This evening I successfully compiled and ran an OpenTyrian port for MacIntel. I'm keen on adding support for big endian processors, so I can compile and test a PowerPC port. Before I jump into the code, I would like some feedback from the team on which would be the preferred method for reading the Tyrian little-endian data. Here are three methods I've considered implementing:
1. Simply insert relevant SDL byte swapping macro after each fread statement that reads more than one byte.
2. Single "little-endian fread" function with the same interface as fread. Contains switch statement for passed byte size, which chooses relevant byte swap.
3. A set of "little-endian fread" functions depending on byte size, such as le_fread16, le_fread32, le_fread64.
My preference is for the second method. This would be very simple to integrate with the existing code. The third method I wouldn't mind implementing, but would involve slightly more effort, as function parameters would have to be modified throughout the code. I think the first method would add too much messiness to the code and shouldn't even really be considered .
What's the opinion of the OpenTyrian team? I'm eager to do this ASAP.
Has there been any progress made on this front? Whether or not it's yet in the main body of code, it would at least be nice for some endian-fixing code to be available for use testing OpenTyrian on PPC Macs, like mine, in order to get the program to run.
(A friend of mine has successfully gotten the code to run on an Intel Mac, but obviously it crashes on PPC-based Macs, and he thinks that writing his own endian-conversion code would be above his skills, currently.)