Page 1 of 3

intel inside macs

Posted: Thu Feb 02, 2006 10:28 am
by S@M
I have not read much about these, is there any info on how an older game like q3 will play?

Posted: Thu Feb 02, 2006 5:34 pm
by NCG_Mike
We've got an iMac at work and it's much quicker than my dual 2Ghz G5.

If you compiled Q3 and turned on smp, it'd fly.

Posted: Thu Feb 02, 2006 6:56 pm
by Canis
Compiled? If you download the source into Xcode and hit compile it will just work on the intel machine?

Posted: Thu Feb 02, 2006 9:11 pm
by NCG_Mike
If you turn on compilation for Intel I'd imagine so. Not tried it to be honest and it'd be worth searching for Mac specific code to give it a quick check (reading binary files or network I/O come to mind).

Posted: Thu Feb 02, 2006 10:12 pm
by S@M
Woah, it sounds like your going to do this....Mike?

Posted: Fri Feb 03, 2006 5:10 pm
by NCG_Mike
I downloaded the sources from http://icculus.org/quake3/ and got it working on my PowerBook after editing the makefile for the following:

- G4 instructions
- G5 scheduling
- -Os instead of -O3
- loop alignment at 32 for the benefit of G5 machines
- -framework SDL instead of the dylib

Here's the diff between the two makefiles:

Code: Select all

pbg4:~/dev/quake3 mdavis$ svn diff Makefile 
Index: Makefile
===================================================================
--- Makefile    (revision 531)
+++ Makefile    (working copy)
@@ -282,10 +282,10 @@
     GL_CFLAGS =
   endif
 
-  OPTIMIZE = -O3 -ffast-math -falign-loops=16
+  OPTIMIZE = -Os -ffast-math -falign-loops=32
 
   ifeq ($(ARCH),ppc)
-  BASE_CFLAGS += -faltivec
+  BASE_CFLAGS += -faltivec -mcpu=G4 -mtune=G5
     ifneq ($(VM_PPC),)
       HAVE_VM_COMPILED=true
     endif
@@ -318,7 +318,7 @@
     #  the file has been modified by each build.
     LIBSDLMAIN=$(B)/libSDLmain.a
     LIBSDLMAINSRC=$(LIBSDIR)/macosx/libSDLmain.a
-    CLIENT_LDFLAGS=-framework Cocoa -framework OpenGL $(LIBSDIR)/macosx/libSDL-1.2.0.dylib
+    CLIENT_LDFLAGS=-framework Cocoa -framework OpenGL -framework SDL
   else
     # !!! FIXME: frameworks: OpenGL, Carbon, etc...
     #CLIENT_LDFLAGS=-L/usr/X11R6/$(LIB) -lX11 -lXext -lXxf86dga -lXxf86vm
If I built Quake 3 the default way, it'd crash on a call to openal during the demo. Dunno why and I didn't look into it.

I used timedemo 1 and the standard demo at 640x480 on a 1.33Ghz G4 PowerBook (768MB RAM) and got 77.6 fps. That's slower than the standard G4 one on the same machine (109fps). I'll fiddle with the optimisations to favour the PowerBook as they favour a G5 right now. There's also a SMP version which I've not tried.

One thing I noticed is that baseq3 has to be in "~/Library/Application Support/Quake3".

Posted: Sat Feb 04, 2006 5:38 pm
by NCG_Mike
Got it working on Intel...

http://homepage.mac.com/only_mortal/scr ... X-i386.jpg

Took a few hours, most of which was compiling SDL and Q3A.

Posted: Sun Feb 05, 2006 3:40 am
by S@M
nice work,
did it feel slower or about the same? you noticed and fps drop, any other issues?
Is it a problem with copyright etc? to do this

Posted: Sun Feb 05, 2006 5:22 am
by Canis
Yeah! Benchmark it with respect to the PPC version! :)

...unless you're not using a production intel mac.

Posted: Mon Feb 06, 2006 10:25 am
by S@M
so older games like q3, wolfie etc wont play on an intel mac unless compiled?

THAT SUCS

