From: sparky4 Date: Sat, 8 Aug 2015 23:14:12 +0000 (-0500) Subject: ok i am working on makin the debug.16 data and tinking abut large amount of data... X-Git-Url: http://4ch.mooo.com/gitweb/?p=16.git;a=commitdiff_plain;h=e5cb235d748a442c66e6b1c556072b70dfc05c91 ok i am working on makin the debug.16 data and tinking abut large amount of data management! new file: DEBUG.16 new file: HEAP.16 new file: MMDUMP.16 new file: PROFILE.16 modified: exmmtest.exe modified: src/lib/16_ca.c modified: src/lib/16_head.h modified: src/lib/16_mm.c modified: src/lib/16_mm.h --- diff --git a/DEBUG.16 b/DEBUG.16 new file mode 100644 index 00000000..f02d76dc --- /dev/null +++ b/DEBUG.16 @@ -0,0 +1,12 @@ +Seg:0 Size:5538 Owner:0xe000 ++_ +Seg:15a2 Size:256 Owner:0x3506 ++_ +Seg:16a2 Size:273 Owner:0x857a ++_0 +Seg:1cf2 Size:49 Owner:0x159f ++_0 +Seg:ad23 Size:13021 Owner:0x169f ++_ +Seg:e000 Size:4294909951 Owner:0xc483 ++_ diff --git a/HEAP.16 b/HEAP.16 new file mode 100644 index 00000000..a2a1a674 --- /dev/null +++ b/HEAP.16 @@ -0,0 +1,45 @@ + + == default == + + USED block at 1d140016 of size 136 + USED block at 1d14009e of size 66 + FREE block at 1d1400e0 of size 18 + USED block at 1d1400f2 of size 20 + FREE block at 1d140106 of size 7926 +OK - end of heap + + == near == + + USED block at 0 of size 0 + USED block at 0 of size 0 + USED block at 0 of size 0 + USED block at 0 of size 0 + USED block at 0 of size 0 + USED block at 0 of size 0 + USED block at 0 of size 0 + USED block at 0 of size 0 + USED block at 0 of size 0 +OK - end of heap + + == far == + + USED block at 0 of size 0 + USED block at 0 of size 0 + USED block at 0 of size 0 + USED block at 0 of size 0 + USED block at 0 of size 0 +OK - end of heap + +Memory Type Total Used Free +---------------- -------- -------- -------- +Default 8166 222 7944 +Near 31318 834 30484 +Far 8166 222 7944 +---------------- -------- -------- -------- +coreleft = 30482 +farcoreleft = 38230 +GetFreeSize = 7768 +GetNearFreeSize = 30484 +GetFarFreeSize = 7768 +memavl = 30482 +stackavail = 11023 diff --git a/MMDUMP.16 b/MMDUMP.16 new file mode 100644 index 00000000..66f20d27 Binary files /dev/null and b/MMDUMP.16 differ diff --git a/PROFILE.16 b/PROFILE.16 new file mode 100644 index 00000000..e69de29b diff --git a/exmmtest.exe b/exmmtest.exe index 6f9a4af5..57975191 100644 Binary files a/exmmtest.exe and b/exmmtest.exe differ diff --git a/src/lib/16_ca.c b/src/lib/16_ca.c index f134df8b..169c4a85 100644 --- a/src/lib/16_ca.c +++ b/src/lib/16_ca.c @@ -1083,8 +1083,8 @@ void CA_Startup(global_game_variables_t *gvar) unlink("profile.16"); gvar->handle.profilehandle = open("profile.16", O_CREAT | O_WRONLY | O_TEXT); #endif - unlink("debug0.16"); - gvar->handle.showmemhandle = open("debug0.16", O_CREAT | O_WRONLY | O_TEXT); +// unlink("debug0.16"); +// gvar->handle.showmemhandle = open("debug0.16", O_CREAT | O_WRONLY | O_TEXT); /*++++ // MDM begin - (GAMERS EDGE) // @@ -1146,7 +1146,7 @@ void CA_Shutdown(global_game_variables_t *gvar) #ifdef PROFILE close(gvar->handle.profilehandle); #endif - close(gvar->handle.showmemhandle); +// close(gvar->handle.showmemhandle); /*++++ close(maphandle); close(grhandle); diff --git a/src/lib/16_head.h b/src/lib/16_head.h index 8baff16a..15c4a54d 100644 --- a/src/lib/16_head.h +++ b/src/lib/16_head.h @@ -179,7 +179,7 @@ typedef void _seg * memptr; typedef struct { - int showmemhandle; +// int showmemhandle; int profilehandle,debughandle; int heaphandle; } handle_t; diff --git a/src/lib/16_mm.c b/src/lib/16_mm.c index a9bcd0c1..cc5a894c 100644 --- a/src/lib/16_mm.c +++ b/src/lib/16_mm.c @@ -610,7 +610,7 @@ void MML_UseSpace(/*d*/word segstart, dword seglength, mminfo_t *mm) { pop ds }*/ - //printf("MML_UseSpace: Segment spans two blocks!\n"); + printf("MML_UseSpace: Segment spans two blocks!\n"); } // @@ -838,6 +838,7 @@ void MM_Startup(mminfo_t *mm, mminfotype *mmi) // emsskip: mmi->XMSmem = 0; + goto xmsskip; for(i = 1;i < #ifdef __WATCOMC__ __argc @@ -1267,24 +1268,24 @@ void MM_ShowMemory(global_game_variables_t *gvar,/*page_t *page, */mminfo_t *mm) mmblocktype huge *scan; //byte color; word temp; - long end,owner; - word chx,chy; + sdword end,owner; + //word chx,chy; + word w; byte scratch[160],scratch0[4096],str[16]; - byte d = "#"; + byte d = '#'; //**** VW_SetDefaultColors(); //**** VW_SetLineWidth(40); //++++mh temp = bufferofs; //++++mh bufferofs = 0; //**** VW_SetScreen (0,0); - scan = mm->mmhead; end = -1; -CA_OpenDebug (gvar); - chx=0; -//++++ chy=0; + CA_OpenDebug (gvar); + w=0; while(scan) { + strcpy(scratch, AARESET); if(scan->attributes & PURGEBITS) strcpy(scratch0, AAMAGENTA); // dark purple = purgable else @@ -1293,11 +1294,19 @@ CA_OpenDebug (gvar); strcpy(scratch0, AARED); // red = locked if(scan->start<=end) { - write(gvar->handle.debughandle,"\nMM_ShowMemory: Memory block order currupted!\n",strlen("\nMM_ShowMemory: Memory block order currupted!\n")); + printf("\n%d\n\n", end); + strcat(scratch, "MM_ShowMemory: Memory block order currupted!\n"); + strcat(scratch, "End's Size: "); + ultoa (end,str,10); + strcat (scratch,str); + strcat(scratch, "\nscan->start's Size: "); + ultoa (scan->start,str,10); + strcat (scratch,str); + write(gvar->handle.debughandle,scratch,strlen(scratch)); //modexprint(&page, chx, chy, 1, 0, 24, "\nMM_ShowMemory: Memory block order currupted!\n"); break; } - end = scan->start+scan->length-1; + end = scan->start+(word)scan->length-1; //++++ chy = scan->start/320; //++++ chx = scan->start%320; //modexhlin(page, scan->start, (unsigned)end, chy, color); @@ -1306,22 +1315,31 @@ CA_OpenDebug (gvar); //++++ modexClearRegion(page, chx, chy, 4, 4, color); //} //++++ VW_Hlin(scan->start,(unsigned)end,0,color); - for(chx=scan->start;chx>=(word)end;chx++) - { - strcat(scratch0,&d); - } - strcat (scratch0,AAWHITE); strcat(scratch0,&d); +// for(w=0;w>=(word)scan->length/80;w++) +// { +// printf("+ %lu\n", w); + //ultoa (w,str,10); + //strcat (scratch0,str); + strcat(scratch0, "+"); +// } + strcat(scratch0, AARESET); strcat(scratch0, AAGREY); strcat(scratch0,"_"); //++++ VW_Plot(scan->start,0,15); //++++ modexClearRegion(page, chx, chy, 4, 4, 15); //++++ VW_Hlin(end+1,scan->next->start,0,0); // black = free - if(scan->next->start > end+1) - { - strcat(scratch0,AABLACK); - for(chx=end+1;chx>=(word)scan->next->start;chx++) - { - strcat(scratch0,&d); - } - } + if(scan->next->start > end+1) + { + strcat(scratch0, AARESET); + //ultoa (w,str,10); + //strcat (scratch0,str); + strcat(scratch0,AAGREEN); +// for(w=(scan->next->start)/80;w>=(word)((scan->length+1)/80);w++) +// { +// printf("0 %lu\n", w); + strcat(scratch0,"0"); +// } + } + strcat(scratch0, AARESET); + strcat(scratch0,"\n"); //for(chx=scan->next->start;chx+4>=(word)end+1;chx+=4) //{ // chx+=scan->next->start; @@ -1331,31 +1349,21 @@ CA_OpenDebug (gvar); /* y = scan->start/320; x = scan->start%320; VW_Hlin(x,x+end,y,color); - VW_Plot(x,y,15); - if (scan->next && scan->next->start > end+1) - { - //write(gvar->handle.showmemhandle,AABLACK,strlen(AABLACK)); - //for(chx=scan->start;chx>=(word)end;chx++) - //{ - //write(gvar->handle.showmemhandle,"_",1); - //} - //write(gvar->handle.showmemhandle,"\n",strlen("\n")); - strcat(scratch0,AABLACK); strcat(scratch0,0x10); - }*/ + VW_Plot(x,y,15);*/ //++++ VW_Hlin(x+end+1,x+(scan->next->start-scan->start),y,0); // black = free -write(gvar->handle.showmemhandle,scratch0,strlen(scratch0)); -strcpy(scratch,"Seg:"); -ultoa (scan->start,str,16); -strcat (scratch,str); -strcat (scratch,"\tSize:"); -ultoa ((dword)scan->length,str,10); -strcat (scratch,str); -strcat (scratch,"\tOwner:0x"); -owner = (unsigned)scan->useptr; -ultoa (owner,str,16); -strcat (scratch,str); -strcat (scratch,"\n"); -write(gvar->handle.debughandle,scratch,strlen(scratch)); + strcat(scratch,"Seg:"); + ultoa (scan->start,str,16); + strcat (scratch,str); + strcat (scratch,"\tSize:"); + ultoa ((dword)scan->length,str,10); + strcat (scratch,str); + strcat (scratch,"\tOwner:0x"); + owner = (unsigned)scan->useptr; + ultoa (owner,str,16); + strcat (scratch,str); + strcat (scratch,"\n"); + write(gvar->handle.debughandle,scratch,strlen(scratch)); + write(gvar->handle.debughandle,scratch0,strlen(scratch0)); //modexprint(page, chx, chy, 1, 0, 24, &scratch); //++++chy+=4; //fprintf(stdout, "%s", scratch); @@ -1363,7 +1371,7 @@ write(gvar->handle.debughandle,scratch,strlen(scratch)); scan = scan->next; } -CA_CloseDebug (gvar); + CA_CloseDebug (gvar); //++++mh IN_Ack(); //**** VW_SetLineWidth(64); diff --git a/src/lib/16_mm.h b/src/lib/16_mm.h index 1ecca330..e67d2fcf 100644 --- a/src/lib/16_mm.h +++ b/src/lib/16_mm.h @@ -40,11 +40,14 @@ #define FREEBLOCK(x) {*x->useptr=NULL;x->next=mm->mmfree;mm->mmfree=x;mm->endid--;} -#define AAMAGENTA "\x1b[35;35m" -#define AABLUE "\x1b[34;34m" -#define AARED "\x1b[31;31m" -#define AABLACK "\x1b[40;40m" -#define AAWHITE "\x1b[37;37m" +#define AARED "\x1b[41;31m" +#define AABLUE "\x1b[44;34m" +#define AAGREEN "\x1b[42;32m" +#define AAYELLOW "\x1b[43;33m" +#define AAGREY "\x1b[47;37m" +#define AABLACK "\x1b[40;30m" +#define AAWHITE "\x1b[47;37m" +#define AAMAGENTA "\x1b[45;35m" #define AARESET "\x1b[0m" #define SAVENEARHEAP 0x200 // space to leave in data segment