From 507347741554182720af2e2b3381bd2ee142b53c Mon Sep 17 00:00:00 2001 From: Megamouse Date: Thu, 19 Dec 2024 16:03:34 +0100 Subject: [PATCH] cellGem: Split horizontal and vertical mouse rotation cone setting --- rpcs3/Emu/Cell/Modules/cellGem.cpp | 7 ++++--- .../RSX/Overlays/HomeMenu/overlay_home_menu_settings.cpp | 3 ++- rpcs3/Emu/localized_string_id.h | 3 ++- rpcs3/Emu/system_config.h | 3 ++- rpcs3/rpcs3qt/localized_emu.h | 3 ++- 5 files changed, 12 insertions(+), 7 deletions(-) diff --git a/rpcs3/Emu/Cell/Modules/cellGem.cpp b/rpcs3/Emu/Cell/Modules/cellGem.cpp index ff596cbc34..cb0e1dfb3e 100644 --- a/rpcs3/Emu/Cell/Modules/cellGem.cpp +++ b/rpcs3/Emu/Cell/Modules/cellGem.cpp @@ -956,9 +956,10 @@ static inline void pos_to_gem_state(u32 gem_num, gem_config::gem_controller& con static constexpr f32 PI = 3.14159265f; const auto degree_to_rad = [](f32 degree) -> f32 { return degree * PI / 180.0f; }; - const f32 max_angle_per_side = g_cfg.io.fake_move_rotation_cone / 2.0f; - const f32 roll = -degree_to_rad((image_y - half_height) / half_height * max_angle_per_side); // This is actually the pitch - const f32 pitch = -degree_to_rad((image_x - half_width) / half_width * max_angle_per_side); // This is actually the yaw + const f32 max_angle_per_side_h = g_cfg.io.fake_move_rotation_cone_h / 2.0f; + const f32 max_angle_per_side_v = g_cfg.io.fake_move_rotation_cone_v / 2.0f; + const f32 roll = -degree_to_rad((image_y - half_height) / half_height * max_angle_per_side_v); // This is actually the pitch + const f32 pitch = -degree_to_rad((image_x - half_width) / half_width * max_angle_per_side_h); // This is actually the yaw const f32 yaw = degree_to_rad(0.0f); const f32 cr = std::cos(roll * 0.5f); const f32 sr = std::sin(roll * 0.5f); diff --git a/rpcs3/Emu/RSX/Overlays/HomeMenu/overlay_home_menu_settings.cpp b/rpcs3/Emu/RSX/Overlays/HomeMenu/overlay_home_menu_settings.cpp index 0639e41ea7..fe82f81253 100644 --- a/rpcs3/Emu/RSX/Overlays/HomeMenu/overlay_home_menu_settings.cpp +++ b/rpcs3/Emu/RSX/Overlays/HomeMenu/overlay_home_menu_settings.cpp @@ -83,7 +83,8 @@ namespace rsx add_dropdown(&g_cfg.io.pad_mode, localized_string_id::HOME_MENU_SETTINGS_INPUT_PAD_MODE); add_unsigned_slider(&g_cfg.io.pad_sleep, localized_string_id::HOME_MENU_SETTINGS_INPUT_PAD_SLEEP, " µs", 100); - add_unsigned_slider(&g_cfg.io.fake_move_rotation_cone, localized_string_id::HOME_MENU_SETTINGS_INPUT_FAKE_MOVE_ROTATION_CONE, "°", 1); + add_unsigned_slider(&g_cfg.io.fake_move_rotation_cone_h, localized_string_id::HOME_MENU_SETTINGS_INPUT_FAKE_MOVE_ROTATION_CONE_H, "°", 1); + add_unsigned_slider(&g_cfg.io.fake_move_rotation_cone_v, localized_string_id::HOME_MENU_SETTINGS_INPUT_FAKE_MOVE_ROTATION_CONE_V, "°", 1); apply_layout(); } diff --git a/rpcs3/Emu/localized_string_id.h b/rpcs3/Emu/localized_string_id.h index 4a380422b9..2e560284d6 100644 --- a/rpcs3/Emu/localized_string_id.h +++ b/rpcs3/Emu/localized_string_id.h @@ -223,7 +223,8 @@ enum class localized_string_id HOME_MENU_SETTINGS_INPUT_CAMERA_FLIP, HOME_MENU_SETTINGS_INPUT_PAD_MODE, HOME_MENU_SETTINGS_INPUT_PAD_SLEEP, - HOME_MENU_SETTINGS_INPUT_FAKE_MOVE_ROTATION_CONE, + HOME_MENU_SETTINGS_INPUT_FAKE_MOVE_ROTATION_CONE_H, + HOME_MENU_SETTINGS_INPUT_FAKE_MOVE_ROTATION_CONE_V, HOME_MENU_SETTINGS_ADVANCED, HOME_MENU_SETTINGS_ADVANCED_PREFERRED_SPU_THREADS, HOME_MENU_SETTINGS_ADVANCED_MAX_CPU_PREEMPTIONS, diff --git a/rpcs3/Emu/system_config.h b/rpcs3/Emu/system_config.h index 04a4ce5399..b476d62941 100644 --- a/rpcs3/Emu/system_config.h +++ b/rpcs3/Emu/system_config.h @@ -283,7 +283,8 @@ struct cfg_root : cfg::node cfg::string midi_devices{this, "Emulated Midi devices", "ßßß@@@ßßß@@@ßßß@@@"}; cfg::_bool load_sdl_mappings{ this, "Load SDL GameController Mappings", true }; cfg::_bool debug_overlay{ this, "IO Debug overlay", false, true }; - cfg::uint<1, 180> fake_move_rotation_cone{ this, "Fake Move Rotation Cone", 10, true }; + cfg::uint<1, 180> fake_move_rotation_cone_h{ this, "Fake Move Rotation Cone", 10, true }; + cfg::uint<1, 180> fake_move_rotation_cone_v{ this, "Fake Move Rotation Cone (Vertical)", 10, true }; } io{ this }; diff --git a/rpcs3/rpcs3qt/localized_emu.h b/rpcs3/rpcs3qt/localized_emu.h index 7b4dbd72f9..9dbc9ee3f3 100644 --- a/rpcs3/rpcs3qt/localized_emu.h +++ b/rpcs3/rpcs3qt/localized_emu.h @@ -244,7 +244,8 @@ private: case localized_string_id::HOME_MENU_SETTINGS_INPUT_CAMERA_FLIP: return tr("Camera Flip", "Input"); case localized_string_id::HOME_MENU_SETTINGS_INPUT_PAD_MODE: return tr("Pad Handler Mode", "Input"); case localized_string_id::HOME_MENU_SETTINGS_INPUT_PAD_SLEEP: return tr("Pad Handler Sleep", "Input"); - case localized_string_id::HOME_MENU_SETTINGS_INPUT_FAKE_MOVE_ROTATION_CONE: return tr("Fake PS Move Rotation Cone", "Input"); + case localized_string_id::HOME_MENU_SETTINGS_INPUT_FAKE_MOVE_ROTATION_CONE_H: return tr("Fake PS Move Rotation Cone (Horizontal)", "Input"); + case localized_string_id::HOME_MENU_SETTINGS_INPUT_FAKE_MOVE_ROTATION_CONE_V: return tr("Fake PS Move Rotation Cone (Vertical)", "Input"); case localized_string_id::HOME_MENU_SETTINGS_ADVANCED: return tr("Advanced"); case localized_string_id::HOME_MENU_SETTINGS_ADVANCED_PREFERRED_SPU_THREADS: return tr("Preferred SPU Threads", "Advanced"); case localized_string_id::HOME_MENU_SETTINGS_ADVANCED_MAX_CPU_PREEMPTIONS: return tr("Max Power Saving CPU-Preemptions", "Advanced");