DSPHLE - AX - Metroid Prime 2 (GC) audio should be better now
git-svn-id: https://dolphin-emu.googlecode.com/svn/trunk@4737 8ced0084-cf51-0410-be5f-012b33b47a6e
This commit is contained in:
parent
d62d6b0c33
commit
dfc24337b5
|
@ -54,7 +54,6 @@ CUCode_AX::CUCode_AX(CMailHandler& _rMailHandler)
|
||||||
{
|
{
|
||||||
// we got loaded
|
// we got loaded
|
||||||
m_rMailHandler.PushMail(0xDCD10000);
|
m_rMailHandler.PushMail(0xDCD10000);
|
||||||
m_rMailHandler.PushMail(0x80000000); // handshake ??? only (crc == 0xe2136399) needs it ...
|
|
||||||
|
|
||||||
templbuffer = new int[1024 * 1024];
|
templbuffer = new int[1024 * 1024];
|
||||||
temprbuffer = new int[1024 * 1024];
|
temprbuffer = new int[1024 * 1024];
|
||||||
|
@ -337,7 +336,12 @@ void CUCode_AX::MixAdd(short* _pBuffer, int _iSize)
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
AXParamBlock PB;
|
AXParamBlock PB;
|
||||||
u32 blockAddr = m_addressPBs;
|
|
||||||
|
for (int x = 0; x < numPBaddr; x++)
|
||||||
|
{
|
||||||
|
//u32 blockAddr = m_addressPBs;
|
||||||
|
u32 blockAddr = PBaddr[x];
|
||||||
|
|
||||||
if (!blockAddr)
|
if (!blockAddr)
|
||||||
return;
|
return;
|
||||||
|
|
||||||
|
@ -346,14 +350,17 @@ void CUCode_AX::MixAdd(short* _pBuffer, int _iSize)
|
||||||
{
|
{
|
||||||
if (!ReadOutPB(blockAddr, PB))
|
if (!ReadOutPB(blockAddr, PB))
|
||||||
break;
|
break;
|
||||||
|
|
||||||
ProcessUpdates(PB);
|
ProcessUpdates(PB);
|
||||||
MixAddVoice(PB, templbuffer, temprbuffer, _iSize, false);
|
MixAddVoice(PB, templbuffer, temprbuffer, _iSize, false);
|
||||||
|
|
||||||
if (!WriteBackPB(blockAddr, PB))
|
if (!WriteBackPB(blockAddr, PB))
|
||||||
break;
|
break;
|
||||||
|
|
||||||
blockAddr = (PB.next_pb_hi << 16) | PB.next_pb_lo;
|
blockAddr = (PB.next_pb_hi << 16) | PB.next_pb_lo;
|
||||||
if (!blockAddr) {
|
|
||||||
// Guess we're out of blocks
|
// Guess we're out of blocks
|
||||||
|
if (!blockAddr)
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -393,6 +400,13 @@ void CUCode_AX::HandleMail(u32 _uMail)
|
||||||
// a new List
|
// a new List
|
||||||
DEBUG_LOG(DSPHLE, " >>>> u32 MAIL : General Mail (%08x)", _uMail);
|
DEBUG_LOG(DSPHLE, " >>>> u32 MAIL : General Mail (%08x)", _uMail);
|
||||||
}
|
}
|
||||||
|
else if (_uMail == 0xCDD10000) // Action 0 - restart
|
||||||
|
{
|
||||||
|
m_rMailHandler.PushMail(0xDCD10001);
|
||||||
|
}
|
||||||
|
else if ((_uMail & 0xFFFF0000) == 0xCDD10000) // Action 1/2/3
|
||||||
|
{
|
||||||
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
DEBUG_LOG(DSPHLE, " >>>> u32 MAIL : AXTask Mail (%08x)", _uMail);
|
DEBUG_LOG(DSPHLE, " >>>> u32 MAIL : AXTask Mail (%08x)", _uMail);
|
||||||
|
@ -454,6 +468,8 @@ bool CUCode_AX::AXTask(u32& _uMail)
|
||||||
|
|
||||||
bool bExecuteList = true;
|
bool bExecuteList = true;
|
||||||
|
|
||||||
|
numPBaddr = 0;
|
||||||
|
|
||||||
#if defined(HAVE_WX) && HAVE_WX
|
#if defined(HAVE_WX) && HAVE_WX
|
||||||
if (m_DebuggerFrame) SaveMail(false, _uMail); // Save mail for debugging
|
if (m_DebuggerFrame) SaveMail(false, _uMail); // Save mail for debugging
|
||||||
#endif
|
#endif
|
||||||
|
@ -462,6 +478,7 @@ bool CUCode_AX::AXTask(u32& _uMail)
|
||||||
static int last_valid_command = 0;
|
static int last_valid_command = 0;
|
||||||
u16 iCommand = Memory_Read_U16(uAddress);
|
u16 iCommand = Memory_Read_U16(uAddress);
|
||||||
uAddress += 2;
|
uAddress += 2;
|
||||||
|
|
||||||
switch (iCommand)
|
switch (iCommand)
|
||||||
{
|
{
|
||||||
case AXLIST_STUDIOADDR: //00
|
case AXLIST_STUDIOADDR: //00
|
||||||
|
@ -491,15 +508,15 @@ bool CUCode_AX::AXTask(u32& _uMail)
|
||||||
//
|
//
|
||||||
case AXLIST_PBADDR: //02
|
case AXLIST_PBADDR: //02
|
||||||
{
|
{
|
||||||
m_addressPBs = Memory_Read_U32(uAddress);
|
PBaddr[numPBaddr] = Memory_Read_U32(uAddress);
|
||||||
uAddress += 4;
|
numPBaddr++;
|
||||||
|
|
||||||
|
m_addressPBs = Memory_Read_U32(uAddress); // left in for now
|
||||||
|
uAddress += 4;
|
||||||
soundStream->GetMixer()->SetHLEReady(true);
|
soundStream->GetMixer()->SetHLEReady(true);
|
||||||
SaveLog("%08x : AXLIST PB address: %08x", uAddress, m_addressPBs);
|
SaveLog("%08x : AXLIST PB address: %08x", uAddress, m_addressPBs);
|
||||||
|
|
||||||
SaveLog("Update the SoundThread to be in sync");
|
SaveLog("Update the SoundThread to be in sync");
|
||||||
// soundStream->Update(); //do it in this thread to avoid sync problems
|
// soundStream->Update(); //do it in this thread to avoid sync problems
|
||||||
|
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
|
|
||||||
|
@ -617,6 +634,6 @@ bool CUCode_AX::AXTask(u32& _uMail)
|
||||||
SaveLog("End");
|
SaveLog("End");
|
||||||
|
|
||||||
// i hope resume is okay AX
|
// i hope resume is okay AX
|
||||||
m_rMailHandler.PushMail(0xDCD10001);
|
m_rMailHandler.PushMail(0xDCD10002);
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
|
@ -48,6 +48,8 @@ public:
|
||||||
int saveNext;
|
int saveNext;
|
||||||
|
|
||||||
// PBs
|
// PBs
|
||||||
|
u8 numPBaddr;
|
||||||
|
u32 PBaddr[8]; //2 needed for MP2
|
||||||
u32 m_addressPBs;
|
u32 m_addressPBs;
|
||||||
u32 _CRC;
|
u32 _CRC;
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue