decompile bike.s

This commit is contained in:
DizzyEggg 2017-12-21 17:46:03 +01:00
parent 7e6a68a99a
commit 6b5157b2a3
20 changed files with 1335 additions and 2398 deletions

2199
asm/bike.s

File diff suppressed because it is too large Load Diff

View File

@ -62,7 +62,7 @@ _0809BF3C:
cmp r6, 0 cmp r6, 0
bne _0809BFA2 bne _0809BFA2
_0809BF40: _0809BF40:
bl sub_811A138 bl GetPlayerSpeed
lsls r0, 16 lsls r0, 16
asrs r0, 16 asrs r0, 16
cmp r0, 0x4 cmp r0, 0x4

View File

@ -2027,7 +2027,7 @@ _080B6A8A:
thumb_func_start mapldr_08084390 thumb_func_start mapldr_08084390
mapldr_08084390: @ 80B6AA4 mapldr_08084390: @ 80B6AA4
push {r4,lr} push {r4,lr}
bl sub_8085784 bl Overworld_PlaySpecialMapMusic
bl pal_fill_black bl pal_fill_black
ldr r0, =c3_080843F8 ldr r0, =c3_080843F8
movs r1, 0 movs r1, 0
@ -2113,7 +2113,7 @@ _080B6B58:
thumb_func_start sub_80B6B68 thumb_func_start sub_80B6B68
sub_80B6B68: @ 80B6B68 sub_80B6B68: @ 80B6B68
push {lr} push {lr}
bl sub_8085784 bl Overworld_PlaySpecialMapMusic
bl pal_fill_for_maplights bl pal_fill_for_maplights
bl ScriptContext2_Enable bl ScriptContext2_Enable
bl FreezeMapObjects bl FreezeMapObjects
@ -2780,7 +2780,7 @@ _080B709C:
thumb_func_start sub_80B70B4 thumb_func_start sub_80B70B4
sub_80B70B4: @ 80B70B4 sub_80B70B4: @ 80B70B4
push {lr} push {lr}
bl sub_8085784 bl Overworld_PlaySpecialMapMusic
bl pal_fill_for_maplights bl pal_fill_for_maplights
bl ScriptContext2_Enable bl ScriptContext2_Enable
ldr r0, =sub_80B70DC ldr r0, =sub_80B70DC
@ -3747,7 +3747,7 @@ _080B784C:
thumb_func_start mapldr_080851BC thumb_func_start mapldr_080851BC
mapldr_080851BC: @ 80B7868 mapldr_080851BC: @ 80B7868
push {lr} push {lr}
bl sub_8085784 bl Overworld_PlaySpecialMapMusic
bl pal_fill_for_maplights bl pal_fill_for_maplights
bl ScriptContext2_Enable bl ScriptContext2_Enable
ldr r0, =gFieldCallback ldr r0, =gFieldCallback
@ -4458,7 +4458,7 @@ _080B7E40:
thumb_func_start mapldr_080859D4 thumb_func_start mapldr_080859D4
mapldr_080859D4: @ 80B7E48 mapldr_080859D4: @ 80B7E48
push {lr} push {lr}
bl sub_8085784 bl Overworld_PlaySpecialMapMusic
bl pal_fill_for_maplights bl pal_fill_for_maplights
bl ScriptContext2_Enable bl ScriptContext2_Enable
bl FreezeMapObjects bl FreezeMapObjects
@ -4903,7 +4903,7 @@ _080B81E6:
thumb_func_start mapldr_08085D88 thumb_func_start mapldr_08085D88
mapldr_08085D88: @ 80B8200 mapldr_08085D88: @ 80B8200
push {lr} push {lr}
bl sub_8085784 bl Overworld_PlaySpecialMapMusic
bl pal_fill_for_maplights bl pal_fill_for_maplights
bl ScriptContext2_Enable bl ScriptContext2_Enable
bl FreezeMapObjects bl FreezeMapObjects

View File

