Paper Mario DX
Paper Mario (N64) modding
 
Loading...
Searching...
No Matches
sfx_control.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 sfx_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_control.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_control.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_control.c.

217 {
220 f32 offsetX, offsetY, depth;
222 s32 phi_v0;
223
225
226 if (screenX > 5000 || screenX < -5000 || screenY > 5000 || screenY < -5000) {
227 *volume = -1;
228 *pan = 0;
229 return;
230 }
231
234 *volume = -1;
235 *pan = 0;
236 return;
237 }
238 } else if (flags & SOUND_PARAM_CLIP_OFFSCREEN_X) {
240 *volume = -1;
241 *pan = 0;
242 return;
243 }
244 } else if (flags & SOUND_PARAM_CLIP_OFFSCREEN_Y) {
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
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}
BSS s32 PopupMenu_SelectedIndex
s8 flags
Definition demo_api.c:15
@ EASING_LINEAR
Definition enums.h:510
@ SOUND_PARAM_CLIP_OFFSCREEN_X
Definition enums.h:1746
@ SOUND_PARAM_CLIP_OFFSCREEN_ANY
Definition enums.h:1745
@ SOUND_PARAM_CLIP_OFFSCREEN_Y
Definition enums.h:1747
f32 update_lerp(s32 easing, f32 start, f32 end, s32 elapsed, s32 duration)
Definition 43F0.c:733
void get_screen_coords(s32 camID, f32 x, f32 y, f32 z, s32 *screenX, s32 *screenY, s32 *screenZ)
Definition cam_main.c:409
#define SCREEN_WIDTH
Definition macros.h:109
#define SCREEN_HEIGHT
Definition macros.h:110
s32 gCurrentCameraID
Definition cam_math.c:5

Referenced by sfx_get_spatialized_sound_params().

◆ sfx_reset_door_sounds()

void sfx_reset_door_sounds ( void )

Definition at line 299 of file sfx_control.c.

299 {
302}
@ DOOR_SOUNDS_BASIC
Definition enums.h:2393
u16 gCurrentDoorSounds
Definition sfx_control.c:6
u16 gCurrentRoomDoorSounds
Definition sfx_control.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_control.c.

304 {
305 bzero(&wEnvSounds, sizeof(wEnvSounds));
306 bzero(&bEnvSounds, sizeof(bEnvSounds));
310}
void sfx_set_reverb_mode(s32 mode)
void sfx_reset_door_sounds(void)
BSS SoundInstance wEnvSounds[10]
BSS SoundInstance bEnvSounds[10]
BSS SoundInstance * gCurrentEnvSounds

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_control.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}
s16 pitchShift
Definition audio.h:826
@ SOUND_INSTANCE_FLAG_ACTIVE
Definition audio.h:369
s32 soundID
Definition audio.h:822
@ CONTEXT_WORLD
Definition enums.h:3562
void snd_start_sound_with_shift(s32 soundID, u8 volume, u8 pan, s16 pitchShift)
#define MAX_SOUND_INSTANCES
Definition sfx_control.c:4
GameStatus * gGameStatusPtr
Definition main_loop.c:31

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_control.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}
s32 sourceFlags
Definition audio.h:823
@ SOUND_INSTANCE_FLAG_POSITION_CHANGED
Definition audio.h:370
Vec3f pos
Definition audio.h:827
void snd_adjust_sound_with_shift(s32 soundID, u8 volume, u8 pan, s16 pitchShift)
void sfx_get_spatialized_sound_params(f32 x, f32 y, f32 z, s16 *volume, s16 *pan, s32 flags)

Referenced by step_game_loop().

◆ sfx_set_reverb_mode()

void sfx_set_reverb_mode ( s32 mode)

Definition at line 352 of file sfx_control.c.

352 {
354 SfxReverbMode = mode;
355}
void snd_set_sfx_reverb_type(s32 arg0)
BSS s32 SfxReverbMode

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_control.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_control.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)

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_control.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 sfx_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_control.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_control.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_control.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)

Referenced by SentinelAI_Descend().

◆ sfx_stop_tracking_env_sound_pos()

void sfx_stop_tracking_env_sound_pos ( s32 soundID,
s32 keepPlaying )

Definition at line 447 of file sfx_control.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_control.c.

458 {
460
462 return;
463 }
464
465 if (soundID & SOUND_ID_TYPE_FLAG) {
466 s32 soundIndex = soundID & 0xFF;
467 s32 soundType = (soundID & SOUND_ID_TYPE_MASK) >> 0x1C;
468 switch (soundType) {
470 sfx_play_sound_looping(LoopingSounds[soundIndex], volume, pan, pitchShift);
471 return;
473 soundID = OpenCloseSounds[gCurrentDoorSounds][soundIndex];
474 break;
476 soundID = OpenCloseSounds[gCurrentRoomDoorSounds][soundIndex];
477 break;
479 alternatingSet = &AlternatingSounds[soundIndex];
480 if (alternatingSet->curIndex >= alternatingSet->soundCount) {
482 }
483 soundID = alternatingSet->sounds[alternatingSet->curIndex++];
484 break;
485 }
486 }
487 snd_start_sound_with_shift(soundID, volume, pan, pitchShift);
488}
@ SOUND_ID_TYPE_FLAG
Definition enums.h:539
@ SOUND_ID_TYPE_MASK
Definition enums.h:538
@ SOUND_TYPE_ROOM_DOOR
Definition enums.h:545
@ SOUND_TYPE_LOOPING
Definition enums.h:543
@ SOUND_TYPE_EXIT_DOOR
Definition enums.h:544
@ SOUND_TYPE_ALTERNATING
Definition enums.h:546
s32 OpenCloseSounds[][2]
AlternatingSoundSet AlternatingSounds[]
s32 LoopingSounds[]
Definition sfx_control.c:12
void sfx_play_sound_looping(s32 soundID, u8 volume, u8 pan, s16 pitchShift)

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 490 of file sfx_control.c.

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

