]> 4ch.mooo.com Git - 16.git/blobdiff - src/lib/scroll16.c
==== MAJOR CHANGES ARE BEING MADE!! WWWW ====
[16.git] / src / lib / scroll16.c
index cab3823fcd33b682d30cd47195a6afe6a08d20dd..51d8137d1d9e55ca8ef43d1ceeb03bea2cd2ced7 100755 (executable)
 */\r
 #include "src/lib/scroll16.h"\r
 \r
-void walk(map_view_t *pip, player_t *player, word pn)\r
+void oldwalk(map_view_t *pip, player_t *player, word pn)\r
 {\r
-       #define INC_PER_FRAME if(player[pn].q&1) player[pn].persist_aniframe++; if(player[pn].persist_aniframe>4) player[pn].persist_aniframe = 1;\r
-       //printf("player[%d].d=%d\n", pn, player[pn].d);\r
-       switch(player[pn].d)\r
+       #define INC_PER_FRAME if(player[pn].enti.q&1) player[pn].enti.persist_aniframe++; if(player[pn].enti.persist_aniframe>4) player[pn].enti.persist_aniframe = 1;\r
+       //printf("player[%d].d=%d\n", pn, player[pn].enti.d);\r
+       switch(player[pn].enti.d)\r
        {\r
                //no direction\r
                case 2:\r
@@ -37,10 +37,10 @@ void walk(map_view_t *pip, player_t *player, word pn)
                //right movement\r
                case 3:\r
                        //printf("pip[0].page->tilesw=%d        ", pip[0].page->tilesw); printf("pip[0].page->tw=%d\n", pip[0].page->tw);\r
-                       if(pip[0].tx >= 0 && pip[0].tx+pip[0].page->tw < pip[0].map->width && player[pn].tx == pip[0].tx+pip[0].page->tilemidposscreenx &&\r
-                       !(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))      //collision detection!\r
+                       if(pip[0].tx >= 0 && pip[0].tx+pip[0].page->tw < pip[0].map->width && player[pn].enti.tx == pip[0].tx+pip[0].page->tilemidposscreenx &&\r
+                       !(pip[0].map->data[(player[pn].enti.tx)+(pip[0].map->width*(player[pn].enti.ty-1))] == 0))//!(player[pn].enti.tx+1 == TRIGGX && player[pn].enti.ty == TRIGGY))  //collision detection!\r
                        {\r
-                               if(player[pn].q<=player[pn].spt)\r
+                               if(player[pn].enti.q<=player[pn].enti.spt)\r
                                {\r
                                        INC_PER_FRAME;\r
                                        animatePlayer(pip, player, pn, 1);\r
@@ -49,42 +49,42 @@ void walk(map_view_t *pip, player_t *player, word pn)
                                        //mapScrollRight(pip, player, !(pip[0].video->p), pn);\r
                                        mapScrollRight(pip, player, (pip[0].video->p), pn);\r
                                        if(!pageflipflop) modexShowPage(pip[1].page);\r
-                                       player[pn].q++;\r
+                                       player[pn].enti.q++;\r
                                        //0000pip[0].video->clk = ((*clockw)-pip[0].video->startclk)/18.2;\r
-                               } else { player[pn].q = 1; player[pn].d = 2; player[pn].tx++; }\r
+                               } else { player[pn].enti.q = 1; player[pn].enti.d = 2; player[pn].enti.tx++; }\r
                        }\r
-                       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))\r
+                       else if(player[pn].enti.tx < pip[0].map->width && !(pip[0].map->data[(player[pn].enti.tx)+(pip[0].map->width*(player[pn].enti.ty-1))] == 0))//!(player[pn].enti.tx+1 == TRIGGX && player[pn].enti.ty == TRIGGY))\r
                        {\r
-                               if(player[pn].q<=player[pn].spt)\r
+                               if(player[pn].enti.q<=player[pn].enti.spt)\r
                                {\r
                                        INC_PER_FRAME;\r
-                                       player[pn].x+=(player[pn].speed);\r
+                                       player[pn].enti.x+=(player[pn].enti.speed);\r
                                        animatePlayer(pip, player, pn, 0);\r
                                        if(!pageflipflop) modexShowPage(pip[1].page);\r
-                                       player[pn].q++;\r
-                               } else { player[pn].q = 1; player[pn].d = 2; player[pn].tx++; }\r
+                                       player[pn].enti.q++;\r
+                               } else { player[pn].enti.q = 1; player[pn].enti.d = 2; player[pn].enti.tx++; }\r
                        }\r
                        else\r
                        {\r
-                               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);\r
+                               if(!pageflipflop) modexCopyPageRegion(pip[1].page, pip[0].page, player[pn].enti.x, player[pn].enti.y-TILEWH, player[pn].enti.x, player[pn].enti.y-TILEWH, 24, 32);\r
 #ifdef SPRITE\r
-                               modexDrawSpriteRegion(pip[0].page, player[pn].x, player[pn].y-TILEWH, 24, 32, 24, 32, PLAYERBMPDATAPTR);\r
+                               modexDrawSpriteRegion(pip[0].page, player[pn].enti.x, player[pn].enti.y-TILEWH, 24, 32, 24, 32, PLAYERBMPDATAPTR);\r
 #else\r
-                               modexClearRegion(pip[1].page, player[pn].x, player[pn].y-TILEWH, 24, 32, 14);\r
+                               modexClearRegion(pip[1].page, player[pn].enti.x, player[pn].enti.y-TILEWH, 24, 32, 14);\r
 #endif\r
                                if(!pageflipflop) modexShowPage(pip[1].page);\r
-                               player[pn].d = 2;\r
+                               player[pn].enti.d = 2;\r
                        }\r
-                       player[pn].triggerx = player[pn].tx+1;\r
-                       player[pn].triggery = player[pn].ty;\r
+                       player[pn].enti.triggerx = player[pn].enti.tx+1;\r
+                       player[pn].enti.triggery = player[pn].enti.ty;\r
                break;\r
 \r
                //left movement\r
                case 1:\r
-                       if(pip[0].tx > 0 && pip[0].tx+pip[0].page->tw <= pip[0].map->width && player[pn].tx == pip[0].tx+pip[0].page->tilemidposscreenx &&\r
-                       !(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))    //collision detection!\r
+                       if(pip[0].tx > 0 && pip[0].tx+pip[0].page->tw <= pip[0].map->width && player[pn].enti.tx == pip[0].tx+pip[0].page->tilemidposscreenx &&\r
+                       !(pip[0].map->data[(player[pn].enti.tx-2)+(pip[0].map->width*(player[pn].enti.ty-1))] == 0))//!(player[pn].enti.tx-1 == TRIGGX && player[pn].enti.ty == TRIGGY))        //collision detection!\r
                        {\r
-                               if(player[pn].q<=player[pn].spt)\r
+                               if(player[pn].enti.q<=player[pn].enti.spt)\r
                                {\r
                                        INC_PER_FRAME;\r
                                        animatePlayer(pip, player, pn, 1);\r
@@ -93,42 +93,42 @@ void walk(map_view_t *pip, player_t *player, word pn)
                                        //mapScrollLeft(pip, player, !(pip[0].video->p), pn);\r
                                        mapScrollLeft(pip, player, (pip[0].video->p), pn);\r
                                        if(!pageflipflop) modexShowPage(pip[1].page);\r
-                                       player[pn].q++;\r
+                                       player[pn].enti.q++;\r
                                        //0000pip[0].video->clk = ((*clockw)-pip[0].video->startclk)/18.2;\r
-                               } else { player[pn].q = 1; player[pn].d = 2; player[pn].tx--; }\r
+                               } else { player[pn].enti.q = 1; player[pn].enti.d = 2; player[pn].enti.tx--; }\r
                        }\r
-                       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))\r
+                       else if(player[pn].enti.tx > 1 && !(pip[0].map->data[(player[pn].enti.tx-2)+(pip[0].map->width*(player[pn].enti.ty-1))] == 0))//!(player[pn].enti.tx-1 == TRIGGX && player[pn].enti.ty == TRIGGY))\r
                        {\r
-                               if(player[pn].q<=player[pn].spt)\r
+                               if(player[pn].enti.q<=player[pn].enti.spt)\r
                                {\r
                                        INC_PER_FRAME;\r
-                                       player[pn].x-=(player[pn].speed);\r
+                                       player[pn].enti.x-=(player[pn].enti.speed);\r
                                        animatePlayer(pip, player, pn, 0);\r
                                        if(!pageflipflop) modexShowPage(pip[1].page);\r
-                                       player[pn].q++;\r
-                               } else { player[pn].q = 1; player[pn].d = 2; player[pn].tx--; }\r
+                                       player[pn].enti.q++;\r
+                               } else { player[pn].enti.q = 1; player[pn].enti.d = 2; player[pn].enti.tx--; }\r
                        }\r
                        else\r
                        {\r
-                               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);\r
+                               if(!pageflipflop) modexCopyPageRegion(pip[1].page, pip[0].page, player[pn].enti.x, player[pn].enti.y-TILEWH, player[pn].enti.x, player[pn].enti.y-TILEWH, 24, 32);\r
 #ifdef SPRITE\r
-                               modexDrawSpriteRegion(pip[0].page, player[pn].x, player[pn].y-TILEWH, 24, 96, 24, 32, PLAYERBMPDATAPTR);\r
+                               modexDrawSpriteRegion(pip[0].page, player[pn].enti.x, player[pn].enti.y-TILEWH, 24, 96, 24, 32, PLAYERBMPDATAPTR);\r
 #else\r
-                               modexClearRegion(pip[1].page, player[pn].x, player[pn].y-TILEWH, 24, 32, 10);\r
+                               modexClearRegion(pip[1].page, player[pn].enti.x, player[pn].enti.y-TILEWH, 24, 32, 10);\r
 #endif\r
                                if(!pageflipflop) modexShowPage(pip[1].page);\r
-                               player[pn].d = 2;\r
+                               player[pn].enti.d = 2;\r
                        }\r
-                       player[pn].triggerx = player[pn].tx-1;\r
-                       player[pn].triggery = player[pn].ty;\r
+                       player[pn].enti.triggerx = player[pn].enti.tx-1;\r
+                       player[pn].enti.triggery = player[pn].enti.ty;\r
                break;\r
 \r
                //down movement\r
                case 4:\r
-                       if(pip[0].ty >= 0 && pip[0].ty+pip[0].page->th < pip[0].map->height && player[pn].ty == pip[0].ty+pip[0].page->tilemidposscreeny &&\r
-                       !(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))      //collision detection!\r
+                       if(pip[0].ty >= 0 && pip[0].ty+pip[0].page->th < pip[0].map->height && player[pn].enti.ty == pip[0].ty+pip[0].page->tilemidposscreeny &&\r
+                       !(pip[0].map->data[(player[pn].enti.tx-1)+(pip[0].map->width*(player[pn].enti.ty))] == 0))//!(player[pn].enti.tx == TRIGGX && player[pn].enti.ty+1 == TRIGGY))  //collision detection!\r
                        {\r
-                               if(player[pn].q<=player[pn].spt)\r
+                               if(player[pn].enti.q<=player[pn].enti.spt)\r
                                {\r
                                        INC_PER_FRAME;\r
                                        animatePlayer(pip, player, pn, 1);\r
@@ -137,42 +137,42 @@ void walk(map_view_t *pip, player_t *player, word pn)
                                        //mapScrollDown(pip, player, !(pip[0].video->p), pn);\r
                                        mapScrollDown(pip, player, (pip[0].video->p), pn);\r
                                        if(!pageflipflop) modexShowPage(pip[1].page);\r
-                                       player[pn].q++;\r
+                                       player[pn].enti.q++;\r
                                        //0000pip[0].video->clk = ((*clockw)-pip[0].video->startclk)/18.2;\r
-                               } else { player[pn].q = 1; player[pn].d = 2; player[pn].ty++; }\r
+                               } else { player[pn].enti.q = 1; player[pn].enti.d = 2; player[pn].enti.ty++; }\r
                        }\r
-                       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))\r
+                       else if(player[pn].enti.ty < pip[0].map->height && !(pip[0].map->data[(player[pn].enti.tx-1)+(pip[0].map->width*(player[pn].enti.ty))] == 0))//!(player[pn].enti.tx == TRIGGX && player[pn].enti.ty+1 == TRIGGY))\r
                        {\r
-                               if(player[pn].q<=player[pn].spt)\r
+                               if(player[pn].enti.q<=player[pn].enti.spt)\r
                                {\r
                                        INC_PER_FRAME;\r
-                                       player[pn].y+=(player[pn].speed);\r
+                                       player[pn].enti.y+=(player[pn].enti.speed);\r
                                        animatePlayer(pip, player, pn, 0);\r
                                        if(!pageflipflop) modexShowPage(pip[1].page);\r
-                                       player[pn].q++;\r
-                               } else { player[pn].q = 1; player[pn].d = 2; player[pn].ty++; }\r
+                                       player[pn].enti.q++;\r
+                               } else { player[pn].enti.q = 1; player[pn].enti.d = 2; player[pn].enti.ty++; }\r
                        }\r
                        else\r
                        {\r
-                               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);\r
+                               if(!pageflipflop) modexCopyPageRegion(pip[1].page, pip[0].page, player[pn].enti.x, player[pn].enti.y-TILEWH, player[pn].enti.x, player[pn].enti.y-TILEWH, 24, 32);\r
 #ifdef SPRITE\r
-                               modexDrawSpriteRegion(pip[0].page, player[pn].x, player[pn].y-TILEWH, 24, 64, 24, 32, PLAYERBMPDATAPTR);\r
+                               modexDrawSpriteRegion(pip[0].page, player[pn].enti.x, player[pn].enti.y-TILEWH, 24, 64, 24, 32, PLAYERBMPDATAPTR);\r
 #else\r
