Fix clearing OAM and initializeing wave RAM

This commit is contained in:
Lior Halphon 2020-05-17 19:24:11 +03:00
parent a588993f28
commit 157123e118

View File

@ -15,6 +15,22 @@ Start:
call ClearMemoryPage call ClearMemoryPage
ld [c], a ld [c], a
; Clear OAM
ld h, $fe
ld c, $a0
.clearOAMLoop
ldi [hl], a
dec c
jr nz, .clearOAMLoop
; Init waveform
ld c, $10
.waveformLoop
ldi [hl], a
cpl
dec c
jr nz, .waveformLoop
; Clear chosen input palette ; Clear chosen input palette
ldh [InputPalette], a ldh [InputPalette], a
; Clear title checksum ; Clear title checksum
@ -29,22 +45,6 @@ Start:
ld a, $77 ld a, $77
ldh [$24], a ldh [$24], a
ld hl, $FF30 ld hl, $FF30
; Init waveform
ld c, $10
.waveformLoop
ldi [hl], a
cpl
dec c
jr nz, .waveformLoop
; Clear OAM
ld h, $fe
ld c, $a0
.clearOAMLoop
ldi [hl], a
dec c
jr nz, .clearOAMLoop
; Init BG palette ; Init BG palette
ld a, $fc ld a, $fc