Processing steps V1 and V2 in apudsp.txt
Page 1 of 1

Author:  jwdonal [ Sun Jan 26, 2014 8:00 pm ]
Post subject:  Processing steps V1 and V2 in apudsp.txt

In apudsp.txt it states the following:
 V1. Load the current value of the VxSRCN register, if necessary.
 V2. Load the sample pointer (using previously loaded DIR and VxSRCN) if

And in Blargg's snes_spc SPC_DSP.cpp we have:
inline VOICE_CLOCK( V1 )
   m.t_dir_addr = m.t_dir * 0x100 + m.t_srcn * 4;
   m.t_srcn = VREG(v->regs,srcn);
inline VOICE_CLOCK( V2 )
   // Read sample pointer (ignored if not needed)
   uint8_t const* entry = &m.ram [m.t_dir_addr];



I don't understand why Blargg's code calculates the value of t_dir_addr with the pre-updated value of t_srcn. The apudsp.txt doc says "using previously loaded DIR and VxSRCN". I'm not sure about DIR, but the previously loaded value of VxSRCN was the value loaded in voice processing step V1. But that is not the value used in the code.

Author:  blargg [ Sun Jan 26, 2014 8:41 pm ]
Post subject:  Re: Processing steps V1 and V2 in apudsp.txt

Anomie's doc is likely incorrect then. He probably just failed to clarify this in the comment about using the previously loaded value. At some point I'll be posting all my DSP tests, some of which test this aspect.

EDIT: I just tried switching the order of those two lines (putting m.t_srcn = VREG(v->regs,srcn); first) and the DSP fails many of the tests.

Author:  jwdonal [ Sun Feb 02, 2014 2:49 am ]
Post subject:  Re: Processing steps V1 and V2 in apudsp.txt

Forgot to reply and say thanks. This was very helpful. I've updated my personal copy of apudsp.txt to reflect this...along with the bazillion other notes I've added. :-P

Author:  jwdonal [ Wed Feb 04, 2015 12:55 am ]
Post subject:  Re: Processing steps V1 and V2 in apudsp.txt

This is a big bump (almost exactly a year to the day actually), but I think it's worth it for anyone else who might need help understanding Anomie's apudsp.txt.

There is a response by Blargg in the thread below that directly relates to this question and explains things really well.


Page 1 of 1 All times are UTC - 7 hours
Powered by phpBB® Forum Software © phpBB Group