mirror of
https://github.com/tuz358/cpu-emulator.git
synced 2025-12-18 13:04:35 +03:00
Bug fix
This commit is contained in:
@@ -3,11 +3,10 @@
|
|||||||
uint32_t swap_endian32(uint32_t data){
|
uint32_t swap_endian32(uint32_t data){
|
||||||
uint32_t swapped = 0x00;
|
uint32_t swapped = 0x00;
|
||||||
|
|
||||||
swapped |= data << 24;
|
swapped += (data & 0xff000000) >> 24;
|
||||||
swapped |= (data & 0x0000ff00) << 8;
|
swapped += (data & 0x00ff0000) >> 8;
|
||||||
swapped |= (data & 0x00ff0000) << 8;
|
swapped += (data & 0x0000ff00) << 8;
|
||||||
swapped |= data >> 24;
|
swapped += (data & 0x000000ff) << 24;
|
||||||
|
|
||||||
return swapped;
|
return swapped;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user