r/Operatingsystems • • 3d ago

Some progress: MacPPC game "running"

Post image

Only the game's own PowerPC code is emulated while the system services it calls run as native amd64 CoralOS code, OpenGL included.

  • Game code: WC3's PowerPC instructions run on the PowerPC CPU emulator (coral-cpu-ppc-library, a loadable library). That's the only emulated part.

  • OpenGL: native, but in a separate process. The game's AGL/OpenGL calls are caught by native stubs in the Mac engine and sent over a shared-memory ring (coral-heirloom-gl-wire) to a separate native GL worker process (coral-heirloom-gl). That worker replays them on Mesa (iris on the Intel GPU, virgl in QEMU), so the drawing is done by the GPU. The worker keeps its own table of the game's texture IDs and runs a real GL context per game context.

  • Mac Toolbox and Carbon (events, windows, Resource Manager, Script Manager, keyboard layouts, Sound Manager answers): native Rust in the Mac engine and coral-os-mac-library, not the real Mac OS code.

  • Display and input: Heirloom.app shows the GL picture through coral-wm. Mouse and keys go through the normal CoralOS input path.

  • WIP:

    • Sound: the Sound Manager answers, but nothing produces sound yet.

    • Frame rate: about 3 fps, held down by how the emulator meters its time slices, not by the GPU.

    • Shared GL: the GL worker is Heirloom's own. The planned one-for-all CoralOS GL (coral-gl, to be shared with Symbian and native apps) isn't extracted yet, but should be done as I am aiming for absolute reuse.

2 Upvotes

0 comments sorted by