diff options
| author | Gabriel Schneider <[email protected]> | 2026-11-10 15:17:21 -0300 |
|---|---|---|
| committer | Gabriel Schneider <[email protected]> | 2026-11-10 15:20:24 -0300 |
| commit | 6fb92d5384ba944b2d6a9c5066a08b41a8ef555f (patch) | |
| tree | f8854c4272879c5fb54b7fd0e7c2f0e0b8ab904a /design/mock/gen.py | |
| parent | 2463e602f12f969fe085bc2114a3960411b79f87 (diff) | |
| download | computeranim-6fb92d5384ba944b2d6a9c5066a08b41a8ef555f.tar.gz computeranim-6fb92d5384ba944b2d6a9c5066a08b41a8ef555f.zip | |
design: a language of named blocks; the lens as a band over the whole context
The README is now the catalogue: atoms, rows, panels, ties, the frame and
the verbs, each block specified once under the name the code uses, with
rules of composition and what is forbidden. From the user's notes on the
context mocks: a lens is a band across the top, its drawing on the left
and the bytes it is drawn from on the right, a hexdump with each field's
bytes marked and read at the row's end; the disassembly is seventeen rows
in address order with a source-line column and an annotation for what
each row read, set or jumped to; a register is pinned to the node it
points at by name; hex is unbroken; and four kinds of tie say which pane
is a view of which (thread, link, projection, echo).
Diffstat (limited to 'design/mock/gen.py')
| -rw-r--r-- | design/mock/gen.py | 12 |
1 files changed, 6 insertions, 6 deletions
diff --git a/design/mock/gen.py b/design/mock/gen.py index afd7a5a..f7c62f3 100644 --- a/design/mock/gen.py +++ b/design/mock/gen.py @@ -288,7 +288,7 @@ def elide(g, x, y, label="", h=24): # ---- numbers -------------------------------------------------------------- def hexw(n, size=DATA_SIZE): adv = round(ADV * size) - return n * adv + (n // 4 - 1) * round(adv / 2) + return n * adv def region(digits): @@ -302,7 +302,7 @@ def region(digits): def hexgroups(g, x, y, digits, size=DATA_SIZE, lead=FAINT, fill=None, font="mono", right=False, all_fill=None): - """Hex in fours, half an advance apart; leading zeros in `lead`; a pointer in its region's ink.""" + """Hex, unbroken; leading zeros in `lead`; a pointer in its region's ink.""" fill = fill or region(digits) or VELLUM adv = round(ADV * size) if right: @@ -313,7 +313,7 @@ def hexgroups(g, x, y, digits, size=DATA_SIZE, lead=FAINT, fill=None, font="mono for i in range(0, len(digits), 4): for k in range(i, min(i + 4, len(digits))): g.t(x + (k - i) * adv, y, digits[k], size, all_fill or (lead if k < nz else fill), font) - x += 4 * adv + round(adv / 2) + x += 4 * adv def address(g, x, y, addr, h=CELL - 2, digits=12): @@ -322,7 +322,7 @@ def address(g, x, y, addr, h=CELL - 2, digits=12): a = ("%012x" % addr)[12 - digits:] n = digits // 4 for i in range(n): - g.t(x + i * (4 * 15 + 8), base(y, h, SM), a[4 * i:4 * i + 4], SM, VELLUM if i == n - 1 else FAINT, "mono") + g.t(x + i * 4 * 15, base(y, h, SM), a[4 * i:4 * i + 4], SM, VELLUM if i == n - 1 else FAINT, "mono") # ---- cells ---------------------------------------------------------------- @@ -994,7 +994,7 @@ def frame5(): ("rbp", "00007ffd3a2c1e60", "plain"), ]) - mx_, my_, mw_, mh_ = panel(g, colx(5), STAGE_Y, span(7), STAGE_H, "stack", focus=True, right="from 7ffd 3a2c 1e30 · low addresses on top") + mx_, my_, mw_, mh_ = panel(g, colx(5), STAGE_Y, span(7), STAGE_H, "stack", focus=True, right="from 7ffd3a2c1e30 · low addresses on top") gx = mx_ + 112 # gutter; register marks sit left of it cx = gx + hexw(8, SM) + 52 # bytes ax = cx + 8 * CELL + 22 # as text @@ -1267,7 +1267,7 @@ def frame8(): ky = y + 16 + len(maps) * 42 + 10 g.rect(x + 2, ky, w - 4, h - (ky - y) - 2, KERNEL) km = ky + (h - (ky - y)) / 2 - g.t(gx, km + 0.36 * SM, "ffff 8000 0000", SM, PAGE, "mono") + g.t(gx, km + 0.36 * SM, "ffff80000000", SM, PAGE, "mono") g.t(nx, km + 0.36 * 28, "kernel", 28, PAGE, "sansm") g.t(nx + 130, km + 0.36 * 24, "the upper half of every address space", 24, KERNEL_DIM, "sans") |
