GB Serialize: Fix timer serialization

This commit is contained in:
Vicki Pfau 2017-07-08 16:22:40 -07:00
parent dde155d0dd
commit 5ce943c580
2 changed files with 3 additions and 3 deletions

View File

@ -170,6 +170,7 @@ Bugfixes:
- 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

View File

@ -118,7 +118,7 @@ void GBTimerSerialize(const struct GBTimer* timer, struct GBSerializedState* sta
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 @@ void GBTimerDeserialize(struct GBTimer* timer, const struct GBSerializedState* s
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);