Skip to content

Commit

Permalink
fix srceu compilation
Browse files Browse the repository at this point in the history
  • Loading branch information
sonicdcer committed Jan 31, 2025
1 parent 2bf26aa commit cb4e0ed
Show file tree
Hide file tree
Showing 6 changed files with 17 additions and 17 deletions.
4 changes: 2 additions & 2 deletions src/audio/audio_synthesis.c
Original file line number Diff line number Diff line change
Expand Up @@ -181,7 +181,7 @@ void AudioSynth_InverseDiscreteCosineTransform(f32* buffer0, f32* buffer1, s32 l
}

// https://decomp.me/scratch/8eyVg
#ifdef NON_MATCHING
#ifndef NON_MATCHING
void AudioSynth_HartleyTransform(f32* arg0, s32 arg1, f32* arg2) {
s32 length;
s32 spD0;
Expand Down Expand Up @@ -387,7 +387,7 @@ void AudioSynth_HartleyTransform(f32* arg0, s32 arg1, f32* arg2) {
#endif

// https://decomp.me/scratch/TZQNS
#ifdef NON_MATCHING
#ifndef NON_MATCHING
void func_80009124(s16** arg0) {
s16* var_a1;
s32 temp_a0;
Expand Down
2 changes: 1 addition & 1 deletion srceu/audio/audio_effects.c
Original file line number Diff line number Diff line change
Expand Up @@ -215,7 +215,7 @@ f32 func_80013B70(AdsrState* adsr) {
break;
default:
if (adsr->delay >= 4) {
adsr->delay = (adsr->delay * gAudioBufferParams.ticksPerUpdate / gAudioBufferParams.count) / 4;
adsr->delay = (adsr->delay * gAudioBufferParams.ticksPerUpdate / gAudioBufferParams.numBuffers) / 4;
}
if (adsr->delay == 0) {
adsr->delay = 1;
Expand Down
10 changes: 5 additions & 5 deletions srceu/audio/audio_general.c
Original file line number Diff line number Diff line change
Expand Up @@ -2310,7 +2310,7 @@ void Audio_PlayFanfare(u16 seqId, u8 bgmVolume, u8 bgmFadeoutTime, u8 bgmFadeinT
void Audio_PlayDeathSequence(void) {
u8 i;

if (sAudioSpecId == AUDIOSPEC_24) {
if (sAudioSpecId == AUDIOSPEC_MAP) {
Audio_ClearVoice();
Audio_PlayMapMenuSfx(0);
AUDIO_PLAY_SFX(NA_SE_ARWING_EXPLOSION, gDefaultSfxSource, 4);
Expand Down Expand Up @@ -2496,7 +2496,7 @@ void Audio_RestartSeqPlayers(void) {

if (sAudioSpecId == AUDIOSPEC_AQ) {
fadeIn = 360;
} else if (sAudioSpecId < AUDIOSPEC_23) {
} else if (sAudioSpecId < AUDIOSPEC_TITLE) {
fadeIn = 90;
}
Audio_StartSequence(SEQ_PLAYER_SFX, NA_BGM_SE, -1, fadeIn);
Expand All @@ -2514,11 +2514,11 @@ void Audio_RestartSeqPlayers(void) {
}

void Audio_StartReset(u8 oldSpecId) {
if (oldSpecId == AUDIOSPEC_16) {
if ((sAudioSpecId == AUDIOSPEC_22) || (sAudioSpecId == AUDIOSPEC_23)) {
if (oldSpecId == AUDIOSPEC_VS) {
if ((sAudioSpecId == AUDIOSPEC_OPENING) || (sAudioSpecId == AUDIOSPEC_TITLE)) {
sAudioResetStatus = AUDIORESET_BLOCK;
}
} else if ((oldSpecId == AUDIOSPEC_28) && (sAudioSpecId == AUDIOSPEC_23)) {
} else if ((oldSpecId == AUDIOSPEC_TR) && (sAudioSpecId == AUDIOSPEC_TITLE)) {
sAudioResetStatus = AUDIORESET_BLOCK;
} else {
sAudioResetStatus = AUDIORESET_WAIT;
Expand Down
14 changes: 7 additions & 7 deletions srceu/audio/audio_heap.c
Original file line number Diff line number Diff line change
Expand Up @@ -488,7 +488,7 @@ void AudioHeap_UpdateReverbs(void) {
s32 count;
s32 reverbIndex;

if (gAudioBufferParams.count == 2) {
if (gAudioBufferParams.numBuffers == 2) {
count = 2;
} else {
count = 1;
Expand Down Expand Up @@ -516,7 +516,7 @@ s32 AudioHeap_ResetStep(void) {
s32 j;
s32 sp24;

if (gAudioBufferParams.count == 2) {
if (gAudioBufferParams.numBuffers == 2) {
sp24 = 2;
} else {
sp24 = 1;
Expand Down Expand Up @@ -618,11 +618,11 @@ void AudioHeap_Init(void) {
gNumNotes = spec->numNotes;
D_8014E320 = spec->unk_14;
gMaxTempo = (u16) ((gAudioBufferParams.ticksPerUpdate * 2880000.0f / gSeqTicksPerBeat) / gMaxTempoTvTypeFactors);
gAudioBufferParams.count = spec->numBuffers;
gAudioBufferParams.samplesPerFrameTarget *= gAudioBufferParams.count;
gAudioBufferParams.maxAiBufferLength *= gAudioBufferParams.count;
gAudioBufferParams.minAiBufferLength *= gAudioBufferParams.count;
gAudioBufferParams.ticksPerUpdate *= gAudioBufferParams.count;
gAudioBufferParams.numBuffers = spec->numBuffers;
gAudioBufferParams.samplesPerFrameTarget *= gAudioBufferParams.numBuffers;
gAudioBufferParams.maxAiBufferLength *= gAudioBufferParams.numBuffers;
gAudioBufferParams.minAiBufferLength *= gAudioBufferParams.numBuffers;
gAudioBufferParams.ticksPerUpdate *= gAudioBufferParams.numBuffers;
#ifdef VERSION_US // probably JP too
if (gAudioBufferParams.count >= 2) {
gAudioBufferParams.maxAiBufferLength -= 0x10;
Expand Down
2 changes: 1 addition & 1 deletion srceu/audio/audio_load.c
Original file line number Diff line number Diff line change
Expand Up @@ -151,7 +151,7 @@ void AudioLoad_InitSampleDmaBuffers(s32 numNotes) {

gSampleDmaBuffSize = 0x2D0;

for (i = 0; i < (3 * gNumNotes * gAudioBufferParams.count); i++) {
for (i = 0; i < (3 * gNumNotes * gAudioBufferParams.numBuffers); i++) {
dma = AudioHeap_Alloc(&gMiscPool, gSampleDmaBuffSize);
gSampleDmas[gSampleDmaCount].ramAddr = dma;
if (dma == NULL) {
Expand Down
2 changes: 1 addition & 1 deletion srceu/audio/audio_synthesis.c
Original file line number Diff line number Diff line change
Expand Up @@ -449,7 +449,7 @@ Acmd* func_8000A2CC(s16* aiBuf, s32 aiBufLen, Acmd* aList, s32 updateIndex) {

j = aiBufLen * 2;
aSetBuffer(aList++, 0, 0, 0x450, j);
aInterleave(aList++, 0, 0x990, 0xB10, 0);
aInterleave(aList++, 0x990, 0xB10);
aSaveBuffer(aList++, 0x450, OS_K0_TO_PHYSICAL(aiBuf), j * 2);

return aList;
Expand Down

0 comments on commit cb4e0ed

Please sign in to comment.