fix display

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

View file

@ -1,41 +1,42 @@
#include <3ds.h>
#include <iostream>
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;
}
}
cout << endl;
}
static void showAll(void) {
consoleClear();
touchPosition touch;
circlePosition circle;
hidScanInput();
hidTouchRead(&touch);
hidCircleRead(&circle);
cout << "=========================" << endl;
cout << "KEYS: "; locateBits(hidKeysHeld()); cout << endl;
cout << "TOUCH SCREEN: " << touch.px << "," << touch.py << endl;
cout << "CIRCLE PAD: " << circle.dx << "," << circle.dy << endl;
}
int main(void) {
gfxInitDefault();
consoleInit(GFX_TOP, NULL);
while (aptMainLoop()) {
gspWaitForVBlank();
showAll();
}
gfxExit();
}
#include <3ds.h>
#include <iostream>
#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;
}
int main(void) {
gfxInitDefault();
consoleInit(GFX_TOP, NULL);
while (aptMainLoop()) {
showAll();
}
gfxExit();
}