ref: 8dd2fd965568af3ac722819053ea95d6023b17b1
parent: 9425d2a601bc5090088e4f8c05a42179336e7e67
author: Devine Lu Linvega <aliceffekt@gmail.com>
date: Fri May 24 13:48:41 EDT 2019
Colorized ports properly, fixed #34
--- a/sim.c
+++ b/sim.c
@@ -417,7 +417,7 @@
BEGIN_OPERATOR(add)
LOWERCASE_REQUIRES_BANG;
- PORT(0, -1, IN);
+ PORT(0, -1, IN | PARAM);
PORT(0, 1, IN);
PORT(1, 0, OUT);
Usz a = index_of(PEEK(0, -1));
@@ -434,10 +434,8 @@
Usz to = index_of(PEEK(0, 1));
if (rate == 0)
rate = 1;
- if (to < 2) {
- POKE(1, 0, glyph_of(0));
- return;
- }
+ if (to == 0)
+ to = 8;
to = to - 1;
Usz key = (Tick_number / rate) % (to * 2);
if (key > to)
@@ -478,7 +476,7 @@
BEGIN_OPERATOR(if)
LOWERCASE_REQUIRES_BANG;
- PORT(0, -1, IN);
+ PORT(0, -1, IN | PARAM);
PORT(0, 1, IN);
PORT(1, 0, OUT);
Glyph g0 = PEEK(0, -1);
@@ -509,7 +507,7 @@
BEGIN_OPERATOR(increment)
LOWERCASE_REQUIRES_BANG;
- PORT(0, -1, IN);
+ PORT(0, -1, IN | PARAM);
PORT(0, 1, IN);
PORT(1, 0, IN | OUT);
Glyph g = PEEK(0, -1);
@@ -582,7 +580,7 @@
BEGIN_OPERATOR(multiply)
LOWERCASE_REQUIRES_BANG;
- PORT(0, -1, IN);
+ PORT(0, -1, IN | PARAM);
PORT(0, 1, IN);
PORT(1, 0, OUT);
Usz ia = index_of(PEEK(0, -1));
@@ -648,7 +646,7 @@
BEGIN_OPERATOR(random)
LOWERCASE_REQUIRES_BANG;
- PORT(0, -1, IN);
+ PORT(0, -1, IN | PARAM);
PORT(0, 1, IN);
PORT(1, 0, OUT);
Usz a = index_of(PEEK(0, -1));
@@ -753,7 +751,7 @@
BEGIN_OPERATOR(lerp)
LOWERCASE_REQUIRES_BANG;
- PORT(0, -1, IN);
+ PORT(0, -1, IN | PARAM);
PORT(0, 1, IN);
PORT(1, 0, IN | OUT);
Glyph g = PEEK(0, -1);