Files
CydandClaude Fable 5 afc3fd839e Vendor dpl3-revive: the Division/DPL3 renderer, now ours
Bring the graphics-dev collaborator's dpl3-revive into the repo as first-class
project code (they've handed it off; it's ours now). This is the proven
Division renderer that our in-process rt_draw has been trying to be.

What's here:
- parser/  B2Z/V2Z/SVT/SCN/SPL/BGF/BMF/BSL decoders (pure Python).
- spec/    reverse-engineered format + the definitive VelociRender wire
           protocol (from the original DIVISION source, matches our live
           VPX node/action tables exactly).
- source-ref/  read-only copies of the original DIVISION C (BIZREAD.C,
           DPLTYPES.H, DPL.H) that define the formats.
- patha/   the "virtual VelociRender board": vrboard.py (24-action protocol
           server), vrview.py (numpy software rasterizer, the reference),
           vrview_gl.py (moderngl GPU backend, 832x512@60Hz), plus the
           run/replay/regress tooling and evidence renders. Drives FLYK/BLADE/
           Star Trek demos AND our btl4opt/rpl4opt game binaries.
- viewer/  WebGL archive generators (.py); prebuilt HTML/data regeneratable.
- samples/ small test models/textures.
- bt*.raw.bin  real BTL4OPT arena wire captures (kept for offline renderer
           testing/regression against OUR game).

.gitignore keeps the multi-hundred-MB demo capture dumps + debug logs +
regeneratable viewer bundles out of history (they stay on disk).

Phase 0 of the integration is validated: their board decodes our bt8 capture
with zero errors (3748 nodes, 507 instances, 4 mechs) and renders our arena
(terrain/dome/sky, correct Division DAC gamma). Plan + status in memory;
integration continues in emulator/RENDERER-COLLAB.md.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
2026-07-05 22:06:25 -05:00

57 lines
2.1 KiB
Python

#!/usr/bin/env python3
"""
vrcapture.py -- quiet raw capture board for the first live FLYK run.
Listens where the DOSBox-X vrlink C012 bridge connects (127.0.0.1:8620), logs every
host->board byte to capture.raw.bin (+ an annotated hex log), and replies NOTHING
(input-status stays 0). FLYK therefore streams its whole boot -- transputer .BTL, then
framed vr_860code/data/bss/args, then vr_init -- without the stock garbage-read error,
and we record the exact bytes to design the responder's boot handling against.
python vrcapture.py # listen; Ctrl-C or kill to stop
"""
import socket, sys, time
HOST, PORT = '127.0.0.1', 8620
BIN = "capture.raw.bin"
HEX = "capture.hex.log"
def main():
binf = open(BIN, "wb")
hexf = open(HEX, "w")
srv = socket.socket(socket.AF_INET, socket.SOCK_STREAM)
srv.setsockopt(socket.SOL_SOCKET, socket.SO_REUSEADDR, 1)
srv.bind((HOST, PORT)); srv.listen(1)
print(f"vrcapture listening on {HOST}:{PORT} -> {BIN} / {HEX}")
conn, addr = srv.accept()
print(f"vrlink connected from {addr}")
total = 0
last = time.time()
with conn:
conn.setblocking(True)
conn.settimeout(2.0)
while True:
try:
data = conn.recv(4096)
except ConnectionResetError:
print("(peer reset the connection -- FLYK closed/exited)")
break
except socket.timeout:
# note idle gaps -- they mark phase boundaries (BTL end / read waits)
if total:
hexf.write(f"# --- idle {time.time()-last:.1f}s at offset {total} ---\n"); hexf.flush()
continue
if not data:
break
binf.write(data); binf.flush()
# annotated hex: offset + first bytes of each chunk
head = ' '.join(f"{b:02x}" for b in data[:16])
hexf.write(f"[{total:7}] +{len(data):-5} {head}{' ...' if len(data)>16 else ''}\n")
hexf.flush()
total += len(data)
last = time.time()
print(f"connection closed; captured {total} bytes -> {BIN}")
if __name__ == '__main__':
main()