GB I/O: Fix writing to WAVE RAM behavior (fixes #1334)

This commit is contained in:
Vicki Pfau 2022-06-06 22:55:04 -07:00
parent 00421cd046
commit fda7f83855
5 changed files with 3 additions and 4 deletions

View File

@ -23,6 +23,7 @@ Emulation fixes:
- GB Audio: Properly apply per-model audio differences - GB Audio: Properly apply per-model audio differences
- GB Audio: Revamp channel rendering - GB Audio: Revamp channel rendering
- GB Audio: Fix APU re-enable timing glitch - GB Audio: Fix APU re-enable timing glitch
- GB I/O: Fix writing to WAVE RAM behavior (fixes mgba.io/i/1334)
- GB Memory: Add cursory cartridge open bus emulation (fixes mgba.io/i/2032) - GB Memory: Add cursory cartridge open bus emulation (fixes mgba.io/i/2032)
- GB Serialize: Fix loading MBC1 states that affect bank 0 (fixes mgba.io/i/2402) - GB Serialize: Fix loading MBC1 states that affect bank 0 (fixes mgba.io/i/2402)
- GB Video: Draw SGB border pieces that overlap GB graphics (fixes mgba.io/i/1339) - GB Video: Draw SGB border pieces that overlap GB graphics (fixes mgba.io/i/1339)

Binary file not shown.

After

Width:  |  Height:  |  Size: 628 B

View File

@ -1,2 +0,0 @@
[testinfo]
fail=1

Binary file not shown.

Before

Width:  |  Height:  |  Size: 785 B

View File

@ -404,9 +404,9 @@ void GBIOWrite(struct GB* gb, unsigned address, uint8_t value) {
case GB_REG_WAVE_E: case GB_REG_WAVE_E:
case GB_REG_WAVE_F: case GB_REG_WAVE_F:
GBAudioRun(&gb->audio, mTimingCurrentTime(gb->audio.timing), 0x4); GBAudioRun(&gb->audio, mTimingCurrentTime(gb->audio.timing), 0x4);
if (!gb->audio.playingCh3 || gb->audio.style != GB_AUDIO_DMG) { if (!gb->audio.playingCh3) {
gb->audio.ch3.wavedata8[address - GB_REG_WAVE_0] = value; gb->audio.ch3.wavedata8[address - GB_REG_WAVE_0] = value;
} else if(gb->audio.ch3.readable) { } else if (gb->audio.ch3.readable || gb->audio.style == GB_AUDIO_CGB) {
gb->audio.ch3.wavedata8[gb->audio.ch3.window >> 1] = value; gb->audio.ch3.wavedata8[gb->audio.ch3.window >> 1] = value;
} }
break; break;