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

1. This document is confidential. By accepting this document you acknowledge that you are boundby the terms set forth in the nondisclosure and confidentiality agreement signed separately and in
the possession of SEGA. If you have not signed such a nondisclosure agreement, please contact
SEGA immediately and return this document to SEGA.

de2. This document may include technical inaccuracies or typographical errors. Changes are periodically made 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) described in this document at any time.

nfi

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, orother intellectual property rights of SEGA Enterprises, Ltd., SEGA of America, Inc., or any third
party.

Co

5. Software, circuitry, and other examples described herein are meant merely to indicate the characteristics 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 the examples
described herein.

GA

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’slicensed 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

NOTE: A reader's comment/correction form is provided with thisdocument. Please address comments to :(11/2/94- 002)

SEGA of America, Inc., Developer Technical Support (att. Evelyn Merritt)
150 Shoreline Drive, Redwood City, CA 94065
SEGA may use or distribute whatever information you supply in any way
it believes appropriate without incurring any obligation to you.

SE

GA

Co

nfi

de

nti
al

TM

SATURN
Sound Driver
System Interface
Version 3.03
Doc. # ST-166-R4-012395© 1995 SEGA. All Rights Reserved.

READER CORRECTION/COMMENT SHEET

ntial

Keep us updated!
If you should come across any incorrect or outdated information while reading through the attacheddocument, or come up with any questions or comments, please let us know so that we can make therequired changes in subsequent revisions. Simply fill out all information below and return 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.
General Information:
Your Name

Phone

Document number

ST-166-R4-012395

Document name

SATURN Sound Driver System Interface Version 3.03

de

Date

Corrections:pg. #Correction

GA

Co

nfi

Chpt.

SE

Questions/comments:

Fax:

Where to send your corrections:(415) 802-1717
Attn: Evelyn Merritt,
Developer Technical Support

Mail:

SEGA OF AMERICA
Attn: Evelyn Merritt,
Developer Technical Support
150 Shoreline Dr.
Redwood City, CA 94065

Table of Contents

SE

GA

Co

nfi

de

nti
al

System Area Memory Map ................................................................................................. 8
System Area Contents ....................................................................................................... 968K Vector Table ...................................................................................................... 9
System Interface Area .............................................................................................. 968K Program Area .................................................................................................... 9
68K Work Area ......................................................................................................... 9Sound Area Map ..................................................................................................... 10
System Interface Area ...................................................................................................... 11
System Interface Table (400H–43FH: 64B) ............................................................ 11
DSP Program Load Flag ........................................................................................ 12
68000 Error Status Bit Map .................................................................................... 12
System Information Table (440H–47FH: 64B) ........................................................ 13
System Interface Work (480H–4FFH: 128B) .......................................................... 13
3D-Sound Control Flag/YAMAHA 3D Work ............................................................ 14
Yamaha 3D Work (32B) .......................................................................................... 15
Sound Area Map CRNT Work (500H-5FFH: 256B) ................................................ 16
Tool Interface Work (600H–6FFH: 256B) ............................................................... 17
Host Interface Work (700H–7FFH: 256B) .............................................................. 18
PCM Play Numbers 0-7 Play Address .................................................................... 19
Command Block ..................................................................................................... 20
Play Sequence Mode/Status .................................................................................. 21
Status Detail ........................................................................................................... 21
Starting the Sound Driver ................................................................................................. 22
Sound System Startup ........................................................................................... 22
Sound Control ........................................................................................................ 22
Sound Data ............................................................................................................ 23
Replacing Sound Data ........................................................................................... 23
Sound Control Commands ............................................................................................... 24
MIDI Direct Control Bit Image ................................................................................. 25
Fade In Method ...................................................................................................... 26
Fade Out Method ................................................................................................... 26
Parameters ....................................................................................................................... 27
Sound Control Number ........................................................................................... 27
Sequence Bank Number ........................................................................................ 27
Sequence Song Number ........................................................................................ 27
Priority Level ........................................................................................................... 27
Sequence Volume .................................................................................................. 27
Fade Rate ............................................................................................................... 27
Effect Bank Number ............................................................................................... 27
PCM Stream Playback Number ............................................................................. 28
Tone Bank Number ................................................................................................. 28
Mixer Number ......................................................................................................... 28
Effect In Select ....................................................................................................... 28
Effect Out Select .................................................................................................... 28
Effect Send Level ................................................................................................... 28
Effect Return Level ................................................................................................. 28
Precautions for Using Sequence Pan (Command 0Eh) ................................................... 29
PCM Stream Playback ..................................................................................................... 31
Overview ................................................................................................................ 31
Setting Up a Buffer ................................................................................................. 31
Playback Method .................................................................................................... 32
Timing for Buffer Rewrites ...................................................................................... 32
Overhead During Data Transfer ............................................................................. 32
Supporting Playback Frequencies Other Than 44.1 KHz ....................................... 33

nti
al

de

SATURN Sound Driver
System Interface

SE

GA

Co

nfi

(This manual covers sound driver version 1.28)

SATURN Sound Driver System Interface Version 3.03

5

Change History

5/3/94
5/10/94• Changed total byte count of PCM START command P4 to word
count of 1 channel.
• Changed 00h-FFh of PCM playback address data to 00h-0Fh.

Driver 1.00

• Changed 68K program area size in system area memory map
from 4000h (16KB) to 5000h (20KB).
• Changed 68K work area size in system area memory map from 3000h(12KB) to 4000h (16KB).
• Changed initialization area size for sound system startup
in conjunction with the above size changes.
• Added detailed explanations on pan data (32 levels). Changed P1/P2
of CD-DA LEVELcommand.
• Added Level item to P2 of PCM START command.

Driver 1.00

• Changed MIDI direct control commands P1 from 0-31 to 00h or
10h and P2 from 0-255 to 80h-EFh.

Driver 1.00

nti
al

4/27/94

Driver 1.00

de

4/26/94• Changed the interface specification for PCM stream playback (leftchannel and right channel simultaneous playback specification).

nfi

4/19/94• Added a detailed explanation of the tempo change parameter (P2).
• Improved timing specification for reading VOLUME FETCHcommand(from 100 ms to selectable timing). Improved the specification for
playback start time lag (maximum 16 ms to 4 ms).

Driver 1.00

Implementation of feedback from the “System Interface Specification Review Meeting":• Changed command buffer from 1 screen to 8 screens and changed
corresponding work area.
• Changed PCM stream playback from 2 channels to 8 channels and changed
corresponding work area and commands.
• Changed the host interface work address from 480h to 700h.
• Set new system interface work in 128 bytes beginning from 480h.
• Optimized the size and location of control commands.
• Added mixer change and mixer parameter change parameters.
• Added explanations on PCM stream playback transfer overhead.
• Changed the priority control (from 8 levels to 128 levels and added
replay disable/enable).
Driver 1.10

6/8/94• Changed the PCM STREAM PLA
Y command parameters andupdated the accompanying explanations.
• Changed the MIXER PARAMETER CHANGEcommand and updated
the accompanying explanations.
• Changed the specification for the VOLUME ANALYZE START command(left and right channels are now always output).

