add some missing IPC HLE data to savestates

This commit is contained in:
nitsuja 2012-01-01 11:36:32 -08:00 committed by skidau
parent c9059c708e
commit 19b0b02ad7
5 changed files with 41 additions and 3 deletions

View File

@ -575,3 +575,12 @@ void UpdateDevices()
} // end of namespace WII_IPC_HLE_Interface
// TODO: create WII_IPC_HLE_Device.cpp ?
void IWII_IPC_HLE_Device::DoStateShared(PointerWrap& p)
{
p.Do(m_Name);
p.Do(m_DeviceID);
p.Do(m_Hardware);
p.Do(m_Active);
}

View File

@ -62,7 +62,9 @@ public:
virtual ~IWII_IPC_HLE_Device() { }
virtual void DoState(PointerWrap&) { }
virtual void DoState(PointerWrap& p) { DoStateShared(p); }
void DoStateShared(PointerWrap& p);
const std::string& GetDeviceName() const { return m_Name; }
u32 GetDeviceID() const { return m_DeviceID; }

View File

@ -363,7 +363,30 @@ bool CWII_IPC_HLE_Device_FileIO::IOCtl(u32 _CommandAddress)
void CWII_IPC_HLE_Device_FileIO::DoState(PointerWrap &p)
{
DoStateShared(p);
bool have_file_handle = (m_pFileHandle != 0);
s32 seek = (have_file_handle) ? (s32)m_pFileHandle.Tell() : 0;
p.Do(have_file_handle);
p.Do(m_Mode);
p.Do(m_SeekPos);
p.Do(m_Filename);
p.Do(seek);
if (p.GetMode() == PointerWrap::MODE_READ)
{
int mode = m_Mode;
bool active = m_Active;
if (have_file_handle)
{
Open(0, m_Mode);
_dbg_assert_msg_(WII_IPC_HLE, m_pFileHandle, "bad filehandle");
}
else
Close(0, true);
m_Mode = mode;
m_Active = active;
}
if (have_file_handle)
m_pFileHandle.Seek(seek, SEEK_SET);
}

View File

@ -501,6 +501,8 @@ s32 CWII_IPC_HLE_Device_fs::ExecuteCommand(u32 _Parameter, u32 _BufferIn, u32 _B
void CWII_IPC_HLE_Device_fs::DoState(PointerWrap& p)
{
DoStateShared(p);
// handle /tmp
std::string Path = File::GetUserPath(D_WIIUSER_IDX) + "tmp";

View File

@ -186,6 +186,8 @@ void CWII_IPC_HLE_Device_usb_oh1_57e_305::DoState(PointerWrap &p)
m_WiiMotes.pop_back();
p.DoMarker("m_WiiMotes");
}
DoStateShared(p);
}
bool CWII_IPC_HLE_Device_usb_oh1_57e_305::RemoteDisconnect(u16 _connectionHandle)