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 0accea9621
commit 19d9ddaf23
2 changed files with 2 additions and 0 deletions

View File

@ -3,6 +3,7 @@ Emulation fixes:
- GBA Video: Fix wrapped sprite mosaic clamping (fixes mgba.io/i/1432)
- GBA Memory: Fix STM to VRAM (fixes mgba.io/i/1430)
- 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:
- Switch: Fix threading-related crash on second launch
- Qt: Fix FPS target maxing out at 59.727 (fixes mgba.io/i/1421)

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;
}