Paper Mario DX
Paper Mario (N64) modding
 
Loading...
Searching...
No Matches
sfx.c File Reference

Go to the source code of this file.

Macros

#define MAX_SOUND_INSTANCES   10
 
#define SOUND_LOOP_IDX(soundID)   (soundID & 0xFFFF)
 
#define SEQ_SOUND_ENTRY(soundID, sym)   [soundID & 0xFFFF] { .sounds = sym, .soundCount = ARRAY_COUNT(sym) }
 

Functions

void sfx_compute_spatialized_sound_params_full (f32 x, f32 y, f32 z, s16 *volume, s16 *pan, s32 flags)
 
void sfx_reset_door_sounds (void)
 
void sfx_clear_sounds (void)
 
void sfx_clear_env_sounds (s16 playSounds)
 
void sfx_update_env_sound_params (void)
 
void sfx_set_reverb_mode (s32 mode)
 
s32 sfx_get_reverb_mode (void)
 
void sfx_stop_env_sounds (void)
 
SoundInstancesfx_get_env_sound_instance (s32 soundID)
 
void sfx_play_sound_looping (s32 soundID, u8 volume, u8 pan, s16 pitchShift)
 
void sfx_register_looping_sound_at_position (s32 soundID, s32 flags, f32 x, f32 y, f32 z)
 
s32 sfx_adjust_env_sound_pos (s32 soundID, s32 sourceFlags, f32 x, f32 y, f32 z)
 
void snd_stop_tracking_env_sound_pos (s32 soundID, s32 keepPlaying)
 
void sfx_play_sound_with_params (s32 soundID, u8 volume, u8 pan, s16 pitchShift)
 
void sfx_adjust_env_sound_params (s32 soundID, u8 volume, u8 pan, s16 pitchShift)
 
void sfx_stop_sound (s32 soundID)
 
void sfx_play_sound (s32 soundID)
 
void sfx_play_sound_at_player (s32 soundID, s32 flags)
 
void sfx_play_sound_at_npc (s32 soundID, s32 flags, s32 npcID)
 
void sfx_play_sound_at_position (s32 soundID, s32 flags, f32 posX, f32 posY, f32 posZ)
 
void sfx_get_spatialized_sound_params (f32 x, f32 y, f32 z, s16 *volume, s16 *pan, s32 flags)
 
void sfx_compute_spatialized_sound_params_ignore_depth (f32 x, f32 y, f32 z, s16 *volume, s16 *pan)
 
void sfx_compute_spatialized_sound_params_with_depth (f32 x, f32 y, f32 z, s16 *volume, s16 *pan)
 

Variables

u16 gCurrentDoorSounds
 
u16 gCurrentRoomDoorSounds
 
s32 LoopingSounds []
 
s32 FireBar0Sounds [] = { SOUND_FIRE_BAR_0_A, SOUND_FIRE_BAR_0_B }
 
s32 FireBar1Sounds [] = { SOUND_FIRE_BAR_1_A, SOUND_FIRE_BAR_1_B }
 
s32 FireBar2Sounds [] = { SOUND_FIRE_BAR_2_A, SOUND_FIRE_BAR_2_B }
 
s32 FireBar3Sounds [] = { SOUND_FIRE_BAR_3_A, SOUND_FIRE_BAR_3_B }
 
s32 FireBar4Sounds [] = { SOUND_FIRE_BAR_4_A, SOUND_FIRE_BAR_4_B }
 
s32 FireBar5Sounds [] = { SOUND_FIRE_BAR_5_A, SOUND_FIRE_BAR_5_B }
 
s32 FireBar6Sounds [] = { SOUND_FIRE_BAR_6_A, SOUND_FIRE_BAR_6_B }
 
s32 FireBar7Sounds [] = { SOUND_FIRE_BAR_7_A, SOUND_FIRE_BAR_7_B }
 
s32 FireBar8Sounds [] = { SOUND_FIRE_BAR_8_A, SOUND_FIRE_BAR_8_B }
 
s32 FireBar9Sounds [] = { SOUND_FIRE_BAR_9_A, SOUND_FIRE_BAR_9_B }
 
s32 FireBarDeadSounds [] = { SOUND_FIRE_BAR_DEAD, SOUND_FIRE_BAR_DEAD }
 
s32 AlertSounds [] = { SOUND_AI_ALERT_A, SOUND_AI_ALERT_B }
 
s32 SnoreInhaleSounds [] = { SOUND_SNORE_INHALE_A, SOUND_SNORE_INHALE_B }
 
s32 SnoreExhaleSounds [] = { SOUND_SNORE_EXHALE_A, SOUND_SNORE_EXHALE_B }
 
s32 SnapAwakeSounds [] = { SOUND_SNAP_AWAKE_A, SOUND_SNAP_AWAKE_B }
 
s32 BooVanishSounds [] = { SOUND_BOO_VANISH_A, SOUND_BOO_VANISH_B }
 
s32 BooAppearSounds [] = { SOUND_BOO_APPEAR_A, SOUND_BOO_APPEAR_B }
 
s32 WindowOpenSounds [] = { SOUND_WINDOW_OPEN_A, SOUND_WINDOW_OPEN_B }
 
s32 WindowCloseSounds [] = { SOUND_WINDOW_CLOSE_A, SOUND_WINDOW_CLOSE_B }
 
s32 RavenLeapSounds [] = { SOUND_RAVEN_LEAP_A, SOUND_RAVEN_LEAP_B }
 
s32 RavenFallSounds [] = { SOUND_RAVEN_FALL_A, SOUND_RAVEN_FALL_B, SOUND_RAVEN_FALL_C }
 
s32 ShootingStarFallSounds [] = { SOUND_SHOOTING_STAR_FALL_A, SOUND_SHOOTING_STAR_FALL_B }
 
s32 ShootingStarBounceSounds [] = { SOUND_STAR_BOUNCE_A, SOUND_STAR_BOUNCE_B }
 
s32 FuzzyHopSounds [] = { SOUND_FUZZY_HOP_A, SOUND_FUZZY_HOP_B, SOUND_FUZZY_HOP_C }
 
s32 BulletBillExplodeSounds [] = { SOUND_BULLET_BILL_EXPLODE_A, SOUND_BULLET_BILL_EXPLODE_B }
 
s32 LuigiStepSounds [] = { SOUND_LUIGI_STEP_A, SOUND_LUIGI_STEP_B }
 
s32 TrainChugSounds [] = { SOUND_TRAIN_CHUG_A, SOUND_TRAIN_CHUG_B }
 
s32 FinaleBridgeCollapseSounds [] = { SOUND_KPA_BRIDGE_COLLAPSE_A, SOUND_KPA_BRIDGE_COLLAPSE_B }
 
s32 FinaleExplosionSounds [] = { SOUND_KPA_EXPLOSION_A, SOUND_KPA_EXPLOSION_B }
 
s32 CardShuffleSounds [] = { SOUND_SHUFFLE_CARD_A, SOUND_SHUFFLE_CARD_B }
 
s32 StarSpiritAppearSounds [] = { SOUND_STAR_SPIRIT_APPEAR_A, SOUND_STAR_SPIRIT_APPEAR_B }
 
s32 StarSpiritCastSounds [] = { SOUND_STAR_SPIRIT_CAST_A, SOUND_STAR_SPIRIT_CAST_B }
 
s32 UnusedExplodeSounds [] = { SOUND_BULLET_BILL_EXPLODE_A, SOUND_BULLET_BILL_EXPLODE_B }
 
s32 ShyGuyStepSounds [] = { SOUND_SHY_GUY_STEP_A, SOUND_SHY_GUY_STEP_B }
 
AlternatingSoundSet AlternatingSounds []
 
s32 OpenCloseSounds [][2]
 
BSS SoundInstance wEnvSounds [10]
 
BSS SoundInstance bEnvSounds [10]
 
BSS SoundInstancegCurrentEnvSounds
 
BSS s32 SfxReverbMode
 

Macro Definition Documentation

◆ MAX_SOUND_INSTANCES

◆ SOUND_LOOP_IDX

#define SOUND_LOOP_IDX ( soundID)    (soundID & 0xFFFF)

Definition at line 9 of file sfx.c.

◆ SEQ_SOUND_ENTRY

#define SEQ_SOUND_ENTRY ( soundID,
sym )   [soundID & 0xFFFF] { .sounds = sym, .soundCount = ARRAY_COUNT(sym) }

Definition at line 162 of file sfx.c.

Function Documentation

◆ sfx_compute_spatialized_sound_params_full()

void sfx_compute_spatialized_sound_params_full ( f32 x,
f32 y,
f32 z,
s16 * volume,
s16 * pan,
s32 flags )

Definition at line 217 of file sfx.c.

