Skip to content
This repository was archived by the owner on Sep 29, 2021. It is now read-only.

Commit b58cfde

Browse files
committed
Change how to exit the 3DS application
3DSX (Homebrew): * press START+UP+L+B as usual * START+SELECT in debug mode (still, as it was) CIA: * press HOME button to return to HOME menu This means that for the CIA-build, every combination of buttons is now valid and you cannot accidentally press one that exits the app.
1 parent aec1a57 commit b58cfde

2 files changed

Lines changed: 10 additions & 7 deletions

File tree

3DS/source/hid.c

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@
66

77
int hidCollectData(struct hidInfo *info)
88
{
9+
hidScanInput();
910
info->keys.up = hidKeysUp();
1011
info->keys.down = hidKeysDown();
1112
info->keys.held = hidKeysHeld();

3DS/source/main.c

Lines changed: 9 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -26,6 +26,7 @@
2626

2727
#include <3ds/result.h>
2828
#include <3ds/console.h>
29+
#include <3ds/env.h>
2930

3031
#include <3ds/services/apt.h>
3132
#include <3ds/services/hid.h>
@@ -102,17 +103,18 @@ int main(int argc, char **argv)
102103
goto failure;
103104
}
104105

105-
printf("Press " EXIT_DESC " to exit.\n");
106+
bool isHomebrew = envIsHomebrew();
107+
printf("Press %s to exit.\n", isHomebrew ? EXIT_DESC : "HOME");
106108
fflush(stdout);
107109

108-
u32 keys = 0;
109110
while (aptMainLoop()) {
110-
hidScanInput();
111-
keys = hidKeysHeld();
112111

113-
if (keys == EXIT_KEYS) {
114-
res = RL_SUCCESS;
115-
break;
112+
if (isHomebrew) {
113+
hidScanInput();
114+
if (hidKeysHeld() == EXIT_KEYS) {
115+
res = RL_SUCCESS;
116+
break;
117+
}
116118
}
117119

118120
if (ctrollerSendHIDInfo()) {

0 commit comments

Comments
 (0)