From 7ed0477a293e09038dccfb2824047aa48e07f5db Mon Sep 17 00:00:00 2001 From: Albert Liu <45282415+ggrtk@users.noreply.github.com> Date: Fri, 13 Nov 2020 07:23:19 -0800 Subject: [PATCH] AnalogController: Save buttons and legacy rumble to state --- src/core/analog_controller.cpp | 3 +++ src/core/save_state_version.h | 2 +- 2 files changed, 4 insertions(+), 1 deletion(-) diff --git a/src/core/analog_controller.cpp b/src/core/analog_controller.cpp index 32c468009..dc0e9ac6e 100644 --- a/src/core/analog_controller.cpp +++ b/src/core/analog_controller.cpp @@ -24,6 +24,7 @@ void AnalogController::Reset() { m_analog_mode = false; m_rumble_unlocked = false; + m_legacy_rumble_unlocked = false; m_configuration_mode = false; m_command_param = 0; m_motor_state.fill(0); @@ -41,8 +42,10 @@ bool AnalogController::DoState(StateWrapper& sw) sw.Do(&m_analog_mode); sw.Do(&m_rumble_unlocked); + sw.DoEx(&m_legacy_rumble_unlocked, 44, false); sw.Do(&m_configuration_mode); sw.Do(&m_command_param); + sw.DoEx(&m_button_state, 44, static_cast(0xFFFF)); sw.Do(&m_state); MotorState motor_state = m_motor_state; diff --git a/src/core/save_state_version.h b/src/core/save_state_version.h index 5e17ec4a0..1d5bfe1f7 100644 --- a/src/core/save_state_version.h +++ b/src/core/save_state_version.h @@ -2,7 +2,7 @@ #include "types.h" static constexpr u32 SAVE_STATE_MAGIC = 0x43435544; -static constexpr u32 SAVE_STATE_VERSION = 43; +static constexpr u32 SAVE_STATE_VERSION = 44; static constexpr u32 SAVE_STATE_MINIMUM_VERSION = 42; #pragma pack(push, 4)