Port of chocolate-doom (v2.2.1)

"Chocolate Doom is a Doom source port that accurately reproduces the
experience of Doom as it was played in the 1990s."

Fixes #2.
This commit is contained in:
Josef Söntgen
2014-02-10 21:53:43 +01:00
committed by Norman Feske
parent 2f4eeec662
commit 2309044145
9 changed files with 421 additions and 0 deletions

View File

@@ -0,0 +1 @@
ff160dca7cf576e9e842e72f6f2724624e47d07a

10
ports/chocolate-doom.port Normal file
View File

@@ -0,0 +1,10 @@
LICENSE := GPLv2
VERSION := 2.2.1
DOWNLOADS := chocolate-doom.archive
BASE_URL := http://www.chocolate-doom.org/downloads/$(VERSION)
URL(chocolate-doom) := $(BASE_URL)/chocolate-doom-$(VERSION).tar.gz
SHA(chocolate-doom) := be0f2b5d642beca8c9ef21ad0472ee9329bc2a78
SIG(chocolate-doom) := ${URL(chocolate-doom)}.asc
KEY(chocolate-doom) := 23354344
DIR(chocolate-doom) := src/app/chocolate-doom

209
run/chocolate-doom.run Normal file
View File

@@ -0,0 +1,209 @@
#
# Build
#
if {[have_include "power_on/qemu"]} {
puts "\nRunning on Qemu is not recommended.\n"
exit 1
}
#
# On x86 systems w/o ps2 only use usb input
#
set use_usb_input_only 0
set use_audio [expr ![have_spec arm]]
set build_components {
core init
drivers/timer
server/tar_fs
drivers/framebuffer
drivers/input
app/chocolate-doom/doom
}
if {[have_spec linux]} {
set use_usb_input_only 1
}
lappend_if $use_audio build_components drivers/audio
source ${genode_dir}/repos/base/run/platform_drv.inc
append_platform_drv_build_components
lappend_if [expr ![have_spec linux]] build_components drivers/usb
lappend_if [expr !$use_usb_input_only] build_components server/input_merger
build $build_components
create_boot_directory
#
# Generate config
#
append config {
<config>
<parent-provides>
<service name="ROM"/>
<service name="RAM"/>
<service name="IRQ"/>
<service name="IO_MEM"/>
<service name="IO_PORT"/>
<service name="CAP"/>
<service name="PD"/>
<service name="RM"/>
<service name="CPU"/>
<service name="LOG"/>
<service name="SIGNAL"/>
</parent-provides>
<default-route>
<any-service> <parent/> <any-child/> </any-service>
</default-route>
<start name="timer">
<resource name="RAM" quantum="1M"/>
<provides><service name="Timer"/></provides>
</start>}
append_if [have_spec sdl] config {
<start name="fb_sdl">
<resource name="RAM" quantum="4M"/>
<provides>
<service name="Input"/>
<service name="Framebuffer"/>
</provides>
</start>}
append_platform_drv_config
append_if [have_spec vesa] config {
<start name="fb_drv">
<resource name="RAM" quantum="10M"/>
<provides><service name="Framebuffer"/></provides>
<config buffered="yes"/>
</start>}
append_if [have_spec pl11x] config {
<start name="fb_drv">
<resource name="RAM" quantum="2M"/>
<provides><service name="Framebuffer"/></provides>
</start>}
append_if [expr [have_spec ps2] && !$use_usb_input_only] config {
<start name="ps2_drv">
<resource name="RAM" quantum="1M"/>
<provides><service name="Input"/></provides>
</start>}
append_if [expr ![have_spec linux]] config {
<start name="usb_drv">
<resource name="RAM" quantum="12M"/>
<provides><service name="Input"/></provides>
<config uhci="yes" ehci="yes" xhci="yes">
<hid/>
</config>
</start>}
append_if $use_audio config {
<start name="audio_drv">
<resource name="RAM" quantum="8M"/>
<provides><service name="Audio_out"/></provides>
</start>}
append_if [expr !$use_usb_input_only] config {
<start name="input_merger">
<resource name="RAM" quantum="1M" />
<provides>
<service name="Input" />
</provides>
<config>
<input label="ps2" />
<input label="usb_hid" />
</config>
<route>
<service name="Input" label="ps2"> <child name="ps2_drv" /> </service>
<service name="Input" label="usb_hid"> <child name="usb_drv" /> </service>
<any-service> <parent /> <any-child /> </any-service>
</route>
</start>}
append config {
<start name="tar_fs">
<resource name="RAM" quantum="4M"/>
<provides> <service name="File_system"/> </provides>
<config>
<archive name="data.tar" />
<policy label="chocolate-doom -> wads" root="/wads" />
</config>
</start>
<start name="chocolate-doom">
<resource name="RAM" quantum="16M"/>
<config>
<sdl_audio_volume value="100"/>
<libc stdout="/dev/log" stderr="/dev/log">
<vfs>
<dir name="dev"> <log/> </dir>
<fs label="wads"/>
</vfs>
</libc>
</config>
<route>}
append_if [expr !$use_usb_input_only] config {
<service name="Input"><child name="input_merger" /></service>}
append config {
<any-service> <parent /> <any-child /></any-service>
</route>
</start>
</config>}
install_config $config
if {![file exists bin/data.tar]} {
if {![file exists bin/doom1.wad]} {
puts ""
puts "Please download the Doom 1 Shareware IWAD from"
puts " http://distro.ibiblio.org/pub/linux/distributions/slitaz/sources/packages/d/doom1.wad"
puts "and place it in './bin'. Afterwards run this script again."
puts ""
exit 1
}
catch { exec mkdir bin/wads }
catch { exec cp bin/doom1.wad bin/wads }
exec tar cf bin/data.tar -C bin wads
}
#
# Boot modules
#
# generic modules
set boot_modules {
core init timer tar_fs
chocolate-doom
ld.lib.so
libc.lib.so libm.lib.so sdl.lib.so sdl_net.lib.so
sdl_mixer.lib.so pthread.lib.so
data.tar
}
# platform-specific modules
append_platform_drv_boot_modules
lappend_if $use_audio boot_modules audio_drv
lappend_if [have_spec linux] boot_modules fb_sdl
lappend_if [have_spec vesa] boot_modules fb_drv
lappend_if [expr ![have_spec linux]] boot_modules usb_drv
lappend_if [expr !$use_usb_input_only] boot_modules input_merger
lappend_if [expr [have_spec ps2] && !$use_usb_input_only] boot_modules ps2_drv
lappend_if [have_spec pl11x] boot_modules fb_drv
build_boot_image $boot_modules
run_genode_until forever