6

Driver 1.10

Specifications added and changed by the “Titan Support Meeting”:• Added a SEQUENCE VOLUMEcommand.
• Deleted the FADE IN/FADE OUT command and changed the fadein/fadeout method.
• Changed the specifications for the MIDI DIRECT CONTROLcommand.
• Added a new status for the sequence play position.
• Updated the specifications for the sound priority control and changed
the specifications for each of the accompanying command parameters. Driver 1.10

SE

6/15/94

GA

Co

5/24/94

• Added interrupt processing for the host when the play address is
updated during PCM stream playback.
• Added the corresponding host interface work and status to accompany
the added processing above.
• Clarified the version of the sound driver that corresponds to the manual
version (the sound driver version is stored in ASCII format in the header of
SDDRV.TSK).
Driver 1.10

7/6/94• Added play address update status interrupt.
• Changed the precision of volume data from 8 bits to 16 bits.
• Changed the song play mode in conjunction with deletion of the
FADE IN/FADE OUTcommand. Made PCM play address area compatible
with stereo playback (1B to 2B).
• Added “sound driver ERROR status work”.
• Added notation regarding updating of the data transfer end bit (twolocations in the system interface table and sound area map CRNT work). Driver 1.10

7/28/94• Changed explanation on DSP program load flag and eliminatedprocessing of the related bit operation on the host side.
• Eliminated sequence start P5 (play mode).
• Added the HARD CHECKcommand.
• Added the PCM parameter changecommand.
• Added a sound output mono/stereo mode setting. Added a PCM
start P11-12 (playback start position).

Driver 1.10

• Changed method of starting sound system.
• Changed sound program (SDDRVs.TSK) to include 68k vector table
and system information table.
• Simplified method of starting sound system in connection with this.
• Eliminated PCM start P11-12 (playback start position).

Driver 1.11

• Added DSP CLEAR command (0Ch).
• Added SOUND ALL OFF command (0Dh).
• Added 68000 error code bit map.
• Added explanation on overall structure of sound area map.
• Added explanation on fixes for noise in PCM stream playback loop.
• Corrected part of explanation on PCM stream playback.
• Added explanation on processing method used by the sound driverin response to host commands.
• Corrected part of explanation on sound driver startup method.

Driver 1.27

• Added SEQUENCE PAN command (0Eh).
• Added flag word and control work for 3D sound control.

Driver 1.27

de

nfi

GA

11/14/94

Co

9/2/94ntial

6/22/94

11/24/94• Changed explanation on sound reset and reset clear method
added in version 3.01.
• Deleted PCM stream playback loop noise fix added to version 3.01.
• Added explanation on SEQUENCE PAN command (0Eh).
• Added explanation on flag word and control work for 3D sound control.
• Added explanation on replacing sound data.
Driver 1.27

SE

12/1/94

12/16/94• Added program work and work pointer for Yamaha 3D sound.
• Added COEF/MADRS pointer for Yamaha 3D/QSound and added
detailed description of Yamaha 3D work.

SATURN Sound Driver System Interface Version 3.03

Driver 1.28

7

0000H
0400H

68K vector table (400H)
0400H

System interface area (400H)

0800H

4KB

Reserved area
(800H)

0440H
0480H

1000H

nti
al

System Area Memory Map

System interface table

64B

System information table

64B

System interface work
0500H

20KB
Sound driver(3000H)
Sequence decompression process(2000H)de

68K program area

Sound area map CRNT work

128B

256B

0600H

nfi

Tool interface work
(128B)

0680H

6000H

256B

Monitor area
(128B)Co

0700H

68K work area

16KB

Sound driver(1800H)
Sequence decompression process(2800H)

A000H

GA

07FFH

Sound area map(1000H)

AFFFH

SE(Total 44KB)

8

4KB

Host interface work

256B

System Area Contentsntial

The system area is a fixed area for running the sound driver provided by SEGA, andcannot be used for anything else. Since the mapping of this area cannot be changed,
the user need not be concerned about its contents during sound development. The
44 Kbyte (B000h) from the top (00000H) of the 4Mbit sound memory is used, and thecontents of this area are described below.

de

68K Vector Table
This is the vector table for program interrupt processing by the sound CPU (68K). Its
size is fixed at 400h beginning from 0000h and cannot be changed.

nfi

System InterfaceArea
This is a fixed area for, among other things, interfacing with the sound driver, asound development system, and a host system during the incorporation of soundrelated content into the game. Its size is 400h beginning from 0400h and cannot bechanged.
68K ProgramArea
This is the program area for the sound CPU, and is used to store and execute all
programs related to sound. The top address and size of this area are stored in thesystem information table of the system information area.

SE

GA

Co

68K Work Area
This is the program work area for the sound CPU. It is also used as a work area by
all sound-related programs. The top address and size of this area are stored in thesystem information table of the system information area.

SATURN Sound Driver System Interface Version 3.03

9

de

nti
al

Sound Area Map
The entire sound area map is stored here. The sound area map can hold up to 128
area maps in 4096 bytes, with one area map holding up to 32 map data (8B) in 256
bytes. Using the Sound Simulator, one sound area map can be created for one game.
Since this area is for storing the entire sound area map, the map data of the currently
selected active area is stored in the sound area map CRNT work (500h-5FFh) of thesystem interface area by the MAP CHANGEcommand. The top address and size of thisarea are stored in the system information table of the system information area.

A000h
Map1
Map2

