From 09ead539a5e4af9810c270cf946b2c1efdc281f3 Mon Sep 17 00:00:00 2001 From: Megamouse Date: Wed, 28 Jul 2021 21:09:11 +0200 Subject: [PATCH] improvise CELL_SAVEDATA_ERRDIALOG_NOREPEAT --- rpcs3/Emu/Cell/Modules/cellSaveData.cpp | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/rpcs3/Emu/Cell/Modules/cellSaveData.cpp b/rpcs3/Emu/Cell/Modules/cellSaveData.cpp index beaa72d199..b3b8800f14 100644 --- a/rpcs3/Emu/Cell/Modules/cellSaveData.cpp +++ b/rpcs3/Emu/Cell/Modules/cellSaveData.cpp @@ -117,6 +117,7 @@ struct savedata_manager { semaphore<> mutex; atomic_t enable_overlay{false}; + atomic_t last_cbresult_error_dialog{0}; // CBRESULT errors are negative }; static std::vector get_save_entries(const std::string& base_dir, const std::string& prefix) @@ -312,9 +313,12 @@ static error_code display_callback_result_error_message(ppu_thread& ppu, const C return {CELL_SAVEDATA_ERROR_PARAM, "22"}; } - // TODO: errDialog == CELL_SAVEDATA_ERRDIALOG_NOREPEAT - if (errDialog != CELL_SAVEDATA_ERRDIALOG_ALWAYS) + if (errDialog == CELL_SAVEDATA_ERRDIALOG_NONE || + (errDialog == CELL_SAVEDATA_ERRDIALOG_NOREPEAT && result.result == g_fxo->get().last_cbresult_error_dialog.exchange(result.result))) + { + // TODO: Find out if the "last error" is always tracked or only when NOREPEAT is set return CELL_SAVEDATA_ERROR_CBRESULT; + } // Yield before a blocking dialog is being spawned lv2_obj::sleep(ppu);