Files
JIANT/tools/landing_anim/patch.py
T
Claude d8b93c72af Front page: the firmware's current animations (recorded from its own drawing code)
The landing keeps its design (layout, type, colours, sections, the four languages); its pictures are now
the firmware's own, as 0.9.12 draws them:
- The nine engines: each its creature (ui_engvis.c, as HOME's BEING shows it: ANALOG's cell, FM6's colony,
  PHASE's snail, LOFI's circuit organism, VOICE's living tract, WHEEL's tube worms, NOISE's swarm, DRUM-X's
  kit of bichos, ANIMAL's bird / insect / mammal), playing a bar at the demo's 118 BPM, one card each, in
  place of the old row of 0.5 species.
- The FM-1's screen: HOME's ECO with the six tracks' beings ("Hoy con carita"), a generated song playing.
- The background: HOME's beings drifting (ported from ui_lzhome.c eco_being / eco_face, ui_being.c
  bg_outline: three isotherms in the JIANT ramp by their level, the face shutting its eyes on a hit).
- The six feature cards: the firmware's real screens (the manual's, manual/shots).

tools/landing_anim: the browser emulator's sources built for the host (a patched copy: the firmware is not
touched), each engine on track 1 playing one bar on the touch keys, every line, dot, disc and text its
creature draws recorded per frame (32 a bar, a few more for the loop's crossfade), packed into
web/landing/anim/<clip>.js (polylines in quarter pixels, simplified within 0.4 px: ~290 KB gzipped for the
ten clips, each loaded when it comes on screen). The page plays them on canvases at any size, one loop for
everything: off-screen canvases and hidden tabs do not draw; reduced motion shows a still.
The workflow publishes web/landing/anim next to the page.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01KMHk6yH4XbP1xxHYKCo9Mh
2026-10-19 02:23:50 +00:00

37 lines
2.0 KiB
Python

# SPDX-License-Identifier: GPL-3.0-only
# Copyright (C) 2026 Juan Ignacio Antonucci (Juan Jiant)
"""The copy's drawing primitives note what they draw (tools/landing_anim/capture.c's cap_*): og_line_a, og_plot
(outside a line), cv_rect, cv_text_flags. patch.py SRC_DIR"""
import sys
from pathlib import Path
src = Path(sys.argv[1])
o = src / "ui_organic.c"
s = o.read_text()
a = "static void og_line_a(int32_t x0, int32_t y0, int32_t x1, int32_t y1, uint16_t c, int32_t a)\n{"
assert s.count(a) == 1
s = s.replace(a, "static void og_line_a_raw(int32_t x0, int32_t y0, int32_t x1, int32_t y1, uint16_t c, int32_t a)\n{")
b = "static void og_line(int32_t x0, int32_t y0, int32_t x1, int32_t y1, uint16_t c)"
assert s.count(b) == 1
s = s.replace(b, "static void og_line_a(int32_t x0, int32_t y0, int32_t x1, int32_t y1, uint16_t c, int32_t a)\n"
"{ if (cap_on) cap_line(x0, y0 + cv_oy * 16, x1, y1 + cv_oy * 16, c, a); cap_inl++; og_line_a_raw(x0, y0, x1, y1, c, a); cap_inl--; }\n" + b)
p = "static inline void og_plot(int32_t x, int32_t y, uint16_t c, int32_t a)\n{"
assert s.count(p) == 1
s = s.replace(p, p + "\n if (cap_on && !cap_inl) cap_plot(x, y + cv_oy, c, a);")
n = "static void og_node(int32_t cx, int32_t cy, int32_t r, uint16_t c)\n{"
assert s.count(n) == 1
s = s.replace(n, "static void og_node_raw(int32_t cx, int32_t cy, int32_t r, uint16_t c)\n{")
lb = "static void og_label("
assert s.count(lb) == 1
s = s.replace(lb, "static void og_node(int32_t cx, int32_t cy, int32_t r, uint16_t c)\n"
"{ if (cap_on) cap_node(cx, cy + cv_oy * 16, r, c); cap_inl++; og_node_raw(cx, cy, r, c); cap_inl--; }\n" + lb)
o.write_text(s)
g = src / "gfx.c"
s = g.read_text()
r = "static void cv_rect(int32_t x, int32_t y, int32_t w, int32_t h, uint16_t c)\n{"
assert s.count(r) == 1
s = s.replace(r, r + "\n if (cap_on) cap_rect(x, y + cv_oy, w, h, c);")
t = " uint32_t flags)\n{"
assert s.count(t) == 1
s = s.replace(t, t + "\n if (cap_on) cap_text(x, y + cv_oy, f == &AF_X ? 0 : f == &AF_S ? 1 : 2, fg, s);")
g.write_text(s)