X-Git-Url: http://4ch.mooo.com/gitweb/?a=blobdiff_plain;f=src%2Flib%2Fmodex16.c;h=e3e70397b36b4241f4240b2c318d10449151a97e;hb=c5dbea494cdfaf301cc12246fea54557c7bc4f21;hp=b1e6d51f79ef370366d443ed08c7330a6a048226;hpb=2170cf972950dffecd075a65d1f8d9a49eb82ce9;p=16.git diff --git a/src/lib/modex16.c b/src/lib/modex16.c old mode 100644 new mode 100755 index b1e6d51f..e3e70397 --- a/src/lib/modex16.c +++ b/src/lib/modex16.c @@ -29,14 +29,14 @@ byte far* VGA=(byte far*) 0xA0000000; /* this points to video memory. */ static void fadePalette(sbyte fade, sbyte start, word iter, byte *palette); static byte tmppal[PAL_SIZE]; -int old_mode; +//int old_mode; ///////////////////////////////////////////////////////////////////////////// // // // setvideo() - This function Manages the video modes // // // ///////////////////////////////////////////////////////////////////////////// -void VGAmodeX(sword vq) +void VGAmodeX(sword vq, global_game_variables_t *gv) { union REGS in, out; @@ -45,7 +45,7 @@ void VGAmodeX(sword vq) // change to the video mode we were in before we switched to mode 13h modexLeave(); in.h.ah = 0x00; - in.h.al = old_mode; + in.h.al = gv->old_mode; int86(0x10, &in, &out); } @@ -54,7 +54,7 @@ void VGAmodeX(sword vq) // get old video mode in.h.ah = 0xf; int86(0x10, &in, &out); - old_mode = out.h.al; + gv->old_mode = out.h.al; // enter mode modexEnter(); } @@ -314,7 +314,7 @@ void modexDrawBmpRegion(page_t *page, int x, int y, int rx, int ry, int rw, int rh, bitmap_t *bmp) { word poffset = (word) page->data + y*(page->width/4) + x/4; - byte *data = bmp->data;//+bmp->offset; + byte far *data = bmp->data;//+bmp->offset; word bmpOffset = (word) data + ry * bmp->width + rx; word width = rw; word height = rh; @@ -325,6 +325,10 @@ modexDrawBmpRegion(page_t *page, int x, int y, word rowCounter; byte planeCounter = 4; +/* printf("bmp->data=%Fp\n",bmp->data); + printf("*bmp->data=%Fp\n",*(bmp->data)); + printf("&bmp->data=%Fp\n",&(bmp->data));*/ + //code is a bit slow here __asm { MOV AX, SCREEN_SEG ; go to the VGA memory