View File

@@ -0,0 +1,89 @@
/* config.h. Generated from config.hin by configure. */
/* config.hin. Generated from configure.ac by autoheader. */
/* Define to 1 if you have the <dev/isa/spkrio.h> header file. */
/* #undef HAVE_DEV_ISA_SPKRIO_H */
/* Define to 1 if you have the <dev/speaker/speaker.h> header file. */
/* #undef HAVE_DEV_SPEAKER_SPEAKER_H */
/* Define to 1 if you have the <inttypes.h> header file. */
#define HAVE_INTTYPES_H 1
/* Define to 1 if you have the `ioperm' function. */
/* #undef HAVE_IOPERM */
/* Define to 1 if you have the `amd64' library (-lamd64). */
/* #undef HAVE_LIBAMD64 */
/* Define to 1 if you have the `i386' library (-li386). */
/* #undef HAVE_LIBI386 */
/* Define to 1 if you have the `m' library (-lm). */
#define HAVE_LIBM 1
/* Define to 1 if you have the `samplerate' library (-lsamplerate). */
/* #undef HAVE_LIBSAMPLERATE */
/* Define to 1 if you have the <linux/kd.h> header file. */
/* #undef HAVE_LINUX_KD_H */
/* Define to 1 if you have the <memory.h> header file. */
#define HAVE_MEMORY_H 1
/* Define to 1 if you have the `mmap' function. */
#define HAVE_MMAP 1
/* Define to 1 if you have the `sched_setaffinity' function. */
/* #undef HAVE_SCHED_SETAFFINITY */
/* Define to 1 if you have the <stdint.h> header file. */
#define HAVE_STDINT_H 1
/* Define to 1 if you have the <stdlib.h> header file. */
#define HAVE_STDLIB_H 1
/* Define to 1 if you have the <strings.h> header file. */
#define HAVE_STRINGS_H 1
/* Define to 1 if you have the <string.h> header file. */
#define HAVE_STRING_H 1
/* Define to 1 if you have the <sys/stat.h> header file. */
#define HAVE_SYS_STAT_H 1
/* Define to 1 if you have the <sys/types.h> header file. */
#define HAVE_SYS_TYPES_H 1
/* Define to 1 if you have the <unistd.h> header file. */
#define HAVE_UNISTD_H 1
/* Name of package */
#define PACKAGE "chocolate-doom"
/* Define to the address where bug reports for this package should be sent. */
#define PACKAGE_BUGREPORT "fraggle@gmail.com"
/* Define to the full name of this package. */
#define PACKAGE_NAME "Chocolate Doom"
/* Define to the full name and version of this package. */
#define PACKAGE_STRING "Chocolate Doom 2.0.0"
/* Define to the one symbol short name of this package. */
#define PACKAGE_TARNAME "chocolate-doom"
/* Define to the home page for this package. */
#define PACKAGE_URL ""
/* Define to the version of this package. */
#define PACKAGE_VERSION "2.0.0"
/* Change this when you create your awesome forked version */
#define PROGRAM_PREFIX "chocolate-"
/* Define to 1 if you have the ANSI C header files. */
#define STDC_HEADERS 1
/* Version number of package */
#define VERSION "2.0.0"

