cat projects/programs/citrine.html SOL.VIN JOURNAL v1.47-prod [ MFET2 ]

PROJECT // Citrine // Programs

Citrine

2026-10-02

PlayStation 2 virtual machine, game engine, and CLI development toolchain written in Crystal.

Citrine is a specialized PlayStation 2 game engine, custom bytecode virtual machine, and CLI toolchain authored in Crystal.

Architecture:

  • 128-Bit QWORD Emotion Engine Architecture: VM values are 16-byte aligned tagged unions executing register copies in single CPU cycles via native MIPS lq and sq instructions.
  • 0-Cycle Cache SPRAM Pinning: 1,024 VM virtual registers are pinned directly into the PS2's 16KB Scratchpad RAM (0x70000000), completely bypassing CPU data-cache thrashing.
  • Zero-GC Determinism: Tiered zero-garbage-collector memory architecture using per-frame bump arenas (reset every Citrine.end_drawing) and level arenas for locked 60 FPS gameplay.
  • Hardware Budget Checker: Statically audits SPRAM register allocations and GS 4MB eDRAM texture footprints during compilation.
  • Built-In Crash Screen (PS2 BSOD): Renders an immediate styled diagnostic screen on-console displaying Crystal source files, lines, and SPRAM register states.
  • cradare2 Remote Debugging: Connects to PCSX2's GDB stub with .cbcsym source maps for source-level stepping and live register examination.
SKILLS USED:
Crystal PlayStation 2 Reverse Engineering radare2 Game Engine Development