summaryrefslogtreecommitdiff
path: root/engine/overworld
diff options
context:
space:
mode:
Diffstat (limited to 'engine/overworld')
-rw-r--r--engine/overworld/cmd_queue.asm4
-rw-r--r--engine/overworld/events.asm2
-rw-r--r--engine/overworld/map_objects.asm26
-rw-r--r--engine/overworld/movement.asm10
-rw-r--r--engine/overworld/npc_movement.asm22
-rw-r--r--engine/overworld/player_movement.asm2
-rw-r--r--engine/overworld/player_object.asm28
-rw-r--r--engine/overworld/scripting.asm4
8 files changed, 49 insertions, 49 deletions
diff --git a/engine/overworld/cmd_queue.asm b/engine/overworld/cmd_queue.asm
index aab339e6c..906a02faa 100644
--- a/engine/overworld/cmd_queue.asm
+++ b/engine/overworld/cmd_queue.asm
@@ -14,7 +14,7 @@ HandleCmdQueue::
ld hl, wCmdQueue
xor a
.loop
- ldh [hMapObjectIndexBuffer], a
+ ldh [hMapObjectIndex], a
ld a, [hl]
and a
jr z, .skip
@@ -27,7 +27,7 @@ HandleCmdQueue::
.skip
ld de, CMDQUEUE_ENTRY_SIZE
add hl, de
- ldh a, [hMapObjectIndexBuffer]
+ ldh a, [hMapObjectIndex]
inc a
cp CMDQUEUE_CAPACITY
jr nz, .loop
diff --git a/engine/overworld/events.asm b/engine/overworld/events.asm
index 5abdb22a3..c0a77ed20 100644
--- a/engine/overworld/events.asm
+++ b/engine/overworld/events.asm
@@ -540,7 +540,7 @@ TryObjectEvent:
.IsObject:
call PlayTalkObject
- ldh a, [hObjectStructIndexBuffer]
+ ldh a, [hObjectStructIndex]
call GetObjectStruct
ld hl, OBJECT_MAP_OBJECT_INDEX
add hl, bc
diff --git a/engine/overworld/map_objects.asm b/engine/overworld/map_objects.asm
index c49e1dafa..4d7139128 100644
--- a/engine/overworld/map_objects.asm
+++ b/engine/overworld/map_objects.asm
@@ -1040,7 +1040,7 @@ _RandomWalkContinue:
add hl, bc
ld [hl], OBJECT_ACTION_STEP
ld hl, wCenteredObject
- ldh a, [hMapObjectIndexBuffer]
+ ldh a, [hMapObjectIndex]
cp [hl]
jr z, .centered
ld hl, OBJECT_STEP_TYPE
@@ -1945,7 +1945,7 @@ ApplyMovementToFollower:
ret z
ld a, [wObjectFollow_Leader]
ld d, a
- ldh a, [hMapObjectIndexBuffer]
+ ldh a, [hMapObjectIndex]
cp d
ret nz
ld a, e
@@ -2085,7 +2085,7 @@ ShakeScreen:
DespawnEmote:
push bc
- ldh a, [hMapObjectIndexBuffer]
+ ldh a, [hMapObjectIndex]
ld c, a
call .DeleteEmote
pop bc
@@ -2130,7 +2130,7 @@ InitTempObject:
CopyTempObjectData:
; load into wTempObjectCopy:
-; -1, -1, [de], [de + 1], [de + 2], [hMapObjectIndexBuffer], [NextMapX], [NextMapY], -1
+; -1, -1, [de], [de + 1], [de + 2], [hMapObjectIndex], [NextMapX], [NextMapY], -1
; This spawns the object at the same place as whichever object is loaded into bc.
ld hl, wTempObjectCopyMapObjectIndex
ld [hl], -1
@@ -2145,7 +2145,7 @@ CopyTempObjectData:
ld [hli], a
ld a, [de]
ld [hli], a
- ldh a, [hMapObjectIndexBuffer]
+ ldh a, [hMapObjectIndex]
ld [hli], a
push hl
ld hl, OBJECT_NEXT_MAP_X
@@ -2169,7 +2169,7 @@ UpdateAllObjectsFrozen::
ld bc, wObjectStructs
xor a
.loop
- ldh [hMapObjectIndexBuffer], a
+ ldh [hMapObjectIndex], a
call DoesObjectHaveASprite
jr z, .ok
call UpdateObjectFrozen
@@ -2178,7 +2178,7 @@ UpdateAllObjectsFrozen::
add hl, bc
ld b, h
ld c, l
- ldh a, [hMapObjectIndexBuffer]
+ ldh a, [hMapObjectIndex]
inc a
cp NUM_OBJECT_STRUCTS
jr nz, .loop
@@ -2228,13 +2228,13 @@ HideAllObjects:
xor a
ld bc, wObjectStructs
.loop
- ldh [hMapObjectIndexBuffer], a
+ ldh [hMapObjectIndex], a
call SetFacing_Standing
ld hl, OBJECT_LENGTH
add hl, bc
ld b, h
ld c, l
- ldh a, [hMapObjectIndexBuffer]
+ ldh a, [hMapObjectIndex]
inc a
cp NUM_OBJECT_STRUCTS
jr nz, .loop
@@ -2452,7 +2452,7 @@ DoStepsForAllObjects:
ld bc, wObjectStructs
xor a
.loop
- ldh [hMapObjectIndexBuffer], a
+ ldh [hMapObjectIndex], a
call DoesObjectHaveASprite
jr z, .next
call HandleObjectStep
@@ -2461,7 +2461,7 @@ DoStepsForAllObjects:
add hl, bc
ld b, h
ld c, l
- ldh a, [hMapObjectIndexBuffer]
+ ldh a, [hMapObjectIndex]
inc a
cp NUM_OBJECT_STRUCTS
jr nz, .loop
@@ -2545,7 +2545,7 @@ StartFollow::
SetLeaderIfVisible:
call CheckObjectVisibility
ret c
- ldh a, [hObjectStructIndexBuffer]
+ ldh a, [hObjectStructIndex]
ld [wObjectFollow_Leader], a
ret
@@ -2571,7 +2571,7 @@ SetFollowerIfVisible:
ld hl, OBJECT_STEP_TYPE
add hl, bc
ld [hl], STEP_TYPE_RESET
- ldh a, [hObjectStructIndexBuffer]
+ ldh a, [hObjectStructIndex]
ld [wObjectFollow_Follower], a
ret
diff --git a/engine/overworld/movement.asm b/engine/overworld/movement.asm
index 7903af704..ec9d56288 100644
--- a/engine/overworld/movement.asm
+++ b/engine/overworld/movement.asm
@@ -237,7 +237,7 @@ Movement_48:
Movement_remove_object:
call DeleteMapObject
ld hl, wObjectFollow_Leader
- ldh a, [hMapObjectIndexBuffer]
+ ldh a, [hMapObjectIndex]
cp [hl]
jr nz, .not_leading
ld [hl], -1
@@ -680,7 +680,7 @@ NormalStep:
.skip_grass
ld hl, wCenteredObject
- ldh a, [hMapObjectIndexBuffer]
+ ldh a, [hMapObjectIndex]
cp [hl]
jr z, .player
@@ -704,7 +704,7 @@ TurningStep:
ld [hl], OBJECT_ACTION_SPIN
ld hl, wCenteredObject
- ldh a, [hMapObjectIndexBuffer]
+ ldh a, [hMapObjectIndex]
cp [hl]
jr z, .player
@@ -728,7 +728,7 @@ SlideStep:
ld [hl], OBJECT_ACTION_STAND
ld hl, wCenteredObject
- ldh a, [hMapObjectIndexBuffer]
+ ldh a, [hMapObjectIndex]
cp [hl]
jr z, .player
@@ -760,7 +760,7 @@ JumpStep:
call SpawnShadow
ld hl, wCenteredObject
- ldh a, [hMapObjectIndexBuffer]
+ ldh a, [hMapObjectIndex]
cp [hl]
jr z, .player
diff --git a/engine/overworld/npc_movement.asm b/engine/overworld/npc_movement.asm
index 1fb8e63a9..2c374ff87 100644
--- a/engine/overworld/npc_movement.asm
+++ b/engine/overworld/npc_movement.asm
@@ -250,7 +250,7 @@ CheckFacingObject::
.not_counter
ld bc, wObjectStructs ; redundant
ld a, 0
- ldh [hMapObjectIndexBuffer], a
+ ldh [hMapObjectIndex], a
call IsNPCAtCoord
ret nc
ld hl, OBJECT_DIRECTION_WALKING
@@ -275,7 +275,7 @@ WillObjectBumpIntoSomeoneElse:
jr IsNPCAtCoord
IsObjectFacingSomeoneElse: ; unreferenced
- ldh a, [hMapObjectIndexBuffer]
+ ldh a, [hMapObjectIndex]
call GetObjectStruct
call .GetFacingCoords
call IsNPCAtCoord
@@ -315,7 +315,7 @@ IsNPCAtCoord:
ld bc, wObjectStructs
xor a
.loop
- ldh [hObjectStructIndexBuffer], a
+ ldh [hObjectStructIndex], a
call DoesObjectHaveASprite
jr z, .next
@@ -345,9 +345,9 @@ IsNPCAtCoord:
jr nz, .check_current_coords
.continue
- ldh a, [hMapObjectIndexBuffer]
+ ldh a, [hMapObjectIndex]
ld l, a
- ldh a, [hObjectStructIndexBuffer]
+ ldh a, [hObjectStructIndex]
cp l
jr nz, .yes
@@ -362,9 +362,9 @@ IsNPCAtCoord:
ld a, [hl]
cp e
jr nz, .next
- ldh a, [hMapObjectIndexBuffer]
+ ldh a, [hMapObjectIndex]
ld l, a
- ldh a, [hObjectStructIndexBuffer]
+ ldh a, [hObjectStructIndex]
cp l
jr nz, .yes
@@ -373,7 +373,7 @@ IsNPCAtCoord:
add hl, bc
ld b, h
ld c, l
- ldh a, [hObjectStructIndexBuffer]
+ ldh a, [hObjectStructIndex]
inc a
cp NUM_OBJECT_STRUCTS
jr nz, .loop
@@ -481,7 +481,7 @@ IsNPCAtPlayerCoord: ; unreferenced
ld bc, wObjectStructs
xor a
.loop
- ldh [hObjectStructIndexBuffer], a
+ ldh [hObjectStructIndex], a
call DoesObjectHaveASprite
jr z, .next
@@ -505,7 +505,7 @@ IsNPCAtPlayerCoord: ; unreferenced
ld a, [hl]
cp d
jr nz, .check_current_coords
- ldh a, [hObjectStructIndexBuffer]
+ ldh a, [hObjectStructIndex]
cp PLAYER_OBJECT
jr z, .next
jr .yes
@@ -528,7 +528,7 @@ IsNPCAtPlayerCoord: ; unreferenced
add hl, bc
ld b, h
ld c, l
- ldh a, [hObjectStructIndexBuffer]
+ ldh a, [hObjectStructIndex]
inc a
cp NUM_OBJECT_STRUCTS
jr nz, .loop
diff --git a/engine/overworld/player_movement.asm b/engine/overworld/player_movement.asm
index 4ef04d79b..a485cfa93 100644
--- a/engine/overworld/player_movement.asm
+++ b/engine/overworld/player_movement.asm
@@ -621,7 +621,7 @@ ENDM
; Returns 1 if there is no NPC in front
; Returns 2 if there is a movable NPC in front
ld a, 0
- ldh [hMapObjectIndexBuffer], a
+ ldh [hMapObjectIndex], a
; Load the next X coordinate into d
ld a, [wPlayerStandingMapX]
ld d, a
diff --git a/engine/overworld/player_object.asm b/engine/overworld/player_object.asm
index f9976a037..84a2c4e16 100644
--- a/engine/overworld/player_object.asm
+++ b/engine/overworld/player_object.asm
@@ -41,10 +41,10 @@ SpawnPlayer:
.ok
ld [hl], e
ld a, PLAYER_OBJECT
- ldh [hMapObjectIndexBuffer], a
+ ldh [hMapObjectIndex], a
ld bc, wMapObjects
ld a, PLAYER_OBJECT
- ldh [hObjectStructIndexBuffer], a
+ ldh [hObjectStructIndex], a
ld de, wObjectStructs
call CopyMapObjectToObjectStruct
ld a, PLAYER
@@ -94,7 +94,7 @@ WriteObjectXY::
ld hl, OBJECT_NEXT_MAP_Y
add hl, bc
ld e, [hl]
- ldh a, [hMapObjectIndexBuffer]
+ ldh a, [hMapObjectIndex]
ld b, a
call CopyDECoordsToMapObject
and a
@@ -138,12 +138,12 @@ CopyObjectStruct::
ld a, 1
ld de, OBJECT_LENGTH
.loop
- ldh [hObjectStructIndexBuffer], a
+ ldh [hObjectStructIndex], a
ld a, [hl]
and a
jr z, .done
add hl, de
- ldh a, [hObjectStructIndexBuffer]
+ ldh a, [hObjectStructIndex]
inc a
cp NUM_OBJECT_STRUCTS
jr nz, .loop
@@ -169,12 +169,12 @@ CopyMapObjectToObjectStruct:
ret
.CopyMapObjectToTempObject:
- ldh a, [hObjectStructIndexBuffer]
+ ldh a, [hObjectStructIndex]
ld hl, MAPOBJECT_OBJECT_STRUCT_ID
add hl, bc
ld [hl], a
- ldh a, [hMapObjectIndexBuffer]
+ ldh a, [hMapObjectIndex]
ld [wTempObjectCopyMapObjectIndex], a
ld hl, MAPOBJECT_SPRITE
@@ -229,7 +229,7 @@ InitializeVisibleSprites:
ld bc, wMap1Object
ld a, 1
.loop
- ldh [hMapObjectIndexBuffer], a
+ ldh [hMapObjectIndex], a
ld hl, MAPOBJECT_SPRITE
add hl, bc
ld a, [hl]
@@ -277,7 +277,7 @@ InitializeVisibleSprites:
add hl, bc
ld b, h
ld c, l
- ldh a, [hMapObjectIndexBuffer]
+ ldh a, [hMapObjectIndex]
inc a
cp NUM_OBJECTS
jr nz, .loop
@@ -316,7 +316,7 @@ CheckObjectEnteringVisibleRange::
ld bc, wMap1Object
ld a, 1
.loop_v
- ldh [hMapObjectIndexBuffer], a
+ ldh [hMapObjectIndex], a
ld hl, MAPOBJECT_SPRITE
add hl, bc
ld a, [hl]
@@ -351,7 +351,7 @@ CheckObjectEnteringVisibleRange::
add hl, bc
ld b, h
ld c, l
- ldh a, [hMapObjectIndexBuffer]
+ ldh a, [hMapObjectIndex]
inc a
cp NUM_OBJECTS
jr nz, .loop_v
@@ -372,7 +372,7 @@ CheckObjectEnteringVisibleRange::
ld bc, wMap1Object
ld a, 1
.loop_h
- ldh [hMapObjectIndexBuffer], a
+ ldh [hMapObjectIndex], a
ld hl, MAPOBJECT_SPRITE
add hl, bc
ld a, [hl]
@@ -407,7 +407,7 @@ CheckObjectEnteringVisibleRange::
add hl, bc
ld b, h
ld c, l
- ldh a, [hMapObjectIndexBuffer]
+ ldh a, [hMapObjectIndex]
inc a
cp NUM_OBJECTS
jr nz, .loop_h
@@ -680,7 +680,7 @@ FollowNotExact::
ld hl, OBJECT_SPRITE_Y
add hl, de
ld [hl], a
- ldh a, [hObjectStructIndexBuffer]
+ ldh a, [hObjectStructIndex]
ld hl, OBJECT_RANGE
add hl, de
ld [hl], a
diff --git a/engine/overworld/scripting.asm b/engine/overworld/scripting.asm
index 5d1d0a0fb..ca2306aee 100644
--- a/engine/overworld/scripting.asm
+++ b/engine/overworld/scripting.asm
@@ -962,7 +962,7 @@ Script_appear:
call GetScriptByte
call GetScriptObject
call UnmaskCopyMapObjectStruct
- ldh a, [hMapObjectIndexBuffer]
+ ldh a, [hMapObjectIndex]
ld b, 0 ; clear
call ApplyEventActionAppearDisappear
ret
@@ -975,7 +975,7 @@ Script_disappear:
ldh a, [hLastTalked]
.ok
call DeleteObjectStruct
- ldh a, [hMapObjectIndexBuffer]
+ ldh a, [hMapObjectIndex]
ld b, 1 ; set
call ApplyEventActionAppearDisappear
farcall _UpdateSprites