softglow's notebook

Dispatches from the Depths of a Super Nintendo

SndThread Lives

I wrote that I had the thread buffer handoff working correctly. Hah. Ha! HAHAHAHAHAHA!

Now it works. I got a thin, quiet, reedy whine out of it last night, and today, I tracked down the final bug: the IO formatter was shifting the wrong direction, thus turning a sample like 3560 into output bytes 6000 because 350000 & ff (the implicit conversion to byte) is zero.

This started life as a triangle wave, but when I got a bad sound, I tried ‘flattening’ the peaks out to put in more sound power and make it fuller. This did not work. Not only was sound power unimportant, but instead of holding the peak value, it holds zero.

But, since this bug is clearly in the generator and the rest of the output chain is working to suit me, I’m going to leave it unfixed and move on to connecting higan’s SMP/DSP subsystem in place of my broken generator.