OSX86 port

Discussion about other and unofficial ports of ScummVM

Moderator: ScummVM Team

ZildjianKX
Posts: 9
Joined: Wed Mar 08, 2006 9:43 am

Post by ZildjianKX »

fingolfin wrote:It depends on how you performed the conversion, so it's kinda hard to say for sure from the distance. Did you use flippers for the conversion, or what changes did you make precisely?

You could try to replace
simpleNoteRequest.info.flags = 0;
simpleNoteRequest.info.polyphony = 11;

WRITE_BE_UINT16(& simpleNoteRequest.info.flags, 0);
WRITE_BE_UINT16(& simpleNoteRequest.info. polyphony, 11);

etc.
Many thanks. That "fixed it"... or so I think so far :)

The error I'm getting now is:

/usr/bin/ld: Undefined symbols:
__hq2x_16
__hq3x_16
collect2: id returned 1 exit status


I know you're probably busy, but any help would be greatly appreciated.
User avatar
Vinterstum
ScummVM Developer
Posts: 580
Joined: Sun Oct 16, 2005 6:59 am

Post by Vinterstum »

fingolfin wrote:(but if somebody with an x86 Mac and the dev tools wants to help me do this, including compiling the binary for x86, that still would be appreciated, because it is really annoying to have to cross compile tons of libraries ...)
I just got a shipping confirmation from Apple for my new MacBook, which will be my main work laptop. So yeah, count me in :).
rented mule
Posts: 70
Joined: Wed Jan 25, 2006 5:27 pm

Post by rented mule »

Vinterstum wrote:
fingolfin wrote:(but if somebody with an x86 Mac and the dev tools wants to help me do this, including compiling the binary for x86, that still would be appreciated, because it is really annoying to have to cross compile tons of libraries ...)
I just got a shipping confirmation from Apple for my new MacBook, which will be my main work laptop. So yeah, count me in :).
Hurray-a for Vinterstum!!! :)
User avatar
Jimbob
Posts: 307
Joined: Mon Oct 31, 2005 4:36 pm
Location: Somewhere in the UK

Post by Jimbob »

Vinterstum wrote:
fingolfin wrote:(but if somebody with an x86 Mac and the dev tools wants to help me do this, including compiling the binary for x86, that still would be appreciated, because it is really annoying to have to cross compile tons of libraries ...)
I just got a shipping confirmation from Apple for my new MacBook, which will be my main work laptop. So yeah, count me in :).
Lucky you! *grumbles about still using an old G3*
ZildjianKX
Posts: 9
Joined: Wed Mar 08, 2006 9:43 am

Post by ZildjianKX »

ZildjianKX wrote:
fingolfin wrote:It depends on how you performed the conversion, so it's kinda hard to say for sure from the distance. Did you use flippers for the conversion, or what changes did you make precisely?

You could try to replace
simpleNoteRequest.info.flags = 0;
simpleNoteRequest.info.polyphony = 11;

WRITE_BE_UINT16(& simpleNoteRequest.info.flags, 0);
WRITE_BE_UINT16(& simpleNoteRequest.info. polyphony, 11);

etc.
Many thanks. That "fixed it"... or so I think so far :)

The error I'm getting now is:

/usr/bin/ld: Undefined symbols:
__hq2x_16
__hq3x_16
collect2: id returned 1 exit status


I know you're probably busy, but any help would be greatly appreciated.
Anyone, anyone? :lol:
User avatar
Jimbob
Posts: 307
Joined: Mon Oct 31, 2005 4:36 pm
Location: Somewhere in the UK

Post by Jimbob »

ZildjianKX wrote:
ZildjianKX wrote: Many thanks. That "fixed it"... or so I think so far :)

The error I'm getting now is:

/usr/bin/ld: Undefined symbols:
__hq2x_16
__hq3x_16
collect2: id returned 1 exit status


I know you're probably busy, but any help would be greatly appreciated.
Anyone, anyone? :lol:
These are probably defined in the hq2x and hq3x .cpp or .h files, is everything compiling OK apart from this linking error? Is it linking in hq2x.o and hq3x.o? For me it's hard to tell what's going on, a developer who knows the code will be able to pinpoint the problem quicker.
User avatar
Vinterstum
ScummVM Developer
Posts: 580
Joined: Sun Oct 16, 2005 6:59 am

