Skip to content

Commit

Permalink
fix reset button in touchscreen config turning off backlight
Browse files Browse the repository at this point in the history
  • Loading branch information
skyfloogle committed Apr 18, 2024
1 parent c4b6ca9 commit 5a2dffa
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 8 deletions.
2 changes: 1 addition & 1 deletion include/vb_gui.h
Original file line number Diff line number Diff line change
Expand Up @@ -64,6 +64,6 @@ bool guiShouldPause();
void toggleVsync(bool enable);
void toggleAnaglyph(bool enable, bool also_update_vsync);
void aptBacklight(APT_HookType hook, void* param);
int guiGetInput(bool do_switching);
int guiGetInput(bool ingame);

#endif //VB_GUI_H
14 changes: 7 additions & 7 deletions source/3ds/gui_hard.c
Original file line number Diff line number Diff line change
Expand Up @@ -1689,25 +1689,25 @@ bool guiShouldPause() {
return (touch_pos.px < tVBOpt.PAUSE_RIGHT && (touch_pos.px >= 32 || (touch_pos.py > (old_2ds ? 0 : 32) && touch_pos.py < 240-32))) && backlightEnabled;
}

int guiGetInput(bool do_switching) {
int guiGetInput(bool ingame) {
touchPosition touch_pos;
hidTouchRead(&touch_pos);
if (backlightEnabled) {
if ((hidKeysHeld() & KEY_TOUCH) && guiShouldSwitch()) {
if (do_switching && (hidKeysDown() & KEY_TOUCH)) setTouchControls(!buttons_on_screen);
if (ingame && (hidKeysDown() & KEY_TOUCH)) setTouchControls(!buttons_on_screen);
return 0;
}
if (do_switching) {
if (ingame) {
if (touch_pos.px < 32 && touch_pos.py >= 240-32) {
if ((tVBOpt.FF_TOGGLE ? hidKeysDown() : hidKeysHeld()) & KEY_TOUCH) {
tVBOpt.FASTFORWARD = !tVBOpt.FASTFORWARD;
}
return 0;
}
}
if (hidKeysDown() & KEY_TOUCH && (touch_pos.px <= 32 && touch_pos.py <= 32) && !old_2ds) {
backlightEnabled = toggleBacklight(false);
return 0;
if (hidKeysDown() & KEY_TOUCH && (touch_pos.px <= 32 && touch_pos.py <= 32) && !old_2ds) {
backlightEnabled = toggleBacklight(false);
return 0;
}
}
if (touch_pos.px < tVBOpt.PAUSE_RIGHT) {
return 0;
Expand Down

0 comments on commit 5a2dffa

Please sign in to comment.