HuC6230 (SoundBox)

The PSG portion of the PC-FX sound. Very similar to PSG in PC-Engine

ADPCM data transfer is handled by KING

I/O Ports

0x100Channel select
0x102Main volume
0x104Frequency (low byte)
0x106Frequency (high byte)
0x108Channel volume
0x10APan
0x10CWave data
0x10ENoise
0x110LFO Frequency
0x112LFO control
0x120ADPCM control
0x122ADPCM Vol0 left(0 ~ 3Fh)
0x124ADPCM Vol0 right(0 ~ 3Fh)
0x126ADPCM Vol1 right(0 ~ 3Fh)
0x128ADPCM Vol1 right(0 ~ 3Fh)
0x12ACD-DA Volume left
0x12CCD-DA Volume right

Register

0x100   Channel select (Byte)

Registers 0x104 ~ 0x10E are set depending on the selected channel. This register selects that channel. (0 ~ 5)

0x102   Main volume (Byte)

Sets the total output volume of all channels.

BitsSpeaker
4 ~ 7Left
0 ~ 3Right

0x104,0x106   Frequency (Byte)

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.

0x108   Volume (Byte)

Specifies the channel's volume. 5 bit volume, with 2 control bits.

bit7 (ch on)bit6 (dda)Operation
00Writes to waveform data store into the waveform buffer
01Reset the index of the waveform data buffer
10Output frequencies are read from the waveform buffer
11Output frequency is read in realtime from wavefrom data

0x10A   Balance (Byte)

Specifies left/right balance volume. Same format as 0x102

0x10C   Waveform data (Byte)

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.

0x10E   Noise settings (Byte)

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

0x110   LFO Frequency (Byte)

Specifies the LFO Frequency.

See LFO information for more information.

0x112   LFO Controls (Byte)

LFO control.

See LFO information for more information.

BitsDescription
0 ~ 1LFO 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.
7LFO disable 0 = LFO on
1 = LFO off/reset

0x120   ADPCM Control (Half)

BitsDescription
0 ~ 1Sample rate 00 = 32kHz
01 = 16kHz
10 = 8kHz
11 = 4kHz
2Channel 0 linear interpolation
3Channel 1 linear interpolation
4Channel 0 reset
5Channel 1 reset

0x122   ADPCM Channel 0 Left volume (Byte)

Volume of the left output for channel 0 on the ADPCM. (0 ~ 63)

0x124   ADPCM Channel 0 Right volume (Byte)

Volume of the right output for channel 0 on the ADPCM. (0 ~ 63)

0x126   ADPCM Channel 1 Left volume (Byte)

Volume of the left output for channel 1 on the ADPCM. (0 ~ 63)

0x128   ADPCM Channel 1 Right volume (Byte)

Volume of the right output for channel 1 on the ADPCM. (0 ~ 63)

0x12A   CD-DA Volume left

Volume of the left output for CD-DA sound. (0 ~ 63)

0x12C   CD-DA Volume right

Volume of the right output for CD-DA sound. (0 ~ 63)

ADPCM data

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.

BitsDescription
0 ~ 2Absolute value
3Sign

LFO information

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.


[TOP]