Add symbols to music_player_table

Also rename gMPlay structs to gMPlayInfo
This commit is contained in:
Diegoisawesome 2018-01-09 21:30:54 -06:00
parent 73d3a21c2d
commit 3241b1405f
29 changed files with 149 additions and 137 deletions

View File

@ -20736,7 +20736,7 @@ _081A54D4:
bl HandleBattleWindow bl HandleBattleWindow
movs r0, 0 movs r0, 0
bl CopyBgTilemapBufferToVram bl CopyBgTilemapBufferToVram
ldr r0, =gMPlay_BGM ldr r0, =gMPlayInfo_BGM
ldr r1, =0x0000ffff ldr r1, =0x0000ffff
movs r2, 0x80 movs r2, 0x80
lsls r2, 1 lsls r2, 1

View File

@ -8891,7 +8891,7 @@ _080DC226:
ble _080DC284 ble _080DC284
movs r0, 0x60 movs r0, 0x60
bl PlaySE bl PlaySE
ldr r4, =gMPlay_SE1 ldr r4, =gMPlayInfo_SE1
adds r0, r4, 0 adds r0, r4, 0
bl m4aMPlayImmInit bl m4aMPlayImmInit
ldr r1, =0x0000ffff ldr r1, =0x0000ffff

View File

@ -3342,11 +3342,11 @@ c2_800ACD4: @ 800AF30
movs r0, 0 movs r0, 0
movs r1, 0 movs r1, 0
bl SetGpuReg bl SetGpuReg
ldr r0, =gMPlay_SE1 ldr r0, =gMPlayInfo_SE1
bl m4aMPlayStop bl m4aMPlayStop
ldr r0, =gMPlay_SE2 ldr r0, =gMPlayInfo_SE2
bl m4aMPlayStop bl m4aMPlayStop
ldr r0, =gMPlay_SE3 ldr r0, =gMPlayInfo_SE3
bl m4aMPlayStop bl m4aMPlayStop
ldr r0, =0x02000000 ldr r0, =0x02000000
movs r1, 0xE0 movs r1, 0xE0

View File

@ -965,7 +965,7 @@ _08120850:
lsls r1, 1 lsls r1, 1
adds r0, r1 adds r0, r1
strh r0, [r6, 0x6] strh r0, [r6, 0x6]
ldr r4, =gMPlay_SE2 ldr r4, =gMPlayInfo_SE2
ldr r5, =0x0000ffff ldr r5, =0x0000ffff
ldrh r2, [r6, 0x6] ldrh r2, [r6, 0x6]
adds r0, r4, 0 adds r0, r4, 0
@ -1008,7 +1008,7 @@ _081208BC:
subs r0, 0x40 subs r0, 0x40
_081208C0: _081208C0:
strh r0, [r6, 0x8] strh r0, [r6, 0x8]
ldr r4, =gMPlay_SE2 ldr r4, =gMPlayInfo_SE2
ldr r5, =0x0000ffff ldr r5, =0x0000ffff
ldrh r2, [r6, 0x6] ldrh r2, [r6, 0x6]
adds r0, r4, 0 adds r0, r4, 0
@ -1059,7 +1059,7 @@ _08120922:
lsls r0, 24 lsls r0, 24
cmp r0, 0 cmp r0, 0
bne _08120938 bne _08120938
ldr r0, =gMPlay_SE2 ldr r0, =gMPlayInfo_SE2
bl m4aMPlayStop bl m4aMPlayStop
movs r0, 0x4 movs r0, 0x4
_08120936: _08120936:
@ -1228,7 +1228,7 @@ _08120A7E:
bne _08120AB0 bne _08120AB0
movs r0, 0x6 movs r0, 0x6
bl FadeInBGM bl FadeInBGM
ldr r0, =gMPlay_SE2 ldr r0, =gMPlayInfo_SE2
movs r1, 0x2 movs r1, 0x2
bl m4aMPlayFadeOutTemporarily bl m4aMPlayFadeOutTemporarily
bl EnableBothScriptContexts bl EnableBothScriptContexts

View File

@ -497,7 +497,7 @@ _080BB71C:
adds r1, r2 adds r1, r2
ldrb r1, [r1] ldrb r1, [r1]
bl sub_80BC8D4 bl sub_80BC8D4
ldr r0, =gMPlay_BGM ldr r0, =gMPlayInfo_BGM
ldr r1, =0x0000ffff ldr r1, =0x0000ffff
movs r2, 0x80 movs r2, 0x80
bl m4aMPlayVolumeControl bl m4aMPlayVolumeControl
@ -1246,7 +1246,7 @@ _080BBE18:
bl DestroyTask bl DestroyTask
ldr r0, =sub_8086194 ldr r0, =sub_8086194
bl SetMainCallback2 bl SetMainCallback2
ldr r0, =gMPlay_BGM ldr r0, =gMPlayInfo_BGM
ldr r1, =0x0000ffff ldr r1, =0x0000ffff
movs r2, 0x80 movs r2, 0x80
lsls r2, 1 lsls r2, 1
@ -7228,7 +7228,7 @@ _080BF2A8:
beq _080BF2B6 beq _080BF2B6
b _080BF5B2 b _080BF5B2
_080BF2B6: _080BF2B6:
ldr r0, =gMPlay_BGM ldr r0, =gMPlayInfo_BGM
bl m4aMPlayStop bl m4aMPlayStop
ldr r5, =gUnknown_02039B4C ldr r5, =gUnknown_02039B4C
ldr r0, [r5] ldr r0, [r5]
@ -7592,7 +7592,7 @@ _080BF636:
movs r2, 0 movs r2, 0
movs r3, 0x10 movs r3, 0x10
bl BeginNormalPaletteFade bl BeginNormalPaletteFade
ldr r0, =gMPlay_BGM ldr r0, =gMPlayInfo_BGM
bl m4aMPlayContinue bl m4aMPlayContinue
ldr r0, =gUnknown_02039B4C ldr r0, =gUnknown_02039B4C
ldr r0, [r0] ldr r0, [r0]
@ -7634,7 +7634,7 @@ _080BF6B0:
movs r2, 0 movs r2, 0
movs r3, 0x10 movs r3, 0x10
bl BeginNormalPaletteFade bl BeginNormalPaletteFade
ldr r0, =gMPlay_BGM ldr r0, =gMPlayInfo_BGM
bl m4aMPlayContinue bl m4aMPlayContinue
ldr r0, =gUnknown_02039B4C ldr r0, =gUnknown_02039B4C
ldr r0, [r0] ldr r0, [r0]
@ -7689,7 +7689,7 @@ _080BF73C:
movs r2, 0 movs r2, 0
movs r3, 0x10 movs r3, 0x10
bl BeginNormalPaletteFade bl BeginNormalPaletteFade
ldr r0, =gMPlay_BGM ldr r0, =gMPlayInfo_BGM
bl m4aMPlayContinue bl m4aMPlayContinue
ldr r0, =gUnknown_02039B4C ldr r0, =gUnknown_02039B4C
ldr r0, [r0] ldr r0, [r0]

View File

@ -239,7 +239,7 @@ sub_8145534: @ 8145534
lsls r0, 16 lsls r0, 16
lsrs r4, r0, 16 lsrs r4, r0, 16
adds r5, r4, 0 adds r5, r4, 0
ldr r0, =gMPlay_BGM ldr r0, =gMPlayInfo_BGM
ldr r0, [r0, 0x4] ldr r0, [r0, 0x4]
cmp r0, 0 cmp r0, 0
bge _08145582 bge _08145582

View File

