OSDN Git Service

p16 is being worked on a bunch by me wwww [16_ca needs huge amounts of work and I...
authorsparky4 <sparky4@cock.li>
Wed, 19 Apr 2017 21:51:08 +0000 (16:51 -0500)
committersparky4 <sparky4@cock.li>
Wed, 19 Apr 2017 21:51:08 +0000 (16:51 -0500)
src/exmmtest.c
src/lib/16_mm.c

index ad274c7..8742c04 100755 (executable)
@@ -49,7 +49,7 @@
 #define NOVID\r
 #endif\r
 #ifdef __WATCOMC__\r
-//#define NOVID\r
+#define NOVID\r
 #endif\r
 \r
 \r
@@ -69,7 +69,8 @@
 #endif\r
 \r
 ////////////////////////////////////////////////////////////////////////////\r
-#ifdef NOVID\r
+//#ifdef NOVID\r
+#ifdef __BORLANDC__\r
 void VL_Startup (global_game_variables_t *gvar){ gvar=gvar; }\r
 void VL_Shutdown (global_game_variables_t *gvar){ gvar=gvar; }\r
 void VGAmodeX(sword vq, boolean cmem, global_game_variables_t *gv)\r
@@ -140,10 +141,6 @@ void
 main(int argc, char *argv[])\r
 {\r
        byte w;\r
-                                                               #ifndef NOVID\r
-       boolean                 done;\r
-       ScanCode                scan;\r
-                                                               #endif\r
        static global_game_variables_t gvar;\r
                                                                #ifdef INITBBUF\r
        INITBBUF\r
@@ -264,7 +261,11 @@ PRINTBB; KEYP
        VGAmodeX(8, 0, &gvar);\r
 //     modexPalUpdate0(&gvar.video.palette);\r
 //     ShapeTest_(&gvar);\r
-\r
+       MM_ShowMemory(&gvar);\r
+#if 0\r
+       {\r
+       boolean                 done;\r
+       ScanCode                scan;\r
        for (done = false;!done;)\r
        {\r
                while (!(scan = gvar.in.inst->LastScan))\r
@@ -294,6 +295,8 @@ PRINTBB; KEYP
                        break;\r
                }\r
        }\r
+}\r
+#endif\r
        VGAmodeX(0, 0, &gvar);\r
 #endif\r
 #endif\r
index 2236494..d43432f 100755 (executable)
@@ -1320,13 +1320,12 @@ void MM_ShowMemory (global_game_variables_t *gvar)
                scaninfo[q].y = y;\r
                VW_Hlin(x,x+end,y,color,gvar);\r
                VL_Plot(x,y,5,gvar);\r
+//++==++==optional                     strcat(scratch0, AARESET); strcat(scratch0, AAGREY); strcat(scratch0,"_");\r
                for(w=(scan->start)/80;w<=end/80;w++)\r
                {\r
 //printf("+    %u      %lu\n", w, scan->length);\r
                        strcat(scratch0, "+");\r
                }\r
-               //++==++==optional\r
-               strcat(scratch0, AARESET); strcat(scratch0, AAGREY); strcat(scratch0,"_");\r
 \r
                if (scan->next && scan->next->start > end+1)\r
                {\r
@@ -1426,6 +1425,7 @@ void MM_ShowMemory (global_game_variables_t *gvar)
 #endif\r
 #ifdef MMSMSCANINFO\r
        {\r
+               byte scratch1[4];\r
                unsigned                maxq = q;\r
                boolean                 done;\r
                ScanCode                scancode;\r
@@ -1438,12 +1438,18 @@ void MM_ShowMemory (global_game_variables_t *gvar)
                        if(scaninfo[qq].scan->attributes & PURGEBITS)\r
                        {\r
                                ccolor = 6;             // dark purple = purgable\r
+                               strcpy(scratch1, AAMAGENTA);            // dark purple = purgable\r
+                               //printf("%s", AAMAGENTA);\r
                        }else{\r
                                ccolor = 2;             // medium blue = non purgable\r
+                               strcpy(scratch1, AABLUE);               // medium blue = non purgable\r
+                               //printf("%s", AABLUE);\r
                        }\r
                        if(scaninfo[qq].scan->attributes & LOCKBIT)\r
                        {\r
                                ccolor = 1;             // red = locked\r
+                               strcpy(scratch1, AARED);                // red = locked\r
+                               //printf("%s", AARED);\r
                        }\r
                        end = scaninfo[qq].scan->length-1;\r
 /*typedef struct mmblockstruct{\r
@@ -1454,9 +1460,9 @@ void MM_ShowMemory (global_game_variables_t *gvar)
 } mmblocktype;*/\r
                        //modexprint(page, x, y, t, tlsw, color, bgcolor, vidsw, const byte *str);\r
 #define MMSMPRINTMEMINFO modexprint(&(gvar->video.page[0]), xpos, ypos, 1, 0, ccolor, 8, gvar->video.VL_Started, global_temp_status_text); ypos+=8;\r
-                       VL_ShowPage(&gvar->video.page[0], 1, 0);\r
                        if(!gvar->video.VL_Started) clrscr(); else\r
                        {\r
+                               VL_ShowPage(&gvar->video.page[0], 1, 0);\r
                                modexClearRegion(&gvar->video.page[0], 0, 0, gvar->video.page[0].width, gvar->video.page[0].height, 8);\r
                        }\r
                        sprintf(global_temp_status_text, "block #%04u", qq); MMSMPRINTMEMINFO\r
@@ -1467,16 +1473,51 @@ void MM_ShowMemory (global_game_variables_t *gvar)
                        {\r
                                sprintf(global_temp_status_text, "free: %05u", (unsigned)(scaninfo[qq].scan->next->start-scaninfo[qq].scan->start)); MMSMPRINTMEMINFO\r
                        }\r
-                       y = ypos;//scaninfo[qq].scan->start/width;\r
-                       x = xpos;//scaninfo[qq].scan->start%width;\r
-                       VW_Hlin(x,x+end,y,ccolor,gvar);\r
-                       VL_Plot(x,y,5,gvar);\r
-                       if (scaninfo[qq].scan->next && scaninfo[qq].scan->next->start > end+1)\r
-                               VW_Hlin(x+end+1,x+(scaninfo[qq].scan->next->start-scaninfo[qq].scan->start),y,3,gvar);  // black = free//now green\r
+                       if(gvar->video.VL_Started)\r
+                       {\r
+                               y = ypos;//scaninfo[qq].scan->start/width;\r
+                               x = xpos;//scaninfo[qq].scan->start%width;\r
+                               VW_Hlin(x,x+end,y,ccolor,gvar);\r
+                               VL_Plot(x,y,5,gvar);\r
+                       }\r
+                       else\r
+                       {\r
+                               printf("%s", scratch1);\r
+                               printf("%s", AAGREY); printf("_");\r
+                               for(w=(scaninfo[qq].scan->start)/80;w<=end/80;w++)\r
+                               {\r
+                                       //strcat(scratch1, "+");\r
+                                       printf("+");\r
+                               }\r
+                       }\r
 \r
-                       //if (scan->next && scan->next->start > end+1) free\r
-                       xpos = 16;\r
-                       ypos = 16;//(gvar->video.page[0].sh-(32));//8*4\r
+\r
+                               if (scaninfo[qq].scan->next && scaninfo[qq].scan->next->start > end+1) if(!gvar->video.VL_Started)\r
+                               {\r
+                                       //strcat(scratch1, AARESET);\r
+                                       printf("%s", AARESET);\r
+                                       //strcat(scratch1,AAGREEN);\r
+                                       printf("%s", AAGREEN);\r
+                                       for(w=(end+1)/80;w<=((scaninfo[qq].scan->next->start-scaninfo[qq].scan->start)/80);w++)\r
+                                       {\r
+                                               //strcat(scratch1,"0");\r
+                                               printf("0");\r
+                                       }\r
+                               }else VW_Hlin(x+end+1,x+(scaninfo[qq].scan->next->start-scaninfo[qq].scan->start),y,3,gvar);    // black = free//now green\r
+\r
+\r
+                       if(gvar->video.VL_Started)\r
+                       {\r
+                               //if (scan->next && scan->next->start > end+1) free\r
+                               xpos = 16;\r
+                               ypos = 16;//(gvar->video.page[0].sh-(32));//8*4\r
+                       }\r
+                       else\r
+                       {\r
+                               //printf("%s\n", scratch1);\r
+                               printf("%s", AARESET);\r
+                               printf("\n");\r
+                       }\r
                        while (!(scancode = gvar->in.inst->LastScan)){}\r
 \r
                        IN_ClearKey(scancode);\r
@@ -1498,7 +1539,7 @@ void MM_ShowMemory (global_game_variables_t *gvar)
        }\r
 #endif\r
 \r
-       IN_Ack(gvar);\r
+       if(gvar->video.VL_Started) IN_Ack(gvar);\r
 \r
        gvar->video.BOFS = (byte __far *)temp;\r
 }\r