217 {
218 s32 screenX, screenY, screenZ;
219 f32 volAmtOffsetX, volAmtDeltaY, volAmtDepth;
220 f32 offsetX, offsetY, depth;
221 f32 volTemp, panTemp;
222 s32 phi_v0;
223
224 get_screen_coords(gCurrentCameraID, x, y, z, &screenX, &screenY, &screenZ);
225
226 if (screenX > 5000 || screenX < -5000 || screenY > 5000 || screenY < -5000) {
227 *volume = -1;
228 *pan = 0;
229 return;
230 }
231
233 if (screenX < -30 || screenX > SCREEN_WIDTH + 30 || screenY < -30 || screenY > SCREEN_HEIGHT + 30) {
234 *volume = -1;
235 *pan = 0;
236 return;
237 }
238 } else if (flags & SOUND_PARAM_CLIP_OFFSCREEN_X) {
239 if (screenX < -30 || screenX > SCREEN_WIDTH + 30) {
240 *volume = -1;
241 *pan = 0;
242 return;
243 }
244 } else if (flags & SOUND_PARAM_CLIP_OFFSCREEN_Y) {
245 if (screenY < -30 || screenY > SCREEN_HEIGHT + 30) {
246 *volume = -1;
247 *pan = 0;
248 return;
249 }
250 }
251
252 offsetX = abs((SCREEN_WIDTH / 2) - screenX) - 145;
253 if (offsetX < 0.0) {
254 offsetX = 0.0f;
255 }
256
257 volAmtOffsetX = update_lerp(EASING_LINEAR, 1.0f, 0.0f, offsetX, 200);
258 if (volAmtOffsetX < 0.0) {
259 volAmtOffsetX = 0.0f;
260 }
261
262 offsetY = abs((SCREEN_HEIGHT / 2) - screenY) - 105;
263 if (offsetY < 0.0) {
264 offsetY = 0.0f;
265 }
266
267 volAmtDeltaY = update_lerp(EASING_LINEAR, 1.0f, 0.0f, offsetY, 130);
268 if (volAmtDeltaY < 0.0) {
269 volAmtDeltaY = 0.0f;
270 }
271
272 depth = screenZ - 5550.0;
273 if (depth < 0.0) {
274 depth = 0.0f;
275 }
276
277 volAmtDepth = update_lerp(EASING_LINEAR, 1.0f, 0.0f, depth, 250);
278 if (volAmtDepth < 0.0) {
279 volAmtDepth = 0.0f;
280 }
281
282 volTemp = (volAmtOffsetX * volAmtDeltaY * volAmtDepth) * 127.0;
283 if (volTemp < 15.0) {
284 volTemp = 15.0f;
285 } else if (volTemp > 127.0) {
286 volTemp = 127.0f;
287 }
288 *volume = volTemp;
289
290 panTemp = (((f32) screenX - (SCREEN_WIDTH / 2.0)) / 3.6) + 64.0;
291 if (panTemp < 1.0) {
292 panTemp = 1.0f;
293 } else if (panTemp > 127.0) {
294 panTemp = 127.0f;
295 }
296 *pan = panTemp;
297}
s8 flags
Definition demo_api.c:15
@ EASING_LINEAR
Definition enums.h:510
@ SOUND_PARAM_CLIP_OFFSCREEN_X
Definition enums.h:1743
@ SOUND_PARAM_CLIP_OFFSCREEN_ANY
Definition enums.h:1742
@ SOUND_PARAM_CLIP_OFFSCREEN_Y
Definition enums.h:1744
f32 update_lerp(s32 easing, f32 start, f32 end, s32 elapsed, s32 duration)
Definition 43F0.c:735
void get_screen_coords(s32 camID, f32 x, f32 y, f32 z, s32 *screenX, s32 *screenY, s32 *screenZ)
Definition cam_main.c:410
#define SCREEN_WIDTH
Definition macros.h:105
#define SCREEN_HEIGHT
Definition macros.h:106
s32 gCurrentCameraID
Definition cam_math.c:4

Referenced by sfx_get_spatialized_sound_params().

◆ sfx_reset_door_sounds()

void sfx_reset_door_sounds ( void )

Definition at line 299 of file sfx.c.

299 {
302}
@ DOOR_SOUNDS_BASIC
Definition enums.h:2407
u16 gCurrentDoorSounds
Definition sfx.c:6
u16 gCurrentRoomDoorSounds
Definition sfx.c:7

Referenced by load_map_by_IDs(), and sfx_clear_sounds().

◆ sfx_clear_sounds()

void sfx_clear_sounds ( void )

Definition at line 304 of file sfx.c.

304 {
305 bzero(&wEnvSounds, sizeof(wEnvSounds));
306 bzero(&bEnvSounds, sizeof(bEnvSounds));
310}
void sfx_set_reverb_mode(s32 mode)
Definition sfx.c:352
void sfx_reset_door_sounds(void)
Definition sfx.c:299
BSS SoundInstance wEnvSounds[10]
Definition sfx.c:212
BSS SoundInstance bEnvSounds[10]
Definition sfx.c:213
BSS SoundInstance * gCurrentEnvSounds
Definition sfx.c:214

Referenced by load_engine_data(), and state_step_startup().

◆ sfx_clear_env_sounds()

void sfx_clear_env_sounds ( s16 playSounds)

Definition at line 313 of file sfx.c.

313 {
316 } else {
318 }
319
320 if (playSounds) {
322 s32 i;
323
324 for (i = 0; i < MAX_SOUND_INSTANCES; i++, sound++) {
325 if (sound->flags & SOUND_INSTANCE_FLAG_ACTIVE) {
326 snd_start_sound_with_shift(sound->soundID, sound->volume, sound->pan, sound->pitchShift);
327 }
328 }
329 } else {
331 }
332}
void snd_start_sound_with_shift(s32 soundID, u8 volume, u8 pan, s16 pitchShift)
Definition 30450.c:199
s16 pitchShift
Definition audio.h:702
@ SOUND_INSTANCE_FLAG_ACTIVE
Definition audio.h:242
s32 soundID
Definition audio.h:698
@ CONTEXT_WORLD
Definition enums.h:3529
#define MAX_SOUND_INSTANCES
Definition sfx.c:4
GameStatus * gGameStatusPtr
Definition main_loop.c:32

Referenced by load_map_by_IDs(), state_step_battle(), state_step_end_battle(), state_step_pause(), and state_step_unpause().

◆ sfx_update_env_sound_params()

void sfx_update_env_sound_params ( void )

Definition at line 334 of file sfx.c.

334 {
336 u16 volume;
337 u16 pan;
338 s32 i;
339
340 for (i = 0; i < MAX_SOUND_INSTANCES; i++, sound++) {
341 if (sound->flags & SOUND_INSTANCE_FLAG_ACTIVE) {
343 sfx_get_spatialized_sound_params(sound->pos.x, sound->pos.y, sound->pos.z, &volume, &pan, sound->sourceFlags);
344 sound->volume = volume;
345 sound->pan = pan;
346 }
347 snd_adjust_sound_with_shift(sound->soundID, sound->volume, sound->pan, sound->pitchShift);
348 }
349 }
350}
void snd_adjust_sound_with_shift(s32 soundID, u8 volume, u8 pan, s16 pitchShift)
Definition 30450.c:235
s32 sourceFlags
Definition audio.h:699
@ SOUND_INSTANCE_FLAG_POSITION_CHANGED
Definition audio.h:243
Vec3f pos
Definition audio.h:703
void sfx_get_spatialized_sound_params(f32 x, f32 y, f32 z, s16 *volume, s16 *pan, s32 flags)
Definition sfx.c:551

Referenced by step_game_loop().

◆ sfx_set_reverb_mode()

void sfx_set_reverb_mode ( s32 mode)

Definition at line 352 of file sfx.c.

352 {
353 func_800561E4(mode);
354 SfxReverbMode = mode;
355}
void func_800561E4(s32 arg0)
Definition 30450.c:857
BSS s32 SfxReverbMode
Definition sfx.c:215

Referenced by load_map_by_IDs(), sfx_clear_sounds(), state_init_title_screen(), state_step_pause(), and state_step_unpause().

◆ sfx_get_reverb_mode()

s32 sfx_get_reverb_mode ( void )

Definition at line 357 of file sfx.c.

357 {
358 return SfxReverbMode;
359}

Referenced by state_step_pause().

◆ sfx_stop_env_sounds()

void sfx_stop_env_sounds ( void )

Definition at line 361 of file sfx.c.

361 {
362 SoundInstance* sound;
363 s32 i;
364
367 } else {
369 }
370
371 sound = gCurrentEnvSounds;
372 for (i = 0; i < MAX_SOUND_INSTANCES; i++, sound++) {
373 if (sound->flags & SOUND_INSTANCE_FLAG_ACTIVE) {
374 snd_stop_sound(sound->soundID);
375 }
376 }
377}
void snd_stop_sound(s32 soundID)
Definition 30450.c:256

