shithub: orca

Download patch

ref: e2e00708d439eef6fee025f95a98aece155fe306
parent: 9062f0ea05008482bc4086a5a5836aa32a9a9906
author: cancel <cancel@cancel.fm>
date: Wed Dec 19 23:38:42 EST 2018

Update behavior of 'X'

--- a/sim.c
+++ b/sim.c
@@ -1019,13 +1019,13 @@
 END_PHASE
 
 BEGIN_DUAL_PHASE_0(teleport)
-  PSEUDO_DUAL;
+  REALIZE_DUAL;
   I32 coords[2];
   coords[0] = 1; // y
   coords[1] = 0; // x
   if (IS_AWAKE) {
-    coords[0] = (I32)usz_clamp(index_of(PEEK(0, -1)), 1, 16);
-    coords[1] = (I32)usz_clamp(index_of(PEEK(0, -2)), 0, 16);
+    coords[0] = (I32)index_of(PEEK(0, -1)) + 1;
+    coords[1] = (I32)index_of(PEEK(0, -2));
     STORE(coords);
   }
   BEGIN_DUAL_PORTS
@@ -1036,6 +1036,8 @@
   END_PORTS
 END_PHASE
 BEGIN_DUAL_PHASE_1(teleport)
+  REALIZE_DUAL;
+  STOP_IF_DUAL_INACTIVE;
   I32 coords[2];
   if (!LOAD(coords)) {
     coords[0] = 1;