@ -6841,14 +6841,14 @@ _08143BEA:
lsls r0, 24 lsls r0, 24
cmp r0, 0 cmp r0, 0
beq _08143C74 beq _08143C74
ldr r0, _08143C84 @ =gMPlay_SE1 ldr r0, _08143C84 @ =gMPlayInfo_SE1
ldr r4, _08143C88 @ =0x0000FFFF ldr r4, _08143C88 @ =0x0000FFFF
ldrh r2, [r7, 0x24] ldrh r2, [r7, 0x24]
lsls r2, 24 lsls r2, 24
asrs r2, 24 asrs r2, 24
adds r1, r4, 0 adds r1, r4, 0
bl m4aMPlayPanpotControl bl m4aMPlayPanpotControl
ldr r0, _08143C8C @ =gMPlay_SE2 ldr r0, _08143C8C @ =gMPlayInfo_SE2
ldrh r2, [r7, 0x24] ldrh r2, [r7, 0x24]
lsls r2, 24 lsls r2, 24
asrs r2, 24 asrs r2, 24
@ -6864,11 +6864,11 @@ _08143C74:
_08143C80: _08143C80:
.4byte 0x00000000 .4byte 0x00000000
_08143C84: _08143C84:
.4byte gMPlay_SE1 .4byte gMPlayInfo_SE1
_08143C88: _08143C88:
.4byte 0x0000FFFF .4byte 0x0000FFFF
_08143C8C: _08143C8C:
.4byte gMPlay_SE2 .4byte gMPlayInfo_SE2
thumb_func_end sub_8143B84 thumb_func_end sub_8143B84
thumb_func_start sub_8143C90 thumb_func_start sub_8143C90
@ -9385,14 +9385,14 @@ sub_81450D8: @ 81450D8
adds r4, r0 adds r4, r0
asrs r4, 1 asrs r4, 1
negs r4, r4 negs r4, r4
ldr r0, =gMPlay_SE1 ldr r0, =gMPlayInfo_SE1
ldr r5, =0x0000ffff ldr r5, =0x0000ffff
lsls r4, 24 lsls r4, 24
asrs r4, 24 asrs r4, 24
adds r1, r5, 0 adds r1, r5, 0
adds r2, r4, 0 adds r2, r4, 0
bl m4aMPlayPanpotControl bl m4aMPlayPanpotControl
ldr r0, =gMPlay_SE2 ldr r0, =gMPlayInfo_SE2
adds r1, r5, 0 adds r1, r5, 0
adds r2, r4, 0 adds r2, r4, 0
bl m4aMPlayPanpotControl bl m4aMPlayPanpotControl

View File

@ -1169,7 +1169,7 @@ _080AAE30:
_080AAE72: _080AAE72:
ldrb r0, [r3, 0x8] ldrb r0, [r3, 0x8]
bl title_screen_update_rayquaza_ring_palette bl title_screen_update_rayquaza_ring_palette
ldr r0, =gMPlay_BGM ldr r0, =gMPlayInfo_BGM
ldr r1, =0x0000ffff ldr r1, =0x0000ffff
ldrh r0, [r0, 0x4] ldrh r0, [r0, 0x4]
cmp r0, 0 cmp r0, 0

View File

@ -1,12 +1,12 @@
gSoundInfo gSoundInfo
gPokemonCrySongs gPokemonCrySongs
gPokemonCryMusicPlayers gPokemonCryMusicPlayers
gMPlay_BGM gMPlayInfo_BGM
gMPlayJumpTable gMPlayJumpTable
gCgbChans gCgbChans
gMPlay_SE1 gMPlayInfo_SE1
gMPlay_SE2 gMPlayInfo_SE2
gPokemonCryTracks gPokemonCryTracks
gPokemonCrySong gPokemonCrySong
gMPlayMemAccArea gMPlayMemAccArea
gMPlay_SE3 gMPlayInfo_SE3

View File

@ -1,6 +1,6 @@
.align 2 .align 2
gMPlayTable:: @ 86B49C0 gMPlayTable:: @ 86B49C0
music_player gMPlay_BGM, 0x3001340, 10, 0 music_player gMPlayInfo_BGM, gMPlayTrack_BGM, 10, 0
music_player gMPlay_SE1, 0x3001660, 3, 1 music_player gMPlayInfo_SE1, gMPlayTrack_SE1, 3, 1
music_player gMPlay_SE2, 0x3001750, 9, 1 music_player gMPlayInfo_SE2, gMPlayTrack_SE2, 9, 1
music_player gMPlay_SE3, 0x3001A20, 1, 0 music_player gMPlayInfo_SE3, gMPlayTrack_SE3, 1, 0

View File

@ -92,8 +92,8 @@ extern struct UnknownPokemonStruct2 gUnknown_02022FF8[3]; // what is it used for
extern struct UnknownPokemonStruct2* gUnknown_02023058; // what is it used for? extern struct UnknownPokemonStruct2* gUnknown_02023058; // what is it used for?
extern u8 gUnknown_02039B28[]; // possibly a struct? extern u8 gUnknown_02039B28[]; // possibly a struct?
extern struct UnknownStruct6 gUnknown_02038C28; // todo: identify & document extern struct UnknownStruct6 gUnknown_02038C28; // todo: identify & document
extern struct MusicPlayerInfo gMPlay_SE1; extern struct MusicPlayerInfo gMPlayInfo_SE1;
extern struct MusicPlayerInfo gMPlay_SE2; extern struct MusicPlayerInfo gMPlayInfo_SE2;
extern u8 gDecompressionBuffer[]; extern u8 gDecompressionBuffer[];
extern u16 gUnknown_020243FC; extern u16 gUnknown_020243FC;
extern u8 gHealthBoxesIds[BATTLE_BANKS_COUNT]; extern u8 gHealthBoxesIds[BATTLE_BANKS_COUNT];
@ -1610,8 +1610,8 @@ void CB2_QuitRecordedBattle(void)
UpdatePaletteFade(); UpdatePaletteFade();
if (!gPaletteFade.active) if (!gPaletteFade.active)
{ {
m4aMPlayStop(&gMPlay_SE1); m4aMPlayStop(&gMPlayInfo_SE1);
m4aMPlayStop(&gMPlay_SE2); m4aMPlayStop(&gMPlayInfo_SE2);
FreeRestoreBattleData(); FreeRestoreBattleData();
FreeAllWindowBuffers(); FreeAllWindowBuffers();
SetMainCallback2(gMain.savedCallback); SetMainCallback2(gMain.savedCallback);

View File

@ -37,9 +37,9 @@ extern u16 gBattle_BG2_X;
extern u16 gBattle_BG2_Y; extern u16 gBattle_BG2_Y;
extern u16 gBattlePartyID[BATTLE_BANKS_COUNT]; extern u16 gBattlePartyID[BATTLE_BANKS_COUNT];
extern u8 gBankSpriteIds[BATTLE_BANKS_COUNT]; extern u8 gBankSpriteIds[BATTLE_BANKS_COUNT];
extern struct MusicPlayerInfo gMPlay_BGM; extern struct MusicPlayerInfo gMPlayInfo_BGM;
extern struct MusicPlayerInfo gMPlay_SE1; extern struct MusicPlayerInfo gMPlayInfo_SE1;
extern struct MusicPlayerInfo gMPlay_SE2; extern struct MusicPlayerInfo gMPlayInfo_SE2;
extern u8 gDecompressionBuffer[]; extern u8 gDecompressionBuffer[];
extern const u16 gUnknown_082C8D64[]; extern const u16 gUnknown_082C8D64[];
@ -272,7 +272,7 @@ void LaunchBattleAnimation(const u8 *const animsTable[], u16 tableId, bool8 isMo
{ {
if (tableId == gUnknown_082C8D64[i]) if (tableId == gUnknown_082C8D64[i])
{ {
m4aMPlayVolumeControl(&gMPlay_BGM, 0xFFFF, 128); m4aMPlayVolumeControl(&gMPlayInfo_BGM, 0xFFFF, 128);
break; break;
} }
} }
@ -514,8 +514,8 @@ static void ScriptCmd_end(void)
} }
else else
{ {
m4aMPlayStop(&gMPlay_SE1); m4aMPlayStop(&gMPlayInfo_SE1);
m4aMPlayStop(&gMPlay_SE2); m4aMPlayStop(&gMPlayInfo_SE2);
} }
} }
@ -534,7 +534,7 @@ static void ScriptCmd_end(void)
if (!continuousAnim) // may have been used for debug? if (!continuousAnim) // may have been used for debug?
{ {
m4aMPlayVolumeControl(&gMPlay_BGM, 0xFFFF, 256); m4aMPlayVolumeControl(&gMPlayInfo_BGM, 0xFFFF, 256);
if (!IsContest()) if (!IsContest())
{ {
sub_80A8278(); sub_80A8278();
@ -1650,8 +1650,8 @@ static void ScriptCmd_waitsound(void)
{ {
if (++sSoundAnimFramesToWait > 90) if (++sSoundAnimFramesToWait > 90)
{ {
m4aMPlayStop(&gMPlay_SE1); m4aMPlayStop(&gMPlayInfo_SE1);
m4aMPlayStop(&gMPlay_SE2); m4aMPlayStop(&gMPlayInfo_SE2);
sSoundAnimFramesToWait = 0; sSoundAnimFramesToWait = 0;
} }
else else
@ -1833,7 +1833,7 @@ static void ScriptCmd_doublebattle_2E(void)
static void ScriptCmd_stopsound(void) static void ScriptCmd_stopsound(void)
{ {
m4aMPlayStop(&gMPlay_SE1); m4aMPlayStop(&gMPlayInfo_SE1);
m4aMPlayStop(&gMPlay_SE2); m4aMPlayStop(&gMPlayInfo_SE2);
sBattleAnimScriptPtr++; sBattleAnimScriptPtr++;
} }

View File

@ -51,7 +51,7 @@ extern u8 gBankTarget;
extern u8 gAbsentBankFlags; extern u8 gAbsentBankFlags;
extern u8 gUnknown_020244B4[]; extern u8 gUnknown_020244B4[];
extern u32 gTransformedPersonalities[BATTLE_BANKS_COUNT]; extern u32 gTransformedPersonalities[BATTLE_BANKS_COUNT];
extern struct MusicPlayerInfo gMPlay_BGM; extern struct MusicPlayerInfo gMPlayInfo_BGM;
extern struct UnusedControllerStruct gUnknown_02022D0C; extern struct UnusedControllerStruct gUnknown_02022D0C;
extern u16 gTrainerBattleOpponent_A; extern u16 gTrainerBattleOpponent_A;
extern u16 gTrainerBattleOpponent_B; extern u16 gTrainerBattleOpponent_B;
@ -353,11 +353,11 @@ static void sub_8064734(void)
if (gBattleTypeFlags & BATTLE_TYPE_MULTI && gBattleTypeFlags & BATTLE_TYPE_LINK) if (gBattleTypeFlags & BATTLE_TYPE_MULTI && gBattleTypeFlags & BATTLE_TYPE_LINK)
{ {
if (GetBankIdentity(gActiveBank) == IDENTITY_OPPONENT_MON1) if (GetBankIdentity(gActiveBank) == IDENTITY_OPPONENT_MON1)
m4aMPlayContinue(&gMPlay_BGM); m4aMPlayContinue(&gMPlayInfo_BGM);
} }
else else
{ {
m4aMPlayVolumeControl(&gMPlay_BGM, 0xFFFF, 0x100); m4aMPlayVolumeControl(&gMPlayInfo_BGM, 0xFFFF, 0x100);
} }
} }
@ -499,7 +499,7 @@ static void sub_8064DD0(void)
if (gSprites[gBankSpriteIds[gActiveBank]].callback == SpriteCallbackDummy if (gSprites[gBankSpriteIds[gActiveBank]].callback == SpriteCallbackDummy
|| gSprites[gBankSpriteIds[gActiveBank]].callback == SpriteCallbackDummy_2) || gSprites[gBankSpriteIds[gActiveBank]].callback == SpriteCallbackDummy_2)
{ {
m4aMPlayVolumeControl(&gMPlay_BGM, 0xFFFF, 0x100); m4aMPlayVolumeControl(&gMPlayInfo_BGM, 0xFFFF, 0x100);
LinkOpponentBufferExecCompleted(); LinkOpponentBufferExecCompleted();
} }
} }

View File

@ -38,7 +38,7 @@ extern u8 gBankSpriteIds[BATTLE_BANKS_COUNT];
extern u8 gBattleBufferA[BATTLE_BANKS_COUNT][0x200]; extern u8 gBattleBufferA[BATTLE_BANKS_COUNT][0x200];
extern u8 gBattleBufferB[BATTLE_BANKS_COUNT][0x200]; extern u8 gBattleBufferB[BATTLE_BANKS_COUNT][0x200];
extern u8 gHealthBoxesIds[BATTLE_BANKS_COUNT]; extern u8 gHealthBoxesIds[BATTLE_BANKS_COUNT];
extern struct MusicPlayerInfo gMPlay_BGM; extern struct MusicPlayerInfo gMPlayInfo_BGM;
extern u8 gUnknown_03005D7C[BATTLE_BANKS_COUNT]; extern u8 gUnknown_03005D7C[BATTLE_BANKS_COUNT];
extern void (*gBattleBankFunc[BATTLE_BANKS_COUNT])(void); extern void (*gBattleBankFunc[BATTLE_BANKS_COUNT])(void);
extern void *gUnknown_020244D8; extern void *gUnknown_020244D8;
@ -350,10 +350,10 @@ static void sub_805F560(void)
if (gBattleTypeFlags & BATTLE_TYPE_MULTI && gBattleTypeFlags & BATTLE_TYPE_LINK) if (gBattleTypeFlags & BATTLE_TYPE_MULTI && gBattleTypeFlags & BATTLE_TYPE_LINK)
{ {
if (GetBankIdentity(gActiveBank) == 1) if (GetBankIdentity(gActiveBank) == 1)
m4aMPlayContinue(&gMPlay_BGM); m4aMPlayContinue(&gMPlayInfo_BGM);
} }
else else
m4aMPlayVolumeControl(&gMPlay_BGM, 0xFFFF, 0x100); m4aMPlayVolumeControl(&gMPlayInfo_BGM, 0xFFFF, 0x100);
} }
gBattleSpritesDataPtr->healthBoxesData[gActiveBank].field_1_x20 = 1; gBattleSpritesDataPtr->healthBoxesData[gActiveBank].field_1_x20 = 1;
sp = TRUE; sp = TRUE;
@ -485,7 +485,7 @@ static void sub_805FC80(void)
{ {
if (gSprites[gBankSpriteIds[gActiveBank]].callback == SpriteCallbackDummy || gSprites[gBankSpriteIds[gActiveBank]].callback == SpriteCallbackDummy_2) if (gSprites[gBankSpriteIds[gActiveBank]].callback == SpriteCallbackDummy || gSprites[gBankSpriteIds[gActiveBank]].callback == SpriteCallbackDummy_2)
{ {
m4aMPlayVolumeControl(&gMPlay_BGM, 0xFFFF, 0x100); m4aMPlayVolumeControl(&gMPlayInfo_BGM, 0xFFFF, 0x100);
OpponentBufferExecCompleted(); OpponentBufferExecCompleted();
} }
} }

