Show HN: Our space game has a built-in RISC-V emulator that runs Linux
The developers of the space game SEEDS built an open-source, in-house RISC-V emulator called PasRISCV that runs Alpine Linux inside the game using a hybrid JIT interpreter.
read it It offers a fascinating technical breakdown of how a custom Object Pascal RISC-V emulator boots Linux inside a game engine, complete with source links.
summary
The space game SEEDS features an in-house RISC-V emulator written in Object Pascal called PasRISCV that executes real Alpine Linux binaries. The emulator uses a hybrid interpreter and tracing JIT compiler to support RV64GC, vector extensions, and full virtual hardware including block devices, graphics framebuffers, and retro sound cards. Communication between the virtual machine and the game engine happens via Linux vsock and custom binary serialization. The developers released PasRISCV, its companion emulator, and their custom game engine as free open-source software.
key points
- PasRISCV is written in Object Pascal and uses a hybrid interpreter with a tracing JIT compiler that handles about 99% of x86-64 instructions.
- The emulated environment runs Alpine Linux, communicating with the game engine via Linux vsock and a fast binary serialization format.
- The system emulates full virtual hardware including VirtIO/PCIe storage, framebuffers for retro shader processing, and legacy FM synthesis sound cards.
who should read it
Game developers, emulator authors, and systems programmers interested in virtualization and custom in-game computing environments.
discussion warm
consensus
Commenters express high enthusiasm, comparing the project to Notch's famously abandoned space game 0x10c and celebrating the developer's demoscene background.
PasRISCV: https://github.com/BeRo1985/pasriscv
pasriscvemu: https://github.com/BeRo1985/pasriscvemu
PasVulkan: https://github.com/BeRo1985/pasvulkan
POCA https://github.com/BeRo1985/poca
BeRo of farbrausch is 1/3 of our team. :)
(edit) added a link to POCA, the scripting language, as it's relevant, too
The developer shares direct GitHub links to the open-source PasRISCV, PasVulkan, and related repositories.
Generated by an LLM from the article and thread. Check the sources before relying on it.