Browse Source

Cleanup

master
cancel 7 years ago
parent
commit
ec6eb8d56b
  1. 12
      sim.c

12
sim.c

@ -702,7 +702,7 @@ BEGIN_OPERATOR(query)
PORT(0, -2, IN | HASTE); // y PORT(0, -2, IN | HASTE); // y
PORT(0, -1, IN | HASTE); // len PORT(0, -1, IN | HASTE); // len
// todo direct buffer manip // todo direct buffer manip
for (I32 i = 0; i < len; ++i) { for (Isz i = 0; i < len; ++i) {
PORT(in_y, in_x + i, IN); PORT(in_y, in_x + i, IN);
PORT(1, out_x + i, OUT); PORT(1, out_x + i, OUT);
} }
@ -711,7 +711,7 @@ BEGIN_OPERATOR(query)
LEGACY_PHASE_GUARD; LEGACY_PHASE_GUARD;
oper_copy_columns(gbuffer, mbuffer, height, width, y, x, in_y, in_x, 1, out_x, oper_copy_columns(gbuffer, mbuffer, height, width, y, x, in_y, in_x, 1, out_x,
len, false); len, false);
// for (I32 i = 0; i < len; ++i) { // for (Isz i = 0; i < len; ++i) {
// Glyph g = PEEK(in_y, in_x + i); // Glyph g = PEEK(in_y, in_x + i);
// POKE(1, out_x + i, g); // POKE(1, out_x + i, g);
// } // }
@ -757,12 +757,9 @@ END_OPERATOR
BEGIN_OPERATOR(track) BEGIN_OPERATOR(track)
REALIZE_DUAL; REALIZE_DUAL;
Isz read_val_x = 1;
Usz len = index_of(PEEK(0, -1)) + 1; Usz len = index_of(PEEK(0, -1)) + 1;
Usz key = index_of(PEEK(0, -2)); Usz key = index_of(PEEK(0, -2));
read_val_x = (Isz)(key % len) + 1; Isz read_val_x = (Isz)(key % len) + 1;
I32 ival[1];
ival[0] = (I32)read_val_x;
for (Usz i = 0; i < len; ++i) { for (Usz i = 0; i < len; ++i) {
LOCK(0, (Isz)(i + 1)); LOCK(0, (Isz)(i + 1));
} }
@ -772,9 +769,8 @@ BEGIN_OPERATOR(track)
PORT(0, (Isz)read_val_x, IN); PORT(0, (Isz)read_val_x, IN);
PORT(1, 0, OUT); PORT(1, 0, OUT);
END_PORTS END_PORTS
LEGACY_PHASE_GUARD; LEGACY_PHASE_GUARD;
POKE(1, 0, PEEK(0, ival[0])); POKE(1, 0, PEEK(0, read_val_x));
END_OPERATOR END_OPERATOR
static Isz const uturn_data[] = { static Isz const uturn_data[] = {

Loading…
Cancel
Save