diff options
Diffstat (limited to 'arm9/lib')
-rw-r--r-- | arm9/lib/include/MI_swap.h | 6 | ||||
-rw-r--r-- | arm9/lib/src/MI_swap.c | 16 |
2 files changed, 22 insertions, 0 deletions
diff --git a/arm9/lib/include/MI_swap.h b/arm9/lib/include/MI_swap.h new file mode 100644 index 00000000..433b5804 --- /dev/null +++ b/arm9/lib/include/MI_swap.h @@ -0,0 +1,6 @@ +#ifndef NITRO_MI_SWAP_H_ +#define NITRO_MI_SWAP_H_ + +u32 MI_SwapWord(u32 setData, volatile u32 * destp); + +#endif //NITRO_MI_SWAP_H_ diff --git a/arm9/lib/src/MI_swap.c b/arm9/lib/src/MI_swap.c new file mode 100644 index 00000000..b72e1386 --- /dev/null +++ b/arm9/lib/src/MI_swap.c @@ -0,0 +1,16 @@ +#include "global.h" +#include "MI_swap.h" + +/* + * Exchange 32 bits of data between register and memory. + * + * The SDK also defines an 8-bit version of this routine, + * but it is not linked in pokediamond. + */ + +asm +u32 MI_SwapWord(register u32 setData, register vu32 * destp) +{ + swp setData, setData, [destp] + bx lr +} |