]> git.sur5r.net Git - cc65/blob - testcode/lib/gamate/ctest.c
conio and most other stuff working now
[cc65] / testcode / lib / gamate / ctest.c
1
2 #include <gamate.h>
3 #include <time.h>
4 #include <conio.h>
5
6 unsigned char y = 0;
7 unsigned char x;
8 unsigned short n;
9
10 int main(int argc, char *argv[])
11 {
12     clrscr();
13     gotoxy(0,0);cputs("abcdABCD");
14
15     textcolor(0);gotoxy(0,5);cputs("abcdABCD 0");
16     textcolor(1);gotoxy(0,6);cputs("abcdABCD  1");
17     textcolor(2);gotoxy(0,7);cputs("abcdABCD   2");
18     textcolor(3);gotoxy(0,8);cputs("abcdABCD    3");
19
20     while(1) {
21         textcolor(COLOR_BLACK);
22
23         n = clock();
24
25         gotoxy(0,2);cprintf("%04x %02x %02x", n, x, y);
26
27         switch((*((unsigned char*)JOY_DATA))) {
28             case 0xff ^ JOY_DATA_UP:
29                 ++y;
30                 break;
31             case 0xff ^ JOY_DATA_DOWN:
32                 --y;
33                 break;
34             case 0xff ^ JOY_DATA_LEFT:
35                 ++x;
36                 break;
37             case 0xff ^ JOY_DATA_RIGHT:
38                 --x;
39                 break;
40             case 0xff ^ JOY_DATA_FIRE_A:
41                 break;
42         }
43
44         (*((unsigned char*)LCD_XPOS)) = x;
45         (*((unsigned char*)LCD_YPOS)) = y;
46
47         waitvblank();
48
49     }
50
51     return 0;
52 }