Area Map 1(MAX 245B

Map4
FFh
Map1

All end (1B)

Area Map 2(MAX 245B

Co

Map2

nfi

Map3

Sound area MAP(MAX 4096B)

Map3
Map4
FFh

All end (1B)

Map1

GA

Map2

Area Map 3(MAX 245B

Map3

Map4

SE

AFFFh

Note:

10

FFh

end code (1B)FFh

All end (1B)

To improve memory efficiency when there are multiple areas, the end code of each area isreduced to one byte. Therefore, byte access is used for access of the sound area map.

System InterfaceArea

ntial

In the Saturn sound system, a system interface area provided in the fixed area of thesound memory is used to exchange information between sound drivers, sounddevelopment systems, the host system during game content assembly, and othersystems. It comprises an information table that stores system information, and awork area for exchanging information.

deSystem Interface T
able (400H–43FH: 64B)
This is an information table for controlling the interface between each of the systems
during sound development or game assembly. It is stored at a fixed address in thesound memory. It also provides a work area for the system interface during sounddevelopment as well as the various systems on the development target.
OffsetSize

Information Data

Contents

0400

+00

4B

0404

+04

4B

System information table
pointerHost interface work pointer

0408

+08

4B

040C

+0C

4B

Sound area map CRNT
work pointerTool interface work pointer

0410

+10

1B

DSP Program load flag

0411
0412

+11
+12

0416

+16

0418

+18

Sound driver load flag
System interface work
pointerSound driver ERROR
statusHardware check return
statues—

Top address of system informationtable(0440h)Top address of host interface work
(0700h)Top address of sound area map CRNT
work
(0500h)Top address of sound tool interface
work(0600h)bit 7
0: no data
1: DSP program load complete
bit 6
0: no data
1: SCSP BIN load complete
bit 5
0: no data
1: sequence data load
complete
Sound driver program work byte
Top address of system interface work
(0480h)Sound driver error status store work:
word
HARDWARE CHECK command return
status store work: word
Reserved area

68000 error bit map
System interface work
pointer—

68000 error status bit map
Top address of system interface work
(0480h)Reserved area

Co

nfi

Address

1B
4B
2B

GA

2B

041A041F
0420
0424

+1A

6B

+20
+24

4B
4B

0428043F

+2B

24B

SE

Note: The values in parentheses may change with software upgrades.

SATURN Sound Driver System Interface Version 3.03

11

nti
al

DSP Program Load Flag
Only used in sound development. Do not use.
System Interface W
ork Top Address

The same contents at +12 are stored at +24. This spec was added in consideration of
the efficient access of 4-byte boundaries by the SH2. To maintain backward compatibility, +12 will not be eliminated.
68000 Error Status Bit Map

68000 Error Status Bit Map

Bit 2:
Bit 1:
Bit 0:nfi

Co

Bit 3:

68K CPU address error
68K CPU bus error
68K CPU exception processing
RAM area for DSP is insufficient for the effect change.
RAM setting for DSP is insufficient for the effect change.
RAM for DSP does not exist in map for the effect change.
DSP program has not been downloaded for the effect change.
DSP program does not exist in map for the effect change.
Sequence bank has not been downloaded at sequence start.
Sequence song number does not exist in sequence bank at sequence start.
Sequence bank does not exist in the map at sequence start.
Program number does not exist in tone bank for the MIDI program change.
Control number and MIDI channel of the tone bank have not been set for the MIDI
program change.
Control number and MIDI channel of the tone bank have not been set for the MIDI
program change (mixer change).
Tone bank does not exist in the map when changing mixer or tone bank, or tonebank has not been downloaded.
Map does not exist at (A000h - ) when changing map.
Mixer does not exist in tone bank when changing mixer. Also, tone bank has notbeen set.

GA

Bit 31:
Bit 30:
Bit 29:Bit 13:
Bit 12:
Bit 11:
Bit 10:
Bit 9:
Bit 8:
Bit 7:
Bit 6:
Bit 5:
Bit 4:

deSince only the last error data generated can be accessed in the +16 sound driver error
status store work, the 68000 error status bit map was added at +20 to facilitate thelookup of up to 32 error status types at the same time in bits.

• Bits 31 to 24 are not automatically cleared, and therefore should be cleared by thehost as required.

SE• Bits 23 to 0 are automatically cleared by the next normal operation.

12

de

nti
al

System Information able
T (440H–47FH: 64B)
This is an information table in which system information of the sound system isstored at a fixed address in the sound memory.

nfi

Note: The values in parentheses may change with version upgrades.

System Interface W
ork (480H–4FFH: 128B)
This is a work area for exchanging information between systems.
pointer + Sizexx

Information Data

1B

Interrupt control word

+01
+02

1B
1B

Interrupt mode
PCM play number

GA
+03

1B

Sound control word

+04

1B

3D-Sound control flag

+05
+06
+07
+08-39+40-87+88-111+112127

1B
1B
1B
32B
48B
24B
16B

QSound COEF
YAMAHA 3D COEF
YAMAHA 3D MADRSYAMAHA 3D work
3D program work—
Titan support

SE

Bit 7

0: PCM play address update interrupt disabled(Host to Sound)
1: PCM play address update interrupt enabledType of interrupt for host(Sound to Host)
PCM stream play number during PCM play address
update interrupt
Bit 7: PCM play number 7 (no update when bit = 0
and update when bit = 1)
Bit 6: PCM play number 6
Bit 5: PCM play number 5::
Bit 0: PCM play number 0(Sound to Host)
Bit 7: 0: sound output STEREO mode (Host to Sound)
1: sound output MONO modeBit 7: YAMAHA 3D 0: not used 1: in use
Bit 6: Qsound0: not used 1: in use
Qsound COEF pointer
YAMAHA 3D COEF pointer
YAMAHA 3D MADRS pointer
YAMAHA 3D Control Data Storage Area
YAMAHA 3D Program Work Area
Reserved area
Reserved area for Titan compatibility (cannot be used on
Saturn)Co+00

Contents

SATURN Sound Driver System Interface Version 3.03

13

Interrupt Control W
ord

none
PCM address update interrupt
reservedde• 00h:• 01h:• 02h-FFh:ntialWhen a PCM stream is played, an interrupt to the host (SH2) can be generated at the
point the PCM play address is updated. When an interrupt is necessary, set the
specified bit of this control word to “1." Also, reset this interrupt on the host side.
This interrupt request is reset by writing “1” to the corresponding bit (MCIRE:Bit5)
in the SCSP interrupt request reset register. Refer to the hardware manual or SCSP
manual for more information regarding this process. The following are the hostinterrupt types:

SE

GA

Co

nfi

3D-Sound Control Flag/Y
AMAHA 3D Work
This is the interface area for controlling 3D sound. (This is not yet supported inversion 1.27 of the sound driver. This area is reserved for adding this function.)14

Yamaha 3D Work (32B)
OffsetDescription

de

nti
al

Distance Target position (0 --> 127)
Horizontal Target position (0 --> 127)
Vertical Target position (0 --> 127)
Bit 7 0: nop 1: start movement instruction
Distance Unit movement (1 --> 127)
Horizontal Unit movement (-128 --> 127: 2's complement)
Vertical Unit movement (-128 --> 127: 2's complement)
Reserved
Current distance (0 --> 127)
Current horizontal axis (0 --> 127)
Current vertical axis (0 --> 127)
Reserved
Reserved
Reserved
Reserved
Reserved
Distance Target position (0 --> 127)
Horizontal Target position (0 --> 127)
Vertical Target position (0 --> 127)
Bit 7 0: nop 1: start movement instruction
Distance Unit movement (1 --> 127)
Horizontal Unit movement (-128 --> 127: 2's complement)
Vertical Unit movement (-128 --> 127: 2's complement)
Reserved
Current distance (0 --> 127)
Current horizontal axis (0 --> 127)
Current vertical axis (0 --> 127)
Reserved
Reserved
Reserved
Reserved
Reserved

nfi

CH1
CH1
CH1
CH1
CH1
CH1
CH1
CH1
CH1
CH1
CH1
CH1
CH1
CH1
CH1
CH1
CH2
CH2
CH2
CH2
CH2
CH2
CH2
CH2
CH2
CH2
CH2
CH2
CH2
CH2
CH2
CH2

Co

00h
01h
02h
03h
04h
05h
06h
07h
08h
09h
0Ah
0Bh
0Ch
0Dh
0Eh
0Fh
10h
11h
12h
13h
14h
15h
16h
17h
18h
19h
1Ah
1Bh
1Ch
1Dh
1Eh
1Fh

SE

GA

(The offset is the offset position from 488H.)

SATURN Sound Driver System Interface Version 3.03

15

Size

+00 (hex) 1B
+01
+04
+05

3B
1B
3B

Interface Data

End mark
Data ID
ID numberStart address
Load markArea size

Data end bit
Data type
Data number
Area start address
Transfer end bit
Area size

+F9
+FC
+FD

3B
1B
3B

0/1
0-3
0-15
00000-FFFFF
0/1
00000-FFFFF

End mark
Data ID
ID numberStart address
Load markArea size

Data end bit
Data type
Data number
Area start address
Transfer end bit
Area size(bit 7)(bits 4-6)
(bits 0-3)
(bits 0-19)(bit 7)(bits 0-19)

0/1
0-3
0-15
00000-FFFFF
0/1
00000-FFFFF

SE

GA

Co

1B

(bit 7)(bits 4-6)
(bits 0-3)
(bits 0-19)(bit 7)(bits 0-19)

nfi

:
+F8

Contents

depointer +
xx

nti
al

Sound Area Map CRNT Work (500H-5FFH: 256B)
The area map (an active map may contain up to 32 map data items ) of the currently
selected area is stored in this area. When a map change is received from the hostsystem, the sound system transfers the area map data of the active area to this region. One map data is comprised of 8 bytes, and one area can hold up to 32 map
data items (8 x 32 = 256B). Since the map data is stored in random order and thenumber of map data items can vary, data is searched by type and data number. Datais stored from the top. When there is no more data, the data end bit of the map data
is set.

Precautions• When the host system has transferred tone bank data, sequence data, DSP program data, or when
the data content has been exchanged, be sure to set the transfer end bit of the corresponding map to
1. The sound driver uses this bit to confirm whether the transfer of data is complete.
• DSP WORK RAM can only be set in 8Kbyte (2000h) units. Also, be sure to set the address and size
to an even number. An odd number cannot be set.

16

nti
al

• Since there can only be one DSP WORK RAM area in the sound memory, ID number (0-15) has no
meaning when Data ID = 3 (DSP WORK RAM).

Tool Interface Work (600H–6FFH: 256B)
Information on the RAM area used by the Wave Editor, Tone Editor, and DSP Linker
is stored in this work area. The lower 128 bytes are monitor data area for monitoring
the playback status.
SizeInterface Data

+00 (hex)
+02
+04
+08
+0C
+0E
+12
+16
+18
+1C
+20
+40
+44
+46
+4A
+4E
+4F-7F+80-83

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

—
—
Area Start Address
Area Total size—
Area Start Address
Area Total size—

4B

TrgtMem_Filename

TrgtMem_DSPRAMSize

TrgtMem_RBL

Reserved
Reserved
Wave Editor RAM area start address
Total Wave Editor RAM area size
Reserved
Total Tone Editor RAM area start address
Total Tone Editor RAM area size
Reserved
DSP Linker dedicated area
DSP Linker dedicated area
DSP Linker dedicated area
DSP Linker dedicated area
DSP Linker dedicated area
DSP Linker dedicated area
DSP Linker dedicated area
DSP Linker dedicated area
Reserved
Bits 24-31 (1st byte): Program (Voice) number 0-127
Bits 16-23 (2nd byte): MIDI note number 0-127
Bits 08-15 (3rd byte): MIDI velocity 0-127
Bits 00-07 (4th byte): Reserved

nfi

TrgtMem_DSPprogSize

TrgtMem_ModElementAddress
TrgtMem_ModElementSize

Co

TrgtMem_NumberOfElements—
Voice 1 monitor:::
Voice 32 monitor

Bits 24-31 (1st byte): Program (Voice) number 0-127
Bits 16-23 (2nd byte): MIDI note number 0-127
Bits 08-15 (3rd byte): MIDI velocity 0-127
Bits 00-07 (4th byte): Reserved

SE

GA+FC-FF

TrgtMem_DSPprogAddress

Contents

depointer +xx

SATURN Sound Driver System Interface Version 3.03

17

nti
al

Host Interface Work (700H–7FFH: 256B)
This is a work area used for communications between the host system and the soundsystem. Commands are received in this area from the host system and then datasuch as status and timing flags are returned. Basic control is performed in the areas
listed below, but since specific commands are required by projects (games), an unused area may be used for this purpose when required. Other data such as modes
and status can similarly be added or changed as required.
SizeInterface Data

Contents+00 (hex)
+10
+20
+30
+40
+50
+60
+70
+80
+82
+84
+86
+88
+8A
+8C
+8E
+90
+92
+94
+96
+98
+9A
+9C
+9E
+A0
+A2
+A4
+A6
+A8
+AA
+AC
+AE

16B
16B
16B
16B
16B
16B
16B
16B
2B
2B
2B
2B
2B
2B
2B
2B
2B
2B
2B
2B
2B
2B
2B
2B
2B
2B
2B
2B
2B
2B
2B
2B

Command block1
Command block 2
Command block 3
Command block 4
Command block 5
Command block 6
Command block 7
Command block 8
song 1 mode/statussong 2 mode/statussong 3 mode/statussong 4 mode/statussong 5 mode/statussong 6 mode/statussong 7 mode/statussong 8 mode/status
Total volume L
Total volume R
H-vol L
H-vol R
M-vol L
M-vol R
L-vol LL-vol RPCM 0 adrs
PCM 1 adrs
PCM 2 adrs
PCM 3 adrs
PCM 4 adrs
PCM 5 adrs
PCM 6 adrs
PCM 7 adrs

Command block 1 from host to sound system (Host to Sound)
Command block 2 from host to sound system (Host to Sound)
Command block 3 from host to sound system (Host to Sound)
Command block 4 from host to sound system (Host to Sound)
Command block 5 from host to sound system (Host to Sound)
Command block 6 from host to sound system (Host to Sound)
Command block 7 from host to sound system (Host to Sound)
Command block 8 from host to sound system (Host to Sound)Play sequence 1 mode/status(Sound to Host)
Play sequence 2 mode/status(Sound to Host)
Play sequence 3 mode/status(Sound to Host)
Play sequence 4 mode/status(Sound to Host)
Play sequence 5 mode/status(Sound to Host)
Play sequence 6 mode/status(Sound to Host)
Play sequence 7 mode/status(Sound to Host)
Play sequence 8 mode/status(Sound to Host)
Total volume data L (0000h-7FFFh)(Sound to Host)
Total volume data R (0000h-7FFFh)(Sound to Host)
Treble range volume data L (0000h-7FFFh) (Sound to Host)
Treble range volume data R (0000h-7FFFh) (Sound to Host)
Midrange volume data L (0000h-7FFFh)(Sound to Host)
Midrange volume data R (0000h-7FFFh)(Sound to Host)
Bass range volume data L (0000h-7FFFh)(Sound to Host)
Bass range volume data R (0000h-7FFFh)(Sound to Host)
PCM play number 0 play address (00h-0Fh) (Sound to Host)
PCM play number 1 play address (00h-0Fh) (Sound to Host)
PCM play number 2 play address (00h-0Fh) (Sound to Host)
PCM play number 3 play address (00h-0Fh) (Sound to Host)
PCM play number 4 play address (00h-0Fh) (Sound to Host)
PCM play number 5 play address (00h-0Fh) (Sound to Host)
PCM play number 6 play address (00h-0Fh) (Sound to Host)
PCM play number 7 play address (00h-0Fh) (Sound to Host)

nfi

Co

GA

SE
18

de

pointer +
xx

nti
al
de

Co

nfi

PCM Play Numbers 0-7 PlayAddress
These are data positions during playback which are denoted as the number ofsamples relative to the start of the PCM Stream playback buffer. Byte numbers
apply when playback is in 8 bits, and word numbers apply when playback in 16 bits.
Although the number of samples is 16-bit data, only the upper 4 bits can be monitored, which means that PCM data replacement can only be controlled in 4K sample
units.
The Play address is set to "MONO" for mono play, and set to the "Rch play address"
for stereo playback. Since the right and left channel play addresses are the same
during stereo playback, the "Lch play address" is not set.

+0
+1

MONO or Rch play address
Lch play address

GA

Note 1
Although access to the sound memory by the host can be performed in 1-byte (byte), 2-byte (word)and 4-byte (long word) units, note that the hardware takes the same amount of processing time
whether it is byte access or word access. Also, one long word access is slightly faster when comparedwith two word accesses.

SE

Note 2Use caution since the sound CPU cannot operate while the host system is accessing the soundmemory. Keep reads and writes of the sound memory by the host system to a minimum and do notallow continuous access over long periods. Refer to the PCM Stream Playback section for guidelines.

SATURN Sound Driver System Interface Version 3.03

19

nti
al

Command Block
Since eight 16-byte command blocks have been provided for commands from the hostto the sound system, a maximum of eight commands can be issued at the same time.

Command code
(Reserved)
Parameter 1 (P1)
Parameter 2 (P2)
Parameter 3 (P3)
Parameter 4 (P4)
Parameter 5 (P5)
Parameter 6 (P6)
Parameter 7 (P7)
Parameter 8 (P8)
Parameter 9 (P9)Parameter 10 (P10)
Parameter 11 (P11)
Parameter 12 (P12)
Parameter 13 (P13)
Parameter 14 (P14)

nfi

+0
+1
+2
+3
+4
+5
+6
+7
+8
+9
+10
+11
+12
+13
+14
+15

de

Command BlockCo• The sound driver processes the command block in order from block 1 to block 8
and then immediately begins processing block 1 again. Also, since the driver does notlook at the next command block until it is completely finished processing each command
block, the command processing order set by the host is guaranteed.
• After the sound driver detects a command and finishes processing it, it clears thatcommand to 00h. Until then, the command is being processed (or waiting for processing).

SEGA• Since there are command sequences, such as map changes and mixer changes, where
their order is important, set commands so that the sound driver processes them in thecorrect order. (If open blocks from 1 to 8 are simply searched and commands are set into
them, then commands may be executed in an order different from the order written by thehost.)

20

Song sound mode
StatusSong Playback Mode

00:
01:
02:
03:
04:

Stop
Play
Fade
Play pause
Fade pause

Status Detail

NormalStatus code

00:
01-FF:

nfi

Out of sequence resolution range
No sequence tempo data
No sequence event data
Out of sequence tempo data range
Data error during sequence data decompression

SE

GA

Co

80h:
81h:
82h:
83h:
FFh:

Status

de

+0
+1

nti
al

Play Sequence Mode/Status
Since the playback status of the sequence is continually updated as mode and statusdata, refer to the mode and status areas shown below to find the sequence's current
status. A fade is set by a sequence volume command, and when the fade is completed, either a Play or Stop is set.

SATURN Sound Driver System Interface Version 3.03

21

Starting the Sound DriverntialThe sound driver is started by transferring the sound program to the soundmemory and clearing the CPU reset signal. However, since the contents of memory
cannot be guaranteed at power-on, memory initialization is required. Use the following
procedure to start the sound driver.

Sound System Startup
The following operation will start the sound CPU and run the sound program from the
beginning of the program. SCSP registers, resets and other hardware issues are describedin greater detail in the SCU, SCSP and SMPC user’s manuals.

Co

nfi

de

1. Reset sound CPU (halt the 68000).
Execute the SMPC I/F library's SOUND OFF.
2. Initialize the SCSP registers to 4Mbit.
Write 02h to the SH2 address 25B00400 in bytes.
3. Zero-clear the system area (B000h from 00000h).
Zero-clear addresses 25A00000 to 25A0AFFF.
4. Transfer the sound program (SDDRVS.TSK) to the sound memory from 00000h.
Transfer the sound program (SDDRVS.TSK) to the area from SH2 address 25A00000.
5. Transfer the sound area map to the sound memory.
Transfer the sound area map to the area from SH2 address 25A0A000.
6. Clear reset of the sound CPU (start the 68000).
Execute the SMPC I/F library's SOUND ON.
7. Other settings should be made via the system interface work (480h-4FFh) control words.

Sound Control
Sound data is required to play songs and sound effects. Preparation for playback iscompleted by transferring the sound data to the sound memory. After this, the playback
is controlled by commands such as those that start and stop song playback and start andstop sound effects playback. Use the following steps to transfer sound data and to control
sound.

SEGA

1. Issue the DSP CLEARcommand (0Ch)
2. Issue the SOUND ALL OFF command (0Dh).
3. Transfer the sound block data corresponding to the area from B000h in the sound memory.
Transfer the sound block data to an area from SH2 address 25A0B000.
4. Issue the MAP CHANGEcommand (08h) corresponding to the area.
5. Set the transfer complete bit of the sound area map CRNT work to 1.
6. Issue the EFFECT CHANGEcommand (83h) as required.
7. Issue the MIXER CHANGEcommand (87h) as required.
8. Perform control of sequence data such as start and stop.
9. Should the area change, repeat from 1 and 8 above.
Note:

22

If the map is changed or if sound data in-use is replaced while sound is still playing
or the DSP is operating, the system may crash. Be sure to perform steps 1 and 2 above to avoid this..

• DSP program:• Sound block data:

Tone definition data comprising wave data and tone parameters
Performance data in which the playback data for songs and soundeffects are stored
The DSP microprogram itself and coefficient data
One file containing all sound data located in the sound memory
according to the area mapde• Tone bank data:• Sequence data:ntialSound Data
There are three types of sound data, each of which can be located freely in memory
according to the area map. However, if the amount of data (number of files) becomeslarge, it becomes difficult for the host to manage it. As a result, file transfer and transfer
size errors may occur more frequently. Since it is convenient to include all 4Mbit worthof data (does not actually include the system area and the DSP ring buffer parts) in one
file, the sound developer should make one large file for each area as the sound block
data. The sound block data can be created with the sound simulator.

nfi

Replacing Sound Data
Each set of sound data (tone bank data, sequence data, DSP program) can be replaced
as required by the game scene or conditions. Transfer new data as required. The procedure is shown below.

Co

1. Set the transfer end bit of the sound area map CRNT work to 0.
2. Transfer the new data according to the MAP data (transfer address and area size)of the sound area map CRNT work.
3. Set the transfer end bit of the sound area map CRNT work to 1.

Take the following precautions when transferring data:• If the transfer data is greater than the area size, other data will be destroyed.

Therefore, do not transfer data greater in size than the area size.
• Tone bank data and sequence data cannot be changed while they are being played back.

SE

GA

When replacing data, perform a transfer after stopping playback.

SATURN Sound Driver System Interface Version 3.03

23

Sound Control Commands

SEQUENCE START(S - -)
SEQUENCE STOP
(S - -)

01

02

SEQUENCE PAUSE(S - -)

03

SEQUENCE CONTINUE(S - - )04

SEQUENCE VOLUME(S - -)

05

Sound control number
Sequence bank number
Sequence song number
Priority level

P1

0-7:

Sound control number

P1

0-7:

Sound control number

P1

0-7:

P1
P2
P3
P1
P2
P3-P4

0-7:
0-127:
0-255:
0-7:-:+32767to -32768

0B

Nothing (end of volume acquisition)

0C

Nothing (halts DSP)

0D

Nothing (stops all play slots)

0E

P1
P2

GA

SE

VOLUME ANALYZE START(- - C)VOLUME ANALYZE STOP(- - C)DSP STOP(S P C)SOUND ALL OFF(S P C)SEQUENCE PAN(S - -)

24

Sound control number

0A

08
09

MIDI DIRECT CONTROL(S - -)

0-7:
0-15:
0-127:
0-31:

Co

MAP CHANGE(S P - -)

P1
P2
P3
P4

Sound control number
Sequence volume
Fade rate
Sound control number
dummy
Given the standard tempo (000h), 1000h (4096)
equals double the tempo. The tempo is 1/2 whenthe value is negative
P1
0-255:
Area number of sound area
map that is changed.
P100h-FFh:
MIDI command word (see bit image below for
details)P200h-FFh:
MIDI channel wordP300h-7Fh:
MIDI data 1P400h-7Fh:
MIDI data 2
Nothing (start of volume acquisition)

07
TEMPO CHANGE(S - -)

Parameter DatadeReserved

CommandData
00 (hex)
Nothingnfi

Command NamentialBelow are descriptions of the commands and parameters issued to the sound systemfrom the host system. The parameters vary in length depending on the command.
Basic control is performed using the following commands, but since special commands become necessary depending on the project (game), unused command codes
may be allocated as required. Commands and parameters can similarly be added orchanged when required.

07:
bit 7:
bits 6-0:

Sound control number
0: Control OFF 1: Control ON
MIDI pan data (00h-7Fh)
00h: left <- -> 40h: center <- -> 7Fh:right (MIDI) pan is capable of 128 steps, but since
SCSP pan only supports 32 steps, the lower 2 bitsof the MIDI pan data are ignored.)(Continued on next page)MIDI Direct Control Bit Image

82

P1
P2
P1

Sound control number
8 levels: 00h (off), 20h, 40h, 60h, 80h, A0h, C0h, E0h(max)
00h-E0h: CD-DA level Right
8 levels: 00h (off), 20h, 40h, 60h, 80h, A0h, C0h, E0h
(max)
0-31:
CD-DA pan left; 32 levels
0-31:
CD-DA pan right; 32 levels
0-15:
16 levels, 0 if OFF

83

P1

0-15:

85

P1

CD-DA LEVEL(- - C)

P2

81

bit 7
0: Mono 1: Stereo
bits 6-5
Not usedbit 4
0: 16 bit PCM 1:8 bit PCM
bits 3-0
0-7: PCM stream playback number
P2
bits 7-5
0-7: Direct sound level, 8 levels
bits 4-0
0-31: Direct sound pan, 32 levels (ignored in stereo)
P3-P4 0000h-FFFFh: PCM stream buffer start address(upper 16 bits of 20 bit data)
P5-P6 0000h-FFFFh: PCM stream buffer size
(number of samples in 1 channel)
P7-P8 0000h-FFFFh: Pitch word (SCSP pitch register data: Oct&FNS)
P9
bits 7-3
0-15: Effect in select (P9 = Rch or MONO)
bits 2-0
0-7: Effect send level, 8 levels
P10 bits 7-3
0-15: Effect in select (P10 = Lch)bits 2-0
0-7: Effect send level, 8 levels
P1
0-7:
Stop playback PCM stream playback number

87
88

GA

HARD CHECK(- - -)86

Co

PCM STOP(- P -)MIXER CHANGE(S P C)MIXER
PARAMETER CHANGE(S P C)

SE

S:
P:
C:

P1
P2
P1
P2

89

P1

8A

P1
P2

PCM PARAMETERCHANGE(- P -)

Reservednfi

PCM START(- P -)(S P C)

Effect bank numberdeCD-DA PAN(--C)
TOTAL VOLUME(S P C)EFFECT CHANGE(S P C)

00h-E0h:

nti
al

P1
80

8B-FF

0-15:
0-127:
0-17:
bits 7-5
bits 4-0
0-5:

bits 7-5
bits 4-0

P3-P4
P5 bits 7-3
bits 2-0
P6 bits 7-3
bits 2-0
NothingTone bank number
Mixer Number
Effect out select0-7: Effect return level, 8 levels
0-31: Effect pan, 32 levels
check items 0 - DRAM 4Mbit read/write
1 - DRAM 8Mbit read/write
2 - SCSP MIDI
3 - Sound generator output (L/R)
4 - Sound generator output (L)5 - Sound generator output (R)0-7:
PCM stream playback number
0-7:
Direct sound level, 8 levels
0-31: Direct sound pan, 32 levels
0000h-FFFFh: Pitch word
0-15: Effect in select (P5 = Rch or MONO)
0-7:
Effect send level, 8 levels
0-15: Effect in select (P6 = Lch)
0-7:
Effect send level, 8 levels

Command for sequence playback or command related to sequence playback.
Command for PCM stream playback or command related to PCM stream playback.
Command for CD-DA playback or command related to CD-DA playback.

SATURN Sound Driver System Interface Version 3.03

25

nti
al

de

Fade In Method
Issue a SEQUENCE VOLUMEcommand before issuing a START command. The volume
will fade in according to the fade rate starting from volume = 0 until the specified
sequence volume is reached. The fade-in curve can be freely controlled by using theSEQUENCE VOLUMEcommand two or more times.

nfi

Fade Out Method
Issue a SEQUENCE VOLUMEcommand at volume = 0. The volume will fade out according to the fade rate from the current sequence volume until volume = 0. The fade-out
curve can be freely controlled by using the SEQUENCE VOLUMEcommand two or moretimes.

Co

Note 1Since commands such as MIDI DIRECT CONTROLand PCM START are closely related to the MIDI
channel and tone, as well as the DSP program and mixer settings, plan ahead with the sound developer
regarding the sound content.
Note 2Since a special DSP program is required for the frequency band based volume analysis, down- load thespecial DSP program using the EFFECT CHANGEcommand before issuing the VOLUME ANALYZE
command. A DSP program is not required for the main volume. Also, since data is updated in 16 ms
intervals in volume analysis, volume data should be read in 16 ms or longer intervals.

GA

Note 3
When stereo is specified by PCM start, the first half beginning from the top is processed as the rightchannel and the second half is processed as the left channel of the area specified by P3-P4. The PCM
stream buffer must start from an even address and must have an even size. Since the start address of
the PCM stream buffer is the upper 16 bits of the 20-bit data (00000h-FFFFFh), the lower four bits arealways 0. The SCSP pitch register word's octave + F number is specified as the pitch word of P7-P8.
Refer to the SCSP manual for details on pitch.

SE

Note 4The sound CPU cannot operate during the transfer (host to sound memory) of PCM stream data, andtherefore its operation cannot be guaranteed when data is transferred continuously over long periods
while a song or sound effect is being played at the same time. Use DMA burst write or transfer data inintervals.
Note 5
PCM stream playback can place a considerable burden on data transfer depending on the playback
rate, and therefore all eight voices may not be played. Refer to the Overhead During Data Transfer section
for guidelines.
26

ParametersntialSound Control Number
Up to eight sequences can be controlled when sequences are played, and are specified
by the sound control numbers 0-7 when the sequences are started. Stop, pause, continue and other commands are executed according to these sound control numbers.

deSequence Bank Number
When multiple sequence data banks are mapped in the currently active map, thesequence bank number identifies the sequence data bank in the active map. Since up
to 16 banks can be held in one map, this number ranges from 0 to 15. If there is only
one sequence data bank, then the number is always 0.
Sequence Song Number
Since multiple sets of sequence data can be stored in the sequence data bank, thesequence song number identifies the sequence data set in the sequence data bank.
Up to 256 sequences can be stored as long as the area size allows.

nfi

Priority Level
This specifies the priority level in 32 levels (0-31) when sequences are played. The
highest priority is assigned 0, and the lowest, 31. When all 32 of the sound slots are
full, subsequent sequences are given last-note priority and played accordingly. Voice
allocation for playing these sounds is controlled by this priority level.

Co

Sequence Volume
The sequence volume is specified from 0-127. The volume is lowest at 0 and highest(the original sound) at 127. The fade rate specifies the time until the specified volume
is reached. The final volume after a fade (specified sequence volume) is retained as thecurrent sequence volume. If a fade is not required, it is possible to set only the sequence volume by setting the fade rate to 0.

GA

Fade Rate
The time it takes to reach the specified sequence volume from the current sequence
volume is specified by the rate (0-255). The larger the value, the faster the change, with255 being the shortest time and 1 being the longest. If 0 is specified, the sequence
volume is set without a fade. A fade is performed from the currently set sequence
volume to the specified sequence volume, and therefore a fade in or fade out occurs
depending on whether the specified sequence volume is larger or smaller than thecurrent sequence volume.

SE

Effect Bank Number
When multiple DSP program banks that store DSP microprograms are in the current
active map, the effect bank number identifies each DSP program bank in the active
map. Since up to 16 banks can be held in one map, the number ranges from 0 to 15.
This number is 0 if there is only one sequence data bank.

SATURN Sound Driver System Interface Version 3.03

27

nti
al

PCM Stream Playback Number
A maximum of eight sounds can be played during PCM stream playback, and are
specified by the PCM stream playback numbers 0-7. Caution must be paid whenplaying in stereo as two voices are played for each PCM stream play number. The
maximum total of voices for mono and stereo is eight. If eight voices are exceeded,
the command is ignored.

deTone Bank Number
When multiple tone data banks are mapped in the current active map, the tone databank number identifies each bank. Since up to 16 banks can be held in one map, thenumber ranges from 0 to 15. When there is only one tone data bank, this number isalways 0.
Mixer Number
Specify mixer numbers when multiple mixers are contained in a tone bank. Since a
maximum of 128 mixer data settings can be held in one tone bank, a value from 0 to
127 can be specified.

Co

nfi

Effect In SelectThis is the DSP effect input channel. There are 16 input channels for the DSP, so avalue from 0 to 15 must be specified. The signal input to the effect input channel
undergoes signal processing in the DSP and is output from the effect output channelof the same number. Any value from 0 to 15 can be used when a DSP effect is not
used, but the effect send level must be set to 0.
Effect Out SelectThis is the DSP effect output channel. Since there are 16 output channels for the DSP
effect, a value from 0 to 15 may be specified. In addition, the two output channels(Lch/Rch) for CD-DA are output from the DSP effect output channels. Specify 16
and 17 when CD-DA is selected.

GA

Effect Send Level
The level of the direct signal input to the effect input channel (0-15) selected by
Effect In Select is specified as a value from 0 to 7. Nothing is input when 0 is specified, and input is set at maximum volume when 7 is specified. Specify 0 when the
DSP is not used.

SE

Effect Return Level
When selected via Effect Out Select, the effect volume output level from the effectoutput channel (0-15) is specified as a value from 0 to 7. Nothing is output when 0 is
specified, and output is set at maximum volume when 7 is specified.
Details of Pan Effect (32 Steps)
Left
Right

28

00h
Max
Max

01h
—
Max

02h
—
Max

—>
—>
Max

0Fh
Off
Max

10h
Max
Max

11h
Max
—

12h
Max
—

—>
Max
—>

1Fh
Max
Off

Precautions for Using Sequence Pan(Command 0Eh)

•

•

Co

•

nti
al

•

de

•

This is pan control for only the direct signal component and has no effect on thepan of the effect signal.
When bit 7 of address 25a00483H (byte) is H:MONO, all pan control is disabled(Stereo/Mono selector switch).
When the control command SEQUENCE PAN = ON is issued, pan control [BnH,0AH,xxH]
in the song as well as the pan control and the tone's layer-pan set by the MIDI
DIRECT CONTROLcommand (09H) of the corresponding control number are disabled.
When program change (CnH,xxH) in a song is issued, enabling/disabling of thetone's layer-pan data is dependent on the ON/OFF of the corresponding command. That is, once this command (= ON) is set, the pan set up to that point
remains enabled even if a new song is requested.
The conditions under which the tone's layer-pan data is enabled are as follows:
1: Stereo mode is set
2: Sequence pan control is OFF.
3: MIDI pan control has not been issued after Sequence Pan Control has been set
to OFF.
4: Note-on is issued under the above conditions.
Even if SEQUENCE PAN = OFF is issued, it has no effect on the pan position of thesound being played.

nfi•

Example(must be in stereo mode):GA

Control No. 3 SEQUENCE START ——↓Control No. 4 SEQUENCE PAN ON ——0Eh, 00h, 04h, 7Fh↓Control No. 4 SEQUENCE START ——↓Control No. 4 MIDI PAN CONTRL ——Bnh, 0Ah, xxh↓
Control No. 3 MIDI PAN CONTRL ——B7h, 0Ah, 00h

Pan setting is in the layer data.
Pan is set to 7Fh (far right)
Has no effect on the pan setting of control No. 3
The pan setting of sounds under control No. 4 are 7Fh(far right)

No change

The pan setting (affects sounds being played) of MIDI
channel #7 of control No. 3 shifts to 00h (far left). The panposition of other MIDI channels is set by the layer data.
Has no effect on the pan setting of control No. 4.

SE↓Control No. 4 SEQUENCE PAN ON —— The panned sound (including those being played) of all
0Eh, 00h, 04h, 00Fhsound under control No. 4 moves to 00h (far left). Has noeffect on the pan setting of control No. 3.

SATURN Sound Driver System Interface Version 3.03

29

↓
Control No. 4 MIDI PAN CONTRL ——B6h, 0Ah, 00h

The pan position (including sounds being played) of MIDI
channel #6 of control No. 4 moves to 00h (far left). The
pan position of other MIDI channels is set by the pansetting of the layer data. The pan of control No. 3 is notaffected.
The pan position (including sounds being played) of MIDI
channel #6 of control No. 4 is determined by the pansetting of the layer data controlled by program changes[C6h, xxh] within the song.

de↓Control No. 4 SEQUENCE START ——

nti
al

↓
Control No. 4 SEQUENCE PAN OFF —— There is no change in the sounds of control No. 4, andsounds played hereafter are dependent on the pan settingof the layer data.

SE

GA

Co

nfi

↓
Control No. 4 SEQUENCE PAN ON —— The pan position (including sounds being played) of all
0Eh, 00h, 04h, 7Fhcontrol No. 4 sounds moves to 7Fh (far right), and has noeffect on the pan setting of control No. 3.
↓
Control No. 4 SEQUENCE START ——No change in the pan setting of control No. 4.

30

PCM Stream Playback

Note:

de

nti
al

Overview
PCM Stream playback is used to play continuous, long PCM data by providing a ringbuffer for PCM playback in the sound memory. By using the loop playback function of
the sound chip to perform processing that writes new PCM data to buffer locations
that have been played, long PCM data can be played back continuously. It is possible
to write new data in areas that have been played by knowing the position of the data
being played. This current playback position is determined by using 4K sample units.
Therefore, by providing at least two 4K sample buffers (for an 8K sample), it becomes
possible to swap data.
One 8 bit sample becomes one byte and one 16 bit sample becomes 2 bytes. For example, a
4K sample would be 4096 bytes when 8 bits and 8192 bytes when 16 bits.

nfi

Setting Up a Buffer
A buffer can be specified at any location in memory. Normally, areas unused by tone
data or song data are used, but memory areas that are not used simultaneously with
PCM stream play can also be used. The maximum buffer size that can be set up for
stream playback of one channel is a 64K sample. The buffer size specified by thecommand parameter is the number of samples for one channel, and therefore twice
the memory of the specified size is used in stereo, so caution must be used.

Co

Example: Using the PCM stream buffer for stereo playback (one channel is divided up into two parts):

Right Channel Buffer 1
4K sample

Left Channel Buffer 1
4K sample
Left Channel Buffer 2
4K sample

SE

GA

Right Channel Buffer 2
4K sample

SATURN Sound Driver System Interface Version 3.03

31

Playback Method
The first PCM data is transferred to the entire PCM playback buffer (buff1, buff2).
[PCM start : 85h] is issued by the SOUND CONTROLcommand.
When playback of buff1 (4k sample) is finished, the next PCM data is transferred to buff1.
When playback of buff2 (4k sample) is finished, the next PCM data is transferred to buff2.
Continuous PCM data can be played back by repeating this operation.
To stop PCM playback, [PCM stop : 86h] is issued by the CONTROLcommand.

Note:

nti
al

1.
2.
3.
4.
5.
6.

In the case of stereo, the above processing is performed in two areas for the right and leftchannels.

nfi

deTiming for Buffer Rewrites
Since the data position currently being played back is stored in the host interface workarea, the next PCM data is written to the buffer that has completed playback. However,since the data position reference is restricted by hardware to only the upper 4 bits of the
16-bit sample (relative number of samples from the top of the PCM stream playback
buffer), the monitoring precision is limited to every 4K sample. PCM playback processing is possible if there are at least two PCM stream buffers. However, multiple buffers
can be used to provide a greater margin for timing. Since it is possible to generate aninterrupt to the host according to the timing of the data position being updated, thisfeature can be used if necessary. The control information of this interrupt is in the systeminterface work.

1 word transfer = 4 clock cycles (1 clock cycle = 35 ns)
Assuming 1 word transfer = 6 clock cycles to allow a margin of safety,
then 6 clock cycles x 735 words = 4410 clock cycles (= 154.35 µs).
The SH2 requires approximately 154 µs to transfer 735 words (1,470
bytes).

GA

During DMA burst writes:

Co

Overhead During Data ransfer
T
Since the PCM playback slot is fixed at 44.1 KHz, 1 sample is played back every 22.68 µs
from the start of playback. Therefore when Vint is used, 735 samples (16,666 µs ÷ 22.68µs) need to be rewritten (transferred) every 16 ms for one stream playback channel.

However, if other sounds are being generated, or if the DSP is being used, the soundchip can only access the sound memory 20% to 30% of the time per one sound chip cycle(22 µs). This requires extra wait time, and since only 16 words can be transferred in one
cycle (22 µs) of the sound chip, about 1 ms is required to transfer 735 words.

SE

The 735 samples referred to by the equation above is for mono playback at 44.1 KHz.
Overhead can be reduced to half if playback at 20 KHz is acceptable (equivalent to 368
samples).
When using DMA, avoid long, continuous transfers so that the sound CPU can operate.
The sound CPU cannot operate during DMAs if data is transferred continuously.

32

Since mixer data is required when using effects, tone bank data must be provided even
if there is no sequence playback. Mixer data includes output levels for each effectchannel as well as pan data. This data is included in the tone bank data.

SE

GA

Co

nfi

de

Note:

nti
al

Supporting Playback Frequencies Other Than 44.1 KHz
The sound chip is normally set to play at 44.1 KHz, but the pitch parameters enable
playback at other frequencies. For example, if a 22-KHz sound (half of 44.1 KHz) isplayed back, it is played at twice its original pitch. Therefore, the original pitch canbe reproduced by halving the playback pitch. Since the pitch can be changed by ±8
octaves and one octave can be divided into 1024 steps, any frequency can be accommodated within this range. The calculation is a simple ratio calculation, and if thefrequency used is known, it can be calculated in advance. This should be passed tothe sound system during playback as the pitch parameter.

SATURN Sound Driver System Interface Version 3.03

33