diff options
author | PikalaxALT <pikalaxalt@gmail.com> | 2021-07-08 08:38:51 -0400 |
---|---|---|
committer | PikalaxALT <pikalaxalt@gmail.com> | 2021-07-08 08:38:51 -0400 |
commit | b86d6d05d92de28c35c899f4fbd03c1d542dc689 (patch) | |
tree | 082b433e0f10e758799ce2501f49f959f2ce54b3 | |
parent | 91ac7fecd90a908af6b12d1a5f4e85e30b651b00 (diff) |
Fix style issues
31 files changed, 102 insertions, 136 deletions
diff --git a/include/battle_anim.h b/include/battle_anim.h index 1252886bf..133dde62f 100644 --- a/include/battle_anim.h +++ b/include/battle_anim.h @@ -5,6 +5,16 @@ #include "sprite.h" +// battle_anim_status_effects.c +#define STAT_ANIM_PLUS1 15 +#define STAT_ANIM_PLUS2 39 +#define STAT_ANIM_MINUS1 22 +#define STAT_ANIM_MINUS2 46 +#define STAT_ANIM_MULTIPLE_PLUS1 55 +#define STAT_ANIM_MULTIPLE_PLUS2 56 +#define STAT_ANIM_MULTIPLE_MINUS1 57 +#define STAT_ANIM_MULTIPLE_MINUS2 58 + #define REG_BGnCNT_BITFIELD(n) (*(vBgCnt *)REG_ADDR_BG##n##CNT) #define REG_BG0CNT_BITFIELD REG_BGnCNT_BITFIELD(0) #define REG_BG1CNT_BITFIELD REG_BGnCNT_BITFIELD(1) @@ -39,7 +49,7 @@ struct ContestMoveAnim u8 contestant; u32 personality; u32 otId; - u32 personality2; + u32 targetPersonality; }; extern void (*gAnimScriptCallback)(void); diff --git a/include/battle_script_commands.h b/include/battle_script_commands.h index 36f54c6a8..4cfa4d71b 100644 --- a/include/battle_script_commands.h +++ b/include/battle_script_commands.h @@ -16,10 +16,10 @@ #define BS_GET_ATTACKER_SIDE 8 // for atk1E_jumpifability #define BS_GET_NOT_ATTACKER_SIDE 9 // for atk1E_jumpifability -#define ATK48_STAT_NEGATIVE 0x1 -#define ATK48_STAT_BY_TWO 0x2 -#define ATK48_BIT_x4 0x4 -#define ATK48_LOWER_FAIL_CHECK 0x8 +#define STAT_CHANGE_NEGATIVE (1 << 0) +#define STAT_CHANGE_BY_TWO (1 << 1) +#define STAT_CHANGE_MULTIPLE_STATS (1 << 2) +#define STAT_CHANGE_CANT_PREVENT (1 << 3) #define ATK4F_DONT_CHECK_STATUSES 0x80 diff --git a/include/constants/pokemon.h b/include/constants/pokemon.h index f5a9f4a6e..d1cec4461 100644 --- a/include/constants/pokemon.h +++ b/include/constants/pokemon.h @@ -141,6 +141,10 @@ #define NUM_STATS 6 #define UNOWN_FORM_COUNT 28 +#define MIN_STAT_STAGE 0 +#define DEFAULT_STAT_STAGE 6 +#define MAX_STAT_STAGE 12 + #define PLAYER_HAS_TWO_USABLE_MONS 0 #define PLAYER_HAS_ONE_MON 1 #define PLAYER_HAS_ONE_USABLE_MON 2 diff --git a/include/global.h b/include/global.h index 17e25f4b5..7897e20c2 100644 --- a/include/global.h +++ b/include/global.h @@ -136,7 +136,7 @@ struct UCoords16 struct SecretBaseParty { /*0x1A3C*/ u32 personality[PARTY_SIZE]; - /*0x1A54*/ u16 moves[PARTY_SIZE * 4]; + /*0x1A54*/ u16 moves[PARTY_SIZE * MAX_MON_MOVES]; /*0x1A84*/ u16 species[PARTY_SIZE]; /*0x1A90*/ u16 heldItems[PARTY_SIZE]; /*0x1A9C*/ u8 levels[PARTY_SIZE]; diff --git a/include/region_map.h b/include/region_map.h index dc3b8cee6..f42c7c493 100644 --- a/include/region_map.h +++ b/include/region_map.h @@ -60,7 +60,6 @@ struct RegionMap /*0x280*/ u8 cursorLargeImage[0x600]; }; // size: 0x880 -// Replaces field_region_map.c:UnkStruct, region_map.c:UnknownStruct3 struct RegionMapState { void (*callback)(void); diff --git a/src/battle_anim_effects_3.c b/src/battle_anim_effects_3.c index 66987b8f7..3de6aacf1 100644 --- a/src/battle_anim_effects_3.c +++ b/src/battle_anim_effects_3.c @@ -3187,7 +3187,7 @@ void AnimTask_RolePlaySilhouette(u8 taskId) if (IsContest()) { isBackPic = 1; - personality = gContestResources__moveAnim.personality2; + personality = gContestResources__moveAnim.targetPersonality; otId = gContestResources__moveAnim.otId; species = gContestResources__moveAnim.targetSpecies; xOffset = 20; @@ -4667,8 +4667,7 @@ void sub_81312E4(u8 taskId) refresh_graphics_maybe(gBattleAnimAttacker, 0, spriteId); if (IsContest()) { - gSprites[gBattlerSpriteIds[gBattleAnimAttacker]].affineAnims = - gAffineAnims_BattleSpriteContest; + gSprites[gBattlerSpriteIds[gBattleAnimAttacker]].affineAnims = gAffineAnims_BattleSpriteContest; StartSpriteAffineAnim(&gSprites[gBattlerSpriteIds[gBattleAnimAttacker]], 0); } diff --git a/src/battle_controller_link_opponent.c b/src/battle_controller_link_opponent.c index fdee6128f..abcfcce27 100644 --- a/src/battle_controller_link_opponent.c +++ b/src/battle_controller_link_opponent.c @@ -1405,8 +1405,7 @@ void LinkOpponentHandlePrintString(void) gBattle_BG0_X = 0; gBattle_BG0_Y = 0; BufferStringBattle(*(u16 *)&gBattleBufferA[gActiveBattler][2]); - Contest_StartTextPrinter( - &gWindowTemplate_Contest_MoveDescription, gDisplayedStringBattle, 144, 2, 15); + Contest_StartTextPrinter(&gWindowTemplate_Contest_MoveDescription, gDisplayedStringBattle, 144, 2, 15); gBattlerControllerFuncs[gActiveBattler] = sub_8037C2C; } diff --git a/src/battle_controller_link_partner.c b/src/battle_controller_link_partner.c index 62ed0101f..9217db81f 100644 --- a/src/battle_controller_link_partner.c +++ b/src/battle_controller_link_partner.c @@ -1341,8 +1341,7 @@ void LinkPartnerHandlePrintString(void) gBattle_BG0_X = 0; gBattle_BG0_Y = 0; BufferStringBattle(*(u16 *)&gBattleBufferA[gActiveBattler][2]); - Contest_StartTextPrinter( - &gWindowTemplate_Contest_MoveDescription, gDisplayedStringBattle, 144, 2, 15); + Contest_StartTextPrinter(&gWindowTemplate_Contest_MoveDescription, gDisplayedStringBattle, 144, 2, 15); gBattlerControllerFuncs[gActiveBattler] = sub_811DFA0; } diff --git a/src/battle_controller_opponent.c b/src/battle_controller_opponent.c index fd7282f49..b50a7718a 100644 --- a/src/battle_controller_opponent.c +++ b/src/battle_controller_opponent.c @@ -1410,8 +1410,7 @@ void OpponentHandlePrintString(void) gBattle_BG0_X = 0; gBattle_BG0_Y = 0; BufferStringBattle(*(u16 *)&gBattleBufferA[gActiveBattler][2]); - Contest_StartTextPrinter( - &gWindowTemplate_Contest_MoveDescription, gDisplayedStringBattle, 144, 2, 15); + Contest_StartTextPrinter(&gWindowTemplate_Contest_MoveDescription, gDisplayedStringBattle, 144, 2, 15); gBattlerControllerFuncs[gActiveBattler] = sub_80331D0; } diff --git a/src/battle_controller_player.c b/src/battle_controller_player.c index ddeefcc32..a4c76992c 100644 --- a/src/battle_controller_player.c +++ b/src/battle_controller_player.c @@ -1722,8 +1722,7 @@ void b_link_standby_message(void) { gBattle_BG0_X = 0; gBattle_BG0_Y = 0; - Contest_StartTextPrinter( - &gWindowTemplate_Contest_MoveDescription, BattleText_LinkStandby, 0x90, 2, 15); + Contest_StartTextPrinter(&gWindowTemplate_Contest_MoveDescription, BattleText_LinkStandby, 0x90, 2, 15); } } @@ -2589,8 +2588,7 @@ void PlayerHandlePrintString(void) gBattle_BG0_X = 0; gBattle_BG0_Y = 0; BufferStringBattle(*(u16 *)&gBattleBufferA[gActiveBattler][2]); - Contest_StartTextPrinter( - &gWindowTemplate_Contest_MoveDescription, gDisplayedStringBattle, 0x90, 2, 15); + Contest_StartTextPrinter(&gWindowTemplate_Contest_MoveDescription, gDisplayedStringBattle, 0x90, 2, 15); gBattlerControllerFuncs[gActiveBattler] = sub_802DF18; } diff --git a/src/battle_controller_safari.c b/src/battle_controller_safari.c index 45b4f2845..cf09ef164 100644 --- a/src/battle_controller_safari.c +++ b/src/battle_controller_safari.c @@ -461,8 +461,7 @@ void SafariHandlePrintString(void) gBattle_BG0_X = 0; gBattle_BG0_Y = 0; BufferStringBattle(*(u16 *)&gBattleBufferA[gActiveBattler][2]); - Contest_StartTextPrinter( - &gWindowTemplate_Contest_MoveDescription, gDisplayedStringBattle, 144, 2, 15); + Contest_StartTextPrinter(&gWindowTemplate_Contest_MoveDescription, gDisplayedStringBattle, 144, 2, 15); gBattlerControllerFuncs[gActiveBattler] = sub_812B694; } diff --git a/src/battle_controller_wally.c b/src/battle_controller_wally.c index 95e648ea7..41f3db56b 100644 --- a/src/battle_controller_wally.c +++ b/src/battle_controller_wally.c @@ -1239,8 +1239,7 @@ void WallyHandlePrintString(void) if (*ptr == 2) DestroyMenuCursor(); BufferStringBattle(*ptr); - Contest_StartTextPrinter( - &gWindowTemplate_Contest_MoveDescription, gDisplayedStringBattle, 0x90, 2, 15); + Contest_StartTextPrinter(&gWindowTemplate_Contest_MoveDescription, gDisplayedStringBattle, 0x90, 2, 15); gBattlerControllerFuncs[gActiveBattler] = sub_8137454; } diff --git a/src/battle_gfx_sfx_util.c b/src/battle_gfx_sfx_util.c index 2e2c4b4bb..d81752f5a 100644 --- a/src/battle_gfx_sfx_util.c +++ b/src/battle_gfx_sfx_util.c @@ -664,7 +664,7 @@ void sub_8031FC4(u8 a, u8 b, bool8 c) eBattleInterfaceGfxBuffer, gMonSpriteGfx_Sprite_ptr[0], species, - gContestResources__moveAnim.personality2); + gContestResources__moveAnim.targetPersonality); } else { diff --git a/src/battle_message.c b/src/battle_message.c index dff698c09..d8aa92fbf 100644 --- a/src/battle_message.c +++ b/src/battle_message.c @@ -503,10 +503,10 @@ extern u8 *de_sub_8041024(s32, u32); StringGetEnd10(text); \ toCpy = text; #else -#define HANDLE_NICKNAME_STRING_CASE(bank, pmMonIndex) \ +#define HANDLE_NICKNAME_STRING_CASE(bank, monIndex) \ if (GetBattlerSide(bank) != 0) \ { \ - GetMonData(&gEnemyParty[pmMonIndex], MON_DATA_NICKNAME, text); \ + GetMonData(&gEnemyParty[monIndex], MON_DATA_NICKNAME, text); \ StringGetEnd10(text); \ toCpy = text; \ while (*toCpy != EOS) \ @@ -522,7 +522,7 @@ extern u8 *de_sub_8041024(s32, u32); } \ else \ { \ - GetMonData(&gPlayerParty[pmMonIndex], MON_DATA_NICKNAME, text); \ + GetMonData(&gPlayerParty[monIndex], MON_DATA_NICKNAME, text); \ StringGetEnd10(text); \ toCpy = text; \ } diff --git a/src/battle_script_commands.c b/src/battle_script_commands.c index 7583b3c05..dc6bd3f5c 100644 --- a/src/battle_script_commands.c +++ b/src/battle_script_commands.c @@ -1,5 +1,6 @@ #include "global.h" #include "battle.h" +#include "battle_anim.h" #include "battle_message.h" #include "battle_string_ids.h" #include "battle_script_commands.h" @@ -2301,23 +2302,10 @@ u8 GetBattlerTurnOrderNum(u8 battlerId) return i; } -#define INCREMENT_RESET_RETURN \ -{ \ - gBattlescriptCurrInstr++; \ - /*gBattleCommunication[MOVE_EFFECT_BYTE] = 0;*/ \ - return; \ -} - -#define RESET_RETURN \ -{ \ - /*gBattleCommunication[MOVE_EFFECT_BYTE] = 0;*/ \ - return; \ -} - void SetMoveEffect(bool8 primary, u8 certain) { bool32 statusChanged = FALSE; - u8 affectsUser = 0; // 0x40 otherwise + u8 affectsUser = 0; bool32 noSunCanFreeze = TRUE; if (gBattleCommunication[MOVE_EFFECT_BYTE] & MOVE_EFFECT_AFFECTS_USER) @@ -2335,19 +2323,31 @@ void SetMoveEffect(bool8 primary, u8 certain) if (gBattleMons[gEffectBattler].ability == ABILITY_SHIELD_DUST && !(gHitMarker & HITMARKER_IGNORE_SAFEGUARD) && !primary && gBattleCommunication[MOVE_EFFECT_BYTE] <= 9) - INCREMENT_RESET_RETURN + { + gBattlescriptCurrInstr++; + return; + } if (gSideStatuses[GET_BATTLER_SIDE(gEffectBattler)] & SIDE_STATUS_SAFEGUARD && !(gHitMarker & HITMARKER_IGNORE_SAFEGUARD) && !primary && gBattleCommunication[MOVE_EFFECT_BYTE] <= 7) - INCREMENT_RESET_RETURN + { + gBattlescriptCurrInstr++; + return; + } if (gBattleMons[gEffectBattler].hp == 0 && gBattleCommunication[MOVE_EFFECT_BYTE] != MOVE_EFFECT_PAYDAY && gBattleCommunication[MOVE_EFFECT_BYTE] != MOVE_EFFECT_STEAL_ITEM) - INCREMENT_RESET_RETURN + { + gBattlescriptCurrInstr++; + return; + } if (gBattleMons[gEffectBattler].status2 & STATUS2_SUBSTITUTE && affectsUser != MOVE_EFFECT_AFFECTS_USER) - INCREMENT_RESET_RETURN + { + gBattlescriptCurrInstr++; + return; + } if (gBattleCommunication[MOVE_EFFECT_BYTE] <= PRIMARY_STATUS_MOVE_EFFECT) { @@ -2396,7 +2396,7 @@ void SetMoveEffect(bool8 primary, u8 certain) { gBattleCommunication[MULTISTRING_CHOOSER] = B_MSG_ABILITY_PREVENTS_MOVE_STATUS; } - RESET_RETURN + return; } if ((IS_BATTLER_OF_TYPE(gEffectBattler, TYPE_POISON) || IS_BATTLER_OF_TYPE(gEffectBattler, TYPE_STEEL)) && (gHitMarker & HITMARKER_IGNORE_SAFEGUARD) @@ -2406,7 +2406,7 @@ void SetMoveEffect(bool8 primary, u8 certain) gBattlescriptCurrInstr = BattleScript_PSNPrevention; gBattleCommunication[MULTISTRING_CHOOSER] = B_MSG_STATUS_HAD_NO_EFFECT; - RESET_RETURN + return; } if (IS_BATTLER_OF_TYPE(gEffectBattler, TYPE_POISON)) break; @@ -2437,7 +2437,7 @@ void SetMoveEffect(bool8 primary, u8 certain) { gBattleCommunication[MULTISTRING_CHOOSER] = B_MSG_ABILITY_PREVENTS_MOVE_STATUS; } - RESET_RETURN + return; } if (IS_BATTLER_OF_TYPE(gEffectBattler, TYPE_FIRE) && (gHitMarker & HITMARKER_IGNORE_SAFEGUARD) @@ -2447,7 +2447,7 @@ void SetMoveEffect(bool8 primary, u8 certain) gBattlescriptCurrInstr = BattleScript_BRNPrevention; gBattleCommunication[MULTISTRING_CHOOSER] = B_MSG_STATUS_HAD_NO_EFFECT; - RESET_RETURN + return; } if (IS_BATTLER_OF_TYPE(gEffectBattler, TYPE_FIRE)) break; @@ -2493,7 +2493,7 @@ void SetMoveEffect(bool8 primary, u8 certain) { gBattleCommunication[MULTISTRING_CHOOSER] = B_MSG_ABILITY_PREVENTS_MOVE_STATUS; } - RESET_RETURN + return; } else break; @@ -2521,7 +2521,7 @@ void SetMoveEffect(bool8 primary, u8 certain) { gBattleCommunication[MULTISTRING_CHOOSER] = B_MSG_ABILITY_PREVENTS_MOVE_STATUS; } - RESET_RETURN + return; } if ((IS_BATTLER_OF_TYPE(gEffectBattler, TYPE_POISON) || IS_BATTLER_OF_TYPE(gEffectBattler, TYPE_STEEL)) && (gHitMarker & HITMARKER_IGNORE_SAFEGUARD) @@ -2531,7 +2531,7 @@ void SetMoveEffect(bool8 primary, u8 certain) gBattlescriptCurrInstr = BattleScript_PSNPrevention; gBattleCommunication[MULTISTRING_CHOOSER] = B_MSG_STATUS_HAD_NO_EFFECT; - RESET_RETURN + return; } if (gBattleMons[gEffectBattler].status1) break; @@ -2838,7 +2838,6 @@ void SetMoveEffect(bool8 primary, u8 certain) else if (gBattleMons[gBattlerTarget].item && gBattleMons[gBattlerTarget].ability == ABILITY_STICKY_HOLD) { -// BattleScriptPushCursor(); gBattlescriptCurrInstr = BattleScript_NoItemSteal; gLastUsedAbility = gBattleMons[gBattlerTarget].ability; @@ -2846,7 +2845,6 @@ void SetMoveEffect(bool8 primary, u8 certain) } else if (gBattleMons[gBattlerAttacker].item == ITEM_NONE && gBattleMons[gBattlerTarget].item != ITEM_ENIGMA_BERRY -// || IS_ITEM_MAIL(gBattleMons[gBattlerTarget].item) && gBattleMons[gBattlerTarget].item != ITEM_NONE) { u16* changedItem = &gBattleStruct->changedItems[gBattlerAttacker]; @@ -4141,25 +4139,6 @@ static void atk47_setgraphicalstatchangevalues(void) gBattlescriptCurrInstr++; } -// stat change flags for atk48_playstatchangeanimation -#define STAT_CHANGE_NEGATIVE (1 << 0) -#define STAT_CHANGE_BY_TWO (1 << 1) -#define STAT_CHANGE_MULTIPLE_STATS (1 << 2) -#define STAT_CHANGE_CANT_PREVENT (1 << 3) - -// battle_anim_status_effects.c -#define STAT_ANIM_PLUS1 15 -#define STAT_ANIM_PLUS2 39 -#define STAT_ANIM_MINUS1 22 -#define STAT_ANIM_MINUS2 46 -#define STAT_ANIM_MULTIPLE_PLUS1 55 -#define STAT_ANIM_MULTIPLE_PLUS2 56 -#define STAT_ANIM_MULTIPLE_MINUS1 57 -#define STAT_ANIM_MULTIPLE_MINUS2 58 - -#define MIN_STAT_STAGE 0 -#define MAX_STAT_STAGE 12 - static void atk48_playstatchangeanimation(void) { u32 currStat = 0; diff --git a/src/contest.c b/src/contest.c index 06fc71888..820ae326a 100644 --- a/src/contest.c +++ b/src/contest.c @@ -1246,8 +1246,7 @@ void Task_DoAppeals(u8 taskId) else if (r4 == 2) Contest_StartTextPrinter(&gMenuWindow, ContestString_WentOverVeryWell, 776, 1, 15); else - Contest_StartTextPrinter( - &gMenuWindow, ContestString_AppealComboExcellently, 776, 1, 15); + Contest_StartTextPrinter(&gMenuWindow, ContestString_AppealComboExcellently, 776, 1, 15); DoJudgeSpeechBubble(3); gTasks[taskId].data[10] = 0; gTasks[taskId].data[0] = 45; diff --git a/src/contest_2.c b/src/contest_2.c index 5d33c3d2f..eab89abe0 100644 --- a/src/contest_2.c +++ b/src/contest_2.c @@ -3984,7 +3984,7 @@ void SetMoveSpecificAnimData(u8 contestant) case MOVE_ROLE_PLAY: r5_2 = sContestantStatus[contestant].contestantAnimTarget; gContestResources__moveAnim.targetSpecies = SanitizeSpecies(gContestMons[r5_2].species); - gContestResources__moveAnim.personality2 = gContestMons[r5_2].personality; + gContestResources__moveAnim.targetPersonality = gContestMons[r5_2].personality; gContestResources__moveAnim.hasTargetAnim = 1; break; case MOVE_RETURN: diff --git a/src/contest_ai.c b/src/contest_ai.c index 9e62fcd70..df69d5019 100644 --- a/src/contest_ai.c +++ b/src/contest_ai.c @@ -1353,8 +1353,7 @@ static void ContestAICmd_unk_5E(void) { u8 var = sub_8128A7C(gAIScriptPtr[1]); - eContestAI->scriptResult = - gContestMonRound1Points[var] - gContestMonRound1Points[eContestAI->unk41]; + eContestAI->scriptResult = gContestMonRound1Points[var] - gContestMonRound1Points[eContestAI->unk41]; gAIScriptPtr += 2; } diff --git a/src/contest_util.c b/src/contest_util.c index 34db5a975..f4c3c2e1c 100644 --- a/src/contest_util.c +++ b/src/contest_util.c @@ -113,8 +113,7 @@ void ShouldReadyContestArtist(void) { if(!gContestFinalStandings[gContestPlayerMonIndex] && gSpecialVar_ContestRank == CONTEST_RANK_MASTER - && - gContestMonTotalPoints[gContestPlayerMonIndex] >= 800) + && gContestMonTotalPoints[gContestPlayerMonIndex] >= 800) { gSpecialVar_0x8004 = TRUE; } diff --git a/src/data/graphics.c b/src/data/graphics.c index 8c98739a2..9a73f34e6 100644 --- a/src/data/graphics.c +++ b/src/data/graphics.c @@ -1422,7 +1422,7 @@ const u16 gTilesetPalettes_Shop[][16] = }; const u8 gTilesetTiles_Shop[] = INCBIN_U8("data/tilesets/secondary/shop/tiles.4bpp.lz"); -const u16 sCryMeter_Pal[] = INCBIN_U16("graphics/pokedex/cry_meter.gbapal"); -const u8 sCryMeter_Gfx[] = INCBIN_U8("graphics/pokedex/cry_meter.4bpp.lz"); -const u8 sCryMeter_Tilemap[] = INCBIN_U8("graphics/pokedex/cry_meter_map.bin"); +const u16 gCryMeter_Pal[] = INCBIN_U16("graphics/pokedex/cry_meter.gbapal"); +const u8 gCryMeter_Gfx[] = INCBIN_U8("graphics/pokedex/cry_meter.4bpp.lz"); +const u8 gCryMeter_Tilemap[] = INCBIN_U8("graphics/pokedex/cry_meter_map.bin"); #endif // GERMAN diff --git a/src/egg_hatch.c b/src/egg_hatch.c index 5e8a8d16e..8ff9f28a7 100644 --- a/src/egg_hatch.c +++ b/src/egg_hatch.c @@ -761,8 +761,7 @@ static void CreateEggShardSprite(u8 x, u8 y, s16 data1, s16 data2, s16 data3, u8 static void EggHatchPrintMessage1(u8* src) { - Contest_StartTextPrinter( - &gEggHatchData->window, src, gEggHatchData->tileDataStartOffset, 3, 15); + Contest_StartTextPrinter(&gEggHatchData->window, src, gEggHatchData->tileDataStartOffset, 3, 15); } static void EggHatchPrintMessage2(u8* src) diff --git a/src/evolution_scene.c b/src/evolution_scene.c index 62073909b..ac30d2c3f 100644 --- a/src/evolution_scene.c +++ b/src/evolution_scene.c @@ -549,8 +549,7 @@ static void Task_EvolutionScene(u8 taskID) if (!gPaletteFade.active) { StringExpandPlaceholders(gStringVar4, BattleText_StartEvo); - Contest_StartTextPrinter( - &gWindowTemplate_Contest_MoveDescription, gStringVar4, 144, 2, 15); + Contest_StartTextPrinter(&gWindowTemplate_Contest_MoveDescription, gStringVar4, 144, 2, 15); gTasks[taskID].tState++; } break; @@ -638,8 +637,7 @@ static void Task_EvolutionScene(u8 taskID) if (IsCryFinished() && !gPaletteFade.active) { StringExpandPlaceholders(gStringVar4, BattleText_FinishEvo); - Contest_StartTextPrinter( - &gWindowTemplate_Contest_MoveDescription, gStringVar4, 144, 2, 15); + Contest_StartTextPrinter(&gWindowTemplate_Contest_MoveDescription, gStringVar4, 144, 2, 15); PlayBGM(MUS_EVOLVED); gTasks[taskID].tState++; SetMonData(mon, MON_DATA_SPECIES, (void*)(&gTasks[taskID].tPostEvoSpecies)); @@ -708,8 +706,7 @@ static void Task_EvolutionScene(u8 taskID) if (IsCryFinished()) { StringExpandPlaceholders(gStringVar4, BattleText_StopEvo); - Contest_StartTextPrinter( - &gWindowTemplate_Contest_MoveDescription, gStringVar4, 144, 2, 15); + Contest_StartTextPrinter(&gWindowTemplate_Contest_MoveDescription, gStringVar4, 144, 2, 15); gTasks[taskID].tEvoWasStopped = TRUE; gTasks[taskID].tState = 14; } @@ -720,8 +717,7 @@ static void Task_EvolutionScene(u8 taskID) sub_8024CEC(); PlayFanfare(MUS_LEVEL_UP); BattleStringExpandPlaceholdersToDisplayedString(gBattleStringsTable[3]); - Contest_StartTextPrinter( - &gWindowTemplate_Contest_MoveDescription, gDisplayedStringBattle, 144, 2, 15); + Contest_StartTextPrinter(&gWindowTemplate_Contest_MoveDescription, gDisplayedStringBattle, 144, 2, 15); gTasks[taskID].tLearnsFirstMove = 0x40; // re-used as a counter gTasks[taskID].tState++; } @@ -738,8 +734,7 @@ static void Task_EvolutionScene(u8 taskID) { sub_8024CEC(); BattleStringExpandPlaceholdersToDisplayedString(gBattleStringsTable[4]); - Contest_StartTextPrinter( - &gWindowTemplate_Contest_MoveDescription, gDisplayedStringBattle, 144, 2, 15); + Contest_StartTextPrinter(&gWindowTemplate_Contest_MoveDescription, gDisplayedStringBattle, 144, 2, 15); gTasks[taskID].tLearnMoveState++; } break; @@ -747,8 +742,7 @@ static void Task_EvolutionScene(u8 taskID) if (gWindowTemplate_Contest_MoveDescription.state == 0 && !IsSEPlaying()) { BattleStringExpandPlaceholdersToDisplayedString(gBattleStringsTable[5]); - Contest_StartTextPrinter( - &gWindowTemplate_Contest_MoveDescription, gDisplayedStringBattle, 144, 2, 15); + Contest_StartTextPrinter(&gWindowTemplate_Contest_MoveDescription, gDisplayedStringBattle, 144, 2, 15); gTasks[taskID].tLearnMoveState++; } break; @@ -758,8 +752,7 @@ static void Task_EvolutionScene(u8 taskID) if (!IsSEPlaying()) { BattleStringExpandPlaceholdersToDisplayedString(gBattleStringsTable[6]); - Contest_StartTextPrinter( - &gWindowTemplate_Contest_MoveDescription, gDisplayedStringBattle, 144, 2, 15); + Contest_StartTextPrinter(&gWindowTemplate_Contest_MoveDescription, gDisplayedStringBattle, 144, 2, 15); gTasks[taskID].tData9 = 5; gTasks[taskID].tdata10 = 9; gTasks[taskID].tLearnMoveState++; @@ -792,8 +785,7 @@ static void Task_EvolutionScene(u8 taskID) { sub_8023AD8(); BattleStringExpandPlaceholdersToDisplayedString(gBattleStringsTable[292]); - Contest_StartTextPrinter( - &gWindowTemplate_Contest_MoveDescription, gDisplayedStringBattle, 144, 2, 15); + Contest_StartTextPrinter(&gWindowTemplate_Contest_MoveDescription, gDisplayedStringBattle, 144, 2, 15); PlaySE(SE_SELECT); if (sEvoCursorPos != 0) gTasks[taskID].tLearnMoveState = gTasks[taskID].tdata10; @@ -808,8 +800,7 @@ static void Task_EvolutionScene(u8 taskID) { sub_8023AD8(); BattleStringExpandPlaceholdersToDisplayedString(gBattleStringsTable[292]); - Contest_StartTextPrinter( - &gWindowTemplate_Contest_MoveDescription, gDisplayedStringBattle, 144, 2, 15); + Contest_StartTextPrinter(&gWindowTemplate_Contest_MoveDescription, gDisplayedStringBattle, 144, 2, 15); PlaySE(SE_SELECT); gTasks[taskID].tLearnMoveState = gTasks[taskID].tdata10; } @@ -866,8 +857,7 @@ static void Task_EvolutionScene(u8 taskID) if (gWindowTemplate_Contest_MoveDescription.state == 0 && !IsSEPlaying()) { BattleStringExpandPlaceholdersToDisplayedString(gBattleStringsTable[7]); - Contest_StartTextPrinter( - &gWindowTemplate_Contest_MoveDescription, gDisplayedStringBattle, 144, 2, 15); + Contest_StartTextPrinter(&gWindowTemplate_Contest_MoveDescription, gDisplayedStringBattle, 144, 2, 15); gTasks[taskID].tLearnMoveState++; } break; @@ -875,23 +865,20 @@ static void Task_EvolutionScene(u8 taskID) if (gWindowTemplate_Contest_MoveDescription.state == 0 && !IsSEPlaying()) { BattleStringExpandPlaceholdersToDisplayedString(gBattleStringsTable[208]); - Contest_StartTextPrinter( - &gWindowTemplate_Contest_MoveDescription, gDisplayedStringBattle, 144, 2, 15); + Contest_StartTextPrinter(&gWindowTemplate_Contest_MoveDescription, gDisplayedStringBattle, 144, 2, 15); gTasks[taskID].tState = 19; } break; case 9: BattleStringExpandPlaceholdersToDisplayedString(gBattleStringsTable[8]); - Contest_StartTextPrinter( - &gWindowTemplate_Contest_MoveDescription, gDisplayedStringBattle, 144, 2, 15); + Contest_StartTextPrinter(&gWindowTemplate_Contest_MoveDescription, gDisplayedStringBattle, 144, 2, 15); gTasks[taskID].tData9 = 10; gTasks[taskID].tdata10 = 0; gTasks[taskID].tLearnMoveState = 3; break; case 10: BattleStringExpandPlaceholdersToDisplayedString(gBattleStringsTable[9]); - Contest_StartTextPrinter( - &gWindowTemplate_Contest_MoveDescription, gDisplayedStringBattle, 144, 2, 15); + Contest_StartTextPrinter(&gWindowTemplate_Contest_MoveDescription, gDisplayedStringBattle, 144, 2, 15); gTasks[taskID].tState = 14; break; case 11: diff --git a/src/pokedex.c b/src/pokedex.c index 3641ff2a1..77d4ab6e9 100644 --- a/src/pokedex.c +++ b/src/pokedex.c @@ -1365,7 +1365,7 @@ static void ClearPokedexView(struct PokedexView *pokedexView) pokedexView->unk63A[i] = 0; pokedexView->currentPage = 0; pokedexView->currentPageBackup = 0; - pokedexView->isSearchResults = 0; + pokedexView->isSearchResults = FALSE; pokedexView->selectedScreen = 0; pokedexView->screenSwitchState = 0; pokedexView->menuIsOpen = 0; @@ -1495,7 +1495,7 @@ static void MainCB(void) static void Task_PokedexShowMainScreen(u8 taskId) { - gPokedexView->isSearchResults = 0; + gPokedexView->isSearchResults = FALSE; if (LoadPokedexListPage(0)) gTasks[taskId].func = Task_PokedexMainScreen; } @@ -1693,7 +1693,7 @@ static void Task_ClosePokedex(u8 taskId) static void Task_OpenSearchResults(u8 taskId) { - gPokedexView->isSearchResults = 1; + gPokedexView->isSearchResults = TRUE; if (LoadPokedexListPage(3)) gTasks[taskId].func = Task_PokedexResultsScreen; } @@ -1898,9 +1898,9 @@ static bool8 LoadPokedexListPage(u8 a) LZ77UnCompVram(gPokedexStartMenuSearchResults_Tilemap, (void *)(VRAM + 0x6500)); ResetPaletteFade(); if (a == 0) - gPokedexView->isSearchResults = 0; + gPokedexView->isSearchResults = FALSE; else - gPokedexView->isSearchResults = 1; + gPokedexView->isSearchResults = TRUE; LoadPokedexBgPalette(); gMain.state = 1; break; diff --git a/src/pokedex_cry_screen.c b/src/pokedex_cry_screen.c index 749d7d802..ec0de84f8 100644 --- a/src/pokedex_cry_screen.c +++ b/src/pokedex_cry_screen.c @@ -49,13 +49,13 @@ const u16 CryMeterNeedlePalette[] = INCBIN_U16("graphics/pokedex/cry_meter_needl const u8 CryMeterNeedleTiles[] = INCBIN_U8("graphics/pokedex/cry_meter_needle.4bpp"); #if ENGLISH -const u16 sCryMeter_Tilemap[] = INCBIN_U16("graphics/pokedex/cry_meter_map.bin"); -const u16 sCryMeter_Pal[] = INCBIN_U16("graphics/pokedex/cry_meter.gbapal"); -const u8 sCryMeter_Gfx[] = INCBIN_U8("graphics/pokedex/cry_meter.4bpp.lz"); +const u16 gCryMeter_Tilemap[] = INCBIN_U16("graphics/pokedex/cry_meter_map.bin"); +const u16 gCryMeter_Pal[] = INCBIN_U16("graphics/pokedex/cry_meter.gbapal"); +const u8 gCryMeter_Gfx[] = INCBIN_U8("graphics/pokedex/cry_meter.4bpp.lz"); #else -extern const u16 sCryMeter_Tilemap[]; -extern const u16 sCryMeter_Pal[]; -extern const u8 sCryMeter_Gfx[]; +extern const u16 gCryMeter_Tilemap[]; +extern const u16 gCryMeter_Pal[]; +extern const u8 gCryMeter_Gfx[]; #endif // ENGLISH const u16 sWaveformOffsets[][72] = { @@ -448,8 +448,8 @@ bool8 ShowPokedexCryScreen(struct CryScreenWindow *cry, UNUSED u8 arg1) { switch (gDexCryScreenState) { case 0: - LZ77UnCompVram(sCryMeter_Gfx, (void *) (VRAM + cry->charBase)); - LoadPalette(sCryMeter_Pal, cry->paletteNo * 16, 0x20); + LZ77UnCompVram(gCryMeter_Gfx, (void *) (VRAM + cry->charBase)); + LoadPalette(gCryMeter_Pal, cry->paletteNo * 16, 0x20); gDexCryScreenState++; break; @@ -470,7 +470,7 @@ bool8 ShowPokedexCryScreen(struct CryScreenWindow *cry, UNUSED u8 arg1) { { y = row + cry->yPos; x = col + cry->xPos; - *(u16 *) (vram + (y * 64 + x * 2)) = (sCryMeter_Tilemap[row * CRY_METER_MAP_WIDTH + col] | (cry->paletteNo << 12)) + r12; + *(u16 *) (vram + (y * 64 + x * 2)) = (gCryMeter_Tilemap[row * CRY_METER_MAP_WIDTH + col] | (cry->paletteNo << 12)) + r12; } } diff --git a/src/pokemon_menu.c b/src/pokemon_menu.c index dd6b9876d..1beace421 100644 --- a/src/pokemon_menu.c +++ b/src/pokemon_menu.c @@ -51,7 +51,7 @@ extern u8 gUnknown_020297ED; extern u8 gUnknown_020384F0; extern u8 gUnknown_0202E8F4; extern u8 gUnknown_0202E8F5; -extern u8 gPartyMenuMessage_IsPrinting; +extern bool8 gPartyMenuMessage_IsPrinting; extern u8 gPokemonItemUseType; extern u16 gUnknown_0202E8F8; extern void (*gPokemonItemUseCallback)(u8 taskID, u16 itemID, TaskFunc func); diff --git a/src/post_battle_event_funcs.c b/src/post_battle_event_funcs.c index 7c8c37c9e..e1fe1c4e4 100644 --- a/src/post_battle_event_funcs.c +++ b/src/post_battle_event_funcs.c @@ -8,7 +8,7 @@ #include "overworld.h" #include "pokemon.h" -extern u8 gHasHallOfFameRecords; +extern bool8 gHasHallOfFameRecords; int GameClear(void) { diff --git a/src/rom_8077ABC.c b/src/rom_8077ABC.c index e5e70c8a6..09589184e 100644 --- a/src/rom_8077ABC.c +++ b/src/rom_8077ABC.c @@ -220,7 +220,7 @@ u8 sub_8077BFC(u8 slot, u16 species) if (IsContest()) { if (gContestResources__moveAnim.hasTargetAnim) - personality = gContestResources__moveAnim.personality2; + personality = gContestResources__moveAnim.targetPersonality; else personality = gContestResources__moveAnim.personality; } @@ -2000,7 +2000,7 @@ s16 GetBattlerSpriteCoordAttr(u8 slot, u8 a2) if (gContestResources__moveAnim.hasTargetAnim) { species = gContestResources__moveAnim.targetSpecies; - personality = gContestResources__moveAnim.personality2; + personality = gContestResources__moveAnim.targetPersonality; } else { diff --git a/src/roulette_gfx.c b/src/roulette_gfx.c index 1abdade7e..cf347f1ea 100644 --- a/src/roulette_gfx.c +++ b/src/roulette_gfx.c @@ -830,8 +830,8 @@ void sub_8117C60(u8 r0, u8 r1) else { gSprites[eRoulette->var3C[49 + i]].invisible = FALSE; - gSprites[eRoulette->var3C[49 + i]].x = (gUnknown_083F8C00[eRoulette->var0C[i]].var03 + 1) * 8 + 4; - gSprites[eRoulette->var3C[49 + i]].y = (gUnknown_083F8C00[eRoulette->var0C[i]].var04 + 1) * 8 + 3; + gSprites[eRoulette->var3C[49 + i]].x = (gUnknown_083F8C00[eRoulette->var0C[i]].var03 + 1) * 8 + 4; + gSprites[eRoulette->var3C[49 + i]].y = (gUnknown_083F8C00[eRoulette->var0C[i]].var04 + 1) * 8 + 3; } } } diff --git a/src/scrcmd.c b/src/scrcmd.c index c51bd2b10..1b6aea42f 100644 --- a/src/scrcmd.c +++ b/src/scrcmd.c @@ -3,7 +3,6 @@ #include "berry.h" #include "clock.h" #include "coins.h" -#include "constants/maps.h" #include "contest_link_util.h" #include "contest_painting.h" #include "contest_util.h" @@ -43,6 +42,7 @@ #include "sound.h" #include "string_util.h" #include "tv.h" +#include "constants/maps.h" typedef u16 (*SpecialFunc)(void); typedef void (*NativeFunc)(void); diff --git a/src/shop.c b/src/shop.c index 75d54e459..34086958e 100644 --- a/src/shop.c +++ b/src/shop.c @@ -498,8 +498,7 @@ static void BuyMenuDrawTextboxBG_Restore(void) for (i = 0; i < 8; i++) for (j = 0; j < 14; j++) - gBGTilemapBuffers[1][32 * (i + 12) + j] = - ewram18000[0x180 + 32 * i + j] + 0xC3E0; + gBGTilemapBuffers[1][32 * (i + 12) + j] = ewram18000[0x180 + 32 * i + j] + 0xC3E0; } static void Shop_PrintItemDesc(void) @@ -2195,7 +2195,7 @@ void sub_80C04A0(void); void sub_80C01D4(void); void sub_80C0408(void); -void ReceiveTvShowsData(u8 * arg0, u32 arg1 , u8 arg2) +void ReceiveTvShowsData(u8 * arg0, u32 arg1, u8 arg2) { u8 i; union TVShow (*tvShows)[TV_SHOWS_COUNT]; |