From 80fe81311621c98328d57dbee5ddf03d6ec91576 Mon Sep 17 00:00:00 2001 From: RedPanda4552 Date: Sat, 12 Aug 2023 15:38:45 -0400 Subject: [PATCH] [SAVEVERSION+] Remove old trigger deadzone references, replace with button deadzone Was removed from UI but not the backend --- pcsx2/SIO/Pad/Pad.cpp | 3 --- pcsx2/SIO/Pad/PadBase.h | 1 - pcsx2/SIO/Pad/PadDualshock2.cpp | 12 ++---------- pcsx2/SIO/Pad/PadDualshock2.h | 3 --- pcsx2/SIO/Pad/PadGuitar.cpp | 5 ----- pcsx2/SIO/Pad/PadGuitar.h | 1 - pcsx2/SIO/Pad/PadNotConnected.cpp | 5 ----- pcsx2/SIO/Pad/PadNotConnected.h | 1 - pcsx2/SIO/Pad/PadTypes.h | 2 -- pcsx2/SaveState.h | 2 +- 10 files changed, 3 insertions(+), 32 deletions(-) diff --git a/pcsx2/SIO/Pad/Pad.cpp b/pcsx2/SIO/Pad/Pad.cpp index 02b1a3bc0d..98763a97d8 100644 --- a/pcsx2/SIO/Pad/Pad.cpp +++ b/pcsx2/SIO/Pad/Pad.cpp @@ -109,11 +109,8 @@ void Pad::LoadConfig(const SettingsInterface& si) const float axis_deadzone = si.GetFloatValue(section.c_str(), "Deadzone", Pad::DEFAULT_STICK_DEADZONE); const float axis_scale = si.GetFloatValue(section.c_str(), "AxisScale", Pad::DEFAULT_STICK_SCALE); - const float trigger_deadzone = si.GetFloatValue(section.c_str(), "TriggerDeadzone", Pad::DEFAULT_TRIGGER_DEADZONE); - const float trigger_scale = si.GetFloatValue(section.c_str(), "TriggerScale", Pad::DEFAULT_TRIGGER_SCALE); const float button_deadzone = si.GetFloatValue(section.c_str(), "ButtonDeadzone", Pad::DEFAULT_BUTTON_DEADZONE); pad->SetAxisScale(axis_deadzone, axis_scale); - pad->SetTriggerScale(trigger_deadzone, trigger_scale); pad->SetButtonDeadzone(button_deadzone); if (ci->vibration_caps != Pad::VibrationCapabilities::NoVibration) diff --git a/pcsx2/SIO/Pad/PadBase.h b/pcsx2/SIO/Pad/PadBase.h index e99c8068ee..534bd4bac5 100644 --- a/pcsx2/SIO/Pad/PadBase.h +++ b/pcsx2/SIO/Pad/PadBase.h @@ -45,7 +45,6 @@ public: // Public members virtual void Set(u32 index, float value) = 0; virtual void SetRawAnalogs(const std::tuple left, const std::tuple right) = 0; virtual void SetAxisScale(float deadzone, float scale) = 0; - virtual void SetTriggerScale(float deadzone, float scale) = 0; virtual float GetVibrationScale(u32 motor) const = 0; virtual void SetVibrationScale(u32 motor, float scale) = 0; virtual float GetPressureModifier() const = 0; diff --git a/pcsx2/SIO/Pad/PadDualshock2.cpp b/pcsx2/SIO/Pad/PadDualshock2.cpp index 85a9a6ae83..c8c000d156 100644 --- a/pcsx2/SIO/Pad/PadDualshock2.cpp +++ b/pcsx2/SIO/Pad/PadDualshock2.cpp @@ -639,8 +639,8 @@ void PadDualshock2::Set(u32 index, float value) } else if (IsTriggerKey(index)) { - const float s_value = std::clamp(value * this->triggerScale, 0.0f, 1.0f); - const float dz_value = (this->triggerDeadzone > 0.0f && s_value < this->triggerDeadzone) ? 0.0f : s_value; + const float s_value = std::clamp(value, 0.0f, 1.0f); + const float dz_value = (this->buttonDeadzone > 0.0f && s_value < this->buttonDeadzone) ? 0.0f : s_value; this->rawInputs[index] = static_cast(dz_value * 255.0f); if (dz_value > 0.0f) this->buttons &= ~(1u << bitmaskMapping[index]); @@ -727,12 +727,6 @@ void PadDualshock2::SetAxisScale(float deadzone, float scale) this->axisScale = scale; } -void PadDualshock2::SetTriggerScale(float deadzone, float scale) -{ - this->triggerDeadzone = deadzone; - this->triggerScale = scale; -} - float PadDualshock2::GetVibrationScale(u32 motor) const { return this->vibrationScale[motor]; @@ -828,8 +822,6 @@ bool PadDualshock2::Freeze(StateWrapper& sw) sw.Do(&vibrationMotors); sw.Do(&axisScale); sw.Do(&axisDeadzone); - sw.Do(&triggerScale); - sw.Do(&triggerDeadzone); sw.Do(&vibrationScale); sw.Do(&pressureModifier); sw.Do(&buttonDeadzone); diff --git a/pcsx2/SIO/Pad/PadDualshock2.h b/pcsx2/SIO/Pad/PadDualshock2.h index ed2cd8ac10..8c05d7247f 100644 --- a/pcsx2/SIO/Pad/PadDualshock2.h +++ b/pcsx2/SIO/Pad/PadDualshock2.h @@ -88,8 +88,6 @@ private: std::array vibrationMotors; float axisScale; float axisDeadzone; - float triggerScale; - float triggerDeadzone; std::array vibrationScale; // When the pressure modifier binding is activated, this is multiplied against // all values in pressures, to artificially reduce pressures and give players @@ -133,7 +131,6 @@ public: void Set(u32 index, float value) override; void SetRawAnalogs(const std::tuple left, const std::tuple right) override; void SetAxisScale(float deadzone, float scale) override; - void SetTriggerScale(float deadzone, float scale) override; float GetVibrationScale(u32 motor) const override; void SetVibrationScale(u32 motor, float scale) override; float GetPressureModifier() const override; diff --git a/pcsx2/SIO/Pad/PadGuitar.cpp b/pcsx2/SIO/Pad/PadGuitar.cpp index 1a88ee25e6..91f249d75a 100644 --- a/pcsx2/SIO/Pad/PadGuitar.cpp +++ b/pcsx2/SIO/Pad/PadGuitar.cpp @@ -337,11 +337,6 @@ void PadGuitar::SetAxisScale(float deadzone, float scale) this->whammyAxisScale = scale; } -void PadGuitar::SetTriggerScale(float deadzone, float scale) -{ - -} - float PadGuitar::GetVibrationScale(u32 motor) const { return 0; diff --git a/pcsx2/SIO/Pad/PadGuitar.h b/pcsx2/SIO/Pad/PadGuitar.h index 31c3da71f5..ff4627ecee 100644 --- a/pcsx2/SIO/Pad/PadGuitar.h +++ b/pcsx2/SIO/Pad/PadGuitar.h @@ -70,7 +70,6 @@ public: void Set(u32 index, float value) override; void SetRawAnalogs(const std::tuple left, const std::tuple right) override; void SetAxisScale(float deadzone, float scale) override; - void SetTriggerScale(float deadzone, float scale) override; float GetVibrationScale(u32 motor) const override; void SetVibrationScale(u32 motor, float scale) override; float GetPressureModifier() const override; diff --git a/pcsx2/SIO/Pad/PadNotConnected.cpp b/pcsx2/SIO/Pad/PadNotConnected.cpp index 5d40afc94e..58cea8d0e8 100644 --- a/pcsx2/SIO/Pad/PadNotConnected.cpp +++ b/pcsx2/SIO/Pad/PadNotConnected.cpp @@ -60,11 +60,6 @@ void PadNotConnected::SetAxisScale(float deadzone, float scale) } -void PadNotConnected::SetTriggerScale(float deadzone, float scale) -{ - -} - float PadNotConnected::GetVibrationScale(u32 motor) const { return 0; diff --git a/pcsx2/SIO/Pad/PadNotConnected.h b/pcsx2/SIO/Pad/PadNotConnected.h index 814f354c94..675b440b82 100644 --- a/pcsx2/SIO/Pad/PadNotConnected.h +++ b/pcsx2/SIO/Pad/PadNotConnected.h @@ -29,7 +29,6 @@ public: void Set(u32 index, float value) override; void SetRawAnalogs(const std::tuple left, const std::tuple right) override; void SetAxisScale(float deadzone, float scale) override; - void SetTriggerScale(float deadzone, float scale) override; float GetVibrationScale(u32 motor) const override; void SetVibrationScale(u32 motor, float scale) override; float GetPressureModifier() const override; diff --git a/pcsx2/SIO/Pad/PadTypes.h b/pcsx2/SIO/Pad/PadTypes.h index e0ac1cf2ed..a639a1b469 100644 --- a/pcsx2/SIO/Pad/PadTypes.h +++ b/pcsx2/SIO/Pad/PadTypes.h @@ -109,8 +109,6 @@ namespace Pad // Default stick deadzone/sensitivity. static constexpr float DEFAULT_STICK_DEADZONE = 0.0f; static constexpr float DEFAULT_STICK_SCALE = 1.33f; - static constexpr float DEFAULT_TRIGGER_DEADZONE = 0.0f; - static constexpr float DEFAULT_TRIGGER_SCALE = 1.0f; static constexpr float DEFAULT_MOTOR_SCALE = 1.0f; static constexpr float DEFAULT_PRESSURE_MODIFIER = 0.5f; static constexpr float DEFAULT_BUTTON_DEADZONE = 0.0f; diff --git a/pcsx2/SaveState.h b/pcsx2/SaveState.h index 6c79c5281c..f7b59417d7 100644 --- a/pcsx2/SaveState.h +++ b/pcsx2/SaveState.h @@ -37,7 +37,7 @@ enum class FreezeAction // [SAVEVERSION+] // This informs the auto updater that the users savestates will be invalidated. -static const u32 g_SaveVersion = (0x9A3C << 16) | 0x0000; +static const u32 g_SaveVersion = (0x9A3D << 16) | 0x0000; // the freezing data between submodules and core