View File

@ -43,7 +43,7 @@ extern u8 gBattleBufferA[BATTLE_BANKS_COUNT][0x200];
extern u8 gBattleBufferB[BATTLE_BANKS_COUNT][0x200]; extern u8 gBattleBufferB[BATTLE_BANKS_COUNT][0x200];
extern u8 gMultiUsePlayerCursor; extern u8 gMultiUsePlayerCursor;
extern struct BattlePokemon gBattleMons[BATTLE_BANKS_COUNT]; extern struct BattlePokemon gBattleMons[BATTLE_BANKS_COUNT];
extern struct MusicPlayerInfo gMPlay_BGM; extern struct MusicPlayerInfo gMPlayInfo_BGM;
extern u16 gPartnerTrainerId; extern u16 gPartnerTrainerId;
extern struct SpriteTemplate gUnknown_0202499C; extern struct SpriteTemplate gUnknown_0202499C;
extern u8 gBattleMonForms[BATTLE_BANKS_COUNT]; extern u8 gBattleMonForms[BATTLE_BANKS_COUNT];
@ -1054,9 +1054,9 @@ static void sub_8058B40(void)
if (!gBattleSpritesDataPtr->healthBoxesData[gActiveBank].field_1_x20) if (!gBattleSpritesDataPtr->healthBoxesData[gActiveBank].field_1_x20)
{ {
if (gBattleTypeFlags & BATTLE_TYPE_MULTI && gBattleTypeFlags & BATTLE_TYPE_LINK) if (gBattleTypeFlags & BATTLE_TYPE_MULTI && gBattleTypeFlags & BATTLE_TYPE_LINK)
m4aMPlayContinue(&gMPlay_BGM); m4aMPlayContinue(&gMPlayInfo_BGM);
else else
m4aMPlayVolumeControl(&gMPlay_BGM, 0xFFFF, 0x100); m4aMPlayVolumeControl(&gMPlayInfo_BGM, 0xFFFF, 0x100);
} }
gBattleSpritesDataPtr->healthBoxesData[gActiveBank].field_1_x20 = 1; gBattleSpritesDataPtr->healthBoxesData[gActiveBank].field_1_x20 = 1;
r9 = TRUE; r9 = TRUE;
@ -1119,7 +1119,7 @@ static void sub_8058FC0(void)
if (!gBattleSpritesDataPtr->healthBoxesData[gActiveBank].specialAnimActive if (!gBattleSpritesDataPtr->healthBoxesData[gActiveBank].specialAnimActive
&& !IsCryPlayingOrClearCrySongs()) && !IsCryPlayingOrClearCrySongs())
{ {
m4aMPlayVolumeControl(&gMPlay_BGM, 0xFFFF, 0x100); m4aMPlayVolumeControl(&gMPlayInfo_BGM, 0xFFFF, 0x100);
HandleLowHpMusicChange(&gPlayerParty[gBattlePartyID[gActiveBank]], gActiveBank); HandleLowHpMusicChange(&gPlayerParty[gBattlePartyID[gActiveBank]], gActiveBank);
PlayerBufferExecCompleted(); PlayerBufferExecCompleted();
} }
@ -1148,7 +1148,7 @@ void c3_0802FDF4(u8 taskId)
{ {
if (!IsCryPlayingOrClearCrySongs()) if (!IsCryPlayingOrClearCrySongs())
{ {
m4aMPlayVolumeControl(&gMPlay_BGM, 0xFFFF, 0x100); m4aMPlayVolumeControl(&gMPlayInfo_BGM, 0xFFFF, 0x100);
DestroyTask(taskId); DestroyTask(taskId);
} }
} }

View File

@ -52,7 +52,7 @@ extern u8 gBankTarget;
extern u8 gAbsentBankFlags; extern u8 gAbsentBankFlags;
extern u8 gUnknown_020244B4[]; extern u8 gUnknown_020244B4[];
extern u32 gTransformedPersonalities[BATTLE_BANKS_COUNT]; extern u32 gTransformedPersonalities[BATTLE_BANKS_COUNT];
extern struct MusicPlayerInfo gMPlay_BGM; extern struct MusicPlayerInfo gMPlayInfo_BGM;
extern struct UnusedControllerStruct gUnknown_02022D0C; extern struct UnusedControllerStruct gUnknown_02022D0C;
extern u16 gTrainerBattleOpponent_A; extern u16 gTrainerBattleOpponent_A;
extern u16 gTrainerBattleOpponent_B; extern u16 gTrainerBattleOpponent_B;
@ -331,11 +331,11 @@ static void sub_818686C(void)
if (gBattleTypeFlags & BATTLE_TYPE_MULTI && gBattleTypeFlags & BATTLE_TYPE_LINK) if (gBattleTypeFlags & BATTLE_TYPE_MULTI && gBattleTypeFlags & BATTLE_TYPE_LINK)
{ {
if (GetBankIdentity(gActiveBank) == IDENTITY_OPPONENT_MON1) if (GetBankIdentity(gActiveBank) == IDENTITY_OPPONENT_MON1)
m4aMPlayContinue(&gMPlay_BGM); m4aMPlayContinue(&gMPlayInfo_BGM);
} }
else else
{ {
m4aMPlayVolumeControl(&gMPlay_BGM, 0xFFFF, 0x100); m4aMPlayVolumeControl(&gMPlayInfo_BGM, 0xFFFF, 0x100);
} }
} }
gBattleSpritesDataPtr->healthBoxesData[gActiveBank].field_1_x20 = 1; gBattleSpritesDataPtr->healthBoxesData[gActiveBank].field_1_x20 = 1;
@ -484,7 +484,7 @@ static void sub_8186F14(void)
if (gSprites[gBankSpriteIds[gActiveBank]].callback == SpriteCallbackDummy if (gSprites[gBankSpriteIds[gActiveBank]].callback == SpriteCallbackDummy
|| gSprites[gBankSpriteIds[gActiveBank]].callback == SpriteCallbackDummy_2) || gSprites[gBankSpriteIds[gActiveBank]].callback == SpriteCallbackDummy_2)
{ {
m4aMPlayVolumeControl(&gMPlay_BGM, 0xFFFF, 0x100); m4aMPlayVolumeControl(&gMPlayInfo_BGM, 0xFFFF, 0x100);
RecordedOpponentBufferExecCompleted(); RecordedOpponentBufferExecCompleted();
} }
} }

View File

@ -54,7 +54,7 @@ extern u8 gUnknown_020244B4[];
extern u32 gTransformedPersonalities[BATTLE_BANKS_COUNT]; extern u32 gTransformedPersonalities[BATTLE_BANKS_COUNT];
extern u8 gBattleCommunication[]; extern u8 gBattleCommunication[];
extern u8 gUnknown_0203C7B4; extern u8 gUnknown_0203C7B4;
extern struct MusicPlayerInfo gMPlay_BGM; extern struct MusicPlayerInfo gMPlayInfo_BGM;
extern struct UnusedControllerStruct gUnknown_02022D0C; extern struct UnusedControllerStruct gUnknown_02022D0C;
extern const struct CompressedSpritePalette gTrainerFrontPicPaletteTable[]; extern const struct CompressedSpritePalette gTrainerFrontPicPaletteTable[];
@ -354,11 +354,11 @@ static void sub_8189D40(void)
if ((gBattleTypeFlags & BATTLE_TYPE_LINK) && (gBattleTypeFlags & BATTLE_TYPE_MULTI)) if ((gBattleTypeFlags & BATTLE_TYPE_LINK) && (gBattleTypeFlags & BATTLE_TYPE_MULTI))
{ {
if (GetBankIdentity(gActiveBank) == IDENTITY_PLAYER_MON1) if (GetBankIdentity(gActiveBank) == IDENTITY_PLAYER_MON1)
m4aMPlayContinue(&gMPlay_BGM); m4aMPlayContinue(&gMPlayInfo_BGM);
} }
else else
{ {
m4aMPlayVolumeControl(&gMPlay_BGM, 0xFFFF, 0x100); m4aMPlayVolumeControl(&gMPlayInfo_BGM, 0xFFFF, 0x100);
} }
} }

