pokeemerald/asm/string_util.s

1373 lines
22 KiB
ArmAsm
Raw Normal View History

2016-11-01 16:29:13 +01:00
.include "asm/macros.inc"
2016-11-01 18:08:48 +01:00
.include "constants/constants.inc"
2016-09-03 08:11:29 +02:00
.syntax unified
.text
2015-11-24 21:35:16 +01:00
thumb_func_start CopyString_Limit10
2016-09-03 04:51:16 +02:00
@ u8 *CopyString_Limit10(u8 *dest, u8 *src)
CopyString_Limit10: @ 8008B10
2015-11-24 21:35:16 +01:00
push {r4,r5,lr}
adds r4, r0, 0
movs r5, 0xA
movs r3, 0
2016-01-07 05:23:20 +01:00
_08008B18:
2015-11-24 21:35:16 +01:00
adds r2, r4, r3
adds r0, r1, r3
ldrb r0, [r0]
strb r0, [r2]
lsls r0, 24
lsrs r0, 24
cmp r0, 0xFF
2016-01-07 05:23:20 +01:00
bne _08008B2C
2015-11-24 21:35:16 +01:00
adds r0, r2, 0
2016-01-07 05:23:20 +01:00
b _08008B3C
_08008B2C:
2015-11-24 21:35:16 +01:00
adds r0, r3, 0x1
lsls r0, 24
lsrs r3, r0, 24
cmp r3, r5
2016-01-07 05:23:20 +01:00
bcc _08008B18
2015-11-24 21:35:16 +01:00
adds r0, r4, r3
movs r1, 0xFF
strb r1, [r0]
2016-01-07 05:23:20 +01:00
_08008B3C:
2015-11-24 21:35:16 +01:00
pop {r4,r5}
pop {r1}
bx r1
thumb_func_end CopyString_Limit10
thumb_func_start GetStringEnd_Limit7
2016-09-03 04:51:16 +02:00
@ u8 *GetStringEnd_Limit7(u8 *s)
GetStringEnd_Limit7: @ 8008B44
2015-11-24 21:35:16 +01:00
push {r4,lr}
adds r3, r0, 0
movs r4, 0xA
movs r2, 0
2016-01-07 05:23:20 +01:00
_08008B4C:
2015-11-24 21:35:16 +01:00
adds r1, r3, r2
ldrb r0, [r1]
cmp r0, 0xFF
2016-01-07 05:23:20 +01:00
bne _08008B58
2015-11-24 21:35:16 +01:00
adds r0, r1, 0
2016-01-07 05:23:20 +01:00
b _08008B68
_08008B58:
2015-11-24 21:35:16 +01:00
adds r0, r2, 0x1
lsls r0, 24
lsrs r2, r0, 24
cmp r2, r4
2016-01-07 05:23:20 +01:00
bcc _08008B4C
2015-11-24 21:35:16 +01:00
adds r0, r3, r2
movs r1, 0xFF
strb r1, [r0]
2016-01-07 05:23:20 +01:00
_08008B68:
2015-11-24 21:35:16 +01:00
pop {r4}
pop {r1}
bx r1
thumb_func_end GetStringEnd_Limit7
thumb_func_start CopyString_Limit7
2016-09-03 04:51:16 +02:00
@ u8 *CopyString_Limit7(u8 *dest, u8 *src)
CopyString_Limit7: @ 8008B70
2015-11-24 21:35:16 +01:00
push {r4,r5,lr}
adds r4, r0, 0
movs r5, 0x7
movs r3, 0
2016-01-07 05:23:20 +01:00
_08008B78:
2015-11-24 21:35:16 +01:00
adds r2, r4, r3
adds r0, r1, r3
ldrb r0, [r0]
strb r0, [r2]
lsls r0, 24
lsrs r0, 24
cmp r0, 0xFF
2016-01-07 05:23:20 +01:00
bne _08008B8C
2015-11-24 21:35:16 +01:00
adds r0, r2, 0
2016-01-07 05:23:20 +01:00
b _08008B98
_08008B8C:
2015-11-24 21:35:16 +01:00
adds r3, 0x1
cmp r3, r5
2016-01-07 05:23:20 +01:00
blt _08008B78
2015-11-24 21:35:16 +01:00
adds r0, r4, r3
movs r1, 0xFF
strb r1, [r0]
2016-01-07 05:23:20 +01:00
_08008B98:
2015-11-24 21:35:16 +01:00
pop {r4,r5}
pop {r1}
bx r1
thumb_func_end CopyString_Limit7
thumb_func_start CopyString
2016-09-03 04:51:16 +02:00
@ u8 *CopyString(u8 *dest, u8 *src)
CopyString: @ 8008BA0
2015-11-24 21:35:16 +01:00
push {lr}
adds r3, r0, 0
2016-01-07 05:23:20 +01:00
b _08008BAC
_08008BA6:
2015-11-24 21:35:16 +01:00
strb r2, [r3]
adds r3, 0x1
adds r1, 0x1
2016-01-07 05:23:20 +01:00
_08008BAC:
2015-11-24 21:35:16 +01:00
ldrb r2, [r1]
adds r0, r2, 0
cmp r0, 0xFF
2016-01-07 05:23:20 +01:00
bne _08008BA6
2015-11-24 21:35:16 +01:00
movs r0, 0xFF
strb r0, [r3]
adds r0, r3, 0
pop {r1}
bx r1
thumb_func_end CopyString
thumb_func_start AppendString
2016-09-03 04:51:16 +02:00
@ u8 *AppendString(u8 *dest, u8 *src)
AppendString: @ 8008BC0
2015-11-24 21:35:16 +01:00
push {lr}
adds r2, r0, 0
2016-01-07 05:23:20 +01:00
b _08008BC8
_08008BC6:
2015-11-24 21:35:16 +01:00
adds r2, 0x1
2016-01-07 05:23:20 +01:00
_08008BC8:
2015-11-24 21:35:16 +01:00
ldrb r0, [r2]
cmp r0, 0xFF
2016-01-07 05:23:20 +01:00
bne _08008BC6
2015-11-24 21:35:16 +01:00
adds r0, r2, 0
bl CopyString
pop {r1}
bx r1
thumb_func_end AppendString
thumb_func_start CopyString_LimitN
2016-09-03 04:51:16 +02:00
@ u8 *CopyString_LimitN(u8 *dest, u8 *src, u8 n)
CopyString_LimitN: @ 8008BD8
2015-11-24 21:35:16 +01:00
push {r4-r6,lr}
adds r4, r0, 0
adds r6, r1, 0
lsls r2, 24
lsrs r5, r2, 24
movs r3, 0
adds r0, r5, 0
cmp r3, r0
2016-01-07 05:23:20 +01:00
bcs _08008BFE
2015-11-24 21:35:16 +01:00
adds r2, r0, 0
2016-01-07 05:23:20 +01:00
_08008BEC:
2015-11-24 21:35:16 +01:00
adds r1, r4, r3
adds r0, r6, r3
ldrb r0, [r0]
strb r0, [r1]
adds r0, r3, 0x1
lsls r0, 16
lsrs r3, r0, 16
cmp r3, r2
2016-01-07 05:23:20 +01:00
bcc _08008BEC
_08008BFE:
2015-11-24 21:35:16 +01:00
adds r0, r4, r5
pop {r4-r6}
pop {r1}
bx r1
thumb_func_end CopyString_LimitN
thumb_func_start AppendString_LimitN
2016-09-03 04:51:16 +02:00
@ u8 *AppendString_LimitN(u8 *dest, u8 *src, u8 n)
AppendString_LimitN: @ 8008C08
2015-11-24 21:35:16 +01:00
push {lr}
adds r3, r0, 0
lsls r2, 24
lsrs r2, 24
2016-01-07 05:23:20 +01:00
b _08008C14
_08008C12:
2015-11-24 21:35:16 +01:00
adds r3, 0x1
2016-01-07 05:23:20 +01:00
_08008C14:
2015-11-24 21:35:16 +01:00
ldrb r0, [r3]
cmp r0, 0xFF
2016-01-07 05:23:20 +01:00
bne _08008C12
2015-11-24 21:35:16 +01:00
adds r0, r3, 0
bl CopyString_LimitN
pop {r1}
bx r1
thumb_func_end AppendString_LimitN
thumb_func_start GetStringLength
2016-09-03 04:51:16 +02:00
@ u16 GetStringLength(u8 *s)
GetStringLength: @ 8008C24
2015-11-24 21:35:16 +01:00
push {lr}
adds r2, r0, 0
movs r1, 0
ldrb r0, [r2]
cmp r0, 0xFF
2016-01-07 05:23:20 +01:00
beq _08008C3E
_08008C30:
2015-11-24 21:35:16 +01:00
adds r0, r1, 0x1
lsls r0, 16
lsrs r1, r0, 16
adds r0, r2, r1
ldrb r0, [r0]
cmp r0, 0xFF
2016-01-07 05:23:20 +01:00
bne _08008C30
_08008C3E:
2015-11-24 21:35:16 +01:00
adds r0, r1, 0
pop {r1}
bx r1
thumb_func_end GetStringLength
thumb_func_start CompareString
2016-09-03 04:51:16 +02:00
@ u8 CompareString(u8 *s1, u8 *s2)
CompareString: @ 8008C44
2015-11-24 21:35:16 +01:00
push {lr}
adds r2, r0, 0
2016-01-07 05:23:20 +01:00
b _08008C56
_08008C4A:
2015-11-24 21:35:16 +01:00
cmp r0, 0xFF
2016-01-07 05:23:20 +01:00
bne _08008C52
2015-11-24 21:35:16 +01:00
movs r0, 0
2016-01-07 05:23:20 +01:00
b _08008C64
_08008C52:
2015-11-24 21:35:16 +01:00
adds r2, 0x1
adds r1, 0x1
2016-01-07 05:23:20 +01:00
_08008C56:
2015-11-24 21:35:16 +01:00
ldrb r0, [r2]
ldrb r3, [r1]
cmp r0, r3
2016-01-07 05:23:20 +01:00
beq _08008C4A
2015-11-24 21:35:16 +01:00
ldrb r0, [r2]
ldrb r1, [r1]
subs r0, r1
2016-01-07 05:23:20 +01:00
_08008C64:
2015-11-24 21:35:16 +01:00
pop {r1}
bx r1
thumb_func_end CompareString
2015-11-26 01:43:06 +01:00
thumb_func_start CompareString_LimitN
2016-09-03 04:51:16 +02:00
@ u8 CompareString_LimitN(u8 *s1, u8 *s2, u32 n)
CompareString_LimitN: @ 8008C68
2015-11-24 21:35:16 +01:00
push {r4,lr}
adds r3, r0, 0
2016-01-07 05:23:20 +01:00
b _08008C80
_08008C6E:
2015-11-24 21:35:16 +01:00
cmp r0, 0xFF
2016-01-07 05:23:20 +01:00
beq _08008C7C
2015-11-24 21:35:16 +01:00
adds r3, 0x1
adds r1, 0x1
subs r2, 0x1
cmp r2, 0
2016-01-07 05:23:20 +01:00
bne _08008C80
_08008C7C:
2015-11-24 21:35:16 +01:00
movs r0, 0
2016-01-07 05:23:20 +01:00
b _08008C8E
_08008C80:
2015-11-24 21:35:16 +01:00
ldrb r0, [r3]
ldrb r4, [r1]
cmp r0, r4
2016-01-07 05:23:20 +01:00
beq _08008C6E
2015-11-24 21:35:16 +01:00
ldrb r0, [r3]
ldrb r1, [r1]
subs r0, r1
2016-01-07 05:23:20 +01:00
_08008C8E:
2015-11-24 21:35:16 +01:00
pop {r4}
pop {r1}
bx r1
2015-11-26 01:43:06 +01:00
thumb_func_end CompareString_LimitN
2015-11-24 21:35:16 +01:00
thumb_func_start IsStringLengthLessThanN
2016-09-03 04:51:16 +02:00
@ bool8 IsStringLengthLessThanN(u8 *s, s32 n)
IsStringLengthLessThanN: @ 8008C94
2015-11-24 21:35:16 +01:00
push {lr}
adds r3, r0, 0
movs r2, 0
cmp r2, r1
2016-01-07 05:23:20 +01:00
bge _08008CB8
_08008C9E:
2015-11-24 21:35:16 +01:00
adds r0, r3, r2
ldrb r0, [r0]
cmp r0, 0
2016-01-07 05:23:20 +01:00
beq _08008CAE
2015-11-24 21:35:16 +01:00
cmp r0, 0xFF
2016-01-07 05:23:20 +01:00
beq _08008CAE
2015-11-24 21:35:16 +01:00
movs r0, 0x1
2016-01-07 05:23:20 +01:00
b _08008CBA
_08008CAE:
2015-11-24 21:35:16 +01:00
adds r0, r2, 0x1
lsls r0, 24
lsrs r2, r0, 24
cmp r2, r1
2016-01-07 05:23:20 +01:00
blt _08008C9E
_08008CB8:
2015-11-24 21:35:16 +01:00
movs r0, 0
2016-01-07 05:23:20 +01:00
_08008CBA:
2015-11-24 21:35:16 +01:00
pop {r1}
bx r1
thumb_func_end IsStringLengthLessThanN
thumb_func_start ConvertIntToDecimalString
2016-09-03 04:51:16 +02:00
@ u8 *ConvertIntToDecimalString(u8 *dest, s32 value, u8 mode, u8 numDigits)
ConvertIntToDecimalString: @ 8008CC0
2015-11-24 21:35:16 +01:00
push {r4-r7,lr}
mov r7, r8
push {r7}
adds r4, r0, 0
adds r6, r1, 0
lsls r3, 24
ldr r0, =gPowersOfTen
lsrs r3, 22
subs r3, 0x4
adds r3, r0
ldr r0, [r3]
movs r7, 0
cmp r2, 0x1
2016-01-07 05:23:20 +01:00
bne _08008CDE
2015-11-24 21:35:16 +01:00
movs r7, 0x2
2016-01-07 05:23:20 +01:00
_08008CDE:
2015-11-24 21:35:16 +01:00
cmp r2, 0x2
2016-01-07 05:23:20 +01:00
bne _08008CE4
2015-11-24 21:35:16 +01:00
movs r7, 0x1
2016-01-07 05:23:20 +01:00
_08008CE4:
2015-11-24 21:35:16 +01:00
adds r5, r0, 0
cmp r5, 0
2016-01-07 05:23:20 +01:00
ble _08008D60
2015-11-24 21:35:16 +01:00
ldr r0, =gDigits
mov r8, r0
2016-01-07 05:23:20 +01:00
_08008CEE:
2015-11-24 21:35:16 +01:00
adds r0, r6, 0
adds r1, r5, 0
bl __divsi3
lsls r0, 16
lsrs r2, r0, 16
adds r3, r2, 0
adds r0, r5, 0
muls r0, r2
subs r1, r6, r0
cmp r7, 0x1
2016-01-07 05:23:20 +01:00
bne _08008D26
2015-11-24 21:35:16 +01:00
adds r3, r4, 0
adds r4, 0x1
cmp r2, 0x9
2016-01-07 05:23:20 +01:00
bhi _08008D20
2015-11-24 21:35:16 +01:00
mov r6, r8
adds r0, r2, r6
ldrb r0, [r0]
2016-01-07 05:23:20 +01:00
b _08008D22
2015-11-24 21:35:16 +01:00
.pool
2016-01-07 05:23:20 +01:00
_08008D20:
2015-11-24 21:35:16 +01:00
movs r0, 0xAC
2016-01-07 05:23:20 +01:00
_08008D22:
2015-11-24 21:35:16 +01:00
strb r0, [r3]
2016-01-07 05:23:20 +01:00
b _08008D50
_08008D26:
2015-11-24 21:35:16 +01:00
cmp r2, 0
2016-01-07 05:23:20 +01:00
bne _08008D2E
2015-11-24 21:35:16 +01:00
cmp r5, 0x1
2016-01-07 05:23:20 +01:00
bne _08008D46
_08008D2E:
2015-11-24 21:35:16 +01:00
movs r7, 0x1
adds r2, r4, 0
adds r4, 0x1
cmp r3, 0x9
2016-01-07 05:23:20 +01:00
bhi _08008D40
2015-11-24 21:35:16 +01:00
mov r6, r8
adds r0, r3, r6
ldrb r0, [r0]
2016-01-07 05:23:20 +01:00
b _08008D42
_08008D40:
2015-11-24 21:35:16 +01:00
movs r0, 0xAC
2016-01-07 05:23:20 +01:00
_08008D42:
2015-11-24 21:35:16 +01:00
strb r0, [r2]
2016-01-07 05:23:20 +01:00
b _08008D50
_08008D46:
2015-11-24 21:35:16 +01:00
cmp r7, 0x2
2016-01-07 05:23:20 +01:00
bne _08008D50
2015-11-24 21:35:16 +01:00
movs r0, 0x77
strb r0, [r4]
adds r4, 0x1
2016-01-07 05:23:20 +01:00
_08008D50:
2015-11-24 21:35:16 +01:00
adds r6, r1, 0
adds r0, r5, 0
movs r1, 0xA
bl __divsi3
adds r5, r0, 0
cmp r5, 0
2016-01-07 05:23:20 +01:00
bgt _08008CEE
_08008D60:
2015-11-24 21:35:16 +01:00
movs r0, 0xFF
strb r0, [r4]
adds r0, r4, 0
pop {r3}
mov r8, r3
pop {r4-r7}
pop {r1}
bx r1
thumb_func_end ConvertIntToDecimalString
thumb_func_start ConvertUnsignedIntToDecimalString
2016-09-03 04:51:16 +02:00
@ u8 *ConvertUnsignedIntToDecimalString(u8 *dest, u32 value, u8 mode, u8 numDigits)
ConvertUnsignedIntToDecimalString: @ 8008D70
2015-11-24 21:35:16 +01:00
push {r4-r7,lr}
mov r7, r8
push {r7}
adds r4, r0, 0
adds r6, r1, 0
lsls r3, 24
ldr r0, =gPowersOfTen
lsrs r3, 22
subs r3, 0x4
adds r3, r0
ldr r0, [r3]
movs r7, 0
cmp r2, 0x1
2016-01-07 05:23:20 +01:00
bne _08008D8E
2015-11-24 21:35:16 +01:00
movs r7, 0x2
2016-01-07 05:23:20 +01:00
_08008D8E:
2015-11-24 21:35:16 +01:00
cmp r2, 0x2
2016-01-07 05:23:20 +01:00
bne _08008D94
2015-11-24 21:35:16 +01:00
movs r7, 0x1
2016-01-07 05:23:20 +01:00
_08008D94:
2015-11-24 21:35:16 +01:00
adds r5, r0, 0
cmp r5, 0
2016-01-07 05:23:20 +01:00
ble _08008E10
2015-11-24 21:35:16 +01:00
ldr r0, =gDigits
mov r8, r0
2016-01-07 05:23:20 +01:00
_08008D9E:
2015-11-24 21:35:16 +01:00
adds r0, r6, 0
adds r1, r5, 0
bl __udivsi3
lsls r0, 16
lsrs r2, r0, 16
adds r3, r2, 0
adds r0, r5, 0
muls r0, r2
subs r1, r6, r0
cmp r7, 0x1
2016-01-07 05:23:20 +01:00
bne _08008DD6
2015-11-24 21:35:16 +01:00
adds r3, r4, 0
adds r4, 0x1
cmp r2, 0x9
2016-01-07 05:23:20 +01:00
bhi _08008DD0
2015-11-24 21:35:16 +01:00
mov r6, r8
adds r0, r2, r6
ldrb r0, [r0]
2016-01-07 05:23:20 +01:00
b _08008DD2
2015-11-24 21:35:16 +01:00
.pool
2016-01-07 05:23:20 +01:00
_08008DD0:
2015-11-24 21:35:16 +01:00
movs r0, 0xAC
2016-01-07 05:23:20 +01:00
_08008DD2:
2015-11-24 21:35:16 +01:00
strb r0, [r3]
2016-01-07 05:23:20 +01:00
b _08008E00
_08008DD6:
2015-11-24 21:35:16 +01:00
cmp r2, 0
2016-01-07 05:23:20 +01:00
bne _08008DDE
2015-11-24 21:35:16 +01:00
cmp r5, 0x1
2016-01-07 05:23:20 +01:00
bne _08008DF6
_08008DDE:
2015-11-24 21:35:16 +01:00
movs r7, 0x1
adds r2, r4, 0
adds r4, 0x1
cmp r3, 0x9
2016-01-07 05:23:20 +01:00
bhi _08008DF0
2015-11-24 21:35:16 +01:00
mov r6, r8
adds r0, r3, r6
ldrb r0, [r0]
2016-01-07 05:23:20 +01:00
b _08008DF2
_08008DF0:
2015-11-24 21:35:16 +01:00
movs r0, 0xAC
2016-01-07 05:23:20 +01:00
_08008DF2:
2015-11-24 21:35:16 +01:00
strb r0, [r2]
2016-01-07 05:23:20 +01:00
b _08008E00
_08008DF6:
2015-11-24 21:35:16 +01:00
cmp r7, 0x2
2016-01-07 05:23:20 +01:00
bne _08008E00
2015-11-24 21:35:16 +01:00
movs r0, 0x77
strb r0, [r4]
adds r4, 0x1
2016-01-07 05:23:20 +01:00
_08008E00:
2015-11-24 21:35:16 +01:00
adds r6, r1, 0
adds r0, r5, 0
movs r1, 0xA
bl __divsi3
adds r5, r0, 0
cmp r5, 0
2016-01-07 05:23:20 +01:00
bgt _08008D9E
_08008E10:
2015-11-24 21:35:16 +01:00
movs r0, 0xFF
strb r0, [r4]
adds r0, r4, 0
pop {r3}
mov r8, r3
pop {r4-r7}
pop {r1}
bx r1
thumb_func_end ConvertUnsignedIntToDecimalString
thumb_func_start ConvertIntToHexString
2016-09-03 04:51:16 +02:00
@ u8 *ConvertIntToHexString(u8 *dest, s32 value, u8 mode, u8 numDigits)
ConvertIntToHexString: @ 8008E20
2015-11-24 21:35:16 +01:00
push {r4-r7,lr}
mov r7, r9
mov r6, r8
push {r6,r7}
sub sp, 0x4
adds r6, r0, 0
mov r8, r1
lsls r3, 24
lsrs r3, 24
movs r1, 0x1
movs r0, 0x1
cmp r1, r3
2016-01-07 05:23:20 +01:00
bcs _08008E46
_08008E3A:
2015-11-24 21:35:16 +01:00
lsls r1, 4
adds r0, 0x1
lsls r0, 24
lsrs r0, 24
cmp r0, r3
2016-01-07 05:23:20 +01:00
bcc _08008E3A
_08008E46:
2015-11-24 21:35:16 +01:00
movs r3, 0
cmp r2, 0x1
2016-01-07 05:23:20 +01:00
bne _08008E4E
2015-11-24 21:35:16 +01:00
movs r3, 0x2
2016-01-07 05:23:20 +01:00
_08008E4E:
2015-11-24 21:35:16 +01:00
cmp r2, 0x2
2016-01-07 05:23:20 +01:00
bne _08008E54
2015-11-24 21:35:16 +01:00
movs r3, 0x1
2016-01-07 05:23:20 +01:00
_08008E54:
2015-11-24 21:35:16 +01:00
adds r5, r1, 0
cmp r5, 0
2016-01-07 05:23:20 +01:00
ble _08008ECA
2015-11-24 21:35:16 +01:00
ldr r0, =gDigits
mov r9, r0
2016-01-07 05:23:20 +01:00
_08008E5E:
2015-11-24 21:35:16 +01:00
mov r0, r8
adds r1, r5, 0
str r3, [sp]
bl __divsi3
adds r4, r0, 0
adds r7, r4, 0
mov r0, r8
adds r1, r5, 0
bl __modsi3
adds r1, r0, 0
ldr r3, [sp]
cmp r3, 0x1
2016-01-07 05:23:20 +01:00
bne _08008E90
2015-11-24 21:35:16 +01:00
adds r2, r6, 0
adds r6, 0x1
cmp r4, 0xF
2016-01-07 05:23:20 +01:00
bhi _08008EAA
2015-11-24 21:35:16 +01:00
mov r7, r9
adds r0, r4, r7
ldrb r0, [r0]
2016-01-07 05:23:20 +01:00
b _08008EAC
2015-11-24 21:35:16 +01:00
.pool
2016-01-07 05:23:20 +01:00
_08008E90:
2015-11-24 21:35:16 +01:00
cmp r4, 0
2016-01-07 05:23:20 +01:00
bne _08008E98
2015-11-24 21:35:16 +01:00
cmp r5, 0x1
2016-01-07 05:23:20 +01:00
bne _08008EB0
_08008E98:
2015-11-24 21:35:16 +01:00
movs r3, 0x1
adds r2, r6, 0
adds r6, 0x1
cmp r7, 0xF
2016-01-07 05:23:20 +01:00
bhi _08008EAA
2015-11-24 21:35:16 +01:00
mov r4, r9
adds r0, r7, r4
ldrb r0, [r0]
2016-01-07 05:23:20 +01:00
b _08008EAC
_08008EAA:
2015-11-24 21:35:16 +01:00
movs r0, 0xAC
2016-01-07 05:23:20 +01:00
_08008EAC:
2015-11-24 21:35:16 +01:00
strb r0, [r2]
2016-01-07 05:23:20 +01:00
b _08008EBA
_08008EB0:
2015-11-24 21:35:16 +01:00
cmp r3, 0x2
2016-01-07 05:23:20 +01:00
bne _08008EBA
2015-11-24 21:35:16 +01:00
movs r0, 0x77
strb r0, [r6]
adds r6, 0x1
2016-01-07 05:23:20 +01:00
_08008EBA:
2015-11-24 21:35:16 +01:00
mov r8, r1
adds r0, r5, 0
cmp r5, 0
2016-01-07 05:23:20 +01:00
bge _08008EC4
2015-11-24 21:35:16 +01:00
adds r0, 0xF
2016-01-07 05:23:20 +01:00
_08008EC4:
2015-11-24 21:35:16 +01:00
asrs r5, r0, 4
cmp r5, 0
2016-01-07 05:23:20 +01:00
bgt _08008E5E
_08008ECA:
2015-11-24 21:35:16 +01:00
movs r0, 0xFF
strb r0, [r6]
adds r0, r6, 0
add sp, 0x4
pop {r3,r4}
mov r8, r3
mov r9, r4
pop {r4-r7}
pop {r1}
bx r1
thumb_func_end ConvertIntToHexString
thumb_func_start ExpandStringRefs
2016-09-03 04:51:16 +02:00
@ u8 *ExpandStringRefs(u8 *dest, u8 *src)
ExpandStringRefs: @ 8008EE0
2015-11-24 21:35:16 +01:00
push {r4,r5,lr}
adds r4, r0, 0
adds r5, r1, 0
2016-01-07 05:23:20 +01:00
_08008EE6:
2015-11-24 21:35:16 +01:00
ldrb r2, [r5]
adds r5, 0x1
adds r0, r2, 0
subs r0, 0xFA
cmp r0, 0x5
2016-01-07 05:23:20 +01:00
bhi _08008FBA
2015-11-24 21:35:16 +01:00
lsls r0, 2
2016-01-07 05:23:20 +01:00
ldr r1, =_08008F00
2015-11-24 21:35:16 +01:00
adds r0, r1
ldr r0, [r0]
mov pc, r0
.pool
.align 2, 0
2016-01-07 05:23:20 +01:00
_08008F00:
.4byte _08008FBA
.4byte _08008FBA
.4byte _08008F2C
.4byte _08008F18
.4byte _08008FBA
.4byte _08008FC0
_08008F18:
2015-11-24 21:35:16 +01:00
ldrb r0, [r5]
adds r5, 0x1
bl GetExpandedStringRef
adds r1, r0, 0
adds r0, r4, 0
bl ExpandStringRefs
adds r4, r0, 0
2016-01-07 05:23:20 +01:00
b _08008EE6
_08008F2C:
2015-11-24 21:35:16 +01:00
strb r2, [r4]
adds r4, 0x1
ldrb r2, [r5]
adds r5, 0x1
strb r2, [r4]
adds r4, 0x1
subs r0, r2, 0x4
cmp r0, 0x14
2016-01-07 05:23:20 +01:00
bhi _08008FB0
2015-11-24 21:35:16 +01:00
lsls r0, 2
2016-01-07 05:23:20 +01:00
ldr r1, =_08008F4C
2015-11-24 21:35:16 +01:00
adds r0, r1
ldr r0, [r0]
mov pc, r0
.pool
.align 2, 0
2016-01-07 05:23:20 +01:00
_08008F4C:
.4byte _08008FA0
.4byte _08008FB0
.4byte _08008FB0
.4byte _08008EE6
.4byte _08008FB0
.4byte _08008EE6
.4byte _08008FB0
.4byte _08008FA8
.4byte _08008FB0
.4byte _08008FB0
.4byte _08008FB0
.4byte _08008EE6
.4byte _08008FB0
.4byte _08008FB0
.4byte _08008FB0
.4byte _08008FB0
.4byte _08008FB0
.4byte _08008EE6
.4byte _08008EE6
.4byte _08008EE6
.4byte _08008EE6
_08008FA0:
2015-11-24 21:35:16 +01:00
ldrb r0, [r5]
strb r0, [r4]
adds r5, 0x1
adds r4, 0x1
2016-01-07 05:23:20 +01:00
_08008FA8:
2015-11-24 21:35:16 +01:00
ldrb r0, [r5]
strb r0, [r4]
adds r5, 0x1
adds r4, 0x1
2016-01-07 05:23:20 +01:00
_08008FB0:
2015-11-24 21:35:16 +01:00
ldrb r0, [r5]
strb r0, [r4]
adds r5, 0x1
adds r4, 0x1
2016-01-07 05:23:20 +01:00
b _08008EE6
_08008FBA:
2015-11-24 21:35:16 +01:00
strb r2, [r4]
adds r4, 0x1
2016-01-07 05:23:20 +01:00
b _08008EE6
_08008FC0:
2015-11-24 21:35:16 +01:00
movs r0, 0xFF
strb r0, [r4]
adds r0, r4, 0
pop {r4,r5}
pop {r1}
bx r1
thumb_func_end ExpandStringRefs
thumb_func_start sub_8008FCC
2016-09-03 04:51:16 +02:00
@ u8 *sub_8008FCC(u8 *dest, u8 *src)
sub_8008FCC: @ 8008FCC
2015-11-24 21:35:16 +01:00
push {r4-r6,lr}
sub sp, 0xC
adds r5, r0, 0
adds r6, r1, 0
ldr r1, =gUnknown_082EC80C
mov r0, sp
movs r2, 0x4
bl memcpy
add r4, sp, 0x4
ldr r1, =gUnknown_082EC810
adds r0, r4, 0
movs r2, 0x5
bl memcpy
adds r0, r5, 0
mov r1, sp
2016-01-07 05:23:20 +01:00
_08008FEE:
2015-11-24 21:35:16 +01:00
bl CopyString
adds r5, r0, 0
2016-01-07 05:23:20 +01:00
_08008FF4:
2015-11-24 21:35:16 +01:00
ldrb r0, [r6]
adds r6, 0x1
cmp r0, 0xFE
2016-01-07 05:23:20 +01:00
beq _0800900C
2015-11-24 21:35:16 +01:00
cmp r0, 0xFF
2016-01-07 05:23:20 +01:00
bne _08009012
b _0800901E
2015-11-24 21:35:16 +01:00
.pool
2016-01-07 05:23:20 +01:00
_0800900C:
2015-11-24 21:35:16 +01:00
adds r0, r5, 0
adds r1, r4, 0
2016-01-07 05:23:20 +01:00
b _08008FEE
_08009012:
2015-11-24 21:35:16 +01:00
strb r0, [r5]
adds r5, 0x1
adds r0, 0x40
strb r0, [r5]
adds r5, 0x1
2016-01-07 05:23:20 +01:00
b _08008FF4
_0800901E:
2015-11-24 21:35:16 +01:00
strb r0, [r5]
adds r0, r5, 0
add sp, 0xC
pop {r4-r6}
pop {r1}
bx r1
thumb_func_end sub_8008FCC
thumb_func_start StringRef_GetPossiblyUnusedStringVar
2016-09-03 04:51:16 +02:00
@ u8 *StringRef_GetPossiblyUnusedStringVar()
StringRef_GetPossiblyUnusedStringVar: @ 800902C
2015-11-24 21:35:16 +01:00
ldr r0, =0x020223ac
bx lr
.pool
thumb_func_end StringRef_GetPossiblyUnusedStringVar
thumb_func_start StringRef_GetPlayerName
2016-09-03 04:51:16 +02:00
@ u8 *StringRef_GetPlayerName()
StringRef_GetPlayerName: @ 8009034
2015-11-24 21:35:16 +01:00
ldr r0, =0x03005d90
ldr r0, [r0]
bx lr
.pool
thumb_func_end StringRef_GetPlayerName
thumb_func_start StringRef_GetStringVar1
2016-09-03 04:51:16 +02:00
@ u8 *StringRef_GetStringVar1()
StringRef_GetStringVar1: @ 8009040
2015-11-24 21:35:16 +01:00
ldr r0, =0x02021cc4
bx lr
.pool
thumb_func_end StringRef_GetStringVar1
thumb_func_start StringRef_GetStringVar2
2016-09-03 04:51:16 +02:00
@ u8 *StringRef_GetStringVar2()
StringRef_GetStringVar2: @ 8009048
2015-11-24 21:35:16 +01:00
ldr r0, =0x02021dc4
bx lr
.pool
thumb_func_end StringRef_GetStringVar2
thumb_func_start StringRef_GetStringVar3
2016-09-03 04:51:16 +02:00
@ u8 *StringRef_GetStringVar3()
StringRef_GetStringVar3: @ 8009050
2015-11-24 21:35:16 +01:00
ldr r0, =0x02021ec4
bx lr
.pool
thumb_func_end StringRef_GetStringVar3
thumb_func_start StringRef_GetDummiedOutGenderDependentString
2016-09-03 04:51:16 +02:00
@ u8 *StringRef_GetDummiedOutGenderDependentString()
StringRef_GetDummiedOutGenderDependentString: @ 8009058
2015-11-24 21:35:16 +01:00
push {lr}
ldr r0, =0x03005d90
ldr r0, [r0]
ldrb r0, [r0, 0x8]
cmp r0, 0
2016-01-07 05:23:20 +01:00
beq _08009070
2015-11-24 21:35:16 +01:00
ldr r0, =gUnknown_085E821A
2016-01-07 05:23:20 +01:00
b _08009072
2015-11-24 21:35:16 +01:00
.pool
2016-01-07 05:23:20 +01:00
_08009070:
2015-11-24 21:35:16 +01:00
ldr r0, =gUnknown_085E8219
2016-01-07 05:23:20 +01:00
_08009072:
2015-11-24 21:35:16 +01:00
pop {r1}
bx r1
.pool
thumb_func_end StringRef_GetDummiedOutGenderDependentString
thumb_func_start StringRef_GetRivalName
2016-09-03 04:51:16 +02:00
@ u8 *StringRef_GetRivalName()
StringRef_GetRivalName: @ 800907C
2015-11-24 21:35:16 +01:00
push {lr}
ldr r0, =0x03005d90
ldr r0, [r0]
ldrb r0, [r0, 0x8]
cmp r0, 0
2016-01-07 05:23:20 +01:00
beq _08009094
2015-11-24 21:35:16 +01:00
ldr r0, =gUnknown_085E8258
2016-01-07 05:23:20 +01:00
b _08009096
2015-11-24 21:35:16 +01:00
.pool
2016-01-07 05:23:20 +01:00
_08009094:
2015-11-24 21:35:16 +01:00
ldr r0, =gUnknown_085E8260
2016-01-07 05:23:20 +01:00
_08009096:
2015-11-24 21:35:16 +01:00
pop {r1}
bx r1
.pool
thumb_func_end StringRef_GetRivalName
thumb_func_start StringRef_GetEmeraldString
2016-09-03 04:51:16 +02:00
@ u8 *StringRef_GetEmeraldString()
StringRef_GetEmeraldString: @ 80090A0
2015-11-24 21:35:16 +01:00
ldr r0, =gUnknown_085E8229
bx lr
.pool
thumb_func_end StringRef_GetEmeraldString
thumb_func_start StringRef_GetAquaString
2016-09-03 04:51:16 +02:00
@ u8 *StringRef_GetAquaString()
StringRef_GetAquaString: @ 80090A8
2015-11-24 21:35:16 +01:00
ldr r0, =gUnknown_085E8231
bx lr
.pool
thumb_func_end StringRef_GetAquaString
thumb_func_start StringRef_GetMagmaString
2016-09-03 04:51:16 +02:00
@ u8 *StringRef_GetMagmaString()
StringRef_GetMagmaString: @ 80090B0
2015-11-24 21:35:16 +01:00
ldr r0, =gUnknown_085E8236
bx lr
.pool
thumb_func_end StringRef_GetMagmaString
thumb_func_start StringRef_GetArchieString
2016-09-03 04:51:16 +02:00
@ u8 *StringRef_GetArchieString()
StringRef_GetArchieString: @ 80090B8
2015-11-24 21:35:16 +01:00
ldr r0, =gUnknown_085E823C
bx lr
.pool
thumb_func_end StringRef_GetArchieString
thumb_func_start StringRef_GetMaxieString
2016-09-03 04:51:16 +02:00
@ u8 *StringRef_GetMaxieString()
StringRef_GetMaxieString: @ 80090C0
2015-11-24 21:35:16 +01:00
ldr r0, =gUnknown_085E8243
bx lr
.pool
thumb_func_end StringRef_GetMaxieString
thumb_func_start StringRef_GetKyogreString
2016-09-03 04:51:16 +02:00
@ u8 *StringRef_GetKyogreString()
StringRef_GetKyogreString: @ 80090C8
2015-11-24 21:35:16 +01:00
ldr r0, =gUnknown_085E8249
bx lr
.pool
thumb_func_end StringRef_GetKyogreString
thumb_func_start StringRef_GetGroudonString
2016-09-03 04:51:16 +02:00
@ u8 *StringRef_GetGroudonString()
StringRef_GetGroudonString: @ 80090D0
2015-11-24 21:35:16 +01:00
ldr r0, =gUnknown_085E8250
bx lr
.pool
thumb_func_end StringRef_GetGroudonString
thumb_func_start GetExpandedStringRef
2016-09-03 04:51:16 +02:00
@ u8 *GetExpandedStringRef(u8 code)
GetExpandedStringRef: @ 80090D8
2015-11-24 21:35:16 +01:00
push {lr}
cmp r0, 0xD
2016-01-07 05:23:20 +01:00
bhi _080090F0
2015-11-24 21:35:16 +01:00
ldr r1, =gStringRefFunctionTable
lsls r0, 2
adds r0, r1
ldr r0, [r0]
bl _call_via_r0
2016-01-07 05:23:20 +01:00
b _080090F2
2015-11-24 21:35:16 +01:00
.pool
2016-01-07 05:23:20 +01:00
_080090F0:
2015-11-24 21:35:16 +01:00
ldr r0, =gUnknown_085E8218
2016-01-07 05:23:20 +01:00
_080090F2:
2015-11-24 21:35:16 +01:00
pop {r1}
bx r1
.pool
thumb_func_end GetExpandedStringRef
thumb_func_start RepeatChar
2016-09-03 04:51:16 +02:00
@ u8 *RepeatChar(u8 *dest, u8 c, u16 n)
RepeatChar: @ 80090FC
2015-11-24 21:35:16 +01:00
push {lr}
adds r3, r0, 0
lsls r1, 24
lsrs r1, 24
lsls r2, 16
lsrs r2, 16
movs r0, 0
cmp r0, r2
2016-01-07 05:23:20 +01:00
bcs _0800911C
_0800910E:
2015-11-24 21:35:16 +01:00
strb r1, [r3]
adds r3, 0x1
adds r0, 0x1
lsls r0, 16
lsrs r0, 16
cmp r0, r2
2016-01-07 05:23:20 +01:00
bcc _0800910E
_0800911C:
2015-11-24 21:35:16 +01:00
movs r0, 0xFF
strb r0, [r3]
adds r0, r3, 0
pop {r1}
bx r1
thumb_func_end RepeatChar
thumb_func_start CopyStringPadded
2016-09-03 04:51:16 +02:00
@ u8 *CopyStringPadded(u8 *dest, u8 *src, u8 c, u16 n)
CopyStringPadded: @ 8009128
2015-11-24 21:35:16 +01:00
push {r4,r5,lr}
adds r4, r0, 0
adds r5, r1, 0
lsls r2, 24
lsrs r2, 24
lsls r3, 16
lsrs r3, 16
2016-01-07 05:23:20 +01:00
b _08009148
_08009138:
2015-11-24 21:35:16 +01:00
strb r1, [r4]
adds r5, 0x1
adds r4, 0x1
cmp r3, 0
2016-01-07 05:23:20 +01:00
beq _08009148
2015-11-24 21:35:16 +01:00
subs r0, r3, 0x1
lsls r0, 16
lsrs r3, r0, 16
2016-01-07 05:23:20 +01:00
_08009148:
2015-11-24 21:35:16 +01:00
ldrb r1, [r5]
adds r0, r1, 0
cmp r0, 0xFF
2016-01-07 05:23:20 +01:00
bne _08009138
2015-11-24 21:35:16 +01:00
subs r0, r3, 0x1
lsls r0, 16
lsrs r3, r0, 16
ldr r0, =0x0000ffff
cmp r3, r0
2016-01-07 05:23:20 +01:00
beq _0800916C
2015-11-24 21:35:16 +01:00
adds r1, r0, 0
2016-01-07 05:23:20 +01:00
_0800915E:
2015-11-24 21:35:16 +01:00
strb r2, [r4]
adds r4, 0x1
subs r0, r3, 0x1
lsls r0, 16
lsrs r3, r0, 16
cmp r3, r1
2016-01-07 05:23:20 +01:00
bne _0800915E
_0800916C:
2015-11-24 21:35:16 +01:00
movs r0, 0xFF
strb r0, [r4]
adds r0, r4, 0
pop {r4,r5}
pop {r1}
bx r1
.pool
thumb_func_end CopyStringPadded
thumb_func_start RepeatStringTerminator
2016-09-03 04:51:16 +02:00
@ u8 *RepeatStringTerminator(u8 *dest, u16 n)
RepeatStringTerminator: @ 800917C
2015-11-24 21:35:16 +01:00
push {lr}
lsls r2, r1, 16
lsrs r2, 16
movs r1, 0xFF
bl RepeatChar
pop {r1}
bx r1
thumb_func_end RepeatStringTerminator
2015-11-26 01:43:06 +01:00
thumb_func_start CopyString_LimitN_Multibyte
2016-09-03 04:51:16 +02:00
@ u8 *CopyString_LimitN_Multibyte(u8 *dest, u8 *src, u32 n)
CopyString_LimitN_Multibyte: @ 800918C
2015-11-24 21:35:16 +01:00
push {r4,r5,lr}
adds r4, r0, 0
adds r3, r1, 0
subs r2, 0x1
movs r5, 0x1
negs r5, r5
2016-01-07 05:23:20 +01:00
b _080091B2
_0800919A:
2015-11-24 21:35:16 +01:00
strb r0, [r4]
adds r3, 0x1
adds r4, 0x1
subs r0, r3, 0x1
ldrb r0, [r0]
cmp r0, 0xF9
2016-01-07 05:23:20 +01:00
bne _080091B0
2015-11-24 21:35:16 +01:00
ldrb r0, [r3]
strb r0, [r4]
adds r3, 0x1
adds r4, 0x1
2016-01-07 05:23:20 +01:00
_080091B0:
2015-11-24 21:35:16 +01:00
subs r2, 0x1
2016-01-07 05:23:20 +01:00
_080091B2:
2015-11-24 21:35:16 +01:00
cmp r2, r5
2016-01-07 05:23:20 +01:00
beq _080091BE
2015-11-24 21:35:16 +01:00
ldrb r0, [r3]
adds r1, r0, 0
cmp r1, 0xFF
2016-01-07 05:23:20 +01:00
bne _0800919A
_080091BE:
2015-11-24 21:35:16 +01:00
movs r0, 0xFF
strb r0, [r4]
adds r0, r4, 0
pop {r4,r5}
pop {r1}
bx r1
2015-11-26 01:43:06 +01:00
thumb_func_end CopyString_LimitN_Multibyte
2015-11-24 21:35:16 +01:00
thumb_func_start GetStringLength_Multibyte
2016-09-03 04:51:16 +02:00
@ u32 GetStringLength_Multibyte(u8 *s)
GetStringLength_Multibyte: @ 80091CC
2015-11-24 21:35:16 +01:00
push {lr}
adds r2, r0, 0
movs r3, 0
2016-01-07 05:23:20 +01:00
b _080091DE
_080091D4:
2015-11-24 21:35:16 +01:00
cmp r1, 0xF9
2016-01-07 05:23:20 +01:00
bne _080091DA
2015-11-24 21:35:16 +01:00
adds r2, 0x1
2016-01-07 05:23:20 +01:00
_080091DA:
2015-11-24 21:35:16 +01:00
adds r2, 0x1
adds r3, 0x1
2016-01-07 05:23:20 +01:00
_080091DE:
2015-11-24 21:35:16 +01:00
ldrb r1, [r2]
adds r0, r1, 0
cmp r0, 0xFF
2016-01-07 05:23:20 +01:00
bne _080091D4
2015-11-24 21:35:16 +01:00
adds r0, r3, 0
pop {r1}
bx r1
thumb_func_end GetStringLength_Multibyte
thumb_func_start WriteColorChangeControlCode
2016-09-03 04:51:16 +02:00
@ u8 *WriteColorChangeControlCode(u8 *dest, u8 colorType, u8 color)
WriteColorChangeControlCode: @ 80091EC
2015-11-24 21:35:16 +01:00
push {lr}
adds r3, r0, 0
lsls r2, 24
lsrs r2, 24
movs r0, 0xFC
strb r0, [r3]
adds r3, 0x1
cmp r1, 0x1
2016-01-07 05:23:20 +01:00
beq _0800920E
2015-11-24 21:35:16 +01:00
cmp r1, 0x1
2016-01-07 05:23:20 +01:00
bcc _08009208
2015-11-24 21:35:16 +01:00
cmp r1, 0x2
2016-01-07 05:23:20 +01:00
beq _08009214
b _08009218
_08009208:
2015-11-24 21:35:16 +01:00
movs r0, 0x1
strb r0, [r3]
2016-01-07 05:23:20 +01:00
b _08009216
_0800920E:
2015-11-24 21:35:16 +01:00
movs r0, 0x3
strb r0, [r3]
2016-01-07 05:23:20 +01:00
b _08009216
_08009214:
2015-11-24 21:35:16 +01:00
strb r1, [r3]
2016-01-07 05:23:20 +01:00
_08009216:
2015-11-24 21:35:16 +01:00
adds r3, 0x1
2016-01-07 05:23:20 +01:00
_08009218:
2015-11-24 21:35:16 +01:00
strb r2, [r3]
adds r3, 0x1
movs r0, 0xFF
strb r0, [r3]
adds r0, r3, 0
pop {r1}
bx r1
thumb_func_end WriteColorChangeControlCode
thumb_func_start sub_8009228
2016-09-03 04:51:16 +02:00
@ bool8 sub_8009228(u8 *s)
sub_8009228: @ 8009228
2015-11-24 21:35:16 +01:00
push {lr}
adds r2, r0, 0
2016-01-07 05:23:20 +01:00
b _0800923E
_0800922E:
2015-11-24 21:35:16 +01:00
adds r0, r1, 0
cmp r0, 0xA0
2016-01-07 05:23:20 +01:00
bhi _0800923C
2015-11-24 21:35:16 +01:00
cmp r0, 0
2016-01-07 05:23:20 +01:00
beq _0800923C
2015-11-24 21:35:16 +01:00
movs r0, 0x1
2016-01-07 05:23:20 +01:00
b _08009248
_0800923C:
2015-11-24 21:35:16 +01:00
adds r2, 0x1
2016-01-07 05:23:20 +01:00
_0800923E:
2015-11-24 21:35:16 +01:00
ldrb r1, [r2]
adds r0, r1, 0
cmp r0, 0xFF
2016-01-07 05:23:20 +01:00
bne _0800922E
2015-11-24 21:35:16 +01:00
movs r0, 0
2016-01-07 05:23:20 +01:00
_08009248:
2015-11-24 21:35:16 +01:00
pop {r1}
bx r1
thumb_func_end sub_8009228
thumb_func_start sub_800924C
2016-09-03 04:51:16 +02:00
@ bool8 sub_800924C(u8 *s, u32 n)
sub_800924C: @ 800924C
2015-11-24 21:35:16 +01:00
push {r4,lr}
adds r3, r0, 0
adds r4, r1, 0
movs r1, 0
2016-01-07 05:23:20 +01:00
b _08009268
_08009256:
2015-11-24 21:35:16 +01:00
adds r0, r2, 0
cmp r0, 0xA0
2016-01-07 05:23:20 +01:00
bhi _08009264
2015-11-24 21:35:16 +01:00
cmp r0, 0
2016-01-07 05:23:20 +01:00
beq _08009264
2015-11-24 21:35:16 +01:00
movs r0, 0x1
2016-01-07 05:23:20 +01:00
b _08009276
_08009264:
2015-11-24 21:35:16 +01:00
adds r3, 0x1
adds r1, 0x1
2016-01-07 05:23:20 +01:00
_08009268:
2015-11-24 21:35:16 +01:00
ldrb r2, [r3]
adds r0, r2, 0
cmp r0, 0xFF
2016-01-07 05:23:20 +01:00
beq _08009274
2015-11-24 21:35:16 +01:00
cmp r1, r4
2016-01-07 05:23:20 +01:00
blt _08009256
_08009274:
2015-11-24 21:35:16 +01:00
movs r0, 0
2016-01-07 05:23:20 +01:00
_08009276:
2015-11-24 21:35:16 +01:00
pop {r4}
pop {r1}
bx r1
thumb_func_end sub_800924C
thumb_func_start GetExtendedControlCodeLength
2016-09-03 04:51:16 +02:00
@ u8 GetExtendedControlCodeLength(u8 code)
GetExtendedControlCodeLength: @ 800927C
2015-11-24 21:35:16 +01:00
push {lr}
lsls r0, 24
lsrs r1, r0, 24
movs r0, 0
cmp r1, 0x18
2016-01-07 05:23:20 +01:00
bhi _0800928E
2015-11-24 21:35:16 +01:00
ldr r0, =gExtendedControlCodeLengths
adds r0, r1, r0
ldrb r0, [r0]
2016-01-07 05:23:20 +01:00
_0800928E:
2015-11-24 21:35:16 +01:00
pop {r1}
bx r1
.pool
thumb_func_end GetExtendedControlCodeLength
thumb_func_start SkipExtendedControlCode
2016-09-03 04:51:16 +02:00
@ u8 *SkipExtendedControlCode(u8 *s)
SkipExtendedControlCode: @ 8009298
2015-11-24 21:35:16 +01:00
push {r4,lr}
adds r4, r0, 0
2016-01-07 05:23:20 +01:00
b _080092AC
_0800929E:
2015-11-24 21:35:16 +01:00
adds r4, 0x1
ldrb r0, [r4]
bl GetExtendedControlCodeLength
lsls r0, 24
lsrs r0, 24
adds r4, r0
2016-01-07 05:23:20 +01:00
_080092AC:
2015-11-24 21:35:16 +01:00
ldrb r0, [r4]
cmp r0, 0xFC
2016-01-07 05:23:20 +01:00
beq _0800929E
2015-11-24 21:35:16 +01:00
adds r0, r4, 0
pop {r4}
pop {r1}
bx r1
thumb_func_end SkipExtendedControlCode
thumb_func_start CompareStringWithoutExtendedControlCodes
2016-09-03 04:51:16 +02:00
@ u8 CompareStringWithoutExtendedControlCodes(u8 *s1, u8 *s2)
CompareStringWithoutExtendedControlCodes: @ 80092BC
2015-11-24 21:35:16 +01:00
push {r4-r6,lr}
adds r4, r0, 0
adds r5, r1, 0
movs r6, 0
2016-01-07 05:23:20 +01:00
b _080092DE
_080092C6:
2015-11-24 21:35:16 +01:00
cmp r1, r0
2016-01-07 05:23:20 +01:00
bcs _080092D4
2015-11-24 21:35:16 +01:00
movs r6, 0x1
negs r6, r6
cmp r0, 0xFF
2016-01-07 05:23:20 +01:00
bne _080092D4
2015-11-24 21:35:16 +01:00
movs r6, 0x1
2016-01-07 05:23:20 +01:00
_080092D4:
2015-11-24 21:35:16 +01:00
ldrb r0, [r4]
cmp r0, 0xFF
2016-01-07 05:23:20 +01:00
beq _080092FE
2015-11-24 21:35:16 +01:00
adds r4, 0x1
adds r5, 0x1
2016-01-07 05:23:20 +01:00
_080092DE:
2015-11-24 21:35:16 +01:00
adds r0, r4, 0
bl SkipExtendedControlCode
adds r4, r0, 0
adds r0, r5, 0
bl SkipExtendedControlCode
adds r5, r0, 0
ldrb r1, [r4]
ldrb r0, [r5]
cmp r1, r0
2016-01-07 05:23:20 +01:00
bls _080092C6
2015-11-24 21:35:16 +01:00
movs r6, 0x1
cmp r1, 0xFF
2016-01-07 05:23:20 +01:00
bne _080092FE
2015-11-24 21:35:16 +01:00
subs r6, 0x2
2016-01-07 05:23:20 +01:00
_080092FE:
2015-11-24 21:35:16 +01:00
adds r0, r6, 0
pop {r4-r6}
pop {r1}
bx r1
thumb_func_end CompareStringWithoutExtendedControlCodes
thumb_func_start StopMusicWhileStringIsPrinted
2016-09-03 04:51:16 +02:00
@ void StopMusicWhileStringIsPrinted(u8 *s, bool8 stopMusic)
StopMusicWhileStringIsPrinted: @ 8009308
2015-11-24 21:35:16 +01:00
push {r4,lr}
adds r4, r0, 0
lsls r1, 24
lsrs r1, 24
cmp r1, 0x1
2016-01-07 05:23:20 +01:00
bne _08009368
2015-11-24 21:35:16 +01:00
bl StripExtendedControlCodes
adds r0, r4, 0
bl GetStringLength
lsls r0, 24
lsrs r2, r0, 24
adds r1, r2, 0
adds r0, r1, 0x1
lsls r0, 24
lsrs r2, r0, 24
adds r3, r2, 0
adds r1, r4, r1
movs r0, 0xFC
strb r0, [r1]
adds r0, r3, 0x1
lsls r0, 24
lsrs r2, r0, 24
adds r3, r4, r3
movs r0, 0x16
strb r0, [r3]
adds r0, r2, 0x1
lsls r0, 24
adds r2, r4, r2
movs r1, 0xFF
strb r1, [r2]
movs r1, 0xFF
lsls r1, 24
adds r0, r1
2016-01-07 05:23:20 +01:00
b _0800935A
_08009350:
2015-11-24 21:35:16 +01:00
adds r1, r2, r4
ldrb r0, [r1]
strb r0, [r1, 0x2]
subs r0, r2, 0x1
lsls r0, 24
2016-01-07 05:23:20 +01:00
_0800935A:
2015-11-24 21:35:16 +01:00
lsrs r2, r0, 24
cmp r2, 0xFF
2016-01-07 05:23:20 +01:00
bne _08009350
2015-11-24 21:35:16 +01:00
movs r0, 0xFC
strb r0, [r4]
movs r0, 0x15
strb r0, [r4, 0x1]
2016-01-07 05:23:20 +01:00
_08009368:
2015-11-24 21:35:16 +01:00
pop {r4}
pop {r0}
bx r0
thumb_func_end StopMusicWhileStringIsPrinted
thumb_func_start StripExtendedControlCodes
2016-09-03 04:51:16 +02:00
@ void StripExtendedControlCodes(u8 *s)
StripExtendedControlCodes: @ 8009370
2015-11-24 21:35:16 +01:00
push {r4-r6,lr}
adds r5, r0, 0
movs r4, 0
movs r6, 0
ldrb r0, [r5]
cmp r0, 0xFF
2016-01-07 05:23:20 +01:00
beq _080093C0
_0800937E:
2015-11-24 21:35:16 +01:00
adds r0, r5, r4
ldrb r0, [r0]
cmp r0, 0xFC
2016-01-07 05:23:20 +01:00
bne _080093A0
2015-11-24 21:35:16 +01:00
adds r0, r4, 0x1
lsls r0, 16
lsrs r4, r0, 16
adds r0, r5, r4
ldrb r0, [r0]
bl GetExtendedControlCodeLength
lsls r0, 24
lsrs r0, 24
adds r0, r4, r0
lsls r0, 16
lsrs r4, r0, 16
2016-01-07 05:23:20 +01:00
b _080093B8
_080093A0:
2015-11-24 21:35:16 +01:00
adds r2, r6, 0
adds r0, r2, 0x1
lsls r0, 16
lsrs r6, r0, 16
adds r2, r5, r2
adds r1, r4, 0
adds r0, r1, 0x1
lsls r0, 16
lsrs r4, r0, 16
adds r1, r5, r1
ldrb r0, [r1]
strb r0, [r2]
2016-01-07 05:23:20 +01:00
_080093B8:
2015-11-24 21:35:16 +01:00
adds r0, r5, r4
ldrb r0, [r0]
cmp r0, 0xFF
2016-01-07 05:23:20 +01:00
bne _0800937E
_080093C0:
2015-11-24 21:35:16 +01:00
adds r1, r5, r6
movs r0, 0xFF
strb r0, [r1]
pop {r4-r6}
pop {r0}
bx r0
thumb_func_end StripExtendedControlCodes
2016-09-03 08:11:29 +02:00
.align 2, 0 @ Don't pad with nop.