From 15c33ebedb5d7e8e72b23598e55b72ff8c8c3965 Mon Sep 17 00:00:00 2001 From: Connor McLaughlin Date: Wed, 1 Apr 2020 01:48:37 +1000 Subject: [PATCH] CDROM: Add "Enable Region Check" option --- src/core/cdrom.cpp | 5 +++-- src/core/host_interface.cpp | 1 + src/core/settings.cpp | 2 ++ src/core/settings.h | 1 + 4 files changed, 7 insertions(+), 2 deletions(-) diff --git a/src/core/cdrom.cpp b/src/core/cdrom.cpp index 8d2ace255..4bee493b6 100644 --- a/src/core/cdrom.cpp +++ b/src/core/cdrom.cpp @@ -1375,8 +1375,9 @@ void CDROM::DoIDRead() { flags_byte |= (1 << 6); // Disc Missing } - else if (m_disc_region == DiscRegion::Other || - m_system->GetRegion() != System::GetConsoleRegionForDiscRegion(m_disc_region)) + else if (m_system->GetSettings().cdrom_region_check && + (m_disc_region == DiscRegion::Other || + m_system->GetRegion() != System::GetConsoleRegionForDiscRegion(m_disc_region))) { stat_byte |= STAT_ID_ERROR; flags_byte |= (1 << 7); // Unlicensed diff --git a/src/core/host_interface.cpp b/src/core/host_interface.cpp index b1ea194ff..36c8e5a74 100644 --- a/src/core/host_interface.cpp +++ b/src/core/host_interface.cpp @@ -879,6 +879,7 @@ void HostInterface::SetDefaultSettings(SettingsInterface& si) si.SetBoolValue("Display", "VSync", true); si.SetBoolValue("CDROM", "ReadThread", true); + si.SetBoolValue("CDROM", "RegionCheck", true); si.SetStringValue("Audio", "Backend", Settings::GetAudioBackendName(AudioBackend::Cubeb)); si.SetBoolValue("Audio", "Sync", true); diff --git a/src/core/settings.cpp b/src/core/settings.cpp index 25ffa182b..635e4ed29 100644 --- a/src/core/settings.cpp +++ b/src/core/settings.cpp @@ -40,6 +40,7 @@ void Settings::Load(SettingsInterface& si) video_sync_enabled = si.GetBoolValue("Display", "VSync", true); cdrom_read_thread = si.GetBoolValue("CDROM", "ReadThread", true); + cdrom_region_check = si.GetBoolValue("CDROM", "RegionCheck", true); audio_backend = ParseAudioBackend(si.GetStringValue("Audio", "Backend", "Cubeb").c_str()).value_or(AudioBackend::Cubeb); @@ -99,6 +100,7 @@ void Settings::Save(SettingsInterface& si) const si.SetBoolValue("Display", "VSync", video_sync_enabled); si.SetBoolValue("CDROM", "ReadThread", cdrom_read_thread); + si.SetBoolValue("CDROM", "RegionCheck", cdrom_region_check); si.SetStringValue("Audio", "Backend", GetAudioBackendName(audio_backend)); si.SetBoolValue("Audio", "Sync", audio_sync_enabled); diff --git a/src/core/settings.h b/src/core/settings.h index f60036fb0..93fdb9c6e 100644 --- a/src/core/settings.h +++ b/src/core/settings.h @@ -61,6 +61,7 @@ struct Settings bool video_sync_enabled = true; bool cdrom_read_thread = true; + bool cdrom_region_check = true; AudioBackend audio_backend = AudioBackend::Cubeb; bool audio_sync_enabled = true;