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