diff options
Diffstat (limited to 'anim/src/disasm.zig')
| -rw-r--r-- | anim/src/disasm.zig | 10 |
1 files changed, 7 insertions, 3 deletions
diff --git a/anim/src/disasm.zig b/anim/src/disasm.zig index afeef1b..b3049f1 100644 --- a/anim/src/disasm.zig +++ b/anim/src/disasm.zig @@ -1221,6 +1221,7 @@ pub fn plainRow(u: ui.Ui, row: Insn, y: f32) void { /// The same instruction atoms for a live debugger: one moment, without /// indexing an animation's entire recording. Only observed operands are annotated. pub fn liveRow(at: ui.Ui, row: Insn, y: f32, width: f32, moment: Recording.Moment, regs: zt.Regs, options: struct { + compact: bool = false, current: bool = false, executed: bool = false, lead: usize = 0, @@ -1229,13 +1230,16 @@ pub fn liveRow(at: ui.Ui, row: Insn, y: f32, width: f32, moment: Recording.Momen heat: ui.Heat = .none, }) void { const base_y = rows.baseline(y); - _ = at.address(c.address, base_y, row.addr, .{ .ink = ui.rgb(theme.color.region.code_), .lead = options.lead }); - const shift = @as(f32, @floatFromInt(@max(ui.digits(row.addr), 7) - 7)) * adv; + if (options.compact) { + at.text(.mono, size, c.address, base_y, at.print("…{x:0>4}", .{row.addr & 0xffff}), theme.color.region.code_); + at.hitAddress(row.addr, .{ .x = c.address, .y = y, .w = 5 * adv, .h = 24 }); + } else _ = at.address(c.address, base_y, row.addr, .{ .ink = ui.rgb(theme.color.region.code_), .lead = options.lead }); + const shift: f32 = if (options.compact) -64 else @as(f32, @floatFromInt(@max(ui.digits(row.addr), 7) - 7)) * adv; const u = at.moved(shift, 0); const room = width - shift - m.side; const pad = row.padding(); const mn = row.mnemonic(); - if (row.line) |line| u.text(.mono, size, c.line, base_y, u.print("{d}", .{line}), t.faint); + if (!options.compact) if (row.line) |line| u.text(.mono, size, c.line, base_y, u.print("{d}", .{line}), t.faint); u.text(.mono_bold, size, c.mnemonic, base_y, mn, if (pad) t.faint else theme.color.code.keyword); var name_buf: [192]u8 = undefined; const name = if (target(row)) |to| (moment.string(to, &name_buf) catch null) orelse "" else ""; |