View File

@ -42,7 +42,7 @@ extern u8 gBattleBufferA[BATTLE_BANKS_COUNT][0x200];
extern u8 gBattleBufferB[BATTLE_BANKS_COUNT][0x200]; extern u8 gBattleBufferB[BATTLE_BANKS_COUNT][0x200];
extern u8 gMultiUsePlayerCursor; extern u8 gMultiUsePlayerCursor;
extern struct BattlePokemon gBattleMons[BATTLE_BANKS_COUNT]; extern struct BattlePokemon gBattleMons[BATTLE_BANKS_COUNT];
extern struct MusicPlayerInfo gMPlay_BGM; extern struct MusicPlayerInfo gMPlayInfo_BGM;
extern u16 gPartnerTrainerId; extern u16 gPartnerTrainerId;
extern struct SpriteTemplate gUnknown_0202499C; extern struct SpriteTemplate gUnknown_0202499C;
extern u8 gBattleMonForms[BATTLE_BANKS_COUNT]; extern u8 gBattleMonForms[BATTLE_BANKS_COUNT];

View File

@ -34,9 +34,9 @@ extern u8 gBankSpriteIds[BATTLE_BANKS_COUNT];
extern u8 gHealthBoxesIds[BATTLE_BANKS_COUNT]; extern u8 gHealthBoxesIds[BATTLE_BANKS_COUNT];
extern u8 gBattleMonForms[BATTLE_BANKS_COUNT]; extern u8 gBattleMonForms[BATTLE_BANKS_COUNT];
extern u32 gTransformedPersonalities[BATTLE_BANKS_COUNT]; extern u32 gTransformedPersonalities[BATTLE_BANKS_COUNT];
extern struct MusicPlayerInfo gMPlay_SE1; extern struct MusicPlayerInfo gMPlayInfo_SE1;
extern struct MusicPlayerInfo gMPlay_SE2; extern struct MusicPlayerInfo gMPlayInfo_SE2;
extern struct MusicPlayerInfo gMPlay_BGM; extern struct MusicPlayerInfo gMPlayInfo_BGM;
extern const struct BattleMove gBattleMoves[]; extern const struct BattleMove gBattleMoves[];
extern const u8 gUnknown_0831C604[]; extern const u8 gUnknown_0831C604[];
@ -527,8 +527,8 @@ bool8 mplay_80342A4(u8 bank)
if (gBattleSpritesDataPtr->healthBoxesData[gActiveBank].field_8 < 30) if (gBattleSpritesDataPtr->healthBoxesData[gActiveBank].field_8 < 30)
return TRUE; return TRUE;
m4aMPlayStop(&gMPlay_SE1); m4aMPlayStop(&gMPlayInfo_SE1);
m4aMPlayStop(&gMPlay_SE2); m4aMPlayStop(&gMPlayInfo_SE2);
} }
if (zero == 0) if (zero == 0)
{ {

View File

@ -112,7 +112,7 @@ extern u16 gBattle_BG1_Y;
extern u16 gBattle_BG2_X; extern u16 gBattle_BG2_X;
extern u16 gBattle_BG2_Y; extern u16 gBattle_BG2_Y;
extern u16 gBattle_BG3_X; extern u16 gBattle_BG3_X;
extern struct MusicPlayerInfo gMPlay_BGM; extern struct MusicPlayerInfo gMPlayInfo_BGM;
struct TrainerMoney struct TrainerMoney
{ {
@ -7103,10 +7103,10 @@ static void atk76_various(void)
} }
break; break;
case 21: case 21:
m4aMPlayVolumeControl(&gMPlay_BGM, 0xFFFF, 0x55); m4aMPlayVolumeControl(&gMPlayInfo_BGM, 0xFFFF, 0x55);
break; break;
case 22: case 22:
m4aMPlayVolumeControl(&gMPlay_BGM, 0xFFFF, 0x100); m4aMPlayVolumeControl(&gMPlayInfo_BGM, 0xFFFF, 0x100);
break; break;
case 23: case 23:
gBattleStruct->field_2A2 |= gBitTable[gActiveBank]; gBattleStruct->field_2A2 |= gBitTable[gActiveBank];

View File

@ -127,8 +127,8 @@ struct BerryBlenderData
struct BlenderGameBlock gameBlock; struct BlenderGameBlock gameBlock;
}; };
extern struct MusicPlayerInfo gMPlay_SE2; extern struct MusicPlayerInfo gMPlayInfo_SE2;
extern struct MusicPlayerInfo gMPlay_BGM; extern struct MusicPlayerInfo gMPlayInfo_BGM;
extern u16 gSpecialVar_ItemId; extern u16 gSpecialVar_ItemId;
extern u8 gInGameOpponentsNo; extern u8 gInGameOpponentsNo;
extern u8 gUnknown_020322D5; extern u8 gUnknown_020322D5;
@ -801,7 +801,7 @@ static const struct WindowTemplate sBlenderRecordWindowTemplate = {0, 6, 4, 0x12
static void Blender_ControlHitPitch(void) static void Blender_ControlHitPitch(void)
{ {
m4aMPlayPitchControl(&gMPlay_SE2, 0xFFFF, 2 * (sBerryBlenderData->field_4C - 128)); m4aMPlayPitchControl(&gMPlayInfo_SE2, 0xFFFF, 2 * (sBerryBlenderData->field_4C - 128));
} }
static void VBlankCB0_BerryBlender(void) static void VBlankCB0_BerryBlender(void)
@ -1938,9 +1938,9 @@ static void sub_80814F4(void)
if (gRecvCmds[i][2] == 0x2345 || gRecvCmds[2][i] == 0x4523 || gRecvCmds[2][i] == 0x5432) // could be a bug, 2 and i are reversed if (gRecvCmds[i][2] == 0x2345 || gRecvCmds[2][i] == 0x4523 || gRecvCmds[2][i] == 0x5432) // could be a bug, 2 and i are reversed
{ {
if (sBerryBlenderData->field_4C > 1500) if (sBerryBlenderData->field_4C > 1500)
m4aMPlayTempoControl(&gMPlay_BGM, ((sBerryBlenderData->field_4C - 750) / 20) + 256); m4aMPlayTempoControl(&gMPlayInfo_BGM, ((sBerryBlenderData->field_4C - 750) / 20) + 256);
else else
m4aMPlayTempoControl(&gMPlay_BGM, 0x100); m4aMPlayTempoControl(&gMPlayInfo_BGM, 0x100);
} }
} }
} }
@ -2335,7 +2335,7 @@ static void CB2_HandleBlenderEndGame(void)
switch (sBerryBlenderData->gameEndState) switch (sBerryBlenderData->gameEndState)
{ {
case 1: case 1:
m4aMPlayTempoControl(&gMPlay_BGM, 256); m4aMPlayTempoControl(&gMPlayInfo_BGM, 256);
for (i = 0; i < gSpecialVar_0x8004; i++) for (i = 0; i < gSpecialVar_0x8004; i++)
{ {
DestroyTask(sBerryBlenderData->field_120[i]); DestroyTask(sBerryBlenderData->field_120[i]);
@ -2355,7 +2355,7 @@ static void CB2_HandleBlenderEndGame(void)
sBerryBlenderData->gameEndState = 5; sBerryBlenderData->gameEndState = 5;
sBerryBlenderData->mainState = 0; sBerryBlenderData->mainState = 0;
m4aMPlayStop(&gMPlay_SE2); m4aMPlayStop(&gMPlayInfo_SE2);
} }
Blender_ControlHitPitch(); Blender_ControlHitPitch();
break; break;

View File

@ -54,7 +54,7 @@ static EWRAM_DATA struct HofGfx *sHofGfxPtr = NULL;
extern bool8 gHasHallOfFameRecords; extern bool8 gHasHallOfFameRecords;
extern u32 gUnknown_0203BCD4; extern u32 gUnknown_0203BCD4;
extern u8 gDecompressionBuffer[]; extern u8 gDecompressionBuffer[];
extern struct MusicPlayerInfo gMPlay_BGM; extern struct MusicPlayerInfo gMPlayInfo_BGM;
extern MainCallback gGameContinueCallback; extern MainCallback gGameContinueCallback;
extern u32 gDamagedSaveSectors; extern u32 gDamagedSaveSectors;
extern u8 gReservedSpritePaletteCount; extern u8 gReservedSpritePaletteCount;
@ -1040,7 +1040,7 @@ static void Task_HofPC_HandleInput(u8 taskId)
if (IsCryPlayingOrClearCrySongs()) if (IsCryPlayingOrClearCrySongs())
{ {
StopCryAndClearCrySongs(); StopCryAndClearCrySongs();
m4aMPlayVolumeControl(&gMPlay_BGM, 0xFFFF, 0x100); m4aMPlayVolumeControl(&gMPlayInfo_BGM, 0xFFFF, 0x100);
} }
gTasks[taskId].func = Task_HofPC_HandlePaletteOnExit; gTasks[taskId].func = Task_HofPC_HandlePaletteOnExit;
} }
@ -1050,7 +1050,7 @@ static void Task_HofPC_HandleInput(u8 taskId)
if (IsCryPlayingOrClearCrySongs()) if (IsCryPlayingOrClearCrySongs())
{ {
StopCryAndClearCrySongs(); StopCryAndClearCrySongs();
m4aMPlayVolumeControl(&gMPlay_BGM, 0xFFFF, 0x100); m4aMPlayVolumeControl(&gMPlayInfo_BGM, 0xFFFF, 0x100);
} }
gTasks[taskId].func = Task_HofPC_HandlePaletteOnExit; gTasks[taskId].func = Task_HofPC_HandlePaletteOnExit;
} }

