Fix random memory overwrite bug in DSP plugin.

git-svn-id: https://dolphin-emu.googlecode.com/svn/trunk@616 8ced0084-cf51-0410-be5f-012b33b47a6e
This commit is contained in:
hrydgard 2008-09-22 22:49:09 +00:00
parent b269e0779a
commit 0ffc909969

View File

@ -21,7 +21,6 @@
#include "UCodes.h" #include "UCodes.h"
#include "UCode_ROM.h" #include "UCode_ROM.h"
CUCode_Rom::CUCode_Rom(CMailHandler& _rMailHandler) CUCode_Rom::CUCode_Rom(CMailHandler& _rMailHandler)
: IUCode(_rMailHandler) : IUCode(_rMailHandler)
, m_BootTask_numSteps(0) , m_BootTask_numSteps(0)
@ -32,15 +31,12 @@ CUCode_Rom::CUCode_Rom(CMailHandler& _rMailHandler)
m_rMailHandler.PushMail(0x8071FEED); m_rMailHandler.PushMail(0x8071FEED);
} }
CUCode_Rom::~CUCode_Rom() CUCode_Rom::~CUCode_Rom()
{} {}
void CUCode_Rom::Update() void CUCode_Rom::Update()
{} {}
void CUCode_Rom::HandleMail(u32 _uMail) void CUCode_Rom::HandleMail(u32 _uMail)
{ {
if (m_NextParameter == 0) if (m_NextParameter == 0)
@ -80,17 +76,17 @@ void CUCode_Rom::HandleMail(u32 _uMail)
{ {
m_CurrentUCode.m_StartPC = _uMail; m_CurrentUCode.m_StartPC = _uMail;
BootUCode(); BootUCode();
return; // FIXES THE OVERWRITE
} }
break; break;
} }
// THE GODDAMN OVERWRITE WAS HERE. Without the return above, since BootUCode may delete "this", well ...
m_NextParameter = 0; m_NextParameter = 0;
} }
} }
void CUCode_Rom::BootUCode()
void
CUCode_Rom::BootUCode()
{ {
// simple non-scientific crc invented by ector :P // simple non-scientific crc invented by ector :P
// too annoying to change now, and probably good enough anyway // too annoying to change now, and probably good enough anyway