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

Go to the source code of this file.

Functions

void func_80055050 (ALHeap *heap)
 
void func_80055068 (u32 arg0)
 
void func_80055110 (BGMPlayer *player)
 
void func_8005513C (u32 arg0)
 
void snd_start_sound (s32 soundID, u8 volume, u8 pan)
 
void snd_start_sound_with_shift (s32 soundID, u8 volume, u8 pan, s16 pitchShift)
 
void snd_adjust_sound (s32 soundID, u8 volume, u8 pan)
 
void snd_adjust_sound_with_shift (s32 soundID, u8 volume, u8 pan, s16 pitchShift)
 
void snd_stop_sound (s32 soundID)
 
void snd_reset (void)
 
void snd_start_sound_raw (s32 soundID, s16 volume, s16 pitchShift, s32 pan)
 
AuResult snd_load_ambient (s32 ambSoundID)
 
AuResult snd_ambient_play (s32 index, s32 fadeInTime)
 
AuResult snd_ambient_stop_quick (s32 index)
 
AuResult snd_ambient_stop_slow (s32 index, s32 fadeOutTime)
 
AuResult snd_ambient_pause (s32 index, s32 fadeOutTime)
 
AuResult snd_ambient_resume (s32 index, s32 fadeInTime)
 
AuResult snd_ambient_is_stopped (s32 index)
 
AuResult snd_ambient_mute (s32 index, s32 arg1)
 
AuResult snd_ambient_set_volume (s32 index, s32 time, s32 volume)
 
AuResult snd_ambient_disable (s32 index)
 
AuResult snd_ambient_enable (s32 index)
 
void snd_ambient_80055760 (s32 index)
 
AuResult snd_ambient_stop_all (s32 time)
 
AuResult snd_ambient_play_only (s32 index)
 
AuResult au_song_load (s32 songID, s32 playerIndex)
 
AuResult au_song_start (s32 songName)
 
AuResult au_song_start_variation (s32 songName, s32 variation)
 
AuResult au_song_stop (s32 songName)
 
void au_stop_songs (void)
 
AuResult au_song_is_playing (s32 songName)
 
AuResult snd_set_song_variation_fade (s32 songName, s32 variation, s32 fadeInTime, s32 startVolume, s32 endVolume)
 
AuResult snd_set_song_fade (s32 songName, s32 fadeInTime, s32 startVolume, s32 endVolume)
 
AuResult snd_set_song_variation_fade_time (s32 songName, s32 fadeTime, s32 variation)
 
AuResult func_80055AF0 (s32 songName)
 
AuResult func_80055B28 (s32 songName)
 
AuResult func_80055B80 (s32 songName)
 
AuResult func_80055BB8 (s32 songName, s32 fadeTime)
 
AuResult func_80055BF0 (s32 songName)
 
AuResult func_80055C2C (s32 songName)
 
AuResult func_80055C64 (s32 songName)
 
AuResult func_80055C94 (s32 songName)
 
AuResult snd_set_song_variation (s32 songName, s32 variation)
 
AuResult snd_song_get_playing_info (s32 songName, BGMHeader **outFile, BGMPlayer **outPlayer)
 
AuResult snd_song_set_playback_rate (s32 songName, f32 rate)
 
AuResult snd_song_set_detune (s32 songName, s32 detune)
 
AuResult snd_song_set_track_volumes (s32 songName, MusicTrackVols trackVolSet)
 
AuResult snd_song_clear_track_volumes (s32 songName, MusicTrackVols trackVolSet)
 
AuResult snd_song_set_track_vol_mute (s32 songName, s32 trackIdx)
 
AuResult snd_song_set_track_vol_quiet (s32 songName, s32 trackIdx)
 
AuResult snd_song_set_track_vol_full (s32 songName, s32 trackIdx)
 
void bgm_set_proximity_mix_far (s32 songName, s32 mix)
 
void bgm_set_proximity_mix_near (s32 songName, s32 mix)
 
void bgm_set_proximity_mix_full (s32 songName, s32 mix)
 
void bgm_poll_music_events (MusicEventTrigger **musicEvents, s32 *count)
 
void bgm_flush_music_events (void)
 
void bgm_trigger_music_event (s32 playerID, s32 trackIndex, s32 eventInfo)
 
void bgm_clear_music_events (void)
 
void au_register_callback (AuCallback func, s32 index)
 
void audio_set_stereo (void)
 
void audio_set_mono (void)
 
void func_800561A4 (s32 arg0)
 
void func_800561C4 (s32 arg0)
 
void func_800561E4 (s32 arg0)
 
void enable_sounds (void)
 
void disable_sounds (void)
 

Variables

s32 PreventBGMPlayerUpdate = FALSE
 
u16 D_80078DB4 = 0
 
u16 AuAmbiencePlayOnlyIndex = 0
 
u8 D_80078DB8 []
 
u8 D_80078DC4 []
 
u8 D_80078DCC []
 
u8 D_80078DD0 []
 
u8 TrackVols_KPA_Outside []
 
u8 TrackVols_KPA_1 []
 
u8 TrackVols_KPA_2 []
 
u8 TrackVols_KPA_3 []
 

Function Documentation

◆ func_80055050()

void func_80055050 ( ALHeap * heap)

Definition at line 103 of file 30450.c.

