Japanese
PROGRAMMER'S GUIDESound I/F library
■ | Go forward
Sound I/F library

1. guide


1.1 Purpose

The purpose is to interface the sound system with the main (including CD system) system and control the sound.

1.2 Overview

The sound system allows you to control sequence, PCM, and CD sound.
To control sound, you must first start your sound system. Next, for sequences and PCM, the sound data must be transferred to sound memory in preparation for performance. Also, the result of sound control is obtained by getting the status. The details will be explained in the following order.
See also Sound Driver System Interface in the Sound Development Manual.

1.3 Starting the sound system

The sound system must be started at power-on. The calling sequence is shown below.

void sndStart()
{
     SndIniDt sys_ini; /* Data storage area for system startup */

     SND_INI_PRG_ADR(sys_ini) = (Uint16 *)0x22002400;
                              /* 68K program storage start address setting */
     SND_INI_PRG_SZ(sys_ini) = (Uint16 *)0x4fc8;
                              /* 68K program size setting */
     SND_INI_ARA_ADR(sys_ini) = (Uint16 *)0x22004400;     
                              /* Sound area map storage start address setting */
     SND_INI_ARA_SZ(sys_ini) = 0x0550;
                              /* Sound area map size (word specification) settings */
     SND_Init(&sys_ini); /* Start sound system */
     ...
}

1.4 Preparing for performance

[sequence]
It is necessary to transfer the sequence data (song data, sound effect data) to be executed by the sound control function to the sound memory. Please transfer according to the current sound area map. Please see the Sound Development Manual for the sound area map. The calling sequence is shown in `` Controlling Sound ''.

[PCM]
For information on preparing PCM for performance, see Sound Driver System Interface in the Sound Development Manual.

1.5 Sound Control

[Functional overview]
Sound control functions write commands to sound memory. There are 8 command buffers. The sound control functions can be used without having to be aware of the command buffer.

[Calling sequence]
The calling sequence below is the processing up to the start of the sequence.

void sndCnt()
{
     sndStart(); /* Start the sound system (see above) */
     SND_ChgMap(2); /* Change sound area map */
     SND_MoveData((Uint16 *)0x22005000, 0xffff, SND_KD_SEQ, 2);
                                        /* Sound data transfer (sequence) */
     SND_MoveData((Uint16 *)0x22005500, 0xffff, SND_KD_TONE, 2);
                                        /* Sound data transfer (tone) */
     SND_SetTlVl(15); /* Overall volume setting */
     SND_StartSeq(0, 2, 5, 0); /* Start sequence */
     ...
}

1.6 Get status

[Functional overview]
Below is an overview of the functions for each sound data.

[Calling sequence]
The calling sequence below starts a different sequence at pronunciation control number 0 if the sequence with pronunciation control number 0 is stopped.

void sndHantei()
{
     SndSeqStat status; /* Sequence status storage area definition */
     ...
     SND_GetSeqStat(&status, 0); /* Get sequence status */
     if(SND_SEQ_STAT_MODE(stauts) == SND_MD_STOP){
                                        /* Is the sequence with pronunciation control number 0 stop? */
          SND_StartSeq(0, 2, 6, 0); /* Start sequence */
     }
}


■ | Go forward
PROGRAMMER'S GUIDESound I/F Library
Copyright SEGA ENTERPRISES, LTD., 1997