diff options
Diffstat (limited to 'apps/plugins/doom')
-rw-r--r-- | apps/plugins/doom/Makefile | 173 | ||||
-rw-r--r-- | apps/plugins/doom/SOURCES | 62 | ||||
-rw-r--r-- | apps/plugins/doom/doom.make | 54 | ||||
-rw-r--r-- | apps/plugins/doom/i_video.c | 2 |
4 files changed, 117 insertions, 174 deletions
diff --git a/apps/plugins/doom/Makefile b/apps/plugins/doom/Makefile deleted file mode 100644 index df6baf704b..0000000000 --- a/apps/plugins/doom/Makefile +++ /dev/null | |||
@@ -1,173 +0,0 @@ | |||
1 | ################################################################ | ||
2 | # | ||
3 | # $Id$ | ||
4 | # | ||
5 | # $Log: Makefile,v $ | ||
6 | # Revision 1.13 2006-12-13 06:52:09 kkurbjun | ||
7 | # Free more plugin memory | ||
8 | # | ||
9 | # Revision 1.12 2006-12-13 05:46:51 kkurbjun | ||
10 | # Will it fit? | ||
11 | # | ||
12 | # Revision 1.11 2006-12-13 04:44:17 kkurbjun | ||
13 | # Dehacked and BEX support for Doom - currently only supports a DEHACKED file in a WAD (not as a standalone file yet). | ||
14 | # | ||
15 | # Revision 1.10 2006-10-27 21:47:55 amiconn | ||
16 | # Next step of Makefile tuning: * Use 'make' internal commands for printing messages. Saves build time especially on cygwin. * SILENT variable used in more places. * Bitmap build system uses one Makefille less. | ||
17 | # | ||
18 | # Revision 1.9 2006-10-23 22:33:36 amiconn | ||
19 | # Consistent style of 'make' messages. Always use ranlib after ar. | ||
20 | # | ||
21 | # Revision 1.8 2006-10-23 14:09:28 markun | ||
22 | # rearrange compiler options to avoid conflicts with header files on FreeBSD | ||
23 | # | ||
24 | # Revision 1.7 2006-10-22 00:21:56 amiconn | ||
25 | # Speed up build process in general by using internal functions of make instead of spawning sub-shells where possible. | ||
26 | # | ||
27 | # Revision 1.6 2006-09-29 20:04:35 barrywardell | ||
28 | # Cleaner implementation of the recent OSX simulator build fix. No need to define SHARED_FLAG in each Makefile. Just have configure create it in the root Makefile instead. | ||
29 | # | ||
30 | # Revision 1.5 2006-09-29 16:15:08 barrywardell | ||
31 | # Allow UI simulator to be build on OS (Slightly updated version of FS5767) | ||
32 | # | ||
33 | # Revision 1.4 2006-07-27 13:27:19 linus | ||
34 | # Moved the X5 button driver to the target tree | ||
35 | # | ||
36 | # Revision 1.3 2006-04-14 21:07:56 kkurbjun | ||
37 | # Start of profiling support for doom. | ||
38 | # | ||
39 | # Revision 1.2 2006-03-29 21:16:45 kkurbjun | ||
40 | # Use rockbox endian defines | ||
41 | # | ||
42 | # Revision 1.1 2006-03-28 15:44:01 dave | ||
43 | # Patch #2969 - Doom! Currently only working on the H300. | ||
44 | # | ||
45 | # | ||
46 | |||
47 | INCLUDES = -I$(APPSDIR) -I.. -I. $(TARGET_INC) -I$(FIRMDIR)/include -I$(FIRMDIR)/export \ | ||
48 | -I$(FIRMDIR)/common -I$(FIRMDIR)/drivers -I$(OUTDIR) -I$(BUILDDIR) | ||
49 | CFLAGS = $(INCLUDES) $(GCCOPTS) $(TARGET) $(EXTRA_DEFINES) \ | ||
50 | -DTARGET_ID=$(TARGET_ID) -DMEM=${MEMORYSIZE} -DPLUGIN \ | ||
51 | -Wno-strict-prototypes $(PROFILE_OPTS) | ||
52 | |||
53 | ifdef APPEXTRA | ||
54 | INCLUDES += $(patsubst %,-I$(APPSDIR)/%,$(subst :, ,$(APPEXTRA))) | ||
55 | endif | ||
56 | |||
57 | # The arm code compiles too large for the plugin buffer when set to optimize for speed | ||
58 | ifeq ($(CPU), arm) | ||
59 | CFLAGS += -Os | ||
60 | ifndef SIMVER | ||
61 | ifeq ($(TARGET), IRIVER_H100) | ||
62 | CFLAGS += -mstructure-size-boundary=8 | ||
63 | endif | ||
64 | endif | ||
65 | else | ||
66 | CFLAGS += -O2 | ||
67 | endif | ||
68 | |||
69 | LINKFILE := $(OBJDIR)/link.lds | ||
70 | DEPFILE = $(OBJDIR)/dep-doom | ||
71 | SRC = info.c doomdef.c doomstat.c dstrings.c tables.c \ | ||
72 | f_finale.c f_wipe.c d_net.c d_items.c g_game.c m_menu.c m_argv.c \ | ||
73 | m_cheat.c m_random.c am_map.c p_ceilng.c p_doors.c p_genlin.c \ | ||
74 | p_enemy.c p_floor.c p_inter.c p_lights.c p_map.c p_maputl.c p_plats.c \ | ||
75 | p_pspr.c p_setup.c p_sight.c p_spec.c p_switch.c p_mobj.c p_telept.c \ | ||
76 | p_tick.c p_saveg.c p_user.c r_bsp.c r_data.c r_draw.c r_main.c \ | ||
77 | r_plane.c r_segs.c r_sky.c r_things.c wi_stuff.c v_video.c st_lib.c \ | ||
78 | st_stuff.c hu_stuff.c hu_lib.c s_sound.c z_zone.c z_bmalloc.c sounds.c \ | ||
79 | d_main.c m_misc.c m_bbox.c i_system.c i_sound.c i_video.c \ | ||
80 | w_wad.c rockdoom.c d_deh.c ../../../firmware/common/sscanf.c | ||
81 | |||
82 | # sscanf isn't built into the core right now - should remove from here if that | ||
83 | # changes | ||
84 | |||
85 | SOURCES = $(SRC) | ||
86 | OBJS := $(SRC:%.c=$(OBJDIR)/%.o) | ||
87 | #OBJS2 := $(SRC:%.c=$(OBJDIR)/%.o) | ||
88 | #OBJS = $(patsubst %.S, $(OBJDIR)/%.o, $(OBJS2)) | ||
89 | DIRS = . | ||
90 | |||
91 | |||
92 | ifndef SIMVER | ||
93 | LDS := ../plugin.lds | ||
94 | OUTPUT = $(OUTDIR)/doom.rock | ||
95 | else ## simulators | ||
96 | OUTPUT = $(OUTDIR)/doom.rock | ||
97 | endif | ||
98 | |||
99 | all: $(OUTPUT) | ||
100 | |||
101 | ifndef SIMVER | ||
102 | $(OBJDIR)/doom.elf: $(OBJS) $(LINKFILE) | ||
103 | $(call PRINTS,LD $(@F))$(CC) $(CFLAGS) -o $@ $(OBJS) -L$(BUILDDIR) -lplugin -lgcc\ | ||
104 | -T$(LINKFILE) -Wl,--gc-sections -Wl,-Map,$(OBJDIR)/doom.map | ||
105 | |||
106 | $(OUTPUT): $(OBJDIR)/doom.elf | ||
107 | $(call PRINTS,OBJCOPY $(@F))$(OC) -O binary $< $@ | ||
108 | else | ||
109 | |||
110 | ifeq ($(SIMVER), x11) | ||
111 | ################################################### | ||
112 | # This is the X11 simulator version | ||
113 | |||
114 | $(OUTPUT): $(OBJS) | ||
115 | $(call PRINTS,LD $(@F))$(CC) $(CFLAGS) $(SHARED_FLAG) $(OBJS) -L$(BUILDDIR) -lplugin -o $@ | ||
116 | ifeq ($(findstring CYGWIN,$(UNAME)),CYGWIN) | ||
117 | # 'x' must be kept or you'll have "Win32 error 5" | ||
118 | # $ fgrep 5 /usr/include/w32api/winerror.h | head -1 | ||
119 | # #define ERROR_ACCESS_DENIED 5L | ||
120 | else | ||
121 | @chmod -x $@ | ||
122 | endif | ||
123 | |||
124 | else # end of x11-simulator | ||
125 | ifeq ($(SIMVER), sdl) | ||
126 | ################################################### | ||
127 | # This is the sdl simulator version | ||
128 | |||
129 | $(OUTPUT): $(OBJS) | ||
130 | $(call PRINTS,LD $(@F))$(CC) $(CFLAGS) $(SHARED_FLAG) $(OBJS) -L$(BUILDDIR) -lplugin -o $@ | ||
131 | ifeq ($(findstring CYGWIN,$(UNAME)),CYGWIN) | ||
132 | # 'x' must be kept or you'll have "Win32 error 5" | ||
133 | # $ fgrep 5 /usr/include/w32api/winerror.h | head -1 | ||
134 | # #define ERROR_ACCESS_DENIED 5L | ||
135 | else | ||
136 | @chmod -x $@ | ||
137 | endif | ||
138 | |||
139 | else # end of sdl-simulator | ||
140 | ################################################### | ||
141 | # This is the win32 simulator version | ||
142 | DLLTOOLFLAGS = --export-all | ||
143 | DLLWRAPFLAGS = -s --entry _DllMain@12 --target=i386-mingw32 -mno-cygwin | ||
144 | |||
145 | $(OUTPUT): $(OBJS) | ||
146 | $(call PRINTS,DLL $(@F))$(DLLTOOL) $(DLLTOOLFLAGS) -z $(OBJDIR)/$*.def $(OBJS) | ||
147 | $(SILENT)$(DLLWRAP) $(DLLWRAPFLAGS) --def $(OBJDIR)/$*.def $(OBJS) \ | ||
148 | $(BUILDDIR)/libplugin.a -o $@ | ||
149 | ifeq ($(findstring CYGWIN,$(UNAME)),CYGWIN) | ||
150 | # 'x' must be kept or you'll have "Win32 error 5" | ||
151 | # $ fgrep 5 /usr/include/w32api/winerror.h | head -1 | ||
152 | # #define ERROR_ACCESS_DENIED 5L | ||
153 | else | ||
154 | @chmod -x $@ | ||
155 | endif | ||
156 | endif # end of win32-simulator | ||
157 | endif | ||
158 | endif # end of simulator section | ||
159 | |||
160 | |||
161 | include $(TOOLSDIR)/make.inc | ||
162 | |||
163 | # MEMORYSIZE should be passed on to this makefile with the chosen memory size | ||
164 | # given in number of MB | ||
165 | $(LINKFILE): $(LDS) | ||
166 | $(call PRINTS,build $(@F))cat $< | $(CC) -DMEMORYSIZE=$(MEMORYSIZE) $(INCLUDES) $(TARGET) $(DEFINES) \ | ||
167 | -E -P - >$@ | ||
168 | |||
169 | clean: | ||
170 | $(call PRINTS,cleaning doom)rm -rf $(OBJDIR)/doom | ||
171 | $(SILENT)rm -f $(OBJDIR)/doom.* $(DEPFILE) | ||
172 | |||
173 | -include $(DEPFILE) | ||
diff --git a/apps/plugins/doom/SOURCES b/apps/plugins/doom/SOURCES new file mode 100644 index 0000000000..6cd69faee6 --- /dev/null +++ b/apps/plugins/doom/SOURCES | |||
@@ -0,0 +1,62 @@ | |||
1 | info.c | ||
2 | doomdef.c | ||
3 | doomstat.c | ||
4 | dstrings.c | ||
5 | tables.c | ||
6 | f_finale.c | ||
7 | f_wipe.c | ||
8 | d_net.c | ||
9 | d_items.c | ||
10 | g_game.c | ||
11 | m_menu.c | ||
12 | m_argv.c | ||
13 | m_cheat.c | ||
14 | m_random.c | ||
15 | am_map.c | ||
16 | p_ceilng.c | ||
17 | p_doors.c | ||
18 | p_genlin.c | ||
19 | p_enemy.c | ||
20 | p_floor.c | ||
21 | p_inter.c | ||
22 | p_lights.c | ||
23 | p_map.c | ||
24 | p_maputl.c | ||
25 | p_plats.c | ||
26 | p_pspr.c | ||
27 | p_setup.c | ||
28 | p_sight.c | ||
29 | p_spec.c | ||
30 | p_switch.c | ||
31 | p_mobj.c | ||
32 | p_telept.c | ||
33 | p_tick.c | ||
34 | p_saveg.c | ||
35 | p_user.c | ||
36 | r_bsp.c | ||
37 | r_data.c | ||
38 | r_draw.c | ||
39 | r_main.c | ||
40 | r_plane.c | ||
41 | r_segs.c | ||
42 | r_sky.c | ||
43 | r_things.c | ||
44 | wi_stuff.c | ||
45 | v_video.c | ||
46 | st_lib.c | ||
47 | st_stuff.c | ||
48 | hu_stuff.c | ||
49 | hu_lib.c | ||
50 | s_sound.c | ||
51 | z_zone.c | ||
52 | z_bmalloc.c | ||
53 | sounds.c | ||
54 | d_main.c | ||
55 | m_misc.c | ||
56 | m_bbox.c | ||
57 | i_system.c | ||
58 | i_sound.c | ||
59 | i_video.c | ||
60 | w_wad.c | ||
61 | rockdoom.c | ||
62 | d_deh.c | ||
diff --git a/apps/plugins/doom/doom.make b/apps/plugins/doom/doom.make new file mode 100644 index 0000000000..d566f5307b --- /dev/null +++ b/apps/plugins/doom/doom.make | |||
@@ -0,0 +1,54 @@ | |||
1 | # __________ __ ___. | ||
2 | # Open \______ \ ____ ____ | | _\_ |__ _______ ___ | ||
3 | # Source | _// _ \_/ ___\| |/ /| __ \ / _ \ \/ / | ||
4 | # Jukebox | | ( <_> ) \___| < | \_\ ( <_> > < < | ||
5 | # Firmware |____|_ /\____/ \___ >__|_ \|___ /\____/__/\_ \ | ||
6 | # \/ \/ \/ \/ \/ | ||
7 | # $Id: Makefile 19082 2008-11-10 23:54:24Z zagor $ | ||
8 | # | ||
9 | |||
10 | DOOMSRCDIR := $(APPSDIR)/plugins/doom | ||
11 | DOOMBUILDDIR := $(BUILDDIR)/apps/plugins/doom | ||
12 | |||
13 | ROCKS += $(DOOMBUILDDIR)/doom.rock | ||
14 | |||
15 | DOOM_SRC := $(call preprocess, $(DOOMSRCDIR)/SOURCES) | ||
16 | DOOM_OBJ := $(call c2obj, $(DOOM_SRC)) | ||
17 | DOOM_OBJ += $(DOOMBUILDDIR)/sscanf.o | ||
18 | |||
19 | # add source files to OTHER_SRC to get automatic dependencies | ||
20 | OTHER_SRC += $(DOOM_SRC) | ||
21 | |||
22 | DOOMCFLAGS = $(PLUGINFLAGS) -Wno-strict-prototypes | ||
23 | |||
24 | # The arm code compiles too large for the plugin buffer when set to optimize for speed | ||
25 | ifeq ($(CPU), arm) | ||
26 | DOOMCFLAGS += -Os | ||
27 | ifndef SIMVER | ||
28 | ifeq ($(TARGET), IRIVER_H100) | ||
29 | DOOMCCFLAGS += -mstructure-size-boundary=8 | ||
30 | endif | ||
31 | endif | ||
32 | else | ||
33 | DOOMCFLAGS += -O2 | ||
34 | endif | ||
35 | |||
36 | $(DOOMBUILDDIR)/sscanf.c: $(FIRMDIR)/common/sscanf.c | ||
37 | $(SILENT)mkdir -p $(dir $@) | ||
38 | $(call PRINTS,CP $<)cp $< $@ | ||
39 | |||
40 | $(DOOMBUILDDIR)/sscanf.o: $(DOOMBUILDDIR)/sscanf.c | ||
41 | |||
42 | $(DOOMBUILDDIR)/doom.rock: $(DOOM_OBJ) | ||
43 | # for some reason, this doesn't match the implicit rule in plugins.make, | ||
44 | # so we have to duplicate the link command here | ||
45 | $(SILENT)$(CC) $(PLUGINFLAGS) -o $*.elf \ | ||
46 | $(filter %.o, $^) \ | ||
47 | $(filter %.a, $^) \ | ||
48 | -lgcc $(PLUGINLDFLAGS) | ||
49 | $(call PRINTS,LD $(@F))$(OC) -O binary $*.elf $@ | ||
50 | |||
51 | # new rule needed to use extra compile flags | ||
52 | $(DOOMBUILDDIR)/%.o: $(DOOMSRCDIR)/%.c $(DOOMSRCDIR)/doom.make | ||
53 | $(SILENT)mkdir -p $(dir $@) | ||
54 | $(call PRINTS,CC $(subst $(ROOTDIR)/,,$<))$(CC) $(DOOMCFLAGS) -c $< -o $@ | ||
diff --git a/apps/plugins/doom/i_video.c b/apps/plugins/doom/i_video.c index 15d0166733..7713fe19f2 100644 --- a/apps/plugins/doom/i_video.c +++ b/apps/plugins/doom/i_video.c | |||
@@ -117,7 +117,7 @@ | |||
117 | #include "rockmacros.h" | 117 | #include "rockmacros.h" |
118 | 118 | ||
119 | #ifndef HAVE_LCD_COLOR | 119 | #ifndef HAVE_LCD_COLOR |
120 | #include "../lib/grey.h" | 120 | #include "lib/grey.h" |
121 | GREY_INFO_STRUCT_IRAM | 121 | GREY_INFO_STRUCT_IRAM |
122 | static unsigned char greybuffer[LCD_WIDTH] IBSS_ATTR; /* off screen buffer */ | 122 | static unsigned char greybuffer[LCD_WIDTH] IBSS_ATTR; /* off screen buffer */ |
123 | static unsigned char *gbuf; | 123 | static unsigned char *gbuf; |