GBA: Savestates with negative audio registers are only relevant if not dead
Jeffrey Pfau jeffrey@endrift.com
Wed, 01 Jul 2015 19:43:34 -0700
1 files changed,
9 insertions(+),
3 deletions(-)
jump to
M
src/gba/serialize.c
→
src/gba/serialize.c
@@ -103,11 +103,16 @@ if (state->audio.eventDiff < 0) {
GBALog(gba, GBA_LOG_WARN, "Savestate is corrupted: audio eventDiff is negative"); error = true; } - if (state->audio.ch1.envelopeNextStep < 0 || state->audio.ch1.waveNextStep < 0 || state->audio.ch1.sweepNextStep < 0 || state->audio.ch1.nextEvent < 0) { + if (!state->audio.ch1Dead && (state->audio.ch1.envelopeNextStep < 0 || + state->audio.ch1.waveNextStep < 0 || + state->audio.ch1.sweepNextStep < 0 || + state->audio.ch1.nextEvent < 0)) { GBALog(gba, GBA_LOG_WARN, "Savestate is corrupted: audio channel 1 register is negative"); error = true; } - if (state->audio.ch2.envelopeNextStep < 0 || state->audio.ch2.waveNextStep < 0 || state->audio.ch2.nextEvent < 0) { + if (!state->audio.ch2Dead && (state->audio.ch2.envelopeNextStep < 0 || + state->audio.ch2.waveNextStep < 0 || + state->audio.ch2.nextEvent < 0)) { GBALog(gba, GBA_LOG_WARN, "Savestate is corrupted: audio channel 2 register is negative"); error = true; }@@ -115,7 +120,8 @@ if (state->audio.ch3.nextEvent < 0) {
GBALog(gba, GBA_LOG_WARN, "Savestate is corrupted: audio channel 3 register is negative"); error = true; } - if (state->audio.ch4.envelopeNextStep < 0 || state->audio.ch4.nextEvent < 0) { + if (!state->audio.ch4Dead && (state->audio.ch4.envelopeNextStep < 0 || + state->audio.ch4.nextEvent < 0)) { GBALog(gba, GBA_LOG_WARN, "Savestate is corrupted: audio channel 4 register is negative"); error = true; }