| 591 | } |
| 592 | |
| 593 | u32 JUTGamePad::CStick::getButton(u32 mask) |
| 594 | { |
| 595 | u32 button = mask & 0xf; |
| 596 | if (-sReleasePoint < mX && mX < sReleasePoint) |
| 597 | { |
| 598 | button &= ~(DPAD_LEFT | DPAD_RIGHT); |
| 599 | } |
| 600 | else if (mX <= -sPressPoint) |
| 601 | { |
| 602 | button &= ~DPAD_RIGHT; |
| 603 | button |= DPAD_LEFT; |
| 604 | } |
| 605 | else if (mX >= sPressPoint) |
| 606 | { |
| 607 | button &= ~DPAD_LEFT; |
| 608 | button |= DPAD_RIGHT; |
| 609 | } |
| 610 | |
| 611 | if (-sReleasePoint < mY && mY < sReleasePoint) |
| 612 | { |
| 613 | button &= ~(DPAD_DOWN | DPAD_UP); |
| 614 | } |
| 615 | else if (mY <= -sPressPoint) |
| 616 | { |
| 617 | button &= ~DPAD_UP; |
| 618 | button |= DPAD_DOWN; |
| 619 | } |
| 620 | else if (mY >= sPressPoint) |
| 621 | { |
| 622 | button &= ~DPAD_DOWN; |
| 623 | button |= DPAD_UP; |
| 624 | } |
| 625 | |
| 626 | return button; |
| 627 | } |
| 628 | |
| 629 | void JUTGamePad::CRumble::clear() |
| 630 | { |