]> 4ch.mooo.com Git - 16.git/commitdiff
no idea why bcexmm.exe is broke w tweaked zcroll.exe a bit also Quit is refined now~
authorsparky4 <sparky4@cock.li>
Fri, 9 Dec 2016 16:30:18 +0000 (10:30 -0600)
committersparky4 <sparky4@cock.li>
Fri, 9 Dec 2016 16:30:18 +0000 (10:30 -0600)
20 files changed:
DEBUG.16B [new file with mode: 0755]
MEMINFO.16B [deleted file]
MMDUMP.16B
bcexmm.dsk
bcexmm.exe
bcexmm.prj
src/.scroll.c.kate-swp [deleted file]
src/lib/16_ca.c
src/lib/16_dbg.c
src/lib/16_dbg.h
src/lib/16_head.c
src/lib/16_head.h
src/lib/16_in.c
src/lib/16_mm.c
src/lib/16_pm.c
src/lib/16_scr.h
src/lib/16_t.h
src/lib/16_tail.c
src/lib/16_tail.h
src/scroll.c

diff --git a/DEBUG.16B b/DEBUG.16B
new file mode 100755 (executable)
index 0000000..f30673d
--- /dev/null
+++ b/DEBUG.16B
@@ -0,0 +1,210 @@
+\e[0mSeg:0      Size:4897       Owner:0x0\r
+\e[41;31m++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++\e[0m\e[42;32m0\r
+\e[0m\e[0mSeg:1321       Size:256        Owner:0x993\r
+\e[44;34m++++\e[0m\e[42;32m\r
+\e[0m\e[0mSeg:1421       Size:256        Owner:0x798\r
+\e[45;35m++++\e[0m\e[42;32m\r
+\e[0m\e[0mSeg:1521       Size:256        Owner:0x79a\r
+\e[45;35m++++\e[0m\e[42;32m\r
+\e[0m\e[0mSeg:1621       Size:256        Owner:0x79c\r
+\e[45;35m+++++\e[0m\e[42;32m\r
+\e[0m\e[0mSeg:1721       Size:256        Owner:0x79e\r
+\e[45;35m++++\e[0m\e[42;32m\r
+\e[0m\e[0mSeg:1821       Size:256        Owner:0x7a0\r
+\e[45;35m++++\e[0m\e[42;32m\r
+\e[0m\e[0mSeg:1921       Size:256        Owner:0x7a2\r
+\e[45;35m++++\e[0m\e[42;32m\r
+\e[0m\e[0mSeg:1a21       Size:256        Owner:0x7a4\r
+\e[45;35m++++\e[0m\e[42;32m\r
+\e[0m\e[0mSeg:1b21       Size:256        Owner:0x7a6\r
+\e[45;35m+++++\e[0m\e[42;32m\r
+\e[0m\e[0mSeg:1c21       Size:256        Owner:0x7a8\r
+\e[45;35m++++\e[0m\e[42;32m\r
+\e[0m\e[0mSeg:1d21       Size:256        Owner:0x7aa\r
+\e[45;35m++++\e[0m\e[42;32m\r
+\e[0m\e[0mSeg:1e21       Size:256        Owner:0x7ac\r
+\e[45;35m++++\e[0m\e[42;32m\r
+\e[0m\e[0mSeg:1f21       Size:256        Owner:0x7ae\r
+\e[45;35m++++\e[0m\e[42;32m\r
+\e[0m\e[0mSeg:2021       Size:256        Owner:0x7b0\r
+\e[45;35m+++++\e[0m\e[42;32m\r
+\e[0m\e[0mSeg:2121       Size:256        Owner:0x7b2\r
+\e[45;35m++++\e[0m\e[42;32m\r
+\e[0m\e[0mSeg:2221       Size:256        Owner:0x7b4\r
+\e[45;35m++++\e[0m\e[42;32m\r
+\e[0m\e[0mSeg:2321       Size:256        Owner:0x7b6\r
+\e[45;35m++++\e[0m\e[42;32m\r
+\e[0m\e[0mSeg:2421       Size:256        Owner:0x7b8\r
+\e[45;35m++++\e[0m\e[42;32m\r
+\e[0m\e[0mSeg:2521       Size:256        Owner:0x7ba\r
+\e[45;35m+++++\e[0m\e[42;32m\r
+\e[0m\e[0mSeg:2621       Size:256        Owner:0x7bc\r
+\e[45;35m++++\e[0m\e[42;32m\r
+\e[0m\e[0mSeg:2721       Size:256        Owner:0x7be\r
+\e[45;35m++++\e[0m\e[42;32m\r
+\e[0m\e[0mSeg:2821       Size:256        Owner:0x7c0\r
+\e[45;35m++++\e[0m\e[42;32m\r
+\e[0m\e[0mSeg:2921       Size:256        Owner:0x7c2\r
+\e[45;35m++++\e[0m\e[42;32m\r
+\e[0m\e[0mSeg:2a21       Size:256        Owner:0x7c4\r
+\e[45;35m+++++\e[0m\e[42;32m\r
+\e[0m\e[0mSeg:2b21       Size:256        Owner:0x7c6\r
+\e[45;35m++++\e[0m\e[42;32m\r
+\e[0m\e[0mSeg:2c21       Size:256        Owner:0x7c8\r
+\e[45;35m++++\e[0m\e[42;32m\r
+\e[0m\e[0mSeg:2d21       Size:256        Owner:0x7ca\r
+\e[45;35m++++\e[0m\e[42;32m\r
+\e[0m\e[0mSeg:2e21       Size:256        Owner:0x7cc\r
+\e[45;35m++++\e[0m\e[42;32m\r
+\e[0m\e[0mSeg:2f21       Size:256        Owner:0x7ce\r
+\e[45;35m+++++\e[0m\e[42;32m\r
+\e[0m\e[0mSeg:3021       Size:256        Owner:0x7d0\r
+\e[45;35m++++\e[0m\e[42;32m\r
+\e[0m\e[0mSeg:3121       Size:256        Owner:0x7d2\r
+\e[45;35m++++\e[0m\e[42;32m\r
+\e[0m\e[0mSeg:3221       Size:256        Owner:0x7d4\r
+\e[45;35m++++\e[0m\e[42;32m\r
+\e[0m\e[0mSeg:3321       Size:256        Owner:0x7d6\r
+\e[45;35m++++\e[0m\e[42;32m\r
+\e[0m\e[0mSeg:3421       Size:256        Owner:0x7d8\r
+\e[45;35m+++++\e[0m\e[42;32m\r
+\e[0m\e[0mSeg:3521       Size:256        Owner:0x7da\r
+\e[45;35m++++\e[0m\e[42;32m\r
+\e[0m\e[0mSeg:3621       Size:256        Owner:0x7dc\r
+\e[45;35m++++\e[0m\e[42;32m\r
+\e[0m\e[0mSeg:3721       Size:256        Owner:0x7de\r
+\e[45;35m++++\e[0m\e[42;32m\r
+\e[0m\e[0mSeg:3821       Size:256        Owner:0x7e0\r
+\e[45;35m++++\e[0m\e[42;32m\r
+\e[0m\e[0mSeg:3921       Size:256        Owner:0x7e2\r
+\e[45;35m+++++\e[0m\e[42;32m\r
+\e[0m\e[0mSeg:3a21       Size:256        Owner:0x7e4\r
+\e[45;35m++++\e[0m\e[42;32m\r
+\e[0m\e[0mSeg:3b21       Size:256        Owner:0x7e6\r
+\e[45;35m++++\e[0m\e[42;32m\r
+\e[0m\e[0mSeg:3c21       Size:256        Owner:0x7e8\r
+\e[45;35m++++\e[0m\e[42;32m\r
+\e[0m\e[0mSeg:3d21       Size:256        Owner:0x7ea\r
+\e[45;35m++++\e[0m\e[42;32m\r
+\e[0m\e[0mSeg:3e21       Size:256        Owner:0x7ec\r
+\e[45;35m+++++\e[0m\e[42;32m\r
+\e[0m\e[0mSeg:3f21       Size:256        Owner:0x7ee\r
+\e[45;35m++++\e[0m\e[42;32m\r
+\e[0m\e[0mSeg:4021       Size:256        Owner:0x7f0\r
+\e[45;35m++++\e[0m\e[42;32m\r
+\e[0m\e[0mSeg:4121       Size:256        Owner:0x7f2\r
+\e[45;35m++++\e[0m\e[42;32m\r
+\e[0m\e[0mSeg:4221       Size:256        Owner:0x7f4\r
+\e[45;35m++++\e[0m\e[42;32m\r
+\e[0m\e[0mSeg:4321       Size:256        Owner:0x7f6\r
+\e[45;35m+++++\e[0m\e[42;32m\r
+\e[0m\e[0mSeg:4421       Size:256        Owner:0x7f8\r
+\e[45;35m++++\e[0m\e[42;32m\r
+\e[0m\e[0mSeg:4521       Size:256        Owner:0x7fa\r
+\e[45;35m++++\e[0m\e[42;32m\r
+\e[0m\e[0mSeg:4621       Size:256        Owner:0x7fc\r
+\e[45;35m++++\e[0m\e[42;32m\r
+\e[0m\e[0mSeg:4721       Size:256        Owner:0x7fe\r
+\e[45;35m++++\e[0m\e[42;32m\r
+\e[0m\e[0mSeg:4821       Size:256        Owner:0x800\r
+\e[45;35m+++++\e[0m\e[42;32m\r
+\e[0m\e[0mSeg:4921       Size:256        Owner:0x802\r
+\e[45;35m++++\e[0m\e[42;32m\r
+\e[0m\e[0mSeg:4a21       Size:256        Owner:0x804\r
+\e[45;35m++++\e[0m\e[42;32m\r
+\e[0m\e[0mSeg:4b21       Size:256        Owner:0x806\r
+\e[45;35m++++\e[0m\e[42;32m\r
+\e[0m\e[0mSeg:4c21       Size:256        Owner:0x808\r
+\e[45;35m++++\e[0m\e[42;32m\r
+\e[0m\e[0mSeg:4d21       Size:256        Owner:0x80a\r
+\e[45;35m+++++\e[0m\e[42;32m\r
+\e[0m\e[0mSeg:4e21       Size:256        Owner:0x80c\r
+\e[45;35m++++\e[0m\e[42;32m\r
+\e[0m\e[0mSeg:4f21       Size:256        Owner:0x80e\r
+\e[45;35m++++\e[0m\e[42;32m\r
+\e[0m\e[0mSeg:5021       Size:256        Owner:0x810\r
+\e[45;35m++++\e[0m\e[42;32m\r
+\e[0m\e[0mSeg:5121       Size:256        Owner:0x812\r
+\e[45;35m++++\e[0m\e[42;32m\r
+\e[0m\e[0mSeg:5221       Size:256        Owner:0x814\r
+\e[45;35m+++++\e[0m\e[42;32m\r
+\e[0m\e[0mSeg:5321       Size:256        Owner:0x816\r
+\e[45;35m++++\e[0m\e[42;32m\r
+\e[0m\e[0mSeg:5421       Size:256        Owner:0x818\r
+\e[45;35m++++\e[0m\e[42;32m\r
+\e[0m\e[0mSeg:5521       Size:256        Owner:0x81a\r
+\e[45;35m++++\e[0m\e[42;32m\r
+\e[0m\e[0mSeg:5621       Size:256        Owner:0x81c\r
+\e[45;35m++++\e[0m\e[42;32m\r
+\e[0m\e[0mSeg:5721       Size:256        Owner:0x81e\r
+\e[45;35m+++++\e[0m\e[42;32m\r
+\e[0m\e[0mSeg:5821       Size:256        Owner:0x820\r
+\e[45;35m++++\e[0m\e[42;32m\r
+\e[0m\e[0mSeg:5921       Size:256        Owner:0x822\r
+\e[45;35m++++\e[0m\e[42;32m\r
+\e[0m\e[0mSeg:5a21       Size:256        Owner:0x824\r
+\e[45;35m++++\e[0m\e[42;32m\r
+\e[0m\e[0mSeg:5b21       Size:256        Owner:0x826\r
+\e[45;35m++++\e[0m\e[42;32m\r
+\e[0m\e[0mSeg:5c21       Size:256        Owner:0x828\r
+\e[45;35m+++++\e[0m\e[42;32m\r
+\e[0m\e[0mSeg:5d21       Size:256        Owner:0x82a\r
+\e[45;35m++++\e[0m\e[42;32m\r
+\e[0m\e[0mSeg:5e21       Size:256        Owner:0x82c\r
+\e[45;35m++++\e[0m\e[42;32m\r
+\e[0m\e[0mSeg:5f21       Size:256        Owner:0x82e\r
+\e[45;35m++++\e[0m\e[42;32m\r
+\e[0m\e[0mSeg:6021       Size:256        Owner:0x830\r
+\e[45;35m++++\e[0m\e[42;32m\r
+\e[0m\e[0mSeg:6121       Size:256        Owner:0x832\r
+\e[45;35m+++++\e[0m\e[42;32m\r
+\e[0m\e[0mSeg:6221       Size:256        Owner:0x834\r
+\e[45;35m++++\e[0m\e[42;32m\r
+\e[0m\e[0mSeg:6321       Size:256        Owner:0x836\r
+\e[45;35m++++\e[0m\e[42;32m\r
+\e[0m\e[0mSeg:6421       Size:256        Owner:0x838\r
+\e[45;35m++++\e[0m\e[42;32m\r
+\e[0m\e[0mSeg:6521       Size:256        Owner:0x83a\r
+\e[45;35m++++\e[0m\e[42;32m\r
+\e[0m\e[0mSeg:6621       Size:256        Owner:0x83c\r
+\e[45;35m+++++\e[0m\e[42;32m\r
+\e[0m\e[0mSeg:6721       Size:256        Owner:0x83e\r
+\e[45;35m++++\e[0m\e[42;32m\r
+\e[0m\e[0mSeg:6821       Size:256        Owner:0x840\r
+\e[45;35m++++\e[0m\e[42;32m\r
+\e[0m\e[0mSeg:6921       Size:256        Owner:0x842\r
+\e[45;35m++++\e[0m\e[42;32m\r
+\e[0m\e[0mSeg:6a21       Size:256        Owner:0x844\r
+\e[45;35m++++\e[0m\e[42;32m\r
+\e[0m\e[0mSeg:6b21       Size:256        Owner:0x846\r
+\e[45;35m+++++\e[0m\e[42;32m\r
+\e[0m\e[0mSeg:6c21       Size:256        Owner:0x848\r
+\e[45;35m++++\e[0m\e[42;32m\r
+\e[0m\e[0mSeg:6d21       Size:256        Owner:0x84a\r
+\e[45;35m++++\e[0m\e[42;32m\r
+\e[0m\e[0mSeg:6e21       Size:256        Owner:0x84c\r
+\e[45;35m++++\e[0m\e[42;32m\r
+\e[0m\e[0mSeg:6f21       Size:256        Owner:0x84e\r
+\e[45;35m++++\e[0m\e[42;32m\r
+\e[0m\e[0mSeg:7021       Size:256        Owner:0x850\r
+\e[45;35m+++++\e[0m\e[42;32m\r
+\e[0m\e[0mSeg:7121       Size:256        Owner:0x852\r
+\e[45;35m++++\e[0m\e[42;32m\r
+\e[0m\e[0mSeg:7221       Size:256        Owner:0x854\r
+\e[45;35m++++\e[0m\e[42;32m\r
+\e[0m\e[0mSeg:7321       Size:256        Owner:0x856\r
+\e[45;35m++++\e[0m\e[42;32m\r
+\e[0m\e[0mSeg:7421       Size:256        Owner:0x858\r
+\e[45;35m++++\e[0m\e[42;32m\r
+\e[0m\e[0mSeg:7521       Size:256        Owner:0x85a\r
+\e[45;35m+++++\e[0m\e[42;32m\r
+\e[0m\e[0mSeg:7621       Size:256        Owner:0x85c\r
+\e[45;35m++++\e[0m\e[42;32m\r
+\e[0m\e[0mSeg:7721       Size:256        Owner:0x85e\r
+\e[45;35m++++\e[0m\e[42;32m\r
+\e[0m\e[0mSeg:7821       Size:273        Owner:0xfde\r
+\e[44;34m++++\e[0m\e[42;32m\r
+\e[0m\e[0mSeg:9fde       Size:32802      Owner:0x0\r
+\e[41;31m\e[0m\e[42;32m\r
+\e[0m\e[0mSeg:9ffe       Size:24577      Owner:0x0\r
+\e[41;31m+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++\e[0m
\ No newline at end of file
diff --git a/MEMINFO.16B b/MEMINFO.16B
deleted file mode 100755 (executable)
index e69de29..0000000
index 3c667e2af1d2866c1a8cc78aabe0767f50845823..451d087ed8a9e199d66b37c7b7cee5dd7d4d7e95 100755 (executable)
Binary files a/MMDUMP.16B and b/MMDUMP.16B differ
index d066bdd4212a88ffd862ae194e8e9b1d04bf57ac..c8d927e3fe1c262b224b4549af444f03470807ee 100755 (executable)
Binary files a/bcexmm.dsk and b/bcexmm.dsk differ
index b8e96146a4d59e5392d79ef48ae91873e98c7a50..585ca07a74a6ebc81ad7ef6383333f01f32e6974 100755 (executable)
Binary files a/bcexmm.exe and b/bcexmm.exe differ
index ff6890861188b34fb64defbe8b4a7ecd5ea8e708..72ec764f317f94de0cafa57501cc14ed020e3ccb 100755 (executable)
Binary files a/bcexmm.prj and b/bcexmm.prj differ
diff --git a/src/.scroll.c.kate-swp b/src/.scroll.c.kate-swp
deleted file mode 100755 (executable)
index 29d7843..0000000
Binary files a/src/.scroll.c.kate-swp and /dev/null differ
index 7298ca3f6639ae93daa497da0a3419d8dbe68b25..61838010e59eee4de606050e7d5df7b6ef7f431a 100755 (executable)
@@ -1028,7 +1028,7 @@ dinorm:
 \r
        if ((handle = open(GREXT"DICT."EXT,\r
                 O_RDONLY | O_BINARY, S_IREAD)) == -1)\r
-               Quit ("Can't open "GREXT"DICT."EXT"!");\r
+               Quit (gvar, "Can't open "GREXT"DICT."EXT"!");\r
 \r
        read(handle, &grhuffman, sizeof(grhuffman));\r
        close(handle);\r
@@ -1040,7 +1040,7 @@ dinorm:
 \r
        if ((handle = open(GREXT"HEAD."EXT,\r
                 O_RDONLY | O_BINARY, S_IREAD)) == -1)\r
-               Quit ("Can't open "GREXT"HEAD."EXT"!");\r
+               Quit (gvar, "Can't open "GREXT"HEAD."EXT"!");\r
 \r
        CA_FarRead(handle, (memptr)grstarts, (NUMCHUNKS+1)*FILEPOSSIZE);\r
 \r
@@ -1054,7 +1054,7 @@ dinorm:
 //\r
        grhandle = open(GREXT"GRAPH."EXT, O_RDONLY | O_BINARY);\r
        if (grhandle == -1)\r
-               Quit ("Cannot open "GREXT"GRAPH."EXT"!");\r
+               Quit (gvar, "Cannot open "GREXT"GRAPH."EXT"!");\r
 \r
 \r
 //\r
@@ -1134,11 +1134,11 @@ void CAL_SetupMapFile (global_game_variables_t *gvar)
 // #ifdef MAPHEADERLINKED\r
 //     if ((maphandle = open("GAMEMAPS."EXT,\r
 //              O_RDONLY | O_BINARY, S_IREAD)) == -1)\r
-//             Quit ("Can't open GAMEMAPS."EXT"!");\r
+//             Quit (gvar, "Can't open GAMEMAPS."EXT"!");\r
 // //#else\r
 //     if ((maphandle = open("MAPTEMP."EXT,\r
 //              O_RDONLY | O_BINARY, S_IREAD)) == -1)\r
-//             Quit ("Can't open MAPTEMP."EXT"!");\r
+//             Quit (gvar, "Can't open MAPTEMP."EXT"!");\r
 // #endif\r
 }\r
 \r
@@ -1164,7 +1164,7 @@ void CAL_SetupMapFile (global_game_variables_t *gvar)
 #ifndef AUDIOHEADERLINKED\r
        if ((handle = open("AUDIOHED."EXT,\r
                 O_RDONLY | O_BINARY, S_IREAD)) == -1)\r
-               Quit ("Can't open AUDIOHED."EXT"!");\r
+               Quit (gvar, "Can't open AUDIOHED."EXT"!");\r
        length = filelength(handle);\r
        MM_GetPtr (&(memptr)audiostarts,length);\r
        CA_FarRead(handle, (byte far *)audiostarts, length);\r
@@ -1181,11 +1181,11 @@ void CAL_SetupMapFile (global_game_variables_t *gvar)
 #ifndef AUDIOHEADERLINKED\r
        if ((audiohandle = open("AUDIOT."EXT,\r
                 O_RDONLY | O_BINARY, S_IREAD)) == -1)\r
-               Quit ("Can't open AUDIOT."EXT"!");\r
+               Quit (gvar, "Can't open AUDIOT."EXT"!");\r
 #else\r
        if ((audiohandle = open("AUDIO."EXT,\r
                 O_RDONLY | O_BINARY, S_IREAD)) == -1)\r
-               Quit ("Can't open AUDIO."EXT"!");\r
+               Quit (gvar, "Can't open AUDIO."EXT"!");\r
 #endif\r
 }*/\r
 \r
@@ -1291,7 +1291,7 @@ void CA_CacheAudioChunk (int chunk)
 // MDM begin - (GAMERS EDGE)\r
 //\r
        if (!FindFile("AUDIO."EXT,NULL,2))\r
-               Quit("CA_CacheAudioChunk(): Can't find audio files.");\r
+               Quit (gvar, "CA_CacheAudioChunk(): Can't find audio files.");\r
 //\r
 // MDM end\r
 \r
@@ -1630,7 +1630,7 @@ void CAL_CacheSprite (int chunk, byte far *compressed)
                break;\r
 \r
        default:\r
-               Quit ("CAL_CacheSprite: Bad shifts number!");\r
+               Quit (gvar, "CAL_CacheSprite: Bad shifts number!");\r
        }\r
 \r
 #endif\r
@@ -1789,7 +1789,7 @@ void CA_CacheGrChunk (int chunk)
 // MDM begin - (GAMERS EDGE)\r
 //\r
        if (!FindFile("EGAGRAPH."EXT,NULL,2))\r
-               Quit("CA_CacheGrChunk(): Can't find graphics files.");\r
+               Quit (gvar, "CA_CacheGrChunk(): Can't find graphics files.");\r
 //\r
 // MDM end\r
 \r
@@ -2255,7 +2255,7 @@ void CA_CacheMarks (char *title)
 // MDM begin - (GAMERS EDGE)\r
 //\r
        if (!FindFile("EGAGRAPH."EXT,NULL,2))\r
-               Quit("CA_CacheMarks(): Can't find graphics files.");\r
+               Quit (gvar, "CA_CacheMarks(): Can't find graphics files.");\r
 //\r
 // MDM end\r
 \r
index c3a4d5bb1628d95912ccc903a1bfd71d118eb4d2..7f34624b630ade752c5db9030aae8ed523ee58d9 100755 (executable)
@@ -9,7 +9,6 @@ boolean dbg_debugpm=0;
 #ifdef __DEBUG_InputMgr__\r
 boolean dbg_testkeyin=0,dbg_testcontrolnoisy=0;\r
 #endif\r
-boolean dbg_nommpmca=0;\r
 #endif\r
 \r
 \r
index eb1743eb2befc4ee3efbc267986d3bca729359e1..06c3fccf07f87b9e061914129fcdcc3f02f904ec 100755 (executable)
@@ -18,7 +18,6 @@ extern boolean dbg_debugpm;
 #ifdef __DEBUG_InputMgr__\r
 extern boolean dbg_testkeyin,dbg_testcontrolnoisy;\r
 #endif\r
-extern boolean dbg_nommpmca;\r
 #endif\r
 \r
 # ifdef DEBUGSERIAL\r
index e56baa94bc86fb44c4efc521450b67d872afef18..7c25afa5126fc50add3dc1c8ff34c5f8b7217c73 100755 (executable)
@@ -78,71 +78,7 @@ US_CheckParm(char *parm,char **strings)
        }\r
        return(-1);\r
 }\r
-#ifdef __BORLANDC__\r
-//===========================================================================\r
 \r
-/*\r
-==========================\r
-=\r
-= Quit\r
-=\r
-==========================\r
-*/\r
-\r
-void Quit (char *error)\r
-{\r
-       unsigned        finscreen;\r
-       memptr  screen;\r
-       union REGS in, out;\r
-\r
-       //ClearMemory ();\r
-       if (!*error)\r
-       {\r
-        //WriteConfig ();\r
-       }\r
-       else\r
-       {\r
-        //CA_CacheGrChunk (ERRORSCREEN);\r
-        //screen = grsegs[ERRORSCREEN];\r
-       }\r
-\r
-       //ShutdownId ();\r
-       //IN_Shutdown();\r
-       //modexLeave();\r
-       in.h.ah = 0x00;\r
-       in.h.al = 0x3;\r
-       int86(0x10, &in, &out);\r
-\r
-       if (error && *error)\r
-       {\r
-         //movedata ((unsigned)screen,7,0xb800,0,7*160);\r
-         //gotoxy (10,4);\r
-               printf("\n");\r
-         puts(error);\r
-               printf("\n");\r
-         //gotoxy (1,8);\r
-         exit(1);\r
-       }\r
-       else\r
-       if (!error || !(*error))\r
-       {\r
-               //clrscr();\r
-               //#ifndef JAPAN\r
-               movedata ((unsigned)screen,7,0xb800,0,4000);\r
-               //gotoxy(1,24);\r
-               //#endif\r
-//asm  mov     bh,0\r
-//asm  mov     dh,23   // row\r
-//asm  mov     dl,0    // collumn\r
-//asm  mov ah,2\r
-//asm  int     0x10\r
-       }\r
-\r
-       exit(0);\r
-}\r
-\r
-//===========================================================================\r
-#endif\r
 \r
 byte dirchar(byte in)\r
 {\r
index a622277356a0d2401e99f799e2feac061f9c823d..7fd72c44ca21253b3bd2c9f75802710f40a747d8 100755 (executable)
@@ -200,9 +200,6 @@ typedef union REGPACK       regs_t;
 long int filesize(FILE *fp);\r
 void printmeminfoline(byte *strc, const byte *pee, size_t h_total, size_t h_used, size_t h_free);\r
 int US_CheckParm(char *parm,char **strings);\r
-#ifdef __BORLANDC__\r
-void Quit (char *error);\r
-#endif\r
 byte dirchar(byte in);\r
 \r
 #endif/*__16_HEAD_H__*/\r
index e5d2ec1bc455de2d8031a2982226fab3115a5c3e..9adfe42abd8c0fed0667e4fc93df8c213e91d6db 100755 (executable)
@@ -850,7 +850,7 @@ register    KeyboardDef     *def;
                realdelta = false;\r
        }\r
        else if (DemoMode == demo_PlayDone)\r
-               Quit("Demo playback exceeded");\r
+               Quit ("Demo playback exceeded");\r
        else\r
        {\r
 #endif\r
@@ -973,7 +973,7 @@ register    KeyboardDef     *def;
                                DemoOffset += 2;\r
 \r
                        if (DemoOffset >= DemoSize)\r
-                               Quit("Demo buffer overflow");\r
+                               Quit ("Demo buffer overflow");\r
 \r
                        DemoBuffer[DemoOffset] = 1;\r
                        DemoBuffer[DemoOffset + 1] = dbyte;\r
index 5bbad2b10bd02228ef1c175accff4fd72465e923..98d0c43fa978f3ac5ce926e2f1f94625a102f6c6 100755 (executable)
@@ -28,7 +28,7 @@ Primary coder: John Carmack
 
 RELIES ON
 ---------
-Quit (char *error) function
+Quit (global_game_variables_t *gvar, char *error) function
 
 
 WORK TO DO
@@ -285,7 +285,7 @@ void MML_ShutdownEMS(global_game_variables_t *gvar)
        }
 #endif
        if(errorflag==true)
-               Quit("MML_ShutdownEMS: Error freeing EMS!\n");  //++++ add something
+               Quit (gvar, "MML_ShutdownEMS: Error freeing EMS!\n");   //++++ add something
 }
 
 /*
@@ -1105,7 +1105,7 @@ void MM_SetPurge(memptr *baseptr, int purge, global_game_variables_t *gvar)
                        gvar->mm.mmrover = gvar->mm.mmhead;
                else if(gvar->mm.mmrover == start)
                {
-                       Quit("MM_SetPurge: Block not found!");
+                       Quit (gvar, "MM_SetPurge: Block not found!");
                        //return;
                }
 
@@ -1145,7 +1145,7 @@ void MM_SetLock(memptr *baseptr, boolean locked, global_game_variables_t *gvar)
                        gvar->mm.mmrover = gvar->mm.mmhead;
                else if(gvar->mm.mmrover == start)
                {
-                       Quit("MM_SetLock: Block not found!");
+                       Quit (gvar, "MM_SetLock: Block not found!");
                        //return;
                }
 
index 3a125111d1068557dd8fc20f53b5169d73cb206b..4cf503968b292a4b375c229e4e08e926758c08ad 100755 (executable)
@@ -139,7 +139,7 @@ PML_MapEMS(word logical, byte physical, global_game_variables_t *gvar)
                strcpy(str,"MM_MapEMS: EMS error ");\r
                MM_EMSerr(str, err);\r
                printf("%s\n",str);\r
-               Quit("PML_MapEMS: Page mapping failed\n");\r
+               Quit (gvar, "PML_MapEMS: Page mapping failed\n");\r
                return err;\r
        }\r
        return 0;\r
@@ -352,7 +352,7 @@ PML_ShutdownEMS(global_game_variables_t *gvar)
                        strcpy(str,"PML_ShutdownEMS: Error freeing EMS ");\r
                        MM_EMSerr(str, err);\r
                        printf("%s\n",str);\r
-                       Quit("PML_ShutdownEMS: Error freeing EMS\n");\r
+                       Quit (gvar, "PML_ShutdownEMS: Error freeing EMS\n");\r
                        //return;\r
                }\r
        }\r
@@ -532,7 +532,7 @@ PML_XMSCopy(boolean toxms,byte far *addr,word xmspage,word length, global_game_v
 \r
        if (!addr)\r
        {\r
-               Quit("PML_XMSCopy: zero address\n");\r
+               Quit (gvar, "PML_XMSCopy: zero address\n");\r
                //return;\r
        }\r
 \r
@@ -554,7 +554,7 @@ PML_XMSCopy(boolean toxms,byte far *addr,word xmspage,word length, global_game_v
        }\r
        if (!_AX)\r
        {\r
-               Quit("PML_XMSCopy: Error on copy");\r
+               Quit (gvar, "PML_XMSCopy: Error on copy");\r
                //return;\r
        }\r
 }\r
@@ -621,7 +621,7 @@ PML_ShutdownXMS(global_game_variables_t *gvar)
 #endif\r
                if(errorflag==true)\r
                {\r
-                       Quit("PML_ShutdownXMS: Error freeing XMS");\r
+                       Quit (gvar, "PML_ShutdownXMS: Error freeing XMS");\r
                        //return;\r
                }\r
        }\r
@@ -656,7 +656,7 @@ PM_SetMainMemPurge(int level, global_game_variables_t *gvar)
 \r
        else\r
        {\r
-               Quit("MainPresent IS NULL\n");\r
+               Quit (gvar, "MainPresent IS NULL\n");\r
        }\r
 }\r
 \r
@@ -765,7 +765,7 @@ PML_StartupMainMem(global_game_variables_t *gvar)
                gvar->mm.mmerror = false;\r
        if (gvar->pm.mm.MainPagesAvail < PMMinMainMem)\r
        {\r
-               Quit("PM_SetupMainMem: Not enough main memory");\r
+               Quit (gvar, "PM_SetupMainMem: Not enough main memory");\r
                //return;\r
        }\r
        gvar->pm.mm.MainPresent = true;\r
@@ -801,22 +801,22 @@ PML_ReadFromFile(byte far *buf,long offset,word length, global_game_variables_t
 {\r
        if (!buf)\r
        {\r
-               Quit("PML_ReadFromFile: Null pointer");\r
+               Quit (gvar, "PML_ReadFromFile: Null pointer");\r
                //return;\r
        }\r
        if (!offset)\r
        {\r
-               Quit("PML_ReadFromFile: Zero offset");\r
+               Quit (gvar, "PML_ReadFromFile: Zero offset");\r
                //return;\r
        }\r
        if (lseek(gvar->pm.fi.PageFile,offset,SEEK_SET) != offset)\r
        {\r
-               Quit("PML_ReadFromFile: Seek failed");\r
+               Quit (gvar, "PML_ReadFromFile: Seek failed");\r
                //return;\r
        }\r
        if (!CA_FarRead(gvar->pm.fi.PageFile,buf,length, gvar))\r
        {\r
-               Quit("PML_ReadFromFile: Read failed");\r
+               Quit (gvar, "PML_ReadFromFile: Read failed");\r
                //return;\r
        }\r
 }\r
@@ -838,7 +838,7 @@ PML_OpenPageFile(global_game_variables_t *gvar)
        gvar->pm.fi.PageFile = open(gvar->pm.fi.PageFileName,O_RDONLY + O_BINARY);\r
        if (gvar->pm.fi.PageFile == -1)\r
        {\r
-               Quit("PML_OpenPageFile: Unable to open page file");\r
+               Quit (gvar, "PML_OpenPageFile: Unable to open page file");\r
                //return;\r
        }\r
 \r
@@ -859,7 +859,7 @@ PML_OpenPageFile(global_game_variables_t *gvar)
        MM_GetPtr(&buf, size, gvar);\r
        if (!CA_FarRead(gvar->pm.fi.PageFile,(byte far *)buf,size, gvar))\r
        {\r
-               Quit("PML_OpenPageFile: Offset read failed");\r
+               Quit (gvar, "PML_OpenPageFile: Offset read failed");\r
                //return;\r
        }\r
        offsetptr = (dword far *)buf;\r
@@ -872,7 +872,7 @@ PML_OpenPageFile(global_game_variables_t *gvar)
        MM_GetPtr(&buf,size, gvar);\r
        if (!CA_FarRead(gvar->pm.fi.PageFile,(byte far *)buf,size, gvar))\r
        {\r
-               Quit("PML_OpenPageFile: Length read failed");\r
+               Quit (gvar, "PML_OpenPageFile: Length read failed");\r
                //return;\r
        }\r
        lengthptr = (word far *)buf;\r
@@ -949,7 +949,7 @@ PML_GetEMSAddress(int page,PMLockType lock, global_game_variables_t *gvar)
        }\r
 \r
        if (emspage == -1)\r
-               Quit("PML_GetEMSAddress: EMS find failed");\r
+               Quit (gvar, "PML_GetEMSAddress: EMS find failed");\r
 \r
        gvar->pm.emm.EMSList[emspage].lastHit = gvar->pm.PMFrameCount;\r
        offset = emspage * EMSPageSizeSeg;\r
@@ -1018,7 +1018,7 @@ PML_GiveLRUPage(boolean mainonly, global_game_variables_t *gvar)
        }\r
 \r
        if (lru == -1)\r
-               Quit("PML_GiveLRUPage: LRU Search failed");\r
+               Quit (gvar, "PML_GiveLRUPage: LRU Search failed");\r
        return(lru);\r
 }\r
 \r
@@ -1073,7 +1073,7 @@ PML_PutPageInXMS(int pagenum, global_game_variables_t *gvar)
        {\r
                usexms = PML_GiveLRUXMSPage(gvar);\r
                if (usexms == -1)\r
-                       Quit("PML_PutPageInXMS: No XMS LRU");\r
+                       Quit (gvar, "PML_PutPageInXMS: No XMS LRU");\r
                page->xmsPage = gvar->pm.PMPages[usexms].xmsPage;\r
                gvar->pm.PMPages[usexms].xmsPage = -1;\r
        }\r
@@ -1091,16 +1091,16 @@ PML_TransferPageSpace(int orig,int new, global_game_variables_t *gvar)
        PageListStruct  far *origpage,far *newpage;\r
 \r
        if (orig == new)\r
-               Quit("PML_TransferPageSpace: Identity replacement");\r
+               Quit (gvar, "PML_TransferPageSpace: Identity replacement");\r
 \r
        origpage = &gvar->pm.PMPages[orig];\r
        newpage = &gvar->pm.PMPages[new];\r
 \r
        if (origpage->locked != pml_Unlocked)\r
-               Quit("PML_TransferPageSpace: Killing locked page");\r
+               Quit (gvar, "PML_TransferPageSpace: Killing locked page");\r
 \r
        if ((origpage->emsPage == -1) && (origpage->mainPage == -1))\r
-               Quit("PML_TransferPageSpace: Reusing non-existent page");\r
+               Quit (gvar, "PML_TransferPageSpace: Reusing non-existent page");\r
 \r
        // Copy page that's about to be purged into XMS\r
        PML_PutPageInXMS(orig, gvar);\r
@@ -1116,7 +1116,7 @@ PML_TransferPageSpace(int orig,int new, global_game_variables_t *gvar)
        origpage->mainPage = origpage->emsPage = -1;\r
 \r
        if (!addr)\r
-               Quit("PML_TransferPageSpace: Zero replacement");\r
+               Quit (gvar, "PML_TransferPageSpace: Zero replacement");\r
 \r
        return(addr);\r
 }\r
@@ -1157,10 +1157,10 @@ PML_GetAPageBuffer(int pagenum,boolean mainonly, global_game_variables_t *gvar)
                        }\r
                }\r
                if (n == -1)\r
-                       Quit("PML_GetPageBuffer: MainPagesAvail lied");\r
+                       Quit (gvar, "PML_GetPageBuffer: MainPagesAvail lied");\r
                addr = gvar->pm.mm.MainMemPages[n];\r
                if (!addr)\r
-                       Quit("PML_GetPageBuffer: Purged main block");\r
+                       Quit (gvar, "PML_GetPageBuffer: Purged main block");\r
                page->mainPage = n;\r
                gvar->pm.MainPagesUsed++;\r
        }\r
@@ -1168,7 +1168,7 @@ PML_GetAPageBuffer(int pagenum,boolean mainonly, global_game_variables_t *gvar)
                addr = PML_TransferPageSpace(PML_GiveLRUPage(mainonly, gvar),pagenum, gvar);\r
 \r
        if (!addr)\r
-               Quit("PML_GetPageBuffer: Search failed");\r
+               Quit (gvar, "PML_GetPageBuffer: Search failed");\r
        return(addr);\r
 }\r
 \r
@@ -1194,7 +1194,7 @@ PML_GetPageFromXMS(int pagenum,boolean mainonly, global_game_variables_t *gvar)
                gvar->pm.xmm.XMSProtectPage = pagenum;\r
                checkaddr = PML_GetAPageBuffer(pagenum,mainonly, gvar);\r
                if (FP_OFF(checkaddr))\r
-                       Quit("PML_GetPageFromXMS: Non segment pointer");\r
+                       Quit (gvar, "PML_GetPageFromXMS: Non segment pointer");\r
                addr = (memptr)FP_SEG(checkaddr);\r
                PML_CopyFromXMS(addr,page->xmsPage,page->length, gvar);\r
                gvar->pm.xmm.XMSProtectPage = -1;\r
@@ -1232,7 +1232,7 @@ PM_GetPage(int pagenum, global_game_variables_t *gvar)
        memptr  result;\r
 \r
        if (pagenum >= gvar->pm.fi.ChunksInFile)\r
-               Quit("PM_GetPage: Invalid page request");\r
+               Quit (gvar, "PM_GetPage: Invalid page request");\r
 \r
 #ifdef __DEBUG_2__     // for debugging\r
        __asm {\r
@@ -1250,7 +1250,7 @@ PM_GetPage(int pagenum, global_game_variables_t *gvar)
        {\r
                boolean mainonly = (pagenum >= gvar->pm.fi.PMSoundStart);\r
 if (!gvar->pm.PMPages[pagenum].offset) // JDC: sparse page\r
-       Quit ("Tried to load a sparse page!");\r
+       Quit (gvar, "Tried to load a sparse page!");\r
                if (!(result = PML_GetPageFromXMS(pagenum,mainonly, gvar)))\r
                {\r
                        if (gvar->pm.PMPages[pagenum].lastHit ==  gvar->pm.PMFrameCount)\r
@@ -1290,7 +1290,7 @@ void
 PM_SetPageLock(int pagenum,PMLockType lock, global_game_variables_t *gvar)\r
 {\r
        if (pagenum < gvar->pm.fi.PMSoundStart)\r
-               Quit("PM_SetPageLock: Locking/unlocking non-sound page");\r
+               Quit (gvar, "PM_SetPageLock: Locking/unlocking non-sound page");\r
 \r
        gvar->pm.PMPages[pagenum].locked = lock;\r
 }\r
@@ -1357,7 +1357,7 @@ PM_Preload(boolean (*update)(word current,word total), global_game_variables_t *
                        page++;\r
 \r
                if (page >= gvar->pm.fi.ChunksInFile)\r
-                       Quit ("PM_Preload: Pages>=gvar->pm.fi.ChunksInFile");\r
+                       Quit (gvar, "PM_Preload: Pages>=gvar->pm.fi.ChunksInFile");\r
 \r
                PM_GetPage(page, gvar);\r
 \r
@@ -1376,7 +1376,7 @@ PM_Preload(boolean (*update)(word current,word total), global_game_variables_t *
                ;\r
                addr = PM_GetPage(oogypage, gvar);\r
                if (!addr)\r
-                       Quit("PM_Preload: XMS buffer failed");\r
+                       Quit (gvar, "PM_Preload: XMS buffer failed");\r
 \r
                while (xmstotal)\r
                {\r
@@ -1384,15 +1384,15 @@ PM_Preload(boolean (*update)(word current,word total), global_game_variables_t *
                                page++;\r
 \r
                        if (page >= gvar->pm.fi.ChunksInFile)\r
-                               Quit ("PM_Preload: Pages>=gvar->pm.fi.ChunksInFile");\r
+                               Quit (gvar, "PM_Preload: Pages>=gvar->pm.fi.ChunksInFile");\r
 \r
                        p = &gvar->pm.PMPages[page];\r
 \r
                        p->xmsPage = gvar->pm.XMSPagesUsed++;\r
                        if (gvar->pm.XMSPagesUsed > gvar->pm.xmm.XMSPagesAvail)\r
-                               Quit("PM_Preload: Exceeded XMS pages");\r
+                               Quit (gvar, "PM_Preload: Exceeded XMS pages");\r
                        if (p->length > PMPageSize)\r
-                               Quit("PM_Preload: Page too long");\r
+                               Quit (gvar, "PM_Preload: Page too long");\r
 \r
                        PML_ReadFromFile((byte far *)addr,p->offset,p->length, gvar);\r
                        PML_CopyToXMS((byte far *)addr,p->xmsPage,p->length, gvar);\r
@@ -1445,7 +1445,7 @@ PM_NextFrame(global_game_variables_t *gvar)
                {\r
                        char buf[40];\r
                        sprintf(buf,"PM_NextFrame: Page %d is locked",i);\r
-                       Quit(buf);\r
+                       Quit(gvar, buf);\r
                }\r
        }\r
 //#endif\r
@@ -1536,7 +1536,7 @@ PM_Startup(global_game_variables_t *gvar)
 \r
        if (!gvar->pm.mm.MainPresent && !gvar->pm.emm.EMSPresent && !gvar->pm.xmm.XMSPresent)\r
        {\r
-               Quit("PM_Startup: No main or EMS\n");\r
+               Quit (gvar, "PM_Startup: No main or EMS\n");\r
                //return;\r
        }\r
 \r
index 94af24e6ebf978595cd99fb8f5bb5530589378d8..38c72637ef7f3a195c4f2d4e2e6fa6daddce89e7 100755 (executable)
@@ -94,6 +94,7 @@ typedef struct
 //printf("mv[%u].tx: %d", pan.pn, mv[pan.pn].tx); printf("     mv[%u].ty: %d   ", pan.pn, mv[pan.pn].ty);\r
 //printf("gvar.kurokku:        "); printf("%.0f ", clock());   printf("tiku=%lu ", gvar.kurokku.tiku); printf("t=%.0f ", gvar.kurokku.t);      printf("ticktock()=%f ", ticktock(&gvar));      printf("%.0f fps", (double)gvar.kurokku.tiku/ticktock(&gvar));\r
 //printf("map.width=%d map.height=%d   map.data[0]=%d\n", mv[0].map->width, mv[0].map->height, mv[0].map->data[0]);\r
+//printf("&global_temp_status_text = %Fp\n", &global_temp_status_text);\r
 #define SCROLLEXITMESG         printf("tx: %d  ", mv[0].tx);\\r
        printf("ty: %d\n", mv[0].ty);\\r
        printf("\n");\\r
@@ -115,9 +116,6 @@ typedef struct
 \\r
        printf("gvar.video.p=%u ", gvar.video.p); printf("gvar.video.r=%u ", gvar.video.r);\\r
        printf("pageflipflop=%u\n", pageflipflop);\\r
-\\r
-       printf("&global_temp_status_text = %Fp\n", &global_temp_status_text);\\r
-\\r
        printf("\n");\r
 \r
 extern boolean pageflipflop, pageploop;\r
index b0fdb481224a45b257143f5b067ba414df1c6e68..35eb2f4b8036923fb719dfc552d51490afcdc2b1 100755 (executable)
@@ -67,6 +67,20 @@ typedef void _seg * memptr;//typedef void __based( void ) * memptr;  ////old //--
 #ifdef __WATCOMC__\r
 #define _argv __argv\r
 #define _argc __argc\r
+\r
+//from http://www.verycomputer.com/3_65d875cc818b54ec_1.htm\r
+void clrscr(void);\r
+#pragma aux clrscr= \\r
+  " mov ah, 0fh " \\r
+  " int 10h " \\r
+  " xor ah, ah " \\r
+  " int 10h " ;\r
+//from http://stackoverflow.com/questions/18425748/gotoxy-function-using-printf-s-position\r
+inline void gotoxy(int x,int y)\r
+{\r
+       printf("\x1B[%d;%df", y, x);\r
+       fflush(stdout);  // @jxh\r
+}\r
 #endif\r
 \r
 #endif/*_TYPE_H_*/\r
index bd5b6f1ee4bb7589a2bab76b1f75f4c5f08e52be..6cd9eb928368bb6256f64cd78fee23f0ead8c186 100755 (executable)
@@ -71,20 +71,13 @@ void Startup16(global_game_variables_t *gvar)
 #endif\r
        gvar->mm.mmstarted=0;\r
        gvar->pm.PMStarted=0;\r
-#ifdef __DEBUG__\r
-       if(!dbg_nommpmca)\r
-#endif\r
        MM_Startup(gvar);\r
+#ifdef __WATCOMC__\r
        IN_Startup(gvar);\r
-#ifdef __DEBUG__\r
-       if(!dbg_nommpmca){\r
 #endif\r
        PM_Startup(gvar);\r
        PM_UnlockMainMem(gvar);\r
        CA_Startup(gvar);\r
-#ifdef __DEBUG__\r
-       }\r
-#endif\r
 }\r
 \r
 //===========================================================================\r
@@ -101,22 +94,160 @@ void Startup16(global_game_variables_t *gvar)
 \r
 void Shutdown16(global_game_variables_t *gvar)\r
 {\r
-#ifdef __DEBUG__\r
-       if(!dbg_nommpmca)\r
-#endif\r
        PM_Shutdown(gvar);\r
+#ifdef __WATCOMC__\r
        IN_Shutdown(gvar);\r
-#ifdef __DEBUG__\r
-       if(!dbg_nommpmca){\r
 #endif\r
        CA_Shutdown(gvar);\r
        MM_Shutdown(gvar);\r
-#ifdef __DEBUG__\r
-       }\r
-#endif\r
 }\r
 \r
 \r
+//===========================================================================\r
+\r
+/*\r
+====================\r
+=\r
+= ReadConfig\r
+=\r
+====================\r
+*/\r
+\r
+/*void ReadConfig(void)\r
+{\r
+       int                     file;\r
+       SDMode          sd;\r
+       SMMode          sm;\r
+       SDSMode         sds;\r
+\r
+\r
+       if ( (file = open(configname,O_BINARY | O_RDONLY)) != -1)\r
+       {\r
+       //\r
+       // valid config file\r
+       //\r
+               read(file,Scores,sizeof(HighScore) * MaxScores);\r
+\r
+               read(file,&sd,sizeof(sd));\r
+               read(file,&sm,sizeof(sm));\r
+               read(file,&sds,sizeof(sds));\r
+\r
+               read(file,&mouseenabled,sizeof(mouseenabled));\r
+               read(file,&joystickenabled,sizeof(joystickenabled));\r
+               read(file,&joypadenabled,sizeof(joypadenabled));\r
+               read(file,&joystickprogressive,sizeof(joystickprogressive));\r
+               read(file,&joystickport,sizeof(joystickport));\r
+\r
+               read(file,&dirscan,sizeof(dirscan));\r
+               read(file,&buttonscan,sizeof(buttonscan));\r
+               read(file,&buttonmouse,sizeof(buttonmouse));\r
+               read(file,&buttonjoy,sizeof(buttonjoy));\r
+\r
+               read(file,&viewsize,sizeof(viewsize));\r
+               read(file,&mouseadjustment,sizeof(mouseadjustment));\r
+\r
+               close(file);\r
+\r
+               if (sd == sdm_AdLib && !AdLibPresent && !SoundBlasterPresent)\r
+               {\r
+                       sd = sdm_PC;\r
+                       sd = smm_Off;\r
+               }\r
+\r
+               if ((sds == sds_SoundBlaster && !SoundBlasterPresent) ||\r
+                       (sds == sds_SoundSource && !SoundSourcePresent))\r
+                       sds = sds_Off;\r
+\r
+               if (!MousePresent)\r
+                       mouseenabled = false;\r
+               if (!JoysPresent[joystickport])\r
+                       joystickenabled = false;\r
+\r
+               MainMenu[6].active=1;\r
+               MainItems.curpos=0;\r
+       }\r
+       else\r
+       {\r
+       //\r
+       // no config file, so select by hardware\r
+       //\r
+               if (SoundBlasterPresent || AdLibPresent)\r
+               {\r
+                       sd = sdm_AdLib;\r
+                       sm = smm_AdLib;\r
+               }\r
+               else\r
+               {\r
+                       sd = sdm_PC;\r
+                       sm = smm_Off;\r
+               }\r
+\r
+               if (SoundBlasterPresent)\r
+                       sds = sds_SoundBlaster;\r
+               else if (SoundSourcePresent)\r
+                       sds = sds_SoundSource;\r
+               else\r
+                       sds = sds_Off;\r
+\r
+               if (MousePresent)\r
+                       mouseenabled = true;\r
+\r
+               joystickenabled = false;\r
+               joypadenabled = false;\r
+               joystickport = 0;\r
+               joystickprogressive = false;\r
+\r
+               viewsize = 15;\r
+               mouseadjustment=5;\r
+       }\r
+\r
+       SD_SetMusicMode (sm);\r
+       SD_SetSoundMode (sd);\r
+       SD_SetDigiDevice (sds);\r
+}*/\r
+\r
+\r
+/*\r
+====================\r
+=\r
+= WriteConfig\r
+=\r
+====================\r
+*/\r
+\r
+/*void WriteConfig(void)\r
+{\r
+       int                     file;\r
+\r
+       file = open(configname,O_CREAT | O_BINARY | O_WRONLY,\r
+                               S_IREAD | S_IWRITE | S_IFREG);\r
+\r
+       if (file != -1)\r
+       {\r
+               write(file,Scores,sizeof(HighScore) * MaxScores);\r
+\r
+               write(file,&SoundMode,sizeof(SoundMode));\r
+               write(file,&MusicMode,sizeof(MusicMode));\r
+               write(file,&DigiMode,sizeof(DigiMode));\r
+\r
+               write(file,&mouseenabled,sizeof(mouseenabled));\r
+               write(file,&joystickenabled,sizeof(joystickenabled));\r
+               write(file,&joypadenabled,sizeof(joypadenabled));\r
+               write(file,&joystickprogressive,sizeof(joystickprogressive));\r
+               write(file,&joystickport,sizeof(joystickport));\r
+\r
+               write(file,&dirscan,sizeof(dirscan));\r
+               write(file,&buttonscan,sizeof(buttonscan));\r
+               write(file,&buttonmouse,sizeof(buttonmouse));\r
+               write(file,&buttonjoy,sizeof(buttonjoy));\r
+\r
+               write(file,&viewsize,sizeof(viewsize));\r
+               write(file,&mouseadjustment,sizeof(mouseadjustment));\r
+\r
+               close(file);\r
+       }\r
+}*/\r
+\r
 //===========================================================================\r
 \r
 /*\r
@@ -159,7 +290,22 @@ void DebugMemory_(global_game_variables_t *gvar, boolean q)
 #endif\r
        if(q) MM_ShowMemory (gvar);\r
 }\r
-#ifdef __WATCOMC__\r
+\r
+/*\r
+==========================\r
+=\r
+= ClearMemory\r
+=\r
+==========================\r
+*/\r
+\r
+void ClearMemory (global_game_variables_t *gvar)\r
+{\r
+       PM_UnlockMainMem(gvar);\r
+       //snd\r
+       MM_SortMem (gvar);\r
+}\r
+\r
 /*\r
 ==========================\r
 =\r
@@ -168,46 +314,43 @@ void DebugMemory_(global_game_variables_t *gvar, boolean q)
 ==========================\r
 */\r
 \r
-void Quit (char *error)\r
+void Quit (global_game_variables_t *gvar, char *error)\r
 {\r
        //unsigned        finscreen;\r
        memptr  screen=0;\r
-       union REGS in, out;\r
 \r
-       //ClearMemory ();\r
+       ClearMemory (gvar);\r
        if (!*error)\r
        {\r
-        //WriteConfig ();\r
+// #ifndef JAPAN\r
+//             CA_CacheGrChunk (ORDERSCREEN);\r
+//             screen = grsegs[ORDERSCREEN];\r
+// #endif\r
+//             WriteConfig ();\r
        }\r
        else\r
        {\r
-        //CA_CacheGrChunk (ERRORSCREEN);\r
-        //screen = grsegs[ERRORSCREEN];\r
+//             CA_CacheGrChunk (ERRORSCREEN);\r
+//             screen = grsegs[ERRORSCREEN];\r
        }\r
-\r
-       //ShutdownId ();\r
-       IN_Shutdown();\r
-       //modexLeave();\r
-       in.h.ah = 0x00;\r
-       in.h.al = 0x3;\r
-       int86(0x10, &in, &out);\r
+       Shutdown16(gvar);\r
 \r
        if (error && *error)\r
        {\r
-         //movedata ((unsigned)screen,7,0xb800,0,7*160);\r
-         //gotoxy (10,4);\r
-         fprintf(stderr, "%s\n", error);\r
-         //gotoxy (1,8);\r
-         exit(1);\r
+               movedata((unsigned)screen,7,0xb800,0,7*160);\r
+               gotoxy (10,4);\r
+               fprintf(stderr, "%s\n", error);\r
+               gotoxy (1,8);\r
+               exit(1);\r
        }\r
        else\r
        if (!error || !(*error))\r
        {\r
-               //clrscr();\r
-               //#ifndef JAPAN\r
+               clrscr();\r
+#ifndef JAPAN\r
                movedata ((unsigned)screen,7,0xb800,0,4000);\r
-               //gotoxy(1,24);\r
-               //#endif\r
+               gotoxy(1,24);\r
+#endif\r
 //asm  mov     bh,0\r
 //asm  mov     dh,23   // row\r
 //asm  mov     dl,0    // collumn\r
@@ -217,7 +360,6 @@ void Quit (char *error)
 \r
        exit(0);\r
 }\r
-#endif\r
 \r
 //===========================================================================\r
 \r
index 8d1274d89378d68c7624bfe50375be61187d5cb6..8cd3009405a887c8eb071e784c1a0c90d10544ff 100755 (executable)
 void DebugMemory_(global_game_variables_t *gvar, boolean q);\r
 void Shutdown16(global_game_variables_t *gvar);\r
 void Startup16(global_game_variables_t *gvar);\r
-#ifdef __WATCOMC__\r
-void Quit (char *error);\r
-#endif\r
+void ClearMemory (global_game_variables_t *gvar);\r
+void Quit (global_game_variables_t *gvar, char *error);\r
 void nibbletest();\r
 void booleantest();\r
 \r
-#endif\r
+#endif /*__16_TAIL__ */\r
index 03859245552740a2d3bcc6fd5942b4da8f3ad0e5..5beb4743d33660ce11b0aec8ac039d03ff131010 100755 (executable)
@@ -29,8 +29,6 @@
 //#define FADE\r
 #define MODEX  //this is for mode x initiating\r
 \r
-extern boolean dbg_nommpmca;\r
-\r
 //word far *clock= (word far*) 0x046C; /* 18.2hz clock */\r
 //bitmap_t *p;\r
 global_game_variables_t gvar;\r
@@ -60,8 +58,6 @@ boolean panswitch=0;//1
 \r
 void main(int argc, char *argv[])\r
 {\r
-       dbg_nommpmca=1;\r
-\r
        if(argv[1]) bakapee = atoi(argv[1]);\r
        else bakapee = 1;\r
 \r