BlitzMax x86 OSX Bank problems

BlitzMax Forums/BlitzMax Programming/BlitzMax x86 OSX Bank problems

OK, I've recently ran into this problem as well. It is an endianess problem related to how PPC and x86 processors store values greater than a byte. Basically, PPC processor store their values hi-byte to lo-byte, while x86 store them lo-byte to hi-byte. You have to take this into account when using the Peek and Poke commands, as the endian settings are used for streams only. You could use a bank stream, but I chose to simply account for the processor in use when doing my Peek/Poking, thus..

?x86
lev.timeLimit=PeekShort(bank,offset+ldLimit)
?PPC
lev.timeLimit=PeekByte(bank,offset+ldLimit)+256*PeekByte(bank,offset+ldLimit+1)
?

As you can see, there are compiler directives to check which processor is being used. As the original file was created on a PC (x86) I simply checked if the program was being compiled on a PPC Mac and simply calculated the correct value using PeekByte instead.

Naturally, this is a little slower, but all my data is transported into an array before the game starts, so speed here is not an issue.

You would do something similar for ints (4 bytes).

Hope that points you in the right direction.