#include "sgl.h"
Uint16 song;
Uint8 prio;
Uint8 vol;
Uint8 rate;
Bool slBGMOn (song, prio, vol, rate);
Uint16 song --Song number.
Uint8 prio --Priority.
Uint8 vol --Volume.
Uint8 rate-Percentage of fades.
Bool- A flag that indicates whether the command was issued correctly.
Start playing BGM. BGM always uses pronunciation control number 0.
vol specifies the range from 0 to 127, and rate specifies the pitch to that vol.
As soon as you specify 0 for rate, it will be at that volume.
If the command buffer is full, FALSE is returned as the return value.
Otherwise, it returns TRUE.
slBGMOn (0, 4, 127, 0);
Although it is a specification to specify the priority in the second argument of this function, the sound driver does not currently support the priority of the sequence.
Therefore, even if you specify a value here, you cannot control the priority of the sequence.
If you want to control the priority of the sequence, you need to specify it on the user application side.
This function is a function that plays a song using sequence 0. Therefore, functionally
slSoundRequest ("bbbb", SND_SEQ_START , 0, Bank, Song, Prio);
It is no different from saying that.
slBGMCont | slBGMOff | slBGMFade | slBGMTempo |
slBGMStat | slSequenceOn | slSequenceOff | slSequenceFade |
slSequenceTempo | slSequencePause | slSequenceCont | slSequencePan |
slSequenceReset | slSequenceStat |
#include "sgl.h"
Bool slBGMPause (void);
void --Do not give anything.
Bool- A flag that indicates whether the command was issued correctly.
Pauses the BGM performance.
If the command buffer is full, the return value, FALSE, is returned, otherwise TRUE is returned.
slBGMPause (3);
slBGMOn | slBGMCont | slBGMOff | slBGMFade |
slBGMTempo | slBGMStat | slSequenceOn | slSequenceOff |
slSequenceFade | slSequenceTempo | slSequencePause | slSequenceCont |
slSequencePan | slSequenceReset | slSequenceStat |
#include "sgl.h"
Bool slBGMCont (void);
void --Do not give anything.
Bool- A flag that indicates whether the command was issued correctly.
Resumes the paused BGM.
If the command buffer is full, the return value, FALSE, is returned, otherwise TRUE is returned.
slBGMCont ();
slBGMOn | slBGMPause | slBGMOff | slBGMFade |
slBGMTempo | slBGMStat | slSequenceOn | slSequenceOff |
slSequenceFade | slSequenceTempo | slSequencePause | slSequenceCont |
slSequencePan | slSequenceReset | slSequenceStat |
#include "sgl.h"
Bool slBGMOff (void);
void --Do not give anything.
Bool- A flag that indicates whether the command was issued correctly.
Stops playing BGM.
If the command buffer is full, the return value, FALSE, is returned, otherwise TRUE is returned.
slBGMOff ();
slBGMOn | slBGMPause | slBGMCont | slBGMFade |
slBGMTempo | slBGMStat | slSequenceOn | slSequenceOff |
slSequenceFade | slSequenceTempo | slSequencePause | slSequenceCont |
slSequencePan | slSequenceReset | slSequenceStat |
#include "sgl.h"
Uint8 vol;
Uint8 rate;
Bool slBGMFade (vol, rate);
Uint8 vol --Maximum volume Uint8 rate --Volume increase rate
Bool- A flag that indicates whether the command was issued correctly.
Gradually changes the playing volume of BGM to the specified size.
As soon as you specify 0 for rate, it will be at that volume.
If the command buffer is full, the return value, FALSE, is returned, otherwise TRUE is returned.
slBGMFade (127, 4);
slBGMOn | slBGMPause | slBGMCont | slBGMOff |
slBGMTempo | slBGMStat | slSequenceOn | slSequenceOff |
slSequenceFade | slSequenceTempo | slSequencePause | slSequenceCont |
slSequencePan | slSequenceReset | slSequenceStat |
#include "sgl.h"
Sint16 tempo;
Bool slBGMTempo (tempo);
Sint16 tempo --BGM tempo
Bool- A flag that indicates whether the command was issued correctly.
Change the tempo of BGM. With 0 as the original tempo, if you go up or down 1000H, the tempo will be
It will be doubled or halved.
If you give 0, the tempo will return to the original tempo of the song.
If the command buffer is full, the return value, FALSE, is returned, otherwise TRUE is returned.
slBGMTempo (-50);
slBGMOn | slBGMPause | slBGMCont | slBGMOff |
slBGMFade | slBGMStat | slSequenceOn | slSequenceOff |
slSequenceFade | slSequenceTempo | slSequencePause | slSequenceCont |
slSequencePan | slSequenceReset | slSequenceStat |
#include "sgl.h"
Bool slBGMStat (void);
void --Do not give anything.
Bool- A flag that indicates whether the command was issued correctly.
Checks if BGM is playing and returns a flag.
TRUE is returned when playing (even during pause), and FALSE is returned when stopped.
if ( slBGMStat () == TRUE ) {
/ * Playing * /
} else {
/ * End of playback * /
}
slBGMOn | slBGMPause | slBGMCont | slBGMOff |
slBGMFade | slBGMTempo | slSequenceOn | slSequenceOff |
slSequenceFade | slSequenceTempo | slSequencePause | slSequenceCont |
slSequencePan | slSequenceReset | slSequenceStat |
#include "sgl.h"
Uint16 song;
Uint8 prio;
Uint8 vol;
Sint8 pan;
Uint8 slSequenceOn (song, prio, vol, pan);
Uint16 song --Song number Uint8 prio --Priority Uint8 vol --Volume Sint8 pan --Pan
Uint8 --Reserved sequence number
Plays the sound effect from the specified direction (Pan).
vol is specified in the range of 0 to 127, and pan is specified in the range of (left -127 to 0 to +127 right) (however, since Pan has 32 steps on the hardware, the lower 3 bits are invalid).
If you specify -128, the Pan setting is ignored.
If there is no free space in the command buffer and pronunciation management buffer, FALSE is returned.
In case of normal termination, the pronunciation control number is returned.
slSequenceOn (bank << 8 | song, 5, 127, 0);
If PAN is set in the sequence data, that will take precedence over the function arguments. If such data is forced on the program side,
To make PAN changes, execute the slSequencePan function after the slSequenceOn function.
Although it is a specification to specify the priority in the second argument of this function, the sound driver does not currently support the priority of the sequence.
Therefore, even if you specify a value here, you cannot control the priority of the sequence.
If you want to control the priority of the sequence, you need to specify it on the user application side.
slBGMOn | slBGMCont | slBGMOff | slBGMFade |
slBGMTempo | slBGMStat | slSequenceOff | slSequenceFade |
slSequenceTempo | slSequencePause | slSequenceCont | slSequencePan |
slSequenceReset | slSequenceStat | slSndFlush |
#include "sgl.h"
Uint8 seq;
Bool slSequenceOff (seq);
Uint8 seq --Sequence number.
Bool- A flag that indicates whether the command was issued correctly.
Stops playing the specified sound effect.
Returns TRUE on success and FALSE on failure.
slSequenceOff (3);
slBGMOn | slBGMCont | slBGMOff | slBGMFade |
slBGMTempo | slBGMStat | slSequenceOn | slSequenceFade |
slSequenceTempo | slSequencePause | slSequenceCont | slSequencePan |
slSequenceReset | slSequenceStat | slSndFlush |
#include "sgl.h"
Uint8 seq;
Uint8 vol;
Uint8 rate;
Bool slSequenceFade (seq, vol, rate);
Uint8 seq --Pronunciation control number Uint8 vol --Maximum volume Uint8 rate --Ratio of volume change
Bool- A flag that indicates whether the command was issued correctly.
Volume control is performed for the specified sound effect.
Specify the pronunciation control number, volume, and pitch.
Returns TRUE on success and FALSE on failure.
slSequenceFade (5, 120, 3);
slBGMOn | slBGMCont | slBGMOff | slBGMFade |
slBGMTempo | slBGMStat | slSequenceOn | slSequenceOff |
slSequenceTempo | slSequencePause | slSequenceCont | slSequencePan |
slSequenceReset | slSequenceStat | slSndFlush |
#include "sgl.h"
Uint8 seq;
Uint16 tempo;
Bool slSequenceTempo (seq, tempo);
Uint8 seq --Pronunciation control number Uint16 tempo --Tempo
Bool- A flag that indicates whether the command was issued correctly.
Changes the tempo for the specified sound effect. With 0 as the original tempo
When you move up or down 1000H, the tempo specifies the pronunciation control number and tempo.
Returns TRUE on success and FALSE on failure.
slSequenceTempo (4, 100);
slBGMOn | slBGMCont | slBGMOff | slBGMFade |
slBGMTempo | slBGMStat | slSequenceOn | slSequenceOff |
slSequenceFade | slSequencePause | slSequenceCont | slSequencePan |
slSequenceReset | slSequenceStat | slSndFlush |
#include "sgl.h"
Uint8 seq;
Bool slSequencePause (seq);
Uint8 seq-Pronunciation control number.
Bool- A flag that indicates whether the command was issued correctly.
Pauses the performance of the specified sound effect.
Returns TRUE on success and FALSE on failure.
slSequencePause (2);
slBGMOn | slBGMCont | slBGMOff | slBGMFade |
slBGMTempo | slBGMStat | slSequenceOn | slSequenceOff |
slSequenceFade | slSequenceTempo | slSequenceCont | slSequencePan |
slSequenceReset | slSequenceStat | slSndFlush |
#include "sgl.h"
Uint8 seq;
Bool slSequenceCont (seq);
Uint8 seq-Pronunciation control number.
Bool- A flag that indicates whether the command was issued correctly.
Resume the paused sound effect.
Returns TRUE on success and FALSE on failure.
slSequenceCont (6);
slBGMOn | slBGMCont | slBGMOff | slBGMFade |
slBGMTempo | slBGMStat | slSequenceOn | slSequenceOff |
slSequenceFade | slSequenceTempo | slSequenceFade | slSequencePan |
slSequenceReset | slSequenceStat | slSndFlush |
#include "sgl.h"
Uint8 seq;
Uint8 pan;
Uint8 seq --Pronunciation control number Uint8 pan --Pan Bool slSequencePan (seq, pan);
Bool- A flag that indicates whether the command was issued correctly.
Specifies the direction of the sound effect.
Specify pan in the range (left -127 to 0 to +127 right) (the lower 3 bits are invalid).
If you specify -128, the pan setting is ignored.
Returns TRUE on success and FALSE on failure.
slSequencePan (5, 65);
slBGMOn | slBGMCont | slBGMOff | slBGMFade |
slBGMTempo | slBGMStat | slSequenceOn | slSequenceOff |
slSequenceFade | slSequenceTempo | slSequenceFade | slSequenceCont |
slSequenceReset | slSequenceStat | slSndFlush |
#include "sgl.h"
Uint8 seq;
Bool slSequenceReset (seq);
Uint8 seq --Pronunciation control number
Bool- A flag that indicates whether the command was issued correctly.
Initializes the volume, tempo, and Pan of the specified pronunciation number.
Volume is maximum, tempo is usually uncontrolled by Pan.
Returns TRUE on success and FALSE on failure.
slSequenceReset (5);
slBGMOn | slBGMCont | slBGMOff | slBGMFade |
slBGMTempo | slBGMStat | slSequenceOn | slSequenceOff |
slSequenceFade | slSequenceTempo | slSequenceFade | slSequenceCont |
slSequencePan | slSequenceStat | slSndFlush |
#include "sgl.h"
Uint8 seq;
Bool slSequenceStat (seq);
Uint8 seq --Sequence number
Bool- A flag that indicates whether the command was issued correctly.
Checks if the specified sequence of pronunciation numbers is playing and returns a flag.
TRUE is returned when playing (even during pause), and FALSE is returned when stopped.
if ( slSequenceStat (4) == TRUE ) {
/ * Playing * /
} else {
/ * End of playback * /
}
slBGMOn | slBGMCont | slBGMOff | slBGMFade |
slBGMTempo | slBGMStat | slSequenceOn | slSequenceOff |
slSequenceFade | slSequenceTempo | slSequenceFade | slSequenceCont |
slSequencePan | slSequenceReset | slSndFlush |
#include "sgl.h"
Uint8 map;
void * slSndMapChange (map);
Uint8 map --Map number.
void * --The address of the current soundmap.
Change the current soundmap.
After transferring the sound data, set the transferred bits in the work area.
The return value is the address of the command buffer in which the parameters are set.
Returns NULL if the command buffer is full.
typedef struct sndmap {
Sint8 ID;
Sint8 ST_Addr [3];
Sint8 LdFlag;
Sint8 AR_Size [3];
} SOUNDMAP;
void init_sound () {
SOUNDMAP * smptrs, * smptrd;
/ * Wait for the current map to switch * /
slWaitSound ( slSndMapChange (1));
smptrs = (SOUNDMAP *) soundmap;
smptrd = (SOUNDMAP *) SoundCTRL;
while (smptrs-> ID> = 0) {
smptrd-> LdFlag = -1; / * Map Load Flag * /
smptrs ++;
smptrd ++;
}
slDMACopy (sounddat, (void *) (SoundSeqBuf), sizeof (sounddat));
}
slWaitSound | slSndFlush | SoundRdCount |
#include "sgl.h"
Uint8 slSndSeqNum (void);
void --Do not give anything.
Uint8 --Available pronunciation control number
Returns a free pronunciation control number.
If there is no space, 0 is returned, and if it ends normally, 1 to 7 are returned.
if ( slSndSeqNum ()> 0) {
slSequenceOn (...
}
slSequenceOn | slSequenceOff | slSequenceFade | slSequenceTempo |
slSequencePause | slSequenceCont | slSequencePan | slSequenceReset |
slSequenceStat |