Identify some more map object labels and constants

This commit is contained in:
Rangi 2020-10-22 17:41:48 -04:00
parent 15f6a0af43
commit d8310c166d
7 changed files with 199 additions and 184 deletions

View File

@ -142,8 +142,8 @@ MAPOBJECT_SCREEN_HEIGHT EQU (SCREEN_HEIGHT / 2) + 2
const SPRITEMOVEDATA_STANDING_RIGHT ; 09 const SPRITEMOVEDATA_STANDING_RIGHT ; 09
const SPRITEMOVEDATA_SPINRANDOM_FAST ; 0a const SPRITEMOVEDATA_SPINRANDOM_FAST ; 0a
const SPRITEMOVEDATA_PLAYER ; 0b const SPRITEMOVEDATA_PLAYER ; 0b
const SPRITEMOVEDATA_0C ; 0c const SPRITEMOVEDATA_INDEXED_1 ; 0c
const SPRITEMOVEDATA_0D ; 0d const SPRITEMOVEDATA_INDEXED_2 ; 0d
const SPRITEMOVEDATA_0E ; 0e const SPRITEMOVEDATA_0E ; 0e
const SPRITEMOVEDATA_0F ; 0f const SPRITEMOVEDATA_0F ; 0f
const SPRITEMOVEDATA_10 ; 10 const SPRITEMOVEDATA_10 ; 10
@ -179,8 +179,8 @@ NUM_SPRITEMOVEDATA EQU const_value
const SPRITEMOVEFN_FAST_RANDOM_SPIN ; 05 const SPRITEMOVEFN_FAST_RANDOM_SPIN ; 05
const SPRITEMOVEFN_STANDING ; 06 const SPRITEMOVEFN_STANDING ; 06
const SPRITEMOVEFN_OBEY_DPAD ; 07 const SPRITEMOVEFN_OBEY_DPAD ; 07
const SPRITEMOVEFN_08 ; 08 const SPRITEMOVEFN_INDEXED_1 ; 08
const SPRITEMOVEFN_09 ; 09 const SPRITEMOVEFN_INDEXED_2 ; 09
const SPRITEMOVEFN_0A ; 0a const SPRITEMOVEFN_0A ; 0a
const SPRITEMOVEFN_0B ; 0b const SPRITEMOVEFN_0B ; 0b
const SPRITEMOVEFN_0C ; 0c const SPRITEMOVEFN_0C ; 0c
@ -202,31 +202,31 @@ NUM_SPRITEMOVEDATA EQU const_value
; StepTypesJumptable indexes (see engine/overworld/map_objects.asm) ; StepTypesJumptable indexes (see engine/overworld/map_objects.asm)
const_def const_def
const STEP_TYPE_00 ; 00 const STEP_TYPE_RESET ; 00
const STEP_TYPE_SLEEP ; 01 const STEP_TYPE_FROM_MOVEMENT ; 01
const STEP_TYPE_NPC_WALK ; 02 const STEP_TYPE_NPC_WALK ; 02
const STEP_TYPE_03 ; 03 const STEP_TYPE_SLEEP ; 03
const STEP_TYPE_04 ; 04 const STEP_TYPE_STANDING ; 04
const STEP_TYPE_05 ; 05 const STEP_TYPE_RESTORE ; 05
const STEP_TYPE_PLAYER_WALK ; 06 const STEP_TYPE_PLAYER_WALK ; 06
const STEP_TYPE_07 ; 07 const STEP_TYPE_CONTINUE_WALK ; 07
const STEP_TYPE_NPC_JUMP ; 08 const STEP_TYPE_NPC_JUMP ; 08
const STEP_TYPE_PLAYER_JUMP ; 09 const STEP_TYPE_PLAYER_JUMP ; 09
const STEP_TYPE_HALF_STEP ; 0a const STEP_TYPE_TURN ; 0a
const STEP_TYPE_BUMP ; 0b const STEP_TYPE_BUMP ; 0b
const STEP_TYPE_TELEPORT_FROM ; 0c const STEP_TYPE_TELEPORT_FROM ; 0c
const STEP_TYPE_TELEPORT_TO ; 0d const STEP_TYPE_TELEPORT_TO ; 0d
const STEP_TYPE_SKYFALL ; 0e const STEP_TYPE_SKYFALL ; 0e
const STEP_TYPE_0F ; 0f const STEP_TYPE_STRENGTH_BOULDER ; 0f
const STEP_TYPE_GOT_BITE ; 10 const STEP_TYPE_GOT_BITE ; 10
const STEP_TYPE_ROCK_SMASH ; 11 const STEP_TYPE_ROCK_SMASH ; 11
const STEP_TYPE_RETURN_DIG ; 12 const STEP_TYPE_RETURN_DIG ; 12
const STEP_TYPE_TRACKING_OBJECT ; 13 const STEP_TYPE_TRACKING_OBJECT ; 13
const STEP_TYPE_14 ; 14 const STEP_TYPE_14 ; 14
const STEP_TYPE_15 ; 15 const STEP_TYPE_SCREENSHAKE ; 15
const STEP_TYPE_16 ; 16 const STEP_TYPE_16 ; 16
const STEP_TYPE_17 ; 17 const STEP_TYPE_17 ; 17
const STEP_TYPE_18 ; 18 const STEP_TYPE_DELETE ; 18
const STEP_TYPE_SKYFALL_TOP ; 19 const STEP_TYPE_SKYFALL_TOP ; 19
; ObjectActionPairPointers indexes (see engine/overworld/map_object_action.asm) ; ObjectActionPairPointers indexes (see engine/overworld/map_object_action.asm)

View File

@ -97,16 +97,16 @@ SpriteMovementData::
db 0 ; flags2 db 0 ; flags2
db 0 ; palette flags db 0 ; palette flags
; SPRITEMOVEDATA_0C ; SPRITEMOVEDATA_INDEXED_1
db SPRITEMOVEFN_08 ; movement function db SPRITEMOVEFN_INDEXED_1 ; movement function
db DOWN ; facing db DOWN ; facing
db OBJECT_ACTION_STAND ; action db OBJECT_ACTION_STAND ; action
db 0 ; flags1 db 0 ; flags1
db 0 ; flags2 db 0 ; flags2
db 0 ; palette flags db 0 ; palette flags
; SPRITEMOVEDATA_0D ; SPRITEMOVEDATA_INDEXED_2
db SPRITEMOVEFN_09 ; movement function db SPRITEMOVEFN_INDEXED_2 ; movement function
db DOWN ; facing db DOWN ; facing
db OBJECT_ACTION_STAND ; action db OBJECT_ACTION_STAND ; action
db 0 ; flags1 db 0 ; flags1

View File

@ -1,5 +1,6 @@
ObjectActionPairPointers: ObjectActionPairPointers:
; entries correspond to OBJECT_ACTION_* constants ; entries correspond to OBJECT_ACTION_* constants
; normal action, frozen action
dw SetFacingStanding, SetFacingStanding dw SetFacingStanding, SetFacingStanding
dw SetFacingStandAction, SetFacingCurrent dw SetFacingStandAction, SetFacingCurrent
dw SetFacingStepAction, SetFacingCurrent dw SetFacingStepAction, SetFacingCurrent
@ -163,7 +164,7 @@ CounterclockwiseSpinAction:
swap e swap e
ld d, 0 ld d, 0
ld hl, .Directions ld hl, .facings
add hl, de add hl, de
ld a, [hl] ld a, [hl]
ld hl, OBJECT_FACING ld hl, OBJECT_FACING
@ -171,8 +172,11 @@ CounterclockwiseSpinAction:
ld [hl], a ld [hl], a
ret ret
.Directions: .facings:
db OW_DOWN, OW_RIGHT, OW_UP, OW_LEFT db OW_DOWN
db OW_RIGHT
db OW_UP
db OW_LEFT
SetFacingFish: SetFacingFish:
call GetSpriteDirection call GetSpriteDirection

View File

