HLE DSP: Fix AAC response stub

This commit is contained in:
wheremyfoodat 2024-05-01 16:10:51 +03:00
parent ad380b8c5a
commit e4b81d61a4
2 changed files with 8 additions and 5 deletions

View file

@ -294,12 +294,12 @@ namespace Audio::HLE {
struct SourceStatus { struct SourceStatus {
struct Status { struct Status {
u8 isEnabled; ///< Is this channel enabled? (Doesn't have to be playing anything.) u8 enabled; ///< Is this channel enabled? (Doesn't have to be playing anything.)
u8 currentBufferIDDirty; ///< Non-zero when current_buffer_id changes u8 currentBufferIDDirty; ///< Non-zero when current_buffer_id changes
u16_le syncCount; ///< Is set by the DSP to the value of SourceConfiguration::sync_count u16_le syncCount; ///< Is set by the DSP to the value of SourceConfiguration::sync_count
u32_dsp samplePosition; ///< Number of samples into the current buffer u32_dsp samplePosition; ///< Number of samples into the current buffer
u16_le currentBufferID; ///< Updated when a buffer finishes playing u16_le currentBufferID; ///< Updated when a buffer finishes playing
u16_le lastBufferID; ///< Updated when all buffers in the queue finish playing u16_le previousBufferID; ///< Updated when all buffers in the queue finish playing
}; };
Status status[sourceCount]; Status status[sourceCount];

View file

@ -229,11 +229,11 @@ namespace Audio {
// Update write region of shared memory // Update write region of shared memory
auto& status = write.sourceStatuses.status[i]; auto& status = write.sourceStatuses.status[i];
status.isEnabled = source.enabled; status.enabled = source.enabled;
status.syncCount = source.syncCount; status.syncCount = source.syncCount;
status.currentBufferIDDirty = source.isBufferIDDirty ? 1 : 0; status.currentBufferIDDirty = source.isBufferIDDirty ? 1 : 0;
status.currentBufferID = source.currentBufferID; status.currentBufferID = source.currentBufferID;
status.lastBufferID = source.previousBufferID; status.previousBufferID = source.previousBufferID;
// TODO: Properly update sample position // TODO: Properly update sample position
status.samplePosition = source.samplePosition; status.samplePosition = source.samplePosition;
@ -503,7 +503,7 @@ namespace Audio {
} }
void HLE_DSP::handleAACRequest(const AAC::Message& request) { void HLE_DSP::handleAACRequest(const AAC::Message& request) {
AAC::Message response = {}; AAC::Message response;
switch (request.command) { switch (request.command) {
case AAC::Command::EncodeDecode: case AAC::Command::EncodeDecode:
@ -514,6 +514,9 @@ namespace Audio {
response.decodeResponse.sampleCount = 1024; response.decodeResponse.sampleCount = 1024;
response.decodeResponse.size = 0; response.decodeResponse.size = 0;
response.decodeResponse.sampleRate = AAC::SampleRate::Rate48000; response.decodeResponse.sampleRate = AAC::SampleRate::Rate48000;
response.command = request.command;
response.mode = request.mode;
break; break;
case AAC::Command::Init: case AAC::Command::Init: