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 loading save states with bluetooth passthrough #9583

Merged
merged 1 commit into from Mar 16, 2021

Conversation

michaelszubartowicz
Copy link
Contributor

When a save state is loaded, the IOS device serving bluetooth is cast as BluetoothEmuDevice. If, however, a real Wiimote with BT passthrough is used, this caused the game to crash. Now the proper device class is used.

return;
if (s_wiimote_sources[index] == WiimoteSource::Real)
{
const auto bluetooth = std::static_pointer_cast<IOS::HLE::BluetoothRealDevice>(
Copy link
Contributor

Choose a reason for hiding this comment

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

This branch seems unnecessary in its current state...it's accessing the bluetooth and doing nothing with it.

Suggest fixing it (not sure what the correct solution would be) or just removing it if there's nothing to do:

if (s_wiimote_sources[index] == WiimoteSource::Emulated)
{
    const auto bluetooth = std::static_pointer_cast<IOS::HLE::BluetoothEmuDevice>(
        ios->GetDeviceByName("/dev/usb/oh1/57e/305"));
    if (!bluetooth)
      return;
bluetooth->AccessWiimoteByIndex(index)->SetSource(GetHIDWiimoteSource(index));
  }

@michaelszubartowicz
Copy link
Contributor Author

Thanks for the quick reply. I fixed it.

Source/Core/Core/HW/Wiimote.cpp Outdated Show resolved Hide resolved
When a save state is loaded, the IOS device serving bluetooth
is cast as BluetoothEmuDevice. If, however, a real Wiimote
with BT passthrough is used, this caused the game to crash.
Now the proper device class is used.
Copy link
Member

@leoetlino leoetlino left a comment

Choose a reason for hiding this comment

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

(I took the liberty of rebasing your PR and squashing the commits)

@leoetlino leoetlino merged commit 646bdc9 into dolphin-emu:master Mar 16, 2021
10 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
3 participants