From 9e3747e2f39834902dffea47906b18041267f432 Mon Sep 17 00:00:00 2001 From: hrydgard Date: Thu, 21 Aug 2008 18:23:10 +0000 Subject: [PATCH] SaveState preparations #1 - Annotate all(?) state. (NO SCHEDULE PROMISE!) git-svn-id: https://dolphin-emu.googlecode.com/svn/trunk@257 8ced0084-cf51-0410-be5f-012b33b47a6e --- Source/Core/Core/Src/HW/EXI.cpp | 2 +- Source/Core/Core/Src/HW/EXI.h | 7 ------- Source/Core/Core/Src/HW/EXI_Channel.cpp | 18 ++++++++++-------- Source/Core/Core/Src/HW/EXI_Channel.h | 19 ++++--------------- Source/Core/Core/Src/HW/EXI_Device.h | 6 +++--- Source/Core/Core/Src/HW/EXI_DeviceAD16.h | 3 +-- Source/Core/Core/Src/HW/EXI_DeviceIPL.h | 10 ++-------- .../Core/Core/Src/HW/EXI_DeviceMemoryCard.h | 12 +++--------- Source/Core/Core/Src/HW/Memmap.cpp | 6 ++++-- Source/Core/Core/Src/HW/MemoryInterface.cpp | 3 ++- .../Core/Core/Src/HW/PeripheralInterface.cpp | 1 + Source/Core/Core/Src/HW/PixelEngine.cpp | 9 +++++---- Source/Core/Core/Src/HW/SerialInterface.cpp | 13 +++++++------ Source/Core/Core/Src/HW/VideoInterface.cpp | 1 + Source/Core/Core/Src/HW/WII_IOB.cpp | 10 +++++----- Source/Core/Core/Src/HW/WII_IPC.cpp | 2 ++ Source/Core/Core/Src/IPC_HLE/WII_IPC_HLE.cpp | 2 ++ .../Core/Src/IPC_HLE/WII_IPC_HLE_Device.h | 12 +++++++----- .../IPC_HLE/WII_IPC_HLE_Device_sdio_slot0.cpp | 2 +- .../Core/Src/IPC_HLE/WII_IPC_HLE_Device_stm.h | 1 + .../Core/Src/IPC_HLE/WII_IPC_HLE_Device_usb.h | 1 + .../Core/Src/IPC_HLE/WII_IPC_HLE_WiiMote.h | 1 + Source/Core/VideoCommon/Src/BPMemory.cpp | 1 + Source/Core/VideoCommon/Src/CPMemory.cpp | 1 + Source/Core/VideoCommon/Src/Fifo.cpp | 2 +- Source/Core/VideoCommon/Src/LookUpTables.cpp | 2 +- .../Core/VideoCommon/Src/TextureDecoder.cpp | 3 ++- Source/Core/VideoCommon/Src/XFMemory.cpp | 1 + 28 files changed, 71 insertions(+), 80 deletions(-) diff --git a/Source/Core/Core/Src/HW/EXI.cpp b/Source/Core/Core/Src/HW/EXI.cpp index 594e1d3d76..67fed625f3 100644 --- a/Source/Core/Core/Src/HW/EXI.cpp +++ b/Source/Core/Core/Src/HW/EXI.cpp @@ -91,7 +91,7 @@ void UpdateInterrupts() { for(int i=0; iIsInterruptSet()) + if (m_pDevices[0]->IsInterruptSet()) m_Status.EXIINT = 1; - } else /* Channel 2: In fact, Channel 0, Device 2 (Serial A) produces interrupt */ + } + else /* Channel 2: In fact, Channel 0, Device 2 (Serial A) produces interrupt */ { + // WTF? this[-2]??? EVIL HACK if (this[-2].m_pDevices[2]->IsInterruptSet()) m_Status.EXIINT = 1; } @@ -117,7 +119,7 @@ IEXIDevice* CEXIChannel::GetDevice(u8 _CHIP_SELECT) void CEXIChannel::Update() { // start the transfer - for(int i=0; iUpdate(); } @@ -132,9 +134,9 @@ void CEXIChannel::Read32(u32& _uReturnValue, const u32 _iRegister) case EXI_STATUS: { // check if a device is present - for(int i=0; iIsPresent()) + if (m_pDevices[i]->IsPresent()) { m_Status.EXT = 1; break; @@ -184,7 +186,7 @@ void CEXIChannel::Write32(const u32 _iValue, const u32 _iRegister) // Device if (m_Status.CHIP_SELECT != newStatus.CHIP_SELECT) { - for (int i=0; i TDeviceMap; TDeviceMap g_DeviceMap; + +// STATE_TO_SAVE u32 g_LastDeviceID = 0x13370000; diff --git a/Source/Core/Core/Src/IPC_HLE/WII_IPC_HLE_Device.h b/Source/Core/Core/Src/IPC_HLE/WII_IPC_HLE_Device.h index a423362784..eeaa7d63b5 100644 --- a/Source/Core/Core/Src/IPC_HLE/WII_IPC_HLE_Device.h +++ b/Source/Core/Core/Src/IPC_HLE/WII_IPC_HLE_Device.h @@ -54,11 +54,11 @@ protected: SIOCtlVBuffer(u32 _Address) : m_Address(_Address) { - Parameter = Memory::Read_U32(m_Address +0x0C); - NumberInBuffer = Memory::Read_U32(m_Address +0x10); - NumberPayloadBuffer = Memory::Read_U32(m_Address +0x14); - BufferVector = Memory::Read_U32(m_Address +0x18); - BufferSize = Memory::Read_U32(m_Address +0x1C); + Parameter = Memory::Read_U32(m_Address + 0x0C); + NumberInBuffer = Memory::Read_U32(m_Address + 0x10); + NumberPayloadBuffer = Memory::Read_U32(m_Address + 0x14); + BufferVector = Memory::Read_U32(m_Address + 0x18); + BufferSize = Memory::Read_U32(m_Address + 0x1C); u32 BufferVectorOffset = BufferVector; for (u32 i=0; i m_HCICommandMessageQueue; bool m_ACLAnswer; diff --git a/Source/Core/Core/Src/IPC_HLE/WII_IPC_HLE_WiiMote.h b/Source/Core/Core/Src/IPC_HLE/WII_IPC_HLE_WiiMote.h index 835be1d797..7e9cb45d3a 100644 --- a/Source/Core/Core/Src/IPC_HLE/WII_IPC_HLE_WiiMote.h +++ b/Source/Core/Core/Src/IPC_HLE/WII_IPC_HLE_WiiMote.h @@ -44,6 +44,7 @@ public: private: + // STATE_TO_SAVE bdaddr_t m_BD; u16 m_ControllerConnectionHandle; diff --git a/Source/Core/VideoCommon/Src/BPMemory.cpp b/Source/Core/VideoCommon/Src/BPMemory.cpp index 22419d16ba..a4d92de477 100644 --- a/Source/Core/VideoCommon/Src/BPMemory.cpp +++ b/Source/Core/VideoCommon/Src/BPMemory.cpp @@ -20,4 +20,5 @@ #include "BPMemory.h" //BP state +// STATE_TO_SAVE BPMemory bpmem; \ No newline at end of file diff --git a/Source/Core/VideoCommon/Src/CPMemory.cpp b/Source/Core/VideoCommon/Src/CPMemory.cpp index 5a47b6044e..06aa8d6192 100644 --- a/Source/Core/VideoCommon/Src/CPMemory.cpp +++ b/Source/Core/VideoCommon/Src/CPMemory.cpp @@ -19,6 +19,7 @@ #include "CPMemory.h" // CP state +// STATE_TO_SAVE u32 arraybases[16]; u32 arraystrides[16]; TMatrixIndexA MatrixIndexA; diff --git a/Source/Core/VideoCommon/Src/Fifo.cpp b/Source/Core/VideoCommon/Src/Fifo.cpp index 12db09b289..94577f9d70 100644 --- a/Source/Core/VideoCommon/Src/Fifo.cpp +++ b/Source/Core/VideoCommon/Src/Fifo.cpp @@ -26,9 +26,9 @@ #define FIFO_SIZE (1024*1024) +// STATE_TO_SAVE FifoReader fifo; static u8 *videoBuffer; - static int size = 0; static int readptr = 0; diff --git a/Source/Core/VideoCommon/Src/LookUpTables.cpp b/Source/Core/VideoCommon/Src/LookUpTables.cpp index cf12c3fd7b..1e60ce59c3 100644 --- a/Source/Core/VideoCommon/Src/LookUpTables.cpp +++ b/Source/Core/VideoCommon/Src/LookUpTables.cpp @@ -37,7 +37,7 @@ void InitLUTs() lut6to8[i] = (i*255) / 63; for (int i = 0; i < 256; i++) { - lutu8tosfloat[i] = (float)(i-128) / 127.0f; + lutu8tosfloat[i] = (float)(i - 128) / 127.0f; lutu8toufloat[i] = (float)(i) / 255.0f; luts8tosfloat[i] = ((float)(signed char)(char)i) / 127.0f; } diff --git a/Source/Core/VideoCommon/Src/TextureDecoder.cpp b/Source/Core/VideoCommon/Src/TextureDecoder.cpp index 86d20101a5..2652b6f3b3 100644 --- a/Source/Core/VideoCommon/Src/TextureDecoder.cpp +++ b/Source/Core/VideoCommon/Src/TextureDecoder.cpp @@ -20,7 +20,7 @@ #include "TextureDecoder.h" #include "LookUpTables.h" -//Uncomment this to enable Texure Format ID overlays +//Uncomment this to enable Texture Format ID overlays #define OVERLAY_TEXFMT #ifdef OVERLAY_TEXFMT @@ -29,6 +29,7 @@ bool TexFmt_Overlay_Center=false; #endif // TRAM +// STATE_TO_SAVE u8 texMem[TMEM_SIZE]; ////////////////////////////////////////////////////////////////////////// diff --git a/Source/Core/VideoCommon/Src/XFMemory.cpp b/Source/Core/VideoCommon/Src/XFMemory.cpp index 7d3dbbe0d9..925e400dfc 100644 --- a/Source/Core/VideoCommon/Src/XFMemory.cpp +++ b/Source/Core/VideoCommon/Src/XFMemory.cpp @@ -17,5 +17,6 @@ #include "XFMemory.h" +// STATE_TO_SAVE XFRegisters xfregs; u32 xfmem[XFMEM_SIZE]; \ No newline at end of file