X-Git-Url: http://4ch.mooo.com/gitweb/?a=blobdiff_plain;f=src%2Flib%2F16_vl_1.c;h=df4e1cbc9e6632781642cadec3a94a5bf4b35bb5;hb=6021fc3f27b895d382fbd30488ead35657e39196;hp=a1257fdc772f6f671475c260381081ad5139ef26;hpb=f2a811af6076e5d139acaef8c0fcf7c40244d8ed;p=16.git diff --git a/src/lib/16_vl_1.c b/src/lib/16_vl_1.c index a1257fdc..df4e1cbc 100755 --- a/src/lib/16_vl_1.c +++ b/src/lib/16_vl_1.c @@ -1,5 +1,5 @@ /* Project 16 Source Code~ - * Copyright (C) 2012-2017 sparky4 & pngwen & andrius4669 & joncampbell123 & yakui-lover + * Copyright (C) 2012-2018 sparky4 & pngwen & andrius4669 & joncampbell123 & yakui-lover * * This file is part of Project 16. * @@ -26,6 +26,8 @@ #include "src/lib/16_vl.h" static word far* clockw= (word far*) 0x046C; /* 18.2hz clock */ +//#define VGASTRIDEVARIABLE vga_state.vga_stride +#define VGASTRIDEVARIABLE gvar->video.page[0].stridew //=========================================================================== @@ -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