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.
|
it looks up because it causes an infinite loop because variable KeyVal doesn't change no matter what happes with (*GetKeyVal)() as the result of this function is assigned to KeyVal before the loop. You should use (*GetKeyVal)() inside the loop.
Another problem with that is that if a one cycle of main() function tooks too much time, it locks up no matter how properly it is designed. In my case it keep hanging after about 2 seconds of executing main(), so this function must hang. Try to do this using multiply main() function variable dependent loop which will work for sure. Its because main function is executed directly by FW code every single time, and between those calls to this function it does some necessary operations (not sure what exactly though). For instance screen doesn't get refreshed before one cycle of main() is executed. If we draw a bitmap, it will be displayed only after main() function is ended.
But normal use of
"getch()" or
"repeat until keypressed" (pascal) is as far as I know impossible to implement. We must follow tricks to do that, because to be honest, when I first met RKP platform I was surprised by the way its all running (infinite loop of main function - in opposite to normal console app where main is executed once and thats it.
Quote:
Originally Posted by Alis
(Sorry for my bad English)
Does this means that we are going to be able to run an app that can read files from FLASH ???
|
For now we can only read RAW data of flash memory, but implementing filesystem is possible, so probably yes - it will be possible to read files from flash - not sure about writing though, but who knows
SIG11. But isn't your function reading values only from standard button input? I got touchpad, so most probably (*GetKeyVal)() is something that should be left original way because it may be written differently - depends on used input keyboard driver in a particular rk26 model player.