Merge pull request #1166 from ketsuban/tidying

Tidy up naked functions
This commit is contained in:
PikalaxALT
2020-09-04 19:41:18 -04:00
committed by GitHub
8 changed files with 115 additions and 120 deletions
+38 -39
View File
@@ -49,7 +49,7 @@
// An 'Info Card' is a trainer or match information page that can be viewed on the Tourney Tree // An 'Info Card' is a trainer or match information page that can be viewed on the Tourney Tree
struct TourneyTreeInfoCard struct TourneyTreeInfoCard
{ {
u8 spriteIds[NUM_INFOCARD_SPRITES]; u8 spriteIds[NUM_INFOCARD_SPRITES];
u8 pos; u8 pos;
u8 tournamentIds[NUM_INFOCARD_TRAINERS]; u8 tournamentIds[NUM_INFOCARD_TRAINERS];
}; };
@@ -499,7 +499,7 @@ static const u8 sBattleStyleMovePoints[MOVES_COUNT][NUM_MOVE_POINT_TYPES] =
[MOVE_PSYCHO_BOOST] = {[MOVE_POINTS_DMG] = 1, [MOVE_POINTS_POWERFUL] = 1, [MOVE_POINTS_STRONG] = 1, [MOVE_POINTS_LOW_PP] = 1, [MOVE_POINTS_EFFECT] = 1}, [MOVE_PSYCHO_BOOST] = {[MOVE_POINTS_DMG] = 1, [MOVE_POINTS_POWERFUL] = 1, [MOVE_POINTS_STRONG] = 1, [MOVE_POINTS_LOW_PP] = 1, [MOVE_POINTS_EFFECT] = 1},
}; };
// This array is searched in-order to determine what battle style a tourney trainer uses. // This array is searched in-order to determine what battle style a tourney trainer uses.
// If the sum of the points for the party's moves meets/exceeds all the point totals of an element, then they use that battle style // If the sum of the points for the party's moves meets/exceeds all the point totals of an element, then they use that battle style
static const u8 sBattleStyleThresholds[NUM_BATTLE_STYLES - 1][NUM_MOVE_POINT_TYPES] = static const u8 sBattleStyleThresholds[NUM_BATTLE_STYLES - 1][NUM_MOVE_POINT_TYPES] =
{ {
@@ -1188,11 +1188,11 @@ static const u8 sIdToMatchNumber[DOME_TOURNAMENT_TRAINERS_COUNT][DOME_ROUNDS_COU
{ 7, 11, 13, 14}, { 7, 11, 13, 14},
}; };
static const u8 sLastMatchCardNum[DOME_ROUNDS_COUNT] = static const u8 sLastMatchCardNum[DOME_ROUNDS_COUNT] =
{ {
[DOME_ROUND1] = 23, [DOME_ROUND1] = 23,
[DOME_ROUND2] = 27, [DOME_ROUND2] = 27,
[DOME_SEMIFINAL] = 29, [DOME_SEMIFINAL] = 29,
[DOME_FINAL] = 30 [DOME_FINAL] = 30
}; };
@@ -1324,12 +1324,12 @@ static const u8 sSpeciesNameTextYCoords[] = {0, 4, 0};
// Offsets within sBattleDomeOpponentStatsTexts for stat combinations // Offsets within sBattleDomeOpponentStatsTexts for stat combinations
// SPDEF has no offset because by then all stat combinations have been reached, so it has no combination texts // SPDEF has no offset because by then all stat combinations have been reached, so it has no combination texts
static const u8 sStatTextOffsets[NUM_STATS - 1] = static const u8 sStatTextOffsets[NUM_STATS - 1] =
{ {
DOME_TEXT_HP, DOME_TEXT_HP,
DOME_TEXT_ATK, DOME_TEXT_ATK,
DOME_TEXT_DEF, DOME_TEXT_DEF,
DOME_TEXT_SPEED, DOME_TEXT_SPEED,
DOME_TEXT_SPATK DOME_TEXT_SPATK
}; };
@@ -1421,7 +1421,7 @@ static const u8 sTrainerNamePositions[DOME_TOURNAMENT_TRAINERS_COUNT][2] =
static const u8 sTourneyTreePokeballCoords[DOME_TOURNAMENT_TRAINERS_COUNT + DOME_TOURNAMENT_MATCHES_COUNT][2] = static const u8 sTourneyTreePokeballCoords[DOME_TOURNAMENT_TRAINERS_COUNT + DOME_TOURNAMENT_MATCHES_COUNT][2] =
{ {
{ 68, 33}, // Left side trainers { 68, 33}, // Left side trainers
{ 68, 49}, { 68, 49},
{ 68, 65}, { 68, 65},
{ 68, 81}, { 68, 81},
{ 68, 97}, { 68, 97},
@@ -1495,7 +1495,7 @@ static const u8 sTourneyTreePokeballCoords[DOME_TOURNAMENT_TRAINERS_COUNT + DOME
{.src = 0x6021, .y = 0x10, .x = 0x09}, \ {.src = 0x6021, .y = 0x10, .x = 0x09}, \
{.src = 0x6023, .y = 0x10, .x = 0x0a}, \ {.src = 0x6023, .y = 0x10, .x = 0x0a}, \
{.src = 0x6047, .y = 0x11, .x = 0x0a}, \ {.src = 0x6047, .y = 0x11, .x = 0x0a}, \
{.src = lastSrc, .y = 0x11, .x = 0x0b}, {.src = lastSrc, .y = 0x11, .x = 0x0b},
#define LINESECTION_ROUND1_TRAINER4(lastSrc) \ #define LINESECTION_ROUND1_TRAINER4(lastSrc) \
{.src = 0x602b, .y = 0x12, .x = 0x09}, \ {.src = 0x602b, .y = 0x12, .x = 0x09}, \
@@ -2395,7 +2395,7 @@ static void InitDomeTrainers(void)
rankingScores[i] += (monTypesCount * monLevel) / 20; rankingScores[i] += (monTypesCount * monLevel) / 20;
} }
// Seed tourney trainers according to their ranking // Seed tourney trainers according to their ranking
for (i = 0; i < DOME_TOURNAMENT_TRAINERS_COUNT - 1; i++) for (i = 0; i < DOME_TOURNAMENT_TRAINERS_COUNT - 1; i++)
{ {
for (j = i + 1; j < DOME_TOURNAMENT_TRAINERS_COUNT; j++) for (j = i + 1; j < DOME_TOURNAMENT_TRAINERS_COUNT; j++)
@@ -2676,7 +2676,7 @@ static int SelectOpponentMonsFromParty(int *partyMovePoints, bool8 allowRandom)
partyPositions[i] = i; partyPositions[i] = i;
// All party mons have equal move score totals, choose randomly // All party mons have equal move score totals, choose randomly
if (partyMovePoints[0] == partyMovePoints[1] if (partyMovePoints[0] == partyMovePoints[1]
&& partyMovePoints[0] == partyMovePoints[2]) && partyMovePoints[0] == partyMovePoints[2])
{ {
if (allowRandom) if (allowRandom)
@@ -2852,8 +2852,8 @@ static int GetTypeEffectivenessPoints(int move, int targetSpecies, int arg2)
NAKED NAKED
static int GetTypeEffectivenessPoints(int move, int species, int arg2) static int GetTypeEffectivenessPoints(int move, int species, int arg2)
{ {
asm_unified("\n\ asm_unified(
push {r4-r7,lr}\n\ "push {r4-r7,lr}\n\
mov r7, r10\n\ mov r7, r10\n\
mov r6, r9\n\ mov r6, r9\n\
mov r5, r8\n\ mov r5, r8\n\
@@ -3085,8 +3085,7 @@ _08190156:\n\
mov r10, r5\n\ mov r10, r5\n\
pop {r4-r7}\n\ pop {r4-r7}\n\
pop {r1}\n\ pop {r1}\n\
bx r1\n\ bx r1");
");
} }
#endif // NONMATCHING #endif // NONMATCHING
@@ -4538,7 +4537,7 @@ static void DisplayTrainerInfoOnCard(u8 flags, u8 trainerTourneyId)
if (flags & MOVE_CARD) if (flags & MOVE_CARD)
gSprites[sInfoCard->spriteIds[2 + i + arrId]].invisible = TRUE; gSprites[sInfoCard->spriteIds[2 + i + arrId]].invisible = TRUE;
} }
// Initialize the text printer // Initialize the text printer
textPrinter.fontId = 2; textPrinter.fontId = 2;
textPrinter.x = 0; textPrinter.x = 0;
@@ -4776,7 +4775,7 @@ static void DisplayTrainerInfoOnCard(u8 flags, u8 trainerTourneyId)
// If 2 good stats have been found already, choose which to use // If 2 good stats have been found already, choose which to use
if (i == 2) if (i == 2)
{ {
if (allocatedArray[6] < allocatedArray[k]) if (allocatedArray[6] < allocatedArray[k])
{ {
if (allocatedArray[7] < allocatedArray[k]) if (allocatedArray[7] < allocatedArray[k])
@@ -4893,7 +4892,7 @@ static int BufferDomeWinString(u8 matchNum, u8 *tournamentIds)
for (i = sCompetitorRangeByMatch[matchNum][0]; i < sCompetitorRangeByMatch[matchNum][0] + sCompetitorRangeByMatch[matchNum][1]; i++) for (i = sCompetitorRangeByMatch[matchNum][0]; i < sCompetitorRangeByMatch[matchNum][0] + sCompetitorRangeByMatch[matchNum][1]; i++)
{ {
tournamentId = sTourneyTreeTrainerIds2[i]; tournamentId = sTourneyTreeTrainerIds2[i];
if (DOME_TRAINERS[tournamentId].isEliminated if (DOME_TRAINERS[tournamentId].isEliminated
&& DOME_TRAINERS[tournamentId].eliminatedAt >= sCompetitorRangeByMatch[matchNum][2]) && DOME_TRAINERS[tournamentId].eliminatedAt >= sCompetitorRangeByMatch[matchNum][2])
{ {
@@ -5353,7 +5352,7 @@ static void ResolveDomeRoundWinners(void)
DOME_TRAINERS[TrainerIdToTournamentId(gTrainerBattleOpponent_A)].isEliminated = TRUE; DOME_TRAINERS[TrainerIdToTournamentId(gTrainerBattleOpponent_A)].isEliminated = TRUE;
DOME_TRAINERS[TrainerIdToTournamentId(gTrainerBattleOpponent_A)].eliminatedAt = gSaveBlock2Ptr->frontier.curChallengeBattleNum; DOME_TRAINERS[TrainerIdToTournamentId(gTrainerBattleOpponent_A)].eliminatedAt = gSaveBlock2Ptr->frontier.curChallengeBattleNum;
gSaveBlock2Ptr->frontier.domeWinningMoves[TrainerIdToTournamentId(gTrainerBattleOpponent_A)] = gBattleResults.lastUsedMovePlayer; gSaveBlock2Ptr->frontier.domeWinningMoves[TrainerIdToTournamentId(gTrainerBattleOpponent_A)] = gBattleResults.lastUsedMovePlayer;
// If the player's match was the final one, no NPC vs NPC matches to decide // If the player's match was the final one, no NPC vs NPC matches to decide
if (gSaveBlock2Ptr->frontier.curChallengeBattleNum < DOME_FINAL) if (gSaveBlock2Ptr->frontier.curChallengeBattleNum < DOME_FINAL)
DecideRoundWinners(gSaveBlock2Ptr->frontier.curChallengeBattleNum); DecideRoundWinners(gSaveBlock2Ptr->frontier.curChallengeBattleNum);
@@ -5363,7 +5362,7 @@ static void ResolveDomeRoundWinners(void)
DOME_TRAINERS[TrainerIdToTournamentId(TRAINER_PLAYER)].isEliminated = TRUE; DOME_TRAINERS[TrainerIdToTournamentId(TRAINER_PLAYER)].isEliminated = TRUE;
DOME_TRAINERS[TrainerIdToTournamentId(TRAINER_PLAYER)].eliminatedAt = gSaveBlock2Ptr->frontier.curChallengeBattleNum; DOME_TRAINERS[TrainerIdToTournamentId(TRAINER_PLAYER)].eliminatedAt = gSaveBlock2Ptr->frontier.curChallengeBattleNum;
gSaveBlock2Ptr->frontier.domeWinningMoves[TrainerIdToTournamentId(TRAINER_PLAYER)] = gBattleResults.lastUsedMoveOpponent; gSaveBlock2Ptr->frontier.domeWinningMoves[TrainerIdToTournamentId(TRAINER_PLAYER)] = gBattleResults.lastUsedMoveOpponent;
if (gBattleOutcome == B_OUTCOME_FORFEITED || gSpecialVar_0x8005 == DOME_PLAYER_RETIRED) if (gBattleOutcome == B_OUTCOME_FORFEITED || gSpecialVar_0x8005 == DOME_PLAYER_RETIRED)
DOME_TRAINERS[TrainerIdToTournamentId(TRAINER_PLAYER)].forfeited = TRUE; DOME_TRAINERS[TrainerIdToTournamentId(TRAINER_PLAYER)].forfeited = TRUE;
@@ -5401,7 +5400,7 @@ static u16 GetWinningMove(int winnerTournamentId, int loserTournamentId, u8 roun
movePower = 40; movePower = 40;
else if (movePower == 1) else if (movePower == 1)
movePower = 60; movePower = 60;
else if (moveIds[i * MAX_MON_MOVES + j] == MOVE_SELF_DESTRUCT else if (moveIds[i * MAX_MON_MOVES + j] == MOVE_SELF_DESTRUCT
|| moveIds[i * MAX_MON_MOVES + j] == MOVE_EXPLOSION) || moveIds[i * MAX_MON_MOVES + j] == MOVE_EXPLOSION)
movePower /= 2; movePower /= 2;
@@ -5558,7 +5557,7 @@ static void Task_ShowTourneyTree(u8 taskId)
{ {
for (i = 0; i < ARRAY_COUNT(sTourneyTreePokeballCoords); i++) for (i = 0; i < ARRAY_COUNT(sTourneyTreePokeballCoords); i++)
CreateSprite(&sTourneyTreePokeballSpriteTemplate, sTourneyTreePokeballCoords[i][0], sTourneyTreePokeballCoords[i][1], 0); CreateSprite(&sTourneyTreePokeballSpriteTemplate, sTourneyTreePokeballCoords[i][0], sTourneyTreePokeballCoords[i][1], 0);
if (gTasks[taskId].tIsPrevTourneyTree) if (gTasks[taskId].tIsPrevTourneyTree)
CreateSprite(&sExitButtonSpriteTemplate, 218, 12, 0); CreateSprite(&sExitButtonSpriteTemplate, 218, 12, 0);
else else
@@ -5698,7 +5697,7 @@ static void Task_ShowTourneyTree(u8 taskId)
gTasks[i].tState = 0; gTasks[i].tState = 0;
} }
ScanlineEffect_Clear(); ScanlineEffect_Clear();
i = 0; i = 0;
while (i < 91) while (i < 91)
{ {
@@ -5713,7 +5712,7 @@ static void Task_ShowTourneyTree(u8 taskId)
gScanlineEffectRegBuffers[1][i] = BGCNT_PRIORITY(1) | BGCNT_SCREENBASE(31) | BGCNT_16COLOR | BGCNT_CHARBASE(2) | BGCNT_TXT256x256; gScanlineEffectRegBuffers[1][i] = BGCNT_PRIORITY(1) | BGCNT_SCREENBASE(31) | BGCNT_16COLOR | BGCNT_CHARBASE(2) | BGCNT_TXT256x256;
i++; i++;
} }
ScanlineEffect_SetParams(sTourneyTreeScanlineEffectParams); ScanlineEffect_SetParams(sTourneyTreeScanlineEffectParams);
DestroyTask(taskId); DestroyTask(taskId);
break; break;
@@ -5851,67 +5850,67 @@ static void HblankCb_TourneyTree(void)
if (vCount < 42) if (vCount < 42)
{ {
REG_WININ = WININ_WIN0_BG_ALL | WININ_WIN0_CLR | WININ_WIN0_OBJ REG_WININ = WININ_WIN0_BG_ALL | WININ_WIN0_CLR | WININ_WIN0_OBJ
| WININ_WIN1_BG_ALL | WININ_WIN1_CLR | WININ_WIN1_OBJ; | WININ_WIN1_BG_ALL | WININ_WIN1_CLR | WININ_WIN1_OBJ;
SET_WIN0H_WIN1H(0, 0); SET_WIN0H_WIN1H(0, 0);
} }
else if (vCount < 50) else if (vCount < 50)
{ {
REG_WININ = WININ_WIN0_BG0 | WININ_WIN0_BG1 | WININ_WIN0_BG3 | WININ_WIN0_OBJ | WININ_WIN0_CLR REG_WININ = WININ_WIN0_BG0 | WININ_WIN0_BG1 | WININ_WIN0_BG3 | WININ_WIN0_OBJ | WININ_WIN0_CLR
| WININ_WIN1_BG0 | WININ_WIN1_BG1 | WININ_WIN1_BG3 | WININ_WIN1_OBJ | WININ_WIN1_CLR; | WININ_WIN1_BG0 | WININ_WIN1_BG1 | WININ_WIN1_BG3 | WININ_WIN1_OBJ | WININ_WIN1_CLR;
SET_WIN0H_WIN1H(WIN_RANGE(152, 155), WIN_RANGE(85, 88)); SET_WIN0H_WIN1H(WIN_RANGE(152, 155), WIN_RANGE(85, 88));
} }
else if (vCount < 58) else if (vCount < 58)
{ {
REG_WININ = WININ_WIN0_BG_ALL | WININ_WIN0_CLR | WININ_WIN0_OBJ REG_WININ = WININ_WIN0_BG_ALL | WININ_WIN0_CLR | WININ_WIN0_OBJ
| WININ_WIN1_BG_ALL | WININ_WIN1_CLR | WININ_WIN1_OBJ; | WININ_WIN1_BG_ALL | WININ_WIN1_CLR | WININ_WIN1_OBJ;
SET_WIN0H_WIN1H(0, 0); SET_WIN0H_WIN1H(0, 0);
} }
else if (vCount < 75) else if (vCount < 75)
{ {
REG_WININ = WININ_WIN0_BG0 | WININ_WIN0_BG1 | WININ_WIN0_BG3 | WININ_WIN0_OBJ | WININ_WIN0_CLR REG_WININ = WININ_WIN0_BG0 | WININ_WIN0_BG1 | WININ_WIN0_BG3 | WININ_WIN0_OBJ | WININ_WIN0_CLR
| WININ_WIN1_BG0 | WININ_WIN1_BG1 | WININ_WIN1_BG3 | WININ_WIN1_OBJ | WININ_WIN1_CLR; | WININ_WIN1_BG0 | WININ_WIN1_BG1 | WININ_WIN1_BG3 | WININ_WIN1_OBJ | WININ_WIN1_CLR;
SET_WIN0H_WIN1H(WIN_RANGE(144, 152), WIN_RANGE(88, 96)); SET_WIN0H_WIN1H(WIN_RANGE(144, 152), WIN_RANGE(88, 96));
} }
else if (vCount < 82) else if (vCount < 82)
{ {
REG_WININ = WININ_WIN0_BG0 | WININ_WIN0_BG1 | WININ_WIN0_BG3 | WININ_WIN0_OBJ | WININ_WIN0_CLR REG_WININ = WININ_WIN0_BG0 | WININ_WIN0_BG1 | WININ_WIN0_BG3 | WININ_WIN0_OBJ | WININ_WIN0_CLR
| WININ_WIN1_BG0 | WININ_WIN1_BG1 | WININ_WIN1_BG3 | WININ_WIN1_OBJ | WININ_WIN1_CLR; | WININ_WIN1_BG0 | WININ_WIN1_BG1 | WININ_WIN1_BG3 | WININ_WIN1_OBJ | WININ_WIN1_CLR;
SET_WIN0H_WIN1H(WIN_RANGE(152, 155), WIN_RANGE(85, 88)); SET_WIN0H_WIN1H(WIN_RANGE(152, 155), WIN_RANGE(85, 88));
} }
else if (vCount < 95) else if (vCount < 95)
{ {
REG_WININ = WININ_WIN0_BG_ALL | WININ_WIN0_CLR | WININ_WIN0_OBJ REG_WININ = WININ_WIN0_BG_ALL | WININ_WIN0_CLR | WININ_WIN0_OBJ
| WININ_WIN1_BG_ALL | WININ_WIN1_CLR | WININ_WIN1_OBJ; | WININ_WIN1_BG_ALL | WININ_WIN1_CLR | WININ_WIN1_OBJ;
SET_WIN0H_WIN1H(0, 0); SET_WIN0H_WIN1H(0, 0);
} }
else if (vCount < 103) else if (vCount < 103)
{ {
REG_WININ = WININ_WIN0_BG0 | WININ_WIN0_BG1 | WININ_WIN0_BG2 | WININ_WIN0_OBJ | WININ_WIN0_CLR REG_WININ = WININ_WIN0_BG0 | WININ_WIN0_BG1 | WININ_WIN0_BG2 | WININ_WIN0_OBJ | WININ_WIN0_CLR
| WININ_WIN1_BG0 | WININ_WIN1_BG1 | WININ_WIN1_BG2 | WININ_WIN1_OBJ | WININ_WIN1_CLR; | WININ_WIN1_BG0 | WININ_WIN1_BG1 | WININ_WIN1_BG2 | WININ_WIN1_OBJ | WININ_WIN1_CLR;
SET_WIN0H_WIN1H(WIN_RANGE(152, 155), WIN_RANGE(85, 88)); SET_WIN0H_WIN1H(WIN_RANGE(152, 155), WIN_RANGE(85, 88));
} }
else if (vCount < 119) else if (vCount < 119)
{ {
REG_WININ = WININ_WIN0_BG0 | WININ_WIN0_BG1 | WININ_WIN0_BG2 | WININ_WIN0_OBJ | WININ_WIN0_CLR REG_WININ = WININ_WIN0_BG0 | WININ_WIN0_BG1 | WININ_WIN0_BG2 | WININ_WIN0_OBJ | WININ_WIN0_CLR
| WININ_WIN1_BG0 | WININ_WIN1_BG1 | WININ_WIN1_BG2 | WININ_WIN1_OBJ | WININ_WIN1_CLR; | WININ_WIN1_BG0 | WININ_WIN1_BG1 | WININ_WIN1_BG2 | WININ_WIN1_OBJ | WININ_WIN1_CLR;
SET_WIN0H_WIN1H(WIN_RANGE(144, 152), WIN_RANGE(88, 96)); SET_WIN0H_WIN1H(WIN_RANGE(144, 152), WIN_RANGE(88, 96));
} }
else if (vCount < 127) else if (vCount < 127)
{ {
REG_WININ = WININ_WIN0_BG_ALL | WININ_WIN0_CLR | WININ_WIN0_OBJ REG_WININ = WININ_WIN0_BG_ALL | WININ_WIN0_CLR | WININ_WIN0_OBJ
| WININ_WIN1_BG_ALL | WININ_WIN1_CLR | WININ_WIN1_OBJ; | WININ_WIN1_BG_ALL | WININ_WIN1_CLR | WININ_WIN1_OBJ;
SET_WIN0H_WIN1H(0, 0); SET_WIN0H_WIN1H(0, 0);
} }
else if (vCount < 135) else if (vCount < 135)
{ {
REG_WININ = WININ_WIN0_BG0 | WININ_WIN0_BG1 | WININ_WIN0_BG2 | WININ_WIN0_OBJ | WININ_WIN0_CLR REG_WININ = WININ_WIN0_BG0 | WININ_WIN0_BG1 | WININ_WIN0_BG2 | WININ_WIN0_OBJ | WININ_WIN0_CLR
| WININ_WIN1_BG0 | WININ_WIN1_BG1 | WININ_WIN1_BG2 | WININ_WIN1_OBJ | WININ_WIN1_CLR; | WININ_WIN1_BG0 | WININ_WIN1_BG1 | WININ_WIN1_BG2 | WININ_WIN1_OBJ | WININ_WIN1_CLR;
SET_WIN0H_WIN1H(WIN_RANGE(152, 155), WIN_RANGE(85, 88)); SET_WIN0H_WIN1H(WIN_RANGE(152, 155), WIN_RANGE(85, 88));
} }
else else
{ {
REG_WININ = WININ_WIN0_BG_ALL | WININ_WIN0_CLR | WININ_WIN0_OBJ REG_WININ = WININ_WIN0_BG_ALL | WININ_WIN0_CLR | WININ_WIN0_OBJ
| WININ_WIN1_BG_ALL | WININ_WIN1_CLR | WININ_WIN1_OBJ; | WININ_WIN1_BG_ALL | WININ_WIN1_CLR | WININ_WIN1_OBJ;
SET_WIN0H_WIN1H(0, 0); SET_WIN0H_WIN1H(0, 0);
} }
+3 -4
View File
@@ -3649,8 +3649,8 @@ static void BattleIntroOpponent1SendsOutMonAnimation(void)
NAKED NAKED
static void BattleIntroOpponent1SendsOutMonAnimation(void) static void BattleIntroOpponent1SendsOutMonAnimation(void)
{ {
asm(".syntax unified\n\ asm_unified(
push {r4-r6,lr}\n\ "push {r4-r6,lr}\n\
ldr r0, =gBattleTypeFlags\n\ ldr r0, =gBattleTypeFlags\n\
ldr r2, [r0]\n\ ldr r2, [r0]\n\
movs r0, 0x80\n\ movs r0, 0x80\n\
@@ -3728,8 +3728,7 @@ _0803B2F2:\n\
pop {r4-r6}\n\ pop {r4-r6}\n\
pop {r0}\n\ pop {r0}\n\
bx r0\n\ bx r0\n\
.pool\n\ .pool");
.syntax divided");
} }
#endif // NONMATCHING #endif // NONMATCHING
+58 -58
View File
@@ -192,18 +192,18 @@ static const struct OamData sOamData_858D7F0 =
.affineParam = 0, .affineParam = 0,
}; };
static const struct SpriteTemplate sSpriteTemplate_858D7F8 = static const struct SpriteTemplate sSpriteTemplate_858D7F8 =
{ {
.tileTag = 3009, .tileTag = 3009,
.paletteTag = 3009, .paletteTag = 3009,
.oam = &sOamData_858D7F0, .oam = &sOamData_858D7F0,
.anims = gDummySpriteAnimTable, .anims = gDummySpriteAnimTable,
.images = NULL, .images = NULL,
.affineAnims = gDummySpriteAffineAnimTable, .affineAnims = gDummySpriteAffineAnimTable,
.callback = SpriteCallbackDummy .callback = SpriteCallbackDummy
}; };
static const struct SpriteSheet sUnknown_0858D810[] = static const struct SpriteSheet sUnknown_0858D810[] =
{ {
{ .data = gMiscBlank_Gfx, .size = 0x400, .tag = 3009 }, { .data = gMiscBlank_Gfx, .size = 0x400, .tag = 3009 },
{ .data = gMiscBlank_Gfx, .size = 0x400, .tag = 3010 }, { .data = gMiscBlank_Gfx, .size = 0x400, .tag = 3010 },
@@ -240,26 +240,26 @@ static const struct OamData sOamData_Confetti =
static const struct SpriteTemplate sSpriteTemplate_Confetti = static const struct SpriteTemplate sSpriteTemplate_Confetti =
{ {
.tileTag = TAG_CONFETTI, .tileTag = TAG_CONFETTI,
.paletteTag = TAG_CONFETTI, .paletteTag = TAG_CONFETTI,
.oam = &sOamData_Confetti, .oam = &sOamData_Confetti,
.anims = gDummySpriteAnimTable, .anims = gDummySpriteAnimTable,
.images = NULL, .images = NULL,
.affineAnims = gDummySpriteAffineAnimTable, .affineAnims = gDummySpriteAffineAnimTable,
.callback = SpriteCB_Confetti .callback = SpriteCB_Confetti
}; };
static const struct CompressedSpriteSheet sSpriteSheet_Confetti = static const struct CompressedSpriteSheet sSpriteSheet_Confetti =
{ {
.data = gConfetti_Gfx, .data = gConfetti_Gfx,
.size = 0x220, .size = 0x220,
.tag = TAG_CONFETTI .tag = TAG_CONFETTI
}; };
static const struct CompressedSpritePalette sSpritePalette_Confetti = static const struct CompressedSpritePalette sSpritePalette_Confetti =
{ {
.data = gConfetti_Pal, .data = gConfetti_Pal,
.tag = TAG_CONFETTI .tag = TAG_CONFETTI
}; };
@@ -282,7 +282,7 @@ static const struct BgTemplate sBgTemplates[] =
.paletteMode = 0, .paletteMode = 0,
.priority = 3, .priority = 3,
.baseTile = 0, .baseTile = 0,
}, },
{ {
.bg = 2, .bg = 2,
.charBaseIndex = 0, .charBaseIndex = 0,
@@ -291,7 +291,7 @@ static const struct BgTemplate sBgTemplates[] =
.paletteMode = 0, .paletteMode = 0,
.priority = 3, .priority = 3,
.baseTile = 0, .baseTile = 0,
}, },
{ {
.bg = 3, .bg = 3,
.charBaseIndex = 0, .charBaseIndex = 0,
@@ -306,39 +306,39 @@ static const struct BgTemplate sBgTemplates[] =
static const struct WindowTemplate sWindowTemplates[] = static const struct WindowTemplate sWindowTemplates[] =
{ {
{ {
.bg = 1, .bg = 1,
.tilemapLeft = 7, .tilemapLeft = 7,
.tilemapTop = 4, .tilemapTop = 4,
.width = 12, .width = 12,
.height = 2, .height = 2,
.paletteNum = 15, .paletteNum = 15,
.baseBlock = 770 .baseBlock = 770
}, },
{ {
.bg = 1, .bg = 1,
.tilemapLeft = 7, .tilemapLeft = 7,
.tilemapTop = 7, .tilemapTop = 7,
.width = 12, .width = 12,
.height = 2, .height = 2,
.paletteNum = 15, .paletteNum = 15,
.baseBlock = 794 .baseBlock = 794
}, },
{ {
.bg = 1, .bg = 1,
.tilemapLeft = 7, .tilemapLeft = 7,
.tilemapTop = 10, .tilemapTop = 10,
.width = 12, .width = 12,
.height = 2, .height = 2,
.paletteNum = 15, .paletteNum = 15,
.baseBlock = 818 .baseBlock = 818
}, },
{ {
.bg = 1, .bg = 1,
.tilemapLeft = 7, .tilemapLeft = 7,
.tilemapTop = 13, .tilemapTop = 13,
.width = 12, .width = 12,
.height = 2, .height = 2,
.paletteNum = 15, .paletteNum = 15,
.baseBlock = 842 .baseBlock = 842
}, },
DUMMY_WIN_TEMPLATE, DUMMY_WIN_TEMPLATE,
@@ -364,19 +364,19 @@ static const struct OamData sUnknown_0858D8C0 =
static const struct SpriteTemplate sSpriteTemplate_858D8C8 = static const struct SpriteTemplate sSpriteTemplate_858D8C8 =
{ {
.tileTag = 22222, .tileTag = 22222,
.paletteTag = 0, .paletteTag = 0,
.oam = &sUnknown_0858D8C0, .oam = &sUnknown_0858D8C0,
.anims = gDummySpriteAnimTable, .anims = gDummySpriteAnimTable,
.images = NULL, .images = NULL,
.affineAnims = gDummySpriteAffineAnimTable, .affineAnims = gDummySpriteAffineAnimTable,
.callback = SpriteCallbackDummy .callback = SpriteCallbackDummy
}; };
static const struct SpriteSheet sUnknown_0858D8E0 = static const struct SpriteSheet sUnknown_0858D8E0 =
{ {
.data = gMiscBlank_Gfx, .data = gMiscBlank_Gfx,
.size = 0x200, .size = 0x200,
.tag = 22222 .tag = 22222
}; };
@@ -1219,8 +1219,8 @@ static s32 DrawResultsTextWindow(const u8 *text, u8 spriteId)
NAKED NAKED
static s32 DrawResultsTextWindow(const u8 *text, u8 spriteId) static s32 DrawResultsTextWindow(const u8 *text, u8 spriteId)
{ {
asm_unified("\n\ asm_unified(
push {r4-r7,lr}\n\ "push {r4-r7,lr}\n\
mov r7, r10\n\ mov r7, r10\n\
mov r6, r9\n\ mov r6, r9\n\
mov r5, r8\n\ mov r5, r8\n\
@@ -2787,8 +2787,8 @@ bool8 GiveMonArtistRibbon(void)
u8 hasArtistRibbon; u8 hasArtistRibbon;
hasArtistRibbon = GetMonData(&gPlayerParty[gContestMonPartyIndex], MON_DATA_ARTIST_RIBBON); hasArtistRibbon = GetMonData(&gPlayerParty[gContestMonPartyIndex], MON_DATA_ARTIST_RIBBON);
if (!hasArtistRibbon if (!hasArtistRibbon
&& gContestFinalStandings[gContestPlayerMonIndex] == 0 && gContestFinalStandings[gContestPlayerMonIndex] == 0
&& gSpecialVar_ContestRank == CONTEST_RANK_MASTER && gSpecialVar_ContestRank == CONTEST_RANK_MASTER
&& gContestMonTotalPoints[gContestPlayerMonIndex] >= 800) && gContestMonTotalPoints[gContestPlayerMonIndex] >= 800)
{ {
@@ -2905,8 +2905,8 @@ static void Task_ShowContestEntryMonPic(u8 taskId)
void GetContestMultiplayerId(void) void GetContestMultiplayerId(void)
{ {
if ((gLinkContestFlags & LINK_CONTEST_FLAG_IS_LINK) if ((gLinkContestFlags & LINK_CONTEST_FLAG_IS_LINK)
&& gNumLinkContestPlayers == CONTESTANT_COUNT && gNumLinkContestPlayers == CONTESTANT_COUNT
&& !(gLinkContestFlags & LINK_CONTEST_FLAG_IS_WIRELESS)) && !(gLinkContestFlags & LINK_CONTEST_FLAG_IS_WIRELESS))
gSpecialVar_Result = GetMultiplayerId(); gSpecialVar_Result = GetMultiplayerId();
else else
+3 -4
View File
@@ -2539,8 +2539,8 @@ void CreateFrontierBrainPokemon(void)
NAKED NAKED
void CreateFrontierBrainPokemon(void) void CreateFrontierBrainPokemon(void)
{ {
asm_unified("\n\ asm_unified(
push {r4-r7,lr}\n\ "push {r4-r7,lr}\n\
mov r7, r10\n\ mov r7, r10\n\
mov r6, r9\n\ mov r6, r9\n\
mov r5, r8\n\ mov r5, r8\n\
@@ -2768,8 +2768,7 @@ _081A4FD0:\n\
pop {r4-r7}\n\ pop {r4-r7}\n\
pop {r0}\n\ pop {r0}\n\
bx r0\n\ bx r0\n\
.pool\n\ .pool");
");
} }
#endif #endif
+2 -1
View File
@@ -247,7 +247,8 @@ bool8 CheckBagHasSpace(u16 itemId, u16 count)
NAKED NAKED
bool8 CheckBagHasSpace(u16 itemId, u16 count) bool8 CheckBagHasSpace(u16 itemId, u16 count)
{ {
asm_unified("push {r4-r7,lr}\n\ asm_unified(
"push {r4-r7,lr}\n\
mov r7, r10\n\ mov r7, r10\n\
mov r6, r9\n\ mov r6, r9\n\
mov r5, r8\n\ mov r5, r8\n\
+3 -4
View File
@@ -762,8 +762,8 @@ static void sub_81BF2B8(u8* a, u16 b, u8 c, u8 d, u8 e)
NAKED NAKED
static void sub_81BF2B8(u8* a, u16 b, u8 c, u8 d, u8 e) static void sub_81BF2B8(u8* a, u16 b, u8 c, u8 d, u8 e)
{ {
asm_unified("\n\ asm_unified(
push {r4-r7,lr}\n\ "push {r4-r7,lr}\n\
mov r7, r10\n\ mov r7, r10\n\
mov r6, r9\n\ mov r6, r9\n\
mov r5, r8\n\ mov r5, r8\n\
@@ -861,7 +861,6 @@ static void sub_81BF2B8(u8* a, u16 b, u8 c, u8 d, u8 e)
pop {r4-r7}\n\ pop {r4-r7}\n\
pop {r0}\n\ pop {r0}\n\
bx r0\n\ bx r0\n\
.pool\n\ .pool");
");
} }
#endif // NONMATCHING #endif // NONMATCHING
+4 -5
View File
@@ -5258,11 +5258,11 @@ void SetSearchRectHighlight(u8 flags, u8 x, u8 y, u8 width)
} }
} }
#else #else
__attribute__((naked)) NAKED
void SetSearchRectHighlight(u8 flags, u8 x, u8 y, u8 width) void SetSearchRectHighlight(u8 flags, u8 x, u8 y, u8 width)
{ {
asm(".syntax unified\n\ asm_unified(
push {r4-r7,lr}\n\ "push {r4-r7,lr}\n\
mov r7, r8\n\ mov r7, r8\n\
push {r7}\n\ push {r7}\n\
adds r4, r3, 0\n\ adds r4, r3, 0\n\
@@ -5310,8 +5310,7 @@ _080C1DEC:\n\
pop {r4-r7}\n\ pop {r4-r7}\n\
pop {r0}\n\ pop {r0}\n\
bx r0\n\ bx r0\n\
.pool\n\ .pool");
.syntax divided\n");
} }
#endif #endif
+4 -5
View File
@@ -293,7 +293,7 @@ static const struct SpriteTemplate sUnknown_0861FB44 =
bool32 InitPokenavMainMenu(void) bool32 InitPokenavMainMenu(void)
{ {
struct PokenavMainMenuResources *structPtr; struct PokenavMainMenuResources *structPtr;
structPtr = AllocSubstruct(0, sizeof(struct PokenavMainMenuResources)); structPtr = AllocSubstruct(0, sizeof(struct PokenavMainMenuResources));
if (structPtr == NULL) if (structPtr == NULL)
return FALSE; return FALSE;
@@ -474,8 +474,8 @@ void sub_81C7990(u32 a0, u16 a1)
NAKED NAKED
void sub_81C79BC(const u16 *a0, const u16 *a1, u32 a2, u32 a3, u32 a4, u16 *a5) void sub_81C79BC(const u16 *a0, const u16 *a1, u32 a2, u32 a3, u32 a4, u16 *a5)
{ {
asm(".syntax unified\n\ asm_unified(
push {r4-r7,lr}\n\ "push {r4-r7,lr}\n\
mov r7, r10\n\ mov r7, r10\n\
mov r6, r9\n\ mov r6, r9\n\
mov r5, r8\n\ mov r5, r8\n\
@@ -603,8 +603,7 @@ _081C7AAE:\n\
mov r10, r5\n\ mov r10, r5\n\
pop {r4-r7}\n\ pop {r4-r7}\n\
pop {r0}\n\ pop {r0}\n\
bx r0\n\ bx r0");
.syntax divided");
} }
void PokenavFadeScreen(s32 fadeType) void PokenavFadeScreen(s32 fadeType)