summaryrefslogtreecommitdiffstats
path: root/apps/plugins/sdl/sdl.make
diff options
context:
space:
mode:
authorFranklin Wei <git@fwei.tk>2019-07-07 22:00:20 -0400
committerFranklin Wei <git@fwei.tk>2019-07-09 11:20:55 -0400
commit3f59fc8b771625aca9c3aefe03cf1038d8461963 (patch)
treee0623a323613baa0b0993411b38bcaed144b27ed /apps/plugins/sdl/sdl.make
parent439a0d1d91fa040d261fc39b87278bc9f5391dcc (diff)
downloadrockbox-3f59fc8b771625aca9c3aefe03cf1038d8461963.tar.gz
rockbox-3f59fc8b771625aca9c3aefe03cf1038d8461963.tar.bz2
rockbox-3f59fc8b771625aca9c3aefe03cf1038d8461963.zip
Wolfenstein 3-D!
This is a port of Wolf4SDL, which is derived from the original id software source release. The port runs on top of the SDL plugin runtime and is loaded as an overlay. Licensing of the game code is not an issue, as discussed below (essentially, the Debian project treats Wolf4SDL as GPLv2, with an email from John Carmack backing it up): http://forums.rockbox.org/index.php?topic=52872 Included is a copy of MAME's Yamaha OPL sound chip emulator (fmopl_gpl.c). This file was not part of the original Wolf4SDL source (which includes a non-GPL'd version), but was rather rebased from from a later MAME source which had been relicensed to GPLv2. Change-Id: I64c2ba035e0be7e2f49252f40640641416613439
Diffstat (limited to 'apps/plugins/sdl/sdl.make')
-rw-r--r--apps/plugins/sdl/sdl.make29
1 files changed, 27 insertions, 2 deletions
diff --git a/apps/plugins/sdl/sdl.make b/apps/plugins/sdl/sdl.make
index 98346389fc..871eac77d8 100644
--- a/apps/plugins/sdl/sdl.make
+++ b/apps/plugins/sdl/sdl.make
@@ -12,12 +12,14 @@ SDL_OBJDIR := $(BUILDDIR)/apps/plugins/sdl
SDL_SRC := $(call preprocess, $(SDL_SRCDIR)/SOURCES)
DUKE3D_SRC := $(call preprocess, $(SDL_SRCDIR)/SOURCES.duke)
+WOLF3D_SRC := $(call preprocess, $(SDL_SRCDIR)/SOURCES.wolf)
SDL_OBJ := $(call c2obj, $(SDL_SRC))
DUKE3D_OBJ = $(call c2obj, $(DUKE3D_SRC))
+WOLF3D_OBJ = $(call c2obj, $(WOLF3D_SRC))
# add source files to OTHER_SRC to get automatic dependencies
-OTHER_SRC += $(SDL_SRC) $(DUKE3D_SRC)
+OTHER_SRC += $(SDL_SRC) $(DUKE3D_SRC) $(WOLF3D_SRC)
OTHER_INC += -I$(SDL_SRCDIR)/include
# include comes first because of possible system SDL headers taking
@@ -31,14 +33,18 @@ endif
ifndef APP_TYPE
### no target has a big enough plugin buffer
- ROCKS += $(SDL_OBJDIR)/duke3d.ovl
+ ROCKS += $(SDL_OBJDIR)/duke3d.ovl $(SDL_OBJDIR)/wolf3d.ovl
DUKE3D_OUTLDS = $(SDL_OBJDIR)/duke3d.link
+ WOLF3D_OUTLDS = $(SDL_OBJDIR)/wolf3d.link
SDL_OVLFLAGS = -T$(DUKE3D_OUTLDS) -Wl,--gc-sections -Wl,-Map,$(basename $@).map
else
### simulator
ROCKS += $(SDL_OBJDIR)/duke3d.rock
+ ROCKS += $(SDL_OBJDIR)/wolf3d.rock
endif
+# Duke3D
+
$(SDL_OBJDIR)/duke3d.rock: $(SDL_OBJ) $(DUKE3D_OBJ) $(TLSFLIB)
$(SDL_OBJDIR)/duke3d.refmap: $(SDL_OBJ) $(DUKE3D_OBJ) $(TLSFLIB)
@@ -54,6 +60,25 @@ $(SDL_OBJDIR)/duke3d.ovl: $(SDL_OBJ) $(DUKE3D_OBJ) $(TLSFLIB) $(DUKE3D_OUTLDS)
-lgcc $(SDL_OVLFLAGS)
$(call PRINTS,LD $(@F))$(call objcopy,$(basename $@).elf,$@)
+# Wolf3D
+
+$(SDL_OBJDIR)/wolf3d.rock: $(SDL_OBJ) $(WOLF3D_OBJ) $(TLSFLIB)
+
+$(SDL_OBJDIR)/wolf3d.refmap: $(SDL_OBJ) $(WOLF3D_OBJ) $(TLSFLIB)
+
+$(WOLF3D_OUTLDS): $(PLUGIN_LDS) $(SDL_OBJDIR)/wolf3d.refmap
+ $(call PRINTS,PP $(@F))$(call preprocess2file,$<,$@,-DOVERLAY_OFFSET=$(shell \
+ $(TOOLSDIR)/ovl_offset.pl $(SDL_OBJDIR)/wolf3d.refmap))
+
+$(SDL_OBJDIR)/wolf3d.ovl: $(SDL_OBJ) $(WOLF3D_OBJ) $(TLSFLIB) $(WOLF3D_OUTLDS)
+ $(SILENT)$(CC) $(PLUGINFLAGS) -o $(basename $@).elf \
+ $(filter %.o, $^) \
+ $(filter %.a, $+) \
+ -lgcc $(SDL_OVLFLAGS)
+ $(call PRINTS,LD $(@F))$(call objcopy,$(basename $@).elf,$@)
+
+# common
+
$(SDL_OBJDIR)/%.o: $(SDL_SRCDIR)/%.c $(SDL_SRCDIR)/sdl.make $(BUILDDIR)/sysfont.h
$(SILENT)mkdir -p $(dir $@)
$(call PRINTS,CC $(subst $(ROOTDIR)/,,$<))$(CC) -I$(dir $<) $(SDLFLAGS) -c $< -o $@