all repos — mgba @ d9d89fad2b10df544fd882d3c9999c8905f9d533

mGBA Game Boy Advance Emulator

Core: Fix ordering events when scheduling during events
Vicki Pfau vi@endrift.com
Mon, 27 Aug 2018 18:08:14 -0700
commit

d9d89fad2b10df544fd882d3c9999c8905f9d533

parent

6af486c7f083ae98e1c5c217b939c075b2b41505

2 files changed, 2 insertions(+), 1 deletions(-)

jump to
M CHANGESCHANGES

@@ -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.csrc/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;