then i looked at Nes_Snd_Emu-0.1.7/nes_apu/Nes_Oscs.cpp to see if i missed something with the shifter. blargg, if i read the code right ..
silenced:
Code: Select all
// approximate noise cycling while muted, by shuffling up noise register
// to do: precise muted noise cycling?
if ( !(regs [2] & mode_flag) )
{
int feedback = (noise << 13) ^ (noise << 14);
noise = (feedback & 0x4000) | (noise >> 1);
}
Code: Select all
const int tap = (regs [2] & mode_flag ? 8 : 13);
do
{
int feedback = (noise << tap) ^ (noise << 14);
time += period;
if ( (noise + 1) & 2 ) {
// bits 0 and 1 of noise differ
delta = -delta;
synth.offset_resampled( rtime, delta, output );
}
rtime += rperiod;
noise = (feedback & 0x4000) | (noise >> 1);
}
while ( time < end_time );
above is the comment that says approximate. seems that it would be just as easy to do the same noise shifting for silenced or not silenced.
blargg, could you explain what you mean with "to do: precise muted noise cycling?"
if the noise pattern is 32767 bits long, then i should see that pattern in the wave, i tried to see if i could line up my output with the timer test, but found no match when shifted in time.
matt