Skip to content

Commit 22dafed

Browse files
committed
(WiiU) Add new "Allow Wii U HOME menu" setting
Users who prefer the old legacy behaviour of the Home button opening the RetroArch menu, they can disable the HBM here.
1 parent 0156f13 commit 22dafed

10 files changed

Lines changed: 77 additions & 1 deletion

File tree

config.def.h

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -943,6 +943,12 @@
943943
#define DEFAULT_ALL_USERS_CONTROL_MENU false
944944
#endif
945945

946+
#if defined(WIIU)
947+
/* On Wii U, whether the HOME button should open the OS's HOME menu, or simply toggle the RetroArch menu (as it did in
948+
* older HBL/Tiramisu builds of RetroArch) */
949+
#define DEFAULT_WIIU_ENABLE_HBM true
950+
#endif
951+
946952
#define DEFAULT_QUIT_PRESS_TWICE true
947953

948954
#define DEFAULT_LOG_TO_FILE false

configuration.c

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2103,6 +2103,9 @@ static struct config_bool_setting *populate_settings_bool(
21032103
#endif
21042104
#if defined(HAVE_DINPUT) || defined(HAVE_WINRAWINPUT)
21052105
SETTING_BOOL("input_nowinkey_enable", &settings->bools.input_nowinkey_enable, true, false, false);
2106+
#endif
2107+
#ifdef WIIU
2108+
SETTING_BOOL("input_wiiu_enable_hbm", &settings->bools.input_wiiu_enable_hbm, true, DEFAULT_WIIU_ENABLE_HBM, false);
21062109
#endif
21072110
SETTING_BOOL("input_sensors_enable", &settings->bools.input_sensors_enable, true, DEFAULT_INPUT_SENSORS_ENABLE, false);
21082111
SETTING_BOOL("vibrate_on_keypress", &settings->bools.vibrate_on_keypress, true, DEFAULT_VIBRATE_ON_KEYPRESS, false);

configuration.h

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -704,6 +704,9 @@ typedef struct settings
704704
bool input_touch_vmouse_trackball;
705705
bool input_touch_vmouse_gesture;
706706
#endif
707+
#ifdef WIIU
708+
bool input_wiiu_enable_hbm;
709+
#endif
707710

708711
/* Frame time counter */
709712
bool frame_time_counter_reset_after_fastforwarding;

frontend/drivers/platform_wiiu.c

Lines changed: 18 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -47,6 +47,7 @@
4747
#include <whb/log_udp.h>
4848
#include <whb/log_cafe.h>
4949

50+
#include "../configuration.h"
5051
#include "../frontend.h"
5152
#include "../frontend_driver.h"
5253
#include "../../file_path_special.h"
@@ -596,13 +597,25 @@ static bool swap_is_pending(void *start_time)
596597
return last_vsync < *(OSTime *)start_time;
597598
}
598599

600+
static bool in_main = false;
601+
static uint32_t proc_home_button_deny(void *context)
602+
{
603+
/* Don't toggle the menu in, like, the middle of a core switch */
604+
if (in_main)
605+
command_event(CMD_EVENT_MENU_TOGGLE, NULL);
606+
607+
return 0;
608+
}
609+
599610
static void main_loop(void)
600611
{
601612
OSTime start_time;
602613
ProcUIStatus os_status;
603614
int status;
615+
settings_t *settings = config_get_ptr();
604616

605-
OSEnableHomeButtonMenu(TRUE);
617+
ProcUIRegisterCallback(PROCUI_CALLBACK_HOME_BUTTON_DENIED, &proc_home_button_deny, NULL, 1000);
618+
in_main = true;
606619

607620
while ((os_status = ProcUIProcessMessages(TRUE)) != PROCUI_STATUS_EXITING)
608621
{
@@ -631,8 +644,12 @@ static void main_loop(void)
631644
}
632645
ProcUIDrawDoneRelease();
633646
}
647+
648+
if (OSIsHomeButtonMenuEnabled() != settings->bools.input_wiiu_enable_hbm)
649+
OSEnableHomeButtonMenu(settings->bools.input_wiiu_enable_hbm);
634650
}
635651

652+
in_main = false;
636653
OSEnableHomeButtonMenu(FALSE);
637654
}
638655
#endif

