It is currently Mon Oct 23, 2017 1:35 pm

All times are UTC - 7 hours





Post new topic Reply to topic  [ 6 posts ] 
Author Message
PostPosted: Mon May 09, 2016 11:01 am 
Offline
User avatar

Joined: Fri Jan 24, 2014 9:05 am
Posts: 133
Location: Hungary
Hey, I have this little question, I would like to add a little extra punch to my percussion but since I'm already using the DMC for raster effects, the only thing I can think of is setting the level via $4011 and since I'm always playing 0 bits with the DMC, it would make a pop sound and then recover the level to 0. But wiki says that if the DMC is active and happens to change the level in the same cycle as you are trying to write to it, the level "doesn't change properly". But what does this mean? Does the $4011 not take effect at all, or is the DMC change ignored? (which would be fine in my case) Moreover, is there any way to fix this, other than doing my $4011 write in NMI, during which I always disable the DMC until the sprite 0 clear? This would delay the pop by about one frame and that's not what I really want.


Top
 Profile  
 
PostPosted: Mon May 09, 2016 11:32 am 
Offline
User avatar

Joined: Mon Jan 03, 2005 10:36 am
Posts: 2963
Location: Tampere, Finland
blargg's apu_ref.txt is unambiguous:
Quote:
Writing to the DAC register ($4011) while a sample is playing sometimes has no
effect, probably because the DMC's output unit is clocking the counter at the
same moment as the write.

If you want to ensure that the write takes effect, probably you can enforce it by doing the write two times (since DMC channel updates are always at least ~50 CPU cycles apart, if the update happens to take over the first write, it should never take over the second one).

_________________
Download STREEMERZ for NES from fauxgame.com! — Some other stuff I've done: kkfos.aspekt.fi


Top
 Profile  
 
PostPosted: Sun May 15, 2016 7:45 am 
Offline
User avatar

Joined: Fri Nov 19, 2004 7:35 pm
Posts: 3944
Also note that setting the sample value to an extreme makes DMC clip against the edges, so it won't sound very good. You need to set the sample value back to the middle to make DMC clip less.

_________________
Here come the fortune cookies! Here come the fortune cookies! They're wearing paper hats!


Top
 Profile  
 
PostPosted: Sun May 15, 2016 10:54 am 
Offline
User avatar

Joined: Fri Nov 19, 2004 7:35 pm
Posts: 3944
Example song: One without DMC pops, and the other one with them. Bassline in DMC channel, percussion in Noise channel.


Attachments:
test_pops.ogg [67.47 KiB]
Downloaded 62 times
test_nopops.ogg [65.6 KiB]
Downloaded 58 times

_________________
Here come the fortune cookies! Here come the fortune cookies! They're wearing paper hats!
Top
 Profile  
 
PostPosted: Sun May 15, 2016 1:18 pm 
Offline
User avatar

Joined: Fri Nov 12, 2004 2:49 pm
Posts: 7235
Location: Chexbres, VD, Switzerland
@dwedit : My understanding is that what you are telling has nothing to do with what he's doing. He's using DMC as a timer for raster effect, not to play any sound. He'd want to use $4011 just for popping sound, like Rad Racer II and Final Fantasy III, and that simultaneously. za909 correct me if I'm wrong.


Top
 Profile  
 
PostPosted: Mon May 16, 2016 10:24 am 
Offline
User avatar

Joined: Fri Jan 24, 2014 9:05 am
Posts: 133
Location: Hungary
Yes, that's exactly what I want to do. It's not as harsh though because the DMC gets the level back to zero a lot more smoothly and not another $4011 write. I could even do this and have some control over the APU2 volume by selecting to play either $00 bytes all the time or $FF and writing $3F to $4011 would always work regardless of the sample being played.


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

All times are UTC - 7 hours


Who is online

Users browsing this forum: No registered users and 2 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