From 645a3ed2aa785b52fd7d451635ea79f2b8fbaf3e Mon Sep 17 00:00:00 2001 From: twinaphex Date: Sat, 6 Aug 2016 20:59:31 +0200 Subject: [PATCH] Update --- mednafen/state.cpp | 17 +++++++---------- 1 file changed, 7 insertions(+), 10 deletions(-) diff --git a/mednafen/state.cpp b/mednafen/state.cpp index 7d37179..d4bad16 100644 --- a/mednafen/state.cpp +++ b/mednafen/state.cpp @@ -23,10 +23,7 @@ #include "driver.h" #include "general.h" #include "state.h" - -#ifdef _MSC_VER -#include -#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 } }