The PSG portion of the PC-FX sound. Very similar to PSG in PC-Engine
ADPCM data transfer is handled by KING
0x100 | Channel select |
---|---|
0x102 | Main volume |
0x104 | Frequency (low byte) |
0x106 | Frequency (high byte) |
0x108 | Channel volume |
0x10A | Pan |
0x10C | Wave data |
0x10E | Noise |
0x110 | LFO Frequency |
0x112 | LFO control |
0x120 | ADPCM control |
0x122 | ADPCM Vol0 left(0 ~ 3Fh) |
0x124 | ADPCM Vol0 right(0 ~ 3Fh) |
0x126 | ADPCM Vol1 right(0 ~ 3Fh) |
0x128 | ADPCM Vol1 right(0 ~ 3Fh) |
0x12A | CD-DA Volume left |
0x12C | CD-DA Volume right |
Registers 0x104 ~ 0x10E are set depending on the selected channel. This register selects that channel. (0 ~ 5)
Sets the total output volume of all channels.
Bits | Speaker |
---|---|
4 ~ 7 | Left |
0 ~ 3 | Right |
Specifies the tone frequency. This 12bit frequency value corresponds like so: n = (3580000 / 32) / freq. 0x104 contains the low 8 bits, and 0x106 contains the top 4 bits.
Specifies the channel's volume. 5 bit volume, with 2 control bits.
bit7 (ch on) | bit6 (dda) | Operation |
---|---|---|
0 | 0 | Writes to waveform data store into the waveform buffer |
0 | 1 | Reset the index of the waveform data buffer |
1 | 0 | Output frequencies are read from the waveform buffer |
1 | 1 | Output frequency is read in realtime from wavefrom data |
Specifies left/right balance volume. Same format as 0x102
Set output waveform data. If 0x108 bits 6 and 7 are set to 00, waveform data is written into 32 byte buffer.
Waveform data is represented by an unsigned 5bit sample.
Noise settings register. Bits 0~4 specify the frequency. Bit 7 specifies whether noise is on or off.
Noise can only be used on channel 5 and 6.
Frequency value can be determined like so: n = (3580000 / 64) / freq
Specifies the LFO Frequency.
See LFO information for more information.
LFO control.
See LFO information for more information.
Bits | Description | |
---|---|---|
0 ~ 1 | LFO control | 00 = No frequency modulation is performed. |
01 = FM data is added directly to channel 0's frequency. | ||
10 = FM data is shifted left 4 bits, then added to ch0's frequency. | ||
11 = FM data is shifted left 8 bits, then added to ch0's frequency. | ||
7 | LFO disable | 0 = LFO on |
1 = LFO off/reset |
Bits | Description | |
---|---|---|
0 ~ 1 | Sample rate | 00 = 32kHz |
01 = 16kHz | ||
10 = 8kHz | ||
11 = 4kHz | ||
2 | Channel 0 linear interpolation | |
3 | Channel 1 linear interpolation | |
4 | Channel 0 reset | |
5 | Channel 1 reset |
Volume of the left output for channel 0 on the ADPCM. (0 ~ 63)
Volume of the right output for channel 0 on the ADPCM. (0 ~ 63)
Volume of the left output for channel 1 on the ADPCM. (0 ~ 63)
Volume of the right output for channel 1 on the ADPCM. (0 ~ 63)
Volume of the left output for CD-DA sound. (0 ~ 63)
Volume of the right output for CD-DA sound. (0 ~ 63)
ADPCM is an improvement on DPCM "in place the difference in scale factor"
volume = old_volume + diff * scale_factor
"The scaling factor for dynamic trend of the difference, large changes in the waveform scale factor increases, for small changes in scale factor is reduced. By such an operation, 4bit output data can be even closer to the original waveform data."
The PC-FX uses an ADPCM format that is somewhat similar to the one used by OKI. The 4bit samples are packed into 1 8bit byte, and are played back in the order: low 4bits, high 4bits.
Bits | Description |
---|---|
0 ~ 2 | Absolute value |
3 | Sign |
Channel 0 gets a value from channel 1's waveform buffer added to it under control of LFO controls. The frequency of which the values are read follows this formula:
freq = 3580000 / (32 * ch1freq * lfofreq)
The values from channel 1 are treated as 5bit signed integers. Channel 1 is automatically muted when LFO is enabled.