diff options
author | luckytyphlosion <alan.rj.huang@gmail.com> | 2016-03-17 18:00:47 -0400 |
---|---|---|
committer | luckytyphlosion <alan.rj.huang@gmail.com> | 2016-03-17 18:00:54 -0400 |
commit | b6d2115df4b4f9d86be898292fca473222941f1d (patch) | |
tree | 530796fd3f2b356d6af8442d6f6b1352b08012e1 /engine/overworld/load_tileset_header.asm | |
parent | bd5a5f70d44a0fef041027be12d439588f863507 (diff) |
Split bank3 up.
Diffstat (limited to 'engine/overworld/load_tileset_header.asm')
-rw-r--r-- | engine/overworld/load_tileset_header.asm | 51 |
1 files changed, 51 insertions, 0 deletions
diff --git a/engine/overworld/load_tileset_header.asm b/engine/overworld/load_tileset_header.asm new file mode 100644 index 00000000..aeab3e24 --- /dev/null +++ b/engine/overworld/load_tileset_header.asm @@ -0,0 +1,51 @@ +LoadTilesetHeader: ; c4f4 (3:44f4) + call GetPredefRegisters + push hl + ld d, 0 + ld a, [wCurMapTileset] + add a + add a + ld e, a + ld hl, Tilesets + add hl, de + add hl, de + add hl, de + ld de, wTilesetBank + ld bc, $b + call CopyData + ld a, [hl] + ld [hTilesetType], a + xor a + ld [$ffd8], a + pop hl + ld a, [wCurMapTileset] + push hl + push de + ld hl, DungeonTilesets + ld de, $1 + call IsInArray + pop de + pop hl + jr c, .notDungeonTileset + ld a, [wCurMapTileset] + ld b, a + ld a, [hPreviousTileset] + cp b + jr z, .done +.notDungeonTileset + ld a, [wDestinationWarpID] + cp $ff + jr z, .done + call LoadDestinationWarpPosition + ld a, [wYCoord] + and $1 + ld [wYBlockCoord], a + ld a, [wXCoord] + and $1 + ld [wXBlockCoord], a +.done + ret + +INCLUDE "data/dungeon_tilesets.asm" + +INCLUDE "data/tileset_headers.asm"
\ No newline at end of file |