all repos — mgba @ c662d779a6c488f53d6f705cb14394e9d9112544

mGBA Game Boy Advance Emulator

GB Audio: Fix performance regression
Jeffrey Pfau jeffrey@endrift.com
Sun, 25 Dec 2016 10:03:28 -0800
commit

c662d779a6c488f53d6f705cb14394e9d9112544

parent

85285a68e51d3d8b4030c8a45db8f4787beaec93

1 files changed, 3 insertions(+), 1 deletions(-)

jump to
M src/gb/audio.csrc/gb/audio.c

@@ -766,7 +766,9 @@ }

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