summaryrefslogtreecommitdiff
path: root/asm/CP_arm9.s
diff options
context:
space:
mode:
authorRevo <projectrevotpp@hotmail.com>2020-04-25 20:07:22 -0400
committerGitHub <noreply@github.com>2020-04-25 20:07:22 -0400
commitf08350ee4d2b7568fba5a1b72eb7278812f7adcc (patch)
tree4bfd7ec0733028751f628847371c920ea975c91a /asm/CP_arm9.s
parent5f1de106f34d57da41173aaa25422cdee7eca72d (diff)
parent143e670e14d18a56f3465ebf1ee3d22a985da25a (diff)
Merge pull request #26 from PikalaxALT/pikalax_work
Disassemble ITCM and split unk_020C9C2C.s
Diffstat (limited to 'asm/CP_arm9.s')
-rw-r--r--asm/CP_arm9.s42
1 files changed, 42 insertions, 0 deletions
diff --git a/asm/CP_arm9.s b/asm/CP_arm9.s
new file mode 100644
index 00000000..c756e8e2
--- /dev/null
+++ b/asm/CP_arm9.s
@@ -0,0 +1,42 @@
+ .include "asm/macros.inc"
+ .include "global.inc"
+ .section .text
+
+ arm_func_start CP_SaveContext
+CP_SaveContext: ; 0x020D3648
+ ldr r1, _020D3684 ; =0x04000290
+ stmdb sp!, {r4}
+ ldmia r1, {r2-r4,r12}
+ stmia r0!, {r2-r4,r12}
+ ldrh r12, [r1, #-0x10]
+ add r1, r1, #0x28
+ ldmia r1, {r2-r3}
+ stmia r0!, {r2-r3}
+ and r12, r12, #0x3
+ ldrh r2, [r1, #-0x8]
+ strh r12, [r0, #0x0]
+ and r2, r2, #0x1
+ strh r2, [r0, #0x2]
+ ldmia sp!, {r4}
+ bx lr
+ .balign 4
+_020D3684: .word 0x04000290
+
+ arm_func_start CP_RestoreContext
+CP_RestoreContext: ; 0x020D3688
+ stmdb sp!, {r4}
+ ldr r1, _020D36C0 ; =0x04000290
+ ldmia r0, {r2-r4,r12}
+ stmia r1, {r2-r4,r12}
+ ldrh r2, [r0, #0x18]
+ ldrh r3, [r0, #0x1a]
+ strh r2, [r1, #-0x10]
+ strh r3, [r1, #0x20]
+ add r0, r0, #0x10
+ add r1, r1, #0x28
+ ldmia r0, {r2-r3}
+ stmia r1, {r2-r3}
+ ldmia sp!, {r4}
+ bx lr
+ .balign 4
+_020D36C0: .word 0x04000290