GBA IO: Fix regression breaking keyCallbacks

This commit is contained in:
Vicki Pfau 2020-02-25 18:11:41 -08:00
parent 03d85b44d2
commit 32a515ee7f
1 changed files with 18 additions and 20 deletions

View File

@ -723,8 +723,7 @@ uint16_t GBAIORead(struct GBA* gba, uint32_t address) {
GBATimerUpdateRegister(gba, 3, 2);
break;
case REG_KEYINPUT:
{
case REG_KEYINPUT: {
size_t c;
for (c = 0; c < mCoreCallbacksListSize(&gba->coreCallbacks); ++c) {
struct mCoreCallbacks* callbacks = mCoreCallbacksListGetPointer(&gba->coreCallbacks, c);
@ -732,7 +731,6 @@ uint16_t GBAIORead(struct GBA* gba, uint32_t address) {
callbacks->keysRead(callbacks->context);
}
}
}
uint16_t input = 0;
if (gba->keyCallback) {
input = gba->keyCallback->readKeys(gba->keyCallback);
@ -752,9 +750,9 @@ uint16_t GBAIORead(struct GBA* gba, uint32_t address) {
input |= ud;
}
}
}
return 0x3FF ^ input;
}
case REG_SIOCNT:
return gba->sio.siocnt;
case REG_RCNT: