- fprintf(stderr, "xx=%d yy=%d\n", bakapee.xx, bakapee.yy);
- printf("Enter 1, 2, 3, 4, or 6 to run a screensaver, or enter 0 to quit.\n", getch()); // prompt the user
- //scanf("%d", &key);
- if(scanf("%d", &key) != 1)
- {
- printf("%d\n", key);
- }
- getch();
- //if(key==3){xx=yy=0;} // crazy screen saver wwww
- if(key==0){ d=0; }else{
- gvar.video.page[0] = modexDefaultPage(&gvar.video.page[0]);
- gvar.video.page[0].width += (TILEWH*2);
- gvar.video.page[0].height += (TILEWH*2);
-#ifdef MXLIB
- VGAmodeX(1, &gvar);
-#else
- mxChangeMode(3);
-#endif
- modexShowPage(&gvar.video.page[0]);
+ fprintf(stderr, "xx=%d yy=%d tile=%d\n", bakapee.xx, bakapee.yy, bakapee.tile);
+ printf("Enter 1, 2, 3, 4, or 6 to run a screensaver, or enter 0 to quit.\n");
+
+ c = getch();
+ switch (c) {
+ case 27: /* Escape key */
+ case '0':
+ d=0;
+ break;
+ case 'b': // test tile change
+ switch (bakapee.tile)
+ {
+ case 0:
+ bakapee.tile=1;
+ break;
+ case 1:
+ bakapee.tile=0;
+ break;
+ }
+ key=0;
+ break;
+ case '1':
+ case '2':
+ case '3':
+ case '4':
+ case '5':
+ case '6':
+ key = c - '0';
+# ifdef MXLIB
+ gvar.video.page[0] = modexDefaultPage(&gvar.video.page[0]);
+ gvar.video.page[0].width += (TILEWH*2);
+ gvar.video.page[0].height += (TILEWH*2);
+ VGAmodeX(1, &gvar);
+# else
+# error REMOVED // this code is written around modex16 which so far is a better fit than using DOSLIB vga directly, so leave MXLIB code in.
+ // we'll integrate DOSLIB vga into that part of the code instead for less disruption. -- J.C.
+# endif
+ modexShowPage(&gvar.video.page[0]);
+ break;
+ default:
+ key=0;
+ break;