summaryrefslogtreecommitdiff
path: root/Source/Core
diff options
context:
space:
mode:
authorLéo Lam <leo@leolam.fr>2022-10-18 08:36:50 +0200
committerGitHub <noreply@github.com>2022-10-18 08:36:50 +0200
commitee5a93c6b8ecffe476ffc0b6348172ab9c59dd0f (patch)
tree26a66ebb7833cf064ba5607f02f372cafd9db5bb /Source/Core
parent10f973a87f921d277a7a9514f2a5dd59d04b7ca6 (diff)
parent486a523e0d87b4a06dab315eb73b01214c979e61 (diff)
Merge pull request #11177 from Lobsterzelda/simplify-device-save-state
IOS: Simplify IOS::HLE::Device savestate method
Diffstat (limited to 'Source/Core')
-rw-r--r--Source/Core/Core/IOS/DI/DI.cpp2
-rw-r--r--Source/Core/Core/IOS/Device.cpp6
-rw-r--r--Source/Core/Core/IOS/Device.h1
-rw-r--r--Source/Core/Core/IOS/FS/FileSystemProxy.cpp1
-rw-r--r--Source/Core/Core/IOS/Network/IP/Top.cpp2
-rw-r--r--Source/Core/Core/IOS/SDIO/SDIOSlot0.cpp2
-rw-r--r--Source/Core/Core/IOS/STM/STM.cpp2
-rw-r--r--Source/Core/Core/IOS/USB/Bluetooth/BTEmu.cpp2
-rw-r--r--Source/Core/Core/IOS/USB/Bluetooth/BTReal.cpp1
-rw-r--r--Source/Core/Core/IOS/USB/Host.cpp1
-rw-r--r--Source/Core/Core/IOS/USB/OH0/OH0Device.cpp2
-rw-r--r--Source/Core/Core/State.cpp2
12 files changed, 10 insertions, 14 deletions
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
@@ -148,12 +148,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);
p.Do(m_is_active);
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<IPCReply> 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<IOCtlRequest>(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<OH0>(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,