You've already forked ultrasm64-2
mirror of
https://github.com/HackerN64/ultrasm64-2.git
synced 2026-01-21 10:38:08 -08:00
Refresh 16
This commit is contained in:
@@ -1,7 +1,7 @@
|
||||
#include "internal.h"
|
||||
#include "data.h"
|
||||
|
||||
#ifdef VERSION_SH
|
||||
#if defined(VERSION_SH) || defined(VERSION_CN)
|
||||
|
||||
struct ReverbSettingsEU sReverbSettings[] = {
|
||||
{0x01, 0x30, 0x2fff, 0x0000, 0x0000, -1, 0x3000, 0x0000, 0x0000},
|
||||
|
||||
@@ -100,7 +100,7 @@ u16 gAudioCosineTable[128] = {
|
||||
// Transforms a pitch scale factor in -127..127 into a frequency scale factor
|
||||
// between -1 and +1 octave.
|
||||
// gPitchBendFrequencyScale[k] = 0.5 * 2^(k/127)
|
||||
#ifndef VERSION_SH
|
||||
#if !defined(VERSION_SH) && !defined(VERSION_CN)
|
||||
#if defined(VERSION_EU)
|
||||
f32 gPitchBendFrequencyScale[256] = {
|
||||
0.5f,
|
||||
@@ -186,7 +186,7 @@ struct NoteSubEu gZeroNoteSub = { 0 };
|
||||
struct NoteSubEu gDefaultNoteSub = { 1, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, { NULL } };
|
||||
#endif
|
||||
|
||||
#if defined(VERSION_EU) || defined(VERSION_SH)
|
||||
#if defined(VERSION_EU) || defined(VERSION_SH) || defined(VERSION_CN)
|
||||
s16 sSawtoothWaves[256] = {
|
||||
0, 1023, 2047, 3071, 4095, 5119, 6143, 7167, 8191, 9215, 10239,
|
||||
11263, 0x2FFF, 13311, 0x37FF, 15359, 0x3FFF, 17407, 0x47FF, 19455, 0x4FFF, 21503,
|
||||
@@ -379,7 +379,7 @@ s16 sSawtoothWave[0x40] = {
|
||||
s16 *gWaveSamples[4] = { sSawtoothWave, sTriangleWave, sSineWave, sSquareWave };
|
||||
#endif
|
||||
|
||||
#ifdef VERSION_SH
|
||||
#if defined(VERSION_SH) || defined(VERSION_CN)
|
||||
s32 unk_sh_data_0[2] = {0, 0};
|
||||
f32 gPitchBendFrequencyScale[256] = {
|
||||
0.5f, 0.5f, 0.502736f, 0.505488f, 0.508254f, 0.511036f, 0.513833f, 0.516645f, 0.519472f,
|
||||
@@ -414,7 +414,7 @@ f32 gPitchBendFrequencyScale[256] = {
|
||||
};
|
||||
#endif
|
||||
|
||||
#ifdef VERSION_SH
|
||||
#if defined(VERSION_SH) || defined(VERSION_CN)
|
||||
f32 unk_sh_data_1[] = {
|
||||
0.890899f, 0.890899f, 0.89171f, 0.892521f, 0.893333f, 0.894146f, 0.89496f, 0.895774f,
|
||||
0.89659f, 0.897406f, 0.898222f, 0.89904f, 0.899858f, 0.900677f, 0.901496f, 0.902317f,
|
||||
@@ -486,7 +486,7 @@ u8 unk_sh_data2[4] = { 0, 0, 0, 0 };
|
||||
struct NoteSubEu gZeroNoteSub = { 0 };
|
||||
struct NoteSubEu gDefaultNoteSub = {
|
||||
1, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, { NULL },
|
||||
#ifdef VERSION_SH
|
||||
#if defined(VERSION_SH) || defined(VERSION_CN)
|
||||
0
|
||||
#endif
|
||||
};
|
||||
@@ -506,11 +506,11 @@ u8 euUnknownData_8030194c[4] = { 0x40, 0x20, 0x10, 0x08 };
|
||||
u16 gHeadsetPanQuantization[0x10] = {
|
||||
0x40, 0x40, 0x30, 0x30, 0x20, 0x20, 0x10, 0, 0, 0,
|
||||
};
|
||||
#elif !defined(VERSION_SH)
|
||||
#elif defined(VERSION_JP) || defined(VERSION_US)
|
||||
u16 gHeadsetPanQuantization[10] = { 0x40, 0x30, 0x20, 0x10, 0, 0, 0, 0, 0, 0 };
|
||||
#endif
|
||||
|
||||
#if defined(VERSION_EU) || defined(VERSION_SH)
|
||||
#if defined(VERSION_EU) || defined(VERSION_SH) || defined(VERSION_CN)
|
||||
s16 euUnknownData_80301950[64] = {
|
||||
0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
|
||||
0, 0, 0, 500, 0, 0, 0, 0, 0, 0, 0, 500, 0, 0, 0, 0, 0, 0, 0, 500, 0, 0, 0, 0, 0, 0, 0, 500, 0, 0, 0, 0,
|
||||
@@ -710,7 +710,7 @@ f32 gVolRampingRhs128[128] = {
|
||||
};
|
||||
#endif
|
||||
|
||||
#ifdef VERSION_SH
|
||||
#if defined(VERSION_SH) || defined(VERSION_CN)
|
||||
u16 unk_sh_data_3[] = {
|
||||
// 30 entries
|
||||
// pattern:
|
||||
@@ -879,7 +879,7 @@ u16 unk_sh_data_4[] = {
|
||||
};
|
||||
#endif
|
||||
|
||||
#ifndef VERSION_SH
|
||||
#if !defined(VERSION_SH) && !defined(VERSION_CN)
|
||||
s16 gTatumsPerBeat = TATUMS_PER_BEAT;
|
||||
s8 gUnusedCount80333EE8 = UNUSED_COUNT_80333EE8;
|
||||
s32 gAudioHeapSize = DOUBLE_SIZE_ON_64_BIT(AUDIO_HEAP_SIZE);
|
||||
@@ -901,7 +901,7 @@ s8 sUnused8033EF8 = 24;
|
||||
|
||||
volatile s32 gAudioFrameCount;
|
||||
|
||||
#if defined(VERSION_EU) || defined(VERSION_SH)
|
||||
#if defined(VERSION_EU) || defined(VERSION_SH) || defined(VERSION_CN)
|
||||
s32 gCurrAudioFrameDmaCount;
|
||||
#else
|
||||
volatile s32 gCurrAudioFrameDmaCount;
|
||||
@@ -916,7 +916,7 @@ u64 *gAudioCmd;
|
||||
struct SPTask *gAudioTask;
|
||||
struct SPTask gAudioTasks[2];
|
||||
|
||||
#if defined(VERSION_EU) || defined(VERSION_SH)
|
||||
#if defined(VERSION_EU) || defined(VERSION_SH) || defined(VERSION_CN)
|
||||
f32 D_EU_802298D0;
|
||||
s32 gRefreshRate;
|
||||
#endif
|
||||
@@ -931,11 +931,11 @@ u16 gUnused80226E98[0x10];
|
||||
|
||||
u32 gAudioRandom;
|
||||
|
||||
#if defined(VERSION_EU) || defined(VERSION_SH)
|
||||
#if defined(VERSION_EU) || defined(VERSION_SH) || defined(VERSION_CN)
|
||||
s32 gAudioErrorFlags;
|
||||
#endif
|
||||
|
||||
#ifdef VERSION_SH
|
||||
#if defined(VERSION_SH) || defined(VERSION_CN)
|
||||
volatile u32 gAudioLoadLockSH;
|
||||
struct EuAudioCmd sAudioCmd[0x100];
|
||||
u8 D_SH_80350F18;
|
||||
|
||||
@@ -13,14 +13,14 @@
|
||||
#define NUMAIBUFFERS 3
|
||||
|
||||
// constant .data
|
||||
#if defined(VERSION_EU) || defined(VERSION_SH)
|
||||
#if defined(VERSION_EU) || defined(VERSION_SH) || defined(VERSION_CN)
|
||||
extern struct AudioSessionSettingsEU gAudioSessionPresets[];
|
||||
#else
|
||||
extern struct AudioSessionSettings gAudioSessionPresets[18];
|
||||
#endif
|
||||
extern u16 D_80332388[128]; // unused
|
||||
|
||||
#if defined(VERSION_EU) || defined(VERSION_SH)
|
||||
#if defined(VERSION_EU) || defined(VERSION_SH) || defined(VERSION_CN)
|
||||
extern f32 gPitchBendFrequencyScale[256];
|
||||
#else
|
||||
extern f32 gPitchBendFrequencyScale[255];
|
||||
@@ -32,14 +32,14 @@ extern u8 gDefaultShortNoteDurationTable[16];
|
||||
extern s8 gVibratoCurve[16];
|
||||
extern struct AdsrEnvelope gDefaultEnvelope[3];
|
||||
|
||||
#if defined(VERSION_EU) || defined(VERSION_SH)
|
||||
#if defined(VERSION_EU) || defined(VERSION_SH) || defined(VERSION_CN)
|
||||
extern s16 gEuUnknownWave7[256];
|
||||
extern s16 *gWaveSamples[6];
|
||||
#else
|
||||
extern s16 *gWaveSamples[4];
|
||||
#endif
|
||||
|
||||
#if defined(VERSION_EU) || defined(VERSION_SH)
|
||||
#if defined(VERSION_EU) || defined(VERSION_SH) || defined(VERSION_CN)
|
||||
extern u8 euUnknownData_8030194c[4];
|
||||
#ifdef VERSION_EU
|
||||
extern u16 gHeadsetPanQuantization[0x10];
|
||||
@@ -74,7 +74,7 @@ extern volatile s32 gAudioLoadLock;
|
||||
extern volatile s32 gAudioFrameCount;
|
||||
|
||||
// number of DMAs performed during this frame
|
||||
#if defined(VERSION_EU) || defined(VERSION_SH)
|
||||
#if defined(VERSION_EU) || defined(VERSION_SH) || defined(VERSION_CN)
|
||||
extern s32 gCurrAudioFrameDmaCount;
|
||||
#else
|
||||
extern volatile s32 gCurrAudioFrameDmaCount;
|
||||
@@ -89,14 +89,14 @@ extern u64 *gAudioCmd;
|
||||
extern struct SPTask *gAudioTask;
|
||||
extern struct SPTask gAudioTasks[2];
|
||||
|
||||
#if defined(VERSION_EU) || defined(VERSION_SH)
|
||||
#if defined(VERSION_EU) || defined(VERSION_SH) || defined(VERSION_CN)
|
||||
extern f32 D_EU_802298D0;
|
||||
extern s32 gRefreshRate;
|
||||
#endif
|
||||
|
||||
extern s16 *gAiBuffers[NUMAIBUFFERS];
|
||||
extern s16 gAiBufferLengths[NUMAIBUFFERS];
|
||||
#if defined(VERSION_SH)
|
||||
#if defined(VERSION_SH) || defined(VERSION_CN)
|
||||
#define AIBUFFER_LEN 0xb00
|
||||
#elif defined(VERSION_EU)
|
||||
#define AIBUFFER_LEN (0xa0 * 17)
|
||||
@@ -109,7 +109,7 @@ extern u16 gUnused80226E98[0x10];
|
||||
|
||||
extern u32 gAudioRandom;
|
||||
|
||||
#ifdef VERSION_SH
|
||||
#if defined(VERSION_SH) || defined(VERSION_CN)
|
||||
extern f32 unk_sh_data_1[];
|
||||
|
||||
extern volatile u32 gAudioLoadLockSH;
|
||||
@@ -134,7 +134,7 @@ extern OSMesgQueue D_SH_80350F90; // address written to D_SH_80350F90
|
||||
extern OSMesgQueue *D_SH_80350FA8;
|
||||
#endif
|
||||
|
||||
#if defined(VERSION_EU) || defined(VERSION_SH)
|
||||
#if defined(VERSION_EU) || defined(VERSION_SH) || defined(VERSION_CN)
|
||||
#define UNUSED_COUNT_80333EE8 24
|
||||
#define AUDIO_HEAP_SIZE 0x2c500
|
||||
#define AUDIO_INIT_POOL_SIZE 0x2c00
|
||||
@@ -144,7 +144,7 @@ extern OSMesgQueue *D_SH_80350FA8;
|
||||
#define AUDIO_INIT_POOL_SIZE 0x2500
|
||||
#endif
|
||||
|
||||
#ifdef VERSION_SH
|
||||
#if defined(VERSION_SH) || defined(VERSION_CN)
|
||||
extern u32 D_SH_80315EF0;
|
||||
extern u16 D_SH_80315EF4;
|
||||
extern u16 D_SH_80315EF8;
|
||||
|
||||
@@ -11,7 +11,7 @@
|
||||
#define US_FLOAT2(x) x
|
||||
#endif
|
||||
|
||||
#if defined(VERSION_EU) || defined(VERSION_SH)
|
||||
#if defined(VERSION_EU) || defined(VERSION_SH) || defined(VERSION_CN)
|
||||
void sequence_channel_process_sound(struct SequenceChannel *seqChannel, s32 recalculateVolume) {
|
||||
f32 channelVolume;
|
||||
s32 i;
|
||||
@@ -21,7 +21,7 @@ void sequence_channel_process_sound(struct SequenceChannel *seqChannel, s32 reca
|
||||
if (seqChannel->seqPlayer->muted && (seqChannel->muteBehavior & MUTE_BEHAVIOR_SOFTEN) != 0) {
|
||||
channelVolume = seqChannel->seqPlayer->muteVolumeScale * channelVolume;
|
||||
}
|
||||
#ifdef VERSION_SH
|
||||
#if defined(VERSION_SH) || defined(VERSION_CN)
|
||||
seqChannel->appliedVolume = channelVolume * channelVolume;
|
||||
#else
|
||||
seqChannel->appliedVolume = channelVolume;
|
||||
@@ -32,7 +32,7 @@ void sequence_channel_process_sound(struct SequenceChannel *seqChannel, s32 reca
|
||||
seqChannel->pan = seqChannel->newPan * seqChannel->panChannelWeight;
|
||||
}
|
||||
|
||||
for (i = 0; i < 4; ++i) {
|
||||
for (i = 0; i < 4; i++) {
|
||||
struct SequenceChannelLayer *layer = seqChannel->layers[i];
|
||||
if (layer != NULL && layer->enabled && layer->note != NULL) {
|
||||
if (layer->notePropertiesNeedInit) {
|
||||
@@ -86,7 +86,7 @@ void sequence_player_process_sound(struct SequencePlayer *seqPlayer) {
|
||||
|
||||
if (seqPlayer->fadeRemainingFrames != 0) {
|
||||
seqPlayer->fadeVolume += seqPlayer->fadeVelocity;
|
||||
#if defined(VERSION_EU) || defined(VERSION_SH)
|
||||
#if defined(VERSION_EU) || defined(VERSION_SH) || defined(VERSION_CN)
|
||||
seqPlayer->recalculateVolume = TRUE;
|
||||
#endif
|
||||
|
||||
@@ -98,7 +98,7 @@ void sequence_player_process_sound(struct SequencePlayer *seqPlayer) {
|
||||
}
|
||||
|
||||
if (--seqPlayer->fadeRemainingFrames == 0) {
|
||||
#if defined(VERSION_EU) || defined(VERSION_SH)
|
||||
#if defined(VERSION_EU) || defined(VERSION_SH) || defined(VERSION_CN)
|
||||
if (seqPlayer->state == 2) {
|
||||
sequence_player_disable(seqPlayer);
|
||||
return;
|
||||
@@ -121,7 +121,7 @@ void sequence_player_process_sound(struct SequencePlayer *seqPlayer) {
|
||||
}
|
||||
}
|
||||
|
||||
#if defined(VERSION_EU) || defined(VERSION_SH)
|
||||
#if defined(VERSION_EU) || defined(VERSION_SH) || defined(VERSION_CN)
|
||||
if (seqPlayer->recalculateVolume) {
|
||||
seqPlayer->appliedFadeVolume = seqPlayer->fadeVolume * seqPlayer->fadeVolumeScale;
|
||||
}
|
||||
@@ -131,7 +131,7 @@ void sequence_player_process_sound(struct SequencePlayer *seqPlayer) {
|
||||
for (i = 0; i < CHANNELS_MAX; i++) {
|
||||
if (IS_SEQUENCE_CHANNEL_VALID(seqPlayer->channels[i]) == TRUE
|
||||
&& seqPlayer->channels[i]->enabled == TRUE) {
|
||||
#if defined(VERSION_EU) || defined(VERSION_SH)
|
||||
#if defined(VERSION_EU) || defined(VERSION_SH) || defined(VERSION_CN)
|
||||
sequence_channel_process_sound(seqPlayer->channels[i], seqPlayer->recalculateVolume);
|
||||
#else
|
||||
sequence_channel_process_sound(seqPlayer->channels[i]);
|
||||
@@ -139,7 +139,7 @@ void sequence_player_process_sound(struct SequencePlayer *seqPlayer) {
|
||||
}
|
||||
}
|
||||
|
||||
#if defined(VERSION_EU) || defined(VERSION_SH)
|
||||
#if defined(VERSION_EU) || defined(VERSION_SH) || defined(VERSION_CN)
|
||||
seqPlayer->recalculateVolume = FALSE;
|
||||
#endif
|
||||
}
|
||||
@@ -156,7 +156,7 @@ f32 get_portamento_freq_scale(struct Portamento *p) {
|
||||
p->cur += p->speed;
|
||||
v0 = (u32) p->cur;
|
||||
|
||||
#if defined(VERSION_EU) || defined(VERSION_SH)
|
||||
#if defined(VERSION_EU) || defined(VERSION_SH) || defined(VERSION_CN)
|
||||
if (v0 > 127)
|
||||
#else
|
||||
if (v0 >= 127)
|
||||
@@ -165,7 +165,7 @@ f32 get_portamento_freq_scale(struct Portamento *p) {
|
||||
v0 = 127;
|
||||
}
|
||||
|
||||
#if defined(VERSION_EU) || defined(VERSION_SH)
|
||||
#if defined(VERSION_EU) || defined(VERSION_SH) || defined(VERSION_CN)
|
||||
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));
|
||||
@@ -173,7 +173,7 @@ f32 get_portamento_freq_scale(struct Portamento *p) {
|
||||
return result;
|
||||
}
|
||||
|
||||
#if defined(VERSION_EU) || defined(VERSION_SH)
|
||||
#if defined(VERSION_EU) || defined(VERSION_SH) || defined(VERSION_CN)
|
||||
s16 get_vibrato_pitch_change(struct VibratoState *vib) {
|
||||
s32 index;
|
||||
vib->time += (s32) vib->rate;
|
||||
@@ -253,7 +253,7 @@ f32 get_vibrato_freq_scale(struct VibratoState *vib) {
|
||||
pitchChange = get_vibrato_pitch_change(vib);
|
||||
extent = (f32) vib->extent / US_FLOAT(4096.0);
|
||||
|
||||
#if defined(VERSION_EU) || defined(VERSION_SH)
|
||||
#if defined(VERSION_EU) || defined(VERSION_SH) || defined(VERSION_CN)
|
||||
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));
|
||||
@@ -262,7 +262,7 @@ f32 get_vibrato_freq_scale(struct VibratoState *vib) {
|
||||
}
|
||||
|
||||
void note_vibrato_update(struct Note *note) {
|
||||
#if defined(VERSION_EU) || defined(VERSION_SH)
|
||||
#if defined(VERSION_EU) || defined(VERSION_SH) || defined(VERSION_CN)
|
||||
if (note->portamento.mode != 0) {
|
||||
note->portamentoFreqScale = get_portamento_freq_scale(¬e->portamento);
|
||||
}
|
||||
@@ -282,7 +282,7 @@ void note_vibrato_update(struct Note *note) {
|
||||
void note_vibrato_init(struct Note *note) {
|
||||
struct VibratoState *vib;
|
||||
UNUSED struct SequenceChannel *seqChannel;
|
||||
#if defined(VERSION_EU) || defined(VERSION_SH)
|
||||
#if defined(VERSION_EU) || defined(VERSION_SH) || defined(VERSION_CN)
|
||||
struct NotePlaybackState *seqPlayerState = (struct NotePlaybackState *) ¬e->priority;
|
||||
#endif
|
||||
|
||||
@@ -303,7 +303,7 @@ void note_vibrato_init(struct Note *note) {
|
||||
vib->active = TRUE;
|
||||
vib->time = 0;
|
||||
|
||||
#if defined(VERSION_EU) || defined(VERSION_SH)
|
||||
#if defined(VERSION_EU) || defined(VERSION_SH) || defined(VERSION_CN)
|
||||
vib->curve = gWaveSamples[2];
|
||||
vib->seqChannel = note->parentLayer->seqChannel;
|
||||
if ((vib->extentChangeTimer = vib->seqChannel->vibratoExtentChangeDelay) == 0) {
|
||||
@@ -345,10 +345,10 @@ void note_vibrato_init(struct Note *note) {
|
||||
void adsr_init(struct AdsrState *adsr, struct AdsrEnvelope *envelope, UNUSED s16 *volOut) {
|
||||
adsr->action = 0;
|
||||
adsr->state = ADSR_STATE_DISABLED;
|
||||
#if defined(VERSION_EU) || defined(VERSION_SH)
|
||||
#if defined(VERSION_EU) || defined(VERSION_SH) || defined(VERSION_CN)
|
||||
adsr->delay = 0;
|
||||
adsr->envelope = envelope;
|
||||
#ifdef VERSION_SH
|
||||
#if defined(VERSION_SH) || defined(VERSION_CN)
|
||||
adsr->sustain = 0.0f;
|
||||
#endif
|
||||
adsr->current = 0.0f;
|
||||
@@ -361,13 +361,13 @@ void adsr_init(struct AdsrState *adsr, struct AdsrEnvelope *envelope, UNUSED s16
|
||||
#endif
|
||||
}
|
||||
|
||||
#if defined(VERSION_EU) || defined(VERSION_SH)
|
||||
#if defined(VERSION_EU) || defined(VERSION_SH) || defined(VERSION_CN)
|
||||
f32 adsr_update(struct AdsrState *adsr) {
|
||||
#else
|
||||
s32 adsr_update(struct AdsrState *adsr) {
|
||||
#endif
|
||||
u8 action = adsr->action;
|
||||
#if defined(VERSION_EU) || defined(VERSION_SH)
|
||||
#if defined(VERSION_EU) || defined(VERSION_SH) || defined(VERSION_CN)
|
||||
u8 state = adsr->state;
|
||||
switch (state) {
|
||||
#else
|
||||
@@ -396,7 +396,7 @@ s32 adsr_update(struct AdsrState *adsr) {
|
||||
adsr->state = ADSR_STATE_LOOP;
|
||||
// fallthrough
|
||||
|
||||
#ifdef VERSION_SH
|
||||
#if defined(VERSION_SH) || defined(VERSION_CN)
|
||||
restart:
|
||||
#endif
|
||||
case ADSR_STATE_LOOP:
|
||||
@@ -410,7 +410,7 @@ s32 adsr_update(struct AdsrState *adsr) {
|
||||
break;
|
||||
case ADSR_GOTO:
|
||||
adsr->envIndex = BSWAP16(adsr->envelope[adsr->envIndex].arg);
|
||||
#ifdef VERSION_SH
|
||||
#if defined(VERSION_SH) || defined(VERSION_CN)
|
||||
goto restart;
|
||||
#else
|
||||
break;
|
||||
@@ -420,15 +420,15 @@ s32 adsr_update(struct AdsrState *adsr) {
|
||||
break;
|
||||
|
||||
default:
|
||||
#if defined(VERSION_EU) || defined(VERSION_SH)
|
||||
#if defined(VERSION_EU) || defined(VERSION_SH) || defined(VERSION_CN)
|
||||
if (adsr->delay >= 4) {
|
||||
adsr->delay = adsr->delay * gAudioBufferParameters.updatesPerFrame
|
||||
#ifdef VERSION_SH
|
||||
#if defined(VERSION_SH) || defined(VERSION_CN)
|
||||
/ gAudioBufferParameters.presetUnk4
|
||||
#endif
|
||||
/ 4;
|
||||
}
|
||||
#if defined(VERSION_SH)
|
||||
#if defined(VERSION_SH) || defined(VERSION_CN)
|
||||
if (adsr->delay == 0) {
|
||||
adsr->delay = 1;
|
||||
}
|
||||
@@ -452,7 +452,7 @@ s32 adsr_update(struct AdsrState *adsr) {
|
||||
// fallthrough
|
||||
|
||||
case ADSR_STATE_FADE:
|
||||
#if defined(VERSION_EU) || defined(VERSION_SH)
|
||||
#if defined(VERSION_EU) || defined(VERSION_SH) || defined(VERSION_CN)
|
||||
adsr->current += adsr->velocity;
|
||||
#else
|
||||
adsr->currentHiRes += adsr->velocity;
|
||||
@@ -469,14 +469,14 @@ s32 adsr_update(struct AdsrState *adsr) {
|
||||
case ADSR_STATE_DECAY:
|
||||
case ADSR_STATE_RELEASE: {
|
||||
adsr->current -= adsr->fadeOutVel;
|
||||
#if defined(VERSION_EU) || defined(VERSION_SH)
|
||||
#if defined(VERSION_EU) || defined(VERSION_SH) || defined(VERSION_CN)
|
||||
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;
|
||||
#if defined(VERSION_EU) || defined(VERSION_SH)
|
||||
#if defined(VERSION_EU) || defined(VERSION_SH) || defined(VERSION_CN)
|
||||
adsr->delay = 128;
|
||||
#else
|
||||
adsr->delay = adsr->sustain / 16;
|
||||
@@ -486,7 +486,7 @@ s32 adsr_update(struct AdsrState *adsr) {
|
||||
break;
|
||||
}
|
||||
|
||||
#if defined(VERSION_SH)
|
||||
#if defined(VERSION_SH) || defined(VERSION_CN)
|
||||
if (adsr->current < 0.00001f) {
|
||||
adsr->current = 0.0f;
|
||||
adsr->state = ADSR_STATE_DISABLED;
|
||||
@@ -520,14 +520,14 @@ s32 adsr_update(struct AdsrState *adsr) {
|
||||
|
||||
if ((action & ADSR_ACTION_RELEASE)) {
|
||||
adsr->state = ADSR_STATE_RELEASE;
|
||||
#if defined(VERSION_EU) || defined(VERSION_SH)
|
||||
#if defined(VERSION_EU) || defined(VERSION_SH) || defined(VERSION_CN)
|
||||
adsr->action = action & ~ADSR_ACTION_RELEASE;
|
||||
#else
|
||||
adsr->action = action & ~(ADSR_ACTION_RELEASE | ADSR_ACTION_DECAY);
|
||||
#endif
|
||||
}
|
||||
|
||||
#if defined(VERSION_EU) || defined(VERSION_SH)
|
||||
#if defined(VERSION_EU) || defined(VERSION_SH) || defined(VERSION_CN)
|
||||
if (adsr->current < 0.0f) {
|
||||
return 0.0f;
|
||||
}
|
||||
|
||||
@@ -37,7 +37,7 @@ void sequence_player_process_sound(struct SequencePlayer *seqPlayer);
|
||||
void note_vibrato_update(struct Note *note);
|
||||
void note_vibrato_init(struct Note *note);
|
||||
void adsr_init(struct AdsrState *adsr, struct AdsrEnvelope *envelope, s16 *volOut);
|
||||
#if defined(VERSION_EU) || defined(VERSION_SH)
|
||||
#if defined(VERSION_EU) || defined(VERSION_SH) || defined(VERSION_CN)
|
||||
f32 adsr_update(struct AdsrState *adsr);
|
||||
#else
|
||||
s32 adsr_update(struct AdsrState *adsr);
|
||||
|
||||
@@ -13,7 +13,7 @@
|
||||
#include "seq_ids.h"
|
||||
#include "dialog_ids.h"
|
||||
|
||||
#if defined(VERSION_EU) || defined(VERSION_SH)
|
||||
#if defined(VERSION_EU) || defined(VERSION_SH) || defined(VERSION_CN)
|
||||
#define EU_FLOAT(x) x##f
|
||||
#else
|
||||
#define EU_FLOAT(x) x
|
||||
@@ -63,7 +63,7 @@ struct SequenceQueueItem {
|
||||
}; // size = 0x2
|
||||
|
||||
// data
|
||||
#if defined(VERSION_EU) || defined(VERSION_SH)
|
||||
#if defined(VERSION_EU) || defined(VERSION_SH) || defined(VERSION_CN)
|
||||
// moved to bss in data.c
|
||||
s32 gAudioErrorFlags2 = 0;
|
||||
#else
|
||||
@@ -166,18 +166,18 @@ u8 sSoundRequestCount = 0;
|
||||
#define DYN3(cond1, val1, cond2, val2, cond3, val3, res) \
|
||||
(s16)(1 << (15 - cond1) | 1 << (15 - cond2) | 1 << (15 - cond3) | res), val1, val2, val3
|
||||
|
||||
s16 sDynBbh[] = {
|
||||
s16 sDynBBH[] = {
|
||||
SEQ_LEVEL_SPOOKY, DYN1(MARIO_IS_IN_ROOM, BBH_OUTSIDE_ROOM, 6),
|
||||
DYN1(MARIO_IS_IN_ROOM, BBH_NEAR_MERRY_GO_ROUND_ROOM, 6), 5,
|
||||
};
|
||||
s16 sDynDdd[] = {
|
||||
s16 sDynDDD[] = {
|
||||
SEQ_LEVEL_WATER,
|
||||
DYN2(MARIO_X_LT, -800, MARIO_IS_IN_AREA, AREA_DDD_WHIRLPOOL & 0xf, 0),
|
||||
DYN3(MARIO_Y_GE, -2000, MARIO_X_LT, 470, MARIO_IS_IN_AREA, AREA_DDD_WHIRLPOOL & 0xf, 0),
|
||||
DYN2(MARIO_Y_GE, 100, MARIO_IS_IN_AREA, AREA_DDD_SUB & 0xf, 2),
|
||||
1,
|
||||
};
|
||||
s16 sDynJrb[] = {
|
||||
s16 sDynJRB[] = {
|
||||
SEQ_LEVEL_WATER,
|
||||
DYN2(MARIO_Y_GE, 945, MARIO_X_LT, -5260, 0),
|
||||
DYN1(MARIO_IS_IN_AREA, AREA_JRB_SHIP & 0xf, 0),
|
||||
@@ -186,11 +186,11 @@ s16 sDynJrb[] = {
|
||||
1,
|
||||
5, // bogus entry, ignored (was JRB originally intended to have spooky music?)
|
||||
};
|
||||
s16 sDynWdw[] = {
|
||||
s16 sDynWDW[] = {
|
||||
SEQ_LEVEL_UNDERGROUND, DYN2(MARIO_Y_LT, -670, MARIO_IS_IN_AREA, AREA_WDW_MAIN & 0xf, 4),
|
||||
DYN1(MARIO_IS_IN_AREA, AREA_WDW_TOWN & 0xf, 4), 3,
|
||||
};
|
||||
s16 sDynHmc[] = {
|
||||
s16 sDynHMC[] = {
|
||||
SEQ_LEVEL_UNDERGROUND, DYN2(MARIO_X_GE, 0, MARIO_Y_LT, -203, 4),
|
||||
DYN2(MARIO_X_LT, 0, MARIO_Y_LT, -2400, 4), 3,
|
||||
};
|
||||
@@ -353,7 +353,7 @@ u8 sBackgroundMusicMaxTargetVolume = TARGET_VOLUME_UNSET;
|
||||
u8 D_80332120 = 0;
|
||||
u8 D_80332124 = 0;
|
||||
|
||||
#if defined(VERSION_EU) || defined(VERSION_SH)
|
||||
#if defined(VERSION_EU) || defined(VERSION_SH) || defined(VERSION_CN)
|
||||
u8 D_EU_80300558 = 0;
|
||||
#endif
|
||||
|
||||
@@ -368,7 +368,7 @@ u8 sUnused8033323C = 0; // never read, set to 0
|
||||
#if defined(VERSION_JP) || defined(VERSION_US)
|
||||
s16 *gCurrAiBuffer;
|
||||
#endif
|
||||
#ifdef VERSION_SH
|
||||
#if defined(VERSION_SH) || defined(VERSION_CN)
|
||||
s8 D_SH_80343CD0_pad[0x20];
|
||||
s32 D_SH_80343CF0;
|
||||
s8 D_SH_80343CF8_pad[0x8];
|
||||
@@ -397,7 +397,7 @@ u8 sBackgroundMusicTargetVolume;
|
||||
static u8 sLowerBackgroundMusicVolume;
|
||||
struct SequenceQueueItem sBackgroundMusicQueue[MAX_BACKGROUND_MUSIC_QUEUE_SIZE];
|
||||
|
||||
#if defined(VERSION_EU) || defined(VERSION_SH)
|
||||
#if defined(VERSION_EU) || defined(VERSION_SH) || defined(VERSION_CN)
|
||||
s32 unk_sh_8034754C;
|
||||
#endif
|
||||
|
||||
@@ -509,7 +509,7 @@ void unused_8031E568(void) {
|
||||
}
|
||||
#endif
|
||||
|
||||
#if defined(VERSION_EU) || defined(VERSION_SH)
|
||||
#if defined(VERSION_EU) || defined(VERSION_SH) || defined(VERSION_CN)
|
||||
const char unusedErrorStr1[] = "Error : Queue is not empty ( %x ) \n";
|
||||
const char unusedErrorStr2[] = "specchg error\n";
|
||||
#endif
|
||||
@@ -518,10 +518,10 @@ const char unusedErrorStr2[] = "specchg error\n";
|
||||
* Fade out a sequence player
|
||||
* Called from threads: thread5_game_loop
|
||||
*/
|
||||
#if defined(VERSION_EU) || defined(VERSION_SH)
|
||||
#if defined(VERSION_EU) || defined(VERSION_SH) || defined(VERSION_CN)
|
||||
void audio_reset_session_eu(s32 presetId) {
|
||||
OSMesg mesg;
|
||||
#ifdef VERSION_SH
|
||||
#if defined(VERSION_SH) || defined(VERSION_CN)
|
||||
osRecvMesg(D_SH_80350FA8, &mesg, OS_MESG_NOBLOCK);
|
||||
osSendMesg(D_SH_80350F88, (OSMesg) presetId, OS_MESG_NOBLOCK);
|
||||
osRecvMesg(D_SH_80350FA8, &mesg, OS_MESG_BLOCK);
|
||||
@@ -583,7 +583,7 @@ static void seq_player_fade_to_percentage_of_volume(s32 player, FadeT fadeDurati
|
||||
struct SequencePlayer *seqPlayer = &gSequencePlayers[player];
|
||||
f32 targetVolume;
|
||||
|
||||
#if defined(VERSION_EU) || defined(VERSION_SH)
|
||||
#if defined(VERSION_EU) || defined(VERSION_SH) || defined(VERSION_CN)
|
||||
if (seqPlayer->state == 2) {
|
||||
return;
|
||||
}
|
||||
@@ -602,7 +602,7 @@ static void seq_player_fade_to_percentage_of_volume(s32 player, FadeT fadeDurati
|
||||
return;
|
||||
}
|
||||
seqPlayer->fadeVelocity = (targetVolume - seqPlayer->fadeVolume) / fadeDuration;
|
||||
#if defined(VERSION_EU) || defined(VERSION_SH)
|
||||
#if defined(VERSION_EU) || defined(VERSION_SH) || defined(VERSION_CN)
|
||||
seqPlayer->state = 0;
|
||||
#else
|
||||
seqPlayer->state = SEQUENCE_PLAYER_STATE_4;
|
||||
@@ -617,7 +617,7 @@ static void seq_player_fade_to_percentage_of_volume(s32 player, FadeT fadeDurati
|
||||
static void seq_player_fade_to_normal_volume(s32 player, FadeT fadeDuration) {
|
||||
struct SequencePlayer *seqPlayer = &gSequencePlayers[player];
|
||||
|
||||
#if defined(VERSION_EU) || defined(VERSION_SH)
|
||||
#if defined(VERSION_EU) || defined(VERSION_SH) || defined(VERSION_CN)
|
||||
if (seqPlayer->state == 2) {
|
||||
return;
|
||||
}
|
||||
@@ -633,7 +633,7 @@ static void seq_player_fade_to_normal_volume(s32 player, FadeT fadeDuration) {
|
||||
return;
|
||||
}
|
||||
seqPlayer->fadeVelocity = (seqPlayer->volume - seqPlayer->fadeVolume) / fadeDuration;
|
||||
#if defined(VERSION_EU) || defined(VERSION_SH)
|
||||
#if defined(VERSION_EU) || defined(VERSION_SH) || defined(VERSION_CN)
|
||||
seqPlayer->state = 0;
|
||||
#else
|
||||
seqPlayer->state = SEQUENCE_PLAYER_STATE_2;
|
||||
@@ -663,7 +663,7 @@ static void seq_player_fade_to_target_volume(s32 player, FadeT fadeDuration, u8
|
||||
seqPlayer->fadeVelocity =
|
||||
(((f32)(FLOAT_CAST(targetVolume) / EU_FLOAT(127.0)) - seqPlayer->fadeVolume)
|
||||
/ (f32) fadeDuration);
|
||||
#if defined(VERSION_EU) || defined(VERSION_SH)
|
||||
#if defined(VERSION_EU) || defined(VERSION_SH) || defined(VERSION_CN)
|
||||
seqPlayer->state = 0;
|
||||
#else
|
||||
seqPlayer->state = SEQUENCE_PLAYER_STATE_4;
|
||||
@@ -672,7 +672,7 @@ static void seq_player_fade_to_target_volume(s32 player, FadeT fadeDuration, u8
|
||||
seqPlayer->fadeRemainingFrames = fadeDuration;
|
||||
}
|
||||
|
||||
#if defined(VERSION_EU) || defined(VERSION_SH)
|
||||
#if defined(VERSION_EU) || defined(VERSION_SH) || defined(VERSION_CN)
|
||||
#ifdef VERSION_EU
|
||||
extern void func_802ad7a0(void);
|
||||
#else
|
||||
@@ -1329,7 +1329,7 @@ static void noop_8031EEC8(void) {
|
||||
*/
|
||||
void audio_signal_game_loop_tick(void) {
|
||||
sGameLoopTicked = 1;
|
||||
#if defined(VERSION_EU) || defined(VERSION_SH)
|
||||
#if defined(VERSION_EU) || defined(VERSION_SH) || defined(VERSION_CN)
|
||||
maybe_tick_game_sound();
|
||||
#endif
|
||||
noop_8031EEC8();
|
||||
@@ -1387,7 +1387,7 @@ static void update_game_sound(void) {
|
||||
case SOUND_BANK_MOVING:
|
||||
if (!(sSoundBanks[bank][soundIndex].soundBits & SOUND_CONSTANT_FREQUENCY)) {
|
||||
if (sSoundMovingSpeed[bank] > 8) {
|
||||
#if defined(VERSION_EU) || defined(VERSION_SH)
|
||||
#if defined(VERSION_EU) || defined(VERSION_SH) || defined(VERSION_CN)
|
||||
func_802ad728(
|
||||
0x02020000 | ((channelIndex & 0xff) << 8),
|
||||
get_sound_volume(bank, soundIndex, VOLUME_RANGE_UNK1));
|
||||
@@ -1397,7 +1397,7 @@ static void update_game_sound(void) {
|
||||
value;
|
||||
#endif
|
||||
} else {
|
||||
#if defined(VERSION_EU) || defined(VERSION_SH)
|
||||
#if defined(VERSION_EU) || defined(VERSION_SH) || defined(VERSION_CN)
|
||||
func_802ad728(0x02020000 | ((channelIndex & 0xff) << 8),
|
||||
get_sound_volume(bank, soundIndex, VOLUME_RANGE_UNK1)
|
||||
* ((sSoundMovingSpeed[bank] + 8.0f) / 16));
|
||||
@@ -1407,7 +1407,7 @@ static void update_game_sound(void) {
|
||||
(sSoundMovingSpeed[bank] + 8.0f) / 16 * value;
|
||||
#endif
|
||||
}
|
||||
#if defined(VERSION_EU) || defined(VERSION_SH)
|
||||
#if defined(VERSION_EU) || defined(VERSION_SH) || defined(VERSION_CN)
|
||||
func_802ad770(0x03020000 | ((channelIndex & 0xff) << 8),
|
||||
get_sound_pan(*sSoundBanks[bank][soundIndex].x,
|
||||
*sSoundBanks[bank][soundIndex].z));
|
||||
@@ -1419,7 +1419,7 @@ static void update_game_sound(void) {
|
||||
|
||||
if ((sSoundBanks[bank][soundIndex].soundBits & SOUNDARGS_MASK_SOUNDID)
|
||||
== (SOUND_MOVING_FLYING & SOUNDARGS_MASK_SOUNDID)) {
|
||||
#if defined(VERSION_EU) || defined(VERSION_SH)
|
||||
#if defined(VERSION_EU) || defined(VERSION_SH) || defined(VERSION_CN)
|
||||
func_802ad728(
|
||||
0x04020000 | ((channelIndex & 0xff) << 8),
|
||||
get_sound_freq_scale(bank, soundIndex)
|
||||
@@ -1430,7 +1430,7 @@ static void update_game_sound(void) {
|
||||
((f32) sSoundMovingSpeed[bank] / US_FLOAT(80.0)) + value;
|
||||
#endif
|
||||
} else {
|
||||
#if defined(VERSION_EU) || defined(VERSION_SH)
|
||||
#if defined(VERSION_EU) || defined(VERSION_SH) || defined(VERSION_CN)
|
||||
func_802ad728(
|
||||
0x04020000 | ((channelIndex & 0xff) << 8),
|
||||
get_sound_freq_scale(bank, soundIndex)
|
||||
@@ -1441,7 +1441,7 @@ static void update_game_sound(void) {
|
||||
((f32) sSoundMovingSpeed[bank] / US_FLOAT(400.0)) + value;
|
||||
#endif
|
||||
}
|
||||
#if defined(VERSION_EU) || defined(VERSION_SH)
|
||||
#if defined(VERSION_EU) || defined(VERSION_SH) || defined(VERSION_CN)
|
||||
func_802ad770(0x05020000 | ((channelIndex & 0xff) << 8),
|
||||
get_sound_reverb(bank, soundIndex, channelIndex));
|
||||
#else
|
||||
@@ -1453,7 +1453,7 @@ static void update_game_sound(void) {
|
||||
}
|
||||
// fallthrough
|
||||
case SOUND_BANK_MENU:
|
||||
#if defined(VERSION_EU) || defined(VERSION_SH)
|
||||
#if defined(VERSION_EU) || defined(VERSION_SH) || defined(VERSION_CN)
|
||||
func_802ad728(0x02020000 | ((channelIndex & 0xff) << 8), 1);
|
||||
func_802ad770(0x03020000 | ((channelIndex & 0xff) << 8), 64);
|
||||
func_802ad728(0x04020000 | ((channelIndex & 0xff) << 8),
|
||||
@@ -1466,7 +1466,7 @@ static void update_game_sound(void) {
|
||||
break;
|
||||
case SOUND_BANK_ACTION:
|
||||
case SOUND_BANK_VOICE:
|
||||
#if defined(VERSION_EU) || defined(VERSION_SH)
|
||||
#if defined(VERSION_EU) || defined(VERSION_SH) || defined(VERSION_CN)
|
||||
func_802ad770(0x05020000 | ((channelIndex & 0xff) << 8),
|
||||
get_sound_reverb(bank, soundIndex, channelIndex));
|
||||
func_802ad728(0x02020000 | ((channelIndex & 0xff) << 8),
|
||||
@@ -1496,7 +1496,7 @@ static void update_game_sound(void) {
|
||||
case SOUND_BANK_AIR:
|
||||
case SOUND_BANK_GENERAL2:
|
||||
case SOUND_BANK_OBJ2:
|
||||
#if defined(VERSION_EU) || defined(VERSION_SH)
|
||||
#if defined(VERSION_EU) || defined(VERSION_SH) || defined(VERSION_CN)
|
||||
func_802ad770(0x05020000 | ((channelIndex & 0xff) << 8),
|
||||
get_sound_reverb(bank, soundIndex, channelIndex));
|
||||
func_802ad728(0x02020000 | ((channelIndex & 0xff) << 8),
|
||||
@@ -1571,7 +1571,7 @@ static void update_game_sound(void) {
|
||||
case SOUND_BANK_MOVING:
|
||||
if (!(sSoundBanks[bank][soundIndex].soundBits & SOUND_CONSTANT_FREQUENCY)) {
|
||||
if (sSoundMovingSpeed[bank] > 8) {
|
||||
#if defined(VERSION_EU) || defined(VERSION_SH)
|
||||
#if defined(VERSION_EU) || defined(VERSION_SH) || defined(VERSION_CN)
|
||||
func_802ad728(
|
||||
0x02020000 | ((channelIndex & 0xff) << 8),
|
||||
get_sound_volume(bank, soundIndex, VOLUME_RANGE_UNK1));
|
||||
@@ -1581,7 +1581,7 @@ static void update_game_sound(void) {
|
||||
value;
|
||||
#endif
|
||||
} else {
|
||||
#if defined(VERSION_EU) || defined(VERSION_SH)
|
||||
#if defined(VERSION_EU) || defined(VERSION_SH) || defined(VERSION_CN)
|
||||
func_802ad728(0x02020000 | ((channelIndex & 0xff) << 8),
|
||||
get_sound_volume(bank, soundIndex, VOLUME_RANGE_UNK1)
|
||||
* ((sSoundMovingSpeed[bank] + 8.0f) / 16));
|
||||
@@ -1591,7 +1591,7 @@ static void update_game_sound(void) {
|
||||
(sSoundMovingSpeed[bank] + 8.0f) / 16 * value;
|
||||
#endif
|
||||
}
|
||||
#if defined(VERSION_EU) || defined(VERSION_SH)
|
||||
#if defined(VERSION_EU) || defined(VERSION_SH) || defined(VERSION_CN)
|
||||
func_802ad770(0x03020000 | ((channelIndex & 0xff) << 8),
|
||||
get_sound_pan(*sSoundBanks[bank][soundIndex].x,
|
||||
*sSoundBanks[bank][soundIndex].z));
|
||||
@@ -1603,7 +1603,7 @@ static void update_game_sound(void) {
|
||||
|
||||
if ((sSoundBanks[bank][soundIndex].soundBits & SOUNDARGS_MASK_SOUNDID)
|
||||
== (SOUND_MOVING_FLYING & SOUNDARGS_MASK_SOUNDID)) {
|
||||
#if defined(VERSION_EU) || defined(VERSION_SH)
|
||||
#if defined(VERSION_EU) || defined(VERSION_SH) || defined(VERSION_CN)
|
||||
func_802ad728(
|
||||
0x04020000 | ((channelIndex & 0xff) << 8),
|
||||
get_sound_freq_scale(bank, soundIndex)
|
||||
@@ -1614,7 +1614,7 @@ static void update_game_sound(void) {
|
||||
((f32) sSoundMovingSpeed[bank] / US_FLOAT(80.0)) + value;
|
||||
#endif
|
||||
} else {
|
||||
#if defined(VERSION_EU) || defined(VERSION_SH)
|
||||
#if defined(VERSION_EU) || defined(VERSION_SH) || defined(VERSION_CN)
|
||||
func_802ad728(
|
||||
0x04020000 | ((channelIndex & 0xff) << 8),
|
||||
get_sound_freq_scale(bank, soundIndex)
|
||||
@@ -1625,7 +1625,7 @@ static void update_game_sound(void) {
|
||||
((f32) sSoundMovingSpeed[bank] / US_FLOAT(400.0)) + value;
|
||||
#endif
|
||||
}
|
||||
#if defined(VERSION_EU) || defined(VERSION_SH)
|
||||
#if defined(VERSION_EU) || defined(VERSION_SH) || defined(VERSION_CN)
|
||||
func_802ad770(0x05020000 | ((channelIndex & 0xff) << 8),
|
||||
get_sound_reverb(bank, soundIndex, channelIndex));
|
||||
#else
|
||||
@@ -1637,7 +1637,7 @@ static void update_game_sound(void) {
|
||||
}
|
||||
// fallthrough
|
||||
case SOUND_BANK_MENU:
|
||||
#if defined(VERSION_EU) || defined(VERSION_SH)
|
||||
#if defined(VERSION_EU) || defined(VERSION_SH) || defined(VERSION_CN)
|
||||
func_802ad728(0x02020000 | ((channelIndex & 0xff) << 8), 1);
|
||||
func_802ad770(0x03020000 | ((channelIndex & 0xff) << 8), 64);
|
||||
func_802ad728(0x04020000 | ((channelIndex & 0xff) << 8),
|
||||
@@ -1650,7 +1650,7 @@ static void update_game_sound(void) {
|
||||
break;
|
||||
case SOUND_BANK_ACTION:
|
||||
case SOUND_BANK_VOICE:
|
||||
#if defined(VERSION_EU) || defined(VERSION_SH)
|
||||
#if defined(VERSION_EU) || defined(VERSION_SH) || defined(VERSION_CN)
|
||||
func_802ad770(0x05020000 | ((channelIndex & 0xff) << 8),
|
||||
get_sound_reverb(bank, soundIndex, channelIndex));
|
||||
func_802ad728(0x02020000 | ((channelIndex & 0xff) << 8),
|
||||
@@ -1680,7 +1680,7 @@ static void update_game_sound(void) {
|
||||
case SOUND_BANK_AIR:
|
||||
case SOUND_BANK_GENERAL2:
|
||||
case SOUND_BANK_OBJ2:
|
||||
#if defined(VERSION_EU) || defined(VERSION_SH)
|
||||
#if defined(VERSION_EU) || defined(VERSION_SH) || defined(VERSION_CN)
|
||||
func_802ad770(0x05020000 | ((channelIndex & 0xff) << 8),
|
||||
get_sound_reverb(bank, soundIndex, channelIndex));
|
||||
func_802ad728(0x02020000 | ((channelIndex & 0xff) << 8),
|
||||
@@ -1737,7 +1737,7 @@ static void seq_player_play_sequence(u8 player, u8 seqId, u16 arg2) {
|
||||
D_80360928[player][i].remainingFrames = 0;
|
||||
}
|
||||
|
||||
#if defined(VERSION_EU) || defined(VERSION_SH)
|
||||
#if defined(VERSION_EU) || defined(VERSION_SH) || defined(VERSION_CN)
|
||||
func_802ad770(0x46000000 | ((u8)(u32) player) << 16, seqId & SEQ_VARIATION);
|
||||
func_802ad74c(0x82000000 | ((u8)(u32) player) << 16 | ((u8)(seqId & SEQ_BASE_ID)) << 8, arg2);
|
||||
|
||||
@@ -1768,7 +1768,7 @@ static void seq_player_play_sequence(u8 player, u8 seqId, u16 arg2) {
|
||||
* Called from threads: thread5_game_loop
|
||||
*/
|
||||
void seq_player_fade_out(u8 player, u16 fadeDuration) {
|
||||
#if defined(VERSION_EU) || defined(VERSION_SH)
|
||||
#if defined(VERSION_EU) || defined(VERSION_SH) || defined(VERSION_CN)
|
||||
#ifdef VERSION_EU
|
||||
u32 fd = fadeDuration;
|
||||
#else
|
||||
@@ -1824,7 +1824,7 @@ static void func_8031F96C(u8 player) {
|
||||
if (gSequencePlayers[player].channels[i] != &gSequenceChannelNone
|
||||
&& D_80360928[player][i].remainingFrames != 0) {
|
||||
D_80360928[player][i].current += D_80360928[player][i].velocity;
|
||||
#if defined(VERSION_EU) || defined(VERSION_SH)
|
||||
#if defined(VERSION_EU) || defined(VERSION_SH) || defined(VERSION_CN)
|
||||
func_802ad728(0x01000000 | (player & 0xff) << 16 | (i & 0xff) << 8,
|
||||
D_80360928[player][i].current);
|
||||
#else
|
||||
@@ -1835,7 +1835,7 @@ static void func_8031F96C(u8 player) {
|
||||
#if defined(VERSION_EU)
|
||||
func_802ad728(0x01000000 | (player & 0xff) << 16 | (i & 0xff) << 8,
|
||||
FLOAT_CAST(D_80360928[player][i].target) / 127.0);
|
||||
#elif defined(VERSION_SH)
|
||||
#elif defined(VERSION_SH) || defined(VERSION_CN)
|
||||
func_802ad728(0x01000000 | (player & 0xff) << 16 | (i & 0xff) << 8,
|
||||
FLOAT_CAST(D_80360928[player][i].target) / 127.0f);
|
||||
#else
|
||||
@@ -2109,7 +2109,7 @@ void set_audio_muted(u8 muted) {
|
||||
u8 i;
|
||||
|
||||
for (i = 0; i < SEQUENCE_PLAYERS; i++) {
|
||||
#if defined(VERSION_EU) || defined(VERSION_SH)
|
||||
#if defined(VERSION_EU) || defined(VERSION_SH) || defined(VERSION_CN)
|
||||
if (muted) {
|
||||
func_802ad74c(0xf1000000, 0);
|
||||
} else {
|
||||
@@ -2499,7 +2499,7 @@ u16 get_current_background_music(void) {
|
||||
* Called from threads: thread4_sound, thread5_game_loop (EU only)
|
||||
*/
|
||||
void func_80320ED8(void) {
|
||||
#if defined(VERSION_EU) || defined(VERSION_SH)
|
||||
#if defined(VERSION_EU) || defined(VERSION_SH) || defined(VERSION_CN)
|
||||
if (D_EU_80300558 != 0) {
|
||||
D_EU_80300558--;
|
||||
}
|
||||
@@ -2577,7 +2577,7 @@ void func_803210D4(u16 fadeDuration) {
|
||||
}
|
||||
|
||||
if (gSequencePlayers[SEQ_PLAYER_LEVEL].enabled == TRUE) {
|
||||
#if defined(VERSION_EU) || defined(VERSION_SH)
|
||||
#if defined(VERSION_EU) || defined(VERSION_SH) || defined(VERSION_CN)
|
||||
func_802ad74c(0x83000000, fadeDuration);
|
||||
#else
|
||||
seq_player_fade_to_zero_volume(SEQ_PLAYER_LEVEL, fadeDuration);
|
||||
@@ -2585,7 +2585,7 @@ void func_803210D4(u16 fadeDuration) {
|
||||
}
|
||||
|
||||
if (gSequencePlayers[SEQ_PLAYER_ENV].enabled == TRUE) {
|
||||
#if defined(VERSION_EU) || defined(VERSION_SH)
|
||||
#if defined(VERSION_EU) || defined(VERSION_SH) || defined(VERSION_CN)
|
||||
func_802ad74c(0x83010000, fadeDuration);
|
||||
#else
|
||||
seq_player_fade_to_zero_volume(SEQ_PLAYER_ENV, fadeDuration);
|
||||
@@ -2607,7 +2607,7 @@ void func_803210D4(u16 fadeDuration) {
|
||||
void play_course_clear(void) {
|
||||
seq_player_play_sequence(SEQ_PLAYER_ENV, SEQ_EVENT_CUTSCENE_COLLECT_STAR, 0);
|
||||
sBackgroundMusicMaxTargetVolume = TARGET_VOLUME_IS_PRESENT_FLAG | 0;
|
||||
#if defined(VERSION_EU) || defined(VERSION_SH)
|
||||
#if defined(VERSION_EU) || defined(VERSION_SH) || defined(VERSION_CN)
|
||||
D_EU_80300558 = 2;
|
||||
#endif
|
||||
begin_background_music_fade(50);
|
||||
@@ -2619,7 +2619,7 @@ void play_course_clear(void) {
|
||||
void play_peachs_jingle(void) {
|
||||
seq_player_play_sequence(SEQ_PLAYER_ENV, SEQ_EVENT_PEACH_MESSAGE, 0);
|
||||
sBackgroundMusicMaxTargetVolume = TARGET_VOLUME_IS_PRESENT_FLAG | 0;
|
||||
#if defined(VERSION_EU) || defined(VERSION_SH)
|
||||
#if defined(VERSION_EU) || defined(VERSION_SH) || defined(VERSION_CN)
|
||||
D_EU_80300558 = 2;
|
||||
#endif
|
||||
begin_background_music_fade(50);
|
||||
@@ -2635,7 +2635,7 @@ void play_peachs_jingle(void) {
|
||||
void play_puzzle_jingle(void) {
|
||||
seq_player_play_sequence(SEQ_PLAYER_ENV, SEQ_EVENT_SOLVE_PUZZLE, 0);
|
||||
sBackgroundMusicMaxTargetVolume = TARGET_VOLUME_IS_PRESENT_FLAG | 20;
|
||||
#if defined(VERSION_EU) || defined(VERSION_SH)
|
||||
#if defined(VERSION_EU) || defined(VERSION_SH) || defined(VERSION_CN)
|
||||
D_EU_80300558 = 2;
|
||||
#endif
|
||||
begin_background_music_fade(50);
|
||||
@@ -2647,7 +2647,7 @@ void play_puzzle_jingle(void) {
|
||||
void play_star_fanfare(void) {
|
||||
seq_player_play_sequence(SEQ_PLAYER_ENV, SEQ_EVENT_HIGH_SCORE, 0);
|
||||
sBackgroundMusicMaxTargetVolume = TARGET_VOLUME_IS_PRESENT_FLAG | 20;
|
||||
#if defined(VERSION_EU) || defined(VERSION_SH)
|
||||
#if defined(VERSION_EU) || defined(VERSION_SH) || defined(VERSION_CN)
|
||||
D_EU_80300558 = 2;
|
||||
#endif
|
||||
begin_background_music_fade(50);
|
||||
@@ -2662,7 +2662,7 @@ void play_power_star_jingle(u8 arg0) {
|
||||
}
|
||||
seq_player_play_sequence(SEQ_PLAYER_ENV, SEQ_EVENT_CUTSCENE_STAR_SPAWN, 0);
|
||||
sBackgroundMusicMaxTargetVolume = TARGET_VOLUME_IS_PRESENT_FLAG | 20;
|
||||
#if defined(VERSION_EU) || defined(VERSION_SH)
|
||||
#if defined(VERSION_EU) || defined(VERSION_SH) || defined(VERSION_CN)
|
||||
D_EU_80300558 = 2;
|
||||
#endif
|
||||
begin_background_music_fade(50);
|
||||
@@ -2674,7 +2674,7 @@ void play_power_star_jingle(u8 arg0) {
|
||||
void play_race_fanfare(void) {
|
||||
seq_player_play_sequence(SEQ_PLAYER_ENV, SEQ_EVENT_RACE, 0);
|
||||
sBackgroundMusicMaxTargetVolume = TARGET_VOLUME_IS_PRESENT_FLAG | 20;
|
||||
#if defined(VERSION_EU) || defined(VERSION_SH)
|
||||
#if defined(VERSION_EU) || defined(VERSION_SH) || defined(VERSION_CN)
|
||||
D_EU_80300558 = 2;
|
||||
#endif
|
||||
begin_background_music_fade(50);
|
||||
@@ -2686,7 +2686,7 @@ void play_race_fanfare(void) {
|
||||
void play_toads_jingle(void) {
|
||||
seq_player_play_sequence(SEQ_PLAYER_ENV, SEQ_EVENT_TOAD_MESSAGE, 0);
|
||||
sBackgroundMusicMaxTargetVolume = TARGET_VOLUME_IS_PRESENT_FLAG | 20;
|
||||
#if defined(VERSION_EU) || defined(VERSION_SH)
|
||||
#if defined(VERSION_EU) || defined(VERSION_SH) || defined(VERSION_CN)
|
||||
D_EU_80300558 = 2;
|
||||
#endif
|
||||
begin_background_music_fade(50);
|
||||
@@ -2705,7 +2705,7 @@ void sound_reset(u8 presetId) {
|
||||
sGameLoopTicked = 0;
|
||||
disable_all_sequence_players();
|
||||
sound_init();
|
||||
#ifdef VERSION_SH
|
||||
#if defined(VERSION_SH) || defined(VERSION_CN)
|
||||
func_802ad74c(0xF2000000, 0);
|
||||
#endif
|
||||
#if defined(VERSION_JP) || defined(VERSION_US)
|
||||
|
||||
137
src/audio/heap.c
137
src/audio/heap.c
File diff suppressed because it is too large
Load Diff
@@ -25,7 +25,7 @@ struct SoundAllocPool {
|
||||
struct SeqOrBankEntry {
|
||||
u8 *ptr;
|
||||
u32 size;
|
||||
#ifdef VERSION_SH
|
||||
#if defined(VERSION_SH) || defined(VERSION_CN)
|
||||
s16 poolIndex;
|
||||
s16 id;
|
||||
#else
|
||||
@@ -93,7 +93,7 @@ extern struct SoundAllocPool gPersistentCommonPool;
|
||||
extern struct SoundAllocPool gTemporaryCommonPool;
|
||||
extern struct SoundMultiPool gSeqLoadedPool;
|
||||
extern struct SoundMultiPool gBankLoadedPool;
|
||||
#ifdef VERSION_SH
|
||||
#if defined(VERSION_SH) || defined(VERSION_CN)
|
||||
extern struct Unk1Pool gUnkPool1;
|
||||
extern struct UnkPool gUnkPool2;
|
||||
extern struct UnkPool gUnkPool3;
|
||||
@@ -103,7 +103,7 @@ extern u8 gSeqLoadStatus[256];
|
||||
extern volatile u8 gAudioResetStatus;
|
||||
extern u8 gAudioResetPresetIdToLoad;
|
||||
|
||||
#if defined(VERSION_EU) || defined(VERSION_SH)
|
||||
#if defined(VERSION_EU) || defined(VERSION_SH) || defined(VERSION_CN)
|
||||
extern volatile u8 gAudioResetStatus;
|
||||
#endif
|
||||
|
||||
@@ -111,14 +111,14 @@ void *soundAlloc(struct SoundAllocPool *pool, u32 size);
|
||||
void *sound_alloc_uninitialized(struct SoundAllocPool *pool, u32 size);
|
||||
void sound_init_main_pools(s32 sizeForAudioInitPool);
|
||||
void sound_alloc_pool_init(struct SoundAllocPool *pool, void *memAddr, u32 size);
|
||||
#ifdef VERSION_SH
|
||||
#if defined(VERSION_SH) || defined(VERSION_CN)
|
||||
void *alloc_bank_or_seq(s32 poolIdx, s32 size, s32 arg3, s32 id);
|
||||
void *get_bank_or_seq(s32 poolIdx, s32 arg1, s32 id);
|
||||
#else
|
||||
void *alloc_bank_or_seq(struct SoundMultiPool *arg0, s32 arg1, s32 size, s32 arg3, s32 id);
|
||||
void *get_bank_or_seq(struct SoundMultiPool *arg0, s32 arg1, s32 id);
|
||||
#endif
|
||||
#if defined(VERSION_EU) || defined(VERSION_SH)
|
||||
#if defined(VERSION_EU) || defined(VERSION_SH) || defined(VERSION_CN)
|
||||
s32 audio_shut_down_and_reset_step(void);
|
||||
void audio_reset_session(void);
|
||||
#else
|
||||
@@ -126,7 +126,7 @@ void audio_reset_session(struct AudioSessionSettings *preset);
|
||||
#endif
|
||||
void discard_bank(s32 bankId);
|
||||
|
||||
#ifdef VERSION_SH
|
||||
#if defined(VERSION_SH) || defined(VERSION_CN)
|
||||
void fill_filter(s16 filter[8], s32 arg1, s32 arg2);
|
||||
u8 *func_sh_802f1d40(u32 size, s32 bank, u8 *arg2, s8 medium);
|
||||
u8 *func_sh_802f1d90(u32 size, s32 bank, u8 *arg2, s8 medium);
|
||||
|
||||
@@ -5,7 +5,7 @@
|
||||
|
||||
#include "types.h"
|
||||
|
||||
#if defined(VERSION_EU) || defined(VERSION_SH)
|
||||
#if defined(VERSION_EU) || defined(VERSION_SH) || defined(VERSION_CN)
|
||||
#define SEQUENCE_PLAYERS 4
|
||||
#define SEQUENCE_CHANNELS 48
|
||||
#define SEQUENCE_LAYERS 64
|
||||
@@ -120,7 +120,7 @@ struct NotePool {
|
||||
struct VibratoState {
|
||||
/*0x00, 0x00*/ struct SequenceChannel *seqChannel;
|
||||
/*0x04, 0x04*/ u32 time;
|
||||
#if defined(VERSION_EU) || defined(VERSION_SH)
|
||||
#if defined(VERSION_EU) || defined(VERSION_SH) || defined(VERSION_CN)
|
||||
/* , 0x08*/ s16 *curve;
|
||||
/* , 0x0C*/ f32 extent;
|
||||
/* , 0x10*/ f32 rate;
|
||||
@@ -167,7 +167,7 @@ struct AdpcmBook {
|
||||
};
|
||||
|
||||
struct AudioBankSample {
|
||||
#ifdef VERSION_SH
|
||||
#if defined(VERSION_SH) || defined(VERSION_CN)
|
||||
/* 0x00 */ u32 codec : 4;
|
||||
/* 0x00 */ u32 medium : 2;
|
||||
/* 0x00 */ u32 bit1 : 1;
|
||||
@@ -180,7 +180,7 @@ struct AudioBankSample {
|
||||
u8 *sampleAddr;
|
||||
struct AdpcmLoop *loop;
|
||||
struct AdpcmBook *book;
|
||||
#ifndef VERSION_SH
|
||||
#if !defined(VERSION_SH) && !defined(VERSION_CN)
|
||||
u32 sampleSize; // never read. either 0 or 1 mod 9, depending on padding
|
||||
#endif
|
||||
};
|
||||
@@ -215,12 +215,12 @@ struct AudioBank {
|
||||
}; // dynamic size
|
||||
|
||||
struct CtlEntry {
|
||||
#ifndef VERSION_SH
|
||||
#if !defined(VERSION_SH) && !defined(VERSION_CN)
|
||||
u8 unused;
|
||||
#endif
|
||||
u8 numInstruments;
|
||||
u8 numDrums;
|
||||
#ifdef VERSION_SH
|
||||
#if defined(VERSION_SH) || defined(VERSION_CN)
|
||||
u8 bankId1;
|
||||
u8 bankId2;
|
||||
#endif
|
||||
@@ -238,7 +238,7 @@ struct M64ScriptState {
|
||||
// Also known as a Group, according to debug strings.
|
||||
struct SequencePlayer {
|
||||
/*US/JP, EU, SH */
|
||||
#if defined(VERSION_EU) || defined(VERSION_SH)
|
||||
#if defined(VERSION_EU) || defined(VERSION_SH) || defined(VERSION_CN)
|
||||
/*0x000, 0x000, 0x000*/ u8 enabled : 1;
|
||||
#else
|
||||
/*0x000, 0x000*/ volatile u8 enabled : 1;
|
||||
@@ -247,10 +247,10 @@ struct SequencePlayer {
|
||||
/*0x000, 0x000*/ u8 muted : 1;
|
||||
/*0x000, 0x000*/ u8 seqDmaInProgress : 1;
|
||||
/*0x000, 0x000*/ u8 bankDmaInProgress : 1;
|
||||
#if defined(VERSION_EU) || defined(VERSION_SH)
|
||||
#if defined(VERSION_EU) || defined(VERSION_SH) || defined(VERSION_CN)
|
||||
/* 0x000*/ u8 recalculateVolume : 1;
|
||||
#endif
|
||||
#ifdef VERSION_SH
|
||||
#if defined(VERSION_SH) || defined(VERSION_CN)
|
||||
/* 0x000*/ u8 unkSh: 1;
|
||||
#endif
|
||||
#if defined(VERSION_JP) || defined(VERSION_US)
|
||||
@@ -267,7 +267,7 @@ struct SequencePlayer {
|
||||
/*0x008, ?????*/ u8 loadingBankNumInstruments;
|
||||
/*0x009, ?????*/ u8 loadingBankNumDrums;
|
||||
#endif
|
||||
#if defined(VERSION_EU) || defined(VERSION_SH)
|
||||
#if defined(VERSION_EU) || defined(VERSION_SH) || defined(VERSION_CN)
|
||||
/* , 0x007, 0x007*/ s8 seqVariationEu[1];
|
||||
#endif
|
||||
/*0x00A, 0x008*/ u16 tempo; // beats per minute in JP, tatums per minute in US/EU
|
||||
@@ -275,12 +275,12 @@ struct SequencePlayer {
|
||||
#if defined(VERSION_JP) || defined(VERSION_US)
|
||||
/*0x00E, 0x010*/ u16 fadeRemainingFrames;
|
||||
#endif
|
||||
#ifdef VERSION_SH
|
||||
#if defined(VERSION_SH) || defined(VERSION_CN)
|
||||
/* 0x00C*/ s16 tempoAdd;
|
||||
#endif
|
||||
/*0x010, 0x00C, 0x00E*/ s16 transposition;
|
||||
/*0x012, 0x00E, 0x010*/ u16 delay;
|
||||
#if defined(VERSION_EU) || defined(VERSION_SH)
|
||||
#if defined(VERSION_EU) || defined(VERSION_SH) || defined(VERSION_CN)
|
||||
/*0x00E, 0x010, 0x012*/ u16 fadeRemainingFrames;
|
||||
/* , 0x012, 0x014*/ u16 fadeTimerUnkEu;
|
||||
#endif
|
||||
@@ -289,7 +289,7 @@ struct SequencePlayer {
|
||||
/*0x01C, 0x01C*/ f32 fadeVelocity; // set to 0.0f
|
||||
/*0x020, 0x020, 0x024*/ f32 volume; // set to 0.0f
|
||||
/*0x024, 0x024*/ f32 muteVolumeScale; // set to 0.5f
|
||||
#if defined(VERSION_EU) || defined(VERSION_SH)
|
||||
#if defined(VERSION_EU) || defined(VERSION_SH) || defined(VERSION_CN)
|
||||
/* , 0x028, 0x02C*/ f32 fadeVolumeScale;
|
||||
/* , 0x02C*/ f32 appliedFadeVolume;
|
||||
#else
|
||||
@@ -316,7 +316,7 @@ struct SequencePlayer {
|
||||
|
||||
struct AdsrSettings {
|
||||
u8 releaseRate;
|
||||
#if defined(VERSION_EU) || defined(VERSION_SH)
|
||||
#if defined(VERSION_EU) || defined(VERSION_SH) || defined(VERSION_CN)
|
||||
u8 sustain;
|
||||
#else
|
||||
u16 sustain; // sustain level, 2^16 = max
|
||||
@@ -334,7 +334,7 @@ struct AdsrState {
|
||||
#endif
|
||||
/*0x08, 0x02*/ s16 envIndex;
|
||||
/*0x0A, 0x04*/ s16 delay;
|
||||
#if defined(VERSION_EU) || defined(VERSION_SH)
|
||||
#if defined(VERSION_EU) || defined(VERSION_SH) || defined(VERSION_CN)
|
||||
/* , 0x08*/ f32 sustain;
|
||||
/* , 0x0C*/ f32 velocity;
|
||||
/* , 0x10*/ f32 fadeOutVel;
|
||||
@@ -378,13 +378,13 @@ struct ReverbInfo {
|
||||
|
||||
struct NoteAttributes {
|
||||
u8 reverbVol;
|
||||
#ifdef VERSION_SH
|
||||
#if defined(VERSION_SH) || defined(VERSION_CN)
|
||||
u8 synthesisVolume; // UQ4.4, although 0 <= x < 1 is rounded up to 1
|
||||
#endif
|
||||
#if defined(VERSION_EU) || defined(VERSION_SH)
|
||||
#if defined(VERSION_EU) || defined(VERSION_SH) || defined(VERSION_CN)
|
||||
u8 pan;
|
||||
#endif
|
||||
#ifdef VERSION_SH
|
||||
#if defined(VERSION_SH) || defined(VERSION_CN)
|
||||
union ReverbBits reverbBits;
|
||||
#endif
|
||||
f32 freqScale;
|
||||
@@ -392,7 +392,7 @@ struct NoteAttributes {
|
||||
#if defined(VERSION_JP) || defined(VERSION_US)
|
||||
f32 pan;
|
||||
#endif
|
||||
#ifdef VERSION_SH
|
||||
#if defined(VERSION_SH) || defined(VERSION_CN)
|
||||
s16 *filter;
|
||||
#endif
|
||||
}; // size = 0x10
|
||||
@@ -409,7 +409,7 @@ 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
|
||||
#if defined(VERSION_EU) || defined(VERSION_SH)
|
||||
#if defined(VERSION_EU) || defined(VERSION_SH) || defined(VERSION_CN)
|
||||
/* , 0x01*/ union {
|
||||
struct {
|
||||
u8 freqScale : 1;
|
||||
@@ -423,11 +423,11 @@ struct SequenceChannel {
|
||||
/*0x02, 0x03, 0x03*/ u8 muteBehavior;
|
||||
/*0x03, 0x04, 0x04*/ u8 reverbVol; // until EU: Q1.7, after EU: UQ0.8
|
||||
/*0x04, ????*/ u8 notePriority; // 0-3
|
||||
#ifdef VERSION_SH
|
||||
#if defined(VERSION_SH) || defined(VERSION_CN)
|
||||
u8 unkSH06; // some priority
|
||||
#endif
|
||||
/*0x05, 0x06*/ u8 bankId;
|
||||
#if defined(VERSION_EU) || defined(VERSION_SH)
|
||||
#if defined(VERSION_EU) || defined(VERSION_SH) || defined(VERSION_CN)
|
||||
/* , 0x07*/ u8 reverbIndex;
|
||||
/* , 0x08, 0x09*/ u8 bookOffset;
|
||||
/* , 0x09*/ u8 newPan;
|
||||
@@ -435,7 +435,7 @@ struct SequenceChannel {
|
||||
#else
|
||||
/*0x06, */ u8 updatesPerFrameUnused;
|
||||
#endif
|
||||
#ifdef VERSION_SH
|
||||
#if defined(VERSION_SH) || defined(VERSION_CN)
|
||||
/* 0x0C*/ u8 synthesisVolume; // UQ4.4, although 0 <= x < 1 is rounded up to 1
|
||||
#endif
|
||||
/*0x08, 0x0C, 0x0E*/ u16 vibratoRateStart; // initially 0x800
|
||||
@@ -465,14 +465,14 @@ struct SequenceChannel {
|
||||
/*0x3C, 0x40*/ struct Instrument *instrument;
|
||||
/*0x40, 0x44*/ struct SequencePlayer *seqPlayer;
|
||||
/*0x44, 0x48*/ struct SequenceChannelLayer *layers[LAYERS_MAX];
|
||||
#ifndef VERSION_SH
|
||||
#if !defined(VERSION_SH) && !defined(VERSION_CN)
|
||||
/*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
|
||||
#endif
|
||||
/*0x5C, 0x60*/ struct M64ScriptState scriptState;
|
||||
/*0x78, 0x7C*/ struct AdsrSettings adsr;
|
||||
/*0x80, 0x84*/ struct NotePool notePool;
|
||||
#ifdef VERSION_SH
|
||||
#if defined(VERSION_SH) || defined(VERSION_CN)
|
||||
/* 0xC0*/ s8 soundScriptIO[8]; // bridge between sound script and audio lib. For player 2,
|
||||
// [0] contains enabled, [4] contains sound ID, [5] contains reverb adjustment
|
||||
/* 0xC8*/ u16 unkC8;
|
||||
@@ -487,11 +487,11 @@ struct SequenceChannelLayer {
|
||||
/*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
|
||||
#if defined(VERSION_EU) || defined(VERSION_SH)
|
||||
#if defined(VERSION_EU) || defined(VERSION_SH) || defined(VERSION_CN)
|
||||
/* , 0x00*/ u8 unusedEu0b8 : 1;
|
||||
/* , 0x00*/ u8 notePropertiesNeedInit : 1;
|
||||
/* , 0x00*/ u8 ignoreDrumPan : 1;
|
||||
#ifdef VERSION_SH
|
||||
#if defined(VERSION_SH) || defined(VERSION_CN)
|
||||
/* , , 0x01 */ union ReverbBits reverbBits;
|
||||
#endif
|
||||
/* , 0x01, 0x02*/ u8 instOrWave;
|
||||
@@ -499,7 +499,7 @@ struct SequenceChannelLayer {
|
||||
/*0x01, 0x02, 0x03*/ u8 status; // 0x03 in SH
|
||||
/*0x02, 0x03*/ u8 noteDuration; // set to 0x80
|
||||
/*0x03, 0x04*/ u8 portamentoTargetNote;
|
||||
#if defined(VERSION_EU) || defined(VERSION_SH)
|
||||
#if defined(VERSION_EU) || defined(VERSION_SH) || defined(VERSION_CN)
|
||||
/* , 0x05*/ u8 pan; // 0..128
|
||||
/* , 0x06, 0x07*/ u8 notePan;
|
||||
#endif
|
||||
@@ -510,7 +510,7 @@ struct SequenceChannelLayer {
|
||||
// (m64 instruction encoding only allows referring to the limited range
|
||||
// 0..0x3f; this makes 0x40..0x7f accessible as well)
|
||||
/*0x20, 0x24, 0x24*/ f32 freqScale;
|
||||
#ifdef VERSION_SH
|
||||
#if defined(VERSION_SH) || defined(VERSION_CN)
|
||||
/* 0x28*/ f32 freqScaleMultiplier;
|
||||
#endif
|
||||
/*0x24, 0x28, 0x2C*/ f32 velocitySquare;
|
||||
@@ -538,13 +538,13 @@ struct SequenceChannelLayer {
|
||||
#endif
|
||||
}; // size = 0x80
|
||||
|
||||
#if defined(VERSION_EU) || defined(VERSION_SH)
|
||||
#if defined(VERSION_EU) || defined(VERSION_SH) || defined(VERSION_CN)
|
||||
struct NoteSynthesisState {
|
||||
/*0x00*/ u8 restart;
|
||||
/*0x01*/ u8 sampleDmaIndex;
|
||||
/*0x02*/ u8 prevHeadsetPanRight;
|
||||
/*0x03*/ u8 prevHeadsetPanLeft;
|
||||
#ifdef VERSION_SH
|
||||
#if defined(VERSION_SH) || defined(VERSION_CN)
|
||||
/* 0x04*/ u8 reverbVol;
|
||||
/* 0x05*/ u8 unk5;
|
||||
#endif
|
||||
@@ -559,7 +559,7 @@ struct NotePlaybackState {
|
||||
/*0x04, 0x00, 0x00*/ u8 priority;
|
||||
/* 0x01, 0x01*/ u8 waveId;
|
||||
/* 0x02, 0x02*/ u8 sampleCountIndex;
|
||||
#ifdef VERSION_SH
|
||||
#if defined(VERSION_SH) || defined(VERSION_CN)
|
||||
/* 0x03*/ u8 bankId;
|
||||
/* 0x04*/ u8 unkSH34;
|
||||
#endif
|
||||
@@ -602,7 +602,7 @@ struct NoteSubEu {
|
||||
s16 *samples;
|
||||
struct AudioBankSound *audioBankSound;
|
||||
} sound;
|
||||
#ifdef VERSION_SH
|
||||
#if defined(VERSION_SH) || defined(VERSION_CN)
|
||||
/*0x10*/ s16 *filter;
|
||||
#endif
|
||||
};
|
||||
@@ -622,7 +622,7 @@ struct Note {
|
||||
/*0x04, 0x30, 0x30*/ u8 priority;
|
||||
/* 0x31, 0x31*/ u8 waveId;
|
||||
/* 0x32, 0x32*/ u8 sampleCountIndex;
|
||||
#ifdef VERSION_SH
|
||||
#if defined(VERSION_SH) || defined(VERSION_CN)
|
||||
/* 0x33*/ u8 bankId;
|
||||
/* 0x34*/ u8 unkSH34;
|
||||
#endif
|
||||
@@ -699,7 +699,7 @@ struct Note {
|
||||
struct NoteSynthesisBuffers {
|
||||
s16 adpcmdecState[0x10];
|
||||
s16 finalResampleState[0x10];
|
||||
#ifdef VERSION_SH
|
||||
#if defined(VERSION_SH) || defined(VERSION_CN)
|
||||
s16 unk[0x10];
|
||||
s16 filterBuffer[0x20];
|
||||
s16 panSamplesBuffer[0x20];
|
||||
@@ -745,12 +745,12 @@ struct AudioSessionSettingsEU {
|
||||
/* 0x0E */ u16 unk3; // always 0
|
||||
/* 0x10 */ u32 persistentSeqMem;
|
||||
/* 0x14 */ u32 persistentBankMem;
|
||||
#ifdef VERSION_SH
|
||||
#if defined(VERSION_SH) || defined(VERSION_CN)
|
||||
/* 0x18 */ u32 unk18; // always 0
|
||||
#endif
|
||||
/* 0x18, 0x1C */ u32 temporarySeqMem;
|
||||
/* 0x1C, 0x20 */ u32 temporaryBankMem;
|
||||
#ifdef VERSION_SH
|
||||
#if defined(VERSION_SH) || defined(VERSION_CN)
|
||||
/* 0x24 */ u32 unk24; // always 0
|
||||
/* 0x28 */ u32 unkMem28; // always 0
|
||||
/* 0x2C */ u32 unkMem2C; // always 0
|
||||
@@ -825,7 +825,7 @@ struct EuAudioCmd {
|
||||
} u2;
|
||||
};
|
||||
|
||||
#ifdef VERSION_SH
|
||||
#if defined(VERSION_SH) || defined(VERSION_CN)
|
||||
struct PendingDmaSample {
|
||||
u8 medium;
|
||||
u8 bankId;
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
#ifndef VERSION_SH
|
||||
#if !defined(VERSION_SH) && !defined(VERSION_CN)
|
||||
#include <ultra64.h>
|
||||
#include <PR/os.h>
|
||||
|
||||
@@ -71,7 +71,7 @@ struct CtlEntry *gCtlEntries; // sh: 0x803505F8
|
||||
#if defined(VERSION_EU)
|
||||
u32 padEuBss1;
|
||||
struct AudioBufferParametersEU gAudioBufferParameters;
|
||||
#elif defined(VERSION_US) || defined(VERSION_JP)
|
||||
#else
|
||||
s32 gAiFrequency;
|
||||
#endif
|
||||
|
||||
|
||||
@@ -36,11 +36,11 @@ extern ALSeqFile *gSeqFileHeader;
|
||||
extern u8 *gAlBankSets;
|
||||
|
||||
extern struct CtlEntry *gCtlEntries;
|
||||
#if defined(VERSION_EU) || defined(VERSION_SH)
|
||||
#if defined(VERSION_EU) || defined(VERSION_SH) || defined(VERSION_CN)
|
||||
extern struct AudioBufferParametersEU gAudioBufferParameters;
|
||||
#endif
|
||||
extern s32 gAiFrequency;
|
||||
#ifdef VERSION_SH
|
||||
#if defined(VERSION_SH) || defined(VERSION_CN)
|
||||
extern s16 gCurrAiBufferLength;
|
||||
extern s32 D_SH_8034F68C;
|
||||
#endif
|
||||
@@ -53,7 +53,7 @@ extern s16 gTempoInternalToExternal;
|
||||
extern s8 gAudioUpdatesPerFrame; // = 4
|
||||
extern s8 gSoundMode;
|
||||
|
||||
#ifdef VERSION_SH
|
||||
#if defined(VERSION_SH) || defined(VERSION_CN)
|
||||
extern OSMesgQueue gUnkQueue1;
|
||||
|
||||
struct UnkStructSH8034EC88 {
|
||||
@@ -78,25 +78,25 @@ extern struct UnkStructSH8034EC88 D_SH_8034EC88[0x80];
|
||||
|
||||
void audio_dma_partial_copy_async(uintptr_t *devAddr, u8 **vAddr, ssize_t *remaining, OSMesgQueue *queue, OSIoMesg *mesg);
|
||||
void decrease_sample_dma_ttls(void);
|
||||
#ifdef VERSION_SH
|
||||
#if defined(VERSION_SH) || defined(VERSION_CN)
|
||||
void *dma_sample_data(uintptr_t devAddr, u32 size, s32 arg2, u8 *dmaIndexRef, s32 medium);
|
||||
#else
|
||||
void *dma_sample_data(uintptr_t devAddr, u32 size, s32 arg2, u8 *dmaIndexRef);
|
||||
#endif
|
||||
void init_sample_dma_buffers(s32 arg0);
|
||||
#if defined(VERSION_SH)
|
||||
#if defined(VERSION_SH) || defined(VERSION_CN)
|
||||
void patch_audio_bank(s32 bankId, struct AudioBank *mem, struct PatchStruct *patchInfo);
|
||||
#else
|
||||
void patch_audio_bank(struct AudioBank *mem, u8 *offset, u32 numInstruments, u32 numDrums);
|
||||
#endif
|
||||
#ifdef VERSION_SH
|
||||
#if defined(VERSION_SH) || defined(VERSION_CN)
|
||||
void preload_sequence(u32 seqId, s32 preloadMask);
|
||||
#else
|
||||
void preload_sequence(u32 seqId, u8 preloadMask);
|
||||
#endif
|
||||
void load_sequence(u32 player, u32 seqId, s32 loadAsync);
|
||||
|
||||
#ifdef VERSION_SH
|
||||
#if defined(VERSION_SH) || defined(VERSION_CN)
|
||||
void func_sh_802f3158(s32 seqId, s32 arg1, s32 arg2, OSMesgQueue *retQueue);
|
||||
u8 *func_sh_802f3220(u32 seqId, u32 *a1);
|
||||
struct AudioBankSample *func_sh_802f4978(s32 bankId, s32 idx);
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
#ifdef VERSION_SH
|
||||
#if defined(VERSION_SH) || defined(VERSION_CN)
|
||||
#include <ultra64.h>
|
||||
#include <PR/os.h>
|
||||
|
||||
@@ -983,7 +983,6 @@ void func_sh_802f41e4(s32 audioResetStatus) {
|
||||
func_sh_802f4dcc(audioResetStatus);
|
||||
}
|
||||
|
||||
#if defined(VERSION_SH)
|
||||
u8 gShindouSoundBanksHeader[] = {
|
||||
#include "sound/ctl_header.inc.c"
|
||||
};
|
||||
@@ -999,7 +998,6 @@ u8 gShindouSampleBanksHeader[] = {
|
||||
u8 gShindouSequencesHeader[] = {
|
||||
#include "sound/sequences_header.inc.c"
|
||||
};
|
||||
#endif
|
||||
|
||||
// (void) must be omitted from parameters
|
||||
void audio_init() {
|
||||
|
||||
@@ -11,8 +11,8 @@
|
||||
|
||||
void note_set_resampling_rate(struct Note *note, f32 resamplingRateInput);
|
||||
|
||||
#if defined(VERSION_EU) || defined(VERSION_SH)
|
||||
#ifdef VERSION_SH
|
||||
#if defined(VERSION_EU) || defined(VERSION_SH) || defined(VERSION_CN)
|
||||
#if defined(VERSION_SH) || defined(VERSION_CN)
|
||||
void note_set_vel_pan_reverb(struct Note *note, struct ReverbInfo *reverbInfo)
|
||||
#else
|
||||
void note_set_vel_pan_reverb(struct Note *note, f32 velocity, u8 pan, u8 reverbVol)
|
||||
@@ -34,7 +34,7 @@ void note_set_vel_pan_reverb(struct Note *note, f32 velocity, u8 pan, u8 reverbV
|
||||
struct ReverbBitsData reverbBits;
|
||||
#endif
|
||||
|
||||
#ifdef VERSION_SH
|
||||
#if defined(VERSION_SH) || defined(VERSION_CN)
|
||||
note_set_resampling_rate(note, reverbInfo->freqScale);
|
||||
velocity = reverbInfo->velocity;
|
||||
pan = reverbInfo->pan;
|
||||
@@ -46,7 +46,7 @@ void note_set_vel_pan_reverb(struct Note *note, f32 velocity, u8 pan, u8 reverbV
|
||||
#endif
|
||||
|
||||
if (note->noteSubEu.stereoHeadsetEffects && gSoundMode == SOUND_MODE_HEADSET) {
|
||||
#ifdef VERSION_SH
|
||||
#if defined(VERSION_SH) || defined(VERSION_CN)
|
||||
smallPanIndex = pan >> 1;
|
||||
#else
|
||||
smallPanIndex = pan >> 3;
|
||||
@@ -64,7 +64,7 @@ void note_set_vel_pan_reverb(struct Note *note, f32 velocity, u8 pan, u8 reverbV
|
||||
volLeft = gHeadsetPanVolume[pan];
|
||||
volRight = gHeadsetPanVolume[127 - pan];
|
||||
} else if (sub->stereoHeadsetEffects && gSoundMode == SOUND_MODE_STEREO) {
|
||||
#ifdef VERSION_SH
|
||||
#if defined(VERSION_SH) || defined(VERSION_CN)
|
||||
strongRight = FALSE;
|
||||
strongLeft = FALSE;
|
||||
sub->headsetPanRight = 0;
|
||||
@@ -89,7 +89,7 @@ void note_set_vel_pan_reverb(struct Note *note, f32 velocity, u8 pan, u8 reverbV
|
||||
sub->stereoStrongRight = strongRight;
|
||||
sub->stereoStrongLeft = strongLeft;
|
||||
|
||||
#ifdef VERSION_SH
|
||||
#if defined(VERSION_SH) || defined(VERSION_CN)
|
||||
switch (reverbBits.stereoHeadsetEffects) {
|
||||
case 0:
|
||||
sub->stereoStrongRight = reverbBits.strongRight;
|
||||
@@ -118,7 +118,7 @@ void note_set_vel_pan_reverb(struct Note *note, f32 velocity, u8 pan, u8 reverbV
|
||||
volRight = gDefaultPanVolume[127 - pan];
|
||||
}
|
||||
|
||||
#ifdef VERSION_SH
|
||||
#if defined(VERSION_SH) || defined(VERSION_CN)
|
||||
if (velocity < 0.0f) {
|
||||
velocity = 0.0f;
|
||||
}
|
||||
@@ -146,7 +146,7 @@ void note_set_vel_pan_reverb(struct Note *note, f32 velocity, u8 pan, u8 reverbV
|
||||
|
||||
//! @bug for the change to UQ0.7, the if statement should also have been changed accordingly
|
||||
if (sub->reverbVol != reverbVol) {
|
||||
#ifdef VERSION_SH
|
||||
#if defined(VERSION_SH) || defined(VERSION_CN)
|
||||
sub->reverbVol = reverbVol >> 1;
|
||||
#else
|
||||
sub->reverbVol = reverbVol;
|
||||
@@ -162,7 +162,7 @@ void note_set_vel_pan_reverb(struct Note *note, f32 velocity, u8 pan, u8 reverbV
|
||||
}
|
||||
}
|
||||
|
||||
#ifdef VERSION_SH
|
||||
#if defined(VERSION_SH) || defined(VERSION_CN)
|
||||
#define MIN_RESAMPLING_RATE 1.99998f
|
||||
#else
|
||||
#define MIN_RESAMPLING_RATE 1.99996f
|
||||
@@ -255,7 +255,7 @@ struct Instrument *get_instrument_inner(s32 bankId, s32 instId) {
|
||||
struct Drum *get_drum(s32 bankId, s32 drumId) {
|
||||
struct Drum *drum;
|
||||
|
||||
#ifdef VERSION_SH
|
||||
#if defined(VERSION_SH) || defined(VERSION_CN)
|
||||
if (IS_BANK_LOAD_COMPLETE(bankId) == FALSE) {
|
||||
stubbed_printf("Audio: voiceman: No bank error %d\n", bankId);
|
||||
gAudioErrorFlags = bankId + 0x10000000;
|
||||
@@ -287,7 +287,7 @@ struct Drum *get_drum(s32 bankId, s32 drumId) {
|
||||
#endif
|
||||
#endif // VERSION_EU
|
||||
|
||||
#if defined(VERSION_EU) || defined(VERSION_SH)
|
||||
#if defined(VERSION_EU) || defined(VERSION_SH) || defined(VERSION_CN)
|
||||
void note_init_for_layer(struct Note *note, struct SequenceChannelLayer *seqLayer);
|
||||
#else
|
||||
s32 note_init_for_layer(struct Note *note, struct SequenceChannelLayer *seqLayer);
|
||||
@@ -299,11 +299,11 @@ void note_init(struct Note *note) {
|
||||
} else {
|
||||
adsr_init(¬e->adsr, note->parentLayer->adsr.envelope, ¬e->adsrVolScale);
|
||||
}
|
||||
#ifdef VERSION_SH
|
||||
#if defined(VERSION_SH) || defined(VERSION_CN)
|
||||
note->unkSH34 = 0;
|
||||
#endif
|
||||
note->adsr.state = ADSR_STATE_INITIAL;
|
||||
#if defined(VERSION_EU) || defined(VERSION_SH)
|
||||
#if defined(VERSION_EU) || defined(VERSION_SH) || defined(VERSION_CN)
|
||||
note->noteSubEu = gDefaultNoteSub;
|
||||
#else
|
||||
note_init_volume(note);
|
||||
@@ -311,7 +311,7 @@ void note_init(struct Note *note) {
|
||||
#endif
|
||||
}
|
||||
|
||||
#if defined(VERSION_EU) || defined(VERSION_SH)
|
||||
#if defined(VERSION_EU) || defined(VERSION_SH) || defined(VERSION_CN)
|
||||
#define note_disable2 note_disable
|
||||
void note_disable(struct Note *note) {
|
||||
if (note->noteSubEu.needsInit == TRUE) {
|
||||
@@ -323,14 +323,14 @@ void note_disable(struct Note *note) {
|
||||
}
|
||||
#endif
|
||||
note->priority = NOTE_PRIORITY_DISABLED;
|
||||
#ifdef VERSION_SH
|
||||
#if defined(VERSION_SH) || defined(VERSION_CN)
|
||||
note->unkSH34 = 0;
|
||||
#endif
|
||||
note->parentLayer = NO_LAYER;
|
||||
note->prevParentLayer = NO_LAYER;
|
||||
note->noteSubEu.enabled = FALSE;
|
||||
note->noteSubEu.finished = FALSE;
|
||||
#ifdef VERSION_SH
|
||||
#if defined(VERSION_SH) || defined(VERSION_CN)
|
||||
note->adsr.state = ADSR_STATE_DISABLED;
|
||||
note->adsr.current = 0;
|
||||
#endif
|
||||
@@ -343,7 +343,7 @@ void note_disable2(struct Note *note) {
|
||||
|
||||
void process_notes(void) {
|
||||
f32 scale;
|
||||
#ifndef VERSION_SH
|
||||
#if !defined(VERSION_SH) && !defined(VERSION_CN)
|
||||
f32 frequency;
|
||||
#if defined(VERSION_JP) || defined(VERSION_US)
|
||||
u8 reverbVol;
|
||||
@@ -355,10 +355,10 @@ void process_notes(void) {
|
||||
#endif
|
||||
#endif
|
||||
struct Note *note;
|
||||
#if defined(VERSION_EU) || defined(VERSION_SH)
|
||||
#if defined(VERSION_EU) || defined(VERSION_SH) || defined(VERSION_CN)
|
||||
struct NotePlaybackState *playbackState;
|
||||
struct NoteSubEu *noteSubEu;
|
||||
#ifndef VERSION_SH
|
||||
#ifdef VERSION_EU
|
||||
UNUSED u8 pad[12];
|
||||
u8 reverbVol;
|
||||
UNUSED u8 pad3;
|
||||
@@ -389,7 +389,7 @@ void process_notes(void) {
|
||||
|
||||
for (i = 0; i < gMaxSimultaneousNotes; i++) {
|
||||
note = &gNotes[i];
|
||||
#if defined(VERSION_EU) || defined(VERSION_SH)
|
||||
#if defined(VERSION_EU) || defined(VERSION_SH) || defined(VERSION_CN)
|
||||
playbackState = (struct NotePlaybackState *) ¬e->priority;
|
||||
if (note->parentLayer != NO_LAYER) {
|
||||
#ifndef NO_SEGMENTED_MEMORY
|
||||
@@ -397,7 +397,7 @@ void process_notes(void) {
|
||||
continue;
|
||||
}
|
||||
#endif
|
||||
#ifdef VERSION_SH
|
||||
#if defined(VERSION_SH) || defined(VERSION_CN)
|
||||
if (note != playbackState->parentLayer->note && playbackState->unkSH34 == 0) {
|
||||
playbackState->adsr.action |= ADSR_ACTION_RELEASE;
|
||||
playbackState->adsr.fadeOutVel = gAudioBufferParameters.updatesPerFrameInv;
|
||||
@@ -456,11 +456,11 @@ void process_notes(void) {
|
||||
#endif
|
||||
d:
|
||||
if (playbackState->priority != NOTE_PRIORITY_DISABLED) {
|
||||
#ifdef VERSION_SH
|
||||
#if defined(VERSION_SH) || defined(VERSION_CN)
|
||||
if (1) {}
|
||||
#endif
|
||||
noteSubEu = ¬e->noteSubEu;
|
||||
#ifdef VERSION_SH
|
||||
#if defined(VERSION_SH) || defined(VERSION_CN)
|
||||
if (playbackState->unkSH34 >= 1 || noteSubEu->finished) {
|
||||
#else
|
||||
if (playbackState->priority == NOTE_PRIORITY_STOPPING || noteSubEu->finished) {
|
||||
@@ -490,7 +490,7 @@ void process_notes(void) {
|
||||
goto skip;
|
||||
}
|
||||
}
|
||||
#ifndef VERSION_SH
|
||||
#if !defined(VERSION_SH) && !defined(VERSION_CN)
|
||||
if (1) {
|
||||
}
|
||||
#endif
|
||||
@@ -504,7 +504,7 @@ void process_notes(void) {
|
||||
scale = adsr_update(&playbackState->adsr);
|
||||
note_vibrato_update(note);
|
||||
attributes = &playbackState->attributes;
|
||||
#ifdef VERSION_SH
|
||||
#if defined(VERSION_SH) || defined(VERSION_CN)
|
||||
if (playbackState->unkSH34 == 1 || playbackState->unkSH34 == 2) {
|
||||
reverbInfo.freqScale = attributes->freqScale;
|
||||
reverbInfo.velocity = attributes->velocity;
|
||||
@@ -631,7 +631,7 @@ void process_notes(void) {
|
||||
#undef POP
|
||||
}
|
||||
|
||||
#if defined(VERSION_SH)
|
||||
#if defined(VERSION_SH) || defined(VERSION_CN)
|
||||
// These three are matching but have been moved from above in shindou:
|
||||
struct AudioBankSound *instrument_get_audio_bank_sound(struct Instrument *instrument, s32 semitone) {
|
||||
struct AudioBankSound *sound;
|
||||
@@ -701,7 +701,7 @@ void seq_channel_layer_decay_release_internal(struct SequenceChannelLayer *seqLa
|
||||
return;
|
||||
}
|
||||
|
||||
#ifdef VERSION_SH
|
||||
#if defined(VERSION_SH) || defined(VERSION_CN)
|
||||
seqLayer->status = SOUND_LOAD_STATUS_NOT_LOADED;
|
||||
#endif
|
||||
|
||||
@@ -724,7 +724,7 @@ void seq_channel_layer_decay_release_internal(struct SequenceChannelLayer *seqLa
|
||||
|
||||
if (note->parentLayer != seqLayer) {
|
||||
|
||||
#if defined(VERSION_EU) || defined(VERSION_SH)
|
||||
#if defined(VERSION_EU) || defined(VERSION_SH) || defined(VERSION_CN)
|
||||
if (note->parentLayer == NO_LAYER && note->wantedParentLayer == NO_LAYER &&
|
||||
note->prevParentLayer == seqLayer && target != ADSR_STATE_DECAY) {
|
||||
// Just guessing that this printf goes here... it's hard to parse.
|
||||
@@ -736,19 +736,19 @@ void seq_channel_layer_decay_release_internal(struct SequenceChannelLayer *seqLa
|
||||
return;
|
||||
}
|
||||
|
||||
#ifndef VERSION_SH
|
||||
#if !defined(VERSION_SH) && !defined(VERSION_CN)
|
||||
seqLayer->status = SOUND_LOAD_STATUS_NOT_LOADED;
|
||||
#endif
|
||||
if (note->adsr.state != ADSR_STATE_DECAY) {
|
||||
attributes->freqScale = seqLayer->noteFreqScale;
|
||||
attributes->velocity = seqLayer->noteVelocity;
|
||||
attributes->pan = seqLayer->notePan;
|
||||
#ifdef VERSION_SH
|
||||
#if defined(VERSION_SH) || defined(VERSION_CN)
|
||||
attributes->reverbBits = seqLayer->reverbBits;
|
||||
#endif
|
||||
if (seqLayer->seqChannel != NULL) {
|
||||
attributes->reverbVol = seqLayer->seqChannel->reverbVol;
|
||||
#ifdef VERSION_SH
|
||||
#if defined(VERSION_SH) || defined(VERSION_CN)
|
||||
attributes->synthesisVolume = seqLayer->seqChannel->synthesisVolume;
|
||||
attributes->filter = seqLayer->seqChannel->filter;
|
||||
if (seqLayer->seqChannel->seqPlayer->muted && (seqLayer->seqChannel->muteBehavior & 8) != 0) {
|
||||
@@ -757,31 +757,31 @@ void seq_channel_layer_decay_release_internal(struct SequenceChannelLayer *seqLa
|
||||
note->priority = seqLayer->seqChannel->unkSH06;
|
||||
#endif
|
||||
}
|
||||
#ifdef VERSION_SH
|
||||
#if defined(VERSION_SH) || defined(VERSION_CN)
|
||||
else {
|
||||
#endif
|
||||
note->priority = NOTE_PRIORITY_STOPPING;
|
||||
#ifdef VERSION_SH
|
||||
#if defined(VERSION_SH) || defined(VERSION_CN)
|
||||
}
|
||||
#endif
|
||||
note->prevParentLayer = note->parentLayer;
|
||||
note->parentLayer = NO_LAYER;
|
||||
if (target == ADSR_STATE_RELEASE) {
|
||||
#if defined(VERSION_EU) || defined(VERSION_SH)
|
||||
#if defined(VERSION_EU) || defined(VERSION_SH) || defined(VERSION_CN)
|
||||
note->adsr.fadeOutVel = gAudioBufferParameters.updatesPerFrameInv;
|
||||
#else
|
||||
note->adsr.fadeOutVel = 0x8000 / gAudioUpdatesPerFrame;
|
||||
#endif
|
||||
note->adsr.action |= ADSR_ACTION_RELEASE;
|
||||
#ifdef VERSION_SH
|
||||
#if defined(VERSION_SH) || defined(VERSION_CN)
|
||||
note->unkSH34 = 2;
|
||||
#endif
|
||||
} else {
|
||||
#ifdef VERSION_SH
|
||||
#if defined(VERSION_SH) || defined(VERSION_CN)
|
||||
note->unkSH34 = 1;
|
||||
#endif
|
||||
note->adsr.action |= ADSR_ACTION_DECAY;
|
||||
#if defined(VERSION_EU) || defined(VERSION_SH)
|
||||
#if defined(VERSION_EU) || defined(VERSION_SH) || defined(VERSION_CN)
|
||||
if (seqLayer->adsr.releaseRate == 0) {
|
||||
note->adsr.fadeOutVel = seqLayer->seqChannel->adsr.releaseRate * gAudioBufferParameters.unkUpdatesPerFrameScaled;
|
||||
} else {
|
||||
@@ -813,7 +813,7 @@ void seq_channel_layer_note_release(struct SequenceChannelLayer *seqLayer) {
|
||||
seq_channel_layer_decay_release_internal(seqLayer, ADSR_STATE_RELEASE);
|
||||
}
|
||||
|
||||
#if defined(VERSION_EU) || defined(VERSION_SH)
|
||||
#if defined(VERSION_EU) || defined(VERSION_SH) || defined(VERSION_CN)
|
||||
s32 build_synthetic_wave(struct Note *note, struct SequenceChannelLayer *seqLayer, s32 waveId) {
|
||||
f32 freqScale;
|
||||
f32 ratio;
|
||||
@@ -910,7 +910,7 @@ void build_synthetic_wave(struct Note *note, struct SequenceChannelLayer *seqLay
|
||||
#endif
|
||||
|
||||
void init_synthetic_wave(struct Note *note, struct SequenceChannelLayer *seqLayer) {
|
||||
#if defined(VERSION_EU) || defined(VERSION_SH)
|
||||
#if defined(VERSION_EU) || defined(VERSION_SH) || defined(VERSION_CN)
|
||||
s32 sampleCountIndex;
|
||||
s32 waveSampleCountIndex;
|
||||
s32 waveId = seqLayer->instOrWave;
|
||||
@@ -919,7 +919,7 @@ void init_synthetic_wave(struct Note *note, struct SequenceChannelLayer *seqLaye
|
||||
}
|
||||
sampleCountIndex = note->sampleCountIndex;
|
||||
waveSampleCountIndex = build_synthetic_wave(note, seqLayer, waveId);
|
||||
#if defined(VERSION_EU) || defined(VERSION_SH)
|
||||
#if defined(VERSION_EU) || defined(VERSION_SH) || defined(VERSION_CN)
|
||||
note->synthesisState.samplePosInt = note->synthesisState.samplePosInt * euUnknownData_8030194c[waveSampleCountIndex] / euUnknownData_8030194c[sampleCountIndex];
|
||||
#else // Not a real change. Just temporary so I can remove this variable.
|
||||
note->synthesisState.samplePosInt = note->synthesisState.samplePosInt * gDefaultShortNoteVelocityTable[waveSampleCountIndex] / gDefaultShortNoteVelocityTable[sampleCountIndex];
|
||||
@@ -993,7 +993,7 @@ void note_pool_clear(struct NotePool *pool) {
|
||||
break;
|
||||
}
|
||||
|
||||
#if defined(VERSION_EU) || defined(VERSION_SH)
|
||||
#if defined(VERSION_EU) || defined(VERSION_SH) || defined(VERSION_CN)
|
||||
for (;;) {
|
||||
cur = source->next;
|
||||
if (cur == source) {
|
||||
@@ -1108,7 +1108,7 @@ struct Note *pop_node_with_lower_prio(struct AudioListItem *list, s32 limit) {
|
||||
}
|
||||
}
|
||||
|
||||
#if defined(VERSION_EU) || defined(VERSION_SH)
|
||||
#if defined(VERSION_EU) || defined(VERSION_SH) || defined(VERSION_CN)
|
||||
if (best == NULL) {
|
||||
return NULL;
|
||||
}
|
||||
@@ -1122,13 +1122,13 @@ struct Note *pop_node_with_lower_prio(struct AudioListItem *list, s32 limit) {
|
||||
}
|
||||
#endif
|
||||
|
||||
#ifndef VERSION_SH
|
||||
#if !defined(VERSION_SH) && !defined(VERSION_CN)
|
||||
audio_list_remove(best);
|
||||
#endif
|
||||
return best->u.value;
|
||||
}
|
||||
|
||||
#if defined(VERSION_EU) || defined(VERSION_SH)
|
||||
#if defined(VERSION_EU) || defined(VERSION_SH) || defined(VERSION_CN)
|
||||
void note_init_for_layer(struct Note *note, struct SequenceChannelLayer *seqLayer) {
|
||||
UNUSED s32 pad[4];
|
||||
s16 instId;
|
||||
@@ -1159,7 +1159,7 @@ void note_init_for_layer(struct Note *note, struct SequenceChannelLayer *seqLaye
|
||||
if (sub->isSyntheticWave) {
|
||||
build_synthetic_wave(note, seqLayer, instId);
|
||||
}
|
||||
#ifdef VERSION_SH
|
||||
#if defined(VERSION_SH) || defined(VERSION_CN)
|
||||
note->bankId = seqLayer->seqChannel->bankId;
|
||||
#else
|
||||
sub->bankId = seqLayer->seqChannel->bankId;
|
||||
@@ -1198,13 +1198,13 @@ void func_80319728(struct Note *note, struct SequenceChannelLayer *seqLayer) {
|
||||
|
||||
void note_release_and_take_ownership(struct Note *note, struct SequenceChannelLayer *seqLayer) {
|
||||
note->wantedParentLayer = seqLayer;
|
||||
#ifdef VERSION_SH
|
||||
#if defined(VERSION_SH) || defined(VERSION_CN)
|
||||
note->priority = seqLayer->seqChannel->notePriority;
|
||||
#else
|
||||
note->priority = NOTE_PRIORITY_STOPPING;
|
||||
#endif
|
||||
|
||||
#if defined(VERSION_EU) || defined(VERSION_SH)
|
||||
#if defined(VERSION_EU) || defined(VERSION_SH) || defined(VERSION_CN)
|
||||
note->adsr.fadeOutVel = gAudioBufferParameters.updatesPerFrameInv;
|
||||
#else
|
||||
note->adsr.fadeOutVel = 0x8000 / gAudioUpdatesPerFrame;
|
||||
@@ -1215,7 +1215,7 @@ void note_release_and_take_ownership(struct Note *note, struct SequenceChannelLa
|
||||
struct Note *alloc_note_from_disabled(struct NotePool *pool, struct SequenceChannelLayer *seqLayer) {
|
||||
struct Note *note = audio_list_pop_back(&pool->disabled);
|
||||
if (note != NULL) {
|
||||
#if defined(VERSION_EU) || defined(VERSION_SH)
|
||||
#if defined(VERSION_EU) || defined(VERSION_SH) || defined(VERSION_CN)
|
||||
note_init_for_layer(note, seqLayer);
|
||||
#else
|
||||
if (note_init_for_layer(note, seqLayer) == TRUE) {
|
||||
@@ -1238,11 +1238,11 @@ struct Note *alloc_note_from_decaying(struct NotePool *pool, struct SequenceChan
|
||||
}
|
||||
|
||||
struct Note *alloc_note_from_active(struct NotePool *pool, struct SequenceChannelLayer *seqLayer) {
|
||||
#ifdef VERSION_SH
|
||||
#if defined(VERSION_SH) || defined(VERSION_CN)
|
||||
struct Note *rNote;
|
||||
#endif
|
||||
struct Note *aNote;
|
||||
#ifdef VERSION_SH
|
||||
#if defined(VERSION_SH) || defined(VERSION_CN)
|
||||
s32 rPriority, aPriority;
|
||||
rPriority = aPriority = 0x10;
|
||||
|
||||
@@ -1258,7 +1258,7 @@ struct Note *alloc_note_from_active(struct NotePool *pool, struct SequenceChanne
|
||||
if (aNote == NULL) {
|
||||
eu_stubbed_printf_0("Audio: C-Alloc : lowerPrio is NULL\n");
|
||||
} else {
|
||||
#ifdef VERSION_SH
|
||||
#if defined(VERSION_SH) || defined(VERSION_CN)
|
||||
aPriority = aNote->priority;
|
||||
#else
|
||||
func_80319728(aNote, seqLayer);
|
||||
@@ -1266,7 +1266,7 @@ struct Note *alloc_note_from_active(struct NotePool *pool, struct SequenceChanne
|
||||
#endif
|
||||
}
|
||||
|
||||
#ifdef VERSION_SH
|
||||
#if defined(VERSION_SH) || defined(VERSION_CN)
|
||||
if (rNote == NULL && aNote == NULL) {
|
||||
return NULL;
|
||||
}
|
||||
@@ -1293,13 +1293,13 @@ struct Note *alloc_note(struct SequenceChannelLayer *seqLayer) {
|
||||
if (policy & NOTE_ALLOC_LAYER) {
|
||||
ret = seqLayer->note;
|
||||
if (ret != NULL && ret->prevParentLayer == seqLayer
|
||||
#if defined(VERSION_EU) || defined(VERSION_SH)
|
||||
#if defined(VERSION_EU) || defined(VERSION_SH) || defined(VERSION_CN)
|
||||
&& ret->wantedParentLayer == NO_LAYER
|
||||
#endif
|
||||
) {
|
||||
note_release_and_take_ownership(ret, seqLayer);
|
||||
audio_list_remove(&ret->listItem);
|
||||
#if defined(VERSION_EU) || defined(VERSION_SH)
|
||||
#if defined(VERSION_EU) || defined(VERSION_SH) || defined(VERSION_CN)
|
||||
audio_list_push_back(&ret->listItem.pool->releasing, &ret->listItem);
|
||||
#else
|
||||
audio_list_push_back(&gNoteFreeLists.releasing, &ret->listItem);
|
||||
@@ -1312,7 +1312,7 @@ struct Note *alloc_note(struct SequenceChannelLayer *seqLayer) {
|
||||
if (!(ret = alloc_note_from_disabled(&seqLayer->seqChannel->notePool, seqLayer))
|
||||
&& !(ret = alloc_note_from_decaying(&seqLayer->seqChannel->notePool, seqLayer))
|
||||
&& !(ret = alloc_note_from_active(&seqLayer->seqChannel->notePool, seqLayer))) {
|
||||
#ifdef VERSION_SH
|
||||
#if defined(VERSION_SH) || defined(VERSION_CN)
|
||||
goto null_return;
|
||||
#else
|
||||
eu_stubbed_printf_0("Sub Limited Warning: Drop Voice");
|
||||
@@ -1330,7 +1330,7 @@ struct Note *alloc_note(struct SequenceChannelLayer *seqLayer) {
|
||||
&& !(ret = alloc_note_from_decaying(&seqLayer->seqChannel->seqPlayer->notePool, seqLayer))
|
||||
&& !(ret = alloc_note_from_active(&seqLayer->seqChannel->notePool, seqLayer))
|
||||
&& !(ret = alloc_note_from_active(&seqLayer->seqChannel->seqPlayer->notePool, seqLayer))) {
|
||||
#ifdef VERSION_SH
|
||||
#if defined(VERSION_SH) || defined(VERSION_CN)
|
||||
goto null_return;
|
||||
#else
|
||||
eu_stubbed_printf_0("Warning: Drop Voice");
|
||||
@@ -1345,7 +1345,7 @@ struct Note *alloc_note(struct SequenceChannelLayer *seqLayer) {
|
||||
if (!(ret = alloc_note_from_disabled(&gNoteFreeLists, seqLayer))
|
||||
&& !(ret = alloc_note_from_decaying(&gNoteFreeLists, seqLayer))
|
||||
&& !(ret = alloc_note_from_active(&gNoteFreeLists, seqLayer))) {
|
||||
#ifdef VERSION_SH
|
||||
#if defined(VERSION_SH) || defined(VERSION_CN)
|
||||
goto null_return;
|
||||
#else
|
||||
eu_stubbed_printf_0("Warning: Drop Voice");
|
||||
@@ -1365,7 +1365,7 @@ struct Note *alloc_note(struct SequenceChannelLayer *seqLayer) {
|
||||
&& !(ret = alloc_note_from_active(&seqLayer->seqChannel->notePool, seqLayer))
|
||||
&& !(ret = alloc_note_from_active(&seqLayer->seqChannel->seqPlayer->notePool, seqLayer))
|
||||
&& !(ret = alloc_note_from_active(&gNoteFreeLists, seqLayer))) {
|
||||
#ifdef VERSION_SH
|
||||
#if defined(VERSION_SH) || defined(VERSION_CN)
|
||||
goto null_return;
|
||||
#else
|
||||
eu_stubbed_printf_0("Warning: Drop Voice");
|
||||
@@ -1375,7 +1375,7 @@ struct Note *alloc_note(struct SequenceChannelLayer *seqLayer) {
|
||||
}
|
||||
return ret;
|
||||
|
||||
#ifdef VERSION_SH
|
||||
#if defined(VERSION_SH) || defined(VERSION_CN)
|
||||
null_return:
|
||||
seqLayer->status = SOUND_LOAD_STATUS_NOT_LOADED;
|
||||
return NULL;
|
||||
@@ -1427,7 +1427,7 @@ void note_init_all(void) {
|
||||
|
||||
for (i = 0; i < gMaxSimultaneousNotes; i++) {
|
||||
note = &gNotes[i];
|
||||
#if defined(VERSION_EU) || defined(VERSION_SH)
|
||||
#if defined(VERSION_EU) || defined(VERSION_SH) || defined(VERSION_CN)
|
||||
note->noteSubEu = gZeroNoteSub;
|
||||
#else
|
||||
note->enabled = FALSE;
|
||||
@@ -1436,13 +1436,13 @@ void note_init_all(void) {
|
||||
note->stereoHeadsetEffects = FALSE;
|
||||
#endif
|
||||
note->priority = NOTE_PRIORITY_DISABLED;
|
||||
#ifdef VERSION_SH
|
||||
#if defined(VERSION_SH) || defined(VERSION_CN)
|
||||
note->unkSH34 = 0;
|
||||
#endif
|
||||
note->parentLayer = NO_LAYER;
|
||||
note->wantedParentLayer = NO_LAYER;
|
||||
note->prevParentLayer = NO_LAYER;
|
||||
#if defined(VERSION_EU) || defined(VERSION_SH)
|
||||
#if defined(VERSION_EU) || defined(VERSION_SH) || defined(VERSION_CN)
|
||||
note->waveId = 0;
|
||||
#else
|
||||
note->reverbVol = 0;
|
||||
@@ -1461,7 +1461,7 @@ void note_init_all(void) {
|
||||
note->vibratoState.active = FALSE;
|
||||
note->portamento.cur = 0.0f;
|
||||
note->portamento.speed = 0.0f;
|
||||
#if defined(VERSION_SH)
|
||||
#if defined(VERSION_SH) || defined(VERSION_CN)
|
||||
note->synthesisState.synthesisBuffers = sound_alloc_uninitialized(&gNotesAndBuffersPool, sizeof(struct NoteSynthesisBuffers));
|
||||
#elif defined(VERSION_EU)
|
||||
note->synthesisState.synthesisBuffers = soundAlloc(&gNotesAndBuffersPool, sizeof(struct NoteSynthesisBuffers));
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
#ifdef VERSION_SH
|
||||
// TODO: merge this with port_eu.c?
|
||||
#if defined(VERSION_SH) || defined(VERSION_CN)
|
||||
// TODO: merge this with port_eu.c
|
||||
|
||||
#include <ultra64.h>
|
||||
|
||||
|
||||
File diff suppressed because it is too large
Load Diff
@@ -1,6 +1,6 @@
|
||||
#include <ultra64.h>
|
||||
|
||||
#ifdef VERSION_SH
|
||||
#if defined(VERSION_SH) || defined(VERSION_CN)
|
||||
// synthesis.c
|
||||
char shindouDebugPrint1[] = "Terminate-Canceled Channel %d,Phase %d\n";
|
||||
char shindouDebugPrint2[] = "S->W\n";
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
#ifndef VERSION_SH
|
||||
#if !defined(VERSION_SH) && !defined(VERSION_CN)
|
||||
#include <ultra64.h>
|
||||
|
||||
#include "synthesis.h"
|
||||
|
||||
@@ -3,7 +3,7 @@
|
||||
|
||||
#include "internal.h"
|
||||
|
||||
#ifdef VERSION_SH
|
||||
#if defined(VERSION_SH) || defined(VERSION_CN)
|
||||
#define DEFAULT_LEN_1CH 0x180
|
||||
#define DEFAULT_LEN_2CH 0x300
|
||||
#else
|
||||
@@ -11,7 +11,7 @@
|
||||
#define DEFAULT_LEN_2CH 0x280
|
||||
#endif
|
||||
|
||||
#if defined(VERSION_EU) || defined(VERSION_SH)
|
||||
#if defined(VERSION_EU) || defined(VERSION_SH) || defined(VERSION_CN)
|
||||
#define MAX_UPDATES_PER_FRAME 5
|
||||
#else
|
||||
#define MAX_UPDATES_PER_FRAME 4
|
||||
@@ -32,19 +32,19 @@ struct SynthesisReverb {
|
||||
/*0x01, 0x01, 0x01*/ u8 useReverb;
|
||||
/*0x02, 0x02, 0x02*/ u8 framesLeftToIgnore;
|
||||
/*0x03, 0x03, 0x03*/ u8 curFrame;
|
||||
#if defined(VERSION_EU) || defined(VERSION_SH)
|
||||
#if defined(VERSION_EU) || defined(VERSION_SH) || defined(VERSION_CN)
|
||||
/* 0x04, 0x04*/ u8 downsampleRate;
|
||||
#ifdef VERSION_SH
|
||||
#if defined(VERSION_SH) || defined(VERSION_CN)
|
||||
/* 0x05*/ s8 unk5;
|
||||
#endif
|
||||
/* 0x06, 0x06*/ u16 windowSize; // same as bufSizePerChannel
|
||||
#endif
|
||||
#ifdef VERSION_SH
|
||||
#if defined(VERSION_SH) || defined(VERSION_CN)
|
||||
/* 0x08*/ u16 unk08;
|
||||
#endif
|
||||
/*0x04, 0x08, 0x0A*/ u16 reverbGain;
|
||||
/*0x06, 0x0A, 0x0C*/ u16 resampleRate;
|
||||
#ifdef VERSION_SH
|
||||
#if defined(VERSION_SH) || defined(VERSION_CN)
|
||||
/* 0x0E*/ u16 panRight;
|
||||
/* 0x10*/ u16 panLeft;
|
||||
#endif
|
||||
@@ -60,7 +60,7 @@ struct SynthesisReverb {
|
||||
/*0x24, 0x28, 0x30*/ s16 *unk24; // never read
|
||||
/*0x28, 0x2C, 0x34*/ s16 *unk28; // never read
|
||||
/*0x2C, 0x30, 0x38*/ struct ReverbRingBufferItem items[2][MAX_UPDATES_PER_FRAME];
|
||||
#if defined(VERSION_EU) || defined(VERSION_SH)
|
||||
#if defined(VERSION_EU) || defined(VERSION_SH) || defined(VERSION_CN)
|
||||
// Only used in sh:
|
||||
/* 0x100*/ s16 *unk100;
|
||||
/* 0x104*/ s16 *unk104;
|
||||
@@ -68,7 +68,7 @@ struct SynthesisReverb {
|
||||
/* 0x10C*/ s16 *unk10C;
|
||||
#endif
|
||||
}; // 0xCC <= size <= 0x100
|
||||
#if defined(VERSION_EU) || defined(VERSION_SH)
|
||||
#if defined(VERSION_EU) || defined(VERSION_SH) || defined(VERSION_CN)
|
||||
extern struct SynthesisReverb gSynthesisReverbs[4];
|
||||
extern s8 gNumSynthesisReverbs;
|
||||
extern struct NoteSubEu *gNoteSubsEu;
|
||||
@@ -80,7 +80,7 @@ extern f32 *gCurrentRightVolRamping; // Points to any of the three right buffers
|
||||
extern struct SynthesisReverb gSynthesisReverb;
|
||||
#endif
|
||||
|
||||
#ifdef VERSION_SH
|
||||
#if defined(VERSION_SH) || defined(VERSION_CN)
|
||||
extern s16 D_SH_803479B4;
|
||||
#endif
|
||||
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
#ifdef VERSION_SH
|
||||
#if defined(VERSION_SH) || defined(VERSION_CN)
|
||||
#include <ultra64.h>
|
||||
|
||||
#include "synthesis.h"
|
||||
|
||||
@@ -1,23 +1,47 @@
|
||||
#include <ultra64.h>
|
||||
|
||||
#include "buffers.h"
|
||||
#include "config.h"
|
||||
|
||||
ALIGNED8 u8 gDecompressionHeap[0xD000];
|
||||
|
||||
#if defined(VERSION_EU)
|
||||
ALIGNED16 u8 gAudioHeap[DOUBLE_SIZE_ON_64_BIT(0x31200) - 0x3800];
|
||||
#elif defined(VERSION_SH)
|
||||
ALIGNED16 u8 gAudioHeap[DOUBLE_SIZE_ON_64_BIT(0x31200) - 0x4800];
|
||||
#elif defined(VERSION_CN)
|
||||
ALIGNED16 u8 gAudioHeap[DOUBLE_SIZE_ON_64_BIT(0x31200) - 0x4C00];
|
||||
#else
|
||||
ALIGNED16 u8 gAudioHeap[DOUBLE_SIZE_ON_64_BIT(0x31200)];
|
||||
#endif
|
||||
|
||||
ALIGNED8 u8 gIdleThreadStack[0x800];
|
||||
ALIGNED8 u8 gThread3Stack[0x2000];
|
||||
ALIGNED8 u8 gThread4Stack[0x2000];
|
||||
ALIGNED8 u8 gThread5Stack[0x2000];
|
||||
#ifdef VERSION_CN
|
||||
|
||||
// iQue BSS reordering
|
||||
|
||||
// 0x200 bytes
|
||||
ALIGNED8 struct SaveBuffer gSaveBuffer;
|
||||
// 0x190a0 bytes
|
||||
struct GfxPool gGfxPools[2];
|
||||
ALIGNED8 u8 gThread4Stack[STACKSIZE];
|
||||
#if ENABLE_RUMBLE
|
||||
ALIGNED8 u8 gThread6Stack[0x2000];
|
||||
ALIGNED8 u8 gThread6Stack[STACKSIZE];
|
||||
#endif
|
||||
ALIGNED8 u8 gThread5Stack[STACKSIZE];
|
||||
// 0x400 bytes
|
||||
ALIGNED8 u8 gGfxSPTaskStack[SP_DRAM_STACK_SIZE8];
|
||||
// 0xc00 bytes for f3dex, 0x900 otherwise
|
||||
ALIGNED8 u8 gGfxSPTaskYieldBuffer[OS_YIELD_DATA_SIZE];
|
||||
ALIGNED8 u8 gThread3Stack[STACKSIZE + 0x400];
|
||||
ALIGNED8 u8 gIdleThreadStack[IDLE_STACKSIZE];
|
||||
|
||||
#else
|
||||
|
||||
ALIGNED8 u8 gIdleThreadStack[IDLE_STACKSIZE];
|
||||
ALIGNED8 u8 gThread3Stack[STACKSIZE];
|
||||
ALIGNED8 u8 gThread4Stack[STACKSIZE];
|
||||
ALIGNED8 u8 gThread5Stack[STACKSIZE];
|
||||
#if ENABLE_RUMBLE
|
||||
ALIGNED8 u8 gThread6Stack[STACKSIZE];
|
||||
#endif
|
||||
// 0x400 bytes
|
||||
ALIGNED8 u8 gGfxSPTaskStack[SP_DRAM_STACK_SIZE8];
|
||||
@@ -28,6 +52,7 @@ ALIGNED8 struct SaveBuffer gSaveBuffer;
|
||||
// 0x190a0 bytes
|
||||
struct GfxPool gGfxPools[2];
|
||||
|
||||
#endif
|
||||
|
||||
// Yield buffer for audio, 0x400 bytes. Stubbed out post-JP since the audio
|
||||
// task never yields.
|
||||
@@ -38,5 +63,5 @@ ALIGNED8 u8 gAudioSPTaskYieldBuffer[OS_YIELD_AUDIO_SIZE];
|
||||
// Probably Thread 2 stack space. Unreferenced, and stubbed out with f3dex to
|
||||
// avoid an overflowing .buffers segment.
|
||||
#if !defined(F3DEX_GBI_SHARED) && !defined(VERSION_EU)
|
||||
ALIGNED8 u8 gUnusedThread2Stack[0x1400];
|
||||
ALIGNED8 u8 gUnusedThread2Stack[UNUSED_STACKSIZE];
|
||||
#endif
|
||||
|
||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user