mirror of
https://github.com/Rockbox/rockbox.git
synced 2025-10-13 18:17:39 -04:00
Doom for the Gigabeat and some code reduction
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@12051 a1c6a512-1295-4272-9138-f99709370657
This commit is contained in:
parent
3b65fc2480
commit
b47a43aa28
24 changed files with 247 additions and 277 deletions
|
@ -2,8 +2,8 @@
|
|||
#
|
||||
# $Id$
|
||||
#
|
||||
# $Log$
|
||||
# Revision 1.13 2006/12/13 06:52:09 kkurbjun
|
||||
# $Log: Makefile,v $
|
||||
# Revision 1.13 2006-12-13 06:52:09 kkurbjun
|
||||
# Free more plugin memory
|
||||
#
|
||||
# Revision 1.12 2006-12-13 05:46:51 kkurbjun
|
||||
|
@ -56,7 +56,7 @@ endif
|
|||
|
||||
# The arm code compiles too large for the plugin buffer when set to optimize for speed
|
||||
#ifeq ($(CC), arm-elf-gcc)
|
||||
ifneq (,$(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)))))
|
||||
ifneq (,$(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)))))
|
||||
CFLAGS += -Os
|
||||
ifndef SIMVER
|
||||
ifeq ($(TARGET), IRIVER_H100)
|
||||
|
|
|
@ -49,7 +49,7 @@ extern boolean clrespawnparm; // checkparm of -respawn
|
|||
extern boolean clfastparm; // checkparm of -fast
|
||||
//jff end of external declaration of command line playmode
|
||||
|
||||
extern boolean nosfxparm;
|
||||
extern boolean enable_sound;
|
||||
extern boolean nomusicparm;
|
||||
extern int ffmap;
|
||||
|
||||
|
|
|
@ -33,7 +33,9 @@
|
|||
#include "doomdef.h"
|
||||
|
||||
// Location for any defines turned variables.
|
||||
|
||||
// None.
|
||||
|
||||
#if(LCD_HEIGHT>LCD_WIDTH)
|
||||
bool rotate_screen=0;
|
||||
int SCREENWIDTH;
|
||||
int SCREENHEIGHT;
|
||||
#endif
|
||||
|
||||
|
|
|
@ -33,6 +33,8 @@
|
|||
#ifndef __DOOMDEF__
|
||||
#define __DOOMDEF__
|
||||
|
||||
#include "rockmacros.h"
|
||||
|
||||
// killough 4/25/98: Make gcc extensions mean nothing on other compilers
|
||||
#ifndef __GNUC__
|
||||
#define __attribute__(x)
|
||||
|
@ -88,14 +90,20 @@ typedef enum {
|
|||
// allows us to avoid the overhead of dynamic allocation
|
||||
// when multiple screen sizes are supported
|
||||
|
||||
#if(LCD_HEIGHT>LCD_WIDTH)
|
||||
extern bool rotate_screen;
|
||||
// proff 08/17/98: Changed for high-res
|
||||
#define MAX_SCREENWIDTH 1600
|
||||
#define MAX_SCREENHEIGHT 1200
|
||||
|
||||
#define MAX_SCREENWIDTH LCD_HEIGHT
|
||||
#define MAX_SCREENHEIGHT LCD_HEIGHT
|
||||
extern int SCREENWIDTH;
|
||||
extern int SCREENHEIGHT;
|
||||
#else
|
||||
// proff 08/17/98: Changed for high-res
|
||||
#define MAX_SCREENWIDTH LCD_WIDTH
|
||||
#define MAX_SCREENHEIGHT LCD_HEIGHT
|
||||
#define SCREENWIDTH LCD_WIDTH
|
||||
//#define SCREENWIDTH 320
|
||||
//#define SCREENHEIGHT 200
|
||||
#define SCREENHEIGHT LCD_HEIGHT
|
||||
#endif
|
||||
|
||||
// The maximum number of players, multiplayer/networking.
|
||||
#define MAXPLAYERS 4
|
||||
|
|
|
@ -100,5 +100,5 @@ int doom_weapon_toggles; // killough 10/98
|
|||
|
||||
int monkeys IBSS_ATTR, default_monkeys;
|
||||
|
||||
boolean nosfxparm=0;
|
||||
boolean enable_sound=1;
|
||||
boolean rockblock=1;
|
||||
|
|
|
@ -115,7 +115,7 @@ enum {
|
|||
|
||||
extern int comp[COMP_TOTAL], default_comp[COMP_TOTAL];
|
||||
|
||||
extern boolean nosfxparm;
|
||||
extern boolean enable_sound;
|
||||
extern boolean rockblock;
|
||||
|
||||
// -------------------------------------------
|
||||
|
|
|
@ -2773,11 +2773,11 @@ boolean G_CheckDemoStatus (void)
|
|||
int fd=open(GAMEBASE "timedemo.txt",O_WRONLY | O_CREAT);
|
||||
fdprintf (fd,"Timed %d gametics in %d realtics = %d frames per second",
|
||||
(unsigned) gametic, realtics,
|
||||
(unsigned) gametic * (double) TICRATE / realtics);
|
||||
(unsigned) gametic * TICRATE/ realtics);
|
||||
close(fd);
|
||||
I_Error ("%d gametics in %d realtics",
|
||||
(unsigned) gametic,realtics,
|
||||
(unsigned) gametic * (double) TICRATE / realtics);
|
||||
(unsigned) gametic * TICRATE / realtics);
|
||||
return false;
|
||||
}
|
||||
|
||||
|
|
|
@ -472,7 +472,7 @@ void get_more(unsigned char** start, size_t* size)
|
|||
|
||||
void I_SubmitSound(void)
|
||||
{
|
||||
if (nosfxparm)
|
||||
if (!enable_sound)
|
||||
return;
|
||||
|
||||
rb->pcm_play_data(&get_more, NULL, 0);
|
||||
|
|
|
@ -15,8 +15,8 @@
|
|||
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
// GNU General Public License for more details.
|
||||
//
|
||||
// $Log$
|
||||
// Revision 1.9 2006/04/15 22:08:36 kkurbjun
|
||||
// $Log: i_system.c,v $
|
||||
// Revision 1.9 2006-04-15 22:08:36 kkurbjun
|
||||
// Slight code cleanups, fixed sound parameter - now it saves. Old configurations will be reset.
|
||||
//
|
||||
// Revision 1.8 2006-04-14 21:07:55 kkurbjun
|
||||
|
@ -87,7 +87,7 @@ void doomtime(void)
|
|||
|
||||
int I_GetTime (void)
|
||||
{
|
||||
#if defined(HAVE_LCD_COLOR) && !defined(SIMULATOR) && !defined(RB_PROFILE)
|
||||
#if defined(HAVE_LCD_COLOR) && !defined(TOSHIBA_GIGABEAT_F) && !defined(SIMULATOR) && !defined(RB_PROFILE)
|
||||
return doomtimer;
|
||||
#else
|
||||
#if HZ==100
|
||||
|
|
|
@ -15,8 +15,8 @@
|
|||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* GNU General Public License for more details.
|
||||
*
|
||||
* $Log$
|
||||
* Revision 1.26 2006/12/13 04:44:17 kkurbjun
|
||||
* $Log: i_video.c,v $
|
||||
* Revision 1.26 2006-12-13 04:44:17 kkurbjun
|
||||
* Dehacked and BEX support for Doom - currently only supports a DEHACKED file in a WAD (not as a standalone file yet).
|
||||
*
|
||||
* Revision 1.25 2006-10-26 13:38:04 barrywardell
|
||||
|
@ -128,13 +128,14 @@ static unsigned char *gbuf;
|
|||
#endif
|
||||
|
||||
#if defined(CPU_COLDFIRE)
|
||||
static char fastscreen[(LCD_WIDTH)*LCD_HEIGHT] IBSS_ATTR;
|
||||
static char fastscreen[LCD_WIDTH*LCD_HEIGHT] IBSS_ATTR;
|
||||
#endif
|
||||
|
||||
static fb_data palette[256] IBSS_ATTR;
|
||||
static fb_data *paldata=NULL;
|
||||
|
||||
//
|
||||
// I_ShutdownGraphics (NOT USED)
|
||||
// I_ShutdownGraphics
|
||||
//
|
||||
void I_ShutdownGraphics(void)
|
||||
{
|
||||
|
@ -187,6 +188,17 @@ void I_ShutdownGraphics(void)
|
|||
#define DOOMBUTTON_ESC BUTTON_POWER
|
||||
#define DOOMBUTTON_ENTER BUTTON_SCROLL_UP
|
||||
#define DOOMBUTTON_WEAPON BUTTON_SCROLL_DOWN
|
||||
#elif CONFIG_KEYPAD == GIGABEAT_PAD
|
||||
#define DOOMBUTTON_UP BUTTON_UP
|
||||
#define DOOMBUTTON_DOWN BUTTON_DOWN
|
||||
#define DOOMBUTTON_LEFT BUTTON_LEFT
|
||||
#define DOOMBUTTON_RIGHT BUTTON_RIGHT
|
||||
#define DOOMBUTTON_SHOOT BUTTON_A
|
||||
#define DOOMBUTTON_OPEN BUTTON_MENU
|
||||
#define DOOMBUTTON_ESC BUTTON_POWER
|
||||
#define DOOMBUTTON_ENTER BUTTON_SELECT
|
||||
#define DOOMBUTTON_WEAPON BUTTON_VOL_DOWN
|
||||
#define DOOMBUTTON_MAP BUTTON_VOL_UP
|
||||
#else
|
||||
#define DOOMBUTTON_UP BUTTON_UP
|
||||
#define DOOMBUTTON_DOWN BUTTON_DOWN
|
||||
|
@ -282,19 +294,24 @@ inline void getkey()
|
|||
D_PostEvent(&event);
|
||||
}
|
||||
#endif
|
||||
#ifdef DOOMBUTTON_ENTER
|
||||
if(released & DOOMBUTTON_ENTER)
|
||||
{
|
||||
event.data1=KEY_ENTER;
|
||||
D_PostEvent(&event);
|
||||
}
|
||||
#endif
|
||||
#ifdef DOOMBUTTON_WEAPON
|
||||
if(released & DOOMBUTTON_WEAPON)
|
||||
{
|
||||
event.data1 ='w';
|
||||
D_PostEvent(&event);
|
||||
}
|
||||
#endif
|
||||
#ifdef DOOMBUTTON_MAP
|
||||
if(released & DOOMBUTTON_MAP)
|
||||
{
|
||||
event.data1 =KEY_TAB;
|
||||
D_PostEvent(&event);
|
||||
}
|
||||
#endif
|
||||
}
|
||||
if(pressed)
|
||||
|
@ -352,6 +369,13 @@ inline void getkey()
|
|||
event.data1='w';
|
||||
D_PostEvent(&event);
|
||||
}
|
||||
#endif
|
||||
#ifdef DOOMBUTTON_MAP
|
||||
if(pressed & DOOMBUTTON_MAP)
|
||||
{
|
||||
event.data1 =KEY_TAB;
|
||||
D_PostEvent(&event);
|
||||
}
|
||||
#endif
|
||||
}
|
||||
}
|
||||
|
@ -481,7 +505,21 @@ void I_FinishUpdate (void)
|
|||
int y;
|
||||
|
||||
#ifdef HAVE_LCD_COLOR
|
||||
|
||||
#if(LCD_HEIGHT>LCD_WIDTH)
|
||||
if(rotate_screen)
|
||||
{
|
||||
int x;
|
||||
for (y=0; y<LCD_HEIGHT; y++)
|
||||
{
|
||||
for (x=0; x < LCD_WIDTH; x++)
|
||||
{
|
||||
paletteIndex = d_screens[0][SCREENWIDTH*(SCREENHEIGHT-1-x) + y];
|
||||
rb->lcd_framebuffer[y*LCD_WIDTH + x] = palette[paletteIndex];
|
||||
}
|
||||
}
|
||||
}
|
||||
else
|
||||
#endif
|
||||
for (y = 0; y < LCD_HEIGHT *LCD_WIDTH; y++)
|
||||
{
|
||||
paletteIndex = d_screens[0][y];
|
||||
|
@ -491,21 +529,21 @@ void I_FinishUpdate (void)
|
|||
#else /* !HAVE_LCD_COLOR */
|
||||
int x, yd = 0;
|
||||
|
||||
for (y = 0; y < LCD_HEIGHT; y++)
|
||||
for (y = 0; y < SCREENHEIGHT; y++)
|
||||
{
|
||||
for (x = 0; x < LCD_WIDTH; x++)
|
||||
for (x = 0; x < SCREENWIDTH; x++)
|
||||
{
|
||||
paletteIndex = d_screens[0][y*SCREENWIDTH + x];
|
||||
graybuffer[yd * LCD_WIDTH + x]=palette[paletteIndex];
|
||||
graybuffer[yd * SCREENWIDTH + x]=palette[paletteIndex];
|
||||
}
|
||||
if (++yd == 8)
|
||||
{
|
||||
gray_ub_gray_bitmap(graybuffer, 0, y & ~7, LCD_WIDTH, 8);
|
||||
gray_ub_gray_bitmap(graybuffer, 0, y & ~7, SCREENWIDTH, 8);
|
||||
yd = 0;
|
||||
}
|
||||
}
|
||||
if (yd > 0)
|
||||
gray_ub_gray_bitmap(graybuffer, 0, y & ~7, LCD_WIDTH, yd);
|
||||
gray_ub_gray_bitmap(graybuffer, 0, y & ~7, SCREENWIDTH, yd);
|
||||
#endif /* !HAVE_LCD_COLOR */
|
||||
#endif
|
||||
}
|
||||
|
@ -515,7 +553,7 @@ void I_FinishUpdate (void)
|
|||
//
|
||||
void I_ReadScreen (byte* scr)
|
||||
{
|
||||
memcpy (scr, d_screens[0], SCREENWIDTH*SCREENHEIGHT);
|
||||
memcpy (scr, d_screens[0], LCD_WIDTH*LCD_HEIGHT);
|
||||
}
|
||||
|
||||
//
|
||||
|
@ -550,6 +588,6 @@ void I_InitGraphics(void)
|
|||
d_screens[0] = fastscreen;
|
||||
#else
|
||||
// Don't know if this will fit in other IRAMs
|
||||
d_screens[0] = malloc ((SCREENWIDTH) * SCREENHEIGHT * sizeof(unsigned char));
|
||||
d_screens[0] = malloc (LCD_WIDTH * LCD_HEIGHT * sizeof(unsigned char));
|
||||
#endif
|
||||
}
|
||||
|
|
|
@ -291,7 +291,7 @@ default_t defaults[] =
|
|||
{"pitched_sounds",{&pitched_sounds, NULL},{0, NULL},0,1, // killough 2/21/98
|
||||
def_bool,ss_none, 0, 0}, // enables variable pitch in sound effects (from id's original code)
|
||||
// {"samplerate",{&snd_samplerate, NULL},{22050, NULL},11025,48000, def_int,ss_none, 0, 0},
|
||||
{"nosfxparm",{(void *)&nosfxparm, NULL},{0, NULL},0,1, def_bool,ss_none, 0, 0},
|
||||
{"enable_sound",{(void *)&enable_sound, NULL},{0, NULL},0,1, def_bool,ss_none, 0, 0},
|
||||
{"sfx_volume",{&snd_SfxVolume, NULL},{8, NULL},0,15, def_int,ss_none, 0, 0},
|
||||
{"music_volume",{&snd_MusicVolume, NULL},{8, NULL},0,15, def_int,ss_none, 0, 0},
|
||||
{"mus_pause_opt",{&mus_pause_opt, NULL},{2, NULL},0,2, // CPhipps - music pausing
|
||||
|
@ -307,6 +307,10 @@ default_t defaults[] =
|
|||
def_int,ss_none, 0, 0},
|
||||
{"screen_height",{&desired_screenheight, NULL},{200, NULL},200,1200,
|
||||
def_int,ss_none, 0, 0},*/
|
||||
#if(LCD_HEIGHT>LCD_WIDTH)
|
||||
{"rotate_screen",{(void *)&rotate_screen, NULL},{0, NULL},0,1,
|
||||
def_bool,ss_none, 0, 0}, /* kwk - rotate the screen 90 degrees */
|
||||
#endif
|
||||
{"fake_contrast",{&fake_contrast, NULL},{1, NULL},0,1,
|
||||
def_bool,ss_none, 0, 0}, /* cph - allow crappy fake contrast to be disabled */
|
||||
// {"use_fullscreen",{&use_fullscreen, NULL},{1, NULL},0,1, /* proff 21/05/2000 */
|
||||
|
|
|
@ -66,7 +66,7 @@ void R_ClearDrawSegs(void)
|
|||
// Instead of clipsegs, let's try using an array with one entry for each column,
|
||||
// indicating whether it's blocked by a solid wall yet or not.
|
||||
|
||||
byte solidcol[SCREENWIDTH] IBSS_ATTR;
|
||||
byte solidcol[MAX_SCREENWIDTH] IBSS_ATTR;
|
||||
|
||||
// CPhipps -
|
||||
// R_ClipWallSegment
|
||||
|
|
|
@ -434,9 +434,9 @@ typedef struct visplane
|
|||
fixed_t height;
|
||||
fixed_t xoffs, yoffs; // killough 2/28/98: Support scrolling flats
|
||||
unsigned short pad1; // leave pads for [minx-1]/[maxx+1]
|
||||
unsigned short top[SCREENWIDTH];
|
||||
unsigned short top[MAX_SCREENWIDTH];
|
||||
unsigned short pad2, pad3; // killough 2/8/98, 4/25/98
|
||||
unsigned short bottom[SCREENWIDTH];
|
||||
unsigned short bottom[MAX_SCREENWIDTH];
|
||||
unsigned short pad4;
|
||||
}
|
||||
visplane_t;
|
||||
|
|
|
@ -86,7 +86,7 @@ int *viewangletox=0;
|
|||
// to the lowest viewangle that maps back to x ranges
|
||||
// from clipangle to -clipangle.
|
||||
|
||||
angle_t xtoviewangle[SCREENWIDTH+1]; // killough 2/8/98
|
||||
angle_t xtoviewangle[MAX_SCREENWIDTH+1]; // killough 2/8/98
|
||||
|
||||
// killough 3/20/98: Support dynamic colormaps, e.g. deep water
|
||||
// killough 4/4/98: support dynamic number of them as well
|
||||
|
|
|
@ -73,11 +73,11 @@ short *openings,*lastopening;
|
|||
// floorclip starts out SCREENHEIGHT
|
||||
// ceilingclip starts out -1
|
||||
|
||||
short floorclip[SCREENWIDTH], ceilingclip[SCREENWIDTH];
|
||||
short floorclip[MAX_SCREENWIDTH], ceilingclip[MAX_SCREENWIDTH];
|
||||
|
||||
// spanstart holds the start of a plane span; initialized to 0 at start
|
||||
|
||||
static int spanstart[SCREENHEIGHT]; // killough 2/8/98
|
||||
static int spanstart[MAX_SCREENHEIGHT]; // killough 2/8/98
|
||||
|
||||
//
|
||||
// texture mapping
|
||||
|
@ -89,13 +89,13 @@ static fixed_t planeheight;
|
|||
// killough 2/8/98: make variables static
|
||||
|
||||
static fixed_t basexscale, baseyscale;
|
||||
static fixed_t cachedheight[SCREENHEIGHT];
|
||||
static fixed_t cacheddistance[SCREENHEIGHT];
|
||||
static fixed_t cachedxstep[SCREENHEIGHT];
|
||||
static fixed_t cachedystep[SCREENHEIGHT];
|
||||
static fixed_t cachedheight[MAX_SCREENHEIGHT];
|
||||
static fixed_t cacheddistance[MAX_SCREENHEIGHT];
|
||||
static fixed_t cachedxstep[MAX_SCREENHEIGHT];
|
||||
static fixed_t cachedystep[MAX_SCREENHEIGHT];
|
||||
static fixed_t xoffs, yoffs; // killough 2/28/98: flat offsets
|
||||
|
||||
fixed_t yslope[SCREENHEIGHT], distscale[SCREENWIDTH];
|
||||
fixed_t yslope[MAX_SCREENHEIGHT], distscale[MAX_SCREENWIDTH];
|
||||
|
||||
//
|
||||
// R_InitPlanes
|
||||
|
|
|
@ -251,7 +251,7 @@ void R_RenderMaskedSegRange(drawseg_t *ds, int x1, int x2)
|
|||
// CALLED: CORE LOOPING ROUTINE.
|
||||
//
|
||||
|
||||
extern byte solidcol[SCREENWIDTH];
|
||||
extern byte solidcol[MAX_SCREENWIDTH];
|
||||
#define HEIGHTBITS 12
|
||||
#define HEIGHTUNIT (1<<HEIGHTBITS)
|
||||
static int didsolidcol; /* True if at least one column was marked solid */
|
||||
|
|
|
@ -109,7 +109,7 @@ extern angle_t viewangle;
|
|||
extern player_t *viewplayer;
|
||||
extern angle_t clipangle;
|
||||
extern int *viewangletox;
|
||||
extern angle_t xtoviewangle[SCREENWIDTH+1]; // killough 2/8/98
|
||||
extern angle_t xtoviewangle[MAX_SCREENWIDTH+1]; // killough 2/8/98
|
||||
extern fixed_t rw_distance;
|
||||
extern angle_t rw_normalangle;
|
||||
|
||||
|
|
|
@ -71,8 +71,8 @@ static lighttable_t** spritelights;
|
|||
|
||||
// constant arrays
|
||||
// used for psprite clipping and initializing clipping
|
||||
short negonearray[SCREENWIDTH];
|
||||
short screenheightarray[SCREENWIDTH];
|
||||
short negonearray[MAX_SCREENWIDTH];
|
||||
short screenheightarray[MAX_SCREENWIDTH];
|
||||
|
||||
|
||||
//
|
||||
|
@ -282,7 +282,7 @@ void R_InitSprites(const char * const *namelist)
|
|||
{
|
||||
int i;
|
||||
|
||||
for (i=0 ; i<SCREENWIDTH ; i++)
|
||||
for (i=0 ; i<MAX_SCREENWIDTH ; i++)
|
||||
negonearray[i] = -1;
|
||||
R_InitSpriteDefs (namelist);
|
||||
}
|
||||
|
@ -835,8 +835,8 @@ void R_SortVisSprites (void)
|
|||
void R_DrawSprite (vissprite_t* spr)
|
||||
{
|
||||
drawseg_t *ds;
|
||||
short clipbot[SCREENWIDTH]; // killough 2/8/98:
|
||||
short cliptop[SCREENWIDTH]; // change to MAX_*
|
||||
short clipbot[MAX_SCREENWIDTH]; // killough 2/8/98:
|
||||
short cliptop[MAX_SCREENWIDTH]; // change to MAX_*
|
||||
int x;
|
||||
int r1;
|
||||
int r2;
|
||||
|
|
|
@ -38,8 +38,8 @@
|
|||
|
||||
/* Constant arrays used for psprite clipping and initializing clipping. */
|
||||
|
||||
extern short negonearray[SCREENWIDTH];
|
||||
extern short screenheightarray[SCREENWIDTH];
|
||||
extern short negonearray[MAX_SCREENWIDTH];
|
||||
extern short screenheightarray[MAX_SCREENWIDTH];
|
||||
|
||||
/* Vars for R_DrawMaskedColumn */
|
||||
|
||||
|
|
|
@ -108,6 +108,7 @@ int printf(const char *fmt, ...)
|
|||
static int p_xtpt;
|
||||
char p_buf[50];
|
||||
bool ok;
|
||||
rb->yield();
|
||||
va_list ap;
|
||||
|
||||
va_start(ap, fmt);
|
||||
|
@ -293,67 +294,20 @@ int Dbuild_base (struct opt_items *names)
|
|||
|
||||
D_AddFile (GAMEBASE"rockdoom.wad", source_pwad);
|
||||
|
||||
int i=0;
|
||||
int i=0, j;
|
||||
/* Doom Shareware */
|
||||
if ( !fileexists (wads_builtin[0]) )
|
||||
{
|
||||
names[i].string=versions_builtin[0];
|
||||
names[i].voice_id=0;
|
||||
namemap[i]=0;
|
||||
i++;
|
||||
}
|
||||
|
||||
/* Doom registered */
|
||||
if ( !fileexists (wads_builtin[1]) )
|
||||
{
|
||||
names[i].string=versions_builtin[1];
|
||||
names[i].voice_id=0;
|
||||
namemap[i]=1;
|
||||
i++;
|
||||
}
|
||||
|
||||
/* Ultimate Doom */
|
||||
if ( !fileexists (wads_builtin[2]) )
|
||||
{
|
||||
names[i].string=versions_builtin[2];
|
||||
names[i].voice_id=0;
|
||||
namemap[i]=2;
|
||||
i++;
|
||||
}
|
||||
|
||||
/* Doom2 */
|
||||
if ( !fileexists (wads_builtin[3]) )
|
||||
{
|
||||
names[i].string=versions_builtin[3];
|
||||
names[i].voice_id=0;
|
||||
namemap[i]=3;
|
||||
i++;
|
||||
}
|
||||
|
||||
/* Doom2f */
|
||||
if ( !fileexists (wads_builtin[4]) )
|
||||
{
|
||||
names[i].string=versions_builtin[4];
|
||||
names[i].voice_id=0;
|
||||
namemap[i]=4;
|
||||
i++;
|
||||
}
|
||||
|
||||
/* Plutonia */
|
||||
if ( !fileexists (wads_builtin[5]) )
|
||||
{
|
||||
names[i].string=versions_builtin[5];
|
||||
names[i].voice_id=0;
|
||||
namemap[i]=5;
|
||||
i++;
|
||||
}
|
||||
|
||||
/* TNT */
|
||||
if ( !fileexists (wads_builtin[6]) )
|
||||
for(j=0;j<7;j++)
|
||||
if ( !fileexists (wads_builtin[j]) )
|
||||
{
|
||||
names[i].string=versions_builtin[6];
|
||||
names[i].string=versions_builtin[j];
|
||||
names[i].voice_id=0;
|
||||
namemap[i]=6;
|
||||
namemap[i]=j;
|
||||
i++;
|
||||
}
|
||||
// Set argvlist defaults
|
||||
|
@ -362,7 +316,7 @@ int Dbuild_base (struct opt_items *names)
|
|||
return i;
|
||||
}
|
||||
|
||||
// This is a general function that takes in an menu_item structure and makes a list
|
||||
// This is a general function that takes in a menu_item structure and makes a list
|
||||
// of files within it based on matching the string stringmatch to the files.
|
||||
int Dbuild_filelistm(struct menu_item **names, char *firstentry, char *directory, char *stringmatch)
|
||||
{
|
||||
|
@ -413,8 +367,10 @@ int Dbuild_filelistm(struct menu_item **names, char *firstentry, char *directory
|
|||
return i;
|
||||
}
|
||||
|
||||
static int translatekey(int key) __attribute__ ((noinline));
|
||||
|
||||
// This key configuration code is not the cleanest or the most efficient, but it works
|
||||
int translatekey(int key)
|
||||
static int translatekey(int key)
|
||||
{
|
||||
if (key<31)
|
||||
{
|
||||
|
@ -431,16 +387,17 @@ int translatekey(int key)
|
|||
case 4:
|
||||
return KEY_DOWNARROW;
|
||||
case 5:
|
||||
return KEY_RCTRL;
|
||||
case 6:
|
||||
return ' ';
|
||||
case 7:
|
||||
return KEY_ESCAPE;
|
||||
case 8:
|
||||
return 'w';
|
||||
case 9:
|
||||
return KEY_ENTER;
|
||||
case 6:
|
||||
return KEY_RCTRL;
|
||||
case 7:
|
||||
return ' ';
|
||||
case 8:
|
||||
return KEY_ESCAPE;
|
||||
case 9:
|
||||
return 'w';
|
||||
case 10:
|
||||
return KEY_TAB;
|
||||
default:
|
||||
return 0;
|
||||
}
|
||||
|
@ -459,17 +416,18 @@ int translatekey(int key)
|
|||
return 3;
|
||||
case KEY_DOWNARROW:
|
||||
return 4;
|
||||
case KEY_RCTRL:
|
||||
return 5;
|
||||
case ' ':
|
||||
return 6;
|
||||
case KEY_ESCAPE:
|
||||
return 7;
|
||||
case 'w':
|
||||
return 8;
|
||||
case KEY_ENTER:
|
||||
return 5;
|
||||
case KEY_RCTRL:
|
||||
return 6;
|
||||
case ' ':
|
||||
return 7;
|
||||
case KEY_ESCAPE:
|
||||
return 8;
|
||||
case 'w':
|
||||
return 9;
|
||||
case KEY_F9:
|
||||
case KEY_TAB:
|
||||
return 10;
|
||||
default:
|
||||
return 0;
|
||||
}
|
||||
|
@ -484,18 +442,40 @@ int Oset_keys()
|
|||
int m, result;
|
||||
int menuquit=0;
|
||||
|
||||
|
||||
static const struct opt_items doomkeys[] = {
|
||||
{ "Unmapped", NULL },
|
||||
{ "Key Right", NULL },
|
||||
{ "Key Left", NULL },
|
||||
{ "Key Up", NULL },
|
||||
{ "Key Down", NULL },
|
||||
{ "Key Select", NULL },
|
||||
#if defined(TOSHIBA_GIGABEAT_F)
|
||||
{ "Key A", NULL },
|
||||
{ "Key Menu", NULL },
|
||||
{ "Key Power", NULL },
|
||||
{ "Key Volume Down", NULL },
|
||||
{ "Key Volume Up", NULL },
|
||||
#else
|
||||
{ "Key Record", NULL },
|
||||
{ "Key Mode", NULL },
|
||||
{ "Key Off", NULL },
|
||||
{ "Key On", NULL },
|
||||
{ "Key Select", NULL },
|
||||
#endif
|
||||
};
|
||||
|
||||
int *keys[]={
|
||||
&key_right,
|
||||
&key_left,
|
||||
&key_up,
|
||||
&key_down,
|
||||
&key_fire,
|
||||
&key_use,
|
||||
&key_strafe,
|
||||
&key_weapon,
|
||||
&key_map
|
||||
};
|
||||
|
||||
int numdoomkeys=sizeof(doomkeys) / sizeof(*doomkeys);
|
||||
|
||||
static const struct menu_item items[] = {
|
||||
|
@ -516,65 +496,13 @@ int Oset_keys()
|
|||
while(!menuquit)
|
||||
{
|
||||
result=rb->menu_show(m);
|
||||
switch (result)
|
||||
{
|
||||
case 0:
|
||||
key_right=translatekey(key_right);
|
||||
rb->set_option(items[0].desc, &key_right, INT, doomkeys, numdoomkeys, NULL );
|
||||
key_right=translatekey(key_right);
|
||||
break;
|
||||
|
||||
case 1:
|
||||
key_left=translatekey(key_left);
|
||||
rb->set_option(items[1].desc, &key_left, INT, doomkeys, numdoomkeys, NULL );
|
||||
key_left=translatekey(key_left);
|
||||
break;
|
||||
|
||||
case 2:
|
||||
key_up=translatekey(key_up);
|
||||
rb->set_option(items[2].desc, &key_up, INT, doomkeys, numdoomkeys, NULL );
|
||||
key_up=translatekey(key_up);
|
||||
break;
|
||||
|
||||
case 3:
|
||||
key_down=translatekey(key_down);
|
||||
rb->set_option(items[3].desc, &key_down, INT, doomkeys, numdoomkeys, NULL );
|
||||
key_down=translatekey(key_down);
|
||||
break;
|
||||
|
||||
case 4:
|
||||
key_fire=translatekey(key_fire);
|
||||
rb->set_option(items[4].desc, &key_fire, INT, doomkeys, numdoomkeys, NULL );
|
||||
key_fire=translatekey(key_fire);
|
||||
break;
|
||||
|
||||
case 5:
|
||||
key_use=translatekey(key_use);
|
||||
rb->set_option(items[5].desc, &key_use, INT, doomkeys, numdoomkeys, NULL );
|
||||
key_use=translatekey(key_use);
|
||||
break;
|
||||
|
||||
case 6:
|
||||
key_strafe=translatekey(key_strafe);
|
||||
rb->set_option(items[6].desc, &key_strafe, INT, doomkeys, numdoomkeys, NULL );
|
||||
key_strafe=translatekey(key_strafe);
|
||||
break;
|
||||
|
||||
case 7:
|
||||
key_weapon=translatekey(key_weapon);
|
||||
rb->set_option(items[7].desc, &key_weapon, INT, doomkeys, numdoomkeys, NULL );
|
||||
key_weapon=translatekey(key_weapon);
|
||||
break;
|
||||
|
||||
case 8:
|
||||
key_map=translatekey(key_map);
|
||||
rb->set_option(items[8].desc, &key_map, INT, doomkeys, numdoomkeys, NULL );
|
||||
key_map=translatekey(key_map);
|
||||
break;
|
||||
|
||||
default:
|
||||
if(result<0)
|
||||
menuquit=1;
|
||||
break;
|
||||
else
|
||||
{
|
||||
*keys[result]=translatekey(*keys[result]);
|
||||
rb->set_option(items[result].desc, keys[result], INT, doomkeys, numdoomkeys, NULL );
|
||||
*keys[result]=translatekey(*keys[result]);
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -596,8 +524,8 @@ static bool Doptions()
|
|||
int menuquit=0;
|
||||
|
||||
static const struct menu_item items[] = {
|
||||
{ "Sound", NULL },
|
||||
{ "Set Keys", NULL },
|
||||
{ "Sound", NULL },
|
||||
{ "Timedemo", NULL },
|
||||
{ "Player Bobbing", NULL },
|
||||
{ "Weapon Recoil", NULL },
|
||||
|
@ -606,6 +534,24 @@ static bool Doptions()
|
|||
{ "Always Run", NULL },
|
||||
{ "Headsup Display", NULL },
|
||||
{ "Statusbar Always Red", NULL },
|
||||
#if(LCD_HEIGHT>LCD_WIDTH)
|
||||
{ "Rotate Screen 90 deg", NULL },
|
||||
#endif
|
||||
};
|
||||
|
||||
void *options[]={
|
||||
&enable_sound,
|
||||
&argvlist.timedemo,
|
||||
&default_player_bobbing,
|
||||
&default_weapon_recoil,
|
||||
&default_translucency,
|
||||
&fake_contrast,
|
||||
&autorun,
|
||||
&hud_displayed,
|
||||
&sts_always_red,
|
||||
#if(LCD_HEIGHT>LCD_WIDTH)
|
||||
&rotate_screen,
|
||||
#endif
|
||||
};
|
||||
|
||||
m = rb->menu_init(items, sizeof(items) / sizeof(*items),
|
||||
|
@ -614,54 +560,12 @@ static bool Doptions()
|
|||
while(!menuquit)
|
||||
{
|
||||
result=rb->menu_show(m);
|
||||
switch (result)
|
||||
{
|
||||
case 0: /* Sound */
|
||||
nosfxparm=!nosfxparm; // Have to invert it before setting
|
||||
rb->set_option(items[0].desc, &nosfxparm, INT, onoff, 2, NULL );
|
||||
nosfxparm=!nosfxparm;
|
||||
break;
|
||||
|
||||
case 1: /* Keys */
|
||||
if(result==0)
|
||||
Oset_keys();
|
||||
break;
|
||||
|
||||
case 2: /* Timedemo */
|
||||
rb->set_option(items[2].desc, &argvlist.timedemo, INT, onoff, 2, NULL );
|
||||
break;
|
||||
|
||||
case 3: /* Player Bobbing */
|
||||
rb->set_option(items[3].desc, &default_player_bobbing, INT, onoff, 2, NULL );
|
||||
break;
|
||||
|
||||
case 4: /* Weapon Recoil */
|
||||
rb->set_option(items[4].desc, &default_weapon_recoil, INT, onoff, 2, NULL );
|
||||
break;
|
||||
|
||||
case 5: /* Translucency */
|
||||
rb->set_option(items[5].desc, &default_translucency, INT, onoff, 2, NULL );
|
||||
break;
|
||||
|
||||
case 6: /* Fake Contrast */
|
||||
rb->set_option(items[6].desc, &fake_contrast, INT, onoff, 2, NULL );
|
||||
break;
|
||||
|
||||
case 7: /* Always Run */
|
||||
rb->set_option(items[7].desc, &autorun, INT, onoff, 2, NULL );
|
||||
break;
|
||||
|
||||
case 8: /* Headsup Display */
|
||||
rb->set_option(items[8].desc, &hud_displayed, INT, onoff, 2, NULL );
|
||||
break;
|
||||
|
||||
case 9: /* Statusbar always red */
|
||||
rb->set_option(items[9].desc, &sts_always_red, INT, onoff, 2, NULL );
|
||||
break;
|
||||
|
||||
default:
|
||||
else if (result > 0)
|
||||
rb->set_option(items[result].desc, options[result-1], INT, onoff, 2, NULL );
|
||||
else
|
||||
menuquit=1;
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
rb->menu_exit(m);
|
||||
|
@ -807,6 +711,19 @@ enum plugin_status plugin_start(struct plugin_api* api, void* parameter)
|
|||
else if( result == -2 ) return PLUGIN_ERROR; // Missing base wads
|
||||
}
|
||||
|
||||
#if(LCD_HEIGHT>LCD_WIDTH)
|
||||
if(rotate_screen)
|
||||
{
|
||||
SCREENHEIGHT=LCD_WIDTH;
|
||||
SCREENWIDTH=LCD_HEIGHT;
|
||||
}
|
||||
else
|
||||
{
|
||||
SCREENHEIGHT=LCD_HEIGHT;
|
||||
SCREENWIDTH=LCD_WIDTH;
|
||||
}
|
||||
#endif
|
||||
|
||||
Dhandle_ver( namemap[ result ] );
|
||||
|
||||
rb->lcd_setfont(0);
|
||||
|
|
|
@ -100,6 +100,6 @@ inline void* memcpy(void* dst, const void* src, size_t size);
|
|||
structure changes.
|
||||
*/
|
||||
#define DOOM_CONFIG_MAGIC MAKE_FOURCC('D','O','O','M')
|
||||
#define DOOM_CONFIG_VERSION 2
|
||||
#define DOOM_CONFIG_VERSION 3
|
||||
|
||||
#endif
|
||||
|
|
|
@ -117,7 +117,7 @@ void S_Init(int sfxVolume,int musicVolume )
|
|||
{
|
||||
//jff 1/22/98 skip sound init if sound not enabled
|
||||
numChannels = default_numChannels;
|
||||
if (!nosfxparm)
|
||||
if (enable_sound)
|
||||
{
|
||||
int i;
|
||||
|
||||
|
@ -154,7 +154,7 @@ void S_Start(void)
|
|||
{
|
||||
int cnum, mnum;
|
||||
|
||||
if (!nosfxparm)
|
||||
if (enable_sound)
|
||||
{
|
||||
// kill all playing sounds at start of level
|
||||
// (trust me - a good idea)
|
||||
|
@ -198,7 +198,7 @@ void S_StartSoundAtVolume(void *origin_p, int sfx_id, int volume)
|
|||
sfxinfo_t* sfx;
|
||||
mobj_t* origin = (mobj_t *) origin_p;
|
||||
|
||||
if (nosfxparm)
|
||||
if (!enable_sound)
|
||||
return;
|
||||
|
||||
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)
|
|||
{
|
||||
int cnum;
|
||||
|
||||
if (nosfxparm)
|
||||
if (!enable_sound)
|
||||
return;
|
||||
|
||||
for (cnum=0 ; cnum<numChannels ; cnum++)
|
||||
|
@ -311,7 +311,7 @@ void S_StopSound(void *origin)
|
|||
//
|
||||
void S_PauseSound(void)
|
||||
{
|
||||
if (nosfxparm)
|
||||
if (!enable_sound)
|
||||
return;
|
||||
|
||||
if (mus_playing && !mus_paused)
|
||||
|
@ -323,7 +323,7 @@ void S_PauseSound(void)
|
|||
|
||||
void S_ResumeSound(void)
|
||||
{
|
||||
if (nosfxparm)
|
||||
if (!enable_sound)
|
||||
return;
|
||||
|
||||
if (mus_playing && mus_paused)
|
||||
|
@ -342,7 +342,7 @@ void S_UpdateSounds(void* listener_p)
|
|||
|
||||
mobj_t* listener = (mobj_t*)listener_p;
|
||||
|
||||
if (nosfxparm)
|
||||
if (!enable_sound)
|
||||
return;
|
||||
|
||||
for (cnum=0 ; cnum<numChannels ; cnum++)
|
||||
|
@ -392,7 +392,7 @@ void S_UpdateSounds(void* listener_p)
|
|||
|
||||
void S_SetMusicVolume(int volume)
|
||||
{
|
||||
if (nosfxparm)
|
||||
if (!enable_sound)
|
||||
return;
|
||||
|
||||
if (volume < 0 || volume > 15)
|
||||
|
@ -403,7 +403,7 @@ void S_SetMusicVolume(int volume)
|
|||
|
||||
void S_SetSfxVolume(int volume)
|
||||
{
|
||||
if (nosfxparm)
|
||||
if (!enable_sound)
|
||||
return;
|
||||
|
||||
if (volume < 0 || volume > 127)
|
||||
|
@ -416,7 +416,7 @@ void S_SetSfxVolume(int volume)
|
|||
//
|
||||
void S_StartMusic(int m_id)
|
||||
{
|
||||
if (nosfxparm)
|
||||
if (!enable_sound)
|
||||
return;
|
||||
S_ChangeMusic(m_id, false);
|
||||
}
|
||||
|
@ -425,7 +425,7 @@ void S_ChangeMusic(int musicnum, int looping)
|
|||
{
|
||||
musicinfo_t *music;
|
||||
|
||||
if (nosfxparm)
|
||||
if (!enable_sound)
|
||||
return;
|
||||
|
||||
if (musicnum <= mus_None || musicnum >= NUMMUSIC)
|
||||
|
@ -464,7 +464,7 @@ void S_ChangeMusic(int musicnum, int looping)
|
|||
|
||||
void S_StopMusic(void)
|
||||
{
|
||||
if (nosfxparm)
|
||||
if (!enable_sound)
|
||||
return;
|
||||
|
||||
if (mus_playing)
|
||||
|
@ -487,7 +487,7 @@ void S_StopChannel(int cnum)
|
|||
int i;
|
||||
channel_t* c = &channels[cnum];
|
||||
|
||||
if (nosfxparm)
|
||||
if (!enable_sound)
|
||||
return;
|
||||
|
||||
if (c->sfxinfo)
|
||||
|
@ -521,7 +521,7 @@ int S_AdjustSoundParams(mobj_t *listener, mobj_t *source,
|
|||
fixed_t adx, ady, approx_dist;
|
||||
angle_t angle;
|
||||
|
||||
if (nosfxparm)
|
||||
if (!enable_sound)
|
||||
return 0;
|
||||
|
||||
// calculate the distance to sound origin
|
||||
|
@ -576,7 +576,7 @@ static int S_getChannel(void *origin, sfxinfo_t *sfxinfo, int is_pickup)
|
|||
int cnum;
|
||||
channel_t* c;
|
||||
|
||||
if (nosfxparm)
|
||||
if (!enable_sound)
|
||||
return -1;
|
||||
|
||||
// Find an open channel
|
||||
|
|
|
@ -485,7 +485,7 @@ void W_Init(void)
|
|||
int W_LumpLength (int lump)
|
||||
{
|
||||
if (lump >= numlumps)
|
||||
I_Error ("W_LumpLength: %i >= numlumps",lump);
|
||||
I_Error ("W_LumpLength: %d >= numlumps",lump);
|
||||
return lumpinfo[lump].size;
|
||||
}
|
||||
|
||||
|
@ -501,7 +501,7 @@ void W_ReadLump(int lump, void *dest)
|
|||
|
||||
#ifdef RANGECHECK
|
||||
if (lump >= numlumps)
|
||||
I_Error ("W_ReadLump: %i >= numlumps",lump);
|
||||
I_Error ("W_ReadLump: %d >= numlumps",lump);
|
||||
#endif
|
||||
|
||||
#ifndef NO_PREDEFINED_LUMPS
|
||||
|
@ -522,7 +522,7 @@ void W_ReadLump(int lump, void *dest)
|
|||
lseek(l->handle, l->position, SEEK_SET);
|
||||
c = read(l->handle, dest, l->size);
|
||||
if (c < l->size)
|
||||
I_Error("W_ReadLump: only read %i of %i on lump %i", c, l->size, lump);
|
||||
I_Error("W_ReadLump: only read %d of %d on lump %d", c, l->size, lump);
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -538,7 +538,7 @@ void * (W_CacheLumpNum)(int lump, unsigned short locks)
|
|||
{
|
||||
#ifdef RANGECHECK
|
||||
if ((unsigned)lump >= (unsigned)numlumps)
|
||||
I_Error ("W_CacheLumpNum: %i >= numlumps",lump);
|
||||
I_Error ("W_CacheLumpNum: %d >= numlumps",lump);
|
||||
#endif
|
||||
|
||||
if (!lumpcache[lump]) // read the lump in
|
||||
|
@ -578,7 +578,7 @@ void * W_CacheLumpNumPadded(int lump, size_t len, unsigned char pad)
|
|||
const int locks = 1;
|
||||
#ifdef RANGECHECK
|
||||
if ((unsigned)lump >= (unsigned)numlumps)
|
||||
I_Error ("W_CacheLumpNum: %i >= numlumps",lump);
|
||||
I_Error ("W_CacheLumpNum: %d >= numlumps",lump);
|
||||
#endif
|
||||
|
||||
if (!lumpcache[lump]) { /* read the lump in */
|
||||
|
|
|
@ -115,7 +115,8 @@ static void Z_PrintStats(void) // Print allocation statistics
|
|||
unsigned long total_memory = free_memory + active_memory +
|
||||
purgable_memory + inactive_memory +
|
||||
virtual_memory;
|
||||
double s = 100.0 / total_memory;
|
||||
// double s = 100.0 / total_memory;
|
||||
int s = 100/total_memory;
|
||||
|
||||
doom_printf("%-5u\t%6.01f%%\tstatic\n"
|
||||
"%-5u\t%6.01f%%\tpurgable\n"
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue