continue labeling more music stuff

This commit is contained in:
Seth Barberee 2022-06-17 11:39:29 -07:00
parent 4ba50b5349
commit 6746cb699a
13 changed files with 141 additions and 143 deletions

View File

@ -452,7 +452,7 @@ sub_80009D0:
mov r10, r0
bl sub_801180C
movs r0, 0x10
bl sub_80118C4
bl FadeOutAllMusic
cmp r7, 0x7
bne _08000A30
cmp r4, 0x2
@ -1161,7 +1161,7 @@ _08000FB8:
adds r0, r4, 0
adds r0, 0x80
bl SetDungeonLocationInfo
bl sub_8011924
bl xxx_call_stop_bgm
movs r1, 0
ldrsh r0, [r7, r1]
cmp r0, r6

View File

@ -3200,7 +3200,7 @@ _0805F1F8:
ldr r0, _0805F20C
movs r1, 0x80
lsls r1, 1
bl sub_800C074
bl PlayFanfareSE
b _0805F240
.align 2, 0
_0805F208: .4byte gDungeonGlobalData

View File

@ -1232,7 +1232,7 @@ _08083CF2:
ldr r0, _08083D04
movs r1, 0x80
lsls r1, 1
bl sub_800C074
bl PlayFanfareSE
_08083CFC:
pop {r0}
bx r0
@ -1248,7 +1248,7 @@ sub_8083D08:
lsls r0, 1
movs r1, 0x80
lsls r1, 1
bl sub_800C074
bl PlayFanfareSE
pop {r0}
bx r0
thumb_func_end sub_8083D08
@ -1259,7 +1259,7 @@ sub_8083D1C:
ldr r0, _08083D2C
movs r1, 0x80
lsls r1, 1
bl sub_800C074
bl PlayFanfareSE
pop {r0}
bx r0
.align 2, 0
@ -1272,7 +1272,7 @@ sub_8083D30:
ldr r0, _08083D40
movs r1, 0x80
lsls r1, 1
bl sub_800C074
bl PlayFanfareSE
pop {r0}
bx r0
.align 2, 0
@ -1286,7 +1286,7 @@ sub_8083D44:
lsls r0, 1
movs r1, 0x80
lsls r1, 1
bl sub_800C074
bl PlayFanfareSE
pop {r0}
bx r0
thumb_func_end sub_8083D44
@ -1297,7 +1297,7 @@ sub_8083D58:
movs r1, 0x80
lsls r1, 1
movs r0, 0xC8
bl sub_800C074
bl PlayFanfareSE
pop {r0}
bx r0
thumb_func_end sub_8083D58
@ -1308,7 +1308,7 @@ sub_8083D68:
movs r1, 0x80
lsls r1, 1
movs r0, 0xCF
bl sub_800C074
bl PlayFanfareSE
pop {r0}
bx r0
thumb_func_end sub_8083D68
@ -1319,7 +1319,7 @@ sub_8083D78:
movs r1, 0x80
lsls r1, 1
movs r0, 0xD3
bl sub_800C074
bl PlayFanfareSE
pop {r0}
bx r0
thumb_func_end sub_8083D78
@ -1330,7 +1330,7 @@ sub_8083D88:
movs r1, 0x80
lsls r1, 1
movs r0, 0xCC
bl sub_800C074
bl PlayFanfareSE
pop {r0}
bx r0
thumb_func_end sub_8083D88
@ -1409,7 +1409,7 @@ sub_8083E28:
movs r1, 0x80
lsls r1, 1
movs r0, 0xCF
bl sub_800C074
bl PlayFanfareSE
pop {r0}
bx r0
thumb_func_end sub_8083E28
@ -1425,7 +1425,7 @@ PlaySoundEffect:
movs r1, 0x80
lsls r1, 1
adds r0, r2, 0
bl sub_800C074
bl PlayFanfareSE
_08083E4E:
pop {r0}
bx r0
@ -1442,7 +1442,7 @@ sub_8083E58:
cmp r1, r0
beq _08083E6A
adds r0, r1, 0
bl sub_800C298
bl StopFanfareSE
_08083E6A:
pop {r0}
bx r0
@ -1450,17 +1450,17 @@ _08083E6A:
_08083E70: .4byte 0x000003e5
thumb_func_end sub_8083E58
thumb_func_start sub_8083E74
sub_8083E74:
thumb_func_start IsFanfareSEPlaying_2
IsFanfareSEPlaying_2:
push {lr}
lsls r0, 16
lsrs r0, 16
bl sub_800C5D0
bl IsFanfareSEPlaying
lsls r0, 24
lsrs r0, 24
pop {r1}
bx r1
thumb_func_end sub_8083E74
thumb_func_end IsFanfareSEPlaying_2
thumb_func_start sub_8083E88
sub_8083E88:
@ -1511,7 +1511,7 @@ sub_8083ED8:
push {lr}
lsls r0, 16
lsrs r0, 16
bl sub_80118C4
bl FadeOutAllMusic
ldr r0, _08083F00
ldr r1, [r0]
ldr r2, _08083F04
@ -1538,7 +1538,7 @@ _08083F10: .4byte 0x0001ceda
sub_8083F14:
push {lr}
bl sub_8083F34
bl sub_8011924
bl xxx_call_stop_bgm
pop {r0}
bx r0
thumb_func_end sub_8083F14
@ -1716,7 +1716,7 @@ _0808406C:
ldr r0, _0808407C
cmp r1, r0
bne _08084080
bl sub_800BF80
bl StopBGM
movs r0, 0
b _08084082
.align 2, 0

View File

@ -94,7 +94,7 @@ _08098504:
cmp r0, 0
bne _08098522
movs r0, 0x10
bl sub_80118C4
bl FadeOutAllMusic
_08098522:
ldr r1, _080985B4
ldr r2, _080985B8
@ -490,7 +490,7 @@ _080988E4:
movs r0, 0x1E
bl sub_8098F44
movs r0, 0x1E
bl sub_80118C4
bl FadeOutAllMusic
_080988F8:
bl GroundMap_Action
bl nullsub_124
@ -572,7 +572,7 @@ _080989E8: .4byte gUnknown_20398A8
_080989EC: .4byte gUnknown_20398B9
_080989F0:
movs r0, 0x1E
bl sub_80118C4
bl FadeOutAllMusic
movs r0, 0xF
b _08098BD2
_080989FA:
@ -779,7 +779,7 @@ _08098BC0:
movs r2, 0x1
bl sub_80018D8
movs r0, 0x10
bl sub_80118C4
bl FadeOutAllMusic
movs r0, 0xE
_08098BD2:
add sp, 0x8

View File

@ -426,7 +426,7 @@ sub_80993F0:
mov r10, r0
bl sub_801180C
movs r0, 0x10
bl sub_80118C4
bl FadeOutAllMusic
ldr r1, _0809948C
ldr r2, _08099490
adds r0, r2, 0
@ -661,7 +661,7 @@ _08099604:
_08099620: .4byte gUnknown_203B46C
_08099624:
movs r0, 0x10
bl sub_80118C4
bl FadeOutAllMusic
bl sub_80A4AC4
bl sub_8099768
bl nullsub_103

View File

@ -768,7 +768,7 @@ _0809DF24:
str r0, [r1]
add r0, sp, 0x4
ldrh r0, [r0, 0x2]
bl sub_80119C0
bl IsFanfareSEPlaying_1
lsls r0, 24
cmp r0, 0
bne _0809DF42
@ -4176,7 +4176,7 @@ _0809FCCE:
.align 2, 0
_0809FCE4: .4byte gUnknown_2039D98
_0809FCE8:
bl sub_80118A4
bl StopAllMusic_1
bl _0809EAE0
_0809FCF0:
add r0, sp, 0x8
@ -4190,7 +4190,7 @@ _0809FCF0:
_0809FD00:
movs r0, 0x1E
_0809FD02:
bl sub_80118C4
bl FadeOutAllMusic
bl _0809EAE0
_0809FD0A:
add r0, sp, 0x8
@ -4266,7 +4266,7 @@ _0809FD90:
.align 2, 0
_0809FD9C: .4byte 0x000003e7
_0809FDA0:
bl sub_8011924
bl xxx_call_stop_bgm
bl _0809EAE0
_0809FDA8:
add r0, sp, 0x8
@ -4294,7 +4294,7 @@ _0809FDD4:
ldr r0, [sp, 0xC]
lsls r0, 16
lsrs r0, 16
bl sub_801199C
bl xxx_call_stop_fanfare_se
bl _0809EAE0
_0809FDE2:
ldr r0, [sp, 0xC]
@ -8734,7 +8734,7 @@ _080A229E:
bl sub_8098F00
lsls r0, r5, 16
lsrs r0, 16
bl sub_80118C4
bl FadeOutAllMusic
b _080A236A
_080A22AE:
bl GetCurrentBGSong

