From: sparky4 Date: Tue, 27 Sep 2016 17:05:10 +0000 (-0500) Subject: ====PM WORKS! XMS PORTING IS NEXT! BCEXMM is broke==== X-Git-Url: http://4ch.mooo.com/gitweb/?a=commitdiff_plain;h=fb309399331ebb5cf52a892b37d847d60985a7e7;p=16.git ====PM WORKS! XMS PORTING IS NEXT! BCEXMM is broke==== --- diff --git a/DEBUG.16W b/DEBUG.16W index 0ef4489d..a55c6fa8 100755 --- a/DEBUG.16W +++ b/DEBUG.16W @@ -1,210 +1,210 @@ -Seg:0 Size:9817 Owner:0x0 +Seg:0 Size:9834 Owner:0x0 +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++0 -Seg:2659 Size:256 Owner:0x18a8 -++++ -Seg:27d5 Size:53 Owner:0x0 +Seg:266a Size:256 Owner:0x18a8 ++++++ +Seg:27e7 Size:53 Owner:0x0 ++ -Seg:280a Size:256 Owner:0x1696 -++++ -Seg:290a Size:256 Owner:0x1698 +Seg:281c Size:256 Owner:0x1696 ++++ -Seg:2a0a Size:256 Owner:0x169a +Seg:291c Size:256 Owner:0x1698 ++++ -Seg:2b0a Size:256 Owner:0x169c +Seg:2a1c Size:256 Owner:0x169a ++++ -Seg:2c0a Size:256 Owner:0x169e +Seg:2b1c Size:256 Owner:0x169c +++++ -Seg:2d0a Size:256 Owner:0x16a0 +Seg:2c1c Size:256 Owner:0x169e ++++ -Seg:2e0a Size:256 Owner:0x16a2 +Seg:2d1c Size:256 Owner:0x16a0 ++++ -Seg:2f0a Size:256 Owner:0x16a4 +Seg:2e1c Size:256 Owner:0x16a2 ++++ -Seg:300a Size:256 Owner:0x16a6 +Seg:2f1c Size:256 Owner:0x16a4 ++++ -Seg:310a Size:256 Owner:0x16a8 +Seg:301c Size:256 Owner:0x16a6 +++++ -Seg:320a Size:256 Owner:0x16aa +Seg:311c Size:256 Owner:0x16a8 ++++ -Seg:330a Size:256 Owner:0x16ac +Seg:321c Size:256 Owner:0x16aa ++++ -Seg:340a Size:256 Owner:0x16ae +Seg:331c Size:256 Owner:0x16ac ++++ -Seg:350a Size:256 Owner:0x16b0 +Seg:341c Size:256 Owner:0x16ae ++++ -Seg:360a Size:256 Owner:0x16b2 +Seg:351c Size:256 Owner:0x16b0 +++++ -Seg:370a Size:256 Owner:0x16b4 +Seg:361c Size:256 Owner:0x16b2 ++++ -Seg:380a Size:256 Owner:0x16b6 +Seg:371c Size:256 Owner:0x16b4 ++++ -Seg:390a Size:256 Owner:0x16b8 +Seg:381c Size:256 Owner:0x16b6 ++++ -Seg:3a0a Size:256 Owner:0x16ba +Seg:391c Size:256 Owner:0x16b8 ++++ -Seg:3b0a Size:256 Owner:0x16bc +Seg:3a1c Size:256 Owner:0x16ba +++++ -Seg:3c0a Size:256 Owner:0x16be +Seg:3b1c Size:256 Owner:0x16bc ++++ -Seg:3d0a Size:256 Owner:0x16c0 +Seg:3c1c Size:256 Owner:0x16be ++++ -Seg:3e0a Size:256 Owner:0x16c2 +Seg:3d1c Size:256 Owner:0x16c0 ++++ -Seg:3f0a Size:256 Owner:0x16c4 +Seg:3e1c Size:256 Owner:0x16c2 ++++ -Seg:400a Size:256 Owner:0x16c6 +Seg:3f1c Size:256 Owner:0x16c4 +++++ -Seg:410a Size:256 Owner:0x16c8 +Seg:401c Size:256 Owner:0x16c6 ++++ -Seg:420a Size:256 Owner:0x16ca +Seg:411c Size:256 Owner:0x16c8 ++++ -Seg:430a Size:256 Owner:0x16cc +Seg:421c Size:256 Owner:0x16ca ++++ -Seg:440a Size:256 Owner:0x16ce +Seg:431c Size:256 Owner:0x16cc ++++ -Seg:450a Size:256 Owner:0x16d0 +Seg:441c Size:256 Owner:0x16ce +++++ -Seg:460a Size:256 Owner:0x16d2 +Seg:451c Size:256 Owner:0x16d0 ++++ -Seg:470a Size:256 Owner:0x16d4 +Seg:461c Size:256 Owner:0x16d2 ++++ -Seg:480a Size:256 Owner:0x16d6 +Seg:471c Size:256 Owner:0x16d4 ++++ -Seg:490a Size:256 Owner:0x16d8 +Seg:481c Size:256 Owner:0x16d6 ++++ -Seg:4a0a Size:256 Owner:0x16da +Seg:491c Size:256 Owner:0x16d8 +++++ -Seg:4b0a Size:256 Owner:0x16dc +Seg:4a1c Size:256 Owner:0x16da ++++ -Seg:4c0a Size:256 Owner:0x16de +Seg:4b1c Size:256 Owner:0x16dc ++++ -Seg:4d0a Size:256 Owner:0x16e0 +Seg:4c1c Size:256 Owner:0x16de ++++ -Seg:4e0a Size:256 Owner:0x16e2 +Seg:4d1c Size:256 Owner:0x16e0 ++++ -Seg:4f0a Size:256 Owner:0x16e4 +Seg:4e1c Size:256 Owner:0x16e2 +++++ -Seg:500a Size:256 Owner:0x16e6 +Seg:4f1c Size:256 Owner:0x16e4 ++++ -Seg:510a Size:256 Owner:0x16e8 +Seg:501c Size:256 Owner:0x16e6 ++++ -Seg:520a Size:256 Owner:0x16ea +Seg:511c Size:256 Owner:0x16e8 ++++ -Seg:530a Size:256 Owner:0x16ec +Seg:521c Size:256 Owner:0x16ea ++++ -Seg:540a Size:256 Owner:0x16ee +Seg:531c Size:256 Owner:0x16ec +++++ -Seg:550a Size:256 Owner:0x16f0 +Seg:541c Size:256 Owner:0x16ee ++++ -Seg:560a Size:256 Owner:0x16f2 +Seg:551c Size:256 Owner:0x16f0 ++++ -Seg:570a Size:256 Owner:0x16f4 +Seg:561c Size:256 Owner:0x16f2 ++++ -Seg:580a Size:256 Owner:0x16f6 +Seg:571c Size:256 Owner:0x16f4 ++++ -Seg:590a Size:256 Owner:0x16f8 +Seg:581c Size:256 Owner:0x16f6 +++++ -Seg:5a0a Size:256 Owner:0x16fa +Seg:591c Size:256 Owner:0x16f8 ++++ -Seg:5b0a Size:256 Owner:0x16fc +Seg:5a1c Size:256 Owner:0x16fa ++++ -Seg:5c0a Size:256 Owner:0x16fe +Seg:5b1c Size:256 Owner:0x16fc ++++ -Seg:5d0a Size:256 Owner:0x1700 +Seg:5c1c Size:256 Owner:0x16fe ++++ -Seg:5e0a Size:256 Owner:0x1702 +Seg:5d1c Size:256 Owner:0x1700 +++++ -Seg:5f0a Size:256 Owner:0x1704 +Seg:5e1c Size:256 Owner:0x1702 ++++ -Seg:600a Size:256 Owner:0x1706 +Seg:5f1c Size:256 Owner:0x1704 ++++ -Seg:610a Size:256 Owner:0x1708 +Seg:601c Size:256 Owner:0x1706 ++++ -Seg:620a Size:256 Owner:0x170a +Seg:611c Size:256 Owner:0x1708 ++++ -Seg:630a Size:256 Owner:0x170c +Seg:621c Size:256 Owner:0x170a +++++ -Seg:640a Size:256 Owner:0x170e +Seg:631c Size:256 Owner:0x170c ++++ -Seg:650a Size:256 Owner:0x1710 +Seg:641c Size:256 Owner:0x170e ++++ -Seg:660a Size:256 Owner:0x1712 +Seg:651c Size:256 Owner:0x1710 ++++ -Seg:670a Size:256 Owner:0x1714 +Seg:661c Size:256 Owner:0x1712 ++++ -Seg:680a Size:256 Owner:0x1716 +Seg:671c Size:256 Owner:0x1714 +++++ -Seg:690a Size:256 Owner:0x1718 +Seg:681c Size:256 Owner:0x1716 ++++ -Seg:6a0a Size:256 Owner:0x171a +Seg:691c Size:256 Owner:0x1718 ++++ -Seg:6b0a Size:256 Owner:0x171c +Seg:6a1c Size:256 Owner:0x171a ++++ -Seg:6c0a Size:256 Owner:0x171e +Seg:6b1c Size:256 Owner:0x171c ++++ -Seg:6d0a Size:256 Owner:0x1720 +Seg:6c1c Size:256 Owner:0x171e +++++ -Seg:6e0a Size:256 Owner:0x1722 +Seg:6d1c Size:256 Owner:0x1720 ++++ -Seg:6f0a Size:256 Owner:0x1724 +Seg:6e1c Size:256 Owner:0x1722 ++++ -Seg:700a Size:256 Owner:0x1726 +Seg:6f1c Size:256 Owner:0x1724 ++++ -Seg:710a Size:256 Owner:0x1728 +Seg:701c Size:256 Owner:0x1726 ++++ -Seg:720a Size:256 Owner:0x172a +Seg:711c Size:256 Owner:0x1728 +++++ -Seg:730a Size:256 Owner:0x172c +Seg:721c Size:256 Owner:0x172a ++++ -Seg:740a Size:256 Owner:0x172e +Seg:731c Size:256 Owner:0x172c ++++ -Seg:750a Size:256 Owner:0x1730 +Seg:741c Size:256 Owner:0x172e ++++ -Seg:760a Size:256 Owner:0x1732 +Seg:751c Size:256 Owner:0x1730 ++++ -Seg:770a Size:256 Owner:0x1734 +Seg:761c Size:256 Owner:0x1732 +++++ -Seg:780a Size:256 Owner:0x1736 +Seg:771c Size:256 Owner:0x1734 ++++ -Seg:790a Size:256 Owner:0x1738 +Seg:781c Size:256 Owner:0x1736 ++++ -Seg:7a0a Size:256 Owner:0x173a +Seg:791c Size:256 Owner:0x1738 ++++ -Seg:7b0a Size:256 Owner:0x173c +Seg:7a1c Size:256 Owner:0x173a ++++ -Seg:7c0a Size:256 Owner:0x173e +Seg:7b1c Size:256 Owner:0x173c +++++ -Seg:7d0a Size:256 Owner:0x1740 +Seg:7c1c Size:256 Owner:0x173e ++++ -Seg:7e0a Size:256 Owner:0x1742 +Seg:7d1c Size:256 Owner:0x1740 ++++ -Seg:7f0a Size:256 Owner:0x1744 +Seg:7e1c Size:256 Owner:0x1742 ++++ -Seg:800a Size:256 Owner:0x1746 +Seg:7f1c Size:256 Owner:0x1744 ++++ -Seg:810a Size:256 Owner:0x1748 +Seg:801c Size:256 Owner:0x1746 +++++ -Seg:820a Size:256 Owner:0x174a +Seg:811c Size:256 Owner:0x1748 ++++ -Seg:830a Size:256 Owner:0x174c +Seg:821c Size:256 Owner:0x174a ++++ -Seg:840a Size:256 Owner:0x174e +Seg:831c Size:256 Owner:0x174c ++++ -Seg:850a Size:256 Owner:0x1750 +Seg:841c Size:256 Owner:0x174e ++++ -Seg:860a Size:256 Owner:0x1752 +Seg:851c Size:256 Owner:0x1750 +++++ -Seg:870a Size:256 Owner:0x1754 +Seg:861c Size:256 Owner:0x1752 ++++ -Seg:880a Size:256 Owner:0x1756 +Seg:871c Size:256 Owner:0x1754 ++++ -Seg:890a Size:256 Owner:0x1758 +Seg:881c Size:256 Owner:0x1756 ++++ -Seg:8a0a Size:256 Owner:0x175a +Seg:891c Size:256 Owner:0x1758 ++++ -Seg:8b0a Size:256 Owner:0x175c +Seg:8a1c Size:256 Owner:0x175a +++++ -Seg:8c0a Size:273 Owner:0xe400 +Seg:8b1c Size:256 Owner:0x175c +++++ +Seg:8c1c Size:273 Owner:0xe3f0 ++++ -Seg:b80a Size:18421 Owner:0x0 -++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ \ No newline at end of file +Seg:b81c Size:18403 Owner:0x0 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ \ No newline at end of file diff --git a/HEAP.16W b/HEAP.16W index 0c3d344f..b3a19848 100755 --- a/HEAP.16W +++ b/HEAP.16W @@ -1,47 +1,47 @@ == default == - USED block at 27f70016 of size 66 - USED block at 27f70058 of size 66 - USED block at 27f7009a of size 136 - FREE block at 27f70122 of size 18 - USED block at 27f70134 of size 20 - FREE block at 27f70148 of size 7860 + USED block at 28090016 of size 66 + USED block at 28090058 of size 66 + USED block at 2809009a of size 136 + FREE block at 28090122 of size 18 + USED block at 28090134 of size 20 + FREE block at 28090148 of size 7860 OK - end of heap == near == - USED block at 17f6e436 of size 12 - USED block at 17f6e442 of size 332 - USED block at 17f6e58e of size 52 - USED block at 17f6e5c2 of size 20 - USED block at 17f6e5d6 of size 20 - USED block at 17f6e5ea of size 20 - USED block at 17f6e5fe of size 20 - USED block at 17f6e612 of size 20 - USED block at 17f6e626 of size 6614 + USED block at 1808e426 of size 12 + USED block at 1808e432 of size 332 + USED block at 1808e57e of size 52 + USED block at 1808e5b2 of size 20 + USED block at 1808e5c6 of size 20 + USED block at 1808e5da of size 20 + USED block at 1808e5ee of size 20 + USED block at 1808e602 of size 20 + USED block at 1808e616 of size 6630 OK - end of heap == far == - USED block at 27f70016 of size 66 - USED block at 27f70058 of size 66 - USED block at 27f7009a of size 136 - USED block at 27f70122 of size 18 - USED block at 27f70134 of size 20 - USED block at 27f70148 of size 7860 + USED block at 28090016 of size 66 + USED block at 28090058 of size 66 + USED block at 2809009a of size 136 + USED block at 28090122 of size 18 + USED block at 28090134 of size 20 + USED block at 28090148 of size 7860 OK - end of heap Memory Type Total Used Free ---------------- -------- -------- -------- Default 8166 288 7878 -Near 7110 496 6614 +Near 7126 496 6630 Far 8166 0 7878 ---------------- -------- -------- -------- -coreleft = 6612 -farcoreleft = 30720 +coreleft = 6628 +farcoreleft = 30736 GetFreeSize = 24128 -GetNearFreeSize = 6614 +GetNearFreeSize = 6630 GetFarFreeSize = 24128 -memavl = 6612 +memavl = 6628 stackavail = 31588 diff --git a/MMDUMP.16W b/MMDUMP.16W index cb01f5be..e231e3c7 100755 Binary files a/MMDUMP.16W and b/MMDUMP.16W differ diff --git a/bcexmm.dsk b/bcexmm.dsk index 5e23aeca..2bd2d3e6 100755 Binary files a/bcexmm.dsk and b/bcexmm.dsk differ diff --git a/bcexmm.exe b/bcexmm.exe index 9f778fa2..47d175b7 100755 Binary files a/bcexmm.exe and b/bcexmm.exe differ diff --git a/bcexmm.prj b/bcexmm.prj index 8e4e273d..2abea17e 100755 Binary files a/bcexmm.prj and b/bcexmm.prj differ diff --git a/src/exmmtest.c b/src/exmmtest.c index 3da6f44e..b57a6f05 100755 --- a/src/exmmtest.c +++ b/src/exmmtest.c @@ -62,12 +62,12 @@ void segatesuto() // getch(); } #endif -global_game_variables_t gvar; + void main(int argc, char *argv[]) { byte w=1; - //static global_game_variables_t gvar; + static global_game_variables_t gvar; #ifdef __WATCOMC__ __segment sega; #endif diff --git a/src/lib/16_pm.c b/src/lib/16_pm.c index 82f45dbd..848af9c8 100755 --- a/src/lib/16_pm.c +++ b/src/lib/16_pm.c @@ -34,19 +34,19 @@ boolean debugpm=0; #endif // Main Mem specific variables - boolean MainPresent; + //boolean MainPresent; /* memptr MainMemPages[PMMaxMainMem]; PMBlockAttr gvar->pm.mm.MainMemUsed[PMMaxMainMem]; int gvar->pm.mm.MainPagesAvail;*/ // EMS specific variables - boolean EMSPresent; + //boolean EMSPresent; /* word gvar->pm.emm.EMSAvail,gvar->pm.emm.EMSPagesAvail,gvar->pm.emm.EMSHandle, gvar->pm.emm.EMSPageFrame,gvar->pm.emm.EMSPhysicalPage; gvar->pm.emm.EMSListStruct gvar->pm.emm.EMSList[EMSFrameCount];*/ // XMS specific variables - boolean XMSPresent; + //boolean XMSPresent; //word gvar->pm.xmm.XMSAvail,gvar->pm.xmm.XMSPagesAvail,gvar->pm.xmm.XMSHandle; word XMSDriver; /* int gvar->pm.xmm.XMSProtectPage = -1; @@ -58,7 +58,7 @@ boolean debugpm=0; word PMSpriteStart,PMSoundStart;*/ // General usage variables - boolean PMStarted;/*, +/* boolean PMStarted, gvar->pm.PMPanicMode, gvar->pm.PMThrashing; word gvar->pm.XMSPagesUsed, @@ -148,7 +148,7 @@ PML_StartupEMS(global_game_variables_t *gvar) unsigned int EMSVer = 0; unsigned totalEMSpages,freeEMSpages,EMSPageFrame,EMSHandle,EMSAvail; totalEMSpages = freeEMSpages = EMSPageFrame = 0; - EMSPresent = false; // Assume that we'll fail + gvar->pm.emm.EMSPresent = false; // Assume that we'll fail gvar->pm.emm.EMSAvail = 0; __asm { @@ -277,10 +277,10 @@ End2: strcpy(str,"PML_StartupEMS: EMS error "); MM_EMSerr(str, err); printf("%s\n",str); - return(EMSPresent); + return(gvar->pm.emm.EMSPresent); } - EMSPresent = true; // We have EMS + gvar->pm.emm.EMSPresent = true; // We have EMS gvar->pm.emm.EMSPageFrame = EMSPageFrame; gvar->pm.emm.EMSAvail = EMSAvail; gvar->pm.emm.EMSVer = EMSVer; @@ -288,7 +288,7 @@ End2: gvar->pm.emm.freeEMSpages = freeEMSpages; gvar->pm.emm.totalEMSpages = totalEMSpages; - return(EMSPresent); + return(gvar->pm.emm.EMSPresent); } // @@ -304,7 +304,7 @@ PML_ShutdownEMS(global_game_variables_t *gvar) EMSHandle=gvar->pm.emm.EMSHandle; - if (EMSPresent) + if (gvar->pm.emm.EMSPresent) { __asm { mov ah,EMS_FREEPAGES @@ -355,7 +355,7 @@ PML_ShutdownEMS(global_game_variables_t *gvar) boolean PML_StartupXMS(global_game_variables_t *gvar) { - XMSPresent = false; // Assume failure + gvar->pm.xmm.XMSPresent = false; // Assume failure gvar->pm.xmm.XMSAvail = 0; _AX=0x4300; @@ -392,9 +392,9 @@ PML_StartupXMS(global_game_variables_t *gvar) gvar->mmi.XMSmem += gvar->pm.xmm.XMSAvail * 1024; - XMSPresent = true; + gvar->pm.xmm.XMSPresent = true; error: - return(XMSPresent); + return(gvar->pm.xmm.XMSPresent); } // @@ -474,7 +474,7 @@ PML_CopyFromXMS(byte far *target,int sourcepage,word length, global_game_variabl void PML_ShutdownXMS(global_game_variables_t *gvar) { - if (XMSPresent) + if (gvar->pm.xmm.XMSPresent) { _DX = gvar->pm.xmm.XMSHandle; XMS_CALL(XMS_FREE); @@ -502,7 +502,7 @@ PM_SetMainMemPurge(int level, global_game_variables_t *gvar) { int i; - if(MainPresent) + if(gvar->pm.mm.MainPresent) for (i = 0;i < PMMaxMainMem;i++) { #ifdef __DEBUG_PM__ @@ -541,7 +541,7 @@ PM_CheckMainMem(global_game_variables_t *gvar) PMBlockAttr *used; PageListStruct far *page; - if (!MainPresent) + if (!gvar->pm.mm.MainPresent) return; for (i = 0,page = gvar->pm.PMPages;i < gvar->pm.fi.ChunksInFile;i++,page++) @@ -608,7 +608,7 @@ PML_StartupMainMem(global_game_variables_t *gvar) memptr *p; gvar->pm.mm.MainPagesAvail = 0; - MainPresent = false; + gvar->pm.mm.MainPresent = false; MM_BombOnError(false, gvar); printf("PML_StartupMainMem()\n"); printf(" p=%04x MainMemPages=%04x\n", p, gvar->pm.mm.MainMemPages); @@ -630,7 +630,7 @@ PML_StartupMainMem(global_game_variables_t *gvar) Quit("PM_SetupMainMem: Not enough main memory"); //return; } - MainPresent = true; + gvar->pm.mm.MainPresent = true; } // @@ -922,7 +922,7 @@ PML_PutPageInXMS(int pagenum, global_game_variables_t *gvar) int usexms; PageListStruct far *page; - if (!XMSPresent) + if (!gvar->pm.xmm.XMSPresent) return; page = &gvar->pm.PMPages[pagenum]; @@ -1051,7 +1051,7 @@ PML_GetPageFromXMS(int pagenum,boolean mainonly, global_game_variables_t *gvar) PageListStruct far *page; page = &gvar->pm.PMPages[pagenum]; - if (XMSPresent && (page->xmsPage != -1)) + if (gvar->pm.xmm.XMSPresent && (page->xmsPage != -1)) { gvar->pm.xmm.XMSProtectPage = pagenum; checkaddr = PML_GetAPageBuffer(pagenum,mainonly, gvar); @@ -1365,7 +1365,7 @@ PM_Startup(global_game_variables_t *gvar) boolean nomain,noems,noxms; int i; - if (PMStarted) + if (gvar->pm.PMStarted) return; //strcpy(&(gvar->pm.fi.PageFileName), "VSWAP."); @@ -1408,7 +1408,7 @@ PM_Startup(global_game_variables_t *gvar) if (!noxms) //++++PML_StartupXMS(gvar); //TODO: convert - if (!nomain && !EMSPresent) + if (!nomain && !gvar->pm.emm.EMSPresent) { Quit("PM_Startup: No main or EMS\n"); //return; @@ -1417,7 +1417,7 @@ PM_Startup(global_game_variables_t *gvar) PM_Reset(gvar); - PMStarted = true; + gvar->pm.PMStarted = true; } // @@ -1429,7 +1429,7 @@ PM_Shutdown(global_game_variables_t *gvar) PML_ShutdownXMS(gvar); PML_ShutdownEMS(gvar); - if (!PMStarted) + if (!gvar->pm.PMStarted) return; PML_ClosePageFile(gvar);