diff --git a/Source/Core/Core/IOS/DI/DI.cpp b/Source/Core/Core/IOS/DI/DI.cpp index 532aea061e..5632cc4bee 100644 --- a/Source/Core/Core/IOS/DI/DI.cpp +++ b/Source/Core/Core/IOS/DI/DI.cpp @@ -53,7 +53,7 @@ DIDevice::DIDevice(Kernel& ios, const std::string& device_name) : Device(ios, de void DIDevice::DoState(PointerWrap& p) { - DoStateShared(p); + Device::DoState(p); p.Do(m_commands_to_execute); p.Do(m_executing_command); p.Do(m_current_partition); diff --git a/Source/Core/Core/IOS/Device.cpp b/Source/Core/Core/IOS/Device.cpp index 8754a3baa0..dd998c6d8d 100644 --- a/Source/Core/Core/IOS/Device.cpp +++ b/Source/Core/Core/IOS/Device.cpp @@ -147,12 +147,6 @@ Device::Device(Kernel& ios, const std::string& device_name, const DeviceType typ } void Device::DoState(PointerWrap& p) -{ - DoStateShared(p); - p.Do(m_is_active); -} - -void Device::DoStateShared(PointerWrap& p) { p.Do(m_name); p.Do(m_device_type); diff --git a/Source/Core/Core/IOS/Device.h b/Source/Core/Core/IOS/Device.h index 2fe1abf37e..d45351e76d 100644 --- a/Source/Core/Core/IOS/Device.h +++ b/Source/Core/Core/IOS/Device.h @@ -181,7 +181,6 @@ public: virtual ~Device() = default; virtual void DoState(PointerWrap& p); - void DoStateShared(PointerWrap& p); const std::string& GetDeviceName() const { return m_name; } // Replies to Open and Close requests are sent by the IPC request handler (HandleCommand), diff --git a/Source/Core/Core/IOS/FS/FileSystemProxy.cpp b/Source/Core/Core/IOS/FS/FileSystemProxy.cpp index fee663144e..0b7e856279 100644 --- a/Source/Core/Core/IOS/FS/FileSystemProxy.cpp +++ b/Source/Core/Core/IOS/FS/FileSystemProxy.cpp @@ -93,6 +93,7 @@ FSDevice::FSDevice(Kernel& ios, const std::string& device_name) : Device(ios, de void FSDevice::DoState(PointerWrap& p) { + Device::DoState(p); p.Do(m_dirty_cache); p.Do(m_cache_chain_index); p.Do(m_cache_fd); diff --git a/Source/Core/Core/IOS/Network/IP/Top.cpp b/Source/Core/Core/IOS/Network/IP/Top.cpp index 74b4a02428..ba59d30b0a 100644 --- a/Source/Core/Core/IOS/Network/IP/Top.cpp +++ b/Source/Core/Core/IOS/Network/IP/Top.cpp @@ -75,7 +75,7 @@ NetIPTopDevice::NetIPTopDevice(Kernel& ios, const std::string& device_name) void NetIPTopDevice::DoState(PointerWrap& p) { - DoStateShared(p); + Device::DoState(p); WiiSockMan::GetInstance().DoState(p); } diff --git a/Source/Core/Core/IOS/SDIO/SDIOSlot0.cpp b/Source/Core/Core/IOS/SDIO/SDIOSlot0.cpp index f9e56d3d74..2f3d741dd8 100644 --- a/Source/Core/Core/IOS/SDIO/SDIOSlot0.cpp +++ b/Source/Core/Core/IOS/SDIO/SDIOSlot0.cpp @@ -56,7 +56,7 @@ void SDIOSlot0Device::RefreshConfig() void SDIOSlot0Device::DoState(PointerWrap& p) { - DoStateShared(p); + Device::DoState(p); if (p.IsReadMode()) { OpenInternal(); diff --git a/Source/Core/Core/IOS/STM/STM.cpp b/Source/Core/Core/IOS/STM/STM.cpp index 32635bfe0b..81e7382236 100644 --- a/Source/Core/Core/IOS/STM/STM.cpp +++ b/Source/Core/Core/IOS/STM/STM.cpp @@ -81,13 +81,13 @@ std::optional STMEventHookDevice::IOCtl(const IOCtlRequest& request) void STMEventHookDevice::DoState(PointerWrap& p) { + Device::DoState(p); u32 address = s_event_hook_request ? s_event_hook_request->address : 0; p.Do(address); if (address != 0) s_event_hook_request = std::make_unique(address); else s_event_hook_request.reset(); - Device::DoState(p); } bool STMEventHookDevice::HasHookInstalled() const diff --git a/Source/Core/Core/IOS/USB/Bluetooth/BTEmu.cpp b/Source/Core/Core/IOS/USB/Bluetooth/BTEmu.cpp index dea42fd589..ea365ba284 100644 --- a/Source/Core/Core/IOS/USB/Bluetooth/BTEmu.cpp +++ b/Source/Core/Core/IOS/USB/Bluetooth/BTEmu.cpp @@ -102,7 +102,7 @@ void BluetoothEmuDevice::DoState(PointerWrap& p) return; } - p.Do(m_is_active); + Device::DoState(p); p.Do(m_controller_bd); DoStateForMessage(m_ios, p, m_hci_endpoint); DoStateForMessage(m_ios, p, m_acl_endpoint); diff --git a/Source/Core/Core/IOS/USB/Bluetooth/BTReal.cpp b/Source/Core/Core/IOS/USB/Bluetooth/BTReal.cpp index 08323d4b4c..d57f913be3 100644 --- a/Source/Core/Core/IOS/USB/Bluetooth/BTReal.cpp +++ b/Source/Core/Core/IOS/USB/Bluetooth/BTReal.cpp @@ -323,6 +323,7 @@ void BluetoothRealDevice::DoState(PointerWrap& p) return; } + Device::DoState(p); // Prevent the transfer callbacks from messing with m_current_transfers after we have started // writing a savestate. We cannot use a scoped lock here because DoState is called twice and // we would lose the lock between the two calls. diff --git a/Source/Core/Core/IOS/USB/Host.cpp b/Source/Core/Core/IOS/USB/Host.cpp index 132f8e5247..bd5debb809 100644 --- a/Source/Core/Core/IOS/USB/Host.cpp +++ b/Source/Core/Core/IOS/USB/Host.cpp @@ -55,6 +55,7 @@ void USBHost::UpdateWantDeterminism(const bool new_want_determinism) void USBHost::DoState(PointerWrap& p) { + Device::DoState(p); if (IsOpened() && p.IsReadMode()) { // After a state has loaded, there may be insertion hooks for devices that were diff --git a/Source/Core/Core/IOS/USB/OH0/OH0Device.cpp b/Source/Core/Core/IOS/USB/OH0/OH0Device.cpp index c1c0397569..398f7490c0 100644 --- a/Source/Core/Core/IOS/USB/OH0/OH0Device.cpp +++ b/Source/Core/Core/IOS/USB/OH0/OH0Device.cpp @@ -44,7 +44,7 @@ OH0Device::OH0Device(Kernel& ios, const std::string& name) : Device(ios, name, D void OH0Device::DoState(PointerWrap& p) { m_oh0 = std::static_pointer_cast(GetIOS()->GetDeviceByName("/dev/usb/oh0")); - p.Do(m_name); + Device::DoState(p); p.Do(m_vid); p.Do(m_pid); p.Do(m_device_id); diff --git a/Source/Core/Core/State.cpp b/Source/Core/Core/State.cpp index 0959e65812..97ceb37c01 100644 --- a/Source/Core/Core/State.cpp +++ b/Source/Core/Core/State.cpp @@ -94,7 +94,7 @@ static size_t s_state_writes_in_queue; static std::condition_variable s_state_write_queue_is_empty; // Don't forget to increase this after doing changes on the savestate system -constexpr u32 STATE_VERSION = 153; // Last changed in PR 11137 +constexpr u32 STATE_VERSION = 154; // Last changed in PR 11177 // Maps savestate versions to Dolphin versions. // Versions after 42 don't need to be added to this list,