mirror of https://github.com/mgba-emu/mgba.git
GB, GBA: Properly handle late cycles this time
This commit is contained in:
parent
4680a767c6
commit
74bb02065d
|
@ -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) {
|
||||
|
|
|
@ -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
|
||||
|
|
Loading…
Reference in New Issue