User`s guide
The Enable/Disable register also lets you decide whether or not to send the
Noise Generator's output through a Channel. Three bits let you decide which
Channel(s) the NG's output will go through. For example, you can enable NG
output through Channels A and C but not through B; or, disable NG output through
all three Channels, etc..
If, for example, Channel A's Tone oscillator output is enabled and NG output
is enabled for Channel A, then, a mixed Tone + NG signal will go through Channel
A. Setting Channel A's Amplitude controls the Level for the mixed signal.
Often, a programmer will want to individually control the Levels of Tone
outputs (for music) and Noise outputs (for sound effects). This is accomplished
by using one PSG Channel only for Noise and two Channels only for Tones. Since
the MB Sound II has 2 PSG's, a typical game application using the board will
have 4 music tones and 2 effects sounds-- each individually controlled for
Level.
More specifically, the user can set Tone Frequency (12 bits, 4 coarse & 8
fine) and Amplitude (4 bits) for each channel individually. A fifth Amplitude
bit lets you decide if a channel's Level will be "fixed" (use the Level value)
or "variable" (i.e. follow the current Envelope pattern). You have 4 bits to
set Noise Generator Frequency.
Tone Freq = A2 Clock Freq/ [ (4096 x Coarse) + (16 x Fine) ]
Noise Freq = A2 Clock Freq/ (16 x NG value)
The Envelope of the combined outputs of enabled sources can be controlled
for Period (16 bits, 8 coarse & 8 fine)** and, roughly, for Shape (4 bits).
Env Freq = A2 Clock Freq/ [ (65536 x Coarse) + (256 x Fine) ]
The registers of the PSG are described briefly below:
Reg. Function and Bit(s) used
00 A Freq. fine (bits 0-7)
01 A Freq. coarse (bits 0-3)
02 B Freq. fine (bits 0-7)
03 B Freq. coarse (bits 0-3)
04 C Freq. fine (bits 0-7)
05 C Freq. coarse (bits 0-3)
06 NG Freq. (bits 0-4)
07 Enable/Disable note: Enable =0/ Disable =1
bit 5: NG sent to A
bit 4: NG sent to B
bit 3: NG sent to C
bit 2: A Tone
bit 1: B Tone
bit 0: C Tone
Ex: Writing $F0 to Reg 07 plays tones A, B, C plus noise on C
Ex: Writing $F8 to Reg 07 plays tones A, B, C and no noise
08 A Level (bits 0-3) and