Fixed some bugs with light version.

Now Luigi's Mansion has sound!

git-svn-id: https://dolphin-emu.googlecode.com/svn/trunk@3782 8ced0084-cf51-0410-be5f-012b33b47a6e
This commit is contained in:
luigi2us 2009-07-13 14:51:06 +00:00
parent 75a226f667
commit 389a2c6fc8
2 changed files with 35 additions and 14 deletions

View File

@ -129,6 +129,28 @@ void CUCode_Zelda::HandleMail(u32 _uMail)
void CUCode_Zelda::HandleMail_LightVersion(u32 _uMail)
{
//ERROR_LOG(DSPHLE, "Light version mail %08X, list in progress: %s, step: %i/%i",
// _uMail, m_bListInProgress ? "yes":"no", m_step, m_numSteps);
if (m_bSyncCmdPending)
{
g_dspInitialize.pGenerateDSPInterrupt();
m_CurBuffer++;
if (m_CurBuffer == m_NumBuffers)
{
m_rMailHandler.PushMail(0x80000066); // seen in DSP_UC_Luigi.txt
soundStream->GetMixer()->SetHLEReady(true);
DEBUG_LOG(DSPHLE, "Update the SoundThread to be in sync");
soundStream->Update(); //do it in this thread to avoid sync problems
m_bSyncCmdPending = false;
}
return;
}
if (!m_bListInProgress)
{
switch ((_uMail >> 24) & 0x7F)
@ -296,9 +318,14 @@ void CUCode_Zelda::ExecuteList()
u32 CmdMail = Read32();
u32 Command = (CmdMail >> 24) & 0x7f;
u32 Sync = CmdMail >> 16;
u32 Sync;
u32 ExtraData = CmdMail & 0xFFFF;
if (IsLightVersion())
Sync = 0x62 + (Command << 1); // seen in DSP_UC_Luigi.txt
else
Sync = CmdMail >> 16;
DEBUG_LOG(DSPHLE, "==============================================================================");
DEBUG_LOG(DSPHLE, "Zelda UCode - execute dlist (cmd: 0x%04x : sync: 0x%04x)", Command, Sync);
@ -344,16 +371,7 @@ void CUCode_Zelda::ExecuteList()
// SyncFrame ... zelda ww jumps to 0x0243
case 0x02:
{
if (!IsLightVersion())
{
m_bSyncCmdPending = true;
}
else
{
soundStream->GetMixer()->SetHLEReady(true);
DEBUG_LOG(DSPHLE, "Update the SoundThread to be in sync");
soundStream->Update(); //do it in this thread to avoid sync problems
}
m_bSyncCmdPending = true;
m_CurBuffer = 0;
m_NumBuffers = (CmdMail >> 16) & 0xFF;

View File

@ -660,9 +660,12 @@ void CUCode_Zelda::MixAdd(short *_Buffer, int _Size)
// For each PB...
for (u32 i = 0; i < m_NumVoices; i++)
{
u32 flags = m_SyncFlags[(i >> 4) & 0xF];
if (!(flags & 1 << (15 - (i & 0xF))))
continue;
if (!IsLightVersion())
{
u32 flags = m_SyncFlags[(i >> 4) & 0xF];
if (!(flags & 1 << (15 - (i & 0xF))))
continue;
}
ZeldaVoicePB pb;
ReadVoicePB(m_VoicePBsAddr + (i * 0x180), pb);