]> 4ch.mooo.com Git - 16.git/commitdiff
====i made a quick and dirty fix to the video issue wwww====
authorsparky4 <sparky4@cock.li>
Mon, 6 Jun 2016 15:15:47 +0000 (10:15 -0500)
committersparky4 <sparky4@cock.li>
Mon, 6 Jun 2016 15:15:47 +0000 (10:15 -0500)
src/lib/scroll16.c
src/lib/typdefst.h
src/scroll.c

index 312a76e6f2add585821e00f7d5976c599f5dee90..f092a3cb931951453884622c59430115046527b1 100755 (executable)
@@ -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;
        }
index 0f47b2b1a6ebcd58c17a58a35dc55ca4708d4cef..25e2a0a8090bd7e8c1e60f3a7cd5c7deaba17ba1 100755 (executable)
@@ -117,6 +117,7 @@ typedef struct
        boolean __near p;                       //render page number\r
        boolean __near r;                       //page flip if true\r
        word pr[MAXPAGE][4];    //render sections of pages\r
+       word startclk; float clk;               //timer\r
 } video_t;\r
 \r
 typedef struct\r
index 7c77673d51f2b269a752241145d9f414dbd34db3..28b2fb886a22762c76a889c1bf9c31ab4d86a169 100755 (executable)
@@ -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]);