@ -57,7 +57,7 @@ player_step: @ 808A9C0
bne _0808AA26 bne _0808AA26
adds r0, r7, 0 adds r0, r7, 0
adds r1, r6, 0 adds r1, r6, 0
bl sub_8119C3C bl Bike_TryAcroBikeHistoryUpdate
adds r0, r5, 0 adds r0, r5, 0
mov r1, r8 mov r1, r8
bl TryInterruptFieldObjectSpecialAnim bl TryInterruptFieldObjectSpecialAnim
@ -405,7 +405,7 @@ DoForcedMovementInCurrentDirection: @ 808AC58
thumb_func_start ForcedMovement_Slip thumb_func_start ForcedMovement_Slip
ForcedMovement_Slip: @ 808AC8C ForcedMovement_Slip: @ 808AC8C
push {lr} push {lr}
ldr r0, =PlayerGoSpeed1 ldr r0, =PlayerGoSpeed2
bl DoForcedMovementInCurrentDirection bl DoForcedMovementInCurrentDirection
lsls r0, 24 lsls r0, 24
lsrs r0, 24 lsrs r0, 24
@ -417,7 +417,7 @@ ForcedMovement_Slip: @ 808AC8C
thumb_func_start ForcedMovement_WalkSouth thumb_func_start ForcedMovement_WalkSouth
ForcedMovement_WalkSouth: @ 808ACA0 ForcedMovement_WalkSouth: @ 808ACA0
push {lr} push {lr}
ldr r1, =PlayerGoSpeed0 ldr r1, =PlayerGoSpeed1
movs r0, 0x1 movs r0, 0x1
bl DoForcedMovement bl DoForcedMovement
lsls r0, 24 lsls r0, 24
@ -430,7 +430,7 @@ ForcedMovement_WalkSouth: @ 808ACA0
thumb_func_start ForcedMovement_WalkNorth thumb_func_start ForcedMovement_WalkNorth
ForcedMovement_WalkNorth: @ 808ACB8 ForcedMovement_WalkNorth: @ 808ACB8
push {lr} push {lr}
ldr r1, =PlayerGoSpeed0 ldr r1, =PlayerGoSpeed1
movs r0, 0x2 movs r0, 0x2
bl DoForcedMovement bl DoForcedMovement
lsls r0, 24 lsls r0, 24
@ -443,7 +443,7 @@ ForcedMovement_WalkNorth: @ 808ACB8
thumb_func_start ForcedMovement_WalkWest thumb_func_start ForcedMovement_WalkWest
ForcedMovement_WalkWest: @ 808ACD0 ForcedMovement_WalkWest: @ 808ACD0
push {lr} push {lr}
ldr r1, =PlayerGoSpeed0 ldr r1, =PlayerGoSpeed1
movs r0, 0x3 movs r0, 0x3
bl DoForcedMovement bl DoForcedMovement
lsls r0, 24 lsls r0, 24
@ -456,7 +456,7 @@ ForcedMovement_WalkWest: @ 808ACD0
thumb_func_start ForcedMovement_WalkEast thumb_func_start ForcedMovement_WalkEast
ForcedMovement_WalkEast: @ 808ACE8 ForcedMovement_WalkEast: @ 808ACE8
push {lr} push {lr}
ldr r1, =PlayerGoSpeed0 ldr r1, =PlayerGoSpeed1
movs r0, 0x4 movs r0, 0x4
bl DoForcedMovement bl DoForcedMovement
lsls r0, 24 lsls r0, 24
@ -469,7 +469,7 @@ ForcedMovement_WalkEast: @ 808ACE8
thumb_func_start ForcedMovement_PushedSouthByCurrent thumb_func_start ForcedMovement_PushedSouthByCurrent
ForcedMovement_PushedSouthByCurrent: @ 808AD00 ForcedMovement_PushedSouthByCurrent: @ 808AD00
push {lr} push {lr}
ldr r1, =PlayerGoSpeed2 ldr r1, =PlayerGoSpeed3
movs r0, 0x1 movs r0, 0x1
bl DoForcedMovement bl DoForcedMovement
lsls r0, 24 lsls r0, 24
@ -482,7 +482,7 @@ ForcedMovement_PushedSouthByCurrent: @ 808AD00
thumb_func_start ForcedMovement_PushedNorthByCurrent thumb_func_start ForcedMovement_PushedNorthByCurrent
ForcedMovement_PushedNorthByCurrent: @ 808AD18 ForcedMovement_PushedNorthByCurrent: @ 808AD18
push {lr} push {lr}
ldr r1, =PlayerGoSpeed2 ldr r1, =PlayerGoSpeed3
movs r0, 0x2 movs r0, 0x2
bl DoForcedMovement bl DoForcedMovement
lsls r0, 24 lsls r0, 24
@ -495,7 +495,7 @@ ForcedMovement_PushedNorthByCurrent: @ 808AD18
thumb_func_start ForcedMovement_PushedWestByCurrent thumb_func_start ForcedMovement_PushedWestByCurrent
ForcedMovement_PushedWestByCurrent: @ 808AD30 ForcedMovement_PushedWestByCurrent: @ 808AD30
push {lr} push {lr}
ldr r1, =PlayerGoSpeed2 ldr r1, =PlayerGoSpeed3
movs r0, 0x3 movs r0, 0x3
bl DoForcedMovement bl DoForcedMovement
lsls r0, 24 lsls r0, 24
@ -508,7 +508,7 @@ ForcedMovement_PushedWestByCurrent: @ 808AD30
thumb_func_start ForcedMovement_PushedEastByCurrent thumb_func_start ForcedMovement_PushedEastByCurrent
ForcedMovement_PushedEastByCurrent: @ 808AD48 ForcedMovement_PushedEastByCurrent: @ 808AD48
push {lr} push {lr}
ldr r1, =PlayerGoSpeed2 ldr r1, =PlayerGoSpeed3
movs r0, 0x4 movs r0, 0x4
bl DoForcedMovement bl DoForcedMovement
lsls r0, 24 lsls r0, 24
@ -548,7 +548,7 @@ ForcedMovement_Slide: @ 808AD60
thumb_func_start ForcedMovement_SlideSouth thumb_func_start ForcedMovement_SlideSouth
ForcedMovement_SlideSouth: @ 808AD98 ForcedMovement_SlideSouth: @ 808AD98
push {lr} push {lr}
ldr r1, =PlayerGoSpeed1 ldr r1, =PlayerGoSpeed2
movs r0, 0x1 movs r0, 0x1
bl ForcedMovement_Slide bl ForcedMovement_Slide
lsls r0, 24 lsls r0, 24
@ -561,7 +561,7 @@ ForcedMovement_SlideSouth: @ 808AD98
thumb_func_start ForcedMovement_SlideNorth thumb_func_start ForcedMovement_SlideNorth
ForcedMovement_SlideNorth: @ 808ADB0 ForcedMovement_SlideNorth: @ 808ADB0
push {lr} push {lr}
ldr r1, =PlayerGoSpeed1 ldr r1, =PlayerGoSpeed2
movs r0, 0x2 movs r0, 0x2
bl ForcedMovement_Slide bl ForcedMovement_Slide
lsls r0, 24 lsls r0, 24
@ -574,7 +574,7 @@ ForcedMovement_SlideNorth: @ 808ADB0
thumb_func_start ForcedMovement_SlideWest thumb_func_start ForcedMovement_SlideWest
ForcedMovement_SlideWest: @ 808ADC8 ForcedMovement_SlideWest: @ 808ADC8
push {lr} push {lr}
ldr r1, =PlayerGoSpeed1 ldr r1, =PlayerGoSpeed2
movs r0, 0x3 movs r0, 0x3
bl ForcedMovement_Slide bl ForcedMovement_Slide
lsls r0, 24 lsls r0, 24
@ -587,7 +587,7 @@ ForcedMovement_SlideWest: @ 808ADC8
thumb_func_start ForcedMovement_SlideEast thumb_func_start ForcedMovement_SlideEast
ForcedMovement_SlideEast: @ 808ADE0 ForcedMovement_SlideEast: @ 808ADE0
push {lr} push {lr}
ldr r1, =PlayerGoSpeed1 ldr r1, =PlayerGoSpeed2
movs r0, 0x4 movs r0, 0x4
bl ForcedMovement_Slide bl ForcedMovement_Slide
lsls r0, 24 lsls r0, 24
@ -630,19 +630,19 @@ ForcedMovement_MuddySlope: @ 808AE10
ands r0, r1 ands r0, r1
cmp r0, 0x20 cmp r0, 0x20
bne _0808AE36 bne _0808AE36
bl sub_811A138 bl GetPlayerSpeed
lsls r0, 16 lsls r0, 16
asrs r0, 16 asrs r0, 16
cmp r0, 0x3 cmp r0, 0x3
bgt _0808AE60 bgt _0808AE60
_0808AE36: _0808AE36:
movs r0, 0 movs r0, 0
bl sub_811A114 bl Bike_UpdateBikeCounterSpeed
ldrb r0, [r4, 0x1] ldrb r0, [r4, 0x1]
movs r1, 0x2 movs r1, 0x2
orrs r0, r1 orrs r0, r1
strb r0, [r4, 0x1] strb r0, [r4, 0x1]
ldr r1, =PlayerGoSpeed1 ldr r1, =PlayerGoSpeed2
movs r0, 0x1 movs r0, 0x1
bl DoForcedMovement bl DoForcedMovement
lsls r0, 24 lsls r0, 24
@ -791,7 +791,7 @@ _0808AF4E:
cmp r0, 0 cmp r0, 0
beq _0808AF68 beq _0808AF68
adds r0, r5, 0 adds r0, r5, 0
bl PlayerGoSpeed1 bl PlayerGoSpeed2
b _0808AFB6 b _0808AFB6
.pool .pool
_0808AF68: _0808AF68:
@ -829,7 +829,7 @@ _0808AF68:
.pool .pool
_0808AFB0: _0808AFB0:
adds r0, r5, 0 adds r0, r5, 0
bl PlayerGoSpeed0 bl PlayerGoSpeed1
_0808AFB6: _0808AFB6:
pop {r4-r6} pop {r4-r6}
pop {r0} pop {r0}
@ -1471,7 +1471,7 @@ PlayerAvatarTransition_MachBike: @ 808B46C
bl SetPlayerAvatarStateMask bl SetPlayerAvatarStateMask
movs r0, 0 movs r0, 0
movs r1, 0 movs r1, 0
bl sub_811A0D0 bl BikeClearState
pop {r4} pop {r4}
pop {r0} pop {r0}
bx r0 bx r0
@ -1497,8 +1497,8 @@ PlayerAvatarTransition_AcroBike: @ 808B4A0
bl SetPlayerAvatarStateMask bl SetPlayerAvatarStateMask
movs r0, 0 movs r0, 0
movs r1, 0 movs r1, 0
bl sub_811A0D0 bl BikeClearState
bl sub_811A188 bl Bike_HandleBumpySlopeJump
pop {r4} pop {r4}
pop {r0} pop {r0}
bx r0 bx r0
@ -1774,9 +1774,9 @@ sub_808B6BC: @ 808B6BC
.pool .pool
thumb_func_end sub_808B6BC thumb_func_end sub_808B6BC
thumb_func_start player_npc_set_state_and_x22_etc thumb_func_start PlayerSetAnimId
@ void player_npc_set_state_and_x22_etc(u8 animState, u8 a2) @ void PlayerSetAnimId(u8 animState, u8 a2)
player_npc_set_state_and_x22_etc: @ 808B6E4 PlayerSetAnimId: @ 808B6E4
push {r4,r5,lr} push {r4,r5,lr}
lsls r0, 24 lsls r0, 24
lsrs r5, r0, 24 lsrs r5, r0, 24
@ -1802,11 +1802,11 @@ _0808B712:
pop {r0} pop {r0}
bx r0 bx r0
.pool .pool
thumb_func_end player_npc_set_state_and_x22_etc thumb_func_end PlayerSetAnimId
thumb_func_start PlayerGoSpeed0 thumb_func_start PlayerGoSpeed1
@ void PlayerGoSpeed0(u8 direction) @ void PlayerGoSpeed1(u8 direction)
PlayerGoSpeed0: @ 808B720 PlayerGoSpeed1: @ 808B720
push {lr} push {lr}
lsls r0, 24 lsls r0, 24
lsrs r0, 24 lsrs r0, 24
@ -1814,14 +1814,14 @@ PlayerGoSpeed0: @ 808B720
lsls r0, 24 lsls r0, 24
lsrs r0, 24 lsrs r0, 24
movs r1, 0x2 movs r1, 0x2
bl player_npc_set_state_and_x22_etc bl PlayerSetAnimId
pop {r0} pop {r0}
bx r0 bx r0
thumb_func_end PlayerGoSpeed0 thumb_func_end PlayerGoSpeed1
thumb_func_start PlayerGoSpeed1 thumb_func_start PlayerGoSpeed2
@ void PlayerGoSpeed1(u8 direction) @ void PlayerGoSpeed2(u8 direction)
PlayerGoSpeed1: @ 808B738 PlayerGoSpeed2: @ 808B738
push {lr} push {lr}
lsls r0, 24 lsls r0, 24
lsrs r0, 24 lsrs r0, 24
@ -1829,14 +1829,14 @@ PlayerGoSpeed1: @ 808B738
lsls r0, 24 lsls r0, 24
lsrs r0, 24 lsrs r0, 24
movs r1, 0x2 movs r1, 0x2
bl player_npc_set_state_and_x22_etc bl PlayerSetAnimId
pop {r0} pop {r0}
bx r0 bx r0
thumb_func_end PlayerGoSpeed1 thumb_func_end PlayerGoSpeed2
thumb_func_start PlayerGoSpeed2 thumb_func_start PlayerGoSpeed3
@ void PlayerGoSpeed2(u8 direction) @ void PlayerGoSpeed3(u8 direction)
PlayerGoSpeed2: @ 808B750 PlayerGoSpeed3: @ 808B750
push {lr} push {lr}
lsls r0, 24 lsls r0, 24
lsrs r0, 24 lsrs r0, 24
@ -1844,14 +1844,14 @@ PlayerGoSpeed2: @ 808B750
lsls r0, 24 lsls r0, 24
lsrs r0, 24 lsrs r0, 24
movs r1, 0x2 movs r1, 0x2
bl player_npc_set_state_and_x22_etc bl PlayerSetAnimId
pop {r0} pop {r0}
bx r0 bx r0
thumb_func_end PlayerGoSpeed2 thumb_func_end PlayerGoSpeed3
thumb_func_start PlayerGoSpeed3 thumb_func_start PlayerGoSpeed4
@ void PlayerGoSpeed3(u8 direction) @ void PlayerGoSpeed4(u8 direction)
PlayerGoSpeed3: @ 808B768 PlayerGoSpeed4: @ 808B768
push {lr} push {lr}
lsls r0, 24 lsls r0, 24
lsrs r0, 24 lsrs r0, 24
@ -1859,10 +1859,10 @@ PlayerGoSpeed3: @ 808B768
lsls r0, 24 lsls r0, 24
lsrs r0, 24 lsrs r0, 24
movs r1, 0x2 movs r1, 0x2
bl player_npc_set_state_and_x22_etc bl PlayerSetAnimId
pop {r0} pop {r0}
bx r0 bx r0
thumb_func_end PlayerGoSpeed3 thumb_func_end PlayerGoSpeed4
thumb_func_start PlayerRun thumb_func_start PlayerRun
@ void PlayerRun(u8 direction) @ void PlayerRun(u8 direction)
@ -1874,7 +1874,7 @@ PlayerRun: @ 808B780
lsls r0, 24 lsls r0, 24
lsrs r0, 24 lsrs r0, 24
movs r1, 0x2 movs r1, 0x2
bl player_npc_set_state_and_x22_etc bl PlayerSetAnimId
pop {r0} pop {r0}
bx r0 bx r0
thumb_func_end PlayerRun thumb_func_end PlayerRun
@ -1893,7 +1893,7 @@ PlayerOnBikeCollide: @ 808B798
lsls r0, 24 lsls r0, 24
lsrs r0, 24 lsrs r0, 24
movs r1, 0x2 movs r1, 0x2
bl player_npc_set_state_and_x22_etc bl PlayerSetAnimId
pop {r4} pop {r4}
pop {r0} pop {r0}
bx r0 bx r0
@ -1909,7 +1909,7 @@ PlayerOnBikeCollideWithFarawayIslandMew: @ 808B7BC
lsls r0, 24 lsls r0, 24
lsrs r0, 24 lsrs r0, 24
movs r1, 0x2 movs r1, 0x2
bl player_npc_set_state_and_x22_etc bl PlayerSetAnimId
pop {r0} pop {r0}
bx r0 bx r0
thumb_func_end PlayerOnBikeCollideWithFarawayIslandMew thumb_func_end PlayerOnBikeCollideWithFarawayIslandMew
@ -1928,7 +1928,7 @@ PlayerNotOnBikeCollide: @ 808B7D4
lsls r0, 24 lsls r0, 24
lsrs r0, 24 lsrs r0, 24
movs r1, 0x2 movs r1, 0x2
bl player_npc_set_state_and_x22_etc bl PlayerSetAnimId
pop {r4} pop {r4}
pop {r0} pop {r0}
bx r0 bx r0
@ -1944,7 +1944,7 @@ PlayerNotOnBikeCollideWithFarawayIslandMew: @ 808B7F8
lsls r0, 24 lsls r0, 24
lsrs r0, 24 lsrs r0, 24
movs r1, 0x2 movs r1, 0x2
bl player_npc_set_state_and_x22_etc bl PlayerSetAnimId
pop {r0} pop {r0}
bx r0 bx r0
thumb_func_end PlayerNotOnBikeCollideWithFarawayIslandMew thumb_func_end PlayerNotOnBikeCollideWithFarawayIslandMew
@ -1959,7 +1959,7 @@ PlayerFaceDirection: @ 808B810
lsls r0, 24 lsls r0, 24
lsrs r0, 24 lsrs r0, 24
movs r1, 0x1 movs r1, 0x1
bl player_npc_set_state_and_x22_etc bl PlayerSetAnimId
pop {r0} pop {r0}
bx r0 bx r0
thumb_func_end PlayerFaceDirection thumb_func_end PlayerFaceDirection
@ -1974,7 +1974,7 @@ PlayerTurnInPlace: @ 808B828
lsls r0, 24 lsls r0, 24
lsrs r0, 24 lsrs r0, 24
movs r1, 0x1 movs r1, 0x1
bl player_npc_set_state_and_x22_etc bl PlayerSetAnimId
pop {r0} pop {r0}
bx r0 bx r0
thumb_func_end PlayerTurnInPlace thumb_func_end PlayerTurnInPlace
@ -1993,7 +1993,7 @@ PlayerJumpLedge: @ 808B840
lsls r0, 24 lsls r0, 24
lsrs r0, 24 lsrs r0, 24
movs r1, 0x8 movs r1, 0x8
bl player_npc_set_state_and_x22_etc bl PlayerSetAnimId
pop {r4} pop {r4}
pop {r0} pop {r0}
bx r0 bx r0
@ -2033,8 +2033,8 @@ _0808B89A:
.pool .pool
thumb_func_end sub_808B864 thumb_func_end sub_808B864
thumb_func_start sub_808B8A8 thumb_func_start PlayerIdleWheelie
sub_808B8A8: @ 808B8A8 PlayerIdleWheelie: @ 808B8A8
push {lr} push {lr}
lsls r0, 24 lsls r0, 24
lsrs r0, 24 lsrs r0, 24
@ -2042,13 +2042,13 @@ sub_808B8A8: @ 808B8A8
lsls r0, 24 lsls r0, 24
lsrs r0, 24 lsrs r0, 24
movs r1, 0x1 movs r1, 0x1
bl player_npc_set_state_and_x22_etc bl PlayerSetAnimId
pop {r0} pop {r0}
bx r0 bx r0
thumb_func_end sub_808B8A8 thumb_func_end PlayerIdleWheelie
thumb_func_start sub_808B8C0 thumb_func_start PlayerStartWheelie
sub_808B8C0: @ 808B8C0 PlayerStartWheelie: @ 808B8C0
push {lr} push {lr}
lsls r0, 24 lsls r0, 24
lsrs r0, 24 lsrs r0, 24
@ -2056,13 +2056,13 @@ sub_808B8C0: @ 808B8C0
lsls r0, 24 lsls r0, 24
lsrs r0, 24 lsrs r0, 24
movs r1, 0x1 movs r1, 0x1
bl player_npc_set_state_and_x22_etc bl PlayerSetAnimId
pop {r0} pop {r0}
bx r0 bx r0
thumb_func_end sub_808B8C0 thumb_func_end PlayerStartWheelie
thumb_func_start sub_808B8D8 thumb_func_start PlayerEndWheelie
sub_808B8D8: @ 808B8D8 PlayerEndWheelie: @ 808B8D8
push {lr} push {lr}
lsls r0, 24 lsls r0, 24
lsrs r0, 24 lsrs r0, 24
@ -2070,13 +2070,13 @@ sub_808B8D8: @ 808B8D8
lsls r0, 24 lsls r0, 24
lsrs r0, 24 lsrs r0, 24
movs r1, 0x1 movs r1, 0x1
bl player_npc_set_state_and_x22_etc bl PlayerSetAnimId
pop {r0} pop {r0}
bx r0 bx r0
thumb_func_end sub_808B8D8 thumb_func_end PlayerEndWheelie
thumb_func_start sub_808B8F0 thumb_func_start PlayerStandingHoppingWheelie
sub_808B8F0: @ 808B8F0 PlayerStandingHoppingWheelie: @ 808B8F0
push {r4,lr} push {r4,lr}
adds r4, r0, 0 adds r4, r0, 0
lsls r4, 24 lsls r4, 24
@ -2088,14 +2088,14 @@ sub_808B8F0: @ 808B8F0
lsls r0, 24 lsls r0, 24
lsrs r0, 24 lsrs r0, 24
movs r1, 0x1 movs r1, 0x1
bl player_npc_set_state_and_x22_etc bl PlayerSetAnimId
pop {r4} pop {r4}
pop {r0} pop {r0}
bx r0 bx r0
thumb_func_end sub_808B8F0 thumb_func_end PlayerStandingHoppingWheelie
thumb_func_start sub_808B914 thumb_func_start PlayerMovingHoppingWheelie
sub_808B914: @ 808B914 PlayerMovingHoppingWheelie: @ 808B914
push {r4,lr} push {r4,lr}
adds r4, r0, 0 adds r4, r0, 0
lsls r4, 24 lsls r4, 24
@ -2107,14 +2107,14 @@ sub_808B914: @ 808B914
lsls r0, 24 lsls r0, 24
lsrs r0, 24 lsrs r0, 24
movs r1, 0x2 movs r1, 0x2
bl player_npc_set_state_and_x22_etc bl PlayerSetAnimId
pop {r4} pop {r4}
pop {r0} pop {r0}
bx r0 bx r0
thumb_func_end sub_808B914 thumb_func_end PlayerMovingHoppingWheelie
thumb_func_start sub_808B938 thumb_func_start PlayerLedgeHoppingWheelie
sub_808B938: @ 808B938 PlayerLedgeHoppingWheelie: @ 808B938
push {r4,lr} push {r4,lr}
adds r4, r0, 0 adds r4, r0, 0
lsls r4, 24 lsls r4, 24
@ -2126,14 +2126,14 @@ sub_808B938: @ 808B938
lsls r0, 24 lsls r0, 24
lsrs r0, 24 lsrs r0, 24
movs r1, 0x8 movs r1, 0x8
bl player_npc_set_state_and_x22_etc bl PlayerSetAnimId
pop {r4} pop {r4}
pop {r0} pop {r0}
bx r0 bx r0
thumb_func_end sub_808B938 thumb_func_end PlayerLedgeHoppingWheelie
thumb_func_start sub_808B95C thumb_func_start PlayerAcroTurnJump
sub_808B95C: @ 808B95C PlayerAcroTurnJump: @ 808B95C
push {r4,lr} push {r4,lr}
adds r4, r0, 0 adds r4, r0, 0
lsls r4, 24 lsls r4, 24
@ -2145,11 +2145,11 @@ sub_808B95C: @ 808B95C
lsls r0, 24 lsls r0, 24
lsrs r0, 24 lsrs r0, 24
movs r1, 0x1 movs r1, 0x1
bl player_npc_set_state_and_x22_etc bl PlayerSetAnimId
pop {r4} pop {r4}
pop {r0} pop {r0}
bx r0 bx r0
thumb_func_end sub_808B95C thumb_func_end PlayerAcroTurnJump
thumb_func_start sub_808B980 thumb_func_start sub_808B980
sub_808B980: @ 808B980 sub_808B980: @ 808B980
@ -2164,7 +2164,7 @@ sub_808B980: @ 808B980
lsls r0, 24 lsls r0, 24
lsrs r0, 24 lsrs r0, 24
movs r1, 0x2 movs r1, 0x2
bl player_npc_set_state_and_x22_etc bl PlayerSetAnimId
pop {r4} pop {r4}
pop {r0} pop {r0}
bx r0 bx r0
@ -2179,7 +2179,7 @@ sub_808B9A4: @ 808B9A4
lsls r0, 24 lsls r0, 24
lsrs r0, 24 lsrs r0, 24
movs r1, 0x2 movs r1, 0x2
bl player_npc_set_state_and_x22_etc bl PlayerSetAnimId
pop {r0} pop {r0}
bx r0 bx r0
thumb_func_end sub_808B9A4 thumb_func_end sub_808B9A4
@ -2193,7 +2193,7 @@ sub_808B9BC: @ 808B9BC
lsls r0, 24 lsls r0, 24
lsrs r0, 24 lsrs r0, 24
movs r1, 0x2 movs r1, 0x2
bl player_npc_set_state_and_x22_etc bl PlayerSetAnimId
pop {r0} pop {r0}
bx r0 bx r0
thumb_func_end sub_808B9BC thumb_func_end sub_808B9BC
@ -2207,7 +2207,7 @@ npc_use_some_d2s: @ 808B9D4
lsls r0, 24 lsls r0, 24
lsrs r0, 24 lsrs r0, 24
movs r1, 0x2 movs r1, 0x2
bl player_npc_set_state_and_x22_etc bl PlayerSetAnimId
pop {r0} pop {r0}
bx r0 bx r0
thumb_func_end npc_use_some_d2s thumb_func_end npc_use_some_d2s
@ -2592,9 +2592,9 @@ sub_808BCF4: @ 808BCF4
lsls r0, 24 lsls r0, 24
cmp r0, 0 cmp r0, 0
beq _0808BD2C beq _0808BD2C
bl sub_811A188 bl Bike_HandleBumpySlopeJump
movs r0, 0 movs r0, 0
bl sub_811A114 bl Bike_UpdateBikeCounterSpeed
_0808BD2C: _0808BD2C:
pop {r4} pop {r4}
pop {r0} pop {r0}

