Fixed AUXB_NOWRITE command number and implemented UPLOAD_LRS command (06)

This commit is contained in:
Pierre Bourdon 2012-11-14 18:08:29 +01:00
parent f84f15c5bf
commit 531cc6aaf3
2 changed files with 25 additions and 5 deletions

View File

@ -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

View File

@ -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);
};