Referenced by load_map_by_IDs(), state_step_battle(), state_step_end_battle(), state_step_pause(), and step_game_loop().

◆ sfx_get_env_sound_instance()

SoundInstance * sfx_get_env_sound_instance ( s32 soundID)

Definition at line 379 of file sfx.c.

379 {
381 s32 i;
382
383 for (i = 0; i < MAX_SOUND_INSTANCES; i++, sound++) {
384 if (sound->flags & SOUND_INSTANCE_FLAG_ACTIVE && sound->soundID == soundID) {
385 return sound;
386 }
387 }
388
389 return NULL;
390}

Referenced by sfx_adjust_env_sound_params(), sfx_adjust_env_sound_pos(), and snd_stop_tracking_env_sound_pos().

◆ sfx_play_sound_looping()

void sfx_play_sound_looping ( s32 soundID,
u8 volume,
u8 pan,
s16 pitchShift )

Definition at line 392 of file sfx.c.

392 {
394 s32 i;
395
396 for (i = 0; i < MAX_SOUND_INSTANCES; i++, sound++) {
397 if (!(sound->flags & SOUND_INSTANCE_FLAG_ACTIVE)) {
398 break;
399 }
400 }
401
402 sound->pan = pan;
403 sound->soundID = soundID;
404 sound->volume = volume;
405 sound->pitchShift = pitchShift;
407
408 snd_start_sound_with_shift(soundID, volume, pan, pitchShift);
409}

Referenced by sfx_play_sound_with_params().

◆ sfx_register_looping_sound_at_position()

void sfx_register_looping_sound_at_position ( s32 soundID,
s32 flags,
f32 x,
f32 y,
f32 z )

Definition at line 411 of file sfx.c.

411 {
413 s32 i;
414
415 for (i = 0; i < MAX_SOUND_INSTANCES; i++, sound++) {
416 if (!(sound->flags & SOUND_INSTANCE_FLAG_ACTIVE)) {
417 break;
418 }
419 }
420
421 sound->sourceFlags = flags;
422 sound->pos.x = x;
423 sound->pos.y = y;
424 sound->pos.z = z;
425 sound->soundID = soundID;
427
428 sfx_play_sound_at_position(soundID, flags, x, y, z);
429}
#define sfx_play_sound_at_position

Referenced by sfx_play_sound_at_position().

◆ sfx_adjust_env_sound_pos()

s32 sfx_adjust_env_sound_pos ( s32 soundID,
s32 sourceFlags,
f32 x,
f32 y,
f32 z )

Definition at line 431 of file sfx.c.

431 {
433
434 if (sound == NULL) {
435 return FALSE;
436 }
437
438 sound->sourceFlags = sourceFlags;
439 sound->pos.x = x;
440 sound->pos.y = y;
441 sound->pos.z = z;
442 sound->soundID = soundID;
444 return TRUE;
445}
SoundInstance * sfx_get_env_sound_instance(s32 soundID)
Definition sfx.c:379

Referenced by SentinelAI_Descend().

◆ snd_stop_tracking_env_sound_pos()

void snd_stop_tracking_env_sound_pos ( s32 soundID,
s32 keepPlaying )

Definition at line 447 of file sfx.c.

447 {
449
450 if (sound != NULL) {
452 if (!keepPlaying) {
453 snd_stop_sound(sound->soundID);
454 }
455 }
456}

Referenced by func_802BB34C_E2DC7C(), and sfx_stop_sound().

◆ sfx_play_sound_with_params()

void sfx_play_sound_with_params ( s32 soundID,
u8 volume,
u8 pan,
s16 pitchShift )

Definition at line 458 of file sfx.c.

458 {
459 AlternatingSoundSet* alternatingSet;
460
462 return;
463 }
464
465 if (soundID & SOUND_TYPE_SPECIAL) {
466 s32 soundIndex = soundID & 0xFF;
467 s32 soundType = (soundID & 0x70000000) >> 0x1C;
468 switch (soundType) {
470 // 0x8xxxxxxx
471 sfx_play_sound_looping(LoopingSounds[soundIndex], volume, pan, pitchShift);
472 return;
474 soundID = OpenCloseSounds[gCurrentDoorSounds][soundIndex];
475 break;
477 soundID = OpenCloseSounds[gCurrentRoomDoorSounds][soundIndex];
478 break;
480 // 0xBxxxxxxx
481 alternatingSet = &AlternatingSounds[soundIndex];
482 if (alternatingSet->curIndex >= alternatingSet->soundCount) {
483 alternatingSet->curIndex = 0;
484 }
485 soundID = alternatingSet->sounds[alternatingSet->curIndex++];
486 break;
487 }
488 }
489 snd_start_sound_with_shift(soundID, volume, pan, pitchShift);
490}
@ SOUND_TYPE_SPECIAL
Definition enums.h:539
@ SOUND_TYPE_ROOM_DOOR
Definition enums.h:542
@ SOUND_TYPE_LOOPING
Definition enums.h:540
@ SOUND_TYPE_EXIT_DOOR
Definition enums.h:541
@ SOUND_TYPE_ALTERNATING
Definition enums.h:543
s32 OpenCloseSounds[][2]
Definition sfx.c:202
AlternatingSoundSet AlternatingSounds[]
Definition sfx.c:165
s32 LoopingSounds[]
Definition sfx.c:12
void sfx_play_sound_looping(s32 soundID, u8 volume, u8 pan, s16 pitchShift)
Definition sfx.c:392

Referenced by _update_message(), msg_copy_to_print_buffer(), msg_play_speech_sound(), sfx_play_sound(), sfx_play_sound_at_position(), update(), and update_riding_physics().

◆ sfx_adjust_env_sound_params()

void sfx_adjust_env_sound_params ( s32 soundID,
u8 volume,
u8 pan,
s16 pitchShift )

Definition at line 492 of file sfx.c.

492 {
493 SoundInstance* sound;
494
495 if (soundID & SOUND_TYPE_SPECIAL) {
496 sound = sfx_get_env_sound_instance(LoopingSounds[soundID & 0xFFFF]);
497 if (sound != NULL) {
498 sound->volume = volume;
499 sound->pan = pan;
500 sound->pitchShift = pitchShift;
501 }
502 } else {
503 snd_adjust_sound_with_shift(soundID, volume, pan, pitchShift);
504 }
505}

Referenced by update().

◆ sfx_stop_sound()

void sfx_stop_sound ( s32 soundID)

Definition at line 507 of file sfx.c.

507 {
508 s32 sound = soundID;
509
510 if (sound & SOUND_TYPE_SPECIAL) {
511 snd_stop_tracking_env_sound_pos(LoopingSounds[sound & 0xFFFF], FALSE);
512 } else {
513 snd_stop_sound(sound);
514 }
515}
void snd_stop_tracking_env_sound_pos(s32 soundID, s32 keepPlaying)
Definition sfx.c:447

Referenced by action_update_spin(), free(), phys_update_action_state(), pre_battle(), pre_battle(), SentinelAI_LosePlayerInit(), set_action_state(), update(), and update_encounters_pre_battle().

◆ sfx_play_sound()

void sfx_play_sound ( s32 soundID)

Definition at line 517 of file sfx.c.

517 {
518 sfx_play_sound_with_params(soundID, 0, 0, 0);
519}
void sfx_play_sound_with_params(s32 soundID, u8 volume, u8 pan, s16 pitchShift)
Definition sfx.c:458

Referenced by _use_partner_ability(), btl_main_menu_update(), btl_state_update_begin_player_turn(), btl_state_update_celebration(), btl_state_update_defeat(), btl_state_update_partner_menu(), btl_state_update_partner_move(), btl_state_update_player_menu(), btl_state_update_player_move(), btl_state_update_run_away(), btl_state_update_select_target(), btl_submenu_moves_update(), btl_update_ko_status(), btl_update_strats_menu(), calc_player_damage_enemy(), can_open_world_menu(), check_input_open_menus(), check_input_status_bar(), coin_counter_draw_content(), entity_BlueWarpPipe_enter_pipe_init(), entity_Chest_begin_opening(), entity_CymbalPlant_idle(), entity_HeartBlockContent__anim_heal(), entity_HiddenPanel_flip_over(), entity_Padlock_idle(), entity_SaveBlock_show_result_message(), entity_StarBoxLauncher_launch(), entity_WoodenCrate_idle(), filemenu_choose_name_handle_input(), filemenu_main_handle_input(), filemenu_yesno_handle_input(), func_800F16CC(), func_802BB34C_E2DC7C(), func_802BC3E4_E2ED14(), hud_element_update(), inflict_partner_ko(), partner_use_ability(), pause_badges_handle_input(), pause_handle_input(), pause_init(), pause_items_handle_input(), pause_map_handle_input(), pause_partners_handle_input(), pause_spirits_handle_input(), pause_stats_handle_input(), pause_tabs_handle_input(), pause_tutorial_input(), popup_menu_update(), remove_player_buffs(), should_cancel_open_world_menu(), state_step_title_screen(), step_entity_commandlist(), update(), update_encounters_neutral(), update_item_entity_pickup(), and update_status_bar().

