Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add back a hack for the SasAudio/sceAtrac integration (mono audio). #19095

Merged
merged 1 commit into from
Apr 29, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
4 changes: 4 additions & 0 deletions Core/HLE/AtracCtx.h
Original file line number Diff line number Diff line change
Expand Up @@ -216,6 +216,10 @@ class AtracBase {
int GetOutputChannels() const {
return outputChannels_;
}
void SetOutputChannels(int channels) {
// Only used for sceSas audio. To be refactored away in the future.
outputChannels_ = channels;
}

int atracID_ = -1;

Expand Down
5 changes: 5 additions & 0 deletions Core/HLE/sceAtrac.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1007,6 +1007,11 @@ u32 AtracSasDecodeData(int atracID, u8* outbuf, u32 outbufPtr, u32 *SamplesNum,

int AtracSasGetIDByContext(u32 contextAddr) {
int atracID = (int)Memory::Read_U32(contextAddr + 0xfc);
// Restored old hack here that forces outputChannels_ to 1, since sceSas expects mono output, unlike normal usage.
// This is for savestate compatibility.
// I think it would be better to simply pass in a 1 as a parameter to atrac->DecodeData in AtracSasDecodeData above.
AtracBase *atrac = getAtrac(atracID);
atrac->SetOutputChannels(1);
return atracID;
}

Expand Down