-                               modexClearRegion(pip[1].page, player[pn].x, player[pn].y-TILEWH, 24, 32, 9);\r
+                               modexClearRegion(pip[1].page, player[pn].enti.x, player[pn].enti.y-TILEWH, 24, 32, 9);\r
 #endif\r
                                if(!pageflipflop) modexShowPage(pip[1].page);\r
-                               player[pn].d = 2;\r
+                               player[pn].enti.d = 2;\r
                        }\r
-                       player[pn].triggerx = player[pn].tx;\r
-                       player[pn].triggery = player[pn].ty+1;\r
+                       player[pn].enti.triggerx = player[pn].enti.tx;\r
+                       player[pn].enti.triggery = player[pn].enti.ty+1;\r
                break;\r
 \r
                //up movement\r
                case 0:\r
-                       if(pip[0].ty > 0 && pip[0].ty+pip[0].page->th <= pip[0].map->height && player[pn].ty == pip[0].ty+pip[0].page->tilemidposscreeny &&\r
-                       !(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))    //collision detection!\r
+                       if(pip[0].ty > 0 && pip[0].ty+pip[0].page->th <= pip[0].map->height && player[pn].enti.ty == pip[0].ty+pip[0].page->tilemidposscreeny &&\r
+                       !(pip[0].map->data[(player[pn].enti.tx-1)+(pip[0].map->width*(player[pn].enti.ty-2))] == 0))//!(player[pn].enti.tx == TRIGGX && player[pn].enti.ty-1 == TRIGGY))        //collision detection!\r
                        {\r
-                               if(player[pn].q<=player[pn].spt)\r
+                               if(player[pn].enti.q<=player[pn].enti.spt)\r
                                {\r
                                        INC_PER_FRAME;\r
                                        animatePlayer(pip, player, pn, 1);\r
@@ -181,34 +181,34 @@ void walk(map_view_t *pip, player_t *player, word pn)
                                        //mapScrollUp(pip, player, !(pip[0].video->p), pn);\r
                                        mapScrollUp(pip, player, (pip[0].video->p), pn);\r
                                        if(!pageflipflop) modexShowPage(pip[1].page);\r
-                                       player[pn].q++;\r
+                                       player[pn].enti.q++;\r
                                        //0000pip[0].video->clk = ((*clockw)-pip[0].video->startclk)/18.2;\r
-                               } else { player[pn].q = 1; player[pn].d = 2; player[pn].ty--; }\r
+                               } else { player[pn].enti.q = 1; player[pn].enti.d = 2; player[pn].enti.ty--; }\r
                        }\r
-                       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))\r
+                       else if(player[pn].enti.ty > 1 && !(pip[0].map->data[(player[pn].enti.tx-1)+(pip[0].map->width*(player[pn].enti.ty-2))] == 0))//!(player[pn].enti.tx == TRIGGX &&  player[pn].enti.ty-1 == TRIGGY))\r
                        {\r
-                               if(player[pn].q<=player[pn].spt)\r
+                               if(player[pn].enti.q<=player[pn].enti.spt)\r
                                {\r
                                        INC_PER_FRAME;\r
-                                       player[pn].y-=(player[pn].speed);\r
+                                       player[pn].enti.y-=(player[pn].enti.speed);\r
                                        animatePlayer(pip, player, 0, pn);\r
                                        if(!pageflipflop) modexShowPage(pip[1].page);\r
-                                       player[pn].q++;\r
-                               } else { player[pn].q = 1; player[pn].d = 2; player[pn].ty--; }\r
+                                       player[pn].enti.q++;\r
+                               } else { player[pn].enti.q = 1; player[pn].enti.d = 2; player[pn].enti.ty--; }\r
                        }\r
                        else\r
                        {\r
-                               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);\r
+                               if(!pageflipflop) modexCopyPageRegion(pip[1].page, pip[0].page, player[pn].enti.x, player[pn].enti.y-TILEWH, player[pn].enti.x, player[pn].enti.y-TILEWH, 24, 32);\r
 #ifdef SPRITE\r
-                               modexDrawSpriteRegion(pip[0].page, player[pn].x, player[pn].y-TILEWH, 24, 0, 24, 32, PLAYERBMPDATAPTR);\r
+                               modexDrawSpriteRegion(pip[0].page, player[pn].enti.x, player[pn].enti.y-TILEWH, 24, 0, 24, 32, PLAYERBMPDATAPTR);\r
 #else\r
-                               modexClearRegion(pip[1].page, player[pn].x, player[pn].y-TILEWH, 24, 32, 12);\r
+                               modexClearRegion(pip[1].page, player[pn].enti.x, player[pn].enti.y-TILEWH, 24, 32, 12);\r
 #endif\r
                                if(!pageflipflop) modexShowPage(pip[1].page);\r
-                               player[pn].d = 2;\r
+                               player[pn].enti.d = 2;\r
                        }\r
-                       player[pn].triggerx = player[pn].tx;\r
-                       player[pn].triggery = player[pn].ty-1;\r
+                       player[pn].enti.triggerx = player[pn].enti.tx;\r
+                       player[pn].enti.triggery = player[pn].enti.ty-1;\r
                break;\r
        }\r
 }\r
