From 9ab87c2dcc0c3cdea05193197c473512d7d138e1 Mon Sep 17 00:00:00 2001 From: Nicola Pisanti Date: Mon, 13 Apr 2020 12:35:45 +0200 Subject: [PATCH] fixes I to work with capitals --- sim.c | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) diff --git a/sim.c b/sim.c index 0a74627..9f4552e 100644 --- a/sim.c +++ b/sim.c @@ -482,17 +482,18 @@ BEGIN_OPERATOR(increment) PORT(0, -1, IN | PARAM); PORT(0, 1, IN); PORT(1, 0, IN | OUT); - Glyph g = PEEK(0, -1); + Glyph ga = PEEK(0, -1); + Glyph gb = PEEK(0, 1); Usz rate = 1; - if (g != '.' && g != '*') - rate = index_of(g); - Usz max = index_of(PEEK(0, 1)); + if (ga != '.' && ga != '*') + rate = index_of(ga); + Usz max = index_of(gb); Usz val = index_of(PEEK(1, 0)); if (max == 0) max = 36; val = val + rate; val = val % max; - POKE(1, 0, glyph_of(val)); + POKE(1, 0, glyph_with_case(glyph_of(val), gb)); END_OPERATOR BEGIN_OPERATOR(jump)