Core: Fix ordering events when scheduling during events
Vicki Pfau vi@endrift.com
Mon, 27 Aug 2018 18:08:14 -0700
2 files changed,
2 insertions(+),
1 deletions(-)
M
CHANGES
→
CHANGES
@@ -46,6 +46,7 @@ - GBA Video: Improve sprite cycle counting (fixes mgba.io/i/1126)
- 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)
M
src/core/timing.c
→
src/core/timing.c
@@ -33,7 +33,7 @@ struct mTimingEvent* next = timing->root;
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;