GB Serialize: Fix audio channel 2 and 3 loading

This commit is contained in:
Vicki Pfau 2020-08-10 22:06:43 -07:00
parent f66c17533b
commit 4f75c1441c
1 changed files with 2 additions and 2 deletions

View File

@ -710,14 +710,14 @@ void GBIODeserialize(struct GB* gb, const struct GBSerializedState* state) {
gb->audio.ch1.control.stop = GBAudioRegisterControlGetStop(gb->memory.io[REG_NR14] << 8);
GBIOWrite(gb, REG_NR21, gb->memory.io[REG_NR21]);
GBIOWrite(gb, REG_NR22, gb->memory.io[REG_NR22]);
GBIOWrite(gb, REG_NR22, gb->memory.io[REG_NR23]);
GBIOWrite(gb, REG_NR23, gb->memory.io[REG_NR23]);
gb->audio.ch2.control.frequency &= 0xFF;
gb->audio.ch2.control.frequency |= GBAudioRegisterControlGetFrequency(gb->memory.io[REG_NR24] << 8);
gb->audio.ch2.control.stop = GBAudioRegisterControlGetStop(gb->memory.io[REG_NR24] << 8);
GBIOWrite(gb, REG_NR30, gb->memory.io[REG_NR30]);
GBIOWrite(gb, REG_NR31, gb->memory.io[REG_NR31]);
GBIOWrite(gb, REG_NR32, gb->memory.io[REG_NR32]);
GBIOWrite(gb, REG_NR32, gb->memory.io[REG_NR33]);
GBIOWrite(gb, REG_NR33, gb->memory.io[REG_NR33]);
gb->audio.ch3.rate &= 0xFF;
gb->audio.ch3.rate |= GBAudioRegisterControlGetRate(gb->memory.io[REG_NR34] << 8);
gb->audio.ch3.stop = GBAudioRegisterControlGetStop(gb->memory.io[REG_NR34] << 8);