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 /engine/pokemon/stats_screen.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 'engine/pokemon/stats_screen.asm')
-rw-r--r-- | engine/pokemon/stats_screen.asm | 26 |
1 files changed, 13 insertions, 13 deletions
diff --git a/engine/pokemon/stats_screen.asm b/engine/pokemon/stats_screen.asm index 72f895269..d0004a47a 100644 --- a/engine/pokemon/stats_screen.asm +++ b/engine/pokemon/stats_screen.asm @@ -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 |