Skip to content
nullmothPublic

About

Rewrites Windows programs, old 32-bit Mac apps and VST plug-ins into 64-bit Mac apps. Full source.

Resources

Stars

517 stars

Watchers

4 watching

Forks

Latest commit

 

History

237 Commits

Folders and files

Repository files navigation

DAISY

DAISY turns Windows programs and old 32-bit Mac apps into real 64-bit Mac apps. It doesn't run them in a virtual machine or an emulator. It rewrites the program's code once, ahead of time, and links it with its own Mac versions of the Windows pieces the program expects (windows, Direct3D, sound, files, threads). What comes out is an ordinary app in your Applications folder.

Download the latest version from Releases.

Installing

  1. Download DAISY.zip and unzip it.
  2. Drag DAISY into Applications.
  3. Open it. The first time, macOS will refuse because DAISY isn't signed with an Apple Developer ID. Go to System Settings → Privacy & Security, scroll down to the note about DAISY, and click Open Anyway. You only have to do this once. Apps DAISY makes for you open normally.
  4. If macOS asks to install the command line developer tools, say yes. DAISY uses Apple's compiler to build each app.

You need macOS 13 or later. DAISY builds for the Mac you convert on: an Apple silicon Mac gets a native Apple silicon app, an Intel Mac gets an Intel app. Audio plug-ins are still built for Intel and run through Rosetta on Apple silicon. To pick yourself, start the conversion with DAISY_ARCH=x86_64, arm64, or universal.

Using it

Drop something on the DAISY window:

  • a game or program folder
  • a .zip, a disk image (.dmg), or a Windows installer
  • a single .exe
  • an audio plug-in (.dll or .vst), a folder of them, or a zip of them

DAISY unpacks it, finds the main program, and converts it. Small programs take under a minute; a big game can take several minutes the first time. Converting the same 32-bit game again later (after a DAISY update, say) is much faster, because only what changed gets rebuilt.

When it's done, the app shows up in Applications with the program's own icon. The game's files are kept in ~/Library/Application Support/DAISY/Games.

Steam games

Steam for Mac only offers the Mac version of a game, so get the Windows version's folder another way: copy it from a PC, or download it with Valve's steamcmd using +@sSteamCmdForcePlatformType windows. Then drop that folder on DAISY. Heads up: steamcmd shares its sign-in with Steam for Mac, so using it signs Steam for Mac out. Sign back in afterwards.

A converted Steam game talks to the real Steam for Mac, so you need Steam installed, you need to be signed in, and you need to own the game. The first time DAISY converts a Steam game, it downloads the Steam interface tables it needs from Valve's public Proton repository. If Steam isn't running when you start the game, DAISY starts it.

Audio plug-ins

Windows VST 2 plug-ins (32-bit or 64-bit) and 32-bit Mac VST 2 plug-ins are installed as 64-bit VST 2 and Audio Unit plug-ins in ~/Library/Audio/Plug-Ins, with their own editor windows. They work in Logic and any other host.

What works

  • 64-bit Windows games and programs: Direct3D 9, 11 and 12, DirectSound, XAudio2, XInput controllers, Win32 windows and controls
  • 32-bit Windows games and programs: Direct3D 9, DirectDraw, OpenGL, DirectSound, XAudio2, full Windows menus, dialogs and toolbars
  • 32-bit Mac apps that current macOS won't open: SDL games, Cocoa apps and Carbon apps
  • Steam games whose only protection is Steam itself

What doesn't

  • Games with kernel anti-cheat (EasyAntiCheat, BattlEye, Vanguard and the like). DAISY spots these and says so instead of converting them.
  • Games whose program is encrypted by DRM (Denuvo, SecuROM, StarForce and the like).
  • .NET programs and Unity games built with Mono. They make their machine code while they run, and DAISY can only rewrite code that exists ahead of time. DAISY says so instead of converting them. (Unity games built with IL2CPP work.)

