Control commands are issued to the command block area below. Write the command code and required parameters (P1--P14) in the 16-byte command block. There are 8 command blocks, so up to 8 commands can be issued at the same time.
System interface area
The host interface roughly looks like the image below. Write the command number in the CMD part. This will be explained in detail on the next page. P1,P2…set parameters. The number of parameters varies depending on the command. There are also commands that do not require parameters.
address | CMD | P1 | P2 | P3 | P4 | P5 | P6 | P7 | P8 | P9 | P10 | P11 | |||
0X0700 | |||||||||||||||
0X0710 | |||||||||||||||
0X0720 | |||||||||||||||
0X0730 | |||||||||||||||
0X0740 | |||||||||||||||
0X0750 | |||||||||||||||
0X0760 | |||||||||||||||
0X0770 |
There are two methods for issuing commands: "timing flag handshake" and "command code handshake." Timing flag handshake is a method of issuing commands that ensures that the order of commands written by the main system is reproduced. However, the command code handshake is for compatibility with sound drivers Ver1.00 to Ver1.29, so normally use the timing flag handshake. This is because if the command code handshake is used, 68000 may not be able to keep up with continuous requests, which may cause trouble. More on this later.
Set the timing flag handshake as follows:
Issuing a command using timing flags is as follows.
Main system processing (issuing commands)
Bit 76543210 *・・・・・・・・・ ↑ | Timing flag 0:Id1e 1: Command set completed
Next, I will also touch on the command code handshake.
This method checks whether the command code (first byte of the command block) is "00h" and issues the command. The main system checks that the command code is "00h" and issues commands in the order from block 1 to block 8. Similarly, the sound driver simply repeats the process of checking blocks 1 to 8 in order, and if a command code is written, processing that command.
The command code is cleared by the sound driver when processing is completed, so if the command code is not cleared to "00h" yet, it means that the command is still being processed or is waiting for processing to start. means. Conversely, if the issued command code is cleared to "00h", it means that the sound driver's command processing has completed completely. However, due to a mistake on the command issuing side, if the next request is written before the sound driver that received the request clears the command code to 0, there is a possibility that the newer command code will be set to 0 ( Ver-2.04 has taken some measures to prevent this phenomenon, but since there is a considerable speed difference between SH2 and 68000, it cannot be completely prevented.)
Due to the nature of the game being a real-time game using a control pad, most of the problems caused by command code handshakes are due to sound effects. A typical phenomenon that often occurs is ``Sometimes the sound effects don't come out.'' Please be careful.
When issuing a command, write all command parameters and then write the command code last. The sound driver takes command parameters as soon as it detects a command code, so if you write a command code for the first time, processing may be performed with unexpected command parameters.
The sound driver checks blocks 1 to 8 in order, so if you simply search for an empty block and set a command, the commands may be executed in a different order than the order in which they were written by the main system. If the execution order is swapped, the system may malfunction, so if you are executing a process that has a fixed execution order, set the commands so that the order will not be swapped.
In this procedure, the main system and sound driver process asynchronously, so even if you follow the above precautions, the order of commands may be swapped. If you need to preserve the order of execution, you can avoid this by using only one command block and making sure that the previous command has been processed before issuing the next command.
01H | SEQUENCE START | Start playing music and sound effects |
---|---|---|
02H | SEQUENCE STOP | Stop playing songs and sound effects |
03H | PAUSE | Pausing songs and sound effects |
04H | PAUSE OFF | Unpause songs and sound effects |
05H | SEQUENCE VOLUME | Adjust volume or fade in/out |
06H | STOP ALL | Stop all playing |
07H | TEMPO CHANGE | Changing the tempo of songs and sound effects |
08H | MAP CHANGE | Perform a map change |
09H | DIRECT MIDI CONTROL | Send MIDI events as commands |
0AH | START VOLUME ANALYZER | Start input level analysis of Digital Audio In |
0BH | STOP VOLUME ANALYZER | Digital Audio In input level analysis completed |
0CH | DSP STOP | Stopping and initializing DSP |
0DH | ALL NOTE OFF | All pronunciation stopped |
0EH | SEQUENCE PAN | Control PANPOT from the game |
10H | SOUND INITIALIZE | Initialize the sound driver |
11H | YAMAHA 3D CONTROL | YAMAHA 3D sound controls |
12H | QSOUND CONTROL | Qsound control |
13H | YAMAHA 3D INITIALIZE | YAMAHA 3D,Qsound localization initialization |
14H | TEMPO MODE | Setting the tempo mode |
15H | TEMPO RATIO | Setting relative tempo values |
80H | CD-DA LEVEL | Adjust CD-DA level |
81H | CD-DA PAN | CD-DA output Panpot settings |
82H | TOTAL VOLUME | Setting the total volume |
83H | EFFECT CHANGE | Switching effects |
85H | START PCM STREAM | PCM stream playback starts |
86H | STOP PCM STREAM | PCM stream playback stop |
87H | MIXER CHANGE | Mixer switching |
88H | MIXER PARAMETER CHANGE | Switching mixer parameters |
89H | HARDWARE CHECK | Check the hardware |
8AH | PCM PARAMETER CHANGE | Parameter switching for the PCM stream being played |
8BH | PCM SLOT ALLOCATION | Reserve a slot for PCM stream |
8CH | PCM SLOT RELEASE | Free up slots for PCM streams |