Migrate main app loop to ctrulib's new aptMainLoop().
This commit is contained in:
parent
e1848bcfc9
commit
b0527b4d47
@ -21,33 +21,24 @@ int main()
|
|||||||
clearScreens();
|
clearScreens();
|
||||||
print(GFX_TOP, "Press A to begin...\n");
|
print(GFX_TOP, "Press A to begin...\n");
|
||||||
|
|
||||||
APP_STATUS status;
|
while (aptMainLoop()) {
|
||||||
while ((status = aptGetStatus()) != APP_EXITING) {
|
drawFrames();
|
||||||
if (status == APP_RUNNING) {
|
|
||||||
drawFrames();
|
|
||||||
|
|
||||||
hidScanInput();
|
hidScanInput();
|
||||||
if (hidKeysDown() & KEY_B) {
|
if (hidKeysDown() & KEY_B) {
|
||||||
|
break;
|
||||||
|
} else if (hidKeysDown() & KEY_A) {
|
||||||
|
clearScreen(GFX_TOP);
|
||||||
|
|
||||||
|
if (testCounter < (sizeof(tests) / sizeof(tests[0]))) {
|
||||||
|
tests[testCounter]();
|
||||||
|
testCounter++;
|
||||||
|
} else {
|
||||||
break;
|
break;
|
||||||
} else if (hidKeysDown() & KEY_A) {
|
|
||||||
clearScreen(GFX_TOP);
|
|
||||||
|
|
||||||
if (testCounter < (sizeof(tests) / sizeof(tests[0]))) {
|
|
||||||
tests[testCounter]();
|
|
||||||
testCounter++;
|
|
||||||
} else {
|
|
||||||
break;
|
|
||||||
}
|
|
||||||
|
|
||||||
print(GFX_TOP, "\n");
|
|
||||||
print(GFX_TOP, "Press A to continue...\n");
|
|
||||||
}
|
}
|
||||||
|
|
||||||
} else if (status == APP_SUSPENDING) {
|
print(GFX_TOP, "\n");
|
||||||
aptReturnToMenu();
|
print(GFX_TOP, "Press A to continue...\n");
|
||||||
} else if (status == APP_SLEEPMODE) {
|
|
||||||
aptWaitStatusEvent();
|
|
||||||
break;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
gspWaitForEvent(GSPEVENT_VBlank0, false);
|
gspWaitForEvent(GSPEVENT_VBlank0, false);
|
||||||
|
Loading…
x
Reference in New Issue
Block a user