Files
cpu-emulator/utils.cpp
2018-03-04 21:57:15 +09:00

13 lines
276 B
C++

#include "include/utils.h"
uint32_t swap_endian32(uint32_t data){
uint32_t swapped = 0x00;
swapped += (data & 0xff000000) >> 24;
swapped += (data & 0x00ff0000) >> 8;
swapped += (data & 0x0000ff00) << 8;
swapped += (data & 0x000000ff) << 24;
return swapped;
}