mirror of
https://github.com/dolphin-emu/dolphin.git
synced 2025-05-30 06:52:38 +00:00
DSPHLE: Try to make zelda ucode savestates safer (sorry, this'll break your current states, as usual).
git-svn-id: https://dolphin-emu.googlecode.com/svn/trunk@3788 8ced0084-cf51-0410-be5f-012b33b47a6e
This commit is contained in:
parent
48a5c4211c
commit
fda61d91d5
8 changed files with 68 additions and 9 deletions
|
@ -93,4 +93,41 @@ void CMailHandler::Update()
|
|||
}
|
||||
}
|
||||
|
||||
void CMailHandler::DoState(PointerWrap &p)
|
||||
{
|
||||
if (p.GetMode() == PointerWrap::MODE_READ)
|
||||
{
|
||||
Clear();
|
||||
int sz;
|
||||
p.Do(sz);
|
||||
for (int i = 0; i < sz; i++)
|
||||
{
|
||||
u32 mail;
|
||||
p.Do(mail);
|
||||
m_Mails.push(mail);
|
||||
}
|
||||
}
|
||||
else // WRITE and MEASURE
|
||||
{
|
||||
std::queue<u32> temp;
|
||||
int sz = m_Mails.size();
|
||||
p.Do(sz);
|
||||
for (int i = 0; i < sz; i++)
|
||||
{
|
||||
u32 value = m_Mails.front();
|
||||
m_Mails.pop();
|
||||
p.Do(value);
|
||||
temp.push(value);
|
||||
}
|
||||
if (!m_Mails.empty())
|
||||
PanicAlert("CMailHandler::DoState - WTF?");
|
||||
|
||||
// Restore queue.
|
||||
for (int i = 0; i < sz; i++)
|
||||
{
|
||||
u32 value = temp.front();
|
||||
temp.pop();
|
||||
m_Mails.push(value);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue