Commit d9003143 authored by Steven Fuller's avatar Steven Fuller

Now just gotta fix linking problems, then actually fix the code!

parent 65d7dc44
......@@ -101,7 +101,7 @@ static void INL_KeyService(void)
byte k, c, temp;
int i;
k = inportb(0x60); // Get the scan code
/* k = inportb(0x60); // Get the scan code */
if (k == 0xe0) // Special key prefix
special = true;
......
......@@ -12,6 +12,7 @@ int px,py;
byte fontcolor,backcolor;
int fontnumber;
unsigned freelatch;
/* ======================================================================== */
void VW_DrawPropString(char *string)
......
......@@ -2,13 +2,12 @@
#include "id_heads.h"
unsigned bufferofs;
unsigned displayofs;
boolean screenfaded;
byte palette1[256][3], palette2[256][3];
byte *gfxbuf;
void VL_WaitVBL(int vbls)
{
}
......
......@@ -331,7 +331,7 @@ void InitAreas (void)
void InitDoorList (void)
{
memset (areabyplayer,0,sizeof(areabyplayer));
_fmemset (areaconnect,0,sizeof(areaconnect));
memset (areaconnect,0,sizeof(areaconnect));
lastdoorobj = &doorobjlist[0];
doornum = 0;
......
......@@ -59,8 +59,6 @@ void DebugMemory (void)
US_CPrint ("Memory Usage");
US_CPrint ("------------");
US_Print ("Total :");
US_PrintUnsigned (mminfo.mainmem/1024);
US_Print ("k\nFree :");
US_PrintUnsigned (MM_UnusedMemory()/1024);
US_Print ("k\nWith purge:");
......@@ -216,21 +214,10 @@ static char buf[10];
US_Print(" (Sound)");
US_Print("\n XMS: ");
if (page->xmsPage != -1)
US_PrintUnsigned(page->xmsPage);
else
US_Print("No");
US_Print("No");
US_Print("\n Main: ");
if (page->mainPage != -1)
US_PrintUnsigned(page->mainPage);
else if (page->emsPage != -1)
{
US_Print("EMS ");
US_PrintUnsigned(page->emsPage);
}
else
US_Print("No");
US_Print("No");
US_Print("\n Last hit: ");
US_PrintUnsigned(page->lastHit);
......@@ -247,7 +234,6 @@ static char buf[10];
//
// draw the wall
//
bufferofs += 32*SCREENWIDTH;
postx = 128;
postwidth = 1;
postsource = ((long)((unsigned)addr))<<16;
......@@ -256,16 +242,13 @@ static char buf[10];
wallheight[postx] = 256;
FarScalePost ();
}
bufferofs -= 32*SCREENWIDTH;
}
else if (i < PMSoundStart)
{
//
// draw the sprite
//
bufferofs += 32*SCREENWIDTH;
SimpleScaleShape (160, i-PMSpriteStart, 64);
bufferofs -= 32*SCREENWIDTH;
}
else if (i == ChunksInFile - 1)
{
......@@ -283,7 +266,7 @@ static char buf[10];
}
else
{
byte *dp = (byte *)MK_FP(addr,0);
byte *dp = addr;
for (j = 0;j < NumDigi;j++)
{
k = (DigiList[(j * 2) + 1] + (PMPageSize - 1)) / PMPageSize;
......
......@@ -56,6 +56,8 @@
#define NUMBERCHARS 9
#define HEIGHTRATIO 0.50
//----------------
#define EXTRAPOINTS 40000
......
......@@ -75,7 +75,6 @@ void AsmRefresh (void);
=
========================
*/
#if 0
fixed FixedByFrac (fixed a, fixed b)
{
long long ra = a;
......@@ -86,7 +85,6 @@ fixed FixedByFrac (fixed a, fixed b)
r >>= 16;
return (fixed)r;
}
#endif
//==========================================================================
......
......@@ -64,7 +64,7 @@ char configname[13]="config.";
unsigned xoffset, yoffset;
int _argc;
char **argv;
char **_argv;
/*
=============================================================================
......@@ -260,7 +260,7 @@ void DiskFlopAnim(int x,int y)
}
long DoChecksum(byte far *source,unsigned size,long checksum)
long DoChecksum(byte *source,unsigned size,long checksum)
{
unsigned i;
......@@ -281,110 +281,75 @@ long DoChecksum(byte far *source,unsigned size,long checksum)
boolean SaveTheGame(int file,int x,int y)
{
struct diskfree_t dfree;
long avail,size,checksum;
objtype *ob,nullobj;
if (_dos_getdiskfree(0,&dfree))
Quit("Error in _dos_getdiskfree call");
avail = (long)dfree.avail_clusters *
dfree.bytes_per_sector *
dfree.sectors_per_cluster;
size = 0;
for (ob = player; ob ; ob=ob->next)
size += sizeof(*ob);
size += sizeof(nullobj);
size += sizeof(gamestate) +
sizeof(LRstruct)*8 +
sizeof(tilemap) +
sizeof(actorat) +
sizeof(laststatobj) +
sizeof(statobjlist) +
sizeof(doorposition) +
sizeof(pwallstate) +
sizeof(pwallx) +
sizeof(pwally) +
sizeof(pwalldir) +
sizeof(pwallpos);
if (avail < size)
{
Message(STR_NOSPACE1"\n"
STR_NOSPACE2);
return false;
}
checksum = 0;
DiskFlopAnim(x,y);
CA_FarWrite (file,(void far *)&gamestate,sizeof(gamestate));
checksum = DoChecksum((byte far *)&gamestate,sizeof(gamestate),checksum);
CA_FarWrite (file,(void *)&gamestate,sizeof(gamestate));
checksum = DoChecksum((byte *)&gamestate,sizeof(gamestate),checksum);
DiskFlopAnim(x,y);
#ifdef SPEAR
CA_FarWrite (file,(void far *)&LevelRatios[0],sizeof(LRstruct)*20);
checksum = DoChecksum((byte far *)&LevelRatios[0],sizeof(LRstruct)*20,checksum);
CA_FarWrite (file,(void *)&LevelRatios[0],sizeof(LRstruct)*20);
checksum = DoChecksum((byte *)&LevelRatios[0],sizeof(LRstruct)*20,checksum);
#else
CA_FarWrite (file,(void far *)&LevelRatios[0],sizeof(LRstruct)*8);
checksum = DoChecksum((byte far *)&LevelRatios[0],sizeof(LRstruct)*8,checksum);
CA_FarWrite (file,(void *)&LevelRatios[0],sizeof(LRstruct)*8);
checksum = DoChecksum((byte *)&LevelRatios[0],sizeof(LRstruct)*8,checksum);
#endif
DiskFlopAnim(x,y);
CA_FarWrite (file,(void far *)tilemap,sizeof(tilemap));
checksum = DoChecksum((byte far *)tilemap,sizeof(tilemap),checksum);
CA_FarWrite (file,(void *)tilemap,sizeof(tilemap));
checksum = DoChecksum((byte *)tilemap,sizeof(tilemap),checksum);
DiskFlopAnim(x,y);
CA_FarWrite (file,(void far *)actorat,sizeof(actorat));
checksum = DoChecksum((byte far *)actorat,sizeof(actorat),checksum);
CA_FarWrite (file,(void *)actorat,sizeof(actorat));
checksum = DoChecksum((byte *)actorat,sizeof(actorat),checksum);
CA_FarWrite (file,(void far *)areaconnect,sizeof(areaconnect));
CA_FarWrite (file,(void far *)areabyplayer,sizeof(areabyplayer));
CA_FarWrite (file,(void *)areaconnect,sizeof(areaconnect));
CA_FarWrite (file,(void *)areabyplayer,sizeof(areabyplayer));
for (ob = player ; ob ; ob=ob->next)
{
DiskFlopAnim(x,y);
CA_FarWrite (file,(void far *)ob,sizeof(*ob));
CA_FarWrite (file,(void *)ob,sizeof(*ob));
}
nullobj.active = ac_badobject; // end of file marker
DiskFlopAnim(x,y);
CA_FarWrite (file,(void far *)&nullobj,sizeof(nullobj));
CA_FarWrite (file,(void *)&nullobj,sizeof(nullobj));
DiskFlopAnim(x,y);
CA_FarWrite (file,(void far *)&laststatobj,sizeof(laststatobj));
checksum = DoChecksum((byte far *)&laststatobj,sizeof(laststatobj),checksum);
CA_FarWrite (file,(void *)&laststatobj,sizeof(laststatobj));
checksum = DoChecksum((byte *)&laststatobj,sizeof(laststatobj),checksum);
DiskFlopAnim(x,y);
CA_FarWrite (file,(void far *)statobjlist,sizeof(statobjlist));
checksum = DoChecksum((byte far *)statobjlist,sizeof(statobjlist),checksum);
CA_FarWrite (file,(void *)statobjlist,sizeof(statobjlist));
checksum = DoChecksum((byte *)statobjlist,sizeof(statobjlist),checksum);
DiskFlopAnim(x,y);
CA_FarWrite (file,(void far *)doorposition,sizeof(doorposition));
checksum = DoChecksum((byte far *)doorposition,sizeof(doorposition),checksum);
CA_FarWrite (file,(void *)doorposition,sizeof(doorposition));
checksum = DoChecksum((byte *)doorposition,sizeof(doorposition),checksum);
DiskFlopAnim(x,y);
CA_FarWrite (file,(void far *)doorobjlist,sizeof(doorobjlist));
checksum = DoChecksum((byte far *)doorobjlist,sizeof(doorobjlist),checksum);
CA_FarWrite (file,(void *)doorobjlist,sizeof(doorobjlist));
checksum = DoChecksum((byte *)doorobjlist,sizeof(doorobjlist),checksum);
DiskFlopAnim(x,y);
CA_FarWrite (file,(void far *)&pwallstate,sizeof(pwallstate));
checksum = DoChecksum((byte far *)&pwallstate,sizeof(pwallstate),checksum);
CA_FarWrite (file,(void far *)&pwallx,sizeof(pwallx));
checksum = DoChecksum((byte far *)&pwallx,sizeof(pwallx),checksum);
CA_FarWrite (file,(void far *)&pwally,sizeof(pwally));
checksum = DoChecksum((byte far *)&pwally,sizeof(pwally),checksum);
CA_FarWrite (file,(void far *)&pwalldir,sizeof(pwalldir));
checksum = DoChecksum((byte far *)&pwalldir,sizeof(pwalldir),checksum);
CA_FarWrite (file,(void far *)&pwallpos,sizeof(pwallpos));
checksum = DoChecksum((byte far *)&pwallpos,sizeof(pwallpos),checksum);
CA_FarWrite (file,(void *)&pwallstate,sizeof(pwallstate));
checksum = DoChecksum((byte *)&pwallstate,sizeof(pwallstate),checksum);
CA_FarWrite (file,(void *)&pwallx,sizeof(pwallx));
checksum = DoChecksum((byte *)&pwallx,sizeof(pwallx),checksum);
CA_FarWrite (file,(void *)&pwally,sizeof(pwally));
checksum = DoChecksum((byte *)&pwally,sizeof(pwally),checksum);
CA_FarWrite (file,(void *)&pwalldir,sizeof(pwalldir));
checksum = DoChecksum((byte *)&pwalldir,sizeof(pwalldir),checksum);
CA_FarWrite (file,(void *)&pwallpos,sizeof(pwallpos));
checksum = DoChecksum((byte *)&pwallpos,sizeof(pwallpos),checksum);
//
// WRITE OUT CHECKSUM
//
CA_FarWrite (file,(void far *)&checksum,sizeof(checksum));
CA_FarWrite (file,(void *)&checksum,sizeof(checksum));
return(true);
}
......@@ -408,41 +373,41 @@ boolean LoadTheGame(int file,int x,int y)
checksum = 0;
DiskFlopAnim(x,y);
CA_FarRead (file,(void far *)&gamestate,sizeof(gamestate));
checksum = DoChecksum((byte far *)&gamestate,sizeof(gamestate),checksum);
CA_FarRead (file,(void *)&gamestate,sizeof(gamestate));
checksum = DoChecksum((byte *)&gamestate,sizeof(gamestate),checksum);
DiskFlopAnim(x,y);
#ifdef SPEAR
CA_FarRead (file,(void far *)&LevelRatios[0],sizeof(LRstruct)*20);
checksum = DoChecksum((byte far *)&LevelRatios[0],sizeof(LRstruct)*20,checksum);
CA_FarRead (file,(void *)&LevelRatios[0],sizeof(LRstruct)*20);
checksum = DoChecksum((byte *)&LevelRatios[0],sizeof(LRstruct)*20,checksum);
#else
CA_FarRead (file,(void far *)&LevelRatios[0],sizeof(LRstruct)*8);
checksum = DoChecksum((byte far *)&LevelRatios[0],sizeof(LRstruct)*8,checksum);
CA_FarRead (file,(void *)&LevelRatios[0],sizeof(LRstruct)*8);
checksum = DoChecksum((byte *)&LevelRatios[0],sizeof(LRstruct)*8,checksum);
#endif
DiskFlopAnim(x,y);
SetupGameLevel ();
DiskFlopAnim(x,y);
CA_FarRead (file,(void far *)tilemap,sizeof(tilemap));
checksum = DoChecksum((byte far *)tilemap,sizeof(tilemap),checksum);
CA_FarRead (file,(void *)tilemap,sizeof(tilemap));
checksum = DoChecksum((byte *)tilemap,sizeof(tilemap),checksum);
DiskFlopAnim(x,y);
CA_FarRead (file,(void far *)actorat,sizeof(actorat));
checksum = DoChecksum((byte far *)actorat,sizeof(actorat),checksum);
CA_FarRead (file,(void *)actorat,sizeof(actorat));
checksum = DoChecksum((byte *)actorat,sizeof(actorat),checksum);
CA_FarRead (file,(void far *)areaconnect,sizeof(areaconnect));
CA_FarRead (file,(void far *)areabyplayer,sizeof(areabyplayer));
CA_FarRead (file,(void *)areaconnect,sizeof(areaconnect));
CA_FarRead (file,(void *)areabyplayer,sizeof(areabyplayer));
InitActorList ();
DiskFlopAnim(x,y);
CA_FarRead (file,(void far *)player,sizeof(*player));
CA_FarRead (file,(void *)player,sizeof(*player));
while (1)
{
DiskFlopAnim(x,y);
CA_FarRead (file,(void far *)&nullobj,sizeof(nullobj));
CA_FarRead (file,(void *)&nullobj,sizeof(nullobj));
if (nullobj.active == ac_badobject)
break;
GetNewActor ();
......@@ -453,32 +418,32 @@ boolean LoadTheGame(int file,int x,int y)
DiskFlopAnim(x,y);
CA_FarRead (file,(void far *)&laststatobj,sizeof(laststatobj));
checksum = DoChecksum((byte far *)&laststatobj,sizeof(laststatobj),checksum);
CA_FarRead (file,(void *)&laststatobj,sizeof(laststatobj));
checksum = DoChecksum((byte *)&laststatobj,sizeof(laststatobj),checksum);
DiskFlopAnim(x,y);
CA_FarRead (file,(void far *)statobjlist,sizeof(statobjlist));
checksum = DoChecksum((byte far *)statobjlist,sizeof(statobjlist),checksum);
CA_FarRead (file,(void *)statobjlist,sizeof(statobjlist));
checksum = DoChecksum((byte *)statobjlist,sizeof(statobjlist),checksum);
DiskFlopAnim(x,y);
CA_FarRead (file,(void far *)doorposition,sizeof(doorposition));
checksum = DoChecksum((byte far *)doorposition,sizeof(doorposition),checksum);
CA_FarRead (file,(void *)doorposition,sizeof(doorposition));
checksum = DoChecksum((byte *)doorposition,sizeof(doorposition),checksum);
DiskFlopAnim(x,y);
CA_FarRead (file,(void far *)doorobjlist,sizeof(doorobjlist));
checksum = DoChecksum((byte far *)doorobjlist,sizeof(doorobjlist),checksum);
CA_FarRead (file,(void *)doorobjlist,sizeof(doorobjlist));
checksum = DoChecksum((byte *)doorobjlist,sizeof(doorobjlist),checksum);
DiskFlopAnim(x,y);
CA_FarRead (file,(void far *)&pwallstate,sizeof(pwallstate));
checksum = DoChecksum((byte far *)&pwallstate,sizeof(pwallstate),checksum);
CA_FarRead (file,(void far *)&pwallx,sizeof(pwallx));
checksum = DoChecksum((byte far *)&pwallx,sizeof(pwallx),checksum);
CA_FarRead (file,(void far *)&pwally,sizeof(pwally));
checksum = DoChecksum((byte far *)&pwally,sizeof(pwally),checksum);
CA_FarRead (file,(void far *)&pwalldir,sizeof(pwalldir));
checksum = DoChecksum((byte far *)&pwalldir,sizeof(pwalldir),checksum);
CA_FarRead (file,(void far *)&pwallpos,sizeof(pwallpos));
checksum = DoChecksum((byte far *)&pwallpos,sizeof(pwallpos),checksum);
CA_FarRead (file,(void far *)&oldchecksum,sizeof(oldchecksum));
CA_FarRead (file,(void *)&pwallstate,sizeof(pwallstate));
checksum = DoChecksum((byte *)&pwallstate,sizeof(pwallstate),checksum);
CA_FarRead (file,(void *)&pwallx,sizeof(pwallx));
checksum = DoChecksum((byte *)&pwallx,sizeof(pwallx),checksum);
CA_FarRead (file,(void *)&pwally,sizeof(pwally));
checksum = DoChecksum((byte *)&pwally,sizeof(pwally),checksum);
CA_FarRead (file,(void *)&pwalldir,sizeof(pwalldir));
checksum = DoChecksum((byte *)&pwalldir,sizeof(pwalldir),checksum);
CA_FarRead (file,(void *)&pwallpos,sizeof(pwallpos));
checksum = DoChecksum((byte *)&pwallpos,sizeof(pwallpos),checksum);
CA_FarRead (file,(void *)&oldchecksum,sizeof(oldchecksum));
if (oldchecksum != checksum)
{
......@@ -708,7 +673,7 @@ void FinishSignon (void)
{
#ifndef SPEAR
VW_Bar (0,189,300,11,peekb(0xa000,0));
VW_Bar (0,189,300,11, *gfxbuf);
WindowX = 0;
WindowW = 320;
PrintY = 190;
......@@ -728,7 +693,7 @@ void FinishSignon (void)
IN_Ack ();
#ifndef JAPAN
VW_Bar (0,189,300,11,peekb(0xa000,0));
VW_Bar (0,189,300,11,*gfxbuf);
PrintY = 190;
SETFONTCOLOR(10,4);
......@@ -758,7 +723,7 @@ void FinishSignon (void)
=================
*/
boolean MS_CheckParm (char far *check)
boolean MS_CheckParm(char *check)
{
int i;
char *parm;
......@@ -771,7 +736,7 @@ boolean MS_CheckParm (char far *check)
if (!*parm++)
break; // hit end of string without an alphanum
if ( !_fstricmp(check,parm) )
if ( !strcasecmp(check,parm) )
return true;
}
......@@ -913,7 +878,7 @@ void InitDigiMap (void)
#ifndef SPEAR
CP_iteminfo MusicItems={CTL_X,CTL_Y,6,0,32};
CP_itemtype far MusicMenu[]=
CP_itemtype MusicMenu[]=
{
{1,"Get Them!",0},
{1,"Searching",0},
......@@ -938,7 +903,7 @@ CP_itemtype far MusicMenu[]=
};
#else
CP_iteminfo MusicItems={CTL_X,CTL_Y-20,9,0,32};
CP_itemtype far MusicMenu[]=
CP_itemtype MusicMenu[]=
{
{1,"Funky Colonel Bill",0},
{1,"Death To The Nazis",0},
......@@ -991,9 +956,6 @@ void DoJukebox(void)
XTOWER2_MUS // 23
#endif
};
struct dostime_t time;
IN_ClearKeysDown();
if (!AdLibPresent && !SoundBlasterPresent)
......@@ -1004,8 +966,7 @@ void DoJukebox(void)
#ifndef SPEAR
#ifndef UPLOAD
_dos_gettime(&time);
start = (time.hsecond%3)*6;
start = (rand()%3)*6;
#else
start = 0;
#endif
......@@ -1086,7 +1047,6 @@ void DoJukebox(void)
void InitGame (void)
{
int i,x,y;
unsigned *blockstart;
if (MS_CheckParm ("virtual"))
virtualreality = true;
......@@ -1100,29 +1060,10 @@ void InitGame (void)
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
//
......@@ -1137,15 +1078,8 @@ void InitGame (void)
for (i=0;i<PORTTILESHIGH;i++)
uwidthtable[i] = UPDATEWIDE*i;
blockstart = &blockstarts[0];
for (y=0;y<UPDATEHIGH;y++)
for (x=0;x<UPDATEWIDE;x++)
*blockstart++ = SCREENWIDTH*16*y+x*TILEWIDTH;
updateptr = &update[0];
bufferofs = 0;
displayofs = 0;
ReadConfig ();
......@@ -1184,13 +1118,9 @@ void InitGame (void)
if (!virtualreality)
FinishSignon();
displayofs = PAGE1START;
bufferofs = PAGE2START;
if (virtualreality)
{
NoWait = true;
geninterrupt(0x60);
}
}
......@@ -1212,7 +1142,7 @@ boolean SetViewSize (unsigned width, unsigned height)
shootdelta = viewwidth/10;
screenofs = ((200-STATUSLINES-viewheight)/2*SCREENWIDTH+(320-viewwidth)/8);
yoffset = (200-STATUSLINES-viewheight)/2
yoffset = (200-STATUSLINES-viewheight)/2;
xoffset = (320-viewwidth)/2;
//
......@@ -1280,9 +1210,6 @@ void Quit (char *error)
unsigned finscreen;
memptr screen;
if (virtualreality)
geninterrupt(0x61);
ClearMemory ();
if (!*error)
{
......@@ -1299,7 +1226,13 @@ void Quit (char *error)
}
ShutdownId ();
if (error && *error)
printf("Quit: %s\n", error);
else
printf("Quit: Nothing\n");
#if 0
if (error && *error)
{
movedata ((unsigned)screen,7,0xb800,0,7*160);
......@@ -1316,12 +1249,8 @@ void Quit (char *error)
movedata ((unsigned)screen,7,0xb800,0,4000);
gotoxy(1,24);
#endif
//asm mov bh,0
//asm mov dh,23 // row
//asm mov dl,0 // collumn
//asm mov ah,2
//asm int 0x10
}
#endif
exit(0);
}
......@@ -1513,7 +1442,7 @@ void DemoLoop (void)
==========================
*/
void main(int argc, char *argv[])
int main(int argc, char *argv[])
{
int i;
......@@ -1527,5 +1456,7 @@ void main(int argc, char *argv[])
DemoLoop();
Quit("Demo loop exited???");
return 0;
}
// WL_PLAY.C
/* wl_play.c */
#include "WL_DEF.H"
#pragma hdrstop
#include "wl_def.h"
/*
......@@ -67,7 +66,7 @@ int viewsize;
boolean buttonheld[NUMBUTTONS];
boolean demorecord,demoplayback;
char far *demoptr, far *lastdemoptr;
char *demoptr, *lastdemoptr;
memptr demobuffer;
//
......@@ -374,11 +373,7 @@ void PollKeyboardMove (void)
void PollMouseMove (void)
{
int mousexmove,mouseymove;
Mouse(MDelta);
mousexmove = _CX;
mouseymove = _DX;
int mousexmove = 0, mouseymove = 0;
controlx += mousexmove*10/(13-mouseadjustment);
controly += mouseymove*20/(13-mouseadjustment);
......@@ -684,7 +679,6 @@ void CheckKeys (void)
STR_CHEATER5);
UNCACHEGRCHUNK(STARTFONT+1);
PM_CheckMainMem ();
IN_ClearKeysDown();
IN_Ack();
......@@ -713,7 +707,6 @@ void CheckKeys (void)
Message("Debugging keys are\nnow available!");
UNCACHEGRCHUNK(STARTFONT+1);
PM_CheckMainMem ();
IN_ClearKeysDown();
IN_Ack();
......@@ -739,7 +732,6 @@ void CheckKeys (void)
"that - right, Cheatmeister?!");
UNCACHEGRCHUNK(STARTFONT+1);
PM_CheckMainMem ();
IN_ClearKeysDown();
IN_Ack();
......@@ -758,8 +750,6 @@ void CheckKeys (void)
IN_ClearKeysDown ();
SD_MusicOn();
Paused = false;
if (MousePresent)
Mouse(MDelta); // Clear accumulated mouse movement
return;
}
......@@ -783,7 +773,6 @@ void CheckKeys (void)
if (scan == sc_F9)
StartMusic ();
PM_CheckMainMem ();
SETFONTCOLOR(0,15);
IN_ClearKeysDown();
return;
......@@ -808,9 +797,6 @@ void CheckKeys (void)
if (loadedgame)
playstate = ex_abort;
lasttimecount = TimeCount;
if (MousePresent)
Mouse(MDelta); // Clear accumulated mouse movement
PM_CheckMainMem ();
return;
}
......@@ -823,8 +809,6 @@ void CheckKeys (void)
fontnumber=0;
SETFONTCOLOR(0,15);
DebugKeys();
if (MousePresent)
Mouse(MDelta); // Clear accumulated mouse movement
lasttimecount = TimeCount;
return;
}
......@@ -1001,8 +985,8 @@ void StopMusic(void)
for (i = 0;i < LASTMUSIC;i++)
if (audiosegs[STARTMUSIC + i])
{
MM_SetPurge(&((memptr)audiosegs[STARTMUSIC + i]),3);
MM_SetLock(&((memptr)audiosegs[STARTMUSIC + i]),false);
MM_SetPurge((memptr)&(audiosegs[STARTMUSIC + i]),3);
MM_SetLock((memptr)&(audiosegs[STARTMUSIC + i]),false);
}
}
......@@ -1030,13 +1014,8 @@ void StartMusic(void)
MM_BombOnError (false);
CA_CacheAudioChunk(STARTMUSIC + chunk);
MM_BombOnError (true);
if (mmerror)
mmerror = false;
else
{
MM_SetLock(&((memptr)audiosegs[STARTMUSIC + chunk]),true);
SD_StartMusic((MusicGroup far *)audiosegs[STARTMUSIC + chunk]);
}
MM_SetLock((memptr)&(audiosegs[STARTMUSIC + chunk]),true);
SD_StartMusic((MusicGroup *)audiosegs[STARTMUSIC + chunk]);
}
......@@ -1056,13 +1035,13 @@ void StartMusic(void)
#define WHITETICS 6
byte far redshifts[NUMREDSHIFTS][768];
byte far whiteshifts[NUMREDSHIFTS][768];
byte redshifts[NUMREDSHIFTS][768];
byte whiteshifts[NUMREDSHIFTS][768];
int damagecount,bonuscount;
boolean palshifted;
extern byte far gamepal;
extern byte gamepal;
/*
=====================
......@@ -1074,7 +1053,7 @@ extern byte far gamepal;
void InitRedShifts (void)
{
byte far *workptr, far *baseptr;
byte *workptr, *baseptr;
int i,j,delta;
......@@ -1083,7 +1062,7 @@ void InitRedShifts (void)
//
for (i=1;i<=NUMREDSHIFTS;i++)
{
workptr = (byte far *)&redshifts[i-1][0];
workptr = (byte *)&redshifts[i-1][0];
baseptr = &gamepal;
for (j=0;j<=255;j++)
......@@ -1099,7 +1078,7 @@ void InitRedShifts (void)
for (i=1;i<=NUMWHITESHIFTS;i++)
{
workptr = (byte far *)&whiteshifts[i-1][0];
workptr = (byte *)&whiteshifts[i-1][0];
baseptr = &gamepal;
for (j=0;j<=255;j++)
......@@ -1376,9 +1355,6 @@ void PlayLoop (void)
memset (buttonstate,0,sizeof(buttonstate));
ClearPaletteShifts ();
if (MousePresent)
Mouse(MDelta); // Clear accumulated mouse movement
if (demoplayback)
IN_StartAck ();
......@@ -1386,7 +1362,7 @@ void PlayLoop (void)
{
if (virtualreality)
{
helmetangle = peek (0x40,0xf0);
helmetangle = 0; /* TODO: virtualreality can be removed */
player->angle += helmetangle;
if (player->angle >= ANGLES)
player->angle -= ANGLES;
......
// WL_STATE.C
/* wl_state.c */
#include "WL_DEF.H"
#pragma hdrstop
#include "wl_def.h"
/*
=============================================================================
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment