shithub: orca

Download patch

ref: d395999d30f90756a252c7e4c1d5e912eb6114ca
parent: 8982892c90d74c2d09380dff0034c2802ab07b94
author: Nicola Pisanti <pisanti.nicola@gmail.com>
date: Wed Jan 23 20:11:26 EST 2019

Update `D` to match orca-js (#10)

--- a/sim.c
+++ b/sim.c
@@ -464,10 +464,12 @@
   PORT(0, 1, IN);
   PORT(1, 0, OUT);
   Usz rate = index_of(PEEK(0, -1));
-  Usz offset = index_of(PEEK(0, 1));
+  Usz mod_num = index_of(PEEK(0, 1));
   if (rate == 0)
     rate = 1;
-  Glyph g = (Tick_number + offset) % rate == 0 ? '*' : '.';
+  if (mod_num == 0)
+    mod_num = 10;
+  Glyph g = Tick_number % (rate * mod_num) == 0 ? '*' : '.';
   POKE(1, 0, g);
 END_OPERATOR