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

Shut down Wii software gracefully #4244

Merged
merged 7 commits into from Oct 3, 2016

Conversation

leoetlino
Copy link
Member

@leoetlino leoetlino commented Sep 24, 2016

This adds support for triggering the power event (in the STM), so that stopping emulation first triggers a shutdown event, which notably gives emulated software time to save game data (issue 8979) and clean up SYSCONF (to disconnect Wiimotes and update their state in the SYSCONF).

On the first press, the stop button/hotkey/whatever will trigger a STM power event, and we immediately show an OSD message, so it doesn't look like Dolphin is ignoring the stop command. On a second try, we will forcefully stop emulation, just like how it was working before.

Note: this still doesn't allow Wiimotes to trigger a poweroff when the last Wiimote is powered off. Not sure why; this will likely be something to look into in the future.


This change is Reviewable

@JMC47
Copy link
Contributor

JMC47 commented Sep 25, 2016

Virtual Console titles indefinitely hang on "attempting shutdown" for right now.

@leoetlino
Copy link
Member Author

@JMC47 does that only happen with VC titles?

@leoetlino
Copy link
Member Author

This should now be fixed.

@leoetlino leoetlino force-pushed the stm-shutdown branch 3 times, most recently from 7a80037 to 591eebe Compare September 25, 2016 20:59
@JMC47
Copy link
Contributor

JMC47 commented Sep 25, 2016

Fixes saving in NES VC/SNES VC games.

There was as far as I know no reason to put everything in the header.

Separating the declaration from the implementation reduces build
times in case the implementation is updated without changing
any declaration.
Switches to the new naming conventions.
This adds support for triggering the power event (in the STM), so that
stopping emulation first triggers a shutdown event, which notably gives
emulated software time to save game data (issue 8979) and clean up
SYSCONF (to disconnect Wiimotes and update their state in the SYSCONF).

On the first press, the stop button/hotkey/whatever will trigger a STM
power event. On a second try, we will forcefully stop emulation, just
like how it was working before.
When standby mode is enabled, this causes games to ES_Launch the system
menu instead of directly asking IOS (the STM more precisely) to shut
down, which prevents graceful shutdown from working
(it'll appear to hang).

Dolphin never supported WC24 standby mode anyway, so this shouldn't
cause any issues. (This should be reverted if and when WC24 standby is
implemented…)
@shuffle2
Copy link
Contributor

shuffle2 commented Oct 3, 2016

lgtm

@shuffle2 shuffle2 merged commit 5e8bc4a into dolphin-emu:master Oct 3, 2016
@leoetlino leoetlino deleted the stm-shutdown branch October 3, 2016 08:43
// Disable WiiConnect24's standby mode. If it is enabled, it prevents us from receiving
// shutdown commands in the State Transition Manager (STM).
// TODO: remove this if and once Dolphin supports WC24 standby mode.
SConfig::GetInstance().m_SYSCONF->SetData("IPL.IDL", 0x00);

This comment was marked as off-topic.

This comment was marked as off-topic.

This comment was marked as off-topic.

This comment was marked as off-topic.

This comment was marked as off-topic.

@Ebola16
Copy link
Member

Ebola16 commented Oct 4, 2016

This PR is likely the cause of Issue #9819 (Dolphin crashes when exiting emulation of Gecko OS)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
4 participants