diff --git a/pcsx2-qt/MainWindow.cpp b/pcsx2-qt/MainWindow.cpp index 2646f2a10d..783c5e309d 100644 --- a/pcsx2-qt/MainWindow.cpp +++ b/pcsx2-qt/MainWindow.cpp @@ -2452,20 +2452,8 @@ void MainWindow::doStartFile(std::optional source, const QStrin void MainWindow::doDiscChange(CDVD_SourceType source, const QString& path) { - const bool is_gs_dump = VMManager::IsGSDumpFileName(path.toStdString()); - if (is_gs_dump != GSDumpReplayer::IsReplayingDump()) - { - QMessageBox::critical(this, tr("Error"), tr("Cannot switch from game to GS dump or vice versa.")); - return; - } - else if (is_gs_dump) - { - Host::RunOnCPUThread([path = path.toStdString()]() { GSDumpReplayer::ChangeDump(path.c_str()); }); - return; - } - bool reset_system = false; - if (!m_was_disc_change_request) + if (!m_was_disc_change_request && !GSDumpReplayer::IsReplayingDump()) { QMessageBox message(QMessageBox::Question, tr("Confirm Disc Change"), tr("Do you want to swap discs or boot the new image (via system reset)?"), QMessageBox::NoButton, this); diff --git a/pcsx2/GSDumpReplayer.cpp b/pcsx2/GSDumpReplayer.cpp index 746f5cf5bc..215f45c557 100644 --- a/pcsx2/GSDumpReplayer.cpp +++ b/pcsx2/GSDumpReplayer.cpp @@ -126,6 +126,12 @@ bool GSDumpReplayer::ChangeDump(const char* filename) { Console.WriteLn("(GSDumpReplayer) Switching to '%s'...", filename); + if (!VMManager::IsGSDumpFileName(filename)) + { + Host::ReportFormattedErrorAsync("GSDumpReplayer", "'%s' is not a GS dump.", filename); + return false; + } + std::unique_ptr new_dump(GSDumpFile::OpenGSDump(filename)); if (!new_dump || !new_dump->ReadFile()) { diff --git a/pcsx2/VMManager.cpp b/pcsx2/VMManager.cpp index 7a26086f01..dec3db2dfc 100644 --- a/pcsx2/VMManager.cpp +++ b/pcsx2/VMManager.cpp @@ -1663,6 +1663,20 @@ void VMManager::FrameAdvance(u32 num_frames /*= 1*/) bool VMManager::ChangeDisc(CDVD_SourceType source, std::string path) { + if (GSDumpReplayer::IsReplayingDump()) + { + if (!GSDumpReplayer::ChangeDump(path.c_str())) + return false; + + UpdateDiscDetails(false); + return true; + } + else if (IsGSDumpFileName(path)) + { + Host::ReportErrorAsync("Error", "Cannot change from game to GS dump without shutting down first."); + return false; + } + const CDVD_SourceType old_type = CDVDsys_GetSourceType(); const std::string old_path(CDVDsys_GetFile(old_type));