2017-12-15 17:10:54 -08:00
|
|
|
ReanchorBGMap_NoOAMUpdate:: ; 6454
|
|
|
|
call DelayFrame
|
|
|
|
ld a, [hOAMUpdate]
|
|
|
|
push af
|
|
|
|
|
|
|
|
ld a, $1
|
|
|
|
ld [hOAMUpdate], a
|
|
|
|
ld a, [hBGMapMode]
|
|
|
|
push af
|
|
|
|
xor a
|
|
|
|
ld [hBGMapMode], a
|
|
|
|
|
|
|
|
call .ReanchorBGMap
|
|
|
|
|
|
|
|
pop af
|
|
|
|
ld [hBGMapMode], a
|
|
|
|
pop af
|
|
|
|
ld [hOAMUpdate], a
|
2018-01-23 14:39:09 -08:00
|
|
|
ld hl, wVramState
|
2017-12-15 17:10:54 -08:00
|
|
|
set 6, [hl]
|
|
|
|
ret
|
|
|
|
|
|
|
|
.ReanchorBGMap:
|
|
|
|
xor a
|
|
|
|
ld [hLCDCPointer], a
|
|
|
|
ld [hBGMapMode], a
|
|
|
|
ld a, $90
|
|
|
|
ld [hWY], a
|
|
|
|
call OverworldTextModeSwitch
|
2017-12-28 04:32:33 -08:00
|
|
|
ld a, HIGH(vBGMap1)
|
2017-12-15 17:10:54 -08:00
|
|
|
call .LoadBGMapAddrIntoHRAM
|
|
|
|
call _OpenAndCloseMenu_HDMATransferTileMapAndAttrMap
|
2017-12-24 09:47:30 -08:00
|
|
|
farcall LoadOW_BGPal7
|
|
|
|
farcall ApplyPals
|
2017-12-15 17:10:54 -08:00
|
|
|
ld a, $1
|
|
|
|
ld [hCGBPalUpdate], a
|
|
|
|
xor a
|
|
|
|
ld [hBGMapMode], a
|
|
|
|
ld [hWY], a
|
2017-12-24 09:47:30 -08:00
|
|
|
farcall HDMATransfer_FillBGMap0WithBlack ; no need to farcall
|
2017-12-28 04:32:33 -08:00
|
|
|
ld a, HIGH(vBGMap0)
|
2017-12-15 17:10:54 -08:00
|
|
|
call .LoadBGMapAddrIntoHRAM
|
2017-12-28 04:32:33 -08:00
|
|
|
xor a ; LOW(vBGMap0)
|
2017-12-15 17:10:54 -08:00
|
|
|
ld [wBGMapAnchor], a
|
2017-12-28 04:32:33 -08:00
|
|
|
ld a, HIGH(vBGMap0)
|
2017-12-15 17:10:54 -08:00
|
|
|
ld [wBGMapAnchor + 1], a
|
|
|
|
xor a
|
|
|
|
ld [hSCX], a
|
|
|
|
ld [hSCY], a
|
|
|
|
call ApplyBGMapAnchorToObjects
|
|
|
|
ret
|
|
|
|
|
|
|
|
.LoadBGMapAddrIntoHRAM: ; 64b9
|
|
|
|
ld [hBGMapAddress + 1], a
|
|
|
|
xor a
|
|
|
|
ld [hBGMapAddress], a
|
|
|
|
ret
|
|
|
|
|
|
|
|
LoadFonts_NoOAMUpdate:: ; 64bf
|
|
|
|
ld a, [hOAMUpdate]
|
|
|
|
push af
|
|
|
|
ld a, $1
|
|
|
|
ld [hOAMUpdate], a
|
|
|
|
|
|
|
|
call .LoadGFX
|
|
|
|
|
|
|
|
pop af
|
|
|
|
ld [hOAMUpdate], a
|
|
|
|
ret
|
|
|
|
|
|
|
|
.LoadGFX:
|
|
|
|
call LoadFontsExtra
|
|
|
|
ld a, $90
|
|
|
|
ld [hWY], a
|
|
|
|
call SafeUpdateSprites
|
|
|
|
call LoadStandardFont
|
|
|
|
ret
|
|
|
|
|
|
|
|
HDMATransfer_FillBGMap0WithBlack: ; 64db
|
|
|
|
ld a, [rSVBK]
|
|
|
|
push af
|
2018-01-03 16:12:45 -08:00
|
|
|
ld a, BANK(wDecompressScratch)
|
2017-12-15 17:10:54 -08:00
|
|
|
ld [rSVBK], a
|
|
|
|
|
2018-01-18 23:30:19 -08:00
|
|
|
ld a, "■"
|
2017-12-15 17:10:54 -08:00
|
|
|
ld hl, wDecompressScratch
|
|
|
|
ld bc, wScratchAttrMap - wDecompressScratch
|
|
|
|
call ByteFill
|
2017-12-25 10:40:10 -08:00
|
|
|
ld a, HIGH(wDecompressScratch)
|
2017-12-15 17:10:54 -08:00
|
|
|
ld [rHDMA1], a
|
2017-12-25 10:40:10 -08:00
|
|
|
ld a, LOW(wDecompressScratch)
|
2017-12-15 17:10:54 -08:00
|
|
|
ld [rHDMA2], a
|
2017-12-28 04:32:33 -08:00
|
|
|
ld a, HIGH(vBGMap0 % $8000)
|
2017-12-15 17:10:54 -08:00
|
|
|
ld [rHDMA3], a
|
2017-12-28 04:32:33 -08:00
|
|
|
ld a, LOW(vBGMap0 % $8000)
|
2017-12-15 17:10:54 -08:00
|
|
|
ld [rHDMA4], a
|
|
|
|
ld a, $3f
|
|
|
|
ld [hDMATransfer], a
|
|
|
|
call DelayFrame
|
|
|
|
|
|
|
|
pop af
|
|
|
|
ld [rSVBK], a
|
|
|
|
ret
|