diff --git a/ps2-arduino.ino b/ps2-arduino.ino index b9c5fec..8c4b626 100644 --- a/ps2-arduino.ino +++ b/ps2-arduino.ino @@ -169,6 +169,40 @@ void loop() { XInput.release(BUTTON_R3); } + // D-Pad + // D-Left + if (ps2x.ButtonPressed(PSB_PAD_LEFT)) { + XInput.press(DPAD_LEFT); + } + + if (ps2x.ButtonReleased(PSB_PAD_LEFT)) { + XInput.release(DPAD_LEFT); + } + // D-Right + if (ps2x.ButtonPressed(PSB_PAD_RIGHT)) { + XInput.press(DPAD_RIGHT); + } + + if (ps2x.ButtonReleased(PSB_PAD_RIGHT)) { + XInput.release(DPAD_RIGHT); + } + // D-Up + if (ps2x.ButtonPressed(PSB_PAD_UP)) { + XInput.press(DPAD_UP); + } + + if (ps2x.ButtonReleased(PSB_PAD_UP)) { + XInput.release(DPAD_UP); + } + // D-Down + if (ps2x.ButtonPressed(PSB_PAD_DOWN)) { + XInput.press(DPAD_DOWN); + } + + if (ps2x.ButtonReleased(PSB_PAD_DOWN)) { + XInput.release(DPAD_DOWN); + } + // Left stick XInput.setJoystick(JOY_LEFT, ps2x.Analog(PSS_LX), 255 - ps2x.Analog(PSS_LY));