MacOS port status

The latest CVS code has been updated for MacOS, and is available
from: http://www.devolution.com/~slouken/SDL/cvs.html

The code archive contains MPW makefiles for SDL and three test programs,
the binaries of which are also available for download.

I have no CodeWarrior, so no projects are included. If you are building
a CodeWarrior project, look at the file SDL.make to see what files need
to be included in the SDL shared library, and which need to be in the
SDLmain library. I welcome contributions of CodeWarrior projects. :slight_smile:

SDL programs should be linked with the SDL shared library, the SDLmain
library, and the SDL.r resource found in src:main:macos. If you are
using MPW, and do not already have a SIZE resource for your program,
you should link with the SIZE.r resource file in src:main:macos.

MacOS TODO List:

  • 8-bit mode support
    There is no palette support in the MacOS toolbox driver, so 8-bit
    displays look terrible. The code support needs to go into
    :src:video:toolbox:SDL_romvideo.c

  • Mouse cursor support
    The routines in :src:video:toolbox:SDL_rommouse.c need to be implemented

  • Audio
    Audio is not implemented at all. The functions that need to be
    implemented are in :src:audio:macos:SDL_romaudio.c.
    Since MacOS doesn’t have preemptive thread support, the Mac_OpenAudio()
    function should set up periodic callbacks and return 1, saying that
    audio has been started. Look at the BeOS driver for an example.
    Does someone who has participated in previous Mac audio discussion
    want to post the ideas to the list? Max?? :slight_smile:

  • CD-ROM testing
    The CD-ROM routines need to be fully tested.

  • Sprockets
    SDL currently does not have Game Sprockets support.
    If you were to add this, a new directory with associated files would
    need to be created in :src:video, and a new audio driver files would
    have to be added to :src:audio:macos.

So what works?
Graphics applications running on a PPC with the monitor set to thousands
or millions of colors work great. Mouse and keyboard input work properly,
and both fullscreen and windowed mode work well.

See ya!
-Sam Lantinga (slouken at devolution.com)

Lead Programmer, Loki Entertainment Software–
“Any sufficiently advanced bug is indistinguishable from a feature”
– Rich Kulawiec

Sam Lantinga wrote:

MacOS TODO List:

  • 8-bit mode support
    There is no palette support in the MacOS toolbox driver, so 8-bit
    displays look terrible. The code support needs to go into
    :src:video:toolbox:SDL_romvideo.c

  • Mouse cursor support
    The routines in :src:video:toolbox:SDL_rommouse.c need to be implemented

  • Audio
    Audio is not implemented at all. The functions that need to be
    implemented are in :src:audio:macos:SDL_romaudio.c.
    Since MacOS doesn’t have preemptive thread support, the Mac_OpenAudio()
    function should set up periodic callbacks and return 1, saying that
    audio has been started. Look at the BeOS driver for an example.
    Does someone who has participated in previous Mac audio discussion
    want to post the ideas to the list? Max?? :slight_smile:

Yes.
In OpenAudio you need to query the sound hardware for the desired audio
spec (although the newer mac sound managers will convert/play almost
ANYTHING), open the sound channel, and install a timer interrupt to feed
the audio channel. I use a timer of 10ms, and it works well on my aging
6500. YMMV

In the timer interrupt routine, check to make sure sound is enabled, not
paused, and not currently playing. If its green, call the audio_spec
callback to fill the sound buffer, issue the sound command, set the
playing flag to true, and setup a sound completion callback.

In the sound completion callback, just set the playing flag to false.

That should be all. The problem is when the size of the data returned by
the audio_spec callback is less than the size of the sound buffer. You
get an angry racket at the end of , or a nice solid lock-up. (Why? Beats
me.) My solution is to fill the sound buffer with the appropriate
silence value prior to invoking the audio_spec callback. That sounds
fine, except for the occasional pop on slower Macs. It does slow things
down, which is may become significant if your application cycle-hungry
already. I hope a REAL Mac programmer can think of a better solution.

I have some code that does all of this. Sort of. It is a little
unstable. :slight_smile: I don’t really have time to polish it, and I hate dumping
code I am unwilling to maintain into OSS projects. That is why I have
not sent it in. Additionally, it is for the pre-1.0 SDL API. (I have
been waiting for 1.0 to settle down before switching.) However, since it
might do some good, I’ll post it tomorrow. I would post it now, but it
is in my Mac at the office, and for some reason my Mac refuses telnet
connections. :slight_smile:

Sorry for the slow response,
Max Watson <@Max_Watson>