View File

@ -11,10 +11,10 @@ void *gMPlayJumpTable[36];
struct CgbChannel gCgbChans[4]; struct CgbChannel gCgbChans[4];
struct MusicPlayerTrack gPokemonCryTracks[MAX_POKEMON_CRIES * 2]; struct MusicPlayerTrack gPokemonCryTracks[MAX_POKEMON_CRIES * 2];
struct PokemonCrySong gPokemonCrySong; struct PokemonCrySong gPokemonCrySong;
struct MusicPlayerInfo gMPlay_BGM; struct MusicPlayerInfo gMPlayInfo_BGM;
struct MusicPlayerInfo gMPlay_SE1; struct MusicPlayerInfo gMPlayInfo_SE1;
struct MusicPlayerInfo gMPlay_SE2; struct MusicPlayerInfo gMPlayInfo_SE2;
struct MusicPlayerInfo gMPlay_SE3; struct MusicPlayerInfo gMPlayInfo_SE3;
u8 gMPlayMemAccArea[0x10]; u8 gMPlayMemAccArea[0x10];
u32 MidiKeyToFreq(struct WaveData *wav, u8 key, u8 fineAdjust) u32 MidiKeyToFreq(struct WaveData *wav, u8 key, u8 fineAdjust)

View File

@ -21,7 +21,7 @@ extern u8 gBankTarget;
extern u16 gBattlePartyID[]; extern u16 gBattlePartyID[];
extern u8 gBankSpriteIds[]; extern u8 gBankSpriteIds[];
extern u8 gHealthBoxesIds[]; extern u8 gHealthBoxesIds[];
extern struct MusicPlayerInfo gMPlay_BGM; extern struct MusicPlayerInfo gMPlayInfo_BGM;
// this file's functions // this file's functions
static void Task_DoPokeballSendOutAnim(u8 taskId); static void Task_DoPokeballSendOutAnim(u8 taskId);
@ -773,11 +773,11 @@ static void SpriteCB_ReleaseMonFromBall(struct Sprite *sprite)
if (gBattleTypeFlags & BATTLE_TYPE_MULTI && gBattleTypeFlags & BATTLE_TYPE_LINK) if (gBattleTypeFlags & BATTLE_TYPE_MULTI && gBattleTypeFlags & BATTLE_TYPE_LINK)
{ {
if (IsBGMPlaying()) if (IsBGMPlaying())
m4aMPlayStop(&gMPlay_BGM); m4aMPlayStop(&gMPlayInfo_BGM);
} }
else else
{ {
m4aMPlayVolumeControl(&gMPlay_BGM, 0xFFFF, 128); m4aMPlayVolumeControl(&gMPlayInfo_BGM, 0xFFFF, 128);
} }
} }

View File

