Color Graphics Implementation Plan: VMEbus, Univision UDC-3400 & Symbolics FrameThrower
Status: Future / Proposed Design Plan (Tier 2) — Not yet implemented. Depends on the shared Merlin-II VMEbus & VIC068 bridge in
docs/vme-bus-plan.md. Seedocs/ROADMAP.mdfor overall sequencing anddocs/emulator/README.md/docs/emulator/peripherals-and-backends.mdfor the currently implemented C11 XL1200 emulator.
Target Emulator: C11 XL1200 Emulator (emu/)
Reference Sources (local-only developer assets): genera-original/sys.sct/{i-sys,color,ifep}/, docs/hardware-reference/04-merlin-ii-core-and-vmebus.md
1. Executive Summary & Strategy
Symbolics XL400 / XL1200 (Merlin-I / Merlin-II) workstations support two VMEbus color graphics subsystems in Genera 8.3:
- Univision UDC-3400 (third-party VMEbus board): Uses off-the-shelf components — three Brooktree Bt458 RAMDACs and an Intel 82786 graphics coprocessor — and has complete Lisp driver source code in Genera 8.3 (
color/univision.lisp,color/univision-82786.lisp,color/vme-color.lisp). - Symbolics FrameThrower (Photon + AVP) (Symbolics VMEbus boardset): Uses custom Symbolics graphics ASICs (Photon framebuffer/DP-ALU/ASQ/VDP + AVP video processor) driven by compiled Ivory binaries (
color/framethrower/*.ibin) and a 1.87 MB proprietary microcode blob (microload-74.ibin), plus an IFEP boot-time sync profile (ifep/i328-framethrower.sync.~1~).
Recommended Order of Implementation
- Prerequisite — Shared Merlin-II VMEbus & VIC068 Bridge: Implemented once via
docs/vme-bus-plan.md(emu/src/vme_bus.c,VmeDeviceOpsregistry,IVORY_CORE_ABI_VERSION = 5U), shared cleanly withdocs/genera-pv.mdusing disjoint VME A32 slots. - Phase 2 — Host SDL3 Secondary Display,
microuiUI, Snapshot & Debug Infrastructure (shared presentation/inspection layer). - Phase 3 — Univision UDC-3400 (fastest path to working 8-bit/24-bit/32-bit Genera Color System + overlays, with full Lisp source truth).
- Phase 4 — FrameThrower (Photon + AVP) (staged: first IFEP
.sync+framethrower-ccu-consoledirect mode, then Genera direct-framebuffer mode, then optional HLE of the*MAIN-QUEUE*/PUSH-FRAMEcommand queue).
2. Core Emulator & ABI Invariants
All changes must preserve the invariants in emu/AGENTS.md and docs/vme-bus-plan.md:
- Frozen hot-reload struct sizes:
sizeof(IvoryCpu) == 4096Usizeof(MerlinBoard) == 278528Usizeof(IvoryMem) == 32768U- Both Univision (
0x9000_0000) and FrameThrower attach asVmeDeviceOpscards on the sharedVmeBus *vmepointer defined indocs/vme-bus-plan.md— requiring zero additional_reservedslots inMerlinBoard.
- Zero writable
.data/.bssinemu/build/obj/core/*.o(verified viareadelf -WS). - Zero SDL dependencies in
libivory_core.so: The core renders active color scanout into a caller-provided RGBA8888 buffer throughIvoryCoreApiv5 (vme_get_display_info/vme_render_rgba). - Strict reference provenance: Derive all register addresses, bitfields, and semantics exclusively from
genera-original/sys.sct/,I_Machine/, anddocs/hardware-reference/.
3. Phase 1: Merlin-II VMEbus & VIC068 Bridge (Shared Foundation)
Extracted Specification: The shared Merlin-II VMEbus & VIC068 bridge (
emu/src/vme_bus.c,VmeDeviceOpsregistry, polled0x88000040..0x88000140access, directPMA >= 0xC0000000window with all 4 shuffle modes, VIC068BESR.VME-BERR#x20latching on unmapped probes, and VME IRQ1–7 / IACK routing) is specified indocs/vme-bus-plan.md. Univision (0x9000_0000) and FrameThrower register directly onto that shared bus alongsideIVPV(0x1000_0000).
4. Phase 2: Host SDL3 Multi-Screen, microui UI, CLI, Snapshot & Debug Support
4.1 Display Architecture (emu/src/sdl_console.c, emu/src/ui_workbench.c, emu/src/main.c)
- Dual-head by default when a color board is attached:
- Window 1: Existing XL1200 monochrome B&W console (
1152×896full or1084×812trimmed +28 pxLED bezel +28 pxmicrouitop menu bar). - Window 2: Color Monitor window (dynamically resized from
VmeDisplayInfo, e.g.1280×1024for Univision / FrameThrower Sony CADBuffer,640×480/768×576for NTSC/PAL), rendered via anSDL_PIXELFORMAT_ARGB8888streaming texture updated at 60 Hz whendirty_seqchanges.
- Window 1: Existing XL1200 monochrome B&W console (
- Single-head primary-console mode (for FrameThrower CCU boot without B&W monitor): Optional flag
--color-primarysuppresses the B&W window and routes keyboard/mouse events from the Color window to the XL1200 SLB console. - Workbench UI & Config Integration (
ui_workbench.c,emu_script.c):Machine Setup→Firmware & Memory(orViewmenu): Color board selector (None/Univision UDC-3400/FrameThrower) persisted in(define-machine :color ...), plusView -> Show Color Monitorwindow toggle.Bug Dump(bug_report.c): Automatically includescolor-screen.ppmin the diagnostic.zipwhen a color board is active;Video Recordingcan optionally select the color head as capture target.
- CLI options in
main.c:--color univision[:<hex_base>](default base0x90000000)--color framethrower[:<hex_base>](default base perprobe.ibin)--color-headless(attach VME board without opening an SDL3 window — for automated tests)
4.2 IvoryCoreApi Additions (IVORY_CORE_ABI_VERSION = 5U, shared with docs/vme-bus-plan.md)
Add clean, opaque VME/color hooks to emu/include/ivory_core_api.h:
vme_attach_univision(MerlinBoard *board, uint32_t base_addr)vme_attach_framethrower(MerlinBoard *board, uint32_t base_addr)vme_get_color_display_info(const MerlinBoard *board, uint32_t head_idx, VmeDisplayInfo *out)vme_render_color_rgba(MerlinBoard *board, uint32_t head_idx, uint32_t *rgba_out, uint32_t max_pixels)
4.3 Debug & Snapshot Integration
debug_ctl.c/scripts/xl1200-ctl.sh:color-status: Prints attached VME color board(s), base address, resolution, bpp, LUT/overlay mode, active dirty/write counters, and 82786/ASQ status.dump-color-ppm <path>: Dumps the current composited RGB24 color screen to a PPM image for headless visual verification.
snapshot.c:- Add an optional tagged chunk (
SNAP_CHUNK_VME_COLOR) storing board type, base address, register state, RAMDAC LUTs, overlay planes, and compressed/dirty-tracked color VRAM pages.
- Add an optional tagged chunk (
5. Phase 3: Univision UDC-3400 VMEbus Color Board
Primary Sources (local-only Genera 8.3 tree):
genera-original/sys.sct/color/univision.lisp.~249~genera-original/sys.sct/color/univision-82786.lisp.~194~genera-original/sys.sct/color/vme-color.lisp.~130~genera-original/sys.sct/i-sys/console.lisp(lines 449–558)
5.1 New Module: emu/src/vme_univision.c
A. Memory Map (16 MB VME A32 Window, Default Base 0x90000000)
| Byte Offset | Size | Hardware Block |
|---|---|---|
+0x000000 | 4 B | Status Register: <31:16> Board ID = 0xC000, <9> VBLANK (set during vertical retrace; write 1 to clear), <8> 786_RESET, <5> VIDEO_ENB, <2> INT, <1> INT_ENB |
+0x000004 | 4 B | Interrupt Vector Register |
+0x000008 | 4 B | Control Register: <15:12> BUFFER_SELECT, <10> XMODE (1 = 8-bit indexed / plane-selected, 0 = 24/32-bit truecolor), <7:4> ZOOM, <3> BURST, <1> VSB_ENB |
+0x00000C | 4 B | Plane Mask Register (32-bit write-enable mask applied to CPU writes into main framebuffer) |
+0x000100 | 16 B | Red Brooktree Bt458 RAMDAC (+0 Addr, +4 Color Palette, +8 Control Regs 0x04..0x07, +12 Overlay Palette) |
+0x000110 | 16 B | Green Brooktree Bt458 RAMDAC (same 4-register layout; also acts as :single RAMDAC in 8-bit mode) |
+0x000120 | 16 B | Blue Brooktree Bt458 RAMDAC (same 4-register layout) |
+0x000200 | 64 B | Intel 82786 Registers (+0x04 BIU Control, +0x06 Refresh, +0x08 VRAM Control, +0x0A..0x0E Priorities, +0x20 GP Opcode, +0x22/24 Link L/H, +0x26 Status, +0x28/2A PC L/H) |
+0x100000 | 256 KiB | Overlay 0 Framebuffer (1 bpp, 2048 × 1024 bit-addressed) |
+0x140000 | 256 KiB | Overlay 1 Framebuffer (1 bpp, 2048 × 1024 bit-addressed) |
+0x180000 | 512 KiB | 82786 Display List SRAM (accessed by Genera with logxor index 1 halfword permutation) |
+0x800000 | 8 MiB | Main Framebuffer (2048 × 1024 pixels × 32 bpp; active visible area 1280 × 1024; supports 8-bit, 24-bit, and 32-bit modes) |
B. Milestone 3a: Direct Framebuffer, Bt458 RAMDACs & Compositor
- Board Detection & Setup:
- Return
0xC0000000 | status_lowat+0x000000sofind-univision-controllersdetects the board at0x90000000. - Implement
plane-mask(+0x00000C) gating on main framebuffer writes, and ensure the0x59595959valid-byte-maskprobe (univision.lisp:390-401) reports all 4 bytes valid (useful-bits-per-pixel = 32, configurable to 24 or 8 if desired). - Advance a 60 Hz (
16,667 µs) vertical retrace timer intick(): latchstatus-vblank(<9>) so:get-vertical-sync-with-timeoutsucceeds immediately without spinning to timeout.
- Return
- Three Brooktree Bt458 RAMDACs:
- Each Bt458 maintains: 8-bit auto-incrementing address register, 256×8 main LUT, 4×8 overlay LUT, and control registers (
0x04Read Mask,0x05Blink Mask,0x06Command Register — overlay enable bits<1:0>and RAM enable,0x07Test). - Auto-increment semantics: writing/reading palette or overlay registers cycles R→G→B or single-channel per Bt458 datasheet and
univision.lisp:705-765.
- Each Bt458 maintains: 8-bit auto-incrementing address register, 256×8 main LUT, 4×8 overlay LUT, and control registers (
- Scanout Compositor (
render_rgba):- Reads visible
1280 × 1024(withx-pan,y-pan,x-zoom,y-zoom,y-wrapfrom 82786/control state) from the2048 × 1024framebuffer:- Truecolor (
XMODE = 0): Extract R, G, B bytes from 32-bit pixel word, map through Red/Green/Blue Bt458 main LUTs. - 8-bit Indexed (
XMODE = 1): Extract byte selected byBUFFER_SELECT, map through RAMDAC LUTs (handling both 3-RAMDAC and:singlegreen-RAMDAC RGB modes). - Overlays: Combine 1-bit pixel from Overlay 0 (
bit 0) and Overlay 1 (bit 1) into 2-bit overlay indexov; if overlay is enabled in Bt458 Command Reg0x06andov != 0, substitute the Bt458 overlay palette RGB entry.
- Truecolor (
- Reads visible
C. Milestone 3b: Intel 82786 Graphics Processor (GP) Engine
Genera's 82786-mixin (univision-82786.lisp) builds command lists in +0x180000 (mapped at 82786 internal address 0x280000, with main FB at 0x000000, overlay 0 at 0x200000, overlay 1 at 0x240000) and kicks execution by writing GOTO (%82786-opcode = 0x02) + LINK_L/H.
Implement a synchronous step/drain interpreter for the Intel 82786 GP opcodes in %82786-opcodes (univision-82786.lisp:279-326):
- Control & Registers:
NOOP(0x03),GOTO(0x02),CALL(0x0F),RETURN(0x17),GENERATE_INTERRUPT(0x0E),LOAD_REGISTER(0x34),DUMP_REGISTER(0x29),ENTER_PICK/EXIT_PICK(0x44/0x45), HALT bit handling (STATUS#o200POLLset when halted). - State Setup:
DEFINE_BITMAP(0x1A),DEFINE_CLIP_RECTANGLE(0x46),DEFINE_COLORS(0x3D),DEFINE_MASK_AND_BOOLEAN(0x41),DEFINE_TEXTURE_OPAQUE/TRANSPARENT(0x06/0x07),DEFINE_CHAR_SET_WORD/BYTE_MODE(0x0A/0x0B),DEFINE_CHAR_ORIENTATION(0x4E),DEFINE_CHARACTER_SPACE(0x4D),MOVE(0x4F),RELATIVE_MOVE(0x52). - Drawing Primitives:
DRAW_POINT(0x53),DRAW_INCREMENTAL_POINTS(0xB4),DRAW_LINE(0x54),DRAW_RECTANGLE(0x58),DRAW_POLYGON(0x73),DRAW_POLYLINE(0x74),DRAW_CIRCLE(0x8E),ARC_EXCLUSION/INCLUSION(0x68/0x69),SCAN_LINES(0xBA),BITBLT_WITHIN_BITMAP(0x64),BITBLT_BETWEEN_BITMAPS(0xAE),DRAW_STRING/DRAW_STRING_OPAQUE(0xA7/0xA6). - Symbolics Custom Halt Opcodes (
univision-82786.lisp:320-325):0xFF(set-plane-enable),0xFE(data-block),0xFD(stack-underflow) — must halt withPOLL(#o200) +ILL_OP(#o100) cleanly so Genera's Lisp driver intercepts and services them as designed. - Note on
set-fast-page-ptiming test (univision.lisp:307-350): Genera benchmarksBITBLTviatime:fixnum-microsecond-time(< 0.425 µs/pixelenables fast-page mode). Synchronous host execution completes fast enough to pass cleanly without division-by-zero (ensurefin2 > start2or realistic microsecond accounting).
6. Phase 4: Symbolics FrameThrower (Photon + AVP)
Primary Sources (local-only Genera 8.3 tree):
genera-original/sys.sct/i-sys/console.lisp(lines 564–720,framethrower-ccu-console)genera-original/sys.sct/color/photon.lisp.~119~(photon-fb-mixin)genera-original/sys.sct/ifep/i328-framethrower.sync.~1~genera-original/sys.sct/color/framethrower/sync/*.lisp*- Compiled
.ibindrivers ingenera-original/sys.sct/color/framethrower/(probe.ibin,hardware-definitions.ibin,photon-hardware.ibin,photon-operations.ibin,avp-hardware.ibin,video.ibin,command-queue.ibin,initialization.ibin) — to be disassembled cleanly via Genera's owndisassembleor nativeemu/inspection tooling before coding.
6.1 Architectural Analysis & Risk Mitigation
FrameThrower is a multi-board VMEbus graphics system (1–4 Photon framebuffer/ALU boards + 1 AVP video processor board):
- Photon board contains: VMEbus interface & ID PROM, 32-bit VRAM (plane mode + pixel mode + component mode), 4×
DP-ALUdatapath ALUs,VDPvideo datapath,RAMDAC-CONTROL-0..3(4-channel palette/control),MICROCODE-BANK-0/1(dual-bank 32-bit sync microcode SRAM), and the ASQ (Address/Microcode Sequencer) that executesmicroload-74.ibin(1.87 MB). - AVP board contains:
SYNC-SEQUENCER-BANK-0/1(Am2910-based video sync microsequencer),VIDEO-PROCESSOR-ADDRESS/DATA/COMMAND,MAIN-CONTROL,AVP-CONTROL,ID-PROM.
Because microload-74.ibin is undocumented proprietary microcode for custom Symbolics ASICs, full low-level emulation (LLE) of the ASQ microengine is high-risk and unnecessary for initial color bring-up. Instead, implement FrameThrower in three incremental milestones:
6.2 Milestone 4a: Static Disassembly & Direct Console Bring-Up (framethrower-ccu-console)
- Reverse-engineer register map from Genera
.ibins (one-time research step using Genera's disassembler oremu/inspection tooling):- Extract exact VME base addresses, ID PROM layout, and
PROBE-SYSTEM-SLOTSsignature fromprobe.ibin,hardware-definitions.ibin,photon-hardware.ibin, andavp-hardware.ibin. - Document the resulting register map in
docs/hardware-reference/07-vme-color-graphics.md.
- Extract exact VME base addresses, ID PROM layout, and
- Implement
emu/src/vme_framethrower.c(Base Layer):- Photon ID PROM + VME slot probe response.
- Direct plane-mode framebuffer (
#o41001000word offset = mode register,#o13 | (1<<8)= 1-bit plane mode, as used byset-framethrower-parametersini-sys/console.lisp:645-688). - Photon RAMDAC indirect interface (
#o41001540index,+1map/bank select,+2control register write,+324-bit palette entry write). - Dual-bank 32-bit sync microcode RAM (
MICROCODE-BANK-0/1) soi328-kernel.fepcan loadi328-framethrower.sync.~1~(Sony 1280×1024 CADBuffer, 358+60 words per bank) without error and initialize FrameThrower as the primary cold-load console.
6.3 Milestone 4b: Genera Color System Direct-Drawing Mode (remote-drawing-enabled = nil)
- Implement Photon
DISPLAY-MEMORY-CONFIGURATION,VIDEO-CONFIGURATION,VIDEO-BACKTIMING,DP-CONFIGURATION(pixel/component/plane addressing modes, plane mask, fill data 0/1), andRAMDAC-CONTROL-0..3. - Support 8-bit indexed and 24/32-bit direct RGB VRAM scanout at
1280×1024(Sony CADBuffer) plus NTSC/PAL/HDTV resolutions defined incolor/framethrower/sync/*.lisp. - Implement vertical-sync status / interrupt so
console-wait-for-vertical-syncand Genera's color map updates work cleanly. - With
remote-drawing-enabledset tonilinphoton-fb-mixin(photon.lisp:162), Genera falls back to Ivory CPU drawing directly into VME VRAM — giving a complete, authentic 24/32-bit FrameThrower color display without needing ASQ microcode execution.
6.4 Milestone 4c: Command Queue Acceleration (HLE vs LLE)
- Inspect
command-queue.ibinandinterface-routines.ibin(*MAIN-QUEUE*,*VERTICAL-QUEUE*,*BIT-QUEUE*,PUSH-FRAME) to catalog the command opcodes sent from Lisp to the ASQ. - Recommended approach — Command-Queue HLE:
- Accept microcode downloads into
MICROCODE-BANK-0/1/ ASQ RAM without faulting. - When Genera writes a new queued frame pointer to
ASQ-COMMUNICATION/*MAIN-QUEUE*, intercept the command packet in C, execute the requested operation (BITBLT, rectangle fill, line, font glyph, sync/RAMDAC register update, return-value writeback) directly on Photon VRAM, and advance the queue consumer pointer / signal completion. - This unlocks full
remote-drawing-enabled = tperformance without needing to reverse-engineer 1.87 MB of custom ASIC microcode.
- Accept microcode downloads into
- AVP (Optional): Stub AVP ID PROM +
SYNC-SEQUENCER-BANK-0/1+AVP-CONTROLsoft::probe-system-slotscan optionally report an AVP board if needed by video/genlock diagnostics.
7. Verification & Acceptance Criteria
7.1 Automated Unit Tests (emu/tests/test_vme_color.c)
- VMEbus: Direct window
0xC0000000..0xFFFFFFFFaddress calculation, all 4 shuffle modes, polled 8/16/32-bit reads & writes, unmapped address VME-BERR latching invic-bus-error-status. - Univision: Board ID
#xC000probe,0x59595959byte-mask test, plane-mask write gating, Bt458 auto-increment LUT & overlay compositing, 82786 GP command-list execution (DEFINE_BITMAP,DRAW_RECTANGLE,DRAW_LINE,BITBLT_WITHIN_BITMAP,BITBLT_BETWEEN_BITMAPS, custom halt opcodes#xFF/#xFE). - FrameThrower: ID-PROM probe, RAMDAC indirect palette writes (
#o41001540), plane-mode register (#o41001000), loadingi328-framethrower.sync.~1~into dual microcode banks, 1-bit & 32-bit RGBA scanout verification.
7.2 End-to-End Genera 8.3 Verification
- Univision E2E:
- Boot Genera 8.3 with
--color univision. - Evaluate
(color:find-univision-controllers)→ detects(:univision #x90000000 nil). - Create an 8-bit and 32-bit color screen (
color:make-color-screen), draw primitives and windows, verify viadump-color-ppmand interactive SDL3 Color window. - Test both
remote-drawing-enabled = nil(CPU direct) andt(82786 GP accelerated).
- Boot Genera 8.3 with
- FrameThrower E2E:
- Install
i328-framethrower.sync.~1~on FEP disk (Install Color Startup File), cold-boot with--color framethrower, and verify IFEP initializes the Sony 1280×1024 display and renders the cold-load stream. - Boot Genera 8.3, verify
framethrower-ccu-consoleandcolor:find-photon-controllers, draw color graphics, and verify viadump-color-ppm.
- Install
7.3 Build & ABI Hygiene Gates
After every phase:
make -C emu clean all test test-e2e
readelf -WS emu/build/obj/core/*.o | awk '$2==".data" || $2==".bss" { if ($6 != "000000") exit 1 }'
- Confirm
sizeof(IvoryCpu) == 4096,sizeof(MerlinBoard) == 278528,sizeof(IvoryMem) == 32768. - Confirm
libivory_core.soexports onlyivory_core_get_apiand has zerolibSDL3linkage (ldd emu/build/libivory_core.so).
8. File Impact Summary
| File | Action | Purpose |
|---|---|---|
emu/include/ivory_hw.h | Edit | Merlin-II VME/VIC068 register offsets, Univision & FrameThrower hardware constants |
emu/include/ivory_emu.h | Edit | VmeBus *vme in MerlinBoard (using 1 _reserved slot), VmeDisplayInfo |
emu/include/ivory_core_api.h | Edit | Bump IVORY_CORE_ABI_VERSION to 5U, add VME attach & color scanout API |
emu/src/vme_bus.c | New | Merlin-II VMEbus bridge (direct window, polled access, shuffle, VIC068 BERR/IRQ) |
emu/src/vme_univision.c | New | Univision UDC-3400 (registers, 3× Bt458 RAMDACs, overlays, Intel 82786 GP engine) |
emu/src/vme_framethrower.c | New | Symbolics FrameThrower (Photon ID PROM, RAMDAC, sync banks, VRAM, HLE queue) |
emu/src/merlin.c, mem.c | Edit | Route VIC068 polled registers and PMA >= 0xC0000000 direct VME window to vme_bus.c |
emu/src/sdl_console.c, ui_workbench.c, main.c | Edit | Secondary SDL3 color display window, microui UI toggles, --color CLI flags |
emu/src/debug_ctl.c, bug_report.c, snapshot.c | Edit | color-status, dump-color-ppm, color-screen.ppm in bug dumps, and SNAP_CHUNK_VME_COLOR |
emu/tests/test_vme_color.c | New | Unit tests for VMEbus, Univision, and FrameThrower |
docs/hardware-reference/07-vme-color-graphics.md | New | Register reference for VMEbus, UDC-3400, and disassembled FrameThrower .ibins |
- Brooktree Bt458 —
brooktree_1989_product_databook_Bt458.pdf(mirror) - VTC / Cypress VIC068A —
cypress_VIC068A_VAC068A_users_guide.pdf(mirror) - Intel 82786 —
intel_82786_preliminary_datasheet_1986.pdf(mirror) - Intel 82786 —
intel_82786_users_manual.pdf(mirror)