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