Rename OBJECT_LENGTH to MAPOBJECT_LENGTH and OBJECT_STRUCT_LENGTH to OBJECT_LENGTH

This commit is contained in:
Rangi 2019-11-03 12:25:59 -05:00
parent 01f68fcc6a
commit 5134266b9a
10 changed files with 37 additions and 37 deletions

View File

@ -34,7 +34,7 @@
const OBJECT_1F ; 1f const OBJECT_1F ; 1f
const OBJECT_RANGE ; 20 const OBJECT_RANGE ; 20
; 21-27 are not used ; 21-27 are not used
OBJECT_STRUCT_LENGTH EQU 40 OBJECT_LENGTH EQU 40
NUM_OBJECT_STRUCTS EQU 13 ; see wObjectStructs NUM_OBJECT_STRUCTS EQU 13 ; see wObjectStructs
; object_struct OBJECT_FACING values ; object_struct OBJECT_FACING values
@ -114,7 +114,7 @@ ABSOLUTE_TILE_ID EQU 1 << ABSOLUTE_TILE_ID_F
const MAPOBJECT_FLAG_HI ; d const MAPOBJECT_FLAG_HI ; d
const MAPOBJECT_E ; unused const MAPOBJECT_E ; unused
const MAPOBJECT_F ; unused const MAPOBJECT_F ; unused
OBJECT_LENGTH EQU const_value MAPOBJECT_LENGTH EQU const_value
; SpriteMovementData struct members (see data/sprites/map_objects.asm) ; SpriteMovementData struct members (see data/sprites/map_objects.asm)
const_def const_def

View File

@ -1626,7 +1626,7 @@ CmdQueue_StoneTable:
jr c, .fall_down_hole jr c, .fall_down_hole
.next .next
ld hl, OBJECT_STRUCT_LENGTH ld hl, OBJECT_LENGTH
add hl, de add hl, de
ld d, h ld d, h
ld e, l ld e, l

View File

@ -10,7 +10,7 @@ DeleteMapObject::
push af push af
ld h, b ld h, b
ld l, c ld l, c
ld bc, OBJECT_STRUCT_LENGTH ld bc, OBJECT_LENGTH
xor a xor a
call ByteFill call ByteFill
pop af pop af
@ -2082,11 +2082,11 @@ DespawnEmote:
jr z, .next jr z, .next
push bc push bc
xor a xor a
ld bc, OBJECT_STRUCT_LENGTH ld bc, OBJECT_LENGTH
call ByteFill call ByteFill
pop bc pop bc
.next .next
ld hl, OBJECT_STRUCT_LENGTH ld hl, OBJECT_LENGTH
add hl, de add hl, de
ld d, h ld d, h
ld e, l ld e, l
@ -2149,7 +2149,7 @@ Function55e0::
jr z, .ok jr z, .ok
call Function565c call Function565c
.ok .ok
ld hl, OBJECT_STRUCT_LENGTH ld hl, OBJECT_LENGTH
add hl, bc add hl, bc
ld b, h ld b, h
ld c, l ld c, l
@ -2205,7 +2205,7 @@ Function5645:
.loop .loop
ldh [hMapObjectIndexBuffer], a ldh [hMapObjectIndexBuffer], a
call SetFacing_Standing call SetFacing_Standing
ld hl, OBJECT_STRUCT_LENGTH ld hl, OBJECT_LENGTH
add hl, bc add hl, bc
ld b, h ld b, h
ld c, l ld c, l
@ -2421,7 +2421,7 @@ HandleNPCStep::
jr z, .next jr z, .next
call Function437b call Function437b
.next .next
ld hl, OBJECT_STRUCT_LENGTH ld hl, OBJECT_LENGTH
add hl, bc add hl, bc
ld b, h ld b, h
ld c, l ld c, l
@ -2582,7 +2582,7 @@ Function587a:
add hl, bc add hl, bc
set OBJ_FLAGS2_5, [hl] set OBJ_FLAGS2_5, [hl]
.next .next
ld hl, OBJECT_STRUCT_LENGTH ld hl, OBJECT_LENGTH
add hl, bc add hl, bc
ld b, h ld b, h
ld c, l ld c, l
@ -2625,7 +2625,7 @@ Function58b9::
add hl, bc add hl, bc
res OBJ_FLAGS2_5, [hl] res OBJ_FLAGS2_5, [hl]
.next .next
ld hl, OBJECT_STRUCT_LENGTH ld hl, OBJECT_LENGTH
add hl, bc add hl, bc
ld b, h ld b, h
ld c, l ld c, l
@ -2750,7 +2750,7 @@ ApplyBGMapAnchorToObjects:
add e add e
ld [hl], a ld [hl], a
.skip .skip
ld hl, OBJECT_STRUCT_LENGTH ld hl, OBJECT_LENGTH
add hl, bc add hl, bc
ld b, h ld b, h
ld c, l ld c, l
@ -2809,7 +2809,7 @@ InitSprites:
jr .add jr .add
.skip .skip
ld hl, OBJECT_STRUCT_LENGTH ld hl, OBJECT_LENGTH
add hl, bc add hl, bc
ld b, h ld b, h
ld c, l ld c, l
@ -2817,7 +2817,7 @@ InitSprites:
jr .next jr .next
.add .add
ld hl, OBJECT_STRUCT_LENGTH ld hl, OBJECT_LENGTH
add hl, bc add hl, bc
ld b, h ld b, h
ld c, l ld c, l

