Use labels instead of constants for HRAM

Use explicit ldh instruction to access HRAM locations, don't rely on optimizing ld
This commit is contained in:
Rangi
2018-08-25 14:28:22 -04:00
parent 376c64468b
commit eb1e3636bb
243 changed files with 4706 additions and 4661 deletions

View File

@@ -46,7 +46,7 @@ WritePartyMenuTilemap:
push af
set NO_TEXT_SCROLL, [hl]
xor a
ld [hBGMapMode], a
ldh [hBGMapMode], a
hlcoord 0, 0
ld bc, SCREEN_WIDTH * SCREEN_HEIGHT
ld a, " "
@@ -590,7 +590,7 @@ InitPartyMenuGFX:
ret z
ld c, a
xor a
ld [hObjectStructIndexBuffer], a
ldh [hObjectStructIndexBuffer], a
.loop
push bc
push hl
@@ -598,9 +598,9 @@ InitPartyMenuGFX:
ld a, BANK(LoadMenuMonIcon)
ld e, MONICON_PARTYMENU
rst FarCall
ld a, [hObjectStructIndexBuffer]
ldh a, [hObjectStructIndexBuffer]
inc a
ld [hObjectStructIndexBuffer], a
ldh [hObjectStructIndexBuffer], a
pop hl
pop bc
dec c
@@ -682,7 +682,7 @@ PartyMenuSelect:
cp b
jr z, .exitmenu ; CANCEL
ld [wPartyMenuCursor], a
ld a, [hJoyLast]
ldh a, [hJoyLast]
ld b, a
bit B_BUTTON_F, b
jr nz, .exitmenu ; B button