]> 4ch.mooo.com Git - 16.git/blobdiff - src/lib/scroll16.c
^^ yay! i polished exmmtest and the memory reporter
[16.git] / src / lib / scroll16.c
index 07da327cc810a4cf5ad4ee482372a048b9d906f0..eca613a8ccfbc1bdf60f5a4a0b837813c3dc3953 100755 (executable)
@@ -1,5 +1,5 @@
 /* Project 16 Source Code~
- * Copyright (C) 2012-2016 sparky4 & pngwen & andrius4669 & joncampbell123
+ * Copyright (C) 2012-2016 sparky4 & pngwen & andrius4669 & joncampbell123 & yakui-lover
  *
  * This file is part of Project 16.
  *
@@ -66,11 +66,11 @@ void walk(map_view_t *pip, player_t *player, word pn)
                        }
                        else
                        {
-                               if(!pageflipflop) modexCopyPageRegion(pip[1].page, pip[0].page, player[pn].x, player[pn].y-TILEWH, player[pn].x, player[pn].y-TILEWH, 16, 32);
+                               if(!pageflipflop) modexCopyPageRegion(pip[1].page, pip[0].page, player[pn].x, player[pn].y-TILEWH, player[pn].x, player[pn].y-TILEWH, 24, 32);
 #ifdef SPRITE
-                               PBUFSFUN(pip[0].page, player[pn].x, player[pn].y-TILEWH, 16, 32, 16, 32, PLAYERBMPDATA);
+                               PBUFSFUN(pip[0].page, player[pn].x, player[pn].y-TILEWH, 24, 32, 24, 32, PLAYERBMPDATA);
 #else
-                               modexClearRegion(pip[1].page, player[pn].x, player[pn].y-TILEWH, 16, 32, 14);
+                               modexClearRegion(pip[1].page, player[pn].x, player[pn].y-TILEWH, 24, 32, 14);
 #endif
                                if(!pageflipflop) modexShowPage(pip[1].page);
                                player[pn].d = 2;
@@ -110,11 +110,11 @@ void walk(map_view_t *pip, player_t *player, word pn)
                        }
                        else
                        {
-                               if(!pageflipflop) modexCopyPageRegion(pip[1].page, pip[0].page, player[pn].x, player[pn].y-TILEWH, player[pn].x, player[pn].y-TILEWH, 16, 32);
+                               if(!pageflipflop) modexCopyPageRegion(pip[1].page, pip[0].page, player[pn].x, player[pn].y-TILEWH, player[pn].x, player[pn].y-TILEWH, 24, 32);
 #ifdef SPRITE
-                               PBUFSFUN(pip[0].page, player[pn].x, player[pn].y-TILEWH, 16, 96, 16, 32, PLAYERBMPDATA);
+                               PBUFSFUN(pip[0].page, player[pn].x, player[pn].y-TILEWH, 24, 96, 24, 32, PLAYERBMPDATA);
 #else
-                               modexClearRegion(pip[1].page, player[pn].x, player[pn].y-TILEWH, 16, 32, 10);
+                               modexClearRegion(pip[1].page, player[pn].x, player[pn].y-TILEWH, 24, 32, 10);
 #endif
                                if(!pageflipflop) modexShowPage(pip[1].page);
                                player[pn].d = 2;
@@ -154,11 +154,11 @@ void walk(map_view_t *pip, player_t *player, word pn)
                        }
                        else
                        {
-                               if(!pageflipflop) modexCopyPageRegion(pip[1].page, pip[0].page, player[pn].x, player[pn].y-TILEWH, player[pn].x, player[pn].y-TILEWH, 16, 32);
+                               if(!pageflipflop) modexCopyPageRegion(pip[1].page, pip[0].page, player[pn].x, player[pn].y-TILEWH, player[pn].x, player[pn].y-TILEWH, 24, 32);
 #ifdef SPRITE
-                               PBUFSFUN(pip[0].page, player[pn].x, player[pn].y-TILEWH, 16, 64, 16, 32, PLAYERBMPDATA);
+                               PBUFSFUN(pip[0].page, player[pn].x, player[pn].y-TILEWH, 24, 64, 24, 32, PLAYERBMPDATA);
 #else
-                               modexClearRegion(pip[1].page, player[pn].x, player[pn].y-TILEWH, 16, 32, 9);
+                               modexClearRegion(pip[1].page, player[pn].x, player[pn].y-TILEWH, 24, 32, 9);
 #endif
                                if(!pageflipflop) modexShowPage(pip[1].page);
                                player[pn].d = 2;
@@ -198,11 +198,11 @@ void walk(map_view_t *pip, player_t *player, word pn)
                        }
                        else
                        {
-                               if(!pageflipflop) modexCopyPageRegion(pip[1].page, pip[0].page, player[pn].x, player[pn].y-TILEWH, player[pn].x, player[pn].y-TILEWH, 16, 32);
+                               if(!pageflipflop) modexCopyPageRegion(pip[1].page, pip[0].page, player[pn].x, player[pn].y-TILEWH, player[pn].x, player[pn].y-TILEWH, 24, 32);
 #ifdef SPRITE
-                               PBUFSFUN(pip[0].page, player[pn].x, player[pn].y-TILEWH, 16, 0, 16, 32, PLAYERBMPDATA);
+                               PBUFSFUN(pip[0].page, player[pn].x, player[pn].y-TILEWH, 24, 0, 24, 32, PLAYERBMPDATA);
 #else
-                               modexClearRegion(pip[1].page, player[pn].x, player[pn].y-TILEWH, 16, 32, 12);
+                               modexClearRegion(pip[1].page, player[pn].x, player[pn].y-TILEWH, 24, 32, 12);
 #endif
                                if(!pageflipflop) modexShowPage(pip[1].page);
                                player[pn].d = 2;
@@ -374,6 +374,7 @@ void near mapScrollRight(map_view_t *mv, player_t *player, word id, word plid)
        mv[id].tx++;
        /* Snap the origin forward */
        mv[id].page->data += 4;