View File

@ -14,16 +14,17 @@ void StartNewBGM(u16 songIndex);
void FadeInNewBGM(u16 SongIndex, u16 speed);
u16 GetCurrentBGSong(void);
void sub_800BF48(u16 SongIndex);
void sub_800BF80(void);
void StopBGM(void); // stops all BGM, fanfares and SE's
void FadeOutBGM(u16 speed);
void sub_800C074(u16 SongIndex, u16 param_2);
void sub_800C298(u16 songIndex);
void sub_800C3F8(u16 songIndex, u16 speed);
void PlayFanfareSE(u16 SongIndex, u16 param_2);
void StopFanfareSE(u16 songIndex);
void FadeOutFanfareSE(u16 songIndex, u16 speed);
bool8 IsFanfareSEPlaying(u16 songIndex);
void nullsub_19(void);
void nullsub_20(u16 songIndex);
enum GetMusicPlayerIndex
enum MusicPlayerIndex
{
INDEX_BGM,
INDEX_FANFARE,

View File

@ -9,13 +9,10 @@
#include "config.h"
void sub_8011924(void);
void xxx_call_stop_bgm(void);
extern u8 sub_80023E4(u8);
extern void sub_800C3F8(u16 r0, u16 r1);
extern void sub_801199C(u16 r0);
extern void sub_800C298(u16 r0);
extern bool8 sub_800C5D0(u16 r0);
extern void xxx_call_stop_fanfare_se(u16 r0);
struct UnkSaveStruct1
{
@ -118,19 +115,19 @@ void sub_80117C4(void)
// Some sound effect
void sub_80117D0(void)
{
sub_800C074(302, 256);
PlayFanfareSE(302, 256);
}
// Some sound effect
void sub_80117E4(void)
{
sub_800C074(303, 256);
PlayFanfareSE(303, 256);
}
// Some sound effect
void sub_80117F8(void)
{
sub_800C074(301, 256);
PlayFanfareSE(301, 256);
}
void sub_801180C(void)
@ -170,18 +167,18 @@ void sub_8011860(void)
}
}
void sub_80118A4(void)
void StopAllMusic_1(void)
{
sub_8011924();
sub_801199C(0x3e6);
sub_801199C(0x3e5);
xxx_call_stop_bgm();
xxx_call_stop_fanfare_se(998);
xxx_call_stop_fanfare_se(997);
}
void sub_80118C4(u16 r0)
void FadeOutAllMusic(u16 speed)
{
FadeOutBGM(r0);
sub_800C3F8(0x3e6, r0);
sub_800C3F8(0x3e5, r0);
FadeOutBGM(speed);
FadeOutFanfareSE(998, speed);
FadeOutFanfareSE(997, speed);
}
void xxx_call_start_new_bgm(u16 songIndex)
@ -199,9 +196,9 @@ void sub_8011914(u16 songIndex)
sub_800BF48(songIndex);
}
void sub_8011924()
void xxx_call_stop_bgm()
{
sub_800BF80();
StopBGM();
}
void xxx_call_fade_out_bgm(u16 speed)
@ -222,34 +219,34 @@ u32 IsEqualtoBGTrack(u16 songIndex)
void sub_8011974(u16 songIndex, u16 r1)
{
sub_800C074(songIndex, r1);
PlayFanfareSE(songIndex, r1);
}
void PlaySound(u16 songIndex)
{
sub_800C074(songIndex, 256);
PlayFanfareSE(songIndex, 256);
}
void sub_801199C(u16 songIndex)
void xxx_call_stop_fanfare_se(u16 songIndex)
{
sub_800C298(songIndex);
StopFanfareSE(songIndex);
}
void sub_80119AC(u16 songIndex, u16 r1)
{
sub_800C3F8(songIndex, r1);
FadeOutFanfareSE(songIndex, r1);
}
bool8 sub_80119C0(u16 songIndex)
bool8 IsFanfareSEPlaying_1(u16 songIndex)
{
return sub_800C5D0(songIndex);
return IsFanfareSEPlaying(songIndex);
}
void PlayMenuSoundEffect(u32 r0)
{
if(gUnknown_202DE20 > 0)
return;
sub_800C074(gUnknown_80D4144[r0], 256);
PlayFanfareSE(gUnknown_80D4144[r0], 256);
gUnknown_202DE20 = 4;
}
@ -258,7 +255,7 @@ void sub_8011A04(void)
if(gUnknown_202DE22 > 0)
return;
gUnknown_202DE22 = 3;
sub_800C074(305, 256);
PlayFanfareSE(305, 256);
}
void sub_8011A2C(u32 r0)

