|
#1
| |||
| |||
| 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? |
|
#2
| ||||
| ||||
| What are you trying to do exactly? |
|
#3
| ||||
| ||||
| 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.
__________________ MacBook Pro 2.16GHz Core2Duo 3GB RAM, G4 1.4GHz OSX Tiger 1.25GB RAM, Dual 2GHz G5 OSX Tiger 2GB RAM (freakin shweet) Athlon 64 Windoze XP for school work (programming) 1GB RAM dferns@macosx.com |
|
#4
| ||||
| ||||
| 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.
__________________ I am but a lonely shadow, Doomed forever to roam and wander. But if you allow me to pause before I must go, I'll spin you tales of mystery and wonder. Site: Night Productions |
|
#5
| |||
| |||
| i see, thank you... i just found a weblink to a little endian/big endian essay... |
![]() |
| Thread Tools | |
|
|