]> 4ch.mooo.com Git - 16.git/commitdiff
==== bcexmm.exe works again! yay! ==== wwww
authorsparky4 <sparky4@cock.li>
Wed, 22 Feb 2017 21:56:11 +0000 (15:56 -0600)
committersparky4 <sparky4@cock.li>
Wed, 22 Feb 2017 21:56:11 +0000 (15:56 -0600)
23 files changed:
BCEXMM.L16 [new file with mode: 0755]
DEBUG.16B [new file with mode: 0755]
DEBUG.16W [new file with mode: 0755]
EXMMTEST.L16 [new file with mode: 0755]
HEAP.16W [new file with mode: 0755]
MEMINFO.16B [new file with mode: 0755]
MEMINFO.16W [new file with mode: 0755]
MMDUMP.16B [new file with mode: 0755]
MMDUMP.16W [new file with mode: 0755]
bcexmm.exe
src/exmmtest.c
src/lib/16_ca.c
src/lib/16_dbg.c
src/lib/16_dbg.h
src/lib/16_hc.c
src/lib/16_hc.h
src/lib/16_head.c
src/lib/16_head.h
src/lib/16_map.h
src/lib/16_mm.c
src/lib/16_t.h
src/lib/16_tail.h
src/lib/16_tdef.h

diff --git a/BCEXMM.L16 b/BCEXMM.L16
new file mode 100755 (executable)
index 0000000..41d4402
--- /dev/null
@@ -0,0 +1,68 @@
+-------------------------------------------------------------------------------\r
+&main()=       1228:0FFA\r
+buffer:\r
+       0004:0000       &0AC8:2EB2\r
+            0000       &     2eb2\r
+-------------------------------------------------------------------------------\r
+\r
+\r
+press any key to continue!\r
+======================================load======================================\r
+===============================================================================\r
+               CA_LoadFile\r
+===============================================================================\r
+       ptr=0AC8:2EB2\r
+       *ptr=110D:0000\r
+       &ptr=1228:0FCE\r
+MM_GetPtr\r
+       baseptr=0AC8:2EB2       useptr=0AC8:2EB2\r
+       *baseptr=1C52:0000      *useptr=1C52:0000\r
+       &baseptr=1228:0FB2      &useptr=0AC8:3797\r
+---------------------------------------\r
+       ptr=0AC8:2EB2\r
+       *ptr=110D:7900\r
+       &ptr=1228:0FCE\r
+-------------------------------------------------------------------------------\r
+-------------------------------------------------------------------------------\r
+&main()=       1228:0FFA\r
+buffer:\r
+       0001:7900       &0AC8:2EB2\r
+            7900       &     2eb2\r
+-------------------------------------------------------------------------------\r
+\r
+yay!\r
+press any key to continue!\r
+========================================\r
+               DebugMemory_\r
+========================================\r
+Memory Usage\r
+------------\r
+Total:         558k\r
+Free:          150k\r
+With purge:    550k\r
+------------\r
+MMDUMP.16 created.\r
+========================================\r
+               MM_Report_\r
+========================================\r
+       ÉLIMEMS 1\r
+       ÇÄEMM v4.0 available\r
+       ÇÄtotalEMSpages:        4032    freeEMSpages:   3939\r
+       ÇÄEMSPageFrame: e000\r
+       ÓÄEMSmem:       64536576\r
+       ÉXMS    1\r
+       ÇÄXMS v3.0 available\r
+       ÇÄXMSDriver:    C83F:0010\r
+       ÇÄXMSHandle:    0800\r
+       ÓÄXMSmem:       2097152\r
+       ÉConv.  1\r
+       ÓÄTotal:        558k    Free:   150k    With purge:550k\r
+nearheap:      50852           farheap:        521204\r
+========================================\r
+near=  1373:0004 far=  1FFF:0004\r
+&near= 0AC8:30E5 &far= 0AC8:30E1\r
+bigb=  0001:0000 &bigb=0AC8:2EB2 \r
+========================================\r
+Project 16 bcexmm.exe. This is just a test file!\r
+version Feb 22 2017 14:48:22\r
+debugmm: 1     \r
diff --git a/DEBUG.16B b/DEBUG.16B
new file mode 100755 (executable)
index 0000000..629832b
--- /dev/null
+++ b/DEBUG.16B
@@ -0,0 +1,210 @@
+\e[0mSeg:0      Size:4864       Owner:0x0\r
+\e[41;31m+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++\e[0m\e[42;32m0\r
+\e[0m\e[0mSeg:1300       Size:256        Owner:0x2e21\r
+\e[44;34m++++\e[0m\e[42;32m\r
+\e[0m\e[0mSeg:1400       Size:256        Owner:0x2c24\r
+\e[45;35m++++\e[0m\e[42;32m\r
+\e[0m\e[0mSeg:1500       Size:256        Owner:0x2c26\r
+\e[45;35m++++\e[0m\e[42;32m\r
+\e[0m\e[0mSeg:1600       Size:256        Owner:0x2c28\r
+\e[45;35m++++\e[0m\e[42;32m\r
+\e[0m\e[0mSeg:1700       Size:256        Owner:0x2c2a\r
+\e[45;35m++++\e[0m\e[42;32m\r
+\e[0m\e[0mSeg:1800       Size:256        Owner:0x2c2c\r
+\e[45;35m++++\e[0m\e[42;32m\r
+\e[0m\e[0mSeg:1900       Size:256        Owner:0x2c2e\r
+\e[45;35m++++\e[0m\e[42;32m\r
+\e[0m\e[0mSeg:1a00       Size:256        Owner:0x2c30\r
+\e[45;35m++++\e[0m\e[42;32m\r
+\e[0m\e[0mSeg:1b00       Size:256        Owner:0x2c32\r
+\e[45;35m++++\e[0m\e[42;32m\r
+\e[0m\e[0mSeg:1c00       Size:256        Owner:0x2c34\r
+\e[45;35m++++\e[0m\e[42;32m\r
+\e[0m\e[0mSeg:1d00       Size:256        Owner:0x2c36\r
+\e[45;35m++++\e[0m\e[42;32m\r
+\e[0m\e[0mSeg:1e00       Size:256        Owner:0x2c38\r
+\e[45;35m++++\e[0m\e[42;32m\r
+\e[0m\e[0mSeg:1fde       Size:34 Owner:0x0\r
+\e[41;31m++\e[0m\e[42;32m\r
+\e[0m\e[0mSeg:2000       Size:256        Owner:0x2c3a\r
+\e[45;35m++++\e[0m\e[42;32m\r
+\e[0m\e[0mSeg:2100       Size:256        Owner:0x2c3c\r
+\e[45;35m++++\e[0m\e[42;32m\r
+\e[0m\e[0mSeg:2200       Size:256        Owner:0x2c3e\r
+\e[45;35m++++\e[0m\e[42;32m\r
+\e[0m\e[0mSeg:2300       Size:256        Owner:0x2c40\r
+\e[45;35m++++\e[0m\e[42;32m\r
+\e[0m\e[0mSeg:2400       Size:256        Owner:0x2c42\r
+\e[45;35m++++\e[0m\e[42;32m\r
+\e[0m\e[0mSeg:2500       Size:256        Owner:0x2c44\r
+\e[45;35m++++\e[0m\e[42;32m\r
+\e[0m\e[0mSeg:2600       Size:256        Owner:0x2c46\r
+\e[45;35m++++\e[0m\e[42;32m\r
+\e[0m\e[0mSeg:2700       Size:256        Owner:0x2c48\r
+\e[45;35m++++\e[0m\e[42;32m\r
+\e[0m\e[0mSeg:2800       Size:256        Owner:0x2c4a\r
+\e[45;35m++++\e[0m\e[42;32m\r
+\e[0m\e[0mSeg:2900       Size:256        Owner:0x2c4c\r
+\e[45;35m++++\e[0m\e[42;32m\r
+\e[0m\e[0mSeg:2a00       Size:256        Owner:0x2c4e\r
+\e[45;35m++++\e[0m\e[42;32m\r
+\e[0m\e[0mSeg:2b00       Size:256        Owner:0x2c50\r
+\e[45;35m++++\e[0m\e[42;32m\r
+\e[0m\e[0mSeg:2c00       Size:256        Owner:0x2c52\r
+\e[45;35m++++\e[0m\e[42;32m\r
+\e[0m\e[0mSeg:2d00       Size:256        Owner:0x2c54\r
+\e[45;35m++++\e[0m\e[42;32m\r
+\e[0m\e[0mSeg:2e00       Size:256        Owner:0x2c56\r
+\e[45;35m++++\e[0m\e[42;32m\r
+\e[0m\e[0mSeg:2f00       Size:256        Owner:0x2c58\r
+\e[45;35m++++\e[0m\e[42;32m\r
+\e[0m\e[0mSeg:3000       Size:256        Owner:0x2c5a\r
+\e[45;35m++++\e[0m\e[42;32m\r
+\e[0m\e[0mSeg:3100       Size:256        Owner:0x2c5c\r
+\e[45;35m++++\e[0m\e[42;32m\r
+\e[0m\e[0mSeg:3200       Size:256        Owner:0x2c5e\r
+\e[45;35m++++\e[0m\e[42;32m\r
+\e[0m\e[0mSeg:3300       Size:256        Owner:0x2c60\r
+\e[45;35m++++\e[0m\e[42;32m\r
+\e[0m\e[0mSeg:3400       Size:256        Owner:0x2c62\r
+\e[45;35m++++\e[0m\e[42;32m\r
+\e[0m\e[0mSeg:3500       Size:256        Owner:0x2c64\r
+\e[45;35m++++\e[0m\e[42;32m\r
+\e[0m\e[0mSeg:3600       Size:256        Owner:0x2c66\r
+\e[45;35m++++\e[0m\e[42;32m\r
+\e[0m\e[0mSeg:3700       Size:256        Owner:0x2c68\r
+\e[45;35m++++\e[0m\e[42;32m\r
+\e[0m\e[0mSeg:3800       Size:256        Owner:0x2c6a\r
+\e[45;35m++++\e[0m\e[42;32m\r
+\e[0m\e[0mSeg:3900       Size:256        Owner:0x2c6c\r
+\e[45;35m++++\e[0m\e[42;32m\r
+\e[0m\e[0mSeg:3a00       Size:256        Owner:0x2c6e\r
+\e[45;35m++++\e[0m\e[42;32m\r
+\e[0m\e[0mSeg:3b00       Size:256        Owner:0x2c70\r
+\e[45;35m++++\e[0m\e[42;32m\r
+\e[0m\e[0mSeg:3c00       Size:256        Owner:0x2c72\r
+\e[45;35m++++\e[0m\e[42;32m\r
+\e[0m\e[0mSeg:3d00       Size:256        Owner:0x2c74\r
+\e[45;35m++++\e[0m\e[42;32m\r
+\e[0m\e[0mSeg:3e00       Size:256        Owner:0x2c76\r
+\e[45;35m++++\e[0m\e[42;32m\r
+\e[0m\e[0mSeg:3f00       Size:256        Owner:0x2c78\r
+\e[45;35m++++\e[0m\e[42;32m\r
+\e[0m\e[0mSeg:4000       Size:256        Owner:0x2c7a\r
+\e[45;35m++++\e[0m\e[42;32m\r
+\e[0m\e[0mSeg:4100       Size:256        Owner:0x2c7c\r
+\e[45;35m++++\e[0m\e[42;32m\r
+\e[0m\e[0mSeg:4200       Size:256        Owner:0x2c7e\r
+\e[45;35m++++\e[0m\e[42;32m\r
+\e[0m\e[0mSeg:4300       Size:256        Owner:0x2c80\r
+\e[45;35m++++\e[0m\e[42;32m\r
+\e[0m\e[0mSeg:4400       Size:256        Owner:0x2c82\r
+\e[45;35m++++\e[0m\e[42;32m\r
+\e[0m\e[0mSeg:4500       Size:256        Owner:0x2c84\r
+\e[45;35m++++\e[0m\e[42;32m\r
+\e[0m\e[0mSeg:4600       Size:256        Owner:0x2c86\r
+\e[45;35m++++\e[0m\e[42;32m\r
+\e[0m\e[0mSeg:4700       Size:256        Owner:0x2c88\r
+\e[45;35m++++\e[0m\e[42;32m\r
+\e[0m\e[0mSeg:4800       Size:256        Owner:0x2c8a\r
+\e[45;35m++++\e[0m\e[42;32m\r
+\e[0m\e[0mSeg:4900       Size:256        Owner:0x2c8c\r
+\e[45;35m++++\e[0m\e[42;32m\r
+\e[0m\e[0mSeg:4a00       Size:256        Owner:0x2c8e\r
+\e[45;35m++++\e[0m\e[42;32m\r
+\e[0m\e[0mSeg:4b00       Size:256        Owner:0x2c90\r
+\e[45;35m++++\e[0m\e[42;32m\r
+\e[0m\e[0mSeg:4c00       Size:256        Owner:0x2c92\r
+\e[45;35m++++\e[0m\e[42;32m\r
+\e[0m\e[0mSeg:4d00       Size:256        Owner:0x2c94\r
+\e[45;35m++++\e[0m\e[42;32m\r
+\e[0m\e[0mSeg:4e00       Size:256        Owner:0x2c96\r
+\e[45;35m++++\e[0m\e[42;32m\r
+\e[0m\e[0mSeg:4f00       Size:256        Owner:0x2c98\r
+\e[45;35m++++\e[0m\e[42;32m\r
+\e[0m\e[0mSeg:5000       Size:256        Owner:0x2c9a\r
+\e[45;35m++++\e[0m\e[42;32m\r
+\e[0m\e[0mSeg:5100       Size:256        Owner:0x2c9c\r
+\e[45;35m++++\e[0m\e[42;32m\r
+\e[0m\e[0mSeg:5200       Size:256        Owner:0x2c9e\r
+\e[45;35m++++\e[0m\e[42;32m\r
+\e[0m\e[0mSeg:5300       Size:256        Owner:0x2ca0\r
+\e[45;35m++++\e[0m\e[42;32m\r
+\e[0m\e[0mSeg:5400       Size:256        Owner:0x2ca2\r
+\e[45;35m++++\e[0m\e[42;32m\r
+\e[0m\e[0mSeg:5500       Size:256        Owner:0x2ca4\r
+\e[45;35m++++\e[0m\e[42;32m\r
+\e[0m\e[0mSeg:5600       Size:256        Owner:0x2ca6\r
+\e[45;35m++++\e[0m\e[42;32m\r
+\e[0m\e[0mSeg:5700       Size:256        Owner:0x2ca8\r
+\e[45;35m++++\e[0m\e[42;32m\r
+\e[0m\e[0mSeg:5800       Size:256        Owner:0x2caa\r
+\e[45;35m++++\e[0m\e[42;32m\r
+\e[0m\e[0mSeg:5900       Size:256        Owner:0x2cac\r
+\e[45;35m++++\e[0m\e[42;32m\r
+\e[0m\e[0mSeg:5a00       Size:256        Owner:0x2cae\r
+\e[45;35m++++\e[0m\e[42;32m\r
+\e[0m\e[0mSeg:5b00       Size:256        Owner:0x2cb0\r
+\e[45;35m++++\e[0m\e[42;32m\r
+\e[0m\e[0mSeg:5c00       Size:256        Owner:0x2cb2\r
+\e[45;35m++++\e[0m\e[42;32m\r
+\e[0m\e[0mSeg:5d00       Size:256        Owner:0x2cb4\r
+\e[45;35m++++\e[0m\e[42;32m\r
+\e[0m\e[0mSeg:5e00       Size:256        Owner:0x2cb6\r
+\e[45;35m++++\e[0m\e[42;32m\r
+\e[0m\e[0mSeg:5f00       Size:256        Owner:0x2cb8\r
+\e[45;35m++++\e[0m\e[42;32m\r
+\e[0m\e[0mSeg:6000       Size:256        Owner:0x2cba\r
+\e[45;35m++++\e[0m\e[42;32m\r
+\e[0m\e[0mSeg:6100       Size:256        Owner:0x2cbc\r
+\e[45;35m++++\e[0m\e[42;32m\r
+\e[0m\e[0mSeg:6200       Size:256        Owner:0x2cbe\r
+\e[45;35m++++\e[0m\e[42;32m\r
+\e[0m\e[0mSeg:6300       Size:256        Owner:0x2cc0\r
+\e[45;35m++++\e[0m\e[42;32m\r
+\e[0m\e[0mSeg:6400       Size:256        Owner:0x2cc2\r
+\e[45;35m++++\e[0m\e[42;32m\r
+\e[0m\e[0mSeg:6500       Size:256        Owner:0x2cc4\r
+\e[45;35m++++\e[0m\e[42;32m\r
+\e[0m\e[0mSeg:6600       Size:256        Owner:0x2cc6\r
+\e[45;35m++++\e[0m\e[42;32m\r
+\e[0m\e[0mSeg:6700       Size:256        Owner:0x2cc8\r
+\e[45;35m++++\e[0m\e[42;32m\r
+\e[0m\e[0mSeg:6800       Size:256        Owner:0x2cca\r
+\e[45;35m++++\e[0m\e[42;32m\r
+\e[0m\e[0mSeg:6900       Size:256        Owner:0x2ccc\r
+\e[45;35m++++\e[0m\e[42;32m\r
+\e[0m\e[0mSeg:6a00       Size:256        Owner:0x2cce\r
+\e[45;35m++++\e[0m\e[42;32m\r
+\e[0m\e[0mSeg:6b00       Size:256        Owner:0x2cd0\r
+\e[45;35m++++\e[0m\e[42;32m\r
+\e[0m\e[0mSeg:6c00       Size:256        Owner:0x2cd2\r
+\e[45;35m++++\e[0m\e[42;32m\r
+\e[0m\e[0mSeg:6d00       Size:256        Owner:0x2cd4\r
+\e[45;35m++++\e[0m\e[42;32m\r
+\e[0m\e[0mSeg:6e00       Size:256        Owner:0x2cd6\r
+\e[45;35m++++\e[0m\e[42;32m\r
+\e[0m\e[0mSeg:6f00       Size:256        Owner:0x2cd8\r
+\e[45;35m++++\e[0m\e[42;32m\r
+\e[0m\e[0mSeg:7000       Size:256        Owner:0x2cda\r
+\e[45;35m++++\e[0m\e[42;32m\r
+\e[0m\e[0mSeg:7100       Size:256        Owner:0x2cdc\r
+\e[45;35m++++\e[0m\e[42;32m\r
+\e[0m\e[0mSeg:7200       Size:256        Owner:0x2cde\r
+\e[45;35m++++\e[0m\e[42;32m\r
+\e[0m\e[0mSeg:7300       Size:256        Owner:0x2ce0\r
+\e[45;35m++++\e[0m\e[42;32m\r
+\e[0m\e[0mSeg:7400       Size:256        Owner:0x2ce2\r
+\e[45;35m++++\e[0m\e[42;32m\r
+\e[0m\e[0mSeg:7500       Size:256        Owner:0x2ce4\r
+\e[45;35m++++\e[0m\e[42;32m\r
+\e[0m\e[0mSeg:7600       Size:256        Owner:0x2ce6\r
+\e[45;35m++++\e[0m\e[42;32m\r
+\e[0m\e[0mSeg:7700       Size:256        Owner:0x2ce8\r
+\e[45;35m++++\e[0m\e[42;32m\r
+\e[0m\e[0mSeg:7800       Size:256        Owner:0x2cea\r
+\e[45;35m++++\e[0m\e[42;32m\r
+\e[0m\e[0mSeg:7900       Size:273        Owner:0x2bfa\r
+\e[44;34m++++\e[0m\e[42;32m\r
+\e[0m\e[0mSeg:9f3f       Size:24768      Owner:0x0\r
+\e[41;31m+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++\e[0m
\ No newline at end of file
diff --git a/DEBUG.16W b/DEBUG.16W
new file mode 100755 (executable)
index 0000000..f401ae9
--- /dev/null
+++ b/DEBUG.16W
@@ -0,0 +1,210 @@
+\e[0mSeg:0      Size:8973       Owner:0x0\r
+\e[41;31m+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++\e[0m\e[42;32m0000\r
+\e[0m\e[0mSeg:23fe       Size:39 Owner:0x0\r
+\e[41;31m+\e[0m\e[42;32m\r
+\e[0m\e[0mSeg:2425       Size:256        Owner:0x1dc4\r
+\e[44;34m++++\e[0m\e[42;32m\r
+\e[0m\e[0mSeg:2525       Size:256        Owner:0x1bb6\r
+\e[45;35m+++++\e[0m\e[42;32m\r
+\e[0m\e[0mSeg:2625       Size:256        Owner:0x1bb8\r
+\e[45;35m++++\e[0m\e[42;32m\r
+\e[0m\e[0mSeg:2725       Size:256        Owner:0x1bba\r
+\e[45;35m++++\e[0m\e[42;32m\r
+\e[0m\e[0mSeg:2825       Size:256        Owner:0x1bbc\r
+\e[45;35m++++\e[0m\e[42;32m\r
+\e[0m\e[0mSeg:2925       Size:256        Owner:0x1bbe\r
+\e[45;35m++++\e[0m\e[42;32m\r
+\e[0m\e[0mSeg:2a25       Size:256        Owner:0x1bc0\r
+\e[45;35m+++++\e[0m\e[42;32m\r
+\e[0m\e[0mSeg:2b25       Size:256        Owner:0x1bc2\r
+\e[45;35m++++\e[0m\e[42;32m\r
+\e[0m\e[0mSeg:2c25       Size:256        Owner:0x1bc4\r
+\e[45;35m++++\e[0m\e[42;32m\r
+\e[0m\e[0mSeg:2d25       Size:256        Owner:0x1bc6\r
+\e[45;35m++++\e[0m\e[42;32m\r
+\e[0m\e[0mSeg:2e25       Size:256        Owner:0x1bc8\r
+\e[45;35m++++\e[0m\e[42;32m\r
+\e[0m\e[0mSeg:2f25       Size:256        Owner:0x1bca\r
+\e[45;35m+++++\e[0m\e[42;32m\r
+\e[0m\e[0mSeg:3025       Size:256        Owner:0x1bcc\r
+\e[45;35m++++\e[0m\e[42;32m\r
+\e[0m\e[0mSeg:3125       Size:256        Owner:0x1bce\r
+\e[45;35m++++\e[0m\e[42;32m\r
+\e[0m\e[0mSeg:3225       Size:256        Owner:0x1bd0\r
+\e[45;35m++++\e[0m\e[42;32m\r
+\e[0m\e[0mSeg:3325       Size:256        Owner:0x1bd2\r
+\e[45;35m++++\e[0m\e[42;32m\r
+\e[0m\e[0mSeg:3425       Size:256        Owner:0x1bd4\r
+\e[45;35m+++++\e[0m\e[42;32m\r
+\e[0m\e[0mSeg:3525       Size:256        Owner:0x1bd6\r
+\e[45;35m++++\e[0m\e[42;32m\r
+\e[0m\e[0mSeg:3625       Size:256        Owner:0x1bd8\r
+\e[45;35m++++\e[0m\e[42;32m\r
+\e[0m\e[0mSeg:3725       Size:256        Owner:0x1bda\r
+\e[45;35m++++\e[0m\e[42;32m\r
+\e[0m\e[0mSeg:3825       Size:256        Owner:0x1bdc\r
+\e[45;35m++++\e[0m\e[42;32m\r
+\e[0m\e[0mSeg:3925       Size:256        Owner:0x1bde\r
+\e[45;35m+++++\e[0m\e[42;32m\r
+\e[0m\e[0mSeg:3a25       Size:256        Owner:0x1be0\r
+\e[45;35m++++\e[0m\e[42;32m\r
+\e[0m\e[0mSeg:3b25       Size:256        Owner:0x1be2\r
+\e[45;35m++++\e[0m\e[42;32m\r
+\e[0m\e[0mSeg:3c25       Size:256        Owner:0x1be4\r
+\e[45;35m++++\e[0m\e[42;32m\r
+\e[0m\e[0mSeg:3d25       Size:256        Owner:0x1be6\r
+\e[45;35m++++\e[0m\e[42;32m\r
+\e[0m\e[0mSeg:3e25       Size:256        Owner:0x1be8\r
+\e[45;35m+++++\e[0m\e[42;32m\r
+\e[0m\e[0mSeg:3f25       Size:256        Owner:0x1bea\r
+\e[45;35m++++\e[0m\e[42;32m\r
+\e[0m\e[0mSeg:4025       Size:256        Owner:0x1bec\r
+\e[45;35m++++\e[0m\e[42;32m\r
+\e[0m\e[0mSeg:4125       Size:256        Owner:0x1bee\r
+\e[45;35m++++\e[0m\e[42;32m\r
+\e[0m\e[0mSeg:4225       Size:256        Owner:0x1bf0\r
+\e[45;35m++++\e[0m\e[42;32m\r
+\e[0m\e[0mSeg:4325       Size:256        Owner:0x1bf2\r
+\e[45;35m+++++\e[0m\e[42;32m\r
+\e[0m\e[0mSeg:4425       Size:256        Owner:0x1bf4\r
+\e[45;35m++++\e[0m\e[42;32m\r
+\e[0m\e[0mSeg:4525       Size:256        Owner:0x1bf6\r
+\e[45;35m++++\e[0m\e[42;32m\r
+\e[0m\e[0mSeg:4625       Size:256        Owner:0x1bf8\r
+\e[45;35m++++\e[0m\e[42;32m\r
+\e[0m\e[0mSeg:4725       Size:256        Owner:0x1bfa\r
+\e[45;35m++++\e[0m\e[42;32m\r
+\e[0m\e[0mSeg:4825       Size:256        Owner:0x1bfc\r
+\e[45;35m+++++\e[0m\e[42;32m\r
+\e[0m\e[0mSeg:4925       Size:256        Owner:0x1bfe\r
+\e[45;35m++++\e[0m\e[42;32m\r
+\e[0m\e[0mSeg:4a25       Size:256        Owner:0x1c00\r
+\e[45;35m++++\e[0m\e[42;32m\r
+\e[0m\e[0mSeg:4b25       Size:256        Owner:0x1c02\r
+\e[45;35m++++\e[0m\e[42;32m\r
+\e[0m\e[0mSeg:4c25       Size:256        Owner:0x1c04\r
+\e[45;35m++++\e[0m\e[42;32m\r
+\e[0m\e[0mSeg:4d25       Size:256        Owner:0x1c06\r
+\e[45;35m+++++\e[0m\e[42;32m\r
+\e[0m\e[0mSeg:4e25       Size:256        Owner:0x1c08\r
+\e[45;35m++++\e[0m\e[42;32m\r
+\e[0m\e[0mSeg:4f25       Size:256        Owner:0x1c0a\r
+\e[45;35m++++\e[0m\e[42;32m\r
+\e[0m\e[0mSeg:5025       Size:256        Owner:0x1c0c\r
+\e[45;35m++++\e[0m\e[42;32m\r
+\e[0m\e[0mSeg:5125       Size:256        Owner:0x1c0e\r
+\e[45;35m++++\e[0m\e[42;32m\r
+\e[0m\e[0mSeg:5225       Size:256        Owner:0x1c10\r
+\e[45;35m+++++\e[0m\e[42;32m\r
+\e[0m\e[0mSeg:5325       Size:256        Owner:0x1c12\r
+\e[45;35m++++\e[0m\e[42;32m\r
+\e[0m\e[0mSeg:5425       Size:256        Owner:0x1c14\r
+\e[45;35m++++\e[0m\e[42;32m\r
+\e[0m\e[0mSeg:5525       Size:256        Owner:0x1c16\r
+\e[45;35m++++\e[0m\e[42;32m\r
+\e[0m\e[0mSeg:5625       Size:256        Owner:0x1c18\r
+\e[45;35m++++\e[0m\e[42;32m\r
+\e[0m\e[0mSeg:5725       Size:256        Owner:0x1c1a\r
+\e[45;35m+++++\e[0m\e[42;32m\r
+\e[0m\e[0mSeg:5825       Size:256        Owner:0x1c1c\r
+\e[45;35m++++\e[0m\e[42;32m\r
+\e[0m\e[0mSeg:5925       Size:256        Owner:0x1c1e\r
+\e[45;35m++++\e[0m\e[42;32m\r
+\e[0m\e[0mSeg:5a25       Size:256        Owner:0x1c20\r
+\e[45;35m++++\e[0m\e[42;32m\r
+\e[0m\e[0mSeg:5b25       Size:256        Owner:0x1c22\r
+\e[45;35m++++\e[0m\e[42;32m\r
+\e[0m\e[0mSeg:5c25       Size:256        Owner:0x1c24\r
+\e[45;35m+++++\e[0m\e[42;32m\r
+\e[0m\e[0mSeg:5d25       Size:256        Owner:0x1c26\r
+\e[45;35m++++\e[0m\e[42;32m\r
+\e[0m\e[0mSeg:5e25       Size:256        Owner:0x1c28\r
+\e[45;35m++++\e[0m\e[42;32m\r
+\e[0m\e[0mSeg:5f25       Size:256        Owner:0x1c2a\r
+\e[45;35m++++\e[0m\e[42;32m\r
+\e[0m\e[0mSeg:6025       Size:256        Owner:0x1c2c\r
+\e[45;35m++++\e[0m\e[42;32m\r
+\e[0m\e[0mSeg:6125       Size:256        Owner:0x1c2e\r
+\e[45;35m+++++\e[0m\e[42;32m\r
+\e[0m\e[0mSeg:6225       Size:256        Owner:0x1c30\r
+\e[45;35m++++\e[0m\e[42;32m\r
+\e[0m\e[0mSeg:6325       Size:256        Owner:0x1c32\r
+\e[45;35m++++\e[0m\e[42;32m\r
+\e[0m\e[0mSeg:6425       Size:256        Owner:0x1c34\r
+\e[45;35m++++\e[0m\e[42;32m\r
+\e[0m\e[0mSeg:6525       Size:256        Owner:0x1c36\r
+\e[45;35m++++\e[0m\e[42;32m\r
+\e[0m\e[0mSeg:6625       Size:256        Owner:0x1c38\r
+\e[45;35m+++++\e[0m\e[42;32m\r
+\e[0m\e[0mSeg:6725       Size:256        Owner:0x1c3a\r
+\e[45;35m++++\e[0m\e[42;32m\r
+\e[0m\e[0mSeg:6825       Size:256        Owner:0x1c3c\r
+\e[45;35m++++\e[0m\e[42;32m\r
+\e[0m\e[0mSeg:6925       Size:256        Owner:0x1c3e\r
+\e[45;35m++++\e[0m\e[42;32m\r
+\e[0m\e[0mSeg:6a25       Size:256        Owner:0x1c40\r
+\e[45;35m++++\e[0m\e[42;32m\r
+\e[0m\e[0mSeg:6b25       Size:256        Owner:0x1c42\r
+\e[45;35m+++++\e[0m\e[42;32m\r
+\e[0m\e[0mSeg:6c25       Size:256        Owner:0x1c44\r
+\e[45;35m++++\e[0m\e[42;32m\r
+\e[0m\e[0mSeg:6d25       Size:256        Owner:0x1c46\r
+\e[45;35m++++\e[0m\e[42;32m\r
+\e[0m\e[0mSeg:6e25       Size:256        Owner:0x1c48\r
+\e[45;35m++++\e[0m\e[42;32m\r
+\e[0m\e[0mSeg:6f25       Size:256        Owner:0x1c4a\r
+\e[45;35m++++\e[0m\e[42;32m\r
+\e[0m\e[0mSeg:7025       Size:256        Owner:0x1c4c\r
+\e[45;35m+++++\e[0m\e[42;32m\r
+\e[0m\e[0mSeg:7125       Size:256        Owner:0x1c4e\r
+\e[45;35m++++\e[0m\e[42;32m\r
+\e[0m\e[0mSeg:7225       Size:256        Owner:0x1c50\r
+\e[45;35m++++\e[0m\e[42;32m\r
+\e[0m\e[0mSeg:7325       Size:256        Owner:0x1c52\r
+\e[45;35m++++\e[0m\e[42;32m\r
+\e[0m\e[0mSeg:7425       Size:256        Owner:0x1c54\r
+\e[45;35m++++\e[0m\e[42;32m\r
+\e[0m\e[0mSeg:7525       Size:256        Owner:0x1c56\r
+\e[45;35m+++++\e[0m\e[42;32m\r
+\e[0m\e[0mSeg:7625       Size:256        Owner:0x1c58\r
+\e[45;35m++++\e[0m\e[42;32m\r
+\e[0m\e[0mSeg:7725       Size:256        Owner:0x1c5a\r
+\e[45;35m++++\e[0m\e[42;32m\r
+\e[0m\e[0mSeg:7825       Size:256        Owner:0x1c5c\r
+\e[45;35m++++\e[0m\e[42;32m\r
+\e[0m\e[0mSeg:7925       Size:256        Owner:0x1c5e\r
+\e[45;35m++++\e[0m\e[42;32m\r
+\e[0m\e[0mSeg:7a25       Size:256        Owner:0x1c60\r
+\e[45;35m+++++\e[0m\e[42;32m\r
+\e[0m\e[0mSeg:7b25       Size:256        Owner:0x1c62\r
+\e[45;35m++++\e[0m\e[42;32m\r
+\e[0m\e[0mSeg:7c25       Size:256        Owner:0x1c64\r
+\e[45;35m++++\e[0m\e[42;32m\r
+\e[0m\e[0mSeg:7d25       Size:256        Owner:0x1c66\r
+\e[45;35m++++\e[0m\e[42;32m\r
+\e[0m\e[0mSeg:7e25       Size:256        Owner:0x1c68\r
+\e[45;35m++++\e[0m\e[42;32m\r
+\e[0m\e[0mSeg:7f25       Size:256        Owner:0x1c6a\r
+\e[45;35m+++++\e[0m\e[42;32m\r
+\e[0m\e[0mSeg:8025       Size:256        Owner:0x1c6c\r
+\e[45;35m++++\e[0m\e[42;32m\r
+\e[0m\e[0mSeg:8125       Size:256        Owner:0x1c6e\r
+\e[45;35m++++\e[0m\e[42;32m\r
+\e[0m\e[0mSeg:8225       Size:256        Owner:0x1c70\r
+\e[45;35m++++\e[0m\e[42;32m\r
+\e[0m\e[0mSeg:8325       Size:256        Owner:0x1c72\r
+\e[45;35m++++\e[0m\e[42;32m\r
+\e[0m\e[0mSeg:8425       Size:256        Owner:0x1c74\r
+\e[45;35m+++++\e[0m\e[42;32m\r
+\e[0m\e[0mSeg:8525       Size:256        Owner:0x1c76\r
+\e[45;35m++++\e[0m\e[42;32m\r
+\e[0m\e[0mSeg:8625       Size:256        Owner:0x1c78\r
+\e[45;35m++++\e[0m\e[42;32m\r
+\e[0m\e[0mSeg:8725       Size:256        Owner:0x1c7a\r
+\e[45;35m++++\e[0m\e[42;32m\r
+\e[0m\e[0mSeg:8825       Size:256        Owner:0x1c7c\r
+\e[45;35m++++\e[0m\e[42;32m\r
+\e[0m\e[0mSeg:8925       Size:273        Owner:0x1b88\r
+\e[44;34m+++++\e[0m\e[42;32m\r
+\e[0m\e[0mSeg:9d64       Size:25243      Owner:0x0\r
+\e[41;31m+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++\e[0m
\ No newline at end of file
diff --git a/EXMMTEST.L16 b/EXMMTEST.L16
new file mode 100755 (executable)
index 0000000..5c2f957
--- /dev/null
@@ -0,0 +1,472 @@
+MM_GetPtr\r
+       baseptr=1430:1db4       useptr=1430:1db4\r
+       *baseptr=1430:0000      *useptr=1430:0000\r
+       &baseptr=1430:ec62      &useptr=1430:1e20\r
+MM_GetPtr\r
+       baseptr=1430:1ba6       useptr=1430:1ba6\r
+       *baseptr=1430:0000      *useptr=1430:0000\r
+       &baseptr=1430:ec48      &useptr=1430:1e30\r
+MM_GetPtr\r
+       baseptr=1430:1ba8       useptr=1430:1ba8\r
+       *baseptr=1430:0000      *useptr=1430:0000\r
+       &baseptr=1430:ec48      &useptr=1430:1e40\r
+MM_GetPtr\r
+       baseptr=1430:1baa       useptr=1430:1baa\r
+       *baseptr=1430:0000      *useptr=1430:0000\r
+       &baseptr=1430:ec48      &useptr=1430:1e50\r
+MM_GetPtr\r
+       baseptr=1430:1bac       useptr=1430:1bac\r
+       *baseptr=1430:0000      *useptr=1430:0000\r
+       &baseptr=1430:ec48      &useptr=1430:1e60\r
+MM_GetPtr\r
+       baseptr=1430:1bae       useptr=1430:1bae\r
+       *baseptr=1430:0000      *useptr=1430:0000\r
+       &baseptr=1430:ec48      &useptr=1430:1e70\r
+MM_GetPtr\r
+       baseptr=1430:1bb0       useptr=1430:1bb0\r
+       *baseptr=1430:0000      *useptr=1430:0000\r
+       &baseptr=1430:ec48      &useptr=1430:1e80\r
+MM_GetPtr\r
+       baseptr=1430:1bb2       useptr=1430:1bb2\r
+       *baseptr=1430:0000      *useptr=1430:0000\r
+       &baseptr=1430:ec48      &useptr=1430:1e90\r
+MM_GetPtr\r
+       baseptr=1430:1bb4       useptr=1430:1bb4\r
+       *baseptr=1430:0000      *useptr=1430:0000\r
+       &baseptr=1430:ec48      &useptr=1430:1ea0\r
+MM_GetPtr\r
+       baseptr=1430:1bb6       useptr=1430:1bb6\r
+       *baseptr=1430:0000      *useptr=1430:0000\r
+       &baseptr=1430:ec48      &useptr=1430:1eb0\r
+MM_GetPtr\r
+       baseptr=1430:1bb8       useptr=1430:1bb8\r
+       *baseptr=1430:0000      *useptr=1430:0000\r
+       &baseptr=1430:ec48      &useptr=1430:1ec0\r
+MM_GetPtr\r
+       baseptr=1430:1bba       useptr=1430:1bba\r
+       *baseptr=1430:0000      *useptr=1430:0000\r
+       &baseptr=1430:ec48      &useptr=1430:1ed0\r
+MM_GetPtr\r
+       baseptr=1430:1bbc       useptr=1430:1bbc\r
+       *baseptr=1430:0000      *useptr=1430:0000\r
+       &baseptr=1430:ec48      &useptr=1430:1ee0\r
+MM_GetPtr\r
+       baseptr=1430:1bbe       useptr=1430:1bbe\r
+       *baseptr=1430:0000      *useptr=1430:0000\r
+       &baseptr=1430:ec48      &useptr=1430:1ef0\r
+MM_GetPtr\r
+       baseptr=1430:1bc0       useptr=1430:1bc0\r
+       *baseptr=1430:0000      *useptr=1430:0000\r
+       &baseptr=1430:ec48      &useptr=1430:1f00\r
+MM_GetPtr\r
+       baseptr=1430:1bc2       useptr=1430:1bc2\r
+       *baseptr=1430:0000      *useptr=1430:0000\r
+       &baseptr=1430:ec48      &useptr=1430:1f10\r
+MM_GetPtr\r
+       baseptr=1430:1bc4       useptr=1430:1bc4\r
+       *baseptr=1430:0000      *useptr=1430:0000\r
+       &baseptr=1430:ec48      &useptr=1430:1f20\r
+MM_GetPtr\r
+       baseptr=1430:1bc6       useptr=1430:1bc6\r
+       *baseptr=1430:0000      *useptr=1430:0000\r
+       &baseptr=1430:ec48      &useptr=1430:1f30\r
+MM_GetPtr\r
+       baseptr=1430:1bc8       useptr=1430:1bc8\r
+       *baseptr=1430:0000      *useptr=1430:0000\r
+       &baseptr=1430:ec48      &useptr=1430:1f40\r
+MM_GetPtr\r
+       baseptr=1430:1bca       useptr=1430:1bca\r
+       *baseptr=1430:0000      *useptr=1430:0000\r
+       &baseptr=1430:ec48      &useptr=1430:1f50\r
+MM_GetPtr\r
+       baseptr=1430:1bcc       useptr=1430:1bcc\r
+       *baseptr=1430:0000      *useptr=1430:0000\r
+       &baseptr=1430:ec48      &useptr=1430:1f60\r
+MM_GetPtr\r
+       baseptr=1430:1bce       useptr=1430:1bce\r
+       *baseptr=1430:0000      *useptr=1430:0000\r
+       &baseptr=1430:ec48      &useptr=1430:1f70\r
+MM_GetPtr\r
+       baseptr=1430:1bd0       useptr=1430:1bd0\r
+       *baseptr=1430:0000      *useptr=1430:0000\r
+       &baseptr=1430:ec48      &useptr=1430:1f80\r
+MM_GetPtr\r
+       baseptr=1430:1bd2       useptr=1430:1bd2\r
+       *baseptr=1430:0000      *useptr=1430:0000\r
+       &baseptr=1430:ec48      &useptr=1430:1f90\r
+MM_GetPtr\r
+       baseptr=1430:1bd4       useptr=1430:1bd4\r
+       *baseptr=1430:0000      *useptr=1430:0000\r
+       &baseptr=1430:ec48      &useptr=1430:1fa0\r
+MM_GetPtr\r
+       baseptr=1430:1bd6       useptr=1430:1bd6\r
+       *baseptr=1430:0000      *useptr=1430:0000\r
+       &baseptr=1430:ec48      &useptr=1430:1fb0\r
+MM_GetPtr\r
+       baseptr=1430:1bd8       useptr=1430:1bd8\r
+       *baseptr=1430:0000      *useptr=1430:0000\r
+       &baseptr=1430:ec48      &useptr=1430:1fc0\r
+MM_GetPtr\r
+       baseptr=1430:1bda       useptr=1430:1bda\r
+       *baseptr=1430:0000      *useptr=1430:0000\r
+       &baseptr=1430:ec48      &useptr=1430:1fd0\r
+MM_GetPtr\r
+       baseptr=1430:1bdc       useptr=1430:1bdc\r
+       *baseptr=1430:0000      *useptr=1430:0000\r
+       &baseptr=1430:ec48      &useptr=1430:1fe0\r
+MM_GetPtr\r
+       baseptr=1430:1bde       useptr=1430:1bde\r
+       *baseptr=1430:0000      *useptr=1430:0000\r
+       &baseptr=1430:ec48      &useptr=1430:1ff0\r
+MM_GetPtr\r
+       baseptr=1430:1be0       useptr=1430:1be0\r
+       *baseptr=1430:0000      *useptr=1430:0000\r
+       &baseptr=1430:ec48      &useptr=1430:2000\r
+MM_GetPtr\r
+       baseptr=1430:1be2       useptr=1430:1be2\r
+       *baseptr=1430:0000      *useptr=1430:0000\r
+       &baseptr=1430:ec48      &useptr=1430:2010\r
+MM_GetPtr\r
+       baseptr=1430:1be4       useptr=1430:1be4\r
+       *baseptr=1430:0000      *useptr=1430:0000\r
+       &baseptr=1430:ec48      &useptr=1430:2020\r
+MM_GetPtr\r
+       baseptr=1430:1be6       useptr=1430:1be6\r
+       *baseptr=1430:0000      *useptr=1430:0000\r
+       &baseptr=1430:ec48      &useptr=1430:2030\r
+MM_GetPtr\r
+       baseptr=1430:1be8       useptr=1430:1be8\r
+       *baseptr=1430:0000      *useptr=1430:0000\r
+       &baseptr=1430:ec48      &useptr=1430:2040\r
+MM_GetPtr\r
+       baseptr=1430:1bea       useptr=1430:1bea\r
+       *baseptr=1430:0000      *useptr=1430:0000\r
+       &baseptr=1430:ec48      &useptr=1430:2050\r
+MM_GetPtr\r
+       baseptr=1430:1bec       useptr=1430:1bec\r
+       *baseptr=1430:0000      *useptr=1430:0000\r
+       &baseptr=1430:ec48      &useptr=1430:2060\r
+MM_GetPtr\r
+       baseptr=1430:1bee       useptr=1430:1bee\r
+       *baseptr=1430:0000      *useptr=1430:0000\r
+       &baseptr=1430:ec48      &useptr=1430:2070\r
+MM_GetPtr\r
+       baseptr=1430:1bf0       useptr=1430:1bf0\r
+       *baseptr=1430:0000      *useptr=1430:0000\r
+       &baseptr=1430:ec48      &useptr=1430:2080\r
+MM_GetPtr\r
+       baseptr=1430:1bf2       useptr=1430:1bf2\r
+       *baseptr=1430:0000      *useptr=1430:0000\r
+       &baseptr=1430:ec48      &useptr=1430:2090\r
+MM_GetPtr\r
+       baseptr=1430:1bf4       useptr=1430:1bf4\r
+       *baseptr=1430:0000      *useptr=1430:0000\r
+       &baseptr=1430:ec48      &useptr=1430:20a0\r
+MM_GetPtr\r
+       baseptr=1430:1bf6       useptr=1430:1bf6\r
+       *baseptr=1430:0000      *useptr=1430:0000\r
+       &baseptr=1430:ec48      &useptr=1430:20b0\r
+MM_GetPtr\r
+       baseptr=1430:1bf8       useptr=1430:1bf8\r
+       *baseptr=1430:0000      *useptr=1430:0000\r
+       &baseptr=1430:ec48      &useptr=1430:20c0\r
+MM_GetPtr\r
+       baseptr=1430:1bfa       useptr=1430:1bfa\r
+       *baseptr=1430:0000      *useptr=1430:0000\r
+       &baseptr=1430:ec48      &useptr=1430:20d0\r
+MM_GetPtr\r
+       baseptr=1430:1bfc       useptr=1430:1bfc\r
+       *baseptr=1430:0000      *useptr=1430:0000\r
+       &baseptr=1430:ec48      &useptr=1430:20e0\r
+MM_GetPtr\r
+       baseptr=1430:1bfe       useptr=1430:1bfe\r
+       *baseptr=1430:0000      *useptr=1430:0000\r
+       &baseptr=1430:ec48      &useptr=1430:20f0\r
+MM_GetPtr\r
+       baseptr=1430:1c00       useptr=1430:1c00\r
+       *baseptr=1430:0000      *useptr=1430:0000\r
+       &baseptr=1430:ec48      &useptr=1430:2100\r
+MM_GetPtr\r
+       baseptr=1430:1c02       useptr=1430:1c02\r
+       *baseptr=1430:0000      *useptr=1430:0000\r
+       &baseptr=1430:ec48      &useptr=1430:2110\r
+MM_GetPtr\r
+       baseptr=1430:1c04       useptr=1430:1c04\r
+       *baseptr=1430:0000      *useptr=1430:0000\r
+       &baseptr=1430:ec48      &useptr=1430:2120\r
+MM_GetPtr\r
+       baseptr=1430:1c06       useptr=1430:1c06\r
+       *baseptr=1430:0000      *useptr=1430:0000\r
+       &baseptr=1430:ec48      &useptr=1430:2130\r
+MM_GetPtr\r
+       baseptr=1430:1c08       useptr=1430:1c08\r
+       *baseptr=1430:0000      *useptr=1430:0000\r
+       &baseptr=1430:ec48      &useptr=1430:2140\r
+MM_GetPtr\r
+       baseptr=1430:1c0a       useptr=1430:1c0a\r
+       *baseptr=1430:0000      *useptr=1430:0000\r
+       &baseptr=1430:ec48      &useptr=1430:2150\r
+MM_GetPtr\r
+       baseptr=1430:1c0c       useptr=1430:1c0c\r
+       *baseptr=1430:0000      *useptr=1430:0000\r
+       &baseptr=1430:ec48      &useptr=1430:2160\r
+MM_GetPtr\r
+       baseptr=1430:1c0e       useptr=1430:1c0e\r
+       *baseptr=1430:0000      *useptr=1430:0000\r
+       &baseptr=1430:ec48      &useptr=1430:2170\r
+MM_GetPtr\r
+       baseptr=1430:1c10       useptr=1430:1c10\r
+       *baseptr=1430:0000      *useptr=1430:0000\r
+       &baseptr=1430:ec48      &useptr=1430:2180\r
+MM_GetPtr\r
+       baseptr=1430:1c12       useptr=1430:1c12\r
+       *baseptr=1430:0000      *useptr=1430:0000\r
+       &baseptr=1430:ec48      &useptr=1430:2190\r
+MM_GetPtr\r
+       baseptr=1430:1c14       useptr=1430:1c14\r
+       *baseptr=1430:0000      *useptr=1430:0000\r
+       &baseptr=1430:ec48      &useptr=1430:21a0\r
+MM_GetPtr\r
+       baseptr=1430:1c16       useptr=1430:1c16\r
+       *baseptr=1430:0000      *useptr=1430:0000\r
+       &baseptr=1430:ec48      &useptr=1430:21b0\r
+MM_GetPtr\r
+       baseptr=1430:1c18       useptr=1430:1c18\r
+       *baseptr=1430:0000      *useptr=1430:0000\r
+       &baseptr=1430:ec48      &useptr=1430:21c0\r
+MM_GetPtr\r
+       baseptr=1430:1c1a       useptr=1430:1c1a\r
+       *baseptr=1430:0000      *useptr=1430:0000\r
+       &baseptr=1430:ec48      &useptr=1430:21d0\r
+MM_GetPtr\r
+       baseptr=1430:1c1c       useptr=1430:1c1c\r
+       *baseptr=1430:0000      *useptr=1430:0000\r
+       &baseptr=1430:ec48      &useptr=1430:21e0\r
+MM_GetPtr\r
+       baseptr=1430:1c1e       useptr=1430:1c1e\r
+       *baseptr=1430:0000      *useptr=1430:0000\r
+       &baseptr=1430:ec48      &useptr=1430:21f0\r
+MM_GetPtr\r
+       baseptr=1430:1c20       useptr=1430:1c20\r
+       *baseptr=1430:0000      *useptr=1430:0000\r
+       &baseptr=1430:ec48      &useptr=1430:2200\r
+MM_GetPtr\r
+       baseptr=1430:1c22       useptr=1430:1c22\r
+       *baseptr=1430:0000      *useptr=1430:0000\r
+       &baseptr=1430:ec48      &useptr=1430:2210\r
+MM_GetPtr\r
+       baseptr=1430:1c24       useptr=1430:1c24\r
+       *baseptr=1430:0000      *useptr=1430:0000\r
+       &baseptr=1430:ec48      &useptr=1430:2220\r
+MM_GetPtr\r
+       baseptr=1430:1c26       useptr=1430:1c26\r
+       *baseptr=1430:0000      *useptr=1430:0000\r
+       &baseptr=1430:ec48      &useptr=1430:2230\r
+MM_GetPtr\r
+       baseptr=1430:1c28       useptr=1430:1c28\r
+       *baseptr=1430:0000      *useptr=1430:0000\r
+       &baseptr=1430:ec48      &useptr=1430:2240\r
+MM_GetPtr\r
+       baseptr=1430:1c2a       useptr=1430:1c2a\r
+       *baseptr=1430:0000      *useptr=1430:0000\r
+       &baseptr=1430:ec48      &useptr=1430:2250\r
+MM_GetPtr\r
+       baseptr=1430:1c2c       useptr=1430:1c2c\r
+       *baseptr=1430:0000      *useptr=1430:0000\r
+       &baseptr=1430:ec48      &useptr=1430:2260\r
+MM_GetPtr\r
+       baseptr=1430:1c2e       useptr=1430:1c2e\r
+       *baseptr=1430:0000      *useptr=1430:0000\r
+       &baseptr=1430:ec48      &useptr=1430:2270\r
+MM_GetPtr\r
+       baseptr=1430:1c30       useptr=1430:1c30\r
+       *baseptr=1430:0000      *useptr=1430:0000\r
+       &baseptr=1430:ec48      &useptr=1430:2280\r
+MM_GetPtr\r
+       baseptr=1430:1c32       useptr=1430:1c32\r
+       *baseptr=1430:0000      *useptr=1430:0000\r
+       &baseptr=1430:ec48      &useptr=1430:2290\r
+MM_GetPtr\r
+       baseptr=1430:1c34       useptr=1430:1c34\r
+       *baseptr=1430:0000      *useptr=1430:0000\r
+       &baseptr=1430:ec48      &useptr=1430:22a0\r
+MM_GetPtr\r
+       baseptr=1430:1c36       useptr=1430:1c36\r
+       *baseptr=1430:0000      *useptr=1430:0000\r
+       &baseptr=1430:ec48      &useptr=1430:22b0\r
+MM_GetPtr\r
+       baseptr=1430:1c38       useptr=1430:1c38\r
+       *baseptr=1430:0000      *useptr=1430:0000\r
+       &baseptr=1430:ec48      &useptr=1430:22c0\r
+MM_GetPtr\r
+       baseptr=1430:1c3a       useptr=1430:1c3a\r
+       *baseptr=1430:0000      *useptr=1430:0000\r
+       &baseptr=1430:ec48      &useptr=1430:22d0\r
+MM_GetPtr\r
+       baseptr=1430:1c3c       useptr=1430:1c3c\r
+       *baseptr=1430:0000      *useptr=1430:0000\r
+       &baseptr=1430:ec48      &useptr=1430:22e0\r
+MM_GetPtr\r
+       baseptr=1430:1c3e       useptr=1430:1c3e\r
+       *baseptr=1430:0000      *useptr=1430:0000\r
+       &baseptr=1430:ec48      &useptr=1430:22f0\r
+MM_GetPtr\r
+       baseptr=1430:1c40       useptr=1430:1c40\r
+       *baseptr=1430:0000      *useptr=1430:0000\r
+       &baseptr=1430:ec48      &useptr=1430:2300\r
+MM_GetPtr\r
+       baseptr=1430:1c42       useptr=1430:1c42\r
+       *baseptr=1430:0000      *useptr=1430:0000\r
+       &baseptr=1430:ec48      &useptr=1430:2310\r
+MM_GetPtr\r
+       baseptr=1430:1c44       useptr=1430:1c44\r
+       *baseptr=1430:0000      *useptr=1430:0000\r
+       &baseptr=1430:ec48      &useptr=1430:2320\r
+MM_GetPtr\r
+       baseptr=1430:1c46       useptr=1430:1c46\r
+       *baseptr=1430:0000      *useptr=1430:0000\r
+       &baseptr=1430:ec48      &useptr=1430:2330\r
+MM_GetPtr\r
+       baseptr=1430:1c48       useptr=1430:1c48\r
+       *baseptr=1430:0000      *useptr=1430:0000\r
+       &baseptr=1430:ec48      &useptr=1430:2340\r
+MM_GetPtr\r
+       baseptr=1430:1c4a       useptr=1430:1c4a\r
+       *baseptr=1430:0000      *useptr=1430:0000\r
+       &baseptr=1430:ec48      &useptr=1430:2350\r
+MM_GetPtr\r
+       baseptr=1430:1c4c       useptr=1430:1c4c\r
+       *baseptr=1430:0000      *useptr=1430:0000\r
+       &baseptr=1430:ec48      &useptr=1430:2360\r
+MM_GetPtr\r
+       baseptr=1430:1c4e       useptr=1430:1c4e\r
+       *baseptr=1430:0000      *useptr=1430:0000\r
+       &baseptr=1430:ec48      &useptr=1430:2370\r
+MM_GetPtr\r
+       baseptr=1430:1c50       useptr=1430:1c50\r
+       *baseptr=1430:0000      *useptr=1430:0000\r
+       &baseptr=1430:ec48      &useptr=1430:2380\r
+MM_GetPtr\r
+       baseptr=1430:1c52       useptr=1430:1c52\r
+       *baseptr=1430:0000      *useptr=1430:0000\r
+       &baseptr=1430:ec48      &useptr=1430:2390\r
+MM_GetPtr\r
+       baseptr=1430:1c54       useptr=1430:1c54\r
+       *baseptr=1430:0000      *useptr=1430:0000\r
+       &baseptr=1430:ec48      &useptr=1430:23a0\r
+MM_GetPtr\r
+       baseptr=1430:1c56       useptr=1430:1c56\r
+       *baseptr=1430:0000      *useptr=1430:0000\r
+       &baseptr=1430:ec48      &useptr=1430:23b0\r
+MM_GetPtr\r
+       baseptr=1430:1c58       useptr=1430:1c58\r
+       *baseptr=1430:0000      *useptr=1430:0000\r
+       &baseptr=1430:ec48      &useptr=1430:23c0\r
+MM_GetPtr\r
+       baseptr=1430:1c5a       useptr=1430:1c5a\r
+       *baseptr=1430:0000      *useptr=1430:0000\r
+       &baseptr=1430:ec48      &useptr=1430:23d0\r
+MM_GetPtr\r
+       baseptr=1430:1c5c       useptr=1430:1c5c\r
+       *baseptr=1430:0000      *useptr=1430:0000\r
+       &baseptr=1430:ec48      &useptr=1430:23e0\r
+MM_GetPtr\r
+       baseptr=1430:1c5e       useptr=1430:1c5e\r
+       *baseptr=1430:0000      *useptr=1430:0000\r
+       &baseptr=1430:ec48      &useptr=1430:23f0\r
+MM_GetPtr\r
+       baseptr=1430:1c60       useptr=1430:1c60\r
+       *baseptr=1430:0000      *useptr=1430:0000\r
+       &baseptr=1430:ec48      &useptr=1430:2400\r
+MM_GetPtr\r
+       baseptr=1430:1c62       useptr=1430:1c62\r
+       *baseptr=1430:0000      *useptr=1430:0000\r
+       &baseptr=1430:ec48      &useptr=1430:2410\r
+MM_GetPtr\r
+       baseptr=1430:1c64       useptr=1430:1c64\r
+       *baseptr=1430:0000      *useptr=1430:0000\r
+       &baseptr=1430:ec48      &useptr=1430:2420\r
+MM_GetPtr\r
+       baseptr=1430:1c66       useptr=1430:1c66\r
+       *baseptr=1430:0000      *useptr=1430:0000\r
+       &baseptr=1430:ec48      &useptr=1430:2430\r
+MM_GetPtr\r
+       baseptr=1430:1c68       useptr=1430:1c68\r
+       *baseptr=1430:0000      *useptr=1430:0000\r
+       &baseptr=1430:ec48      &useptr=1430:2440\r
+MM_GetPtr\r
+       baseptr=1430:1c6a       useptr=1430:1c6a\r
+       *baseptr=1430:0000      *useptr=1430:0000\r
+       &baseptr=1430:ec48      &useptr=1430:2450\r
+MM_GetPtr\r
+       baseptr=1430:1c6c       useptr=1430:1c6c\r
+       *baseptr=1430:0000      *useptr=1430:0000\r
+       &baseptr=1430:ec48      &useptr=1430:2460\r
+-------------------------------------------------------------------------------\r
+&main()=       1430:6cc1\r
+buffer:\r
+       1430:0000       &1430:1b78\r
+            0000       &     1b78\r
+-------------------------------------------------------------------------------\r
+press any key to continue!\r
+======================================load======================================\r
+MM_GetPtr\r
+       baseptr=1430:1b78       useptr=1430:1b78\r
+       *baseptr=1430:0000      *useptr=1430:0000\r
+       &baseptr=1430:ec64      &useptr=1430:2470\r
+-------------------------------------------------------------------------------\r
+&main()=       1430:6cc1\r
+buffer:\r
+       1430:893b       &1430:1b78\r
+            893b       &     1b78\r
+-------------------------------------------------------------------------------\r
+\r
+yay!\r
+======================================read======================================\r
+-------------------------------------------------------------------------------\r
+&main()=       1430:6cc1\r
+buffer:\r
+       1430:893b       &1430:1b78\r
+            893b       &     1b78\r
+-------------------------------------------------------------------------------\r
+\r
+yay!\r
+========================================\r
+               DebugMemory_\r
+========================================\r
+Memory Usage\r
+------------\r
+Total:         578k\r
+Free:          170k\r
+With purge:    570k\r
+------------\r
+MMDUMP.16 created.\r
+========================================\r
+               MM_Report_\r
+========================================\r
+       ÉLIMEMS 1\r
+       ÇÄEMM v4.0 available\r
+       ÇÄtotalEMSpages:        4032    freeEMSpages:   3939\r
+       ÇÄEMSPageFrame: e000\r
+       ÓÄEMSmem:       64536576\r
+       ÉXMS    1\r
+       ÇÄXMS v3.0 available\r
+       ÇÄXMSDriver:    c83f:0010\r
+       ÇÄXMSHandle:    0800\r
+       ÓÄXMSmem:       2097152\r
+       ÉConv.  1\r
+       ÓÄTotal:        578k    Free:   170k    With purge:570k\r
+nearheap:      3884            farheap:        588812\r
+========================================\r
+near=  1430:eec8 far=  2431:009c\r
+&near= 1430:1dc0 &far= 1430:1dbc\r
+bigb=  1430:0000 &bigb=1430:1b78 \r
+========================================\r
+\r
+_memavl():                     4404\r
+HC_farcoreleft():                      962022\r
+HC_GetNearFreeSize():          4406\r
+HC_GetFarFreeSize():                   40134\r
+Project 16 exmmtest.exe. This is just a test file!\r
+version Feb 22 2017 12:35:11\r
+debugmm: 1     \r
diff --git a/HEAP.16W b/HEAP.16W
new file mode 100755 (executable)
index 0000000..e4332ea
--- /dev/null
+++ b/HEAP.16W
@@ -0,0 +1,47 @@
+\r
+       == default ==\r
+\r
+  USED block at 24200016 of size 26\r
+  USED block at 24200030 of size 26\r
+  FREE block at 2420004a of size 38914\r
+  USED block at 2420984c of size 136\r
+  USED block at 242098d4 of size 20\r
+  FREE block at 242098e8 of size 7972\r
+OK - end of heap\r
+\r
+       == near ==\r
+\r
+  USED block at 141fece6 of size 12\r
+  USED block at 141fecf2 of size 332\r
+  USED block at 141fee3e of size 52\r
+  USED block at 141fee72 of size 20\r
+  USED block at 141fee86 of size 20\r
+  USED block at 141fee9a of size 20\r
+  USED block at 141feeae of size 20\r
+  USED block at 141feec2 of size 20\r
+  USED block at 141feed6 of size 4390\r
+OK - end of heap\r
+\r
+       == far ==\r
+\r
+  USED block at 24200016 of size 26\r
+  USED block at 24200030 of size 26\r
+  USED block at 2420004a of size 38914\r
+  USED block at 2420984c of size 136\r
+  USED block at 242098d4 of size 20\r
+  USED block at 242098e8 of size 7972\r
+OK - end of heap\r
+\r
+Memory Type         Total      Used       Free\r
+----------------  --------   --------   --------\r
+Default                   47094        208       46886\r
+Near              4886         496       4390\r
+Far               47094        208       46886\r
+----------------  --------   --------   --------\r
+HC_coreleft = 4388\r
+HC_farcoreleft = 458752\r
+HC_GetFreeSize = 46886\r
+HC_GetNearFreeSize = 4390\r
+HC_GetFarFreeSize = 46886\r
+memavl = 4388\r
+stackavail = 31606\r
diff --git a/MEMINFO.16B b/MEMINFO.16B
new file mode 100755 (executable)
index 0000000..e69de29
diff --git a/MEMINFO.16W b/MEMINFO.16W
new file mode 100755 (executable)
index 0000000..e69de29
diff --git a/MMDUMP.16B b/MMDUMP.16B
new file mode 100755 (executable)
index 0000000..2cb68d4
Binary files /dev/null and b/MMDUMP.16B differ
diff --git a/MMDUMP.16W b/MMDUMP.16W
new file mode 100755 (executable)
index 0000000..4c1c8fe
Binary files /dev/null and b/MMDUMP.16W differ
index d5f755b1a57612117f50e7a6dd2fd91e8f5e1765..5376f8fc10e1793aa6b639ba05e3b9959654548e 100755 (executable)
Binary files a/bcexmm.exe and b/bcexmm.exe differ
index 94599dafebf503662448c08e98bbcb74a2f3b46a..b6efd4ebae120ef0ee01d204c8d6db63d16765fc 100755 (executable)
@@ -22,6 +22,7 @@
 /*\r
        exmm test\r
 */\r
+#include <malloc.h>            // for _memavl()\r
 #include "src/lib/16_head.h"\r
 #include "src/lib/16_tail.h"\r
 #include "src/lib/16_pm.h"\r
 #include "src/lib/16_mm.h"\r
 #include "src/lib/16_hc.h"\r
 //#include "src/lib/16_vl.h"\r
+#include "src/lib/16_dbg.h"\r
+\r
 #pragma hdrstop\r
 \r
 #pragma warn -pro\r
 #pragma warn -use\r
 \r
 //file load or read definition\r
+#define FILEREADLOAD\r
 #define FILEREAD\r
-#define EXMMVERBOSE\r
-//#ifdef __BORLANDC__\r
+//#define EXMMVERBOSE\r
+//#define BUFFDUMPPAUSE\r
+//#define EXMMVERBOSE__\r
+//     #define PRINTBBDUMP\r
 #define BUFFDUMP\r
-//#endif\r
 \r
-#define BBUF bigbuffer//gvar.ca.tinf[0]\r
+#define BBUFNAME gvar.ca.tinf[0]//bigbuffer\r
+//#define INITBBUF static memptr BBUFNAME;\r
+#define BBUFPTR        &BBUFNAME\r
+\r
+#ifdef __BORLANDC__\r
+#define BBUF           (memptr *)BBUFPTR//\r
+#define BBUFSTRING     (memptr *)BBUFNAME\r
+#endif\r
+#ifdef __WATCOMC__\r
+#define BBUF           BBUFNAME\r
+#define BBUFSTRING     BBUF\r
+#endif\r
+\r
 \r
 void VGAmodeX(sword vq, boolean cmem, global_game_variables_t *gv)\r
 {\r
        printf("VGAmodeX dummy:\n       %Fp     %Fp     %Fp\n", &vq, &cmem, gv);\r
 }\r
+\r
+//printf("*    %Fp\t", *BBUF);\r
+//printf("*         %04x\t", *BBUF);\r
 #define PRINTBB {\\r
+       printf("-------------------------------------------------------------------------------\n");\\r
        printf("&main()=        %Fp\n", argv[0]);\\r
-       printf("BBUF:\n");\\r
+       printf("buffer:\n");\\r
        printf("        %Fp\t", BBUF);\\r
-       printf("&%Fp\n", &BBUF);\\r
+       printf("&%Fp\n", BBUFPTR);\\r
        printf("             %04x\t", BBUF);\\r
-       printf("&     %04x\n", &BBUF);\\r
+       printf("&     %04x\n", BBUFPTR);\\r
+       printf("-------------------------------------------------------------------------------\n");\\r
 }\r
        //printf("&main()=      %Fp\n", *argv[0]);\r
        //printf("bigbuffer=    %Fp\n", bigbuffer);\r
@@ -86,9 +108,11 @@ void segatesuto()
 void\r
 main(int argc, char *argv[])\r
 {\r
-       byte w=1;\r
+       byte w;\r
        static global_game_variables_t gvar;\r
-       memptr BBUF;\r
+#ifdef INITBBUF\r
+       INITBBUF\r
+#endif\r
 //#ifdef __WATCOMC__\r
 //     __segment sega;\r
 //#endif\r
@@ -100,8 +124,8 @@ main(int argc, char *argv[])
        argc=argc;\r
 #endif\r
        //file name //\r
-       bakapee1 = malloc(64);\r
-       bakapee2 = malloc(64);\r
+       bakapee1 = malloc(24);\r
+       bakapee2 = malloc(24);\r
        //file name //\r
 \r
 #ifdef __16_PM__\r
@@ -110,7 +134,12 @@ main(int argc, char *argv[])
 #endif\r
 #endif\r
 \r
-       //PRINTBB\r
+#ifdef __DEBUG_CA__\r
+       dbg_debugca=1;\r
+#endif\r
+#ifdef PRINTBBDUMP\r
+//0000PRINTBB; printf("press any key to continue!\n"); getch();\r
+#endif\r
        if(argv[1]){ bakapee1 = argv[1];\r
        if(argv[2]) bakapee2 = argv[2]; }\r
        else{\r
@@ -119,63 +148,85 @@ main(int argc, char *argv[])
                bakapee2 = "data/test.map";\r
        }\r
        //printf("main()=%Fp    start MM\n", *argv[0]);\r
-       MM_Startup(&gvar);\r
-       //printf("ok\n");\r
+       MM_Startup(&gvar); //printf("ok\n");\r
 #ifdef __16_PM__\r
 #ifdef __DEBUG_PM__\r
        if(dbg_debugpm>0)\r
        {\r
 #endif\r
                PM_Startup(&gvar); PM_CheckMainMem(&gvar); PM_UnlockMainMem(&gvar);\r
+//0000         printf("PM Started\n"); printf("press any key to continue!\n"); getch();\r
 #ifdef __DEBUG_PM__\r
        }\r
 #endif\r
+#endif\r
+\r
+#ifdef __DEBUG_MM__\r
+       dbg_debugmm=0;\r
 #endif\r
        CA_Startup(&gvar);\r
 //     printf("                done!\n");\r
-       //0000\r
-       PRINTBB; printf("press any key to continue!\n"); getch();\r
+#ifdef PRINTBBDUMP\r
+//0000\r
+PRINTBB; printf("\n\npress any key to continue!\n"); getch();\r
+#endif\r
+#ifdef __DEBUG_MM__\r
+       dbg_debugmm=1;\r
+#endif\r
+\r
+       w=0;\r
+#ifdef FILEREADLOAD\r
 #ifdef FILEREAD\r
-for(w=0;w<2;w++)\r
-{\r
-//     printf("size of big buffer~=%u\n", _bmsize(segu, BBUF));\r
-       if(w>0)\r
+       for(;w<2;w++)\r
        {\r
-               printf("                read\n");\r
-               if(CA_ReadFile(bakapee2, &BBUF, &gvar)) baka=1; else baka=0;\r
-       }\r
+       //      printf("size of big buffer~=%u\n", _bmsize(segu, BBUF));\r
+               if(w>0)\r
+               {\r
+                       printf("======================================read=====================================\n");\r
+                       if(CA_ReadFile(bakapee2, BBUFPTR, &gvar)) baka=1; else baka=0;\r
+                       printf("====================================read end===================================\n");\r
+               }\r
 #endif\r
-       if(w==0)\r
-       {\r
-               printf("                load\n");\r
-               if(CA_LoadFile(bakapee1, &BBUF, &gvar)) baka=1; else baka=0;\r
-       }\r
+               if(w==0)\r
+               {\r
+                       printf("======================================load=====================================\n");\r
+                       if(CA_LoadFile(bakapee1, BBUFPTR, &gvar)) baka=1; else baka=0;\r
+                       printf("====================================load end===================================\n");\r
+               }\r
 //#ifdef __WATCOMC__\r
 //     printf("\nsize of big buffer~=%u\n", _bmsize(sega, BBUF));\r
 //#endif\r
 #ifdef BUFFDUMP\r
-       printf("contents of the buffer\n[\n%s\n]\n", (BBUF));\r
+               printf("contents of the buffer\n[\n%s\n]\n", BBUFSTRING);\r
 #endif// #else\r
-       PRINTBB;\r
-// #endif\r
-       //printf("dark purple = purgable\n");\r
-       //printf("medium blue = non purgable\n");\r
-       //printf("red = locked\n");\r
-//     printf("press any key to continue!\n");\r
-//     DebugMemory_(&gvar, 1);\r
-       if(baka) printf("\nyay!\n");\r
-       else printf("\npoo!\n");\r
-       printf("press any key to continue!\n");\r
-       getch();\r
+#ifdef PRINTBBDUMP\r
+               PRINTBB;\r
+#endif\r
+//endif // BUFFDUMP\r
+\r
+               //printf("dark purple = purgable\n");\r
+               //printf("medium blue = non purgable\n");\r
+               //printf("red = locked\n");\r
+       //      printf("press any key to continue!\n");\r
+       //      DebugMemory_(&gvar, 1);\r
+               if(baka) printf("\nyay!\n");\r
+               else printf("\npoo!\n");\r
+#ifdef BUFFDUMPPAUSE\r
+               printf("press any key to continue!\n"); getch();\r
+#endif\r
 #ifdef FILEREAD\r
-}\r
+       }\r
 #endif\r
+#ifndef BUFFDUMPPAUSE\r
+       printf("press any key to continue!\n"); getch();\r
+#endif\r
+#endif //filereadload\r
        DebugMemory_(&gvar, 1);\r
        MM_DumpData(&gvar);\r
        MM_Report_(&gvar);\r
        //printf("bakapee1=%s\n", bakapee1);\r
        //printf("bakapee2=%s\n", bakapee2);\r
-       MM_FreePtr(&BBUF, &gvar);\r
+       MM_FreePtr(BBUFPTR, &gvar);\r
 #ifdef __16_PM__\r
 #ifdef __DEBUG_PM__\r
        if(dbg_debugpm>0)\r
@@ -196,30 +247,48 @@ for(w=0;w<2;w++)
        printf("bigb=   %Fp ", BBUF);\r
        //printf("bigbr=        %04x", BBUF);\r
        //printf("\n");\r
-       printf("&bigb=%Fp ", &BBUF);\r
-       //printf("&bigb=%04x", &BBUF);\r
+       printf("&bigb=%Fp ", BBUFPTR);\r
+       //printf("&bigb=%04x", BBUFPTR);\r
        printf("\n");\r
+#endif\r
        printf("========================================\n");\r
+\r
+#ifdef EXMMVERBOSE__\r
+       printf("coreleft():                     %u\n", _memavl());\r
+       printf("farcoreleft():                  %lu\n", (dword)HC_farcoreleft());\r
 #endif\r
-       printf("\n");\r
-       printf("HC_coreleft():                  %u\n", HC_coreleft());\r
 #ifdef __WATCOMC__\r
 //this is far  printf("Total free:                     %lu\n", (dword)(HC_GetFreeSize()));\r
-       printf("HC_GetNearFreeSize():           %u\n", HC_GetNearFreeSize());\r
-       printf("HC_GetFarFreeSize():                    %lub\n", (dword)HC_GetFarFreeSize());\r
+//super buggy  printf("HC_coreleft():                  %u\n", HC_coreleft());\r
+//     printf("HC_farcoreleft():                       %lu\n", (dword)HC_farcoreleft());\r
+       //printf("HC_GetNearFreeSize():         %u\n", HC_GetNearFreeSize());\r
+       //printf("HC_GetFarFreeSize():                  %lu\n", (dword)HC_GetFarFreeSize());\r
        HC_heapdump(&gvar);\r
 //     segatesuto();\r
 #endif\r
-#ifdef __BORLANDC__\r
+/*#ifdef __BORLANDC__\r
        //printf("core left:                    %lu\n", (dword)HC_coreleft());\r
        //printf("far core left:                        %lu\n", (dword)HC_farcoreleft());\r
-       printf("coreleft():                     %u\n", coreleft());\r
-       printf("farcoreleft():                  %lu\n", (dword)farcoreleft());\r
+//     printf("\nfarcoreleft():                        %lu\n", farcoreleft());\r
+#endif*/\r
+       printf("Project 16 ");\r
+#ifdef __WATCOMC__\r
+       printf("exmmtest");\r
+#endif\r
+#ifdef __BORLANDC__\r
+       printf("bcexmm");\r
 #endif\r
-       printf("Project 16 exmmtest.exe. This is just a test file!\n");\r
+       printf(".exe. This is just a test file!\n");\r
        printf("version %s\n", VERSION);\r
-       //printf("\n");\r
-\r
+#if defined(__DEBUG__) && ( defined(__DEBUG_PM__) || defined(__DEBUG_MM__) )\r
+#ifdef __DEBUG_MM__\r
+       printf("debugmm: %u\t", dbg_debugmm);\r
+#endif\r
+#ifdef __DEBUG_PM__\r
+       printf("debugpm: %u", dbg_ddebugpm);\r
+#endif\r
+       printf("\n");\r
+#endif\r
        //printf("based core left:                      %lu\n", (dword)_basedcoreleft());\r
        //printf("huge core left:                       %lu\n", (dword)_hugecoreleft());\r
 }\r
index 9e98489951b3ba0a1aad5bf1b729330e5eda07f7..c08ef4349eebdfa52354fdc280f62aecac05b710 100755 (executable)
@@ -305,7 +305,7 @@ boolean CA_FarWrite(int handle, byte far *source, dword length, global_game_vari
                //segm=(length%0xfffflu)-1;\r
                //fat=segm*0xfffflu;\r
                //length-=fat;\r
-               printf("CA_FarRead doesn't support 64K reads yet!\n");\r
+               printf("CA_FarWrite doesn't support 64K reads yet!\n");\r
                return 0;\r
        }\r
 \r
@@ -377,10 +377,10 @@ boolean CA_ReadFile(char *filename, memptr *ptr, global_game_variables_t *gvar)
        size = filelength(handle);\r
        if(!CA_FarRead(handle,*ptr,size, gvar))\r
        {\r
-               close (handle);\r
+               close(handle);\r
                return false;\r
        }\r
-       close (handle);\r
+       close(handle);\r
        return true;\r
 }\r
 \r
@@ -438,7 +438,28 @@ boolean CA_LoadFile(char *filename, memptr *ptr, global_game_variables_t *gvar)
                return false;\r
 \r
        size = filelength(handle);\r
+#ifdef __DEBUG_CA__\r
+       if(dbg_debugca>0){\r
+               printf("===============================================================================\n");\r
+               printf("                CA_LoadFile\n");\r
+               printf("===============================================================================\n");\r
+               //%04x\r
+               printf("        ptr=%Fp\n", ptr);\r
+               printf("        *ptr=%Fp\n", *ptr);\r
+               printf("        &ptr=%Fp\n", &ptr);\r
+       }\r
+#endif\r
        MM_GetPtr(ptr,size, gvar);\r
+#ifdef __DEBUG_CA__\r
+       if(dbg_debugca>0){\r
+               //%04x\r
+               printf("---------------------------------------\n");\r
+               printf("        ptr=%Fp\n", ptr);\r
+               printf("        *ptr=%Fp\n", *ptr);\r
+               printf("        &ptr=%Fp\n", &ptr);\r
+               printf("-------------------------------------------------------------------------------\n");\r
+       }\r
+#endif\r
        if(!CA_FarRead(handle,*ptr,size, gvar))\r
        {\r
                close(handle);\r
index 634003a6f3d7590dd51b0e4e4f105e57d4000f60..bfa55a5344b8b68655349a94a4d094819589cfb2 100755 (executable)
@@ -1,9 +1,15 @@
 #include "src/lib/16_dbg.h"\r
 \r
 #ifdef __DEBUG__\r
+#ifdef __DEBUG_MM__\r
+boolean dbg_debugmm=0;\r
+#endif\r
 #ifdef __DEBUG_PM__\r
 boolean dbg_debugpm=0;\r
 #endif\r
+#ifdef __DEBUG_CA__\r
+boolean dbg_debugca=0;\r
+#endif\r
 #ifdef __DEBUG_InputMgr__\r
 boolean dbg_testkeyin=0,dbg_testcontrolnoisy=0,dbg_nointest=0;\r
 #endif\r
@@ -13,7 +19,7 @@ byte *dbg_mapdata;
 #endif\r
 #endif\r
 \r
-\r
+#ifdef __WATCOMC__\r
 // TODO: Could we also provide a build mode to emit debug to the "Bochs E9 hack?"\r
 #ifdef DEBUGSERIAL\r
 # include <stdarg.h>\r
@@ -85,5 +91,5 @@ void _DEBUGF(const char *fmt,...) {
        _DEBUG(_DEBUGF_TMP);\r
        va_end(va);\r
 }\r
+#endif //watcomc\r
 #endif\r
-\r
index 1abc2bce5742dbed9e48252c9fcaddc22be0a960..5340313a2439961837db2eeb686d3eaa0670cee3 100755 (executable)
@@ -8,14 +8,21 @@
 #define __DEBUG__\r
 #define __DEBUG_InputMgr__\r
 #define __DEBUG_MAP__\r
+//#define __DEBUG_CA__\r
 //#define __DEBUG_PM__\r
 //#define __DEBUG_MM__\r
 \r
 \r
 #ifdef __DEBUG__\r
+#ifdef __DEBUG_MM__\r
+extern boolean dbg_debugmm;\r
+#endif\r
 #ifdef __DEBUG_PM__\r
 extern boolean dbg_debugpm;\r
 #endif\r
+#ifdef __DEBUG_CA__\r
+extern boolean dbg_debugca;\r
+#endif\r
 #ifdef __DEBUG_InputMgr__\r
 extern boolean dbg_testkeyin,dbg_testcontrolnoisy,dbg_nointest;\r
 #endif\r
@@ -25,6 +32,7 @@ extern byte *dbg_mapdata;
 #endif\r
 #endif\r
 \r
+#ifdef __WATCOMC__\r
 # ifdef DEBUGSERIAL\r
 #  include <hw/8250/8250.h>\r
 \r
@@ -44,5 +52,5 @@ static inline int _DEBUG_INIT() {
        return -1;\r
 }\r
 # endif\r
+#endif //watcomc\r
 #endif // _SRC_LIB_16_DBG\r
-\r
index 8c9f939648eab9cf171443b3cc77b97b5bda6d82..f2963158f9fa4154055d171b64277d4092a8fec3 100755 (executable)
 #include "src/lib/16_hc.h"\r
 #include <malloc.h>\r
 \r
-//functions\r
-void CHIKAKU* HC_LargestFreeBlock(size_t* Size)\r
+//from ftp://213.85.246.177/pub/FreeBSD/ports/archivers/arj/work/arj-3.10.22/environ.c\r
+//#ifdef __WATCOMC__\r
+#define FARCORELEFTPTR __huge\r
+long HC_farcoreleft()\r
+{\r
+       void FARCORELEFTPTR *hp;\r
+       static long rc=736L;\r
+       long s_rc;\r
+\r
+       s_rc=rc;\r
+       rc+=2L;\r
+       do\r
+               hp=halloc(rc-=2L, 1024);\r
+       while(hp==NULL&&rc>0L);\r
+       if(hp!=NULL)\r
+               hfree(hp);\r
+       if(rc<s_rc)\r
+               return(rc*1024L);\r
+       do\r
+       {\r
+               hp=halloc(rc+=16L, 1024);\r
+               if(hp!=NULL)\r
+                       hfree(hp);\r
+       } while(hp!=NULL);\r
+       return((rc-16L)*1024L);\r
+}\r
+//#endif\r
+\r
+void\r
+#ifdef __BORLANDC__\r
+ *\r
+#endif\r
+#ifdef __WATCOMC__\r
+ __near*\r
+#endif\r
+HC_LargestFreeBlock(size_t* Size)\r
 {\r
        size_t s0, s1;\r
-       void CHIKAKU* p;\r
+#ifdef __BORLANDC__\r
+       void * p;\r
+#endif\r
+#ifdef __WATCOMC__\r
+       void __near* p;\r
+#endif\r
 \r
        s0 = ~(size_t)0 ^ (~(size_t)0 >> 1);\r
+#ifdef __BORLANDC__\r
+       while (s0 && (p = malloc(s0)) == NULL)\r
+#endif\r
+#ifdef __WATCOMC__\r
        while (s0 && (p = _nmalloc(s0)) == NULL)\r
+#endif\r
                s0 >>= 1;\r
 \r
        if (p)\r
+#ifdef __BORLANDC__\r
+               free(p);\r
+#endif\r
+#ifdef __WATCOMC__\r
                _nfree(p);\r
+#endif\r
 \r
        s1 = s0 >> 1;\r
        while (s1)\r
        {\r
+#ifdef __BORLANDC__\r
+               if ((p = malloc(s0 + s1)) != NULL)\r
+#endif\r
+#ifdef __WATCOMC__\r
                if ((p = _nmalloc(s0 + s1)) != NULL)\r
+#endif\r
                {\r
                        s0 += s1;\r
+#ifdef __BORLANDC__\r
+                       free(p);\r
+#endif\r
+#ifdef __WATCOMC__\r
                        _nfree(p);\r
+#endif\r
                }\r
        s1 >>= 1;\r
        }\r
+#ifdef __BORLANDC__\r
+       while (s0 && (p = malloc(s0)) == NULL)\r
+#endif\r
+#ifdef __WATCOMC__\r
        while (s0 && (p = _nmalloc(s0)) == NULL)\r
+#endif\r
                s0 ^= s0 & -s0;\r
 \r
        *Size = s0;\r
@@ -59,34 +123,42 @@ void CHIKAKU* HC_LargestFreeBlock(size_t* Size)
 size_t HC_coreleft(void)\r
 {\r
        size_t total = 0;\r
-       void CHIKAKU* pFirst = NULL;\r
-       void CHIKAKU* pLast = NULL;\r
+       void __near* pFirst = NULL;\r
+       void __near* pLast = NULL;\r
        for(;;)\r
        {\r
                size_t largest;\r
-               void CHIKAKU* p = (void CHIKAKU *)HC_LargestFreeBlock(&largest);\r
-               if (largest < sizeof(void CHIKAKU*))\r
+               void __near* p = (void __near *)HC_LargestFreeBlock(&largest);\r
+               if (largest < sizeof(void __near*))\r
                {\r
                        if (p != NULL)\r
+#ifdef __BORLANDC__\r
+                       free(p);\r
+#endif\r
+#ifdef __WATCOMC__\r
                        _nfree(p);\r
-\r
+#endif\r
                        break;\r
                }\r
-               *(void CHIKAKU* CHIKAKU*)p = NULL;\r
+               *(void __near* __near*)p = NULL;\r
                total += largest;\r
                if (pFirst == NULL)\r
                        pFirst = p;\r
 \r
                if (pLast != NULL)\r
-                       *(void CHIKAKU* CHIKAKU*)pLast = p;\r
+                       *(void __near* __near*)pLast = p;\r
                pLast = p;\r
        }\r
 \r
        while (pFirst != NULL)\r
        {\r
-               void CHIKAKU* p = *(void CHIKAKU* CHIKAKU*)pFirst;\r
+               void __near* p = *(void __near* __near*)pFirst;\r
+#ifdef __BORLANDC__\r
+               free(pFirst);\r
+#endif\r
+#ifdef __WATCOMC__\r
                _nfree(pFirst);\r
-\r
+#endif\r
                pFirst = p;\r
        }\r
        return total;\r
@@ -121,7 +193,7 @@ void far* HC_LargestFarFreeBlock(size_t* Size)
        return p;\r
 }\r
 \r
-size_t HC_farcoreleft(void)\r
+size_t HC_farcoreleft_(void)\r
 {\r
        size_t total = 0;\r
        void far* pFirst = NULL;\r
@@ -156,8 +228,7 @@ size_t HC_farcoreleft(void)
 }\r
 \r
 #ifdef __WATCOMC__\r
-/*\r
-void huge* HC_LargestHugeFreeBlock(size_t* Size)\r
+/*void huge* LargestHugeFreeBlock(size_t* Size)\r
 {\r
        size_t s0, s1;\r
        void huge* p;\r
@@ -186,7 +257,7 @@ void huge* HC_LargestHugeFreeBlock(size_t* Size)
        return p;\r
 }\r
 \r
-size_t HC_hugecoreleft(void)\r
+size_t _hugecoreleft(void)\r
 {\r
        size_t total = 0;\r
        void huge* pFirst = NULL;\r
@@ -194,7 +265,7 @@ size_t HC_hugecoreleft(void)
        for(;;)\r
        {\r
                size_t largest;\r
-               void huge* p = HC_LargestHugeFreeBlock(&largest);\r
+               void huge* p = LargestHugeFreeBlock(&largest);\r
                if (largest < sizeof(void huge*))\r
                {\r
                        if (p != NULL)\r
@@ -257,7 +328,7 @@ size_t _basedcoreleft(void)
        void __based(segu)* pFirst = NULL;\r
        void __based(segu)* pLast = NULL;\r
        // allocate based heap\r
-       segu = _bheapseg( 1024 );\r
+       segu = _bHC_heapseg( 1024 );\r
        if( segu == _NULLSEG ) {\r
                printf( "Unable to allocate based heap\n" );\r
                return 0;\r
@@ -353,7 +424,7 @@ void HC_heapdump(global_game_variables_t *gvar)
        struct _heapinfo fh_info, nh_info, h_info;\r
        int heap_status;\r
        size_t h_free, nh_free, fh_free, h_total, nh_total, fh_total, h_used, nh_used, fh_used;\r
-       byte    scratch[1024],str[16];\r
+       byte    scratch[1024],str[16];\r
 \r
        HC_OpenDebug(gvar);\r
 \r
@@ -417,11 +488,11 @@ fh_info._pentry, fh_info._size );*/
        printmeminfoline(&scratch, "Near", nh_total, nh_used, nh_free);\r
        printmeminfoline(&scratch, "Far", fh_total, fh_used, fh_free);\r
        strcat(scratch,"----------------  --------   --------   --------\n");\r
-       strcat(scratch,"coreleft = ");                  ultoa((dword)HC_coreleft(),str,10);             strcat(scratch,str);    strcat(scratch,"\n");\r
-       strcat(scratch,"farcoreleft = ");               ultoa((dword)HC_farcoreleft(),str,10);  strcat(scratch,str);    strcat(scratch,"\n");\r
-       strcat(scratch,"GetFreeSize = ");               ultoa((dword)HC_GetFreeSize(),str,10);          strcat(scratch,str);    strcat(scratch,"\n");\r
-       strcat(scratch,"GetNearFreeSize = ");   ultoa((dword)HC_GetNearFreeSize(),str,10);      strcat(scratch,str);    strcat(scratch,"\n");\r
-       strcat(scratch,"GetFarFreeSize = ");    ultoa((dword)HC_GetFarFreeSize(),str,10);       strcat(scratch,str);    strcat(scratch,"\n");\r
+       strcat(scratch,"HC_coreleft = ");                       ultoa((dword)HC_coreleft(),str,10);             strcat(scratch,str);    strcat(scratch,"\n");\r
+       strcat(scratch,"HC_farcoreleft = ");            ultoa((dword)HC_farcoreleft(),str,10);  strcat(scratch,str);    strcat(scratch,"\n");\r
+       strcat(scratch,"HC_GetFreeSize = ");            ultoa((dword)HC_GetFreeSize(),str,10);          strcat(scratch,str);    strcat(scratch,"\n");\r
+       strcat(scratch,"HC_GetNearFreeSize = ");        ultoa((dword)HC_GetNearFreeSize(),str,10);      strcat(scratch,str);    strcat(scratch,"\n");\r
+       strcat(scratch,"HC_GetFarFreeSize = ");         ultoa((dword)HC_GetFarFreeSize(),str,10);       strcat(scratch,str);    strcat(scratch,"\n");\r
        strcat(scratch,"memavl = ");                    ultoa((dword)_memavl(),str,10);                 strcat(scratch,str);    strcat(scratch,"\n");\r
        strcat(scratch,"stackavail = ");                ultoa((dword)stackavail(),str,10);              strcat(scratch,str);    strcat(scratch,"\n");\r
        write(gvar->handle.heaphandle,scratch,strlen(scratch));\r
index 1dac364b1356ac35c5d012a5cbdefdca0b1b1dcc..5924d2a5fac7aecbacd2d8b489c94fc89f8a80bc 100755 (executable)
 \r
 #include "src/lib/16_head.h"\r
 \r
+long HC_farcoreleft();\r
 #ifdef __BORLANDC__\r
-#define CHIKAKU                        near\r
-#define _nmalloc(size)          malloc(size)\r
-#define _nfree(block)           free(block)\r
-#define _nrealloc(block,size)   realloc(block,size)\r
-#define _ncalloc(num,size)      calloc(num,size)\r
-#define _nheapmin()             0\r
+void * HC_LargestFreeBlock(size_t* Size);\r
 #endif\r
 #ifdef __WATCOMC__\r
-//#define SETTOUJ I_CHIKAKU    _n\r
-#define CHIKAKU                        __near\r
+void __near* HC_LargestFreeBlock(size_t* Size);\r
 #endif\r
-\r
-void CHIKAKU* HC_LargestFreeBlock(size_t* Size);\r
 size_t HC_coreleft(void);\r
 void far* HC_LargestFarFreeBlock(size_t* Size);\r
-size_t HC_farcoreleft(void);\r
-//void huge* HC_LargestHugeFreeBlock(size_t* Size);\r
-//size_t HC_hugecoreleft(void);\r
-//void __based(__self)* LargestBasedFreeBlock(size_t* Size);\r
-//size_t _basedcoreleft(void);\r
+size_t HC_farcoreleft_(void);\r
+/*void huge* LargestHugeFreeBlock(size_t* Size);\r
+size_t _hugecoreleft(void);\r
+void __based(__self)* LargestBasedFreeBlock(size_t* Size);\r
+size_t _basedcoreleft(void);*/\r
 size_t HC_GetFreeSize(void);\r
 size_t HC_GetFarFreeSize(void);\r
 size_t HC_GetNearFreeSize(void);\r
index 2dadb9715633385d1db7503e3f721956fdad2046..20321e284916b85b02863f16a5133ae2240b7d76 100755 (executable)
@@ -84,6 +84,8 @@ char *remove_ext (char* mystr, char dot, char sep) {
        return retstr;\r
 }\r
 \r
+\r
+\r
 //from http://quiz.geeksforgeeks.org/c-program-cyclically-rotate-array-one/\r
 void rotateR(byte *arr, byte n)\r
 {\r
index 251d0b6b41d475797f6434cdb714951234b8c18e..81af81c5f04fcf1ed80ddba48840afc9e720896f 100755 (executable)
@@ -49,7 +49,6 @@
 #include <unistd.h>\r
 #include <alloca.h>\r
 #include <stdint.h> //16_vrs.h\r
-#include "src/lib/16_dbg.h"\r
 #endif\r
 #ifdef __BORLANDC__\r
 #include <values.h>\r
@@ -59,6 +58,7 @@
 #include "src/lib/16_t.h"\r
 #include "src/lib/16_tdef.h"\r
 #include "src/lib/nyan/kitten.h"\r
+#include "src/lib/16_dbg.h"\r
 \r
 #define VERSION __DATE__ " " __TIME__\r
 \r
@@ -161,11 +161,13 @@ extern    int                     profilehandle,debughandle;      //make it into game global
 \r
 #define        nil     ((void *)0)\r
 #ifdef __BORLANDC__\r
-#define _FCORELEFT 0x90000UL-16UL\r
+//#define _FCORELEFT 0x90000UL-16UL\r
+#define _FCORELEFT HC_farcoreleft()\r
 #define sprite\r
 #endif\r
 #ifdef __WATCOMC__\r
-#define _FCORELEFT 0x90000UL+16UL\r
+//#define _FCORELEFT 0x90000UL+16UL\r
+#define _FCORELEFT HC_farcoreleft()\r
 /*static union REGS CPURegs;\r
 \r
 #define _AX CPURegs.x.ax\r
index 4c6b9a8c6cdb681d1dc0e10d216ac6bdeb96b679..abaf525fa6d3cffabadbe9b9c88d45335dce6b2b 100755 (executable)
@@ -31,9 +31,8 @@
 #include "src/lib/16_vl.h"\r
 #include "src/lib/16_ca.h"\r
 #include "src/lib/16_mm.h"\r
-#ifdef __WATCOMC__\r
 #include "src/lib/16_pm.h"\r
-#endif\r
+\r
 \r
 //#define DEBUG_MAPDATA\r
 //#define DEBUG_MAPVARS\r
index 72ab5ae002c90b0cb50d42a4c3c7191be0b412e0..5f8bb38e47aea4972ccb5a68bf77bdc68ea60d30 100755 (executable)
@@ -562,30 +562,7 @@ void MML_ShutdownXMS(global_game_variables_t *gvar)
 ======================
 */
 
-/*void MML_UseSpace(word segstart, dword seglength, global_game_variables_t *gvar)
-{
-       mmblocktype far *scan,far *last;
-       word            segm=1;
-       word    oldend;
-       dword           segmlen;
-       dword           extra;
-
-       scan = last = gvar->mm.mmhead;
-       gvar->mm.mmrover = gvar->mm.mmhead;             // reset rover to start of memory
-
-//
-// search for the block that contains the range of segments
-//
-       while(scan->start+scan->length < segstart)
-       {
-               last = scan;
-               scan = scan->next;
-       }
-
-//
-// take the given range out of the block
-//
-       oldend = scan->start + scan->length;
+/*
        extra = oldend - (segstart+seglength);
 
        segmlen=extra;
@@ -610,28 +587,7 @@ void MML_ShutdownXMS(global_game_variables_t *gvar)
        printf("segmlen=%lu\n", segmlen);
        }
 //++++todo: linked list of segment!
-       if(segstart == scan->start)
-       {
-               last->next = scan->next;                        // unlink block
-               FREEBLOCK(scan);
-               scan = last;
-       }
-       else
-               scan->length = segstart-scan->start;    // shorten block
-
-       if(extra > 0)
-       {
-               GETNEWBLOCK;
-               gvar->mm.mmnew->useptr = NULL;
-
-               gvar->mm.mmnew->next = scan->next;
-               scan->next = gvar->mm.mmnew;
-               gvar->mm.mmnew->start = segstart+seglength;
-               gvar->mm.mmnew->length = extra;
-               gvar->mm.mmnew->attributes = LOCKBIT;
-       }//else if(segm>0) goto segu;
-
-}*/
+*/
 void MML_UseSpace(word segstart, dword seglength, global_game_variables_t *gvar)
 {
        mmblocktype far *scan,far *last;
@@ -699,7 +655,7 @@ void MML_UseSpace(word segstart, dword seglength, global_game_variables_t *gvar)
                gvar->mm.mmnew->start = segstart+seglength;
                gvar->mm.mmnew->length = extra;
                gvar->mm.mmnew->attributes = LOCKBIT;
-       }
+       }//else if(segm>0) goto segu;
 
 }
 
@@ -788,15 +744,15 @@ void MM_Startup(global_game_variables_t *gvar)
 #ifdef __WATCOMC__
        _nheapgrow();
 #endif
-
-       length=(word)_memavl();//(word)coreleft();//(dword)GetFreeSize();
-
+       length=(word)_memavl();//(word)coreleft();
+       //start = gvar->mm.nearheap = _fmalloc(length);
 #ifdef __WATCOMC__
        start = (void __far *)(gvar->mm.nearheap = _nmalloc(length));
 #endif
 #ifdef __BORLANDC__
        start = (void far *)(gvar->mm.nearheap = malloc(length));
 #endif
+
        length -= 16-(FP_OFF(start)&15);
        length -= SAVENEARHEAP;
        seglength = length / 16;                        // now in paragraphs
@@ -808,18 +764,16 @@ void MM_Startup(global_game_variables_t *gvar)
 //
 // get all available far conventional memory segments
 //
-       //printf("_FARCORELEFT                          %lu\n", _FCORELEFT);
 #ifdef __WATCOMC__
        _fheapgrow();
-       length=_FCORELEFT;//_fcoreleft();//(dword)GetFarFreeSize();//0xffffUL*4UL;
 #endif
 #ifdef __BORLANDC__
-//0000 printf("farcoreleft()                           %lu\n", farcoreleft());
-//0000 printf("(farcoreleft()+32)-_FCORELEFT   %d\n", (sword)((farcoreleft()+32)-_FCORELEFT));
-       length=farcoreleft();//_fcoreleft();//(dword)GetFarFreeSize();//0xffffUL*4UL;
+//     printf("farcoreleft()                           %lu\n", farcoreleft());
+//     printf("(farcoreleft()+32)-_FCORELEFT   %d\n", (sword)((farcoreleft()+32)-_FCORELEFT));
 #endif
-       start = gvar->mm.farheap = _fmalloc(length);
-       //start = gvar->mm.farheap = halloc(length, 1);
+       length=_FCORELEFT;
+       start = gvar->mm.farheap = _fmalloc(length);//start = gvar->mm.farheap = halloc(length, 1);
+
        length -= 16-(FP_OFF(start)&15);
        length -= SAVEFARHEAP;
        seglength = length / 16;                        // now in paragraphs
@@ -941,11 +895,13 @@ void MM_GetPtr (memptr *baseptr, dword size, global_game_variables_t *gvar)
        gvar->mm.mmnew->useptr = baseptr;
        //if(gvar->mm.mmnew->useptr==NULL){
 #ifdef __DEBUG_MM__
+       if(dbg_debugmm>0){
                printf("MM_GetPtr\n");
                //%04x
                printf("        baseptr=%Fp     ", baseptr); printf("useptr=%Fp\n", gvar->mm.mmnew->useptr);
                printf("        *baseptr=%Fp    ", *baseptr); printf("*useptr=%Fp\n", *(gvar->mm.mmnew->useptr));
                printf("        &baseptr=%Fp    ", &baseptr); printf("&useptr=%Fp\n", &(gvar->mm.mmnew->useptr));
+       }
 #endif
        //Quit(gvar, "gvar->mm.mmnew->useptr==NULL"); }
        gvar->mm.mmnew->attributes = BASEATTRIBUTES;
@@ -1062,8 +1018,8 @@ void MM_FreePtr(memptr *baseptr, global_game_variables_t *gvar)
 
        if(!scan)
        {
-               printf("MM_FreePtr: Block not found!\n");
-               return;
+               Quit(gvar, "MM_FreePtr: Block not found!\n");
+               //printf("MM_FreePtr: Block not found!\n"); return;
        }
 
        last->next = scan->next;
@@ -1441,7 +1397,12 @@ void MM_DumpData(global_game_variables_t *gvar)
        byte    lock,purge;
        FILE    *dumpfile;
 
+#ifdef __WATCOMC__
+       _nfree(gvar->mm.nearheap);
+#endif
+#ifdef __BORLANDC__
        free(gvar->mm.nearheap);
+#endif
 #ifdef __BORLANDC__
                dumpfile = fopen ("mmdump.16b","w");
 #endif
index 0a6dff9ad15fc7850b3b14e9f1a26554b03372af..d04b382d5df6b6e2306a5027201b6507361e034f 100755 (executable)
@@ -53,19 +53,18 @@ memptr should be replaced by memseg in code.
 on usage where you need pointer convert memseg type (segment) to far pointer by\r
 MK_FP(segment value, 0)*/\r
 #ifdef __WATCOMC__\r
+//typedef void __based( void ) * memptr;       ////old //----typedef void __based(__self) * memptr;\r
 //typedef unsigned short _seg; // it will contains segment value (as Borland _seg)\r
 #define _seg __based( void )\r
 #define __SEGA __segment\r
 #endif\r
 #ifdef __BORLANDC__\r
-//typedef void _seg * memptr;\r
+#define _memavl()               coreleft()\r
 #define __SEGA _seg\r
 #endif\r
 \r
-typedef void _seg * memptr;//typedef void __based( void ) * memptr;    ////old //----typedef void __based(__self) * memptr;\r
-#ifdef __BORLANDC__\r
-#define _memavl()               coreleft()\r
-#endif\r
+typedef void _seg * memptr;\r
+\r
 #ifdef __WATCOMC__\r
 #define _argv __argv\r
 #define _argc __argc\r
index a07d5ec3b160900145123fe47d6b1571870a8308..08c03d0ae44070df8b392931dc1c97056d5980d8 100755 (executable)
@@ -29,6 +29,7 @@
 #include "src/lib/16_mm.h"\r
 #include "src/lib/16_ca.h"\r
 #include "src/lib/16_in.h"\r
+#include "src/lib/16_dbg.h"\r
 #include "src/lib/16_vl.h"\r
 #include "src/lib/testpatt.h"\r
 \r
index 28f35c0135467097cd6a3282c54134778f9a31cd..dbda778a0b9fa4f49dbd188377d5be301c08ba75 100755 (executable)
@@ -376,7 +376,7 @@ typedef struct
        boolean         mmstarted, bombonerror, mmerror;\r
        void far        *farheap;\r
 #ifdef __BORLANDC__\r
-       void far        *nearheap;\r
+       void            *nearheap;\r
 #endif\r
 #ifdef __WATCOMC__\r
        void __near     *nearheap;\r
@@ -493,7 +493,7 @@ typedef struct
                                        PMNumBlocks;\r
        long                    PMFrameCount;\r
        PageListStruct  far *PMPages;\r
-       __SEGA *PMSegPages;\r
+       memptr/*__SEGA*/ *PMSegPages;\r
        pm_mmi_t        mm;\r
        pm_emmi_t       emm;\r
        pm_xmmi_t       xmm;\r