From 0a2694e935fa8a79f1a399f2d2cbc643f8c3734e Mon Sep 17 00:00:00 2001 From: Gabriel Schneider Date: Tue, 29 Sep 2026 08:28:40 -0300 Subject: G13: Parallax, lapis's dots drift with the text at a quarter of its speed Parallax on|off (off, a pixel shell's; Chrome.fx bit 3). A body region carries its first line (Region.line, a file's scroll or a terminal's grid offset; the wire's region record grows a u32). The GUI offsets each body's page dots by a quarter of its line in rows, and of G6's glide offset while one runs, so the pattern drifts with the text and settles with it; the cell shader reads it from the instance's serial slot, whose per-cell dissolve noise G7 left unused (the dead noise code goes). Tests: a scrolled body tells its line; the shift handed to the shader is a quarter of it within the dots' period. Measured in a capture: four lines move the dots 13 px (140 px / 4 mod 22). Gates as before, goldens byte-identical. Feel review: .scratch/render/parallax/. --- src/detached/wire.zig | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) (limited to 'src/detached') diff --git a/src/detached/wire.zig b/src/detached/wire.zig index 3a914e42..6903a1e8 100644 --- a/src/detached/wire.zig +++ b/src/detached/wire.zig @@ -270,6 +270,7 @@ pub const Frame = struct { region.notice = try r.getByte(); region.clip = try r.getU16(); region.lift = @bitCast(try r.getU32()); + region.line = @bitCast(try r.getU32()); // A springy flavour overshoots, and a wind-up dips below. if (!(region.lift >= -1 and region.lift <= 2)) return error.BadValue; if (region.rect.x > f.cols or region.rect.w > f.cols - region.rect.x or @@ -754,7 +755,7 @@ pub fn layersBound(layers: []const pardes.Layer, tags: []const pardes.Layer, reg return n + regions.len * region_len + chrome_len; } -const region_len = 1 + 1 + 4 + 8 + 1 + 2 + 2 + 1 + 2 + 4; +const region_len = 1 + 1 + 4 + 8 + 1 + 2 + 2 + 1 + 2 + 4 + 4; /// The palette: each colour three bytes, a theme's optional ones a flag /// before them. const chrome_len = @typeInfo(pardes.Chrome).@"struct".fields.len * 4 + 8 * 4; @@ -839,6 +840,7 @@ pub fn encodeFrameLayers(out: []u8, cols: u16, rows: u16, cursor: ?Cursor, point try w.putByte(region.notice); try w.putU16(region.clip); try w.putU32(@bitCast(region.lift)); + try w.putU32(@bitCast(region.line)); } inline for (@typeInfo(pardes.Chrome).@"struct".fields) |field| { const rgb = @field(chrome, field.name); -- cgit v1.3