summaryrefslogtreecommitdiff
path: root/Source
diff options
context:
space:
mode:
authorhrydgard <hrydgard@gmail.com>2009-07-12 20:14:21 +0000
committerhrydgard <hrydgard@gmail.com>2009-07-12 20:14:21 +0000
commitc45dfd156f6be4cb2b692f1a70af52d696103ade (patch)
tree041ac15ec4d06f9757409cf074173a86a3c7cac6 /Source
parentfe76193641def26ff5a60c7076b8d213e5638190 (diff)
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
Diffstat (limited to 'Source')
-rw-r--r--Source/Plugins/Plugin_DSP_HLE/Src/MailHandler.h11
-rw-r--r--Source/Plugins/Plugin_DSP_HLE/Src/UCodes/UCode_Zelda_Voice.cpp9
2 files changed, 15 insertions, 5 deletions
diff --git a/Source/Plugins/Plugin_DSP_HLE/Src/MailHandler.h b/Source/Plugins/Plugin_DSP_HLE/Src/MailHandler.h
index 69ffacb862..b7bb13a63b 100644
--- a/Source/Plugins/Plugin_DSP_HLE/Src/MailHandler.h
+++ b/Source/Plugins/Plugin_DSP_HLE/Src/MailHandler.h
@@ -37,7 +37,16 @@ public:
u16 ReadDSPMailboxLow();
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:
// mail handler
diff --git a/Source/Plugins/Plugin_DSP_HLE/Src/UCodes/UCode_Zelda_Voice.cpp b/Source/Plugins/Plugin_DSP_HLE/Src/UCodes/UCode_Zelda_Voice.cpp
index 944a2111fd..aa933414c2 100644
--- a/Source/Plugins/Plugin_DSP_HLE/Src/UCodes/UCode_Zelda_Voice.cpp
+++ b/Source/Plugins/Plugin_DSP_HLE/Src/UCodes/UCode_Zelda_Voice.cpp
@@ -312,7 +312,7 @@ void CUCode_Zelda::RenderVoice_Raw(ZeldaVoicePB &PB, s16 *_Buffer, int _Size)
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
// in Zelda, since Length is set to 0xF0000000
// blah
@@ -526,7 +526,7 @@ ContinueWithBlock:
AX1L = m_MiscTable[0x200 + AX1L];
AX1H = m_MiscTable[0x200 + AX1H];
- short b00[16];
+ short b00[20];
b00[0] = AX1L * AX1H >> 16;
b00[1] = AX0L * AX1H >> 16;
b00[2] = AX0H * AX1L >> 16;
@@ -646,9 +646,10 @@ ContinueWithBlock:
// size is in stereo samples.
void CUCode_Zelda::MixAdd(short *_Buffer, int _Size)
{
+ // PanicAlert("mixadd");
// Safety check
- if (_Size > 256 * 1024)
- _Size = 256 * 1024;
+ if (_Size > 256 * 1024 - 8)
+ _Size = 256 * 1024 - 8;
// Final mix buffers
memset(m_LeftBuffer, 0, _Size * sizeof(s32));