+
        mv[id].page->dx = mv[id].map->tiles->tileWidth;
        }
 
@@ -403,6 +404,7 @@ void near mapScrollLeft(map_view_t *mv, player_t *player, word id, word plid)
        mv[id].tx--;
        /* Snap the origin backward */
        mv[id].page->data -= 4;
+
        mv[id].page->dx = mv[id].map->tiles->tileWidth;
        }
 
@@ -432,6 +434,7 @@ void near mapScrollUp(map_view_t *mv, player_t *player, word id, word plid)
        mv[id].ty--;
        /* Snap the origin downward */
        mv[id].page->data -= mv[id].page->pi;
+
        mv[id].page->dy = mv[id].map->tiles->tileHeight;
        }
 
@@ -460,6 +463,7 @@ void near mapScrollDown(map_view_t *mv, player_t *player, word id, word plid)
        mv[id].ty++;
        /* Snap the origin downward */
        mv[id].page->data += mv[id].page->pi;
+
        mv[id].page->dy = mv[id].map->tiles->tileHeight;
        }
 
@@ -622,7 +626,7 @@ void mapGoTo(map_view_t *mv, int tx, int ty)
 //                                     vga_state.vga_graphics_ram[o] = (k^j)&15; // VRL samples put all colors in first 15!
 //             }
 //     }
-       modexCopyPageRegion(mv[3].page, mv[0].page, 0/**/, 0/**/, 0, 0, 16, 32);
+       modexCopyPageRegion(mv[3].page, mv[0].page, 0/**/, 0/**/, 0, 0, 24, 32);
 }
 
 void near
@@ -749,7 +753,7 @@ void mapDrawWCol(map_view_t *mv, int tx, int ty, word x)
 }*/
 
 unsigned char shinku_fps_indicator_page = 2;
-boolean pageflipflop;
+boolean pageflipflop = 1;
 boolean pageploop = 1;
 
 /*     sync    */
@@ -864,15 +868,15 @@ void near animatePlayer(map_view_t *pip, player_t *player, word pn, sword scroll
        }
 
 #ifdef SPRITE
-#define FRAME1 PBUFSFUN(pip[/*!*/(pip->video->p)].page, x, y, 32, dire, 16, 32,        PLAYERBMPDATA);
-#define FRAME2 PBUFSFUN(pip[/*!*/(pip->video->p)].page, x, y, 16, dire, 16, 32,        PLAYERBMPDATA);
-#define FRAME3 PBUFSFUN(pip[/*!*/(pip->video->p)].page, x, y, 0, dire, 16, 32, PLAYERBMPDATA);
-#define FRAME4 PBUFSFUN(pip[/*!*/(pip->video->p)].page, x, y, 16, dire, 16, 32,        PLAYERBMPDATA);
+#define FRAME1 PBUFSFUN(pip[/*!*/(pip->video->p)].page, x, y, 48, dire, 24, 32,        PLAYERBMPDATA);
+#define FRAME2 PBUFSFUN(pip[/*!*/(pip->video->p)].page, x, y, 24, dire, 24, 32,        PLAYERBMPDATA);
+#define FRAME3 PBUFSFUN(pip[/*!*/(pip->video->p)].page, x, y, 0, dire, 24, 32, PLAYERBMPDATA);
+#define FRAME4 PBUFSFUN(pip[/*!*/(pip->video->p)].page, x, y, 24, dire, 24, 32,        PLAYERBMPDATA);
 #else
-#define FRAME1 modexClearRegion(pip[/*!*/(pip->video->p)].page, x, y, 16, 32, 2+dire);
-#define FRAME2 modexClearRegion(pip[/*!*/(pip->video->p)].page, x, y, 16, 32, 1+dire);
-#define FRAME3 modexClearRegion(pip[/*!*/(pip->video->p)].page, x, y, 16, 32, dire);
-#define FRAME4 modexClearRegion(pip[/*!*/(pip->video->p)].page, x, y, 16, 32, 1+dire);
+#define FRAME1 modexClearRegion(pip[/*!*/(pip->video->p)].page, x, y, 24, 32, 2+dire);
+#define FRAME2 modexClearRegion(pip[/*!*/(pip->video->p)].page, x, y, 24, 32, 1+dire);
+#define FRAME3 modexClearRegion(pip[/*!*/(pip->video->p)].page, x, y, 24, 32, dire);
+#define FRAME4 modexClearRegion(pip[/*!*/(pip->video->p)].page, x, y, 24, 32, 1+dire);
 #endif
        if(!pageflipflop)
                modexCopyPageRegion(pip[1].page, pip[0].page, x-4, y-4, x-4, y-4, 28, 36);
@@ -906,7 +910,7 @@ void near animatePlayer(map_view_t *pip, player_t *player, word pn, sword scroll
 //     if(3>ls && ls>=2) { FRAME2 }else
 //     if(4>ls && ls>=3) { FRAME3 }else
 //     if(5>ls && ls>=4) { FRAME4 }
-       //modexCopyPageRegion(pip[0].page, pip[3].page, 0, 0, x, y, 16, 32);
+       //modexCopyPageRegion(pip[0].page, pip[3].page, 0, 0, x, y, 24, 32);
        //printf("x=%d  y=%d    bx=%d           by=%d\n", x, y, bx, by);
        pip->video->r=1;
 }