View File

@ -334,7 +334,7 @@ extern void DisplayDungeonDialogue(u32 *);
extern void sub_803E708(u32, u32);
extern u8 HasRecruitedMon(u32);
extern u8 sub_806FD18(struct DungeonEntity *);
extern u8 sub_8083E74(u32);
extern bool8 IsFanfareSEPlaying_2(u32);
extern void sub_8083F14();
extern void sub_80861D4(struct DungeonEntity *, u32, u32);
extern void sub_806FDF4(struct DungeonEntity *, struct DungeonEntity *, struct DungeonEntity **);
@ -4546,7 +4546,7 @@ void CelebiJoinDialogue(void)
{
sub_8083F14();
PlaySoundEffect(0xcc);
while (sub_8083E74(0xcc) != 0) {
while (IsFanfareSEPlaying_2(0xcc) != 0) {
sub_803E46C(0x46);
}
sub_8083E88(0x7f);
@ -4746,7 +4746,7 @@ void CelebiJoinDialogue(void)
"\tbl sub_803E46C\n"
"_0808C76E:\n"
"\tmovs r0, 0xCC\n"
"\tbl sub_8083E74\n"
"\tbl IsFanfareSEPlaying_2\n"
"\tlsls r0, 24\n"
"\tcmp r0, 0\n"
"\tbne _0808C768\n"

View File

@ -72,7 +72,7 @@ extern const char *sub_80A2B18(s16);
extern u8 sub_8001CC4(u8, u8, u8);
extern void xxx_inv_unk250_random_8091980(u32);
extern u8 sub_80023E4(u32);
extern void sub_80118C4(u16);
extern void FadeOutAllMusic(u16);
extern u8 sub_809C730();
extern s16 sub_80A2750(s16);
extern u8 sub_8001D44(u32, u32, s32);
@ -209,7 +209,7 @@ bool8 sub_8098D80(u32 r0)
sub_809C730();
if(sub_80023E4(0xD) == 0)
{
sub_80118C4(r0);
FadeOutAllMusic(r0);
}
return TRUE;
}
@ -226,7 +226,7 @@ bool8 sub_8098DCC(u32 r0)
sub_809C730();
if(sub_80023E4(0xD) == 0)
{
sub_80118C4(r0);
FadeOutAllMusic(r0);
}
return TRUE;
}

View File

