nesdev.com
http://forums.nesdev.com/

Accurate apu_mixer timing?
http://forums.nesdev.com/viewtopic.php?f=3&t=13327
Page 1 of 1

Author:  Rahsennor [ Sat Oct 03, 2015 8:29 pm ]
Post subject:  Accurate apu_mixer timing?

I'm trying to make my NSF player pass blargg's apu_mixer tests, starting with the square wave. The section of output that is meant to be silent is quiet, but certainly not silent. Visual inspection of the waveform shows a train of alternating positive and negative spikes, leading me to believe it's a phase issue, and logging the exact cycle of each transition shows that each channel is exactly four cycles out of phase: first the PCM, then Pulse 1, then Pulse 2.

But looking at the test source, I see this:
Code:
   ldx #$6F        ; period = 896*2
   ldy #$00
   stx $4002
   stx $4006
   sty $4003
   sty $4007
The phase-resetting writes occur exactly four cycles apart. Does this mean the output I'm hearing is an artifact of the test, or is there an obscure timing issue in the APU I'm not emulating properly?

Author:  ap9 [ Sun Nov 08, 2015 2:45 pm ]
Post subject:  Re: Accurate apu_mixer timing?

First of all, the test wave isn’t silent, it’s mostly silent with close-cancelation artifacting (includes spikes), and grows more audible toward the end. There are recordings of these tests currently available on github.

As far as timing goes, the synth channels have a slight clocking delay, whereas the DMC 4011 write is a direct setting of the DA output, with immediate effect. It’s easiest to render a sample before clocking the period to simulate this delay.

Be sure to account for all of the CPU cycles when updating the sound results; the actual write occurs on the last instruction cycle.

Author:  nothingtosay [ Tue Nov 10, 2015 9:44 pm ]
Post subject:  Re: Accurate apu_mixer timing?

I just want to say that it makes me happy that you're trying to make a perfectly accurate NSF player and I look forward to you reaching your goal!

Author:  zeroone [ Wed Nov 11, 2015 2:59 pm ]
Post subject:  Re: Accurate apu_mixer timing?

nothingtosay wrote:
I just want to say that it makes me happy that you're trying to make a perfectly accurate NSF player and I look forward to you reaching your goal!


Given that user name, I can't tell if this comment is a joke or not.

Author:  Zepper [ Thu Nov 12, 2015 5:54 pm ]
Post subject:  Re: Accurate apu_mixer timing?

Possibly...

Author:  thefox [ Thu Nov 12, 2015 6:41 pm ]
Post subject:  Re: Accurate apu_mixer timing?

Why would you try to draw any conclusions based on a username? It's not like he can change it for every single post he makes.

Author:  nothingtosay [ Mon Nov 16, 2015 1:13 am ]
Post subject:  Re: Accurate apu_mixer timing?

I was being sincere, I assure everyone.

Author:  Rahsennor [ Sat Nov 21, 2015 12:59 am ]
Post subject:  Re: Accurate apu_mixer timing?

ap9 wrote:
First of all, the test wave isn’t silent, it’s mostly silent with close-cancelation artifacting (includes spikes), and grows more audible toward the end. There are recordings of these tests currently available on github.
Thanks for the information, and links. My NSF player sounds almost exactly like the recording on the square test, so I guess I'm on target.

Sorry for not noticing your reply sooner; I haven't checked in for a while due to being very busy with other stuff.

Page 1 of 1 All times are UTC - 7 hours
Powered by phpBB® Forum Software © phpBB Group
http://www.phpbb.com/