Post by Vinterstum »

ZildjianKX wrote: Anyone, anyone? :lol:
Run configure with --disable-nasm for the time being, that should fix it.
You may also run into the problem of the build system assuming you're running with Altivec support, which you can hack by editing configure and commenting out these lines:

DEFINES="$DEFINES -DHAS_ALTIVEC"
CXXFLAGS="$CXXFLAGS -faltivec"

Should be at around line 788.

Good luck :). With these changes it should compile.

As you may be able to tell, I've gotten my MacBook :). I've fixed most of these things on my end, but I'm still trying to get Nasm (or rather, hq2/3x_i386.asm) to work before I commit anything. Scummvm compiles and links with it after a few changes, but crashes when I try to use HQ scaling in a game. Still trying to figure out why, maybe the assembly code won't work in Mach O binary format without some changes, or something. Not really my field.

Otherwise things work fine though!
ZildjianKX
Posts: 9
Joined: Wed Mar 08, 2006 9:43 am

Post by ZildjianKX »

Vinterstum wrote:
ZildjianKX wrote: Anyone, anyone? :lol:
Run configure with --disable-nasm for the time being, that should fix it.
You may also run into the problem of the build system assuming you're running with Altivec support, which you can hack by editing configure and commenting out these lines:

DEFINES="$DEFINES -DHAS_ALTIVEC"
CXXFLAGS="$CXXFLAGS -faltivec"

Should be at around line 788.

Good luck :). With these changes it should compile.

As you may be able to tell, I've gotten my MacBook :). I've fixed most of these things on my end, but I'm still trying to get Nasm (or rather, hq2/3x_i386.asm) to work before I commit anything. Scummvm compiles and links with it after a few changes, but crashes when I try to use HQ scaling in a game. Still trying to figure out why, maybe the assembly code won't work in Mach O binary format without some changes, or something. Not really my field.

Otherwise things work fine though!
Thanks, you rock.

Two quick questions, did you end up editing the coreaudio.cpp or quicktime.cpp for endianness?

Also, is there a special argument for 'make' to create the OS X application wrapper? I see it inside 'make' but I'm not quite sure how to create it.

Thanks!
User avatar
Jimbob
Posts: 307
Joined: Mon Oct 31, 2005 4:36 pm
Location: Somewhere in the UK

Post by Jimbob »

ZildjianKX wrote:Also, is there a special argument for 'make' to create the OS X application wrapper? I see it inside 'make' but I'm not quite sure how to create it.

Thanks!
'make bundle' creates the ScummVM.app (well it does on G3).
ZildjianKX
Posts: 9
Joined: Wed Mar 08, 2006 9:43 am

Post by ZildjianKX »

Jimbob wrote:
ZildjianKX wrote:Also, is there a special argument for 'make' to create the OS X application wrapper? I see it inside 'make' but I'm not quite sure how to create it.

Thanks!
'make bundle' creates the ScummVM.app (well it does on G3).
Thanks.

Hey Vinterstum, any luck getting FLAC to compile? I tried with darwinports and the fix on the mailing list, but to no avail.
User avatar
Vinterstum
ScummVM Developer
Posts: 580
Joined: Sun Oct 16, 2005 6:59 am

Post by Vinterstum »

ZildjianKX wrote:
Vinterstum wrote:
ZildjianKX wrote: Anyone, anyone? :lol:
Run configure with --disable-nasm for the time being, that should fix it.
You may also run into the problem of the build system assuming you're running with Altivec support, which you can hack by editing configure and commenting out these lines:

DEFINES="$DEFINES -DHAS_ALTIVEC"
CXXFLAGS="$CXXFLAGS -faltivec"

Should be at around line 788.

Good luck :). With these changes it should compile.

As you may be able to tell, I've gotten my MacBook :). I've fixed most of these things on my end, but I'm still trying to get Nasm (or rather, hq2/3x_i386.asm) to work before I commit anything. Scummvm compiles and links with it after a few changes, but crashes when I try to use HQ scaling in a game. Still trying to figure out why, maybe the assembly code won't work in Mach O binary format without some changes, or something. Not really my field.

