]> 4ch.mooo.com Git - 16.git/commitdiff
====XMS MOSTLY translated but crashes EXMMTEST.EXE ====
authorsparky4 <sparky4@cock.li>
Wed, 28 Sep 2016 17:18:45 +0000 (12:18 -0500)
committersparky4 <sparky4@cock.li>
Wed, 28 Sep 2016 17:18:45 +0000 (12:18 -0500)
15 files changed:
DEBUG.16B [deleted file]
DEBUG.16W
HEAP.16W
MMDUMP.16B
bcexmm.dsk
bcexmm.exe
bcexmm.prj
makefile
src/exmmtest.c
src/lib/16_in.c
src/lib/16_mm.c
src/lib/16_mm.h
src/lib/16_pm.c
src/lib/16_tail.c [moved from src/lib/16_lib.c with 72% similarity]
src/lib/16_tail.h [moved from src/lib/16_lib.h with 86% similarity]

diff --git a/DEBUG.16B b/DEBUG.16B
deleted file mode 100755 (executable)
index a8fa9d1..0000000
--- a/DEBUG.16B
+++ /dev/null
@@ -1,8 +0,0 @@
-\e[0mSeg:0      Size:3552       Owner:0xc8eb\r
-\e[41;31m+++++++++++++++++++++++++++++++++++++++++++++\e[0m\e[42;32m0\r
-\e[0m\e[0mSeg:de0        Size:256        Owner:0xcf79\r
-\e[44;34m++++\e[0m\e[42;32m0000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000\r
-\e[0m\e[0mSeg:9fde       Size:28706      Owner:0x0\r
-\e[41;31m\e[0m\e[42;32m\r
-\e[0m\e[0mSeg:9ffe       Size:24577      Owner:0x0\r
-\e[41;31m+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++\e[0m
\ No newline at end of file
index 3a8eca6901d6fb548e934be400fde784e362f152..5aadb17d57b266ad92dca8c4ca937875743861ea 100755 (executable)
--- a/DEBUG.16W
+++ b/DEBUG.16W
-\e[0mSeg:0      Size:9835       Owner:0x0\r
+\e[0mSeg:0      Size:9818       Owner:0x0\r
 \e[41;31m+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++\e[0m\e[42;32m0\r
-\e[0m\e[0mSeg:266b       Size:256        Owner:0x18a8\r
-\e[44;34m+++++\e[0m\e[42;32m\r
-\e[0m\e[0mSeg:27e8       Size:53 Owner:0x0\r
+\e[0m\e[0mSeg:265a       Size:256        Owner:0x18a8\r
+\e[44;34m++++\e[0m\e[42;32m\r
+\e[0m\e[0mSeg:27d7       Size:44 Owner:0x0\r
 \e[41;31m++\e[0m\e[42;32m\r
-\e[0m\e[0mSeg:281d       Size:256        Owner:0x1696\r
+\e[0m\e[0mSeg:2803       Size:256        Owner:0x1696\r
+\e[45;35m++++\e[0m\e[42;32m\r
+\e[0m\e[0mSeg:2903       Size:256        Owner:0x1698\r
 \e[45;35m++++\e[0m\e[42;32m\r
-\e[0m\e[0mSeg:291d       Size:256        Owner:0x1698\r
+\e[0m\e[0mSeg:2a03       Size:256        Owner:0x169a\r
 \e[45;35m++++\e[0m\e[42;32m\r
-\e[0m\e[0mSeg:2a1d       Size:256        Owner:0x169a\r
+\e[0m\e[0mSeg:2b03       Size:256        Owner:0x169c\r
 \e[45;35m++++\e[0m\e[42;32m\r
-\e[0m\e[0mSeg:2b1d       Size:256        Owner:0x169c\r
+\e[0m\e[0mSeg:2c03       Size:256        Owner:0x169e\r
 \e[45;35m+++++\e[0m\e[42;32m\r
-\e[0m\e[0mSeg:2c1d       Size:256        Owner:0x169e\r
+\e[0m\e[0mSeg:2d03       Size:256        Owner:0x16a0\r
 \e[45;35m++++\e[0m\e[42;32m\r
-\e[0m\e[0mSeg:2d1d       Size:256        Owner:0x16a0\r
+\e[0m\e[0mSeg:2e03       Size:256        Owner:0x16a2\r
 \e[45;35m++++\e[0m\e[42;32m\r
-\e[0m\e[0mSeg:2e1d       Size:256        Owner:0x16a2\r
+\e[0m\e[0mSeg:2f03       Size:256        Owner:0x16a4\r
 \e[45;35m++++\e[0m\e[42;32m\r
-\e[0m\e[0mSeg:2f1d       Size:256        Owner:0x16a4\r
+\e[0m\e[0mSeg:3003       Size:256        Owner:0x16a6\r
 \e[45;35m++++\e[0m\e[42;32m\r
-\e[0m\e[0mSeg:301d       Size:256        Owner:0x16a6\r
+\e[0m\e[0mSeg:3103       Size:256        Owner:0x16a8\r
 \e[45;35m+++++\e[0m\e[42;32m\r
-\e[0m\e[0mSeg:311d       Size:256        Owner:0x16a8\r
+\e[0m\e[0mSeg:3203       Size:256        Owner:0x16aa\r
 \e[45;35m++++\e[0m\e[42;32m\r
-\e[0m\e[0mSeg:321d       Size:256        Owner:0x16aa\r
+\e[0m\e[0mSeg:3303       Size:256        Owner:0x16ac\r
 \e[45;35m++++\e[0m\e[42;32m\r
-\e[0m\e[0mSeg:331d       Size:256        Owner:0x16ac\r
+\e[0m\e[0mSeg:3403       Size:256        Owner:0x16ae\r
 \e[45;35m++++\e[0m\e[42;32m\r
-\e[0m\e[0mSeg:341d       Size:256        Owner:0x16ae\r
+\e[0m\e[0mSeg:3503       Size:256        Owner:0x16b0\r
 \e[45;35m++++\e[0m\e[42;32m\r
-\e[0m\e[0mSeg:351d       Size:256        Owner:0x16b0\r
+\e[0m\e[0mSeg:3603       Size:256        Owner:0x16b2\r
 \e[45;35m+++++\e[0m\e[42;32m\r
-\e[0m\e[0mSeg:361d       Size:256        Owner:0x16b2\r
+\e[0m\e[0mSeg:3703       Size:256        Owner:0x16b4\r
 \e[45;35m++++\e[0m\e[42;32m\r
-\e[0m\e[0mSeg:371d       Size:256        Owner:0x16b4\r
+\e[0m\e[0mSeg:3803       Size:256        Owner:0x16b6\r
 \e[45;35m++++\e[0m\e[42;32m\r
-\e[0m\e[0mSeg:381d       Size:256        Owner:0x16b6\r
+\e[0m\e[0mSeg:3903       Size:256        Owner:0x16b8\r
 \e[45;35m++++\e[0m\e[42;32m\r
-\e[0m\e[0mSeg:391d       Size:256        Owner:0x16b8\r
+\e[0m\e[0mSeg:3a03       Size:256        Owner:0x16ba\r
 \e[45;35m++++\e[0m\e[42;32m\r
-\e[0m\e[0mSeg:3a1d       Size:256        Owner:0x16ba\r
+\e[0m\e[0mSeg:3b03       Size:256        Owner:0x16bc\r
 \e[45;35m+++++\e[0m\e[42;32m\r
-\e[0m\e[0mSeg:3b1d       Size:256        Owner:0x16bc\r
+\e[0m\e[0mSeg:3c03       Size:256        Owner:0x16be\r
 \e[45;35m++++\e[0m\e[42;32m\r
-\e[0m\e[0mSeg:3c1d       Size:256        Owner:0x16be\r
+\e[0m\e[0mSeg:3d03       Size:256        Owner:0x16c0\r
 \e[45;35m++++\e[0m\e[42;32m\r
-\e[0m\e[0mSeg:3d1d       Size:256        Owner:0x16c0\r
+\e[0m\e[0mSeg:3e03       Size:256        Owner:0x16c2\r
 \e[45;35m++++\e[0m\e[42;32m\r
-\e[0m\e[0mSeg:3e1d       Size:256        Owner:0x16c2\r
+\e[0m\e[0mSeg:3f03       Size:256        Owner:0x16c4\r
 \e[45;35m++++\e[0m\e[42;32m\r
-\e[0m\e[0mSeg:3f1d       Size:256        Owner:0x16c4\r
+\e[0m\e[0mSeg:4003       Size:256        Owner:0x16c6\r
 \e[45;35m+++++\e[0m\e[42;32m\r
-\e[0m\e[0mSeg:401d       Size:256        Owner:0x16c6\r
+\e[0m\e[0mSeg:4103       Size:256        Owner:0x16c8\r
 \e[45;35m++++\e[0m\e[42;32m\r
-\e[0m\e[0mSeg:411d       Size:256        Owner:0x16c8\r
+\e[0m\e[0mSeg:4203       Size:256        Owner:0x16ca\r
 \e[45;35m++++\e[0m\e[42;32m\r
-\e[0m\e[0mSeg:421d       Size:256        Owner:0x16ca\r
+\e[0m\e[0mSeg:4303       Size:256        Owner:0x16cc\r
 \e[45;35m++++\e[0m\e[42;32m\r
-\e[0m\e[0mSeg:431d       Size:256        Owner:0x16cc\r
+\e[0m\e[0mSeg:4403       Size:256        Owner:0x16ce\r
 \e[45;35m++++\e[0m\e[42;32m\r
-\e[0m\e[0mSeg:441d       Size:256        Owner:0x16ce\r
+\e[0m\e[0mSeg:4503       Size:256        Owner:0x16d0\r
 \e[45;35m+++++\e[0m\e[42;32m\r
-\e[0m\e[0mSeg:451d       Size:256        Owner:0x16d0\r
+\e[0m\e[0mSeg:4603       Size:256        Owner:0x16d2\r
 \e[45;35m++++\e[0m\e[42;32m\r
-\e[0m\e[0mSeg:461d       Size:256        Owner:0x16d2\r
+\e[0m\e[0mSeg:4703       Size:256        Owner:0x16d4\r
 \e[45;35m++++\e[0m\e[42;32m\r
-\e[0m\e[0mSeg:471d       Size:256        Owner:0x16d4\r
+\e[0m\e[0mSeg:4803       Size:256        Owner:0x16d6\r
 \e[45;35m++++\e[0m\e[42;32m\r
-\e[0m\e[0mSeg:481d       Size:256        Owner:0x16d6\r
+\e[0m\e[0mSeg:4903       Size:256        Owner:0x16d8\r
 \e[45;35m++++\e[0m\e[42;32m\r
-\e[0m\e[0mSeg:491d       Size:256        Owner:0x16d8\r
+\e[0m\e[0mSeg:4a03       Size:256        Owner:0x16da\r
 \e[45;35m+++++\e[0m\e[42;32m\r
-\e[0m\e[0mSeg:4a1d       Size:256        Owner:0x16da\r
+\e[0m\e[0mSeg:4b03       Size:256        Owner:0x16dc\r
 \e[45;35m++++\e[0m\e[42;32m\r
-\e[0m\e[0mSeg:4b1d       Size:256        Owner:0x16dc\r
+\e[0m\e[0mSeg:4c03       Size:256        Owner:0x16de\r
 \e[45;35m++++\e[0m\e[42;32m\r
-\e[0m\e[0mSeg:4c1d       Size:256        Owner:0x16de\r
+\e[0m\e[0mSeg:4d03       Size:256        Owner:0x16e0\r
 \e[45;35m++++\e[0m\e[42;32m\r
-\e[0m\e[0mSeg:4d1d       Size:256        Owner:0x16e0\r
+\e[0m\e[0mSeg:4e03       Size:256        Owner:0x16e2\r
 \e[45;35m++++\e[0m\e[42;32m\r
-\e[0m\e[0mSeg:4e1d       Size:256        Owner:0x16e2\r
+\e[0m\e[0mSeg:4f03       Size:256        Owner:0x16e4\r
 \e[45;35m+++++\e[0m\e[42;32m\r
-\e[0m\e[0mSeg:4f1d       Size:256        Owner:0x16e4\r
+\e[0m\e[0mSeg:5003       Size:256        Owner:0x16e6\r
 \e[45;35m++++\e[0m\e[42;32m\r
-\e[0m\e[0mSeg:501d       Size:256        Owner:0x16e6\r
+\e[0m\e[0mSeg:5103       Size:256        Owner:0x16e8\r
 \e[45;35m++++\e[0m\e[42;32m\r
-\e[0m\e[0mSeg:511d       Size:256        Owner:0x16e8\r
+\e[0m\e[0mSeg:5203       Size:256        Owner:0x16ea\r
 \e[45;35m++++\e[0m\e[42;32m\r
-\e[0m\e[0mSeg:521d       Size:256        Owner:0x16ea\r
+\e[0m\e[0mSeg:5303       Size:256        Owner:0x16ec\r
 \e[45;35m++++\e[0m\e[42;32m\r
-\e[0m\e[0mSeg:531d       Size:256        Owner:0x16ec\r
+\e[0m\e[0mSeg:5403       Size:256        Owner:0x16ee\r
 \e[45;35m+++++\e[0m\e[42;32m\r
-\e[0m\e[0mSeg:541d       Size:256        Owner:0x16ee\r
+\e[0m\e[0mSeg:5503       Size:256        Owner:0x16f0\r
 \e[45;35m++++\e[0m\e[42;32m\r
-\e[0m\e[0mSeg:551d       Size:256        Owner:0x16f0\r
+\e[0m\e[0mSeg:5603       Size:256        Owner:0x16f2\r
 \e[45;35m++++\e[0m\e[42;32m\r
-\e[0m\e[0mSeg:561d       Size:256        Owner:0x16f2\r
+\e[0m\e[0mSeg:5703       Size:256        Owner:0x16f4\r
 \e[45;35m++++\e[0m\e[42;32m\r
-\e[0m\e[0mSeg:571d       Size:256        Owner:0x16f4\r
+\e[0m\e[0mSeg:5803       Size:256        Owner:0x16f6\r
 \e[45;35m++++\e[0m\e[42;32m\r
-\e[0m\e[0mSeg:581d       Size:256        Owner:0x16f6\r
+\e[0m\e[0mSeg:5903       Size:256        Owner:0x16f8\r
 \e[45;35m+++++\e[0m\e[42;32m\r
-\e[0m\e[0mSeg:591d       Size:256        Owner:0x16f8\r
+\e[0m\e[0mSeg:5a03       Size:256        Owner:0x16fa\r
 \e[45;35m++++\e[0m\e[42;32m\r
-\e[0m\e[0mSeg:5a1d       Size:256        Owner:0x16fa\r
+\e[0m\e[0mSeg:5b03       Size:256        Owner:0x16fc\r
 \e[45;35m++++\e[0m\e[42;32m\r
-\e[0m\e[0mSeg:5b1d       Size:256        Owner:0x16fc\r
+\e[0m\e[0mSeg:5c03       Size:256        Owner:0x16fe\r
 \e[45;35m++++\e[0m\e[42;32m\r
-\e[0m\e[0mSeg:5c1d       Size:256        Owner:0x16fe\r
+\e[0m\e[0mSeg:5d03       Size:256        Owner:0x1700\r
 \e[45;35m++++\e[0m\e[42;32m\r
-\e[0m\e[0mSeg:5d1d       Size:256        Owner:0x1700\r
+\e[0m\e[0mSeg:5e03       Size:256        Owner:0x1702\r
 \e[45;35m+++++\e[0m\e[42;32m\r
-\e[0m\e[0mSeg:5e1d       Size:256        Owner:0x1702\r
+\e[0m\e[0mSeg:5f03       Size:256        Owner:0x1704\r
 \e[45;35m++++\e[0m\e[42;32m\r
-\e[0m\e[0mSeg:5f1d       Size:256        Owner:0x1704\r
+\e[0m\e[0mSeg:6003       Size:256        Owner:0x1706\r
 \e[45;35m++++\e[0m\e[42;32m\r
-\e[0m\e[0mSeg:601d       Size:256        Owner:0x1706\r
+\e[0m\e[0mSeg:6103       Size:256        Owner:0x1708\r
 \e[45;35m++++\e[0m\e[42;32m\r
-\e[0m\e[0mSeg:611d       Size:256        Owner:0x1708\r
+\e[0m\e[0mSeg:6203       Size:256        Owner:0x170a\r
 \e[45;35m++++\e[0m\e[42;32m\r
-\e[0m\e[0mSeg:621d       Size:256        Owner:0x170a\r
+\e[0m\e[0mSeg:6303       Size:256        Owner:0x170c\r
 \e[45;35m+++++\e[0m\e[42;32m\r
-\e[0m\e[0mSeg:631d       Size:256        Owner:0x170c\r
+\e[0m\e[0mSeg:6403       Size:256        Owner:0x170e\r
 \e[45;35m++++\e[0m\e[42;32m\r
-\e[0m\e[0mSeg:641d       Size:256        Owner:0x170e\r
+\e[0m\e[0mSeg:6503       Size:256        Owner:0x1710\r
 \e[45;35m++++\e[0m\e[42;32m\r
-\e[0m\e[0mSeg:651d       Size:256        Owner:0x1710\r
+\e[0m\e[0mSeg:6603       Size:256        Owner:0x1712\r
 \e[45;35m++++\e[0m\e[42;32m\r
-\e[0m\e[0mSeg:661d       Size:256        Owner:0x1712\r
+\e[0m\e[0mSeg:6703       Size:256        Owner:0x1714\r
 \e[45;35m++++\e[0m\e[42;32m\r
-\e[0m\e[0mSeg:671d       Size:256        Owner:0x1714\r
+\e[0m\e[0mSeg:6803       Size:256        Owner:0x1716\r
 \e[45;35m+++++\e[0m\e[42;32m\r
-\e[0m\e[0mSeg:681d       Size:256        Owner:0x1716\r
+\e[0m\e[0mSeg:6903       Size:256        Owner:0x1718\r
 \e[45;35m++++\e[0m\e[42;32m\r
-\e[0m\e[0mSeg:691d       Size:256        Owner:0x1718\r
+\e[0m\e[0mSeg:6a03       Size:256        Owner:0x171a\r
 \e[45;35m++++\e[0m\e[42;32m\r
-\e[0m\e[0mSeg:6a1d       Size:256        Owner:0x171a\r
+\e[0m\e[0mSeg:6b03       Size:256        Owner:0x171c\r
 \e[45;35m++++\e[0m\e[42;32m\r
-\e[0m\e[0mSeg:6b1d       Size:256        Owner:0x171c\r
+\e[0m\e[0mSeg:6c03       Size:256        Owner:0x171e\r
 \e[45;35m++++\e[0m\e[42;32m\r
-\e[0m\e[0mSeg:6c1d       Size:256        Owner:0x171e\r
+\e[0m\e[0mSeg:6d03       Size:256        Owner:0x1720\r
 \e[45;35m+++++\e[0m\e[42;32m\r
-\e[0m\e[0mSeg:6d1d       Size:256        Owner:0x1720\r
+\e[0m\e[0mSeg:6e03       Size:256        Owner:0x1722\r
 \e[45;35m++++\e[0m\e[42;32m\r
-\e[0m\e[0mSeg:6e1d       Size:256        Owner:0x1722\r
+\e[0m\e[0mSeg:6f03       Size:256        Owner:0x1724\r
 \e[45;35m++++\e[0m\e[42;32m\r
-\e[0m\e[0mSeg:6f1d       Size:256        Owner:0x1724\r
+\e[0m\e[0mSeg:7003       Size:256        Owner:0x1726\r
 \e[45;35m++++\e[0m\e[42;32m\r
-\e[0m\e[0mSeg:701d       Size:256        Owner:0x1726\r
+\e[0m\e[0mSeg:7103       Size:256        Owner:0x1728\r
 \e[45;35m++++\e[0m\e[42;32m\r
-\e[0m\e[0mSeg:711d       Size:256        Owner:0x1728\r
+\e[0m\e[0mSeg:7203       Size:256        Owner:0x172a\r
 \e[45;35m+++++\e[0m\e[42;32m\r
-\e[0m\e[0mSeg:721d       Size:256        Owner:0x172a\r
+\e[0m\e[0mSeg:7303       Size:256        Owner:0x172c\r
 \e[45;35m++++\e[0m\e[42;32m\r
-\e[0m\e[0mSeg:731d       Size:256        Owner:0x172c\r
+\e[0m\e[0mSeg:7403       Size:256        Owner:0x172e\r
 \e[45;35m++++\e[0m\e[42;32m\r
-\e[0m\e[0mSeg:741d       Size:256        Owner:0x172e\r
+\e[0m\e[0mSeg:7503       Size:256        Owner:0x1730\r
 \e[45;35m++++\e[0m\e[42;32m\r
-\e[0m\e[0mSeg:751d       Size:256        Owner:0x1730\r
+\e[0m\e[0mSeg:7603       Size:256        Owner:0x1732\r
 \e[45;35m++++\e[0m\e[42;32m\r
-\e[0m\e[0mSeg:761d       Size:256        Owner:0x1732\r
+\e[0m\e[0mSeg:7703       Size:256        Owner:0x1734\r
 \e[45;35m+++++\e[0m\e[42;32m\r
-\e[0m\e[0mSeg:771d       Size:256        Owner:0x1734\r
+\e[0m\e[0mSeg:7803       Size:256        Owner:0x1736\r
 \e[45;35m++++\e[0m\e[42;32m\r
-\e[0m\e[0mSeg:781d       Size:256        Owner:0x1736\r
+\e[0m\e[0mSeg:7903       Size:256        Owner:0x1738\r
 \e[45;35m++++\e[0m\e[42;32m\r
-\e[0m\e[0mSeg:791d       Size:256        Owner:0x1738\r
+\e[0m\e[0mSeg:7a03       Size:256        Owner:0x173a\r
 \e[45;35m++++\e[0m\e[42;32m\r
-\e[0m\e[0mSeg:7a1d       Size:256        Owner:0x173a\r
+\e[0m\e[0mSeg:7b03       Size:256        Owner:0x173c\r
 \e[45;35m++++\e[0m\e[42;32m\r
-\e[0m\e[0mSeg:7b1d       Size:256        Owner:0x173c\r
+\e[0m\e[0mSeg:7c03       Size:256        Owner:0x173e\r
 \e[45;35m+++++\e[0m\e[42;32m\r
-\e[0m\e[0mSeg:7c1d       Size:256        Owner:0x173e\r
+\e[0m\e[0mSeg:7d03       Size:256        Owner:0x1740\r
 \e[45;35m++++\e[0m\e[42;32m\r
-\e[0m\e[0mSeg:7d1d       Size:256        Owner:0x1740\r
+\e[0m\e[0mSeg:7e03       Size:256        Owner:0x1742\r
 \e[45;35m++++\e[0m\e[42;32m\r
-\e[0m\e[0mSeg:7e1d       Size:256        Owner:0x1742\r
+\e[0m\e[0mSeg:7f03       Size:256        Owner:0x1744\r
 \e[45;35m++++\e[0m\e[42;32m\r
-\e[0m\e[0mSeg:7f1d       Size:256        Owner:0x1744\r
+\e[0m\e[0mSeg:8003       Size:256        Owner:0x1746\r
 \e[45;35m++++\e[0m\e[42;32m\r
-\e[0m\e[0mSeg:801d       Size:256        Owner:0x1746\r
+\e[0m\e[0mSeg:8103       Size:256        Owner:0x1748\r
 \e[45;35m+++++\e[0m\e[42;32m\r
-\e[0m\e[0mSeg:811d       Size:256        Owner:0x1748\r
+\e[0m\e[0mSeg:8203       Size:256        Owner:0x174a\r
 \e[45;35m++++\e[0m\e[42;32m\r
-\e[0m\e[0mSeg:821d       Size:256        Owner:0x174a\r
+\e[0m\e[0mSeg:8303       Size:256        Owner:0x174c\r
 \e[45;35m++++\e[0m\e[42;32m\r
-\e[0m\e[0mSeg:831d       Size:256        Owner:0x174c\r
+\e[0m\e[0mSeg:8403       Size:256        Owner:0x174e\r
 \e[45;35m++++\e[0m\e[42;32m\r
-\e[0m\e[0mSeg:841d       Size:256        Owner:0x174e\r
+\e[0m\e[0mSeg:8503       Size:256        Owner:0x1750\r
 \e[45;35m++++\e[0m\e[42;32m\r
-\e[0m\e[0mSeg:851d       Size:256        Owner:0x1750\r
+\e[0m\e[0mSeg:8603       Size:256        Owner:0x1752\r
 \e[45;35m+++++\e[0m\e[42;32m\r
-\e[0m\e[0mSeg:861d       Size:256        Owner:0x1752\r
+\e[0m\e[0mSeg:8703       Size:256        Owner:0x1754\r
 \e[45;35m++++\e[0m\e[42;32m\r
-\e[0m\e[0mSeg:871d       Size:256        Owner:0x1754\r
+\e[0m\e[0mSeg:8803       Size:256        Owner:0x1756\r
 \e[45;35m++++\e[0m\e[42;32m\r
-\e[0m\e[0mSeg:881d       Size:256        Owner:0x1756\r
+\e[0m\e[0mSeg:8903       Size:256        Owner:0x1758\r
 \e[45;35m++++\e[0m\e[42;32m\r
-\e[0m\e[0mSeg:891d       Size:256        Owner:0x1758\r
+\e[0m\e[0mSeg:8a03       Size:256        Owner:0x175a\r
 \e[45;35m++++\e[0m\e[42;32m\r
-\e[0m\e[0mSeg:8a1d       Size:256        Owner:0x175a\r
+\e[0m\e[0mSeg:8b03       Size:256        Owner:0x175c\r
 \e[45;35m+++++\e[0m\e[42;32m\r
-\e[0m\e[0mSeg:8b1d       Size:256        Owner:0x175c\r
-\e[45;35m++++\e[0m\e[42;32m\r
-\e[0m\e[0mSeg:8c1d       Size:273        Owner:0xe3f0\r
+\e[0m\e[0mSeg:8c03       Size:273        Owner:0xe3f0\r
 \e[44;34m++++\e[0m\e[42;32m\r
-\e[0m\e[0mSeg:b81d       Size:18402      Owner:0x0\r
-\e[41;31m+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++\e[0m
\ No newline at end of file
+\e[0m\e[0mSeg:b803       Size:18428      Owner:0x0\r
+\e[41;31m++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++\e[0m
\ No newline at end of file
index eee55bfd12f0b24e1eecf43c3b9289b1832c3c80..59a1b45b9c037e3d7d9e54e4b674f5483e0ae7bf 100755 (executable)
--- a/HEAP.16W
+++ b/HEAP.16W
@@ -1,35 +1,35 @@
 \r
        == default ==\r
 \r
-  USED block at 280a0016 of size 66\r
-  USED block at 280a0058 of size 66\r
-  USED block at 280a009a of size 136\r
-  FREE block at 280a0122 of size 18\r
-  USED block at 280a0134 of size 20\r
-  FREE block at 280a0148 of size 7860\r
+  USED block at 27f90016 of size 66\r
+  USED block at 27f90058 of size 66\r
+  FREE block at 27f9009a of size 18\r
+  USED block at 27f900ac of size 136\r
+  USED block at 27f90134 of size 20\r
+  FREE block at 27f90148 of size 7860\r
 OK - end of heap\r
 \r
        == near ==\r
 \r
-  USED block at 1809e426 of size 12\r
-  USED block at 1809e432 of size 332\r
-  USED block at 1809e57e of size 52\r
-  USED block at 1809e5b2 of size 20\r
-  USED block at 1809e5c6 of size 20\r
-  USED block at 1809e5da of size 20\r
-  USED block at 1809e5ee of size 20\r
-  USED block at 1809e602 of size 20\r
-  USED block at 1809e616 of size 6630\r
+  USED block at 17f8e426 of size 12\r
+  USED block at 17f8e432 of size 332\r
+  USED block at 17f8e57e of size 52\r
+  USED block at 17f8e5b2 of size 20\r
+  USED block at 17f8e5c6 of size 20\r
+  USED block at 17f8e5da of size 20\r
+  USED block at 17f8e5ee of size 20\r
+  USED block at 17f8e602 of size 20\r
+  USED block at 17f8e616 of size 6630\r
 OK - end of heap\r
 \r
        == far ==\r
 \r
-  USED block at 280a0016 of size 66\r
-  USED block at 280a0058 of size 66\r
-  USED block at 280a009a of size 136\r
-  USED block at 280a0122 of size 18\r
-  USED block at 280a0134 of size 20\r
-  USED block at 280a0148 of size 7860\r
+  USED block at 27f90016 of size 66\r
+  USED block at 27f90058 of size 66\r
+  USED block at 27f9009a of size 18\r
+  USED block at 27f900ac of size 136\r
+  USED block at 27f90134 of size 20\r
+  USED block at 27f90148 of size 7860\r
 OK - end of heap\r
 \r
 Memory Type         Total      Used       Free\r
index 98f569f2080d89bce45072bcefa9a80af0672eb1..a2763a1596e554e4e153a06f71fbf4a8a14339c7 100755 (executable)
Binary files a/MMDUMP.16B and b/MMDUMP.16B differ
index 2bd2d3e635824f5d27228d15dc04eea450bb5d98..1fb336b1a1cdb0704999bf60511fdd3701586242 100755 (executable)
Binary files a/bcexmm.dsk and b/bcexmm.dsk differ
index 47d175b724c0672f225118c28b42dc26bbd71b92..ba460567b992edeea1a7849af7af7ffc8e663718 100755 (executable)
Binary files a/bcexmm.exe and b/bcexmm.exe differ
index 2abea17e99d8f0cf77d74744d89514c347e909e1..4b0799a7369ff8792cca8f28e2ed2a70c5829ae8 100755 (executable)
Binary files a/bcexmm.prj and b/bcexmm.prj differ
index e8aa09fcdc1d93afdcf9b68e197c05974ddb7dc4..e58e6e58997c8b80060436aa81ba96ac8384209e 100755 (executable)
--- a/makefile
+++ b/makefile
@@ -107,7 +107,7 @@ LIBFLAGS=$(WLIBQ) -b -n
 #
 VGMSNDOBJ = vgmSnd.$(OBJ) 16_snd.$(OBJ)
 GFXLIBOBJS = modex16.$(OBJ) bitmap.$(OBJ) 16text.$(OBJ) bakapee.$(OBJ) scroll16.$(OBJ) 16render.$(OBJ) 16_vrs.$(OBJ) 16_sprit.$(OBJ)
-16LIBOBJS = 16_mm.$(OBJ) 16_pm.$(OBJ) 16_ca.$(OBJ) 16_lib.$(OBJ) 16_in.$(OBJ) 16_head.$(OBJ) 16_dbg.$(OBJ) kitten.$(OBJ) 16_hc.$(OBJ) wcpu.$(OBJ) 16_timer.$(OBJ)
+16LIBOBJS = 16_mm.$(OBJ) 16_pm.$(OBJ) 16_ca.$(OBJ) 16_tail.$(OBJ) 16_in.$(OBJ) 16_head.$(OBJ) 16_dbg.$(OBJ) kitten.$(OBJ) 16_hc.$(OBJ) wcpu.$(OBJ) 16_timer.$(OBJ)
 #16planar.$(OBJ) planar.$(OBJ)
 DOSLIBOBJ = adlib.$(OBJ) 8254.$(OBJ) 8259.$(OBJ) dos.$(OBJ) cpu.$(OBJ)
 !ifeq DEBUGSERIAL 1
@@ -292,7 +292,7 @@ mapread.$(OBJ):   $(SRCLIB)/mapread.c $(SRCLIB)/mapread.h
 16_dbg.$(OBJ):    $(SRCLIB)/16_dbg.c $(SRCLIB)/16_dbg.h
 midi.$(OBJ):      $(SRCLIB)/midi.c $(SRCLIB)/midi.h
 16_head.$(OBJ):   $(SRCLIB)/16_head.c $(SRCLIB)/16_head.h
-16_lib.$(OBJ):   $(SRCLIB)/16_lib.c $(SRCLIB)/16_lib.h
+16_tail.$(OBJ):   $(SRCLIB)/16_tail.c $(SRCLIB)/16_tail.h
 16_hc.$(OBJ):     $(SRCLIB)/16_hc.c $(SRCLIB)/16_hc.h
 16_snd.$(OBJ):    $(SRCLIB)/16_snd.c $(SRCLIB)/16_snd.h
 jsmn.$(OBJ):      $(JSMNLIB)/jsmn.c $(JSMNLIB)/jsmn.h
index 46095449735323085b4e8e9ae42d0c5e90842e6b..aaf10f567f5e5c95a79d197725baeb6b594a0be9 100755 (executable)
@@ -27,7 +27,7 @@
 #include "src/lib/16_ca.h"\r
 #include "src/lib/16_mm.h"\r
 #include "src/lib/16_hc.h"\r
-#include "src/lib/16_lib.h"\r
+#include "src/lib/16_tail.h"\r
 //#include "src/lib/modex16.h"\r
 #pragma hdrstop\r
 \r
@@ -97,19 +97,21 @@ main(int argc, char *argv[])
                bakapee1 = "data/koishi~.pcx";\r
                bakapee2 = "data/test.map";\r
        }\r
-       printf("main()=%Fp      start MM\n", *argv[0]);\r
+       //printf("main()=%Fp    start MM\n", *argv[0]);\r
        MM_Startup(&gvar);\r
-       printf("ok\n");\r
+       //printf("ok\n");\r
+#ifdef __WATCOMC__\r
        if(debugpm>0)\r
        {\r
                PM_Startup(&gvar);\r
-               printf("pmstarted ok\n");\r
+               //printf("pmstarted ok\n");\r
                //PM_CheckMainMem(&gvar);\r
                PM_UnlockMainMem(&gvar);\r
        }\r
+#endif\r
        CA_Startup(&gvar);\r
 //     printf("                done!\n");\r
-       PRINTBB;\r
+       //0000PRINTBB;\r
 //     printf("press any key to continue!\n");\r
 //     getch();\r
 #ifdef FILEREAD\r
@@ -140,10 +142,7 @@ for(w=0;w<2;w++)
        //printf("medium blue = non purgable\n");\r
        //printf("red = locked\n");\r
        printf("press any key to continue!\n");\r
-       getch();\r
-       MM_ShowMemory(&gvar);\r
-       MM_DumpData(&gvar);\r
-       MM_Report_(&gvar);\r
+       DebugMemory_(&gvar, 1);\r
        if(baka) printf("\nyay!\n");\r
        else printf("\npoo!\n");\r
        printf("press any key to continue!\n");\r
@@ -151,11 +150,16 @@ for(w=0;w<2;w++)
 #ifdef FILEREAD\r
 }\r
 #endif\r
-       printf("bakapee1=%s\n", bakapee1);\r
-       printf("bakapee2=%s\n", bakapee2);\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(&bigbuffer, &gvar);\r
+#ifdef __WATCOMC__\r
        if(debugpm>0)\r
                PM_Shutdown(&gvar);\r
+#endif\r
        CA_Shutdown(&gvar);\r
        MM_Shutdown(&gvar);\r
        free(bakapee1); free(bakapee2);\r
index 6df6d06af3927c9243beec8ba9b957b89f8388ed..85153939ccd443b05db0491f353dd635560297f5 100755 (executable)
@@ -1155,6 +1155,9 @@ IN_Ack()
 {\r
        word    i;\r
 \r
+       if (!inst.IN_Started)\r
+               return;\r
+\r
        IN_ClearKey(inpu.LastScan);\r
        inpu.LastScan = sc_None;\r
 \r
index d1e2759d5b519e7c0ef9f7e59ef3553bf742204b..16b65aa631537ef305f5eee18ebfe9382b9bb098 100755 (executable)
@@ -140,7 +140,7 @@ boolean MML_CheckForEMS(void)
        return(emmcfems);
 }
 
-
+#ifndef __16_PM__
 /*
 ======================
 =
@@ -424,7 +424,7 @@ byte MM_MapXEMS(global_game_variables_t *gvar)
        gvar->mmi.EMSmem = (i)*0x4000lu;
        return 0;
 }
-
+#endif
 //==========================================================================
 
 /*
@@ -459,7 +459,7 @@ boolean MML_CheckForXMS(global_game_variables_t *gvar)
        else return true;
 }
 
-
+#ifndef __16_PM__
 /*
 ======================
 =
@@ -546,7 +546,7 @@ void MML_ShutdownXMS(global_game_variables_t *gvar)
                }
        }
 }
-
+#endif
 //==========================================================================
 
 /*
@@ -817,12 +817,13 @@ void MM_Startup(global_game_variables_t *gvar)
        //printf("_FARCORELEFT                          %lu\n", _FCORELEFT);
 #ifdef __WATCOMC__
        _fheapgrow();
+       length=_FCORELEFT;//_fcoreleft();//(dword)GetFarFreeSize();//0xffffUL*4UL;
 #endif
 #ifdef __BORLANDC__
        printf("farcoreleft()                           %lu\n", farcoreleft());
        printf("(farcoreleft()+32)-_FCORELEFT   %d\n", (sword)((farcoreleft()+32)-_FCORELEFT));
+       length=farcoreleft();//_fcoreleft();//(dword)GetFarFreeSize();//0xffffUL*4UL;
 #endif
-       length=_FCORELEFT;//_fcoreleft();//(dword)GetFarFreeSize();//0xffffUL*4UL;
        start = gvar->mm.farheap = _fmalloc(length);
        //start = gvar->mm.farheap = halloc(length, 1);
        length -= 16-(FP_OFF(start)&15);
@@ -864,7 +865,7 @@ void MM_Startup(global_game_variables_t *gvar)
        if(MML_CheckForEMS())
        {
                MML_SetupEMS(gvar);                                     // allocate space
-               //TODO: EMS4! AND EMS 3.2 MASSIVE DATA HANDLMENT!
+               //16_PM: EMS4! AND EMS 3.2 MASSIVE DATA HANDLMENT!
                MML_UseSpace(gvar->mm.EMSPageFrame,(MAPPAGES)*0x4000lu, gvar);
                //if(gvar->pm.emm.EMSVer<0x40)
                        MM_MapEMS(gvar);                                        // map in used pages
@@ -1626,11 +1627,13 @@ void MM_Report_(global_game_variables_t *gvar)
                printf("        XMS\n");
                printf("                XMSaddr:        %X\n", *XMSaddr);
        }
-       printf("near:   %lu             ", gvar->mmi.nearheap); printf("far:    %lu\n", gvar->mmi.farheap); if(MML_CheckForEMS())
-       printf("EMSmem: %lu     ", gvar->mmi.EMSmem); if(MML_CheckForXMS(gvar)) printf("XMSmem: %lu", gvar->mmi.XMSmem); printf("\n");
+       printf("nearheap:       %lu             ", gvar->mmi.nearheap); printf("farheap:        %lu\n", gvar->mmi.farheap);
+       if(MML_CheckForEMS()) printf("EMSmem:           %lu     ", gvar->mmi.EMSmem); if(MML_CheckForXMS(gvar)) printf("XMSmem:         %lu", gvar->mmi.XMSmem); printf("\n");
+       printf("convmem:\n"); DebugMemory_(gvar, 0);
        //printf("mainmem:      %lu\n", gvar->mmi.mainmem);
-       printf("Total convmem:  %lu     ", gvar->mmi.mainmem); printf("TotalFree:       %lu     ", MM_TotalFree(gvar)+gvar->mmi.EMSmem+gvar->mmi.XMSmem+gvar->mmi.XMSmem); printf("TotalUsed:   %lu\n", gvar->mmi.mainmem);
-       printf("                        UnusedMemory:   %lu\n", MM_UnusedMemory(gvar));
+       //printf("Total convmem:        %lu     ", gvar->mmi.mainmem); printf("TotalFree:       %lu     ", MM_TotalFree(gvar)+gvar->mmi.EMSmem+gvar->mmi.XMSmem+gvar->mmi.XMSmem); printf("TotalUsed:   %lu\n", gvar->mmi.mainmem);
+       //printf("                      UnusedMemory:   %lu\n", MM_UnusedMemory(gvar));
+
 }
 
 //==========================================================================
index d858c0f1b69908beddec362184e5db27ba97f3ac..7c681255d63b52ee9cc50c27c5fa18c362d94f63 100755 (executable)
@@ -25,7 +25,7 @@
 #include <malloc.h>\r
 #include "src/lib/16_head.h"\r
 #include "src/lib/16_hc.h"\r
-#include "src/lib/16_lib.h"\r
+#include "src/lib/16_tail.h"\r
 //++++mh       #include "src/lib/16_in.h"\r
 \r
 #ifdef __DEBUG__               // 1 == Debug/Dev  ;  0 == Production/final\r
@@ -68,11 +68,11 @@ extern boolean debugpm;
 #define        XMS_INT                 0x2f\r
 #define        XMS_CALL(v)             _AH = (v);\\r
                                                __asm call [WORD PTR XMSDriver]\r
-/*__asm { //mov (v),ah*/\r
+/*__asm { mov ah,[v]\*///}\r
 \r
 #define        XMS_VERSION             0x00\r
 \r
-#define        XMS_ALLOCHMA    0x01\r
+#define        XMS_ALLOCHMA            0x01\r
 #define        XMS_FREEHMA             0x02\r
 \r
 #define        XMS_GENABLEA20  0x03\r
@@ -83,14 +83,14 @@ extern boolean debugpm;
 \r
 #define        XMS_QUERYFREE   0x08\r
 #define        XMS_ALLOC               0x09\r
-#define        XMS_FREE                0x0A\r
-#define        XMS_MOVE                0x0B\r
-#define        XMS_LOCK                0x0C\r
+#define        XMS_FREE                        0x0A\r
+#define        XMS_MOVE                        0x0B\r
+#define        XMS_LOCK                        0x0C\r
 #define        XMS_UNLOCK              0x0D\r
 #define        XMS_GETINFO             0x0E\r
 #define        XMS_RESIZE              0x0F\r
 \r
-#define        XMS_ALLOCUMB    0x10\r
+#define        XMS_ALLOCUMB            0x10\r
 #define        XMS_FREEUMB             0x11\r
 \r
 //==========================================================================\r
index 2f21482d4e9d132fba5768d0606f69b9f88c560b..10ee7b6ddee6969f88ae45e9cf92790ecaf8325e 100755 (executable)
@@ -98,7 +98,7 @@ PML_MapEMS(word logical, byte physical, global_game_variables_t *gvar)
                int     EMS_INT\r
                or      ah,ah\r
                jnz     error\r
-               jmp End\r
+               jmp     End\r
 #ifdef __BORLANDC__\r
        }\r
 #endif\r
@@ -156,50 +156,50 @@ PML_StartupEMS(global_game_variables_t *gvar)
                mov     dx,OFFSET emmname       //fix by andrius4669\r
                mov     ax,0x3d00\r
                int     EMS_INT         // try to open EMMXXXX0 device\r
-               jc      error1\r
+               jc      erroreu\r
 \r
                mov     bx,ax\r
                mov     ax,0x4400\r
 \r
                int     EMS_INT         // get device info\r
-               jc      error1\r
+               jc      erroreu\r
 \r
                and     dx,0x80\r
-               jz      error1\r
+               jz      erroreu\r
 \r
                mov     ax,0x4407\r
 \r
                int     EMS_INT         // get status\r
-               jc      error1\r
+               jc      erroreu\r
                or      al,al\r
-               jz      error1\r
+               jz      erroreu\r
 \r
                mov     ah,0x3e\r
                int     EMS_INT         // close handle\r
-               jc      error1\r
+               jc      erroreu\r
 \r
                mov     ah,EMS_STATUS\r
                int     EMS_INT\r
-               jc      error                 // make sure EMS hardware is present\r
+               jc      erroreu                 // make sure EMS hardware is present\r
 \r
                mov     ah,EMS_VERSION\r
                int     EMS_INT                 // only work on EMS 3.2 or greater (silly, but...)\r
                or      ah,ah\r
-               jnz     error1\r
+               jnz     erroreu\r
                mov     [EMSVer],ax             //      set EMSVer\r
                cmp     al,0x32                 // only work on ems 3.2 or greater\r
-               jb      error1\r
+               jb      erroreu\r
 \r
                mov     ah,EMS_GETFRAME\r
                int     EMS_INT                 // find the page frame address\r
                or      ah,ah\r
-               jnz     error1\r
+               jnz     erroreu\r
                mov     [EMSPageFrame],bx\r
 \r
                mov     ah,EMS_GETPAGES\r
                int     EMS_INT                 // find out how much EMS is there\r
                or      ah,ah\r
-               jnz     error1\r
+               jnz     erroreu\r
                or      bx,bx\r
                jz      noEMS                   // no EMS at all to allocate\r
                cmp     bx,2\r
@@ -207,22 +207,22 @@ PML_StartupEMS(global_game_variables_t *gvar)
                mov     [totalEMSpages],dx\r
                mov     [freeEMSpages],bx\r
                mov     [EMSAvail],bx\r
-               jmp End1\r
+               jmp     Endeu\r
 #ifdef __BORLANDC__\r
        }\r
 #endif\r
-       error1:\r
+               erroreu:\r
 #ifdef __BORLANDC__\r
        __asm {\r
 #endif\r
                mov     err,ah\r
                mov     errorflag,1\r
-               jmp End1\r
+               jmp     Endeu\r
 #ifdef __BORLANDC__\r
        }\r
 #endif\r
-noEMS:\r
-End1:\r
+               noEMS:\r
+               Endeu:\r
 #ifdef __WATCOMC__\r
        }\r
 #endif\r
@@ -243,30 +243,31 @@ End1:
                mov     bx,[EMSAvail];\r
                int     EMS_INT\r
                or      ah,ah\r
-               jnz     error2\r
+               jnz     erroreuu\r
                mov     [EMSHandle],dx\r
-               jmp     End2\r
+               jmp     Endeuu\r
 #ifdef __BORLANDC__\r
        }\r
 #endif\r
-       error2:\r
+               erroreuu:\r
 #ifdef __BORLANDC__\r
        __asm {\r
 #endif\r
                mov     err,ah\r
                mov     errorflag,1\r
-               jmp End2\r
+               jmp Endeuu\r
 #ifdef __BORLANDC__\r
        }\r
 #endif\r
-End2:\r
+               Endeuu:\r
 #ifdef __WATCOMC__\r
        }\r
 #endif\r
 \r
        if(errorflag==false)\r
        {\r
-       gvar->mmi.EMSmem = EMSAvail * (dword)EMSPageSize;\r
+       gvar->pm.emm.EMSAvail = EMSAvail;\r
+       gvar->mmi.EMSmem = gvar->pm.emm.EMSAvail * (dword)EMSPageSize;\r
 \r
        // Initialize EMS mapping cache\r
        for (i = 0;i < EMSFrameCount;i++)\r
@@ -283,7 +284,6 @@ End2:
 \r
        gvar->pm.emm.EMSPresent = true;                 // We have EMS\r
        gvar->pm.emm.EMSPageFrame = EMSPageFrame;\r
-       gvar->pm.emm.EMSAvail = EMSAvail;\r
        gvar->pm.emm.EMSVer = EMSVer;\r
        gvar->pm.emm.EMSHandle = EMSHandle;\r
        gvar->pm.emm.freeEMSpages = freeEMSpages;\r
@@ -311,22 +311,22 @@ PML_ShutdownEMS(global_game_variables_t *gvar)
                        mov     ah,EMS_FREEPAGES\r
                        mov     dx,[EMSHandle]\r
                        int     EMS_INT\r
-                       jc      errors\r
-                       jmp     Ends\r
+                       jc      errores\r
+                       jmp     Endes\r
 #ifdef __BORLANDC__\r
                }\r
 #endif\r
-                       errors:\r
+                       errores:\r
 #ifdef __BORLANDC__\r
                __asm {\r
 #endif\r
                        mov     err,ah\r
                        mov     errorflag,1\r
-                       jmp Ends\r
+                       jmp     Endes\r
 #ifdef __BORLANDC__\r
                }\r
 #endif\r
-               Ends:\r
+                       Endes:\r
 #ifdef __WATCOMC__\r
                }\r
 #endif\r
@@ -356,44 +356,86 @@ PML_ShutdownEMS(global_game_variables_t *gvar)
 boolean\r
 PML_StartupXMS(global_game_variables_t *gvar)\r
 {\r
-       gvar->pm.xmm.XMSPresent = false;                                        // Assume failure\r
-       gvar->pm.xmm.XMSAvail = 0;\r
-\r
-       _AX=0x4300;\r
-       geninterrupt(XMS_INT);                                  // Check for presence of XMS driver\r
-       if (_AL != 0x80)\r
-               goto error;\r
-\r
+       boolean errorflag;\r
+       word XMSAvail, XMSHandle;\r
+       errorflag=gvar->pm.xmm.XMSPresent = false;                                      // Assume failure\r
+       XMSAvail = gvar->pm.xmm.XMSAvail = 0;\r
 \r
        __asm {\r
+               mov     ax,0x4300\r
+               int     XMS_INT                                         // Check for presence of XMS driver\r
+               cmp     al,0x80\r
+               jne     errorxu\r
+\r
                mov     ax,0x4310\r
                int     XMS_INT                                                 // Get address of XMS driver\r
                mov     [WORD PTR XMSDriver],bx\r
                mov     [WORD PTR XMSDriver+2],es               // function pointer to XMS driver\r
-       }\r
-\r
-       XMS_CALL(XMS_QUERYFREE);                        // Find out how much XMS is available\r
-       gvar->pm.xmm.XMSAvail = _AX;\r
-       if (!_AX)                               // AJR: bugfix 10/8/92\r
-               goto error;\r
 \r
+               //XMS_CALL(XMS_QUERYFREE);                      // Find out how much XMS is available\r
+               mov     ah,XMS_QUERYFREE\r
+               call    [WORD PTR XMSDriver]\r
+               mov     [XMSAvail],ax\r
+               or      ax,ax                           // AJR: bugfix 10/8/92\r
+               jz      errorxu\r
+               jmp     Endxu\r
+#ifdef __BORLANDC__\r
+       }\r
+#endif\r
+               errorxu:\r
+#ifdef __BORLANDC__\r
+       __asm {\r
+#endif\r
+               //mov   err,ah\r
+               mov     errorflag,1\r
+               jmp     Endxu\r
+#ifdef __BORLANDC__\r
+       }\r
+#endif\r
+               Endxu:\r
+#ifdef __WATCOMC__\r
+       }\r
+#endif\r
        gvar->pm.xmm.XMSAvail &= ~(PMPageSizeKB - 1);   // Round off to nearest page size\r
        if (gvar->pm.xmm.XMSAvail < (PMPageSizeKB * 2)) // Need at least 2 pages\r
                goto error;\r
 \r
-       _DX = gvar->pm.xmm.XMSAvail;\r
-       XMS_CALL(XMS_ALLOC);                            // And do the allocation\r
-       gvar->pm.xmm.XMSHandle = _DX;\r
-\r
-       if (!_AX)                               // AJR: bugfix 10/8/92\r
-       {\r
-               gvar->pm.xmm.XMSAvail = 0;\r
-               goto error;\r
+       __asm {\r
+               mov     dx,[XMSAvail]\r
+               //XMS_CALL(XMS_ALLOC);                          // And do the allocation\r
+               mov     ah,XMS_ALLOC\r
+               call    [WORD PTR XMSDriver]\r
+               mov     [XMSHandle],dx\r
+               or      ax,ax                           // AJR: bugfix 10/8/92\r
+               jz      errorxuu\r
+               jmp     Endxuu\r
+#ifdef __BORLANDC__\r
+               }\r
+#endif\r
+               errorxuu:\r
+#ifdef __BORLANDC__\r
+       __asm {\r
+#endif\r
+               //mov   err,ah\r
+               mov     [XMSAvail],0\r
+               mov     errorflag,1\r
+               jmp     Endxuu\r
+#ifdef __BORLANDC__\r
+       }\r
+#endif\r
+               Endxuu:\r
+#ifdef __WATCOMC__\r
        }\r
+#endif\r
 \r
-       gvar->mmi.XMSmem += gvar->pm.xmm.XMSAvail * 1024;\r
+       if(errorflag==false)\r
+       {\r
+               gvar->pm.xmm.XMSAvail = XMSAvail;\r
+               gvar->mmi.XMSmem += gvar->pm.xmm.XMSAvail * 1024;\r
+               gvar->pm.xmm.XMSHandle = XMSHandle;\r
 \r
-       gvar->pm.xmm.XMSPresent = true;\r
+               gvar->pm.xmm.XMSPresent = true;\r
+       }\r
 error:\r
        return(gvar->pm.xmm.XMSPresent);\r
 }\r
@@ -475,11 +517,36 @@ PML_CopyFromXMS(byte far *target,int sourcepage,word length, global_game_variabl
 void\r
 PML_ShutdownXMS(global_game_variables_t *gvar)\r
 {\r
+       boolean errorflag=false;\r
+       word XMSHandle = gvar->pm.xmm.XMSHandle;\r
        if (gvar->pm.xmm.XMSPresent)\r
        {\r
-               _DX = gvar->pm.xmm.XMSHandle;\r
-               XMS_CALL(XMS_FREE);\r
-               if (_BL)\r
+               __asm {\r
+                       mov     dx,[XMSHandle]\r
+                       //XMS_CALL(XMS_FREE);\r
+                       mov     ah,XMS_FREE\r
+                       call    [WORD PTR XMSDriver]\r
+                       or      bl,bl\r
+                       jz      errorxs\r
+                       jmp     Endxs\r
+#ifdef __BORLANDC__\r
+               }\r
+#endif\r
+                       errorxs:\r
+#ifdef __BORLANDC__\r
+               __asm {\r
+#endif\r
+                       //mov   err,ah\r
+                       mov     errorflag,1\r
+                       jmp     Endxs\r
+#ifdef __BORLANDC__\r
+               }\r
+#endif\r
+                       Endxs:\r
+#ifdef __WATCOMC__\r
+               }\r
+#endif\r
+               if(errorflag==true)\r
                {\r
                        Quit("PML_ShutdownXMS: Error freeing XMS");\r
                        //return;\r
@@ -611,9 +678,6 @@ PML_StartupMainMem(global_game_variables_t *gvar)
        gvar->pm.mm.MainPagesAvail = 0;\r
        gvar->pm.mm.MainPresent = false;\r
        MM_BombOnError(false, gvar);\r
-       printf("PML_StartupMainMem()\n");\r
-       printf("        p=%04x  MainMemPages=%04x\n", p, gvar->pm.mm.MainMemPages);\r
-       printf("        p=%Fp   MainMemPages=%Fp\n", p, gvar->pm.mm.MainMemPages);\r
        for (i = 0,p = gvar->pm.mm.MainMemPages;i < PMMaxMainMem;i++,p++)\r
        {\r
                MM_GetPtr(p,PMPageSize, gvar);\r
@@ -1402,12 +1466,17 @@ PM_Startup(global_game_variables_t *gvar)
                }\r
        }\r
 \r
-       //0000++++PML_OpenPageFile(gvar);\r
+       //0000+=+=PML_OpenPageFile(gvar);\r
 \r
        if (!noems)\r
                PML_StartupEMS(gvar);\r
-       if (!noxms)\r
-               //++++PML_StartupXMS(gvar);     //TODO: convert\r
+       /*if (!noxms)\r
+       {\r
+               //++++\r
+               printf("PML_StartupXMS ");\r
+               PML_StartupXMS(gvar);   //TODO: convert\r
+               printf("ok!\n");\r
+       }*/\r
 \r
        if (!nomain && !gvar->pm.emm.EMSPresent)\r
        {\r
similarity index 72%
rename from src/lib/16_lib.c
rename to src/lib/16_tail.c
index 12a4288b6aab4e1ccc97f7a7bf36b82d2cf89dcf..f9f6fb569914e1972fd52b528b4786f82ca5cea2 100755 (executable)
@@ -23,7 +23,7 @@
  * 16 library\r
  */\r
 \r
-#include "src/lib/16_lib.h"\r
+#include "src/lib/16_tail.h"\r
 \r
 //===========================================================================\r
 \r
@@ -35,7 +35,7 @@
 ==================\r
 */\r
 \r
-void DebugMemory (global_game_variables_t *gvar)\r
+void DebugMemory_(global_game_variables_t *gvar, boolean q)\r
 {\r
        /*VW_FixRefreshBuffer ();\r
        US_CenterWindow (16,7);\r
@@ -50,10 +50,24 @@ void DebugMemory (global_game_variables_t *gvar)
        US_PrintUnsigned (MM_TotalFree()/1024);\r
        US_Print ("k\n");\r
        VW_UpdateScreen();*/\r
+       if(q){\r
+       printf("========================================\n");\r
+       printf("                DebugMemory_\n");\r
+       printf("========================================\n");}\r
+       if(q) { printf("Memory Usage\n");\r
+       printf("------------\n"); }else printf("  ");\r
+       printf("Total:  "); if(q) printf("      "); printf("%uk", gvar->mmi.mainmem/1024);\r
+       if(q) printf("\n"); else printf("       ");\r
+       printf("Free:   "); if(q) printf("      "); printf("%uk", MM_UnusedMemory(gvar)/1024);\r
+       if(q) printf("\n"); else printf("       ");\r
+       printf("With purge:"); if(q) printf("   "); printf("%uk\n", MM_TotalFree(gvar)/1024);\r
+       if(q) printf("------------\n");\r
+#ifdef __WATCOMC__\r
        IN_Ack ();\r
-       MM_ShowMemory (gvar);\r
+#endif\r
+       if(q) MM_ShowMemory (gvar);\r
 }\r
-\r
+#ifdef __WATCOMC__\r
 /*\r
 ==========================\r
 =\r
@@ -111,5 +125,6 @@ void Quit (char *error)
 \r
        exit(0);\r
 }\r
+#endif\r
 \r
 //===========================================================================\r
similarity index 86%
rename from src/lib/16_lib.h
rename to src/lib/16_tail.h
index 5529ec6250feba88722796c88fa90f0ade6844bb..76916aeb1913c4fe453032369500b807f1a4b3d8 100755 (executable)
  *\r
  */\r
 \r
-#ifndef        __16_LIB__\r
-#define        __16_LIB__\r
+#ifndef        __16_TAIL__\r
+#define        __16_TAIL__\r
 \r
 #include "src/lib/16_head.h"\r
 #include "src/lib/16_mm.h"\r
 #include "src/lib/16_in.h"\r
 \r
-void DebugMemory (global_game_variables_t *gvar);\r
+void DebugMemory_(global_game_variables_t *gvar, boolean q);\r
+#ifdef __WATCOMC__\r
 void Quit (char *error);\r
+#endif\r
 \r
 #endif\r