View File

@ -7975,7 +7975,7 @@ _080AF120:
sub_80AF128: @ 80AF128 sub_80AF128: @ 80AF128
push {lr} push {lr}
bl ScriptContext2_Enable bl ScriptContext2_Enable
bl sub_8085784 bl Overworld_PlaySpecialMapMusic
bl pal_fill_black bl pal_fill_black
ldr r0, =task0A_nop_for_a_while ldr r0, =task0A_nop_for_a_while
movs r1, 0xA movs r1, 0xA
@ -8006,7 +8006,7 @@ _080AF160:
sub_80AF168: @ 80AF168 sub_80AF168: @ 80AF168
push {lr} push {lr}
bl ScriptContext2_Enable bl ScriptContext2_Enable
bl sub_8085784 bl Overworld_PlaySpecialMapMusic
bl pal_fill_black bl pal_fill_black
ldr r0, =task0A_asap_script_env_2_enable_and_set_ctx_running ldr r0, =task0A_asap_script_env_2_enable_and_set_ctx_running
movs r1, 0xA movs r1, 0xA
@ -8092,7 +8092,7 @@ _080AF20E:
sub_80AF214: @ 80AF214 sub_80AF214: @ 80AF214
push {lr} push {lr}
bl ScriptContext2_Enable bl ScriptContext2_Enable
bl sub_8085784 bl Overworld_PlaySpecialMapMusic
bl palette_bg_faded_fill_black bl palette_bg_faded_fill_black
ldr r0, =task_mpl_807DD60 ldr r0, =task_mpl_807DD60
movs r1, 0xA movs r1, 0xA
@ -8220,7 +8220,7 @@ _080AF30C:
sub_80AF314: @ 80AF314 sub_80AF314: @ 80AF314
push {lr} push {lr}
bl ScriptContext2_Enable bl ScriptContext2_Enable
bl sub_8085784 bl Overworld_PlaySpecialMapMusic
bl palette_bg_faded_fill_black bl palette_bg_faded_fill_black
ldr r0, =sub_80AF234 ldr r0, =sub_80AF234
movs r1, 0xA movs r1, 0xA
@ -8279,7 +8279,7 @@ _080AF37E:
thumb_func_start mapldr_default thumb_func_start mapldr_default
mapldr_default: @ 80AF398 mapldr_default: @ 80AF398
push {lr} push {lr}
bl sub_8085784 bl Overworld_PlaySpecialMapMusic
bl pal_fill_for_maplights bl pal_fill_for_maplights
bl sub_80AF334 bl sub_80AF334
bl ScriptContext2_Enable bl ScriptContext2_Enable
@ -8290,7 +8290,7 @@ mapldr_default: @ 80AF398
thumb_func_start sub_80AF3B0 thumb_func_start sub_80AF3B0
sub_80AF3B0: @ 80AF3B0 sub_80AF3B0: @ 80AF3B0
push {lr} push {lr}
bl sub_8085784 bl Overworld_PlaySpecialMapMusic
bl sub_80AF08C bl sub_80AF08C
bl sub_80AF334 bl sub_80AF334
bl ScriptContext2_Enable bl ScriptContext2_Enable
@ -8304,7 +8304,7 @@ sub_80AF3C8: @ 80AF3C8
bl sub_81D6534 bl sub_81D6534
cmp r0, 0 cmp r0, 0
bne _080AF3D6 bne _080AF3D6
bl sub_8085784 bl Overworld_PlaySpecialMapMusic
_080AF3D6: _080AF3D6:
bl pal_fill_black bl pal_fill_black
bl sub_80AF334 bl sub_80AF334
@ -8316,7 +8316,7 @@ _080AF3D6:
thumb_func_start sub_80AF3E8 thumb_func_start sub_80AF3E8
sub_80AF3E8: @ 80AF3E8 sub_80AF3E8: @ 80AF3E8
push {lr} push {lr}
bl sub_8085784 bl Overworld_PlaySpecialMapMusic
bl pal_fill_for_maplights bl pal_fill_for_maplights
movs r0, 0x2E movs r0, 0x2E
bl PlaySE bl PlaySE
@ -8332,7 +8332,7 @@ sub_80AF3E8: @ 80AF3E8
thumb_func_start sub_80AF40C thumb_func_start sub_80AF40C
sub_80AF40C: @ 80AF40C sub_80AF40C: @ 80AF40C
push {lr} push {lr}
bl sub_8085784 bl Overworld_PlaySpecialMapMusic
bl pal_fill_for_maplights bl pal_fill_for_maplights
movs r0, 0x2E movs r0, 0x2E
bl PlaySE bl PlaySE
@ -8680,7 +8680,7 @@ sub_80AF6D4: @ 80AF6D4
sub_80AF6F0: @ 80AF6F0 sub_80AF6F0: @ 80AF6F0
push {lr} push {lr}
bl ScriptContext2_Enable bl ScriptContext2_Enable
bl sub_8085784 bl Overworld_PlaySpecialMapMusic
bl pal_fill_black bl pal_fill_black
ldr r0, =task_mpl_807E3C8 ldr r0, =task_mpl_807E3C8
movs r1, 0xA movs r1, 0xA

