diff options
author | Rangi <remy.oukaour+rangi42@gmail.com> | 2018-08-25 14:28:22 -0400 |
---|---|---|
committer | Rangi <remy.oukaour+rangi42@gmail.com> | 2018-08-25 14:28:22 -0400 |
commit | eb1e3636bb71509546c274bf2a5910d8e71a9600 (patch) | |
tree | 24d7742604073b2afb86c1225258f8217d1653e7 /home/map_objects.asm | |
parent | 376c64468bab8d162da43fc6e1b6f0942943cf43 (diff) |
Use labels instead of constants for HRAM
Use explicit ldh instruction to access HRAM locations, don't rely on optimizing ld
Diffstat (limited to 'home/map_objects.asm')
-rw-r--r-- | home/map_objects.asm | 24 |
1 files changed, 12 insertions, 12 deletions
diff --git a/home/map_objects.asm b/home/map_objects.asm index 6bc30d571..4cc28b07d 100644 --- a/home/map_objects.asm +++ b/home/map_objects.asm @@ -20,7 +20,7 @@ GetSpriteVTile:: ld hl, wUsedSprites + 2 ld c, SPRITE_GFX_LIST_CAPACITY - 1 ld b, a - ld a, [hMapObjectIndexBuffer] + ldh a, [hMapObjectIndexBuffer] cp 0 jr z, .nope ld a, b @@ -54,7 +54,7 @@ DoesSpriteHaveFacings:: push hl ld b, a - ld a, [hROMBank] + ldh a, [hROMBank] push af ld a, BANK(_DoesSpriteHaveFacings) rst Bankswitch @@ -96,7 +96,7 @@ GetTileCollision:: ld d, 0 add hl, de - ld a, [hROMBank] + ldh a, [hROMBank] push af ld a, BANK(TileCollisionTable) rst Bankswitch @@ -210,14 +210,14 @@ GetMapObject:: CheckObjectVisibility:: ; Sets carry if the object is not visible on the screen. - ld [hMapObjectIndexBuffer], a + ldh [hMapObjectIndexBuffer], a call GetMapObject ld hl, MAPOBJECT_OBJECT_STRUCT_ID add hl, bc ld a, [hl] cp -1 jr z, .not_visible - ld [hObjectStructIndexBuffer], a + ldh [hObjectStructIndexBuffer], a call GetObjectStruct and a ret @@ -301,21 +301,21 @@ CheckObjectTime:: ret ; unused - ld [hMapObjectIndexBuffer], a + ldh [hMapObjectIndexBuffer], a call GetMapObject call CopyObjectStruct ret _CopyObjectStruct:: - ld [hMapObjectIndexBuffer], a + ldh [hMapObjectIndexBuffer], a call UnmaskObject - ld a, [hMapObjectIndexBuffer] + ldh a, [hMapObjectIndexBuffer] call GetMapObject farcall CopyObjectStruct ret ApplyDeletionToMapObject:: - ld [hMapObjectIndexBuffer], a + ldh [hMapObjectIndexBuffer], a call GetMapObject ld hl, MAPOBJECT_OBJECT_STRUCT_ID add hl, bc @@ -394,7 +394,7 @@ Unreferenced_Function19b8: LoadMovementDataPointer:: ; Load the movement data pointer for object a. ld [wMovementObject], a - ld a, [hROMBank] + ldh a, [hROMBank] ld [wMovementDataPointer], a ld a, l ld [wMovementDataPointer + 1], a @@ -484,7 +484,7 @@ endr CopySpriteMovementData:: ld l, a - ld a, [hROMBank] + ldh a, [hROMBank] push af ld a, BANK(SpriteMovementData) rst Bankswitch @@ -551,7 +551,7 @@ endr _GetMovementByte:: ; Switch to the movement data bank - ld a, [hROMBank] + ldh a, [hROMBank] push af ld a, [hli] rst Bankswitch |