hn.today

A custom virtual machine for the Stars 4X game

nullprogram.com4 points0 comments
Screenshot of A custom virtual machine for the Stars 4X game

STARS!VM is a custom virtual machine that embeds an 80286 emulator and a Win16-to-Win32 compatibility bridge to run the 1995 4X game Stars! as a native Win32 program on modern Windows. Signed releases on GitHub ship a single compressed EXE containing the original 16-bit game, providing a modern file chooser, 4k scaling, correct taskbar and filesystem behavior, and neutralized copy protection. The bridge maps 16-bit handles to host handles, translates struct layouts, services DOS interrupts, and copies data between guest memory and the host, making the experience indistinguishable from a genuine port while remaining a contained, ready-to-play executable (32-bit builds requiring SSE2).

The emulator executes x87 floating-point operations on host hardware and is validated with a differential fuzzer. It exposes a Model Context Protocol (MCP) so external agents can inspect and drive the UI; an AI (Opus 5) played a full game via MCP. Performance work targeted turn generation: traces identified hot routines, which were reverse-engineered with Fable 5.1, reimplemented in C, and injected as new 80286 instructions for ~2x speedup; I/O is buffered and WaveMix.dll interfaces are implemented natively. A custom LZ compressor halves the embedded game size to ~1.5MB, and the VM injects a fixed serial and hardware signature to avoid copy-protection penalties. Source builds use w64devkit, and the project is positioned to enable easy modding.

Read on nullprogram.com0 comments on Hacker News

Summary generated by AI from the linked article. hn.today is not affiliated with Hacker News or Y Combinator.

More in Other

The daily digest

Today's best Hacker News stories, summarized and screenshotted, one email a day.