Remember me

Lost Password?

Register now!


Who's Online
91 user(s) are online (69 user(s) are browsing Forums)

Members: 0
Guests: 91


Support us!


Report message:*

Re: DevilutionX - Diablo 1

Subject: Re: DevilutionX - Diablo 1
by kas1e on 2019/2/3 13:41:11

Once you see anything about byteoffsets, headers and stuff when it come to reading files to memory , you can be on 99% sure it is Endianes which cause issues.

To add to Han's answer, you also may use SDL's endian conversion functions:

#define     SDL_SwapLE16(X)   (X)
#define     SDL_SwapLE32(X)   (X)
#define     SDL_SwapLE64(X)   (X)
#define     SDL_SwapBE16(X)   SDL_Swap16(X)
#define     SDL_SwapBE32(X)   SDL_Swap32(X)
#define     SDL_SwapBE64(X)   SDL_Swap64(X)

And for gcc if you use any old one (like one from SDK), just build latest one from adtools repo, so to have 8.2.0. It is well tested already.

Powered by XOOPS 2.0 © 2001-2016 The XOOPS Project