View File

@ -1662,7 +1662,7 @@ _0809E572:
lsls r0, 24 lsls r0, 24
cmp r0, 0 cmp r0, 0
beq _0809E5D2 beq _0809E5D2
bl sub_811A138 bl GetPlayerSpeed
lsls r0, 16 lsls r0, 16
asrs r0, 16 asrs r0, 16
cmp r0, 0x4 cmp r0, 0x4

View File

@ -354,7 +354,7 @@ _080FD320:
bl sav1_map_is_biking_allowed bl sav1_map_is_biking_allowed
cmp r0, 0x1 cmp r0, 0x1
bne _080FD348 bne _080FD348
bl sub_8119FF8 bl IsBikingDisallowedByPlayer
lsls r0, 24 lsls r0, 24
cmp r0, 0 cmp r0, 0
bne _080FD348 bne _080FD348

View File

@ -2212,8 +2212,8 @@ call_ResetMapMusic: @ 8085778
bx r0 bx r0
thumb_func_end call_ResetMapMusic thumb_func_end call_ResetMapMusic
thumb_func_start sub_8085784 thumb_func_start Overworld_PlaySpecialMapMusic
sub_8085784: @ 8085784 Overworld_PlaySpecialMapMusic: @ 8085784
push {r4,lr} push {r4,lr}
bl sav1_map_get_music bl sav1_map_get_music
lsls r0, 16 lsls r0, 16
@ -2261,7 +2261,7 @@ _080857E8:
pop {r0} pop {r0}
bx r0 bx r0
.pool .pool
thumb_func_end sub_8085784 thumb_func_end Overworld_PlaySpecialMapMusic
thumb_func_start Overworld_SetSavedMusic thumb_func_start Overworld_SetSavedMusic
Overworld_SetSavedMusic: @ 80857F4 Overworld_SetSavedMusic: @ 80857F4

