ref: 8982892c90d74c2d09380dff0034c2802ab07b94
parent: 13a18ac95ca2a0929d15aad6e4e022fd6b84a14b
author: cancel <cancel@cancel.fm>
date: Thu Jan 24 03:24:22 EST 2019
Fix ordering of gbuffer reads in `C` operator
--- a/sim.c
+++ b/sim.c
@@ -448,12 +448,12 @@
PORT(0, -1, IN | PARAM);
PORT(0, 1, IN);
PORT(1, 0, OUT);
- Usz mod_num = index_of(PEEK(0, 1));
Usz rate = index_of(PEEK(0, -1));
- if (mod_num == 0)
- mod_num = 10;
+ Usz mod_num = index_of(PEEK(0, 1));
if (rate == 0)
rate = 1;
+ if (mod_num == 0)
+ mod_num = 10;
Glyph g = glyph_of(Tick_number / rate % mod_num);
POKE(1, 0, g);
END_OPERATOR