tialGeneral Notice
When using this document, keep the following in mind:

This document is confidential. By accepting this document you acknowledge that you are bound by
the terms set forth in the non-disclosure and confidentiality agreement signed separately and /in thepossession of SEGA. If you have not signed such a non-disclosure agreement, please contact SEGA
immediately and return this document to SEGA.

2.

This document may include technical inaccuracies or typographical errors. Changes are periodicallymade to the information herein; these changes will be incorporated in new versions of the document.
SEGA may make improvements and/or changes in the product(s) and/or the program(s) describedin this document at any time.

3.

No one is permitted to reproduce or duplicate, in any form, the whole or part of this document
without SEGA'S written permission. Request for copies of this document and for technicalinformation about SEGA products must be made to your authorized SEGA Technical Services
representative.

4.

No license is granted by implication or otherwise under any patents, copyrights, trademarks, or otherintellectual property rights of Sega Enterprises, Ltd., Sega of America, Inc., or any third party.

5.

Software, circuitry, and other examples described herein are meant merely to indicate thecharacteristics and performance of SEGA's products. SEGA assumes no responsibility for any
intellectual property claims or other problems that may result from applications based on theexamples describe herein.

6.

It is possible that this document may contain reference to, or information about, SEGA products(development hardware/ software) or services that are not provided in countries other than Japan.
Such references/ information must not be construed to mean that SEGA intends to provide such
SEGA products or services in countries other than Japan. Any reference of a SEGA licensed
product/program in this document is not intended to state or imply that you can use only SEGA's
licensed products/programs. Any functionally equivalent hardware/software can be used instead.

7.

SEGA will not be held responsible for any damage to the user that may result from accidents or any
other reasons during operation of the user's equipment, or programs according to this document.

SE
GA

Co

nfi

de
n

1.

NOTE: A reader's comment/correction form is provided with thisdocument. Please address comments to :SEGA of America, Inc., Developer Technical Support
150 Shoreline Drive, Redwood City, CA 94065
E:Mail: dts@sega.com

SEGA may use or distribute whatever information you supply in any way it
believes appropriate without incurring any obligation to you.

(r073096yn)

tia
l
de
n
nfi
Co
SE
GA

SEGA SATURNSound Driver
Implementation
ManualDoc. # ST-241-042795© 1995 SEGA. All Rights Reserved.

tialReader Correction/Comment Sheet
Keep Us Updated!

den

If you should come across any incorrect or outdated information while reading through the attacheddocument, or have any questions or comments, please let us know so that we can make the requiredchanges in subsequent revisions of the document. Simply fill out all relevant information below andreturn this form to the Developer Technical Support Manager at the address below. Please make more
copies of this form if more space is needed. Thank you for your cooperation!
General Information
Your Name:

Phone:

Document Number: ST-241-042795

Date:

Document Name: SEGA SATURN Sound Driver Implementation ManualCorrections
Page

Correction

SE
GA

Questions/Comments

Co

nfi

Chapter

Send Your Corrections/Comments to:
Fax:

415.802.1717
Attention: Evelyn Merritt
Developer Technical Support

E-Mail: dts@sega.com

Mail:

SEGA OF AMERICA, INC.
Attention:
Evelyn Merritt
Developer Technical Support
150 Shoreline Drive
Redwood City, California 94065

de
n

tia
l

ST-241-042795
SEGA Enterprises, Ltd.

SATURN Sound Driver

SE
GA

Co

nfi

Sound Incorporation Manual(DY, 05/26/95)

1

ST-241-042795
SEGA Enterprises, Ltd.

ContentstialPreface ..............................................................................................................................3
Limitations............................................................................................................3
Terminology...........................................................................................................4

System Overview..........................................................................................5
Hardware Overview.....................................................................................5Sound Driver.................................................................................................5Sound Memory...............................................................................................6

Chapter 2
2.1

Sound Driver Activation ...............................................................................7
Activating the Sound Driver .........................................................................7

Chapter 3
3.1
3.2
3.3
3.4

Sound Play....................................................................................................9Sound Types..................................................................................................9
Sequence Play ...............................................................................................11
PCM Stream Play..........................................................................................12
CD-DA Play.................................................................................................13

Chapter 4
4.1
4.2
4.3

Commands and Status Information.................................................................14
Command Area .............................................................................................14
Details on Command .....................................................................................15
Status Area...................................................................................................23

Chapter 5
5.1

System Area .................................................................................................26
Details on Interface Area ..............................................................................26

Chapter 6
6.1
6.2
6.3
6.4
6.5
6.6
6.7
6.8
6.9
6.10
6.11

Supplemental Information.............................................................................32
Executing Commands .....................................................................................32
Handling Sound Data....................................................................................34
CD-DA Play.................................................................................................35
PCM Stream Play..........................................................................................37
MIDI Direct Output.......................................................................................40
Fade-In and Fade-Out ...................................................................................41
DSP and Mixers.............................................................................................42
Sound Area Map............................................................................................45
3D Sound.......................................................................................................48
Sound Initial Command .................................................................................49
Hardware Check Command...........................................................................50

Chapter 7
7.1
7.2
7.3
7.4
7.5

Supplement...................................................................................................51
Details on Error Status Bit Map.....................................................................51
Details on SCSP Pan (32 Levels) ....................................................................52
Details on MIDI Pan Data (Correspondance between SCSP and Pan) ...............52
Check Points.................................................................................................53
Reference Data for Error Occurrences..............................................................57

SE
GA

Co

nfi

de
n

Chapter 1
1.1
1.2
1.3

Index .................................................................................................................................58(DY, 05/26/95)

2

ST-241-042795
SEGA Enterprises, Ltd.

Prefacetial

The purpose of this manual is to aid SATURN game programmers in incorporating
sound drivers into games. This manual also explains how to activate a soundsystem, the different sound types, and how to produce the sound.

denAlthough this manual provides detailed instructions on how users can program allsound controls, a Sound Interface Library provided by SEGA is also available forincorporating sounds. Readers are urged to use the library when necessary. For
information on the contents and usage of the Sound Interface Library, refer to it’suser’s manual.
Limitations
1. Sound Driver Ver. 1.29 does not support the timing flag handshake, which is acommand issuing method described in section 6.1, Executing Commands in“Supplemental Information.”nfi

2. Sound Driver Ver. 1.29 does not support the Yamaha 3D Sound and the Q
Sound, which are described in section 6.9,3D Sounds

SE
GA

Co

3. Sound Driver Ver. 1.29 does not support P4 priority level (0-31) of the sequence
start command (01h).

(DY, 05/26/95)

3

ST-241-042795
SEGA Enterprises, Ltd.

Term

Sound data
Tone data
Sequence data

DSP program
DSP work RAM
Sound creator
Main system

SE
GA

Co

nfi

Sample countDescription

Acronym for SATURN Custom Sound Processor. The sound generator LSI chip that forms thenucleus of the SATURN sound system.
Data stored in the sound memory. The three types of sound data are tone data, sequence data, andthe DSP program.
The tone portion used in playing sequence data. Tone data consists of PCM wave data, soundparameters, and FM tones.
Music play data. Sequence data is MIDI-composed music data that has been compressed for
SATURN and consists of play information such as sound strength, pitch, sound start, and sound stop.
Effects are created with thesame format.
A DSP microprogram that operates the sound DSP. Effect programs such as reverb and surround areavailable.
Area for the DSP delay RAM and effect coefficients. The DSP work RAM is used for DSP internal
processing. The size of this area changes according to the micro program.
Person in charge of creating sounds in a sound system. The sound creator creates tones and effects
and composes music.
Game program in the SH unit. The sound driver in the 68000 is the sound subsystem. The gameprogram, which controls the sound subsystem, is considered the main system.
A sample depends on the data width of the PCM wave. For 8-bit PCM, a sample is 1 byte. For 16-bit
PCM, a sample is 2 bytes. Thus a 4K sample contains 4,096 bytes for 8-bit PCM, and 8,192 bytes for
16-bit PCM.

de
n

SCSP

tia
l

Terminology(DY, 05/26/95)

4

ST-241-042795
SEGA Enterprises, Ltd.

Chapter 1

tialHardware Overview

Co

nfi

de
n

1.1

System Overview

The sound system centers around a sound source LSI chip that connects to a soundCPU, a 512 KB sound memory, a main system, and a CD interface. The main system
is able to access the sound memory and all SCSP I/O space through an SCU. The
main system also controls the sound CPU stop (reset) and restart (reset release)
operations through an SMPC.

SEGA

An important component is the sound memory, which controls all sound system
operations including sound driver execution, data management, storage of soundsource data, and intersystem communication.
1.2 Sound Driver
The sound driver is a sound control program that generates music and effects. The
program is stored in the sound memory and operates independently from the main
system. Therefore, to play music and effects, the main system need only executecommands.
Both the sound driver and the sound data are lost when the system is turned off, as
they are stored in the sound memory. The main system must therefore activate thesound driver each time the power is turned on. To do so, the main system mustfirst transfer the sound driver to the sound memory and then cancel the reset signal.
This operation activates the sound driver and allows music and effects to be played.

(DY, 05/26/95)

5

ST-241-042795
SEGA Enterprises, Ltd.

nfi

de
n

tia
l

1.3 Sound Memory
The sound memory includes a system area and a data area. The system area is a
fixed area used for sound driver operation and system management. The data area
is a variable area (variable mapping) that is used for sound source data storage andinternal DSP processing.

System Area

Data Area

Co

The system area consists of a storage area for the sound driver operation programand a work area. The work area includes a program work area for the sound driverand a system interface area that interfaces with the main system and the sounddevelopment system. The size of the system area is fixed at 44 KB, and cannot be
used for other purposes.

SEGA

The data area stores sound data. Three types of sound data--tone data, sequence data,
and the DSP program--are stored in various combinations (mappings). If PCM
stream play is performed, the data area is also used as a PCM stream play buffer.
Depending on the game or the scene, the data stored in this data area and themapping always change. In other words, the sound data is mapped for each scene in
the 4 Mb range.
DSP Work RAM Area

The DSP work RAM area is for the DSP delay RAM and effect coefficients. If the
DSP is not being used, this area is not necessary. Because of hardware constraints,
the first address of this area must be set to a 2000h boundary. Also note that the sizeof the delay RAM and coefficient area changes according to the DSP microprogram.

(DY, 05/26/95)

6ST-241-042795
SEGA Enterprises, Ltd.

tial

Chapter 2 Sound Driver Activation
2.1 Activating the Sound Driver
To activate the sound driver, transfer it to the sound memory and cancel the reset
signal. However, because the memory contents are not guaranteed when the poweris turned on, the memory must be initialized by zero-clear and other initializations.

2.1.1

Activation Procedure
Operation

1
2

Stop the 68000. (Reset the sound CPU.)
Initialize the SCSP registers.

3
4

Zero-clear the system area.
Transfer the sound program to the soundmemory.
Transfer the sound area map to the soundmemory.
Start the 68000. (Release the sound CPU
reset.)

5
6

The size of the sound area map can be up to 4,096 bytes. If the sound area map exceeds thissize, divide the data and create multiple sound area maps. In this case, replace the soundarea map before changing the map (see the explanation in Chapter 3, Sound Play
Procedure), if necessary.

SE
GA

Co

Note:

Description

