Quite simple, really:

  • 3 square wave channels,
  • 1 noise channel.

The wave channels use a 10 bit counter, which is reset when it reaches the expected value (signal period). The output is changed at each reset.

The noise channel uses a pseudo-random generator, implemented with a shifter and a xor (as described in http://www.smspower.org/uploads/Development/SN76489-20030421.txt

Warning: SMS is active low, so volume $f is mute and 0 is the maximum. We simply output "1111" for "1" and "given volume" for "0".

Summing the 4 channels, each having 4 bits, gives a 6 bit level. We turn this in a 1 bit signal with a sigma-delta modulator.

The high frequency noise can be cut with an analog low pass filter but it is far above the audible range (MHz rather than kHz) and the TV speakers are certainly not that good: a plain wire seems to work fine (although the sound is a bit weak)

  

Share |