1
0
Fork 0
mirror of https://github.com/zeldaret/oot.git synced 2024-11-25 09:45:02 +00:00

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
This commit is contained in:
engineer124 2022-01-12 12:58:26 +11:00 committed by GitHub
parent 67f6b50de3
commit d3a8ade6ba
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
8 changed files with 118 additions and 224 deletions

View file

@ -1,85 +0,0 @@
.include "macro.inc"
# assembler directives
.set noat # allow manual use of $at
.set noreorder # don't insert nops after branches
.set gp=64 # allow use of 64-bit general purpose registers
.section .bss
.balign 16
glabel D_8016BAD0
.space 0x1B0
glabel D_8016BC80
.space 0x240
glabel D_8016BEC0
.space 0x420
glabel D_8016C2E0
.space 0x3C0
glabel D_8016C6A0
.space 0x180
glabel D_8016C820
.space 0x90
glabel D_8016C8B0
.space 0xF0
glabel sSoundRequests
.space 0x1800
glabel sSoundBankListEnd
.space 0x8
glabel sSoundBankFreeListStart
.space 0x8
glabel sSoundBankUnused
.space 0x8
glabel gActiveSounds
.space 0xA8
glabel sCurSfxPlayerChannelIdx
.space 0x4
glabel gSoundBankMuted
.space 0xC
glabel sUnusedBankLerp
.space 0x70
glabel gAudioSfxSwapSource
.space 0x18
glabel gAudioSfxSwapTarget
.space 0x18
glabel gAudioSfxSwapMode
.space 0x10
glabel D_8016E320
.space 0x28
glabel D_8016E348
.space 0x8
glabel sAudioSeqCmds
.space 0x400
glabel D_8016E750
.space 0x990
glabel D_8016F0E0 # unused?
.space 0xA0
glabel gAudioContext
.space 0x6450
glabel D_801755D0
.space 0x20

View file

@ -1,104 +0,0 @@
.include "macro.inc"
# assembler directives
.set noat # allow manual use of $at
.set noreorder # don't insert nops after branches
.set gp=64 # allow use of 64-bit general purpose registers
.section .data
.balign 16
glabel sSeqCmdWrPos
.incbin "baserom.z64", 0xBAA5A0, 0x4
glabel sSeqCmdRdPos
.incbin "baserom.z64", 0xBAA5A4, 0x4
glabel D_80133408
.incbin "baserom.z64", 0xBAA5A8, 0x4
glabel D_8013340C
.incbin "baserom.z64", 0xBAA5AC, 0x4
glabel D_80133410
.incbin "baserom.z64", 0xBAA5B0, 0x4
glabel gAudioSpecId
.incbin "baserom.z64", 0xBAA5B4, 0x4
glabel D_80133418
.incbin "baserom.z64", 0xBAA5B8, 0x8
glabel D_80133420
.incbin "baserom.z64", 0xBAA5C0, 0x48
glabel D_80133468
.incbin "baserom.z64", 0xBAA608, 0x48
glabel D_801334B0
.incbin "baserom.z64", 0xBAA650, 0x90
glabel D_80133540
.incbin "baserom.z64", 0xBAA6E0, 0x48
glabel D_80133588
.incbin "baserom.z64", 0xBAA728, 0x48
glabel D_801335D0
.incbin "baserom.z64", 0xBAA770, 0x48
glabel D_80133618
.incbin "baserom.z64", 0xBAA7B8, 0x48
glabel D_80133660
.incbin "baserom.z64", 0xBAA800, 0x48
glabel D_801336A8
.incbin "baserom.z64", 0xBAA848, 0x48
glabel D_801336F0
.incbin "baserom.z64", 0xBAA890, 0x48
glabel D_80133738
.incbin "baserom.z64", 0xBAA8D8, 0x90
glabel gAudioSpecs
.incbin "baserom.z64", 0xBAA968, 0xC
.word D_80133420
.incbin "baserom.z64", 0xBAA978, 0x34
.word D_80133468
.incbin "baserom.z64", 0xBAA9B0, 0x34
.word D_801334B0
.incbin "baserom.z64", 0xBAA9E8, 0x34
.word D_80133540
.incbin "baserom.z64", 0xBAAA20, 0x34
.word D_80133588
.incbin "baserom.z64", 0xBAAA58, 0x34
.word D_801335D0
.incbin "baserom.z64", 0xBAAA90, 0x34
.word D_80133618
.incbin "baserom.z64", 0xBAAAC8, 0x34
.word D_80133660
.incbin "baserom.z64", 0xBAAB00, 0x34
.word D_801336A8
.incbin "baserom.z64", 0xBAAB38, 0x34
.word D_80133660
.incbin "baserom.z64", 0xBAAB70, 0x34
.word D_801336F0
.incbin "baserom.z64", 0xBAABA8, 0x34
.word D_80133738
.incbin "baserom.z64", 0xBAABE0, 0x34
.word D_80133738
.incbin "baserom.z64", 0xBAAC18, 0x34
.word D_80133420
.incbin "baserom.z64", 0xBAAC50, 0x34
.word D_80133660
.incbin "baserom.z64", 0xBAAC88, 0x34
.word D_80133420
.incbin "baserom.z64", 0xBAACC0, 0x34
.word D_80133420
.incbin "baserom.z64", 0xBAACF8, 0x34
.word D_801334B0
.incbin "baserom.z64", 0xBAAD30, 0x30

