From 5c13e8c7426f71e128f370e86845a7b428d32892 Mon Sep 17 00:00:00 2001 From: PikalaxALT Date: Wed, 2 Jun 2021 20:16:39 -0400 Subject: Split cw runtime math routines --- arm9/asm/MSL_string_extras.s | 46 ++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 46 insertions(+) create mode 100644 arm9/asm/MSL_string_extras.s (limited to 'arm9/asm/MSL_string_extras.s') diff --git a/arm9/asm/MSL_string_extras.s b/arm9/asm/MSL_string_extras.s new file mode 100644 index 00000000..9e0b6072 --- /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 -- cgit v1.2.3 From 6e3af5fa580d0f6aca3bb310d979323bf2a09a84 Mon Sep 17 00:00:00 2001 From: PikalaxALT Date: Wed, 2 Jun 2021 20:37:13 -0400 Subject: Fix indentation in .s files --- arm9/asm/MSL_string_extras.s | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'arm9/asm/MSL_string_extras.s') diff --git a/arm9/asm/MSL_string_extras.s b/arm9/asm/MSL_string_extras.s index 9e0b6072..c3b09fe9 100644 --- a/arm9/asm/MSL_string_extras.s +++ b/arm9/asm/MSL_string_extras.s @@ -35,7 +35,7 @@ _020E9B0C: ldmia sp!, {r3,pc} .balign 4 _020E9B34: .word __lower_mapC - arm_func_end stricmp + arm_func_end stricmp arm_func_start strnicmp strnicmp: ; 0x020E9B38 @@ -43,4 +43,4 @@ strnicmp: ; 0x020E9B38 bx r12 .balign 4 _020E9B40: .word stricmp - arm_func_end strnicmp + arm_func_end strnicmp -- cgit v1.2.3