mirror of https://github.com/mgba-emu/mgba.git
GB I/O: Fix inverted button filter
This commit is contained in:
parent
2865c9ab2b
commit
426993bbbb
|
@ -563,12 +563,11 @@ static uint8_t _readKeysFiltered(struct GB* gb) {
|
||||||
if (!gb->allowOpposingDirections && (keys & 0x30) == 0x20) {
|
if (!gb->allowOpposingDirections && (keys & 0x30) == 0x20) {
|
||||||
unsigned rl = keys & 0x03;
|
unsigned rl = keys & 0x03;
|
||||||
unsigned ud = keys & 0x0C;
|
unsigned ud = keys & 0x0C;
|
||||||
keys &= 0xF0;
|
if (!rl) {
|
||||||
if (rl != 0x03) {
|
keys |= 0x03;
|
||||||
keys |= rl;
|
|
||||||
}
|
}
|
||||||
if (ud != 0x0C) {
|
if (!ud) {
|
||||||
keys |= ud;
|
keys |= 0x0C;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
return keys;
|
return keys;
|
||||||
|
|
Loading…
Reference in New Issue