★ SOUND Manual ★ Sound Driver Programmer's Guide| order | Processing content | explanation |
|---|---|---|
| 1 | Stop 68000 (Reset the sound CPU) | Execute "Sound OFF" of the software library "SMPC Interface Library". |
| 2 | Initialize SCSP registers | Write 02h as a byte at address 25B00400 of the SH address. (DAC18B = 0, MEM4MB = 1 is set) |
| 3 | Clear the system area to zero | Clear all zeros from address 25A00000 to address 25A0AFFF of the SH address. |
| Four | Transfer the sound program to sound memory | Transfer the sound program (SDDRVS.TSK) from address 25A00000 of the SH address. |
| Five | Transfer the sound area map to sound memory | Transfer the sound area map from address 25A0A000 of the SH address. |
| 6 | Start 68000 (Release the sound CPU reset) | Execute "Sound ON" of the software library "SMPC Interface Library". |
remarks)
The maximum size of the sound area map is 0x1000 bytes, so if the size is larger than this, please divide it into multiple sound area maps. However, in that case, replace the sound area map before changing the map (explained in the section on how to play sound) if necessary.
Even if you know the details of the request command, you often do not know how to actually issue the command. The general request procedure is shown here, but it is recommended that you decide on the request command buffer allocation before doing so. The command buffer allocations recommended by SEGA are as follows (regardless of the order, the roles are divided).
| 0x25A00700 | Dedicated to important commands such as sound initials and map changes |
| 0x25A00710 | Pose on / off only |
| 0x25A00720 | Dedicated to on / off PCM stream playback |
| 0x25A00730 | For CD-DA control only |
| 0x25A00740 | Normal sound effect volume request only |
| 0x25A00750 | Normal sound effect performance on / off request only |
| 0x25A00760 | BGM volume request only |
| 0x25A00770 | BGM performance on / off request only |
This isn't always a good idea, but at least it's highly recommended that sound effects and other requests be buffer-distinguished. This is because most of the troubles related to sound requests are sound effects. This is due to the fact that the number of sound effect requests is extremely large compared to others, and that there are many cases where it is unpredictable because it is a real-time request by the control pad. Distinguishing this also saves you time in debugging, as well as not to affect other requests.
Now, I will explain the request procedure from the start of the game.
| +0 | +1 | +2 | +3 | +4 | +5 | +6 | +7 | +8 | +9 | + A | + B | |
| 0x0700 | Ten | - | 01 01 | 01 01 | 01 01 | 01 01 | 01 01 | - | - | - | - | - |
Write the above and set the timing flag.
| +0 | +1 | +2 | +3 | +4 | +5 | +6 | +7 | +8 | +9 | + A | + B | |
| 0x0700 | 08 08 | - | nn | - | - | - | - | - | - | - | - | - |
Write the above and set the timing flag.
| +0 | +1 | +2 | +3 | +4 | +5 | +6 | +7 | +8 | +9 | + A | + B | |
| 0x0700 | 83 | - | nn | - | - | - | - | - | - | - | - | - |
Write the above and set the timing flag.
| +0 | +1 | +2 | +3 | +4 | +5 | +6 | +7 | +8 | +9 | + A | + B | |
| 0x0700 | 87 | - | nn | nn | - | - | - | - | - | - | - | - |
Write the above and set the timing flag.
Once you have completed the above, you will be able to request songs and sound effects. Next, let's request the song with song number 2 in bank 1 with pronunciation control number 3. In this example, it is assumed that the sound creator does not specify the volume.
| +0 | +1 | +2 | +3 | +4 | +5 | +6 | +7 | +8 | +9 | + A | + B | |
| 0x0760 | 05 05 | - | 03 03 | 80 | 00 | - | - | - | - | - | - | - |
| 0x0770 | 01 01 | - | 03 03 | 01 01 | 02 02 | 00 | - | - | - | - | - | - |
Write the above and set the timing flag.
In this way, there is no mistake in issuing to the same INT as a set with the sequence volume command. Now, let's request the sound effect of song number 3 in bank 2 with pronunciation control number 7. Since the song produces sound effects without stopping, the song and sound effect pronunciation control numbers must be different.
| +0 | +1 | +2 | +3 | +4 | +5 | +6 | +7 | +8 | +9 | + A | + B | |
| 0x0740 | 05 05 | - | 04 | 80 | 00 | - | - | - | - | - | - | - |
| 0x0750 | 01 01 | - | 04 | 02 02 | 03 03 | 00 | - | - | - | - | - | - |
Write the above and set the timing flag.
Next, stop the song currently being played with pronunciation control number 3. Specify 0 for the end mode.
| +0 | +1 | +2 | +3 | +4 | +5 | +6 | +7 | +8 | +9 | + A | + B | |
| 0x0770 | 02 02 | - | 03 03 | 00 | - | - | - | - | - | - | - | - |
Write the above and set the timing flag.
You can stop playing with this one shot. Looking at the command reference, there are other commands that seem to stop the sound, but this is the only command that stops playing. Now let's fade out and finish the song. Let's set the speed of fading out to 0x0A. Most games are about this.
| +0 | +1 | +2 | +3 | +4 | +5 | +6 | +7 | +8 | +9 | + A | + B | |
| 0x0760 | 05 05 | - | 03 03 | 00 | 0A | - | - | - | - | - | - | - |
Write the above and set the timing flag. Usually, you can't wait until the song fades out completely, so issue a performance end command at an appropriate place.
| +0 | +1 | +2 | +3 | +4 | +5 | +6 | +7 | +8 | +9 | + A | + B | |
| 0x0770 | 02 02 | - | 03 03 | 00 | - | - | - | - | - | - | - | - |
Write the above and set the timing flag.
I've just finished the song, but after that, I'd like to replace the sound data by overlay processing. In this case, just in case (because a sequence such as a sound effect may be playing at another pronunciation control number), stop all sequences.
| +0 | +1 | +2 | +3 | +4 | +5 | +6 | +7 | +8 | +9 | + A | + B | |
| 0x0700 | 06 06 | - | - | - | - | - | - | - | - | - | - | - |
Write the above, set the timing flag, wait for the timing flag to turn off, return to the beginning, issue sound initials, load data, issue map change, issue effect change, issue mixer change.
★ SOUND Manual ★ Sound Driver Programmer's Guide