summaryrefslogtreecommitdiff
path: root/arm9/asm/MSL_string_extras.s
diff options
context:
space:
mode:
authorAkira Akashi <rubenru09@aol.com>2021-06-03 02:48:35 +0100
committerGitHub <noreply@github.com>2021-06-03 02:48:35 +0100
commit33a7ec1fd719b9321357aa59460cbdb9f7779053 (patch)
tree993c0c156f6a3c310cccd2a3e0ac802b59ab149e /arm9/asm/MSL_string_extras.s
parent7e32d3758e7e36d7a67a1442cdb9386f9aa18a6e (diff)
parent6e3af5fa580d0f6aca3bb310d979323bf2a09a84 (diff)
Merge pull request #400 from PikalaxALT/doc_heap_etc
SDK-informed refactoring
Diffstat (limited to 'arm9/asm/MSL_string_extras.s')
-rw-r--r--arm9/asm/MSL_string_extras.s46
1 files changed, 46 insertions, 0 deletions
diff --git a/arm9/asm/MSL_string_extras.s b/arm9/asm/MSL_string_extras.s
new file mode 100644
index 00000000..c3b09fe9
--- /dev/null
+++ b/arm9/asm/MSL_string_extras.s
@@ -0,0 +1,46 @@
+ .include "asm/macros.inc"
+ .include "global.inc"
+
+ .text
+
+ arm_func_start stricmp
+stricmp: ; 0x020E9AD0
+ stmdb sp!, {r3,lr}
+ ldr r3, _020E9B34 ; =__lower_mapC
+_020E9AD8:
+ ldrb r2, [r0], #0x1
+ cmp r2, #0x0
+ blt _020E9AF0
+ cmp r2, #0x80
+ bge _020E9AF0
+ ldrb r2, [r3, r2]
+_020E9AF0:
+ ldrb lr, [r1], #0x1
+ and r12, r2, #0xff
+ cmp lr, #0x0
+ blt _020E9B0C
+ cmp lr, #0x80
+ bge _020E9B0C
+ ldrb lr, [r3, lr]
+_020E9B0C:
+ and r2, lr, #0xff
+ cmp r12, r2
+ mvncc r0, #0x0
+ ldmccia sp!, {r3,pc}
+ movhi r0, #0x1
+ ldmhiia sp!, {r3,pc}
+ cmp r12, #0x0
+ bne _020E9AD8
+ mov r0, #0x0
+ ldmia sp!, {r3,pc}
+ .balign 4
+_020E9B34: .word __lower_mapC
+ arm_func_end stricmp
+
+ arm_func_start strnicmp
+strnicmp: ; 0x020E9B38
+ ldr ip, _020E9B40 ; =stricmp
+ bx r12
+ .balign 4
+_020E9B40: .word stricmp
+ arm_func_end strnicmp