From 248dd3823b6167e1e408bd89b2bd9f80260d9b32 Mon Sep 17 00:00:00 2001 From: pineappleEA Date: Fri, 10 Feb 2023 20:19:54 +0100 Subject: [PATCH] early-access version 3380 --- README.md | 2 +- src/audio_core/sink/cubeb_sink.cpp | 20 ++++++++ src/common/settings.h | 1 + src/core/hid/emulated_controller.cpp | 22 ++++++++- src/core/hid/emulated_controller.h | 5 +- src/core/hid/hid_types.h | 7 +++ src/core/hid/motion_input.cpp | 12 +++-- src/core/hid/motion_input.h | 15 ++++++ src/core/hle/kernel/svc_version.h | 4 +- src/core/hle/service/hid/controllers/npad.cpp | 7 ++- src/core/hle/service/hid/controllers/npad.h | 14 ++---- src/core/hle/service/hid/hid.cpp | 6 +-- src/input_common/drivers/joycon.cpp | 49 ++++++++++++++++++- src/input_common/drivers/joycon.h | 1 + src/input_common/drivers/sdl_driver.cpp | 18 ++++++- src/input_common/helpers/joycon_driver.cpp | 3 +- src/yuzu/configuration/config.cpp | 2 + .../configure_input_advanced.cpp | 2 + .../configuration/configure_input_advanced.ui | 22 +++++++-- src/yuzu/main.cpp | 2 + src/yuzu_cmd/config.cpp | 1 + 21 files changed, 184 insertions(+), 31 deletions(-) diff --git a/README.md b/README.md index 7e51d1f53..8cc1f3ead 100755 --- a/README.md +++ b/README.md @@ -1,7 +1,7 @@ yuzu emulator early access ============= -This is the source code for early-access 3378. +This is the source code for early-access 3380. ## Legal Notice diff --git a/src/audio_core/sink/cubeb_sink.cpp b/src/audio_core/sink/cubeb_sink.cpp index 8af3fa4f1..3c6f05a9a 100755 --- a/src/audio_core/sink/cubeb_sink.cpp +++ b/src/audio_core/sink/cubeb_sink.cpp @@ -302,11 +302,21 @@ std::vector ListCubebSinkDevices(bool capture) { std::vector device_list; cubeb* ctx; +#ifdef _WIN32 + auto com_init_result = CoInitializeEx(nullptr, COINIT_MULTITHREADED); +#endif + if (cubeb_init(&ctx, "yuzu Device Enumerator", nullptr) != CUBEB_OK) { LOG_CRITICAL(Audio_Sink, "cubeb_init failed"); return {}; } +#ifdef _WIN32 + if (SUCCEEDED(com_init_result)) { + CoUninitialize(); + } +#endif + auto type{capture ? CUBEB_DEVICE_TYPE_INPUT : CUBEB_DEVICE_TYPE_OUTPUT}; cubeb_device_collection collection; if (cubeb_enumerate_devices(ctx, type, &collection) != CUBEB_OK) { @@ -329,12 +339,22 @@ std::vector ListCubebSinkDevices(bool capture) { u32 GetCubebLatency() { cubeb* ctx; +#ifdef _WIN32 + auto com_init_result = CoInitializeEx(nullptr, COINIT_MULTITHREADED); +#endif + if (cubeb_init(&ctx, "yuzu Latency Getter", nullptr) != CUBEB_OK) { LOG_CRITICAL(Audio_Sink, "cubeb_init failed"); // Return a large latency so we choose SDL instead. return 10000u; } +#ifdef _WIN32 + if (SUCCEEDED(com_init_result)) { + CoUninitialize(); + } +#endif + cubeb_stream_params params{}; params.rate = TargetSampleRate; params.channels = 2; diff --git a/src/common/settings.h b/src/common/settings.h index 5dd4d8b43..370d3ccca 100755 --- a/src/common/settings.h +++ b/src/common/settings.h @@ -488,6 +488,7 @@ struct Values { Setting enable_raw_input{false, "enable_raw_input"}; Setting controller_navigation{true, "controller_navigation"}; Setting enable_joycon_driver{true, "enable_joycon_driver"}; + Setting enable_procon_driver{false, "enable_procon_driver"}; SwitchableSetting vibration_enabled{true, "vibration_enabled"}; SwitchableSetting enable_accurate_vibrations{false, "enable_accurate_vibrations"}; diff --git a/src/core/hid/emulated_controller.cpp b/src/core/hid/emulated_controller.cpp index b57288f68..81b0166cd 100755 --- a/src/core/hid/emulated_controller.cpp +++ b/src/core/hid/emulated_controller.cpp @@ -957,7 +957,7 @@ void EmulatedController::SetMotion(const Common::Input::CallbackStatus& callback raw_status.gyro.y.value, raw_status.gyro.z.value, }); - emulated.SetGyroThreshold(raw_status.gyro.x.properties.threshold); + emulated.SetUserGyroThreshold(raw_status.gyro.x.properties.threshold); emulated.UpdateRotation(raw_status.delta_timestamp); emulated.UpdateOrientation(raw_status.delta_timestamp); force_update_motion = raw_status.force_update; @@ -1284,6 +1284,26 @@ void EmulatedController::SetLedPattern() { } } +void EmulatedController::SetGyroscopeZeroDriftMode(GyroscopeZeroDriftMode mode) { + for (auto& motion : controller.motion_values) { + switch (mode) { + case GyroscopeZeroDriftMode::Loose: + motion_sensitivity = motion.emulated.IsAtRestLoose; + motion.emulated.SetGyroThreshold(motion.emulated.ThresholdLoose); + break; + case GyroscopeZeroDriftMode::Tight: + motion_sensitivity = motion.emulated.IsAtRestThight; + motion.emulated.SetGyroThreshold(motion.emulated.ThresholdThight); + break; + case GyroscopeZeroDriftMode::Standard: + default: + motion_sensitivity = motion.emulated.IsAtRestStandard; + motion.emulated.SetGyroThreshold(motion.emulated.ThresholdStandard); + break; + } + } +} + void EmulatedController::SetSupportedNpadStyleTag(NpadStyleTag supported_styles) { supported_style_tag = supported_styles; if (!is_connected) { diff --git a/src/core/hid/emulated_controller.h b/src/core/hid/emulated_controller.h index f48c4f50d..4da1e9d60 100755 --- a/src/core/hid/emulated_controller.h +++ b/src/core/hid/emulated_controller.h @@ -398,6 +398,9 @@ public: /// Asks the output device to change the player led pattern void SetLedPattern(); + /// Changes sensitivity of the motion sensor + void SetGyroscopeZeroDriftMode(GyroscopeZeroDriftMode mode); + /** * Adds a callback to the list of events * @param update_callback A ConsoleUpdateCallback that will be triggered @@ -523,7 +526,7 @@ private: bool is_connected{false}; bool is_configuring{false}; bool system_buttons_enabled{true}; - f32 motion_sensitivity{0.01f}; + f32 motion_sensitivity{Core::HID::MotionInput::IsAtRestStandard}; bool force_update_motion{false}; u32 turbo_button_state{0}; diff --git a/src/core/hid/hid_types.h b/src/core/hid/hid_types.h index daba6f399..156480228 100755 --- a/src/core/hid/hid_types.h +++ b/src/core/hid/hid_types.h @@ -282,6 +282,13 @@ enum class VibrationGcErmCommand : u64 { StopHard = 2, }; +// This is nn::hid::GyroscopeZeroDriftMode +enum class GyroscopeZeroDriftMode : u32 { + Loose = 0, + Standard = 1, + Tight = 2, +}; + // This is nn::hid::NpadStyleTag struct NpadStyleTag { union { diff --git a/src/core/hid/motion_input.cpp b/src/core/hid/motion_input.cpp index cecffc3e1..2e77b8e39 100755 --- a/src/core/hid/motion_input.cpp +++ b/src/core/hid/motion_input.cpp @@ -9,7 +9,7 @@ namespace Core::HID { MotionInput::MotionInput() { // Initialize PID constants with default values SetPID(0.3f, 0.005f, 0.0f); - SetGyroThreshold(0.007f); + SetGyroThreshold(ThresholdStandard); } void MotionInput::SetPID(f32 new_kp, f32 new_ki, f32 new_kd) { @@ -26,11 +26,11 @@ void MotionInput::SetGyroscope(const Common::Vec3f& gyroscope) { gyro = gyroscope - gyro_bias; // Auto adjust drift to minimize drift - if (!IsMoving(0.1f)) { + if (!IsMoving(IsAtRestRelaxed)) { gyro_bias = (gyro_bias * 0.9999f) + (gyroscope * 0.0001f); } - if (gyro.Length() < gyro_threshold) { + if (gyro.Length() < gyro_threshold * user_gyro_threshold) { gyro = {}; } else { only_accelerometer = false; @@ -49,6 +49,10 @@ void MotionInput::SetGyroThreshold(f32 threshold) { gyro_threshold = threshold; } +void MotionInput::SetUserGyroThreshold(f32 threshold) { + user_gyro_threshold = threshold / ThresholdStandard; +} + void MotionInput::EnableReset(bool reset) { reset_enabled = reset; } @@ -208,7 +212,7 @@ void MotionInput::ResetOrientation() { if (!reset_enabled || only_accelerometer) { return; } - if (!IsMoving(0.5f) && accel.z <= -0.9f) { + if (!IsMoving(IsAtRestRelaxed) && accel.z <= -0.9f) { ++reset_counter; if (reset_counter > 900) { quat.w = 0; diff --git a/src/core/hid/motion_input.h b/src/core/hid/motion_input.h index 24e231a21..9e90d2a57 100755 --- a/src/core/hid/motion_input.h +++ b/src/core/hid/motion_input.h @@ -11,6 +11,15 @@ namespace Core::HID { class MotionInput { public: + static constexpr float ThresholdLoose = 0.01f; + static constexpr float ThresholdStandard = 0.007f; + static constexpr float ThresholdThight = 0.002f; + + static constexpr float IsAtRestRelaxed = 0.05f; + static constexpr float IsAtRestLoose = 0.02f; + static constexpr float IsAtRestStandard = 0.01f; + static constexpr float IsAtRestThight = 0.005f; + explicit MotionInput(); MotionInput(const MotionInput&) = default; @@ -26,6 +35,9 @@ public: void SetGyroBias(const Common::Vec3f& bias); void SetGyroThreshold(f32 threshold); + /// Applies a modifier on top of the normal gyro threshold + void SetUserGyroThreshold(f32 threshold); + void EnableReset(bool reset); void ResetRotations(); @@ -74,6 +86,9 @@ private: // Minimum gyro amplitude to detect if the device is moving f32 gyro_threshold = 0.0f; + // Multiplies gyro_threshold by this value + f32 user_gyro_threshold = 0.0f; + // Number of invalid sequential data u32 reset_counter = 0; diff --git a/src/core/hle/kernel/svc_version.h b/src/core/hle/kernel/svc_version.h index e4f47b34b..3eb95aa7b 100755 --- a/src/core/hle/kernel/svc_version.h +++ b/src/core/hle/kernel/svc_version.h @@ -35,11 +35,11 @@ constexpr inline u32 EncodeKernelVersion(u32 major, u32 minor) { } constexpr inline u32 GetKernelMajorVersion(u32 encoded) { - return std::bit_cast(encoded).Value(); + return decltype(KernelVersion::major_version)::ExtractValue(encoded); } constexpr inline u32 GetKernelMinorVersion(u32 encoded) { - return std::bit_cast(encoded).Value(); + return decltype(KernelVersion::minor_version)::ExtractValue(encoded); } // Nintendo doesn't support programs targeting SVC versions < 3.0. diff --git a/src/core/hle/service/hid/controllers/npad.cpp b/src/core/hle/service/hid/controllers/npad.cpp index ee0615f38..a57af3992 100755 --- a/src/core/hle/service/hid/controllers/npad.cpp +++ b/src/core/hle/service/hid/controllers/npad.cpp @@ -1132,7 +1132,8 @@ Result Controller_NPad::DisconnectNpad(Core::HID::NpadIdType npad_id) { return ResultSuccess; } Result Controller_NPad::SetGyroscopeZeroDriftMode( - const Core::HID::SixAxisSensorHandle& sixaxis_handle, GyroscopeZeroDriftMode drift_mode) { + const Core::HID::SixAxisSensorHandle& sixaxis_handle, + Core::HID::GyroscopeZeroDriftMode drift_mode) { const auto is_valid = VerifyValidSixAxisSensorHandle(sixaxis_handle); if (is_valid.IsError()) { LOG_ERROR(Service_HID, "Invalid handle, error_code={}", is_valid.raw); @@ -1140,14 +1141,16 @@ Result Controller_NPad::SetGyroscopeZeroDriftMode( } auto& sixaxis = GetSixaxisState(sixaxis_handle); + auto& controller = GetControllerFromHandle(sixaxis_handle); sixaxis.gyroscope_zero_drift_mode = drift_mode; + controller.device->SetGyroscopeZeroDriftMode(drift_mode); return ResultSuccess; } Result Controller_NPad::GetGyroscopeZeroDriftMode( const Core::HID::SixAxisSensorHandle& sixaxis_handle, - GyroscopeZeroDriftMode& drift_mode) const { + Core::HID::GyroscopeZeroDriftMode& drift_mode) const { const auto is_valid = VerifyValidSixAxisSensorHandle(sixaxis_handle); if (is_valid.IsError()) { LOG_ERROR(Service_HID, "Invalid handle, error_code={}", is_valid.raw); diff --git a/src/core/hle/service/hid/controllers/npad.h b/src/core/hle/service/hid/controllers/npad.h index 174cbb174..48482e420 100755 --- a/src/core/hle/service/hid/controllers/npad.h +++ b/src/core/hle/service/hid/controllers/npad.h @@ -52,13 +52,6 @@ public: // When the controller is requesting a motion update for the shared memory void OnMotionUpdate(const Core::Timing::CoreTiming& core_timing) override; - // This is nn::hid::GyroscopeZeroDriftMode - enum class GyroscopeZeroDriftMode : u32 { - Loose = 0, - Standard = 1, - Tight = 2, - }; - // This is nn::hid::NpadJoyHoldType enum class NpadJoyHoldType : u64 { Vertical = 0, @@ -146,9 +139,9 @@ public: Result DisconnectNpad(Core::HID::NpadIdType npad_id); Result SetGyroscopeZeroDriftMode(const Core::HID::SixAxisSensorHandle& sixaxis_handle, - GyroscopeZeroDriftMode drift_mode); + Core::HID::GyroscopeZeroDriftMode drift_mode); Result GetGyroscopeZeroDriftMode(const Core::HID::SixAxisSensorHandle& sixaxis_handle, - GyroscopeZeroDriftMode& drift_mode) const; + Core::HID::GyroscopeZeroDriftMode& drift_mode) const; Result IsSixAxisSensorAtRest(const Core::HID::SixAxisSensorHandle& sixaxis_handle, bool& is_at_rest) const; Result IsFirmwareUpdateAvailableForSixAxisSensor( @@ -489,7 +482,8 @@ private: Core::HID::SixAxisSensorFusionParameters fusion{}; Core::HID::SixAxisSensorCalibrationParameter calibration{}; Core::HID::SixAxisSensorIcInformation ic_information{}; - GyroscopeZeroDriftMode gyroscope_zero_drift_mode{GyroscopeZeroDriftMode::Standard}; + Core::HID::GyroscopeZeroDriftMode gyroscope_zero_drift_mode{ + Core::HID::GyroscopeZeroDriftMode::Standard}; }; struct NpadControllerData { diff --git a/src/core/hle/service/hid/hid.cpp b/src/core/hle/service/hid/hid.cpp index 820715338..f923a90ce 100755 --- a/src/core/hle/service/hid/hid.cpp +++ b/src/core/hle/service/hid/hid.cpp @@ -712,7 +712,7 @@ void Hid::ResetSixAxisSensorFusionParameters(Kernel::HLERequestContext& ctx) { void Hid::SetGyroscopeZeroDriftMode(Kernel::HLERequestContext& ctx) { IPC::RequestParser rp{ctx}; const auto sixaxis_handle{rp.PopRaw()}; - const auto drift_mode{rp.PopEnum()}; + const auto drift_mode{rp.PopEnum()}; const auto applet_resource_user_id{rp.Pop()}; auto& controller = GetAppletResource()->GetController(HidController::NPad); @@ -739,7 +739,7 @@ void Hid::GetGyroscopeZeroDriftMode(Kernel::HLERequestContext& ctx) { const auto parameters{rp.PopRaw()}; - auto drift_mode{Controller_NPad::GyroscopeZeroDriftMode::Standard}; + auto drift_mode{Core::HID::GyroscopeZeroDriftMode::Standard}; auto& controller = GetAppletResource()->GetController(HidController::NPad); const auto result = controller.GetGyroscopeZeroDriftMode(parameters.sixaxis_handle, drift_mode); @@ -764,7 +764,7 @@ void Hid::ResetGyroscopeZeroDriftMode(Kernel::HLERequestContext& ctx) { const auto parameters{rp.PopRaw()}; - const auto drift_mode{Controller_NPad::GyroscopeZeroDriftMode::Standard}; + const auto drift_mode{Core::HID::GyroscopeZeroDriftMode::Standard}; auto& controller = GetAppletResource()->GetController(HidController::NPad); const auto result = controller.SetGyroscopeZeroDriftMode(parameters.sixaxis_handle, drift_mode); diff --git a/src/input_common/drivers/joycon.cpp b/src/input_common/drivers/joycon.cpp index 4fcfb4510..afc33db57 100755 --- a/src/input_common/drivers/joycon.cpp +++ b/src/input_common/drivers/joycon.cpp @@ -16,7 +16,7 @@ namespace InputCommon { Joycons::Joycons(const std::string& input_engine_) : InputEngine(input_engine_) { // Avoid conflicting with SDL driver - if (!Settings::values.enable_joycon_driver) { + if (!Settings::values.enable_joycon_driver && !Settings::values.enable_procon_driver) { return; } LOG_INFO(Input, "Joycon driver Initialization started"); @@ -46,6 +46,12 @@ void Joycons::Reset() { } device->Stop(); } + for (const auto& device : pro_controller) { + if (!device) { + continue; + } + device->Stop(); + } SDL_hid_exit(); } @@ -61,6 +67,11 @@ void Joycons::Setup() { PreSetController(GetIdentifier(port, Joycon::ControllerType::Right)); device = std::make_shared(port++); } + port = 0; + for (auto& device : pro_controller) { + PreSetController(GetIdentifier(port, Joycon::ControllerType::Pro)); + device = std::make_shared(port++); + } scan_thread = std::jthread([this](std::stop_token stop_token) { ScanThread(stop_token); }); } @@ -116,6 +127,9 @@ bool Joycons::IsDeviceNew(SDL_hid_device_info* device_info) const { // Check if device already exist switch (type) { case Joycon::ControllerType::Left: + if (!Settings::values.enable_joycon_driver) { + return false; + } for (const auto& device : left_joycons) { if (is_handle_identical(device)) { return false; @@ -123,12 +137,25 @@ bool Joycons::IsDeviceNew(SDL_hid_device_info* device_info) const { } break; case Joycon::ControllerType::Right: + if (!Settings::values.enable_joycon_driver) { + return false; + } for (const auto& device : right_joycons) { if (is_handle_identical(device)) { return false; } } break; + case Joycon::ControllerType::Pro: + if (!Settings::values.enable_procon_driver) { + return false; + } + for (const auto& device : pro_controller) { + if (is_handle_identical(device)) { + return false; + } + } + break; default: return false; } @@ -199,6 +226,14 @@ std::shared_ptr Joycons::GetNextFreeHandle( return *unconnected_device; } } + if (type == Joycon::ControllerType::Pro) { + const auto unconnected_device = std::ranges::find_if( + pro_controller, [](auto& device) { return !device->IsConnected(); }); + + if (unconnected_device != pro_controller.end()) { + return *unconnected_device; + } + } return nullptr; } @@ -409,6 +444,15 @@ std::shared_ptr Joycons::GetHandle(PadIdentifier identifie } } + if (type == Joycon::ControllerType::Pro) { + const auto matching_device = std::ranges::find_if( + pro_controller, [is_handle_active](auto& device) { return is_handle_active(device); }); + + if (matching_device != pro_controller.end()) { + return *matching_device; + } + } + return nullptr; } @@ -455,6 +499,9 @@ std::vector Joycons::GetInputDevices() const { for (const auto& controller : right_joycons) { add_entry(controller); } + for (const auto& controller : pro_controller) { + add_entry(controller); + } // List dual joycon pairs for (std::size_t i = 0; i < MaxSupportedControllers; i++) { diff --git a/src/input_common/drivers/joycon.h b/src/input_common/drivers/joycon.h index 2149ab7fd..473ba1b9e 100755 --- a/src/input_common/drivers/joycon.h +++ b/src/input_common/drivers/joycon.h @@ -106,6 +106,7 @@ private: // Joycon types are split by type to ease supporting dualjoycon configurations std::array, MaxSupportedControllers> left_joycons{}; std::array, MaxSupportedControllers> right_joycons{}; + std::array, MaxSupportedControllers> pro_controller{}; }; } // namespace InputCommon diff --git a/src/input_common/drivers/sdl_driver.cpp b/src/input_common/drivers/sdl_driver.cpp index e9a25539a..fc577a5f7 100755 --- a/src/input_common/drivers/sdl_driver.cpp +++ b/src/input_common/drivers/sdl_driver.cpp @@ -343,6 +343,14 @@ void SDLDriver::InitJoystick(int joystick_index) { } } + if (Settings::values.enable_procon_driver) { + if (guid.uuid[5] == 0x05 && guid.uuid[4] == 0x7e && guid.uuid[8] == 0x09) { + LOG_WARNING(Input, "Preferring joycon driver for device index {}", joystick_index); + SDL_JoystickClose(sdl_joystick); + return; + } + } + std::scoped_lock lock{joystick_map_mutex}; if (joystick_map.find(guid) == joystick_map.end()) { auto joystick = std::make_shared(guid, 0, sdl_joystick, sdl_gamecontroller); @@ -465,13 +473,19 @@ SDLDriver::SDLDriver(std::string input_engine_) : InputEngine(std::move(input_en SDL_SetHint(SDL_HINT_JOYSTICK_HIDAPI_PS5_RUMBLE, "1"); SDL_SetHint(SDL_HINT_JOYSTICK_ALLOW_BACKGROUND_EVENTS, "1"); - // Disable hidapi drivers for switch controllers when the custom joycon driver is enabled + // Disable hidapi drivers for joycon controllers when the custom joycon driver is enabled if (Settings::values.enable_joycon_driver) { SDL_SetHint(SDL_HINT_JOYSTICK_HIDAPI_JOY_CONS, "0"); } else { SDL_SetHint(SDL_HINT_JOYSTICK_HIDAPI_JOY_CONS, "1"); } - SDL_SetHint(SDL_HINT_JOYSTICK_HIDAPI_SWITCH, "1"); + + // Disable hidapi drivers for pro controllers when the custom joycon driver is enabled + if (Settings::values.enable_procon_driver) { + SDL_SetHint(SDL_HINT_JOYSTICK_HIDAPI_SWITCH, "0"); + } else { + SDL_SetHint(SDL_HINT_JOYSTICK_HIDAPI_SWITCH, "1"); + } // Disable hidapi driver for xbox. Already default on Windows, this causes conflict with native // driver on Linux. diff --git a/src/input_common/helpers/joycon_driver.cpp b/src/input_common/helpers/joycon_driver.cpp index 8f94c9f45..e65b6b845 100755 --- a/src/input_common/helpers/joycon_driver.cpp +++ b/src/input_common/helpers/joycon_driver.cpp @@ -543,9 +543,10 @@ void JoyconDriver::SetCallbacks(const JoyconCallbacks& callbacks) { DriverResult JoyconDriver::GetDeviceType(SDL_hid_device_info* device_info, ControllerType& controller_type) { - static constexpr std::array, 2> supported_devices{ + static constexpr std::array, 6> supported_devices{ std::pair{0x2006, ControllerType::Left}, {0x2007, ControllerType::Right}, + {0x2009, ControllerType::Pro}, }; constexpr u16 nintendo_vendor_id = 0x057e; diff --git a/src/yuzu/configuration/config.cpp b/src/yuzu/configuration/config.cpp index a9bbc71a2..13fb940c4 100755 --- a/src/yuzu/configuration/config.cpp +++ b/src/yuzu/configuration/config.cpp @@ -441,6 +441,7 @@ void Config::ReadControlValues() { Settings::values.mouse_panning = false; ReadBasicSetting(Settings::values.mouse_panning_sensitivity); ReadBasicSetting(Settings::values.enable_joycon_driver); + ReadBasicSetting(Settings::values.enable_procon_driver); ReadBasicSetting(Settings::values.tas_enable); ReadBasicSetting(Settings::values.tas_loop); @@ -1141,6 +1142,7 @@ void Config::SaveControlValues() { WriteGlobalSetting(Settings::values.motion_enabled); WriteBasicSetting(Settings::values.enable_raw_input); WriteBasicSetting(Settings::values.enable_joycon_driver); + WriteBasicSetting(Settings::values.enable_procon_driver); WriteBasicSetting(Settings::values.keyboard_enabled); WriteBasicSetting(Settings::values.emulate_analog_keyboard); WriteBasicSetting(Settings::values.mouse_panning_sensitivity); diff --git a/src/yuzu/configuration/configure_input_advanced.cpp b/src/yuzu/configuration/configure_input_advanced.cpp index 7e6ef873a..59209b0d3 100755 --- a/src/yuzu/configuration/configure_input_advanced.cpp +++ b/src/yuzu/configuration/configure_input_advanced.cpp @@ -139,6 +139,7 @@ void ConfigureInputAdvanced::ApplyConfiguration() { Settings::values.enable_ring_controller = ui->enable_ring_controller->isChecked(); Settings::values.enable_ir_sensor = ui->enable_ir_sensor->isChecked(); Settings::values.enable_joycon_driver = ui->enable_joycon_driver->isChecked(); + Settings::values.enable_procon_driver = ui->enable_procon_driver->isChecked(); } void ConfigureInputAdvanced::LoadConfiguration() { @@ -174,6 +175,7 @@ void ConfigureInputAdvanced::LoadConfiguration() { ui->enable_ring_controller->setChecked(Settings::values.enable_ring_controller.GetValue()); ui->enable_ir_sensor->setChecked(Settings::values.enable_ir_sensor.GetValue()); ui->enable_joycon_driver->setChecked(Settings::values.enable_joycon_driver.GetValue()); + ui->enable_procon_driver->setChecked(Settings::values.enable_procon_driver.GetValue()); UpdateUIEnabled(); } diff --git a/src/yuzu/configuration/configure_input_advanced.ui b/src/yuzu/configuration/configure_input_advanced.ui index 5c918f47b..4ef8d77df 100755 --- a/src/yuzu/configuration/configure_input_advanced.ui +++ b/src/yuzu/configuration/configure_input_advanced.ui @@ -2712,6 +2712,22 @@ + + + Requires restarting yuzu + + + + 0 + 23 + + + + Enable direct Pro Controller driver [EXPERIMENTAL] + + + + @@ -2724,7 +2740,7 @@ - + Mouse sensitivity @@ -2746,14 +2762,14 @@ - + Motion / Touch - + Configure diff --git a/src/yuzu/main.cpp b/src/yuzu/main.cpp index f914090bc..c7314c4cc 100755 --- a/src/yuzu/main.cpp +++ b/src/yuzu/main.cpp @@ -805,6 +805,8 @@ void GMainWindow::WebBrowserOpenWebPage(const std::string& main_url, layout.screen.GetHeight() / scale_ratio); web_browser_view.move(layout.screen.left / scale_ratio, (layout.screen.top / scale_ratio) + menuBar()->height()); + web_browser_view.setZoomFactor(static_cast(layout.screen.GetWidth() / scale_ratio) / + static_cast(Layout::ScreenUndocked::Width)); web_browser_view.setFocus(); web_browser_view.show(); diff --git a/src/yuzu_cmd/config.cpp b/src/yuzu_cmd/config.cpp index 054d37614..c1881ca97 100755 --- a/src/yuzu_cmd/config.cpp +++ b/src/yuzu_cmd/config.cpp @@ -178,6 +178,7 @@ void Config::ReadValues() { ReadSetting("ControlsGeneral", Settings::values.enable_raw_input); ReadSetting("ControlsGeneral", Settings::values.enable_joycon_driver); + ReadSetting("ControlsGeneral", Settings::values.enable_procon_driver); ReadSetting("ControlsGeneral", Settings::values.emulate_analog_keyboard); ReadSetting("ControlsGeneral", Settings::values.vibration_enabled); ReadSetting("ControlsGeneral", Settings::values.enable_accurate_vibrations);