quake3 MacOS hackery, continued...

Ryan C. Gordon icculus at icculus.org
Sat Nov 26 02:56:07 EST 2005


Okay,

Subversion Revision #373 adds my Mac OS X work. I fully expect things to 
be broken in small ways on other platforms...just commit fixes if 
something is obviously hosed. I corrected the x86 assembly thing that 
was mentioned previously.


Notes and current bugs:

- Mac-specific codepaths are gone...it uses SDL and OpenAL in the Unix
codepaths now. Less code to maintain.

- Compiled VM seems to work, but keeps writing to console:

       Com_sprintf: overflow of 247 in 144

     ...so I guess the calling convention isn't totally right? I think 
this is a PowerPC Linux issue, too, at the moment. I tried vm_ppc_new.

- Interpreted VM works, but eats like 30% of the CPU!

- dlopen() is (mostly) gone...uses SDL_LoadObject() and
SDL_GL_LoadLibrary() now. The dedicated server still uses dlopen, to
avoid the dependency.

- Rendering issues: mirror in Q3DM0 doesn't render, water in Q3DM2
doesn't render. Looks like health orbs lose their orbs (just crosses
rendering) with some frequency. All of these issues appear to affect
PowerPC Linux, too, and did before I started my Mac work...some byteswap
issue?

- Haven't tried multiplayer at all.

- Need OpenAL library...doesn't ship as a system framework until 10.4.
SDL Audio and OpenAL output both appear to be fine on Mac OS now.

- OpenAL dynamic loading doesn't compile. Should make default and let
people choose a specific openal.dylib via a cvar.

- Altivec code is split out now, since you can't call a function with
Altivec code on a G3, even if the code is protected with an "if
(altivec)" check...GCC adds prologue code to these functions to protect
the vector registers, so G3 systems crash when you call the function at
all. This is fixed now. Also, there is now a "com_altivec" cvar which
uses can use to toggle Altivec support on/off at runtime (if com_altivec
is 1 at startup, we'll detect support and set it appropriately...if it's
0, we won't detect it and just leave support off).

- Altivec code is broken in _debug_ mode...see nastiness in
LerpMeshVertexes() in renderer/tr_surface.c ... Works fine in release 
mode. Don't know why. Someone should fix that, I won't be doing so.

- Altivec detection relies on Carbon framework...not sure how to do this
on PowerPC Linux. For now, we assume it's available (and G3 Linux users
will have to disable it from the command line).

- I have (re)added the SDL and OpenAL headers to Subversion. I don't
care what the Linux users say, this is non-negotiable. You can choose to
use the system versions if you want for Linux, but on Windows and MacOS,
these need to be included so we don't have to hunt down the external
dependency. As such, there will also be Mac and Windows precompiled
versions of the libraries added, too. Again, Linux users can use a
system version if they want. By default, they still do this; I haven't 
changed the Makefile to do otherwise. Seriously, leave these headers in 
there.

- Added support for ccache...please build with USE_CCACHE=0 if you don't
want it.

- The XCode project files went away with the rest of the Mac-specific
bits...this could be reconstructed, though, but I don't personally use
it, so I don't personally care.  :)

- Haven't tried x86 Mac (will do so this upcoming week if there's time).

I think most of the remaining issues affect PowerPC Linux, too, so I'm 
leaving this to the pros from here out unless there's a specific issue 
for me to tackle.

--ryan.






More information about the quake3 mailing list