103 {
104 D_80078DB4 = 1;
106}
s32 PreventBGMPlayerUpdate
Definition 30450.c:6
u16 D_80078DB4
Definition 30450.c:7

Referenced by au_engine_init().

◆ func_80055068()

void func_80055068 ( u32 arg0)

Definition at line 108 of file 30450.c.

108 {
109 u16 temp_a0 = D_80078DB4;
110 u32 temp_v1 = arg0 & 0xF;
111
112 if (temp_a0 == 1) {
113 switch (temp_v1) {
114 case 2:
115 case 3:
116 break;
117 case 4:
118 snd_start_sound_with_shift(arg0 >> 4, 0, 0, 0);
119 break;
120 case 1:
121 if (temp_v1 == 1) {
122 s32 filename = au_song_load((arg0 >> 4) & 0xFF, 0);
123
124 if (filename > ASCII_TO_U32('0', ' ', ' ', '\0')) {
125 au_song_start_variation(filename, (arg0 >> 0xC) & 3);
126 }
127 }
128 break;
129 }
130 }
131}
void snd_start_sound_with_shift(s32 soundID, u8 volume, u8 pan, s16 pitchShift)
Definition 30450.c:199
AuResult au_song_load(s32 songID, s32 playerIndex)
Definition 30450.c:436
AuResult au_song_start_variation(s32 songName, s32 variation)
Definition 30450.c:466
#define ASCII_TO_U32(a, b, c, d)
Definition macros.h:179

◆ func_80055110()

void func_80055110 ( BGMPlayer * player)

Definition at line 133 of file 30450.c.

133 {
134 s32 i;
135
136 for (i = 0; i < ARRAY_COUNT(player->unk_238); i++) {
137 player->unk_238[i] = 0;
138 }
139
140 player->unk_25B = 0;
141 player->unk_25A = 0;
142 player->unk_259 = 0;
143 player->unk_258 = 0;
144}
u8 unk_25B
Definition audio.h:1080
u8 unk_25A
Definition audio.h:1079
u8 unk_258
Definition audio.h:1077
u8 unk_259
Definition audio.h:1078
s32 unk_238[8]
Definition audio.h:1076
#define ARRAY_COUNT(arr)
Definition macros.h:40

Referenced by au_bgm_player_init().

◆ func_8005513C()

void func_8005513C ( u32 arg0)

Definition at line 146 of file 30450.c.

146 {
147 BGMPlayer* player = NULL;
148 u32 playerSwitch = arg0 & 0xF;
149
150 if (playerSwitch != 0) {
151 if (playerSwitch == 1) {
152 player = gBGMPlayerA;
153 } else if (playerSwitch == 2) {
154 player = gBGMPlayerB;
155 }
156
157 if (player != NULL) {
158 u32 temp;
159
160 if (player->unk_258 < 8) {
161 temp = player->unk_25A;
162
163 player->unk_238[temp] = arg0 >> 4;
164
165 temp++;
166 if (temp >= 8) {
167 temp = 0;
168 }
169 player->unk_25A = temp;
170
171 player->unk_258++;
172 } else {
173 temp = player->unk_25B + 1;
174
175 if (temp > 99) {
176 temp = 99;
177 }
178 player->unk_25B = temp;
179 }
180 }
181 }
182}
BGMPlayer * gBGMPlayerB
BGMPlayer * gBGMPlayerA

◆ snd_start_sound()

void snd_start_sound ( s32 soundID,
u8 volume,
u8 pan )

Definition at line 184 of file 30450.c.

184 {
185 SoundManager* soundManager = gSoundManager;
186 s16 vol = volume << 8;
187
188 if (vol != 0) {
189 vol |= 0xFF;
190 }
191
192 if (pan > 0x7F) {
193 pan = 0x7F;
194 }
195
196 au_sfx_enqueue_event(soundManager, soundID, vol, 0, pan);
197}
SoundManager * gSoundManager
void au_sfx_enqueue_event(SoundManager *manager, u32 soundID, s16 volume, s16 pitchShift, u8 pan)
Definition sfx_player.c:543

◆ snd_start_sound_with_shift()

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

Definition at line 199 of file 30450.c.

199 {
200 SoundManager* soundManager = gSoundManager;
201 s16 vol = volume << 8;
202
203 if (vol != 0) {
204 vol |= 0xFF;
205 }
206
207 if (pan > 0x7F) {
208 pan = 0x7F;
209 }
210
211 if (pitchShift > 2400) {
212 pitchShift = 2400;
213 } else if (pitchShift < -2400) {
214 pitchShift = -2400;
215 }
216
217 au_sfx_enqueue_event(soundManager, soundID, vol, pitchShift, pan);
218}

Referenced by func_80055068(), sfx_clear_env_sounds(), sfx_play_sound_looping(), and sfx_play_sound_with_params().

◆ snd_adjust_sound()

void snd_adjust_sound ( s32 soundID,
u8 volume,
u8 pan )

Definition at line 220 of file 30450.c.

220 {
221 SoundManager* soundManager = gSoundManager;
222 s16 vol = volume << 8;
223
224 if (vol != 0) {
225 vol |= 0xFF;
226 }
227
228 if (pan > 0x7F) {
229 pan = 0x7F;
230 }
231
232 au_sfx_enqueue_event(soundManager, soundID | SOUND_ID_ADJUST, vol, 0, pan);
233}
@ SOUND_ID_ADJUST
Definition enums.h:529

