ft2-clone

Fasttracker 2 clone
Log | Files | Refs | README | LICENSE

commit 769146c059482b381a1f618b04b870c028b88067
parent 85f195d02aecd7478bb2b4c3ba689b13a40d7638
Author: Olav Sørensen <olav.sorensen@live.no>
Date:   Mon, 20 Jan 2025 16:21:35 +0100

Code cleanup

Diffstat:
Msrc/scopes/ft2_scope_macros.h | 4++--
Msrc/scopes/ft2_scopedraw.c | 2+-
Msrc/scopes/ft2_scopes.h | 2+-
3 files changed, 4 insertions(+), 4 deletions(-)

diff --git a/src/scopes/ft2_scope_macros.h b/src/scopes/ft2_scope_macros.h @@ -60,7 +60,7 @@ } \ #define CUBIC_SMP8(frac) \ - const int16_t *t = scopeIntrpLUT + (((frac) >> (SCOPE_FRAC_BITS-SCOPE_INTRP_PHASES_BITS)) * SCOPE_INTRP_TAPS); \ + const int16_t *t = scopeIntrpLUT + (((frac) >> (SCOPE_FRAC_BITS-SCOPE_INTRP_PHASES_BITS)) * SCOPE_INTRP_WIDTH); \ \ sample = ((s8[-2] * t[0]) + \ (s8[-1] * t[1]) + \ @@ -70,7 +70,7 @@ ( s8[3] * t[5])) >> (SCOPE_INTRP_SCALE_BITS-8); #define CUBIC_SMP16(frac) \ - const int16_t *t = scopeIntrpLUT + (((frac) >> (SCOPE_FRAC_BITS-SCOPE_INTRP_PHASES_BITS)) * SCOPE_INTRP_TAPS); \ + const int16_t *t = scopeIntrpLUT + (((frac) >> (SCOPE_FRAC_BITS-SCOPE_INTRP_PHASES_BITS)) * SCOPE_INTRP_WIDTH); \ \ sample = ((s16[-2] * t[0]) + \ (s16[-1] * t[1]) + \ diff --git a/src/scopes/ft2_scopedraw.c b/src/scopes/ft2_scopedraw.c @@ -16,7 +16,7 @@ static void scopeLine(int32_t x1, int32_t y1, int32_t y2, const uint32_t color); bool calcScopeIntrpLUT(void) { - scopeIntrpLUT = (int16_t *)malloc(SCOPE_INTRP_TAPS * SCOPE_INTRP_PHASES * sizeof (int16_t)); + scopeIntrpLUT = (int16_t *)malloc(SCOPE_INTRP_WIDTH * SCOPE_INTRP_PHASES * sizeof (int16_t)); if (scopeIntrpLUT == NULL) return false; diff --git a/src/scopes/ft2_scopes.h b/src/scopes/ft2_scopes.h @@ -17,7 +17,7 @@ #define SCOPE_FRAC_SCALE ((int64_t)1 << SCOPE_FRAC_BITS) #define SCOPE_FRAC_MASK (SCOPE_FRAC_SCALE-1) -#define SCOPE_INTRP_TAPS 6 +#define SCOPE_INTRP_WIDTH 6 #define SCOPE_INTRP_SCALE 32768 #define SCOPE_INTRP_SCALE_BITS 15 /* log2(SCOPE_INTRP_SCALE) */ #define SCOPE_INTRP_PHASES 512 /* plentiful for FT2-styled scopes */