File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -66,8 +66,9 @@ uint16_t JoystickReadWord(uint32_t offset)
6666 uint8_t offset0 , offset1 ;
6767 uint16_t data = 0xFFFF ;
6868
69- if (!joysticksEnabled )
69+ if (!joysticksEnabled ) {
7070 return 0xFFFF ;
71+ }
7172
7273 // Joystick data returns active low for buttons pressed, high for non-
7374 // pressed.
@@ -119,14 +120,14 @@ uint16_t JoystickReadWord(uint32_t offset)
119120 if (offset0 != 0xFF )
120121 {
121122 data &= (joypad0Buttons [mask [offset0 ][0 ]] ? 0xFFFD : 0xFFFF );
122- if (mask [offset0 ][1 ] != 0xFF )
123+ if (mask [offset0 ][1 ] != 0xF )
123124 data &= (joypad0Buttons [mask [offset0 ][1 ]] ? 0xFFFE : 0xFFFF );
124125 }
125126
126127 if (offset1 != 0xFF )
127128 {
128129 data &= (joypad1Buttons [mask [offset1 ][0 ]] ? 0xFFF7 : 0xFFFF );
129- if (mask [offset1 ][1 ] != 0xFF )
130+ if (mask [offset1 ][1 ] != 0xF )
130131 data &= (joypad1Buttons [mask [offset1 ][1 ]] ? 0xFFFB : 0xFFFF );
131132 }
132133
You can’t perform that action at this time.
0 commit comments