View File

@ -4668,7 +4668,7 @@ mapldr_080CA5C0: @ 8137C5C
push {lr} push {lr}
sub sp, 0x4 sub sp, 0x4
bl ScriptContext2_Enable bl ScriptContext2_Enable
bl sub_8085784 bl Overworld_PlaySpecialMapMusic
bl sp109_CreatePCMenu bl sp109_CreatePCMenu
bl sub_80E2514 bl sub_80E2514
movs r0, 0x1 movs r0, 0x1
@ -4733,10 +4733,10 @@ Special_ViewWallClock: @ 8137CC8
thumb_func_start wild_pokemon_reroll thumb_func_start wild_pokemon_reroll
wild_pokemon_reroll: @ 8137CEC wild_pokemon_reroll: @ 8137CEC
ldr r0, =gUnknown_0203AB54 ldr r0, =gBikeCyclingChallenge
movs r1, 0 movs r1, 0
strb r1, [r0] strb r1, [r0]
ldr r0, =gUnknown_0203AB55 ldr r0, =gBikeCollisions
strb r1, [r0] strb r1, [r0]
ldr r1, =gUnknown_0203AB58 ldr r1, =gUnknown_0203AB58
movs r0, 0 movs r0, 0
@ -4747,10 +4747,10 @@ wild_pokemon_reroll: @ 8137CEC
thumb_func_start sub_8137D0C thumb_func_start sub_8137D0C
sub_8137D0C: @ 8137D0C sub_8137D0C: @ 8137D0C
ldr r1, =gUnknown_0203AB54 ldr r1, =gBikeCyclingChallenge
movs r0, 0x1 movs r0, 0x1
strb r0, [r1] strb r0, [r1]
ldr r1, =gUnknown_0203AB55 ldr r1, =gBikeCollisions
movs r0, 0 movs r0, 0
strb r0, [r1] strb r0, [r1]
ldr r1, =gUnknown_0203AB58 ldr r1, =gUnknown_0203AB58
@ -4919,7 +4919,7 @@ sub_8137E6C: @ 8137E6C
ldr r4, [r0, 0x20] ldr r4, [r0, 0x20]
ldr r0, [r1] ldr r0, [r1]
subs r4, r0 subs r4, r0
ldr r5, =gUnknown_0203AB55 ldr r5, =gBikeCollisions
ldrb r1, [r5] ldrb r1, [r5]
adds r0, r4, 0 adds r0, r4, 0
bl sub_8137D5C bl sub_8137D5C

