]> 4ch.mooo.com Git - 16.git/commitdiff
the scanshowinfo part of show memory text prints do not match the text file's text...
authorsparky4 <sparky4@cock.li>
Wed, 16 Aug 2017 21:24:21 +0000 (16:24 -0500)
committersparky4 <sparky4@cock.li>
Wed, 16 Aug 2017 21:24:21 +0000 (16:24 -0500)
src/exmmtest.c
src/lib/16_mm.c
src/lib/16_tdef.h
src/lib/16_vl.c
src/lib/16_vl.h
src/lib/16_vl_1.c

index f34cc3be33aa693bc51db15809c9af2b06c0557d..7bf0ef01bd8f8894610d19d22d9752e10bb89330 100755 (executable)
@@ -56,6 +56,7 @@ void  TL_VidInit(global_game_variables_t *gvar)
 void VL_ShowPage(page_t *page, boolean vsync, boolean sr){}\r
 void modexClearRegion(page_t *page, int x, int y, int w, int h, byte color){}\r
 void modexprint(page_t *page, sword x, sword y, word t, boolean tlsw, word color, word bgcolor, boolean vidsw, const byte *str){ printf("%s\n", str); }\r
+void VL_print(const byte *str, nibble pagenum, global_game_variables_t *gvar){ printf("%s\n", str); }\r
 void modexpdump(nibble pagenum, global_game_variables_t *gvar){}\r
 #endif\r
 #endif\r
@@ -199,8 +200,7 @@ PRINTBB; KEYP
        }\r
 \r
                                                        #ifdef SCROLLLOAD\r
-//                                                     #else           //scrollload\r
-//     CA_loadmap(bakapee2, &gvar.map, &gvar); //BREAKS!\r
+       CA_loadmap(bakapee2, &gvar.map, &gvar); //BREAKS!\r
 //     newloadmap(bakapee2, &gvar.map);\r
        VRS_LoadVRS(bakapee1, &gvar.player[0].enti, &gvar);\r
 //     HC_heapdump(&gvar);\r
index dc807cbd1a0daf49985c0b743e0838e48908fcc6..77bbe9638ebec7b051692df765466678f797597d 100755 (executable)
@@ -1367,7 +1367,7 @@ void MM_ShowMemory (global_game_variables_t *gvar)
 #ifdef MMSMSCANINFO\r
        mmshowmemoryinfo_t scaninfo[MAXBLOCKS];\r
        byte scratch1[4];\r
-       unsigned                xpos,ypos, oldq,q,maxq;\r
+       unsigned                /*xpos,ypos, */oldq,q,maxq;\r
        boolean         done,restarted,mmsmscaninfoxyposinew;\r
        ScanCode                scancode;\r
 #endif\r
@@ -1478,7 +1478,10 @@ reset:
 #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
@@ -1501,11 +1504,10 @@ reset:
 #ifdef MMSMSCANINFO\r
                q++;\r
 #endif\r
-//0000if(q==1 && gvar->video.VL_Started && color!=6) IN_Ack(gvar);\r
+//0000if(gvar->video.VL_Started && color!=6) IN_Ack(gvar);\r
        }\r
 \r
        CA_CloseDebug (gvar);\r
-       if (gvar->video.VL_Started) IN_Ack(gvar);\r
 \r
 #ifdef MMSMPANVID\r
        {\r
@@ -1513,6 +1515,8 @@ reset:
                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
@@ -1545,7 +1549,8 @@ reset:
        }\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
@@ -1573,8 +1578,13 @@ reset:
                        //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
@@ -1591,15 +1601,15 @@ reset:
                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/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
@@ -1638,8 +1648,8 @@ reset:
                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
@@ -1686,8 +1696,8 @@ reset:
                        break;\r
                }\r
        }\r
-//#else\r
-//     if(gvar->video.VL_Started) IN_Ack(gvar);\r
+#else\r
+       if(gvar->video.VL_Started) IN_Ack(gvar);\r
 #endif\r
 \r
        gvar->video.BOFS = (byte __far *)temp;\r
index bb886801f6c9d12ca7b82cee2261f6d61b95558d..0016fceebf9cafb5e7f83b6b1251631a5d4acd8c 100755 (executable)
@@ -396,6 +396,16 @@ typedef struct
        int             hscrolledge[MAXSCROLLEDGES],vscrolledge[MAXSCROLLEDGES];\r
 } pan_t;\r
 \r
