GB Serialize: Fix timer serialization
Vicki Pfau vi@endrift.com
Sat, 08 Jul 2017 16:22:40 -0700
2 files changed,
3 insertions(+),
3 deletions(-)
M
CHANGES
→
CHANGES
@@ -170,6 +170,7 @@ - PSP2: Use custom localtime_r since newlib version is broken (fixes mgba.io/i/560)
- GBA SIO: Improve SIO Normal dummy driver (fixes mgba.io/i/520) - Qt: Fix patch loading while a game is running - Qt: Fix shader selector on Ubuntu (fixes mgba.io/i/767) + - GB Serialize: Fix timer serialization Misc: - Qt: Add language selector - GBA Timer: Improve accuracy of timers
M
src/gb/timer.c
→
src/gb/timer.c
@@ -118,7 +118,7 @@ STORE_32LE(timer->timaPeriod, 0, &state->timer.timaPeriod);
STORE_32LE(timer->event.when - mTimingCurrentTime(&timer->p->timing), 0, &state->timer.nextEvent); STORE_32LE(timer->irq.when - mTimingCurrentTime(&timer->p->timing), 0, &state->timer.nextIRQ); GBSerializedTimerFlags flags = GBSerializedTimerFlagsSetIrqPending(0, mTimingIsScheduled(&timer->p->timing, &timer->irq)); - STORE_32LE(flags, 0, &state->timer.flags); + state->timer.flags = flags; } void GBTimerDeserialize(struct GBTimer* timer, const struct GBSerializedState* state) {@@ -130,8 +130,7 @@ uint32_t when;
LOAD_32LE(when, 0, &state->timer.nextEvent); mTimingSchedule(&timer->p->timing, &timer->event, when); - GBSerializedTimerFlags flags; - LOAD_32LE(flags, 0, &state->timer.flags); + GBSerializedTimerFlags flags = state->timer.flags; if (GBSerializedTimerFlagsIsIrqPending(flags)) { LOAD_32LE(when, 0, &state->timer.nextIRQ);