pmd-red/asm/code_809447C.s
2022-03-13 17:48:04 -07:00

336 lines
5.5 KiB
ArmAsm

#include "asm/constants/gba_constants.inc"
#include "asm/macros.inc"
.syntax unified
.text
thumb_func_start sub_8094558
sub_8094558:
push {r4-r7,lr}
mov r7, r8
push {r7}
sub sp, 0xCC
adds r7, r0, 0
adds r4, r1, 0
adds r6, r2, 0
bl sub_80073B8
movs r5, 0
str r5, [sp]
movs r0, 0x10
movs r1, 0
adds r2, r4, 0
adds r3, r7, 0
bl xxx_format_and_draw
ldr r4, _080945D0
adds r1, r6, 0
adds r1, 0x18
adds r0, r4, 0
bl PrintYellowDungeonNametoBuffer
ldr r0, _080945D4
ldr r2, [r0]
str r5, [sp]
movs r0, 0x4
movs r1, 0x10
adds r3, r7, 0
bl xxx_format_and_draw
movs r5, 0x1A
adds r0, r4, 0
adds r1, r6, 0
movs r2, 0xA
bl sub_80922B4
adds r4, 0x50
adds r1, r6, 0
adds r1, 0xA
adds r0, r4, 0
movs r2, 0xA
bl sub_80922B4
movs r1, 0x14
ldrsh r0, [r6, r1]
bl sub_8094528
lsls r0, 24
cmp r0, 0
beq _080945DC
ldr r0, _080945D8
ldr r0, [r0]
add r2, sp, 0xCC
add r1, sp, 0x4
movs r3, 0
bl xxx_format_string
b _080945EA
.align 2, 0
_080945D0: .4byte gAvailablePokemonNames
_080945D4: .4byte gUnknown_8113850
_080945D8: .4byte gUnknown_8113868
_080945DC:
ldr r0, _0809465C
ldr r0, [r0]
add r2, sp, 0xCC
add r1, sp, 0x4
movs r3, 0
bl xxx_format_string
_080945EA:
add r0, sp, 0x4
bl sub_8008ED0
movs r4, 0xB0
subs r0, r4, r0
lsrs r1, r0, 31
adds r0, r1
asrs r0, 1
movs r1, 0
mov r8, r1
str r1, [sp]
adds r1, r5, 0
add r2, sp, 0x4
adds r3, r7, 0
bl xxx_format_and_draw
adds r5, 0xA
movs r1, 0x14
ldrsh r0, [r6, r1]
add r1, sp, 0x4
bl sub_80944BC
add r0, sp, 0x4
bl sub_8008ED0
subs r4, r0
lsrs r0, r4, 31
adds r4, r0
asrs r0, r4, 1
mov r1, r8
str r1, [sp]
adds r1, r5, 0
add r2, sp, 0x4
adds r3, r7, 0
bl xxx_format_and_draw
adds r5, 0x10
ldr r1, _08094660
ldr r0, [r6, 0x20]
str r0, [r1]
adds r0, r6, 0
adds r0, 0x2A
ldrb r0, [r0]
str r0, [r1, 0x4]
cmp r0, 0x63
ble _08094668
ldr r0, _08094664
ldr r2, [r0]
mov r0, r8
str r0, [sp]
movs r0, 0x4
adds r1, r5, 0
adds r3, r7, 0
bl xxx_format_and_draw
b _0809467A
.align 2, 0
_0809465C: .4byte gUnknown_8113870
_08094660: .4byte gUnknown_202DE30
_08094664: .4byte gUnknown_81138C0
_08094668:
ldr r0, _080946CC
ldr r2, [r0]
mov r1, r8
str r1, [sp]
movs r0, 0x4
adds r1, r5, 0
adds r3, r7, 0
bl xxx_format_and_draw
_0809467A:
adds r5, 0xA
ldr r4, _080946D0
movs r1, 0x24
ldrsh r0, [r6, r1]
str r0, [r4]
ldr r0, _080946D4
ldr r2, [r0]
movs r0, 0
mov r8, r0
str r0, [sp]
movs r0, 0x4
adds r1, r5, 0
adds r3, r7, 0
bl xxx_format_and_draw
adds r5, 0xA
adds r0, r6, 0
adds r0, 0x26
ldrb r2, [r0]
str r2, [r4]
adds r0, 0x2
ldrb r0, [r0]
str r0, [r4, 0x4]
adds r0, r6, 0
adds r0, 0x2B
ldrb r1, [r0]
cmp r1, 0
beq _080946DC
adds r0, r1, 0
adds r0, r2, r0
str r0, [r4]
ldr r0, _080946D8
ldr r2, [r0]
mov r1, r8
str r1, [sp]
movs r0, 0x4
adds r1, r5, 0
adds r3, r7, 0
bl xxx_format_and_draw
b _080946EC
.align 2, 0
_080946CC: .4byte gUnknown_8113898
_080946D0: .4byte gUnknown_202DE30
_080946D4: .4byte gUnknown_81138D0
_080946D8: .4byte gUnknown_8113950
_080946DC:
ldr r0, _08094714
ldr r2, [r0]
str r1, [sp]
movs r0, 0x4
adds r1, r5, 0
adds r3, r7, 0
bl xxx_format_and_draw
_080946EC:
adds r0, r6, 0
adds r0, 0x2D
ldrb r1, [r0]
cmp r1, 0
beq _08094720
ldr r2, _08094718
ldr r0, [r2, 0x4]
adds r0, r1
str r0, [r2, 0x4]
ldr r0, _0809471C
ldr r2, [r0]
movs r0, 0
str r0, [sp]
movs r0, 0x4
adds r1, r5, 0
adds r3, r7, 0
bl xxx_format_and_draw
b _08094730
.align 2, 0
_08094714: .4byte gUnknown_81138E4
_08094718: .4byte gUnknown_202DE30
_0809471C: .4byte gUnknown_8113974
_08094720:
ldr r0, _08094768
ldr r2, [r0]
str r1, [sp]
movs r0, 0x4
adds r1, r5, 0
adds r3, r7, 0
bl xxx_format_and_draw
_08094730:
adds r5, 0xA
ldr r2, _0809476C
adds r0, r6, 0
adds r0, 0x27
ldrb r3, [r0]
str r3, [r2]
adds r0, 0x2
ldrb r0, [r0]
str r0, [r2, 0x4]
adds r0, r6, 0
adds r0, 0x2C
ldrb r1, [r0]
cmp r1, 0
beq _08094774
adds r0, r1, 0
adds r0, r3, r0
str r0, [r2]
ldr r0, _08094770
ldr r2, [r0]
movs r0, 0
str r0, [sp]
movs r0, 0x4
adds r1, r5, 0
adds r3, r7, 0
bl xxx_format_and_draw
b _08094784
.align 2, 0
_08094768: .4byte gUnknown_8113900
_0809476C: .4byte gUnknown_202DE30
_08094770: .4byte gUnknown_8113990
_08094774:
ldr r0, _080947AC
ldr r2, [r0]
str r1, [sp]
movs r0, 0x4
adds r1, r5, 0
adds r3, r7, 0
bl xxx_format_and_draw
_08094784:
adds r0, r6, 0
adds r0, 0x2E
ldrb r1, [r0]
cmp r1, 0
beq _080947B8
ldr r2, _080947B0
ldr r0, [r2, 0x4]
adds r0, r1
str r0, [r2, 0x4]
ldr r0, _080947B4
ldr r2, [r0]
movs r0, 0
str r0, [sp]
movs r0, 0x4
adds r1, r5, 0
adds r3, r7, 0
bl xxx_format_and_draw
b _080947C8
.align 2, 0
_080947AC: .4byte gUnknown_8113918
_080947B0: .4byte gUnknown_202DE30
_080947B4: .4byte gUnknown_81139B4
_080947B8:
ldr r0, _080947E4
ldr r2, [r0]
str r1, [sp]
movs r0, 0x4
adds r1, r5, 0
adds r3, r7, 0
bl xxx_format_and_draw
_080947C8:
adds r5, 0x10
adds r2, r6, 0
adds r2, 0x1C
ldrb r1, [r6, 0x1C]
movs r0, 0x1
ands r0, r1
cmp r0, 0
beq _080947EC
ldr r0, _080947E8
adds r1, r2, 0
movs r2, 0
bl sub_8090E14
b _080947F6
.align 2, 0
_080947E4: .4byte gUnknown_8113934
_080947E8: .4byte gUnknown_202DE58
_080947EC:
ldr r0, _0809481C
ldr r1, _08094820
ldr r1, [r1]
bl strcpy
_080947F6:
ldr r0, _08094824
ldr r2, [r0]
movs r0, 0
str r0, [sp]
movs r0, 0x4
adds r1, r5, 0
adds r3, r7, 0
bl xxx_format_and_draw
adds r0, r7, 0
bl sub_80073E0
add sp, 0xCC
pop {r3}
mov r8, r3
pop {r4-r7}
pop {r0}
bx r0
.align 2, 0
_0809481C: .4byte gUnknown_202DE58
_08094820: .4byte gUnknown_81139B8
_08094824: .4byte gUnknown_81139CC
thumb_func_end sub_8094558
.align 2,0