◆ snd_adjust_sound_with_shift()

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

Definition at line 235 of file 30450.c.

235 {
236 SoundManager* soundManager = gSoundManager;
237 s16 vol = volume << 8;
238
239 if (vol != 0) {
240 vol |= 0xFF;
241 }
242
243 if (pan > 0x7F) {
244 pan = 0x7F;
245 }
246
247 if (pitchShift > 2400) {
248 pitchShift = 2400;
249 } else if (pitchShift < -2400) {
250 pitchShift = -2400;
251 }
252
253 au_sfx_enqueue_event(soundManager, soundID | SOUND_ID_ADJUST, vol, pitchShift, pan);
254}

Referenced by sfx_adjust_env_sound_params(), and sfx_update_env_sound_params().

◆ snd_stop_sound()

void snd_stop_sound ( s32 soundID)

Definition at line 256 of file 30450.c.

256 {
257 SoundManager* soundManager = gSoundManager;
258
259 au_sfx_enqueue_event(soundManager, soundID | SOUND_ID_STOP, 0, 0, 0);
260}
@ SOUND_ID_STOP
Definition enums.h:526

Referenced by action_update_sliding(), sfx_stop_env_sounds(), sfx_stop_sound(), and snd_stop_tracking_env_sound_pos().

◆ snd_reset()

void snd_reset ( void )

Definition at line 262 of file 30450.c.

262 {
264}
s32 resetPending
Definition audio.h:692

◆ snd_start_sound_raw()

void snd_start_sound_raw ( s32 soundID,
s16 volume,
s16 pitchShift,
s32 pan )

Definition at line 266 of file 30450.c.

266 {
267 SoundManager* soundManager = gSoundManager;
268
269 au_sfx_enqueue_event(soundManager, soundID, volume, pitchShift, pan);
270}

◆ snd_load_ambient()

AuResult snd_load_ambient ( s32 ambSoundID)

Definition at line 272 of file 30450.c.

272 {
273 return au_ambient_load(ambSoundID);
274}
AuResult au_ambient_load(u32 ambSoundID)

Referenced by update_ambient_sounds().

◆ snd_ambient_play()

AuResult snd_ambient_play ( s32 index,
s32 fadeInTime )

Definition at line 276 of file 30450.c.

276 {
277 AuResult status = au_amb_check_player_index(index);
278
279 if (status != AU_RESULT_OK) {
280 return status;
281 }
282 return au_amb_start(index, fadeInTime);
283}
AuResult au_amb_check_player_index(u32 index)
Definition 2BF90.c:60
AuResult au_amb_start(s32 index, s32 time)
Definition 2BF90.c:83
AuResult
Definition enums.h:1755
@ AU_RESULT_OK
Definition enums.h:1756

Referenced by snd_ambient_80055760(), and update_ambient_sounds().

◆ snd_ambient_stop_quick()

AuResult snd_ambient_stop_quick ( s32 index)

Definition at line 285 of file 30450.c.

285 {
286 AuResult status = au_amb_check_player_index(index);
287
288 if (status == AU_RESULT_OK) {
289 au_amb_stop_quick(index);
290 }
291
292 return status;
293}
void au_amb_stop_quick(s32 index)
Definition 2BF90.c:157

Referenced by play_ambient_sounds(), snd_ambient_stop_all(), and update_ambient_sounds().

◆ snd_ambient_stop_slow()

AuResult snd_ambient_stop_slow ( s32 index,
s32 fadeOutTime )

Definition at line 295 of file 30450.c.

295 {
296 AuResult status = au_amb_check_player_index(index);
297
298 if (status == AU_RESULT_OK) {
299 au_amb_stop_slow(index, fadeOutTime);
300 }
301
302 return status;
303}
void au_amb_stop_slow(s32 index, s32 time)
Definition 2BF90.c:172

Referenced by snd_ambient_stop_all(), and update_ambient_sounds().

◆ snd_ambient_pause()

AuResult snd_ambient_pause ( s32 index,
s32 fadeOutTime )

Definition at line 305 of file 30450.c.

305 {
306 AuResult status = au_amb_check_player_index(index);
307
308 if (status == AU_RESULT_OK) {
309 au_amb_pause(index, fadeOutTime);
310 }
311
312 return status;
313}
void au_amb_pause(s32 index, s32 time)
Definition 2BF90.c:126

Referenced by bgm_push_battle_song().

◆ snd_ambient_resume()

AuResult snd_ambient_resume ( s32 index,
s32 fadeInTime )

Definition at line 315 of file 30450.c.

315 {
316 AuResult status = au_amb_check_player_index(index);
317
318 if (status == AU_RESULT_OK) {
319 au_amb_resume(index, fadeInTime);
320 }
321
322 return status;
323}
void au_amb_resume(s32 index, s32 time)
Definition 2BF90.c:141

Referenced by bgm_pop_battle_song().

◆ snd_ambient_is_stopped()

AuResult snd_ambient_is_stopped ( s32 index)

Definition at line 325 of file 30450.c.

325 {
326 AuResult status = au_amb_check_player_index(index);
327
328 if (status != AU_RESULT_OK) {
329 return status;
330 }
331 return au_amb_is_stopped(index);
332}
AuResult au_amb_is_stopped(s32 index)
Definition 2BF90.c:206

