diff options
| author | engineer124 <47598039+engineer124@users.noreply.github.com> | 2022-01-12 12:58:26 +1100 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2022-01-11 20:58:26 -0500 |
| commit | d3a8ade6bae030b587cfbe7aa2d76117d1e54a02 (patch) | |
| tree | d61ea977cec26c1fa1a5e97af6fe5c9d3d666619 /src | |
| parent | 67f6b50de3d2679c066d2d9b5363a7140e7b9ee2 (diff) | |
Migrate Remaining Audio Data & Cleanup some Audio Data externs (#1097)
* Import code_800F7260.bss.s
* Import code_800F9280.data.s
* format
* cleanup externs
* Move bss to next file
* Move struct_8016E320 (BgmRequests) back to file
* Move data to init_params, remove data pad (can't remove bss pad), ReverbSettings
* remove extra spacing
* Remove data/bss comments
Diffstat (limited to 'src')
| -rw-r--r-- | src/code/audio_init_params.c | 81 | ||||
| -rw-r--r-- | src/code/code_800EC960.c | 5 | ||||
| -rw-r--r-- | src/code/code_800F7260.c | 34 | ||||
| -rw-r--r-- | src/code/code_800F9280.c | 26 |
4 files changed, 116 insertions, 30 deletions
diff --git a/src/code/audio_init_params.c b/src/code/audio_init_params.c index f7528deed..0cebdf596 100644 --- a/src/code/audio_init_params.c +++ b/src/code/audio_init_params.c @@ -1,7 +1,88 @@ #include "global.h" +u8 D_8016F0E0[0xA0]; // unused +AudioContext gAudioContext; +void (*D_801755D0)(void); +s32 D_801755D8[3]; // unused + const s16 D_8014A6C0[] = { 0x1C00, // unused 0x0030, // gTatumsPerBeat }; + const AudioContextInitSizes D_8014A6C4 = { 0x37F00, 0xE0E0, 0xBCE0 }; + +ReverbSettings D_80133420[][3] = { + { + { 1, 0x30, 0x3000, 0, 0, 0x7FFF, 0x0000, 0x0000, 0xFF, 0x3000, 0x0, 0x0 }, + { 1, 0x20, 0x0800, 0, 0, 0x7FFF, 0x0000, 0x0000, 0xFF, 0x0000, 0x0, 0x0 }, + }, + { + { 1, 0x30, 0x3000, 0, 0, 0x7FFF, 0x0000, 0x0000, 0xFF, 0x3000, 0x0, 0x0 }, + { 1, 0x30, 0x1800, 0, 0, 0x7FFF, 0x0000, 0x0000, 0xFF, 0x0000, 0xB, 0xB }, + }, + { + { 1, 0x30, 0x3000, 0, 0, 0x7FFF, 0x0000, 0x0000, 0xFF, 0x3000, 0x0, 0x0 }, + { 1, 0x38, 0x2800, 0, 0, 0x7FFF, 0x0000, 0x0000, 0xFF, 0x0000, 0x7, 0x7 }, + }, + { + { 1, 0x30, 0x3000, 0, 0, 0x7FFF, 0x0000, 0x0000, 0xFF, 0x3000, 0x0, 0x0 }, + { 1, 0x50, 0x5000, 0, 0, 0x7FFF, 0x1000, 0x1000, 0xFF, 0x3000, 0x7, 0x7 }, + }, + { + { 1, 0x30, 0x3000, 0, 0, 0x7FFF, 0x0000, 0x0000, 0xFF, 0x3000, 0x0, 0x0 }, + { 1, 0x40, 0x5000, 0, 0, 0x7FFF, 0x1800, 0x1800, 0xFF, 0x3000, 0x7, 0x7 }, + }, + { + { 1, 0x30, 0x3000, 0, 0, 0x7FFF, 0x0000, 0x0000, 0xFF, 0x3000, 0x0, 0x0 }, + { 1, 0x40, 0x5C00, 0, 0, 0x7FFF, 0x2000, 0x2000, 0xFF, 0x3000, 0x4, 0x4 }, + }, + { + { 1, 0x30, 0x3000, 0, 0, 0x7FFF, 0x0000, 0x0000, 0xFF, 0x3000, 0x0, 0x0 }, + { 1, 0x30, 0x6000, 0, 0, 0x7FFF, 0x1000, 0x1000, 0xFF, 0x3000, 0xA, 0xA }, + }, + { + { 1, 0x30, 0x3000, 0, 0, 0x7FFF, 0x0000, 0x0000, 0xFF, 0x3000, 0x0, 0x0 }, + { 1, 0x30, 0x6800, 0, 0, 0x7FFF, 0x1400, 0x1400, 0xFF, 0x3000, 0x6, 0x6 }, + }, + { + { 1, 0x30, 0x3000, 0, 0, 0x7FFF, 0x0000, 0x0000, 0xFF, 0x3000, 0x0, 0x0 }, + { 2, 0x50, 0x5000, 0, 0, 0x7FFF, 0xD000, 0x3000, 0xFF, 0x3000, 0x0, 0x0 }, + }, + { + { 1, 0x30, 0x3000, 0, 0, 0x7FFF, 0x0000, 0x0000, 0xFF, 0x3000, 0x0, 0x0 }, + { 1, 0x20, 0x0000, 0, 0, 0x7FFF, 0x0000, 0x0000, 0xFF, 0x0000, 0x0, 0x0 }, + }, + { + { 1, 0x30, 0x3000, 0, 0, 0x7FFF, 0x0000, 0x0000, 0xFF, 0x3000, 0x0, 0x0 }, + { 1, 0x30, 0x1800, 0, 0, 0x7FFF, 0x0000, 0x0000, 0xFF, 0x0000, 0xB, 0xB }, + }, + { + { 1, 0x30, 0x3000, 0, 0, 0x7FFF, 0x0000, 0x0000, 0xFF, 0x3000, 0x0, 0x0 }, + }, + { + { 1, 0x30, 0x3000, 0, 0, 0x7FFF, 0x0000, 0x0000, 0xFF, 0x3000, 0x0, 0x0 }, + { 1, 0x40, 0x5000, 0, 0, 0x7FFF, 0x0000, 0x0000, 0xFF, 0x3000, 0x0, 0x0 }, + }, +}; + +AudioSpec gAudioSpecs[18] = { + { 32000, 1, 24, 4, 0, 0, 2, D_80133420[0], 0x300, 0x200, 0x7FFF, 0x7F0, 0xE00, 0, 0x4000, 0x2880, 0, 0, 0 }, + { 32000, 1, 24, 4, 0, 0, 2, D_80133420[1], 0x300, 0x200, 0x7FFF, 0x7F0, 0xE00, 0, 0x3800, 0x2880, 0, 0, 0 }, + { 32000, 1, 24, 4, 0, 0, 2, D_80133420[2], 0x300, 0x200, 0x7FFF, 0x7F0, 0xE00, 0, 0x3800, 0x2880, 0, 0, 0 }, + { 32000, 1, 23, 4, 0, 0, 2, D_80133420[4], 0x300, 0x200, 0x7FFF, 0x7F0, 0xE00, 0, 0x3800, 0x2880, 0, 0, 0 }, + { 32000, 1, 23, 4, 0, 0, 2, D_80133420[5], 0x300, 0x200, 0x7FFF, 0x7F0, 0xE00, 0, 0x3800, 0x2880, 0, 0, 0 }, + { 32000, 1, 24, 4, 0, 0, 2, D_80133420[6], 0x300, 0x200, 0x7FFF, 0x7F0, 0xE00, 0, 0x3800, 0x2880, 0, 0, 0 }, + { 32000, 1, 24, 4, 0, 0, 2, D_80133420[7], 0x300, 0x200, 0x7FFF, 0x7F0, 0xE00, 0, 0x3800, 0x2880, 0, 0, 0 }, + { 32000, 1, 23, 4, 0, 0, 2, D_80133420[8], 0x300, 0x200, 0x7FFF, 0x7F0, 0xE00, 0, 0x3800, 0x2880, 0, 0, 0 }, + { 32000, 1, 24, 4, 0, 0, 2, D_80133420[9], 0x300, 0x200, 0x7FFF, 0x7F0, 0xE00, 0, 0x3800, 0x2880, 0, 0, 0 }, + { 32000, 1, 23, 4, 0, 0, 2, D_80133420[8], 0x300, 0x200, 0x7FFF, 0x7F0, 0xE00, 0, 0x3800, 0x2880, 0, 0, 0 }, + { 32000, 1, 28, 3, 0, 0, 2, D_80133420[10], 0x300, 0x200, 0x7FFF, 0x7F0, 0xE00, 0, 0x2800, 0x2880, 0, 0, 0 }, + { 32000, 1, 28, 3, 0, 0, 1, D_80133420[11], 0x300, 0x200, 0x7FFF, 0, 0x4800, 0, 0x4000, 0, 0, 0, 0 }, + { 32000, 1, 28, 3, 0, 0, 1, D_80133420[11], 0x300, 0x200, 0x7FFF, 0, 0, 0, 0x4000, 0x4800, 0, 0, 0 }, + { 32000, 1, 22, 4, 0, 0, 2, D_80133420[0], 0x300, 0x200, 0x7FFF, 0x7F0, 0xE00, 0, 0x3800, 0x2880, 0, 0, 0 }, + { 32000, 1, 22, 4, 0, 0, 2, D_80133420[8], 0x300, 0x200, 0x7FFF, 0x7F0, 0xE00, 0, 0x3800, 0x2880, 0, 0, 0 }, + { 32000, 1, 16, 4, 0, 0, 2, D_80133420[0], 0x300, 0x200, 0x7FFF, 0x7F0, 0xE00, 0, 0x3800, 0x2880, 0, 0, 0 }, + { 22050, 1, 24, 4, 0, 0, 2, D_80133420[0], 0x300, 0x200, 0x7FFF, 0x7F0, 0xE00, 0, 0x3800, 0x2880, 0, 0, 0 }, + { 32000, 1, 24, 4, 0, 0, 2, D_80133420[2], 0x300, 0x200, 0x7FFF, 0x7F0, 0xE00, 0, 0x3600, 0x2600, 0, 0, 0 }, +}; diff --git a/src/code/code_800EC960.c b/src/code/code_800EC960.c index f10ebe349..583d871bf 100644 --- a/src/code/code_800EC960.c +++ b/src/code/code_800EC960.c @@ -84,8 +84,6 @@ typedef enum { #define SFX_PLAYER_CHANNEL_OCARINA 13 -extern f32 D_8012F6B4[]; // from audio_synthesis - u8 gIsLargeSoundBank[7] = { 0, 0, 0, 1, 0, 0, 0 }; // Only the first row of these is supported by sequence 0. (gSfxChannelLayout is always 0.) @@ -1170,9 +1168,6 @@ OcarinaSongInfo gOcarinaSongNotes[OCARINA_SONG_MAX] = { }; // clang-format on -extern u8 D_801333F0; -extern u8 gAudioSfxSwapOff; - /** * BSS */ diff --git a/src/code/code_800F7260.c b/src/code/code_800F7260.c index b04dfb6cf..188f6d8b2 100644 --- a/src/code/code_800F7260.c +++ b/src/code/code_800F7260.c @@ -32,22 +32,24 @@ s32 D_8013338C = 0; char D_80133390[] = "SEQ H"; char D_80133398[] = " L"; -// bss -extern SoundRequest sSoundRequests[0x100]; -extern SoundBankEntry D_8016BAD0[9]; -extern SoundBankEntry D_8016BC80[12]; -extern SoundBankEntry D_8016BEC0[22]; -extern SoundBankEntry D_8016C2E0[20]; -extern SoundBankEntry D_8016C6A0[8]; -extern SoundBankEntry D_8016C820[3]; -extern SoundBankEntry D_8016C8B0[5]; -extern u8 sSoundBankListEnd[7]; -extern u8 sSoundBankFreeListStart[7]; -extern u8 sSoundBankUnused[7]; -extern u8 sCurSfxPlayerChannelIdx; -extern UnusedBankLerp sUnusedBankLerp[7]; - -// data +SoundBankEntry D_8016BAD0[9]; +SoundBankEntry D_8016BC80[12]; +SoundBankEntry D_8016BEC0[22]; +SoundBankEntry D_8016C2E0[20]; +SoundBankEntry D_8016C6A0[8]; +SoundBankEntry D_8016C820[3]; +SoundBankEntry D_8016C8B0[5]; +SoundRequest sSoundRequests[0x100]; +u8 sSoundBankListEnd[7]; +u8 sSoundBankFreeListStart[7]; +u8 sSoundBankUnused[7]; +ActiveSound gActiveSounds[7][3]; +u8 sCurSfxPlayerChannelIdx; +u8 gSoundBankMuted[7]; +UnusedBankLerp sUnusedBankLerp[7]; +u16 gAudioSfxSwapSource[10]; +u16 gAudioSfxSwapTarget[10]; +u8 gAudioSfxSwapMode[10]; // sSoundRequests ring buffer endpoints. read index <= write index, wrapping around mod 256. u8 sSoundRequestWriteIndex = 0; diff --git a/src/code/code_800F9280.c b/src/code/code_800F9280.c index 381cdf611..075d609aa 100644 --- a/src/code/code_800F9280.c +++ b/src/code/code_800F9280.c @@ -2,9 +2,23 @@ #include "global.h" #include "ultra64/abi.h" -extern u8 sSeqCmdRdPos; -extern u8 sSeqCmdWrPos; -extern u8 D_80133410[]; +typedef struct { + u8 unk_0; + u8 unk_1; // importance? +} Struct_8016E320; + +Struct_8016E320 D_8016E320[4][5]; +u8 D_8016E348[4]; +u32 sAudioSeqCmds[0x100]; +unk_D_8016E750 D_8016E750[4]; + +u8 sSeqCmdWrPos = 0; +u8 sSeqCmdRdPos = 0; +u8 D_80133408 = 0; +u8 D_8013340C = 1; +u8 D_80133410[] = { 0, 1, 2, 3 }; +u8 gAudioSpecId = 0; +u8 D_80133418 = 0; // TODO: clean up these macros. They are similar to ones in code_800EC960.c but without casts. #define Audio_StartSeq(playerIdx, fadeTimer, seqId) \ @@ -81,12 +95,6 @@ typedef enum { CMDF } SeqCmdType; -typedef struct { - u8 unk_0; - u8 unk_1; // importance? -} Struct_8016E320; -extern Struct_8016E320 D_8016E320[][5]; // sorted by unk_1, descending - void Audio_ProcessSeqCmd(u32 cmd) { s32 pad[2]; u16 fadeTimer; |
