summaryrefslogtreecommitdiff
path: root/home/menu.asm
diff options
context:
space:
mode:
authorRangi <remy.oukaour+rangi42@gmail.com>2018-08-25 14:28:22 -0400
committerRangi <remy.oukaour+rangi42@gmail.com>2018-08-25 14:28:22 -0400
commiteb1e3636bb71509546c274bf2a5910d8e71a9600 (patch)
tree24d7742604073b2afb86c1225258f8217d1653e7 /home/menu.asm
parent376c64468bab8d162da43fc6e1b6f0942943cf43 (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/menu.asm')
-rw-r--r--home/menu.asm30
1 files changed, 15 insertions, 15 deletions
diff --git a/home/menu.asm b/home/menu.asm
index d10b6e936..5060a915a 100644
--- a/home/menu.asm
+++ b/home/menu.asm
@@ -9,7 +9,7 @@ CopyMenuHeader::
ld de, wMenuHeader
ld bc, wMenuHeaderEnd - wMenuHeader
call CopyBytes
- ld a, [hROMBank]
+ ldh a, [hROMBank]
ld [wMenuDataBank], a
ret
@@ -59,7 +59,7 @@ Call_ExitMenu::
VerticalMenu::
xor a
- ld [hBGMapMode], a
+ ldh [hBGMapMode], a
call MenuBox
call UpdateSprites
call PlaceVerticalMenuItems
@@ -229,17 +229,17 @@ DrawVariableLengthMenuBox::
MenuWriteText::
xor a
- ld [hBGMapMode], a
+ ldh [hBGMapMode], a
call GetMenuIndexSet ; sort out the text
call RunMenuItemPrintingFunction ; actually write it
call SafeUpdateSprites
- ld a, [hOAMUpdate]
+ ldh a, [hOAMUpdate]
push af
ld a, $1
- ld [hOAMUpdate], a
+ ldh [hOAMUpdate], a
call ApplyTilemap
pop af
- ld [hOAMUpdate], a
+ ldh [hOAMUpdate], a
ret
AutomaticGetMenuBottomCoord::
@@ -455,10 +455,10 @@ ClearWindowData::
ld hl, w2DMenuCursorInitY
call .bytefill
- ld a, [rSVBK]
+ ldh a, [rSVBK]
push af
ld a, BANK(wWindowStack)
- ld [rSVBK], a
+ ldh [rSVBK], a
xor a
ld hl, wWindowStackBottom
@@ -470,7 +470,7 @@ ClearWindowData::
ld [wWindowStackPointer + 1], a
pop af
- ld [rSVBK], a
+ ldh [rSVBK], a
ret
.bytefill
@@ -505,10 +505,10 @@ MenuTextBoxWaitButton::
ret
Place2DMenuItemName::
- ld [hBuffer], a
- ld a, [hROMBank]
+ ldh [hBuffer], a
+ ldh a, [hROMBank]
push af
- ld a, [hBuffer]
+ ldh a, [hBuffer]
rst Bankswitch
call PlaceString
@@ -518,21 +518,21 @@ Place2DMenuItemName::
ret
_2DMenu::
- ld a, [hROMBank]
+ ldh a, [hROMBank]
ld [wMenuData_2DMenuItemStringsBank], a
farcall _2DMenu_
ld a, [wMenuCursorBuffer]
ret
InterpretBattleMenu::
- ld a, [hROMBank]
+ ldh a, [hROMBank]
ld [wMenuData_2DMenuItemStringsBank], a
farcall _InterpretBattleMenu
ld a, [wMenuCursorBuffer]
ret
InterpretMobileMenu::
- ld a, [hROMBank]
+ ldh a, [hROMBank]
ld [wMenuData_2DMenuItemStringsBank], a
farcall _InterpretMobileMenu
ld a, [wMenuCursorBuffer]