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) ...@@ -101,7 +101,7 @@ static void INL_KeyService(void)
byte k, c, temp; byte k, c, temp;
int i; int i;
k = inportb(0x60); // Get the scan code /* k = inportb(0x60); // Get the scan code */
if (k == 0xe0) // Special key prefix if (k == 0xe0) // Special key prefix
special = true; special = true;
......
...@@ -12,6 +12,7 @@ int px,py; ...@@ -12,6 +12,7 @@ int px,py;
byte fontcolor,backcolor; byte fontcolor,backcolor;
int fontnumber; int fontnumber;
unsigned freelatch;
/* ======================================================================== */ /* ======================================================================== */
void VW_DrawPropString(char *string) void VW_DrawPropString(char *string)
......
...@@ -2,13 +2,12 @@ ...@@ -2,13 +2,12 @@
#include "id_heads.h" #include "id_heads.h"
unsigned bufferofs;
unsigned displayofs;
boolean screenfaded; boolean screenfaded;
byte palette1[256][3], palette2[256][3]; byte palette1[256][3], palette2[256][3];
byte *gfxbuf;
void VL_WaitVBL(int vbls) void VL_WaitVBL(int vbls)
{ {
} }
......
...@@ -331,7 +331,7 @@ void InitAreas (void) ...@@ -331,7 +331,7 @@ void InitAreas (void)
void InitDoorList (void) void InitDoorList (void)
{ {
memset (areabyplayer,0,sizeof(areabyplayer)); memset (areabyplayer,0,sizeof(areabyplayer));
_fmemset (areaconnect,0,sizeof(areaconnect)); memset (areaconnect,0,sizeof(areaconnect));
lastdoorobj = &doorobjlist[0]; lastdoorobj = &doorobjlist[0];
doornum = 0; doornum = 0;
......
...@@ -59,8 +59,6 @@ void DebugMemory (void) ...@@ -59,8 +59,6 @@ void DebugMemory (void)
US_CPrint ("Memory Usage"); US_CPrint ("Memory Usage");
US_CPrint ("------------"); US_CPrint ("------------");
US_Print ("Total :");
US_PrintUnsigned (mminfo.mainmem/1024);
US_Print ("k\nFree :"); US_Print ("k\nFree :");
US_PrintUnsigned (MM_UnusedMemory()/1024); US_PrintUnsigned (MM_UnusedMemory()/1024);
US_Print ("k\nWith purge:"); US_Print ("k\nWith purge:");
...@@ -216,21 +214,10 @@ static char buf[10]; ...@@ -216,21 +214,10 @@ static char buf[10];
US_Print(" (Sound)"); US_Print(" (Sound)");
US_Print("\n XMS: "); US_Print("\n XMS: ");
if (page->xmsPage != -1) US_Print("No");
US_PrintUnsigned(page->xmsPage);
else
US_Print("No");
US_Print("\n Main: "); US_Print("\n Main: ");
if (page->mainPage != -1) US_Print("No");
US_PrintUnsigned(page->mainPage);
else if (page->emsPage != -1)
{
US_Print("EMS ");
US_PrintUnsigned(page->emsPage);
}
else
US_Print("No");
US_Print("\n Last hit: "); US_Print("\n Last hit: ");
US_PrintUnsigned(page->lastHit); US_PrintUnsigned(page->lastHit);
...@@ -247,7 +234,6 @@ static char buf[10]; ...@@ -247,7 +234,6 @@ static char buf[10];
// //
// draw the wall // draw the wall
// //
bufferofs += 32*SCREENWIDTH;
postx = 128; postx = 128;
postwidth = 1; postwidth = 1;
postsource = ((long)((unsigned)addr))<<16; postsource = ((long)((unsigned)addr))<<16;
...@@ -256,16 +242,13 @@ static char buf[10]; ...@@ -256,16 +242,13 @@ static char buf[10];
wallheight[postx] = 256; wallheight[postx] = 256;
FarScalePost (); FarScalePost ();
} }
bufferofs -= 32*SCREENWIDTH;
} }
else if (i < PMSoundStart) else if (i < PMSoundStart)
{ {
// //
// draw the sprite // draw the sprite
// //
bufferofs += 32*SCREENWIDTH;
SimpleScaleShape (160, i-PMSpriteStart, 64); SimpleScaleShape (160, i-PMSpriteStart, 64);
bufferofs -= 32*SCREENWIDTH;
} }
else if (i == ChunksInFile - 1) else if (i == ChunksInFile - 1)
{ {
...@@ -283,7 +266,7 @@ static char buf[10]; ...@@ -283,7 +266,7 @@ static char buf[10];
} }
else else
{ {
byte *dp = (byte *)MK_FP(addr,0); byte *dp = addr;
for (j = 0;j < NumDigi;j++) for (j = 0;j < NumDigi;j++)
{ {
k = (DigiList[(j * 2) + 1] + (PMPageSize - 1)) / PMPageSize; k = (DigiList[(j * 2) + 1] + (PMPageSize - 1)) / PMPageSize;
......
...@@ -56,6 +56,8 @@ ...@@ -56,6 +56,8 @@
#define NUMBERCHARS 9 #define NUMBERCHARS 9
#define HEIGHTRATIO 0.50
//---------------- //----------------
#define EXTRAPOINTS 40000 #define EXTRAPOINTS 40000
......
...@@ -75,7 +75,6 @@ void AsmRefresh (void); ...@@ -75,7 +75,6 @@ void AsmRefresh (void);
= =
======================== ========================
*/ */
#if 0
fixed FixedByFrac (fixed a, fixed b) fixed FixedByFrac (fixed a, fixed b)
{ {
long long ra = a; long long ra = a;
...@@ -86,7 +85,6 @@ fixed FixedByFrac (fixed a, fixed b) ...@@ -86,7 +85,6 @@ fixed FixedByFrac (fixed a, fixed b)
r >>= 16; r >>= 16;
return (fixed)r; return (fixed)r;
} }
#endif
//========================================================================== //==========================================================================
......
This diff is collapsed.
// WL_PLAY.C /* wl_play.c */
#include "WL_DEF.H" #include "wl_def.h"
#pragma hdrstop
/* /*
...@@ -67,7 +66,7 @@ int viewsize; ...@@ -67,7 +66,7 @@ int viewsize;
boolean buttonheld[NUMBUTTONS]; boolean buttonheld[NUMBUTTONS];
boolean demorecord,demoplayback; boolean demorecord,demoplayback;
char far *demoptr, far *lastdemoptr; char *demoptr, *lastdemoptr;
memptr demobuffer; memptr demobuffer;
// //
...@@ -374,11 +373,7 @@ void PollKeyboardMove (void) ...@@ -374,11 +373,7 @@ void PollKeyboardMove (void)
void PollMouseMove (void) void PollMouseMove (void)
{ {
int mousexmove,mouseymove; int mousexmove = 0, mouseymove = 0;
Mouse(MDelta);
mousexmove = _CX;
mouseymove = _DX;
controlx += mousexmove*10/(13-mouseadjustment); controlx += mousexmove*10/(13-mouseadjustment);
controly += mouseymove*20/(13-mouseadjustment); controly += mouseymove*20/(13-mouseadjustment);
...@@ -684,7 +679,6 @@ void CheckKeys (void) ...@@ -684,7 +679,6 @@ void CheckKeys (void)
STR_CHEATER5); STR_CHEATER5);
UNCACHEGRCHUNK(STARTFONT+1); UNCACHEGRCHUNK(STARTFONT+1);
PM_CheckMainMem ();
IN_ClearKeysDown(); IN_ClearKeysDown();
IN_Ack(); IN_Ack();
...@@ -713,7 +707,6 @@ void CheckKeys (void) ...@@ -713,7 +707,6 @@ void CheckKeys (void)
Message("Debugging keys are\nnow available!"); Message("Debugging keys are\nnow available!");
UNCACHEGRCHUNK(STARTFONT+1); UNCACHEGRCHUNK(STARTFONT+1);
PM_CheckMainMem ();
IN_ClearKeysDown(); IN_ClearKeysDown();
IN_Ack(); IN_Ack();
...@@ -739,7 +732,6 @@ void CheckKeys (void) ...@@ -739,7 +732,6 @@ void CheckKeys (void)
"that - right, Cheatmeister?!"); "that - right, Cheatmeister?!");
UNCACHEGRCHUNK(STARTFONT+1); UNCACHEGRCHUNK(STARTFONT+1);
PM_CheckMainMem ();
IN_ClearKeysDown(); IN_ClearKeysDown();
IN_Ack(); IN_Ack();
...@@ -758,8 +750,6 @@ void CheckKeys (void) ...@@ -758,8 +750,6 @@ void CheckKeys (void)
IN_ClearKeysDown (); IN_ClearKeysDown ();
SD_MusicOn(); SD_MusicOn();
Paused = false; Paused = false;
if (MousePresent)
Mouse(MDelta); // Clear accumulated mouse movement
return; return;
} }
...@@ -783,7 +773,6 @@ void CheckKeys (void) ...@@ -783,7 +773,6 @@ void CheckKeys (void)
if (scan == sc_F9) if (scan == sc_F9)
StartMusic (); StartMusic ();
PM_CheckMainMem ();
SETFONTCOLOR(0,15); SETFONTCOLOR(0,15);
IN_ClearKeysDown(); IN_ClearKeysDown();
return; return;
...@@ -808,9 +797,6 @@ void CheckKeys (void) ...@@ -808,9 +797,6 @@ void CheckKeys (void)
if (loadedgame) if (loadedgame)
playstate = ex_abort; playstate = ex_abort;
lasttimecount = TimeCount; lasttimecount = TimeCount;
if (MousePresent)
Mouse(MDelta); // Clear accumulated mouse movement
PM_CheckMainMem ();
return; return;
} }
...@@ -823,8 +809,6 @@ void CheckKeys (void) ...@@ -823,8 +809,6 @@ void CheckKeys (void)
fontnumber=0; fontnumber=0;
SETFONTCOLOR(0,15); SETFONTCOLOR(0,15);
DebugKeys(); DebugKeys();
if (MousePresent)
Mouse(MDelta); // Clear accumulated mouse movement
lasttimecount = TimeCount; lasttimecount = TimeCount;
return; return;
} }
...@@ -1001,8 +985,8 @@ void StopMusic(void) ...@@ -1001,8 +985,8 @@ void StopMusic(void)
for (i = 0;i < LASTMUSIC;i++) for (i = 0;i < LASTMUSIC;i++)
if (audiosegs[STARTMUSIC + i]) if (audiosegs[STARTMUSIC + i])
{ {
MM_SetPurge(&((memptr)audiosegs[STARTMUSIC + i]),3); MM_SetPurge((memptr)&(audiosegs[STARTMUSIC + i]),3);
MM_SetLock(&((memptr)audiosegs[STARTMUSIC + i]),false); MM_SetLock((memptr)&(audiosegs[STARTMUSIC + i]),false);
} }
} }
...@@ -1030,13 +1014,8 @@ void StartMusic(void) ...@@ -1030,13 +1014,8 @@ void StartMusic(void)
MM_BombOnError (false); MM_BombOnError (false);
CA_CacheAudioChunk(STARTMUSIC + chunk); CA_CacheAudioChunk(STARTMUSIC + chunk);
MM_BombOnError (true); MM_BombOnError (true);
if (mmerror) MM_SetLock((memptr)&(audiosegs[STARTMUSIC + chunk]),true);
mmerror = false; SD_StartMusic((MusicGroup *)audiosegs[STARTMUSIC + chunk]);
else
{
MM_SetLock(&((memptr)audiosegs[STARTMUSIC + chunk]),true);
SD_StartMusic((MusicGroup far *)audiosegs[STARTMUSIC + chunk]);
}
} }
...@@ -1056,13 +1035,13 @@ void StartMusic(void) ...@@ -1056,13 +1035,13 @@ void StartMusic(void)
#define WHITETICS 6 #define WHITETICS 6
byte far redshifts[NUMREDSHIFTS][768]; byte redshifts[NUMREDSHIFTS][768];
byte far whiteshifts[NUMREDSHIFTS][768]; byte whiteshifts[NUMREDSHIFTS][768];
int damagecount,bonuscount; int damagecount,bonuscount;
boolean palshifted; boolean palshifted;
extern byte far gamepal; extern byte gamepal;
/* /*
===================== =====================
...@@ -1074,7 +1053,7 @@ extern byte far gamepal; ...@@ -1074,7 +1053,7 @@ extern byte far gamepal;
void InitRedShifts (void) void InitRedShifts (void)
{ {
byte far *workptr, far *baseptr; byte *workptr, *baseptr;
int i,j,delta; int i,j,delta;
...@@ -1083,7 +1062,7 @@ void InitRedShifts (void) ...@@ -1083,7 +1062,7 @@ void InitRedShifts (void)
// //
for (i=1;i<=NUMREDSHIFTS;i++) for (i=1;i<=NUMREDSHIFTS;i++)
{ {
workptr = (byte far *)&redshifts[i-1][0]; workptr = (byte *)&redshifts[i-1][0];
baseptr = &gamepal; baseptr = &gamepal;
for (j=0;j<=255;j++) for (j=0;j<=255;j++)
...@@ -1099,7 +1078,7 @@ void InitRedShifts (void) ...@@ -1099,7 +1078,7 @@ void InitRedShifts (void)
for (i=1;i<=NUMWHITESHIFTS;i++) for (i=1;i<=NUMWHITESHIFTS;i++)
{ {
workptr = (byte far *)&whiteshifts[i-1][0]; workptr = (byte *)&whiteshifts[i-1][0];
baseptr = &gamepal; baseptr = &gamepal;
for (j=0;j<=255;j++) for (j=0;j<=255;j++)
...@@ -1376,9 +1355,6 @@ void PlayLoop (void) ...@@ -1376,9 +1355,6 @@ void PlayLoop (void)
memset (buttonstate,0,sizeof(buttonstate)); memset (buttonstate,0,sizeof(buttonstate));
ClearPaletteShifts (); ClearPaletteShifts ();
if (MousePresent)
Mouse(MDelta); // Clear accumulated mouse movement
if (demoplayback) if (demoplayback)
IN_StartAck (); IN_StartAck ();
...@@ -1386,7 +1362,7 @@ void PlayLoop (void) ...@@ -1386,7 +1362,7 @@ void PlayLoop (void)
{ {
if (virtualreality) if (virtualreality)
{ {
helmetangle = peek (0x40,0xf0); helmetangle = 0; /* TODO: virtualreality can be removed */
player->angle += helmetangle; player->angle += helmetangle;
if (player->angle >= ANGLES) if (player->angle >= ANGLES)
player->angle -= ANGLES; player->angle -= ANGLES;
......
// WL_STATE.C /* wl_state.c */
#include "WL_DEF.H" #include "wl_def.h"
#pragma hdrstop
/* /*
============================================================================= =============================================================================
......
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