Execute Sound OFF of the SMPC Interface Library (software library).
Write 02h (1 byte) to SH address 25B00400. (Set: DAC18B = 0 and
MEM4MB =1.)
Zero-clear all SH addresses from 25A00000 to 25A0AFFF.
Transfer the sound program (SDDRVS.TSK) to the SH addresses
beginning with 25A00000.
Transfer the sound area map to the SH addresses beginning with
25A0A000.
Execute Sound ON of the SMPC Interface Library (software library).

nfi

SequencedenActivate the sound driver according to steps 1 through 6 described below. This
procedure activates and runs the program from the beginning. For information on
the SCSP, reset, and other hardware details, refer to the SCSP and SMPC user’s
manuals.

(DY, 05/26/95)

7

ST-241-042795
SEGA Enterprises, Ltd.

2.1.2 Necessary Data Filestial

The activation of the sound driver requires only the main sound driver program.
The sound area map is also transferred during activation as it only has to betransferred once. During game operation, all area maps are stored in the sound area
map area. Prepare the following two data files when activating the sound driveraccording to this procedure:den

1. Sound driver (SDDRVS.TSK)
The sound driver forms the body of the program and is an executable binary data file.
SEGA provides the sound driver as a sound tool.

SE
GA

Co

nfi

2. Sound area map (user-specified name)
The sound area map is a binary data file formed by combining all area maps in a game.
This file is different for each game and is created by the sound creator. For details on
the sound area map, see section 6.8, Sound Area Map.

(DY, 05/26/95)

8

ST-241-042795
SEGA Enterprises, Ltd.

tial

Chapter 3 Sound Play
3.1 Sound Types
There are three different methods to producing sounds. The following tables
describe the advantages and disadvantages of each method. Select the appropriate
play method according to the content of the game and the particular scene. The
three methods are:den

1. Sequence play
2. PCM stream play
3. CD-DA playnfi

Sequence PlaySound generation Uses tone data (wave data) in the sound memory as the sound source and plays sounds while decompressing
methodthe sequence data.
Characteristics
Uses wave data as the sound source (an instrument) and treats the SATURN unit as a multi-sound source
instrument.
Advantages•
Many melodies can be included because the data size of each melody is small.
•Music can be modified and corrected easily.
•
Tempo can be changed in real-time.
•
CD access is not necessary.
•
The main system only issues requests. (The sound driver controls all of the above.)
Disadvantages
The wave capacity is limited to 4 Mb (512 KB) at any one time.

SE
GA

Co

PCM Stream PlaySound generation Loop-plays wave data. After sounds in the wave data are generated, the next wave data is transferred. Thismethodprocedure is repeated to allow continuous play of long wave data.
Characteristics
Allows long, prerecorded wave data to be played without modification. However, the wave data must betransferred continuously to ensure uninterrupted sound generation.
Advantages•
Wave data longer than 4 Mb can be played.
•
Various play patterns can be edited by modifying the transfer. (Edit synthesis is possible.)•
The data width can be set to 8 or 16 bits. The frequency can also be changed freely. (Memory efficiency isgood. The pitch can also be changed during record and play operations.)•
Several channels can be played concurrently.
Disadvantages
The wave data transfer adds a large overhead on the main system and the sound CPU.

(DY, 05/26/95)

9

ST-241-042795
SEGA Enterprises, Ltd.

SE
GA

Co

nfi

de
n

tia
l

CD-DA PlaySound generation Uses hardware to play audio sounds recorded on a CD audio track. This is the same method used to playmethodcommercial music CDs.
Characteristics
Plays long, prerecorded wave data without modification. The audio sounds are automatically output by hardware.
Advantages•
Realistic and highly expressive music can be played because sounds can be recorded live.
•
No overhead is placed on either the main system or the sound CPU.
Disadvantages•
The music cannot be modified or corrected easily, and must instead be re-recorded.
•
The data width and frequency are fixed at 16 bits and 44.1 KHz respectively. A large amount of wave data isrequired.
•Monopolizes the CD drive through constant CD access. This method monopolizes the CD drive.
•
The tempo cannot be changed in real-time.

(DY, 05/26/95)

10

ST-241-042795
SEGA Enterprises, Ltd.

Sequence Play

3.2.1

Map Change

tia
l

3.2

A game contains many scenes, and normally a different area map is used for eachscene. Therefore, always specify an area map before playing a sequence. Select thedesired area map from the available sound area maps, and execute map change.
After map change ends, transfer the sound data according to the map. This
completes the preparation for sequence play.

Map Change

Description

Stop all sounds.

2

Change the area map.

3

Transfer the sound data.

4

Report transfer completion.

5
6

Set the DSP.
Set the mixer.

Sequence Play

Execute the Sound Initial (10h) command. Use parameters to specify stopand initialization of all sounds.
Execute the Map Change (08h) command. Use a parameter to specify the
number of the area map to be changed.
Transfer the sound data to the area starting from SH address 25A0B000. If thesound data is divided into several files, transfer the data in each file according to thearea map.
For all sound data that was transferred, change the transfer completed bits in thesound area map CRNT work area (from SH address 25A00500h) to 1.
If necessary, execute the Effect Change (83h) command.
Execute the Mixer Change (87h) command. Set the mixer even if the DSP is
not being used.

Co

3.2.2

Operation

1

nfi

SequencedenExecute map change at least once after activating the sound driver, and then eachtime the area map changes. Follow steps 1 through 6 below to execute a mapchange.

After map change is completed, the sequence can be played at any time. Execute thesound control commands (such as sequence start and sequence stop) to play asequence. See Chapter 4, Commands and Status Information for details on issuingcommands.
The system may run uncontrolled if the area map is changed while sounds are being
produced or if the sound data being used is replaced. Even if sequence play is stopped andsound is not being produced, sound processing may occur internally. Be sure to execute step 1
above before changing the area map or the sound data.

SE
GA

Note 1:

Note 2:

The DSP work RAM is used in DSP internal processing. When the DPS is operating, itconstantly rewrites the contents of this area. Caution is necessary for area map changes
that change the size and address of the DSP work RAM. If the area map is changed during
DSP operation, transferred sound data in the original DSP work RAM is destroyed.

(DY, 05/26/95)

11

ST-241-042795
SEGA Enterprises, Ltd.

3.3

PCM Stream Playtia
l3.3.1 How Stream Play Works

To play data, the PCM stream play method plays long PCM wave data through loop
play . In loop play, after one segment of the PCM wave data is played, the next wave
data segment is written to the sound memory. This process is repeated until theentire wave data is played. This method can be used to play long PCM wave data,such as speech, long special effects, and recorded background music that normallywill not fit into sound memory.

Co

nfi

de
n

After the current wave data segment is played, the system writes the next wave data
segment. The following figure shows that after wave data A is played, wave data B
begins to play while the system writes the next wave data to data A. By repeating
this process, the system can play wave data of any length without interruption.

3.3.2

PCM Stream Play Procedure

SE
GA

Execute PCM stream play according to the procedure described below. For details on
issuing the sound control commands, see Chapter 4, Commands and Status
Information. Execute the following procedure for both the left and right channels.
Sequence

1
2
3
4
5
6

Note:

Operation

Transfer the first wave data to the wave data A and B areas.
Execute the PCM start (85h) command of the sound control commands.
After data A replay ends, transfer the next wave data to the wave data A area.
After data B replay ends, transfer the next wave data to the wave data B area.
Repeat the operations for 3 and 4 above.
Execute the sound control command PCM stop (86h) to end play

The buffer size, the transfer method, and the transfer timing are determined independently by
the main system. Select the optimum procedure for the scene without being bound to the above
procedure.

(DY, 05/26/95)

12

ST-241-042795
SEGA Enterprises, Ltd.

3.4

CD-DA Playtia
l3.4.1 How CD-DA Play Works

nfi

de
n

The CD-DA play method uses hardware to output audio data recorded on a CD
audio track. The recorded data is played unchanged according to the same principle
used in data recorders. Audio data read from the CD is transferred automatically to
the SCSP. Audio output can then be started by setting the CD-DA level on the SCSP.

3.4.2

CD-DA PlayCo

Sound memory
DRAM 4 Mb(512 KB)

To execute CD-DA play, read the audio data from the CD drive and set audio output
from the SCSP.

SEGACall the following two functions from the CDC system library to read audio data.
For details on the CDC library, see the CDC Library User's Manual.

[CDC library functions]
1. CDC_CdInit: Initializes the CD drive.
2. CDC-CdPlay: Plays the CD.

To set audio output from the SCSP, execute sound control commands CD-DA Level(80h) and CD-DA Pan (81h). See Chapter 4, Commands and Status Information for
details on issuing these commands.

(DY, 05/26/95)

13

ST-241-042795
SEGA Enterprises, Ltd.

Commands and Status InformationtialChapter 4

4.1 Command Area
Control commands are issued for the command block area shown below. Write thecommand code and the necessary parameters (P1 to P14) to a 16-byte command
block. The command block area contains eight command blocks, which can be used
to execute up to eight commands concurrently.

SE
GA

Co

nfi

de
n

For information on the write procedure, see section 6.1, Executing Commands.

(DY, 05/26/95)

14

ST-241-042795
SEGA Enterprises, Ltd.

A sequence play command or a command related to sequence play
A PCM stream play command or a command related to PCM stream play
A CD-DA play command or a command related to CD-DA play
Command related to two or all of the above, other command

de
n

S:
P:
C:
S/P/C:

tial

4.2 Details on Command
The sound control commands are categorized into four types according to the type ofsound to be played. The related play type for each command is described inparentheses (SPC) in the command name column.

For details on each parameter, refer to section 4.2.1 beginning on page 19 while
reading this table.
Command

01h

(S--)

Sequence Stop

02h

(S--)
Sequence Pause

03h

(S--)
Sequence Continue

04h

(S--)
Sequence Volume

05h

Tempo Change(S--)

Map Change(S--)
MIDI Direct Control

07h

08h
09h

SE
GA

(S--)

Co

(S--)

Parameters[Sequence play start]
P1: Sound control number (0-7)
P2: Sequence data bank number (0-15)
P3: Song number in sequence data (0-127)
P4: Priority level (0-31)[Sequence play stop]
P1: Sound control number (0-7)[Sequence play pause]
P1: Sound control number (0-7)[Sequence play continue]
P1: Sound control number (0-7)[Sequence volume and fade settings]
P1: Sound control number (0-7)
P2: Sequence volume (0-127)
P3: Fade rate (0-255)[Sequence play tempo change]
P1: Sound control number (0-7)
P2: Dummy (not used)
P3-P4: Tempo value (+32767 --> -32768)[Area map switching]
P1: Area map number (0-255)[MIDI direct output]
P1: MIDI command word (00h-FFh)
P2: MIDI channel word (00h-FFh)
P3: MIDI data 1 (00h-7Fh)
P4: MIDI data 2 (00h-7Fh)•
For details, see "MIDI Direct Output" in Chapter 6, Supplemental Information .

nfi

Command Name
Sequence Start(DY, 05/26/95)

15

ST-241-042795
SEGA Enterprises, Ltd.
CommandVolume Analyze Stop

0Bh

(--C)
DSP Stop

0Ch

(SPC)

Sound All Off

0Dh

(SPC)

Sequence Pan

0Eh

(S--)

Reserved
Sound Initial

0Fh
10h

3D Control(SPC)

Qsound Control

11h

12h

SE
GA

(SPC)

Co

(SPC)

tia
l

(--C)