◆ sfx_play_sound_at_player()

◆ sfx_play_sound_at_npc()

void sfx_play_sound_at_npc ( s32 soundID,
s32 flags,
s32 npcID )

Definition at line 527 of file sfx.c.

527 {
528 Npc* npc = get_npc_safe(npcID);
529
530 if (npc != NULL) {
531 sfx_play_sound_at_position(soundID, flags, npc->pos.x, npc->pos.y, npc->pos.z);
532 }
533}
Npc * get_npc_safe(s32 npcID)
Definition npc.c:1010
Vec3f pos

Referenced by update_riding_physics().

◆ sfx_play_sound_at_position()

void sfx_play_sound_at_position ( s32 soundID,
s32 flags,
f32 posX,
f32 posY,
f32 posZ )

Definition at line 535 of file sfx.c.

535 {
536 if ((soundID & 0xF0000000) == SOUND_TYPE_SPECIAL) {
537 s32 id = LoopingSounds[soundID & 0xFFFF];
538
539 sfx_register_looping_sound_at_position(id, flags, posX, posY, posZ);
540 } else {
541 s16 volume;
542 s16 pan;
543
544 sfx_get_spatialized_sound_params(posX, posY, posZ, &volume, &pan, flags);
545 if (volume >= 0) {
546 sfx_play_sound_with_params(soundID, volume, pan, 0);
547 }
548 }
549}
void sfx_register_looping_sound_at_position(s32 soundID, s32 flags, f32 x, f32 y, f32 z)
Definition sfx.c:411

◆ sfx_get_spatialized_sound_params()

void sfx_get_spatialized_sound_params ( f32 x,
f32 y,
f32 z,
s16 * volume,
s16 * pan,
s32 flags )

Definition at line 551 of file sfx.c.

551 {
552 u32 paramFlags;
553 u32 spaceMode;
554
555 paramFlags = flags & SOUND_SPACE_PARAMS_MASK;
556 spaceMode = flags & SOUND_SPACE_MODE_MASK;
557
558 switch (spaceMode) {
561 break;
564 break;
565 case SOUND_SPACE_FULL:
566 sfx_compute_spatialized_sound_params_full(x, y, z, volume, pan, paramFlags);
567 break;
568 }
569
570 if (paramFlags & SOUND_PARAM_MUTE) {
571 *volume = 0;
572 } else if (paramFlags & SOUND_PARAM_QUIET) {
573 if (*volume < 80) {
574 *volume = 80;
575 }
576 } else if (paramFlags & SOUND_PARAM_MORE_QUIET) {
577 if (*volume < 60) {
578 *volume = 60;
579 }
580 } else if (paramFlags & SOUND_PARAM_MOST_QUIET) {
581 if (*volume < 40) {
582 *volume = 40;
583 }
584 }
585
586 if (*pan < 1) {
587 *pan = 1;
588 }
589 if (*pan > 127) {
590 *pan = 127;
591 }
592}
@ SOUND_SPACE_PARAMS_MASK
Definition enums.h:1740
@ SOUND_SPACE_MODE_MASK
Definition enums.h:1736
@ SOUND_SPACE_DEFAULT
Definition enums.h:1737
@ SOUND_SPACE_FULL
Definition enums.h:1739
@ SOUND_PARAM_QUIET
Definition enums.h:1747
@ SOUND_SPACE_WITH_DEPTH
Definition enums.h:1738
@ SOUND_PARAM_MUTE
Definition enums.h:1741
@ SOUND_PARAM_MORE_QUIET
Definition enums.h:1746
@ SOUND_PARAM_MOST_QUIET
Definition enums.h:1745
void sfx_compute_spatialized_sound_params_with_depth(f32 x, f32 y, f32 z, s16 *volume, s16 *pan)
Definition sfx.c:628
void sfx_compute_spatialized_sound_params_ignore_depth(f32 x, f32 y, f32 z, s16 *volume, s16 *pan)
Definition sfx.c:594
void sfx_compute_spatialized_sound_params_full(f32 x, f32 y, f32 z, s16 *volume, s16 *pan, s32 flags)
Definition sfx.c:217

Referenced by sfx_play_sound_at_position(), and sfx_update_env_sound_params().

◆ sfx_compute_spatialized_sound_params_ignore_depth()

void sfx_compute_spatialized_sound_params_ignore_depth ( f32 x,
f32 y,
f32 z,
s16 * volume,
s16 * pan )

Definition at line 594 of file sfx.c.

594 {
595 s32 screenX, screenY, screenZ;
596
597 get_screen_coords(gCurrentCameraID, x, y, z, &screenX, &screenY, &screenZ);
598
599 if (screenX > 3000 || screenX < -3000 || screenY > 3000 || screenY < -3000) {
600 *volume = 1;
601 *pan = 0;
602 return;
603 }
604
605 *volume = 127;
606 if (screenX < 0) {
607 *volume = (screenX * 0.3f) + 127.0f;
608 screenX = 0;
609 }
610 if (screenX > SCREEN_WIDTH) {
611 *volume = 127.0f - ((screenX - SCREEN_WIDTH) * 0.3f);
612 screenX = SCREEN_WIDTH;
613 }
614
615 if (*volume < 1) {
616 *volume = 1;
617 }
618
620 // 25/75 at screen edge
621 *pan = (screenX * 0.2f) + 32.0f;
622 } else {
623 f32 temp_f20 = ((screenX * 127.0) / SCREEN_WIDTH) - 64.0;
624 *pan = (s32) (temp_f20 * sin_rad(DEG_TO_RAD(fabs(temp_f20) * 90.0 / 64.0))) + 64;
625 }
626}
f64 fabs(f64 f)
f32 sin_rad(f32 x)
Definition 43F0.c:713
#define DEG_TO_RAD(deg)
Definition macros.h:134

Referenced by sfx_get_spatialized_sound_params().

◆ sfx_compute_spatialized_sound_params_with_depth()

void sfx_compute_spatialized_sound_params_with_depth ( f32 x,
f32 y,
f32 z,
s16 * volume,
s16 * pan )

Definition at line 628 of file sfx.c.

628 {
629 Camera* camera = &gCameras[gCurrentCameraID];
630 s32 screenX, screenY, screenZ;
631 f32 depth;
632
633 get_screen_coords(gCurrentCameraID, x, y, z, &screenX, &screenY, &screenZ);
634
635 if (screenX > 3000 || screenX < -3000 || screenY > 3000 || screenY < -3000) {
636 *volume = 1;
637 *pan = 0;
638 return;
639 }
640
641 *volume = 127;
642 if (screenX < 0) {
643 *volume = (screenX * 0.3f) + 127.0f;
644 screenX = 0;
645 }
646 if (camera->viewportW < screenX) {
647 *volume = 127.0f - ((screenX - camera->viewportW) * 0.3f);
648 screenX = camera->viewportW;
649 }
650
651 depth = fabsf(5000 - screenZ);
652 if (depth > 1000.0f) {
653 depth = 1000.0f;
654 }
655
656 *volume = *volume * (1500.0f - depth) * 0.001f;
657 if (*volume > 127) {
658 *volume = 127;
659 }
660 if (*volume < 1) {
661 *volume = 1;
662 }
663
664 *pan = ((screenX * 64.0f) / camera->viewportW) + 32.0f;
665}
f32 fabsf(f32 f)
Camera gCameras[4]
Definition cam_main.c:17

Referenced by sfx_get_spatialized_sound_params().

Variable Documentation

◆ gCurrentDoorSounds

u16 gCurrentDoorSounds

Definition at line 6 of file sfx.c.

Referenced by sfx_play_sound_with_params(), and sfx_reset_door_sounds().

◆ gCurrentRoomDoorSounds

u16 gCurrentRoomDoorSounds

Definition at line 7 of file sfx.c.

Referenced by sfx_play_sound_with_params(), and sfx_reset_door_sounds().

◆ LoopingSounds

s32 LoopingSounds[]

Definition at line 12 of file sfx.c.

