[HN Gopher] SDL2 for macOS 9 "rough draft"
       ___________________________________________________________________
        
       SDL2 for macOS 9 "rough draft"
        
       Author : helfire
       Score  : 83 points
       Date   : 2025-04-10 15:54 UTC (7 hours ago)
        
 (HTM) web link (macintoshgarden.org)
 (TXT) w3m dump (macintoshgarden.org)
        
       | TimTheTinker wrote:
       | Just to understand the context ... would an SDL2 driver for Mac
       | OS 9 enable first-class support for Mac OS 9 as a guest OS in
       | modern VM hypervisors?
        
         | Moto7451 wrote:
         | No, this is not something that would enable a VM. This allows
         | SDL2 code to be used in the classic Mac OS as a library.
        
       | helfire wrote:
       | Uh, did an editor change the title? I's MacOS 9, not macOS 9 ;)
       | This is classic Macintosh. Please change it back to the original.
        
         | Lammy wrote:
         | It's Mac OS 9, title cased with a space between the words
         | https://i1.wp.com/lowendmac.com/wp-content/uploads/about-mac...
         | 
         | Extremely cool project!
        
           | helfire wrote:
           | True true, I just submitted it with the casing of the
           | original title. Though actually if you read the page they've
           | tested support down to Mac OS 7.6!
        
       | helfire wrote:
       | 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/
        
         | bluedino wrote:
         | 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.
        
       | OSDeveloper wrote:
       | 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.
        
       | anthk wrote:
       | New exotic stuff:
       | 
       | - UXN for MacOS 9
       | 
       | - ScummVM, maybe modern games could run under a G4 with Altivec
       | 
       | - Netsurf with the SDL front end
        
       | ndiddy wrote:
       | 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 wrote:
         | > 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 wrote:
         | Retro68k allows you to build with gcc12
         | https://github.com/autc04/Retro68
        
         | KerrAvon wrote:
         | 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.
        
       | cortesoft wrote:
       | Is SDL2 just something that everyone is expected to know what it
       | is? I was thinking it was about a Software Development Lifecycle
       | on Mac0S9, but it clearly isn't... but there is no where in this
       | post or that page that explains what SDL2 is.
        
         | thrance wrote:
         | As far as libraries go, this one is pretty well known. If you
         | ever need to make a small game or custom gui, it's fairly easy
         | to pick, very performant and very portable.
        
         | skyyler wrote:
         | It is one of the most popular multimedia libraries in the
         | world.
         | 
         | If you want to build a game without using an engine, but don't
         | want to deal with talking to the hardware on your own, SDL is
         | there.
        
         | OnionBlender wrote:
         | I think that anyone that doesn't know what SDL2 is probably
         | won't care about this announcement. Besides, when I search for
         | "SDL2" on Google, the first 5 pages were all about the Simple
         | Direct Media Layer library, so there shouldn't be any
         | uncertainty.
        
         | haunter wrote:
         | >Is SDL2 just something that everyone is expected to know what
         | it is?
         | 
         | No but it's assumed that if use a site like HN you can figure
         | it out?
        
         | bowsamic wrote:
         | Yes, it is one of those things that I'd expect your average HN
         | user to know about
        
         | cardanome wrote:
         | What exactly is your background? MY first idea was that you
         | might be very young but your account is from 2010.
         | 
         | Not knowing SDL feels like someone having no idea what C++ or
         | Unreal Engine is. I am curious how you managed to avoid
         | learning about SDL despite being on hacker news.
        
       | scroot wrote:
       | Love everything going on here. Now if someone could just send me
       | an old Pismo powerbook...
        
       | Ecco wrote:
       | Wouldn't it be easier to cross-compile using a modern LLVM/GCC? I
       | assume both have 68k backends?
        
         | o11c wrote:
         | I was really confused by the mention of 68k at first since
         | MacOS 8.6 dropped support for that, but following the link it
         | looks like it supports System 7 as well.
         | 
         | Cross-compiling would be _faster_ (than emulation or too-old
         | hardware), but I have never heard it called  "easy". There are
         | a _lot_ of projects out there that need special configuration,
         | and many don 't even support the HOSTCC variable, etc. And
         | that's before considering the importance of system libraries.
        
           | Ecco wrote:
           | I commented that because the author said "dealing with the
           | foibles of CodeWarrior". I guess in the scenario cross-
           | compiling wouldn't be _easy_ , but possibly _easier_?
        
       | geenat wrote:
       | 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.
        
       | gwbas1c wrote:
       | Uhm, nothing says _what SDL is_? The description is an
       | interesting story about the struggles of getting vintage code to
       | build; but it assumes that the reader knows what the thing is to
       | begin with.
        
         | slackfan wrote:
         | If you do not know what it is, nor cant be arsed to look it up
         | perhaps hackernews is not the correct discussion forum for you.
         | Lurk more.
        
           | gwbas1c wrote:
           | I've been here longer than you, and have an order of
           | magnitude more karma than you do.
        
             | CursedSilicon wrote:
             | This isn't Reddit. Imaginary internet points don't matter
             | here.
        
       | JKCalhoun wrote:
       | 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 wrote:
         | 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.
        
       | kristianp wrote:
       | 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.
        
       ___________________________________________________________________
       (page generated 2025-04-10 23:00 UTC)