mirror of
https://github.com/TwilitRealm/dusklight
synced 2026-06-24 15:43:13 -04:00
JUtility matching for debug (#3074)
* Jut cleanup work * data section fix * match the last of JUtility * added more helpful comment * Add missed null terminator * do while -> while loop * replace more do whiles * Fix wii regression * Add suggestions * fix null check --------- Co-authored-by: roeming <roeming@users.noreply.github.com>
This commit is contained in:
@@ -391,26 +391,26 @@ u32 JUTGamePad::CStick::update(s8 x, s8 y, JUTGamePad::EStickMode mode,
|
||||
}
|
||||
|
||||
u32 JUTGamePad::CStick::getButton(u32 buttons) {
|
||||
u32 button = buttons & 0xF;
|
||||
u32 button = buttons & (PAD_BUTTON_UP | PAD_BUTTON_DOWN | PAD_BUTTON_LEFT | PAD_BUTTON_RIGHT);
|
||||
|
||||
if (-sReleasePoint < mPosX && mPosX < sReleasePoint) {
|
||||
button = button & ~0x3;
|
||||
button &= ~(PAD_BUTTON_LEFT | PAD_BUTTON_RIGHT);
|
||||
} else if (mPosX <= -sPressPoint) {
|
||||
button = (button & ~0x2);
|
||||
button |= 1;
|
||||
button &= ~PAD_BUTTON_RIGHT;
|
||||
button |= PAD_BUTTON_LEFT;
|
||||
} else if (mPosX >= sPressPoint) {
|
||||
button = (button & ~0x1);
|
||||
button |= 2;
|
||||
button &= ~PAD_BUTTON_LEFT;
|
||||
button |= PAD_BUTTON_RIGHT;
|
||||
}
|
||||
|
||||
if (-sReleasePoint < mPosY && mPosY < sReleasePoint) {
|
||||
button = button & ~0xC;
|
||||
button &= ~(PAD_BUTTON_UP | PAD_BUTTON_DOWN);
|
||||
} else if (mPosY <= -sPressPoint) {
|
||||
button = (button & ~0x8);
|
||||
button |= 4;
|
||||
button &= ~PAD_BUTTON_UP;
|
||||
button |= PAD_BUTTON_DOWN;
|
||||
} else if (mPosY >= sPressPoint) {
|
||||
button = (button & ~0x4);
|
||||
button |= 8;
|
||||
button &= ~PAD_BUTTON_DOWN;
|
||||
button |= PAD_BUTTON_UP;
|
||||
}
|
||||
|
||||
return button;
|
||||
@@ -481,7 +481,7 @@ void JUTGamePad::CRumble::update(s16 port) {
|
||||
return;
|
||||
} else {
|
||||
bool enabled = getNumBit(mPattern, mFrame % mFrameCount);
|
||||
u8 status = mStatus[port] != false;
|
||||
u32 status = mStatus[port] != false;
|
||||
|
||||
if (enabled && !status) {
|
||||
startMotor(port);
|
||||
|
||||
Reference in New Issue
Block a user