2020-02-13 09:30:13 -08:00
|
|
|
LoadTilemapToTempTilemap::
|
|
|
|
; Load wTilemap into wTempTilemap
|
2018-08-25 11:28:22 -07:00
|
|
|
ldh a, [rSVBK]
|
2018-04-04 21:35:14 -07:00
|
|
|
push af
|
2020-02-13 09:30:13 -08:00
|
|
|
ld a, BANK(wTempTilemap)
|
2018-08-25 11:28:22 -07:00
|
|
|
ldh [rSVBK], a
|
2018-04-04 21:35:14 -07:00
|
|
|
hlcoord 0, 0
|
2020-02-13 09:30:13 -08:00
|
|
|
decoord 0, 0, wTempTilemap
|
|
|
|
ld bc, wTilemapEnd - wTilemap
|
2018-04-04 21:35:14 -07:00
|
|
|
call CopyBytes
|
|
|
|
pop af
|
2018-08-25 11:28:22 -07:00
|
|
|
ldh [rSVBK], a
|
2018-04-04 21:35:14 -07:00
|
|
|
ret
|
|
|
|
|
2020-02-13 09:30:13 -08:00
|
|
|
SafeLoadTempTilemapToTilemap::
|
2018-04-04 21:35:14 -07:00
|
|
|
xor a
|
2018-08-25 11:28:22 -07:00
|
|
|
ldh [hBGMapMode], a
|
2020-02-13 09:30:13 -08:00
|
|
|
call LoadTempTilemapToTilemap
|
2018-04-04 21:35:14 -07:00
|
|
|
ld a, 1
|
2018-08-25 11:28:22 -07:00
|
|
|
ldh [hBGMapMode], a
|
2018-04-04 21:35:14 -07:00
|
|
|
ret
|
|
|
|
|
2020-02-13 09:30:13 -08:00
|
|
|
LoadTempTilemapToTilemap::
|
|
|
|
; Load wTempTilemap into wTilemap
|
2018-08-25 11:28:22 -07:00
|
|
|
ldh a, [rSVBK]
|
2018-04-04 21:35:14 -07:00
|
|
|
push af
|
2020-02-13 09:30:13 -08:00
|
|
|
ld a, BANK(wTempTilemap)
|
2018-08-25 11:28:22 -07:00
|
|
|
ldh [rSVBK], a
|
2020-02-13 09:30:13 -08:00
|
|
|
hlcoord 0, 0, wTempTilemap
|
2018-04-04 21:35:14 -07:00
|
|
|
decoord 0, 0
|
2020-02-13 09:30:13 -08:00
|
|
|
ld bc, wTilemapEnd - wTilemap
|
2018-04-04 21:35:14 -07:00
|
|
|
call CopyBytes
|
|
|
|
pop af
|
2018-08-25 11:28:22 -07:00
|
|
|
ldh [rSVBK], a
|
2018-04-04 21:35:14 -07:00
|
|
|
ret
|