From d8f18a3318d7801633b4205bbe49f39e9a6d52e5 Mon Sep 17 00:00:00 2001 From: Ty Lamontagne Date: Tue, 26 Nov 2024 16:53:12 -0500 Subject: [PATCH] CDVD: Byte swap hack. CHD CD audio with OSDSYS is working --- pcsx2/CDVD/InputIsoFile.cpp | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/pcsx2/CDVD/InputIsoFile.cpp b/pcsx2/CDVD/InputIsoFile.cpp index 5240925bb1..e16f0b2170 100644 --- a/pcsx2/CDVD/InputIsoFile.cpp +++ b/pcsx2/CDVD/InputIsoFile.cpp @@ -160,6 +160,17 @@ int InputIsoFile::FinishRead3(u8* dst, uint mode) dst[diff - 9] = 2; } + // Seems like CHD data ends up being the wrong endianess for audio + // Confidence is about 50% on this one, but it seems to work + // (CHD is the only file with a TOC anyways, so who cares about the other formats) + if (m_type == ISOTYPE_AUDIO && mode == CDVD_MODE_2352) + { + for (int i = 0; i < 2352; i += 2) + { + std::swap(dst[diff + i], dst[diff + i + 1]); + } + } + return 0; }