From 841a0909b94716aab68acc8d08e00fd863cc2631 Mon Sep 17 00:00:00 2001 From: Jeffrey Pfau Date: Mon, 29 Jun 2015 00:24:52 -0700 Subject: [PATCH] GBA Audio: Implement audio reset for channels A/B --- CHANGES | 1 + README.md | 1 - src/gba/audio.c | 7 ++++++- 3 files changed, 7 insertions(+), 2 deletions(-) diff --git a/CHANGES b/CHANGES index bf49561b1..74697337c 100644 --- a/CHANGES +++ b/CHANGES @@ -86,6 +86,7 @@ Misc: - ARM7: Reduce the size of the Thumb instruction table - GBA: Don't include GBACLIDebugger struct unless needed - SDL: Clean up GL context + - GBA Audio: Implement audio reset for channels A/B 0.2.1: (2015-05-13) Bugfixes: diff --git a/README.md b/README.md index 91fc00c2d..74ce04c0d 100644 --- a/README.md +++ b/README.md @@ -104,7 +104,6 @@ Footnotes - OBJ window for modes 3, 4 and 5 ([Bug #5](http://mgba.io/b/5)) - Mosaic for transformed OBJs ([Bug #9](http://mgba.io/b/9)) - BIOS call RegisterRamReset is partially stubbed out ([Bug #141](http://mgba.io/b/141)) -- Audio channel reset flags ([Bug #142](http://mgba.io/b/142)) - Game Pak prefetch ([Bug #195](http://mgba.io/b/195)) - BIOS call Stop, for entering sleep mode ([Bug #199](http://mgba.io/b/199)) diff --git a/src/gba/audio.c b/src/gba/audio.c index 26e9ac3b5..652ebc2f0 100644 --- a/src/gba/audio.c +++ b/src/gba/audio.c @@ -456,7 +456,12 @@ void GBAAudioWriteSOUNDCNT_HI(struct GBAAudio* audio, uint16_t value) { audio->chBRight = GBARegisterSOUNDCNT_HIGetChBRight(value); audio->chBLeft = GBARegisterSOUNDCNT_HIGetChBLeft(value); audio->chBTimer = GBARegisterSOUNDCNT_HIGetChBTimer(value); - // TODO: Implement channel reset + if (GBARegisterSOUNDCNT_HIIsChAReset(value)) { + CircleBufferClear(&audio->chA.fifo); + } + if (GBARegisterSOUNDCNT_HIIsChBReset(value)) { + CircleBufferClear(&audio->chB.fifo); + } } void GBAAudioWriteSOUNDCNT_X(struct GBAAudio* audio, uint16_t value) {