summaryrefslogtreecommitdiff
path: root/arm9/lib/NitroSDK/src/FX_mtx22.c
diff options
context:
space:
mode:
authorRevo <projectrevotpp@hotmail.com>2021-07-22 20:46:10 -0400
committerGitHub <noreply@github.com>2021-07-22 20:46:10 -0400
commitb5b9e57dcb55ee1a69ca86c30e90475bb80e3c28 (patch)
tree2e91e60bdb7a9174b16d8ca1b532809d4ae2e5b6 /arm9/lib/NitroSDK/src/FX_mtx22.c
parentc2d91a2d997afd01fa4f40e1e16d5ee85557c9a8 (diff)
parent5bf13c7f48fe91c7902ce50250bc1a5a2398a2ae (diff)
Merge pull request #435 from red031000/master
separate out libs to libc, libnns and NitroSDK
Diffstat (limited to 'arm9/lib/NitroSDK/src/FX_mtx22.c')
-rw-r--r--arm9/lib/NitroSDK/src/FX_mtx22.c28
1 files changed, 28 insertions, 0 deletions
diff --git a/arm9/lib/NitroSDK/src/FX_mtx22.c b/arm9/lib/NitroSDK/src/FX_mtx22.c
new file mode 100644
index 00000000..a74bb25c
--- /dev/null
+++ b/arm9/lib/NitroSDK/src/FX_mtx22.c
@@ -0,0 +1,28 @@
+#include "global.h"
+#include "main.h"
+#include "fx.h"
+
+ARM_FUNC void MTX_ScaleApply22(struct Mtx22 *mtx, struct Mtx22 *dst, fx32 x, fx32 y){
+ dst->_[0] = (fx32)(((fx64)x * mtx->_[0]) >> FX32_INT_SHIFT);
+ dst->_[1] = (fx32)(((fx64)x * mtx->_[1]) >> FX32_INT_SHIFT);
+ dst->_[2] = (fx32)(((fx64)y * mtx->_[2]) >> FX32_INT_SHIFT);
+ dst->_[3] = (fx32)(((fx64)y * mtx->_[3]) >> FX32_INT_SHIFT);
+}
+
+ARM_FUNC 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
+}
+
+THUMB_FUNC asm void MTX_Rot22_(struct Mtx22 *mtx, fx32 sinphi, fx32 cosphi){
+ str r2, [r0, #0x0]
+ str r1, [r0, #0x4]
+ neg r1, r1
+ str r1, [r0, #0x8]
+ str r2, [r0, #0xc]
+ bx lr
+}