mirror of https://github.com/mgba-emu/mgba.git
GB: Implement keypad IRQs
This commit is contained in:
parent
1dcf70d6d3
commit
126afa12d9
2
CHANGES
2
CHANGES
|
@ -21,7 +21,7 @@ Features:
|
|||
- Debugger: Segment/bank support
|
||||
- GB: Symbol table support
|
||||
- GB MBC: Add MBC1 multicart support
|
||||
- GBA: Implement keypad interrupts
|
||||
- Implement keypad interrupts
|
||||
- LR35902: Watchpoints
|
||||
- Memory search
|
||||
- Debugger: Execution tracing
|
||||
|
|
|
@ -139,6 +139,8 @@ bool GBIsROM(struct VFile* vf);
|
|||
void GBGetGameTitle(const struct GB* gba, char* out);
|
||||
void GBGetGameCode(const struct GB* gba, char* out);
|
||||
|
||||
void GBTestKeypadIRQ(struct GB* gb);
|
||||
|
||||
void GBFrameEnded(struct GB* gb);
|
||||
|
||||
CXX_GUARD_END
|
||||
|
|
|
@ -432,11 +432,13 @@ static bool _GBCoreSaveState(struct mCore* core, void* state) {
|
|||
static void _GBCoreSetKeys(struct mCore* core, uint32_t keys) {
|
||||
struct GBCore* gbcore = (struct GBCore*) core;
|
||||
gbcore->keys = keys;
|
||||
GBTestKeypadIRQ(core->board);
|
||||
}
|
||||
|
||||
static void _GBCoreAddKeys(struct mCore* core, uint32_t keys) {
|
||||
struct GBCore* gbcore = (struct GBCore*) core;
|
||||
gbcore->keys |= keys;
|
||||
GBTestKeypadIRQ(core->board);
|
||||
}
|
||||
|
||||
static void _GBCoreClearKeys(struct mCore* core, uint32_t keys) {
|
||||
|
|
|
@ -710,4 +710,6 @@ void GBFrameEnded(struct GB* gb) {
|
|||
mCheatRefresh(device, cheats);
|
||||
}
|
||||
}
|
||||
|
||||
GBTestKeypadIRQ(gb);
|
||||
}
|
||||
|
|
|
@ -564,6 +564,13 @@ uint8_t GBIORead(struct GB* gb, unsigned address) {
|
|||
return gb->memory.io[address] | _registerMask[address];
|
||||
}
|
||||
|
||||
void GBTestKeypadIRQ(struct GB* gb) {
|
||||
if (_readKeys(gb)) {
|
||||
gb->memory.io[REG_IF] |= (1 << GB_IRQ_KEYPAD);
|
||||
GBUpdateIRQs(gb);
|
||||
}
|
||||
}
|
||||
|
||||
struct GBSerializedState;
|
||||
void GBIOSerialize(const struct GB* gb, struct GBSerializedState* state) {
|
||||
memcpy(state->io, gb->memory.io, GB_SIZE_IO);
|
||||
|
|
Loading…
Reference in New Issue