PDA

View Full Version : Universal Binary?


fyonn
July 9, 2007, 20:38
Hello all,

just a quickie, I was wondering if a Universal binary for the OS X port might be available at some point? as a fairly portable game in the first place I would hope that not too much work would be involved.

are there any plans? it's just that it's the only powerpc code running my this laptop atm, and it makes the little fans whirr :)

cheers
dave

Big Al
July 10, 2007, 03:22
No idea how to do a universal binary, but a couple compiles for mac can be picked up here for now:
http://www.ualberta.ca/~aphillip/angband.html
(both intel and ppc)

takkaria
July 10, 2007, 12:06
No idea how to do a universal binary, but a couple compiles for mac can be picked up here for now:
http://www.ualberta.ca/~aphillip/angband.html
(both intel and ppc)

Could you please take the PPC version, run "make -f Makefile.osx dist" inside the src/ directory, and then put the resulting .dmg file online? I can distribute it as the official OS X build then.

Omnipact
July 10, 2007, 21:34
For a universal binary try command line option (for gcc) '-arch i386,ppc' or something like that.
If that doesn't work try creating a simple project in xcode, change the options so it creates a universal binary, then examine the console output when it compiles.

Omni.

Nolendil
July 10, 2007, 23:29
Just some quick notes concerning the Mac OS X build provided above (thanks, Big Al) :

The "About Angband" window is not up to date. I don't know if this window is specific to this platform.
http://julien.labatut.free.fr/AboutAngband308.png

Otherwise, it seems PNG support for tiles is already in. Great.
However, I found some bugs more or less related with tiles : interpolate seems to do nothing, I can see lines between floor tiles when font size is not 32, equippy chars won't be displayed when "double wide" (shouldn't it be '"width", btw?) is enabled, "Appearance" menu is sometimes not refreshed, display is not correctly refreshed when changing font size...
Anyway I still can't manage to play correctly with tiles (just killed my first character at dlvl 2 by stepping on a trap I hadn't noticed which summoned Mughash), I'm switching back to ascii. At least I gave it another try :)

It seems roguelike keys and messages are a bit messed up too but I didn't look too far.

As this thread is not the most appropriate place, I'll submit those to the bug tracker (along with the others I find) when we have a more official Mac OS X build on which I can test again (was this one compiled from the exact same source revision as the Windows version?).

PS :
Just noticed something that might be nasty.
As stated on another thread, under Mac OS X, the data directory containing the .raw files is put inside ~/Library/Preferences/Angband/ so both of my current installs of Angband (3.0.6 and 3.0.8) must read them from there.
If some changes were made to the edit files between the 2 versions (and I suppose there are), may this produce some weird behaviour or at least not take some changes into account?
Could the data directory be moved to Angband.app/Contents/Resources/lib/ with the rest, in the next Mac OS X build? The other shared directories should cause few troubles I suppose (bone, save, score) but I'm skeptic about this one.

Big Al
July 11, 2007, 04:29
Could you please take the PPC version, run "make -f Makefile.osx dist" inside the src/ directory, and then put the resulting .dmg file online? I can distribute it as the official OS X build then.

You can grab the distribution (PPC) build from the above website now. Good to know about the 'dist' option. (The only way that I made a PPC version and an intel version was compiling it on a PPC and intel-based computer respectively.)

The "About Angband" window is not up to date. I don't know if this window is specific to this platform.Yes, this a mac-specific thing. I updated the src/osx/English.lproj/main.nib file in the above build. It still needs to be updated in the source though (I can post a copy of the main.nib here to if needed since nib files seem rather hard to edit without XCode/InterfaceBuilder.)
Was this one compiled from the exact same source revision as the Windows version?Yes, I believe.

Could the data directory be moved to Angband.app/Contents/Resources/lib/ with the rest, in the next Mac OS X build? The other shared directories should cause few troubles I suppose (bone, save, score) but I'm skeptic about this one.Agreed with this. I often have several versions on Angband on my system.

Regarding universal binaries: I tried adding to the CFLAGS (in makefile.osx) "-arch ppc -arch i386" (which I'm told is the proper way to make a universal binary). Trying this, it compiled all the files fine until it got to main-crb.c, at which point it ran into problems (too advanced for me). Anyway, I think that any mac new enough to be intel-based is fast enough not to be noticeably hampered by running a PPC version, so just did a PPC version in the above build.

fyonn
July 11, 2007, 19:48
Anyway, I think that any mac new enough to be intel-based is fast enough not to be noticeably hampered by running a PPC version, so just did a PPC version in the above build.

whilst all the intel mac's are easily fast enough to run angband PPC, the rosetta emulation core it what works the machine a bit. the noticeable aspect is that it kicks the fans up on a laptop :) okay, okay, I'm nitpicking I know but hey, you gotta try haven't you :)

glad to see some action though :)

now I just need my level 13 paladin to survive a bit longer...

PS. oh, how about remembering the window positions for the subwindows? whenever I reload angband, it forgets them all

Nolendil
July 11, 2007, 21:32
Yes, this a mac-specific thing. I updated the src/osx/English.lproj/main.nib file in the above build.
Nice, thanks.

Yes, I believe.
Ok, so I'll post proper bug reports when I have some time to have another look and test for longer.

PS. oh, how about remembering the window positions for the subwindows? whenever I reload angband, it forgets them all
Weird, it works on my own laptop (native PPC though).

Big Al
July 12, 2007, 07:00
Weird, it works on my own laptop (native PPC though).

On my intel-MacbookPro, it remembers window positions fine also.

takkaria
July 12, 2007, 13:40
No idea how to do a universal binary, but a couple compiles for mac can be picked up here for now:
http://www.ualberta.ca/~aphillip/angband.html
(both intel and ppc)

Disk image now at the proper rephial.org website. Thanks for that!

LoneIgadzra
August 6, 2007, 22:21
Hey guys, the PPC build of Angband 3.0.9 gives me the following error when run:

Cannot create the '/var/root/Library/Preferences/Angband/scores/scores.raw' file!

The 'lib' directory is probably missing or broken. Perhaps the archive was not extracted correctly. See the 'readme.txt' file for more information.

As far as I can tell, it's compiled wrong or something. The path should be '~/Library/Preferences/Angband/scores/scores.raw'. I mean it's no wonder it can't write to /var without root privileges.

(To say nothing of the fact I'm on an Intel Mac, and would also like to know how to make a UB version.)

Big Al
August 7, 2007, 03:29
Heh, odd. I tested this on both 'standard' and 'admin' accounts on both intel and PPC macs when I compiled it (and again just now). In all four cases, angband put the score, save, etc. files exactly where it should be in '~/Library/Preferences/Angband/...'. I'm on a Intel Core Duo, 2GHz, Macbook Pro, OS 10.4.9 and works fine.

Figuring out how to do a UB build is on my list of things to do, but I suspect that I don't really know enough about macs and/or compiling to make one. I'll look into it one of these days.