Warning: preg_match(): Compilation failed: group name must start with a non-digit at offset 8 in /home/content/30/6867330/html/intellivision/wiki/includes/MagicWord.php on line 722

Warning: preg_match(): Compilation failed: group name must start with a non-digit at offset 8 in /home/content/30/6867330/html/intellivision/wiki/includes/MagicWord.php on line 722

Warning: preg_match_all(): Compilation failed: group name must start with a non-digit at offset 4 in /home/content/30/6867330/html/intellivision/wiki/includes/MagicWord.php on line 700

Warning: Invalid argument supplied for foreach() in /home/content/30/6867330/html/intellivision/wiki/includes/MagicWord.php on line 701

Warning: preg_replace(): Compilation failed: group name must start with a non-digit at offset 4 in /home/content/30/6867330/html/intellivision/wiki/includes/MagicWord.php on line 705

Warning: preg_match_all(): Compilation failed: group name must start with a non-digit at offset 4 in /home/content/30/6867330/html/intellivision/wiki/includes/MagicWord.php on line 700

Warning: Invalid argument supplied for foreach() in /home/content/30/6867330/html/intellivision/wiki/includes/MagicWord.php on line 701

Warning: preg_replace(): Compilation failed: group name must start with a non-digit at offset 4 in /home/content/30/6867330/html/intellivision/wiki/includes/MagicWord.php on line 705

Warning: preg_match(): Compilation failed: group name must start with a non-digit at offset 8 in /home/content/30/6867330/html/intellivision/wiki/includes/MagicWord.php on line 722

Warning: preg_match_all(): Compilation failed: group name must start with a non-digit at offset 4 in /home/content/30/6867330/html/intellivision/wiki/includes/MagicWord.php on line 700

Warning: Invalid argument supplied for foreach() in /home/content/30/6867330/html/intellivision/wiki/includes/MagicWord.php on line 701

Warning: preg_replace(): Compilation failed: group name must start with a non-digit at offset 4 in /home/content/30/6867330/html/intellivision/wiki/includes/MagicWord.php on line 705

Warning: preg_match_all(): Compilation failed: group name must start with a non-digit at offset 4 in /home/content/30/6867330/html/intellivision/wiki/includes/MagicWord.php on line 700

Warning: Invalid argument supplied for foreach() in /home/content/30/6867330/html/intellivision/wiki/includes/MagicWord.php on line 701

Warning: preg_replace(): Compilation failed: group name must start with a non-digit at offset 4 in /home/content/30/6867330/html/intellivision/wiki/includes/MagicWord.php on line 705

Warning: preg_match_all(): Compilation failed: group name must start with a non-digit at offset 4 in /home/content/30/6867330/html/intellivision/wiki/includes/MagicWord.php on line 700

Warning: Invalid argument supplied for foreach() in /home/content/30/6867330/html/intellivision/wiki/includes/MagicWord.php on line 701

Warning: preg_replace(): Compilation failed: group name must start with a non-digit at offset 4 in /home/content/30/6867330/html/intellivision/wiki/includes/MagicWord.php on line 705

Warning: preg_match_all(): Compilation failed: group name must start with a non-digit at offset 4 in /home/content/30/6867330/html/intellivision/wiki/includes/MagicWord.php on line 700

Warning: Invalid argument supplied for foreach() in /home/content/30/6867330/html/intellivision/wiki/includes/MagicWord.php on line 701

Warning: preg_replace(): Compilation failed: group name must start with a non-digit at offset 4 in /home/content/30/6867330/html/intellivision/wiki/includes/MagicWord.php on line 705

Warning: preg_match(): Compilation failed: group name must start with a non-digit at offset 8 in /home/content/30/6867330/html/intellivision/wiki/includes/MagicWord.php on line 722

Warning: preg_match(): Compilation failed: group name must start with a non-digit at offset 8 in /home/content/30/6867330/html/intellivision/wiki/includes/MagicWord.php on line 722

Warning: preg_match(): Compilation failed: group name must start with a non-digit at offset 8 in /home/content/30/6867330/html/intellivision/wiki/includes/MagicWord.php on line 722

Warning: preg_match(): Compilation failed: group name must start with a non-digit at offset 8 in /home/content/30/6867330/html/intellivision/wiki/includes/MagicWord.php on line 722

Warning: preg_match_all(): Compilation failed: group name must start with a non-digit at offset 4 in /home/content/30/6867330/html/intellivision/wiki/includes/MagicWord.php on line 700

Warning: Invalid argument supplied for foreach() in /home/content/30/6867330/html/intellivision/wiki/includes/MagicWord.php on line 701

Warning: preg_replace(): Compilation failed: group name must start with a non-digit at offset 4 in /home/content/30/6867330/html/intellivision/wiki/includes/MagicWord.php on line 705

Warning: preg_match_all(): Compilation failed: group name must start with a non-digit at offset 4 in /home/content/30/6867330/html/intellivision/wiki/includes/MagicWord.php on line 700

Warning: Invalid argument supplied for foreach() in /home/content/30/6867330/html/intellivision/wiki/includes/MagicWord.php on line 701

