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

@@ -23,10 +23,10 @@ _MobileStatsScreenInit:
jr StatsScreenInit_gotaddress
StatsScreenInit_gotaddress:
ld a, [hMapAnims]
ldh a, [hMapAnims]
push af
xor a
ld [hMapAnims], a ; disable overworld tile animations
ldh [hMapAnims], a ; disable overworld tile animations
ld a, [wBoxAlignment] ; whether sprite is to be mirrorred
push af
ld a, [wJumptableIndex]
@@ -54,7 +54,7 @@ StatsScreenInit_gotaddress:
pop af
ld [wBoxAlignment], a
pop af
ld [hMapAnims], a
ldh [hMapAnims], a
ret
StatsScreenMain:
@@ -264,7 +264,7 @@ StatsScreen_GetJoypad:
jr .clear_flags
.notbreedmon
ld a, [hJoyPressed]
ldh a, [hJoyPressed]
.clear_flags
and a
ret
@@ -375,7 +375,7 @@ StatsScreen_JoypadAction:
StatsScreen_InitUpperHalf:
call .PlaceHPBar
xor a
ld [hBGMapMode], a
ldh [hBGMapMode], a
ld a, [wBaseDexNo]
ld [wDeciramBuffer], a
ld [wCurSpecies], a
@@ -486,7 +486,7 @@ StatsScreen_LoadGFX:
ld [wTempSpecies], a
ld [wCurSpecies], a
xor a
ld [hBGMapMode], a
ldh [hBGMapMode], a
call .ClearBox
call .PageTilemap
call .LoadPals
@@ -636,15 +636,15 @@ StatsScreen_LoadGFX:
farcall CalcExpAtLevel
ld hl, wTempMonExp + 2
ld hl, wTempMonExp + 2
ld a, [hQuotient + 2]
ldh a, [hQuotient + 2]
sub [hl]
dec hl
ld [wBuffer3], a
ld a, [hQuotient + 1]
ldh a, [hQuotient + 1]
sbc [hl]
dec hl
ld [wBuffer2], a
ld a, [hQuotient]
ldh a, [hQuotient]
sbc [hl]
ld [wBuffer1], a
ret
@@ -926,16 +926,16 @@ StatsScreen_LoadTextBoxSpaceGFX:
push bc
push af
call DelayFrame
ld a, [rVBK]
ldh a, [rVBK]
push af
ld a, $1
ld [rVBK], a
ldh [rVBK], a
ld de, TextBoxSpaceGFX
lb bc, BANK(TextBoxSpaceGFX), 1
ld hl, vTiles2 tile " "
call Get2bpp
pop af
ld [rVBK], a
ldh [rVBK], a
pop af
pop bc
pop de
@@ -948,7 +948,7 @@ Unreferenced_4e32a:
EggStatsScreen:
xor a
ld [hBGMapMode], a
ldh [hBGMapMode], a
ld hl, wCurHPPal
call SetHPPal
ld b, SCGB_STATS_SCREEN_HP_PALS