mapGoTo(&mv, 0, 0);\r
\r
/* scroll all the way to the right */\r
- for(x=0; x<(80*16-SCREEN_WIDTH); x++) {\r
+ /*for(x=0; x<((80)*16-SCREEN_WIDTH); x++) {\r
+ mapScrollRight(&mv, 1);\r
+ modexShowPage(mv.page);\r
+ }
+\r
+ for(x=0; x<((80+0.50625)*16-SCREEN_WIDTH); x++) {\r
+ mapScrollLeft(&mv, 1);\r
+ modexShowPage(mv.page);\r
+ }*/
+
+ for(x=0; x<((40)*16-SCREEN_WIDTH); x++) {\r
mapScrollRight(&mv, 1);\r
modexShowPage(mv.page);\r
}\r
- \r
+ for(x=0; x<((40/*+0.50625*/)*16-SCREEN_WIDTH); x++) {\r
+ mapScrollLeft(&mv, 1);\r
+ modexShowPage(mv.page);\r
+ }
\r
/* spin for a time */\r
for(x=0; x<500; x++) {\r
/* draw the next column */\r
x= SCREEN_WIDTH;\r
i= mv->ty * mv->map->width + mv->tx + 20;\r
- for(y=0; y<240; y+=16) {\r
+ for(y=0; y<SCREEN_HEIGHT; y+=16) {\r
mapDrawTile(mv->map->tiles, mv->map->data[i], mv->page, (int)mv->page->dx + x, (int)mv->page->dy+y);\r
i += mv->map->width;\r
}\r
\r
\r
void\r
-mapScrollLeft(map_view_t *mv, byte offest) {\r
+mapScrollLeft(map_view_t *mv, byte offset) {
+ word x, y; /* coordinate for drawing */\r
+ unsigned int i;\r
+\r
+ /* increment the pixel position and update the page */\r
+ mv->page->dx -= offset;\r
+\r
+ /* check to see if this changes the tile */\r
+ if(mv->page->dx >= 16) {\r
+ /* go forward one tile */\r
+ mv->tx++;\r
+ /* Snap the origin forward */\r
+ mv->page->data -= 4;\r
+ mv->page->dx =16;\r
+\r
+\r
+ /* draw the next column */\r
+ x= SCREEN_WIDTH;\r
+ i= mv->ty * mv->map->width + mv->tx + 20;\r
+ for(y=0; y<SCREEN_HEIGHT; y+=16) {\r
+ mapDrawTile(mv->map->tiles, mv->map->data[i], mv->page, (int)mv->page->dx + x, (int)mv->page->dy+y);\r
+ i += mv->map->width;\r
+ }
+}\r
}\r
\r
\r