From: sparky4 Date: Tue, 4 Oct 2016 15:01:36 +0000 (-0500) Subject: revertede back but fixup xms startup X-Git-Url: http://4ch.mooo.com/gitweb/?a=commitdiff_plain;h=2dcd5a983922df452bd7dc56044bfbd2ad07341b;p=16.git revertede back but fixup xms startup --- diff --git a/DEBUG.16W b/DEBUG.16W index 503c7fd2..72245a61 100755 --- a/DEBUG.16W +++ b/DEBUG.16W @@ -1,210 +1,212 @@ -Seg:0 Size:9874 Owner:0x0 -++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++0 -Seg:2692 Size:256 Owner:0x18a8 -++++ -Seg:280e Size:44 Owner:0x0 +Seg:0 Size:11735 Owner:0x0 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++000 +Seg:2e4c Size:36 Owner:0x0 + -Seg:283a Size:256 Owner:0x1696 +Seg:2e70 Size:256 Owner:0x1988 +++++ +Seg:2f70 Size:256 Owner:0x1776 +++++ +Seg:3070 Size:256 Owner:0x1778 +++++ +Seg:3170 Size:256 Owner:0x177a +++++ +Seg:3270 Size:256 Owner:0x177c +++++ +Seg:3370 Size:256 Owner:0x177e +++++ +Seg:3470 Size:256 Owner:0x1780 +++++ +Seg:3570 Size:256 Owner:0x1782 +++++ +Seg:3670 Size:256 Owner:0x1784 +++++ +Seg:3770 Size:256 Owner:0x1786 +++++ +Seg:3870 Size:256 Owner:0x1788 +++++ +Seg:3970 Size:256 Owner:0x178a +++++ +Seg:3a70 Size:256 Owner:0x178c +++++ +Seg:3b70 Size:256 Owner:0x178e +++++ +Seg:3c70 Size:256 Owner:0x1790 +++++ +Seg:3d70 Size:256 Owner:0x1792 +++++ +Seg:3e70 Size:256 Owner:0x1794 +++++ +Seg:3f70 Size:256 Owner:0x1796 +++++ +Seg:4070 Size:256 Owner:0x1798 +++++ +Seg:4170 Size:256 Owner:0x179a +++++ +Seg:4270 Size:256 Owner:0x179c +++++ +Seg:4370 Size:256 Owner:0x179e ++++ -Seg:293a Size:256 Owner:0x1698 -+++++ -Seg:2a3a Size:256 Owner:0x169a +Seg:4470 Size:256 Owner:0x17a0 ++++ -Seg:2b3a Size:256 Owner:0x169c +Seg:4570 Size:256 Owner:0x17a2 ++++ -Seg:2c3a Size:256 Owner:0x169e +Seg:4670 Size:256 Owner:0x17a4 ++++ -Seg:2d3a Size:256 Owner:0x16a0 +Seg:4770 Size:256 Owner:0x17a6 ++++ -Seg:2e3a Size:256 Owner:0x16a2 -+++++ -Seg:2f3a Size:256 Owner:0x16a4 +Seg:4870 Size:256 Owner:0x17a8 ++++ -Seg:303a Size:256 Owner:0x16a6 +Seg:4970 Size:256 Owner:0x17aa ++++ -Seg:313a Size:256 Owner:0x16a8 +Seg:4a70 Size:256 Owner:0x17ac ++++ -Seg:323a Size:256 Owner:0x16aa +Seg:4b70 Size:256 Owner:0x17ae ++++ -Seg:333a Size:256 Owner:0x16ac -+++++ -Seg:343a Size:256 Owner:0x16ae +Seg:4c70 Size:256 Owner:0x17b0 ++++ -Seg:353a Size:256 Owner:0x16b0 +Seg:4d70 Size:256 Owner:0x17b2 ++++ -Seg:363a Size:256 Owner:0x16b2 +Seg:4e70 Size:256 Owner:0x17b4 ++++ -Seg:373a Size:256 Owner:0x16b4 +Seg:4f70 Size:256 Owner:0x17b6 ++++ -Seg:383a Size:256 Owner:0x16b6 -+++++ -Seg:393a Size:256 Owner:0x16b8 +Seg:5070 Size:256 Owner:0x17b8 ++++ -Seg:3a3a Size:256 Owner:0x16ba +Seg:5170 Size:256 Owner:0x17ba ++++ -Seg:3b3a Size:256 Owner:0x16bc +Seg:5270 Size:256 Owner:0x17bc ++++ -Seg:3c3a Size:256 Owner:0x16be +Seg:5370 Size:256 Owner:0x17be ++++ -Seg:3d3a Size:256 Owner:0x16c0 -+++++ -Seg:3e3a Size:256 Owner:0x16c2 +Seg:5470 Size:256 Owner:0x17c0 ++++ -Seg:3f3a Size:256 Owner:0x16c4 +Seg:5570 Size:256 Owner:0x17c2 ++++ -Seg:403a Size:256 Owner:0x16c6 +Seg:5670 Size:256 Owner:0x17c4 ++++ -Seg:413a Size:256 Owner:0x16c8 +Seg:5770 Size:256 Owner:0x17c6 ++++ -Seg:423a Size:256 Owner:0x16ca -+++++ -Seg:433a Size:256 Owner:0x16cc +Seg:5870 Size:256 Owner:0x17c8 ++++ -Seg:443a Size:256 Owner:0x16ce +Seg:5970 Size:256 Owner:0x17ca ++++ -Seg:453a Size:256 Owner:0x16d0 +Seg:5a70 Size:256 Owner:0x17cc ++++ -Seg:463a Size:256 Owner:0x16d2 +Seg:5b70 Size:256 Owner:0x17ce ++++ -Seg:473a Size:256 Owner:0x16d4 -+++++ -Seg:483a Size:256 Owner:0x16d6 +Seg:5c70 Size:256 Owner:0x17d0 ++++ -Seg:493a Size:256 Owner:0x16d8 +Seg:5d70 Size:256 Owner:0x17d2 ++++ -Seg:4a3a Size:256 Owner:0x16da +Seg:5e70 Size:256 Owner:0x17d4 ++++ -Seg:4b3a Size:256 Owner:0x16dc +Seg:5f70 Size:256 Owner:0x17d6 ++++ -Seg:4c3a Size:256 Owner:0x16de -+++++ -Seg:4d3a Size:256 Owner:0x16e0 +Seg:6070 Size:256 Owner:0x17d8 ++++ -Seg:4e3a Size:256 Owner:0x16e2 +Seg:6170 Size:256 Owner:0x17da ++++ -Seg:4f3a Size:256 Owner:0x16e4 +Seg:6270 Size:256 Owner:0x17dc ++++ -Seg:503a Size:256 Owner:0x16e6 +Seg:6370 Size:256 Owner:0x17de ++++ -Seg:513a Size:256 Owner:0x16e8 -+++++ -Seg:523a Size:256 Owner:0x16ea +Seg:6470 Size:256 Owner:0x17e0 ++++ -Seg:533a Size:256 Owner:0x16ec +Seg:6570 Size:256 Owner:0x17e2 ++++ -Seg:543a Size:256 Owner:0x16ee +Seg:6670 Size:256 Owner:0x17e4 ++++ -Seg:553a Size:256 Owner:0x16f0 +Seg:6770 Size:256 Owner:0x17e6 ++++ -Seg:563a Size:256 Owner:0x16f2 -+++++ -Seg:573a Size:256 Owner:0x16f4 +Seg:6870 Size:256 Owner:0x17e8 ++++ -Seg:583a Size:256 Owner:0x16f6 +Seg:6970 Size:256 Owner:0x17ea ++++ -Seg:593a Size:256 Owner:0x16f8 +Seg:6a70 Size:256 Owner:0x17ec ++++ -Seg:5a3a Size:256 Owner:0x16fa +Seg:6b70 Size:256 Owner:0x17ee ++++ -Seg:5b3a Size:256 Owner:0x16fc -+++++ -Seg:5c3a Size:256 Owner:0x16fe +Seg:6c70 Size:256 Owner:0x17f0 ++++ -Seg:5d3a Size:256 Owner:0x1700 +Seg:6d70 Size:256 Owner:0x17f2 ++++ -Seg:5e3a Size:256 Owner:0x1702 +Seg:6e70 Size:256 Owner:0x17f4 ++++ -Seg:5f3a Size:256 Owner:0x1704 +Seg:6f70 Size:256 Owner:0x17f6 ++++ -Seg:603a Size:256 Owner:0x1706 -+++++ -Seg:613a Size:256 Owner:0x1708 +Seg:7070 Size:256 Owner:0x17f8 ++++ -Seg:623a Size:256 Owner:0x170a +Seg:7170 Size:256 Owner:0x17fa ++++ -Seg:633a Size:256 Owner:0x170c +Seg:7270 Size:256 Owner:0x17fc ++++ -Seg:643a Size:256 Owner:0x170e +Seg:7370 Size:256 Owner:0x17fe ++++ -Seg:653a Size:256 Owner:0x1710 -+++++ -Seg:663a Size:256 Owner:0x1712 +Seg:7470 Size:256 Owner:0x1800 ++++ -Seg:673a Size:256 Owner:0x1714 +Seg:7570 Size:256 Owner:0x1802 ++++ -Seg:683a Size:256 Owner:0x1716 +Seg:7670 Size:256 Owner:0x1804 ++++ -Seg:693a Size:256 Owner:0x1718 +Seg:7770 Size:256 Owner:0x1806 ++++ -Seg:6a3a Size:256 Owner:0x171a -+++++ -Seg:6b3a Size:256 Owner:0x171c +Seg:7870 Size:256 Owner:0x1808 ++++ -Seg:6c3a Size:256 Owner:0x171e +Seg:7970 Size:256 Owner:0x180a ++++ -Seg:6d3a Size:256 Owner:0x1720 +Seg:7a70 Size:256 Owner:0x180c ++++ -Seg:6e3a Size:256 Owner:0x1722 +Seg:7b70 Size:256 Owner:0x180e ++++ -Seg:6f3a Size:256 Owner:0x1724 -+++++ -Seg:703a Size:256 Owner:0x1726 +Seg:7c70 Size:256 Owner:0x1810 ++++ -Seg:713a Size:256 Owner:0x1728 +Seg:7d70 Size:256 Owner:0x1812 ++++ -Seg:723a Size:256 Owner:0x172a +Seg:7e70 Size:256 Owner:0x1814 ++++ -Seg:733a Size:256 Owner:0x172c +Seg:7f70 Size:256 Owner:0x1816 ++++ -Seg:743a Size:256 Owner:0x172e -+++++ -Seg:753a Size:256 Owner:0x1730 +Seg:8070 Size:256 Owner:0x1818 ++++ -Seg:763a Size:256 Owner:0x1732 +Seg:8170 Size:256 Owner:0x181a ++++ -Seg:773a Size:256 Owner:0x1734 +Seg:8270 Size:256 Owner:0x181c ++++ -Seg:783a Size:256 Owner:0x1736 +Seg:8370 Size:256 Owner:0x181e ++++ -Seg:793a Size:256 Owner:0x1738 -+++++ -Seg:7a3a Size:256 Owner:0x173a +Seg:8470 Size:256 Owner:0x1820 ++++ -Seg:7b3a Size:256 Owner:0x173c +Seg:8570 Size:256 Owner:0x1822 ++++ -Seg:7c3a Size:256 Owner:0x173e +Seg:8670 Size:256 Owner:0x1824 ++++ -Seg:7d3a Size:256 Owner:0x1740 +Seg:8770 Size:256 Owner:0x1826 ++++ -Seg:7e3a Size:256 Owner:0x1742 -+++++ -Seg:7f3a Size:256 Owner:0x1744 +Seg:8870 Size:256 Owner:0x1828 ++++ -Seg:803a Size:256 Owner:0x1746 +Seg:8970 Size:256 Owner:0x182a ++++ -Seg:813a Size:256 Owner:0x1748 +Seg:8a70 Size:256 Owner:0x182c ++++ -Seg:823a Size:256 Owner:0x174a +Seg:8b70 Size:256 Owner:0x182e ++++ -Seg:833a Size:256 Owner:0x174c -+++++ -Seg:843a Size:256 Owner:0x174e +Seg:8c70 Size:256 Owner:0x1830 ++++ -Seg:853a Size:256 Owner:0x1750 +Seg:8d70 Size:256 Owner:0x1832 ++++ -Seg:863a Size:256 Owner:0x1752 +Seg:8e70 Size:256 Owner:0x1834 ++++ -Seg:873a Size:256 Owner:0x1754 +Seg:8f70 Size:256 Owner:0x1836 ++++ -Seg:883a Size:256 Owner:0x1756 -+++++ -Seg:893a Size:256 Owner:0x1758 +Seg:9070 Size:256 Owner:0x1838 ++++ -Seg:8a3a Size:256 Owner:0x175a +Seg:9170 Size:256 Owner:0x183a ++++ -Seg:8b3a Size:256 Owner:0x175c +Seg:9270 Size:256 Owner:0x183c ++++ -Seg:8c3a Size:273 Owner:0xe400 -+++++ -Seg:b83a Size:18373 Owner:0x0 -+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ \ No newline at end of file +Seg:9370 Size:401 Owner:0xf45a +++++++ +Seg:be70 Size:8592 Owner:0x0 +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ +Seg:e000 Size:8191 Owner:0x0 +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ \ No newline at end of file diff --git a/HEAP.16W b/HEAP.16W index 1c82fec5..78ae75ec 100755 --- a/HEAP.16W +++ b/HEAP.16W @@ -1,47 +1,57 @@ == default == - USED block at 28300016 of size 66 - USED block at 28300058 of size 66 - FREE block at 2830009a of size 18 - USED block at 283000ac of size 136 - USED block at 28300134 of size 20 - FREE block at 28300148 of size 7860 + FREE block at 2e6e0016 of size 18 + USED block at 2e6e0028 of size 136 + USED block at 2e6e00b0 of size 50 + USED block at 2e6e00e2 of size 50 + USED block at 2e6e0114 of size 50 + USED block at 2e6e0146 of size 50 + USED block at 2e6e0178 of size 50 + USED block at 2e6e01aa of size 50 + USED block at 2e6e01dc of size 50 + USED block at 2e6e020e of size 50 + USED block at 2e6e0240 of size 50 + USED block at 2e6e0272 of size 50 + USED block at 2e6e02a4 of size 50 + USED block at 2e6e02d6 of size 50 + USED block at 2e6e0308 of size 50 + FREE block at 2e6e033a of size 14 + USED block at 2e6e0348 of size 20 + FREE block at 2e6e035c of size 7328 OK - end of heap == near == - USED block at 182fe436 of size 12 - USED block at 182fe442 of size 332 - USED block at 182fe58e of size 52 - USED block at 182fe5c2 of size 20 - USED block at 182fe5d6 of size 20 - USED block at 182fe5ea of size 20 - USED block at 182fe5fe of size 20 - USED block at 182fe612 of size 20 - USED block at 182fe626 of size 6614 + USED block at 1e6df4a6 of size 12 + USED block at 1e6df4b2 of size 330 + USED block at 1e6df5fc of size 52 + USED block at 1e6df630 of size 20 + USED block at 1e6df644 of size 20 + USED block at 1e6df658 of size 20 + USED block at 1e6df66c of size 20 + USED block at 1e6df680 of size 20 + USED block at 1e6df694 of size 2408 OK - end of heap == far == - USED block at 28300016 of size 66 - USED block at 28300058 of size 66 - USED block at 2830009a of size 18 - USED block at 283000ac of size 136 - USED block at 28300134 of size 20 - USED block at 28300148 of size 7860 + USED block at 2e6e0016 of size 18 + USED block at 2e6e0028 of size 136 + USED block at 2e6e00b0 of size 50 + USED block at 2e6e00e2 of size 50 + USED block at 2e6e0114 of size 50 + USED block at 2e6e0146 of size 50 + USED block at 2e6e0178 of size 50 + USED block at 2e6e01aa of size 50 + USED block at 2e6e01dc of size 50 + USED block at 2e6e020e of size 50 + USED block at 2e6e0240 of size 50 + USED block at 2e6e0272 of size 50 + USED block at 2e6e02a4 of size 50 + USED block at 2e6e02d6 of size 50 + USED block at 2e6e0308 of size 50 + USED block at 2e6e033a of size 14 + USED block at 2e6e0348 of size 20 + USED block at 2e6e035c of size 7328 OK - end of heap - -Memory Type Total Used Free ----------------- -------- -------- -------- -Default 8166 288 7878 -Near 7110 496 6614 -Far 8166 0 7878 ----------------- -------- -------- -------- -coreleft = 6612 -farcoreleft = 30720 -GetFreeSize = 24128 -GetNearFreeSize = 6614 -GetFarFreeSize = 24128 -memavl = 6612 -stackavail = 31588 diff --git a/MMDUMP.16W b/MMDUMP.16W index cb01f5be..91ef291f 100755 Binary files a/MMDUMP.16W and b/MMDUMP.16W differ diff --git a/src/lib/16_head.h b/src/lib/16_head.h index 2d080d52..aab4c033 100755 --- a/src/lib/16_head.h +++ b/src/lib/16_head.h @@ -152,7 +152,7 @@ static word far* clockw= (word far*) 0x046C; /* 18.2hz clock */ extern int profilehandle,debughandle; //make it into game global #define __DEBUG__ -#define __DEBUG_PM__ +//#define __DEBUG_PM__ //#define __DEBUG_MM__ #define nil ((void *)0) diff --git a/src/lib/16_pm.c b/src/lib/16_pm.c index 3b19c0ae..3b37ec62 100755 --- a/src/lib/16_pm.c +++ b/src/lib/16_pm.c @@ -356,6 +356,7 @@ PML_StartupXMS(global_game_variables_t *gvar) { //#define STARTUPXMSASM byte err; + #define BRACKETXMS word XMSAvail, XMSHandle; #define XMSAVI XMSAvail #define XMSHAN XMSHandle @@ -383,10 +384,14 @@ PML_StartupXMS(global_game_variables_t *gvar) #ifdef STARTUPXMSASM mov ah,XMS_QUERYFREE // Find out how much XMS is available - call [DWORD PTR XMSDriver] + call [DWORD PTR XMSDriver]//DWORD PTR +#ifndef BRACKETXMS mov XMSAVI,ax - cmp bl,0xa0 // AJR: bugfix 10/8/92 - je error1 +#else + mov [XMSAVI],ax +#endif + or ax,ax // AJR: bugfix 10/8/92 + jz error1 mov e,3 #endif jmp End1 @@ -411,7 +416,7 @@ End1: #ifndef STARTUPXMSASM XMS_CALL(XMS_QUERYFREE); // Find out how much XMS is available XMSAVI = _AX; - if (_BL) // AJR: bugfix 10/8/92 + if (!_AX) // AJR: bugfix 10/8/92 { errorflag = true; err = _BL; @@ -422,8 +427,7 @@ End1: #ifdef __DEBUG_PM__ //++++ printf("XMSVer=%02X ", XMSVer); - printf("XMSAvail=%u\n", (XMSAVI)); - getch(); + printf("XMSAvail=%u\n", XMSAVI); #endif XMSAVI &= ~(PMPageSizeKB - 1); // Round off to nearest page size if (XMSAVI < (PMPageSizeKB * 2)) // Need at least 2 pages @@ -433,16 +437,20 @@ End1: } #ifdef STARTUPXMSASM __asm { +#ifndef BRACKETXMS mov dx,XMSAVI +#else + mov dx,[XMSAVI] +#endif mov ah,XMS_ALLOC // And do the allocation - call [DWORD PTR XMSDriver] + call [DWORD PTR XMSDriver]//DWORD PTR #ifndef BRACKETXMS mov XMSHAN,dx #else mov [XMSHAN],dx #endif - cmp ax,0 // AJR: bugfix 10/8/92 - je error2 + or ax,ax // AJR: bugfix 10/8/92 + jz error2 mov e,4 jmp End2 #ifdef __BORLANDC__ @@ -477,8 +485,8 @@ End2: error: if(errorflag==false) { - gvar->mmi.XMSmem = (XMSAVI) * 1024ul; - gvar->pm.xmm.XMSAvail = (word)XMSAVI; + gvar->mmi.XMSmem = (dword)(XMSAVI) * 1024; + gvar->pm.xmm.XMSAvail = XMSAVI; gvar->pm.xmm.XMSHandle = XMSHAN; //++++ gvar->pm.xmm.XMSVer = XMSVer; gvar->pm.xmm.XMSPresent = true; @@ -493,10 +501,7 @@ error: //printf(" 1=%u 2=%u 3=%u 4=%u\n", XMSHandle1, XMSHandle2, XMSHandle3, XMSHandle4); //printf(" 2=%u ", XMSHandle); //printf(" %u", gvar->pm.xmm.XMSHandle); - printf("XMSerr\n"); - printf(" %u, %lu\n", (word)XMSAVI, (dword)XMSAVI); - printf(" err=%02X e=%u\n", err, e); - getch(); + printf("err=%02X e=%u\n", err, e); #endif } return(gvar->pm.xmm.XMSPresent); diff --git a/src/lib/typdefst.h b/src/lib/typdefst.h index 41c6b069..6c5ca4e3 100755 --- a/src/lib/typdefst.h +++ b/src/lib/typdefst.h @@ -257,7 +257,7 @@ typedef struct typedef struct { boolean XMSPresent; - word XMSAvail,XMSPagesAvail,XMSHandle;//++++,XMSVer; + word XMSAvail,XMSPagesAvail,XMSHandle;//++++,XMSVer; dword XMSDriver; int XMSProtectPage;// = -1; } pm_xmmi_t;