@@ -225,8 +225,8 @@ src/lib/scroll16.c: mv->video->r=1;
 \r
 void ZC_walk(map_view_t *pip, player_t *player, word pn)\r
 {\r
-       #define INC_PER_FRAME if(player[pn].q&1) player[pn].persist_aniframe++; if(player[pn].persist_aniframe>4) player[pn].persist_aniframe = 1;\r
-       switch(player[pn].d)\r
+       #define INC_PER_FRAME if(player[pn].enti.q&1) player[pn].enti.persist_aniframe++; if(player[pn].enti.persist_aniframe>4) player[pn].enti.persist_aniframe = 1;\r
+       switch(player[pn].enti.d)\r
        {\r
                //no direction\r
                case 2:\r
@@ -234,155 +234,155 @@ void ZC_walk(map_view_t *pip, player_t *player, word pn)
                break;\r
                //right movement\r
                case 3:\r
-                       if(pip[0].tx >= 0 && pip[0].tx+pip[0].page->tw < pip[0].map->width && player[pn].tx == pip[0].tx+pip[0].page->tilemidposscreenx &&\r
-                       !(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))      //collision detection!\r
+                       if(pip[0].tx >= 0 && pip[0].tx+pip[0].page->tw < pip[0].map->width && player[pn].enti.tx == pip[0].tx+pip[0].page->tilemidposscreenx &&\r
+                       !(pip[0].map->data[(player[pn].enti.tx)+(pip[0].map->width*(player[pn].enti.ty-1))] == 0))//!(player[pn].enti.tx+1 == TRIGGX && player[pn].enti.ty == TRIGGY))  //collision detection!\r
                        {\r
-                               if(player[pn].q<=player[pn].spt)\r
+                               if(player[pn].enti.q<=player[pn].enti.spt)\r
                                {\r
                                        INC_PER_FRAME;\r
                                        animatePlayer(pip, player, pn, 1);\r
                                        ScrollRight(pip, player, 3, pn);\r
                                        ScrollRight(pip, player, 2, pn);\r
                                        mapScrollRight(pip, player, (pip[0].video->p), pn);\r
-                                       player[pn].q++;\r
+                                       player[pn].enti.q++;\r
                                        //0000pip[0].video->clk = ((*clockw)-pip[0].video->startclk)/18.2;\r
-                               } else { player[pn].q = 1; player[pn].d = 2; player[pn].tx++; }\r
+                               } else { player[pn].enti.q = 1; player[pn].enti.d = 2; player[pn].enti.tx++; }\r
                        }\r
-                       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))\r
+                       else if(player[pn].enti.tx < pip[0].map->width && !(pip[0].map->data[(player[pn].enti.tx)+(pip[0].map->width*(player[pn].enti.ty-1))] == 0))//!(player[pn].enti.tx+1 == TRIGGX && player[pn].enti.ty == TRIGGY))\r
                        {\r
-                               if(player[pn].q<=player[pn].spt)\r
+                               if(player[pn].enti.q<=player[pn].enti.spt)\r
                                {\r
                                        INC_PER_FRAME;\r
-                                       player[pn].x+=(player[pn].speed);\r
+                                       player[pn].enti.x+=(player[pn].enti.speed);\r
                                        animatePlayer(pip, player, pn, 0);\r
-                                       player[pn].q++;\r
-                               } else { player[pn].q = 1; player[pn].d = 2; player[pn].tx++; }\r
+                                       player[pn].enti.q++;\r
+                               } else { player[pn].enti.q = 1; player[pn].enti.d = 2; player[pn].enti.tx++; }\r
                        }\r
                        else\r
                        {\r
 #ifdef SPRITE\r
-                               modexDrawSpriteRegion(pip[0].page, player[pn].x, player[pn].y-TILEWH, 24, 32, 24, 32, PLAYERBMPDATAPTR);\r
+                               modexDrawSpriteRegion(pip[0].page, player[pn].enti.x, player[pn].enti.y-TILEWH, 24, 32, 24, 32, PLAYERBMPDATAPTR);\r
 #else\r
-                               modexClearRegion(pip[1].page, player[pn].x, player[pn].y-TILEWH, 24, 32, 14);\r
+                               modexClearRegion(pip[1].page, player[pn].enti.x, player[pn].enti.y-TILEWH, 24, 32, 14);\r
 #endif\r
-                               player[pn].d = 2;\r
+                               player[pn].enti.d = 2;\r
                        }\r
-                       player[pn].triggerx = player[pn].tx+1;\r
-                       player[pn].triggery = player[pn].ty;\r
+                       player[pn].enti.triggerx = player[pn].enti.tx+1;\r
+                       player[pn].enti.triggery = player[pn].enti.ty;\r
                break;\r
                //left movement\r
                case 1:\r
-                       if(pip[0].tx > 0 && pip[0].tx+pip[0].page->tw <= pip[0].map->width && player[pn].tx == pip[0].tx+pip[0].page->tilemidposscreenx &&\r
-                       !(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))    //collision detection!\r
+                       if(pip[0].tx > 0 && pip[0].tx+pip[0].page->tw <= pip[0].map->width && player[pn].enti.tx == pip[0].tx+pip[0].page->tilemidposscreenx &&\r
+                       !(pip[0].map->data[(player[pn].enti.tx-2)+(pip[0].map->width*(player[pn].enti.ty-1))] == 0))//!(player[pn].enti.tx-1 == TRIGGX && player[pn].enti.ty == TRIGGY))        //collision detection!\r
                        {\r
-                               if(player[pn].q<=player[pn].spt)\r
+                               if(player[pn].enti.q<=player[pn].enti.spt)\r
                                {\r
                                        INC_PER_FRAME;\r
                                        animatePlayer(pip, player, pn, 1);\r
                                        ScrollLeft(pip, player, 3, pn);\r
                                        ScrollLeft(pip, player, 2, pn);\r
                                        mapScrollLeft(pip, player, (pip[0].video->p), pn);\r
-                                       player[pn].q++;\r
+                                       player[pn].enti.q++;\r
                                        //0000pip[0].video->clk = ((*clockw)-pip[0].video->startclk)/18.2;\r
-                               } else { player[pn].q = 1; player[pn].d = 2; player[pn].tx--; }\r
+                               } else { player[pn].enti.q = 1; player[pn].enti.d = 2; player[pn].enti.tx--; }\r
                        }\r
-                       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))\r
+                       else if(player[pn].enti.tx > 1 && !(pip[0].map->data[(player[pn].enti.tx-2)+(pip[0].map->width*(player[pn].enti.ty-1))] == 0))//!(player[pn].enti.tx-1 == TRIGGX && player[pn].enti.ty == TRIGGY))\r
                        {\r
-                               if(player[pn].q<=player[pn].spt)\r
+                               if(player[pn].enti.q<=player[pn].enti.spt)\r
                                {\r
                                        INC_PER_FRAME;\r
-                                       player[pn].x-=(player[pn].speed);\r
+                                       player[pn].enti.x-=(player[pn].enti.speed);\r
                                        animatePlayer(pip, player, pn, 0);\r
-                                       player[pn].q++;\r
-                               } else { player[pn].q = 1; player[pn].d = 2; player[pn].tx--; }\r
+                                       player[pn].enti.q++;\r
+                               } else { player[pn].enti.q = 1; player[pn].enti.d = 2; player[pn].enti.tx--; }\r
                        }\r
                        else\r
                        {\r
 #ifdef SPRITE\r
-                               modexDrawSpriteRegion(pip[0].page, player[pn].x, player[pn].y-TILEWH, 24, 96, 24, 32, PLAYERBMPDATAPTR);\r
+                               modexDrawSpriteRegion(pip[0].page, player[pn].enti.x, player[pn].enti.y-TILEWH, 24, 96, 24, 32, PLAYERBMPDATAPTR);\r
 #else\r
-                               modexClearRegion(pip[1].page, player[pn].x, player[pn].y-TILEWH, 24, 32, 10);\r
+                               modexClearRegion(pip[1].page, player[pn].enti.x, player[pn].enti.y-TILEWH, 24, 32, 10);\r
 #endif\r
-                               player[pn].d = 2;\r
+                               player[pn].enti.d = 2;\r
                        }\r
-                       player[pn].triggerx = player[pn].tx-1;\r
-                       player[pn].triggery = player[pn].ty;\r
+                       player[pn].enti.triggerx = player[pn].enti.tx-1;\r
+                       player[pn].enti.triggery = player[pn].enti.ty;\r
                break;\r
                //down movement\r
                case 4:\r
