Skip to content

Commit 020b539

Browse files
authored
Merge pull request #19095 from hrydgard/mono-atrac-fix
Add back a hack for the SasAudio/sceAtrac integration (mono audio).
2 parents 31749ac + 917f589 commit 020b539

File tree

2 files changed

+9
-0
lines changed

2 files changed

+9
-0
lines changed

Core/HLE/AtracCtx.h

+4
Original file line numberDiff line numberDiff line change
@@ -216,6 +216,10 @@ class AtracBase {
216216
int GetOutputChannels() const {
217217
return outputChannels_;
218218
}
219+
void SetOutputChannels(int channels) {
220+
// Only used for sceSas audio. To be refactored away in the future.
221+
outputChannels_ = channels;
222+
}
219223

220224
int atracID_ = -1;
221225

Core/HLE/sceAtrac.cpp

+5
Original file line numberDiff line numberDiff line change
@@ -1007,6 +1007,11 @@ u32 AtracSasDecodeData(int atracID, u8* outbuf, u32 outbufPtr, u32 *SamplesNum,
10071007

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

0 commit comments

Comments
 (0)