Programs that use LuaJIT (LÖVE games, Luanti and others) run their Lua in LuaJIT's interpreter, because its compiler also makes code while running. They work, but heavy Lua code runs slower than on Windows.

Tips

  • Shaders are recorded while a game runs. If a game stutters the first time it shows a new effect, convert it again after you've played for a while. The recorded shaders then get built in ahead of time, which also fills in a few effects (like water in some Direct3D 11 games) that otherwise show up late.
  • A game takes the mouse while it's in front. Press Command-Tab, or hold Command, to get the pointer back. Click in the game to go back to it.
  • To keep a full-screen 32-bit game in a window, start it from Terminal with PE2_WINDOWED=1, for example PE2_WINDOWED=1 open -a "My Game".

When something goes wrong

Every converted app writes a log to ~/Library/Logs/DAISY/<app name>.log. The last few lines usually say what stopped it. If a program needs a Windows function DAISY doesn't have yet, the log names it near the top.

To send us the logs, click Something went wrong? Send logs to NullMoth at the bottom of the DAISY window. It sends DAISY's own logs and nothing else: the last conversion, the build logs and the converted app's log.

For Steam problems, start the game from Terminal with DAISY_STEAM_TRACE=1 set, and every call it makes to Steam goes into the log.

Building DAISY from source

You need macOS 13 or later with Xcode or the command line developer tools (xcode-select --install). To run the tools straight from the repository you also need Python 3.12 or later with the capstone module (python3 -m pip install capstone).

The finished app is self-contained, so app/build_app.sh also packs in four things that are too big to check in, or aren't ours to. It finds each one through an environment variable:

Variable What it points at
DAISY_BUNDLE Standalone Python 3.12 builds for x86_64 and arm64 (inst/cpython-3.12.*-macos-<cpu>-none), capstone wheels for both (wheels/), and a universal 7z
DAISY_SC The shader tools: bin/conv12 and the other converters, the DirectX shader compiler, and Apple's Metal shader converter library (lib/)
DAISY_SYS Microsoft's redistributable Visual C++ runtime DLLs (vcruntime140.dll, msvcp140.dll and the rest), x64
DAISY_SYS32 The same DLLs for x86, from Microsoft's x86 redistributable

Then:

git clone https://github.com/nullmoth/daisy.git
cd daisy
DAISY_BUNDLE=/path/to/py DAISY_SC=/path/to/sc DAISY_SYS=/path/to/sys DAISY_SYS32=/path/to/sys32 bash app/build_app.sh ./build

The app ends up at build/DAISY.app.

While you're working on DAISY you don't need to build the app to convert something. The converter runs from the repository:

# a 32-bit Windows program: rewrite it and link it with the 32-bit runtime
python3 tools/build.py <game folder> <output folder> <program.exe> --auto

Rewritten modules stay cached in the output folder. Run the same command again after changing the runtime, and only the runtime gets recompiled and the program relinked. tools/daisy64.py does the same job for 64-bit programs, and app/convert.sh shows exactly how the app calls both.

How the source is laid out

  • pe2mac/ reads Windows (PE) and 32-bit Mac (Mach-O) programs and rewrites their machine code ahead of time
  • runtime/ is the Mac side of every Windows function a 32-bit program calls (windows, GDI, Direct3D, sound, files, threads, Steam)
  • w64/ is the same for 64-bit programs
  • m32/ is the runtime for old 32-bit Mac apps (SDL, Cocoa, Carbon), plus the Audio Unit and VST 2 plug-in shims
  • app/ is the DAISY app and convert.sh, the script it runs for each conversion
  • tools/ holds the build tools and the generators for the API tables; tests/ holds small test programs

License

PolyForm Noncommercial 1.0.0. See LICENSE.

About

Rewrites Windows programs, old 32-bit Mac apps and VST plug-ins into 64-bit Mac apps. Full source.

Resources

Stars

517 stars

Watchers

4 watching

Forks

Releases

Packages

Contributors

Languages