Has the SPC-700 noise algorithm been determined exactly? A while back I examined it and found it used a similar algorithm as the NES 2A03 sound chip, with some modifications to give it a multi-bit output. I never found an exact algorithm, only something fairly close. Anomie's DSP draft covers the feedback part but not the extra mapping to the final amplitude. Here is what I use in my SPC DSP emulator:
Well, as the DSP doc states, initial value is 0x4000, and on each iteration 'internal' is updated as your code does.
The actual noise sample is exactly this internal, though. The noise sample replaces the BRR decoded sample, before volume adjustments or the 15-to-16 bit conversion. All this was determined by running a noise channel into the echo buffer and examining the output.
Ouch, it really is that simple . I must have messed up the sign-extension when I was trying endless tricky variations of the algorithm I posted. Now Chrono Trigger - Beach sounds exactly the same as on a SNES. Thanks!