SDL2 for macOS 9 “rough draft”
61 comments
·April 10, 2025helfire
contrahax
Retro68 is indeed very cool, I started writing some Think C and it is fun to code on such a tiny screen but Retro68 allowing you to code on your regular dev environment using more modern C has been great. I've been playing around with it last week to make some applications (not a plug because these projects suck!) - If anyone wants a simple Retro68 application boilerplate to start off with:
- Chatbot: https://github.com/yocontra/macintosh-ai/
- Game: https://github.com/yocontra/maccraft (Doesn't work very well atm, making a game run well on a macintosh plus is hard!)
I wasn't even alive when these computers were out but enjoying coding for them - something to be said about the simple interfaces (both in C and UI) and challenge of making things work with the constraints of the hardware.
Retro68 community has some really neat stuff like MacHTTP (https://github.com/antscode/MacHTTP) as well so you can offload some work to services (assuming you buy one of the many SCSI Wifi thingys).
bluedino
I tried a little bit 20+ years ago. Bought a 'road Apple' Performa for $50, download Pangea's game programming book, can't remember if I used MPW or CodeWarrior...
It wasn't anywhere near as simple as DOS game programming was so I think I just installed YellowDog and used that Mac as a webserver.
https://www.pangeasoft.net/book/buy.html
Edit: I just opened that PDF and I think that's a newer version or I remembered the book wrong.
wsc981
Perhaps the book was "The Black Art of Macintosh Game Programming" [0]? That was a fun book I got myself.
---
nxobject
I love retro68, but as much as I love it I'm frustrated the"black box" dependency on CMake to specify the build process + app metadata (e.g. distinguishing between apps and desktop accessories which treat system globals differently, rsrc compiling, resource fork creation, etc.) My first instinct with (hobbyist) programs is to go for a lean and mean makefile.
JKCalhoun
Wondering what I could do with it ... I rewrote Glypha (an old Mac shareware game I wrote) using modern SDL2. Might be fun to try to "back port" (?) it to OS 9 on top of SDL2 (rather than the clunkier CopyBits() calls I used in the original shareware game).
chongli
I'd love to hear how that goes. I've never written any code for OS 9 or earlier. I have heard many things about the brilliance of QuickDraw for writing very fast 2D drawing code on the very limited hardware of the time. I have not heard anything about the actual experience of writing software with QuickDraw calls.
I'd also be really interested to know how SDL2 would fare by comparison. Would it be as fast on old hardware? It wasn't built with the assumptions of that old hardware in mind, so I would be very surprised if it performed as well.
classichasclass
The funny part is I think the SDL2 porter implemented most of the software rendering with ... CopyBits!
ndiddy
Nice, I hadn't heard about that before. The original Mac game was really fun, but your new Steam version looks way smoother. I like how the UI's like an old B&W Mac UI but with Egyptian touches thrown in. If you don't mind me asking, what was the new version written in (C, C++, something else)? Were you able to reuse any of the logic from the original Pascal version, or was everything more or less done from scratch?
geerlingguy
Thank you for providing me with many hours of entertainment on our old Performa 6360 many years ago! Bought the new version on Steam, too.
JKCalhoun
And you have given me plenty of entertainment in my retirement. You keep up the good work.
ndiddy
Looks neat! SDL seems open to supporting legacy platforms, so hopefully it'll get mainlined at some point (at this point, may be more likely if they port SDL3 though, SDL2 is in maintenance mode). Does anyone know if it's possible to use a new compiler for this rather than CodeWarrior 7? It would make it easier to port stuff to Mac OS 9 if you don't also have to deal with the compiler only supporting old C/C++ standards.
ender341341
> compiler only supporting old C/C++ standards.
That's from back when the c++ standard was a rough suggestion. I had to use code warrior 10 for a project back in 2008ish (when standards compliance seemed to actually be picking up real steam across gcc/llvm/msvc) and it was painful how many things that were standard/supported across the other compilers that would break, we ended up basically falling back to closer to c with classes than anything that would resemble modern (at the time) c++.
helfire
Retro68k allows you to build with gcc12 https://github.com/autc04/Retro68
KerrAvon
The classic 68k Mac binary model is pretty far from what LLVM and GCC support even if they still have backends capable of compiling to older 68k CPUs (I'm not sure if that's case). Executable code is stored in the resource fork; the Mac SDKs require a compiler with support for a special syntax for trap-table based calls; the classic Mac Toolbox expects Pascal-format strings for most things.
helfire mentions Retro68; if you look at its README, you can get an idea of the scope of modifications required.
system7rocks
I'm here for this. Going to start building a first class competitor to Elder Scrolls Arena this weekend for my Mac SE/30. And do it better.
keyle
Love the enthusiasm and commitment.
geenat
Cool to see. SDL 1 went back to System 7, awesomely enough.
Before that you had... Sprite Animation Toolkit by Ingemar Ragnemalm which powered Escape Velocity, etc.
donnachangstein
There is no such thing as "macOS 9".
"Mac OS 9" or "OS9" does, however, exist.
helfire
Ya.. A mod edited the title and didn't change it back.
kristianp
So Mac OS9 is PowerPC macs, but this also covers 68k macs with OS 7.6:
> Compatibility Architecture: 68k PPC MacOS 9 PPC, MacOS 7.6 M68k, using CodeWarrior 6 and 7 Pro.
alekq
Whenever I think that the time I invested in some of the mini-projects is lost/wasted time and that it was probably better choice to do just about anything else instead - I come across something like this. The only thing I can conclude is that there is no such thing as wasted time, as long you enjoy the road.
Kudos.
skrrtww
Pretty cool!
I have heard stories of people in 2025 creating a fat macOS binary containing arm64, x86_64, x86, and ppc slices.
I hope that we can get virtualization of x86_64 macOS on arm64 hosts. It would be really cool to be able to do such a thing solely on a modern machine!
grishka
You can't virtualize a different architecture. Virtualization means that the guest OS runs natively on the host CPU with some sort of hypervisor. Do you mean emulation?
OSDeveloper
I think it's amazing that we would have a new way to make apps running on macOS 9 systems since with a well known standard such as SDL2 we could make far more apps.
bni
What is the best option for having an experience like "DosBox but for 68K macs"?
BruceEel
+1 this question. I notice QEMU can do 68k these days, apparently, including MacOS 7 & 8:
https://wiki.qemu.org/Documentation/Platforms/m68k#Running_M...
scroot
Love everything going on here. Now if someone could just send me an old Pismo powerbook...
It's really a great time to be a classic MacOS developer - tons of resources out there such as Retro68k, AmendHub, and a small but active community of people interested in sharing examples and help.
Back in the day when this stuff was modern I didn't have many resources or people to talk to about it, so exploring what could have been is an interesting endeavor.
https://github.com/autc04/Retro68 https://amendhub.com/