summaryrefslogtreecommitdiff
path: root/anim/scenes/zoom.zig
diff options
context:
space:
mode:
Diffstat (limited to 'anim/scenes/zoom.zig')
-rw-r--r--anim/scenes/zoom.zig9
1 files changed, 6 insertions, 3 deletions
diff --git a/anim/scenes/zoom.zig b/anim/scenes/zoom.zig
index 5ea2346..ee24e7d 100644
--- a/anim/scenes/zoom.zig
+++ b/anim/scenes/zoom.zig
@@ -18,7 +18,6 @@ pub const scene = anim.Live(frame, struct {});
fn frame(s: *anim.Frame) void {
const rec = canim.open(recordings.steps);
- const t = canim.theme.time;
// fib(5), about to run line 6: `return fib(n-1) + fib(n-2);`. Its first call is fib(4).
const call = rec.call("fib", 1);
var at = canim.cursor(s, rec, rec.lineMoment(6, rec.call("fib", 0).enter));
@@ -40,11 +39,15 @@ fn frame(s: *anim.Frame) void {
says.line(s, "`call` writes eight bytes on the stack: the way back.\nThe new frame saves `rbp` under them, then its own `n`.");
// Nearer, for the bytes: the stack alone, twice the size.
cam.go(s, split.stack, 2, .{ ctx.source, ctx.disasm, ctx.registers, ctx.backtrace });
+ // Under the camera the stack holds still: six free words above rsp for the new frame.
+ ctx.stage.holdStack(s, at.moment(s), 6);
at.walk(s, .moment, call.enter + 4);
+ s.wait(canim.theme.time.beat);
+ ctx.stage.releaseStack(s);
cam.back(s, .{ ctx.source, ctx.disasm, ctx.registers, ctx.backtrace });
- says.line(s, "Eleven instructions and three words of stack later\n`fib(4)` begins: the same lines, one call deeper.");
+ says.line(s, "Nine instructions and three words of stack later\n`fib(4)` begins: the same lines, one call deeper.");
at.walk(s, .line, end);
- s.wait(t.before_cut);
+ says.close(s);
cam.apply(s);
}