Skip to content

Commit

Permalink
joystock.c Fix uint8 logical compare 0xFF to 0xF
Browse files Browse the repository at this point in the history
Signed-off-by: Joseph Mattello <[email protected]>
  • Loading branch information
JoeMatt committed Oct 13, 2021
1 parent c88b4a7 commit 5119873
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/joystick.c
Original file line number Diff line number Diff line change
Expand Up @@ -120,14 +120,14 @@ uint16_t JoystickReadWord(uint32_t offset)
if (offset0 != 0xFF)
{
data &= (joypad0Buttons[mask[offset0][0]] ? 0xFFFD : 0xFFFF);
if (mask[offset0][1] != 0xFF)
if (mask[offset0][1] != 0xF)
data &= (joypad0Buttons[mask[offset0][1]] ? 0xFFFE : 0xFFFF);
}

if (offset1 != 0xFF)
{
data &= (joypad1Buttons[mask[offset1][0]] ? 0xFFF7 : 0xFFFF);
if (mask[offset1][1] != 0xFF)
if (mask[offset1][1] != 0xF)
data &= (joypad1Buttons[mask[offset1][1]] ? 0xFFFB : 0xFFFF);
}

Expand Down

0 comments on commit 5119873

Please sign in to comment.