Referenced by update().

◆ sfx_stop_sound()

void sfx_stop_sound ( s32 soundID)

Definition at line 505 of file sfx_control.c.

505 {
506 s32 sound = soundID;
507
508 if (sound & SOUND_ID_TYPE_FLAG) {
510 } else {
511 snd_stop_sound(sound);
512 }
513}
void sfx_stop_tracking_env_sound_pos(s32 soundID, s32 keepPlaying)

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 515 of file sfx_control.c.

515 {
516 sfx_play_sound_with_params(soundID, 0, 0, 0);
517}
void sfx_play_sound_with_params(s32 soundID, u8 volume, u8 pan, s16 pitchShift)

Referenced by _use_partner_ability(), btl_main_menu_update(), 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_submenu_strats_update(), btl_update_ko_status(), 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_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(), show_popup_menu(), state_step_title_screen(), step_entity_commandlist(), update(), update_encounters_neutral(), update_item_entity_pickup(), update_status_bar(), update_status_damage(), and update_water_block().

◆ 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 525 of file sfx_control.c.

525 {
526 Npc* npc = get_npc_safe(npcID);
527
528 if (npc != NULL) {
529 sfx_play_sound_at_position(soundID, flags, npc->pos.x, npc->pos.y, npc->pos.z);
530 }
531}
Npc * get_npc_safe(s32 npcID)
Definition npc.c:1008
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 533 of file sfx_control.c.

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

◆ 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 549 of file sfx_control.c.

549 {
552
554
555 do {
557 } while (0); // required to match
558
559 switch (spaceMode) {
562 break;
565 break;
566 case SOUND_SPACE_FULL:
568 break;
569 }
570
572 *volume = 0;
573 } else if (paramFlags & SOUND_PARAM_QUIET) {
574 if (*volume < 80) {
575 *volume = 80;
576 }
577 } else if (paramFlags & SOUND_PARAM_MORE_QUIET) {
578 if (*volume < 60) {
579 *volume = 60;
580 }
581 } else if (paramFlags & SOUND_PARAM_MOST_QUIET) {
582 if (*volume < 40) {
583 *volume = 40;
584 }
585 }
586
587 if (*pan < 1) {
588 *pan = 1;
589 }
590 if (*pan > AU_PAN_MAX) {
591 *pan = AU_PAN_MAX;
592 }
593}
#define AU_PAN_MAX
Definition audio.h:67
@ SOUND_SPACE_PARAMS_MASK
Definition enums.h:1743
@ SOUND_SPACE_MODE_MASK
Definition enums.h:1739
@ SOUND_SPACE_DEFAULT
Definition enums.h:1740
@ SOUND_SPACE_FULL
Definition enums.h:1742
@ SOUND_PARAM_QUIET
Definition enums.h:1750
@ SOUND_SPACE_WITH_DEPTH
Definition enums.h:1741
@ SOUND_PARAM_MUTE
Definition enums.h:1744
@ SOUND_PARAM_MORE_QUIET
Definition enums.h:1749
@ SOUND_PARAM_MOST_QUIET
Definition enums.h:1748
void sfx_compute_spatialized_sound_params_with_depth(f32 x, f32 y, f32 z, s16 *volume, s16 *pan)
void sfx_compute_spatialized_sound_params_ignore_depth(f32 x, f32 y, f32 z, s16 *volume, s16 *pan)
void sfx_compute_spatialized_sound_params_full(f32 x, f32 y, f32 z, s16 *volume, s16 *pan, s32 flags)

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 595 of file sfx_control.c.

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

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 629 of file sfx_control.c.

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

Referenced by sfx_get_spatialized_sound_params().

Variable Documentation

◆ gCurrentDoorSounds

u16 gCurrentDoorSounds

Definition at line 6 of file sfx_control.c.

Referenced by sfx_play_sound_with_params(), and sfx_reset_door_sounds().

◆ gCurrentRoomDoorSounds

u16 gCurrentRoomDoorSounds

Definition at line 7 of file sfx_control.c.

Referenced by sfx_play_sound_with_params(), and sfx_reset_door_sounds().

◆ LoopingSounds

s32 LoopingSounds[]

Definition at line 12 of file sfx_control.c.

