From efc7cd65819e6f59e944409e37212110ab6b1200 Mon Sep 17 00:00:00 2001 From: ayuanx Date: Mon, 25 Jan 2010 09:48:27 +0000 Subject: [PATCH] Sanity check, this could help us to figure out the ARAM DMA crash. git-svn-id: https://dolphin-emu.googlecode.com/svn/trunk@4956 8ced0084-cf51-0410-be5f-012b33b47a6e --- Source/Core/Core/Src/HW/DSP.cpp | 18 +++++++++++++++--- 1 file changed, 15 insertions(+), 3 deletions(-) diff --git a/Source/Core/Core/Src/HW/DSP.cpp b/Source/Core/Core/Src/HW/DSP.cpp index d7248eb694..b7f999c079 100644 --- a/Source/Core/Core/Src/HW/DSP.cpp +++ b/Source/Core/Core/Src/HW/DSP.cpp @@ -436,7 +436,13 @@ void Write16(const u16 _Value, const u32 _Address) case AR_DMA_CNT_L: g_arDMA.Cnt.Hex = (g_arDMA.Cnt.Hex & 0xFFFF0000) | (_Value); - Do_ARAM_DMA(); + if (g_arDMA.Cnt.count % 8) + { + PanicAlert("DSPINTERFACE: ARAM DMA count: %08x not aligned to 8 bytes!", g_arDMA.Cnt.Hex); + ERROR_LOG(DSPINTERFACE, "ARAM DMA count: %08x not aligned to 8 bytes!", g_arDMA.Cnt.Hex); + } + else + Do_ARAM_DMA(); break; // Audio DMA_REGS 0x5030+ @@ -508,8 +514,14 @@ void Write32(const u32 _iValue, const u32 _iAddress) break; case AR_DMA_CNT_H: - g_arDMA.Cnt.Hex = _iValue; - Do_ARAM_DMA(); + g_arDMA.Cnt.Hex = _iValue; + if (g_arDMA.Cnt.count % 8) + { + PanicAlert("DSPINTERFACE: ARAM DMA count: %08x not aligned to 8 bytes!", g_arDMA.Cnt.Hex); + ERROR_LOG(DSPINTERFACE, "ARAM DMA count: %08x not aligned to 8 bytes!", g_arDMA.Cnt.Hex); + } + else + Do_ARAM_DMA(); break; default: