From 46de466195384487cfd2ce33da7d277a25c4cdef Mon Sep 17 00:00:00 2001 From: sparky4 Date: Sun, 17 Apr 2016 15:11:07 -0500 Subject: [PATCH] vga_wait_for_vsync(); --- src/lib/modex16.c | 29 ++++++++++++++++++----------- src/lib/modex16.h | 2 +- src/lib/scroll16.c | 6 ++++-- 3 files changed, 23 insertions(+), 14 deletions(-) diff --git a/src/lib/modex16.c b/src/lib/modex16.c index 42d4f6c8..fcec8d38 100755 --- a/src/lib/modex16.c +++ b/src/lib/modex16.c @@ -545,7 +545,8 @@ modexPalUpdate(bitmap_t *bmp, word *i, word qp, word aqoffset) static word a[PAL_SIZE]; //palette array of change values! word z=0, aq=0, aa=0, pp=0; - modexWaitBorder(); + //modexWaitBorder(); + vga_wait_for_vsync(); if((*i)==0) { memset(a, -1, sizeof(a)); @@ -595,7 +596,8 @@ modexPalUpdate(bitmap_t *bmp, word *i, word qp, word aqoffset) //if(qp>0) printf("qp=%d\n", qp); //if(qp>0) printf(" (*i)=%d\n", (*i)/3); } - modexWaitBorder(); /* waits one retrace -- less flicker */ + //modexWaitBorder(); /* waits one retrace -- less flicker */ + vga_wait_for_vsync(); if((*i)>=PAL_SIZE/2 && w==0) { for(; (*i)width*(page->height)/4); } -void +/*void modexWaitBorder() { while(inp(INPUT_STATUS_1) & 8) { - /* spin */ + // spin } while(!(inp(INPUT_STATUS_1) & 8)) { - /* spin */ + // spin } -} +}*/ diff --git a/src/lib/modex16.h b/src/lib/modex16.h index 3621466f..6b8622f1 100755 --- a/src/lib/modex16.h +++ b/src/lib/modex16.h @@ -128,7 +128,7 @@ void modexprint(page_t *page, word x, word y, word t, word col, word bgcol, cons void modexprintbig(page_t *page, word x, word y, word t, word col, word bgcol, const byte *str); void pdump(page_t *pee); void cls(page_t *page, byte color, byte *Where); -void modexWaitBorder(); +//void modexWaitBorder(); /* -======================= Constants & Vars ==========================- */ extern byte far* VGA; /* The VGA Memory */ diff --git a/src/lib/scroll16.c b/src/lib/scroll16.c index 5f3158d4..5c8c4dd2 100755 --- a/src/lib/scroll16.c +++ b/src/lib/scroll16.c @@ -488,7 +488,8 @@ mapDrawTile(tiles_t *t, word i, page_t *page, word x, word y) modexClearRegion(page, x, y, t->tileWidth, t->tileHeight, ((t->debug_data[i])+1)); //cannot print number value du to it being slow as bakapee #else - PBUFBFUN (page, x, y, rx, ry, t->tileWidth, t->tileHeight, (t->data)); + //PBUFBFUN (page, x, y, rx, ry, t->tileWidth, t->tileHeight, (t->data)); + //modexDrawBmpRegion (page, x, y, rx, ry, t->tileWidth, t->tileHeight, (t->data)); #endif break; @@ -613,7 +614,8 @@ void shinku(map_view_t *pip, global_game_variables_t *gv) break; case 1: //turn this off if XT - modexWaitBorder(); + //modexWaitBorder(); + vga_wait_for_vsync(); gv->kurokku.frames_per_second=60; break; } -- 2.39.5