12 {
124};
@ SOUND_LRAW_OSR_FOUNTAIN_INTACT
Definition enums.h:611
@ SOUND_LRAW_USE_PEACH_BEAM
Definition enums.h:973
@ SOUND_LOOP_IWA00_FLOW2
Definition enums.h:1596
@ SOUND_LRAW_STAR_SANCTUARY_FAR
Definition enums.h:688
@ SOUND_LOOP_TIK19_WATER
Definition enums.h:1652
@ SOUND_LOOP_JAN_LARGE_GEYSER
Definition enums.h:1613
@ SOUND_LRAW_BOWSER_PROPELLER
Definition enums.h:965
@ SOUND_LOOP_KPA_ARENA_ACTIVE
Definition enums.h:1694
@ SOUND_LOOP_TIK05_WATER
Definition enums.h:1629
@ SOUND_LOOP_JAN_BEACH_WAVES
Definition enums.h:1607
@ SOUND_LOOP_TIK_UNUSED3_FLOW3
Definition enums.h:1646
@ SOUND_LRAW_SBK_RUINS_WHIRLWIND
Definition enums.h:626
@ SOUND_LRAW_OSR_RUMBLING
Definition enums.h:593
@ SOUND_LRAW_BOBOMB_FUSE
Definition enums.h:1030
@ SOUND_LOOP_IWA_UNUSED_FLOW3
Definition enums.h:1594
@ SOUND_LOOP_BOWSER_PROPELLER
Definition enums.h:1686
@ SOUND_LRAW_BUBBLE_DRIFT
Definition enums.h:823
@ SOUND_LOOP_AUDIENCE_MURMUR
Definition enums.h:1603
@ SOUND_LRAW_ZIPLINE_RIDE
Definition enums.h:793
@ SOUND_LOOP_SBK_RUINS_RISING
Definition enums.h:1678
@ SOUND_LOOP_STAR_SANCTUARY_NEAR
Definition enums.h:1684
@ SOUND_LRAW_FLO_WATER_FLOW_2
Definition enums.h:826
@ SOUND_LOOP_FLO_FILL_WATER_POOL
Definition enums.h:1664
@ SOUND_LRAW_TRD_WATER_EXT
Definition enums.h:850
@ SOUND_LOOP_TIK06_FLOW4
Definition enums.h:1634
@ SOUND_LOOP_SHY_GUY_CROWD_2
Definition enums.h:1661
@ SOUND_LOOP_TIK06_FLOW2
Definition enums.h:1632
@ SOUND_LRAW_FLO_WATER_FLOW_1
Definition enums.h:825
@ SOUND_LRAW_MOVE_LARGE_STATUE
Definition enums.h:674
@ SOUND_LOOP_BOBOMB_FUSE
Definition enums.h:1585
@ SOUND_LOOP_TIK_UNUSED2_WATER
Definition enums.h:1643
@ SOUND_LOOP_TROMP_ROLL
Definition enums.h:1611
@ SOUND_LRAW_TROMP_ROLL
Definition enums.h:617
@ SOUND_LOOP_WINDMILL_EXT
Definition enums.h:1658
@ SOUND_LRAW_FLO_FILL_WATER_POOL
Definition enums.h:824
@ SOUND_LOOP_KKJ_RUMBLING
Definition enums.h:1670
@ SOUND_LOOP_PUFF_PUFF_MACHINE
Definition enums.h:1621
@ SOUND_LRAW_ISK_LOWER_STAIRS
Definition enums.h:621
@ SOUND_LOOP_FLO_WATER_FLOW_2
Definition enums.h:1618
@ SOUND_LRAW_CHEERING
Definition enums.h:1154
@ SOUND_LRAW_USE_STAR_BEAM
Definition enums.h:972
@ SOUND_LOOP_OBK_LOWER_CHAIN
Definition enums.h:1599
@ SOUND_LOOP_TIK09_FLOW4
Definition enums.h:1639
@ SOUND_LRAW_SBK_OASIS_WATER
Definition enums.h:851
@ SOUND_LRAW_TRD_04_LOWER_STAIRS
Definition enums.h:582
@ SOUND_LRAW_SPINNING_FLOWER
Definition enums.h:1218
@ SOUND_LRAW_OSR_FOUNTAIN_BROKEN
Definition enums.h:612
@ SOUND_LRAW_SHY_GUY_CROWD_2
Definition enums.h:1184
@ SOUND_LRAW_BOMBETTE_FUSE
Definition enums.h:1001
@ SOUND_LOOP_SENTINEL_ALARM
Definition enums.h:1601
@ SOUND_LRAW_WATER_FLOWING_1
Definition enums.h:992
@ SOUND_LRAW_FIGHTING
Definition enums.h:1246
@ SOUND_LRAW_WATER_FLOWING_3
Definition enums.h:994
@ SOUND_LOOP_TIK24_WATER
Definition enums.h:1657
@ SOUND_NONE
Definition enums.h:550
@ SOUND_LOOP_SBK_OASIS_WATER
Definition enums.h:1681
@ SOUND_LOOP_TIK02_FLOW3
Definition enums.h:1626
@ SOUND_LOOP_OSR_FOUNTAIN_BROKEN
Definition enums.h:1674
@ SOUND_LOOP_TIK09_FLOW3
Definition enums.h:1640
@ SOUND_LRAW_QUIZ_TICKING
Definition enums.h:660
@ SOUND_LRAW_FLO_RELEASE_FOUNTAIN
Definition enums.h:827
@ SOUND_LRAW_CHARGE_METER
Definition enums.h:1148
@ SOUND_LOOP_IWA01_FLOW1
Definition enums.h:1597
@ SOUND_LRAW_JR_TROOPA_SWIM
Definition enums.h:606
@ SOUND_LOOP_DGB_COLLAPSE
Definition enums.h:1677
@ SOUND_LRAW_WHALE_GEYSER
Definition enums.h:603
@ SOUND_LOOP_TOYBOX_TRAIN_GEAR
Definition enums.h:1604
@ SOUND_KPA_FLIP_BRIDGE_PANEL
Definition enums.h:1372
@ SOUND_LOOP_FLIGHT
Definition enums.h:1662
@ SOUND_LOOP_TRD_WATER_EXT
Definition enums.h:1676
@ SOUND_LOOP_JAN_CONSTRUCTION
Definition enums.h:1614
@ SOUND_LOOP_TIK_UNUSED1_WATER
Definition enums.h:1642
@ SOUND_LRAW_JAN_CONSTRUCTION
Definition enums.h:815
@ SOUND_LRAW_TRD_02_LOWER_STAIRS
Definition enums.h:579
@ SOUND_LRAW_SHY_GUY_CROWD_1
Definition enums.h:1183
@ SOUND_LOOP_STAR_SANCTUARY_FAR
Definition enums.h:1683
@ SOUND_LRAW_JAN_BEACH_WAVES
Definition enums.h:610
@ SOUND_LOOP_TIK_UNUSED3_FLOW2
Definition enums.h:1647
@ SOUND_ISK_FLIP_STAIRS
Definition enums.h:619
@ SOUND_LOOP_ZIPLINE_RIDE
Definition enums.h:1609
@ SOUND_LRAW_STAR_SANCTUARY_INSIDE
Definition enums.h:690
@ SOUND_LOOP_TIK_UNUSED3_FLOW4
Definition enums.h:1645
@ SOUND_LRAW_JAN_LARGE_GEYSER
Definition enums.h:614
@ SOUND_LRAW_TOYBOX_TRAIN_GEAR
Definition enums.h:651
@ SOUND_LOOP_TIK05_FLOW1
Definition enums.h:1630
@ SOUND_LOOP_CRYSTAL_BALL_GLOW
Definition enums.h:1650
@ SOUND_LRAW_WINDMILL_GEARS
Definition enums.h:643
@ SOUND_LOOP_CHARGE_METER
Definition enums.h:1649
@ SOUND_LOOP_TIK03_FLOW1
Definition enums.h:1628
@ SOUND_LOOP_OSR_RUMBLING
Definition enums.h:1671
@ SOUND_LOOP_FIGHTING
Definition enums.h:1692
@ SOUND_LOOP_SPINNING_FLOWER
Definition enums.h:1690
@ SOUND_LOOP_NOK_WATER
Definition enums.h:1675
@ SOUND_LRAW_SENTINEL_ALARM
Definition enums.h:1129
@ SOUND_LOOP_BOMBETTE_FUSE
Definition enums.h:1584
@ SOUND_LOOP_TIK06_FLOW3
Definition enums.h:1633
@ SOUND_LOOP_JR_TROOPA_SWIM
Definition enums.h:1669
@ SOUND_LOOP_TIK01_WATER
Definition enums.h:1623
@ SOUND_LOOP_TIK02_FLOW2
Definition enums.h:1625
@ SOUND_LOOP_TIK02_WATER
Definition enums.h:1624
@ SOUND_FLIGHT
Definition enums.h:1015
@ SOUND_LRAW_WINDMILL_EXT
Definition enums.h:615
@ SOUND_LOOP_TIK03_WATER
Definition enums.h:1627
@ SOUND_LOOP_USE_PEACH_BEAM
Definition enums.h:1689
@ SOUND_LOOP_MOVE_LARGE_STATUE
Definition enums.h:1608
@ SOUND_LRAW_DGB_COLLAPSE
Definition enums.h:665
@ SOUND_LOOP_TIK19_FLOW4
Definition enums.h:1654
@ SOUND_LRAW_NOK_WATER
Definition enums.h:849
@ SOUND_LOOP_ISK_LOWER_STAIRS
Definition enums.h:1587
@ SOUND_LOOP_TIK23_WATER
Definition enums.h:1656
@ SOUND_LOOP_KPA_CHAIN_DRIVE
Definition enums.h:1665
@ SOUND_LRAW_SBK_RUINS_RISING_DISTANT
Definition enums.h:631
@ SOUND_LOOP_FLO_WATER_FLOW_1
Definition enums.h:1617
@ SOUND_LOOP_TIK09_WATER
Definition enums.h:1637
@ SOUND_LRAW_TRD_RAISE_STAIRS
Definition enums.h:577
@ SOUND_LOOP_NOTHING_1F
Definition enums.h:1615
@ SOUND_LOOP_TIK08_WATER
Definition enums.h:1635
@ SOUND_LOOP_WINDMILL_GEARS
Definition enums.h:1659
@ SOUND_LRAW_CRYSTAL_BALL_GLOW
Definition enums.h:917
@ SOUND_LOOP_ISK_FLIP_STAIRS
Definition enums.h:1586
@ SOUND_LOOP_NOTHING_26
Definition enums.h:1622
@ SOUND_LOOP_62
Definition enums.h:1682
@ SOUND_LRAW_STAR_ORB_RISING
Definition enums.h:677
@ SOUND_LOOP_TIK10_WATER
Definition enums.h:1641
@ SOUND_LOOP_TRD_04_LOWER_STAIRS
Definition enums.h:1589
@ SOUND_LOOP_TIK20_WATER
Definition enums.h:1655
@ SOUND_LOOP_STAR_SANCTUARY_INSIDE
Definition enums.h:1685
@ SOUND_LRAW_WATER_FLOWING_4
Definition enums.h:995
@ SOUND_LRAW_TIK_WATER
Definition enums.h:991
@ SOUND_LOOP_TIK_UNUSED3_WATER
Definition enums.h:1644
@ SOUND_LOOP_TIK08_FLOW1
Definition enums.h:1636
@ SOUND_LOOP_SBK_RUINS_WHIRLWIND
Definition enums.h:1679
@ SOUND_LRAW_KPA_ARENA_TURN_ON
Definition enums.h:948
@ SOUND_LOOP_SBK_RUINS_RISING_DISTANT
Definition enums.h:1680
@ SOUND_LOOP_FLO_RELEASE_FOUNTAIN
Definition enums.h:1620
@ SOUND_LOOP_TRD_RAISE_STAIRS
Definition enums.h:1591
@ SOUND_LOOP_KPA_FILL_WATER
Definition enums.h:1666
@ SOUND_LRAW_WATER_FLOWING_2
Definition enums.h:993
@ SOUND_LRAW_KPA_FILL_WATER
Definition enums.h:946
@ SOUND_LOOP_MAC_HARBOR_WATER
Definition enums.h:1672
@ SOUND_LOOP_TIK18_WATER
Definition enums.h:1651
@ SOUND_LRAW_KPA_ARENA_ACTIVE
Definition enums.h:949
@ SOUND_LOOP_OMO_ROTATING_WHEEL
Definition enums.h:1606
@ SOUND_LOOP_STAR_ORB_RISING
Definition enums.h:1687
@ SOUND_LOOP_MOVE_STATUE
Definition enums.h:1600
@ SOUND_LRAW_PUFF_PUFF_MACHINE
Definition enums.h:662
@ SOUND_LRAW_OMO_SLOT_MACHINE
Definition enums.h:1210
@ SOUND_LRAW_KKJ_RUMBLING
Definition enums.h:592
@ SOUND_LRAW_JAN_SMALL_GEYSER
Definition enums.h:613
@ SOUND_LOOP_QUIZ_TICKING
Definition enums.h:1602
@ SOUND_LRAW_KPA_CHAIN_DRIVE
Definition enums.h:937
@ SOUND_LOOP_TIK19_FLOW3
Definition enums.h:1653
@ SOUND_LOOP_OSR_FOUNTAIN_INTACT
Definition enums.h:1673
@ SOUND_LRAW_MOVE_STATUE
Definition enums.h:673
@ SOUND_LOOP_TRD_02_LOWER_STAIRS
Definition enums.h:1588
@ SOUND_LOOP_IWA10_FLOW1
Definition enums.h:1593
@ SOUND_LOOP_SHY_GUY_CROWD_1
Definition enums.h:1660
@ SOUND_LOOP_TRD_FLOWING_WATER
Definition enums.h:1590
@ SOUND_LOOP_WHALE_GEYSER
Definition enums.h:1663
@ SOUND_LRAW_STAR_SANCTUARY_NEAR
Definition enums.h:689
@ SOUND_LOOP_BUBBLE_DRIFT
Definition enums.h:1619
@ SOUND_LRAW_NOTHING_26
Definition enums.h:789
@ SOUND_LOOP_KPA_ARENA_TURN_ON
Definition enums.h:1693
@ SOUND_LOOP_KPA_FLIP_BRIDGE_PANEL
Definition enums.h:1668
@ SOUND_LOOP_JAN_SMALL_GEYSER
Definition enums.h:1612
@ SOUND_LRAW_RUMBLE
Definition enums.h:1260
@ SOUND_LOOP_KPA_DRAIN_WATER
Definition enums.h:1667
@ SOUND_LRAW_SBK_RUINS_RISING
Definition enums.h:628
@ SOUND_LOOP_SAM_STAIRS_RISE
Definition enums.h:1648
@ SOUND_LOOP_NOTHING_20
Definition enums.h:1616
@ SOUND_LOOP_IWA00_FLOW3
Definition enums.h:1595
@ SOUND_LOOP_TIK06_WATER
Definition enums.h:1631
@ SOUND_LOOP_TIK09_FLOW2
Definition enums.h:1638
@ SOUND_LOOP_RUMBLE
Definition enums.h:1691
@ SOUND_LRAW_SAM_STAIRS_RISE
Definition enums.h:1231
@ SOUND_LOOP_CHEERING
Definition enums.h:1592
@ SOUND_LOOP_ZIPLINE_RETURN
Definition enums.h:1610
@ SOUND_LRAW_ZIPLINE_RETURN
Definition enums.h:811
@ SOUND_LRAW_OMO_ROTATING_WHEEL
Definition enums.h:675
@ SOUND_LRAW_AUDIENCE_MURMUR
Definition enums.h:655
@ SOUND_LRAW_MAC_HARBOR_WATER
Definition enums.h:598
@ SOUND_LRAW_KPA_DRAIN_WATER
Definition enums.h:947
@ SOUND_LRAW_OBK_LOWER_CHAIN
Definition enums.h:670
@ SOUND_LOOP_USE_STAR_BEAM
Definition enums.h:1688
@ SOUND_LOOP_OMO_SLOT_MACHINE
Definition enums.h:1605
@ SOUND_LOOP_IWA01_FLOW2
Definition enums.h:1598
@ SOUND_LRAW_TRD_FLOWING_WATER
Definition enums.h:576
#define SOUND_LOOP_IDX(soundID)
Definition sfx_control.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_control.c.

