intel inside macs

S@M
Posts: 1889
Joined: Wed Mar 16, 2005 3:11 am

intel inside macs

Post by S@M »

I have not read much about these, is there any info on how an older game like q3 will play?
"Liberty, what crimes are committed in your name."
NCG_Mike
Posts: 226
Joined: Tue Aug 21, 2001 7:00 am

Post 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.
Canis
Posts: 3798
Joined: Sun Jan 14, 2001 8:00 am

Post by Canis »

Compiled? If you download the source into Xcode and hit compile it will just work on the intel machine?
NCG_Mike
Posts: 226
Joined: Tue Aug 21, 2001 7:00 am

Post 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).
S@M
Posts: 1889
Joined: Wed Mar 16, 2005 3:11 am

Post by S@M »

Woah, it sounds like your going to do this....Mike?
"Liberty, what crimes are committed in your name."
NCG_Mike
Posts: 226
Joined: Tue Aug 21, 2001 7:00 am

Post 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".
NCG_Mike
Posts: 226
Joined: Tue Aug 21, 2001 7:00 am

Post 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.
S@M
Posts: 1889
Joined: Wed Mar 16, 2005 3:11 am

Post 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
"Liberty, what crimes are committed in your name."
Canis
Posts: 3798
Joined: Sun Jan 14, 2001 8:00 am

Post by Canis »

Yeah! Benchmark it with respect to the PPC version! :)

...unless you're not using a production intel mac.
S@M
Posts: 1889
Joined: Wed Mar 16, 2005 3:11 am

Post by S@M »

so older games like q3, wolfie etc wont play on an intel mac unless compiled?

THAT SUCS
"Liberty, what crimes are committed in your name."
Canis
Posts: 3798
Joined: Sun Jan 14, 2001 8:00 am

Post 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.
S@M
Posts: 1889
Joined: Wed Mar 16, 2005 3:11 am

Post 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,
"Liberty, what crimes are committed in your name."
NCG_Mike
Posts: 226
Joined: Tue Aug 21, 2001 7:00 am

Post by NCG_Mike »

I couldn't get near the iMac today as someone's using it.
dzjepp
Posts: 12839
Joined: Wed Mar 28, 2001 8:00 am

Post 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*
S@M
Posts: 1889
Joined: Wed Mar 16, 2005 3:11 am

Post 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!
"Liberty, what crimes are committed in your name."
dzjepp
Posts: 12839
Joined: Wed Mar 28, 2001 8:00 am

Post by dzjepp »

So basically it has problems working on intel macs?
S@M
Posts: 1889
Joined: Wed Mar 16, 2005 3:11 am

Post by S@M »

Not sure... Mike had to compile it to get it working and then it was average...
come back Mike....
"Liberty, what crimes are committed in your name."
Canis
Posts: 3798
Joined: Sun Jan 14, 2001 8:00 am

Post 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.
NCG_Mike
Posts: 226
Joined: Tue Aug 21, 2001 7:00 am

Post 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.
NCG_Mike
Posts: 226
Joined: Tue Aug 21, 2001 7:00 am

Post 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.
S@M
Posts: 1889
Joined: Wed Mar 16, 2005 3:11 am

Post by S@M »

thats a shame, most of the servers left in Australia are pb servers, even private ones tend to have pb.

fark!! :(
"Liberty, what crimes are committed in your name."
Canis
Posts: 3798
Joined: Sun Jan 14, 2001 8:00 am

Post by Canis »

How well does it run under Rosetta?
S@M
Posts: 1889
Joined: Wed Mar 16, 2005 3:11 am

Post 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?
"Liberty, what crimes are committed in your name."
NCG_Mike
Posts: 226
Joined: Tue Aug 21, 2001 7:00 am

Post 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!
S@M
Posts: 1889
Joined: Wed Mar 16, 2005 3:11 am

Post 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....
"Liberty, what crimes are committed in your name."
Locked