Overworld HUD implementation (#15)

This commit is contained in:
xCrystal
2023-08-29 18:33:20 +02:00
parent b275d642cd
commit f386a63cf8
21 changed files with 214 additions and 98 deletions

View File

@@ -126,7 +126,9 @@ EnterMap:
ld [wPoisonStepCount], a
.dontresetpoison
call EnableOverworldWindowHUD
call ConstructOverworldHUDTilemap
call TransferOverworldHUDToBGMap
call EnableOverworldHUD
xor a ; end map entry
ldh [hMapEntryMethod], a

View File

@@ -25,17 +25,20 @@ ReanchorBGMap_NoOAMUpdate::
xor a
ldh [hLCDCPointer], a
ldh [hBGMapMode], a
; prepare vBGMap1/vBGMap3 to be displayed while vBGMap0/vBGMap2 is reanchored.
; draw screen at wTilemap and wAttrmap and then transfer it.
ld a, $90
ldh [hWY], a
call LoadScreenTilemapAndAttrmapPals
call LoadWindowHUD
ld a, HIGH(vBGMap1)
call .LoadBGMapAddrIntoHRAM
call HDMATransferTilemapAndAttrmap_OpenAndCloseMenu
farcall ApplyPals
ld a, TRUE
ldh [hCGBPalUpdate], a
; display window while BG map is reanchored.
; disable LCD interrupt to prevent cropping the window due to hWindowHUD
; display window using vBGMap1/vBGMap3 while vBGMap0/vBGMap2 is reanchored.
; disable LCD interrupt to prevent cropping the window if window HUD is active
; (caller must re-enable when window is hidden again).
xor a
ldh [rSTAT], a

View File

@@ -33,4 +33,5 @@ _LoadScreenTilemap::
.carry
dec b
jr nz, .loop
ret

View File

@@ -1165,7 +1165,7 @@ Script_loadtrainer:
ret
Script_startbattle:
call DisableWindowHUD
call DisableOverworldHUD
call BufferScreen
predef StartBattle
ld a, [wBattleResult]

View File

@@ -1,5 +1,4 @@
HandleNewMap:
call ClearUnusedMapBuffer
call ResetMapBufferEventFlags
call ResetFlashIfOutOfCave
call GetCurrentMapSceneID