From: sparky4 Date: Mon, 6 Jun 2016 15:15:47 +0000 (-0500) Subject: ====i made a quick and dirty fix to the video issue wwww==== X-Git-Url: http://4ch.mooo.com/gitweb/?a=commitdiff_plain;h=20f690b53a11b7aa09a8614b3d281c4014e0df22;p=16.git ====i made a quick and dirty fix to the video issue wwww==== --- diff --git a/src/lib/scroll16.c b/src/lib/scroll16.c index 312a76e6..f092a3cb 100755 --- a/src/lib/scroll16.c +++ b/src/lib/scroll16.c @@ -40,6 +40,7 @@ void walk(map_view_t *pip, player_t *player, word pn) { INC_PER_FRAME; animatePlayer(pip, player, pn, 1); + pip[0].video->startclk = (*clockw); if(!pageflipflop) mapScrollRight(pip, player, !(pip[0].video->p), pn); else{ mapScrollRight(pip, player, 0, pn); mapScrollRight(pip, player, 1, pn); @@ -47,7 +48,7 @@ void walk(map_view_t *pip, player_t *player, word pn) ScrollRight(pip, player, 3, pn); } if(!pageflipflop) modexShowPage(pip[1].page); player[pn].q++; - } else { player[pn].q = 1; player[pn].d = 2; player[pn].tx++; } + } else { player[pn].q = 1; player[pn].d = 2; player[pn].tx++; pip[0].video->clk = (float)((*clockw)-pip[0].video->startclk)/18.2; } } else if(player[pn].tx < pip[0].map->width && !(pip[0].map->data[(player[pn].tx)+(pip[0].map->width*(player[pn].ty-1))] == 0))//!(player[pn].tx+1 == TRIGGX && player[pn].ty == TRIGGY)) { @@ -84,6 +85,7 @@ void walk(map_view_t *pip, player_t *player, word pn) { INC_PER_FRAME; animatePlayer(pip, player, pn, 1); + pip[0].video->startclk = (*clockw); if(!pageflipflop) mapScrollLeft(pip, player, !(pip[0].video->p), pn); else{ mapScrollLeft(pip, player, 0, pn); mapScrollLeft(pip, player, 1, pn); @@ -91,7 +93,7 @@ void walk(map_view_t *pip, player_t *player, word pn) ScrollLeft(pip, player, 3, pn); } if(!pageflipflop) modexShowPage(pip[1].page); player[pn].q++; - } else { player[pn].q = 1; player[pn].d = 2; player[pn].tx--; } + } else { player[pn].q = 1; player[pn].d = 2; player[pn].tx--; pip[0].video->clk = (float)((*clockw)-pip[0].video->startclk)/18.2; } } else if(player[pn].tx > 1 && !(pip[0].map->data[(player[pn].tx-2)+(pip[0].map->width*(player[pn].ty-1))] == 0))//!(player[pn].tx-1 == TRIGGX && player[pn].ty == TRIGGY)) { @@ -128,6 +130,7 @@ void walk(map_view_t *pip, player_t *player, word pn) { INC_PER_FRAME; animatePlayer(pip, player, pn, 1); + pip[0].video->startclk = (*clockw); if(!pageflipflop) mapScrollDown(pip, player, !(pip[0].video->p), pn); else{ mapScrollDown(pip, player, 0, pn); mapScrollDown(pip, player, 1, pn); @@ -135,7 +138,7 @@ void walk(map_view_t *pip, player_t *player, word pn) ScrollDown(pip, player, 3, pn); } if(!pageflipflop) modexShowPage(pip[1].page); player[pn].q++; - } else { player[pn].q = 1; player[pn].d = 2; player[pn].ty++; } + } else { player[pn].q = 1; player[pn].d = 2; player[pn].ty++; pip[0].video->clk = (float)((*clockw)-pip[0].video->startclk)/18.2; } } else if(player[pn].ty < pip[0].map->height && !(pip[0].map->data[(player[pn].tx-1)+(pip[0].map->width*(player[pn].ty))] == 0))//!(player[pn].tx == TRIGGX && player[pn].ty+1 == TRIGGY)) { @@ -172,6 +175,7 @@ void walk(map_view_t *pip, player_t *player, word pn) { INC_PER_FRAME; animatePlayer(pip, player, pn, 1); + pip[0].video->startclk = (*clockw); if(!pageflipflop) mapScrollUp(pip, player, !(pip[0].video->p), pn); else{ mapScrollUp(pip, player, 0, pn); mapScrollUp(pip, player, 1, pn); @@ -179,7 +183,7 @@ void walk(map_view_t *pip, player_t *player, word pn) ScrollUp(pip, player, 3, pn); } if(!pageflipflop) modexShowPage(pip[1].page); player[pn].q++; - } else { player[pn].q = 1; player[pn].d = 2; player[pn].ty--; } + } else { player[pn].q = 1; player[pn].d = 2; player[pn].ty--; pip[0].video->clk = (float)((*clockw)-pip[0].video->startclk)/18.2; } } else if(player[pn].ty > 1 && !(pip[0].map->data[(player[pn].tx-1)+(pip[0].map->width*(player[pn].ty-2))] == 0))//!(player[pn].tx == TRIGGX && player[pn].ty-1 == TRIGGY)) { @@ -775,8 +779,8 @@ void shinku(global_game_variables_t *gv) break; case 1: //turn this off if XT - modexWaitBorder(); - //vga_wait_for_vsync(); + //modexWaitBorder(); + vga_wait_for_vsync(); gv->kurokku.frames_per_second=60; break; } diff --git a/src/lib/typdefst.h b/src/lib/typdefst.h index 0f47b2b1..25e2a0a8 100755 --- a/src/lib/typdefst.h +++ b/src/lib/typdefst.h @@ -117,6 +117,7 @@ typedef struct boolean __near p; //render page number boolean __near r; //page flip if true word pr[MAXPAGE][4]; //render sections of pages + word startclk; float clk; //timer } video_t; typedef struct diff --git a/src/scroll.c b/src/scroll.c index 7c77673d..28b2fb88 100755 --- a/src/scroll.c +++ b/src/scroll.c @@ -322,7 +322,8 @@ void main(int argc, char *argv[]) printf("middle tile position: %dx", gvar.video.page[0].tilemidposscreenx); printf("%d\n", gvar.video.page[0].tilemidposscreeny); modexprintmeminfo(&gvar.video); printf("mv[%u].tx: %d", pan.pn, mv[pan.pn].tx); printf(" mv[%u].ty: %d ", pan.pn, mv[pan.pn].ty); printf("gvar.video.p=%u\n", gvar.video.p); - //printf("player[1].q: %d", player[1].q); printf(" player[1].d: %d\n", player[1].d); + printf("\ngvar.video.startclk=%u ", gvar.video.startclk); + printf("gvar.video.clk=%f\n", (float)((*clockw)-gvar.video.startclk)/18.2); printf("\n"); //printf("map.width=%d map.height=%d map.data[0]=%d\n", mv[0].map->width, mv[0].map->height, mv[0].map->data[0]);