Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix menu bar becoming desynced when Pause at End of Movie is disabled #10457

Merged

Conversation

Pokechu22
Copy link
Contributor

Previously, when Pause at End of Movie was disabled, the game would continue running as it should, but the menu bar would think the game was paused, showing the play button instead of the pause button. To make things worse, clicking the play button would then restart the game, instead of pausing or doing nothing. F10 paused/unpaused as normal, though.

The old behavior was essentially to enable stepping/pause mode (via CPU::Break()) and then if Pause at End of Movie was disabled, to un-pause on the host thread (via CPU::EnableStepping(false)). For reasons which aren't entirely clear to me, the first one notified the menu bar (through the Host::UpdateDisasmDialog callback, not the Settings::EmulationStateChanged one), and the second did not. In any case, this approach does not particularly make sense; I don't see any reason to pause and unpause if Pause at End of Movie is disabled; instead, we should only pause when Pause at End of Movie is enabled.

This behavior was probably introduced in c1944f6, though I haven't tested it.

Previously, when Pause at End of Movie was disabled, the game would continue running as it should, but the menu bar would think the game was paused, showing the play button instead of the pause button.  To make things worse, clicking the play button would then restart the game, instead of pausing or doing nothing.  F10 paused/unpaused as normal, though.

The old behavior was essentially to enable stepping/pause mode (via `CPU::Break()`) and then if Pause at End of Movie was disabled, to un-pause on the host thread (via `CPU::EnableStepping(false)`).  For reasons which aren't entirely clear to me, the first one notified the menu bar (through the `Host::UpdateDisasmDialog` callback, not the `Settings::EmulationStateChanged` one), and the second did not.  In any case, this approach does not particularly make sense; I don't see any reason to pause and unpause if Pause at End of Movie is disabled; instead, we should only pause when Pause at End of Movie is enabled.

This behavior was probably introduced in c1944f6, though I haven't tested it.
Copy link
Member

@JosJuice JosJuice left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is probably fine.

@lioncash lioncash merged commit 1e126d2 into dolphin-emu:master Feb 18, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
3 participants