View File

@@ -0,0 +1,6 @@
GAME = doom
TARGET=chocolate-$(GAME)
include $(PRG_DIR)/../target.inc

View File

@@ -0,0 +1,6 @@
GAME = heretic
TARGET=chocolate-$(GAME)
include $(PRG_DIR)/../target.inc

View File

@@ -0,0 +1,6 @@
GAME = hexen
TARGET=chocolate-$(GAME)
include $(PRG_DIR)/../target.inc

View File

@@ -0,0 +1,6 @@
GAME = strife
TARGET=chocolate-$(GAME)
include $(PRG_DIR)/../target.inc

View File

@@ -0,0 +1,88 @@
CHOCOLATE_DOOM_DIR = $(call select_from_ports,chocolate-doom)/src/app/chocolate-doom
# textscreen
SRC_C += $(notdir $(wildcard $(CHOCOLATE_DOOM_DIR)/textscreen/*.c))
# opl
SRC_C += $(notdir $(wildcard $(CHOCOLATE_DOOM_DIR)/opl/*.c))
# pcsound
SRC_C += $(notdir $(wildcard $(CHOCOLATE_DOOM_DIR)/pcsound/*.c))
# common engine source
SRC_C += \
aes_prng.c \
d_event.c \
d_iwad.c \
d_loop.c \
d_mode.c \
deh_io.c \
deh_main.c \
deh_mapping.c \
deh_str.c \
deh_text.c \
gusconf.c \
i_cdmus.c \
i_endoom.c \
i_joystick.c \
i_main.c \
i_oplmusic.c \
i_pcsound.c \
i_scale.c \
i_sdlmusic.c \
i_sdlsound.c \
i_sound.c \
i_system.c \
i_timer.c \
i_video.c \
i_videohr.c \
m_argv.c \
m_bbox.c \
m_cheat.c \
m_config.c \
m_controls.c \
m_fixed.c \
m_misc.c \
memio.c \
midifile.c \
mus2mid.c \
net_client.c \
net_common.c \
net_dedicated.c \
net_gui.c \
net_io.c \
net_loop.c \
net_packet.c \
net_query.c \
net_sdl.c \
net_server.c \
net_structrw.c \
sha1.c \
tables.c \
v_video.c \
w_checksum.c \
w_file.c \
w_file_posix.c \
w_file_stdc.c \
w_file_win32.c \
w_main.c \
w_merge.c \
w_wad.c \
z_zone.c
# game src
SRC_C += $(notdir $(wildcard $(CHOCOLATE_DOOM_DIR)/src/$(GAME)/*.c))
vpath %.c $(CHOCOLATE_DOOM_DIR)/opl
vpath %.c $(CHOCOLATE_DOOM_DIR)/pcsound
vpath %.c $(CHOCOLATE_DOOM_DIR)/src
vpath %.c $(CHOCOLATE_DOOM_DIR)/src/$(GAME)
vpath %.c $(CHOCOLATE_DOOM_DIR)/textscreen
INC_DIR += $(PRG_DIR)/..
INC_DIR += $(CHOCOLATE_DOOM_DIR)/opl
INC_DIR += $(CHOCOLATE_DOOM_DIR)/pcsound
INC_DIR += $(CHOCOLATE_DOOM_DIR)/src
INC_DIR += $(CHOCOLATE_DOOM_DIR)/src/$(GAME)
INC_DIR += $(CHOCOLATE_DOOM_DIR)/textscreen
LIBS = libc libm sdl sdl_mixer sdl_net
# vi:set ft=make :