void main() {\r
int show1=1;\r
int tx, ty;\r
- int x, y;\r
+ int x, y;
+ int ch=0x0;\r
page_t screen;\r
map_t map;\r
map_view_t mv;\r
byte *ptr;\r
\r
/* create the map */\r
- map = allocMap(80,60);\r
+ map = allocMap(40,30);\r
initMap(&map);\r
mv.map = ↦\r
\r
mv.page = &screen;\r
mapGoTo(&mv, 0, 0);\r
modexShowPage(mv.page);\r
-\r
- /* scroll all the way to the right */\r
- for(x=0; x<(map.width*16-SCREEN_WIDTH); x++) {\r
- mapScrollRight(&mv, 1);\r
+
+ while(1){ \r
+ // scroll all the way to the right\r
+ //for(x=0; x<(map.width*16-SCREEN_WIDTH); x++) {
+ if(ch==0x4d){\r
+ mapScrollRight(&mv, 4);\r
modexShowPage(mv.page);\r
}\r
\r
- /* scroll all the way to the left */\r
- for(; x>0; x--) {\r
- mapScrollLeft(&mv, 1);\r
+ // scroll all the way to the left\r
+ //for(; x>0; x--) {
+ if(ch==0x4b){\r
+ mapScrollLeft(&mv, 4);\r
modexShowPage(mv.page);\r
}\r
\r
- /* scroll all the way down */\r
- for(y=0; y<(map.height*16-SCREEN_HEIGHT); y++) {\r
- mapScrollDown(&mv, 1);\r
+ // scroll all the way down\r
+ //for(y=0; y<(map.height*16-SCREEN_HEIGHT); y++) {
+ if(ch==0x50){\r
+ mapScrollDown(&mv, 4);\r
modexShowPage(mv.page);\r
}\r
\r
- /* scroll all the way up */\r
- for(; y>0; y--) {\r
- mapScrollUp(&mv, 1);\r
+ // scroll all the way up\r
+ //for(; y>0; y--) {
+ if(ch==0x48){\r
+ mapScrollUp(&mv, 4);\r
modexShowPage(mv.page);\r
}\r
\r
- /* spin for a time */\r
- for(x=0; x<500; x++) {\r
+ // spin for a time \r
+ /*for(x=0; x<500; x++) {\r
modexWaitBorder();\r
- }\r
-\r
+ }*/
+ //while(1){
+ ch=getch();
+ //printf("0x%02x\n", ch);\r
+ if(ch==0x71)break; // 'q'\r
+ if(ch==0x1b)break; // 'ESC'\r
+}\r
modexLeave();\r
}\r
\r