Referenced by update_ambient_sounds().

◆ snd_ambient_mute()

AuResult snd_ambient_mute ( s32 index,
s32 arg1 )

Definition at line 335 of file 30450.c.

335 {
336 AuResult status = au_amb_check_player_index(index);
337
338 if (status == AU_RESULT_OK) {
339 au_amb_load_tracks_fade(index, arg1);
340 }
341
342 return status;
343}
void au_amb_load_tracks_fade(s32 arg0, s32 arg1)
Definition 2BF90.c:68

◆ snd_ambient_set_volume()

AuResult snd_ambient_set_volume ( s32 index,
s32 time,
s32 volume )

Definition at line 345 of file 30450.c.

345 {
346 AuResult status = au_amb_check_player_index(index);
347
348 if (status == AU_RESULT_OK) {
349 au_amb_set_volume(index, time, volume);
350 }
351
352 return status;
353}
void au_amb_set_volume(s32 index, s32 time, s32 volume)
Definition 2BF90.c:187

◆ snd_ambient_disable()

AuResult snd_ambient_disable ( s32 index)

Definition at line 355 of file 30450.c.

355 {
356 AuResult status = au_amb_check_player_index(index);
357
358 if (status == AU_RESULT_OK) {
359 au_amb_set_disabled(index, TRUE);
360 }
361
362 return status;
363}
void au_amb_set_disabled(s32 index, s32 disable)
Definition 2BF90.c:72

Referenced by snd_ambient_play_only().

◆ snd_ambient_enable()

AuResult snd_ambient_enable ( s32 index)

Definition at line 365 of file 30450.c.

365 {
366 AuResult status = au_amb_check_player_index(index);
367
368 if (status == AU_RESULT_OK) {
369 au_amb_set_disabled(index, FALSE);
370 }
371
372 return status;
373}

Referenced by snd_ambient_play_only().

◆ snd_ambient_80055760()

void snd_ambient_80055760 ( s32 index)

Definition at line 376 of file 30450.c.

376 {
377 u32 i;
378 s32 lim = 4;
379
381
382 for (i = 0; i < lim; i++) {
383 if (snd_ambient_play(i, 0) != AU_RESULT_OK) {
384 return;
385 }
386 }
387
389}
u16 AuAmbiencePlayOnlyIndex
Definition 30450.c:8
AuResult snd_ambient_play_only(s32 index)
Definition 30450.c:409
AuResult snd_ambient_play(s32 index, s32 fadeInTime)
Definition 30450.c:276

◆ snd_ambient_stop_all()

AuResult snd_ambient_stop_all ( s32 time)

Definition at line 391 of file 30450.c.

391 {
392 AuResult status = AU_RESULT_OK;
393 s32 lim = 4;
394 u32 i;
395
396 for (i = 0; i < lim; i++) {
397 if (i == AuAmbiencePlayOnlyIndex) {
398 status = snd_ambient_stop_slow(i, time);
399 } else {
400 status = snd_ambient_stop_quick(i);
401 }
402 if (status != AU_RESULT_OK) {
403 break;
404 }
405 }
406 return status;
407}
AuResult snd_ambient_stop_slow(s32 index, s32 fadeOutTime)
Definition 30450.c:295
AuResult snd_ambient_stop_quick(s32 index)
Definition 30450.c:285

◆ snd_ambient_play_only()

AuResult snd_ambient_play_only ( s32 index)

Definition at line 409 of file 30450.c.

409 {
410 AuResult status = AU_RESULT_OK;
411 s32 lim = 4;
412
413 if (index != AuAmbiencePlayOnlyIndex) {
414 u32 i;
415
416 for (i = 0; i < lim; i++) {
417 if (i == index) {
418 status = snd_ambient_enable(i);
419 } else {
420 status = snd_ambient_disable(i); // mute
421 }
422
423 if (status != AU_RESULT_OK) {
424 break;
425 }
426 }
427
428 if (status == AU_RESULT_OK) {
430 }
431 }
432
433 return status;
434}
AuResult snd_ambient_disable(s32 index)
Definition 30450.c:355
AuResult snd_ambient_enable(s32 index)
Definition 30450.c:365

Referenced by snd_ambient_80055760().

◆ au_song_load()

AuResult au_song_load ( s32 songID,
s32 playerIndex )

Definition at line 436 of file 30450.c.

436 {
437 BGMHeader* bgmFile;
438 BGMPlayer* player;
439
440 au_get_bgm_player_and_file(playerIndex, &bgmFile, &player);
441
442 if (bgmFile != NULL) {
443 return au_load_song_files(songID, bgmFile, player);
444 } else {
446 }
447}
void au_get_bgm_player_and_file(u32 playerIndex, BGMHeader **outFile, BGMPlayer **outPlayer)
AuResult au_load_song_files(u32 songID, BGMHeader *bgmFile, BGMPlayer *player)
@ AU_ERROR_NULL_SONG_NAME
Definition enums.h:1761

Referenced by bgm_update_music_settings(), and func_80055068().

◆ au_song_start()

AuResult au_song_start ( s32 songName)

Definition at line 449 of file 30450.c.

