Skip to Content
The Alchemy Project

include/sound/sound_driver_symbols.h

The sound driver's command masks, sound controls and the functions and globals it shares with the rest of the game.

Included by battle_internal.h, battle_effect_internal.h, babi_palace.c, battle_arena.c, colosseum_azart_match.c, colosseum_satrage_match.c, crossbone_isle_stepping_stones.c, file_screen.c, kalay.c, lemurian_ship.c, log_rooms_a.c, lunpa_fortress.c, ship_rooms.c, sol_sanctum_statue.c, title.c, tunnel_ruins.c, vale_cave.c, vale_plaza.c and sound.c.

Enumerations

NameDescription
enumSoundCommandMask { SOUND_COMMAND_MASK_TOGGLE, SOUND_COMMAND_MASK_BITS }sySoundUpdateCommandMask's command: the new SoundCommandMaskWork, or with SOUND_COMMAND_MASK_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.ms).
enumSoundReverbCode { SOUND_REVERB_MONO, SOUND_REVERB_CROSSED, SOUND_REVERB_NORMAL … }The five versions of the IWRAM mixer's last step sySoundLoadReverbCode copies into place, each carrying a different share of a frame's sound into the next: the song's reverb, as MusicPlayer2000 calls it.

Variables

NameDescription
extern struct MusicPlayerInfoMPlayInfoBGMPlays music; SOUND_FADE_OUT_BGM fades it and a jingle silences it until it ends.
extern struct MusicPlayerInfoMPlayInfoJinglePlays jingles; the music returns once it stops.
extern struct MusicPlayerInfoMPlayInfoActionSEthe music player SOUND_FADE_OUT_ACTION_SE fades
extern Uint16MusicPlayerLastSound [8]The sound effect each music player last started, by player: music and jingles are not recorded, and SOUND_FADE_OUT_ACTION_SE clears MUSIC_PLAYER_ACTION_SE's entry.
extern Uint8BgmRestoreDelayFrames after a jingle starts before the music waits for its end; held at 1 until the jingle's player stops, then 0.
extern Uint16BgmVolumeThe music's volume and its combined tempo and pitch, each ramped toward its target by its step each VBlank, in 8.8 fixed point (BGM_UNITY_SCALE 1.0).
extern Uint16BgmVolumeTarget
extern Uint16BgmVolumeStep
extern Uint16BgmTempoPitch
extern Uint16BgmTempoPitchTarget
extern Uint16BgmTempoPitchStep
extern Uint8CurrentBgmThe music sySoundPlay last chose: 0xff before any, MUS_SILENCE after a fade; asking for it again changes nothing.
extern Uint8SoundCommandMaskWorkSet by sySoundUpdateCommandMask; nothing reads it.

Description

The sound driver's command masks, sound controls and the functions and globals it shares with the rest of the game.

Enumerations in detail

SoundCommandMask

enum SoundCommandMask

sySoundUpdateCommandMask's command: the new SoundCommandMaskWork, or with SOUND_COMMAND_MASK_TOGGLE the bits to flip in it.

EnumeratorValueDescription
SOUND_COMMAND_MASK_TOGGLE0x80
SOUND_COMMAND_MASK_BITS0x7f

Definition at line 12 of file sound_driver_symbols.h.

SoundControl

enum SoundControl

A sound for sySoundPlay: bits 11..0 the sound number, 15..12 flags.

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 but SOUND_FADE_OUT_ACTION_SE each play on the player SongTable names for them.

Definition at line 19 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.ms). sySoundPlay maps a sound on MUSIC_PLAYER_SE_LAST to the first idle player from MUSIC_PLAYER_SE_LAST down to MUSIC_PLAYER_SE_FIRST, or to MUSIC_PLAYER_SE_LAST itself.

EnumeratorValueDescription
MUSIC_PLAYER_JINGLE0MPlayInfoJingle
MUSIC_PLAYER_BGM1MPlayInfoBGM
MUSIC_PLAYER_MENU_SE2MPlayInfoMenuSE: the interface's sounds
MUSIC_PLAYER_ACTION_SE3MPlayInfoActionSE: field and battle actions
MUSIC_PLAYER_SE_FIRST4first player MUSIC_PLAYER_SE_LAST may borrow
MUSIC_PLAYER_SE_LAST7borrows first idle down to MUSIC_PLAYER_SE_FIRST

Definition at line 38 of file sound_driver_symbols.h.

SoundReverbCode

enum SoundReverbCode

The five versions of the IWRAM mixer's last step sySoundLoadReverbCode copies into place, each carrying a different share of a frame's sound into the next: the song's reverb, as MusicPlayer2000 calls it.

