Add TRACKS_ALL, remove BGCntrlBitfield
This commit is contained in:
-10
@@ -1,16 +1,6 @@
|
|||||||
#ifndef GUARD_BG_H
|
#ifndef GUARD_BG_H
|
||||||
#define GUARD_BG_H
|
#define GUARD_BG_H
|
||||||
|
|
||||||
struct BGCntrlBitfield // for the I/O registers
|
|
||||||
{
|
|
||||||
volatile u16 priority:2;
|
|
||||||
volatile u16 charBaseBlock:2;
|
|
||||||
volatile u16 field_0_2:4;
|
|
||||||
volatile u16 field_1_0:5;
|
|
||||||
volatile u16 areaOverflowMode:1;
|
|
||||||
volatile u16 screenSize:2;
|
|
||||||
};
|
|
||||||
|
|
||||||
enum
|
enum
|
||||||
{
|
{
|
||||||
BG_ATTR_CHARBASEINDEX = 1,
|
BG_ATTR_CHARBASEINDEX = 1,
|
||||||
|
|||||||
@@ -313,6 +313,8 @@ struct MusicPlayerTrack
|
|||||||
|
|
||||||
#define MAX_MUSICPLAYER_TRACKS 16
|
#define MAX_MUSICPLAYER_TRACKS 16
|
||||||
|
|
||||||
|
#define TRACKS_ALL 0xFFFF
|
||||||
|
|
||||||
#define TEMPORARY_FADE 0x0001
|
#define TEMPORARY_FADE 0x0001
|
||||||
#define FADE_IN 0x0002
|
#define FADE_IN 0x0002
|
||||||
#define FADE_VOL_MAX 64
|
#define FADE_VOL_MAX 64
|
||||||
|
|||||||
+1
-1
@@ -35,7 +35,7 @@ struct BgCnt
|
|||||||
{
|
{
|
||||||
u16 priority:2;
|
u16 priority:2;
|
||||||
u16 charBaseBlock:2;
|
u16 charBaseBlock:2;
|
||||||
u16 dummy:2;
|
u16 dsCharBaseBlock:2;
|
||||||
u16 mosaic:1;
|
u16 mosaic:1;
|
||||||
u16 palettes:1;
|
u16 palettes:1;
|
||||||
u16 screenBaseBlock:5;
|
u16 screenBaseBlock:5;
|
||||||
|
|||||||
+2
-2
@@ -1877,7 +1877,7 @@ void LaunchBattleAnimation(const u8 *const animsTable[], u16 tableId, bool8 isMo
|
|||||||
{
|
{
|
||||||
if (tableId == gMovesWithQuietBGM[i])
|
if (tableId == gMovesWithQuietBGM[i])
|
||||||
{
|
{
|
||||||
m4aMPlayVolumeControl(&gMPlayInfo_BGM, 0xFFFF, 128);
|
m4aMPlayVolumeControl(&gMPlayInfo_BGM, TRACKS_ALL, 128);
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -2143,7 +2143,7 @@ static void ScriptCmd_end(void)
|
|||||||
|
|
||||||
if (!continuousAnim) // May have been used for debug?
|
if (!continuousAnim) // May have been used for debug?
|
||||||
{
|
{
|
||||||
m4aMPlayVolumeControl(&gMPlayInfo_BGM, 0xFFFF, 256);
|
m4aMPlayVolumeControl(&gMPlayInfo_BGM, TRACKS_ALL, 256);
|
||||||
if (!IsContest())
|
if (!IsContest())
|
||||||
{
|
{
|
||||||
sub_80A8278();
|
sub_80A8278();
|
||||||
|
|||||||
+1
-1
@@ -614,7 +614,7 @@ u8 BattleArena_ShowJudgmentWindow(u8 *state)
|
|||||||
SetGpuReg(REG_OFFSET_WININ, WININ_WIN0_BG1 | WININ_WIN0_BG2 | WININ_WIN0_BG3 | WININ_WIN0_OBJ | WININ_WIN0_CLR | WININ_WIN1_BG_ALL | WININ_WIN1_OBJ | WININ_WIN1_CLR);
|
SetGpuReg(REG_OFFSET_WININ, WININ_WIN0_BG1 | WININ_WIN0_BG2 | WININ_WIN0_BG3 | WININ_WIN0_OBJ | WININ_WIN0_CLR | WININ_WIN1_BG_ALL | WININ_WIN1_OBJ | WININ_WIN1_CLR);
|
||||||
HandleBattleWindow(5, 0, 24, 13, WINDOW_CLEAR);
|
HandleBattleWindow(5, 0, 24, 13, WINDOW_CLEAR);
|
||||||
CopyBgTilemapBufferToVram(0);
|
CopyBgTilemapBufferToVram(0);
|
||||||
m4aMPlayVolumeControl(&gMPlayInfo_BGM, 0xFFFF, 256);
|
m4aMPlayVolumeControl(&gMPlayInfo_BGM, TRACKS_ALL, 256);
|
||||||
BeginNormalPaletteFade(0x7FFFFF1C, 4, 8, 0, RGB_BLACK);
|
BeginNormalPaletteFade(0x7FFFFF1C, 4, 8, 0, RGB_BLACK);
|
||||||
(*state)++;
|
(*state)++;
|
||||||
break;
|
break;
|
||||||
|
|||||||
@@ -323,7 +323,7 @@ static void Intro_TryShinyAnimShowHealthbox(void)
|
|||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
m4aMPlayVolumeControl(&gMPlayInfo_BGM, 0xFFFF, 0x100);
|
m4aMPlayVolumeControl(&gMPlayInfo_BGM, TRACKS_ALL, 0x100);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -465,7 +465,7 @@ static void SwitchIn_HandleSoundAndEnd(void)
|
|||||||
if (gSprites[gBattlerSpriteIds[gActiveBattler]].callback == SpriteCallbackDummy
|
if (gSprites[gBattlerSpriteIds[gActiveBattler]].callback == SpriteCallbackDummy
|
||||||
|| gSprites[gBattlerSpriteIds[gActiveBattler]].callback == SpriteCallbackDummy_2)
|
|| gSprites[gBattlerSpriteIds[gActiveBattler]].callback == SpriteCallbackDummy_2)
|
||||||
{
|
{
|
||||||
m4aMPlayVolumeControl(&gMPlayInfo_BGM, 0xFFFF, 0x100);
|
m4aMPlayVolumeControl(&gMPlayInfo_BGM, TRACKS_ALL, 0x100);
|
||||||
LinkOpponentBufferExecCompleted();
|
LinkOpponentBufferExecCompleted();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -334,7 +334,7 @@ static void Intro_TryShinyAnimShowHealthbox(void)
|
|||||||
m4aMPlayContinue(&gMPlayInfo_BGM);
|
m4aMPlayContinue(&gMPlayInfo_BGM);
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
m4aMPlayVolumeControl(&gMPlayInfo_BGM, 0xFFFF, 0x100);
|
m4aMPlayVolumeControl(&gMPlayInfo_BGM, TRACKS_ALL, 0x100);
|
||||||
}
|
}
|
||||||
gBattleSpritesDataPtr->healthBoxesData[gActiveBattler].bgmRestored = TRUE;
|
gBattleSpritesDataPtr->healthBoxesData[gActiveBattler].bgmRestored = TRUE;
|
||||||
bgmRestored = TRUE;
|
bgmRestored = TRUE;
|
||||||
@@ -470,7 +470,7 @@ static void SwitchIn_HandleSoundAndEnd(void)
|
|||||||
if (gSprites[gBattlerSpriteIds[gActiveBattler]].callback == SpriteCallbackDummy
|
if (gSprites[gBattlerSpriteIds[gActiveBattler]].callback == SpriteCallbackDummy
|
||||||
|| gSprites[gBattlerSpriteIds[gActiveBattler]].callback == SpriteCallbackDummy_2)
|
|| gSprites[gBattlerSpriteIds[gActiveBattler]].callback == SpriteCallbackDummy_2)
|
||||||
{
|
{
|
||||||
m4aMPlayVolumeControl(&gMPlayInfo_BGM, 0xFFFF, 0x100);
|
m4aMPlayVolumeControl(&gMPlayInfo_BGM, TRACKS_ALL, 0x100);
|
||||||
OpponentBufferExecCompleted();
|
OpponentBufferExecCompleted();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1024,7 +1024,7 @@ static void Intro_TryShinyAnimShowHealthbox(void)
|
|||||||
if (gBattleTypeFlags & BATTLE_TYPE_MULTI && gBattleTypeFlags & BATTLE_TYPE_LINK)
|
if (gBattleTypeFlags & BATTLE_TYPE_MULTI && gBattleTypeFlags & BATTLE_TYPE_LINK)
|
||||||
m4aMPlayContinue(&gMPlayInfo_BGM);
|
m4aMPlayContinue(&gMPlayInfo_BGM);
|
||||||
else
|
else
|
||||||
m4aMPlayVolumeControl(&gMPlayInfo_BGM, 0xFFFF, 0x100);
|
m4aMPlayVolumeControl(&gMPlayInfo_BGM, TRACKS_ALL, 0x100);
|
||||||
}
|
}
|
||||||
gBattleSpritesDataPtr->healthBoxesData[gActiveBattler].bgmRestored = TRUE;
|
gBattleSpritesDataPtr->healthBoxesData[gActiveBattler].bgmRestored = TRUE;
|
||||||
bgmRestored = TRUE;
|
bgmRestored = TRUE;
|
||||||
@@ -1092,7 +1092,7 @@ static void SwitchIn_HandleSoundAndEnd(void)
|
|||||||
if (!gBattleSpritesDataPtr->healthBoxesData[gActiveBattler].specialAnimActive
|
if (!gBattleSpritesDataPtr->healthBoxesData[gActiveBattler].specialAnimActive
|
||||||
&& !IsCryPlayingOrClearCrySongs())
|
&& !IsCryPlayingOrClearCrySongs())
|
||||||
{
|
{
|
||||||
m4aMPlayVolumeControl(&gMPlayInfo_BGM, 0xFFFF, 0x100);
|
m4aMPlayVolumeControl(&gMPlayInfo_BGM, TRACKS_ALL, 0x100);
|
||||||
HandleLowHpMusicChange(&gPlayerParty[gBattlerPartyIndexes[gActiveBattler]], gActiveBattler);
|
HandleLowHpMusicChange(&gPlayerParty[gBattlerPartyIndexes[gActiveBattler]], gActiveBattler);
|
||||||
PlayerBufferExecCompleted();
|
PlayerBufferExecCompleted();
|
||||||
}
|
}
|
||||||
@@ -1121,7 +1121,7 @@ void Task_PlayerController_RestoreBgmAfterCry(u8 taskId)
|
|||||||
{
|
{
|
||||||
if (!IsCryPlayingOrClearCrySongs())
|
if (!IsCryPlayingOrClearCrySongs())
|
||||||
{
|
{
|
||||||
m4aMPlayVolumeControl(&gMPlayInfo_BGM, 0xFFFF, 0x100);
|
m4aMPlayVolumeControl(&gMPlayInfo_BGM, TRACKS_ALL, 0x100);
|
||||||
DestroyTask(taskId);
|
DestroyTask(taskId);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -301,7 +301,7 @@ static void Intro_TryShinyAnimShowHealthbox(void)
|
|||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
m4aMPlayVolumeControl(&gMPlayInfo_BGM, 0xFFFF, 0x100);
|
m4aMPlayVolumeControl(&gMPlayInfo_BGM, TRACKS_ALL, 0x100);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
gBattleSpritesDataPtr->healthBoxesData[gActiveBattler].bgmRestored = TRUE;
|
gBattleSpritesDataPtr->healthBoxesData[gActiveBattler].bgmRestored = TRUE;
|
||||||
@@ -450,7 +450,7 @@ static void SwitchIn_HandleSoundAndEnd(void)
|
|||||||
if (gSprites[gBattlerSpriteIds[gActiveBattler]].callback == SpriteCallbackDummy
|
if (gSprites[gBattlerSpriteIds[gActiveBattler]].callback == SpriteCallbackDummy
|
||||||
|| gSprites[gBattlerSpriteIds[gActiveBattler]].callback == SpriteCallbackDummy_2)
|
|| gSprites[gBattlerSpriteIds[gActiveBattler]].callback == SpriteCallbackDummy_2)
|
||||||
{
|
{
|
||||||
m4aMPlayVolumeControl(&gMPlayInfo_BGM, 0xFFFF, 0x100);
|
m4aMPlayVolumeControl(&gMPlayInfo_BGM, TRACKS_ALL, 0x100);
|
||||||
RecordedOpponentBufferExecCompleted();
|
RecordedOpponentBufferExecCompleted();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -318,7 +318,7 @@ static void Intro_TryShinyAnimShowHealthbox(void)
|
|||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
m4aMPlayVolumeControl(&gMPlayInfo_BGM, 0xFFFF, 0x100);
|
m4aMPlayVolumeControl(&gMPlayInfo_BGM, TRACKS_ALL, 0x100);
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -6412,10 +6412,10 @@ static void Cmd_various(void)
|
|||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
case VARIOUS_VOLUME_DOWN:
|
case VARIOUS_VOLUME_DOWN:
|
||||||
m4aMPlayVolumeControl(&gMPlayInfo_BGM, 0xFFFF, 0x55);
|
m4aMPlayVolumeControl(&gMPlayInfo_BGM, TRACKS_ALL, 0x55);
|
||||||
break;
|
break;
|
||||||
case VARIOUS_VOLUME_UP:
|
case VARIOUS_VOLUME_UP:
|
||||||
m4aMPlayVolumeControl(&gMPlayInfo_BGM, 0xFFFF, 0x100);
|
m4aMPlayVolumeControl(&gMPlayInfo_BGM, TRACKS_ALL, 0x100);
|
||||||
break;
|
break;
|
||||||
case VARIOUS_SET_ALREADY_STATUS_MOVE_ATTEMPT:
|
case VARIOUS_SET_ALREADY_STATUS_MOVE_ATTEMPT:
|
||||||
gBattleStruct->alreadyStatusedMoveAttempt |= gBitTable[gActiveBattler];
|
gBattleStruct->alreadyStatusedMoveAttempt |= gBitTable[gActiveBattler];
|
||||||
|
|||||||
+1
-1
@@ -932,7 +932,7 @@ static const struct WindowTemplate sBlenderRecordWindowTemplate =
|
|||||||
|
|
||||||
static void UpdateHitPitch(void)
|
static void UpdateHitPitch(void)
|
||||||
{
|
{
|
||||||
m4aMPlayPitchControl(&gMPlayInfo_SE2, 0xFFFF, 2 * (sBerryBlender->speed - MIN_ARROW_SPEED));
|
m4aMPlayPitchControl(&gMPlayInfo_SE2, TRACKS_ALL, 2 * (sBerryBlender->speed - MIN_ARROW_SPEED));
|
||||||
}
|
}
|
||||||
|
|
||||||
static void VBlankCB_BerryBlender(void)
|
static void VBlankCB_BerryBlender(void)
|
||||||
|
|||||||
+1
-1
@@ -3820,7 +3820,7 @@ static void Task_UpdateAppealHearts(u8 taskId)
|
|||||||
{
|
{
|
||||||
PlaySE(SE_CONTEST_HEART);
|
PlaySE(SE_CONTEST_HEART);
|
||||||
m4aMPlayImmInit(&gMPlayInfo_SE1);
|
m4aMPlayImmInit(&gMPlayInfo_SE1);
|
||||||
m4aMPlayPitchControl(&gMPlayInfo_SE1, 0xFFFF, pitchMod * 256);
|
m4aMPlayPitchControl(&gMPlayInfo_SE1, TRACKS_ALL, pitchMod * 256);
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
|
|||||||
+2
-2
@@ -1019,7 +1019,7 @@ static void Task_HofPC_HandleInput(u8 taskId)
|
|||||||
if (IsCryPlayingOrClearCrySongs())
|
if (IsCryPlayingOrClearCrySongs())
|
||||||
{
|
{
|
||||||
StopCryAndClearCrySongs();
|
StopCryAndClearCrySongs();
|
||||||
m4aMPlayVolumeControl(&gMPlayInfo_BGM, 0xFFFF, 0x100);
|
m4aMPlayVolumeControl(&gMPlayInfo_BGM, TRACKS_ALL, 0x100);
|
||||||
}
|
}
|
||||||
gTasks[taskId].func = Task_HofPC_HandlePaletteOnExit;
|
gTasks[taskId].func = Task_HofPC_HandlePaletteOnExit;
|
||||||
}
|
}
|
||||||
@@ -1029,7 +1029,7 @@ static void Task_HofPC_HandleInput(u8 taskId)
|
|||||||
if (IsCryPlayingOrClearCrySongs())
|
if (IsCryPlayingOrClearCrySongs())
|
||||||
{
|
{
|
||||||
StopCryAndClearCrySongs();
|
StopCryAndClearCrySongs();
|
||||||
m4aMPlayVolumeControl(&gMPlayInfo_BGM, 0xFFFF, 0x100);
|
m4aMPlayVolumeControl(&gMPlayInfo_BGM, TRACKS_ALL, 0x100);
|
||||||
}
|
}
|
||||||
gTasks[taskId].func = Task_HofPC_HandlePaletteOnExit;
|
gTasks[taskId].func = Task_HofPC_HandlePaletteOnExit;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -502,9 +502,9 @@ static void BardSing(struct Task *task, struct BardSong *song)
|
|||||||
if (sound->var00 <= 50)
|
if (sound->var00 <= 50)
|
||||||
{
|
{
|
||||||
song->volume = 0x100 + sound->volume * 16;
|
song->volume = 0x100 + sound->volume * 16;
|
||||||
m4aMPlayVolumeControl(&gMPlayInfo_SE2, 0xFFFF, song->volume);
|
m4aMPlayVolumeControl(&gMPlayInfo_SE2, TRACKS_ALL, song->volume);
|
||||||
song->pitch = 0x200 + song->phonemes[song->currPhoneme].pitch;
|
song->pitch = 0x200 + song->phonemes[song->currPhoneme].pitch;
|
||||||
m4aMPlayPitchControl(&gMPlayInfo_SE2, 0xFFFF, song->pitch);
|
m4aMPlayPitchControl(&gMPlayInfo_SE2, TRACKS_ALL, song->pitch);
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
case 1:
|
case 1:
|
||||||
@@ -514,8 +514,8 @@ static void BardSing(struct Task *task, struct BardSong *song)
|
|||||||
song->pitch += 64;
|
song->pitch += 64;
|
||||||
else
|
else
|
||||||
song->pitch -= 64;
|
song->pitch -= 64;
|
||||||
m4aMPlayVolumeControl(&gMPlayInfo_SE2, 0xFFFF, song->volume);
|
m4aMPlayVolumeControl(&gMPlayInfo_SE2, TRACKS_ALL, song->volume);
|
||||||
m4aMPlayPitchControl(&gMPlayInfo_SE2, 0xFFFF, song->pitch);
|
m4aMPlayPitchControl(&gMPlayInfo_SE2, TRACKS_ALL, song->pitch);
|
||||||
song->voiceInflection++;
|
song->voiceInflection++;
|
||||||
song->phonemeTimer--;
|
song->phonemeTimer--;
|
||||||
if (song->phonemeTimer == 0)
|
if (song->phonemeTimer == 0)
|
||||||
|
|||||||
+1
-1
@@ -774,7 +774,7 @@ static void SpriteCB_ReleaseMonFromBall(struct Sprite *sprite)
|
|||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
m4aMPlayVolumeControl(&gMPlayInfo_BGM, 0xFFFF, 128);
|
m4aMPlayVolumeControl(&gMPlayInfo_BGM, TRACKS_ALL, 128);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -886,7 +886,7 @@ static void Task_ExitPokeblockFeed(u8 taskId)
|
|||||||
{
|
{
|
||||||
ResetSpriteData();
|
ResetSpriteData();
|
||||||
FreeAllSpritePalettes();
|
FreeAllSpritePalettes();
|
||||||
m4aMPlayVolumeControl(&gMPlayInfo_BGM, -1, 0x100);
|
m4aMPlayVolumeControl(&gMPlayInfo_BGM, TRACKS_ALL, 0x100);
|
||||||
SetMainCallback2(gMain.savedCallback);
|
SetMainCallback2(gMain.savedCallback);
|
||||||
DestroyTask(taskId);
|
DestroyTask(taskId);
|
||||||
FreeAllWindowBuffers();
|
FreeAllWindowBuffers();
|
||||||
|
|||||||
+2
-2
@@ -1637,7 +1637,7 @@ void CB2_OpenPokedex(void)
|
|||||||
SetVBlankCallback(VBlankCB_Pokedex);
|
SetVBlankCallback(VBlankCB_Pokedex);
|
||||||
SetMainCallback2(CB2_Pokedex);
|
SetMainCallback2(CB2_Pokedex);
|
||||||
CreatePokedexList(sPokedexView->dexMode, sPokedexView->dexOrder);
|
CreatePokedexList(sPokedexView->dexMode, sPokedexView->dexOrder);
|
||||||
m4aMPlayVolumeControl(&gMPlayInfo_BGM, 0xFFFF, 0x80);
|
m4aMPlayVolumeControl(&gMPlayInfo_BGM, TRACKS_ALL, 0x80);
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -1847,7 +1847,7 @@ static void Task_ClosePokedex(u8 taskId)
|
|||||||
FreeWindowAndBgBuffers();
|
FreeWindowAndBgBuffers();
|
||||||
DestroyTask(taskId);
|
DestroyTask(taskId);
|
||||||
SetMainCallback2(CB2_ReturnToFieldWithOpenMenu);
|
SetMainCallback2(CB2_ReturnToFieldWithOpenMenu);
|
||||||
m4aMPlayVolumeControl(&gMPlayInfo_BGM, 0xFFFF, 0x100);
|
m4aMPlayVolumeControl(&gMPlayInfo_BGM, TRACKS_ALL, 0x100);
|
||||||
Free(sPokedexView);
|
Free(sPokedexView);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1498,7 +1498,7 @@ static void CloseSummaryScreen(u8 taskId)
|
|||||||
ResetSpriteData();
|
ResetSpriteData();
|
||||||
FreeAllSpritePalettes();
|
FreeAllSpritePalettes();
|
||||||
StopCryAndClearCrySongs();
|
StopCryAndClearCrySongs();
|
||||||
m4aMPlayVolumeControl(&gMPlayInfo_BGM, 0xFFFF, 0x100);
|
m4aMPlayVolumeControl(&gMPlayInfo_BGM, TRACKS_ALL, 0x100);
|
||||||
if (gMonSpritesGfxPtr == NULL)
|
if (gMonSpritesGfxPtr == NULL)
|
||||||
DestroyMonSpritesGfxManager(MON_SPR_GFX_MANAGER_A);
|
DestroyMonSpritesGfxManager(MON_SPR_GFX_MANAGER_A);
|
||||||
FreeSummaryScreen();
|
FreeSummaryScreen();
|
||||||
|
|||||||
@@ -21,7 +21,7 @@ static void CB2_ReshowBattleScreenAfterMenu(void);
|
|||||||
static bool8 LoadBattlerSpriteGfx(u8 battlerId);
|
static bool8 LoadBattlerSpriteGfx(u8 battlerId);
|
||||||
static void CreateBattlerSprite(u8 battlerId);
|
static void CreateBattlerSprite(u8 battlerId);
|
||||||
static void CreateHealthboxSprite(u8 battlerId);
|
static void CreateHealthboxSprite(u8 battlerId);
|
||||||
static void sub_80A95F4(void);
|
static void ClearBattleBgCntBaseBlocks(void);
|
||||||
|
|
||||||
void ReshowBattleScreenDummy(void)
|
void ReshowBattleScreenDummy(void)
|
||||||
{
|
{
|
||||||
@@ -158,7 +158,7 @@ static void CB2_ReshowBattleScreenAfterMenu(void)
|
|||||||
break;
|
break;
|
||||||
default:
|
default:
|
||||||
SetVBlankCallback(VBlankCB_Battle);
|
SetVBlankCallback(VBlankCB_Battle);
|
||||||
sub_80A95F4();
|
ClearBattleBgCntBaseBlocks();
|
||||||
BeginHardwarePaletteFade(0xFF, 0, 0x10, 0, 1);
|
BeginHardwarePaletteFade(0xFF, 0, 0x10, 0, 1);
|
||||||
gPaletteFade.bufferTransferDisabled = 0;
|
gPaletteFade.bufferTransferDisabled = 0;
|
||||||
SetMainCallback2(BattleMainCB2);
|
SetMainCallback2(BattleMainCB2);
|
||||||
@@ -169,14 +169,14 @@ static void CB2_ReshowBattleScreenAfterMenu(void)
|
|||||||
gBattleScripting.reshowMainState++;
|
gBattleScripting.reshowMainState++;
|
||||||
}
|
}
|
||||||
|
|
||||||
static void sub_80A95F4(void)
|
static void ClearBattleBgCntBaseBlocks(void)
|
||||||
{
|
{
|
||||||
struct BGCntrlBitfield *regBgcnt1, *regBgcnt2;
|
vBgCnt *regBgcnt1, *regBgcnt2;
|
||||||
|
|
||||||
regBgcnt1 = (struct BGCntrlBitfield *)(®_BG1CNT);
|
regBgcnt1 = (vBgCnt *)(®_BG1CNT);
|
||||||
regBgcnt1->charBaseBlock = 0;
|
regBgcnt1->charBaseBlock = 0;
|
||||||
|
|
||||||
regBgcnt2 = (struct BGCntrlBitfield *)(®_BG2CNT);
|
regBgcnt2 = (vBgCnt *)(®_BG2CNT);
|
||||||
regBgcnt2->charBaseBlock = 0;
|
regBgcnt2->charBaseBlock = 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
+4
-4
@@ -3999,8 +3999,8 @@ static void UpdateBallPos(struct Sprite *sprite)
|
|||||||
sprite->y2 = -cos * sprite->sBallDistToCenter >> 12;
|
sprite->y2 = -cos * sprite->sBallDistToCenter >> 12;
|
||||||
if (IsSEPlaying())
|
if (IsSEPlaying())
|
||||||
{
|
{
|
||||||
m4aMPlayPanpotControl(&gMPlayInfo_SE1, 0xFFFF, sprite->x2);
|
m4aMPlayPanpotControl(&gMPlayInfo_SE1, TRACKS_ALL, sprite->x2);
|
||||||
m4aMPlayPanpotControl(&gMPlayInfo_SE2, 0xFFFF, sprite->x2);
|
m4aMPlayPanpotControl(&gMPlayInfo_SE2, TRACKS_ALL, sprite->x2);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -4704,8 +4704,8 @@ static void SpriteCB_Taillow_FlyIn(struct Sprite *sprite)
|
|||||||
if (IsSEPlaying())
|
if (IsSEPlaying())
|
||||||
{
|
{
|
||||||
s8 pan = -((116 - sprite->x) / 2);
|
s8 pan = -((116 - sprite->x) / 2);
|
||||||
m4aMPlayPanpotControl(&gMPlayInfo_SE1, 0xFFFF, pan);
|
m4aMPlayPanpotControl(&gMPlayInfo_SE1, TRACKS_ALL, pan);
|
||||||
m4aMPlayPanpotControl(&gMPlayInfo_SE2, 0xFFFF, pan);
|
m4aMPlayPanpotControl(&gMPlayInfo_SE2, TRACKS_ALL, pan);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
|
|||||||
+13
-13
@@ -271,7 +271,7 @@ void FadeInNewBGM(u16 songNum, u8 speed)
|
|||||||
songNum = 0;
|
songNum = 0;
|
||||||
m4aSongNumStart(songNum);
|
m4aSongNumStart(songNum);
|
||||||
m4aMPlayImmInit(&gMPlayInfo_BGM);
|
m4aMPlayImmInit(&gMPlayInfo_BGM);
|
||||||
m4aMPlayVolumeControl(&gMPlayInfo_BGM, 0xFFFF, 0);
|
m4aMPlayVolumeControl(&gMPlayInfo_BGM, TRACKS_ALL, 0);
|
||||||
m4aSongNumStop(songNum);
|
m4aSongNumStop(songNum);
|
||||||
m4aMPlayFadeIn(&gMPlayInfo_BGM, speed);
|
m4aMPlayFadeIn(&gMPlayInfo_BGM, speed);
|
||||||
}
|
}
|
||||||
@@ -309,7 +309,7 @@ bool8 IsBGMStopped(void)
|
|||||||
|
|
||||||
void PlayCry1(u16 species, s8 pan)
|
void PlayCry1(u16 species, s8 pan)
|
||||||
{
|
{
|
||||||
m4aMPlayVolumeControl(&gMPlayInfo_BGM, 0xFFFF, 85);
|
m4aMPlayVolumeControl(&gMPlayInfo_BGM, TRACKS_ALL, 85);
|
||||||
PlayCryInternal(species, pan, CRY_VOLUME, 10, 0);
|
PlayCryInternal(species, pan, CRY_VOLUME, 10, 0);
|
||||||
gPokemonCryBGMDuckingCounter = 2;
|
gPokemonCryBGMDuckingCounter = 2;
|
||||||
RestoreBGMVolumeAfterPokemonCry();
|
RestoreBGMVolumeAfterPokemonCry();
|
||||||
@@ -328,7 +328,7 @@ void PlayCry3(u16 species, s8 pan, u8 mode)
|
|||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
m4aMPlayVolumeControl(&gMPlayInfo_BGM, 0xFFFF, 85);
|
m4aMPlayVolumeControl(&gMPlayInfo_BGM, TRACKS_ALL, 85);
|
||||||
PlayCryInternal(species, pan, CRY_VOLUME, 10, mode);
|
PlayCryInternal(species, pan, CRY_VOLUME, 10, mode);
|
||||||
gPokemonCryBGMDuckingCounter = 2;
|
gPokemonCryBGMDuckingCounter = 2;
|
||||||
RestoreBGMVolumeAfterPokemonCry();
|
RestoreBGMVolumeAfterPokemonCry();
|
||||||
@@ -344,7 +344,7 @@ void PlayCry4(u16 species, s8 pan, u8 mode)
|
|||||||
else
|
else
|
||||||
{
|
{
|
||||||
if (!(gBattleTypeFlags & BATTLE_TYPE_MULTI))
|
if (!(gBattleTypeFlags & BATTLE_TYPE_MULTI))
|
||||||
m4aMPlayVolumeControl(&gMPlayInfo_BGM, 0xFFFF, 85);
|
m4aMPlayVolumeControl(&gMPlayInfo_BGM, TRACKS_ALL, 85);
|
||||||
PlayCryInternal(species, pan, CRY_VOLUME, 10, mode);
|
PlayCryInternal(species, pan, CRY_VOLUME, 10, mode);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -357,7 +357,7 @@ void PlayCry6(u16 species, s8 pan, u8 mode) // not present in R/S
|
|||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
m4aMPlayVolumeControl(&gMPlayInfo_BGM, 0xFFFF, 85);
|
m4aMPlayVolumeControl(&gMPlayInfo_BGM, TRACKS_ALL, 85);
|
||||||
PlayCryInternal(species, pan, CRY_VOLUME, 10, mode);
|
PlayCryInternal(species, pan, CRY_VOLUME, 10, mode);
|
||||||
gPokemonCryBGMDuckingCounter = 2;
|
gPokemonCryBGMDuckingCounter = 2;
|
||||||
}
|
}
|
||||||
@@ -365,7 +365,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(&gMPlayInfo_BGM, 0xFFFF, 85);
|
m4aMPlayVolumeControl(&gMPlayInfo_BGM, TRACKS_ALL, 85);
|
||||||
PlayCryInternal(species, 0, CRY_VOLUME, 10, mode);
|
PlayCryInternal(species, 0, CRY_VOLUME, 10, mode);
|
||||||
gPokemonCryBGMDuckingCounter = 2;
|
gPokemonCryBGMDuckingCounter = 2;
|
||||||
RestoreBGMVolumeAfterPokemonCry();
|
RestoreBGMVolumeAfterPokemonCry();
|
||||||
@@ -549,7 +549,7 @@ static void Task_DuckBGMForPokemonCry(u8 taskId)
|
|||||||
|
|
||||||
if (!IsPokemonCryPlaying(gMPlay_PokemonCry))
|
if (!IsPokemonCryPlaying(gMPlay_PokemonCry))
|
||||||
{
|
{
|
||||||
m4aMPlayVolumeControl(&gMPlayInfo_BGM, 0xFFFF, 256);
|
m4aMPlayVolumeControl(&gMPlayInfo_BGM, TRACKS_ALL, 256);
|
||||||
DestroyTask(taskId);
|
DestroyTask(taskId);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -579,28 +579,28 @@ void PlaySE12WithPanning(u16 songNum, s8 pan)
|
|||||||
m4aSongNumStart(songNum);
|
m4aSongNumStart(songNum);
|
||||||
m4aMPlayImmInit(&gMPlayInfo_SE1);
|
m4aMPlayImmInit(&gMPlayInfo_SE1);
|
||||||
m4aMPlayImmInit(&gMPlayInfo_SE2);
|
m4aMPlayImmInit(&gMPlayInfo_SE2);
|
||||||
m4aMPlayPanpotControl(&gMPlayInfo_SE1, 0xFFFF, pan);
|
m4aMPlayPanpotControl(&gMPlayInfo_SE1, TRACKS_ALL, pan);
|
||||||
m4aMPlayPanpotControl(&gMPlayInfo_SE2, 0xFFFF, pan);
|
m4aMPlayPanpotControl(&gMPlayInfo_SE2, TRACKS_ALL, pan);
|
||||||
}
|
}
|
||||||
|
|
||||||
void PlaySE1WithPanning(u16 songNum, s8 pan)
|
void PlaySE1WithPanning(u16 songNum, s8 pan)
|
||||||
{
|
{
|
||||||
m4aSongNumStart(songNum);
|
m4aSongNumStart(songNum);
|
||||||
m4aMPlayImmInit(&gMPlayInfo_SE1);
|
m4aMPlayImmInit(&gMPlayInfo_SE1);
|
||||||
m4aMPlayPanpotControl(&gMPlayInfo_SE1, 0xFFFF, pan);
|
m4aMPlayPanpotControl(&gMPlayInfo_SE1, TRACKS_ALL, pan);
|
||||||
}
|
}
|
||||||
|
|
||||||
void PlaySE2WithPanning(u16 songNum, s8 pan)
|
void PlaySE2WithPanning(u16 songNum, s8 pan)
|
||||||
{
|
{
|
||||||
m4aSongNumStart(songNum);
|
m4aSongNumStart(songNum);
|
||||||
m4aMPlayImmInit(&gMPlayInfo_SE2);
|
m4aMPlayImmInit(&gMPlayInfo_SE2);
|
||||||
m4aMPlayPanpotControl(&gMPlayInfo_SE2, 0xFFFF, pan);
|
m4aMPlayPanpotControl(&gMPlayInfo_SE2, TRACKS_ALL, pan);
|
||||||
}
|
}
|
||||||
|
|
||||||
void SE12PanpotControl(s8 pan)
|
void SE12PanpotControl(s8 pan)
|
||||||
{
|
{
|
||||||
m4aMPlayPanpotControl(&gMPlayInfo_SE1, 0xFFFF, pan);
|
m4aMPlayPanpotControl(&gMPlayInfo_SE1, TRACKS_ALL, pan);
|
||||||
m4aMPlayPanpotControl(&gMPlayInfo_SE2, 0xFFFF, pan);
|
m4aMPlayPanpotControl(&gMPlayInfo_SE2, TRACKS_ALL, pan);
|
||||||
}
|
}
|
||||||
|
|
||||||
bool8 IsSEPlaying(void)
|
bool8 IsSEPlaying(void)
|
||||||
|
|||||||
Reference in New Issue
Block a user