You've already forked pokecrystal-board
mirror of
https://gitlab.com/xCrystal/pokecrystal-board.git
synced 2025-04-09 05:44:44 -07:00
Don't hide sprites behind a 2BPP textbox if they are partially outside of it, and make 2BPP textboxes have priority over objects (#7); Generalize 1bpp/2bpp text state tracking (#10) [reworks 052d246e
]
This commit is contained in:
@@ -209,8 +209,8 @@ MenuBox::
|
||||
call GetMenuBoxDims
|
||||
dec b
|
||||
dec c
|
||||
ld a, [wMenuBoxUse2bppFrame]
|
||||
and a
|
||||
ld a, [wTextboxFlags]
|
||||
bit TEXT_2BPP_F, a
|
||||
jp z, Textbox1bpp
|
||||
ld d, h
|
||||
ld e, l
|
||||
|
@@ -72,7 +72,7 @@ Textbox1bpp::
|
||||
call TextboxBorder
|
||||
pop hl
|
||||
pop bc
|
||||
jr TextboxPalette
|
||||
jr TextboxAttributes1bpp
|
||||
|
||||
TextboxBorder::
|
||||
; Top
|
||||
@@ -120,15 +120,23 @@ TextboxBorder::
|
||||
jr nz, .loop
|
||||
ret
|
||||
|
||||
TextboxPalette::
|
||||
; Fill text box width c height b at hl with pal 7
|
||||
TextboxAttributes1bpp::
|
||||
; Fill text box width c height b at hl with PAL_BG_TEXT
|
||||
ld a, PAL_BG_TEXT
|
||||
jr _TextboxAttributes
|
||||
|
||||
TextboxAttributes2bpp::
|
||||
; Fill text box width c height b at hl with PAL_BG_TEXT | PRIORITY
|
||||
ld a, PAL_BG_TEXT | PRIORITY
|
||||
; fallthrough
|
||||
|
||||
_TextboxAttributes:
|
||||
ld de, wAttrmap - wTilemap
|
||||
add hl, de
|
||||
inc b
|
||||
inc b
|
||||
inc c
|
||||
inc c
|
||||
ld a, PAL_BG_TEXT
|
||||
.col
|
||||
push bc
|
||||
push hl
|
||||
@@ -155,7 +163,7 @@ Textbox2bpp::
|
||||
farcall _OverworldTextbox
|
||||
pop hl
|
||||
pop bc
|
||||
jp TextboxPalette
|
||||
jp TextboxAttributes2bpp
|
||||
|
||||
RadioTerminator::
|
||||
ld hl, .stop
|
||||
|
@@ -46,6 +46,9 @@ OpenText2bpp::
|
||||
ld a, BANK(ReanchorBGMap_NoOAMUpdate)
|
||||
rst Bankswitch
|
||||
|
||||
ld hl, wTextboxFlags
|
||||
set TEXT_2BPP_F, [hl]
|
||||
|
||||
; assumes that the overworld 2bpp font and frame are loaded when calling this
|
||||
call ReanchorBGMap_NoOAMUpdate ; anchor bgmap
|
||||
call SpeechTextbox2bpp
|
||||
@@ -64,6 +67,9 @@ OpenText1bpp::
|
||||
ld a, BANK(ReanchorBGMap_NoOAMUpdate) ; aka BANK(LoadFont_NoOAMUpdate)
|
||||
rst Bankswitch
|
||||
|
||||
ld hl, wTextboxFlags
|
||||
res TEXT_2BPP_F, [hl]
|
||||
|
||||
call ReanchorBGMap_NoOAMUpdate ; anchor bgmap
|
||||
call SpeechTextbox1bpp
|
||||
call HDMATransferTilemapAndAttrmap_OpenAndCloseMenu ; transfer bgmap
|
||||
|
Reference in New Issue
Block a user