]> 4ch.mooo.com Git - 16.git/commitdiff
Merge branch 'master' of github.com:sparky4/16
authoryakui-lover <yakui-lover@yandex.ru>
Fri, 25 Nov 2016 18:12:14 +0000 (03:12 +0900)
committeryakui-lover <yakui-lover@yandex.ru>
Fri, 25 Nov 2016 18:12:14 +0000 (03:12 +0900)
74 files changed:
16/SCRC.ZIP [new file with mode: 0755]
16/WOLFSRC-8086.zip [new file with mode: 0755]
16/makefile.old [moved from makefile.old with 100% similarity]
16/src/lib/_croll16.c [moved from src/lib/_croll16.c with 100% similarity]
16/zcroll16.c [moved from src/lib/zcroll16.c with 100% similarity]
16/zcroll16.h [moved from src/lib/zcroll16.h with 95% similarity]
DEBUG.16W
HEAP.16W
MMDUMP.16W
PROFILE.16W [deleted file]
cutetest.bat [new file with mode: 0755]
data/g.pal
fmemtest.exe
fontgfx.exe
fonttest.exe
inputest.exe
make-lowercase
makefile
maptest.exe
pcxtest.exe
pcxtest2.exe
pm.use
q.sh [new file with mode: 0755]
src/16.h
src/exmmtest.c
src/fontgfx.c
src/inputest.c
src/lib/16_ca.c
src/lib/16_head.h
src/lib/16_in.c
src/lib/16_in.h
src/lib/16_map.c
src/lib/16_map.h
src/lib/16_mm.c
src/lib/16_pm.c
src/lib/16_tail.c
src/lib/16_timer.c
src/lib/16_vl.c [moved from src/lib/modex16.c with 69% similarity]
src/lib/16_vl.h [moved from src/lib/modex16.h with 92% similarity]
src/lib/16_vrs.c
src/lib/16_vrs.h
src/lib/16render.c
src/lib/16render.h
src/lib/16text.c
src/lib/bakapee.h
src/lib/bitmap.c
src/lib/bitmap.h
src/lib/cpumk.sh [new file with mode: 0755]
src/lib/doslib
src/lib/mapread.c
src/lib/mapread.h
src/lib/modex16/16planar.h
src/lib/scroll16.c
src/lib/scroll16.h
src/lib/typdefst.h
src/lib/types.h
src/lib/wcpu/wcpu.c
src/palettec.c
src/palettel.c
src/pcxtest.c
src/pcxtest2.c
src/planrpcx.c
src/scroll.c
src/test.c
src/test2.c
src/tesuto.h
src/vgacamm.c
src/vrstest.c
src/zcroll.c
t.bat [deleted file]
test.exe
test0.exe
vgmtest.exe
wbuild.sh

diff --git a/16/SCRC.ZIP b/16/SCRC.ZIP
new file mode 100755 (executable)
index 0000000..55bcd51
Binary files /dev/null and b/16/SCRC.ZIP differ
diff --git a/16/WOLFSRC-8086.zip b/16/WOLFSRC-8086.zip
new file mode 100755 (executable)
index 0000000..64c133d
Binary files /dev/null and b/16/WOLFSRC-8086.zip differ
similarity index 100%
rename from makefile.old
rename to 16/makefile.old
similarity index 100%
rename from src/lib/_croll16.c
rename to 16/src/lib/_croll16.c
similarity index 100%
rename from src/lib/zcroll16.c
rename to 16/zcroll16.c
similarity index 95%
rename from src/lib/zcroll16.h
rename to 16/zcroll16.h
index 8e07c2c0d3ff4f89281880aa5cc0701c926742ee..89b4b7b1b952018502038979813ef151d2cda258 100755 (executable)
@@ -26,7 +26,7 @@
 #include "src/lib/16_head.h"\r
 #include "src/lib/16_entity.h"\r
 //#include "src/lib/bakapee.h"\r
-#include "src/lib/modex16.h"\r
+#include "src/lib/16_vl.h"\r
 //#include "src/lib/16_in.h"\r
 #include "src/lib/bitmap.h"\r
 #include "src/lib/16_map.h" //map is loaded here www\r