-                       if(pip[0].ty >= 0 && pip[0].ty+pip[0].page->th < pip[0].map->height && player[pn].ty == pip[0].ty+pip[0].page->tilemidposscreeny &&\r
-                       !(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))      //collision detection!\r
+                       if(pip[0].ty >= 0 && pip[0].ty+pip[0].page->th < pip[0].map->height && player[pn].enti.ty == pip[0].ty+pip[0].page->tilemidposscreeny &&\r
+                       !(pip[0].map->data[(player[pn].enti.tx-1)+(pip[0].map->width*(player[pn].enti.ty))] == 0))//!(player[pn].enti.tx == TRIGGX && player[pn].enti.ty+1 == TRIGGY))  //collision detection!\r
                        {\r
-                               if(player[pn].q<=player[pn].spt)\r
+                               if(player[pn].enti.q<=player[pn].enti.spt)\r
                                {\r
                                        INC_PER_FRAME;\r
                                        animatePlayer(pip, player, pn, 1);\r
                                        ScrollDown(pip, player, 3, pn);\r
                                        ScrollDown(pip, player, 2, pn);\r
                                        mapScrollDown(pip, player, (pip[0].video->p), pn);\r
-                                       player[pn].q++;\r
+                                       player[pn].enti.q++;\r
                                        //0000pip[0].video->clk = ((*clockw)-pip[0].video->startclk)/18.2;\r
-                               } else { player[pn].q = 1; player[pn].d = 2; player[pn].ty++; }\r
+                               } else { player[pn].enti.q = 1; player[pn].enti.d = 2; player[pn].enti.ty++; }\r
                        }\r
-                       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))\r
+                       else if(player[pn].enti.ty < pip[0].map->height && !(pip[0].map->data[(player[pn].enti.tx-1)+(pip[0].map->width*(player[pn].enti.ty))] == 0))//!(player[pn].enti.tx == TRIGGX && player[pn].enti.ty+1 == TRIGGY))\r
                        {\r
-                               if(player[pn].q<=player[pn].spt)\r
+                               if(player[pn].enti.q<=player[pn].enti.spt)\r
                                {\r
                                        INC_PER_FRAME;\r
-                                       player[pn].y+=(player[pn].speed);\r
+                                       player[pn].enti.y+=(player[pn].enti.speed);\r
                                        animatePlayer(pip, player, pn, 0);\r
-                                       player[pn].q++;\r
-                               } else { player[pn].q = 1; player[pn].d = 2; player[pn].ty++; }\r
+                                       player[pn].enti.q++;\r
+                               } else { player[pn].enti.q = 1; player[pn].enti.d = 2; player[pn].enti.ty++; }\r
                        }\r
                        else\r
                        {\r
 #ifdef SPRITE\r
-                               modexDrawSpriteRegion(pip[0].page, player[pn].x, player[pn].y-TILEWH, 24, 64, 24, 32, PLAYERBMPDATAPTR);\r
+                               modexDrawSpriteRegion(pip[0].page, player[pn].enti.x, player[pn].enti.y-TILEWH, 24, 64, 24, 32, PLAYERBMPDATAPTR);\r
 #else\r
-                               modexClearRegion(pip[1].page, player[pn].x, player[pn].y-TILEWH, 24, 32, 9);\r
+                               modexClearRegion(pip[1].page, player[pn].enti.x, player[pn].enti.y-TILEWH, 24, 32, 9);\r
 #endif\r
-                               player[pn].d = 2;\r
+                               player[pn].enti.d = 2;\r
                        }\r
-                       player[pn].triggerx = player[pn].tx;\r
-                       player[pn].triggery = player[pn].ty+1;\r
+                       player[pn].enti.triggerx = player[pn].enti.tx;\r
+                       player[pn].enti.triggery = player[pn].enti.ty+1;\r
                break;\r
                //up movement\r
                case 0:\r
-                       if(pip[0].ty > 0 && pip[0].ty+pip[0].page->th <= pip[0].map->height && player[pn].ty == pip[0].ty+pip[0].page->tilemidposscreeny &&\r
-                       !(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))    //collision detection!\r
+                       if(pip[0].ty > 0 && pip[0].ty+pip[0].page->th <= pip[0].map->height && player[pn].enti.ty == pip[0].ty+pip[0].page->tilemidposscreeny &&\r
+                       !(pip[0].map->data[(player[pn].enti.tx-1)+(pip[0].map->width*(player[pn].enti.ty-2))] == 0))//!(player[pn].enti.tx == TRIGGX && player[pn].enti.ty-1 == TRIGGY))        //collision detection!\r
                        {\r
-                               if(player[pn].q<=player[pn].spt)\r
+                               if(player[pn].enti.q<=player[pn].enti.spt)\r
                                {\r
                                        INC_PER_FRAME;\r
                                        animatePlayer(pip, player, pn, 1);\r
                                        ScrollUp(pip, player, 3, pn);\r
                                        ScrollUp(pip, player, 2, pn);\r
                                        mapScrollUp(pip, player, (pip[0].video->p), pn);\r
-                                       player[pn].q++;\r
+                                       player[pn].enti.q++;\r
                                        //0000pip[0].video->clk = ((*clockw)-pip[0].video->startclk)/18.2;\r
-                               } else { player[pn].q = 1; player[pn].d = 2; player[pn].ty--; }\r
+                               } else { player[pn].enti.q = 1; player[pn].enti.d = 2; player[pn].enti.ty--; }\r
                        }\r
-                       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))\r
+                       else if(player[pn].enti.ty > 1 && !(pip[0].map->data[(player[pn].enti.tx-1)+(pip[0].map->width*(player[pn].enti.ty-2))] == 0))//!(player[pn].enti.tx == TRIGGX &&  player[pn].enti.ty-1 == TRIGGY))\r
                        {\r
-                               if(player[pn].q<=player[pn].spt)\r
+                               if(player[pn].enti.q<=player[pn].enti.spt)\r
                                {\r
                                        INC_PER_FRAME;\r
-                                       player[pn].y-=(player[pn].speed);\r
+                                       player[pn].enti.y-=(player[pn].enti.speed);\r
                                        animatePlayer(pip, player, 0, pn);\r
-                                       player[pn].q++;\r
-                               } else { player[pn].q = 1; player[pn].d = 2; player[pn].ty--; }\r
+                                       player[pn].enti.q++;\r
+                               } else { player[pn].enti.q = 1; player[pn].enti.d = 2; player[pn].enti.ty--; }\r
                        }\r
                        else\r
                        {\r
 #ifdef SPRITE\r
-                               modexDrawSpriteRegion(pip[0].page, player[pn].x, player[pn].y-TILEWH, 24, 0, 24, 32, PLAYERBMPDATAPTR);\r
+                               modexDrawSpriteRegion(pip[0].page, player[pn].enti.x, player[pn].enti.y-TILEWH, 24, 0, 24, 32, PLAYERBMPDATAPTR);\r
 #else\r
-                               modexClearRegion(pip[1].page, player[pn].x, player[pn].y-TILEWH, 24, 32, 12);\r
+                               modexClearRegion(pip[1].page, player[pn].enti.x, player[pn].enti.y-TILEWH, 24, 32, 12);\r
 #endif\r
-                               player[pn].d = 2;\r
+                               player[pn].enti.d = 2;\r
                        }\r
-                       player[pn].triggerx = player[pn].tx;\r
-                       player[pn].triggery = player[pn].ty-1;\r
+                       player[pn].enti.triggerx = player[pn].enti.tx;\r
+                       player[pn].enti.triggery = player[pn].enti.ty-1;\r
                break;\r
        }\r
 }\r
