From 463d64b3b9ec88399c8d35593ae68f5be673d6cc Mon Sep 17 00:00:00 2001 From: Nicola Pisanti Date: Sun, 2 Jan 2022 12:45:27 +0100 Subject: [PATCH] Fix Z capitalization Lerp operator Z now respects capitalization based on the right port. --- sim.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/sim.c b/sim.c index c9337f0..6882172 100644 --- a/sim.c +++ b/sim.c @@ -735,11 +735,12 @@ BEGIN_OPERATOR(lerp) PORT(0, 1, IN); PORT(1, 0, IN | OUT); Glyph g = PEEK(0, -1); + Glyph b = PEEK(0, 1); Isz rate = g == '.' || g == '*' ? 1 : (Isz)index_of(g); - Isz goal = (Isz)index_of(PEEK(0, 1)); + Isz goal = (Isz)index_of(b); Isz val = (Isz)index_of(PEEK(1, 0)); Isz mod = val <= goal - rate ? rate : val >= goal + rate ? -rate : goal - val; - POKE(1, 0, glyph_of((Usz)(val + mod))); + POKE(1, 0, glyph_with_case(glyph_of((Usz)(val + mod)), b)); END_OPERATOR //////// Run simulation