diff --git a/source/main.cpp b/source/main.cpp index 9d7f99a..7b26335 100644 --- a/source/main.cpp +++ b/source/main.cpp @@ -1,42 +1,37 @@ #include <3ds.h> #include -#define ENDL "\e[0K" - using namespace std; -static void locateBits(u32 bits) { - bool first = true; - for (int i = 0; i < 32; i++) { - if ((bits >> i) & 1) { - if (!first) - cout << ","; - first = false; - cout << i; - } - } -} - -static void showAll(void) { - - touchPosition touch; - circlePosition circle; - hidScanInput(); - hidTouchRead(&touch); - hidCircleRead(&circle); - cout - << "\e[H" - << "=========================" << endl - << "KEYS: "; locateBits(hidKeysHeld()); cout << ENDL << endl - << "TOUCH SCREEN: " << touch.px << "," << touch.py << ENDL << endl - << "CIRCLE PAD: " << circle.dx << "," << circle.dy << ENDL << endl; -} +// RESULTS +// Top screen has 50 cols +// Bottom screen has 40 cols +// Bith screens have 29 lines int main(void) { + // gfxInitDefault(); + // consoleInit(GFX_TOP, NULL); + // cout << "012345678901234567890123456789012345678901234567890123456789" << endl; + // consoleInit(GFX_BOTTOM, NULL); + // cout << "012345678901234567890123456789012345678901234567890123456789" << endl; + // while (aptMainLoop()) { + // gfxFlushBuffers(); + // } + // gfxExit(); gfxInitDefault(); consoleInit(GFX_TOP, NULL); + for (int i = 50; aptMainLoop(); i--) { + cout << i << endl; + while (aptMainLoop()) { + hidScanInput(); + if (hidKeysDownRepeat() & KEY_A) + break; + gfxFlushBuffers(); + } + gfxFlushBuffers(); + } while (aptMainLoop()) { - showAll(); + gfxFlushBuffers(); } gfxExit(); }