mirror of
https://gitlab.com/xCrystal/pokecrystal-board.git
synced 2024-11-16 11:27:33 -08:00
Tinker with overworld HUD implementation in f386a63cf8
(#15)
This commit is contained in:
parent
236519fc55
commit
9f835560d7
@ -52,12 +52,13 @@
|
||||
|
||||
#### HUD
|
||||
|
||||
- **EnableWindowHUD**: Configure LCD interrupt in LYC=LY mode with corresponding LYC
|
||||
- **EnableWindowHUD**: Configure LCD interrupt in LYC=LY mode with corresponding LYC.
|
||||
- **DisableWindowHUD**: Configure LCD interrupt in hblank mode
|
||||
- **LoadHUD**: Load the HUD at wWhichHUD to the top of wTilemap and wAttrmap
|
||||
- **LoadWindowHUD**: Like LoadHUD, but for HUDs that require a Window overlay. Only does anything if hWindowHUDLY is non-0
|
||||
- **ConstructOverworldHUDTilemap**: Draw the overworld HUD's tilemap into wOverworldHUDTiles
|
||||
- **TransferOverworldHUDToBGMap**: Transfer overworld HUD to vBGMap1/vBGMap3 during v/hblank(s). Tilemap is read from wOverworldHUDTiles, attrmap is all PAL_BG_TEXT | PRIORITY.
|
||||
- **RefreshOverworldHUD**: ConstructOverworldHUDTilemap + TransferOverworldHUDToBGMap
|
||||
|
||||
### Scripts
|
||||
|
||||
|
@ -27,3 +27,15 @@ _LoadOverworldHUDAttrmap:
|
||||
ld bc, SCREEN_WIDTH
|
||||
ld a, PAL_BG_TEXT | PRIORITY
|
||||
jp ByteFill
|
||||
|
||||
_ConstructOverworldHUDTilemap::
|
||||
ld hl, .Tilemap
|
||||
ld de, wOverworldHUDTiles
|
||||
ld bc, .TilemapEnd - .Tilemap ; SCREEN_WIDTH
|
||||
call CopyBytes
|
||||
ret
|
||||
|
||||
.Tilemap:
|
||||
db "▶- ▶- ▶ ▶ "
|
||||
.TilemapEnd:
|
||||
assert .TilemapEnd - .Tilemap == wOverworldHUDTilesEnd - wOverworldHUDTiles
|
||||
|
@ -127,7 +127,6 @@ EnterMap:
|
||||
.dontresetpoison
|
||||
|
||||
call ConstructOverworldHUDTilemap
|
||||
call TransferOverworldHUDToBGMap
|
||||
call EnableOverworldHUD
|
||||
|
||||
xor a ; end map entry
|
||||
|
17
home/hud.asm
17
home/hud.asm
@ -3,10 +3,11 @@ OVERWORLD_HUD_HEIGHT EQU 8
|
||||
EnableOverworldHUD::
|
||||
ld a, HUD_OVERWORLD
|
||||
ld [wWhichHUD], a
|
||||
call TransferOverworldHUDToBGMap
|
||||
ld a, OVERWORLD_HUD_HEIGHT - 1
|
||||
; fallthrough
|
||||
|
||||
EnableWindowHUD:
|
||||
EnableWindowHUD::
|
||||
ldh [hWindowHUDLY], a
|
||||
; configure LCD interrupt
|
||||
ldh [rLYC], a
|
||||
@ -54,18 +55,14 @@ LoadHUD::
|
||||
|
||||
ConstructOverworldHUDTilemap::
|
||||
; draw the overworld HUD's tilemap into wOverworldHUDTiles
|
||||
ld hl, .Tilemap
|
||||
ld de, wOverworldHUDTiles
|
||||
ld bc, .TilemapEnd - .Tilemap ; SCREEN_WIDTH
|
||||
call CopyBytes
|
||||
farcall _ConstructOverworldHUDTilemap
|
||||
ret
|
||||
|
||||
.Tilemap:
|
||||
db "▶- ▶- ▶ ▶ "
|
||||
.TilemapEnd:
|
||||
assert .TilemapEnd - .Tilemap == wOverworldHUDTilesEnd - wOverworldHUDTiles
|
||||
RefreshOverworldHUD::
|
||||
call ConstructOverworldHUDTilemap
|
||||
; fallthrough
|
||||
|
||||
TransferOverworldHUDToBGMap::
|
||||
TransferOverworldHUDToBGMap:
|
||||
; transfer overworld HUD to vBGMap1/vBGMap3 during v/hblank(s)
|
||||
; tilemap is read from wOverworldHUDTiles, attrmap is all PAL_BG_TEXT | PRIORITY
|
||||
ldh a, [rVBK]
|
||||
|
Loading…
Reference in New Issue
Block a user