GB, GBA: Properly handle late cycles this time

This commit is contained in:
Jeffrey Pfau 2016-10-07 12:25:46 -07:00
parent 4680a767c6
commit 74bb02065d
2 changed files with 4 additions and 4 deletions

View File

@ -528,11 +528,11 @@ void GBUpdateIRQs(struct GB* gb) {
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) {

View File

@ -235,11 +235,11 @@ static void GBAProcessEvents(struct ARMCore* cpu) {
}
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