summaryrefslogtreecommitdiff
path: root/anim/src/hexdump.zig
diff options
context:
space:
mode:
authorGabriel Schneider <[email protected]>2026-11-10 18:06:30 -0300
committerGabriel Schneider <[email protected]>2026-11-10 19:01:23 -0300
commite63b0624f57472d40af32a006c32cc47d403b822 (patch)
treeb7295da62acd96bc7aba425720eed95605526693 /anim/src/hexdump.zig
parent318e16181a28725e218121363555580725d6d0d4 (diff)
downloadcomputeranim-e63b0624f57472d40af32a006c32cc47d403b822.tar.gz
computeranim-e63b0624f57472d40af32a006c32cc47d403b822.zip
canim: what the review found; the band as two panels; list and sort by instruction
The first videos were reviewed frame by frame and the catalogue changed with them. A lens is a drawing over the program column and its view over the state column, so the stack keeps six slots, its window on the whole frame. Operands are whole. list and sort are recorded by instruction from main (record --from), so their registers strike, links reach nodes and cells, rows that ran are marked and jumps are drawn. A call's node is a projection of its return address; pins travel and keep their side; a mark covers the bytes that changed, at the element's width; a syscall's result is stored after the kernel returns it and every panel is of one moment; fast passes are veiled; the clock stands still during a step; captions get their reading time and a scene's first step comes by four seconds. Co-Authored-By: Claude Fable 5.2 <[email protected]>
Diffstat (limited to 'anim/src/hexdump.zig')
-rw-r--r--anim/src/hexdump.zig33
1 files changed, 30 insertions, 3 deletions
diff --git a/anim/src/hexdump.zig b/anim/src/hexdump.zig
index 165f241..bd76150 100644
--- a/anim/src/hexdump.zig
+++ b/anim/src/hexdump.zig
@@ -64,9 +64,36 @@ pub const Of = struct {
region: u24 = theme.color.region.heap,
};
-/// The dump: `count` rows from `first`, at `x` (its panel's left edge
-/// is the band's middle), the rows from `y`. The rows of what the drawing
-/// draws have quiet brackets.
+/// The band's view of bytes: its own panel over the state column, the
+/// tag `its bytes` with the range shown (`about`) and the legend of runs.
+/// Returns its `Ui` (the panel's origin) and how many rows it holds.
+pub fn panel(f: *@import("sketch").Frame, placed: @import("anim").Placed, stage: *const @import("stage.zig").Stage, about: []const u8, legend: []const ui.Legend) View {
+ const box = stage.box(placed, .view);
+ const u = @import("context.zig").at(f, placed, box).faded(placed.value(stage.view));
+ if (box.h < m.tag + m.row) return .{ .u = u, .rows = 0, .box = box };
+ // Its own box, as it moves; the drawing's panel clips itself again after.
+ u.clip(.{ .x = 0, .y = 0, .w = box.w, .h = box.h });
+ _ = u.panel(box.w, box.h, "its bytes", .{ .legend = legend });
+ const tag = theme.size.sans.tag;
+ u.text(.sans, theme.size.sans.micro, 28 + u.width(.sans_medium, tag, "its bytes") + 12, m.tag - 6, about, t.faint);
+ return .{ .u = u, .rows = theme.layout.rowsIn(box.h), .box = box };
+}
+
+/// The view's panel as drawn: its `Ui`, how many rows it holds, its box.
+pub const View = struct {
+ u: ui.Ui,
+ rows: usize,
+ box: Rect,
+
+ /// What a sprint cannot show: veiled, over its rows.
+ pub fn veil(v: View, now: cursors.Now) void {
+ @import("context.zig").veiled(v.u, v.box, now.sprint_veil);
+ }
+};
+
+/// The dump: `count` rows from `first`, at `x` in `u` (the view's
+/// panel), the rows from `y`. The rows of what the drawing draws have
+/// quiet brackets.
pub fn draw(u: ui.Ui, now: cursors.Now, x: f32, y: f32, first: u64, count: usize, of: Of) void {
const v = u.moved(x, 0);
const moment = now.shown(.memory);