I've been looking at the VICE vic20sound.c file for VICE 3.6.1, and I cannot for the life of me see how the LFSR for the noise channel ever changes from zero. The relevant code looks like this:
Code: Select all
if(j == 3) {
int bit3 = (noise_LFSR >> 3) & 1;
int bit12 = (noise_LFSR >> 12) & 1;
int bit14 = (noise_LFSR >> 14) & 1;
int bit15 = (noise_LFSR >> 15) & 1;
int gate1 = bit3 ^ bit12;
int gate2 = bit14 ^ bit15;
int gate3 = (gate1 ^ gate2) ^ 1;
int gate4 = (gate3 & enabled) ^ 1;
noise_LFSR0_old = noise_LFSR & 1;
noise_LFSR = (noise_LFSR << 1) | gate4;
}
gate1 will be 0 ex-or 0, i.e. 0
gate 2 will be 0 ex-or 0, i.e. 0
gate 3 will be 0 ex-or 0 ex-or 1, i.e. 1
gate 4 will be (1 & 1) ex-or 1, i.e. 1 ex-or 1, i.e. 0
So gate 4, zero, will be shifted into the LFSR, so it remains zero forever.
What have I missed, or does the noise voice really not work on VICE 3.6.1? (Answer: yes it does work, how?)