GB Audio: Fix deserializing while audio was disabled (fixes #1305)

This commit is contained in:
Vicki Pfau 2020-08-24 01:19:45 -07:00
parent 9841db0d94
commit 27b31024ce
2 changed files with 2 additions and 1 deletions

View File

@ -16,6 +16,7 @@ Emulation fixes:
- GB Audio: Fix initial sweep state
- GB Audio: Fix serializing sweep time
- GB Audio: Fix deserializing audio channels 2 and 3
- GB Audio: Fix deserializing while audio was disabled (fixes mgba.io/i/1305)
- GB MBC: Fix MBC1 mode changing behavior
- GB Video: Fix state after skipping BIOS (fixes mgba.io/i/1715 and mgba.io/i/1716)
- GBA: Fix timing advancing too quickly in rare cases

View File

@ -700,7 +700,7 @@ void GBIODeserialize(struct GB* gb, const struct GBSerializedState* state) {
gb->memory.ie = state->ie;
gb->audio.enable = GBAudioEnableGetEnable(*gb->audio.nr52);
if (GBAudioEnableGetEnable(gb->audio.enable)) {
if (gb->audio.enable) {
GBIOWrite(gb, REG_NR10, gb->memory.io[REG_NR10]);
GBIOWrite(gb, REG_NR11, gb->memory.io[REG_NR11]);
GBIOWrite(gb, REG_NR12, gb->memory.io[REG_NR12]);