mirror of
https://github.com/dolphin-emu/dolphin.git
synced 2025-02-02 19:12:47 +02:00
Add surround sound support to GC AX HLE
This commit is contained in:
parent
954c55e35a
commit
ae85159a94
@ -157,13 +157,11 @@ void CUCode_AX::HandleCommandList()
|
|||||||
break;
|
break;
|
||||||
|
|
||||||
case CMD_OUTPUT:
|
case CMD_OUTPUT:
|
||||||
// Skip the first address, it is used for surround audio
|
|
||||||
// output, which we don't support yet.
|
|
||||||
curr_idx += 2;
|
|
||||||
|
|
||||||
addr_hi = m_cmdlist[curr_idx++];
|
addr_hi = m_cmdlist[curr_idx++];
|
||||||
addr_lo = m_cmdlist[curr_idx++];
|
addr_lo = m_cmdlist[curr_idx++];
|
||||||
OutputSamples(HILO_TO_32(addr));
|
addr2_hi = m_cmdlist[curr_idx++];
|
||||||
|
addr2_lo = m_cmdlist[curr_idx++];
|
||||||
|
OutputSamples(HILO_TO_32(addr2), HILO_TO_32(addr));
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case CMD_END:
|
case CMD_END:
|
||||||
@ -379,8 +377,14 @@ void CUCode_AX::UploadLRS(u32 dst_addr)
|
|||||||
memcpy(HLEMemory_Get_Pointer(dst_addr), buffers, sizeof (buffers));
|
memcpy(HLEMemory_Get_Pointer(dst_addr), buffers, sizeof (buffers));
|
||||||
}
|
}
|
||||||
|
|
||||||
void CUCode_AX::OutputSamples(u32 out_addr)
|
void CUCode_AX::OutputSamples(u32 lr_addr, u32 surround_addr)
|
||||||
{
|
{
|
||||||
|
int surround_buffer[5 * 32];
|
||||||
|
|
||||||
|
for (u32 i = 0; i < 5 * 32; ++i)
|
||||||
|
surround_buffer[i] = Common::swap32(m_samples_surround[i]);
|
||||||
|
memcpy(HLEMemory_Get_Pointer(surround_addr), surround_buffer, sizeof (surround_buffer));
|
||||||
|
|
||||||
// 32 samples per ms, 5 ms, 2 channels
|
// 32 samples per ms, 5 ms, 2 channels
|
||||||
short buffer[5 * 32 * 2];
|
short buffer[5 * 32 * 2];
|
||||||
|
|
||||||
@ -405,7 +409,7 @@ void CUCode_AX::OutputSamples(u32 out_addr)
|
|||||||
buffer[2 * i + 1] = Common::swap16(m_samples_right[i]);
|
buffer[2 * i + 1] = Common::swap16(m_samples_right[i]);
|
||||||
}
|
}
|
||||||
|
|
||||||
memcpy(HLEMemory_Get_Pointer(out_addr), buffer, sizeof (buffer));
|
memcpy(HLEMemory_Get_Pointer(lr_addr), buffer, sizeof (buffer));
|
||||||
}
|
}
|
||||||
|
|
||||||
void CUCode_AX::HandleMail(u32 mail)
|
void CUCode_AX::HandleMail(u32 mail)
|
||||||
|
@ -21,7 +21,6 @@
|
|||||||
// * Depop support
|
// * Depop support
|
||||||
// * ITD support
|
// * ITD support
|
||||||
// * Polyphase sample interpolation support (not very useful)
|
// * Polyphase sample interpolation support (not very useful)
|
||||||
// * Surround sound mixing
|
|
||||||
// * Dolby Pro 2 mixing with recent AX versions
|
// * Dolby Pro 2 mixing with recent AX versions
|
||||||
|
|
||||||
#ifndef _UCODE_AX_H
|
#ifndef _UCODE_AX_H
|
||||||
@ -135,7 +134,7 @@ protected:
|
|||||||
void ProcessPBList(u32 pb_addr);
|
void ProcessPBList(u32 pb_addr);
|
||||||
void MixAUXSamples(int aux_id, u32 write_addr, u32 read_addr);
|
void MixAUXSamples(int aux_id, u32 write_addr, u32 read_addr);
|
||||||
void UploadLRS(u32 dst_addr);
|
void UploadLRS(u32 dst_addr);
|
||||||
void OutputSamples(u32 out_addr);
|
void OutputSamples(u32 out_addr, u32 surround_addr);
|
||||||
|
|
||||||
private:
|
private:
|
||||||
enum CmdType
|
enum CmdType
|
||||||
|
Loading…
Reference in New Issue
Block a user