@ -27,13 +27,13 @@ DeleteMapObject::
ret ret
HandleObjectStep: HandleObjectStep:
call .CheckObjectStillVisible call CheckObjectStillVisible
ret c ret c
call .HandleStepType call HandleStepType
call .HandleObjectAction call HandleObjectAction
ret ret
.CheckObjectStillVisible: CheckObjectStillVisible:
ld hl, OBJECT_FLAGS2 ld hl, OBJECT_FLAGS2
add hl, bc add hl, bc
res OBJ_FLAGS2_6, [hl] res OBJ_FLAGS2_6, [hl]
@ -103,7 +103,7 @@ HandleObjectStep:
and a and a
ret ret
.HandleStepType: HandleStepType:
ld hl, OBJECT_STEP_TYPE ld hl, OBJECT_STEP_TYPE
add hl, bc add hl, bc
ld a, [hl] ld a, [hl]
@ -113,24 +113,24 @@ HandleObjectStep:
add hl, bc add hl, bc
bit OBJ_FLAGS2_5, [hl] bit OBJ_FLAGS2_5, [hl]
jr nz, .bit5 jr nz, .bit5
cp STEP_TYPE_SLEEP cp STEP_TYPE_FROM_MOVEMENT
jr z, .one jr z, .one
jr .ok3 jr .ok3
.zero .zero
call ObjectMovementReset call StepFunction_Reset
ld hl, OBJECT_FLAGS2 ld hl, OBJECT_FLAGS2
add hl, bc add hl, bc
bit OBJ_FLAGS2_5, [hl] bit OBJ_FLAGS2_5, [hl]
jr nz, .bit5 jr nz, .bit5
.one .one
call MapObjectMovementPattern call StepFunction_FromMovement
ld hl, OBJECT_STEP_TYPE ld hl, OBJECT_STEP_TYPE
add hl, bc add hl, bc
ld a, [hl] ld a, [hl]
and a and a
ret z ret z
cp STEP_TYPE_SLEEP cp STEP_TYPE_FROM_MOVEMENT
ret z ret z
.ok3 .ok3
ld hl, StepTypesJumptable ld hl, StepTypesJumptable
@ -140,7 +140,7 @@ HandleObjectStep:
.bit5 .bit5
ret ret
.HandleObjectAction: HandleObjectAction:
ld hl, OBJECT_FLAGS1 ld hl, OBJECT_FLAGS1
add hl, bc add hl, bc
bit INVISIBLE_F, [hl] bit INVISIBLE_F, [hl]
@ -150,21 +150,21 @@ HandleObjectStep:
bit OBJ_FLAGS2_6, [hl] bit OBJ_FLAGS2_6, [hl]
jr nz, SetFacingStanding jr nz, SetFacingStanding
bit OBJ_FLAGS2_5, [hl] bit OBJ_FLAGS2_5, [hl]
jr nz, _UseSecondObjectAction jr nz, _CallFrozenObjectAction
ld de, ObjectActionPairPointers ; use first column ; use first column (normal)
jr _HandleObjectAction ld de, ObjectActionPairPointers
jr CallObjectAction
Function4440: HandleFrozenObjectAction:
ld hl, OBJECT_FLAGS1 ld hl, OBJECT_FLAGS1
add hl, bc add hl, bc
bit INVISIBLE_F, [hl] bit INVISIBLE_F, [hl]
jr nz, SetFacingStanding jr nz, SetFacingStanding
_UseSecondObjectAction: _CallFrozenObjectAction:
ld de, ObjectActionPairPointers + 2 ; use second column ld de, ObjectActionPairPointers + 2
jr _HandleObjectAction jr CallObjectAction ; pointless
_HandleObjectAction: CallObjectAction:
; call [4 * wObjectStructs[ObjInd, OBJECT_ACTION] + de]
ld hl, OBJECT_ACTION ld hl, OBJECT_ACTION
add hl, bc add hl, bc
ld a, [hl] ld a, [hl]
@ -207,7 +207,7 @@ CopyNextCoordsTileToStandingCoordsTile:
call UselessAndA call UselessAndA
ret ret
Function462a: CopyStandingCoordsTileToNextCoordsTile:
ld hl, OBJECT_MAP_X ld hl, OBJECT_MAP_X
add hl, bc add hl, bc
ld a, [hl] ld a, [hl]
@ -272,8 +272,8 @@ EndSpriteMovement:
ld hl, OBJECT_MOVEMENT_BYTE_INDEX ld hl, OBJECT_MOVEMENT_BYTE_INDEX
add hl, bc add hl, bc
ld [hli], a ld [hli], a
ld [hli], a ld [hli], a ; OBJECT_1C
ld [hli], a ld [hli], a ; OBJECT_1D
ld [hl], a ; OBJECT_1E ld [hl], a ; OBJECT_1E
ld hl, OBJECT_DIRECTION_WALKING ld hl, OBJECT_DIRECTION_WALKING
add hl, bc add hl, bc
@ -294,6 +294,8 @@ InitStep:
ld hl, OBJECT_FACING ld hl, OBJECT_FACING
add hl, bc add hl, bc
ld [hl], a ld [hl], a
; fallthrough
GetNextTile: GetNextTile:
call GetStepVector call GetStepVector
ld hl, OBJECT_STEP_DURATION ld hl, OBJECT_STEP_DURATION
@ -379,11 +381,11 @@ StepVectors:
GetStepVectorSign: GetStepVectorSign:
add a add a
ret z ; 0 or 128 ret z ; 0 or 128 (-128)
ld a, 1 ld a, 1
ret nc ; 1 - 127 ret nc ; +1 to +127
ld a, -1 ld a, -1
ret ; 129 - 255 ret ; -127 to -1
UpdatePlayerStep: UpdatePlayerStep:
ld hl, OBJECT_DIRECTION_WALKING ld hl, OBJECT_DIRECTION_WALKING
@ -402,7 +404,7 @@ UpdatePlayerStep:
set PLAYERSTEP_CONTINUE_F, [hl] set PLAYERSTEP_CONTINUE_F, [hl]
ret ret
Function4759: ; unreferenced GetMapObjectField: ; unreferenced
push bc push bc
ld e, a ld e, a
ld d, 0 ld d, 0
@ -491,7 +493,7 @@ Field1c_SetAnonJumptableIndex: ; unreferenced
ld [hl], a ld [hl], a
ret ret
ObjectMovementReset: StepFunction_Reset:
ld hl, OBJECT_NEXT_MAP_X ld hl, OBJECT_NEXT_MAP_X
add hl, bc add hl, bc
ld d, [hl] ld d, [hl]
@ -508,10 +510,10 @@ ObjectMovementReset:
call EndSpriteMovement call EndSpriteMovement
ld hl, OBJECT_STEP_TYPE ld hl, OBJECT_STEP_TYPE
add hl, bc add hl, bc
ld [hl], STEP_TYPE_SLEEP ld [hl], STEP_TYPE_FROM_MOVEMENT
ret ret
MapObjectMovementPattern: StepFunction_FromMovement:
call Field1c_ZeroAnonJumptableIndex call Field1c_ZeroAnonJumptableIndex
call GetSpriteMovementFunction call GetSpriteMovementFunction
ld a, [hl] ld a, [hl]
@ -529,8 +531,8 @@ MapObjectMovementPattern:
dw MovementFunction_RandomSpinFast ; 05 dw MovementFunction_RandomSpinFast ; 05
dw MovementFunction_Standing ; 06 dw MovementFunction_Standing ; 06
dw MovementFunction_ObeyDPad ; 07 dw MovementFunction_ObeyDPad ; 07
dw MovementFunction_08 ; 08 dw MovementFunction_Indexed1 ; 08
dw MovementFunction_09 ; 09 dw MovementFunction_Indexed2 ; 09
dw MovementFunction_0a ; 0a dw MovementFunction_0a ; 0a
dw MovementFunction_0b ; 0b dw MovementFunction_0b ; 0b
dw MovementFunction_0c ; 0c dw MovementFunction_0c ; 0c
@ -598,26 +600,26 @@ MovementFunction_RandomSpinFast:
jp RandomStepDuration_Fast jp RandomStepDuration_Fast
MovementFunction_Standing: MovementFunction_Standing:
call Function462a call CopyStandingCoordsTileToNextCoordsTile
call EndSpriteMovement call EndSpriteMovement
ld hl, OBJECT_ACTION ld hl, OBJECT_ACTION
add hl, bc add hl, bc
ld [hl], OBJECT_ACTION_STAND ld [hl], OBJECT_ACTION_STAND
ld hl, OBJECT_STEP_TYPE ld hl, OBJECT_STEP_TYPE
add hl, bc add hl, bc
ld [hl], STEP_TYPE_05 ld [hl], STEP_TYPE_RESTORE
ret ret
MovementFunction_ObeyDPad: MovementFunction_ObeyDPad:
ld hl, ApplyPlayerMovementByte ld hl, GetPlayerNextMovementByte
jp HandleMovementData jp HandleMovementData
MovementFunction_08: MovementFunction_Indexed1:
ld hl, Function5015 ld hl, GetIndexedMovementByte1
jp HandleMovementData jp HandleMovementData
MovementFunction_09: MovementFunction_Indexed2:
ld hl, Function5026 ld hl, GetIndexedMovementByte2
jp HandleMovementData jp HandleMovementData
MovementFunction_0a: MovementFunction_0a:
@ -630,7 +632,7 @@ MovementFunction_0c:
jp _GetMovementObject jp _GetMovementObject
MovementFunction_0d: MovementFunction_0d:
ld hl, ApplyPlayerMovementByte ld hl, GetPlayerNextMovementByte
jp HandleMovementData jp HandleMovementData
MovementFunction_0e: MovementFunction_0e:
@ -675,11 +677,11 @@ MovementFunction_Strength:
call UpdateTallGrassFlags call UpdateTallGrassFlags
ld hl, OBJECT_STEP_TYPE ld hl, OBJECT_STEP_TYPE
add hl, bc add hl, bc
ld [hl], STEP_TYPE_0F ld [hl], STEP_TYPE_STRENGTH_BOULDER
ret ret
.ok2 .ok2
call Function462a call CopyStandingCoordsTileToNextCoordsTile
.ok .ok
ld hl, OBJECT_DIRECTION_WALKING ld hl, OBJECT_DIRECTION_WALKING
add hl, bc add hl, bc
@ -766,7 +768,7 @@ MovementFunction_BigStanding:
ld [hl], OBJECT_ACTION_BIG_DOLL_SYM ld [hl], OBJECT_ACTION_BIG_DOLL_SYM
ld hl, OBJECT_STEP_TYPE ld hl, OBJECT_STEP_TYPE
add hl, bc add hl, bc
ld [hl], STEP_TYPE_04 ld [hl], STEP_TYPE_STANDING
ret ret
MovementFunction_Bouncing: MovementFunction_Bouncing:
@ -779,7 +781,7 @@ MovementFunction_Bouncing:
ld [hl], OBJECT_ACTION_BOUNCE ld [hl], OBJECT_ACTION_BOUNCE
ld hl, OBJECT_STEP_TYPE ld hl, OBJECT_STEP_TYPE
add hl, bc add hl, bc
ld [hl], STEP_TYPE_04 ld [hl], STEP_TYPE_STANDING
ret ret
MovementFunction_SpinCounterclockwise: MovementFunction_SpinCounterclockwise:
@ -799,6 +801,8 @@ MovementFunction_SpinClockwise:
_MovementSpinInit: _MovementSpinInit:
call EndSpriteMovement call EndSpriteMovement
call ObjectMovementByte_IncAnonJumptableIndex call ObjectMovementByte_IncAnonJumptableIndex
; fallthrough
_MovementSpinRepeat: _MovementSpinRepeat:
ld hl, OBJECT_ACTION ld hl, OBJECT_ACTION
add hl, bc add hl, bc
@ -812,7 +816,7 @@ _MovementSpinRepeat:
ld [hl], a ld [hl], a
ld hl, OBJECT_STEP_TYPE ld hl, OBJECT_STEP_TYPE
add hl, bc add hl, bc
ld [hl], STEP_TYPE_03 ld [hl], STEP_TYPE_SLEEP
call ObjectMovementByte_IncAnonJumptableIndex call ObjectMovementByte_IncAnonJumptableIndex
ret ret
@ -1006,7 +1010,7 @@ MovementFunction_ScreenShake:
ld [hl], a ld [hl], a
ld hl, OBJECT_STEP_TYPE ld hl, OBJECT_STEP_TYPE
add hl, bc add hl, bc
ld [hl], STEP_TYPE_15 ld [hl], STEP_TYPE_SCREENSHAKE
ret ret
.GetDurationAndField1e: .GetDurationAndField1e:
@ -1028,7 +1032,7 @@ MovementFunction_ScreenShake:
_RandomWalkContinue: _RandomWalkContinue:
call InitStep call InitStep
call CanObjectMoveInDirection ; check whether the object can move in that direction call CanObjectMoveInDirection
jr c, .new_duration jr c, .new_duration
call UpdateTallGrassFlags call UpdateTallGrassFlags
ld hl, OBJECT_ACTION ld hl, OBJECT_ACTION
@ -1040,7 +1044,7 @@ _RandomWalkContinue:
jr z, .centered jr z, .centered
ld hl, OBJECT_STEP_TYPE ld hl, OBJECT_STEP_TYPE
add hl, bc add hl, bc
ld [hl], STEP_TYPE_07 ld [hl], STEP_TYPE_CONTINUE_WALK
ret ret
.centered .centered
@ -1051,20 +1055,20 @@ _RandomWalkContinue:
.new_duration: .new_duration:
call EndSpriteMovement call EndSpriteMovement
call Function462a call CopyStandingCoordsTileToNextCoordsTile
; fallthrough ; fallthrough
RandomStepDuration_Slow: RandomStepDuration_Slow:
call Random call Random
ldh a, [hRandomAdd] ldh a, [hRandomAdd]
and %01111111 and %01111111
jr SetRandomStepDuration jr _SetRandomStepDuration
RandomStepDuration_Fast: RandomStepDuration_Fast:
call Random call Random
ldh a, [hRandomAdd] ldh a, [hRandomAdd]
and %00011111 and %00011111
SetRandomStepDuration: _SetRandomStepDuration:
ld hl, OBJECT_STEP_DURATION ld hl, OBJECT_STEP_DURATION
add hl, bc add hl, bc
ld [hl], a ld [hl], a
@ -1076,37 +1080,37 @@ SetRandomStepDuration:
ld [hl], OBJECT_ACTION_STAND ld [hl], OBJECT_ACTION_STAND
ld hl, OBJECT_STEP_TYPE ld hl, OBJECT_STEP_TYPE
add hl, bc add hl, bc
ld [hl], STEP_TYPE_03 ld [hl], STEP_TYPE_SLEEP
ret ret
StepTypesJumptable: StepTypesJumptable:
; entries correspond to STEP_TYPE_* constants ; entries correspond to STEP_TYPE_* constants
dw ObjectMovementReset ; 00 dw StepFunction_Reset ; 00
dw MapObjectMovementPattern ; 01 dw StepFunction_FromMovement ; 01
dw NPCStep ; 02 dw StepFunction_NPCWalk ; 02
dw StepType03 ; 03 dw StepFunction_Sleep ; 03
dw StepType04 ; 04 dw StepFunction_Standing ; 04
dw StepType05 ; 05 dw StepFunction_Restore ; 05
dw PlayerStep ; 06 dw StepFunction_PlayerWalk ; 06
dw StepType07 ; 07 dw StepFunction_ContinueWalk ; 07
dw NPCJump ; 08 dw StepFunction_NPCJump ; 08
dw PlayerJump ; 09 dw StepFunction_PlayerJump ; 09
dw PlayerOrNPCTurnStep ; 0a dw StepFunction_Turn ; 0a
dw StepTypeBump ; 0b dw StepFunction_Bump ; 0b
dw TeleportFrom ; 0c dw StepFunction_TeleportFrom ; 0c
dw TeleportTo ; 0d dw StepFunction_TeleportTo ; 0d
dw Skyfall ; 0e dw StepFunction_Skyfall ; 0e
dw StepType0f ; 0f dw StepFunction_StrengthBoulder ; 0f
dw GotBiteStep ; 10 dw StepFunction_GotBite ; 10
dw RockSmashStep ; 11 dw StepFunction_RockSmash ; 11
dw ReturnDigStep ; 12 dw StepFunction_DigTo ; 12
dw StepTypeTrackingObject ; 13 dw StepFunction_TrackingObject ; 13
dw StepType14 ; 14 dw StepFunction_14 ; 14
dw StepType15 ; 15 dw StepFunction_ScreenShake ; 15
dw StepType16 ; 16 dw StepFunction_16 ; 16
dw StepType17 ; 17 dw StepFunction_17 ; 17
dw StepType18 ; 18 dw StepFunction_Delete ; 18
dw SkyfallTop ; 19 dw StepFunction_SkyfallTop ; 19
WaitStep_InPlace: WaitStep_InPlace:
ld hl, OBJECT_STEP_DURATION ld hl, OBJECT_STEP_DURATION
@ -1115,10 +1119,10 @@ WaitStep_InPlace:
ret nz ret nz
ld hl, OBJECT_STEP_TYPE ld hl, OBJECT_STEP_TYPE
add hl, bc add hl, bc
ld [hl], STEP_TYPE_SLEEP ld [hl], STEP_TYPE_FROM_MOVEMENT
ret ret
NPCJump: StepFunction_NPCJump:
call Field1c_AnonJumptable call Field1c_AnonJumptable
.anon_dw .anon_dw
dw .Jump dw .Jump
@ -1149,10 +1153,10 @@ NPCJump:
call CopyNextCoordsTileToStandingCoordsTile call CopyNextCoordsTileToStandingCoordsTile
ld hl, OBJECT_STEP_TYPE ld hl, OBJECT_STEP_TYPE
add hl, bc add hl, bc
ld [hl], STEP_TYPE_SLEEP ld [hl], STEP_TYPE_FROM_MOVEMENT
ret ret
PlayerJump: StepFunction_PlayerJump:
call Field1c_AnonJumptable call Field1c_AnonJumptable
.anon_dw .anon_dw
dw .initjump dw .initjump
@ -1198,10 +1202,10 @@ PlayerJump:
call CopyNextCoordsTileToStandingCoordsTile call CopyNextCoordsTileToStandingCoordsTile
ld hl, OBJECT_STEP_TYPE ld hl, OBJECT_STEP_TYPE
add hl, bc add hl, bc
ld [hl], STEP_TYPE_SLEEP ld [hl], STEP_TYPE_FROM_MOVEMENT
ret ret
TeleportFrom: StepFunction_TeleportFrom:
call Field1c_AnonJumptable call Field1c_AnonJumptable
.anon_dw .anon_dw
dw .InitSpin dw .InitSpin
@ -1266,10 +1270,10 @@ TeleportFrom:
ld [hl], 0 ld [hl], 0
ld hl, OBJECT_STEP_TYPE ld hl, OBJECT_STEP_TYPE
add hl, bc add hl, bc
ld [hl], STEP_TYPE_SLEEP ld [hl], STEP_TYPE_FROM_MOVEMENT
ret ret
TeleportTo: StepFunction_TeleportTo:
call Field1c_AnonJumptable call Field1c_AnonJumptable
.anon_dw .anon_dw
dw .InitWait dw .InitWait
@ -1353,10 +1357,10 @@ TeleportTo:
ld [hl], 0 ld [hl], 0
ld hl, OBJECT_STEP_TYPE ld hl, OBJECT_STEP_TYPE
add hl, bc add hl, bc
ld [hl], STEP_TYPE_SLEEP ld [hl], STEP_TYPE_FROM_MOVEMENT
ret ret
Skyfall: StepFunction_Skyfall:
call Field1c_AnonJumptable call Field1c_AnonJumptable
.anon_dw .anon_dw
dw .Init dw .Init
@ -1416,10 +1420,10 @@ Skyfall:
ld [hl], 0 ld [hl], 0
ld hl, OBJECT_STEP_TYPE ld hl, OBJECT_STEP_TYPE
add hl, bc add hl, bc
ld [hl], STEP_TYPE_SLEEP ld [hl], STEP_TYPE_FROM_MOVEMENT
ret ret
GotBiteStep: StepFunction_GotBite:
call Field1c_AnonJumptable call Field1c_AnonJumptable
.anon_dw .anon_dw
dw .Init dw .Init
@ -1448,10 +1452,10 @@ GotBiteStep:
ld [hl], 0 ld [hl], 0
ld hl, OBJECT_STEP_TYPE ld hl, OBJECT_STEP_TYPE
add hl, bc add hl, bc
ld [hl], STEP_TYPE_SLEEP ld [hl], STEP_TYPE_FROM_MOVEMENT
ret ret
RockSmashStep: StepFunction_RockSmash:
call .Step call .Step
jp WaitStep_InPlace jp WaitStep_InPlace
@ -1469,7 +1473,7 @@ RockSmashStep:
ld [hl], a ld [hl], a
ret ret
ReturnDigStep: StepFunction_DigTo:
ld hl, OBJECT_STEP_DURATION ld hl, OBJECT_STEP_DURATION
add hl, bc add hl, bc
ld a, [hl] ld a, [hl]
@ -1483,7 +1487,7 @@ ReturnDigStep:
ld [hl], a ld [hl], a
jp WaitStep_InPlace jp WaitStep_InPlace
StepType03: StepFunction_Sleep:
ld hl, OBJECT_DIRECTION_WALKING ld hl, OBJECT_DIRECTION_WALKING
add hl, bc add hl, bc
ld [hl], STANDING ld [hl], STANDING
@ -1493,10 +1497,10 @@ StepType03:
ret nz ret nz
ld hl, OBJECT_STEP_TYPE ld hl, OBJECT_STEP_TYPE
add hl, bc add hl, bc
ld [hl], STEP_TYPE_SLEEP ld [hl], STEP_TYPE_FROM_MOVEMENT
ret ret
StepType18: StepFunction_Delete:
ld hl, OBJECT_DIRECTION_WALKING ld hl, OBJECT_DIRECTION_WALKING
add hl, bc add hl, bc
ld [hl], STANDING ld [hl], STANDING
@ -1506,21 +1510,21 @@ StepType18:
ret nz ret nz
jp DeleteMapObject jp DeleteMapObject
StepTypeBump: StepFunction_Bump:
ld hl, OBJECT_STEP_DURATION ld hl, OBJECT_STEP_DURATION
add hl, bc add hl, bc
dec [hl] dec [hl]
ret nz ret nz
ld hl, OBJECT_STEP_TYPE ld hl, OBJECT_STEP_TYPE
add hl, bc add hl, bc
ld [hl], STEP_TYPE_SLEEP ld [hl], STEP_TYPE_FROM_MOVEMENT
ret ret
StepType05: StepFunction_Restore:
call Field1c_AnonJumptable call Field1c_AnonJumptable
.anon_dw .anon_dw
dw .Reset dw .Reset
dw StepType04 dw StepFunction_Standing
.Reset: .Reset:
call RestoreDefaultMovement call RestoreDefaultMovement
@ -1529,15 +1533,17 @@ StepType05:
add hl, bc add hl, bc
ld [hl], a ld [hl], a
call Field1c_IncAnonJumptableIndex call Field1c_IncAnonJumptableIndex
StepType04: ; fallthrough
call Stubbed_Function4fb2
StepFunction_Standing:
call Stubbed_UpdateYOffset
ld hl, OBJECT_DIRECTION_WALKING ld hl, OBJECT_DIRECTION_WALKING
add hl, bc add hl, bc
ld [hl], STANDING ld [hl], STANDING
ret ret
NPCStep: StepFunction_NPCWalk:
call Stubbed_Function4fb2 call Stubbed_UpdateYOffset
call AddStepVector call AddStepVector
ld hl, OBJECT_STEP_DURATION ld hl, OBJECT_STEP_DURATION
add hl, bc add hl, bc
@ -1549,10 +1555,10 @@ NPCStep:
ld [hl], STANDING ld [hl], STANDING
ld hl, OBJECT_STEP_TYPE ld hl, OBJECT_STEP_TYPE
add hl, bc add hl, bc
ld [hl], STEP_TYPE_SLEEP ld [hl], STEP_TYPE_FROM_MOVEMENT
ret ret
StepType07: StepFunction_ContinueWalk:
call AddStepVector call AddStepVector
ld hl, OBJECT_STEP_DURATION ld hl, OBJECT_STEP_DURATION
add hl, bc add hl, bc
@ -1561,8 +1567,7 @@ StepType07:
call CopyNextCoordsTileToStandingCoordsTile call CopyNextCoordsTileToStandingCoordsTile
jp RandomStepDuration_Slow jp RandomStepDuration_Slow
PlayerStep: StepFunction_PlayerWalk:
; AnimateStep?
call Field1c_AnonJumptable call Field1c_AnonJumptable
.anon_dw .anon_dw
dw .init dw .init
@ -1586,10 +1591,10 @@ PlayerStep:
ld [hl], STANDING ld [hl], STANDING
ld hl, OBJECT_STEP_TYPE ld hl, OBJECT_STEP_TYPE
add hl, bc add hl, bc
ld [hl], STEP_TYPE_SLEEP ld [hl], STEP_TYPE_FROM_MOVEMENT
ret ret
PlayerOrNPCTurnStep: StepFunction_Turn:
call Field1c_AnonJumptable call Field1c_AnonJumptable
.anon_dw .anon_dw
dw .init1 dw .init1
@ -1633,10 +1638,10 @@ PlayerOrNPCTurnStep:
ret nz ret nz
ld hl, OBJECT_STEP_TYPE ld hl, OBJECT_STEP_TYPE
add hl, bc add hl, bc
ld [hl], STEP_TYPE_SLEEP ld [hl], STEP_TYPE_FROM_MOVEMENT
ret ret
StepType0f: StepFunction_StrengthBoulder:
call AddStepVector call AddStepVector
ld hl, OBJECT_STEP_DURATION ld hl, OBJECT_STEP_DURATION
add hl, bc add hl, bc
@ -1664,10 +1669,10 @@ StepType0f:
ld [hl], STANDING ld [hl], STANDING
ld hl, OBJECT_STEP_TYPE ld hl, OBJECT_STEP_TYPE
add hl, bc add hl, bc
ld [hl], STEP_TYPE_SLEEP ld [hl], STEP_TYPE_FROM_MOVEMENT
ret ret
StepTypeTrackingObject: StepFunction_TrackingObject:
ld hl, OBJECT_1D ld hl, OBJECT_1D
add hl, bc add hl, bc
ld e, [hl] ld e, [hl]
@ -1700,8 +1705,8 @@ StepTypeTrackingObject:
.nope .nope
jp DeleteMapObject jp DeleteMapObject
StepType14: StepFunction_14:
StepType15: StepFunction_ScreenShake:
call Field1c_AnonJumptable call Field1c_AnonJumptable
.anon_dw .anon_dw
dw .Init dw .Init
@ -1749,9 +1754,10 @@ StepType15:
inc a inc a
ret ret
StepType16: StepFunction_16:
call Field1c_AnonJumptable ; ???? call Field1c_AnonJumptable ; ????
StepType17:
StepFunction_17:
call Field1c_AnonJumptable call Field1c_AnonJumptable
.anon_dw .anon_dw
dw .null dw .null
@ -1759,9 +1765,9 @@ StepType17:
dw .null dw .null
.null .null
SkyfallTop: StepFunction_SkyfallTop:
call Field1c_AnonJumptable call Field1c_AnonJumptable
; anonymous dw .anon_dw
dw .Init dw .Init
dw .Run dw .Run
@ -1787,10 +1793,11 @@ SkyfallTop:
ld [hl], 0 ld [hl], 0
ld hl, OBJECT_STEP_TYPE ld hl, OBJECT_STEP_TYPE
add hl, bc add hl, bc
ld [hl], STEP_TYPE_SLEEP ld [hl], STEP_TYPE_FROM_MOVEMENT
ret ret
Stubbed_Function4fb2: Stubbed_UpdateYOffset:
; dummied out
ret ret
ld hl, OBJECT_1D ld hl, OBJECT_1D
add hl, bc add hl, bc
@ -1801,7 +1808,7 @@ Stubbed_Function4fb2:
and %00000111 and %00000111
ld l, a ld l, a
ld h, 0 ld h, 0
ld de, .y ld de, .y_offsets
add hl, de add hl, de
ld a, [hl] ld a, [hl]
ld hl, OBJECT_SPRITE_Y_OFFSET ld hl, OBJECT_SPRITE_Y_OFFSET
@ -1809,7 +1816,7 @@ Stubbed_Function4fb2:
ld [hl], a ld [hl], a
ret ret
.y .y_offsets:
db 0, -1, -2, -3, -4, -3, -2, -1 db 0, -1, -2, -3, -4, -3, -2, -1
UpdateJumpPosition: UpdateJumpPosition:
@ -1823,7 +1830,7 @@ UpdateJumpPosition:
nop nop
srl e srl e
ld d, 0 ld d, 0
ld hl, .y ld hl, .y_offsets
add hl, de add hl, de
ld a, [hl] ld a, [hl]
ld hl, OBJECT_SPRITE_Y_OFFSET ld hl, OBJECT_SPRITE_Y_OFFSET
@ -1831,11 +1838,11 @@ UpdateJumpPosition:
ld [hl], a ld [hl], a
ret ret
.y .y_offsets:
db -4, -6, -8, -10, -11, -12, -12, -12 db -4, -6, -8, -10, -11, -12, -12, -12
db -11, -10, -9, -8, -6, -4, 0, 0 db -11, -10, -9, -8, -6, -4, 0, 0
ApplyPlayerMovementByte: GetPlayerNextMovementByte:
; copy [wPlayerNextMovement] to [wPlayerMovement] ; copy [wPlayerNextMovement] to [wPlayerMovement]
ld a, [wPlayerNextMovement] ld a, [wPlayerNextMovement]
ld hl, wPlayerMovement ld hl, wPlayerMovement
@ -1852,7 +1859,7 @@ GetMovementByte:
call _GetMovementByte call _GetMovementByte
ret ret
Function5015: GetIndexedMovementByte1:
ld hl, OBJECT_MOVEMENT_BYTE_INDEX ld hl, OBJECT_MOVEMENT_BYTE_INDEX
add hl, bc add hl, bc
ld e, [hl] ld e, [hl]
@ -1866,7 +1873,7 @@ Function5015:
ld a, [hl] ld a, [hl]
ret ret
Function5026: GetIndexedMovementByte2:
ld hl, OBJECT_MOVEMENT_BYTE_INDEX ld hl, OBJECT_MOVEMENT_BYTE_INDEX
add hl, bc add hl, bc
ld e, [hl] ld e, [hl]
@ -2032,6 +2039,7 @@ SpawnStrengthBoulderDust:
ret ret
.BoulderDustObject: .BoulderDustObject:
; vtile, palette, movement
db $00, PAL_OW_SILVER, SPRITEMOVEDATA_BOULDERDUST db $00, PAL_OW_SILVER, SPRITEMOVEDATA_BOULDERDUST
SpawnEmote: SpawnEmote:
@ -2043,6 +2051,7 @@ SpawnEmote:
ret ret
.EmoteObject: .EmoteObject:
; vtile, palette, movement
db $00, PAL_OW_SILVER, SPRITEMOVEDATA_EMOTE db $00, PAL_OW_SILVER, SPRITEMOVEDATA_EMOTE
ShakeGrass: ShakeGrass:
@ -2053,7 +2062,8 @@ ShakeGrass:
pop bc pop bc
ret ret
.GrassObject .GrassObject:
; vtile, palette, movement
db $00, PAL_OW_TREE, SPRITEMOVEDATA_GRASS db $00, PAL_OW_TREE, SPRITEMOVEDATA_GRASS
ShakeScreen: ShakeScreen:
@ -2068,6 +2078,7 @@ ShakeScreen:
ret ret
.ScreenShakeObject: .ScreenShakeObject:
; vtile, palette, movement
db $00, PAL_OW_SILVER, SPRITEMOVEDATA_SCREENSHAKE db $00, PAL_OW_SILVER, SPRITEMOVEDATA_SCREENSHAKE
DespawnEmote: DespawnEmote:
@ -2235,14 +2246,14 @@ Function565c:
call Function56a3 call Function56a3
jr c, SetFacing_Standing jr c, SetFacing_Standing
call Function5688 call Function5688
farcall Function4440 farcall HandleFrozenObjectAction ; no need to farcall
xor a xor a
ret ret
Function5673: Function5673:
call Function56a3 call Function56a3
jr c, SetFacing_Standing jr c, SetFacing_Standing
farcall Function4440 ; no need to farcall farcall HandleFrozenObjectAction ; no need to farcall
xor a xor a
ret ret
@ -2546,7 +2557,7 @@ SetFollowerIfVisible:
ld [hl], SPRITEMOVEDATA_FOLLOWING ld [hl], SPRITEMOVEDATA_FOLLOWING
ld hl, OBJECT_STEP_TYPE ld hl, OBJECT_STEP_TYPE
add hl, bc add hl, bc
ld [hl], STEP_TYPE_00 ld [hl], STEP_TYPE_RESET
ldh a, [hObjectStructIndexBuffer] ldh a, [hObjectStructIndexBuffer]
ld [wObjectFollow_Follower], a ld [wObjectFollow_Follower], a
ret ret
@ -2673,7 +2684,7 @@ Function58e3:
ld [hl], a ld [hl], a
ld hl, OBJECT_STEP_TYPE ld hl, OBJECT_STEP_TYPE
add hl, bc add hl, bc
ld [hl], STEP_TYPE_00 ld [hl], STEP_TYPE_RESET
ret ret
Function5903: Function5903:
@ -2690,10 +2701,10 @@ Function5903:
ld [hl], a ld [hl], a
ld hl, OBJECT_STEP_TYPE ld hl, OBJECT_STEP_TYPE
add hl, bc add hl, bc
ld [hl], STEP_TYPE_00 ld [hl], STEP_TYPE_RESET
ret ret
.standing_movefns .standing_movefns:
db SPRITEMOVEDATA_STANDING_DOWN db SPRITEMOVEDATA_STANDING_DOWN
db SPRITEMOVEDATA_STANDING_UP db SPRITEMOVEDATA_STANDING_UP
db SPRITEMOVEDATA_STANDING_LEFT db SPRITEMOVEDATA_STANDING_LEFT

