--- /dev/null
+\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
\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
\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
//\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
// #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
#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
#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
// 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
break;\r
\r
default:\r
- Quit ("CAL_CacheSprite: Bad shifts number!");\r
+ Quit (gvar, "CAL_CacheSprite: Bad shifts number!");\r
}\r
\r
#endif\r
// 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
// 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
#ifdef __DEBUG_InputMgr__\r
boolean dbg_testkeyin=0,dbg_testcontrolnoisy=0;\r
#endif\r
-boolean dbg_nommpmca=0;\r
#endif\r
\r
\r
#ifdef __DEBUG_InputMgr__\r
extern boolean dbg_testkeyin,dbg_testcontrolnoisy;\r
#endif\r
-extern boolean dbg_nommpmca;\r
#endif\r
\r
# ifdef DEBUGSERIAL\r
}\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
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
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
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
RELIES ON
---------
-Quit (char *error) function
+Quit (global_game_variables_t *gvar, char *error) function
WORK TO DO
}
#endif
if(errorflag==true)
- Quit("MML_ShutdownEMS: Error freeing EMS!\n"); //++++ add something
+ Quit (gvar, "MML_ShutdownEMS: Error freeing EMS!\n"); //++++ add something
}
/*
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;
}
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;
}
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
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
\r
if (!addr)\r
{\r
- Quit("PML_XMSCopy: zero address\n");\r
+ Quit (gvar, "PML_XMSCopy: zero address\n");\r
//return;\r
}\r
\r
}\r
if (!_AX)\r
{\r
- Quit("PML_XMSCopy: Error on copy");\r
+ Quit (gvar, "PML_XMSCopy: Error on copy");\r
//return;\r
}\r
}\r
#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
\r
else\r
{\r
- Quit("MainPresent IS NULL\n");\r
+ Quit (gvar, "MainPresent IS NULL\n");\r
}\r
}\r
\r
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
{\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
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
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
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
}\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
}\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
{\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
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
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
}\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
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
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
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
{\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
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
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
;\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
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
{\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
\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
//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
\\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
#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
#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
\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
#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
==========================\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
\r
exit(0);\r
}\r
-#endif\r
\r
//===========================================================================\r
\r
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
//#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
\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