diff options
author | U-Daniel-PC\Daniel <corrnondacqb@yahoo.com> | 2015-07-03 14:37:53 -0500 |
---|---|---|
committer | U-Daniel-PC\Daniel <corrnondacqb@yahoo.com> | 2015-07-03 14:37:53 -0500 |
commit | cd649184f556db777d592671a7274bfa4a8423d7 (patch) | |
tree | dca56b6c0accb03b4256268faaee2705d373b933 /engine/overworld/movement.asm | |
parent | ae420a4d8f24d4c4290b7b2e7ccc02f363272548 (diff) |
Rename/organize part 1 of 4
rename functions, clean up address/wram comments, other misc
only broken up so that all changes are viewable on github
Diffstat (limited to 'engine/overworld/movement.asm')
-rw-r--r-- | engine/overworld/movement.asm | 20 |
1 files changed, 10 insertions, 10 deletions
diff --git a/engine/overworld/movement.asm b/engine/overworld/movement.asm index c4482700..75b4f3ea 100644 --- a/engine/overworld/movement.asm +++ b/engine/overworld/movement.asm @@ -22,7 +22,7 @@ UpdatePlayerSprite: ; 4e31 (1:4e31) .lowerLeftTileIsMapTile call DetectCollisionBetweenSprites ld h, $c1 - ld a, [wWalkCounter] ; wcfc5 + ld a, [wWalkCounter] and a jr nz, .asm_4e90 ld a, [wd528] @@ -108,7 +108,7 @@ Func_4ed1: ; 4ed1 (1:4ed1) swap a dec a add a - ld hl, W_MAPSPRITEDATA ; wd4e4 + ld hl, W_MAPSPRITEDATA add l ld l, a ld a, [hl] ; read movement byte 2 @@ -138,7 +138,7 @@ Func_4ed1: ; 4ed1 (1:4ed1) jp z, UpdateSpriteMovementDelay ; c1x1 == 2 cp $3 jp z, UpdateSpriteInWalkingAnimation ; c1x1 == 3 - ld a, [wWalkCounter] ; wcfc5 + ld a, [wWalkCounter] and a ret nz ; don't do anything yet if player is currently moving (redundant, already tested in CheckSpriteAvailability) call InitializeSpriteScreenPosition @@ -212,7 +212,7 @@ Func_4ed1: ; 4ed1 (1:4ed1) cp $2 jr z, .moveRight ; movement byte 2 = $2 only allows left or right .moveUp - ld de, -2*20 ; $ffd8 + ld de, -2*20 add hl, de ; move tile pointer two rows up ld de, $ff00 ld bc, $804 @@ -440,7 +440,7 @@ InitializeSpriteScreenPosition: ; 50bd (1:50bd) ld a, [H_CURRENTSPRITEOFFSET] add $4 ld l, a - ld a, [W_YCOORD] ; wd361 + ld a, [W_YCOORD] ld b, a ld a, [hl] ; c2x4 (Y position + 4) sub b ; relative to player position @@ -449,7 +449,7 @@ InitializeSpriteScreenPosition: ; 50bd (1:50bd) dec h ld [hli], a ; c1x4 (screen Y position) inc h - ld a, [W_XCOORD] ; wd362 + ld a, [W_XCOORD] ld b, a ld a, [hli] ; c2x6 (X position + 4) sub b ; relative to player position @@ -475,7 +475,7 @@ CheckSpriteAvailability: ; 50dc (1:50dc) add $4 ld l, a ld b, [hl] ; c2x4: Y pos (+4) - ld a, [W_YCOORD] ; wd361 + ld a, [W_YCOORD] cp b jr z, .skipYVisibilityTest jr nc, .spriteInvisible ; above screen region @@ -485,7 +485,7 @@ CheckSpriteAvailability: ; 50dc (1:50dc) .skipYVisibilityTest inc l ld b, [hl] ; c2x5: X pos (+4) - ld a, [W_XCOORD] ; wd362 + ld a, [W_XCOORD] cp b jr z, .skipXVisibilityTest jr nc, .spriteInvisible ; left of screen region @@ -503,7 +503,7 @@ CheckSpriteAvailability: ; 50dc (1:50dc) ld a, [hld] cp d jr nc, .spriteInvisible ; standing on tile with ID >=$60 (bottom right tile) - ld bc, -20 ; $ffec + ld bc, -20 add hl, bc ; go back one row of tiles ld a, [hli] cp d @@ -521,7 +521,7 @@ CheckSpriteAvailability: ; 50dc (1:50dc) jr .done .spriteVisible ld c, a - ld a, [wWalkCounter] ; wcfc5 + ld a, [wWalkCounter] and a jr nz, .done ; if player is currently walking, we're done call UpdateSpriteImage |