ENDL restores the label scope from before LOAD (#1180)

This commit is contained in:
Rangi
2023-10-26 16:58:36 -04:00
committed by GitHub
parent 22def89760
commit 84f3cb4075
4 changed files with 28 additions and 0 deletions

View File

@@ -0,0 +1,25 @@
SECTION "DMA ROM", ROM0[0]
SetUpDMA::
ld c, LOW(DMARoutine)
ld b, DMARoutineCode.end - DMARoutineCode
ld hl, DMARoutineCode
.loop
ld a, [hl+]
ldh [c], a
inc c
dec b
jr nz, .loop
ret
DMARoutineCode::
LOAD "DMA RAM", HRAM[$FF80]
DMARoutine::
ld a, $C0
ldh [rDMA], a
ld a, $28
.loop
dec a
jr nz, .loop
ret
ENDL
.end ; This label should be in the DMARoutineCode scope after ENDL