@ -96,7 +96,7 @@ extern void UpdateLuminousCaveDialogue(void);
extern void sub_80141B4(const char *r0, u32, struct OpenedFile **r1, u32);
extern void sub_8014248(const char *r0, u32, u32, struct MenuItem *r4, u16 *, u32, u32, struct OpenedFile **r5, u32);
void xxx_call_fade_out_bgm(u16 speed);
void sub_801199C(u16 songIndex);
void xxx_call_stop_fanfare_se(u16 songIndex);
void xxx_call_fade_in_new_bgm(u16 songIndex, u16 speed);
void sub_80977D0(void);
void PlaySound(u32);
@ -397,7 +397,7 @@ void UpdateLuminousCaveDialogue(void)
ClearItemSlotAt(gUnknown_203B2B0->evoItem2_InvIndex);
}
FillInventoryGaps();
sub_801199C(0x1ff);
xxx_call_stop_fanfare_se(0x1ff);
PlaySound(0xd2);
if (gUnknown_203B2B0->pokeRenamed) {
BoundedCopyStringtoBuffer(gUnknown_203B2B0->pokeStruct->name,GetMonSpecies(gUnknown_203B2B0->pokeStruct->speciesNum),POKEMON_NAME_LENGTH);

View File

@ -4,7 +4,7 @@
#include "music.h"
extern u8 sub_80023E4(u32);
extern void sub_80118C4(u16);
extern void FadeOutAllMusic(u16);
extern void sub_809C730();
extern bool8 DisableInterrupts();
@ -32,8 +32,8 @@ void StopBGMusicVSync(void)
bool8 interrupt_flag;
u16 temp;
sub_800C3F8(0x3e5, 0x10);
sub_800C3F8(0x3e6, 0x10);
FadeOutFanfareSE(0x3e5, 0x10);
FadeOutFanfareSE(0x3e6, 0x10);
interrupt_flag = DisableInterrupts();
if(gUnknown_202D690 == 0)

View File

@ -50,7 +50,8 @@ extern s16 gUnknown_203B0AE;
extern s16 gUnknown_203B0B0;
extern s16 gUnknown_203B0B2;
struct unkStruct_3000FD8
// PMD keeps it's own copy of music players for some reason
struct PMDMusicPlayer
{
u16 unk0;
u16 songIndex;
@ -58,8 +59,8 @@ struct unkStruct_3000FD8
u8 unk6;
};
extern struct unkStruct_3000FD8 gUnknown_3000FD8[8];
extern struct unkStruct_3000FD8 gUnknown_3000FE8[8];
extern struct PMDMusicPlayer gUnknown_3000FD8[8];
extern struct PMDMusicPlayer gUnknown_3000FE8[8];
extern u8 gUnknown_202D7FE;
extern u16 gBldCnt;
@ -80,7 +81,7 @@ enum
extern void SoundVSync();
extern void BlinkSavingIcon();
void sub_800BF80(void);
void StopBGM(void);
void xxx_update_bg_sound_input(void);
void UnusedIntrFunc(void)
@ -394,9 +395,9 @@ void UpdateBGControlRegisters(void)
void InitMusic(void)
{
s32 counter;
s32 playerIndex;
struct unkStruct_3000FD8 *preload;
struct PMDMusicPlayer *musicPlayer;
DmaStop(0);
DmaStop(1);
@ -413,24 +414,23 @@ void InitMusic(void)
gUnknown_202D692 = 0;
gUnknown_202D694 = 0;
for(counter = INDEX_BGM, preload = &gUnknown_3000FD8[0]; counter < INDEX_SE6 + 1; counter++, preload++)
for(playerIndex = INDEX_BGM, musicPlayer = &gUnknown_3000FD8[0]; playerIndex < INDEX_SE6 + 1; playerIndex++, musicPlayer++)
{
preload->unk0 = 0;
preload->songIndex = 997;
preload->unk4 = 0;
preload->unk6 = 0;
musicPlayer->unk0 = 0;
musicPlayer->songIndex = 997;
musicPlayer->unk4 = 0;
musicPlayer->unk6 = 0;
}
nullsub_19();
}
void sub_800BDDC(void)
void StopAllMusic(void)
{
sub_800BF80();
sub_800C298(998);
sub_800C298(997);
StopBGM();
StopFanfareSE(998);
StopFanfareSE(997);
}
void StartNewBGM(u16 songIndex)
{
bool8 interrupt_flag;
@ -518,7 +518,7 @@ void sub_800BF48(u16 songIndex)
gUnknown_202D68C = songIndex;
}
void sub_800BF80(void)
void StopBGM(void)
{
bool8 interrupt_flag = DisableInterrupts();
if(gUnknown_202D690 == 0)
@ -584,12 +584,12 @@ u16 GetCurrentBGSong(void)
return gCurrentBGSong;
}
void sub_800C074(u16 songIndex, u16 param_2)
void PlayFanfareSE(u16 songIndex, u16 param_2)
{
bool8 interrupt_flag;
bool8 interrupt_flag2;
u16 playerIndex;
struct unkStruct_3000FD8 *preload;
struct PMDMusicPlayer *musicPlayer;
if (songIndex == 997)
return;
@ -672,24 +672,24 @@ void sub_800C074(u16 songIndex, u16 param_2)
if (!IsSoundEffect(songIndex))
return;
playerIndex = GetMusicPlayerIndex(songIndex);
preload = &gUnknown_3000FD8[playerIndex]; // need to load this before comparison to match
musicPlayer = &gUnknown_3000FD8[playerIndex]; // need to load this before comparison to match
if (playerIndex < INDEX_SE1)
nullsub_20(songIndex);
else
{
interrupt_flag2 = DisableInterrupts();
m4aSongNumStart(songIndex);
preload->unk0 = 1;
preload->songIndex = songIndex;
musicPlayer->unk0 = 1;
musicPlayer->songIndex = songIndex;
if(param_2 == 256)
{
preload->unk6 = 0;
musicPlayer->unk6 = 0;
}
else
{
preload->unk6 = 1;
musicPlayer->unk6 = 1;
}
preload->unk4 = param_2;
musicPlayer->unk4 = param_2;
if (interrupt_flag2)
EnableInterrupts();
}
@ -701,7 +701,7 @@ void SetSoundEffectVolume(u16 songIndex, u16 volume)
bool8 interrupt_flag;
u16 playerIndex;
struct MusicPlayerInfo *info;
struct unkStruct_3000FD8 *preload;
struct PMDMusicPlayer *musicPlayer;
if (256 < volume) {
volume = 256;
@ -710,10 +710,10 @@ void SetSoundEffectVolume(u16 songIndex, u16 volume)
if ((!IsFanfare(songIndex)) && (IsSoundEffect(songIndex))) {
playerIndex = GetMusicPlayerIndex(songIndex);
info = gMPlayTable[playerIndex].info;
preload = &gUnknown_3000FD8[playerIndex];
musicPlayer = &gUnknown_3000FD8[playerIndex];
if (playerIndex >= INDEX_SE1) {
interrupt_flag = DisableInterrupts();
if (preload->songIndex == songIndex) {
if (musicPlayer->songIndex == songIndex) {
m4aMPlayVolumeControl(info, 0xf, volume);
}
if (interrupt_flag)
@ -722,7 +722,7 @@ void SetSoundEffectVolume(u16 songIndex, u16 volume)
}
}
void sub_800C298(u16 songIndex)
void StopFanfareSE(u16 songIndex)
{
// Each section needs a var for interrupts..
char cVar1;
@ -732,20 +732,20 @@ void sub_800C298(u16 songIndex)
u32 playerIndex;
s32 playerIndex2;
struct MusicPlayerInfo *puVar6;
struct unkStruct_3000FD8 *preload;
struct unkStruct_3000FD8 *puVar3;
struct MusicPlayerInfo *info;
struct PMDMusicPlayer *musicPlayer;
struct PMDMusicPlayer *musicPlayer1;
if (songIndex == 997) {
cVar1 = DisableInterrupts();
for(playerIndex2 = INDEX_SE1, puVar3 = &gUnknown_3000FE8[0]; playerIndex2 < INDEX_SE6; playerIndex2++, puVar3++)
for(playerIndex2 = INDEX_SE1, musicPlayer1 = &gUnknown_3000FE8[0]; playerIndex2 < INDEX_SE6; playerIndex2++, musicPlayer1++)
{
m4aMPlayStop(gMPlayTable[playerIndex2].info);
puVar3->unk0 = 0;
puVar3->songIndex = 997;
puVar3->unk4 = 0;
puVar3->unk6 = 0;
musicPlayer1->unk0 = 0;
musicPlayer1->songIndex = 997;
musicPlayer1->unk4 = 0;
musicPlayer1->unk6 = 0;
}
if (cVar1 != '\0') {
EnableInterrupts();
@ -754,19 +754,19 @@ void sub_800C298(u16 songIndex)
else if (IsSoundEffect(songIndex))
{
playerIndex = GetMusicPlayerIndex(songIndex);
puVar6 = gMPlayTable[playerIndex].info;
preload = &gUnknown_3000FD8[playerIndex];
info = gMPlayTable[playerIndex].info;
musicPlayer = &gUnknown_3000FD8[playerIndex];
if (playerIndex < INDEX_SE1) {
nullsub_21(songIndex);
}
else {
cVar2 = DisableInterrupts();
if (preload->songIndex == songIndex) {
m4aMPlayStop(puVar6);
preload->unk0 = 0;
preload->songIndex = 997;
preload->unk4 = 0;
preload->unk6 = 0;
if (musicPlayer->songIndex == songIndex) {
m4aMPlayStop(info);
musicPlayer->unk0 = 0;
musicPlayer->songIndex = 997;
musicPlayer->unk4 = 0;
musicPlayer->unk6 = 0;
}
if (cVar2 != '\0') {
EnableInterrupts();
@ -801,7 +801,7 @@ void sub_800C298(u16 songIndex)
}
}
void sub_800C3F8(u16 songIndex, u16 speed)
void FadeOutFanfareSE(u16 songIndex, u16 speed)
{
char cVar1;
char cVar2;
@ -810,8 +810,8 @@ void sub_800C3F8(u16 songIndex, u16 speed)
u32 comparison;
s32 playerIndex2;
u32 playerIndex;
struct unkStruct_3000FD8 *preload;
struct unkStruct_3000FD8 *puVar3;
struct PMDMusicPlayer *musicPlayer;
struct PMDMusicPlayer *musicPlayer1;
struct MusicPlayerInfo *playerInfo;
comparison = 0x80 << 17; // 16777216
@ -829,18 +829,18 @@ void sub_800C3F8(u16 songIndex, u16 speed)
if (songIndex == 997) {
cVar1 = DisableInterrupts();
for(playerIndex2 = INDEX_SE1, puVar3 = &gUnknown_3000FE8[0]; playerIndex2 < INDEX_SE6; playerIndex2++, puVar3++)
for(playerIndex2 = INDEX_SE1, musicPlayer1 = &gUnknown_3000FE8[0]; playerIndex2 < INDEX_SE6; playerIndex2++, musicPlayer1++)
{
if (puVar3->songIndex != 997) {
if (musicPlayer1->songIndex != 997) {
if (IsMusicPlayerPlaying(playerIndex2)) {
m4aMPlayFadeOut(gMPlayTable[playerIndex2].info,speed);
}
else {
m4aMPlayStop(gMPlayTable[playerIndex2].info);
puVar3->unk0 = 0;
puVar3->songIndex = 997;
puVar3->unk4 = 0;
puVar3->unk6 = 0;
musicPlayer1->unk0 = 0;
musicPlayer1->songIndex = 997;
musicPlayer1->unk4 = 0;
musicPlayer1->unk6 = 0;
}
}
}
@ -850,19 +850,19 @@ void sub_800C3F8(u16 songIndex, u16 speed)
}
else if (IsSoundEffect(songIndex)) {
playerIndex = GetMusicPlayerIndex(songIndex);
preload = &gUnknown_3000FD8[playerIndex];
musicPlayer = &gUnknown_3000FD8[playerIndex];
playerInfo = gMPlayTable[playerIndex].info;
cVar2 = DisableInterrupts();
if (preload->songIndex != 997) {
if (musicPlayer->songIndex != 997) {
if (IsMusicPlayerPlaying(playerIndex)) {
m4aMPlayFadeOut(playerInfo,speed);
}
else {
m4aMPlayStop(playerInfo);
preload->unk0 = 0;
preload->songIndex = 997;
preload->unk4 = 0;
preload->unk6 = 0;
musicPlayer->unk0 = 0;
musicPlayer->songIndex = 997;
musicPlayer->unk4 = 0;
musicPlayer->unk6 = 0;
}
}
if (cVar2 != '\0') {
@ -901,10 +901,10 @@ void sub_800C3F8(u16 songIndex, u16 speed)
}
}
bool8 sub_800C5D0(u16 songIndex)
bool8 IsFanfareSEPlaying(u16 songIndex)
{
u32 uVar3;
struct unkStruct_3000FD8 *preload;
u32 playerIndex;
struct PMDMusicPlayer *musicPlayer;
register u32 songIndex_u32 asm("r4");
register u32 songIndex_u32_2 asm("r5");
@ -919,9 +919,9 @@ bool8 sub_800C5D0(u16 songIndex)
else
{
if (IsSoundEffect(songIndex_u32)) {
uVar3 = GetMusicPlayerIndex(songIndex_u32);
preload = &gUnknown_3000FD8[uVar3];
if ((INDEX_SE1 <= uVar3) && (preload->songIndex == songIndex_u32_2)) {
playerIndex = GetMusicPlayerIndex(songIndex_u32);
musicPlayer = &gUnknown_3000FD8[playerIndex];
if ((INDEX_SE1 <= playerIndex) && (musicPlayer->songIndex == songIndex_u32_2)) {
return TRUE;
}
}