12 {
124};
@ SOUND_LRAW_OSR_FOUNTAIN_INTACT
Definition enums.h:608
@ SOUND_LRAW_USE_PEACH_BEAM
Definition enums.h:970
@ SOUND_LOOP_IWA00_FLOW2
Definition enums.h:1593
@ SOUND_LRAW_STAR_SANCTUARY_FAR
Definition enums.h:685
@ SOUND_LOOP_TIK19_WATER
Definition enums.h:1649
@ SOUND_LOOP_JAN_LARGE_GEYSER
Definition enums.h:1610
@ SOUND_LRAW_BOWSER_PROPELLER
Definition enums.h:962
@ SOUND_LOOP_KPA_ARENA_ACTIVE
Definition enums.h:1691
@ SOUND_LOOP_TIK05_WATER
Definition enums.h:1626
@ SOUND_LOOP_JAN_BEACH_WAVES
Definition enums.h:1604
@ SOUND_LOOP_TIK_UNUSED3_FLOW3
Definition enums.h:1643
@ SOUND_LRAW_SBK_RUINS_WHIRLWIND
Definition enums.h:623
@ SOUND_LRAW_OSR_RUMBLING
Definition enums.h:590
@ SOUND_LRAW_BOBOMB_FUSE
Definition enums.h:1027
@ SOUND_LOOP_IWA_UNUSED_FLOW3
Definition enums.h:1591
@ SOUND_LOOP_BOWSER_PROPELLER
Definition enums.h:1683
@ SOUND_LRAW_BUBBLE_DRIFT
Definition enums.h:820
@ SOUND_LOOP_AUDIENCE_MURMUR
Definition enums.h:1600
@ SOUND_LRAW_ZIPLINE_RIDE
Definition enums.h:790
@ SOUND_LOOP_SBK_RUINS_RISING
Definition enums.h:1675
@ SOUND_LOOP_STAR_SANCTUARY_NEAR
Definition enums.h:1681
@ SOUND_LRAW_FLO_WATER_FLOW_2
Definition enums.h:823
@ SOUND_LOOP_FLO_FILL_WATER_POOL
Definition enums.h:1661
@ SOUND_LRAW_TRD_WATER_EXT
Definition enums.h:847
@ SOUND_LOOP_TIK06_FLOW4
Definition enums.h:1631
@ SOUND_LOOP_SHY_GUY_CROWD_2
Definition enums.h:1658
@ SOUND_LOOP_TIK06_FLOW2
Definition enums.h:1629
@ SOUND_LRAW_FLO_WATER_FLOW_1
Definition enums.h:822
@ SOUND_LRAW_MOVE_LARGE_STATUE
Definition enums.h:671
@ SOUND_LOOP_BOBOMB_FUSE
Definition enums.h:1582
@ SOUND_LOOP_TIK_UNUSED2_WATER
Definition enums.h:1640
@ SOUND_LOOP_TROMP_ROLL
Definition enums.h:1608
@ SOUND_LRAW_TROMP_ROLL
Definition enums.h:614
@ SOUND_LRAW_CHARGE_BAR
Definition enums.h:1145
@ SOUND_LOOP_WINDMILL_EXT
Definition enums.h:1655
@ SOUND_LRAW_FLO_FILL_WATER_POOL
Definition enums.h:821
@ SOUND_LOOP_KKJ_RUMBLING
Definition enums.h:1667
@ SOUND_LOOP_PUFF_PUFF_MACHINE
Definition enums.h:1618
@ SOUND_LRAW_ISK_LOWER_STAIRS
Definition enums.h:618
@ SOUND_LOOP_FLO_WATER_FLOW_2
Definition enums.h:1615
@ SOUND_LRAW_CHEERING
Definition enums.h:1151
@ SOUND_LRAW_USE_STAR_BEAM
Definition enums.h:969
@ SOUND_LOOP_OBK_LOWER_CHAIN
Definition enums.h:1596
@ SOUND_LOOP_TIK09_FLOW4
Definition enums.h:1636
@ SOUND_LRAW_SBK_OASIS_WATER
Definition enums.h:848
@ SOUND_LRAW_TRD_04_LOWER_STAIRS
Definition enums.h:579
@ SOUND_LRAW_SPINNING_FLOWER
Definition enums.h:1215
@ SOUND_LRAW_OSR_FOUNTAIN_BROKEN
Definition enums.h:609
@ SOUND_LRAW_SHY_GUY_CROWD_2
Definition enums.h:1181
@ SOUND_LRAW_BOMBETTE_FUSE
Definition enums.h:998
@ SOUND_LOOP_SENTINEL_ALARM
Definition enums.h:1598
@ SOUND_LRAW_WATER_FLOWING_1
Definition enums.h:989
@ SOUND_LRAW_FIGHTING
Definition enums.h:1243
@ SOUND_LRAW_WATER_FLOWING_3
Definition enums.h:991
@ SOUND_LOOP_TIK24_WATER
Definition enums.h:1654
@ SOUND_NONE
Definition enums.h:547
@ SOUND_LOOP_SBK_OASIS_WATER
Definition enums.h:1678
@ SOUND_LOOP_TIK02_FLOW3
Definition enums.h:1623
@ SOUND_LOOP_OSR_FOUNTAIN_BROKEN
Definition enums.h:1671
@ SOUND_LOOP_TIK09_FLOW3
Definition enums.h:1637
@ SOUND_LRAW_QUIZ_TICKING
Definition enums.h:657
@ SOUND_LRAW_FLO_RELEASE_FOUNTAIN
Definition enums.h:824
@ SOUND_LOOP_IWA01_FLOW1
Definition enums.h:1594
@ SOUND_LRAW_JR_TROOPA_SWIM
Definition enums.h:603
@ SOUND_LOOP_DGB_COLLAPSE
Definition enums.h:1674
@ SOUND_LRAW_WHALE_GEYSER
Definition enums.h:600
@ SOUND_LOOP_TOYBOX_TRAIN_GEAR
Definition enums.h:1601
@ SOUND_KPA_FLIP_BRIDGE_PANEL
Definition enums.h:1369
@ SOUND_LOOP_FLIGHT
Definition enums.h:1659
@ SOUND_LOOP_TRD_WATER_EXT
Definition enums.h:1673
@ SOUND_LOOP_JAN_CONSTRUCTION
Definition enums.h:1611
@ SOUND_LOOP_TIK_UNUSED1_WATER
Definition enums.h:1639
@ SOUND_LRAW_JAN_CONSTRUCTION
Definition enums.h:812
@ SOUND_LRAW_TRD_02_LOWER_STAIRS
Definition enums.h:576
@ SOUND_LRAW_SHY_GUY_CROWD_1
Definition enums.h:1180
@ SOUND_LOOP_STAR_SANCTUARY_FAR
Definition enums.h:1680
@ SOUND_LRAW_JAN_BEACH_WAVES
Definition enums.h:607
@ SOUND_LOOP_TIK_UNUSED3_FLOW2
Definition enums.h:1644
@ SOUND_ISK_FLIP_STAIRS
Definition enums.h:616
@ SOUND_LOOP_ZIPLINE_RIDE
Definition enums.h:1606
@ SOUND_LRAW_STAR_SANCTUARY_INSIDE
Definition enums.h:687
@ SOUND_LOOP_TIK_UNUSED3_FLOW4
Definition enums.h:1642
@ SOUND_LRAW_JAN_LARGE_GEYSER
Definition enums.h:611
@ SOUND_LRAW_TOYBOX_TRAIN_GEAR
Definition enums.h:648
@ SOUND_LOOP_TIK05_FLOW1
Definition enums.h:1627
@ SOUND_LOOP_CRYSTAL_BALL_GLOW
Definition enums.h:1647
@ SOUND_LRAW_WINDMILL_GEARS
Definition enums.h:640
@ SOUND_LOOP_TIK03_FLOW1
Definition enums.h:1625
@ SOUND_LOOP_OSR_RUMBLING
Definition enums.h:1668
@ SOUND_LOOP_FIGHTING
Definition enums.h:1689
@ SOUND_LOOP_SPINNING_FLOWER
Definition enums.h:1687
@ SOUND_LOOP_NOK_WATER
Definition enums.h:1672
@ SOUND_LRAW_SENTINEL_ALARM
Definition enums.h:1126
@ SOUND_LOOP_BOMBETTE_FUSE
Definition enums.h:1581
@ SOUND_LOOP_TIK06_FLOW3
Definition enums.h:1630
@ SOUND_LOOP_JR_TROOPA_SWIM
Definition enums.h:1666
@ SOUND_LOOP_TIK01_WATER
Definition enums.h:1620
@ SOUND_LOOP_TIK02_FLOW2
Definition enums.h:1622
@ SOUND_LOOP_TIK02_WATER
Definition enums.h:1621
@ SOUND_FLIGHT
Definition enums.h:1012
@ SOUND_LRAW_WINDMILL_EXT
Definition enums.h:612
@ SOUND_LOOP_TIK03_WATER
Definition enums.h:1624
@ SOUND_LOOP_USE_PEACH_BEAM
Definition enums.h:1686
@ SOUND_LOOP_MOVE_LARGE_STATUE
Definition enums.h:1605
@ SOUND_LRAW_DGB_COLLAPSE
Definition enums.h:662
@ SOUND_LOOP_TIK19_FLOW4
Definition enums.h:1651
@ SOUND_LRAW_NOK_WATER
Definition enums.h:846
@ SOUND_LOOP_ISK_LOWER_STAIRS
Definition enums.h:1584
@ SOUND_LOOP_TIK23_WATER
Definition enums.h:1653
@ SOUND_LOOP_KPA_CHAIN_DRIVE
Definition enums.h:1662
@ SOUND_LRAW_SBK_RUINS_RISING_DISTANT
Definition enums.h:628
@ SOUND_LOOP_FLO_WATER_FLOW_1
Definition enums.h:1614
@ SOUND_LOOP_TIK09_WATER
Definition enums.h:1634
@ SOUND_LRAW_TRD_RAISE_STAIRS
Definition enums.h:574
@ SOUND_LOOP_NOTHING_1F
Definition enums.h:1612
@ SOUND_LOOP_TIK08_WATER
Definition enums.h:1632
@ SOUND_LOOP_WINDMILL_GEARS
Definition enums.h:1656
@ SOUND_LRAW_CRYSTAL_BALL_GLOW
Definition enums.h:914
@ SOUND_LOOP_ISK_FLIP_STAIRS
Definition enums.h:1583
@ SOUND_LOOP_NOTHING_26
Definition enums.h:1619
@ SOUND_LOOP_62
Definition enums.h:1679
@ SOUND_LRAW_STAR_ORB_RISING
Definition enums.h:674
@ SOUND_LOOP_TIK10_WATER
Definition enums.h:1638
@ SOUND_LOOP_TRD_04_LOWER_STAIRS
Definition enums.h:1586
@ SOUND_LOOP_TIK20_WATER
Definition enums.h:1652
@ SOUND_LOOP_STAR_SANCTUARY_INSIDE
Definition enums.h:1682
@ SOUND_LRAW_WATER_FLOWING_4
Definition enums.h:992
@ SOUND_LRAW_TIK_WATER
Definition enums.h:988
@ SOUND_LOOP_TIK_UNUSED3_WATER
Definition enums.h:1641
@ SOUND_LOOP_TIK08_FLOW1
Definition enums.h:1633
@ SOUND_LOOP_SBK_RUINS_WHIRLWIND
Definition enums.h:1676
@ SOUND_LRAW_KPA_ARENA_TURN_ON
Definition enums.h:945
@ SOUND_LOOP_SBK_RUINS_RISING_DISTANT
Definition enums.h:1677
@ SOUND_LOOP_FLO_RELEASE_FOUNTAIN
Definition enums.h:1617
@ SOUND_LOOP_TRD_RAISE_STAIRS
Definition enums.h:1588
@ SOUND_LOOP_KPA_FILL_WATER
Definition enums.h:1663
@ SOUND_LRAW_WATER_FLOWING_2
Definition enums.h:990
@ SOUND_LRAW_KPA_FILL_WATER
Definition enums.h:943
@ SOUND_LOOP_MAC_HARBOR_WATER
Definition enums.h:1669
@ SOUND_LOOP_TIK18_WATER
Definition enums.h:1648
@ SOUND_LRAW_KPA_ARENA_ACTIVE
Definition enums.h:946
@ SOUND_LOOP_OMO_ROTATING_WHEEL
Definition enums.h:1603
@ SOUND_LOOP_STAR_ORB_RISING
Definition enums.h:1684
@ SOUND_LOOP_MOVE_STATUE
Definition enums.h:1597
@ SOUND_LRAW_PUFF_PUFF_MACHINE
Definition enums.h:659
@ SOUND_LRAW_OMO_SLOT_MACHINE
Definition enums.h:1207
@ SOUND_LRAW_KKJ_RUMBLING
Definition enums.h:589
@ SOUND_LRAW_JAN_SMALL_GEYSER
Definition enums.h:610
@ SOUND_LOOP_QUIZ_TICKING
Definition enums.h:1599
@ SOUND_LRAW_KPA_CHAIN_DRIVE
Definition enums.h:934
@ SOUND_LOOP_CHARGE_BAR
Definition enums.h:1646
@ SOUND_LOOP_TIK19_FLOW3
Definition enums.h:1650
@ SOUND_LOOP_OSR_FOUNTAIN_INTACT
Definition enums.h:1670
@ SOUND_LRAW_MOVE_STATUE
Definition enums.h:670
@ SOUND_LOOP_TRD_02_LOWER_STAIRS
Definition enums.h:1585
@ SOUND_LOOP_IWA10_FLOW1
Definition enums.h:1590
@ SOUND_LOOP_SHY_GUY_CROWD_1
Definition enums.h:1657
@ SOUND_LOOP_TRD_FLOWING_WATER
Definition enums.h:1587
@ SOUND_LOOP_WHALE_GEYSER
Definition enums.h:1660
@ SOUND_LRAW_STAR_SANCTUARY_NEAR
Definition enums.h:686
@ SOUND_LOOP_BUBBLE_DRIFT
Definition enums.h:1616
@ SOUND_LRAW_NOTHING_26
Definition enums.h:786
@ SOUND_LOOP_KPA_ARENA_TURN_ON
Definition enums.h:1690
@ SOUND_LOOP_KPA_FLIP_BRIDGE_PANEL
Definition enums.h:1665
@ SOUND_LOOP_JAN_SMALL_GEYSER
Definition enums.h:1609
@ SOUND_LRAW_RUMBLE
Definition enums.h:1257
@ SOUND_LOOP_KPA_DRAIN_WATER
Definition enums.h:1664
@ SOUND_LRAW_SBK_RUINS_RISING
Definition enums.h:625
@ SOUND_LOOP_SAM_STAIRS_RISE
Definition enums.h:1645
@ SOUND_LOOP_NOTHING_20
Definition enums.h:1613
@ SOUND_LOOP_IWA00_FLOW3
Definition enums.h:1592
@ SOUND_LOOP_TIK06_WATER
Definition enums.h:1628
@ SOUND_LOOP_TIK09_FLOW2
Definition enums.h:1635
@ SOUND_LOOP_RUMBLE
Definition enums.h:1688
@ SOUND_LRAW_SAM_STAIRS_RISE
Definition enums.h:1228
@ SOUND_LOOP_CHEERING
Definition enums.h:1589
@ SOUND_LOOP_ZIPLINE_RETURN
Definition enums.h:1607
@ SOUND_LRAW_ZIPLINE_RETURN
Definition enums.h:808
@ SOUND_LRAW_OMO_ROTATING_WHEEL
Definition enums.h:672
@ SOUND_LRAW_AUDIENCE_MURMUR
Definition enums.h:652
@ SOUND_LRAW_MAC_HARBOR_WATER
Definition enums.h:595
@ SOUND_LRAW_KPA_DRAIN_WATER
Definition enums.h:944
@ SOUND_LRAW_OBK_LOWER_CHAIN
Definition enums.h:667
@ SOUND_LOOP_USE_STAR_BEAM
Definition enums.h:1685
@ SOUND_LOOP_OMO_SLOT_MACHINE
Definition enums.h:1602
@ SOUND_LOOP_IWA01_FLOW2
Definition enums.h:1595
@ SOUND_LRAW_TRD_FLOWING_WATER
Definition enums.h:573
#define SOUND_LOOP_IDX(soundID)
Definition sfx.c:9