Warning: preg_replace(): Compilation failed: group name must start with a non-digit at offset 4 in /home/content/30/6867330/html/intellivision/wiki/includes/MagicWord.php on line 705

Warning: preg_match(): Compilation failed: group name must start with a non-digit at offset 8 in /home/content/30/6867330/html/intellivision/wiki/includes/MagicWord.php on line 722

Warning: preg_match(): Compilation failed: group name must start with a non-digit at offset 8 in /home/content/30/6867330/html/intellivision/wiki/includes/MagicWord.php on line 722
PSG - Intellivision Wiki

PSG


Warning: preg_match(): Compilation failed: group name must start with a non-digit at offset 8 in /home/content/30/6867330/html/intellivision/wiki/includes/MagicWord.php on line 722
From Intellivision Wiki

Jump to: navigation, search
m (Protected "PSG" ([edit=autoconfirmed] (indefinite) [move=autoconfirmed] (indefinite)))
(Channels)
 
Line 50: Line 50:
==Channels==
==Channels==
-
The PSG contains 3 independent channels, a single noise generator, and a single envelope generator.  Each channel includes a square wave tone generator and is capable of mixing any combination of the output from its respective tone generator with the noise generator and the envelope generator.  Output from each of the 3 channels is then mixed together to produce the final audio output.<br/>
 
-
Channel periods are 12-bit values indicating a range of period from 1 PSG clock cycle up to 4096 PSG clock cycles.  This translates to a frequency range from.  Note that a channel period value of zero actually indicates a period of 4096.<br/>
 
-
In the simplest case, where channel output is affected only by its respective tone generator and not by either noise or envelope, the PSG generates channel output by counting the number of PSG clock cycles indicated by the channel period and then toggling the channel output between zero (0) and the currently selected volume for that channel.<br/>
 
-
square wave output optionally modified by the envelope generator and/or the noise generator<br/>
 
-
Volume (0-15)
 
-
Period (1-4096)
 
-
Tone Enabled
 
-
Envelope Enabled
 
-
Noise Enabled
 
-
16 volume levels, independent to each channel
+
The PSG provides 3 independent analog output channels.  The PSG provides a dedicated square wave tone generator and D/A converter for each of the three output channels.  It also provides a single noise generator and single volume envelope generator, both can be mixed with any combination of the three channels.  The Intellivision mixes the output of the three analog channels directly to produce the final audio output.
 +
 
 +
 
 +
The square wave tone generators work by dividing the PSG's sound clock by a 12-bit value.  On NTSC systems, the effective sound clock is 3.579545MHz / 16 = 223721.5625Hz.  On PAL systems, the sound clock is 4MHz / 16 = 250000Hz.  The tone generator toggles at the rate (sound clock / pitch period).  Because two toggles make a full square wave, the actual frequency of the resulting square wave is half that:  (sound clock / pitch period / 2).  This translates to a frequency range from 111860Hz to 27.31Hz on NTSC systems, and 125000Hz to 30.52Hz on PAL/SECAM.  Note that a channel period value of zero actually indicates a period of 4096.  The following equations convert pitch period to frequency for both systems:
 +
 
 +
            3.579545MHz
 +
F_tone =  -------------  for NTSC
 +
            32*P_channel
 +
 +
            4.000000MHz
 +
F_tone =  -------------  for PAL
 +
            32*P_channel
 +
 
 +
 
 +
Each channel has separate control bits to enable tone and noise.  The output of the tone generator gets mixed with the output of the shared noise generator with the following equation:
 +
 
 +
    channel_output = (noise_enable OR noise_generator_output) AND (tone_enable OR tone_generator_output)
 +
 
 +
Because the PSG logically-ANDs the two sources together, the resulting output can sound "gritty", particularly when the tone generator outputs low pitched tones.  Examples include the tank sound effects in Armor Battle, and the explosion sound effects in River Raid.
 +
 
 +
 
 +
The PSG sends the binary 0/1 mixed output to the D/A converter.  The D/A converter applies the channel's selected volume to this binary stream.  For volume levels $00 through $0F, the PSG outputs a fixed volume level for the channel.  For volume levels $30 - $3F, the PSG uses the current output level from the shared envelope generator.
 +
 
 +
 
 +
Note:  Some PSG variants have 5 volume control bits and some have 6.  On devices with 5-bit volume registers, volumes $10 - $1F select the envelope generator as the volume source.  On devices with 6-bit volume registers, $30 - $3F selects the envelope generator in the same manner.  On these 6-bit volume devices, however, $10 - $1F select the envelope shifted right by 2 bits, and $20 - $2F select the envelope shifted right by 1 bit, resulting in "quiet" envelopes.  For consistency across all variants, programs should write $3F to select the envelope generator for a particular channel, and should tolerate reading back $1F after having written $3F to a given channel's volume register.
==Envelope Generator==
==Envelope Generator==

Latest revision as of 15:36, 28 September 2011

Personal tools
Namespaces
Variants
Actions
Navigation
Toolbox