449 {
450 AuResult status;
452
454 s.songName = songName;
455 s.duration = 0;
456 s.startVolume = 127;
457 s.finalVolume = 127;
458 s.variation = 0;
459 s.unk14 = 0;
460 status = au_bgm_dispatch_player_event(&s);
462
463 return status;
464}
AuResult au_bgm_dispatch_player_event(SongUpdateEvent *event)

◆ au_song_start_variation()

AuResult au_song_start_variation ( s32 songName,
s32 variation )

Definition at line 466 of file 30450.c.

466 {
467 AuResult status;
469
471 s.songName = songName;
472 s.duration = 0;
473 s.startVolume = 127;
474 s.finalVolume = 127;
475 s.variation = variation;
476 s.unk14 = 0;
477 status = au_bgm_dispatch_player_event(&s);
479
480 return status;
481}

Referenced by bgm_update_music_settings(), and func_80055068().

◆ au_song_stop()

AuResult au_song_stop ( s32 songName)

Definition at line 483 of file 30450.c.

483 {
484 return au_bgm_stop_song(songName);
485}
AuResult au_bgm_stop_song(s32 songName)

Referenced by _bgm_set_song(), bgm_update_music_settings(), and func_8014A964().

◆ au_stop_songs()

void au_stop_songs ( void )

Definition at line 487 of file 30450.c.

487 {
489}
void au_bgm_stop_all(void)

◆ au_song_is_playing()

AuResult au_song_is_playing ( s32 songName)

Definition at line 491 of file 30450.c.

491 {
492 return au_bgm_is_song_playing(songName);
493}
AuResult au_bgm_is_song_playing(s32 songName)

Referenced by bgm_update_music_settings(), and func_8014AD40().

◆ snd_set_song_variation_fade()

AuResult snd_set_song_variation_fade ( s32 songName,
s32 variation,
s32 fadeInTime,
s32 startVolume,
s32 endVolume )

Definition at line 495 of file 30450.c.

495 {
496 AuResult status;
498
500 s.songName = songName;
501 s.duration = fadeInTime;
502 s.startVolume = startVolume;
503 s.finalVolume = endVolume;
504 s.variation = variation;
505 s.unk14 = 0;
506 status = au_bgm_dispatch_player_event(&s);
508
509 return status;
510}

Referenced by bgm_update_music_settings().

◆ snd_set_song_fade()

AuResult snd_set_song_fade ( s32 songName,
s32 fadeInTime,
s32 startVolume,
s32 endVolume )

Definition at line 512 of file 30450.c.

512 {
513 AuResult status;
515
517 s.songName = songName;
518 s.duration = fadeInTime;
519 s.startVolume = startVolume;
520 s.finalVolume = endVolume;
521 s.variation = 0;
522 s.unk14 = 0;
523 status = au_bgm_dispatch_player_event(&s);
525
526 return status;
527}

◆ snd_set_song_variation_fade_time()

AuResult snd_set_song_variation_fade_time ( s32 songName,
s32 fadeTime,
s32 variation )

Definition at line 529 of file 30450.c.

529 {
531 s.songName = songName;
532 s.duration = fadeTime;
533 s.startVolume = 0;
534 s.finalVolume = 0;
535 s.variation = variation;
536 s.unk14 = 0;
537 return func_8004DB4C(&s);
538}
AuResult func_8004DB4C(SongUpdateEvent *s)

Referenced by bgm_update_music_settings().

◆ func_80055AF0()

AuResult func_80055AF0 ( s32 songName)

Definition at line 540 of file 30450.c.

540 {
542 s.songName = songName;
543 s.duration = 0;
544 s.startVolume = 0;
545 s.finalVolume = 0;
546 s.variation = 0;
547 s.unk14 = 0;
548 return func_8004DCB8(&s, 0);
549}
AuResult func_8004DCB8(SongUpdateEvent *update, s32 clearChanged)

Referenced by bgm_update_music_settings().

◆ func_80055B28()

AuResult func_80055B28 ( s32 songName)

Definition at line 551 of file 30450.c.

551 {
552 AuResult status;
554
556 s.songName = songName;
557 s.duration = 2000;
558 s.startVolume = 1;
559 s.finalVolume = 127;
560 s.variation = 0;
561 s.unk14 = 0;
562 status = func_8004DE2C(&s);
564
565 return status;
566}
AuResult func_8004DE2C(SongUpdateEvent *update)

Referenced by bgm_update_music_settings().

◆ func_80055B80()

AuResult func_80055B80 ( s32 songName)

Definition at line 568 of file 30450.c.

568 {
570 s.songName = songName;
571 s.duration = 0;
572 s.startVolume = 0;
573 s.finalVolume = 0;
574 s.variation = 0;
575 s.unk14 = 0;
576 return func_8004DCB8(&s, 1);
577}

Referenced by _bgm_set_song().

◆ func_80055BB8()

AuResult func_80055BB8 ( s32 songName,
s32 fadeTime )

Definition at line 579 of file 30450.c.

579 {
581 s.songName = songName;
582 s.duration = fadeTime;
583 s.startVolume = 0;
584 s.finalVolume = 0;
585 s.variation = 0;
586 s.unk14 = 1;
587 return func_8004DB4C(&s);
588}

Referenced by bgm_update_music_settings().

◆ func_80055BF0()

AuResult func_80055BF0 ( s32 songName)

Definition at line 590 of file 30450.c.

590 {
592 s.songName = songName;
593 s.duration = 0;
594 s.startVolume = 0;
595 s.finalVolume = 0;
596 s.variation = 0;
597 s.unk14 = 1;
598 return func_8004DCB8(&s, 0);
599}

◆ func_80055C2C()

AuResult func_80055C2C ( s32 songName)

Definition at line 601 of file 30450.c.

601 {
603 s.songName = songName;
604 s.duration = 0;
605 s.startVolume = 0;
606 s.finalVolume = 0;
607 s.variation = 0;
608 s.unk14 = 1;
609 return func_8004DE2C(&s);
610}

◆ func_80055C64()

AuResult func_80055C64 ( s32 songName)

Definition at line 612 of file 30450.c.

612 {
614 s.songName = songName;
615 s.duration = 500;
616 s.finalVolume = 0x2000;
617 return func_8004E0F4(&s);
618}
AuResult func_8004E0F4(SongUpdateEvent *update)

◆ func_80055C94()

AuResult func_80055C94 ( s32 songName)

Definition at line 620 of file 30450.c.

620 {
622 s.songName = songName;
623 s.duration = 500;
624 s.finalVolume = 0x7FFF;
625 return func_8004E0F4(&s);
626}

◆ snd_set_song_variation()

AuResult snd_set_song_variation ( s32 songName,
s32 variation )

Definition at line 628 of file 30450.c.

628 {
630 s.songName = songName;
631 s.variation = variation;
632 return func_80050970(&s);
633}
AuResult func_80050970(SongUpdateEvent *update)

Referenced by bgm_set_variation().

◆ snd_song_get_playing_info()

AuResult snd_song_get_playing_info ( s32 songName,
BGMHeader ** outFile,
BGMPlayer ** outPlayer )

Definition at line 636 of file 30450.c.

636 {
637 AuResult status = AU_RESULT_OK;
638 BGMHeader* bgmFile;
639
640 bgmFile = gSoundGlobals->dataBGM[0];
641 if (songName == bgmFile->name) {
642 *outPlayer = gBGMPlayerA;
643 *outFile = bgmFile;
644 } else {
645 bgmFile = gSoundGlobals->dataBGM[1];
646 if (songName == bgmFile->name) {
647 *outPlayer = gBGMPlayerB;
648 *outFile = bgmFile;
649 } else {
650 status = AU_ERROR_1;
651 }
652 }
653 return status;
654}
AuGlobals * gSoundGlobals
s32 name
Definition audio.h:758
struct BGMHeader * dataBGM[2]
Definition audio.h:910
@ AU_ERROR_1
Definition enums.h:1757

Referenced by snd_song_clear_track_volumes(), snd_song_set_detune(), snd_song_set_playback_rate(), and snd_song_set_track_volumes().

◆ snd_song_set_playback_rate()

AuResult snd_song_set_playback_rate ( s32 songName,
f32 rate )

Definition at line 656 of file 30450.c.

656 {
657 BGMPlayer* bgmPlayer;
658 BGMHeader* bgmFile;
659 AuResult status;
660
661 status = snd_song_get_playing_info(songName, &bgmFile, &bgmPlayer);
662
663 if (status == AU_RESULT_OK) {
664 au_bgm_set_playback_rate(bgmPlayer, rate);
665 }
666
667 return status;
668}
void au_bgm_set_playback_rate(BGMPlayer *player, f32 rate)
AuResult snd_song_get_playing_info(s32 songName, BGMHeader **outFile, BGMPlayer **outPlayer)
Definition 30450.c:636

◆ snd_song_set_detune()

AuResult snd_song_set_detune ( s32 songName,
s32 detune )

Definition at line 670 of file 30450.c.

670 {
671 BGMPlayer* bgmPlayer;
672 BGMHeader* bgmFile;
673 AuResult status;
674
675 status = snd_song_get_playing_info(songName, &bgmFile, &bgmPlayer);
676
677 if (status == AU_RESULT_OK) {
678 au_bgm_player_set_detune(bgmPlayer, detune);
679 }
680
681 return status;
682}
void au_bgm_player_set_detune(BGMPlayer *player, s32 detune)

◆ snd_song_set_track_volumes()

AuResult snd_song_set_track_volumes ( s32 songName,
MusicTrackVols trackVolSet )

Definition at line 684 of file 30450.c.

684 {
685 BGMPlayer* bgmPlayer;
686 BGMHeader* bgmFile;
687 AuResult status;
688
689 status = snd_song_get_playing_info(songName, &bgmFile, &bgmPlayer);
690
691 if (status == AU_RESULT_OK) {
692 u8* trackVols = snd_song_get_track_volumes_set(trackVolSet);
693
694 if (trackVols != NULL) {
695 au_bgm_set_track_volumes(bgmPlayer, trackVols, TRUE);
696 } else {
697 status = AU_ERROR_11;
698 }
699 }
700
701 return status;
702}
void au_bgm_set_track_volumes(BGMPlayer *player, u8 *trackVols, s32 mode)
@ AU_ERROR_11
Definition enums.h:1766

Referenced by bgm_set_track_volumes().

◆ snd_song_clear_track_volumes()

AuResult snd_song_clear_track_volumes ( s32 songName,
MusicTrackVols trackVolSet )

Definition at line 704 of file 30450.c.

704 {
705 BGMPlayer* bgmPlayer;
706 BGMHeader* bgmFile;
707 AuResult status;
708
709 status = snd_song_get_playing_info(songName, &bgmFile, &bgmPlayer);
710
711 if (status == AU_RESULT_OK) {
712 u8* trackVols = snd_song_get_track_volumes_set(trackVolSet);
713
714 if (trackVols != NULL) {
715 au_bgm_set_track_volumes(bgmPlayer, trackVols, FALSE);
716 } else {
717 status = AU_ERROR_11;
718 }
719 }
720
721 return status;
722}

Referenced by bgm_clear_track_volumes().

◆ snd_song_set_track_vol_mute()

AuResult snd_song_set_track_vol_mute ( s32 songName,
s32 trackIdx )

Definition at line 777 of file 30450.c.

777 {
778 return snd_song_change_track_volume(songName, trackIdx, 0);
779}

◆ snd_song_set_track_vol_quiet()

AuResult snd_song_set_track_vol_quiet ( s32 songName,
s32 trackIdx )

Definition at line 781 of file 30450.c.

781 {
782 return snd_song_change_track_volume(songName, trackIdx, 0x3F);
783}

◆ snd_song_set_track_vol_full()

AuResult snd_song_set_track_vol_full ( s32 songName,
s32 trackIdx )

Definition at line 785 of file 30450.c.

785 {
786 return snd_song_change_track_volume(songName, trackIdx, 0x7F);
787}

◆ bgm_set_proximity_mix_far()

void bgm_set_proximity_mix_far ( s32 songName,
s32 mix )

Definition at line 789 of file 30450.c.

789 {
790 au_bgm_set_proximity_mix(songName, (u8)mix);
791}
void au_bgm_set_proximity_mix(s32 songName, u32 mix)

Referenced by bgm_adjust_proximity().

◆ bgm_set_proximity_mix_near()

void bgm_set_proximity_mix_near ( s32 songName,
s32 mix )

Definition at line 793 of file 30450.c.

793 {
794 au_bgm_set_proximity_mix(songName, (u8)mix | 0x57000000);
795}

Referenced by bgm_adjust_proximity().

◆ bgm_set_proximity_mix_full()

void bgm_set_proximity_mix_full ( s32 songName,
s32 mix )

Definition at line 797 of file 30450.c.

797 {
798 au_bgm_set_proximity_mix(songName, (u8)mix | 0x7F000000);
799}

Referenced by bgm_adjust_proximity().

◆ bgm_poll_music_events()

void bgm_poll_music_events ( MusicEventTrigger ** musicEvents,
s32 * count )

Definition at line 801 of file 30450.c.

801 {
802 AuGlobals* globals = gSoundGlobals;
803
804 *musicEvents = globals->musicEventQueue;
805 *count = globals->musicEventQueueCount;
806}
MusicEventTrigger * musicEventQueue
Definition audio.h:921
u32 musicEventQueueCount
Definition audio.h:922

◆ bgm_flush_music_events()

void bgm_flush_music_events ( void )

Definition at line 808 of file 30450.c.

808 {
810}
s32 flushMusicEventQueue
Definition audio.h:923

◆ bgm_trigger_music_event()

void bgm_trigger_music_event ( s32 playerID,
s32 trackIndex,
s32 eventInfo )

Definition at line 812 of file 30450.c.

812 {
813 AuGlobals* globals = gSoundGlobals;
814
815 if (globals->musicEventQueueCount < 16) {
816 *globals->musicEventQueuePos++ = ((playerID << 0x1C) + ((trackIndex & 0xF) << 0x18) + eventInfo);
817 globals->musicEventQueueCount++;
818 }
819}
MusicEventTrigger * musicEventQueuePos
Definition audio.h:920

Referenced by au_BGMCmd_FD_EventTrigger().

◆ bgm_clear_music_events()

void bgm_clear_music_events ( void )

Definition at line 821 of file 30450.c.

821 {
822 AuGlobals* globals = gSoundGlobals;
823 s32* buf = globals->musicEventQueue;
824 s32 i = 15;
825
826 do {
827 *buf++ = 0;
828 } while (i-- != 0);
829
830 globals->musicEventQueueCount = 0;
831 globals->flushMusicEventQueue = FALSE;
832 globals->musicEventQueuePos = globals->musicEventQueue;
833}

Referenced by au_engine_init(), and au_update_players_main().

◆ au_register_callback()

void au_register_callback ( AuCallback func,
s32 index )

Definition at line 835 of file 30450.c.

835 {
836 gSoundGlobals->audioThreadCallbacks[index] = func;
837}
AuCallback audioThreadCallbacks[2]
Definition audio.h:925

◆ audio_set_stereo()

void audio_set_stereo ( void )

Definition at line 839 of file 30450.c.

839 {
840 func_80056D5C(1);
841 func_80054DA8(0);
842}
void func_80054DA8(u32 bMonoSound)
void func_80056D5C(u8 bStereoSound)
Definition 31650.c:262

Referenced by filemenu_main_handle_input(), and state_step_startup().

◆ audio_set_mono()

void audio_set_mono ( void )

Definition at line 844 of file 30450.c.

844 {
845 func_80056D5C(0);
846 func_80054DA8(1);
847}

Referenced by filemenu_main_handle_input(), and state_step_startup().

◆ func_800561A4()

void func_800561A4 ( s32 arg0)

Definition at line 849 of file 30450.c.

849 {
850 func_80054CE0(1, arg0);
851}
void func_80054CE0(s32 arg0, u32 idx)

Referenced by bgm_reset_sequence_players(), and bgm_update_volume().

◆ func_800561C4()

void func_800561C4 ( s32 arg0)

Definition at line 853 of file 30450.c.

853 {
854 func_80054CE0(0x10, arg0);
855}

◆ func_800561E4()

void func_800561E4 ( s32 arg0)

Definition at line 857 of file 30450.c.

857 {
858 func_80054D74(0x10, arg0);
859}
s32 func_80054D74(s32 arg0, s32 arg1)

Referenced by sfx_set_reverb_mode().

◆ enable_sounds()

void enable_sounds ( void )

Definition at line 861 of file 30450.c.

861 {
863}
@ SND_MANAGER_STATE_ENABLED
Definition audio.h:237
void au_sfx_set_state(SoundManager *manager, s32 arg1)
Definition sfx_player.c:684

Referenced by state_step_demo().

◆ disable_sounds()

void disable_sounds ( void )

Definition at line 865 of file 30450.c.

865 {
867}
@ SND_MANAGER_STATE_DISABLED
Definition audio.h:238

Referenced by state_init_demo().

Variable Documentation

◆ PreventBGMPlayerUpdate

s32 PreventBGMPlayerUpdate = FALSE

◆ D_80078DB4

u16 D_80078DB4 = 0

Definition at line 7 of file 30450.c.

Referenced by func_80055050(), and func_80055068().

◆ AuAmbiencePlayOnlyIndex

u16 AuAmbiencePlayOnlyIndex = 0

Definition at line 8 of file 30450.c.

Referenced by snd_ambient_80055760(), snd_ambient_play_only(), and snd_ambient_stop_all().

◆ D_80078DB8

u8 D_80078DB8[]
Initial value:
= {
2, 94,
3, 80,
4, 100,
5, 84,
0
}

Definition at line 14 of file 30450.c.

14 {
15 2, 94,
16 3, 80,
17 4, 100,
18 5, 84,
19 0
20};

◆ D_80078DC4

u8 D_80078DC4[]
Initial value:
= {
2, 100,
3, 110,
4, 90,
0
}

Definition at line 21 of file 30450.c.

21 {
22 2, 100,
23 3, 110,
24 4, 90,
25 0
26};

◆ D_80078DCC

u8 D_80078DCC[]
Initial value:
= {
2, 95,
0
}

Definition at line 27 of file 30450.c.

27 {
28 2, 95,
29 0
30};

◆ D_80078DD0

u8 D_80078DD0[]
Initial value:
= {
5, 70,
6, 90,
7, 90,
8, 100,
0
}

Definition at line 31 of file 30450.c.

31 {
32 5, 70,
33 6, 90,
34 7, 90,
35 8, 100,
36 0
37};

◆ TrackVols_KPA_Outside

u8 TrackVols_KPA_Outside[]
Initial value:
= {
5, 0,
6, 0,
7, 0,
8, 0,
9, 0,
10, 0,
11, 0,
12, 0,
13, 0,
14, 0,
15, 0,
16, 0,
0
}

Definition at line 39 of file 30450.c.

39 {
40 5, 0,
41 6, 0,
42 7, 0,
43 8, 0,
44 9, 0,
45 10, 0,
46 11, 0,
47 12, 0,
48 13, 0,
49 14, 0,
50 15, 0,
51 16, 0,
52 0
53};

◆ TrackVols_KPA_1

u8 TrackVols_KPA_1[]
Initial value:
= {
5, 100,
6, 102,
7, 88,
8, 110,
9, 0,
10, 0,
11, 0,
12, 0,
13, 0,
14, 0,
15, 0,
16, 0,
0
}

Definition at line 55 of file 30450.c.

55 {
56 5, 100,
57 6, 102,
58 7, 88,
59 8, 110,
60 9, 0,
61 10, 0,
62 11, 0,
63 12, 0,
64 13, 0,
65 14, 0,
66 15, 0,
67 16, 0,
68 0
69};

◆ TrackVols_KPA_2

u8 TrackVols_KPA_2[]
Initial value:
= {
5, 100,
6, 102,
7, 88,
8, 110,
9, 126,
10, 88,
11, 100,
12, 0,
13, 0,
14, 0,
15, 0,
16, 0,
0
}

Definition at line 71 of file 30450.c.

71 {
72 5, 100,
73 6, 102,
74 7, 88,
75 8, 110,
76 9, 126,
77 10, 88,
78 11, 100,
79 12, 0,
80 13, 0,
81 14, 0,
82 15, 0,
83 16, 0,
84 0
85};

◆ TrackVols_KPA_3

u8 TrackVols_KPA_3[]
Initial value:
= {
5, 100,
6, 102,
7, 88,
8, 110,
9, 126,
10, 88,
11, 100,
12, 100,
13, 106,
14, 100,
15, 100,
16, 110,
0
}

Definition at line 87 of file 30450.c.

87 {
88 5, 100,
89 6, 102,
90 7, 88,
91 8, 110,
92 9, 126,
93 10, 88,
94 11, 100,
95 12, 100,
96 13, 106,
97 14, 100,
98 15, 100,
99 16, 110,
100 0
101};