EnumeratorValueDescription
SOUND_REVERB_MONOOne value for both channels, from the two buffers together; only the sound test loads it.
SOUND_REVERB_CROSSEDEach channel's old samples crossed with the other's; only the sound test loads it.
SOUND_REVERB_NORMALA quarter of the mix and an eighth of each buffer's old samples carry over: most music and the Battle Arena.
SOUND_REVERB_LONGAn eighth of the mix and a quarter of the old samples carry over: MUS_MAIN_THEME_TITLE, MUS_TO_BE_CONTINUED and MUS_THE_BROKEN_SEAL_ENDING.
SOUND_REVERB_NONENothing carries over, the mix buffer is cleared: a link battle.

Definition at line 52 of file sound_driver_symbols.h.

Variables in detail

MPlayInfoBGM

extern struct MusicPlayerInfo MPlayInfoBGM

Plays music; SOUND_FADE_OUT_BGM fades it and a jingle silences it until it ends.

Referenced by sySoundPlay(), sySoundSetBGMPitch(), sySoundSetBGMTempo(), sySoundSetBGMVolume() and sySoundUpdateBGMRamps().

Definition at line 71 of file sound_driver_symbols.h.

MPlayInfoJingle

extern struct MusicPlayerInfo MPlayInfoJingle

Plays jingles; the music returns once it stops.

Referenced by sySoundUpdateBGMRamps().

Definition at line 73 of file sound_driver_symbols.h.

MPlayInfoActionSE

extern struct MusicPlayerInfo MPlayInfoActionSE

the music player SOUND_FADE_OUT_ACTION_SE fades

Referenced by sySoundPlay().

Definition at line 75 of file sound_driver_symbols.h.

MusicPlayerLastSound

extern Uint16 MusicPlayerLastSound[8]

The sound effect each music player last started, by player: music and jingles are not recorded, and SOUND_FADE_OUT_ACTION_SE clears MUSIC_PLAYER_ACTION_SE's entry. Nothing reads it.

Referenced by sySoundInit() and sySoundPlay().

Definition at line 79 of file sound_driver_symbols.h.

BgmRestoreDelay

extern Uint8 BgmRestoreDelay

Frames after a jingle starts before the music waits for its end; held at 1 until the jingle's player stops, then 0.

Referenced by sySoundGetBGMRestoreDelay(), sySoundInit(), sySoundPlay(), sySoundUpdateBGMRamps() and sySoundWaitForBGMRestore().

Definition at line 82 of file sound_driver_symbols.h.

BgmVolume

extern Uint16 BgmVolume

The music's volume and its combined tempo and pitch, each ramped toward its target by its step each VBlank, in 8.8 fixed point (BGM_UNITY_SCALE 1.0).

Referenced by sySoundInit(), sySoundPlay(), sySoundSetBGMVolume() and sySoundUpdateBGMRamps().

Definition at line 86 of file sound_driver_symbols.h.

BgmVolumeTarget

extern Uint16 BgmVolumeTarget

Referenced by sySoundInit(), sySoundPlay(), sySoundSetBGMVolume(), sySoundSetBGMVolumeTarget() and sySoundUpdateBGMRamps().

Definition at line 87 of file sound_driver_symbols.h.

BgmVolumeStep

extern Uint16 BgmVolumeStep

Referenced by sySoundInit(), sySoundPlay(), sySoundSetBGMVolumeTarget() and sySoundUpdateBGMRamps().

Definition at line 88 of file sound_driver_symbols.h.

BgmTempoPitch

extern Uint16 BgmTempoPitch

Referenced by sySoundInit() and sySoundUpdateBGMRamps().

Definition at line 89 of file sound_driver_symbols.h.

BgmTempoPitchTarget

extern Uint16 BgmTempoPitchTarget

Referenced by sySoundInit(), sySoundSetBGMTempoPitchTarget() and sySoundUpdateBGMRamps().

Definition at line 90 of file sound_driver_symbols.h.

BgmTempoPitchStep

extern Uint16 BgmTempoPitchStep

Referenced by sySoundInit(), sySoundSetBGMTempoPitchTarget() and sySoundUpdateBGMRamps().

Definition at line 91 of file sound_driver_symbols.h.

CurrentBgm

extern Uint8 CurrentBgm

The music sySoundPlay last chose: 0xff before any, MUS_SILENCE after a fade; asking for it again changes nothing.

Referenced by sySoundGetCurrentBGM(), sySoundInit() and sySoundPlay().

Definition at line 94 of file sound_driver_symbols.h.

SoundCommandMaskWork

extern Uint8 SoundCommandMaskWork

Set by sySoundUpdateCommandMask; nothing reads it.

Referenced by sySoundInit() and sySoundUpdateCommandMask().

Definition at line 96 of file sound_driver_symbols.h.