summaryrefslogtreecommitdiff
path: root/engine/overworld/npc_movement.asm
diff options
context:
space:
mode:
authorRangi <35663410+Rangi42@users.noreply.github.com>2018-08-25 22:23:45 -0400
committerGitHub <noreply@github.com>2018-08-25 22:23:45 -0400
commit3eacab563d0e1ab5557c2443556a7a5e58d14cad (patch)
tree3d747166409fdc94f0fd1aa760693a7ee5bd2156 /engine/overworld/npc_movement.asm
parent89681d231611938a791f4256e602c88c2f9aa3e1 (diff)
parentb2adcd6d6ff91efc764a6ecc65147be7b9cda9e8 (diff)
Merge pull request #555 from Rangi42/ldh
Use real labels for HRAM instead of constants, and the ldh instruction
Diffstat (limited to 'engine/overworld/npc_movement.asm')
-rw-r--r--engine/overworld/npc_movement.asm22
1 files changed, 11 insertions, 11 deletions
diff --git a/engine/overworld/npc_movement.asm b/engine/overworld/npc_movement.asm
index b4b5ef467..ffed4875b 100644
--- a/engine/overworld/npc_movement.asm
+++ b/engine/overworld/npc_movement.asm
@@ -238,7 +238,7 @@ CheckFacingObject::
.asm_6ff1
ld bc, wObjectStructs ; redundant
ld a, 0
- ld [hMapObjectIndexBuffer], a
+ ldh [hMapObjectIndexBuffer], a
call IsNPCAtCoord
ret nc
ld hl, OBJECT_DIRECTION_WALKING
@@ -263,7 +263,7 @@ WillObjectBumpIntoSomeoneElse:
jr IsNPCAtCoord
Unreferenced_Function7015:
- ld a, [hMapObjectIndexBuffer]
+ ldh a, [hMapObjectIndexBuffer]
call GetObjectStruct
call .CheckWillBeFacingNPC
call IsNPCAtCoord
@@ -302,7 +302,7 @@ IsNPCAtCoord:
ld bc, wObjectStructs
xor a
.loop
- ld [hObjectStructIndexBuffer], a
+ ldh [hObjectStructIndexBuffer], a
call DoesObjectHaveASprite
jr z, .next
@@ -333,9 +333,9 @@ IsNPCAtCoord:
jr nz, .ok
.ok2
- ld a, [hMapObjectIndexBuffer]
+ ldh a, [hMapObjectIndexBuffer]
ld l, a
- ld a, [hObjectStructIndexBuffer]
+ ldh a, [hObjectStructIndexBuffer]
cp l
jr nz, .setcarry
@@ -350,9 +350,9 @@ IsNPCAtCoord:
ld a, [hl]
cp e
jr nz, .next
- ld a, [hMapObjectIndexBuffer]
+ ldh a, [hMapObjectIndexBuffer]
ld l, a
- ld a, [hObjectStructIndexBuffer]
+ ldh a, [hObjectStructIndexBuffer]
cp l
jr nz, .setcarry
@@ -361,7 +361,7 @@ IsNPCAtCoord:
add hl, bc
ld b, h
ld c, l
- ld a, [hObjectStructIndexBuffer]
+ ldh a, [hObjectStructIndexBuffer]
inc a
cp NUM_OBJECT_STRUCTS
jr nz, .loop
@@ -469,7 +469,7 @@ Unreferenced_Function7113:
ld bc, wObjectStructs
xor a
.loop
- ld [hObjectStructIndexBuffer], a
+ ldh [hObjectStructIndexBuffer], a
call DoesObjectHaveASprite
jr z, .next
ld hl, OBJECT_MOVEMENTTYPE
@@ -492,7 +492,7 @@ Unreferenced_Function7113:
ld a, [hl]
cp d
jr nz, .check_current_coords
- ld a, [hObjectStructIndexBuffer]
+ ldh a, [hObjectStructIndexBuffer]
cp $0
jr z, .next
jr .yes
@@ -515,7 +515,7 @@ Unreferenced_Function7113:
add hl, bc
ld b, h
ld c, l
- ld a, [hObjectStructIndexBuffer]
+ ldh a, [hObjectStructIndexBuffer]
inc a
cp NUM_OBJECT_STRUCTS
jr nz, .loop