summaryrefslogtreecommitdiff
path: root/src/home/dma.asm
blob: bcba963079faf9a5f444543ba10fec86e39e72ba (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
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