HeadlinesBriefing favicon HeadlinesBriefing.com

RISC‑V emulator rvcore gets DOOM running

Hacker News •
×

Developer Lalit Shankarch released rvcore, a single‑core RISC‑V emulator that can run the classic DOOM engine. The emulator implements the RV32IM instruction set, omitting only FENCE and EBREAK, and provides a minimal syscall layer built on newlib. A short YouTube demo shows the game rendering inside the virtual machine.

To execute C programs, Shankarch integrated newlib and added ELF loading support, though currently only a single PT_LOAD segment is handled. He crafted a tiny linker script that forces the entry point to _start and forces virtual addresses to zero, simplifying loader logic. Input events are queued in memory and consumed by DOOM via the emulator.

The build chain relies on CMake, a C++20‑compatible compiler, and SDL3 libraries. On Windows, Cygwin is required; Linux users need libsdl3‑dev. Shankarch also forked doomgeneric, a lightweight DOOM port, and compiled it with a riscv64‑unknown‑elf‑gcc toolchain configured for rv32im‑ilp32. The resulting binary runs in the emulator's memory layout, mapping VRAM at 0x705FDD and using a fixed stack region.

Running DOOM on a pure software RISC‑V core demonstrates that the ISA is mature enough for complex graphics workloads without hardware acceleration. It also provides a practical testbed for developers experimenting with newlib syscalls, ELF handling, and custom linker scripts, making RV32IM emulation more accessible for hobbyists.