Hacker News front pageAgainst All Odds7 min readintermediate
Show HN: Our space game has a built-in RISC-V emulator that runs Linux
Summary
The post explains PasRISCV, an open‑source full‑system RISC‑V emulator written in Object Pascal that runs Alpine Linux inside the SEEDS game. It covers the hybrid interpreter/JIT, device emulation (VirtIO storage, framebuffer, audio), networking, and debugging integration.
- PasRISCV is a full‑system RV64GC emulator in Object Pascal, using an interpreter plus a tracing JIT (x86‑64 hosts) that handles ~99% of instructions.
- It boots Alpine Linux via OpenSBI → U‑Boot, exposing VirtIO block/NVMe and VirtIO‑9P/FS for disk images and host directory sharing.
- Graphics are provided through a SimpleFB framebuffer, with optional VirtIO‑GPU and experimental VirGL for 3D, enabling in‑game shader effects.
- Audio emulation includes legacy OPL2/OPL3, CMI8738, FM801, Intel HDA and VirtIO sound, allowing retro chiptune playback inside the VM.
Game developers and emulator engineers will find the design choices and integration details useful for embedding a full Linux environment in interactive applications.
6/10