6#if VERSION_US || VERSION_JP
259 if (bank->
vabId != -1) {
260 for (j = 0; j < bank->
numSeqs; j++) {
262 SsSepStop(bank->
seqs[j], k);
279 if (slot != -1 && !keyOn) {
295 if (slot != -1 && !keyOn) {
300 SsSepSetDecrescendo(
SOUND.
banks[slot].
seqs[seq], sep, 0x80, 0x3C);
321 if (bank->
vabId != -1) {
322 for (i = 0; i < bank->
numSeqs; i++) {
324 SsSepStop(bank->
seqs[i], j);
326 SsSepClose(bank->
seqs[i]);
328 SsVabClose(bank->
vabId);
361 switch (loader->
state) {
371 for (j = 0; j < n; j++) {
388 if (SsVabTransCompleted(0) == 0) {
394 for (; loader->
files->
seps[i] != 0; i++) {
415 if (voice != -1 && slot != -1) {
427 SsSetTickMode(SS_NOTICK);
429 SsSetTickMode(SS_NOTICK | 50);
432 SsSetTickMode(SS_NOTICK);
436 SsSetSerialAttr(0, 0, 1);
438 SsUtSetReverbType(SS_REV_TYPE_STUDIO_B);
439 SsUtSetReverbDepth(0, 0);
s32 NTSC_MODE
The European version runs at 50 Hz (PAL) unless NTSC_MODE is set; its clocks then advance 0x133,...
#define CD_SECTOR_SIZE
The bytes of data in a sector (Mode 2 Form 1), as the reader reads them.
FileCache FILE_CACHE
The file cache.
FileTableFuncs FILE_TABLE
The disc's file table.
Heap HEAP
The functions that return what a call left in v0 (allocMemHigh, findTask) and the ones that take othe...
void stopSound(s32 packed)
Stops a sequence sound (key-on sounds are left alone)
SoundFiles SOUND_FILES_3D
SoundFiles SOUND_FILES_24
SoundFiles SOUND_FILES_41
SoundFiles SOUND_FILES_0D
SoundFiles SOUND_FILES_14
SoundFiles SOUND_FILES_39
SoundFiles SOUND_FILES_47
SoundFiles SOUND_FILES_38
SoundFiles SOUND_FILES_2F
SoundFiles SOUND_FILES_3B
SoundFiles SOUND_FILES_1D
SoundFiles SOUND_FILES_42
SoundFiles SOUND_FILES_0B
SoundFiles SOUND_FILES_2C
SoundFiles SOUND_FILES_0A
SoundFiles SOUND_FILES_2A
SoundState SOUND
rsin and rcos (libgte) read rsin_tbl[a - 0x800] and the like: their addresses before the table fall i...
s32 SOUND_HEAD_BUFFER_2[10240]
SoundFiles SOUND_FILES_04
SoundFiles SOUND_FILES_13
SoundFiles SOUND_FILES_3F
SoundFiles * SOUND_BANK_FILES[72]
The banks by id: bits 18-24 of a sound id.
SoundFiles SOUND_FILES_23
void loadSoundBankInto(s32 slot, s32 id)
Closes what slot slot holds and starts loading bank id into it.
SoundFiles SOUND_FILES_21
SoundFiles SOUND_FILES_46
short soundKeyOn(s32 slot, short prog, short note)
Plays one note of a program from the bank in slot slot; returns the voice.
SoundFiles SOUND_FILES_22
SoundFiles SOUND_FILES_2D
SoundFiles SOUND_FILES_12
short playSound(s32 packed)
Plays a packed sound id (see engine/sound.h); returns the voice of a key-on.
SoundFiles SOUND_FILES_35
SoundFiles SOUND_FILES_1C
void fadeOutSound(s32 packed)
Fades a sequence sound out over a second (key-on sounds are left alone)
SoundFiles SOUND_FILES_0E
SoundFiles SOUND_FILES_3C
SoundFiles SOUND_FILES_28
SoundFiles SOUND_FILES_06
SoundFiles SOUND_FILES_40
SoundFiles SOUND_FILES_10
SoundFiles SOUND_FILES_3E
SoundFiles SOUND_FILES_3A
SoundFiles SOUND_FILES_05
SoundFiles SOUND_FILES_17
SoundFiles SOUND_FILES_19
s32 isSoundLoading(void)
Whether a bank is still being loaded.
SoundFiles SOUND_FILES_29
SoundFiles SOUND_FILES_33
SoundFiles SOUND_FILES_1E
SoundFiles SOUND_FILES_16
SoundFiles SOUND_FILES_0F
void loadSoundBank(s32 id)
Loads a bank into slot 1 or 2, whichever was not used last.
SoundFiles SOUND_FILES_36
SoundFiles SOUND_FILES_2B
SoundFiles SOUND_FILES_0C
SoundFiles SOUND_FILES_25
SoundFiles SOUND_FILES_44
SoundFiles SOUND_FILES_26
void soundKeyOff(s32 packed, s16 voice)
Releases the voice that a key-on sound id started.
SoundFiles SOUND_FILES_02
void stopAllSounds(void)
Stops every track of the loaded banks and every voice.
SoundFiles SOUND_FILES_15
SoundFiles SOUND_FILES_09
s32 SOUND_HEAD_BUFFER_1[10240]
SoundFiles SOUND_FILES_1F
SoundFiles SOUND_FILES_07
SoundFiles SOUND_FILES_18
void * SOUND_HEAD_BUFFERS[3]
Each slot's buffer, and its SPU address.
void updateSoundLoading(void)
Header: copied to the slot's buffer, then the body goes to the SPU.
SoundFiles SOUND_FILES_1A
s32 findSoundBank(s32 id)
The slot (0-2) that holds bank id, or -1.
SoundFiles SOUND_FILES_32
SoundFiles SOUND_FILES_45
SoundFiles SOUND_FILES_37
s32 SOUND_HEAD_BUFFER_0[14336]
Each slot's buffer for the VAB header and the SEPs, in this unit's .bss (see the Makefile)
SoundFiles SOUND_FILES_20
SoundFiles SOUND_FILES_03
void initSound(void)
Starts libsnd, gives each slot its buffers and loads the system sounds (bank 1) into slot 0.
SoundFiles SOUND_FILES_2E
SoundFiles SOUND_FILES_27
SoundFiles SOUND_FILES_43
SoundFiles SOUND_FILES_30
SoundFiles SOUND_FILES_1B
SoundFiles SOUND_FILES_34
SoundFiles SOUND_FILES_31
SoundFiles SOUND_FILES_11
SoundFiles SOUND_FILES_08
SoundFiles SOUND_FILES_01
Each bank's files (SOUND_BANK_FILES[id]), numbered in the Japanese disc as in the USA one.
#define SOUND_SLOT_COUNT
The banks loaded at once: slot 0 keeps bank 1 (system sounds), 1 and 2 alternate.
#define SOUND_VOLUME_MAX
The loudest volume of a voice or track.
#define SOUND_IS_EXCLUSIVE(id)
#define SOUND_IS_KEY_ON(id)
Sound ids pack everything needed to play them: bit 31 a key-on of one VAB tone (sound effect),...
#define SOUND_SEP_COUNT
The tracks (SEPs) of each SEQ.
void *(* getArchiveEntry)(s32 index, void *archive)
s32(* isLoading)(s32 file)
void(* request)(s32 file)
void *(* getEntry)(u32 fileAndIndex)
s32(* getSectorCount)(s32 file)
One of the SOUND_SLOT_COUNT loaded sound banks: a VAB and its SEP sequences.
void * headBuffer
VAB header and SEPs are copied here.
A bank's files (SOUND_BANK_FILES[id])
s32 headFile
archive: VAB header and SEPs
s32 vhIndex
of the VAB header in headFile
s32 seps[0]
indices in headFile, 0-terminated
s32 bodyFile
VAB body, sent to the SPU.
s32 bodyEntry
(file << 16) | slot
Loads a bank in the background (updateSoundLoading)
s32 music
the exclusive sound playing
u8 seqTable[0x4200]
SsSetTableSize(6 SEQs, 16 SEPs)
void(* stopSound)(s32 id)