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
}\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
#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
#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
#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
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
}\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
//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
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
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
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
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
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
}\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
// 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
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
#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
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
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
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
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
{\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
\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
\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