From 7e6f74e429aec0e6fa9041f8647a7bab32eea0c4 Mon Sep 17 00:00:00 2001 From: Karl Kurbjun Date: Wed, 13 Dec 2006 04:44:17 +0000 Subject: [PATCH] Dehacked and BEX support for Doom - currently only supports a DEHACKED file in a WAD (not as a standalone file yet). git-svn-id: svn://svn.rockbox.org/rockbox/trunk@11738 a1c6a512-1295-4272-9138-f99709370657 --- apps/plugins/doom/Makefile | 24 ++-- apps/plugins/doom/am_map.c | 16 +-- apps/plugins/doom/d_main.c | 8 ++ apps/plugins/doom/dstrings.h | 2 +- apps/plugins/doom/f_finale.c | 103 +++++++------- apps/plugins/doom/g_game.c | 2 +- apps/plugins/doom/hu_stuff.c | 245 +++++++-------------------------- apps/plugins/doom/hu_stuff.h | 8 +- apps/plugins/doom/i_sound.c | 9 +- apps/plugins/doom/i_video.c | 81 +++++------ apps/plugins/doom/m_menu.c | 54 ++++---- apps/plugins/doom/p_doors.c | 14 +- apps/plugins/doom/p_inter.c | 77 ++++++----- apps/plugins/doom/p_pspr.c | 4 +- apps/plugins/doom/p_spec.c | 20 +-- apps/plugins/doom/rockdoom.c | 16 --- apps/plugins/doom/rockmacros.h | 4 +- 17 files changed, 260 insertions(+), 427 deletions(-) diff --git a/apps/plugins/doom/Makefile b/apps/plugins/doom/Makefile index f0e858a393..538d57720c 100644 --- a/apps/plugins/doom/Makefile +++ b/apps/plugins/doom/Makefile @@ -3,7 +3,10 @@ # $Id$ # # $Log$ -# Revision 1.10 2006/10/27 21:47:55 amiconn +# Revision 1.11 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.10 2006-10-27 21:47:55 amiconn # 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. # # Revision 1.9 2006-10-23 22:33:36 amiconn @@ -39,16 +42,20 @@ INCLUDES = -I$(APPSDIR) -I.. -I. $(TARGET_INC) -I$(FIRMDIR)/include -I$(FIRMDIR) -I$(FIRMDIR)/common -I$(FIRMDIR)/drivers -I$(OUTDIR) -I$(BUILDDIR) CFLAGS = $(INCLUDES) $(GCCOPTS) $(TARGET) $(EXTRA_DEFINES) \ -DTARGET_ID=$(TARGET_ID) -DMEM=${MEMORYSIZE} -DPLUGIN \ - -Wno-strict-prototypes -O2 $(PROFILE_OPTS) + -Wno-strict-prototypes $(PROFILE_OPTS) ifdef APPEXTRA INCLUDES += $(patsubst %,-I$(APPSDIR)/%,$(subst :, ,$(APPEXTRA))) endif -ifneq (,$(strip $(foreach tgt,IPOD_NANO IPOD_COLOR IPOD_VIDEO,$(findstring $(tgt),$(TARGET))))) +# The arm code compiles too large for the plugin buffer when set to optimize for speed +ifeq ($(CC), arm-elf-gcc) + CFLAGS += -Os ifndef SIMVER CFLAGS += -mstructure-size-boundary=8 endif +else + CFLAGS += -O2 endif LINKFILE := $(OBJDIR)/link.lds @@ -62,8 +69,10 @@ SRC = info.c doomdef.c doomstat.c dstrings.c tables.c \ r_plane.c r_segs.c r_sky.c r_things.c wi_stuff.c v_video.c st_lib.c \ st_stuff.c hu_stuff.c hu_lib.c s_sound.c z_zone.c z_bmalloc.c sounds.c \ d_main.c m_misc.c m_bbox.c i_system.c i_sound.c i_video.c \ - w_wad.c rockdoom.c -# fixmath2.S + w_wad.c rockdoom.c d_deh.c ../../../firmware/common/sscanf.c + +# sscanf isn't built into the core right now - should remove from here if that +# changes SOURCES = $(SRC) OBJS := $(SRC:%.c=$(OBJDIR)/%.o) @@ -73,13 +82,8 @@ DIRS = . ifndef SIMVER -ifneq (,$(findstring RECORDER,$(TARGET))) ## Archos recorder targets - LDS := archos.lds - OUTPUT = $(OUTDIR)/doom.ovl -else ## iRiver target LDS := ../plugin.lds OUTPUT = $(OUTDIR)/doom.rock -endif else ## simulators OUTPUT = $(OUTDIR)/doom.rock endif diff --git a/apps/plugins/doom/am_map.c b/apps/plugins/doom/am_map.c index 8f04f0df30..eb4e13279e 100644 --- a/apps/plugins/doom/am_map.c +++ b/apps/plugins/doom/am_map.c @@ -41,7 +41,7 @@ #include "p_spec.h" #include "am_map.h" #include "dstrings.h" -//#include "d_deh.h" // Ty 03/27/98 - externalizations +#include "d_deh.h" // Ty 03/27/98 - externalizations #include "g_game.h" #include "rockmacros.h" @@ -72,7 +72,7 @@ int mapcolor_sngl; // single player arrow color int mapcolor_plyr[4] = { 112, 88, 64, 176 }; // colors for player arrows in multiplayer //jff 3/9/98 add option to not show secret sectors until entered -int map_secret_after=0; +int map_secret_after; //jff 4/3/98 add symbols for "no-color" for disable and "black color" for black #define NC 0 #define BC 247 @@ -702,33 +702,33 @@ boolean AM_Responder automapmode ^= am_follow; // CPhipps - put all automap mode stuff into one enum f_oldloc.x = INT_MAX; // Ty 03/27/98 - externalized - plr->message = (automapmode & am_follow) ? AMSTR_FOLLOWON : AMSTR_FOLLOWOFF; + plr->message = (automapmode & am_follow) ? s_AMSTR_FOLLOWON : s_AMSTR_FOLLOWOFF; } else if (ch == key_map_grid) { automapmode ^= am_grid; // CPhipps // Ty 03/27/98 - *not* externalized - plr->message = (automapmode & am_grid) ? AMSTR_GRIDON : AMSTR_GRIDOFF; + plr->message = (automapmode & am_grid) ? s_AMSTR_GRIDON : s_AMSTR_GRIDOFF; } else if (ch == key_map_mark) { // Ty 03/27/98 - *not* externalized - snprintf(buffer, sizeof(buffer), "%s %d", AMSTR_MARKEDSPOT, markpointnum); + snprintf(buffer, sizeof(buffer), "%s %d", s_AMSTR_MARKEDSPOT, markpointnum); plr->message = buffer; AM_addMark(); } else if (ch == key_map_clear) { AM_clearMarks(); // Ty 03/27/98 - *not* externalized - plr->message = AMSTR_MARKSCLEARED; // ^ + plr->message = s_AMSTR_MARKSCLEARED; // ^ } // | else if (ch == key_map_rotate) { automapmode ^= am_rotate; - plr->message = (automapmode & am_rotate) ? AMSTR_ROTATEON : AMSTR_ROTATEOFF; + plr->message = (automapmode & am_rotate) ? s_AMSTR_ROTATEON : s_AMSTR_ROTATEOFF; } else if (ch == key_map_overlay) { automapmode ^= am_overlay; - plr->message = (automapmode & am_overlay) ? AMSTR_OVERLAYON : AMSTR_OVERLAYOFF; + plr->message = (automapmode & am_overlay) ? s_AMSTR_OVERLAYON : s_AMSTR_OVERLAYOFF; } else // phares { diff --git a/apps/plugins/doom/d_main.c b/apps/plugins/doom/d_main.c index b8c136689a..3dc64875fd 100644 --- a/apps/plugins/doom/d_main.c +++ b/apps/plugins/doom/d_main.c @@ -62,9 +62,13 @@ #include "r_draw.h" #include "r_main.h" #include "d_main.h" +#include "d_deh.h" // Ty 04/08/98 - Externalizations #include "am_map.h" #include "m_swap.h" +// DEHacked support - Ty 03/09/97 // CPhipps - const char*'s +void ProcessDehFile(const char *filename, const char *outfilename, int lumpnum); + // CPhipps - removed wadfiles[] stuff boolean devparm; // started game with -devparm @@ -78,6 +82,7 @@ boolean clfastparm; // checkparm of -fast boolean nomonsters; // working -nomonsters boolean respawnparm; // working -respawn boolean fastparm; // working -fast +boolean dehout=false; boolean singletics = false; // debug flag to cancel adaptiveness @@ -725,6 +730,9 @@ void D_DoomMainSetup(void) printf ("W_Init: Init WADfiles.\n"); W_Init(); + if ((p = W_CheckNumForName("DEHACKED")) != -1) // cph - add dehacked-in-a-wad support + ProcessDehFile(NULL, dehout ? NULL : "/dehlog.txt", p); + V_InitColorTranslation(); //jff 4/24/98 load color translation lumps // Check for -file in shareware diff --git a/apps/plugins/doom/dstrings.h b/apps/plugins/doom/dstrings.h index 4402c21f1f..f885faaeeb 100644 --- a/apps/plugins/doom/dstrings.h +++ b/apps/plugins/doom/dstrings.h @@ -26,7 +26,7 @@ * * DESCRIPTION: * DOOM strings, by language. - * Note: In BOOM, some new strings hav ebeen defined that are + * Note: In BOOM, some new strings have been defined that are * not found in the French version. A better approach is * to create a BEX text-replacement file for other * languages since any language can be supported that way diff --git a/apps/plugins/doom/f_finale.c b/apps/plugins/doom/f_finale.c index 3af27d2785..0b912c8239 100644 --- a/apps/plugins/doom/f_finale.c +++ b/apps/plugins/doom/f_finale.c @@ -32,13 +32,12 @@ #include "doomstat.h" #include "d_event.h" -#include "d_englsh.h" #include "m_swap.h" #include "v_video.h" #include "w_wad.h" #include "s_sound.h" #include "sounds.h" -//#include "d_deh.h" // Ty 03/22/98 - externalizations +#include "d_deh.h" // Ty 03/22/98 - externalizations #include "f_finale.h" // CPhipps - hmm... #include "rockmacros.h" @@ -98,20 +97,20 @@ void F_StartFinale (void) switch (gameepisode) { case 1: - finaleflat = "FLOOR4_8"; - finaletext = E1TEXT; + finaleflat = bgflatE1; // Ty 03/30/98 - new externalized bg flats + finaletext = s_E1TEXT; // Ty 03/23/98 - Was e1text variable. break; case 2: - finaleflat = "SFLR6_1"; - finaletext = E2TEXT; + finaleflat = bgflatE2; + finaletext = s_E2TEXT; // Ty 03/23/98 - Same stuff for each break; case 3: - finaleflat = "MFLR8_4"; - finaletext = E3TEXT; + finaleflat = bgflatE3; + finaletext = s_E3TEXT; break; case 4: - finaleflat = "MFLR8_3"; - finaletext = E4TEXT; + finaleflat = bgflatE4; + finaletext = s_E4TEXT; break; default: // Ouch. @@ -129,48 +128,48 @@ void F_StartFinale (void) switch (gamemap) { case 6: - finaleflat = "SLIME16"; - finaletext = (gamemission==pack_tnt) ? T1TEXT : - (gamemission==pack_plut) ? P1TEXT : C1TEXT; + finaleflat = bgflat06; + finaletext = (gamemission==pack_tnt) ? s_T1TEXT : + (gamemission==pack_plut) ? s_P1TEXT : s_C1TEXT; break; case 11: - finaleflat = "RROCK14"; - finaletext = (gamemission==pack_tnt) ? T2TEXT : - (gamemission==pack_plut) ? P2TEXT : C2TEXT; + finaleflat = bgflat11; + finaletext = (gamemission==pack_tnt) ? s_T2TEXT : + (gamemission==pack_plut) ? s_P2TEXT : s_C2TEXT; break; case 20: - finaleflat = "RROCK07"; - finaletext = (gamemission==pack_tnt) ? T3TEXT : - (gamemission==pack_plut) ? P3TEXT : C3TEXT; + finaleflat = bgflat20; + finaletext = (gamemission==pack_tnt) ? s_T3TEXT : + (gamemission==pack_plut) ? s_P3TEXT : s_C3TEXT; break; case 30: - finaleflat = "RROCK17"; - finaletext = (gamemission==pack_tnt) ? T4TEXT : - (gamemission==pack_plut) ? P4TEXT : C4TEXT; + finaleflat = bgflat30; + finaletext = (gamemission==pack_tnt) ? s_T4TEXT : + (gamemission==pack_plut) ? s_P4TEXT : s_C4TEXT; break; case 15: - finaleflat = "RROCK13"; - finaletext = (gamemission==pack_tnt) ? T5TEXT : - (gamemission==pack_plut) ? P5TEXT : C5TEXT; + finaleflat = bgflat15; + finaletext = (gamemission==pack_tnt) ? s_T5TEXT : + (gamemission==pack_plut) ? s_P5TEXT : s_C5TEXT; break; case 31: - finaleflat = "RROCK19"; - finaletext = (gamemission==pack_tnt) ? T6TEXT : - (gamemission==pack_plut) ? P6TEXT : C6TEXT; + finaleflat = bgflat31; + finaletext = (gamemission==pack_tnt) ? s_T6TEXT : + (gamemission==pack_plut) ? s_P6TEXT : s_C6TEXT; break; default: // Ouch. break; } break; + // Ty 08/27/98 - end gamemission logic } - // Indeterminate. - default: + default: // Ty 03/30/98 - not externalized S_ChangeMusic(mus_read_m, true); finaleflat = "F_SKY1"; // Not used anywhere else. - finaletext = C1TEXT; // FIXME - other text, music? + finaletext = s_C1TEXT; // FIXME - other text, music? break; } @@ -320,29 +319,29 @@ void F_TextWrite (void) // typedef struct { - const char *name; // CPhipps - const** + const char **name; // CPhipps - const** mobjtype_t type; } castinfo_t; #define MAX_CASTORDER 18 /* Ty - hard coded for now */ static const castinfo_t castorder[] = { // CPhipps - static const, initialised here - { CC_ZOMBIE, MT_POSSESSED }, - { CC_SHOTGUN, MT_SHOTGUY }, - { CC_HEAVY, MT_CHAINGUY }, - { CC_IMP, MT_TROOP }, - { CC_DEMON, MT_SERGEANT }, - { CC_LOST, MT_SKULL }, - { CC_CACO, MT_HEAD }, - { CC_HELL, MT_KNIGHT }, - { CC_BARON, MT_BRUISER }, - { CC_ARACH, MT_BABY }, - { CC_PAIN, MT_PAIN }, - { CC_REVEN, MT_UNDEAD }, - { CC_MANCU, MT_FATSO }, - { CC_ARCH, MT_VILE }, - { CC_SPIDER, MT_SPIDER }, - { CC_CYBER, MT_CYBORG }, - { CC_HERO, MT_PLAYER }, + { &s_CC_ZOMBIE, MT_POSSESSED }, + { &s_CC_SHOTGUN, MT_SHOTGUY }, + { &s_CC_HEAVY, MT_CHAINGUY }, + { &s_CC_IMP, MT_TROOP }, + { &s_CC_DEMON, MT_SERGEANT }, + { &s_CC_LOST, MT_SKULL }, + { &s_CC_CACO, MT_HEAD }, + { &s_CC_HELL, MT_KNIGHT }, + { &s_CC_BARON, MT_BRUISER }, + { &s_CC_ARACH, MT_BABY }, + { &s_CC_PAIN, MT_PAIN }, + { &s_CC_REVEN, MT_UNDEAD }, + { &s_CC_MANCU, MT_FATSO }, + { &s_CC_ARCH, MT_VILE }, + { &s_CC_SPIDER, MT_SPIDER }, + { &s_CC_CYBER, MT_CYBORG }, + { &s_CC_HERO, MT_PLAYER }, { NULL, 0} }; @@ -560,7 +559,6 @@ static void F_CastPrint (const char* text) // CPhipps - static, const char* // // F_CastDrawer // -void V_DrawPatchFlipped (int x, int y, int scrn, patch_t *patch); void F_CastDrawer (void) { @@ -570,9 +568,10 @@ void F_CastDrawer (void) boolean flip; // erase the entire screen to a background - V_DrawNamePatch(0,0,0, "BOSSBACK", CR_DEFAULT, VPT_STRETCH); // Ty 03/30/98 bg texture extern + // CPhipps - patch drawing updated + V_DrawNamePatch(0,0,0, bgcastcall, CR_DEFAULT, VPT_STRETCH); // Ty 03/30/98 bg texture extern - F_CastPrint (castorder[castnum].name); + F_CastPrint (*(castorder[castnum].name)); // draw the current frame in the middle of the screen sprdef = &sprites[caststate->sprite]; diff --git a/apps/plugins/doom/g_game.c b/apps/plugins/doom/g_game.c index 7410e01bc7..b5944eae54 100644 --- a/apps/plugins/doom/g_game.c +++ b/apps/plugins/doom/g_game.c @@ -2771,7 +2771,7 @@ boolean G_CheckDemoStatus (void) // killough -- added fps information and made it work for longer demos: unsigned realtics = endtime-starttime; int fd=open("/games/doom/timedemo.txt",O_WRONLY | O_CREAT); - fprintf (fd,"Timed %d gametics in %d realtics = %d frames per second", + fdprintf (fd,"Timed %d gametics in %d realtics = %d frames per second", (unsigned) gametic, realtics, (unsigned) gametic * (double) TICRATE / realtics); close(fd); diff --git a/apps/plugins/doom/hu_stuff.c b/apps/plugins/doom/hu_stuff.c index cc240de8c1..747be18df0 100644 --- a/apps/plugins/doom/hu_stuff.c +++ b/apps/plugins/doom/hu_stuff.c @@ -56,10 +56,10 @@ int hud_graph_keys=1; //jff 3/7/98 display HUD keys as graphics // // Ty 03/28/98 - // These four shortcuts modifed to reflect char ** of mapnamesx[] -#define HU_TITLE (mapnames[(gameepisode-1)*9+gamemap-1]) -#define HU_TITLE2 (mapnames2[gamemap-1]) -#define HU_TITLEP (mapnamesp[gamemap-1]) -#define HU_TITLET (mapnamest[gamemap-1]) +#define HU_TITLE (*mapnames[(gameepisode-1)*9+gamemap-1]) +#define HU_TITLE2 (*mapnames2[gamemap-1]) +#define HU_TITLEP (*mapnamesp[gamemap-1]) +#define HU_TITLET (*mapnamest[gamemap-1]) #define HU_TITLEHEIGHT 1 #define HU_TITLEX 0 //jff 2/16/98 change 167 to ST_Y-1 @@ -131,16 +131,16 @@ const char* chat_macros[] = // Ty 03/27/98 - *not* externalized // CPhipps - const char* { - HUSTR_CHATMACRO0, HUSTR_CHATMACRO1, - HUSTR_CHATMACRO2, - HUSTR_CHATMACRO3, - HUSTR_CHATMACRO4, - HUSTR_CHATMACRO5, - HUSTR_CHATMACRO6, - HUSTR_CHATMACRO7, - HUSTR_CHATMACRO8, - HUSTR_CHATMACRO9 + HUSTR_CHATMACRO1, + HUSTR_CHATMACRO1, + HUSTR_CHATMACRO1, + HUSTR_CHATMACRO1, + HUSTR_CHATMACRO1, + HUSTR_CHATMACRO1, + HUSTR_CHATMACRO1, + HUSTR_CHATMACRO1, + HUSTR_CHATMACRO1 }; const char* player_names[] = @@ -206,16 +206,16 @@ int hudcolor_list; // list of messages color int hud_list_bgon; // enable for solid window background for message list //jff 2/16/98 initialization strings for ammo, health, armor widgets -static char hud_coordstrx[32]; -static char hud_coordstry[32]; -static char hud_coordstrz[32]; -static char hud_ammostr[80]; -static char hud_healthstr[80]; -static char hud_armorstr[80]; -static char hud_weapstr[80]; -static char hud_keysstr[80]; -static char hud_gkeysstr[80]; //jff 3/7/98 add support for graphic key display -static char hud_monsecstr[80]; +static char *hud_coordstrx; +static char *hud_coordstry; +static char *hud_coordstrz; +static char *hud_ammostr; +static char *hud_healthstr; +static char *hud_armorstr; +static char *hud_weapstr; +static char *hud_keysstr; +static char *hud_gkeysstr; //jff 3/7/98 add support for graphic key display +static char *hud_monsecstr; //jff 2/16/98 declaration of color switch points extern int ammo_red; @@ -234,175 +234,10 @@ extern int armor_green; // Ty 03/27/98 - externalized map name arrays - now in d_deh.c // and converted to arrays of pointers to char * // See modified HUTITLEx macros -char* mapnames[] = // DOOM shareware/registered/retail (Ultimate) names. - { - - HUSTR_E1M1, - HUSTR_E1M2, - HUSTR_E1M3, - HUSTR_E1M4, - HUSTR_E1M5, - HUSTR_E1M6, - HUSTR_E1M7, - HUSTR_E1M8, - HUSTR_E1M9, - - HUSTR_E2M1, - HUSTR_E2M2, - HUSTR_E2M3, - HUSTR_E2M4, - HUSTR_E2M5, - HUSTR_E2M6, - HUSTR_E2M7, - HUSTR_E2M8, - HUSTR_E2M9, - - HUSTR_E3M1, - HUSTR_E3M2, - HUSTR_E3M3, - HUSTR_E3M4, - HUSTR_E3M5, - HUSTR_E3M6, - HUSTR_E3M7, - HUSTR_E3M8, - HUSTR_E3M9, - - HUSTR_E4M1, - HUSTR_E4M2, - HUSTR_E4M3, - HUSTR_E4M4, - HUSTR_E4M5, - HUSTR_E4M6, - HUSTR_E4M7, - HUSTR_E4M8, - HUSTR_E4M9, - - "NEWLEVEL", - "NEWLEVEL", - "NEWLEVEL", - "NEWLEVEL", - "NEWLEVEL", - "NEWLEVEL", - "NEWLEVEL", - "NEWLEVEL", - "NEWLEVEL" - }; - -char* mapnames2[] = // DOOM 2 map names. - { - HUSTR_1, - HUSTR_2, - HUSTR_3, - HUSTR_4, - HUSTR_5, - HUSTR_6, - HUSTR_7, - HUSTR_8, - HUSTR_9, - HUSTR_10, - HUSTR_11, - - HUSTR_12, - HUSTR_13, - HUSTR_14, - HUSTR_15, - HUSTR_16, - HUSTR_17, - HUSTR_18, - HUSTR_19, - HUSTR_20, - - HUSTR_21, - HUSTR_22, - HUSTR_23, - HUSTR_24, - HUSTR_25, - HUSTR_26, - HUSTR_27, - HUSTR_28, - HUSTR_29, - HUSTR_30, - HUSTR_31, - HUSTR_32 - }; - - -char* mapnamesp[] = // Plutonia WAD map names. - { - PHUSTR_1, - PHUSTR_2, - PHUSTR_3, - PHUSTR_4, - PHUSTR_5, - PHUSTR_6, - PHUSTR_7, - PHUSTR_8, - PHUSTR_9, - PHUSTR_10, - PHUSTR_11, - - PHUSTR_12, - PHUSTR_13, - PHUSTR_14, - PHUSTR_15, - PHUSTR_16, - PHUSTR_17, - PHUSTR_18, - PHUSTR_19, - PHUSTR_20, - - PHUSTR_21, - PHUSTR_22, - PHUSTR_23, - PHUSTR_24, - PHUSTR_25, - PHUSTR_26, - PHUSTR_27, - PHUSTR_28, - PHUSTR_29, - PHUSTR_30, - PHUSTR_31, - PHUSTR_32 - }; - - -char *mapnamest[] = // TNT WAD map names. - { - THUSTR_1, - THUSTR_2, - THUSTR_3, - THUSTR_4, - THUSTR_5, - THUSTR_6, - THUSTR_7, - THUSTR_8, - THUSTR_9, - THUSTR_10, - THUSTR_11, - - THUSTR_12, - THUSTR_13, - THUSTR_14, - THUSTR_15, - THUSTR_16, - THUSTR_17, - THUSTR_18, - THUSTR_19, - THUSTR_20, - - THUSTR_21, - THUSTR_22, - THUSTR_23, - THUSTR_24, - THUSTR_25, - THUSTR_26, - THUSTR_27, - THUSTR_28, - THUSTR_29, - THUSTR_30, - THUSTR_31, - THUSTR_32 - }; +extern char **mapnames[]; +extern char **mapnames2[]; +extern char **mapnamesp[]; +extern char **mapnamest[]; // key tables // jff 5/10/98 french support removed, @@ -466,6 +301,18 @@ void HU_Init(void) shiftxform = english_shiftxform; + // malloc all the strings, trying to get size down + hud_ammostr=malloc(80*sizeof(char)); + hud_healthstr=malloc(80*sizeof(char)); + hud_armorstr=malloc(80*sizeof(char)); + hud_weapstr=malloc(80*sizeof(char)); + hud_keysstr=malloc(80*sizeof(char)); + hud_gkeysstr=malloc(80*sizeof(char)); + hud_monsecstr=malloc(80*sizeof(char)); + hud_coordstrx=malloc(32*sizeof(char)); + hud_coordstry=malloc(32*sizeof(char)); + hud_coordstrz=malloc(32*sizeof(char)); + // load the heads-up font j = HU_FONTSTART; for (i=0;imo->x)>>FRACBITS); + snprintf(hud_coordstrx,32*sizeof(char),"X: %d", (plr->mo->x)>>FRACBITS); HUlib_clearTextLine(&w_coordx); s = hud_coordstrx; while (*s) @@ -924,7 +771,7 @@ void HU_Drawer(void) //jff 3/3/98 split coord display into x,y,z lines // y-coord - snprintf(hud_coordstry,sizeof(hud_coordstry),"Y: %d", (plr->mo->y)>>FRACBITS); + snprintf(hud_coordstry,32*sizeof(char),"Y: %d", (plr->mo->y)>>FRACBITS); HUlib_clearTextLine(&w_coordy); s = hud_coordstry; while (*s) @@ -934,7 +781,7 @@ void HU_Drawer(void) //jff 3/3/98 split coord display into x,y,z lines //jff 2/22/98 added z // z-coord - snprintf(hud_coordstrz,sizeof(hud_coordstrz),"Z: %d", (plr->mo->z)>>FRACBITS); + snprintf(hud_coordstrz,32*sizeof(char),"Z: %d", (plr->mo->z)>>FRACBITS); HUlib_clearTextLine(&w_coordz); s = hud_coordstrz; while (*s) @@ -1399,7 +1246,7 @@ void HU_Drawer(void) // build the init string with fixed colors snprintf ( - hud_monsecstr,sizeof(hud_monsecstr), + hud_monsecstr,80*sizeof(char), "STS \x1b\x36K \x1b\x33%d \x1b\x36M \x1b\x33%d \x1b\x37I \x1b\x33%d/%d \x1b\x35S \x1b\x33%d/%d", plr->killcount,totallive, plr->itemcount,totalitems, diff --git a/apps/plugins/doom/hu_stuff.h b/apps/plugins/doom/hu_stuff.h index 76c6a90313..c0e927d4bb 100644 --- a/apps/plugins/doom/hu_stuff.h +++ b/apps/plugins/doom/hu_stuff.h @@ -84,9 +84,9 @@ extern int hud_displayed; /* hud is displayed */ extern int hud_active; /* hud mode 0=off, 1=small, 2=full */ extern int hud_nosecrets; /* status does not list secrets/items/kills */ -extern char* mapnames[]; -extern char* mapnames2[]; -extern char* mapnamesp[]; -extern char* mapnamest[]; +extern char **mapnames[]; +extern char **mapnames2[]; +extern char **mapnamesp[]; +extern char **mapnamest[]; #endif diff --git a/apps/plugins/doom/i_sound.c b/apps/plugins/doom/i_sound.c index 641721a231..e2eeab0c3d 100644 --- a/apps/plugins/doom/i_sound.c +++ b/apps/plugins/doom/i_sound.c @@ -50,7 +50,7 @@ // Needed for calling the actual sound output. #define SAMPLECOUNT 512 -#define NUM_CHANNELS 16 +#define NUM_CHANNELS 24 // It is 2 for 16bit, and 2 for two channels. #define BUFMUL 2 #define MIXBUFFERSIZE (SAMPLECOUNT*BUFMUL) @@ -66,7 +66,7 @@ // Basically, samples from all active internal channels // are modifed and added, and stored in the buffer // that is submitted to the audio device. -signed short mixbuffer[MIXBUFFERSIZE]; +signed short *mixbuffer; /* Don't place this in IRAM! * Sound playback uses DMA, and not all IRAM is DMA capable on coldfire. */ @@ -97,7 +97,7 @@ channel_info_t channelinfo[NUM_CHANNELS] IBSS_ATTR; int *vol_lookup; // Volume lookups. -int steptable[256]; // Pitch to stepping lookup. (Not setup properly right now) +int *steptable; // Pitch to stepping lookup. (Not setup properly right now) // // This function loads the sound data from the WAD lump for single sound. @@ -501,6 +501,9 @@ void I_InitSound() vol_lookup=malloc(128*256*sizeof(int)); + mixbuffer=malloc(MIXBUFFERSIZE*sizeof(short)); + steptable=malloc(256*sizeof(int)); + for (i=1 ; ilcd_framebuffer[y * LCD_WIDTH + x] = palette[paletteIndex]; - } + paletteIndex = d_screens[0][y]; + rb->lcd_framebuffer[y] = palette[paletteIndex]; } rb->lcd_update(); #else /* !HAVE_LCD_COLOR */ - int yd = 0; + int x, yd = 0; for (y = 0; y < LCD_HEIGHT; y++) { diff --git a/apps/plugins/doom/m_menu.c b/apps/plugins/doom/m_menu.c index 415ca0852e..14d8474cbf 100644 --- a/apps/plugins/doom/m_menu.c +++ b/apps/plugins/doom/m_menu.c @@ -16,7 +16,10 @@ // GNU General Public License for more details. // // $Log$ -// Revision 1.6 2006/04/16 23:14:04 kkurbjun +// Revision 1.7 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.6 2006-04-16 23:14:04 kkurbjun // Fix run so that it stays enabled across level loads. Removed some unused code and added some back in for hopeful future use. // // Revision 1.5 2006-04-04 23:58:37 kkurbjun @@ -53,7 +56,7 @@ #include "w_wad.h" #include "r_main.h" - +#include "d_deh.h" #include "hu_stuff.h" #include "g_game.h" @@ -96,7 +99,7 @@ int quickSaveSlot; // 1 = message to be printed int messageToPrint; // ...and here is the message string! -char* messageString; +const char* messageString; // message x & y int messx; @@ -110,15 +113,6 @@ void (*messageRoutine)(int response); #define SAVESTRINGSIZE 24 -char gammamsg[5][26] = - { - GAMMALVL0, - GAMMALVL1, - GAMMALVL2, - GAMMALVL3, - GAMMALVL4 - }; - // we are going to be entering a savegame string int saveStringEnter; int saveSlot; // which slot to save in @@ -233,7 +227,7 @@ void M_WriteText(int x, int y, char *string); int M_StringWidth(const char* string); int M_StringHeight(const char* string); void M_StartControlPanel(void); -void M_StartMessage(char *string,void *routine,boolean input); +void M_StartMessage(const char *string,void *routine,boolean input); void M_StopMessage(void); void M_ClearMenus (void); @@ -657,11 +651,11 @@ void M_SaveSelect(int choice) saveSlot = choice; snprintf(savegamestrings[choice], sizeof(savegamestrings[choice]), (gamemode==shareware||gamemode==registered||gamemode==retail) ? - mapnames[(gameepisode-1)*9+gamemap-1] : (gamemission==doom2) ? - mapnames2[gamemap-1] : (gamemission==pack_plut) ? - mapnamesp[gamemap-1] : (gamemission==pack_tnt) ? - mapnamest[gamemap-1] : "Unknown Location", choice); - if (!strcmp(savegamestrings[choice],EMPTYSTRING)) + *mapnames[(gameepisode-1)*9+gamemap-1] : (gamemission==doom2) ? + *mapnames2[gamemap-1] : (gamemission==pack_plut) ? + *mapnamesp[gamemap-1] : (gamemission==pack_tnt) ? + *mapnamest[gamemap-1] : "Unknown Location", choice); + if (!strcmp(savegamestrings[choice],s_EMPTYSTRING)) savegamestrings[choice][0] = 0; saveCharIndex = strlen(savegamestrings[choice]); } @@ -674,7 +668,7 @@ void M_SaveGame (int choice) (void)choice; if (!usergame) { - M_StartMessage(SAVEDEAD,NULL,false); + M_StartMessage(s_SAVEDEAD,NULL,false); return; } @@ -722,7 +716,7 @@ void M_QuickSave(void) quickSaveSlot = -2; // means to pick a slot now return; } - snprintf(tempstring,sizeof(tempstring),QSPROMPT,savegamestrings[quickSaveSlot]); + snprintf(tempstring,sizeof(tempstring),s_QSPROMPT,savegamestrings[quickSaveSlot]); M_StartMessage(tempstring,M_QuickSaveResponse,true); } @@ -917,7 +911,7 @@ void M_NewGame(int choice) (void) choice; if (netgame && !demoplayback) { - M_StartMessage(NEWGAME,NULL,false); + M_StartMessage(s_NEWGAME,NULL,false); return; } @@ -952,7 +946,7 @@ void M_ChooseSkill(int choice) { if (choice == nightmare) { - M_StartMessage(NIGHTMARE,M_VerifyNightmare,true); + M_StartMessage(s_NIGHTMARE,M_VerifyNightmare,true); return; } @@ -969,7 +963,7 @@ void M_Episode(int choice) if ( (gamemode == shareware) && choice) { - M_StartMessage(SWSTRING,NULL,false); + M_StartMessage(s_SWSTRING,NULL,false); // Ty 03/27/98 - externalized M_SetupNextMenu(&ReadDef1); return; } @@ -1030,9 +1024,9 @@ void M_ChangeMessages(int choice) showMessages = 1 - showMessages; if (!showMessages) - players[consoleplayer].message = MSGOFF; + players[consoleplayer].message = s_MSGOFF; else - players[consoleplayer].message = MSGON ; + players[consoleplayer].message = s_MSGON ; message_dontfuckwithme = true; } @@ -1066,11 +1060,11 @@ void M_EndGame(int choice) if (netgame) { - M_StartMessage(NETEND,NULL,false); + M_StartMessage(s_NETEND,NULL,false); return; } - M_StartMessage(ENDGAME,M_EndGameResponse,true); + M_StartMessage(s_ENDGAME,M_EndGameResponse,true); } @@ -1153,9 +1147,9 @@ void M_QuitDOOM(int choice) // We pick index 0 which is language sensitive, // or one at random, between 1 and maximum number. if (language != english ) - snprintf(endstring,sizeof(endstring),"%s\n\n"DOSY, endmsg[0] ); + snprintf(endstring,sizeof(endstring),"%s\n\n%s",s_DOSY, endmsg[0] ); else - snprintf(endstring,sizeof(endstring),"%s\n\n%s", endmsg[gametic%(NUM_QUITMESSAGES-1)+1], DOSY); + snprintf(endstring,sizeof(endstring),"%s\n\n%s", endmsg[gametic%(NUM_QUITMESSAGES-1)+1], s_DOSY); M_StartMessage(endstring,M_QuitResponse,true); } @@ -1256,7 +1250,7 @@ M_DrawSelCell void M_StartMessage -( char* string, +( const char* string, void* routine, boolean input ) { diff --git a/apps/plugins/doom/p_doors.c b/apps/plugins/doom/p_doors.c index 9d8f28cd7a..0b6d777e17 100644 --- a/apps/plugins/doom/p_doors.c +++ b/apps/plugins/doom/p_doors.c @@ -36,7 +36,7 @@ #include "sounds.h" #include "r_main.h" #include "dstrings.h" -//#include "d_deh.h" // Ty 03/27/98 - externalized +#include "d_deh.h" // Ty 03/27/98 - externalized #include "rockmacros.h" @@ -295,7 +295,7 @@ int EV_DoLockedDoor case 133: if (!p->cards[it_bluecard] && !p->cards[it_blueskull]) { - p->message = PD_BLUEO; // Ty 03/27/98 - externalized + p->message = s_PD_BLUEO; // Ty 03/27/98 - externalized S_StartSound(p->mo,sfx_oof); // killough 3/20/98 return 0; } @@ -305,7 +305,7 @@ int EV_DoLockedDoor case 135: if (!p->cards[it_redcard] && !p->cards[it_redskull]) { - p->message = PD_REDO; // Ty 03/27/98 - externalized + p->message = s_PD_REDO; // Ty 03/27/98 - externalized S_StartSound(p->mo,sfx_oof); // killough 3/20/98 return 0; } @@ -315,7 +315,7 @@ int EV_DoLockedDoor case 137: if (!p->cards[it_yellowcard] && !p->cards[it_yellowskull]) { - p->message = PD_YELLOWO; // Ty 03/27/98 - externalized + p->message = s_PD_YELLOWO; // Ty 03/27/98 - externalized S_StartSound(p->mo,sfx_oof); // killough 3/20/98 return 0; } @@ -449,7 +449,7 @@ int EV_VerticalDoor return 0; if (!player->cards[it_bluecard] && !player->cards[it_blueskull]) { - player->message = PD_BLUEK; // Ty 03/27/98 - externalized + player->message = s_PD_BLUEK; // Ty 03/27/98 - externalized S_StartSound(player->mo,sfx_oof); // killough 3/20/98 return 0; } @@ -461,7 +461,7 @@ int EV_VerticalDoor return 0; if (!player->cards[it_yellowcard] && !player->cards[it_yellowskull]) { - player->message = PD_YELLOWK; // Ty 03/27/98 - externalized + player->message = s_PD_YELLOWK; // Ty 03/27/98 - externalized S_StartSound(player->mo,sfx_oof); // killough 3/20/98 return 0; } @@ -473,7 +473,7 @@ int EV_VerticalDoor return 0; if (!player->cards[it_redcard] && !player->cards[it_redskull]) { - player->message = PD_REDK; // Ty 03/27/98 - externalized + player->message = s_PD_REDK; // Ty 03/27/98 - externalized S_StartSound(player->mo,sfx_oof); // killough 3/20/98 return 0; } diff --git a/apps/plugins/doom/p_inter.c b/apps/plugins/doom/p_inter.c index f4a0f80c8f..9a34af1358 100644 --- a/apps/plugins/doom/p_inter.c +++ b/apps/plugins/doom/p_inter.c @@ -36,9 +36,10 @@ #include "r_main.h" #include "s_sound.h" #include "sounds.h" -//#include "d_deh.h" // Ty 03/22/98 - externalized strings +#include "d_deh.h" // Ty 03/22/98 - externalized strings #include "p_tick.h" #include "i_system.h" + #include "p_inter.h" #include "p_enemy.h" @@ -315,13 +316,13 @@ void P_TouchSpecialThing(mobj_t *special, mobj_t *toucher) case SPR_ARM1: if (!P_GiveArmor (player, green_armor_class)) return; - player->message = GOTARMOR; // Ty 03/22/98 - externalized + player->message = s_GOTARMOR; // Ty 03/22/98 - externalized break; case SPR_ARM2: if (!P_GiveArmor (player, blue_armor_class)) return; - player->message = GOTMEGA; // Ty 03/22/98 - externalized + player->message = s_GOTMEGA; // Ty 03/22/98 - externalized break; // bonus items @@ -330,7 +331,7 @@ void P_TouchSpecialThing(mobj_t *special, mobj_t *toucher) if (player->health > (maxhealth * 2)) player->health = (maxhealth * 2); player->mo->health = player->health; - player->message = GOTHTHBONUS; // Ty 03/22/98 - externalized + player->message = s_GOTHTHBONUS; // Ty 03/22/98 - externalized break; case SPR_BON2: @@ -339,7 +340,7 @@ void P_TouchSpecialThing(mobj_t *special, mobj_t *toucher) player->armorpoints = max_armor; if (!player->armortype) player->armortype = green_armor_class; - player->message = GOTARMBONUS; // Ty 03/22/98 - externalized + player->message = s_GOTARMBONUS; // Ty 03/22/98 - externalized break; case SPR_SOUL: @@ -347,7 +348,7 @@ void P_TouchSpecialThing(mobj_t *special, mobj_t *toucher) if (player->health > max_soul) player->health = max_soul; player->mo->health = player->health; - player->message = GOTSUPER; // Ty 03/22/98 - externalized + player->message = s_GOTSUPER; // Ty 03/22/98 - externalized sound = sfx_getpow; break; @@ -357,7 +358,7 @@ void P_TouchSpecialThing(mobj_t *special, mobj_t *toucher) player->health = mega_health; player->mo->health = player->health; P_GiveArmor (player,blue_armor_class); - player->message = GOTMSPHERE; // Ty 03/22/98 - externalized + player->message = s_GOTMSPHERE; // Ty 03/22/98 - externalized sound = sfx_getpow; break; @@ -365,7 +366,7 @@ void P_TouchSpecialThing(mobj_t *special, mobj_t *toucher) // leave cards for everyone case SPR_BKEY: if (!player->cards[it_bluecard]) - player->message = GOTBLUECARD; // Ty 03/22/98 - externalized + player->message = s_GOTBLUECARD; // Ty 03/22/98 - externalized P_GiveCard (player, it_bluecard); if (!netgame) break; @@ -373,7 +374,7 @@ void P_TouchSpecialThing(mobj_t *special, mobj_t *toucher) case SPR_YKEY: if (!player->cards[it_yellowcard]) - player->message = GOTYELWCARD; // Ty 03/22/98 - externalized + player->message = s_GOTYELWCARD; // Ty 03/22/98 - externalized P_GiveCard (player, it_yellowcard); if (!netgame) break; @@ -381,7 +382,7 @@ void P_TouchSpecialThing(mobj_t *special, mobj_t *toucher) case SPR_RKEY: if (!player->cards[it_redcard]) - player->message = GOTREDCARD; // Ty 03/22/98 - externalized + player->message = s_GOTREDCARD; // Ty 03/22/98 - externalized P_GiveCard (player, it_redcard); if (!netgame) break; @@ -389,7 +390,7 @@ void P_TouchSpecialThing(mobj_t *special, mobj_t *toucher) case SPR_BSKU: if (!player->cards[it_blueskull]) - player->message = GOTBLUESKUL; // Ty 03/22/98 - externalized + player->message = s_GOTBLUESKUL; // Ty 03/22/98 - externalized P_GiveCard (player, it_blueskull); if (!netgame) break; @@ -397,7 +398,7 @@ void P_TouchSpecialThing(mobj_t *special, mobj_t *toucher) case SPR_YSKU: if (!player->cards[it_yellowskull]) - player->message = GOTYELWSKUL; // Ty 03/22/98 - externalized + player->message = s_GOTYELWSKUL; // Ty 03/22/98 - externalized P_GiveCard (player, it_yellowskull); if (!netgame) break; @@ -405,7 +406,7 @@ void P_TouchSpecialThing(mobj_t *special, mobj_t *toucher) case SPR_RSKU: if (!player->cards[it_redskull]) - player->message = GOTREDSKULL; // Ty 03/22/98 - externalized + player->message = s_GOTREDSKULL; // Ty 03/22/98 - externalized P_GiveCard (player, it_redskull); if (!netgame) break; @@ -415,7 +416,7 @@ void P_TouchSpecialThing(mobj_t *special, mobj_t *toucher) case SPR_STIM: if (!P_GiveBody (player, 10)) return; - player->message = GOTSTIM; // Ty 03/22/98 - externalized + player->message = s_GOTSTIM; // Ty 03/22/98 - externalized break; case SPR_MEDI: @@ -423,9 +424,9 @@ void P_TouchSpecialThing(mobj_t *special, mobj_t *toucher) return; if (player->health < 50) // cph - 25 + the 25 just added, thanks to Quasar for reporting this bug - player->message = GOTMEDINEED; // Ty 03/22/98 - externalized + player->message = s_GOTMEDINEED; // Ty 03/22/98 - externalized else - player->message = GOTMEDIKIT; // Ty 03/22/98 - externalized + player->message = s_GOTMEDIKIT; // Ty 03/22/98 - externalized break; @@ -433,14 +434,14 @@ void P_TouchSpecialThing(mobj_t *special, mobj_t *toucher) case SPR_PINV: if (!P_GivePower (player, pw_invulnerability)) return; - player->message = GOTINVUL; // Ty 03/22/98 - externalized + player->message = s_GOTINVUL; // Ty 03/22/98 - externalized sound = sfx_getpow; break; case SPR_PSTR: if (!P_GivePower (player, pw_strength)) return; - player->message = GOTBERSERK; // Ty 03/22/98 - externalized + player->message = s_GOTBERSERK; // Ty 03/22/98 - externalized if (player->readyweapon != wp_fist) player->pendingweapon = wp_fist; sound = sfx_getpow; @@ -449,28 +450,28 @@ void P_TouchSpecialThing(mobj_t *special, mobj_t *toucher) case SPR_PINS: if (!P_GivePower (player, pw_invisibility)) return; - player->message = GOTINVIS; // Ty 03/22/98 - externalized + player->message = s_GOTINVIS; // Ty 03/22/98 - externalized sound = sfx_getpow; break; case SPR_SUIT: if (!P_GivePower (player, pw_ironfeet)) return; - player->message = GOTSUIT; // Ty 03/22/98 - externalized + player->message = s_GOTSUIT; // Ty 03/22/98 - externalized sound = sfx_getpow; break; case SPR_PMAP: if (!P_GivePower (player, pw_allmap)) return; - player->message = GOTMAP; // Ty 03/22/98 - externalized + player->message = s_GOTMAP; // Ty 03/22/98 - externalized sound = sfx_getpow; break; case SPR_PVIS: if (!P_GivePower (player, pw_infrared)) return; - player->message = GOTVISOR; // Ty 03/22/98 - externalized + player->message = s_GOTVISOR; // Ty 03/22/98 - externalized sound = sfx_getpow; break; @@ -486,49 +487,49 @@ void P_TouchSpecialThing(mobj_t *special, mobj_t *toucher) if (!P_GiveAmmo (player,am_clip,1)) return; } - player->message = GOTCLIP; // Ty 03/22/98 - externalized + player->message = s_GOTCLIP; // Ty 03/22/98 - externalized break; case SPR_AMMO: if (!P_GiveAmmo (player, am_clip,5)) return; - player->message = GOTCLIPBOX; // Ty 03/22/98 - externalized + player->message = s_GOTCLIPBOX; // Ty 03/22/98 - externalized break; case SPR_ROCK: if (!P_GiveAmmo (player, am_misl,1)) return; - player->message = GOTROCKET; // Ty 03/22/98 - externalized + player->message = s_GOTROCKET; // Ty 03/22/98 - externalized break; case SPR_BROK: if (!P_GiveAmmo (player, am_misl,5)) return; - player->message = GOTROCKBOX; // Ty 03/22/98 - externalized + player->message = s_GOTROCKBOX; // Ty 03/22/98 - externalized break; case SPR_CELL: if (!P_GiveAmmo (player, am_cell,1)) return; - player->message = GOTCELL; // Ty 03/22/98 - externalized + player->message = s_GOTCELL; // Ty 03/22/98 - externalized break; case SPR_CELP: if (!P_GiveAmmo (player, am_cell,5)) return; - player->message = GOTCELLBOX; // Ty 03/22/98 - externalized + player->message = s_GOTCELLBOX; // Ty 03/22/98 - externalized break; case SPR_SHEL: if (!P_GiveAmmo (player, am_shell,1)) return; - player->message = GOTSHELLS; // Ty 03/22/98 - externalized + player->message = s_GOTSHELLS; // Ty 03/22/98 - externalized break; case SPR_SBOX: if (!P_GiveAmmo (player, am_shell,5)) return; - player->message = GOTSHELLBOX; // Ty 03/22/98 - externalized + player->message = s_GOTSHELLBOX; // Ty 03/22/98 - externalized break; case SPR_BPAK: @@ -540,56 +541,56 @@ void P_TouchSpecialThing(mobj_t *special, mobj_t *toucher) } for (i=0 ; imessage = GOTBACKPACK; // Ty 03/22/98 - externalized + player->message = s_GOTBACKPACK; // Ty 03/22/98 - externalized break; // weapons case SPR_BFUG: if (!P_GiveWeapon (player, wp_bfg, false) ) return; - player->message = GOTBFG9000; // Ty 03/22/98 - externalized + player->message = s_GOTBFG9000; // Ty 03/22/98 - externalized sound = sfx_wpnup; break; case SPR_MGUN: if (!P_GiveWeapon (player, wp_chaingun, (special->flags&MF_DROPPED)!=0) ) return; - player->message = GOTCHAINGUN; // Ty 03/22/98 - externalized + player->message = s_GOTCHAINGUN; // Ty 03/22/98 - externalized sound = sfx_wpnup; break; case SPR_CSAW: if (!P_GiveWeapon (player, wp_chainsaw, false) ) return; - player->message = GOTCHAINSAW; // Ty 03/22/98 - externalized + player->message = s_GOTCHAINSAW; // Ty 03/22/98 - externalized sound = sfx_wpnup; break; case SPR_LAUN: if (!P_GiveWeapon (player, wp_missile, false) ) return; - player->message = GOTLAUNCHER; // Ty 03/22/98 - externalized + player->message = s_GOTLAUNCHER; // Ty 03/22/98 - externalized sound = sfx_wpnup; break; case SPR_PLAS: if (!P_GiveWeapon (player, wp_plasma, false) ) return; - player->message = GOTPLASMA; // Ty 03/22/98 - externalized + player->message = s_GOTPLASMA; // Ty 03/22/98 - externalized sound = sfx_wpnup; break; case SPR_SHOT: if (!P_GiveWeapon (player, wp_shotgun, (special->flags&MF_DROPPED)!=0 ) ) return; - player->message = GOTSHOTGUN; // Ty 03/22/98 - externalized + player->message = s_GOTSHOTGUN; // Ty 03/22/98 - externalized sound = sfx_wpnup; break; case SPR_SGN2: if (!P_GiveWeapon(player, wp_supershotgun, (special->flags&MF_DROPPED)!=0)) return; - player->message = GOTSHOTGUN2; // Ty 03/22/98 - externalized + player->message = s_GOTSHOTGUN2; // Ty 03/22/98 - externalized sound = sfx_wpnup; break; diff --git a/apps/plugins/doom/p_pspr.c b/apps/plugins/doom/p_pspr.c index 9ef9e73978..c3bc422df8 100644 --- a/apps/plugins/doom/p_pspr.c +++ b/apps/plugins/doom/p_pspr.c @@ -46,9 +46,7 @@ #define WEAPONBOTTOM (FRACUNIT*128) #define WEAPONTOP (FRACUNIT*32) -// plasma cells for a bfg attack -#define BFGCELLS 40 -//#define BFGCELLS bfgcells /* Ty 03/09/98 externalized in p_inter.c */ +#define BFGCELLS bfgcells /* Ty 03/09/98 externalized in p_inter.c */ extern void P_Thrust(player_t *, angle_t, fixed_t); diff --git a/apps/plugins/doom/p_spec.c b/apps/plugins/doom/p_spec.c index c8c04fa7e2..f2757f8399 100644 --- a/apps/plugins/doom/p_spec.c +++ b/apps/plugins/doom/p_spec.c @@ -54,7 +54,7 @@ #include "s_sound.h" #include "sounds.h" #include "m_bbox.h" // phares 3/20/98 -//#include "d_deh.h" +#include "d_deh.h" #include "r_plane.h" #include "i_system.h" #include "rockmacros.h" @@ -818,7 +818,7 @@ boolean P_CanUnlockGenDoor !player->cards[it_yellowskull] ) { - player->message = PD_ANY; // Ty 03/27/98 - externalized + player->message = s_PD_ANY; // Ty 03/27/98 - externalized S_StartSound(player->mo,sfx_oof); // killough 3/20/98 return false; } @@ -830,7 +830,7 @@ boolean P_CanUnlockGenDoor (!skulliscard || !player->cards[it_redskull]) ) { - player->message = skulliscard? PD_REDK : PD_REDC; // Ty 03/27/98 - externalized + player->message = skulliscard? s_PD_REDK : s_PD_REDC; // Ty 03/27/98 - externalized S_StartSound(player->mo,sfx_oof); // killough 3/20/98 return false; } @@ -842,7 +842,7 @@ boolean P_CanUnlockGenDoor (!skulliscard || !player->cards[it_blueskull]) ) { - player->message = skulliscard? PD_BLUEK : PD_BLUEC; // Ty 03/27/98 - externalized + player->message = skulliscard? s_PD_BLUEK : s_PD_BLUEC; // Ty 03/27/98 - externalized S_StartSound(player->mo,sfx_oof); // killough 3/20/98 return false; } @@ -854,7 +854,7 @@ boolean P_CanUnlockGenDoor (!skulliscard || !player->cards[it_yellowskull]) ) { - player->message = skulliscard? PD_YELLOWK : PD_YELLOWC; // Ty 03/27/98 - externalized + player->message = skulliscard? s_PD_YELLOWK : s_PD_YELLOWC; // Ty 03/27/98 - externalized S_StartSound(player->mo,sfx_oof); // killough 3/20/98 return false; } @@ -866,7 +866,7 @@ boolean P_CanUnlockGenDoor (!skulliscard || !player->cards[it_redcard]) ) { - player->message = skulliscard? PD_REDK : PD_REDS; // Ty 03/27/98 - externalized + player->message = skulliscard? s_PD_REDK : s_PD_REDS; // Ty 03/27/98 - externalized S_StartSound(player->mo,sfx_oof); // killough 3/20/98 return false; } @@ -878,7 +878,7 @@ boolean P_CanUnlockGenDoor (!skulliscard || !player->cards[it_bluecard]) ) { - player->message = skulliscard? PD_BLUEK : PD_BLUES; // Ty 03/27/98 - externalized + player->message = skulliscard? s_PD_BLUEK : s_PD_BLUES; // Ty 03/27/98 - externalized S_StartSound(player->mo,sfx_oof); // killough 3/20/98 return false; } @@ -890,7 +890,7 @@ boolean P_CanUnlockGenDoor (!skulliscard || !player->cards[it_yellowcard]) ) { - player->message = skulliscard? PD_YELLOWK : PD_YELLOWS; // Ty 03/27/98 - externalized + player->message = skulliscard? s_PD_YELLOWK : s_PD_YELLOWS; // Ty 03/27/98 - externalized S_StartSound(player->mo,sfx_oof); // killough 3/20/98 return false; } @@ -909,7 +909,7 @@ boolean P_CanUnlockGenDoor ) ) { - player->message = PD_ALL6; // Ty 03/27/98 - externalized + player->message = s_PD_ALL6; // Ty 03/27/98 - externalized S_StartSound(player->mo,sfx_oof); // killough 3/20/98 return false; } @@ -926,7 +926,7 @@ boolean P_CanUnlockGenDoor ) ) { - player->message = PD_ALL3; // Ty 03/27/98 - externalized + player->message = s_PD_ALL3; // Ty 03/27/98 - externalized S_StartSound(player->mo,sfx_oof); // killough 3/20/98 return false; } diff --git a/apps/plugins/doom/rockdoom.c b/apps/plugins/doom/rockdoom.c index d66d86d65d..00bd22b7ea 100644 --- a/apps/plugins/doom/rockdoom.c +++ b/apps/plugins/doom/rockdoom.c @@ -782,14 +782,6 @@ enum plugin_status plugin_start(struct plugin_api* api, void* parameter) rb->lcd_setfont(0); -#ifdef FANCY_MENU - /* TO FIX: Don't use load_main_backdrop() - use lcd_set_backdrop() */ - if(rb->load_main_backdrop(GAMEBASE"backdrop.bmp")) - rb->lcd_set_foreground(LCD_RGBPACK(85,208,56)); - - rb->lcd_clear_display(); -#endif - // We're using doom's memory management since it implements a proper free (and re-uses the memory) // and now with prboom's code: realloc and calloc printf ("Z_Init: Init zone memory allocation daemon.\n"); @@ -798,15 +790,7 @@ enum plugin_status plugin_start(struct plugin_api* api, void* parameter) printf ("M_LoadDefaults: Load system defaults.\n"); M_LoadDefaults (); // load before initing other systems -#ifdef FANCY_MENU - rb->lcd_setfont(FONT_UI); - rb->lcd_putsxy(5,LCD_HEIGHT-20, "Welcome to RockDoom"); - rb->lcd_update(); - rb->sleep(HZ*2); - rb->lcd_setfont(0); -#else rb->splash(HZ*2, true, "Welcome to RockDoom"); -#endif myargv =0; myargc=0; diff --git a/apps/plugins/doom/rockmacros.h b/apps/plugins/doom/rockmacros.h index bda8219409..31b16c75eb 100644 --- a/apps/plugins/doom/rockmacros.h +++ b/apps/plugins/doom/rockmacros.h @@ -35,7 +35,7 @@ int my_open(const char *file, int flags); int my_close(int id); char *my_strtok( char * s, const char * delim ); #define alloca __builtin_alloca -#define fprintf(...) rb->fdprintf(__VA_ARGS__) +#define fdprintf(...) rb->fdprintf(__VA_ARGS__) #define vsnprintf(...) rb->vsnprintf(__VA_ARGS__) #ifdef SIMULATOR @@ -61,6 +61,7 @@ char *my_strtok( char * s, const char * delim ); #define lseek(a,b,c) rb->lseek((a),(b),(c)) #endif /* !SIMULATOR */ +#define strtok(a,b) my_strtok((a),(b)) #define strcat(a,b) rb->strcat((a),(b)) #define read(a,b,c) rb->read((a),(b),(c)) #define write(a,b,c) rb->write((a),(b),(c)) @@ -91,7 +92,6 @@ inline void* memcpy(void* dst, const void* src, size_t size); //#define SIMPLECHECKS #define NO_PREDEFINED_LUMPS #define TABLES_AS_LUMPS // This frees up alot of space in the plugin buffer -//#define FANCY_MENU // This is a call to allow load_main_backdrop to run in doom #define MAKE_FOURCC(a,b,c,d) (uint32_t)((((a)<<24)|((b)<<16)|((c)<<8)|(d)))