From 275d4e210f8c2fada311b5ab14b2f74d628eb550 Mon Sep 17 00:00:00 2001 From: pineappleEA Date: Fri, 29 Apr 2022 11:17:49 +0200 Subject: [PATCH] early-access version 2712 --- README.md | 2 +- src/core/hid/input_converter.cpp | 4 +-- src/core/hle/service/hid/hid.cpp | 21 +++++++++++++++- src/core/hle/service/hid/hid.h | 1 + src/input_common/input_poller.cpp | 2 +- .../configuration/configure_input_player.cpp | 25 +++++++++++++++++-- .../configuration/configure_input_player.ui | 8 +++--- 7 files changed, 52 insertions(+), 11 deletions(-) diff --git a/README.md b/README.md index fd2292906..f79873e63 100755 --- a/README.md +++ b/README.md @@ -1,7 +1,7 @@ yuzu emulator early access ============= -This is the source code for early-access 2711. +This is the source code for early-access 2712. ## Legal Notice diff --git a/src/core/hid/input_converter.cpp b/src/core/hid/input_converter.cpp index ee228e39b..3c26260f3 100755 --- a/src/core/hid/input_converter.cpp +++ b/src/core/hid/input_converter.cpp @@ -327,7 +327,7 @@ void SanitizeStick(Common::Input::AnalogStatus& analog_x, Common::Input::AnalogS raw_y += properties_y.offset; // Apply X scale correction from offset - if (std::abs(properties_x.offset) < 0.5f) { + if (std::abs(properties_x.offset) < 0.75f) { if (raw_x > 0) { raw_x /= 1 + properties_x.offset; } else { @@ -336,7 +336,7 @@ void SanitizeStick(Common::Input::AnalogStatus& analog_x, Common::Input::AnalogS } // Apply Y scale correction from offset - if (std::abs(properties_y.offset) < 0.5f) { + if (std::abs(properties_y.offset) < 0.75f) { if (raw_y > 0) { raw_y /= 1 + properties_y.offset; } else { diff --git a/src/core/hle/service/hid/hid.cpp b/src/core/hle/service/hid/hid.cpp index 36162ac97..eba44eda8 100755 --- a/src/core/hle/service/hid/hid.cpp +++ b/src/core/hle/service/hid/hid.cpp @@ -357,7 +357,7 @@ Hid::Hid(Core::System& system_) {1000, &Hid::SetNpadCommunicationMode, "SetNpadCommunicationMode"}, {1001, &Hid::GetNpadCommunicationMode, "GetNpadCommunicationMode"}, {1002, &Hid::SetTouchScreenConfiguration, "SetTouchScreenConfiguration"}, - {1003, nullptr, "IsFirmwareUpdateNeededForNotification"}, + {1003, &Hid::IsFirmwareUpdateNeededForNotification, "IsFirmwareUpdateNeededForNotification"}, {2000, nullptr, "ActivateDigitizer"}, }; // clang-format on @@ -1798,6 +1798,25 @@ void Hid::SetTouchScreenConfiguration(Kernel::HLERequestContext& ctx) { rb.Push(ResultSuccess); } +void Hid::IsFirmwareUpdateNeededForNotification(Kernel::HLERequestContext& ctx) { + IPC::RequestParser rp{ctx}; + struct Parameters { + s32 unknown; + INSERT_PADDING_WORDS_NOINIT(1); + u64 applet_resource_user_id; + }; + static_assert(sizeof(Parameters) == 0x10, "Parameters has incorrect size."); + + const auto parameters{rp.PopRaw()}; + + LOG_WARNING(Service_HID, "(STUBBED) called, unknown={}, applet_resource_user_id={}", + parameters.unknown, parameters.applet_resource_user_id); + + IPC::ResponseBuilder rb{ctx, 3}; + rb.Push(ResultSuccess); + rb.Push(false); +} + class HidDbg final : public ServiceFramework { public: explicit HidDbg(Core::System& system_) : ServiceFramework{system_, "hid:dbg"} { diff --git a/src/core/hle/service/hid/hid.h b/src/core/hle/service/hid/hid.h index e61f8ed08..1be04c22b 100755 --- a/src/core/hle/service/hid/hid.h +++ b/src/core/hle/service/hid/hid.h @@ -166,6 +166,7 @@ private: void SetNpadCommunicationMode(Kernel::HLERequestContext& ctx); void GetNpadCommunicationMode(Kernel::HLERequestContext& ctx); void SetTouchScreenConfiguration(Kernel::HLERequestContext& ctx); + void IsFirmwareUpdateNeededForNotification(Kernel::HLERequestContext& ctx); std::shared_ptr applet_resource; diff --git a/src/input_common/input_poller.cpp b/src/input_common/input_poller.cpp index 99d6c3cd6..49ccb4422 100755 --- a/src/input_common/input_poller.cpp +++ b/src/input_common/input_poller.cpp @@ -732,7 +732,7 @@ std::unique_ptr InputFactory::CreateHatButtonDevice( std::unique_ptr InputFactory::CreateStickDevice( const Common::ParamPackage& params) { const auto deadzone = std::clamp(params.Get("deadzone", 0.15f), 0.0f, 1.0f); - const auto range = std::clamp(params.Get("range", 1.0f), 0.25f, 1.50f); + const auto range = std::clamp(params.Get("range", 0.95f), 0.25f, 1.50f); const auto threshold = std::clamp(params.Get("threshold", 0.5f), 0.0f, 1.0f); const PadIdentifier identifier = { .guid = Common::UUID{params.Get("guid", "")}, diff --git a/src/yuzu/configuration/configure_input_player.cpp b/src/yuzu/configuration/configure_input_player.cpp index b4f5d172a..1c05dd0f3 100755 --- a/src/yuzu/configuration/configure_input_player.cpp +++ b/src/yuzu/configuration/configure_input_player.cpp @@ -520,7 +520,28 @@ ConfigureInputPlayer::ConfigureInputPlayer(QWidget* parent, std::size_t player_i QMenu context_menu; Common::ParamPackage param = emulated_controller->GetStickParam(analog_id); context_menu.addAction(tr("Clear"), [&] { - emulated_controller->SetStickParam(analog_id, {}); + if (param.Get("engine", "") != "analog_from_button") { + emulated_controller->SetStickParam(analog_id, {}); + for (auto button : analog_map_buttons[analog_id]) { + button->setText(tr("[not set]")); + } + return; + } + switch (sub_button_id) { + case 0: + param.Erase("up"); + break; + case 1: + param.Erase("down"); + break; + case 2: + param.Erase("left"); + break; + case 3: + param.Erase("right"); + break; + } + emulated_controller->SetStickParam(analog_id, param); analog_map_buttons[analog_id][sub_button_id]->setText(tr("[not set]")); }); context_menu.addAction(tr("Center axis"), [&] { @@ -988,7 +1009,7 @@ void ConfigureInputPlayer::UpdateUI() { slider_value = static_cast(param.Get("deadzone", 0.15f) * 100); deadzone_label->setText(tr("Deadzone: %1%").arg(slider_value)); deadzone_slider->setValue(slider_value); - range_spinbox->setValue(static_cast(param.Get("range", 1.0f) * 100)); + range_spinbox->setValue(static_cast(param.Get("range", 0.95f) * 100)); } else { slider_value = static_cast(param.Get("modifier_scale", 0.5f) * 100); modifier_label->setText(tr("Modifier Range: %1%").arg(slider_value)); diff --git a/src/yuzu/configuration/configure_input_player.ui b/src/yuzu/configuration/configure_input_player.ui index 756a414b5..a62b57501 100755 --- a/src/yuzu/configuration/configure_input_player.ui +++ b/src/yuzu/configuration/configure_input_player.ui @@ -754,13 +754,13 @@ % - 50 + 25 150 - 100 + 95 @@ -2985,13 +2985,13 @@ % - 50 + 25 150 - 100 + 95