[Project64] Add Load32AudioInterface

This commit is contained in:
zilmar 2015-12-21 21:06:51 +11:00
parent 6d4ea6d693
commit 9778846ae8
2 changed files with 49 additions and 39 deletions

View File

@ -2531,39 +2531,8 @@ bool CMipsMemoryVM::LW_NonMemory(uint32_t PAddr, uint32_t* Value)
*Value = m_MemLookupValue.UW[0]; *Value = m_MemLookupValue.UW[0];
break; break;
case 0x04500000: case 0x04500000:
switch (PAddr) Load32AudioInterface();
{ *Value = m_MemLookupValue.UW[0];
case 0x04500004:
if (g_System->bFixedAudio())
{
*Value = g_Audio->GetLength();
}
else
{
if (g_Plugins->Audio()->AiReadLength != NULL)
{
*Value = g_Plugins->Audio()->AiReadLength();
}
else
{
*Value = 0;
}
}
break;
case 0x0450000C:
if (g_System->bFixedAudio())
{
*Value = g_Audio->GetStatus();
}
else
{
*Value = g_Reg->AI_STATUS_REG;
}
break;
default:
*Value = 0;
return false;
}
break; break;
case 0x04600000: case 0x04600000:
switch (PAddr) switch (PAddr)
@ -5672,3 +5641,43 @@ void CMipsMemoryVM::Load32VideoInterface(void)
} }
} }
} }
void CMipsMemoryVM::Load32AudioInterface(void)
{
switch (m_MemLookupAddress & 0x1FFFFFFF)
{
case 0x04500004:
if (g_System->bFixedAudio())
{
m_MemLookupValue.UW[0] = g_Audio->GetLength();
}
else
{
if (g_Plugins->Audio()->AiReadLength != NULL)
{
m_MemLookupValue.UW[0] = g_Plugins->Audio()->AiReadLength();
}
else
{
m_MemLookupValue.UW[0] = 0;
}
}
break;
case 0x0450000C:
if (g_System->bFixedAudio())
{
m_MemLookupValue.UW[0] = g_Audio->GetStatus();
}
else
{
m_MemLookupValue.UW[0] = g_Reg->AI_STATUS_REG;
}
break;
default:
m_MemLookupValue.UW[0] = 0;
if (bHaveDebugger())
{
g_Notify->BreakPoint(__FILE__, __LINE__);
}
}
}

View File

@ -187,6 +187,7 @@ private:
static void Load32DPCommand(void); static void Load32DPCommand(void);
static void Load32MIPSInterface(void); static void Load32MIPSInterface(void);
static void Load32VideoInterface(void); static void Load32VideoInterface(void);
static void Load32AudioInterface(void);
CMipsMemory_CallBack * const m_CBClass; CMipsMemory_CallBack * const m_CBClass;