diff options
| author | Gabriel Schneider <[email protected]> | 2026-11-11 14:17:43 -0300 |
|---|---|---|
| committer | Gabriel Schneider <[email protected]> | 2026-11-11 14:17:51 -0300 |
| commit | 4862e778af7779bbdb047b9c71adfb62add319b2 (patch) | |
| tree | 669715d535fe1a381adf95e053ba6a2986039de9 /design/mock/context.py | |
| parent | 5941372c6c153ad595236193e61ea027a40a9950 (diff) | |
| download | computeranim-4862e778af7779bbdb047b9c71adfb62add319b2.tar.gz computeranim-4862e778af7779bbdb047b9c71adfb62add319b2.zip | |
design: the disassembly stays under the source; the graph as a track
From the user, on the sort render. Registers a scene never changes fold
three to a row, so the stack is twelve to fifteen slots and the
disassembly keeps its place under the source with eleven to seventeen
rows; a blocks lens has no view. The graph leaves the layered picture of
the reverse-engineering tools: blocks are pills on one line in the order
they run, a loop an arch over its blocks with the turn count at its
centre, every bend a quarter circle; sort's eleven blocks and both loops
are seen whole across the band. Sheets 42 and 43 set the layouts and the
graph's forms side by side.
Co-Authored-By: Claude Fable 5.2 <[email protected]>
Claude-Session: https://claude.ai/code/session_016Y9MNCKgYCGiANnEwcEQxa
Diffstat (limited to 'design/mock/context.py')
| -rw-r--r-- | design/mock/context.py | 34 |
1 files changed, 31 insertions, 3 deletions
diff --git a/design/mock/context.py b/design/mock/context.py index 31a54f6..b35abd5 100644 --- a/design/mock/context.py +++ b/design/mock/context.py @@ -301,12 +301,40 @@ def bracket(g, x, y0, y1, ink, sw=2, serif=5, side=1): # ---- the state column --------------------------------------------------------------- -def registers(g, y, regs, flags, marks): +QUIET_PITCH = 285 # a quiet register's cell: three to a row + + +def reg_rows(quiet): + """The registers panel's rows: one a register the scene moves (and rsp, rbp, rip), a row of three the rest.""" + return 17 - len(quiet) + (len(quiet) + 2) // 3 + + +def registers(g, y, regs, flags, marks, quiet=()): + """quiet: the registers no step of the scene changes, folded three to a row over rip: each its name and its + value in its ink, a pointer's chain cut to `more` at once (the map has it whole).""" legend = [("stack", STACK, False), ("heap", HEAP, False), ("code", CODE, False), ("data", DATA, False), ("rwx", DATA, True), ("read-only", VELLUM, False)] - y0 = panel(g, RX, y, CW, 17, "registers", note=legend) + y0 = panel(g, RX, y, CW, reg_rows(quiet), "registers", note=legend) where = {} - for i, (name, links, end) in enumerate(regs): + full = [r for r in regs if r[0] not in quiet] + if quiet: + qy = y0 + (len(full) - 1) * ROW + g.rect(RX + 2, qy, CW - 4, 2, RULE) + for k, (name, links, end) in enumerate(r for r in regs if r[0] in quiet): + xx, yy = RX + 12 + (k % 3) * QUIET_PITCH, qy + (k // 3) * ROW + where[name] = yy + g.t(xx, b(yy), name, S, FAINT, MONO) + if links: + x = addr(g, xx + 48, yy, links[0][0], links[0][1]) + if len(links) > 1 or end is not None: + more(g, x, yy) + else: + integer(g, xx + 48, yy, end[1]) + full = full[:-1] + [None] * ((len(quiet) + 2) // 3) + full[-1:] + for i, r in enumerate(full): + if r is None: + continue + name, links, end = r yy = y0 + i * ROW if name == "rip": g.t(RX + 12, b(yy), name, S, current_row(g, RX + 2, yy, CW - 4, 54), BOLD) |
