diff --git a/rpcs3/Emu/system_progress.cpp b/rpcs3/Emu/system_progress.cpp index c4181263f8..092ca399d2 100644 --- a/rpcs3/Emu/system_progress.cpp +++ b/rpcs3/Emu/system_progress.cpp @@ -12,6 +12,9 @@ atomic_t g_progr_fdone{0}; atomic_t g_progr_ptotal{0}; atomic_t g_progr_pdone{0}; +// For Batch PPU Compilation +atomic_t g_system_progress_canceled{false}; + namespace rsx::overlays { class progress_dialog : public message_dialog @@ -44,6 +47,8 @@ void progress_dialog_server::operator()() break; } + g_system_progress_canceled = false; + // Initialize message dialog bool skip_this_one = false; // Workaround: do not open a progress dialog if there is already a cell message dialog open. std::shared_ptr dlg; @@ -82,6 +87,8 @@ void progress_dialog_server::operator()() // Abort everything Emu.Stop(); }); + + g_system_progress_canceled = true; }; Emu.CallAfter([dlg, text0]() diff --git a/rpcs3/Emu/system_progress.hpp b/rpcs3/Emu/system_progress.hpp index e4eeb6275c..b9b1422e4a 100644 --- a/rpcs3/Emu/system_progress.hpp +++ b/rpcs3/Emu/system_progress.hpp @@ -8,6 +8,7 @@ extern atomic_t g_progr_ftotal; extern atomic_t g_progr_fdone; extern atomic_t g_progr_ptotal; extern atomic_t g_progr_pdone; +extern atomic_t g_system_progress_canceled; // Initialize progress dialog (can be recursive) class scoped_progress_dialog final diff --git a/rpcs3/rpcs3qt/game_list_frame.cpp b/rpcs3/rpcs3qt/game_list_frame.cpp index 635bf98c51..937e3f4e8f 100644 --- a/rpcs3/rpcs3qt/game_list_frame.cpp +++ b/rpcs3/rpcs3qt/game_list_frame.cpp @@ -44,6 +44,8 @@ LOG_CHANNEL(game_list_log, "GameList"); LOG_CHANNEL(sys_log, "SYS"); +extern atomic_t g_system_progress_canceled; + inline std::string sstr(const QString& _in) { return _in.toStdString(); } game_list_frame::game_list_frame(std::shared_ptr gui_settings, std::shared_ptr emu_settings, std::shared_ptr persistent_settings, QWidget* parent) @@ -1664,7 +1666,7 @@ void game_list_frame::BatchCreatePPUCaches() for (const auto& game : m_game_data) { - if (pdlg->wasCanceled()) + if (pdlg->wasCanceled() || g_system_progress_canceled) { break; } @@ -1678,7 +1680,7 @@ void game_list_frame::BatchCreatePPUCaches() } } - if (pdlg->wasCanceled()) + if (pdlg->wasCanceled() || g_system_progress_canceled) { game_list_log.notice("PPU Cache Batch Creation was canceled"); @@ -1687,6 +1689,11 @@ void game_list_frame::BatchCreatePPUCaches() QApplication::processEvents(); Emu.Stop(); } + + if (!pdlg->wasCanceled()) + { + pdlg->close(); + } return; }