From 3241b1405f003217d3041ae445eb10d039c0a654 Mon Sep 17 00:00:00 2001 From: Diegoisawesome Date: Tue, 9 Jan 2018 21:30:54 -0600 Subject: [PATCH] Add symbols to music_player_table Also rename gMPlay structs to gMPlayInfo --- asm/battle_frontier_2.s | 2 +- asm/contest.s | 2 +- asm/link.s | 6 +- asm/mauville_old_man.s | 8 +-- asm/pokedex.s | 12 ++-- asm/pokedex_cry_screen.s | 2 +- asm/roulette.s | 12 ++-- asm/title_screen.s | 2 +- common_syms/m4a_2.txt | 8 +-- sound/music_player_table.inc | 8 +-- src/battle_2.c | 8 +-- src/battle_anim.c | 22 +++---- src/battle_controller_link_opponent.c | 8 +-- src/battle_controller_opponent.c | 8 +-- src/battle_controller_player.c | 10 +-- src/battle_controller_recorded_opponent.c | 8 +-- src/battle_controller_recorded_player.c | 6 +- src/battle_controller_wally.c | 2 +- src/battle_gfx_sfx_util.c | 10 +-- src/battle_script_commands.c | 6 +- src/berry_blender.c | 14 ++--- src/hall_of_fame.c | 6 +- src/m4a_2.c | 8 +-- src/pokeball.c | 6 +- src/pokeblock_feed.c | 4 +- src/pokemon_summary_screen.c | 4 +- src/sound.c | 76 +++++++++++------------ src/text.c | 4 +- sym_bss.txt | 14 ++++- 29 files changed, 149 insertions(+), 137 deletions(-) diff --git a/asm/battle_frontier_2.s b/asm/battle_frontier_2.s index 1909a7a02..23f870d4d 100755 --- a/asm/battle_frontier_2.s +++ b/asm/battle_frontier_2.s @@ -20736,7 +20736,7 @@ _081A54D4: bl HandleBattleWindow movs r0, 0 bl CopyBgTilemapBufferToVram - ldr r0, =gMPlay_BGM + ldr r0, =gMPlayInfo_BGM ldr r1, =0x0000ffff movs r2, 0x80 lsls r2, 1 diff --git a/asm/contest.s b/asm/contest.s index 7577826cf..3c34965ad 100644 --- a/asm/contest.s +++ b/asm/contest.s @@ -8891,7 +8891,7 @@ _080DC226: ble _080DC284 movs r0, 0x60 bl PlaySE - ldr r4, =gMPlay_SE1 + ldr r4, =gMPlayInfo_SE1 adds r0, r4, 0 bl m4aMPlayImmInit ldr r1, =0x0000ffff diff --git a/asm/link.s b/asm/link.s index a270c8f62..05dda2cb7 100644 --- a/asm/link.s +++ b/asm/link.s @@ -3342,11 +3342,11 @@ c2_800ACD4: @ 800AF30 movs r0, 0 movs r1, 0 bl SetGpuReg - ldr r0, =gMPlay_SE1 + ldr r0, =gMPlayInfo_SE1 bl m4aMPlayStop - ldr r0, =gMPlay_SE2 + ldr r0, =gMPlayInfo_SE2 bl m4aMPlayStop - ldr r0, =gMPlay_SE3 + ldr r0, =gMPlayInfo_SE3 bl m4aMPlayStop ldr r0, =0x02000000 movs r1, 0xE0 diff --git a/asm/mauville_old_man.s b/asm/mauville_old_man.s index 8c7037ca7..49a502d5c 100644 --- a/asm/mauville_old_man.s +++ b/asm/mauville_old_man.s @@ -965,7 +965,7 @@ _08120850: lsls r1, 1 adds r0, r1 strh r0, [r6, 0x6] - ldr r4, =gMPlay_SE2 + ldr r4, =gMPlayInfo_SE2 ldr r5, =0x0000ffff ldrh r2, [r6, 0x6] adds r0, r4, 0 @@ -1008,7 +1008,7 @@ _081208BC: subs r0, 0x40 _081208C0: strh r0, [r6, 0x8] - ldr r4, =gMPlay_SE2 + ldr r4, =gMPlayInfo_SE2 ldr r5, =0x0000ffff ldrh r2, [r6, 0x6] adds r0, r4, 0 @@ -1059,7 +1059,7 @@ _08120922: lsls r0, 24 cmp r0, 0 bne _08120938 - ldr r0, =gMPlay_SE2 + ldr r0, =gMPlayInfo_SE2 bl m4aMPlayStop movs r0, 0x4 _08120936: @@ -1228,7 +1228,7 @@ _08120A7E: bne _08120AB0 movs r0, 0x6 bl FadeInBGM - ldr r0, =gMPlay_SE2 + ldr r0, =gMPlayInfo_SE2 movs r1, 0x2 bl m4aMPlayFadeOutTemporarily bl EnableBothScriptContexts diff --git a/asm/pokedex.s b/asm/pokedex.s index 147f8921b..6ebeb0792 100644 --- a/asm/pokedex.s +++ b/asm/pokedex.s @@ -497,7 +497,7 @@ _080BB71C: adds r1, r2 ldrb r1, [r1] bl sub_80BC8D4 - ldr r0, =gMPlay_BGM + ldr r0, =gMPlayInfo_BGM ldr r1, =0x0000ffff movs r2, 0x80 bl m4aMPlayVolumeControl @@ -1246,7 +1246,7 @@ _080BBE18: bl DestroyTask ldr r0, =sub_8086194 bl SetMainCallback2 - ldr r0, =gMPlay_BGM + ldr r0, =gMPlayInfo_BGM ldr r1, =0x0000ffff movs r2, 0x80 lsls r2, 1 @@ -7228,7 +7228,7 @@ _080BF2A8: beq _080BF2B6 b _080BF5B2 _080BF2B6: - ldr r0, =gMPlay_BGM + ldr r0, =gMPlayInfo_BGM bl m4aMPlayStop ldr r5, =gUnknown_02039B4C ldr r0, [r5] @@ -7592,7 +7592,7 @@ _080BF636: movs r2, 0 movs r3, 0x10 bl BeginNormalPaletteFade - ldr r0, =gMPlay_BGM + ldr r0, =gMPlayInfo_BGM bl m4aMPlayContinue ldr r0, =gUnknown_02039B4C ldr r0, [r0] @@ -7634,7 +7634,7 @@ _080BF6B0: movs r2, 0 movs r3, 0x10 bl BeginNormalPaletteFade - ldr r0, =gMPlay_BGM + ldr r0, =gMPlayInfo_BGM bl m4aMPlayContinue ldr r0, =gUnknown_02039B4C ldr r0, [r0] @@ -7689,7 +7689,7 @@ _080BF73C: movs r2, 0 movs r3, 0x10 bl BeginNormalPaletteFade - ldr r0, =gMPlay_BGM + ldr r0, =gMPlayInfo_BGM bl m4aMPlayContinue ldr r0, =gUnknown_02039B4C ldr r0, [r0] diff --git a/asm/pokedex_cry_screen.s b/asm/pokedex_cry_screen.s index e8b8ad5e6..846b20881 100644 --- a/asm/pokedex_cry_screen.s +++ b/asm/pokedex_cry_screen.s @@ -239,7 +239,7 @@ sub_8145534: @ 8145534 lsls r0, 16 lsrs r4, r0, 16 adds r5, r4, 0 - ldr r0, =gMPlay_BGM + ldr r0, =gMPlayInfo_BGM ldr r0, [r0, 0x4] cmp r0, 0 bge _08145582 diff --git a/asm/roulette.s b/asm/roulette.s index bb1d5fed6..9d9e39feb 100644 --- a/asm/roulette.s +++ b/asm/roulette.s @@ -6841,14 +6841,14 @@ _08143BEA: lsls r0, 24 cmp r0, 0 beq _08143C74 - ldr r0, _08143C84 @ =gMPlay_SE1 + ldr r0, _08143C84 @ =gMPlayInfo_SE1 ldr r4, _08143C88 @ =0x0000FFFF ldrh r2, [r7, 0x24] lsls r2, 24 asrs r2, 24 adds r1, r4, 0 bl m4aMPlayPanpotControl - ldr r0, _08143C8C @ =gMPlay_SE2 + ldr r0, _08143C8C @ =gMPlayInfo_SE2 ldrh r2, [r7, 0x24] lsls r2, 24 asrs r2, 24 @@ -6864,11 +6864,11 @@ _08143C74: _08143C80: .4byte 0x00000000 _08143C84: - .4byte gMPlay_SE1 + .4byte gMPlayInfo_SE1 _08143C88: .4byte 0x0000FFFF _08143C8C: - .4byte gMPlay_SE2 + .4byte gMPlayInfo_SE2 thumb_func_end sub_8143B84 thumb_func_start sub_8143C90 @@ -9385,14 +9385,14 @@ sub_81450D8: @ 81450D8 adds r4, r0 asrs r4, 1 negs r4, r4 - ldr r0, =gMPlay_SE1 + ldr r0, =gMPlayInfo_SE1 ldr r5, =0x0000ffff lsls r4, 24 asrs r4, 24 adds r1, r5, 0 adds r2, r4, 0 bl m4aMPlayPanpotControl - ldr r0, =gMPlay_SE2 + ldr r0, =gMPlayInfo_SE2 adds r1, r5, 0 adds r2, r4, 0 bl m4aMPlayPanpotControl diff --git a/asm/title_screen.s b/asm/title_screen.s index bc9401fb6..b5286d049 100644 --- a/asm/title_screen.s +++ b/asm/title_screen.s @@ -1169,7 +1169,7 @@ _080AAE30: _080AAE72: ldrb r0, [r3, 0x8] bl title_screen_update_rayquaza_ring_palette - ldr r0, =gMPlay_BGM + ldr r0, =gMPlayInfo_BGM ldr r1, =0x0000ffff ldrh r0, [r0, 0x4] cmp r0, 0 diff --git a/common_syms/m4a_2.txt b/common_syms/m4a_2.txt index b9281c718..0d6b13a79 100644 --- a/common_syms/m4a_2.txt +++ b/common_syms/m4a_2.txt @@ -1,12 +1,12 @@ gSoundInfo gPokemonCrySongs gPokemonCryMusicPlayers -gMPlay_BGM +gMPlayInfo_BGM gMPlayJumpTable gCgbChans -gMPlay_SE1 -gMPlay_SE2 +gMPlayInfo_SE1 +gMPlayInfo_SE2 gPokemonCryTracks gPokemonCrySong gMPlayMemAccArea -gMPlay_SE3 +gMPlayInfo_SE3 diff --git a/sound/music_player_table.inc b/sound/music_player_table.inc index 7c9fd5397..de987c978 100644 --- a/sound/music_player_table.inc +++ b/sound/music_player_table.inc @@ -1,6 +1,6 @@ .align 2 gMPlayTable:: @ 86B49C0 - music_player gMPlay_BGM, 0x3001340, 10, 0 - music_player gMPlay_SE1, 0x3001660, 3, 1 - music_player gMPlay_SE2, 0x3001750, 9, 1 - music_player gMPlay_SE3, 0x3001A20, 1, 0 + music_player gMPlayInfo_BGM, gMPlayTrack_BGM, 10, 0 + music_player gMPlayInfo_SE1, gMPlayTrack_SE1, 3, 1 + music_player gMPlayInfo_SE2, gMPlayTrack_SE2, 9, 1 + music_player gMPlayInfo_SE3, gMPlayTrack_SE3, 1, 0 diff --git a/src/battle_2.c b/src/battle_2.c index 6752c4d4f..61e39b39f 100644 --- a/src/battle_2.c +++ b/src/battle_2.c @@ -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 u8 gUnknown_02039B28[]; // possibly a struct? extern struct UnknownStruct6 gUnknown_02038C28; // todo: identify & document -extern struct MusicPlayerInfo gMPlay_SE1; -extern struct MusicPlayerInfo gMPlay_SE2; +extern struct MusicPlayerInfo gMPlayInfo_SE1; +extern struct MusicPlayerInfo gMPlayInfo_SE2; extern u8 gDecompressionBuffer[]; extern u16 gUnknown_020243FC; extern u8 gHealthBoxesIds[BATTLE_BANKS_COUNT]; @@ -1610,8 +1610,8 @@ void CB2_QuitRecordedBattle(void) UpdatePaletteFade(); if (!gPaletteFade.active) { - m4aMPlayStop(&gMPlay_SE1); - m4aMPlayStop(&gMPlay_SE2); + m4aMPlayStop(&gMPlayInfo_SE1); + m4aMPlayStop(&gMPlayInfo_SE2); FreeRestoreBattleData(); FreeAllWindowBuffers(); SetMainCallback2(gMain.savedCallback); diff --git a/src/battle_anim.c b/src/battle_anim.c index fa4dfb48f..d991a702d 100644 --- a/src/battle_anim.c +++ b/src/battle_anim.c @@ -37,9 +37,9 @@ extern u16 gBattle_BG2_X; extern u16 gBattle_BG2_Y; extern u16 gBattlePartyID[BATTLE_BANKS_COUNT]; extern u8 gBankSpriteIds[BATTLE_BANKS_COUNT]; -extern struct MusicPlayerInfo gMPlay_BGM; -extern struct MusicPlayerInfo gMPlay_SE1; -extern struct MusicPlayerInfo gMPlay_SE2; +extern struct MusicPlayerInfo gMPlayInfo_BGM; +extern struct MusicPlayerInfo gMPlayInfo_SE1; +extern struct MusicPlayerInfo gMPlayInfo_SE2; extern u8 gDecompressionBuffer[]; extern const u16 gUnknown_082C8D64[]; @@ -272,7 +272,7 @@ void LaunchBattleAnimation(const u8 *const animsTable[], u16 tableId, bool8 isMo { if (tableId == gUnknown_082C8D64[i]) { - m4aMPlayVolumeControl(&gMPlay_BGM, 0xFFFF, 128); + m4aMPlayVolumeControl(&gMPlayInfo_BGM, 0xFFFF, 128); break; } } @@ -514,8 +514,8 @@ static void ScriptCmd_end(void) } else { - m4aMPlayStop(&gMPlay_SE1); - m4aMPlayStop(&gMPlay_SE2); + m4aMPlayStop(&gMPlayInfo_SE1); + m4aMPlayStop(&gMPlayInfo_SE2); } } @@ -534,7 +534,7 @@ static void ScriptCmd_end(void) if (!continuousAnim) // may have been used for debug? { - m4aMPlayVolumeControl(&gMPlay_BGM, 0xFFFF, 256); + m4aMPlayVolumeControl(&gMPlayInfo_BGM, 0xFFFF, 256); if (!IsContest()) { sub_80A8278(); @@ -1650,8 +1650,8 @@ static void ScriptCmd_waitsound(void) { if (++sSoundAnimFramesToWait > 90) { - m4aMPlayStop(&gMPlay_SE1); - m4aMPlayStop(&gMPlay_SE2); + m4aMPlayStop(&gMPlayInfo_SE1); + m4aMPlayStop(&gMPlayInfo_SE2); sSoundAnimFramesToWait = 0; } else @@ -1833,7 +1833,7 @@ static void ScriptCmd_doublebattle_2E(void) static void ScriptCmd_stopsound(void) { - m4aMPlayStop(&gMPlay_SE1); - m4aMPlayStop(&gMPlay_SE2); + m4aMPlayStop(&gMPlayInfo_SE1); + m4aMPlayStop(&gMPlayInfo_SE2); sBattleAnimScriptPtr++; } diff --git a/src/battle_controller_link_opponent.c b/src/battle_controller_link_opponent.c index 58360b9a1..cb510bb5b 100644 --- a/src/battle_controller_link_opponent.c +++ b/src/battle_controller_link_opponent.c @@ -51,7 +51,7 @@ extern u8 gBankTarget; extern u8 gAbsentBankFlags; extern u8 gUnknown_020244B4[]; extern u32 gTransformedPersonalities[BATTLE_BANKS_COUNT]; -extern struct MusicPlayerInfo gMPlay_BGM; +extern struct MusicPlayerInfo gMPlayInfo_BGM; extern struct UnusedControllerStruct gUnknown_02022D0C; extern u16 gTrainerBattleOpponent_A; extern u16 gTrainerBattleOpponent_B; @@ -353,11 +353,11 @@ static void sub_8064734(void) if (gBattleTypeFlags & BATTLE_TYPE_MULTI && gBattleTypeFlags & BATTLE_TYPE_LINK) { if (GetBankIdentity(gActiveBank) == IDENTITY_OPPONENT_MON1) - m4aMPlayContinue(&gMPlay_BGM); + m4aMPlayContinue(&gMPlayInfo_BGM); } 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 || gSprites[gBankSpriteIds[gActiveBank]].callback == SpriteCallbackDummy_2) { - m4aMPlayVolumeControl(&gMPlay_BGM, 0xFFFF, 0x100); + m4aMPlayVolumeControl(&gMPlayInfo_BGM, 0xFFFF, 0x100); LinkOpponentBufferExecCompleted(); } } diff --git a/src/battle_controller_opponent.c b/src/battle_controller_opponent.c index 8aeab6a55..30414d53a 100644 --- a/src/battle_controller_opponent.c +++ b/src/battle_controller_opponent.c @@ -38,7 +38,7 @@ extern u8 gBankSpriteIds[BATTLE_BANKS_COUNT]; extern u8 gBattleBufferA[BATTLE_BANKS_COUNT][0x200]; extern u8 gBattleBufferB[BATTLE_BANKS_COUNT][0x200]; extern u8 gHealthBoxesIds[BATTLE_BANKS_COUNT]; -extern struct MusicPlayerInfo gMPlay_BGM; +extern struct MusicPlayerInfo gMPlayInfo_BGM; extern u8 gUnknown_03005D7C[BATTLE_BANKS_COUNT]; extern void (*gBattleBankFunc[BATTLE_BANKS_COUNT])(void); extern void *gUnknown_020244D8; @@ -350,10 +350,10 @@ static void sub_805F560(void) if (gBattleTypeFlags & BATTLE_TYPE_MULTI && gBattleTypeFlags & BATTLE_TYPE_LINK) { if (GetBankIdentity(gActiveBank) == 1) - m4aMPlayContinue(&gMPlay_BGM); + m4aMPlayContinue(&gMPlayInfo_BGM); } else - m4aMPlayVolumeControl(&gMPlay_BGM, 0xFFFF, 0x100); + m4aMPlayVolumeControl(&gMPlayInfo_BGM, 0xFFFF, 0x100); } gBattleSpritesDataPtr->healthBoxesData[gActiveBank].field_1_x20 = 1; sp = TRUE; @@ -485,7 +485,7 @@ static void sub_805FC80(void) { if (gSprites[gBankSpriteIds[gActiveBank]].callback == SpriteCallbackDummy || gSprites[gBankSpriteIds[gActiveBank]].callback == SpriteCallbackDummy_2) { - m4aMPlayVolumeControl(&gMPlay_BGM, 0xFFFF, 0x100); + m4aMPlayVolumeControl(&gMPlayInfo_BGM, 0xFFFF, 0x100); OpponentBufferExecCompleted(); } } diff --git a/src/battle_controller_player.c b/src/battle_controller_player.c index 6023552c3..a9d5b70eb 100644 --- a/src/battle_controller_player.c +++ b/src/battle_controller_player.c @@ -43,7 +43,7 @@ extern u8 gBattleBufferA[BATTLE_BANKS_COUNT][0x200]; extern u8 gBattleBufferB[BATTLE_BANKS_COUNT][0x200]; extern u8 gMultiUsePlayerCursor; extern struct BattlePokemon gBattleMons[BATTLE_BANKS_COUNT]; -extern struct MusicPlayerInfo gMPlay_BGM; +extern struct MusicPlayerInfo gMPlayInfo_BGM; extern u16 gPartnerTrainerId; extern struct SpriteTemplate gUnknown_0202499C; extern u8 gBattleMonForms[BATTLE_BANKS_COUNT]; @@ -1054,9 +1054,9 @@ static void sub_8058B40(void) if (!gBattleSpritesDataPtr->healthBoxesData[gActiveBank].field_1_x20) { if (gBattleTypeFlags & BATTLE_TYPE_MULTI && gBattleTypeFlags & BATTLE_TYPE_LINK) - m4aMPlayContinue(&gMPlay_BGM); + m4aMPlayContinue(&gMPlayInfo_BGM); else - m4aMPlayVolumeControl(&gMPlay_BGM, 0xFFFF, 0x100); + m4aMPlayVolumeControl(&gMPlayInfo_BGM, 0xFFFF, 0x100); } gBattleSpritesDataPtr->healthBoxesData[gActiveBank].field_1_x20 = 1; r9 = TRUE; @@ -1119,7 +1119,7 @@ static void sub_8058FC0(void) if (!gBattleSpritesDataPtr->healthBoxesData[gActiveBank].specialAnimActive && !IsCryPlayingOrClearCrySongs()) { - m4aMPlayVolumeControl(&gMPlay_BGM, 0xFFFF, 0x100); + m4aMPlayVolumeControl(&gMPlayInfo_BGM, 0xFFFF, 0x100); HandleLowHpMusicChange(&gPlayerParty[gBattlePartyID[gActiveBank]], gActiveBank); PlayerBufferExecCompleted(); } @@ -1148,7 +1148,7 @@ void c3_0802FDF4(u8 taskId) { if (!IsCryPlayingOrClearCrySongs()) { - m4aMPlayVolumeControl(&gMPlay_BGM, 0xFFFF, 0x100); + m4aMPlayVolumeControl(&gMPlayInfo_BGM, 0xFFFF, 0x100); DestroyTask(taskId); } } diff --git a/src/battle_controller_recorded_opponent.c b/src/battle_controller_recorded_opponent.c index 64dea0200..6e29fa951 100644 --- a/src/battle_controller_recorded_opponent.c +++ b/src/battle_controller_recorded_opponent.c @@ -52,7 +52,7 @@ extern u8 gBankTarget; extern u8 gAbsentBankFlags; extern u8 gUnknown_020244B4[]; extern u32 gTransformedPersonalities[BATTLE_BANKS_COUNT]; -extern struct MusicPlayerInfo gMPlay_BGM; +extern struct MusicPlayerInfo gMPlayInfo_BGM; extern struct UnusedControllerStruct gUnknown_02022D0C; extern u16 gTrainerBattleOpponent_A; extern u16 gTrainerBattleOpponent_B; @@ -331,11 +331,11 @@ static void sub_818686C(void) if (gBattleTypeFlags & BATTLE_TYPE_MULTI && gBattleTypeFlags & BATTLE_TYPE_LINK) { if (GetBankIdentity(gActiveBank) == IDENTITY_OPPONENT_MON1) - m4aMPlayContinue(&gMPlay_BGM); + m4aMPlayContinue(&gMPlayInfo_BGM); } else { - m4aMPlayVolumeControl(&gMPlay_BGM, 0xFFFF, 0x100); + m4aMPlayVolumeControl(&gMPlayInfo_BGM, 0xFFFF, 0x100); } } gBattleSpritesDataPtr->healthBoxesData[gActiveBank].field_1_x20 = 1; @@ -484,7 +484,7 @@ static void sub_8186F14(void) if (gSprites[gBankSpriteIds[gActiveBank]].callback == SpriteCallbackDummy || gSprites[gBankSpriteIds[gActiveBank]].callback == SpriteCallbackDummy_2) { - m4aMPlayVolumeControl(&gMPlay_BGM, 0xFFFF, 0x100); + m4aMPlayVolumeControl(&gMPlayInfo_BGM, 0xFFFF, 0x100); RecordedOpponentBufferExecCompleted(); } } diff --git a/src/battle_controller_recorded_player.c b/src/battle_controller_recorded_player.c index 52fd803e1..f101d811f 100644 --- a/src/battle_controller_recorded_player.c +++ b/src/battle_controller_recorded_player.c @@ -54,7 +54,7 @@ extern u8 gUnknown_020244B4[]; extern u32 gTransformedPersonalities[BATTLE_BANKS_COUNT]; extern u8 gBattleCommunication[]; extern u8 gUnknown_0203C7B4; -extern struct MusicPlayerInfo gMPlay_BGM; +extern struct MusicPlayerInfo gMPlayInfo_BGM; extern struct UnusedControllerStruct gUnknown_02022D0C; extern const struct CompressedSpritePalette gTrainerFrontPicPaletteTable[]; @@ -354,11 +354,11 @@ static void sub_8189D40(void) if ((gBattleTypeFlags & BATTLE_TYPE_LINK) && (gBattleTypeFlags & BATTLE_TYPE_MULTI)) { if (GetBankIdentity(gActiveBank) == IDENTITY_PLAYER_MON1) - m4aMPlayContinue(&gMPlay_BGM); + m4aMPlayContinue(&gMPlayInfo_BGM); } else { - m4aMPlayVolumeControl(&gMPlay_BGM, 0xFFFF, 0x100); + m4aMPlayVolumeControl(&gMPlayInfo_BGM, 0xFFFF, 0x100); } } diff --git a/src/battle_controller_wally.c b/src/battle_controller_wally.c index eeb0b596d..b0e1e1480 100644 --- a/src/battle_controller_wally.c +++ b/src/battle_controller_wally.c @@ -42,7 +42,7 @@ extern u8 gBattleBufferA[BATTLE_BANKS_COUNT][0x200]; extern u8 gBattleBufferB[BATTLE_BANKS_COUNT][0x200]; extern u8 gMultiUsePlayerCursor; extern struct BattlePokemon gBattleMons[BATTLE_BANKS_COUNT]; -extern struct MusicPlayerInfo gMPlay_BGM; +extern struct MusicPlayerInfo gMPlayInfo_BGM; extern u16 gPartnerTrainerId; extern struct SpriteTemplate gUnknown_0202499C; extern u8 gBattleMonForms[BATTLE_BANKS_COUNT]; diff --git a/src/battle_gfx_sfx_util.c b/src/battle_gfx_sfx_util.c index 4f444b8bf..775578ca2 100644 --- a/src/battle_gfx_sfx_util.c +++ b/src/battle_gfx_sfx_util.c @@ -34,9 +34,9 @@ extern u8 gBankSpriteIds[BATTLE_BANKS_COUNT]; extern u8 gHealthBoxesIds[BATTLE_BANKS_COUNT]; extern u8 gBattleMonForms[BATTLE_BANKS_COUNT]; extern u32 gTransformedPersonalities[BATTLE_BANKS_COUNT]; -extern struct MusicPlayerInfo gMPlay_SE1; -extern struct MusicPlayerInfo gMPlay_SE2; -extern struct MusicPlayerInfo gMPlay_BGM; +extern struct MusicPlayerInfo gMPlayInfo_SE1; +extern struct MusicPlayerInfo gMPlayInfo_SE2; +extern struct MusicPlayerInfo gMPlayInfo_BGM; extern const struct BattleMove gBattleMoves[]; extern const u8 gUnknown_0831C604[]; @@ -527,8 +527,8 @@ bool8 mplay_80342A4(u8 bank) if (gBattleSpritesDataPtr->healthBoxesData[gActiveBank].field_8 < 30) return TRUE; - m4aMPlayStop(&gMPlay_SE1); - m4aMPlayStop(&gMPlay_SE2); + m4aMPlayStop(&gMPlayInfo_SE1); + m4aMPlayStop(&gMPlayInfo_SE2); } if (zero == 0) { diff --git a/src/battle_script_commands.c b/src/battle_script_commands.c index 4ddf2472e..c7976fc2a 100644 --- a/src/battle_script_commands.c +++ b/src/battle_script_commands.c @@ -112,7 +112,7 @@ extern u16 gBattle_BG1_Y; extern u16 gBattle_BG2_X; extern u16 gBattle_BG2_Y; extern u16 gBattle_BG3_X; -extern struct MusicPlayerInfo gMPlay_BGM; +extern struct MusicPlayerInfo gMPlayInfo_BGM; struct TrainerMoney { @@ -7103,10 +7103,10 @@ static void atk76_various(void) } break; case 21: - m4aMPlayVolumeControl(&gMPlay_BGM, 0xFFFF, 0x55); + m4aMPlayVolumeControl(&gMPlayInfo_BGM, 0xFFFF, 0x55); break; case 22: - m4aMPlayVolumeControl(&gMPlay_BGM, 0xFFFF, 0x100); + m4aMPlayVolumeControl(&gMPlayInfo_BGM, 0xFFFF, 0x100); break; case 23: gBattleStruct->field_2A2 |= gBitTable[gActiveBank]; diff --git a/src/berry_blender.c b/src/berry_blender.c index 9aa80612c..51580b50b 100644 --- a/src/berry_blender.c +++ b/src/berry_blender.c @@ -127,8 +127,8 @@ struct BerryBlenderData struct BlenderGameBlock gameBlock; }; -extern struct MusicPlayerInfo gMPlay_SE2; -extern struct MusicPlayerInfo gMPlay_BGM; +extern struct MusicPlayerInfo gMPlayInfo_SE2; +extern struct MusicPlayerInfo gMPlayInfo_BGM; extern u16 gSpecialVar_ItemId; extern u8 gInGameOpponentsNo; extern u8 gUnknown_020322D5; @@ -801,7 +801,7 @@ static const struct WindowTemplate sBlenderRecordWindowTemplate = {0, 6, 4, 0x12 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) @@ -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 (sBerryBlenderData->field_4C > 1500) - m4aMPlayTempoControl(&gMPlay_BGM, ((sBerryBlenderData->field_4C - 750) / 20) + 256); + m4aMPlayTempoControl(&gMPlayInfo_BGM, ((sBerryBlenderData->field_4C - 750) / 20) + 256); else - m4aMPlayTempoControl(&gMPlay_BGM, 0x100); + m4aMPlayTempoControl(&gMPlayInfo_BGM, 0x100); } } } @@ -2335,7 +2335,7 @@ static void CB2_HandleBlenderEndGame(void) switch (sBerryBlenderData->gameEndState) { case 1: - m4aMPlayTempoControl(&gMPlay_BGM, 256); + m4aMPlayTempoControl(&gMPlayInfo_BGM, 256); for (i = 0; i < gSpecialVar_0x8004; i++) { DestroyTask(sBerryBlenderData->field_120[i]); @@ -2355,7 +2355,7 @@ static void CB2_HandleBlenderEndGame(void) sBerryBlenderData->gameEndState = 5; sBerryBlenderData->mainState = 0; - m4aMPlayStop(&gMPlay_SE2); + m4aMPlayStop(&gMPlayInfo_SE2); } Blender_ControlHitPitch(); break; diff --git a/src/hall_of_fame.c b/src/hall_of_fame.c index 414959882..4465f65a3 100644 --- a/src/hall_of_fame.c +++ b/src/hall_of_fame.c @@ -54,7 +54,7 @@ static EWRAM_DATA struct HofGfx *sHofGfxPtr = NULL; extern bool8 gHasHallOfFameRecords; extern u32 gUnknown_0203BCD4; extern u8 gDecompressionBuffer[]; -extern struct MusicPlayerInfo gMPlay_BGM; +extern struct MusicPlayerInfo gMPlayInfo_BGM; extern MainCallback gGameContinueCallback; extern u32 gDamagedSaveSectors; extern u8 gReservedSpritePaletteCount; @@ -1040,7 +1040,7 @@ static void Task_HofPC_HandleInput(u8 taskId) if (IsCryPlayingOrClearCrySongs()) { StopCryAndClearCrySongs(); - m4aMPlayVolumeControl(&gMPlay_BGM, 0xFFFF, 0x100); + m4aMPlayVolumeControl(&gMPlayInfo_BGM, 0xFFFF, 0x100); } gTasks[taskId].func = Task_HofPC_HandlePaletteOnExit; } @@ -1050,7 +1050,7 @@ static void Task_HofPC_HandleInput(u8 taskId) if (IsCryPlayingOrClearCrySongs()) { StopCryAndClearCrySongs(); - m4aMPlayVolumeControl(&gMPlay_BGM, 0xFFFF, 0x100); + m4aMPlayVolumeControl(&gMPlayInfo_BGM, 0xFFFF, 0x100); } gTasks[taskId].func = Task_HofPC_HandlePaletteOnExit; } diff --git a/src/m4a_2.c b/src/m4a_2.c index 2d3c65848..0625f05d1 100644 --- a/src/m4a_2.c +++ b/src/m4a_2.c @@ -11,10 +11,10 @@ void *gMPlayJumpTable[36]; struct CgbChannel gCgbChans[4]; struct MusicPlayerTrack gPokemonCryTracks[MAX_POKEMON_CRIES * 2]; struct PokemonCrySong gPokemonCrySong; -struct MusicPlayerInfo gMPlay_BGM; -struct MusicPlayerInfo gMPlay_SE1; -struct MusicPlayerInfo gMPlay_SE2; -struct MusicPlayerInfo gMPlay_SE3; +struct MusicPlayerInfo gMPlayInfo_BGM; +struct MusicPlayerInfo gMPlayInfo_SE1; +struct MusicPlayerInfo gMPlayInfo_SE2; +struct MusicPlayerInfo gMPlayInfo_SE3; u8 gMPlayMemAccArea[0x10]; u32 MidiKeyToFreq(struct WaveData *wav, u8 key, u8 fineAdjust) diff --git a/src/pokeball.c b/src/pokeball.c index 13969a5d1..b48e55135 100644 --- a/src/pokeball.c +++ b/src/pokeball.c @@ -21,7 +21,7 @@ extern u8 gBankTarget; extern u16 gBattlePartyID[]; extern u8 gBankSpriteIds[]; extern u8 gHealthBoxesIds[]; -extern struct MusicPlayerInfo gMPlay_BGM; +extern struct MusicPlayerInfo gMPlayInfo_BGM; // this file's functions 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 (IsBGMPlaying()) - m4aMPlayStop(&gMPlay_BGM); + m4aMPlayStop(&gMPlayInfo_BGM); } else { - m4aMPlayVolumeControl(&gMPlay_BGM, 0xFFFF, 128); + m4aMPlayVolumeControl(&gMPlayInfo_BGM, 0xFFFF, 128); } } diff --git a/src/pokeblock_feed.c b/src/pokeblock_feed.c index 1bf40bbe5..b26da118c 100644 --- a/src/pokeblock_feed.c +++ b/src/pokeblock_feed.c @@ -50,7 +50,7 @@ struct PokeblockFeedStruct }; extern u16 gSpecialVar_ItemId; -extern struct MusicPlayerInfo gMPlay_BGM; +extern struct MusicPlayerInfo gMPlayInfo_BGM; extern struct SpriteTemplate gUnknown_0202499C; extern const u8 gBattleTerrainPalette_Frontier[]; @@ -802,7 +802,7 @@ static void Task_ReturnAfterPaletteFade(u8 taskId) { ResetSpriteData(); FreeAllSpritePalettes(); - m4aMPlayVolumeControl(&gMPlay_BGM, -1, 0x100); + m4aMPlayVolumeControl(&gMPlayInfo_BGM, -1, 0x100); SetMainCallback2(gMain.savedCallback); DestroyTask(taskId); FreeAllWindowBuffers(); diff --git a/src/pokemon_summary_screen.c b/src/pokemon_summary_screen.c index d659b2a02..e56448d8b 100755 --- a/src/pokemon_summary_screen.c +++ b/src/pokemon_summary_screen.c @@ -41,7 +41,7 @@ struct ContestEffect extern struct UnkSummaryStruct* gUnknown_0203CF1C; extern struct BgTemplate gUnknown_0861CBB4; extern u8 gUnknown_0203CF20; -extern struct MusicPlayerInfo gMPlay_BGM; +extern struct MusicPlayerInfo gMPlayInfo_BGM; extern s8 gUnknown_0861CC1C[]; extern u8 gUnknown_08329D22[]; extern u8 gUnknown_0203CF21; @@ -793,7 +793,7 @@ void sub_81C0484(u8 taskId) ResetSpriteData(); FreeAllSpritePalettes(); StopCryAndClearCrySongs(); - m4aMPlayVolumeControl(&gMPlay_BGM, 0xFFFF, 0x100); + m4aMPlayVolumeControl(&gMPlayInfo_BGM, 0xFFFF, 0x100); if (gMonSpritesGfxPtr == 0) sub_806F47C(0); sub_81C0434(); diff --git a/src/sound.c b/src/sound.c index 0cb11d5a5..ba3f659cc 100644 --- a/src/sound.c +++ b/src/sound.c @@ -29,10 +29,10 @@ IWRAM_DATA static u16 sFanfareCounter; bool8 gDisableMusic; extern u32 gBattleTypeFlags; -extern struct MusicPlayerInfo gMPlay_BGM; -extern struct MusicPlayerInfo gMPlay_SE1; -extern struct MusicPlayerInfo gMPlay_SE2; -extern struct MusicPlayerInfo gMPlay_SE3; +extern struct MusicPlayerInfo gMPlayInfo_BGM; +extern struct MusicPlayerInfo gMPlayInfo_SE1; +extern struct MusicPlayerInfo gMPlayInfo_SE2; +extern struct MusicPlayerInfo gMPlayInfo_SE3; extern struct ToneData gCryTable[]; extern struct ToneData gCryTable2[]; extern const struct Fanfare sFanfares[]; @@ -171,7 +171,7 @@ bool8 IsNotWaitingForBGMStop(void) void PlayFanfareByFanfareNum(u8 fanfareNum) { u16 songNum; - m4aMPlayStop(&gMPlay_BGM); + m4aMPlayStop(&gMPlayInfo_BGM); songNum = sFanfares[fanfareNum].songNum; sFanfareCounter = sFanfares[fanfareNum].duration; m4aSongNumStart(songNum); @@ -187,7 +187,7 @@ bool8 WaitFanfare(bool8 stop) else { if (!stop) - m4aMPlayContinue(&gMPlay_BGM); + m4aMPlayContinue(&gMPlayInfo_BGM); else m4aSongNumStart(MUS_DUMMY); @@ -232,7 +232,7 @@ static void Task_Fanfare(u8 taskId) } else { - m4aMPlayContinue(&gMPlay_BGM); + m4aMPlayContinue(&gMPlayInfo_BGM); DestroyTask(taskId); } } @@ -250,46 +250,46 @@ void FadeInNewBGM(u16 songNum, u8 speed) if (songNum == 0xFFFF) songNum = 0; m4aSongNumStart(songNum); - m4aMPlayImmInit(&gMPlay_BGM); - m4aMPlayVolumeControl(&gMPlay_BGM, 0xFFFF, 0); + m4aMPlayImmInit(&gMPlayInfo_BGM); + m4aMPlayVolumeControl(&gMPlayInfo_BGM, 0xFFFF, 0); m4aSongNumStop(songNum); - m4aMPlayFadeIn(&gMPlay_BGM, speed); + m4aMPlayFadeIn(&gMPlayInfo_BGM, speed); } void FadeOutBGMTemporarily(u8 speed) { - m4aMPlayFadeOutTemporarily(&gMPlay_BGM, speed); + m4aMPlayFadeOutTemporarily(&gMPlayInfo_BGM, speed); } bool8 IsBGMPausedOrStopped(void) { - if (gMPlay_BGM.status & MUSICPLAYER_STATUS_PAUSE) + if (gMPlayInfo_BGM.status & MUSICPLAYER_STATUS_PAUSE) return TRUE; - if (!(gMPlay_BGM.status & MUSICPLAYER_STATUS_TRACK)) + if (!(gMPlayInfo_BGM.status & MUSICPLAYER_STATUS_TRACK)) return TRUE; return FALSE; } void FadeInBGM(u8 speed) { - m4aMPlayFadeIn(&gMPlay_BGM, speed); + m4aMPlayFadeIn(&gMPlayInfo_BGM, speed); } void FadeOutBGM(u8 speed) { - m4aMPlayFadeOut(&gMPlay_BGM, speed); + m4aMPlayFadeOut(&gMPlayInfo_BGM, speed); } bool8 IsBGMStopped(void) { - if (!(gMPlay_BGM.status & MUSICPLAYER_STATUS_TRACK)) + if (!(gMPlayInfo_BGM.status & MUSICPLAYER_STATUS_TRACK)) return TRUE; return FALSE; } void PlayCry1(u16 species, s8 pan) { - m4aMPlayVolumeControl(&gMPlay_BGM, 0xFFFF, 85); + m4aMPlayVolumeControl(&gMPlayInfo_BGM, 0xFFFF, 85); PlayCryInternal(species, pan, CRY_VOLUME, 10, 0); gPokemonCryBGMDuckingCounter = 2; RestoreBGMVolumeAfterPokemonCry(); @@ -308,7 +308,7 @@ void PlayCry3(u16 species, s8 pan, u8 mode) } else { - m4aMPlayVolumeControl(&gMPlay_BGM, 0xFFFF, 85); + m4aMPlayVolumeControl(&gMPlayInfo_BGM, 0xFFFF, 85); PlayCryInternal(species, pan, CRY_VOLUME, 10, mode); gPokemonCryBGMDuckingCounter = 2; RestoreBGMVolumeAfterPokemonCry(); @@ -324,7 +324,7 @@ void PlayCry4(u16 species, s8 pan, u8 mode) else { if (!(gBattleTypeFlags & BATTLE_TYPE_MULTI)) - m4aMPlayVolumeControl(&gMPlay_BGM, 0xFFFF, 85); + m4aMPlayVolumeControl(&gMPlayInfo_BGM, 0xFFFF, 85); 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 { - m4aMPlayVolumeControl(&gMPlay_BGM, 0xFFFF, 85); + m4aMPlayVolumeControl(&gMPlayInfo_BGM, 0xFFFF, 85); PlayCryInternal(species, pan, CRY_VOLUME, 10, mode); 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) { - m4aMPlayVolumeControl(&gMPlay_BGM, 0xFFFF, 85); + m4aMPlayVolumeControl(&gMPlayInfo_BGM, 0xFFFF, 85); PlayCryInternal(species, 0, CRY_VOLUME, 10, mode); gPokemonCryBGMDuckingCounter = 2; RestoreBGMVolumeAfterPokemonCry(); @@ -529,7 +529,7 @@ static void Task_DuckBGMForPokemonCry(u8 taskId) if (!IsPokemonCryPlaying(gMPlay_PokemonCry)) { - m4aMPlayVolumeControl(&gMPlay_BGM, 0xFFFF, 256); + m4aMPlayVolumeControl(&gMPlayInfo_BGM, 0xFFFF, 256); DestroyTask(taskId); } } @@ -557,55 +557,55 @@ void PlaySE(u16 songNum) void PlaySE12WithPanning(u16 songNum, s8 pan) { m4aSongNumStart(songNum); - m4aMPlayImmInit(&gMPlay_SE1); - m4aMPlayImmInit(&gMPlay_SE2); - m4aMPlayPanpotControl(&gMPlay_SE1, 0xFFFF, pan); - m4aMPlayPanpotControl(&gMPlay_SE2, 0xFFFF, pan); + m4aMPlayImmInit(&gMPlayInfo_SE1); + m4aMPlayImmInit(&gMPlayInfo_SE2); + m4aMPlayPanpotControl(&gMPlayInfo_SE1, 0xFFFF, pan); + m4aMPlayPanpotControl(&gMPlayInfo_SE2, 0xFFFF, pan); } void PlaySE1WithPanning(u16 songNum, s8 pan) { m4aSongNumStart(songNum); - m4aMPlayImmInit(&gMPlay_SE1); - m4aMPlayPanpotControl(&gMPlay_SE1, 0xFFFF, pan); + m4aMPlayImmInit(&gMPlayInfo_SE1); + m4aMPlayPanpotControl(&gMPlayInfo_SE1, 0xFFFF, pan); } void PlaySE2WithPanning(u16 songNum, s8 pan) { m4aSongNumStart(songNum); - m4aMPlayImmInit(&gMPlay_SE2); - m4aMPlayPanpotControl(&gMPlay_SE2, 0xFFFF, pan); + m4aMPlayImmInit(&gMPlayInfo_SE2); + m4aMPlayPanpotControl(&gMPlayInfo_SE2, 0xFFFF, pan); } void SE12PanpotControl(s8 pan) { - m4aMPlayPanpotControl(&gMPlay_SE1, 0xFFFF, pan); - m4aMPlayPanpotControl(&gMPlay_SE2, 0xFFFF, pan); + m4aMPlayPanpotControl(&gMPlayInfo_SE1, 0xFFFF, pan); + m4aMPlayPanpotControl(&gMPlayInfo_SE2, 0xFFFF, pan); } 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; - 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 TRUE; } bool8 IsBGMPlaying(void) { - if (gMPlay_BGM.status & MUSICPLAYER_STATUS_PAUSE) + if (gMPlayInfo_BGM.status & MUSICPLAYER_STATUS_PAUSE) return FALSE; - if (!(gMPlay_BGM.status & MUSICPLAYER_STATUS_TRACK)) + if (!(gMPlayInfo_BGM.status & MUSICPLAYER_STATUS_TRACK)) return FALSE; return TRUE; } bool8 IsSpecialSEPlaying(void) { - if (gMPlay_SE3.status & MUSICPLAYER_STATUS_PAUSE) + if (gMPlayInfo_SE3.status & MUSICPLAYER_STATUS_PAUSE) return FALSE; - if (!(gMPlay_SE3.status & MUSICPLAYER_STATUS_TRACK)) + if (!(gMPlayInfo_SE3.status & MUSICPLAYER_STATUS_TRACK)) return FALSE; return TRUE; } diff --git a/src/text.c b/src/text.c index a13ed162d..5db3ba308 100644 --- a/src/text.c +++ b/src/text.c @@ -2418,12 +2418,12 @@ _08005ABA:\n\ strb r0, [r6, #0x9]\n\ b _08005A0A\n\ _08005ABE:\n\ - ldr r0, =gMPlay_BGM\n\ + ldr r0, =gMPlayInfo_BGM\n\ bl m4aMPlayStop\n\ b _08005A0A\n\ .pool\n\ _08005ACC:\n\ - ldr r0, =gMPlay_BGM\n\ + ldr r0, =gMPlayInfo_BGM\n\ bl m4aMPlayContinue\n\ b _08005A0A\n\ .pool\n\ diff --git a/sym_bss.txt b/sym_bss.txt index de452b2e7..645f82bbc 100644 --- a/sym_bss.txt +++ b/sym_bss.txt @@ -192,7 +192,19 @@ gUnknown_030012FC: @ 30012FC .space 0x4 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/siirtc.o"