Skip to content

Commit 7f0a459

Browse files
author
Niko
committed
XA Audio Progress
1 parent 1f5a3e5 commit 7f0a459

File tree

4 files changed

+19
-21
lines changed

4 files changed

+19
-21
lines changed

decompile/General/HOWL/h100_Audio_SetState.c

Lines changed: 6 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -47,21 +47,12 @@ void DECOMP_Audio_SetState(u_int state)
4747
}
4848
break;
4949
case 9:
50-
51-
// hack to save byte budget
52-
//CDSYS_XAPlay(XA_type, (int)sdata->desiredXA_1);
5350

54-
iVar1 = (int)sdata->desiredXA_1 + 1;
55-
XA_index = iVar1;
56-
if (iVar1 < 0)
57-
{
58-
XA_index = (int)sdata->desiredXA_1 + 4;
59-
}
60-
sdata->desiredXA_1 = iVar1 + (XA_index >> 2) * -4;
61-
62-
// hack to save byte budget,
63-
// jmp to XAPlay call instead of "break"
64-
XA_index = iVar1 - 1;
51+
// OG game would use desiredXA_RaceIntroIndex
52+
// to cycle through 4 different XAs (0,1,2,3),
53+
// but all the tracks are the same (unused beta)
54+
55+
XA_index = 0;
6556
goto PLAY_XA;
6657
//break;
6758

@@ -117,7 +108,7 @@ void DECOMP_Audio_SetState(u_int state)
117108
DECOMP_Music_Restart();
118109

119110
// set XA
120-
XA_index = sdata->desiredXA_3;
111+
XA_index = sdata->desiredXA_RaceEndIndex;
121112

122113
if (61 < XA_index)
123114
{

decompile/General/HOWL/h104_Audio_Update1.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -342,7 +342,7 @@ void DECOMP_Audio_Update1(void)
342342
}
343343

344344
// desired XA
345-
sdata->desiredXA_3 = uVar1;
345+
sdata->desiredXA_RaceEndIndex = uVar1;
346346

347347
DECOMP_Audio_SetState_Safe(0x10);
348348
}

decompile/General/HOWL/h99_Voiceline_SetDefaults.c

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,8 +3,11 @@
33
void DECOMP_Voiceline_SetDefaults(void)
44
{
55
sdata->unkAudioState = 0;
6-
sdata->desiredXA_1 = 0;
7-
sdata->desiredXA_2 = 0;
6+
7+
#if 0 // unused
8+
sdata->desiredXA_RaceIntroIndex = 0;
9+
sdata->desiredXA_FinalLapIndex = 0;
10+
#endif
811

912
sdata->WrongWayDirection_bool = false;
1013

include/regionsEXE.h

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -3895,13 +3895,17 @@ struct sData
38953895
short unkAudioState;
38963896

38973897
// 8008d7f2
3898-
short desiredXA_1;
3898+
// unused, OG game would cycle through
3899+
// 4 RaceIntro XA files (0,1,2,3)
3900+
short desiredXA_RaceIntroIndex;
38993901

39003902
// 8008d7f4
3901-
int desiredXA_2;
3903+
// unused, would have changed the Final Lap XA,
3904+
// (at least assumed? its between Intro and End?)
3905+
int desiredXA_FinalLapIndex;
39023906

39033907
// 8008d7f8
3904-
short desiredXA_3;
3908+
short desiredXA_RaceEndIndex;
39053909

39063910
// 8008d7fa
39073911
short nTropyVoiceCount;

0 commit comments

Comments
 (0)