mirror of https://github.com/mgba-emu/mgba.git
GBA: Fix keypad IRQs not firing when extra buttons are pressed
This commit is contained in:
parent
e6f81b0385
commit
6a223ccd3f
1
CHANGES
1
CHANGES
|
@ -25,6 +25,7 @@ Bugfixes:
|
||||||
- GBA BIOS: Use core's VRAM variable instead of renderer's
|
- GBA BIOS: Use core's VRAM variable instead of renderer's
|
||||||
- GBA Savedata: Fix 512 byte EEPROM saving as 8kB (fixes mgba.io/i/877)
|
- GBA Savedata: Fix 512 byte EEPROM saving as 8kB (fixes mgba.io/i/877)
|
||||||
- SDL: Fix potential race condition when pressing keys (fixes mgba.io/i/872)
|
- SDL: Fix potential race condition when pressing keys (fixes mgba.io/i/872)
|
||||||
|
- GBA: Fix keypad IRQs not firing when extra buttons are pressed
|
||||||
Misc:
|
Misc:
|
||||||
- Qt: Don't rebuild library view if style hasn't changed
|
- Qt: Don't rebuild library view if style hasn't changed
|
||||||
- SDL: Fix 2.0.5 build on macOS under some circumstances
|
- SDL: Fix 2.0.5 build on macOS under some circumstances
|
||||||
|
|
|
@ -489,7 +489,6 @@ static void _GBACoreAddKeys(struct mCore* core, uint32_t keys) {
|
||||||
static void _GBACoreClearKeys(struct mCore* core, uint32_t keys) {
|
static void _GBACoreClearKeys(struct mCore* core, uint32_t keys) {
|
||||||
struct GBACore* gbacore = (struct GBACore*) core;
|
struct GBACore* gbacore = (struct GBACore*) core;
|
||||||
gbacore->keys &= ~keys;
|
gbacore->keys &= ~keys;
|
||||||
GBATestKeypadIRQ(core->board);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
static int32_t _GBACoreFrameCounter(const struct mCore* core) {
|
static int32_t _GBACoreFrameCounter(const struct mCore* core) {
|
||||||
|
|
|
@ -695,19 +695,17 @@ void GBATestKeypadIRQ(struct GBA* gba) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
int isAnd = keycnt & 0x8000;
|
int isAnd = keycnt & 0x8000;
|
||||||
uint16_t keyInput;
|
|
||||||
|
|
||||||
if (!gba->keySource) {
|
if (!gba->keySource) {
|
||||||
// TODO?
|
// TODO?
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
keycnt &= 0x3FF;
|
keycnt &= 0x3FF;
|
||||||
keyInput = *gba->keySource;
|
uint16_t keyInput = *gba->keySource & keycnt;
|
||||||
|
|
||||||
if (isAnd && keycnt == keyInput) {
|
if (isAnd && keycnt == keyInput) {
|
||||||
GBARaiseIRQ(gba, IRQ_KEYPAD);
|
GBARaiseIRQ(gba, IRQ_KEYPAD);
|
||||||
} else if (!isAnd && keycnt & keyInput) {
|
} else if (!isAnd && keyInput) {
|
||||||
GBARaiseIRQ(gba, IRQ_KEYPAD);
|
GBARaiseIRQ(gba, IRQ_KEYPAD);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue