This commit is contained in:
twinaphex 2016-08-06 20:59:31 +02:00
parent 0dcb8a6ca8
commit 645a3ed2aa

View File

@ -23,10 +23,7 @@
#include "driver.h"
#include "general.h"
#include "state.h"
#ifdef _MSC_VER
#include <compat/msvc.h>
#endif
#include "video.h"
#define RLSB MDFNSTATE_RLSB //0x80000000
@ -158,13 +155,13 @@ static bool SubWrite(StateMem *st, SFORMAT *sf, const char *name_prefix = NULL)
}
else if(sf->flags & MDFNSTATE_RLSB64)
Endian_A64_NE_to_LE(sf->v, bytesize / sizeof(uint64_t));
Endian_A64_Swap(sf->v, bytesize / sizeof(uint64_t));
else if(sf->flags & MDFNSTATE_RLSB32)
Endian_A32_NE_to_LE(sf->v, bytesize / sizeof(uint32_t));
Endian_A32_Swap(sf->v, bytesize / sizeof(uint32_t));
else if(sf->flags & MDFNSTATE_RLSB16)
Endian_A16_NE_to_LE(sf->v, bytesize / sizeof(uint16_t));
Endian_A16_Swap(sf->v, bytesize / sizeof(uint16_t));
else if(sf->flags & RLSB)
Endian_V_NE_to_LE(sf->v, bytesize);
FlipByteOrder((uint8_t*)sf->v, bytesize);
#endif
// Special case for the evil bool type, to convert bool to 1-byte elements.
@ -194,7 +191,7 @@ static bool SubWrite(StateMem *st, SFORMAT *sf, const char *name_prefix = NULL)
else if(sf->flags & MDFNSTATE_RLSB16)
Endian_A16_LE_to_NE(sf->v, bytesize / sizeof(uint16_t));
else if(sf->flags & RLSB)
Endian_V_LE_to_NE(sf->v, bytesize);
FlipByteOrder((uint8_t*)sf->v, bytesize);
#endif
sf++;
}
@ -355,7 +352,7 @@ static int ReadStateChunk(StateMem *st, SFORMAT *sf, int size)
else if(tmp->flags & MDFNSTATE_RLSB16)
Endian_A16_LE_to_NE(tmp->v, expected_size / sizeof(uint16_t));
else if(tmp->flags & RLSB)
Endian_V_LE_to_NE(tmp->v, expected_size);
FlipByteOrder((uint8_t*)tmp->v, expected_size);
#endif
}
}