It is currently Mon Oct 15, 2018 6:00 am

All times are UTC - 7 hours



Forum rules





Post new topic Reply to topic  [ 5 posts ] 
Author Message
 Post subject: HDMA music streaming
PostPosted: Sun Mar 29, 2015 7:33 pm 
Offline

Joined: Wed May 19, 2010 6:12 pm
Posts: 2757
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


Top
 Profile  
 
 Post subject: Re: HDMA music streaming
PostPosted: Sun Mar 29, 2015 8:19 pm 
Offline
User avatar

Joined: Thu Dec 25, 2014 10:26 pm
Posts: 311
Location: Canada
I haven't tried using HDMA yet, but according to the documents I have HDMA uses $43x5 and $43x6 as a "Data address". I don't see a write to $4375 anywhere, could that be the problem?

Beyond that I don't fully understand how audio streaming works yet and can't help...


Top
 Profile  
 
 Post subject: Re: HDMA music streaming
PostPosted: Mon Mar 30, 2015 5:01 am 
Offline

Joined: Fri Jul 04, 2014 9:31 pm
Posts: 966
One thing I notice is that you activate the HDMA channel before proceeding to populate the table. Are you 100% sure you have enough time to get ahead of the game before the next active HBlank?

I presume your SPC700 code has a fast enough turnaround time to not miss bytes, and doesn't get confused when the data counter resets...

Other than that, I'm not sure; it looks to me like you're constructing a valid HDMA table and initializing the channel correctly... I failed pretty hard at debugging your last code sample on this project, so odds are I've missed the real problem. What does it do when you run it?

Khaz wrote:
I haven't tried using HDMA yet, but according to the documents I have HDMA uses $43x5 and $43x6 as a "Data address". I don't see a write to $4375 anywhere, could that be the problem?

Those registers are for indirect addressing mode, which he's not using. They don't do anything unless bit 6 of $43x0 is set.


Top
 Profile  
 
 Post subject: Re: HDMA music streaming
PostPosted: Mon Mar 30, 2015 8:23 am 
Offline
User avatar

Joined: Thu Dec 25, 2014 10:26 pm
Posts: 311
Location: Canada
93143 wrote:
Khaz wrote:
I haven't tried using HDMA yet, but according to the documents I have HDMA uses $43x5 and $43x6 as a "Data address". I don't see a write to $4375 anywhere, could that be the problem?

Those registers are for indirect addressing mode, which he's not using. They don't do anything unless bit 6 of $43x0 is set.

Mmkay, I tried. Thanks for the answer, good to know.


Top
 Profile  
 
 Post subject: Re: HDMA music streaming
PostPosted: Tue Mar 31, 2015 2:06 pm 
Offline

Joined: Fri Jul 04, 2014 9:31 pm
Posts: 966
I assume you've got a plan for the actual demo that doesn't take quite as long... By my calculations this one takes about two-thirds of active display to run.


Top
 Profile  
 
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 5 posts ] 

All times are UTC - 7 hours


Who is online

Users browsing this forum: No registered users and 7 guests


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Search for:
Jump to:  
Powered by phpBB® Forum Software © phpBB Group