View File

@ -131,7 +131,7 @@ Movement_step_dig:
ld [hl], a ld [hl], a
ld hl, OBJECT_STEP_TYPE ld hl, OBJECT_STEP_TYPE
add hl, bc add hl, bc
ld [hl], STEP_TYPE_03 ld [hl], STEP_TYPE_SLEEP
ld hl, OBJECT_DIRECTION_WALKING ld hl, OBJECT_DIRECTION_WALKING
add hl, bc add hl, bc
ld [hl], STANDING ld [hl], STANDING
@ -184,7 +184,7 @@ Movement_fish_cast_rod:
ld [hl], OBJECT_ACTION_FISHING ld [hl], OBJECT_ACTION_FISHING
ld hl, OBJECT_STEP_TYPE ld hl, OBJECT_STEP_TYPE
add hl, bc add hl, bc
ld [hl], STEP_TYPE_SLEEP ld [hl], STEP_TYPE_FROM_MOVEMENT
ret ret
Movement_step_loop: Movement_step_loop:
@ -208,7 +208,7 @@ Movement_step_end:
ld hl, OBJECT_STEP_TYPE ld hl, OBJECT_STEP_TYPE
add hl, bc add hl, bc
ld [hl], STEP_TYPE_SLEEP ld [hl], STEP_TYPE_FROM_MOVEMENT
ret ret
Movement_48: Movement_48:
@ -228,7 +228,7 @@ Movement_48:
ld hl, OBJECT_STEP_TYPE ld hl, OBJECT_STEP_TYPE
add hl, bc add hl, bc
ld [hl], STEP_TYPE_03 ld [hl], STEP_TYPE_SLEEP
ld hl, wVramState ld hl, wVramState
res 7, [hl] res 7, [hl]
@ -254,7 +254,7 @@ Movement_4b:
ld hl, OBJECT_STEP_TYPE ld hl, OBJECT_STEP_TYPE
add hl, bc add hl, bc
ld [hl], STEP_TYPE_04 ld [hl], STEP_TYPE_STANDING
ld hl, wVramState ld hl, wVramState
res 7, [hl] res 7, [hl]
@ -306,7 +306,7 @@ Movement_step_sleep_common:
ld hl, OBJECT_STEP_TYPE ld hl, OBJECT_STEP_TYPE
add hl, bc add hl, bc
ld [hl], STEP_TYPE_03 ld [hl], STEP_TYPE_SLEEP
ld hl, OBJECT_ACTION ld hl, OBJECT_ACTION
add hl, bc add hl, bc
@ -344,7 +344,7 @@ Movement_tree_shake:
ld hl, OBJECT_STEP_TYPE ld hl, OBJECT_STEP_TYPE
add hl, bc add hl, bc
ld [hl], STEP_TYPE_03 ld [hl], STEP_TYPE_SLEEP
ld hl, OBJECT_ACTION ld hl, OBJECT_ACTION
add hl, bc add hl, bc
@ -656,7 +656,7 @@ TurnStep:
ld hl, OBJECT_STEP_TYPE ld hl, OBJECT_STEP_TYPE
add hl, bc add hl, bc
ld [hl], STEP_TYPE_HALF_STEP ld [hl], STEP_TYPE_TURN
ret ret
NormalStep: NormalStep:

