You've already forked pokecrystal-board
mirror of
https://gitlab.com/xCrystal/pokecrystal-board.git
synced 2025-09-08 08:13:02 -07:00
Overworld HUD implementation (#15)
This commit is contained in:
@@ -41,12 +41,12 @@ HDMATransferTilemapAndAttrmap_OverworldEffect::
|
||||
call PadTilemapForHDMATransfer
|
||||
call DelayFrame
|
||||
|
||||
ldh a, [hWindowHUD]
|
||||
ldh a, [hWindowHUDLY]
|
||||
and a
|
||||
jr z, .go
|
||||
; wait until LCD interrupt has ocurred this frame ([rLY] - [hWindowHUD] >= 0)
|
||||
; wait until LCD interrupt has ocurred this frame ([rLY] - [hWindowHUDLY] >= 0)
|
||||
.wait_lcd
|
||||
; ldh a, [hWindowHUD]
|
||||
; ldh a, [hWindowHUDLY]
|
||||
ld b, a
|
||||
ldh a, [rLY]
|
||||
sub b
|
||||
@@ -86,12 +86,12 @@ _HDMATransferTilemapAndAttrmap_OpenAndCloseMenu::
|
||||
call PadTilemapForHDMATransfer
|
||||
call DelayFrame
|
||||
|
||||
ldh a, [hWindowHUD]
|
||||
ldh a, [hWindowHUDLY]
|
||||
and a
|
||||
jr z, .go
|
||||
; wait until LCD interrupt has ocurred this frame ([rLY] - [hWindowHUD] >= 0)
|
||||
; wait until LCD interrupt has ocurred this frame ([rLY] - [hWindowHUDLY] >= 0)
|
||||
.wait_lcd
|
||||
; ldh a, [hWindowHUD]
|
||||
; ldh a, [hWindowHUDLY]
|
||||
ld b, a
|
||||
ldh a, [rLY]
|
||||
sub b
|
||||
@@ -276,12 +276,12 @@ _continue_HDMATransfer:
|
||||
cp d
|
||||
jr nc, .ly_loop
|
||||
|
||||
ldh a, [hWindowHUD]
|
||||
ldh a, [hWindowHUDLY]
|
||||
and a
|
||||
jr z, .go
|
||||
; wait until LCD interrupt has ocurred this frame ([rLY] - [hWindowHUD] >= 0)
|
||||
; wait until LCD interrupt has ocurred this frame ([rLY] - [hWindowHUDLY] >= 0)
|
||||
.wait_lcd
|
||||
; ldh a, [hWindowHUD]
|
||||
; ldh a, [hWindowHUDLY]
|
||||
ld b, a
|
||||
ldh a, [rLY]
|
||||
sub b
|
||||
|
||||
29
engine/gfx/hud.asm
Executable file
29
engine/gfx/hud.asm
Executable file
@@ -0,0 +1,29 @@
|
||||
_LoadHUD::
|
||||
jumptable .Jumptable, wWhichHUD
|
||||
|
||||
.Jumptable:
|
||||
; entries correspond to HUD_* constants (see constants/gfx_constants.asm)
|
||||
table_width 2, _LoadHUD.Jumptable
|
||||
dw .None
|
||||
dw _LoadOverworldHUDTilemapAndAttrmap
|
||||
assert_table_length NUM_HUD_TYPES + 1
|
||||
|
||||
.None:
|
||||
ret
|
||||
|
||||
_LoadOverworldHUDTilemapAndAttrmap:
|
||||
call _LoadOverworldHUDAttrmap
|
||||
; fallthrough
|
||||
|
||||
_LoadOverworldHUDTilemap:
|
||||
; overworld HUD reads SCREEN_WIDTH tiles from wOverworldHUDTiles
|
||||
ld hl, wOverworldHUDTiles
|
||||
decoord 0, 0, wTilemap
|
||||
ld bc, wOverworldHUDTilesEnd - wOverworldHUDTiles ; SCREEN_WIDTH
|
||||
jp CopyBytes
|
||||
|
||||
_LoadOverworldHUDAttrmap:
|
||||
hlcoord 0, 0, wAttrmap
|
||||
ld bc, SCREEN_WIDTH
|
||||
ld a, PAL_BG_TEXT | PRIORITY
|
||||
jp ByteFill
|
||||
Reference in New Issue
Block a user