View File

@ -410,7 +410,7 @@ sub_80FBAE4: @ 80FBAE4
adds r0, r4, 0x4 adds r0, r4, 0x4
lsls r0, 24 lsls r0, 24
lsrs r4, r0, 24 lsrs r4, r0, 24
bl sub_811A138 bl GetPlayerSpeed
lsls r0, 16 lsls r0, 16
asrs r0, 16 asrs r0, 16
cmp r0, 0x1 cmp r0, 0x1
@ -433,7 +433,7 @@ _080FBB2A:
adds r0, 0x8 adds r0, 0x8
lsls r0, 24 lsls r0, 24
lsrs r4, r0, 24 lsrs r4, r0, 24
bl sub_811A138 bl GetPlayerSpeed
lsls r0, 16 lsls r0, 16
asrs r0, 16 asrs r0, 16
cmp r0, 0x1 cmp r0, 0x1

View File

@ -5766,7 +5766,7 @@ sub_80C58D4: @ 80C58D4
beq _080C5914 beq _080C5914
cmp r0, 0x2 cmp r0, 0x2
beq _080C591C beq _080C591C
bl sub_8085784 bl Overworld_PlaySpecialMapMusic
b _080C5924 b _080C5924
.pool .pool
_080C5914: _080C5914:

View File