View file

@ -210,14 +210,13 @@ extern volatile OSTime gRSPOtherTotalTime;
extern volatile OSTime gRDPTotalTime; extern volatile OSTime gRDPTotalTime;
extern FaultThreadStruct gFaultStruct; extern FaultThreadStruct gFaultStruct;
// data/code_800F7260.bss.s
extern ActiveSound gActiveSounds[7][MAX_CHANNELS_PER_BANK]; // total size = 0xA8 extern ActiveSound gActiveSounds[7][MAX_CHANNELS_PER_BANK]; // total size = 0xA8
extern u8 gSoundBankMuted[]; extern u8 gSoundBankMuted[];
extern u8 D_801333F0;
extern u8 gAudioSfxSwapOff;
extern u16 gAudioSfxSwapSource[10]; extern u16 gAudioSfxSwapSource[10];
extern u16 gAudioSfxSwapTarget[10]; extern u16 gAudioSfxSwapTarget[10];
extern u8 gAudioSfxSwapMode[10]; extern u8 gAudioSfxSwapMode[10];
extern u8 D_8016E348[4];
extern u32 sAudioSeqCmds[0x100];
extern unk_D_8016E750 D_8016E750[4]; extern unk_D_8016E750 D_8016E750[4];
extern AudioContext gAudioContext; extern AudioContext gAudioContext;
extern void(*D_801755D0)(void); extern void(*D_801755D0)(void);

2
spec
View file

@ -421,9 +421,7 @@ beginseg
include "build/src/code/code_800EC960.o" include "build/src/code/code_800EC960.o"
include "build/src/code/audio_sound_params.o" include "build/src/code/audio_sound_params.o"
include "build/src/code/code_800F7260.o" include "build/src/code/code_800F7260.o"
include "build/data/code_800F7260.bss.o"
include "build/src/code/code_800F9280.o" include "build/src/code/code_800F9280.o"
include "build/data/code_800F9280.data.o"
include "build/src/code/audio_init_params.o" include "build/src/code/audio_init_params.o"
include "build/src/code/logseverity.o" include "build/src/code/logseverity.o"
include "build/src/code/gfxprint.o" include "build/src/code/gfxprint.o"

View file