@ SOUND_FIRE_BAR_0_B
Definition enums.h:1110
@ SOUND_FIRE_BAR_0_A
Definition enums.h:1137

◆ FireBar1Sounds

s32 FireBar1Sounds[] = { SOUND_FIRE_BAR_1_A, SOUND_FIRE_BAR_1_B }

Definition at line 128 of file sfx_control.c.

@ SOUND_FIRE_BAR_1_B
Definition enums.h:1111
@ SOUND_FIRE_BAR_1_A
Definition enums.h:1138

◆ FireBar2Sounds

s32 FireBar2Sounds[] = { SOUND_FIRE_BAR_2_A, SOUND_FIRE_BAR_2_B }

Definition at line 129 of file sfx_control.c.

@ SOUND_FIRE_BAR_2_B
Definition enums.h:1112
@ SOUND_FIRE_BAR_2_A
Definition enums.h:1139

◆ FireBar3Sounds

s32 FireBar3Sounds[] = { SOUND_FIRE_BAR_3_A, SOUND_FIRE_BAR_3_B }

Definition at line 130 of file sfx_control.c.

@ SOUND_FIRE_BAR_3_B
Definition enums.h:1113
@ SOUND_FIRE_BAR_3_A
Definition enums.h:1140

◆ FireBar4Sounds

