add tests on the known functions
This commit is contained in:
parent
a7c1c096a4
commit
747816c5fd
1 changed files with 106 additions and 4 deletions
106
source/main.cpp
106
source/main.cpp
|
@ -3,11 +3,113 @@
|
|||
|
||||
int main(int argc, char **argv) {
|
||||
gfxInitDefault();
|
||||
|
||||
// draw top screen
|
||||
consoleInit(GFX_TOP, NULL);
|
||||
printf("hi lol");
|
||||
gspWaitForVBlank();
|
||||
gfxFlushBuffers();
|
||||
gfxSwapBuffers();
|
||||
|
||||
printf("Test Code::Blocks project!");
|
||||
consoleInit(GFX_BOTTOM, NULL);
|
||||
printf("\r \r");
|
||||
|
||||
printf("\x1b[20;15HPress Start to exit.");
|
||||
// Start
|
||||
printf("Press Start for test 1.\n");
|
||||
|
||||
while(aptMainLoop()) {
|
||||
gspWaitForVBlank();
|
||||
hidScanInput();
|
||||
|
||||
if(hidKeysDown() & KEY_START)
|
||||
break;
|
||||
|
||||
gfxFlushBuffers();
|
||||
gfxSwapBuffers();
|
||||
}
|
||||
|
||||
// Test 1
|
||||
printf("TEST 1: without VBlank\n");
|
||||
printf("Press Start for test 2.\n");
|
||||
|
||||
while(aptMainLoop()) {
|
||||
hidScanInput();
|
||||
|
||||
if(hidKeysDown() & KEY_START)
|
||||
break;
|
||||
|
||||
gfxFlushBuffers();
|
||||
gfxSwapBuffers();
|
||||
}
|
||||
|
||||
// Test 2
|
||||
printf("TEST 2: without scan input\n");
|
||||
printf("Press Start for test 3.\n");
|
||||
|
||||
while(aptMainLoop()) {
|
||||
gspWaitForVBlank();
|
||||
|
||||
if(hidKeysDown() & KEY_START)
|
||||
break;
|
||||
|
||||
gfxFlushBuffers();
|
||||
gfxSwapBuffers();
|
||||
}
|
||||
|
||||
// Test 3
|
||||
printf("TEST 3: without flush\n");
|
||||
printf("Press Start for test 4.\n");
|
||||
|
||||
while(aptMainLoop()) {
|
||||
gspWaitForVBlank();
|
||||
hidScanInput();
|
||||
|
||||
if(hidKeysDown() & KEY_START)
|
||||
break;
|
||||
|
||||
gfxSwapBuffers();
|
||||
}
|
||||
|
||||
// Test 4
|
||||
printf("TEST 4: without swap\n");
|
||||
printf("Press Start for test 5.\n");
|
||||
|
||||
while(aptMainLoop()) {
|
||||
gspWaitForVBlank();
|
||||
hidScanInput();
|
||||
|
||||
if(hidKeysDown() & KEY_START)
|
||||
break;
|
||||
|
||||
gfxFlushBuffers();
|
||||
}
|
||||
|
||||
// Test 5
|
||||
printf("TEST 5: without anything\n");
|
||||
printf("Press A to test something.\n");
|
||||
printf("Press Start for test 6.\n");
|
||||
|
||||
while(aptMainLoop()) {
|
||||
hidScanInput();
|
||||
if(hidKeysDown() & KEY_A)
|
||||
printf("\e[32msomething :)\e[0m\n");
|
||||
if(hidKeysDown() & KEY_START)
|
||||
break;
|
||||
}
|
||||
|
||||
// Test 6
|
||||
printf("TEST 6: literally without anything\n");
|
||||
printf("Press Start to end.\n");
|
||||
|
||||
while(true) {
|
||||
hidScanInput();
|
||||
if(hidKeysDown() & KEY_START)
|
||||
break;
|
||||
gfxFlushBuffers();
|
||||
}
|
||||
|
||||
// End
|
||||
printf("Press Start to exit.\n");
|
||||
|
||||
while(aptMainLoop()) {
|
||||
gspWaitForVBlank();
|
||||
|
|
Loading…
Add table
Reference in a new issue