pokecrystal-board/home/window.asm

98 lines
1.6 KiB
NASM
Raw Normal View History

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