summaryrefslogtreecommitdiff
path: root/anim/src/disasm.zig
diff options
context:
space:
mode:
Diffstat (limited to 'anim/src/disasm.zig')
-rw-r--r--anim/src/disasm.zig19
1 files changed, 10 insertions, 9 deletions
diff --git a/anim/src/disasm.zig b/anim/src/disasm.zig
index be3452f..7017453 100644
--- a/anim/src/disasm.zig
+++ b/anim/src/disasm.zig
@@ -87,7 +87,8 @@ pub const Disasm = struct {
const from = listing(u, rec, now.marks[0], room);
const to = listing(u, rec, now.marks[1], room);
// On the map its box is as long as the instructions the recording has round the pc.
- if (ui.mapping and d.measures) map.measure(.disasm, listing(u, rec, now.marks[1], theme.map.disasm_rows).rows.len);
+ // (Of the moment the pane shows: a continue's destination repacks the map as the pane goes there, not as it sets off.)
+ if (ui.mapping and d.measures) map.measure(.disasm, listing(u, rec, now.marks[if (going >= 0.5) 1 else 0], theme.map.disasm_rows).rows.len);
const pc = [2]u64{ rec.register(now.marks[0], "rip"), rec.register(now.marks[1], "rip") };
// The function's name: one that changes with the advance crossfades over it.
@@ -113,17 +114,17 @@ pub const Disasm = struct {
var merged: []const Insn = to.rows;
var offsets = [2]f32{ 0, 0 };
var fade: f32 = 1;
- var faded_through = false;
var shown = to;
if (pc[0] != pc[1] and going < 1) {
if (merge(u, from.rows, to.rows)) |both| {
merged = both.rows;
offsets = .{ @floatFromInt(both.from), @floatFromInt(both.to) };
} else {
- merged = if (going < 0.5) from.rows else to.rows;
- shown = if (going < 0.5) from else to;
- fade = @abs(2 * going - 1);
- faded_through = true;
+ // On the map, for the strip, the other column as the advance starts: the strip shows where the pane goes first.
+ const over = if (ui.mapping) going > 0 else going >= 0.5;
+ merged = if (over) to.rows else from.rows;
+ shown = if (over) to else from;
+ fade = if (ui.mapping) 1 else @abs(2 * going - 1);
}
}
const scroll = std.math.lerp(offsets[0], offsets[1], cursors.glide(going));
@@ -244,9 +245,9 @@ pub const Disasm = struct {
lit.route(&.{ .{ 38, ya }, .{ c.jump_lane, ya }, .{ c.jump_lane, yb }, .{ 39, yb } }, theme.color.trail[0], .{ .width = theme.stroke.rule, .head = .{ 7, 8 }, .radius = 4 });
}
context.veiled(u, box, now.veil);
- // A window going to another column (another function) fades through, and its strip with it.
- const column_changes = faded_through and (from.rows.len == 0 or to.rows.len == 0 or !(map.inColumn(.disasm, .{ from.rows[0].addr, from.rows[from.rows.len - 1].addr }) and map.inColumn(.disasm, .{ to.rows[0].addr, to.rows[to.rows.len - 1].addr })));
- map.strip(.disasm, if (column_changes) u.faded(map.through(now, now.plan.travel)) else u, box);
+ // A window going to another column (another function): its strip goes over
+ // as the advance starts (the strip's drawings are 6 f apart: the column going over is a 6 f crossfade on it, ahead of the pane's fade.)
+ map.strip(.disasm, u, box);
}
pub const State = union(enum) {