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.zig16
1 files changed, 13 insertions, 3 deletions
diff --git a/anim/src/disasm.zig b/anim/src/disasm.zig
index e871cc6..cf16c6a 100644
--- a/anim/src/disasm.zig
+++ b/anim/src/disasm.zig
@@ -85,8 +85,18 @@ pub const Disasm = struct {
if (ui.mapping) map.measure(.disasm, listing(u, rec, now.marks[1], theme.map.disasm_rows, (theme.map.disasm_rows - 1) / 2).rows.len);
const pc = [2]u64{ rec.register(now.marks[0], "rip"), rec.register(now.marks[1], "rip") };
- const name = rec.strings.get(pc[if (going >= 0.5) 1 else 0]) orelse "";
- const body = u.panel(box.w, box.h, "disassembly", .{ .focus = d.focus, .note = name[0 .. std.mem.lastIndexOfScalar(u8, name, '+') orelse name.len] });
+ // The function's name: one that changes with the advance crossfades over it.
+ var names: [2][]const u8 = undefined;
+ for (pc, &names) |at_pc, *name| {
+ const sym = rec.strings.get(at_pc) orelse "";
+ name.* = sym[0 .. std.mem.lastIndexOfScalar(u8, sym, '+') orelse sym.len];
+ }
+ const renamed = !std.mem.eql(u8, names[0], names[1]);
+ const body = u.panel(box.w, box.h, "disassembly", .{ .focus = d.focus, .note = if (renamed) "" else names[1] });
+ if (renamed) {
+ u.faded(1 - going).tagNote(box.w, names[0]);
+ u.faded(going).tagNote(box.w, names[1]);
+ }
const top = body.y + m.pad;
u.clip(.{ .x = theme.stroke.rule, .y = m.tag, .w = box.w - 2 * theme.stroke.rule, .h = box.h - m.tag - theme.stroke.rule });
defer u.unclip();
@@ -172,7 +182,7 @@ pub const Disasm = struct {
break :blk rec.register(at - 1, "rip");
};
- if (shown.rows.len > 0) map.window(.disasm, shown.rows[0].addr, shown.rows[shown.rows.len - 1].addr);
+ if (to.rows.len > 0) map.window(.disasm, .{ to.rows[0].addr, to.rows[to.rows.len - 1].addr }, if (from.rows.len > 0) .{ from.rows[0].addr, from.rows[from.rows.len - 1].addr } else .{ to.rows[0].addr, to.rows[to.rows.len - 1].addr }, cursors.glide(going));
var last_line: ?u32 = null;
// A source of many lines (SQLite's) has wider numbers, as wide as
// its largest: what is right of them moves right by as much.