@ -50,7 +50,7 @@ struct PokeblockFeedStruct
}; };
extern u16 gSpecialVar_ItemId; extern u16 gSpecialVar_ItemId;
extern struct MusicPlayerInfo gMPlay_BGM; extern struct MusicPlayerInfo gMPlayInfo_BGM;
extern struct SpriteTemplate gUnknown_0202499C; extern struct SpriteTemplate gUnknown_0202499C;
extern const u8 gBattleTerrainPalette_Frontier[]; extern const u8 gBattleTerrainPalette_Frontier[];
@ -802,7 +802,7 @@ static void Task_ReturnAfterPaletteFade(u8 taskId)
{ {
ResetSpriteData(); ResetSpriteData();
FreeAllSpritePalettes(); FreeAllSpritePalettes();
m4aMPlayVolumeControl(&gMPlay_BGM, -1, 0x100); m4aMPlayVolumeControl(&gMPlayInfo_BGM, -1, 0x100);
SetMainCallback2(gMain.savedCallback); SetMainCallback2(gMain.savedCallback);
DestroyTask(taskId); DestroyTask(taskId);
FreeAllWindowBuffers(); FreeAllWindowBuffers();

View File

@ -41,7 +41,7 @@ struct ContestEffect
extern struct UnkSummaryStruct* gUnknown_0203CF1C; extern struct UnkSummaryStruct* gUnknown_0203CF1C;
extern struct BgTemplate gUnknown_0861CBB4; extern struct BgTemplate gUnknown_0861CBB4;
extern u8 gUnknown_0203CF20; extern u8 gUnknown_0203CF20;
extern struct MusicPlayerInfo gMPlay_BGM; extern struct MusicPlayerInfo gMPlayInfo_BGM;
extern s8 gUnknown_0861CC1C[]; extern s8 gUnknown_0861CC1C[];
extern u8 gUnknown_08329D22[]; extern u8 gUnknown_08329D22[];
extern u8 gUnknown_0203CF21; extern u8 gUnknown_0203CF21;
@ -793,7 +793,7 @@ void sub_81C0484(u8 taskId)
ResetSpriteData(); ResetSpriteData();
FreeAllSpritePalettes(); FreeAllSpritePalettes();
StopCryAndClearCrySongs(); StopCryAndClearCrySongs();
m4aMPlayVolumeControl(&gMPlay_BGM, 0xFFFF, 0x100); m4aMPlayVolumeControl(&gMPlayInfo_BGM, 0xFFFF, 0x100);
if (gMonSpritesGfxPtr == 0) if (gMonSpritesGfxPtr == 0)
sub_806F47C(0); sub_806F47C(0);
sub_81C0434(); sub_81C0434();

View File

@ -29,10 +29,10 @@ IWRAM_DATA static u16 sFanfareCounter;
bool8 gDisableMusic; bool8 gDisableMusic;
extern u32 gBattleTypeFlags; extern u32 gBattleTypeFlags;
extern struct MusicPlayerInfo gMPlay_BGM; extern struct MusicPlayerInfo gMPlayInfo_BGM;
extern struct MusicPlayerInfo gMPlay_SE1; extern struct MusicPlayerInfo gMPlayInfo_SE1;
extern struct MusicPlayerInfo gMPlay_SE2; extern struct MusicPlayerInfo gMPlayInfo_SE2;
extern struct MusicPlayerInfo gMPlay_SE3; extern struct MusicPlayerInfo gMPlayInfo_SE3;
extern struct ToneData gCryTable[]; extern struct ToneData gCryTable[];
extern struct ToneData gCryTable2[]; extern struct ToneData gCryTable2[];
extern const struct Fanfare sFanfares[]; extern const struct Fanfare sFanfares[];
@ -171,7 +171,7 @@ bool8 IsNotWaitingForBGMStop(void)
void PlayFanfareByFanfareNum(u8 fanfareNum) void PlayFanfareByFanfareNum(u8 fanfareNum)
{ {
u16 songNum; u16 songNum;
m4aMPlayStop(&gMPlay_BGM); m4aMPlayStop(&gMPlayInfo_BGM);
songNum = sFanfares[fanfareNum].songNum; songNum = sFanfares[fanfareNum].songNum;
sFanfareCounter = sFanfares[fanfareNum].duration; sFanfareCounter = sFanfares[fanfareNum].duration;
m4aSongNumStart(songNum); m4aSongNumStart(songNum);
@ -187,7 +187,7 @@ bool8 WaitFanfare(bool8 stop)
else else
{ {
if (!stop) if (!stop)
m4aMPlayContinue(&gMPlay_BGM); m4aMPlayContinue(&gMPlayInfo_BGM);
else else
m4aSongNumStart(MUS_DUMMY); m4aSongNumStart(MUS_DUMMY);
@ -232,7 +232,7 @@ static void Task_Fanfare(u8 taskId)
} }
else else
{ {
m4aMPlayContinue(&gMPlay_BGM); m4aMPlayContinue(&gMPlayInfo_BGM);
DestroyTask(taskId); DestroyTask(taskId);
} }
} }
@ -250,46 +250,46 @@ void FadeInNewBGM(u16 songNum, u8 speed)
if (songNum == 0xFFFF) if (songNum == 0xFFFF)
songNum = 0; songNum = 0;
m4aSongNumStart(songNum); m4aSongNumStart(songNum);
m4aMPlayImmInit(&gMPlay_BGM); m4aMPlayImmInit(&gMPlayInfo_BGM);
m4aMPlayVolumeControl(&gMPlay_BGM, 0xFFFF, 0); m4aMPlayVolumeControl(&gMPlayInfo_BGM, 0xFFFF, 0);
m4aSongNumStop(songNum); m4aSongNumStop(songNum);
m4aMPlayFadeIn(&gMPlay_BGM, speed); m4aMPlayFadeIn(&gMPlayInfo_BGM, speed);
} }
void FadeOutBGMTemporarily(u8 speed) void FadeOutBGMTemporarily(u8 speed)
{ {
m4aMPlayFadeOutTemporarily(&gMPlay_BGM, speed); m4aMPlayFadeOutTemporarily(&gMPlayInfo_BGM, speed);
} }
bool8 IsBGMPausedOrStopped(void) bool8 IsBGMPausedOrStopped(void)
{ {
if (gMPlay_BGM.status & MUSICPLAYER_STATUS_PAUSE) if (gMPlayInfo_BGM.status & MUSICPLAYER_STATUS_PAUSE)
return TRUE; return TRUE;
if (!(gMPlay_BGM.status & MUSICPLAYER_STATUS_TRACK)) if (!(gMPlayInfo_BGM.status & MUSICPLAYER_STATUS_TRACK))
return TRUE; return TRUE;
return FALSE; return FALSE;
} }
void FadeInBGM(u8 speed) void FadeInBGM(u8 speed)
{ {
m4aMPlayFadeIn(&gMPlay_BGM, speed); m4aMPlayFadeIn(&gMPlayInfo_BGM, speed);
} }
void FadeOutBGM(u8 speed) void FadeOutBGM(u8 speed)
{ {
m4aMPlayFadeOut(&gMPlay_BGM, speed); m4aMPlayFadeOut(&gMPlayInfo_BGM, speed);
} }
bool8 IsBGMStopped(void) bool8 IsBGMStopped(void)
{ {
if (!(gMPlay_BGM.status & MUSICPLAYER_STATUS_TRACK)) if (!(gMPlayInfo_BGM.status & MUSICPLAYER_STATUS_TRACK))
return TRUE; return TRUE;
return FALSE; return FALSE;
} }
void PlayCry1(u16 species, s8 pan) void PlayCry1(u16 species, s8 pan)
{ {
m4aMPlayVolumeControl(&gMPlay_BGM, 0xFFFF, 85); m4aMPlayVolumeControl(&gMPlayInfo_BGM, 0xFFFF, 85);
PlayCryInternal(species, pan, CRY_VOLUME, 10, 0); PlayCryInternal(species, pan, CRY_VOLUME, 10, 0);
gPokemonCryBGMDuckingCounter = 2; gPokemonCryBGMDuckingCounter = 2;
RestoreBGMVolumeAfterPokemonCry(); RestoreBGMVolumeAfterPokemonCry();
@ -308,7 +308,7 @@ void PlayCry3(u16 species, s8 pan, u8 mode)
} }
else else
{ {
m4aMPlayVolumeControl(&gMPlay_BGM, 0xFFFF, 85); m4aMPlayVolumeControl(&gMPlayInfo_BGM, 0xFFFF, 85);
PlayCryInternal(species, pan, CRY_VOLUME, 10, mode); PlayCryInternal(species, pan, CRY_VOLUME, 10, mode);
gPokemonCryBGMDuckingCounter = 2; gPokemonCryBGMDuckingCounter = 2;
RestoreBGMVolumeAfterPokemonCry(); RestoreBGMVolumeAfterPokemonCry();
@ -324,7 +324,7 @@ void PlayCry4(u16 species, s8 pan, u8 mode)
else else
{ {
if (!(gBattleTypeFlags & BATTLE_TYPE_MULTI)) if (!(gBattleTypeFlags & BATTLE_TYPE_MULTI))
m4aMPlayVolumeControl(&gMPlay_BGM, 0xFFFF, 85); m4aMPlayVolumeControl(&gMPlayInfo_BGM, 0xFFFF, 85);
PlayCryInternal(species, pan, CRY_VOLUME, 10, mode); PlayCryInternal(species, pan, CRY_VOLUME, 10, mode);
} }
} }
@ -337,7 +337,7 @@ void PlayCry6(u16 species, s8 pan, u8 mode) // not present in R/S
} }
else else
{ {
m4aMPlayVolumeControl(&gMPlay_BGM, 0xFFFF, 85); m4aMPlayVolumeControl(&gMPlayInfo_BGM, 0xFFFF, 85);
PlayCryInternal(species, pan, CRY_VOLUME, 10, mode); PlayCryInternal(species, pan, CRY_VOLUME, 10, mode);
gPokemonCryBGMDuckingCounter = 2; gPokemonCryBGMDuckingCounter = 2;
} }
@ -345,7 +345,7 @@ void PlayCry6(u16 species, s8 pan, u8 mode) // not present in R/S
void PlayCry5(u16 species, u8 mode) void PlayCry5(u16 species, u8 mode)
{ {
m4aMPlayVolumeControl(&gMPlay_BGM, 0xFFFF, 85); m4aMPlayVolumeControl(&gMPlayInfo_BGM, 0xFFFF, 85);
PlayCryInternal(species, 0, CRY_VOLUME, 10, mode); PlayCryInternal(species, 0, CRY_VOLUME, 10, mode);
gPokemonCryBGMDuckingCounter = 2; gPokemonCryBGMDuckingCounter = 2;
RestoreBGMVolumeAfterPokemonCry(); RestoreBGMVolumeAfterPokemonCry();
@ -529,7 +529,7 @@ static void Task_DuckBGMForPokemonCry(u8 taskId)
if (!IsPokemonCryPlaying(gMPlay_PokemonCry)) if (!IsPokemonCryPlaying(gMPlay_PokemonCry))
{ {
m4aMPlayVolumeControl(&gMPlay_BGM, 0xFFFF, 256); m4aMPlayVolumeControl(&gMPlayInfo_BGM, 0xFFFF, 256);
DestroyTask(taskId); DestroyTask(taskId);
} }
} }
@ -557,55 +557,55 @@ void PlaySE(u16 songNum)
void PlaySE12WithPanning(u16 songNum, s8 pan) void PlaySE12WithPanning(u16 songNum, s8 pan)
{ {
m4aSongNumStart(songNum); m4aSongNumStart(songNum);
m4aMPlayImmInit(&gMPlay_SE1); m4aMPlayImmInit(&gMPlayInfo_SE1);
m4aMPlayImmInit(&gMPlay_SE2); m4aMPlayImmInit(&gMPlayInfo_SE2);
m4aMPlayPanpotControl(&gMPlay_SE1, 0xFFFF, pan); m4aMPlayPanpotControl(&gMPlayInfo_SE1, 0xFFFF, pan);
m4aMPlayPanpotControl(&gMPlay_SE2, 0xFFFF, pan); m4aMPlayPanpotControl(&gMPlayInfo_SE2, 0xFFFF, pan);
} }
void PlaySE1WithPanning(u16 songNum, s8 pan) void PlaySE1WithPanning(u16 songNum, s8 pan)
{ {
m4aSongNumStart(songNum); m4aSongNumStart(songNum);
m4aMPlayImmInit(&gMPlay_SE1); m4aMPlayImmInit(&gMPlayInfo_SE1);
m4aMPlayPanpotControl(&gMPlay_SE1, 0xFFFF, pan); m4aMPlayPanpotControl(&gMPlayInfo_SE1, 0xFFFF, pan);
} }
void PlaySE2WithPanning(u16 songNum, s8 pan) void PlaySE2WithPanning(u16 songNum, s8 pan)
{ {
m4aSongNumStart(songNum); m4aSongNumStart(songNum);
m4aMPlayImmInit(&gMPlay_SE2); m4aMPlayImmInit(&gMPlayInfo_SE2);
m4aMPlayPanpotControl(&gMPlay_SE2, 0xFFFF, pan); m4aMPlayPanpotControl(&gMPlayInfo_SE2, 0xFFFF, pan);
} }
void SE12PanpotControl(s8 pan) void SE12PanpotControl(s8 pan)
{ {
m4aMPlayPanpotControl(&gMPlay_SE1, 0xFFFF, pan); m4aMPlayPanpotControl(&gMPlayInfo_SE1, 0xFFFF, pan);
m4aMPlayPanpotControl(&gMPlay_SE2, 0xFFFF, pan); m4aMPlayPanpotControl(&gMPlayInfo_SE2, 0xFFFF, pan);
} }
bool8 IsSEPlaying(void) bool8 IsSEPlaying(void)
{ {
if ((gMPlay_SE1.status & MUSICPLAYER_STATUS_PAUSE) && (gMPlay_SE2.status & MUSICPLAYER_STATUS_PAUSE)) if ((gMPlayInfo_SE1.status & MUSICPLAYER_STATUS_PAUSE) && (gMPlayInfo_SE2.status & MUSICPLAYER_STATUS_PAUSE))
return FALSE; return FALSE;
if (!(gMPlay_SE1.status & MUSICPLAYER_STATUS_TRACK) && !(gMPlay_SE2.status & MUSICPLAYER_STATUS_TRACK)) if (!(gMPlayInfo_SE1.status & MUSICPLAYER_STATUS_TRACK) && !(gMPlayInfo_SE2.status & MUSICPLAYER_STATUS_TRACK))
return FALSE; return FALSE;
return TRUE; return TRUE;
} }
bool8 IsBGMPlaying(void) bool8 IsBGMPlaying(void)
{ {
if (gMPlay_BGM.status & MUSICPLAYER_STATUS_PAUSE) if (gMPlayInfo_BGM.status & MUSICPLAYER_STATUS_PAUSE)
return FALSE; return FALSE;
if (!(gMPlay_BGM.status & MUSICPLAYER_STATUS_TRACK)) if (!(gMPlayInfo_BGM.status & MUSICPLAYER_STATUS_TRACK))
return FALSE; return FALSE;
return TRUE; return TRUE;
} }
bool8 IsSpecialSEPlaying(void) bool8 IsSpecialSEPlaying(void)
{ {
if (gMPlay_SE3.status & MUSICPLAYER_STATUS_PAUSE) if (gMPlayInfo_SE3.status & MUSICPLAYER_STATUS_PAUSE)
return FALSE; return FALSE;
if (!(gMPlay_SE3.status & MUSICPLAYER_STATUS_TRACK)) if (!(gMPlayInfo_SE3.status & MUSICPLAYER_STATUS_TRACK))
return FALSE; return FALSE;
return TRUE; return TRUE;
} }

