mirror of https://github.com/sm64pc/sm64pc.git
Updated sound engine to refresh 13
This commit is contained in:
parent
6fe41e0120
commit
c9bcce5ac1
File diff suppressed because it is too large
Load Diff
|
@ -1,6 +1,9 @@
|
|||
#ifndef SEQ_IDS_H
|
||||
#define SEQ_IDS_H
|
||||
|
||||
// Sometimes a sequence id is represented as one of the below ids (the base id),
|
||||
// optionally OR'd with SEQ_VARIATION.
|
||||
#define SEQ_BASE_ID 0x7f
|
||||
#define SEQ_VARIATION 0x80
|
||||
|
||||
enum SeqId {
|
||||
|
@ -42,4 +45,4 @@ enum SeqId {
|
|||
SEQ_COUNT
|
||||
};
|
||||
|
||||
#endif // SEQ_IDS_H
|
||||
#endif // SEQ_IDS_H
|
|
@ -13,7 +13,7 @@ const LevelScript level_script_entry[] = {
|
|||
#ifdef TOGGLE_GAME_DEBUG
|
||||
EXECUTE(/*seg*/ 0x14, /*script*/ _introSegmentRomStart, /*scriptEnd*/ _introSegmentRomEnd, /*entry*/ level_intro_entry_4),
|
||||
#else
|
||||
EXECUTE(/*seg*/ 0x14, /*script*/ _introSegmentRomStart, /*scriptEnd*/ _introSegmentRomEnd, /*entry*/ level_intro_n64),
|
||||
EXECUTE(/*seg*/ 0x14, /*script*/ _introSegmentRomStart, /*scriptEnd*/ _introSegmentRomEnd, /*entry*/ script_intro_L1),
|
||||
#endif
|
||||
JUMP(/*target*/ level_script_entry),
|
||||
};
|
||||
|
|
|
@ -5,62 +5,15 @@
|
|||
#include "data.h"
|
||||
#include "seqplayer.h"
|
||||
|
||||
#ifdef VERSION_JP
|
||||
#define US_FLOAT2(x) x##.0
|
||||
#else
|
||||
#define US_FLOAT2(x) x
|
||||
#endif
|
||||
|
||||
#ifdef VERSION_EU
|
||||
static void sequence_channel_process_sound(struct SequenceChannel *seqChannel, s32 recalculateVolume) {
|
||||
f32 channelVolume;
|
||||
s32 i;
|
||||
|
||||
if (seqChannel->changes.as_bitfields.volume || recalculateVolume) {
|
||||
channelVolume = seqChannel->volume * seqChannel->volumeScale *
|
||||
seqChannel->seqPlayer->appliedFadeVolume * seqChannel->seqPlayer->volumeScale;
|
||||
if (seqChannel->seqPlayer->muted && (seqChannel->muteBehavior & MUTE_BEHAVIOR_SOFTEN) != 0) {
|
||||
channelVolume = seqChannel->seqPlayer->muteVolumeScale * channelVolume;
|
||||
}
|
||||
seqChannel->appliedVolume = channelVolume;
|
||||
}
|
||||
|
||||
if (seqChannel->changes.as_bitfields.pan) {
|
||||
seqChannel->pan = seqChannel->newPan * seqChannel->panChannelWeight;
|
||||
}
|
||||
|
||||
for (i = 0; i < 4; ++i) {
|
||||
struct SequenceChannelLayer *layer = seqChannel->layers[i];
|
||||
if (layer != NULL && layer->enabled && layer->note != NULL) {
|
||||
if (layer->notePropertiesNeedInit) {
|
||||
layer->noteFreqScale = layer->freqScale * seqChannel->freqScale;
|
||||
layer->noteVelocity = layer->velocitySquare * seqChannel->appliedVolume;
|
||||
layer->notePan = (seqChannel->pan + layer->pan * (0x80 - seqChannel->panChannelWeight)) >> 7;
|
||||
layer->notePropertiesNeedInit = FALSE;
|
||||
} else {
|
||||
if (seqChannel->changes.as_bitfields.freqScale) {
|
||||
layer->noteFreqScale = layer->freqScale * seqChannel->freqScale;
|
||||
}
|
||||
if (seqChannel->changes.as_bitfields.volume || recalculateVolume) {
|
||||
layer->noteVelocity = layer->velocitySquare * seqChannel->appliedVolume;
|
||||
}
|
||||
if (seqChannel->changes.as_bitfields.pan) {
|
||||
layer->notePan = (seqChannel->pan + layer->pan * (0x80 - seqChannel->panChannelWeight)) >> 7;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
seqChannel->changes.as_u8 = 0;
|
||||
}
|
||||
#else
|
||||
static void sequence_channel_process_sound(struct SequenceChannel *seqChannel) {
|
||||
f32 channelVolume;
|
||||
f32 panLayerWeight;
|
||||
f32 panFromChannel;
|
||||
s32 i;
|
||||
|
||||
channelVolume = seqChannel->volume * seqChannel->volumeScale *
|
||||
seqChannel->seqPlayer->fadeVolume * seqChannel->seqPlayer->volumeScale;
|
||||
channelVolume = seqChannel->volume * seqChannel->volumeScale * seqChannel->seqPlayer->fadeVolume;
|
||||
if (seqChannel->seqPlayer->muted && (seqChannel->muteBehavior & MUTE_BEHAVIOR_SOFTEN) != 0) {
|
||||
channelVolume *= seqChannel->seqPlayer->muteVolumeScale;
|
||||
}
|
||||
|
@ -77,16 +30,12 @@ static void sequence_channel_process_sound(struct SequenceChannel *seqChannel) {
|
|||
}
|
||||
}
|
||||
}
|
||||
#endif
|
||||
|
||||
void sequence_player_process_sound(struct SequencePlayer *seqPlayer) {
|
||||
s32 i;
|
||||
|
||||
if (seqPlayer->fadeTimer != 0) {
|
||||
if (seqPlayer->fadeRemainingFrames != 0) {
|
||||
seqPlayer->fadeVolume += seqPlayer->fadeVelocity;
|
||||
#ifdef VERSION_EU
|
||||
seqPlayer->recalculateVolume = TRUE;
|
||||
#endif
|
||||
|
||||
if (seqPlayer->fadeVolume > US_FLOAT2(1)) {
|
||||
seqPlayer->fadeVolume = US_FLOAT2(1);
|
||||
|
@ -95,13 +44,7 @@ void sequence_player_process_sound(struct SequencePlayer *seqPlayer) {
|
|||
seqPlayer->fadeVolume = 0;
|
||||
}
|
||||
|
||||
if (--seqPlayer->fadeTimer == 0) {
|
||||
#ifdef VERSION_EU
|
||||
if (seqPlayer->state == 2) {
|
||||
sequence_player_disable(seqPlayer);
|
||||
return;
|
||||
}
|
||||
#else
|
||||
if (--seqPlayer->fadeRemainingFrames == 0) {
|
||||
switch (seqPlayer->state) {
|
||||
case SEQUENCE_PLAYER_STATE_FADE_OUT:
|
||||
sequence_player_disable(seqPlayer);
|
||||
|
@ -115,70 +58,32 @@ void sequence_player_process_sound(struct SequencePlayer *seqPlayer) {
|
|||
case SEQUENCE_PLAYER_STATE_4:
|
||||
break;
|
||||
}
|
||||
#endif
|
||||
}
|
||||
}
|
||||
|
||||
#ifdef VERSION_EU
|
||||
if (seqPlayer->recalculateVolume) {
|
||||
seqPlayer->appliedFadeVolume = seqPlayer->fadeVolume * seqPlayer->fadeVolumeScale;
|
||||
}
|
||||
#endif
|
||||
|
||||
// Process channels
|
||||
for (i = 0; i < CHANNELS_MAX; i++) {
|
||||
if (IS_SEQUENCE_CHANNEL_VALID(seqPlayer->channels[i]) == TRUE
|
||||
&& seqPlayer->channels[i]->enabled == TRUE) {
|
||||
#ifdef VERSION_EU
|
||||
sequence_channel_process_sound(seqPlayer->channels[i], seqPlayer->recalculateVolume);
|
||||
#else
|
||||
sequence_channel_process_sound(seqPlayer->channels[i]);
|
||||
#endif
|
||||
}
|
||||
}
|
||||
|
||||
#ifdef VERSION_EU
|
||||
seqPlayer->recalculateVolume = FALSE;
|
||||
#endif
|
||||
}
|
||||
|
||||
f32 get_portamento_freq_scale(struct Portamento *p) {
|
||||
u32 v0;
|
||||
f32 result;
|
||||
#ifndef VERSION_EU
|
||||
if (p->mode == 0) {
|
||||
return 1.0f;
|
||||
}
|
||||
#endif
|
||||
|
||||
p->cur += p->speed;
|
||||
v0 = (u32) p->cur;
|
||||
|
||||
#ifdef VERSION_EU
|
||||
if (v0 > 127)
|
||||
#else
|
||||
if (v0 >= 127)
|
||||
#endif
|
||||
{
|
||||
v0 = 127;
|
||||
}
|
||||
if (v0 >= 127) v0 = 127;
|
||||
|
||||
#ifdef VERSION_EU
|
||||
result = US_FLOAT(1.0) + p->extent * (gPitchBendFrequencyScale[v0 + 128] - US_FLOAT(1.0));
|
||||
#else
|
||||
result = US_FLOAT(1.0) + p->extent * (gPitchBendFrequencyScale[v0 + 127] - US_FLOAT(1.0));
|
||||
#endif
|
||||
return result;
|
||||
return US_FLOAT(1.0) + p->extent * (gPitchBendFrequencyScale[v0 + 127] - US_FLOAT(1.0));
|
||||
}
|
||||
|
||||
#ifdef VERSION_EU
|
||||
s16 get_vibrato_pitch_change(struct VibratoState *vib) {
|
||||
s32 index;
|
||||
vib->time += (s32) vib->rate;
|
||||
index = (vib->time >> 10) & 0x3F;
|
||||
return vib->curve[index] >> 8;
|
||||
}
|
||||
#else
|
||||
s8 get_vibrato_pitch_change(struct VibratoState *vib) {
|
||||
s32 index;
|
||||
vib->time += vib->rate;
|
||||
|
@ -203,7 +108,6 @@ s8 get_vibrato_pitch_change(struct VibratoState *vib) {
|
|||
|
||||
return -vib->curve[index];
|
||||
}
|
||||
#endif
|
||||
|
||||
f32 get_vibrato_freq_scale(struct VibratoState *vib) {
|
||||
s32 pitchChange;
|
||||
|
@ -250,75 +154,38 @@ f32 get_vibrato_freq_scale(struct VibratoState *vib) {
|
|||
|
||||
pitchChange = get_vibrato_pitch_change(vib);
|
||||
extent = (f32) vib->extent / US_FLOAT(4096.0);
|
||||
|
||||
#ifdef VERSION_EU
|
||||
result = US_FLOAT(1.0) + extent * (gPitchBendFrequencyScale[pitchChange + 128] - US_FLOAT(1.0));
|
||||
#else
|
||||
result = US_FLOAT(1.0) + extent * (gPitchBendFrequencyScale[pitchChange + 127] - US_FLOAT(1.0));
|
||||
#endif
|
||||
return result;
|
||||
}
|
||||
|
||||
void note_vibrato_update(struct Note *note) {
|
||||
#ifdef VERSION_EU
|
||||
if (note->portamento.mode != 0) {
|
||||
note->portamentoFreqScale = get_portamento_freq_scale(¬e->portamento);
|
||||
}
|
||||
if (note->vibratoState.active && note->parentLayer != NO_LAYER) {
|
||||
note->vibratoFreqScale = get_vibrato_freq_scale(¬e->vibratoState);
|
||||
}
|
||||
#else
|
||||
if (note->vibratoState.active) {
|
||||
note->portamentoFreqScale = get_portamento_freq_scale(¬e->portamento);
|
||||
if (note->parentLayer != NO_LAYER) {
|
||||
note->vibratoFreqScale = get_vibrato_freq_scale(¬e->vibratoState);
|
||||
}
|
||||
}
|
||||
#endif
|
||||
}
|
||||
|
||||
void note_vibrato_init(struct Note *note) {
|
||||
struct VibratoState *vib;
|
||||
UNUSED struct SequenceChannel *seqChannel;
|
||||
#ifdef VERSION_EU
|
||||
struct NotePlaybackState *seqPlayerState = (struct NotePlaybackState *) ¬e->priority;
|
||||
#endif
|
||||
|
||||
note->vibratoFreqScale = 1.0f;
|
||||
note->portamentoFreqScale = 1.0f;
|
||||
|
||||
vib = ¬e->vibratoState;
|
||||
|
||||
#ifndef VERSION_EU
|
||||
if (note->parentLayer->seqChannel->vibratoExtentStart == 0
|
||||
&& note->parentLayer->seqChannel->vibratoExtentTarget == 0
|
||||
&& note->parentLayer->portamento.mode == 0) {
|
||||
vib->active = FALSE;
|
||||
return;
|
||||
}
|
||||
#endif
|
||||
|
||||
vib->active = TRUE;
|
||||
vib->time = 0;
|
||||
|
||||
#ifdef VERSION_EU
|
||||
vib->curve = gWaveSamples[2];
|
||||
vib->seqChannel = note->parentLayer->seqChannel;
|
||||
if ((vib->extentChangeTimer = vib->seqChannel->vibratoExtentChangeDelay) == 0) {
|
||||
vib->extent = FLOAT_CAST(vib->seqChannel->vibratoExtentTarget);
|
||||
} else {
|
||||
vib->extent = FLOAT_CAST(vib->seqChannel->vibratoExtentStart);
|
||||
}
|
||||
|
||||
if ((vib->rateChangeTimer = vib->seqChannel->vibratoRateChangeDelay) == 0) {
|
||||
vib->rate = FLOAT_CAST(vib->seqChannel->vibratoRateTarget);
|
||||
} else {
|
||||
vib->rate = FLOAT_CAST(vib->seqChannel->vibratoRateStart);
|
||||
}
|
||||
vib->delay = vib->seqChannel->vibratoDelay;
|
||||
|
||||
seqPlayerState->portamento = seqPlayerState->parentLayer->portamento;
|
||||
#else
|
||||
vib->curve = gVibratoCurve;
|
||||
vib->seqChannel = note->parentLayer->seqChannel;
|
||||
seqChannel = vib->seqChannel;
|
||||
|
@ -337,45 +204,27 @@ void note_vibrato_init(struct Note *note) {
|
|||
vib->delay = seqChannel->vibratoDelay;
|
||||
|
||||
note->portamento = note->parentLayer->portamento;
|
||||
#endif
|
||||
}
|
||||
|
||||
void adsr_init(struct AdsrState *adsr, struct AdsrEnvelope *envelope, UNUSED s16 *volOut) {
|
||||
adsr->action = 0;
|
||||
adsr->state = ADSR_STATE_DISABLED;
|
||||
#ifdef VERSION_EU
|
||||
adsr->delay = 0;
|
||||
adsr->envelope = envelope;
|
||||
adsr->current = 0.0f;
|
||||
#else
|
||||
adsr->initial = 0;
|
||||
adsr->delay = 0;
|
||||
adsr->velocity = 0;
|
||||
adsr->envelope = envelope;
|
||||
adsr->volOut = volOut;
|
||||
#endif
|
||||
}
|
||||
|
||||
#ifdef VERSION_EU
|
||||
f32 adsr_update(struct AdsrState *adsr) {
|
||||
#else
|
||||
s32 adsr_update(struct AdsrState *adsr) {
|
||||
#endif
|
||||
u8 action = adsr->action;
|
||||
#ifdef VERSION_EU
|
||||
u8 state = adsr->state;
|
||||
switch (state) {
|
||||
#else
|
||||
switch (adsr->state) {
|
||||
#endif
|
||||
case ADSR_STATE_DISABLED:
|
||||
return 0;
|
||||
|
||||
case ADSR_STATE_INITIAL: {
|
||||
#ifndef VERSION_EU
|
||||
adsr->current = adsr->initial;
|
||||
adsr->target = adsr->initial;
|
||||
#endif
|
||||
if (action & ADSR_ACTION_HANG) {
|
||||
adsr->state = ADSR_STATE_HANG;
|
||||
break;
|
||||
|
@ -385,14 +234,11 @@ s32 adsr_update(struct AdsrState *adsr) {
|
|||
|
||||
case ADSR_STATE_START_LOOP:
|
||||
adsr->envIndex = 0;
|
||||
#ifndef VERSION_EU
|
||||
adsr->currentHiRes = adsr->current << 0x10;
|
||||
#endif
|
||||
adsr->state = ADSR_STATE_LOOP;
|
||||
// fallthrough
|
||||
|
||||
case ADSR_STATE_LOOP:
|
||||
adsr->delay = BE_TO_HOST16(adsr->envelope[adsr->envIndex].delay);
|
||||
adsr->delay = BSWAP16(adsr->envelope[adsr->envIndex].delay);
|
||||
switch (adsr->delay) {
|
||||
case ADSR_DISABLE:
|
||||
adsr->state = ADSR_STATE_DISABLED;
|
||||
|
@ -401,24 +247,15 @@ s32 adsr_update(struct AdsrState *adsr) {
|
|||
adsr->state = ADSR_STATE_HANG;
|
||||
break;
|
||||
case ADSR_GOTO:
|
||||
adsr->envIndex = BE_TO_HOST16(adsr->envelope[adsr->envIndex].arg);
|
||||
adsr->envIndex = BSWAP16(adsr->envelope[adsr->envIndex].arg);
|
||||
break;
|
||||
case ADSR_RESTART:
|
||||
adsr->state = ADSR_STATE_INITIAL;
|
||||
break;
|
||||
|
||||
default:
|
||||
#ifdef VERSION_EU
|
||||
if (adsr->delay >= 4) {
|
||||
adsr->delay = adsr->delay * gAudioBufferParameters.updatesPerFrame / 4;
|
||||
}
|
||||
adsr->target = (f32) BE_TO_HOST16(adsr->envelope[adsr->envIndex].arg) / 32767.0;
|
||||
adsr->target = adsr->target * adsr->target;
|
||||
adsr->velocity = (adsr->target - adsr->current) / adsr->delay;
|
||||
#else
|
||||
adsr->target = BE_TO_HOST16(adsr->envelope[adsr->envIndex].arg);
|
||||
adsr->target = BSWAP16(adsr->envelope[adsr->envIndex].arg);
|
||||
adsr->velocity = ((adsr->target - adsr->current) << 0x10) / adsr->delay;
|
||||
#endif
|
||||
adsr->state = ADSR_STATE_FADE;
|
||||
adsr->envIndex++;
|
||||
break;
|
||||
|
@ -429,12 +266,8 @@ s32 adsr_update(struct AdsrState *adsr) {
|
|||
// fallthrough
|
||||
|
||||
case ADSR_STATE_FADE:
|
||||
#ifdef VERSION_EU
|
||||
adsr->current += adsr->velocity;
|
||||
#else
|
||||
adsr->currentHiRes += adsr->velocity;
|
||||
adsr->current = adsr->currentHiRes >> 0x10;
|
||||
#endif
|
||||
if (--adsr->delay <= 0) {
|
||||
adsr->state = ADSR_STATE_LOOP;
|
||||
}
|
||||
|
@ -446,34 +279,19 @@ s32 adsr_update(struct AdsrState *adsr) {
|
|||
case ADSR_STATE_DECAY:
|
||||
case ADSR_STATE_RELEASE: {
|
||||
adsr->current -= adsr->fadeOutVel;
|
||||
#ifdef VERSION_EU
|
||||
if (adsr->sustain != 0.0f && state == ADSR_STATE_DECAY) {
|
||||
#else
|
||||
if (adsr->sustain != 0 && adsr->state == ADSR_STATE_DECAY) {
|
||||
#endif
|
||||
if (adsr->current < adsr->sustain) {
|
||||
adsr->current = adsr->sustain;
|
||||
#ifdef VERSION_EU
|
||||
adsr->delay = 128;
|
||||
#else
|
||||
adsr->delay = adsr->sustain / 16;
|
||||
#endif
|
||||
adsr->state = ADSR_STATE_SUSTAIN;
|
||||
}
|
||||
break;
|
||||
}
|
||||
|
||||
#ifdef VERSION_EU
|
||||
if (adsr->current < 0) {
|
||||
adsr->current = 0.0f;
|
||||
adsr->state = ADSR_STATE_DISABLED;
|
||||
}
|
||||
#else
|
||||
if (adsr->current < 100) {
|
||||
adsr->current = 0;
|
||||
adsr->state = ADSR_STATE_DISABLED;
|
||||
}
|
||||
#endif
|
||||
break;
|
||||
}
|
||||
|
||||
|
@ -492,23 +310,9 @@ s32 adsr_update(struct AdsrState *adsr) {
|
|||
|
||||
if ((action & ADSR_ACTION_RELEASE)) {
|
||||
adsr->state = ADSR_STATE_RELEASE;
|
||||
#ifdef VERSION_EU
|
||||
adsr->action = action & ~ADSR_ACTION_RELEASE;
|
||||
#else
|
||||
adsr->action = action & ~(ADSR_ACTION_RELEASE | ADSR_ACTION_DECAY);
|
||||
#endif
|
||||
}
|
||||
|
||||
#ifdef VERSION_EU
|
||||
if (adsr->current < 0.0f) {
|
||||
return 0.0f;
|
||||
}
|
||||
if (adsr->current > 1.0f) {
|
||||
return 1.0f;
|
||||
}
|
||||
return adsr->current;
|
||||
#else
|
||||
*adsr->volOut = adsr->current;
|
||||
return 0;
|
||||
#endif
|
||||
}
|
||||
}
|
2025
src/audio/external.c
2025
src/audio/external.c
File diff suppressed because it is too large
Load Diff
|
@ -5,7 +5,7 @@
|
|||
|
||||
#include "types.h"
|
||||
|
||||
// Sequence arguments, passed to play_sequence. seqId may be bit-OR'ed with
|
||||
// Sequence arguments, passed to seq_player_play_sequence. seqId may be bit-OR'ed with
|
||||
// SEQ_VARIATION; this will load the same sequence, but set a variation
|
||||
// bit which may be read by the sequence script.
|
||||
#define SEQUENCE_ARGS(priority, seqId) ((priority << 8) | seqId)
|
||||
|
@ -14,32 +14,35 @@
|
|||
#define SOUND_MODE_MONO 3
|
||||
#define SOUND_MODE_HEADSET 1
|
||||
|
||||
#define SEQ_PLAYER_LEVEL 0
|
||||
#define SEQ_PLAYER_ENV 1
|
||||
#define SEQ_PLAYER_SFX 2
|
||||
#define SEQ_PLAYER_LEVEL 0 // Level background music
|
||||
#define SEQ_PLAYER_ENV 1 // Misc music like the puzzle jingle
|
||||
#define SEQ_PLAYER_SFX 2 // Sound effects
|
||||
|
||||
extern s32 gAudioErrorFlags;
|
||||
extern f32 gDefaultSoundArgs[3];
|
||||
extern f32 gGlobalSoundSource[3];
|
||||
|
||||
// defined in data.c, used by the game
|
||||
extern u32 gAudioRandom;
|
||||
|
||||
extern u8 gAudioSPTaskYieldBuffer[]; // ucode yield data ptr; only used in JP
|
||||
|
||||
struct SPTask *create_next_audio_frame_task(void);
|
||||
void play_sound(s32 soundBits, f32 *pos);
|
||||
void audio_signal_game_loop_tick(void);
|
||||
void sequence_player_fade_out(u8 player, u16 fadeTimer);
|
||||
void fade_volume_scale(u8 player, u8 targetScale, u16 fadeTimer);
|
||||
void func_8031FFB4(u8 player, u16 fadeTimer, u8 arg2);
|
||||
void sequence_player_unlower(u8 player, u16 fadeTimer);
|
||||
void set_sound_disabled(u8 disabled);
|
||||
void seq_player_fade_out(u8 player, u16 fadeDuration);
|
||||
void fade_volume_scale(u8 player, u8 targetScale, u16 fadeDuration);
|
||||
void seq_player_lower_volume(u8 player, u16 fadeDuration, u8 percentage);
|
||||
void seq_player_unlower_volume(u8 player, u16 fadeDuration);
|
||||
void set_audio_muted(u8 muted);
|
||||
void sound_init(void);
|
||||
void func_803205E8(u32 soundBits, f32 *vec);
|
||||
void func_803206F8(f32 *arg0);
|
||||
void func_80320890(void);
|
||||
void get_currently_playing_sound(u8 bank, u8 *numPlayingSounds, u8 *numSoundsInBank, u8 *soundId);
|
||||
void stop_sound(u32 soundBits, f32 *pos);
|
||||
void stop_sounds_from_source(f32 *pos);
|
||||
void stop_sounds_in_continuous_banks(void);
|
||||
void sound_banks_disable(u8 player, u16 bankMask);
|
||||
void sound_banks_enable(u8 player, u16 bankMask);
|
||||
void func_80320A4C(u8 bankIndex, u8 arg1);
|
||||
void set_sound_moving_speed(u8 bank, u8 speed);
|
||||
void play_dialog_sound(u8 dialogID);
|
||||
void set_sequence_player_volume(s32 player, f32 volume);
|
||||
void play_music(u8 player, u16 seqArgs, u16 fadeTimer);
|
||||
void stop_background_music(u16 seqId);
|
||||
void fadeout_background_music(u16 arg0, u16 fadeOut);
|
||||
|
@ -60,8 +63,4 @@ void audio_set_sound_mode(u8 arg0);
|
|||
|
||||
void audio_init(void); // in load.c
|
||||
|
||||
#ifdef VERSION_EU
|
||||
struct SPTask *unused_80321460(void);
|
||||
#endif
|
||||
|
||||
#endif // AUDIO_EXTERNAL_H
|
||||
#endif // AUDIO_EXTERNAL_H
|
|
@ -5,7 +5,7 @@
|
|||
|
||||
#include "types.h"
|
||||
|
||||
#ifdef VERSION_EU
|
||||
#if defined(VERSION_EU) || defined(VERSION_SH)
|
||||
#define SEQUENCE_PLAYERS 4
|
||||
#define SEQUENCE_CHANNELS 48
|
||||
#define SEQUENCE_LAYERS 64
|
||||
|
@ -41,28 +41,31 @@
|
|||
|
||||
#define TATUMS_PER_BEAT 48
|
||||
|
||||
#ifdef VERSION_JP
|
||||
#define TEMPO_SCALE 1
|
||||
#else
|
||||
#define TEMPO_SCALE TATUMS_PER_BEAT
|
||||
#endif
|
||||
|
||||
// TODO: US_FLOAT should probably be renamed to JP_DOUBLE since eu seems to use floats too
|
||||
#ifdef VERSION_JP
|
||||
#define US_FLOAT(x) x
|
||||
#else
|
||||
#define US_FLOAT(x) x ## f
|
||||
#endif
|
||||
|
||||
// Convert u8 or u16 to f32. On JP, this uses a u32->f32 conversion,
|
||||
// resulting in more bloated codegen, while on US it goes through s32.
|
||||
// Since u8 and u16 fit losslessly in both, behavior is the same.
|
||||
#ifdef VERSION_JP
|
||||
#define FLOAT_CAST(x) (f32) (x)
|
||||
#else
|
||||
#define FLOAT_CAST(x) (f32) (s32) (x)
|
||||
|
||||
// No-op printf macro which leaves string literals in rodata in IDO. IDO
|
||||
// doesn't support variadic macros, so instead we let the parameter list
|
||||
// expand to a no-op comma expression. Another possibility is that it might
|
||||
// have expanded to something with "if (0)". See also goddard/gd_main.h.
|
||||
// On US/JP, -sopt optimizes away these except for external.c.
|
||||
#ifdef __sgi
|
||||
#define stubbed_printf
|
||||
#else
|
||||
#define stubbed_printf(...)
|
||||
#endif
|
||||
|
||||
#define eu_stubbed_printf_0(msg)
|
||||
#define eu_stubbed_printf_1(msg, a)
|
||||
#define eu_stubbed_printf_2(msg, a, b)
|
||||
#define eu_stubbed_printf_3(msg, a, b, c)
|
||||
|
||||
struct NotePool;
|
||||
|
||||
struct AudioListItem
|
||||
|
@ -94,18 +97,10 @@ struct NotePool
|
|||
struct VibratoState {
|
||||
/*0x00, 0x00*/ struct SequenceChannel *seqChannel;
|
||||
/*0x04, 0x04*/ u32 time;
|
||||
#ifdef VERSION_EU
|
||||
/* , 0x08*/ s16 *curve;
|
||||
/* , 0x0C*/ f32 extent;
|
||||
/* , 0x10*/ f32 rate;
|
||||
/* , 0x14*/ u8 active;
|
||||
#endif
|
||||
#ifndef VERSION_EU
|
||||
/*0x08, */ s8 *curve;
|
||||
/*0x0C, */ u8 active;
|
||||
/*0x0E, */ u16 rate;
|
||||
/*0x10, */ u16 extent;
|
||||
#endif
|
||||
/*0x12, 0x16*/ u16 rateChangeTimer;
|
||||
/*0x14, 0x18*/ u16 extentChangeTimer;
|
||||
/*0x16, 0x1A*/ u16 delay;
|
||||
|
@ -143,8 +138,7 @@ struct AdpcmBook
|
|||
s16 book[1]; // size 8 * order * npredictors. 8-byte aligned
|
||||
};
|
||||
|
||||
struct AudioBankSample
|
||||
{
|
||||
struct AudioBankSample {
|
||||
u8 unused;
|
||||
u8 loaded;
|
||||
u8 *sampleAddr;
|
||||
|
@ -202,61 +196,37 @@ struct M64ScriptState {
|
|||
u8 depth;
|
||||
}; // size = 0x1C
|
||||
|
||||
// Also known as a Group, according to debug strings.
|
||||
struct SequencePlayer
|
||||
{
|
||||
/*US/JP, EU */
|
||||
#ifdef VERSION_EU
|
||||
/*0x000, 0x000*/ u8 enabled : 1;
|
||||
#else
|
||||
/*US/JP, EU, SH */
|
||||
/*0x000, 0x000*/ volatile u8 enabled : 1;
|
||||
#endif
|
||||
/*0x000, 0x000*/ u8 finished : 1; // never read
|
||||
/*0x000, 0x000*/ u8 muted : 1;
|
||||
/*0x000, 0x000*/ u8 seqDmaInProgress : 1;
|
||||
/*0x000, 0x000*/ u8 bankDmaInProgress : 1;
|
||||
#ifdef VERSION_EU
|
||||
/* 0x000*/ u8 recalculateVolume : 1;
|
||||
#endif
|
||||
#ifndef VERSION_EU
|
||||
/*0x001 */ s8 seqVariation;
|
||||
#endif
|
||||
/*0x002, 0x001*/ u8 state;
|
||||
/*0x002, 0x001, 0x001*/ u8 state;
|
||||
/*0x003, 0x002*/ u8 noteAllocPolicy;
|
||||
/*0x004, 0x003*/ u8 muteBehavior;
|
||||
/*0x005, 0x004*/ u8 seqId;
|
||||
/*0x006, 0x005*/ u8 defaultBank[1]; // must be an array to get a comparison
|
||||
// to match; other u8's might also be part of that array
|
||||
/*0x007, 0x006*/ u8 loadingBankId;
|
||||
#ifndef VERSION_EU
|
||||
/*0x008, ?????*/ u8 loadingBankNumInstruments;
|
||||
/*0x009, ?????*/ u8 loadingBankNumDrums;
|
||||
#endif
|
||||
#ifdef VERSION_EU
|
||||
/* , 0x007*/ s8 seqVariationEu[1];
|
||||
#endif
|
||||
/*0x00A, 0x008*/ u16 tempo; // beats per minute in JP, tatums per minute in US/EU
|
||||
/*0x00C, 0x00A*/ u16 tempoAcc;
|
||||
#ifndef VERSION_EU
|
||||
/*0x00E, 0x010*/ u16 fadeTimer;
|
||||
#endif
|
||||
/*0x010, 0x00C*/ s16 transposition;
|
||||
/*0x012, 0x00E*/ u16 delay;
|
||||
#ifdef VERSION_EU
|
||||
/*0x00E, 0x010*/ u16 fadeTimer;
|
||||
/* , 0x012*/ u16 fadeTimerUnkEu;
|
||||
#endif
|
||||
/*0x00E, 0x010*/ u16 fadeRemainingFrames;
|
||||
/*0x010, 0x00C, 0x00E*/ s16 transposition;
|
||||
/*0x012, 0x00E, 0x010*/ u16 delay;
|
||||
/*0x014, 0x014*/ u8 *seqData; // buffer of some sort
|
||||
/*0x018, 0x018*/ f32 fadeVolume; // set to 1.0f
|
||||
/*0x018, 0x018, 0x1C*/ f32 fadeVolume; // set to 1.0f
|
||||
/*0x01C, 0x01C*/ f32 fadeVelocity; // set to 0.0f
|
||||
/*0x020, 0x020*/ f32 volume; // set to 0.0f
|
||||
/*0x020, 0x020, 0x024*/ f32 volume; // set to 0.0f
|
||||
/*0x024, 0x024*/ f32 muteVolumeScale; // set to 0.5f
|
||||
#ifdef VERSION_EU
|
||||
/* , 0x028*/ f32 fadeVolumeScale;
|
||||
/* , 0x02C*/ f32 appliedFadeVolume;
|
||||
#else
|
||||
/* */ u8 pad2[4];
|
||||
#endif
|
||||
/*0x02C, 0x030*/ struct SequenceChannel *channels[CHANNELS_MAX];
|
||||
/*0x02C, 0x030, 0x034*/ struct SequenceChannel *channels[CHANNELS_MAX];
|
||||
/*0x06C, 0x070*/ struct M64ScriptState scriptState;
|
||||
/*0x088, 0x08C*/ u8 *shortNoteVelocityTable;
|
||||
/*0x08C, 0x090*/ u8 *shortNoteDurationTable;
|
||||
|
@ -268,68 +238,70 @@ struct SequencePlayer
|
|||
/*0x118, 0x120*/ OSMesg bankDmaMesg;
|
||||
/*0x11C, 0x124*/ OSIoMesg bankDmaIoMesg;
|
||||
/*0x130, 0x13C*/ u8 *bankDmaCurrMemAddr;
|
||||
#ifndef VERSION_EU
|
||||
/*0x134, ?????*/ struct AudioBank *loadingBank;
|
||||
#endif
|
||||
/*0x138, 0x140*/ uintptr_t bankDmaCurrDevAddr;
|
||||
/*0x13C, 0x144*/ ssize_t bankDmaRemaining;
|
||||
/* ext */ f32 volumeScale;
|
||||
}; // size = 0x140, 0x148 on EU
|
||||
}; // size = 0x140, 0x148 on EU, 0x14C on SH
|
||||
|
||||
struct AdsrSettings
|
||||
{
|
||||
struct AdsrSettings {
|
||||
u8 releaseRate;
|
||||
#ifdef VERSION_EU
|
||||
u8 sustain;
|
||||
#else
|
||||
u16 sustain; // sustain level, 2^16 = max
|
||||
#endif
|
||||
struct AdsrEnvelope *envelope;
|
||||
}; // size = 0x8
|
||||
|
||||
struct AdsrState {
|
||||
/*0x00, 0x00*/ u8 action;
|
||||
/*0x01, 0x01*/ u8 state;
|
||||
#ifndef VERSION_EU
|
||||
/*0x02, */ s16 initial; // always 0
|
||||
/*0x04, */ s16 target;
|
||||
/*0x06, */ s16 current;
|
||||
#endif
|
||||
/*0x08, 0x02*/ s16 envIndex;
|
||||
/*0x0A, 0x04*/ s16 delay;
|
||||
#ifdef VERSION_EU
|
||||
/* , 0x08*/ f32 sustain;
|
||||
/* , 0x0C*/ f32 velocity;
|
||||
/* , 0x10*/ f32 fadeOutVel;
|
||||
/* , 0x14*/ f32 current;
|
||||
/* , 0x18*/ f32 target;
|
||||
s32 pad1C;
|
||||
#else
|
||||
/*0x0C, */ s16 sustain;
|
||||
/*0x0E, */ s16 fadeOutVel;
|
||||
/*0x10, */ s32 velocity;
|
||||
/*0x14, */ s32 currentHiRes;
|
||||
/*0x18, */ s16 *volOut;
|
||||
#endif
|
||||
/*0x1C, 0x20*/ struct AdsrEnvelope *envelope;
|
||||
}; // size = 0x20, 0x24 in EU
|
||||
|
||||
struct NoteAttributes
|
||||
{
|
||||
s8 reverb;
|
||||
#ifdef VERSION_EU
|
||||
struct ReverbBitsData {
|
||||
/* 0x00 */ u8 bit0 : 1;
|
||||
/* 0x00 */ u8 bit1 : 1;
|
||||
/* 0x00 */ u8 bit2 : 1;
|
||||
/* 0x00 */ u8 usesHeadsetPanEffects : 1;
|
||||
/* 0x00 */ u8 stereoHeadsetEffects : 2;
|
||||
/* 0x00 */ u8 strongRight : 1;
|
||||
/* 0x00 */ u8 strongLeft : 1;
|
||||
};
|
||||
|
||||
union ReverbBits {
|
||||
/* 0x00 */ struct ReverbBitsData s;
|
||||
/* 0x00 */ u8 asByte;
|
||||
};
|
||||
struct ReverbInfo {
|
||||
u8 reverb;
|
||||
u8 bankId;
|
||||
u8 pan;
|
||||
#endif
|
||||
union ReverbBits reverbBits;
|
||||
f32 freqScale;
|
||||
f32 velocity;
|
||||
s32 unused;
|
||||
s16 *filter;
|
||||
};
|
||||
|
||||
struct NoteAttributes
|
||||
{
|
||||
u8 reverb;
|
||||
f32 freqScale;
|
||||
f32 velocity;
|
||||
#ifndef VERSION_EU
|
||||
f32 pan;
|
||||
#endif
|
||||
}; // size = 0x10
|
||||
|
||||
struct SequenceChannel
|
||||
{
|
||||
/* U/J, EU */
|
||||
// Also known as a SubTrack, according to debug strings.
|
||||
// Confusingly, a SubTrack is a container of Tracks.
|
||||
struct SequenceChannel {
|
||||
/* U/J, EU, SH */
|
||||
/*0x00, 0x00*/ u8 enabled : 1;
|
||||
/*0x00, 0x00*/ u8 finished : 1;
|
||||
/*0x00, 0x00*/ u8 stopScript : 1;
|
||||
|
@ -338,49 +310,28 @@ struct SequenceChannel
|
|||
/*0x00, 0x00*/ u8 stereoHeadsetEffects : 1;
|
||||
/*0x00, ????*/ u8 largeNotes : 1; // notes specify duration and velocity
|
||||
/*0x00, ????*/ u8 unused : 1; // never read, set to 0
|
||||
#ifdef VERSION_EU
|
||||
/* , 0x01*/ union {
|
||||
struct {
|
||||
u8 freqScale : 1;
|
||||
u8 volume : 1;
|
||||
u8 pan : 1;
|
||||
} as_bitfields;
|
||||
u8 as_u8;
|
||||
} changes;
|
||||
#endif
|
||||
/*0x01, 0x02*/ u8 noteAllocPolicy;
|
||||
/*0x02, 0x03*/ u8 muteBehavior;
|
||||
/*0x03, 0x04*/ u8 reverb; // or dry/wet mix
|
||||
/*0x02, 0x03, 0x03*/ u8 muteBehavior;
|
||||
/*0x03, 0x04, 0x04*/ u8 reverb; // or dry/wet mix
|
||||
/*0x04, ????*/ u8 notePriority; // 0-3
|
||||
/*0x05, 0x06*/ u8 bankId;
|
||||
#ifdef VERSION_EU
|
||||
/* , 0x07*/ u8 reverbIndex;
|
||||
/* , 0x08*/ u8 bookOffset;
|
||||
/* , 0x09*/ u8 newPan;
|
||||
/* , 0x0A*/ u8 panChannelWeight; // proportion of pan that comes from the channel (0..128)
|
||||
#else
|
||||
/*0x06, */ u8 updatesPerFrameUnused;
|
||||
#endif
|
||||
/*0x08, 0x0C*/ u16 vibratoRateStart; // initially 0x800
|
||||
/*0x0A, 0x0E*/ u16 vibratoExtentStart;
|
||||
/*0x0C, 0x10*/ u16 vibratoRateTarget; // initially 0x800
|
||||
/*0x0E, 0x12*/ u16 vibratoExtentTarget;
|
||||
/*0x10, 0x14*/ u16 vibratoRateChangeDelay;
|
||||
/*0x12, 0x16*/ u16 vibratoExtentChangeDelay;
|
||||
/*0x14, 0x18*/ u16 vibratoDelay;
|
||||
/*0x16, 0x1A*/ u16 delay;
|
||||
/*0x18, 0x1C*/ s16 instOrWave; // either 0 (none), instrument index + 1, or
|
||||
/*0x08, 0x0C, 0x0E*/ u16 vibratoRateStart; // initially 0x800
|
||||
/*0x0A, 0x0E, 0x10*/ u16 vibratoExtentStart;
|
||||
/*0x0C, 0x10, 0x12*/ u16 vibratoRateTarget; // initially 0x800
|
||||
/*0x0E, 0x12, 0x14*/ u16 vibratoExtentTarget;
|
||||
/*0x10, 0x14, 0x16*/ u16 vibratoRateChangeDelay;
|
||||
/*0x12, 0x16, 0x18*/ u16 vibratoExtentChangeDelay;
|
||||
/*0x14, 0x18, 0x1A*/ u16 vibratoDelay;
|
||||
/*0x16, 0x1A, 0x1C*/ u16 delay;
|
||||
/*0x18, 0x1C, 0x1E*/ s16 instOrWave; // either 0 (none), instrument index + 1, or
|
||||
// 0x80..0x83 for sawtooth/triangle/sine/square waves.
|
||||
/*0x1A, 0x1E*/ s16 transposition;
|
||||
/*0x1C, 0x20*/ f32 volumeScale;
|
||||
/*0x20, 0x24*/ f32 volume;
|
||||
#ifndef VERSION_EU
|
||||
/*0x1A, 0x1E, 0x20*/ s16 transposition;
|
||||
/*0x1C, 0x20, 0x24*/ f32 volumeScale;
|
||||
/*0x20, 0x24, 0x28*/ f32 volume;
|
||||
/*0x24, */ f32 pan;
|
||||
/*0x28, */ f32 panChannelWeight; // proportion of pan that comes from the channel (0..1)
|
||||
#else
|
||||
/* , 0x28*/ s32 pan;
|
||||
/* , 0x2C*/ f32 appliedVolume;
|
||||
#endif
|
||||
/*0x2C, 0x30*/ f32 freqScale;
|
||||
/*0x30, 0x34*/ u8 (*dynTable)[][2];
|
||||
/*0x34, ????*/ struct Note *noteUnused; // never read
|
||||
|
@ -388,143 +339,49 @@ struct SequenceChannel
|
|||
/*0x3C, 0x40*/ struct Instrument *instrument;
|
||||
/*0x40, 0x44*/ struct SequencePlayer *seqPlayer;
|
||||
/*0x44, 0x48*/ struct SequenceChannelLayer *layers[LAYERS_MAX];
|
||||
/*0x54, 0x58*/ s8 soundScriptIO[8]; // bridge between sound script and audio lib. For player 2,
|
||||
/*0x54, 0x58 */ s8 soundScriptIO[8]; // bridge between sound script and audio lib. For player 2,
|
||||
// [0] contains enabled, [4] contains sound ID, [5] contains reverb adjustment
|
||||
/*0x5C, 0x60*/ struct M64ScriptState scriptState;
|
||||
/*0x78, 0x7C*/ struct AdsrSettings adsr;
|
||||
/*0x80, 0x84*/ struct NotePool notePool;
|
||||
}; // size = 0xC0, 0xC4 in EU
|
||||
}; // size = 0xC0, 0xC4 in EU, 0xD0 in SH
|
||||
|
||||
struct SequenceChannelLayer // Maybe SequenceTrack?
|
||||
// Also known as a Track, according to debug strings.
|
||||
struct SequenceChannelLayer
|
||||
{
|
||||
/* U/J, EU */
|
||||
/* U/J, EU, SH */
|
||||
/*0x00, 0x00*/ u8 enabled : 1;
|
||||
/*0x00, 0x00*/ u8 finished : 1;
|
||||
/*0x00, 0x00*/ u8 stopSomething : 1; // ?
|
||||
/*0x00, 0x00*/ u8 continuousNotes : 1; // keep the same note for consecutive notes with the same sound
|
||||
#ifdef VERSION_EU
|
||||
/* , 0x00*/ u8 unusedEu0b8 : 1;
|
||||
/* , 0x00*/ u8 notePropertiesNeedInit : 1;
|
||||
/* , 0x00*/ u8 ignoreDrumPan : 1;
|
||||
/* , 0x01*/ u8 instOrWave;
|
||||
#endif
|
||||
/*0x01, 0x02*/ u8 status;
|
||||
/*0x01, 0x02, 0x03*/ u8 status; // 0x03 in SH
|
||||
/*0x02, 0x03*/ u8 noteDuration; // set to 0x80
|
||||
/*0x03, 0x04*/ u8 portamentoTargetNote;
|
||||
#ifdef VERSION_EU
|
||||
/* , 0x05*/ u8 pan; // 0..128
|
||||
/* , 0x06*/ u8 notePan;
|
||||
#endif
|
||||
/*0x04, 0x08*/ struct Portamento portamento;
|
||||
/*0x14, 0x18*/ struct AdsrSettings adsr;
|
||||
/*0x1C, 0x20*/ u16 portamentoTime;
|
||||
/*0x1E, 0x22*/ s16 transposition; // #semitones added to play commands
|
||||
// (m64 instruction encoding only allows referring to the limited range
|
||||
// 0..0x3f; this makes 0x40..0x7f accessible as well)
|
||||
/*0x20, 0x24*/ f32 freqScale;
|
||||
/*0x24, 0x28*/ f32 velocitySquare;
|
||||
#ifndef VERSION_EU
|
||||
/*0x20, 0x24, 0x24*/ f32 freqScale;
|
||||
/*0x24, 0x28, 0x2C*/ f32 velocitySquare;
|
||||
/*0x28, */ f32 pan; // 0..1
|
||||
#endif
|
||||
/*0x2C, 0x2C*/ f32 noteVelocity;
|
||||
#ifndef VERSION_EU
|
||||
/*0x2C, 0x2C, 0x30*/ f32 noteVelocity;
|
||||
/*0x30*/ f32 notePan;
|
||||
#endif
|
||||
/*0x34, 0x30*/ f32 noteFreqScale;
|
||||
/*0x34, 0x30, 0x34*/ f32 noteFreqScale;
|
||||
/*0x38, 0x34*/ s16 shortNoteDefaultPlayPercentage;
|
||||
/*0x3A, 0x36*/ s16 playPercentage; // it's not really a percentage...
|
||||
/*0x3C, 0x38*/ s16 delay;
|
||||
/*0x3E, 0x3A*/ s16 duration;
|
||||
/*0x40, 0x3C*/ s16 delayUnused; // set to 'delay', never read
|
||||
/*0x44, 0x40*/ struct Note *note;
|
||||
/*0x44, 0x40, 0x44*/ struct Note *note;
|
||||
/*0x48, 0x44*/ struct Instrument *instrument;
|
||||
/*0x4C, 0x48*/ struct AudioBankSound *sound;
|
||||
/*0x50, 0x4C*/ struct SequenceChannel *seqChannel;
|
||||
/*0x50, 0x4C, 0x50*/ struct SequenceChannel *seqChannel;
|
||||
/*0x54, 0x50*/ struct M64ScriptState scriptState;
|
||||
/*0x70, 0x6C*/ struct AudioListItem listItem;
|
||||
#ifdef VERSION_EU
|
||||
u8 pad2[4];
|
||||
#endif
|
||||
}; // size = 0x80
|
||||
|
||||
#ifdef VERSION_EU
|
||||
struct NoteSynthesisState
|
||||
{
|
||||
/*0x00*/ u8 restart;
|
||||
/*0x01*/ u8 sampleDmaIndex;
|
||||
/*0x02*/ u8 prevHeadsetPanRight;
|
||||
/*0x03*/ u8 prevHeadsetPanLeft;
|
||||
/*0x04*/ u16 samplePosFrac;
|
||||
/*0x08*/ s32 samplePosInt;
|
||||
/*0x0C*/ struct NoteSynthesisBuffers *synthesisBuffers;
|
||||
/*0x10*/ s16 curVolLeft;
|
||||
/*0x12*/ s16 curVolRight;
|
||||
};
|
||||
struct NotePlaybackState
|
||||
{
|
||||
/* U/J, EU */
|
||||
/*0x04, 0x00*/ u8 priority;
|
||||
/* 0x01*/ u8 waveId;
|
||||
/* 0x02*/ u8 sampleCountIndex;
|
||||
/*0x08, 0x04*/ s16 adsrVolScale;
|
||||
/*0x18, 0x08*/ f32 portamentoFreqScale;
|
||||
/*0x1C, 0x0C*/ f32 vibratoFreqScale;
|
||||
/*0x28, 0x10*/ struct SequenceChannelLayer *prevParentLayer;
|
||||
/*0x2C, 0x14*/ struct SequenceChannelLayer *parentLayer;
|
||||
/*0x30, 0x18*/ struct SequenceChannelLayer *wantedParentLayer;
|
||||
/* , 0x1C*/ struct NoteAttributes attributes;
|
||||
/*0x54, 0x28*/ struct AdsrState adsr;
|
||||
/*0x74, 0x4C*/ struct Portamento portamento;
|
||||
/*0x84, 0x5C*/ struct VibratoState vibratoState;
|
||||
};
|
||||
struct NoteSubEu
|
||||
{
|
||||
/*0x00*/ volatile u8 enabled : 1;
|
||||
/*0x00*/ u8 needsInit : 1;
|
||||
/*0x00*/ u8 finished : 1;
|
||||
/*0x00*/ u8 envMixerNeedsInit : 1;
|
||||
/*0x00*/ u8 stereoStrongRight : 1;
|
||||
/*0x00*/ u8 stereoStrongLeft : 1;
|
||||
/*0x00*/ u8 stereoHeadsetEffects : 1;
|
||||
/*0x00*/ u8 usesHeadsetPanEffects : 1;
|
||||
/*0x01*/ u8 reverbIndex : 3;
|
||||
/*0x01*/ u8 bookOffset : 3;
|
||||
/*0x01*/ u8 isSyntheticWave : 1;
|
||||
/*0x01*/ u8 hasTwoAdpcmParts : 1;
|
||||
/*0x02*/ u8 bankId;
|
||||
/*0x03*/ u8 headsetPanRight;
|
||||
/*0x04*/ u8 headsetPanLeft;
|
||||
/*0x05*/ u8 reverbVol;
|
||||
/*0x06*/ u16 targetVolLeft;
|
||||
/*0x08*/ u16 targetVolRight;
|
||||
/*0x0A*/ u16 resamplingRateFixedPoint; // stored as signed but loaded as u16
|
||||
/*0x0C*/ union {
|
||||
s16 *samples;
|
||||
struct AudioBankSound *audioBankSound;
|
||||
} sound;
|
||||
};
|
||||
struct Note
|
||||
{
|
||||
/* U/J, EU */
|
||||
/*0xA4, 0x00*/ struct AudioListItem listItem;
|
||||
/* 0x10*/ struct NoteSynthesisState synthesisState;
|
||||
/*0x04, 0x30*/ u8 priority;
|
||||
/* 0x31*/ u8 waveId;
|
||||
/* 0x32*/ u8 sampleCountIndex;
|
||||
/*0x08, 0x34*/ s16 adsrVolScale;
|
||||
/*0x18, 0x38*/ f32 portamentoFreqScale;
|
||||
/*0x1C, 0x3C*/ f32 vibratoFreqScale;
|
||||
/*0x28, 0x40*/ struct SequenceChannelLayer *prevParentLayer;
|
||||
/*0x2C, 0x44*/ struct SequenceChannelLayer *parentLayer;
|
||||
/*0x30, 0x48*/ struct SequenceChannelLayer *wantedParentLayer;
|
||||
/* , 0x4C*/ struct NoteAttributes attributes;
|
||||
/*0x54, 0x58*/ struct AdsrState adsr;
|
||||
/*0x74, 0x7C*/ struct Portamento portamento;
|
||||
/*0x84, 0x8C*/ struct VibratoState vibratoState;
|
||||
u8 pad3[8];
|
||||
/* , 0xB0*/ struct NoteSubEu noteSubEu;
|
||||
}; // size = 0xC0
|
||||
#else
|
||||
// volatile Note, needed in synthesis_process_notes
|
||||
struct vNote
|
||||
{
|
||||
/* U/J, EU */
|
||||
|
@ -580,46 +437,45 @@ struct Note
|
|||
/*0xA4, 0x00*/ struct AudioListItem listItem;
|
||||
/* */ u8 pad2[0xc];
|
||||
}; // size = 0xC0
|
||||
#endif
|
||||
|
||||
struct NoteSynthesisBuffers
|
||||
{
|
||||
struct NoteSynthesisBuffers {
|
||||
s16 adpcmdecState[0x10];
|
||||
s16 finalResampleState[0x10];
|
||||
s16 mixEnvelopeState[0x28];
|
||||
s16 panResampleState[0x10];
|
||||
s16 panSamplesBuffer[0x20];
|
||||
s16 dummyResampleState[0x10];
|
||||
#ifndef VERSION_EU
|
||||
s16 samples[0x40];
|
||||
#endif
|
||||
};
|
||||
|
||||
struct ReverbSettingsEU
|
||||
{
|
||||
u8 downsampleRate;
|
||||
u8 windowSize; // To be multiplied by 64
|
||||
u8 downsampleRate; // always 1
|
||||
u8 windowSize; // To be multiplied by 16
|
||||
u16 gain;
|
||||
u16 unk4; // always zero
|
||||
u16 unk6; // always zero
|
||||
s8 unk8; // always -1
|
||||
u16 unkA; // always 0x3000
|
||||
s16 unkC; // always zero
|
||||
s16 unkE; // always zero
|
||||
};
|
||||
|
||||
struct AudioSessionSettingsEU
|
||||
{
|
||||
u32 frequency;
|
||||
u8 unk1; // always 1
|
||||
u8 maxSimultaneousNotes;
|
||||
u8 numReverbs; // always 1
|
||||
u8 unk2; // always 0
|
||||
struct ReverbSettingsEU *reverbSettings;
|
||||
u16 volume;
|
||||
u16 unk3; // always 0
|
||||
u32 persistentSeqMem;
|
||||
u32 persistentBankMem;
|
||||
u32 temporarySeqMem;
|
||||
u32 temporaryBankMem;
|
||||
struct AudioSessionSettingsEU {
|
||||
/* 0x00 */ u32 frequency;
|
||||
/* 0x04 */ u8 unk1; // always 1
|
||||
/* 0x05 */ u8 maxSimultaneousNotes;
|
||||
/* 0x06 */ u8 numReverbs; // always 1
|
||||
/* 0x07 */ u8 unk2; // always 0
|
||||
/* 0x08 */ struct ReverbSettingsEU *reverbSettings;
|
||||
/* 0x0C */ u16 volume;
|
||||
/* 0x0E */ u16 unk3; // always 0
|
||||
/* 0x10 */ u32 persistentSeqMem;
|
||||
/* 0x14 */ u32 persistentBankMem;
|
||||
/* 0x18, 0x1C */ u32 temporarySeqMem;
|
||||
/* 0x1C, 0x20 */ u32 temporaryBankMem;
|
||||
};
|
||||
|
||||
struct AudioSessionSettings
|
||||
{
|
||||
struct AudioSessionSettings {
|
||||
/*0x00*/ u32 frequency;
|
||||
/*0x04*/ u8 maxSimultaneousNotes;
|
||||
/*0x05*/ u8 reverbDownsampleRate; // always 1
|
||||
|
@ -686,5 +542,4 @@ struct EuAudioCmd {
|
|||
#endif
|
||||
} u2;
|
||||
};
|
||||
|
||||
#endif // AUDIO_INTERNAL_H
|
||||
#endif // AUDIO_INTERNAL_H
|
|
@ -24,7 +24,7 @@ extern OSMesgQueue *OSMesgQueues[];
|
|||
extern struct EuAudioCmd sAudioCmd[0x100];
|
||||
|
||||
void func_8031D690(s32 player, FadeT fadeInTime);
|
||||
void sequence_player_fade_out_internal(s32 player, FadeT fadeOutTime);
|
||||
void seq_player_fade_out_internal(s32 player, FadeT fadeOutTime);
|
||||
void port_eu_init_queues(void);
|
||||
void decrease_sample_dma_ttls(void);
|
||||
s32 audio_shut_down_and_reset_step(void);
|
||||
|
@ -76,7 +76,7 @@ void eu_process_audio_cmd(struct EuAudioCmd *cmd) {
|
|||
sequence_player_disable(&gSequencePlayers[cmd->u.s.arg1]);
|
||||
}
|
||||
else {
|
||||
sequence_player_fade_out_internal(cmd->u.s.arg1, cmd->u2.as_s32);
|
||||
seq_player_fade_out_internal(cmd->u.s.arg1, cmd->u2.as_s32);
|
||||
}
|
||||
}
|
||||
break;
|
||||
|
@ -111,7 +111,7 @@ extern OSMesg OSMesg1;
|
|||
extern OSMesg OSMesg2;
|
||||
extern OSMesg OSMesg3;
|
||||
|
||||
void sequence_player_fade_out_internal(s32 player, FadeT fadeOutTime) {
|
||||
void seq_player_fade_out_internal(s32 player, FadeT fadeOutTime) {
|
||||
if (fadeOutTime == 0) {
|
||||
fadeOutTime = 1;
|
||||
}
|
||||
|
|
|
@ -1829,10 +1829,10 @@ void sequence_player_process_sequence(struct SequencePlayer *seqPlayer) {
|
|||
temp = m64_read_u8(state);
|
||||
switch (seqPlayer->state) {
|
||||
case SEQUENCE_PLAYER_STATE_2:
|
||||
if (seqPlayer->fadeTimer != 0) {
|
||||
if (seqPlayer->fadeRemainingFrames != 0) {
|
||||
f32 targetVolume = FLOAT_CAST(temp) / US_FLOAT(127.0);
|
||||
seqPlayer->fadeVelocity = (targetVolume - seqPlayer->fadeVolume)
|
||||
/ FLOAT_CAST(seqPlayer->fadeTimer);
|
||||
/ FLOAT_CAST(seqPlayer->fadeRemainingFrames);
|
||||
break;
|
||||
}
|
||||
// fallthrough
|
||||
|
@ -2017,7 +2017,7 @@ void init_sequence_player(u32 player) {
|
|||
#else
|
||||
seqPlayer->state = SEQUENCE_PLAYER_STATE_0;
|
||||
#endif
|
||||
seqPlayer->fadeTimer = 0;
|
||||
seqPlayer->fadeRemainingFrames = 0;
|
||||
#ifdef VERSION_EU
|
||||
seqPlayer->fadeTimerUnkEu = 0;
|
||||
#endif
|
||||
|
@ -2083,7 +2083,7 @@ void init_sequence_players(void) {
|
|||
gSequencePlayers[i].seqDmaInProgress = FALSE;
|
||||
|
||||
// only set this once at the start so it doesn't spike later
|
||||
gSequencePlayers[i].volumeScale = 1.0f;
|
||||
gSequencePlayers[i].volume = 1.0f;
|
||||
|
||||
init_note_lists(&gSequencePlayers[i].notePool);
|
||||
init_sequence_player(i);
|
||||
|
|
|
@ -639,7 +639,7 @@ static void level_cmd_load_area(void) {
|
|||
s16 areaIndex = CMD_GET(u8, 2);
|
||||
UNUSED void *unused = (u8 *) sCurrentCmd + 4;
|
||||
|
||||
func_80320890();
|
||||
stop_sounds_in_continuous_banks();
|
||||
load_area(areaIndex);
|
||||
|
||||
sCurrentCmd = CMD_NEXT;
|
||||
|
@ -731,8 +731,8 @@ static void level_cmd_get_or_set_var(void) {
|
|||
case 4:
|
||||
gCurrAreaIndex = sRegister;
|
||||
break;
|
||||
case 5:
|
||||
gPressedStart = sRegister;
|
||||
case 5:
|
||||
gPressedStart = sRegister;
|
||||
break;
|
||||
}
|
||||
} else {
|
||||
|
@ -752,8 +752,8 @@ static void level_cmd_get_or_set_var(void) {
|
|||
case 4:
|
||||
sRegister = gCurrAreaIndex;
|
||||
break;
|
||||
case 5:
|
||||
sRegister = gPressedStart;
|
||||
case 5:
|
||||
sRegister = gPressedStart;
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
|
|
@ -260,7 +260,7 @@ void unload_area(void) {
|
|||
}
|
||||
|
||||
void load_mario_area(void) {
|
||||
func_80320890();
|
||||
stop_sounds_in_continuous_banks();
|
||||
load_area(gMarioSpawnInfo->areaIndex);
|
||||
|
||||
if (gCurrentArea->index == gMarioSpawnInfo->areaIndex) {
|
||||
|
|
|
@ -74,7 +74,7 @@ void bhv_merry_go_round_loop(void) {
|
|||
o->oMerryGoRoundMarioIsOutside++;
|
||||
}
|
||||
} else {
|
||||
play_sound(SOUND_AIR_HOWLING_WIND, gDefaultSoundArgs);
|
||||
play_sound(SOUND_AIR_HOWLING_WIND, gGlobalSoundSource);
|
||||
|
||||
if (
|
||||
// There are objects outside BBH, such as corkboxes.
|
||||
|
|
|
@ -111,9 +111,9 @@ void bhv_blue_coin_switch_loop(void) {
|
|||
case BLUE_COIN_SWITCH_ACT_TICKING:
|
||||
// Tick faster when the blue coins start blinking
|
||||
if (o->oTimer < 200) {
|
||||
play_sound(SOUND_GENERAL2_SWITCH_TICK_FAST, gDefaultSoundArgs);
|
||||
play_sound(SOUND_GENERAL2_SWITCH_TICK_FAST, gGlobalSoundSource);
|
||||
} else {
|
||||
play_sound(SOUND_GENERAL2_SWITCH_TICK_SLOW, gDefaultSoundArgs);
|
||||
play_sound(SOUND_GENERAL2_SWITCH_TICK_SLOW, gGlobalSoundSource);
|
||||
}
|
||||
|
||||
// Delete the switch (which stops the sound) after the last coin is collected,
|
||||
|
|
|
@ -777,7 +777,7 @@ void bhv_merry_go_round_boo_manager_loop(void) {
|
|||
#ifndef VERSION_JP
|
||||
play_puzzle_jingle();
|
||||
#else
|
||||
play_sound(SOUND_GENERAL2_RIGHT_ANSWER, gDefaultSoundArgs);
|
||||
play_sound(SOUND_GENERAL2_RIGHT_ANSWER, gGlobalSoundSource);
|
||||
#endif
|
||||
}
|
||||
}
|
||||
|
|
|
@ -830,14 +830,14 @@ s32 bowser_dead_not_bits_end(void) {
|
|||
s32 ret = 0;
|
||||
if (o->oBowserUnkF8 < 2) {
|
||||
if (o->oBowserUnkF8 == 0) {
|
||||
func_8031FFB4(SEQ_PLAYER_LEVEL, 60, 40);
|
||||
seq_player_lower_volume(SEQ_PLAYER_LEVEL, 60, 40);
|
||||
o->oBowserUnkF8++;
|
||||
}
|
||||
if (cur_obj_update_dialog(2, 18, sBowserDefeatedDialogText[o->oBehParams2ndByte], 0)) {
|
||||
o->oBowserUnkF8++;
|
||||
cur_obj_play_sound_2(SOUND_GENERAL2_BOWSER_EXPLODE);
|
||||
sequence_player_unlower(SEQ_PLAYER_LEVEL, 60);
|
||||
sequence_player_fade_out(0, 1);
|
||||
seq_player_unlower_volume(SEQ_PLAYER_LEVEL, 60);
|
||||
seq_player_fade_out(0, 1);
|
||||
}
|
||||
} else if (bowser_dead_twirl_into_trophy()) {
|
||||
bowser_dead_hide();
|
||||
|
@ -859,13 +859,13 @@ s32 bowser_dead_bits_end(void) {
|
|||
else
|
||||
dialogID = DIALOG_163;
|
||||
if (o->oBowserUnkF8 == 0) {
|
||||
func_8031FFB4(SEQ_PLAYER_LEVEL, 60, 40);
|
||||
seq_player_lower_volume(SEQ_PLAYER_LEVEL, 60, 40);
|
||||
o->oBowserUnkF8++;
|
||||
}
|
||||
if (cur_obj_update_dialog(2, 18, dialogID, 0)) {
|
||||
cur_obj_set_model(MODEL_BOWSER2);
|
||||
sequence_player_unlower(SEQ_PLAYER_LEVEL, 60);
|
||||
sequence_player_fade_out(0, 1);
|
||||
seq_player_unlower_volume(SEQ_PLAYER_LEVEL, 60);
|
||||
seq_player_fade_out(0, 1);
|
||||
bowser_spawn_grand_star_key();
|
||||
o->oBowserUnkF8++;
|
||||
}
|
||||
|
|
|
@ -43,7 +43,7 @@ static void eyerok_boss_act_wake_up(void) {
|
|||
if (o->oEyerokBossNumHands == 2) {
|
||||
if (o->oTimer > 5) {
|
||||
if (o->oSubAction == 0) {
|
||||
func_8031FFB4(SEQ_PLAYER_LEVEL, 60, 40);
|
||||
seq_player_lower_volume(SEQ_PLAYER_LEVEL, 60, 40);
|
||||
o->oSubAction += 1;
|
||||
}
|
||||
|
||||
|
|
|
@ -269,13 +269,13 @@ void bhv_book_switch_loop(void) {
|
|||
if (approach_f32_ptr(&o->oBookSwitchUnkF4, 0.0f, 20.0f)) {
|
||||
if (o->oAction != 0) {
|
||||
if (o->parentObj->oBookSwitchManagerUnkF4 == o->oBehParams2ndByte) {
|
||||
play_sound(SOUND_GENERAL2_RIGHT_ANSWER, gDefaultSoundArgs);
|
||||
play_sound(SOUND_GENERAL2_RIGHT_ANSWER, gGlobalSoundSource);
|
||||
o->parentObj->oBookSwitchManagerUnkF4 += 1;
|
||||
} else {
|
||||
sp36 = random_u16() & 0x1;
|
||||
sp34 = gMarioObject->oPosZ + 1.5f * gMarioStates[0].vel[2];
|
||||
|
||||
play_sound(SOUND_MENU_CAMERA_BUZZ, gDefaultSoundArgs);
|
||||
play_sound(SOUND_MENU_CAMERA_BUZZ, gGlobalSoundSource);
|
||||
if (sp34 > 0) {
|
||||
sp34 = 0;
|
||||
}
|
||||
|
|
|
@ -44,11 +44,11 @@ void bhv_hidden_star_trigger_loop(void) {
|
|||
}
|
||||
|
||||
#ifdef VERSION_JP
|
||||
play_sound(SOUND_MENU_STAR_SOUND, gDefaultSoundArgs);
|
||||
play_sound(SOUND_MENU_STAR_SOUND, gGlobalSoundSource);
|
||||
#else
|
||||
play_sound(SOUND_MENU_COLLECT_SECRET
|
||||
+ (((u8) hiddenStar->oHiddenStarTriggerCounter - 1) << 16),
|
||||
gDefaultSoundArgs);
|
||||
gGlobalSoundSource);
|
||||
#endif
|
||||
}
|
||||
|
||||
|
|
|
@ -33,7 +33,7 @@ void king_bobomb_act_0(void) {
|
|||
o->oHealth = 3;
|
||||
if (cur_obj_can_mario_activate_textbox_2(500.0f, 100.0f)) {
|
||||
o->oSubAction++;
|
||||
func_8031FFB4(SEQ_PLAYER_LEVEL, 60, 40);
|
||||
seq_player_lower_volume(SEQ_PLAYER_LEVEL, 60, 40);
|
||||
}
|
||||
} else if (cur_obj_update_dialog_with_cutscene(2, 1, CUTSCENE_DIALOG, DIALOG_017)) {
|
||||
o->oAction = 2;
|
||||
|
|
|
@ -4,7 +4,7 @@ void bhv_1up_interact(void) {
|
|||
UNUSED s32 sp1C;
|
||||
|
||||
if (obj_check_if_collided_with_object(o, gMarioObject) == 1) {
|
||||
play_sound(SOUND_GENERAL_COLLECT_1UP, gDefaultSoundArgs);
|
||||
play_sound(SOUND_GENERAL_COLLECT_1UP, gGlobalSoundSource);
|
||||
gMarioState->numLives++;
|
||||
o->activeFlags = ACTIVE_FLAG_DEACTIVATED;
|
||||
}
|
||||
|
@ -72,7 +72,7 @@ void bhv_1up_walking_loop(void) {
|
|||
spawn_object(o, MODEL_NONE, bhvSparkleSpawn);
|
||||
|
||||
if (o->oTimer == 0)
|
||||
play_sound(SOUND_GENERAL2_1UP_APPEAR, gDefaultSoundArgs);
|
||||
play_sound(SOUND_GENERAL2_1UP_APPEAR, gGlobalSoundSource);
|
||||
|
||||
one_up_loop_in_air();
|
||||
|
||||
|
@ -109,7 +109,7 @@ void bhv_1up_running_away_loop(void) {
|
|||
spawn_object(o, MODEL_NONE, bhvSparkleSpawn);
|
||||
|
||||
if (o->oTimer == 0)
|
||||
play_sound(SOUND_GENERAL2_1UP_APPEAR, gDefaultSoundArgs);
|
||||
play_sound(SOUND_GENERAL2_1UP_APPEAR, gGlobalSoundSource);
|
||||
|
||||
one_up_loop_in_air();
|
||||
|
||||
|
@ -215,7 +215,7 @@ void bhv_1up_hidden_loop(void) {
|
|||
o->oVelY = 40.0f;
|
||||
o->oAction = 3;
|
||||
o->header.gfx.node.flags &= ~GRAPH_RENDER_INVISIBLE;
|
||||
play_sound(SOUND_GENERAL2_1UP_APPEAR, gDefaultSoundArgs);
|
||||
play_sound(SOUND_GENERAL2_1UP_APPEAR, gGlobalSoundSource);
|
||||
}
|
||||
break;
|
||||
|
||||
|
@ -267,7 +267,7 @@ void bhv_1up_hidden_in_pole_loop(void) {
|
|||
o->oVelY = 40.0f;
|
||||
o->oAction = 3;
|
||||
o->header.gfx.node.flags &= ~GRAPH_RENDER_INVISIBLE;
|
||||
play_sound(SOUND_GENERAL2_1UP_APPEAR, gDefaultSoundArgs);
|
||||
play_sound(SOUND_GENERAL2_1UP_APPEAR, gGlobalSoundSource);
|
||||
}
|
||||
break;
|
||||
|
||||
|
|
|
@ -45,9 +45,9 @@ void bhv_purple_switch_loop(void) {
|
|||
o->oAction++;
|
||||
} else {
|
||||
if (o->oTimer < 360) {
|
||||
play_sound(SOUND_GENERAL2_SWITCH_TICK_FAST, gDefaultSoundArgs);
|
||||
play_sound(SOUND_GENERAL2_SWITCH_TICK_FAST, gGlobalSoundSource);
|
||||
} else {
|
||||
play_sound(SOUND_GENERAL2_SWITCH_TICK_SLOW, gDefaultSoundArgs);
|
||||
play_sound(SOUND_GENERAL2_SWITCH_TICK_SLOW, gGlobalSoundSource);
|
||||
}
|
||||
if (o->oTimer > 400) {
|
||||
o->oAction = PURPLE_SWITCH_WAIT_FOR_MARIO_TO_GET_OFF;
|
||||
|
|
|
@ -70,7 +70,7 @@ void bhv_red_coin_loop(void) {
|
|||
#ifndef VERSION_JP
|
||||
play_sound(SOUND_MENU_COLLECT_RED_COIN
|
||||
+ (((u8) o->parentObj->oHiddenStarTriggerCounter - 1) << 16),
|
||||
gDefaultSoundArgs);
|
||||
gGlobalSoundSource);
|
||||
#endif
|
||||
}
|
||||
|
||||
|
|
|
@ -4,5 +4,5 @@ void bhv_ambient_sounds_init(void) {
|
|||
if (gCamera->mode == CAMERA_MODE_BEHIND_MARIO)
|
||||
return;
|
||||
|
||||
play_sound(SOUND_AIR_CASTLE_OUTDOORS_AMBIENT, gDefaultSoundArgs);
|
||||
play_sound(SOUND_AIR_CASTLE_OUTDOORS_AMBIENT, gGlobalSoundSource);
|
||||
}
|
||||
|
|
|
@ -69,7 +69,7 @@ void bhv_treasure_chest_bottom_loop(void) {
|
|||
if (is_point_within_radius_of_mario(o->oPosX, o->oPosY, o->oPosZ, 150)) {
|
||||
if (!o->parentObj->oTreasureChestUnkF8) {
|
||||
if (o->parentObj->oTreasureChestUnkF4 == o->oBehParams2ndByte) {
|
||||
play_sound(SOUND_GENERAL2_RIGHT_ANSWER, gDefaultSoundArgs);
|
||||
play_sound(SOUND_GENERAL2_RIGHT_ANSWER, gGlobalSoundSource);
|
||||
o->parentObj->oTreasureChestUnkF4++;
|
||||
o->oAction = 1;
|
||||
} else {
|
||||
|
@ -77,7 +77,7 @@ void bhv_treasure_chest_bottom_loop(void) {
|
|||
o->parentObj->oTreasureChestUnkF8 = 1;
|
||||
o->oAction = 2;
|
||||
cur_obj_become_tangible();
|
||||
play_sound(SOUND_MENU_CAMERA_BUZZ, gDefaultSoundArgs);
|
||||
play_sound(SOUND_MENU_CAMERA_BUZZ, gGlobalSoundSource);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -130,7 +130,7 @@ void bhv_treasure_chest_ship_loop(void) {
|
|||
case 1:
|
||||
if (gEnvironmentRegions != NULL) {
|
||||
gEnvironmentRegions[6] += -5;
|
||||
play_sound(SOUND_ENV_WATER_DRAIN, gDefaultSoundArgs);
|
||||
play_sound(SOUND_ENV_WATER_DRAIN, gGlobalSoundSource);
|
||||
set_environmental_camera_shake(SHAKE_ENV_JRB_SHIP_DRAIN);
|
||||
if (gEnvironmentRegions[6] < -335) {
|
||||
gEnvironmentRegions[6] = -335;
|
||||
|
|
|
@ -64,11 +64,11 @@ void water_ring_check_collection(f32 avgScale, struct Object *ringManager) {
|
|||
if (ringSpawner->oWaterRingSpawnerRingsCollected < 6) {
|
||||
spawn_orange_number(ringSpawner->oWaterRingSpawnerRingsCollected, 0, -40, 0);
|
||||
#ifdef VERSION_JP
|
||||
play_sound(SOUND_MENU_STAR_SOUND, gDefaultSoundArgs);
|
||||
play_sound(SOUND_MENU_STAR_SOUND, gGlobalSoundSource);
|
||||
#else
|
||||
play_sound(SOUND_MENU_COLLECT_SECRET
|
||||
+ (((u8) ringSpawner->oWaterRingSpawnerRingsCollected - 1) << 16),
|
||||
gDefaultSoundArgs);
|
||||
gGlobalSoundSource);
|
||||
#endif
|
||||
}
|
||||
|
||||
|
|
|
@ -23,7 +23,7 @@ void whomp_act_0(void) {
|
|||
if (o->oSubAction == 0) {
|
||||
if (o->oDistanceToMario < 600.0f) {
|
||||
o->oSubAction++;
|
||||
func_8031FFB4(SEQ_PLAYER_LEVEL, 60, 40);
|
||||
seq_player_lower_volume(SEQ_PLAYER_LEVEL, 60, 40);
|
||||
} else {
|
||||
cur_obj_set_pos_to_home();
|
||||
o->oHealth = 3;
|
||||
|
|
|
@ -222,7 +222,7 @@ static void wiggler_act_walk(void) {
|
|||
// Update text if necessary
|
||||
if (o->oWigglerTextStatus < WIGGLER_TEXT_STATUS_COMPLETED_DIALOG) {
|
||||
if (o->oWigglerTextStatus == WIGGLER_TEXT_STATUS_AWAIT_DIALOG) {
|
||||
func_8031FFB4(SEQ_PLAYER_LEVEL, 60, 40);
|
||||
seq_player_lower_volume(SEQ_PLAYER_LEVEL, 60, 40);
|
||||
o->oWigglerTextStatus = WIGGLER_TEXT_STATUS_SHOWING_DIALOG;
|
||||
}
|
||||
|
||||
|
|
|
@ -133,14 +133,14 @@ void yoshi_give_present_loop(void) {
|
|||
s32 sp1C = gGlobalTimer;
|
||||
|
||||
if (gHudDisplay.lives == 100) {
|
||||
play_sound(SOUND_GENERAL_COLLECT_1UP, gDefaultSoundArgs);
|
||||
play_sound(SOUND_GENERAL_COLLECT_1UP, gGlobalSoundSource);
|
||||
gSpecialTripleJump = 1;
|
||||
o->oAction = YOSHI_ACT_WALK_JUMP_OFF_ROOF;
|
||||
return;
|
||||
}
|
||||
|
||||
if ((sp1C & 0x03) == 0) {
|
||||
play_sound(SOUND_MENU_YOSHI_GAIN_LIVES, gDefaultSoundArgs);
|
||||
play_sound(SOUND_MENU_YOSHI_GAIN_LIVES, gGlobalSoundSource);
|
||||
gMarioState->numLives++;
|
||||
}
|
||||
}
|
||||
|
|
|
@ -9,7 +9,7 @@
|
|||
#include "engine/surface_collision.h"
|
||||
#include "pc/configfile.h"
|
||||
#include "pc/controller/controller_mouse.h"
|
||||
#if defined(__MINGW32__) && !defined(__MINGW64_VERSION_MAJOR)
|
||||
#if defined(__MINGW32__) && !defined(__MINGW64_VERSION_MAJOR)
|
||||
//quick and dirty fix for some older MinGW.org mingwrt
|
||||
#else
|
||||
#include <stdio.h>
|
||||
|
@ -265,7 +265,7 @@ static void newcam_rotate_button(void) {
|
|||
//8 directional camera rotation input for buttons.
|
||||
if ((gPlayer1Controller->buttonPressed & L_CBUTTONS) && newcam_analogue == 0) {
|
||||
#ifndef nosound
|
||||
play_sound(SOUND_MENU_CAMERA_ZOOM_IN, gDefaultSoundArgs);
|
||||
play_sound(SOUND_MENU_CAMERA_ZOOM_IN, gGlobalSoundSource);
|
||||
#endif
|
||||
if (newcam_modeflags & NC_FLAG_8D)
|
||||
newcam_yaw_target = newcam_yaw_target+(ivrt(newcam_invertX)*0x2000);
|
||||
|
@ -274,7 +274,7 @@ static void newcam_rotate_button(void) {
|
|||
newcam_centering = 1;
|
||||
} else if ((gPlayer1Controller->buttonPressed & R_CBUTTONS) && newcam_analogue == 0) {
|
||||
#ifndef nosound
|
||||
play_sound(SOUND_MENU_CAMERA_ZOOM_IN, gDefaultSoundArgs);
|
||||
play_sound(SOUND_MENU_CAMERA_ZOOM_IN, gGlobalSoundSource);
|
||||
#endif
|
||||
if (newcam_modeflags & NC_FLAG_8D)
|
||||
newcam_yaw_target = newcam_yaw_target-(ivrt(newcam_invertX)*0x2000);
|
||||
|
@ -316,7 +316,7 @@ static void newcam_rotate_button(void) {
|
|||
newcam_yaw_target = newcam_yaw+(ivrt(newcam_invertX)*0x3000);
|
||||
newcam_centering = 1;
|
||||
#ifndef nosound
|
||||
play_sound(SOUND_MENU_CAMERA_ZOOM_IN, gDefaultSoundArgs);
|
||||
play_sound(SOUND_MENU_CAMERA_ZOOM_IN, gGlobalSoundSource);
|
||||
#endif
|
||||
}
|
||||
newcam_framessincec[0] = 0;
|
||||
|
@ -326,7 +326,7 @@ static void newcam_rotate_button(void) {
|
|||
newcam_yaw_target = newcam_yaw-(ivrt(newcam_invertX)*0x3000);
|
||||
newcam_centering = 1;
|
||||
#ifndef nosound
|
||||
play_sound(SOUND_MENU_CAMERA_ZOOM_IN, gDefaultSoundArgs);
|
||||
play_sound(SOUND_MENU_CAMERA_ZOOM_IN, gGlobalSoundSource);
|
||||
#endif
|
||||
}
|
||||
newcam_framessincec[1] = 0;
|
||||
|
@ -345,7 +345,7 @@ static void newcam_rotate_button(void) {
|
|||
newcam_cstick_down = 1;
|
||||
newcam_centering = 1;
|
||||
#ifndef nosound
|
||||
play_sound(SOUND_MENU_CAMERA_ZOOM_IN, gDefaultSoundArgs);
|
||||
play_sound(SOUND_MENU_CAMERA_ZOOM_IN, gGlobalSoundSource);
|
||||
#endif
|
||||
if (newcam_stick2[0] > 20) {
|
||||
if (newcam_modeflags & NC_FLAG_8D)
|
||||
|
@ -399,7 +399,7 @@ static void newcam_zoom_button(void) {
|
|||
} else if (gPlayer1Controller->buttonPressed & R_TRIG && newcam_modeflags & NC_FLAG_XTURN) {
|
||||
//Each time the player presses R, but NOT L the camera zooms out more, until it hits the limit and resets back to close view.
|
||||
#ifndef nosound
|
||||
play_sound(SOUND_MENU_CLICK_CHANGE_VIEW, gDefaultSoundArgs);
|
||||
play_sound(SOUND_MENU_CLICK_CHANGE_VIEW, gGlobalSoundSource);
|
||||
#endif
|
||||
|
||||
if (newcam_distance_target == newcam_distance_values[0])
|
||||
|
|
|
@ -4864,23 +4864,23 @@ void play_camera_buzz_if_c_sideways(void) {
|
|||
}
|
||||
|
||||
void play_sound_cbutton_up(void) {
|
||||
play_sound(SOUND_MENU_CAMERA_ZOOM_IN, gDefaultSoundArgs);
|
||||
play_sound(SOUND_MENU_CAMERA_ZOOM_IN, gGlobalSoundSource);
|
||||
}
|
||||
|
||||
void play_sound_cbutton_down(void) {
|
||||
play_sound(SOUND_MENU_CAMERA_ZOOM_OUT, gDefaultSoundArgs);
|
||||
play_sound(SOUND_MENU_CAMERA_ZOOM_OUT, gGlobalSoundSource);
|
||||
}
|
||||
|
||||
void play_sound_cbutton_side(void) {
|
||||
play_sound(SOUND_MENU_CAMERA_TURN, gDefaultSoundArgs);
|
||||
play_sound(SOUND_MENU_CAMERA_TURN, gGlobalSoundSource);
|
||||
}
|
||||
|
||||
void play_sound_button_change_blocked(void) {
|
||||
play_sound(SOUND_MENU_CAMERA_BUZZ, gDefaultSoundArgs);
|
||||
play_sound(SOUND_MENU_CAMERA_BUZZ, gGlobalSoundSource);
|
||||
}
|
||||
|
||||
void play_sound_rbutton_changed(void) {
|
||||
play_sound(SOUND_MENU_CLICK_CHANGE_VIEW, gDefaultSoundArgs);
|
||||
play_sound(SOUND_MENU_CLICK_CHANGE_VIEW, gGlobalSoundSource);
|
||||
}
|
||||
|
||||
void play_sound_if_cam_switched_to_lakitu_or_mario(void) {
|
||||
|
@ -7083,7 +7083,7 @@ static UNUSED void unused_cutscene_mario_dialog_looking_up(UNUSED struct Camera
|
|||
*/
|
||||
BAD_RETURN(s32) cutscene_intro_peach_start_letter_music(UNUSED struct Camera *c) {
|
||||
#if defined(VERSION_US) || defined(VERSION_SH)
|
||||
func_8031FFB4(SEQ_PLAYER_LEVEL, 60, 40);
|
||||
seq_player_lower_volume(SEQ_PLAYER_LEVEL, 60, 40);
|
||||
#endif
|
||||
cutscene_intro_peach_play_message_music();
|
||||
}
|
||||
|
@ -7093,7 +7093,7 @@ BAD_RETURN(s32) cutscene_intro_peach_start_letter_music(UNUSED struct Camera *c)
|
|||
*/
|
||||
BAD_RETURN(s32) cutscene_intro_peach_start_flying_music(UNUSED struct Camera *c) {
|
||||
#ifndef VERSION_JP
|
||||
sequence_player_unlower(SEQ_PLAYER_LEVEL, 60);
|
||||
seq_player_unlower_volume(SEQ_PLAYER_LEVEL, 60);
|
||||
#endif
|
||||
cutscene_intro_peach_play_lakitu_flying_music();
|
||||
}
|
||||
|
@ -7104,7 +7104,7 @@ BAD_RETURN(s32) cutscene_intro_peach_start_flying_music(UNUSED struct Camera *c)
|
|||
* starts.
|
||||
*/
|
||||
BAD_RETURN(s32) cutscene_intro_peach_eu_lower_volume(UNUSED struct Camera *c) {
|
||||
func_8031FFB4(SEQ_PLAYER_LEVEL, 60, 40);
|
||||
seq_player_lower_volume(SEQ_PLAYER_LEVEL, 60, 40);
|
||||
}
|
||||
#endif
|
||||
|
||||
|
@ -7257,11 +7257,11 @@ void set_flag_post_door(struct Camera *c) {
|
|||
}
|
||||
|
||||
void cutscene_soften_music(UNUSED struct Camera *c) {
|
||||
func_8031FFB4(SEQ_PLAYER_LEVEL, 60, 40);
|
||||
seq_player_lower_volume(SEQ_PLAYER_LEVEL, 60, 40);
|
||||
}
|
||||
|
||||
void cutscene_unsoften_music(UNUSED struct Camera *c) {
|
||||
sequence_player_unlower(SEQ_PLAYER_LEVEL, 60);
|
||||
seq_player_unlower_volume(SEQ_PLAYER_LEVEL, 60);
|
||||
}
|
||||
|
||||
static void stub_camera_5(UNUSED struct Camera *c) {
|
||||
|
@ -9588,7 +9588,7 @@ BAD_RETURN(s32) peach_letter_text(UNUSED struct Camera *c) {
|
|||
|
||||
#ifndef VERSION_JP
|
||||
BAD_RETURN(s32) play_sound_peach_reading_letter(UNUSED struct Camera *c) {
|
||||
play_sound(SOUND_PEACH_DEAR_MARIO, gDefaultSoundArgs);
|
||||
play_sound(SOUND_PEACH_DEAR_MARIO, gGlobalSoundSource);
|
||||
}
|
||||
#endif
|
||||
|
||||
|
|
|
@ -174,7 +174,7 @@ void envfx_update_lava(Vec3s centerPos) {
|
|||
}
|
||||
|
||||
if ((chance = (s32)(random_float() * 16.0f)) == 8) {
|
||||
play_sound(SOUND_GENERAL_QUIET_BUBBLE2, gDefaultSoundArgs);
|
||||
play_sound(SOUND_GENERAL_QUIET_BUBBLE2, gGlobalSoundSource);
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -523,7 +523,7 @@ void handle_menu_scrolling(s8 scrollDirection, s8 *currentIndex, s8 minIndex, s8
|
|||
//! Probably originally a >=, but later replaced with an == and an else statement.
|
||||
currentIndex[0] = maxIndex;
|
||||
} else {
|
||||
play_sound(SOUND_MENU_CHANGE_SELECT, gDefaultSoundArgs);
|
||||
play_sound(SOUND_MENU_CHANGE_SELECT, gGlobalSoundSource);
|
||||
currentIndex[0]++;
|
||||
}
|
||||
}
|
||||
|
@ -532,7 +532,7 @@ void handle_menu_scrolling(s8 scrollDirection, s8 *currentIndex, s8 minIndex, s8
|
|||
if (currentIndex[0] == minIndex) {
|
||||
// Same applies to here as above
|
||||
} else {
|
||||
play_sound(SOUND_MENU_CHANGE_SELECT, gDefaultSoundArgs);
|
||||
play_sound(SOUND_MENU_CHANGE_SELECT, gGlobalSoundSource);
|
||||
currentIndex[0]--;
|
||||
}
|
||||
}
|
||||
|
@ -1318,7 +1318,7 @@ void handle_special_dialog_text(s16 dialogID) { // dialog ID tables, in order
|
|||
|
||||
for (i = 0; i < (s16) ARRAY_COUNT(dialogBossStart); i++) {
|
||||
if (dialogBossStart[i] == dialogID) {
|
||||
sequence_player_unlower(SEQ_PLAYER_LEVEL, 60);
|
||||
seq_player_unlower_volume(SEQ_PLAYER_LEVEL, 60);
|
||||
play_music(SEQ_PLAYER_LEVEL, SEQUENCE_ARGS(4, SEQ_EVENT_BOSS), 0);
|
||||
return;
|
||||
}
|
||||
|
@ -1333,14 +1333,14 @@ void handle_special_dialog_text(s16 dialogID) { // dialog ID tables, in order
|
|||
|
||||
for (i = 0; i < (s16) ARRAY_COUNT(dialogStarSound); i++) {
|
||||
if (dialogStarSound[i] == dialogID && gDialogLineNum == 1) {
|
||||
play_sound(SOUND_MENU_STAR_SOUND, gDefaultSoundArgs);
|
||||
play_sound(SOUND_MENU_STAR_SOUND, gGlobalSoundSource);
|
||||
return;
|
||||
}
|
||||
}
|
||||
|
||||
for (i = 0; i < (s16) ARRAY_COUNT(dialogBossStop); i++) {
|
||||
if (dialogBossStop[i] == dialogID) {
|
||||
sequence_player_fade_out(0, 1);
|
||||
seq_player_fade_out(0, 1);
|
||||
return;
|
||||
}
|
||||
}
|
||||
|
@ -1391,7 +1391,7 @@ void render_dialog_entries(void) {
|
|||
case DIALOG_STATE_OPENING:
|
||||
if (gDialogBoxOpenTimer == DEFAULT_DIALOG_BOX_ANGLE) {
|
||||
play_dialog_sound(gDialogID);
|
||||
play_sound(SOUND_MENU_MESSAGE_APPEAR, gDefaultSoundArgs);
|
||||
play_sound(SOUND_MENU_MESSAGE_APPEAR, gGlobalSoundSource);
|
||||
}
|
||||
|
||||
if (gDialogBoxType == DIALOG_TYPE_ROTATE) {
|
||||
|
@ -1420,7 +1420,7 @@ void render_dialog_entries(void) {
|
|||
gDialogBoxState = DIALOG_STATE_CLOSING;
|
||||
} else {
|
||||
gDialogBoxState = DIALOG_STATE_HORIZONTAL;
|
||||
play_sound(SOUND_MENU_MESSAGE_NEXT_PAGE, gDefaultSoundArgs);
|
||||
play_sound(SOUND_MENU_MESSAGE_NEXT_PAGE, gGlobalSoundSource);
|
||||
}
|
||||
}
|
||||
#if !defined(VERSION_JP) && !defined(VERSION_SH)
|
||||
|
@ -1442,7 +1442,7 @@ void render_dialog_entries(void) {
|
|||
case DIALOG_STATE_CLOSING:
|
||||
if (gDialogBoxOpenTimer == 20.0f) {
|
||||
level_set_transition(0, 0);
|
||||
play_sound(SOUND_MENU_MESSAGE_DISAPPEAR, gDefaultSoundArgs);
|
||||
play_sound(SOUND_MENU_MESSAGE_DISAPPEAR, gGlobalSoundSource);
|
||||
|
||||
if (gDialogBoxType == DIALOG_TYPE_ZOOM) {
|
||||
trigger_cutscene_dialog(2);
|
||||
|
@ -2153,7 +2153,7 @@ s16 render_pause_courses_and_castle(void) {
|
|||
gDialogLineNum = 1;
|
||||
gDialogTextAlpha = 0;
|
||||
level_set_transition(-1, 0);
|
||||
play_sound(SOUND_MENU_PAUSE_HIGHPRIO, gDefaultSoundArgs);
|
||||
play_sound(SOUND_MENU_PAUSE_HIGHPRIO, gGlobalSoundSource);
|
||||
|
||||
if (gCurrCourseNum >= COURSE_MIN && gCurrCourseNum <= COURSE_MAX) {
|
||||
change_dialog_camera_angle();
|
||||
|
@ -2175,7 +2175,7 @@ s16 render_pause_courses_and_castle(void) {
|
|||
|
||||
if (gPlayer3Controller->buttonPressed & (A_BUTTON | START_BUTTON)) {
|
||||
level_set_transition(0, 0);
|
||||
play_sound(SOUND_MENU_PAUSE_2, gDefaultSoundArgs);
|
||||
play_sound(SOUND_MENU_PAUSE_2, gGlobalSoundSource);
|
||||
gDialogBoxState = DIALOG_STATE_OPENING;
|
||||
gMenuMode = -1;
|
||||
|
||||
|
@ -2196,7 +2196,7 @@ s16 render_pause_courses_and_castle(void) {
|
|||
|
||||
if (gPlayer3Controller->buttonPressed & (A_BUTTON | START_BUTTON)) {
|
||||
level_set_transition(0, 0);
|
||||
play_sound(SOUND_MENU_PAUSE_2, gDefaultSoundArgs);
|
||||
play_sound(SOUND_MENU_PAUSE_2, gGlobalSoundSource);
|
||||
gMenuMode = -1;
|
||||
gDialogBoxState = DIALOG_STATE_OPENING;
|
||||
|
||||
|
@ -2261,16 +2261,16 @@ void print_hud_course_complete_coins(s16 x, s16 y) {
|
|||
} else {
|
||||
if ((gCourseDoneMenuTimer & 1) || gHudDisplay.coins > 70) {
|
||||
gCourseCompleteCoins++;
|
||||
play_sound(SOUND_MENU_YOSHI_GAIN_LIVES, gDefaultSoundArgs);
|
||||
play_sound(SOUND_MENU_YOSHI_GAIN_LIVES, gGlobalSoundSource);
|
||||
|
||||
if (gCourseCompleteCoins == 50 || gCourseCompleteCoins == 100 || gCourseCompleteCoins == 150) {
|
||||
play_sound(SOUND_GENERAL_COLLECT_1UP, gDefaultSoundArgs);
|
||||
play_sound(SOUND_GENERAL_COLLECT_1UP, gGlobalSoundSource);
|
||||
gMarioState[0].numLives++;
|
||||
}
|
||||
}
|
||||
|
||||
if (gHudDisplay.coins == gCourseCompleteCoins && gGotFileCoinHiScore != 0) {
|
||||
play_sound(SOUND_MENU_MARIO_CASTLE_WARP2, gDefaultSoundArgs);
|
||||
play_sound(SOUND_MENU_MARIO_CASTLE_WARP2, gGlobalSoundSource);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -2430,7 +2430,7 @@ s16 render_course_complete_screen(void) {
|
|||
#endif
|
||||
)) {
|
||||
level_set_transition(0, 0);
|
||||
play_sound(SOUND_MENU_STAR_SOUND, gDefaultSoundArgs);
|
||||
play_sound(SOUND_MENU_STAR_SOUND, gGlobalSoundSource);
|
||||
gDialogBoxState = DIALOG_STATE_OPENING;
|
||||
gMenuMode = -1;
|
||||
num = gDialogLineNum;
|
||||
|
|
|
@ -444,12 +444,12 @@ void init_mario_after_warp(void) {
|
|||
&& sWarpDest.nodeId == 31
|
||||
#endif
|
||||
)
|
||||
play_sound(SOUND_MENU_MARIO_CASTLE_WARP, gDefaultSoundArgs);
|
||||
play_sound(SOUND_MENU_MARIO_CASTLE_WARP, gGlobalSoundSource);
|
||||
#ifndef VERSION_JP
|
||||
if (sWarpDest.levelNum == LEVEL_CASTLE_GROUNDS && sWarpDest.areaIdx == 1
|
||||
&& (sWarpDest.nodeId == 7 || sWarpDest.nodeId == 10 || sWarpDest.nodeId == 20
|
||||
|| sWarpDest.nodeId == 30)) {
|
||||
play_sound(SOUND_MENU_MARIO_CASTLE_WARP, gDefaultSoundArgs);
|
||||
play_sound(SOUND_MENU_MARIO_CASTLE_WARP, gGlobalSoundSource);
|
||||
}
|
||||
#endif
|
||||
}
|
||||
|
@ -676,7 +676,7 @@ void initiate_painting_warp(void) {
|
|||
|
||||
gMarioState->marioObj->header.gfx.node.flags &= ~GRAPH_RENDER_ACTIVE;
|
||||
|
||||
play_sound(SOUND_MENU_STAR_SOUND, gDefaultSoundArgs);
|
||||
play_sound(SOUND_MENU_STAR_SOUND, gGlobalSoundSource);
|
||||
fadeout_music(398);
|
||||
queue_rumble_data(80, 70);
|
||||
func_sh_8024C89C(1);
|
||||
|
@ -730,7 +730,7 @@ s16 level_trigger_warp(struct MarioState *m, s32 warpOp) {
|
|||
sDelayedWarpTimer = 48;
|
||||
sSourceWarpNodeId = WARP_NODE_DEATH;
|
||||
play_transition(WARP_TRANSITION_FADE_INTO_BOWSER, 0x30, 0x00, 0x00, 0x00);
|
||||
play_sound(SOUND_MENU_BOWSER_LAUGH, gDefaultSoundArgs);
|
||||
play_sound(SOUND_MENU_BOWSER_LAUGH, gGlobalSoundSource);
|
||||
break;
|
||||
|
||||
case WARP_OP_WARP_FLOOR:
|
||||
|
@ -751,7 +751,7 @@ s16 level_trigger_warp(struct MarioState *m, s32 warpOp) {
|
|||
sSourceWarpNodeId = WARP_NODE_F2;
|
||||
play_transition(WARP_TRANSITION_FADE_INTO_COLOR, 0x1E, 0xFF, 0xFF, 0xFF);
|
||||
#ifndef VERSION_JP
|
||||
play_sound(SOUND_MENU_STAR_SOUND, gDefaultSoundArgs);
|
||||
play_sound(SOUND_MENU_STAR_SOUND, gGlobalSoundSource);
|
||||
#endif
|
||||
break;
|
||||
|
||||
|
@ -926,7 +926,7 @@ void update_hud_values(void) {
|
|||
gHudDisplay.keys = gMarioState->numKeys;
|
||||
|
||||
if (numHealthWedges > gHudDisplay.wedges) {
|
||||
play_sound(SOUND_MENU_POWER_METER, gDefaultSoundArgs);
|
||||
play_sound(SOUND_MENU_POWER_METER, gGlobalSoundSource);
|
||||
}
|
||||
gHudDisplay.wedges = numHealthWedges;
|
||||
|
||||
|
@ -1213,7 +1213,7 @@ s32 init_level(void) {
|
|||
set_background_music(gCurrentArea->musicParam, gCurrentArea->musicParam2, 0);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
if (gCurrDemoInput == NULL) {
|
||||
cancel_rumble();
|
||||
}
|
||||
|
@ -1306,6 +1306,6 @@ s32 lvl_set_current_level(UNUSED s16 arg0, s32 levelNum) {
|
|||
* Play the "thank you so much for to playing my game" sound.
|
||||
*/
|
||||
s32 lvl_play_the_end_screen_sound(UNUSED s16 arg0, UNUSED s32 arg1) {
|
||||
play_sound(SOUND_MENU_THANK_YOU_PLAYING_MY_GAME, gDefaultSoundArgs);
|
||||
play_sound(SOUND_MENU_THANK_YOU_PLAYING_MY_GAME, gGlobalSoundSource);
|
||||
return 1;
|
||||
}
|
||||
|
|
|
@ -160,7 +160,7 @@ extern void func_sh_802F69CC(void);
|
|||
void handle_nmi_request(void) {
|
||||
gResetTimer = 1;
|
||||
D_8032C648 = 0;
|
||||
func_80320890();
|
||||
stop_sounds_in_continuous_banks();
|
||||
sound_banks_disable(2, 0x037A);
|
||||
fadeout_music(90);
|
||||
#ifdef VERSION_SH
|
||||
|
|
|
@ -276,7 +276,7 @@ void play_mario_jump_sound(struct MarioState *m) {
|
|||
*/
|
||||
void adjust_sound_for_speed(struct MarioState *m) {
|
||||
s32 absForwardVel = (m->forwardVel > 0.0f) ? m->forwardVel : -m->forwardVel;
|
||||
func_80320A4C(1, (absForwardVel > 100) ? 100 : absForwardVel);
|
||||
set_sound_moving_speed(1, (absForwardVel > 100) ? 100 : absForwardVel);
|
||||
}
|
||||
|
||||
/**
|
||||
|
@ -1231,7 +1231,7 @@ void squish_mario_model(struct MarioState *m) {
|
|||
else {
|
||||
vec3f_set(m->marioObj->header.gfx.scale, 1.0f, 1.0f, 1.0f);
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
// If timer is less than 16, rubber-band Mario's size scale up and down.
|
||||
else if (m->squishTimer <= 16) {
|
||||
|
@ -1413,7 +1413,7 @@ void update_mario_inputs(struct MarioState *m) {
|
|||
update_mario_geometry_inputs(m);
|
||||
|
||||
debug_print_speed_action_normal(m);
|
||||
|
||||
|
||||
/* Moonjump cheat */
|
||||
while (Cheats.MoonJump == true && Cheats.EnableCheats == true && m->controller->buttonDown & L_TRIG ){
|
||||
m->vel[1] = 25;
|
||||
|
@ -1533,7 +1533,7 @@ void update_mario_health(struct MarioState *m) {
|
|||
|
||||
// Play a noise to alert the player when Mario is close to drowning.
|
||||
if (((m->action & ACT_GROUP_MASK) == ACT_GROUP_SUBMERGED) && (m->health < 0x300)) {
|
||||
play_sound(SOUND_MOVING_ALMOST_DROWNING, gDefaultSoundArgs);
|
||||
play_sound(SOUND_MOVING_ALMOST_DROWNING, gGlobalSoundSource);
|
||||
if (!gRumblePakTimer) {
|
||||
gRumblePakTimer = 36;
|
||||
if (is_rumble_finished_and_queue_empty()) {
|
||||
|
|
|
@ -172,7 +172,7 @@ s32 act_holding_pole(struct MarioState *m) {
|
|||
}
|
||||
play_climbing_sounds(m, 2);
|
||||
reset_rumble_timers();
|
||||
func_80320A4C(1, marioObj->oMarioPoleYawVel / 0x100 * 2);
|
||||
set_sound_moving_speed(1, marioObj->oMarioPoleYawVel / 0x100 * 2);
|
||||
} else {
|
||||
marioObj->oMarioPoleYawVel = 0;
|
||||
m->faceAngle[1] -= m->controller->stickX * 16.0f;
|
||||
|
|
|
@ -2063,7 +2063,7 @@ static void end_peach_cutscene_spawn_peach(struct MarioState *m) {
|
|||
play_transition(WARP_TRANSITION_FADE_INTO_COLOR, 14, 255, 255, 255);
|
||||
}
|
||||
if (m->actionTimer == 2) {
|
||||
play_sound(SOUND_MENU_STAR_SOUND, gDefaultSoundArgs);
|
||||
play_sound(SOUND_MENU_STAR_SOUND, gGlobalSoundSource);
|
||||
}
|
||||
if (m->actionTimer == 44) {
|
||||
play_transition(WARP_TRANSITION_FADE_FROM_COLOR, 192, 255, 255, 255);
|
||||
|
@ -2202,7 +2202,7 @@ static void end_peach_cutscene_dialog_1(struct MarioState *m) {
|
|||
case 230:
|
||||
set_cutscene_message(160, 227, 0, 30);
|
||||
#ifndef VERSION_JP
|
||||
func_8031FFB4(SEQ_PLAYER_LEVEL, 60, 40);
|
||||
seq_player_lower_volume(SEQ_PLAYER_LEVEL, 60, 40);
|
||||
play_sound(SOUND_PEACH_MARIO, sEndPeachObj->header.gfx.cameraToObject);
|
||||
#endif
|
||||
break;
|
||||
|
@ -2363,7 +2363,7 @@ static void end_peach_cutscene_star_dance(struct MarioState *m) {
|
|||
|
||||
case 140:
|
||||
#ifndef VERSION_JP
|
||||
sequence_player_unlower(SEQ_PLAYER_LEVEL, 60);
|
||||
seq_player_unlower_volume(SEQ_PLAYER_LEVEL, 60);
|
||||
#endif
|
||||
play_cutscene_music(SEQUENCE_ARGS(15, SEQ_EVENT_CUTSCENE_CREDITS));
|
||||
break;
|
||||
|
|
|
@ -333,10 +333,10 @@ s32 act_sleeping(struct MarioState *m) {
|
|||
|
||||
s32 act_waking_up(struct MarioState *m) {
|
||||
if (!m->actionTimer) {
|
||||
func_803205E8(SOUND_MARIO_SNORING1, m->marioObj->header.gfx.cameraToObject);
|
||||
func_803205E8(SOUND_MARIO_SNORING2, m->marioObj->header.gfx.cameraToObject);
|
||||
stop_sound(SOUND_MARIO_SNORING1, m->marioObj->header.gfx.cameraToObject);
|
||||
stop_sound(SOUND_MARIO_SNORING2, m->marioObj->header.gfx.cameraToObject);
|
||||
#ifndef VERSION_JP
|
||||
func_803205E8(SOUND_MARIO_SNORING3, m->marioObj->header.gfx.cameraToObject);
|
||||
stop_sound(SOUND_MARIO_SNORING3, m->marioObj->header.gfx.cameraToObject);
|
||||
#endif
|
||||
raise_background_noise(2);
|
||||
}
|
||||
|
|
|
@ -82,10 +82,10 @@ void lower_background_noise(s32 a) // Soften volume
|
|||
{
|
||||
switch (a) {
|
||||
case 1:
|
||||
set_sound_disabled(TRUE);
|
||||
set_audio_muted(TRUE);
|
||||
break;
|
||||
case 2:
|
||||
func_8031FFB4(SEQ_PLAYER_LEVEL, 60, 40); // soften music
|
||||
seq_player_lower_volume(SEQ_PLAYER_LEVEL, 60, 40); // soften music
|
||||
break;
|
||||
}
|
||||
D_8032C6C0 |= a;
|
||||
|
@ -95,10 +95,10 @@ void raise_background_noise(s32 a) // harden volume
|
|||
{
|
||||
switch (a) {
|
||||
case 1:
|
||||
set_sound_disabled(FALSE);
|
||||
set_audio_muted(FALSE);
|
||||
break;
|
||||
case 2:
|
||||
sequence_player_unlower(SEQ_PLAYER_LEVEL, 60);
|
||||
seq_player_unlower_volume(SEQ_PLAYER_LEVEL, 60);
|
||||
break;
|
||||
}
|
||||
D_8032C6C0 &= ~a;
|
||||
|
@ -133,27 +133,27 @@ void set_sound_mode(u16 soundMode) {
|
|||
void play_menu_sounds(s16 soundMenuFlags) {
|
||||
|
||||
if (soundMenuFlags & SOUND_MENU_FLAG_HANDAPPEAR) {
|
||||
play_sound(SOUND_MENU_HAND_APPEAR, gDefaultSoundArgs);
|
||||
play_sound(SOUND_MENU_HAND_APPEAR, gGlobalSoundSource);
|
||||
} else if (soundMenuFlags & SOUND_MENU_FLAG_HANDISAPPEAR) {
|
||||
play_sound(SOUND_MENU_HAND_DISAPPEAR, gDefaultSoundArgs);
|
||||
play_sound(SOUND_MENU_HAND_DISAPPEAR, gGlobalSoundSource);
|
||||
} else if (soundMenuFlags & SOUND_MENU_FLAG_UNKNOWN1) {
|
||||
play_sound(SOUND_MENU_UNK0C, gDefaultSoundArgs);
|
||||
play_sound(SOUND_MENU_UNK0C, gGlobalSoundSource);
|
||||
} else if (soundMenuFlags & SOUND_MENU_FLAG_PINCHMARIOFACE) {
|
||||
play_sound(SOUND_MENU_PINCH_MARIO_FACE, gDefaultSoundArgs);
|
||||
play_sound(SOUND_MENU_PINCH_MARIO_FACE, gGlobalSoundSource);
|
||||
} else if (soundMenuFlags & SOUND_MENU_FLAG_PINCHMARIOFACE2) {
|
||||
play_sound(SOUND_MENU_PINCH_MARIO_FACE, gDefaultSoundArgs);
|
||||
play_sound(SOUND_MENU_PINCH_MARIO_FACE, gGlobalSoundSource);
|
||||
} else if (soundMenuFlags & SOUND_MENU_FLAG_LETGOMARIOFACE) {
|
||||
play_sound(SOUND_MENU_LET_GO_MARIO_FACE, gDefaultSoundArgs);
|
||||
play_sound(SOUND_MENU_LET_GO_MARIO_FACE, gGlobalSoundSource);
|
||||
} else if (soundMenuFlags & SOUND_MENU_FLAG_CAMERAZOOMIN) {
|
||||
play_sound(SOUND_MENU_CAMERA_ZOOM_IN, gDefaultSoundArgs);
|
||||
play_sound(SOUND_MENU_CAMERA_ZOOM_IN, gGlobalSoundSource);
|
||||
} else if (soundMenuFlags & SOUND_MENU_FLAG_CAMERAZOOMOUT) {
|
||||
play_sound(SOUND_MENU_CAMERA_ZOOM_OUT, gDefaultSoundArgs);
|
||||
play_sound(SOUND_MENU_CAMERA_ZOOM_OUT, gGlobalSoundSource);
|
||||
}
|
||||
|
||||
if (soundMenuFlags & 0x100) {
|
||||
play_menu_sounds_extra(20, NULL);
|
||||
}
|
||||
|
||||
|
||||
if ((soundMenuFlags & 0x20) != 0) {
|
||||
queue_rumble_data(10, 60);
|
||||
}
|
||||
|
@ -220,7 +220,7 @@ void fadeout_music(s16 fadeOutTime) {
|
|||
}
|
||||
|
||||
void fadeout_level_music(s16 fadeTimer) {
|
||||
sequence_player_fade_out(0, fadeTimer);
|
||||
seq_player_fade_out(0, fadeTimer);
|
||||
sCurrentMusic = MUSIC_NONE;
|
||||
sCurrentShellMusic = MUSIC_NONE;
|
||||
sCurrentCapMusic = MUSIC_NONE;
|
||||
|
|
|
@ -188,7 +188,7 @@ void unload_object(struct Object *obj) {
|
|||
obj->prevObj = NULL;
|
||||
|
||||
obj->header.gfx.throwMatrix = NULL;
|
||||
func_803206F8(obj->header.gfx.cameraToObject);
|
||||
stop_sounds_from_source(obj->header.gfx.cameraToObject);
|
||||
geo_remove_child(&obj->header.gfx.node);
|
||||
geo_add_child(&gObjParentGraphNode, &obj->header.gfx.node);
|
||||
|
||||
|
|
|
@ -377,7 +377,7 @@ void exit_score_file_to_score_menu(struct Object *scoreFileButton, s8 scoreButto
|
|||
// Begin exit
|
||||
if (scoreFileButton->oMenuButtonState == MENU_BUTTON_STATE_FULLSCREEN
|
||||
&& sCursorClickingTimer == 2) {
|
||||
play_sound(SOUND_MENU_CAMERA_ZOOM_OUT, gDefaultSoundArgs);
|
||||
play_sound(SOUND_MENU_CAMERA_ZOOM_OUT, gGlobalSoundSource);
|
||||
scoreFileButton->oMenuButtonState = MENU_BUTTON_STATE_SHRINKING;
|
||||
}
|
||||
// End exit
|
||||
|
@ -469,7 +469,7 @@ void check_score_menu_clicked_buttons(struct Object *scoreButton) {
|
|||
// If menu button clicked, select it
|
||||
if (buttonID == MENU_BUTTON_SCORE_RETURN || buttonID == MENU_BUTTON_SCORE_COPY_FILE
|
||||
|| buttonID == MENU_BUTTON_SCORE_ERASE_FILE) {
|
||||
play_sound(SOUND_MENU_CLICK_FILE_SELECT, gDefaultSoundArgs);
|
||||
play_sound(SOUND_MENU_CLICK_FILE_SELECT, gGlobalSoundSource);
|
||||
sMainMenuButtons[buttonID]->oMenuButtonState = MENU_BUTTON_STATE_ZOOM_IN_OUT;
|
||||
sSelectedButtonID = buttonID;
|
||||
}
|
||||
|
@ -477,13 +477,13 @@ void check_score_menu_clicked_buttons(struct Object *scoreButton) {
|
|||
if (sMainMenuTimer >= SCORE_TIMER) {
|
||||
// If clicked in a existing save file, select it too see it's score
|
||||
if (save_file_exists(buttonID - MENU_BUTTON_SCORE_MIN) == TRUE) {
|
||||
play_sound(SOUND_MENU_CAMERA_ZOOM_IN, gDefaultSoundArgs);
|
||||
play_sound(SOUND_MENU_CAMERA_ZOOM_IN, gGlobalSoundSource);
|
||||
sMainMenuButtons[buttonID]->oMenuButtonState = MENU_BUTTON_STATE_GROWING;
|
||||
sSelectedButtonID = buttonID;
|
||||
}
|
||||
else {
|
||||
// If clicked in a non-existing save file, play buzz sound
|
||||
play_sound(SOUND_MENU_CAMERA_BUZZ, gDefaultSoundArgs);
|
||||
play_sound(SOUND_MENU_CAMERA_BUZZ, gGlobalSoundSource);
|
||||
sMainMenuButtons[buttonID]->oMenuButtonState =
|
||||
MENU_BUTTON_STATE_ZOOM_IN_OUT;
|
||||
if (sMainMenuTimer >= SCORE_TIMER) {
|
||||
|
@ -576,7 +576,7 @@ void copy_action_file_button(struct Object *copyButton, s32 copyFileButtonID) {
|
|||
}
|
||||
if (save_file_exists(copyFileButtonID - MENU_BUTTON_COPY_MIN) == TRUE) {
|
||||
// If clicked in a existing save file, ask where it wants to copy
|
||||
play_sound(SOUND_MENU_CLICK_FILE_SELECT, gDefaultSoundArgs);
|
||||
play_sound(SOUND_MENU_CLICK_FILE_SELECT, gGlobalSoundSource);
|
||||
sMainMenuButtons[copyFileButtonID]->oMenuButtonState = MENU_BUTTON_STATE_ZOOM_IN;
|
||||
sSelectedFileIndex = copyFileButtonID - MENU_BUTTON_COPY_MIN;
|
||||
copyButton->oMenuButtonActionPhase = COPY_PHASE_COPY_WHERE;
|
||||
|
@ -584,7 +584,7 @@ void copy_action_file_button(struct Object *copyButton, s32 copyFileButtonID) {
|
|||
sMainMenuTimer = 0;
|
||||
} else {
|
||||
// If clicked in a non-existing save file, play buzz sound
|
||||
play_sound(SOUND_MENU_CAMERA_BUZZ, gDefaultSoundArgs);
|
||||
play_sound(SOUND_MENU_CAMERA_BUZZ, gGlobalSoundSource);
|
||||
sMainMenuButtons[copyFileButtonID]->oMenuButtonState = MENU_BUTTON_STATE_ZOOM_IN_OUT;
|
||||
if (sMainMenuTimer >= BUZZ_TIMER) {
|
||||
sFadeOutText = TRUE;
|
||||
|
@ -596,7 +596,7 @@ void copy_action_file_button(struct Object *copyButton, s32 copyFileButtonID) {
|
|||
sMainMenuButtons[copyFileButtonID]->oMenuButtonState = MENU_BUTTON_STATE_ZOOM_IN_OUT;
|
||||
if (save_file_exists(copyFileButtonID - MENU_BUTTON_COPY_MIN) == FALSE) {
|
||||
// If clicked in a non-existing save file, copy the file
|
||||
play_sound(SOUND_MENU_STAR_SOUND, gDefaultSoundArgs);
|
||||
play_sound(SOUND_MENU_STAR_SOUND, gGlobalSoundSource);
|
||||
copyButton->oMenuButtonActionPhase = COPY_PHASE_COPY_COMPLETE;
|
||||
sFadeOutText = TRUE;
|
||||
sMainMenuTimer = 0;
|
||||
|
@ -608,7 +608,7 @@ void copy_action_file_button(struct Object *copyButton, s32 copyFileButtonID) {
|
|||
} else {
|
||||
// If clicked in a existing save file, play buzz sound
|
||||
if (MENU_BUTTON_COPY_FILE_A + sSelectedFileIndex == copyFileButtonID) {
|
||||
play_sound(SOUND_MENU_CAMERA_BUZZ, gDefaultSoundArgs);
|
||||
play_sound(SOUND_MENU_CAMERA_BUZZ, gGlobalSoundSource);
|
||||
sMainMenuButtons[MENU_BUTTON_COPY_FILE_A + sSelectedFileIndex]->oMenuButtonState =
|
||||
MENU_BUTTON_STATE_ZOOM_OUT;
|
||||
copyButton->oMenuButtonActionPhase = COPY_PHASE_MAIN;
|
||||
|
@ -648,7 +648,7 @@ void check_copy_menu_clicked_buttons(struct Object *copyButton) {
|
|||
if (buttonID == MENU_BUTTON_COPY_RETURN || buttonID == MENU_BUTTON_COPY_CHECK_SCORE
|
||||
|| buttonID == MENU_BUTTON_COPY_ERASE_FILE) {
|
||||
if (copyButton->oMenuButtonActionPhase == COPY_PHASE_MAIN) {
|
||||
play_sound(SOUND_MENU_CLICK_FILE_SELECT, gDefaultSoundArgs);
|
||||
play_sound(SOUND_MENU_CLICK_FILE_SELECT, gGlobalSoundSource);
|
||||
sMainMenuButtons[buttonID]->oMenuButtonState = MENU_BUTTON_STATE_ZOOM_IN_OUT;
|
||||
sSelectedButtonID = buttonID;
|
||||
}
|
||||
|
@ -743,7 +743,7 @@ void erase_action_file_button(struct Object *eraseButton, s32 eraseFileButtonID)
|
|||
case ERASE_PHASE_MAIN: // Erase Menu Main Phase
|
||||
if (save_file_exists(eraseFileButtonID - MENU_BUTTON_ERASE_MIN) == TRUE) {
|
||||
// If clicked in a existing save file, ask if it wants to delete it
|
||||
play_sound(SOUND_MENU_CLICK_FILE_SELECT, gDefaultSoundArgs);
|
||||
play_sound(SOUND_MENU_CLICK_FILE_SELECT, gGlobalSoundSource);
|
||||
sMainMenuButtons[eraseFileButtonID]->oMenuButtonState = MENU_BUTTON_STATE_ZOOM_IN;
|
||||
sSelectedFileIndex = eraseFileButtonID - MENU_BUTTON_ERASE_MIN;
|
||||
eraseButton->oMenuButtonActionPhase = ERASE_PHASE_PROMPT;
|
||||
|
@ -751,7 +751,7 @@ void erase_action_file_button(struct Object *eraseButton, s32 eraseFileButtonID)
|
|||
sMainMenuTimer = 0;
|
||||
} else {
|
||||
// If clicked in a non-existing save file, play buzz sound
|
||||
play_sound(SOUND_MENU_CAMERA_BUZZ, gDefaultSoundArgs);
|
||||
play_sound(SOUND_MENU_CAMERA_BUZZ, gGlobalSoundSource);
|
||||
sMainMenuButtons[eraseFileButtonID]->oMenuButtonState = MENU_BUTTON_STATE_ZOOM_IN_OUT;
|
||||
|
||||
if (sMainMenuTimer >= BUZZ_TIMER) {
|
||||
|
@ -765,7 +765,7 @@ void erase_action_file_button(struct Object *eraseButton, s32 eraseFileButtonID)
|
|||
// If clicked in a existing save file, play click sound and zoom out button
|
||||
// Note: The prompt functions are actually called when the ERASE_MSG_PROMPT
|
||||
// message is displayed with print_erase_menu_prompt
|
||||
play_sound(SOUND_MENU_CLICK_FILE_SELECT, gDefaultSoundArgs);
|
||||
play_sound(SOUND_MENU_CLICK_FILE_SELECT, gGlobalSoundSource);
|
||||
sMainMenuButtons[MENU_BUTTON_ERASE_MIN + sSelectedFileIndex]->oMenuButtonState =
|
||||
MENU_BUTTON_STATE_ZOOM_OUT;
|
||||
eraseButton->oMenuButtonActionPhase = ERASE_PHASE_MAIN;
|
||||
|
@ -792,7 +792,7 @@ void check_erase_menu_clicked_buttons(struct Object *eraseButton) {
|
|||
if (buttonID == MENU_BUTTON_ERASE_RETURN || buttonID == MENU_BUTTON_ERASE_CHECK_SCORE
|
||||
|| buttonID == MENU_BUTTON_ERASE_COPY_FILE) {
|
||||
if (eraseButton->oMenuButtonActionPhase == ERASE_PHASE_MAIN) {
|
||||
play_sound(SOUND_MENU_CLICK_FILE_SELECT, gDefaultSoundArgs);
|
||||
play_sound(SOUND_MENU_CLICK_FILE_SELECT, gGlobalSoundSource);
|
||||
sMainMenuButtons[buttonID]->oMenuButtonState = MENU_BUTTON_STATE_ZOOM_IN_OUT;
|
||||
sSelectedButtonID = buttonID;
|
||||
}
|
||||
|
@ -884,7 +884,7 @@ void check_sound_mode_menu_clicked_buttons(struct Object *soundModeButton) {
|
|||
if (buttonID == MENU_BUTTON_STEREO || buttonID == MENU_BUTTON_MONO
|
||||
|| buttonID == MENU_BUTTON_HEADSET) {
|
||||
if (soundModeButton->oMenuButtonActionPhase == SOUND_MODE_PHASE_MAIN) {
|
||||
play_sound(SOUND_MENU_CLICK_FILE_SELECT, gDefaultSoundArgs);
|
||||
play_sound(SOUND_MENU_CLICK_FILE_SELECT, gGlobalSoundSource);
|
||||
sMainMenuButtons[buttonID]->oMenuButtonState = MENU_BUTTON_STATE_ZOOM_IN_OUT;
|
||||
// Sound menu buttons don't return to Main Menu in EU
|
||||
// because they don't have a case in bhv_menu_button_manager_loop
|
||||
|
@ -922,7 +922,7 @@ void return_to_main_menu(s16 prevMenuButtonID, struct Object *sourceButton) {
|
|||
// play zoom out sound and shrink previous menu
|
||||
if (sourceButton->oMenuButtonState == MENU_BUTTON_STATE_DEFAULT
|
||||
&& sMainMenuButtons[prevMenuButtonID]->oMenuButtonState == MENU_BUTTON_STATE_FULLSCREEN) {
|
||||
play_sound(SOUND_MENU_CAMERA_ZOOM_OUT, gDefaultSoundArgs);
|
||||
play_sound(SOUND_MENU_CAMERA_ZOOM_OUT, gGlobalSoundSource);
|
||||
sMainMenuButtons[prevMenuButtonID]->oMenuButtonState = MENU_BUTTON_STATE_SHRINKING;
|
||||
sCurrentMenuLevel = MENU_LAYER_MAIN;
|
||||
}
|
||||
|
@ -962,7 +962,7 @@ void load_score_menu_from_submenu(s16 prevMenuButtonID, struct Object *sourceBut
|
|||
// play zoom out sound and shrink previous menu
|
||||
if (sourceButton->oMenuButtonState == MENU_BUTTON_STATE_DEFAULT
|
||||
&& sMainMenuButtons[prevMenuButtonID]->oMenuButtonState == MENU_BUTTON_STATE_FULLSCREEN) {
|
||||
play_sound(SOUND_MENU_CAMERA_ZOOM_OUT, gDefaultSoundArgs);
|
||||
play_sound(SOUND_MENU_CAMERA_ZOOM_OUT, gGlobalSoundSource);
|
||||
sMainMenuButtons[prevMenuButtonID]->oMenuButtonState = MENU_BUTTON_STATE_SHRINKING;
|
||||
sCurrentMenuLevel = MENU_LAYER_MAIN;
|
||||
}
|
||||
|
@ -988,7 +988,7 @@ void load_score_menu_from_submenu(s16 prevMenuButtonID, struct Object *sourceBut
|
|||
}
|
||||
// Play zoom in sound, select score menu and render it's buttons
|
||||
sSelectedButtonID = MENU_BUTTON_SCORE;
|
||||
play_sound(SOUND_MENU_CAMERA_ZOOM_IN, gDefaultSoundArgs);
|
||||
play_sound(SOUND_MENU_CAMERA_ZOOM_IN, gGlobalSoundSource);
|
||||
sMainMenuButtons[MENU_BUTTON_SCORE]->oMenuButtonState = MENU_BUTTON_STATE_GROWING;
|
||||
render_score_menu_buttons(sMainMenuButtons[MENU_BUTTON_SCORE]);
|
||||
}
|
||||
|
@ -1003,7 +1003,7 @@ void load_copy_menu_from_submenu(s16 prevMenuButtonID, struct Object *sourceButt
|
|||
// play zoom out sound and shrink previous menu
|
||||
if (sourceButton->oMenuButtonState == MENU_BUTTON_STATE_DEFAULT
|
||||
&& sMainMenuButtons[prevMenuButtonID]->oMenuButtonState == MENU_BUTTON_STATE_FULLSCREEN) {
|
||||
play_sound(SOUND_MENU_CAMERA_ZOOM_OUT, gDefaultSoundArgs);
|
||||
play_sound(SOUND_MENU_CAMERA_ZOOM_OUT, gGlobalSoundSource);
|
||||
sMainMenuButtons[prevMenuButtonID]->oMenuButtonState = MENU_BUTTON_STATE_SHRINKING;
|
||||
sCurrentMenuLevel = MENU_LAYER_MAIN;
|
||||
}
|
||||
|
@ -1029,7 +1029,7 @@ void load_copy_menu_from_submenu(s16 prevMenuButtonID, struct Object *sourceButt
|
|||
}
|
||||
// Play zoom in sound, select copy menu and render it's buttons
|
||||
sSelectedButtonID = MENU_BUTTON_COPY;
|
||||
play_sound(SOUND_MENU_CAMERA_ZOOM_IN, gDefaultSoundArgs);
|
||||
play_sound(SOUND_MENU_CAMERA_ZOOM_IN, gGlobalSoundSource);
|
||||
sMainMenuButtons[MENU_BUTTON_COPY]->oMenuButtonState = MENU_BUTTON_STATE_GROWING;
|
||||
render_copy_menu_buttons(sMainMenuButtons[MENU_BUTTON_COPY]);
|
||||
}
|
||||
|
@ -1044,7 +1044,7 @@ void load_erase_menu_from_submenu(s16 prevMenuButtonID, struct Object *sourceBut
|
|||
// play zoom out sound and shrink previous menu
|
||||
if (sourceButton->oMenuButtonState == MENU_BUTTON_STATE_DEFAULT
|
||||
&& sMainMenuButtons[prevMenuButtonID]->oMenuButtonState == MENU_BUTTON_STATE_FULLSCREEN) {
|
||||
play_sound(SOUND_MENU_CAMERA_ZOOM_OUT, gDefaultSoundArgs);
|
||||
play_sound(SOUND_MENU_CAMERA_ZOOM_OUT, gGlobalSoundSource);
|
||||
sMainMenuButtons[prevMenuButtonID]->oMenuButtonState = MENU_BUTTON_STATE_SHRINKING;
|
||||
sCurrentMenuLevel = MENU_LAYER_MAIN;
|
||||
}
|
||||
|
@ -1070,7 +1070,7 @@ void load_erase_menu_from_submenu(s16 prevMenuButtonID, struct Object *sourceBut
|
|||
}
|
||||
// Play zoom in sound, select erase menu and render it's buttons
|
||||
sSelectedButtonID = MENU_BUTTON_ERASE;
|
||||
play_sound(SOUND_MENU_CAMERA_ZOOM_IN, gDefaultSoundArgs);
|
||||
play_sound(SOUND_MENU_CAMERA_ZOOM_IN, gGlobalSoundSource);
|
||||
sMainMenuButtons[MENU_BUTTON_ERASE]->oMenuButtonState = MENU_BUTTON_STATE_GROWING;
|
||||
render_erase_menu_buttons(sMainMenuButtons[MENU_BUTTON_ERASE]);
|
||||
}
|
||||
|
@ -1193,32 +1193,32 @@ void check_main_menu_clicked_buttons(void) {
|
|||
// Play sound of the save file clicked
|
||||
switch (sSelectedButtonID) {
|
||||
case MENU_BUTTON_PLAY_FILE_A:
|
||||
play_sound(SAVE_FILE_SOUND, gDefaultSoundArgs);
|
||||
play_sound(SAVE_FILE_SOUND, gGlobalSoundSource);
|
||||
break;
|
||||
case MENU_BUTTON_PLAY_FILE_B:
|
||||
play_sound(SAVE_FILE_SOUND, gDefaultSoundArgs);
|
||||
play_sound(SAVE_FILE_SOUND, gGlobalSoundSource);
|
||||
break;
|
||||
case MENU_BUTTON_PLAY_FILE_C:
|
||||
play_sound(SAVE_FILE_SOUND, gDefaultSoundArgs);
|
||||
play_sound(SAVE_FILE_SOUND, gGlobalSoundSource);
|
||||
break;
|
||||
case MENU_BUTTON_PLAY_FILE_D:
|
||||
play_sound(SAVE_FILE_SOUND, gDefaultSoundArgs);
|
||||
play_sound(SAVE_FILE_SOUND, gGlobalSoundSource);
|
||||
break;
|
||||
// Play sound of the button clicked and render buttons of that menu.
|
||||
case MENU_BUTTON_SCORE:
|
||||
play_sound(SOUND_MENU_CAMERA_ZOOM_IN, gDefaultSoundArgs);
|
||||
play_sound(SOUND_MENU_CAMERA_ZOOM_IN, gGlobalSoundSource);
|
||||
render_score_menu_buttons(sMainMenuButtons[MENU_BUTTON_SCORE]);
|
||||
break;
|
||||
case MENU_BUTTON_COPY:
|
||||
play_sound(SOUND_MENU_CAMERA_ZOOM_IN, gDefaultSoundArgs);
|
||||
play_sound(SOUND_MENU_CAMERA_ZOOM_IN, gGlobalSoundSource);
|
||||
render_copy_menu_buttons(sMainMenuButtons[MENU_BUTTON_COPY]);
|
||||
break;
|
||||
case MENU_BUTTON_ERASE:
|
||||
play_sound(SOUND_MENU_CAMERA_ZOOM_IN, gDefaultSoundArgs);
|
||||
play_sound(SOUND_MENU_CAMERA_ZOOM_IN, gGlobalSoundSource);
|
||||
render_erase_menu_buttons(sMainMenuButtons[MENU_BUTTON_ERASE]);
|
||||
break;
|
||||
case MENU_BUTTON_SOUND_MODE:
|
||||
play_sound(SOUND_MENU_CAMERA_ZOOM_IN, gDefaultSoundArgs);
|
||||
play_sound(SOUND_MENU_CAMERA_ZOOM_IN, gGlobalSoundSource);
|
||||
render_sound_mode_menu_buttons(sMainMenuButtons[MENU_BUTTON_SOUND_MODE]);
|
||||
break;
|
||||
}
|
||||
|
@ -1372,7 +1372,7 @@ void handle_cursor_button_input(void) {
|
|||
sCursorClickingTimer = 1;
|
||||
} else if (gPlayer3Controller->buttonPressed & A_BUTTON) {
|
||||
sScoreFileCoinScoreMode = 1 - sScoreFileCoinScoreMode;
|
||||
play_sound(SOUND_MENU_CLICK_FILE_SELECT, gDefaultSoundArgs);
|
||||
play_sound(SOUND_MENU_CLICK_FILE_SELECT, gGlobalSoundSource);
|
||||
}
|
||||
} else { // If cursor is clicked
|
||||
if (gPlayer3Controller->buttonPressed
|
||||
|
@ -1825,7 +1825,7 @@ void print_erase_menu_prompt(s16 x, s16 y) {
|
|||
if (sCursorClickingTimer == 2) {
|
||||
// ..and is hovering "YES", delete file
|
||||
if (sEraseYesNoHoverState == MENU_ERASE_HOVER_YES) {
|
||||
play_sound(SOUND_MARIO_WAAAOOOW, gDefaultSoundArgs);
|
||||
play_sound(SOUND_MARIO_WAAAOOOW, gGlobalSoundSource);
|
||||
sMainMenuButtons[MENU_BUTTON_ERASE]->oMenuButtonActionPhase = ERASE_PHASE_MARIO_ERASED;
|
||||
sFadeOutText = TRUE;
|
||||
sMainMenuTimer = 0;
|
||||
|
@ -1837,7 +1837,7 @@ void print_erase_menu_prompt(s16 x, s16 y) {
|
|||
sEraseYesNoHoverState = MENU_ERASE_HOVER_NONE;
|
||||
// ..and is hovering "NO", return back to main phase
|
||||
} else if (sEraseYesNoHoverState == MENU_ERASE_HOVER_NO) {
|
||||
play_sound(SOUND_MENU_CLICK_FILE_SELECT, gDefaultSoundArgs);
|
||||
play_sound(SOUND_MENU_CLICK_FILE_SELECT, gGlobalSoundSource);
|
||||
sMainMenuButtons[MENU_BUTTON_ERASE_MIN + sSelectedFileIndex]->oMenuButtonState =
|
||||
MENU_BUTTON_STATE_ZOOM_OUT;
|
||||
sMainMenuButtons[MENU_BUTTON_ERASE]->oMenuButtonActionPhase = ERASE_PHASE_MAIN;
|
||||
|
|
|
@ -122,7 +122,7 @@ s16 level_select_input_loop(void) {
|
|||
|
||||
// if the stage was changed, play the sound for changing a stage.
|
||||
if (stageChanged) {
|
||||
play_sound(SOUND_GENERAL_LEVEL_SELECT_CHANGE, gDefaultSoundArgs);
|
||||
play_sound(SOUND_GENERAL_LEVEL_SELECT_CHANGE, gGlobalSoundSource);
|
||||
}
|
||||
|
||||
// TODO: enum counts for the stage lists
|
||||
|
@ -151,7 +151,7 @@ s16 level_select_input_loop(void) {
|
|||
gDebugLevelSelect = 0;
|
||||
return -1;
|
||||
}
|
||||
play_sound(SOUND_MENU_STAR_SOUND, gDefaultSoundArgs);
|
||||
play_sound(SOUND_MENU_STAR_SOUND, gGlobalSoundSource);
|
||||
return gCurrLevelNum;
|
||||
}
|
||||
return 0;
|
||||
|
@ -163,16 +163,16 @@ int intro_default(void) {
|
|||
|
||||
#ifndef VERSION_JP
|
||||
if (D_U_801A7C34 == 1) {
|
||||
play_sound(SOUND_MARIO_HELLO, gDefaultSoundArgs);
|
||||
play_sound(SOUND_MARIO_HELLO, gGlobalSoundSource);
|
||||
D_U_801A7C34 = 0;
|
||||
}
|
||||
#endif
|
||||
print_intro_text();
|
||||
|
||||
if (gPlayer1Controller->buttonPressed & START_BUTTON) {
|
||||
play_sound(SOUND_MENU_STAR_SOUND, gDefaultSoundArgs);
|
||||
play_sound(SOUND_MENU_STAR_SOUND, gGlobalSoundSource);
|
||||
sp1C = 100 + gDebugLevelSelect;
|
||||
#ifndef VERSION_JP
|
||||
#ifndef VERSION_JP
|
||||
D_U_801A7C34 = 1;
|
||||
#endif
|
||||
}
|
||||
|
@ -184,7 +184,7 @@ int intro_game_over(void) {
|
|||
|
||||
#ifndef VERSION_JP
|
||||
if (gameOverNotPlayed == 1) {
|
||||
play_sound(SOUND_MARIO_GAME_OVER, gDefaultSoundArgs);
|
||||
play_sound(SOUND_MARIO_GAME_OVER, gGlobalSoundSource);
|
||||
gameOverNotPlayed = 0;
|
||||
}
|
||||
#endif
|
||||
|
@ -192,7 +192,7 @@ int intro_game_over(void) {
|
|||
print_intro_text();
|
||||
|
||||
if (gPlayer1Controller->buttonPressed & START_BUTTON) {
|
||||
play_sound(SOUND_MENU_STAR_SOUND, gDefaultSoundArgs);
|
||||
play_sound(SOUND_MENU_STAR_SOUND, gGlobalSoundSource);
|
||||
sp1C = 100 + gDebugLevelSelect;
|
||||
#ifndef VERSION_JP
|
||||
gameOverNotPlayed = 1;
|
||||
|
@ -203,7 +203,7 @@ int intro_game_over(void) {
|
|||
|
||||
int intro_play_its_a_me_mario(void) {
|
||||
set_background_music(0, SEQ_SOUND_PLAYER, 0);
|
||||
play_sound(SOUND_MENU_COIN_ITS_A_ME_MARIO, gDefaultSoundArgs);
|
||||
play_sound(SOUND_MENU_COIN_ITS_A_ME_MARIO, gGlobalSoundSource);
|
||||
return 1;
|
||||
}
|
||||
|
||||
|
|
|
@ -364,9 +364,9 @@ s32 lvl_update_obj_and_load_act_button_actions(UNUSED s32 arg, UNUSED s32 unused
|
|||
if ((gPlayer3Controller->buttonPressed & (A_BUTTON | START_BUTTON | B_BUTTON | Z_TRIG))) {
|
||||
#endif
|
||||
#if defined(VERSION_JP) || defined(VERSION_SH)
|
||||
play_sound(SOUND_MENU_STAR_SOUND, gDefaultSoundArgs);
|
||||
play_sound(SOUND_MENU_STAR_SOUND, gGlobalSoundSource);
|
||||
#else
|
||||
play_sound(SOUND_MENU_STAR_SOUND_LETS_A_GO, gDefaultSoundArgs);
|
||||
play_sound(SOUND_MENU_STAR_SOUND_LETS_A_GO, gGlobalSoundSource);
|
||||
#endif
|
||||
if (sInitSelectedActNum >= sSelectedActIndex + 1) {
|
||||
sLoadedActNum = sSelectedActIndex + 1;
|
||||
|
|
|
@ -33,13 +33,13 @@ int categoryIndex = 0;
|
|||
void MoonOptMain::setCategory(int index){
|
||||
MoonCategory *cat = categories[index];
|
||||
this->widgets = cat->catOptions;
|
||||
play_sound(SOUND_MENU_CHANGE_SELECT, gDefaultSoundArgs);
|
||||
play_sound(SOUND_MENU_CHANGE_SELECT, gGlobalSoundSource);
|
||||
MoonScreen::Mount();
|
||||
}
|
||||
|
||||
void MoonOptMain::Init(){
|
||||
this->useMouseInstead = true;
|
||||
play_sound(SOUND_MENU_CHANGE_SELECT, gDefaultSoundArgs);
|
||||
play_sound(SOUND_MENU_CHANGE_SELECT, gGlobalSoundSource);
|
||||
}
|
||||
|
||||
void MoonOptMain::Mount(){
|
||||
|
@ -98,5 +98,5 @@ void MoonOptMain::Draw(){
|
|||
|
||||
void MoonOptMain::Dispose(){
|
||||
configfile_save(configfile_name());
|
||||
play_sound(SOUND_MENU_CHANGE_SELECT, gDefaultSoundArgs);
|
||||
play_sound(SOUND_MENU_CHANGE_SELECT, gGlobalSoundSource);
|
||||
}
|
Loading…
Reference in New Issue