]> 4ch.mooo.com Git - 16.git/commitdiff
optimize for XT i did ww
authorsparky4 <sparky4@cock.li>
Thu, 16 Jun 2016 17:12:23 +0000 (12:12 -0500)
committersparky4 <sparky4@cock.li>
Thu, 16 Jun 2016 17:12:23 +0000 (12:12 -0500)
src/lib/scroll16.c
src/scroll.c

index 057ecf06c3d13d0c79250311a43c407c5c98e8a4..5e0a4202ed78cfe905e7e8901d9fa83d551ac444 100755 (executable)
@@ -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-4, player[pn].y-TILEWH, player[pn].x-4, player[pn].y-TILEWH, 24, 32);
+                               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);
 #ifdef SPRITE
-                               PBUFSFUN(pip[1].page, player[pn].x-4, player[pn].y-TILEWH, 24, 32, 24, 32, PLAYERBMPDATA);
+                               PBUFSFUN(pip[1].page, player[pn].x, player[pn].y-TILEWH, 16, 32, 16, 32, PLAYERBMPDATA);
 #else
-                               modexClearRegion(pip[1].page, player[pn].x-4, player[pn].y-TILEWH, 24, 32, 14);
+                               modexClearRegion(pip[1].page, player[pn].x, player[pn].y-TILEWH, 16, 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-4, player[pn].y-TILEWH, player[pn].x-4, player[pn].y-TILEWH, 24, 32);
+                               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);
 #ifdef SPRITE
-                               PBUFSFUN(pip[1].page, player[pn].x-4, player[pn].y-TILEWH, 24, 96, 24, 32, PLAYERBMPDATA);
+                               PBUFSFUN(pip[1].page, player[pn].x, player[pn].y-TILEWH, 16, 96, 16, 32, PLAYERBMPDATA);
 #else
-                               modexClearRegion(pip[1].page, player[pn].x-4, player[pn].y-TILEWH, 24, 32, 10);
+                               modexClearRegion(pip[1].page, player[pn].x, player[pn].y-TILEWH, 16, 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-4, player[pn].y-TILEWH, player[pn].x-4, player[pn].y-TILEWH, 24, 32);
+                               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);
 #ifdef SPRITE
-                               PBUFSFUN(pip[1].page, player[pn].x-4, player[pn].y-TILEWH, 24, 64, 24, 32, PLAYERBMPDATA);
+                               PBUFSFUN(pip[1].page, player[pn].x, player[pn].y-TILEWH, 16, 64, 16, 32, PLAYERBMPDATA);
 #else
-                               modexClearRegion(pip[1].page, player[pn].x-4, player[pn].y-TILEWH, 24, 32, 9);
+                               modexClearRegion(pip[1].page, player[pn].x, player[pn].y-TILEWH, 16, 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-4, player[pn].y-TILEWH, player[pn].x-4, player[pn].y-TILEWH, 24, 32);
+                               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);
 #ifdef SPRITE
-                               PBUFSFUN(pip[1].page, player[pn].x-4, player[pn].y-TILEWH, 24, 0, 24, 32, PLAYERBMPDATA);
+                               PBUFSFUN(pip[1].page, player[pn].x, player[pn].y-TILEWH, 16, 0, 16, 32, PLAYERBMPDATA);
 #else
-                               modexClearRegion(pip[1].page, player[pn].x-4, player[pn].y-TILEWH, 24, 32, 12);
+                               modexClearRegion(pip[1].page, player[pn].x, player[pn].y-TILEWH, 16, 32, 12);
 #endif
                                if(!pageflipflop) modexShowPage(pip[1].page);
                                player[pn].d = 2;
@@ -632,7 +632,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[!(mv->video->p)].page, 0/**/, 0/**/, 0, 128, 28, 36);
+       modexCopyPageRegion(mv[3].page, mv[!(mv->video->p)].page, 0/**/, 0/**/, 0, 128, 24, 36);
 }
 
 
@@ -835,17 +835,13 @@ void near animatePlayer(map_view_t *pip, player_t *player, word pn, sword scroll
 {
        sword x = player[pn].x;
        sword y = player[pn].y;
-#ifdef SPRITE
        word dire=32; //direction
-#else
-       word dire=8; //direction
-#endif
        sword qq; //scroll offset
        word ls = player[pn].persist_aniframe;
 
        if(scrollswitch==0) qq = 0;
        else qq = ((player[pn].q)*(player[pn].speed));
-       x-=4;
+       //x-=4;
        y-=TILEWH;
        switch (player[pn].d)
        {
@@ -872,22 +868,21 @@ void near animatePlayer(map_view_t *pip, player_t *player, word pn, sword scroll
                        x-=qq;
                break;
        }
-
        //modexCopyPageRegion(pip[!(pip->video->p)].page, pip[3].page, 0, 128, x-4, y-4, 28, 36);
 #ifdef SPRITE
-// #define FRAME1 PBUFSFUN(pip[1].page, x, y, 48, dire, 24, 32,        PLAYERBMPDATA);
-// #define FRAME2 PBUFSFUN(pip[1].page, x, y, 24, dire, 24, 32,        PLAYERBMPDATA);
-// #define FRAME3 PBUFSFUN(pip[1].page, x, y, 0, dire, 24, 32, PLAYERBMPDATA);
-// #define FRAME4 PBUFSFUN(pip[1].page, x, y, 24, dire, 24, 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);
+// #define FRAME1 PBUFSFUN(pip[1].page, x, y, 32, dire, 16, 32,        PLAYERBMPDATA);
+// #define FRAME2 PBUFSFUN(pip[1].page, x, y, 16, dire, 16, 32,        PLAYERBMPDATA);
+// #define FRAME3 PBUFSFUN(pip[1].page, x, y, 0, dire, 16, 32, PLAYERBMPDATA);
+// #define FRAME4 PBUFSFUN(pip[1].page, x, y, 16, dire, 16, 32,        PLAYERBMPDATA);
+#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);
 #else
-#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);
+#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);
        #endif
        if(!pageflipflop)
                modexCopyPageRegion(pip[1].page, pip[0].page, x-4, y-4, x-4, y-4, 28, 36);
index fa6df24b88708ad4bcb7a34ed1a4b088041472f5..6fb842dc804b04a2dd95db2cbdbf1f7acc18a4c4 100755 (executable)
@@ -191,11 +191,11 @@ void main(int argc, char *argv[])
        //IN_initplayer(&player, 1);
 
 #ifndef        SPRITE
-       modexClearRegion(mv[0].page, player[0].x-4, player[0].y-TILEWH, 24, 32, 15);
-       modexClearRegion(mv[1].page, player[0].x-4, player[0].y-TILEWH, 24, 32, 15);
+       modexClearRegion(mv[0].page, player[0].x, player[0].y-TILEWH, 16, 32, 15);
+       modexClearRegion(mv[1].page, player[0].x, player[0].y-TILEWH, 16, 32, 15);
 #else
-       //PBUFSFUN(mv[1].page, player[0].x-4, player[0].y-TILEWH, 24, 64, 24, 32,       PLAYERBMPDATA);
-       PBUFSFUN(mv[1].page, player[0].x-4, player[0].y-TILEWH, 24, 64, 24, 32, &pp);
+       //PBUFSFUN(mv[1].page, player[0].x, player[0].y-TILEWH, 16, 64, 24, 32, PLAYERBMPDATA);
+       PBUFSFUN(mv[1].page, player[0].x, player[0].y-TILEWH, 16, 64, 16, 32,   &pp);
 #endif
 
        if(!pageflipflop)       modexShowPage(mv[1].page);