diff options
| author | Matthew Parlane <parlane@gmail.com> | 2017-01-23 11:11:08 +1300 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2017-01-23 11:11:08 +1300 |
| commit | 5cee3f99ce491c4dae86239d91ed1a3499d62bf3 (patch) | |
| tree | c1c261955cb0c5642589c37d272cb9044a26640a /Source/Core | |
| parent | 90ee85f4e83ba26ddb9dadd57f72f93405a56ca4 (diff) | |
| parent | 6291cd0bce8d0fccd05e3be664b728941efc5b56 (diff) | |
Merge pull request #4710 from leoetlino/save-stm-hook
IOS: STM: Save event hook to savestates
Diffstat (limited to 'Source/Core')
| -rw-r--r-- | Source/Core/Core/IOS/STM/STM.cpp | 12 | ||||
| -rw-r--r-- | Source/Core/Core/IOS/STM/STM.h | 3 | ||||
| -rw-r--r-- | Source/Core/Core/State.cpp | 2 |
3 files changed, 16 insertions, 1 deletions
diff --git a/Source/Core/Core/IOS/STM/STM.cpp b/Source/Core/Core/IOS/STM/STM.cpp index a24cae51b0..ee66f5f98d 100644 --- a/Source/Core/Core/IOS/STM/STM.cpp +++ b/Source/Core/Core/IOS/STM/STM.cpp @@ -8,6 +8,7 @@ #include <memory> #include "Common/Assert.h" +#include "Common/ChunkFile.h" #include "Common/Logging/Log.h" #include "Core/HW/Memmap.h" @@ -90,6 +91,17 @@ IPCCommandResult STMEventHook::IOCtl(const IOCtlRequest& request) return GetNoReply(); } +void STMEventHook::DoState(PointerWrap& 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 STMEventHook::HasHookInstalled() const { return s_event_hook_request != nullptr; diff --git a/Source/Core/Core/IOS/STM/STM.h b/Source/Core/Core/IOS/STM/STM.h index be37187310..1a2f534d00 100644 --- a/Source/Core/Core/IOS/STM/STM.h +++ b/Source/Core/Core/IOS/STM/STM.h @@ -10,6 +10,8 @@ #include "Core/IOS/Device.h" #include "Core/IOS/IPC.h" +class PointerWrap; + namespace IOS { namespace HLE @@ -55,6 +57,7 @@ public: STMEventHook(u32 device_id, const std::string& device_name) : Device(device_id, device_name) {} void Close() override; IPCCommandResult IOCtl(const IOCtlRequest& request) override; + void DoState(PointerWrap& p) override; bool HasHookInstalled() const; void ResetButton() const; diff --git a/Source/Core/Core/State.cpp b/Source/Core/Core/State.cpp index e4901013b4..33060a777c 100644 --- a/Source/Core/Core/State.cpp +++ b/Source/Core/Core/State.cpp @@ -71,7 +71,7 @@ static Common::Event g_compressAndDumpStateSyncEvent; static std::thread g_save_thread; // Don't forget to increase this after doing changes on the savestate system -static const u32 STATE_VERSION = 71; // Last changed in PR 4687 +static const u32 STATE_VERSION = 72; // Last changed in PR 4710 // Maps savestate versions to Dolphin versions. // Versions after 42 don't need to be added to this list, |