@@ -391,18 +391,18 @@ void ZC_walk(map_view_t *pip, player_t *player, word pn)
 void ZC_panPageManual(map_view_t *pip, player_t *player, word pn)\r
 {\r
 #define SHOWMVFUN_ ZC_ShowMV(pip, 0, 0);\r
-       switch(player[pn].d)\r
+       switch(player[pn].enti.d)\r
        {\r
                //right movement\r
                case 3:\r
                        if(pip[0].tx >= 0 && pip[0].tx+pip[0].page->tw < pip[0].page->tilesw)\r
                        {\r
-                               if(player[pn].q<=player[pn].spt)\r
+                               if(player[pn].enti.q<=player[pn].enti.spt)\r
                                {\r
                                        pip[0].page->dx+=4;\r
                                        SHOWMVFUN_;\r
-                                       player[pn].q++;\r
-                               } else { player[pn].q = 1; player[pn].d = 2; pip[0].tx++; }\r
+                                       player[pn].enti.q++;\r
+                               } else { player[pn].enti.q = 1; player[pn].enti.d = 2; pip[0].tx++; }\r
                        }\r
                break;\r
 \r
@@ -410,12 +410,12 @@ void ZC_panPageManual(map_view_t *pip, player_t *player, word pn)
                case 1:\r
                        if(pip[0].tx > 0 && pip[0].tx+pip[0].page->tw <= pip[0].page->tilesw)\r
                        {\r
-                               if(player[pn].q<=player[pn].spt)\r
+                               if(player[pn].enti.q<=player[pn].enti.spt)\r
                                {\r
                                        pip[0].page->dx-=4;\r
                                        SHOWMVFUN_;\r
-                                       player[pn].q++;\r
-                               } else { player[pn].q = 1; player[pn].d = 2; pip[0].tx--; }\r
+                                       player[pn].enti.q++;\r
+                               } else { player[pn].enti.q = 1; player[pn].enti.d = 2; pip[0].tx--; }\r
                        }\r
                break;\r
 \r
@@ -423,12 +423,12 @@ void ZC_panPageManual(map_view_t *pip, player_t *player, word pn)
                case 4:\r
                        if(pip[0].ty >= 0 && pip[0].ty+pip[0].page->th < pip[0].page->tilesh)\r
                        {\r
-                               if(player[pn].q<=player[pn].spt)\r
+                               if(player[pn].enti.q<=player[pn].enti.spt)\r
                                {\r
                                        pip[0].page->dy+=4;\r
                                        SHOWMVFUN_;\r
-                                       player[pn].q++;\r
-                               } else { player[pn].q = 1; player[pn].d = 2; pip[0].ty++; }\r
+                                       player[pn].enti.q++;\r
+                               } else { player[pn].enti.q = 1; player[pn].enti.d = 2; pip[0].ty++; }\r
                        }\r
                break;\r
 \r
@@ -436,12 +436,12 @@ void ZC_panPageManual(map_view_t *pip, player_t *player, word pn)
                case 0:\r
                        if(pip[0].ty > 0 && pip[0].ty+pip[0].page->th <= pip[0].page->tilesh)\r
                        {\r
-                               if(player[pn].q<=player[pn].spt)\r
+                               if(player[pn].enti.q<=player[pn].enti.spt)\r
                                {\r
                                        pip[0].page->dy-=4;\r
                                        SHOWMVFUN_;\r
-                                       player[pn].q++;\r
-                               } else { player[pn].q = 1; player[pn].d = 2; pip[0].ty--; }\r
+                                       player[pn].enti.q++;\r
+                               } else { player[pn].enti.q = 1; player[pn].enti.d = 2; pip[0].ty--; }\r
                        }\r
                break;\r
        }\r
@@ -614,7 +614,7 @@ void near mapScrollRight(map_view_t *mv, player_t *player, word id, word plid)
        word x;//, y;  /* coordinate for drawing */\r
 \r
        /* increment the pixel position and update the page */\r
-       mv[id].page[0].dx += player[plid].speed;\r
+       mv[id].page[0].dx += player[plid].enti.speed;\r
 \r
        /* check to see if this changes the tile */\r
        if(mv[id].page[0].dx >= mv[id].dxThresh )\r
@@ -629,7 +629,7 @@ void near mapScrollRight(map_view_t *mv, player_t *player, word id, word plid)
 \r
        /* draw the next column */\r
        x= mv[0].page->sw + mv[id].map->tiles->tileWidth;\r
-       if(player[plid].q%4)\r
+       if(player[plid].enti.q%4)\r
                if(id==0)\r
                        mapDrawCol(&mv[0], mv[0].tx + mv[0].page->tw, mv[0].ty-1, x, player, mv->page[0].dx);\r
                else\r
@@ -644,7 +644,7 @@ void near mapScrollLeft(map_view_t *mv, player_t *player, word id, word plid)
        word x;//,y;  /* coordinate for drawing */\r
 \r
        /* decrement the pixel position and update the page */\r
-       mv[id].page[0].dx -= player[plid].speed;\r
+       mv[id].page[0].dx -= player[plid].enti.speed;\r
 \r
        /* check to see if this changes the tile */\r
        if(mv[id].page[0].dx == 0)\r
@@ -659,7 +659,7 @@ void near mapScrollLeft(map_view_t *mv, player_t *player, word id, word plid)
 \r
        /* draw the next column */\r
        x= 0;\r
-       if(player[plid].q%4)\r
+       if(player[plid].enti.q%4)\r
                if(id==0)\r
                        mapDrawCol(&mv[0], mv[0].tx - 1, mv[0].ty-1, x, player, mv->page[0].dx);\r
                else\r
@@ -674,7 +674,7 @@ void near mapScrollUp(map_view_t *mv, player_t *player, word id, word plid)
        word y;//x,  /* coordinate for drawing */\r
 \r
        /* decrement the pixel position and update the page */\r
-       mv[id].page[0].dy -= player[plid].speed;\r
+       mv[id].page[0].dy -= player[plid].enti.speed;\r
 \r
        /* check to see if this changes the tile */\r
        if(mv[id].page[0].dy == 0 )\r
@@ -689,7 +689,7 @@ void near mapScrollUp(map_view_t *mv, player_t *player, word id, word plid)
 \r
        /* draw the next row */\r
        y= 0;\r
-       if(player[plid].q%3)\r
+       if(player[plid].enti.q%3)\r
                if(id==0)\r
                        mapDrawRow(&mv[0], mv[0].tx - 1, mv[0].ty-1, y, player, mv->page[0].dy);\r
                else\r
@@ -703,7 +703,7 @@ void near mapScrollDown(map_view_t *mv, player_t *player, word id, word plid)
        word y;//x,  /* coordinate for drawing */\r
 \r
        /* increment the pixel position and update the page */\r
-       mv[id].page[0].dy += player[plid].speed;\r
+       mv[id].page[0].dy += player[plid].enti.speed;\r
 \r
        /* check to see if this changes the tile */\r
        if(mv[id].page[0].dy >= mv[id].dyThresh )\r
