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 wiimotespeaker emulation affecting real wiimote #1573

Merged
merged 1 commit into from Nov 21, 2014

Conversation

kamiyo
Copy link
Contributor

@kamiyo kamiyo commented Nov 19, 2014

Added condition so that function to mix wiimote-speaker data into the master mixer is called only if wiimote is emulated.

… master mixer is called only if wiimote is emulated.
@skidau
Copy link
Contributor

skidau commented Nov 19, 2014

@dolphin-emu-bot rebuild

@waddlesplash
Copy link
Contributor

@skidau build succeded, and this LGTM but I'm not too familiar with this code though.

@comex
Copy link
Contributor

comex commented Nov 20, 2014

I think this is actually this code being wrong:

void InterruptChannel(int _number, u16 _channelID, const void* _pData, u32 _Size)  
{   
    if (WIIMOTE_SRC_HYBRID & g_wiimote_sources[_number])                           
        ((WiimoteEmu::Wiimote*)s_config.controllers[_number])->InterruptChannel(_channelID, _pData, _Size);
}       

WIIMOTE_SRC_HYBRID = WIIMOTE_SRC_EMU | WIIMOTE_SRC_REAL, so it will trigger even if the actual value is "real". If that method were not called, it wouldn't get to the point changed in this patch.

@kamiyo
Copy link
Contributor Author

kamiyo commented Nov 20, 2014

I thought so at first, but the way this was written is that this passes through to the emulated wiimote regardless. The function in the emulated wiimote (WiimoteEmu.cpp line 817) receives the data, and passes it to WiimoteReal (line 845). That's all good. It's the HidOutputReport after that (line 849) that processes things for the emulator. I think that's how all the other Wiimote interrupts are processed.

Now, it may be that the HidOutputReport on line 849 isn't needed, but I doubt it.

Someone who knows more about this let me know if that makes sense.

edit: this is also how the ControlChannel is processed if I'm understanding it correctly.

skidau added a commit that referenced this pull request Nov 21, 2014
Fix wiimotespeaker emulation affecting real wiimote
@skidau skidau merged commit 15e7a8c into dolphin-emu:master Nov 21, 2014
@kamiyo kamiyo deleted the fix-wiimote-speaker branch November 21, 2014 05:06
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
4 participants