Line 314: |
Line 314: |
| |} | | |} |
| | | |
− | This command is used for initializing IMA-ADPCM state(when IMA-ADPCM encoding is used), prior to using command 0xE. [[CSND]] <nowiki>channelslotregister+0x18 = (u16)cmdword[3] | ((cmdword[4] & 0xFF)<<16)</nowiki>. [[CSND]] channelslotregister+0x1C = 0. | + | This command is used for setting the IMA-ADPCM state used to play the first block (when IMA-ADPCM encoding is used), prior to using command 0xE. [[CSND]] <nowiki>channelslotregister+0x18 = (u16)cmdword[3] | ((cmdword[4] & 0xFF)<<16)</nowiki>. [[CSND]] channelslotregister+0x1C = 0. |
| | | |
| ==Command 0xC== | | ==Command 0xC== |
Line 340: |
Line 340: |
| |} | | |} |
| | | |
− | This is used for initializing looping state for IMA-ADPCM encoding. <nowiki>channelslotregister+0x18 = (1<<31) | (u16)cmdword[3] | ((cmdword[4] & 0xFF)<<16)</nowiki>. | + | This is used for setting the IMA-ADPCM state used to play the second block (when IMA-ADPCM encoding is used). <nowiki>channelslotregister+0x1C = (1<<31) | (u16)cmdword[3] | ((cmdword[4] & 0xFF)<<16)</nowiki>. |
| | | |
| ==Command 0xD== | | ==Command 0xD== |
− | Unknown.
| + | {| class="wikitable" border="1" |
| + | |- |
| + | ! Index Byte |
| + | ! Size |
| + | ! Description |
| + | |- |
| + | | 0x2 |
| + | | 2 |
| + | | CmdID 0xB |
| + | |- |
| + | | 0xC |
| + | | 1 |
| + | | 0 = disable ADPCM state reload for the second block, 1 = enable. |
| + | |} |
| + | |
| + | This command configures bit31 of <nowiki>channelslotregister+0x1C</nowiki>. This bit indicates whether the hardware will load ADPCM state from said register everytime the second block is to be played; or if it will continue using the same state used for the previously emitted sample. |
| | | |
| ==Command 0xE== | | ==Command 0xE== |
Line 381: |
Line 396: |
| |} | | |} |
| | | |
− | This initializes the [[CSND]] channel registers located at: 0x1EC03400 + (channel_index*0x20). It is unknown if stereo samples are supported. When looping is disabled, the hardware plays the first block and then stops. When looping is enabled, the hardware plays the first block once and then repeats the second forever. Before playing a block, the hardware reads the corresponding address register in order to know where it is located. The block size is either read only once at the beginning or before each block (this is controlled by bit11 of word 0x8). | + | This initializes the [[CSND]] channel registers located at: 0x1EC03400 + (channel_index*0x20). It is unknown if stereo samples are supported. In manual mode, the hardware plays the audio data of the first block endlessly ignoring the size field. In one-shot mode, the hardware plays the first block with the specified size and then stops. When looping is enabled, the hardware plays the first block once and then repeats the second forever. Before playing a block, the hardware reads the corresponding address register in order to know where it is located. The block size is either read only once at the beginning (mode 3) or before each block (mode 1, normal looping). |
| | | |
| ===Parameter word 0x8=== | | ===Parameter word 0x8=== |
Line 398: |
Line 413: |
| | ? | | | ? |
| |- | | |- |
− | | 10 | + | | 11-10 |
− | | 0 = disable looping (one-shot sample), 1 = enable looping. | + | | Repeat mode: 0 = manual, 1 = normal looping, 2 = one-shot, 3 = looping with constant block size. |
− | |-
| |
− | | 11
| |
− | | 0 = read the block size before each block, 1 = read the block size only once.
| |
| |- | | |- |
| | 13-12 | | | 13-12 |
Line 419: |
Line 431: |
| Bits 0 through 5 are written as zero to the CNT register. | | Bits 0 through 5 are written as zero to the CNT register. |
| | | |
− | PSG: Channels 8 through 13 play a square tone that is 16 samples long. Channels 14 and 15 play noise. It is currently unknown how to set the duty of the square tones. | + | PSG: Channels 8 through 13 play a square tone that is 32 samples long. Channels 14 and 15 play noise. The duty of the square tones is set using command 0x7. |
| | | |
| ===Parameter word 0xC=== | | ===Parameter word 0xC=== |