match and document audiosfx.c (#550)

* match func_80004668 and adjust types

* match _handleEvent

* documentation WIP

* wip

* document audiosfx.c

* fix build

* a few type renames

* update score

* remove comment

* fix type

* fix typo
This commit is contained in:
Unnunu
2025-05-05 15:47:26 +03:00
committed by GitHub
parent 7063517833
commit b88bd4366e
31 changed files with 1109 additions and 742 deletions
-23
View File
@@ -592,28 +592,6 @@ typedef struct {
u8 chan;
} ALOscEvent;
typedef struct ALSoundState {
/* 0x00 */ struct ALSoundState *next;
/* 0x04 */ struct ALSoundState *prev;
/* 0x08 */ struct ALSoundState *unk8;
/* 0x0C */ ALVoice voice;
/* 0x28 */ ALSound *sound; /* sound referenced here */
/* 0x2C */ s16 priority;
/* 0x30 */ struct ALSoundState *unk30;
/* 0x34 */ u8 pad34[0x2];
/* 0x34 */ u8 soundPriority;
/* 0x38 */ s16 vol; /* volume - combined with volume from bank */
/* 0x3A */ ALPan pan; /* pan - 0 = left, 127 = right */
/* 0x3C */ u8 fxMix; /* wet/dry mix - 0 = dry, 127 = wet */
/* 0x3C */ u8 pad3C[2];
/* 0x3E */ u8 flags;
/* 0x3F */ u8 soundState;
} ALSoundState;
typedef struct {
ALSoundState *soundState;
} ALSoundEvent;
typedef struct {
s16 type;
union {
@@ -628,7 +606,6 @@ typedef struct {
ALSeqpSeqEvent spseq;
ALSeqpBankEvent spbank;
ALOscEvent osc;
ALSoundEvent sndpevent;
} msg;
} ALEvent;
+3
View File
@@ -81,4 +81,7 @@
// A few systems in the game use an array as a cache table. This gives you the pointer to the asset
#define ASSETCACHE_PTR(x) ((x << 1) + 1)
#define MIN(a, b) ((a) < (b) ? (a) : (b))
#define MAX(a, b) ((a) > (b) ? (a) : (b))
#endif
+16 -15
View File
@@ -9,6 +9,7 @@
#include "object_properties.h"
#include "gbi.h"
#include "PR/libaudio.h"
#include "audio.h"
typedef struct Vec4f {
union {
@@ -109,7 +110,7 @@ typedef struct SoundMask {
/* 0x11 */ u8 unk11;
/* 0x12 */ u8 unk12;
/* 0x14 */ s32 distance;
/* 0x18 */ ALSoundState *soundPtr;
/* 0x18 */ SoundHandle soundPtr;
/* 0x1C */ struct SoundMask **soundMask;
/* 0x20 */ u8 unk20;
/* 0x21 */ u8 unk21;
@@ -964,7 +965,7 @@ typedef struct Object_Animation {
/* 0x0C */ f32 x;
/* 0x10 */ f32 y;
/* 0x14 */ f32 z;
/* 0x18 */ u8 *unk18;
/* 0x18 */ SoundHandle unk18;
/* 0x1C */ struct Object *unk1C;
/* 0x20 */ s32 unk20;
/* 0x24 */ s16 unk24;
@@ -1031,7 +1032,7 @@ typedef struct Object_Weapon {
/* 0x18 */ u8 weaponID;
/* 0x19 */ s8 checkpoint;
/* 0x19 */ s16 unk1A;
/* 0x19 */ SoundMask *soundMask;
/* 0x19 */ SoundHandle soundMask;
} Object_Weapon;
typedef struct Object_Butterfly {
@@ -1225,11 +1226,11 @@ typedef struct Object_Racer {
/* 0x004 */ s32 unk4;
/* 0x008 */ f32 forwardVel;
/* 0x00C */ f32 animationSpeed;
/* 0x010 */ s32 unk10;
/* 0x014 */ s32 unk14;
/* 0x018 */ s32 unk18;
/* 0x01C */ s32 unk1C;
/* 0x020 */ s32 unk20;
/* 0x010 */ SoundHandle unk10;
/* 0x014 */ SoundHandle unk14;
/* 0x018 */ SoundHandle unk18;
/* 0x01C */ SoundHandle unk1C;
/* 0x020 */ SoundHandle unk20;
/* 0x024 */ SoundMask *soundMask;
/* 0x028 */ u16 lastSoundID;
/* 0x02A */ u16 unk2A;
@@ -1312,7 +1313,7 @@ typedef struct Object_Racer {
/* 0x174 */ s8 balloon_level;
/* 0x175 */ s8 magnetTimer;
/* 0x176 */ s16 unk176;
/* 0x178 */ void *magnetSoundMask;
/* 0x178 */ SoundHandle magnetSoundMask;
/* 0x17C */ SoundMask *shieldSoundMask;
/* 0x180 */ SoundMask *bananaSoundMask;
/* 0x184 */ s8 magnetModelID;
@@ -1427,14 +1428,14 @@ typedef struct Object_Racer {
/* 0x215 */ s8 unk215;
/* 0x216 */ u8 unk216;
/* 0x217 */ u8 unk217;
/* 0x218 */ s32 weaponSoundMask;
/* 0x21C */ SoundMask *unk21C;
/* 0x220 */ s32 unk220;
/* 0x218 */ SoundHandle weaponSoundMask;
/* 0x21C */ SoundHandle unk21C;
/* 0x220 */ SoundHandle unk220;
} Object_Racer;
typedef struct Object_Door {
/* 0x00 */ f32 homeY;
/* 0x04 */ SoundMask *soundMask;
/* 0x04 */ SoundHandle soundMask;
/* 0x08 */ s32 jingleTimer;
/* 0x0A */ s16 jingleCooldown;
/* 0x0E */ s8 doorID;
@@ -1551,7 +1552,7 @@ typedef struct Object_TT {
typedef struct Object_Bridge_WhaleRamp {
/* 0x0 */ f32 homeY;
/* 0x4 */ SoundMask *soundMask;
/* 0x4 */ SoundHandle soundMask;
} Object_Bridge_WhaleRamp;
typedef struct Object_64_80021400 {
@@ -1578,7 +1579,7 @@ typedef struct Object_Log {
typedef struct Object_Fireball_Octoweapon {
u8 pad0[0x1C];
s32 soundMask;
SoundHandle soundMask;
} Object_Fireball_Octoweapon;
typedef struct Object_AnimatedObject {