View File

@ -2418,12 +2418,12 @@ _08005ABA:\n\
strb r0, [r6, #0x9]\n\ strb r0, [r6, #0x9]\n\
b _08005A0A\n\ b _08005A0A\n\
_08005ABE:\n\ _08005ABE:\n\
ldr r0, =gMPlay_BGM\n\ ldr r0, =gMPlayInfo_BGM\n\
bl m4aMPlayStop\n\ bl m4aMPlayStop\n\
b _08005A0A\n\ b _08005A0A\n\
.pool\n\ .pool\n\
_08005ACC:\n\ _08005ACC:\n\
ldr r0, =gMPlay_BGM\n\ ldr r0, =gMPlayInfo_BGM\n\
bl m4aMPlayContinue\n\ bl m4aMPlayContinue\n\
b _08005A0A\n\ b _08005A0A\n\
.pool\n\ .pool\n\

View File

@ -192,7 +192,19 @@ gUnknown_030012FC: @ 30012FC
.space 0x4 .space 0x4
gUnknown_03001300: @ 3001300 gUnknown_03001300: @ 3001300
.space 0x770 .space 0x40
gMPlayTrack_BGM: @ 3001340
.space 0x320
gMPlayTrack_SE1: @ 3001660
.space 0xF0
gMPlayTrack_SE2: @ 3001750
.space 0x2D0
gMPlayTrack_SE3: @ 3001A20
.space 0x50
.include "src/agb_flash.o" .include "src/agb_flash.o"
.include "src/siirtc.o" .include "src/siirtc.o"