forked from Ports/perfect_dark
replace the byte swapping macros with the ones from platform.h rename and move things to match the rest of the code
replace the byte swapping macros with the ones from platform.h rename and move things to match the rest of the code