Core: Fix ordering events when scheduling during events

This commit is contained in:
Vicki Pfau 2018-08-27 18:08:14 -07:00
parent 6af486c7f0
commit d9d89fad2b
2 changed files with 2 additions and 1 deletions

View File

@ -46,6 +46,7 @@ Bugfixes:
- GB, GBA Savedata: Fix savestate loading overwriting saves on reset
- GBA Video: Make layer disabling work consistently
- GB: Fix IRQ disabling on the same T-cycle as an assert
- Core: Fix ordering events when scheduling during events
Misc:
- GBA Timer: Use global cycles for timers
- GBA: Extend oddly-sized ROMs to full address space (fixes mgba.io/i/722)

View File

@ -33,7 +33,7 @@ void mTimingSchedule(struct mTiming* timing, struct mTimingEvent* event, int32_t
unsigned priority = event->priority;
while (next) {
int32_t nextWhen = next->when - timing->masterCycles;
if (nextWhen > when || (nextWhen == when && next->priority > priority)) {
if (nextWhen > nextEvent || (nextWhen == nextEvent && next->priority > priority)) {
break;
}
previous = &next->next;