summaryrefslogtreecommitdiff
path: root/src/home/unsafe_bg_map.asm
diff options
context:
space:
mode:
authorElectroDeoxys <ElectroDeoxys@gmail.com>2021-09-09 08:51:12 +0100
committerElectroDeoxys <ElectroDeoxys@gmail.com>2021-09-09 08:51:12 +0100
commit32b02147925566bac93bf71b002860335583574c (patch)
treed9cf016338d08022f0c0db358b356ddfb18b0e16 /src/home/unsafe_bg_map.asm
parente4bce9b7ee5e89f8edfd921de2379f0fa06af206 (diff)
Split home bank
Diffstat (limited to 'src/home/unsafe_bg_map.asm')
-rw-r--r--src/home/unsafe_bg_map.asm19
1 files changed, 19 insertions, 0 deletions
diff --git a/src/home/unsafe_bg_map.asm b/src/home/unsafe_bg_map.asm
new file mode 100644
index 0000000..64e6e93
--- /dev/null
+++ b/src/home/unsafe_bg_map.asm
@@ -0,0 +1,19 @@
+; reads struct:
+; x (1 byte), y (1 byte), data (n bytes), $00
+; writes data to BGMap0-translated x,y
+; important: make sure VRAM can be accessed first, else use WriteDataBlockToBGMap0
+UnsafeWriteDataBlockToBGMap0: ; 0492 (0:0492)
+ ld a, [hli]
+ ld b, a
+ ld a, [hli]
+ ld c, a
+ call BCCoordToBGMap0Address
+ jr .next
+.loop
+ ld [de], a
+ inc de
+.next
+ ld a, [hli]
+ or a
+ jr nz, .loop
+ ret