end = -1;
-//CA_OpenDebug ();
+CA_OpenDebug ();
chx=0;
chy=0;
color = 12; // red = locked
if(scan->start<=end)
{
- //printf("\nMM_ShowMemory: Memory block order currupted!\n");
- modexprint(&page, chx, chy, 1, 0, 24, "\nMM_ShowMemory: Memory block order currupted!\n");
+ //printf(");
+ write (debughandle,"\nMM_ShowMemory: Memory block order currupted!\n",strlen("\nMM_ShowMemory: Memory block order currupted!\n"));
+ //modexprint(&page, chx, chy, 1, 0, 24, "\nMM_ShowMemory: Memory block order currupted!\n");
return;
}
end = scan->start+scan->length-1;
-//++++ modexhlin(page, scan->start, (unsigned)end, chy, color);
+ modexhlin(page, scan->start, (unsigned)end, chy, color);
//++++ VW_Hlin(scan->start,(unsigned)end,0,color);
//void VW_Plot(unsigned x, unsigned y, unsigned color);
//void VW_Hlin(unsigned xl, unsigned xh, unsigned y, unsigned color);
//++++ VW_Plot(scan->start,0,15);
-//++++ modexputPixel(page, scan->start, chy, 15);
+ modexputPixel(page, scan->start, chy, 15);
if(scan->next->start > end+1)
//++++ VW_Hlin(end+1,scan->next->start,0,0); // black = free
+ modexhlin(page, end+1,scan->next->start, chy, color);
//****#if 0
printf("\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0"); //bug!
ultoa (owner,str,16);
strcat (scratch,str);
strcat (scratch,"\n");
-//++++write (debughandle,scratch,strlen(scratch));
-modexprint(page, chx, chy, 1, 0, 24, &scratch);
-chy+=8;
-//fprintf(stdout, "%s", scratch);
+write (debughandle,scratch,strlen(scratch));
+//modexprint(page, chx, chy, 1, 0, 24, &scratch);
+//chy+=4;
+//fprintf(debughandle, "%s", scratch);
//****#endif
scan = scan->next;
}
-//CA_CloseDebug ();
+CA_CloseDebug ();
//++++mh IN_Ack();
//**** VW_SetLineWidth(64);
}
//****#endif
+//==========================================================================\r
+\r
+/*\r
+=====================\r
+=\r
+= MM_DumpData\r
+=\r
+=====================\r
+*/\r
+\r
+void MM_DumpData(mminfo_t *mm)\r
+{\r
+ mmblocktype far *scan,far *best;\r
+ long lowest,oldlowest;\r
+ unsigned owner;\r
+ char lock,purge;\r
+ FILE *dumpfile;\r
+\r
+\r
+ free (mm->nearheap);\r
+ dumpfile = fopen ("mmdump.txt","w");\r
+ if (!dumpfile){\r
+ printf("MM_DumpData: Couldn't open MMDUMP.TXT!");
+ return;
+ }\r
+\r
+ lowest = -1;\r
+ do\r
+ {\r
+ oldlowest = lowest;\r
+ lowest = 0xffff;\r
+\r
+ scan = mm->mmhead;\r
+ while (scan)\r
+ {\r
+ owner = (unsigned)scan->useptr;\r
+\r
+ if (owner && owner<lowest && owner > oldlowest)\r
+ {\r
+ best = scan;\r
+ lowest = owner;\r
+ }\r
+\r
+ scan = scan->next;\r
+ }\r
+\r
+ if (lowest != 0xffff)\r
+ {\r
+ if (best->attributes & PURGEBITS)\r
+ purge = 'P';\r
+ else\r
+ purge = '-';\r
+ if (best->attributes & LOCKBIT)\r
+ lock = 'L';\r
+ else\r
+ lock = '-';\r
+ fprintf (dumpfile,"0x%p (%c%c) = %u\n"\r
+ ,(unsigned)lowest,lock,purge,best->length);\r
+ }\r
+\r
+ } while (lowest != 0xffff);\r
+\r
+ fclose (dumpfile);\r
+ printf("MMDUMP.TXT created.");\r
+}
+
//==========================================================================