GB I/O: Fix inverted button filter
Vicki Pfau vi@endrift.com
Sat, 29 Sep 2018 23:14:43 -0700
1 files changed,
4 insertions(+),
5 deletions(-)
jump to
M
src/gb/io.c
→
src/gb/io.c
@@ -563,12 +563,11 @@ uint8_t keys = _readKeys(gb);
if (!gb->allowOpposingDirections && (keys & 0x30) == 0x20) { unsigned rl = keys & 0x03; unsigned ud = keys & 0x0C; - keys &= 0xF0; - if (rl != 0x03) { - keys |= rl; + if (!rl) { + keys |= 0x03; } - if (ud != 0x0C) { - keys |= ud; + if (!ud) { + keys |= 0x0C; } } return keys;