From c5e2579e86b089548e88b75af850c6315f874b1d Mon Sep 17 00:00:00 2001 From: sparky4 Date: Wed, 16 Aug 2017 16:24:21 -0500 Subject: [PATCH] the scanshowinfo part of show memory text prints do not match the text file's text prints.. I gotta get the merged somehow --- src/exmmtest.c | 4 ++-- src/lib/16_mm.c | 38 ++++++++++++++++++++++++-------------- src/lib/16_tdef.h | 11 +++++++++++ src/lib/16_vl.c | 9 ++++++++- src/lib/16_vl.h | 1 + src/lib/16_vl_1.c | 22 ++++++++++++---------- 6 files changed, 58 insertions(+), 27 deletions(-) diff --git a/src/exmmtest.c b/src/exmmtest.c index f34cc3be..7bf0ef01 100755 --- a/src/exmmtest.c +++ b/src/exmmtest.c @@ -56,6 +56,7 @@ void TL_VidInit(global_game_variables_t *gvar) void VL_ShowPage(page_t *page, boolean vsync, boolean sr){} void modexClearRegion(page_t *page, int x, int y, int w, int h, byte color){} 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); } +void VL_print(const byte *str, nibble pagenum, global_game_variables_t *gvar){ printf("%s\n", str); } void modexpdump(nibble pagenum, global_game_variables_t *gvar){} #endif #endif @@ -199,8 +200,7 @@ PRINTBB; KEYP } #ifdef SCROLLLOAD -// #else //scrollload -// CA_loadmap(bakapee2, &gvar.map, &gvar); //BREAKS! + CA_loadmap(bakapee2, &gvar.map, &gvar); //BREAKS! // newloadmap(bakapee2, &gvar.map); VRS_LoadVRS(bakapee1, &gvar.player[0].enti, &gvar); // HC_heapdump(&gvar); diff --git a/src/lib/16_mm.c b/src/lib/16_mm.c index dc807cbd..77bbe963 100755 --- a/src/lib/16_mm.c +++ b/src/lib/16_mm.c @@ -1367,7 +1367,7 @@ void MM_ShowMemory (global_game_variables_t *gvar) #ifdef MMSMSCANINFO mmshowmemoryinfo_t scaninfo[MAXBLOCKS]; byte scratch1[4]; - unsigned xpos,ypos, oldq,q,maxq; + unsigned /*xpos,ypos, */oldq,q,maxq; boolean done,restarted,mmsmscaninfoxyposinew; ScanCode scancode; #endif @@ -1478,7 +1478,10 @@ reset: #endif strcat(scratch0, AARESET); //strcat(scratch0,"\n"); - strcat(scratch,"Seg:"); + strcat(scratch,"Block:"); + ultoa (q,str,10); + strcat (scratch,str); + strcat(scratch,"\tSeg:"); ultoa (scan->start,str,16); strcat (scratch,str); // strcat(scratch, AABLACK); strcat(scratch,"\t"); strcat(scratch, AARESET); @@ -1501,11 +1504,10 @@ reset: #ifdef MMSMSCANINFO q++; #endif -//0000if(q==1 && gvar->video.VL_Started && color!=6) IN_Ack(gvar); +//0000if(gvar->video.VL_Started && color!=6) IN_Ack(gvar); } CA_CloseDebug (gvar); - if (gvar->video.VL_Started) IN_Ack(gvar); #ifdef MMSMPANVID { @@ -1513,6 +1515,8 @@ reset: odx = gvar->video.page[0].dx; ody = gvar->video.page[0].dy; dx = dy = 0; + + while (!(scancode = gvar->in.inst->LastScan)){} while(!gvar->in.inst->Keyboard[sc_Escape] && !gvar->in.inst->Keyboard[sc_Space]) { if(gvar->in.inst->Keyboard[sc_UpArrow]) @@ -1545,7 +1549,8 @@ reset: } #endif #ifdef MMSMSCANINFO - maxq = q; + if (gvar->video.VL_Started) IN_Ack(gvar); + maxq = q-1; if(restarted) q = oldq; else q = 0; restarted = false; @@ -1573,8 +1578,13 @@ reset: //printf("%s", AARED); } end = scaninfo[q].scan->length-1; -//modexprint(page, x, y, t, tlsw, color, bgcolor, vidsw, const byte *str); -#define MMSMPRINTMEMINFO modexprint(&(gvar->video.page[0]), xpos, ypos, 1, 1, color, 8, gvar->video.VL_Started, global_temp_status_text); ypos+=8; + + gvar->video.print.t=1; + gvar->video.print.tlsw=1; + gvar->video.print.color=color; + gvar->video.print.bgcolor=8; +#define MMSMPRINTMEMINFO VL_print(global_temp_status_text, 0, gvar); gvar->video.print.y+=8; +//modexprint(&(gvar->video.page[0]), xpos, ypos, 1, 1, color, 8, gvar->video.VL_Started, global_temp_status_text); #ifdef __WATCOMC__ if(gvar->video.VL_Started) { @@ -1591,15 +1601,15 @@ reset: if (scaninfo[q].scan->next && scaninfo[q].scan->next->start > end+1) { sprintf(global_temp_status_text, "free: %05u", (unsigned)(scaninfo[q].scan->next->start-scaninfo[q].scan->start)); MMSMPRINTMEMINFO - }else ypos+=8; + }else /*ypos*/gvar->video.print.y+=8; if(gvar->video.VL_Started) { y = scaninfo[q].scan->start/sw; x = scaninfo[q].scan->start%sw; if(!mmsmscaninfoxyposinew) { - y = ypos; - x = xpos; + y = gvar->video.print.y;//ypos; + x = gvar->video.print.x;//xpos; }else{ //y = scaninfo[q].y; //x = scaninfo[q].x; @@ -1638,8 +1648,8 @@ reset: if(gvar->video.VL_Started) { //if (scan->next && scan->next->start > end+1) free - xpos = gvar->video.page[0].dx; - ypos = gvar->video.page[0].dy; + /*xpos*/gvar->video.print.x = gvar->video.page[0].dx; + /*ypos*/gvar->video.print.y = gvar->video.page[0].dy; } else { @@ -1686,8 +1696,8 @@ reset: break; } } -//#else -// if(gvar->video.VL_Started) IN_Ack(gvar); +#else + if(gvar->video.VL_Started) IN_Ack(gvar); #endif gvar->video.BOFS = (byte __far *)temp; diff --git a/src/lib/16_tdef.h b/src/lib/16_tdef.h index bb886801..0016fcee 100755 --- a/src/lib/16_tdef.h +++ b/src/lib/16_tdef.h @@ -396,6 +396,16 @@ typedef struct int hscrolledge[MAXSCROLLEDGES],vscrolledge[MAXSCROLLEDGES]; } pan_t; +typedef struct +{ + sword x; + sword y; + word t; + boolean tlsw; + word color; + word bgcolor; +} modexprint_t; + typedef struct { //---- ylookup[MAXSCANLINES], @@ -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. ofs_t ofs; //offset vars used for doslib word vh; //video combined height + modexprint_t print; //modexprint variables tile_dimention_t td; //0000word startclk; float clk, tickclk; //timer //wolf3d vars diff --git a/src/lib/16_vl.c b/src/lib/16_vl.c index 1f5754d9..761a0cf3 100755 --- a/src/lib/16_vl.c +++ b/src/lib/16_vl.c @@ -1268,6 +1268,12 @@ void modexprintbig(page_t *page, word x, word y, word t, word col, word bgcol, c } } +// short hand of modexprint +void VL_print(const byte *str, nibble pagenum, global_game_variables_t *gvar) +{ + 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); +} + /* palette dump on display! */ void modexpdump(nibble pagenum, global_game_variables_t *gvar) { @@ -1392,7 +1398,8 @@ void VL_PrintmodexmemInfo(video_t *v) // printf("========================================\n"); 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"); 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"); - printf(" stride: %u ", vga_state.vga_stride); + printf(" vga_stride: %u ", vga_state.vga_stride); + printf("pagestride: %u ", v->page[0].stridew); printf("draw_stride: %u ", vga_state.vga_draw_stride); printf("draw_stride_limit: %u\n", vga_state.vga_draw_stride_limit); diff --git a/src/lib/16_vl.h b/src/lib/16_vl.h index 1eeff032..a3769a28 100755 --- a/src/lib/16_vl.h +++ b/src/lib/16_vl.h @@ -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); void modexprintbig(page_t *page, word x, word y, word t, word col, word bgcol, const byte *str); void VL_modexPrintTextBox(global_game_variables_t *gvar); +void VL_print(const byte *str, nibble pagenum, global_game_variables_t *gvar); void modexpdump(nibble pagenum, global_game_variables_t *gvar); void VL_PatternDraw(video_t *video, word pn, boolean sw, boolean allsw); void modexWaitBorder(); diff --git a/src/lib/16_vl_1.c b/src/lib/16_vl_1.c index a1257fdc..57c59b30 100755 --- a/src/lib/16_vl_1.c +++ b/src/lib/16_vl_1.c @@ -26,6 +26,8 @@ #include "src/lib/16_vl.h" static word far* clockw= (word far*) 0x046C; /* 18.2hz clock */ +#define VGASTRIDEVARIABLE gvar->video.page[0].stridew +//vga_state.vga_stride //=========================================================================== @@ -531,8 +533,8 @@ void VL_Plot (int x, int y, int color, global_game_variables_t *gvar) mask = pclip[x&3]; VGAMAPMASK(mask); //*(byte far *)MK_FP(SCREENSEG,gvar->video.ofs.bufferofs+(gvar->video.ofs.ylookup[y]+(x>>2))) = color; - //*(byte far *)MK_FP(SCREENSEG,gvar->video.ofs.bufferofs+((y*gvar->video.page[0].stridew)+(x>>2))) = color; - *(byte far *)MK_FP(SCREENSEG,BDOFSCONV gvar->video.BOFS+((y*gvar->video.page[0].stridew)+(x>>2))) = color; + //*(byte far *)MK_FP(SCREENSEG,gvar->video.ofs.bufferofs+((y*VGASTRIDEVARIABLE)+(x>>2))) = color; + *(byte far *)MK_FP(SCREENSEG,BDOFSCONV gvar->video.BOFS+((y*VGASTRIDEVARIABLE)+(x>>2))) = color; VGAMAPMASK(15); } @@ -562,7 +564,7 @@ void VL_Hlin (unsigned x, unsigned y, unsigned width, unsigned color, global_gam midbytes = ((x+width+3)>>2) - xbyte - 2; //dest = MK_FP(SCREENSEG,gvar->video.ofs.bufferofs+gvar->video.ofs.ylookup[y]+xbyte); - dest = MK_FP(SCREENSEG,BDOFSCONV gvar->video.BOFS+(y*gvar->video.page[0].stridew)+xbyte); + dest = MK_FP(SCREENSEG,BDOFSCONV gvar->video.BOFS+(y*VGASTRIDEVARIABLE)+xbyte); if (midbytes<0) { @@ -606,13 +608,13 @@ void VL_Vlin (int x, int y, int height, int color, global_game_variables_t *gvar VGAMAPMASK(mask); //dest = MK_FP(SCREENSEG,gvar->video.ofs.bufferofs+gvar->video.ofs.ylookup[y]+(x>>2)); - dest = MK_FP(SCREENSEG,BDOFSCONV gvar->video.BOFS+(y*gvar->video.page[0].stridew)+(x>>2)); + dest = MK_FP(SCREENSEG,BDOFSCONV gvar->video.BOFS+(y*VGASTRIDEVARIABLE)+(x>>2)); while (height--) { *dest = color; //dest += gvar->video.ofs.linewidth; - dest += gvar->video.page[0].stridew; + dest += VGASTRIDEVARIABLE; } VGAMAPMASK(15); @@ -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]; midbytes = ((x+width+3)>>2) - (x>>2) - 2; //linedelta = gvar->video.ofs.linewidth-(midbytes+1); - linedelta = gvar->video.page[0].stridew-(midbytes+1); + linedelta = VGASTRIDEVARIABLE-(midbytes+1); //dest = MK_FP(SCREENSEG,gvar->video.ofs.bufferofs+gvar->video.ofs.ylookup[y]+(x>>2)); - dest = MK_FP(SCREENSEG,BDOFSCONV gvar->video.BOFS+(y*gvar->video.page[0].stridew)+(x>>2)); + dest = MK_FP(SCREENSEG,BDOFSCONV gvar->video.BOFS+(y*VGASTRIDEVARIABLE)+(x>>2)); if (midbytes<0) { @@ -654,7 +656,7 @@ void VL_Bar (int x, int y, int width, int height, int color, global_game_variabl { *dest = color; //dest += gvar->video.ofs.linewidth; - dest += gvar->video.page[0].stridew; + dest += VGASTRIDEVARIABLE; } VGAMAPMASK(15); return; @@ -697,7 +699,7 @@ void VL_MemToScreen (byte far *source, int width, int height, int x, int y, glob width>>=2; //dest = MK_FP(SCREENSEG,gvar->video.ofs.bufferofs+gvar->video.ofs.ylookup[y]+(x>>2)); - dest = MK_FP(SCREENSEG,BDOFSCONV gvar->video.BOFS+(y*gvar->video.page[0].stridew)+(x>>2)); + dest = MK_FP(SCREENSEG,BDOFSCONV gvar->video.BOFS+(y*VGASTRIDEVARIABLE)+(x>>2)); mask = 1 << (x&3); for (plane = 0; plane<4; plane++) @@ -709,7 +711,7 @@ void VL_MemToScreen (byte far *source, int width, int height, int x, int y, glob screen = dest; //for (y=0;yvideo.ofs.linewidth,source+=width) - for (y=0;yvideo.page[0].stridew,source+=width) + for (y=0;y