Parameters[Input level analysis start for digital audio in]
No parameters[Input level analysis stop for digital audio in]
No parameters[DSP initialization]
No parameters•
This command is supported for compatibility with thethe host and will be deleted in the future. Use theSound Initial (10h) command instead.
[All sound stop]
No parameters•
This command is supported for compatibility with thehost and will be deleted in the future. Use theSound Initial (10h) command instead.
[Sequence Pan setting]
P1: Sound control number (0-7)
P2: Bit 7 0: Pan control OFF
1: Pan control ON
Bits 6-0 MIDI Pan data (00h-7Fh)•
For data values, see "Details on MIDI Pan Data."[Sound initialization
P1: Stop all sequence play (0-1)
P2: Stop all PCM stream play (0-1)
P3: Stop CD-DA play (0-1)
P4: Initialize DSP (0-1)
P5: Initialize mixer (0-1)•
From P1 to P5, all execution instructions are per 01h.
with 00h, no action is taken.
[3D sound control]
P1: Channel number (0-1)
P2: Distance (0-127)
P3: Horizontal position (0-127)
P4: Vertical position (0-127)[Qsound control]
P1: Channel number (0-7)
P2: Pan position (0-30)

de
n

0Ah

nfi

Command Name
Volume Analyze Start(DY, 05/26/95)

16

ST-241-042795
SEGA Enterprises, Ltd.
Command

CD-DA Pan

81h

(--C)
Total Volume

82h

(SPC)
Effect Change

83h

(SPC)
PCM Start

85h

(-P-)

PCM Stop

86h

(-P-)
87h

SE
GA

(SPC)

Co

Mixer Change

tia
l

(--C)

Parameters[CD-DA output level setting]P1: CD-DA level left, 8 levels (00h-E0h)
P2: CD-DA level right, 8 levels (00h-E0h)
Level values: 00h (off), 20h, 40h, 60h, 80h, A0h, C0h, E0h (max)[CD-DA output Pan setting]P1: CD-DA Pan left, 32 levels (0-31)
P2: CD-DA Pan right, 32 levels (0-31)[Total volume setting]
P1: Total volume, 16 levels (0-15)[Total effect switching]P1: Effect bank number (0-15)[PCM stream play start]
P1: Bit 7 0: Mono 1: Stereo
Bits 6-5
Not used
Bit4 0: 16-bit PCM
1: 8-bit PCM
Bits 3-0
Play-start PCM stream play number (0-7)
P2: Bits 7-5
Direct sound output level, 8 levels (0-7)
Bits 4-0
Direct sound output Pan, 32 levels (0-31)
P3-P4 PCM stream buffer start address (0000h-FFFFh)
P5-P6 PCM stream buffer size (0000h-FFFFh)
P7-P8 Pitch word (0000h-7FFFh)
P9: Bits 7-3
Effect input channel (0-15) [P9=Rch]
Bits 2-0
Effect input level, 8 levels (0-7)
P10: Bits 7-3
Effect input channel (0-15) [P10=Lch]
Bits 2-0
Effect input level, 8 levels (0-7)[PCM stream play stop]
P1: Play-stop PCM stream play number (0-7)[Mixer switching]
P1: Tone data bank number (0-15)
P2: Mixer number in tone data (0-127)

de
n

80h

nfi

Command Name
CD-DA Level(DY, 05/26/95)

17

ST-241-042795
SEGA Enterprises, Ltd.
Command(SPC)

Hard Check

89h

(---)

PCM Parameter Change

8Ah

SE
GA

Co

nfi

(-P-)

Parameter[Mixer parameter change]
P1: Effect output channel (0-17)
P2: Bits 7-5
Effect output level, 8 levels (0-7)
Bits 4-0
Effect output Pan, 32 levels (0-31)[Hard check]
P1: Check items 00h: DRAM 4 Mb read/write
01h: DRAM 8Mb read/write
02h: SCSP MIDI
03h: Sound source output (L/R)
04h: Sound source output (L)05h: Sound source output (R)[Parameter change for PCM stream play]
P1: PCM stream play number (0-7)
P2: Bits 7-5
Direct sound output level, 8 levels (0-7)
Bits 4-0
Direct sound output Pan, 32 levels (0-31)
P3-P4: Pitch word (0000h-FFFFh)
P5: Bits 7-3
Effect input channel (0-15) [P5=Rch]
Bits 2-0
Effect input level, 8 levels (0-7)
P6: Bits 7-3
Effect input channel (0-15) [P6=Lch]
Bits 2-0
Effect input level, 8 levels (0-7)

tia
l

88h

de
n

Command Name
Mixer Parameter Change(DY, 05/26/95)

18

ST-241-042795
SEGA Enterprises, Ltd.

4.2.1
•

Parameters

Sound Control Number (0-7)

•

tia
l

Specifies a sound control number from 0 to 7 at sequence start. This parameter isused because sequence play allows up to eight concurrent sequence plays. The
specified sound control number is used later to stop, pause, or restart sequence
play.
Sequence Data Bank Number (0-15)•

Song Number in Sequence Data (0-127)denSpecifies the position of the sequence bank (sequence data storage area) in thecurrent area map if the area map contains more than one sequence bank. Sincean area map can hold up to 16 sequence banks, 0 to 15 values are allowed. If thearea map contains only one sequence bank, the parameter value will always be 0.

•

nfi

Specifies the sequence number of the song data within the sequence data area.
This parameter is used because one sequence data area can store data for multiple
songs. Since one sequence data area can store up to 128 songs, 0-127 values areallowed. If the sequence data contains only one song, the parameter value will
always be 0.
Priority Level (0-31)•

Sequence Volume (0-127)

Co

Specifies the priority level when a sequence is played. There are 32 priority levels(0 to 31), where level 0 has the highest priority. When the 32 sound slots
become full, the sounds are played according to reverse arrival priority. Thispriority sequence is also used to control which sounds are erased when the system
plays the later arriving sounds.
Specifies the sequence volume with a value from 0 to 127, where value 127 is thehighest volume (fundamental tone). The fade rate can be set to determine howlong it takes to reach the specified volume. After the fade, the final volume is
kept as the current sequence volume. If fade is not necessary, set the fade rate (P3)
to 0, and set only the sequence volume.
•

Fade Rate (0-255)

SE
GA

Specifies the required time for the current sequence volume to reach the specified
sequence volume with a rate from 0 to 255, where 255 is the longest. The change
delay becomes longer as the value increases. (If 0 is specified, fade is not
performed, and only the sequence volume is set.) The fade direction is from thecurrent sequence volume to the specified sequence volume. The fade-in andfade-out areas are determined by whether the specified sequence volume is larger
or smaller than the current sequence volume.

•

Tempo Value (+32767 --> - 32768)

Specifies the relative tempo volume in relation to the standard tempo value(0000h). The tempo is doubled for every positive 1000h (4,096) and is halved forevery negative 1000h. In other words, the interval can be controlled with a
precision of 4,096 levels until the tempo is doubled (or halved). Since 0 is thestandard tempo, the original tempo can be restored by specifying 0000h.

(DY, 05/26/95)

19

ST-241-042795
SEGA Enterprises, Ltd.

•Area Map Number (0-255)

•

tia
l

Indicates which area map from the start address within the sound area map
should be specified.
Pan Control ON/OFF (Bit 7: 0/1)

Specifies whether or not sequence Pan control is to be executed. If the specified
value is 1, sequence Pan control is executed. If the specified value is 0, control is
not executed.
•

3D Channel Number (0-1)

•

de
n

Specifies the channel number that controls Yamaha 3D sound. A maximum of
two channels can be used; specify 0 or 1.
3D Distance (0-127)

Specifies the distance from the listening point to the virtual sound source for
Yamaha 3D sound. The value 0 indicates a distance of 0. The distance increases as
the value becomes larger.
•

3D Horizontal Position (0-127)•

nfi

Specifies the horizontal position of the virtual sound source for Yamaha 3D
sound as viewed from the listening point. A value of 0 = straight ahead; value
32 = 90 degrees to the right; value 64 = directly behind; and value 96 = 90 degrees tothe left.
3D Vertical Position (0-127)•

Q Channel Number (0-7)

Co

Specifies the vertical position of the virtual sound source for Yamaha 3D sound as
viewed from the listening point. A value of 0 = directly above; value 32 = directly
ahead; value 64 = directly below; and value 96 = directly behind.
Specifies the channel number that controls Q sound. Up to eight channels can beused, and values between 0 and 7 can be specified.
•

Q Pan Position (0-30)

SEGA

Specifies the Pan position for Q sound. A value of 0 = 90 degrees to the left; value
15 = center; and value 30 = 90 degrees to the right. There are 15 levels for both left
and right.
•

CD-DA Level (00h-E0h)

Sets the CD-DA output level. There are eight output volume levels, with 00h as
the lowest (=off) and E0h as the highest.
Off <-------------------------------------> Max
00h, 20h, 40h, 60h, 80h, A0h, C0h, E0h•

CD-DA Pan (0-31)

Sets the CD-DA output Pan. For more information, see section 7.2, Details on
SCSP Pan (32 Levels).

•

Total Volume (0-15)

Sets the SCSP total volumes (overall volume for all play operations). There are
16 volume levels, with 0 as the lowest (=off) and 15 as the highest.

(DY, 05/26/95)

20

ST-241-042795
SEGA Enterprises, Ltd.

•

Effect Bank Number (0-15)

•

tia
l

Specifies the position of the DSP bank (DSP microprogram storage area) in thecurrent area map if the area map contains more than one DSP bank. Since one
area map can hold up to 16 DSP banks, 0 to 15 values are allowed. If the area
map contains only one DSP bank, the parameter value will always be 0.
PCM Stream Play Number (0-17)

•

de
n

Specifies the PCM stream play number with a value from 0 to 7 since the PCM
stream play can play up to eight streams concurrently. For stereo output, notethat one play number plays two streams: Lch and Rch. The maximum total
number of streams for mono and stereo is eight streams. The command isignored if there are more than eight streams.
Direct Sound Output Level (0-7)

Sets the direct sound output level. There are eight levels with 0 as the lowest
volume (=off).
•

Direct Sound Output Pan (0-31)•

nfi

Sets the direct sound output Pan. For more information, see Section 7.2, Details
on SCSP Pan (32 Levels .
PCM Stream Buffer Start Address (0000h-FFFFh)

Specifies the start address of the PCM stream buffer. This parameter specifies theupper 16 bits of the 20-bit address.
•

PCM Stream Buffer Size (0000h-FFFFh)•

Pitch Word (0000h-7FFFh)

Co

Specifies the size of the PCM stream buffer. The value is the sample count foreach channel. The same value is used for both mono and stereo operations.

SE
GA

Specifies the SCSP pitch register value (16 bits).

OCT: Specifies the octave as a two's complement. The allowed values are -8 octave to +7
octave.
FNS: Specifies the interval from the standard pitch (0) to one octave above (1023) with 1,024
levels. Bits 15 and 10 are always 0.
Note:

For an explanation of the pitch calculation procedure, see Calculating the Pitch insection 6.4, PCM Stream Play.

(DY, 05/26/95)

21

ST-241-042795
SEGA Enterprises, Ltd.

•

Effect Input Channel (0-15)

•

tia
l

Specifies the DSP effect in each channel. The allowed values are 0 to 15 because
there are 16 DSP effect input channels. For details, see section 6.7, DSP and
Mixers.
Effect Input Level, 8 levels (0-7)•

Tone Data Bank Number (0-15)

denSpecifies the direct sound level to be sent to the effect input channel. The level is
specified with a value from 0 to 7. There are 8 levels with 0 as the lowest level(=off).
Specifies the position of the tone bank (tone data storage area) in the current area
map if the area map contains more than one tone bank. Values can be specified
between 0 and 15 since one area map can hold up to 16 tone banks. If the area
map only has one tone bank, the parameter value will always be 0.
•

Mixer Number in Tone Data (0-127)•

Effect Output Channel (0-15, 16-17)

nfi

Specifies the sequence number of the mixer data within one tone data area. Thisparameter is used because one tone data can store data for multiple mixers.
Values can be specified between 0 and 127 since one tone data area can store up to
128 mixers. If the tone data contains only one mixer, the parameter value will
always be 0.

•

Effect Output Level (0-7)

Co

Specifies the DSP effect out channel. Since there are 16 DSP effect output
channels, 0 to 15 values are allowed. When CD-DA is selected, either 16 (Lch) or
17 (Rch) is specified. For details, see section 6.7, DSP and Mixers.
Specifies the effect level to be output from the effect output channel. The level is
specified with a value from 0 to 7. There are eight levels with 0 as the lowest
level (=off)•

Effect Output Pan (0-31)

SE
GA

Specifies the effect Pan that is output from the effect output channel. The Pan
is specified with a value from 0 to 31. For details, see section 7.2, Details on SCSP
Pan (32 Levels).

(DY, 05/26/95)

22

ST-241-042795
SEGA Enterprises, Ltd.

SE
GA

Co

nfi

de
n

tia
l

4.3 Status Area
When a sound control command is executed, the current execution state and all
pertinent information are sent to the main system as the return status. The return
status is stored in the status area of the system area and can be referenced whennecessary.

(DY, 05/26/95)

23

ST-241-042795
SEGA Enterprises, Ltd.

Sequence Play Mode and Status+0+1

Sequence play mode (0-4)
Sequence play status (0-FFh)

tia
l

4.3.1

During sequence play, the current status is constantly written to the mode and statusareas. To find out the current sequence play status, reference these areas.

den

The mode status area corresponds to sound control numbers 0 to 7 and contains a
total of 16 bytes for 8 sequences of 2 bytes each. For details on the area addresses, see
the section that describes the host interface work RAM found in the system area.
[Sequence play mode][Sequence play status]

00h: Initial status
01h: Playing
02h: Fading
03h: Pause during play
04h: Pause during fade

00h: Normal
80h: Outside resolution range
81h: No tempo data
82h: No event data
83h: Outside tempo data range
FFh: Data error during data decompression

CD-DA Input Level

nfi

4.3.2

Co

The CD-DA input level area stores the signal level of the digital audio input signal.
When the Volume Analyze Start (0Ah) control command for Digital Audio In is executed,
the system begins searching for the input signal and sets this area. The values arefrom 0 to 7FFFh, with 0 indicating the absence of an input signal and 7FFFh
indicating the maximum input signal level. Because the input signal level is a
momentary value, it changes as the input signal level changes.
Normally, only the total level of Lch and Rch is stored. However, a special DSP
program (DSP-3 Band Ana.EXB) can be used to detect the input signal at three levels:
high-tone band, mid-tone band, and low-tone band. This program only allows
detection of the input signal level. Even if the output volume is exceeded by the CDDA Level (80h) control command, the signal set in this area does not change.
Level detection places a load on the sound driver. If level detection is not necessary, execute
the Volume Analyze Stop (0Bh) control command for Digital Audio In to stop the process.

SE
GA

Note:

(DY, 05/26/95)

24

ST-241-042795
SEGA Enterprises, Ltd.

PCM Stream Play Address+0+1

PCM stream play position (1-15)
Unused

tia
l

4.3.3

de
n

The PCM stream play address area stores the position of the data currently being
played. This position is the sample count from the beginning of the PCM stream
play buffer and is indicated with a value from 0 to 15. The system can monitor 4K
sample units (4 Kb for 8-bit play, 8 Kb for 16-bit play). If the value increments by 1,
the play position advances by 4K samples. In stereo play, Rch and Lch have thesame play address.

4.3.4

Sequence Play Position+0+1

Sequence play position (H)Sequence play position (L)nfi

The PCM stream play position area corresponds to stream play numbers 0 to 7 andcontains a total of 16 bytes for 8 streams of 2 bytes each. For details on the area
addresses, see the section that describes the host interface work RAM found in thesystem area.

Co

The sequence play position area stores the sequence play position during sequenceplay. Values from 0 to FFFh are stored sequentially in this area. The current value
indicates the elapsed time since play was started and provides an approximation of
the current play position. The value increments by 1 every 100 ms.
The sequence play position area corresponds to sound control numbers 0 to 7 andcontains a total of 16 bytes for 8 sequences of 2 bytes each. For details on the area
addresses, see the section that describes the host interface work RAM found in thesystem area.
The sequence play position represents the absolute time that has elapsed. If the tempo ischanged, the same value will indicate a different position. For accurate synchronization of
the sequence being played, store synchronization messages in the sequence data.

SE
GA

Note:

(DY, 05/26/95)

25

ST-241-042795
SEGA Enterprises, Ltd.

tial

Chapter 5 System Area

SE
GA

Co

nfi

de
n

5.1 Details on Interface Area
The system area is a fixed area used to operate the sound driver provided by SEGA.
As shown in the following figure, the system area consists of five areas. The systeminterface area controls the entire system. (Refer to the next section for more
information on the system interface area.)(DY, 05/26/95)

26

ST-241-042795
SEGA Enterprises, Ltd.

5.1.1

System Interface Table (400H-43FH:

64B)

Size

0400h

4B

Pointer to system information table

Data Contents

Start address of system information table

Description

0404h

4B

Pointer to host interface work area

Start address of host interface work area

0408h

4B

040Ch

4B

0410h
0411h
0412h

1B
1B
4B

0416h
0418h
041Ah
041Ch
0420h
0424h

2B
2B
2B
4B
4B
4B

0428h

24 B

tia
l

Address(440h)

Size

+00h
+04h
+08h
+0Ch
+10h
+14h
+18h

4B
4B
4B
4B
4B
4B
40 B

de
n

Data Contents

68K program start address
68K program size
Sound area map start address
Sound area map size
68 K work area start address
68K work area size
Reserved area

64B)

Description

Start address of 68K program area
Size of 68K program area
Start address of sound area map area
Size of sound area map area
Start address of 68K work area
Size of 68K work area-

(1000h)(6000h)(A000h)(1000h)(7000h)(3000h)SE
GA

Offsetnfi

System Information Table (440H-47FH:

Co

5.1.2

(700h)
Pointer to sound area map CRNT work Start address of sound area map CRNT work area
area
(500h)
Pointer to tool interface work area
Start address of tool interface work area
(600h)DSP program load flag
Bit 7 = 0: No data 1: DSP program load completed
Reserved area
Pointer to system interface work area
Start address of system interface work area
(480h)
Error status
Area for storing error status of sound driver
Hardware check status
Area for storing return status of hardware check
Command history offset address
Write pointer for sound control command history (800h-FFFh)
Reserved area
Error status bit map
Bit map for sound driver error status
Pointer to system interface work area
Start address of system interface work address(412h copy: for SH)
Reserved area-

(DY, 05/26/95)

27

ST-241-042795
SEGA Enterprises, Ltd.

System Interface Work Area (480H-4FFH:

+01h

1B

+02h

1B

+03h

1B

+04h

1B

+05h
+06h
+07h
+08h
+28h
+58h
+60h

1B
1B
1B
32 B
48 B
8B
1B

+61h

1B

+62h
+70h

14 B
16 B

Data Contents

Description

Interrupt control word
(Host ---> Sound)Bit 7: IPT enable
0: Disables PCM play address update interrupt
1: Enables PCM play address update interrupt
Interrupt type (1-127)
1: PCM play address update interrupt(Sound ---> Host)
2-127: Not used
Corresponding stream play number Corresponding stream play number when PCM play address update(Sound ---> Host)interrupt is executed•
Bits 0-7 correspond to PCM play numbers 0-7 (bit=1: Updated)
Sound mode control word
Bit 7: Sound mode 0: Stereo output(Host ---> Sound)
1: Mono output
3D sound control word
Bit 7: 3D 1-ch mode 0: Not used
1: Used(Host ---> Sound)Bit 6: 3D 2-ch mode 0: Not used
1: UsedBit 5: Q sound 4-ch mode 0: Not used 1: Used
Bit 4: Q sound 8-ch mode 0: Not used 1: Used
Q sound COEF pointer
Q sound COEF pointer
3D sound COEF pointer
3D sound COEF pointer
3D sound MADRS pointer
3D sound MADRS pointer
3D sound parameter
3D sound parameter storage area
3D sound program work
3D sound program work area (30h)Reserved area
Command sequence timing flag
Bit 7: Timing flag
0: Idle(Host ---> Sound)
1: Command set completed
Command sequence control word Bit 7: Command mode
0: Handshake off (V1.00-1.29)(Host ---> Sound)
1: Handshake on (V1.30)
Reserved area
Titan work area
Reserved area for Titan compatibility (not used by SATURN)

tia
l

1B

de
n

Size

+00h

SE
GA

Co

Offset

128B)

nfi

5.1.3

(DY, 05/26/95)

28

ST-241-042795
SEGA Enterprises, Ltd.

Sound Area MAP CRNT Work Area (500H-5FFH:
Size

+00h

8B

Data Contents

Description

Map information 1

tialOffset.
.
.

Map information 32

Tool Interface Work Area (600H-6FFH:
Size

+00h
+04h
+08h
+0Ch
+0Eh
+12h
+16h
+18h
+1Ch
+20h
+40h
+44h
+46h
+4Ah
+4Eh
+4Fh
+80h
:
+FCh

4B
4B
4B
2B
4B
4B
2B
4B
4B
32 B
4B
2B
4B
4B
1B
49 B
4B
:
4B

Data Contents

Reserved area
Wave edit start address
Wave edit total size
Reserved area
Tone editor start address
Tone editor total size
Reserved area
TrgtMem_DSPprogAddress
TrgtMem_DSPprogSize
TrgtMem_Filename
TrgtMem_DSPRAMSize
TrgtMem_RBL
TrgtMem_ModElementAddress
TrgtMem_ModElementSize
TrgtMem_NumberOfElements
Reserved area
Voice 1 monitor:
Voice 32 monitor

Description

Start address of RAM area for wave editing
Total size of RAM area for wave editing
Start address of RAM editor for tone editor
Total size of RAM area for tone editor
Dedicated DSP linker area
Dedicated DSP linker area
Dedicated DSP linker area
Dedicated DSP linker area
Dedicated DSP linker area
Dedicated DSP linker area
Dedicated DSP linker area
Dedicated DSP linker area
Voice # / Note / Velocity:
Voice # / Note / Velocity

SE
GA

Offset

256B)

Co

5.1.5

8B

nfi

+F8h

256B)

de
n

5.1.4

(DY, 05/26/95)

29

ST-241-042795
SEGA Enterprises, Ltd.

5.1.6

Host Interface Work Area (700H-7FFH:

256B)• Command block area (700h-77Fh: Main system ---> sound driver)
Data Contents

Command block 1
Command block 2
Command block 3
Command block 4
Command block 5
Command block 6
Command block 7
Command block 8

Description

tia
l

16 B
16 B
16 B
16 B
16 B
16 B
16 B
16 B

Command block 1 from host to sound driver
Command block 2 from host to sound driver
Command block 3 from host to sound driver
Command block 4 from host to sound driver
Command block 5 from host to sound driver
Command block 6 from host to sound driver
Command block 7 from host to sound driver
Command block 8 from host to sound driver

de
n

Size

+00h
+10h
+20h
+30h
+40h
+50h
+60h
+70h

SE
GA

Co

nfi

Offset(DY, 05/26/95)

30

ST-241-042795
SEGA Enterprises, Ltd.

• Status area (780h-7FFh: Sound driver ---> main system)
Data Contents

Description

tialSequence play mode/status for sound control no. 0
Sequence play mode/status for sound control no. 1
Sequence play mode/status for sound control no. 2
Sequence play mode/status for sound control no. 3
Sequence play mode/status for sound control no. 4
Sequence play mode/status for sound control no. 5
Sequence play mode/status for sound control no. 6
Sequence play mode/status for sound control no. 7
Digital audio input level Lch (0000h-7FFFh)
Digital audio input level Rch (0000h-7FFFh)
High-range input level Lch (0000h-7FFFh)
High-range input level Rch (0000h-7FFFh)
Middle-range input level Lch (0000h-7FFFh)
Middle-range input level Rch (0000h-7FFFh)
Low-range input level Lch (0000h-7FFFh)
Low-range input level Rch (0000h-7FFFh)
PCM stream play position (0-15) of stream play no. 0
PCM stream play position (0-15) of stream play no. 1
PCM stream play position (0-15) of stream play no. 2
PCM stream play position (0-15) of stream play no. 3
PCM stream play position (0-15) of stream play no. 4
PCM stream play position (0-15) of stream play no. 5
PCM stream play position (0-15) of stream play no. 6
PCM stream play position (0-15) of stream play no. 7
Sequence play position (0000h-FFFFh) of sound control no. 0
Sequence play position (0000h-FFFFh) of sound control no. 1
Sequence play position (0000h-FFFFh) of sound control no. 2
Sequence play position (0000h-FFFFh) of sound control no. 3
Sequence play position (0000h-FFFFh) of sound control no. 4
Sequence play position (0000h-FFFFh) of sound control no. 5
Sequence play position (0000h-FFFFh) of sound control no. 6
Sequence play position (0000h-FFFFh) of sound control no. 7-

denSequence play 0 mode/status
Sequence play 1 mode/status
Sequence play 2 mode/status
Sequence play 3 mode/status
Sequence play 4 mode/status
Sequence play 5 mode/status
Sequence play 6 mode/status
Sequence play 7 mode/status
Input level Lch
Input level Rch
H-vol L
H-vol R
M-vol L
M-vol R
L-vol LL-vol RPCM stream play 0 address
PCM stream play 1 address
PCM stream play 2 address
PCM stream play 3 address
PCM stream play 4 address
PCM stream play 5 address
PCM stream play 6 address
PCM stream play 7 address
Sequence play 0 play position
Sequence play 1 play position
Sequence play 2 play position
Sequence play 3 play position
Sequence play 4 play position
Sequence play 5 play position
Sequence play 6 play position
Sequence play 7 play position
Reserved area

nfi

2B
2B
2B
2B
2B
2B
2B
2B
2B
2B
2B
2B
2B
2B
2B
2B
2B
2B
2B
2B
2B
2B
2B
2B
2B
2B
2B
2B
2B
2B
2B
2B
64 B

Co

Size

+80h
+82h
+84h
+86h
+88h
+8Ah
+8Ch
+8Eh
+90h
+92h
+94h
+96h
+98h
+9Ah
+9Ch
+9Eh
+A0h
+A2h
+A4h
+A6h
+A8h
+AAh
+ACh
+AEh
+B0h
+B2h
+B4h
+B6h
+B8h
+BAh
+BCh
+BEh
+C0h

SE
GA

Offset(DY, 05/26/95)

31

ST-241-042795
SEGA Enterprises, Ltd.

Chapter 6

Supplemental Information

tial

6.1 Executing Commands
Commands can be executed by using two methods: timing flag handshake (forSound Driver version 1.30 and later), and command code handshake (for Sound
Driver versions 1.00 to 1.29.)

6.1.1

de
n

Although either method can be selected, the default is command code handshakeset for upward compatibility. When timing flag handshake is selected, set the"command sequence control word (4E1h)" in the system interface work area to thetiming flag handshake side. For setting instructions, see section 5.1.3, System
Interface Work Area.
Timing Flag HandshakenfiThis method uses a timing flag to ensure that commands written by the main
system are executed in the correct sequence. To execute commands by using atiming flag, follow the procedure below. The "timing flag (4E0h)" area is located in
the system interface work area. For details, see section 5.1.3, System Interface WorkArea.
Main System Processing (Issuing Commands)

Co

1. If the timing flag is 0, the main system writes the commands to be executed into thecommand blocks. (Up to eight commands can be written. Spaces are permitted between
the command blocks.)
2. The main system changes the timing flag to 1.
Sound Driver Processing (Accepting and Executing Commands)

SEGA

1. If the timing flag is 1, the sound driver starts command execution sequentially fromcommand block 1. (The command blocks are executed in sequence from block 1 to block 8.
If the command code for a block is 00h, the sound driver skips that block and proceeds tothe next block.)
2. After execution of a command ends, the sound driver returns the command code in acommand block to 00h.
3. After processing command blocks 1 to 8, the sound driver returns the timing flag to 0.

(DY, 05/26/95)

32

ST-241-042795
SEGA Enterprises, Ltd.

6.1.2

Command Code HandshaketialThis method executes commands by checking whether the command code is 00h. In
this method, the main system checks that the command code is 00h and thenexecutes commands while preserving the block 1 to block 8 sequence. Similarly, thesound driver checks the sequence from block 1 to block 8 and, if a command code iswritten, the commands are processed again.

denWhen command code processing ends, the sound driver clears the command code
to 00h. If the command code has not been cleared to 00h, it means that the sounddriver is still processing commands or is waiting to start processing. Conversely, if
the command code has been cleared to 00h, the sound driver has completed allcommand processing.
Notes on Using the Command Code Handshake Method

When issuing a command, first write all command parameters, and then write the commandcode. When the sound driver detects a command code, it immediately retrieves thecommand parameters. If the command code is written first, the code may be processedwith unexpected command parameters.

•

The sound driver checks the command blocks in sequence from block 1 to block 8. If acommand is set to any empty block that is found, the commands may not be executed in thesame sequence written by the main system. If the execution sequence is switched, a system
malfunction may occur. Therefore, to execute the commands in the desired intended
execution sequence, set the commands so that the execution sequence will not switch.

•

In this procedure, the main system and the sound driver operate asynchronously, and thecommand sequence may be switched even when the above notes are followed. Use only one
command block to prevent sequence switching in situations when the execution sequencemust be maintained, then check to ensure that the previous command was processed before
issuing the next command.

SE
GA

Co

nfi

•

(DY, 05/26/95)

33

ST-241-042795
SEGA Enterprises, Ltd.

tial

6.2 Handling Sound Data
The sound data for all 512 KB of sound memory can either be stored in one file or inseparate files. See below for the advantages and disadvantages of each method.
Select the best method for the particular game or scene.
• Storing all sound data into one filedenAdvantages:
The sound data need to be transferred only once,and data management is easy. SEGA
recommends this method for most situations.

Disadvantages:
The file size is large, and the data volume
becomes large. Although some space may be
wasted, this should not be a problem considering
the CD capacity.

nfi

DSP program• Storing sound data into separate files

Co

Advantages:
Data can be stored without wasting space.

SE
GA

Disadvantages:
There are many files to manage. The large
number of files may lead to problems such astransfer errors, incorrect versions, and incorrect
mapping.

For the reasons described above, SEGA recommends that the sounddata normally be stored in one large file. If data replacement isnecessary, store the replacement data in a separate data file.

(DY, 05/26/95)

34

ST-241-042795
SEGA Enterprises, Ltd.

6.3

CD-DA Play6.3.1 Characteristics of CD-DA Play

de
n

tia
l

Audio data is transferred from the CD interface directly to the SCSP and output as
audio sound. Therefore, the main system only has to execute a play request to the
CD interface and does not need to read or transfer data to the sound memory.
CD-DA play places the smallest load on the main system and the sound system, butmonopolizes the CD drive while sounds are being played. In other words, the CD
drive can only be accessed to output sounds. In situations that allow CD drive
monopolization, this method produces the best quality sound available in thissound system.

SE
GA

Co

nfi

The frequency and data width are fixed at 44.1 KHz and 16 bits, which are the sameas the CD standards. Also, the pitch and tempo cannot be changed during play.
Furthermore, implementing this high quality sound requires an extremely large
amount of audio data. Just as in normal music CDs, one CD will only hold from 10
to 20 melodies. Because the CD will also contain the game program and the image
data, the CD actually will hold only about five to six melodies.

(DY, 05/26/95)

35

ST-241-042795
SEGA Enterprises, Ltd.

6.3.2

Creating CD-DA Data

Some tools output PCM wave data in which the 16-bit low/high relationship is reverse.
Generally, Intel family CPUs feature a low/high format, while the Motorola family CPUs
feature a high/low format. If the CPU outputs data in the Motorola format, convert thedata to the Intel format. If necessary, prepare a tool that facilitates inversion of the
low/high format.

SE
GA

Note 1:

Co

nfi

de
n

tia
l

CD-DA data is the recorded PCM audio wave data, and is saved as a data file.
Although the amount of data is large, CD-DA is the simplest audio data to use
because manipulation and detailed processing are not required. CD-DA data can becreated with the sound tool wave editor provided by SEGA, or any othercommercial wave editing tool, as long as it outputs 16-bit stereo PCM data at 44.1
KHz. Melodies and effects can be digitally recorded, or analog audio sounds can beconverted to digital. For mono play, the same data is recorded to both Lch and Rch.

Note 2:Mixer settings are necessary to use a DSP (for effects) with the CD-DA. When using a DSP,
prepare the necessary mixer data, and execute the Mixer Change (87h) command. Even if
there is no sequence play, tone data is necessary for the mixer settings.

(DY, 05/26/95)

36

ST-241-042795
SEGA Enterprises, Ltd.

6.4

PCM Stream Playtia
l6.4.1 Handling the Data Area

Execution of PCM stream play requires a data area (PCM stream buffer) for playing
the PCM wave data. The PCM stream buffer can be allocated to any location in thesound memory. Normally, an area that is not being used by tone or melody data isused. However, a tone bank that is not used during PCM stream play can also be
used.

de
n

The current play position can be known within a 4K sample unit. This means that
PCM stream play can be executed as long as at least two 4K sample buffers areprepared. The total size of the PCM stream buffers can be set to hold anywhere up to
64K samples per channel.
6.4.2 Buffer Write Timing

Buffer Allocation Examples

If two 4K sample buffers are allocated
If three 4K sample buffers are allocatedIf sixteen 4K sample buffers are assigned

nfi

When PCM stream play starts, the current wave play position is written to the hostinterface work area. The play position is a number from 0 to 15. The value is 0 at
the start of play, and increments by 1 each time play advances by 4K samples. When
play reaches the end of the buffer, the play position value returns to 0 and play isrepeated from the beginning of the buffer.
Play Position Values

0, 1, 0, 1, 0, 1, ...
0, 1, 2, 0, 1, 2, 0, 1, 2, ...
0., 1, 2, 3, ..., 12, 13, 14, 15, 0, 1, 2, 3, ...

Co

Set up the main system so that it monitors the play position when sending the next
wave data. Because the PCM stream buffers can hold up to 64K samples, anywherefrom 2 to 16 buffers can be allocated.
An interrupt can be executed to the main system whenever the play position is
updated. Use this feature when necessary. The system interface work area contains
control information for this interrupt. For information on the settings, see section
5.1.3, System Interface Work Area.
Transfer Load

SE
GA

6.4.3

Because the PCM play slot is fixed by the hardware to 44.1 KHz, a sample is played
every 22.68 µsec after play starts. In other words, wave data for 44,100 samples mustbe supplied continuously for each channel per second. This number of sample
converts to 44,100 bytes for 8-bit PCM and 88,200 bytes for 16-bit PCM.
The transfer time, which includes data read from the CD up to data transfer to thesound memory, becomes part of the main system load. The transfer time depends
on the main system hardware and can be calculated from the CD revolution wait
and seek times, the SH (or DMA) transfer clock, and the number of transfer bytes.
However, the number of bytes described above is the data size at 44.1 KHz. If thefrequency can be halved to 22 KHz, the data volume can also be halved.
Consequently, the transfer load is also halved. Conversely, in stereo play or
concurrent multi-channel play, the load increases correspondingly.

(DY, 05/26/95)

37

ST-241-042795
SEGA Enterprises, Ltd.

6.4.4

Stereo Play

nfi

de
n

tia
l

PCM stream play can be executed in stereo. For stereo play, twice the memory usedin mono play is necessary. The parameter size specified in the command parameterat the start of play is the sample count for one channel. For stereo play, allocate anarea that is twice the specified parameter size.

6.4.5 Playing Wave Data at Frequencies Other than 44.1 Khz

Co

The SCSP plays wave data always at a frequency of 44.1 KHz. The sound system
supports wave data play at other frequencies by using a pitch parameter. For
example, if wave data is played unaltered at 22 KHz, the play pitch is doubled. By
halving the play pitch, the wave data can be played at the original pitch.

SEGA

The pitch range can be up to ±8 octaves (OCT). In addition, one octave can bedivided into 1,024 levels (FNS). With a range of this precision, the sound system
can handle any frequency. If the sampling frequency is known, calculate the pitch(OCT and FNS values) beforehand according to the pitch calculation proceduredescribed in the next section. During PCM stream play, this pitch is assigned to aparameter so that the sampling frequency can be reproduced unaltered.

(DY, 05/26/95)

38

ST-241-042795
SEGA Enterprises, Ltd.

Calculating the Pitchtial

Use the equation shown below to calculate the pitch. To calculate FNS, select the
OCT value from the following table and substitute the sampling frequency value for
Fs. For example, if the sampling frequency is 44.1 KHz, Fs is 44.1; if the sampling
frequency 16 KHz, Fs is 16, etc.

FNS =2− OCT × 1024 × Fs
− 102444.1

OCT Values•

5.5125KHz→-3

11.025KHz→-2

22.05 KHz→

44.1 KHz→

88.2 KHz→

-1

0

1

nfi

Sampling
frequency
OCT valuedenCalculation Equation

For example, if wave data sampled at 16 KHz is played, the values for OCT and FNS are
as shown below. The table tells us that the value for OCT is -2. From the equation, FNS is
calculated as 462 (1CEh).

Co

FNS = - 1024 = - 1024 = 462 (1CEh)

Consequently, the value for parameter P7-P8 Pitch Word for PCM stream play becomes
71CEh.
6.4.6 Notes
Continuous Transfer

SE
GA

When transferring wave data, allow the sound CPU to operate by avoiding long,continuous transfers. Note that the sound CPU operation is disabled during soundmemory access by the main system, which has a higher priority. If continuoustransfer is necessary, divide the transfer into segments no longer than 1 millisecond
each. The sound CPU is then able to operate during the breaks when no data is
being transferred.
DSP Usage

Mixer settings are necessary when using a DSP (for effects) in PCM stream play. To
use a DSP, prepare the necessary mixer data and execute the mixer setting command.
Tone data is necessary for the mixer settings even if there is no sequence play.

Note:

A sample is the smallest unit of PCM wave data, and the size of a sample depends on the datawidth. If the data width is 8 bits, the sample size is one byte; if the data width is 16 bits, thesample size is two bytes. A 4K sample therefore indicates 4,096 bytes for 8-bit PCM, and 8,192
bytes for 16-bit PCM.

(DY, 05/26/95)

39

ST-241-042795
SEGA Enterprises, Ltd.

tial

6.5 MIDI Direct Output
The sound driver is a sound source that uses MIDI messages to generate sounds.
Sounds can be generated with the sound driver by sending MIDI messages directly
without creating sequence data. The MIDI Direct Control command is the interface for
MIDI direct output and has parameters that specify the message block to be sent tothe sound driver.

nfi

de
n

The message block is a 4-byte data block that has the sound start time parameter
added to the MIDI message. The following figure shows the structure of themessage block.

Correspondence between CMD value and actual MIDI event:
CMD value

6.5.1

Corresponding MIDI event(80h-8Fh) Note Off Event(90h-9Fh) Note On Event(A0h-AFh) After Touch(B0h-BFh) Control Change(C0h-CFh) Program Change(D0h-DFh) Channel Pressure(E0h-EFh) Pitch Wheel(F0h-FFh) System Message

Co

0
1
2
3
4
5
6
7

Usage Procedure

SE
GA

Execute the MIDI Direct Control (09h) command with the 4-byte message block asparameters P1, P2, P3, and P4. The following are the advantages and disadvantagesof doing so. Consult with the sound creator before selecting the method to be used.
Advantages•••

Real-time control is permitted when sequence data cannot be deployed in advance.
Data creation tasks from sequence creation to compression are unnecessary.
The load is reduced because the data compression and decompression processes areomitted.

Disadvantages

Although this method is versatile, in certain cases, a sophisticated program must be
written based on an understanding of a large amount of information. (Using thismethod requires an understanding of MIDI channels and the corresponding tones,
as well as an understanding of the relationship between the DSP program and mixer
specifications. Consultation with the sound creator is necessary.)(DY, 05/26/95)

40

ST-241-042795
SEGA Enterprises, Ltd.

6.6

Fade-In and Fade-Out

6.6.1

Fade-In Procedure

6.6.2

de
n

tia
l

Specify a fade rate in the Sequence Volume command, and execute the command
before issuing the Sequence Start command. (If a fade rate is not specified, only thecurrent sequence volume changes.) Immediately after the Sequence Start command is
executed, the volume fades in from the current sequence volume until the specified
sequence volume is reached. The fade-in curve can be controlled by using theSequence Volume command more than once.
Fade-Out Procedure

SE
GA

Co

nfi

Specify “Volume=0” in the Sequence Volume command and execute the command.
The volume fades out until “volume=0” is reached, according to the fade rate. The
fade-out curve can be controlled by using the Sequence Volume command more thanonce.

(DY, 05/26/95)

41

ST-241-042795
SEGA Enterprises, Ltd.

• Slot Direct mixer:

Co

nfi

de
n

tia
l

6.7 DSP and Mixers
The relationship between the DSP and the mixers is very important whencontrolling sound. This section explains the relationship between the DSP and themixers.

Direct (without passing through the DSP) output level and Pan fromthe sound slot

SE
GA

• CD-DA Direct mixer: Direct (without passing through the DSP) output level and Pan fromthe CD-DA• Effect In mixer:

Input level to the DSP• Effect Out mixer:

Effect (through the DSP) output level and Pan from the DSP(DY, 05/26/95)

42

ST-241-042795
SEGA Enterprises, Ltd.

6.7.1 Introduction to Mixers• Slot Direct mixer:

tialMixers are hardware units that balance the volume and position (left-right
distribution) of the SCSP sound source. The sound source itself has two types: asound slot and a digital audio input. However, because each type can be passed
through the DSP, the mixers can be divided into the following four mixer blocks:

Direct (without passing through the DSP) output level and Pan fromthe sound slotden• CD-DA Direct mixer: Direct (without passing through the DSP) output level and Pan fromthe CD-DA• Effect In mixer:

Input level to the DSP• Effect Out mixer:

Effect (through the DSP) output level and Pan from the DSP

Of these mixers, the Slot Direct mixer and the Effect In mixer are already set in thetone data and do not require special control. To control the CD-DA Direct mixer, use
the special CD-DA Level (80h) and CD-DA Pan (81h) commands that have been prepared.

6.7.2

nfi

In this manual, "mixer" refers to the Effect Out mixer and the 16 channel effect level
and Pan settings that are output by the DSP.
DSP and Mixers

Co

The mixer is the exit setting for sounds output by the DSP. Even if effect processing
operates normally and effects are properly incorporated, the effect sounds will not be
output if the mixer is not set correctly. The mixer is the volume and position
setting data for the 16 DSP output channels. The sound creator creates this data aspart of the sound data.

SEGA

All sounds for sequence play, PCM stream play, and CD-DA play enter the DSP.
Controlling the mixer requires a correct understanding of which sounds enter andexit which channels in each scene. When switching effects, check the corresponding
mixer and mixer specifications beforehand.

(DY, 05/26/95)

43

ST-241-042795
SEGA Enterprises, Ltd.

6.7.3

Eliminating Noise During Effect ChangetialWhen an effect is switched, certain effect types may generate a large amount ofnoise. In such cases, use the mixer controls to prevent noise generation.
Instructions are as follows:den

1. Prepare a mixer that does not output any effects (mixer in which the output level for all 16
channels is 0).
2. Use the Mixer Change (87h) command to switch the mixer. After the mixer is switched, noeffects are output.
3. Execute the Effect Change (83h) command to switch the DSP program.
4. Wait about one second. Other processing can be performed during this time. Althoughnoise is actually generated, the noise is not output externally because the mixer is closed.
Note that the time until the noise disappears varies slightly depending on the sound being
produced at the time and the environment, including the DSP program and the size of thedelay RAM. Make any necessary adjustments.
5. Use the Mixer Change (87h) command to return to the mixer that outputs the previous effects.

SE
GA

Co

nfi

However, the effect component is not output for about one second while the effect isbeing switched. In step 2 when the mixer is switched, the abrupt volume change
may generate a faint noise, which cannot be avoided. To eliminate the noise
completely, use the Total Volume (82h) command to reduce the volume gradually bylevels. An abrupt volume change can cause noise. Note that using the Total Volumecommand changes all sounds.

(DY, 05/26/95)

44

ST-241-042795
SEGA Enterprises, Ltd.

SE
GA

Co

nfi

de
n

tia
l

6.8 Sound Area Map
The sound area map links and combines all area maps in a game into one map andoutputs it with the sound emulator (one of the sound development tools.) A onebyte end code (FFh) is inserted at the end of each area map, and an all-end code (FFh)is inserted at the end of the sound area map. The size of the sound area map varies,
depending on the number of area maps. The maximum size a sound area map canbe is 4,096 bytes.

(DY, 05/26/95)

45

ST-241-042795
SEGA Enterprises, Ltd.

6.8.1 Introduction to Area Maps

de
n

tia
l

A game has several scenes, and frequently the music changes when a scene changes.
When the music changes, the sound data allocation (how the 512-KB soundmemory is used) also changes. An area map represents how data is arranged for aparticular scene. The three types of allocated data are tone data, sequence data, andthe DSP program. Therefore, the area map displays where and how much of thesound memory each of the three types use. When the DSP is used, a DSP work
RAM becomes necessary. In this case, the memory map also specifies the locationand size of the DSP work RAM.
Normally, sequence play is enabled if an area map contains map information forboth sound data and sequence data. However, to build a system with high memoryand development efficiency, divide frequently used melodies and sound effects andallocate them to separate locations.

SE
GA

Co

nfi

If the sound does change when the game scene changes, the number of required area
maps would be equal to the number of scenes. However, area map, as used here,
refers to the area map viewed in terms of sound; therefore, one area map does notnecessary correspond to one game scene. In cases when the same sound is used after
the game scene changes, the area map does not have to be changed. In addition, thearea map does not have to be changed if only part of the sound data is replaced.

(DY, 05/26/95)

46

ST-241-042795
SEGA Enterprises, Ltd.

6.8.2

Area Map StructuretialAn area map links and combines several map information units into one unit.
The size of area maps vary.

An area map can have up to 32 map information units, and the size of the area map
is determined by the number of units.

6.8.3 Details on Map InformationdenBecause the size of an area map varies, a one-byte end code is inserted at the end of
the area map.

Map Information Data
Data

Co

nfi

A map information unit is an 8-byte data block that describes where sound data is
mapped in memory. The following figure shows the structure of a map
information unit.

Meaning

E

Data end bit

Data ID
ID number

Data type
Identification number in data
type
Start address
Transfer completed bit
Area size

SE
GA

Start address
L
Area size

Description

End bit of the map information. The data is one-byte long, and the actual value is
FFh.
Type of data to be stored in the defined area.
Identification number if there are several data items of the same type.
First address of the defined area.
Flag indicating that data was transferred to this area.
Size of the defined area.

(DY, 05/26/95)

47

ST-241-042795
SEGA Enterprises, Ltd.

tial

6.9 3D SoundThe SATURN sound driver supports two types of 3D sound: Q sound and Yamaha
3D sound. Use sound control commands 3D Control (11h) and Q Sound Control (12h) to
specify any desired position. The virtual sound source moves to the specified
position.

denFor both Q sound and Yamaha 3D sound, the movement of the virtual soundsource is random in most cases. Thus, the position movement controls are all
performed by the main system. The sound driver only moves the sound image tothe specified position. However, in cases involving simple linear movement orthat require more intelligent control by the sound driver, the necessary processing
can be performed for each project.

The sound driver provides four DSP programs as Yamaha DSP extension modules:
Q sound 4 channel, Q sound 8 channel, Yamaha 3D sound 1 channel, and Yamaha
3D sound 2 channel. When using 3D sound, download the necessary DSP programwith the Effect Change (83h) command.
Q Sound

nfi

6.9.1

Q sound is able to Pan sound over wide angles of up to 180 degrees horizontally.
The position type is only Pan; however, up to eight channels can be controlled
simultaneously.

6.9.2

Either four channels (0-3) or eight channels (0-7) can be specified.
Position 15 is the center. Sound can be panned up to 15 levels left
and right.

YAMAHA 3D SoundCo• Channels (0-7):• Pan position (0-30):

Yamaha 3D sound allows the virtual sound source to be moved freely to positions
spanning 360 degrees horizontal, 360 degrees vertical, and 128 distance levels.
Although only up to two channels can be used, the channels can be specified to any
combination of up, down, left, and right.

SEGA• Channels (0-1):• Distance (0-127):• Horizontal position (0-127):• Vertical position (0-127):

Note:

Either one channel (0) or two channels (1) can be specified.
The value 0 indicates a distance of 0. The distanceincreases as the value increases.
The 360-degree horizontal position is specified with 128
levels. The value 0 indicates directly ahead; 32, 90 degrees
to the right; 64, directly behind; and 96, 90 degrees to theleft.
The 360-degree vertical position is specified with 128
levels. The value 0 indicates directly above; 32, directly
ahead; 64, directly below; and 96, directly behind.

3D sound is presented as a Yamaha DSP extension module (DSP program), and cannot be useduntil the DSP extension modules are provided. At this time (2/28/95), 3D sound is still notsupported.

(DY, 05/26/95)

48

ST-241-042795
SEGA Enterprises, Ltd.

tial6.10 Sound Initial Command
For parameters P1 to P5 of the Sound Initial (10h) command, the corresponding process
is executed when the parameter value is 01h. For all other values, the parameter isignored. This command is used mainly for setting conditions immediately before
the Map Change command is executed.
Details on P1 to P5

When 01h is specified for P1, the Sound Initial command stops all sequences that are
currently generating sounds. This specification does not affect other sounds (PCM stream
play or CD-DA play).

•

When 01h is specified for P2, the Sound Initial command stops all PCM stream plays that are
currently generating sounds. This specification does not affect other sounds (sequence playor CD-DA play).

•

When 01h is specified for P3, the Sound Initial command turns off the output for the CD-DA
input components EXTS0 and EXTS1 by setting the direct components EFSDL and EFPAN to
00H. Therefore when the CD-DA input is manipulated with effects and the results are
output, the volume is not turned off. This specification does not affect other sounds(sequence play or PCM stream play).
Sound address

When 01h is specified for P4, the Sound Initial command initializes the DSP unit in the soundsource. Actually, the data shown below is set to the DSP registers, the output of the effectcomponent is turned off, and access (read/write) to the D-RAM by the DSP is prohibited.
In addition, the mixer is initialized but then returned. This specification does not affectother sounds (direct components of sequence play, CD-DA play, and PCM stream play).
IMXL <--- 00H
EFSDL, EFPAN <--- 00H
MPRO <--- 00000000H
COEF <--- 00H
TEMP <--- 000000H

When 01h is specified for P5, the Sound Initial command writes EFSDL=EFPAN=0 for all
EFREG units (the mixer units), and disables output of the effect components. This
specification does not affect other sounds (direct components of sequence play, CD-DA
play, and PCM stream play).

SE
GA

•

Co

•

100217H.b <--- 00H
100237H.b <--- 00H

nfi

de
n

•

(DY, 05/26/95)

49

ST-241-042795
SEGA Enterprises, Ltd.

tial6.11 Hardware Check Command
Details on the check items performed by the Hard Check (89h) command are described
below. During check execution, a value from 0 to 5 is specified for commandparameter P1. The parameter value determines the check to be performed. For all
checks, one of the following values is stored in the system interface table (address
418h: word) as the check result.

den• 7FFFH: Memory check error• 8000H: Memory check OK
Check Description

00h

The command executes read/write check of the sound D-RAM (4 Mb). Note that during this check, the DSP for whichinternal memory access should be prohibited is initialized.
The check writes, reads, and compares low/high for all bits and stores the results into the system interface table.
The command executes read/write check of the sound D-RAM (8 Mb). The other features are as described in theprevious item.
The command executes an operation check of the SCSP built-in MIDI. When executing this check, short the inputoutput terminals for the external MIDI. The check results are as described above.
The command outputs a square wave from both L and R sides. Note that during this check, SCSP slot 025B00000H
is forcibly used. Also the sound is turned off automatically after a few seconds. When this command is executed, mapdata, melody data, and tone data are not necessary.
The command outputs a square wave from the L side only. The other features are as described above.
The command outputs a square wave from the R side only. The other features are as described above.

01h
02h
03h

SE
GA

Co

04h
05h

nfi

P1 Value(DY, 05/26/95)

50

ST-241-042795
SEGA Enterprises, Ltd.

Supplement

7.1 Details on Error Status Bit Map
Bit Position

Bits 24 to 31 are not cleared automatically. When necessary, clear these bits from the hostside. Bits 0 to 23 are automatically cleared during normal operation.

SE
GA

Co

Note:

de
n

bit 1
bit 0

Error Description

68K CPU address error
68K CPU bass error
68K CPU exception processing
RAM area for target DSP was insufficient during effect change.
Invalid value was set for RAM of target DSP during effect change.
RAM for target DSP was not found in map during effect change.
Target DSP program was not downloaded during effect change.
Target DSP program was not found in map during effect change.
Target sequence bank was not downloaded during sequence start.
Target sequence song number was not found in sequence bank during sequence start.
Target sequence bank was not found in map during sequence start.
Target program number was not found in tone bank during MIDI program change.
Tone bank for target control number and MIDI channel was not set during MIDI program change.
Tone bank for target control number and MIDI channel was not set during MIDI control change (mixer change).
Target tone bank was not found in map during mixer change or tone bank change. Or, the tone bank was not
downloaded.
Target map was not found in area starting from A000h during map change.
Target mixer was not found in tone bank during mixer change. Or, the tone bank was not set.

nfi

bit 31
bit 30
bit 29bit 13
bit 12
bit 11
bit 10
bit 9
bit 8
bit 7
bit 6
bit 5
bit 4
bit 3
bit 2

tia
l

Chapter 7(DY, 05/26/95)

51

ST-241-042795
SEGA Enterprises, Ltd.

7.2

Details on SCSP Pan (32 Levels)
L (dB)R (dB)

PositionPan

L (dB)R (dB)

Position

00h
01h
02h
03h
04h
05h
06h
07h
08h
09h
0Ah
0Bh
0Ch
0Dh
0Eh
0Fh

-00.0
-03.0
-06.0
-09.0
-12.0
-15.0
-18.0
-21.0
-24.0
-27.0
-30.0
-33.0
-36.0
-39.0
-42.0
∞
-

-00.0
-00.0
-00.0
-00.0
-00.0
-00.0
-00.0
-00.0
-00.0
-00.0
-00.0
-00.0
-00.0
-00.0
-00.0
-00.0

C
R1
R2
R3
R4
R5
R6
R7
R8
R9
R10
R11
R12
R13
R14
R15

10h
11h
12h
13h
14h
15h
16h
17h
18h
19h
1Ah
1Bh
1Ch
1Dh
1Eh
1Fh

-00.0
-00.0
-00.0
-00.0
-00.0
-00.0
-00.0
-00.0
-00.0
-00.0
-00.0
-00.0
-00.0
-00.0
-00.0
-00.0

-00.0
-03.0
-06.0
-09.0
-12.0
-15.0
-18.0
-21.0
-24.0
-27.0
-30.0
-33.0
-36.0
-39.0
-42.0
∞
-

C
L1
L2
L3
L4
L5
L6
L7
L8
L9
L10
L11
L12
L13
L14
L15

MIDI Pan
00H-0FH
10h-1Fh20h-2Fh30h-3Fh40h-4Fh50h-5Fh60h-6Fh70h-7Fh

•
•

0
1Fh
1Bh
17h
13h
00h
04h
08h
0Ch

1
1Fh
1Bh
17h
13h
00h
04h
08h
0Ch

2
1Fh
1Bh
17h
13h
00h
04h
08h
0Ch

3
1Fh
1Bh
17h
13h
00h
04h
08h
0Ch

4
1Eh
1Ah
16h
12h
01h
05h
09h
0Dh

de
n

nfi

Details on MIDI Pan Data (Correspondence between SCSP and Pan)
5
1Eh
1Ah
16h
12h
01h
05h
09h
0Dh

6
1Eh
1Ah
16h
12h
01h
05h
09h
0Dh

7
1Eh
1Ah
16h
12h
01h
05h
09h
0Dh

Co

7.3

tia
l

Pan

8
1Dh
19h
15h
11h
02h
06h
0Ah
0Eh

9
1Dh
19h
15h
11h
02h
06h
0Ah
0Eh

A
1Dh
19h
15h
11h
02h
06h
0Ah
0Eh

B
1Dh
19h
15h
11h
02h
06h
0Ah
0Eh

C
1Ch
18h
14h
10h
03h
07h
0Bh
0Fh

D
1Ch
18h
14h
10h
03h
07h
0Bh
0Fh

E
1Ch
18h
14h
10h
03h
07h
0Bh
0Fh

F
1Ch
18h
14h
10h
03h
07h
0Bh
0Fh

The values in the table are Pan data values (00h-1Fh: 32 levels) for the SCSP.
The MIDI Pan data consists of 128 levels. When MIDI Pan data is converted to SCSP Pan
data, the last 2 bits are ignored.

SE
GA

Left
CenterRight
00h <-------------------> 40h <-------------------> 7Fh(DY, 05/26/95)

52

ST-241-042795
SEGA Enterprises, Ltd.

7.4

Check Points
Symptom

Cause

tia
l

• Is the sound driver operating?
Execute any Sound Control command if uncertain. If the executed command code is cleared to
00h, the driver is operating.
Alternatively, check sound memory address 8827h (byte) (SH address 25A08827h). If the sounddriver is operating, the address value is incremented every two msec.
• Is sound data transfer completed?
For sequence play to take place, the tone data and the sequence data must be transferred
successfully to the sound memory.
• Is the transfer completed bit set?
After sound data is transferred, the L bit (transfer completed) must be set in the sound area map CRNT
work area. Otherwise, sounds will not be generated.
• Do the area map and the transferred data match?
Sound will be not generated if the transferred sound data does not match contents of the area map.
Check the consistency, transfer address, and size of the area map and the transferred data.
• Is the sound driver version correct?
If the driver used to create the sounds and the driver incorporated in the game are different, sounds
may not be generated correctly. If two different driver versions area used, the sequence compression
format may be different. Check that the version is correct.
• Is the sound driver data file destroyed?
If the sound driver (SDDRVS.TSK) is transferred through a network UNIX server and the transmitting
source is a Macintosh file with text attribute, the return codes may be converted to data. Before
transferring the sound driver, check whether the attribute of the Macintosh file is text.

SE
GA

Co

nfi

de
n

No sounds are output.

(DY, 05/26/95)

53

ST-241-042795
SEGA Enterprises, Ltd.
Symptom

Cause• Has the DSP program been transferred?
Effects can be applied only after the DSP program is successfully transferred to the sound memory.
• Is the transfer completed bit set?
After sound data is transferred, the L bit (transfer completed) must be set in the sound area map CRNT
work area. Otherwise, sounds will not be generated.
• Was effect change executed?
Effects can be applied only if the DSP program in the sound memory is actually downloaded to the
DSP. Execute the Effect Change command that corresponds to the effects used.
• Was mixer change executed?
Sound effects can be output only if the correct mixer is set. Execute the Mixer Change commandthat corresponds to the effects used.
• Is sound sent to the DSP via tone data?
Each tone in the effect data has a setting that indicates the effect to which the sound is to be connected(sent). If this setting is incorrect, effects will not be applied. Contact the sound creator and check thesettings.
No sounds are output after• Was a bank change inserted in the sequence data?
the sound driver was
The sequence data must contain bank and program changes. For tool compatibility, sound will be
upgraded to a higher version. generated on the development tool even if the data does not contain a bank change. When playedon actual units, the sequence data must contain a bank change.
• Was a different sequence compression format used?
Older versions (1.1x) of the sound driver use a different sequence compression format than the newversions (1.2x). Check that the correct version is being used.
• Does the program contain data size-dependent processing?
When the version of the sound driver is upgraded, the driver size changes. Check whether the driver
size is being processed by a constant for the previous version.

SE
GA

Co

nfi

de
n

tia
l

Effects are not applied.

(DY, 05/26/95)

54

ST-241-042795
SEGA Enterprises, Ltd.
Symptom

tia
l

SE
GA

Co

Abnormal operation occurs.

• Was the DSP work RAM address changed?
The data in the DSP work RAM is always being overwritten by DSP internal processing. If the map isswitched without stopping the DSP, the data that was transferred to the space corresponding to the
DSP work RAM in the previous map is destroyed.
• Was effect change executed?
The DSP is stopped before executing map change. After map change, reexecute the effect changecommand, as necessary.
• Was mixer change executed?
In some cases, the mixer is initialized before map change. Always reexecute the mixer changecommand after map change.
• Is the bank change at the beginning of the sequence data?
When a standard MIDI file is created, there is a sequencer that rearranges the sequence of control
changes having the same delta time. Shift the clock to ensure that the bank change is always first. If
there is a program change or there is a MIDI Volume command before the bank change, sounds may
not be output or the balance may be poor.
• Are the correct commands being executed in the correct order?
With processing that has a set command sequence, check that the correct commands are being
executed in the correct sequence. A history of the sound control commands is stored in the reserved
area of the system area. (The latest 16 bytes x 128 commands are stored in the 2,048-byte region from800h to FFFh. Also, see the explanation in the next section.)denWhen data is played on an
actual unit:• no sounds are output.
• sound balance is poor.

Cause• Were all sound generation processes stopped before the map change?
The sound driver executes internal processing even if no sound is being output. Before executing
map change, execute the Sound Initial (10h) command to stop all sound generation processes.

nfi

When map change is
executed:• no sounds are output.
• operation becomesabnormal.

(DY, 05/26/95)

55

ST-241-042795
SEGA Enterprises, Ltd.

PCM Stream Sounds Are Not Output

25A00700H <--tialActivate the sounder driver, and then execute the PCM Start (85h) command withthe following parameters. A square wave sound should be output. Preparation of
PCM wave data is not necessary.
CMD P1 P2 P3 P4 P5 P6 P7 P8 P9 P1085h, 00h, 00h, E0h, 00h, 01h, 00h, FFh, 50h, 00h, 00h, 00hden

If the command outputs a sound, either the parameter settings or the PCM data isincorrect. If the command does not output a sound, check the following items.
Symptom

PCM stream sounds are not
outputCause•

Check the external line to the speaker, the volume, and other settings.

SE
GA

Co

nfi

• Check the sound driver operation.
Check whether the sound driver is operating. For instructions, see the items described for thesymptom "no sounds are output."• Check the sound driver version.
The version is recorded in ASCII characters starting from sound memory address 1010h (SH address
25A01010h).
• Was the target PCM data correctly transferred to the sound memory?
Note that command parameters P3 and P4 specify only the upper 16 bits of the 20-bit PCM play start
address.
Example) If P3=12h and P4=34h, the actual address is 12340h (25A12340h).
• Is the master volume of the sound source set to -∞ dB (volume=off)?
Write 0Fh (-0 dB: maximum volume) to the byte starting from sound memory address 100401h (SHaddress 25B00401h).
Note: This address cannot be read.
• Is the setting for PCM volume parameter P2 in the command correct?
Note: Bits 7, 6, 5 = volume; bits 4,3,2,1,0 = Pan
P2=E0h (volume = maximum, Pan = center)P2=C0h (volume = -6 dB, Pan = center).
.
.
P2=00h (volume = -∞ dB, Pan = center)• Are the settings for pitch parameters P7 and P8 in the command correct?
Bits 7 and 2 of P7 cannot be used (fixed at 0).
If P7 and P8 are both set to 00h, PCM stream data is played at 44.1 KHz.

(DY, 05/26/95)

56

ST-241-042795
SEGA Enterprises, Ltd.

tial

7.5 Reference Data for Error Occurrences
If a sound-related problem occurs, check the following areas for possible reference
data when investigating the cause.
Error Status Bit Map

If an error occurs during sound driver operation, an error bit corresponding to theerror type is set into the system interface table (4 bytes from 420h). For details on theerror types, see section 7.1, Details on Error Status Bit Map.

Sound Control Command HistorydenThe bit map contains bits that are automatically cleared when operation returns tonormal and bits that are not cleared automatically after once set. When checking anerror, clear the bits from the main system as necessary.
A history of the sound control commands is stored in the reserved area (2,048 bytes
from 800h to FFFh) of the system area. Control commands (16 bytes) that the sounddriver received from the main system and executed are constantly being written tothis area in execution sequence.

Co

nfi

The commands are written in ring buffer format. When the area becomes full, thecommands are overwritten beginning from the oldest command. A record of thelatest 128 commands always remains in the area. (When the number of processedcommands exceeds 128, commands are written in sequence from the beginning of
the reserved area.) In such cases, the next data write position is set in the systeminterface table (one word starting from 41Ah) as an offset address from 800h. The
table therefore indicates the position of the data that was written last.
In the command history area (16 bytes), bytes 15 and 16 (one word area) contains theelapsed time since the previous command process. These bytes can be used toguarantee the command issuance timing. One count is approximately two
milliseconds.
Reference the sound control command history area to check the following types of
items:
Whether the correct command was output from the main system if no sounds are being
output.
Whether the same command is being executed repeatedly.
Whether commands are being executed in the correct sequence for processing in which thecommand sequence is set.
Whether many commands are being executed in an extremely short time interval.

SE
GA

•
•
•
•

(DY, 05/26/95)

57

ST-241-042795
SEGA Enterprises, Ltd.

SE
GA

Co

nfi

de
n

tia
l

Index

(DY, 05/26/95)

58

ST-241-042795
SEGA Enterprises, Ltd.

Area map number, 20

tialCD-DA Direct mixer, 42
CD-DA level, 17, 20
CD-DA Pan, 20
CD-DA Pan, 17denData area, 6
Direct sound output level, 21
Direct sound output Pan, 21
DSP program, 4
DSP Stop, 16
DSP work RAM, 4
DSP work RAM area, 6nfi

Effect bank number, 20
Effect Change, 17
Effect In mixer, 42
Effect input channel, 22
Effect input level, 22
Effect Out mixer, 42
Effect output channel, 22
Effect output level, 22
Effect output Pan, 22

Main system, 4
Map Change, 15
MIDI Direct Control, 15
Mixer Change, 17
Mixer number in tone data, 22
Mixer Parameter Change, 18

Co

Hard Check, 18

SEGA

Pan control ON/OFF, 20
PCM Parameter Change, 18
PCM Start, 17
PCM Stop, 18
PCM stream play number, 21
PCM stream buffer size, 21
PCM stream buffer start address, 21
Pitch word, 21
Q PAN position, 20
Q channel number, 20
Q Sound Control, 16Sample count, 4
SCSP, 4
Sequence Continue, 15Sequence data, 4Sequence Pan, 16
Sequence Pause, 15Sequence Start, 15
Sequence Stop, 15
Sequence Volume, 15(DY, 05/26/95)

1

ST-241-042795
SEGA Enterprises, Ltd.

42

tia
l

Slot Direct mixer
Sound All OFF, 16Sound area map, 8Sound creator, 4Sound data, 4Sound driver, 8Sound Initial, 16
System area, 6denTempo Change, 15
3D channel number, 20
3D control, 16
3D distance, 20
3D horizontal position, 20
3D vertical position, 20
Tone data, 4Tone data bank number, 22
Total Volume, 17
Total volume, 20

SE
GA

Co

nfi

Volume Analyze Start, 16
Volume Analyze Stop, 16(DY, 05/26/95)

2