+typedef struct\r
+{\r
+       sword x;\r
+       sword y;\r
+       word t;\r
+       boolean tlsw;\r
+       word color;\r
+       word bgcolor;\r
+} modexprint_t;\r
+\r
 typedef struct\r
 {\r
 //---- ylookup[MAXSCANLINES],\r
@@ -436,6 +446,7 @@ typedef struct
        nibble sfip;            //shinku_fps_indicator_page; // we're on page 1 now, shinku(). follow along please or it will not be visible.\r
        ofs_t   ofs;            //offset vars used for doslib\r
        word    vh;             //video combined height\r
+       modexprint_t    print;  //modexprint variables\r
        tile_dimention_t        td;\r
        //0000word startclk; float clk, tickclk;        //timer\r
        //wolf3d vars\r
index 1f5754d9c2edcca74ddca917b6900ccf7df8e781..761a0cf3848bd5d0b0ed5a3e66434528bc1cb30e 100755 (executable)
@@ -1268,6 +1268,12 @@ void modexprintbig(page_t *page, word x, word y, word t, word col, word bgcol, c
        }\r
 }\r
 \r
+//     short hand of modexprint\r
+void VL_print(const byte *str, nibble pagenum, global_game_variables_t *gvar)\r
+{\r
+       modexprint(&(gvar->video.page[pagenum]), gvar->video.print.x, gvar->video.print.y, gvar->video.print.t, gvar->video.print.tlsw, gvar->video.print.color, gvar->video.print.bgcolor, gvar->video.VL_Started, str);\r
+}\r
+\r
 /* palette dump on display! */\r
 void modexpdump(nibble pagenum, global_game_variables_t *gvar)\r
 {\r
@@ -1392,7 +1398,8 @@ void VL_PrintmodexmemInfo(video_t *v)
 //     printf("========================================\n");\r
        printf("  Virtual Screen: %dx", v->page[0].width);      printf("%d      ", v->page[0].height);  printf("Tile: %dx", v->page[0].ti.tilesw);              printf("%d", v->page[0].ti.tilesh);     printf("=((Virtual Screen)/16)\n");\r
        printf("          Screen: %dx", v->page[0].sw);         printf("%d      ", v->page[0].sh);              printf("Tile: %dx", v->page[0].ti.tw);                  printf("%d", v->page[0].ti.th);         printf("=((Screen)/16)\n");\r
-       printf("  stride: %u ", vga_state.vga_stride);\r
+       printf("  vga_stride: %u ", vga_state.vga_stride);\r
+       printf("pagestride: %u ", v->page[0].stridew);\r
        printf("draw_stride: %u ", vga_state.vga_draw_stride);\r
        printf("draw_stride_limit: %u\n", vga_state.vga_draw_stride_limit);\r
 \r
index 1eeff032e68ca75eba69ac908f6c1ac6a79f7852..a3769a28216aee6c9803865982e88e30064433cf 100755 (executable)
@@ -258,6 +258,7 @@ void modexDrawChar(page_t *page, int x/*for planar selection only*/, word t, wor
 void modexprint(page_t *page, sword x, sword y, word t, boolean tlsw, word color, word bgcolor, boolean vidsw, const byte *str);\r
 void modexprintbig(page_t *page, word x, word y, word t, word col, word bgcol, const byte *str);\r
 void VL_modexPrintTextBox(global_game_variables_t *gvar);\r
+void VL_print(const byte *str, nibble pagenum, global_game_variables_t *gvar);\r
 void modexpdump(nibble pagenum, global_game_variables_t *gvar);\r
 void VL_PatternDraw(video_t *video, word pn, boolean sw, boolean allsw);\r
 void modexWaitBorder();\r
index a1257fdc772f6f671475c260381081ad5139ef26..57c59b304cbd5cfed43e13c1e0fc431982db9437 100755 (executable)
@@ -26,6 +26,8 @@
 #include "src/lib/16_vl.h"\r
 \r
 static word far* clockw= (word far*) 0x046C; /* 18.2hz clock */\r
+#define VGASTRIDEVARIABLE      gvar->video.page[0].stridew\r
+//vga_state.vga_stride\r
 \r
 //===========================================================================\r
 \r
@@ -531,8 +533,8 @@ void VL_Plot (int x, int y, int color, global_game_variables_t *gvar)
        mask = pclip[x&3];\r
        VGAMAPMASK(mask);\r
        //*(byte far *)MK_FP(SCREENSEG,gvar->video.ofs.bufferofs+(gvar->video.ofs.ylookup[y]+(x>>2))) = color;\r
-       //*(byte far *)MK_FP(SCREENSEG,gvar->video.ofs.bufferofs+((y*gvar->video.page[0].stridew)+(x>>2))) = color;\r
-       *(byte far *)MK_FP(SCREENSEG,BDOFSCONV gvar->video.BOFS+((y*gvar->video.page[0].stridew)+(x>>2))) = color;\r
+       //*(byte far *)MK_FP(SCREENSEG,gvar->video.ofs.bufferofs+((y*VGASTRIDEVARIABLE)+(x>>2))) = color;\r
+       *(byte far *)MK_FP(SCREENSEG,BDOFSCONV gvar->video.BOFS+((y*VGASTRIDEVARIABLE)+(x>>2))) = color;\r
        VGAMAPMASK(15);\r
 }\r
 \r
@@ -562,7 +564,7 @@ void VL_Hlin        (unsigned x, unsigned y, unsigned width, unsigned color, global_gam
        midbytes = ((x+width+3)>>2) - xbyte - 2;\r
 \r
        //dest = MK_FP(SCREENSEG,gvar->video.ofs.bufferofs+gvar->video.ofs.ylookup[y]+xbyte);\r
-       dest = MK_FP(SCREENSEG,BDOFSCONV gvar->video.BOFS+(y*gvar->video.page[0].stridew)+xbyte);\r
+       dest = MK_FP(SCREENSEG,BDOFSCONV gvar->video.BOFS+(y*VGASTRIDEVARIABLE)+xbyte);\r
 \r
        if (midbytes<0)\r
        {\r
@@ -606,13 +608,13 @@ void VL_Vlin      (int x, int y, int height, int color, global_game_variables_t *gvar
        VGAMAPMASK(mask);\r
 \r
        //dest = MK_FP(SCREENSEG,gvar->video.ofs.bufferofs+gvar->video.ofs.ylookup[y]+(x>>2));\r
-       dest = MK_FP(SCREENSEG,BDOFSCONV gvar->video.BOFS+(y*gvar->video.page[0].stridew)+(x>>2));\r
+       dest = MK_FP(SCREENSEG,BDOFSCONV gvar->video.BOFS+(y*VGASTRIDEVARIABLE)+(x>>2));\r
 \r
        while (height--)\r
        {\r
                *dest = color;\r
                //dest += gvar->video.ofs.linewidth;\r
-               dest += gvar->video.page[0].stridew;\r
+               dest += VGASTRIDEVARIABLE;\r
        }\r
 \r
        VGAMAPMASK(15);\r
@@ -641,10 +643,10 @@ void VL_Bar (int x, int y, int width, int height, int color, global_game_variabl
        rightmask = rclip[(x+width-1)&3];\r
        midbytes = ((x+width+3)>>2) - (x>>2) - 2;\r
        //linedelta = gvar->video.ofs.linewidth-(midbytes+1);\r
-       linedelta = gvar->video.page[0].stridew-(midbytes+1);\r
+       linedelta = VGASTRIDEVARIABLE-(midbytes+1);\r
 \r
        //dest = MK_FP(SCREENSEG,gvar->video.ofs.bufferofs+gvar->video.ofs.ylookup[y]+(x>>2));\r
-       dest = MK_FP(SCREENSEG,BDOFSCONV gvar->video.BOFS+(y*gvar->video.page[0].stridew)+(x>>2));\r
+       dest = MK_FP(SCREENSEG,BDOFSCONV gvar->video.BOFS+(y*VGASTRIDEVARIABLE)+(x>>2));\r
 \r
        if (midbytes<0)\r
        {\r
@@ -654,7 +656,7 @@ void VL_Bar (int x, int y, int width, int height, int color, global_game_variabl
                {\r
                        *dest = color;\r
                        //dest += gvar->video.ofs.linewidth;\r
-                       dest += gvar->video.page[0].stridew;\r
+                       dest += VGASTRIDEVARIABLE;\r
                }\r
                VGAMAPMASK(15);\r
                return;\r
@@ -697,7 +699,7 @@ void VL_MemToScreen (byte far *source, int width, int height, int x, int y, glob
 \r
        width>>=2;\r
        //dest = MK_FP(SCREENSEG,gvar->video.ofs.bufferofs+gvar->video.ofs.ylookup[y]+(x>>2));\r
-       dest = MK_FP(SCREENSEG,BDOFSCONV gvar->video.BOFS+(y*gvar->video.page[0].stridew)+(x>>2));\r
+       dest = MK_FP(SCREENSEG,BDOFSCONV gvar->video.BOFS+(y*VGASTRIDEVARIABLE)+(x>>2));\r
        mask = 1 << (x&3);\r
 \r
        for     (plane = 0; plane<4; plane++)\r
@@ -709,7 +711,7 @@ void VL_MemToScreen (byte far *source, int width, int height, int x, int y, glob
 \r
                screen = dest;\r
                //for   (y=0;y<height;y++,screen+=gvar->video.ofs.linewidth,source+=width)\r
-               for     (y=0;y<height;y++,screen+=gvar->video.page[0].stridew,source+=width)\r
+               for     (y=0;y<height;y++,screen+=VGASTRIDEVARIABLE,source+=width)\r
                        _fmemcpy (screen,source,width);\r
        }\r
 }\r