Merge branch 'master' into 'master'

Document sfxsource related code

See merge request banjo.decomp/banjo-kazooie!83
This commit is contained in:
Banjo Kazooie
2024-09-27 00:05:30 +00:00
55 changed files with 297 additions and 297 deletions

View File

@@ -384,9 +384,9 @@ Actor * func_803055E0(enum actor_e id, s32 pos[3], s32 arg2, s32 arg3, s32 arg4)
Actor * spawn_actor(enum actor_e id, s32 pos[3], s32 yaw);
f32 mapModel_getFloorY(f32[3]);
BKModelBin *func_8030A428(s32);
u8 func_8030D90C(void);
u8 sfxsource_createSfxsourceAndReturnIndex(void);
void sfxsource_setSfxId(u8 indx, enum sfx_e uid);
void func_8030DBB4(u8, f32);
void sfxsource_playSfxAtVolume(u8, f32);
void func_8030DD14(u8, int);
void sfxsource_set_position(u8, f32[3]);
void func_8030DFF0(u8, s32);

View File

@@ -175,7 +175,7 @@ typedef struct actor_s{
u32 unk38_0:1;
u32 unk3C;
s32 unk40;
u32 unk44_31:8;
u32 unk44_31:8; // sfxsource idx
u32 modelCacheIndex:10; //modelCacheIndex
s32 unk44_14:10;
u32 despawn_flag:1;

View File

@@ -446,7 +446,7 @@ typedef struct struct_4D_s{
}struct4Ds;
typedef struct{
u8 unk0;
u8 unk0; // sfxsource index
u8 pad1[0x3];
f32 unk4;
f32 unk8;
@@ -587,7 +587,7 @@ typedef struct struct_65_s{
typedef void (*Struct68DrawMethod)(void *, struct struct_68_s *, f32[3], f32[3], f32, BKModelBin*, Gfx**, Mtx**, Vtx**);
typedef struct struct_68_s{
u8 unk0;
u8 unk0; // sfxsource index
// u8 pad1[0x3];
struct actorMarker_s *unk4;
Struct68DrawMethod unk8;
@@ -619,7 +619,7 @@ typedef struct{
} Struct6Cs;
typedef struct struct_6D_s{
u8 unk0;
u8 unk0; //sfxsource index
// u8 pad1[3];
f32 unk4;
f32 unk8;

View File

@@ -199,11 +199,11 @@ gctransition_reset = 0x8030c07c;
func_8030C704 = 0x8030c8a4;
scissorBox_setSmall = 0x8030c8b0;
func_8030C77C = 0x8030c91c;
func_8030D90C = 0x8030daac;
sfxsource_createSfxsourceAndReturnIndex = 0x8030daac;
func_8030DA44 = 0x8030dbe4;
sfxsource_setSfxId = 0x8030dc20;
sfxsource_setSampleRate = 0x8030dc5c;
func_8030DBB4 = 0x8030dd54;
sfxsource_playSfxAtVolume = 0x8030dd54;
func_8030E2C4 = 0x8030e464;
func_8030E484 = 0x8030e624;
func_8030E58C = 0x8030e72c;

View File

@@ -34,7 +34,7 @@ f32 D_80389C24[3] = {4000.0f, 3500.0f, 0.0f};
/* .bss */
struct {
s32 unk0;
u8 unk4;
u8 sfxsourceIdx;
//u8 pad5[0x3];
f32 unk8;
f32 unkC[3];
@@ -80,7 +80,7 @@ void func_803884A8(s32 arg0, f32 arg1, s32 arg2, s32 arg3){
void func_80388518(s32 arg0){
s32 sp24;
if(D_80389FA0.unk21 == 2){
func_8030E394(D_80389FA0.unk4);
func_8030E394(D_80389FA0.sfxsourceIdx);
func_8030E760(SFX_7F_HEAVYDOOR_SLAM, 0.6f, 20000);
func_8030E760(SFX_7F_HEAVYDOOR_SLAM, 0.8f, 20000);
func_8030E760(SFX_7F_HEAVYDOOR_SLAM, 0.9f, 20000);
@@ -93,12 +93,12 @@ void func_80388518(s32 arg0){
skeletalAnim_set(D_80389FA0.unk0, ASSET_C3_ANIM_CLANKER_IDLE, 0.0f, 10.0f);
}
if(D_80389FA0.unk21 == 2){
func_8030DD90(D_80389FA0.unk4, 0);
func_8030DBB4(D_80389FA0.unk4, 1.0f);
sfxsource_setSfxId(D_80389FA0.unk4, SFX_7D_ANCHOR_LIFTING);
func_8030DD14(D_80389FA0.unk4, 3);
sfxsource_setSampleRate(D_80389FA0.unk4, 27000);
func_8030E2C4(D_80389FA0.unk4);
func_8030DD90(D_80389FA0.sfxsourceIdx, 0);
sfxsource_playSfxAtVolume(D_80389FA0.sfxsourceIdx, 1.0f);
sfxsource_setSfxId(D_80389FA0.sfxsourceIdx, SFX_7D_ANCHOR_LIFTING);
func_8030DD14(D_80389FA0.sfxsourceIdx, 3);
sfxsource_setSampleRate(D_80389FA0.sfxsourceIdx, 27000);
func_8030E2C4(D_80389FA0.sfxsourceIdx);
}
if(D_80389FA0.unk21 == 3){
@@ -249,7 +249,7 @@ int CC_func_80388CA0(void){
void func_80388CB4(void){
if(D_80389FA0.unk21){
skeletalAnim_free(D_80389FA0.unk0);
func_8030DA44(D_80389FA0.unk4);
func_8030DA44(D_80389FA0.sfxsourceIdx);
func_80340690(D_80389FA0.unk18);
func_8034A2A8(D_80389FA0.unk34);
if(model_getVtxList(D_80389FA0.unk24) != D_80389FA0.unk40)
@@ -267,7 +267,7 @@ void func_80388D54(void){
D_80389FA0.unk21 = 0;
if(map_get() == MAP_B_CC_CLANKERS_CAVERN){
D_80389FA0.unk0 = skeletalAnim_new();
D_80389FA0.unk4 = func_8030D90C();
D_80389FA0.sfxsourceIdx = sfxsource_createSfxsourceAndReturnIndex();
D_80389FA0.unk8 = 1.0f;
D_80389FA0.unk18 = func_803406B0();
D_80389FA0.unk21 = 0;

View File

@@ -8,7 +8,7 @@ void func_80388EA4(void);
typedef struct {
u8 unk0;
u8 sfxsourceIdx;
u8 unk1;
u8 unk2;
u8 unk3;
@@ -37,16 +37,16 @@ void CC_func_80386920(Actor *this, s32 next_state){
local->unk14 = 0.0f;
if(this->state == 2 || this->state == 3 || this->state == 4){
func_8030E394(local->unk0);
func_8030E394(local->sfxsourceIdx);
}
if(next_state == 2 || next_state == 3 || next_state == 4){
func_8030DD90(local->unk0, 1);
func_8030DBB4(local->unk0, 0.3f);
sfxsource_setSfxId(local->unk0, 0x3ec);
func_8030DD14(local->unk0, 3);
sfxsource_setSampleRate(local->unk0, 28000);
func_8030E2C4(local->unk0);
func_8030DD90(local->sfxsourceIdx, 1);
sfxsource_playSfxAtVolume(local->sfxsourceIdx, 0.3f);
sfxsource_setSfxId(local->sfxsourceIdx, 0x3ec);
func_8030DD14(local->sfxsourceIdx, 3);
sfxsource_setSampleRate(local->sfxsourceIdx, 28000);
func_8030E2C4(local->sfxsourceIdx);
}
if(next_state == 2 || next_state == 4){
@@ -77,7 +77,7 @@ void func_80386AD0(ActorMarker *arg0, s32 arg1) {
void func_80386AF8(Actor *arg0) {
ActorLocal_CC_530 *local = (ActorLocal_CC_530 *)&arg0->local;
CC_func_80386920(arg0, 0);
func_8030DA44(local->unk0);
func_8030DA44(local->sfxsourceIdx);
}
void func_80386B28(Actor *this){
@@ -94,7 +94,7 @@ void func_80386B28(Actor *this){
if(!this->volatile_initialized){
this->volatile_initialized = TRUE;
marker_setCollisionScripts(this->marker, NULL, func_80386AD0, NULL);
local->unk0 = func_8030D90C();
local->sfxsourceIdx = sfxsource_createSfxsourceAndReturnIndex();
local->unk1 = 0;
local->unk2 = 0;
local->unk10 = this->pitch;

View File

@@ -13,7 +13,7 @@ typedef struct{
}Struct_CCW_14B0_0;
typedef struct {
u8 unk0;
u8 sfxsourceIdx;
// u8 pad1[3];
Struct_CCW_14B0_0 *unk4;
f32 unk8;
@@ -55,7 +55,7 @@ void func_803878A0(Actor *this, s32 next_state) {
void CCW_func_80387A20(Actor *this){
ActorLocal_CCW_14B0 *local = (ActorLocal_CCW_14B0 *)&this->local;
func_8030DA44(local->unk0);
func_8030DA44(local->sfxsourceIdx);
}
void CCW_func_80387A40(Actor *this) {
@@ -76,12 +76,12 @@ void CCW_func_80387A40(Actor *this) {
while((local->unk4->unk0 != 0) && (map_get() != local->unk4->unk0)) {
local->unk4++;
}
local->unk0 = func_8030D90C();
local->sfxsourceIdx = sfxsource_createSfxsourceAndReturnIndex();
local->unk18[0] = local->unk18[1] = local->unk18[2] = 0.0f;
sfxsource_setSfxId(local->unk0, 0x3FA);
func_8030DD14(local->unk0, 2);
func_8030DBB4(local->unk0, 0.9f);
sfxsource_setSampleRate(local->unk0, 0);
sfxsource_setSfxId(local->sfxsourceIdx, 0x3FA);
func_8030DD14(local->sfxsourceIdx, 2);
sfxsource_playSfxAtVolume(local->sfxsourceIdx, 0.9f);
sfxsource_setSampleRate(local->sfxsourceIdx, 0);
func_803878A0(this, 1);
return;
}
@@ -113,11 +113,11 @@ void CCW_func_80387A40(Actor *this) {
if(this->position[0]);
func_8030DBFC(local->unk0, 0.8f, 0.9f, 0.05f);
sfxsource_set_fade_distances(local->unk0, 500.0f, 1500.0f);
sfxsource_set_position(local->unk0, this->position);
func_8030E2C4(local->unk0);
sfxsource_setSampleRate(local->unk0, 2000.0f + 8000.0f*(gu_sqrtf(local->unk18[0]*local->unk18[0] + local->unk18[1]*local->unk18[1] + local->unk18[2]*local->unk18[2])/ local->unk8));
func_8030DBFC(local->sfxsourceIdx, 0.8f, 0.9f, 0.05f);
sfxsource_set_fade_distances(local->sfxsourceIdx, 500.0f, 1500.0f);
sfxsource_set_position(local->sfxsourceIdx, this->position);
func_8030E2C4(local->sfxsourceIdx);
sfxsource_setSampleRate(local->sfxsourceIdx, 2000.0f + 8000.0f*(gu_sqrtf(local->unk18[0]*local->unk18[0] + local->unk18[1]*local->unk18[1] + local->unk18[2]*local->unk18[2])/ local->unk8));
if (!mapSpecificFlags_get(local->unk4->unk2)) {
player_getPosition(sp44);
if (sp44[2] > -600.0f) {

View File

@@ -111,7 +111,7 @@ void func_803891B0(void* marker) {
actor->unk44_31 = func_8030ED2C(SFX_3EC_CCW_DOOR_OPENING, 3);
func_8030DD90(actor->unk44_31, 0);
sfxsource_setSampleRate(actor->unk44_31, 0x2AF8);
func_8030DBB4(actor->unk44_31, 0.3f);
sfxsource_playSfxAtVolume(actor->unk44_31, 0.3f);
func_8030E2C4(actor->unk44_31);
}

View File

@@ -5,7 +5,7 @@
extern void func_8030DBFC(u8, f32, f32, f32);
typedef struct{
u8 unk0;
u8 sfxsourceIdx;
//u8 pad1[3];
ActorMarker *unk4;
f32 unk8[3];
@@ -91,7 +91,7 @@ void func_8038717C(Actor *this){
ActorLocal_CCW_950 *local;
local = (ActorLocal_CCW_950 *)&this->local;
func_8030DA44(local->unk0);
func_8030DA44(local->sfxsourceIdx);
}
void chwasp_update(Actor *this) {
@@ -113,13 +113,13 @@ void chwasp_update(Actor *this) {
if (!this->volatile_initialized) {
this->volatile_initialized = TRUE;
this->marker->actorFreeFunc = func_8038717C;
local->unk0 = func_8030D90C();
local->sfxsourceIdx = sfxsource_createSfxsourceAndReturnIndex();
local->unk4 = 0;
local->unk14 = 1000.0f;
sfxsource_setSfxId(local->unk0, 0x3FA);
func_8030DD14(local->unk0, 2);
func_8030DBB4(local->unk0, 0.9f);
sfxsource_setSampleRate(local->unk0, 0);
sfxsource_setSfxId(local->sfxsourceIdx, 0x3FA);
func_8030DD14(local->sfxsourceIdx, 2);
sfxsource_playSfxAtVolume(local->sfxsourceIdx, 0.9f);
sfxsource_setSampleRate(local->sfxsourceIdx, 0);
marker_setCollisionScripts(this->marker, func_80387124, NULL, CCW_func_80387150);
chwasp_setState(this, 1);
return;
@@ -204,12 +204,12 @@ void chwasp_update(Actor *this) {
if(this->state);
if (this->state == 2) {
func_8030DBFC(local->unk0, 1.0f, 1.1f, 0.05f);
func_8030DBFC(local->sfxsourceIdx, 1.0f, 1.1f, 0.05f);
} else {
func_8030DBFC(local->unk0, 0.8f, 0.9f, 0.05f);
func_8030DBFC(local->sfxsourceIdx, 0.8f, 0.9f, 0.05f);
}
sfxsource_set_fade_distances(local->unk0, 500.0f, 1500.0f);
sfxsource_set_position(local->unk0, this->position);
func_8030E2C4(local->unk0);
sfxsource_setSampleRate(local->unk0, (s32) ((local->unk18 / local->unk14) * 10000.0f));
sfxsource_set_fade_distances(local->sfxsourceIdx, 500.0f, 1500.0f);
sfxsource_set_position(local->sfxsourceIdx, this->position);
func_8030E2C4(local->sfxsourceIdx);
sfxsource_setSampleRate(local->sfxsourceIdx, (s32) ((local->unk18 / local->unk14) * 10000.0f));
}

View File

@@ -261,7 +261,7 @@ void func_80388F90(Actor *this){
ActorLocal_FP_2350 *local = (ActorLocal_FP_2350 *)&this->local;
func_8030DB04(this->unk44_31, 32000, this->position, 1000.0f, 4000.0f);
func_8030DBB4(this->unk44_31, local->unk8);
sfxsource_playSfxAtVolume(this->unk44_31, local->unk8);
func_8030E2C4(this->unk44_31);
}

View File

@@ -68,7 +68,7 @@ void __chXmasTree_spawnStar(void *marker){
void __chXmasTree_80387038(Actor *this){
if(func_8030E3FC(this->unk44_31))
func_8030E394(this->unk44_31);
func_8030DBB4(this->unk44_31, randf2(0.9f, 1.1f));
sfxsource_playSfxAtVolume(this->unk44_31, randf2(0.9f, 1.1f));
func_8030E2C4(this->unk44_31);
}
@@ -93,7 +93,7 @@ void chXmasTree_update(Actor *this){
this->marker->collidable = FALSE;
marker_setFreeMethod(this->marker, __chXmasTree_free);
if(this->unk44_31 == 0){
this->unk44_31 = func_8030D90C();
this->unk44_31 = sfxsource_createSfxsourceAndReturnIndex();
sfxsource_setSfxId(this->unk44_31, SFX_415_UNKNOWN);
func_8030DD14(this->unk44_31, 3);
sfxsource_setSampleRate(this->unk44_31, 28000);

View File

@@ -3,7 +3,7 @@
#include "variables.h"
struct {
u8 unk0;
u8 sfxsourceIdx;
f32 unk4[3];
} D_803935E0;
@@ -11,8 +11,8 @@ struct {
void func_803918C0(void){
Actor *actor;
if(map_get() == MAP_7F_FP_WOZZAS_CAVE){
D_803935E0.unk0 = func_8030ED2C(SFX_128_FIRE_CRACKING, 2);
func_8030DBB4(D_803935E0.unk0, 1.0f);
D_803935E0.sfxsourceIdx = func_8030ED2C(SFX_128_FIRE_CRACKING, 2);
sfxsource_playSfxAtVolume(D_803935E0.sfxsourceIdx, 1.0f);
actor = actorArray_findActorFromActorId(0x353);
if(actor){
D_803935E0.unk4[0] = actor->position_x;
@@ -26,15 +26,15 @@ void func_803918C0(void){
}
void func_8039195C(void){
if(D_803935E0.unk0){
func_8030DA44(D_803935E0.unk0);
D_803935E0.unk0 = 0;
if(D_803935E0.sfxsourceIdx){
func_8030DA44(D_803935E0.sfxsourceIdx);
D_803935E0.sfxsourceIdx = 0;
}
}
void func_80391994(void){
if(map_get() == MAP_7F_FP_WOZZAS_CAVE){
func_8030DB04(D_803935E0.unk0, 22000, D_803935E0.unk4, 400.0f, 1200.0f);
func_8030E2C4(D_803935E0.unk0);
func_8030DB04(D_803935E0.sfxsourceIdx, 22000, D_803935E0.unk4, 400.0f, 1200.0f);
func_8030E2C4(D_803935E0.sfxsourceIdx);
}
}

View File

@@ -5,7 +5,7 @@
extern func_802EBA98(s32, f32[3], s32, f32, s32, f32[3], f32, f32[3]);
typedef struct {
u8 unk0[2];
u8 unk0[2]; // array of sfxsource indexes
//u8 pad2[2];
f32 unk4;
f32 unk8;
@@ -121,8 +121,8 @@ void chGobi1_update(Actor *this){
marker->collidable = TRUE;
GV_D_80391A40.unk0 = 0;
GV_D_80391A40.unk1 = 0;
local->unk0[0] = func_8030D90C();
local->unk0[1] = func_8030D90C();
local->unk0[0] = sfxsource_createSfxsourceAndReturnIndex();
local->unk0[1] = sfxsource_createSfxsourceAndReturnIndex();
local->unk8 = 0.0f;
local->unkC = 0.0f;
local->unk10 = 0.0f;

View File

@@ -222,7 +222,7 @@ void func_8038DBDC(Actor *this){
if(1.0 < this->unk1C[1]){
this->unk1C[1] -= 0.1;
}
func_8030DBB4(this->unk44_31, this->unk1C[1]);
sfxsource_playSfxAtVolume(this->unk44_31, this->unk1C[1]);
}
}
break;

View File

@@ -166,10 +166,10 @@ void func_8038B124(Actor *this){
this->unk138_27 = 1;
this->unk1C[1] = 0.0f;
if(this->unk44_31 == 0){
this->unk44_31 = func_8030D90C();
this->unk44_31 = sfxsource_createSfxsourceAndReturnIndex();
sfxsource_setSfxId(this->unk44_31, SFX_3EC_CCW_DOOR_OPENING);
func_8030DD14(this->unk44_31, 2);
func_8030DBB4(this->unk44_31, 0.1f);
sfxsource_playSfxAtVolume(this->unk44_31, 0.1f);
sfxsource_setSampleRate(this->unk44_31, 32000);
}
}//L8038B25C

View File

@@ -172,10 +172,10 @@ void GV_func_8038BEA0(Actor *this){
if(!this->volatile_initialized){
this->volatile_initialized = TRUE;
if(this->unk44_31 == 0){
this->unk44_31 = func_8030D90C();
this->unk44_31 = sfxsource_createSfxsourceAndReturnIndex();
sfxsource_setSfxId(this->unk44_31, SFX_3EC_CCW_DOOR_OPENING);
func_8030DD14(this->unk44_31, 2);
func_8030DBB4(this->unk44_31, 0.1f);
sfxsource_playSfxAtVolume(this->unk44_31, 0.1f);
sfxsource_setSampleRate(this->unk44_31, 32000);
}
if(this->unk100 == NULL){

View File

@@ -5,7 +5,7 @@
typedef struct {
s32 unk0;
u8 unk4;
u8 sfxsourceIdx;
//u8 pad5[3];
u8 *unk8;
f32 unkC;
@@ -74,15 +74,15 @@ void func_8038C8A0(Actor *this, s32 next_state){
this->marker->propPtr->unk8_3 = (next_state == 1) ? FALSE : TRUE;
this->marker->collidable = (next_state == 1) ? FALSE : TRUE;
if(this->state == 4 || this->state == 5)
func_8030DA44(local->unk4);
func_8030DA44(local->sfxsourceIdx);
if(next_state == 4 || next_state == 5){
local->unk4 = func_8030D90C();
sfxsource_setSfxId(local->unk4, SFX_3EC_CCW_DOOR_OPENING);
func_8030DD14(local->unk4, 3);
func_8030DBB4(local->unk4, 0.8f);
sfxsource_setSampleRate(local->unk4, 0);
func_8030E2C4(local->unk4);
local->sfxsourceIdx = sfxsource_createSfxsourceAndReturnIndex();
sfxsource_setSfxId(local->sfxsourceIdx, SFX_3EC_CCW_DOOR_OPENING);
func_8030DD14(local->sfxsourceIdx, 3);
sfxsource_playSfxAtVolume(local->sfxsourceIdx, 0.8f);
sfxsource_setSampleRate(local->sfxsourceIdx, 0);
func_8030E2C4(local->sfxsourceIdx);
}//L8038C9B8
if(next_state == 2){
@@ -243,7 +243,7 @@ void func_8038CC98(Actor *this){
else{
f12 = 1.0f;
}
func_8030DB04(local->unk4, f12*24000.0f, this->position, 200.0f, 1500.0f);
func_8030DB04(local->sfxsourceIdx, f12*24000.0f, this->position, 200.0f, 1500.0f);
if(!func_8038D388()){
func_8038C8A0(this, 3);
}

View File

@@ -78,7 +78,7 @@ void MMM_func_8038ADF0(Struct_MMM_47D0_0 *arg0, Struct68s *arg1) {
sp3F = func_80351758(arg1);
sfxsource_setSfxId(sp3F, SFX_3EC_CCW_DOOR_OPENING);
func_8030DD14(sp3F, 3);
func_8030DBB4(sp3F, 0.6f);
sfxsource_playSfxAtVolume(sp3F, 0.6f);
sfxsource_setSampleRate(sp3F, 0);
func_8030E2C4(sp3F);
func_8035179C(arg1, sp28);

View File

@@ -76,7 +76,7 @@ void func_8038B630(Struct5Fs *arg0, Struct68s *arg1){
sp20 = alCents2Ratio(func_80389BBC()*100);
phi_s0 = func_80351758(arg1);
func_8030E394(phi_s0);
func_8030DBB4(phi_s0, sp20);
sfxsource_playSfxAtVolume(phi_s0, sp20);
sfxsource_setSfxId(phi_s0, 0x3f3);
func_8030DD14(phi_s0, 3);
sfxsource_setSampleRate(phi_s0, 0x7fff);

View File

@@ -4,7 +4,7 @@
/* typedefs and declarations */
typedef struct {
u8 sfxsource_index;
u8 sfxsourceIdx;
}ActorLocal_RBB_27E0;
void func_80388C20(Actor *this);
@@ -38,7 +38,7 @@ void func_80388BD0(Actor *this, s32 arg1){
void func_80388BE8(Actor *actor){
ActorLocal_RBB_27E0 *local = (ActorLocal_RBB_27E0 *)&actor->local;
if(actor->modelCacheIndex == 0x17b){
func_8030DA44(local->sfxsource_index);
func_8030DA44(local->sfxsourceIdx);
}
}
@@ -51,14 +51,14 @@ void func_80388C20(Actor *this){
this->marker->actorFreeFunc = func_80388BE8;
this->volatile_initialized = TRUE;
if(this->modelCacheIndex == 0x17B){
local->sfxsource_index = func_8030D90C();
sfxsource_set_fade_distances(local->sfxsource_index, 1000.0f, 2000.0f);
sfxsource_set_position(local->sfxsource_index, &this->position);
func_8030DBB4(local->sfxsource_index, 0.5f);
sfxsource_setSfxId(local->sfxsource_index, SFX_9F_GENERATOR_RUNNING);
func_8030DD14(local->sfxsource_index, 3);
sfxsource_setSampleRate(local->sfxsource_index, 0);
func_8030E2C4(local->sfxsource_index);
local->sfxsourceIdx = sfxsource_createSfxsourceAndReturnIndex();
sfxsource_set_fade_distances(local->sfxsourceIdx, 1000.0f, 2000.0f);
sfxsource_set_position(local->sfxsourceIdx, &this->position);
sfxsource_playSfxAtVolume(local->sfxsourceIdx, 0.5f);
sfxsource_setSfxId(local->sfxsourceIdx, SFX_9F_GENERATOR_RUNNING);
func_8030DD14(local->sfxsourceIdx, 3);
sfxsource_setSampleRate(local->sfxsourceIdx, 0);
func_8030E2C4(local->sfxsourceIdx);
}//L80388CFC
if(this->state == 0){
if(this->modelCacheIndex == 0x17B){
@@ -78,7 +78,7 @@ void func_80388C20(Actor *this){
if(360.0f <= this->roll)
this->roll -= 360.0f;
if(this->modelCacheIndex == 0x17B){
func_8030DB04(local->sfxsource_index, 25000, &this->position, 1000.0f, 2000.0f);
func_8030DB04(local->sfxsourceIdx, 25000, &this->position, 1000.0f, 2000.0f);
}
}
}

View File

@@ -145,10 +145,10 @@ void func_80388FA0(Actor *this, s32 arg1){
if(myOther && other && myOther->id == 0xB8)
subaddie_set_state_with_direction(other, 3, 0.0001f, 1);
actor_playAnimationOnce(this);
this->unk44_31 = func_8030D90C();
this->unk44_31 = sfxsource_createSfxsourceAndReturnIndex();
sfxsource_setSfxId(this->unk44_31, 0x3f9);
func_8030DD14(this->unk44_31, 2);
func_8030DBB4(this->unk44_31, 1.4f);
sfxsource_playSfxAtVolume(this->unk44_31, 1.4f);
sfxsource_setSampleRate(this->unk44_31, 0x6590);
func_8028F918(0);
break;
@@ -170,10 +170,10 @@ void func_80388FA0(Actor *this, s32 arg1){
subaddie_set_state_with_direction(other, 2, 0.0001f, 1);
animctrl_setSmoothTransition(this->animctrl, 1);
actor_playAnimationOnce(this);
this->unk44_31 = func_8030D90C();
this->unk44_31 = sfxsource_createSfxsourceAndReturnIndex();
sfxsource_setSfxId(this->unk44_31, 0x3f9);
func_8030DD14(this->unk44_31, 2);
func_8030DBB4(this->unk44_31, 1.4f);
sfxsource_playSfxAtVolume(this->unk44_31, 1.4f);
sfxsource_setSampleRate(this->unk44_31, 0x6590);
chsmmole_setSpiralMountainStaticCamera(this);
func_8028F94C(2, this->position);

View File

@@ -102,11 +102,11 @@ void func_80386C2C(ParticleEmitter *p_ctrl, f32 *arg1, s32 arg2, f32 arg3) {
void SM_func_80386D68(Actor *this){
FUNC_8030E8B4(SFX_9B_BOULDER_BREAKING_1, 1.0f, 32000, this->position, 1000, 2000);
this->unk44_31 = func_8030D90C();
this->unk44_31 = sfxsource_createSfxsourceAndReturnIndex();
sfxsource_setSfxId(this->unk44_31, 0x3F9);
func_8030DD14(this->unk44_31, 3);
sfxsource_setSampleRate(this->unk44_31, 32000);
func_8030DBB4(this->unk44_31, (0.01 < (2.0 - this->scale))? (2.0 - this->scale): 0.01);
sfxsource_playSfxAtVolume(this->unk44_31, (0.01 < (2.0 - this->scale))? (2.0 - this->scale): 0.01);
func_8030E2C4(this->unk44_31);
func_80386B04(partEmitMgr_newEmitter(0xA), this->position, 0xA, this->scale);
func_80386C2C(partEmitMgr_newEmitter(0x10), this->position, 0x10, this->scale);

View File

@@ -96,7 +96,7 @@ struct{
BKModel *model1;
BKModel *model2;
u8 unk8;
u8 unk9;
u8 sfxsourceIdx;
u8 unkA;
u8 padB[1];
f32 unkC;
@@ -320,7 +320,7 @@ void func_8038AC48(LetterFloorTile *arg0) {
D_8038D720.unkC = 0.0f;
mapSpecificFlags_set(1, TRUE);
fileProgressFlag_set(0xFA, TRUE);
func_8030E2C4(D_8038D720.unk9);
func_8030E2C4(D_8038D720.sfxsourceIdx);
func_8038A258(2);
} else if (var_v0 & 0xE) {
func_8035644C((i_ptr - codesTable) - 1 + FILEPROG_BE_CHEATO_BLUEEGGS);
@@ -377,7 +377,7 @@ void func_8038AFC8(void){
void func_8038B04C(void){
if(D_8038D720.model1){
func_8038A258(0);
func_8030DA44(D_8038D720.unk9);
func_8030DA44(D_8038D720.sfxsourceIdx);
func_8030DA44(D_8038D720.unkA);
}
}
@@ -423,13 +423,13 @@ void func_8038B094(void){
D_8038D720.unk10 = 0;
D_8038D720.unkC = 0.0f;
D_8038D720.unk9 = func_8030D90C();
func_8030DBB4(D_8038D720.unk9, 0.1f);
sfxsource_setSfxId(D_8038D720.unk9, SFX_3EC_CCW_DOOR_OPENING);
func_8030DD14(D_8038D720.unk9, 3);
sfxsource_setSampleRate(D_8038D720.unk9, 28000);
D_8038D720.sfxsourceIdx = sfxsource_createSfxsourceAndReturnIndex();
sfxsource_playSfxAtVolume(D_8038D720.sfxsourceIdx, 0.1f);
sfxsource_setSfxId(D_8038D720.sfxsourceIdx, SFX_3EC_CCW_DOOR_OPENING);
func_8030DD14(D_8038D720.sfxsourceIdx, 3);
sfxsource_setSampleRate(D_8038D720.sfxsourceIdx, 28000);
D_8038D720.unkA = func_8030D90C();
D_8038D720.unkA = sfxsource_createSfxsourceAndReturnIndex();
sfxsource_setSfxId(D_8038D720.unkA, SFX_3_DULL_CANNON_SHOT);
func_8030DD14(D_8038D720.unkA, 3);
sfxsource_setSampleRate(D_8038D720.unkA, 0x7fff);
@@ -495,7 +495,7 @@ void func_8038B2F0(void) {
if (D_8038D720.unkC > 4.0f) {
D_8038D720.unk8 = 3;
func_8030E2C4(D_8038D720.unkA);
func_8030E394(D_8038D720.unk9);
func_8030E394(D_8038D720.sfxsourceIdx);
}
}
}

View File

@@ -46,11 +46,11 @@ void func_80244BB0(s32 arg0, s32 arg1, s32 arg2, f32 arg3){
s32 i;
u8 indx;
if(func_8030ED70(func_80255D44(arg1))){
i = func_8030D90C();
i = sfxsource_createSfxsourceAndReturnIndex();
indx = i;
if(i){
sfxsource_setSfxId(indx, func_80255D44(arg1));
func_8030DBB4(indx, arg3);
sfxsource_playSfxAtVolume(indx, arg3);
sfxsource_setSampleRate(indx, arg2);
func_8030E2C4(indx);
func_80244C78(arg0);

View File

@@ -32,7 +32,7 @@ void bsbflap_init(void) {
func_8029E070(1);
miscFlag_set(MISC_FLAG_12_HAS_FLAPPED);
func_8029E3C0(0, 2.5f);
D_8037D30C = func_8030D90C();
D_8037D30C = sfxsource_createSfxsourceAndReturnIndex();
func_80299BD4();
D_8037D301 = 0;
D_8037D308 = 0.0f;
@@ -42,7 +42,7 @@ void bsbflap_init(void) {
void func_802A2790(s32 arg0, f32 arg1, s32 arg2) {
func_8030E394(D_8037D30C);
sfxsource_setSfxId(D_8037D30C, arg0);
func_8030DBB4(D_8037D30C, arg1);
sfxsource_playSfxAtVolume(D_8037D30C, arg1);
sfxsource_setSampleRate(D_8037D30C, arg2);
func_8030DD90(D_8037D30C, 0);
func_8030DD14(D_8037D30C, 3);

View File

@@ -118,7 +118,7 @@ void __bsblongleg_enter(void){
}
void bsblongleg_enter_init(void){
D_8037D361 = func_8030D90C();
D_8037D361 = sfxsource_createSfxsourceAndReturnIndex();
sfxsource_setSfxId(D_8037D361, SFX_2C_PULLING_NOISE);
func_8030E04C(D_8037D361, 0.8f, 1.9f, 1.2f);
miscFlag_clear(MISC_FLAG_E_TOUCHING_WADING_BOOTS);
@@ -275,7 +275,7 @@ void bsblongleg_exit_init(void){
baanim_setUpdateType(BAANIM_UPDATE_1_NORMAL);
func_8029957C(2);
baphysics_set_target_horizontal_velocity(0.0f);
D_8037D361 = func_8030D90C();
D_8037D361 = sfxsource_createSfxsourceAndReturnIndex();
sfxsource_setSfxId(D_8037D361, SFX_2C_PULLING_NOISE);
func_8030E04C(D_8037D361, 1.4f, 0.4f, -1.2f);
}

View File

@@ -34,7 +34,7 @@ void bsbshock_charge_init(void){
func_8029E064(1);
func_8029E070(1);
func_80299BD4();
D_8037D382 = func_8030D90C();
D_8037D382 = sfxsource_createSfxsourceAndReturnIndex();
sfxsource_setSfxId(D_8037D382, SFX_2C_PULLING_NOISE);
func_8030E04C(D_8037D382, 1.4f, 0.4f, -1.2f);
baModel_80292158(-50.0f);

View File

@@ -42,7 +42,7 @@ void chBeehive_update(Actor *this){
if(!this->volatile_initialized){
marker_setCollisionScripts(this->marker, NULL, NULL, chBeehive_die);
this->marker->propPtr->unk8_3 = 1;
this->unk44_31 = func_8030D90C();
this->unk44_31 = sfxsource_createSfxsourceAndReturnIndex();
this->volatile_initialized = TRUE;
this->unk38_0 = volatileFlag_get(VOLATILE_FLAG_1)| volatileFlag_get(VOLATILE_FLAG_1F_IN_CHARACTER_PARADE);
}//L802CE960
@@ -77,7 +77,7 @@ void chBeehive_update(Actor *this){
func_8030E394(this->unk44_31);
sfxsource_setSfxId(this->unk44_31, SFX_67_BEEHIVE_CLONK);
sfxsource_setSampleRate(this->unk44_31, 12000);
func_8030DBB4(this->unk44_31, (animctrl_getAnimTimer(this->animctrl) + 0.9) - 0.4);
sfxsource_playSfxAtVolume(this->unk44_31, (animctrl_getAnimTimer(this->animctrl) + 0.9) - 0.4);
sfxsource_set_position(this->unk44_31, this->position);
sfxsource_set_fade_distances(this->unk44_31, 300.0f, 1500.0f);
func_8030DD14(this->unk44_31, 3);

View File

@@ -236,12 +236,12 @@ void func_802C6240(Actor *this){
this->unk28 += 5.7;
tmp_a0 = this->unk44_31;
if(this->unk44_31 == 0){
this->unk44_31 = func_8030D90C();
this->unk44_31 = sfxsource_createSfxsourceAndReturnIndex();
tmp_a0 = this->unk44_31;
}
sfxsource_setSfxId(tmp_a0, SFX_18_BIGBUTT_SLIDE);
func_8030DD14(this->unk44_31, 2);
func_8030DBB4(this->unk44_31, (randf()*0.1 - 0.05) + 1.0);
sfxsource_playSfxAtVolume(this->unk44_31, (randf()*0.1 - 0.05) + 1.0);
func_8030E2C4(this->unk44_31);
}
else{//L802C69FC

View File

@@ -68,7 +68,7 @@ void chfirefx_update(Actor *this){
if(this->unkF4_8 != 0x32){
this->unk1C[0] = 1.0f;
this->unk44_31 = func_8030ED2C(SFX_128_FIRE_CRACKING, 2);
func_8030DBB4(this->unk44_31, 1.1f);
sfxsource_playSfxAtVolume(this->unk44_31, 1.1f);
}
else{
this->unk1C[0] = 0.0f;

View File

@@ -211,7 +211,7 @@ void func_8035F138(Actor *this) {
if (this->unk1C[1] < 1.9) {
this->unk1C[1] += 0.1;
}
func_8030DBB4(this->unk44_31, this->unk1C[1]);
sfxsource_playSfxAtVolume(this->unk44_31, this->unk1C[1]);
if (actor_animationIsAt(this, 0.66f)) {
FUNC_8030E8B4(SFX_F9_GRUNTLING_NOISE_1, 0.8f, 32000, this->position, 1750, 3500);
@@ -272,7 +272,7 @@ void func_8035F138(Actor *this) {
if (this->unk1C[1] > 1.0) {
this->unk1C[1] -= 0.1;
}
func_8030DBB4(this->unk44_31, this->unk1C[1]);
sfxsource_playSfxAtVolume(this->unk44_31, this->unk1C[1]);
}
if (animctrl_getAnimTimer(this->animctrl) <= 0.02) {
subaddie_set_state_with_direction(this, 1, 0.02f, 1);

View File

@@ -128,10 +128,10 @@ void func_802D9530(Actor *this){
}
subaddie_set_state_with_direction(this, 4, 0.0001f, 1);
actor_playAnimationOnce(this);
this->unk44_31 = func_8030D90C();
this->unk44_31 = sfxsource_createSfxsourceAndReturnIndex();
sfxsource_setSfxId(this->unk44_31, SFX_3F9_UNKNOWN);
func_8030DD14(this->unk44_31, 2);
func_8030DBB4(this->unk44_31, 1.4f);
sfxsource_playSfxAtVolume(this->unk44_31, 1.4f);
sfxsource_setSampleRate(this->unk44_31, 26000);
func_8028F918(0);
}
@@ -255,10 +255,10 @@ void func_802D9ADC(Actor *this){
animctrl_setSmoothTransition(this->animctrl, TRUE);
subaddie_set_state_with_direction(this, 2, 0.0001f, 1);
actor_playAnimationOnce(this);
this->unk44_31 = func_8030D90C();
this->unk44_31 = sfxsource_createSfxsourceAndReturnIndex();
sfxsource_setSfxId(this->unk44_31, SFX_3F9_UNKNOWN);
func_8030DD14(this->unk44_31, 2);
func_8030DBB4(this->unk44_31, 1.4f);
sfxsource_playSfxAtVolume(this->unk44_31, 1.4f);
sfxsource_setSampleRate(this->unk44_31, 26000);
chmole_setStaticCamera(this);
func_8028F94C(2, this->position);

View File

@@ -9,12 +9,12 @@ typedef struct{
s16 unk4;
s16 unk6;
s32 unk8;
f32 unkC;
f32 unkC; // volume for sfxsource
f32 unk10;
}struct49570s;
typedef struct{
u8 unk0;
u8 sfxsourceIdx;
}ActorLocal_Core2_49570;
/* .data */
@@ -36,9 +36,9 @@ void func_802D0500(Actor *this){
ActorLocal_Core2_49570 *local = (ActorLocal_Core2_49570 *)this->local;
if(D_80367340[(s32)this->yaw].unk8 != -1){
if(this->unk1C[0] == this->unk1C[1])
sfxsource_setSampleRate(local->unk0, D_80367340[(s32)this->yaw].unk8);
sfxsource_setSampleRate(local->sfxsourceIdx, D_80367340[(s32)this->yaw].unk8);
else{
sfxsource_setSampleRate(local->unk0, (s32)((D_80367340[(s32)this->yaw].unk8/this->unk1C[1])*this->unk1C[0]));
sfxsource_setSampleRate(local->sfxsourceIdx, (s32)((D_80367340[(s32)this->yaw].unk8/this->unk1C[1])*this->unk1C[0]));
}
}
@@ -46,9 +46,9 @@ void func_802D0500(Actor *this){
void func_802D05A0(Actor *this, s32 next_state){
ActorLocal_Core2_49570 *local = (ActorLocal_Core2_49570 *)this->local;
if(this->state == 2 && local->unk0){
func_8030DA44(local->unk0);
local->unk0 = 0;
if(this->state == 2 && local->sfxsourceIdx){
func_8030DA44(local->sfxsourceIdx);
local->sfxsourceIdx = 0;
}
if(next_state == 2){
this->unk1C[0] = 0.0f;
@@ -56,17 +56,17 @@ void func_802D05A0(Actor *this, s32 next_state){
if(-1.0f != D_80367340[(s32)this->yaw].unk10){
this->unk1C[1] = D_80367340[(s32)this->yaw].unk10;
}
local->unk0 = func_8030D90C();
sfxsource_setSfxId(local->unk0, D_80367340[(s32)this->yaw].unk0);
func_8030DD14(local->unk0, 3);
func_8030DFF0(local->unk0, 1);
sfxsource_set_position(local->unk0, this->position);
sfxsource_set_fade_distances(local->unk0, D_80367340[(s32)this->yaw].unk4*this->scale, D_80367340[(s32)this->yaw].unk6*this->scale);
func_8030DFB4(local->unk0, 1);
local->sfxsourceIdx = sfxsource_createSfxsourceAndReturnIndex();
sfxsource_setSfxId(local->sfxsourceIdx, D_80367340[(s32)this->yaw].unk0);
func_8030DD14(local->sfxsourceIdx, 3);
func_8030DFF0(local->sfxsourceIdx, 1);
sfxsource_set_position(local->sfxsourceIdx, this->position);
sfxsource_set_fade_distances(local->sfxsourceIdx, D_80367340[(s32)this->yaw].unk4*this->scale, D_80367340[(s32)this->yaw].unk6*this->scale);
func_8030DFB4(local->sfxsourceIdx, 1);
func_802D0500(this);
if(-1.0f != D_80367340[(s32)this->yaw].unkC)
func_8030DBB4(local->unk0, D_80367340[(s32)this->yaw].unkC);
func_8030E2C4(local->unk0);
sfxsource_playSfxAtVolume(local->sfxsourceIdx, D_80367340[(s32)this->yaw].unkC);
func_8030E2C4(local->sfxsourceIdx);
}//L802D0780
this->state = next_state;
}

View File

@@ -31,7 +31,7 @@ u8 D_8037C6C4;
u32 D_8037C6C8;
f32 D_8037C6CC;
struct{
u8 unk0;
u8 sfxsourceIdx;
f32 unk4;
f32 unk8;
f32 unkC;
@@ -74,11 +74,11 @@ void func_80299650(f32 arg1, f32 arg2){
void func_802997E8(void){
f32 f12;
f32 f2;
if(D_8037C6D0.unk0){
if(D_8037C6D0.sfxsourceIdx){
D_8037C6D0.unk4 += time_getDelta();
if(D_8037C6D0.unk8 <= D_8037C6D0.unk4){
func_8030DA44(D_8037C6D0.unk0);
D_8037C6D0.unk0 = 0;
func_8030DA44(D_8037C6D0.sfxsourceIdx);
D_8037C6D0.sfxsourceIdx = 0;
}
else{
f12 = D_8037C6D0.unk4/D_8037C6D0.unk8;
@@ -91,7 +91,7 @@ void func_802997E8(void){
else{
f2 = ml_map_f(f12, D_8037C6D0.unk10, 1.0f, D_8037C6D0.unk18, D_8037C6D0.unk1C);
}
func_8030DBB4(D_8037C6D0.unk0, f2);
sfxsource_playSfxAtVolume(D_8037C6D0.sfxsourceIdx, f2);
}
}
}
@@ -102,28 +102,28 @@ void func_802998D0(u8 indx){
void func_80299900(void){
D_8037C6C8 = 0;
D_8037C6C0 = func_8030D90C();
D_8037C6C0 = sfxsource_createSfxsourceAndReturnIndex();
func_8030DD14(D_8037C6C0, 3);
func_8030DD90(D_8037C6C0, 0);
D_8037C6CC = 1.0f;
D_8037C6C1 = func_8030D90C();
D_8037C6C1 = sfxsource_createSfxsourceAndReturnIndex();
sfxsource_setSfxId(D_8037C6C1, SFX_18_BIGBUTT_SLIDE);
func_8030DD54(D_8037C6C1, func_802998D0);
sfxsource_setSampleRate(D_8037C6C1, 28000);
func_8030DD14(D_8037C6C1, 2);
func_8030DD90(D_8037C6C1, 0);
D_8037C6C2 = func_8030D90C();
D_8037C6C2 = sfxsource_createSfxsourceAndReturnIndex();
func_8030DD90(D_8037C6C2, 0);
D_8037C6C3 = func_8030D90C();
D_8037C6C3 = sfxsource_createSfxsourceAndReturnIndex();
func_8030DD90(D_8037C6C3, 0);
D_8037C6C4 = func_8030D90C();
D_8037C6C4 = sfxsource_createSfxsourceAndReturnIndex();
func_8030DD90(D_8037C6C4, 0);
func_8030DD14(D_8037C6C4, 3);
D_8037C6D0.unk0 = 0;
D_8037C6D0.sfxsourceIdx = 0;
}
void func_80299A20(void){
@@ -132,8 +132,8 @@ void func_80299A20(void){
func_8030DA44(D_8037C6C3);
func_8030DA44(D_8037C6C2);
func_8030DA44(D_8037C6C4);
if(D_8037C6D0.unk0){
func_8030DA44(D_8037C6D0.unk0);
if(D_8037C6D0.sfxsourceIdx){
func_8030DA44(D_8037C6D0.sfxsourceIdx);
}
}
@@ -145,7 +145,7 @@ void func_80299AAC(void){
D_8037C6CC += randf()*0.1 - 0.05;
D_8037C6CC = ml_max_f(D_8037C6CC, 0.9f);
D_8037C6CC = ml_min_f(D_8037C6CC, 1.5f);
func_8030DBB4(D_8037C6C1, D_8037C6CC);
sfxsource_playSfxAtVolume(D_8037C6C1, D_8037C6CC);
func_8030E2C4(D_8037C6C1);
}
@@ -162,7 +162,7 @@ void func_80299BD4(void){
void func_80299BFC(f32 arg0){
sfxsource_setSfxId(D_8037C6C0, D_80364564[D_8037C6C8]);
func_8030DBB4(D_8037C6C0, arg0);
sfxsource_playSfxAtVolume(D_8037C6C0, arg0);
func_8030E2C4(D_8037C6C0);
++D_8037C6C8;
if(D_8037C6C8 >= 8)
@@ -171,7 +171,7 @@ void func_80299BFC(f32 arg0){
void func_80299C78(u8 indx, enum sfx_e sfx_id, f32 arg2, s32 arg3){
sfxsource_setSfxId(indx, sfx_id);
func_8030DBB4(indx, arg2);
sfxsource_playSfxAtVolume(indx, arg2);
sfxsource_setSampleRate(indx, arg3);
func_8030E2C4(indx);
}

View File

@@ -24,7 +24,7 @@ void func_8029CFF8(void){
void func_8029D01C(void){
miscFlag_clear(MISC_FLAG_13);
D_8037D210 = func_8030D90C();
D_8037D210 = sfxsource_createSfxsourceAndReturnIndex();
D_8037D212 = 0;
}
@@ -33,7 +33,7 @@ void func_8029D050(void){
func_8030E394(D_8037D210);
sfxsource_setSfxId(D_8037D210, SFX_14D_BANJO_FREEZING);
sfxsource_setSampleRate(D_8037D210, 30000);
func_8030DBB4(D_8037D210, 1.2f);
sfxsource_playSfxAtVolume(D_8037D210, 1.2f);
func_8030DD14(D_8037D210, 3);
func_8030E2C4(D_8037D210);
@@ -45,7 +45,7 @@ void func_8029D0D8(void) {
func_8030E394(D_8037D210);
sfxsource_setSfxId(D_8037D210, SFX_B0_SIZZLING_NOISE);
sfxsource_setSampleRate(D_8037D210, 32000);
func_8030DBB4(D_8037D210, randf2(0.7f, 0.8f));
sfxsource_playSfxAtVolume(D_8037D210, randf2(0.7f, 0.8f));
func_8030DD14(D_8037D210, 3);
func_8030E2C4(D_8037D210);
}
@@ -111,7 +111,7 @@ void func_8029D2F8(void) {
func_8030E394(D_8037D210);
sfxsource_setSfxId(D_8037D210, SFX_134_FREEZING_SHIVER);
sfxsource_setSampleRate(D_8037D210, 20000);
func_8030DBB4(D_8037D210, 1.2f);
sfxsource_playSfxAtVolume(D_8037D210, 1.2f);
func_8030DD14(D_8037D210, 3);
func_8030E2C4(D_8037D210);
D_8037D211 = 2;
@@ -143,7 +143,7 @@ void func_8029D4D8(void) {
if (!(D_8037D224 > 0.0f)) {
D_8037D212 += -1;
D_8037D224 = randf2(0.12f, 0.22f);
func_8030DBB4(D_8037D210, randf2(0.95f, 1.05f));
sfxsource_playSfxAtVolume(D_8037D210, randf2(0.95f, 1.05f));
func_8030E2C4(D_8037D210);
}
}

View File

@@ -6,7 +6,7 @@
extern f32 func_8025715C(f32, f32);
extern f32 func_802575BC(f32);
extern f32 func_80309B24(f32[3]);
extern void func_8030DBB4(u8, f32);
extern void sfxsource_playSfxAtVolume(u8, f32);
extern void func_802CC340(Actor *, f32[3]);
extern bool func_80320DB0(f32[3], f32, f32[3], u32);
@@ -270,8 +270,8 @@ void func_802CCBF4(Actor *this) {
ActorLocal_Core2_45310 * local;
local = (ActorLocal_Core2_45310 * )&this->local;
local->unk0 = func_8030D90C();
func_8030DBB4(local->unk0, 0.9f);
local->unk0 = sfxsource_createSfxsourceAndReturnIndex();
sfxsource_playSfxAtVolume(local->unk0, 0.9f);
sfxsource_setSfxId(local->unk0, 0x3FA);
func_8030DD14(local->unk0, 2);
sfxsource_setSampleRate(local->unk0, 0);
@@ -350,7 +350,7 @@ void func_802CCC5C(Actor *this) {
spB0 += randf2(-0.05, 0.05);
spB0 = (spB0 < spAC) ? spAC : MIN(spA8 , spB0);
}
func_8030DBB4(local->unk0, spB0);
sfxsource_playSfxAtVolume(local->unk0, spB0);
phi_f12 = 1.0f - ml_distance_vec3f(spC4, this->position) / 2000.0f;
if(0.0f > phi_f12){
phi_f12 = 0.0f;
@@ -429,7 +429,7 @@ void func_802CCC5C(Actor *this) {
} else {
phi_f2 = 1.0 - ((local->unk4 - 0.2) / 0.6);
}
func_8030DBB4(local->unk0, phi_f2 * 0.3999999999999999 + 1.0);
sfxsource_playSfxAtVolume(local->unk0, phi_f2 * 0.3999999999999999 + 1.0);
}
}
}

View File

@@ -296,7 +296,7 @@ void chBeeSwarm_802CF610(Actor *this, ParticleEmitter *p_ctrl, f32 position[3])
void chBeeSwarm_802CF7CC(Actor *this) {
if (D_8037DCBC == 0) {
this->unk44_31 = func_8030D90C();
this->unk44_31 = sfxsource_createSfxsourceAndReturnIndex();
sfxsource_setSfxId(this->unk44_31, SFX_3FA_HONEYCOMB_TALKING);
func_8030DD14(this->unk44_31, 2);
func_8030DD90(this->unk44_31, 2);

View File

@@ -78,16 +78,16 @@ s32 func_802F4420(Struct5Ds *this){
}
void func_802F44AC(Struct5Ds *this, enum sfx_e sfx_id, f32 arg2, f32 arg3, s32 arg4){
u8 s0;
u8 sfxsourceIdx;
f32 f0;
s0 = (this->unk1E) ? this->unk1C : this->unk1D;
sfxsourceIdx = (this->unk1E) ? this->unk1C : this->unk1D;
sfxsource_setSfxId(s0, sfx_id);
sfxsource_setSfxId(sfxsourceIdx, sfx_id);
f0 = arg3*0.5;
func_8030DBB4(s0, randf2(arg2 - f0, arg2 + f0));
sfxsource_setSampleRate(s0, arg4);
func_8030E2C4(s0);
sfxsource_playSfxAtVolume(sfxsourceIdx, randf2(arg2 - f0, arg2 + f0));
sfxsource_setSampleRate(sfxsourceIdx, arg4);
func_8030E2C4(sfxsourceIdx);
this->unk1E ^= 1;
}
@@ -107,7 +107,7 @@ void func_802F4554(Struct5Ds *this, enum sfx_e sfx_id, f32 arg2, f32 arg3, f32 a
sfxsource_setSfxId(sp20, sfx_id);
range = arg4*0.5;
func_8030DBB4(sp20, randf2(sp24 - range, sp24 + range));
sfxsource_playSfxAtVolume(sp20, randf2(sp24 - range, sp24 + range));
sfxsource_setSampleRate(sp20, arg5);
func_8030E2C4(sp20);
this->unk1E ^= 1;
@@ -165,11 +165,11 @@ Struct5Ds *func_802F47D0(void){
this->unk1E = 0;
this->unk1F = 1;
this->unk1C = func_8030D90C();
this->unk1C = sfxsource_createSfxsourceAndReturnIndex();
func_8030DD14(this->unk1C, 3);
func_8030DD90(this->unk1C, 0);
this->unk1D = func_8030D90C();
this->unk1D = sfxsource_createSfxsourceAndReturnIndex();
func_8030DD14(this->unk1D, 3);
func_8030DD90(this->unk1D, 0);

View File

@@ -31,7 +31,7 @@ s32 func_802F9AA8(enum sfx_e arg0){
if(iPtr == endPtr)
iPtr = vector_pushBackNew(&D_803810A0);
iPtr->unk0 = func_8030D90C();
iPtr->unk0 = sfxsource_createSfxsourceAndReturnIndex();
sfxsource_setSfxId(iPtr->unk0, arg0);
func_8030DD14(iPtr->unk0, 3);
sfxsource_setSampleRate(iPtr->unk0, 0x64);
@@ -105,7 +105,7 @@ void func_802F9DB8(s32 arg0, f32 arg1, f32 arg2, f32 arg3){
ptr->unk20 = arg1;
ptr->unk1C = arg2;
if(ptr->unk0){
func_8030DBB4(ptr->unk0, (arg1 + arg2)/2);
sfxsource_playSfxAtVolume(ptr->unk0, (arg1 + arg2)/2);
}
}
@@ -118,7 +118,7 @@ void func_802F9E44(s32 arg0, f32 arg1, f32 arg2, f32 arg3, f32 arg4){
ptr->unk2C = arg3;
ptr->unk30 = arg4;
if(ptr->unk0){
func_8030DBB4(ptr->unk0, arg3);
sfxsource_playSfxAtVolume(ptr->unk0, arg3);
}
}
@@ -204,7 +204,7 @@ void func_802FA0F8(void){
else if(iPtr->unk3E == 2){//L802FA238
f20 = ml_map_f(iPtr->unk4, iPtr->unk24, iPtr->unk28, iPtr->unk2C, iPtr->unk30);
}
func_8030DBB4(iPtr->unk0, f20);
sfxsource_playSfxAtVolume(iPtr->unk0, f20);
if(iPtr->unk3C){
if(0.0f == iPtr->unk10){

View File

@@ -44,7 +44,7 @@ typedef struct {
u8 unk43_1:2;
}SfxSource;
u8 func_8030D90C(void);
u8 sfxsource_createSfxsourceAndReturnIndex(void);
void sfxsource_setSfxId(u8 indx, enum sfx_e uid);
void sfxsource_setSampleRate(u8, s32);
void func_8030DD90(u8, s32);
@@ -193,20 +193,20 @@ void func_8030CC90(SfxSource *arg0){
}
}
s32 func_8030CCF0(SfxSource *arg0, s32 arg1){
f32 plyr_pos[3];
s32 func_8030CCF0(SfxSource *arg0, s32 sample_rate){
f32 player_position[3];
f32 diff[3];
f32 dist_sqr;
s32 retVal;
__sfx_getPlayerPositionIfPresent(plyr_pos);
diff[0] = arg0->position[0] - plyr_pos[0];
diff[1] = arg0->position[1] - plyr_pos[1];
diff[2] = arg0->position[2] - plyr_pos[2];
__sfx_getPlayerPositionIfPresent(player_position);
diff[0] = arg0->position[0] - player_position[0];
diff[1] = arg0->position[1] - player_position[1];
diff[2] = arg0->position[2] - player_position[2];
dist_sqr = diff[0]*diff[0] + diff[1]*diff[1] + diff[2]*diff[2];
if( dist_sqr < arg0->fade_inner_radius_sqr)
retVal = arg1;
retVal = sample_rate;
else if( dist_sqr < arg0->fade_outer_radius_sqr)
retVal = arg0->unk14 + (((arg0->fade_outer_radius_sqr-dist_sqr))/(arg0->fade_outer_radius_sqr - arg0->fade_inner_radius_sqr))*(arg1 - arg0->unk14);
retVal = arg0->unk14 + (((arg0->fade_outer_radius_sqr-dist_sqr))/(arg0->fade_outer_radius_sqr - arg0->fade_inner_radius_sqr))*(sample_rate - arg0->unk14);
else
retVal = arg0->unk14;
return retVal;
@@ -421,11 +421,11 @@ void func_8030D644(void){
}
void func_8030D6C4(enum sfx_e uid, f32 arg1, s32 arg2, s32 arg3, s32 arg4){
u8 indx = func_8030D90C();
u8 indx = sfxsource_createSfxsourceAndReturnIndex();
if(indx){
sfxsource_setSfxId(indx, uid);
sfxsource_setSampleRate(indx, arg2);
func_8030DBB4(indx, arg1);
sfxsource_playSfxAtVolume(indx, arg1);
func_8030DCCC(indx, arg3);
func_8030DD14(indx, 1);
func_8030DD90(indx, arg4);
@@ -477,7 +477,7 @@ void func_8030D8DC(void){
func_8030D8B4();
}
u8 func_8030D90C(void){
u8 sfxsource_createSfxsourceAndReturnIndex(void){
u8 s1 = sfxsource_getNewIndex();
SfxSource *s0;
@@ -550,7 +550,7 @@ void func_8030DB04(u8 indx, s32 arg1, f32 arg2[3], f32 min_dist, f32 max_dist){
sfxsource_setSampleRate(indx, (s32)arg1*temp_f2);
}
void func_8030DBB4(u8 indx, f32 arg1){
void sfxsource_playSfxAtVolume(u8 indx, f32 arg1){
SfxSource *temp_v0;
if(indx){
temp_v0 = sfxsource_at(indx);
@@ -577,7 +577,7 @@ void func_8030DBFC(u8 indx, f32 arg1, f32 arg2, f32 arg3){
temp_f2 = temp_f0;
}
}
func_8030DBB4(indx, temp_f2);
sfxsource_playSfxAtVolume(indx, temp_f2);
}
@@ -700,7 +700,7 @@ void func_8030E04C(u8 indx, f32 arg1, f32 arg2, f32 arg3){
ptr->unk43_1 = 1;
ptr->unk1C = arg3;
ptr->unk20 = arg2;
func_8030DBB4(indx, arg1);
sfxsource_playSfxAtVolume(indx, arg1);
}
}
@@ -722,7 +722,7 @@ void func_8030E0FC(u8 indx, f32 arg1, f32 arg2, f32 arg3){
ptr->unk24 = arg3;
ptr->unk20 = arg1;
ptr->unk1C = arg2;
func_8030DBB4(indx, (arg1 + arg2)/2);
sfxsource_playSfxAtVolume(indx, (arg1 + arg2)/2);
}
}
@@ -901,19 +901,19 @@ void func_8030E760(enum sfx_e uid, f32 arg1, s32 arg2){
void sfx_play(enum sfx_e uid, f32 arg1, u32 sampleRate, f32 position[3], f32 minFadeDistance, f32 maxFadeDistance, s32 arg6){
u8 sfxsource;
f32 plyr_pos[3];
f32 player_position[3];
__sfx_getPlayerPositionIfPresent(plyr_pos);
if( !(maxFadeDistance <= ml_distance_vec3f(plyr_pos, position))
__sfx_getPlayerPositionIfPresent(player_position);
if( !(maxFadeDistance <= ml_distance_vec3f(player_position, position))
&& levelSpecificFlags_validateCRC2()
&& dummy_func_80320240()
){
sfxsource = func_8030D90C();
sfxsource = sfxsource_createSfxsourceAndReturnIndex();
if(sfxsource){
func_8030DD90(sfxsource, arg6); // priority ?
sfxsource_setSfxId(sfxsource, uid);
sfxsource_setSampleRate(sfxsource, sampleRate);
func_8030DBB4(sfxsource, arg1); // volume ?
sfxsource_playSfxAtVolume(sfxsource, arg1); // volume ?
sfxsource_set_fade_distances(sfxsource, minFadeDistance, maxFadeDistance);
sfxsource_set_position(sfxsource, position);
func_8030DD14(sfxsource, 1);
@@ -980,11 +980,11 @@ void func_8030EC20(enum sfx_e uid, f32 arg1, f32 arg2, u32 arg3, u32 arg4){
}
void func_8030EC74(enum sfx_e uid, f32 arg1, f32 arg2, u32 arg3, u32 arg4, f32 arg5[3]){
u8 indx = func_8030D90C();
u8 indx = sfxsource_createSfxsourceAndReturnIndex();
if(indx){
sfxsource_setSfxId(indx, uid);
sfxsource_setSampleRate(indx, sfx_randi2(arg3, arg4));
func_8030DBB4(indx, sfx_randf2(arg1, arg2));
sfxsource_playSfxAtVolume(indx, sfx_randf2(arg1, arg2));
sfxsource_set_position(indx, arg5);
func_8030DD14(indx, 1);
func_8030E2C4(indx);
@@ -996,7 +996,7 @@ void func_8030ED0C(void){
}
u8 func_8030ED2C(enum sfx_e uid, s32 arg1){
u8 indx = func_8030D90C();
u8 indx = sfxsource_createSfxsourceAndReturnIndex();
sfxsource_setSfxId(indx, uid);
func_8030DD14(indx, arg1);
return indx;

View File

@@ -49,14 +49,14 @@ void func_8029099C(void){
}
void func_802909C4(void){
D_8037C040 = func_8030D90C();
D_8037C040 = sfxsource_createSfxsourceAndReturnIndex();
D_8037C050.unk0 = 1.0f;
D_8037C048.unk4 = D_8037C050.unk4 = 13000;
D_8037C048.unk0 = D_8037C050.unk0;
sfxsource_setSfxId(D_8037C040, 0x3fa);
func_8030DD14(D_8037C040, 2);
func_8030DBB4(D_8037C040, D_8037C048.unk0);
sfxsource_playSfxAtVolume(D_8037C040, D_8037C048.unk0);
sfxsource_setSampleRate(D_8037C040, D_8037C048.unk4);
D_8037C058 = 0.0f;
}
@@ -65,7 +65,7 @@ void func_80290A6C(void){
D_8037C058 += time_getDelta();
D_8037C048.unk0 = func_80290920(D_8037C048.unk0, D_8037C050.unk0, 0.3f);
D_8037C048.unk4 = func_80290920((f32)D_8037C048.unk4, (f32)D_8037C050.unk4, 100.0f);
func_8030DBB4(D_8037C040, func_80290890(D_8037C058) + D_8037C048.unk0);
sfxsource_playSfxAtVolume(D_8037C040, func_80290890(D_8037C058) + D_8037C048.unk0);
sfxsource_setSampleRate(D_8037C040, D_8037C048.unk4);
func_8030E2C4(D_8037C040);
}

View File

@@ -24,7 +24,7 @@ void func_80323170(void){
}
void func_80323190(void){
D_80383370 = func_8030D90C();
D_80383370 = sfxsource_createSfxsourceAndReturnIndex();
func_8030DD14(D_80383370, 3);
sfxsource_setSfxId(D_80383370, SFX_21_EGG_BOUNCE_1);
sfxsource_setSampleRate(D_80383370, 12000);

View File

@@ -757,7 +757,7 @@ void func_803422AC(ActorMarker *caller, enum asset_e text_id, s32 arg2){
s32 func_803422D4(Actor *arg0, Union_glspline *arg1, SplineList *arg2){
s32 sp84;
u8 sp83;
u8 sfxsourceIdx;
f32 sp7C;
s32 sp78;
s32 sp74;
@@ -792,18 +792,18 @@ s32 func_803422D4(Actor *arg0, Union_glspline *arg1, SplineList *arg2){
sp74 = arg1->t0.unk4.common.bit15 * 8;
sp70 = arg1->t0.unk10.common.bit7;
if (func_8030ED70(func_80255D44(sp78))){
sp83 = func_8030D90C();
if (sp83 == 0){
sfxsourceIdx = sfxsource_createSfxsourceAndReturnIndex();
if (sfxsourceIdx == 0){
return sp84;
}
sfxsource_setSfxId(sp83, func_80255D44(sp78));
func_8030DBB4(sp83, sp7C);
sfxsource_setSampleRate(sp83, sp74);
func_8030E2C4(sp83);
sfxsource_setSfxId(sfxsourceIdx, func_80255D44(sp78));
sfxsource_playSfxAtVolume(sfxsourceIdx, sp7C);
sfxsource_setSampleRate(sfxsourceIdx, sp74);
func_8030E2C4(sfxsourceIdx);
if (D_803858A0[sp70] != 0){
func_8030DA44(D_803858A0[sp70]);
}
D_803858A0[sp70] = sp83;
D_803858A0[sp70] = sfxsourceIdx;
} else {
func_8030E6A4(func_80255D44(sp78), sp7C, sp74);
}
@@ -1267,10 +1267,10 @@ void func_80343E20(s32 arg0, s32 arg1, f32 arg2, s32 arg3) {
u8 temp_v0;
if (func_8030ED70(func_80255D44(arg0)) != 0) {
temp_v0 = func_8030D90C();
temp_v0 = sfxsource_createSfxsourceAndReturnIndex();
if (temp_v0 != 0) {
sfxsource_setSfxId(temp_v0, func_80255D44(arg0));
func_8030DBB4(temp_v0, arg2);
sfxsource_playSfxAtVolume(temp_v0, arg2);
sfxsource_setSampleRate(temp_v0, arg1);
func_8030E2C4(temp_v0);
if (D_803858A0[arg3] != 0) {

View File

@@ -243,13 +243,13 @@ void func_8034E174(Struct6Ds *arg0){
void func_8034E1A4(Struct6Ds *arg0, enum sfx_e sfx_id, f32 arg2, f32 arg3){
if(arg0->unk0 == 0){
arg0->unk0 = func_8030D90C();
arg0->unk0 = sfxsource_createSfxsourceAndReturnIndex();
}
arg0->unk20 = arg2;
arg0->unk24 = arg3;
sfxsource_setSfxId(arg0->unk0, sfx_id);
func_8030DD14(arg0->unk0, 3);
func_8030DBB4(arg0->unk0, (arg2 +arg3)/2);
sfxsource_playSfxAtVolume(arg0->unk0, (arg2 +arg3)/2);
sfxsource_setSampleRate(arg0->unk0, 32000);
func_8030E2C4(arg0->unk0);
}
@@ -335,7 +335,7 @@ void func_8034E26C(Struct6Ds *arg0, BKModel *model, s32 mesh_id) {
if (0.85 <= sp28) {
sp20 = (1.0 - ((sp28 - 0.85) / 0.15000000000000002)) * sp20;
}
func_8030DBB4(arg0->unk0, sp24);
sfxsource_playSfxAtVolume(arg0->unk0, sp24);
sfxsource_setSampleRate(arg0->unk0, sp20);
}
switch (arg0->unk29) {

View File

@@ -7,7 +7,7 @@ void func_8030DE44(u8, s32, f32);
struct {
ParticleEmitter *unk0;
u8 unk4;
u8 unk5;
u8 sfxsourceIdx;
u8 pad6[2];
}D_803720A0 = {NULL, 0, 0};
@@ -21,7 +21,7 @@ void func_8034F6F0(Gfx **gdl, Mtx **mptr, s32 vptr){
void func_8034F734(void){
if(D_803720A0.unk0){
func_8030DA44(D_803720A0.unk5);
func_8030DA44(D_803720A0.sfxsourceIdx);
particleEmitter_free(D_803720A0.unk0);
}
}
@@ -47,18 +47,18 @@ void func_8034F774(void){
particleEmitter_setStartingScaleRange(D_803720A0.unk0, 1.8f, 2.2f);
particleEmitter_emitUniformLine(D_803720A0.unk0, &sp38, &sp2C, 10);
particleEmitter_setSpawnInterval(D_803720A0.unk0, 0.0f);
D_803720A0.unk5 = func_8030D90C();
D_803720A0.sfxsourceIdx = sfxsource_createSfxsourceAndReturnIndex();
sp44[0] = (sp38[0] + sp2C[0])/2;
sp44[1] = (sp38[1] + sp2C[1])/2;
sp44[2] = (sp38[2] + sp2C[2])/2;
sfxsource_setSfxId(D_803720A0.unk5, 0x3EC);
func_8030DD14(D_803720A0.unk5, 3);
func_8030DFF0(D_803720A0.unk5, 1);
sfxsource_set_position(D_803720A0.unk5, &sp44);
sfxsource_set_fade_distances(D_803720A0.unk5, 400.0f, 3200.0f);
func_8030DE44(D_803720A0.unk5, 2, 0.5f);
func_8030E2C4(D_803720A0.unk5);
sfxsource_setSfxId(D_803720A0.sfxsourceIdx, 0x3EC);
func_8030DD14(D_803720A0.sfxsourceIdx, 3);
func_8030DFF0(D_803720A0.sfxsourceIdx, 1);
sfxsource_set_position(D_803720A0.sfxsourceIdx, &sp44);
sfxsource_set_fade_distances(D_803720A0.sfxsourceIdx, 400.0f, 3200.0f);
func_8030DE44(D_803720A0.sfxsourceIdx, 2, 0.5f);
func_8030E2C4(D_803720A0.sfxsourceIdx);
}
}

View File

@@ -281,7 +281,7 @@ bool func_80351724(void * arg0){
s32 func_80351758(Struct68s *arg0){
if(arg0->unk0 == 0){
arg0->unk0 = func_8030D90C();
arg0->unk0 = sfxsource_createSfxsourceAndReturnIndex();
}
return arg0->unk0;
}

View File

@@ -12,7 +12,7 @@ Actor *func_80358344(ActorMarker *marker, Gfx **gfx, Mtx **mtx, Vtx **vtx);
void func_80358684(Actor *this);
typedef struct {
u8 unk0;
u8 sfxsourceIdx;
f32 unk4;
f32 unk8[3];
f32 unk14;
@@ -220,8 +220,8 @@ void func_80358490(Actor *this) {
ActorLocal_core2_D0CA0 *local;
local = (ActorLocal_core2_D0CA0 *)&this->local;
if(local->unk0 != 0){
func_8030DA44(local->unk0);
if(local->sfxsourceIdx != 0){
func_8030DA44(local->sfxsourceIdx);
}
}
@@ -229,11 +229,11 @@ void func_803584BC(Actor *this) {
ActorLocal_core2_D0CA0 *local;
local = (ActorLocal_core2_D0CA0 *)&this->local;
local->unk0 = func_8030D90C();
func_8030DBB4(local->unk0, 0.9f);
sfxsource_setSfxId(local->unk0, 0x3FA);
func_8030DD14(local->unk0, 2);
sfxsource_setSampleRate(local->unk0, 0);
local->sfxsourceIdx = sfxsource_createSfxsourceAndReturnIndex();
sfxsource_playSfxAtVolume(local->sfxsourceIdx, 0.9f);
sfxsource_setSfxId(local->sfxsourceIdx, 0x3FA);
func_8030DD14(local->sfxsourceIdx, 2);
sfxsource_setSampleRate(local->sfxsourceIdx, 0);
}
@@ -301,24 +301,24 @@ void func_80358684(Actor *this) {
local->unk30[2] = (s16) (s32) this->position[2];
local->unk30[1] += 0xC8;
marker_setCollisionScripts(this->marker, func_803582C4, NULL, func_80358304);
local->unk0 = 0;
local->sfxsourceIdx = 0;
func_80357F0C(this, 1);
}
if (!subaddie_playerIsWithinSphere(this, 4000)) {
if (local->unk0 != 0) {
func_8030DA44(local->unk0);
local->unk0 = 0U;
if (local->sfxsourceIdx != 0) {
func_8030DA44(local->sfxsourceIdx);
local->sfxsourceIdx = 0U;
}
return;
}
if (local->unk0 == 0) {
if (local->sfxsourceIdx == 0) {
func_803584BC(this);
}
player_getPosition(sp94);
if ((this->state > 0) && (this->state < 6)) {
sp84 = func_8030E200(local->unk0);
sp84 = func_8030E200(local->sfxsourceIdx);
if (local->unk39 == 1) {
sp80 = 0.9f;
sp7C = 1.0f;
@@ -336,12 +336,12 @@ void func_80358684(Actor *this) {
: (sp7C < sp84) ? sp7C
: sp84;
}
func_8030DBB4(local->unk0, sp84);
sfxsource_playSfxAtVolume(local->sfxsourceIdx, sp84);
sp78 = 1.0f - ml_distance_vec3f(sp94, this->position) / 2000.0f;
sp78 = (0.0f > sp78) ? 0 : sp78;
if (sp78 > 0.0f) {
sfxsource_setSampleRate(local->unk0, (s32) (sp78 * 10000.0f));
func_8030E2C4(local->unk0);
sfxsource_setSampleRate(local->sfxsourceIdx, (s32) (sp78 * 10000.0f));
func_8030E2C4(local->sfxsourceIdx);
}
}
if (this->unk10_25) {
@@ -406,7 +406,7 @@ void func_80358684(Actor *this) {
if (this->state == 3) {
if (0.0f <= local->unk4 - 0.2) {
sp84 = (0.8 < local->unk4) ? 0.0f : (f32) (1.0 - ((local->unk4 - 0.2) / 0.6));
func_8030DBB4(local->unk0, 1.0 + (sp84 * 0.3999999999999999));
sfxsource_playSfxAtVolume(local->sfxsourceIdx, 1.0 + (sp84 * 0.3999999999999999));
}
}
}

View File

@@ -747,7 +747,7 @@ void func_80315C90(GcZoombox *this, s32 arg1) {
if ( -2.0f > phi_f14) {
phi_f12 -= (phi_f14 - -2.0f);
}
func_8030DBB4(this->unk108[current_sfx], alCents2Ratio(phi_f12 *100.0f));
sfxsource_playSfxAtVolume(this->unk108[current_sfx], alCents2Ratio(phi_f12 *100.0f));
} else {
phi_f12 = (phi_f14 - phi_f2 < 0.1) ? 0.1 : phi_f14 - phi_f2;
phi_f12 = (phi_f12 >= 2.0)? 1.99 : phi_f12;
@@ -755,7 +755,7 @@ void func_80315C90(GcZoombox *this, s32 arg1) {
phi_f14 = (phi_f14 - phi_f18 < 2.0) ? phi_f14 - phi_f18 : 2.0;
phi_f14 = (0.1 < phi_f14) ? phi_f14 : 0.1;
func_8030DBB4(this->unk108[current_sfx], randf2(phi_f12, phi_f14));
sfxsource_playSfxAtVolume(this->unk108[current_sfx], randf2(phi_f12, phi_f14));
}
phi_a0 = (this->unk124[current_sfx] - phi_s1_3 < 0)? 0 : this->unk124[current_sfx] - phi_s1_3;

View File

@@ -127,7 +127,7 @@ typedef struct {
BKSpriteDisplayData *unkFC;
BKSprite *unk100;
BKSpriteDisplayData *unk104;
u8 unk108[5]; //sfx_ids
u8 unk108[5]; //sfx_indexes
u8 pad10D[3];
f32 unk110[5]; //sfx_???
s16 unk124[5]; //sfx_???

View File

@@ -4,7 +4,7 @@
#include "fight.h"
typedef struct {
u8 unk0;
u8 sfxsourceIdx;
}ActorLocal_BossJinjoBase;
enum chBossJinjoBase_states {
@@ -90,9 +90,9 @@ void fight_func_8038D510(Actor *arg0) {
func_8030DA44(arg0->unk44_31);
arg0->unk44_31 = 0;
}
if (sp18->unk0 != 0) {
func_8030DA44(sp18->unk0);
sp18->unk0 = 0;
if (sp18->sfxsourceIdx != 0) {
func_8030DA44(sp18->sfxsourceIdx);
sp18->sfxsourceIdx = 0;
}
}
@@ -115,17 +115,17 @@ void chBossJinjoBase_update(Actor *this) {
this->marker->propPtr->unk8_3 = 1;
actor_collisionOn(this);
this->unk38_31 = 0;
this->unk44_31 = func_8030D90C();
this->unk44_31 = sfxsource_createSfxsourceAndReturnIndex();
sfxsource_setSfxId(this->unk44_31, SFX_3F9_UNKNOWN);
func_8030DD14(this->unk44_31, 2);
func_8030DBB4(this->unk44_31, 1.4f);
sfxsource_playSfxAtVolume(this->unk44_31, 1.4f);
sfxsource_setSampleRate(this->unk44_31, 32000);
local->unk0 = func_8030D90C();
sfxsource_setSfxId(local->unk0, SFX_405_UNKNOWN);
func_8030DD14(local->unk0, 2);
func_8030DBB4(local->unk0, 0.7f);
sfxsource_setSampleRate(local->unk0, 12000);
local->sfxsourceIdx = sfxsource_createSfxsourceAndReturnIndex();
sfxsource_setSfxId(local->sfxsourceIdx, SFX_405_UNKNOWN);
func_8030DD14(local->sfxsourceIdx, 2);
sfxsource_playSfxAtVolume(local->sfxsourceIdx, 0.7f);
sfxsource_setSampleRate(local->sfxsourceIdx, 12000);
FUNC_8030E624(SFX_3F6_UNKNOWN, 0.6f, 20000);
func_8038D3DC(this, 0x19a, 0.0f, -200.0f, 0.0f);
TUPLE_COPY(this->unk1C, this->position);
@@ -148,7 +148,7 @@ void chBossJinjoBase_update(Actor *this) {
if(this->position_y + y_delta < this->unk1C[1]) {
if( !fileProgressFlag_get(FILEPROG_D2_HAS_SPAWNED_A_JINJO_STATUE_IN_FINAL_FIGHT) || this->unkF4_8 == 1) {
func_8030E2C4(this->unk44_31);
func_8030E2C4(local->unk0);
func_8030E2C4(local->sfxsourceIdx);
}
position_delta[0] = (shake_noise & 1) ? 3.0f : -3.0f;
@@ -171,8 +171,8 @@ void chBossJinjoBase_update(Actor *this) {
subaddie_set_state(this, CHBOSSJINJOBASE_STATE_2_DEFAULT);
func_8030DA44(this->unk44_31);
this->unk44_31 = 0;
func_8030DA44(local->unk0);
local->unk0 = 0;
func_8030DA44(local->sfxsourceIdx);
local->sfxsourceIdx = 0;
TUPLE_COPY(this->position, this->unk1C);
TUPLE_COPY(actor_stone_jinjo->position, this->unk1C);
actor_stone_jinjo->position_y += 172.0f;

View File

@@ -657,10 +657,10 @@ void chfinalboss_setPhase(ActorMarker *this, u32 phase_id)
local->unk10 = 0;
if (actor->unk44_31 == 0)
{
actor->unk44_31 = (u8)func_8030D90C();
actor->unk44_31 = (u8)sfxsource_createSfxsourceAndReturnIndex();
sfxsource_setSfxId(actor->unk44_31, SFX_152_MOTOR_BREAKDOWN_01);
func_8030DD14(actor->unk44_31, 3);
func_8030DBB4(actor->unk44_31, 1.0f);
sfxsource_playSfxAtVolume(actor->unk44_31, 1.0f);
sfxsource_setSampleRate(actor->unk44_31, 32000);
}
return;
@@ -1559,11 +1559,11 @@ void chfinalboss_phase4_setState(Actor *this, s32 arg1) {
func_80311480(randi2(0, 5) + 0x1145, 0x20, NULL, NULL, NULL, NULL);
func_8030E6A4(SFX_1F_HITTING_AN_ENEMY_3, randf2(0.95f, 1.05f), 32000);
func_8030E6A4(SFX_133_GRUNTY_OHW, randf2(0.95f, 1.05f), 32000);
this->unk44_31 = func_8030D90C();
this->unk44_31 = sfxsource_createSfxsourceAndReturnIndex();
D_803927C0 = 1.0f;
sfxsource_setSfxId(this->unk44_31, SFX_2C_PULLING_NOISE);
func_8030DD14(this->unk44_31, 2);
func_8030DBB4(this->unk44_31, D_803927C0);
sfxsource_playSfxAtVolume(this->unk44_31, D_803927C0);
sfxsource_setSampleRate(this->unk44_31, 26000);
for(iter.i = 0; iter.i < 4; iter.i+=1){
if(__chFinalBossJinjoStatueMarker[iter.i] != NULL){
@@ -1726,7 +1726,7 @@ void chfinalboss_phase4_update(ActorMarker *marker) {
func_8030E6A4(SFX_12A_GRUNTY_AH, randf2(0.95f, 1.05f), 32000);
}
if ((sp58 >= 0.4) && (sp58 <= 0.65)) {
func_8030DBB4(this->unk44_31, ((D_803927C0 += 0.005) > 1.99) ? 1.99 : (D_803927C0 += 0.005));
sfxsource_playSfxAtVolume(this->unk44_31, ((D_803927C0 += 0.005) > 1.99) ? 1.99 : (D_803927C0 += 0.005));
func_8030E2C4(this->unk44_31);
}
if (actor_animationIsAt(this, 0.56f)) {
@@ -1785,10 +1785,10 @@ void chfinalboss_phase5_setState(Actor *this, s32 next_state) {
case 40:
func_802BB41C(0);
if (this->unk44_31 == 0) {
this->unk44_31 = func_8030D90C();
this->unk44_31 = sfxsource_createSfxsourceAndReturnIndex();
sfxsource_setSfxId(this->unk44_31, SFX_134_FREEZING_SHIVER);
func_8030DD14(this->unk44_31, 2);
func_8030DBB4(this->unk44_31, 1.0f);
sfxsource_playSfxAtVolume(this->unk44_31, 1.0f);
sfxsource_setSampleRate(this->unk44_31, 0x4268);
}
break;
@@ -1796,10 +1796,10 @@ void chfinalboss_phase5_setState(Actor *this, s32 next_state) {
case 41:
this->unk7C[2] = 0;
if (this->unk44_31 == 0) {
this->unk44_31 = func_8030D90C();
this->unk44_31 = sfxsource_createSfxsourceAndReturnIndex();
sfxsource_setSfxId(this->unk44_31, SFX_134_FREEZING_SHIVER);
func_8030DD14(this->unk44_31, 3);
func_8030DBB4(this->unk44_31, 1.0f);
sfxsource_playSfxAtVolume(this->unk44_31, 1.0f);
sfxsource_setSampleRate(this->unk44_31, 0x4268);
func_8030E2C4(this->unk44_31);
}

View File

@@ -142,7 +142,7 @@ void chjinjonator_8039040C(Actor *this){
f32 tick = time_getDelta();
local->unk14 = MIN(1.99, local->unk14 + local->unk18*tick);
func_8030DBB4(this->unk44_31, local->unk14);
sfxsource_playSfxAtVolume(this->unk44_31, local->unk14);
if(func_8030E3FC(this->unk44_31) == 0)
func_8030E2C4(this->unk44_31);
}
@@ -167,7 +167,7 @@ void chjinjonator_update(Actor *this){
func_8025A58C(0, 0x7fff);
this->unk44_31 = func_8030ED2C(SFX_17A_SHIPHORN, 3);
sfxsource_setSampleRate(this->unk44_31, 25000);
func_8030DBB4(this->unk44_31, local->unk14);
sfxsource_playSfxAtVolume(this->unk44_31, local->unk14);
func_8030E2C4(this->unk44_31);
local->unk28 = 0xC;
}//L80390574
@@ -240,7 +240,7 @@ void chjinjonator_update(Actor *this){
local->unk14 = 0.4f;
this->unk44_31 = func_8030ED2C(0x416, 3);
sfxsource_setSampleRate(this->unk44_31, 26000);
func_8030DBB4(this->unk44_31, local->unk14);
sfxsource_playSfxAtVolume(this->unk44_31, local->unk14);
func_8030E2C4(this->unk44_31);
}//L803908AC
local->unk1C = 0.5f;

View File

@@ -127,10 +127,10 @@ void chjinjonatorbase_update(Actor *this){
local->unk0[i] = 5;
func_8038E0D4(this, 0x19a + i, 0.0f, -300.0f, 0.0f);
}
this->unk44_31 = func_8030D90C();
this->unk44_31 = sfxsource_createSfxsourceAndReturnIndex();
sfxsource_setSfxId(this->unk44_31, 0x3f9);
func_8030DD14(this->unk44_31, 3);
func_8030DBB4(this->unk44_31, 1.0f);
sfxsource_playSfxAtVolume(this->unk44_31, 1.0f);
sfxsource_setSampleRate(this->unk44_31, 26000);
func_8030E2C4(this->unk44_31);
temp_s0 = func_802F9AA8(0x3EC);

View File

@@ -20,7 +20,7 @@ typedef struct {
u8 unkD;
u8 unkE;
u8 unkF;
u8 unk10;
u8 sfxsourceIdx;
} ActorLocal_fight_8390;
void chspellbarrier_update(Actor *this);
@@ -42,8 +42,8 @@ void func_8038E780(ActorMarker *arg0, ActorMarker *arg1) {
sp18 = (ActorLocal_fight_8390 *) &sp1C->local;
sp18->unk0 = 0xFF;
sp18->unk4 = 0;
if (func_8030E3FC(sp18->unk10) == 0) {
func_8030E2C4(sp18->unk10);
if (func_8030E3FC(sp18->sfxsourceIdx) == 0) {
func_8030E2C4(sp18->sfxsourceIdx);
}
if (func_8030E3FC(sp1C->unk44_31) == 0) {
func_8030E2C4(sp1C->unk44_31);
@@ -57,9 +57,9 @@ void func_8038E7EC(Actor *arg0) {
func_8030DA44(arg0->unk44_31);
arg0->unk44_31 = 0;
}
if (local->unk10 != 0) {
func_8030DA44(local->unk10);
local->unk10 = (u8)0;
if (local->sfxsourceIdx != 0) {
func_8030DA44(local->sfxsourceIdx);
local->sfxsourceIdx = (u8)0;
}
}
@@ -80,10 +80,10 @@ void chspellbarrier_update(Actor *this){
this->scale = 0.0f;
this->unk44_31 = func_8030ED2C(SFX_142_GRUNTY_LAUGH_3, 3);
func_8030DB04(this->unk44_31, 32000, this->position, 4000.0f, 12000.0f);
func_8030DBB4(this->unk44_31, 1.0f);
local->unk10 = func_8030ED2C(0x415, 3);
func_8030DB04(local->unk10, 32000, this->position, 4000.0f, 12000.0f);
func_8030DBB4(local->unk10, 1.0f);
sfxsource_playSfxAtVolume(this->unk44_31, 1.0f);
local->sfxsourceIdx = func_8030ED2C(0x415, 3);
func_8030DB04(local->sfxsourceIdx, 32000, this->position, 4000.0f, 12000.0f);
sfxsource_playSfxAtVolume(local->sfxsourceIdx, 1.0f);
FUNC_8030E8B4(SFX_416, 0.8f, 32000, this->position, 10000, 25000);
}//L8038E97C
jinjo_marker = chfinalboss_findCollidingJinjo(this, 600.0f);

View File

@@ -526,7 +526,7 @@ void func_8038CC10(void)
D_8037DCB8->UNK_18 = func_8030ED2C(0x1C, 3);
func_8030DD90(D_8037DCB8->UNK_18, 0);
sfxsource_setSampleRate(D_8037DCB8->UNK_18, 32760);
func_8030DBB4(D_8037DCB8->UNK_18, 0.7f);
sfxsource_playSfxAtVolume(D_8037DCB8->UNK_18, 0.7f);
func_8030E2C4(D_8037DCB8->UNK_18);
}