%20WL_MAIN.C
//=================================================================
==========
/*
=====================
=
= InitDigiMap
=
=====================
*/
static int wolfdigimap[] =
{
// These first sounds are in the upload version
#ifndef SPEAR
HALTSND, 0,
DOGBARKSND, 1,
CLOSEDOORSND, 2,
OPENDOORSND, 3,
ATKMACHINEGUNSND, 4,
ATKPISTOLSND, 5,
ATKGATLINGSND, 6,
SCHUTZADSND, 7,
GUTENTAGSND, 8,
MUTTISND, 9,
BOSSFIRESND, 10,
SSFIRESND, 11,
DEATHSCREAM1SND, 12,
DEATHSCREAM2SND, 13,
DEATHSCREAM3SND, 13,
TAKEDAMAGESND, 14,
PUSHWALLSND, 15,
LEBENSND, 20,
NAZIFIRESND, 21,
SLURPIESND, 22,
YEAHSND, 32,
#ifndef UPLOAD
// These are in all other episodes
DOGDEATHSND, 16,
AHHHGSND, 17,
DIESND, 18,
EVASND, 19,
TOT_HUNDSND, 23,
MEINGOTTSND, 24,
SCHABBSHASND, 25,
HITLERHASND, 26,
SPIONSND, 27,
NEINSOVASSND, 28,
DOGATTACKSND, 29,
LEVELDONESND, 30,
MECHSTEPSND, 31,
SCHEISTSND, 33,
DEATHSCREAM4SND, 34, // AIIEEE
DEATHSCREAM5SND, 35, // DEE-DEE
DONNERSND, 36, // EPISODE 4 BOSS DIE
EINESND, 37, // EPISODE 4 BOSS SIGHTING
ERLAUBENSND, 38, // EPISODE 6 BOSS SIGHTING
DEATHSCREAM6SND, 39, // FART
DEATHSCREAM7SND, 40, // GASP
DEATHSCREAM8SND, 41, // GUH-BOY!
DEATHSCREAM9SND, 42, // AH GEEZ!
KEINSND, 43, // EPISODE 5 BOSS SIGHTING
MEINSND, 44, // EPISODE 6 BOSS DIE
ROSESND, 45, // EPISODE 5 BOSS DIE
#endif
#else
//
// SPEAR OF DESTINY DIGISOUNDS
//
HALTSND, 0,
CLOSEDOORSND, 2,
OPENDOORSND, 3,
ATKMACHINEGUNSND, 4,
ATKPISTOLSND, 5,
ATKGATLINGSND, 6,
SCHUTZADSND, 7,
BOSSFIRESND, 8,
SSFIRESND, 9,
DEATHSCREAM1SND, 10,
DEATHSCREAM2SND, 11,
TAKEDAMAGESND, 12,
PUSHWALLSND, 13,
AHHHGSND, 15,
LEBENSND, 16,
NAZIFIRESND, 17,
SLURPIESND, 18,
LEVELDONESND, 22,
DEATHSCREAM4SND, 23, // AIIEEE
DEATHSCREAM3SND, 23, // DOUBLY-MAPPED!!!
DEATHSCREAM5SND, 24, // DEE-DEE
DEATHSCREAM6SND, 25, // FART
DEATHSCREAM7SND, 26, // GASP
DEATHSCREAM8SND, 27, // GUH-BOY!
DEATHSCREAM9SND, 28, // AH GEEZ!
GETGATLINGSND, 38, // Got Gat replacement
#ifndef SPEARDEMO
DOGBARKSND, 1,
DOGDEATHSND, 14,
SPIONSND, 19,
NEINSOVASSND, 20,
DOGATTACKSND, 21,
TRANSSIGHTSND, 29, // Trans Sight
TRANSDEATHSND, 30, // Trans Death
WILHELMSIGHTSND, 31, // Wilhelm Sight
WILHELMDEATHSND, 32, // Wilhelm Death
UBERDEATHSND, 33, // Uber Death
KNIGHTSIGHTSND, 34, // Death Knight Sight
KNIGHTDEATHSND, 35, // Death Knight Death
ANGELSIGHTSND, 36, // Angel Sight
ANGELDEATHSND, 37, // Angel Death
GETSPEARSND, 39, // Got Spear replacement
#endif
#endif
LASTSOUND
};
void InitDigiMap (void)
{
int *map;
for (map = wolfdigimap;*map != LASTSOUND;map += 2)
DigiMap[map[0]] = map[1];
}
#ifndef SPEAR
CP_iteminfo MusicItems={CTL_X,CTL_Y,6,0,32};
CP_itemtype far MusicMenu[]=
{
{1,"Get Them!",0},
{1,"Searching",0},
{1,"P.O.W.",0},
{1,"Suspense",0},
{1,"War March",0},
{1,"Around The Corner!",0},
{1,"Nazi Anthem",0},
{1,"Lurking...",0},
{1,"Going After Hitler",0},
{1,"Pounding Headache",0},
{1,"Into the Dungeons",0},
{1,"Ultimate Conquest",0},
{1,"Kill the S.O.B.",0},
{1,"The Nazi Rap",0},
{1,"Twelfth Hour",0},
{1,"Zero Hour",0},
{1,"Ultimate Conquest",0},
{1,"Wolfpack",0}
};
#else
CP_iteminfo MusicItems={CTL_X,CTL_Y-20,9,0,32};
CP_itemtype far MusicMenu[]=
{
{1,"Funky Colonel Bill",0},
{1,"Death To The Nazis",0},
{1,"Tiptoeing Around",0},
{1,"Is This THE END?",0},
{1,"Evil Incarnate",0},
{1,"Jazzin' Them Nazis",0},
{1,"Puttin' It To The Enemy",0},
{1,"The SS Gonna Get You",0},
{1,"Towering Above",0}
};
#endif
#ifndef SPEARDEMO
void DoJukebox(void)
{
int which,lastsong=-1;
unsigned start,songs[]=
{
#ifndef SPEAR
GETTHEM_MUS,
SEARCHN_MUS,
POW_MUS,
SUSPENSE_MUS,
WARMARCH_MUS,
CORNER_MUS,
NAZI_OMI_MUS,
PREGNANT_MUS,
GOINGAFT_MUS,
HEADACHE_MUS,
DUNGEON_MUS,
ULTIMATE_MUS,
INTROCW3_MUS,
NAZI_RAP_MUS,
TWELFTH_MUS,
ZEROHOUR_MUS,
ULTIMATE_MUS,
PACMAN_MUS
#else
XFUNKIE_MUS, // 0
XDEATH_MUS, // 2
XTIPTOE_MUS, // 4
XTHEEND_MUS, // 7
XEVIL_MUS, // 17
XJAZNAZI_MUS, // 18
XPUTIT_MUS, // 21
XGETYOU_MUS, // 22
XTOWER2_MUS // 23
#endif
};
struct dostime_t time;
IN_ClearKeysDown();
if (!AdLibPresent && !SoundBlasterPresent)
return;
MenuFadeOut();
#ifndef SPEAR
#ifndef UPLOAD
_dos_gettime(&time);
start = (time.hsecond%3)*6;
#else
start = 0;
#endif
#else
start = 0;
#endif
CA_CacheGrChunk (STARTFONT+1);
#ifdef SPEAR
CacheLump (BACKDROP_LUMP_START,BACKDROP_LUMP_END);
#else
CacheLump (CONTROLS_LUMP_START,CONTROLS_LUMP_END);
#endif
CA_LoadAllSounds ();
fontnumber=1;
ClearMScreen ();
VWB_DrawPic(112,184,C_MOUSELBACKPIC);
DrawStripes (10);
SETFONTCOLOR (TEXTCOLOR,BKGDCOLOR);
#ifndef SPEAR
DrawWindow (CTL_X-2,CTL_Y-6,280,13*7,BKGDCOLOR);
#else
DrawWindow (CTL_X-2,CTL_Y-26,280,13*10,BKGDCOLOR);
#endif
DrawMenu (&MusicItems,&MusicMenu[start]);
SETFONTCOLOR (READHCOLOR,BKGDCOLOR);
PrintY=15;
WindowX = 0;
WindowY = 320;
US_CPrint ("Robert's Jukebox");
SETFONTCOLOR (TEXTCOLOR,BKGDCOLOR);
VW_UpdateScreen();
MenuFadeIn();
do
{
which = HandleMenu(&MusicItems,&MusicMenu[start],NULL);
if (which>=0)
{
if (lastsong >= 0)
MusicMenu[start+lastsong].active = 1;
StartCPMusic(songs[start + which]);
MusicMenu[start+which].active = 2;
DrawMenu (&MusicItems,&MusicMenu[start]);
VW_UpdateScreen();
lastsong = which;
}
} while(which>=0);
MenuFadeOut();
IN_ClearKeysDown();
#ifdef SPEAR
UnCacheLump (BACKDROP_LUMP_START,BACKDROP_LUMP_END);
#else
UnCacheLump (CONTROLS_LUMP_START,CONTROLS_LUMP_END);
#endif
}
#endif
/*
==========================
=
= InitGame
=
= Load a few things right away
=
==========================
*/
void InitGame (void)
{
int i,x,y;
unsigned *blockstart;
if (MS_CheckParm ("virtual"))
virtualreality = true;
else
virtualreality = false;
MM_Startup (); // so the signon screen can be freed
SignonScreen ();
VW_Startup ();
IN_Startup ();
PM_Startup ();
PM_UnlockMainMem ();
SD_Startup ();
CA_Startup ();
US_Startup ();
#ifndef SPEAR
if (mminfo.mainmem < 235000L)
#else
if (mminfo.mainmem < 257000L && !MS_CheckParm("debugmode"))
#endif
{
memptr screen;
CA_CacheGrChunk (ERRORSCREEN);
screen = grsegs[ERRORSCREEN];
ShutdownId();
movedata ((unsigned)screen,7+7*160,0xb800,0,17*160);
gotoxy (1,23);
exit(1);
}
//
// build some tables
//
InitDigiMap ();
for (i=0;i YEAR ||
(d.month >= MONTH && d.day >= DAY))
{
printf("Sorry, BETA-TESTING is over. Thanks for you help.\n");
exit(1);
}
#endif
CheckForEpisodes();
Patch386 ();
InitGame ();
DemoLoop();
Quit("Demo loop exited???");
}