]> 4ch.mooo.com Git - 16.git/commitdiff
ok i am working on makin the debug.16 data and tinking abut large amount of data...
authorsparky4 <sparky4@cock.li>
Sat, 8 Aug 2015 23:14:12 +0000 (18:14 -0500)
committersparky4 <sparky4@cock.li>
Sat, 8 Aug 2015 23:14:12 +0000 (18:14 -0500)
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

DEBUG.16 [new file with mode: 0644]
HEAP.16 [new file with mode: 0644]
MMDUMP.16 [new file with mode: 0644]
PROFILE.16 [new file with mode: 0644]
exmmtest.exe
src/lib/16_ca.c
src/lib/16_head.h
src/lib/16_mm.c
src/lib/16_mm.h

diff --git a/DEBUG.16 b/DEBUG.16
new file mode 100644 (file)
index 0000000..f02d76d
--- /dev/null
+++ b/DEBUG.16
@@ -0,0 +1,12 @@
+\e[0mSeg:0      Size:5538       Owner:0xe000\r
+\e[41;31m+\e[0m\e[47;37m_\e[0m\r
+\e[0mSeg:15a2   Size:256        Owner:0x3506\r
+\e[44;34m+\e[0m\e[47;37m_\e[0m\r
+\e[0mSeg:16a2   Size:273        Owner:0x857a\r
+\e[44;34m+\e[0m\e[47;37m_\e[0m\e[42;32m0\e[0m\r
+\e[0mSeg:1cf2   Size:49 Owner:0x159f\r
+\e[41;31m+\e[0m\e[47;37m_\e[0m\e[42;32m0\e[0m\r
+\e[0mSeg:ad23   Size:13021      Owner:0x169f\r
+\e[41;31m+\e[0m\e[47;37m_\e[0m\r
+\e[0mSeg:e000   Size:4294909951 Owner:0xc483\r
+\e[41;31m+\e[0m\e[47;37m_\e[0m\r
diff --git a/HEAP.16 b/HEAP.16
new file mode 100644 (file)
index 0000000..a2a1a67
--- /dev/null
+++ b/HEAP.16
@@ -0,0 +1,45 @@
+\r
+       == default ==\r
+\r
+  USED block at 1d140016 of size 136\r
+  USED block at 1d14009e of size 66\r
+  FREE block at 1d1400e0 of size 18\r
+  USED block at 1d1400f2 of size 20\r
+  FREE block at 1d140106 of size 7926\r
+OK - end of heap\r
+\r
+       == near ==\r
+\r
+  USED block at 0 of size 0\r
+  USED block at 0 of size 0\r
+  USED block at 0 of size 0\r
+  USED block at 0 of size 0\r
+  USED block at 0 of size 0\r
+  USED block at 0 of size 0\r
+  USED block at 0 of size 0\r
+  USED block at 0 of size 0\r
+  USED block at 0 of size 0\r
+OK - end of heap\r
+\r
+       == far ==\r
+\r
+  USED block at 0 of size 0\r
+  USED block at 0 of size 0\r
+  USED block at 0 of size 0\r
+  USED block at 0 of size 0\r
+  USED block at 0 of size 0\r
+OK - end of heap\r
+\r
+Memory Type         Total      Used       Free\r
+----------------  --------   --------   --------\r
+Default                   8166 222     7944\r
+Near              31318        834     30484\r
+Far               8166 222     7944\r
+----------------  --------   --------   --------\r
+coreleft = 30482\r
+farcoreleft = 38230\r
+GetFreeSize = 7768\r
+GetNearFreeSize = 30484\r
+GetFarFreeSize = 7768\r
+memavl = 30482\r
+stackavail = 11023\r
diff --git a/MMDUMP.16 b/MMDUMP.16
new file mode 100644 (file)
index 0000000..66f20d2
Binary files /dev/null and b/MMDUMP.16 differ
diff --git a/PROFILE.16 b/PROFILE.16
new file mode 100644 (file)
index 0000000..e69de29
index 6f9a4af50e8b04c9ca6b44f41b54ab702c203a7a..579751913741cc754bc8e90df4e67901dfa54805 100644 (file)
Binary files a/exmmtest.exe and b/exmmtest.exe differ
index f134df8b5bada37ec067d8c893849b7f847c3c22..169c4a8539691ecbc600f7d6d604417d09c6889f 100644 (file)
@@ -1083,8 +1083,8 @@ void CA_Startup(global_game_variables_t *gvar)
        unlink("profile.16");\r
        gvar->handle.profilehandle = open("profile.16", O_CREAT | O_WRONLY | O_TEXT);\r
 #endif\r
-       unlink("debug0.16");\r
-       gvar->handle.showmemhandle = open("debug0.16", O_CREAT | O_WRONLY | O_TEXT);\r
+//     unlink("debug0.16");\r
+//     gvar->handle.showmemhandle = open("debug0.16", O_CREAT | O_WRONLY | O_TEXT);\r
 /*++++\r
 // MDM begin - (GAMERS EDGE)\r
 //\r
@@ -1146,7 +1146,7 @@ void CA_Shutdown(global_game_variables_t *gvar)
 #ifdef PROFILE\r
        close(gvar->handle.profilehandle);\r
 #endif\r
-       close(gvar->handle.showmemhandle);\r
+//     close(gvar->handle.showmemhandle);\r
 /*++++\r
        close(maphandle);\r
        close(grhandle);\r
index 8baff16a12b6609d806963747dc3440bf6a435ae..15c4a54dd550e4ecdc980ca8d66da8fab72c6b7a 100644 (file)
@@ -179,7 +179,7 @@ typedef void _seg * memptr;
 \r
 typedef struct\r
 {\r
-       int showmemhandle;\r
+//     int showmemhandle;\r
        int                     profilehandle,debughandle;\r
        int heaphandle;\r
 } handle_t;\r
index a9bcd0c1d5f12115943508a884d3e481878b5345..cc5a894cc3dbfeb8cab2e69ea8b60389e36c2a7a 100644 (file)
@@ -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);
index 1ecca330b45812c2304f129ec5326b4ebb256ed5..e67d2fcff1c2addfdadb33f3bf9af280d1242180 100644 (file)
 
 #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