Материал из Chipwiki
Перейти к: навигация, поиск
Namco WSG
Pac Man (1980) OST

Namco 3-channel Waveform Sound Generator (WSG) использовался в аркадных платформах Pac Man и Galaga. Позволяет использовать три канала с независимой регулировкой громкости, частоты и формы. Все функции зависят от 4-я битных регистров:

Регистр За что отвечает
00h-04h Частотный счётчик Voice #1
05h Форма волны Voice #1 (использует 3 бита)
06-09h Частотный счётчик Voice #2
0Ah Форма волны Voice #2 (использует 3 бита)
0Bh-0Eh Частотный счётчик Voice #3
0Fh Форма волны Voice #3 (использует 3 бита)
10h-14h Частота Voice #1
15h Громкость Voice #1
16h-19h Частота Voice #2
1Ah Громкость Voice #2
1Bh-1Eh Частота Voice #3
1Fh Громкость Voice #3


Edit.gif
Требуется перевод

Frequencies and counters are 20-bit values stored with the least significant nibble first. Voice #2 and #3 are missing the register for the least significant nibble and it is assumed to be always zero.

These registers are usually mapped into the memory space of the CPU. In the Pacman hardware the memory locations at 5040h-505Fh map the sound registers, so for example writing a value at the address 505Ah sets the volume of voice #2.

Sound generation is based on a table that contains 8 different waveforms, where each waveform is described by 32 4-bit entries. For versatility and reuseability, this data is kept outside of the chip in a 256 byte PROM.

The chip itself is clocked at 96 KHz, which is the main CPU clock (3.072 MHz) divided by 32. At each cycle the frequency counter for each voice is incremented by the voice frequency, then the most significant 5 bits are used as an index to retrieve the current wave sample from the waveform table. The sample is then multiplied by the voice volume and sent to the amplifier for output. Note that a voice is actually muted if its volume or frequency is zero.