GBA: Fix GB Player features
Vicki Pfau vi@endrift.com
Tue, 08 Jan 2019 23:19:33 -0800
3 files changed,
14 insertions(+),
13 deletions(-)
M
CHANGES
→
CHANGES
@@ -144,6 +144,7 @@ - GB Video: Changing LYC while LCDC off doesn't affect STAT (fixes mgba.io/i/1224)
- 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
M
src/gba/hardware.c
→
src/gba/hardware.c
@@ -539,9 +539,9 @@
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) {
M
src/gba/io.c
→
src/gba/io.c
@@ -728,7 +728,7 @@ case REG_KEYINPUT:
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) {@@ -736,16 +736,16 @@ *gba->keySource = input;
} } 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)) {