GB Audio: Small audio fixes

This commit is contained in:
Jeffrey Pfau 2016-02-06 01:48:28 -08:00
parent d3fa698c81
commit a712216c2e
1 changed files with 4 additions and 1 deletions

View File

@ -121,6 +121,9 @@ void GBAudioWriteNR14(struct GBAudio* audio, uint8_t value) {
if (!audio->ch1.control.length) {
audio->ch1.control.length = 64;
}
if (audio->playingCh1 && audio->ch1.shift) {
audio->playingCh1 = _updateSweep(&audio->ch1);
}
audio->nextEvent = 0;
}
}
@ -360,7 +363,7 @@ int32_t GBAudioProcessEvents(struct GBAudio* audio, int32_t cycles) {
}
}
if ((frame & 3) == 2) {
if (audio->ch1.sweepStep && (frame & 3) == 2) {
--audio->ch1.sweepStep;
if (audio->ch1.sweepStep == 0) {
audio->playingCh1 = _updateSweep(&audio->ch1);