all repos — mgba @ af96ee70879f65255c11e1cc28a88f2afd23894c

mGBA Game Boy Advance Emulator

GB Audio: Remove faulty optimization
Jeffrey Pfau jeffrey@endrift.com
Fri, 29 Apr 2016 01:35:57 -0700
commit

af96ee70879f65255c11e1cc28a88f2afd23894c

parent

faab8ae5f03a4370f867b56d7ddc4f28f4f56537

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

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

@@ -594,13 +594,7 @@ int sampleRight = 0;

if (audio->ch4.envelope.dead != 2) { while (audio->nextCh4 <= 0) { - int32_t timing = _updateChannel4(&audio->ch4); - if (audio->nextCh4 < -timing) { - int32_t bound = timing * 16; - // Perform negative modulo to cap to 16 iterations - audio->nextCh4 = bound - (audio->nextCh4 - 1) % bound - 1; - } - audio->nextCh4 += timing; + audio->nextCh4 += _updateChannel4(&audio->ch4); } if (audio->nextCh4 < audio->nextEvent) { audio->nextEvent = audio->nextCh4;