1
0
Fork 0
forked from len0rd/rockbox
This ports id Software's Quake to run on the SDL plugin runtime. The
source code originated from id under the GPLv2 license. I used
https://github.com/ahefner/sdlquake as the base of my port.

Performance is, unsurprisingly, not on par with what you're probably
used to on PC. I average about 10FPS on ipod6g, but it's still
playable.

Sound works well enough, but in-game music is not supported. I've
written ARM assembly routines for the inner sound loop. Make sure you
turn the "brightness" all the way down, or colors will look funky.

To run, extract Quake's data files to /.rockbox/quake. Have fun!

Change-Id: I4285036e967d7f0722802d43cf2096c808ca5799
This commit is contained in:
Franklin Wei 2018-02-11 15:34:30 -05:00
parent b70fecf21d
commit 5d05b9d3e9
171 changed files with 64268 additions and 20 deletions

View file

@ -13,34 +13,46 @@ 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)
QUAKE_SRC := $(call preprocess, $(SDL_SRCDIR)/SOURCES.quake)
SDL_OBJ := $(call c2obj, $(SDL_SRC))
DUKE3D_OBJ = $(call c2obj, $(DUKE3D_SRC))
WOLF3D_OBJ = $(call c2obj, $(WOLF3D_SRC))
QUAKE_OBJ = $(call c2obj, $(QUAKE_SRC))
# add source files to OTHER_SRC to get automatic dependencies
OTHER_SRC += $(SDL_SRC) $(DUKE3D_SRC) $(WOLF3D_SRC)
OTHER_SRC += $(SDL_SRC) $(DUKE3D_SRC) $(WOLF3D_SRC) $(QUAKE_SRC)
OTHER_INC += -I$(SDL_SRCDIR)/include
# include comes first because of possible system SDL headers taking
# precedence
SDLFLAGS = -I$(SDL_SRCDIR)/include $(filter-out -O%,$(PLUGINFLAGS)) \
-O3 -Wno-unused-parameter -Xpreprocessor -Wno-undef -Wcast-align -w
# some of these are for Quake only
SDLFLAGS = -I$(SDL_SRCDIR)/include $(filter-out -O%,$(PLUGINFLAGS)) \
-O3 -Wno-unused-parameter -Xpreprocessor -Wno-undef -Wcast-align \
-ffast-math -funroll-loops -fomit-frame-pointer -fexpensive-optimizations \
-D_GNU_SOURCE=1 -D_REENTRANT -DSDL -DELF -w # disable all warnings
# use FPU on ARMv6
ifeq ($(ARCH_VERSION),6)
SDLFLAGS += -mfloat-abi=softfp
endif
ifndef APP_TYPE
### no target has a big enough plugin buffer
ROCKS += $(SDL_OBJDIR)/duke3d.ovl $(SDL_OBJDIR)/wolf3d.ovl
ROCKS += $(SDL_OBJDIR)/duke3d.ovl
ROCKS += $(SDL_OBJDIR)/wolf3d.ovl
ROCKS += $(SDL_OBJDIR)/quake.ovl
DUKE3D_OUTLDS = $(SDL_OBJDIR)/duke3d.link
WOLF3D_OUTLDS = $(SDL_OBJDIR)/wolf3d.link
QUAKE_OUTLDS = $(SDL_OBJDIR)/quake.link
SDL_OVLFLAGS = -Wl,--gc-sections -Wl,-Map,$(basename $@).map
else
### simulator
ROCKS += $(SDL_OBJDIR)/duke3d.rock
ROCKS += $(SDL_OBJDIR)/wolf3d.rock
ROCKS += $(SDL_OBJDIR)/quake.rock
endif
# Duke3D
@ -77,6 +89,26 @@ $(SDL_OBJDIR)/wolf3d.ovl: $(SDL_OBJ) $(WOLF3D_OBJ) $(TLSFLIB) $(WOLF3D_OUTLDS)
-lgcc -T$(WOLF3D_OUTLDS) $(SDL_OVLFLAGS)
$(call PRINTS,LD $(@F))$(call objcopy,$(basename $@).elf,$@)
# Quake
###
$(SDL_OBJDIR)/quake.rock: $(SDL_OBJ) $(QUAKE_OBJ) $(TLSFLIB)
$(SDL_OBJDIR)/quake.refmap: $(SDL_OBJ) $(QUAKE_OBJ) $(TLSFLIB)
$(QUAKE_OUTLDS): $(PLUGIN_LDS) $(SDL_OBJDIR)/quake.refmap
$(call PRINTS,PP $(@F))$(call preprocess2file,$<,$@,-DOVERLAY_OFFSET=$(shell \
$(TOOLSDIR)/ovl_offset.pl $(SDL_OBJDIR)/quake.refmap))
$(SDL_OBJDIR)/quake.ovl: $(SDL_OBJ) $(QUAKE_OBJ) $(TLSFLIB) $(QUAKE_OUTLDS)
$(SILENT)$(CC) $(PLUGINFLAGS) -o $(basename $@).elf \
$(filter %.o, $^) \
$(filter %.a, $+) \
-lgcc -T$(QUAKE_OUTLDS) $(SDL_OVLFLAGS)
$(call PRINTS,LD $(@F))$(call objcopy,$(basename $@).elf,$@)
###
# common
$(SDL_OBJDIR)/%.o: $(SDL_SRCDIR)/%.c $(SDL_SRCDIR)/sdl.make $(BUILDDIR)/sysfont.h