DSPHLE: Fix 1 potential and 2 actual crash bugs affecting 32-bit.
git-svn-id: https://dolphin-emu.googlecode.com/svn/trunk@3768 8ced0084-cf51-0410-be5f-012b33b47a6e
This commit is contained in:
parent
fe76193641
commit
c45dfd156f
|
@ -37,7 +37,16 @@ public:
|
||||||
u16 ReadDSPMailboxLow();
|
u16 ReadDSPMailboxLow();
|
||||||
void Update();
|
void Update();
|
||||||
|
|
||||||
u32 GetNextMail() { return m_Mails.front(); }
|
u32 GetNextMail()
|
||||||
|
{
|
||||||
|
if (m_Mails.size())
|
||||||
|
return m_Mails.front();
|
||||||
|
else
|
||||||
|
{
|
||||||
|
WARN_LOG(DSPHLE, "GetNextMail: No mails");
|
||||||
|
return 0; //
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
private:
|
private:
|
||||||
// mail handler
|
// mail handler
|
||||||
|
|
|
@ -312,7 +312,7 @@ void CUCode_Zelda::RenderVoice_Raw(ZeldaVoicePB &PB, s16 *_Buffer, int _Size)
|
||||||
|
|
||||||
if (PB.RemLength < _RealSize)
|
if (PB.RemLength < _RealSize)
|
||||||
{
|
{
|
||||||
WARN_LOG(VIDEO, "Raw: END");
|
WARN_LOG(DSPHLE, "Raw: END");
|
||||||
// Let's ignore this entire case since it doesn't seem to happen
|
// Let's ignore this entire case since it doesn't seem to happen
|
||||||
// in Zelda, since Length is set to 0xF0000000
|
// in Zelda, since Length is set to 0xF0000000
|
||||||
// blah
|
// blah
|
||||||
|
@ -526,7 +526,7 @@ ContinueWithBlock:
|
||||||
AX1L = m_MiscTable[0x200 + AX1L];
|
AX1L = m_MiscTable[0x200 + AX1L];
|
||||||
AX1H = m_MiscTable[0x200 + AX1H];
|
AX1H = m_MiscTable[0x200 + AX1H];
|
||||||
|
|
||||||
short b00[16];
|
short b00[20];
|
||||||
b00[0] = AX1L * AX1H >> 16;
|
b00[0] = AX1L * AX1H >> 16;
|
||||||
b00[1] = AX0L * AX1H >> 16;
|
b00[1] = AX0L * AX1H >> 16;
|
||||||
b00[2] = AX0H * AX1L >> 16;
|
b00[2] = AX0H * AX1L >> 16;
|
||||||
|
@ -646,9 +646,10 @@ ContinueWithBlock:
|
||||||
// size is in stereo samples.
|
// size is in stereo samples.
|
||||||
void CUCode_Zelda::MixAdd(short *_Buffer, int _Size)
|
void CUCode_Zelda::MixAdd(short *_Buffer, int _Size)
|
||||||
{
|
{
|
||||||
|
// PanicAlert("mixadd");
|
||||||
// Safety check
|
// Safety check
|
||||||
if (_Size > 256 * 1024)
|
if (_Size > 256 * 1024 - 8)
|
||||||
_Size = 256 * 1024;
|
_Size = 256 * 1024 - 8;
|
||||||
|
|
||||||
// Final mix buffers
|
// Final mix buffers
|
||||||
memset(m_LeftBuffer, 0, _Size * sizeof(s32));
|
memset(m_LeftBuffer, 0, _Size * sizeof(s32));
|
||||||
|
|
Loading…
Reference in New Issue