diff --git a/CHANGES b/CHANGES index d9f285676..81c3ae56c 100644 --- a/CHANGES +++ b/CHANGES @@ -134,6 +134,7 @@ Bugfixes: - GBA I/O: SOUNDCNT_HI is readable when sound is off - SDL: Fix handling of invalid gamepads (fixes mgba.io/i/1239) - Libretro: Fix adding codes with hooks + - GBA: Fix GB Player features Misc: - mGUI: Add SGB border configuration option - mGUI: Add support for different settings types diff --git a/src/gba/hardware.c b/src/gba/hardware.c index 70704a5d2..e981a9649 100644 --- a/src/gba/hardware.c +++ b/src/gba/hardware.c @@ -539,9 +539,9 @@ void GBAHardwarePlayerUpdate(struct GBA* gba) { uint16_t _gbpRead(struct mKeyCallback* callback) { struct GBAGBPKeyCallback* gbpCallback = (struct GBAGBPKeyCallback*) callback; if (gbpCallback->p->gbpInputsPosted == 2) { - return 0x30F; + return 0xF0; } - return 0x3FF; + return 0; } uint16_t _gbpSioWriteRegister(struct GBASIODriver* driver, uint32_t address, uint16_t value) { diff --git a/src/gba/io.c b/src/gba/io.c index 84a2c9478..602f4d0c0 100644 --- a/src/gba/io.c +++ b/src/gba/io.c @@ -725,7 +725,7 @@ uint16_t GBAIORead(struct GBA* gba, uint32_t address) { if (gba->rr && gba->rr->isPlaying(gba->rr)) { return 0x3FF ^ gba->rr->queryInput(gba->rr); } else { - uint16_t input = 0x3FF; + uint16_t input = 0; if (gba->keyCallback) { input = gba->keyCallback->readKeys(gba->keyCallback); if (gba->keySource) { @@ -733,16 +733,16 @@ uint16_t GBAIORead(struct GBA* gba, uint32_t address) { } } else if (gba->keySource) { input = *gba->keySource; - } - if (!gba->allowOpposingDirections) { - unsigned rl = input & 0x030; - unsigned ud = input & 0x0C0; - input &= 0x30F; - if (rl != 0x030) { - input |= rl; - } - if (ud != 0x0C0) { - input |= ud; + if (!gba->allowOpposingDirections) { + unsigned rl = input & 0x030; + unsigned ud = input & 0x0C0; + input &= 0x30F; + if (rl != 0x030) { + input |= rl; + } + if (ud != 0x0C0) { + input |= ud; + } } } if (gba->rr && gba->rr->isRecording(gba->rr)) {