Otherwise things work fine though!
Thanks, you rock.

Two quick questions, did you end up editing the coreaudio.cpp or quicktime.cpp for endianness?

Also, is there a special argument for 'make' to create the OS X application wrapper? I see it inside 'make' but I'm not quite sure how to create it.

Thanks!
I haven't made any changes to coreaudio.cpp, and only those changes Fingolfin mentioned earlier in the thread to quicktime.cpp. Not sure if any more are necessary, things seem to work fine so far. I'll go through the sources a bit more throughfully though, to make sure.

And nope, haven't compiled FLAC yet. Mpeg2dec, MAD, ogg vorbis and SDL all worked fine, though. Getting this all crosscompiled together to be able to create an universal binary will be some work, however.

Currently on a few days vacation, and my only internet connection is a 9600 kbps link through my mobile. So doubt I'll be able to try FLAC while I'm away :).
User avatar
aubin
Posts: 14
Joined: Sun Mar 12, 2006 6:46 am
Contact:

Post by aubin »

Vinterstum wrote:Currently on a few days vacation, and my only internet connection is a 9600 kbps link through my mobile. So doubt I'll be able to try FLAC while I'm away :).
I've made a Universal Binary and submitted some patches so you can use that until you're able to make an "official build." It's built with all the same options as the official version.

All the details are: http://forums.scummvm.org/viewtopic.php?t=1069
pedro
Posts: 3
Joined: Mon Apr 17, 2006 4:26 pm

Post by pedro »

fingolfin wrote: You could try to replace
simpleNoteRequest.info.flags = 0;
simpleNoteRequest.info.polyphony = 11;

WRITE_BE_UINT16(& simpleNoteRequest.info.flags, 0);
WRITE_BE_UINT16(& simpleNoteRequest.info. polyphony, 11);
I solved it using this solution instead:

Code: Select all

simpleNoteRequest.info.polyphony.bigEndianValue = EndianU16_NtoB( 11 );
simpleNoteRequest.info.typicalPolyphony.bigEndianValue = EndianU32_NtoB( 0x00010000 );
I also managed to compile and link the asm code using nasm -f macho and double-underscoring the external and global symbols. Unfortunately, as Vinterstum already noted, this is not enough and the program crashes upon entering this code area. I forgot all of my assembly coding skills, so I don't think I'll be able to work around this other than using --disable-nasm for the moment being ;)
fingolfin
Retired
Posts: 1452
Joined: Wed Sep 21, 2005 4:12 pm

Post by fingolfin »

The advantage of using WRITE_BE_UINT16 is that the code still compiles on 10.2 / 10.3, so I'll stick with that (not that I would recommend using the QuickTime MIDI driver to anybody, but that's a different matter).
pedro
Posts: 3
Joined: Mon Apr 17, 2006 4:26 pm

Post by pedro »

fingolfin wrote:The advantage of using WRITE_BE_UINT16 is that the code still compiles on 10.2 / 10.3, so I'll stick with that.
Thanks for the clarification, I'm new to Macs and didn't know that.

Regarding the Intel ASM code, I've made some progress, although it doesn't work yet. Using the trial and error method I've found that the offsets used in the assembly code to retrieve function arguments need to be changed. Specifically, they need to be incremented by 12. So, where the previous code was:

Code: Select all

inbuffer     equ 8
outbuffer    equ 12
Xres         equ 16
Yres         equ 20
srcPitch     equ 24
dstPitch     equ 28
It needs to be changed to:

Code: Select all

inbuffer     equ 20
outbuffer    equ 24
Xres         equ 28
Yres         equ 32
srcPitch     equ 36
dstPitch     equ 40
To be honest, I don't know why this happens, or whether a magic arcane gcc flag can be used to make everything fit together properly. What I do know from running gdb on the modified code is that the function is called, the parameters are retrieved correctly, and the function returns to the right place in the C code. I've seen the assembly function being called a few times, but then the program crashes and it was too late to track it down. I'll try again tonight after work, but I thought this information could also be useful to someone more experienced.

Of course, the additional speed of the assembly optimizations is not required at all on these machines. I just hate unfinished problems ;)
Post Reply