summaryrefslogtreecommitdiff
path: root/engine/overworld/movement.asm
diff options
context:
space:
mode:
authorYamaArashi <shadow962@live.com>2016-06-12 00:54:14 -0700
committerGitHub <noreply@github.com>2016-06-12 00:54:14 -0700
commit2b2c6fefd311101c87845c8c498746dc74bd725f (patch)
tree3f917e1bf896e380cfea6d2d876ff68a4db87a57 /engine/overworld/movement.asm
parenta51037eeeedb03e29d8675626018cf02750882fa (diff)
parent61ee39678695479816feff4b58baaa6953ff219f (diff)
Merge pull request #134 from YamaArashi/master
sync engine code with pokeyellow
Diffstat (limited to 'engine/overworld/movement.asm')
-rw-r--r--engine/overworld/movement.asm19
1 files changed, 9 insertions, 10 deletions
diff --git a/engine/overworld/movement.asm b/engine/overworld/movement.asm
index e60f820a..9302b6e3 100644
--- a/engine/overworld/movement.asm
+++ b/engine/overworld/movement.asm
@@ -393,7 +393,7 @@ UpdateSpriteMovementDelay:
ld l, a
ld [hl], $1 ; c1x1 = 1 (mark as ready to move)
notYetMoving:
- ld h, $c1
+ ld h, wSpriteStateData1 / $100
ld a, [H_CURRENTSPRITEOFFSET]
add $8
ld l, a
@@ -408,7 +408,6 @@ MakeNPCFacePlayer:
ld a, [wd72d]
bit 5, a
jr nz, notYetMoving
-
res 7, [hl]
ld a, [wPlayerDirection]
bit PLAYER_DIR_BIT_UP, a
@@ -449,7 +448,7 @@ InitializeSpriteStatus:
; calculates the spprite's scrren position form its map position and the player position
InitializeSpriteScreenPosition:
- ld h, $c2
+ ld h, wSpriteStateData2 / $100
ld a, [H_CURRENTSPRITEOFFSET]
add $4
ld l, a
@@ -477,7 +476,7 @@ CheckSpriteAvailability:
ld a, [$ffe5]
and a
jp nz, .spriteInvisible
- ld h, $c2
+ ld h, wSpriteStateData2 / $100
ld a, [H_CURRENTSPRITEOFFSET]
add $6
ld l, a
@@ -525,7 +524,7 @@ CheckSpriteAvailability:
cp d
jr c, .spriteVisible ; standing on tile with ID >=$60 (top right tile)
.spriteInvisible
- ld h, $c1
+ ld h, wSpriteStateData1 / $100
ld a, [H_CURRENTSPRITEOFFSET]
add $2
ld l, a
@@ -579,7 +578,7 @@ UpdateSpriteImage:
; e: X movement delta (-1, 0 or 1)
; set carry on failure, clears carry on success
CanWalkOntoTile:
- ld h, $c2
+ ld h, wSpriteStateData2 / $100
ld a, [H_CURRENTSPRITEOFFSET]
add $6
ld l, a
@@ -607,7 +606,7 @@ CanWalkOntoTile:
ld a, [hl] ; $c2x6 (movement byte 1)
inc a
jr z, .impassable ; if $ff, no movement allowed (however, changing direction is)
- ld h, $c1
+ ld h, wSpriteStateData1 / $100
ld a, [H_CURRENTSPRITEOFFSET]
add $4
ld l, a
@@ -626,14 +625,14 @@ CanWalkOntoTile:
call DetectCollisionBetweenSprites
pop bc
pop de
- ld h, $c1
+ ld h, wSpriteStateData1 / $100
ld a, [H_CURRENTSPRITEOFFSET]
add $c
ld l, a
ld a, [hl] ; c1xc (directions in which sprite collision would occur)
and b ; check against chosen direction (1,2,4 or 8)
jr nz, .impassable ; collision between sprites, don't go there
- ld h, $c2
+ ld h, wSpriteStateData2 / $100
ld a, [H_CURRENTSPRITEOFFSET]
add $2
ld l, a
@@ -690,7 +689,7 @@ CanWalkOntoTile:
; this is always the lower left tile of the 2x2 tile blocks all sprites are snapped to
; hl: output pointer
GetTileSpriteStandsOn:
- ld h, $c1
+ ld h, wSpriteStateData1 / $100
ld a, [H_CURRENTSPRITEOFFSET]
add $4
ld l, a