fix bigendian compiling in saves.cpp.

someone ought to test savestate portability between big endian and little endian. to test this easily on little endian only systems we could setup the save system somehow so that it can write in either big or little endian.
This commit is contained in:
zeromus 2009-12-06 18:31:24 +00:00
parent 56468eda49
commit 6f486fc2cf
1 changed files with 3 additions and 2 deletions

View File

@ -857,13 +857,14 @@ static int SubWrite(EMUFILE* os, const SFORMAT *sf)
keyset.insert(sf->desc);
#endif
#ifdef LOCAL_LE
// no need to ever loop one at a time if not flipping byte order
os->fwrite((char *)sf->v,size*count);
#else
if(sz == 1) {
if(size == 1) {
//special case: write a huge byte array
os->fwrite((char *)sf->v,1,count);
os->fwrite((char *)sf->v,count);
} else {
for(int i=0;i<count;i++) {
FlipByteOrder((u8*)sf->v + i*size, size);