@@ -718,7 +718,7 @@ void near mapScrollDown(map_view_t *mv, player_t *player, word id, word plid)
 \r
        /* draw the next row */\r
        y= mv[0].page->sh + mv[id].map->tiles->tileHeight;\r
-       if(player[plid].q%3)\r
+       if(player[plid].enti.q%3)\r
                if(id==0)\r
                        mapDrawRow(&mv[0], mv[0].tx - 1, mv[0].ty+mv[0].page->th, y, player, mv->page[0].dy);\r
                else\r
@@ -732,7 +732,7 @@ void near mapScrollDown(map_view_t *mv, player_t *player, word id, word plid)
 void near ScrollRight(map_view_t *mv, player_t *player, word id, word plid)\r
 {\r
        /* increment the pixel position and update the page */\r
-       mv[id].page->dx += player[plid].speed;\r
+       mv[id].page->dx += player[plid].enti.speed;\r
 \r
        /* check to see if this changes the tile */\r
        if(mv[id].page->dx >= mv[0].dxThresh )\r
@@ -749,7 +749,7 @@ void near ScrollRight(map_view_t *mv, player_t *player, word id, word plid)
 void near ScrollLeft(map_view_t *mv, player_t *player, word id, word plid)\r
 {\r
        /* decrement the pixel position and update the page */\r
-       mv[id].page->dx -= player[plid].speed;\r
+       mv[id].page->dx -= player[plid].enti.speed;\r
 \r
        /* check to see if this changes the tile */\r
        if(mv[id].page->dx == 0)\r
@@ -766,7 +766,7 @@ void near ScrollLeft(map_view_t *mv, player_t *player, word id, word plid)
 void near ScrollUp(map_view_t *mv, player_t *player, word id, word plid)\r
 {\r
        /* decrement the pixel position and update the page */\r
-       mv[id].page->dy -= player[plid].speed;\r
+       mv[id].page->dy -= player[plid].enti.speed;\r
 \r
        /* check to see if this changes the tile */\r
        if(mv[id].page->dy == 0)\r
@@ -783,7 +783,7 @@ void near ScrollUp(map_view_t *mv, player_t *player, word id, word plid)
 void near ScrollDown(map_view_t *mv, player_t *player, word id, word plid)\r
 {\r
        /* increment the pixel position and update the page */\r
-       mv[id].page->dy += player[plid].speed;\r
+       mv[id].page->dy += player[plid].enti.speed;\r
 \r
        /* check to see if this changes the tile */\r
        if(mv[id].page->dy >= mv[0].dxThresh )\r
@@ -802,8 +802,8 @@ void near ScrollDown(map_view_t *mv, player_t *player, word id, word plid)
 //default player position on the viewable map\r
 void playerXYpos(int x, int y, player_t *player, map_view_t *pip, nibble pn)\r
 {\r
-       player[pn].tx = x + pip[0].tx + pip[0].page->tilemidposscreenx;\r
-       player[pn].ty = y + pip[0].ty + pip[0].page->tilemidposscreeny;\r
+       player[pn].enti.tx = x + pip[0].tx + pip[0].page->tilemidposscreenx;\r
+       player[pn].enti.ty = y + pip[0].ty + pip[0].page->tilemidposscreeny;\r
 }\r
 //===========================================================================\r
 \r
@@ -948,11 +948,11 @@ mapDrawTile(tiles_t *t, word i, page_t *page, word x, word y)
        }\r
 }\r
 \r
-void near mapDrawRow(map_view_t *mv, int tx, int ty, word y, player_t *p, word poopoffset)\r
+void near mapDrawRow(map_view_t *mv, int tx, int ty, word y, player_t *player, word poopoffset)\r
 {\r
        word x;\r
        int i;\r
-       poopoffset%=p[0].speed;\r
+       poopoffset%=player[0].enti.speed;\r
 //printf("y: %d\n", poopoffset);\r
        /* the position within the map array */\r
        i=ty * mv->map->width + tx;\r
@@ -965,11 +965,11 @@ void near mapDrawRow(map_view_t *mv, int tx, int ty, word y, player_t *p, word p
        }\r
 }\r
 \r
-void near mapDrawCol(map_view_t *mv, int tx, int ty, word x, player_t *p, word poopoffset)\r
+void near mapDrawCol(map_view_t *mv, int tx, int ty, word x, player_t *player, word poopoffset)\r
 {\r
        int y;\r
        int i;\r
-       poopoffset%=p[0].speed;\r
+       poopoffset%=player[0].enti.speed;\r
 //printf("x: %d\n", poopoffset);\r
        /* location in the map array */\r
        i=ty * mv->map->width + tx;\r
@@ -1095,15 +1095,27 @@ void shinku(global_game_variables_t *gv)
        }\r
 }\r
 \r
+#ifdef SPRITE\r
+#define FRAME1 modexDrawSpriteRegion(pip[/*!*/(pip->video->p)].page, x, y, 48, dire, 24, 32,   PLAYERBMPDATAPTR);\r
+#define FRAME2 modexDrawSpriteRegion(pip[/*!*/(pip->video->p)].page, x, y, 24, dire, 24, 32,   PLAYERBMPDATAPTR);\r
+#define FRAME3 modexDrawSpriteRegion(pip[/*!*/(pip->video->p)].page, x, y, 0, dire, 24, 32,    PLAYERBMPDATAPTR);\r
+#define FRAME4 modexDrawSpriteRegion(pip[/*!*/(pip->video->p)].page, x, y, 24, dire, 24, 32,   PLAYERBMPDATAPTR);\r
+#else\r
+#define FRAME1 modexClearRegion(pip[/*!*/(pip->video->p)].page, x, y, 24, 32, 2+dire);\r
+#define FRAME2 modexClearRegion(pip[/*!*/(pip->video->p)].page, x, y, 24, 32, 1+dire);\r
+#define FRAME3 modexClearRegion(pip[/*!*/(pip->video->p)].page, x, y, 24, 32, dire);\r
+#define FRAME4 modexClearRegion(pip[/*!*/(pip->video->p)].page, x, y, 24, 32, 1+dire);\r
+#endif\r
+\r
 void near animatePlayer(map_view_t *pip, player_t *player, word pn, sword scrollswitch)\r
 {\r
-       sword x = player[pn].x;\r
-       sword y = player[pn].y;\r
+       sword x = player[pn].enti.x;\r
+       sword y = player[pn].enti.y;\r
        sword bx = x+16;        //buffer's x\r
        sword by = y+16;        //buffer's y\r
        word dire=32; //direction\r
        sword qq; //scroll offset\r
-       word ls = player[pn].persist_aniframe;\r
+       word ls = player[pn].enti.persist_aniframe;\r
 \r
        switch(scrollswitch)\r
        {\r
@@ -1111,22 +1123,22 @@ void near animatePlayer(map_view_t *pip, player_t *player, word pn, sword scroll
                        qq = 0;\r
                break;\r
                default:\r
-                       qq = ((player[pn].q)*(player[pn].speed));\r
+                       qq = ((player[pn].enti.q)*(player[pn].enti.speed));\r
                break;\r
        }\r
        //x-=4;\r
        y-=pip[0].map->tiles->tileHeight;\r
-       switch (player[pn].d)\r
+       switch (player[pn].enti.d)\r
        {\r
                case 0:\r
                        //up\r
-                       dire*=player[pn].d;\r
+                       dire*=player[pn].enti.d;\r
                        y-=qq;\r
                        by-=4;\r
                break;\r
                case 3:\r
                        // right\r
-                       dire*=(player[pn].d-2);\r
+                       dire*=(player[pn].enti.d-2);\r
                        x+=qq;\r
                        bx+=4;\r
                break;\r
@@ -1134,29 +1146,106 @@ void near animatePlayer(map_view_t *pip, player_t *player, word pn, sword scroll
                break;\r
                case 4:\r
                        //down\r
-                       dire*=(player[pn].d-2);\r
+                       dire*=(player[pn].enti.d-2);\r
                        y+=qq;\r
                        by+=4;\r
                break;\r
                case 1:\r
                        //left\r
-                       dire*=(player[pn].d+2);\r
+                       dire*=(player[pn].enti.d+2);\r
+                       x-=qq;\r
+                       bx-=4;\r
+               break;\r
+       }\r
+\r
+       if(!pageflipflop)\r
+               modexCopyPageRegion(pip[1].page, pip[0].page, x-4, y-4, x-4, y-4, 28, 36);\r
+       else{\r
+               //copy old bg to page0\r
+               //modexCopyPageRegion(pip[3].page, pip[0].page, bx, by, 0, 0,   20, 36);\r
+               //update buffer\r
+               //modexCopyPageRegion(pip[0].page, pip[3].page, 0, 0,   x, y,   20, 36);\r
+       }\r
+//modexCopyPageRegion(page_t *dest, page_t *src, word sx, word sy, word dx, word dy, word width, word height);\r
+       //modexCopyPageRegion(pip[3].page, pip[!(pip->video->p)].page, x-4, y-4, 0, 128, 28, 36);\r
+       /*modexCopyPageRegion(pip[pip->video->p].page,\r
+ pip[!(pip->video->p)].page, x-4, y-4, x-4, y-4, 28, 36);*/\r
+//     else modexCopyPageRegion(pip[1].page, pip[0].page, x-4, y-4, x-4, y-4, 28, 40);\r
+       switch(ls)\r
+       {\r
+               case 1:\r
+                       FRAME1\r
+               break;\r
+               case 2:\r
+                       FRAME2\r
+               break;\r
+               case 3:\r
+                       FRAME3\r
+               break;\r
+               case 4:\r
+                       FRAME4\r
+               break;\r
+       }\r
+//     if(2>ls && ls>=1) { FRAME1 }else\r
+//     if(3>ls && ls>=2) { FRAME2 }else\r
+//     if(4>ls && ls>=3) { FRAME3 }else\r
+//     if(5>ls && ls>=4) { FRAME4 }\r
+       //modexCopyPageRegion(pip[0].page, pip[3].page, 0, 0, x, y, 24, 32);\r
+       //printf("x=%d  y=%d    bx=%d           by=%d\n", x, y, bx, by);\r
+       pip->video->r=1;\r
+}\r
+\r
+void near ZC_animatePlayer(map_view_t *pip, player_t *player, word pn, sword scrollswitch)\r
+{\r
+       sword x = player[pn].enti.x;\r
+       sword y = player[pn].enti.y;\r
+       sword bx = x+16;        //buffer's x\r
+       sword by = y+16;        //buffer's y\r
+       word dire=32; //direction\r
+       sword qq; //scroll offset\r
+       word ls = player[pn].enti.persist_aniframe;\r
+\r
+       switch(scrollswitch)\r
+       {\r
+               case 0:\r
+                       qq = 0;\r
+               break;\r
+               default:\r
+                       qq = ((player[pn].enti.q)*(player[pn].enti.speed));\r
+               break;\r
+       }\r
+       //x-=4;\r
+       y-=pip[0].map->tiles->tileHeight;\r
+       switch (player[pn].enti.d)\r
+       {\r
+               case 0:\r
+                       //up\r
+                       dire*=player[pn].enti.d;\r
+                       y-=qq;\r
+                       by-=4;\r
+               break;\r
+               case 3:\r
+                       // right\r
+                       dire*=(player[pn].enti.d-2);\r
+                       x+=qq;\r
+                       bx+=4;\r
+               break;\r
+               case 2:\r
+               break;\r
+               case 4:\r
+                       //down\r
+                       dire*=(player[pn].enti.d-2);\r
+                       y+=qq;\r
+                       by+=4;\r
+               break;\r
+               case 1:\r
+                       //left\r
+                       dire*=(player[pn].enti.d+2);\r
                        x-=qq;\r
                        bx-=4;\r
                break;\r
        }\r
 \r
-#ifdef SPRITE\r
-#define FRAME1 modexDrawSpriteRegion(pip[/*!*/(pip->video->p)].page, x, y, 48, dire, 24, 32,   PLAYERBMPDATAPTR);\r
-#define FRAME2 modexDrawSpriteRegion(pip[/*!*/(pip->video->p)].page, x, y, 24, dire, 24, 32,   PLAYERBMPDATAPTR);\r
-#define FRAME3 modexDrawSpriteRegion(pip[/*!*/(pip->video->p)].page, x, y, 0, dire, 24, 32,    PLAYERBMPDATAPTR);\r
-#define FRAME4 modexDrawSpriteRegion(pip[/*!*/(pip->video->p)].page, x, y, 24, dire, 24, 32,   PLAYERBMPDATAPTR);\r
-#else\r
-#define FRAME1 modexClearRegion(pip[/*!*/(pip->video->p)].page, x, y, 24, 32, 2+dire);\r
-#define FRAME2 modexClearRegion(pip[/*!*/(pip->video->p)].page, x, y, 24, 32, 1+dire);\r
-#define FRAME3 modexClearRegion(pip[/*!*/(pip->video->p)].page, x, y, 24, 32, dire);\r
-#define FRAME4 modexClearRegion(pip[/*!*/(pip->video->p)].page, x, y, 24, 32, 1+dire);\r
-#endif\r
        if(!pageflipflop)\r
                modexCopyPageRegion(pip[1].page, pip[0].page, x-4, y-4, x-4, y-4, 28, 36);\r
        else{\r
@@ -1243,7 +1332,7 @@ boolean ZC_walk2(entity_t *ent, map_view_t *map_v)
 \r
 void player_walk(player_t *player, map_view_t *map_v){\r
        int dx=16, dy=16;\r
-       if(ZC_walk2(player->ent, map_v) && boundary_check(map_v->tx, map_v->ty, dx, dy, map_v->map->width - 2*map_v->page->tilesw, map_v->map->height - 2*map_v->page->tilesh))\r
+       if(ZC_walk2(&(player->enti), map_v) && boundary_check(map_v->tx, map_v->ty, dx, dy, map_v->map->width - 2*map_v->page->tilesw, map_v->map->height - 2*map_v->page->tilesh))\r
        {\r
                mapScroll(map_v, player);\r
                // (Un)load stuff?\r