summaryrefslogtreecommitdiff
path: root/anim/src/root.zig
diff options
context:
space:
mode:
Diffstat (limited to 'anim/src/root.zig')
-rw-r--r--anim/src/root.zig31
1 files changed, 21 insertions, 10 deletions
diff --git a/anim/src/root.zig b/anim/src/root.zig
index b7be9b4..78da9dc 100644
--- a/anim/src/root.zig
+++ b/anim/src/root.zig
@@ -220,7 +220,7 @@ pub const map = @import("map.zig");
pub const Context = struct {
stage: *Stage,
/// The working frame unfolded (`map.Map`): its panels, on a stage of its
- /// own; drawn small as the minimap. A lens adds its drawing with `map.add`.
+ /// own; each pane's column of it is the pane's strip. A lens adds its drawing with `map.add`.
map: *map.Map,
clock: anim.Obj,
source: anim.Obj,
@@ -288,18 +288,29 @@ pub fn context(s: *anim.Frame, cursor_: Cursor, options: Context.Options) Contex
const stage = Stage.init(s, options.split);
var at = cursor_;
at.levels.crossings = options.syscalls;
- // The map first: while it fills the frame or falls to the minimap it is under the panels diving out of it.
+ // The map first: while it fills the frame it is under the panels diving out of it.
const whole = s.new(map.Map{ .stage = Stage.init(s, map.split(at.rec, options.split.band.h > 0, .{ at.first, at.last }, options.graph)), .frame = stage, .t = s.value(map.diving.land + map.diving.still), .cursor = at, .graph = options.graph });
whole.obj = s.custom(whole, .{ .x = -640, .y = -360, .scale = ui.scale });
- whole.add(s, Source{ .cursor = at, .stage = whole.stage, .descent = options.descent });
- whole.add(s, Source{ .cursor = at, .stage = whole.stage, .descent = options.descent, .part = .source_more });
- if (options.graph) whole.add(s, graph.Map{ .cursor = at, .stage = whole.stage }) else if (options.descent) whole.add(s, Descent{ .cursor = at, .stage = whole.stage }) else whole.add(s, Disasm{ .cursor = at, .stage = whole.stage });
- whole.add(s, Registers{ .cursor = at, .stage = whole.stage, .syscalls = options.syscalls, .quiet = options.quiet });
- whole.add(s, Stack{ .cursor = at, .stage = whole.stage, .above = theme.map.stack_above });
+ whole.addIn(s, Source{ .cursor = at, .stage = whole.stage, .descent = options.descent }, .both, .source);
+ whole.addIn(s, Source{ .cursor = at, .stage = whole.stage, .descent = options.descent, .part = .source_more }, .both, .source);
+ // The disassembly's strip is its linear column: where the map draws a
+ // graph or a descent, the rows round the pc are drawn for the strip alone.
+ if (options.graph) {
+ whole.linear = Stage.init(s, map.split(at.rec, options.split.band.h > 0, .{ at.first, at.last }, false));
+ whole.addIn(s, graph.Map{ .cursor = at, .stage = whole.stage }, .map, .disasm);
+ whole.addIn(s, Disasm{ .cursor = at, .stage = whole.linear.?, .measures = false }, .strips, .disasm);
+ } else if (options.descent) {
+ whole.addIn(s, Descent{ .cursor = at, .stage = whole.stage }, .map, .disasm);
+ whole.addIn(s, Disasm{ .cursor = at, .stage = whole.stage, .measures = false }, .strips, .disasm);
+ } else whole.addIn(s, Disasm{ .cursor = at, .stage = whole.stage }, .both, .disasm);
+ whole.addIn(s, Registers{ .cursor = at, .stage = whole.stage, .syscalls = options.syscalls, .quiet = options.quiet }, .map, .registers);
+ whole.addIn(s, Stack{ .cursor = at, .stage = whole.stage, .above = theme.map.stack_above }, .both, .stack);
// The stack goes on in the rest of the memory's column, from where its own column ends.
- whole.add(s, Stack{ .cursor = at, .stage = whole.stage, .above = theme.map.stack_above - @as(i32, @intCast(theme.layout.rowsIn(whole.stage.first.stack.h))), .part = .more });
- whole.add(s, Backtrace{ .cursor = at, .stage = whole.stage });
- whole.add(s, map.Spare{ .cursor = at, .stage = whole.stage, .map = whole });
+ whole.addIn(s, Stack{ .cursor = at, .stage = whole.stage, .above = theme.map.stack_above - @as(i32, @intCast(theme.layout.rowsIn(whole.stage.first.stack.h))), .part = .more }, .both, .stack);
+ whole.addIn(s, Backtrace{ .cursor = at, .stage = whole.stage }, .map, .backtrace);
+ // The rest of the first two columns: no pane's.
+ whole.addIn(s, map.Spare{ .cursor = at, .stage = whole.stage, .map = whole }, .map, .backtrace);
+ map.current = whole;
return .{
.stage = stage,
.map = whole,