summaryrefslogtreecommitdiff
path: root/anim/src/root.zig
diff options
context:
space:
mode:
authorGabriel Schneider <[email protected]>2026-11-12 11:32:59 -0300
committerGabriel Schneider <[email protected]>2026-11-12 13:19:32 -0300
commiteab50d1c040774351f332a1568fa332c377860bd (patch)
tree0e727f9bf323e49aa6a2f55bb4fabd166aa9a492 /anim/src/root.zig
parent38971edd9b49a802e6e726fb51d162df1bf58b83 (diff)
downloadcomputeranim-eab50d1c040774351f332a1568fa332c377860bd.tar.gz
computeranim-eab50d1c040774351f332a1568fa332c377860bd.zip
canim: the introduction as one video, with a chapter on registers
From the user. One scene, intro, in four chapters: memory, registers, the stack, code and meaning (210 s). The registers chapter builds the panel before the stack needs it: sixteen rows with their chains, rip pinned on the code band and rsp and rbp on the stack's, rdi opened into its parts as mov edi changes one byte, a call to malloc stepped over with its result in rax, the registers a scene never changes folded. The chapters join at seams that say their title and keep it as the clock's label; one recording (from push(9), no agent, the heap from --heap) and one clock. Co-Authored-By: Claude Opus 5.5 <[email protected]> Claude-Session: https://claude.ai/code/session_016Y9MNCKgYCGiANnEwcEQxa
Diffstat (limited to 'anim/src/root.zig')
-rw-r--r--anim/src/root.zig20
1 files changed, 19 insertions, 1 deletions
diff --git a/anim/src/root.zig b/anim/src/root.zig
index 5482285..bc807de 100644
--- a/anim/src/root.zig
+++ b/anim/src/root.zig
@@ -54,6 +54,8 @@ pub const Ties = tying.Ties;
pub const Place = tying.Place;
/// Says where a place is this frame, for a scene's own component the ties should find.
pub const anchor = tying.anchor;
+/// Where a place is this frame, in canvas pixels, if a panel said (`ties.find`).
+pub const findPlace = tying.find;
pub const Array = @import("array.zig").Array;
pub const Loupe = @import("loupe.zig").Loupe;
pub const syscalls = @import("syscalls.zig");
@@ -65,6 +67,10 @@ const words = @import("words.zig");
pub const Clock = words.Clock;
pub const Caption = words.Caption;
pub const Label = words.Label;
+pub const Title = words.Title;
+pub const ChapterLabel = words.ChapterLabel;
+/// A `Ui` in the design's units that the camera does not move (`words.fixed`).
+pub const fixed = words.fixed;
pub const Veil = words.Veil;
pub const Legend = words.Legend;
/// The column (design/README.md, "column (an experiment)"): beat by beat,
@@ -279,6 +285,9 @@ pub const Context = struct {
/// (`graph.Blocks`), the map's drawing over the source; the
/// disassembly beside it linear, its blocks ruled.
graph: bool = false,
+ /// The registers the scene moves, where not its clock's way's
+ /// (`movedBy`): a scene in chapters has one set for all of them.
+ moves: ?u32 = null,
};
/// The ties between the panes, drawn over everything added before.
@@ -325,7 +334,7 @@ pub const Context = struct {
pub fn context(s: *anim.Frame, cursor_: Cursor, options: Context.Options) Context {
// The registers the scene moves keep their rows, the rest fold, chosen
// once from its way; the panel is as tall as its rows, the stack has the rest.
- const moves = contexts.movedBy(cursor_.rec, cursor_.by, .{ cursor_.first, cursor_.last });
+ const moves = options.moves orelse contexts.movedBy(cursor_.rec, cursor_.by, .{ cursor_.first, cursor_.last });
const registers_rows: f32 = @floatFromInt(contexts.registerRows(moves));
const stage = Stage.init(s, layout.fit(options.split, registers_rows));
stage.registers_rows = registers_rows;
@@ -352,6 +361,15 @@ pub fn context(s: *anim.Frame, cursor_: Cursor, options: Context.Options) Contex
// 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;
+ // (Each frame anew: what a frame's `frame` made lives for that frame.)
+ if (map.maps_frame != s.in.frame) {
+ map.maps = @splat(null);
+ map.maps_frame = s.in.frame;
+ }
+ for (&map.maps) |*slot| if (slot.* == null) {
+ slot.* = whole;
+ break;
+ };
return .{
.stage = stage,
.map = whole,