PROJECT // Citrine // Programs
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
lqandsqinstructions. - 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
.cbcsymsource maps for source-level stepping and live register examination.