just some misc cleanup that's been setting around

git-svn-id: https://dolphin-emu.googlecode.com/svn/trunk@4403 8ced0084-cf51-0410-be5f-012b33b47a6e
This commit is contained in:
Shawn Hoffman 2009-10-11 22:44:58 +00:00
parent 9da9346274
commit 2cfbd4327f
4 changed files with 71 additions and 80 deletions

View File

@ -827,7 +827,7 @@
> >
</File> </File>
<File <File
RelativePath=".\Src\HW\StreamADPCM.H" RelativePath=".\Src\HW\StreamADPCM.h"
> >
</File> </File>
</Filter> </Filter>

View File

@ -33,7 +33,7 @@ void DoState(PointerWrap &p);
void Update(); void Update();
// Calls by DSP plugin // Called by DSP plugin
u32 Callback_GetStreaming(short* _pDestBuffer, u32 _numSamples); u32 Callback_GetStreaming(short* _pDestBuffer, u32 _numSamples);
void Read32(u32& _uReturnValue, const u32 _iAddress); void Read32(u32& _uReturnValue, const u32 _iAddress);

View File

@ -230,87 +230,78 @@ void Shutdown()
void Read16(u16& _uReturnValue, const u32 _iAddress) void Read16(u16& _uReturnValue, const u32 _iAddress)
{ {
// WTF is this check about? DSP is at 5000 TODO remove switch (_iAddress & 0xFFFF)
if ((_iAddress & 0x6C00) != 0x6c00)
{ {
switch (_iAddress & 0xFFFF)
{
// AI_REGS 0x5000+ // AI_REGS 0x5000+
case DSP_MAIL_TO_DSP_HI: case DSP_MAIL_TO_DSP_HI:
_uReturnValue = dsp_plugin->DSP_ReadMailboxHigh(true); _uReturnValue = dsp_plugin->DSP_ReadMailboxHigh(true);
break; break;
case DSP_MAIL_TO_DSP_LO: case DSP_MAIL_TO_DSP_LO:
_uReturnValue = dsp_plugin->DSP_ReadMailboxLow(true); _uReturnValue = dsp_plugin->DSP_ReadMailboxLow(true);
break; break;
case DSP_MAIL_FROM_DSP_HI: case DSP_MAIL_FROM_DSP_HI:
_uReturnValue = dsp_plugin->DSP_ReadMailboxHigh(false); _uReturnValue = dsp_plugin->DSP_ReadMailboxHigh(false);
break; break;
case DSP_MAIL_FROM_DSP_LO: case DSP_MAIL_FROM_DSP_LO:
_uReturnValue = dsp_plugin->DSP_ReadMailboxLow(false); _uReturnValue = dsp_plugin->DSP_ReadMailboxLow(false);
break; break;
case DSP_CONTROL: case DSP_CONTROL:
_uReturnValue = (g_dspState.DSPControl.Hex & ~DSP_CONTROL_MASK) | _uReturnValue = (g_dspState.DSPControl.Hex & ~DSP_CONTROL_MASK) |
(dsp_plugin->DSP_ReadControlRegister() & DSP_CONTROL_MASK); (dsp_plugin->DSP_ReadControlRegister() & DSP_CONTROL_MASK);
break; break;
// AR_REGS 0x501x+ // AR_REGS 0x501x+
case 0x5012: case 0x5012:
_uReturnValue = g_AR_MODE; _uReturnValue = g_AR_MODE;
break; break;
case 0x5016: // ready flag? case 0x5016: // ready flag?
_uReturnValue = g_AR_READY_FLAG; _uReturnValue = g_AR_READY_FLAG;
break; break;
case 0x501a: case 0x501a:
_uReturnValue = 0x000; _uReturnValue = 0x000;
break; break;
case AR_DMA_MMADDR_H: _uReturnValue = g_arDMA.MMAddr >> 16; return; case AR_DMA_MMADDR_H: _uReturnValue = g_arDMA.MMAddr >> 16; return;
case AR_DMA_MMADDR_L: _uReturnValue = g_arDMA.MMAddr & 0xFFFF; return; case AR_DMA_MMADDR_L: _uReturnValue = g_arDMA.MMAddr & 0xFFFF; return;
case AR_DMA_ARADDR_H: _uReturnValue = g_arDMA.ARAddr >> 16; return; case AR_DMA_ARADDR_H: _uReturnValue = g_arDMA.ARAddr >> 16; return;
case AR_DMA_ARADDR_L: _uReturnValue = g_arDMA.ARAddr & 0xFFFF; return; case AR_DMA_ARADDR_L: _uReturnValue = g_arDMA.ARAddr & 0xFFFF; return;
case AR_DMA_CNT_H: _uReturnValue = g_arDMA.Cnt.Hex >> 16; return; case AR_DMA_CNT_H: _uReturnValue = g_arDMA.Cnt.Hex >> 16; return;
case AR_DMA_CNT_L: _uReturnValue = g_arDMA.Cnt.Hex & 0xFFFF; return; case AR_DMA_CNT_L: _uReturnValue = g_arDMA.Cnt.Hex & 0xFFFF; return;
// DMA_REGS 0x5030+ // DMA_REGS 0x5030+
case AUDIO_DMA_BYTES_LEFT: case AUDIO_DMA_BYTES_LEFT:
// Hmm. Would be stupid to ask for bytes left. Assume it wants // Hmm. Would be stupid to ask for bytes left. Assume it wants
// blocks left. // blocks left.
_uReturnValue = g_audioDMA.BlocksLeft; _uReturnValue = g_audioDMA.BlocksLeft;
break; break;
case AUDIO_DMA_START_LO: case AUDIO_DMA_START_LO:
_uReturnValue = g_audioDMA.SourceAddress & 0xFFFF; _uReturnValue = g_audioDMA.SourceAddress & 0xFFFF;
break; break;
case AUDIO_DMA_START_HI: case AUDIO_DMA_START_HI:
_uReturnValue = g_audioDMA.SourceAddress >> 16; _uReturnValue = g_audioDMA.SourceAddress >> 16;
break; break;
case AUDIO_DMA_CONTROL_LEN: case AUDIO_DMA_CONTROL_LEN:
_uReturnValue = g_audioDMA.AudioDMAControl.Hex; _uReturnValue = g_audioDMA.AudioDMAControl.Hex;
break; break;
default: default:
_dbg_assert_(DSPINTERFACE,0);
break;
}
if (_iAddress != 0xCC005004)
{
DEBUG_LOG(DSPINTERFACE, "DSPInterface(r16) 0x%08x (%02x) (%08x)", _iAddress, _uReturnValue, PowerPC::ppcState.pc);
}
return;
}
else
{
_dbg_assert_(DSPINTERFACE,0); _dbg_assert_(DSPINTERFACE,0);
break;
}
if (_iAddress != (0xCC000000 + DSP_MAIL_FROM_DSP_HI))
{
DEBUG_LOG(DSPINTERFACE, "DSPInterface(r16) 0x%08x (%02x) (%08x)", _iAddress, _uReturnValue, PowerPC::ppcState.pc);
} }
_uReturnValue = 0x000;
} }
void Write16(const u16 _Value, const u32 _Address) void Write16(const u16 _Value, const u32 _Address)