Skip to Content
The Alchemy Project

include/sound/sound_driver_symbols.h

What the game sets over the sound driver: the music's player, the sound numbers sySoundPlay takes and their ranges, the music players by row, the mixer's reverb codes, and the music's volume and tempo ramps.

Included by battle_internal.h, lobby.c, sound.c, sound_test.c and system_internal.h.

Structures

NameDescription
structSoundVBlankStateHow the tick wait and the VBlank handler share the sound driver's update, so that it runs once a VBlank, from whichever reaches it first.

Macros

NameDescription
#defineSOUND_MODE_FREQ_GAME 0x00090000Rate 9, 31536 samples a second, as the rate bits of a sound mode word (SOUND_MODE_FREQ): the rate sySoundInit fixes for the game (pret's SOUND_MODE_FREQ_31536).

Enumerations

NameDescription
enumAudioCommandMask { AUDIO_COMMAND_TOGGLE, AUDIO_COMMAND_MASK }sySoundUpdateCommandMask's command: the new SoundCommandMask, or with AUDIO_COMMAND_TOGGLE the bits to flip in it.
enumSoundControl { SOUND_NUM_MASK, SOUND_FLAGS_MASK, SOUND_FLAG_FADE_IN, SOUND_ … }A sound for sySoundPlay: bits 11..0 the sound number, 15..12 flags.
enumMusicPlayerId { MUSIC_PLAYER_JINGLE, MUSIC_PLAYER_BGM, MUSIC_PLAYER_MENU_SE, … }The music players by their row in MPlayTable (sound/music_player_table.c), as a song table row names them (Song.slot).
enumSoundReverbCode { SOUND_REVERB_MONO, SOUND_REVERB_CROSSED, SOUND_REVERB_NORMAL … }The mixer's reverb codes.

Description

What the game sets over the sound driver: the music's player, the sound numbers sySoundPlay takes and their ranges, the music players by row, the mixer's reverb codes, and the music's volume and tempo ramps.

Macros in detail

SOUND_MODE_FREQ_GAME

#define SOUND_MODE_FREQ_GAME 0x00090000

Rate 9, 31536 samples a second, as the rate bits of a sound mode word (SOUND_MODE_FREQ): the rate sySoundInit fixes for the game (pret's SOUND_MODE_FREQ_31536).

Referenced by sySoundInit().

Definition at line 25 of file sound_driver_symbols.h.

Enumerations in detail

AudioCommandMask

enum AudioCommandMask

sySoundUpdateCommandMask's command: the new SoundCommandMask, or with AUDIO_COMMAND_TOGGLE the bits to flip in it. Nothing sends one.

EnumeratorValueDescription
AUDIO_COMMAND_TOGGLE0x80
AUDIO_COMMAND_MASK0x7f

Definition at line 16 of file sound_driver_symbols.h.

SoundControl

enum SoundControl

A sound for sySoundPlay: bits 11..0 the sound number, 15..12 flags. SOUND_FADE_OUT_BGM, SOUND_KEEP_BGM, SOUND_FADE_OUT_ACTION_SE and SOUND_FADE_OUT_EXIT_SE are rows of the song table, in sounds.h.

EnumeratorValueDescription
SOUND_NUM_MASK0xfff
SOUND_FLAGS_MASK0xf000
SOUND_FLAG_FADE_IN0x1000Music fades in over 64 frames.
SOUND_JINGLE_FIRSTMUS_PUZZLE_SOLVEDSounds from here to SOUND_SE_FIRST are jingles; those below are music, but for SOUND_FADE_OUT_BGM and SOUND_KEEP_BGM.
SOUND_SE_FIRSTSE_BELLSounds from here to SOUND_SE_END, but for the two fades, each play on the player SongTable names for them.
SOUND_SE_ENDMUS_VILLAGE_THEMESounds from here on are music again.

Definition at line 30 of file sound_driver_symbols.h.

MusicPlayerId

enum MusicPlayerId

The music players by their row in MPlayTable (sound/music_player_table.c), as a song table row names them (Song.slot). A sound on MUSIC_PLAYER_SE_LAST takes the first idle player from there down to MUSIC_PLAYER_SE_FIRST, else MUSIC_PLAYER_SE_LAST itself (sySoundPlay).

EnumeratorValueDescription
MUSIC_PLAYER_JINGLE0MPlayInfoJingle
MUSIC_PLAYER_BGM1MPlayInfoBGM
MUSIC_PLAYER_MENU_SE2MPlayInfoMenuSE
MUSIC_PLAYER_ACTION_SE3MPlayInfoActionSE
MUSIC_PLAYER_SE_FIRST4lowest player MUSIC_PLAYER_SE_LAST may borrow
MUSIC_PLAYER_SE55MPlayInfoSE5
MUSIC_PLAYER_SE_LAST7borrows first idle player down to MUSIC_PLAYER_SE_FIRST

Definition at line 52 of file sound_driver_symbols.h.

SoundReverbCode

enum SoundReverbCode

The mixer's reverb codes. sySoundLoadReverbCode loads none of them, and sySoundGetReverbCode gives every music SOUND_REVERB_LONG.

EnumeratorValueDescription
SOUND_REVERB_MONO
SOUND_REVERB_CROSSED
SOUND_REVERB_NORMAL
SOUND_REVERB_LONG
SOUND_REVERB_NONE

Definition at line 66 of file sound_driver_symbols.h.