Referenced by sfx_adjust_env_sound_params(), sfx_play_sound_at_position(), sfx_play_sound_with_params(), and sfx_stop_sound().

◆ FireBar0Sounds

s32 FireBar0Sounds[] = { SOUND_FIRE_BAR_0_A, SOUND_FIRE_BAR_0_B }

Definition at line 127 of file sfx.c.

@ SOUND_FIRE_BAR_0_B
Definition enums.h:1107
@ SOUND_FIRE_BAR_0_A
Definition enums.h:1134

◆ FireBar1Sounds

s32 FireBar1Sounds[] = { SOUND_FIRE_BAR_1_A, SOUND_FIRE_BAR_1_B }

Definition at line 128 of file sfx.c.

@ SOUND_FIRE_BAR_1_B
Definition enums.h:1108
@ SOUND_FIRE_BAR_1_A
Definition enums.h:1135

◆ FireBar2Sounds

s32 FireBar2Sounds[] = { SOUND_FIRE_BAR_2_A, SOUND_FIRE_BAR_2_B }

Definition at line 129 of file sfx.c.

@ SOUND_FIRE_BAR_2_B
Definition enums.h:1109
@ SOUND_FIRE_BAR_2_A
Definition enums.h:1136

◆ FireBar3Sounds

s32 FireBar3Sounds[] = { SOUND_FIRE_BAR_3_A, SOUND_FIRE_BAR_3_B }

Definition at line 130 of file sfx.c.

@ SOUND_FIRE_BAR_3_B
Definition enums.h:1110
@ SOUND_FIRE_BAR_3_A
Definition enums.h:1137

◆ FireBar4Sounds

s32 FireBar4Sounds[] = { SOUND_FIRE_BAR_4_A, SOUND_FIRE_BAR_4_B }