View File

@ -19,7 +19,7 @@ LoadObjectMasks:
ld [de], a ld [de], a
inc de inc de
pop bc pop bc
ld hl, OBJECT_LENGTH ld hl, MAPOBJECT_LENGTH
add hl, bc add hl, bc
ld b, h ld b, h
ld c, l ld c, l

View File

@ -369,7 +369,7 @@ IsNPCAtCoord:
jr nz, .setcarry jr nz, .setcarry
.next .next
ld hl, OBJECT_STRUCT_LENGTH ld hl, OBJECT_LENGTH
add hl, bc add hl, bc
ld b, h ld b, h
ld c, l ld c, l
@ -523,7 +523,7 @@ Unreferenced_Function7113:
jr .yes jr .yes
.next .next
ld hl, OBJECT_STRUCT_LENGTH ld hl, OBJECT_LENGTH
add hl, bc add hl, bc
ld b, h ld b, h
ld c, l ld c, l

View File

@ -109,7 +109,7 @@ AddIndoorSprites:
push af push af
ld a, [hl] ld a, [hl]
call AddSpriteGFX call AddSpriteGFX
ld de, OBJECT_LENGTH ld de, MAPOBJECT_LENGTH
add hl, de add hl, de
pop af pop af
inc a inc a

View File

@ -132,9 +132,9 @@ CopyObjectStruct::
and a and a
ret nz ; masked ret nz ; masked
ld hl, wObjectStructs + OBJECT_STRUCT_LENGTH * 1 ld hl, wObjectStructs + OBJECT_LENGTH * 1
ld a, 1 ld a, 1
ld de, OBJECT_STRUCT_LENGTH ld de, OBJECT_LENGTH
.loop .loop
ldh [hObjectStructIndexBuffer], a ldh [hObjectStructIndexBuffer], a
ld a, [hl] ld a, [hl]
@ -224,7 +224,7 @@ CopyMapObjectToObjectStruct:
ret ret
InitializeVisibleSprites: InitializeVisibleSprites:
ld bc, wMapObjects + OBJECT_LENGTH ld bc, wMapObjects + MAPOBJECT_LENGTH
ld a, 1 ld a, 1
.loop .loop
ldh [hMapObjectIndexBuffer], a ldh [hMapObjectIndexBuffer], a
@ -271,7 +271,7 @@ InitializeVisibleSprites:
jp c, .ret jp c, .ret
.next .next
ld hl, OBJECT_LENGTH ld hl, MAPOBJECT_LENGTH
add hl, bc add hl, bc
ld b, h ld b, h
ld c, l ld c, l
@ -311,7 +311,7 @@ CheckObjectEnteringVisibleRange::
ld d, a ld d, a
ld a, [wXCoord] ld a, [wXCoord]
ld e, a ld e, a
ld bc, wMapObjects + OBJECT_LENGTH ld bc, wMapObjects + MAPOBJECT_LENGTH
ld a, 1 ld a, 1
.loop_v .loop_v
ldh [hMapObjectIndexBuffer], a ldh [hMapObjectIndexBuffer], a
@ -345,7 +345,7 @@ CheckObjectEnteringVisibleRange::
pop de pop de
.next_v .next_v
ld hl, OBJECT_LENGTH ld hl, MAPOBJECT_LENGTH
add hl, bc add hl, bc
ld b, h ld b, h
ld c, l ld c, l
@ -367,7 +367,7 @@ CheckObjectEnteringVisibleRange::
ld e, a ld e, a
ld a, [wYCoord] ld a, [wYCoord]
ld d, a ld d, a
ld bc, wMapObjects + OBJECT_LENGTH ld bc, wMapObjects + MAPOBJECT_LENGTH
ld a, 1 ld a, 1
.loop_h .loop_h
ldh [hMapObjectIndexBuffer], a ldh [hMapObjectIndexBuffer], a
@ -401,7 +401,7 @@ CheckObjectEnteringVisibleRange::
pop de pop de
.next_h .next_h
ld hl, OBJECT_LENGTH ld hl, MAPOBJECT_LENGTH
add hl, bc add hl, bc
ld b, h ld b, h
ld c, l ld c, l

