diff --git a/desmume/src/saves.cpp b/desmume/src/saves.cpp index d8a71c77d..9975a8c9b 100644 --- a/desmume/src/saves.cpp +++ b/desmume/src/saves.cpp @@ -386,6 +386,29 @@ SFORMAT reserveChunks[] = { { 0 } }; +#ifdef MSB_FIRST +/* endian-flips count bytes. count should be even and nonzero. */ +static INLINE void FlipByteOrder(u8 *src, u32 count) +{ + u8 *start=src; + u8 *end=src+count-1; + + if((count&1) || !count) + return; /* This shouldn't happen. */ + + while(count--) + { + u8 tmp; + + tmp=*end; + *end=*start; + *start=tmp; + end--; + start++; + } +} +#endif + static bool s_slot1_loadstate(EMUFILE* is, int size) { u32 version = is->read32le(); diff --git a/desmume/src/types.h b/desmume/src/types.h index 1cfd8a95e..4c784b760 100644 --- a/desmume/src/types.h +++ b/desmume/src/types.h @@ -294,28 +294,6 @@ typedef enum ARM7 = 1 } cpu_id_t; -///endian-flips count bytes. count should be even and nonzero. -inline void FlipByteOrder(u8 *src, u32 count) -{ - u8 *start=src; - u8 *end=src+count-1; - - if((count&1) || !count) return; /* This shouldn't happen. */ - - while(count--) - { - u8 tmp; - - tmp=*end; - *end=*start; - *start=tmp; - end--; - start++; - } -} - - - inline u64 double_to_u64(double d) { union { u64 a;