Can PSU run natively on a Mac?
I play Phantasy Star Universe on the Clementine private server, and I want to keep playing it on my Mac. Before writing any code I spent a week finding out whether that is realistic. This post is what I learned and what I decided.
Why not Wine
The easy answer is Wine, or a paid wrapper built on it. People do play this way today, and I list CrossOver on the site as an interim option. I still don't want to depend on it, for two reasons.
First, performance. PSU uses Direct3D 9. Under Wine on a Mac, that goes through a translation stack with several layers, and the cost shows. Second, the platform is moving. Apple has said general-purpose Rosetta stays through macOS 27, and after that only a subset aimed at older games remains. Wine on Apple Silicon needs Rosetta to run 32-bit x86 Windows code. If that goes away, so does the easy route. I would rather build something that does not need it.
The precedent
The project that convinced me this is doable is NFSU2Recomp. It is a native arm64 macOS build of Need for Speed: Underground 2, a 2004 Direct3D 9 game. Its author reports 119 fps on an M1 Pro, against 10 to 15 fps for the same game under Wine on the same machine. I have not reproduced those numbers myself, so treat them as the author's claim. Even so, a gap that large is enough reason to try.
PSU is a similar kind of target. It is a 32-bit x86 Windows executable that draws with Direct3D 9, and it came out in the same era.
The approach
I'm going with static recompilation plus a runtime written in Rust.
The idea is to translate the game's x86 machine code into C ahead of time, then compile that C for arm64. The translated code calls Windows functions such as CreateFile or Direct3D calls, so something has to answer them. That is the Rust runtime. It provides the subset of Win32 the game uses, plus replacements for DirectInput, DirectSound and Winsock built on Apple's controller, audio and socket APIs.
For graphics I plan to fork mtld3d, an open source Direct3D 9 to Metal layer. Writing a D3D9 implementation from nothing would take far longer than adapting one that already exists.
Guest pointers stay as 32-bit addresses inside a reserved 4 GiB block of memory. That keeps the lifted code simple, because the game's pointers keep working as they are.
The legal model
This part matters most to me. The download will contain only my own tools and runtime. It will not contain any SEGA code or art, and none of the Clementine client.
Each player brings their own Clementine install. The app translates a copy of that install on the player's own Mac. It never edits the original, and nothing from the game is uploaded anywhere. I also plan to ask the Clementine staff for written approval before any public release, and the frame rate stays capped as their rules require.
I'm not affiliated with SEGA or the Clementine team. SEGA has sent takedown notices to other Phantasy Star fan projects, so I'm keeping this one small, independent and free of game assets.
What's next
The first job is scaffolding: a Rust workspace, a tool that reads the game's executable and tells me what it needs, and the memory layout for the runtime. That is the next post.