Become a MacRumors Supporter for $50/year with no ads, ability to filter front page stories, and private forums.

Jubadub

macrumors 6502
Original poster
Nov 1, 2017
368
457
I thought the news about this ought to be shared here on MacRumors PPC, as well, to make sure "everyone" is within the loop:


For the developers among you, and perhaps even non-developers, you may have heard of SDL before. And almost guaranteed you played games that make use of it!

So, this is a VERY exciting effort, and let me make it clear this is NOT done by me, but by "lauland" over at Macintosh Garden and various other Mac spaces. However, there's "only" graphics rendering that is done and working, and that too only in software (no OpenGL, QuickDraw 3D RAVE etc. yet). A super-ultra basic game in SDL2 was tested with it, and is included in that Garden page's source download of SDL2 (based on January 2025's SDL 2.30.11), and it technically works. Which honestly has us all amazed, including lauland himself.

However, there's no sound/audio implementation ported over yet. No joystick support. No nothing else, everything is just dummied out for now.

And so, this is one of the main reasons I'm making this thread: anyone else feeling like giving lauland a helping hand? Just even the WILLINGNESS to join in to help would be more than enough, don't be pressured nor concerned about "getting results". No need to be shy nor worry! Just come on in and see if you can help, no programming wizards are expected. Even if someone knows NOTHING of programming, but would like to learn and try things out, like clicking around on CodeWarrior just to see programs "magically" compile, you're more than welcome!

Thing is, lauland is super technical, humble and a very nice guy overall, but... he is just one guy. SDL2 is massive... And it saddens him that a lot of people are interested in the idea, but too "scared" to try. It's not scary. So in some ways, we can say the fate of SDL2 for Mac OS, the non-UNIX Mac OS proper, rests upon us to provide some support, even if "just" human support and not necessarily so much technical support (as in, just the willingness to help in and of itself is enough).

Of course, proper technical support to get it done is beyond welcome, too.

If interested, hit us up over at System 7 Today's Hotline (hotline.system7today.com), or Mac OS 9 Lives!'s Hotline (hotline.macos9lives.com). We are completely informal there, so feel free to even just hang out and chat. You can use Hotline with a client app for just about any system.
 
I thought the news about this ought to be shared here on MacRumors PPC, as well, to make sure "everyone" is within the loop:


For the developers among you, and perhaps even non-developers, you may have heard of SDL before. And almost guaranteed you played games that make use of it!

So, this is a VERY exciting effort, and let me make it clear this is NOT done by me, but by "lauland" over at Macintosh Garden and various other Mac spaces. However, there's "only" graphics rendering that is done and working, and that too only in software (no OpenGL, QuickDraw 3D RAVE etc. yet). A super-ultra basic game in SDL2 was tested with it, and is included in that Garden page's source download of SDL2 (based on January 2025's SDL 2.30.11), and it technically works. Which honestly has us all amazed, including lauland himself.

However, there's no sound/audio implementation ported over yet. No joystick support. No nothing else, everything is just dummied out for now.

And so, this is one of the main reasons I'm making this thread: anyone else feeling like giving lauland a helping hand? Just even the WILLINGNESS to join in to help would be more than enough, don't be pressured nor concerned about "getting results". No need to be shy nor worry! Just come on in and see if you can help, no programming wizards are expected. Even if someone knows NOTHING of programming, but would like to learn and try things out, like clicking around on CodeWarrior just to see programs "magically" compile, you're more than welcome!

Thing is, lauland is super technical, humble and a very nice guy overall, but... he is just one guy. SDL2 is massive... And it saddens him that a lot of people are interested in the idea, but too "scared" to try. It's not scary. So in some ways, we can say the fate of SDL2 for Mac OS, the non-UNIX Mac OS proper, rests upon us to provide some support, even if "just" human support and not necessarily so much technical support (as in, just the willingness to help in and of itself is enough).

Of course, proper technical support to get it done is beyond welcome, too.

If interested, hit us up over at System 7 Today's Hotline (hotline.system7today.com), or Mac OS 9 Lives!'s Hotline (hotline.macos9lives.com). We are completely informal there, so feel free to even just hang out and chat. You can use Hotline with a client app for just about any system.

Is there some contact of those folks? Given that Cocoa backend of SDL2 is broken on OSX at the moment (since 2.0.x), if they have some fixes for that, it would be of great help.
 
Well, guess what, SDL3 now also compiles on Mac OS 9! The core of it, that is. Meaning it is in the same state as SDL2, but without even the video drivers, so there's nothing to show visually besides a text-based terminal, but the core SDL code is there and even runs (some non-visual tests work, for example).

So for SDL3, it's literally a "call to arms" to develop it. I don't expect it to be touched much otherwise, at least not until/if SDL2 is ever finished.

@barracuda156 You were directly answered in the SDL2 Garden page, but you could also take that SDL3 Mac OS 9 project, and start adding a Cocoa OS X video (OpenGL?) back-end to it, or "video driver" in SDL parlance. The other guys mentioned in that Garden page surely would love to collaborate for that, as well, I'd bet. I think it'd be better than starting completely from scratch!
 
Well, guess what, SDL3 now also compiles on Mac OS 9! The core of it, that is. Meaning it is in the same state as SDL2, but without even the video drivers, so there's nothing to show visually besides a text-based terminal, but the core SDL code is there and even runs (some non-visual tests work, for example).

So for SDL3, it's literally a "call to arms" to develop it. I don't expect it to be touched much otherwise, at least not until/if SDL2 is ever finished.

@barracuda156 You were directly answered in the SDL2 Garden page, but you could also take that SDL3 Mac OS 9 project, and start adding a Cocoa OS X video (OpenGL?) back-end to it, or "video driver" in SDL parlance. The other guys mentioned in that Garden page surely would love to collaborate for that, as well, I'd bet. I think it'd be better than starting completely from scratch!

If the project will be available somewhere with git support (GitHub, GitLab, SourceHut, you name it) and will target OS X and not only OS 9, I am in.
 
  • Like
Reactions: eastone
If it works on OS9 won't it work on early osx via carbonization?

Why would we want to do it though? That would certainly result in more handicapped, heavily patched library with fewer functionality (if it works at all). It probably won’t be any easier/faster either.
 
@f54da "lauland" was indeed able to compile SDL2 for Carbon, too, IIRC, so it certainly should cover all PPC Macs all the way up to OS X 10.6.8 Snow Leopard (and if used with certain IDEs, should be compilable for versions all the way up to 10.14 Mojave potentially).

@barracuda156 "Heavily-patched"? "Handicapped"? "Fewer functionality"? "Probably won't be easier/faster either"? Why? Carbon is a native OS X API, as much as Cocoa, and can very well be used instead of it. Or are you simply saying Cocoa is more performant in OS X than Carbon is?

That being said, yes, generally-speaking, Carbon is slower under Mac OS (the actual thing, not OS X) than software compiled for the Macintosh Toolbox API, so maybe it's similar for the UNIX cousin system, as Cocoa is the "OG" API ever since the NeXTSTEP days?
 
Last edited:
@f54da "lauland" was indeed able to compile SDL2 for Carbon, too, IIRC, so it certainly should cover all PPC Macs all the way up to OS X 10.6.8 Snow Leopard (and if used with certain IDEs, should be compilable for versions all the way up to 10.14 Mojave potentially).

@barracuda156 "Heavily-patched"? "Handicapped"? "Fewer functionality"? "Probably won't be easier/faster either"? Why? Carbon is a native OS X API, as much as Cocoa, and can very well be used instead of it. Or are you simply saying Cocoa is more performant in OS X than Carbon is?

That being said, yes, generally-speaking, Carbon is slower under Mac OS (the actual thing, not OS X) than software compiled for the Macintosh Toolbox API, so maybe it's similar for the UNIX cousin system, as Cocoa is the "OG" API ever since the NeXTSTEP days?

I wasn’t referring to Carbon as such, but to using a port for OS9 for OSX. Or do you want to say that the code does not need to be modified more in order to work on OS9? And that OS9 port maintains identical functionality to what we get on OSX? Admittedly, I have no access to OS9 and did not look into the sources for it, but I would be genuinely surprised, if that is the case. In my experience, even 10.5 vs 10.6 already makes a big difference.
 
The drivers for MacOS X are still included (along with all the other official platforms), so in theory the same tree could still be used to build it. (I mean to try this soon). I may have archived some of the drivers to get around filename conflicts in CodeWarrior, but didn't delete anything outright. The new MacOS 9 support is completely separate and useless for MacOS X (other than through Carbon and that is no better than native MacOS 9...ie still extremely rough and very much in progress).

It sounds like you're interested in fixing issues with the MacOS X drivers, which is a completely separate project. Since MacOS X, at least on more recent versions, is officially supported by SDL2, you might find luck in their official forums or whereever it is being discussed.

With that said, I know things have drifted and support on older versions of MacOS X has been dropped, particularly for PowerPC. The most recent versions of SDL2 may require features of Cocoa and CoreGraphics not available on older MacOS X. It's possible a fork might be needed for older systems, with drivers based on a version of SDL2 much older than the current one. But, again, that'd be a completely different project, and basing it on this code would not be a good idea, as it'd be starting almost completely from scratch.
 
I know things have drifted and support on older versions of MacOS X has been dropped, particularly for PowerPC. The most recent versions of SDL2 may require features of Cocoa and CoreGraphics not available on older MacOS X.

Cocoa was broken since very early 2.0.x in upstream, and publicly available patched versions existed up to 2.0.3. I had something like 2.0.9 building, with quite bad patches, after which I gave up. There are a few powerpc-specific bugs, but largely the issue is SDK – and that upstream couldn’t care less about about maintaining backward compatibility.
 
I was afraid of that, but expecting it. Yeah, it does seem like an unofficial fork may be needed.

How far did you get? Was it working, even with the bad patches? If so, if you have your codebase someplace I can definitely take a look at it. I can't promise too much, as far as bug fixing goes. If we start working on it, we'll break it out into a separate post, and keep this one just MacOS 9.

For the record, as I said, the work I've done here won't be ANY help at all with that, I'm using different compilers and it's a different API, but I know my way around SDL2 well enough I may be able to help.
 
  • Like
Reactions: barracuda156
I was afraid of that, but expecting it. Yeah, it does seem like an unofficial fork may be needed.

How far did you get? Was it working, even with the bad patches? If so, if you have your codebase someplace I can definitely take a look at it. I can't promise too much, as far as bug fixing goes. If we start working on it, we'll break it out into a separate post, and keep this one just MacOS 9.

For the record, as I said, the work I've done here won't be ANY help at all with that, I'm using different compilers and it's a different API, but I know my way around SDL2 well enough I may be able to help.

It would be awesome if you can take a look and maybe help with Cocoa in SDL2/3.

I will review my old patches for 2.0.x, if there is anything worth, I will make a branch for that. As a starter, here is what we have right now:

2.0.3 with Ken’s patches, according to him it worked: https://github.com/macos-powerpc/po...94983db4e6fccd4a4e/devel/libsdl2-legacy/files

Minimal patches to get the latest SDL2 working with X11: https://github.com/macos-powerpc/po...4983db4e6fccd4a4e/devel/libsdl2-powerpc/files
This is tested, but got issues, at least on my machine. Specifically:
1. If SDL is built with OpenGL via mesa, it tends to freeze the OS randomly when being used. I have enabled back an option to build against Apple framework, but I vaguely recall it did not work correctly either. This needs to be checked again.
2. If SDL is built without OpenGL, then in mpv colors get wrong (but in ffplay they are okay, so I am not sure where is the bug). Update: looking at my screenshot now, it actually seems like mpv does not want a non-OpenGL version at all, and falls back to Xlib. So this may be unrelated to SDL, but the core problem with SDL is more or less broken GL.

mpv.png


Patches for SDL3, X11 backend: https://github.com/macos-powerpc/po...b67c687eea94983db4e6fccd4a4e/devel/SDL3/files
So far looks working, but only tested with one port (just GUI, no video), so the status is largely unknown.
 
  • Like
Reactions: repairedCheese
Updates:
Enough key and mouse events now for really basic games.
Have switched primarily to Retro68 from Codewarrior and loving it.
Split stuff only CodeWarrior needs just for it.
All tests build, but, of course, many still fail due to missing drivers.
Created skeleton audio and joystick drivers, will be trying to move over parts of SDL 1.2 drivers.
timer and loadso drivers from SDL 1.2 converted, but need testing.
Now have SDL_main() based on SDL 1.2's, needs testing.
Uses resources from SDL 1.2 since they were good enough.
Refined SDL_config_macosclassic.h, everything possible now included.
OpenGL support and renderer now building, but nothing in driver but stubs so far.
Fixed lots of memory and cleanup issues/bugs.
Did basic what was needed and created simple video driver for m68k Amiga and it works.
Tons of cleaning and refining.
 
  • Like
Reactions: repairedCheese
Now have SDL2_image, SDL2_mixer, SDL2_ttf and SDL2_gfx.
SDL2_image and SDL2_mixer aren't using ANY external libraries yet, as I haven't built them, so file formats limited.
 
Register on MacRumors! This sidebar will go away, and you'll see fewer ads.