summaryrefslogtreecommitdiff
path: root/home/menu_window.asm
diff options
context:
space:
mode:
authorRangi <remy.oukaour+rangi42@gmail.com>2018-06-24 21:23:51 -0400
committerRangi <remy.oukaour+rangi42@gmail.com>2018-06-24 21:23:51 -0400
commite2fb7acac0e3c1d598021b52fc2583dd983321bc (patch)
treeea5922596ce167e5b0485ea3bacd65f43339ca60 /home/menu_window.asm
parent1a888f22004aec967d2b6049ede7e04b1815f956 (diff)
parent364854623267a8a39242243b0cdf80144e868642 (diff)
Merge branch 'master' of https://github.com/pret/pokecrystal
# Conflicts: # engine/items/mart.asm
Diffstat (limited to 'home/menu_window.asm')
-rw-r--r--home/menu_window.asm51
1 files changed, 19 insertions, 32 deletions
diff --git a/home/menu_window.asm b/home/menu_window.asm
index aceb00343..c279b8c56 100644
--- a/home/menu_window.asm
+++ b/home/menu_window.asm
@@ -1,19 +1,18 @@
-PushWindow:: ; 1c00
+PushWindow::
callfar _PushWindow
ret
-; 1c07
-ExitMenu:: ; 0x1c07
+ExitMenu::
push af
callfar _ExitMenu
pop af
ret
-InitVerticalMenuCursor:: ; 0x1c10
+InitVerticalMenuCursor::
callfar _InitVerticalMenuCursor
ret
-CloseWindow:: ; 0x1c17
+CloseWindow::
push af
call ExitMenu
call ApplyTilemap
@@ -21,15 +20,14 @@ CloseWindow:: ; 0x1c17
pop af
ret
-RestoreTileBackup:: ; 0x1c23
+RestoreTileBackup::
call MenuBoxCoord2Tile
call .copy
call MenuBoxCoord2Attr
call .copy
ret
-; 0x1c30
-.copy ; 0x1c30
+.copy
call GetMenuBoxDims
inc b
inc c
@@ -54,7 +52,7 @@ RestoreTileBackup:: ; 0x1c23
ret
-PopWindow:: ; 0x1c47
+PopWindow::
ld b, $10
ld de, wMenuFlags
.loop
@@ -65,7 +63,7 @@ PopWindow:: ; 0x1c47
jr nz, .loop ; 0x1c50 $fa
ret
-GetMenuBoxDims:: ; 0x1c53
+GetMenuBoxDims::
ld a, [wMenuBorderTopCoord] ; top
ld b, a
ld a, [wMenuBorderBottomCoord] ; bottom
@@ -77,9 +75,8 @@ GetMenuBoxDims:: ; 0x1c53
sub c
ld c, a
ret
-; 0x1c66
-CopyMenuData:: ; 1c66
+CopyMenuData::
push hl
push de
push bc
@@ -96,9 +93,8 @@ CopyMenuData:: ; 1c66
pop de
pop hl
ret
-; 1c7e
-GetWindowStackTop:: ; 1c7e
+GetWindowStackTop::
ld hl, wWindowStackPointer
ld a, [hli]
ld h, [hl]
@@ -108,9 +104,8 @@ GetWindowStackTop:: ; 1c7e
ld h, [hl]
ld l, a
ret
-; 1c89
-PlaceVerticalMenuItems:: ; 1c89
+PlaceVerticalMenuItems::
call CopyMenuData
ld hl, wMenuDataPointer
ld e, [hl]
@@ -143,17 +138,15 @@ PlaceVerticalMenuItems:: ; 1c89
ld b, $0
add hl, bc
jp PlaceString
-; 1cbb
-MenuBox:: ; 1cbb
+MenuBox::
call MenuBoxCoord2Tile
call GetMenuBoxDims
dec b
dec c
jp TextBox
-; 1cc6
-GetMenuTextStartCoord:: ; 1cc6
+GetMenuTextStartCoord::
ld a, [wMenuBorderTopCoord]
ld b, a
inc b
@@ -175,9 +168,8 @@ GetMenuTextStartCoord:: ; 1cc6
.bit_7_clear
ret
-; 1ce1
-ClearMenuBoxInterior:: ; 1ce1
+ClearMenuBoxInterior::
call MenuBoxCoord2Tile
ld bc, SCREEN_WIDTH + 1
add hl, bc
@@ -186,27 +178,24 @@ ClearMenuBoxInterior:: ; 1ce1
dec c
call ClearBox
ret
-; 1cf1
-ClearWholeMenuBox:: ; 1cf1
+ClearWholeMenuBox::
call MenuBoxCoord2Tile
call GetMenuBoxDims
inc c
inc b
call ClearBox
ret
-; 1cfd
-MenuBoxCoord2Tile:: ; 1cfd
+MenuBoxCoord2Tile::
ld a, [wMenuBorderLeftCoord]
ld c, a
ld a, [wMenuBorderTopCoord]
ld b, a
-; 1d05
-Coord2Tile:: ; 1d05
+Coord2Tile::
; Return the address of wTileMap(c, b) in hl.
xor a
ld h, a
@@ -226,15 +215,14 @@ Coord2Tile:: ; 1d05
bccoord 0, 0
add hl, bc
ret
-; 1d19
-MenuBoxCoord2Attr:: ; 1d19
+MenuBoxCoord2Attr::
ld a, [wMenuBorderLeftCoord]
ld c, a
ld a, [wMenuBorderTopCoord]
ld b, a
-Coord2Attr:: ; 1d21
+Coord2Attr::
; Return the address of wAttrMap(c, b) in hl.
xor a
ld h, a
@@ -254,4 +242,3 @@ Coord2Attr:: ; 1d21
bccoord 0, 0, wAttrMap
add hl, bc
ret
-; 1d35