pokecrystal/engine/overworld/init_map.asm

105 lines
1.7 KiB
NASM
Raw Normal View History

2018-06-24 14:09:41 +00:00
ReanchorBGMap_NoOAMUpdate::
call DelayFrame
ldh a, [hOAMUpdate]
push af
ld a, $1
ldh [hOAMUpdate], a
ldh a, [hBGMapMode]
push af
xor a
ldh [hBGMapMode], a
call .ReanchorBGMap
pop af
ldh [hBGMapMode], a
pop af
ldh [hOAMUpdate], a
2018-01-23 22:39:09 +00:00
ld hl, wVramState
set 6, [hl]
ret
.ReanchorBGMap:
xor a
ldh [hLCDCPointer], a
ldh [hBGMapMode], a
ld a, $90
ldh [hWY], a
call OverworldTextModeSwitch
2017-12-28 12:32:33 +00:00
ld a, HIGH(vBGMap1)
call .LoadBGMapAddrIntoHRAM
call _OpenAndCloseMenu_HDMATransferTilemapAndAttrmap
2017-12-24 17:47:30 +00:00
farcall LoadOW_BGPal7
farcall ApplyPals
ld a, $1
ldh [hCGBPalUpdate], a
xor a
ldh [hBGMapMode], a
ldh [hWY], a
2017-12-24 17:47:30 +00:00
farcall HDMATransfer_FillBGMap0WithBlack ; no need to farcall
2017-12-28 12:32:33 +00:00
ld a, HIGH(vBGMap0)
call .LoadBGMapAddrIntoHRAM
2017-12-28 12:32:33 +00:00
xor a ; LOW(vBGMap0)
ld [wBGMapAnchor], a
2017-12-28 12:32:33 +00:00
ld a, HIGH(vBGMap0)
ld [wBGMapAnchor + 1], a
xor a
ldh [hSCX], a
ldh [hSCY], a
call ApplyBGMapAnchorToObjects
ret
2018-06-24 14:09:41 +00:00
.LoadBGMapAddrIntoHRAM:
ldh [hBGMapAddress + 1], a
xor a
ldh [hBGMapAddress], a
ret
2018-06-24 14:09:41 +00:00
LoadFonts_NoOAMUpdate::
ldh a, [hOAMUpdate]
push af
ld a, $1
ldh [hOAMUpdate], a
call .LoadGFX
pop af
ldh [hOAMUpdate], a
ret
.LoadGFX:
call LoadFontsExtra
ld a, $90
ldh [hWY], a
call SafeUpdateSprites
call LoadStandardFont
ret
2018-06-24 14:09:41 +00:00
HDMATransfer_FillBGMap0WithBlack:
ldh a, [rSVBK]
push af
ld a, BANK(wDecompressScratch)
ldh [rSVBK], a
2018-01-19 07:30:19 +00:00
ld a, "■"
ld hl, wDecompressScratch
ld bc, wScratchAttrmap - wDecompressScratch
call ByteFill
ld a, HIGH(wDecompressScratch)
ldh [rHDMA1], a
ld a, LOW(wDecompressScratch)
ldh [rHDMA2], a
2019-02-16 18:04:08 +00:00
ld a, HIGH(vBGMap0 - VRAM_Begin)
ldh [rHDMA3], a
2019-02-16 18:04:08 +00:00
ld a, LOW(vBGMap0 - VRAM_Begin)
ldh [rHDMA4], a
ld a, $3f
ldh [hDMATransfer], a
call DelayFrame
pop af
ldh [rSVBK], a
ret