mirror of
https://gitlab.com/xCrystal/pokecrystal-board.git
synced 2024-09-09 09:51:34 -07:00
Window HUD: Handle Window being fully shown during reanchor map (#15)
This commit is contained in:
parent
6e49bb9893
commit
11db1300b2
@ -70,8 +70,7 @@ DoBattleTransition:
|
|||||||
call DelayFrame
|
call DelayFrame
|
||||||
call .LoadPokeballTiles
|
call .LoadPokeballTiles
|
||||||
call CopyTilemapAtOnce
|
call CopyTilemapAtOnce
|
||||||
ld a, SCREEN_HEIGHT_PX
|
call HideWindow_EnableLCDInt
|
||||||
ldh [hWY], a
|
|
||||||
call DelayFrame
|
call DelayFrame
|
||||||
xor a
|
xor a
|
||||||
ldh [hBGMapMode], a
|
ldh [hBGMapMode], a
|
||||||
|
@ -34,7 +34,11 @@ ReanchorBGMap_NoOAMUpdate::
|
|||||||
farcall ApplyPals
|
farcall ApplyPals
|
||||||
ld a, TRUE
|
ld a, TRUE
|
||||||
ldh [hCGBPalUpdate], a
|
ldh [hCGBPalUpdate], a
|
||||||
|
; display window while BG map is reanchored.
|
||||||
|
; disable LCD interrupt to prevent cropping the window due to hWindowHUD
|
||||||
|
; (caller must re-enable when window is hidden again).
|
||||||
xor a
|
xor a
|
||||||
|
ldh [rSTAT], a
|
||||||
ldh [hBGMapMode], a
|
ldh [hBGMapMode], a
|
||||||
ldh [hWY], a
|
ldh [hWY], a
|
||||||
farcall HDMATransfer_FillBGMap0WithBlack ; no need to farcall
|
farcall HDMATransfer_FillBGMap0WithBlack ; no need to farcall
|
||||||
@ -63,8 +67,7 @@ LoadFont_NoOAMUpdate::
|
|||||||
ldh [hOAMUpdate], a
|
ldh [hOAMUpdate], a
|
||||||
|
|
||||||
call LoadFrame
|
call LoadFrame
|
||||||
ld a, $90
|
call HideWindow_EnableLCDInt
|
||||||
ldh [hWY], a
|
|
||||||
call SafeUpdateSprites
|
call SafeUpdateSprites
|
||||||
call LoadStandardFont
|
call LoadStandardFont
|
||||||
|
|
||||||
|
@ -7,8 +7,7 @@ RefreshScreen::
|
|||||||
|
|
||||||
call ReanchorBGMap_NoOAMUpdate
|
call ReanchorBGMap_NoOAMUpdate
|
||||||
call _OpenAndCloseMenu_HDMATransferTilemapAndAttrmap
|
call _OpenAndCloseMenu_HDMATransferTilemapAndAttrmap
|
||||||
ld a, $90
|
call HideWindow_EnableLCDInt
|
||||||
ldh [hWY], a
|
|
||||||
|
|
||||||
pop af
|
pop af
|
||||||
rst Bankswitch
|
rst Bankswitch
|
||||||
@ -51,8 +50,7 @@ OpenText2bpp::
|
|||||||
call ReanchorBGMap_NoOAMUpdate ; clear bgmap
|
call ReanchorBGMap_NoOAMUpdate ; clear bgmap
|
||||||
call SpeechTextbox2bpp
|
call SpeechTextbox2bpp
|
||||||
call _OpenAndCloseMenu_HDMATransferTilemapAndAttrmap ; anchor bgmap
|
call _OpenAndCloseMenu_HDMATransferTilemapAndAttrmap ; anchor bgmap
|
||||||
ld a, $90
|
call HideWindow_EnableLCDInt
|
||||||
ldh [hWY], a
|
|
||||||
|
|
||||||
pop af
|
pop af
|
||||||
rst Bankswitch
|
rst Bankswitch
|
||||||
@ -109,6 +107,18 @@ SafeUpdateSprites::
|
|||||||
ldh [hOAMUpdate], a
|
ldh [hOAMUpdate], a
|
||||||
ret
|
ret
|
||||||
|
|
||||||
|
HideWindow_EnableLCDInt::
|
||||||
|
ld a, $90
|
||||||
|
ldh [hWY], a
|
||||||
|
ldh a, [hWindowHUD]
|
||||||
|
and a
|
||||||
|
ld a, 1 << rSTAT_INT_HBLANK
|
||||||
|
jr z, .ok
|
||||||
|
ld a, 1 << rSTAT_INT_LYC
|
||||||
|
.ok
|
||||||
|
ldh [rSTAT], a
|
||||||
|
ret
|
||||||
|
|
||||||
OVERWORLD_HUD_HEIGHT EQU 8
|
OVERWORLD_HUD_HEIGHT EQU 8
|
||||||
|
|
||||||
EnableOverworldWindowHUD::
|
EnableOverworldWindowHUD::
|
||||||
@ -119,11 +129,12 @@ EnableWindowHUD:
|
|||||||
ldh [hWindowHUD], a
|
ldh [hWindowHUD], a
|
||||||
; configure LCD interrupt
|
; configure LCD interrupt
|
||||||
ldh [rLYC], a
|
ldh [rLYC], a
|
||||||
ld a, 1 << rSTAT_INT_LYC ; LYC=LC
|
|
||||||
ldh [rSTAT], a
|
|
||||||
; make window hidden this frame to prevent graphical glitches
|
; make window hidden this frame to prevent graphical glitches
|
||||||
ld a, $90
|
ld a, $90
|
||||||
ldh [hWY], a
|
ldh [hWY], a
|
||||||
|
; configure LCD interrupt
|
||||||
|
ld a, 1 << rSTAT_INT_LYC ; LYC=LC
|
||||||
|
ldh [rSTAT], a
|
||||||
ret
|
ret
|
||||||
|
|
||||||
DisableWindowHUD::
|
DisableWindowHUD::
|
||||||
|
Loading…
Reference in New Issue
Block a user