From: Robert Lowe Date: Mon, 8 Sep 2014 00:51:22 +0000 (-0400) Subject: initial attempt at paging while scrolling X-Git-Url: http://4ch.mooo.com/gitweb/?a=commitdiff_plain;ds=sidebyside;h=df3157c1dee208438339a697e59c923eb986f0de;p=16.git initial attempt at paging while scrolling --- diff --git a/16/modex16/scroll.c b/16/modex16/scroll.c index bd086732..09b91f76 100644 --- a/16/modex16/scroll.c +++ b/16/modex16/scroll.c @@ -44,19 +44,22 @@ void mapDrawTile(tiles_t *t, word i, page_t *page, word x, word y); void mapDrawRow(map_view_t *mv, int tx, int ty, word y); void mapDrawCol(map_view_t *mv, int tx, int ty, word x); +#define SWAP(a, b) tmp=a; a=b; b=tmp; void main() { int show1=1; int tx, ty; int x, y; - page_t screen; + page_t screen,screen2; map_t map; - map_view_t mv; + map_view_t mv, mv2; + map_view_t *draw, *show, *tmp; byte *ptr; /* create the map */ map = allocMap(80,60); initMap(&map); mv.map = ↦ + mv2.map = ↦ /* draw the tiles */ ptr = map.data; @@ -64,13 +67,21 @@ void main() { screen = modexDefaultPage(); screen.width = 352; mv.page = &screen; + screen2=modexNextPage(mv.page); + mv2.page = &screen2; mapGoTo(&mv, 0, 0); + mapGoTo(&mv2, 0, 0); modexShowPage(mv.page); + /* set up paging */ + show = &mv; + draw = &mv2; /* scroll all the way to the right */ for(x=0; x<(map.width*16-SCREEN_WIDTH); x++) { - mapScrollRight(&mv, 1); - modexShowPage(mv.page); + mapScrollRight(draw, 1); + modexShowPage(draw->page); + mapScrollRight(show, 1); + //SWAP(draw, show); } /* scroll all the way to the left */ diff --git a/16/modex16/scroll.exe b/16/modex16/scroll.exe index 26addeed..ee38ecba 100755 Binary files a/16/modex16/scroll.exe and b/16/modex16/scroll.exe differ