intl/msg_hash_lbl.h

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1852,6 +1852,12 @@ MSG_HASH(
18521852
"input_android_physical_keyboard"
18531853
)
18541854
#endif
1855+
#ifdef WIIU
1856+
MSG_HASH(
1857+
MENU_ENUM_LABEL_INPUT_WIIU_ENABLE_HBM,
1858+
"input_wiiu_enable_hbm"
1859+
)
1860+
#endif
18551861
MSG_HASH(
18561862
MENU_ENUM_LABEL_INPUT_SENSORS_ENABLE,
18571863
"input_sensors_enable"

intl/msg_hash_us.h

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3613,6 +3613,16 @@ MSG_HASH(
36133613
MENU_ENUM_SUBLABEL_INPUT_ALL_USERS_CONTROL_MENU,
36143614
"Allow any user to control the menu. If disabled, only User 1 can control the menu."
36153615
)
3616+
#ifdef WIIU
3617+
MSG_HASH(
3618+
MENU_ENUM_LABEL_VALUE_INPUT_WIIU_ENABLE_HBM,
3619+
"Allow Wii U HOME menu"
3620+
)
3621+
MSG_HASH(
3622+
MENU_ENUM_SUBLABEL_INPUT_WIIU_ENABLE_HBM,
3623+
"Enable the Wii U's HOME menu overlay. If disabled, the Home button toggles the RetroArch menu."
3624+
)
3625+
#endif
36163626

36173627
/* Settings > Input > Hotkeys */
36183628

menu/cbs/menu_cbs_sublabel.c

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -534,6 +534,9 @@ DEFAULT_SUBLABEL_MACRO(action_bind_sublabel_location_allow, MENU_
534534
DEFAULT_SUBLABEL_MACRO(action_bind_sublabel_input_max_users, MENU_ENUM_SUBLABEL_INPUT_MAX_USERS)
535535
DEFAULT_SUBLABEL_MACRO(action_bind_sublabel_input_poll_type_behavior, MENU_ENUM_SUBLABEL_INPUT_POLL_TYPE_BEHAVIOR)
536536
DEFAULT_SUBLABEL_MACRO(action_bind_sublabel_input_all_users_control_menu, MENU_ENUM_SUBLABEL_INPUT_ALL_USERS_CONTROL_MENU)
537+
#ifdef WIIU
538+
DEFAULT_SUBLABEL_MACRO(action_bind_sublabel_input_wiiu_enable_hbm, MENU_ENUM_SUBLABEL_INPUT_WIIU_ENABLE_HBM)
539+
#endif
537540
DEFAULT_SUBLABEL_MACRO(action_bind_sublabel_input_bind_timeout, MENU_ENUM_SUBLABEL_INPUT_BIND_TIMEOUT)
538541
DEFAULT_SUBLABEL_MACRO(action_bind_sublabel_input_bind_hold, MENU_ENUM_SUBLABEL_INPUT_BIND_HOLD)
539542
DEFAULT_SUBLABEL_MACRO(action_bind_sublabel_audio_volume, MENU_ENUM_SUBLABEL_AUDIO_VOLUME)
@@ -4597,6 +4600,11 @@ int menu_cbs_init_bind_sublabel(menu_file_list_cbs_t *cbs,
45974600
case MENU_ENUM_LABEL_INPUT_ALL_USERS_CONTROL_MENU:
45984601
BIND_ACTION_SUBLABEL(cbs, action_bind_sublabel_input_all_users_control_menu);
45994602
break;
4603+
#ifdef WIIU
4604+
case MENU_ENUM_LABEL_INPUT_WIIU_ENABLE_HBM:
4605+
BIND_ACTION_SUBLABEL(cbs, action_bind_sublabel_input_wiiu_enable_hbm);
4606+
break;
4607+
#endif
46004608
case MENU_ENUM_LABEL_INPUT_POLL_TYPE_BEHAVIOR:
46014609
BIND_ACTION_SUBLABEL(cbs, action_bind_sublabel_input_poll_type_behavior);
46024610
break;

menu/menu_displaylist.c

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7839,6 +7839,9 @@ unsigned menu_displaylist_build_list(
78397839
{MENU_ENUM_LABEL_MENU_INPUT_SWAP_OK_CANCEL, PARSE_ONLY_BOOL, true },
78407840
{MENU_ENUM_LABEL_MENU_INPUT_SWAP_SCROLL, PARSE_ONLY_BOOL, true },
78417841
{MENU_ENUM_LABEL_INPUT_ALL_USERS_CONTROL_MENU, PARSE_ONLY_BOOL, true },
7842+
#ifdef WIIU
7843+
{MENU_ENUM_LABEL_INPUT_WIIU_ENABLE_HBM, PARSE_ONLY_BOOL, true },
7844+
#endif
78427845
{MENU_ENUM_LABEL_MENU_SCROLL_FAST, PARSE_ONLY_BOOL, true },
78437846
{MENU_ENUM_LABEL_MENU_SCROLL_DELAY, PARSE_ONLY_UINT, true },
78447847
{MENU_ENUM_LABEL_INPUT_DISABLE_INFO_BUTTON, PARSE_ONLY_BOOL, true },

menu/menu_setting.c

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15204,6 +15204,24 @@ static bool setting_append_list(
1520415204
SD_FLAG_NONE
1520515205
);
1520615206

15207+
#ifdef WIIU
15208+
CONFIG_BOOL(
15209+
list, list_info,
15210+
&settings->bools.input_wiiu_enable_hbm,
15211+
MENU_ENUM_LABEL_INPUT_WIIU_ENABLE_HBM,
15212+
MENU_ENUM_LABEL_VALUE_INPUT_WIIU_ENABLE_HBM,
15213+
DEFAULT_WIIU_ENABLE_HBM,
15214+
MENU_ENUM_LABEL_VALUE_OFF,
15215+
MENU_ENUM_LABEL_VALUE_ON,
15216+
&group_info,
15217+
&subgroup_info,
15218+
parent_group,
15219+
general_write_handler,
15220+
general_read_handler,
15221+
SD_FLAG_NONE
15222+
);
15223+
#endif
15224+
1520715225
CONFIG_BOOL(
1520815226
list, list_info,
1520915227
&settings->bools.input_remap_binds_enable,

msg_hash.h

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1346,6 +1346,8 @@ enum msg_hash_enums
13461346

13471347
MENU_LABEL(ANDROID_INPUT_DISCONNECT_WORKAROUND),
13481348

1349+
MENU_LABEL(INPUT_WIIU_ENABLE_HBM),
1350+
13491351
MENU_ENUM_LABEL_VALUE_QUIT_ON_CLOSE_CONTENT_DISABLED,
13501352
MENU_ENUM_LABEL_VALUE_QUIT_ON_CLOSE_CONTENT_ENABLED,
13511353
MENU_ENUM_LABEL_VALUE_QUIT_ON_CLOSE_CONTENT_CLI,

0 commit comments

Comments
 (0)