mirror of https://github.com/mgba-emu/mgba.git
Core: Fix ordering events when scheduling during events
This commit is contained in:
parent
6af486c7f0
commit
d9d89fad2b
1
CHANGES
1
CHANGES
|
@ -46,6 +46,7 @@ Bugfixes:
|
||||||
- GB, GBA Savedata: Fix savestate loading overwriting saves on reset
|
- GB, GBA Savedata: Fix savestate loading overwriting saves on reset
|
||||||
- GBA Video: Make layer disabling work consistently
|
- GBA Video: Make layer disabling work consistently
|
||||||
- GB: Fix IRQ disabling on the same T-cycle as an assert
|
- GB: Fix IRQ disabling on the same T-cycle as an assert
|
||||||
|
- Core: Fix ordering events when scheduling during events
|
||||||
Misc:
|
Misc:
|
||||||
- GBA Timer: Use global cycles for timers
|
- GBA Timer: Use global cycles for timers
|
||||||
- GBA: Extend oddly-sized ROMs to full address space (fixes mgba.io/i/722)
|
- GBA: Extend oddly-sized ROMs to full address space (fixes mgba.io/i/722)
|
||||||
|
|
|
@ -33,7 +33,7 @@ void mTimingSchedule(struct mTiming* timing, struct mTimingEvent* event, int32_t
|
||||||
unsigned priority = event->priority;
|
unsigned priority = event->priority;
|
||||||
while (next) {
|
while (next) {
|
||||||
int32_t nextWhen = next->when - timing->masterCycles;
|
int32_t nextWhen = next->when - timing->masterCycles;
|
||||||
if (nextWhen > when || (nextWhen == when && next->priority > priority)) {
|
if (nextWhen > nextEvent || (nextWhen == nextEvent && next->priority > priority)) {
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
previous = &next->next;
|
previous = &next->next;
|
||||||
|
|
Loading…
Reference in New Issue