From 04a187afb258f9a3a9b1ed66c123489ba1d60e92 Mon Sep 17 00:00:00 2001 From: Connor McLaughlin Date: Fri, 1 Jan 2021 03:00:06 +1000 Subject: [PATCH] CDROM: Fix read error/unlicensed flag getting set on all discs Regression from 75aa52ab06dea891b21ae9f618d56d52247dd313. --- src/core/cdrom.cpp | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/src/core/cdrom.cpp b/src/core/cdrom.cpp index 0130ab260..c7f981e16 100644 --- a/src/core/cdrom.cpp +++ b/src/core/cdrom.cpp @@ -248,7 +248,7 @@ bool CDROM::DoesMediaRegionMatchConsole() const if (!g_settings.cdrom_region_check) return true; - return System::GetRegion() != System::GetConsoleRegionForDiscRegion(m_disc_region); + return System::GetRegion() == System::GetConsoleRegionForDiscRegion(m_disc_region); } void CDROM::InsertMedia(std::unique_ptr media) @@ -1772,7 +1772,12 @@ void CDROM::DoIDRead() m_current_lba = 0; m_reader.QueueReadSector(0); - if (!IsMediaPS1Disc() || (g_settings.cdrom_region_check && !DoesMediaRegionMatchConsole())) + if (!IsMediaPS1Disc()) + { + stat_byte |= STAT_ID_ERROR; + flags_byte |= (1 << 7) | (1 << 4); // Unlicensed + Audio CD + } + else if (!DoesMediaRegionMatchConsole()) { stat_byte |= STAT_ID_ERROR; flags_byte |= (1 << 7); // Unlicensed