Posted: Mon Feb 06, 2006 10:30 am
by Canis
I think they'll play, just not well, because the rosetta translator will bottleneck performance. They've got benchmarks of various ppc games running on intel, and they're roughly 1/3 the performance.

Posted: Mon Feb 06, 2006 10:47 am
by S@M
I dont know what to do then, I want a new computer, want to stay mac, want to play q3 for ever, and want to play bf2 etc as well. grrrr. cant have 2 computers,

Posted: Mon Feb 06, 2006 6:24 pm
by NCG_Mike
I couldn't get near the iMac today as someone's using it.

Posted: Tue Feb 07, 2006 3:51 am
by dzjepp
You can't play online with a modified exe can you (checksum will differ from original), and 1.32 punkbuster won't allow it, as well as sv_pure 1. :paranoid:

*runs away from mac disc. where he dosen't belong*

Posted: Tue Feb 07, 2006 4:48 am
by S@M
If I cant play q3 on it, I am NOT getting a mac, end of story. But obviously a very sad ending :(

dzj, u belong everywhere dont worry bout that!

Posted: Tue Feb 07, 2006 4:51 am
by dzjepp
So basically it has problems working on intel macs?

Posted: Tue Feb 07, 2006 4:57 am
by S@M
Not sure... Mike had to compile it to get it working and then it was average...
come back Mike....

Posted: Tue Feb 07, 2006 7:03 am
by Canis
dzjepp wrote:You can't play online with a modified exe can you (checksum will differ from original), and 1.32 punkbuster won't allow it, as well as sv_pure 1. :paranoid:

*runs away from mac disc. where he dosen't belong*
I'm not sure. I'd expect it at least has the potential to be fine.

Posted: Tue Feb 07, 2006 9:06 pm
by NCG_Mike
It's slower than the original version but I'm not sure that matters too much unless you're sub-PowerBook level.

There's a SMP version of the binary which I can compile. I've not ran that yet as the Intel box I have around is the DTK. This will probably be fine on the iMac with its dual core CPU.

Posted: Tue Feb 07, 2006 9:10 pm
by NCG_Mike
I'm pretty sure it'll work on-line, though obviously not on Punk Buster servers. There's also a dedicated server that ships with the sources.

Posted: Tue Feb 07, 2006 10:00 pm
by S@M
thats a shame, most of the servers left in Australia are pb servers, even private ones tend to have pb.

fark!! :(

Posted: Tue Feb 07, 2006 10:02 pm
by Canis
How well does it run under Rosetta?

Posted: Tue Feb 07, 2006 10:08 pm
by S@M
just came across this website:
http://wiki.osx86project.org/wiki/index.php/PPC_Games

suggests q3 should run okay, but does not mention pb related issues or if the networking was public multiplayer or lan....
another suggestion from a diff forum:
http://wiki.osx86project.org/wiki/index.php/Darwine
using Darwine which is a form of wine (of course I have nfi about these) but are they reasonable options? Something the community could do?

Posted: Wed Feb 08, 2006 5:57 pm
by NCG_Mike
Okay, I got near the iMac for an hour today and built a universal binary with XCode 2.2 (GCC 4) and some optimizations specific for each processor (Altivec and SSE3) along with -Os code optimization.

The test was at 640x480 in a window with sound at low quality (to avoid an OpenAL crash). I ran a timedemo on the default demo twice and took a screen shot of the final results. Note that it seems to be using a software renderer for audio...

The machine specs were:

- 20" iMac dual core with 512MB of RAM (as supplied by Apple)
- 2Ghz dual G5 with 1.5GB of RAM

Both have the latest OS installed.

http://homepage.mac.com/only_mortal/scr ... Q3I386.jpg
http://homepage.mac.com/only_mortal/scr ... /Q3PPC.jpg

Note the Intel based system is quite a bit faster!

Posted: Thu Feb 09, 2006 7:34 am
by S@M
woah, thats a good improvement. I guess there is no question of it being legit on pb servers though.

What is going to happen to games like wolfenstein that were brought out for mac, theyre not likely to produce intel optimised versions are they.... :(

I guess teh next edition would be tho....