GB Audio: Deschedule channel 3 when disabled (fixes #1463)

This commit is contained in:
Vicki Pfau 2019-06-24 09:15:35 -07:00
parent 06d407f130
commit 51e7070302
2 changed files with 2 additions and 0 deletions

View File

@ -28,6 +28,7 @@ Emulation fixes:
- GB Audio: Only reset channel 3 sample in DMG mode
- GB Audio: Sample inactive channels (fixes mgba.io/i/1455, mgba.io/i/1456)
- GB Video: Increment BCPS/OCPS even in mode 3 (fixes mgba.io/i/1462)
- GB Audio: Deschedule channel 3 when disabled (fixes mgba.io/i/1463)
Other fixes:
- Qt: Fix some Qt display driver race conditions
- Core: Improved lockstep driver reliability (Le Hoang Quyen)

View File

@ -279,6 +279,7 @@ void GBAudioWriteNR24(struct GBAudio* audio, uint8_t value) {
void GBAudioWriteNR30(struct GBAudio* audio, uint8_t value) {
audio->ch3.enable = GBAudioRegisterBankGetEnable(value);
if (!audio->ch3.enable) {
mTimingDeschedule(audio->timing, &audio->ch3Event);
audio->playingCh3 = false;
*audio->nr52 &= ~0x0004;
}