From: sparky4 Date: Wed, 15 Jun 2016 17:58:05 +0000 (-0500) Subject: attempted to make static page buffer system ww X-Git-Url: http://4ch.mooo.com/gitweb/?a=commitdiff_plain;h=fdf0f5aced9f893c4a60c60fe3ff59c32b49745a;p=16.git attempted to make static page buffer system ww --- diff --git a/src/lib/modex16.c b/src/lib/modex16.c index f3a7c776..2ed2e983 100755 --- a/src/lib/modex16.c +++ b/src/lib/modex16.c @@ -251,7 +251,8 @@ modexNextPageFlexibleSize(page_t *p, word x, word y) result.id = p->id+1; result.stridew=result.width/4; result.pagesize = (word)(result.width/4)*result.height; - if(result.id==2) result.pi=p->width;//*p->pi; + if(result.id==2) + result.pi=p->width*p->pi; else if(result.id==3) result.pi=p->pi; return result; diff --git a/src/lib/scroll16.c b/src/lib/scroll16.c index 248a1a09..fc973769 100755 --- a/src/lib/scroll16.c +++ b/src/lib/scroll16.c @@ -46,8 +46,8 @@ void walk(map_view_t *pip, player_t *player, word pn) animatePlayer(pip, player, pn, 1); ScrollRight(pip, player, 3, pn); ScrollRight(pip, player, 2, pn); - mapScrollRight(pip, player, (pip[0].video->p), pn); mapScrollRight(pip, player, !(pip[0].video->p), pn); + mapScrollRight(pip, player, (pip[0].video->p), pn); if(!pageflipflop) modexShowPage(pip[1].page); player[pn].q++; pip[0].video->clk = ((*clockw)-pip[0].video->startclk)/18.2; @@ -90,8 +90,8 @@ void walk(map_view_t *pip, player_t *player, word pn) animatePlayer(pip, player, pn, 1); ScrollLeft(pip, player, 3, pn); ScrollLeft(pip, player, 2, pn); - mapScrollLeft(pip, player, (pip[0].video->p), pn); mapScrollLeft(pip, player, !(pip[0].video->p), pn); + mapScrollLeft(pip, player, (pip[0].video->p), pn); if(!pageflipflop) modexShowPage(pip[1].page); player[pn].q++; pip[0].video->clk = ((*clockw)-pip[0].video->startclk)/18.2; @@ -134,8 +134,8 @@ void walk(map_view_t *pip, player_t *player, word pn) animatePlayer(pip, player, pn, 1); ScrollDown(pip, player, 3, pn); ScrollDown(pip, player, 2, pn); - mapScrollDown(pip, player, (pip[0].video->p), pn); mapScrollDown(pip, player, !(pip[0].video->p), pn); + mapScrollDown(pip, player, (pip[0].video->p), pn); if(!pageflipflop) modexShowPage(pip[1].page); player[pn].q++; pip[0].video->clk = ((*clockw)-pip[0].video->startclk)/18.2; @@ -178,8 +178,8 @@ void walk(map_view_t *pip, player_t *player, word pn) animatePlayer(pip, player, pn, 1); ScrollUp(pip, player, 3, pn); ScrollUp(pip, player, 2, pn); - mapScrollUp(pip, player, (pip[0].video->p), pn); mapScrollUp(pip, player, !(pip[0].video->p), pn); + mapScrollUp(pip, player, (pip[0].video->p), pn); if(!pageflipflop) modexShowPage(pip[1].page); player[pn].q++; pip[0].video->clk = ((*clockw)-pip[0].video->startclk)/18.2; @@ -485,8 +485,13 @@ void near ScrollRight(map_view_t *mv, player_t *player, word id, word plid) /* check to see if this changes the tile */ if(mv[0].video->page[id].dx >= mv[0].dxThresh ) { + /* block copy pattern to where we will draw the sprite */ + vga_setup_wm1_block_copy(); + _fmemmove(mv[0].video->page[id].data-4, mv[0].video->page[id].data, mv[0].video->page[id].pagesize); + /* must restore Write Mode 0/Read Mode 0 for this code to continue drawing normally */ + vga_restore_rm0wm0(); /* Snap the origin forward */ - mv[0].video->page[id].data += mv[0].video->page[id].pi; + mv[0].video->page[id].data += 4; mv[0].video->page[id].dx = mv[0].map->tiles->tileWidth; } } @@ -500,8 +505,13 @@ void near ScrollLeft(map_view_t *mv, player_t *player, word id, word plid) /* check to see if this changes the tile */ if(mv[0].video->page[id].dx == 0) { + /* block copy pattern to where we will draw the sprite */ + vga_setup_wm1_block_copy(); + _fmemmove(mv[0].video->page[id].data-4, mv[0].video->page[id].data, mv[0].video->page[id].pagesize); + /* must restore Write Mode 0/Read Mode 0 for this code to continue drawing normally */ + vga_restore_rm0wm0(); /* Snap the origin backward */ - mv[0].video->page[id].data -= mv[0].video->page[id].pi; + mv[0].video->page[id].data -= 4; mv[0].video->page[id].dx = mv[0].map->tiles->tileWidth; } } @@ -514,8 +524,13 @@ void near ScrollUp(map_view_t *mv, player_t *player, word id, word plid) /* check to see if this changes the tile */ if(mv[0].video->page[id].dy == 0) { + /* block copy pattern to where we will draw the sprite */ + vga_setup_wm1_block_copy(); + _fmemmove(mv[0].video->page[id].data-mv[0].video->page[id].pi, mv[0].video->page[id].data, mv[0].video->page[id].pagesize); + /* must restore Write Mode 0/Read Mode 0 for this code to continue drawing normally */ + vga_restore_rm0wm0(); /* Snap the origin backward */ - mv[0].video->page[id].data -= mv[0].video->page[id].pi;//4; + mv[0].video->page[id].data -= mv[0].video->page[id].pi; mv[0].video->page[id].dy = mv[0].map->tiles->tileWidth; } } @@ -528,8 +543,13 @@ void near ScrollDown(map_view_t *mv, player_t *player, word id, word plid) /* check to see if this changes the tile */ if(mv[0].video->page[id].dy >= mv[0].dxThresh ) { + /* block copy pattern to where we will draw the sprite */ + vga_setup_wm1_block_copy(); + _fmemmove(mv[0].video->page[id].data+mv[0].video->page[id].pi, mv[0].video->page[id].data, mv[0].video->page[id].pagesize); + /* must restore Write Mode 0/Read Mode 0 for this code to continue drawing normally */ + vga_restore_rm0wm0(); /* Snap the origin forward */ - mv[0].video->page[id].data += mv[0].video->page[id].pi;//4; + mv[0].video->page[id].data += mv[0].video->page[id].pi; mv[0].video->page[id].dy = mv[0].map->tiles->tileWidth; } } @@ -600,12 +620,7 @@ void mapGoTo(map_view_t *mv, int tx, int ty) mapDrawWRow(&mv[0], tx-1, ty, py); i+=mv->map->width - tx; } - /* block copy pattern to where we will draw the sprite */ - vga_setup_wm1_block_copy(); - //_fmemcpy(mv[1].page->data, mv[0].page->data, mv[0].page->pagesize); modexCopyPageRegion(mv[1].page, mv[0].page, 0, 0, 0, 0, mv[0].page->width, mv[0].page->height); - /* must restore Write Mode 0/Read Mode 0 for this code to continue drawing normally */ - vga_restore_rm0wm0(); modexCopyPageRegion(mv[3].page, mv[!(mv->video->p)].page, 0/**/, 0/**/, 0, 128, 28, 36); } diff --git a/src/scroll.c b/src/scroll.c index 3e7032e5..a3b44bb5 100755 --- a/src/scroll.c +++ b/src/scroll.c @@ -177,6 +177,7 @@ void main(int argc, char *argv[]) mv[i].video = &gvar.video; mv[i].pan = &pan; } + /* 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); @@ -200,7 +201,12 @@ void main(int argc, char *argv[]) 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); + + /* buffer pages */ + modexClearRegion(mv[2].page, 0, 0, mv[2].page->width, mv[2].page->height, 47); + modexClearRegion(mv[3].page, 0, 0, mv[3].page->width, mv[3].page->height, 45); + modexClearRegion(mv[3].page, 0, 128, 28, 36, 15); + #ifdef MODEX #ifdef FADE modexFadeOn(4, gpal); @@ -276,7 +282,9 @@ void main(int argc, char *argv[]) } if(IN_KeyDown(67)) //f9 { - modexClearRegion(mv[3].page, 0, 0/*128*/, 28, 36, 15); + modexClearRegion(mv[2].page, 0, 0, mv[2].page->width, mv[2].page->height, 47); + modexClearRegion(mv[3].page, 0, 0, mv[3].page->width, mv[3].page->height, 45); + modexClearRegion(mv[3].page, 0, 128, 28, 36, 15); //IN_UserInput(1,1); } //TODO fmemtest into page