diff --git a/src/core/bus.cpp b/src/core/bus.cpp index c3c7e9f8a..bcdab1926 100644 --- a/src/core/bus.cpp +++ b/src/core/bus.cpp @@ -1609,23 +1609,21 @@ void Bus::EXP2WriteHandler(VirtualMemoryAddress address, u32 value) { DEV_LOG("BIOS POST2 status: {:02X}", value & UINT32_C(0x0F)); } -#if 0 - // TODO: Put behind configuration variable - else if (offset == 0x81) - { - Log_WarningPrint("pcsx_debugbreak()"); - Host::ReportErrorAsync("Error", "pcsx_debugbreak()"); - System::PauseSystem(true); - CPU::ExitExecution(); - } - else if (offset == 0x82) + else if (offset >= 0x81 && offset <= 0x82 && g_settings.pcsx_expansion_region_enable) { - Log_WarningFmt("pcsx_exit() with status 0x{:02X}", value & UINT32_C(0xFF)); - Host::ReportErrorAsync("Error", fmt::format("pcsx_exit() with status 0x{:02X}", value & UINT32_C(0xFF))); - System::ShutdownSystem(false); - CPU::ExitExecution(); + if (offset == 0x81) + { + WARNING_LOG("pcsx_debugbreak()"); + System::PauseSystem(true); + CPU::ExitExecution(); + } + else // if (offset == 0x82) + { + WARNING_LOG("pcsx_exit() with status 0x{:02X}", value & UINT32_C(0xFF)); + System::ShutdownSystem(false); + CPU::ExitExecution(); + } } -#endif else { WARNING_LOG("EXP2 write: 0x{:08X} <- 0x{:08X}", address, value); diff --git a/src/core/settings.cpp b/src/core/settings.cpp index bc6574244..c3720580f 100644 --- a/src/core/settings.cpp +++ b/src/core/settings.cpp @@ -632,6 +632,8 @@ void Settings::Load(const SettingsInterface& si, const SettingsInterface& contro pcdrv_enable_writes = si.GetBoolValue("PCDrv", "EnableWrites", false); pcdrv_root = si.GetStringViewValue("PCDrv", "Root"); + pcsx_expansion_region_enable = si.GetBoolValue("Debug", "PCSXExpansionRegion", false); + #ifdef __ANDROID__ // Android users are incredibly silly and don't understand that stretch is in the aspect ratio list... if (si.GetBoolValue("Display", "Stretch", false)) @@ -954,6 +956,8 @@ void Settings::Save(SettingsInterface& si, bool ignore_base) const si.SetBoolValue("PCDrv", "Enabled", pcdrv_enable); si.SetBoolValue("PCDrv", "EnableWrites", pcdrv_enable_writes); si.SetStringValue("PCDrv", "Root", pcdrv_root.c_str()); + + si.SetBoolValue("Debug", "PCSXExpansionRegion", pcsx_expansion_region_enable); } bool Settings::TextureReplacementSettings::Configuration::operator==(const Configuration& rhs) const @@ -1160,6 +1164,7 @@ void Settings::ApplySettingRestrictions() rewind_enable = false; pio_device_type = PIODeviceType::None; pcdrv_enable = false; + pcsx_expansion_region_enable = false; dma_max_slice_ticks = DEFAULT_DMA_MAX_SLICE_TICKS; dma_halt_ticks = DEFAULT_DMA_HALT_TICKS; gpu_fifo_size = DEFAULT_GPU_FIFO_SIZE; diff --git a/src/core/settings.h b/src/core/settings.h index 4d8e9c401..279a6ed6a 100644 --- a/src/core/settings.h +++ b/src/core/settings.h @@ -301,6 +301,7 @@ struct Settings : public GPUSettings bool pcdrv_enable : 1 = false; bool pcdrv_enable_writes : 1 = false; + bool pcsx_expansion_region_enable : 1 = false; bool pio_switch_active : 1 = true; bool pio_flash_write_enable : 1 = false; diff --git a/src/core/system.cpp b/src/core/system.cpp index ee326c67a..3854e0cac 100644 --- a/src/core/system.cpp +++ b/src/core/system.cpp @@ -4878,6 +4878,8 @@ void System::WarnAboutUnsafeSettings() append(TRANSLATE_SV("System", "PIO device removed.")); if (g_settings.pcdrv_enable) append(TRANSLATE_SV("System", "PCDrv disabled.")); + if (g_settings.pcsx_expansion_region_enable) + append(TRANSLATE_SV("System", "PCSX Expansion Region disabled.")); if (g_settings.bios_patch_fast_boot) append(TRANSLATE_SV("System", "Fast boot disabled.")); diff --git a/src/duckstation-qt/debuggingsettingswidget.cpp b/src/duckstation-qt/debuggingsettingswidget.cpp index 832b918c4..c0da05321 100644 --- a/src/duckstation-qt/debuggingsettingswidget.cpp +++ b/src/duckstation-qt/debuggingsettingswidget.cpp @@ -247,6 +247,8 @@ void DebuggingSettingsWidget::addTweakOptions() addIntRangeTweakOption(m_dialog, m_ui.tweakOptionTable, tr("GDB Server Port"), "Debug", "GDBServerPort", 1, 65535, Settings::DEFAULT_GDB_SERVER_PORT); + addBooleanTweakOption(m_dialog, m_ui.tweakOptionTable, tr("Enable PCSX Expansion Region"), "Debug", + "PCSXExpansionRegion", false); addBooleanTweakOption(m_dialog, m_ui.tweakOptionTable, tr("Export Shared Memory"), "Hacks", "ExportSharedMemory", false); addBooleanTweakOption(m_dialog, m_ui.tweakOptionTable, tr("Redirect SIO to TTY"), "SIO", "RedirectToTTY", false); @@ -294,10 +296,11 @@ void DebuggingSettingsWidget::onResetToDefaultClicked() setBooleanTweakOption(m_ui.tweakOptionTable, i++, false); // Enable GDB Server setIntRangeTweakOption(m_ui.tweakOptionTable, i++, Settings::DEFAULT_GDB_SERVER_PORT); // GDB Server Port setBooleanTweakOption(m_ui.tweakOptionTable, i++, false); // Export Shared Memory - setBooleanTweakOption(m_ui.tweakOptionTable, i++, false); // Redirect SIO to TTY - setBooleanTweakOption(m_ui.tweakOptionTable, i++, false); // Enable PCDRV - setBooleanTweakOption(m_ui.tweakOptionTable, i++, false); // Enable PCDRV Writes - setDirectoryOption(m_ui.tweakOptionTable, i++, ""); // PCDrv Root Directory + setBooleanTweakOption(m_ui.tweakOptionTable, i++, false); // Enable PCSX Expansion Region + setBooleanTweakOption(m_ui.tweakOptionTable, i++, false); // Redirect SIO to TTY + setBooleanTweakOption(m_ui.tweakOptionTable, i++, false); // Enable PCDRV + setBooleanTweakOption(m_ui.tweakOptionTable, i++, false); // Enable PCDRV Writes + setDirectoryOption(m_ui.tweakOptionTable, i++, ""); // PCDrv Root Directory return; } @@ -330,6 +333,7 @@ void DebuggingSettingsWidget::onResetToDefaultClicked() sif->DeleteValue("CDROM", "AllowBootingWithoutSBIFile"); sif->DeleteValue("Debug", "EnableGDBServer"); sif->DeleteValue("Debug", "GDBServerPort"); + sif->DeleteValue("Debug", "PCSXExpansionRegion"); sif->DeleteValue("SIO", "RedirectToTTY"); sif->DeleteValue("PCDrv", "Enabled"); sif->DeleteValue("PCDrv", "EnableWrites");