diff options
author | Made <made111@gmx.de> | 2020-05-04 17:01:35 +0200 |
---|---|---|
committer | Made <made111@gmx.de> | 2020-05-04 17:01:35 +0200 |
commit | 246d8051ac7b7535c53d5d180eaf1d97451d31f2 (patch) | |
tree | 683fcfbc70090a185d5b4deefc7b3a586f4db516 /arm9/lib/src | |
parent | 8edaffd4aaddac79b3d15148783a74fa508c3edc (diff) |
Decompile FX_mtx22.s
Diffstat (limited to 'arm9/lib/src')
-rw-r--r-- | arm9/lib/src/FX_mtx22.c | 30 |
1 files changed, 30 insertions, 0 deletions
diff --git a/arm9/lib/src/FX_mtx22.c b/arm9/lib/src/FX_mtx22.c new file mode 100644 index 00000000..fcd634b1 --- /dev/null +++ b/arm9/lib/src/FX_mtx22.c @@ -0,0 +1,30 @@ +#include "global.h" +#include "main.h" +#include "fx.h" + +void MTX_ScaleApply22(struct Mtx22 *mtx, struct Mtx22 *dst, s32 x, s32 y){ + dst->_[0] = ((s64)x * mtx->_[0]) >> FX32_INT_SHIFT; + dst->_[1] = ((s64)x * mtx->_[1]) >> FX32_INT_SHIFT; + dst->_[2] = ((s64)y * mtx->_[2]) >> FX32_INT_SHIFT; + dst->_[3] = ((s64)y * mtx->_[3]) >> FX32_INT_SHIFT; +} + +asm void MTX_Identity22_(struct Mtx22 *mtx){ + mov r1, #0x0 + mov r2, #0x1000 + mov r3, #0x0 + stmia r0!, {r2-r3} + stmia r0!, {r1-r2} + bx lr +} + +#pragma thumb on +asm void MTX_Rot22_(struct Mtx22 *mtx, s32 sinphi, s32 cosphi){ + str r2, [r0, #0x0] + str r1, [r0, #0x4] + neg r1, r1 + str r1, [r0, #0x8] + str r2, [r0, #0xc] + bx lr +} +#pragma thumb off |