summaryrefslogtreecommitdiff
path: root/src/home/dma.asm
diff options
context:
space:
mode:
authorDaniel Harding <33dannye@gmail.com>2021-09-19 00:21:14 -0500
committerGitHub <noreply@github.com>2021-09-19 00:21:14 -0500
commitdf67aac83b466dadf5f74c881bf84dd9ef19bdfc (patch)
tree47501aced2d256052b8f78bc97328d5af5703add /src/home/dma.asm
parente4bce9b7ee5e89f8edfd921de2379f0fa06af206 (diff)
parent8dee6b7a11e85d6d4b9f8ec9fb9d53a499fd37dc (diff)
Merge pull request #110 from ElectroDeoxys/master
Split Home bank
Diffstat (limited to 'src/home/dma.asm')
-rw-r--r--src/home/dma.asm22
1 files changed, 22 insertions, 0 deletions
diff --git a/src/home/dma.asm b/src/home/dma.asm
new file mode 100644
index 0000000..bcba963
--- /dev/null
+++ b/src/home/dma.asm
@@ -0,0 +1,22 @@
+; copy DMA to hDMAFunction
+CopyDMAFunction:
+ ld c, LOW(hDMAFunction)
+ ld b, JumpToFunctionInTable - DMA
+ ld hl, DMA
+.loop
+ ld a, [hli]
+ ld [$ff00+c], a
+ inc c
+ dec b
+ jr nz, .loop
+ ret
+
+; CopyDMAFunction copies this function to hDMAFunction ($ff83)
+DMA:
+ ld a, HIGH(wOAM)
+ ldh [rDMA], a
+ ld a, $28
+.wait
+ dec a
+ jr nz, .wait
+ ret