pmd-red/asm/code_8097DD0.s
Seth Barberee aa939e0955 All saving functions decomped
- poke_sub_4 was determined to be Dungeon Index/Floor
- Clean up code that references these functions
2022-03-11 10:14:32 -08:00

214 lines
3.0 KiB
ArmAsm

#include "asm/constants/gba_constants.inc"
#include "asm/macros.inc"
.syntax unified
.text
thumb_func_start sub_8097DD0
sub_8097DD0:
push {lr}
adds r2, r0, 0
adds r3, r1, 0
ldr r1, [r2]
ldr r0, [r3]
cmp r1, r0
bne _08097DEA
ldr r1, [r2, 0x4]
ldr r0, [r3, 0x4]
cmp r1, r0
bne _08097DEA
movs r0, 0x1
b _08097DEC
_08097DEA:
movs r0, 0
_08097DEC:
pop {r1}
bx r1
thumb_func_end sub_8097DD0
thumb_func_start sub_8097DF0
sub_8097DF0:
push {r4-r7,lr}
mov r7, r10
mov r6, r9
mov r5, r8
push {r5-r7}
sub sp, 0x1F8
mov r8, r0
str r1, [sp, 0x1F0]
movs r0, 0
mov r9, r0
movs r7, 0
ldr r1, _08097E3C
ldr r0, [r1]
cmp r0, 0
beq _08097E6E
_08097E0E:
movs r4, 0
lsls r5, r7, 3
lsls r1, r7, 2
mov r10, r1
adds r6, r7, 0x1
ldr r2, _08097E3C
adds r3, r5, r2
add r1, sp, 0x18C
_08097E1E:
ldr r0, [r3]
adds r0, r4
ldrb r2, [r0]
cmp r2, 0x23
bne _08097E40
ldrb r0, [r0, 0x1]
cmp r0, 0x72
bne _08097E40
strb r2, [r1]
adds r1, 0x1
strb r0, [r1]
adds r1, 0x1
movs r0, 0
strb r0, [r1]
b _08097E50
.align 2, 0
_08097E3C: .4byte gStatusDescriptions
_08097E40:
ldr r0, [r3]
adds r0, r4
ldrb r0, [r0]
strb r0, [r1]
adds r1, 0x1
adds r4, 0x1
cmp r4, 0x63
ble _08097E1E
_08097E50:
add r0, sp, 0x18C
bl strlen
mov r1, sp
add r1, r10
str r0, [r1]
adds r7, r6, 0
cmp r6, 0x62
bgt _08097E6E
lsls r0, r6, 3
ldr r1, _08097EB4
adds r0, r1
ldr r0, [r0]
cmp r0, 0
bne _08097E0E
_08097E6E:
mov r2, r8
ldrb r0, [r2]
cmp r0, 0
beq _08097F2C
ldr r3, _08097EB4
_08097E78:
cmp r0, 0x23
bne _08097F08
movs r7, 0
adds r1, r3, 0
ldr r0, [r1]
cmp r0, 0
beq _08097F20
mov r2, r9
lsls r0, r2, 2
ldr r2, [sp, 0x1F0]
adds r0, r2
mov r10, r0
_08097E90:
lsls r4, r7, 3
adds r0, r4, r1
ldr r0, [r0]
lsls r1, r7, 2
add r1, sp
ldr r2, [r1]
mov r1, r8
str r3, [sp, 0x1F4]
bl sub_800B2D4
lsls r0, 24
adds r5, r4, 0
adds r6, r7, 0x1
ldr r3, [sp, 0x1F4]
cmp r0, 0
bne _08097EF0
movs r4, 0
b _08097EBA
.align 2, 0
_08097EB4: .4byte gStatusDescriptions
_08097EB8:
adds r4, 0x1
_08097EBA:
cmp r4, r9
bge _08097ED6
adds r0, r5, r3
lsls r1, r4, 2
ldr r2, [sp, 0x1F0]
adds r1, r2
ldr r1, [r1]
str r3, [sp, 0x1F4]
bl sub_8097DD0
lsls r0, 24
ldr r3, [sp, 0x1F4]
cmp r0, 0
beq _08097EB8
_08097ED6:
cmp r4, r9
bne _08097EF0
mov r0, r9
cmp r0, 0x3
bgt _08097EF0
adds r0, r5, r3
mov r1, r10
adds r1, 0x4
mov r10, r1
subs r1, 0x4
stm r1!, {r0}
movs r2, 0x1
add r9, r2
_08097EF0:
adds r7, r6, 0
cmp r6, 0x62
bgt _08097F20
ldr r1, _08097F04
lsls r0, r6, 3
adds r0, r1
ldr r0, [r0]
cmp r0, 0
bne _08097E90
b _08097F20
.align 2, 0
_08097F04: .4byte gStatusDescriptions
_08097F08:
mov r0, r8
ldrb r1, [r0]
adds r0, r1, 0
adds r0, 0x7F
lsls r0, 24
lsrs r0, 24
cmp r0, 0x3
bls _08097F1C
cmp r1, 0x87
bne _08097F20
_08097F1C:
movs r1, 0x1
add r8, r1
_08097F20:
movs r2, 0x1
add r8, r2
mov r1, r8
ldrb r0, [r1]
cmp r0, 0
bne _08097E78
_08097F2C:
mov r0, r9
add sp, 0x1F8
pop {r3-r5}
mov r8, r3
mov r9, r4
mov r10, r5
pop {r4-r7}
pop {r1}
bx r1
thumb_func_end sub_8097DF0
.align 2,0