Fixed a silly math bug from r5638. Thanks ector!

git-svn-id: https://dolphin-emu.googlecode.com/svn/trunk@5644 8ced0084-cf51-0410-be5f-012b33b47a6e
This commit is contained in:
skidau 2010-06-10 10:30:41 +00:00
parent 5845ff6728
commit de45e015cd
1 changed files with 14 additions and 5 deletions

View File

@ -440,21 +440,27 @@ void Write16(const u16 _Value, const u32 _Address)
break;
case AR_DMA_MMADDR_H:
g_arDMA.MMAddr = (g_arDMA.MMAddr & 0xFFFF) | (_Value<<16); break;
g_arDMA.MMAddr = (g_arDMA.MMAddr & 0xFFFF) | (_Value<<16);
break;
case AR_DMA_MMADDR_L:
g_arDMA.MMAddr = (g_arDMA.MMAddr & 0xFFFF0000) | (_Value); break; // Is MMAddr also 32 byte aligned?
g_arDMA.MMAddr = (g_arDMA.MMAddr & 0xFFFF0000) | (_Value);
break;
case AR_DMA_ARADDR_H:
g_arDMA.ARAddr = (g_arDMA.ARAddr & 0xFFFF) | (_Value<<16); break;
g_arDMA.ARAddr = (g_arDMA.ARAddr & 0xFFFF) | (_Value<<16);
break;
case AR_DMA_ARADDR_L:
g_arDMA.ARAddr = (g_arDMA.ARAddr & 0xFFFF0000) | (_Value) + (_Value % 32); break;
g_arDMA.ARAddr = (g_arDMA.ARAddr & 0xFFFF0000) | (_Value);
break;
case AR_DMA_CNT_H:
g_arDMA.Cnt.Hex = (g_arDMA.Cnt.Hex & 0xFFFF) | (_Value<<16);
break;
case AR_DMA_CNT_L:
g_arDMA.Cnt.Hex = (g_arDMA.Cnt.Hex & 0xFFFF0000) | (_Value) + (_Value % 4);
g_arDMA.Cnt.Hex = ((g_arDMA.Cnt.Hex & 0xFFFF0000) | (_Value) + 3) & ~3;
Do_ARAM_DMA();
break;
@ -609,6 +615,9 @@ void UpdateAudioDMA()
void Do_ARAM_DMA()
{
// Align ARAddr to the 32 byte boundary. TODO: Verify alignment on the real hw
g_arDMA.ARAddr = g_arDMA.ARAddr & ~31;
// Real hardware DMAs in 32byte chunks, but we can get by with 8byte chunks
if (g_arDMA.Cnt.dir)
{