Definition at line 131 of file sfx.c.

@ SOUND_FIRE_BAR_4_A
Definition enums.h:1138
@ SOUND_FIRE_BAR_4_B
Definition enums.h:1111

◆ FireBar5Sounds

s32 FireBar5Sounds[] = { SOUND_FIRE_BAR_5_A, SOUND_FIRE_BAR_5_B }

Definition at line 132 of file sfx.c.

@ SOUND_FIRE_BAR_5_A
Definition enums.h:1139
@ SOUND_FIRE_BAR_5_B
Definition enums.h:1112

◆ FireBar6Sounds

s32 FireBar6Sounds[] = { SOUND_FIRE_BAR_6_A, SOUND_FIRE_BAR_6_B }

Definition at line 133 of file sfx.c.

@ SOUND_FIRE_BAR_6_A
Definition enums.h:1140
@ SOUND_FIRE_BAR_6_B
Definition enums.h:1113

◆ FireBar7Sounds

s32 FireBar7Sounds[] = { SOUND_FIRE_BAR_7_A, SOUND_FIRE_BAR_7_B }

Definition at line 134 of file sfx.c.

@ SOUND_FIRE_BAR_7_A
Definition enums.h:1141
@ SOUND_FIRE_BAR_7_B
Definition enums.h:1114

◆ FireBar8Sounds

s32 FireBar8Sounds[] = { SOUND_FIRE_BAR_8_A, SOUND_FIRE_BAR_8_B }

Definition at line 135 of file sfx.c.

@ SOUND_FIRE_BAR_8_B
Definition enums.h:1115
@ SOUND_FIRE_BAR_8_A
Definition enums.h:1142

◆ FireBar9Sounds

s32 FireBar9Sounds[] = { SOUND_FIRE_BAR_9_A, SOUND_FIRE_BAR_9_B }

Definition at line 136 of file sfx.c.

@ SOUND_FIRE_BAR_9_B
Definition enums.h:1116
@ SOUND_FIRE_BAR_9_A
Definition enums.h:1143

◆ FireBarDeadSounds

s32 FireBarDeadSounds[] = { SOUND_FIRE_BAR_DEAD, SOUND_FIRE_BAR_DEAD }

Definition at line 137 of file sfx.c.

◆ AlertSounds

s32 AlertSounds[] = { SOUND_AI_ALERT_A, SOUND_AI_ALERT_B }

Definition at line 138 of file sfx.c.

@ SOUND_AI_ALERT_B
Definition enums.h:1079
@ SOUND_AI_ALERT_A
Definition enums.h:1078

◆ SnoreInhaleSounds

s32 SnoreInhaleSounds[] = { SOUND_SNORE_INHALE_A, SOUND_SNORE_INHALE_B }

Definition at line 139 of file sfx.c.

@ SOUND_SNORE_INHALE_A
Definition enums.h:1127
@ SOUND_SNORE_INHALE_B
Definition enums.h:1128

◆ SnoreExhaleSounds

s32 SnoreExhaleSounds[] = { SOUND_SNORE_EXHALE_A, SOUND_SNORE_EXHALE_B }

Definition at line 140 of file sfx.c.

@ SOUND_SNORE_EXHALE_B
Definition enums.h:1133
@ SOUND_SNORE_EXHALE_A
Definition enums.h:1132

◆ SnapAwakeSounds

s32 SnapAwakeSounds[] = { SOUND_SNAP_AWAKE_A, SOUND_SNAP_AWAKE_B }

Definition at line 141 of file sfx.c.

@ SOUND_SNAP_AWAKE_A
Definition enums.h:1075
@ SOUND_SNAP_AWAKE_B
Definition enums.h:1076

◆ BooVanishSounds

s32 BooVanishSounds[] = { SOUND_BOO_VANISH_A, SOUND_BOO_VANISH_B }

Definition at line 142 of file sfx.c.

@ SOUND_BOO_VANISH_B
Definition enums.h:693
@ SOUND_BOO_VANISH_A
Definition enums.h:692

◆ BooAppearSounds

s32 BooAppearSounds[] = { SOUND_BOO_APPEAR_A, SOUND_BOO_APPEAR_B }

Definition at line 143 of file sfx.c.

@ SOUND_BOO_APPEAR_B
Definition enums.h:695
@ SOUND_BOO_APPEAR_A
Definition enums.h:694

◆ WindowOpenSounds

s32 WindowOpenSounds[] = { SOUND_WINDOW_OPEN_A, SOUND_WINDOW_OPEN_B }

Definition at line 144 of file sfx.c.

@ SOUND_WINDOW_OPEN_B
Definition enums.h:861
@ SOUND_WINDOW_OPEN_A
Definition enums.h:859

◆ WindowCloseSounds

s32 WindowCloseSounds[] = { SOUND_WINDOW_CLOSE_A, SOUND_WINDOW_CLOSE_B }

Definition at line 145 of file sfx.c.

@ SOUND_WINDOW_CLOSE_A
Definition enums.h:860
@ SOUND_WINDOW_CLOSE_B
Definition enums.h:862

◆ RavenLeapSounds

s32 RavenLeapSounds[] = { SOUND_RAVEN_LEAP_A, SOUND_RAVEN_LEAP_B }

Definition at line 146 of file sfx.c.

@ SOUND_RAVEN_LEAP_B
Definition enums.h:1026
@ SOUND_RAVEN_LEAP_A
Definition enums.h:1025

◆ RavenFallSounds

Definition at line 147 of file sfx.c.

@ SOUND_RAVEN_FALL_B
Definition enums.h:920
@ SOUND_RAVEN_FALL_A
Definition enums.h:919
@ SOUND_RAVEN_FALL_C
Definition enums.h:921

◆ ShootingStarFallSounds

s32 ShootingStarFallSounds[] = { SOUND_SHOOTING_STAR_FALL_A, SOUND_SHOOTING_STAR_FALL_B }

Definition at line 148 of file sfx.c.

@ SOUND_SHOOTING_STAR_FALL_B
Definition enums.h:974
@ SOUND_SHOOTING_STAR_FALL_A
Definition enums.h:973

◆ ShootingStarBounceSounds

s32 ShootingStarBounceSounds[] = { SOUND_STAR_BOUNCE_A, SOUND_STAR_BOUNCE_B }

Definition at line 149 of file sfx.c.

@ SOUND_STAR_BOUNCE_A
Definition enums.h:975
@ SOUND_STAR_BOUNCE_B
Definition enums.h:976

◆ FuzzyHopSounds

Definition at line 150 of file sfx.c.

@ SOUND_FUZZY_HOP_A
Definition enums.h:1129
@ SOUND_FUZZY_HOP_B
Definition enums.h:1130
@ SOUND_FUZZY_HOP_C
Definition enums.h:1131

◆ BulletBillExplodeSounds

s32 BulletBillExplodeSounds[] = { SOUND_BULLET_BILL_EXPLODE_A, SOUND_BULLET_BILL_EXPLODE_B }

Definition at line 151 of file sfx.c.

@ SOUND_BULLET_BILL_EXPLODE_B
Definition enums.h:1417
@ SOUND_BULLET_BILL_EXPLODE_A
Definition enums.h:1416

◆ LuigiStepSounds

s32 LuigiStepSounds[] = { SOUND_LUIGI_STEP_A, SOUND_LUIGI_STEP_B }

Definition at line 152 of file sfx.c.

@ SOUND_LUIGI_STEP_A
Definition enums.h:796
@ SOUND_LUIGI_STEP_B
Definition enums.h:797

◆ TrainChugSounds

s32 TrainChugSounds[] = { SOUND_TRAIN_CHUG_A, SOUND_TRAIN_CHUG_B }

Definition at line 153 of file sfx.c.

@ SOUND_TRAIN_CHUG_B
Definition enums.h:904
@ SOUND_TRAIN_CHUG_A
Definition enums.h:903

◆ FinaleBridgeCollapseSounds

s32 FinaleBridgeCollapseSounds[] = { SOUND_KPA_BRIDGE_COLLAPSE_A, SOUND_KPA_BRIDGE_COLLAPSE_B }

Definition at line 154 of file sfx.c.

@ SOUND_KPA_BRIDGE_COLLAPSE_B
Definition enums.h:1364
@ SOUND_KPA_BRIDGE_COLLAPSE_A
Definition enums.h:1363

◆ FinaleExplosionSounds

s32 FinaleExplosionSounds[] = { SOUND_KPA_EXPLOSION_A, SOUND_KPA_EXPLOSION_B }

Definition at line 155 of file sfx.c.

@ SOUND_KPA_EXPLOSION_B
Definition enums.h:948
@ SOUND_KPA_EXPLOSION_A
Definition enums.h:947

◆ CardShuffleSounds

s32 CardShuffleSounds[] = { SOUND_SHUFFLE_CARD_A, SOUND_SHUFFLE_CARD_B }