@@ -73,7 +73,7 @@ typedef struct {
  * 1. Calculate, store and update a panning info, which includes, but not limited to:\r
  *     combined layer information, actual map representation (reflecting real state of the game),\r
  *     pixel shift for smooth tile scrolling.\r
- * 2. Provide ways to draw a visible part of map. For simplicity with smooth scrolling, \r
+ * 2. Provide ways to draw a visible part of map. For simplicity with smooth scrolling,\r
  *     additional row/column is always drawn at the each side of the map. This implies that 'fence'\r
  *     should have a sprite too. Map is drawn left-to-right, top-to-bottom.\r
  */\r
index 86023db0db6ee704d19335b31dab4df8ca92fef5..1d9a2adcd20a9f560fca78286a5be00d5dc168ac 100755 (executable)
--- a/DEBUG.16W
+++ b/DEBUG.16W
-\e[0mSeg:0      Size:11821      Owner:0x0\r
-\e[41;31m++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++\e[0m\e[42;32m000\r
-\e[0m\e[0mSeg:2eb4       Size:37 Owner:0x0\r
+\e[0mSeg:0      Size:11694      Owner:0x0\r
+\e[41;31m+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++\e[0m\e[42;32m0000\r
+\e[0m\e[0mSeg:2e9b       Size:37 Owner:0x0\r
 \e[41;31m+\e[0m\e[42;32m\r
-\e[0m\e[0mSeg:2ed9       Size:256        Owner:0x1784\r
-\e[44;34m+++++\e[0m\e[42;32m\r
-\e[0m\e[0mSeg:2fd9       Size:256        Owner:0x1572\r
+\e[0m\e[0mSeg:2ec0       Size:256        Owner:0x1650\r
+\e[44;34m++++\e[0m\e[42;32m\r
+\e[0m\e[0mSeg:2fc0       Size:256        Owner:0x1442\r
 \e[45;35m++++\e[0m\e[42;32m\r
-\e[0m\e[0mSeg:30d9       Size:256        Owner:0x1574\r
+\e[0m\e[0mSeg:30c0       Size:256        Owner:0x1444\r
 \e[45;35m++++\e[0m\e[42;32m\r
-\e[0m\e[0mSeg:31d9       Size:256        Owner:0x1576\r
+\e[0m\e[0mSeg:31c0       Size:256        Owner:0x1446\r
 \e[45;35m++++\e[0m\e[42;32m\r
-\e[0m\e[0mSeg:32d9       Size:256        Owner:0x1578\r
+\e[0m\e[0mSeg:32c0       Size:256        Owner:0x1448\r
 \e[45;35m++++\e[0m\e[42;32m\r
-\e[0m\e[0mSeg:33d9       Size:256        Owner:0x157a\r
-\e[45;35m+++++\e[0m\e[42;32m\r
-\e[0m\e[0mSeg:34d9       Size:256        Owner:0x157c\r
+\e[0m\e[0mSeg:33c0       Size:256        Owner:0x144a\r
 \e[45;35m++++\e[0m\e[42;32m\r
-\e[0m\e[0mSeg:35d9       Size:256        Owner:0x157e\r
+\e[0m\e[0mSeg:34c0       Size:256        Owner:0x144c\r
 \e[45;35m++++\e[0m\e[42;32m\r
-\e[0m\e[0mSeg:36d9       Size:256        Owner:0x1580\r
+\e[0m\e[0mSeg:35c0       Size:256        Owner:0x144e\r
 \e[45;35m++++\e[0m\e[42;32m\r
-\e[0m\e[0mSeg:37d9       Size:256        Owner:0x1582\r
+\e[0m\e[0mSeg:36c0       Size:256        Owner:0x1450\r
 \e[45;35m++++\e[0m\e[42;32m\r
-\e[0m\e[0mSeg:38d9       Size:256        Owner:0x1584\r
-\e[45;35m+++++\e[0m\e[42;32m\r
-\e[0m\e[0mSeg:39d9       Size:256        Owner:0x1586\r
+\e[0m\e[0mSeg:37c0       Size:256        Owner:0x1452\r
 \e[45;35m++++\e[0m\e[42;32m\r
-\e[0m\e[0mSeg:3ad9       Size:256        Owner:0x1588\r
+\e[0m\e[0mSeg:38c0       Size:256        Owner:0x1454\r
 \e[45;35m++++\e[0m\e[42;32m\r
-\e[0m\e[0mSeg:3bd9       Size:256        Owner:0x158a\r
+\e[0m\e[0mSeg:39c0       Size:256        Owner:0x1456\r
 \e[45;35m++++\e[0m\e[42;32m\r
-\e[0m\e[0mSeg:3cd9       Size:256        Owner:0x158c\r
+\e[0m\e[0mSeg:3ac0       Size:256        Owner:0x1458\r
 \e[45;35m++++\e[0m\e[42;32m\r
-\e[0m\e[0mSeg:3dd9       Size:256        Owner:0x158e\r
-\e[45;35m+++++\e[0m\e[42;32m\r
-\e[0m\e[0mSeg:3ed9       Size:256        Owner:0x1590\r
+\e[0m\e[0mSeg:3bc0       Size:256        Owner:0x145a\r
 \e[45;35m++++\e[0m\e[42;32m\r
-\e[0m\e[0mSeg:3fd9       Size:256        Owner:0x1592\r
+\e[0m\e[0mSeg:3cc0       Size:256        Owner:0x145c\r
 \e[45;35m++++\e[0m\e[42;32m\r
-\e[0m\e[0mSeg:40d9       Size:256        Owner:0x1594\r
+\e[0m\e[0mSeg:3dc0       Size:256        Owner:0x145e\r
 \e[45;35m++++\e[0m\e[42;32m\r
-\e[0m\e[0mSeg:41d9       Size:256        Owner:0x1596\r
+\e[0m\e[0mSeg:3ec0       Size:256        Owner:0x1460\r
 \e[45;35m++++\e[0m\e[42;32m\r
-\e[0m\e[0mSeg:42d9       Size:256        Owner:0x1598\r
-\e[45;35m+++++\e[0m\e[42;32m\r
-\e[0m\e[0mSeg:43d9       Size:256        Owner:0x159a\r
+\e[0m\e[0mSeg:3fc0       Size:256        Owner:0x1462\r
 \e[45;35m++++\e[0m\e[42;32m\r
-\e[0m\e[0mSeg:44d9       Size:256        Owner:0x159c\r
+\e[0m\e[0mSeg:40c0       Size:256        Owner:0x1464\r
 \e[45;35m++++\e[0m\e[42;32m\r
-\e[0m\e[0mSeg:45d9       Size:256        Owner:0x159e\r
+\e[0m\e[0mSeg:41c0       Size:256        Owner:0x1466\r
 \e[45;35m++++\e[0m\e[42;32m\r
-\e[0m\e[0mSeg:46d9       Size:256        Owner:0x15a0\r
+\e[0m\e[0mSeg:42c0       Size:256        Owner:0x1468\r
 \e[45;35m++++\e[0m\e[42;32m\r
-\e[0m\e[0mSeg:47d9       Size:256        Owner:0x15a2\r
-\e[45;35m+++++\e[0m\e[42;32m\r
-\e[0m\e[0mSeg:48d9       Size:256        Owner:0x15a4\r
+\e[0m\e[0mSeg:43c0       Size:256        Owner:0x146a\r
 \e[45;35m++++\e[0m\e[42;32m\r
-\e[0m\e[0mSeg:49d9       Size:256        Owner:0x15a6\r
+\e[0m\e[0mSeg:44c0       Size:256        Owner:0x146c\r
 \e[45;35m++++\e[0m\e[42;32m\r
-\e[0m\e[0mSeg:4ad9       Size:256        Owner:0x15a8\r
+\e[0m\e[0mSeg:45c0       Size:256        Owner:0x146e\r
 \e[45;35m++++\e[0m\e[42;32m\r
-\e[0m\e[0mSeg:4bd9       Size:256        Owner:0x15aa\r
+\e[0m\e[0mSeg:46c0       Size:256        Owner:0x1470\r
 \e[45;35m++++\e[0m\e[42;32m\r
-\e[0m\e[0mSeg:4cd9       Size:256        Owner:0x15ac\r
-\e[45;35m+++++\e[0m\e[42;32m\r
-\e[0m\e[0mSeg:4dd9       Size:256        Owner:0x15ae\r
+\e[0m\e[0mSeg:47c0       Size:256        Owner:0x1472\r
 \e[45;35m++++\e[0m\e[42;32m\r
-\e[0m\e[0mSeg:4ed9       Size:256        Owner:0x15b0\r
+\e[0m\e[0mSeg:48c0       Size:256        Owner:0x1474\r
 \e[45;35m++++\e[0m\e[42;32m\r
-\e[0m\e[0mSeg:4fd9       Size:256        Owner:0x15b2\r
+\e[0m\e[0mSeg:49c0       Size:256        Owner:0x1476\r
 \e[45;35m++++\e[0m\e[42;32m\r
-\e[0m\e[0mSeg:50d9       Size:256        Owner:0x15b4\r
+\e[0m\e[0mSeg:4ac0       Size:256        Owner:0x1478\r
 \e[45;35m++++\e[0m\e[42;32m\r
-\e[0m\e[0mSeg:51d9       Size:256        Owner:0x15b6\r
-\e[45;35m+++++\e[0m\e[42;32m\r
-\e[0m\e[0mSeg:52d9       Size:256        Owner:0x15b8\r
+\e[0m\e[0mSeg:4bc0       Size:256        Owner:0x147a\r
 \e[45;35m++++\e[0m\e[42;32m\r
-\e[0m\e[0mSeg:53d9       Size:256        Owner:0x15ba\r
+\e[0m\e[0mSeg:4cc0       Size:256        Owner:0x147c\r
 \e[45;35m++++\e[0m\e[42;32m\r
-\e[0m\e[0mSeg:54d9       Size:256        Owner:0x15bc\r
+\e[0m\e[0mSeg:4dc0       Size:256        Owner:0x147e\r
 \e[45;35m++++\e[0m\e[42;32m\r
-\e[0m\e[0mSeg:55d9       Size:256        Owner:0x15be\r
+\e[0m\e[0mSeg:4ec0       Size:256        Owner:0x1480\r
 \e[45;35m++++\e[0m\e[42;32m\r
-\e[0m\e[0mSeg:56d9       Size:256        Owner:0x15c0\r
-\e[45;35m+++++\e[0m\e[42;32m\r
-\e[0m\e[0mSeg:57d9       Size:256        Owner:0x15c2\r
+\e[0m\e[0mSeg:4fc0       Size:256        Owner:0x1482\r
 \e[45;35m++++\e[0m\e[42;32m\r
-\e[0m\e[0mSeg:58d9       Size:256        Owner:0x15c4\r
+\e[0m\e[0mSeg:50c0       Size:256        Owner:0x1484\r
 \e[45;35m++++\e[0m\e[42;32m\r
-\e[0m\e[0mSeg:59d9       Size:256        Owner:0x15c6\r
+\e[0m\e[0mSeg:51c0       Size:256        Owner:0x1486\r
 \e[45;35m++++\e[0m\e[42;32m\r
-\e[0m\e[0mSeg:5ad9       Size:256        Owner:0x15c8\r
+\e[0m\e[0mSeg:52c0       Size:256        Owner:0x1488\r
 \e[45;35m++++\e[0m\e[42;32m\r
-\e[0m\e[0mSeg:5bd9       Size:256        Owner:0x15ca\r
-\e[45;35m+++++\e[0m\e[42;32m\r
-\e[0m\e[0mSeg:5cd9       Size:256        Owner:0x15cc\r
+\e[0m\e[0mSeg:53c0       Size:256        Owner:0x148a\r
 \e[45;35m++++\e[0m\e[42;32m\r
-\e[0m\e[0mSeg:5dd9       Size:256        Owner:0x15ce\r
+\e[0m\e[0mSeg:54c0       Size:256        Owner:0x148c\r
 \e[45;35m++++\e[0m\e[42;32m\r
-\e[0m\e[0mSeg:5ed9       Size:256        Owner:0x15d0\r
+\e[0m\e[0mSeg:55c0       Size:256        Owner:0x148e\r
 \e[45;35m++++\e[0m\e[42;32m\r
-\e[0m\e[0mSeg:5fd9       Size:256        Owner:0x15d2\r
+\e[0m\e[0mSeg:56c0       Size:256        Owner:0x1490\r
 \e[45;35m++++\e[0m\e[42;32m\r
-\e[0m\e[0mSeg:60d9       Size:256        Owner:0x15d4\r
-\e[45;35m+++++\e[0m\e[42;32m\r
-\e[0m\e[0mSeg:61d9       Size:256        Owner:0x15d6\r
+\e[0m\e[0mSeg:57c0       Size:256        Owner:0x1492\r
 \e[45;35m++++\e[0m\e[42;32m\r
-\e[0m\e[0mSeg:62d9       Size:256        Owner:0x15d8\r
+\e[0m\e[0mSeg:58c0       Size:256        Owner:0x1494\r
 \e[45;35m++++\e[0m\e[42;32m\r
-\e[0m\e[0mSeg:63d9       Size:256        Owner:0x15da\r
+\e[0m\e[0mSeg:59c0       Size:256        Owner:0x1496\r
 \e[45;35m++++\e[0m\e[42;32m\r
-\e[0m\e[0mSeg:64d9       Size:256        Owner:0x15dc\r
+\e[0m\e[0mSeg:5ac0       Size:256        Owner:0x1498\r
 \e[45;35m++++\e[0m\e[42;32m\r
-\e[0m\e[0mSeg:65d9       Size:256        Owner:0x15de\r
-\e[45;35m+++++\e[0m\e[42;32m\r
-\e[0m\e[0mSeg:66d9       Size:256        Owner:0x15e0\r
+\e[0m\e[0mSeg:5bc0       Size:256        Owner:0x149a\r
 \e[45;35m++++\e[0m\e[42;32m\r
-\e[0m\e[0mSeg:67d9       Size:256        Owner:0x15e2\r
+\e[0m\e[0mSeg:5cc0       Size:256        Owner:0x149c\r
 \e[45;35m++++\e[0m\e[42;32m\r
-\e[0m\e[0mSeg:68d9       Size:256        Owner:0x15e4\r
+\e[0m\e[0mSeg:5dc0       Size:256        Owner:0x149e\r
 \e[45;35m++++\e[0m\e[42;32m\r
-\e[0m\e[0mSeg:69d9       Size:256        Owner:0x15e6\r
+\e[0m\e[0mSeg:5ec0       Size:256        Owner:0x14a0\r
 \e[45;35m++++\e[0m\e[42;32m\r
-\e[0m\e[0mSeg:6ad9       Size:256        Owner:0x15e8\r
-\e[45;35m+++++\e[0m\e[42;32m\r
-\e[0m\e[0mSeg:6bd9       Size:256        Owner:0x15ea\r
+\e[0m\e[0mSeg:5fc0       Size:256        Owner:0x14a2\r
 \e[45;35m++++\e[0m\e[42;32m\r
-\e[0m\e[0mSeg:6cd9       Size:256        Owner:0x15ec\r
+\e[0m\e[0mSeg:60c0       Size:256        Owner:0x14a4\r
 \e[45;35m++++\e[0m\e[42;32m\r
-\e[0m\e[0mSeg:6dd9       Size:256        Owner:0x15ee\r
+\e[0m\e[0mSeg:61c0       Size:256        Owner:0x14a6\r
 \e[45;35m++++\e[0m\e[42;32m\r
-\e[0m\e[0mSeg:6ed9       Size:256        Owner:0x15f0\r
+\e[0m\e[0mSeg:62c0       Size:256        Owner:0x14a8\r
 \e[45;35m++++\e[0m\e[42;32m\r
-\e[0m\e[0mSeg:6fd9       Size:256        Owner:0x15f2\r
-\e[45;35m+++++\e[0m\e[42;32m\r
-\e[0m\e[0mSeg:70d9       Size:256        Owner:0x15f4\r
+\e[0m\e[0mSeg:63c0       Size:256        Owner:0x14aa\r
 \e[45;35m++++\e[0m\e[42;32m\r
-\e[0m\e[0mSeg:71d9       Size:256        Owner:0x15f6\r
+\e[0m\e[0mSeg:64c0       Size:256        Owner:0x14ac\r
 \e[45;35m++++\e[0m\e[42;32m\r
-\e[0m\e[0mSeg:72d9       Size:256        Owner:0x15f8\r
+\e[0m\e[0mSeg:65c0       Size:256        Owner:0x14ae\r
 \e[45;35m++++\e[0m\e[42;32m\r
-\e[0m\e[0mSeg:73d9       Size:256        Owner:0x15fa\r
+\e[0m\e[0mSeg:66c0       Size:256        Owner:0x14b0\r
 \e[45;35m++++\e[0m\e[42;32m\r
-\e[0m\e[0mSeg:74d9       Size:256        Owner:0x15fc\r
-\e[45;35m+++++\e[0m\e[42;32m\r
-\e[0m\e[0mSeg:75d9       Size:256        Owner:0x15fe\r
+\e[0m\e[0mSeg:67c0       Size:256        Owner:0x14b2\r
 \e[45;35m++++\e[0m\e[42;32m\r
-\e[0m\e[0mSeg:76d9       Size:256        Owner:0x1600\r
+\e[0m\e[0mSeg:68c0       Size:256        Owner:0x14b4\r
 \e[45;35m++++\e[0m\e[42;32m\r
-\e[0m\e[0mSeg:77d9       Size:256        Owner:0x1602\r
+\e[0m\e[0mSeg:69c0       Size:256        Owner:0x14b6\r
 \e[45;35m++++\e[0m\e[42;32m\r
-\e[0m\e[0mSeg:78d9       Size:256        Owner:0x1604\r
+\e[0m\e[0mSeg:6ac0       Size:256        Owner:0x14b8\r
 \e[45;35m++++\e[0m\e[42;32m\r
-\e[0m\e[0mSeg:79d9       Size:256        Owner:0x1606\r
-\e[45;35m+++++\e[0m\e[42;32m\r
-\e[0m\e[0mSeg:7ad9       Size:256        Owner:0x1608\r
+\e[0m\e[0mSeg:6bc0       Size:256        Owner:0x14ba\r
 \e[45;35m++++\e[0m\e[42;32m\r
-\e[0m\e[0mSeg:7bd9       Size:256        Owner:0x160a\r
+\e[0m\e[0mSeg:6cc0       Size:256        Owner:0x14bc\r
 \e[45;35m++++\e[0m\e[42;32m\r
-\e[0m\e[0mSeg:7cd9       Size:256        Owner:0x160c\r
+\e[0m\e[0mSeg:6dc0       Size:256        Owner:0x14be\r
 \e[45;35m++++\e[0m\e[42;32m\r
-\e[0m\e[0mSeg:7dd9       Size:256        Owner:0x160e\r
+\e[0m\e[0mSeg:6ec0       Size:256        Owner:0x14c0\r
 \e[45;35m++++\e[0m\e[42;32m\r
-\e[0m\e[0mSeg:7ed9       Size:256        Owner:0x1610\r
-\e[45;35m+++++\e[0m\e[42;32m\r
-\e[0m\e[0mSeg:7fd9       Size:256        Owner:0x1612\r
+\e[0m\e[0mSeg:6fc0       Size:256        Owner:0x14c2\r
 \e[45;35m++++\e[0m\e[42;32m\r
-\e[0m\e[0mSeg:80d9       Size:256        Owner:0x1614\r
+\e[0m\e[0mSeg:70c0       Size:256        Owner:0x14c4\r
 \e[45;35m++++\e[0m\e[42;32m\r
-\e[0m\e[0mSeg:81d9       Size:256        Owner:0x1616\r
+\e[0m\e[0mSeg:71c0       Size:256        Owner:0x14c6\r
 \e[45;35m++++\e[0m\e[42;32m\r
-\e[0m\e[0mSeg:82d9       Size:256        Owner:0x1618\r
+\e[0m\e[0mSeg:72c0       Size:256        Owner:0x14c8\r
 \e[45;35m++++\e[0m\e[42;32m\r
-\e[0m\e[0mSeg:83d9       Size:256        Owner:0x161a\r
-\e[45;35m+++++\e[0m\e[42;32m\r
-\e[0m\e[0mSeg:84d9       Size:256        Owner:0x161c\r
+\e[0m\e[0mSeg:73c0       Size:256        Owner:0x14ca\r
 \e[45;35m++++\e[0m\e[42;32m\r
-\e[0m\e[0mSeg:85d9       Size:256        Owner:0x161e\r
+\e[0m\e[0mSeg:74c0       Size:256        Owner:0x14cc\r
 \e[45;35m++++\e[0m\e[42;32m\r
-\e[0m\e[0mSeg:86d9       Size:256        Owner:0x1620\r
+\e[0m\e[0mSeg:75c0       Size:256        Owner:0x14ce\r
 \e[45;35m++++\e[0m\e[42;32m\r
-\e[0m\e[0mSeg:87d9       Size:256        Owner:0x1622\r
+\e[0m\e[0mSeg:76c0       Size:256        Owner:0x14d0\r
 \e[45;35m++++\e[0m\e[42;32m\r
-\e[0m\e[0mSeg:88d9       Size:256        Owner:0x1624\r
-\e[45;35m+++++\e[0m\e[42;32m\r
-\e[0m\e[0mSeg:89d9       Size:256        Owner:0x1626\r
+\e[0m\e[0mSeg:77c0       Size:256        Owner:0x14d2\r
 \e[45;35m++++\e[0m\e[42;32m\r
-\e[0m\e[0mSeg:8ad9       Size:256        Owner:0x1628\r
+\e[0m\e[0mSeg:78c0       Size:256        Owner:0x14d4\r
 \e[45;35m++++\e[0m\e[42;32m\r
-\e[0m\e[0mSeg:8bd9       Size:256        Owner:0x162a\r
+\e[0m\e[0mSeg:79c0       Size:256        Owner:0x14d6\r
 \e[45;35m++++\e[0m\e[42;32m\r
-\e[0m\e[0mSeg:8cd9       Size:256        Owner:0x162c\r
+\e[0m\e[0mSeg:7ac0       Size:256        Owner:0x14d8\r
 \e[45;35m++++\e[0m\e[42;32m\r
-\e[0m\e[0mSeg:8dd9       Size:256        Owner:0x162e\r
-\e[45;35m+++++\e[0m\e[42;32m\r
-\e[0m\e[0mSeg:8ed9       Size:256        Owner:0x1630\r
+\e[0m\e[0mSeg:7bc0       Size:256        Owner:0x14da\r
 \e[45;35m++++\e[0m\e[42;32m\r
-\e[0m\e[0mSeg:8fd9       Size:256        Owner:0x1632\r
+\e[0m\e[0mSeg:7cc0       Size:256        Owner:0x14dc\r
 \e[45;35m++++\e[0m\e[42;32m\r
-\e[0m\e[0mSeg:90d9       Size:256        Owner:0x1634\r
+\e[0m\e[0mSeg:7dc0       Size:256        Owner:0x14de\r
 \e[45;35m++++\e[0m\e[42;32m\r
-\e[0m\e[0mSeg:91d9       Size:256        Owner:0x1636\r
+\e[0m\e[0mSeg:7ec0       Size:256        Owner:0x14e0\r
 \e[45;35m++++\e[0m\e[42;32m\r
-\e[0m\e[0mSeg:92d9       Size:256        Owner:0x1638\r
-\e[45;35m+++++\e[0m\e[42;32m\r
-\e[0m\e[0mSeg:93d9       Size:401        Owner:0xf25a\r
+\e[0m\e[0mSeg:7fc0       Size:256        Owner:0x14e2\r
+\e[45;35m++++\e[0m\e[42;32m\r
+\e[0m\e[0mSeg:80c0       Size:256        Owner:0x14e4\r
+\e[45;35m++++\e[0m\e[42;32m\r
+\e[0m\e[0mSeg:81c0       Size:256        Owner:0x14e6\r
+\e[45;35m++++\e[0m\e[42;32m\r
+\e[0m\e[0mSeg:82c0       Size:256        Owner:0x14e8\r
+\e[45;35m++++\e[0m\e[42;32m\r
+\e[0m\e[0mSeg:83c0       Size:256        Owner:0x14ea\r
+\e[45;35m++++\e[0m\e[42;32m\r
+\e[0m\e[0mSeg:84c0       Size:256        Owner:0x14ec\r
+\e[45;35m++++\e[0m\e[42;32m\r
+\e[0m\e[0mSeg:85c0       Size:256        Owner:0x14ee\r
+\e[45;35m++++\e[0m\e[42;32m\r
+\e[0m\e[0mSeg:86c0       Size:256        Owner:0x14f0\r
+\e[45;35m++++\e[0m\e[42;32m\r
+\e[0m\e[0mSeg:87c0       Size:256        Owner:0x14f2\r
+\e[45;35m++++\e[0m\e[42;32m\r
+\e[0m\e[0mSeg:88c0       Size:256        Owner:0x14f4\r
+\e[45;35m++++\e[0m\e[42;32m\r
+\e[0m\e[0mSeg:89c0       Size:256        Owner:0x14f6\r
+\e[45;35m++++\e[0m\e[42;32m\r
+\e[0m\e[0mSeg:8ac0       Size:256        Owner:0x14f8\r
+\e[45;35m++++\e[0m\e[42;32m\r
+\e[0m\e[0mSeg:8bc0       Size:256        Owner:0x14fa\r
+\e[45;35m++++\e[0m\e[42;32m\r
+\e[0m\e[0mSeg:8cc0       Size:256        Owner:0x14fc\r
+\e[45;35m++++\e[0m\e[42;32m\r
+\e[0m\e[0mSeg:8dc0       Size:256        Owner:0x14fe\r
+\e[45;35m++++\e[0m\e[42;32m\r
+\e[0m\e[0mSeg:8ec0       Size:256        Owner:0x1500\r
+\e[45;35m++++\e[0m\e[42;32m\r
+\e[0m\e[0mSeg:8fc0       Size:256        Owner:0x1502\r
+\e[45;35m++++\e[0m\e[42;32m\r
+\e[0m\e[0mSeg:90c0       Size:256        Owner:0x1504\r
+\e[45;35m++++\e[0m\e[42;32m\r
+\e[0m\e[0mSeg:91c0       Size:256        Owner:0x1506\r
+\e[45;35m++++\e[0m\e[42;32m\r
+\e[0m\e[0mSeg:92c0       Size:256        Owner:0x1508\r
+\e[45;35m++++\e[0m\e[42;32m\r
+\e[0m\e[0mSeg:93c0       Size:401        Owner:0xebf6\r
 \e[44;34m++++++\e[0m\e[42;32m\r
-\e[0m\e[0mSeg:bed9       Size:16678      Owner:0x0\r
+\e[0m\e[0mSeg:bec0       Size:16703      Owner:0x0\r
 \e[41;31m++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++\e[0m
\ No newline at end of file
index 0526b3209da0365c8de17c3e5929a57e7e6f3c39..7aa4d04f70a8eb707564a630f30b26bec1217c36 100755 (executable)
--- a/HEAP.16W
+++ b/HEAP.16W
@@ -1,71 +1,71 @@
 \r
        == default ==\r
 \r
-  FREE block at 2ed70016 of size 18\r
-  USED block at 2ed70028 of size 50\r
-  USED block at 2ed7005a of size 50\r
-  USED block at 2ed7008c of size 50\r
-  USED block at 2ed700be of size 50\r
-  USED block at 2ed700f0 of size 50\r
-  USED block at 2ed70122 of size 50\r
-  USED block at 2ed70154 of size 50\r
-  USED block at 2ed70186 of size 50\r
-  USED block at 2ed701b8 of size 50\r
-  USED block at 2ed701ea of size 50\r
-  USED block at 2ed7021c of size 50\r
-  USED block at 2ed7024e of size 50\r
-  USED block at 2ed70280 of size 50\r
-  FREE block at 2ed702b2 of size 14\r
-  USED block at 2ed702c0 of size 20\r
-  USED block at 2ed702d4 of size 136\r
-  FREE block at 2ed7035c of size 7328\r
+  FREE block at 2ebe0016 of size 18\r
+  USED block at 2ebe0028 of size 50\r
+  USED block at 2ebe005a of size 50\r
+  USED block at 2ebe008c of size 50\r
+  USED block at 2ebe00be of size 50\r
+  USED block at 2ebe00f0 of size 50\r
+  USED block at 2ebe0122 of size 50\r
+  USED block at 2ebe0154 of size 50\r
+  USED block at 2ebe0186 of size 50\r
+  USED block at 2ebe01b8 of size 50\r
+  USED block at 2ebe01ea of size 50\r
+  USED block at 2ebe021c of size 50\r
+  USED block at 2ebe024e of size 50\r
+  USED block at 2ebe0280 of size 50\r
+  FREE block at 2ebe02b2 of size 14\r
+  USED block at 2ebe02c0 of size 20\r
+  USED block at 2ebe02d4 of size 136\r
+  FREE block at 2ebe035c of size 7328\r
 OK - end of heap\r
 \r
        == near ==\r
 \r
-  USED block at 1ed6f2a6 of size 12\r
-  USED block at 1ed6f2b2 of size 528\r
-  USED block at 1ed6f4c2 of size 72\r
-  USED block at 1ed6f50a of size 20\r
-  USED block at 1ed6f51e of size 20\r
-  USED block at 1ed6f532 of size 20\r
-  USED block at 1ed6f546 of size 20\r
-  USED block at 1ed6f55a of size 20\r
-  USED block at 1ed6f56e of size 2702\r
+  USED block at 1ebdec46 of size 12\r
+  USED block at 1ebdec52 of size 528\r
+  USED block at 1ebdee62 of size 72\r
+  USED block at 1ebdeeaa of size 20\r
+  USED block at 1ebdeebe of size 20\r
+  USED block at 1ebdeed2 of size 20\r
+  USED block at 1ebdeee6 of size 20\r
+  USED block at 1ebdeefa of size 20\r
+  USED block at 1ebdef0e of size 4334\r
 OK - end of heap\r
 \r
        == far ==\r
 \r
-  USED block at 2ed70016 of size 18\r
-  USED block at 2ed70028 of size 50\r
-  USED block at 2ed7005a of size 50\r
-  USED block at 2ed7008c of size 50\r
-  USED block at 2ed700be of size 50\r
-  USED block at 2ed700f0 of size 50\r
-  USED block at 2ed70122 of size 50\r
-  USED block at 2ed70154 of size 50\r
-  USED block at 2ed70186 of size 50\r
-  USED block at 2ed701b8 of size 50\r
-  USED block at 2ed701ea of size 50\r
-  USED block at 2ed7021c of size 50\r
-  USED block at 2ed7024e of size 50\r
-  USED block at 2ed70280 of size 50\r
-  USED block at 2ed702b2 of size 14\r
-  USED block at 2ed702c0 of size 20\r
-  USED block at 2ed702d4 of size 136\r
-  USED block at 2ed7035c of size 7328\r
+  USED block at 2ebe0016 of size 18\r
+  USED block at 2ebe0028 of size 50\r
+  USED block at 2ebe005a of size 50\r
+  USED block at 2ebe008c of size 50\r
+  USED block at 2ebe00be of size 50\r
+  USED block at 2ebe00f0 of size 50\r
+  USED block at 2ebe0122 of size 50\r
+  USED block at 2ebe0154 of size 50\r
+  USED block at 2ebe0186 of size 50\r
+  USED block at 2ebe01b8 of size 50\r
+  USED block at 2ebe01ea of size 50\r
+  USED block at 2ebe021c of size 50\r
+  USED block at 2ebe024e of size 50\r
+  USED block at 2ebe0280 of size 50\r
+  USED block at 2ebe02b2 of size 14\r
+  USED block at 2ebe02c0 of size 20\r
+  USED block at 2ebe02d4 of size 136\r
+  USED block at 2ebe035c of size 7328\r
 OK - end of heap\r
 \r
 Memory Type         Total      Used       Free\r
 ----------------  --------   --------   --------\r
 Default                   8166         806       7360\r
-Near              3414         712       2702\r
+Near              5046         712       4334\r
 Far               8166         806       7360\r
 ----------------  --------   --------   --------\r
-coreleft = 2700\r
-farcoreleft = 1694\r
+coreleft = 4332\r
+farcoreleft = 3326\r
 GetFreeSize = 64548\r
-GetNearFreeSize = 2702\r
+GetNearFreeSize = 4334\r
 GetFarFreeSize = 64548\r
-memavl = 2700\r
-stackavail = 31519\r
+memavl = 4332\r
+stackavail = 31515\r
index 89ef9446f1eb47b42c548c3efefa1f7440d0d34b..8e17e88fd4f0ffe1ee26b2d9424efb8f7a35552b 100755 (executable)
Binary files a/MMDUMP.16W and b/MMDUMP.16W differ
diff --git a/PROFILE.16W b/PROFILE.16W
deleted file mode 100755 (executable)
index e69de29..0000000
diff --git a/cutetest.bat b/cutetest.bat
new file mode 100755 (executable)
index 0000000..efaf91d
--- /dev/null
@@ -0,0 +1,3 @@
+@echo off
+tesuto cute.vrl cute.pal
+
index f162c4cae406a47b40fe8f2dcf6140a03f8edf98..e67dd143650c6ce5d1a2fa7f3daed2791da21720 100755 (executable)
Binary files a/data/g.pal and b/data/g.pal differ
index ee3480f377f4944836f4bca9614676a13bc146fe..1dd10568a4713b5a38a2ee5dd083b50e8f3526e9 100755 (executable)
Binary files a/fmemtest.exe and b/fmemtest.exe differ
index d8891c5e1e3304cedd4cf550e122af5f770c506a..49b58b6541089846df3750f0bec102ffa2bfa3b9 100755 (executable)
Binary files a/fontgfx.exe and b/fontgfx.exe differ
index 22505eb088662aa3fafd7855b53380aa6aacac3e..99e247b8a89a6997c59481e248baa8697c7b7a54 100755 (executable)
Binary files a/fonttest.exe and b/fonttest.exe differ
index 0bc39164704a5a9b0f101c4573e5ae272c24e576..53a9bc31afeee8b7a81899dae1be2d9b0304d979 100755 (executable)
Binary files a/inputest.exe and b/inputest.exe differ
index 4e586f225afa21e9a84570fc186ad21ce6490b2b..2cd4e2a2dc829c4b1eaae5446716a94d343fa9f7 100755 (executable)
@@ -2,62 +2,62 @@
 my $top=`pwd`; chomp $top;
 
 sub vfat_rename($$) {
-       my $from,$to;
-       ($from,$to) = @_;
+    my $from,$to;
+    ($from,$to) = @_;
 
-       # uppercase DOS names with the vfat driver need some forceful convincing
-       # to actually make them lowercase
-       rename($from,"$to.xxx.xx");
-       rename("$to.xxx.xx",$to);
+    # uppercase DOS names with the vfat driver need some forceful convincing
+    # to actually make them lowercase
+    rename($from,"$to.xxx.xx");
+    rename("$to.xxx.xx",$to);
 }
 
 sub scan($) {
-       my $old = `pwd`; chomp $old;
-       my $cur = shift @_;
-       my @x;
-
-       print "scanning $cur\n";
-       chdir($cur) || die;
-
-       opendir(X,".") || return;
-       while (my $name = readdir(X)) {
-               next unless -f $name;
-               my $n = lc($name);
-               next if $n eq $name;
-               print "$name\n";
-               rename($name,$n) || die;
-               vfat_rename($name,$n);
-       }
-       closedir(X);
-
-       opendir(X,".") || return;
-       while (my $name = readdir(X)) {
-               next if $name =~ m/^\.+$/;
-               next if $name eq ".git";
-               next if $name eq ".GIT";
-               next unless -d $name;
-               my $n = lc($name);
-               next if $n eq $name;
-               print "$name\n";
-               rename($name,$n) || die;
-               vfat_rename($name,$n);
-       }
-       closedir(X);
-
-       opendir(X,".") || return;
-       while (my $name = readdir(X)) {
-               next if $name =~ m/^\.+$/;
-               next if $name eq ".git";
-               next if $name eq ".GIT";
-               next unless -d $name;
-               push(@x,$name);
-       }
-       closedir(X);
-       foreach my $name (@x) {
-               scan("$cur/$name");
-       }
-
-       chdir($old) || die;
+    my $old = `pwd`; chomp $old;
+    my $cur = shift @_;
+    my @x;
+
+    print "scanning $cur\n";
+    chdir($cur) || die;
+
+    opendir(X,".") || return;
+    while (my $name = readdir(X)) {
+        next unless -f $name;
+        my $n = lc($name);
+        next if $n eq $name;
+        print "$name\n";
+        rename($name,$n) || die;
+        vfat_rename($name,$n);
+    }
+    closedir(X);
+
+    opendir(X,".") || return;
+    while (my $name = readdir(X)) {
+        next if $name =~ m/^\.+$/;
+        next if $name eq ".git";
+        next if $name eq ".GIT";
+        next unless -d $name;
+        my $n = lc($name);
+        next if $n eq $name;
+        print "$name\n";
+        rename($name,$n) || die;
+        vfat_rename($name,$n);
+    }
+    closedir(X);
+
+    opendir(X,".") || return;
+    while (my $name = readdir(X)) {
+        next if $name =~ m/^\.+$/;
+        next if $name eq ".git";
+        next if $name eq ".GIT";
+        next unless -d $name;
+        push(@x,$name);
+    }
+    closedir(X);
+    foreach my $name (@x) {
+        scan("$cur/$name");
+    }
+
+    chdir($old) || die;
 }
 
 scan($top);
index 705665de297a860b06fefed850a2c59fddb1b0b3..478641222e156f807288f5eb315aa8bb58dd30b3 100755 (executable)
--- a/makefile
+++ b/makefile
@@ -4,23 +4,23 @@
 #
 # Possible optimizations for 8088 class processors
 #
-# -oa   Relax alias checking
-# -ob   Try to generate straight line code
+# -oa  Relax alias checking
+# -ob  Try to generate straight line code
 # -oe - expand user functions inline (-oe=20 is default, adds lots of code)
-# -oh   Enable repeated optimizations
-# -oi   generate certain lib funcs inline
-# -oi+  Set max inline depth (C++ only, use -oi for C)
-# -ok   Flowing of register save into function flow graph
-# -ol   loop optimizations
-# -ol+  loop optimizations plus unrolling
-# -or   Reorder for pipelined (486+ procs); not sure if good to use
-# -os   Favor space over time
-# -ot   Favor time over space
-# -ei   Allocate an "int" for all enum types
-# -zp2  Allow compiler to add padding to structs
-# -zpw  Use with above; make sure you are warning free!
-# -0    8088/8086 class code generation
-# -s    disable stack overflow checking
+# -oh  Enable repeated optimizations
+# -oi  generate certain lib funcs inline
+# -oi  +Set max inline depth (C++ only, use -oi for C)
+# -ok  Flowing of register save into function flow graph
+# -ol  loop optimizations
+# -ol+ loop optimizations plus unrolling
+# -or  Reorder for pipelined (486+ procs); not sure if good to use
+# -os  Favor space over time
+# -ot  Favor time over space
+# -ei  Allocate an "int" for all enum types
+# -zp2 Allow compiler to add padding to structs
+# -zpw Use with above; make sure you are warning free!
+# -0   8088/8086 class code generation
+# -s   disable stack overflow checking
 
 # -zk0u        translate kanji to unicode... wwww
 # -zk0 kanji support~
@@ -66,7 +66,7 @@ SRCLIB=src/lib
 JSMNLIB=src/lib/jsmn
 NYANLIB=src/lib/nyan
 EXMMLIB=src/lib/exmm
-MODEXLIB16=src/lib/modex16
+MODEXLIB16=src/lib/16_vl
 MODEXLIB=src/lib/modex
 VGMSNDLIB=src/lib/vgmsnd
 DOSLIB=src/lib/doslib
@@ -88,10 +88,10 @@ UPXQ=-qqq
 #
 # compile flags
 #
-S_FLAGS=-sg -st -of+ -zu -zdf -zff -zgf -k32768#54096#60000
+S_FLAGS=-sg -st -of+ -zu -zdf -zff -zgf -zq -k32768#54096#60000
 Z_FLAGS=-zk0 -zc -zp8 -zm
 O_FLAGS=-obmilr -oe=24 -out -oh -ei -onac -ol+ -ok##x
-T_FLAGS=-bt=dos -mh -0 -fpi87 -fo=.$(OBJ) -d1###### -e=65536
+T_FLAGS=-bt=dos -wx -mh -0 -fpi87 -fo=.$(OBJ) -d1###### -e=65536
 
 CPPFLAGS=-DTARGET_MSDOS=16 -DMSDOS=1
 !ifeq DEBUGSERIAL 1
@@ -106,8 +106,9 @@ LIBFLAGS=$(WLIBQ) -b -n
 # objects
 #
 VGMSNDOBJ = vgmSnd.$(OBJ) 16_snd.$(OBJ)
-GFXLIBOBJS = modex16.$(OBJ) bitmap.$(OBJ) 16text.$(OBJ) bakapee.$(OBJ) zcroll16.$(OBJ) 16render.$(OBJ) 16_vrs.$(OBJ) 16_sprit.$(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)
+OLDLIBOBJS=bitmap.$(OBJ) mapread.$(OBJ) 16render.$(OBJ)
+GFXLIBOBJS = 16_vl.$(OBJ) 16text.$(OBJ) bakapee.$(OBJ) scroll16.$(OBJ) 16_vrs.$(OBJ) 16_sprit.$(OBJ) $(OLDLIBOBJS)
+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) jsmn.$(OBJ)
 #16planar.$(OBJ) planar.$(OBJ)
 DOSLIBOBJ = adlib.$(OBJ) 8254.$(OBJ) 8259.$(OBJ) dos.$(OBJ) cpu.$(OBJ)
 !ifeq DEBUGSERIAL 1
@@ -154,101 +155,102 @@ DOSLIBLIBS += $(DOSLIB_8250)/dos86h/8250.lib
 # List of executables to build
 #
 TESTEXEC = &
-    tesuto.exe &
-    0.exe &
-    scroll.exe &
-    zcroll.exe &
-    exmmtest.exe &
-    vrstest.exe
+       tesuto.exe &
+       0.exe &
+       scroll.exe &
+       zcroll.exe &
+       exmmtest.exe &
+       vrstest.exe
 TESTEXEC2 = &
-    vgmtest.exe &
-    inputest.exe &
-    maptest.exe &
-    fmemtest.exe &
-    fonttest.exe &
-    fontgfx.exe &
-    test.exe &
-    test0.exe &
-    pcxtest.exe &
-    pcxtest2.exe
+       vgmtest.exe &
+       inputest.exe &
+       maptest.exe &
+       fmemtest.exe &
+       fonttest.exe &
+       fontgfx.exe &
+       test.exe &
+       test0.exe &
+       pcxtest.exe &
+       pcxtest2.exe
 UTILEXEC = &
-    palettel.exe &
-    palettec.exe
+       palettel.exe &
+       palettec.exe
 EXEC = &
-    16.exe &
-    bakapi.exe &
-    $(UTILEXEC) &
-    $(TESTEXEC)
+       16.exe &
+       bakapi.exe &
+       $(UTILEXEC) &
+       $(TESTEXEC)
 
 all: $(EXEC) joytest.exe
+testexec: $(EXEC) joytest.exe $(TESTEXEC2)
 
 #
 # game and bakapi executables
 #
-16.exe:           16.$(OBJ) mapread.$(OBJ) jsmn.$(OBJ) $(16LIB) gfx.lib $(DOSLIBLIBS)
-bakapi.exe:       bakapi.$(OBJ) gfx.lib $(DOSLIBLIBS)
+16.exe:                16.$(OBJ) $(16LIB) gfx.lib $(DOSLIBLIBS)
+bakapi.exe:            bakapi.$(OBJ) gfx.lib $(DOSLIBLIBS)
 
 #
 # Test Executables!
 #
-scroll.exe:       scroll.$(OBJ) mapread.$(OBJ) jsmn.$(OBJ) $(16LIB) gfx.lib $(DOSLIBLIBS)
-scroll.$(OBJ):    $(SRC)/scroll.c
-zcroll.exe:       zcroll.$(OBJ) 16_map.$(OBJ) jsmn.$(OBJ) $(16LIB) gfx.lib $(DOSLIBLIBS)
-zcroll.$(OBJ):    $(SRC)/zcroll.c
-tesuto.exe:       tesuto.$(OBJ) 16_head.$(OBJ) gfx.lib $(DOSLIBLIBS)
-tesuto.$(OBJ):    $(SRC)/tesuto.c
-0.exe:            0.$(OBJ) $(16LIB) gfx.lib $(DOSLIBLIBS)
-0.$(OBJ):         $(SRC)/0.c
-test.exe:         test.$(OBJ) $(16LIB) gfx.lib $(DOSLIBLIBS)
-#test2.exe:       test2.$(OBJ) gfx.lib $(DOSLIBLIBS)
-test0.exe:        test0.$(OBJ)
-fonttest.exe:     fonttest.$(OBJ) gfx.lib
-#fonttes0.exe:    fonttes0.$(OBJ) $(16LIB)
-fontgfx.exe:      fontgfx.$(OBJ) gfx.lib $(DOSLIBLIBS)
-inputest.exe:     inputest.$(OBJ) $(16LIB) $(DOSLIBLIBS)
-#sountest.exe:    sountest.$(OBJ) $(16LIB)
-pcxtest.exe:      pcxtest.$(OBJ) gfx.lib $(DOSLIBLIBS)
-vrstest.exe:      vrstest.$(OBJ) $(16LIB) gfx.lib $(DOSLIBLIBS)
-#vgacamm.exe:      vgacamm.$(OBJ) $(16LIB) gfx.lib $(DOSLIBLIBS)
-palettec.exe:     palettec.$(OBJ) gfx.lib $(DOSLIBLIBS)
-palettel.exe:     palettel.$(OBJ) gfx.lib $(DOSLIBLIBS)
-pcxtest2.exe:     pcxtest2.$(OBJ) gfx.lib $(DOSLIBLIBS)
-#planrpcx.exe:    planrpcx.$(OBJ) gfx.lib
-maptest.exe:      maptest.$(OBJ) 16_map.$(OBJ) 16_head.$(OBJ) jsmn.$(OBJ) gfx.lib $(DOSLIBLIBS)
-fmemtest.exe:     fmemtest.$(OBJ)
-exmmtest.exe:     exmmtest.$(OBJ) $(16LIB) $(DOSLIBLIBS)
-vgmtest.exe:      vgmtest.$(OBJ) vgmsnd.lib $(16LIB) $(DOSLIBLIBS)
+scroll.exe:    scroll.$(OBJ) $(16LIB) gfx.lib $(DOSLIBLIBS)
+scroll.$(OBJ): $(SRC)/scroll.c
+zcroll.exe:    zcroll.$(OBJ) $(16LIB) gfx.lib $(DOSLIBLIBS)
+zcroll.$(OBJ): $(SRC)/zcroll.c
+tesuto.exe:    tesuto.$(OBJ) 16_head.$(OBJ) gfx.lib $(DOSLIBLIBS)
+tesuto.$(OBJ): $(SRC)/tesuto.c
+0.exe:                 0.$(OBJ) $(16LIB) gfx.lib $(DOSLIBLIBS)
+0.$(OBJ):               $(SRC)/0.c
+test.exe:               test.$(OBJ) $(16LIB) gfx.lib $(DOSLIBLIBS)
+#test2.exe:    test2.$(OBJ) gfx.lib $(DOSLIBLIBS)
+test0.exe:             test0.$(OBJ)
+fonttest.exe:   fonttest.$(OBJ) gfx.lib
+#fonttes0.exe: fonttes0.$(OBJ) $(16LIB)
+fontgfx.exe:   fontgfx.$(OBJ) gfx.lib $(DOSLIBLIBS)
+inputest.exe:   inputest.$(OBJ) $(16LIB) $(DOSLIBLIBS)
+#sountest.exe: sountest.$(OBJ) $(16LIB)
+pcxtest.exe:   pcxtest.$(OBJ) gfx.lib $(DOSLIBLIBS)
+vrstest.exe:   vrstest.$(OBJ) $(16LIB) gfx.lib $(DOSLIBLIBS)
+#vgacamm.exe:  vgacamm.$(OBJ) $(16LIB) gfx.lib $(DOSLIBLIBS)
+palettec.exe:   palettec.$(OBJ) gfx.lib $(DOSLIBLIBS)
+palettel.exe:   palettel.$(OBJ) gfx.lib $(DOSLIBLIBS)
+pcxtest2.exe:   pcxtest2.$(OBJ) gfx.lib $(DOSLIBLIBS)
+#planrpcx.exe: planrpcx.$(OBJ) gfx.lib
+maptest.exe:   maptest.$(OBJ) 16_map.$(OBJ) 16_head.$(OBJ) gfx.lib $(DOSLIBLIBS)
+fmemtest.exe:   fmemtest.$(OBJ)
+exmmtest.exe:   exmmtest.$(OBJ) $(16LIB) $(DOSLIBLIBS)
+vgmtest.exe:   vgmtest.$(OBJ) vgmsnd.lib $(16LIB) $(DOSLIBLIBS)
 
 #
 # executable's objects
 #
-16.$(OBJ):        $(SRC)/16.c $(SRC)/16.h
-bakapi.$(OBJ):    $(SRC)/bakapi.c $(SRC)/bakapi.h
-test.$(OBJ):      $(SRC)/test.c $(SRCLIB)/modex16.h
-#test2.$(OBJ):    $(SRC)/test2.c $(SRCLIB)/modex16.h
-test0.$(OBJ):     $(SRC)/test0.c
-pcxtest.$(OBJ):   $(SRC)/pcxtest.c $(SRCLIB)/modex16.h
-vrstest.$(OBJ):   $(SRC)/vrstest.c $(SRCLIB)/modex16.h
-#vgacamm.$(OBJ):   $(SRC)/vgacamm.c $(SRCLIB)/modex16.h
-#planrpcx.$(OBJ): $(SRC)/planrpcx.c $(SRCLIB)/modex16.h
-pcxtest2.$(OBJ):  $(SRC)/pcxtest2.c $(SRCLIB)/modex16.h
-palettec.$(OBJ):  $(SRC)/palettec.c
-palettel.$(OBJ):  $(SRC)/palettel.c
-maptest.$(OBJ):   $(SRC)/maptest.c $(SRCLIB)/modex16.h
-#emmtest.$(OBJ):  $(SRC)/emmtest.c
-#emsdump.$(OBJ):  $(SRC)/emsdump.c
-fmemtest.$(OBJ):  $(SRC)/fmemtest.c
-fonttest.$(OBJ):  $(SRC)/fonttest.c
+16.$(OBJ):             $(SRC)/16.c $(SRC)/16.h
+bakapi.$(OBJ): $(SRC)/bakapi.c $(SRC)/bakapi.h
+test.$(OBJ):   $(SRC)/test.c $(SRCLIB)/16_vl.h
+#test2.$(OBJ): $(SRC)/test2.c $(SRCLIB)/16_vl.h
+test0.$(OBJ):   $(SRC)/test0.c
+pcxtest.$(OBJ):$(SRC)/pcxtest.c $(SRCLIB)/16_vl.h
+vrstest.$(OBJ):$(SRC)/vrstest.c $(SRCLIB)/16_vl.h
+#vgacamm.$(OBJ):$(SRC)/vgacamm.c $(SRCLIB)/16_vl.h
+#planrpcx.$(OBJ): $(SRC)/planrpcx.c $(SRCLIB)/16_vl.h
+pcxtest2.$(OBJ):$(SRC)/pcxtest2.c $(SRCLIB)/16_vl.h
+palettec.$(OBJ):$(SRC)/palettec.c
+palettel.$(OBJ):$(SRC)/palettel.c
+maptest.$(OBJ):$(SRC)/maptest.c $(SRCLIB)/16_vl.h
+#emmtest.$(OBJ):$(SRC)/emmtest.c
+#emsdump.$(OBJ):$(SRC)/emsdump.c
+fmemtest.$(OBJ):$(SRC)/fmemtest.c
+fonttest.$(OBJ):$(SRC)/fonttest.c
 #fonttes0.$(OBJ): $(SRC)/fonttes0.c
-fontgfx.$(OBJ):   $(SRC)/fontgfx.c
-inputest.$(OBJ):  $(SRC)/inputest.c
+fontgfx.$(OBJ):$(SRC)/fontgfx.c
+inputest.$(OBJ):$(SRC)/inputest.c
 #sountest.$(OBJ): $(SRC)/sountest.c
 #miditest.$(OBJ): $(SRC)/miditest.c
-#testemm.$(OBJ):  $(SRC)/testemm.c
+#testemm.$(OBJ):$(SRC)/testemm.c
 #testemm0.$(OBJ): $(SRC)/testemm0.c
 #tsthimem.$(OBJ): $(SRC)/tsthimem.c
-exmmtest.$(OBJ):  $(SRC)/exmmtest.c
-vgmtest.$(OBJ):   $(SRC)/vgmtest.c
+exmmtest.$(OBJ):$(SRC)/exmmtest.c
+vgmtest.$(OBJ):$(SRC)/vgmtest.c
 
 #
 # non executable objects libraries
@@ -278,37 +280,36 @@ joytest.exe:
        cd $(DOSLIB_JOYSTICK:$(to_os_path)) && $(DOSLIBMAKE) && cd $(BUILD_ROOT)
        $(COPYCOMMAND) $(DOSLIB_JOYSTICK:$(to_os_path))$(DIRSEP)dos86h$(DIRSEP)test.exe joytest.exe
 
-modex16.$(OBJ):   $(SRCLIB)/modex16.c $(SRCLIB)/modex16.h
-bakapee.$(OBJ):   $(SRCLIB)/bakapee.c $(SRCLIB)/bakapee.h
-16render.$(OBJ):  $(SRCLIB)/16render.c $(SRCLIB)/16render.h
-16planar.$(OBJ):  $(MODEXLIB16)/16planar.c $(MODEXLIB16)/16planar.h
-16_vrs.$(OBJ):    $(SRCLIB)/16_vrs.c $(SRCLIB)/16_vrs.h $(DOSLIBLIBS)
-16_sprit.$(OBJ):  $(SRCLIB)/16_sprit.c $(SRCLIB)/16_sprit.h
-bitmap.$(OBJ):    $(SRCLIB)/bitmap.c $(SRCLIB)/bitmap.h
-planar.$(OBJ):    $(SRCLIB)/planar.c $(SRCLIB)/planar.h
-16text.$(OBJ):    $(SRCLIB)/16text.c
-scroll16.$(OBJ):  $(SRCLIB)/scroll16.c $(SRCLIB)/scroll16.h
-zcroll16.$(OBJ):  $(SRCLIB)/zcroll16.c $(SRCLIB)/zcroll16.h
-mapread.$(OBJ):   $(SRCLIB)/mapread.c $(SRCLIB)/mapread.h
-16_map.$(OBJ):   $(SRCLIB)/16_map.c $(SRCLIB)/16_map.h
-16_timer.$(OBJ):  $(SRCLIB)/16_timer.c $(SRCLIB)/16_timer.h
-16_in.$(OBJ):     $(SRCLIB)/16_in.c $(SRCLIB)/16_in.h
-16_mm.$(OBJ):     $(SRCLIB)/16_mm.c $(SRCLIB)/16_mm.h
-16_pm.$(OBJ):     $(SRCLIB)/16_pm.c $(SRCLIB)/16_pm.h
-16_ca.$(OBJ):     $(SRCLIB)/16_ca.c $(SRCLIB)/16_ca.h
-16_dbg.$(OBJ):    $(SRCLIB)/16_dbg.c $(SRCLIB)/16_dbg.h
-midi.$(OBJ):      $(SRCLIB)/midi.c $(SRCLIB)/midi.h
-16_head.$(OBJ):   $(SRCLIB)/16_head.c $(SRCLIB)/16_head.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
-kitten.$(OBJ):    $(NYANLIB)/kitten.c $(NYANLIB)/kitten.h
-vgmSnd.$(OBJ):    $(VGMSNDLIB)/vgmSnd.c $(VGMSNDLIB)/vgmSnd.h
-wcpu.$(OBJ):      $(WCPULIB)/wcpu.c $(WCPULIB)/wcpu.h
-#memory.$(OBJ):   $(EXMMLIB)/memory.c $(EXMMLIB)/memory.h
-c_utils.$(OBJ):   $(MODEXLIB)/c_utils.asm
-modex.$(OBJ):     $(MODEXLIB)/modex.asm
+16_vl.$(OBJ):$(SRCLIB)/16_vl.c $(SRCLIB)/16_vl.h
+bakapee.$(OBJ):$(SRCLIB)/bakapee.c $(SRCLIB)/bakapee.h
+16render.$(OBJ):$(SRCLIB)/16render.c $(SRCLIB)/16render.h
+16planar.$(OBJ):$(MODEXLIB16)/16planar.c $(MODEXLIB16)/16planar.h
+16_vrs.$(OBJ): $(SRCLIB)/16_vrs.c $(SRCLIB)/16_vrs.h $(DOSLIBLIBS)
+16_sprit.$(OBJ):$(SRCLIB)/16_sprit.c $(SRCLIB)/16_sprit.h
+bitmap.$(OBJ): $(SRCLIB)/bitmap.c $(SRCLIB)/bitmap.h
+planar.$(OBJ): $(SRCLIB)/planar.c $(SRCLIB)/planar.h
+scroll16.$(OBJ):$(SRCLIB)/scroll16.c $(SRCLIB)/scroll16.h
+16text.$(OBJ): $(SRCLIB)/16text.c
+mapread.$(OBJ):$(SRCLIB)/mapread.c $(SRCLIB)/mapread.h
+16_map.$(OBJ):$(SRCLIB)/16_map.c $(SRCLIB)/16_map.h
+16_timer.$(OBJ):$(SRCLIB)/16_timer.c $(SRCLIB)/16_timer.h
+16_in.$(OBJ):   $(SRCLIB)/16_in.c $(SRCLIB)/16_in.h
+16_mm.$(OBJ):   $(SRCLIB)/16_mm.c $(SRCLIB)/16_mm.h
+16_pm.$(OBJ):   $(SRCLIB)/16_pm.c $(SRCLIB)/16_pm.h
+16_ca.$(OBJ):   $(SRCLIB)/16_ca.c $(SRCLIB)/16_ca.h
+16_dbg.$(OBJ): $(SRCLIB)/16_dbg.c $(SRCLIB)/16_dbg.h
+midi.$(OBJ):   $(SRCLIB)/midi.c $(SRCLIB)/midi.h
+16_head.$(OBJ):$(SRCLIB)/16_head.c $(SRCLIB)/16_head.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
+kitten.$(OBJ): $(NYANLIB)/kitten.c $(NYANLIB)/kitten.h
+vgmSnd.$(OBJ): $(VGMSNDLIB)/vgmSnd.c $(VGMSNDLIB)/vgmSnd.h
+wcpu.$(OBJ):   $(WCPULIB)/wcpu.c $(WCPULIB)/wcpu.h
+#memory.$(OBJ):$(EXMMLIB)/memory.c $(EXMMLIB)/memory.h
+c_utils.$(OBJ):$(MODEXLIB)/c_utils.asm
+modex.$(OBJ):   $(MODEXLIB)/modex.asm
 
 #
 #other~
@@ -375,7 +376,7 @@ getwww: .symbolic
        *x4get.bat $(EXEC)
 
 vomitchan: .symbolic
-       @$(DUMP) *.err
+       @if exist *.err $(DUMP) *.err
 
 ##
 ##     External library management~ ^^
@@ -405,6 +406,7 @@ reinitlibs: .symbolic
        @rm -rf 16/CatacombApocalypse
        @rm -rf 16/wolf3d
        @rm -rf 16/keen
+       @rm -rf 16/Catacomb3D
        @wmake -h initlibs
 
 initlibs: .symbolic
index e8e04a6334c12c6029476bcdd34538c249171006..e387020e13be95fb4c16c586280a10056b7a0991 100755 (executable)
Binary files a/maptest.exe and b/maptest.exe differ
index 9f5b82174631569b519c3e0442bf0c97aaede4b1..5febf45293dfeda02f70d9cafecc76f9aab9516c 100755 (executable)
Binary files a/pcxtest.exe and b/pcxtest.exe differ
index ef3287a22a56c19090d4ebbee191a85eddfa4250..caffd3da7ada24a40a0d33f61dc25a6750775299 100755 (executable)
Binary files a/pcxtest2.exe and b/pcxtest2.exe differ
diff --git a/pm.use b/pm.use
index fbd7a2c7333e0bbccd830cfba456f3c9c3fe02fa..651d085cc2677ec95dd3c7f8a8785d17576c18e2 100755 (executable)
--- a/pm.use
+++ b/pm.use
@@ -90,19 +90,21 @@ Binary file 16/wf3d8086/obj/wolf3d.exe matches
 16/wf3d8086/obj/wolf3d.map: 1A26:111E       _PM_Startup\r
 16/wf3d8086/obj/wolf3d.map: 1A26:11CF       _PM_Shutdown\r
 16/wf3d8086/oldscale.c:        shape = PM_GetSpritePage (shapenum);\r
-16/wf3d8086/oldscale.c:        shape = PM_GetSpritePage (shapenum);\r
+16/wf3d8086/oldscale.c:        shape = PM_GetSpritePage (shapenum);
+
+\r
 16/wf3d8086/wl_act2.c: PM_UnlockMainMem ();\r
-16/wf3d8086/wl_act2.c: PM_CheckMainMem ();\r
+16/wf3d8086/wl_act2.c: PM_CheckMainMem ();
 16/wf3d8086/wl_debug.c:                addr = PM_GetPageAddress(i);\r
 16/wf3d8086/wl_debug.c:                                PM_GetPage(j);\r
-16/wf3d8086/wl_debug.c:                        PM_GetPage(i);\r
+16/wf3d8086/wl_debug.c:                        PM_GetPage(i);
 16/wf3d8086/wl_draw.c:         *( ((unsigned *)&postsource)+1) = (unsigned)PM_GetPage(wallpic);\r
 16/wf3d8086/wl_draw.c:         *( ((unsigned *)&postsource)+1) = (unsigned)PM_GetPage(wallpic);\r
 16/wf3d8086/wl_draw.c:         *( ((unsigned *)&postsource)+1) = (unsigned)PM_GetPage(doorpage);\r
 16/wf3d8086/wl_draw.c:         *( ((unsigned *)&postsource)+1) = (unsigned)PM_GetPage(doorpage+1);\r
 16/wf3d8086/wl_draw.c:         *( ((unsigned *)&postsource)+1) = (unsigned)PM_GetPage(wallpic);\r
 16/wf3d8086/wl_draw.c:         *( ((unsigned *)&postsource)+1) = (unsigned)PM_GetPage(wallpic);\r
-16/wf3d8086/wl_draw.c: PM_NextFrame();\r
+16/wf3d8086/wl_draw.c: PM_NextFrame();
 16/wf3d8086/wl_game.c: PM_UnlockMainMem();\r
 16/wf3d8086/wl_game.c: PM_CheckMainMem ();\r
 16/wf3d8086/wl_game.c: PM_CheckMainMem ();\r
@@ -120,7 +122,9 @@ Binary file 16/wf3d8086/obj/wolf3d.exe matches
 16/wf3d8086/wl_play.c:         PM_CheckMainMem ();\r
 16/wf3d8086/wl_play.c:         PM_CheckMainMem ();\r
 16/wf3d8086/wl_scale.c:        shape = PM_GetSpritePage (shapenum);\r
-16/wf3d8086/wl_scale.c:        shape = PM_GetSpritePage (shapenum);\r
+16/wf3d8086/wl_scale.c:        shape = PM_GetSpritePage (shapenum);
+
+\r
 16/wf3d8086/wolf3d.map: 19127H 1A286H 01160H ID_PM_TEXT         CODE\r
 16/wf3d8086/wolf3d.map: 1912:0007 1160 C=CODE   S=ID_PM_TEXT     G=(none)  M=ID_PM.C    ACBP=28\r
 16/wf3d8086/wolf3d.map: 1912:02DF       _PM_CheckMainMem\r
diff --git a/q.sh b/q.sh
new file mode 100755 (executable)
index 0000000..db78af5
--- /dev/null
+++ b/q.sh
@@ -0,0 +1 @@
+grep -iR "$1" src/*
index 7f792bbb53601129973ca8d5db93aea447649d17..958a8e392f5abb150642d11a985dc7bf9d098932 100755 (executable)
--- a/src/16.h
+++ b/src/16.h
@@ -25,7 +25,7 @@
 \r
 #include "src/lib/16_head.h"\r
 #include "src/lib/16_in.h"\r
-#include "src/lib/modex16.h"\r
+#include "src/lib/16_vl.h"\r
 #include "src/lib/wcpu/wcpu.h"\r
 //#include "src/lib/planar.h"\r
 #include "src/lib/scroll16.h"\r
index f68d148e99bb4e1e2bff099a8cf7d50a796f985d..fc4eb11d61660c75a2d99dc86e7ebe282a03dc68 100755 (executable)
@@ -28,7 +28,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/modex16.h"\r
+//#include "src/lib/16_vl.h"\r
 #pragma hdrstop\r
 \r
 #pragma warn -pro\r
@@ -69,9 +69,9 @@ main(int argc, char *argv[])
 {\r
        byte w=1;\r
        static global_game_variables_t gvar;\r
-#ifdef __WATCOMC__\r
-       __segment sega;\r
-#endif\r
+//#ifdef __WATCOMC__\r
+//     __segment sega;\r
+//#endif\r
        memptr bigbuffer;\r
 \r
        //static byte bakapee[64];\r
@@ -133,9 +133,9 @@ for(w=0;w<2;w++)
        }\r
 //     close(bakapeehandle);\r
        //hmm functions in cache system use the buffered stuff\r
-#ifdef __WATCOMC__\r
-       printf("\nsize of big buffer~=%u\n", _bmsize(sega, bigbuffer));\r
-#endif\r
+//#ifdef __WATCOMC__\r
+//     printf("\nsize of big buffer~=%u\n", _bmsize(sega, bigbuffer));\r
+//#endif\r
 \r
        printf("contents of the buffer\n[\n%s\n]\n", bigbuffer);\r
        //printf("dark purple = purgable\n");\r
index 354a897bf5bdab0ee7bead1886db0717071975ea..e25a130a07f1e0c22e46559f4af06dcf1af91ca9 100755 (executable)
@@ -21,9 +21,9 @@
  */\r
 #include <stdio.h>\r
 #include <conio.h>\r
-#include "lib/types.h"\r
+#include "src/lib/types.h"\r
 //#include "lib/16text.h"\r
-#include "lib/modex16.h"\r
+#include "src/lib/16_vl.h"\r
 \r
 #include <hw/cpu/cpu.h>\r
 #include <hw/dos/dos.h>\r
index be6ac4a2a725284c1f958afa1ada71b7fd4b86e5..a573d54a8e769cf0d86fde5781dd2506a723f3a9 100755 (executable)
@@ -30,7 +30,7 @@ main(int argc, char *argv[])
        global_game_variables_t gvar;\r
        player_t player[MaxPlayers];\r
        //extern struct inconfig inpu;\r
-       dbg_testkeyin=0;\r
+       dbg_testkeyin=1;\r
        dbg_testcontrolnoisy=1;\r
        IN_Startup();\r
        IN_Default(0,&player,ctrl_Joystick1);\r
index 74fb0f676feae633d3e3eda60fd079cb7f5cde83..7298ca3f6639ae93daa497da0a3419d8dbe68b25 100755 (executable)
@@ -223,7 +223,7 @@ void CAL_GetGrChunkLength (int chunk)
 \r
 boolean CA_FarRead(int handle, byte huge *dest, dword length, global_game_variables_t *gvar)\r
 {\r
-       boolean flag;\r
+       boolean flag=0;\r
        //dword fat=0;\r
        //word segm=0;\r
        if(gvar->pm.emm.EMSVer<0x40)\r
@@ -239,45 +239,45 @@ boolean CA_FarRead(int handle, byte huge *dest, dword length, global_game_variab
 \r
        //if(!fat&&!segm)\r
        //{\r
-               __asm {\r
-                       push    ds\r
-                       mov     bx,[handle]\r
-                       mov     cx,[WORD PTR length]\r
-                       mov     dx,[WORD PTR dest]\r
-                       mov     ds,[WORD PTR dest+2]\r
-                       mov     ah,0x3f                         // READ w/handle\r
-                       int     21h\r
-                       pop     ds\r
-                       jnc     good\r
-                       mov     errno,ax\r
-                       mov     flag,0\r
-                       jmp End\r
+       __asm {\r
+               push    ds\r
+               mov     bx,[handle]\r
+               mov     cx,[WORD PTR length]\r
+               mov     dx,[WORD PTR dest]\r
+               mov     ds,[WORD PTR dest+2]\r
+               mov     ah,0x3f                         // READ w/handle\r
+               int     21h\r
+               pop     ds\r
+               jnc     good\r
+               mov     errno,ax\r
+               mov     flag,0\r
+               jmp End\r
 #ifdef __BORLANDC__\r
-               }\r
+       }\r
 #endif\r
 good:\r
 #ifdef __BORLANDC__\r
-               __asm {\r
+       __asm {\r
 #endif\r
-                       cmp     ax,[WORD PTR length]\r
-                       je      done\r
-//                     errno = EINVFMT;                        // user manager knows this is bad read\r
-                       mov     flag,0\r
-                       jmp End\r
+               cmp     ax,[WORD PTR length]\r
+               je      done\r
+//             errno = EINVFMT;                        // user manager knows this is bad read\r
+               mov     flag,0\r
+               jmp End\r
 #ifdef __BORLANDC__\r
-               }\r
+       }\r
 #endif\r
 done:\r
 #ifdef __BORLANDC__\r
-               __asm {\r
+       __asm {\r
 #endif\r
-                       mov     flag,1\r
+               mov     flag,1\r
 #ifdef __BORLANDC__\r
-               }\r
+       }\r
 #endif\r
 End:\r
 #ifdef __WATCOMC__\r
-               }\r
+       }\r
 #endif\r
        return flag;\r
 }\r
@@ -295,7 +295,7 @@ End:
 \r
 boolean CA_FarWrite(int handle, byte huge *source, dword length, global_game_variables_t *gvar)\r
 {\r
-       boolean flag;\r
+       boolean flag=0;\r
        //dword fat=0;\r
        //word segm=0;\r
        if(gvar->pm.emm.EMSVer<0x40)\r
@@ -311,45 +311,45 @@ boolean CA_FarWrite(int handle, byte huge *source, dword length, global_game_var
 \r
        //if(!fat&&!segm)\r
        //{\r
-               __asm {\r
-                       push    ds\r
-                       mov     bx,[handle]\r
-                       mov     cx,[WORD PTR length]\r
-                       mov     dx,[WORD PTR source]\r
-                       mov     ds,[WORD PTR source+2]\r
-                       mov     ah,0x40                 // WRITE w/handle\r
-                       int     21h\r
-                       pop     ds\r
-                       jnc     good\r
-                       mov     errno,ax\r
-                       mov flag,0\r
-                       jmp End\r
+       __asm {\r
+               push    ds\r
+               mov     bx,[handle]\r
+               mov     cx,[WORD PTR length]\r
+               mov     dx,[WORD PTR source]\r
+               mov     ds,[WORD PTR source+2]\r
+               mov     ah,0x40                 // WRITE w/handle\r
+               int     21h\r
+               pop     ds\r
+               jnc     good\r
+               mov     errno,ax\r
+               mov flag,0\r
+               jmp End\r
 #ifdef __BORLANDC__\r
-               }\r
+       }\r
 #endif\r
 good:\r
 #ifdef __BORLANDC__\r
-               __asm {\r
+       __asm {\r
 #endif\r
-                       cmp     ax,[WORD PTR length]\r
-                       je      done\r
-                       //errno = ENOMEM;                               // user manager knows this is bad write\r
-                       mov     flag,0\r
-                       jmp End\r
+               cmp     ax,[WORD PTR length]\r
+               je      done\r
+//             errno = ENOMEM;                         // user manager knows this is bad write\r
+               mov     flag,0\r
+               jmp End\r
 #ifdef __BORLANDC__\r
-               }\r
+       }\r
 #endif\r
 done:\r
 #ifdef __BORLANDC__\r
-               __asm {\r
+       __asm {\r
 #endif\r
-                       mov     flag,1\r
+               mov     flag,1\r
 #ifdef __BORLANDC__\r
-               }\r
+       }\r
 #endif\r
 End:\r
 #ifdef __WATCOMC__\r
-               }\r
+       }\r
 #endif\r
        return flag;\r
 }\r
@@ -398,7 +398,7 @@ boolean CA_ReadFile(char *filename, memptr *ptr, global_game_variables_t *gvar)
 boolean CA_WriteFile (char *filename, void far *ptr, long length, global_game_variables_t *gvar)\r
 {\r
        int handle;\r
-       sdword size;\r
+       //sdword size;\r
        //long size;\r
 \r
        handle = open(filename,O_CREAT | O_BINARY | O_WRONLY,\r
@@ -503,10 +503,10 @@ void CAL_HuffExpand (byte huge *source, byte huge *dest,
 {\r
 //  unsigned bit,byte,node,code;\r
   unsigned sourceseg,sourceoff,destseg,destoff,endoff;\r
-  huffnode *headptr;\r
+       huffnode *headptr;\r
 //  huffnode *nodeon;\r
 \r
-  headptr = hufftable+254;     // head node is allways node 254\r
+       headptr = hufftable+254;        // head node is allways node 254\r
 \r
   source++;    // normalize\r
   source--;\r
@@ -533,7 +533,7 @@ void CAL_HuffExpand (byte huge *source, byte huge *dest,
 //--------------------------\r
 \r
        __asm {\r
-////           mov     bx,[headptr]\r
+               mov     bx,[word ptr headptr]\r
 \r
                mov     si,[sourceoff]\r
                mov     di,[destoff]\r
@@ -597,7 +597,7 @@ storebyteshort:
 #endif\r
                mov     [es:di],dl\r
                inc     di                                      // write a decopmpressed byte out\r
-////           mov     bx,[headptr]            // back to the head node for next bit\r
+               mov     bx,[word ptr headptr]           // back to the head node for next bit\r
 \r
                cmp     di,ax                           // done?\r
                jne     expandshort\r
@@ -613,7 +613,7 @@ storebyteshort:
   length--;\r
 \r
        __asm {\r
-////           mov     bx,[headptr]\r
+               mov     bx,[word ptr headptr]\r
                mov     cl,1\r
 \r
                mov     si,[sourceoff]\r
@@ -685,7 +685,7 @@ storebyte:
 #endif\r
                mov     [es:di],dl\r
                inc     di              // write a decopmpressed byte out\r
-////           mov     bx,[headptr]    // back to the head node for next bit\r
+               mov     bx,[word ptr headptr]   // back to the head node for next bit\r
 \r
                cmp     di,0x10         // normalize es:di\r
                jb      dinorm\r
@@ -1102,8 +1102,8 @@ dinorm:
 \r
 void CAL_SetupMapFile (global_game_variables_t *gvar)\r
 {\r
-       int handle;\r
-       long length;\r
+//     int handle;\r
+//     long length;\r
 \r
 //\r
 // load maphead.ext (offsets and tileinfo for map file)\r
index 6b189d875fcd864c0cb1107332c937739a47bd27..ef63aaf33a91d35d9cf3cf83e63cd8ce110f989b 100755 (executable)
 #define KEY_MENU               (0x75)\r
 */\r
 \r
-static word far* clockw= (word far*) 0x046C; /* 18.2hz clock */\r
+//static word far* clockw= (word far*) 0x046C; /* 18.2hz clock */\r
 extern int                     profilehandle,debughandle;      //make it into game global\r
 \r
 #define __DEBUG__\r
 //#define __DEBUG_PM__\r
 //#define __DEBUG_MM__\r
 \r
+//#define OLD16_VL\r
+\r
 #define        nil     ((void *)0)\r
 #ifdef __BORLANDC__\r
 #define _FCORELEFT 0x90000UL-16UL\r
@@ -169,7 +171,7 @@ extern      int                     profilehandle,debughandle;      //make it into game global
 #endif\r
 #ifdef __WATCOMC__\r
 #define _FCORELEFT 0x90000UL+16UL\r
-static union REGS CPURegs;\r
+/*static union REGS CPURegs;\r
 \r
 #define _AX CPURegs.x.ax\r
 #define _BX CPURegs.x.bx\r
@@ -187,7 +189,7 @@ static union REGS CPURegs;
 #define _DH CPURegs.h.dh\r
 #define _DL CPURegs.h.dl\r
 \r
-#define geninterrupt(n) int86(n,&CPURegs,&CPURegs);\r
+#define geninterrupt(n) int86(n,&CPURegs,&CPURegs);*/\r
 #define peekb(segm,ofs) (*(byte far*)MK_FP((segm),(ofs)))\r
 #define peekw(segm,ofs) (*(word far*)MK_FP((segm),(ofs)))\r
 #define pokeb(segm,ofs,value) (peekb((segm),(ofs)) = (byte)(value))\r
index 363b588b2e30254c7bd54bef28dd1b6688ba1b81..ef0f1fa65660ae238dd057c88b82054a60736e53 100755 (executable)
@@ -42,6 +42,8 @@
 boolean dbg_testkeyin=0,dbg_testcontrolnoisy=0;\r
 #endif\r
 \r
+static word far* clockw= (word far*) 0x046C; /* 18.2hz clock */\r
+\r
 /*\r
 =============================================================================\r
 \r
@@ -748,7 +750,7 @@ IN_SetKeyHook(void (*hook)())
 void\r
 IN_ClearKeysDown()\r
 {\r
-       int     i;\r
+       //int   i;\r
 \r
        inpu.LastScan = sc_None;\r
        inpu.LastASCII = key_None;\r
@@ -818,7 +820,9 @@ void near
 IN_ReadControl(player_t *player)\r
 {\r
                        boolean         realdelta;\r
+#if DEMO0\r
                        byte            dbyte;\r
+#endif\r
                        word            buttons;\r
                        int                     dx,dy;\r
                        Motion          mx,my;\r
index b2170176335c5498d265f205629be345150b3bf2..de0bf36df2147e23044d185f71ee594538b6c086 100755 (executable)
@@ -32,9 +32,8 @@
 #include "src/lib/16_timer.h"\r
 #ifdef __WATCOMC__     //borland C BCEXMM.EXE\r
 #include "src/lib/16_dbg.h"\r
-#include "src/lib/bitmap.h"    //old format\r
 #include "src/lib/16_sprit.h"\r
-#include "src/lib/16_entity.h"\r
+//#include "src/lib/bitmap.h"  //old format\r
 #endif\r
 #ifdef __DEBUG__\r
 #define        __DEBUG_InputMgr__\r
@@ -42,7 +41,10 @@ extern boolean dbg_testkeyin,dbg_testcontrolnoisy;
 #endif\r
 \r
 //if else for gfxtesting and direction\r
-#define DIRECTIONIFELSE        (player->info.dir == 2)\r
+//player[pn].d == 2 ||\r
+//player[pn].d != 2 ||\r
+#define DIRECTIONIFELSE        (player[pn].info.dir == 2)\r
+//#define NDIRECTIONIFELSE     (player[pn].info.dir != 2)\r
 \r
 #define        KeyInt  9       // The keyboard ISR number\r
 \r
index d697142d34a940f639141a717857513451fb60b9..1afb7bc8efe47dd95941e9ecc1cada52d1e47fef 100755 (executable)
@@ -20,7 +20,7 @@
  *\r
  */\r
 \r
-#include "16_map.h"\r
+#include "src/lib/16_map.h"\r
 \r
 // Ideally, preprocess json during compilation and read serialized data\r
 \r
@@ -33,9 +33,9 @@ int jsoneq(const char *json, jsmntok_t *tok, const char *s) {
 }\r
 \r
 void extract_map(const char *js, jsmntok_t *t, size_t count, map_t *map) {\r
-       int i, j, k, indent, inner_end;\r
+       int i, j, k, indent=0, inner_end;\r
        bitmap_t bp;\r
-       char *s;\r
+       //char *s;\r
        i = 0;\r
        while(i<count) {\r
                if(jsoneq(js, &(t[i]), "layers") == 0) {\r
@@ -84,7 +84,7 @@ void extract_map(const char *js, jsmntok_t *t, size_t count, map_t *map) {
                                        map->tiles[k]->debug_text=false;\r
                                        //Fix to load tileset specified.\r
                                        //And move to vrs, probably\r
-                                       bp = bitmapLoadPcx("data/ed.pcx");\r
+                                       //bp = bitmapLoadPcx("data/ed.pcx");\r
                                        map->tiles[k]->btdata = &bp;\r
                                        k++;\r
                                }\r
@@ -151,6 +151,6 @@ int loadmap(char *mn, map_t *map) {
        free(js);\r
        free(tok);\r
        fclose(fh);\r
-       \r
+\r
        return 0;\r
 }\r
index 4fd0442967ee63cb39c49791b6cb37852e1b2d9f..bac162c9371df7e9545c9c7e02e3883408bc4355 100755 (executable)
  *\r
  */\r
 \r
-#ifndef _LIBMAPREAD_H_\r
-#define _LIBMAPREAD_H_\r
+#ifndef _16_MAP__H_\r
+#define _16_MAP__H_\r
 \r
-#include "jsmn/jsmn.h"\r
+#include "src/lib/16_head.h"\r
+#include "src/lib/jsmn/jsmn.h"\r
 //#include "stdio.h" included in 16_head.h\r
 //#include "stdlib.h" included in 16_head.h\r
-#include "src/lib/modex16.h"\r
-#include "src/lib/16_head.h"\r
+#include "src/lib/16_vl.h"\r
 #include "src/lib/16_ca.h"\r
 #include "src/lib/16_mm.h"\r
 \r
index 42a87440485b974a3b11baf23fb91f8c5119db73..df1dd7f7fef2222f312f848279042e4963efa9be 100755 (executable)
@@ -72,9 +72,9 @@ void          (* XMSaddr) (void);             // far pointer to XMS driver
 
 =============================================================================
 */
-
+#ifndef __16_PM__
 static char *ParmStringsexmm[] = {"noems","noxms",""};
-
+#endif
 /*
 ======================
 =
@@ -87,7 +87,7 @@ static        char *ParmStringsexmm[] = {"noems","noxms",""};
 
 boolean MML_CheckForEMS(void)
 {
-       boolean emmcfems;
+       boolean emmcfems=0;
        static char     emmname[] = "EMMXXXX0"; //fix by andrius4669
        __asm {
                mov     dx,OFFSET emmname       //fix by andrius4669
@@ -717,7 +717,7 @@ void MML_UseSpace(word segstart, dword seglength, global_game_variables_t *gvar)
 void MML_ClearBlock(global_game_variables_t *gvar)
 {
        //huge mmblocktype huge *scan,huge *last;
-       mmblocktype far *scan,far *last;
+       mmblocktype __far *scan;//,far *last;
 
        scan = gvar->mm.mmhead->next;
 
@@ -770,9 +770,7 @@ void MM_Startup(global_game_variables_t *gvar)
        gvar->mm.mmhead = NULL;
        gvar->mm.mmfree = &(gvar->mm.mmblocks[0]);
        for(i=0;i<MAXBLOCKS-1;i++)
-       {
                gvar->mm.mmblocks[i].next = &(gvar->mm.mmblocks[i+1]);
-       }
        gvar->mm.mmblocks[i].next = NULL;
 
 //
@@ -1177,8 +1175,8 @@ void MM_SortMem(global_game_variables_t *gvar)
 {
        //huge mmblocktype huge *scan,huge *last,huge *next;
        mmblocktype far *scan,far *last,far *next;
-       unsigned        start,length,source,dest,oldborder;
-       int                     playing;
+       unsigned        start,length,source,dest;//++++,oldborder;
+       //++++int                       playing;
 
        //
        // lock down a currently playing sound
@@ -1288,18 +1286,18 @@ void MM_ShowMemory(global_game_variables_t *gvar)
 {
        //huge mmblocktype huge *scan;
        mmblocktype far *scan;
-       word temp;
+       //word temp;
        sdword  end,owner;
        //word chx,chy;
        word w;
        //dword wwww;
-       byte    scratch[160],scratch0[4096],scratch1[160],str[16];
+       byte    scratch[160],scratch0[4096],str[16];//[[[[scratch1[160],
        //byte d = '#';
-//**** VW_SetDefaultColors();
-//**** VW_SetLineWidth(40);
+//[[[[ VW_SetDefaultColors();
+//[[[[ VW_SetLineWidth(40);
 //++++mh       temp = bufferofs;
 //++++mh       bufferofs = 0;
-//**** VW_SetScreen (0,0);
+//[[[[ VW_SetScreen (0,0);
        scan = gvar->mm.mmhead;
        end = -1;
 
index c9019b785e70d5dccfc76fdd6d50ab5c713b8a04..7ecab1eb418ee35fb6ef1d30a77ea3e6c53f51c0 100755 (executable)
@@ -70,6 +70,26 @@ boolean dbg_debugpm=0;
        PageListStruct  far *gvar->pm.PMPages,\r
                                        _seg *gvar->pm.PMSegPages;*/\r
 \r
+static union REGS CPURegs;\r
+\r
+#define _AX CPURegs.x.ax\r
+#define _BX CPURegs.x.bx\r
+#define _CX CPURegs.x.cx\r
+#define _DX CPURegs.x.dx\r
+\r
+#define _SI CPURegs.x.si\r
+\r
+#define _AH CPURegs.h.ah\r
+#define _AL CPURegs.h.al\r
+#define _BH CPURegs.h.bh\r
+#define _BL CPURegs.h.bl\r
+#define _CH CPURegs.h.ch\r
+#define _CL CPURegs.h.cl\r
+#define _DH CPURegs.h.dh\r
+#define _DL CPURegs.h.dl\r
+\r
+#define geninterrupt(n) int86(n,&CPURegs,&CPURegs);\r
+\r
 static char            *ParmStrings[] = {"nomain","noems","noxms",nil};\r
 \r
 /////////////////////////////////////////////////////////////////////////////\r
@@ -84,9 +104,9 @@ static       char            *ParmStrings[] = {"nomain","noems","noxms",nil};
 byte\r
 PML_MapEMS(word logical, byte physical, global_game_variables_t *gvar)\r
 {\r
-       byte    err, str[160];\r
+       byte    err=0, str[160];\r
        unsigned        EMShandle;\r
-       int     i;\r
+       //int   i;\r
 \r
        boolean errorflag=false;\r
        EMShandle=gvar->pm.emm.EMSHandle;\r
@@ -141,12 +161,12 @@ PML_StartupEMS(global_game_variables_t *gvar)
 {\r
        int             i;\r
        //long  size;\r
-       byte    err, str[64];\r
+       byte    err=0, str[64];\r
 \r
        boolean errorflag=false;\r
        static char     emmname[] = "EMMXXXX0"; //fix by andrius4669\r
        unsigned int EMSVer = 0;\r
-       unsigned        totalEMSpages,freeEMSpages,EMSPageFrame,EMSHandle,EMSAvail;\r
+       unsigned        totalEMSpages,freeEMSpages,EMSPageFrame,EMSHandle=0,EMSAvail=0;\r
        totalEMSpages = freeEMSpages = EMSPageFrame = 0;\r
        gvar->pm.emm.EMSPresent = false;                        // Assume that we'll fail\r
        gvar->pm.emm.EMSAvail = 0;\r
@@ -299,7 +319,7 @@ void
 PML_ShutdownEMS(global_game_variables_t *gvar)\r
 {\r
        word EMSHandle;\r
-       byte err,str[64];\r
+       byte err=0, str[64];\r
 \r
        boolean errorflag=false;\r
        EMSHandle=gvar->pm.emm.EMSHandle;\r
@@ -727,7 +747,7 @@ PM_CheckMainMem(global_game_variables_t *gvar)
 void\r
 PML_StartupMainMem(global_game_variables_t *gvar)\r
 {\r
-       int             i,n;\r
+       int             i;//,n;\r
        memptr  *p;\r
 \r
        gvar->pm.mm.MainPagesAvail = 0;\r
@@ -1285,15 +1305,15 @@ PM_SetPageLock(int pagenum,PMLockType lock, global_game_variables_t *gvar)
 void\r
 PM_Preload(boolean (*update)(word current,word total), global_game_variables_t *gvar)\r
 {\r
-       int                             i,j,\r
+       int                             i,//j,\r
                                        page,oogypage;\r
        word                    current,total,\r
-                                       totalnonxms,totalxms,\r
+                                       //totalnonxms,totalxms,\r
                                        mainfree,maintotal,\r
-                                       emsfree,emstotal,\r
+                                       //emstotal,emsfree,\r
                                        xmsfree,xmstotal;\r
        memptr                  addr;\r
-       PageListStruct  far *p;\r
+       PageListStruct  __far *p;\r
 \r
        mainfree = (gvar->pm.mm.MainPagesAvail - gvar->pm.MainPagesUsed) + (gvar->pm.emm.EMSPagesAvail - gvar->pm.EMSPagesUsed);\r
        xmsfree = (gvar->pm.xmm.XMSPagesAvail - gvar->pm.XMSPagesUsed);\r
index f63dddc1dde608f0d07bf45ffe69b3612279952b..b2acec13763597edfd912d1461b82f605965490e 100755 (executable)
@@ -76,7 +76,7 @@ void Startup16(global_game_variables_t *gvar)
        CA_Startup(gvar);\r
 #ifdef __WATCOMC__\r
        start_timer(gvar);\r
-       \r
+\r
 #endif\r
 \r
 }\r
@@ -155,8 +155,8 @@ void DebugMemory_(global_game_variables_t *gvar, boolean q)
 \r
 void Quit (char *error)\r
 {\r
-       unsigned        finscreen;\r
-       memptr  screen;\r
+       //unsigned        finscreen;\r
+       memptr  screen=0;\r
        union REGS in, out;\r
 \r
        //ClearMemory ();\r
index 9b73b887f22f5db05b65a39efcdd121e05ad9092..5cb216c19b48f47ce61eff49b157f55e9c382636 100755 (executable)
@@ -22,6 +22,8 @@
 \r
 #include "src/lib/16_timer.h"\r
 \r
+static word far* clockw= (word far*) 0x046C; /* 18.2hz clock */\r
+\r
 clock_t start_timer(global_game_variables_t *gv)\r
 {\r
        gv->kurokku.t = clock();\r
@@ -29,8 +31,8 @@ clock_t start_timer(global_game_variables_t *gv)
        gv->kurokku.clock_start = *clockw;\r
        gv->kurokku.clock = clockw;\r
        //gv->kurokku.frames_per_second = 60;\r
-       gv->pee = _nmalloc(sizeof(byte)*16);\r
-       //turn this off if XT\r
+\r
+    //turn this off if XT\r
        switch(detectcpu())\r
        {\r
                case 0:\r
@@ -63,6 +65,9 @@ double time_in_seconds(global_game_variables_t *gv)
        return (gv->kurokku.t) / CLOCKS_PER_SEC;\r
 }\r
 \r
+// big global status text buffer\r
+char global_temp_status_text[512];\r
+\r
 /*double time_in_seconds(time_t in_t)\r
 {\r
        return (in_t) / CLOCKS_PER_SEC;\r
@@ -75,8 +80,8 @@ void shinkutxt(global_game_variables_t *gv)
        if(elapsed_timer(gv) >= (1.0 / gv->kurokku.frames_per_second))\r
        {\r
                //t=(((*(gv->clock))-gv->clock_start) /18.2);\r
-               sprintf(gv->pee, "%.0f fps", (double)gv->kurokku.tiku/ticktock(gv));\r
-               fprintf(stderr, "%s\n", gv->pee);\r
+               sprintf(global_temp_status_text, "%.0f fps", (double)gv->kurokku.tiku/ticktock(gv));\r
+               fprintf(stderr, "%s\n", global_temp_status_text);\r
                //(gv->clock_start)=*(gv->clock);\r
                gv->kurokku.tiku=0;\r
        }\r
similarity index 69%
rename from src/lib/modex16.c
rename to src/lib/16_vl.c
index b8f733be22b581f1748cffffa04e1f60e988b3be..0c8c5571fd7db83be30f5ba79917755f94616d21 100755 (executable)
@@ -23,7 +23,7 @@
 #include <conio.h>\r
 #include <stdio.h>\r
 #include <stdlib.h>\r
-#include "src/lib/modex16.h"\r
+#include "src/lib/16_vl.h"\r
 \r
 byte far* VGA=(byte far*) 0xA0000000;   /* this points to video memory. */\r
 \r
@@ -78,7 +78,7 @@ vgaSetMode(byte mode)
 byte/*FIXME: why long? "long" is 32-bit datatype, VGA modes are 8-bit numbers. */\r
 vgaGetMode()\r
 {\r
-    return int10_getmode();\r
+       return int10_getmode();\r
 }\r
 \r
 /* -========================= Entry  Points ==========================- */\r
@@ -86,7 +86,7 @@ void modexEnter(sword vq, boolean cmem, global_game_variables_t *gv)
 {\r
        word i;\r
        struct vga_mode_params cm;\r
-       int CRTParmCount;\r
+       //int CRTParmCount;\r
 \r
        vgaSetMode(VGA_256_COLOR_MODE);\r
        vga_enable_256color_modex();\r
@@ -116,8 +116,8 @@ void modexEnter(sword vq, boolean cmem, global_game_variables_t *gv)
                        cm.word_mode = 0;\r
                        cm.dword_mode = 0;\r
                        // 320x240 mode 60Hz\r
-                       cm.horizontal_total=0x5f + 5; /* CRTC[0]             -5 */\r
-                       cm.horizontal_display_end=0x4f + 1; /* CRTC[1]       -1 */\r
+                       cm.horizontal_total=0x5f + 5; /* CRTC[0]                         -5 */\r
+                       cm.horizontal_display_end=0x4f + 1; /* CRTC[1]     -1 */\r
                        cm.horizontal_blank_start=0x50 + 1; /* CRTC[2] */\r
 //                     cm.horizontal_blank_end=0x82 + 1;   /* CRTC[3] bit 0-4 & CRTC[5] bit 7 *///skewing ^^;\r
                        cm.horizontal_start_retrace=0x54;/* CRTC[4] */\r
@@ -155,7 +155,7 @@ void modexEnter(sword vq, boolean cmem, global_game_variables_t *gv)
        {\r
                case 1: {\r
                        /* clear video memory */\r
-                       dword far*ptr=(dword far*)vga_state.vga_graphics_ram;//VGA;      /* used for faster screen clearing */\r
+                       dword far*ptr=(dword far*)vga_state.vga_graphics_ram;//VGA;       /* used for faster screen clearing */\r
                        vga_write_sequencer(2/*map mask register*/,0xf/*all 4 planes*/);\r
                        for(i = 0;i < 0x4000; i++) ptr[i] = 0x0000; // 0x4000 x dword = 64KB\r
                }\r
@@ -179,14 +179,14 @@ modexLeave() {
 page_t\r
 modexDefaultPage(page_t *p)\r
 {\r
-    page_t page;\r
+       page_t page;\r
 \r
-    /* default page values */\r
+       /* default page values */\r
        //page.data = VGA;\r
        //page.data = (byte far *)(vga_state.vga_graphics_ram);\r
        page.data = (vga_state.vga_graphics_ram);\r
-    page.dx = 0;\r
-    page.dy = 0;\r
+       page.dx = 0;\r
+       page.dy = 0;\r
        page.sw = p->sw;\r
        page.sh = p->sh;\r
        page.width = p->sw+TILEWHD;\r
@@ -202,7 +202,7 @@ modexDefaultPage(page_t *p)
        page.pi=page.width*4;\r
        page.id = 0;\r
 \r
-    return page;\r
+       return page;\r
 }\r
 \r
 /* returns the next page in contiguous memory\r
@@ -210,15 +210,15 @@ modexDefaultPage(page_t *p)
  */\r
 page_t\r
 modexNextPage(page_t *p) {\r
-    page_t result;\r
+       page_t result;\r
 \r
-    result.data = p->data + (p->pagesize);\r
-    result.dx = 0;\r
-    result.dy = 0;\r
+       result.data = p->data + (p->pagesize);\r
+       result.dx = 0;\r
+       result.dy = 0;\r
        result.sw = p->sw;\r
        result.sh = p->sh;\r
-    result.width = p->width;\r
-    result.height = p->height;\r
+       result.width = p->width;\r
+       result.height = p->height;\r
        result.tw = p->tw;\r
        result.th = p->th;\r
        result.tilesw = p->tilesw;\r
@@ -296,78 +296,78 @@ void modexHiganbanaPageSetup(video_t *video)
 \r
 void\r
 modexShowPage(page_t *page) {\r
-    word high_address;\r
-    word low_address;\r
-    word offset;\r
-    byte crtcOffset;\r
-\r
-    /* calculate offset */\r
-    offset = (word) page->data;\r
-    offset += page->dy * (page->width >> 2 );\r
-    offset += page->dx >> 2;\r
-\r
-    /* calculate crtcOffset according to virtual width */\r
-    crtcOffset = page->width >> 3;\r
-\r
-    high_address = HIGH_ADDRESS | (offset & 0xff00);\r
-    low_address  = LOW_ADDRESS  | (offset << 8);\r
-\r
-    /* wait for appropriate timing and then program CRTC */\r
-    //while ((inp(INPUT_STATUS_1) & DISPLAY_ENABLE));\r
-    outpw(CRTC_INDEX, high_address);\r
-    outpw(CRTC_INDEX, low_address);\r
-    outp(CRTC_INDEX, 0x13);\r
-    outp(CRTC_DATA, crtcOffset);\r
-\r
-    /*  wait for one retrace */\r
-    //while (!(inp(INPUT_STATUS_1) & VRETRACE));\r
-\r
-    /* do PEL panning here */\r
-    outp(AC_INDEX, 0x33);\r
-    outp(AC_INDEX, (page->dx & 0x03) << 1);\r
+       word high_address;\r
+       word low_address;\r
+       word offset;\r
+       byte crtcOffset;\r
+\r
+       /* calculate offset */\r
+       offset = (word) page->data;\r
+       offset += page->dy * (page->width >> 2 );\r
+       offset += page->dx >> 2;\r
+\r
+       /* calculate crtcOffset according to virtual width */\r
+       crtcOffset = page->width >> 3;\r
+\r
+       high_address = HIGH_ADDRESS | (offset & 0xff00);\r
+       low_address  = LOW_ADDRESS  | (offset << 8);\r
+\r
+       /* wait for appropriate timing and then program CRTC */\r
+       //while ((inp(INPUT_STATUS_1) & DISPLAY_ENABLE));\r
+       outpw(CRTC_INDEX, high_address);\r
+       outpw(CRTC_INDEX, low_address);\r
+       outp(CRTC_INDEX, 0x13);\r
+       outp(CRTC_DATA, crtcOffset);\r
+\r
+       /*  wait for one retrace */\r
+       //while (!(inp(INPUT_STATUS_1) & VRETRACE));\r
+\r
+       /* do PEL panning here */\r
+       outp(AC_INDEX, 0x33);\r
+       outp(AC_INDEX, (page->dx & 0x03) << 1);\r
 }\r
 \r
 void\r
 modexPanPage(page_t *page, int dx, int dy) {\r
-    page->dx = dx;\r
-    page->dy = dy;\r
+       page->dx = dx;\r
+       page->dy = dy;\r
 }\r
 \r
 void\r
 modexSelectPlane(byte plane) {\r
-    outp(SC_INDEX, MAP_MASK);    /* select plane */\r
-    outp(SC_DATA,  plane);\r
+       outp(SC_INDEX, MAP_MASK);         /* select plane */\r
+       outp(SC_DATA,  plane);\r
 }\r
 \r
 void\r
 modexClearRegion(page_t *page, int x, int y, int w, int h, byte  color) {\r
-    word pageOff = (word) page->data;\r
-    word xoff=x/4;       /* xoffset that begins each row */\r
-    word scanCount=w/4;  /* number of iterations per row (excluding right clip)*/\r
-    word poffset = pageOff + y*(page->stridew) + xoff; /* starting offset */\r
-    word nextRow = page->stridew-scanCount-1;  /* loc of next row */\r
-    byte lclip[] = {0x0f, 0x0e, 0x0c, 0x08};  /* clips for rectangles not on 4s */\r
-    byte rclip[] = {0x00, 0x01, 0x03, 0x07};\r
-    byte left = lclip[x&0x03];\r
-    byte right = rclip[(x+w)&0x03];\r
-\r
-    /* handle the case which requires an extra group */\r
-    if((x & 0x03) && !((x+w) & 0x03)) {\r
-      right=0x0f;\r
-    }\r
+       word pageOff = (word) page->data;\r
+       word xoff=x/4;     /* xoffset that begins each row */\r
+       word scanCount=w/4;  /* number of iterations per row (excluding right clip)*/\r
+       word poffset = pageOff + y*(page->stridew) + xoff; /* starting offset */\r
+       word nextRow = page->stridew-scanCount-1;  /* loc of next row */\r
+       byte lclip[] = {0x0f, 0x0e, 0x0c, 0x08};  /* clips for rectangles not on 4s */\r
+       byte rclip[] = {0x00, 0x01, 0x03, 0x07};\r
+       byte left = lclip[x&0x03];\r
+       byte right = rclip[(x+w)&0x03];\r
+\r
+       /* handle the case which requires an extra group */\r
+       if((x & 0x03) && !((x+w) & 0x03)) {\r
+         right=0x0f;\r
+       }\r
 \r
        //printf("modexClearRegion(x=%u, y=%u, w=%u, h=%u, left=%u, right=%u)\n", x, y, w, h, left, right);\r
 \r
-    __asm {\r
-           PUSHF\r
-           PUSH ES\r
-           PUSH AX\r
-           PUSH BX\r
-           PUSH CX\r
-           PUSH DX\r
-           PUSH SI\r
-           PUSH DI\r
-               MOV AX, SCREEN_SEG      ; go to the VGA memory\r
+       __asm {\r
+               PUSHF\r
+               PUSH ES\r
+               PUSH AX\r
+               PUSH BX\r
+               PUSH CX\r
+               PUSH DX\r
+               PUSH SI\r
+               PUSH DI\r
+               MOV AX, SCREEN_SEG        ; go to the VGA memory\r
                MOV ES, AX\r
                MOV DI, poffset  ; go to the first pixel\r
                MOV DX, SC_INDEX        ; point to the map mask\r
@@ -376,39 +376,39 @@ modexClearRegion(page_t *page, int x, int y, int w, int h, byte  color) {
                INC DX\r
                MOV AL, color      ; get ready to write colors\r
        SCAN_START:\r
-               MOV CX, scanCount       ; count the line\r
-               MOV BL, AL            ; remember color\r
-               MOV AL, left        ; do the left clip\r
-               OUT DX, AL            ; set the left clip\r
-               MOV AL, BL            ; restore color\r
+               MOV CX, scanCount          ; count the line\r
+               MOV BL, AL                ; remember color\r
+               MOV AL, left            ; do the left clip\r
+               OUT DX, AL                ; set the left clip\r
+               MOV AL, BL                ; restore color\r
                STOSB              ; write the color\r
                DEC CX\r
-               JZ SCAN_DONE        ; handle 1 group stuff\r
+               JZ SCAN_DONE            ; handle 1 group stuff\r
 \r
                ;-- write the main body of the scanline\r
-               MOV BL, AL            ; remember color\r
-               MOV AL, 0x0f        ; write to all pixels\r
+               MOV BL, AL                ; remember color\r
+               MOV AL, 0x0f            ; write to all pixels\r
                OUT DX, AL\r
-               MOV AL, BL            ; restore color\r
-               REP STOSB              ; write the color\r
+               MOV AL, BL                ; restore color\r
+               REP STOSB                  ; write the color\r
        SCAN_DONE:\r
-               MOV BL, AL            ; remeber color\r
+               MOV BL, AL                ; remeber color\r
                MOV AL, right\r
-               OUT DX, AL            ; do the right clip\r
-               MOV AL, BL            ; restore color\r
+               OUT DX, AL                ; do the right clip\r
+               MOV AL, BL                ; restore color\r
                STOSB              ; write pixel\r
                ADD DI, nextRow  ; go to the next row\r
                DEC h\r
                JNZ SCAN_START\r
-           POP DI\r
-           POP SI\r
-           POP DX\r
-           POP CX\r
-           POP BX\r
-           POP AX\r
-           POP ES\r
-           POPF\r
-    }\r
+               POP DI\r
+               POP SI\r
+               POP DX\r
+               POP CX\r
+               POP BX\r
+               POP AX\r
+               POP ES\r
+               POPF\r
+       }\r
 }\r
 \r
 /* moved to src/lib/modex16/16render.c */\r
@@ -419,19 +419,19 @@ modexClearRegion(page_t *page, int x, int y, int w, int h, byte  color) {
  */\r
 void\r
 modexCopyPageRegion(page_t *dest, page_t *src,\r
-                   word sx, word sy,\r
-                   word dx, word dy,\r
-                   word width, word height)\r
+                       word sx, word sy,\r
+                       word dx, word dy,\r
+                       word width, word height)\r
 {\r
-    word doffset = (word)dest->data + dy*(dest->stridew) + dx/4;\r
-    word soffset = (word)src->data + sy*(src->stridew) + sx/4;\r
-    word scans   = vga_state.vga_stride;                               //++++0000 the quick and dirty fix of the major issue with p16 video display wwww\r
-    word nextSrcRow = src->stridew - scans - 1;\r
-    word nextDestRow = dest->stridew - scans - 1;\r
-    byte lclip[] = {0x0f, 0x0e, 0x0c, 0x08};  /* clips for rectangles not on 4s */\r
-    byte rclip[] = {0x00, 0x01, 0x03, 0x07};\r
-    byte left = lclip[sx&0x03];\r
-    byte right = rclip[(sx+width)&0x03];\r
+       word doffset = (word)dest->data + dy*(dest->stridew) + dx/4;\r
+       word soffset = (word)src->data + sy*(src->stridew) + sx/4;\r
+       word scans   = vga_state.vga_stride;                            //++++0000 the quick and dirty fix of the major issue with p16 video display wwww\r
+       word nextSrcRow = src->stridew - scans - 1;\r
+       word nextDestRow = dest->stridew - scans - 1;\r
+       byte lclip[] = {0x0f, 0x0e, 0x0c, 0x08};  /* clips for rectangles not on 4s */\r
+       byte rclip[] = {0x00, 0x01, 0x03, 0x07};\r
+       byte left = lclip[sx&0x03];\r
+       byte right = rclip[(sx+width)&0x03];\r
 \r
        /* handle the case which requires an extra group */\r
        if((sx & 0x03) && !((sx+width) & 0x03)) {\r
@@ -440,18 +440,18 @@ modexCopyPageRegion(page_t *dest, page_t *src,
 \r
 //     printf("modexCopyPageRegion(src->stridew=%u, dest->stridew=%u, sx=%u, sy=%u, dx=%u, dy=%u, width=%u, height=%u, left=%u, right=%u)\n", src->stridew, dest->stridew, sx, sy, dx, dy, width, height, left, right);\r
 \r
-    __asm {\r
-           PUSHF\r
-           PUSH ES\r
-           PUSH AX\r
-           PUSH BX\r
-           PUSH CX\r
-           PUSH DX\r
-           PUSH SI\r
-           PUSH DI\r
-\r
-               MOV AX, SCREEN_SEG      ; work in the vga space\r
-               MOV ES, AX            ;\r
+       __asm {\r
+               PUSHF\r
+               PUSH ES\r
+               PUSH AX\r
+               PUSH BX\r
+               PUSH CX\r
+               PUSH DX\r
+               PUSH SI\r
+               PUSH DI\r
+\r
+               MOV AX, SCREEN_SEG        ; work in the vga space\r
+               MOV ES, AX                ;\r
                MOV DI, doffset  ;\r
                MOV SI, soffset  ;\r
 \r
@@ -460,9 +460,9 @@ modexCopyPageRegion(page_t *dest, page_t *src,
                OUT DX, AX\r
 \r
                MOV AX, SC_INDEX        ; point to the mask register\r
-               MOV DX, AX            ;\r
+               MOV DX, AX                ;\r
                MOV AL, MAP_MASK        ;\r
-               OUT DX, AL            ;\r
+               OUT DX, AL                ;\r
                INC DX            ;\r
 \r
        ROW_START:\r
@@ -471,183 +471,183 @@ modexCopyPageRegion(page_t *dest, page_t *src,
                MOV DS, AX\r
                MOV CX, scans      ; the number of latches\r
 \r
-               MOV AL, left        ; do the left column\r
-               OUT DX, AL            ;\r
+               MOV AL, left            ; do the left column\r
+               OUT DX, AL                ;\r
                MOVSB              ;\r
                DEC CX            ;\r
 \r
-               MOV AL, 0fh          ; do the inner columns\r
+               MOV AL, 0fh              ; do the inner columns\r
                OUT DX, AL\r
-               REP MOVSB              ; copy the pixels\r
+               REP MOVSB                  ; copy the pixels\r
 \r
                MOV AL, right      ; do the right column\r
                OUT DX, AL\r
                MOVSB\r
                POP DS\r
 \r
-               MOV AX, SI            ; go the start of the next row\r
-               ADD AX, nextSrcRow      ;\r
-               MOV SI, AX            ;\r
-               MOV AX, DI            ;\r
-               ADD AX, nextDestRow     ;\r
-               MOV DI, AX            ;\r
+               MOV AX, SI                ; go the start of the next row\r
+               ADD AX, nextSrcRow        ;\r
+               MOV SI, AX                ;\r
+               MOV AX, DI                ;\r
+               ADD AX, nextDestRow      ;\r
+               MOV DI, AX                ;\r
 \r
-               DEC height            ; do the rest of the actions\r
+               DEC height                ; do the rest of the actions\r
                JNZ ROW_START      ;\r
 \r
-               MOV DX, GC_INDEX+1      ; go back to CPU data\r
-               MOV AL, 0ffh        ; none from latches\r
-               OUT DX, AL            ;\r
-\r
-           POP DI\r
-           POP SI\r
-           POP DX\r
-           POP CX\r
-           POP BX\r
-           POP AX\r
-           POP ES\r
-           POPF\r
-    }\r
+               MOV DX, GC_INDEX+1        ; go back to CPU data\r
+               MOV AL, 0ffh            ; none from latches\r
+               OUT DX, AL                ;\r
+\r
+               POP DI\r
+               POP SI\r
+               POP DX\r
+               POP CX\r
+               POP BX\r
+               POP AX\r
+               POP ES\r
+               POPF\r
+       }\r
 }\r
 \r
 \r
 /* fade and flash */\r
 void\r
 modexFadeOn(word fade, byte *palette) {\r
-    fadePalette(-fade, 64, 64/fade+1, palette);\r
+       fadePalette(-fade, 64, 64/fade+1, palette);\r
 }\r
 \r
 \r
 void\r
 modexFadeOff(word fade, byte *palette) {\r
-    fadePalette(fade, 0, 64/fade+1, palette);\r
+       fadePalette(fade, 0, 64/fade+1, palette);\r
 }\r
 \r
 \r
 void\r
 modexFlashOn(word fade, byte *palette) {\r
-    fadePalette(fade, -64, 64/fade+1, palette);\r
+       fadePalette(fade, -64, 64/fade+1, palette);\r
 }\r
 \r
 \r
 void\r
 modexFlashOff(word fade, byte *palette) {\r
-    fadePalette(-fade, 0, 64/fade+1, palette);\r
+       fadePalette(-fade, 0, 64/fade+1, palette);\r
 }\r
 \r
 \r
 static void\r
 fadePalette(sbyte fade, sbyte start, word iter, byte *palette) {\r
-    word i;\r
-    byte dim = start;\r
+       word i;\r
+       byte dim = start;\r
 \r
-    /* handle the case where we just update */\r
-    if(iter == 0) {\r
+       /* handle the case where we just update */\r
+       if(iter == 0) {\r
        modexPalUpdate1(palette);\r
        return;\r
-    }\r
+       }\r
 \r
-    while(iter > 0) {  /* FadeLoop */\r
+       while(iter > 0) {  /* FadeLoop */\r
        for(i=0; i<PAL_SIZE; i++) { /* loadpal_loop */\r
-           tmppal[i] = palette[i] - dim;\r
-           if(tmppal[i] > 127) {\r
+               tmppal[i] = palette[i] - dim;\r
+               if(tmppal[i] > 127) {\r
                tmppal[i] = 0;\r
-           } else if(tmppal[i] > 63) {\r
+               } else if(tmppal[i] > 63) {\r
                tmppal[i] = 63;\r
-           }\r
+               }\r
        }\r
        modexPalUpdate1(tmppal);\r
        iter--;\r
        dim += fade;\r
-    }\r
+       }\r
 }\r
 \r
 \r
 /* save and load */\r
 void\r
 modexPalSave(byte *palette) {\r
-    int  i;\r
+       int  i;\r
 \r
-    outp(PAL_READ_REG, 0);      /* start at palette entry 0 */\r
-    for(i=0; i<PAL_SIZE; i++) {\r
+       outp(PAL_READ_REG, 0);    /* start at palette entry 0 */\r
+       for(i=0; i<PAL_SIZE; i++) {\r
        palette[i] = inp(PAL_DATA_REG); /* read the palette data */\r
-    }\r
+       }\r
 }\r
 \r
 \r
 byte *\r
 modexNewPal() {\r
-    byte *ptr;\r
-    ptr = malloc(PAL_SIZE);\r
+       byte *ptr;\r
+       ptr = malloc(PAL_SIZE);\r
 \r
-    /* handle errors */\r
-    if(!ptr) {\r
+       /* handle errors */\r
+       if(!ptr) {\r
        printf("Could not allocate palette.\n");\r
        exit(-1);\r
-    }\r
+       }\r
 \r
-    return ptr;\r
+       return ptr;\r
 }\r
 \r
 \r
 void\r
 modexLoadPalFile(byte *filename, byte **palette) {\r
-    FILE *file;\r
-    byte *ptr;\r
+       FILE *file;\r
+       byte *ptr;\r
 \r
-    /* free the palette if it exists */\r
-    if(*palette) {\r
+       /* free the palette if it exists */\r
+       if(*palette) {\r
        free(*palette);\r
-    }\r
+       }\r
 \r
-    /* allocate the new palette */\r
-    *palette = modexNewPal();\r
+       /* allocate the new palette */\r
+       *palette = modexNewPal();\r
 \r
-    /* open the file */\r
-    file = fopen(filename, "rb");\r
-    if(!file) {\r
+       /* open the file */\r
+       file = fopen(filename, "rb");\r
+       if(!file) {\r
        printf("Could not open palette file: %s\n", filename);\r
        exit(-2);\r
-    }\r
+       }\r
 \r
-    /* read the file */\r
-    ptr = *palette;\r
-    while(!feof(file)) {\r
+       /* read the file */\r
+       ptr = *palette;\r
+       while(!feof(file)) {\r
        *ptr++ = fgetc(file);\r
-    }\r
+       }\r
 \r
-    fclose(file);\r
+       fclose(file);\r
 }\r
 \r
 \r
 void\r
 modexSavePalFile(char *filename, byte *pal) {\r
-    unsigned int i;\r
-    FILE *file;\r
+       //unsigned int i;\r
+       FILE *file;\r
 \r
-    /* open the file for writing */\r
-    file = fopen(filename, "wb");\r
-    if(!file) {\r
+       /* open the file for writing */\r
+       file = fopen(filename, "wb");\r
+       if(!file) {\r
        printf("Could not open %s for writing\n", filename);\r
        exit(-2);\r
-    }\r
+       }\r
 \r
-    /* write the data to the file */\r
-    fwrite(pal, 1, PAL_SIZE, file);\r
-    fclose(file);\r
+       /* write the data to the file */\r
+       fwrite(pal, 1, PAL_SIZE, file);\r
+       fclose(file);\r
 }\r
 \r
 \r
 /* blanking */\r
 void\r
 modexPalBlack() {\r
-    fadePalette(-1, 64, 1, tmppal);\r
+       fadePalette(-1, 64, 1, tmppal);\r
 }\r
 \r
 \r
 void\r
 modexPalWhite() {\r
-    fadePalette(-1, -64, 1, tmppal);\r
+       fadePalette(-1, -64, 1, tmppal);\r
 }\r
 \r
 \r
@@ -677,9 +677,9 @@ modexPalUpdate(bitmap_t *bmp, word *i, word qp, word aqoffset)
        {\r
                q=(*i);\r
                qq=(*i)/3;\r
-//           printf("q: %02d\n", (q));\r
-//           printf("qq: %02d\n", (qq));\r
-               //printf("      (*i)-q=%02d\n", (*i)-q);\r
+//               printf("q: %02d\n", (q));\r
+//               printf("qq: %02d\n", (qq));\r
+               //printf("        (*i)-q=%02d\n", (*i)-q);\r
                outp(PAL_WRITE_REG, qq);  /* start at the beginning of palette */\r
        }\r
        if((*i)<PAL_SIZE/2 && w==0)\r
@@ -696,7 +696,7 @@ modexPalUpdate(bitmap_t *bmp, word *i, word qp, word aqoffset)
                        else if(qp>0 && (*i)>=(qp) && (*i)<((qp)+3))\r
                        {\r
                                //printf("qp=%d\n", qp);\r
-                               //printf("            (*i)=%d a[%d]=%d\n", (*i), qp, a[qp]);\r
+                               //printf("                (*i)=%d a[%d]=%d\n", (*i), qp, a[qp]);\r
                                printf("                %d's color=%d\n", (*i), (a[qp])-(bmp->offset*3)+qp);\r
                                //outp(PAL_DATA_REG, p[((a[qp])-(bmp->offset*3)+qp)]);// fix this shit!\r
                                if((*i)+1==(qp)+3){ w++; /*(*i)++;*/ break; }\r
@@ -711,7 +711,7 @@ modexPalUpdate(bitmap_t *bmp, word *i, word qp, word aqoffset)
                        }\r
                }\r
                //if(qp>0) printf("qp=%d\n", qp);\r
-               //if(qp>0) printf("                                          (*i)=%d\n", (*i)/3);\r
+               //if(qp>0) printf("                                              (*i)=%d\n", (*i)/3);\r
        }\r
        //modexWaitBorder();      /* waits one retrace -- less flicker */\r
        vga_wait_for_vsync();\r
@@ -728,7 +728,7 @@ modexPalUpdate(bitmap_t *bmp, word *i, word qp, word aqoffset)
                        else if(qp>0 && (*i)>=(qp) && (*i)<((qp)+3))\r
                        {\r
                                //printf("qp=%d\n", qp);\r
-                               //printf("            (*i)=%d a[%d]=%d\n", (*i), qp, a[qp]);\r
+                               //printf("                (*i)=%d a[%d]=%d\n", (*i), qp, a[qp]);\r
                                printf("                %d's color=%d\n", (*i), (a[qp]-(bmp->offset*3)+qp));\r
                                //outp(PAL_DATA_REG, p[((a[qp])-(bmp->offset*3)+qp)]);// fix this shit!\r
                                if((*i)+1==(qp)+3){ w++; /*(*i)++;*/ break; }\r
@@ -740,7 +740,7 @@ modexPalUpdate(bitmap_t *bmp, word *i, word qp, word aqoffset)
                                printf("p[]=%d  qp=%d   p[]-qp=%d\n", ((*i)-(bmp->offset*3)), qp, ((*i)-(bmp->offset*3))+qp); }\r
                        }\r
                }\r
-               //printf("                                            (*i)=%d\n", (*i)/3);\r
+               //printf("                                                (*i)=%d\n", (*i)/3);\r
        }\r
 \r
 printf("\nqqqqqqqq\n\n");\r
@@ -760,7 +760,7 @@ printf("\nqqqqqqqq\n\n");
 aqpee:\r
                while(aq<=aa)\r
                {\r
-//                   printf("a[%02d]=(%d)\n", aq, a[aq]);\r
+//                       printf("a[%02d]=(%d)\n", aq, a[aq]);\r
                        if(a[aq]==-1) aq++;\r
                        else { aqoffset++; break; }\r
                }\r
@@ -788,12 +788,12 @@ aqpee:
                        //printf("%02d", bmp->data[lq]);\r
                        //printf("\n%02d\n", bmp->offset);\r
                        printf("aq=%02d ", aq);\r
-                       printf("a[aq]=%02d      ", a[aq]);\r
+                       printf("a[aq]=%02d        ", a[aq]);\r
                        printf("a[aq]+aqpp=%02d ", a[aq]+aqpp);\r
                        printf("a[aq]-aqpp=%02d\n", a[aq]-aqpp);\r
                        //bmp->data[lq]=((bmp->data[lq]+bmp->offset)-a[aq]);\r
 //++++           bmp->data[lq]=a[aq]-aqpp;\r
-//                   printf("_%d ", bmp->data[lq]);\r
+//                       printf("_%d ", bmp->data[lq]);\r
                        //if(lq > 0 && lq%bmp->width==0) printf("\n");\r
                }\r
                else if(bmp->data[lq]+bmp->offset < ((*i)/3)-aqpp)\r
@@ -810,8 +810,8 @@ aqpee:
                //if(lq > 0 && lq%bmp->width==0) printf("\n");\r
        }\r
 \r
-//printf("           aq=%02d\n", aq);\r
-//printf("           aa=%02d\n", aa);\r
+//printf("               aq=%02d\n", aq);\r
+//printf("               aa=%02d\n", aa);\r
 \r
        //update the palette~\r
        modexPalUpdate(bmp, &pp, aq, aqoffset);\r
@@ -878,23 +878,23 @@ void modexchkcolor(bitmap_t *bmp, word *q, word *a, word *aa, word *z, word *i/*
                modexPalSave(pal);\r
                //printf("q: %02d\n", (*q));\r
                printf("chkcolor start~\n");\r
-               printf("1                              (*z): %d\n", (*z)/3);\r
-               printf("1                              (*i): %d\n", (*i)/3);\r
-//           printf("1 offset of color in palette    (*q): %d\n", (*q)/3);\r
+               printf("1                                  (*z): %d\n", (*z)/3);\r
+               printf("1                                  (*i): %d\n", (*i)/3);\r
+//               printf("1 offset of color in palette  (*q): %d\n", (*q)/3);\r
                printf("wwwwwwwwwwwwwwww\n");\r
                //check palette for dups\r
                for(; (*z)<PAL_SIZE; (*z)+=3)\r
                {\r
-                       //printf("\n        z: %d\n", (*z));\r
-                       //printf("            q: %d\n", (*q));\r
-                       //printf("            z+q: %d\n\n", ((*z)+(*q)));\r
+                       //printf("\n            z: %d\n", (*z));\r
+                       //printf("                q: %d\n", (*q));\r
+                       //printf("                z+q: %d\n\n", ((*z)+(*q)));\r
                        //if((*z)%3==0)\r
                        //{\r
 //----                   if(pal[(*z)]==pal[(*z)+3] && pal[(*z)+1]==pal[(*z)+4] && pal[(*z)+2]==pal[(*z)+5])\r
                                if((*z)==(*i))\r
                                {\r
-//                                   printf("\n%d    [%02d][%02d][%02d]\n", (*z), pal[(*z)], pal[(*z)+1], pal[(*z)+2]);\r
-//                                   printf("%d      [%02d][%02d][%02d]\n\n", (*z)+3, pal[(*z)+3], pal[(*z)+4], pal[(*z)+5]);\r
+//                                       printf("\n%d  [%02d][%02d][%02d]\n", (*z), pal[(*z)], pal[(*z)+1], pal[(*z)+2]);\r
+//                                       printf("%d      [%02d][%02d][%02d]\n\n", (*z)+3, pal[(*z)+3], pal[(*z)+4], pal[(*z)+5]);\r
 //0000                           (*z)-=3;\r
                                        break;\r
                                }\r
@@ -903,23 +903,23 @@ void modexchkcolor(bitmap_t *bmp, word *q, word *a, word *aa, word *z, word *i/*
                                        //printf("zz: %02d\n", zz/3);\r
                                        if(zz%3==0)\r
                                        {\r
-                                               if(pal[((*z)+(*q))]==pal[((*z)+(*q))+3] && pal[((*z)+(*q))+1]==pal[((*z)+(*q))+4] && pal[((*z)+(*q))+2]==pal[((*z)+(*q))+5])    //break if duplicate colors found in palette because it have reached the end of the current data of the palette\r
+                                               if(pal[((*z)+(*q))]==pal[((*z)+(*q))+3] && pal[((*z)+(*q))+1]==pal[((*z)+(*q))+4] && pal[((*z)+(*q))+2]==pal[((*z)+(*q))+5])    //break if duplicate colors found in palette because it have reached the end of the current data of the palette\r
                                                {\r
-//                                                   (*z)-=3;\r
-//                                                   (*i)-=3;\r
-//                                                   printf("\nzq1:%d[%02d][%02d][%02d]\n", (zz+q), pal[(zz+q)], pal[(zz+q)+1], pal[(zz+q)+2]);\r
-//                                                   printf("zq2:%d[%02d][%02d][%02d]\n\n", (zz+q)+3, pal[(zz+q)+3], pal[(zz+q)+4], pal[(zz+q)+5]);\r
+//                                                       (*z)-=3;\r
+//                                                       (*i)-=3;\r
+//                                                       printf("\nzq1:%d[%02d][%02d][%02d]\n", (zz+q), pal[(zz+q)], pal[(zz+q)+1], pal[(zz+q)+2]);\r
+//                                                       printf("zq2:%d[%02d][%02d][%02d]\n\n", (zz+q)+3, pal[(zz+q)+3], pal[(zz+q)+4], pal[(zz+q)+5]);\r
                                                        break;\r
                                                }\r
                                                else if(pal[zz]==pal[((*z)+(*q))] && pal[zz+1]==pal[((*z)+(*q))+1] && pal[zz+2]==pal[((*z)+(*q))+2])\r
                                                {\r
-//                                                   printf("\n\nwwwwwwwwwwwwwwww\n");\r
-//                                                   printf("  zq: %d  [%02d][%02d][%02d] value that is needing to be changed~\n", ((*z)+(*q))/3, pal[((*z)+(*q))], pal[((*z)+(*q))+1], pal[((*z)+(*q))+2]);\r
-//                                                   printf("  zz: %d  [%02d][%02d][%02d] value that the previous value is going to change to~\n", (zz)/3, pal[zz], pal[zz+1], pal[zz+2]);\r
-//                                                   //printf("      zv: %d  [%02d][%02d][%02d] wwww\n", (zz-z+q)/3, pal[(zz-z+q)], pal[(zz-z+q)+1], pal[(zz-z+q)+2]);\r
-//                                                   printf("  z : %d  [%02d][%02d][%02d] offset value~\n", (*z)/3, pal[(*z)], pal[(*z)+1], pal[(*z)+2]);\r
+//                                                       printf("\n\nwwwwwwwwwwwwwwww\n");\r
+//                                                       printf("      zq: %d  [%02d][%02d][%02d] value that is needing to be changed~\n", ((*z)+(*q))/3, pal[((*z)+(*q))], pal[((*z)+(*q))+1], pal[((*z)+(*q))+2]);\r
+//                                                       printf("      zz: %d  [%02d][%02d][%02d] value that the previous value is going to change to~\n", (zz)/3, pal[zz], pal[zz+1], pal[zz+2]);\r
+//                                                       //printf("      zv: %d  [%02d][%02d][%02d] wwww\n", (zz-z+q)/3, pal[(zz-z+q)], pal[(zz-z+q)+1], pal[(zz-z+q)+2]);\r
+//                                                       printf("      z : %d  [%02d][%02d][%02d] offset value~\n", (*z)/3, pal[(*z)], pal[(*z)+1], pal[(*z)+2]);\r
 //++++                                           (*i)--;\r
-//                                                   (*z)--;\r
+//                                                       (*z)--;\r
                                                        //expand dong here\r
 /*\r
 planned features that i plan to implement~\r
@@ -933,10 +933,10 @@ no... wait.... no wwww
                                                                a[(((*z)+(*q)))]=zz;\r
                                                        //}\r
                                                        (*aa)=(((*z)+(*q)));\r
-                                                       printf("!!                                    a[%02d]: %d\n", (((*z)+(*q))/3), zz/3);\r
-//                                                   printf("\n              aa: %d\n\n", (*aa));\r
-//                                                   printf("  a[%02d]=(%02d) offset array i think the palette should be updated again~\n", ((*z)+(*q))/3, a[((*z)+(*q))/3]);\r
-//                                                   printf("wwwwwwwwwwwwwwww\n\n");\r
+                                                       printf("!!                                        a[%02d]: %d\n", (((*z)+(*q))/3), zz/3);\r
+//                                                       printf("\n              aa: %d\n\n", (*aa));\r
+//                                                       printf("      a[%02d]=(%02d) offset array i think the palette should be updated again~\n", ((*z)+(*q))/3, a[((*z)+(*q))/3]);\r
+//                                                       printf("wwwwwwwwwwwwwwww\n\n");\r
                                                }\r
                                                /*else\r
                                                {\r
@@ -951,9 +951,9 @@ no... wait.... no wwww
                                }\r
                }\r
                printf("wwwwwwwwwwwwwwww\n");\r
-               printf("2                              (*z): %d\n", (*z)/3);\r
-               printf("2                              (*i): %d\n", (*i)/3);\r
-//           printf("2 offset of color in palette    (*q): %d\n", (*q)/3);\r
+               printf("2                                  (*z): %d\n", (*z)/3);\r
+               printf("2                                  (*i): %d\n", (*i)/3);\r
+//               printf("2 offset of color in palette  (*q): %d\n", (*q)/3);\r
                printf("chkcolor end~\n");\r
                free(pal);\r
 }\r
@@ -988,11 +988,48 @@ byte modexgetPixel(page_t *page, int x, int y)
 \r
 }\r
 \r
+void modexDrawChar(page_t *page, int x/*for planar selection only*/, word t, word col, word bgcol, word addr)\r
+{\r
+       /* vertical drawing routine by joncampbell123.\r
+        *\r
+        * optimize for VGA mode X planar memory to minimize the number of times we do I/O write to map mask register.\r
+        * so, we enumerate over columns (not rows!) to draw every 4th pixel. bit masks are used because of the font bitmap.\r
+        *\r
+        * NTS: addr defines what VGA memory address we use, "x" is redundant except to specify which of the 4 pixels we select in the map mask register. */\r
+       word rows = romFonts[t].charSize;\r
+       word drawaddr;\r
+       word colm, row;\r
+       byte fontbyte;\r
+       byte plane;\r
+       byte m1,m2;\r
+\r
+       plane = x & 3;\r
+       m1 = 0x80; // left half\r
+       m2 = 0x08; // right half\r
+       for (colm=0;colm < 4;colm++) {\r
+               drawaddr = addr;\r
+               modexSelectPlane(PLANE(plane));\r
+               for (row=0;row < rows;row++) {\r
+                       fontbyte = romFontsData.l[row];\r
+                       vga_state.vga_graphics_ram[drawaddr  ] = (fontbyte & m1) ? col : bgcol;\r
+                       vga_state.vga_graphics_ram[drawaddr+1] = (fontbyte & m2) ? col : bgcol;\r
+                       drawaddr += page->width >> 2;\r
+               }\r
+\r
+               m1 >>= 1;\r
+               m2 >>= 1;\r
+               if ((++plane) == 4) {\r
+                       addr++;\r
+                       plane = 0;\r
+               }\r
+       }\r
+}\r
+\r
 void modexprint(page_t *page, word x, word y, word t, word col, word bgcol, const byte *str)\r
 {\r
        word s, o, w;\r
        word x_draw = x;\r
-       word addr = (word) romFontsData.l;\r
+       //word addr = (word) romFontsData.l;\r
        word addrq = (page->width/4) * y + (x / 4) + ((word)page->data);\r
        word addrr = addrq;\r
        byte c;\r
@@ -1068,14 +1105,14 @@ void modexprintbig(page_t *page, word x, word y, word t, word col, word bgcol, c
        }\r
        //load the letter 'A'\r
        __asm {\r
-           PUSHF\r
-           PUSH ES\r
-           PUSH AX\r
-           PUSH BX\r
-           PUSH CX\r
-           PUSH DX\r
-           PUSH SI\r
-           PUSH DI\r
+               PUSHF\r
+               PUSH ES\r
+               PUSH AX\r
+               PUSH BX\r
+               PUSH CX\r
+               PUSH DX\r
+               PUSH SI\r
+               PUSH DI\r
 \r
                MOV DI, addr\r
                MOV SI, o\r
@@ -1092,14 +1129,14 @@ void modexprintbig(page_t *page, word x, word y, word t, word col, word bgcol, c
                DEC CX\r
                JNZ L1\r
 \r
-           POP DI\r
-           POP SI\r
-           POP DX\r
-           POP CX\r
-           POP BX\r
-           POP AX\r
-           POP ES\r
-           POPF\r
+               POP DI\r
+               POP SI\r
+               POP DX\r
+               POP CX\r
+               POP BX\r
+               POP AX\r
+               POP ES\r
+               POPF\r
        }\r
 \r
                for(i=0; i<w; i++)\r
similarity index 92%
rename from src/lib/modex16.h
rename to src/lib/16_vl.h
index 3467a77dd3487169751b90b5ad516b025c6d8b26..d0af774f43f1e8edb90403f9e7b32d9d31a1e4d7 100755 (executable)
@@ -30,7 +30,6 @@
 //#include "src/lib/planar.h"\r
 //#include "src/lib/modex16/16planar.h"\r
 #include "src/lib/16text.h"\r
-#include "src/lib/16render.h"\r
 ////#include "src/lib/modex16/320x240.h"\r
 // #include "src/lib/modex16/320x200.h"\r
 // #include "src/lib/modex16/256x192.h"\r
 #include <hw/vga/vrs.h>\r
 #endif\r
 \r
-static struct pcxHeader {\r
-       byte id;\r
-       byte version;\r
-       byte encoding;\r
-       byte bpp;\r
-       word xmin;\r
-       word ymin;\r
-       word xmax;\r
-       word ymax;\r
-       word hres;\r
-       word vres;\r
-       byte pal16[48];\r
-       byte res1;\r
-       word bpplane;\r
-       word palType;\r
-       word hScreenSize;\r
-       word vScreenSize;\r
-       byte padding[54];\r
-} head;\r
-\r
 //320x240 = 20x15\r
 //192x144 = 12x9\r
 \r
@@ -182,6 +161,7 @@ static inline byte modexreadPixel(page_t *page, int x, int y, word addr)
 }\r
 #endif\r
 \r
+void modexDrawChar(page_t *page, int x/*for planar selection only*/, word t, word col, word bgcol, word addr);\r
 void modexprint(page_t *page, word x, word y, word t, word col, word bgcol, const byte *str);\r
 void modexprintbig(page_t *page, word x, word y, word t, word col, word bgcol, const byte *str);\r
 void modexpdump(page_t *pee);\r
index 595489d69fe760f647ba7de213369a4aa2625e5b..ee49885dcba24336f413fe2ca8eb7674b3290754 100755 (executable)
 int read_vrs(global_game_variables_t *gvar, char *filename, struct vrs_container *vrs_cont){\r
        int fd;\r
        dword size;\r
-#ifdef __WATCOMC__\r
-       __segment seg;\r
-       void __based(seg)* bigbuffer;\r
-#endif\r
-#ifdef __BORLANDC__\r
-       memptr bigbuffer;\r
-#endif\r
        byte huge *buffer;\r
        vrl1_vgax_offset_t **vrl_line_offsets;\r
        uint32_t huge *vrl_headers_offsets;\r
        uint16_t huge *vrl_id_iter;\r
        uint32_t vrl_size;\r
-       int num_of_vrl, i;\r
+       int num_of_vrl=0, i;\r
        struct vrl1_vgax_header huge *curr_vrl;\r
-       int success;\r
+       int success=1;\r
 \r
        // Open filename, get size of file,\r
        // populate the vrs_container if all tests pass\r
@@ -60,7 +53,7 @@ int read_vrs(global_game_variables_t *gvar, char *filename, struct vrs_container
        vrs_cont->buffer = buffer;\r
 \r
        // Calculate vrl offsets\r
-       \r
+\r
        // Count sprites\r
        vrl_id_iter = (uint16_t huge *)(buffer + vrs_cont->vrs_hdr->offset_table[VRS_HEADER_OFFSET_SPRITE_ID_LIST]);\r
        while(vrl_id_iter[num_of_vrl]){\r
@@ -101,7 +94,7 @@ int get_vrl_by_id(struct vrs_container /*huge*/ *vrs_cont, uint16_t id, struct v
        }\r
 \r
        // Get id list from .vrs blob (base + offset)\r
-       ids = (uint16_t huge*)(vrs_cont->buffer + \r
+       ids = (uint16_t huge*)(vrs_cont->buffer +\r
                vrs_cont->vrs_hdr->offset_table[VRS_HEADER_OFFSET_SPRITE_ID_LIST]);\r
 \r
        // Loop through the id list until we found the right one or hit the end of the list\r
index cdeb81a0cf74a1cdfa97abff15bacb9c76857419..9aceda0a8a3c3d633b34e3f69fbac14fc617cd38 100755 (executable)
@@ -22,7 +22,7 @@
 #ifndef __16_VRS__\r
 #define __16_VRS__\r
 \r
-#include "src/lib/modex16.h"\r
+#include "src/lib/16_vl.h"\r
 #include "src/lib/typdefst.h"\r
 //#include <hw/cpu/cpu.h>\r
 //#include <hw/dos/dos.h>\r
index 091775b7ba1ce88a0bf82eb80e6805bd308943a3..4118f17ee09718ad579e8f1f4b3f037fbb2c5604 100755 (executable)
@@ -151,7 +151,7 @@ modexDrawBmpRegion(page_t *page, int x, int y,
        word scanCount = width/4 + (width%4 ? 1 :0);\r
        word nextPageRow = page->width/4 - scanCount;\r
        word nextBmpRow = (word) bmp->width - width;\r
-       word rowCounter;\r
+       word rowCounter=0;\r
        byte planeCounter = 4;\r
 \r
     __asm {\r
@@ -218,7 +218,7 @@ modexDrawSpriteRegion(page_t *page, int x, int y,
        word scanCount = width/4 + (width%4 ? 1 :0);\r
        word nextPageRow = page->width/4 - scanCount;\r
        word nextBmpRow = (word) bmp->width - width;\r
-       word rowCounter;\r
+       word rowCounter=0;\r
        byte planeCounter = 4;\r
 \r
     __asm {\r
@@ -297,7 +297,7 @@ modexDrawBmpPBufRegion(page_t *page, int x, int y,
        word scanCount = width/4 + (width%4 ? 1 :0);\r
        word nextPageRow = page->width/4 - scanCount;\r
        word nextBmpRow = (word) bmp->width - width;\r
-       word rowCounter;\r
+       word rowCounter=0;\r
        byte planeCounter = 4;\r
 \r
     __asm {\r
@@ -375,7 +375,7 @@ modexDrawSpritePBufRegion(page_t *page, int x, int y,
        word scanCount = width/4 + (width%4 ? 1 :0);\r
        word nextPageRow = page->width/4 - scanCount;\r
        word nextBmpRow = (word) bmp->width - width;\r
-       word rowCounter;\r
+       word rowCounter=0;\r
        byte planeCounter = 4;\r
 \r
     __asm {\r
@@ -434,40 +434,3 @@ modexDrawSpritePBufRegion(page_t *page, int x, int y,
                JNZ PLANE_LOOP    ; do all 4 planes\r
     }\r
 }\r
-\r
-void modexDrawChar(page_t *page, int x/*for planar selection only*/, word t, word col, word bgcol, word addr)\r
-{\r
-       /* vertical drawing routine by joncampbell123.\r
-        *\r
-        * optimize for VGA mode X planar memory to minimize the number of times we do I/O write to map mask register.\r
-        * so, we enumerate over columns (not rows!) to draw every 4th pixel. bit masks are used because of the font bitmap.\r
-        *\r
-        * NTS: addr defines what VGA memory address we use, "x" is redundant except to specify which of the 4 pixels we select in the map mask register. */\r
-       word rows = romFonts[t].charSize;\r
-       word drawaddr;\r
-       word colm, row;\r
-       byte fontbyte;\r
-       byte plane;\r
-       byte m1,m2;\r
-\r
-       plane = x & 3;\r
-       m1 = 0x80; // left half\r
-       m2 = 0x08; // right half\r
-       for (colm=0;colm < 4;colm++) {\r
-               drawaddr = addr;\r
-               modexSelectPlane(PLANE(plane));\r
-               for (row=0;row < rows;row++) {\r
-                       fontbyte = romFontsData.l[row];\r
-                       vga_state.vga_graphics_ram[drawaddr  ] = (fontbyte & m1) ? col : bgcol;\r
-                       vga_state.vga_graphics_ram[drawaddr+1] = (fontbyte & m2) ? col : bgcol;\r
-                       drawaddr += page->width >> 2;\r
-               }\r
-\r
-               m1 >>= 1;\r
-               m2 >>= 1;\r
-               if ((++plane) == 4) {\r
-                       addr++;\r
-                       plane = 0;\r
-               }\r
-       }\r
-}\r
index 9edce93799795e82ddbf7d7be7d9cb3de29a19d2..32cb7e0ff98dc618652e695b0fe3690f497de9ab 100755 (executable)
@@ -23,7 +23,7 @@
 #ifndef __RENDER_H__\r
 #define __RENDER_H__\r
 \r
-#include "src/lib/modex16.h"\r
+#include "src/lib/16_vl.h"\r
 \r
 void modexDrawPBufRegion(page_t *page, int x, int y, int rx, int ry, int rw, int rh, planar_buf_t *p, boolean sprite);\r
 void modexDrawPBuf(page_t *page, int x, int y, planar_buf_t *p, boolean sprite); /*temp*/\r
@@ -36,6 +36,5 @@ void modexDrawBmpPBuf(page_t *page, int x, int y, planar_buf_t *bmp); /*pbuf ver
 void modexDrawBmpPBufRegion(page_t *page, int x, int y, int rx, int ry, int rw, int rh, planar_buf_t *bmp);\r
 void modexDrawSpritePBuf(page_t *page, int x, int y, planar_buf_t *bmp);\r
 void modexDrawSpritePBufRegion(page_t *page, int x, int y, int rx, int ry, int rw, int rh, planar_buf_t *bmp);\r
-void modexDrawChar(page_t *page, int x/*for planar selection only*/, word t, word col, word bgcol, word addr);\r
 \r
 #endif\r
index 7f7259927ae4e2bc6bc2f83a33f2e50ec55cd844..0f946510459dd2e5b8896fa9d1360bc1566c2686 100755 (executable)
@@ -27,8 +27,8 @@ font_t romFonts[4];
 fontdata_t romFontsData;\r
 \r
 static void getRomFontAddr(char fontNum, int index) {\r
-    word fontSeg;\r
-    word fontOff;\r
+    word fontSeg=0;\r
+    word fontOff=0;\r
 \r
     __asm {\r
                PUSH AX\r
index 7ae770a10e5e92f30d79230a2598a2b0ab7e1ed5..4d3df42ce3d321cc8dd45cd08751cebe1b3722c3 100755 (executable)
@@ -45,7 +45,7 @@
  *\r
  */\r
 #include "src/lib/16_head.h"\r
-#include "src/lib/modex16.h"\r
+#include "src/lib/16_vl.h"\r
 #include <hw/cpu/cpu.h>\r
 #include <hw/dos/dos.h>\r
 #include <hw/vga/vga.h>\r
index 7696cc3475ed303e89dd5014f84ab1c4a7e4e626..7f9df1f0f836a65cd6454b05a4407e677ea9d755 100755 (executable)
 #include <malloc.h>\r
 #include "src/lib/bitmap.h"\r
 \r
+static struct pcxHeader {\r
+       byte id;\r
+       byte version;\r
+       byte encoding;\r
+       byte bpp;\r
+       word xmin;\r
+       word ymin;\r
+       word xmax;\r
+       word ymax;\r
+       word hres;\r
+       word vres;\r
+       byte pal16[48];\r
+       byte res1;\r
+       word bpplane;\r
+       word palType;\r
+       word hScreenSize;\r
+       word vScreenSize;\r
+       byte padding[54];\r
+} head;\r
+\r
 static void loadPcxStage1(FILE *file, bitmap_t *result) {\r
-       long bufSize;\r
-       int index;\r
-       byte count, val;\r
-       long int pos;\r
+       //long bufSize;\r
+       //int index;\r
+       //byte count, val;\r
+       //long int pos;\r
 \r
        /* read the header */\r
        fread(&head, sizeof(char), sizeof(struct pcxHeader), file);\r
index 1d0154b15b399ae9437727ea6fcbd05eb6d8c9f0..6ef0af717d09818d4f06f5895557dcbd0863f146 100755 (executable)
@@ -26,7 +26,7 @@
 #ifndef BITMAP_H\r
 #define BITMAP_H\r
 \r
-#include "src/lib/modex16.h"\r
+#include "src/lib/16_vl.h"\r
 \r
 bitmap_t bitmapLoadPcx(char *filename);\r
 tileset_t bitmapLoadPcxTiles(char *filename, word twidth, word theight);\r
diff --git a/src/lib/cpumk.sh b/src/lib/cpumk.sh
new file mode 100755 (executable)
index 0000000..5bed60e
--- /dev/null
@@ -0,0 +1,3 @@
+cd doslib/hw/cpu
+wlink option quiet system win386  library ../../hw/dos/win386/dos.lib library ../../hw/cpu/win386/cpu.lib library ../../windows/ntvdm/win386/ntvdmlib.lib library ../../hw/dos/win386/dos.lib library ../../hw/cpu/win386/cpu.lib file win386/test.obj option map=win386/test.map name win386/test.exe
+wlink option quiet system win386  library ../../hw/dos/win386/dos.lib library ../../hw/cpu/win386/cpu.lib library ../../windows/ntvdm/win386/ntvdmlib.lib library ../../hw/dos/win386/dos.lib library ../../hw/cpu/win386/cpu.lib file win386/grind.obj option map=win386/grind.map
index d7165e9733719fc4197bfdaaeae9998189fa6c54..458ce127f9d5fbcd6ab6f05545851a63936f5429 160000 (submodule)
@@ -1 +1 @@
-Subproject commit d7165e9733719fc4197bfdaaeae9998189fa6c54
+Subproject commit 458ce127f9d5fbcd6ab6f05545851a63936f5429
index 5421d9dd8a57cf37a23cbdc42006859b24117b06..a13a370d8d365bd19a15f2fa5e879f9aec8ec185 100755 (executable)
@@ -95,7 +95,7 @@ word dump(const char *js, jsmntok_t *t, size_t count, word indent, char *js_sv,
                        map->tiles = malloc(sizeof(tiles_t));\r
                        map->tiles->btdata = malloc(sizeof(bitmap_t));\r
                        //fix this to be far~\r
-                       bp = bitmapLoadPcx("data/ed.pcx");\r
+//0000                 bp = bitmapLoadPcx("data/ed.pcx");\r
 //                     bp = bitmapLoadPcx("data/koishi^^.pcx");\r
                        map->tiles->btdata = &bp;\r
 //----                 map->tiles->data = planar_buf_from_bitmap(&bp);\r
@@ -237,9 +237,9 @@ again:
                }\r
        }\r
 \r
-       free(js);\r
-       free(tok);\r
-       fclose(fh);\r
+       //free(js);\r
+       //free(tok);\r
+       //fclose(fh);\r
 \r
        return 0;\r
 }\r
index d3c26c03ff207407212a1f28d1de7d36265f8fc7..88cc79ef43d98a84e00e4b0d5853973ce7c375c1 100755 (executable)
@@ -24,7 +24,7 @@
 #define _LIBMAPREAD_H_\r
 \r
 #include "src/lib/jsmn/jsmn.h"\r
-#include "src/lib/modex16.h"\r
+#include "src/lib/16_vl.h"\r
 #include "src/lib/16_head.h"\r
 \r
 //#define DEBUG_MAPDATA\r
index 2ff43e4616a068a3f3e62ed173881154247948ee..8084f70a1b7a97d17747f1ecd8d4637af1e6aa6f 100755 (executable)
@@ -28,7 +28,7 @@
 #ifndef PLANW_H\r
 #define PLANW_H\r
 \r
-#include "src/lib/modex16.h"\r
+#include "src/lib/16_vl.h"\r
 \r
 planar_buf_t planarLoadPcx(char *filename);\r
 tileset_t planarLoadPcxTiles(char *filename, word twidth, word theight);\r
index b94e768a77c1a8d4813111caa3e2bdae39c36cf3..cb014fd06bf126206eedaa47b6c2b776be4bfeae 100755 (executable)
@@ -362,7 +362,7 @@ initMap(map_t *map) {
 \r
 void near mapScrollRight(map_view_t *mv, player_t *player, word id, word plid)\r
 {\r
-       word x, y;  /* coordinate for drawing */\r
+       word x;//, y;  /* coordinate for drawing */\r
 \r
        /* increment the pixel position and update the page */\r
        mv[id].page->dx += player[plid].speed;\r
@@ -392,7 +392,7 @@ void near mapScrollRight(map_view_t *mv, player_t *player, word id, word plid)
 \r
 void near mapScrollLeft(map_view_t *mv, player_t *player, word id, word plid)\r
 {\r
-       word xy;  /* coordinate for drawing */\r
+       word x;//,y;  /* coordinate for drawing */\r
 \r
        /* decrement the pixel position and update the page */\r
        mv[id].page->dx -= player[plid].speed;\r
@@ -422,7 +422,7 @@ void near mapScrollLeft(map_view_t *mv, player_t *player, word id, word plid)
 \r
 void near mapScrollUp(map_view_t *mv, player_t *player, word id, word plid)\r
 {\r
-       word x, y;  /* coordinate for drawing */\r
+       word y;//x,  /* coordinate for drawing */\r
 \r
        /* decrement the pixel position and update the page */\r
        mv[id].page->dy -= player[plid].speed;\r
@@ -451,7 +451,7 @@ void near mapScrollUp(map_view_t *mv, player_t *player, word id, word plid)
 \r
 void near mapScrollDown(map_view_t *mv, player_t *player, word id, word plid)\r
 {\r
-       word x, y;  /* coordinate for drawing */\r
+       word y;//x,  /* coordinate for drawing */\r
 \r
        /* increment the pixel position and update the page */\r
        mv[id].page->dy += player[plid].speed;\r
@@ -594,7 +594,7 @@ sword chkmap(map_t *map, word q)
 //TODO: player position here\r
 void mapGoTo(map_view_t *mv, int tx, int ty)\r
 {\r
-       int px, py;\r
+       int py;//px,\r
        unsigned int i;\r
 \r
        /* set up the coordinates */\r
@@ -634,8 +634,7 @@ mapDrawTile(tiles_t *t, word i, page_t *page, word x, word y)
 {\r
        word rx;\r
        word ry;\r
-       word textx=0;\r
-       word texty=0;\r
+       //word textx=0, texty=0;\r
        //if(i==0) i=2;\r
        if(i==0)\r
        {\r
@@ -761,8 +760,8 @@ void shinku(global_game_variables_t *gv)
 {\r
        word x = (0) + gv->video.page[/*!*/(gv->video.p)].dx; // follow the screen\r
        word y = (0) + gv->video.page[/*!*/(gv->video.p)].dy; // follow the screen\r
-       word w = 64, h = 8, col = 7, bgcol = 0, type = 1;\r
-       byte o,o2,i;\r
+       word col = 7, bgcol = 0, type = 1;//w = 64, h = 8,\r
+       //byte o,o2,i;\r
        //modexCopyPageRegion(pip[1].page, pip[2].page, 16, 16, 16, 16, (14*8)+4, 8+4);\r
        /* block copy to visible RAM from offscreen */\r
 //     vga_setup_wm1_block_copy();\r
@@ -774,9 +773,16 @@ void shinku(global_game_variables_t *gv)
 //     vga_restore_rm0wm0();\r
        if(elapsed_timer(gv) >= (1.0 / gv->kurokku.frames_per_second))\r
        {\r
-               sprintf(gv->pee, "%.0f fps", (double)gv->kurokku.tiku/ticktock(gv));\r
+        // NTS: For some bizarre reason, gv->pee is not initialized, but the pointer is not NULL even\r
+        //      though it should be. Instead it's NULL as a near pointer but contains a non-null\r
+        //      segment value, so testing against NULL doesn't work. It is initialized properly if\r
+        //      you call start_timer() though which uses near malloc. Rather than fight with that,\r
+        //      I decided it would be better to declare a temp buffer statically and sprintf to that.\r
+        //\r
+        //      This fixes *** Null pointer assignment detected error message in ZCROLL.EXE on exit.\r
+               sprintf(global_temp_status_text, "%.0f fps", (double)gv->kurokku.tiku/ticktock(gv));\r
                //modexClearRegion(&(gv->video.page[shinku_fps_indicator_page]), x, y, w, h, 45);\r
-               modexprint(&(gv->video.page[/*!*/(gv->video.p)]), x, y, type, col, bgcol, gv->pee);\r
+               modexprint(&(gv->video.page[/*!*/(gv->video.p)]), x, y, type, col, bgcol, global_temp_status_text);\r
                gv->kurokku.tiku=0;\r
                /* block copy to visible RAM from offscreen */\r
 //             vga_setup_wm1_block_copy();\r
index 1f60967087e3bcb74d3a56b1aa192096f835868a..a7c4d4b3a844d78cab4b02c59d79c183fa182e67 100755 (executable)
 \r
 #include "src/lib/16_head.h"\r
 #include "src/lib/bakapee.h"\r
-#include "src/lib/modex16.h"\r
+#include "src/lib/16_vl.h"\r
 #include "src/lib/16_in.h"\r
 #include "src/lib/bitmap.h"\r
 #include "src/lib/mapread.h" //map is loaded here www\r
+#include "src/lib/16render.h"\r
+//#include "src/lib/16_map.h"  //new map stuff\r
 #include "src/lib/16_timer.h"\r
 #include "src/lib/wcpu/wcpu.h"\r
 #include "src/lib/16_tail.h"\r
@@ -41,6 +43,8 @@
 #define SPRITE\r
 //#define TILERENDER\r
 \r
+extern void modexDrawSpriteRegion(page_t *page, int x, int y, int rx, int ry, int rw, int rh, bitmap_t *bmp);\r
+\r
 //modexDrawSpritePBufRegion\r
 //modexDrawBmpPBufRegion\r
 #define PBUFSFUN               modexDrawSpriteRegion\r
@@ -70,6 +74,8 @@ typedef struct
 extern boolean pageflipflop, pageploop;\r
 extern unsigned char shinku_fps_indicator_page;\r
 \r
+extern char global_temp_status_text[512];\r
+\r
 //map_t allocMap(int w, int h);\r
 //void initMap(map_t *map);\r
 void walk(map_view_t *pip, player_t *player, word pn);\r
index 4242f6c4ff8920a9cc05924e7be64438c44bf844..a27b6b8599374f6950e0939fbb37e215dd5114a7 100755 (executable)
@@ -336,10 +336,13 @@ typedef struct
        video_t video;  // video settings variable\r
        ca_t            ca;     // ca stuff\r
        pm_t            pm;     // pm stuff\r
-       byte *pee;              // message for fps\r
        loghandle_t handle;     //handles for file logging\r
        kurokku_t kurokku;      //clock struct\r
        mminfo_t mm; mminfotype mmi;\r
 } global_game_variables_t;\r
 \r
+extern char global_temp_status_text[512];\r
+\r
+#define EINVFMT EMFILE\r
+\r
 #endif /* _TYPEDEFSTRUCT_H_ */\r
index 884aaea956fa090d1e9920804b0a8629388e696b..093b38da5df52bc9d21c8dd6c6f8aae20133d6d9 100755 (executable)
@@ -48,15 +48,17 @@ 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
+//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
+//typedef void _seg * memptr;\r
 #define __SEGA _seg\r
 #endif\r
 \r
+typedef void _seg * memptr;//typedef void __based( void ) * memptr;    ////old //----typedef void __based(__self) * memptr;\r
+\r
 #define _argv __argv\r
 #define _argc __argc\r
 \r
index 8a0be98c46c5fb6e46b930ee49e978986b912415..92b919198fb0721835678c42dcbc3bcb79247697 100755 (executable)
@@ -25,7 +25,7 @@
 
 byte detectcpu()
 {
-       byte cputype;
+       byte cputype=0;
        __asm
        {
                PUSHF                   ; we gonna modify flags, so back them up
index 25437fcb03460886861838992dc9e2971e56b517..624b098f4fa01fe8956eede176b5e4671f563dc4 100755 (executable)
@@ -20,7 +20,7 @@
  *\r
  */\r
 \r
-#include "src/lib/modex16.h"\r
+#include "src/lib/16_vl.h"\r
 \r
 global_game_variables_t gvar;\r
 \r
index 04beeff673d6377236e85bebd05f1245ff09005f..53e86c2d0c19409b80524eac9be4069c1ae31a83 100755 (executable)
@@ -20,7 +20,7 @@
  *\r
  */\r
 \r
-#include "src/lib/modex16.h"\r
+#include "src/lib/16_vl.h"\r
 #include "src/lib/bakapee.h"\r
 \r
 global_game_variables_t gvar;\r
index 2f61443de3d0a72af5148d8fdba8e3680fbd019f..84a8323699855b657c370a37a64cbd96939d91a3 100755 (executable)
 #include <stdio.h>\r
 #include <dos.h>\r
 #include <string.h>\r
-#include "src/lib/modex16.h"\r
+#include "src/lib/16_vl.h"\r
 #include "src/lib/bitmap.h"\r
 //----#include "src/lib/planar.h"\r
 \r
 global_game_variables_t gvar;\r
+static word far* clockw= (word far*) 0x046C; /* 18.2hz clock */\r
 \r
 void main() {\r
        bitmap_t bmp;\r
index 167e1f6a46f955f2b8071112cec982b1ad1bad63..f92c300be87c7871db32ff7404e4b0312bf4530e 100755 (executable)
 #include <stdio.h>\r
 #include <dos.h>\r
 #include <string.h>\r
-#include "src/lib/modex16.h"\r
+#include "src/lib/16_vl.h"\r
 #include "src/lib/bitmap.h"\r
 //----#include "src/lib/planar.h"\r
 \r
 global_game_variables_t gvar;\r
+static word far* clockw= (word far*) 0x046C; /* 18.2hz clock */\r
 \r
 /*\r
 void\r
index eea4796ca6dc515ba0eedc765c0087a0d88857a9..e673302642796ac07a47734577c1aa4781227b1b 100755 (executable)
@@ -23,7 +23,7 @@
 #include <stdio.h>\r
 #include <dos.h>\r
 #include <string.h>\r
-#include "src/lib/modex16.h"\r
+#include "src/lib/16_vl.h"\r
 #include "src/lib/modex16/16planar.h"\r
 \r
 global_game_variables_t gvar;\r
index e638df1b06c0677b09dce6d45fe3b32e956024a8..b512f832bf78e8274e83bcb292aa1c8308f90839 100755 (executable)
@@ -23,6 +23,7 @@
 #include "src/lib/scroll16.h"\r
 #include "src/lib/16_timer.h"\r
 #include "src/lib/wcpu/wcpu.h"\r
+#include "src/lib/mapread.h"\r
 \r
 //#define FADE\r
 #define MODEX  //this is for mode x initiating\r
@@ -47,7 +48,7 @@ boolean panswitch=0;
        //map_view_db_t pgid[4];\r
        word pg;\r
 //#ifdef FADE\r
-       static word paloffset=0;\r
+       //static word paloffset=0;\r
        byte *dpal;\r
 //#endif\r
        byte *gpal;\r
@@ -56,7 +57,7 @@ boolean panswitch=0;
 \r
 void main(int argc, char *argv[])\r
 {\r
-       byte *mesg=malloc(sizeof(dword));\r
+       //byte *mesg=malloc(sizeof(dword));\r
 \r
        if(argv[1]) bakapee = atoi(argv[1]);\r
        else bakapee = 1;\r
index cb75a0fa248ae81e17025f162fe09489428c057d..dfbc7de857e89c923f66948880f643870382fc4b 100755 (executable)
  */\r
 \r
 #include <stdio.h>\r
-#include "src/lib/modex16.h"\r
+#include "src/lib/16_vl.h"\r
 #include "src/lib/16_in.h"\r
 #include "src/lib/scroll16.h"\r
 #include "src/lib/bakapee.h"\r
 \r
+static word far* clockw= (word far*) 0x046C; /* 18.2hz clock */\r
 global_game_variables_t gvar;\r
 player_t player[MaxPlayers];\r
 map_view_t mv[4];\r
index 722678a6f3f02e230c76280f4cf4ba5ef522933b..b4c33ee3c7f5315f574e20e2a39a2586dfa86c0f 100755 (executable)
@@ -22,7 +22,7 @@
 \r
 #include <stdio.h>\r
 #include <conio.h>\r
-#include "src/lib/modex16.h"\r
+#include "src/lib/16_vl.h"\r
 #include "src/lib/planar.h"\r
 //#include "src/lib/bitmap.h"\r
 \r
index d1f8bbbe3ee54e1ec2fead4424e8a66ee3f89bf3..7578e4ab090149e1b2e1a8a5092ec5f4dc7b56bc 100755 (executable)
@@ -2,7 +2,7 @@
 #define __TESUTO_H__\r
 \r
 #include "src/lib/16_head.h"\r
-#include "src/lib/modex16.h"\r
+#include "src/lib/16_vl.h"\r
 #include "src/lib/16_in.h"\r
 #include <hw/cpu/cpu.h>\r
 #include <hw/dos/dos.h>\r
index e77fbc6e805ceebf9cc779bea029b0e66d71a081..2c8eaa89a5698d38df9629d8bf82541c84bb9b8d 100755 (executable)
  *\r
  */\r
 \r
-#include "src/lib/modex16.h"\r
+#include "src/lib/16_vl.h"\r
 #include "src/lib/16_sprit.h"\r
 #include "src/lib/16_ca.h"\r
 #include "src/lib/16_mm.h"\r
 \r
+static word far* clockw= (word far*) 0x046C; /* 18.2hz clock */\r
+\r
 void main() {\r
        global_game_variables_t gvar;\r
        __segment sega;\r
index cdba1e9b992999f492f47aad0f1402c2bb53c8bf..743fe4aff9bdbd8421db40f61c3a0150651e02c8 100755 (executable)
  *\r
  */\r
 \r
-#include "src/lib/modex16.h"\r
+//#include "src/lib/16_head.h"\r
+#include "src/lib/16_vl.h"\r
 #include "src/lib/16_sprit.h"\r
 #include "src/lib/16_tail.h"\r
 #include "src/lib/16_pm.h"\r
 #include "src/lib/16_ca.h"\r
 #include "src/lib/16_mm.h"\r
 \r
+static word far* clockw= (word far*) 0x046C; /* 18.2hz clock */\r
+\r
 void main() {\r
        static global_game_variables_t gvar;\r
-       __segment sega;\r
+       //__segment sega;\r
        memptr bigbuffer;\r
        int i;\r
        word start;\r
        float t1, t2;\r
        boolean baka;\r
-       byte *pal;\r
-       int size;\r
+       byte *pal=0;\r
+       int size=0;\r
        struct sprite spri;\r
-       vrl1_vgax_offset_t * off, *off1;\r
+       //vrl1_vgax_offset_t * off, *off1;\r
        struct vrs_container vrs;\r
        vrl1_vgax_offset_t **vrl_line_offsets;\r
        uint32_t huge *vrl_headers_offsets;\r
index f7603e8d2c31d3454a4ea86ba46d5b175a032e1c..991217ca4c438c40c32566d77ed43c984b79cdf8 100755 (executable)
@@ -23,6 +23,7 @@
 #include "src/lib/zcroll16.h"\r
 #include "src/lib/16_timer.h"\r
 #include "src/lib/wcpu/wcpu.h"\r
+#include "src/lib/16render.h"\r
 \r
 global_game_variables_t gvar;\r
 static map_t map;\r
@@ -50,15 +51,13 @@ memptr pal;
 \r
 void main(int argc, char *argv[])\r
 {\r
-       byte *mesg=malloc(sizeof(dword));\r
-       int i;\r
-\r
        if(argv[1]) bakapee = atoi(argv[1]);\r
        else bakapee = 1;\r
 \r
        Startup16(&gvar);\r
 \r
        pan.pn=0;\r
+       // OK, this one takes hellova time and needs to be done in farmalloc or MM_...\r
        player = malloc(sizeof(player_t));\r
        player->ent = malloc(sizeof(entity_t));\r
        player->ent->spri = malloc(sizeof(struct sprite));\r
diff --git a/t.bat b/t.bat
deleted file mode 100755 (executable)
index 801c5be..0000000
--- a/t.bat
+++ /dev/null
@@ -1 +0,0 @@
-tesuto.exe data\aconita.vrl data\aconita.pal\r
index c26af169b556455599b6b9319e1706a54f332990..fc489c2c5f4537dd2ef1aeda66015b68eb8b02a2 100755 (executable)
Binary files a/test.exe and b/test.exe differ
index a8a34c97014994b0cc89296c0c5def3970835185..31c4ed411655c2f8eecc3f18a69cd94a4c0878e7 100755 (executable)
Binary files a/test0.exe and b/test0.exe differ
index d4aeea4b58af9e921bf1dac62513962a12d1700f..68c88c980b6b66bfe5545ac71052f8e35e128a61 100755 (executable)
Binary files a/vgmtest.exe and b/vgmtest.exe differ
index 4d947e6209a0648e23bea75619cddffd77cf3016..fa6245cdd8e04914f78eccef989255a27b830990 100755 (executable)
--- a/wbuild.sh
+++ b/wbuild.sh
@@ -2,12 +2,12 @@
 wmake -h clean
 wmake -h
 wmake -h comp
-if [ -f *.err ]
-then
-       echo dumping *.err
+#if [[ -f *.err ]]
+#then
+#      echo dumping *.err
        #cat *.err
-       wmake vomitchan
-fi
+       wmake -h vomitchan
+#fi
 #if [ -f 16_head.o ]
 #then
 #      rm *.o