Plese help me

cypher35

Registered
i am in the process of porting an app that extracts Xbox *.xpr files so you can edit the texture data of games like Dead or Alive 3...

in the source code, he typedefs "dword" as an unsigned int and includes the dword type in all of his structs for the xpr file structure.

For some odd reason, when i compile it on my mac and run it in the unix terminal, the dwords' Hex values are switched around.

Here's the output in DOS:
XPR0 magic header: 30525058
Filesize: 1677312 (0x199800)
Headersize: 112640 (0x1b800)

Here's the same output in the terminal:
XPR0 magic header: 58505230
Filesize: 9967872 (0x981900)
Headersize: 12058880 (0xb80100)

please help me figure out why... a friend suggested that the intel processer does this "switch" automaticly, but is there a way to change this for compilation on mac?
 
I believe DWORD on a PC is defined as an unsigned long. I don't know if that would change the order of the hex values.
 
It's the byte-order - Intel machines are little-endian and Macs are big-endian.

You'll need to swap the byte order around for it to work correctly.
 
Back
Top