From 22a6533f7f6224f152cad783d87a3620e5efee88 Mon Sep 17 00:00:00 2001 From: "XTra.KrazzY" Date: Sat, 20 Jun 2009 10:24:49 +0000 Subject: [PATCH] State saving is now consistent with the Zelda UCode. We can now save, load, and still hear sound git-svn-id: https://dolphin-emu.googlecode.com/svn/trunk@3503 8ced0084-cf51-0410-be5f-012b33b47a6e --- .../Plugin_DSP_HLE/Src/UCodes/UCode_Zelda.cpp | 14 ++++++++++++++ .../Plugin_DSP_HLE/Src/UCodes/UCode_Zelda.h | 1 + Source/Plugins/Plugin_DSP_HLE/Src/UCodes/UCodes.h | 3 +++ Source/Plugins/Plugin_DSP_HLE/Src/main.cpp | 1 + 4 files changed, 19 insertions(+) diff --git a/Source/Plugins/Plugin_DSP_HLE/Src/UCodes/UCode_Zelda.cpp b/Source/Plugins/Plugin_DSP_HLE/Src/UCodes/UCode_Zelda.cpp index ec70cd0d97..8920bacf30 100644 --- a/Source/Plugins/Plugin_DSP_HLE/Src/UCodes/UCode_Zelda.cpp +++ b/Source/Plugins/Plugin_DSP_HLE/Src/UCodes/UCode_Zelda.cpp @@ -783,3 +783,17 @@ int CUCode_Zelda::DumpAFC(u8* pIn, const int size, const int srate) } +void CUCode_Zelda::DoState(PointerWrap &p) { + p.Do(m_MailState); + p.Do(m_PBMask); + p.Do(m_NumPBs); + p.Do(m_PBAddress); + p.Do(m_MaxSyncedPB); + p.Do(m_PBs); + p.Do(m_readOffset); + p.Do(m_NumberOfFramesToRender); + p.Do(m_CurrentFrameToRender); + p.Do(m_numSteps); + p.Do(m_step); + p.Do(m_Buffer); +} diff --git a/Source/Plugins/Plugin_DSP_HLE/Src/UCodes/UCode_Zelda.h b/Source/Plugins/Plugin_DSP_HLE/Src/UCodes/UCode_Zelda.h index d480f9f9db..5227bfe2ec 100644 --- a/Source/Plugins/Plugin_DSP_HLE/Src/UCodes/UCode_Zelda.h +++ b/Source/Plugins/Plugin_DSP_HLE/Src/UCodes/UCode_Zelda.h @@ -140,6 +140,7 @@ public: void CopyPBsFromRAM(); void CopyPBsToRAM(); + void DoState(PointerWrap &p); int AFCdecodebuffer(char *input, signed short *out, short * histp, short * hist2p, int type = 9); diff --git a/Source/Plugins/Plugin_DSP_HLE/Src/UCodes/UCodes.h b/Source/Plugins/Plugin_DSP_HLE/Src/UCodes/UCodes.h index 1a296bcff9..fe9ed08e05 100644 --- a/Source/Plugins/Plugin_DSP_HLE/Src/UCodes/UCodes.h +++ b/Source/Plugins/Plugin_DSP_HLE/Src/UCodes/UCodes.h @@ -19,6 +19,7 @@ #define _UCODES_H #include "Common.h" +#include "ChunkFile.h" #define UCODE_ROM 0x0000000 #define UCODE_INIT_AUDIO_SYSTEM 0x0000001 @@ -41,6 +42,8 @@ public: virtual void Update(int cycles) = 0; virtual void MixAdd(short* buffer, int size) {} + virtual void DoState(PointerWrap &p) {} + protected: CMailHandler& m_rMailHandler; }; diff --git a/Source/Plugins/Plugin_DSP_HLE/Src/main.cpp b/Source/Plugins/Plugin_DSP_HLE/Src/main.cpp index d8a5a7100b..325e0b1a09 100644 --- a/Source/Plugins/Plugin_DSP_HLE/Src/main.cpp +++ b/Source/Plugins/Plugin_DSP_HLE/Src/main.cpp @@ -225,6 +225,7 @@ void Shutdown() void DoState(unsigned char **ptr, int mode) { PointerWrap p(ptr, mode); + CDSPHandler::GetInstance().GetUCode()->DoState(p); }