#include <3ds.h> #include 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(); }