mirror of
https://github.com/pret/pokeruby.git
synced 2025-01-09 06:10:21 +00:00
629 lines
10 KiB
ArmAsm
629 lines
10 KiB
ArmAsm
.include "constants/gba_constants.inc"
|
|
.include "constants/species_constants.inc"
|
|
.include "asm/macros.inc"
|
|
|
|
.syntax unified
|
|
|
|
.text
|
|
|
|
.ifndef NONMATCHING
|
|
thumb_func_start sub_805F3EC
|
|
sub_805F3EC: @ 805F3EC
|
|
movs r0, 0
|
|
bx lr
|
|
thumb_func_end sub_805F3EC
|
|
|
|
thumb_func_start sub_805F3F0
|
|
sub_805F3F0: @ 805F3F0
|
|
push {r4,r5,lr}
|
|
adds r4, r0, 0
|
|
adds r5, r1, 0
|
|
lsls r2, 24
|
|
lsrs r2, 24
|
|
ldr r1, _0805F434 @ =gUnknown_0836DC09
|
|
ldrb r0, [r4, 0x6]
|
|
adds r0, r1
|
|
ldrb r0, [r0]
|
|
adds r1, r4, 0
|
|
adds r1, 0x21
|
|
ldrb r1, [r1]
|
|
bl state_to_direction
|
|
bl GetFaceDirectionAnimId
|
|
adds r2, r0, 0
|
|
lsls r2, 24
|
|
lsrs r2, 24
|
|
adds r0, r4, 0
|
|
adds r1, r5, 0
|
|
bl FieldObjectSetRegularAnim
|
|
ldrb r0, [r4]
|
|
movs r1, 0x2
|
|
orrs r0, r1
|
|
strb r0, [r4]
|
|
movs r0, 0x2
|
|
strh r0, [r5, 0x30]
|
|
movs r0, 0x1
|
|
pop {r4,r5}
|
|
pop {r1}
|
|
bx r1
|
|
.align 2, 0
|
|
_0805F434: .4byte gUnknown_0836DC09
|
|
thumb_func_end sub_805F3F0
|
|
|
|
thumb_func_start sub_805F438
|
|
sub_805F438: @ 805F438
|
|
push {r4-r7,lr}
|
|
mov r7, r8
|
|
push {r7}
|
|
sub sp, 0x4
|
|
adds r4, r0, 0
|
|
adds r7, r1, 0
|
|
mov r8, r3
|
|
lsls r2, 24
|
|
lsrs r6, r2, 24
|
|
ldr r1, _0805F4EC @ =gUnknown_0836DC09
|
|
ldrb r0, [r4, 0x6]
|
|
adds r0, r1
|
|
ldrb r0, [r0]
|
|
adds r1, r4, 0
|
|
adds r1, 0x21
|
|
ldrb r1, [r1]
|
|
adds r2, r6, 0
|
|
bl state_to_direction
|
|
adds r6, r0, 0
|
|
mov r5, sp
|
|
adds r5, 0x2
|
|
adds r0, r4, 0
|
|
adds r1, r6, 0
|
|
mov r2, sp
|
|
adds r3, r5, 0
|
|
bl FieldObjectMoveDestCoords
|
|
adds r0, r6, 0
|
|
bl GetGoSpeed0AnimId
|
|
adds r2, r0, 0
|
|
lsls r2, 24
|
|
lsrs r2, 24
|
|
adds r0, r4, 0
|
|
adds r1, r7, 0
|
|
bl FieldObjectSetRegularAnim
|
|
mov r0, sp
|
|
movs r2, 0
|
|
ldrsh r1, [r0, r2]
|
|
movs r0, 0
|
|
ldrsh r2, [r5, r0]
|
|
adds r0, r4, 0
|
|
adds r3, r6, 0
|
|
bl npc_block_way
|
|
lsls r0, 24
|
|
cmp r0, 0
|
|
bne _0805F4BE
|
|
mov r1, r8
|
|
cmp r1, 0
|
|
beq _0805F4D2
|
|
mov r0, sp
|
|
movs r2, 0
|
|
ldrsh r0, [r0, r2]
|
|
movs r2, 0
|
|
ldrsh r1, [r5, r2]
|
|
bl MapGridGetMetatileBehaviorAt
|
|
lsls r0, 24
|
|
lsrs r0, 24
|
|
bl _call_via_r8
|
|
lsls r0, 24
|
|
cmp r0, 0
|
|
bne _0805F4D2
|
|
_0805F4BE:
|
|
adds r0, r6, 0
|
|
bl GetFaceDirectionAnimId
|
|
adds r2, r0, 0
|
|
lsls r2, 24
|
|
lsrs r2, 24
|
|
adds r0, r4, 0
|
|
adds r1, r7, 0
|
|
bl FieldObjectSetRegularAnim
|
|
_0805F4D2:
|
|
ldrb r0, [r4]
|
|
movs r1, 0x2
|
|
orrs r0, r1
|
|
strb r0, [r4]
|
|
movs r0, 0x2
|
|
strh r0, [r7, 0x30]
|
|
movs r0, 0x1
|
|
add sp, 0x4
|
|
pop {r3}
|
|
mov r8, r3
|
|
pop {r4-r7}
|
|
pop {r1}
|
|
bx r1
|
|
.align 2, 0
|
|
_0805F4EC: .4byte gUnknown_0836DC09
|
|
thumb_func_end sub_805F438
|
|
.endif
|
|
|
|
thumb_func_start sub_805F4F0
|
|
sub_805F4F0: @ 805F4F0
|
|
push {r4-r7,lr}
|
|
mov r7, r8
|
|
push {r7}
|
|
sub sp, 0x4
|
|
adds r4, r0, 0
|
|
adds r7, r1, 0
|
|
mov r8, r3
|
|
lsls r2, 24
|
|
lsrs r6, r2, 24
|
|
ldr r1, _0805F5A4 @ =gUnknown_0836DC09
|
|
ldrb r0, [r4, 0x6]
|
|
adds r0, r1
|
|
ldrb r0, [r0]
|
|
adds r1, r4, 0
|
|
adds r1, 0x21
|
|
ldrb r1, [r1]
|
|
adds r2, r6, 0
|
|
bl state_to_direction
|
|
adds r6, r0, 0
|
|
mov r5, sp
|
|
adds r5, 0x2
|
|
adds r0, r4, 0
|
|
adds r1, r6, 0
|
|
mov r2, sp
|
|
adds r3, r5, 0
|
|
bl FieldObjectMoveDestCoords
|
|
adds r0, r6, 0
|
|
bl sub_8060744
|
|
adds r2, r0, 0
|
|
lsls r2, 24
|
|
lsrs r2, 24
|
|
adds r0, r4, 0
|
|
adds r1, r7, 0
|
|
bl FieldObjectSetRegularAnim
|
|
mov r0, sp
|
|
movs r2, 0
|
|
ldrsh r1, [r0, r2]
|
|
movs r0, 0
|
|
ldrsh r2, [r5, r0]
|
|
adds r0, r4, 0
|
|
adds r3, r6, 0
|
|
bl npc_block_way
|
|
lsls r0, 24
|
|
cmp r0, 0
|
|
bne _0805F576
|
|
mov r1, r8
|
|
cmp r1, 0
|
|
beq _0805F58A
|
|
mov r0, sp
|
|
movs r2, 0
|
|
ldrsh r0, [r0, r2]
|
|
movs r2, 0
|
|
ldrsh r1, [r5, r2]
|
|
bl MapGridGetMetatileBehaviorAt
|
|
lsls r0, 24
|
|
lsrs r0, 24
|
|
bl _call_via_r8
|
|
lsls r0, 24
|
|
cmp r0, 0
|
|
bne _0805F58A
|
|
_0805F576:
|
|
adds r0, r6, 0
|
|
bl GetFaceDirectionAnimId
|
|
adds r2, r0, 0
|
|
lsls r2, 24
|
|
lsrs r2, 24
|
|
adds r0, r4, 0
|
|
adds r1, r7, 0
|
|
bl FieldObjectSetRegularAnim
|
|
_0805F58A:
|
|
ldrb r0, [r4]
|
|
movs r1, 0x2
|
|
orrs r0, r1
|
|
strb r0, [r4]
|
|
movs r0, 0x2
|
|
strh r0, [r7, 0x30]
|
|
movs r0, 0x1
|
|
add sp, 0x4
|
|
pop {r3}
|
|
mov r8, r3
|
|
pop {r4-r7}
|
|
pop {r1}
|
|
bx r1
|
|
.align 2, 0
|
|
_0805F5A4: .4byte gUnknown_0836DC09
|
|
thumb_func_end sub_805F4F0
|
|
|
|
thumb_func_start sub_805F5A8
|
|
sub_805F5A8: @ 805F5A8
|
|
push {r4-r7,lr}
|
|
mov r7, r8
|
|
push {r7}
|
|
sub sp, 0x4
|
|
adds r4, r0, 0
|
|
adds r7, r1, 0
|
|
mov r8, r3
|
|
lsls r2, 24
|
|
lsrs r6, r2, 24
|
|
ldr r1, _0805F65C @ =gUnknown_0836DC09
|
|
ldrb r0, [r4, 0x6]
|
|
adds r0, r1
|
|
ldrb r0, [r0]
|
|
adds r1, r4, 0
|
|
adds r1, 0x21
|
|
ldrb r1, [r1]
|
|
adds r2, r6, 0
|
|
bl state_to_direction
|
|
adds r6, r0, 0
|
|
mov r5, sp
|
|
adds r5, 0x2
|
|
adds r0, r4, 0
|
|
adds r1, r6, 0
|
|
mov r2, sp
|
|
adds r3, r5, 0
|
|
bl FieldObjectMoveDestCoords
|
|
adds r0, r6, 0
|
|
bl sub_806079C
|
|
adds r2, r0, 0
|
|
lsls r2, 24
|
|
lsrs r2, 24
|
|
adds r0, r4, 0
|
|
adds r1, r7, 0
|
|
bl FieldObjectSetRegularAnim
|
|
mov r0, sp
|
|
movs r2, 0
|
|
ldrsh r1, [r0, r2]
|
|
movs r0, 0
|
|
ldrsh r2, [r5, r0]
|
|
adds r0, r4, 0
|
|
adds r3, r6, 0
|
|
bl npc_block_way
|
|
lsls r0, 24
|
|
cmp r0, 0
|
|
bne _0805F62E
|
|
mov r1, r8
|
|
cmp r1, 0
|
|
beq _0805F642
|
|
mov r0, sp
|
|
movs r2, 0
|
|
ldrsh r0, [r0, r2]
|
|
movs r2, 0
|
|
ldrsh r1, [r5, r2]
|
|
bl MapGridGetMetatileBehaviorAt
|
|
lsls r0, 24
|
|
lsrs r0, 24
|
|
bl _call_via_r8
|
|
lsls r0, 24
|
|
cmp r0, 0
|
|
bne _0805F642
|
|
_0805F62E:
|
|
adds r0, r6, 0
|
|
bl GetFaceDirectionAnimId
|
|
adds r2, r0, 0
|
|
lsls r2, 24
|
|
lsrs r2, 24
|
|
adds r0, r4, 0
|
|
adds r1, r7, 0
|
|
bl FieldObjectSetRegularAnim
|
|
_0805F642:
|
|
ldrb r0, [r4]
|
|
movs r1, 0x2
|
|
orrs r0, r1
|
|
strb r0, [r4]
|
|
movs r0, 0x2
|
|
strh r0, [r7, 0x30]
|
|
movs r0, 0x1
|
|
add sp, 0x4
|
|
pop {r3}
|
|
mov r8, r3
|
|
pop {r4-r7}
|
|
pop {r1}
|
|
bx r1
|
|
.align 2, 0
|
|
_0805F65C: .4byte gUnknown_0836DC09
|
|
thumb_func_end sub_805F5A8
|
|
|
|
thumb_func_start sub_805F660
|
|
sub_805F660: @ 805F660
|
|
push {r4-r7,lr}
|
|
mov r7, r8
|
|
push {r7}
|
|
sub sp, 0x4
|
|
adds r4, r0, 0
|
|
adds r7, r1, 0
|
|
mov r8, r3
|
|
lsls r2, 24
|
|
lsrs r6, r2, 24
|
|
ldr r1, _0805F714 @ =gUnknown_0836DC09
|
|
ldrb r0, [r4, 0x6]
|
|
adds r0, r1
|
|
ldrb r0, [r0]
|
|
adds r1, r4, 0
|
|
adds r1, 0x21
|
|
ldrb r1, [r1]
|
|
adds r2, r6, 0
|
|
bl state_to_direction
|
|
adds r6, r0, 0
|
|
mov r5, sp
|
|
adds r5, 0x2
|
|
adds r0, r4, 0
|
|
adds r1, r6, 0
|
|
mov r2, sp
|
|
adds r3, r5, 0
|
|
bl FieldObjectMoveDestCoords
|
|
adds r0, r6, 0
|
|
bl sub_80607C8
|
|
adds r2, r0, 0
|
|
lsls r2, 24
|
|
lsrs r2, 24
|
|
adds r0, r4, 0
|
|
adds r1, r7, 0
|
|
bl FieldObjectSetRegularAnim
|
|
mov r0, sp
|
|
movs r2, 0
|
|
ldrsh r1, [r0, r2]
|
|
movs r0, 0
|
|
ldrsh r2, [r5, r0]
|
|
adds r0, r4, 0
|
|
adds r3, r6, 0
|
|
bl npc_block_way
|
|
lsls r0, 24
|
|
cmp r0, 0
|
|
bne _0805F6E6
|
|
mov r1, r8
|
|
cmp r1, 0
|
|
beq _0805F6FA
|
|
mov r0, sp
|
|
movs r2, 0
|
|
ldrsh r0, [r0, r2]
|
|
movs r2, 0
|
|
ldrsh r1, [r5, r2]
|
|
bl MapGridGetMetatileBehaviorAt
|
|
lsls r0, 24
|
|
lsrs r0, 24
|
|
bl _call_via_r8
|
|
lsls r0, 24
|
|
cmp r0, 0
|
|
bne _0805F6FA
|
|
_0805F6E6:
|
|
adds r0, r6, 0
|
|
bl GetFaceDirectionAnimId
|
|
adds r2, r0, 0
|
|
lsls r2, 24
|
|
lsrs r2, 24
|
|
adds r0, r4, 0
|
|
adds r1, r7, 0
|
|
bl FieldObjectSetRegularAnim
|
|
_0805F6FA:
|
|
ldrb r0, [r4]
|
|
movs r1, 0x2
|
|
orrs r0, r1
|
|
strb r0, [r4]
|
|
movs r0, 0x2
|
|
strh r0, [r7, 0x30]
|
|
movs r0, 0x1
|
|
add sp, 0x4
|
|
pop {r3}
|
|
mov r8, r3
|
|
pop {r4-r7}
|
|
pop {r1}
|
|
bx r1
|
|
.align 2, 0
|
|
_0805F714: .4byte gUnknown_0836DC09
|
|
thumb_func_end sub_805F660
|
|
|
|
thumb_func_start cph_IM_DIFFERENT
|
|
cph_IM_DIFFERENT: @ 805F718
|
|
push {r4,r5,lr}
|
|
adds r4, r0, 0
|
|
adds r5, r1, 0
|
|
lsls r2, 24
|
|
lsrs r2, 24
|
|
ldr r1, _0805F75C @ =gUnknown_0836DC09
|
|
ldrb r0, [r4, 0x6]
|
|
adds r0, r1
|
|
ldrb r0, [r0]
|
|
adds r1, r4, 0
|
|
adds r1, 0x21
|
|
ldrb r1, [r1]
|
|
bl state_to_direction
|
|
bl sub_806084C
|
|
adds r2, r0, 0
|
|
lsls r2, 24
|
|
lsrs r2, 24
|
|
adds r0, r4, 0
|
|
adds r1, r5, 0
|
|
bl FieldObjectSetRegularAnim
|
|
ldrb r0, [r4]
|
|
movs r1, 0x2
|
|
orrs r0, r1
|
|
strb r0, [r4]
|
|
movs r0, 0x2
|
|
strh r0, [r5, 0x30]
|
|
movs r0, 0x1
|
|
pop {r4,r5}
|
|
pop {r1}
|
|
bx r1
|
|
.align 2, 0
|
|
_0805F75C: .4byte gUnknown_0836DC09
|
|
thumb_func_end cph_IM_DIFFERENT
|
|
|
|
thumb_func_start sub_805F760
|
|
sub_805F760: @ 805F760
|
|
push {r4-r7,lr}
|
|
mov r7, r8
|
|
push {r7}
|
|
sub sp, 0x4
|
|
adds r4, r0, 0
|
|
adds r7, r1, 0
|
|
mov r8, r3
|
|
lsls r2, 24
|
|
lsrs r6, r2, 24
|
|
ldr r1, _0805F814 @ =gUnknown_0836DC09
|
|
ldrb r0, [r4, 0x6]
|
|
adds r0, r1
|
|
ldrb r0, [r0]
|
|
adds r1, r4, 0
|
|
adds r1, 0x21
|
|
ldrb r1, [r1]
|
|
adds r2, r6, 0
|
|
bl state_to_direction
|
|
adds r6, r0, 0
|
|
mov r5, sp
|
|
adds r5, 0x2
|
|
adds r0, r4, 0
|
|
adds r1, r6, 0
|
|
mov r2, sp
|
|
adds r3, r5, 0
|
|
bl FieldObjectMoveDestCoords
|
|
adds r0, r6, 0
|
|
bl sub_80608A4
|
|
adds r2, r0, 0
|
|
lsls r2, 24
|
|
lsrs r2, 24
|
|
adds r0, r4, 0
|
|
adds r1, r7, 0
|
|
bl FieldObjectSetRegularAnim
|
|
mov r0, sp
|
|
movs r2, 0
|
|
ldrsh r1, [r0, r2]
|
|
movs r0, 0
|
|
ldrsh r2, [r5, r0]
|
|
adds r0, r4, 0
|
|
adds r3, r6, 0
|
|
bl npc_block_way
|
|
lsls r0, 24
|
|
cmp r0, 0
|
|
bne _0805F7E6
|
|
mov r1, r8
|
|
cmp r1, 0
|
|
beq _0805F7FA
|
|
mov r0, sp
|
|
movs r2, 0
|
|
ldrsh r0, [r0, r2]
|
|
movs r2, 0
|
|
ldrsh r1, [r5, r2]
|
|
bl MapGridGetMetatileBehaviorAt
|
|
lsls r0, 24
|
|
lsrs r0, 24
|
|
bl _call_via_r8
|
|
lsls r0, 24
|
|
cmp r0, 0
|
|
bne _0805F7FA
|
|
_0805F7E6:
|
|
adds r0, r6, 0
|
|
bl GetFaceDirectionAnimId
|
|
adds r2, r0, 0
|
|
lsls r2, 24
|
|
lsrs r2, 24
|
|
adds r0, r4, 0
|
|
adds r1, r7, 0
|
|
bl FieldObjectSetRegularAnim
|
|
_0805F7FA:
|
|
ldrb r0, [r4]
|
|
movs r1, 0x2
|
|
orrs r0, r1
|
|
strb r0, [r4]
|
|
movs r0, 0x2
|
|
strh r0, [r7, 0x30]
|
|
movs r0, 0x1
|
|
add sp, 0x4
|
|
pop {r3}
|
|
mov r8, r3
|
|
pop {r4-r7}
|
|
pop {r1}
|
|
bx r1
|
|
.align 2, 0
|
|
_0805F814: .4byte gUnknown_0836DC09
|
|
thumb_func_end sub_805F760
|
|
|
|
thumb_func_start oac_hopping
|
|
oac_hopping: @ 805F818
|
|
push {r4-r7,lr}
|
|
mov r7, r8
|
|
push {r7}
|
|
sub sp, 0x8
|
|
adds r4, r0, 0
|
|
adds r7, r1, 0
|
|
mov r8, r3
|
|
lsls r2, 24
|
|
lsrs r6, r2, 24
|
|
ldr r1, _0805F8DC @ =gUnknown_0836DC09
|
|
ldrb r0, [r4, 0x6]
|
|
adds r0, r1
|
|
ldrb r0, [r0]
|
|
adds r1, r4, 0
|
|
adds r1, 0x21
|
|
ldrb r1, [r1]
|
|
adds r2, r6, 0
|
|
bl state_to_direction
|
|
adds r6, r0, 0
|
|
ldrh r1, [r4, 0x10]
|
|
add r0, sp, 0x4
|
|
strh r1, [r0]
|
|
ldrh r0, [r4, 0x12]
|
|
mov r5, sp
|
|
adds r5, 0x6
|
|
strh r0, [r5]
|
|
movs r0, 0x2
|
|
str r0, [sp]
|
|
adds r0, r6, 0
|
|
add r1, sp, 0x4
|
|
adds r2, r5, 0
|
|
movs r3, 0x2
|
|
bl sub_8060320
|
|
adds r0, r6, 0
|
|
bl GetJumpLedgeAnimId
|
|
adds r2, r0, 0
|
|
lsls r2, 24
|
|
lsrs r2, 24
|
|
adds r0, r4, 0
|
|
adds r1, r7, 0
|
|
bl FieldObjectSetRegularAnim
|
|
add r0, sp, 0x4
|
|
movs r2, 0
|
|
ldrsh r1, [r0, r2]
|
|
movs r0, 0
|
|
ldrsh r2, [r5, r0]
|
|
adds r0, r4, 0
|
|
adds r3, r6, 0
|
|
bl npc_block_way
|
|
lsls r0, 24
|
|
cmp r0, 0
|
|
bne _0805F8AC
|
|
mov r1, r8
|
|
cmp r1, 0
|
|
beq _0805F8C0
|
|
add r0, sp, 0x4
|
|
movs r2, 0
|
|
ldrsh r0, [r0, r2]
|
|
movs r2, 0
|
|
ldrsh r1, [r5, r2]
|
|
bl MapGridGetMetatileBehaviorAt
|
|
lsls r0, 24
|
|
lsrs r0, 24
|
|
bl _call_via_r8
|
|
lsls r0, 24
|
|
cmp r0, 0
|
|
bne _0805F8C0
|
|
_0805F8AC:
|
|
adds r0, r6, 0
|
|
bl GetFaceDirectionAnimId
|
|
adds r2, r0, 0
|
|
lsls r2, 24
|
|
lsrs r2, 24
|
|
adds r0, r4, 0
|
|
adds r1, r7, 0
|
|
bl FieldObjectSetRegularAnim
|
|
_0805F8C0:
|
|
ldrb r0, [r4]
|
|
movs r1, 0x2
|
|
orrs r0, r1
|
|
strb r0, [r4]
|
|
movs r0, 0x2
|
|
strh r0, [r7, 0x30]
|
|
movs r0, 0x1
|
|
add sp, 0x8
|
|
pop {r3}
|
|
mov r8, r3
|
|
pop {r4-r7}
|
|
pop {r1}
|
|
bx r1
|
|
.align 2, 0
|
|
_0805F8DC: .4byte gUnknown_0836DC09
|
|
thumb_func_end oac_hopping
|