From 79e005d85e7dfe09a9c7402e67eaa1148ccbb470 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 | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/pcsx2/CDVD/InputIsoFile.cpp b/pcsx2/CDVD/InputIsoFile.cpp index 5240925bb17b6..aa29e0f54d658 100644 --- a/pcsx2/CDVD/InputIsoFile.cpp +++ b/pcsx2/CDVD/InputIsoFile.cpp @@ -160,6 +160,15 @@ int InputIsoFile::FinishRead3(u8* dst, uint mode) dst[diff - 9] = 2; } + // why do we need to byte swap here ?! + 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; }