@ -1,7 +1,88 @@
#include "global.h" #include "global.h"
u8 D_8016F0E0[0xA0]; // unused
AudioContext gAudioContext;
void (*D_801755D0)(void);
s32 D_801755D8[3]; // unused
const s16 D_8014A6C0[] = { const s16 D_8014A6C0[] = {
0x1C00, // unused 0x1C00, // unused
0x0030, // gTatumsPerBeat 0x0030, // gTatumsPerBeat
}; };
const AudioContextInitSizes D_8014A6C4 = { 0x37F00, 0xE0E0, 0xBCE0 }; 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 },
};

View file

@ -84,8 +84,6 @@ typedef enum {
#define SFX_PLAYER_CHANNEL_OCARINA 13 #define SFX_PLAYER_CHANNEL_OCARINA 13
extern f32 D_8012F6B4[]; // from audio_synthesis
u8 gIsLargeSoundBank[7] = { 0, 0, 0, 1, 0, 0, 0 }; 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.) // 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 // clang-format on
extern u8 D_801333F0;
extern u8 gAudioSfxSwapOff;
/** /**
* BSS * BSS
*/ */

View file

@ -32,22 +32,24 @@ s32 D_8013338C = 0;
char D_80133390[] = "SEQ H"; char D_80133390[] = "SEQ H";
char D_80133398[] = " L"; char D_80133398[] = " L";
// bss SoundBankEntry D_8016BAD0[9];
extern SoundRequest sSoundRequests[0x100]; SoundBankEntry D_8016BC80[12];
extern SoundBankEntry D_8016BAD0[9]; SoundBankEntry D_8016BEC0[22];
extern SoundBankEntry D_8016BC80[12]; SoundBankEntry D_8016C2E0[20];
extern SoundBankEntry D_8016BEC0[22]; SoundBankEntry D_8016C6A0[8];
extern SoundBankEntry D_8016C2E0[20]; SoundBankEntry D_8016C820[3];
extern SoundBankEntry D_8016C6A0[8]; SoundBankEntry D_8016C8B0[5];
extern SoundBankEntry D_8016C820[3]; SoundRequest sSoundRequests[0x100];
extern SoundBankEntry D_8016C8B0[5]; u8 sSoundBankListEnd[7];
extern u8 sSoundBankListEnd[7]; u8 sSoundBankFreeListStart[7];
extern u8 sSoundBankFreeListStart[7]; u8 sSoundBankUnused[7];
extern u8 sSoundBankUnused[7]; ActiveSound gActiveSounds[7][3];
extern u8 sCurSfxPlayerChannelIdx; u8 sCurSfxPlayerChannelIdx;
extern UnusedBankLerp sUnusedBankLerp[7]; u8 gSoundBankMuted[7];
UnusedBankLerp sUnusedBankLerp[7];
// data u16 gAudioSfxSwapSource[10];
u16 gAudioSfxSwapTarget[10];
u8 gAudioSfxSwapMode[10];
// sSoundRequests ring buffer endpoints. read index <= write index, wrapping around mod 256. // sSoundRequests ring buffer endpoints. read index <= write index, wrapping around mod 256.
u8 sSoundRequestWriteIndex = 0; u8 sSoundRequestWriteIndex = 0;

View file

@ -2,9 +2,23 @@
#include "global.h" #include "global.h"
#include "ultra64/abi.h" #include "ultra64/abi.h"
extern u8 sSeqCmdRdPos; typedef struct {
extern u8 sSeqCmdWrPos; u8 unk_0;
extern u8 D_80133410[]; 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. // TODO: clean up these macros. They are similar to ones in code_800EC960.c but without casts.
#define Audio_StartSeq(playerIdx, fadeTimer, seqId) \ #define Audio_StartSeq(playerIdx, fadeTimer, seqId) \
@ -81,12 +95,6 @@ typedef enum {
CMDF CMDF
} SeqCmdType; } 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) { void Audio_ProcessSeqCmd(u32 cmd) {
s32 pad[2]; s32 pad[2];
u16 fadeTimer; u16 fadeTimer;