mirror of
https://gitlab.com/xCrystal/pokecrystal-board.git
synced 2024-11-16 11:27:33 -08:00
Load overworld font and frame via HDMA instead of copying to VRAM (#10)
This commit is contained in:
parent
db26480ffd
commit
c405c955ba
@ -88,32 +88,6 @@ OpenAndCloseMenu_HDMATransferTilemapAndAttrmap::
|
|||||||
ei
|
ei
|
||||||
ret
|
ret
|
||||||
|
|
||||||
Mobile_OpenAndCloseMenu_HDMATransferTilemapAndAttrmap:
|
|
||||||
ld hl, .Function
|
|
||||||
jp CallInSafeGFXMode
|
|
||||||
|
|
||||||
.Function:
|
|
||||||
; Transfer wAttrmap and Tilemap to BGMap
|
|
||||||
; Fill vBGAttrs with $00
|
|
||||||
; Fill vBGTiles with $ff
|
|
||||||
decoord 0, 0, wAttrmap
|
|
||||||
ld hl, wScratchAttrmap
|
|
||||||
call PadAttrmapForHDMATransfer
|
|
||||||
ld c, $ff
|
|
||||||
decoord 0, 0
|
|
||||||
ld hl, wScratchTilemap
|
|
||||||
call PadMapForHDMATransfer
|
|
||||||
|
|
||||||
ld a, $1
|
|
||||||
ldh [rVBK], a
|
|
||||||
ld hl, wScratchAttrmap
|
|
||||||
call HDMATransfer_Wait127Scanlines_toBGMap
|
|
||||||
ld a, $0
|
|
||||||
ldh [rVBK], a
|
|
||||||
ld hl, wScratchTilemap
|
|
||||||
call HDMATransfer_Wait127Scanlines_toBGMap
|
|
||||||
ret
|
|
||||||
|
|
||||||
CallInSafeGFXMode:
|
CallInSafeGFXMode:
|
||||||
ldh a, [hBGMapMode]
|
ldh a, [hBGMapMode]
|
||||||
push af
|
push af
|
||||||
|
@ -1,12 +1,16 @@
|
|||||||
_LoadOverworldFontAndFrame::
|
_LoadOverworldFontAndFrame::
|
||||||
ld de, .OverworldFontGFX
|
ld de, .OverworldFontGFX
|
||||||
ld hl, vTiles1
|
ld hl, vTiles1
|
||||||
lb bc, BANK(.OverworldFontGFX), 112
|
lb bc, BANK(.OverworldFontGFX), 64
|
||||||
call Get2bpp
|
call Get2bppViaHDMA
|
||||||
|
ld de, .OverworldFontGFX + 64 * LEN_2BPP_TILE
|
||||||
|
ld hl, vTiles1 tile $40
|
||||||
|
lb bc, BANK(.OverworldFontGFX), 56
|
||||||
|
call Get2bppViaHDMA
|
||||||
ld de, .OverworldFontSpaceGFX
|
ld de, .OverworldFontSpaceGFX
|
||||||
ld hl, vTiles2 tile " "
|
ld hl, vTiles2 tile " "
|
||||||
lb bc, BANK(.OverworldFontSpaceGFX), 1
|
lb bc, BANK(.OverworldFontSpaceGFX), 1
|
||||||
call Get2bpp
|
call Get2bppViaHDMA
|
||||||
ld a, [wEnvironment]
|
ld a, [wEnvironment]
|
||||||
maskbits NUM_ENVIRONMENTS
|
maskbits NUM_ENVIRONMENTS
|
||||||
ld bc, OW_TEXTBOX_FRAME_TILES * LEN_2BPP_TILE
|
ld bc, OW_TEXTBOX_FRAME_TILES * LEN_2BPP_TILE
|
||||||
@ -16,7 +20,7 @@ _LoadOverworldFontAndFrame::
|
|||||||
ld e, l
|
ld e, l
|
||||||
ld hl, vTiles0 tile "┌" ; $f0
|
ld hl, vTiles0 tile "┌" ; $f0
|
||||||
lb bc, BANK(.OverworldFrames), OW_TEXTBOX_FRAME_TILES
|
lb bc, BANK(.OverworldFrames), OW_TEXTBOX_FRAME_TILES
|
||||||
call Get2bpp
|
call Get2bppViaHDMA
|
||||||
ret
|
ret
|
||||||
|
|
||||||
.OverworldFontGFX:
|
.OverworldFontGFX:
|
||||||
|
@ -72,6 +72,21 @@ LoadFont_NoOAMUpdate::
|
|||||||
ldh [hOAMUpdate], a
|
ldh [hOAMUpdate], a
|
||||||
ret
|
ret
|
||||||
|
|
||||||
|
LoadOverworldFont_NoOAMUpdate::
|
||||||
|
ldh a, [hOAMUpdate]
|
||||||
|
push af
|
||||||
|
ld a, $1
|
||||||
|
ldh [hOAMUpdate], a
|
||||||
|
|
||||||
|
call LoadOverworldFontAndFrame
|
||||||
|
ld a, $90
|
||||||
|
ldh [hWY], a
|
||||||
|
call SafeUpdateSprites
|
||||||
|
|
||||||
|
pop af
|
||||||
|
ldh [hOAMUpdate], a
|
||||||
|
ret
|
||||||
|
|
||||||
HDMATransfer_FillBGMap0WithBlack:
|
HDMATransfer_FillBGMap0WithBlack:
|
||||||
ldh a, [rSVBK]
|
ldh a, [rSVBK]
|
||||||
push af
|
push af
|
||||||
|
@ -70,6 +70,7 @@ OpenText1bpp::
|
|||||||
call SpeechTextbox1bpp
|
call SpeechTextbox1bpp
|
||||||
call _OpenAndCloseMenu_HDMATransferTilemapAndAttrmap ; anchor bgmap
|
call _OpenAndCloseMenu_HDMATransferTilemapAndAttrmap ; anchor bgmap
|
||||||
call LoadFont_NoOAMUpdate ; load 1bpp font and frame, hide window
|
call LoadFont_NoOAMUpdate ; load 1bpp font and frame, hide window
|
||||||
|
|
||||||
pop af
|
pop af
|
||||||
rst Bankswitch
|
rst Bankswitch
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user