diff options
Diffstat (limited to 'engine/overworld/player_object.asm')
-rw-r--r-- | engine/overworld/player_object.asm | 64 |
1 files changed, 32 insertions, 32 deletions
diff --git a/engine/overworld/player_object.asm b/engine/overworld/player_object.asm index 7d287dedb..08a990f4b 100644 --- a/engine/overworld/player_object.asm +++ b/engine/overworld/player_object.asm @@ -1,4 +1,4 @@ -BlankScreen: ; 8000 +BlankScreen: call DisableSpriteUpdates xor a ld [hBGMapMode], a @@ -16,7 +16,7 @@ BlankScreen: ; 8000 call SetPalettes ret -SpawnPlayer: ; 8029 +SpawnPlayer: ld a, -1 ld [wObjectFollow_Leader], a ld [wObjectFollow_Follower], a @@ -51,13 +51,13 @@ SpawnPlayer: ; 8029 ld [wCenteredObject], a ret -PlayerObjectTemplate: ; 8071 +PlayerObjectTemplate: ; A dummy map object used to initialize the player object. ; Shorter than the actual amount copied by two bytes. ; Said bytes seem to be unused. object_event -4, -4, SPRITE_CHRIS, SPRITEMOVEDATA_PLAYER, 15, 15, -1, -1, 0, OBJECTTYPE_SCRIPT, 0, 0, -1 -CopyDECoordsToMapObject:: ; 807e +CopyDECoordsToMapObject:: push de ld a, b call GetMapObject @@ -70,7 +70,7 @@ CopyDECoordsToMapObject:: ; 807e ld [hl], e ret -PlayerSpawn_ConvertCoords: ; 808f +PlayerSpawn_ConvertCoords: push bc ld a, [wXCoord] add 4 @@ -82,7 +82,7 @@ PlayerSpawn_ConvertCoords: ; 808f call CopyDECoordsToMapObject ret -WriteObjectXY:: ; 80a1 +WriteObjectXY:: ld a, b call CheckObjectVisibility ret c @@ -99,7 +99,7 @@ WriteObjectXY:: ; 80a1 and a ret -RefreshPlayerCoords: ; 80b8 +RefreshPlayerCoords: ld a, [wXCoord] add 4 ld d, a @@ -127,7 +127,7 @@ RefreshPlayerCoords: ; 80b8 ret nz ; wtf ret -CopyObjectStruct:: ; 80e7 +CopyObjectStruct:: call CheckObjectMask and a ret nz ; masked @@ -161,12 +161,12 @@ CopyObjectStruct:: ; 80e7 set 5, [hl] ret -CopyMapObjectToObjectStruct: ; 8116 +CopyMapObjectToObjectStruct: call .CopyMapObjectToTempObject call CopyTempObjectToObjectStruct ret -.CopyMapObjectToTempObject: ; 811d +.CopyMapObjectToTempObject: ld a, [hObjectStructIndexBuffer] ld hl, MAPOBJECT_OBJECT_STRUCT_ID add hl, bc @@ -223,7 +223,7 @@ CopyMapObjectToObjectStruct: ; 8116 ld [wTempObjectCopyRadius], a ret -InitializeVisibleSprites: ; 8177 +InitializeVisibleSprites: ld bc, wMapObjects + OBJECT_LENGTH ld a, 1 .loop @@ -281,10 +281,10 @@ InitializeVisibleSprites: ; 8177 jr nz, .loop ret -.ret ; 81c9 +.ret ret -CheckObjectEnteringVisibleRange:: ; 81ca +CheckObjectEnteringVisibleRange:: nop ld a, [wPlayerStepDirection] cp STANDING @@ -293,21 +293,21 @@ CheckObjectEnteringVisibleRange:: ; 81ca rst JumpTable ret -.dw ; 81d6 +.dw dw .Down dw .Up dw .Left dw .Right -.Up: ; 81de +.Up: ld a, [wYCoord] sub 1 jr .Vertical -.Down: ; 81e5 +.Down: ld a, [wYCoord] add 9 -.Vertical: ; 81ea +.Vertical: ld d, a ld a, [wXCoord] ld e, a @@ -355,15 +355,15 @@ CheckObjectEnteringVisibleRange:: ; 81ca jr nz, .loop_v ret -.Left: ; 8232 +.Left: ld a, [wXCoord] sub 1 jr .Horizontal -.Right: ; 8239 +.Right: ld a, [wXCoord] add 10 -.Horizontal: ; 823e +.Horizontal: ld e, a ld a, [wYCoord] ld d, a @@ -411,7 +411,7 @@ CheckObjectEnteringVisibleRange:: ; 81ca jr nz, .loop_h ret -CopyTempObjectToObjectStruct: ; 8286 +CopyTempObjectToObjectStruct: ld a, [wTempObjectCopyMapObjectIndex] ld hl, OBJECT_MAP_OBJECT_INDEX add hl, de @@ -461,7 +461,7 @@ CopyTempObjectToObjectStruct: ; 8286 and a ret -.InitYCoord: ; 82d5 +.InitYCoord: ld hl, OBJECT_INIT_Y add hl, de ld [hl], a @@ -481,7 +481,7 @@ CopyTempObjectToObjectStruct: ; 8286 ld [hl], a ret -.InitXCoord: ; 82f1 +.InitXCoord: ld hl, OBJECT_INIT_X add hl, de ld [hl], a @@ -499,7 +499,7 @@ CopyTempObjectToObjectStruct: ; 8286 ld [hl], a ret -.InitRadius: ; 830d +.InitRadius: ld h, a inc a and $f @@ -513,7 +513,7 @@ CopyTempObjectToObjectStruct: ; 8286 ld [hl], a ret -TrainerWalkToPlayer: ; 831e +TrainerWalkToPlayer: ld a, [hLastTalked] call InitMovementBuffer ld a, movement_step_sleep @@ -533,7 +533,7 @@ TrainerWalkToPlayer: ; 831e call AppendToMovementBuffer ret -.GetPathToPlayer: ; 8341 +.GetPathToPlayer: push de push bc ; get player object struct, load to de @@ -577,7 +577,7 @@ TrainerWalkToPlayer: ; 831e call ComputePathToWalkToPlayer ret -SurfStartStep: ; 8379 +SurfStartStep: call InitMovementBuffer call .GetMovementData call AppendToMovementBuffer @@ -585,7 +585,7 @@ SurfStartStep: ; 8379 call AppendToMovementBuffer ret -.GetMovementData: ; 8388 +.GetMovementData: ld a, [wPlayerDirection] srl a srl a @@ -603,7 +603,7 @@ SurfStartStep: ; 8379 slow_step LEFT slow_step RIGHT -FollowNotExact:: ; 839e +FollowNotExact:: push bc ld a, c call CheckObjectVisibility @@ -690,7 +690,7 @@ FollowNotExact:: ; 839e ld [hl], STEP_TYPE_00 ret -GetRelativeFacing:: ; 8417 +GetRelativeFacing:: ; Determines which way map object e would have to turn to face map object d. Returns carry if it's impossible for whatever reason. ld a, d call GetMapObject @@ -715,7 +715,7 @@ GetRelativeFacing:: ; 8417 scf ret -.GetFacing_e_relativeto_d: ; 8439 +.GetFacing_e_relativeto_d: ; Determines which way object e would have to turn to face object d. Returns carry if it's impossible. ; load the coordinates of object d into bc ld a, d @@ -796,7 +796,7 @@ GetRelativeFacing:: ; 8417 scf ret -QueueFollowerFirstStep: ; 848a +QueueFollowerFirstStep: call .QueueFirstStep jr c, .same ld [wFollowMovementQueue], a |