Update field_player_avatar.s

This commit is contained in:
MCboy 2018-07-24 17:01:44 +04:30 committed by GitHub
parent 82d88479ce
commit ed3a698b98
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -5,627 +5,6 @@
.text
thumb_func_start MovePlayerNotOnBike
@ void MovePlayerNotOnBike(u8 direction, u8 heldKeys)
MovePlayerNotOnBike: @ 808AE68
push {r4-r6,lr}
adds r4, r0, 0
adds r5, r1, 0
lsls r4, 24
lsrs r4, 24
lsls r5, 16
lsrs r5, 16
ldr r6, =gUnknown_08497490
adds r0, r4, 0
bl CheckMovementInputNotOnBike
lsls r0, 24
lsrs r0, 22
adds r0, r6
ldr r2, [r0]
adds r0, r4, 0
adds r1, r5, 0
bl _call_via_r2
pop {r4-r6}
pop {r0}
bx r0
.pool
thumb_func_end MovePlayerNotOnBike
thumb_func_start CheckMovementInputNotOnBike
@ u8 CheckMovementInputNotOnBike(u8 direction)
CheckMovementInputNotOnBike: @ 808AE98
push {r4,lr}
lsls r0, 24
lsrs r4, r0, 24
cmp r4, 0
bne _0808AEB0
ldr r0, =gPlayerAvatar
strb r4, [r0, 0x2]
movs r0, 0
b _0808AED2
.pool
_0808AEB0:
bl GetPlayerMovementDirection
lsls r0, 24
lsrs r0, 24
cmp r4, r0
beq _0808AECC
ldr r1, =gPlayerAvatar
ldrb r0, [r1, 0x2]
cmp r0, 0x2
beq _0808AECC
movs r0, 0x1
b _0808AED0
.pool
_0808AECC:
ldr r1, =gPlayerAvatar
movs r0, 0x2
_0808AED0:
strb r0, [r1, 0x2]
_0808AED2:
pop {r4}
pop {r1}
bx r1
.pool
thumb_func_end CheckMovementInputNotOnBike
thumb_func_start PlayerNotOnBikeNotMoving
@ void PlayerNotOnBikeNotMoving(u8 direction, u8 heldKeys)
PlayerNotOnBikeNotMoving: @ 808AEDC
push {lr}
bl GetPlayerFacingDirection
lsls r0, 24
lsrs r0, 24
bl PlayerFaceDirection
pop {r0}
bx r0
thumb_func_end PlayerNotOnBikeNotMoving
thumb_func_start PlayerNotOnBikeTurningInPlace
@ void PlayerNotOnBikeTurningInPlace(u8 direction, u8 heldKeys)
PlayerNotOnBikeTurningInPlace: @ 808AEF0
push {lr}
lsls r0, 24
lsrs r0, 24
bl PlayerTurnInPlace
pop {r0}
bx r0
thumb_func_end PlayerNotOnBikeTurningInPlace
thumb_func_start PlayerNotOnBikeMoving
@ void PlayerNotOnBikeMoving(u8 direction, u8 heldKeys)
PlayerNotOnBikeMoving: @ 808AF00
push {r4-r6,lr}
lsls r0, 24
lsrs r5, r0, 24
lsls r1, 16
lsrs r6, r1, 16
adds r0, r5, 0
bl CheckForPlayerAvatarCollision
lsls r0, 24
lsrs r4, r0, 24
cmp r4, 0
beq _0808AF4E
cmp r4, 0x6
bne _0808AF24
adds r0, r5, 0
bl PlayerJumpLedge
b _0808AFB6
_0808AF24:
cmp r4, 0x4
bne _0808AF3C
adds r0, r5, 0
bl IsPlayerCollidingWithFarawayIslandMew
lsls r0, 24
cmp r0, 0
beq _0808AF3C
adds r0, r5, 0
bl PlayerNotOnBikeCollideWithFarawayIslandMew
b _0808AFB6
_0808AF3C:
subs r0, r4, 0x5
lsls r0, 24
lsrs r0, 24
cmp r0, 0x3
bls _0808AFB6
adds r0, r5, 0
bl PlayerNotOnBikeCollide
b _0808AFB6
_0808AF4E:
ldr r4, =gPlayerAvatar
ldrb r1, [r4]
movs r0, 0x8
ands r0, r1
cmp r0, 0
beq _0808AF68
adds r0, r5, 0
bl PlayerGoSpeed2
b _0808AFB6
.pool
_0808AF68:
movs r0, 0x10
ands r0, r1
cmp r0, 0
bne _0808AFB0
movs r0, 0x2
ands r6, r0
cmp r6, 0
beq _0808AFB0
movs r0, 0x8C
lsls r0, 4
bl FlagGet
lsls r0, 24
cmp r0, 0
beq _0808AFB0
ldr r2, =gEventObjects
ldrb r1, [r4, 0x5]
lsls r0, r1, 3
adds r0, r1
lsls r0, 2
adds r0, r2
ldrb r0, [r0, 0x1E]
bl IsRunningDisallowed
cmp r0, 0
bne _0808AFB0
adds r0, r5, 0
bl PlayerRun
ldrb r1, [r4]
movs r0, 0x80
orrs r0, r1
strb r0, [r4]
b _0808AFB6
.pool
_0808AFB0:
adds r0, r5, 0
bl PlayerGoSpeed1
_0808AFB6:
pop {r4-r6}
pop {r0}
bx r0
thumb_func_end PlayerNotOnBikeMoving
thumb_func_start CheckForPlayerAvatarCollision
CheckForPlayerAvatarCollision: @ 808AFBC
push {r4-r6,lr}
sub sp, 0x8
adds r6, r0, 0
lsls r6, 24
lsrs r6, 24
ldr r0, =gPlayerAvatar
ldrb r0, [r0, 0x5]
lsls r4, r0, 3
adds r4, r0
lsls r4, 2
ldr r0, =gEventObjects
adds r4, r0
ldrh r1, [r4, 0x10]
add r0, sp, 0x4
strh r1, [r0]
ldrh r0, [r4, 0x12]
mov r5, sp
adds r5, 0x6
strh r0, [r5]
adds r0, r6, 0
add r1, sp, 0x4
adds r2, r5, 0
bl MoveCoords
add r0, sp, 0x4
movs r1, 0
ldrsh r0, [r0, r1]
movs r2, 0
ldrsh r1, [r5, r2]
bl MapGridGetMetatileBehaviorAt
lsls r0, 24
lsrs r0, 24
add r1, sp, 0x4
movs r3, 0
ldrsh r1, [r1, r3]
movs r3, 0
ldrsh r2, [r5, r3]
str r0, [sp]
adds r0, r4, 0
adds r3, r6, 0
bl CheckForEventObjectCollision
lsls r0, 24
lsrs r0, 24
add sp, 0x8
pop {r4-r6}
pop {r1}
bx r1
.pool
thumb_func_end CheckForPlayerAvatarCollision
thumb_func_start sub_808B028
sub_808B028: @ 808B028
push {r4-r6,lr}
sub sp, 0x8
adds r6, r0, 0
lsls r6, 24
lsrs r6, 24
ldr r0, =gPlayerAvatar
ldrb r0, [r0, 0x5]
lsls r4, r0, 3
adds r4, r0
lsls r4, 2
ldr r0, =gEventObjects
adds r4, r0
ldrh r1, [r4, 0x10]
add r0, sp, 0x4
strh r1, [r0]
ldrh r0, [r4, 0x12]
mov r5, sp
adds r5, 0x6
strh r0, [r5]
adds r0, r6, 0
add r1, sp, 0x4
adds r2, r5, 0
bl MoveCoords
add r0, sp, 0x4
movs r1, 0
ldrsh r0, [r0, r1]
movs r2, 0
ldrsh r1, [r5, r2]
bl MapGridGetMetatileBehaviorAt
lsls r0, 24
lsrs r0, 24
add r1, sp, 0x4
movs r3, 0
ldrsh r1, [r1, r3]
movs r3, 0
ldrsh r2, [r5, r3]
str r0, [sp]
adds r0, r4, 0
adds r3, r6, 0
bl sub_808B164
lsls r0, 24
lsrs r0, 24
add sp, 0x8
pop {r4-r6}
pop {r1}
bx r1
.pool
thumb_func_end sub_808B028
thumb_func_start CheckForEventObjectCollision
@ u8 CheckForEventObjectCollision(struct npc_state *eventObject, u16 x, u16 y, u8 direction, u8 metatileBehavior)
CheckForEventObjectCollision: @ 808B094
push {r4-r7,lr}
mov r7, r10
mov r6, r9
mov r5, r8
push {r5-r7}
sub sp, 0x4
ldr r4, [sp, 0x24]
lsls r1, 16
lsls r2, 16
lsls r3, 24
lsrs r6, r3, 24
lsls r4, 24
lsrs r4, 24
mov r10, r4
lsrs r7, r1, 16
asrs r5, r1, 16
lsrs r1, r2, 16
mov r9, r1
asrs r4, r2, 16
adds r1, r5, 0
adds r2, r4, 0
adds r3, r6, 0
bl GetCollisionAtCoords
lsls r0, 24
lsrs r0, 24
mov r1, sp
strb r0, [r1]
cmp r0, 0x3
bne _0808B0E4
adds r0, r5, 0
adds r1, r4, 0
adds r2, r6, 0
bl sub_808B1BC
lsls r0, 24
cmp r0, 0
beq _0808B0E4
movs r0, 0x5
b _0808B152
_0808B0E4:
lsls r5, r7, 16
asrs r0, r5, 16
mov r8, r0
mov r1, r9
lsls r4, r1, 16
asrs r7, r4, 16
adds r1, r7, 0
adds r2, r6, 0
bl ShouldJumpLedge
lsls r0, 24
cmp r0, 0
beq _0808B108
movs r0, 0x2B
bl IncrementGameStat
movs r0, 0x6
b _0808B152
_0808B108:
mov r0, sp
ldrb r0, [r0]
cmp r0, 0x4
bne _0808B124
mov r0, r8
adds r1, r7, 0
adds r2, r6, 0
bl sub_808B238
lsls r0, 24
cmp r0, 0
beq _0808B124
movs r0, 0x7
b _0808B152
_0808B124:
mov r0, sp
ldrb r0, [r0]
cmp r0, 0
bne _0808B14E
asrs r5, 16
asrs r4, 16
adds r0, r6, 0
adds r1, r5, 0
adds r2, r4, 0
bl CheckForRotatingGatePuzzleCollision
cmp r0, 0
beq _0808B142
movs r0, 0x8
b _0808B152
_0808B142:
adds r0, r5, 0
adds r1, r4, 0
mov r2, r10
mov r3, sp
bl check_acro_bike_metatile
_0808B14E:
mov r0, sp
ldrb r0, [r0]
_0808B152:
add sp, 0x4
pop {r3-r5}
mov r8, r3
mov r9, r4
mov r10, r5
pop {r4-r7}
pop {r1}
bx r1
thumb_func_end CheckForEventObjectCollision
thumb_func_start sub_808B164
sub_808B164: @ 808B164
push {r4-r7,lr}
sub sp, 0x4
ldr r4, [sp, 0x18]
lsls r3, 24
lsrs r6, r3, 24
lsls r4, 24
lsrs r7, r4, 24
lsls r1, 16
asrs r5, r1, 16
lsls r2, 16
asrs r4, r2, 16
adds r1, r5, 0
adds r2, r4, 0
adds r3, r6, 0
bl GetCollisionAtCoords
lsls r0, 24
lsrs r0, 24
mov r1, sp
strb r0, [r1]
cmp r0, 0
bne _0808B1AE
adds r0, r6, 0
adds r1, r5, 0
adds r2, r4, 0
bl CheckForRotatingGatePuzzleCollisionWithoutAnimation
cmp r0, 0
beq _0808B1A2
movs r0, 0x8
b _0808B1B2
_0808B1A2:
adds r0, r5, 0
adds r1, r4, 0
adds r2, r7, 0
mov r3, sp
bl check_acro_bike_metatile
_0808B1AE:
mov r0, sp
ldrb r0, [r0]
_0808B1B2:
add sp, 0x4
pop {r4-r7}
pop {r1}
bx r1
thumb_func_end sub_808B164
thumb_func_start sub_808B1BC
@ bool8 sub_808B1BC(u16 x, u16 y, u8 direction)
sub_808B1BC: @ 808B1BC
push {r4-r6,lr}
lsls r0, 16
lsrs r3, r0, 16
lsls r1, 16
lsrs r4, r1, 16
lsls r2, 24
lsrs r6, r2, 24
ldr r0, =gPlayerAvatar
ldrb r1, [r0]
movs r0, 0x8
ands r0, r1
cmp r0, 0
beq _0808B20C
lsls r5, r3, 16
asrs r0, r5, 16
lsls r4, 16
asrs r1, r4, 16
bl MapGridGetZCoordAt
lsls r0, 24
lsrs r0, 24
cmp r0, 0x3
bne _0808B20C
lsrs r0, r5, 16
lsrs r1, r4, 16
movs r2, 0x3
bl GetEventObjectIdByXYZ
lsls r0, 24
lsrs r0, 24
cmp r0, 0x10
bne _0808B20C
adds r0, r6, 0
bl sub_808C750
movs r0, 0x1
b _0808B20E
.pool
_0808B20C:
movs r0, 0
_0808B20E:
pop {r4-r6}
pop {r1}
bx r1
thumb_func_end sub_808B1BC
thumb_func_start ShouldJumpLedge
@ bool8 ShouldJumpLedge(s16 x, s16 y, u8 direction)
ShouldJumpLedge: @ 808B214
push {lr}
lsls r2, 24
lsrs r2, 24
lsls r0, 16
asrs r0, 16
lsls r1, 16
asrs r1, 16
bl GetLedgeJumpDirection
lsls r0, 24
cmp r0, 0
bne _0808B230
movs r0, 0
b _0808B232
_0808B230:
movs r0, 0x1
_0808B232:
pop {r1}
bx r1
thumb_func_end ShouldJumpLedge
thumb_func_start sub_808B238
sub_808B238: @ 808B238
push {r4-r7,lr}
sub sp, 0x4
mov r3, sp
strh r0, [r3]
mov r5, sp
adds r5, 0x2
strh r1, [r5]
lsls r2, 24
lsrs r7, r2, 24
ldr r0, =0x00000889
bl FlagGet
lsls r0, 24
cmp r0, 0
beq _0808B2D8
mov r0, sp
movs r1, 0
ldrsh r0, [r0, r1]
movs r2, 0
ldrsh r1, [r5, r2]
bl GetEventObjectIdByXY
lsls r0, 24
lsrs r6, r0, 24
cmp r6, 0x10
beq _0808B2D8
ldr r0, =gEventObjects
lsls r1, r6, 3
adds r1, r6
lsls r1, 2
adds r4, r1, r0
ldrb r0, [r4, 0x5]
cmp r0, 0x57
bne _0808B2D8
ldrh r1, [r4, 0x10]
mov r0, sp
strh r1, [r0]
ldrh r0, [r4, 0x12]
strh r0, [r5]
adds r0, r7, 0
mov r1, sp
adds r2, r5, 0
bl MoveCoords
mov r0, sp
movs r2, 0
ldrsh r1, [r0, r2]
movs r0, 0
ldrsh r2, [r5, r0]
adds r0, r4, 0
adds r3, r7, 0
bl GetCollisionAtCoords
lsls r0, 24
cmp r0, 0
bne _0808B2D8
mov r0, sp
movs r1, 0
ldrsh r0, [r0, r1]
movs r2, 0
ldrsh r1, [r5, r2]
bl MapGridGetMetatileBehaviorAt
lsls r0, 24
lsrs r0, 24
bl MetatileBehavior_IsNonAnimDoor
lsls r0, 24
cmp r0, 0
bne _0808B2D8
adds r0, r6, 0
adds r1, r7, 0
bl task_add_bump_boulder
movs r0, 0x1
b _0808B2DA
.pool
_0808B2D8:
movs r0, 0
_0808B2DA:
add sp, 0x4
pop {r4-r7}
pop {r1}
bx r1
thumb_func_end sub_808B238
thumb_func_start check_acro_bike_metatile
@ void check_acro_bike_metatile(s16 x, s16 y, u8 metatileBehavior, u8 *returnValue)
check_acro_bike_metatile: @ 808B2E4
push {r4-r7,lr}
adds r6, r3, 0
lsls r2, 24
lsrs r5, r2, 24
movs r4, 0
ldr r7, =gUnknown_0849749C
_0808B2F0:
lsls r0, r4, 2
adds r0, r7
ldr r1, [r0]
adds r0, r5, 0
bl _call_via_r1
lsls r0, 24
cmp r0, 0
beq _0808B314
ldr r0, =gUnknown_084974B0
adds r0, r4, r0
ldrb r0, [r0]
strb r0, [r6]
b _0808B31E
.pool
_0808B314:
adds r0, r4, 0x1
lsls r0, 24
lsrs r4, r0, 24
cmp r4, 0x4
bls _0808B2F0
_0808B31E:
pop {r4-r7}
pop {r0}
bx r0
thumb_func_end check_acro_bike_metatile
thumb_func_start IsPlayerCollidingWithFarawayIslandMew
@ bool8 IsPlayerCollidingWithFarawayIslandMew(u8 direction)
IsPlayerCollidingWithFarawayIslandMew: @ 808B324