2015-11-29 00:14:59 +00:00
|
|
|
|
|
|
|
#include <gamate.h>
|
|
|
|
#include <time.h>
|
|
|
|
#include <conio.h>
|
|
|
|
|
|
|
|
unsigned char y = 0;
|
2015-11-29 15:01:36 +00:00
|
|
|
unsigned char x = 0;
|
2015-11-29 00:14:59 +00:00
|
|
|
unsigned short n;
|
|
|
|
|
2021-12-25 19:15:09 +00:00
|
|
|
int main(void)
|
2015-11-29 00:14:59 +00:00
|
|
|
{
|
|
|
|
clrscr();
|
2015-11-29 00:24:01 +00:00
|
|
|
gotoxy(0,0);cputs("Gamate C-Test");
|
2015-11-29 00:14:59 +00:00
|
|
|
|
|
|
|
textcolor(0);gotoxy(0,5);cputs("abcdABCD 0");
|
|
|
|
textcolor(1);gotoxy(0,6);cputs("abcdABCD 1");
|
|
|
|
textcolor(2);gotoxy(0,7);cputs("abcdABCD 2");
|
|
|
|
textcolor(3);gotoxy(0,8);cputs("abcdABCD 3");
|
|
|
|
|
|
|
|
while(1) {
|
|
|
|
textcolor(COLOR_BLACK);
|
|
|
|
|
|
|
|
n = clock();
|
|
|
|
|
2015-11-29 15:01:36 +00:00
|
|
|
gotoxy(0,2);cprintf("%04x %02x %02x %02x", n, x, y, *((unsigned char*)JOY_DATA));
|
2015-11-29 00:14:59 +00:00
|
|
|
|
|
|
|
switch((*((unsigned char*)JOY_DATA))) {
|
2020-08-26 13:59:52 +00:00
|
|
|
case 0xff ^ JOY_UP_MASK:
|
2015-11-29 15:01:36 +00:00
|
|
|
++y; if (y == 0xc8) y = 0;
|
2015-11-29 00:14:59 +00:00
|
|
|
break;
|
2020-08-26 13:59:52 +00:00
|
|
|
case 0xff ^ JOY_DOWN_MASK:
|
2015-11-29 15:01:36 +00:00
|
|
|
--y; if (y == 0xff) y = 0xc7;
|
2015-11-29 00:14:59 +00:00
|
|
|
break;
|
2020-08-26 13:59:52 +00:00
|
|
|
case 0xff ^ JOY_LEFT_MASK:
|
2015-11-29 00:14:59 +00:00
|
|
|
++x;
|
|
|
|
break;
|
2020-08-26 13:59:52 +00:00
|
|
|
case 0xff ^ JOY_RIGHT_MASK:
|
2015-11-29 00:14:59 +00:00
|
|
|
--x;
|
|
|
|
break;
|
2020-08-26 13:59:52 +00:00
|
|
|
case 0xff ^ JOY_BTN_A_MASK:
|
2015-11-29 00:14:59 +00:00
|
|
|
break;
|
|
|
|
}
|
2015-11-29 15:01:36 +00:00
|
|
|
|
2017-07-17 21:15:05 +00:00
|
|
|
waitvsync();
|
2015-11-29 00:14:59 +00:00
|
|
|
|
|
|
|
(*((unsigned char*)LCD_XPOS)) = x;
|
|
|
|
(*((unsigned char*)LCD_YPOS)) = y;
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
return 0;
|
|
|
|
}
|