/* Project 16 Source Code~\r
- * Copyright (C) 2012-2017 sparky4 & pngwen & andrius4669 & joncampbell123 & yakui-lover\r
+ * Copyright (C) 2012-2021 sparky4 & pngwen & andrius4669 & joncampbell123 & yakui-lover\r
*\r
* This file is part of Project 16.\r
*\r
\r
\r
SD_StopSound();*/\r
-#ifdef __WATCOMC__\r
+\r
oldborder = gvar->video.bordercolor;\r
gvar->video.bordercolor = VL_modexPalOverscan(gvar->video.palette, 4);\r
-#endif\r
\r
if (beforesort)\r
beforesort();\r
extern char global_temp_status_text[512];\r
extern char global_temp_status_text2[512];\r
#endif\r
-#ifdef __WATCOMC__\r
+//#ifdef __WATCOMC__\r
//#define MMSMPANVID\r
#define MMSMSCANINFO\r
-#endif\r
+//#endif\r
\r
/*\r
=====================\r
=====================\r
*/\r
\r
-\r
void MM_ShowMemory (global_game_variables_t *gvar)\r
{\r
mmblocktype far *scan;\r
- unsigned color,temp,x,y ,w,width;\r
+ unsigned color,temp,x,y ,q,w/*,width*/,sw;\r
sdword end,owner;\r
byte scratch[160],scratch0[4096],str[16];\r
#ifdef MMSMSCANINFO\r
mmshowmemoryinfo_t scaninfo[MAXBLOCKS];\r
byte scratch1[4];\r
- unsigned xpos,ypos, oldq,q,maxq;\r
+ unsigned /*xpos,ypos, */oldq,maxq;\r
boolean done,restarted,mmsmscaninfoxyposinew;\r
ScanCode scancode;\r
#endif\r
#ifdef MMSMSCANINFO\r
oldq = 0; restarted = false; mmsmscaninfoxyposinew = false;\r
reset:\r
- q = 0;\r
#endif\r
scan = gvar->mm.mmhead;\r
\r
- end = -1; w = 0;\r
+ end = -1; w = 0; q = 0;\r
\r
- width = gvar->video.page[0].sw;\r
+ //width = gvar->video.page[0].width;\r
+ sw = gvar->video.page[0].sw;\r
\r
CA_OpenDebug (gvar);\r
while (scan)\r
Quit (gvar, "MM_ShowMemory: Memory block order currupted!");\r
}\r
end = scan->length-1;\r
- y = scan->start/width;\r
- x = scan->start%width;\r
+ y = gvar->video.page[0].dx+(scan->start/sw);\r
+ x = gvar->video.page[0].dy+(scan->start%sw);\r
#if 0\r
//def MMSMSCANINFO\r
if(restarted){\r
#endif\r
strcat(scratch0, AARESET);\r
//strcat(scratch0,"\n");\r
- strcat(scratch,"Seg:");\r
+ strcat(scratch,"Block:");\r
+ ultoa (q,str,10);\r
+ strcat (scratch,str);\r
+ strcat(scratch,"\tSeg:");\r
ultoa (scan->start,str,16);\r
strcat (scratch,str);\r
// strcat(scratch, AABLACK); strcat(scratch,"\t"); strcat(scratch, AARESET);\r
//0000fprintf(stdout, "[%u]\n", q);\r
\r
scan = scan->next;\r
-#ifdef MMSMSCANINFO\r
q++;\r
-#endif\r
-//0000if(q==1 && gvar->video.VL_Started && color!=6) IN_Ack(gvar);\r
+\r
+//0000if(gvar->video.VL_Started && color!=6) IN_Ack(gvar);\r
}\r
\r
CA_CloseDebug (gvar);\r
odx = gvar->video.page[0].dx;\r
ody = gvar->video.page[0].dy;\r
dx = dy = 0;\r
+\r
+ while (!(scancode = gvar->in.inst->LastScan)){}\r
while(!gvar->in.inst->Keyboard[sc_Escape] && !gvar->in.inst->Keyboard[sc_Space])\r
{\r
if(gvar->in.inst->Keyboard[sc_UpArrow])\r
}\r
#endif\r
#ifdef MMSMSCANINFO\r
- maxq = q;\r
+ if (gvar->video.VL_Started) IN_Ack(gvar);\r
+ maxq = q-1;\r
if(restarted) q = oldq;\r
else q = 0;\r
restarted = false;\r
\r
- IN_Ack(gvar);\r
-// VL_ClearVideo (8);\r
+ while (!(scancode = gvar->in.inst->LastScan)){}\r
+// IN_ClearKey(scancode);\r
+// IN_Ack(gvar);\r
+\r
for (done = false;!done;)\r
{\r
if(scaninfo[q].scan->attributes & PURGEBITS)\r
//printf("%s", AARED);\r
}\r
end = scaninfo[q].scan->length-1;\r
-//modexprint(page, x, y, t, tlsw, color, bgcolor, vidsw, const byte *str);\r
-#define MMSMPRINTMEMINFO modexprint(&(gvar->video.page[0]), xpos, ypos, 1, 1, color, 8, gvar->video.VL_Started, global_temp_status_text); ypos+=8;\r
+\r
+ gvar->video.print.t=1;\r
+ gvar->video.print.tlsw=1;\r
+ gvar->video.print.color=color;\r
+ gvar->video.print.bgcolor=8;\r
+#define MMSMPRINTMEMINFO VL_print(global_temp_status_text, 0, gvar); gvar->video.print.y+=8;\r
+//modexprint(&(gvar->video.page[0]), xpos, ypos, 1, 1, color, 8, gvar->video.VL_Started, global_temp_status_text);\r
#ifdef __WATCOMC__\r
if(gvar->video.VL_Started)\r
{\r
modexClearRegion(&gvar->video.page[0], gvar->video.page[0].dx, gvar->video.page[0].dy, gvar->video.page[0].sw, gvar->video.page[0].sh, 8);\r
}else\r
#endif\r
+ {\r
clrscr();\r
+ }\r
sprintf(global_temp_status_text, "block #%04u", q); MMSMPRINTMEMINFO\r
// sprintf(global_temp_status_text, "%Fp", scaninfo[q].scan->useptr); MMSMPRINTMEMINFO\r
sprintf(global_temp_status_text, "start: %04x", (unsigned)scaninfo[q].scan->start); MMSMPRINTMEMINFO\r
if (scaninfo[q].scan->next && scaninfo[q].scan->next->start > end+1)\r
{\r
sprintf(global_temp_status_text, "free: %05u", (unsigned)(scaninfo[q].scan->next->start-scaninfo[q].scan->start)); MMSMPRINTMEMINFO\r
- }else ypos+=8;\r
+ }else /*ypos*/gvar->video.print.y+=8;\r
if(gvar->video.VL_Started)\r
{\r
- y = scaninfo[q].scan->start/width;\r
- x = scaninfo[q].scan->start%width;\r
+ y = scaninfo[q].scan->start/sw;\r
+ x = scaninfo[q].scan->start%sw;\r
if(!mmsmscaninfoxyposinew)\r
{\r
- y = ypos;\r
- x = xpos;\r
+ y = gvar->video.print.y;//ypos;\r
+ x = gvar->video.print.x;//xpos;\r
}else{\r
//y = scaninfo[q].y;\r
//x = scaninfo[q].x;\r
if(gvar->video.VL_Started)\r
{\r
//if (scan->next && scan->next->start > end+1) free\r
- xpos = gvar->video.page[0].dx;\r
- ypos = gvar->video.page[0].dy;\r
+ /*xpos*/gvar->video.print.x = gvar->video.page[0].dx;\r
+ /*ypos*/gvar->video.print.y = gvar->video.page[0].dy;\r
}\r
else\r
{\r
case sc_Space:\r
oldq = q;\r
restarted = true;\r
- modexClearRegion(&gvar->video.page[0], gvar->video.page[0].dx, gvar->video.page[0].dy, gvar->video.page[0].sw, gvar->video.page[0].sh, 8);\r
+#ifdef __WATCOMC__\r
+ if(gvar->video.VL_Started) modexClearRegion(&gvar->video.page[0], gvar->video.page[0].dx, gvar->video.page[0].dy, gvar->video.page[0].sw, gvar->video.page[0].sh, 8);\r
+#endif\r
goto reset;\r
- break;\r
+\r
case sc_Escape:\r
done = true;\r
break;\r