Skip to content

Commit

Permalink
jap pad fix
Browse files Browse the repository at this point in the history
  • Loading branch information
bucanero committed Nov 25, 2023
1 parent d817786 commit 27ee102
Showing 1 changed file with 14 additions and 6 deletions.
20 changes: 14 additions & 6 deletions source/ps3pad.c
Original file line number Diff line number Diff line change
Expand Up @@ -56,12 +56,6 @@ int readPad(int port)
if (padA[port].ANA_L_H > ANALOG_MAX)
padA[port].BTN_RIGHT = 1;

if (!crossButtonOK)
{
padA[port].BTN_CROSS ^= 1;
padA[port].BTN_CIRCLE ^= 1;
}

//new
dpad = ((char)*(&padA[port].zeroes + off) << 8) >> 12;
rest = ((((char)*(&padA[port].zeroes + off) & 0xF) << 8) | ((char)*(&padA[port].zeroes + off + 1) << 0));
Expand Down Expand Up @@ -149,6 +143,20 @@ int readPad(int port)
if (!retDPAD && !retREST)
return 0;

if (!crossButtonOK)
{
if (paddata[port].BTN_CROSS)
{
paddata[port].BTN_CROSS = 0;
paddata[port].BTN_CIRCLE = 1;
}
else if (paddata[port].BTN_CIRCLE)
{
paddata[port].BTN_CIRCLE = 0;
paddata[port].BTN_CROSS = 1;
}
}

if (!retDPAD)
{
paddata[port].BTN_LEFT = 0;
Expand Down

0 comments on commit 27ee102

Please sign in to comment.