pokecrystal/home/window.asm

98 lines
1.6 KiB
NASM
Raw Normal View History

2018-06-24 14:09:41 +00:00
RefreshScreen::
call ClearWindowData
ldh a, [hROMBank]
2013-09-19 01:40:48 +00:00
push af
ld a, BANK(ReanchorBGMap_NoOAMUpdate) ; aka BANK(LoadFonts_NoOAMUpdate)
2013-09-19 01:40:48 +00:00
rst Bankswitch
2016-05-05 02:34:09 +00:00
call ReanchorBGMap_NoOAMUpdate
call _OpenAndCloseMenu_HDMATransferTileMapAndAttrMap
call LoadFonts_NoOAMUpdate
2013-09-19 01:40:48 +00:00
pop af
rst Bankswitch
ret
2018-06-24 14:09:41 +00:00
CloseText::
ldh a, [hOAMUpdate]
2013-09-19 01:40:48 +00:00
push af
ld a, $1
ldh [hOAMUpdate], a
2015-10-24 14:34:19 +00:00
2015-12-09 23:25:44 +00:00
call .CloseText
2015-10-24 14:34:19 +00:00
2013-09-19 01:40:48 +00:00
pop af
ldh [hOAMUpdate], a
2018-01-23 22:39:09 +00:00
ld hl, wVramState
2013-09-19 01:40:48 +00:00
res 6, [hl]
ret
2018-06-24 14:09:41 +00:00
.CloseText:
call ClearWindowData
2013-09-19 01:40:48 +00:00
xor a
ldh [hBGMapMode], a
2015-11-11 19:12:46 +00:00
call OverworldTextModeSwitch
2016-05-05 02:34:09 +00:00
call _OpenAndCloseMenu_HDMATransferTileMapAndAttrMap
2013-09-19 01:40:48 +00:00
xor a
ldh [hBGMapMode], a
call SafeUpdateSprites
2013-09-19 01:40:48 +00:00
ld a, $90
ldh [hWY], a
2015-11-04 21:14:27 +00:00
call ReplaceKrisSprite
2017-12-24 17:47:30 +00:00
farcall ReturnFromMapSetupScript
farcall LoadOverworldFont
2013-09-19 01:40:48 +00:00
ret
2018-06-24 14:09:41 +00:00
OpenText::
call ClearWindowData
ldh a, [hROMBank]
2013-09-19 01:40:48 +00:00
push af
ld a, BANK(ReanchorBGMap_NoOAMUpdate) ; aka BANK(LoadFonts_NoOAMUpdate)
2013-09-19 01:40:48 +00:00
rst Bankswitch
2016-05-05 02:34:09 +00:00
call ReanchorBGMap_NoOAMUpdate ; clear bgmap
2013-09-19 01:40:48 +00:00
call SpeechTextBox
2016-05-05 02:34:09 +00:00
call _OpenAndCloseMenu_HDMATransferTileMapAndAttrMap ; anchor bgmap
call LoadFonts_NoOAMUpdate ; load font
2013-09-19 01:40:48 +00:00
pop af
rst Bankswitch
ret
2018-06-24 14:09:41 +00:00
_OpenAndCloseMenu_HDMATransferTileMapAndAttrMap::
ldh a, [hOAMUpdate]
2013-09-19 01:40:48 +00:00
push af
ld a, $1
ldh [hOAMUpdate], a
2017-12-24 17:47:30 +00:00
farcall OpenAndCloseMenu_HDMATransferTileMapAndAttrMap
2013-09-19 01:40:48 +00:00
pop af
ldh [hOAMUpdate], a
2013-09-19 01:40:48 +00:00
ret
2018-06-24 14:09:41 +00:00
SafeUpdateSprites::
ldh a, [hOAMUpdate]
2013-09-19 01:40:48 +00:00
push af
ldh a, [hBGMapMode]
2013-09-19 01:40:48 +00:00
push af
xor a
ldh [hBGMapMode], a
2013-09-19 01:40:48 +00:00
ld a, $1
ldh [hOAMUpdate], a
call UpdateSprites
2013-09-19 01:40:48 +00:00
xor a
ldh [hOAMUpdate], a
2013-09-19 01:40:48 +00:00
call DelayFrame
pop af
ldh [hBGMapMode], a
2013-09-19 01:40:48 +00:00
pop af
ldh [hOAMUpdate], a
2013-09-19 01:40:48 +00:00
ret
2016-05-10 16:59:34 +00:00
; unused
2016-05-10 16:59:34 +00:00
scf
ret