From aec8b8275622c3b54ee2bebfd903d5fc051255bc Mon Sep 17 00:00:00 2001 From: Vicki Pfau Date: Mon, 24 Apr 2017 12:44:51 -0700 Subject: [PATCH] GB, GBA Core: Reset audio when loading mVL states so audio sync works --- src/gb/core.c | 1 + src/gba/core.c | 1 + 2 files changed, 2 insertions(+) diff --git a/src/gb/core.c b/src/gb/core.c index 6707b8416..97b48e7da 100644 --- a/src/gb/core.c +++ b/src/gb/core.c @@ -818,6 +818,7 @@ static bool _GBVLPLoadState(struct mCore* core, const void* buffer) { GBVideoDeserialize(&gb->video, state); GBIODeserialize(gb, state); + GBAudioReset(&gb->audio); // Make sure CPU loop never spins GBHalt(gb->cpu); diff --git a/src/gba/core.c b/src/gba/core.c index 185598e53..4558ccd77 100644 --- a/src/gba/core.c +++ b/src/gba/core.c @@ -838,6 +838,7 @@ static bool _GBAVLPLoadState(struct mCore* core, const void* state) { gba->cpu->memory.store16(gba->cpu, BASE_IO | REG_IE, 0, NULL); GBAVideoDeserialize(&gba->video, state); GBAIODeserialize(gba, state); + GBAAudioReset(&gba->audio); return true; }