s32 FireBar4Sounds[] = { SOUND_FIRE_BAR_4_A, SOUND_FIRE_BAR_4_B }

Definition at line 131 of file sfx_control.c.

@ SOUND_FIRE_BAR_4_A
Definition enums.h:1141
@ SOUND_FIRE_BAR_4_B
Definition enums.h:1114

◆ FireBar5Sounds

s32 FireBar5Sounds[] = { SOUND_FIRE_BAR_5_A, SOUND_FIRE_BAR_5_B }

Definition at line 132 of file sfx_control.c.

@ SOUND_FIRE_BAR_5_A
Definition enums.h:1142
@ SOUND_FIRE_BAR_5_B
Definition enums.h:1115

◆ FireBar6Sounds

s32 FireBar6Sounds[] = { SOUND_FIRE_BAR_6_A, SOUND_FIRE_BAR_6_B }

Definition at line 133 of file sfx_control.c.

@ SOUND_FIRE_BAR_6_A
Definition enums.h:1143
@ SOUND_FIRE_BAR_6_B
Definition enums.h:1116

◆ FireBar7Sounds

s32 FireBar7Sounds[] = { SOUND_FIRE_BAR_7_A, SOUND_FIRE_BAR_7_B }

Definition at line 134 of file sfx_control.c.

@ SOUND_FIRE_BAR_7_A
Definition enums.h:1144
@ SOUND_FIRE_BAR_7_B
Definition enums.h:1117

◆ FireBar8Sounds

s32 FireBar8Sounds[] = { SOUND_FIRE_BAR_8_A, SOUND_FIRE_BAR_8_B }

Definition at line 135 of file sfx_control.c.

@ SOUND_FIRE_BAR_8_B
Definition enums.h:1118
@ SOUND_FIRE_BAR_8_A
Definition enums.h:1145

◆ FireBar9Sounds

s32 FireBar9Sounds[] = { SOUND_FIRE_BAR_9_A, SOUND_FIRE_BAR_9_B }

Definition at line 136 of file sfx_control.c.

@ SOUND_FIRE_BAR_9_B
Definition enums.h:1119
@ SOUND_FIRE_BAR_9_A
Definition enums.h:1146

◆ FireBarDeadSounds

s32 FireBarDeadSounds[] = { SOUND_FIRE_BAR_DEAD, SOUND_FIRE_BAR_DEAD }

Definition at line 137 of file sfx_control.c.

◆ AlertSounds

s32 AlertSounds[] = { SOUND_AI_ALERT_A, SOUND_AI_ALERT_B }

Definition at line 138 of file sfx_control.c.

@ SOUND_AI_ALERT_B
Definition enums.h:1082
@ SOUND_AI_ALERT_A
Definition enums.h:1081

◆ SnoreInhaleSounds

s32 SnoreInhaleSounds[] = { SOUND_SNORE_INHALE_A, SOUND_SNORE_INHALE_B }

Definition at line 139 of file sfx_control.c.

@ SOUND_SNORE_INHALE_A
Definition enums.h:1130
@ SOUND_SNORE_INHALE_B
Definition enums.h:1131

◆ SnoreExhaleSounds

s32 SnoreExhaleSounds[] = { SOUND_SNORE_EXHALE_A, SOUND_SNORE_EXHALE_B }

Definition at line 140 of file sfx_control.c.

@ SOUND_SNORE_EXHALE_B
Definition enums.h:1136
@ SOUND_SNORE_EXHALE_A
Definition enums.h:1135

◆ SnapAwakeSounds

s32 SnapAwakeSounds[] = { SOUND_SNAP_AWAKE_A, SOUND_SNAP_AWAKE_B }

Definition at line 141 of file sfx_control.c.

@ SOUND_SNAP_AWAKE_A
Definition enums.h:1078
@ SOUND_SNAP_AWAKE_B
Definition enums.h:1079

◆ BooVanishSounds

s32 BooVanishSounds[] = { SOUND_BOO_VANISH_A, SOUND_BOO_VANISH_B }

Definition at line 142 of file sfx_control.c.

@ SOUND_BOO_VANISH_B
Definition enums.h:696
@ SOUND_BOO_VANISH_A
Definition enums.h:695

◆ BooAppearSounds

s32 BooAppearSounds[] = { SOUND_BOO_APPEAR_A, SOUND_BOO_APPEAR_B }

Definition at line 143 of file sfx_control.c.

@ SOUND_BOO_APPEAR_B
Definition enums.h:698
@ SOUND_BOO_APPEAR_A
Definition enums.h:697

◆ WindowOpenSounds

s32 WindowOpenSounds[] = { SOUND_WINDOW_OPEN_A, SOUND_WINDOW_OPEN_B }

Definition at line 144 of file sfx_control.c.

@ SOUND_WINDOW_OPEN_B
Definition enums.h:864
@ SOUND_WINDOW_OPEN_A
Definition enums.h:862

◆ WindowCloseSounds

s32 WindowCloseSounds[] = { SOUND_WINDOW_CLOSE_A, SOUND_WINDOW_CLOSE_B }

Definition at line 145 of file sfx_control.c.

@ SOUND_WINDOW_CLOSE_A
Definition enums.h:863
@ SOUND_WINDOW_CLOSE_B
Definition enums.h:865

◆ RavenLeapSounds

s32 RavenLeapSounds[] = { SOUND_RAVEN_LEAP_A, SOUND_RAVEN_LEAP_B }

Definition at line 146 of file sfx_control.c.

@ SOUND_RAVEN_LEAP_B
Definition enums.h:1029
@ SOUND_RAVEN_LEAP_A
Definition enums.h:1028

◆ RavenFallSounds

Definition at line 147 of file sfx_control.c.

@ SOUND_RAVEN_FALL_B
Definition enums.h:923
@ SOUND_RAVEN_FALL_A
Definition enums.h:922
@ SOUND_RAVEN_FALL_C
Definition enums.h:924

◆ ShootingStarFallSounds

Definition at line 148 of file sfx_control.c.

@ SOUND_SHOOTING_STAR_FALL_B
Definition enums.h:977
@ SOUND_SHOOTING_STAR_FALL_A
Definition enums.h:976

◆ ShootingStarBounceSounds

s32 ShootingStarBounceSounds[] = { SOUND_STAR_BOUNCE_A, SOUND_STAR_BOUNCE_B }

Definition at line 149 of file sfx_control.c.

@ SOUND_STAR_BOUNCE_A
Definition enums.h:978
@ SOUND_STAR_BOUNCE_B
Definition enums.h:979

◆ FuzzyHopSounds

Definition at line 150 of file sfx_control.c.

@ SOUND_FUZZY_HOP_A
Definition enums.h:1132
@ SOUND_FUZZY_HOP_B
Definition enums.h:1133
@ SOUND_FUZZY_HOP_C
Definition enums.h:1134

◆ BulletBillExplodeSounds

Definition at line 151 of file sfx_control.c.

@ SOUND_BULLET_BILL_EXPLODE_B
Definition enums.h:1420
@ SOUND_BULLET_BILL_EXPLODE_A
Definition enums.h:1419

◆ LuigiStepSounds

s32 LuigiStepSounds[] = { SOUND_LUIGI_STEP_A, SOUND_LUIGI_STEP_B }

Definition at line 152 of file sfx_control.c.

@ SOUND_LUIGI_STEP_A
Definition enums.h:799
@ SOUND_LUIGI_STEP_B
Definition enums.h:800

◆ TrainChugSounds

s32 TrainChugSounds[] = { SOUND_TRAIN_CHUG_A, SOUND_TRAIN_CHUG_B }

Definition at line 153 of file sfx_control.c.

@ SOUND_TRAIN_CHUG_B
Definition enums.h:907
@ SOUND_TRAIN_CHUG_A
Definition enums.h:906

◆ FinaleBridgeCollapseSounds

s32 FinaleBridgeCollapseSounds[] = { SOUND_KPA_BRIDGE_COLLAPSE_A, SOUND_KPA_BRIDGE_COLLAPSE_B }

Definition at line 154 of file sfx_control.c.

@ SOUND_KPA_BRIDGE_COLLAPSE_B
Definition enums.h:1367
@ SOUND_KPA_BRIDGE_COLLAPSE_A
Definition enums.h:1366

◆ FinaleExplosionSounds

s32 FinaleExplosionSounds[] = { SOUND_KPA_EXPLOSION_A, SOUND_KPA_EXPLOSION_B }

Definition at line 155 of file sfx_control.c.

@ SOUND_KPA_EXPLOSION_B
Definition enums.h:951
@ SOUND_KPA_EXPLOSION_A
Definition enums.h:950

◆ CardShuffleSounds

s32 CardShuffleSounds[] = { SOUND_SHUFFLE_CARD_A, SOUND_SHUFFLE_CARD_B }

Definition at line 156 of file sfx_control.c.

@ SOUND_SHUFFLE_CARD_B
Definition enums.h:1351
@ SOUND_SHUFFLE_CARD_A
Definition enums.h:1350

◆ StarSpiritAppearSounds

Definition at line 157 of file sfx_control.c.

@ SOUND_STAR_SPIRIT_APPEAR_A
Definition enums.h:1373
@ SOUND_STAR_SPIRIT_APPEAR_B
Definition enums.h:1374

◆ StarSpiritCastSounds

s32 StarSpiritCastSounds[] = { SOUND_STAR_SPIRIT_CAST_A, SOUND_STAR_SPIRIT_CAST_B }

Definition at line 158 of file sfx_control.c.

@ SOUND_STAR_SPIRIT_CAST_B
Definition enums.h:1376
@ SOUND_STAR_SPIRIT_CAST_A
Definition enums.h:1375

◆ UnusedExplodeSounds

◆ ShyGuyStepSounds

s32 ShyGuyStepSounds[] = { SOUND_SHY_GUY_STEP_A, SOUND_SHY_GUY_STEP_B }

Definition at line 160 of file sfx_control.c.

@ SOUND_SHY_GUY_STEP_B
Definition enums.h:1256
@ SOUND_SHY_GUY_STEP_A
Definition enums.h:1255

◆ AlternatingSounds

AlternatingSoundSet AlternatingSounds[]

Definition at line 165 of file sfx_control.c.

