Update some header files (#373)

Also moved a lot of extern variable declarations into the
 their appropriate header file(s)

Signed-off-by: Taggerung <tyler.taggerung@email.com>
This commit is contained in:
Tyler McGavran 2023-08-20 23:15:07 -04:00 committed by GitHub
parent c124377253
commit 70c082d303
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
9 changed files with 70 additions and 65 deletions

View File

@ -13,8 +13,6 @@ void func_8000F628(void);
void func_8006B7E4(Player* player, s32 arg1);
void func_800267AC(Player* player, s8 arg1, s8 arg2);
void func_8005D290(void);
// TODO: should rot, arg4, and arg5 be rotx, roty, and rotz?
void camera_init(f32 x, f32 y, f32 z, s16 rot, u32 arg4, s32 arg5);

View File

@ -1076,9 +1076,6 @@ block_11:
GLOBAL_ASM("asm/non_matchings/audio/external/func_800C2A2C.s")
#endif
extern u8 D_800EA1E4;
extern u32 D_80192CD0[];
void func_800C3448(s32 arg0) {
D_80192CD0[D_800EA1E4] = arg0;
D_800EA1E4 += 1;
@ -1153,8 +1150,6 @@ s32 func_800C357C(s32 arg0) {
GLOBAL_ASM("asm/non_matchings/audio/external/func_800C357C.s")
#endif
extern unsigned char D_80192CC6[];
void func_800C35E8(u8 arg0) {
D_80192CC6[arg0] = 0;
}
@ -2610,17 +2605,6 @@ void func_800C5BD0(void) {
}
void func_800C2474();
void func_800C284C(u8, u8, u8, s32);
void func_800C2474(void);
void func_800C3F70(void);
void func_800C5A3C(void);
void func_800C400C(void);
void func_800C5BD0(void);
extern u8 D_800E9DA0;
void func_800C5C40(void) {
func_800C2474();
@ -4832,9 +4816,6 @@ void func_800CAC08() {
}
}
extern u8 D_800EA10C[];
extern s8 D_800EA168;
void func_800CAC60(UNUSED s32 arg0) {
if ((D_800EA108 == 0) && (D_800EA0F0 == 0)) {
play_sound(SOUND_ACTION_EXPLOSION_2, D_800EA1C8, 0U, D_800EA1D4, D_800EA1D4, &D_800EA1DC);
@ -4846,11 +4827,6 @@ void func_800CAC60(UNUSED s32 arg0) {
}
}
extern int func_800C56F0(); /* extern */
extern s8 D_800EA168;
extern u8 D_800EA170[];
void func_800CAD40(UNUSED s32 arg0) {
if (D_800EA108 == 0) {
if ((D_800EA170[0] == 0) && (D_800EA170[1] == 0) && (D_800EA170[2] == 0) && (D_800EA170[3] == 0)) {
@ -4953,8 +4929,6 @@ block_4:
GLOBAL_ASM("asm/non_matchings/audio/external/func_800CAEC4.s")
#endif
extern u8 D_800EA170[];
void func_800CAFC0(u8 arg0) {
if (D_800EA108 == 0) {
@ -5052,13 +5026,6 @@ void func_800CB14C(void) {
GLOBAL_ASM("asm/non_matchings/audio/external/func_800CB14C.s")
#endif
extern void func_800C2274(s32); /* extern */
extern void func_800C3478(); /* extern */
extern void func_800C3724(); /* extern */
extern void func_800C59C4(); /* extern */
extern void func_800C8CCC(); /* extern */
extern void func_800CBC24(); /* extern */
// run audio?
void func_800CB2C4() {
func_800C1F8C();

View File

@ -88,47 +88,68 @@ struct Unk_800EA06C {
/* 0x0D */ // u8 compilerPadding0[3];
};
void func_800C35E8(u8);
u16 func_800C3508(s32);
void func_800C5278(u8);
void func_800CB14C(void);
void func_800C8F80(u8, s32);
void func_800C9018(u8, s32);
void func_800C9D0C(s32);
void func_800C97C4(u8);
void func_800C13F0();
void func_800C13FC(OSMesg);
f32 func_800C1480(u8, u8);
s8 func_800C15D0(u8, u8, u8);
f32 func_800C1934(u8, u8);
f32 func_800C1480(u8, u8);
s8 func_800C15D0(u8, u8, u8);
f32 func_800C1934(u8, u8);
struct Unk_8018EFD8 *func_800C1C88(u8, Vec3f, Vec3f, f32*, u8, u32);
void func_800C1DA4(Camera*, Vec3s, struct Unk_8018EFD8*);
void func_800C1E2C(Camera*, Vec3f, struct Unk_8018EFD8*);
void func_800C1F8C();
f32 *func_800C21E8(Vec3f, u32);
void func_800C2274(s32);
void func_800C2474();
void func_800C284C(u8, u8, u8, s32);
void func_800C3724();
void func_800C3448(s32);
void func_800C3478();
u16 func_800C3508(s32);
void func_800C35E8(u8);
void func_800C36C4(s32, u32, u8, s8);
void func_800C3F70(void);
void func_800C400C(void);
void func_800C4084(u16);
void play_sound(u32, f32*, u8, f32*, f32*, u8*);
void func_800C41CC(u8, struct Unk_80191420*);
void func_800C4398();
void func_800C5278(u8);
void func_800C5578(Vec3f, u32);
u8 func_800C56F0();
void func_800C5848();
void func_800C58B8(u8, u8, u16);
void func_800C59C4();
void func_800C5A3C(void);
void func_800C5BD0(void);
void func_800C5C40();
void func_800C5CB8();
void func_800C6758(u8);
void func_800C86D8(u8);
void func_800C8770(u8);
void func_800C89E4();
void func_800C8CCC();
void play_sound2(s32);
void func_800C8EAC(u16);
void func_800C8EF8(u16);
void func_800C8F44(u8);
void func_800C8F80(u8, s32);
void func_800C9018(u8, s32);
void func_800C9060(u8, u32);
void func_800C90F4(u8, uintptr_t);
void func_800C97C4(u8);
void func_800C9A88(u8);
void func_800C9D0C(s32);
void func_800C9D80(Vec3f, Vec3f, u32);
void func_800C9EF4(Vec3f, u32);
void func_800C9F90(u8);
void func_800CA008(u8, u8);
void func_800CA0A0();
void func_800CA0B8();
@ -146,10 +167,15 @@ void func_800CA388(u8);
void func_800CA414(u16, u16);
void func_800CA49C(u8);
void func_800CAACC(u8);
void func_800CAC60(s32);
void func_800CAD40(s32);
void func_800CAEC4(u8, f32);
void func_800CAFC0(u8);
void func_800CB134();
void func_800CB14C(void);
void func_800CB2C4();
void func_800C5CB8(void);
void func_800CBC24();
// Based on SM64, this should be part of data.c's BSS section. Somehow.
extern s32 gAudioErrorFlags;
@ -173,7 +199,11 @@ extern u8 sNumProcessedSoundRequests;
extern u8 sSoundRequestCount;
extern struct Unk_8018FC20 sSoundRequests[0x100];
extern u8 D_80192CC6[];
extern u32 D_80192CD0[];
// Data entries
extern u8 D_800E9DA0;
extern f32 D_800E9E54[4];// = { 0.0f, 0.0f, 0.0f, 0.0f }; /* const */
extern s32 D_800E9E74[4];// = { 0, 0, 0, 0 }; /* const */
extern f32 D_800E9F14[4];// = { 1.0f, 1.0f, 1.0f, 1.0f }; /* const */
@ -188,9 +218,12 @@ extern u8 D_800EA0F0;// = 0;
extern u8 D_800EA0F4;
extern u8 D_800EA104;
extern u8 D_800EA108;// = 0;
extern u8 D_800EA10C[];
extern u16 D_800EA15C;
extern u16 D_800EA160;
extern u8 D_800EA164;
extern s8 D_800EA168;
extern u8 D_800EA170[];
extern s16 D_800EA174;// = 0;
extern f32 D_800EA178;
extern f32 D_800EA17C;
@ -201,6 +234,7 @@ extern u8 D_800EA1C0;// = 0;
extern Vec3f D_800EA1C8;// = {0.0f, 0.0f, 0.0f}
extern Vec3f D_800EA1D4;
extern u8 D_800EA1DC;// = 0;
extern u8 D_800EA1E4;
extern u8 D_800EA244;
extern s8 D_800EA16C;

View File

@ -6,8 +6,6 @@
#include "audio/playback.h"
#include "audio/seqplayer.h"
extern struct SoundAllocPool gNotesAndBuffersPool;
/**
* Given that (almost) all of these are format strings, it is highly likely
* that they are meant to be used in some sort of printf variant. But I don't
@ -155,9 +153,6 @@ void func_800B90E0(struct SoundAllocPool *pool) {
pool->cur = pool->start;
}
extern s32 D_800EA5D0;
extern u8 D_803B71B0[];
// inspired by sound_init_main_pools in sm64
void func_800B90F0(s32 arg0) {
sound_alloc_pool_init(&gAudioInitPool, &D_803B71B0, arg0);
@ -606,8 +601,6 @@ void func_800B9BE4(f32 arg0, f32 arg1, u16 *arg2) {
GLOBAL_ASM("asm/non_matchings/audio/heap/func_800B9BE4.s")
#endif
extern s8 gNumSynthesisReverbs;
// inspired by decrease_reverb_gain from SM64
void func_800B9FB8(void) {
s32 i;

View File

@ -92,6 +92,7 @@ struct PoolSplit2 {
u32 wantTemporary;
}; // size = 0x8
void reset_bank_and_seq_load_status();
void discard_bank(s32 bankId);
void discard_sequence(s32 seqId);
void *soundAlloc(struct SoundAllocPool *pool, u32 size);
@ -100,14 +101,23 @@ void persistent_pool_clear(struct PersistentPool *persistent);
void temporary_pool_clear(struct TemporaryPool *temporary);
void *get_bank_or_seq(s32 poolIdx, s32 arg1, s32 id);
void *get_bank_or_seq_inner(s32 poolIdx, s32 arg1, s32 bankId);
void func_800B9BE4(f32, f32, u16*);
void func_800B90E0(struct SoundAllocPool *pool);
void func_800B90F0(s32);
void func_800B914C(struct PoolSplit*);
void func_800B9FB8();
void seq_and_bank_pool_init(struct PoolSplit2 *a);
void persistent_pools_init(struct PoolSplit *a);
void temporary_pools_init(struct PoolSplit *a);
void *unk_pool1_lookup(s32 poolIdx, s32 id);
extern s32 D_800EA5D0;
extern u8 D_803B71B0[];
// Note: In some .asm files D_803AFBC8 has been replaced with gLeftVolRampings
// That is almost certainly incorrect, but I don't know how to fix it at this point
extern s8 gNumSynthesisReverbs; // D_803AFBC3
extern struct SoundAllocPool gLeftVolRampings;
extern struct SoundAllocPool gAudioSessionPool; // D_803AFBC8
extern struct SoundAllocPool gAudioInitPool; // D_803AFBD8

View File

@ -357,10 +357,6 @@ block_27:
GLOBAL_ASM("asm/non_matchings/audio/load/func_800BAD0C.s")
#endif
extern u32 D_803B70A8; // sDmaBufSize
extern s32 gMaxSimultaneousNotes; // gMaxSimultaneousNotes
extern struct AudioBufferParametersEU gAudioBufferParameters; // gAudioBufferParameters
//extern struct SoundAllocPool gNotesAndBuffersPool; // remove when possible. This is in heap.h
// init_sample_dma_buffers
void func_800BB030(UNUSED s32 arg0) {
s32 i;
@ -921,7 +917,6 @@ block_11:
GLOBAL_ASM("asm/non_matchings/audio/load/func_800BBDDC.s")
#endif
extern volatile s32 D_800EA5DC;
//load_sequence
void func_800BBEF0(u32 player, u32 seqId, s32 loadAsync) {
if (!loadAsync) {

View File

@ -24,6 +24,11 @@ u8 get_missing_bank(u32 seqId, s32 *nonNullCount, s32 *nullCount);
void patch_sound(struct AudioBankSound *sound, u8 *memBase, u8 *offsetBase);
void patch_audio_bank(struct AudioBank *mem, u8 *offset, u32 numInstruments, u32 numDrums);
extern u32 D_803B70A8; // sDmaBufSize
// This is really data, not a volatile
// found in data/data_0DD0A0_2_1_2.s
extern volatile s32 D_800EA5DC;
extern struct Note *gNotes;
extern struct SequencePlayer gSequencePlayers[SEQUENCE_PLAYERS];
extern struct SequenceChannel gSequenceChannels[SEQUENCE_CHANNELS];

View File

@ -254,7 +254,6 @@ void func_8001CA78(UNUSED Player *player, Camera *camera, Vec3f arg2, f32 *arg3,
*arg5 = ((temp_f16 - posZ) * 1) + posZ;
}
//generated by m2c commit bece1d6db17040749f77dbbd090363cc6fb926f9
void func_8001CCEC(Player *player, Camera *camera, Vec3f arg2, f32 *arg3, f32 *arg4, f32 *arg5, UNUSED s32 *arg6, s16 arg7, s16 index) {
Mat3 sp9C;
Vec3f sp90;
@ -892,9 +891,6 @@ void func_8001EA0C(Camera *camera, Player *player, s8 arg2) {
camera->rot[2] = 0;
}
extern s8 D_80164A89;
void func_8001EE98(Player *player, Camera *camera, s8 index) {
s32 cameraIndex;
@ -996,8 +992,6 @@ void func_8001EE98(Player *player, Camera *camera, s8 index) {
}
}
extern s32 D_80164A08[4];
void func_8001F394(Player *player, f32 *arg1) {
f32 var_f0;
UNUSED s32 pad;

View File

@ -56,17 +56,26 @@ typedef struct {
typedef BAD_RETURN(s32) (*CameraEvent)(Camera *c);
typedef CameraEvent CutsceneShot;
void camera_init(f32, f32, f32, s16, u32, s32);
void func_8001CA10(Camera*);
void func_8001CA24(Player*, f32);
void func_8001CA78(Player*, Camera*, Vec3f, f32*, f32*, f32*, s32, s32);
void func_8001CCEC(Player*, Camera*, Vec3f, f32*, f32*, f32*, s32*, s16, s16);
void func_8001D53C(Player*, Camera*, Vec3f, f32*, f32*, f32*, s16, s16);
void func_8001D794(Player*, Camera*, Vec3f, f32*, f32*, f32*, s16);
void func_8001D944(Player*, Camera*, Vec3f, f32*, f32*, f32*, s32*, s16, s16);
void func_8001E0C4(Camera*, Player*, s8);
void func_8001E45C(Camera*, Player*, s8);
void func_8001E8E8(Camera*, Player*, s8);
void func_8001EA0C(Camera*, Player*, s8);
void func_8001F87C(s32);
void func_8001EE98(Player*, Camera*, s8);
void func_8001F394(Player*, f32*);
extern s8 D_80164A89;
extern s32 D_80164A08[4];
extern s32 D_80164A2C;
extern f32 D_80164A30;
extern f32 D_80164A90[];