mirror of
https://github.com/dolphin-emu/dolphin.git
synced 2025-05-06 19:01:36 +03:00
Stage1: Introducing MotionPlus as emulated extension, allowing us to boot games that require the MotionPlus itself.
I also already implemented most of the needed data structures and datareport handling for the motionplus-nunchuk passthrough mode, which I'll add up next as well. Wii Sports Resort is now bootable by just using an emulated wiimote (only working under the old wiimote plugin atm, I asked billiard to port my commit into his plugin since he knows his plugin better than me and its less work for him than for me, I kept most parts of my code in modules to simplify that task). Upcoming stage2: Faking the motionplus on the fly on real wiimotes, that means you will be able to play, e.g. Redsteel2 with a real wiimote and nunchuk or wii sports resort with just your real wiimote. and nunchuk, but w/o the need of having a real motionpluscontroller connected. The new Zelda 2010 will benefit by that, since it will require a motionplus controller. git-svn-id: https://dolphin-emu.googlecode.com/svn/trunk@5438 8ced0084-cf51-0410-be5f-012b33b47a6e
This commit is contained in:
parent
f6ce87765f
commit
7742e1a6dd
11 changed files with 530 additions and 77 deletions
|
@ -416,6 +416,8 @@ void ResetVariables()
|
|||
for (int i = 0; i < MAX_WIIMOTES; i++)
|
||||
{
|
||||
g_ReportingAuto[i] = false;
|
||||
g_MotionPlusReadError[i] = 0;
|
||||
g_InterleavedData[i] = false;
|
||||
g_ReportingMode[i] = 0;
|
||||
g_ReportingChannel[i] = 0;
|
||||
WiiMapping[i].Motion.TiltWM.Shake = 0;
|
||||
|
@ -492,25 +494,56 @@ void InitCalibration()
|
|||
// Update the extension calibration values with our default values
|
||||
void UpdateExtRegisterBlocks(int Slot)
|
||||
{
|
||||
// Copy extension id and calibration to its register
|
||||
if(WiiMapping[Slot].iExtensionConnected == EXT_NUNCHUCK)
|
||||
if (WiiMapping[Slot].bMotionPlusConnected)
|
||||
{
|
||||
memcpy(g_RegExt[Slot] + 0x20, nunchuck_calibration, sizeof(nunchuck_calibration));
|
||||
memcpy(g_RegExt[Slot] + 0x30, nunchuck_calibration, sizeof(nunchuck_calibration));
|
||||
memcpy(g_RegExt[Slot] + 0xfa, nunchuck_id, sizeof(nunchuck_id));
|
||||
}
|
||||
else if(WiiMapping[Slot].iExtensionConnected == EXT_CLASSIC_CONTROLLER)
|
||||
{
|
||||
memcpy(g_RegExt[Slot] + 0x20, classic_calibration, sizeof(classic_calibration));
|
||||
memcpy(g_RegExt[Slot] + 0x30, classic_calibration, sizeof(classic_calibration));
|
||||
memcpy(g_RegExt[Slot] + 0xfa, classic_id, sizeof(classic_id));
|
||||
}
|
||||
else if(WiiMapping[Slot].iExtensionConnected == EXT_GUITARHERO)
|
||||
{
|
||||
// TODO get the correct values here
|
||||
memcpy(g_RegExt[Slot] + 0x20, classic_calibration, sizeof(classic_calibration));
|
||||
memcpy(g_RegExt[Slot] + 0x30, classic_calibration, sizeof(classic_calibration));
|
||||
memcpy(g_RegExt[Slot] + 0xfa, gh3glp_id, sizeof(gh3glp_id));
|
||||
// Copy extension id and calibration to its register
|
||||
if (WiiMapping[Slot].iExtensionConnected == EXT_NONE)
|
||||
{
|
||||
memset(g_RegExt[Slot],0,sizeof(g_RegExt[0]));
|
||||
memcpy(g_RegMotionPlus[Slot], motionplus_register, sizeof(motionplus_register));
|
||||
memcpy(g_RegMotionPlus[Slot] + 0x20, motion_plus_calibration, sizeof(motion_plus_calibration)); //reg 32bytes 0x20-3f;
|
||||
g_MotionPlus[Slot] = 0;
|
||||
//memcpy(g_RegMotionPlus[Slot] + 0xfa, motionplus_id, sizeof(motionplus_id));
|
||||
}
|
||||
else if(WiiMapping[Slot].iExtensionConnected == EXT_NUNCHUK)
|
||||
{
|
||||
memset(g_RegMotionPlus[Slot],0,sizeof(g_RegExt[0]));
|
||||
memcpy(g_RegMotionPlus[Slot], motionplus_register, sizeof(motionplus_register));
|
||||
memcpy(g_RegMotionPlus[Slot] + 0x20, motion_plus_calibration, sizeof(motion_plus_calibration)); //reg 32bytes 0x20-3f;
|
||||
memcpy(g_RegExt[Slot] + 0x20, nunchuck_calibration, sizeof(nunchuck_calibration));
|
||||
memcpy(g_RegExt[Slot] + 0x30, nunchuck_calibration, sizeof(nunchuck_calibration));
|
||||
memcpy(g_RegExt[Slot] + 0xfa, nunchuck_id, sizeof(nunchuck_id));
|
||||
g_MotionPlus[Slot] = 1;
|
||||
}
|
||||
g_MotionPlusReadError[Slot] = 0;
|
||||
|
||||
} else {
|
||||
|
||||
|
||||
// Copy extension id and calibration to its register
|
||||
if(WiiMapping[Slot].iExtensionConnected == EXT_NUNCHUK)
|
||||
{
|
||||
memcpy(g_RegExt[Slot] + 0x20, nunchuck_calibration, sizeof(nunchuck_calibration));
|
||||
memcpy(g_RegExt[Slot] + 0x30, nunchuck_calibration, sizeof(nunchuck_calibration));
|
||||
memcpy(g_RegExt[Slot] + 0xfa, nunchuck_id, sizeof(nunchuck_id));
|
||||
}
|
||||
else if(WiiMapping[Slot].iExtensionConnected == EXT_CLASSIC_CONTROLLER)
|
||||
{
|
||||
memcpy(g_RegExt[Slot] + 0x20, classic_calibration, sizeof(classic_calibration));
|
||||
memcpy(g_RegExt[Slot] + 0x30, classic_calibration, sizeof(classic_calibration));
|
||||
memcpy(g_RegExt[Slot] + 0xfa, classic_id, sizeof(classic_id));
|
||||
}
|
||||
else if(WiiMapping[Slot].iExtensionConnected == EXT_GUITARHERO)
|
||||
{
|
||||
// TODO get the correct values here
|
||||
memcpy(g_RegExt[Slot] + 0x20, classic_calibration, sizeof(classic_calibration));
|
||||
memcpy(g_RegExt[Slot] + 0x30, classic_calibration, sizeof(classic_calibration));
|
||||
memcpy(g_RegExt[Slot] + 0xfa, gh3glp_id, sizeof(gh3glp_id));
|
||||
}
|
||||
else if(WiiMapping[Slot].iExtensionConnected == EXT_WBB)
|
||||
{
|
||||
// TODO
|
||||
}
|
||||
}
|
||||
|
||||
INFO_LOG(WIIMOTE, "UpdateExtRegisterBlocks()");
|
||||
|
@ -546,6 +579,7 @@ void DoState(PointerWrap &p)
|
|||
p.Do(g_IR[i]);
|
||||
p.Do(g_Leds[i]);
|
||||
p.Do(g_Speaker[i]);
|
||||
p.Do(g_MotionPlus[i]);
|
||||
//p.Do(g_SpeakerMute[i]);
|
||||
p.Do(g_ExtKey[i]);
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue