4#define MAX_SOUND_INSTANCES 10
9#define SOUND_LOOP_IDX(soundID) (soundID & 0xFFFF)
162#define SEQ_SOUND_ENTRY(soundID, sym) [soundID & 0xFFFF] { .sounds = sym, .soundCount = ARRAY_COUNT(sym) }
218 s32 screenX, screenY, screenZ;
219 f32 volAmtOffsetX, volAmtDeltaY, volAmtDepth;
220 f32 offsetX, offsetY, depth;
221 f32 volTemp, panTemp;
226 if (screenX > 5000 || screenX < -5000 || screenY > 5000 || screenY < -5000) {
258 if (volAmtOffsetX < 0.0) {
259 volAmtOffsetX = 0.0f;
268 if (volAmtDeltaY < 0.0) {
272 depth = screenZ - 5550.0;
278 if (volAmtDepth < 0.0) {
282 volTemp = (volAmtOffsetX * volAmtDeltaY * volAmtDepth) * 127.0;
283 if (volTemp < 15.0) {
285 }
else if (volTemp > 127.0) {
290 panTemp = (((f32) screenX - (
SCREEN_WIDTH / 2.0)) / 3.6) + 64.0;
293 }
else if (panTemp > 127.0) {
466 s32 soundIndex = soundID & 0xFF;
467 s32 soundType = (soundID & 0x70000000) >> 0x1C;
595 s32 screenX, screenY, screenZ;
599 if (screenX > 3000 || screenX < -3000 || screenY > 3000 || screenY < -3000) {
607 *volume = (screenX * 0.3f) + 127.0f;
621 *pan = (screenX * 0.2f) + 32.0f;
623 f32 temp_f20 = ((screenX * 127.0) /
SCREEN_WIDTH) - 64.0;
630 s32 screenX, screenY, screenZ;
635 if (screenX > 3000 || screenX < -3000 || screenY > 3000 || screenY < -3000) {
643 *volume = (screenX * 0.3f) + 127.0f;
647 *volume = 127.0f - ((screenX - camera->
viewportW) * 0.3f);
651 depth =
fabsf(5000 - screenZ);
652 if (depth > 1000.0f) {
656 *volume = *volume * (1500.0f - depth) * 0.001f;
664 *pan = ((screenX * 64.0f) / camera->
viewportW) + 32.0f;
void snd_stop_sound(s32 soundID)
void snd_start_sound_with_shift(s32 soundID, u8 volume, u8 pan, s16 pitchShift)
void snd_adjust_sound_with_shift(s32 soundID, u8 volume, u8 pan, s16 pitchShift)
void func_800561E4(s32 arg0)
@ SOUND_INSTANCE_FLAG_POSITION_CHANGED
@ SOUND_INSTANCE_FLAG_ACTIVE
#define sfx_play_sound_at_position
@ SOUND_LRAW_OSR_FOUNTAIN_INTACT
@ SOUND_LRAW_USE_PEACH_BEAM
@ SOUND_LRAW_STAR_SANCTUARY_FAR
@ SOUND_LOOP_JAN_LARGE_GEYSER
@ SOUND_SEQ_STAR_SPIRIT_APPEAR
@ SOUND_LRAW_BOWSER_PROPELLER
@ SOUND_CREAKY_DOOR_CLOSE
@ SOUND_LOOP_KPA_ARENA_ACTIVE
@ SOUND_LOOP_JAN_BEACH_WAVES
@ SOUND_LOOP_TIK_UNUSED3_FLOW3
@ SOUND_LRAW_SBK_RUINS_WHIRLWIND
@ SOUND_LRAW_OSR_RUMBLING
@ SOUND_LOOP_IWA_UNUSED_FLOW3
@ SOUND_LOOP_BOWSER_PROPELLER
@ SOUND_LRAW_BUBBLE_DRIFT
@ SOUND_LOOP_AUDIENCE_MURMUR
@ SOUND_LRAW_ZIPLINE_RIDE
@ SOUND_LOOP_SBK_RUINS_RISING
@ SOUND_LOOP_STAR_SANCTUARY_NEAR
@ SOUND_LRAW_FLO_WATER_FLOW_2
@ SOUND_LOOP_FLO_FILL_WATER_POOL
@ SOUND_LRAW_TRD_WATER_EXT
@ SOUND_LOOP_SHY_GUY_CROWD_2
@ SOUND_LRAW_FLO_WATER_FLOW_1
@ SOUND_LRAW_MOVE_LARGE_STATUE
@ SOUND_STAR_SPIRIT_APPEAR_A
@ SOUND_LOOP_TIK_UNUSED2_WATER
@ SOUND_LOOP_WINDMILL_EXT
@ SOUND_LRAW_FLO_FILL_WATER_POOL
@ SOUND_LOOP_KKJ_RUMBLING
@ SOUND_LOOP_PUFF_PUFF_MACHINE
@ SOUND_LRAW_ISK_LOWER_STAIRS
@ SOUND_SEQ_SHOOTING_STAR_BOUNCE
@ SOUND_LOOP_FLO_WATER_FLOW_2
@ SOUND_SHOOTING_STAR_FALL_B
@ SOUND_SHOOTING_STAR_FALL_A
@ SOUND_LRAW_USE_STAR_BEAM
@ SOUND_CREAKY_WINDOW_OPEN
@ SOUND_LOOP_OBK_LOWER_CHAIN
@ SOUND_LRAW_SBK_OASIS_WATER
@ SOUND_LRAW_TRD_04_LOWER_STAIRS
@ SOUND_LRAW_SPINNING_FLOWER
@ SOUND_LRAW_OSR_FOUNTAIN_BROKEN
@ SOUND_LRAW_SHY_GUY_CROWD_2
@ SOUND_LRAW_BOMBETTE_FUSE
@ SOUND_LOOP_SENTINEL_ALARM
@ SOUND_LRAW_WATER_FLOWING_1
@ SOUND_LRAW_WATER_FLOWING_3
@ SOUND_LOOP_SBK_OASIS_WATER
@ SOUND_LOOP_OSR_FOUNTAIN_BROKEN
@ SOUND_STAR_SPIRIT_APPEAR_B
@ SOUND_STAR_SPIRIT_CAST_B
@ SOUND_LRAW_QUIZ_TICKING
@ SOUND_LRAW_FLO_RELEASE_FOUNTAIN
@ SOUND_LRAW_JR_TROOPA_SWIM
@ SOUND_LOOP_DGB_COLLAPSE
@ SOUND_LRAW_WHALE_GEYSER
@ SOUND_LOOP_TOYBOX_TRAIN_GEAR
@ SOUND_KPA_FLIP_BRIDGE_PANEL
@ SOUND_LOOP_TRD_WATER_EXT
@ SOUND_LOOP_JAN_CONSTRUCTION
@ SOUND_LOOP_TIK_UNUSED1_WATER
@ SOUND_KPA_BRIDGE_COLLAPSE_B
@ SOUND_LRAW_JAN_CONSTRUCTION
@ SOUND_LRAW_TRD_02_LOWER_STAIRS
@ SOUND_LRAW_SHY_GUY_CROWD_1
@ SOUND_LOOP_STAR_SANCTUARY_FAR
@ SOUND_LRAW_JAN_BEACH_WAVES
@ SOUND_LOOP_TIK_UNUSED3_FLOW2
@ SOUND_LOOP_ZIPLINE_RIDE
@ SOUND_LRAW_STAR_SANCTUARY_INSIDE
@ SOUND_LOOP_TIK_UNUSED3_FLOW4
@ SOUND_LRAW_JAN_LARGE_GEYSER
@ SOUND_LRAW_TOYBOX_TRAIN_GEAR
@ SOUND_LOOP_CRYSTAL_BALL_GLOW
@ SOUND_LRAW_WINDMILL_GEARS
@ SOUND_SEQ_BULLET_BILL_EXPLODE
@ SOUND_BULLET_BILL_EXPLODE_B
@ SOUND_SEQ_FIRE_BAR_DEAD
@ SOUND_LOOP_OSR_RUMBLING
@ SOUND_LOOP_SPINNING_FLOWER
@ SOUND_LRAW_SENTINEL_ALARM
@ SOUND_LOOP_BOMBETTE_FUSE
@ SOUND_BULLET_BILL_EXPLODE_A
@ SOUND_LOOP_JR_TROOPA_SWIM
@ SOUND_LRAW_WINDMILL_EXT
@ SOUND_LOOP_USE_PEACH_BEAM
@ SOUND_LOOP_MOVE_LARGE_STATUE
@ SOUND_LRAW_DGB_COLLAPSE
@ SOUND_LOOP_ISK_LOWER_STAIRS
@ SOUND_LOOP_KPA_CHAIN_DRIVE
@ SOUND_LRAW_SBK_RUINS_RISING_DISTANT
@ SOUND_LOOP_FLO_WATER_FLOW_1
@ SOUND_LRAW_TRD_RAISE_STAIRS
@ SOUND_LOOP_WINDMILL_GEARS
@ SOUND_SEQ_UNUSED_EXPLODE
@ SOUND_LRAW_CRYSTAL_BALL_GLOW
@ SOUND_LOOP_ISK_FLIP_STAIRS
@ SOUND_LRAW_STAR_ORB_RISING
@ SOUND_LOOP_TRD_04_LOWER_STAIRS
@ SOUND_LOOP_STAR_SANCTUARY_INSIDE
@ SOUND_LRAW_WATER_FLOWING_4
@ SOUND_SEQ_STAR_SPIRIT_CAST
@ SOUND_LOOP_TIK_UNUSED3_WATER
@ SOUND_LOOP_SBK_RUINS_WHIRLWIND
@ SOUND_LRAW_KPA_ARENA_TURN_ON
@ SOUND_LOOP_SBK_RUINS_RISING_DISTANT
@ SOUND_SEQ_FINALE_EXPLOSION
@ SOUND_LOOP_FLO_RELEASE_FOUNTAIN
@ SOUND_LOOP_TRD_RAISE_STAIRS
@ SOUND_LOOP_KPA_FILL_WATER
@ SOUND_LRAW_WATER_FLOWING_2
@ SOUND_LRAW_KPA_FILL_WATER
@ SOUND_SEQ_SHOOTING_STAR_FALL
@ SOUND_LOOP_MAC_HARBOR_WATER
@ SOUND_STAR_SPIRIT_CAST_A
@ SOUND_LRAW_KPA_ARENA_ACTIVE
@ SOUND_LOOP_OMO_ROTATING_WHEEL
@ SOUND_LOOP_STAR_ORB_RISING
@ SOUND_LRAW_PUFF_PUFF_MACHINE
@ SOUND_SEQ_FINALE_BRIDGE_COLLAPSE
@ SOUND_LRAW_OMO_SLOT_MACHINE
@ SOUND_LRAW_KKJ_RUMBLING
@ SOUND_LRAW_JAN_SMALL_GEYSER
@ SOUND_LOOP_QUIZ_TICKING
@ SOUND_LRAW_KPA_CHAIN_DRIVE
@ SOUND_LOOP_OSR_FOUNTAIN_INTACT
@ SOUND_LOOP_TRD_02_LOWER_STAIRS
@ SOUND_LOOP_SHY_GUY_CROWD_1
@ SOUND_LOOP_TRD_FLOWING_WATER
@ SOUND_LOOP_WHALE_GEYSER
@ SOUND_LRAW_STAR_SANCTUARY_NEAR
@ SOUND_LOOP_BUBBLE_DRIFT
@ SOUND_KPA_BRIDGE_COLLAPSE_A
@ SOUND_LOOP_KPA_ARENA_TURN_ON
@ SOUND_LOOP_KPA_FLIP_BRIDGE_PANEL
@ SOUND_LOOP_JAN_SMALL_GEYSER
@ SOUND_LOOP_KPA_DRAIN_WATER
@ SOUND_LRAW_SBK_RUINS_RISING
@ SOUND_LOOP_SAM_STAIRS_RISE
@ SOUND_LRAW_SAM_STAIRS_RISE
@ SOUND_CREAKY_WINDOW_CLOSE
@ SOUND_LOOP_ZIPLINE_RETURN
@ SOUND_LRAW_ZIPLINE_RETURN
@ SOUND_LRAW_OMO_ROTATING_WHEEL
@ SOUND_LRAW_AUDIENCE_MURMUR
@ SOUND_LRAW_MAC_HARBOR_WATER
@ SOUND_LRAW_KPA_DRAIN_WATER
@ SOUND_LRAW_OBK_LOWER_CHAIN
@ SOUND_LOOP_USE_STAR_BEAM
@ SOUND_LOOP_OMO_SLOT_MACHINE
@ SOUND_LRAW_TRD_FLOWING_WATER
@ SOUND_SPACE_PARAMS_MASK
@ SOUND_PARAM_CLIP_OFFSCREEN_X
@ SOUND_PARAM_CLIP_OFFSCREEN_ANY
@ SOUND_PARAM_CLIP_OFFSCREEN_Y
f32 update_lerp(s32 easing, f32 start, f32 end, s32 elapsed, s32 duration)
void get_screen_coords(s32 camID, f32 x, f32 y, f32 z, s32 *screenX, s32 *screenY, s32 *screenZ)
Npc * get_npc_safe(s32 npcID)
void sfx_clear_env_sounds(s16 playSounds)
void sfx_play_sound_at_npc(s32 soundID, s32 flags, s32 npcID)
void sfx_set_reverb_mode(s32 mode)
void sfx_update_env_sound_params(void)
void sfx_stop_env_sounds(void)
void sfx_register_looping_sound_at_position(s32 soundID, s32 flags, f32 x, f32 y, f32 z)
#define SEQ_SOUND_ENTRY(soundID, sym)
s32 BulletBillExplodeSounds[]
void sfx_get_spatialized_sound_params(f32 x, f32 y, f32 z, s16 *volume, s16 *pan, s32 flags)
void sfx_stop_sound(s32 soundID)
s32 sfx_get_reverb_mode(void)
void sfx_adjust_env_sound_params(s32 soundID, u8 volume, u8 pan, s16 pitchShift)
void sfx_reset_door_sounds(void)
void sfx_play_sound_with_params(s32 soundID, u8 volume, u8 pan, s16 pitchShift)
void snd_stop_tracking_env_sound_pos(s32 soundID, s32 keepPlaying)
s32 ShootingStarBounceSounds[]
SoundInstance * sfx_get_env_sound_instance(s32 soundID)
void sfx_play_sound(s32 soundID)
s32 sfx_adjust_env_sound_pos(s32 soundID, s32 sourceFlags, f32 x, f32 y, f32 z)
void sfx_compute_spatialized_sound_params_with_depth(f32 x, f32 y, f32 z, s16 *volume, s16 *pan)
s32 FinaleBridgeCollapseSounds[]
BSS SoundInstance wEnvSounds[10]
#define SOUND_LOOP_IDX(soundID)
AlternatingSoundSet AlternatingSounds[]
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)
void sfx_play_sound_at_player(s32 soundID, s32 flags)
#define MAX_SOUND_INSTANCES
BSS SoundInstance bEnvSounds[10]
s32 StarSpiritAppearSounds[]
void sfx_clear_sounds(void)
s32 UnusedExplodeSounds[]
void sfx_play_sound_looping(s32 soundID, u8 volume, u8 pan, s16 pitchShift)
s32 FinaleExplosionSounds[]
u16 gCurrentRoomDoorSounds
BSS SoundInstance * gCurrentEnvSounds
s32 StarSpiritCastSounds[]
s32 ShootingStarFallSounds[]
GameStatus * gGameStatusPtr
PlayerStatus gPlayerStatus