2018-06-24 07:09:41 -07:00
|
|
|
RefreshScreen::
|
2023-08-11 03:28:14 -07:00
|
|
|
call ClearMenuAndWindowData
|
2018-08-25 11:28:22 -07:00
|
|
|
ldh a, [hROMBank]
|
2013-09-18 18:40:48 -07:00
|
|
|
push af
|
2023-08-11 03:28:14 -07:00
|
|
|
ld a, BANK(ReanchorBGMap_NoOAMUpdate) ; aka BANK(LoadFont_NoOAMUpdate)
|
2013-09-18 18:40:48 -07:00
|
|
|
rst Bankswitch
|
|
|
|
|
2016-05-04 19:34:09 -07:00
|
|
|
call ReanchorBGMap_NoOAMUpdate
|
2023-08-28 04:30:13 -07:00
|
|
|
call HDMATransferTilemapAndAttrmap_OpenAndCloseMenu
|
2023-08-28 03:03:32 -07:00
|
|
|
call HideWindow_EnableLCDInt
|
2013-09-18 18:40:48 -07:00
|
|
|
|
|
|
|
pop af
|
|
|
|
rst Bankswitch
|
|
|
|
ret
|
|
|
|
|
2018-06-24 07:09:41 -07:00
|
|
|
CloseText::
|
2018-08-25 11:28:22 -07:00
|
|
|
ldh a, [hOAMUpdate]
|
2013-09-18 18:40:48 -07:00
|
|
|
push af
|
|
|
|
ld a, $1
|
2018-08-25 11:28:22 -07:00
|
|
|
ldh [hOAMUpdate], a
|
2015-10-24 07:34:19 -07:00
|
|
|
|
2023-08-11 03:28:14 -07:00
|
|
|
call ClearMenuAndWindowData
|
2013-09-18 18:40:48 -07:00
|
|
|
xor a
|
2018-08-25 11:28:22 -07:00
|
|
|
ldh [hBGMapMode], a
|
2023-08-28 04:30:13 -07:00
|
|
|
call LoadScreenTilemapAndAttrmapPals
|
|
|
|
call HDMATransferTilemapAndAttrmap_OpenAndCloseMenu
|
2013-09-18 18:40:48 -07:00
|
|
|
xor a
|
2018-08-25 11:28:22 -07:00
|
|
|
ldh [hBGMapMode], a
|
2016-05-10 09:31:49 -07:00
|
|
|
call SafeUpdateSprites
|
2013-09-18 18:40:48 -07:00
|
|
|
ld a, $90
|
2018-08-25 11:28:22 -07:00
|
|
|
ldh [hWY], a
|
2020-06-16 16:38:00 -07:00
|
|
|
call UpdatePlayerSprite
|
2023-07-31 10:30:40 -07:00
|
|
|
xor a
|
|
|
|
ldh [hBGMapMode], a
|
2023-08-11 03:28:14 -07:00
|
|
|
|
|
|
|
pop af
|
|
|
|
ldh [hOAMUpdate], a
|
|
|
|
ld hl, wVramState
|
|
|
|
res 6, [hl]
|
|
|
|
ret
|
|
|
|
|
|
|
|
OpenText2bpp::
|
|
|
|
call ClearMenuAndWindowData
|
|
|
|
ldh a, [hROMBank]
|
|
|
|
push af
|
|
|
|
ld a, BANK(ReanchorBGMap_NoOAMUpdate)
|
|
|
|
rst Bankswitch
|
|
|
|
|
2023-08-31 09:41:05 -07:00
|
|
|
ld hl, wTextboxFlags
|
|
|
|
set TEXT_2BPP_F, [hl]
|
|
|
|
|
2023-08-28 04:30:13 -07:00
|
|
|
; assumes that the overworld 2bpp font and frame are loaded when calling this
|
|
|
|
call ReanchorBGMap_NoOAMUpdate ; anchor bgmap
|
2023-08-11 03:28:14 -07:00
|
|
|
call SpeechTextbox2bpp
|
2023-08-28 04:30:13 -07:00
|
|
|
call HDMATransferTilemapAndAttrmap_OpenAndCloseMenu ; transfer bgmap
|
2023-08-28 03:03:32 -07:00
|
|
|
call HideWindow_EnableLCDInt
|
2023-08-11 03:28:14 -07:00
|
|
|
|
|
|
|
pop af
|
|
|
|
rst Bankswitch
|
|
|
|
|
2013-09-18 18:40:48 -07:00
|
|
|
ret
|
|
|
|
|
2023-08-11 03:28:14 -07:00
|
|
|
OpenText1bpp::
|
|
|
|
call ClearMenuAndWindowData
|
2018-08-25 11:28:22 -07:00
|
|
|
ldh a, [hROMBank]
|
2013-09-18 18:40:48 -07:00
|
|
|
push af
|
2023-08-11 03:28:14 -07:00
|
|
|
ld a, BANK(ReanchorBGMap_NoOAMUpdate) ; aka BANK(LoadFont_NoOAMUpdate)
|
2013-09-18 18:40:48 -07:00
|
|
|
rst Bankswitch
|
|
|
|
|
2023-08-31 10:27:39 -07:00
|
|
|
; note: 1bpp text is NOT compatible with the overworld HUD enabled because it uses 2bpp font tiles.
|
2023-08-31 09:41:05 -07:00
|
|
|
ld hl, wTextboxFlags
|
|
|
|
res TEXT_2BPP_F, [hl]
|
|
|
|
|
2023-08-28 04:30:13 -07:00
|
|
|
call ReanchorBGMap_NoOAMUpdate ; anchor bgmap
|
2023-08-11 03:28:14 -07:00
|
|
|
call SpeechTextbox1bpp
|
2023-08-28 04:30:13 -07:00
|
|
|
call HDMATransferTilemapAndAttrmap_OpenAndCloseMenu ; transfer bgmap
|
2023-08-11 03:28:14 -07:00
|
|
|
call LoadFont_NoOAMUpdate ; load 1bpp font and frame, hide window
|
2023-08-12 12:14:46 -07:00
|
|
|
|
2013-09-18 18:40:48 -07:00
|
|
|
pop af
|
|
|
|
rst Bankswitch
|
|
|
|
|
|
|
|
ret
|
|
|
|
|
2023-08-28 04:30:13 -07:00
|
|
|
HDMATransferTilemapAndAttrmap_OpenAndCloseMenu::
|
2018-08-25 11:28:22 -07:00
|
|
|
ldh a, [hOAMUpdate]
|
2013-09-18 18:40:48 -07:00
|
|
|
push af
|
|
|
|
ld a, $1
|
2018-08-25 11:28:22 -07:00
|
|
|
ldh [hOAMUpdate], a
|
2015-10-17 17:49:34 -07:00
|
|
|
|
2023-08-28 04:30:13 -07:00
|
|
|
farcall _HDMATransferTilemapAndAttrmap_OpenAndCloseMenu
|
2015-10-17 17:49:34 -07:00
|
|
|
|
2013-09-18 18:40:48 -07:00
|
|
|
pop af
|
2018-08-25 11:28:22 -07:00
|
|
|
ldh [hOAMUpdate], a
|
2013-09-18 18:40:48 -07:00
|
|
|
ret
|
|
|
|
|
2018-06-24 07:09:41 -07:00
|
|
|
SafeUpdateSprites::
|
2018-08-25 11:28:22 -07:00
|
|
|
ldh a, [hOAMUpdate]
|
2013-09-18 18:40:48 -07:00
|
|
|
push af
|
2018-08-25 11:28:22 -07:00
|
|
|
ldh a, [hBGMapMode]
|
2013-09-18 18:40:48 -07:00
|
|
|
push af
|
|
|
|
xor a
|
2018-08-25 11:28:22 -07:00
|
|
|
ldh [hBGMapMode], a
|
2013-09-18 18:40:48 -07:00
|
|
|
ld a, $1
|
2018-08-25 11:28:22 -07:00
|
|
|
ldh [hOAMUpdate], a
|
2016-05-10 09:31:49 -07:00
|
|
|
|
2015-07-22 12:57:02 -07:00
|
|
|
call UpdateSprites
|
2016-05-10 09:31:49 -07:00
|
|
|
|
2013-09-18 18:40:48 -07:00
|
|
|
xor a
|
2018-08-25 11:28:22 -07:00
|
|
|
ldh [hOAMUpdate], a
|
2013-09-18 18:40:48 -07:00
|
|
|
call DelayFrame
|
|
|
|
pop af
|
2018-08-25 11:28:22 -07:00
|
|
|
ldh [hBGMapMode], a
|
2013-09-18 18:40:48 -07:00
|
|
|
pop af
|
2018-08-25 11:28:22 -07:00
|
|
|
ldh [hOAMUpdate], a
|
2013-09-18 18:40:48 -07:00
|
|
|
ret
|
2023-08-27 10:18:52 -07:00
|
|
|
|
2023-08-28 03:03:32 -07:00
|
|
|
HideWindow_EnableLCDInt::
|
|
|
|
ld a, $90
|
|
|
|
ldh [hWY], a
|
2023-08-29 09:33:20 -07:00
|
|
|
ldh a, [hWindowHUDLY]
|
2023-08-28 03:03:32 -07:00
|
|
|
and a
|
|
|
|
ld a, 1 << rSTAT_INT_HBLANK
|
|
|
|
jr z, .ok
|
|
|
|
ld a, 1 << rSTAT_INT_LYC
|
|
|
|
.ok
|
|
|
|
ldh [rSTAT], a
|
|
|
|
ret
|