@ -1,58 +0,0 @@
.include "asm/macros.inc"
.include "constants/constants.inc"
.section .rodata
.align 2, 0
gUnknown_0859744C:: @ 859744C
.4byte sub_8119224
.4byte sub_8119238
.4byte sub_8119280
.4byte sub_8119344
.align 2
gUnknown_0859745C:: @ 859745C
.4byte PlayerGoSpeed0
.4byte PlayerGoSpeed1
.4byte PlayerGoSpeed3
.align 2
gUnknown_08597468:: @ 8597468
.4byte sub_81197E4
.4byte sub_81197F4
.4byte sub_8119830
.4byte sub_81198C0
.4byte sub_81198FC
.4byte sub_8119938
.4byte sub_8119974
.4byte sub_81199B0
.4byte sub_8119A24
.4byte sub_8119A94
.4byte sub_8119AA4
.4byte sub_8119B34
.4byte sub_8119BC4
.align 2
gUnknown_0859749C:: @ 859749C
.4byte CheckMovementInputAcroBikeNormal
.4byte CheckMovementInputAcroBikeChangingDirection
.4byte CheckMovementInputAcroBikeStandingWheelie
.4byte CheckMovementInputAcroBikeBunnyHop
.4byte CheckMovementInputAcroBikeMovingWheelie
.4byte CheckMovementInputAcroBikeUnknownMode5
.4byte CheckMovementInputAcroBikeUnknownMode6
.align 2
gUnknown_085974B8:: @ 85974B8
.2byte 0x0001, 0x0002, 0x0004
.align 1
gUnknown_085974BE:: @ 85974BE
.2byte 0x0004
.align 2
gUnknown_085974C0:: @ 85974C0
.4byte 0x00000001, 0x00000002, 0x0000000f, 0x0000000f, gUnknown_085974BE, gUnknown_085974BE, 0x00000001
.4byte 0x00000002, 0x00000002, 0x0000000f, 0x0000000f, gUnknown_085974BE, gUnknown_085974BE, 0x00000002
.4byte 0x00000003, 0x00000002, 0x0000000f, 0x0000000f, gUnknown_085974BE, gUnknown_085974BE, 0x00000003
.4byte 0x00000004, 0x00000002, 0x0000000f, 0x0000000f, gUnknown_085974BE, gUnknown_085974BE, 0x00000004

View File

@ -163,7 +163,7 @@ gSpecials:: @ 81DBA64
def_special sub_8138BC8 def_special sub_8138BC8
def_special sub_8138B8C def_special sub_8138B8C
def_special sub_814FC9C def_special sub_814FC9C
def_special sub_8085784 def_special Overworld_PlaySpecialMapMusic
def_special StartWallClock def_special StartWallClock
def_special Special_ViewWallClock def_special Special_ViewWallClock
def_special ChooseStarter def_special ChooseStarter

78
include/bike.h Normal file
View File

@ -0,0 +1,78 @@
#ifndef GUARD_BIKE_H
#define GUARD_BIKE_H
// the struct below is used for checking button combinations of the last input so that the acro can potentially perform a side/turn jump.
// its possible that at some point Game Freak intended for the acro bike to have more complex tricks: but only the acro jump combinations can be seen in the final ROM.
struct BikeHistoryInputInfo
{
u32 dirHistoryMatch; // the direction you need to press
u32 abStartSelectHistoryMatch; // the button you need to press
u32 dirHistoryMask; // mask applied so that way only the recent nybble (the recent input) is checked
u32 abStartSelectHistoryMask; // mask applied so that way only the recent nybble (the recent input) is checked
const u8 *dirTimerHistoryList; // list of timers to check for direction before the button+dir combination can be verified.
const u8 *abStartSelectHistoryList; // list of timers to check for buttons before the button+dir combination can be verified.
u32 direction; // direction to jump
};
// Player speeds
enum
{
SPEED_STANDING,
SPEED_NORMAL,
SPEED_FAST,
SPEED_FASTER,
SPEED_FASTEST,
};
// mach bike transitions enum
enum
{
MACH_TRANS_FACE_DIRECTION,
MACH_TRANS_TURN_DIRECTION,
MACH_TRANS_KEEP_MOVING,
MACH_TRANS_START_MOVING
};
// Acro bike states
enum
{
ACRO_STATE_NORMAL,
ACRO_STATE_TURNING,
ACRO_STATE_WHEELIE_STANDING,
ACRO_STATE_BUNNY_HOP,
ACRO_STATE_WHEELIE_MOVING,
ACRO_STATE_SIDE_JUMP,
ACRO_STATE_TURN_JUMP,
};
// Acro bike transitions
enum
{
ACRO_TRANS_FACE_DIRECTION,
ACRO_TRANS_TURN_DIRECTION,
ACRO_TRANS_MOVING,
ACRO_TRANS_NORMAL_TO_WHEELIE,
ACRO_TRANS_WHEELIE_TO_NORMAL,
ACRO_TRANS_WHEELIE_IDLE,
ACRO_TRANS_WHEELIE_HOPPING_STANDING,
ACRO_TRANS_WHEELIE_HOPPING_MOVING,
ACRO_TRANS_SIDE_JUMP,
ACRO_TRANS_TURN_JUMP,
ACRO_TRANS_WHEELIE_MOVING,
ACRO_TRANS_WHEELIE_RISING_MOVING,
ACRO_TRANS_WHEELIE_LOWERING_MOVING,
};
void MovePlayerOnBike(u8 direction, u16 newKeys, u16 heldKeys);
void Bike_TryAcroBikeHistoryUpdate(u16 newKeys, u16 heldKeys);
bool8 RS_IsRunningDisallowed(u8 tile);
bool8 IsBikingDisallowedByPlayer(void);
bool8 player_should_look_direction_be_enforced_upon_movement(void);
void GetOnOffBike(u8 transitionFlags);
void BikeClearState(int newDirHistory, int newAbStartHistory);
void Bike_UpdateBikeCounterSpeed(u8 counter);
s16 GetPlayerSpeed(void);
void Bike_HandleBumpySlopeJump(void);
bool32 IsRunningDisallowed(u8 metatile);
#endif // GUARD_BIKE_H

View File

@ -9,6 +9,27 @@ void PlayerGetDestCoords(s16 *, s16 *);
u8 player_get_direction_lower_nybble(void); u8 player_get_direction_lower_nybble(void);
u8 player_get_direction_upper_nybble(void); u8 player_get_direction_upper_nybble(void);
u8 player_get_x22(void); u8 player_get_x22(void);
void PlayerGoSpeed1(u8);
void PlayerGoSpeed2(u8);
void PlayerGoSpeed3(u8);
void PlayerGoSpeed4(u8);
void PlayerOnBikeCollide(u8);
void PlayerFaceDirection(u8 a);
void PlayerTurnInPlace(u8 a);
void PlayerJumpLedge(u8 a);
void PlayerIdleWheelie(u8 a);
void PlayerStartWheelie(u8 a);
void PlayerEndWheelie(u8 a);
void PlayerStandingHoppingWheelie(u8 a);
void PlayerMovingHoppingWheelie(u8 a);
void PlayerLedgeHoppingWheelie(u8 a);
void PlayerAcroTurnJump(u8 a);
void PlayerSetAnimId(u8 a, u8 b);
bool8 IsPlayerCollidingWithFarawayIslandMew(u8 direction);
void PlayerOnBikeCollideWithFarawayIslandMew(u8 direction);
u8 CheckForFieldObjectCollision(struct MapObject *a, s16 b, s16 c, u8 d, u8 e);
u8 PlayerGetZCoord(void);
void SetPlayerAvatarTransitionFlags(u16 a);
void sub_808D074(u8); void sub_808D074(u8);
void GetXYCoordsOneStepInFrontOfPlayer(s16 *xPtr, s16 *yPtr); void GetXYCoordsOneStepInFrontOfPlayer(s16 *xPtr, s16 *yPtr);

