Okay I went back to working on Bad Apple today. I am almost done with it, but I am having difficulty getting HDMA to work. Anybody find anything wrong with my code?
Code:
spc700_streaming:
php
sep #$20
rep #$10
ldx #$4001
stx $4370
ldx #{hdma_table}
stx $4372
lda #$00
sta $4374
lda #$80
sta $420c
sep #$30
ldy #$00
tyx
-;
lda #$01
sta {hdma_table},x
inx
lda [{brr_stream_address}],y
sta {hdma_table},x
tya
inx
sta {hdma_table},x
inx
iny
cpy #$99
bne -
stz {hdma_table},x
tya
rep #$20
and #$00ff
clc
adc {brr_stream_address}
sta {brr_stream_address}
bcc +
inc {brr_stream_bank}
+;
plp
rts
php
sep #$20
rep #$10
ldx #$4001
stx $4370
ldx #{hdma_table}
stx $4372
lda #$00
sta $4374
lda #$80
sta $420c
sep #$30
ldy #$00
tyx
-;
lda #$01
sta {hdma_table},x
inx
lda [{brr_stream_address}],y
sta {hdma_table},x
tya
inx
sta {hdma_table},x
inx
iny
cpy #$99
bne -
stz {hdma_table},x
tya
rep #$20
and #$00ff
clc
adc {brr_stream_address}
sta {brr_stream_address}
bcc +
inc {brr_stream_bank}
+;
plp
rts