Thursday, March 3, 2022

Emulating 1998-Vintage Mac Compilers

Ninji (tweet):

All of the tools I needed could be accessed via MPW. Could I get these to run externally somehow?


The obvious choice to start with here is Unicorn Engine, which is essentially the CPU emulator from QEMU made into an embeddable library. I’ve used it for a bunch of projects before. They’ve brought Rust bindings into the tree now which is also quite cool!


Whenever the emulator calls a library function, it loads the function’s index into rtoc (r2) and invokes sc. Then, my hook looks at r2 to determine which function we should try and simulate.


The CodeWarrior C/C++ compiler (MWCPPC) imports over a hundred library functions, but I didn’t want to just implement every single one right off the bat - I wanted to see results faster than that, so I ran it and implemented things as they came up.

1 Comment RSS · Twitter

Having lived through all of this technology 25-35 years ago this was very entertaining, though I would not want to actually ever work with this stuff ever again!

Leave a Comment