X-Git-Url: http://4ch.mooo.com/gitweb/?a=blobdiff_plain;f=src%2Flib%2Fscroll16.c;h=534ae630588d1981dc9da012631bed863647ff41;hb=31cf323b1ac94e123c6a770890551020e47e3b8d;hp=94a9d59f08c6ec76b121b441098bf070567014d1;hpb=895b5d145c4fc5597fefd85a43e5636222e44cd5;p=16.git diff --git a/src/lib/scroll16.c b/src/lib/scroll16.c index 94a9d59f..534ae630 100755 --- a/src/lib/scroll16.c +++ b/src/lib/scroll16.c @@ -44,10 +44,10 @@ void walk(map_view_t *pip, player_t *player, word pn) { INC_PER_FRAME; 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); - ScrollRight(pip, player, 2, pn); - ScrollRight(pip, player, 3, pn); if(!pageflipflop) modexShowPage(pip[1].page); player[pn].q++; pip[0].video->clk = ((*clockw)-pip[0].video->startclk)/18.2; @@ -88,10 +88,10 @@ void walk(map_view_t *pip, player_t *player, word pn) { INC_PER_FRAME; 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); - ScrollLeft(pip, player, 2, pn); - ScrollLeft(pip, player, 3, pn); if(!pageflipflop) modexShowPage(pip[1].page); player[pn].q++; pip[0].video->clk = ((*clockw)-pip[0].video->startclk)/18.2; @@ -132,10 +132,10 @@ void walk(map_view_t *pip, player_t *player, word pn) { INC_PER_FRAME; 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); - ScrollDown(pip, player, 2, pn); - ScrollDown(pip, player, 3, pn); if(!pageflipflop) modexShowPage(pip[1].page); player[pn].q++; pip[0].video->clk = ((*clockw)-pip[0].video->startclk)/18.2; @@ -176,10 +176,10 @@ void walk(map_view_t *pip, player_t *player, word pn) { INC_PER_FRAME; 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); - ScrollUp(pip, player, 2, pn); - ScrollUp(pip, player, 3, pn); if(!pageflipflop) modexShowPage(pip[1].page); player[pn].q++; pip[0].video->clk = ((*clockw)-pip[0].video->startclk)/18.2; @@ -483,8 +483,13 @@ void near ScrollRight(map_view_t *mv, player_t *player, word id, word plid) mv[0].video->page[id].dx += player[plid].speed; /* check to see if this changes the tile */ - if(mv[0].video->page[id].dx >= mv[id].dxThresh ) + 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 += 4; mv[0].video->page[id].dx = mv[0].map->tiles->tileWidth; @@ -500,6 +505,11 @@ 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 -= 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 -= 4; + mv[0].video->page[id].data -= mv[0].video->page[id].pi; mv[0].video->page[id].dy = mv[0].map->tiles->tileWidth; } } @@ -526,15 +541,17 @@ void near ScrollDown(map_view_t *mv, player_t *player, word id, word plid) mv[0].video->page[id].dy += player[plid].speed; /* check to see if this changes the tile */ - if(mv[0].video->page[id].dy >= mv[id].dxThresh ) + 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 += 4; + mv[0].video->page[id].data += mv[0].video->page[id].pi; mv[0].video->page[id].dy = mv[0].map->tiles->tileWidth; } -// modexClearRegion(&(mv[0].video->page[id]), 0, 0, -// mv[0].video->page[id].width-1, -// mv[0].video->page[id].height-1, id*2); } sword chkmap(map_t *map, word q) @@ -588,12 +605,12 @@ void mapGoTo(map_view_t *mv, int tx, int ty) /* set up the coordinates */ 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; + mv[0].page->dx = mv[1].page->dx = mv[2].page->dx = mv[3].page->dx = mv->map->tiles->tileWidth; + mv[0].page->dy = mv[1].page->dy = mv[2].page->dy = mv[3].page->dy = mv->map->tiles->tileHeight; /* set up the thresholds */ - mv[0].dxThresh = mv[1].dxThresh = mv->map->tiles->tileWidth * 2; - mv[0].dyThresh = mv[1].dyThresh = mv->map->tiles->tileHeight * 2; + mv[0].dxThresh = mv[1].dxThresh = mv[2].dxThresh = mv[3].dxThresh = mv->map->tiles->tileWidth * 2; + mv[0].dyThresh = mv[1].dyThresh = mv[2].dxThresh = mv[3].dxThresh = mv->map->tiles->tileHeight * 2; /* draw the tiles */ modexClearRegion(mv[0].page, 0, 0, mv[0].page->width, mv[0].page->height, 0); @@ -603,13 +620,18 @@ void mapGoTo(map_view_t *mv, int tx, int ty) 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); - /* 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); - /* 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); + modexCopyPageRegion(mv[1].page, mv[0].page, 0, 0, 0, 0, mv[0].page->width, mv[0].page->height); + { + unsigned int k,j,o; + /* fill screen with a distinctive pattern */ + for (k=0;k < vga_state.vga_width;k++) { + o = k >> 2; + vga_write_sequencer(0x02/*map mask*/,1 << (k&3)); + for (j=0;j < (mv[0].page->height)+(mv[1].page->height)+(mv[2].page->height)+(mv[3].page->height);j++,o += vga_state.vga_stride) + 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); } @@ -751,6 +773,8 @@ void shinku(global_game_variables_t *gv) word bgcol = 0; word type = 1; byte o,o2,i; + //modexClearRegion(&gv->video.page[2], 0, 0, gv->video.page[2].sw, gv->video.page[2].sh, 47); + //modexClearRegion(&gv->video.page[3], 0, 0, gv->video.page[3].sw, gv->video.page[3].sh, 45); //modexCopyPageRegion(pip[1].page, pip[2].page, 16, 16, 16, 16, (14*8)+4, 8+4); /* block copy to visible RAM from offscreen */ // vga_setup_wm1_block_copy(); @@ -792,10 +816,10 @@ void shinku(global_game_variables_t *gv) } if(pageflipflop){ if(gv->video.r){ - //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); /* block copy pattern to where we will draw the sprite */ vga_setup_wm1_block_copy(); - _fmemmove((gv->video.page[(gv->video.p)]).data, (gv->video.page[(!gv->video.p)]).data, gv->video.page[(!gv->video.p)].pagesize); + //_fmemmove((gv->video.page[(gv->video.p)]).data, (gv->video.page[(!gv->video.p)]).data, gv->video.page[(!gv->video.p)].pagesize); + 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); /* must restore Write Mode 0/Read Mode 0 for this code to continue drawing normally */ vga_restore_rm0wm0(); modexShowPage(&(gv->video.page[gv->video.p]));