165 {
200};
@ SOUND_SEQ_WINDOW_CLOSE
Definition enums.h:1720
@ SOUND_SEQ_STAR_SPIRIT_APPEAR
Definition enums.h:1732
@ SOUND_SEQ_FIRE_BAR_1
Definition enums.h:1703
@ SOUND_SEQ_RAVEN_FALL
Definition enums.h:1722
@ SOUND_SEQ_FIRE_BAR_9
Definition enums.h:1711
@ SOUND_SEQ_SHOOTING_STAR_BOUNCE
Definition enums.h:1724
@ SOUND_SEQ_SHY_GUY_STEP
Definition enums.h:1735
@ SOUND_SEQ_FIRE_BAR_6
Definition enums.h:1708
@ SOUND_SEQ_AI_ALERT
Definition enums.h:1713
@ SOUND_SEQ_FIRE_BAR_4
Definition enums.h:1706
@ SOUND_SEQ_FIRE_BAR_8
Definition enums.h:1710
@ SOUND_SEQ_FIRE_BAR_2
Definition enums.h:1704
@ SOUND_SEQ_RAVEN_LEAP
Definition enums.h:1721
@ SOUND_SEQ_SNORE_INHALE
Definition enums.h:1714
@ SOUND_SEQ_BULLET_BILL_EXPLODE
Definition enums.h:1726
@ SOUND_SEQ_FIRE_BAR_DEAD
Definition enums.h:1712
@ SOUND_SEQ_SNORE_EXHALE
Definition enums.h:1715
@ SOUND_SEQ_FUZZY_HOP
Definition enums.h:1725
@ SOUND_SEQ_FIRE_BAR_5
Definition enums.h:1707
@ SOUND_SEQ_SHUFFLE_CARD
Definition enums.h:1731
@ SOUND_SEQ_UNUSED_EXPLODE
Definition enums.h:1734
@ SOUND_SEQ_FIRE_BAR_3
Definition enums.h:1705
@ SOUND_SEQ_LUIGI_STEP
Definition enums.h:1727
@ SOUND_SEQ_STAR_SPIRIT_CAST
Definition enums.h:1733
@ SOUND_SEQ_FIRE_BAR_7
Definition enums.h:1709
@ SOUND_SEQ_FINALE_EXPLOSION
Definition enums.h:1730
@ SOUND_SEQ_SHOOTING_STAR_FALL
Definition enums.h:1723
@ SOUND_SEQ_BOO_VANISH
Definition enums.h:1717
@ SOUND_SEQ_BOO_APPEAR
Definition enums.h:1718
@ SOUND_SEQ_FINALE_BRIDGE_COLLAPSE
Definition enums.h:1729
@ SOUND_SEQ_TRAIN_CHUG
Definition enums.h:1728
@ SOUND_SEQ_FIRE_BAR_0
Definition enums.h:1702
@ SOUND_SEQ_WINDOW_OPEN
Definition enums.h:1719
@ SOUND_SEQ_SNAP_AWAKE
Definition enums.h:1716
s32 ShyGuyStepSounds[]
s32 TrainChugSounds[]
s32 BooAppearSounds[]
#define SEQ_SOUND_ENTRY(soundID, sym)
s32 BulletBillExplodeSounds[]
s32 SnoreExhaleSounds[]
s32 WindowOpenSounds[]
s32 FireBar7Sounds[]
s32 LuigiStepSounds[]
s32 FireBar8Sounds[]
s32 ShootingStarBounceSounds[]
s32 SnoreInhaleSounds[]
s32 FinaleBridgeCollapseSounds[]
s32 BooVanishSounds[]
s32 FireBar1Sounds[]
s32 FireBar9Sounds[]
s32 WindowCloseSounds[]
s32 AlertSounds[]
s32 FireBar2Sounds[]
s32 FireBar3Sounds[]
s32 StarSpiritAppearSounds[]
s32 FireBar4Sounds[]
s32 FireBar6Sounds[]
s32 UnusedExplodeSounds[]
s32 SnapAwakeSounds[]
s32 FinaleExplosionSounds[]
s32 FireBarDeadSounds[]
s32 FireBar0Sounds[]
s32 StarSpiritCastSounds[]
s32 RavenFallSounds[]
s32 FireBar5Sounds[]
s32 FuzzyHopSounds[]
s32 CardShuffleSounds[]
s32 RavenLeapSounds[]
s32 ShootingStarFallSounds[]

Referenced by sfx_play_sound_with_params().

◆ OpenCloseSounds

s32 OpenCloseSounds[][2]
Initial value:
= {
}
@ SOUND_BASIC_DOOR_CLOSE
Definition enums.h:853
@ SOUND_CREAKY_DOOR_CLOSE
Definition enums.h:859
@ SOUND_BASIC_DOOR_OPEN
Definition enums.h:852
@ SOUND_METAL_GATE_CLOSE
Definition enums.h:861
@ SOUND_METAL_DOOR_OPEN
Definition enums.h:854
@ SOUND_CREAKY_WINDOW_OPEN
Definition enums.h:1457
@ SOUND_CREAKY_DOOR_OPEN
Definition enums.h:858
@ SOUND_LARGE_DOOR_OPEN
Definition enums.h:856
@ SOUND_METAL_DOOR_CLOSE
Definition enums.h:855
@ SOUND_LARGE_DOOR_CLOSE
Definition enums.h:857
@ SOUND_METAL_GATE_OPEN
Definition enums.h:860
@ SOUND_CREAKY_WINDOW_CLOSE
Definition enums.h:1458

Definition at line 202 of file sfx_control.c.

Referenced by sfx_play_sound_with_params().

◆ wEnvSounds

BSS SoundInstance wEnvSounds[10]

Definition at line 212 of file sfx_control.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_control.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_control.c.

Referenced by sfx_get_reverb_mode(), and sfx_set_reverb_mode().