From 8807330649c8f700d032fd47bdd34ec221c79b50 Mon Sep 17 00:00:00 2001 From: Randy Heit Date: Thu, 7 Feb 2013 23:30:20 +0000 Subject: [PATCH] - Update DUMB to revision c0fc19ef2e756ef25aa44ca3775b4afed3f02c9c - Changed aliased resampler loop conditions a bit to fix some bugs - Removed resampler loop unrolling, as it actually made things slightly slower - Fixed a bug with songs triggering notes on the first order with instrument changes before any note commands have been triggered SVN r4077 (trunk) --- dumb/src/helpers/resamp3.inc | 14 ++++++-------- dumb/src/helpers/resample.c | 4 ++-- dumb/src/it/itrender.c | 2 +- 3 files changed, 9 insertions(+), 11 deletions(-) diff --git a/dumb/src/helpers/resamp3.inc b/dumb/src/helpers/resamp3.inc index 1581e7bfa..05c0dfbb7 100644 --- a/dumb/src/helpers/resamp3.inc +++ b/dumb/src/helpers/resamp3.inc @@ -124,13 +124,12 @@ int32 dumb_resample(DUMB_RESAMPLER *resampler, sample_t *dst, int32 dst_size, VO todo_clocks_set = todo_clocks; if ( todo_clocks_set > 256 * 65536 ) todo_clocks_set = 256 * 65536; todo_clocks -= todo_clocks_set; - todo = ( todo_clocks_set - resampler->last_clock + inv_dt - 1 ) / inv_dt; - if ( todo < 0 ) todo = 0; - LOOP4(todo, + while ( resampler->last_clock < todo_clocks_set ) + { POKE_ALIAS(2); pos--; x -= SRC_CHANNELS; - ); + } todo = todo_clocks_set >> 16; MIX_ALIAS( todo ); } @@ -229,13 +228,12 @@ int32 dumb_resample(DUMB_RESAMPLER *resampler, sample_t *dst, int32 dst_size, VO todo_clocks_set = todo_clocks; if ( todo_clocks_set > 256 * 65536 ) todo_clocks_set = 256 * 65536; todo_clocks -= todo_clocks_set; - todo = ( todo_clocks_set - resampler->last_clock + inv_dt - 1 ) / inv_dt; - if ( todo < 0 ) todo = 0; - LOOP4(todo, + while ( resampler->last_clock < todo_clocks_set ) + { POKE_ALIAS(-2); pos++; x += SRC_CHANNELS; - ); + } todo = todo_clocks_set >> 16; MIX_ALIAS( todo ); } diff --git a/dumb/src/helpers/resample.c b/dumb/src/helpers/resample.c index e78d0d39c..4424a4934 100644 --- a/dumb/src/helpers/resample.c +++ b/dumb/src/helpers/resample.c @@ -117,9 +117,9 @@ int dumb_resampling_quality = DUMB_RQ_CUBIC; */ #define LOOP4(iterator, CONTENT) \ { \ - while (iterator) { \ + while ( (iterator)-- ) \ + { \ CONTENT; \ - (iterator)--; \ } \ } #endif diff --git a/dumb/src/it/itrender.c b/dumb/src/it/itrender.c index 4d188ae6a..b8d4b5e92 100644 --- a/dumb/src/it/itrender.c +++ b/dumb/src/it/itrender.c @@ -4863,7 +4863,7 @@ static DUMB_IT_SIGRENDERER *init_sigrenderer(DUMB_IT_SIGDATA *sigdata, int n_cha channel->channelvolume = sigdata->channel_volume[i]; channel->instrument = 0; channel->sample = 0; - channel->note = 0; + channel->note = IT_NOTE_OFF; channel->SFmacro = 0; channel->filter_cutoff = 127; channel->filter_resonance = 0;