From 612e7bf8446574a7cca0d0175afc3ccc06f366af Mon Sep 17 00:00:00 2001 From: SirHumza <204067870+SirHumza@users.noreply.github.com> Date: Fri, 25 Sep 2026 16:27:33 +0200 Subject: [PATCH] installer: normalize X=confirm O=back via EnterButtonAssignment --- installer/ui.c | 26 +++++++++++++++++++++++--- 1 file changed, 23 insertions(+), 3 deletions(-) diff --git a/installer/ui.c b/installer/ui.c index 2ec898a..9fb9506 100644 --- a/installer/ui.c +++ b/installer/ui.c @@ -10,6 +10,7 @@ #include #include #include +#include #include #include @@ -23,6 +24,7 @@ static void base_init(OrbisMsgDialogParam *param){ } static int ui_ready = 0; +static int g_cross_default = 1; /* true unless system says Circle=confirm */ int ui_init(void){ if(ui_ready) return 0; @@ -56,6 +58,15 @@ int ui_init(void){ sceSysmoduleUnloadModule(ORBIS_SYSMODULE_MESSAGE_DIALOG); return -1; } + /* The dialog's fixed mapping treats Circle as the confirm button + * (Japanese-style). Poll the user's Enter Button Assignment so + * we can invert the Yes/No interpretation and always make X + * confirm — the behaviour every other app on the console uses. */ + { + int32_t v = 0; + if (sceSystemServiceParamGetInt(ORBIS_SYSTEM_SERVICE_PARAM_ID_ENTER_BUTTON_ASSIGN, &v) == 0) + g_cross_default = (v == ORBIS_SYSTEM_PARAM_ENTER_BUTTON_ASSIGN_CROSS); + } ui_ready = 1; return 0; } @@ -91,8 +102,10 @@ int ui_confirm(const char *msg){ base_init(¶m); memset(&um, 0, sizeof um); um.msg = msg; - /* X = enter (Yes focused), O = back/decline. The default FOCUS_NO - * variant puts the confirm button on No, which inverts the wizard. */ + /* Yes/No dialog. The dialog's fixed layout treats Circle as + * confirm and Cross as cancel (Japanese default); the user's + * system setting flips this. We read the assign and invert so + * that X always confirms — the behaviour every other app uses. */ um.buttonType = ORBIS_MSG_DIALOG_BUTTON_TYPE_YESNO; param.userMsgParam = &um; if(sceMsgDialogOpen(¶m) < 0){ sceMsgDialogTerminate(); return -1; } @@ -101,7 +114,14 @@ int ui_confirm(const char *msg){ sceMsgDialogClose(); sceMsgDialogGetResult(&res); sceMsgDialogTerminate(); - return res.buttonId == ORBIS_MSG_DIALOG_BUTTON_ID_YES ? 1 : 0; + /* Button mapping: the dialog's fixed layout treats Circle as + * confirm and Cross as cancel (Japanese default). The user's + * system setting flips this. Invert the interpretation when + * Circle is the system assign so that X always confirms — the + * behaviour every other app on the console uses. */ + int yes = (res.buttonId == ORBIS_MSG_DIALOG_BUTTON_ID_YES) + ^ (g_cross_default == 0); + return yes ? 1 : 0; } static int progress_open = 0;