After you use GetKey(int* key) return after you press Menu? I've got some code that is basically:
Code:
(Flip is just an alias to that unmemorable Bdisp_something_something command) What happens when I run that is: the screen turns green, I press Menu, and it goes straight to the menu, go back to the program, and it flashes black, and then turns green again. So, does GetKey() return directly where it left off, or does it do something crazy with block?
Edit: Nevermind. I'm stupid. My error was that this was part of a bigger piece of code, so there were two loops (while (forever); and while(!forever) and I forgot to fix the error condition from the first loop when it goes back around. So, it was turning green again because that first loop decided to exit on its first go and then went straight into the other block that looks like the code above.
Code:
main() {
int key;
FillScreen(COLOR_GREEN);
Flip();
while (1) {
key = PRGM_GetKey();
if (key == KEY_PRGM_MENU) {
GetKey(&key);
FillScreen(COLOR_BLACK);
Flip();
}
}
}
Edit: Nevermind. I'm stupid. My error was that this was part of a bigger piece of code, so there were two loops (while (forever); and while(!forever) and I forgot to fix the error condition from the first loop when it goes back around. So, it was turning green again because that first loop decided to exit on its first go and then went straight into the other block that looks like the code above.