diff --git a/rpcs3/Emu/Cell/Modules/cellSysutil.cpp b/rpcs3/Emu/Cell/Modules/cellSysutil.cpp index 328f87e083..accb2f131f 100644 --- a/rpcs3/Emu/Cell/Modules/cellSysutil.cpp +++ b/rpcs3/Emu/Cell/Modules/cellSysutil.cpp @@ -143,7 +143,7 @@ s32 cellSysutilGetSystemParamInt(CellSysutilParamId id, vm::ptr value) break; case CELL_SYSUTIL_SYSTEMPARAM_ID_ENTER_BUTTON_ASSIGN: - *value = CELL_SYSUTIL_ENTER_BUTTON_ASSIGN_CROSS; + *value = g_cfg.sys.enter_button_assignment; break; case CELL_SYSUTIL_SYSTEMPARAM_ID_DATE_FORMAT: diff --git a/rpcs3/Emu/RSX/Overlays/overlay_controls.h b/rpcs3/Emu/RSX/Overlays/overlay_controls.h index 1fc9dde301..50e6b47c87 100644 --- a/rpcs3/Emu/RSX/Overlays/overlay_controls.h +++ b/rpcs3/Emu/RSX/Overlays/overlay_controls.h @@ -1472,8 +1472,17 @@ namespace rsx m_scroll_indicator_top->set_image_resource(resource_config::standard_image_resource::fade_top); m_scroll_indicator_bottom->set_image_resource(resource_config::standard_image_resource::fade_bottom); - m_accept_btn->set_image_resource(resource_config::standard_image_resource::cross); - m_cancel_btn->set_image_resource(resource_config::standard_image_resource::circle); + + if (g_cfg.sys.enter_button_assignment == enter_button_assign::circle) + { + m_accept_btn->set_image_resource(resource_config::standard_image_resource::circle); + m_cancel_btn->set_image_resource(resource_config::standard_image_resource::cross); + } + else + { + m_accept_btn->set_image_resource(resource_config::standard_image_resource::cross); + m_cancel_btn->set_image_resource(resource_config::standard_image_resource::circle); + } m_scroll_indicator_bottom->set_pos(0, height - 40); m_accept_btn->set_pos(30, height + 20); diff --git a/rpcs3/Emu/RSX/Overlays/overlays.h b/rpcs3/Emu/RSX/Overlays/overlays.h index 44c7d1a27a..e70d118b4e 100644 --- a/rpcs3/Emu/RSX/Overlays/overlays.h +++ b/rpcs3/Emu/RSX/Overlays/overlays.h @@ -153,13 +153,13 @@ namespace rsx button_id = pad_button::triangle; break; case CELL_PAD_CTRL_CIRCLE: - button_id = pad_button::circle; + button_id = g_cfg.sys.enter_button_assignment == enter_button_assign::circle ? pad_button::cross : pad_button::circle; break; case CELL_PAD_CTRL_SQUARE: button_id = pad_button::square; break; case CELL_PAD_CTRL_CROSS: - button_id = pad_button::cross; + button_id = g_cfg.sys.enter_button_assignment == enter_button_assign::circle ? pad_button::circle : pad_button::cross; break; } } @@ -790,18 +790,27 @@ namespace rsx progress_1.back_color = color4f(0.25f, 0.f, 0.f, 0.85f); progress_2.back_color = color4f(0.25f, 0.f, 0.f, 0.85f); - btn_ok.set_image_resource(resource_config::standard_image_resource::cross); btn_ok.set_text("Yes"); btn_ok.set_size(140, 30); btn_ok.set_pos(545, 420); btn_ok.set_font("Arial", 16); - btn_cancel.set_image_resource(resource_config::standard_image_resource::circle); btn_cancel.set_text("No"); btn_cancel.set_size(140, 30); btn_cancel.set_pos(685, 420); btn_cancel.set_font("Arial", 16); + if (g_cfg.sys.enter_button_assignment == enter_button_assign::circle) + { + btn_ok.set_image_resource(resource_config::standard_image_resource::circle); + btn_cancel.set_image_resource(resource_config::standard_image_resource::cross); + } + else + { + btn_ok.set_image_resource(resource_config::standard_image_resource::cross); + btn_cancel.set_image_resource(resource_config::standard_image_resource::circle); + } + if (use_custom_background) { std::string root_path = Emu.GetBoot(); diff --git a/rpcs3/Emu/System.cpp b/rpcs3/Emu/System.cpp index 0cf0fc8703..e8d3d4f745 100644 --- a/rpcs3/Emu/System.cpp +++ b/rpcs3/Emu/System.cpp @@ -257,6 +257,21 @@ void fmt_class_string::format(std::string& out, u64 arg) }); } +template <> +void fmt_class_string::format(std::string& out, u64 arg) +{ + format_enum(out, arg, [](enter_button_assign value) + { + switch (value) + { + case enter_button_assign::circle: return "Enter with circle"; + case enter_button_assign::cross: return "Enter with cross"; + } + + return unknown; + }); +} + void Emulator::Init() { if (!g_tty) diff --git a/rpcs3/Emu/System.h b/rpcs3/Emu/System.h index 6a8b7e4cb2..b97e89f6be 100644 --- a/rpcs3/Emu/System.h +++ b/rpcs3/Emu/System.h @@ -170,6 +170,12 @@ enum class tsx_usage forced, }; +enum enter_button_assign +{ + circle = 0, // CELL_SYSUTIL_ENTER_BUTTON_ASSIGN_CIRCLE + cross = 1 // CELL_SYSUTIL_ENTER_BUTTON_ASSIGN_CROSS +}; + enum CellNetCtlState : s32; enum CellSysutilLang : s32; @@ -523,6 +529,7 @@ struct cfg_root : cfg::node node_sys(cfg::node* _this) : cfg::node(_this, "System") {} cfg::_enum language{this, "Language", (CellSysutilLang)1}; // CELL_SYSUTIL_LANG_ENGLISH_US + cfg::_enum enter_button_assignment{this, "Enter button assignment", enter_button_assign::cross}; } sys{this}; diff --git a/rpcs3/Json/tooltips.json b/rpcs3/Json/tooltips.json index c5a436337b..d9e35067e3 100644 --- a/rpcs3/Json/tooltips.json +++ b/rpcs3/Json/tooltips.json @@ -137,6 +137,7 @@ }, "system": { "sysLangBox": "Some games may fail to boot if the system language is not available in the game itself.\nOther games will switch language automatically to what is selected here.\nIt is recommended leaving this on a language supported by the game.", + "enterButtonAssignment": "The button used for enter/accept/confirm in system dialogs.\nChange this to use the circle button instead, which is the default configuration on japanese systems and in many japanese games.\nIn these cases having the cross button assigned can often lead to confusion.", "enableHostRoot": "Required for some Homebrew.\nIf unsure, don't use this option." } } diff --git a/rpcs3/rpcs3qt/emu_settings.h b/rpcs3/rpcs3qt/emu_settings.h index b8969e7f7d..80d68b8071 100644 --- a/rpcs3/rpcs3qt/emu_settings.h +++ b/rpcs3/rpcs3qt/emu_settings.h @@ -122,8 +122,9 @@ public: // Network ConnectionStatus, - // Language + // System Language, + EnterButtonAssignment, EnableHostRoot, // Virtual File System @@ -322,8 +323,9 @@ private: { ConnectionStatus, { "Net", "Connection status"}}, // System - { Language, { "System", "Language"}}, - { EnableHostRoot, { "VFS", "Enable /host_root/"}}, + { Language, { "System", "Language"}}, + { EnterButtonAssignment, { "System", "Enter button assignment"}}, + { EnableHostRoot, { "VFS", "Enable /host_root/"}}, // Virtual File System { emulatorLocation, { "VFS", "$(EmulatorDir)"}}, diff --git a/rpcs3/rpcs3qt/settings_dialog.cpp b/rpcs3/rpcs3qt/settings_dialog.cpp index db276eb47e..8df5029a89 100644 --- a/rpcs3/rpcs3qt/settings_dialog.cpp +++ b/rpcs3/rpcs3qt/settings_dialog.cpp @@ -765,6 +765,35 @@ settings_dialog::settings_dialog(std::shared_ptr guiSettings, std: xemu_settings->EnhanceCheckBox(ui->enableHostRoot, emu_settings::EnableHostRoot); SubscribeTooltip(ui->enableHostRoot, json_sys["enableHostRoot"].toString()); + // Radio Buttons + + SubscribeTooltip(ui->gb_enterButtonAssignment, json_sys["enterButtonAssignment"].toString()); + + // creating this in ui file keeps scrambling the order... + QButtonGroup *enterButtonAssignmentBG = new QButtonGroup(this); + enterButtonAssignmentBG->addButton(ui->enterButtonAssignCircle, 0); + enterButtonAssignmentBG->addButton(ui->enterButtonAssignCross, 1); + + { // EnterButtonAssignment options + QString assigned_button = qstr(xemu_settings->GetSetting(emu_settings::EnterButtonAssignment)); + QStringList assignable_buttons = xemu_settings->GetSettingOptions(emu_settings::EnterButtonAssignment); + + for (int i = 0; i < assignable_buttons.count(); i++) + { + enterButtonAssignmentBG->button(i)->setText(assignable_buttons[i]); + + if (assignable_buttons[i] == assigned_button) + { + enterButtonAssignmentBG->button(i)->setChecked(true); + } + + connect(enterButtonAssignmentBG->button(i), &QAbstractButton::pressed, [=]() + { + xemu_settings->SetSetting(emu_settings::EnterButtonAssignment, sstr(assignable_buttons[i])); + }); + } + } + // _ _ _ _ _______ _ // | \ | | | | | | |__ __| | | // | \| | ___| |___ _____ _ __| | __ | | __ _| |__ diff --git a/rpcs3/rpcs3qt/settings_dialog.ui b/rpcs3/rpcs3qt/settings_dialog.ui index 7b4c7909d4..0c1a3e2053 100644 --- a/rpcs3/rpcs3qt/settings_dialog.ui +++ b/rpcs3/rpcs3qt/settings_dialog.ui @@ -1015,7 +1015,7 @@ System - + @@ -1076,6 +1076,39 @@ + + + + + + Enter Button Assignment + + + + + + Enter with circle + + + + + + + Enter with cross + + + + + + + + + + + + + +