View File

@ -299,25 +299,42 @@ enum
COLLISION_LEDGE_JUMP = 6 COLLISION_LEDGE_JUMP = 6
}; };
struct PlayerAvatar /* 0x202E858 */ // player running states
enum
{
NOT_MOVING,
TURN_DIRECTION, // not the same as turning! turns your avatar without moving. also known as a turn frame in some circles
MOVING,
};
// player tile transition states
enum
{
T_NOT_MOVING,
T_TILE_TRANSITION,
T_TILE_CENTER, // player is on a frame in which they are centered on a tile during which the player either stops or keeps their momentum and keeps going, changing direction if necessary.
};
struct PlayerAvatar
{ {
/*0x00*/ u8 flags; /*0x00*/ u8 flags;
/*0x01*/ u8 bike; /*0x01*/ u8 unk1; // used to be named bike, but its definitely not that. seems to be some transition flags
/*0x02*/ u8 running2; /*0x02*/ u8 runningState; // this is a static running state. 00 is not moving, 01 is turn direction, 02 is moving.
/*0x03*/ u8 running1; /*0x03*/ u8 tileTransitionState; // this is a transition running state: 00 is not moving, 01 is transition between tiles, 02 means you are on the frame in which you have centered on a tile but are about to keep moving, even if changing directions. 2 is also used for a ledge hop, since you are transitioning.
/*0x04*/ u8 spriteId; /*0x04*/ u8 spriteId;
/*0x05*/ u8 mapObjectId; /*0x05*/ u8 mapObjectId;
/*0x06*/ u8 unk6; /*0x06*/ bool8 preventStep;
/*0x07*/ u8 gender; /*0x07*/ u8 gender;
u8 acroBikeState; /*0x08*/ u8 acroBikeState; // 00 is normal, 01 is turning, 02 is standing wheelie, 03 is hopping wheelie
u8 unk9; /*0x09*/ u8 newDirBackup; // during bike movement, the new direction as opposed to player's direction is backed up here.
u8 bikeFrameCounter; /*0x0A*/ u8 bikeFrameCounter; // on the mach bike, when this value is 1, the bike is moving but not accelerating yet for 1 tile. on the acro bike, this acts as a timer for acro bike.
u8 unkB; /*0x0B*/ u8 bikeSpeed;
u32 unkC; // acro bike only
u32 unk10; /*0x0C*/ u32 directionHistory; // up/down/left/right history is stored in each nybble, but using the field directions and not the io inputs.
u8 unk14[8]; /*0x10*/ u32 abStartSelectHistory; // same as above but for A + B + start + select only
u8 unk1C[8]; // these two are timer history arrays which [0] is the active timer for acro bike. every element is backed up to the next element upon update.
// TODO: rest of struct /*0x14*/ u8 dirTimerHistory[8];
/*0x1C*/ u8 abStartSelectTimerHistory[8];
}; };
struct Camera struct Camera

View File

@ -162,7 +162,7 @@ SECTIONS {
asm/contest_link_80FC4F4.o(.text); asm/contest_link_80FC4F4.o(.text);
asm/item_use.o(.text); asm/item_use.o(.text);
asm/battle_anim_80FE840.o(.text); asm/battle_anim_80FE840.o(.text);
asm/bike.o(.text); src/bike.o(.text);
asm/easy_chat.o(.text); asm/easy_chat.o(.text);
asm/mon_markings.o(.text); asm/mon_markings.o(.text);
asm/mauville_old_man.o(.text); asm/mauville_old_man.o(.text);
@ -409,7 +409,7 @@ SECTIONS {
data/rotating_gate.o(.rodata); data/rotating_gate.o(.rodata);
data/item_use.o(.rodata); data/item_use.o(.rodata);
data/battle_anim_80FE840.o(.rodata); data/battle_anim_80FE840.o(.rodata);
data/bike.o(.rodata); src/bike.o(.rodata);
data/easy_chat.o(.rodata); data/easy_chat.o(.rodata);
data/mon_markings.o(.rodata); data/mon_markings.o(.rodata);
data/mauville_old_man.o(.rodata); data/mauville_old_man.o(.rodata);

1078
src/bike.c Normal file

File diff suppressed because it is too large Load Diff

View File

@ -86,7 +86,7 @@ extern void sub_806A068(u16, u8);
extern void sub_807F19C(void); extern void sub_807F19C(void);
extern void sub_807B140(void); extern void sub_807B140(void);
extern void EvolutionRenameMon(struct Pokemon *mon, u16 oldSpecies, u16 newSpecies); extern void EvolutionRenameMon(struct Pokemon *mon, u16 oldSpecies, u16 newSpecies);
extern void sub_8085784(void); extern void Overworld_PlaySpecialMapMusic(void);
extern void sub_81BFA38(struct Pokemon *party, u8 monId, u8 partyCount, void *CB2_ptr, u16 move); extern void sub_81BFA38(struct Pokemon *party, u8 monId, u8 partyCount, void *CB2_ptr, u16 move);
extern u8 sub_81C1B94(void); extern u8 sub_81C1B94(void);
extern void sub_807F1A8(u8 arg0, const u8 *arg1, u8 arg2); extern void sub_807F1A8(u8 arg0, const u8 *arg1, u8 arg2);
@ -698,7 +698,7 @@ static void Task_EvolutionScene(u8 taskID)
if (!(gTasks[taskID].tBits & TASK_BIT_LEARN_MOVE)) if (!(gTasks[taskID].tBits & TASK_BIT_LEARN_MOVE))
{ {
StopMapMusic(); StopMapMusic();
sub_8085784(); Overworld_PlaySpecialMapMusic();
} }
gTasks[taskID].tBits |= TASK_BIT_LEARN_MOVE; gTasks[taskID].tBits |= TASK_BIT_LEARN_MOVE;
@ -727,7 +727,7 @@ static void Task_EvolutionScene(u8 taskID)
if (!(gTasks[taskID].tBits & TASK_BIT_LEARN_MOVE)) if (!(gTasks[taskID].tBits & TASK_BIT_LEARN_MOVE))
{ {
StopMapMusic(); StopMapMusic();
sub_8085784(); Overworld_PlaySpecialMapMusic();
} }
if (!gTasks[taskID].tEvoWasStopped) if (!gTasks[taskID].tEvoWasStopped)
CreateShedinja(gTasks[taskID].tPreEvoSpecies, mon); CreateShedinja(gTasks[taskID].tPreEvoSpecies, mon);

View File

@ -1130,10 +1130,10 @@ gUnknown_0203AB4E: @ 203AB4E
gUnknown_0203AB50: @ 203AB50 gUnknown_0203AB50: @ 203AB50
.space 0x4 .space 0x4
gUnknown_0203AB54: @ 203AB54 gBikeCyclingChallenge: @ 203AB54
.space 0x1 .space 0x1
gUnknown_0203AB55: @ 203AB55 gBikeCollisions: @ 203AB55
.space 0x3 .space 0x3
gUnknown_0203AB58: @ 203AB58 gUnknown_0203AB58: @ 203AB58