Skip to content

Commit

Permalink
overlays: update progress dialog workaround
Browse files Browse the repository at this point in the history
  • Loading branch information
Megamouse committed Jun 10, 2023
1 parent 27349c5 commit c78c504
Show file tree
Hide file tree
Showing 4 changed files with 11 additions and 16 deletions.
2 changes: 1 addition & 1 deletion rpcs3/Emu/Cell/PPUThread.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1535,7 +1535,7 @@ void ppu_thread::cpu_task()
// Wait until the progress dialog is closed.
// We don't want to open a cell dialog while a native progress dialog is still open.
thread_ctrl::wait_on<atomic_wait::op_ne>(g_progr_ptotal, 0);
g_fxo->get<progress_dialog_workaround>().skip_the_progress_dialog = true;
g_fxo->get<progress_dialog_server>().show_overlay_message_only = true;

// Sadly we can't postpone initializing guest time because we need to run PPU threads
// (the farther it's postponed, the less accuracy of guest time has been lost)
Expand Down
8 changes: 0 additions & 8 deletions rpcs3/Emu/System.h
Original file line number Diff line number Diff line change
Expand Up @@ -15,14 +15,6 @@

void init_fxo_for_exec(utils::serial*, bool);

struct progress_dialog_workaround
{
// WORKAROUND:
// We don't want to show the native dialog during gameplay.
// This can currently interfere with cell dialogs.
atomic_t<bool> skip_the_progress_dialog = false;
};

enum class localized_string_id;
enum class video_renderer;

Expand Down
14 changes: 7 additions & 7 deletions rpcs3/Emu/system_progress.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,7 @@ void progress_dialog_server::operator()()
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.
bool show_overlay_message = false; // Only show an overlay message after initial loading is done.
std::shared_ptr<MsgDialogBase> dlg;

if (const auto renderer = rsx::get_current_renderer())
Expand All @@ -71,9 +71,9 @@ void progress_dialog_server::operator()()
renderer->is_initialized.wait(false, atomic_wait_timeout(5 * 1000000000ull));

auto manager = g_fxo->try_get<rsx::overlays::display_manager>();
skip_this_one = !renderer->is_initialized || g_fxo->get<progress_dialog_workaround>().skip_the_progress_dialog || (manager && manager->get<rsx::overlays::message_dialog>());
show_overlay_message = show_overlay_message_only;

if (manager && !skip_this_one)
if (manager && !show_overlay_message)
{
MsgDialogType type{};
type.se_mute_on = true;
Expand All @@ -88,7 +88,7 @@ void progress_dialog_server::operator()()
}
}

if (!skip_this_one && !native_dlg && (dlg = Emu.GetCallbacks().get_msg_dialog()))
if (!show_overlay_message && !native_dlg && (dlg = Emu.GetCallbacks().get_msg_dialog()))
{
dlg->type.se_normal = true;
dlg->type.bg_invisible = true;
Expand Down Expand Up @@ -141,7 +141,7 @@ void progress_dialog_server::operator()()
break;
}

if (skip_this_one)
if (show_overlay_message)
{
// Show a message instead
rsx::overlays::show_ppu_compile_notification();
Expand Down Expand Up @@ -180,7 +180,7 @@ void progress_dialog_server::operator()()
}
}

if (skip_this_one)
if (show_overlay_message)
{
// Make sure to update any pending messages. PPU compilation may freeze the image.
rsx::overlays::refresh_message_queue();
Expand All @@ -194,7 +194,7 @@ void progress_dialog_server::operator()()
break;
}

if (skip_this_one)
if (show_overlay_message)
{
// Do nothing
}
Expand Down
3 changes: 3 additions & 0 deletions rpcs3/Emu/system_progress.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -39,4 +39,7 @@ struct progress_dialog_server
~progress_dialog_server();

static constexpr auto thread_name = "Progress Dialog Server"sv;

// We don't want to show the native dialog during gameplay.
atomic_t<bool> show_overlay_message_only = false;
};

0 comments on commit c78c504

Please sign in to comment.