From a529bcf0b696eaad60806a676397aac7ca9226d1 Mon Sep 17 00:00:00 2001 From: Thomas Winwood Date: Wed, 2 Sep 2020 14:49:04 +0100 Subject: [PATCH] Tidy up naked functions --- src/battle_dome.c | 77 +++++++++++++------------- src/battle_main.c | 7 ++- src/contest_util.c | 116 ++++++++++++++++++++-------------------- src/frontier_util.c | 7 ++- src/item.c | 3 +- src/mirage_tower.c | 7 ++- src/pokedex.c | 9 ++-- src/pokenav_main_menu.c | 9 ++-- 8 files changed, 115 insertions(+), 120 deletions(-) diff --git a/src/battle_dome.c b/src/battle_dome.c index 16798f46ca..452997ebd6 100644 --- a/src/battle_dome.c +++ b/src/battle_dome.c @@ -49,7 +49,7 @@ // An 'Info Card' is a trainer or match information page that can be viewed on the Tourney Tree struct TourneyTreeInfoCard { - u8 spriteIds[NUM_INFOCARD_SPRITES]; + u8 spriteIds[NUM_INFOCARD_SPRITES]; u8 pos; 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}, }; -// 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 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}, }; -static const u8 sLastMatchCardNum[DOME_ROUNDS_COUNT] = +static const u8 sLastMatchCardNum[DOME_ROUNDS_COUNT] = { - [DOME_ROUND1] = 23, - [DOME_ROUND2] = 27, - [DOME_SEMIFINAL] = 29, + [DOME_ROUND1] = 23, + [DOME_ROUND2] = 27, + [DOME_SEMIFINAL] = 29, [DOME_FINAL] = 30 }; @@ -1324,12 +1324,12 @@ static const u8 sSpeciesNameTextYCoords[] = {0, 4, 0}; // 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 -static const u8 sStatTextOffsets[NUM_STATS - 1] = +static const u8 sStatTextOffsets[NUM_STATS - 1] = { - DOME_TEXT_HP, - DOME_TEXT_ATK, - DOME_TEXT_DEF, - DOME_TEXT_SPEED, + DOME_TEXT_HP, + DOME_TEXT_ATK, + DOME_TEXT_DEF, + DOME_TEXT_SPEED, 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] = { { 68, 33}, // Left side trainers - { 68, 49}, + { 68, 49}, { 68, 65}, { 68, 81}, { 68, 97}, @@ -1495,7 +1495,7 @@ static const u8 sTourneyTreePokeballCoords[DOME_TOURNAMENT_TRAINERS_COUNT + DOME {.src = 0x6021, .y = 0x10, .x = 0x09}, \ {.src = 0x6023, .y = 0x10, .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) \ {.src = 0x602b, .y = 0x12, .x = 0x09}, \ @@ -2395,7 +2395,7 @@ static void InitDomeTrainers(void) 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 (j = i + 1; j < DOME_TOURNAMENT_TRAINERS_COUNT; j++) @@ -2676,7 +2676,7 @@ static int SelectOpponentMonsFromParty(int *partyMovePoints, bool8 allowRandom) partyPositions[i] = i; // All party mons have equal move score totals, choose randomly - if (partyMovePoints[0] == partyMovePoints[1] + if (partyMovePoints[0] == partyMovePoints[1] && partyMovePoints[0] == partyMovePoints[2]) { if (allowRandom) @@ -2852,8 +2852,8 @@ static int GetTypeEffectivenessPoints(int move, int targetSpecies, int arg2) NAKED static int GetTypeEffectivenessPoints(int move, int species, int arg2) { - asm_unified("\n\ - push {r4-r7,lr}\n\ + asm_unified( + "push {r4-r7,lr}\n\ mov r7, r10\n\ mov r6, r9\n\ mov r5, r8\n\ @@ -3085,8 +3085,7 @@ _08190156:\n\ mov r10, r5\n\ pop {r4-r7}\n\ pop {r1}\n\ - bx r1\n\ - "); + bx r1"); } #endif // NONMATCHING @@ -4538,7 +4537,7 @@ static void DisplayTrainerInfoOnCard(u8 flags, u8 trainerTourneyId) if (flags & MOVE_CARD) gSprites[sInfoCard->spriteIds[2 + i + arrId]].invisible = TRUE; } - + // Initialize the text printer textPrinter.fontId = 2; 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 (i == 2) { - + if (allocatedArray[6] < 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++) { tournamentId = sTourneyTreeTrainerIds2[i]; - + if (DOME_TRAINERS[tournamentId].isEliminated && 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)].eliminatedAt = gSaveBlock2Ptr->frontier.curChallengeBattleNum; 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 (gSaveBlock2Ptr->frontier.curChallengeBattleNum < DOME_FINAL) DecideRoundWinners(gSaveBlock2Ptr->frontier.curChallengeBattleNum); @@ -5363,7 +5362,7 @@ static void ResolveDomeRoundWinners(void) DOME_TRAINERS[TrainerIdToTournamentId(TRAINER_PLAYER)].isEliminated = TRUE; DOME_TRAINERS[TrainerIdToTournamentId(TRAINER_PLAYER)].eliminatedAt = gSaveBlock2Ptr->frontier.curChallengeBattleNum; gSaveBlock2Ptr->frontier.domeWinningMoves[TrainerIdToTournamentId(TRAINER_PLAYER)] = gBattleResults.lastUsedMoveOpponent; - + if (gBattleOutcome == B_OUTCOME_FORFEITED || gSpecialVar_0x8005 == DOME_PLAYER_RETIRED) DOME_TRAINERS[TrainerIdToTournamentId(TRAINER_PLAYER)].forfeited = TRUE; @@ -5401,7 +5400,7 @@ static u16 GetWinningMove(int winnerTournamentId, int loserTournamentId, u8 roun movePower = 40; else if (movePower == 1) 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) movePower /= 2; @@ -5558,7 +5557,7 @@ static void Task_ShowTourneyTree(u8 taskId) { for (i = 0; i < ARRAY_COUNT(sTourneyTreePokeballCoords); i++) CreateSprite(&sTourneyTreePokeballSpriteTemplate, sTourneyTreePokeballCoords[i][0], sTourneyTreePokeballCoords[i][1], 0); - + if (gTasks[taskId].tIsPrevTourneyTree) CreateSprite(&sExitButtonSpriteTemplate, 218, 12, 0); else @@ -5698,7 +5697,7 @@ static void Task_ShowTourneyTree(u8 taskId) gTasks[i].tState = 0; } ScanlineEffect_Clear(); - + i = 0; 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; i++; } - + ScanlineEffect_SetParams(sTourneyTreeScanlineEffectParams); DestroyTask(taskId); break; @@ -5851,67 +5850,67 @@ static void HblankCb_TourneyTree(void) 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; SET_WIN0H_WIN1H(0, 0); } 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; SET_WIN0H_WIN1H(WIN_RANGE(152, 155), WIN_RANGE(85, 88)); } 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; SET_WIN0H_WIN1H(0, 0); } 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; SET_WIN0H_WIN1H(WIN_RANGE(144, 152), WIN_RANGE(88, 96)); } 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; SET_WIN0H_WIN1H(WIN_RANGE(152, 155), WIN_RANGE(85, 88)); } 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; SET_WIN0H_WIN1H(0, 0); } 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; SET_WIN0H_WIN1H(WIN_RANGE(152, 155), WIN_RANGE(85, 88)); } 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; SET_WIN0H_WIN1H(WIN_RANGE(144, 152), WIN_RANGE(88, 96)); } 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; SET_WIN0H_WIN1H(0, 0); } 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; SET_WIN0H_WIN1H(WIN_RANGE(152, 155), WIN_RANGE(85, 88)); } 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; SET_WIN0H_WIN1H(0, 0); } diff --git a/src/battle_main.c b/src/battle_main.c index 935a53ffe9..99d48ef27b 100644 --- a/src/battle_main.c +++ b/src/battle_main.c @@ -3649,8 +3649,8 @@ static void BattleIntroOpponent1SendsOutMonAnimation(void) NAKED static void BattleIntroOpponent1SendsOutMonAnimation(void) { - asm(".syntax unified\n\ - push {r4-r6,lr}\n\ + asm_unified( + "push {r4-r6,lr}\n\ ldr r0, =gBattleTypeFlags\n\ ldr r2, [r0]\n\ movs r0, 0x80\n\ @@ -3728,8 +3728,7 @@ _0803B2F2:\n\ pop {r4-r6}\n\ pop {r0}\n\ bx r0\n\ - .pool\n\ - .syntax divided"); + .pool"); } #endif // NONMATCHING diff --git a/src/contest_util.c b/src/contest_util.c index f0edc53dcd..123d3e8eb6 100644 --- a/src/contest_util.c +++ b/src/contest_util.c @@ -192,18 +192,18 @@ static const struct OamData sOamData_858D7F0 = .affineParam = 0, }; -static const struct SpriteTemplate sSpriteTemplate_858D7F8 = +static const struct SpriteTemplate sSpriteTemplate_858D7F8 = { - .tileTag = 3009, - .paletteTag = 3009, - .oam = &sOamData_858D7F0, - .anims = gDummySpriteAnimTable, - .images = NULL, - .affineAnims = gDummySpriteAffineAnimTable, + .tileTag = 3009, + .paletteTag = 3009, + .oam = &sOamData_858D7F0, + .anims = gDummySpriteAnimTable, + .images = NULL, + .affineAnims = gDummySpriteAffineAnimTable, .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 = 3010 }, @@ -240,26 +240,26 @@ static const struct OamData sOamData_Confetti = static const struct SpriteTemplate sSpriteTemplate_Confetti = { - .tileTag = TAG_CONFETTI, - .paletteTag = TAG_CONFETTI, - .oam = &sOamData_Confetti, - .anims = gDummySpriteAnimTable, - .images = NULL, - .affineAnims = gDummySpriteAffineAnimTable, + .tileTag = TAG_CONFETTI, + .paletteTag = TAG_CONFETTI, + .oam = &sOamData_Confetti, + .anims = gDummySpriteAnimTable, + .images = NULL, + .affineAnims = gDummySpriteAffineAnimTable, .callback = SpriteCB_Confetti }; static const struct CompressedSpriteSheet sSpriteSheet_Confetti = { - .data = gConfetti_Gfx, - .size = 0x220, + .data = gConfetti_Gfx, + .size = 0x220, .tag = TAG_CONFETTI }; static const struct CompressedSpritePalette sSpritePalette_Confetti = { - .data = gConfetti_Pal, + .data = gConfetti_Pal, .tag = TAG_CONFETTI }; @@ -282,7 +282,7 @@ static const struct BgTemplate sBgTemplates[] = .paletteMode = 0, .priority = 3, .baseTile = 0, - }, + }, { .bg = 2, .charBaseIndex = 0, @@ -291,7 +291,7 @@ static const struct BgTemplate sBgTemplates[] = .paletteMode = 0, .priority = 3, .baseTile = 0, - }, + }, { .bg = 3, .charBaseIndex = 0, @@ -306,39 +306,39 @@ static const struct BgTemplate sBgTemplates[] = static const struct WindowTemplate sWindowTemplates[] = { { - .bg = 1, - .tilemapLeft = 7, - .tilemapTop = 4, - .width = 12, - .height = 2, - .paletteNum = 15, + .bg = 1, + .tilemapLeft = 7, + .tilemapTop = 4, + .width = 12, + .height = 2, + .paletteNum = 15, .baseBlock = 770 }, { - .bg = 1, - .tilemapLeft = 7, - .tilemapTop = 7, - .width = 12, - .height = 2, - .paletteNum = 15, + .bg = 1, + .tilemapLeft = 7, + .tilemapTop = 7, + .width = 12, + .height = 2, + .paletteNum = 15, .baseBlock = 794 }, { - .bg = 1, - .tilemapLeft = 7, - .tilemapTop = 10, - .width = 12, - .height = 2, - .paletteNum = 15, + .bg = 1, + .tilemapLeft = 7, + .tilemapTop = 10, + .width = 12, + .height = 2, + .paletteNum = 15, .baseBlock = 818 }, { - .bg = 1, - .tilemapLeft = 7, - .tilemapTop = 13, - .width = 12, - .height = 2, - .paletteNum = 15, + .bg = 1, + .tilemapLeft = 7, + .tilemapTop = 13, + .width = 12, + .height = 2, + .paletteNum = 15, .baseBlock = 842 }, DUMMY_WIN_TEMPLATE, @@ -364,19 +364,19 @@ static const struct OamData sUnknown_0858D8C0 = static const struct SpriteTemplate sSpriteTemplate_858D8C8 = { - .tileTag = 22222, - .paletteTag = 0, - .oam = &sUnknown_0858D8C0, - .anims = gDummySpriteAnimTable, - .images = NULL, - .affineAnims = gDummySpriteAffineAnimTable, + .tileTag = 22222, + .paletteTag = 0, + .oam = &sUnknown_0858D8C0, + .anims = gDummySpriteAnimTable, + .images = NULL, + .affineAnims = gDummySpriteAffineAnimTable, .callback = SpriteCallbackDummy }; -static const struct SpriteSheet sUnknown_0858D8E0 = +static const struct SpriteSheet sUnknown_0858D8E0 = { - .data = gMiscBlank_Gfx, - .size = 0x200, + .data = gMiscBlank_Gfx, + .size = 0x200, .tag = 22222 }; @@ -1219,8 +1219,8 @@ static s32 DrawResultsTextWindow(const u8 *text, u8 spriteId) NAKED static s32 DrawResultsTextWindow(const u8 *text, u8 spriteId) { - asm_unified("\n\ - push {r4-r7,lr}\n\ + asm_unified( + "push {r4-r7,lr}\n\ mov r7, r10\n\ mov r6, r9\n\ mov r5, r8\n\ @@ -2787,8 +2787,8 @@ bool8 GiveMonArtistRibbon(void) u8 hasArtistRibbon; hasArtistRibbon = GetMonData(&gPlayerParty[gContestMonPartyIndex], MON_DATA_ARTIST_RIBBON); - if (!hasArtistRibbon - && gContestFinalStandings[gContestPlayerMonIndex] == 0 + if (!hasArtistRibbon + && gContestFinalStandings[gContestPlayerMonIndex] == 0 && gSpecialVar_ContestRank == CONTEST_RANK_MASTER && gContestMonTotalPoints[gContestPlayerMonIndex] >= 800) { @@ -2905,8 +2905,8 @@ static void Task_ShowContestEntryMonPic(u8 taskId) void GetContestMultiplayerId(void) { - if ((gLinkContestFlags & LINK_CONTEST_FLAG_IS_LINK) - && gNumLinkContestPlayers == CONTESTANT_COUNT + if ((gLinkContestFlags & LINK_CONTEST_FLAG_IS_LINK) + && gNumLinkContestPlayers == CONTESTANT_COUNT && !(gLinkContestFlags & LINK_CONTEST_FLAG_IS_WIRELESS)) gSpecialVar_Result = GetMultiplayerId(); else diff --git a/src/frontier_util.c b/src/frontier_util.c index c741a64fea..3e7fecb480 100644 --- a/src/frontier_util.c +++ b/src/frontier_util.c @@ -2539,8 +2539,8 @@ void CreateFrontierBrainPokemon(void) NAKED void CreateFrontierBrainPokemon(void) { - asm_unified("\n\ - push {r4-r7,lr}\n\ + asm_unified( + "push {r4-r7,lr}\n\ mov r7, r10\n\ mov r6, r9\n\ mov r5, r8\n\ @@ -2768,8 +2768,7 @@ _081A4FD0:\n\ pop {r4-r7}\n\ pop {r0}\n\ bx r0\n\ - .pool\n\ -"); + .pool"); } #endif diff --git a/src/item.c b/src/item.c index 44b73802bc..5a77d363ec 100644 --- a/src/item.c +++ b/src/item.c @@ -247,7 +247,8 @@ bool8 CheckBagHasSpace(u16 itemId, u16 count) NAKED 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 r6, r9\n\ mov r5, r8\n\ diff --git a/src/mirage_tower.c b/src/mirage_tower.c index fb3a0a3743..c980d76df0 100644 --- a/src/mirage_tower.c +++ b/src/mirage_tower.c @@ -762,8 +762,8 @@ static void sub_81BF2B8(u8* a, u16 b, u8 c, u8 d, u8 e) NAKED static void sub_81BF2B8(u8* a, u16 b, u8 c, u8 d, u8 e) { - asm_unified("\n\ - push {r4-r7,lr}\n\ + asm_unified( + "push {r4-r7,lr}\n\ mov r7, r10\n\ mov r6, r9\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 {r0}\n\ bx r0\n\ - .pool\n\ - "); + .pool"); } #endif // NONMATCHING diff --git a/src/pokedex.c b/src/pokedex.c index 458d6c94b2..4f41c5557e 100644 --- a/src/pokedex.c +++ b/src/pokedex.c @@ -5258,11 +5258,11 @@ void SetSearchRectHighlight(u8 flags, u8 x, u8 y, u8 width) } } #else -__attribute__((naked)) +NAKED void SetSearchRectHighlight(u8 flags, u8 x, u8 y, u8 width) { - asm(".syntax unified\n\ - push {r4-r7,lr}\n\ + asm_unified( + "push {r4-r7,lr}\n\ mov r7, r8\n\ push {r7}\n\ adds r4, r3, 0\n\ @@ -5310,8 +5310,7 @@ _080C1DEC:\n\ pop {r4-r7}\n\ pop {r0}\n\ bx r0\n\ - .pool\n\ - .syntax divided\n"); + .pool"); } #endif diff --git a/src/pokenav_main_menu.c b/src/pokenav_main_menu.c index 155e30939d..0e2425d4e9 100644 --- a/src/pokenav_main_menu.c +++ b/src/pokenav_main_menu.c @@ -293,7 +293,7 @@ static const struct SpriteTemplate sUnknown_0861FB44 = bool32 InitPokenavMainMenu(void) { struct PokenavMainMenuResources *structPtr; - + structPtr = AllocSubstruct(0, sizeof(struct PokenavMainMenuResources)); if (structPtr == NULL) return FALSE; @@ -474,8 +474,8 @@ void sub_81C7990(u32 a0, u16 a1) NAKED void sub_81C79BC(const u16 *a0, const u16 *a1, u32 a2, u32 a3, u32 a4, u16 *a5) { - asm(".syntax unified\n\ - push {r4-r7,lr}\n\ + asm_unified( + "push {r4-r7,lr}\n\ mov r7, r10\n\ mov r6, r9\n\ mov r5, r8\n\ @@ -603,8 +603,7 @@ _081C7AAE:\n\ mov r10, r5\n\ pop {r4-r7}\n\ pop {r0}\n\ - bx r0\n\ - .syntax divided"); + bx r0"); } void PokenavFadeScreen(s32 fadeType)