Quote:
Originally Posted by knob
That great! thanks.
I have been trying to emulate the conio.h functions like clrscr(), gotoxy() getch()to make game porting easier.
I was having problems making a while loop work for a getch() to emulate an operation like "press any key" I'll give it another try.
tried this instead of while:-
int KeyVal;
KeyVal=(*GetKeyVal)();
KeyVal=KeyVal&0x1FFF;
for ( ; ; )
{
if (KeyVal==KEY_VAL_PLAY)
break;
}
player just locks up, got something to do with detecting the keypress.
|
Use this instead of (*GetKeyVal)();
#define KEY_PORT GPIO_PDAT0
unsigned int getKey()
{
unsigned int KeyTemp;
KeyTemp = read_mem(KEY_PORT);
KeyTemp = ((~KeyTemp) & 0x3f) | (KeyTemp & 0x40);
return (KeyTemp);
}