Sign in to follow this  

Porting PC games to Mac?

This topic is 4546 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Recommended Posts

Hi all, I was wondering if anyone could point me any resource (books, internet tutorial, etc) or share me some advices on dealing PC games porting to Mac. So far the fundamental problem is: 1. Byte-swapping. 2. Need to mimic what Direct-X does with OpenGL. And I want to know what do you think about this book? - Cross-platform game programming by Steven GoodWin. For me, I haven't spent too much time with this book but I like the scope that he covers in the book (CPU, file-system, memory management, etc). Thank you

Share this post


Link to post
Share on other sites
Well start with the obvious, then work your way towards the non-obvious..;)

Naturally, use a cross-platform library of some kind that runs on both PC and Mac. SDL is good place to start.

Next, for your 3D API (should you choose to use 3D), you'll probably just want to stick with OpenGL. It's cross platform and all that good stuff. I'm not sure what you mean by mimicking DirectX....*shrug*

Next, you need to be aware of the Little Endian/Big Endian issues to make sure your code is compatible. The SDL library has a few functions here to help you out..

For sound effects, I would recommend SDL_Mixer or OpenAL, and for image loading, I'd suggest SDL_Image...all 3 of those libraries are cross platform and should help you out..

hth,

Share this post


Link to post
Share on other sites

About the word "mimicking" might not be the right one, I don't know how to explain it in a simple way.

Maybe I should use a scenario to explain the fundamental problem #2 more better.
I have a 3D PC games that uses Direct3D. Now I need to port it to Mac, and I am using OpenGL for the 3D. It has to perform identically or better to the PC version.

Thx for all the inputs and advices.

Share this post


Link to post
Share on other sites
Nope, I don't have any source code at all.

I am just trying to get informations as much as possible to know the details on how the porting is going to be.

This is for my upcoming interview that I am going to have, btw :)

Thx for asking the qs, Nypyren.

Share this post


Link to post
Share on other sites
Yes, if you get ahold of an x86 Apple machine, then you don't have to deal with architecture-specific machine code conversion (which is so tedious that it's not really worth doing unless you're obsessed and insane, like me).


I'm reverse engineering 150,000 lines of IA32 assembly from a Win32 port of an early 1990's game into C by hand. There're 1200 functions, and each one can take between a day and a week to decode, and to remote debug/breakpoint, guess what the variables do, test theories about code function, and what the freaking nested and multicondition "if" statements look like. I lucked out because: 90% of the variables are globals, they hardly use any data structures of any significance at all, and they're using a REALLY thin DirectX wrapper to support the features of the old DOS game. I've spent probably 7 months on it and I'm about 15% of the way done. (Don't ask why; I'm insane.)

I would say: Don't even try porting the executable for a modern 3D game (which is orders of magnitude more complex than what I'm doing) from Intel to non-Intel architecture; You will give up before you're even 1% of the way done. Compilers do some really horrible things to the final machine code that makes it a serious pain to look at and quickly figure out what's going on.


When most people talk about "port X to Y" they usually have the source code available. I don't think you'll be able to do this in time for your interview unfortunately. I would say that if your interview is for a company that is in the business of porting games between platforms, you'd be better off learning the differences in platforms (like you said, byte order between x86 and the Apple-style processors are reversed). Showing that kind of knowledge in the hopes of getting a job porting games would work better than trying to do something incredibly difficult like porting-without-source-code.

Share this post


Link to post
Share on other sites
Wow...Nypyren, may I ask why you try to port that game ? *grin*
I hope that you at least got something positive out of it other than countless of restless night, and tons of caffeine :)

Yeah, that's what my goal is to just get some knowledge on the cross-platforming programming especially from PC to Mac.

And I guess that I have to religiously read "Cross-platform game programming" by Steven GoodWin.

Thank you again for all the inputs.

Share this post


Link to post
Share on other sites

This topic is 4546 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

Sign in to follow this