summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorKarl Kurbjun <kkurbjun@gmail.com>2007-01-17 18:52:24 +0000
committerKarl Kurbjun <kkurbjun@gmail.com>2007-01-17 18:52:24 +0000
commitb47a43aa2866dbac7cc63b7a0f18d20b3b38883d (patch)
treed8bf3cc0b3c1c296e0cfd5ede1790968c4ce475f
parent3b65fc2480929ade2686bb7ee3413a0f78f7c36a (diff)
downloadrockbox-b47a43aa2866dbac7cc63b7a0f18d20b3b38883d.tar.gz
rockbox-b47a43aa2866dbac7cc63b7a0f18d20b3b38883d.zip
Doom for the Gigabeat and some code reduction
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@12051 a1c6a512-1295-4272-9138-f99709370657
-rw-r--r--apps/plugins/doom/Makefile6
-rw-r--r--apps/plugins/doom/d_main.h2
-rw-r--r--apps/plugins/doom/doomdef.c8
-rw-r--r--apps/plugins/doom/doomdef.h18
-rw-r--r--apps/plugins/doom/doomstat.c2
-rw-r--r--apps/plugins/doom/doomstat.h2
-rw-r--r--apps/plugins/doom/g_game.c4
-rw-r--r--apps/plugins/doom/i_sound.c2
-rw-r--r--apps/plugins/doom/i_system.c6
-rw-r--r--apps/plugins/doom/i_video.c80
-rw-r--r--apps/plugins/doom/m_misc.c6
-rw-r--r--apps/plugins/doom/r_bsp.c2
-rw-r--r--apps/plugins/doom/r_defs.h4
-rw-r--r--apps/plugins/doom/r_main.c2
-rw-r--r--apps/plugins/doom/r_plane.c14
-rw-r--r--apps/plugins/doom/r_segs.c2
-rw-r--r--apps/plugins/doom/r_state.h2
-rw-r--r--apps/plugins/doom/r_things.c10
-rw-r--r--apps/plugins/doom/r_things.h4
-rw-r--r--apps/plugins/doom/rockdoom.c291
-rw-r--r--apps/plugins/doom/rockmacros.h2
-rw-r--r--apps/plugins/doom/s_sound.c30
-rw-r--r--apps/plugins/doom/w_wad.c10
-rw-r--r--apps/plugins/doom/z_zone.c3
24 files changed, 241 insertions, 271 deletions
diff --git a/apps/plugins/doom/Makefile b/apps/plugins/doom/Makefile
index 3565612709..a90a864f36 100644
--- a/apps/plugins/doom/Makefile
+++ b/apps/plugins/doom/Makefile
@@ -2,8 +2,8 @@
2# 2#
3# $Id$ 3# $Id$
4# 4#
5# $Log$ 5# $Log: Makefile,v $
6# Revision 1.13 2006/12/13 06:52:09 kkurbjun 6# Revision 1.13 2006-12-13 06:52:09 kkurbjun
7# Free more plugin memory 7# Free more plugin memory
8# 8#
9# Revision 1.12 2006-12-13 05:46:51 kkurbjun 9# Revision 1.12 2006-12-13 05:46:51 kkurbjun
@@ -56,7 +56,7 @@ endif
56 56
57# The arm code compiles too large for the plugin buffer when set to optimize for speed 57# The arm code compiles too large for the plugin buffer when set to optimize for speed
58#ifeq ($(CC), arm-elf-gcc) 58#ifeq ($(CC), arm-elf-gcc)
59ifneq (,$(strip $(foreach tgt,SANSA_E200 IPOD_NANO IPOD_COLOR IPOD_VIDEO IPOD_MINI IPOD_3G IPOD_4G IRIVER_H10_5GB IRIVER_H10,$(findstring $(tgt),$(TARGET))))) 59ifneq (,$(strip $(foreach tgt,SANSA_E200 IPOD_NANO IPOD_COLOR IPOD_VIDEO IPOD_MINI IPOD_3G IPOD_4G IRIVER_H10_5GB IRIVER_H10 GIGABEAT_F,$(findstring $(tgt),$(TARGET)))))
60 CFLAGS += -Os 60 CFLAGS += -Os
61ifndef SIMVER 61ifndef SIMVER
62ifeq ($(TARGET), IRIVER_H100) 62ifeq ($(TARGET), IRIVER_H100)
diff --git a/apps/plugins/doom/d_main.h b/apps/plugins/doom/d_main.h
index c7a861e9ac..3700c482bd 100644
--- a/apps/plugins/doom/d_main.h
+++ b/apps/plugins/doom/d_main.h
@@ -49,7 +49,7 @@ extern boolean clrespawnparm; // checkparm of -respawn
49extern boolean clfastparm; // checkparm of -fast 49extern boolean clfastparm; // checkparm of -fast
50//jff end of external declaration of command line playmode 50//jff end of external declaration of command line playmode
51 51
52extern boolean nosfxparm; 52extern boolean enable_sound;
53extern boolean nomusicparm; 53extern boolean nomusicparm;
54extern int ffmap; 54extern int ffmap;
55 55
diff --git a/apps/plugins/doom/doomdef.c b/apps/plugins/doom/doomdef.c
index d4ad61e979..3facfbb299 100644
--- a/apps/plugins/doom/doomdef.c
+++ b/apps/plugins/doom/doomdef.c
@@ -33,7 +33,9 @@
33#include "doomdef.h" 33#include "doomdef.h"
34 34
35// Location for any defines turned variables. 35// Location for any defines turned variables.
36 36#if(LCD_HEIGHT>LCD_WIDTH)
37// None. 37bool rotate_screen=0;
38 38int SCREENWIDTH;
39int SCREENHEIGHT;
40#endif
39 41
diff --git a/apps/plugins/doom/doomdef.h b/apps/plugins/doom/doomdef.h
index be586a511f..a0e8ad50bc 100644
--- a/apps/plugins/doom/doomdef.h
+++ b/apps/plugins/doom/doomdef.h
@@ -33,6 +33,8 @@
33#ifndef __DOOMDEF__ 33#ifndef __DOOMDEF__
34#define __DOOMDEF__ 34#define __DOOMDEF__
35 35
36#include "rockmacros.h"
37
36// killough 4/25/98: Make gcc extensions mean nothing on other compilers 38// killough 4/25/98: Make gcc extensions mean nothing on other compilers
37#ifndef __GNUC__ 39#ifndef __GNUC__
38#define __attribute__(x) 40#define __attribute__(x)
@@ -88,14 +90,20 @@ typedef enum {
88// allows us to avoid the overhead of dynamic allocation 90// allows us to avoid the overhead of dynamic allocation
89// when multiple screen sizes are supported 91// when multiple screen sizes are supported
90 92
93#if(LCD_HEIGHT>LCD_WIDTH)
94extern bool rotate_screen;
91// proff 08/17/98: Changed for high-res 95// proff 08/17/98: Changed for high-res
92#define MAX_SCREENWIDTH 1600 96#define MAX_SCREENWIDTH LCD_HEIGHT
93#define MAX_SCREENHEIGHT 1200 97#define MAX_SCREENHEIGHT LCD_HEIGHT
94 98extern int SCREENWIDTH;
99extern int SCREENHEIGHT;
100#else
101// proff 08/17/98: Changed for high-res
102#define MAX_SCREENWIDTH LCD_WIDTH
103#define MAX_SCREENHEIGHT LCD_HEIGHT
95#define SCREENWIDTH LCD_WIDTH 104#define SCREENWIDTH LCD_WIDTH
96//#define SCREENWIDTH 320
97//#define SCREENHEIGHT 200
98#define SCREENHEIGHT LCD_HEIGHT 105#define SCREENHEIGHT LCD_HEIGHT
106#endif
99 107
100// The maximum number of players, multiplayer/networking. 108// The maximum number of players, multiplayer/networking.
101#define MAXPLAYERS 4 109#define MAXPLAYERS 4
diff --git a/apps/plugins/doom/doomstat.c b/apps/plugins/doom/doomstat.c
index 75cc209919..b6dc649d1b 100644
--- a/apps/plugins/doom/doomstat.c
+++ b/apps/plugins/doom/doomstat.c
@@ -100,5 +100,5 @@ int doom_weapon_toggles; // killough 10/98
100 100
101int monkeys IBSS_ATTR, default_monkeys; 101int monkeys IBSS_ATTR, default_monkeys;
102 102
103boolean nosfxparm=0; 103boolean enable_sound=1;
104boolean rockblock=1; 104boolean rockblock=1;
diff --git a/apps/plugins/doom/doomstat.h b/apps/plugins/doom/doomstat.h
index 42cd4f5716..5a5a87c3c5 100644
--- a/apps/plugins/doom/doomstat.h
+++ b/apps/plugins/doom/doomstat.h
@@ -115,7 +115,7 @@ enum {
115 115
116extern int comp[COMP_TOTAL], default_comp[COMP_TOTAL]; 116extern int comp[COMP_TOTAL], default_comp[COMP_TOTAL];
117 117
118extern boolean nosfxparm; 118extern boolean enable_sound;
119extern boolean rockblock; 119extern boolean rockblock;
120 120
121// ------------------------------------------- 121// -------------------------------------------
diff --git a/apps/plugins/doom/g_game.c b/apps/plugins/doom/g_game.c
index cd6ab45ade..8b5e222082 100644
--- a/apps/plugins/doom/g_game.c
+++ b/apps/plugins/doom/g_game.c
@@ -2773,11 +2773,11 @@ boolean G_CheckDemoStatus (void)
2773 int fd=open(GAMEBASE "timedemo.txt",O_WRONLY | O_CREAT); 2773 int fd=open(GAMEBASE "timedemo.txt",O_WRONLY | O_CREAT);
2774 fdprintf (fd,"Timed %d gametics in %d realtics = %d frames per second", 2774 fdprintf (fd,"Timed %d gametics in %d realtics = %d frames per second",
2775 (unsigned) gametic, realtics, 2775 (unsigned) gametic, realtics,
2776 (unsigned) gametic * (double) TICRATE / realtics); 2776 (unsigned) gametic * TICRATE/ realtics);
2777 close(fd); 2777 close(fd);
2778 I_Error ("%d gametics in %d realtics", 2778 I_Error ("%d gametics in %d realtics",
2779 (unsigned) gametic,realtics, 2779 (unsigned) gametic,realtics,
2780 (unsigned) gametic * (double) TICRATE / realtics); 2780 (unsigned) gametic * TICRATE / realtics);
2781 return false; 2781 return false;
2782 } 2782 }
2783 2783
diff --git a/apps/plugins/doom/i_sound.c b/apps/plugins/doom/i_sound.c
index 0f9e6edd19..34e838287e 100644
--- a/apps/plugins/doom/i_sound.c
+++ b/apps/plugins/doom/i_sound.c
@@ -472,7 +472,7 @@ void get_more(unsigned char** start, size_t* size)
472 472
473void I_SubmitSound(void) 473void I_SubmitSound(void)
474{ 474{
475 if (nosfxparm) 475 if (!enable_sound)
476 return; 476 return;
477 477
478 rb->pcm_play_data(&get_more, NULL, 0); 478 rb->pcm_play_data(&get_more, NULL, 0);
diff --git a/apps/plugins/doom/i_system.c b/apps/plugins/doom/i_system.c
index bf1aef63e1..95ea7a8f68 100644
--- a/apps/plugins/doom/i_system.c
+++ b/apps/plugins/doom/i_system.c
@@ -15,8 +15,8 @@
15// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 15// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
16// GNU General Public License for more details. 16// GNU General Public License for more details.
17// 17//
18// $Log$ 18// $Log: i_system.c,v $
19// Revision 1.9 2006/04/15 22:08:36 kkurbjun 19// Revision 1.9 2006-04-15 22:08:36 kkurbjun
20// Slight code cleanups, fixed sound parameter - now it saves. Old configurations will be reset. 20// Slight code cleanups, fixed sound parameter - now it saves. Old configurations will be reset.
21// 21//
22// Revision 1.8 2006-04-14 21:07:55 kkurbjun 22// Revision 1.8 2006-04-14 21:07:55 kkurbjun
@@ -87,7 +87,7 @@ void doomtime(void)
87 87
88int I_GetTime (void) 88int I_GetTime (void)
89{ 89{
90#if defined(HAVE_LCD_COLOR) && !defined(SIMULATOR) && !defined(RB_PROFILE) 90#if defined(HAVE_LCD_COLOR) && !defined(TOSHIBA_GIGABEAT_F) && !defined(SIMULATOR) && !defined(RB_PROFILE)
91 return doomtimer; 91 return doomtimer;
92#else 92#else
93#if HZ==100 93#if HZ==100
diff --git a/apps/plugins/doom/i_video.c b/apps/plugins/doom/i_video.c
index 0ddede09fa..b69b017103 100644
--- a/apps/plugins/doom/i_video.c
+++ b/apps/plugins/doom/i_video.c
@@ -15,8 +15,8 @@
15 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 15 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
16 * GNU General Public License for more details. 16 * GNU General Public License for more details.
17 * 17 *
18 * $Log$ 18 * $Log: i_video.c,v $
19 * Revision 1.26 2006/12/13 04:44:17 kkurbjun 19 * Revision 1.26 2006-12-13 04:44:17 kkurbjun
20 * Dehacked and BEX support for Doom - currently only supports a DEHACKED file in a WAD (not as a standalone file yet). 20 * Dehacked and BEX support for Doom - currently only supports a DEHACKED file in a WAD (not as a standalone file yet).
21 * 21 *
22 * Revision 1.25 2006-10-26 13:38:04 barrywardell 22 * Revision 1.25 2006-10-26 13:38:04 barrywardell
@@ -127,14 +127,15 @@ static unsigned char *gbuf;
127#endif 127#endif
128#endif 128#endif
129 129
130#if defined(CPU_COLDFIRE) 130#if defined(CPU_COLDFIRE)
131static char fastscreen[(LCD_WIDTH)*LCD_HEIGHT] IBSS_ATTR; 131static char fastscreen[LCD_WIDTH*LCD_HEIGHT] IBSS_ATTR;
132#endif 132#endif
133
133static fb_data palette[256] IBSS_ATTR; 134static fb_data palette[256] IBSS_ATTR;
134static fb_data *paldata=NULL; 135static fb_data *paldata=NULL;
135 136
136// 137//
137// I_ShutdownGraphics (NOT USED) 138// I_ShutdownGraphics
138// 139//
139void I_ShutdownGraphics(void) 140void I_ShutdownGraphics(void)
140{ 141{
@@ -187,6 +188,17 @@ void I_ShutdownGraphics(void)
187#define DOOMBUTTON_ESC BUTTON_POWER 188#define DOOMBUTTON_ESC BUTTON_POWER
188#define DOOMBUTTON_ENTER BUTTON_SCROLL_UP 189#define DOOMBUTTON_ENTER BUTTON_SCROLL_UP
189#define DOOMBUTTON_WEAPON BUTTON_SCROLL_DOWN 190#define DOOMBUTTON_WEAPON BUTTON_SCROLL_DOWN
191#elif CONFIG_KEYPAD == GIGABEAT_PAD
192#define DOOMBUTTON_UP BUTTON_UP
193#define DOOMBUTTON_DOWN BUTTON_DOWN
194#define DOOMBUTTON_LEFT BUTTON_LEFT
195#define DOOMBUTTON_RIGHT BUTTON_RIGHT
196#define DOOMBUTTON_SHOOT BUTTON_A
197#define DOOMBUTTON_OPEN BUTTON_MENU
198#define DOOMBUTTON_ESC BUTTON_POWER
199#define DOOMBUTTON_ENTER BUTTON_SELECT
200#define DOOMBUTTON_WEAPON BUTTON_VOL_DOWN
201#define DOOMBUTTON_MAP BUTTON_VOL_UP
190#else 202#else
191#define DOOMBUTTON_UP BUTTON_UP 203#define DOOMBUTTON_UP BUTTON_UP
192#define DOOMBUTTON_DOWN BUTTON_DOWN 204#define DOOMBUTTON_DOWN BUTTON_DOWN
@@ -282,13 +294,11 @@ inline void getkey()
282 D_PostEvent(&event); 294 D_PostEvent(&event);
283 } 295 }
284#endif 296#endif
285#ifdef DOOMBUTTON_ENTER
286 if(released & DOOMBUTTON_ENTER) 297 if(released & DOOMBUTTON_ENTER)
287 { 298 {
288 event.data1=KEY_ENTER; 299 event.data1=KEY_ENTER;
289 D_PostEvent(&event); 300 D_PostEvent(&event);
290 } 301 }
291#endif
292#ifdef DOOMBUTTON_WEAPON 302#ifdef DOOMBUTTON_WEAPON
293 if(released & DOOMBUTTON_WEAPON) 303 if(released & DOOMBUTTON_WEAPON)
294 { 304 {
@@ -296,6 +306,13 @@ inline void getkey()
296 D_PostEvent(&event); 306 D_PostEvent(&event);
297 } 307 }
298#endif 308#endif
309#ifdef DOOMBUTTON_MAP
310 if(released & DOOMBUTTON_MAP)
311 {
312 event.data1 =KEY_TAB;
313 D_PostEvent(&event);
314 }
315#endif
299 } 316 }
300 if(pressed) 317 if(pressed)
301 { 318 {
@@ -353,6 +370,13 @@ inline void getkey()
353 D_PostEvent(&event); 370 D_PostEvent(&event);
354 } 371 }
355#endif 372#endif
373#ifdef DOOMBUTTON_MAP
374 if(pressed & DOOMBUTTON_MAP)
375 {
376 event.data1 =KEY_TAB;
377 D_PostEvent(&event);
378 }
379#endif
356 } 380 }
357} 381}
358 382
@@ -481,31 +505,45 @@ void I_FinishUpdate (void)
481 int y; 505 int y;
482 506
483#ifdef HAVE_LCD_COLOR 507#ifdef HAVE_LCD_COLOR
484 508#if(LCD_HEIGHT>LCD_WIDTH)
485 for (y = 0; y < LCD_HEIGHT*LCD_WIDTH; y++) 509 if(rotate_screen)
486 { 510 {
487 paletteIndex = d_screens[0][y]; 511 int x;
488 rb->lcd_framebuffer[y] = palette[paletteIndex]; 512 for (y=0; y<LCD_HEIGHT; y++)
489 } 513 {
490 rb->lcd_update(); 514 for (x=0; x < LCD_WIDTH; x++)
515 {
516 paletteIndex = d_screens[0][SCREENWIDTH*(SCREENHEIGHT-1-x) + y];
517 rb->lcd_framebuffer[y*LCD_WIDTH + x] = palette[paletteIndex];
518 }
519 }
520 }
521 else
522#endif
523 for (y = 0; y < LCD_HEIGHT *LCD_WIDTH; y++)
524 {
525 paletteIndex = d_screens[0][y];
526 rb->lcd_framebuffer[y] = palette[paletteIndex];
527 }
528 rb->lcd_update();
491#else /* !HAVE_LCD_COLOR */ 529#else /* !HAVE_LCD_COLOR */
492 int x, yd = 0; 530 int x, yd = 0;
493 531
494 for (y = 0; y < LCD_HEIGHT; y++) 532 for (y = 0; y < SCREENHEIGHT; y++)
495 { 533 {
496 for (x = 0; x < LCD_WIDTH; x++) 534 for (x = 0; x < SCREENWIDTH; x++)
497 { 535 {
498 paletteIndex = d_screens[0][y*SCREENWIDTH + x]; 536 paletteIndex = d_screens[0][y*SCREENWIDTH + x];
499 graybuffer[yd * LCD_WIDTH + x]=palette[paletteIndex]; 537 graybuffer[yd * SCREENWIDTH + x]=palette[paletteIndex];
500 } 538 }
501 if (++yd == 8) 539 if (++yd == 8)
502 { 540 {
503 gray_ub_gray_bitmap(graybuffer, 0, y & ~7, LCD_WIDTH, 8); 541 gray_ub_gray_bitmap(graybuffer, 0, y & ~7, SCREENWIDTH, 8);
504 yd = 0; 542 yd = 0;
505 } 543 }
506 } 544 }
507 if (yd > 0) 545 if (yd > 0)
508 gray_ub_gray_bitmap(graybuffer, 0, y & ~7, LCD_WIDTH, yd); 546 gray_ub_gray_bitmap(graybuffer, 0, y & ~7, SCREENWIDTH, yd);
509#endif /* !HAVE_LCD_COLOR */ 547#endif /* !HAVE_LCD_COLOR */
510#endif 548#endif
511} 549}
@@ -515,7 +553,7 @@ void I_FinishUpdate (void)
515// 553//
516void I_ReadScreen (byte* scr) 554void I_ReadScreen (byte* scr)
517{ 555{
518 memcpy (scr, d_screens[0], SCREENWIDTH*SCREENHEIGHT); 556 memcpy (scr, d_screens[0], LCD_WIDTH*LCD_HEIGHT);
519} 557}
520 558
521// 559//
@@ -550,6 +588,6 @@ void I_InitGraphics(void)
550 d_screens[0] = fastscreen; 588 d_screens[0] = fastscreen;
551#else 589#else
552 // Don't know if this will fit in other IRAMs 590 // Don't know if this will fit in other IRAMs
553 d_screens[0] = malloc ((SCREENWIDTH) * SCREENHEIGHT * sizeof(unsigned char)); 591 d_screens[0] = malloc (LCD_WIDTH * LCD_HEIGHT * sizeof(unsigned char));
554#endif 592#endif
555} 593}
diff --git a/apps/plugins/doom/m_misc.c b/apps/plugins/doom/m_misc.c
index 75cef87f7d..1e4b75d8e1 100644
--- a/apps/plugins/doom/m_misc.c
+++ b/apps/plugins/doom/m_misc.c
@@ -291,7 +291,7 @@ default_t defaults[] =
291 {"pitched_sounds",{&pitched_sounds, NULL},{0, NULL},0,1, // killough 2/21/98 291 {"pitched_sounds",{&pitched_sounds, NULL},{0, NULL},0,1, // killough 2/21/98
292 def_bool,ss_none, 0, 0}, // enables variable pitch in sound effects (from id's original code) 292 def_bool,ss_none, 0, 0}, // enables variable pitch in sound effects (from id's original code)
293// {"samplerate",{&snd_samplerate, NULL},{22050, NULL},11025,48000, def_int,ss_none, 0, 0}, 293// {"samplerate",{&snd_samplerate, NULL},{22050, NULL},11025,48000, def_int,ss_none, 0, 0},
294 {"nosfxparm",{(void *)&nosfxparm, NULL},{0, NULL},0,1, def_bool,ss_none, 0, 0}, 294 {"enable_sound",{(void *)&enable_sound, NULL},{0, NULL},0,1, def_bool,ss_none, 0, 0},
295 {"sfx_volume",{&snd_SfxVolume, NULL},{8, NULL},0,15, def_int,ss_none, 0, 0}, 295 {"sfx_volume",{&snd_SfxVolume, NULL},{8, NULL},0,15, def_int,ss_none, 0, 0},
296 {"music_volume",{&snd_MusicVolume, NULL},{8, NULL},0,15, def_int,ss_none, 0, 0}, 296 {"music_volume",{&snd_MusicVolume, NULL},{8, NULL},0,15, def_int,ss_none, 0, 0},
297 {"mus_pause_opt",{&mus_pause_opt, NULL},{2, NULL},0,2, // CPhipps - music pausing 297 {"mus_pause_opt",{&mus_pause_opt, NULL},{2, NULL},0,2, // CPhipps - music pausing
@@ -307,6 +307,10 @@ default_t defaults[] =
307 def_int,ss_none, 0, 0}, 307 def_int,ss_none, 0, 0},
308 {"screen_height",{&desired_screenheight, NULL},{200, NULL},200,1200, 308 {"screen_height",{&desired_screenheight, NULL},{200, NULL},200,1200,
309 def_int,ss_none, 0, 0},*/ 309 def_int,ss_none, 0, 0},*/
310#if(LCD_HEIGHT>LCD_WIDTH)
311 {"rotate_screen",{(void *)&rotate_screen, NULL},{0, NULL},0,1,
312 def_bool,ss_none, 0, 0}, /* kwk - rotate the screen 90 degrees */
313#endif
310 {"fake_contrast",{&fake_contrast, NULL},{1, NULL},0,1, 314 {"fake_contrast",{&fake_contrast, NULL},{1, NULL},0,1,
311 def_bool,ss_none, 0, 0}, /* cph - allow crappy fake contrast to be disabled */ 315 def_bool,ss_none, 0, 0}, /* cph - allow crappy fake contrast to be disabled */
312// {"use_fullscreen",{&use_fullscreen, NULL},{1, NULL},0,1, /* proff 21/05/2000 */ 316// {"use_fullscreen",{&use_fullscreen, NULL},{1, NULL},0,1, /* proff 21/05/2000 */
diff --git a/apps/plugins/doom/r_bsp.c b/apps/plugins/doom/r_bsp.c
index e6ce74c029..a06cb96196 100644
--- a/apps/plugins/doom/r_bsp.c
+++ b/apps/plugins/doom/r_bsp.c
@@ -66,7 +66,7 @@ void R_ClearDrawSegs(void)
66// Instead of clipsegs, let's try using an array with one entry for each column, 66// Instead of clipsegs, let's try using an array with one entry for each column,
67// indicating whether it's blocked by a solid wall yet or not. 67// indicating whether it's blocked by a solid wall yet or not.
68 68
69byte solidcol[SCREENWIDTH] IBSS_ATTR; 69byte solidcol[MAX_SCREENWIDTH] IBSS_ATTR;
70 70
71// CPhipps - 71// CPhipps -
72// R_ClipWallSegment 72// R_ClipWallSegment
diff --git a/apps/plugins/doom/r_defs.h b/apps/plugins/doom/r_defs.h
index 0fbaf9a9ac..a70d8a306c 100644
--- a/apps/plugins/doom/r_defs.h
+++ b/apps/plugins/doom/r_defs.h
@@ -434,9 +434,9 @@ typedef struct visplane
434 fixed_t height; 434 fixed_t height;
435 fixed_t xoffs, yoffs; // killough 2/28/98: Support scrolling flats 435 fixed_t xoffs, yoffs; // killough 2/28/98: Support scrolling flats
436 unsigned short pad1; // leave pads for [minx-1]/[maxx+1] 436 unsigned short pad1; // leave pads for [minx-1]/[maxx+1]
437 unsigned short top[SCREENWIDTH]; 437 unsigned short top[MAX_SCREENWIDTH];
438 unsigned short pad2, pad3; // killough 2/8/98, 4/25/98 438 unsigned short pad2, pad3; // killough 2/8/98, 4/25/98
439 unsigned short bottom[SCREENWIDTH]; 439 unsigned short bottom[MAX_SCREENWIDTH];
440 unsigned short pad4; 440 unsigned short pad4;
441} 441}
442visplane_t; 442visplane_t;
diff --git a/apps/plugins/doom/r_main.c b/apps/plugins/doom/r_main.c
index 58fe9d0f96..fa24bd9d13 100644
--- a/apps/plugins/doom/r_main.c
+++ b/apps/plugins/doom/r_main.c
@@ -86,7 +86,7 @@ int *viewangletox=0;
86// to the lowest viewangle that maps back to x ranges 86// to the lowest viewangle that maps back to x ranges
87// from clipangle to -clipangle. 87// from clipangle to -clipangle.
88 88
89angle_t xtoviewangle[SCREENWIDTH+1]; // killough 2/8/98 89angle_t xtoviewangle[MAX_SCREENWIDTH+1]; // killough 2/8/98
90 90
91// killough 3/20/98: Support dynamic colormaps, e.g. deep water 91// killough 3/20/98: Support dynamic colormaps, e.g. deep water
92// killough 4/4/98: support dynamic number of them as well 92// killough 4/4/98: support dynamic number of them as well
diff --git a/apps/plugins/doom/r_plane.c b/apps/plugins/doom/r_plane.c
index 1ea1dd9193..2d2afd7cbe 100644
--- a/apps/plugins/doom/r_plane.c
+++ b/apps/plugins/doom/r_plane.c
@@ -73,11 +73,11 @@ short *openings,*lastopening;
73// floorclip starts out SCREENHEIGHT 73// floorclip starts out SCREENHEIGHT
74// ceilingclip starts out -1 74// ceilingclip starts out -1
75 75
76short floorclip[SCREENWIDTH], ceilingclip[SCREENWIDTH]; 76short floorclip[MAX_SCREENWIDTH], ceilingclip[MAX_SCREENWIDTH];
77 77
78// spanstart holds the start of a plane span; initialized to 0 at start 78// spanstart holds the start of a plane span; initialized to 0 at start
79 79
80static int spanstart[SCREENHEIGHT]; // killough 2/8/98 80static int spanstart[MAX_SCREENHEIGHT]; // killough 2/8/98
81 81
82// 82//
83// texture mapping 83// texture mapping
@@ -89,13 +89,13 @@ static fixed_t planeheight;
89// killough 2/8/98: make variables static 89// killough 2/8/98: make variables static
90 90
91static fixed_t basexscale, baseyscale; 91static fixed_t basexscale, baseyscale;
92static fixed_t cachedheight[SCREENHEIGHT]; 92static fixed_t cachedheight[MAX_SCREENHEIGHT];
93static fixed_t cacheddistance[SCREENHEIGHT]; 93static fixed_t cacheddistance[MAX_SCREENHEIGHT];
94static fixed_t cachedxstep[SCREENHEIGHT]; 94static fixed_t cachedxstep[MAX_SCREENHEIGHT];
95static fixed_t cachedystep[SCREENHEIGHT]; 95static fixed_t cachedystep[MAX_SCREENHEIGHT];
96static fixed_t xoffs, yoffs; // killough 2/28/98: flat offsets 96static fixed_t xoffs, yoffs; // killough 2/28/98: flat offsets
97 97
98fixed_t yslope[SCREENHEIGHT], distscale[SCREENWIDTH]; 98fixed_t yslope[MAX_SCREENHEIGHT], distscale[MAX_SCREENWIDTH];
99 99
100// 100//
101// R_InitPlanes 101// R_InitPlanes
diff --git a/apps/plugins/doom/r_segs.c b/apps/plugins/doom/r_segs.c
index 8d38e4bd5f..f3bd81e921 100644
--- a/apps/plugins/doom/r_segs.c
+++ b/apps/plugins/doom/r_segs.c
@@ -251,7 +251,7 @@ void R_RenderMaskedSegRange(drawseg_t *ds, int x1, int x2)
251// CALLED: CORE LOOPING ROUTINE. 251// CALLED: CORE LOOPING ROUTINE.
252// 252//
253 253
254extern byte solidcol[SCREENWIDTH]; 254extern byte solidcol[MAX_SCREENWIDTH];
255#define HEIGHTBITS 12 255#define HEIGHTBITS 12
256#define HEIGHTUNIT (1<<HEIGHTBITS) 256#define HEIGHTUNIT (1<<HEIGHTBITS)
257static int didsolidcol; /* True if at least one column was marked solid */ 257static int didsolidcol; /* True if at least one column was marked solid */
diff --git a/apps/plugins/doom/r_state.h b/apps/plugins/doom/r_state.h
index bca66d4b6d..e04a8170f0 100644
--- a/apps/plugins/doom/r_state.h
+++ b/apps/plugins/doom/r_state.h
@@ -109,7 +109,7 @@ extern angle_t viewangle;
109extern player_t *viewplayer; 109extern player_t *viewplayer;
110extern angle_t clipangle; 110extern angle_t clipangle;
111extern int *viewangletox; 111extern int *viewangletox;
112extern angle_t xtoviewangle[SCREENWIDTH+1]; // killough 2/8/98 112extern angle_t xtoviewangle[MAX_SCREENWIDTH+1]; // killough 2/8/98
113extern fixed_t rw_distance; 113extern fixed_t rw_distance;
114extern angle_t rw_normalangle; 114extern angle_t rw_normalangle;
115 115
diff --git a/apps/plugins/doom/r_things.c b/apps/plugins/doom/r_things.c
index 461edadce1..6c83a47b27 100644
--- a/apps/plugins/doom/r_things.c
+++ b/apps/plugins/doom/r_things.c
@@ -71,8 +71,8 @@ static lighttable_t** spritelights;
71 71
72// constant arrays 72// constant arrays
73// used for psprite clipping and initializing clipping 73// used for psprite clipping and initializing clipping
74short negonearray[SCREENWIDTH]; 74short negonearray[MAX_SCREENWIDTH];
75short screenheightarray[SCREENWIDTH]; 75short screenheightarray[MAX_SCREENWIDTH];
76 76
77 77
78// 78//
@@ -282,7 +282,7 @@ void R_InitSprites(const char * const *namelist)
282{ 282{
283 int i; 283 int i;
284 284
285 for (i=0 ; i<SCREENWIDTH ; i++) 285 for (i=0 ; i<MAX_SCREENWIDTH ; i++)
286 negonearray[i] = -1; 286 negonearray[i] = -1;
287 R_InitSpriteDefs (namelist); 287 R_InitSpriteDefs (namelist);
288} 288}
@@ -835,8 +835,8 @@ void R_SortVisSprites (void)
835void R_DrawSprite (vissprite_t* spr) 835void R_DrawSprite (vissprite_t* spr)
836{ 836{
837 drawseg_t *ds; 837 drawseg_t *ds;
838 short clipbot[SCREENWIDTH]; // killough 2/8/98: 838 short clipbot[MAX_SCREENWIDTH]; // killough 2/8/98:
839 short cliptop[SCREENWIDTH]; // change to MAX_* 839 short cliptop[MAX_SCREENWIDTH]; // change to MAX_*
840 int x; 840 int x;
841 int r1; 841 int r1;
842 int r2; 842 int r2;
diff --git a/apps/plugins/doom/r_things.h b/apps/plugins/doom/r_things.h
index c3308744b8..424033a971 100644
--- a/apps/plugins/doom/r_things.h
+++ b/apps/plugins/doom/r_things.h
@@ -38,8 +38,8 @@
38 38
39/* Constant arrays used for psprite clipping and initializing clipping. */ 39/* Constant arrays used for psprite clipping and initializing clipping. */
40 40
41extern short negonearray[SCREENWIDTH]; 41extern short negonearray[MAX_SCREENWIDTH];
42extern short screenheightarray[SCREENWIDTH]; 42extern short screenheightarray[MAX_SCREENWIDTH];
43 43
44/* Vars for R_DrawMaskedColumn */ 44/* Vars for R_DrawMaskedColumn */
45 45
diff --git a/apps/plugins/doom/rockdoom.c b/apps/plugins/doom/rockdoom.c
index 00bd22b7ea..6d0e73e3be 100644
--- a/apps/plugins/doom/rockdoom.c
+++ b/apps/plugins/doom/rockdoom.c
@@ -108,6 +108,7 @@ int printf(const char *fmt, ...)
108 static int p_xtpt; 108 static int p_xtpt;
109 char p_buf[50]; 109 char p_buf[50];
110 bool ok; 110 bool ok;
111 rb->yield();
111 va_list ap; 112 va_list ap;
112 113
113 va_start(ap, fmt); 114 va_start(ap, fmt);
@@ -293,76 +294,29 @@ int Dbuild_base (struct opt_items *names)
293 294
294 D_AddFile (GAMEBASE"rockdoom.wad", source_pwad); 295 D_AddFile (GAMEBASE"rockdoom.wad", source_pwad);
295 296
296 int i=0; 297 int i=0, j;
297 /* Doom Shareware */ 298 /* Doom Shareware */
298 if ( !fileexists (wads_builtin[0]) )
299 {
300 names[i].string=versions_builtin[0];
301 names[i].voice_id=0;
302 namemap[i]=0;
303 i++;
304 }
305
306 /* Doom registered */ 299 /* Doom registered */
307 if ( !fileexists (wads_builtin[1]) )
308 {
309 names[i].string=versions_builtin[1];
310 names[i].voice_id=0;
311 namemap[i]=1;
312 i++;
313 }
314
315 /* Ultimate Doom */ 300 /* Ultimate Doom */
316 if ( !fileexists (wads_builtin[2]) )
317 {
318 names[i].string=versions_builtin[2];
319 names[i].voice_id=0;
320 namemap[i]=2;
321 i++;
322 }
323
324 /* Doom2 */ 301 /* Doom2 */
325 if ( !fileexists (wads_builtin[3]) )
326 {
327 names[i].string=versions_builtin[3];
328 names[i].voice_id=0;
329 namemap[i]=3;
330 i++;
331 }
332
333 /* Doom2f */ 302 /* Doom2f */
334 if ( !fileexists (wads_builtin[4]) )
335 {
336 names[i].string=versions_builtin[4];
337 names[i].voice_id=0;
338 namemap[i]=4;
339 i++;
340 }
341
342 /* Plutonia */ 303 /* Plutonia */
343 if ( !fileexists (wads_builtin[5]) )
344 {
345 names[i].string=versions_builtin[5];
346 names[i].voice_id=0;
347 namemap[i]=5;
348 i++;
349 }
350
351 /* TNT */ 304 /* TNT */
352 if ( !fileexists (wads_builtin[6]) ) 305 for(j=0;j<7;j++)
353 { 306 if ( !fileexists (wads_builtin[j]) )
354 names[i].string=versions_builtin[6]; 307 {
355 names[i].voice_id=0; 308 names[i].string=versions_builtin[j];
356 namemap[i]=6; 309 names[i].voice_id=0;
357 i++; 310 namemap[i]=j;
358 } 311 i++;
312 }
359 // Set argvlist defaults 313 // Set argvlist defaults
360 argvlist.timedemo=0; 314 argvlist.timedemo=0;
361 315
362 return i; 316 return i;
363} 317}
364 318
365// This is a general function that takes in an menu_item structure and makes a list 319// This is a general function that takes in a menu_item structure and makes a list
366// of files within it based on matching the string stringmatch to the files. 320// of files within it based on matching the string stringmatch to the files.
367int Dbuild_filelistm(struct menu_item **names, char *firstentry, char *directory, char *stringmatch) 321int Dbuild_filelistm(struct menu_item **names, char *firstentry, char *directory, char *stringmatch)
368{ 322{
@@ -413,8 +367,10 @@ int Dbuild_filelistm(struct menu_item **names, char *firstentry, char *directory
413 return i; 367 return i;
414} 368}
415 369
370static int translatekey(int key) __attribute__ ((noinline));
371
416// This key configuration code is not the cleanest or the most efficient, but it works 372// This key configuration code is not the cleanest or the most efficient, but it works
417int translatekey(int key) 373static int translatekey(int key)
418{ 374{
419 if (key<31) 375 if (key<31)
420 { 376 {
@@ -431,16 +387,17 @@ int translatekey(int key)
431 case 4: 387 case 4:
432 return KEY_DOWNARROW; 388 return KEY_DOWNARROW;
433 case 5: 389 case 5:
434 return KEY_RCTRL; 390 return KEY_ENTER;
435 case 6: 391 case 6:
436 return ' '; 392 return KEY_RCTRL;
437 case 7: 393 case 7:
438 return KEY_ESCAPE; 394 return ' ';
439 case 8: 395 case 8:
440 return 'w'; 396 return KEY_ESCAPE;
441 case 9: 397 case 9:
442 return KEY_ENTER; 398 return 'w';
443 case 10: 399 case 10:
400 return KEY_TAB;
444 default: 401 default:
445 return 0; 402 return 0;
446 } 403 }
@@ -459,17 +416,18 @@ int translatekey(int key)
459 return 3; 416 return 3;
460 case KEY_DOWNARROW: 417 case KEY_DOWNARROW:
461 return 4; 418 return 4;
462 case KEY_RCTRL: 419 case KEY_ENTER:
463 return 5; 420 return 5;
464 case ' ': 421 case KEY_RCTRL:
465 return 6; 422 return 6;
466 case KEY_ESCAPE: 423 case ' ':
467 return 7; 424 return 7;
468 case 'w': 425 case KEY_ESCAPE:
469 return 8; 426 return 8;
470 case KEY_ENTER: 427 case 'w':
471 return 9; 428 return 9;
472 case KEY_F9: 429 case KEY_TAB:
430 return 10;
473 default: 431 default:
474 return 0; 432 return 0;
475 } 433 }
@@ -484,18 +442,40 @@ int Oset_keys()
484 int m, result; 442 int m, result;
485 int menuquit=0; 443 int menuquit=0;
486 444
445
487 static const struct opt_items doomkeys[] = { 446 static const struct opt_items doomkeys[] = {
488 { "Unmapped", NULL }, 447 { "Unmapped", NULL },
489 { "Key Right", NULL }, 448 { "Key Right", NULL },
490 { "Key Left", NULL }, 449 { "Key Left", NULL },
491 { "Key Up", NULL }, 450 { "Key Up", NULL },
492 { "Key Down", NULL }, 451 { "Key Down", NULL },
452 { "Key Select", NULL },
453#if defined(TOSHIBA_GIGABEAT_F)
454 { "Key A", NULL },
455 { "Key Menu", NULL },
456 { "Key Power", NULL },
457 { "Key Volume Down", NULL },
458 { "Key Volume Up", NULL },
459#else
493 { "Key Record", NULL }, 460 { "Key Record", NULL },
494 { "Key Mode", NULL }, 461 { "Key Mode", NULL },
495 { "Key Off", NULL }, 462 { "Key Off", NULL },
496 { "Key On", NULL }, 463 { "Key On", NULL },
497 { "Key Select", NULL }, 464#endif
498 }; 465 };
466
467 int *keys[]={
468 &key_right,
469 &key_left,
470 &key_up,
471 &key_down,
472 &key_fire,
473 &key_use,
474 &key_strafe,
475 &key_weapon,
476 &key_map
477 };
478
499 int numdoomkeys=sizeof(doomkeys) / sizeof(*doomkeys); 479 int numdoomkeys=sizeof(doomkeys) / sizeof(*doomkeys);
500 480
501 static const struct menu_item items[] = { 481 static const struct menu_item items[] = {
@@ -513,69 +493,17 @@ int Oset_keys()
513 m = rb->menu_init(items, sizeof(items) / sizeof(*items), 493 m = rb->menu_init(items, sizeof(items) / sizeof(*items),
514 NULL, NULL, NULL, NULL); 494 NULL, NULL, NULL, NULL);
515 495
516 while(!menuquit) 496 while(!menuquit)
517 { 497 {
518 result=rb->menu_show(m); 498 result=rb->menu_show(m);
519 switch (result) 499 if(result<0)
520 {
521 case 0:
522 key_right=translatekey(key_right);
523 rb->set_option(items[0].desc, &key_right, INT, doomkeys, numdoomkeys, NULL );
524 key_right=translatekey(key_right);
525 break;
526
527 case 1:
528 key_left=translatekey(key_left);
529 rb->set_option(items[1].desc, &key_left, INT, doomkeys, numdoomkeys, NULL );
530 key_left=translatekey(key_left);
531 break;
532
533 case 2:
534 key_up=translatekey(key_up);
535 rb->set_option(items[2].desc, &key_up, INT, doomkeys, numdoomkeys, NULL );
536 key_up=translatekey(key_up);
537 break;
538
539 case 3:
540 key_down=translatekey(key_down);
541 rb->set_option(items[3].desc, &key_down, INT, doomkeys, numdoomkeys, NULL );
542 key_down=translatekey(key_down);
543 break;
544
545 case 4:
546 key_fire=translatekey(key_fire);
547 rb->set_option(items[4].desc, &key_fire, INT, doomkeys, numdoomkeys, NULL );
548 key_fire=translatekey(key_fire);
549 break;
550
551 case 5:
552 key_use=translatekey(key_use);
553 rb->set_option(items[5].desc, &key_use, INT, doomkeys, numdoomkeys, NULL );
554 key_use=translatekey(key_use);
555 break;
556
557 case 6:
558 key_strafe=translatekey(key_strafe);
559 rb->set_option(items[6].desc, &key_strafe, INT, doomkeys, numdoomkeys, NULL );
560 key_strafe=translatekey(key_strafe);
561 break;
562
563 case 7:
564 key_weapon=translatekey(key_weapon);
565 rb->set_option(items[7].desc, &key_weapon, INT, doomkeys, numdoomkeys, NULL );
566 key_weapon=translatekey(key_weapon);
567 break;
568
569 case 8:
570 key_map=translatekey(key_map);
571 rb->set_option(items[8].desc, &key_map, INT, doomkeys, numdoomkeys, NULL );
572 key_map=translatekey(key_map);
573 break;
574
575 default:
576 menuquit=1; 500 menuquit=1;
577 break; 501 else
578 } 502 {
503 *keys[result]=translatekey(*keys[result]);
504 rb->set_option(items[result].desc, keys[result], INT, doomkeys, numdoomkeys, NULL );
505 *keys[result]=translatekey(*keys[result]);
506 }
579 } 507 }
580 508
581 rb->menu_exit(m); 509 rb->menu_exit(m);
@@ -596,8 +524,8 @@ static bool Doptions()
596 int menuquit=0; 524 int menuquit=0;
597 525
598 static const struct menu_item items[] = { 526 static const struct menu_item items[] = {
599 { "Sound", NULL },
600 { "Set Keys", NULL }, 527 { "Set Keys", NULL },
528 { "Sound", NULL },
601 { "Timedemo", NULL }, 529 { "Timedemo", NULL },
602 { "Player Bobbing", NULL }, 530 { "Player Bobbing", NULL },
603 { "Weapon Recoil", NULL }, 531 { "Weapon Recoil", NULL },
@@ -606,67 +534,43 @@ static bool Doptions()
606 { "Always Run", NULL }, 534 { "Always Run", NULL },
607 { "Headsup Display", NULL }, 535 { "Headsup Display", NULL },
608 { "Statusbar Always Red", NULL }, 536 { "Statusbar Always Red", NULL },
537#if(LCD_HEIGHT>LCD_WIDTH)
538 { "Rotate Screen 90 deg", NULL },
539#endif
609 }; 540 };
541
542 void *options[]={
543 &enable_sound,
544 &argvlist.timedemo,
545 &default_player_bobbing,
546 &default_weapon_recoil,
547 &default_translucency,
548 &fake_contrast,
549 &autorun,
550 &hud_displayed,
551 &sts_always_red,
552#if(LCD_HEIGHT>LCD_WIDTH)
553 &rotate_screen,
554#endif
555 };
610 556
611 m = rb->menu_init(items, sizeof(items) / sizeof(*items), 557 m = rb->menu_init(items, sizeof(items) / sizeof(*items),
612 NULL, NULL, NULL, NULL); 558 NULL, NULL, NULL, NULL);
613 559
614 while(!menuquit) 560 while(!menuquit)
615 { 561 {
616 result=rb->menu_show(m); 562 result=rb->menu_show(m);
617 switch (result) 563 if(result==0)
618 {
619 case 0: /* Sound */
620 nosfxparm=!nosfxparm; // Have to invert it before setting
621 rb->set_option(items[0].desc, &nosfxparm, INT, onoff, 2, NULL );
622 nosfxparm=!nosfxparm;
623 break;
624
625 case 1: /* Keys */
626 Oset_keys(); 564 Oset_keys();
627 break; 565 else if (result > 0)
628 566 rb->set_option(items[result].desc, options[result-1], INT, onoff, 2, NULL );
629 case 2: /* Timedemo */ 567 else
630 rb->set_option(items[2].desc, &argvlist.timedemo, INT, onoff, 2, NULL );
631 break;
632
633 case 3: /* Player Bobbing */
634 rb->set_option(items[3].desc, &default_player_bobbing, INT, onoff, 2, NULL );
635 break;
636
637 case 4: /* Weapon Recoil */
638 rb->set_option(items[4].desc, &default_weapon_recoil, INT, onoff, 2, NULL );
639 break;
640
641 case 5: /* Translucency */
642 rb->set_option(items[5].desc, &default_translucency, INT, onoff, 2, NULL );
643 break;
644
645 case 6: /* Fake Contrast */
646 rb->set_option(items[6].desc, &fake_contrast, INT, onoff, 2, NULL );
647 break;
648
649 case 7: /* Always Run */
650 rb->set_option(items[7].desc, &autorun, INT, onoff, 2, NULL );
651 break;
652
653 case 8: /* Headsup Display */
654 rb->set_option(items[8].desc, &hud_displayed, INT, onoff, 2, NULL );
655 break;
656
657 case 9: /* Statusbar always red */
658 rb->set_option(items[9].desc, &sts_always_red, INT, onoff, 2, NULL );
659 break;
660
661 default:
662 menuquit=1; 568 menuquit=1;
663 break; 569 }
664 }
665 }
666 570
667 rb->menu_exit(m); 571 rb->menu_exit(m);
668 572
669 return (1); 573 return (1);
670} 574}
671 575
672int menuchoice(struct menu_item *menu, int items) 576int menuchoice(struct menu_item *menu, int items)
@@ -807,6 +711,19 @@ enum plugin_status plugin_start(struct plugin_api* api, void* parameter)
807 else if( result == -2 ) return PLUGIN_ERROR; // Missing base wads 711 else if( result == -2 ) return PLUGIN_ERROR; // Missing base wads
808 } 712 }
809 713
714#if(LCD_HEIGHT>LCD_WIDTH)
715 if(rotate_screen)
716 {
717 SCREENHEIGHT=LCD_WIDTH;
718 SCREENWIDTH=LCD_HEIGHT;
719 }
720 else
721 {
722 SCREENHEIGHT=LCD_HEIGHT;
723 SCREENWIDTH=LCD_WIDTH;
724 }
725#endif
726
810 Dhandle_ver( namemap[ result ] ); 727 Dhandle_ver( namemap[ result ] );
811 728
812 rb->lcd_setfont(0); 729 rb->lcd_setfont(0);
diff --git a/apps/plugins/doom/rockmacros.h b/apps/plugins/doom/rockmacros.h
index 901aa5513d..ff179cfc65 100644
--- a/apps/plugins/doom/rockmacros.h
+++ b/apps/plugins/doom/rockmacros.h
@@ -100,6 +100,6 @@ inline void* memcpy(void* dst, const void* src, size_t size);
100 structure changes. 100 structure changes.
101 */ 101 */
102#define DOOM_CONFIG_MAGIC MAKE_FOURCC('D','O','O','M') 102#define DOOM_CONFIG_MAGIC MAKE_FOURCC('D','O','O','M')
103#define DOOM_CONFIG_VERSION 2 103#define DOOM_CONFIG_VERSION 3
104 104
105#endif 105#endif
diff --git a/apps/plugins/doom/s_sound.c b/apps/plugins/doom/s_sound.c
index c8ed7b2839..4b863b5872 100644
--- a/apps/plugins/doom/s_sound.c
+++ b/apps/plugins/doom/s_sound.c
@@ -117,7 +117,7 @@ void S_Init(int sfxVolume,int musicVolume )
117{ 117{
118 //jff 1/22/98 skip sound init if sound not enabled 118 //jff 1/22/98 skip sound init if sound not enabled
119 numChannels = default_numChannels; 119 numChannels = default_numChannels;
120 if (!nosfxparm) 120 if (enable_sound)
121 { 121 {
122 int i; 122 int i;
123 123
@@ -154,7 +154,7 @@ void S_Start(void)
154{ 154{
155 int cnum, mnum; 155 int cnum, mnum;
156 156
157 if (!nosfxparm) 157 if (enable_sound)
158 { 158 {
159 // kill all playing sounds at start of level 159 // kill all playing sounds at start of level
160 // (trust me - a good idea) 160 // (trust me - a good idea)
@@ -198,7 +198,7 @@ void S_StartSoundAtVolume(void *origin_p, int sfx_id, int volume)
198 sfxinfo_t* sfx; 198 sfxinfo_t* sfx;
199 mobj_t* origin = (mobj_t *) origin_p; 199 mobj_t* origin = (mobj_t *) origin_p;
200 200
201 if (nosfxparm) 201 if (!enable_sound)
202 return; 202 return;
203 203
204 is_pickup = sfx_id & PICKUP_SOUND || sfx_id == sfx_oof || (compatibility_level >= prboom_2_compatibility && sfx_id == sfx_noway); // killough 4/25/98 204 is_pickup = sfx_id & PICKUP_SOUND || sfx_id == sfx_oof || (compatibility_level >= prboom_2_compatibility && sfx_id == sfx_noway); // killough 4/25/98
@@ -295,7 +295,7 @@ void S_StopSound(void *origin)
295{ 295{
296 int cnum; 296 int cnum;
297 297
298 if (nosfxparm) 298 if (!enable_sound)
299 return; 299 return;
300 300
301 for (cnum=0 ; cnum<numChannels ; cnum++) 301 for (cnum=0 ; cnum<numChannels ; cnum++)
@@ -311,7 +311,7 @@ void S_StopSound(void *origin)
311// 311//
312void S_PauseSound(void) 312void S_PauseSound(void)
313{ 313{
314 if (nosfxparm) 314 if (!enable_sound)
315 return; 315 return;
316 316
317 if (mus_playing && !mus_paused) 317 if (mus_playing && !mus_paused)
@@ -323,7 +323,7 @@ void S_PauseSound(void)
323 323
324void S_ResumeSound(void) 324void S_ResumeSound(void)
325{ 325{
326 if (nosfxparm) 326 if (!enable_sound)
327 return; 327 return;
328 328
329 if (mus_playing && mus_paused) 329 if (mus_playing && mus_paused)
@@ -342,7 +342,7 @@ void S_UpdateSounds(void* listener_p)
342 342
343 mobj_t* listener = (mobj_t*)listener_p; 343 mobj_t* listener = (mobj_t*)listener_p;
344 344
345 if (nosfxparm) 345 if (!enable_sound)
346 return; 346 return;
347 347
348 for (cnum=0 ; cnum<numChannels ; cnum++) 348 for (cnum=0 ; cnum<numChannels ; cnum++)
@@ -392,7 +392,7 @@ void S_UpdateSounds(void* listener_p)
392 392
393void S_SetMusicVolume(int volume) 393void S_SetMusicVolume(int volume)
394{ 394{
395 if (nosfxparm) 395 if (!enable_sound)
396 return; 396 return;
397 397
398 if (volume < 0 || volume > 15) 398 if (volume < 0 || volume > 15)
@@ -403,7 +403,7 @@ void S_SetMusicVolume(int volume)
403 403
404void S_SetSfxVolume(int volume) 404void S_SetSfxVolume(int volume)
405{ 405{
406 if (nosfxparm) 406 if (!enable_sound)
407 return; 407 return;
408 408
409 if (volume < 0 || volume > 127) 409 if (volume < 0 || volume > 127)
@@ -416,7 +416,7 @@ void S_SetSfxVolume(int volume)
416// 416//
417void S_StartMusic(int m_id) 417void S_StartMusic(int m_id)
418{ 418{
419 if (nosfxparm) 419 if (!enable_sound)
420 return; 420 return;
421 S_ChangeMusic(m_id, false); 421 S_ChangeMusic(m_id, false);
422} 422}
@@ -425,7 +425,7 @@ void S_ChangeMusic(int musicnum, int looping)
425{ 425{
426 musicinfo_t *music; 426 musicinfo_t *music;
427 427
428 if (nosfxparm) 428 if (!enable_sound)
429 return; 429 return;
430 430
431 if (musicnum <= mus_None || musicnum >= NUMMUSIC) 431 if (musicnum <= mus_None || musicnum >= NUMMUSIC)
@@ -464,7 +464,7 @@ void S_ChangeMusic(int musicnum, int looping)
464 464
465void S_StopMusic(void) 465void S_StopMusic(void)
466{ 466{
467 if (nosfxparm) 467 if (!enable_sound)
468 return; 468 return;
469 469
470 if (mus_playing) 470 if (mus_playing)
@@ -487,7 +487,7 @@ void S_StopChannel(int cnum)
487 int i; 487 int i;
488 channel_t* c = &channels[cnum]; 488 channel_t* c = &channels[cnum];
489 489
490 if (nosfxparm) 490 if (!enable_sound)
491 return; 491 return;
492 492
493 if (c->sfxinfo) 493 if (c->sfxinfo)
@@ -521,7 +521,7 @@ int S_AdjustSoundParams(mobj_t *listener, mobj_t *source,
521 fixed_t adx, ady, approx_dist; 521 fixed_t adx, ady, approx_dist;
522 angle_t angle; 522 angle_t angle;
523 523
524 if (nosfxparm) 524 if (!enable_sound)
525 return 0; 525 return 0;
526 526
527 // calculate the distance to sound origin 527 // calculate the distance to sound origin
@@ -576,7 +576,7 @@ static int S_getChannel(void *origin, sfxinfo_t *sfxinfo, int is_pickup)
576 int cnum; 576 int cnum;
577 channel_t* c; 577 channel_t* c;
578 578
579 if (nosfxparm) 579 if (!enable_sound)
580 return -1; 580 return -1;
581 581
582 // Find an open channel 582 // Find an open channel
diff --git a/apps/plugins/doom/w_wad.c b/apps/plugins/doom/w_wad.c
index 18da216dcf..1e3406199d 100644
--- a/apps/plugins/doom/w_wad.c
+++ b/apps/plugins/doom/w_wad.c
@@ -485,7 +485,7 @@ void W_Init(void)
485int W_LumpLength (int lump) 485int W_LumpLength (int lump)
486{ 486{
487 if (lump >= numlumps) 487 if (lump >= numlumps)
488 I_Error ("W_LumpLength: %i >= numlumps",lump); 488 I_Error ("W_LumpLength: %d >= numlumps",lump);
489 return lumpinfo[lump].size; 489 return lumpinfo[lump].size;
490} 490}
491 491
@@ -501,7 +501,7 @@ void W_ReadLump(int lump, void *dest)
501 501
502#ifdef RANGECHECK 502#ifdef RANGECHECK
503 if (lump >= numlumps) 503 if (lump >= numlumps)
504 I_Error ("W_ReadLump: %i >= numlumps",lump); 504 I_Error ("W_ReadLump: %d >= numlumps",lump);
505#endif 505#endif
506 506
507#ifndef NO_PREDEFINED_LUMPS 507#ifndef NO_PREDEFINED_LUMPS
@@ -522,7 +522,7 @@ void W_ReadLump(int lump, void *dest)
522 lseek(l->handle, l->position, SEEK_SET); 522 lseek(l->handle, l->position, SEEK_SET);
523 c = read(l->handle, dest, l->size); 523 c = read(l->handle, dest, l->size);
524 if (c < l->size) 524 if (c < l->size)
525 I_Error("W_ReadLump: only read %i of %i on lump %i", c, l->size, lump); 525 I_Error("W_ReadLump: only read %d of %d on lump %d", c, l->size, lump);
526 } 526 }
527} 527}
528 528
@@ -538,7 +538,7 @@ void * (W_CacheLumpNum)(int lump, unsigned short locks)
538{ 538{
539#ifdef RANGECHECK 539#ifdef RANGECHECK
540 if ((unsigned)lump >= (unsigned)numlumps) 540 if ((unsigned)lump >= (unsigned)numlumps)
541 I_Error ("W_CacheLumpNum: %i >= numlumps",lump); 541 I_Error ("W_CacheLumpNum: %d >= numlumps",lump);
542#endif 542#endif
543 543
544 if (!lumpcache[lump]) // read the lump in 544 if (!lumpcache[lump]) // read the lump in
@@ -578,7 +578,7 @@ void * W_CacheLumpNumPadded(int lump, size_t len, unsigned char pad)
578 const int locks = 1; 578 const int locks = 1;
579#ifdef RANGECHECK 579#ifdef RANGECHECK
580 if ((unsigned)lump >= (unsigned)numlumps) 580 if ((unsigned)lump >= (unsigned)numlumps)
581 I_Error ("W_CacheLumpNum: %i >= numlumps",lump); 581 I_Error ("W_CacheLumpNum: %d >= numlumps",lump);
582#endif 582#endif
583 583
584 if (!lumpcache[lump]) { /* read the lump in */ 584 if (!lumpcache[lump]) { /* read the lump in */
diff --git a/apps/plugins/doom/z_zone.c b/apps/plugins/doom/z_zone.c
index 2ae5d73833..552e3218b0 100644
--- a/apps/plugins/doom/z_zone.c
+++ b/apps/plugins/doom/z_zone.c
@@ -115,7 +115,8 @@ static void Z_PrintStats(void) // Print allocation statistics
115 unsigned long total_memory = free_memory + active_memory + 115 unsigned long total_memory = free_memory + active_memory +
116 purgable_memory + inactive_memory + 116 purgable_memory + inactive_memory +
117 virtual_memory; 117 virtual_memory;
118 double s = 100.0 / total_memory; 118// double s = 100.0 / total_memory;
119 int s = 100/total_memory;
119 120
120 doom_printf("%-5u\t%6.01f%%\tstatic\n" 121 doom_printf("%-5u\t%6.01f%%\tstatic\n"
121 "%-5u\t%6.01f%%\tpurgable\n" 122 "%-5u\t%6.01f%%\tpurgable\n"