X-Git-Url: http://4ch.mooo.com/gitweb/?a=blobdiff_plain;f=src%2Flib%2F16_vl_1.c;h=a1257fdc772f6f671475c260381081ad5139ef26;hb=8807e59c1c5d34b1ee351dd92fb7cd57b6c2847f;hp=7332d5fb5d10795c7a7cb265d50c1036573daba3;hpb=23c4d02d9d36e5c5aa030fa5d1413d1558fc8af0;p=16.git diff --git a/src/lib/16_vl_1.c b/src/lib/16_vl_1.c index 7332d5fb..a1257fdc 100755 --- a/src/lib/16_vl_1.c +++ b/src/lib/16_vl_1.c @@ -168,8 +168,8 @@ SetScreen_done: = ==================== */ - -void VL_SetLineWidth (unsigned width, ofs_t *ofs) +#if 0 +void VL_SetLineWidth (unsigned width, global_game_variables_t *gvar) { int i,offset; @@ -181,17 +181,17 @@ void VL_SetLineWidth (unsigned width, ofs_t *ofs) // // set up lookup tables // - ofs->linewidth = width*2; + gvar->video.ofs.linewidth = width*2; offset = 0; for (i=0;iylookup[i]=offset; - offset += ofs->linewidth; + gvar->video.ofs.ylookup[i]=offset; + offset += gvar->video.ofs.linewidth; } } - +#endif /* ============================================================================= @@ -483,6 +483,25 @@ void VL_TestPaletteSet (video_t *v) v->fastpalette = false; } +/* +================== += += VL_ColorBorder += +================== +*/ + +void VL_ColorBorder (int color, video_t *v) +{ + union REGS in, out; + + in.h.ah = 0x10; + in.h.al = 0x01; + in.h.bh = color; + int86(0x10, &in, &out); + v->bordercolor = color; +} + /* ============================================================================= @@ -502,14 +521,18 @@ void VL_TestPaletteSet (video_t *v) ================= */ -void VL_Plot (int x, int y, int color, ofs_t *ofs) +void VL_Plot (int x, int y, int color, global_game_variables_t *gvar) { byte mask; VCLIPDEF + if(!gvar->video.VL_Started) return; + mask = pclip[x&3]; VGAMAPMASK(mask); - *(byte far *)MK_FP(SCREENSEG,ofs->bufferofs+(ofs->ylookup[y]+(x>>2))) = color; + //*(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; VGAMAPMASK(15); } @@ -522,7 +545,7 @@ void VL_Plot (int x, int y, int color, ofs_t *ofs) ================= */ -void VL_Hlin (unsigned x, unsigned y, unsigned width, unsigned color, ofs_t *ofs) +void VL_Hlin (unsigned x, unsigned y, unsigned width, unsigned color, global_game_variables_t *gvar) { unsigned xbyte; byte far *dest; @@ -531,12 +554,15 @@ void VL_Hlin (unsigned x, unsigned y, unsigned width, unsigned color, ofs_t *ofs LRCLIPDEF + if(!gvar->video.VL_Started) return; + xbyte = x>>2; leftmask = lclip[x&3]; rightmask = rclip[(x+width-1)&3]; midbytes = ((x+width+3)>>2) - xbyte - 2; - dest = MK_FP(SCREENSEG,ofs->bufferofs+ofs->ylookup[y]+xbyte); + //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); if (midbytes<0) { @@ -569,20 +595,24 @@ void VL_Hlin (unsigned x, unsigned y, unsigned width, unsigned color, ofs_t *ofs ================= */ -void VL_Vlin (int x, int y, int height, int color, ofs_t *ofs) +void VL_Vlin (int x, int y, int height, int color, global_game_variables_t *gvar) { byte far *dest,mask; VCLIPDEF + if(!gvar->video.VL_Started) return; + mask = pclip[x&3]; VGAMAPMASK(mask); - dest = MK_FP(SCREENSEG,ofs->bufferofs+ofs->ylookup[y]+(x>>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)); while (height--) { *dest = color; - dest += ofs->linewidth; + //dest += gvar->video.ofs.linewidth; + dest += gvar->video.page[0].stridew; } VGAMAPMASK(15); @@ -597,7 +627,7 @@ void VL_Vlin (int x, int y, int height, int color, ofs_t *ofs) ================= */ -void VL_Bar (int x, int y, int width, int height, int color, ofs_t *ofs) +void VL_Bar (int x, int y, int width, int height, int color, global_game_variables_t *gvar) { byte far *dest; byte leftmask,rightmask; @@ -605,12 +635,16 @@ void VL_Bar (int x, int y, int width, int height, int color, ofs_t *ofs) LRCLIPDEF + if(!gvar->video.VL_Started) return; + leftmask = lclip[x&3]; rightmask = rclip[(x+width-1)&3]; midbytes = ((x+width+3)>>2) - (x>>2) - 2; - linedelta = ofs->linewidth-(midbytes+1); + //linedelta = gvar->video.ofs.linewidth-(midbytes+1); + linedelta = gvar->video.page[0].stridew-(midbytes+1); - dest = MK_FP(SCREENSEG,ofs->bufferofs+ofs->ylookup[y]+(x>>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)); if (midbytes<0) { @@ -619,7 +653,8 @@ void VL_Bar (int x, int y, int width, int height, int color, ofs_t *ofs) while (height--) { *dest = color; - dest += ofs->linewidth; + //dest += gvar->video.ofs.linewidth; + dest += gvar->video.page[0].stridew; } VGAMAPMASK(15); return; @@ -655,13 +690,14 @@ void VL_Bar (int x, int y, int width, int height, int color, ofs_t *ofs) ================= */ -void VL_MemToScreen (byte far *source, int width, int height, int x, int y, ofs_t *ofs) +void VL_MemToScreen (byte far *source, int width, int height, int x, int y, global_game_variables_t *gvar) { byte far *screen,far *dest,mask; int plane; width>>=2; - dest = MK_FP(SCREENSEG,ofs->bufferofs+ofs->ylookup[y]+(x>>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)); mask = 1 << (x&3); for (plane = 0; plane<4; plane++) @@ -672,7 +708,8 @@ void VL_MemToScreen (byte far *source, int width, int height, int x, int y, ofs_ mask = 1; screen = dest; - for (y=0;ylinewidth,source+=width) + //for (y=0;yvideo.ofs.linewidth,source+=width) + for (y=0;yvideo.page[0].stridew,source+=width) _fmemcpy (screen,source,width); } }