PC to MAC conversion?

BlitzPlus Forums/BlitzPlus Programming/PC to MAC conversion?

Slomas(Posted 2010) [#1]
Hi-

I created a word game for someone who is asking about the
feasibility of of a MAC version.

Anyone know how similar the syntax is, could the code be cut,
pasted with some adjsutment or would it have to be re-written?

Any help much appreciated..

Steve


xlsior(Posted 2010) [#2]
If you don't use any 3rd party stuff, then the conversion is fairly straightforward: you can't use the DirectX vidreo driver and the DirectSound audio driver on the mac. If you don't specify these explicitly, then you should be good to go already.
If you are using 3rd party modules, then there may be other limitations or restrictions.

If you use MaxGUI, then keep in mind that Apple people typically expect a different window layout than windows people would. Even though it'd work without changes, you may need some usability tweaks or it may look 'weird' to people.

you'll need a Mac to create the mac executables though, can't do that from a PC.

Keep in mind that there are two flavors of Mac out there: the intel macs (anything fairly recent) and the older legacy PPC macs.

If you want to compile your work for the PowerPC mac, then you may need additional code changes: the bit order that information is stored in memory is different on powerpc platform than it is on intel. The built-in blitzmax functions all take this into account already, but if you have any files that read/write info such as for example level data or highscore information, you may need some small tweaks to makle sure that is loaded properly.

In streams, you can specify little-endian or big-endian which indicate how to parse and store the data.
Intel is Little-endian, power-PC is Big-Endian.
If you want to deal with the same external files you'd have to do something like this on PowerPC macs:
HighScoreFile = ReadFile( "littleendian::media\data\highscores.dat" )

That'll automatically convert the data to it's consistent for both.

If you stick with Intel Mac only, then you can forget the above and may be able to compile without any changes at all.


Who was John Galt?(Posted 2010) [#3]
Well, this is in the B+ section, so I will assume you are using that. You will need to convert to BlitzMax and compile with that to get a Mac version. Max is very similar in syntax to B+, so it shouldn't be too difficult.


Slomas(Posted 2010) [#4]
Thanks V. Much for the responses-

Yes the game is in Blitz Plus, so as I understand now, there is no
OS2 version of Blitzplus-

A few questions if I may...

The game uses some DLL's also-might this cause complications?

Also this game uses a lot of Window's file handling saving/loading, menu's etc- & I know Blitz 3D doesn't support this so much, - does Blitz max?

(I'm thinking it might be easier & better just to re-write in BlitzMax-)

I have Mac Powerbook about 10 years old- would this be a
decent test for compatibility with most Macs?

Thanks for the help! I'd have had to turn down a few jobs without this forum!


xlsior(Posted 2010) [#5]
Oops, didn't see that this was BlitzPlus, my answer above applied to Blitzmax.

If you're dealing with blitzplus source, then you'll be looking at a fairly significant re-write since there are a lot of differences between blitzplus and (for example) blitzmax.

Also, you can forget about DLL's: those are windows-only, and will not work at all on the Mac. There are similar libraries available on the mac that you can call, but it's not just a matter of copying/renaming the DLL and go -- you'll have to find (or create) a mac version of the lbirary in question.

If you have a 10-year old Mac, it's most likely a G3 or G4 PowerPC model.
For over 5 years now, all Macs sold have been based on the Intel chips, and most Mac users would be expecting programs to be in Intel format, not the legacy PowerPC format.
(Of coure, if your ten-year-old system is fast enough to run your program, it means that pretty much any modern machine will run circles around it.)

I know that Blitzmax can create universal binaries on an Intel Mac that will work both on PowerPC and Intel using Brucey's custom BMK, but I don't know if it's possible to create an intel binary on an older PPC model as well...


GaryV(Posted 2010) [#6]
Your BlitzPlus created game/app should run just fine on OS X if you use CrossOver Mac or an equivalent.


Slomas(Posted 2010) [#7]
OK....

so I'm thinking then that the best approach would be to re-write
in Blitzmax for PC avoiding using any DLLs- and then the conversion
shouldn't be to hard if I can find a newer Mac to test it on...

Just one last question, can Blitzmax open operating load/save windows on both PC and Mac directly like Bitzplus can?(and Bltz 3D can't?)-(This was the reason for using Blitzplus in the first place)

Many thanks


xlsior(Posted 2010) [#8]
Yes. Blitzmax has built-in load/save windows if you're running in windowed mode, and there's also some GUI modules available that can give you that kind of functionality in full screen graphics mode.