-
-
Notifications
You must be signed in to change notification settings - Fork 52
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
Add emulated stick values for Nunchuk and Classic Controller #114
Conversation
I just did another commit, I have also added acceleration sensor data to Again, to help me, I have done a table:
For the acceleration variable names, I'm using names similar to the ones from this structure: struct VPADAccStatus
{
VPADVec3D acc;
float magnitude;
float variation;
VPADVec2D vertical;
}; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks good to me! I threw together a quick demo using the accelerometer data and it looks perfect. I did check what C and Z are, so you should probably add them to the enum.
I did a commit to add the missing mask for C and Z. I did some test and you are right about mask values 😃 |
I did a bit more testing, and it appears all the buttons can be read from the nunchuck.hold property; with the Wii Remote's buttons getting OR'd in. (yes, this does result in the wiimote dpad setting the nunchuck direction too. it seems the only way to tell them apart is to check both the wii remote and nunchuck masks and compare). |
I think its best to keep the enums separate, I like this change as it is now unless you really object. Even if it does look like the wii remote buttons are being or'd into the nunchuk buttons, i think it is best that people use only the nunchuk specific enums with the nunchuk button field, and use the other enums with their respective fields. |
I guess my key issue is that there aren't really any buttons specific to the nunchuk field (the nunchuk-specific buttons like C and Z are available through both) other than the emulated directions; and since those share a bitmask with the Wii Remote's d-pad it leads to a situation where |
I have also changed the posValid type from uint8_t to int8_t because the value can be negative. A negative value means that the result validity is not really good.
The same mask applies to WPADButton and WPADNunchukButton.
Most of the comments are pretty obvious but at least it's a start.
3c8e81a
to
38336c2
Compare
I have also added comments for VPADGetTPCalibrationParam and VPADSetTPCalibrationParam.
Hello, I have added a lot of new comments. I didn't change the enum for the Wii Remote buttons ( I don't care if someone propose changes, I will accept them. There is currently more than 300 new lines of code, mostly comments, in this PR. I just want the emulated stick values for the Nunchuk and the Classic Controller to work in wut. Please help me achieve that 😃 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Doxygen! Absolutely someone after my own heart. I guess we'll leave WPADNunchuckButton as-is for now.
Hello, I have added emulated stick values for the Nunchuk and the Classic Controller.
For the Classic Controller is was simply adding new values at the end of the
WPADClassicButton
enum
.For the Nunchuk extension I added new properties to the
struct
.To help me understand the
union
used for extensions, I have created this table:KPADVec2D
)uint32_t
)uint32_t
)uint32_t
)uint32_t
)KPADVec3D
)uint32_t
)uint32_t
)KPADVec2D
)KPADVec2D
)float
)KPADVec2D
)KPADVec2D
)float
)uint32_t
)float
)int32_t
)uint32_t
)float
)int32_t
)uint32_t
)By the way, there is an error in the word Nunchuk, there is no C before the K:
struct { KPADVec2D stick; } nunchuck;
I did not changed it, because it would break compatibility with all homebrews using this.