From 785c0951f7d623318d8b04f01793472d81d94a7d Mon Sep 17 00:00:00 2001 From: sparky4 Date: Wed, 4 May 2016 10:46:06 -0500 Subject: [PATCH] MORE WORK ON SCROLL wwwwwww --- SCROLL.16L | 224 +++------------------------------------------ scroll.smp | Bin 7411 -> 871 bytes src/lib/scroll16.c | 68 ++++++++------ src/scroll.c | 12 ++- 4 files changed, 57 insertions(+), 247 deletions(-) diff --git a/SCROLL.16L b/SCROLL.16L index 10d2d7ca..15a839fb 100755 --- a/SCROLL.16L +++ b/SCROLL.16L @@ -11,226 +11,26 @@ chkmap ok [2], vmem_remain=256 [3], video->page[i].pagesize=256 [3], vmem_remain=0 -player[0].d=2 -player[0].d=2 -player[0].d=2 -player[0].d=2 -player[0].d=2 -player[0].d=2 -player[0].d=2 -player[0].d=2 -player[0].d=2 -player[0].d=2 -player[0].d=2 -player[0].d=2 -player[0].d=2 -player[0].d=2 -player[0].d=3 -pip[0].page->tilesw=22 pip[0].page->tw=20 -player[0].d=3 -pip[0].page->tilesw=22 pip[0].page->tw=20 -player[0].d=3 -pip[0].page->tilesw=22 pip[0].page->tw=20 -player[0].d=3 -pip[0].page->tilesw=22 pip[0].page->tw=20 -player[0].d=3 -pip[0].page->tilesw=22 pip[0].page->tw=20 -player[0].d=2 -player[0].d=3 -pip[0].page->tilesw=22 pip[0].page->tw=20 -player[0].d=3 -pip[0].page->tilesw=22 pip[0].page->tw=20 -player[0].d=3 -pip[0].page->tilesw=22 pip[0].page->tw=20 -player[0].d=3 -pip[0].page->tilesw=22 pip[0].page->tw=20 -player[0].d=3 -pip[0].page->tilesw=22 pip[0].page->tw=20 -player[0].d=2 -player[0].d=3 -pip[0].page->tilesw=22 pip[0].page->tw=20 -player[0].d=3 -pip[0].page->tilesw=22 pip[0].page->tw=20 -player[0].d=3 -pip[0].page->tilesw=22 pip[0].page->tw=20 -player[0].d=3 -pip[0].page->tilesw=22 pip[0].page->tw=20 -player[0].d=3 -pip[0].page->tilesw=22 pip[0].page->tw=20 -player[0].d=2 -player[0].d=3 -pip[0].page->tilesw=22 pip[0].page->tw=20 -player[0].d=3 -pip[0].page->tilesw=22 pip[0].page->tw=20 -player[0].d=3 -pip[0].page->tilesw=22 pip[0].page->tw=20 -player[0].d=3 -pip[0].page->tilesw=22 pip[0].page->tw=20 -player[0].d=3 -pip[0].page->tilesw=22 pip[0].page->tw=20 -player[0].d=2 -player[0].d=3 -pip[0].page->tilesw=22 pip[0].page->tw=20 -player[0].d=3 -pip[0].page->tilesw=22 pip[0].page->tw=20 -player[0].d=3 -pip[0].page->tilesw=22 pip[0].page->tw=20 -player[0].d=3 -pip[0].page->tilesw=22 pip[0].page->tw=20 -player[0].d=3 -pip[0].page->tilesw=22 pip[0].page->tw=20 -player[0].d=2 -player[0].d=3 -pip[0].page->tilesw=22 pip[0].page->tw=20 -player[0].d=3 -pip[0].page->tilesw=22 pip[0].page->tw=20 -player[0].d=3 -pip[0].page->tilesw=22 pip[0].page->tw=20 -player[0].d=3 -pip[0].page->tilesw=22 pip[0].page->tw=20 -player[0].d=3 -pip[0].page->tilesw=22 pip[0].page->tw=20 -player[0].d=2 -player[0].d=2 -player[0].d=2 -player[0].d=4 -player[0].d=4 -player[0].d=4 -player[0].d=4 -player[0].d=4 -player[0].d=2 -player[0].d=4 -player[0].d=4 -player[0].d=4 -player[0].d=4 -player[0].d=4 -player[0].d=2 -player[0].d=4 -player[0].d=4 -player[0].d=4 -player[0].d=4 -player[0].d=4 -player[0].d=2 -player[0].d=4 -player[0].d=4 -player[0].d=4 -player[0].d=4 -player[0].d=4 -player[0].d=2 -player[0].d=4 -player[0].d=4 -player[0].d=4 -player[0].d=4 -player[0].d=4 -player[0].d=2 -player[0].d=2 -player[0].d=2 -player[0].d=2 -player[0].d=2 -player[0].d=2 -player[0].d=2 -player[0].d=2 -player[0].d=2 -player[0].d=2 -player[0].d=2 -player[0].d=2 -player[0].d=2 -player[0].d=2 -player[0].d=2 -player[0].d=2 -player[0].d=0 -player[0].d=0 -player[0].d=0 -player[0].d=0 -player[0].d=0 -player[0].d=2 -player[0].d=0 -player[0].d=0 -player[0].d=0 -player[0].d=0 -player[0].d=0 -player[0].d=2 -player[0].d=0 -player[0].d=0 -player[0].d=0 -player[0].d=0 -player[0].d=0 -player[0].d=2 -player[0].d=0 -player[0].d=0 -player[0].d=0 -player[0].d=0 -player[0].d=0 -player[0].d=2 -player[0].d=0 -player[0].d=0 -player[0].d=0 -player[0].d=0 -player[0].d=0 -player[0].d=2 -player[0].d=0 -player[0].d=0 -player[0].d=0 -player[0].d=0 -player[0].d=0 -player[0].d=2 -player[0].d=0 -player[0].d=0 -player[0].d=0 -player[0].d=0 -player[0].d=0 -player[0].d=2 -player[0].d=0 -player[0].d=0 -player[0].d=0 -player[0].d=0 -player[0].d=0 -player[0].d=2 -player[0].d=1 -player[0].d=1 -player[0].d=1 -player[0].d=1 -player[0].d=1 -player[0].d=2 -player[0].d=1 -player[0].d=1 -player[0].d=1 -player[0].d=1 -player[0].d=1 -player[0].d=2 -player[0].d=1 -player[0].d=1 -player[0].d=1 -player[0].d=1 -player[0].d=1 -player[0].d=2 -player[0].d=1 -player[0].d=1 -player[0].d=1 -player[0].d=1 -player[0].d=1 -player[0].d=2 -player[0].d=2 Project 16 scroll.exe. This is just a test file! -version May 3 2016 13:10:29 -tx: 2 -ty: 0 -player.x: 160 player.y: 80 -player.tx: 12 player.ty: 5 -player.triggx: 11 player.triggy: 5 +version May 4 2016 10:25:12 +tx: 15 +ty: 4 +player.x: 160 player.y: 128 +player.tx: 25 player.ty: 12 +player.triggx: 24 player.triggy: 12 player.hp: 4 player.q: 1 player.info.dir: 2 player.d: 2 pdir=1 -tile data value at player trigger position: 1 +tile data value at player trigger position: 3 Virtual Screen: 352x272 Screen: 320x240 virtual tile resolution: 22x17 tile resolution: 20x15 middle tile position: 10x8 video memory remaining: 0 -page [0]=(a000:0008) - [1]=(a000:5d88) - [2]=(a000:bb8c) - [3]=(a000:000c) -mv[1].tx: 2 mv[1].ty: 0 panswitch=0 +page [0]=(a000:163c) + [1]=(a000:73bc) + [2]=(a000:bd14) + [3]=(a000:010c) +mv[1].tx: 15 mv[1].ty: 4 panswitch=0 detected CPU type: 386 or newer diff --git a/scroll.smp b/scroll.smp index 96cd888f7ac8a66835ea44f7f08e7db9f561704f..1856e160aaaaa125934140aa4a04e11756b4366c 100755 GIT binary patch literal 871 zcmZuuze_?<6h1!E!Zbl`ae4(3JW|NPo`q0YIaLmk5H6AifgxByTYo|g4X!mb_+JD~ zO+gemSkPWu5VUm8`JxWkh5Oy_edoL9$9>i1tstA@AYCE;LeC=?z({8o0 z&6B3;NeY_F{fvBcod6f8FnixPRh(6fC>|?@QbhesB1Yu-cifHVUnq}HiS8)gsQx-b zG$>CbM30XM&yTCJCiuA`c(2X^5AOLdtD?j-I?1&>zo<%)%MZ#A>I`ah(G{hjIInmW z{ZkNy0uE2!IKhztPOE_TOit?rAFhsDs0hBKbD=u)Tb%+**vx_+pabnhwxV_R^nIW_ z;w5!PRELhbK;%Kx_J5|6Lbp*{3;uI;+8NynPTaLQzqH#A{qI({eq^>UK)l9i Ll-`~lXPWsp={LQ^ literal 7411 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, pn); else{ mapScrollRight(pip, player, 0, pn); mapScrollRight(pip, player, 1, pn); ScrollRight(pip, player, 2, pn); - ScrollRight(pip, player, 3, 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++; } @@ -61,7 +62,7 @@ void walk(map_view_t *pip, player_t *player, word pn) } else { - 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-4, player[pn].y-TILEWH, player[pn].x-4, player[pn].y-TILEWH, 24, 32); #ifdef SPRITE PBUFSFUN(pip[1].page, player[pn].x-4, player[pn].y-TILEWH, 24, 32, 24, 32, PLAYERBMPDATA); #else @@ -83,10 +84,11 @@ void walk(map_view_t *pip, player_t *player, word pn) { INC_PER_FRAME; animatePlayer(pip, player, pn, 1); + if(!pageflipflop) mapScrollLeft(pip, player, !(pip[0].video->p), pn); else{ mapScrollLeft(pip, player, 0, pn); mapScrollLeft(pip, player, 1, pn); ScrollLeft(pip, player, 2, pn); - ScrollLeft(pip, player, 3, 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--; } @@ -104,7 +106,7 @@ void walk(map_view_t *pip, player_t *player, word pn) } else { - 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-4, player[pn].y-TILEWH, player[pn].x-4, player[pn].y-TILEWH, 24, 32); #ifdef SPRITE PBUFSFUN(pip[1].page, player[pn].x-4, player[pn].y-TILEWH, 24, 96, 24, 32, PLAYERBMPDATA); #else @@ -126,10 +128,11 @@ void walk(map_view_t *pip, player_t *player, word pn) { INC_PER_FRAME; animatePlayer(pip, player, pn, 1); + if(!pageflipflop) mapScrollDown(pip, player, !(pip[0].video->p), pn); else{ mapScrollDown(pip, player, 0, pn); mapScrollDown(pip, player, 1, pn); ScrollDown(pip, player, 2, pn); - ScrollDown(pip, player, 3, 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++; } @@ -147,7 +150,7 @@ void walk(map_view_t *pip, player_t *player, word pn) } else { - 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-4, player[pn].y-TILEWH, player[pn].x-4, player[pn].y-TILEWH, 24, 32); #ifdef SPRITE PBUFSFUN(pip[1].page, player[pn].x-4, player[pn].y-TILEWH, 24, 64, 24, 32, PLAYERBMPDATA); #else @@ -169,10 +172,11 @@ void walk(map_view_t *pip, player_t *player, word pn) { INC_PER_FRAME; animatePlayer(pip, player, pn, 1); + if(!pageflipflop) mapScrollUp(pip, player, !(pip[0].video->p), pn); else{ mapScrollUp(pip, player, 0, pn); mapScrollUp(pip, player, 1, pn); ScrollUp(pip, player, 2, pn); - ScrollUp(pip, player, 3, 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--; } @@ -190,7 +194,7 @@ void walk(map_view_t *pip, player_t *player, word pn) } else { - 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-4, player[pn].y-TILEWH, player[pn].x-4, player[pn].y-TILEWH, 24, 32); #ifdef SPRITE PBUFSFUN(pip[1].page, player[pn].x-4, player[pn].y-TILEWH, 24, 0, 24, 32, PLAYERBMPDATA); #else @@ -372,11 +376,12 @@ void near mapScrollRight(map_view_t *mv, player_t *player, word id, word plid) /* draw the next column */ x= mv[0].page->sw + mv[id].map->tiles->tileWidth; if(player[plid].q%4) + if(pageflipflop){ if(id==0) mapDrawCol(&mv[0], mv[0].tx + mv[0].page->tw, mv[0].ty-1, x, player, mv->page->dx); else modexCopyPageRegion(mv[id].page, mv[0].page, x, 0, x, 0, mv[id].map->tiles->tileWidth, mv[id].map->tiles->tileHeight*(mv[0].page->th+2)); - //} + }else mapDrawCol(&mv[(!mv[0].video->p)], mv[0].tx + mv[0].page->tw, mv[0].ty-1, x, player, mv->page->dx); } @@ -401,11 +406,12 @@ void near mapScrollLeft(map_view_t *mv, player_t *player, word id, word plid) /* draw the next column */ x= 0; if(player[plid].q%4) + if(pageflipflop){ if(id==0) mapDrawCol(&mv[0], mv[0].tx - 1, mv[0].ty-1, x, player, mv->page->dx); else modexCopyPageRegion(mv[id].page, mv[0].page, x, 0, x, 0, mv[id].map->tiles->tileWidth, mv[id].map->tiles->tileHeight*(mv[0].page->th+2)); - //} + }else mapDrawCol(&mv[(!mv[0].video->p)], mv[0].tx - 1, mv[0].ty-1, x, player, mv->page->dx); } @@ -429,11 +435,12 @@ void near mapScrollUp(map_view_t *mv, player_t *player, word id, word plid) /* draw the next row */ y= 0; if(player[plid].q%3) + if(pageflipflop){ if(id==0) mapDrawRow(&mv[0], mv[0].tx - 1, mv[0].ty-1, y, player, mv->page->dy); else modexCopyPageRegion(mv[id].page, mv[0].page, 0, y, 0, y, mv[id].map->tiles->tileWidth*(mv[0].page->tw+2), mv[id].map->tiles->tileHeight); - //} + }else mapDrawRow(&mv[(!mv[0].video->p)], mv[0].tx - 1, mv[0].ty-1, y, player, mv->page->dy); } void near mapScrollDown(map_view_t *mv, player_t *player, word id, word plid) @@ -456,11 +463,12 @@ void near mapScrollDown(map_view_t *mv, player_t *player, word id, word plid) /* draw the next row */ y= mv[0].page->sh + mv[id].map->tiles->tileHeight; if(player[plid].q%3) + if(pageflipflop){ if(id==0) mapDrawRow(&mv[0], mv[0].tx - 1, mv[0].ty+mv[0].page->th, y, player, mv->page->dy); else modexCopyPageRegion(mv[id].page, mv[0].page, 0, y, 0, y, mv[id].map->tiles->tileWidth*(mv[0].page->tw+2), mv[id].map->tiles->tileHeight); - //} + }else mapDrawRow(&mv[(!mv[0].video->p)], mv[0].tx - 1, mv[0].ty+mv[0].page->th, y, player, mv->page->dy); } @@ -574,23 +582,24 @@ void mapGoTo(map_view_t *mv, int tx, int ty) unsigned int i; /* set up the coordinates */ - mv->tx = tx; - mv->ty = ty; - mv->page->dx = mv->map->tiles->tileWidth; - mv->page->dy = mv->map->tiles->tileHeight; + mv[0].tx = mv[1].tx = tx; + mv[0].ty = mv[1].ty = ty; + mv[0].page->dx = mv[1].page->dx = mv->map->tiles->tileWidth; + mv[0].page->dy = mv[1].page->dy = mv->map->tiles->tileHeight; /* set up the thresholds */ - mv->dxThresh = mv->map->tiles->tileWidth * 2; - mv->dyThresh = mv->map->tiles->tileHeight * 2; + mv[0].dxThresh = mv[1].dxThresh = mv->map->tiles->tileWidth * 2; + mv[0].dyThresh = mv[1].dyThresh = mv->map->tiles->tileHeight * 2; /* draw the tiles */ - modexClearRegion(mv->page, 0, 0, mv->page->width, mv->page->height, 0); + modexClearRegion(mv[0].page, 0, 0, mv[0].page->width, mv[0].page->height, 0); py=0; - i=mv->ty * mv->map->width + mv->tx; - for(ty=mv->ty-1; py < mv->page->sh+mv->dyThresh && ty < mv->map->height; ty++, py+=mv->map->tiles->tileHeight) { - mapDrawWRow(mv, tx-1, ty, py); + i=mv[0].ty * mv[0].map->width + mv[0].tx; + for(ty=mv[0].ty-1; py < mv[0].page->sh+mv->dyThresh && ty < mv[0].map->height; ty++, py+=mv[0].map->tiles->tileHeight) { + mapDrawWRow(&mv[0], tx-1, ty, py); i+=mv->map->width - tx; } + modexCopyPageRegion(mv[1].page, mv[0].page, 0, 0, 0, 0, mv[0].page->width, mv[0].page->height); } @@ -617,7 +626,7 @@ mapDrawTile(tiles_t *t, word i, page_t *page, word x, word y) case 0: #ifndef TILERENDER modexClearRegion(page, x, y, t->tileWidth, t->tileHeight, ((t->debug_data[i])+1)); - //cannot print number value du to it being slow as bakapee + modexprint(page, x, y, 1, 15, 0, (char const *)(t->debug_data[i])); #else PBUFBFUN (page, x, y, rx, ry, t->tileWidth, t->tileHeight, (t->data)); /* then the sprite. note modding ram ptr means we just draw to (x&3,0) */ @@ -724,8 +733,8 @@ boolean pageflipflop=0; /* sync */ void shinku(global_game_variables_t *gv) { - word x = (0) + gv->video.page[shinku_fps_indicator_page].dx; // follow the screen - word y = (0) + gv->video.page[shinku_fps_indicator_page].dy; // follow the screen + word x = (0) + gv->video.page[!(gv->video.p)].dx; // follow the screen + word y = (0) + gv->video.page[!(gv->video.p)].dy; // follow the screen word w = 64; word h = 8; word col = 7; @@ -745,7 +754,7 @@ void shinku(global_game_variables_t *gv) { sprintf(gv->pee, "%.0f fps", (double)gv->kurokku.tiku/ticktock(gv)); //modexClearRegion(&(gv->video.page[shinku_fps_indicator_page]), x, y, w, h, 45); - modexprint(&(gv->video.page[shinku_fps_indicator_page]), x, y, type, col, bgcol, gv->pee); + modexprint(&(gv->video.page[!(gv->video.p)]), x, y, type, col, bgcol, gv->pee); gv->kurokku.tiku=0; /* block copy to visible RAM from offscreen */ // vga_setup_wm1_block_copy(); @@ -772,11 +781,10 @@ void shinku(global_game_variables_t *gv) break; } if(pageflipflop){ - modexCopyPageRegion(&(gv->video.page[gv->video.p]), &(gv->video.page[!gv->video.p]), 0, 0, 0, 0, gv->video.page[gv->video.p].width, gv->video.page[!gv->video.p].height); - modexShowPage(&(gv->video.page[gv->video.p])); - + modexCopyPageRegion(&(gv->video.page[(gv->video.p)]), &(gv->video.page[(!gv->video.p)]), 0, 0, 0, 0, gv->video.page[gv->video.p].width, gv->video.page[!gv->video.p].height); + modexShowPage(&(gv->video.page[gv->video.p])); //this is slow as fack too!! + gv->video.p=!gv->video.p; } - gv->video.p=!gv->video.p; } void near animatePlayer(map_view_t *pip, player_t *player, word pn, sword scrollswitch) diff --git a/src/scroll.c b/src/scroll.c index 6357ad9b..deed3df9 100755 --- a/src/scroll.c +++ b/src/scroll.c @@ -40,7 +40,9 @@ static planar_buf_t huge *pp; float t; sword bakapee; pan_t pan; +//debugswitches boolean panswitch=0; +boolean pageflipflop=1; unsigned int i; const char *cpus; //static int persist_aniframe = 0; /* gonna be increased to 1 before being used, so 0 is ok for default */ @@ -169,8 +171,7 @@ void main(int argc, char *argv[]) } /* set up paging */ //TODO: LOAD map data and position the map in the middle of the screen if smaller then screen - mapGoTo(&mv[0], 0, 0); - mapGoTo(&mv[1], 0, 0); + mapGoTo(mv, 0, 0); //modexCopyPageRegion(mv[1].page, mv[0].page, 0, 0, 0, 0, mv[1].page->width, mv[1].page->height); //TODO: put player in starting position of spot @@ -187,8 +188,9 @@ void main(int argc, char *argv[]) PBUFSFUN(mv[1].page, player[0].x-4, player[0].y-TILEWH, 24, 64, 24, 32, &pp); #endif - modexShowPage(mv[1].page); - shinku_fps_indicator_page = 1; // we're on page 1 now, shinku(). follow along please or it will not be visible. + if(!pageflipflop) modexShowPage(mv[1].page); + else modexShowPage(mv[(gvar.video.p)].page); + shinku_fps_indicator_page = 1; // we're on page 1 now, shinku(). follow along please or it will not be visible. //modexClearRegion(mv[2].page, 0, 0, mv[2].page->width, mv[2].page->height, 1); #ifdef MODEX #ifdef FADE @@ -207,7 +209,7 @@ void main(int argc, char *argv[]) if(!panswitch){ walk(mv, player, 0); }else{ - panpagemanual(mv, player, pan.pn); + panpagemanual(mv, player, 0); //printf(" player[0].q: %d", player[0].q); printf(" player[0].d: %d\n", player[0].d); } -- 2.39.5