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 savestates in Bluetooth passthrough mode #4651

Merged
merged 2 commits into from Jan 27, 2017

Conversation

leoetlino
Copy link
Member

@leoetlino leoetlino commented Jan 12, 2017

This fixes savestates when using Bluetooth passthrough by keeping track of pending transfer commands and discarding them on state load, so that the emulated software receives a reply to IOS requests as expected.

With this change, savestates in BT passthrough should work as noted in the following table:

BT state when saving when loading Result
N remotes connected N remotes connected during the same session
(remotes were not disconnected after saving)
Working
N remotes connected some or all remotes disconnected Working*
0 remote connected 0 remote connected Working
N remotes connected some or all remotes connected during a different session
(i.e., disconnected after saving)
Not supported
0 remote connected 1 or more remotes connected Not supported

* On the first connection attempt, the game will realise that the Wiimote has disconnected. A remote can then be connected. Also, you may need to connect then disconnect a Wiimote first before loading the state; otherwise the adapter may get confused.

Basically, as long as there's no Bluetooth connection, or the Bluetooth connections all match (which are the most common cases), then it should work fine.

This PR also gets rid of the static state, which was previously needed because the transfer callbacks were static methods.

@leoetlino
Copy link
Member Author

Temporarily closing while I investigate something I broke

@leoetlino leoetlino closed this Jan 12, 2017
@leoetlino leoetlino changed the title Fix savestates in Bluetooth passthrough mode [WIP] Fix savestates in Bluetooth passthrough mode Jan 14, 2017
@leoetlino leoetlino reopened this Jan 14, 2017
@leoetlino leoetlino force-pushed the bt-pass-savestates branch 2 times, most recently from 1458321 to 29cf230 Compare January 14, 2017 20:45
@leoetlino leoetlino changed the title [WIP] Fix savestates in Bluetooth passthrough mode Fix savestates in Bluetooth passthrough mode Jan 14, 2017
@leoetlino
Copy link
Member Author

This should now be working as explained in the PR description.

@mbc07
Copy link
Contributor

mbc07 commented Jan 17, 2017

What happens if we try to load a state made with a emulated Wiimote in passthrough mode or vice-versa?

@leoetlino
Copy link
Member Author

You can't. Dolphin will detect it and prevent the state from loading.

@leoetlino leoetlino changed the title Fix savestates in Bluetooth passthrough mode [WIP] Fix savestates in Bluetooth passthrough mode Jan 19, 2017
@leoetlino leoetlino changed the title [WIP] Fix savestates in Bluetooth passthrough mode Fix savestates in Bluetooth passthrough mode Jan 21, 2017
@leoetlino leoetlino force-pushed the bt-pass-savestates branch 3 times, most recently from 0a8d3d9 to 903eb6e Compare January 25, 2017 14:08
This fixes savestates when using Bluetooth passthrough by keeping track
of pending transfer commands and discarding them on state load, so that
the emulated software receives a reply to IOS requests as expected.

With this change, savestates in BT passthrough should work as long as
no Wiimote is connected when creating the savestate and when
restoring it. Yes, I know this is an important limitation -- but
that is probably the best we can do, and it's still better than
completely broken savestates.
@Parlane Parlane merged commit 64b0773 into dolphin-emu:master Jan 27, 2017
@leoetlino leoetlino deleted the bt-pass-savestates branch January 27, 2017 07:44
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
3 participants