all repos — mgba @ 5ce943c5801e1621be8754183d4b34dd12899fc7

mGBA Game Boy Advance Emulator

GB Serialize: Fix timer serialization
Vicki Pfau vi@endrift.com
Sat, 08 Jul 2017 16:22:40 -0700
commit

5ce943c5801e1621be8754183d4b34dd12899fc7

parent

dde155d0dd6e991291afed758e6eb1e54584443b

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

jump to
M CHANGESCHANGES

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