From: sparky4 Date: Thu, 15 Sep 2016 15:52:30 +0000 (-0500) Subject: pm mm and ca i am working on pm started wwww X-Git-Url: http://4ch.mooo.com/gitweb/?a=commitdiff_plain;h=0c47a862860b6ae769429092860ecd9ae1591ba9;p=16.git pm mm and ca i am working on pm started wwww --- diff --git a/bcexmm.dsk b/bcexmm.dsk index 9d1c2ae5..115d6b99 100755 Binary files a/bcexmm.dsk and b/bcexmm.dsk differ diff --git a/bcexmm.exe b/bcexmm.exe index d4ca4af8..b0c69877 100755 Binary files a/bcexmm.exe and b/bcexmm.exe differ diff --git a/bcexmm.prj b/bcexmm.prj index 6a7ef631..8ea92c50 100755 Binary files a/bcexmm.prj and b/bcexmm.prj differ diff --git a/makefile b/makefile index 22929918..41c58178 100755 --- a/makefile +++ b/makefile @@ -91,7 +91,7 @@ UPXQ=-qqq S_FLAGS=-sg -st -of+ -zu -zdf -zff -zgf -k32768#54096#60000 Z_FLAGS=-zk0 -zc -zp8 -zm O_FLAGS=-obmilr -oe=24 -out -oh -ei -onac -ol+ -ok##x -T_FLAGS=-bt=dos -mh -0 -fpi87 -fo=.$(OBJ) -d1 +T_FLAGS=-bt=dos -mh -0 -fpi87 -fo=.$(OBJ) -d1 -e=256 CPPFLAGS=-DTARGET_MSDOS=16 -DMSDOS=1 !ifeq DEBUGSERIAL 1 @@ -288,6 +288,7 @@ mapread.$(OBJ): $(SRCLIB)/mapread.c $(SRCLIB)/mapread.h 16_timer.$(OBJ): $(SRCLIB)/16_timer.c $(SRCLIB)/16_timer.h 16_in.$(OBJ): $(SRCLIB)/16_in.c $(SRCLIB)/16_in.h 16_mm.$(OBJ): $(SRCLIB)/16_mm.c $(SRCLIB)/16_mm.h +16_pm.$(OBJ): $(SRCLIB)/16_pm.c $(SRCLIB)/16_pm.h 16_ca.$(OBJ): $(SRCLIB)/16_ca.c $(SRCLIB)/16_ca.h 16_dbg.$(OBJ): $(SRCLIB)/16_dbg.c $(SRCLIB)/16_dbg.h midi.$(OBJ): $(SRCLIB)/midi.c $(SRCLIB)/midi.h diff --git a/pm.use b/pm.use index e96744a7..a255a3a3 100755 --- a/pm.use +++ b/pm.use @@ -66,7 +66,7 @@ 16/wf3d8086/id_sd.c: PM_CheckMainMem(); 16/wf3d8086/id_sd.c: p = (word far *)MK_FP(PM_GetPage(ChunksInFile - 1),0); 16/wf3d8086/id_sd.c: PM_UnlockMainMem(); -Binary file 16/wf3d8086/obj/wolf3d.exe matches +Binary file 16/wf3d8086/obj/wolf3d.exe matches 16/wf3d8086/obj/wolf3d.map: 1A268H 1B44AH 011E3H ID_PM_TEXT CODE 16/wf3d8086/obj/wolf3d.map: 1A26:0008 11E3 C=CODE S=ID_PM_TEXT G=(none) M=ID_PM.C ACBP=28 16/wf3d8086/obj/wolf3d.map: 1A26:02F3 _PM_CheckMainMem @@ -145,438 +145,128 @@ Binary file 16/wf3d8086/obj/wolf3d.exe matches 16/wf3d8086/wolf3d.map: 1912:114B _PM_Shutdown 16/wf3d8086/wolfhack.c: src = PM_GetPage(0); 16/wf3d8086/wolfhack.c: src = PM_GetPage(1); -16/wolf3d/WOLFSRC/CONTIGSC.C: shape = PM_GetSpritePage (shapenum); -16/wolf3d/WOLFSRC/CONTIGSC.C: shape = PM_GetSpritePage (shapenum); -16/wolf3d/WOLFSRC/ID_PM.C:// PM_SetMainMemPurge() - Sets the purge level for all allocated main memory -16/wolf3d/WOLFSRC/ID_PM.C:// blocks. This shouldn't be called directly - the PM_LockMainMem() and -16/wolf3d/WOLFSRC/ID_PM.C:// PM_UnlockMainMem() macros should be used instead. -16/wolf3d/WOLFSRC/ID_PM.C:PM_SetMainMemPurge(int level) -16/wolf3d/WOLFSRC/ID_PM.C:// PM_CheckMainMem() - If something besides the Page Mgr makes requests of -16/wolf3d/WOLFSRC/ID_PM.C:// This routine now calls PM_LockMainMem() to make sure that any allocation -16/wolf3d/WOLFSRC/ID_PM.C:// of the other blocks. Because PM_LockMainMem() is called, -16/wolf3d/WOLFSRC/ID_PM.C:// PM_UnlockMainMem() needs to be called before any other part of the -16/wolf3d/WOLFSRC/ID_PM.C:PM_CheckMainMem(void) -16/wolf3d/WOLFSRC/ID_PM.C: PM_LockMainMem(); -16/wolf3d/WOLFSRC/ID_PM.C:// necessary to make requests of the Memory Mgr, PM_UnlockMainMem() -16/wolf3d/WOLFSRC/ID_PM.C: Quit("PM_SetupMainMem: Not enough main memory"); -16/wolf3d/WOLFSRC/ID_PM.C:// PM_GetPageAddress() - Returns the address of a given page -16/wolf3d/WOLFSRC/ID_PM.C:PM_GetPageAddress(int pagenum) -16/wolf3d/WOLFSRC/ID_PM.C: PML_CopyToXMS(PM_GetPageAddress(pagenum),page->xmsPage,page->length); -16/wolf3d/WOLFSRC/ID_PM.C: addr = PM_GetPageAddress(orig); -16/wolf3d/WOLFSRC/ID_PM.C:// PM_GetPage() - Returns the address of the page, loading it if necessary -16/wolf3d/WOLFSRC/ID_PM.C:PM_GetPage(int pagenum) -16/wolf3d/WOLFSRC/ID_PM.C: Quit("PM_GetPage: Invalid page request"); -16/wolf3d/WOLFSRC/ID_PM.C: if (!(result = PM_GetPageAddress(pagenum))) -16/wolf3d/WOLFSRC/ID_PM.C: result = PM_GetPageAddress(pagenum); -16/wolf3d/WOLFSRC/ID_PM.C:// PM_SetPageLock() - Sets the lock type on a given page -16/wolf3d/WOLFSRC/ID_PM.C:PM_SetPageLock(int pagenum,PMLockType lock) -16/wolf3d/WOLFSRC/ID_PM.C: Quit("PM_SetPageLock: Locking/unlocking non-sound page"); -16/wolf3d/WOLFSRC/ID_PM.C:// PM_Preload() - Loads as many pages as possible into all types of memory. -16/wolf3d/WOLFSRC/ID_PM.C:PM_Preload(boolean (*update)(word current,word total)) -16/wolf3d/WOLFSRC/ID_PM.C: Quit ("PM_Preload: Pages>=ChunksInFile"); -16/wolf3d/WOLFSRC/ID_PM.C: PM_GetPage(page); -16/wolf3d/WOLFSRC/ID_PM.C: addr = PM_GetPage(oogypage); -16/wolf3d/WOLFSRC/ID_PM.C: Quit("PM_Preload: XMS buffer failed"); -16/wolf3d/WOLFSRC/ID_PM.C: Quit ("PM_Preload: Pages>=ChunksInFile"); -16/wolf3d/WOLFSRC/ID_PM.C: Quit("PM_Preload: Exceeded XMS pages"); -16/wolf3d/WOLFSRC/ID_PM.C: Quit("PM_Preload: Page too long"); -16/wolf3d/WOLFSRC/ID_PM.C:// PM_NextFrame() - Increments the frame counter and adjusts the thrash -16/wolf3d/WOLFSRC/ID_PM.C:PM_NextFrame(void) -16/wolf3d/WOLFSRC/ID_PM.C: sprintf(buf,"PM_NextFrame: Page %d is locked",i); -16/wolf3d/WOLFSRC/ID_PM.C:// PM_Reset() - Sets up caching structures -16/wolf3d/WOLFSRC/ID_PM.C:PM_Reset(void) -16/wolf3d/WOLFSRC/ID_PM.C:// PM_Startup() - Start up the Page Mgr -16/wolf3d/WOLFSRC/ID_PM.C:PM_Startup(void) -16/wolf3d/WOLFSRC/ID_PM.C: Quit("PM_Startup: No main or EMS"); -16/wolf3d/WOLFSRC/ID_PM.C: PM_Reset(); -16/wolf3d/WOLFSRC/ID_PM.C:// PM_Shutdown() - Shut down the Page Mgr -16/wolf3d/WOLFSRC/ID_PM.C:PM_Shutdown(void) -16/wolf3d/WOLFSRC/ID_PM.H:#define PM_GetSoundPage(v) PM_GetPage(PMSoundStart + (v)) -16/wolf3d/WOLFSRC/ID_PM.H:#define PM_GetSpritePage(v) PM_GetPage(PMSpriteStart + (v)) -16/wolf3d/WOLFSRC/ID_PM.H:#define PM_LockMainMem() PM_SetMainMemPurge(0) -16/wolf3d/WOLFSRC/ID_PM.H:#define PM_UnlockMainMem() PM_SetMainMemPurge(3) -16/wolf3d/WOLFSRC/ID_PM.H:extern void PM_Startup(void), -16/wolf3d/WOLFSRC/ID_PM.H: PM_Shutdown(void), -16/wolf3d/WOLFSRC/ID_PM.H: PM_Reset(void), -16/wolf3d/WOLFSRC/ID_PM.H: PM_Preload(boolean (*update)(word current,word total)), -16/wolf3d/WOLFSRC/ID_PM.H: PM_NextFrame(void), -16/wolf3d/WOLFSRC/ID_PM.H: PM_SetPageLock(int pagenum,PMLockType lock), -16/wolf3d/WOLFSRC/ID_PM.H: PM_SetMainPurge(int level), -16/wolf3d/WOLFSRC/ID_PM.H: PM_CheckMainMem(void); -16/wolf3d/WOLFSRC/ID_PM.H:extern memptr PM_GetPageAddress(int pagenum), -16/wolf3d/WOLFSRC/ID_PM.H: PM_GetPage(int pagenum); // Use this one to cache page -16/wolf3d/WOLFSRC/ID_PM.H:void PM_SetMainMemPurge(int level); -16/wolf3d/WOLFSRC/ID_SD.C: addr = PM_GetSoundPage(page); -16/wolf3d/WOLFSRC/ID_SD.C: PM_SetPageLock(PMSoundStart + page,pml_Locked); -16/wolf3d/WOLFSRC/ID_SD.C: PM_SetPageLock(i + PMSoundStart,pml_Unlocked); -16/wolf3d/WOLFSRC/ID_SD.C: PM_UnlockMainMem(); -16/wolf3d/WOLFSRC/ID_SD.C: PM_CheckMainMem(); -16/wolf3d/WOLFSRC/ID_SD.C: p = (word far *)MK_FP(PM_GetPage(ChunksInFile - 1),0); -16/wolf3d/WOLFSRC/ID_SD.C: PM_UnlockMainMem(); -16/wolf3d/WOLFSRC/OLDSCALE.C: shape = PM_GetSpritePage (shapenum); -16/wolf3d/WOLFSRC/OLDSCALE.C: shape = PM_GetSpritePage (shapenum); -16/wolf3d/WOLFSRC/WL_ACT2.C: PM_UnlockMainMem (); -16/wolf3d/WOLFSRC/WL_ACT2.C: PM_CheckMainMem (); -16/wolf3d/WOLFSRC/WL_DEBUG.C: addr = PM_GetPageAddress(i); -16/wolf3d/WOLFSRC/WL_DEBUG.C: PM_GetPage(j); -16/wolf3d/WOLFSRC/WL_DEBUG.C: PM_GetPage(i); -16/wolf3d/WOLFSRC/WL_DRAW.C: *( ((unsigned *)&postsource)+1) = (unsigned)PM_GetPage(wallpic); -16/wolf3d/WOLFSRC/WL_DRAW.C: *( ((unsigned *)&postsource)+1) = (unsigned)PM_GetPage(wallpic); -16/wolf3d/WOLFSRC/WL_DRAW.C: *( ((unsigned *)&postsource)+1) = (unsigned)PM_GetPage(doorpage); -16/wolf3d/WOLFSRC/WL_DRAW.C: *( ((unsigned *)&postsource)+1) = (unsigned)PM_GetPage(doorpage+1); -16/wolf3d/WOLFSRC/WL_DRAW.C: *( ((unsigned *)&postsource)+1) = (unsigned)PM_GetPage(wallpic); -16/wolf3d/WOLFSRC/WL_DRAW.C: *( ((unsigned *)&postsource)+1) = (unsigned)PM_GetPage(wallpic); -16/wolf3d/WOLFSRC/WL_DRAW.C: PM_NextFrame(); -16/wolf3d/WOLFSRC/WL_GAME.C: PM_UnlockMainMem(); -16/wolf3d/WOLFSRC/WL_GAME.C: PM_CheckMainMem (); -16/wolf3d/WOLFSRC/WL_GAME.C: PM_CheckMainMem (); -16/wolf3d/WOLFSRC/WL_GAME.C: PM_CheckMainMem (); -16/wolf3d/WOLFSRC/WL_GAME.C: PM_CheckMainMem (); -16/wolf3d/WOLFSRC/WL_INTER.C: PM_Preload (PreloadUpdate); -16/wolf3d/WOLFSRC/WL_MAIN.C: PM_Shutdown (); -16/wolf3d/WOLFSRC/WL_MAIN.C: PM_Startup (); -16/wolf3d/WOLFSRC/WL_MAIN.C: PM_UnlockMainMem (); -16/wolf3d/WOLFSRC/WL_MENU.C: PM_CheckMainMem (); -16/wolf3d/WOLFSRC/WL_MENU.C: PM_CheckMainMem (); -16/wolf3d/WOLFSRC/WL_PLAY.C: PM_CheckMainMem (); -16/wolf3d/WOLFSRC/WL_PLAY.C: PM_CheckMainMem (); -16/wolf3d/WOLFSRC/WL_PLAY.C: PM_CheckMainMem (); -16/wolf3d/WOLFSRC/WL_PLAY.C: PM_CheckMainMem (); -16/wolf3d/WOLFSRC/WL_PLAY.C: PM_CheckMainMem (); -16/wolf3d/WOLFSRC/WL_SCALE.C: shape = PM_GetSpritePage (shapenum); -16/wolf3d/WOLFSRC/WL_SCALE.C: shape = PM_GetSpritePage (shapenum); -Binary file 16/wolf3d/WOLFSRC/WOLF3D.EXE matches -16/wolf3d/WOLFSRC/WOLF3D.MAP: 19127H 1A286H 01160H ID_PM_TEXT CODE -16/wolf3d/WOLFSRC/WOLF3D.MAP: 1912:0007 1160 C=CODE S=ID_PM_TEXT G=(none) M=ID_PM.C ACBP=28 -16/wolf3d/WOLFSRC/WOLF3D.MAP: 1912:02DF _PM_CheckMainMem -16/wolf3d/WOLFSRC/WOLF3D.MAP: 1912:0C71 _PM_GetPage -16/wolf3d/WOLFSRC/WOLF3D.MAP: 1912:07BF _PM_GetPageAddress -16/wolf3d/WOLFSRC/WOLF3D.MAP: 1912:0FBA _PM_NextFrame -16/wolf3d/WOLFSRC/WOLF3D.MAP: 1912:0D60 _PM_Preload -16/wolf3d/WOLFSRC/WOLF3D.MAP: 1912:1034 idle _PM_Reset -16/wolf3d/WOLFSRC/WOLF3D.MAP: 1912:02B8 _PM_SetMainMemPurge -16/wolf3d/WOLFSRC/WOLF3D.MAP: 1912:0D31 _PM_SetPageLock -16/wolf3d/WOLFSRC/WOLF3D.MAP: 1912:114B _PM_Shutdown -16/wolf3d/WOLFSRC/WOLF3D.MAP: 1912:10A0 _PM_Startup -16/wolf3d/WOLFSRC/WOLF3D.MAP: 1912:02B8 _PM_SetMainMemPurge -16/wolf3d/WOLFSRC/WOLF3D.MAP: 1912:02DF _PM_CheckMainMem -16/wolf3d/WOLFSRC/WOLF3D.MAP: 1912:07BF _PM_GetPageAddress -16/wolf3d/WOLFSRC/WOLF3D.MAP: 1912:0C71 _PM_GetPage -16/wolf3d/WOLFSRC/WOLF3D.MAP: 1912:0D31 _PM_SetPageLock -16/wolf3d/WOLFSRC/WOLF3D.MAP: 1912:0D60 _PM_Preload -16/wolf3d/WOLFSRC/WOLF3D.MAP: 1912:0FBA _PM_NextFrame -16/wolf3d/WOLFSRC/WOLF3D.MAP: 1912:1034 idle _PM_Reset -16/wolf3d/WOLFSRC/WOLF3D.MAP: 1912:10A0 _PM_Startup -16/wolf3d/WOLFSRC/WOLF3D.MAP: 1912:114B _PM_Shutdown -16/wolf3d/WOLFSRC/WOLFHACK.C: src = PM_GetPage(0); -16/wolf3d/WOLFSRC/WOLFHACK.C: src = PM_GetPage(1); -16/wf3d8086/id_pm.c:// PML_MapEMS() - Maps a logical page to a physical page -16/wf3d8086/id_pm.c:PML_MapEMS(word logical,word physical) -16/wf3d8086/id_pm.c: Quit("PML_MapEMS: Page mapping failed"); -16/wf3d8086/id_pm.c:// PML_StartupEMS() - Sets up EMS for Page Mgr's use -16/wf3d8086/id_pm.c:PML_StartupEMS(void) -16/wf3d8086/id_pm.c:// PML_ShutdownEMS() - If EMS was used, deallocate it -16/wf3d8086/id_pm.c:PML_ShutdownEMS(void) -16/wf3d8086/id_pm.c: Quit ("PML_ShutdownEMS: Error freeing EMS"); -16/wf3d8086/id_pm.c:// PML_StartupXMS() - Starts up XMS for the Page Mgr's use -16/wf3d8086/id_pm.c:PML_StartupXMS(void) -16/wf3d8086/id_pm.c:// PML_XMSCopy() - Copies a main/EMS page to or from XMS -16/wf3d8086/id_pm.c:PML_XMSCopy(boolean toxms,byte far *addr,word xmspage,word length) -16/wf3d8086/id_pm.c: Quit("PML_XMSCopy: zero address"); -16/wf3d8086/id_pm.c: Quit("PML_XMSCopy: Error on copy"); -16/wf3d8086/id_pm.c:#define PML_CopyToXMS(s,t,l) PML_XMSCopy(true,(s),(t),(l)) -16/wf3d8086/id_pm.c:#define PML_CopyFromXMS(t,s,l) PML_XMSCopy(false,(t),(s),(l)) -16/wf3d8086/id_pm.c:// PML_CopyToXMS() - Copies the specified number of bytes from the real mode -16/wf3d8086/id_pm.c:PML_CopyToXMS(byte far *source,int targetpage,word length) -16/wf3d8086/id_pm.c: PML_XMSCopy(true,source,targetpage,length); -16/wf3d8086/id_pm.c:// PML_CopyFromXMS() - Copies the specified number of bytes from an XMS -16/wf3d8086/id_pm.c:PML_CopyFromXMS(byte far *target,int sourcepage,word length) -16/wf3d8086/id_pm.c: PML_XMSCopy(false,target,sourcepage,length); -16/wf3d8086/id_pm.c:// PML_ShutdownXMS() -16/wf3d8086/id_pm.c:PML_ShutdownXMS(void) -16/wf3d8086/id_pm.c: Quit("PML_ShutdownXMS: Error freeing XMS"); -16/wf3d8086/id_pm.c:// PML_StartupMainMem() - Allocates as much main memory as is possible for -16/wf3d8086/id_pm.c:PML_StartupMainMem(void) -16/wf3d8086/id_pm.c:// PML_ShutdownMainMem() - Frees all of the main memory blocks used by the -16/wf3d8086/id_pm.c:PML_ShutdownMainMem(void) -16/wf3d8086/id_pm.c:// PML_ReadFromFile() - Reads some data in from the page file -16/wf3d8086/id_pm.c:PML_ReadFromFile(byte far *buf,long offset,word length) -16/wf3d8086/id_pm.c: Quit("PML_ReadFromFile: Null pointer"); -16/wf3d8086/id_pm.c: Quit("PML_ReadFromFile: Zero offset"); -16/wf3d8086/id_pm.c: Quit("PML_ReadFromFile: Seek failed"); -16/wf3d8086/id_pm.c: Quit("PML_ReadFromFile: Read failed"); -16/wf3d8086/id_pm.c:// PML_OpenPageFile() - Opens the page file and sets up the page info -16/wf3d8086/id_pm.c:PML_OpenPageFile(void) -16/wf3d8086/id_pm.c: Quit("PML_OpenPageFile: Unable to open page file"); -16/wf3d8086/id_pm.c: Quit("PML_OpenPageFile: Offset read failed"); -16/wf3d8086/id_pm.c: Quit("PML_OpenPageFile: Length read failed"); -16/wf3d8086/id_pm.c:// PML_ClosePageFile() - Closes the page file -16/wf3d8086/id_pm.c:PML_ClosePageFile(void) -16/wf3d8086/id_pm.c:// PML_GetEMSAddress() -16/wf3d8086/id_pm.c:PML_GetEMSAddress(int page,PMLockType lock) -16/wf3d8086/id_pm.c: PML_MapEMS(page / PMEMSSubPage,emspage); -16/wf3d8086/id_pm.c: Quit("PML_GetEMSAddress: EMS find failed"); -16/wf3d8086/id_pm.c:PML_GetEMSAddress(int page,PMLockType lock) -16/wf3d8086/id_pm.c: PML_MapEMS(page / PMEMSSubPage,emspage); -16/wf3d8086/id_pm.c: return(PML_GetEMSAddress(page->emsPage,page->locked)); -16/wf3d8086/id_pm.c:// PML_GiveLRUPage() - Returns the page # of the least recently used -16/wf3d8086/id_pm.c:PML_GiveLRUPage(boolean mainonly) -16/wf3d8086/id_pm.c: Quit("PML_GiveLRUPage: LRU Search failed"); -16/wf3d8086/id_pm.c:// PML_GiveLRUXMSPage() - Returns the page # of the least recently used -16/wf3d8086/id_pm.c:PML_GiveLRUXMSPage(void) -16/wf3d8086/id_pm.c:// PML_PutPageInXMS() - If page isn't in XMS, find LRU XMS page and replace -16/wf3d8086/id_pm.c:PML_PutPageInXMS(int pagenum) -16/wf3d8086/id_pm.c: usexms = PML_GiveLRUXMSPage(); -16/wf3d8086/id_pm.c: Quit("PML_PutPageInXMS: No XMS LRU"); -16/wf3d8086/id_pm.c: PML_CopyToXMS(PM_GetPageAddress(pagenum),page->xmsPage,page->length); -16/wf3d8086/id_pm.c:// PML_TransferPageSpace() - A page is being replaced, so give the new page -16/wf3d8086/id_pm.c:PML_TransferPageSpace(int orig,int new) -16/wf3d8086/id_pm.c: Quit("PML_TransferPageSpace: Identity replacement"); -16/wf3d8086/id_pm.c: Quit("PML_TransferPageSpace: Killing locked page"); -16/wf3d8086/id_pm.c: Quit("PML_TransferPageSpace: Reusing non-existent page"); -16/wf3d8086/id_pm.c: PML_PutPageInXMS(orig); -16/wf3d8086/id_pm.c: Quit("PML_TransferPageSpace: Zero replacement"); -16/wf3d8086/id_pm.c:// PML_GetAPageBuffer() - A page buffer is needed. Either get it from the -16/wf3d8086/id_pm.c:// main/EMS free pool, or use PML_GiveLRUPage() to find which page to -16/wf3d8086/id_pm.c:// will be looked at by PML_GiveLRUPage(). -16/wf3d8086/id_pm.c:PML_GetAPageBuffer(int pagenum,boolean mainonly) -16/wf3d8086/id_pm.c: addr = PML_GetEMSAddress(page->emsPage,page->locked); -16/wf3d8086/id_pm.c: Quit("PML_GetPageBuffer: MainPagesAvail lied"); -16/wf3d8086/id_pm.c: Quit("PML_GetPageBuffer: Purged main block"); -16/wf3d8086/id_pm.c: addr = PML_TransferPageSpace(PML_GiveLRUPage(mainonly),pagenum); -16/wf3d8086/id_pm.c: Quit("PML_GetPageBuffer: Search failed"); -16/wf3d8086/id_pm.c:// PML_GetPageFromXMS() - If page is in XMS, find LRU main/EMS page and -16/wf3d8086/id_pm.c:PML_GetPageFromXMS(int pagenum,boolean mainonly) -16/wf3d8086/id_pm.c: checkaddr = PML_GetAPageBuffer(pagenum,mainonly); -16/wf3d8086/id_pm.c: Quit("PML_GetPageFromXMS: Non segment pointer"); -16/wf3d8086/id_pm.c: PML_CopyFromXMS(addr,page->xmsPage,page->length); -16/wf3d8086/id_pm.c:// PML_LoadPage() - A page is not in main/EMS memory, and it's not in XMS. -16/wf3d8086/id_pm.c:PML_LoadPage(int pagenum,boolean mainonly) -16/wf3d8086/id_pm.c: addr = PML_GetAPageBuffer(pagenum,mainonly); -16/wf3d8086/id_pm.c: PML_ReadFromFile(addr,page->offset,page->length); -16/wf3d8086/id_pm.c: if (!(result = PML_GetPageFromXMS(pagenum,mainonly))) -16/wf3d8086/id_pm.c: PML_LoadPage(pagenum,mainonly); -16/wf3d8086/id_pm.c: PML_ReadFromFile((byte far *)addr,p->offset,p->length); -16/wf3d8086/id_pm.c: PML_CopyToXMS((byte far *)addr,p->xmsPage,p->length); -16/wf3d8086/id_pm.c: PML_ReadFromFile((byte far *)addr,p->offset,p->length); -16/wf3d8086/id_pm.c: PML_OpenPageFile(); -16/wf3d8086/id_pm.c: PML_StartupEMS(); -16/wf3d8086/id_pm.c: PML_StartupXMS(); -16/wf3d8086/id_pm.c: PML_StartupMainMem(); -16/wf3d8086/id_pm.c: PML_ShutdownXMS(); -16/wf3d8086/id_pm.c: PML_ShutdownEMS(); -16/wf3d8086/id_pm.c: PML_ClosePageFile(); -16/wf3d8086/id_pm.c: PML_ShutdownMainMem(); -Binary file 16/wf3d8086/obj/wolf3d.exe matches -16/wf3d8086/obj/wolf3d.map: 1A26:06F7 idle _PML_ClosePageFile -16/wf3d8086/obj/wolf3d.map: 1A26:0AFB idle _PML_GetAPageBuffer -16/wf3d8086/obj/wolf3d.map: 1A26:0731 idle _PML_GetEMSAddress -16/wf3d8086/obj/wolf3d.map: 1A26:0C08 idle _PML_GetPageFromXMS -16/wf3d8086/obj/wolf3d.map: 1A26:0866 idle _PML_GiveLRUPage -16/wf3d8086/obj/wolf3d.map: 1A26:0907 idle _PML_GiveLRUXMSPage -16/wf3d8086/obj/wolf3d.map: 1A26:0C8C idle _PML_LoadPage -16/wf3d8086/obj/wolf3d.map: 1A26:0008 idle _PML_MapEMS -16/wf3d8086/obj/wolf3d.map: 1A26:0510 idle _PML_OpenPageFile -16/wf3d8086/obj/wolf3d.map: 1A26:0979 idle _PML_PutPageInXMS -16/wf3d8086/obj/wolf3d.map: 1A26:0490 idle _PML_ReadFromFile -16/wf3d8086/obj/wolf3d.map: 1A26:0160 idle _PML_ShutdownEMS -16/wf3d8086/obj/wolf3d.map: 1A26:0469 idle _PML_ShutdownMainMem -16/wf3d8086/obj/wolf3d.map: 1A26:02A4 idle _PML_ShutdownXMS -16/wf3d8086/obj/wolf3d.map: 1A26:002B idle _PML_StartupEMS -16/wf3d8086/obj/wolf3d.map: 1A26:03EC idle _PML_StartupMainMem -16/wf3d8086/obj/wolf3d.map: 1A26:0184 idle _PML_StartupXMS -16/wf3d8086/obj/wolf3d.map: 1A26:0A28 idle _PML_TransferPageSpace -16/wf3d8086/obj/wolf3d.map: 1A26:01F7 idle _PML_XMSCopy -16/wf3d8086/obj/wolf3d.map: 1A26:0008 idle _PML_MapEMS -16/wf3d8086/obj/wolf3d.map: 1A26:002B idle _PML_StartupEMS -16/wf3d8086/obj/wolf3d.map: 1A26:0160 idle _PML_ShutdownEMS -16/wf3d8086/obj/wolf3d.map: 1A26:0184 idle _PML_StartupXMS -16/wf3d8086/obj/wolf3d.map: 1A26:01F7 idle _PML_XMSCopy -16/wf3d8086/obj/wolf3d.map: 1A26:02A4 idle _PML_ShutdownXMS -16/wf3d8086/obj/wolf3d.map: 1A26:03EC idle _PML_StartupMainMem -16/wf3d8086/obj/wolf3d.map: 1A26:0469 idle _PML_ShutdownMainMem -16/wf3d8086/obj/wolf3d.map: 1A26:0490 idle _PML_ReadFromFile -16/wf3d8086/obj/wolf3d.map: 1A26:0510 idle _PML_OpenPageFile -16/wf3d8086/obj/wolf3d.map: 1A26:06F7 idle _PML_ClosePageFile -16/wf3d8086/obj/wolf3d.map: 1A26:0731 idle _PML_GetEMSAddress -16/wf3d8086/obj/wolf3d.map: 1A26:0866 idle _PML_GiveLRUPage -16/wf3d8086/obj/wolf3d.map: 1A26:0907 idle _PML_GiveLRUXMSPage -16/wf3d8086/obj/wolf3d.map: 1A26:0979 idle _PML_PutPageInXMS -16/wf3d8086/obj/wolf3d.map: 1A26:0A28 idle _PML_TransferPageSpace -16/wf3d8086/obj/wolf3d.map: 1A26:0AFB idle _PML_GetAPageBuffer -16/wf3d8086/obj/wolf3d.map: 1A26:0C08 idle _PML_GetPageFromXMS -16/wf3d8086/obj/wolf3d.map: 1A26:0C8C idle _PML_LoadPage -16/wf3d8086/wolf3d.map: 1912:06B1 idle _PML_ClosePageFile -16/wf3d8086/wolf3d.map: 1912:0A96 idle _PML_GetAPageBuffer -16/wf3d8086/wolf3d.map: 1912:06E8 idle _PML_GetEMSAddress -16/wf3d8086/wolf3d.map: 1912:0BA0 idle _PML_GetPageFromXMS -16/wf3d8086/wolf3d.map: 1912:0812 idle _PML_GiveLRUPage -16/wf3d8086/wolf3d.map: 1912:08B0 idle _PML_GiveLRUXMSPage -16/wf3d8086/wolf3d.map: 1912:0C21 idle _PML_LoadPage -16/wf3d8086/wolf3d.map: 1912:0007 idle _PML_MapEMS -16/wf3d8086/wolf3d.map: 1912:04E8 idle _PML_OpenPageFile -16/wf3d8086/wolf3d.map: 1912:0920 idle _PML_PutPageInXMS -16/wf3d8086/wolf3d.map: 1912:046E idle _PML_ReadFromFile -16/wf3d8086/wolf3d.map: 1912:0155 idle _PML_ShutdownEMS -16/wf3d8086/wolf3d.map: 1912:0447 idle _PML_ShutdownMainMem -16/wf3d8086/wolf3d.map: 1912:0293 idle _PML_ShutdownXMS -16/wf3d8086/wolf3d.map: 1912:0029 idle _PML_StartupEMS -16/wf3d8086/wolf3d.map: 1912:03D0 idle _PML_StartupMainMem -16/wf3d8086/wolf3d.map: 1912:0178 idle _PML_StartupXMS -16/wf3d8086/wolf3d.map: 1912:09C9 idle _PML_TransferPageSpace -16/wf3d8086/wolf3d.map: 1912:01EA idle _PML_XMSCopy -16/wf3d8086/wolf3d.map: 1912:0007 idle _PML_MapEMS -16/wf3d8086/wolf3d.map: 1912:0029 idle _PML_StartupEMS -16/wf3d8086/wolf3d.map: 1912:0155 idle _PML_ShutdownEMS -16/wf3d8086/wolf3d.map: 1912:0178 idle _PML_StartupXMS -16/wf3d8086/wolf3d.map: 1912:01EA idle _PML_XMSCopy -16/wf3d8086/wolf3d.map: 1912:0293 idle _PML_ShutdownXMS -16/wf3d8086/wolf3d.map: 1912:03D0 idle _PML_StartupMainMem -16/wf3d8086/wolf3d.map: 1912:0447 idle _PML_ShutdownMainMem -16/wf3d8086/wolf3d.map: 1912:046E idle _PML_ReadFromFile -16/wf3d8086/wolf3d.map: 1912:04E8 idle _PML_OpenPageFile -16/wf3d8086/wolf3d.map: 1912:06B1 idle _PML_ClosePageFile -16/wf3d8086/wolf3d.map: 1912:06E8 idle _PML_GetEMSAddress -16/wf3d8086/wolf3d.map: 1912:0812 idle _PML_GiveLRUPage -16/wf3d8086/wolf3d.map: 1912:08B0 idle _PML_GiveLRUXMSPage -16/wf3d8086/wolf3d.map: 1912:0920 idle _PML_PutPageInXMS -16/wf3d8086/wolf3d.map: 1912:09C9 idle _PML_TransferPageSpace -16/wf3d8086/wolf3d.map: 1912:0A96 idle _PML_GetAPageBuffer -16/wf3d8086/wolf3d.map: 1912:0BA0 idle _PML_GetPageFromXMS -16/wf3d8086/wolf3d.map: 1912:0C21 idle _PML_LoadPage -16/wolf3d/WOLFSRC/ID_PM.C:// PML_MapEMS() - Maps a logical page to a physical page -16/wolf3d/WOLFSRC/ID_PM.C:PML_MapEMS(word logical,word physical) -16/wolf3d/WOLFSRC/ID_PM.C: Quit("PML_MapEMS: Page mapping failed"); -16/wolf3d/WOLFSRC/ID_PM.C:// PML_StartupEMS() - Sets up EMS for Page Mgr's use -16/wolf3d/WOLFSRC/ID_PM.C:PML_StartupEMS(void) -16/wolf3d/WOLFSRC/ID_PM.C:// PML_ShutdownEMS() - If EMS was used, deallocate it -16/wolf3d/WOLFSRC/ID_PM.C:PML_ShutdownEMS(void) -16/wolf3d/WOLFSRC/ID_PM.C: Quit ("PML_ShutdownEMS: Error freeing EMS"); -16/wolf3d/WOLFSRC/ID_PM.C:// PML_StartupXMS() - Starts up XMS for the Page Mgr's use -16/wolf3d/WOLFSRC/ID_PM.C:PML_StartupXMS(void) -16/wolf3d/WOLFSRC/ID_PM.C:// PML_XMSCopy() - Copies a main/EMS page to or from XMS -16/wolf3d/WOLFSRC/ID_PM.C:PML_XMSCopy(boolean toxms,byte far *addr,word xmspage,word length) -16/wolf3d/WOLFSRC/ID_PM.C: Quit("PML_XMSCopy: zero address"); -16/wolf3d/WOLFSRC/ID_PM.C: Quit("PML_XMSCopy: Error on copy"); -16/wolf3d/WOLFSRC/ID_PM.C:#define PML_CopyToXMS(s,t,l) PML_XMSCopy(true,(s),(t),(l)) -16/wolf3d/WOLFSRC/ID_PM.C:#define PML_CopyFromXMS(t,s,l) PML_XMSCopy(false,(t),(s),(l)) -16/wolf3d/WOLFSRC/ID_PM.C:// PML_CopyToXMS() - Copies the specified number of bytes from the real mode -16/wolf3d/WOLFSRC/ID_PM.C:PML_CopyToXMS(byte far *source,int targetpage,word length) -16/wolf3d/WOLFSRC/ID_PM.C: PML_XMSCopy(true,source,targetpage,length); -16/wolf3d/WOLFSRC/ID_PM.C:// PML_CopyFromXMS() - Copies the specified number of bytes from an XMS -16/wolf3d/WOLFSRC/ID_PM.C:PML_CopyFromXMS(byte far *target,int sourcepage,word length) -16/wolf3d/WOLFSRC/ID_PM.C: PML_XMSCopy(false,target,sourcepage,length); -16/wolf3d/WOLFSRC/ID_PM.C:// PML_ShutdownXMS() -16/wolf3d/WOLFSRC/ID_PM.C:PML_ShutdownXMS(void) -16/wolf3d/WOLFSRC/ID_PM.C: Quit("PML_ShutdownXMS: Error freeing XMS"); -16/wolf3d/WOLFSRC/ID_PM.C:// PML_StartupMainMem() - Allocates as much main memory as is possible for -16/wolf3d/WOLFSRC/ID_PM.C:PML_StartupMainMem(void) -16/wolf3d/WOLFSRC/ID_PM.C:// PML_ShutdownMainMem() - Frees all of the main memory blocks used by the -16/wolf3d/WOLFSRC/ID_PM.C:PML_ShutdownMainMem(void) -16/wolf3d/WOLFSRC/ID_PM.C:// PML_ReadFromFile() - Reads some data in from the page file -16/wolf3d/WOLFSRC/ID_PM.C:PML_ReadFromFile(byte far *buf,long offset,word length) -16/wolf3d/WOLFSRC/ID_PM.C: Quit("PML_ReadFromFile: Null pointer"); -16/wolf3d/WOLFSRC/ID_PM.C: Quit("PML_ReadFromFile: Zero offset"); -16/wolf3d/WOLFSRC/ID_PM.C: Quit("PML_ReadFromFile: Seek failed"); -16/wolf3d/WOLFSRC/ID_PM.C: Quit("PML_ReadFromFile: Read failed"); -16/wolf3d/WOLFSRC/ID_PM.C:// PML_OpenPageFile() - Opens the page file and sets up the page info -16/wolf3d/WOLFSRC/ID_PM.C:PML_OpenPageFile(void) -16/wolf3d/WOLFSRC/ID_PM.C: Quit("PML_OpenPageFile: Unable to open page file"); -16/wolf3d/WOLFSRC/ID_PM.C: Quit("PML_OpenPageFile: Offset read failed"); -16/wolf3d/WOLFSRC/ID_PM.C: Quit("PML_OpenPageFile: Length read failed"); -16/wolf3d/WOLFSRC/ID_PM.C:// PML_ClosePageFile() - Closes the page file -16/wolf3d/WOLFSRC/ID_PM.C:PML_ClosePageFile(void) -16/wolf3d/WOLFSRC/ID_PM.C:// PML_GetEMSAddress() -16/wolf3d/WOLFSRC/ID_PM.C:PML_GetEMSAddress(int page,PMLockType lock) -16/wolf3d/WOLFSRC/ID_PM.C: PML_MapEMS(page / PMEMSSubPage,emspage); -16/wolf3d/WOLFSRC/ID_PM.C: Quit("PML_GetEMSAddress: EMS find failed"); -16/wolf3d/WOLFSRC/ID_PM.C:PML_GetEMSAddress(int page,PMLockType lock) -16/wolf3d/WOLFSRC/ID_PM.C: PML_MapEMS(page / PMEMSSubPage,emspage); -16/wolf3d/WOLFSRC/ID_PM.C: return(PML_GetEMSAddress(page->emsPage,page->locked)); -16/wolf3d/WOLFSRC/ID_PM.C:// PML_GiveLRUPage() - Returns the page # of the least recently used -16/wolf3d/WOLFSRC/ID_PM.C:PML_GiveLRUPage(boolean mainonly) -16/wolf3d/WOLFSRC/ID_PM.C: Quit("PML_GiveLRUPage: LRU Search failed"); -16/wolf3d/WOLFSRC/ID_PM.C:// PML_GiveLRUXMSPage() - Returns the page # of the least recently used -16/wolf3d/WOLFSRC/ID_PM.C:PML_GiveLRUXMSPage(void) -16/wolf3d/WOLFSRC/ID_PM.C:// PML_PutPageInXMS() - If page isn't in XMS, find LRU XMS page and replace -16/wolf3d/WOLFSRC/ID_PM.C:PML_PutPageInXMS(int pagenum) -16/wolf3d/WOLFSRC/ID_PM.C: usexms = PML_GiveLRUXMSPage(); -16/wolf3d/WOLFSRC/ID_PM.C: Quit("PML_PutPageInXMS: No XMS LRU"); -16/wolf3d/WOLFSRC/ID_PM.C: PML_CopyToXMS(PM_GetPageAddress(pagenum),page->xmsPage,page->length); -16/wolf3d/WOLFSRC/ID_PM.C:// PML_TransferPageSpace() - A page is being replaced, so give the new page -16/wolf3d/WOLFSRC/ID_PM.C:PML_TransferPageSpace(int orig,int new) -16/wolf3d/WOLFSRC/ID_PM.C: Quit("PML_TransferPageSpace: Identity replacement"); -16/wolf3d/WOLFSRC/ID_PM.C: Quit("PML_TransferPageSpace: Killing locked page"); -16/wolf3d/WOLFSRC/ID_PM.C: Quit("PML_TransferPageSpace: Reusing non-existent page"); -16/wolf3d/WOLFSRC/ID_PM.C: PML_PutPageInXMS(orig); -16/wolf3d/WOLFSRC/ID_PM.C: Quit("PML_TransferPageSpace: Zero replacement"); -16/wolf3d/WOLFSRC/ID_PM.C:// PML_GetAPageBuffer() - A page buffer is needed. Either get it from the -16/wolf3d/WOLFSRC/ID_PM.C:// main/EMS free pool, or use PML_GiveLRUPage() to find which page to -16/wolf3d/WOLFSRC/ID_PM.C:// will be looked at by PML_GiveLRUPage(). -16/wolf3d/WOLFSRC/ID_PM.C:PML_GetAPageBuffer(int pagenum,boolean mainonly) -16/wolf3d/WOLFSRC/ID_PM.C: addr = PML_GetEMSAddress(page->emsPage,page->locked); -16/wolf3d/WOLFSRC/ID_PM.C: Quit("PML_GetPageBuffer: MainPagesAvail lied"); -16/wolf3d/WOLFSRC/ID_PM.C: Quit("PML_GetPageBuffer: Purged main block"); -16/wolf3d/WOLFSRC/ID_PM.C: addr = PML_TransferPageSpace(PML_GiveLRUPage(mainonly),pagenum); -16/wolf3d/WOLFSRC/ID_PM.C: Quit("PML_GetPageBuffer: Search failed"); -16/wolf3d/WOLFSRC/ID_PM.C:// PML_GetPageFromXMS() - If page is in XMS, find LRU main/EMS page and -16/wolf3d/WOLFSRC/ID_PM.C:PML_GetPageFromXMS(int pagenum,boolean mainonly) -16/wolf3d/WOLFSRC/ID_PM.C: checkaddr = PML_GetAPageBuffer(pagenum,mainonly); -16/wolf3d/WOLFSRC/ID_PM.C: Quit("PML_GetPageFromXMS: Non segment pointer"); -16/wolf3d/WOLFSRC/ID_PM.C: PML_CopyFromXMS(addr,page->xmsPage,page->length); -16/wolf3d/WOLFSRC/ID_PM.C:// PML_LoadPage() - A page is not in main/EMS memory, and it's not in XMS. -16/wolf3d/WOLFSRC/ID_PM.C:PML_LoadPage(int pagenum,boolean mainonly) -16/wolf3d/WOLFSRC/ID_PM.C: addr = PML_GetAPageBuffer(pagenum,mainonly); -16/wolf3d/WOLFSRC/ID_PM.C: PML_ReadFromFile(addr,page->offset,page->length); -16/wolf3d/WOLFSRC/ID_PM.C: if (!(result = PML_GetPageFromXMS(pagenum,mainonly))) -16/wolf3d/WOLFSRC/ID_PM.C: PML_LoadPage(pagenum,mainonly); -16/wolf3d/WOLFSRC/ID_PM.C: PML_ReadFromFile((byte far *)addr,p->offset,p->length); -16/wolf3d/WOLFSRC/ID_PM.C: PML_CopyToXMS((byte far *)addr,p->xmsPage,p->length); -16/wolf3d/WOLFSRC/ID_PM.C: PML_ReadFromFile((byte far *)addr,p->offset,p->length); -16/wolf3d/WOLFSRC/ID_PM.C: PML_OpenPageFile(); -16/wolf3d/WOLFSRC/ID_PM.C: PML_StartupEMS(); -16/wolf3d/WOLFSRC/ID_PM.C: PML_StartupXMS(); -16/wolf3d/WOLFSRC/ID_PM.C: PML_StartupMainMem(); -16/wolf3d/WOLFSRC/ID_PM.C: PML_ShutdownXMS(); -16/wolf3d/WOLFSRC/ID_PM.C: PML_ShutdownEMS(); -16/wolf3d/WOLFSRC/ID_PM.C: PML_ClosePageFile(); -16/wolf3d/WOLFSRC/ID_PM.C: PML_ShutdownMainMem(); -Binary file 16/wolf3d/WOLFSRC/WOLF3D.EXE matches -16/wolf3d/WOLFSRC/WOLF3D.MAP: 1912:06B1 idle _PML_ClosePageFile -16/wolf3d/WOLFSRC/WOLF3D.MAP: 1912:0A96 idle _PML_GetAPageBuffer -16/wolf3d/WOLFSRC/WOLF3D.MAP: 1912:06E8 idle _PML_GetEMSAddress -16/wolf3d/WOLFSRC/WOLF3D.MAP: 1912:0BA0 idle _PML_GetPageFromXMS -16/wolf3d/WOLFSRC/WOLF3D.MAP: 1912:0812 idle _PML_GiveLRUPage -16/wolf3d/WOLFSRC/WOLF3D.MAP: 1912:08B0 idle _PML_GiveLRUXMSPage -16/wolf3d/WOLFSRC/WOLF3D.MAP: 1912:0C21 idle _PML_LoadPage -16/wolf3d/WOLFSRC/WOLF3D.MAP: 1912:0007 idle _PML_MapEMS -16/wolf3d/WOLFSRC/WOLF3D.MAP: 1912:04E8 idle _PML_OpenPageFile -16/wolf3d/WOLFSRC/WOLF3D.MAP: 1912:0920 idle _PML_PutPageInXMS -16/wolf3d/WOLFSRC/WOLF3D.MAP: 1912:046E idle _PML_ReadFromFile -16/wolf3d/WOLFSRC/WOLF3D.MAP: 1912:0155 idle _PML_ShutdownEMS -16/wolf3d/WOLFSRC/WOLF3D.MAP: 1912:0447 idle _PML_ShutdownMainMem -16/wolf3d/WOLFSRC/WOLF3D.MAP: 1912:0293 idle _PML_ShutdownXMS -16/wolf3d/WOLFSRC/WOLF3D.MAP: 1912:0029 idle _PML_StartupEMS -16/wolf3d/WOLFSRC/WOLF3D.MAP: 1912:03D0 idle _PML_StartupMainMem -16/wolf3d/WOLFSRC/WOLF3D.MAP: 1912:0178 idle _PML_StartupXMS -16/wolf3d/WOLFSRC/WOLF3D.MAP: 1912:09C9 idle _PML_TransferPageSpace -16/wolf3d/WOLFSRC/WOLF3D.MAP: 1912:01EA idle _PML_XMSCopy -16/wolf3d/WOLFSRC/WOLF3D.MAP: 1912:0007 idle _PML_MapEMS -16/wolf3d/WOLFSRC/WOLF3D.MAP: 1912:0029 idle _PML_StartupEMS -16/wolf3d/WOLFSRC/WOLF3D.MAP: 1912:0155 idle _PML_ShutdownEMS -16/wolf3d/WOLFSRC/WOLF3D.MAP: 1912:0178 idle _PML_StartupXMS -16/wolf3d/WOLFSRC/WOLF3D.MAP: 1912:01EA idle _PML_XMSCopy -16/wolf3d/WOLFSRC/WOLF3D.MAP: 1912:0293 idle _PML_ShutdownXMS -16/wolf3d/WOLFSRC/WOLF3D.MAP: 1912:03D0 idle _PML_StartupMainMem -16/wolf3d/WOLFSRC/WOLF3D.MAP: 1912:0447 idle _PML_ShutdownMainMem -16/wolf3d/WOLFSRC/WOLF3D.MAP: 1912:046E idle _PML_ReadFromFile -16/wolf3d/WOLFSRC/WOLF3D.MAP: 1912:04E8 idle _PML_OpenPageFile -16/wolf3d/WOLFSRC/WOLF3D.MAP: 1912:06B1 idle _PML_ClosePageFile -16/wolf3d/WOLFSRC/WOLF3D.MAP: 1912:06E8 idle _PML_GetEMSAddress -16/wolf3d/WOLFSRC/WOLF3D.MAP: 1912:0812 idle _PML_GiveLRUPage -16/wolf3d/WOLFSRC/WOLF3D.MAP: 1912:08B0 idle _PML_GiveLRUXMSPage -16/wolf3d/WOLFSRC/WOLF3D.MAP: 1912:0920 idle _PML_PutPageInXMS -16/wolf3d/WOLFSRC/WOLF3D.MAP: 1912:09C9 idle _PML_TransferPageSpace -16/wolf3d/WOLFSRC/WOLF3D.MAP: 1912:0A96 idle _PML_GetAPageBuffer -16/wolf3d/WOLFSRC/WOLF3D.MAP: 1912:0BA0 idle _PML_GetPageFromXMS -16/wolf3d/WOLFSRC/WOLF3D.MAP: 1912:0C21 idle _PML_LoadPage +16/wolf3d/WOLFSRC/CONTIGSC.C: shape = PM_GetSpritePage (shapenum); +16/wolf3d/WOLFSRC/CONTIGSC.C: shape = PM_GetSpritePage (shapenum); +16/wolf3d/WOLFSRC/ID_PM.C:// PM_SetMainMemPurge() - Sets the purge level for all allocated main memory +16/wolf3d/WOLFSRC/ID_PM.C:// blocks. This shouldn't be called directly - the PM_LockMainMem() and +16/wolf3d/WOLFSRC/ID_PM.C:// PM_UnlockMainMem() macros should be used instead. +16/wolf3d/WOLFSRC/ID_PM.C:PM_SetMainMemPurge(int level) +16/wolf3d/WOLFSRC/ID_PM.C:// PM_CheckMainMem() - If something besides the Page Mgr makes requests of +16/wolf3d/WOLFSRC/ID_PM.C:// This routine now calls PM_LockMainMem() to make sure that any allocation +16/wolf3d/WOLFSRC/ID_PM.C:// of the other blocks. Because PM_LockMainMem() is called, +16/wolf3d/WOLFSRC/ID_PM.C:// PM_UnlockMainMem() needs to be called before any other part of the +16/wolf3d/WOLFSRC/ID_PM.C:PM_CheckMainMem(void) +16/wolf3d/WOLFSRC/ID_PM.C: PM_LockMainMem(); +16/wolf3d/WOLFSRC/ID_PM.C:// necessary to make requests of the Memory Mgr, PM_UnlockMainMem() +16/wolf3d/WOLFSRC/ID_PM.C: Quit("PM_SetupMainMem: Not enough main memory"); +16/wolf3d/WOLFSRC/ID_PM.C:// PM_GetPageAddress() - Returns the address of a given page +16/wolf3d/WOLFSRC/ID_PM.C:PM_GetPageAddress(int pagenum) +16/wolf3d/WOLFSRC/ID_PM.C: PML_CopyToXMS(PM_GetPageAddress(pagenum),page->xmsPage,page->length); +16/wolf3d/WOLFSRC/ID_PM.C: addr = PM_GetPageAddress(orig); +16/wolf3d/WOLFSRC/ID_PM.C:// PM_GetPage() - Returns the address of the page, loading it if necessary +16/wolf3d/WOLFSRC/ID_PM.C:PM_GetPage(int pagenum) +16/wolf3d/WOLFSRC/ID_PM.C: Quit("PM_GetPage: Invalid page request"); +16/wolf3d/WOLFSRC/ID_PM.C: if (!(result = PM_GetPageAddress(pagenum))) +16/wolf3d/WOLFSRC/ID_PM.C: result = PM_GetPageAddress(pagenum); +16/wolf3d/WOLFSRC/ID_PM.C:// PM_SetPageLock() - Sets the lock type on a given page +16/wolf3d/WOLFSRC/ID_PM.C:PM_SetPageLock(int pagenum,PMLockType lock) +16/wolf3d/WOLFSRC/ID_PM.C: Quit("PM_SetPageLock: Locking/unlocking non-sound page"); +16/wolf3d/WOLFSRC/ID_PM.C:// PM_Preload() - Loads as many pages as possible into all types of memory. +16/wolf3d/WOLFSRC/ID_PM.C:PM_Preload(boolean (*update)(word current,word total)) +16/wolf3d/WOLFSRC/ID_PM.C: Quit ("PM_Preload: Pages>=ChunksInFile"); +16/wolf3d/WOLFSRC/ID_PM.C: PM_GetPage(page); +16/wolf3d/WOLFSRC/ID_PM.C: addr = PM_GetPage(oogypage); +16/wolf3d/WOLFSRC/ID_PM.C: Quit("PM_Preload: XMS buffer failed"); +16/wolf3d/WOLFSRC/ID_PM.C: Quit ("PM_Preload: Pages>=ChunksInFile"); +16/wolf3d/WOLFSRC/ID_PM.C: Quit("PM_Preload: Exceeded XMS pages"); +16/wolf3d/WOLFSRC/ID_PM.C: Quit("PM_Preload: Page too long"); +16/wolf3d/WOLFSRC/ID_PM.C:// PM_NextFrame() - Increments the frame counter and adjusts the thrash +16/wolf3d/WOLFSRC/ID_PM.C:PM_NextFrame(void) +16/wolf3d/WOLFSRC/ID_PM.C: sprintf(buf,"PM_NextFrame: Page %d is locked",i); +16/wolf3d/WOLFSRC/ID_PM.C:// PM_Reset() - Sets up caching structures +16/wolf3d/WOLFSRC/ID_PM.C:PM_Reset(void) +16/wolf3d/WOLFSRC/ID_PM.C:// PM_Startup() - Start up the Page Mgr +16/wolf3d/WOLFSRC/ID_PM.C:PM_Startup(void) +16/wolf3d/WOLFSRC/ID_PM.C: Quit("PM_Startup: No main or EMS"); +16/wolf3d/WOLFSRC/ID_PM.C: PM_Reset(); +16/wolf3d/WOLFSRC/ID_PM.C:// PM_Shutdown() - Shut down the Page Mgr +16/wolf3d/WOLFSRC/ID_PM.C:PM_Shutdown(void) +16/wolf3d/WOLFSRC/ID_PM.H:#define PM_GetSoundPage(v) PM_GetPage(PMSoundStart + (v)) +16/wolf3d/WOLFSRC/ID_PM.H:#define PM_GetSpritePage(v) PM_GetPage(PMSpriteStart + (v)) +16/wolf3d/WOLFSRC/ID_PM.H:#define PM_LockMainMem() PM_SetMainMemPurge(0) +16/wolf3d/WOLFSRC/ID_PM.H:#define PM_UnlockMainMem() PM_SetMainMemPurge(3) +16/wolf3d/WOLFSRC/ID_PM.H:extern void PM_Startup(void), +16/wolf3d/WOLFSRC/ID_PM.H: PM_Shutdown(void), +16/wolf3d/WOLFSRC/ID_PM.H: PM_Reset(void), +16/wolf3d/WOLFSRC/ID_PM.H: PM_Preload(boolean (*update)(word current,word total)), +16/wolf3d/WOLFSRC/ID_PM.H: PM_NextFrame(void), +16/wolf3d/WOLFSRC/ID_PM.H: PM_SetPageLock(int pagenum,PMLockType lock), +16/wolf3d/WOLFSRC/ID_PM.H: PM_SetMainPurge(int level), +16/wolf3d/WOLFSRC/ID_PM.H: PM_CheckMainMem(void); +16/wolf3d/WOLFSRC/ID_PM.H:extern memptr PM_GetPageAddress(int pagenum), +16/wolf3d/WOLFSRC/ID_PM.H: PM_GetPage(int pagenum); // Use this one to cache page +16/wolf3d/WOLFSRC/ID_PM.H:void PM_SetMainMemPurge(int level); +16/wolf3d/WOLFSRC/ID_SD.C: addr = PM_GetSoundPage(page); +16/wolf3d/WOLFSRC/ID_SD.C: PM_SetPageLock(PMSoundStart + page,pml_Locked); +16/wolf3d/WOLFSRC/ID_SD.C: PM_SetPageLock(i + PMSoundStart,pml_Unlocked); +16/wolf3d/WOLFSRC/ID_SD.C: PM_UnlockMainMem(); +16/wolf3d/WOLFSRC/ID_SD.C: PM_CheckMainMem(); +16/wolf3d/WOLFSRC/ID_SD.C: p = (word far *)MK_FP(PM_GetPage(ChunksInFile - 1),0); +16/wolf3d/WOLFSRC/ID_SD.C: PM_UnlockMainMem(); +16/wolf3d/WOLFSRC/OLDSCALE.C: shape = PM_GetSpritePage (shapenum); +16/wolf3d/WOLFSRC/OLDSCALE.C: shape = PM_GetSpritePage (shapenum); +16/wolf3d/WOLFSRC/WL_ACT2.C: PM_UnlockMainMem (); +16/wolf3d/WOLFSRC/WL_ACT2.C: PM_CheckMainMem (); +16/wolf3d/WOLFSRC/WL_DEBUG.C: addr = PM_GetPageAddress(i); +16/wolf3d/WOLFSRC/WL_DEBUG.C: PM_GetPage(j); +16/wolf3d/WOLFSRC/WL_DEBUG.C: PM_GetPage(i); +16/wolf3d/WOLFSRC/WL_DRAW.C: *( ((unsigned *)&postsource)+1) = (unsigned)PM_GetPage(wallpic); +16/wolf3d/WOLFSRC/WL_DRAW.C: *( ((unsigned *)&postsource)+1) = (unsigned)PM_GetPage(wallpic); +16/wolf3d/WOLFSRC/WL_DRAW.C: *( ((unsigned *)&postsource)+1) = (unsigned)PM_GetPage(doorpage); +16/wolf3d/WOLFSRC/WL_DRAW.C: *( ((unsigned *)&postsource)+1) = (unsigned)PM_GetPage(doorpage+1); +16/wolf3d/WOLFSRC/WL_DRAW.C: *( ((unsigned *)&postsource)+1) = (unsigned)PM_GetPage(wallpic); +16/wolf3d/WOLFSRC/WL_DRAW.C: *( ((unsigned *)&postsource)+1) = (unsigned)PM_GetPage(wallpic); +16/wolf3d/WOLFSRC/WL_DRAW.C: PM_NextFrame(); +16/wolf3d/WOLFSRC/WL_GAME.C: PM_UnlockMainMem(); +16/wolf3d/WOLFSRC/WL_GAME.C: PM_CheckMainMem (); +16/wolf3d/WOLFSRC/WL_GAME.C: PM_CheckMainMem (); +16/wolf3d/WOLFSRC/WL_GAME.C: PM_CheckMainMem (); +16/wolf3d/WOLFSRC/WL_GAME.C: PM_CheckMainMem (); +16/wolf3d/WOLFSRC/WL_INTER.C: PM_Preload (PreloadUpdate); +16/wolf3d/WOLFSRC/WL_MAIN.C: PM_Shutdown (); +16/wolf3d/WOLFSRC/WL_MAIN.C: PM_Startup (); +16/wolf3d/WOLFSRC/WL_MAIN.C: PM_UnlockMainMem (); +16/wolf3d/WOLFSRC/WL_MENU.C: PM_CheckMainMem (); +16/wolf3d/WOLFSRC/WL_MENU.C: PM_CheckMainMem (); +16/wolf3d/WOLFSRC/WL_PLAY.C: PM_CheckMainMem (); +16/wolf3d/WOLFSRC/WL_PLAY.C: PM_CheckMainMem (); +16/wolf3d/WOLFSRC/WL_PLAY.C: PM_CheckMainMem (); +16/wolf3d/WOLFSRC/WL_PLAY.C: PM_CheckMainMem (); +16/wolf3d/WOLFSRC/WL_PLAY.C: PM_CheckMainMem (); +16/wolf3d/WOLFSRC/WL_SCALE.C: shape = PM_GetSpritePage (shapenum); +16/wolf3d/WOLFSRC/WL_SCALE.C: shape = PM_GetSpritePage (shapenum); +Binary file 16/wolf3d/WOLFSRC/WOLF3D.EXE matches +16/wolf3d/WOLFSRC/WOLF3D.MAP: 19127H 1A286H 01160H ID_PM_TEXT CODE +16/wolf3d/WOLFSRC/WOLF3D.MAP: 1912:0007 1160 C=CODE S=ID_PM_TEXT G=(none) M=ID_PM.C ACBP=28 +16/wolf3d/WOLFSRC/WOLF3D.MAP: 1912:02DF _PM_CheckMainMem +16/wolf3d/WOLFSRC/WOLF3D.MAP: 1912:0C71 _PM_GetPage +16/wolf3d/WOLFSRC/WOLF3D.MAP: 1912:07BF _PM_GetPageAddress +16/wolf3d/WOLFSRC/WOLF3D.MAP: 1912:0FBA _PM_NextFrame +16/wolf3d/WOLFSRC/WOLF3D.MAP: 1912:0D60 _PM_Preload +16/wolf3d/WOLFSRC/WOLF3D.MAP: 1912:1034 idle _PM_Reset +16/wolf3d/WOLFSRC/WOLF3D.MAP: 1912:02B8 _PM_SetMainMemPurge +16/wolf3d/WOLFSRC/WOLF3D.MAP: 1912:0D31 _PM_SetPageLock +16/wolf3d/WOLFSRC/WOLF3D.MAP: 1912:114B _PM_Shutdown +16/wolf3d/WOLFSRC/WOLF3D.MAP: 1912:10A0 _PM_Startup +16/wolf3d/WOLFSRC/WOLF3D.MAP: 1912:02B8 _PM_SetMainMemPurge +16/wolf3d/WOLFSRC/WOLF3D.MAP: 1912:02DF _PM_CheckMainMem +16/wolf3d/WOLFSRC/WOLF3D.MAP: 1912:07BF _PM_GetPageAddress +16/wolf3d/WOLFSRC/WOLF3D.MAP: 1912:0C71 _PM_GetPage +16/wolf3d/WOLFSRC/WOLF3D.MAP: 1912:0D31 _PM_SetPageLock +16/wolf3d/WOLFSRC/WOLF3D.MAP: 1912:0D60 _PM_Preload +16/wolf3d/WOLFSRC/WOLF3D.MAP: 1912:0FBA _PM_NextFrame +16/wolf3d/WOLFSRC/WOLF3D.MAP: 1912:1034 idle _PM_Reset +16/wolf3d/WOLFSRC/WOLF3D.MAP: 1912:10A0 _PM_Startup +16/wolf3d/WOLFSRC/WOLF3D.MAP: 1912:114B _PM_Shutdown +16/wolf3d/WOLFSRC/WOLFHACK.C: src = PM_GetPage(0); +16/wolf3d/WOLFSRC/WOLFHACK.C: src = PM_GetPage(1); diff --git a/src/exmmtest.c b/src/exmmtest.c index 02fafeb6..06835abf 100755 --- a/src/exmmtest.c +++ b/src/exmmtest.c @@ -133,7 +133,7 @@ for(w=0;w<2;w++) getch(); MM_ShowMemory(&gvar, &gvar.mm); MM_DumpData(&gvar.mm); - MM_Report(&gvar); + MM_Report_(&gvar); if(baka) printf("\nyay!\n"); else printf("\npoo!\n"); printf("press any key to continue!\n"); diff --git a/src/lib/16_head.c b/src/lib/16_head.c index 027693d5..69f69db2 100755 --- a/src/lib/16_head.c +++ b/src/lib/16_head.c @@ -95,6 +95,8 @@ US_CheckParm(char *parm,char **strings) return(-1); } +//=========================================================================== + /* ========================== = @@ -103,60 +105,58 @@ US_CheckParm(char *parm,char **strings) ========================== */ -/*void Quit(char *error, ...) +void Quit (char *error) { - short exit_code=0; - unsigned finscreen; - - va_list ap; - - va_start(ap,error); + unsigned finscreen; + memptr screen; + union REGS in, out; -#ifndef CATALOG - if (!error) + //ClearMemory (); + if (!*error) + { + //WriteConfig (); + } + else { - CA_SetAllPurge (); - CA_CacheGrChunk (PIRACY); - finscreen = (unsigned)grsegs[PIRACY]; + //CA_CacheGrChunk (ERRORSCREEN); + //screen = grsegs[ERRORSCREEN]; } -#endif //ShutdownId (); + //IN_Shutdown(); + //modexLeave(); + in.h.ah = 0x00; + in.h.al = 0x3; + int86(0x10, &in, &out); if (error && *error) { - vprintf(error,ap); - exit_code = 1; + movedata ((unsigned)screen,7,0xb800,0,7*160); + //gotoxy (10,4); + puts(error); + //gotoxy (1,8); + exit(1); } -#ifndef CATALOG else - if (!NoWait) + if (!error || !(*error)) { - movedata (finscreen,0,0xb800,0,4000); - bioskey (0); + //clrscr(); + //#ifndef JAPAN + 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 - va_end(ap); + exit(0); +} -#ifndef CATALOG - if (!error) - { - _argc = 2; - _argv[1] = "LAST.SHL"; - _argv[2] = "ENDSCN.SCN"; - _argv[3] = NULL; - if (execv("LOADSCN.EXE", _argv) == -1) - { - clrscr(); - puts("Couldn't find executable LOADSCN.EXE.\n"); - exit(1); - } - } -#endif +//=========================================================================== - exit(exit_code); -}*/ byte dirchar(byte in) { diff --git a/src/lib/16_head.h b/src/lib/16_head.h index 74822da2..e804410f 100755 --- a/src/lib/16_head.h +++ b/src/lib/16_head.h @@ -176,6 +176,7 @@ void wait(clock_t wait); long int filesize(FILE *fp); void printmeminfoline(byte *strc, const byte *pee, size_t h_total, size_t h_used, size_t h_free); int US_CheckParm(char *parm,char **strings); +void Quit (char *error); byte dirchar(byte in); #endif/*_LIBHEAD_H_*/ diff --git a/src/lib/16_mm.c b/src/lib/16_mm.c index add7707e..a8a5a467 100755 --- a/src/lib/16_mm.c +++ b/src/lib/16_mm.c @@ -284,7 +284,8 @@ void MML_ShutdownEMS(mminfo_t *mm) #ifdef __WATCOMC__ } #endif - if(errorflag==true) printf("MML_ShutdownEMS: Error freeing EMS!\n"); //++++ add something + if(errorflag==true) + Quit("MML_ShutdownEMS: Error freeing EMS!\n"); //++++ add something } /* @@ -1123,8 +1124,8 @@ void MM_SetPurge(memptr *baseptr, int purge, mminfo_t *mm) mm->mmrover = mm->mmhead; else if(mm->mmrover == start) { - printf("MM_SetPurge: Block not found!"); - return; + Quit("MM_SetPurge: Block not found!"); + //return; } } while(1); @@ -1163,8 +1164,8 @@ void MM_SetLock(memptr *baseptr, boolean locked, mminfo_t *mm) mm->mmrover = mm->mmhead; else if(mm->mmrover == start) { - printf("MM_SetLock: Block not found!"); - return; + Quit("MM_SetLock: Block not found!"); + //return; } } while(1); @@ -1596,7 +1597,7 @@ dword MM_TotalFree(mminfo_t *mm) ===================== */ -void MM_Report(global_game_variables_t *gvar) +void MM_Report_(global_game_variables_t *gvar) { printf("========================================\n"); printf(" MM_Report\n"); diff --git a/src/lib/16_mm.h b/src/lib/16_mm.h index 3b1eac3d..6d4e8ec0 100755 --- a/src/lib/16_mm.h +++ b/src/lib/16_mm.h @@ -196,7 +196,7 @@ void MM_ShowMemory(global_game_variables_t *gvar,/*page_t *page, */mminfo_t *mm) void MM_DumpData(mminfo_t *mm); dword MM_UnusedMemory(mminfo_t *mm); dword MM_TotalFree(mminfo_t *mm); -void MM_Report(global_game_variables_t *gvar); +void MM_Report_(global_game_variables_t *gvar); static void MM_EMSerr(byte *stri, byte err); void MM_BombOnError(boolean bomb, mminfo_t *mm); //void MM_GetNewBlock(mminfo_t *mm); diff --git a/src/lib/16_pm.c b/src/lib/16_pm.c index bc9ba74c..7d112a9e 100755 --- a/src/lib/16_pm.c +++ b/src/lib/16_pm.c @@ -6,7 +6,7 @@ #include "src/lib/16_pm.h" #pragma hdrstop - +/* // Main Mem specific variables boolean MainPresent; memptr MainMemPages[PMMaxMainMem]; @@ -22,7 +22,7 @@ // XMS specific variables boolean XMSPresent; word XMSAvail,XMSPagesAvail,XMSHandle; - longword XMSDriver; + dword XMSDriver; int XMSProtectPage = -1; // File specific variables @@ -42,7 +42,7 @@ long PMFrameCount; PageListStruct far *PMPages, _seg *PMSegPages; - +*/ static char *ParmStrings[] = {"nomain","noems","noxms",nil}; ///////////////////////////////////////////////////////////////////////////// @@ -56,19 +56,22 @@ static char *ParmStrings[] = {"nomain","noems","noxms",nil}; // void PML_MapEMS(word logical,word physical) -{ +{ union REGS CPURegs; CPURegs.h.al = physical; CPURegs.x.bx = logical; CPURegs.x.dx = EMSHandle; CPURegs.h.ah = EMS_MAPPAGE; - __asm - { - int EMS_INT + __asm + { + int EMS_INT } if(CPURegs.h.ah) - printf("PML_MapEMS: Page mapping failed\n"); + { + Quit("PML_MapEMS: Page mapping failed\n"); + return; + } } // @@ -85,62 +88,63 @@ PML_MapEMS(word logical,word physical) boolean PML_StartupEMS(void) { + union REGS CPURegs; int i; long size; EMSPresent = false; // Assume that we'll fail EMSAvail = 0; - _DX = (word)EMMDriverName; - _AX = 0x3d00; + CPURegs.x.dx = (word)EMMDriverName; + CPURegs.x.ax = 0x3d00; geninterrupt(0x21); // try to open EMMXXXX0 device asm jnc gothandle goto error; gothandle: - _BX = _AX; - _AX = 0x4400; + CPURegs.x.bx = CPURegs.x.ax; + CPURegs.x.ax = 0x4400; geninterrupt(0x21); // get device info asm jnc gotinfo; goto error; gotinfo: asm and dx,0x80 - if (!_DX) + if (!CPURegs.x.dx) goto error; - _AX = 0x4407; + CPURegs.x.ax = 0x4407; geninterrupt(0x21); // get status asm jc error - if (!_AL) + if (!CPURegs.l.al) goto error; - _AH = 0x3e; + CPURegs.h.ah = 0x3e; geninterrupt(0x21); // close handle - _AH = EMS_STATUS; + CPURegs.h.ah = EMS_STATUS; geninterrupt(EMS_INT); - if (_AH) + if (CPURegs.h.ah) goto error; // make sure EMS hardware is present - _AH = EMS_VERSION; + CPURegs.h.ah = EMS_VERSION; geninterrupt(EMS_INT); - if (_AH || (_AL < 0x32)) // only work on EMS 3.2 or greater (silly, but...) + if (CPURegs.h.ah || (CPURegs.l.al < 0x32)) // only work on EMS 3.2 or greater (silly, but...) goto error; - _AH = EMS_GETFRAME; + CPURegs.h.ah = EMS_GETFRAME; geninterrupt(EMS_INT); - if (_AH) + if (CPURegs.h.ah) goto error; // find the page frame address - EMSPageFrame = _BX; + EMSPageFrame = CPURegs.x.bx; - _AH = EMS_GETPAGES; + CPURegs.h.ah = EMS_GETPAGES; geninterrupt(EMS_INT); - if (_AH) + if (CPURegs.h.ah) goto error; - if (_BX < 2) + if (CPURegs.x.bx < 2) goto error; // Require at least 2 pages (32k) - EMSAvail = _BX; + EMSAvail = CPURegs.x.bx; // Don't hog all available EMS size = EMSAvail * (long)EMSPageSize; @@ -150,12 +154,12 @@ asm jc error EMSAvail = size / EMSPageSize; } - _AH = EMS_ALLOCPAGES; - _BX = EMSAvail; + CPURegs.h.ah = EMSCPURegs.l.alLOCPAGES; + CPURegs.x.bx = EMSAvail; geninterrupt(EMS_INT); - if (_AH) + if (CPURegs.h.ah) goto error; - EMSHandle = _DX; + EMSHandle = CPURegs.x.dx; mminfo.EMSmem += EMSAvail * (long)EMSPageSize; @@ -177,11 +181,16 @@ PML_ShutdownEMS(void) { if (EMSPresent) { - asm mov ah,EMS_FREEPAGES - asm mov dx,[EMSHandle] - asm int EMS_INT - if (_AH) - printf("PML_ShutdownEMS: Error freeing EMS\n"); + __asm { + mov ah,EMS_FREEPAGES + mov dx,[EMSHandle] + int EMS_INT + } + if (CPURegs.h.ah) + { + Quit("PML_ShutdownEMS: Error freeing EMS\n"); + //return; + } } } @@ -205,7 +214,7 @@ PML_StartupXMS(void) asm mov ax,0x4300 asm int XMS_INT // Check for presence of XMS driver - if (_AL != 0x80) + if (CPURegs.l.al != 0x80) goto error; @@ -215,19 +224,19 @@ asm mov [WORD PTR XMSDriver],bx asm mov [WORD PTR XMSDriver+2],es // function pointer to XMS driver XMS_CALL(XMS_QUERYFREE); // Find out how much XMS is available - XMSAvail = _AX; - if (!_AX) // AJR: bugfix 10/8/92 + XMSAvail = CPURegs.x.ax; + if (!CPURegs.x.ax) // AJR: bugfix 10/8/92 goto error; XMSAvail &= ~(PMPageSizeKB - 1); // Round off to nearest page size if (XMSAvail < (PMPageSizeKB * 2)) // Need at least 2 pages goto error; - _DX = XMSAvail; - XMS_CALL(XMS_ALLOC); // And do the allocation - XMSHandle = _DX; + CPURegs.x.dx = XMSAvail; + XMS_CALL(XMSCPURegs.l.alLOC); // And do the allocation + XMSHandle = CPURegs.x.dx; - if (!_AX) // AJR: bugfix 10/8/92 + if (!CPURegs.x.ax) // AJR: bugfix 10/8/92 { XMSAvail = 0; goto error; @@ -250,17 +259,20 @@ PML_XMSCopy(boolean toxms,byte far *addr,word xmspage,word length) dword xoffset; struct { - longword length; + dword length; word source_handle; - longword source_offset; + dword source_offset; word target_handle; - longword target_offset; + dword target_offset; } copy; if (!addr) - printf("PML_XMSCopy: zero address\n"); + { + Quit("PML_XMSCopy: zero address\n"); + //return; + } - xoffset = (longword)xmspage * PMPageSize; + xoffset = (dword)xmspage * PMPageSize; copy.length = (length + 1) & ~1; copy.source_handle = toxms? 0 : XMSHandle; @@ -269,11 +281,14 @@ PML_XMSCopy(boolean toxms,byte far *addr,word xmspage,word length) copy.target_offset = toxms? xoffset : (long)addr; asm push si - _SI = (word)© + CPURegs.i.si = (word)© XMS_CALL(XMS_MOVE); asm pop si - if (!_AX) + if (!CPURegs.x.ax) + { Quit("PML_XMSCopy: Error on copy"); + //return; + } } #if 1 @@ -309,10 +324,13 @@ PML_ShutdownXMS(void) { if (XMSPresent) { - _DX = XMSHandle; + CPURegs.x.dx = XMSHandle; XMS_CALL(XMS_FREE); - if (_BL) + if (CPURegs.l.bl) + { Quit("PML_ShutdownXMS: Error freeing XMS"); + //return; + } } } @@ -440,7 +458,10 @@ PML_StartupMainMem(void) if (mmerror) mmerror = false; if (MainPagesAvail < PMMinMainMem) + { Quit("PM_SetupMainMem: Not enough main memory"); + //return; + } MainPresent = true; } @@ -473,13 +494,24 @@ void PML_ReadFromFile(byte far *buf,long offset,word length) { if (!buf) + { Quit("PML_ReadFromFile: Null pointer"); + //return; + } if (!offset) + { Quit("PML_ReadFromFile: Zero offset"); + //return; + } if (lseek(PageFile,offset,SEEK_SET) != offset) + { Quit("PML_ReadFromFile: Seek failed"); + //return; + } if (!CA_FarRead(PageFile,buf,length)) Quit("PML_ReadFromFile: Read failed"); + //return; + } } // @@ -490,14 +522,17 @@ PML_OpenPageFile(void) { int i; long size; - void _seg *buf; - longword far *offsetptr; + __SEGA *buf; + dword far *offsetptr; word far *lengthptr; PageListStruct far *page; PageFile = open(PageFileName,O_RDONLY + O_BINARY); if (PageFile == -1) + { Quit("PML_OpenPageFile: Unable to open page file"); + //return; + } // Read in header variables read(PageFile,&ChunksInFile,sizeof(ChunksInFile)); @@ -512,11 +547,14 @@ PML_OpenPageFile(void) _fmemset(PMPages,0,sizeof(PageListStruct) * PMNumBlocks); // Read in the chunk offsets - size = sizeof(longword) * ChunksInFile; + size = sizeof(dword) * ChunksInFile; MM_GetPtr(&buf,size); if (!CA_FarRead(PageFile,(byte far *)buf,size)) + { Quit("PML_OpenPageFile: Offset read failed"); - offsetptr = (longword far *)buf; + //return; + } + offsetptr = (dword far *)buf; for (i = 0,page = PMPages;i < ChunksInFile;i++,page++) page->offset = *offsetptr++; MM_FreePtr(&buf); @@ -525,7 +563,10 @@ PML_OpenPageFile(void) size = sizeof(word) * ChunksInFile; MM_GetPtr(&buf,size); if (!CA_FarRead(PageFile,(byte far *)buf,size)) + { Quit("PML_OpenPageFile: Length read failed"); + //return; + } lengthptr = (word far *)buf; for (i = 0,page = PMPages;i < ChunksInFile;i++,page++) page->length = *lengthptr++; @@ -543,7 +584,7 @@ PML_ClosePageFile(void) if (PMSegPages) { MM_SetLock(&(memptr)PMSegPages,false); - MM_FreePtr(&(void _seg *)PMSegPages); + MM_FreePtr(&(__SEGA *)PMSegPages); } } @@ -560,7 +601,7 @@ PML_ClosePageFile(void) // to map our page in. If normal page, use EMS physical page 3, else // use the physical page specified by the lock type // -#if 1 +#ifdef __DEBUG__ #pragma argsused // DEBUG - remove lock parameter memptr PML_GetEMSAddress(int page,PMLockType lock) @@ -585,7 +626,7 @@ PML_GetEMSAddress(int page,PMLockType lock) // If page isn't already mapped in, find LRU EMS frame, and use it if (emspage == -1) { - longword last = MAXLONG; + dword last = MAXLONG; for (i = 0;i < EMSFrameCount;i++) { if (EMSList[i].lastHit < last) @@ -1175,10 +1216,10 @@ PM_Startup(void) if (!noxms) PML_StartupXMS(); - if (nomain && !EMSPresent) + if (nomain && !EMSPresent) { - printf("PM_Startup: No main or EMS\n"); - return; + Quit("PM_Startup: No main or EMS\n"); + //return; } else PML_StartupMainMem(); diff --git a/src/lib/16_pm.h b/src/lib/16_pm.h index 54f1600b..f8b62c40 100755 --- a/src/lib/16_pm.h +++ b/src/lib/16_pm.h @@ -7,7 +7,7 @@ #include "src/lib/16_hc.h" #include "src/lib/16_mm.h" -// NOTE! PMPageSize must be an even divisor of EMSPageSize, and >= 1024 +/*// NOTE! PMPageSize must be an even divisor of EMSPageSize, and >= 1024 #define EMSPageSize 16384 #define EMSPageSizeSeg (EMSPageSize >> 4) #define EMSPageSizeKB (EMSPageSize >> 10) @@ -38,7 +38,7 @@ typedef enum typedef struct { - longword offset; // Offset of chunk into file + dword offset; // Offset of chunk into file word length; // Length of the chunk int xmsPage; // If in XMS, (xmsPage * PMPageSize) gives offset into XMS handle @@ -47,13 +47,13 @@ typedef struct int emsPage; // If in EMS, logical page/offset into page int mainPage; // If in Main, index into handle array - longword lastHit; // Last frame number of hit + dword lastHit; // Last frame number of hit } PageListStruct; typedef struct { int baseEMSPage; // Base EMS page for this phys frame - longword lastHit; // Last frame number of hit + dword lastHit; // Last frame number of hit } EMSListStruct; extern boolean XMSPresent,EMSPresent; @@ -61,7 +61,7 @@ extern word XMSPagesAvail,EMSPagesAvail; extern word ChunksInFile, PMSpriteStart,PMSoundStart; -extern PageListStruct far *PMPages; +extern PageListStruct far *PMPages;*///moved to src/lib/typdefst.h #define PM_GetSoundPage(v) PM_GetPage(PMSoundStart + (v)) #define PM_GetSpritePage(v) PM_GetPage(PMSpriteStart + (v)) diff --git a/src/lib/typdefst.h b/src/lib/typdefst.h index fdf96a27..137b00b6 100755 --- a/src/lib/typdefst.h +++ b/src/lib/typdefst.h @@ -135,6 +135,12 @@ typedef struct //0000word startclk; float clk, tickclk; //timer } video_t; +//from 16_mm +//========================================================================== + +#define MAXBLOCKS 1024 +#define MAXUMBS 12 + typedef struct mmblockstruct { word start,length; @@ -146,12 +152,6 @@ typedef struct mmblockstruct struct mmblockstruct far *next; } mmblocktype; -//from 16_mm -//========================================================================== - -#define MAXBLOCKS 1024 -#define MAXUMBS 12 - typedef struct { dword nearheap,farheap,EMSmem,XMSmem,mainmem; @@ -180,6 +180,116 @@ typedef struct //========================================================================== + +//from 16_pm +//========================================================================== + +// NOTE! PMPageSize must be an even divisor of EMSPageSize, and >= 1024 +#define EMSPageSize 16384 +#define EMSPageSizeSeg (EMSPageSize >> 4) +#define EMSPageSizeKB (EMSPageSize >> 10) +#define EMSFrameCount 4 +#define PMPageSize 4096 +#define PMPageSizeSeg (PMPageSize >> 4) +#define PMPageSizeKB (PMPageSize >> 10) +#define PMEMSSubPage (EMSPageSize / PMPageSize) + +#define PMMinMainMem 10 // Min acceptable # of pages from main +#define PMMaxMainMem 100 // Max number of pages in main memory + +#define PMThrashThreshold 1 // Number of page thrashes before panic mode +#define PMUnThrashThreshold 5 // Number of non-thrashing frames before leaving panic mode + +typedef enum + { + pml_Unlocked, + pml_Locked + } PMLockType; + +typedef enum + { + pmba_Unused = 0, + pmba_Used = 1, + pmba_Allocated = 2 + } PMBlockAttr; + +typedef struct + { + dword offset; // Offset of chunk into file + word length; // Length of the chunk + + int xmsPage; // If in XMS, (xmsPage * PMPageSize) gives offset into XMS handle + + PMLockType locked; // If set, this page can't be purged + int emsPage; // If in EMS, logical page/offset into page + int mainPage; // If in Main, index into handle array + + dword lastHit; // Last frame number of hit + } PageListStruct; + +typedef struct + { + int baseEMSPage; // Base EMS page for this phys frame + dword lastHit; // Last frame number of hit + } EMSListStruct; + +// Main Mem specific variables +typedef struct +{ + boolean MainPresent; + memptr MainMemPages[PMMaxMainMem]; + PMBlockAttr MainMemUsed[PMMaxMainMem]; + int MainPagesAvail; +} pm_mmi_t; + +// EMS specific variables +typedef struct +{ + boolean EMSPresent; + word EMSAvail,EMSPagesAvail,EMSHandle, + EMSPageFrame,EMSPhysicalPage; + EMSListStruct EMSList[EMSFrameCount]; +} pm_emmi_t; + +// XMS specific variables +typedef struct +{ + boolean XMSPresent; + word XMSAvail,XMSPagesAvail,XMSHandle; + dword XMSDriver; + int XMSProtectPage;// = -1; +} pm_xmmi_t; + +// File specific variables +typedef struct +{ + char PageFileName[13];// = {"VSWAP."}; + int PageFile;// = -1; + word ChunksInFile; + word PMSpriteStart,PMSoundStart; +} pm_fi_t; + +// General usage variables +typedef struct +{ + boolean PMStarted, + PMPanicMode, + PMThrashing; + word XMSPagesUsed, + EMSPagesUsed, + MainPagesUsed, + PMNumBlocks; + long PMFrameCount; + PageListStruct far *PMPages; + __SEGA *PMSegPages; + pm_mmi_t mm; + pm_emmi_t emm; + pm_xmmi_t xmm; + pm_fi_t fi; +} pm_t; + +//========================================================================== + //from 16_ca //========================================================================== @@ -221,6 +331,7 @@ typedef struct { video_t video; // video settings variable ca_t ca; // ca stuff + pm_t pm; // pm stuff byte *pee; // message for fps loghandle_t handle; //handles for file logging kurokku_t kurokku; //clock struct