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

WIP - WiimoteEmu: MotionPlus is now mostly working. #7861

Open
wants to merge 3 commits into
base: master
from

Conversation

5 participants
@jordan-woyak
Copy link
Member

jordan-woyak commented Mar 6, 2019

The emulated MotionPlus attachment is now enabled by default. ("Attach MotionPlus" setting in the emulated wiimote configuration)

Angular velocity (gyro) data is generated from the existing IR/Tilt/Swing mappings.

Wii Sports Resort games are very playable with keyboard+mouse / gamepad.

Skyward Sword is playable but select sections requiring unique movements will likely be difficult.

Red Steel 2's tutorial was easy to complete with a keyboard and mouse but some changes will need to be done to allow easier ways to slowly move a wiimote about before performing fast swings.

Current problems:
The M+ initialization sequence involves a crypto "challenge" which will fail 50% of the time. (solution is being worked on)

Skyward Sword's "cursor" movement is very different from any other game. It uses acceleration/gyro data in addition to IR data. It requires much more wiimote movement to reach screen edges than that of a typical game. This can be resolved with increased IR Width/Height settings but some tweaking of the underlying parameters will need to be done to support all games.

Additional input mappings will need to be added to support the special movements required by all games. But this can be done at a later time.

@jordan-woyak jordan-woyak force-pushed the jordan-woyak:mplus-emu branch 2 times, most recently from ec6efc9 to dfdeb51 Mar 6, 2019

Show resolved Hide resolved Source/Core/Core/HW/WiimoteEmu/Dynamics.cpp Outdated
constexpr float YAW_ANGLE = 0.1472f;
constexpr float PITCH_ANGLE = 0.121f;
// constexpr float YAW_ANGLE = 0.1472f;
// constexpr float PITCH_ANGLE = 0.121f;

This comment has been minimized.

@BhaaLseN

BhaaLseN Mar 7, 2019

Member

Same for those?

This comment has been minimized.

@jordan-woyak

jordan-woyak Mar 16, 2019

Author Member

These values still need to be tweaked before merge.

Show resolved Hide resolved Source/Core/Core/HW/WiimoteEmu/MotionPlus.cpp Outdated
Show resolved Hide resolved Source/Core/Core/HW/WiimoteEmu/MotionPlus.cpp Outdated
Show resolved Hide resolved Source/Core/Core/HW/WiimoteEmu/MotionPlus.cpp Outdated
mplus_data.pitch_slow = 1;
// INFO_LOG(WIIMOTE, "M+ YAW: 0x%x slow:%d", yaw_value, mplus_data.yaw_slow);
// INFO_LOG(WIIMOTE, "M+ ROL: 0x%x slow:%d", roll_value, mplus_data.roll_slow);
// INFO_LOG(WIIMOTE, "M+ PIT: 0x%x slow:%d", pitch_value, mplus_data.pitch_slow);

This comment has been minimized.

@BhaaLseN

BhaaLseN Mar 7, 2019

Member

I feel those would be spammy if we left them in; I think we should remove those completely before merging.

This comment has been minimized.

@jordan-woyak

jordan-woyak Mar 16, 2019

Author Member

👍 Will remove before merge.

This comment has been minimized.

@CrystalGamma

CrystalGamma Mar 17, 2019

I'd love it if we had log configuration like Log4J where you can set different verbosity levels for different components. That would allow us to have easily accessible debugging logs for something we need to diagnose without spamming the (visible) log with unrelated data …

Show resolved Hide resolved Source/Core/Core/HW/WiimoteEmu/WiimoteEmu.cpp Outdated
Show resolved Hide resolved Source/Core/Core/HW/WiimoteEmu/WiimoteEmu.cpp Outdated
Show resolved Hide resolved Source/Core/Core/State.cpp Outdated
@pair1984011

This comment was marked as off-topic.

Copy link

pair1984011 commented Mar 16, 2019

Could you make a apk file for me? thank you.

@jordan-woyak jordan-woyak force-pushed the jordan-woyak:mplus-emu branch from dfdeb51 to ef7e7f5 Mar 17, 2019

@jordan-woyak jordan-woyak force-pushed the jordan-woyak:mplus-emu branch from ef7e7f5 to 4e08c8f Mar 17, 2019

Jit64: make timebase always odd
The crypto challenge for the MotionPlus is the lowest bit in the
timebase SPR. By forcing it to 1 we can reuse an X/Y parameter pair
captured from real hardware without knowing the factorization of certn.
@@ -323,6 +323,7 @@ void Jit64::mfspr(UGeckoInstruction inst)
MOV(64, rax, MDisp(rcx, offsetof(CoreTiming::Globals, fake_TB_start_value)));
SHR(64, rdx, Imm8(3));
ADD(64, rax, rdx);
OR(64, rax, Imm8(1));

This comment has been minimized.

@jordan-woyak

jordan-woyak Mar 18, 2019

Author Member

Thanks, this is just a temporary hack-fix, of course.
At this point we aren't really simulating the MotionPlus and we're making big assumptions about the SDKs RNG. :P

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.
You signed in with another tab or window. Reload to refresh your session. You signed out in another tab or window. Reload to refresh your session.