diff --git a/CHANGES b/CHANGES index 189ca1c3b..8e371932a 100644 --- a/CHANGES +++ b/CHANGES @@ -12,6 +12,7 @@ Emulation fixes: - GB SIO: Disabling SIO should cancel pending transfers (fixes mgba.io/i/2537) - GB Video: Implement DMG-style sprite ordering - GBA Audio: Fix sample timing drifting when changing sample interval + - GBA Audio: Fix initial channel 3 wave RAM (fixes mgba.io/i/2947) - GBA BIOS: Fix clobbering registers with word-sized CpuSet - GBA Video: Disable BG target 1 blending when OBJ blending (fixes mgba.io/i/2722) Other fixes: diff --git a/src/gb/audio.c b/src/gb/audio.c index 9130c8711..a90d5531a 100644 --- a/src/gb/audio.c +++ b/src/gb/audio.c @@ -100,22 +100,24 @@ void GBAudioReset(struct GBAudio* audio) { audio->ch3 = (struct GBAudioWaveChannel) { .bank = 0 }; audio->ch4 = (struct GBAudioNoiseChannel) { .nSamples = 0 }; // TODO: DMG randomness - audio->ch3.wavedata8[0] = 0x00; - audio->ch3.wavedata8[1] = 0xFF; - audio->ch3.wavedata8[2] = 0x00; - audio->ch3.wavedata8[3] = 0xFF; - audio->ch3.wavedata8[4] = 0x00; - audio->ch3.wavedata8[5] = 0xFF; - audio->ch3.wavedata8[6] = 0x00; - audio->ch3.wavedata8[7] = 0xFF; - audio->ch3.wavedata8[8] = 0x00; - audio->ch3.wavedata8[9] = 0xFF; - audio->ch3.wavedata8[10] = 0x00; - audio->ch3.wavedata8[11] = 0xFF; - audio->ch3.wavedata8[12] = 0x00; - audio->ch3.wavedata8[13] = 0xFF; - audio->ch3.wavedata8[14] = 0x00; - audio->ch3.wavedata8[15] = 0xFF; + if (audio->style != GB_AUDIO_GBA) { + audio->ch3.wavedata8[0] = 0x00; + audio->ch3.wavedata8[1] = 0xFF; + audio->ch3.wavedata8[2] = 0x00; + audio->ch3.wavedata8[3] = 0xFF; + audio->ch3.wavedata8[4] = 0x00; + audio->ch3.wavedata8[5] = 0xFF; + audio->ch3.wavedata8[6] = 0x00; + audio->ch3.wavedata8[7] = 0xFF; + audio->ch3.wavedata8[8] = 0x00; + audio->ch3.wavedata8[9] = 0xFF; + audio->ch3.wavedata8[10] = 0x00; + audio->ch3.wavedata8[11] = 0xFF; + audio->ch3.wavedata8[12] = 0x00; + audio->ch3.wavedata8[13] = 0xFF; + audio->ch3.wavedata8[14] = 0x00; + audio->ch3.wavedata8[15] = 0xFF; + } audio->ch4 = (struct GBAudioNoiseChannel) { .envelope = { .dead = 2 } }; audio->frame = 0; audio->sampleInterval = SAMPLE_INTERVAL * GB_MAX_SAMPLES;