+ if (tape.pos[tape.length].delay > 0) /* already stored action */
+ {
+ if (tape.pos[tape.length].action[0] != tape_action ||
+ tape.pos[tape.length].delay + tape_repeat >= 256)
+ {
+ tape.length++;
+ tape.pos[tape.length].delay = 0;
+ }
+ else
+ {
+ tape.pos[tape.length].delay += tape_repeat;
+ }
+ }
+
+ if (tape.pos[tape.length].delay == 0) /* store new action */
+ {
+ tape.pos[tape.length].action[0] = tape_action;
+ tape.pos[tape.length].delay = tape_repeat;
+ }