Commit 5127a0d0 authored by Steven Fuller's avatar Steven Fuller

More cleanups

parent 95ee2e54
...@@ -625,8 +625,8 @@ void CAL_SetupMapFile (void) ...@@ -625,8 +625,8 @@ void CAL_SetupMapFile (void)
if (pos<0) // $FFFFFFFF start is a sparse map if (pos<0) // $FFFFFFFF start is a sparse map
continue; continue;
MM_GetPtr(&(memptr)mapheaderseg[i],sizeof(maptype)); MM_GetPtr((memptr)&mapheaderseg[i],sizeof(maptype));
MM_SetLock(&(memptr)mapheaderseg[i],true); MM_SetLock((memptr)&mapheaderseg[i],true);
lseek(maphandle,pos,SEEK_SET); lseek(maphandle,pos,SEEK_SET);
CA_FarRead (maphandle,(memptr)mapheaderseg[i],sizeof(maptype)); CA_FarRead (maphandle,(memptr)mapheaderseg[i],sizeof(maptype));
} }
...@@ -636,8 +636,8 @@ void CAL_SetupMapFile (void) ...@@ -636,8 +636,8 @@ void CAL_SetupMapFile (void)
// //
for (i=0;i<MAPPLANES;i++) for (i=0;i<MAPPLANES;i++)
{ {
MM_GetPtr (&(memptr)mapsegs[i],64*64*2); MM_GetPtr ((memptr)&mapsegs[i],64*64*2);
MM_SetLock (&(memptr)mapsegs[i],true); MM_SetLock ((memptr)&mapsegs[i],true);
} }
} }
...@@ -670,7 +670,7 @@ void CAL_SetupAudioFile (void) ...@@ -670,7 +670,7 @@ void CAL_SetupAudioFile (void)
CA_CannotOpen(fname); CA_CannotOpen(fname);
length = filelength(handle); length = filelength(handle);
MM_GetPtr (&(memptr)audiostarts,length); MM_GetPtr ((memptr)&audiostarts,length);
CA_FarRead(handle, (byte *)audiostarts, length); CA_FarRead(handle, (byte *)audiostarts, length);
close(handle); close(handle);
...@@ -755,7 +755,7 @@ void CA_CacheAudioChunk (int chunk) ...@@ -755,7 +755,7 @@ void CA_CacheAudioChunk (int chunk)
if (audiosegs[chunk]) if (audiosegs[chunk])
{ {
MM_SetPurge (&(memptr)audiosegs[chunk],0); MM_SetPurge ((memptr)&audiosegs[chunk],0);
return; // allready in memory return; // allready in memory
} }
...@@ -769,7 +769,7 @@ void CA_CacheAudioChunk (int chunk) ...@@ -769,7 +769,7 @@ void CA_CacheAudioChunk (int chunk)
lseek(audiohandle,pos,SEEK_SET); lseek(audiohandle,pos,SEEK_SET);
MM_GetPtr (&(memptr)audiosegs[chunk],compressed); MM_GetPtr ((memptr)&audiosegs[chunk],compressed);
if (mmerror) if (mmerror)
return; return;
...@@ -807,7 +807,8 @@ void CA_LoadAllSounds (void) ...@@ -807,7 +807,8 @@ void CA_LoadAllSounds (void)
for (i=0;i<NUMSOUNDS;i++,start++) for (i=0;i<NUMSOUNDS;i++,start++)
if (audiosegs[start]) if (audiosegs[start])
MM_SetPurge (&(memptr)audiosegs[start],3); // make purgable MM_SetPurge ((memptr)&audiosegs[start],3);
// make purgable
cachein: cachein:
...@@ -993,7 +994,7 @@ void CA_CacheScreen (int chunk) ...@@ -993,7 +994,7 @@ void CA_CacheScreen (int chunk)
// Sprites need to have shifts made and various other junk // Sprites need to have shifts made and various other junk
// //
/* TODO: show screen! */ /* TODO: show screen! */
CAL_HuffExpand (source,MK_FP(SCREENSEG,bufferofs),expanded,grhuffman); CAL_HuffExpand (source, MK_FP(SCREENSEG,bufferofs),expanded,grhuffman);
VW_MarkUpdateBlock (0,0,319,199); VW_MarkUpdateBlock (0,0,319,199);
MM_FreePtr(&bigbufferseg); MM_FreePtr(&bigbufferseg);
} }
...@@ -1032,7 +1033,7 @@ void CA_CacheMap (int mapnum) ...@@ -1032,7 +1033,7 @@ void CA_CacheMap (int mapnum)
pos = mapheaderseg[mapnum]->planestart[plane]; pos = mapheaderseg[mapnum]->planestart[plane];
compressed = mapheaderseg[mapnum]->planelength[plane]; compressed = mapheaderseg[mapnum]->planelength[plane];
dest = &(memptr)mapsegs[plane]; dest = (memptr)&mapsegs[plane];
lseek(maphandle,pos,SEEK_SET); lseek(maphandle,pos,SEEK_SET);
if (compressed<=BUFFERSIZE) if (compressed<=BUFFERSIZE)
...@@ -1202,7 +1203,7 @@ void CA_SetAllPurge (void) ...@@ -1202,7 +1203,7 @@ void CA_SetAllPurge (void)
// //
for (i=0;i<NUMSNDCHUNKS;i++) for (i=0;i<NUMSNDCHUNKS;i++)
if (audiosegs[i]) if (audiosegs[i])
MM_SetPurge (&(memptr)audiosegs[i],3); MM_SetPurge ((memptr)&audiosegs[i],3);
// //
// free graphics // free graphics
...@@ -1457,8 +1458,6 @@ void MML_ClearBlock (void) ...@@ -1457,8 +1458,6 @@ void MML_ClearBlock (void)
=================== ===================
*/ */
static char *ParmStrings[] = {"noems","noxms",""};
void MM_Startup (void) void MM_Startup (void)
{ {
int i; int i;
...@@ -1812,7 +1811,7 @@ void MM_SortMem (void) ...@@ -1812,7 +1811,7 @@ void MM_SortMem (void)
playing += STARTADLIBSOUNDS; playing += STARTADLIBSOUNDS;
break; break;
} }
MM_SetLock(&(memptr)audiosegs[playing],true); MM_SetLock((memptr)&audiosegs[playing],true);
} }
...@@ -1883,7 +1882,7 @@ void MM_SortMem (void) ...@@ -1883,7 +1882,7 @@ void MM_SortMem (void)
aftersort(); aftersort();
if (playing) if (playing)
MM_SetLock(&(memptr)audiosegs[playing],false); MM_SetLock((memptr)&audiosegs[playing],false);
} }
...@@ -2120,8 +2119,6 @@ void MM_BombOnError (boolean bomb) ...@@ -2120,8 +2119,6 @@ void MM_BombOnError (boolean bomb)
long PMFrameCount; long PMFrameCount;
PageListStruct *PMPages, *PMSegPages; PageListStruct *PMPages, *PMSegPages;
static char *ParmStrings[] = {"nomain","noems","noxms",nil};
///////////////////////////////////////////////////////////////////////////// /////////////////////////////////////////////////////////////////////////////
// //
// Main memory code // Main memory code
...@@ -2306,10 +2303,10 @@ void PML_OpenPageFile(void) ...@@ -2306,10 +2303,10 @@ void PML_OpenPageFile(void)
// Allocate and clear the page list // Allocate and clear the page list
PMNumBlocks = ChunksInFile; PMNumBlocks = ChunksInFile;
MM_GetPtr(&(memptr)PMSegPages,sizeof(PageListStruct) * PMNumBlocks); MM_GetPtr((memptr)&PMSegPages,sizeof(PageListStruct) * PMNumBlocks);
MM_SetLock(&(memptr)PMSegPages,true); MM_SetLock((memptr)&PMSegPages,true);
PMPages = (PageListStruct *)PMSegPages; PMPages = (PageListStruct *)PMSegPages;
_fmemset(PMPages,0,sizeof(PageListStruct) * PMNumBlocks); memset(PMPages,0,sizeof(PageListStruct) * PMNumBlocks);
// Read in the chunk offsets // Read in the chunk offsets
size = sizeof(longword) * ChunksInFile; size = sizeof(longword) * ChunksInFile;
...@@ -2341,8 +2338,8 @@ void PML_ClosePageFile(void) ...@@ -2341,8 +2338,8 @@ void PML_ClosePageFile(void)
close(PageFile); close(PageFile);
if (PMSegPages) if (PMSegPages)
{ {
MM_SetLock(&(memptr)PMSegPages,false); MM_SetLock((memptr)&PMSegPages,false);
MM_FreePtr(&(void *)PMSegPages); MM_FreePtr((memptr)&PMSegPages);
} }
} }
...@@ -2891,40 +2888,13 @@ void PM_Reset(void) ...@@ -2891,40 +2888,13 @@ void PM_Reset(void)
// //
void PM_Startup(void) void PM_Startup(void)
{ {
boolean nomain,noems,noxms;
int i; int i;
if (PMStarted) if (PMStarted)
return; return;
nomain = noems = noxms = false;
for (i = 1;i < _argc;i++)
{
switch (US_CheckParm(_argv[i],ParmStrings))
{
case 0:
nomain = true;
break;
case 1:
noems = true;
break;
case 2:
noxms = true;
break;
}
}
PML_OpenPageFile(); PML_OpenPageFile();
PML_StartupMainMem();
if (!noems)
PML_StartupEMS();
if (!noxms)
PML_StartupXMS();
if (nomain && !EMSPresent)
Quit("PM_Startup: No main or EMS");
else
PML_StartupMainMem();
PM_Reset(); PM_Reset();
......
...@@ -127,7 +127,7 @@ static Direction DirTable[] = // Quick lookup for total direction ...@@ -127,7 +127,7 @@ static Direction DirTable[] = // Quick lookup for total direction
}; };
static void (*INL_KeyHook)(void); static void (*INL_KeyHook)(void);
static void interrupt (*OldKeyVect)(void); static void (*OldKeyVect)(void);
static char *ParmStrings[] = {"nojoys","nomouse",nil}; static char *ParmStrings[] = {"nojoys","nomouse",nil};
...@@ -138,8 +138,7 @@ static char *ParmStrings[] = {"nojoys","nomouse",nil}; ...@@ -138,8 +138,7 @@ static char *ParmStrings[] = {"nojoys","nomouse",nil};
// INL_KeyService() - Handles a keyboard interrupt (key up/down) // INL_KeyService() - Handles a keyboard interrupt (key up/down)
// //
/////////////////////////////////////////////////////////////////////////// ///////////////////////////////////////////////////////////////////////////
static void interrupt static void INL_KeyService(void)
INL_KeyService(void)
{ {
static boolean special; static boolean special;
byte k,c, byte k,c,
......
...@@ -1212,7 +1212,5 @@ void SpawnHitler (int tilex, int tiley); ...@@ -1212,7 +1212,5 @@ void SpawnHitler (int tilex, int tiley);
============================================================================= =============================================================================
*/ */
extern char helpfilename[],endfilename[];
extern void HelpScreens(void); extern void HelpScreens(void);
extern void EndText(void); extern void EndText(void);
...@@ -3975,11 +3975,4 @@ void CheckForEpisodes(void) ...@@ -3975,11 +3975,4 @@ void CheckForEpisodes(void)
strcat(PageFileName,extension); strcat(PageFileName,extension);
strcat(audioname,extension); strcat(audioname,extension);
strcat(demoname,extension); strcat(demoname,extension);
#ifndef SPEAR
#ifndef GOODTIMES
strcat(helpfilename,extension);
#endif
strcat(endfilename,extension);
#endif
#endif
} }
...@@ -730,8 +730,6 @@ int endextern = T_ENDART1; ...@@ -730,8 +730,6 @@ int endextern = T_ENDART1;
#ifndef SPEAR #ifndef SPEAR
int helpextern = T_HELPART; int helpextern = T_HELPART;
#endif #endif
char helpfilename[13] = "HELPART.",
endfilename[13] = "ENDART1.";
#endif #endif
/* /*
......
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