hwtests/source/main.c

63 lines
1.0 KiB
C
Raw Normal View History

2014-10-26 18:47:14 -07:00
#include <stdlib.h>
#include <stdio.h>
#include <3ds.h>
#include "output.h"
#include "test_fs.h"
static int testCounter = 0;
static void (*tests[]) (void) = {
FS_TestAll
};
2014-10-26 18:47:14 -07:00
int main()
{
srvInit();
aptInit();
hidInit(NULL);
gfxInit();
gfxSet3D(false);
clearScreens();
print(GFX_TOP, "Press A to begin...\n");
2014-10-26 18:47:14 -07:00
APP_STATUS status;
while ((status = aptGetStatus()) != APP_EXITING) {
if (status == APP_RUNNING) {
drawFrames();
2014-10-26 18:47:14 -07:00
hidScanInput();
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;
}
print(GFX_TOP, "\n");
print(GFX_TOP, "Press A to continue...\n");
2014-10-26 18:47:14 -07:00
}
2014-10-30 00:42:44 -07:00
} else if (status == APP_SUSPENDING) {
2014-10-26 18:47:14 -07:00
aptReturnToMenu();
} else if (status == APP_SLEEPMODE) {
2014-10-26 18:47:14 -07:00
aptWaitStatusEvent();
2014-10-30 00:42:44 -07:00
break;
2014-10-26 18:47:14 -07:00
}
2014-10-30 00:42:44 -07:00
2014-10-26 18:47:14 -07:00
gspWaitForEvent(GSPEVENT_VBlank0, false);
}
clearScreens();
2014-10-26 18:47:14 -07:00
gfxExit();
hidExit();
aptExit();
srvExit();
return 0;
}