View File

@ -597,7 +597,7 @@ ReadObjectEvents::
; Fill the remaining sprite IDs and y coords with 0 and -1, respectively. ; Fill the remaining sprite IDs and y coords with 0 and -1, respectively.
; Bleeds into wObjectMasks due to a bug. Uncomment the above subtraction ; Bleeds into wObjectMasks due to a bug. Uncomment the above subtraction
; to fix. ; to fix.
ld bc, OBJECT_LENGTH ld bc, MAPOBJECT_LENGTH
.loop .loop
ld [hl], 0 ld [hl], 0
inc hl inc hl
@ -631,7 +631,7 @@ CopyMapObjectEvents::
jr nz, .loop2 jr nz, .loop2
pop hl pop hl
ld bc, OBJECT_LENGTH ld bc, MAPOBJECT_LENGTH
add hl, bc add hl, bc
pop bc pop bc
dec c dec c
@ -640,13 +640,13 @@ CopyMapObjectEvents::
ClearObjectStructs:: ClearObjectStructs::
ld hl, wObject1Struct ld hl, wObject1Struct
ld bc, OBJECT_STRUCT_LENGTH * (NUM_OBJECT_STRUCTS - 1) ld bc, OBJECT_LENGTH * (NUM_OBJECT_STRUCTS - 1)
xor a xor a
call ByteFill call ByteFill
; Just to make sure (this is rather pointless) ; Just to make sure (this is rather pointless)
ld hl, wObject1Struct ld hl, wObject1Struct
ld de, OBJECT_STRUCT_LENGTH ld de, OBJECT_LENGTH
ld c, NUM_OBJECT_STRUCTS - 1 ld c, NUM_OBJECT_STRUCTS - 1
xor a xor a
.loop .loop

View File

@ -202,7 +202,7 @@ CheckStandingOnEntrance::
GetMapObject:: GetMapObject::
; Return the location of map object a in bc. ; Return the location of map object a in bc.
ld hl, wMapObjects ld hl, wMapObjects
ld bc, OBJECT_LENGTH ld bc, MAPOBJECT_LENGTH
call AddNTimes call AddNTimes
ld b, h ld b, h
ld c, l ld c, l
@ -358,7 +358,7 @@ CopyPlayerObjectTemplate::
ld [de], a ld [de], a
inc de inc de
pop hl pop hl
ld bc, OBJECT_LENGTH - 1 ld bc, MAPOBJECT_LENGTH - 1
call CopyBytes call CopyBytes
ret ret
@ -370,7 +370,7 @@ Unreferenced_Function19b8:
push af push af
ld [hl], -1 ld [hl], -1
inc hl inc hl
ld bc, OBJECT_LENGTH - 1 ld bc, MAPOBJECT_LENGTH - 1
xor a xor a
call ByteFill call ByteFill
pop af pop af
@ -424,7 +424,7 @@ FindFirstEmptyObjectStruct::
push bc push bc
push de push de
ld hl, wObjectStructs ld hl, wObjectStructs
ld de, OBJECT_STRUCT_LENGTH ld de, OBJECT_LENGTH
ld c, NUM_OBJECT_STRUCTS ld c, NUM_OBJECT_STRUCTS
.loop .loop
ld a, [hl] ld a, [hl]
@ -594,7 +594,7 @@ UpdateSprites::
ret ret
GetObjectStruct:: GetObjectStruct::
ld bc, OBJECT_STRUCT_LENGTH ld bc, OBJECT_LENGTH
ld hl, wObjectStructs ld hl, wObjectStructs
call AddNTimes call AddNTimes
ld b, h ld b, h

View File

@ -15,7 +15,7 @@ _CheckTrainerBattle::
; Skip the player object. ; Skip the player object.
ld a, 1 ld a, 1
ld de, wMapObjects + OBJECT_LENGTH ld de, wMapObjects + MAPOBJECT_LENGTH
.loop .loop
@ -78,7 +78,7 @@ _CheckTrainerBattle::
.next .next
pop de pop de
ld hl, OBJECT_LENGTH ld hl, MAPOBJECT_LENGTH
add hl, de add hl, de
ld d, h ld d, h
ld e, l ld e, l