HDGL SUBSTRATE — FACE SCHEDULER
=================================
The substrate runs continuously. Programs run as FACES: concurrent projections
of the substrate, with mathematically isolated tape memory per face.

No handoff. No separate process. The substrate IS the machine.
Faces are executed one instruction per substrate tick — genuinely interleaved.

PRIVACY
  Each face's tape occupies a different 256-byte region in RAM:
    Face 0: 0xC000..0xC0FF
    Face 1: 0xC100..0xC1FF
    Face 2: 0xC200..0xC2FF
    Face 3: 0xC300..0xC3FF
  Privacy token: phi_fold(settle_genome ^ session_coord ^ face_id)
  Different session_coord each boot (derived from RDTSC) -> different token each session.
  A face cannot read or write another face's tape: the addresses are disjoint.

USB LAYOUT
  LBA 0    : MBR
  LBA 1-20 : substrate + face scheduler (stage2, 10240 bytes)
  LBA 21   : face 0 program (512 bytes max)
  LBA 22   : face 1 program
  LBA 23   : face 2 program
  LBA 24   : face 3 program

WRITING FACE PROGRAMS
  dd if=myprog.txt of=/dev/sdX bs=512 seek=21 conv=notrunc  (face 0)
  dd if=myprog.txt of=/dev/sdX bs=512 seek=22 conv=notrunc  (face 1)
  etc.

  On the image:
  dd if=myprog.txt of=hdgl_faces.img bs=512 seek=21 conv=notrunc

KEYBOARD (works while faces run — non-blocking poll)
  h    help
  f    run_fib mode (blocking, stops faces temporarily)
  p    REPL mode
  t    temple oracle
  z    summon TempleOS (phi-bridge)
  ESC  restart substrate

VERIFIED TESTS (see build.sh)
  A: No faces — substrate ticks, z key works
  B: Face 0 = 'p' — prints 0.00000000 while substrate ticks
  C: Face 0 = phi convergence — 2.0, 1.5, 1.666... interleaved with substrate
  D: Faces 0+1 simultaneously — phi + countdown, both interleaved
  E: Keyboard 'h' key during face execution — screen changes (keyboard works)
  F: Privacy — face 0 decrements, face 1 increments, no interference (saw 5,4,6)
  G: 4 faces simultaneously — phi + countdown + Hello World + tape add + 7199 ticks

INSTRUCTION SET (same as hdgl-tc, full Turing complete)
  See hdgl-tc/INSTRUCTION_SET.txt

=================================================================
COMMODORE 64 FACE  (added v3.4-C64)
=================================================================
The Commodore 64 is present in TWO complementary forms.

(1) face3_c64.txt  — C64 as a literal face
    The iconic BASIC prompt "READY." encoded in the tape instruction
    set and looped (trailing 'l'). Runs concurrently as face slot 3,
    one instruction per substrate tick, alongside the phi / count /
    hello faces. Program:
        9*+=$>8*+++++=$>8*+=$>8*++++=$>9*++++++++=$>6*++++++++++=$>l
    (builds each PETSCII byte as d*d + adjustment, stores, prints,
     advances head; verified by round-trip encoder gen_face.py)

(2) The 'c' key — interactive COMMODORE 64 BASIC V2 face
    run_c64 in stage2_faces.asm. An authentic power-on screen in the
    C64 light-blue-on-blue palette (VGA attr 0x1B):

        **** COMMODORE 64 BASIC V2 ****
        64K RAM SYSTEM  38911 BASIC BYTES FREE
        READY.

    WORKING KEYBOARD (non-blocking poll, substrate keeps ticking):
        printable keys  -> echo, uppercased (PETSCII feel)
        PRINT <x> + RET -> prints <x>, then READY.
        <other> + RET   -> ?SYNTAX ERROR, then READY.
        BACKSPACE       -> erase last char
        ESC             -> leave face, return to substrate orbit

    The live substrate genome ticks in the top-right border the whole
    time the face is up — the C64 is a projection of the running
    substrate, not a halt.

LAYOUT NOTE
    Adding run_c64 grew stage2 past the old 20-sector (10240 B) limit.
    stage2 now occupies LBA 1-24 (12288 B budget, 10457 B used);
    face programs moved to LBA 25-28. stage1_mbr_faces.asm reads 24
    sectors (EDD + CHS paths both updated).

BUILD / RUN
    bash build.sh                       # produces hdgl_faces.img
    qemu-system-i386 -drive format=raw,file=hdgl_faces.img
    # press 'c' for the Commodore 64 face
