summaryrefslogtreecommitdiff
path: root/build.zig
diff options
context:
space:
mode:
Diffstat (limited to 'build.zig')
-rw-r--r--build.zig27
1 files changed, 27 insertions, 0 deletions
diff --git a/build.zig b/build.zig
index ed3a2e6a..07c180d3 100644
--- a/build.zig
+++ b/build.zig
@@ -362,6 +362,33 @@ pub fn build(b: *std.Build) void {
// in region l2mem, overflowed by 76036 bytes`, that being the shell's shadow copy of the grid.
opts.addOption(u16, "p4_cols", b.option(u16, "p4-cols", "board grid width in cells (p4 only)") orelse 56);
opts.addOption(u16, "p4_rows", b.option(u16, "p4-rows", "board grid height in cells (p4 only)") orelse 14);
+ // ANIMATED THEME CHANGES, off on the board because there the animation is not an animation.
+ //
+ // A theme change moves the anchored chrome palette - taglines, boxes, line numbers, scroll bars -
+ // from the old colors to the new ones over `animation.transition_steps` display frames, which is
+ // ten. On a screen that repaints in microseconds that is a short legible fade, and it is the
+ // reason the transition exists: a palette that teleports reads as a glitch.
+ //
+ // On a 115200 serial line a frame is not free. Every one of those ten steps recolors every
+ // anchored cell, so the shell's diff finds the whole chrome dirty and spends a frame's worth of
+ // wire on it, ten times over, with nothing else to look at in between. Measured on the die, one
+ // `NextColor`:
+ //
+ // fade on 12,593 bytes 1,097 ms of saturated wire
+ // fade off 2,425 bytes 215 ms
+ //
+ // A second of the editor talking to itself about a color, on the one transport where a second is
+ // noticeable, for a gradient nobody can see arrive gradually at 11.5 KB/s.
+ //
+ // COMPTIME, not a runtime flag: `pardes.ChromeAnimation` selects `animation.Immediate` over
+ // `animation.Transition`, which leaves `ChromeTheme.interpolate` unreachable and out of the image
+ // (2,336 bytes of it). A bool tested at runtime would have kept every one of those bytes.
+ //
+ // A build option rather than a platform test, because "is a frame expensive" is a property of the
+ // transport and not of the target: a P4 driven over something faster than a UART would want it on,
+ // and it is off here only as the default that matches the wire this port actually has.
+ opts.addOption(bool, "theme_animation", b.option(bool, "theme-animation", "animate chrome colors across a theme change (default: off for p4)") orelse
+ (platform != .p4));
// Meaningful only for the SDL shell. Keeping the platform condition here
// prevents Config/EffectCode from describing tty/macOS/web as "prebuilt".
opts.addOption(bool, "gui_shader_sources_prebuilt", gui_shader_sources_prebuilt);