diff --git a/Source/Core/Core/Src/HW/DSPHLE/UCodes/UCode_NewAX.cpp b/Source/Core/Core/Src/HW/DSPHLE/UCodes/UCode_NewAX.cpp index c482a8ce8a..9bc43b0f04 100644 --- a/Source/Core/Core/Src/HW/DSPHLE/UCodes/UCode_NewAX.cpp +++ b/Source/Core/Core/Src/HW/DSPHLE/UCodes/UCode_NewAX.cpp @@ -126,15 +126,21 @@ void CUCode_NewAX::HandleCommandList() MixAUXSamples(cmd == CMD_MIX_AUXA, HILO_TO_32(addr), HILO_TO_32(addr2)); break; + case CMD_UPLOAD_LRS: + addr_hi = m_cmdlist[curr_idx++]; + addr_lo = m_cmdlist[curr_idx++]; + UploadLRS(HILO_TO_32(addr)); + break; + + case CMD_SBUFFER_ADDR: curr_idx += 2; break; + case CMD_UNK_08: curr_idx += 10; break; // TODO: check + case CMD_MIX_AUXB_NOWRITE: addr_hi = m_cmdlist[curr_idx++]; addr_lo = m_cmdlist[curr_idx++]; MixAUXSamples(false, 0, HILO_TO_32(addr)); break; - case CMD_SBUFFER_ADDR: curr_idx += 2; break; - case CMD_UNK_08: curr_idx += 10; break; // TODO: check - case CMD_UNK_09: curr_idx += 2; break; case CMD_COMPRESSOR_TABLE_ADDR: curr_idx += 2; break; case CMD_UNK_0B: break; // TODO: check other versions case CMD_UNK_0C: break; // TODO: check other versions @@ -370,6 +376,19 @@ void CUCode_NewAX::MixAUXSamples(bool AUXA, u32 write_addr, u32 read_addr) } } +void CUCode_NewAX::UploadLRS(u32 dst_addr) +{ + int buffers[3][5 * 32]; + + for (u32 i = 0; i < 5 * 32; ++i) + { + buffers[0][i] = Common::swap32(m_samples_left[i]); + buffers[1][i] = Common::swap32(m_samples_right[i]); + buffers[2][i] = Common::swap32(m_samples_surround[i]); + } + memcpy(HLEMemory_Get_Pointer(dst_addr), buffers, sizeof (buffers)); +} + void CUCode_NewAX::OutputSamples(u32 out_addr) { // 32 samples per ms, 5 ms, 2 channels diff --git a/Source/Core/Core/Src/HW/DSPHLE/UCodes/UCode_NewAX.h b/Source/Core/Core/Src/HW/DSPHLE/UCodes/UCode_NewAX.h index af4a2a4895..91aa495c0e 100644 --- a/Source/Core/Core/Src/HW/DSPHLE/UCodes/UCode_NewAX.h +++ b/Source/Core/Core/Src/HW/DSPHLE/UCodes/UCode_NewAX.h @@ -57,10 +57,10 @@ private: CMD_PROCESS = 0x03, CMD_MIX_AUXA = 0x04, CMD_MIX_AUXB = 0x05, - CMD_MIX_AUXB_NOWRITE = 0x06, + CMD_UPLOAD_LRS = 0x06, CMD_SBUFFER_ADDR = 0x07, CMD_UNK_08 = 0x08, - CMD_UNK_09 = 0x09, + CMD_MIX_AUXB_NOWRITE = 0x09, CMD_COMPRESSOR_TABLE_ADDR = 0x0A, CMD_UNK_0B = 0x0B, CMD_UNK_0C = 0x0C, @@ -108,6 +108,7 @@ private: void SetupProcessing(u32 studio_addr); void ProcessPBList(u32 pb_addr); void MixAUXSamples(bool AUXA, u32 write_addr, u32 read_addr); + void UploadLRS(u32 dst_addr); void OutputSamples(u32 out_addr); };