summaryrefslogtreecommitdiff
path: root/anim/src/ties.zig
diff options
context:
space:
mode:
authorGabriel Schneider <[email protected]>2026-11-10 22:02:01 -0300
committerGabriel Schneider <[email protected]>2026-11-10 22:06:03 -0300
commit8b5d0340c9f9b3168c67f04e57cfa03712ac992c (patch)
tree66891f03e905731b8afa2689e86fe612675f4f35 /anim/src/ties.zig
parent36bb1c332a124cb4d437dd8386b267ee58310a5d (diff)
downloadcomputeranim-8b5d0340c9f9b3168c67f04e57cfa03712ac992c.tar.gz
computeranim-8b5d0340c9f9b3168c67f04e57cfa03712ac992c.zip
canim: a continue is a wave; what arrives after a fade is plain; a pin only where its register points
From the designer's review of the SQLite scene. Between far stops the changed registers strike two frames apart in pwndbg's order, and links and pins set off with memory. A stack window or a dump that fades in carries no marks of changes the viewer did not see. At rest a moved register kept a pin at its old place as well, in every scene: gone. The kernel's answer is filled before the return arrow leaves, and rax strikes as it lands. Every dump has one reading, by type (a char quoted, a bool by name); line numbers are as wide as the program's largest; pins' names keep the side they came to. Names and measures follow the catalogue (.loose, theme.metric.calls, time.pin, time.continue_wave). Co-Authored-By: Claude Fable 5.2 <[email protected]>
Diffstat (limited to 'anim/src/ties.zig')
-rw-r--r--anim/src/ties.zig22
1 files changed, 16 insertions, 6 deletions
diff --git a/anim/src/ties.zig b/anim/src/ties.zig
index 1f2532d..0df8e34 100644
--- a/anim/src/ties.zig
+++ b/anim/src/ties.zig
@@ -100,7 +100,8 @@ fn find(place: Place) ?[4]f32 {
/// When register `i` strikes in this step: the registers one step wrote
/// strike 6 f apart, in the registers' order; from the fourth on with the
/// third, within the CPU's slot of the cascade; in a crossing, once the
-/// call is back. Its pin and its link go with it.
+/// call is back; in a continue, a wave, 2 f after the one above it. Its
+/// pin and its link go with it.
pub fn strikeDelay(now: cursors.Now, i: usize) f32 {
var before: f32 = 0;
for (theme.metric.all_registers[0..16]) |name| {
@@ -108,9 +109,17 @@ pub fn strikeDelay(now: cursors.Now, i: usize) f32 {
if (k == i) break;
if (now.registerAge(k) == 0) before += 1;
}
+ if (now.plan.wave) return before * time.continue_wave;
return @min(before * cursors.write_apart, time.cascade) + @import("syscalls.zig").crossingDelay(now);
}
+/// Seconds since register `i`'s link (and its pin) set off: its strike;
+/// in a continue, memory's, when the stack's window is at its new place
+/// (a tie arrives at what is on screen, not at a window about to go).
+fn linkSince(now: cursors.Now, i: usize) f32 {
+ return if (now.plan.wave) now.since(.memory, 0) else now.since(.cpu, strikeDelay(now, i));
+}
+
/// How long a link draws: to a slot near by, or across to the lens.
pub fn linkTime(target: enum { slot, node }) f32 {
return if (target == .slot) time.link.in else time.link.in_far;
@@ -120,11 +129,12 @@ pub fn linkTime(target: enum { slot, node }) f32 {
/// before this step (`old`) and at the one it points at now (`new`):
/// 6 f after its strike the old pin fades (12 f); the new lands with
/// its link's head and settles (12 f). At a run or a sprint it moves
-/// with its level; at rest, and for a register the step did not write,
-/// both are 1.
+/// with its level; at rest it is where the register points, and only
+/// there; for a register the step did not write, the two are one place.
pub fn pinShows(now: cursors.Now, i: usize, target: enum { slot, node }) struct { old: f32, new: f32 } {
- if (now.resting() or now.registerAge(i) != 0) return .{ .old = 1, .new = 1 };
- const since = now.since(.cpu, strikeDelay(now, i));
+ if (now.registerAge(i) != 0) return .{ .old = 1, .new = 1 };
+ if (now.resting()) return .{ .old = 0, .new = 1 };
+ const since = linkSince(now, i);
if (!now.walking()) return if (since >= 0) .{ .old = 0, .new = 1 } else .{ .old = 1, .new = 0 };
const l = time.link;
const arrives = l.after + linkTime(if (target == .slot) .slot else .node);
@@ -221,7 +231,7 @@ pub const Ties = struct {
const y = if (words < 0) w.top else w.top + @as(f32, @floatFromInt(w.slots - 1)) * w.row;
break :edge [4]f32{ w.x, y, w.x + 10 * k, y + w.row };
};
- const since = now.since(.cpu, strikeDelay(now, i));
+ const since = linkSince(now, i);
const l = time.link;
const drawn = cursors.standard(std.math.clamp((since - l.after) / linkTime(if (node != null) .node else .slot), 0, 1));
const back = std.math.clamp((now.time - now.plan.advance) / l.out, 0, 1);