Very small but very COOL fix.

This commit fixed the Hang-up in many games, like "New Super Mario Bros. Wii", "Resident Evil: The Darkside Chronicles", "Fatal Frame 4: Tsukihami no Kamen", "Muramasa: The Demon Blade", and etc. You name it. OH YEAH!

This little issue really cost me some *serious* debugging time, phew...

git-svn-id: https://dolphin-emu.googlecode.com/svn/trunk@4616 8ced0084-cf51-0410-be5f-012b33b47a6e
This commit is contained in:
ayuanx
2009-11-27 15:07:52 +00:00
parent 3e49599a33
commit 155719dc36
6 changed files with 41 additions and 97 deletions

View File

@ -111,12 +111,9 @@ union UDSPControl
// DSPState
struct DSPState
{
u32 IntControl;
UDSPControl DSPControl;
DSPState()
{
IntControl = 0;
DSPControl.Hex = 0;
}
};
@ -411,20 +408,12 @@ void Write16(const u16 _Value, const u32 _Address)
break;
case AUDIO_DMA_CONTROL_LEN: // called by AIStartDMA()
{
UAudioDMAControl old_control = g_audioDMA.AudioDMAControl;
g_audioDMA.AudioDMAControl.Hex = _Value;
if (!old_control.Enabled && g_audioDMA.AudioDMAControl.Enabled)
{
// Enabled bit was flipped to true, let's latch address & length and call the interrupt.
g_audioDMA.BlocksLeft = g_audioDMA.AudioDMAControl.NumBlocks;
g_audioDMA.ReadAddress = g_audioDMA.SourceAddress;
GenerateDSPInterrupt(DSP::INT_AID);
INFO_LOG(DSPINTERFACE, "AID DMA started - source address %08x, length %i blocks", g_audioDMA.SourceAddress, g_audioDMA.AudioDMAControl.NumBlocks);
}
g_audioDMA.BlocksLeft = g_audioDMA.AudioDMAControl.NumBlocks;
g_audioDMA.ReadAddress = g_audioDMA.SourceAddress;
INFO_LOG(DSPINTERFACE, "AID DMA started - source address %08x, length %i blocks", g_audioDMA.SourceAddress, g_audioDMA.AudioDMAControl.NumBlocks);
break;
}
case AUDIO_DMA_BYTES_LEFT:
_dbg_assert_(DSPINTERFACE,0);
break;
@ -449,11 +438,6 @@ void UpdateAudioDMA()
g_audioDMA.ReadAddress += 32;
g_audioDMA.BlocksLeft--;
if (!g_audioDMA.BlocksLeft) {
// No need to turn off the DMA - we can only get here if we had
// blocks left when we entered this function, and no longer have
// any. Latch new parameters
g_audioDMA.BlocksLeft = g_audioDMA.AudioDMAControl.NumBlocks;
g_audioDMA.ReadAddress = g_audioDMA.SourceAddress;
// DEBUG_LOG(DSPLLE, "ADMA read addresses: %08x", g_audioDMA.ReadAddress);
GenerateDSPInterrupt(DSP::INT_AID);
}
@ -469,10 +453,6 @@ void Read32(u32& _uReturnValue, const u32 _iAddress)
INFO_LOG(DSPINTERFACE, "DSPInterface(r) 0x%08x", _iAddress);
switch (_iAddress & 0xFFFF)
{
case DSP_INTERRUPT_CONTROL:
_uReturnValue = g_dspState.IntControl;
return;
default:
_dbg_assert_(DSPINTERFACE,0);
break;