From 120cff84ab37e27dae526ee8b95295675259191f Mon Sep 17 00:00:00 2001 From: Ryan Dwyer Date: Thu, 24 Feb 2022 21:14:58 +1000 Subject: [PATCH] Attempt to decompile propsnd0f094ef4 --- src/game/bondgun.c | 4 +-- src/game/game_092610.c | 46 +++++++++++++++++++++++++++++++++- src/include/game/game_092610.h | 6 ++--- 3 files changed, 50 insertions(+), 6 deletions(-) diff --git a/src/game/bondgun.c b/src/game/bondgun.c index 877c93c14..f443825f8 100644 --- a/src/game/bondgun.c +++ b/src/game/bondgun.c @@ -27454,7 +27454,7 @@ void bgunPlayPropHitSound(struct gset *gset, struct prop *prop, s32 texturenum) } if (soundnum != -1) { - func0f094ef4(&prop->pos, prop->rooms, soundnum, &spac, &spa8); + propsnd0f094ef4(&prop->pos, prop->rooms, soundnum, &spac, &spa8); if (spac) { sndStart(var80095200, soundnum, handle, -1, -1, -1, -1, -1); @@ -27505,7 +27505,7 @@ void bgunPlayPropHitSound(struct gset *gset, struct prop *prop, s32 texturenum) } if (soundnum != -1) { - func0f094ef4(&prop->pos, prop->rooms, soundnum, &sp90, &sp8c); + propsnd0f094ef4(&prop->pos, prop->rooms, soundnum, &sp90, &sp8c); if (sp90) { sndStart(var80095200, soundnum, handle, -1, -1, -1, -1, -1); diff --git a/src/game/game_092610.c b/src/game/game_092610.c index 5b2cbf193..04f56faa0 100644 --- a/src/game/game_092610.c +++ b/src/game/game_092610.c @@ -4698,7 +4698,7 @@ glabel var7f1ab778 #if VERSION >= VERSION_NTSC_1_0 GLOBAL_ASM( -glabel func0f094ef4 +glabel propsnd0f094ef4 .late_rodata glabel var7f1ab77c .word 0x451c4000 @@ -4801,6 +4801,50 @@ glabel var7f1ab784 /* f095054: 03e00008 */ jr $ra /* f095058: 00000000 */ nop ); + +//void propsnd0f094ef4(struct coord *pos, s16 *rooms, s16 soundnum, s32 *arg3, s32 *arg4) +//{ +// f32 sp5c; +// f32 sp58; +// f32 sp54; +// struct audiorussmapping *russ; +// struct audioconfig *config; +// union soundnumhack sp48; +// union soundnumhack sp44; +// f32 sp40; +// bool sp3c; +// u32 stack[4]; +// +// sp5c = 400; +// sp58 = 2500; +// sp54 = 3000; +// sp44.packed = soundnum; +// sp40 = 9999999; +// sp3c = false; +// +// if (sp44.hasconfig) { +// russ = &g_AudioRussMappings[sp44.confignum]; +// config = &g_AudioConfigs[russ->audioconfig_index]; +// sp5c = config->unk00; +// sp58 = config->unk00; +// sp54 = config->unk00; +// sp48.packed = russ->soundnum; +// +// if (config->flags & AUDIOCONFIGFLAG_01) { +// sp3c = true; +// } +// +// if (sp54 < sp40) { +// sp40 = sp54; +// } +// +// sp48.hasconfig = false; +// soundnum = sp48.packed; +// } +// +// *arg3 = func0f0946b0(pos, sp5c, sp58, sp54, rooms, soundnum, 0x7fff, &sp40); +// *arg4 = func0f094d78(pos, sp5c, sp58, sp54, sp40, sp3c, 0); +//} #endif GLOBAL_ASM( diff --git a/src/include/game/game_092610.h b/src/include/game/game_092610.h index 56c7ebf7f..a4d3655dd 100644 --- a/src/include/game/game_092610.h +++ b/src/include/game/game_092610.h @@ -21,11 +21,11 @@ s16 func0f0939f8(struct audiochannel *channel, struct prop *prop, s16 soundnum, void audioMuteChannel(s32 channelnum); bool audioIsChannelIdle(s32 channelnum); void audioPlayFromProp2(s32 channelnum, s32 soundnum, s16 padnum, struct prop *prop, s32 arg4, s32 arg5, s32 arg6, u16 arg7); -u32 func0f0946b0(void); +s32 func0f0946b0(struct coord *pos, f32 arg2, f32 arg3, f32 arg4, s16 *rooms, s32 soundnum, s32 arg7, f32 *arg8); u32 func0f094940(void); u32 func0f094b1c(void); -u32 func0f094d78(void); -void func0f094ef4(struct coord *pos, s16 *rooms, s32 soundnum, s32 *arg3, s32 *arg4); +s32 func0f094d78(struct coord *pos, f32 arg2, f32 arg3, f32 arg4, f32 arg5, bool arg6, s32 arg7); +void propsnd0f094ef4(struct coord *pos, s16 *rooms, s16 soundnum, s32 *arg3, s32 *arg4); void func0f09505c(struct sndstate *handle, struct coord *pos, f32 arg2, f32 arg3, f32 arg4, s16 *rooms, s16 soundnum, u16 arg7, u32 arg8); s32 propsndGetRandomSparkSound(void); s32 propsndGetDuration60(s32 channelnum);