audio_synthesis.c OK and Documented (#1090)

* import synth docs

* cleanup

* small followup cleanup

* PR Suggestions, small cleanup

* fix bss

* PR suggestion

* fix enum

* PR Suggestions
This commit is contained in:
engineer124 2022-10-02 15:24:10 -04:00 committed by GitHub
parent 0e2de439dd
commit 3e32379c2b
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
18 changed files with 2612 additions and 770 deletions

View File

@ -53,6 +53,7 @@
#define A_INIT 0x01
#define A_CONTINUE 0x00
#define A_LOOP 0x02
#define A_ADPCM_SHORT 0x04
#define A_OUT 0x02
#define A_LEFT 0x02
#define A_RIGHT 0x00
@ -331,13 +332,20 @@ typedef short ENVMIX_STATE[40];
_a->words.w1 = (unsigned int)(a2); \
}
#define aClearBuffer(pkt, d, c) \
{ \
Acmd *_a = (Acmd *)pkt; \
\
_a->words.w0 = _SHIFTL(A_CLEARBUFF, 24, 8) | _SHIFTL(d, 0, 24); \
_a->words.w1 = (unsigned int)(c); \
}
/*
* Clears DMEM by writing zeros.
*
* @param pkt pointer to an Acmd buffer
* @param dmem DMEM address to clear
* @param size number of bytes to clear (rounded up to the next multiple of 16)
*/
#define aClearBuffer(pkt, dmem, size) \
{ \
Acmd* _a = (Acmd*)pkt; \
\
_a->words.w0 = _SHIFTL(A_CLEARBUFF, 24, 8) | _SHIFTL(dmem, 0, 24); \
_a->words.w1 = (uintptr_t)(size); \
}
#define aEnvMixer(pkt, dmemi, count, swapLR, x0, x1, x2, x3, m, bits) \
{ \
@ -368,14 +376,21 @@ typedef short ENVMIX_STATE[40];
_a->words.w1 = _SHIFTL(dmemi, 16, 16) | _SHIFTL(dmemo, 0, 16); \
}
#define aLoadBuffer(pkt, s, d, c) \
{ \
Acmd *_a = (Acmd *)pkt; \
\
_a->words.w0 = _SHIFTL(A_LOADBUFF, 24, 8) | \
_SHIFTL((c) >> 4, 16, 8) | _SHIFTL(d, 0, 16); \
_a->words.w1 = (unsigned int)(s); \
}
/*
* Loads a buffer to DMEM from any physical source address, KSEG0, or KSEG1
*
* @param pkt pointer to an Acmd buffer
* @param addrSrc Any physical source address, KSEG0, or KSEG1
* @param dmemDest DMEM destination address
* @param size number of bytes to copy (rounded down to the next multiple of 16)
*/
#define aLoadBuffer(pkt, addrSrc, dmemDest, size) \
{ \
Acmd* _a = (Acmd*)pkt; \
\
_a->words.w0 = (_SHIFTL(A_LOADBUFF, 24, 8) | _SHIFTL((size) >> 4, 16, 8) | _SHIFTL(dmemDest, 0, 16)); \
_a->words.w1 = (uintptr_t)(addrSrc); \
}
#define aMix(pkt, f, g, i, o) \
{ \
@ -404,14 +419,21 @@ typedef short ENVMIX_STATE[40];
_a->words.w1 = (unsigned int)(s); \
}
#define aSaveBuffer(pkt, s, d, c) \
{ \
Acmd *_a = (Acmd *)pkt; \
\
_a->words.w0 = _SHIFTL(A_SAVEBUFF, 24, 8) | \
_SHIFTL((c) >> 4, 16, 8) | _SHIFTL(s, 0, 16); \
_a->words.w1 = (unsigned int)(d); \
}
/*
* Stores a buffer from DMEM to any physical source address, KSEG0, or KSEG1
*
* @param pkt pointer to an Acmd buffer
* @param dmemSrc DMEM source address
* @param addrDest Any physical source address, KSEG0, or KSEG1
* @param size number of bytes to copy (rounded down to the next multiple of 16)
*/
#define aSaveBuffer(pkt, dmemSrc, addrDest, size) \
{ \
Acmd* _a = (Acmd*)pkt; \
\
_a->words.w0 = (_SHIFTL(A_SAVEBUFF, 24, 8) | _SHIFTL((size) >> 4, 16, 8) | _SHIFTL(dmemSrc, 0, 16)); \
_a->words.w1 = (uintptr_t)(addrDest); \
}
#define aSegment(pkt, s, b) \
{ \
@ -501,14 +523,21 @@ typedef short ENVMIX_STATE[40];
_a->words.w1 = (unsigned int)(addr); \
}
#define aDuplicate(pkt, count, dmemi, dmemo, a4) \
{ \
Acmd *_a = (Acmd *)pkt; \
\
_a->words.w0 = (_SHIFTL(A_DUPLICATE, 24, 8) | \
_SHIFTL(count, 16, 8) | _SHIFTL(dmemi, 0, 16)); \
_a->words.w1 = _SHIFTL(dmemo, 16, 16) | _SHIFTL(a4, 0, 16); \
}
/*
* Duplicates 128 bytes of data a specified number of times.
*
* @param pkt pointer to an Acmd buffer
* @param numCopies number of times to duplicate 128 bytes from src
* @param dmemSrc DMEM source address
* @param dmemDest DMEM destination address for the duplicates, size 128 * numCopies
*/
#define aDuplicate(pkt, numCopies, dmemSrc, dmemDest) \
{ \
Acmd* _a = (Acmd*)pkt; \
\
_a->words.w0 = (_SHIFTL(A_DUPLICATE, 24, 8) | _SHIFTL(numCopies, 16, 8) | _SHIFTL(dmemSrc, 0, 16)); \
_a->words.w1 = _SHIFTL(dmemDest, 16, 16) | _SHIFTL(0x80, 0, 16); \
}
#define aAddMixer(pkt, count, dmemi, dmemo, a4) \
{ \

View File

@ -2897,48 +2897,7 @@ s32 osFlashWriteBuffer(OSIoMesg* mb, s32 priority, void* dramAddr, OSMesgQueue*
s32 osFlashWriteArray(u32 pageNum);
s32 osFlashReadArray(OSIoMesg* mb, s32 priority, u32 pageNum, void* dramAddr, u32 pageCount, OSMesgQueue* mq);
// void func_801877D0(void);
// void func_80187B64(void);
// void func_80187BEC(void);
// void func_80187DE8(void);
// void func_80187E58(void);
// void func_80187F00(void);
// void func_80187FB0(void);
// void func_80187FE8(UNK_TYPE1 param_1, UNK_TYPE1 param_2, UNK_TYPE1 param_3, UNK_TYPE1 param_4, UNK_TYPE4 param_5);
// void func_80188034(UNK_TYPE1 param_1, UNK_TYPE1 param_2, UNK_TYPE1 param_3, UNK_TYPE1 param_4, UNK_TYPE4 param_5);
// void func_80188078(void);
// void func_801880C4(void);
// void func_801880E8(UNK_TYPE1 param_1, UNK_TYPE1 param_2, UNK_TYPE1 param_3, UNK_TYPE1 param_4, UNK_TYPE4 param_5);
// void func_80188124(void);
// void func_8018814C(void);
// void func_80188174(void);
// void func_801881A8(void);
// void func_801881C4(UNK_TYPE1 param_1, UNK_TYPE1 param_2, UNK_TYPE1 param_3, UNK_TYPE1 param_4, UNK_TYPE4 param_5);
// void func_801881F8(UNK_TYPE1 param_1, UNK_TYPE1 param_2, UNK_TYPE1 param_3, UNK_TYPE1 param_4, UNK_TYPE4 param_5);
// void func_80188264(void);
// void func_80188288(void);
// void func_801882A0(void);
// void func_80188304(void);
// void func_801884A0(void);
// void func_80188698(void);
// void func_8018883C(void);
// void func_801888E4(void);
// void func_801889A4(void);
// void func_80188A50(void);
// void func_80188AFC(void);
// void func_80188C48(UNK_TYPE1 param_1, UNK_TYPE1 param_2, UNK_TYPE1 param_3, UNK_TYPE1 param_4, UNK_TYPE4 param_5);
// void func_80188CB4(UNK_TYPE1 param_1, UNK_TYPE1 param_2, UNK_TYPE1 param_3, UNK_TYPE1 param_4, UNK_TYPE4 param_5);
// void func_80188D28(void);
// void func_80188D68(void);
// void func_80188DDC(void);
// void func_80188FBC(void);
// void func_80189064(void);
// void func_80189620(UNK_TYPE1 param_1, UNK_TYPE1 param_2, UNK_TYPE1 param_3, UNK_TYPE1 param_4, UNK_TYPE4 param_5, UNK_TYPE4 param_6, UNK_TYPE4 param_7);
// void func_8018A4B4(UNK_TYPE1 param_1, UNK_TYPE1 param_2, UNK_TYPE1 param_3, UNK_TYPE1 param_4, UNK_TYPE4 param_5, UNK_TYPE4 param_6);
// void func_8018A768(UNK_TYPE1 param_1, UNK_TYPE1 param_2, UNK_TYPE1 param_3, UNK_TYPE1 param_4, UNK_TYPE2 param_5, UNK_TYPE4 param_6);
// void func_8018A808(UNK_TYPE1 param_1, UNK_TYPE1 param_2, UNK_TYPE1 param_3, UNK_TYPE1 param_4, UNK_TYPE2 param_5, UNK_TYPE4 param_6);
// void func_8018ACC4(void);
// void func_8018AE34(UNK_TYPE1 param_1, UNK_TYPE1 param_2, UNK_TYPE1 param_3, UNK_TYPE1 param_4, UNK_TYPE4 param_5, UNK_TYPE4 param_6);
Acmd* AudioSynth_Update(Acmd* cmdStart, s32* numAbiCmds, s16* aiStart, s32 aiBufLen);
void AudioHeap_DiscardFont(s32 fontId);
void* AudioHeap_WritebackDCache(void* addr, size_t size);

View File

@ -1557,11 +1557,11 @@ extern f32 gPitchFrequencies[];
extern u8 gDefaultShortNoteVelocityTable[];
extern u8 gDefaultShortNoteGateTimeTable[];
extern EnvelopePoint gDefaultEnvelope[];
extern NoteSubEu gZeroNoteSub;
extern NoteSubEu gDefaultNoteSub;
extern u16 gHeadsetPanQuantization[];
extern u16 gHeadsetPanQuantization[];
extern s16 D_801D58A8[];
extern NoteSampleState gZeroedSampleState;
extern NoteSampleState gDefaultSampleState;
extern u16 gHaasEffectDelaySize[];
extern u16 gHaasEffectDelaySize[];
extern s16 gInvalidAdpcmCodeBook[];
extern f32 gHeadsetPanVolume[];
extern f32 gStereoPanVolume[];
extern f32 gDefaultPanVolume[];
@ -1721,21 +1721,7 @@ extern s8 gSfxDefaultReverb;
extern u8 gAudioSpecId;
// extern UNK_TYPE1 D_801DB4D8;
// extern UNK_TYPE4 D_801DB4DC;
// extern UNK_TYPE1 D_801DB4E0;
// extern UNK_TYPE1 D_801DB528;
// extern UNK_TYPE1 D_801DB570;
// extern UNK_TYPE1 D_801DB5B8;
// extern UNK_TYPE1 D_801DB600;
// extern UNK_TYPE1 D_801DB648;
// extern UNK_TYPE1 D_801DB690;
// extern UNK_TYPE1 D_801DB6D8;
// extern UNK_TYPE1 D_801DB720;
// extern UNK_TYPE1 D_801DB750;
// extern UNK_TYPE1 D_801DB798;
// extern UNK_TYPE1 D_801DB870;
// extern UNK_TYPE1 D_801DB8B8;
// extern UNK_TYPE1 D_801DB900;
extern UNK_PTR D_801DB930;
extern ReverbSettings* gReverbSettingsTable[];
extern AudioSpec gAudioSpecs[21];
// rodata
@ -3483,10 +3469,10 @@ extern ActiveSequence gActiveSeqs[];
// extern UNK_TYPE1 D_80200BCE;
// extern UNK_TYPE1 D_80200BD0;
extern AudioContext gAudioContext; // at 0x80200C70
extern void (*D_80208E68)(void);
extern u32 (*D_80208E6C)(s8 value, SequenceChannel* channel);
extern s32 (*D_80208E70)(Sample*, s32, s8, s32);
extern Acmd* (*D_80208E74)(Acmd*, s32, s32);
extern void (*gCustomAudioUpdateFunction)(void);
extern u32 (*gCustomAudioSeqFunction)(s8 value, SequenceChannel* channel);
extern s32 (*gCustomAudioReverbFunction)(Sample*, s32, s8, s32);
extern Acmd* (*gCustomAudioSynthFunction)(Acmd*, s32, s32);
// post-code buffers
extern u8 gGfxSPTaskYieldBuffer[OS_YIELD_DATA_SIZE];

View File

@ -1,7 +1,7 @@
#ifndef Z64_AUDIO_H
#define Z64_AUDIO_H
#define MK_AUDIO_CMD(b0,b1,b2,b3) ((((b0) & 0xFF) << 0x18) | (((b1) & 0xFF) << 0x10) | (((b2) & 0xFF) << 0x8) | (((b3) & 0xFF) << 0))
#define AUDIO_MK_CMD(b0,b1,b2,b3) ((((b0) & 0xFF) << 0x18) | (((b1) & 0xFF) << 0x10) | (((b2) & 0xFF) << 0x8) | (((b3) & 0xFF) << 0))
#define NO_LAYER ((SequenceLayer*)(-1))
@ -32,13 +32,45 @@ typedef enum {
#define ADSR_GOTO -2
#define ADSR_RESTART -3
#define AIBUF_LEN 0x580
// size of a single sample point
#define SAMPLE_SIZE sizeof(s16)
// Samples are processed in groups of 16 called a "frame"
#define SAMPLES_PER_FRAME ADPCMFSIZE
// The length of one left/right channel is 13 frames
#define DMEM_1CH_SIZE (13 * SAMPLES_PER_FRAME * SAMPLE_SIZE)
// Both left and right channels
#define DMEM_2CH_SIZE (2 * DMEM_1CH_SIZE)
#define AIBUF_LEN (88 * SAMPLES_PER_FRAME) // number of samples
#define AIBUF_SIZE (AIBUF_LEN * SAMPLE_SIZE) // number of bytes
// Filter sizes
#define FILTER_SIZE (8 * SAMPLE_SIZE)
#define FILTER_BUF_PART1 (8 * SAMPLE_SIZE)
#define FILTER_BUF_PART2 (8 * SAMPLE_SIZE)
// Must be the same amount of samples as copied by aDuplicate() (audio microcode)
#define WAVE_SAMPLE_COUNT 64
#define AUDIO_RELOCATED_ADDRESS_START K0BASE
#define REVERB_INDEX_NONE -1
typedef enum {
/* 0 */ REVERB_DATA_TYPE_SETTINGS, // Reverb Settings (Init)
/* 1 */ REVERB_DATA_TYPE_DELAY, // Reverb Delay (numSamples)
/* 2 */ REVERB_DATA_TYPE_DECAY, // Reverb Decay Ratio
/* 3 */ REVERB_DATA_TYPE_SUB_VOLUME, // Reverb Sub-Volume
/* 4 */ REVERB_DATA_TYPE_VOLUME, // Reverb Volume
/* 5 */ REVERB_DATA_TYPE_LEAK_RIGHT, // Reverb Leak Right Channel
/* 6 */ REVERB_DATA_TYPE_LEAK_LEFT, // Reverb Leak Left Channel
/* 7 */ REVERB_DATA_TYPE_FILTER_LEFT, // Reverb Left Filter
/* 8 */ REVERB_DATA_TYPE_FILTER_RIGHT, // Reverb Right Filter
/* 9 */ REVERB_DATA_TYPE_9 // Reverb Unk
} ReverbDataType;
typedef enum {
/* 0x1 */ AUDIO_ERROR_NO_INST = 1,
/* 0x3 */ AUDIO_ERROR_INVALID_INST_ID = 3,
@ -78,12 +110,14 @@ typedef enum {
} SampleMedium;
typedef enum {
/* 0 */ CODEC_ADPCM,
/* 1 */ CODEC_S8,
/* 0 */ CODEC_ADPCM, // 16 2-byte samples (32 bytes) compressed into 4-bit samples (8 bytes) + 1 header byte
/* 1 */ CODEC_S8, // 16 2-byte samples (32 bytes) compressed into 8-bit samples (16 bytes)
/* 2 */ CODEC_S16_INMEMORY,
/* 3 */ CODEC_SMALL_ADPCM,
/* 3 */ CODEC_SMALL_ADPCM, // 16 2-byte samples (32 bytes) compressed into 2-bit samples (4 bytes) + 1 header byte
/* 4 */ CODEC_REVERB,
/* 5 */ CODEC_S16
/* 5 */ CODEC_S16,
/* 6 */ CODEC_UNK6,
/* 7 */ CODEC_UNK7 // processed as uncompressed samples
} SampleCodec;
typedef enum {
@ -165,24 +199,28 @@ typedef struct {
typedef struct {
/* 0x00 */ u32 start;
/* 0x04 */ u32 end;
/* 0x04 */ u32 loopEnd; // numSamples into the sample where the loop ends
/* 0x08 */ u32 count;
/* 0x0C */ u32 unk_0C;
/* 0x10 */ s16 state[16]; // only exists if count != 0. 8-byte aligned
/* 0x0C */ u32 sampleEnd; // total number of s16-samples in the
/* 0x10 */ s16 predictorState[16]; // only exists if count != 0. 8-byte aligned
} AdpcmLoop; // size = 0x30 (or 0x10)
/**
* The procedure used to design the codeBook is based on an adaptive clustering algorithm.
* The size of the codeBook is (8 * order * numPredictors) and is 8-byte aligned
*/
typedef struct {
/* 0x00 */ s32 order;
/* 0x04 */ s32 npredictors;
/* 0x08 */ s16 book[1]; // size 8 * order * npredictors. 8-byte aligned
/* 0x04 */ s32 numPredictors;
/* 0x08 */ s16 codeBook[1]; // a table of prediction coefficients that the coder selects from to optimize sound quality.
} AdpcmBook; // size >= 0x8
typedef struct {
/* 0x00 */ u32 unk_0 : 1;
/* 0x00 */ u32 codec : 3; // The state of compression or decompression
/* 0x00 */ u32 medium : 2; // Medium where sample is currently stored
/* 0x00 */ u32 unk_bit26 : 1; // Has the sample header been relocated (offsets to pointers)
/* 0x00 */ u32 isRelocated : 1; // Size of the sample
/* 0x00 */ u32 unk_bit26 : 1;
/* 0x00 */ u32 isRelocated : 1; // Has the sample header been relocated (offsets to pointers)
/* 0x01 */ u32 size : 24; // Size of the sample
/* 0x04 */ u8* sampleAddr; // Raw sample data. Offset from the start of the sample bank or absolute address to either rom or ram
/* 0x08 */ AdpcmLoop* loop; // Adpcm loop parameters used by the sample. Offset from the start of the sound font / pointer to ram
@ -194,18 +232,23 @@ typedef struct {
/* 0x04 */ f32 tuning; // frequency scale factor
} TunedSample; // size = 0x8
/**
* Stores an entry of decompressed samples in a reverb ring buffer.
* By storing the sample in a ring buffer, the time it takes to loop
* around back to the same sample acts as a delay, leading to an echo effect.
*/
typedef struct {
/* 0x00 */ s16 numSamplesAfterDownsampling; // never read
/* 0x02 */ s16 chunkLen; // never read
/* 0x02 */ s16 numSamples; // never read
/* 0x04 */ s16* toDownsampleLeft;
/* 0x08 */ s16* toDownsampleRight; // data pointed to by left and right are adjacent in memory
/* 0x0C */ s32 startPos; // start pos in ring buffer
/* 0x10 */ s16 lengthA; // first length in ring buffer (from startPos, at most until end)
/* 0x12 */ s16 lengthB; // second length in ring buffer (from pos 0)
/* 0x14 */ u16 unk_14;
/* 0x16 */ u16 unk_16;
/* 0x18 */ u16 unk_18;
} ReverbRingBufferItem; // size = 0x1C
/* 0x10 */ s16 size; // first length in ring buffer (from startPos, at most until end)
/* 0x12 */ s16 wrappedSize; // second length in ring buffer (from pos 0)
/* 0x14 */ u16 loadResamplePitch;
/* 0x16 */ u16 saveResamplePitch;
/* 0x18 */ u16 saveResampleNumSamples;
} ReverbBufferEntry; // size = 0x1C
typedef struct {
/* 0x000 */ u8 resampleFlags;
@ -213,35 +256,35 @@ typedef struct {
/* 0x002 */ u8 framesToIgnore;
/* 0x003 */ u8 curFrame;
/* 0x004 */ u8 downsampleRate;
/* 0x005 */ s8 unk_05;
/* 0x006 */ u16 windowSize;
/* 0x008 */ s16 unk_08;
/* 0x00A */ s16 unk_0A;
/* 0x00C */ u16 unk_0C;
/* 0x00E */ u16 unk_0E;
/* 0x005 */ s8 mixReverbIndex; // mix in reverb from this index. set to 0xFF to not mix any
/* 0x006 */ u16 delayNumSamples; // number of samples between echos
/* 0x008 */ s16 mixReverbStrength; // the gain/amount to mix in reverb from mixReverbIndex
/* 0x00A */ s16 volume;
/* 0x00C */ u16 decayRatio; // determines how fast reverb dissipate
/* 0x00E */ u16 downsamplePitch;
/* 0x010 */ s16 leakRtl;
/* 0x012 */ s16 leakLtr;
/* 0x014 */ u16 unk_14;
/* 0x016 */ s16 unk_16;
/* 0x018 */ u8 unk_18;
/* 0x019 */ s8 unk_19;
/* 0x01A */ u16 unk_1A;
/* 0x01C */ u16 unk_1C;
/* 0x01E */ u8 unk_1E;
/* 0x020 */ s32 nextRingBufPos;
/* 0x024 */ s32 unk_24; // May be bufSizePerChan
/* 0x028 */ s16* leftRingBuf;
/* 0x02C */ s16* rightRingBuf;
/* 0x030 */ void* unk_30;
/* 0x034 */ void* unk_34;
/* 0x038 */ void* unk_38;
/* 0x03C */ void* unk_3C;
/* 0x040 */ ReverbRingBufferItem items[2][5];
/* 0x158 */ ReverbRingBufferItem items2[2][5];
/* 0x014 */ u16 subDelay; // number of samples between sub echos
/* 0x016 */ s16 subVolume; // strength of the sub echos
/* 0x018 */ u8 resampleEffectOn;
/* 0x019 */ s8 resampleEffectExtraSamples;
/* 0x01A */ u16 resampleEffectLoadUnk;
/* 0x01C */ u16 resampleEffectSaveUnk;
/* 0x01E */ u8 delayNumSamplesAfterDownsampling;
/* 0x020 */ s32 nextReverbBufPos;
/* 0x024 */ s32 delayNumSamplesUnk; // May be bufSizePerChan
/* 0x028 */ s16* leftReverbBuf;
/* 0x02C */ s16* rightReverbBuf;
/* 0x030 */ s16* leftLoadResampleBuf;
/* 0x034 */ s16* rightLoadResampleBuf;
/* 0x038 */ s16* leftSaveResampleBuf;
/* 0x03C */ s16* rightSaveResampleBuf;
/* 0x040 */ ReverbBufferEntry bufEntry[2][5];
/* 0x158 */ ReverbBufferEntry subBufEntry[2][5];
/* 0x270 */ s16* filterLeft;
/* 0x274 */ s16* filterRight;
/* 0x278 */ s16* unk_278;
/* 0x27C */ s16* unk_27C;
/* 0x278 */ s16* filterLeftInit;
/* 0x27C */ s16* filterRightInit;
/* 0x280 */ s16* filterLeftState;
/* 0x284 */ s16* filterRightState;
/* 0x288 */ TunedSample tunedSample;
@ -363,28 +406,26 @@ typedef struct {
/* 0x1C */ EnvelopePoint* envelope;
} AdsrState; // size = 0x20
typedef struct {
/* 0x0 */ u8 unused : 2;
/* 0x0 */ u8 bit2 : 2;
/* 0x0 */ u8 strongRight : 1;
/* 0x0 */ u8 strongLeft : 1;
/* 0x0 */ u8 stereoHeadsetEffects : 1;
/* 0x0 */ u8 usesHeadsetPanEffects : 1;
typedef union {
struct {
/* 0x0 */ u8 unused : 2;
/* 0x0 */ u8 type : 2;
/* 0x0 */ u8 strongRight : 1;
/* 0x0 */ u8 strongLeft : 1;
/* 0x0 */ u8 strongReverbRight : 1;
/* 0x0 */ u8 strongReverbLeft : 1;
};
/* 0x0 */ u8 asByte;
} StereoData; // size = 0x1
typedef union {
/* 0x0 */ StereoData s;
/* 0x0 */ u8 asByte;
} Stereo; // size = 0x1
typedef struct {
/* 0x00 */ u8 reverb;
/* 0x00 */ u8 targetReverbVol;
/* 0x01 */ u8 gain; // Increases volume by a multiplicative scaling factor. Represented as a UQ4.4 number
/* 0x02 */ u8 pan;
/* 0x03 */ u8 unk_3; // Possibly part of stereo?
/* 0x04 */ Stereo stereo;
/* 0x05 */ u8 unk_4;
/* 0x06 */ u16 unk_6;
/* 0x03 */ u8 surroundEffectIndex;
/* 0x04 */ StereoData stereoData;
/* 0x05 */ u8 combFilterSize;
/* 0x06 */ u16 combFilterGain;
/* 0x08 */ f32 freqScale;
/* 0x0C */ f32 velocity;
/* 0x10 */ s16* filter;
@ -421,7 +462,7 @@ typedef struct SequenceChannel {
} changes;
/* 0x02 */ u8 noteAllocPolicy;
/* 0x03 */ u8 muteFlags;
/* 0x04 */ u8 reverb; // or dry/wet mix
/* 0x04 */ u8 targetReverbVol; // or dry/wet mix
/* 0x05 */ u8 notePriority; // 0-3
/* 0x06 */ u8 someOtherPriority;
/* 0x07 */ u8 fontId;
@ -432,12 +473,12 @@ typedef struct SequenceChannel {
/* 0x0C */ u8 gain; // Increases volume by a multiplicative scaling factor. Represented as a UQ4.4 number
/* 0x0D */ u8 velocityRandomVariance;
/* 0x0E */ u8 gateTimeRandomVariance;
/* 0x0F */ u8 unk_0F;
/* 0x10 */ u8 unk_10;
/* 0x0F */ u8 combFilterSize;
/* 0x10 */ u8 surroundEffectIndex;
/* 0x11 */ u8 unk_11;
/* 0x12 */ VibratoSubStruct vibrato;
/* 0x20 */ u16 delay;
/* 0x22 */ u16 unk_20;
/* 0x22 */ u16 combFilterGain;
/* 0x24 */ u16 unk_22; // Used for indexing data
/* 0x26 */ s16 instOrWave; // either 0 (none), instrument index + 1, or
// 0x80..0x83 for sawtooth/triangle/sine/square waves.
@ -459,7 +500,7 @@ typedef struct SequenceChannel {
/* 0xC8 */ s8 soundScriptIO[8]; // bridge between sound script and audio lib, "io ports"
/* 0xD0 */ u8* sfxState; // SfxChannelState
/* 0xD4 */ s16* filter;
/* 0xD8 */ Stereo stereo;
/* 0xD8 */ StereoData stereoData;
/* 0xDC */ s32 startSamplePos;
/* 0xE0 */ s32 unk_E0;
} SequenceChannel; // size = 0xE4
@ -474,15 +515,15 @@ typedef struct SequenceLayer {
/* 0x00 */ u8 ignoreDrumPan : 1;
/* 0x00 */ u8 bit1 : 1; // "has initialized continuous notes"?
/* 0x00 */ u8 notePropertiesNeedInit : 1;
/* 0x01 */ Stereo stereo;
/* 0x01 */ StereoData stereoData;
/* 0x02 */ u8 instOrWave;
/* 0x03 */ u8 gateTime;
/* 0x04 */ u8 semitone;
/* 0x05 */ u8 portamentoTargetNote;
/* 0x06 */ u8 pan; // 0..128
/* 0x07 */ u8 notePan;
/* 0x08 */ u8 unk_08;
/* 0x09 */ u8 unk_09;
/* 0x08 */ u8 surroundEffectIndex;
/* 0x09 */ u8 targetReverbVol;
union {
struct {
/* 0x0A */ u16 bit_0 : 1;
@ -531,45 +572,37 @@ typedef struct SequenceLayer {
} SequenceLayer; // size = 0x90
typedef struct {
/* 0x00 */ s16 adpcmdecState[0x10];
/* 0x20 */ s16 finalResampleState[0x10];
/* 0x40 */ s16 mixEnvelopeState[0x28];
/* 0x90 */ s16 panResampleState[0x10];
/* 0xB0 */ s16 panSamplesBuffer[0x20];
/* 0xF0 */ s16 dummyResampleState[0x10];
} NoteSynthesisBuffers; // size = 0x110
/* 0x000 */ s16 adpcmState[16];
/* 0x020 */ s16 finalResampleState[16];
/* 0x040 */ s16 filterState[32];
/* 0x080 */ s16 unusedState[16];
/* 0x0A0 */ s16 haasEffectDelayState[32];
/* 0x0E0 */ s16 combFilterState[128];
/* 0x1E0 */ s16 surroundEffectState[128];
} NoteSynthesisBuffers; // size = 0x2E0
typedef struct {
/* 0x00 */ u8 restart_bit0 : 1;
/* 0x00 */ u8 restart_bit1 : 1;
/* 0x00 */ u8 restart_bit2 : 1;
/* 0x00 */ u8 restart_bit3 : 1;
/* 0x00 */ u8 restart_bit4 : 1;
/* 0x00 */ u8 restart_bit5 : 1;
/* 0x00 */ u8 restart_bit6 : 1;
/* 0x00 */ u8 restart_bit7 : 1;
/* 0x00 */ u8 atLoopPoint : 1;
/* 0x00 */ u8 stopLoop : 1;
/* 0x01 */ u8 sampleDmaIndex;
/* 0x02 */ u8 prevHeadsetPanRight;
/* 0x03 */ u8 prevHeadsetPanLeft;
/* 0x04 */ u8 reverbVol;
/* 0x02 */ u8 prevHaasEffectLeftDelaySize;
/* 0x03 */ u8 prevHaasEffectRightDelaySize;
/* 0x04 */ u8 curReverbVol;
/* 0x05 */ u8 numParts;
/* 0x06 */ u16 samplePosFrac;
/* 0x08 */ u16 unk_08;
/* 0x0C */ s32 samplePosInt;
/* 0x06 */ u16 samplePosFrac; // Fractional part of the sample position
/* 0x08 */ u16 surroundEffectGain;
/* 0x0C */ s32 samplePosInt; // Integer part of the sample position
/* 0x10 */ NoteSynthesisBuffers* synthesisBuffers;
/* 0x14 */ s16 curVolLeft;
/* 0x16 */ s16 curVolRight;
/* 0x18 */ u16 unk_14;
/* 0x1A */ u16 unk_16;
/* 0x1C */ u16 unk_18;
/* 0x1E */ u8 unk_1A;
/* 0x18 */ UNK_TYPE1 unk_14[0x6];
/* 0x1E */ u8 combFilterNeedsInit;
/* 0x1F */ u8 unk_1F;
/* 0x20 */ u16 unk_1C;
/* 0x22 */ u16 unk_1E;
/* 0x20 */ UNK_TYPE1 unk_20[0x4];
} NoteSynthesisState; // size = 0x24
typedef struct {
/* 0x00 */ struct VibratoSubStruct* vibSubStruct; // MM Something else?
/* 0x00 */ struct VibratoSubStruct* vibSubStruct; // Something else?
/* 0x04 */ u32 time;
/* 0x08 */ s16* curve;
/* 0x0C */ f32 extent;
@ -603,67 +636,68 @@ typedef struct {
/* 0x34 */ AdsrState adsr;
/* 0x54 */ Portamento portamento;
/* 0x60 */ VibratoState vibratoState;
/* 0x7C */ char unk_7C[0x8];
/* 0x7C */ UNK_TYPE1 pad7C[0x4];
/* 0x80 */ u8 unk_80;
/* 0x84 */ u32 startSamplePos;
} NotePlaybackState; // size = 0x88
/* 0x88 */ UNK_TYPE1 unk_BC[0x1C];
} NotePlaybackState; // size = 0xA4
typedef struct {
struct {
/* 0x00 */ volatile u8 enabled : 1;
/* 0x00 */ u8 needsInit : 1;
/* 0x00 */ u8 finished : 1; // ?
/* 0x00 */ u8 finished : 1;
/* 0x00 */ u8 unused : 1;
/* 0x00 */ u8 stereoStrongRight : 1;
/* 0x00 */ u8 stereoStrongLeft : 1;
/* 0x00 */ u8 stereoHeadsetEffects : 1;
/* 0x00 */ u8 usesHeadsetPanEffects : 1; // ?
/* 0x00 */ u8 strongRight : 1;
/* 0x00 */ u8 strongLeft : 1;
/* 0x00 */ u8 strongReverbRight : 1;
/* 0x00 */ u8 strongReverbLeft : 1;
} bitField0;
struct {
/* 0x01 */ u8 reverbIndex : 3;
/* 0x01 */ u8 bookOffset : 2;
/* 0x01 */ u8 isSyntheticWave : 1;
/* 0x01 */ u8 hasTwoParts : 1;
/* 0x01 */ u8 usesHeadsetPanEffects2 : 1;
/* 0x01 */ u8 useHaasEffect : 1;
} bitField1;
/* 0x02 */ u8 gain; // Increases volume by a multiplicative scaling factor. Represented as a UQ4.4 number
/* 0x03 */ u8 headsetPanRight;
/* 0x04 */ u8 headsetPanLeft;
/* 0x05 */ u8 reverbVol;
/* 0x03 */ u8 haasEffectLeftDelaySize;
/* 0x04 */ u8 haasEffectRightDelaySize;
/* 0x05 */ u8 targetReverbVol;
/* 0x06 */ u8 harmonicIndexCurAndPrev; // bits 3..2 store curHarmonicIndex, bits 1..0 store prevHarmonicIndex
/* 0x07 */ u8 unk_07;
/* 0x07 */ u8 combFilterSize;
/* 0x08 */ u16 targetVolLeft;
/* 0x0A */ u16 targetVolRight;
/* 0x0C */ u16 resamplingRateFixedPoint;
/* 0x0E */ u16 unk_0E;
/* 0x0C */ u16 frequencyFixedPoint;
/* 0x0E */ u16 combFilterGain;
union {
/* 0x10 */ TunedSample* tunedSample;
/* 0x10 */ s16* waveSampleAddr; // used for synthetic waves
};
/* 0x14 */ s16* filter;
/* 0x18 */ u8 unk_18;
/* 0x19 */ u8 unk_19;
/* 0x1A */ UNK_TYPE1 pad_1A[0x6];
} NoteSubEu; // size = 0x20
/* 0x18 */ UNK_TYPE1 unk_18;
/* 0x19 */ u8 surroundEffectIndex;
/* 0x1A */ UNK_TYPE1 unk_1A[0x6];
} NoteSampleState; // size = 0x20
typedef struct Note {
/* 0x00 */ AudioListItem listItem;
/* 0x10 */ NoteSynthesisState synthesisState;
/* 0x34 */ NotePlaybackState playbackState;
/* 0xBC */ char unk_BC[0x1C];
/* 0xD8 */ NoteSubEu noteSubEu;
/* 0xD8 */ NoteSampleState sampleState;
} Note; // size = 0xF8
typedef struct {
/* 0x00 */ u8 downsampleRate;
/* 0x02 */ u16 windowSize;
/* 0x04 */ u16 unk_4;
/* 0x06 */ u16 unk_6;
/* 0x08 */ u16 unk_8;
/* 0x0A */ u16 unk_A;
/* 0x02 */ u16 delayNumSamples;
/* 0x04 */ u16 decayRatio; // determines how fast reverb dissipates
/* 0x06 */ u16 subDelay;
/* 0x08 */ u16 subVolume;
/* 0x0A */ u16 volume;
/* 0x0C */ u16 leakRtl;
/* 0x0E */ u16 leakLtr;
/* 0x10 */ s8 unk_10;
/* 0x12 */ u16 unk_12;
/* 0x10 */ s8 mixReverbIndex;
/* 0x12 */ u16 mixReverbStrength;
/* 0x14 */ s16 lowPassFilterCutoffLeft;
/* 0x16 */ s16 lowPassFilterCutoffRight;
} ReverbSettings; // size = 0x18
@ -704,13 +738,13 @@ typedef struct {
/* 0x00 */ s16 specUnk4;
/* 0x02 */ u16 samplingFreq; // Target sampling rate in Hz
/* 0x04 */ u16 aiSamplingFreq; // True sampling rate set to the audio interface (AI) for the audio digital-analog converter (DAC)
/* 0x06 */ s16 samplesPerFrameTarget;
/* 0x08 */ s16 maxAiBufNumSamples;
/* 0x0A */ s16 minAiBufNumSamples;
/* 0x06 */ s16 numSamplesPerFrameTarget;
/* 0x08 */ s16 numSamplesPerFrameMax;
/* 0x0A */ s16 numSamplesPerFrameMin;
/* 0x0C */ s16 updatesPerFrame; // for each frame of the audio thread (default 60 fps), number of updates to process audio
/* 0x0E */ s16 samplesPerUpdate;
/* 0x10 */ s16 samplesPerUpdateMax;
/* 0x12 */ s16 samplesPerUpdateMin;
/* 0x0E */ s16 numSamplesPerUpdate;
/* 0x10 */ s16 numSamplesPerUpdateMax;
/* 0x12 */ s16 numSamplesPerUpdateMin;
/* 0x14 */ s16 numSequencePlayers;
/* 0x18 */ f32 resampleRate;
/* 0x1C */ f32 updatesPerFrameInv; // inverse (reciprocal) of updatesPerFrame
@ -899,8 +933,8 @@ typedef struct {
/* 0x0002 */ u16 unk_2; // reads from audio spec unk_14, never used, always set to 0x7FFF
/* 0x0004 */ u16 unk_4;
/* 0x0006 */ char unk_0006[0xA];
/* 0x0010 */ s16* curLoadedBook;
/* 0x0014 */ NoteSubEu* noteSubsEu;
/* 0x0010 */ s16* adpcmCodeBook;
/* 0x0014 */ NoteSampleState* sampleStateList;
/* 0x0018 */ SynthesisReverb synthesisReverbs[4];
/* 0x0B58 */ char unk_0B58[0x30];
/* 0x0B88 */ Sample* usedSamples[128];
@ -1002,7 +1036,7 @@ typedef struct {
/* 0x4460 */ SequencePlayer seqPlayers[5];
/* 0x4B40 */ SequenceLayer sequenceLayers[80];
/* 0x7840 */ SequenceChannel sequenceChannelNone;
/* 0x7924 */ s32 noteSubEuOffset;
/* 0x7924 */ s32 sampleStateOffset; // Start of the list of sample states for this update. Resets after each audio frame.
/* 0x7928 */ AudioListItem layerFreeList;
/* 0x7938 */ NotePool noteFreeLists;
/* 0x7978 */ u8 cmdWritePos;
@ -1023,17 +1057,17 @@ typedef struct {
} AudioContext; // size = 0x81F8
typedef struct {
/* 0x00 */ u8 reverbVol;
/* 0x00 */ u8 targetReverbVol;
/* 0x01 */ u8 gain; // Increases volume by a multiplicative scaling factor. Represented as a UQ4.4 number
/* 0x02 */ u8 pan;
/* 0x03 */ u8 unk_3;
/* 0x04 */ Stereo stereo;
/* 0x03 */ u8 surroundEffectIndex;
/* 0x04 */ StereoData stereoData;
/* 0x08 */ f32 frequency;
/* 0x0C */ f32 velocity;
/* 0x10 */ char unk_0C[0x4];
/* 0x14 */ s16* filter;
/* 0x18 */ u8 unk_14;
/* 0x1A */ u16 unk_16;
/* 0x18 */ u8 combFilterSize;
/* 0x1A */ u16 combFilterGain;
} NoteSubAttributes; // size = 0x1A
typedef struct {

1
spec
View File

@ -608,7 +608,6 @@ beginseg
pad_text
include "build/src/code/audio/audio_data.o"
include "build/src/code/audio/audio_synthesis.o"
include "build/data/code/audio_synthesis.data.o"
include "build/src/code/audio/audio_heap.o"
include "build/data/code/audio_heap.bss.o"
include "build/src/code/audio/audio_load.o"

View File

@ -857,22 +857,99 @@ EnvelopePoint gDefaultEnvelope[] = {
{ ADSR_DISABLE, 0 },
};
NoteSubEu gZeroNoteSub = { 0 };
NoteSampleState gZeroedSampleState = { 0 };
NoteSubEu gDefaultNoteSub = {
{ 1, 1, 0, 0, 0, 0, 0, 0 }, { 0 }, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
NoteSampleState gDefaultSampleState = {
{ true, true, false, false, false, false, false, false },
{ 0 },
0, // gain
0, // haasEffectLeftDelaySize
0, // haasEffectRightDelaySize
0, // targetReverbVol
0, // harmonicIndexCurAndPrev
0, // combFilterSize
0, // targetVolLeft
0, // targetVolRight
0, // frequencyFixedPoint
0, // combFilterGain
NULL, // tunedSample
NULL, // filter
0, // unk_18
0, // surroundEffectIndex
0, // unk_1A
};
u16 gHeadsetPanQuantization[64] = {
60, 58, 56, 54, 52, 50, 48, 46, 44, 42, 40, 38, 36, 34, 32, 30, 28, 26, 24, 22, 20, 18,
16, 14, 12, 10, 8, 6, 4, 2, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
u16 gHaasEffectDelaySize[64] = {
30 * SAMPLE_SIZE,
29 * SAMPLE_SIZE,
28 * SAMPLE_SIZE,
27 * SAMPLE_SIZE,
26 * SAMPLE_SIZE,
25 * SAMPLE_SIZE,
24 * SAMPLE_SIZE,
23 * SAMPLE_SIZE,
22 * SAMPLE_SIZE,
21 * SAMPLE_SIZE,
20 * SAMPLE_SIZE,
19 * SAMPLE_SIZE,
18 * SAMPLE_SIZE,
17 * SAMPLE_SIZE,
16 * SAMPLE_SIZE,
15 * SAMPLE_SIZE,
14 * SAMPLE_SIZE,
13 * SAMPLE_SIZE,
12 * SAMPLE_SIZE,
11 * SAMPLE_SIZE,
10 * SAMPLE_SIZE,
9 * SAMPLE_SIZE,
8 * SAMPLE_SIZE,
7 * SAMPLE_SIZE,
6 * SAMPLE_SIZE,
5 * SAMPLE_SIZE,
4 * SAMPLE_SIZE,
3 * SAMPLE_SIZE,
2 * SAMPLE_SIZE,
1 * SAMPLE_SIZE,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
};
s32 D_801D58A4 = 0;
// clang-format off
s16 D_801D58A8[] = {
s16 gInvalidAdpcmCodeBook[] = {
0, 0, 0, 0, 0, 0, 0, 0,
0, 0, 0, 0, 0, 0, 0, 0,
0, 0, 0, 0, 0, 0, 0, 0,

View File

@ -10,7 +10,7 @@ void AudioHeap_DiscardSampleCaches(void);
void AudioHeap_DiscardSampleBank(s32 sampleBankId);
void AudioHeap_ApplySampleBankCacheInternal(s32 apply, s32 sampleBankId);
void AudioHeap_DiscardSampleBanks(void);
void AudioHeap_InitReverb(s32 reverbIndex, ReverbSettings* settings, s32 flags);
void AudioHeap_InitReverb(s32 reverbIndex, ReverbSettings* settings, s32 isFirstInit);
#define gTatumsPerBeat (gAudioTatumInit[1])
@ -421,7 +421,7 @@ void* AudioHeap_AllocCached(s32 tableType, size_t size, s32 cache, s32 id) {
if (loadStatusEntry0 == LOAD_STATUS_MAYBE_DISCARDABLE) {
for (i = 0; i < gAudioContext.numNotes; i++) {
if ((gAudioContext.notes[i].playbackState.fontId == temporaryCache->entries[0].id) &&
gAudioContext.notes[i].noteSubEu.bitField0.enabled) {
gAudioContext.notes[i].sampleState.bitField0.enabled) {
break;
}
}
@ -435,7 +435,7 @@ void* AudioHeap_AllocCached(s32 tableType, size_t size, s32 cache, s32 id) {
if (loadStatusEntry1 == LOAD_STATUS_MAYBE_DISCARDABLE) {
for (i = 0; i < gAudioContext.numNotes; i++) {
if ((gAudioContext.notes[i].playbackState.fontId == temporaryCache->entries[1].id) &&
gAudioContext.notes[i].noteSubEu.bitField0.enabled) {
gAudioContext.notes[i].sampleState.bitField0.enabled) {
break;
}
}
@ -491,7 +491,7 @@ void* AudioHeap_AllocCached(s32 tableType, size_t size, s32 cache, s32 id) {
if (loadStatusEntry0 == LOAD_STATUS_COMPLETE) {
for (i = 0; i < gAudioContext.numNotes; i++) {
if ((gAudioContext.notes[i].playbackState.fontId == temporaryCache->entries[0].id) &&
gAudioContext.notes[i].noteSubEu.bitField0.enabled) {
gAudioContext.notes[i].sampleState.bitField0.enabled) {
break;
}
}
@ -504,7 +504,7 @@ void* AudioHeap_AllocCached(s32 tableType, size_t size, s32 cache, s32 id) {
if (loadStatusEntry1 == LOAD_STATUS_COMPLETE) {
for (i = 0; i < gAudioContext.numNotes; i++) {
if ((gAudioContext.notes[i].playbackState.fontId == temporaryCache->entries[1].id) &&
gAudioContext.notes[i].noteSubEu.bitField0.enabled) {
gAudioContext.notes[i].sampleState.bitField0.enabled) {
break;
}
}
@ -814,7 +814,7 @@ void AudioHeap_UpdateReverb(SynthesisReverb* reverb) {
void AudioHeap_UpdateReverbs(void) {
s32 count;
s32 i;
s32 reverbIndex;
s32 j;
if (gAudioContext.audioBufferParameters.specUnk4 == 2) {
@ -823,9 +823,9 @@ void AudioHeap_UpdateReverbs(void) {
count = 1;
}
for (i = 0; i < gAudioContext.numSynthesisReverbs; i++) {
for (reverbIndex = 0; reverbIndex < gAudioContext.numSynthesisReverbs; reverbIndex++) {
for (j = 0; j < count; j++) {
AudioHeap_UpdateReverb(&gAudioContext.synthesisReverbs[i]);
AudioHeap_UpdateReverb(&gAudioContext.synthesisReverbs[reverbIndex]);
}
}
}
@ -837,7 +837,7 @@ void AudioHeap_ClearAiBuffers(void) {
s32 curAiBufferIndex = gAudioContext.curAiBufferIndex;
s32 i;
gAudioContext.aiBufNumSamples[curAiBufferIndex] = gAudioContext.audioBufferParameters.minAiBufNumSamples;
gAudioContext.aiBufNumSamples[curAiBufferIndex] = gAudioContext.audioBufferParameters.numSamplesPerFrameMin;
for (i = 0; i < AIBUF_LEN; i++) {
gAudioContext.aiBuffers[curAiBufferIndex][i] = 0;
@ -870,7 +870,7 @@ s32 AudioHeap_ResetStep(void) {
AudioHeap_UpdateReverbs();
} else {
for (i = 0; i < gAudioContext.numNotes; i++) {
if (gAudioContext.notes[i].noteSubEu.bitField0.enabled &&
if (gAudioContext.notes[i].sampleState.bitField0.enabled &&
gAudioContext.notes[i].playbackState.adsr.action.s.state != ADSR_STATE_DISABLED) {
gAudioContext.notes[i].playbackState.adsr.fadeOutVel =
gAudioContext.audioBufferParameters.updatesPerFrameInv;
@ -907,7 +907,7 @@ s32 AudioHeap_ResetStep(void) {
AudioHeap_Init();
gAudioContext.resetStatus = 0;
for (i = 0; i < ARRAY_COUNT(gAudioContext.aiBufNumSamples); i++) {
gAudioContext.aiBufNumSamples[i] = gAudioContext.audioBufferParameters.maxAiBufNumSamples;
gAudioContext.aiBufNumSamples[i] = gAudioContext.audioBufferParameters.numSamplesPerFrameMax;
for (j = 0; j < AIBUF_LEN; j++) {
gAudioContext.aiBuffers[i][j] = 0;
}
@ -930,8 +930,8 @@ void AudioHeap_Init(void) {
size_t cachePoolSize;
size_t miscPoolSize;
u32 intMask;
s32 reverbIndex;
s32 i;
s32 j;
s32 pad2;
AudioSpec* spec = &gAudioSpecs[gAudioContext.audioResetSpecIdToLoad]; // Audio Specifications
@ -942,19 +942,22 @@ void AudioHeap_Init(void) {
gAudioContext.audioBufferParameters.aiSamplingFreq =
osAiSetFrequency(gAudioContext.audioBufferParameters.samplingFreq);
gAudioContext.audioBufferParameters.samplesPerFrameTarget =
gAudioContext.audioBufferParameters.numSamplesPerFrameTarget =
ALIGN16(gAudioContext.audioBufferParameters.samplingFreq / gAudioContext.refreshRate);
gAudioContext.audioBufferParameters.minAiBufNumSamples =
gAudioContext.audioBufferParameters.samplesPerFrameTarget - 0x10;
gAudioContext.audioBufferParameters.maxAiBufNumSamples =
gAudioContext.audioBufferParameters.samplesPerFrameTarget + 0x10;
gAudioContext.audioBufferParameters.numSamplesPerFrameMin =
gAudioContext.audioBufferParameters.numSamplesPerFrameTarget - 0x10;
gAudioContext.audioBufferParameters.numSamplesPerFrameMax =
gAudioContext.audioBufferParameters.numSamplesPerFrameTarget + 0x10;
gAudioContext.audioBufferParameters.updatesPerFrame =
((gAudioContext.audioBufferParameters.samplesPerFrameTarget + 0x10) / 0xD0) + 1;
gAudioContext.audioBufferParameters.samplesPerUpdate = (gAudioContext.audioBufferParameters.samplesPerFrameTarget /
gAudioContext.audioBufferParameters.updatesPerFrame) &
~7;
gAudioContext.audioBufferParameters.samplesPerUpdateMax = gAudioContext.audioBufferParameters.samplesPerUpdate + 8;
gAudioContext.audioBufferParameters.samplesPerUpdateMin = gAudioContext.audioBufferParameters.samplesPerUpdate - 8;
((gAudioContext.audioBufferParameters.numSamplesPerFrameTarget + 0x10) / 0xD0) + 1;
gAudioContext.audioBufferParameters.numSamplesPerUpdate =
(gAudioContext.audioBufferParameters.numSamplesPerFrameTarget /
gAudioContext.audioBufferParameters.updatesPerFrame) &
~7;
gAudioContext.audioBufferParameters.numSamplesPerUpdateMax =
gAudioContext.audioBufferParameters.numSamplesPerUpdate + 8;
gAudioContext.audioBufferParameters.numSamplesPerUpdateMin =
gAudioContext.audioBufferParameters.numSamplesPerUpdate - 8;
gAudioContext.audioBufferParameters.resampleRate = 32000.0f / (s32)gAudioContext.audioBufferParameters.samplingFreq;
gAudioContext.audioBufferParameters.updatesPerFrameInvScaled =
(1.0f / 256.0f) / gAudioContext.audioBufferParameters.updatesPerFrame;
@ -984,13 +987,13 @@ void AudioHeap_Init(void) {
gAudioContext.unk_2870 /= gAudioContext.tempoInternalToExternal;
gAudioContext.audioBufferParameters.specUnk4 = spec->unk_04;
gAudioContext.audioBufferParameters.samplesPerFrameTarget *= gAudioContext.audioBufferParameters.specUnk4;
gAudioContext.audioBufferParameters.maxAiBufNumSamples *= gAudioContext.audioBufferParameters.specUnk4;
gAudioContext.audioBufferParameters.minAiBufNumSamples *= gAudioContext.audioBufferParameters.specUnk4;
gAudioContext.audioBufferParameters.numSamplesPerFrameTarget *= gAudioContext.audioBufferParameters.specUnk4;
gAudioContext.audioBufferParameters.numSamplesPerFrameMax *= gAudioContext.audioBufferParameters.specUnk4;
gAudioContext.audioBufferParameters.numSamplesPerFrameMin *= gAudioContext.audioBufferParameters.specUnk4;
gAudioContext.audioBufferParameters.updatesPerFrame *= gAudioContext.audioBufferParameters.specUnk4;
if (gAudioContext.audioBufferParameters.specUnk4 >= 2) {
gAudioContext.audioBufferParameters.maxAiBufNumSamples -= 0x10;
gAudioContext.audioBufferParameters.numSamplesPerFrameMax -= 0x10;
}
// Determine the maximum allowable number of audio command list entries for the rsp microcode
@ -1037,13 +1040,13 @@ void AudioHeap_Init(void) {
gAudioContext.notes = AudioHeap_AllocZeroed(&gAudioContext.miscPool, gAudioContext.numNotes * sizeof(Note));
AudioPlayback_NoteInitAll();
AudioPlayback_InitNoteFreeList();
gAudioContext.noteSubsEu =
gAudioContext.sampleStateList =
AudioHeap_AllocZeroed(&gAudioContext.miscPool, gAudioContext.audioBufferParameters.updatesPerFrame *
gAudioContext.numNotes * sizeof(NoteSubEu));
gAudioContext.numNotes * sizeof(NoteSampleState));
// Initialize audio binary interface command list buffer
for (j = 0; j < ARRAY_COUNT(gAudioContext.abiCmdBufs); j++) {
gAudioContext.abiCmdBufs[j] =
for (i = 0; i < ARRAY_COUNT(gAudioContext.abiCmdBufs); i++) {
gAudioContext.abiCmdBufs[i] =
AudioHeap_AllocDmaMemoryZeroed(&gAudioContext.miscPool, gAudioContext.maxAudioCmds * sizeof(Acmd));
}
@ -1052,20 +1055,20 @@ void AudioHeap_Init(void) {
AudioHeap_InitAdsrDecayTable();
// Initialize reverbs
for (i = 0; i < ARRAY_COUNT(gAudioContext.synthesisReverbs); i++) {
gAudioContext.synthesisReverbs[i].useReverb = 0;
for (reverbIndex = 0; reverbIndex < ARRAY_COUNT(gAudioContext.synthesisReverbs); reverbIndex++) {
gAudioContext.synthesisReverbs[reverbIndex].useReverb = 0;
}
gAudioContext.numSynthesisReverbs = spec->numReverbs;
for (i = 0; i < gAudioContext.numSynthesisReverbs; i++) {
AudioHeap_InitReverb(i, &spec->reverbSettings[i], 1);
for (reverbIndex = 0; reverbIndex < gAudioContext.numSynthesisReverbs; reverbIndex++) {
AudioHeap_InitReverb(reverbIndex, &spec->reverbSettings[reverbIndex], true);
}
// Initialize sequence players
AudioSeq_InitSequencePlayers();
for (j = 0; j < gAudioContext.audioBufferParameters.numSequencePlayers; j++) {
AudioSeq_InitSequencePlayerChannels(j);
AudioSeq_ResetSequencePlayer(&gAudioContext.seqPlayers[j]);
for (i = 0; i < gAudioContext.audioBufferParameters.numSequencePlayers; i++) {
AudioSeq_InitSequencePlayerChannels(i);
AudioSeq_ResetSequencePlayer(&gAudioContext.seqPlayers[i]);
}
// Initialize two additional caches on the audio heap to store individual audio samples
@ -1529,149 +1532,165 @@ void AudioHeap_DiscardSampleBanks(void) {
}
}
void AudioHeap_SetReverbData(s32 reverbIndex, u32 dataType, s32 data, s32 flags) {
s32 windowSize;
void AudioHeap_SetReverbData(s32 reverbIndex, u32 dataType, s32 data, s32 isFirstInit) {
s32 delayNumSamples;
SynthesisReverb* reverb = &gAudioContext.synthesisReverbs[reverbIndex];
switch (dataType) {
case 0:
AudioHeap_InitReverb(reverbIndex, (ReverbSettings*)data, 0);
case REVERB_DATA_TYPE_SETTINGS:
AudioHeap_InitReverb(reverbIndex, (ReverbSettings*)data, false);
break;
case 1:
case REVERB_DATA_TYPE_DELAY:
if (data < 4) {
data = 4;
}
windowSize = data * 64;
if (windowSize < 0x100) {
windowSize = 0x100;
delayNumSamples = data * 64;
if (delayNumSamples < (16 * SAMPLES_PER_FRAME)) {
delayNumSamples = 16 * SAMPLES_PER_FRAME;
}
windowSize /= reverb->downsampleRate;
delayNumSamples /= reverb->downsampleRate;
if (flags == 0) {
if (reverb->unk_1E >= (data / reverb->downsampleRate)) {
if ((reverb->nextRingBufPos >= windowSize) || (reverb->unk_24 >= windowSize)) {
reverb->nextRingBufPos = 0;
reverb->unk_24 = 0;
}
} else {
if (!isFirstInit) {
if (reverb->delayNumSamplesAfterDownsampling < (data / reverb->downsampleRate)) {
break;
}
if ((reverb->nextReverbBufPos >= delayNumSamples) || (reverb->delayNumSamplesUnk >= delayNumSamples)) {
reverb->nextReverbBufPos = 0;
reverb->delayNumSamplesUnk = 0;
}
}
reverb->windowSize = windowSize;
reverb->delayNumSamples = delayNumSamples;
if ((reverb->downsampleRate != 1) || reverb->unk_18) {
reverb->unk_0E = 0x8000 / reverb->downsampleRate;
if (reverb->unk_30 == NULL) {
reverb->unk_30 = AudioHeap_AllocZeroed(&gAudioContext.miscPool, 0x20);
reverb->unk_34 = AudioHeap_AllocZeroed(&gAudioContext.miscPool, 0x20);
reverb->unk_38 = AudioHeap_AllocZeroed(&gAudioContext.miscPool, 0x20);
reverb->unk_3C = AudioHeap_AllocZeroed(&gAudioContext.miscPool, 0x20);
if (reverb->unk_3C == NULL) {
if ((reverb->downsampleRate != 1) || reverb->resampleEffectOn) {
reverb->downsamplePitch = 0x8000 / reverb->downsampleRate;
if (reverb->leftLoadResampleBuf == NULL) {
reverb->leftLoadResampleBuf =
AudioHeap_AllocZeroed(&gAudioContext.miscPool, sizeof(RESAMPLE_STATE));
reverb->rightLoadResampleBuf =
AudioHeap_AllocZeroed(&gAudioContext.miscPool, sizeof(RESAMPLE_STATE));
reverb->leftSaveResampleBuf =
AudioHeap_AllocZeroed(&gAudioContext.miscPool, sizeof(RESAMPLE_STATE));
reverb->rightSaveResampleBuf =
AudioHeap_AllocZeroed(&gAudioContext.miscPool, sizeof(RESAMPLE_STATE));
if (reverb->rightSaveResampleBuf == NULL) {
reverb->downsampleRate = 1;
}
}
}
break;
case 2:
gAudioContext.synthesisReverbs[reverbIndex].unk_0C = data;
case REVERB_DATA_TYPE_DECAY:
gAudioContext.synthesisReverbs[reverbIndex].decayRatio = data;
break;
case 3:
gAudioContext.synthesisReverbs[reverbIndex].unk_16 = data;
case REVERB_DATA_TYPE_SUB_VOLUME:
gAudioContext.synthesisReverbs[reverbIndex].subVolume = data;
break;
case 4:
gAudioContext.synthesisReverbs[reverbIndex].unk_0A = data;
case REVERB_DATA_TYPE_VOLUME:
gAudioContext.synthesisReverbs[reverbIndex].volume = data;
break;
case 5:
case REVERB_DATA_TYPE_LEAK_RIGHT:
gAudioContext.synthesisReverbs[reverbIndex].leakRtl = data;
break;
case 6:
case REVERB_DATA_TYPE_LEAK_LEFT:
gAudioContext.synthesisReverbs[reverbIndex].leakLtr = data;
break;
case 7:
case REVERB_DATA_TYPE_FILTER_LEFT:
if (data != 0) {
if ((flags != 0) || (reverb->unk_278 == 0)) {
reverb->filterLeftState = AudioHeap_AllocDmaMemoryZeroed(&gAudioContext.miscPool, 0x40);
reverb->unk_278 = AudioHeap_AllocDmaMemory(&gAudioContext.miscPool, 0x10);
if (isFirstInit || (reverb->filterLeftInit == NULL)) {
reverb->filterLeftState = AudioHeap_AllocDmaMemoryZeroed(&gAudioContext.miscPool,
2 * (FILTER_BUF_PART1 + FILTER_BUF_PART2));
reverb->filterLeftInit = AudioHeap_AllocDmaMemory(&gAudioContext.miscPool, FILTER_SIZE);
}
reverb->filterLeft = reverb->unk_278;
if (reverb->filterLeft != 0) {
reverb->filterLeft = reverb->filterLeftInit;
if (reverb->filterLeft != NULL) {
AudioHeap_LoadLowPassFilter(reverb->filterLeft, data);
}
} else {
reverb->filterLeft = 0;
reverb->filterLeft = NULL;
if (flags != 0) {
reverb->unk_278 = 0;
if (isFirstInit) {
reverb->filterLeftInit = NULL;
}
}
break;
case 8:
case REVERB_DATA_TYPE_FILTER_RIGHT:
if (data != 0) {
if ((flags != 0) || (reverb->unk_27C == 0)) {
reverb->filterRightState = AudioHeap_AllocDmaMemoryZeroed(&gAudioContext.miscPool, 0x40);
reverb->unk_27C = AudioHeap_AllocDmaMemory(&gAudioContext.miscPool, 0x10);
if (isFirstInit || (reverb->filterRightInit == NULL)) {
reverb->filterRightState = AudioHeap_AllocDmaMemoryZeroed(
&gAudioContext.miscPool, 2 * (FILTER_BUF_PART1 + FILTER_BUF_PART2));
reverb->filterRightInit = AudioHeap_AllocDmaMemory(&gAudioContext.miscPool, FILTER_SIZE);
}
reverb->filterRight = reverb->unk_27C;
if (reverb->unk_27C != 0) {
AudioHeap_LoadLowPassFilter(reverb->unk_27C, data);
reverb->filterRight = reverb->filterRightInit;
if (reverb->filterRight != NULL) {
AudioHeap_LoadLowPassFilter(reverb->filterRight, data);
}
} else {
reverb->filterRight = 0;
if (flags != 0) {
reverb->unk_27C = 0;
reverb->filterRight = NULL;
if (isFirstInit) {
reverb->filterRightInit = NULL;
}
}
break;
case 9:
reverb->unk_19 = data;
case REVERB_DATA_TYPE_9:
reverb->resampleEffectExtraSamples = data;
if (data == 0) {
reverb->unk_18 = false;
reverb->resampleEffectOn = false;
} else {
reverb->unk_18 = true;
reverb->resampleEffectOn = true;
}
break;
default:
break;
}
}
void AudioHeap_InitReverb(s32 reverbIndex, ReverbSettings* settings, s32 flags) {
void AudioHeap_InitReverb(s32 reverbIndex, ReverbSettings* settings, s32 isFirstInit) {
SynthesisReverb* reverb = &gAudioContext.synthesisReverbs[reverbIndex];
if (flags != 0) {
reverb->unk_1E = settings->windowSize / settings->downsampleRate;
reverb->unk_30 = 0;
} else if (reverb->unk_1E < (settings->windowSize / settings->downsampleRate)) {
if (isFirstInit) {
reverb->delayNumSamplesAfterDownsampling = settings->delayNumSamples / settings->downsampleRate;
reverb->leftLoadResampleBuf = NULL;
} else if (reverb->delayNumSamplesAfterDownsampling < (settings->delayNumSamples / settings->downsampleRate)) {
return;
}
reverb->downsampleRate = settings->downsampleRate;
reverb->unk_18 = false;
reverb->unk_19 = 0;
reverb->unk_1A = 0;
reverb->unk_1C = 0;
AudioHeap_SetReverbData(reverbIndex, 1, settings->windowSize, flags);
reverb->unk_0C = settings->unk_4;
reverb->unk_0A = settings->unk_A;
reverb->unk_14 = settings->unk_6 << 6;
reverb->unk_16 = settings->unk_8;
reverb->resampleEffectOn = false;
reverb->resampleEffectExtraSamples = 0;
reverb->resampleEffectLoadUnk = 0;
reverb->resampleEffectSaveUnk = 0;
AudioHeap_SetReverbData(reverbIndex, REVERB_DATA_TYPE_DELAY, settings->delayNumSamples, isFirstInit);
reverb->decayRatio = settings->decayRatio;
reverb->volume = settings->volume;
reverb->subDelay = settings->subDelay * 64;
reverb->subVolume = settings->subVolume;
reverb->leakRtl = settings->leakRtl;
reverb->leakLtr = settings->leakLtr;
reverb->unk_05 = settings->unk_10;
reverb->unk_08 = settings->unk_12;
reverb->useReverb = 8;
reverb->mixReverbIndex = settings->mixReverbIndex;
reverb->mixReverbStrength = settings->mixReverbStrength;
reverb->useReverb = 8; // used as a boolean
if (flags != 0) {
reverb->leftRingBuf = AudioHeap_AllocZeroedAttemptExternal(&gAudioContext.miscPool, reverb->windowSize * 2);
reverb->rightRingBuf = AudioHeap_AllocZeroedAttemptExternal(&gAudioContext.miscPool, reverb->windowSize * 2);
if (isFirstInit) {
reverb->leftReverbBuf =
AudioHeap_AllocZeroedAttemptExternal(&gAudioContext.miscPool, reverb->delayNumSamples * 2);
reverb->rightReverbBuf =
AudioHeap_AllocZeroedAttemptExternal(&gAudioContext.miscPool, reverb->delayNumSamples * 2);
reverb->resampleFlags = 1;
reverb->nextRingBufPos = 0;
reverb->unk_24 = 0;
reverb->nextReverbBufPos = 0;
reverb->delayNumSamplesUnk = 0;
reverb->curFrame = 0;
reverb->framesToIgnore = 2;
}
@ -1681,12 +1700,13 @@ void AudioHeap_InitReverb(s32 reverbIndex, ReverbSettings* settings, s32 flags)
reverb->tunedSample.tuning = 1.0f;
reverb->sample.codec = CODEC_REVERB;
reverb->sample.medium = MEDIUM_RAM;
reverb->sample.size = reverb->windowSize * 2;
reverb->sample.sampleAddr = (u8*)reverb->leftRingBuf;
reverb->sample.size = reverb->delayNumSamples * SAMPLE_SIZE;
reverb->sample.sampleAddr = (u8*)reverb->leftReverbBuf;
reverb->loop.start = 0;
reverb->loop.count = 1;
reverb->loop.end = reverb->windowSize;
reverb->loop.loopEnd = reverb->delayNumSamples;
AudioHeap_SetReverbData(reverbIndex, 7, settings->lowPassFilterCutoffLeft, flags);
AudioHeap_SetReverbData(reverbIndex, 8, settings->lowPassFilterCutoffRight, flags);
AudioHeap_SetReverbData(reverbIndex, REVERB_DATA_TYPE_FILTER_LEFT, settings->lowPassFilterCutoffLeft, isFirstInit);
AudioHeap_SetReverbData(reverbIndex, REVERB_DATA_TYPE_FILTER_RIGHT, settings->lowPassFilterCutoffRight,
isFirstInit);
}

View File

@ -1,12 +1,184 @@
#include "global.h"
const s16 gAudioTatumInit[] = {
0x1C00, // unused
0x30, // gTatumsPerBeat
0x1C00, // unused
TATUMS_PER_BEAT, // gTatumsPerBeat
};
// TODO: Extract from table?
#define NUM_SOUNDFONTS 41
#define SFX_SEQ_SIZE 0xC6A0
#define AMBIENCE_SEQ_SIZE 0xFC0
#define SOUNDFONT_0_SIZE 0x81C0
#define SOUNDFONT_1_SIZE 0x36D0
#define SOUNDFONT_2_SIZE 0xCE0
// Sizes of everything on the init pool
#define AI_BUFFERS_SIZE (AIBUF_SIZE * ARRAY_COUNT(gAudioContext.aiBuffers))
#define SOUNDFONT_LIST_SIZE (NUM_SOUNDFONTS * sizeof(SoundFont))
// 0x19BD0
#define PERMANENT_POOL_SIZE \
(SFX_SEQ_SIZE + AMBIENCE_SEQ_SIZE + SOUNDFONT_0_SIZE + SOUNDFONT_1_SIZE + SOUNDFONT_2_SIZE + 0x430)
const AudioHeapInitSizes gAudioHeapInitSizes = {
0x137F00, // heapSize
0x1C480, // initPoolSize
0x1A000, // permanentPoolSize
ALIGN16(sizeof(gAudioHeap) - 0x100), // audio heap size
ALIGN16(PERMANENT_POOL_SIZE + AI_BUFFERS_SIZE + SOUNDFONT_LIST_SIZE + 0x40), // init pool size
ALIGN16(PERMANENT_POOL_SIZE), // permanent pool size
};
#define REVERB_INDEX_0_SETTINGS \
{ 1, 0x30, 0x3000, 0, 0, 0x7FFF, 0x0000, 0x0000, REVERB_INDEX_NONE, 0x3000, 0, 0 }
ReverbSettings reverbSettings0[3] = {
REVERB_INDEX_0_SETTINGS,
{ 1, 0x20, 0x0800, 0, 0, 0x7FFF, 0x0000, 0x0000, REVERB_INDEX_NONE, 0x0000, 0, 0 },
};
ReverbSettings reverbSettings1[3] = {
REVERB_INDEX_0_SETTINGS,
{ 1, 0x30, 0x1800, 0, 0, 0x7FFF, 0x0000, 0x0000, REVERB_INDEX_NONE, 0x0000, 11, 11 },
};
ReverbSettings reverbSettings2[3] = {
REVERB_INDEX_0_SETTINGS,
{ 1, 0x38, 0x2800, 0, 0, 0x7FFF, 0x0000, 0x0000, REVERB_INDEX_NONE, 0x0000, 7, 7 },
};
ReverbSettings reverbSettings3[3] = {
REVERB_INDEX_0_SETTINGS,
{ 1, 0x30, 0x6800, 0, 0, 0x7FFF, 0x1400, 0x1400, REVERB_INDEX_NONE, 0x3000, 6, 6 },
{ 2, 0x50, 0x6000, 0, 0, 0x7FFF, 0xD000, 0x3000, REVERB_INDEX_NONE, 0x3000, 0, 0 },
};
ReverbSettings reverbSettings4[3] = {
REVERB_INDEX_0_SETTINGS,
{ 1, 0x40, 0x5000, 0, 0, 0x7FFF, 0x1800, 0x1800, REVERB_INDEX_NONE, 0x3000, 7, 7 },
};
ReverbSettings reverbSettings5[3] = {
REVERB_INDEX_0_SETTINGS,
{ 1, 0x40, 0x5C00, 0, 0, 0x7FFF, 0x2000, 0x2000, REVERB_INDEX_NONE, 0x3000, 4, 4 },
};
ReverbSettings reverbSettings6[3] = {
REVERB_INDEX_0_SETTINGS,
{ 1, 0x30, 0x6000, 0, 0, 0x7FFF, 0x1000, 0x1000, REVERB_INDEX_NONE, 0x3000, 10, 10 },
};
ReverbSettings reverbSettings7[3] = {
REVERB_INDEX_0_SETTINGS,
{ 1, 0x30, 0x6800, 0, 0, 0x7FFF, 0x1400, 0x1400, REVERB_INDEX_NONE, 0x3000, 6, 6 },
};
ReverbSettings reverbSettings8[2] = {
REVERB_INDEX_0_SETTINGS,
{ 1, 0x50, 0x5000, 0, 0, 0x7FFF, 0xD000, 0x3000, REVERB_INDEX_NONE, 0x3000, 0, 0 },
};
ReverbSettings reverbSettings9[3] = {
REVERB_INDEX_0_SETTINGS,
{ 1, 0x20, 0x0000, 0, 0, 0x7FFF, 0x0000, 0x0000, REVERB_INDEX_NONE, 0x0000, 0, 0 },
};
ReverbSettings reverbSettingsA[3] = {
REVERB_INDEX_0_SETTINGS,
{ 1, 0x30, 0x1800, 0, 0, 0x7FFF, 0x0000, 0x0000, REVERB_INDEX_NONE, 0x0000, 11, 11 },
};
ReverbSettings reverbSettingsB[3] = {
REVERB_INDEX_0_SETTINGS,
};
ReverbSettings reverbSettingsC[3] = {
REVERB_INDEX_0_SETTINGS,
{ 1, 0x40, 0x5000, 0, 0, 0x7FFF, 0x0000, 0x0000, REVERB_INDEX_NONE, 0x3000, 0, 0 },
};
ReverbSettings reverbSettingsD[3] = {
REVERB_INDEX_0_SETTINGS,
{ 1, 0x30, 0x6800, 0, 0, 0x7FFF, 0x1400, 0x1400, REVERB_INDEX_NONE, 0x3000, 6, 6 },
{ 2, 0x50, 0x6000, 0, 0, 0x7FFF, 0xD000, 0x3000, REVERB_INDEX_NONE, 0x3000, 0, 0 },
};
ReverbSettings reverbSettingsE[3] = {
REVERB_INDEX_0_SETTINGS,
{ 1, 0x30, 0x1800, 0, 0, 0x7FFF, 0x0000, 0x0000, REVERB_INDEX_NONE, 0x0000, 11, 11 },
{ 1, 0x40, 0x5000, 0, 0, 0x7FFF, 0x1800, 0x1800, REVERB_INDEX_NONE, 0x3000, 7, 7 },
};
ReverbSettings reverbSettingsF[2] = {
REVERB_INDEX_0_SETTINGS,
{ 1, 0x50, 0x1800, 0, 0, 0x7FFF, 0x0000, 0x0000, REVERB_INDEX_NONE, 0x0000, 11, 11 },
};
ReverbSettings* gReverbSettingsTable[] = {
reverbSettings0, reverbSettings1, reverbSettings2, reverbSettings4, reverbSettings5,
reverbSettings6, reverbSettings7, reverbSettings8, reverbSettings9, reverbSettings3,
};
AudioSpec gAudioSpecs[21] = {
/* 0x0 */
{ 32000, 1, 24, 5, 0, 0, 2, reverbSettingsF, 0x500, 0x200, 0x7FFF, 0xAF0, 0x2D80, 0, 0x4100, 0x2D00, 0, 0,
0xDC800 },
/* 0x1 */
{ 32000, 1, 24, 5, 0, 0, 2, reverbSettingsF, 0x500, 0x200, 0x7FFF, 0xAF0, 0x2D80, 0, 0x4100, 0x2D00, 0, 0,
0xDC800 },
/* 0x2 */
{ 32000, 1, 24, 5, 0, 0, 2, reverbSettingsF, 0x500, 0x200, 0x7FFF, 0xAF0, 0x2D80, 0, 0x4100, 0x2D00, 0, 0,
0xDC800 },
/* 0x3 */
{ 32000, 1, 24, 5, 0, 0, 2, reverbSettingsF, 0x500, 0x200, 0x7FFF, 0xAF0, 0x2D80, 0, 0x4100, 0x2D00, 0, 0,
0xDC800 },
/* 0x4 */
{ 32000, 1, 24, 5, 0, 0, 2, reverbSettingsF, 0x500, 0x200, 0x7FFF, 0xAF0, 0x2D80, 0, 0x4100, 0x2D00, 0, 0,
0xDC800 },
/* 0x5 */
{ 32000, 1, 24, 5, 0, 0, 2, reverbSettingsF, 0x500, 0x200, 0x7FFF, 0xAF0, 0x2D80, 0, 0x4100, 0x2D00, 0, 0,
0xDC800 },
/* 0x6 */
{ 32000, 1, 24, 5, 0, 0, 2, reverbSettingsF, 0x500, 0x200, 0x7FFF, 0xAF0, 0x2D80, 0, 0x4100, 0x2D00, 0, 0,
0xDC800 },
/* 0x7 */
{ 32000, 1, 24, 5, 0, 0, 2, reverbSettingsF, 0x500, 0x200, 0x7FFF, 0xAF0, 0x2D80, 0, 0x4100, 0x2D00, 0, 0,
0xDC800 },
/* 0x8 */
{ 32000, 1, 24, 5, 0, 0, 2, reverbSettingsF, 0x500, 0x200, 0x7FFF, 0xAF0, 0x2D80, 0, 0x4100, 0x2D00, 0, 0,
0xDC800 },
/* 0x9 */
{ 32000, 1, 24, 5, 0, 0, 2, reverbSettingsF, 0x500, 0x200, 0x7FFF, 0xAF0, 0x2D80, 0, 0x4100, 0x2D00, 0, 0,
0xDC800 },
/* 0xA */
{ 32000, 1, 28, 3, 0, 0, 2, reverbSettingsA, 0x500, 0x200, 0x7FFF, 0xAF0, 0x2D80, 0, 0x2800, 0x2D00, 0, 0,
0xDC800 },
/* 0xB */
{ 32000, 1, 28, 3, 0, 0, 2, reverbSettingsA, 0x500, 0x200, 0x7FFF, 0xAF0, 0x2D80, 0, 0x4100, 0x2D00, 0, 0,
0xDC800 },
/* 0xC */
{ 32000, 1, 28, 5, 0, 0, 2, reverbSettingsA, 0x500, 0x200, 0x7FFF, 0xAF0, 0x2D80, 0, 0x4100, 0x2D00, 0, 0,
0xCC800 },
/* 0xD */
{ 32000, 1, 24, 5, 0, 0, 3, reverbSettingsD, 0x500, 0x200, 0x7FFF, 0xAF0, 0x2D80, 0, 0x4100, 0x2D00, 0, 0,
0xDC800 },
/* 0xE */
{ 32000, 1, 24, 5, 0, 0, 3, reverbSettingsE, 0x500, 0x200, 0x7FFF, 0xAF0, 0x2D80, 0, 0x4100, 0x2D00, 0, 0,
0xDC800 },
/* 0xF */
{ 32000, 1, 24, 5, 0, 0, 2, reverbSettingsF, 0x500, 0x200, 0x7FFF, 0xAF0, 0x2D80, 0, 0x4000, 0x2D00, 0, 0,
0xDC800 },
/* 0x10 */
{ 32000, 1, 22, 5, 0, 0, 2, reverbSettings0, 0x500, 0x200, 0x7FFF, 0xAF0, 0x2D80, 0, 0x4100, 0x2D00, 0, 0,
0xDC800 },
/* 0x11 */
{ 32000, 1, 22, 5, 0, 0, 2, reverbSettings8, 0x500, 0x200, 0x7FFF, 0xAF0, 0x2D80, 0, 0x4100, 0x2D00, 0, 0,
0xDC800 },
/* 0x12 */
{ 32000, 1, 16, 5, 0, 0, 2, reverbSettings0, 0x500, 0x200, 0x7FFF, 0xAF0, 0x2D80, 0, 0x4100, 0x2D00, 0, 0,
0xDC800 },
/* 0x13 */
{ 22050, 1, 24, 5, 0, 0, 2, reverbSettings0, 0x500, 0x200, 0x7FFF, 0xAF0, 0x2D80, 0, 0x4100, 0x2D00, 0, 0,
0xDC800 },
/* 0x14 */
{ 32000, 1, 24, 5, 0, 0, 2, reverbSettings2, 0x500, 0x200, 0x7FFF, 0xAF0, 0x2D80, 0, 0x3600, 0x2600, 0, 0,
0xDC800 },
};

View File

@ -1218,9 +1218,9 @@ void AudioLoad_Init(void* heap, size_t heapSize) {
s32 i;
s32 j;
D_80208E68 = NULL;
D_80208E70 = NULL;
D_80208E74 = NULL;
gCustomAudioUpdateFunction = NULL;
gCustomAudioReverbFunction = NULL;
gCustomAudioSynthFunction = NULL;
for (i = 0; i < ARRAY_COUNT(gAudioContext.unk_29A8); i++) {
gAudioContext.unk_29A8[i] = NULL;

View File

@ -1,10 +1,10 @@
#include "global.h"
void AudioPlayback_NoteSetResamplingRate(NoteSubEu* noteSubEu, f32 resamplingRateInput);
void AudioPlayback_NoteSetResamplingRate(NoteSampleState* sampleState, f32 resamplingRateInput);
void AudioPlayback_AudioListPushFront(AudioListItem* list, AudioListItem* item);
void AudioPlayback_NoteInitForLayer(Note* note, SequenceLayer* layer);
void AudioPlayback_InitNoteSub(Note* note, NoteSubEu* noteSubEu, NoteSubAttributes* subAttrs) {
void AudioPlayback_InitSampleState(Note* note, NoteSampleState* sampleState, NoteSubAttributes* subAttrs) {
f32 volLeft;
f32 volRight;
s32 halfPanIndex;
@ -13,45 +13,45 @@ void AudioPlayback_InitNoteSub(Note* note, NoteSubEu* noteSubEu, NoteSubAttribut
u8 strongRight;
f32 vel;
u8 pan;
u8 reverbVol;
u8 targetReverbVol;
StereoData stereoData;
s32 stereoHeadsetEffects = note->playbackState.stereoHeadsetEffects;
vel = subAttrs->velocity;
pan = subAttrs->pan;
reverbVol = subAttrs->reverbVol;
stereoData = subAttrs->stereo.s;
targetReverbVol = subAttrs->targetReverbVol;
stereoData = subAttrs->stereoData;
noteSubEu->bitField0 = note->noteSubEu.bitField0;
noteSubEu->bitField1 = note->noteSubEu.bitField1;
noteSubEu->waveSampleAddr = note->noteSubEu.waveSampleAddr;
noteSubEu->harmonicIndexCurAndPrev = note->noteSubEu.harmonicIndexCurAndPrev;
sampleState->bitField0 = note->sampleState.bitField0;
sampleState->bitField1 = note->sampleState.bitField1;
sampleState->waveSampleAddr = note->sampleState.waveSampleAddr;
sampleState->harmonicIndexCurAndPrev = note->sampleState.harmonicIndexCurAndPrev;
AudioPlayback_NoteSetResamplingRate(noteSubEu, subAttrs->frequency);
AudioPlayback_NoteSetResamplingRate(sampleState, subAttrs->frequency);
pan &= 0x7F;
noteSubEu->bitField0.stereoStrongRight = false;
noteSubEu->bitField0.stereoStrongLeft = false;
noteSubEu->bitField0.stereoHeadsetEffects = stereoData.stereoHeadsetEffects;
noteSubEu->bitField0.usesHeadsetPanEffects = stereoData.usesHeadsetPanEffects;
sampleState->bitField0.strongRight = false;
sampleState->bitField0.strongLeft = false;
sampleState->bitField0.strongReverbRight = stereoData.strongReverbRight;
sampleState->bitField0.strongReverbLeft = stereoData.strongReverbLeft;
if (stereoHeadsetEffects && (gAudioContext.soundMode == SOUNDMODE_HEADSET)) {
halfPanIndex = pan >> 1;
if (halfPanIndex > 0x3F) {
halfPanIndex = 0x3F;
}
noteSubEu->headsetPanLeft = gHeadsetPanQuantization[halfPanIndex];
noteSubEu->headsetPanRight = gHeadsetPanQuantization[0x3F - halfPanIndex];
noteSubEu->bitField1.usesHeadsetPanEffects2 = true;
sampleState->haasEffectRightDelaySize = gHaasEffectDelaySize[halfPanIndex];
sampleState->haasEffectLeftDelaySize = gHaasEffectDelaySize[0x3F - halfPanIndex];
sampleState->bitField1.useHaasEffect = true;
volLeft = gHeadsetPanVolume[pan];
volRight = gHeadsetPanVolume[0x7F - pan];
} else if (stereoHeadsetEffects && (gAudioContext.soundMode == SOUNDMODE_STEREO)) {
strongLeft = strongRight = false;
noteSubEu->headsetPanRight = 0;
noteSubEu->headsetPanLeft = 0;
noteSubEu->bitField1.usesHeadsetPanEffects2 = false;
sampleState->haasEffectLeftDelaySize = 0;
sampleState->haasEffectRightDelaySize = 0;
sampleState->bitField1.useHaasEffect = false;
volLeft = gStereoPanVolume[pan];
volRight = gStereoPanVolume[0x7F - pan];
@ -62,37 +62,37 @@ void AudioPlayback_InitNoteSub(Note* note, NoteSubEu* noteSubEu, NoteSubAttribut
}
// case 0:
noteSubEu->bitField0.stereoStrongRight = strongRight;
noteSubEu->bitField0.stereoStrongLeft = strongLeft;
sampleState->bitField0.strongRight = strongRight;
sampleState->bitField0.strongLeft = strongLeft;
switch (stereoData.bit2) {
switch (stereoData.type) {
case 0:
break;
case 1:
noteSubEu->bitField0.stereoStrongRight = stereoData.strongRight;
noteSubEu->bitField0.stereoStrongLeft = stereoData.strongLeft;
sampleState->bitField0.strongRight = stereoData.strongRight;
sampleState->bitField0.strongLeft = stereoData.strongLeft;
break;
case 2:
noteSubEu->bitField0.stereoStrongRight = stereoData.strongRight | strongRight;
noteSubEu->bitField0.stereoStrongLeft = stereoData.strongLeft | strongLeft;
sampleState->bitField0.strongRight = stereoData.strongRight | strongRight;
sampleState->bitField0.strongLeft = stereoData.strongLeft | strongLeft;
break;
case 3:
noteSubEu->bitField0.stereoStrongRight = stereoData.strongRight ^ strongRight;
noteSubEu->bitField0.stereoStrongLeft = stereoData.strongLeft ^ strongLeft;
sampleState->bitField0.strongRight = stereoData.strongRight ^ strongRight;
sampleState->bitField0.strongLeft = stereoData.strongLeft ^ strongLeft;
break;
}
} else if (gAudioContext.soundMode == SOUNDMODE_MONO) {
noteSubEu->bitField0.stereoHeadsetEffects = false;
noteSubEu->bitField0.usesHeadsetPanEffects = false;
sampleState->bitField0.strongReverbRight = false;
sampleState->bitField0.strongReverbLeft = false;
volLeft = 0.707f; // approx 1/sqrt(2)
volRight = 0.707f;
} else {
noteSubEu->bitField0.stereoStrongRight = stereoData.strongRight;
noteSubEu->bitField0.stereoStrongLeft = stereoData.strongLeft;
sampleState->bitField0.strongRight = stereoData.strongRight;
sampleState->bitField0.strongLeft = stereoData.strongLeft;
volLeft = gDefaultPanVolume[pan];
volRight = gDefaultPanVolume[0x7F - pan];
}
@ -100,33 +100,33 @@ void AudioPlayback_InitNoteSub(Note* note, NoteSubEu* noteSubEu, NoteSubAttribut
vel = 0.0f > vel ? 0.0f : vel;
vel = 1.0f < vel ? 1.0f : vel;
noteSubEu->targetVolLeft = (s32)((vel * volLeft) * (0x1000 - 0.001f));
noteSubEu->targetVolRight = (s32)((vel * volRight) * (0x1000 - 0.001f));
sampleState->targetVolLeft = (s32)((vel * volLeft) * (0x1000 - 0.001f));
sampleState->targetVolRight = (s32)((vel * volRight) * (0x1000 - 0.001f));
noteSubEu->gain = subAttrs->gain;
noteSubEu->filter = subAttrs->filter;
noteSubEu->unk_07 = subAttrs->unk_14;
noteSubEu->unk_0E = subAttrs->unk_16;
noteSubEu->reverbVol = reverbVol;
noteSubEu->unk_19 = subAttrs->unk_3;
sampleState->gain = subAttrs->gain;
sampleState->filter = subAttrs->filter;
sampleState->combFilterSize = subAttrs->combFilterSize;
sampleState->combFilterGain = subAttrs->combFilterGain;
sampleState->targetReverbVol = targetReverbVol;
sampleState->surroundEffectIndex = subAttrs->surroundEffectIndex;
}
void AudioPlayback_NoteSetResamplingRate(NoteSubEu* noteSubEu, f32 resamplingRateInput) {
void AudioPlayback_NoteSetResamplingRate(NoteSampleState* sampleState, f32 resamplingRateInput) {
f32 resamplingRate = 0.0f;
if (resamplingRateInput < 2.0f) {
noteSubEu->bitField1.hasTwoParts = false;
sampleState->bitField1.hasTwoParts = false;
resamplingRate = CLAMP_MAX(resamplingRateInput, 1.99998f);
} else {
noteSubEu->bitField1.hasTwoParts = true;
sampleState->bitField1.hasTwoParts = true;
if (resamplingRateInput > 3.99996f) {
resamplingRate = 1.99998f;
} else {
resamplingRate = resamplingRateInput * 0.5f;
}
}
noteSubEu->resamplingRateFixedPoint = (s32)(resamplingRate * 32768.0f);
sampleState->frequencyFixedPoint = (s32)(resamplingRate * 32768.0f);
}
void AudioPlayback_NoteInit(Note* note) {
@ -140,17 +140,17 @@ void AudioPlayback_NoteInit(Note* note) {
note->playbackState.status = PLAYBACK_STATUS_0;
note->playbackState.adsr.action.s.state = ADSR_STATE_INITIAL;
note->noteSubEu = gDefaultNoteSub;
note->sampleState = gDefaultSampleState;
}
void AudioPlayback_NoteDisable(Note* note) {
if (note->noteSubEu.bitField0.needsInit == true) {
note->noteSubEu.bitField0.needsInit = false;
if (note->sampleState.bitField0.needsInit == true) {
note->sampleState.bitField0.needsInit = false;
}
note->playbackState.priority = 0;
note->noteSubEu.bitField0.enabled = false;
note->sampleState.bitField0.enabled = false;
note->playbackState.status = PLAYBACK_STATUS_0;
note->noteSubEu.bitField0.finished = false;
note->sampleState.bitField0.finished = false;
note->playbackState.parentLayer = NO_LAYER;
note->playbackState.prevParentLayer = NO_LAYER;
note->playbackState.adsr.action.s.state = ADSR_STATE_DISABLED;
@ -161,8 +161,8 @@ void AudioPlayback_ProcessNotes(void) {
s32 pad;
s32 playbackStatus;
NoteAttributes* attrs;
NoteSubEu* noteSubEu2;
NoteSubEu* noteSubEu;
NoteSampleState* sampleState;
NoteSampleState* noteSampleState;
Note* note;
NotePlaybackState* playbackState;
NoteSubAttributes subAttrs;
@ -172,7 +172,7 @@ void AudioPlayback_ProcessNotes(void) {
for (i = 0; i < gAudioContext.numNotes; i++) {
note = &gAudioContext.notes[i];
noteSubEu2 = &gAudioContext.noteSubsEu[gAudioContext.noteSubEuOffset + i];
sampleState = &gAudioContext.sampleStateList[gAudioContext.sampleStateOffset + i];
playbackState = &note->playbackState;
if (playbackState->parentLayer != NO_LAYER) {
if ((u32)playbackState->parentLayer < 0x7FFFFFFF) {
@ -211,10 +211,12 @@ void AudioPlayback_ProcessNotes(void) {
out:
if (playbackState->priority != 0) {
//! FAKE:
if (1) {}
noteSubEu = &note->noteSubEu;
if ((playbackState->status >= 1) || noteSubEu->bitField0.finished) {
if ((playbackState->adsr.action.s.state == ADSR_STATE_DISABLED) || noteSubEu->bitField0.finished) {
noteSampleState = &note->sampleState;
if ((playbackState->status >= 1) || noteSampleState->bitField0.finished) {
if ((playbackState->adsr.action.s.state == ADSR_STATE_DISABLED) ||
noteSampleState->bitField0.finished) {
if (playbackState->wantedParentLayer != NO_LAYER) {
AudioPlayback_NoteDisable(note);
if (playbackState->wantedParentLayer->channel != NULL) {
@ -260,14 +262,14 @@ void AudioPlayback_ProcessNotes(void) {
subAttrs.frequency = attrs->freqScale;
subAttrs.velocity = attrs->velocity;
subAttrs.pan = attrs->pan;
subAttrs.reverbVol = attrs->reverb;
subAttrs.stereo = attrs->stereo;
subAttrs.targetReverbVol = attrs->targetReverbVol;
subAttrs.stereoData = attrs->stereoData;
subAttrs.gain = attrs->gain;
subAttrs.filter = attrs->filter;
subAttrs.unk_14 = attrs->unk_4;
subAttrs.unk_16 = attrs->unk_6;
subAttrs.unk_3 = attrs->unk_3;
bookOffset = noteSubEu->bitField1.bookOffset;
subAttrs.combFilterSize = attrs->combFilterSize;
subAttrs.combFilterGain = attrs->combFilterGain;
subAttrs.surroundEffectIndex = attrs->surroundEffectIndex;
bookOffset = noteSampleState->bitField1.bookOffset;
} else {
SequenceLayer* layer = playbackState->parentLayer;
SequenceChannel* channel = playbackState->parentLayer->channel;
@ -276,34 +278,35 @@ void AudioPlayback_ProcessNotes(void) {
subAttrs.velocity = layer->noteVelocity;
subAttrs.pan = layer->notePan;
if (layer->unk_08 == 0x80) {
subAttrs.unk_3 = channel->unk_10;
if (layer->surroundEffectIndex == 0x80) {
subAttrs.surroundEffectIndex = channel->surroundEffectIndex;
} else {
subAttrs.unk_3 = layer->unk_08;
subAttrs.surroundEffectIndex = layer->surroundEffectIndex;
}
if (layer->stereo.s.bit2 == 0) {
subAttrs.stereo = channel->stereo;
if (layer->stereoData.type == 0) {
subAttrs.stereoData = channel->stereoData;
} else {
subAttrs.stereo = layer->stereo;
subAttrs.stereoData = layer->stereoData;
}
if (layer->unk_0A.s.bit_2 == 1) {
subAttrs.reverbVol = channel->reverb;
subAttrs.targetReverbVol = channel->targetReverbVol;
} else {
subAttrs.reverbVol = layer->unk_09;
subAttrs.targetReverbVol = layer->targetReverbVol;
}
if (layer->unk_0A.s.bit_9 == 1) {
subAttrs.gain = channel->gain;
} else {
subAttrs.gain = 0;
//! FAKE:
if (1) {}
}
subAttrs.filter = channel->filter;
subAttrs.unk_14 = channel->unk_0F;
subAttrs.unk_16 = channel->unk_20;
subAttrs.combFilterSize = channel->combFilterSize;
subAttrs.combFilterGain = channel->combFilterGain;
bookOffset = channel->bookOffset & 0x7;
if (channel->seqPlayer->muted && (channel->muteFlags & MUTE_FLAGS_3)) {
@ -315,8 +318,8 @@ void AudioPlayback_ProcessNotes(void) {
subAttrs.frequency *= playbackState->vibratoFreqScale * playbackState->portamentoFreqScale;
subAttrs.frequency *= gAudioContext.audioBufferParameters.resampleRate;
subAttrs.velocity *= scale;
AudioPlayback_InitNoteSub(note, noteSubEu2, &subAttrs);
noteSubEu->bitField1.bookOffset = bookOffset;
AudioPlayback_InitSampleState(note, sampleState, &subAttrs);
noteSampleState->bitField1.bookOffset = bookOffset;
skip:;
}
}
@ -500,15 +503,15 @@ void AudioPlayback_SeqLayerDecayRelease(SequenceLayer* layer, s32 target) {
channel = layer->channel;
if (layer->unk_0A.s.bit_2 == 1) {
attrs->reverb = channel->reverb;
attrs->targetReverbVol = channel->targetReverbVol;
} else {
attrs->reverb = layer->unk_09;
attrs->targetReverbVol = layer->targetReverbVol;
}
if (layer->unk_08 == 0x80) {
attrs->unk_3 = channel->unk_10;
if (layer->surroundEffectIndex == 0x80) {
attrs->surroundEffectIndex = channel->surroundEffectIndex;
} else {
attrs->unk_3 = layer->unk_08;
attrs->surroundEffectIndex = layer->surroundEffectIndex;
}
if (layer->unk_0A.s.bit_9 == 1) {
@ -526,20 +529,20 @@ void AudioPlayback_SeqLayerDecayRelease(SequenceLayer* layer, s32 target) {
attrs->filter = attrs->filterBuf;
}
attrs->unk_6 = channel->unk_20;
attrs->unk_4 = channel->unk_0F;
attrs->combFilterGain = channel->combFilterGain;
attrs->combFilterSize = channel->combFilterSize;
if (channel->seqPlayer->muted && (channel->muteFlags & MUTE_FLAGS_3)) {
note->noteSubEu.bitField0.finished = true;
note->sampleState.bitField0.finished = true;
}
if (layer->stereo.asByte == 0) {
attrs->stereo = channel->stereo;
if (layer->stereoData.asByte == 0) {
attrs->stereoData = channel->stereoData;
} else {
attrs->stereo = layer->stereo;
attrs->stereoData = layer->stereoData;
}
note->playbackState.priority = channel->someOtherPriority;
} else {
attrs->stereo = layer->stereo;
attrs->stereoData = layer->stereoData;
note->playbackState.priority = 1;
}
@ -620,7 +623,7 @@ s32 AudioPlayback_BuildSyntheticWave(Note* note, SequenceLayer* layer, s32 waveI
// Save the pointer to the synthethic wave
// waveId index starts at 128, there are WAVE_SAMPLE_COUNT samples to read from
note->noteSubEu.waveSampleAddr = &gWaveSamples[waveId - 128][harmonicIndex * WAVE_SAMPLE_COUNT];
note->sampleState.waveSampleAddr = &gWaveSamples[waveId - 128][harmonicIndex * WAVE_SAMPLE_COUNT];
return harmonicIndex;
}
@ -638,7 +641,7 @@ void AudioPlayback_InitSyntheticWave(Note* note, SequenceLayer* layer) {
curHarmonicIndex = AudioPlayback_BuildSyntheticWave(note, layer, waveId);
if (curHarmonicIndex != prevHarmonicIndex) {
note->noteSubEu.harmonicIndexCurAndPrev = (curHarmonicIndex << 2) + prevHarmonicIndex;
note->sampleState.harmonicIndexCurAndPrev = (curHarmonicIndex << 2) + prevHarmonicIndex;
}
}
@ -808,7 +811,7 @@ void AudioPlayback_NoteInitForLayer(Note* note, SequenceLayer* layer) {
s16 instId;
SequenceChannel* channel = layer->channel;
NotePlaybackState* playbackState = &note->playbackState;
NoteSubEu* noteSubEu = &note->noteSubEu;
NoteSampleState* noteSampleState = &note->sampleState;
playbackState->prevParentLayer = NO_LAYER;
playbackState->parentLayer = layer;
@ -825,28 +828,28 @@ void AudioPlayback_NoteInitForLayer(Note* note, SequenceLayer* layer) {
if (instId == 0xFF) {
instId = channel->instOrWave;
}
noteSubEu->tunedSample = layer->tunedSample;
noteSampleState->tunedSample = layer->tunedSample;
if (instId >= 0x80 && instId < 0xC0) {
noteSubEu->bitField1.isSyntheticWave = true;
noteSampleState->bitField1.isSyntheticWave = true;
} else {
noteSubEu->bitField1.isSyntheticWave = false;
noteSampleState->bitField1.isSyntheticWave = false;
}
if (noteSubEu->bitField1.isSyntheticWave) {
if (noteSampleState->bitField1.isSyntheticWave) {
AudioPlayback_BuildSyntheticWave(note, layer, instId);
} else if (channel->startSamplePos == 1) {
playbackState->startSamplePos = noteSubEu->tunedSample->sample->loop->start;
playbackState->startSamplePos = noteSampleState->tunedSample->sample->loop->start;
} else {
playbackState->startSamplePos = channel->startSamplePos;
if (playbackState->startSamplePos >= noteSubEu->tunedSample->sample->loop->end) {
if (playbackState->startSamplePos >= noteSampleState->tunedSample->sample->loop->loopEnd) {
playbackState->startSamplePos = 0;
}
}
playbackState->fontId = channel->fontId;
playbackState->stereoHeadsetEffects = channel->stereoHeadsetEffects;
noteSubEu->bitField1.reverbIndex = channel->reverbIndex & 3;
noteSampleState->bitField1.reverbIndex = channel->reverbIndex & 3;
}
void func_801963E8(Note* note, SequenceLayer* layer) {
@ -987,7 +990,7 @@ void AudioPlayback_NoteInitAll(void) {
for (i = 0; i < gAudioContext.numNotes; i++) {
note = &gAudioContext.notes[i];
note->noteSubEu = gZeroNoteSub;
note->sampleState = gZeroedSampleState;
note->playbackState.priority = 0;
note->playbackState.status = PLAYBACK_STATUS_0;
note->playbackState.parentLayer = NO_LAYER;
@ -1002,7 +1005,8 @@ void AudioPlayback_NoteInitAll(void) {
note->playbackState.portamento.speed = 0;
note->playbackState.stereoHeadsetEffects = false;
note->playbackState.startSamplePos = 0;
note->synthesisState.synthesisBuffers = AudioHeap_AllocDmaMemory(&gAudioContext.miscPool, 0x2E0);
note->playbackState.attributes.filterBuf = AudioHeap_AllocDmaMemory(&gAudioContext.miscPool, 0x10);
note->synthesisState.synthesisBuffers =
AudioHeap_AllocDmaMemory(&gAudioContext.miscPool, sizeof(NoteSynthesisBuffers));
note->playbackState.attributes.filterBuf = AudioHeap_AllocDmaMemory(&gAudioContext.miscPool, FILTER_SIZE);
}
}

View File

@ -282,17 +282,17 @@ void AudioSeq_InitSequenceChannel(SequenceChannel* channel) {
channel->transposition = 0;
channel->largeNotes = false;
channel->bookOffset = 0;
channel->stereo.asByte = 0;
channel->stereoData.asByte = 0;
channel->changes.asByte = 0xFF;
channel->scriptState.depth = 0;
channel->newPan = 0x40;
channel->panChannelWeight = 0x80;
channel->unk_10 = 0xFF;
channel->surroundEffectIndex = 0xFF;
channel->velocityRandomVariance = 0;
channel->gateTimeRandomVariance = 0;
channel->noteUnused = NULL;
channel->reverbIndex = 0;
channel->reverb = 0;
channel->targetReverbVol = 0;
channel->gain = 0;
channel->notePriority = 3;
channel->someOtherPriority = 1;
@ -308,8 +308,8 @@ void AudioSeq_InitSequenceChannel(SequenceChannel* channel) {
channel->vibrato.vibratoExtentChangeDelay = 0;
channel->vibrato.vibratoDelay = 0;
channel->filter = NULL;
channel->unk_20 = 0;
channel->unk_0F = 0;
channel->combFilterGain = 0;
channel->combFilterSize = 0;
channel->volume = 1.0f;
channel->volumeScale = 1.0f;
channel->freqScale = 1.0f;
@ -345,7 +345,7 @@ s32 AudioSeq_SeqChannelSetLayer(SequenceChannel* channel, s32 layerIndex) {
layer->channel = channel;
layer->adsr = channel->adsr;
layer->adsr.decayIndex = 0;
layer->unk_09 = channel->reverb;
layer->targetReverbVol = channel->targetReverbVol;
layer->enabled = true;
layer->finished = false;
layer->stopSomething = false;
@ -355,8 +355,8 @@ s32 AudioSeq_SeqChannelSetLayer(SequenceChannel* channel, s32 layerIndex) {
layer->bit1 = false;
layer->notePropertiesNeedInit = false;
layer->gateTime = 0x80;
layer->unk_08 = 0x80;
layer->stereo.asByte = 0;
layer->surroundEffectIndex = 0x80;
layer->stereoData.asByte = 0;
layer->portamento.mode = PORTAMENTO_MODE_OFF;
layer->scriptState.depth = 0;
layer->pan = 0x40;
@ -782,7 +782,7 @@ s32 AudioSeq_SeqLayerProcessScriptStep2(SequenceLayer* layer) {
break;
case 0xCD: // layer: stereo effects
layer->stereo.asByte = AudioSeq_ScriptReadU8(state);
layer->stereoData.asByte = AudioSeq_ScriptReadU8(state);
break;
case 0xCE: // layer: bend pitch
@ -796,7 +796,7 @@ s32 AudioSeq_SeqLayerProcessScriptStep2(SequenceLayer* layer) {
break;
case 0xF1: // layer:
layer->unk_08 = AudioSeq_ScriptReadU8(state);
layer->surroundEffectIndex = AudioSeq_ScriptReadU8(state);
break;
default:
@ -991,13 +991,14 @@ s32 AudioSeq_SeqLayerProcessScriptStep4(SequenceLayer* layer, s32 cmd) {
if (layer->delay == 0) {
if (layer->tunedSample != NULL) {
time = layer->tunedSample->sample->loop->end;
time = layer->tunedSample->sample->loop->loopEnd;
} else {
time = 0.0f;
}
time *= seqPlayer->tempo;
time *= gAudioContext.unk_2870;
time /= layer->freqScale;
//! FAKE:
if (1) {}
if (time > 0x7FFE) {
time = 0x7FFE;
@ -1416,9 +1417,9 @@ void AudioSeq_SequenceChannelProcessScript(SequenceChannel* channel) {
channel->vibrato.vibratoDelay = cmd * 16;
break;
case 0xD4: // channel: set reverb
case 0xD4: // channel: set reverb volume
cmd = (u8)cmdArgs[0];
channel->reverb = cmd;
channel->targetReverbVol = cmd;
break;
case 0xC6: // channel: set soundFont
@ -1491,7 +1492,7 @@ void AudioSeq_SequenceChannelProcessScript(SequenceChannel* channel) {
} else {
channel->stereoHeadsetEffects = false;
}
channel->stereo.asByte = cmd & 0x7F;
channel->stereoData.asByte = cmd & 0x7F;
break;
case 0xD1: // channel: set note allocation policy
@ -1537,7 +1538,7 @@ void AudioSeq_SequenceChannelProcessScript(SequenceChannel* channel) {
data += 4;
channel->newPan = data[-3];
channel->panChannelWeight = data[-2];
channel->reverb = data[-1];
channel->targetReverbVol = data[-1];
channel->reverbIndex = data[0];
//! @bug: Not marking reverb state as changed
channel->changes.s.pan = true;
@ -1551,7 +1552,7 @@ void AudioSeq_SequenceChannelProcessScript(SequenceChannel* channel) {
channel->transposition = (s8)AudioSeq_ScriptReadU8(scriptState);
channel->newPan = AudioSeq_ScriptReadU8(scriptState);
channel->panChannelWeight = AudioSeq_ScriptReadU8(scriptState);
channel->reverb = AudioSeq_ScriptReadU8(scriptState);
channel->targetReverbVol = AudioSeq_ScriptReadU8(scriptState);
channel->reverbIndex = AudioSeq_ScriptReadU8(scriptState);
//! @bug: Not marking reverb state as changed
channel->changes.s.pan = true;
@ -1569,8 +1570,8 @@ void AudioSeq_SequenceChannelProcessScript(SequenceChannel* channel) {
channel->adsr.sustain = 0;
channel->velocityRandomVariance = 0;
channel->gateTimeRandomVariance = 0;
channel->unk_0F = 0;
channel->unk_20 = 0;
channel->combFilterSize = 0;
channel->combFilterGain = 0;
channel->bookOffset = 0;
channel->startSamplePos = 0;
channel->unk_E0 = 0;
@ -1651,8 +1652,8 @@ void AudioSeq_SequenceChannelProcessScript(SequenceChannel* channel) {
break;
case 0xBB: // channel:
channel->unk_0F = cmdArgs[0];
channel->unk_20 = cmdArgs[1];
channel->combFilterSize = cmdArgs[0];
channel->combFilterGain = cmdArgs[1];
break;
case 0xBC: // channel: add large
@ -1667,8 +1668,8 @@ void AudioSeq_SequenceChannelProcessScript(SequenceChannel* channel) {
if (cmdArgs[0] < 5) {
if (1) {}
if (gAudioContext.unk_29A8[cmdArgs[0]] != NULL) {
D_80208E6C = gAudioContext.unk_29A8[cmdArgs[0]];
scriptState->value = D_80208E6C(scriptState->value, channel);
gCustomAudioSeqFunction = gAudioContext.unk_29A8[cmdArgs[0]];
scriptState->value = gCustomAudioSeqFunction(scriptState->value, channel);
}
}
break;
@ -1693,7 +1694,7 @@ void AudioSeq_SequenceChannelProcessScript(SequenceChannel* channel) {
break;
case 0xA4: // channel:
channel->unk_10 = cmdArgs[0];
channel->surroundEffectIndex = cmdArgs[0];
break;
case 0xA5: // channel:
@ -2197,7 +2198,7 @@ void AudioSeq_ProcessSequences(s32 arg0) {
SequencePlayer* seqPlayer;
u32 i;
gAudioContext.noteSubEuOffset =
gAudioContext.sampleStateOffset =
(gAudioContext.audioBufferParameters.updatesPerFrame - arg0 - 1) * gAudioContext.numNotes;
for (i = 0; i < (u32)gAudioContext.audioBufferParameters.numSequencePlayers; i++) {

File diff suppressed because it is too large Load Diff

View File

@ -4078,7 +4078,7 @@ void AudioSfx_SetProperties(u8 bankId, u8 entryIndex, u8 channelIndex) {
}
u32 AudioSfx_SetFreqAndStereoBits(u8 seqScriptValIn, SequenceChannel* channel) {
channel->stereo.asByte = sSfxChannelState[seqScriptValIn].stereoBits;
channel->stereoData.asByte = sSfxChannelState[seqScriptValIn].stereoBits;
channel->freqScale = sSfxChannelState[seqScriptValIn].freqScale;
channel->changes.s.freqScale = true;

View File

@ -4,7 +4,6 @@
* Description: Keaton grass
*/
#include "prevent_bss_reordering.h"
#include "z_en_kusa2.h"
#include "objects/gameplay_field_keep/gameplay_field_keep.h"
#include "objects/gameplay_keep/gameplay_keep.h"

View File

@ -597,6 +597,7 @@
0x801D9090 : "audio_sound_params",
0x801DB470 : "code_801A5BD0",
0x801DB4C0 : "code_801A7B10",
0x801DB4E0 : "audio_init_params",
# .rodata section
0x801DBDF0 : "z_en_item00",

View File

@ -3478,74 +3478,74 @@
0x801872FC:("osFlashWriteBuffer",),
0x801873BC:("osFlashWriteArray",),
0x8018752C:("osFlashReadArray",),
0x801877D0:("func_801877D0",),
0x80187B64:("func_80187B64",),
0x80187BEC:("func_80187BEC",),
0x80187DE8:("func_80187DE8",),
0x80187E58:("func_80187E58",),
0x80187F00:("func_80187F00",),
0x80187FA8:("func_80187FA8",),
0x80187FB0:("func_80187FB0",),
0x80187FD0:("func_80187FD0",),
0x80187FD8:("func_80187FD8",),
0x80187FE0:("func_80187FE0",),
0x80187FE8:("func_80187FE8",),
0x8018801C:("func_8018801C",),
0x80188024:("func_80188024",),
0x8018802C:("func_8018802C",),
0x80188034:("func_80188034",),
0x80188068:("func_80188068",),
0x80188070:("func_80188070",),
0x80188078:("func_80188078",),
0x801880A4:("func_801880A4",),
0x801880AC:("func_801880AC",),
0x801880B4:("func_801880B4",),
0x801880BC:("func_801880BC",),
0x801880C4:("func_801880C4",),
0x801880E8:("func_801880E8",),
0x8018811C:("func_8018811C",),
0x80188124:("func_80188124",),
0x8018814C:("func_8018814C",),
0x80188174:("func_80188174",),
0x80188190:("func_80188190",),
0x80188198:("func_80188198",),
0x801881A0:("func_801881A0",),
0x801881A8:("func_801881A8",),
0x801881C4:("func_801881C4",),
0x801881F8:("func_801881F8",),
0x80188224:("func_80188224",),
0x8018822C:("func_8018822C",),
0x80188234:("func_80188234",),
0x8018823C:("func_8018823C",),
0x80188244:("func_80188244",),
0x8018824C:("func_8018824C",),
0x80188254:("func_80188254",),
0x8018825C:("func_8018825C",),
0x80188264:("func_80188264",),
0x80188288:("func_80188288",),
0x801882A0:("func_801882A0",),
0x80188304:("func_80188304",),
0x801884A0:("func_801884A0",),
0x80188698:("func_80188698",),
0x8018883C:("func_8018883C",),
0x801888E4:("func_801888E4",),
0x801889A4:("func_801889A4",),
0x80188A50:("func_80188A50",),
0x80188AFC:("func_80188AFC",),
0x80188C48:("func_80188C48",),
0x80188CB4:("func_80188CB4",),
0x80188D20:("func_80188D20",),
0x80188D28:("func_80188D28",),
0x80188D68:("func_80188D68",),
0x80188DDC:("func_80188DDC",),
0x80188FBC:("func_80188FBC",),
0x80189064:("func_80189064",),
0x80189620:("func_80189620",),
0x8018A4B4:("func_8018A4B4",),
0x8018A768:("func_8018A768",),
0x8018A808:("func_8018A808",),
0x8018ACC4:("func_8018ACC4",),
0x8018AE34:("func_8018AE34",),
0x801877D0:("AudioSynth_AddReverbBufferEntry",),
0x80187B64:("AudioSynth_SyncSampleStates",),
0x80187BEC:("AudioSynth_Update",),
0x80187DE8:("AudioSynth_DisableSampleStates",),
0x80187E58:("AudioSynth_LoadMixedReverbSamples",),
0x80187F00:("AudioSynth_SaveMixedReverbSamples",),
0x80187FA8:("AudioSynth_Noop1",),
0x80187FB0:("AudioSynth_ClearBuffer",),
0x80187FD0:("AudioSynth_Noop2",),
0x80187FD8:("AudioSynth_Noop3",),
0x80187FE0:("AudioSynth_Noop4",),
0x80187FE8:("AudioSynth_Mix",),
0x8018801C:("AudioSynth_Noop5",),
0x80188024:("AudioSynth_Noop6",),
0x8018802C:("AudioSynth_Noop7",),
0x80188034:("AudioSynth_SetBuffer",),
0x80188068:("AudioSynth_Noop8",),
0x80188070:("AudioSynth_Noop9",),
0x80188078:("AudioSynth_DMemMove",),
0x801880A4:("AudioSynth_Noop10",),
0x801880AC:("AudioSynth_Noop11",),
0x801880B4:("AudioSynth_Noop12",),
0x801880BC:("AudioSynth_Noop13",),
0x801880C4:("AudioSynth_InterL",),
0x801880E8:("AudioSynth_EnvSetup1",),
0x8018811C:("AudioSynth_Noop14",),
0x80188124:("AudioSynth_LoadBuffer",),
0x8018814C:("AudioSynth_SaveBuffer",),
0x80188174:("AudioSynth_EnvSetup2",),
0x80188190:("AudioSynth_Noop15",),
0x80188198:("AudioSynth_Noop16",),
0x801881A0:("AudioSynth_Noop17",),
0x801881A8:("AudioSynth_S8Dec",),
0x801881C4:("AudioSynth_HiLoGain",),
0x801881F8:("AudioSynth_UnkCmd19",),
0x80188224:("AudioSynth_Noop18",),
0x8018822C:("AudioSynth_Noop19",),
0x80188234:("AudioSynth_Noop20",),
0x8018823C:("AudioSynth_Noop21",),
0x80188244:("AudioSynth_Noop22",),
0x8018824C:("AudioSynth_Noop23",),
0x80188254:("AudioSynth_Noop24",),
0x8018825C:("AudioSynth_Noop25",),
0x80188264:("AudioSynth_LoadFilterBuffer",),
0x80188288:("AudioSynth_LoadFilterSize",),
0x801882A0:("AudioSynth_LeakReverb",),
0x80188304:("AudioSynth_LoadDownsampledReverbSamples",),
0x801884A0:("AudioSynth_SaveResampledReverbSamples",),
0x80188698:("AudioSynth_LoadResampledReverbSamples",),
0x8018883C:("AudioSynth_FilterReverb",),
0x801888E4:("AudioSynth_MixOtherReverbIndex",),
0x801889A4:("AudioSynth_LoadDefaultReverbSamples",),
0x80188A50:("AudioSynth_LoadSubReverbSamples",),
0x80188AFC:("AudioSynth_SaveResampledReverbSamplesImpl",),
0x80188C48:("AudioSynth_LoadReverbSamplesImpl",),
0x80188CB4:("AudioSynth_SaveReverbSamplesImpl",),
0x80188D20:("AudioSynth_Noop26",),
0x80188D28:("AudioSynth_LoadSubReverbSamplesWithoutDownsample",),
0x80188D68:("AudioSynth_LoadReverbSamples",),
0x80188DDC:("AudioSynth_SaveReverbSamples",),
0x80188FBC:("AudioSynth_SaveSubReverbSamples",),
0x80189064:("AudioSynth_ProcessSamples",),
0x80189620:("AudioSynth_ProcessSample",),
0x8018A4B4:("AudioSynth_ApplySurroundEffect",),
0x8018A768:("AudioSynth_FinalResample",),
0x8018A808:("AudioSynth_ProcessEnvelope",),
0x8018ACC4:("AudioSynth_LoadWaveSamples",),
0x8018AE34:("AudioSynth_ApplyHaasEffect",),
0x8018B0F0:("AudioHeap_CalculateAdsrDecay",),
0x8018B10C:("AudioHeap_InitAdsrDecayTable",),
0x8018B250:("AudioHeap_ResetLoadStatus",),
@ -3726,7 +3726,7 @@
0x80194804:("func_80194804",),
0x80194840:("func_80194840",),
0x801948B0:("func_801948B0",),
0x80194930:("AudioPlayback_InitNoteSub",),
0x80194930:("AudioPlayback_InitSampleState",),
0x80194DB0:("AudioPlayback_NoteSetResamplingRate",),
0x80194E60:("AudioPlayback_NoteInit",),
0x80194F20:("AudioPlayback_NoteDisable",),

View File

@ -2220,11 +2220,11 @@
0x801D57B4:("gDefaultShortNoteVelocityTable","UNK_TYPE1","",0x1),
0x801D57C4:("gDefaultShortNoteGateTimeTable","UNK_TYPE1","",0x1),
0x801D57D4:("gDefaultEnvelope","UNK_TYPE1","",0x1),
0x801D57E4:("gZeroNoteSub","UNK_TYPE4","",0x4),
0x801D5804:("gDefaultNoteSub","UNK_TYPE4","",0x4),
0x801D5824:("gHeadsetPanQuantization","u16","[64]",0x80),
0x801D57E4:("gZeroedSampleState","UNK_TYPE4","",0x4),
0x801D5804:("gDefaultSampleState","UNK_TYPE4","",0x4),
0x801D5824:("gHaasEffectDelaySize","u16","[64]",0x80),
0x801D58A4:("D_801D58A4","s32","",0x4),
0x801D58A8:("D_801D58A8","s16","[64]",0x80),
0x801D58A8:("gInvalidAdpcmCodeBook","s16","[64]",0x80),
0x801D5928:("gHeadsetPanVolume","f32","[128]",0x200),
0x801D5B28:("gStereoPanVolume","f32","[128]",0x200),
0x801D5D28:("gDefaultPanVolume","f32","[128]",0x200),
@ -2411,7 +2411,7 @@
0x801DB870:("D_801DB870","UNK_TYPE1","",0x1),
0x801DB8B8:("D_801DB8B8","UNK_TYPE1","",0x1),
0x801DB900:("D_801DB900","UNK_TYPE1","",0x1),
0x801DB930:("D_801DB930","UNK_PTR","",0x4),
0x801DB930:("gReverbSettingsTable","UNK_PTR","",0x4),
0x801DB958:("gAudioSpecs","AudioSpec","[21]",0x498),
0x801DBDF0:("D_801DBDF0","f32","",0x4),
0x801DBDF4:("jtbl_801DBDF4","UNK_PTR","",0x4),
@ -4354,10 +4354,10 @@
0x80200BCE:("D_80200BCE","UNK_TYPE1","",0x1),
0x80200BD0:("D_80200BD0","UNK_TYPE1","",0x1),
0x80200C70:("gAudioContext","AudioContext","",0x81F8),
0x80208E68:("D_80208E68","UNK_TYPE4","",0x4),
0x80208E6C:("D_80208E6C","UNK_TYPE4","",0x4),
0x80208E70:("D_80208E70","UNK_TYPE4","",0x4),
0x80208E74:("D_80208E74","UNK_TYPE4","",0x4),
0x80208E68:("gCustomAudioUpdateFunction","UNK_TYPE4","",0x4),
0x80208E6C:("gCustomAudioSeqFunction","UNK_TYPE4","",0x4),
0x80208E70:("gCustomAudioReverbFunction","UNK_TYPE4","",0x4),
0x80208E74:("gCustomAudioSynthFunction","UNK_TYPE4","",0x4),
0x80208E90:("sJpegBitStreamPtr","UNK_TYPE1","",0x1),
0x80208E94:("sJpegBitStreamByteIdx","UNK_TYPE1","",0x1),
0x80208E98:("sJpegBitStreamBitIdx","UNK_TYPE1","",0x1),

View File

@ -2996,74 +2996,74 @@ asm/non_matchings/code/osFlash/func_80187284.s,func_80187284,0x80187284,0x1E
asm/non_matchings/code/osFlash/func_801872FC.s,func_801872FC,0x801872FC,0x30
asm/non_matchings/code/osFlash/func_801873BC.s,func_801873BC,0x801873BC,0x5C
asm/non_matchings/code/osFlash/func_8018752C.s,func_8018752C,0x8018752C,0x9D
asm/non_matchings/code/audio_synthesis/func_801877D0.s,func_801877D0,0x801877D0,0xE5
asm/non_matchings/code/audio_synthesis/func_80187B64.s,func_80187B64,0x80187B64,0x22
asm/non_matchings/code/audio_synthesis/func_80187BEC.s,func_80187BEC,0x80187BEC,0x7F
asm/non_matchings/code/audio_synthesis/func_80187DE8.s,func_80187DE8,0x80187DE8,0x1C
asm/non_matchings/code/audio_synthesis/func_80187E58.s,func_80187E58,0x80187E58,0x2A
asm/non_matchings/code/audio_synthesis/func_80187F00.s,func_80187F00,0x80187F00,0x2A
asm/non_matchings/code/audio_synthesis/func_80187FA8.s,func_80187FA8,0x80187FA8,0x2
asm/non_matchings/code/audio_synthesis/func_80187FB0.s,func_80187FB0,0x80187FB0,0x8
asm/non_matchings/code/audio_synthesis/func_80187FD0.s,func_80187FD0,0x80187FD0,0x2
asm/non_matchings/code/audio_synthesis/func_80187FD8.s,func_80187FD8,0x80187FD8,0x2
asm/non_matchings/code/audio_synthesis/func_80187FE0.s,func_80187FE0,0x80187FE0,0x2
asm/non_matchings/code/audio_synthesis/func_80187FE8.s,func_80187FE8,0x80187FE8,0xD
asm/non_matchings/code/audio_synthesis/func_8018801C.s,func_8018801C,0x8018801C,0x2
asm/non_matchings/code/audio_synthesis/func_80188024.s,func_80188024,0x80188024,0x2
asm/non_matchings/code/audio_synthesis/func_8018802C.s,func_8018802C,0x8018802C,0x2
asm/non_matchings/code/audio_synthesis/func_80188034.s,func_80188034,0x80188034,0xD
asm/non_matchings/code/audio_synthesis/func_80188068.s,func_80188068,0x80188068,0x2
asm/non_matchings/code/audio_synthesis/func_80188070.s,func_80188070,0x80188070,0x2
asm/non_matchings/code/audio_synthesis/func_80188078.s,func_80188078,0x80188078,0xB
asm/non_matchings/code/audio_synthesis/func_801880A4.s,func_801880A4,0x801880A4,0x2
asm/non_matchings/code/audio_synthesis/func_801880AC.s,func_801880AC,0x801880AC,0x2
asm/non_matchings/code/audio_synthesis/func_801880B4.s,func_801880B4,0x801880B4,0x2
asm/non_matchings/code/audio_synthesis/func_801880BC.s,func_801880BC,0x801880BC,0x2
asm/non_matchings/code/audio_synthesis/func_801880C4.s,func_801880C4,0x801880C4,0x9
asm/non_matchings/code/audio_synthesis/func_801880E8.s,func_801880E8,0x801880E8,0xD
asm/non_matchings/code/audio_synthesis/func_8018811C.s,func_8018811C,0x8018811C,0x2
asm/non_matchings/code/audio_synthesis/func_80188124.s,func_80188124,0x80188124,0xA
asm/non_matchings/code/audio_synthesis/func_8018814C.s,func_8018814C,0x8018814C,0xA
asm/non_matchings/code/audio_synthesis/func_80188174.s,func_80188174,0x80188174,0x7
asm/non_matchings/code/audio_synthesis/func_80188190.s,func_80188190,0x80188190,0x2
asm/non_matchings/code/audio_synthesis/func_80188198.s,func_80188198,0x80188198,0x2
asm/non_matchings/code/audio_synthesis/func_801881A0.s,func_801881A0,0x801881A0,0x2
asm/non_matchings/code/audio_synthesis/func_801881A8.s,func_801881A8,0x801881A8,0x7
asm/non_matchings/code/audio_synthesis/func_801881C4.s,func_801881C4,0x801881C4,0xD
asm/non_matchings/code/audio_synthesis/func_801881F8.s,func_801881F8,0x801881F8,0xB
asm/non_matchings/code/audio_synthesis/func_80188224.s,func_80188224,0x80188224,0x2
asm/non_matchings/code/audio_synthesis/func_8018822C.s,func_8018822C,0x8018822C,0x2
asm/non_matchings/code/audio_synthesis/func_80188234.s,func_80188234,0x80188234,0x2
asm/non_matchings/code/audio_synthesis/func_8018823C.s,func_8018823C,0x8018823C,0x2
asm/non_matchings/code/audio_synthesis/func_80188244.s,func_80188244,0x80188244,0x2
asm/non_matchings/code/audio_synthesis/func_8018824C.s,func_8018824C,0x8018824C,0x2
asm/non_matchings/code/audio_synthesis/func_80188254.s,func_80188254,0x80188254,0x2
asm/non_matchings/code/audio_synthesis/func_8018825C.s,func_8018825C,0x8018825C,0x2
asm/non_matchings/code/audio_synthesis/func_80188264.s,func_80188264,0x80188264,0x9
asm/non_matchings/code/audio_synthesis/func_80188288.s,func_80188288,0x80188288,0x6
asm/non_matchings/code/audio_synthesis/func_801882A0.s,func_801882A0,0x801882A0,0x19
asm/non_matchings/code/audio_synthesis/func_80188304.s,func_80188304,0x80188304,0x67
asm/non_matchings/code/audio_synthesis/func_801884A0.s,func_801884A0,0x801884A0,0x7E
asm/non_matchings/code/audio_synthesis/func_80188698.s,func_80188698,0x80188698,0x69
asm/non_matchings/code/audio_synthesis/func_8018883C.s,func_8018883C,0x8018883C,0x2A
asm/non_matchings/code/audio_synthesis/func_801888E4.s,func_801888E4,0x801888E4,0x30
asm/non_matchings/code/audio_synthesis/func_801889A4.s,func_801889A4,0x801889A4,0x2B
asm/non_matchings/code/audio_synthesis/func_80188A50.s,func_80188A50,0x80188A50,0x2B
asm/non_matchings/code/audio_synthesis/func_80188AFC.s,func_80188AFC,0x80188AFC,0x53
asm/non_matchings/code/audio_synthesis/func_80188C48.s,func_80188C48,0x80188C48,0x1B
asm/non_matchings/code/audio_synthesis/func_80188CB4.s,func_80188CB4,0x80188CB4,0x1B
asm/non_matchings/code/audio_synthesis/func_80188D20.s,func_80188D20,0x80188D20,0x2
asm/non_matchings/code/audio_synthesis/func_80188D28.s,func_80188D28,0x80188D28,0x10
asm/non_matchings/code/audio_synthesis/func_80188D68.s,func_80188D68,0x80188D68,0x1D
asm/non_matchings/code/audio_synthesis/func_80188DDC.s,func_80188DDC,0x80188DDC,0x78
asm/non_matchings/code/audio_synthesis/func_80188FBC.s,func_80188FBC,0x80188FBC,0x2A
asm/non_matchings/code/audio_synthesis/func_80189064.s,func_80189064,0x80189064,0x16F
asm/non_matchings/code/audio_synthesis/func_80189620.s,func_80189620,0x80189620,0x3A5
asm/non_matchings/code/audio_synthesis/func_8018A4B4.s,func_8018A4B4,0x8018A4B4,0xAD
asm/non_matchings/code/audio_synthesis/func_8018A768.s,func_8018A768,0x8018A768,0x28
asm/non_matchings/code/audio_synthesis/func_8018A808.s,func_8018A808,0x8018A808,0x12F
asm/non_matchings/code/audio_synthesis/func_8018ACC4.s,func_8018ACC4,0x8018ACC4,0x5C
asm/non_matchings/code/audio_synthesis/func_8018AE34.s,func_8018AE34,0x8018AE34,0xAF
asm/non_matchings/code/audio_synthesis/AudioSynth_AddReverbBufferEntry.s,AudioSynth_AddReverbBufferEntry,0x801877D0,0xE5
asm/non_matchings/code/audio_synthesis/AudioSynth_SyncSampleStates.s,AudioSynth_SyncSampleStates,0x80187B64,0x22
asm/non_matchings/code/audio_synthesis/AudioSynth_Update.s,AudioSynth_Update,0x80187BEC,0x7F
asm/non_matchings/code/audio_synthesis/AudioSynth_DisableSampleStates.s,AudioSynth_DisableSampleStates,0x80187DE8,0x1C
asm/non_matchings/code/audio_synthesis/AudioSynth_LoadMixedReverbSamples.s,AudioSynth_LoadMixedReverbSamples,0x80187E58,0x2A
asm/non_matchings/code/audio_synthesis/AudioSynth_SaveMixedReverbSamples.s,AudioSynth_SaveMixedReverbSamples,0x80187F00,0x2A
asm/non_matchings/code/audio_synthesis/AudioSynth_Noop1.s,AudioSynth_Noop1,0x80187FA8,0x2
asm/non_matchings/code/audio_synthesis/AudioSynth_ClearBuffer.s,AudioSynth_ClearBuffer,0x80187FB0,0x8
asm/non_matchings/code/audio_synthesis/AudioSynth_Noop2.s,AudioSynth_Noop2,0x80187FD0,0x2
asm/non_matchings/code/audio_synthesis/AudioSynth_Noop3.s,AudioSynth_Noop3,0x80187FD8,0x2
asm/non_matchings/code/audio_synthesis/AudioSynth_Noop4.s,AudioSynth_Noop4,0x80187FE0,0x2
asm/non_matchings/code/audio_synthesis/AudioSynth_Mix.s,AudioSynth_Mix,0x80187FE8,0xD
asm/non_matchings/code/audio_synthesis/AudioSynth_Noop5.s,AudioSynth_Noop5,0x8018801C,0x2
asm/non_matchings/code/audio_synthesis/AudioSynth_Noop6.s,AudioSynth_Noop6,0x80188024,0x2
asm/non_matchings/code/audio_synthesis/AudioSynth_Noop7.s,AudioSynth_Noop7,0x8018802C,0x2
asm/non_matchings/code/audio_synthesis/AudioSynth_SetBuffer.s,AudioSynth_SetBuffer,0x80188034,0xD
asm/non_matchings/code/audio_synthesis/AudioSynth_Noop8.s,AudioSynth_Noop8,0x80188068,0x2
asm/non_matchings/code/audio_synthesis/AudioSynth_Noop9.s,AudioSynth_Noop9,0x80188070,0x2
asm/non_matchings/code/audio_synthesis/AudioSynth_DMemMove.s,AudioSynth_DMemMove,0x80188078,0xB
asm/non_matchings/code/audio_synthesis/AudioSynth_Noop10.s,AudioSynth_Noop10,0x801880A4,0x2
asm/non_matchings/code/audio_synthesis/AudioSynth_Noop11.s,AudioSynth_Noop11,0x801880AC,0x2
asm/non_matchings/code/audio_synthesis/AudioSynth_Noop12.s,AudioSynth_Noop12,0x801880B4,0x2
asm/non_matchings/code/audio_synthesis/AudioSynth_Noop13.s,AudioSynth_Noop13,0x801880BC,0x2
asm/non_matchings/code/audio_synthesis/AudioSynth_InterL.s,AudioSynth_InterL,0x801880C4,0x9
asm/non_matchings/code/audio_synthesis/AudioSynth_EnvSetup1.s,AudioSynth_EnvSetup1,0x801880E8,0xD
asm/non_matchings/code/audio_synthesis/AudioSynth_Noop14.s,AudioSynth_Noop14,0x8018811C,0x2
asm/non_matchings/code/audio_synthesis/AudioSynth_LoadBuffer.s,AudioSynth_LoadBuffer,0x80188124,0xA
asm/non_matchings/code/audio_synthesis/AudioSynth_SaveBuffer.s,AudioSynth_SaveBuffer,0x8018814C,0xA
asm/non_matchings/code/audio_synthesis/AudioSynth_EnvSetup2.s,AudioSynth_EnvSetup2,0x80188174,0x7
asm/non_matchings/code/audio_synthesis/AudioSynth_Noop15.s,AudioSynth_Noop15,0x80188190,0x2
asm/non_matchings/code/audio_synthesis/AudioSynth_Noop16.s,AudioSynth_Noop16,0x80188198,0x2
asm/non_matchings/code/audio_synthesis/AudioSynth_Noop17.s,AudioSynth_Noop17,0x801881A0,0x2
asm/non_matchings/code/audio_synthesis/AudioSynth_S8Dec.s,AudioSynth_S8Dec,0x801881A8,0x7
asm/non_matchings/code/audio_synthesis/AudioSynth_HiLoGain.s,AudioSynth_HiLoGain,0x801881C4,0xD
asm/non_matchings/code/audio_synthesis/AudioSynth_UnkCmd19.s,AudioSynth_UnkCmd19,0x801881F8,0xB
asm/non_matchings/code/audio_synthesis/AudioSynth_Noop18.s,AudioSynth_Noop18,0x80188224,0x2
asm/non_matchings/code/audio_synthesis/AudioSynth_Noop19.s,AudioSynth_Noop19,0x8018822C,0x2
asm/non_matchings/code/audio_synthesis/AudioSynth_Noop20.s,AudioSynth_Noop20,0x80188234,0x2
asm/non_matchings/code/audio_synthesis/AudioSynth_Noop21.s,AudioSynth_Noop21,0x8018823C,0x2
asm/non_matchings/code/audio_synthesis/AudioSynth_Noop22.s,AudioSynth_Noop22,0x80188244,0x2
asm/non_matchings/code/audio_synthesis/AudioSynth_Noop23.s,AudioSynth_Noop23,0x8018824C,0x2
asm/non_matchings/code/audio_synthesis/AudioSynth_Noop24.s,AudioSynth_Noop24,0x80188254,0x2
asm/non_matchings/code/audio_synthesis/AudioSynth_Noop25.s,AudioSynth_Noop25,0x8018825C,0x2
asm/non_matchings/code/audio_synthesis/AudioSynth_LoadFilterBuffer.s,AudioSynth_LoadFilterBuffer,0x80188264,0x9
asm/non_matchings/code/audio_synthesis/AudioSynth_LoadFilterSize.s,AudioSynth_LoadFilterSize,0x80188288,0x6
asm/non_matchings/code/audio_synthesis/AudioSynth_LeakReverb.s,AudioSynth_LeakReverb,0x801882A0,0x19
asm/non_matchings/code/audio_synthesis/AudioSynth_LoadDownsampledReverbSamples.s,AudioSynth_LoadDownsampledReverbSamples,0x80188304,0x67
asm/non_matchings/code/audio_synthesis/AudioSynth_SaveResampledReverbSamples.s,AudioSynth_SaveResampledReverbSamples,0x801884A0,0x7E
asm/non_matchings/code/audio_synthesis/AudioSynth_LoadResampledReverbSamples.s,AudioSynth_LoadResampledReverbSamples,0x80188698,0x69
asm/non_matchings/code/audio_synthesis/AudioSynth_FilterReverb.s,AudioSynth_FilterReverb,0x8018883C,0x2A
asm/non_matchings/code/audio_synthesis/AudioSynth_MixOtherReverbIndex.s,AudioSynth_MixOtherReverbIndex,0x801888E4,0x30
asm/non_matchings/code/audio_synthesis/AudioSynth_LoadDefaultReverbSamples.s,AudioSynth_LoadDefaultReverbSamples,0x801889A4,0x2B
asm/non_matchings/code/audio_synthesis/AudioSynth_LoadSubReverbSamples.s,AudioSynth_LoadSubReverbSamples,0x80188A50,0x2B
asm/non_matchings/code/audio_synthesis/AudioSynth_SaveResampledReverbSamplesImpl.s,AudioSynth_SaveResampledReverbSamplesImpl,0x80188AFC,0x53
asm/non_matchings/code/audio_synthesis/AudioSynth_LoadReverbSamplesImpl.s,AudioSynth_LoadReverbSamplesImpl,0x80188C48,0x1B
asm/non_matchings/code/audio_synthesis/AudioSynth_SaveReverbSamplesImpl.s,AudioSynth_SaveReverbSamplesImpl,0x80188CB4,0x1B
asm/non_matchings/code/audio_synthesis/AudioSynth_Noop26.s,AudioSynth_Noop26,0x80188D20,0x2
asm/non_matchings/code/audio_synthesis/AudioSynth_LoadSubReverbSamplesWithoutDownsample.s,AudioSynth_LoadSubReverbSamplesWithoutDownsample,0x80188D28,0x10
asm/non_matchings/code/audio_synthesis/AudioSynth_LoadReverbSamples.s,AudioSynth_LoadReverbSamples,0x80188D68,0x1D
asm/non_matchings/code/audio_synthesis/AudioSynth_SaveReverbSamples.s,AudioSynth_SaveReverbSamples,0x80188DDC,0x78
asm/non_matchings/code/audio_synthesis/AudioSynth_SaveSubReverbSamples.s,AudioSynth_SaveSubReverbSamples,0x80188FBC,0x2A
asm/non_matchings/code/audio_synthesis/AudioSynth_ProcessSamples.s,AudioSynth_ProcessSamples,0x80189064,0x16F
asm/non_matchings/code/audio_synthesis/AudioSynth_ProcessSample.s,AudioSynth_ProcessSample,0x80189620,0x3A5
asm/non_matchings/code/audio_synthesis/AudioSynth_ApplySurroundEffect.s,AudioSynth_ApplySurroundEffect,0x8018A4B4,0xAD
asm/non_matchings/code/audio_synthesis/AudioSynth_FinalResample.s,AudioSynth_FinalResample,0x8018A768,0x28
asm/non_matchings/code/audio_synthesis/AudioSynth_ProcessEnvelope.s,AudioSynth_ProcessEnvelope,0x8018A808,0x12F
asm/non_matchings/code/audio_synthesis/AudioSynth_LoadWaveSamples.s,AudioSynth_LoadWaveSamples,0x8018ACC4,0x5C
asm/non_matchings/code/audio_synthesis/AudioSynth_ApplyHaasEffect.s,AudioSynth_ApplyHaasEffect,0x8018AE34,0xAF
asm/non_matchings/code/audio_heap/AudioHeap_ResetLoadStatus.s,AudioHeap_ResetLoadStatus,0x8018B250,0x32
asm/non_matchings/code/audio_heap/AudioHeap_DiscardFont.s,AudioHeap_DiscardFont,0x8018B318,0x39
asm/non_matchings/code/audio_heap/AudioHeap_ReleaseNotesForFont.s,AudioHeap_ReleaseNotesForFont,0x8018B3FC,0x1E
@ -3242,7 +3242,7 @@ asm/non_matchings/code/code_80194710/osAiSetNextBuffer.s,osAiSetNextBuffer,0x801
asm/non_matchings/code/code_80194710/func_80194804.s,func_80194804,0x80194804,0xF
asm/non_matchings/code/code_80194710/func_80194840.s,func_80194840,0x80194840,0x1C
asm/non_matchings/code/code_80194710/func_801948B0.s,func_801948B0,0x801948B0,0x20
asm/non_matchings/code/audio_playback/AudioPlayback_InitNoteSub.s,AudioPlayback_InitNoteSub,0x80194930,0x120
asm/non_matchings/code/audio_playback/AudioPlayback_InitSampleState.s,AudioPlayback_InitSampleState,0x80194930,0x120
asm/non_matchings/code/audio_playback/AudioPlayback_NoteSetResamplingRate.s,AudioPlayback_NoteSetResamplingRate,0x80194DB0,0x2C
asm/non_matchings/code/audio_playback/AudioPlayback_NoteInit.s,AudioPlayback_NoteInit,0x80194E60,0x30
asm/non_matchings/code/audio_playback/AudioPlayback_NoteDisable.s,AudioPlayback_NoteDisable,0x80194F20,0x19

1 asm/non_matchings/code/z_en_a_keep/EnAObj_Init.s EnAObj_Init 0x800A5AC0 0x2B
2996 asm/non_matchings/code/osFlash/func_801872FC.s func_801872FC 0x801872FC 0x30
2997 asm/non_matchings/code/osFlash/func_801873BC.s func_801873BC 0x801873BC 0x5C
2998 asm/non_matchings/code/osFlash/func_8018752C.s func_8018752C 0x8018752C 0x9D
2999 asm/non_matchings/code/audio_synthesis/func_801877D0.s asm/non_matchings/code/audio_synthesis/AudioSynth_AddReverbBufferEntry.s func_801877D0 AudioSynth_AddReverbBufferEntry 0x801877D0 0xE5
3000 asm/non_matchings/code/audio_synthesis/func_80187B64.s asm/non_matchings/code/audio_synthesis/AudioSynth_SyncSampleStates.s func_80187B64 AudioSynth_SyncSampleStates 0x80187B64 0x22
3001 asm/non_matchings/code/audio_synthesis/func_80187BEC.s asm/non_matchings/code/audio_synthesis/AudioSynth_Update.s func_80187BEC AudioSynth_Update 0x80187BEC 0x7F
3002 asm/non_matchings/code/audio_synthesis/func_80187DE8.s asm/non_matchings/code/audio_synthesis/AudioSynth_DisableSampleStates.s func_80187DE8 AudioSynth_DisableSampleStates 0x80187DE8 0x1C
3003 asm/non_matchings/code/audio_synthesis/func_80187E58.s asm/non_matchings/code/audio_synthesis/AudioSynth_LoadMixedReverbSamples.s func_80187E58 AudioSynth_LoadMixedReverbSamples 0x80187E58 0x2A
3004 asm/non_matchings/code/audio_synthesis/func_80187F00.s asm/non_matchings/code/audio_synthesis/AudioSynth_SaveMixedReverbSamples.s func_80187F00 AudioSynth_SaveMixedReverbSamples 0x80187F00 0x2A
3005 asm/non_matchings/code/audio_synthesis/func_80187FA8.s asm/non_matchings/code/audio_synthesis/AudioSynth_Noop1.s func_80187FA8 AudioSynth_Noop1 0x80187FA8 0x2
3006 asm/non_matchings/code/audio_synthesis/func_80187FB0.s asm/non_matchings/code/audio_synthesis/AudioSynth_ClearBuffer.s func_80187FB0 AudioSynth_ClearBuffer 0x80187FB0 0x8
3007 asm/non_matchings/code/audio_synthesis/func_80187FD0.s asm/non_matchings/code/audio_synthesis/AudioSynth_Noop2.s func_80187FD0 AudioSynth_Noop2 0x80187FD0 0x2
3008 asm/non_matchings/code/audio_synthesis/func_80187FD8.s asm/non_matchings/code/audio_synthesis/AudioSynth_Noop3.s func_80187FD8 AudioSynth_Noop3 0x80187FD8 0x2
3009 asm/non_matchings/code/audio_synthesis/func_80187FE0.s asm/non_matchings/code/audio_synthesis/AudioSynth_Noop4.s func_80187FE0 AudioSynth_Noop4 0x80187FE0 0x2
3010 asm/non_matchings/code/audio_synthesis/func_80187FE8.s asm/non_matchings/code/audio_synthesis/AudioSynth_Mix.s func_80187FE8 AudioSynth_Mix 0x80187FE8 0xD
3011 asm/non_matchings/code/audio_synthesis/func_8018801C.s asm/non_matchings/code/audio_synthesis/AudioSynth_Noop5.s func_8018801C AudioSynth_Noop5 0x8018801C 0x2
3012 asm/non_matchings/code/audio_synthesis/func_80188024.s asm/non_matchings/code/audio_synthesis/AudioSynth_Noop6.s func_80188024 AudioSynth_Noop6 0x80188024 0x2
3013 asm/non_matchings/code/audio_synthesis/func_8018802C.s asm/non_matchings/code/audio_synthesis/AudioSynth_Noop7.s func_8018802C AudioSynth_Noop7 0x8018802C 0x2
3014 asm/non_matchings/code/audio_synthesis/func_80188034.s asm/non_matchings/code/audio_synthesis/AudioSynth_SetBuffer.s func_80188034 AudioSynth_SetBuffer 0x80188034 0xD
3015 asm/non_matchings/code/audio_synthesis/func_80188068.s asm/non_matchings/code/audio_synthesis/AudioSynth_Noop8.s func_80188068 AudioSynth_Noop8 0x80188068 0x2
3016 asm/non_matchings/code/audio_synthesis/func_80188070.s asm/non_matchings/code/audio_synthesis/AudioSynth_Noop9.s func_80188070 AudioSynth_Noop9 0x80188070 0x2
3017 asm/non_matchings/code/audio_synthesis/func_80188078.s asm/non_matchings/code/audio_synthesis/AudioSynth_DMemMove.s func_80188078 AudioSynth_DMemMove 0x80188078 0xB
3018 asm/non_matchings/code/audio_synthesis/func_801880A4.s asm/non_matchings/code/audio_synthesis/AudioSynth_Noop10.s func_801880A4 AudioSynth_Noop10 0x801880A4 0x2
3019 asm/non_matchings/code/audio_synthesis/func_801880AC.s asm/non_matchings/code/audio_synthesis/AudioSynth_Noop11.s func_801880AC AudioSynth_Noop11 0x801880AC 0x2
3020 asm/non_matchings/code/audio_synthesis/func_801880B4.s asm/non_matchings/code/audio_synthesis/AudioSynth_Noop12.s func_801880B4 AudioSynth_Noop12 0x801880B4 0x2
3021 asm/non_matchings/code/audio_synthesis/func_801880BC.s asm/non_matchings/code/audio_synthesis/AudioSynth_Noop13.s func_801880BC AudioSynth_Noop13 0x801880BC 0x2
3022 asm/non_matchings/code/audio_synthesis/func_801880C4.s asm/non_matchings/code/audio_synthesis/AudioSynth_InterL.s func_801880C4 AudioSynth_InterL 0x801880C4 0x9
3023 asm/non_matchings/code/audio_synthesis/func_801880E8.s asm/non_matchings/code/audio_synthesis/AudioSynth_EnvSetup1.s func_801880E8 AudioSynth_EnvSetup1 0x801880E8 0xD
3024 asm/non_matchings/code/audio_synthesis/func_8018811C.s asm/non_matchings/code/audio_synthesis/AudioSynth_Noop14.s func_8018811C AudioSynth_Noop14 0x8018811C 0x2
3025 asm/non_matchings/code/audio_synthesis/func_80188124.s asm/non_matchings/code/audio_synthesis/AudioSynth_LoadBuffer.s func_80188124 AudioSynth_LoadBuffer 0x80188124 0xA
3026 asm/non_matchings/code/audio_synthesis/func_8018814C.s asm/non_matchings/code/audio_synthesis/AudioSynth_SaveBuffer.s func_8018814C AudioSynth_SaveBuffer 0x8018814C 0xA
3027 asm/non_matchings/code/audio_synthesis/func_80188174.s asm/non_matchings/code/audio_synthesis/AudioSynth_EnvSetup2.s func_80188174 AudioSynth_EnvSetup2 0x80188174 0x7
3028 asm/non_matchings/code/audio_synthesis/func_80188190.s asm/non_matchings/code/audio_synthesis/AudioSynth_Noop15.s func_80188190 AudioSynth_Noop15 0x80188190 0x2
3029 asm/non_matchings/code/audio_synthesis/func_80188198.s asm/non_matchings/code/audio_synthesis/AudioSynth_Noop16.s func_80188198 AudioSynth_Noop16 0x80188198 0x2
3030 asm/non_matchings/code/audio_synthesis/func_801881A0.s asm/non_matchings/code/audio_synthesis/AudioSynth_Noop17.s func_801881A0 AudioSynth_Noop17 0x801881A0 0x2
3031 asm/non_matchings/code/audio_synthesis/func_801881A8.s asm/non_matchings/code/audio_synthesis/AudioSynth_S8Dec.s func_801881A8 AudioSynth_S8Dec 0x801881A8 0x7
3032 asm/non_matchings/code/audio_synthesis/func_801881C4.s asm/non_matchings/code/audio_synthesis/AudioSynth_HiLoGain.s func_801881C4 AudioSynth_HiLoGain 0x801881C4 0xD
3033 asm/non_matchings/code/audio_synthesis/func_801881F8.s asm/non_matchings/code/audio_synthesis/AudioSynth_UnkCmd19.s func_801881F8 AudioSynth_UnkCmd19 0x801881F8 0xB
3034 asm/non_matchings/code/audio_synthesis/func_80188224.s asm/non_matchings/code/audio_synthesis/AudioSynth_Noop18.s func_80188224 AudioSynth_Noop18 0x80188224 0x2
3035 asm/non_matchings/code/audio_synthesis/func_8018822C.s asm/non_matchings/code/audio_synthesis/AudioSynth_Noop19.s func_8018822C AudioSynth_Noop19 0x8018822C 0x2
3036 asm/non_matchings/code/audio_synthesis/func_80188234.s asm/non_matchings/code/audio_synthesis/AudioSynth_Noop20.s func_80188234 AudioSynth_Noop20 0x80188234 0x2
3037 asm/non_matchings/code/audio_synthesis/func_8018823C.s asm/non_matchings/code/audio_synthesis/AudioSynth_Noop21.s func_8018823C AudioSynth_Noop21 0x8018823C 0x2
3038 asm/non_matchings/code/audio_synthesis/func_80188244.s asm/non_matchings/code/audio_synthesis/AudioSynth_Noop22.s func_80188244 AudioSynth_Noop22 0x80188244 0x2
3039 asm/non_matchings/code/audio_synthesis/func_8018824C.s asm/non_matchings/code/audio_synthesis/AudioSynth_Noop23.s func_8018824C AudioSynth_Noop23 0x8018824C 0x2
3040 asm/non_matchings/code/audio_synthesis/func_80188254.s asm/non_matchings/code/audio_synthesis/AudioSynth_Noop24.s func_80188254 AudioSynth_Noop24 0x80188254 0x2
3041 asm/non_matchings/code/audio_synthesis/func_8018825C.s asm/non_matchings/code/audio_synthesis/AudioSynth_Noop25.s func_8018825C AudioSynth_Noop25 0x8018825C 0x2
3042 asm/non_matchings/code/audio_synthesis/func_80188264.s asm/non_matchings/code/audio_synthesis/AudioSynth_LoadFilterBuffer.s func_80188264 AudioSynth_LoadFilterBuffer 0x80188264 0x9
3043 asm/non_matchings/code/audio_synthesis/func_80188288.s asm/non_matchings/code/audio_synthesis/AudioSynth_LoadFilterSize.s func_80188288 AudioSynth_LoadFilterSize 0x80188288 0x6
3044 asm/non_matchings/code/audio_synthesis/func_801882A0.s asm/non_matchings/code/audio_synthesis/AudioSynth_LeakReverb.s func_801882A0 AudioSynth_LeakReverb 0x801882A0 0x19
3045 asm/non_matchings/code/audio_synthesis/func_80188304.s asm/non_matchings/code/audio_synthesis/AudioSynth_LoadDownsampledReverbSamples.s func_80188304 AudioSynth_LoadDownsampledReverbSamples 0x80188304 0x67
3046 asm/non_matchings/code/audio_synthesis/func_801884A0.s asm/non_matchings/code/audio_synthesis/AudioSynth_SaveResampledReverbSamples.s func_801884A0 AudioSynth_SaveResampledReverbSamples 0x801884A0 0x7E
3047 asm/non_matchings/code/audio_synthesis/func_80188698.s asm/non_matchings/code/audio_synthesis/AudioSynth_LoadResampledReverbSamples.s func_80188698 AudioSynth_LoadResampledReverbSamples 0x80188698 0x69
3048 asm/non_matchings/code/audio_synthesis/func_8018883C.s asm/non_matchings/code/audio_synthesis/AudioSynth_FilterReverb.s func_8018883C AudioSynth_FilterReverb 0x8018883C 0x2A
3049 asm/non_matchings/code/audio_synthesis/func_801888E4.s asm/non_matchings/code/audio_synthesis/AudioSynth_MixOtherReverbIndex.s func_801888E4 AudioSynth_MixOtherReverbIndex 0x801888E4 0x30
3050 asm/non_matchings/code/audio_synthesis/func_801889A4.s asm/non_matchings/code/audio_synthesis/AudioSynth_LoadDefaultReverbSamples.s func_801889A4 AudioSynth_LoadDefaultReverbSamples 0x801889A4 0x2B
3051 asm/non_matchings/code/audio_synthesis/func_80188A50.s asm/non_matchings/code/audio_synthesis/AudioSynth_LoadSubReverbSamples.s func_80188A50 AudioSynth_LoadSubReverbSamples 0x80188A50 0x2B
3052 asm/non_matchings/code/audio_synthesis/func_80188AFC.s asm/non_matchings/code/audio_synthesis/AudioSynth_SaveResampledReverbSamplesImpl.s func_80188AFC AudioSynth_SaveResampledReverbSamplesImpl 0x80188AFC 0x53
3053 asm/non_matchings/code/audio_synthesis/func_80188C48.s asm/non_matchings/code/audio_synthesis/AudioSynth_LoadReverbSamplesImpl.s func_80188C48 AudioSynth_LoadReverbSamplesImpl 0x80188C48 0x1B
3054 asm/non_matchings/code/audio_synthesis/func_80188CB4.s asm/non_matchings/code/audio_synthesis/AudioSynth_SaveReverbSamplesImpl.s func_80188CB4 AudioSynth_SaveReverbSamplesImpl 0x80188CB4 0x1B
3055 asm/non_matchings/code/audio_synthesis/func_80188D20.s asm/non_matchings/code/audio_synthesis/AudioSynth_Noop26.s func_80188D20 AudioSynth_Noop26 0x80188D20 0x2
3056 asm/non_matchings/code/audio_synthesis/func_80188D28.s asm/non_matchings/code/audio_synthesis/AudioSynth_LoadSubReverbSamplesWithoutDownsample.s func_80188D28 AudioSynth_LoadSubReverbSamplesWithoutDownsample 0x80188D28 0x10
3057 asm/non_matchings/code/audio_synthesis/func_80188D68.s asm/non_matchings/code/audio_synthesis/AudioSynth_LoadReverbSamples.s func_80188D68 AudioSynth_LoadReverbSamples 0x80188D68 0x1D
3058 asm/non_matchings/code/audio_synthesis/func_80188DDC.s asm/non_matchings/code/audio_synthesis/AudioSynth_SaveReverbSamples.s func_80188DDC AudioSynth_SaveReverbSamples 0x80188DDC 0x78
3059 asm/non_matchings/code/audio_synthesis/func_80188FBC.s asm/non_matchings/code/audio_synthesis/AudioSynth_SaveSubReverbSamples.s func_80188FBC AudioSynth_SaveSubReverbSamples 0x80188FBC 0x2A
3060 asm/non_matchings/code/audio_synthesis/func_80189064.s asm/non_matchings/code/audio_synthesis/AudioSynth_ProcessSamples.s func_80189064 AudioSynth_ProcessSamples 0x80189064 0x16F
3061 asm/non_matchings/code/audio_synthesis/func_80189620.s asm/non_matchings/code/audio_synthesis/AudioSynth_ProcessSample.s func_80189620 AudioSynth_ProcessSample 0x80189620 0x3A5
3062 asm/non_matchings/code/audio_synthesis/func_8018A4B4.s asm/non_matchings/code/audio_synthesis/AudioSynth_ApplySurroundEffect.s func_8018A4B4 AudioSynth_ApplySurroundEffect 0x8018A4B4 0xAD
3063 asm/non_matchings/code/audio_synthesis/func_8018A768.s asm/non_matchings/code/audio_synthesis/AudioSynth_FinalResample.s func_8018A768 AudioSynth_FinalResample 0x8018A768 0x28
3064 asm/non_matchings/code/audio_synthesis/func_8018A808.s asm/non_matchings/code/audio_synthesis/AudioSynth_ProcessEnvelope.s func_8018A808 AudioSynth_ProcessEnvelope 0x8018A808 0x12F
3065 asm/non_matchings/code/audio_synthesis/func_8018ACC4.s asm/non_matchings/code/audio_synthesis/AudioSynth_LoadWaveSamples.s func_8018ACC4 AudioSynth_LoadWaveSamples 0x8018ACC4 0x5C
3066 asm/non_matchings/code/audio_synthesis/func_8018AE34.s asm/non_matchings/code/audio_synthesis/AudioSynth_ApplyHaasEffect.s func_8018AE34 AudioSynth_ApplyHaasEffect 0x8018AE34 0xAF
3067 asm/non_matchings/code/audio_heap/AudioHeap_ResetLoadStatus.s AudioHeap_ResetLoadStatus 0x8018B250 0x32
3068 asm/non_matchings/code/audio_heap/AudioHeap_DiscardFont.s AudioHeap_DiscardFont 0x8018B318 0x39
3069 asm/non_matchings/code/audio_heap/AudioHeap_ReleaseNotesForFont.s AudioHeap_ReleaseNotesForFont 0x8018B3FC 0x1E
3242 asm/non_matchings/code/code_80194710/func_80194804.s func_80194804 0x80194804 0xF
3243 asm/non_matchings/code/code_80194710/func_80194840.s func_80194840 0x80194840 0x1C
3244 asm/non_matchings/code/code_80194710/func_801948B0.s func_801948B0 0x801948B0 0x20
3245 asm/non_matchings/code/audio_playback/AudioPlayback_InitNoteSub.s asm/non_matchings/code/audio_playback/AudioPlayback_InitSampleState.s AudioPlayback_InitNoteSub AudioPlayback_InitSampleState 0x80194930 0x120
3246 asm/non_matchings/code/audio_playback/AudioPlayback_NoteSetResamplingRate.s AudioPlayback_NoteSetResamplingRate 0x80194DB0 0x2C
3247 asm/non_matchings/code/audio_playback/AudioPlayback_NoteInit.s AudioPlayback_NoteInit 0x80194E60 0x30
3248 asm/non_matchings/code/audio_playback/AudioPlayback_NoteDisable.s AudioPlayback_NoteDisable 0x80194F20 0x19