Implement command 10, used by FIFA 06 and linked to AUXB mixing. Sound still broken in that game.

This commit is contained in:
Pierre Bourdon 2012-11-27 00:03:02 +01:00
parent fb1ecd90b0
commit 706939e632
2 changed files with 35 additions and 2 deletions

View File

@ -170,7 +170,14 @@ void CUCode_AX::HandleCommandList()
end = true;
break;
case CMD_UNK_10: curr_idx += 4; break;
case CMD_MIX_AUXB_LR:
addr_hi = m_cmdlist[curr_idx++];
addr_lo = m_cmdlist[curr_idx++];
addr2_hi = m_cmdlist[curr_idx++];
addr2_lo = m_cmdlist[curr_idx++];
MixAUXBLR(HILO_TO_32(addr), HILO_TO_32(addr2));
break;
case CMD_UNK_11: curr_idx += 2; break;
case CMD_UNK_12: curr_idx += 1; break;
@ -447,6 +454,31 @@ void CUCode_AX::OutputSamples(u32 lr_addr, u32 surround_addr)
memcpy(HLEMemory_Get_Pointer(lr_addr), buffer, sizeof (buffer));
}
void CUCode_AX::MixAUXBLR(u32 ul_addr, u32 dl_addr)
{
// Upload AUXB L/R
int* ptr = (int*)HLEMemory_Get_Pointer(ul_addr);
for (u32 i = 0; i < 5 * 32; ++i)
*ptr++ = Common::swap32(m_samples_auxB_left[i]);
for (u32 i = 0; i < 5 * 32; ++i)
*ptr++ = Common::swap32(m_samples_auxB_right[i]);
// Mix AUXB L/R to MAIN L/R, and replace AUXB L/R
ptr = (int*)HLEMemory_Get_Pointer(dl_addr);
for (u32 i = 0; i < 5 * 32; ++i)
{
int samp = Common::swap32(*ptr++);
m_samples_auxB_left[i] = samp;
m_samples_left[i] += samp;
}
for (u32 i = 0; i < 5 * 32; ++i)
{
int samp = Common::swap32(*ptr++);
m_samples_auxB_right[i] = samp;
m_samples_right[i] += samp;
}
}
void CUCode_AX::SendAUXAndMix(u32 main_auxa_up, u32 auxb_s_up, u32 main_l_dl,
u32 main_r_dl, u32 auxb_l_dl, u32 auxb_r_dl)
{

View File

@ -135,6 +135,7 @@ protected:
void MixAUXSamples(int aux_id, u32 write_addr, u32 read_addr);
void UploadLRS(u32 dst_addr);
void OutputSamples(u32 out_addr, u32 surround_addr);
void MixAUXBLR(u32 ul_addr, u32 dl_addr);
void SendAUXAndMix(u32 main_auxa_up, u32 auxb_s_up, u32 main_l_dl,
u32 main_r_dl, u32 auxb_l_dl, u32 auxb_r_dl);
@ -157,7 +158,7 @@ private:
CMD_MORE = 0x0D,
CMD_OUTPUT = 0x0E,
CMD_END = 0x0F,
CMD_UNK_10 = 0x10,
CMD_MIX_AUXB_LR = 0x10,
CMD_UNK_11 = 0x11,
CMD_UNK_12 = 0x12,
CMD_SEND_AUX_AND_MIX = 0x13,