GB, GBA: Properly handle late cycles this time
Jeffrey Pfau jeffrey@endrift.com
Fri, 07 Oct 2016 12:25:46 -0700
2 files changed,
4 insertions(+),
4 deletions(-)
M
src/gb/gb.c
→
src/gb/gb.c
@@ -528,11 +528,11 @@
void GBProcessEvents(struct LR35902Core* cpu) { struct GB* gb = (struct GB*) cpu->master; do { - int32_t cycles = cpu->nextEvent; + int32_t cycles = cpu->cycles; int32_t nextEvent; int32_t testEvent; - cpu->cycles -= cycles; + cpu->cycles = 0; cpu->nextEvent = INT_MAX; if (gb->eiPending != INT_MAX) {
M
src/gba/gba.c
→
src/gba/gba.c
@@ -235,11 +235,11 @@ gba->springIRQ = 0;
} do { - int32_t cycles = cpu->nextEvent; + int32_t cycles = cpu->cycles; int32_t nextEvent; int32_t testEvent; - cpu->cycles -= cycles; + cpu->cycles = 0; cpu->nextEvent = INT_MAX; #ifndef NDEBUG