pokecrystal-board/engine/events/buena_menu.asm
Rangi eb1e3636bb Use labels instead of constants for HRAM
Use explicit ldh instruction to access HRAM locations, don't rely on optimizing ld
2018-08-25 14:28:22 -04:00

59 lines
780 B
NASM

AskRememberPassword:
call .DoMenu
ld a, $0
jr c, .okay
ld a, $1
.okay
ld [wScriptVar], a
ret
.DoMenu:
lb bc, 14, 7
push bc
ld hl, YesNoMenuHeader
call CopyMenuHeader
pop bc
ld a, b
ld [wMenuBorderLeftCoord], a
add $5
ld [wMenuBorderRightCoord], a
ld a, c
ld [wMenuBorderTopCoord], a
add $4
ld [wMenuBorderBottomCoord], a
call PushWindow
call VerticalMenu
push af
ld c, 15
call DelayFrames
call Buena_ExitMenu
pop af
jr c, .refused
ld a, [wMenuCursorY]
cp $2
jr z, .refused
and a
ret
.refused
ld a, $2
ld [wMenuCursorY], a
scf
ret
Buena_ExitMenu:
ldh a, [hOAMUpdate]
push af
call ExitMenu
call UpdateSprites
xor a
ldh [hOAMUpdate], a
call DelayFrame
ld a, $1
ldh [hOAMUpdate], a
call ApplyTilemap
pop af
ldh [hOAMUpdate], a
ret