View File

@ -446,7 +446,7 @@ CopyTempObjectToObjectStruct:
ld hl, OBJECT_STEP_TYPE ld hl, OBJECT_STEP_TYPE
add hl, de add hl, de
ld [hl], STEP_TYPE_00 ld [hl], STEP_TYPE_RESET
ld hl, OBJECT_FACING_STEP ld hl, OBJECT_FACING_STEP
add hl, de add hl, de
@ -689,7 +689,7 @@ FollowNotExact::
ld [hl], SPRITEMOVEDATA_FOLLOWNOTEXACT ld [hl], SPRITEMOVEDATA_FOLLOWNOTEXACT
ld hl, OBJECT_STEP_TYPE ld hl, OBJECT_STEP_TYPE
add hl, de add hl, de
ld [hl], STEP_TYPE_00 ld [hl], STEP_TYPE_RESET
ret ret
GetRelativeFacing:: GetRelativeFacing::

View File

@ -410,7 +410,7 @@ LoadMovementDataPointer::
ld hl, OBJECT_STEP_TYPE ld hl, OBJECT_STEP_TYPE
add hl, bc add hl, bc
ld [hl], STEP_TYPE_00 ld [hl], STEP_TYPE_RESET
ld hl, wVramState ld hl, wVramState
set 7, [hl] set 7, [hl]