fix display

This commit is contained in:
Zy 2024-09-25 22:39:07 +02:00
parent e9e4c3e930
commit 3112db466d

View file

@ -1,6 +1,8 @@
#include <3ds.h> #include <3ds.h>
#include <iostream> #include <iostream>
#define ENDL "\e[0K"
using namespace std; using namespace std;
static void locateBits(u32 bits) { static void locateBits(u32 bits) {
@ -13,28 +15,27 @@ static void locateBits(u32 bits) {
cout << i; cout << i;
} }
} }
cout << endl;
} }
static void showAll(void) { static void showAll(void) {
consoleClear();
touchPosition touch; touchPosition touch;
circlePosition circle; circlePosition circle;
hidScanInput(); hidScanInput();
hidTouchRead(&touch); hidTouchRead(&touch);
hidCircleRead(&circle); hidCircleRead(&circle);
cout << "=========================" << endl; cout
cout << "KEYS: "; locateBits(hidKeysHeld()); cout << endl; << "\e[H"
cout << "TOUCH SCREEN: " << touch.px << "," << touch.py << endl; << "=========================" << endl
cout << "CIRCLE PAD: " << circle.dx << "," << circle.dy << endl; << "KEYS: "; locateBits(hidKeysHeld()); cout << ENDL << endl
<< "TOUCH SCREEN: " << touch.px << "," << touch.py << ENDL << endl
<< "CIRCLE PAD: " << circle.dx << "," << circle.dy << ENDL << endl;
} }
int main(void) { int main(void) {
gfxInitDefault(); gfxInitDefault();
consoleInit(GFX_TOP, NULL); consoleInit(GFX_TOP, NULL);
while (aptMainLoop()) { while (aptMainLoop()) {
gspWaitForVBlank();
showAll(); showAll();
} }
gfxExit(); gfxExit();