Move FlipByteOrder to saves.cpp

This commit is contained in:
twinaphex 2016-08-16 19:34:46 +02:00 committed by zeromus
parent 10b6b1e33a
commit 2759834178
2 changed files with 23 additions and 22 deletions

View File

@ -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();

View File

@ -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;