fix display
This commit is contained in:
parent
e9e4c3e930
commit
3112db466d
1 changed files with 42 additions and 41 deletions
|
@ -1,41 +1,42 @@
|
||||||
#include <3ds.h>
|
#include <3ds.h>
|
||||||
#include <iostream>
|
#include <iostream>
|
||||||
|
|
||||||
using namespace std;
|
#define ENDL "\e[0K"
|
||||||
|
|
||||||
static void locateBits(u32 bits) {
|
using namespace std;
|
||||||
bool first = true;
|
|
||||||
for (int i = 0; i < 32; i++) {
|
static void locateBits(u32 bits) {
|
||||||
if ((bits >> i) & 1) {
|
bool first = true;
|
||||||
if (!first)
|
for (int i = 0; i < 32; i++) {
|
||||||
cout << ",";
|
if ((bits >> i) & 1) {
|
||||||
first = false;
|
if (!first)
|
||||||
cout << i;
|
cout << ",";
|
||||||
}
|
first = false;
|
||||||
}
|
cout << i;
|
||||||
cout << endl;
|
}
|
||||||
}
|
}
|
||||||
|
}
|
||||||
static void showAll(void) {
|
|
||||||
consoleClear();
|
static void showAll(void) {
|
||||||
|
|
||||||
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) {
|
}
|
||||||
gfxInitDefault();
|
|
||||||
consoleInit(GFX_TOP, NULL);
|
int main(void) {
|
||||||
while (aptMainLoop()) {
|
gfxInitDefault();
|
||||||
gspWaitForVBlank();
|
consoleInit(GFX_TOP, NULL);
|
||||||
showAll();
|
while (aptMainLoop()) {
|
||||||
}
|
showAll();
|
||||||
gfxExit();
|
}
|
||||||
}
|
gfxExit();
|
||||||
|
}
|
||||||
|
|
Loading…
Add table
Reference in a new issue