GB Audio: Fix performance regression

This commit is contained in:
Jeffrey Pfau 2016-12-25 10:03:28 -08:00
parent 85285a68e5
commit c662d779a6
1 changed files with 3 additions and 1 deletions

View File

@ -766,7 +766,9 @@ static void _updateEnvelope(struct GBAudioEnvelope* envelope) {
}
static void _updateEnvelopeDead(struct GBAudioEnvelope* envelope) {
if (!envelope->direction && !envelope->currentVolume) {
if (!envelope->stepTime) {
envelope->dead = envelope->currentVolume ? 1 : 2;
} else if (!envelope->direction && !envelope->currentVolume) {
envelope->dead = 2;
} else if (envelope->direction && envelope->currentVolume == 0xF) {
envelope->dead = 1;