Definition at line 156 of file sfx.c.

@ SOUND_SHUFFLE_CARD_B
Definition enums.h:1348
@ SOUND_SHUFFLE_CARD_A
Definition enums.h:1347

◆ StarSpiritAppearSounds

s32 StarSpiritAppearSounds[] = { SOUND_STAR_SPIRIT_APPEAR_A, SOUND_STAR_SPIRIT_APPEAR_B }

Definition at line 157 of file sfx.c.

@ SOUND_STAR_SPIRIT_APPEAR_A
Definition enums.h:1370
@ SOUND_STAR_SPIRIT_APPEAR_B
Definition enums.h:1371

◆ StarSpiritCastSounds

s32 StarSpiritCastSounds[] = { SOUND_STAR_SPIRIT_CAST_A, SOUND_STAR_SPIRIT_CAST_B }

Definition at line 158 of file sfx.c.

@ SOUND_STAR_SPIRIT_CAST_B
Definition enums.h:1373
@ SOUND_STAR_SPIRIT_CAST_A
Definition enums.h:1372

◆ UnusedExplodeSounds

◆ ShyGuyStepSounds

s32 ShyGuyStepSounds[] = { SOUND_SHY_GUY_STEP_A, SOUND_SHY_GUY_STEP_B }

Definition at line 160 of file sfx.c.

@ SOUND_SHY_GUY_STEP_B
Definition enums.h:1253
@ SOUND_SHY_GUY_STEP_A
Definition enums.h:1252

◆ AlternatingSounds

AlternatingSoundSet AlternatingSounds[]

Definition at line 165 of file sfx.c.

165 {
200};
@ SOUND_SEQ_WINDOW_CLOSE
Definition enums.h:1717
@ SOUND_SEQ_STAR_SPIRIT_APPEAR
Definition enums.h:1729
@ SOUND_SEQ_FIRE_BAR_1
Definition enums.h:1700
@ SOUND_SEQ_RAVEN_FALL
Definition enums.h:1719
@ SOUND_SEQ_FIRE_BAR_9
Definition enums.h:1708
@ SOUND_SEQ_SHOOTING_STAR_BOUNCE
Definition enums.h:1721
@ SOUND_SEQ_SHY_GUY_STEP
Definition enums.h:1732
@ SOUND_SEQ_FIRE_BAR_6
Definition enums.h:1705
@ SOUND_SEQ_AI_ALERT
Definition enums.h:1710
@ SOUND_SEQ_FIRE_BAR_4
Definition enums.h:1703
@ SOUND_SEQ_FIRE_BAR_8
Definition enums.h:1707
@ SOUND_SEQ_FIRE_BAR_2
Definition enums.h:1701
@ SOUND_SEQ_RAVEN_LEAP
Definition enums.h:1718
@ SOUND_SEQ_SNORE_INHALE
Definition enums.h:1711
@ SOUND_SEQ_BULLET_BILL_EXPLODE
Definition enums.h:1723
@ SOUND_SEQ_FIRE_BAR_DEAD
Definition enums.h:1709
@ SOUND_SEQ_SNORE_EXHALE
Definition enums.h:1712
@ SOUND_SEQ_FUZZY_HOP
Definition enums.h:1722
@ SOUND_SEQ_FIRE_BAR_5
Definition enums.h:1704
@ SOUND_SEQ_SHUFFLE_CARD
Definition enums.h:1728
@ SOUND_SEQ_UNUSED_EXPLODE
Definition enums.h:1731
@ SOUND_SEQ_FIRE_BAR_3
Definition enums.h:1702
@ SOUND_SEQ_LUIGI_STEP
Definition enums.h:1724
@ SOUND_SEQ_STAR_SPIRIT_CAST
Definition enums.h:1730
@ SOUND_SEQ_FIRE_BAR_7
Definition enums.h:1706
@ SOUND_SEQ_FINALE_EXPLOSION
Definition enums.h:1727
@ SOUND_SEQ_SHOOTING_STAR_FALL
Definition enums.h:1720
@ SOUND_SEQ_BOO_VANISH
Definition enums.h:1714
@ SOUND_SEQ_BOO_APPEAR
Definition enums.h:1715
@ SOUND_SEQ_FINALE_BRIDGE_COLLAPSE
Definition enums.h:1726
@ SOUND_SEQ_TRAIN_CHUG
Definition enums.h:1725
@ SOUND_SEQ_FIRE_BAR_0
Definition enums.h:1699
@ SOUND_SEQ_WINDOW_OPEN
Definition enums.h:1716
@ SOUND_SEQ_SNAP_AWAKE
Definition enums.h:1713
s32 ShyGuyStepSounds[]
Definition sfx.c:160
s32 TrainChugSounds[]
Definition sfx.c:153
s32 BooAppearSounds[]
Definition sfx.c:143
#define SEQ_SOUND_ENTRY(soundID, sym)
Definition sfx.c:162
s32 BulletBillExplodeSounds[]
Definition sfx.c:151
s32 SnoreExhaleSounds[]
Definition sfx.c:140
s32 WindowOpenSounds[]
Definition sfx.c:144
s32 FireBar7Sounds[]
Definition sfx.c:134
s32 LuigiStepSounds[]
Definition sfx.c:152
s32 FireBar8Sounds[]
Definition sfx.c:135
s32 ShootingStarBounceSounds[]
Definition sfx.c:149
s32 SnoreInhaleSounds[]
Definition sfx.c:139
s32 FinaleBridgeCollapseSounds[]
Definition sfx.c:154
s32 BooVanishSounds[]
Definition sfx.c:142
s32 FireBar1Sounds[]
Definition sfx.c:128
s32 FireBar9Sounds[]
Definition sfx.c:136
s32 WindowCloseSounds[]
Definition sfx.c:145
s32 AlertSounds[]
Definition sfx.c:138
s32 FireBar2Sounds[]
Definition sfx.c:129
s32 FireBar3Sounds[]
Definition sfx.c:130
s32 StarSpiritAppearSounds[]
Definition sfx.c:157
s32 FireBar4Sounds[]
Definition sfx.c:131
s32 FireBar6Sounds[]
Definition sfx.c:133
s32 UnusedExplodeSounds[]
Definition sfx.c:159
s32 SnapAwakeSounds[]
Definition sfx.c:141
s32 FinaleExplosionSounds[]
Definition sfx.c:155
s32 FireBarDeadSounds[]
Definition sfx.c:137
s32 FireBar0Sounds[]
Definition sfx.c:127
s32 StarSpiritCastSounds[]
Definition sfx.c:158
s32 RavenFallSounds[]
Definition sfx.c:147
s32 FireBar5Sounds[]
Definition sfx.c:132
s32 FuzzyHopSounds[]
Definition sfx.c:150
s32 CardShuffleSounds[]
Definition sfx.c:156
s32 RavenLeapSounds[]
Definition sfx.c:146
s32 ShootingStarFallSounds[]
Definition sfx.c:148

Referenced by sfx_play_sound_with_params().

◆ OpenCloseSounds

s32 OpenCloseSounds[][2]
Initial value:
= {
}
@ SOUND_BASIC_DOOR_CLOSE
Definition enums.h:850
@ SOUND_CREAKY_DOOR_CLOSE
Definition enums.h:856
@ SOUND_BASIC_DOOR_OPEN
Definition enums.h:849
@ SOUND_METAL_GATE_CLOSE
Definition enums.h:858
@ SOUND_METAL_DOOR_OPEN
Definition enums.h:851
@ SOUND_CREAKY_WINDOW_OPEN
Definition enums.h:1454
@ SOUND_CREAKY_DOOR_OPEN
Definition enums.h:855
@ SOUND_LARGE_DOOR_OPEN
Definition enums.h:853
@ SOUND_METAL_DOOR_CLOSE
Definition enums.h:852
@ SOUND_LARGE_DOOR_CLOSE
Definition enums.h:854
@ SOUND_METAL_GATE_OPEN
Definition enums.h:857
@ SOUND_CREAKY_WINDOW_CLOSE
Definition enums.h:1455

Definition at line 202 of file sfx.c.

Referenced by sfx_play_sound_with_params().

◆ wEnvSounds

BSS SoundInstance wEnvSounds[10]

Definition at line 212 of file sfx.c.

Referenced by sfx_clear_env_sounds(), sfx_clear_sounds(), and sfx_stop_env_sounds().

◆ bEnvSounds

BSS SoundInstance bEnvSounds[10]

Definition at line 213 of file sfx.c.

Referenced by sfx_clear_env_sounds(), sfx_clear_sounds(), and sfx_stop_env_sounds().

◆ gCurrentEnvSounds

◆ SfxReverbMode

BSS s32 SfxReverbMode

Definition at line 215 of file sfx.c.

Referenced by sfx_get_reverb_mode(), and sfx_set_reverb_mode().