diff --git a/data/battle_scripts_1.s b/data/battle_scripts_1.s index 8dd80c915..880957859 100644 --- a/data/battle_scripts_1.s +++ b/data/battle_scripts_1.s @@ -490,7 +490,7 @@ BattleScript_EffectStatUp:: BattleScript_EffectStatUpAfterAtkCanceler:: attackstring ppreduce - statbuffchange MOVE_EFFECT_AFFECTS_USER | STAT_BUFF_ALLOW_PTR, BattleScript_StatUpEnd + statbuffchange MOVE_EFFECT_AFFECTS_USER | STAT_CHANGE_ALLOW_PTR, BattleScript_StatUpEnd jumpifbyte CMP_NOT_EQUAL, cMULTISTRING_CHOOSER, B_MSG_STAT_WONT_INCREASE, BattleScript_StatUpAttackAnim pause B_WAIT_TIME_SHORT goto BattleScript_StatUpPrintString @@ -536,7 +536,7 @@ BattleScript_EffectStatDown:: accuracycheck BattleScript_PrintMoveMissed, ACC_CURR_MOVE attackstring ppreduce - statbuffchange STAT_BUFF_ALLOW_PTR, BattleScript_StatDownEnd + statbuffchange STAT_CHANGE_ALLOW_PTR, BattleScript_StatDownEnd jumpifbyte CMP_LESS_THAN, cMULTISTRING_CHOOSER, B_MSG_STAT_WONT_DECREASE, BattleScript_StatDownDoAnim jumpifbyte CMP_EQUAL, cMULTISTRING_CHOOSER, B_MSG_STAT_FELL_EMPTY, BattleScript_StatDownEnd pause B_WAIT_TIME_SHORT @@ -1492,17 +1492,17 @@ BattleScript_CurseTrySpeed:: attackanimation waitanimation setstatchanger STAT_SPEED, 1, TRUE - statbuffchange MOVE_EFFECT_AFFECTS_USER | STAT_BUFF_ALLOW_PTR, BattleScript_CurseTryAttack + statbuffchange MOVE_EFFECT_AFFECTS_USER | STAT_CHANGE_ALLOW_PTR, BattleScript_CurseTryAttack printfromtable gStatDownStringIds waitmessage B_WAIT_TIME_LONG BattleScript_CurseTryAttack:: setstatchanger STAT_ATK, 1, FALSE - statbuffchange MOVE_EFFECT_AFFECTS_USER | STAT_BUFF_ALLOW_PTR, BattleScript_CurseTryDefense + statbuffchange MOVE_EFFECT_AFFECTS_USER | STAT_CHANGE_ALLOW_PTR, BattleScript_CurseTryDefense printfromtable gStatUpStringIds waitmessage B_WAIT_TIME_LONG BattleScript_CurseTryDefense:: setstatchanger STAT_DEF, 1, FALSE - statbuffchange MOVE_EFFECT_AFFECTS_USER | STAT_BUFF_ALLOW_PTR, BattleScript_CurseEnd + statbuffchange MOVE_EFFECT_AFFECTS_USER | STAT_CHANGE_ALLOW_PTR, BattleScript_CurseEnd printfromtable gStatUpStringIds waitmessage B_WAIT_TIME_LONG BattleScript_CurseEnd:: @@ -1614,7 +1614,7 @@ BattleScript_EffectSwagger:: attackanimation waitanimation setstatchanger STAT_ATK, 2, FALSE - statbuffchange STAT_BUFF_ALLOW_PTR, BattleScript_SwaggerTryConfuse + statbuffchange STAT_CHANGE_ALLOW_PTR, BattleScript_SwaggerTryConfuse jumpifbyte CMP_EQUAL, cMULTISTRING_CHOOSER, B_MSG_STAT_WONT_INCREASE, BattleScript_SwaggerTryConfuse setgraphicalstatchangevalues playanimation BS_TARGET, B_ANIM_STATS_CHANGE, sB_ANIM_ARG1 @@ -1813,7 +1813,7 @@ BattleScript_EffectSkullBash:: setbyte sTWOTURN_STRINGID, B_MSG_TURN1_SKULL_BASH call BattleScriptFirstChargingTurn setstatchanger STAT_DEF, 1, FALSE - statbuffchange MOVE_EFFECT_AFFECTS_USER | STAT_BUFF_ALLOW_PTR, BattleScript_SkullBashEnd + statbuffchange MOVE_EFFECT_AFFECTS_USER | STAT_CHANGE_ALLOW_PTR, BattleScript_SkullBashEnd jumpifbyte CMP_EQUAL, cMULTISTRING_CHOOSER, B_MSG_STAT_WONT_INCREASE, BattleScript_SkullBashEnd setgraphicalstatchangevalues playanimation BS_ATTACKER, B_ANIM_STATS_CHANGE, sB_ANIM_ARG1 @@ -2016,7 +2016,7 @@ BattleScript_EffectDefenseCurl:: ppreduce setdefensecurlbit setstatchanger STAT_DEF, 1, FALSE - statbuffchange MOVE_EFFECT_AFFECTS_USER | STAT_BUFF_ALLOW_PTR, BattleScript_DefenseCurlDoStatUpAnim + statbuffchange MOVE_EFFECT_AFFECTS_USER | STAT_CHANGE_ALLOW_PTR, BattleScript_DefenseCurlDoStatUpAnim jumpifbyte CMP_EQUAL, cMULTISTRING_CHOOSER, B_MSG_STAT_WONT_INCREASE, BattleScript_StatUpPrintString attackanimation waitanimation @@ -2157,7 +2157,7 @@ BattleScript_EffectFlatter:: attackanimation waitanimation setstatchanger STAT_SPATK, 1, FALSE - statbuffchange STAT_BUFF_ALLOW_PTR, BattleScript_FlatterTryConfuse + statbuffchange STAT_CHANGE_ALLOW_PTR, BattleScript_FlatterTryConfuse jumpifbyte CMP_EQUAL, cMULTISTRING_CHOOSER, B_MSG_STAT_WONT_INCREASE, BattleScript_FlatterTryConfuse setgraphicalstatchangevalues playanimation BS_TARGET, B_ANIM_STATS_CHANGE, sB_ANIM_ARG1 @@ -2214,7 +2214,7 @@ BattleScript_EffectMemento:: playstatchangeanimation BS_TARGET, BIT_ATK | BIT_SPATK, STAT_CHANGE_NEGATIVE | STAT_CHANGE_BY_TWO | STAT_CHANGE_MULTIPLE_STATS playstatchangeanimation BS_TARGET, BIT_ATK, STAT_CHANGE_NEGATIVE | STAT_CHANGE_BY_TWO setstatchanger STAT_ATK, 2, TRUE - statbuffchange STAT_BUFF_ALLOW_PTR, BattleScript_EffectMementoTrySpAtk + statbuffchange STAT_CHANGE_ALLOW_PTR, BattleScript_EffectMementoTrySpAtk @ Greater than B_MSG_DEFENDER_STAT_FELL is checking if the stat cannot decrease jumpifbyte CMP_GREATER_THAN, cMULTISTRING_CHOOSER, B_MSG_DEFENDER_STAT_FELL, BattleScript_EffectMementoTrySpAtk printfromtable gStatDownStringIds @@ -2222,7 +2222,7 @@ BattleScript_EffectMemento:: BattleScript_EffectMementoTrySpAtk: playstatchangeanimation BS_TARGET, BIT_SPATK, STAT_CHANGE_NEGATIVE | STAT_CHANGE_BY_TWO setstatchanger STAT_SPATK, 2, TRUE - statbuffchange STAT_BUFF_ALLOW_PTR, BattleScript_EffectMementoTryFaint + statbuffchange STAT_CHANGE_ALLOW_PTR, BattleScript_EffectMementoTryFaint @ Greater than B_MSG_DEFENDER_STAT_FELL is checking if the stat cannot decrease jumpifbyte CMP_GREATER_THAN, cMULTISTRING_CHOOSER, B_MSG_DEFENDER_STAT_FELL, BattleScript_EffectMementoTryFaint printfromtable gStatDownStringIds @@ -2662,14 +2662,14 @@ BattleScript_TickleDoMoveAnim:: playstatchangeanimation BS_TARGET, BIT_ATK | BIT_DEF, STAT_CHANGE_NEGATIVE | STAT_CHANGE_MULTIPLE_STATS playstatchangeanimation BS_TARGET, BIT_ATK, STAT_CHANGE_NEGATIVE setstatchanger STAT_ATK, 1, TRUE - statbuffchange STAT_BUFF_ALLOW_PTR, BattleScript_TickleTryLowerDef + statbuffchange STAT_CHANGE_ALLOW_PTR, BattleScript_TickleTryLowerDef jumpifbyte CMP_EQUAL, cMULTISTRING_CHOOSER, B_MSG_STAT_WONT_DECREASE, BattleScript_TickleTryLowerDef printfromtable gStatDownStringIds waitmessage B_WAIT_TIME_LONG BattleScript_TickleTryLowerDef:: playstatchangeanimation BS_TARGET, BIT_DEF, STAT_CHANGE_NEGATIVE setstatchanger STAT_DEF, 1, TRUE - statbuffchange STAT_BUFF_ALLOW_PTR, BattleScript_TickleEnd + statbuffchange STAT_CHANGE_ALLOW_PTR, BattleScript_TickleEnd jumpifbyte CMP_EQUAL, cMULTISTRING_CHOOSER, B_MSG_STAT_WONT_DECREASE, BattleScript_TickleEnd printfromtable gStatDownStringIds waitmessage B_WAIT_TIME_LONG @@ -2695,13 +2695,13 @@ BattleScript_CosmicPowerDoMoveAnim:: setbyte sSTAT_ANIM_PLAYED, FALSE playstatchangeanimation BS_ATTACKER, BIT_DEF | BIT_SPDEF, 0 setstatchanger STAT_DEF, 1, FALSE - statbuffchange MOVE_EFFECT_AFFECTS_USER | STAT_BUFF_ALLOW_PTR, BattleScript_CosmicPowerTrySpDef + statbuffchange MOVE_EFFECT_AFFECTS_USER | STAT_CHANGE_ALLOW_PTR, BattleScript_CosmicPowerTrySpDef jumpifbyte CMP_EQUAL, cMULTISTRING_CHOOSER, B_MSG_STAT_WONT_INCREASE, BattleScript_CosmicPowerTrySpDef printfromtable gStatUpStringIds waitmessage B_WAIT_TIME_LONG BattleScript_CosmicPowerTrySpDef:: setstatchanger STAT_SPDEF, 1, FALSE - statbuffchange MOVE_EFFECT_AFFECTS_USER | STAT_BUFF_ALLOW_PTR, BattleScript_CosmicPowerEnd + statbuffchange MOVE_EFFECT_AFFECTS_USER | STAT_CHANGE_ALLOW_PTR, BattleScript_CosmicPowerEnd jumpifbyte CMP_EQUAL, cMULTISTRING_CHOOSER, B_MSG_STAT_WONT_INCREASE, BattleScript_CosmicPowerEnd printfromtable gStatUpStringIds waitmessage B_WAIT_TIME_LONG @@ -2724,13 +2724,13 @@ BattleScript_BulkUpDoMoveAnim:: setbyte sSTAT_ANIM_PLAYED, FALSE playstatchangeanimation BS_ATTACKER, BIT_ATK | BIT_DEF, 0 setstatchanger STAT_ATK, 1, FALSE - statbuffchange MOVE_EFFECT_AFFECTS_USER | STAT_BUFF_ALLOW_PTR, BattleScript_BulkUpTryDef + statbuffchange MOVE_EFFECT_AFFECTS_USER | STAT_CHANGE_ALLOW_PTR, BattleScript_BulkUpTryDef jumpifbyte CMP_EQUAL, cMULTISTRING_CHOOSER, B_MSG_STAT_WONT_INCREASE, BattleScript_BulkUpTryDef printfromtable gStatUpStringIds waitmessage B_WAIT_TIME_LONG BattleScript_BulkUpTryDef:: setstatchanger STAT_DEF, 1, FALSE - statbuffchange MOVE_EFFECT_AFFECTS_USER | STAT_BUFF_ALLOW_PTR, BattleScript_BulkUpEnd + statbuffchange MOVE_EFFECT_AFFECTS_USER | STAT_CHANGE_ALLOW_PTR, BattleScript_BulkUpEnd jumpifbyte CMP_EQUAL, cMULTISTRING_CHOOSER, B_MSG_STAT_WONT_INCREASE, BattleScript_BulkUpEnd printfromtable gStatUpStringIds waitmessage B_WAIT_TIME_LONG @@ -2749,13 +2749,13 @@ BattleScript_CalmMindDoMoveAnim:: setbyte sSTAT_ANIM_PLAYED, FALSE playstatchangeanimation BS_ATTACKER, BIT_SPATK | BIT_SPDEF, 0 setstatchanger STAT_SPATK, 1, FALSE - statbuffchange MOVE_EFFECT_AFFECTS_USER | STAT_BUFF_ALLOW_PTR, BattleScript_CalmMindTrySpDef + statbuffchange MOVE_EFFECT_AFFECTS_USER | STAT_CHANGE_ALLOW_PTR, BattleScript_CalmMindTrySpDef jumpifbyte CMP_EQUAL, cMULTISTRING_CHOOSER, B_MSG_STAT_WONT_INCREASE, BattleScript_CalmMindTrySpDef printfromtable gStatUpStringIds waitmessage B_WAIT_TIME_LONG BattleScript_CalmMindTrySpDef:: setstatchanger STAT_SPDEF, 1, FALSE - statbuffchange MOVE_EFFECT_AFFECTS_USER | STAT_BUFF_ALLOW_PTR, BattleScript_CalmMindEnd + statbuffchange MOVE_EFFECT_AFFECTS_USER | STAT_CHANGE_ALLOW_PTR, BattleScript_CalmMindEnd jumpifbyte CMP_EQUAL, cMULTISTRING_CHOOSER, B_MSG_STAT_WONT_INCREASE, BattleScript_CalmMindEnd printfromtable gStatUpStringIds waitmessage B_WAIT_TIME_LONG @@ -2781,13 +2781,13 @@ BattleScript_DragonDanceDoMoveAnim:: setbyte sSTAT_ANIM_PLAYED, FALSE playstatchangeanimation BS_ATTACKER, BIT_ATK | BIT_SPEED, 0 setstatchanger STAT_ATK, 1, FALSE - statbuffchange MOVE_EFFECT_AFFECTS_USER | STAT_BUFF_ALLOW_PTR, BattleScript_DragonDanceTrySpeed + statbuffchange MOVE_EFFECT_AFFECTS_USER | STAT_CHANGE_ALLOW_PTR, BattleScript_DragonDanceTrySpeed jumpifbyte CMP_EQUAL, cMULTISTRING_CHOOSER, B_MSG_STAT_WONT_INCREASE, BattleScript_DragonDanceTrySpeed printfromtable gStatUpStringIds waitmessage B_WAIT_TIME_LONG BattleScript_DragonDanceTrySpeed:: setstatchanger STAT_SPEED, 1, FALSE - statbuffchange MOVE_EFFECT_AFFECTS_USER | STAT_BUFF_ALLOW_PTR, BattleScript_DragonDanceEnd + statbuffchange MOVE_EFFECT_AFFECTS_USER | STAT_CHANGE_ALLOW_PTR, BattleScript_DragonDanceEnd jumpifbyte CMP_EQUAL, cMULTISTRING_CHOOSER, B_MSG_STAT_WONT_INCREASE, BattleScript_DragonDanceEnd printfromtable gStatUpStringIds waitmessage B_WAIT_TIME_LONG @@ -3458,27 +3458,27 @@ BattleScript_AllStatsUpAtk:: setbyte sSTAT_ANIM_PLAYED, FALSE playstatchangeanimation BS_ATTACKER, BIT_ATK | BIT_DEF | BIT_SPEED | BIT_SPATK | BIT_SPDEF, 0 setstatchanger STAT_ATK, 1, FALSE - statbuffchange MOVE_EFFECT_AFFECTS_USER | STAT_BUFF_ALLOW_PTR, BattleScript_AllStatsUpDef + statbuffchange MOVE_EFFECT_AFFECTS_USER | STAT_CHANGE_ALLOW_PTR, BattleScript_AllStatsUpDef printfromtable gStatUpStringIds waitmessage B_WAIT_TIME_LONG BattleScript_AllStatsUpDef:: setstatchanger STAT_DEF, 1, FALSE - statbuffchange MOVE_EFFECT_AFFECTS_USER | STAT_BUFF_ALLOW_PTR, BattleScript_AllStatsUpSpeed + statbuffchange MOVE_EFFECT_AFFECTS_USER | STAT_CHANGE_ALLOW_PTR, BattleScript_AllStatsUpSpeed printfromtable gStatUpStringIds waitmessage B_WAIT_TIME_LONG BattleScript_AllStatsUpSpeed:: setstatchanger STAT_SPEED, 1, FALSE - statbuffchange MOVE_EFFECT_AFFECTS_USER | STAT_BUFF_ALLOW_PTR, BattleScript_AllStatsUpSpAtk + statbuffchange MOVE_EFFECT_AFFECTS_USER | STAT_CHANGE_ALLOW_PTR, BattleScript_AllStatsUpSpAtk printfromtable gStatUpStringIds waitmessage B_WAIT_TIME_LONG BattleScript_AllStatsUpSpAtk:: setstatchanger STAT_SPATK, 1, FALSE - statbuffchange MOVE_EFFECT_AFFECTS_USER | STAT_BUFF_ALLOW_PTR, BattleScript_AllStatsUpSpDef + statbuffchange MOVE_EFFECT_AFFECTS_USER | STAT_CHANGE_ALLOW_PTR, BattleScript_AllStatsUpSpDef printfromtable gStatUpStringIds waitmessage B_WAIT_TIME_LONG BattleScript_AllStatsUpSpDef:: setstatchanger STAT_SPDEF, 1, FALSE - statbuffchange MOVE_EFFECT_AFFECTS_USER | STAT_BUFF_ALLOW_PTR, BattleScript_AllStatsUpRet + statbuffchange MOVE_EFFECT_AFFECTS_USER | STAT_CHANGE_ALLOW_PTR, BattleScript_AllStatsUpRet printfromtable gStatUpStringIds waitmessage B_WAIT_TIME_LONG BattleScript_AllStatsUpRet:: @@ -3625,14 +3625,14 @@ BattleScript_AtkDefDown:: playstatchangeanimation BS_ATTACKER, BIT_DEF | BIT_ATK, STAT_CHANGE_CANT_PREVENT | STAT_CHANGE_NEGATIVE | STAT_CHANGE_MULTIPLE_STATS playstatchangeanimation BS_ATTACKER, BIT_ATK, STAT_CHANGE_CANT_PREVENT | STAT_CHANGE_NEGATIVE setstatchanger STAT_ATK, 1, TRUE - statbuffchange MOVE_EFFECT_AFFECTS_USER | MOVE_EFFECT_CERTAIN | STAT_BUFF_ALLOW_PTR, BattleScript_AtkDefDown_TryDef + statbuffchange MOVE_EFFECT_AFFECTS_USER | MOVE_EFFECT_CERTAIN | STAT_CHANGE_ALLOW_PTR, BattleScript_AtkDefDown_TryDef jumpifbyte CMP_EQUAL, cMULTISTRING_CHOOSER, B_MSG_STAT_WONT_DECREASE, BattleScript_AtkDefDown_TryDef printfromtable gStatDownStringIds waitmessage B_WAIT_TIME_LONG BattleScript_AtkDefDown_TryDef:: playstatchangeanimation BS_ATTACKER, BIT_DEF, STAT_CHANGE_CANT_PREVENT | STAT_CHANGE_NEGATIVE setstatchanger STAT_DEF, 1, TRUE - statbuffchange MOVE_EFFECT_AFFECTS_USER | MOVE_EFFECT_CERTAIN | STAT_BUFF_ALLOW_PTR, BattleScript_AtkDefDown_End + statbuffchange MOVE_EFFECT_AFFECTS_USER | MOVE_EFFECT_CERTAIN | STAT_CHANGE_ALLOW_PTR, BattleScript_AtkDefDown_End jumpifbyte CMP_EQUAL, cMULTISTRING_CHOOSER, B_MSG_STAT_WONT_DECREASE, BattleScript_AtkDefDown_End printfromtable gStatDownStringIds waitmessage B_WAIT_TIME_LONG @@ -3698,7 +3698,7 @@ BattleScript_SAtkDown2:: setbyte sSTAT_ANIM_PLAYED, FALSE playstatchangeanimation BS_ATTACKER, BIT_SPATK, STAT_CHANGE_CANT_PREVENT | STAT_CHANGE_NEGATIVE | STAT_CHANGE_BY_TWO setstatchanger STAT_SPATK, 2, TRUE - statbuffchange MOVE_EFFECT_AFFECTS_USER | MOVE_EFFECT_CERTAIN | STAT_BUFF_ALLOW_PTR, BattleScript_SAtkDown2End + statbuffchange MOVE_EFFECT_AFFECTS_USER | MOVE_EFFECT_CERTAIN | STAT_CHANGE_ALLOW_PTR, BattleScript_SAtkDown2End jumpifbyte CMP_EQUAL, cMULTISTRING_CHOOSER, B_MSG_STAT_WONT_DECREASE, BattleScript_SAtkDown2End printfromtable gStatDownStringIds waitmessage B_WAIT_TIME_LONG @@ -4029,7 +4029,7 @@ BattleScript_IntimidateActivatesLoop: jumpifability BS_TARGET, ABILITY_CLEAR_BODY, BattleScript_IntimidatePrevented jumpifability BS_TARGET, ABILITY_HYPER_CUTTER, BattleScript_IntimidatePrevented jumpifability BS_TARGET, ABILITY_WHITE_SMOKE, BattleScript_IntimidatePrevented - statbuffchange STAT_BUFF_NOT_PROTECT_AFFECTED | STAT_BUFF_ALLOW_PTR, BattleScript_IntimidateActivatesLoopIncrement + statbuffchange STAT_CHANGE_NOT_PROTECT_AFFECTED | STAT_CHANGE_ALLOW_PTR, BattleScript_IntimidateActivatesLoopIncrement jumpifbyte CMP_GREATER_THAN, cMULTISTRING_CHOOSER, 1, BattleScript_IntimidateActivatesLoopIncrement setgraphicalstatchangevalues playanimation BS_TARGET, B_ANIM_STATS_CHANGE, sB_ANIM_ARG1 @@ -4408,7 +4408,7 @@ BattleScript_BerryConfuseHealEnd2:: BattleScript_BerryStatRaiseEnd2:: playanimation BS_ATTACKER, B_ANIM_HELD_ITEM_EFFECT - statbuffchange MOVE_EFFECT_AFFECTS_USER | STAT_BUFF_ALLOW_PTR, BattleScript_BerryStatRaiseDoStatUp + statbuffchange MOVE_EFFECT_AFFECTS_USER | STAT_CHANGE_ALLOW_PTR, BattleScript_BerryStatRaiseDoStatUp BattleScript_BerryStatRaiseDoStatUp:: setbyte cMULTISTRING_CHOOSER, B_MSG_STAT_ROSE_ITEM call BattleScript_StatUp diff --git a/gflib/bg.c b/gflib/bg.c index 6e97be207..4b0379de0 100644 --- a/gflib/bg.c +++ b/gflib/bg.c @@ -33,7 +33,7 @@ struct BgConfig2 u32 basePalette:4; u32 unk_3:18; - void* tilemap; + void *tilemap; s32 bg_x; s32 bg_y; }; @@ -183,14 +183,14 @@ u8 LoadBgVram(u8 bg, const void *src, u16 size, u16 destOffset, u8 mode) case 0x1: offset = sGpuBgConfigs.configs[bg].charBaseIndex * BG_CHAR_SIZE; offset = destOffset + offset; - cursor = RequestDma3Copy(src, (void*)(offset + BG_VRAM), size, 0); + cursor = RequestDma3Copy(src, (void *)(offset + BG_VRAM), size, 0); if (cursor == -1) return -1; break; case 0x2: offset = sGpuBgConfigs.configs[bg].mapBaseIndex * BG_SCREEN_SIZE; offset = destOffset + offset; - cursor = RequestDma3Copy(src, (void*)(offset + BG_VRAM), size, 0); + cursor = RequestDma3Copy(src, (void *)(offset + BG_VRAM), size, 0); if (cursor == -1) return -1; break; @@ -372,7 +372,7 @@ void SetBgMode(u8 bgMode) SetBgModeInternal(bgMode); } -u16 LoadBgTiles(u8 bg, const void* src, u16 size, u16 destOffset) +u16 LoadBgTiles(u8 bg, const void *src, u16 size, u16 destOffset) { u16 tileOffset; u8 cursor; @@ -422,7 +422,7 @@ u16 Unused_LoadBgPalette(u8 bg, const void *src, u16 size, u16 destOffset) if (!IsInvalidBg32(bg)) { u16 paletteOffset = (sGpuBgConfigs2[bg].basePalette * 0x20) + (destOffset * 2); - cursor = RequestDma3Copy(src, (void*)(paletteOffset + BG_PLTT), size, 0); + cursor = RequestDma3Copy(src, (void *)(paletteOffset + BG_PLTT), size, 0); if (cursor == -1) { @@ -863,7 +863,7 @@ void UnsetBgTilemapBuffer(u8 bg) } } -void* GetBgTilemapBuffer(u8 bg) +void *GetBgTilemapBuffer(u8 bg) { if (IsInvalidBg32(bg)) return NULL; @@ -906,7 +906,7 @@ void CopyBgTilemapBufferToVram(u8 bg) } } -void CopyToBgTilemapBufferRect(u8 bg, const void* src, u8 destX, u8 destY, u8 width, u8 height) +void CopyToBgTilemapBufferRect(u8 bg, const void *src, u8 destX, u8 destY, u8 width, u8 height) { u16 destX16; u16 destY16; @@ -923,7 +923,7 @@ void CopyToBgTilemapBufferRect(u8 bg, const void* src, u8 destX, u8 destY, u8 wi { for (destX16 = destX; destX16 < (destX + width); destX16++) { - ((u16*)sGpuBgConfigs2[bg].tilemap)[((destY16 * 0x20) + destX16)] = *srcCopy++; + ((u16 *)sGpuBgConfigs2[bg].tilemap)[((destY16 * 0x20) + destX16)] = *srcCopy++; } } break; @@ -936,7 +936,7 @@ void CopyToBgTilemapBufferRect(u8 bg, const void* src, u8 destX, u8 destY, u8 wi { for (destX16 = destX; destX16 < (destX + width); destX16++) { - ((u8*)sGpuBgConfigs2[bg].tilemap)[((destY16 * mode) + destX16)] = *srcCopy++; + ((u8 *)sGpuBgConfigs2[bg].tilemap)[((destY16 * mode) + destX16)] = *srcCopy++; } } break; @@ -984,7 +984,7 @@ void CopyRectToBgTilemapBufferRect(u8 bg, const void *src, u8 srcX, u8 srcY, u8 { for (j = destX; j < (destX + rectWidth); j++) { - *(u8*)(sGpuBgConfigs2[bg].tilemap + ((var * i) + j)) = *(u8*)(srcPtr) + tileOffset; + *(u8 *)(sGpuBgConfigs2[bg].tilemap + ((var * i) + j)) = *(u8 *)(srcPtr) + tileOffset; srcPtr++; } srcPtr += (srcWidth - rectWidth); @@ -1009,7 +1009,7 @@ void FillBgTilemapBufferRect_Palette0(u8 bg, u16 tileNum, u8 x, u8 y, u8 width, { for (x16 = x; x16 < (x + width); x16++) { - ((u16*)sGpuBgConfigs2[bg].tilemap)[((y16 * 0x20) + x16)] = tileNum; + ((u16 *)sGpuBgConfigs2[bg].tilemap)[((y16 * 0x20) + x16)] = tileNum; } } break; @@ -1019,7 +1019,7 @@ void FillBgTilemapBufferRect_Palette0(u8 bg, u16 tileNum, u8 x, u8 y, u8 width, { for (x16 = x; x16 < (x + width); x16++) { - ((u8*)sGpuBgConfigs2[bg].tilemap)[((y16 * mode) + x16)] = tileNum; + ((u8 *)sGpuBgConfigs2[bg].tilemap)[((y16 * mode) + x16)] = tileNum; } } break; @@ -1052,7 +1052,7 @@ void WriteSequenceToBgTilemapBuffer(u8 bg, u16 firstTileNum, u8 x, u8 y, u8 widt { for (x16 = x; x16 < (x + width); x16++) { - CopyTileMapEntry(&firstTileNum, &((u16*)sGpuBgConfigs2[bg].tilemap)[(u16)GetTileMapIndexFromCoords(x16, y16, attribute, mode, mode2)], paletteSlot, 0, 0); + CopyTileMapEntry(&firstTileNum, &((u16 *)sGpuBgConfigs2[bg].tilemap)[(u16)GetTileMapIndexFromCoords(x16, y16, attribute, mode, mode2)], paletteSlot, 0, 0); firstTileNum = (firstTileNum & (MAPGRID_COLLISION_MASK | MAPGRID_ELEVATION_MASK)) + ((firstTileNum + tileNumDelta) & MAPGRID_METATILE_ID_MASK); } } @@ -1063,7 +1063,7 @@ void WriteSequenceToBgTilemapBuffer(u8 bg, u16 firstTileNum, u8 x, u8 y, u8 widt { for (x16 = x; x16 < (x + width); x16++) { - ((u8*)sGpuBgConfigs2[bg].tilemap)[(y16 * mode3) + x16] = firstTileNum; + ((u8 *)sGpuBgConfigs2[bg].tilemap)[(y16 * mode3) + x16] = firstTileNum; firstTileNum = (firstTileNum & (MAPGRID_COLLISION_MASK | MAPGRID_ELEVATION_MASK)) + ((firstTileNum + tileNumDelta) & MAPGRID_METATILE_ID_MASK); } } @@ -1240,7 +1240,7 @@ bool32 IsInvalidBg32(u8 bg) bool32 IsTileMapOutsideWram(u8 bg) { - if (sGpuBgConfigs2[bg].tilemap > (void*)IWRAM_END) + if (sGpuBgConfigs2[bg].tilemap > (void *)IWRAM_END) return TRUE; else if (sGpuBgConfigs2[bg].tilemap == NULL) return TRUE; diff --git a/gflib/bg.h b/gflib/bg.h index 02ff07369..4b9744561 100644 --- a/gflib/bg.h +++ b/gflib/bg.h @@ -62,7 +62,7 @@ void ResetBgsAndClearDma3BusyFlags(u32 leftoverFireRedLeafGreenVariable); void InitBgsFromTemplates(u8 bgMode, const struct BgTemplate *templates, u8 numTemplates); void InitBgFromTemplate(const struct BgTemplate *template); void SetBgMode(u8 bgMode); -u16 LoadBgTiles(u8 bg, const void* src, u16 size, u16 destOffset); +u16 LoadBgTiles(u8 bg, const void *src, u16 size, u16 destOffset); u16 LoadBgTilemap(u8 bg, const void *src, u16 size, u16 destOffset); u16 Unused_LoadBgPalette(u8 bg, const void *src, u16 size, u16 destOffset); bool8 IsDma3ManagerBusyWithBgCopy(void); @@ -79,10 +79,10 @@ void SetBgAffine(u8 bg, s32 srcCenterX, s32 srcCenterY, s16 dispCenterX, s16 dis u8 Unused_AdjustBgMosaic(u8 val, u8 mode); void SetBgTilemapBuffer(u8 bg, void *tilemap); void UnsetBgTilemapBuffer(u8 bg); -void* GetBgTilemapBuffer(u8 bg); +void *GetBgTilemapBuffer(u8 bg); void CopyToBgTilemapBuffer(u8 bg, const void *src, u16 mode, u16 destOffset); void CopyBgTilemapBufferToVram(u8 bg); -void CopyToBgTilemapBufferRect(u8 bg, const void* src, u8 destX, u8 destY, u8 width, u8 height); +void CopyToBgTilemapBufferRect(u8 bg, const void *src, u8 destX, u8 destY, u8 width, u8 height); void CopyToBgTilemapBufferRect_ChangePalette(u8 bg, const void *src, u8 destX, u8 destY, u8 rectWidth, u8 rectHeight, u8 palette); void CopyRectToBgTilemapBufferRect(u8 bg, const void *src, u8 srcX, u8 srcY, u8 srcWidth, u8 srcHeight, u8 destX, u8 destY, u8 rectWidth, u8 rectHeight, u8 palette1, s16 tileOffset, s16 palette2); void FillBgTilemapBufferRect_Palette0(u8 bg, u16 tileNum, u8 x, u8 y, u8 width, u8 height); diff --git a/gflib/sprite.c b/gflib/sprite.c index e5bf89063..28b33dfff 100644 --- a/gflib/sprite.c +++ b/gflib/sprite.c @@ -94,7 +94,7 @@ static void ApplyAffineAnimFrame(u8 matrixNum, struct AffineAnimFrameCmd *frameC static u8 IndexOfSpriteTileTag(u16 tag); static void AllocSpriteTileRange(u16 tag, u16 start, u16 count); static void DoLoadSpritePalette(const u16 *src, u16 paletteOffset); -static void UpdateSpriteMatrixAnchorPos(struct Sprite*, s32, s32); +static void UpdateSpriteMatrixAnchorPos(struct Sprite *, s32, s32); typedef void (*AnimFunc)(struct Sprite *); typedef void (*AnimCmdFunc)(struct Sprite *); @@ -1201,7 +1201,7 @@ u8 GetSpriteMatrixNum(struct Sprite *sprite) // Used to shift a sprite's position as it scales. // Only used by the minigame countdown, so that for instance the numbers don't slide up as they squish down before jumping. -void SetSpriteMatrixAnchor(struct Sprite* sprite, s16 x, s16 y) +void SetSpriteMatrixAnchor(struct Sprite *sprite, s16 x, s16 y) { sprite->sAnchorX = x; sprite->sAnchorY = y; diff --git a/gflib/sprite.h b/gflib/sprite.h index f7ef16532..86527bc4c 100644 --- a/gflib/sprite.h +++ b/gflib/sprite.h @@ -282,7 +282,7 @@ void FreeSpritePalette(struct Sprite *sprite); void FreeSpriteOamMatrix(struct Sprite *sprite); void DestroySpriteAndFreeResources(struct Sprite *sprite); void AnimateSprite(struct Sprite *sprite); -void SetSpriteMatrixAnchor(struct Sprite* sprite, s16 x, s16 y); +void SetSpriteMatrixAnchor(struct Sprite *sprite, s16 x, s16 y); void StartSpriteAnim(struct Sprite *sprite, u8 animNum); void StartSpriteAnimIfDifferent(struct Sprite *sprite, u8 animNum); void SeekSpriteAnim(struct Sprite *sprite, u8 animCmdIndex); diff --git a/gflib/text.c b/gflib/text.c index c400c0582..c7efdccce 100644 --- a/gflib/text.c +++ b/gflib/text.c @@ -652,7 +652,7 @@ void ClearTextSpan(struct TextPrinter *textPrinter, u32 width) struct Window *window; struct Bitmap pixels_data; struct TextGlyph *glyph; - u8* glyphHeight; + u8 *glyphHeight; if (sLastTextBgColor != TEXT_COLOR_TRANSPARENT) { @@ -1684,7 +1684,7 @@ u8 GetMenuCursorDimensionByFont(u8 fontId, u8 whichDimension) static void DecompressGlyph_Small(u16 glyphId, bool32 isJapanese) { - const u16* glyphs; + const u16 *glyphs; if (isJapanese == 1) { @@ -1726,7 +1726,7 @@ static u32 GetGlyphWidth_Small(u16 glyphId, bool32 isJapanese) static void DecompressGlyph_Narrow(u16 glyphId, bool32 isJapanese) { - const u16* glyphs; + const u16 *glyphs; if (isJapanese == TRUE) { @@ -1768,7 +1768,7 @@ static u32 GetGlyphWidth_Narrow(u16 glyphId, bool32 isJapanese) static void DecompressGlyph_SmallNarrow(u16 glyphId, bool32 isJapanese) { - const u16* glyphs; + const u16 *glyphs; if (isJapanese == TRUE) { @@ -1810,7 +1810,7 @@ static u32 GetGlyphWidth_SmallNarrow(u16 glyphId, bool32 isJapanese) static void DecompressGlyph_Short(u16 glyphId, bool32 isJapanese) { - const u16* glyphs; + const u16 *glyphs; if (isJapanese == TRUE) { @@ -1854,7 +1854,7 @@ static u32 GetGlyphWidth_Short(u16 glyphId, bool32 isJapanese) static void DecompressGlyph_Normal(u16 glyphId, bool32 isJapanese) { - const u16* glyphs; + const u16 *glyphs; if (isJapanese == TRUE) { @@ -1896,7 +1896,7 @@ static u32 GetGlyphWidth_Normal(u16 glyphId, bool32 isJapanese) static void DecompressGlyph_Bold(u16 glyphId) { - const u16* glyphs; + const u16 *glyphs; glyphs = sFontBoldJapaneseGlyphs + (0x100 * (glyphId >> 4)) + (0x8 * (glyphId & 0xF)); DecompressGlyphTile(glyphs, gCurGlyph.gfxBufferTop); diff --git a/gflib/text.h b/gflib/text.h index 2f660354f..c07817290 100644 --- a/gflib/text.h +++ b/gflib/text.h @@ -65,7 +65,7 @@ struct TextPrinterSubStruct struct TextPrinterTemplate { - const u8* currentChar; + const u8 *currentChar; u8 windowId; u8 fontId; u8 x; diff --git a/gflib/window.c b/gflib/window.c index 8ca1a4b62..ff9e8a6e0 100644 --- a/gflib/window.c +++ b/gflib/window.c @@ -35,7 +35,7 @@ bool16 InitWindows(const struct WindowTemplate *templates) int j; u8 bgLayer; u16 attrib; - u8* allocatedTilemapBuffer; + u8 *allocatedTilemapBuffer; int allocatedBaseBlock; for (i = 0; i < NUM_BACKGROUNDS; ++i) @@ -405,7 +405,7 @@ void BlitBitmapRectToWindow(u8 windowId, const u8 *pixels, u16 srcX, u16 srcY, u struct Bitmap sourceRect; struct Bitmap destRect; - sourceRect.pixels = (u8*)pixels; + sourceRect.pixels = (u8 *)pixels; sourceRect.width = srcWidth; sourceRect.height = srcHeight; @@ -421,7 +421,7 @@ static void BlitBitmapRectToWindowWithColorKey(u8 windowId, const u8 *pixels, u1 struct Bitmap sourceRect; struct Bitmap destRect; - sourceRect.pixels = (u8*)pixels; + sourceRect.pixels = (u8 *)pixels; sourceRect.width = srcWidth; sourceRect.height = srcHeight; @@ -463,9 +463,9 @@ void FillWindowPixelBuffer(u8 windowId, u8 fillValue) destOffset = i + (a); \ srcOffset = i + (((width * (distanceLoop & ~7)) | (distanceLoop & 7)) * 4); \ if (srcOffset < size) \ - *(u32*)(tileData + destOffset) = *(u32*)(tileData + srcOffset); \ + *(u32 *)(tileData + destOffset) = *(u32 *)(tileData + srcOffset); \ else \ - *(u32*)(tileData + destOffset) = fillValue32; \ + *(u32 *)(tileData + destOffset) = fillValue32; \ distanceLoop++; \ } @@ -474,9 +474,9 @@ void FillWindowPixelBuffer(u8 windowId, u8 fillValue) destOffset = i + (a); \ srcOffset = i + (((width * (distanceLoop & ~7)) | (distanceLoop & 7)) * 4); \ if (srcOffset < size) \ - *(u32*)(tileData - destOffset) = *(u32*)(tileData - srcOffset); \ + *(u32 *)(tileData - destOffset) = *(u32 *)(tileData - srcOffset); \ else \ - *(u32*)(tileData - destOffset) = fillValue32; \ + *(u32 *)(tileData - destOffset) = fillValue32; \ distanceLoop++; \ } @@ -550,7 +550,7 @@ bool8 SetWindowAttribute(u8 windowId, u8 attributeId, u32 value) gWindows[windowId].window.baseBlock = value; return FALSE; case WINDOW_TILE_DATA: - gWindows[windowId].tileData = (u8*)(value); + gWindows[windowId].tileData = (u8 *)(value); return TRUE; case WINDOW_BG: case WINDOW_WIDTH: @@ -605,7 +605,7 @@ static void DummyWindowBgTilemap8Bit(void) u16 AddWindow8Bit(const struct WindowTemplate *template) { u16 windowId; - u8* memAddress; + u8 *memAddress; u8 bgLayer; for (windowId = 0; windowId < WINDOWS_MAX; windowId++) @@ -675,7 +675,7 @@ void BlitBitmapRectToWindow4BitTo8Bit(u8 windowId, const u8 *pixels, u16 srcX, u struct Bitmap sourceRect; struct Bitmap destRect; - sourceRect.pixels = (u8*) pixels; + sourceRect.pixels = (u8 *) pixels; sourceRect.width = srcWidth; sourceRect.height = srcHeight; diff --git a/gflib/window.h b/gflib/window.h index 6cb98c845..583e7e167 100644 --- a/gflib/window.h +++ b/gflib/window.h @@ -73,7 +73,7 @@ void BlitBitmapRectToWindow4BitTo8Bit(u8 windowId, const u8 *pixels, u16 srcX, u void CopyWindowToVram8Bit(u8 windowId, u8 mode); extern struct Window gWindows[]; -extern void* gWindowBgTilemapBuffers[]; +extern void *gWindowBgTilemapBuffers[]; extern u32 gUnusedWindowVar1; extern u32 gUnusedWindowVar2; extern u32 gUnusedWindowVar3; diff --git a/include/battle.h b/include/battle.h index 9656bab8d..0b349e4b6 100644 --- a/include/battle.h +++ b/include/battle.h @@ -588,10 +588,10 @@ struct BattleSpriteData struct MonSpritesGfx { - void* firstDecompressed; // ptr to the decompressed sprite of the first pokemon + void *firstDecompressed; // ptr to the decompressed sprite of the first pokemon union { - void* ptr[MAX_BATTLERS_COUNT]; - u8* byte[MAX_BATTLERS_COUNT]; + void *ptr[MAX_BATTLERS_COUNT]; + u8 *byte[MAX_BATTLERS_COUNT]; } sprites; struct SpriteTemplate templates[MAX_BATTLERS_COUNT]; struct SpriteFrameImage frameImages[MAX_BATTLERS_COUNT][4]; diff --git a/include/battle_anim.h b/include/battle_anim.h index c98766ea8..5ac512346 100644 --- a/include/battle_anim.h +++ b/include/battle_anim.h @@ -108,8 +108,8 @@ u8 GetBattlerSpriteBGPriority(u8 battlerId); void *LoadPointerFromVars(s16 bottom, s16 top); void StorePointerInVars(s16 *bottom, s16 *top, const void *ptr); void InitPrioritiesForVisibleBattlers(void); -void GetBattleAnimBg1Data(struct BattleAnimBgData*); -void GetBattleAnimBgData(struct BattleAnimBgData*, u32 bgId); +void GetBattleAnimBg1Data(struct BattleAnimBgData *); +void GetBattleAnimBgData(struct BattleAnimBgData *, u32 bgId); u8 GetBattlerSpriteSubpriority(u8 battlerId); bool8 TranslateAnimHorizontalArc(struct Sprite *sprite); void TranslateSpriteLinearByIdFixedPoint(struct Sprite *sprite); @@ -122,10 +122,10 @@ u32 GetBattlePalettesMask(bool8 battleBackground, bool8 attacker, bool8 target, u32 GetBattleMonSpritePalettesMask(u8 playerLeft, u8 playerRight, u8 opponentLeft, u8 opponentRight); u8 AnimDummyReturnArg(u8 battler); s16 CloneBattlerSpriteWithBlend(u8); -void DestroySpriteWithActiveSheet(struct Sprite*); +void DestroySpriteWithActiveSheet(struct Sprite *); u8 CreateInvisibleSpriteCopy(int, u8, int); -void AnimLoadCompressedBgTilemapHandleContest(struct BattleAnimBgData*, const void*, bool32); -void AnimLoadCompressedBgGfx(u32, const u32*, u32); +void AnimLoadCompressedBgTilemapHandleContest(struct BattleAnimBgData *, const void *, bool32); +void AnimLoadCompressedBgGfx(u32, const u32 *, u32); void UpdateAnimBg3ScreenSize(bool8); void TranslateSpriteInGrowingCircle(struct Sprite *); void SetBattlerSpriteYOffsetFromYScale(u8 spriteId); @@ -186,7 +186,7 @@ u8 GetAnimBattlerSpriteId(u8 wantedBattler); bool8 IsDoubleBattle(void); u8 GetBattleBgPaletteNum(void); u8 GetBattlerSpriteBGPriorityRank(u8 battlerId); -void StoreSpriteCallbackInData6(struct Sprite *sprite, void (*spriteCallback)(struct Sprite*)); +void StoreSpriteCallbackInData6(struct Sprite *sprite, void (*spriteCallback)(struct Sprite *)); void SetSpritePrimaryCoordsFromSecondaryCoords(struct Sprite *sprite); u8 GetBattlerSpriteDefault_Y(u8 battlerId); u8 GetSubstituteSpriteDefault_Y(u8 battlerId); @@ -216,8 +216,8 @@ void InitStatsChangeAnimation(u8); void StartMonScrollingBgMask(u8 taskId, int unused, u16 scrollSpeed, u8 battler, bool8 includePartner, u8 numFadeSteps, u8 fadeStepDelay, u8 duration, const u32 *gfx, const u32 *tilemap, const u32 *palette); // battle_anim_effects_1.c -void SetSpriteNextToMonHead(u8 battler, struct Sprite* sprite); -void AnimMoveTwisterParticle(struct Sprite* sprite); +void SetSpriteNextToMonHead(u8 battler, struct Sprite *sprite); +void AnimMoveTwisterParticle(struct Sprite *sprite); void AnimParticleBurst(struct Sprite *); // battle_anim_water.c diff --git a/include/battle_controllers.h b/include/battle_controllers.h index 5b6ba30bd..f6ac07b91 100644 --- a/include/battle_controllers.h +++ b/include/battle_controllers.h @@ -92,7 +92,7 @@ enum { LINK_STANDBY_MSG_ONLY, }; -#define INSTANT_HP_BAR_DROP 32767 +#define INSTANT_HP_BAR_DROP 0x7FFF #define PARTY_SUMM_SKIP_DRAW_DELAY (1 << 7) @@ -222,8 +222,8 @@ void BtlController_EmitPrintSelectionString(u8 bufferId, u16 stringId); void BtlController_EmitChooseAction(u8 bufferId, u8 action, u16 itemId); void BtlController_EmitYesNoBox(u8 bufferId); void BtlController_EmitChooseMove(u8 bufferId, bool8 isDoubleBattle, bool8 NoPpNumber, struct ChooseMoveStruct *movePpData); -void BtlController_EmitChooseItem(u8 bufferId, u8* battlePartyOrder); -void BtlController_EmitChoosePokemon(u8 bufferId, u8 caseId, u8 slotId, u8 abilityId, u8* data); +void BtlController_EmitChooseItem(u8 bufferId, u8 *battlePartyOrder); +void BtlController_EmitChoosePokemon(u8 bufferId, u8 caseId, u8 slotId, u8 abilityId, u8 *data); void BtlController_EmitCmd23(u8 bufferId); // unused void BtlController_EmitHealthBarUpdate(u8 bufferId, u16 hpValue); void BtlController_EmitExpUpdate(u8 bufferId, u8 partyId, u16 expPoints); diff --git a/include/battle_message.h b/include/battle_message.h index da3009d63..cc18a13d2 100644 --- a/include/battle_message.h +++ b/include/battle_message.h @@ -211,18 +211,18 @@ struct BattleMsgData }; void BufferStringBattle(u16 stringID); -u32 BattleStringExpandPlaceholdersToDisplayedString(const u8* src); -u32 BattleStringExpandPlaceholders(const u8* src, u8* dst); -void BattlePutTextOnWindow(const u8* text, u8 windowId); +u32 BattleStringExpandPlaceholdersToDisplayedString(const u8 *src); +u32 BattleStringExpandPlaceholders(const u8 *src, u8 *dst); +void BattlePutTextOnWindow(const u8 *text, u8 windowId); void SetPpNumbersPaletteInMoveSelection(void); u8 GetCurrentPpToMaxPpState(u8 currentPp, u8 maxPp); extern struct BattleMsgData *gBattleMsgDataPtr; -extern const u8* const gBattleStringsTable[]; -extern const u8* const gStatNamesTable[]; -extern const u8* const gPokeblockWasTooXStringTable[]; -extern const u8* const gRefereeStringsTable[]; +extern const u8 *const gBattleStringsTable[]; +extern const u8 *const gStatNamesTable[]; +extern const u8 *const gPokeblockWasTooXStringTable[]; +extern const u8 *const gRefereeStringsTable[]; extern const u8 *const gRoundsStringTable[]; extern const u8 gText_PkmnIsEvolving[]; diff --git a/include/battle_util.h b/include/battle_util.h index d15d4583e..8428be8d9 100644 --- a/include/battle_util.h +++ b/include/battle_util.h @@ -73,7 +73,7 @@ void PrepareStringBattle(u16 stringId, u8 battlerId); void ResetSentPokesToOpponentValue(void); void OpponentSwitchInResetSentPokesToOpponentValue(u8 battlerId); void UpdateSentPokesToOpponentValue(u8 battlerId); -void BattleScriptPush(const u8* bsPtr); +void BattleScriptPush(const u8 *bsPtr); void BattleScriptPushCursor(void); void BattleScriptPop(void); u8 TrySetCantSelectMoveBattleScript(void); @@ -89,8 +89,8 @@ u8 AtkCanceller_UnableToUseMove(void); bool8 HasNoMonsToSwitch(u8 battlerId, u8 r1, u8 r2); u8 CastformDataTypeChange(u8 battlerId); u8 AbilityBattleEffects(u8 caseID, u8 battlerId, u8 ability, u8 special, u16 moveArg); -void BattleScriptExecute(const u8* BS_ptr); -void BattleScriptPushCursorAndCallback(const u8* BS_ptr); +void BattleScriptExecute(const u8 *BS_ptr); +void BattleScriptPushCursorAndCallback(const u8 *BS_ptr); u8 ItemBattleEffects(u8 caseID, u8 battlerId, bool8 moveTurn); void ClearFuryCutterDestinyBondGrudge(u8 battlerId); void HandleAction_RunBattleScript(void); diff --git a/include/constants/battle.h b/include/constants/battle.h index 31bc7fa3f..2c35c5657 100644 --- a/include/constants/battle.h +++ b/include/constants/battle.h @@ -53,17 +53,17 @@ #define BATTLE_TYPE_MULTI (1 << 6) #define BATTLE_TYPE_SAFARI (1 << 7) #define BATTLE_TYPE_BATTLE_TOWER (1 << 8) -#define BATTLE_TYPE_WALLY_TUTORIAL (1 << 9) +#define BATTLE_TYPE_WALLY_TUTORIAL (1 << 9) // Used in pokefirered as BATTLE_TYPE_OLD_MAN_TUTORIAL. #define BATTLE_TYPE_ROAMER (1 << 10) #define BATTLE_TYPE_EREADER_TRAINER (1 << 11) #define BATTLE_TYPE_KYOGRE_GROUDON (1 << 12) #define BATTLE_TYPE_LEGENDARY (1 << 13) #define BATTLE_TYPE_REGI (1 << 14) -#define BATTLE_TYPE_TWO_OPPONENTS (1 << 15) -#define BATTLE_TYPE_DOME (1 << 16) -#define BATTLE_TYPE_PALACE (1 << 17) -#define BATTLE_TYPE_ARENA (1 << 18) -#define BATTLE_TYPE_FACTORY (1 << 19) +#define BATTLE_TYPE_TWO_OPPONENTS (1 << 15) // Used in pokefirered as BATTLE_TYPE_GHOST. +#define BATTLE_TYPE_DOME (1 << 16) // Used in pokefirered as BATTLE_TYPE_POKEDUDE. +#define BATTLE_TYPE_PALACE (1 << 17) // Used in pokefirered as BATTLE_TYPE_WILD_SCRIPTED. +#define BATTLE_TYPE_ARENA (1 << 18) // Used in pokefirered as BATTLE_TYPE_LEGENDARY_FRLG. +#define BATTLE_TYPE_FACTORY (1 << 19) // Used in pokefirered as BATTLE_TYPE_TRAINER_TOWER. #define BATTLE_TYPE_PIKE (1 << 20) #define BATTLE_TYPE_PYRAMID (1 << 21) #define BATTLE_TYPE_INGAME_PARTNER (1 << 22) diff --git a/include/constants/battle_script_commands.h b/include/constants/battle_script_commands.h index 83aacf316..c21276a4e 100644 --- a/include/constants/battle_script_commands.h +++ b/include/constants/battle_script_commands.h @@ -53,15 +53,15 @@ #define BS_EFFECT_BATTLER 2 #define BS_FAINTED 3 #define BS_ATTACKER_WITH_PARTNER 4 // for Cmd_updatestatusicon -#define BS_FAINTED_LINK_MULTIPLE_1 5 -#define BS_FAINTED_LINK_MULTIPLE_2 6 +#define BS_FAINTED_LINK_MULTIPLE_1 5 // for openpartyscreen +#define BS_FAINTED_LINK_MULTIPLE_2 6 // for openpartyscreen #define BS_BATTLER_0 7 #define BS_ATTACKER_SIDE 8 // for Cmd_jumpifability #define BS_NOT_ATTACKER_SIDE 9 // for Cmd_jumpifability #define BS_SCRIPTING 10 #define BS_PLAYER1 11 #define BS_OPPONENT1 12 -#define BS_PLAYER2 13 +#define BS_PLAYER2 13 // for Cmd_updatestatusicon #define BS_OPPONENT2 14 // Cmd_accuracycheck @@ -115,8 +115,8 @@ #define SWITCH_IGNORE_ESCAPE_PREVENTION (1 << 7) // Cmd_statbuffchange -#define STAT_BUFF_ALLOW_PTR (1 << 0) // If set, allow use of jumpptr. Set in every use of statbuffchange -#define STAT_BUFF_NOT_PROTECT_AFFECTED (1 << 5) +#define STAT_CHANGE_ALLOW_PTR (1 << 0) // If set, allow use of jumpptr. Set in every use of statbuffchange +#define STAT_CHANGE_NOT_PROTECT_AFFECTED (1 << 5) // stat change flags for Cmd_playstatchangeanimation #define STAT_CHANGE_NEGATIVE (1 << 0) diff --git a/include/decompress.h b/include/decompress.h index 14906211c..5e33665b7 100644 --- a/include/decompress.h +++ b/include/decompress.h @@ -10,15 +10,15 @@ void LZDecompressVram(const u32 *src, void *dest); u16 LoadCompressedSpriteSheet(const struct CompressedSpriteSheet *src); void LoadCompressedSpriteSheetOverrideBuffer(const struct CompressedSpriteSheet *src, void *buffer); -bool8 LoadCompressedSpriteSheetUsingHeap(const struct CompressedSpriteSheet* src); +bool8 LoadCompressedSpriteSheetUsingHeap(const struct CompressedSpriteSheet *src); void LoadCompressedSpritePalette(const struct CompressedSpritePalette *src); void LoadCompressedSpritePaletteOverrideBuffer(const struct CompressedSpritePalette *src, void *buffer); bool8 LoadCompressedSpritePaletteUsingHeap(const struct CompressedSpritePalette *src); -void DecompressPicFromTable(const struct CompressedSpriteSheet *src, void* buffer, s32 species); -void DecompressPicFromTable_2(const struct CompressedSpriteSheet *src, void* buffer, s32 species); -void DecompressPicFromTable_DontHandleDeoxys(const struct CompressedSpriteSheet *src, void* buffer, s32 species); +void DecompressPicFromTable(const struct CompressedSpriteSheet *src, void *buffer, s32 species); +void DecompressPicFromTable_2(const struct CompressedSpriteSheet *src, void *buffer, s32 species); +void DecompressPicFromTable_DontHandleDeoxys(const struct CompressedSpriteSheet *src, void *buffer, s32 species); void HandleLoadSpecialPokePic(const struct CompressedSpriteSheet *src, void *dest, s32 species, u32 personality); void HandleLoadSpecialPokePic_2(const struct CompressedSpriteSheet *src, void *dest, s32 species, u32 personality); diff --git a/include/evolution_scene.h b/include/evolution_scene.h index 5f8c534b9..25d34eddf 100644 --- a/include/evolution_scene.h +++ b/include/evolution_scene.h @@ -1,9 +1,9 @@ #ifndef GUARD_EVOLUTION_SCENE_H #define GUARD_EVOLUTION_SCENE_H -void BeginEvolutionScene(struct Pokemon* mon, u16 speciesToEvolve, bool8 canStopEvo, u8 partyID); -void EvolutionScene(struct Pokemon* mon, u16 speciesToEvolve, bool8 canStopEvo, u8 partyID); -void TradeEvolutionScene(struct Pokemon* mon, u16 speciesToEvolve, u8 preEvoSpriteID, u8 partyID); +void BeginEvolutionScene(struct Pokemon *mon, u16 speciesToEvolve, bool8 canStopEvo, u8 partyID); +void EvolutionScene(struct Pokemon *mon, u16 speciesToEvolve, bool8 canStopEvo, u8 partyID); +void TradeEvolutionScene(struct Pokemon *mon, u16 speciesToEvolve, u8 preEvoSpriteID, u8 partyID); extern void (*gCB2_AfterEvolution)(void); diff --git a/include/faraway_island.h b/include/faraway_island.h index a5243c6a7..9fd2a69fc 100755 --- a/include/faraway_island.h +++ b/include/faraway_island.h @@ -2,7 +2,7 @@ #define GUARD_FARAWAY_ISLAND_H u32 GetMewMoveDirection(void); -bool8 ShouldMewShakeGrass(struct ObjectEvent*); +bool8 ShouldMewShakeGrass(struct ObjectEvent *); void UpdateFarawayIslandStepCounter(void); bool8 ObjectEventIsFarawayIslandMew(struct ObjectEvent *); bool8 IsMewPlayingHideAndSeek(void); diff --git a/include/field_effect.h b/include/field_effect.h index 731fb9c59..b35a8c869 100644 --- a/include/field_effect.h +++ b/include/field_effect.h @@ -39,8 +39,8 @@ void StartEscalatorWarp(u8 metatileBehavior, u8 priority); void StartLavaridgeGymB1FWarp(u8 priority); void StartLavaridgeGym1FWarp(u8 priority); -void SpriteCB_AshPuff(struct Sprite*); -void SpriteCB_AshLaunch(struct Sprite*); +void SpriteCB_AshPuff(struct Sprite *); +void SpriteCB_AshLaunch(struct Sprite *); void MultiplyPaletteRGBComponents(u16 i, u8 r, u8 g, u8 b); void FreeResourcesAndDestroySprite(struct Sprite *sprite, u8 spriteId); diff --git a/include/field_effect_helpers.h b/include/field_effect_helpers.h index 528492d81..2ae5d79f7 100644 --- a/include/field_effect_helpers.h +++ b/include/field_effect_helpers.h @@ -20,25 +20,25 @@ void SetSurfBlob_PlayerOffset(u8 spriteId, bool8 hasOffset, s16 offset); bool8 UpdateRevealDisguise(struct ObjectEvent *); void StartRevealDisguise(struct ObjectEvent *); void StartAshFieldEffect(s16, s16, u16, s16); -void SetUpReflection(struct ObjectEvent*, struct Sprite*, u8); -u32 StartFieldEffectForObjectEvent(u8, struct ObjectEvent*); +void SetUpReflection(struct ObjectEvent *, struct Sprite *, u8); +u32 StartFieldEffectForObjectEvent(u8, struct ObjectEvent *); u8 FindTallGrassFieldEffectSpriteId(u8 localId, u8 mapNum, u8 mapGroup, s16 x, s16 y); -void UpdateRayquazaSpotlightEffect(struct Sprite*); -void UpdateShadowFieldEffect(struct Sprite*); -void UpdateTallGrassFieldEffect(struct Sprite*); -void WaitFieldEffectSpriteAnim(struct Sprite*); -void UpdateAshFieldEffect(struct Sprite*); -void UpdateSurfBlobFieldEffect(struct Sprite*); -void UpdateJumpImpactEffect(struct Sprite*); -void UpdateFootprintsTireTracksFieldEffect(struct Sprite*); -void UpdateSplashFieldEffect(struct Sprite*); -void UpdateLongGrassFieldEffect(struct Sprite*); -void UpdateSandPileFieldEffect(struct Sprite*); -void UpdateDisguiseFieldEffect(struct Sprite*); -void UpdateShortGrassFieldEffect(struct Sprite*); -void UpdateHotSpringsWaterFieldEffect(struct Sprite*); -void UpdateBubblesFieldEffect(struct Sprite*); -void UpdateSparkleFieldEffect(struct Sprite*); +void UpdateRayquazaSpotlightEffect(struct Sprite *); +void UpdateShadowFieldEffect(struct Sprite *); +void UpdateTallGrassFieldEffect(struct Sprite *); +void WaitFieldEffectSpriteAnim(struct Sprite *); +void UpdateAshFieldEffect(struct Sprite *); +void UpdateSurfBlobFieldEffect(struct Sprite *); +void UpdateJumpImpactEffect(struct Sprite *); +void UpdateFootprintsTireTracksFieldEffect(struct Sprite *); +void UpdateSplashFieldEffect(struct Sprite *); +void UpdateLongGrassFieldEffect(struct Sprite *); +void UpdateSandPileFieldEffect(struct Sprite *); +void UpdateDisguiseFieldEffect(struct Sprite *); +void UpdateShortGrassFieldEffect(struct Sprite *); +void UpdateHotSpringsWaterFieldEffect(struct Sprite *); +void UpdateBubblesFieldEffect(struct Sprite *); +void UpdateSparkleFieldEffect(struct Sprite *); void SetSpriteInvisible(u8 spriteId); void ShowWarpArrowSprite(u8 spriteId, u8 direction, s16 x, s16 y); diff --git a/include/fieldmap.h b/include/fieldmap.h index e7497f7bd..a166e785a 100644 --- a/include/fieldmap.h +++ b/include/fieldmap.h @@ -25,7 +25,7 @@ u32 MapGridGetMetatileIdAt(int, int); u32 MapGridGetMetatileBehaviorAt(int, int); void MapGridSetMetatileIdAt(int, int, u16); void MapGridSetMetatileEntryAt(int, int, u16); -void GetCameraCoords(u16*, u16*); +void GetCameraCoords(u16 *, u16 *); bool8 MapGridIsImpassableAt(int, int); int GetMapBorderIdAt(int x, int y); bool32 CanCameraMoveInDirection(int direction); diff --git a/include/gba/isagbprint.h b/include/gba/isagbprint.h index 1be3852e3..13687825e 100644 --- a/include/gba/isagbprint.h +++ b/include/gba/isagbprint.h @@ -23,14 +23,14 @@ void AGBAssert(const char *pFile, int nLine, const char *pExpression, int nStopP #ifdef NDEBUG #define AGB_ASSERT(exp) #else -#define AGB_ASSERT(exp) (exp) ? ((void*)0) : AGBAssert(__FILE__, __LINE__, #exp, 1); +#define AGB_ASSERT(exp) (exp) ? ((void *)0) : AGBAssert(__FILE__, __LINE__, #exp, 1); #endif #undef AGB_WARNING #ifdef NDEBUG #define AGB_WARNING(exp) #else -#define AGB_WARNING(exp) (exp) ? ((void*)0) : AGBAssert(__FILE__, __LINE__, #exp, 0); +#define AGB_WARNING(exp) (exp) ? ((void *)0) : AGBAssert(__FILE__, __LINE__, #exp, 0); #endif // for matching purposes @@ -38,13 +38,13 @@ void AGBAssert(const char *pFile, int nLine, const char *pExpression, int nStopP #ifdef NDEBUG #define AGB_ASSERT_EX(exp, file, line) #else -#define AGB_ASSERT_EX(exp, file, line) (exp) ? ((void*)0) : AGBAssert(file, line, #exp, 1); +#define AGB_ASSERT_EX(exp, file, line) (exp) ? ((void *)0) : AGBAssert(file, line, #exp, 1); #endif #ifdef NDEBUG #define AGB_WARNING_EX(exp, file, line) #else -#define AGB_WARNING_EX(exp, file, line) (exp) ? ((void*)0) : AGBAssert(file, line, #exp, 0); +#define AGB_WARNING_EX(exp, file, line) (exp) ? ((void *)0) : AGBAssert(file, line, #exp, 0); #endif #endif // GUARD_GBA_ISAGBPRINT_H diff --git a/include/global.h b/include/global.h index 64af518ce..b1fd21d8b 100644 --- a/include/global.h +++ b/include/global.h @@ -102,13 +102,13 @@ #define T1_READ_8(ptr) ((ptr)[0]) #define T1_READ_16(ptr) ((ptr)[0] | ((ptr)[1] << 8)) #define T1_READ_32(ptr) ((ptr)[0] | ((ptr)[1] << 8) | ((ptr)[2] << 16) | ((ptr)[3] << 24)) -#define T1_READ_PTR(ptr) (u8*) T1_READ_32(ptr) +#define T1_READ_PTR(ptr) (u8 *) T1_READ_32(ptr) // T2_READ_8 is a duplicate to remain consistent with each group. #define T2_READ_8(ptr) ((ptr)[0]) #define T2_READ_16(ptr) ((ptr)[0] + ((ptr)[1] << 8)) #define T2_READ_32(ptr) ((ptr)[0] + ((ptr)[1] << 8) + ((ptr)[2] << 16) + ((ptr)[3] << 24)) -#define T2_READ_PTR(ptr) (void*) T2_READ_32(ptr) +#define T2_READ_PTR(ptr) (void *) T2_READ_32(ptr) // Macros for checking the joypad #define TEST_BUTTON(field, button) ((field) & (button)) diff --git a/include/international_string_util.h b/include/international_string_util.h index dd5c6ac5f..b0ac8afb6 100644 --- a/include/international_string_util.h +++ b/include/international_string_util.h @@ -11,7 +11,7 @@ int GetStringRightAlignXOffset(int fontId, const u8 *str, int totalWidth); int GetStringCenterAlignXOffsetWithLetterSpacing(int fontId, const u8 *str, int totalWidth, int letterSpacing); int GetStringWidthDifference(int fontId, const u8 *str, int totalWidth, int letterSpacing); int GetMaxWidthInMenuTable(const struct MenuAction *actions, int numActions); -int GetMaxWidthInSubsetOfMenuTable(const struct MenuAction *actions, const u8* actionIds, int numActions); +int GetMaxWidthInSubsetOfMenuTable(const struct MenuAction *actions, const u8 *actionIds, int numActions); int Intl_GetListMenuWidth(const struct ListMenuTemplate *listMenu); void CopyMonCategoryText(int dexNum, u8 *dest); u8 *GetStringClearToWidth(u8 *dest, int fontId, const u8 *str, int totalStringWidth); diff --git a/include/item_menu.h b/include/item_menu.h index fd576c3b5..ce03cdacb 100644 --- a/include/item_menu.h +++ b/include/item_menu.h @@ -71,7 +71,7 @@ struct BagMenu u8 unused1[2]; u8 pocketScrollArrowsTask; u8 pocketSwitchArrowsTask; - const u8* contextMenuItemsPtr; + const u8 *contextMenuItemsPtr; u8 contextMenuItemsBuffer[4]; u8 contextMenuNumItems; u8 numItemStacks[POCKETS_COUNT]; diff --git a/include/menu.h b/include/menu.h index c38e87cbd..43b564da2 100644 --- a/include/menu.h +++ b/include/menu.h @@ -50,7 +50,7 @@ void LoadMessageBoxAndBorderGfx(void); void DrawDialogueFrame(u8 windowId, bool8 copyToVram); void ClearStdWindowAndFrame(u8 windowId, bool8 copyToVram); u16 AddTextPrinterParameterized2(u8 windowId, u8 fontId, const u8 *str, u8 speed, void (*callback)(struct TextPrinterTemplate *, u16), u8 fgColor, u8 bgColor, u8 shadowColor); -void PrintPlayerNameOnWindow(u8, const u8*, u16, u16); +void PrintPlayerNameOnWindow(u8, const u8 *, u16, u16); void ClearDialogWindowAndFrame(u8 windowId, bool8 copyToVram); void SetStandardWindowBorderStyle(u8 windowId, bool8 copyToVram); void DisplayYesNoMenuDefaultYes(void); @@ -61,7 +61,7 @@ void AddTextPrinterWithCallbackForMessage(bool8 canSpeedUp, void (*callback)(str void BgDmaFill(u32 bg, u8 value, int offset, int size); void AddTextPrinterParameterized3(u8 windowId, u8 fontId, u8 left, u8 top, const u8 *color, s8 speed, const u8 *str); void ClearStdWindowAndFrameToTransparent(u8 windowId, bool8 copyToVram); -void SetWindowTemplateFields(struct WindowTemplate* template, u8 priority, u8 tilemapLeft, u8 tilemapTop, u8 width, u8 height, u8 palNum, u16 baseBlock); +void SetWindowTemplateFields(struct WindowTemplate *template, u8 priority, u8 tilemapLeft, u8 tilemapTop, u8 width, u8 height, u8 palNum, u16 baseBlock); void DrawStdFrameWithCustomTileAndPalette(u8 windowId, bool8 copyToVram, u16 tileStart, u8 palette); void ScheduleBgCopyTilemapToVram(u8 bgNum); void PrintMenuTable(u8 windowId, u8 itemCount, const struct MenuAction *strs); diff --git a/include/money.h b/include/money.h index 5c7c1c984..e7a837978 100644 --- a/include/money.h +++ b/include/money.h @@ -1,11 +1,11 @@ #ifndef GUARD_MONEY_H #define GUARD_MONEY_H -u32 GetMoney(u32* moneyPtr); -void SetMoney(u32* moneyPtr, u32 newValue); -bool8 IsEnoughMoney(u32* moneyPtr, u32 cost); -void AddMoney(u32* moneyPtr, u32 toAdd); -void RemoveMoney(u32* moneyPtr, u32 toSub); +u32 GetMoney(u32 *moneyPtr); +void SetMoney(u32 *moneyPtr, u32 newValue); +bool8 IsEnoughMoney(u32 *moneyPtr, u32 cost); +void AddMoney(u32 *moneyPtr, u32 toAdd); +void RemoveMoney(u32 *moneyPtr, u32 toSub); bool8 IsEnoughForCostInVar0x8005(void); void SubtractMoneyFromVar0x8005(void); void PrintMoneyAmountInMoneyBox(u8 windowId, int amount, u8 speed); diff --git a/include/party_menu.h b/include/party_menu.h index 7f51d08c9..40029f77b 100644 --- a/include/party_menu.h +++ b/include/party_menu.h @@ -36,8 +36,8 @@ bool8 IsMultiBattle(void); u8 GetCursorSelectionMonId(void); u8 GetPartyMenuType(void); void Task_HandleChooseMonInput(u8 taskId); -u8* GetMonNickname(struct Pokemon *mon, u8 *dest); -u8 DisplayPartyMenuMessage(const u8* str, bool8 keepOpen); +u8 *GetMonNickname(struct Pokemon *mon, u8 *dest); +u8 DisplayPartyMenuMessage(const u8 *str, bool8 keepOpen); bool8 IsPartyMenuTextPrinterActive(void); void PartyMenuModifyHP(u8 taskId, u8 slot, s8 hpIncrement, s16 HPDifference, TaskFunc task); u8 GetAilmentFromStatus(u32 status); diff --git a/include/pokedex_area_screen.h b/include/pokedex_area_screen.h index 027d3e4a7..86dfaa6c5 100755 --- a/include/pokedex_area_screen.h +++ b/include/pokedex_area_screen.h @@ -1,6 +1,6 @@ #ifndef GUARD_POKEDEX_AREA_SCREEN_H #define GUARD_POKEDEX_AREA_SCREEN_H -void ShowPokedexAreaScreen(u16, u8*); +void ShowPokedexAreaScreen(u16, u8 *); #endif // GUARD_POKEDEX_AREA_SCREEN_H diff --git a/include/pokedex_cry_screen.h b/include/pokedex_cry_screen.h index 4d2043292..3401db22d 100755 --- a/include/pokedex_cry_screen.h +++ b/include/pokedex_cry_screen.h @@ -12,10 +12,10 @@ struct CryScreenWindow extern u8 gDexCryScreenState; -bool8 LoadCryWaveformWindow(struct CryScreenWindow*, u8); +bool8 LoadCryWaveformWindow(struct CryScreenWindow *, u8); void UpdateCryWaveformWindow(u8); void CryScreenPlayButton(u16); -bool8 LoadCryMeter(struct CryScreenWindow*, u8); +bool8 LoadCryMeter(struct CryScreenWindow *, u8); void FreeCryScreen(void); #endif diff --git a/include/pokemon.h b/include/pokemon.h index d173387fb..e7b1d738b 100644 --- a/include/pokemon.h +++ b/include/pokemon.h @@ -426,11 +426,11 @@ void SetWildMonHeldItem(void); bool8 IsMonShiny(struct Pokemon *mon); bool8 IsShinyOtIdPersonality(u32 otId, u32 personality); const u8 *GetTrainerPartnerName(void); -void BattleAnimateFrontSprite(struct Sprite* sprite, u16 species, bool8 noCry, u8 panMode); -void DoMonFrontSpriteAnimation(struct Sprite* sprite, u16 species, bool8 noCry, u8 panModeAnimFlag); -void PokemonSummaryDoMonAnimation(struct Sprite* sprite, u16 species, bool8 oneFrame); +void BattleAnimateFrontSprite(struct Sprite *sprite, u16 species, bool8 noCry, u8 panMode); +void DoMonFrontSpriteAnimation(struct Sprite *sprite, u16 species, bool8 noCry, u8 panModeAnimFlag); +void PokemonSummaryDoMonAnimation(struct Sprite *sprite, u16 species, bool8 oneFrame); void StopPokemonAnimationDelayTask(void); -void BattleAnimateBackSprite(struct Sprite* sprite, u16 species); +void BattleAnimateBackSprite(struct Sprite *sprite, u16 species); u8 GetOpposingLinkMultiBattlerId(bool8 rightSide, u8 multiplayerId); u16 FacilityClassToPicIndex(u16 facilityClass); u16 PlayerGenderToFrontTrainerPicId(u8 playerGender); diff --git a/include/save.h b/include/save.h index 89fc9ad33..4f2903f09 100644 --- a/include/save.h +++ b/include/save.h @@ -104,8 +104,8 @@ bool8 WriteSaveBlock2(void); bool8 WriteSaveBlock1Sector(void); u8 LoadGameSave(u8 saveType); u16 GetSaveBlocksPointersBaseOffset(void); -u32 TryReadSpecialSaveSector(u8 sector, u8* dst); -u32 TryWriteSpecialSaveSector(u8 sector, u8* src); +u32 TryReadSpecialSaveSector(u8 sector, u8 *dst); +u32 TryWriteSpecialSaveSector(u8 sector, u8 *src); void Task_LinkFullSave(u8 taskId); // save_failed_screen.c diff --git a/include/script_menu.h b/include/script_menu.h index a690ef8b8..36b66bf98 100644 --- a/include/script_menu.h +++ b/include/script_menu.h @@ -12,7 +12,7 @@ bool8 (*ScriptMenu_HidePokemonPic(void))(void); int ConvertPixelWidthToTileWidth(int width); u8 CreateWindowFromRect(u8 x, u8 y, u8 width, u8 height); void ClearToTransparentAndRemoveWindow(u8 windowId); -int DisplayTextAndGetWidth(const u8* str, int width); +int DisplayTextAndGetWidth(const u8 *str, int width); int ScriptMenu_AdjustLeftCoordFromWidth(int left, int width); bool16 ScriptMenu_CreatePCMultichoice(void); void ScriptMenu_DisplayPCStartupPrompt(void); diff --git a/include/sound.h b/include/sound.h index a5463a456..b39a7306a 100644 --- a/include/sound.h +++ b/include/sound.h @@ -12,7 +12,6 @@ void StopMapMusic(void); void FadeOutMapMusic(u8 speed); void FadeOutAndPlayNewMapMusic(u16 songNum, u8 speed); void FadeOutAndFadeInNewMapMusic(u16 songNum, u8 fadeOutSpeed, u8 fadeInSpeed); -void FadeInNewMapMusic(u16 songNum, u8 speed); bool8 IsNotWaitingForBGMStop(void); void PlayFanfareByFanfareNum(u8 fanfareNum); bool8 WaitFanfare(bool8 stop); diff --git a/include/start_menu.h b/include/start_menu.h index 1ddd82066..94d0f9d5b 100644 --- a/include/start_menu.h +++ b/include/start_menu.h @@ -11,6 +11,6 @@ void SaveGame(void); void CB2_SetUpSaveAfterLinkBattle(void); void SaveForBattleTowerLink(void); void HideStartMenu(void); -void AppendToList(u8* list, u8* pos, u8 newEntry); +void AppendToList(u8 *list, u8 *pos, u8 newEntry); #endif // GUARD_START_MENU_H diff --git a/include/trade.h b/include/trade.h index 27b5ee8bd..d63749653 100644 --- a/include/trade.h +++ b/include/trade.h @@ -14,10 +14,10 @@ void CB2_StartCreateTradeMenu(void); void CB2_LinkTrade(void); int CanRegisterMonForTradingBoard(struct RfuGameCompatibilityData player, u16 species2, u16 species, bool8 isEventLegal); int GetUnionRoomTradeMessageId(struct RfuGameCompatibilityData player, struct RfuGameCompatibilityData partner, u16 playerSpecies2, u16 partnerSpecies, u8 requestedType, u16 playerSpecies, bool8 isEventLegal); -int CanSpinTradeMon(struct Pokemon*, u16); +int CanSpinTradeMon(struct Pokemon *, u16); void InitTradeSequenceBgGpuRegs(void); void LinkTradeDrawWindow(void); -void InitTradeBg(void); +void LoadTradeAnimGfx(void); void DrawTextOnTradeWindow(u8, const u8 *, u8); #endif //GUARD_TRADE_H diff --git a/include/util.h b/include/util.h index 77062de96..8f2079a0b 100644 --- a/include/util.h +++ b/include/util.h @@ -12,7 +12,7 @@ void LoadWordFromTwoHalfwords(u16 *, u32 *); int CountTrailingZeroBits(u32 value); u16 CalcCRC16(const u8 *data, s32 length); u16 CalcCRC16WithTable(const u8 *data, u32 length); -u32 CalcByteArraySum(const u8* data, u32 length); +u32 CalcByteArraySum(const u8 *data, u32 length); void BlendPalette(u16 palOffset, u16 numEntries, u8 coeff, u16 blendColor); void DoBgAffineSet(struct BgAffineDstData *dest, u32 texX, u32 texY, s16 scrX, s16 scrY, s16 sx, s16 sy, u16 alpha); void CopySpriteTiles(u8 shape, u8 size, u8 *tiles, u16 *tilemap, u8 *output); diff --git a/src/apprentice.c b/src/apprentice.c index f27528172..16ce0a859 100644 --- a/src/apprentice.c +++ b/src/apprentice.c @@ -1289,7 +1289,7 @@ static void Task_ExecuteFuncAfterButtonPress(u8 taskId) { if (JOY_NEW(A_BUTTON) || JOY_NEW(B_BUTTON)) { - gApprenticeFunc = (void*)(u32)(((u16)gTasks[taskId].data[0] | (gTasks[taskId].data[1] << 16))); + gApprenticeFunc = (void *)(u32)(((u16)gTasks[taskId].data[0] | (gTasks[taskId].data[1] << 16))); gApprenticeFunc(); DestroyTask(taskId); } diff --git a/src/battle_anim.c b/src/battle_anim.c index 4273ac607..375363212 100644 --- a/src/battle_anim.c +++ b/src/battle_anim.c @@ -676,13 +676,13 @@ void MoveBattlerSpriteToBG(u8 battlerId, bool8 toBG_2, bool8 setSpriteInvisible) if (IsContest() == TRUE) { - RequestDma3Fill(0, (void*)(BG_SCREEN_ADDR(16)), 0x2000, 1); - RequestDma3Fill(0xFF, (void*)(BG_SCREEN_ADDR(30)), 0x1000, 0); + RequestDma3Fill(0, (void *)(BG_SCREEN_ADDR(16)), 0x2000, 1); + RequestDma3Fill(0xFF, (void *)(BG_SCREEN_ADDR(30)), 0x1000, 0); } else { - RequestDma3Fill(0, (void*)(BG_SCREEN_ADDR(8)), 0x2000, 1); - RequestDma3Fill(0xFF, (void*)(BG_SCREEN_ADDR(28)), 0x1000, 0); + RequestDma3Fill(0, (void *)(BG_SCREEN_ADDR(8)), 0x2000, 1); + RequestDma3Fill(0xFF, (void *)(BG_SCREEN_ADDR(28)), 0x1000, 0); } GetBattleAnimBg1Data(&animBg); @@ -707,7 +707,7 @@ void MoveBattlerSpriteToBG(u8 battlerId, bool8 toBG_2, bool8 setSpriteInvisible) SetGpuReg(REG_OFFSET_BG1VOFS, gBattle_BG1_Y); LoadPalette(&gPlttBufferUnfaded[0x100 + battlerId * 16], animBg.paletteId * 16, 0x20); - CpuCopy32(&gPlttBufferUnfaded[0x100 + battlerId * 16], (void*)(BG_PLTT + animBg.paletteId * 32), 0x20); + CpuCopy32(&gPlttBufferUnfaded[0x100 + battlerId * 16], (void *)(BG_PLTT + animBg.paletteId * 32), 0x20); if (IsContest()) battlerPosition = 0; @@ -721,8 +721,8 @@ void MoveBattlerSpriteToBG(u8 battlerId, bool8 toBG_2, bool8 setSpriteInvisible) } else { - RequestDma3Fill(0, (void*)(BG_SCREEN_ADDR(12)), 0x2000, 1); - RequestDma3Fill(0, (void*)(BG_SCREEN_ADDR(30)), 0x1000, 1); + RequestDma3Fill(0, (void *)(BG_SCREEN_ADDR(12)), 0x2000, 1); + RequestDma3Fill(0, (void *)(BG_SCREEN_ADDR(30)), 0x1000, 1); GetBattleAnimBgData(&animBg, 2); CpuFill16(0, animBg.bgTiles + 0x1000, 0x1000); CpuFill16(0, animBg.bgTilemap + 0x400, 0x800); @@ -742,7 +742,7 @@ void MoveBattlerSpriteToBG(u8 battlerId, bool8 toBG_2, bool8 setSpriteInvisible) SetGpuReg(REG_OFFSET_BG2VOFS, gBattle_BG2_Y); LoadPalette(&gPlttBufferUnfaded[0x100 + battlerId * 16], 0x90, 0x20); - CpuCopy32(&gPlttBufferUnfaded[0x100 + battlerId * 16], (void*)(BG_PLTT + 0x120), 0x20); + CpuCopy32(&gPlttBufferUnfaded[0x100 + battlerId * 16], (void *)(BG_PLTT + 0x120), 0x20); DrawBattlerOnBg(2, 0, 0, GetBattlerPosition(battlerId), animBg.paletteId, animBg.bgTiles + 0x1000, animBg.bgTilemap + 0x400, animBg.tilesOffset); } @@ -1203,7 +1203,7 @@ static void LoadMoveBg(u16 bgId) void *dmaDest; LZDecompressWram(tilemap, gDecompressionBuffer); - RelocateBattleBgPal(GetBattleBgPaletteNum(), (void*)gDecompressionBuffer, 0x100, FALSE); + RelocateBattleBgPal(GetBattleBgPaletteNum(), (void *)gDecompressionBuffer, 0x100, FALSE); dmaSrc = gDecompressionBuffer; dmaDest = (void *)BG_SCREEN_ADDR(26); DmaCopy32(3, dmaSrc, dmaDest, 0x800); diff --git a/src/battle_anim_effects_1.c b/src/battle_anim_effects_1.c index 8f3b91b7d..0387d3929 100644 --- a/src/battle_anim_effects_1.c +++ b/src/battle_anim_effects_1.c @@ -2197,7 +2197,7 @@ const struct SpriteTemplate gTauntFingerSpriteTemplate = // arg 3: vertical movement speed (sub-pixel value) // arg 4: wave amplitude // arg 5: wave speed -static void AnimMovePowderParticle(struct Sprite* sprite) +static void AnimMovePowderParticle(struct Sprite *sprite) { sprite->x += gBattleAnimArgs[0]; sprite->y += gBattleAnimArgs[1]; @@ -2217,7 +2217,7 @@ static void AnimMovePowderParticle(struct Sprite* sprite) sprite->callback = AnimMovePowderParticle_Step; } -static void AnimMovePowderParticle_Step(struct Sprite* sprite) +static void AnimMovePowderParticle_Step(struct Sprite *sprite) { if (sprite->data[0] > 0) { @@ -2237,7 +2237,7 @@ static void AnimMovePowderParticle_Step(struct Sprite* sprite) // arg 0: initial x pixel offset // arg 1: initial y pixel offset // arg 2: duration -static void AnimPowerAbsorptionOrb(struct Sprite* sprite) +static void AnimPowerAbsorptionOrb(struct Sprite *sprite) { InitSpritePosToAnimAttacker(sprite, TRUE); sprite->data[0] = gBattleAnimArgs[2]; @@ -2252,7 +2252,7 @@ static void AnimPowerAbsorptionOrb(struct Sprite* sprite) // arg 1: initial y pixel offset // arg 2: duration // arg 3: sprite anim number -static void AnimSolarBeamBigOrb(struct Sprite* sprite) +static void AnimSolarBeamBigOrb(struct Sprite *sprite) { InitSpritePosToAnimAttacker(sprite, TRUE); StartSpriteAnim(sprite, gBattleAnimArgs[3]); @@ -2269,7 +2269,7 @@ static void AnimSolarBeamBigOrb(struct Sprite* sprite) // arg 1: initial y pixel offset // arg 2: duration // arg 3: initial wave offset -static void AnimSolarBeamSmallOrb(struct Sprite* sprite) +static void AnimSolarBeamSmallOrb(struct Sprite *sprite) { InitSpritePosToAnimAttacker(sprite, TRUE); sprite->data[0] = gBattleAnimArgs[2]; @@ -2283,7 +2283,7 @@ static void AnimSolarBeamSmallOrb(struct Sprite* sprite) sprite->callback(sprite); } -static void AnimSolarBeamSmallOrb_Step(struct Sprite* sprite) +static void AnimSolarBeamSmallOrb_Step(struct Sprite *sprite) { if (AnimTranslateLinear(sprite)) { @@ -2327,7 +2327,7 @@ void AnimTask_CreateSmallSolarBeamOrbs(u8 taskId) // arg 1: initial y pixel offset // arg 2: wave amplitude // arg 3: wave period (lower means faster wave) -static void AnimAbsorptionOrb(struct Sprite* sprite) +static void AnimAbsorptionOrb(struct Sprite *sprite) { InitSpritePosToAnimTarget(sprite, TRUE); sprite->data[0] = gBattleAnimArgs[3]; @@ -2338,7 +2338,7 @@ static void AnimAbsorptionOrb(struct Sprite* sprite) sprite->callback = AnimAbsorptionOrb_Step; } -static void AnimAbsorptionOrb_Step(struct Sprite* sprite) +static void AnimAbsorptionOrb_Step(struct Sprite *sprite) { if (TranslateAnimHorizontalArc(sprite)) DestroyAnimSprite(sprite); @@ -2346,7 +2346,7 @@ static void AnimAbsorptionOrb_Step(struct Sprite* sprite) // Moves an orb in a wave-like fashion towards the target mon. The wave's // properties and the sprite anim are randomly determined. -static void AnimHyperBeamOrb(struct Sprite* sprite) +static void AnimHyperBeamOrb(struct Sprite *sprite) { u16 speed; u16 animNum = Random2(); @@ -2372,7 +2372,7 @@ static void AnimHyperBeamOrb(struct Sprite* sprite) sprite->callback(sprite); } -static void AnimHyperBeamOrb_Step(struct Sprite* sprite) +static void AnimHyperBeamOrb_Step(struct Sprite *sprite) { if (AnimFastTranslateLinear(sprite)) { @@ -2399,7 +2399,7 @@ static void AnimHyperBeamOrb_Step(struct Sprite* sprite) // arg 3: target y pixel offset // arg 4: duration // arg 5: wave amplitude -static void AnimLeechSeed(struct Sprite* sprite) +static void AnimLeechSeed(struct Sprite *sprite) { InitSpritePosToAnimAttacker(sprite, TRUE); if (GetBattlerSide(gBattleAnimAttacker) != B_SIDE_PLAYER) @@ -2413,7 +2413,7 @@ static void AnimLeechSeed(struct Sprite* sprite) sprite->callback = AnimLeechSeed_Step; } -static void AnimLeechSeed_Step(struct Sprite* sprite) +static void AnimLeechSeed_Step(struct Sprite *sprite) { if (TranslateAnimHorizontalArc(sprite)) { @@ -2424,7 +2424,7 @@ static void AnimLeechSeed_Step(struct Sprite* sprite) } } -static void AnimLeechSeedSprouts(struct Sprite* sprite) +static void AnimLeechSeedSprouts(struct Sprite *sprite) { sprite->invisible = FALSE; StartSpriteAnim(sprite, 1); @@ -2441,7 +2441,7 @@ static void AnimLeechSeedSprouts(struct Sprite* sprite) // arg 2: initial wave offset // arg 3: duration // arg 4: blend (0 = off, 1 = on) -static void AnimSporeParticle(struct Sprite* sprite) +static void AnimSporeParticle(struct Sprite *sprite) { InitSpritePosToAnimTarget(sprite, TRUE); StartSpriteAnim(sprite, gBattleAnimArgs[4]); @@ -2454,7 +2454,7 @@ static void AnimSporeParticle(struct Sprite* sprite) sprite->callback(sprite); } -static void AnimSporeParticle_Step(struct Sprite* sprite) +static void AnimSporeParticle_Step(struct Sprite *sprite) { sprite->x2 = Sin(sprite->data[1], 32); sprite->y2 = Cos(sprite->data[1], -3) + ((sprite->data[2] += 24) >> 8); @@ -2503,7 +2503,7 @@ void AnimTask_SporeDoubleBattle(u8 taskId) // arg 1: initial y pixel offset // arg 2: target y pixel offset // arg 3: duration -static void AnimPetalDanceBigFlower(struct Sprite* sprite) +static void AnimPetalDanceBigFlower(struct Sprite *sprite) { InitSpritePosToAnimAttacker(sprite, FALSE); sprite->data[0] = gBattleAnimArgs[3]; @@ -2517,7 +2517,7 @@ static void AnimPetalDanceBigFlower(struct Sprite* sprite) sprite->callback(sprite); } -static void AnimPetalDanceBigFlower_Step(struct Sprite* sprite) +static void AnimPetalDanceBigFlower_Step(struct Sprite *sprite) { if (!AnimTranslateLinear(sprite)) { @@ -2541,7 +2541,7 @@ static void AnimPetalDanceBigFlower_Step(struct Sprite* sprite) // arg 1: initial y pixel offset // arg 2: target y pixel offset // arg 3: duration -static void AnimPetalDanceSmallFlower(struct Sprite* sprite) +static void AnimPetalDanceSmallFlower(struct Sprite *sprite) { InitSpritePosToAnimAttacker(sprite, TRUE); sprite->data[0] = gBattleAnimArgs[3]; @@ -2555,7 +2555,7 @@ static void AnimPetalDanceSmallFlower(struct Sprite* sprite) sprite->callback(sprite); } -static void AnimPetalDanceSmallFlower_Step(struct Sprite* sprite) +static void AnimPetalDanceSmallFlower_Step(struct Sprite *sprite) { if (!AnimTranslateLinear(sprite)) { @@ -2576,7 +2576,7 @@ static void AnimPetalDanceSmallFlower_Step(struct Sprite* sprite) // arg 0: upward x delta per frame // arg 1: upward y delta per frame // arg 2: upward duration -static void AnimRazorLeafParticle(struct Sprite* sprite) +static void AnimRazorLeafParticle(struct Sprite *sprite) { sprite->x = GetBattlerSpriteCoord(gBattleAnimAttacker, BATTLER_COORD_X_2); sprite->y = GetBattlerSpriteCoord(gBattleAnimAttacker, BATTLER_COORD_Y_PIC_OFFSET); @@ -2586,7 +2586,7 @@ static void AnimRazorLeafParticle(struct Sprite* sprite) sprite->callback = AnimRazorLeafParticle_Step1; } -static void AnimRazorLeafParticle_Step1(struct Sprite* sprite) +static void AnimRazorLeafParticle_Step1(struct Sprite *sprite) { if (!sprite->data[2]) { @@ -2612,7 +2612,7 @@ static void AnimRazorLeafParticle_Step1(struct Sprite* sprite) } } -static void AnimRazorLeafParticle_Step2(struct Sprite* sprite) +static void AnimRazorLeafParticle_Step2(struct Sprite *sprite) { if (GetBattlerSide(gBattleAnimAttacker)) sprite->x2 = -Sin(sprite->data[0], 25); @@ -2639,7 +2639,7 @@ static void AnimRazorLeafParticle_Step2(struct Sprite* sprite) // arg 4: translation duration // arg 5: wave amplitude // arg 6: target between double battle opponents (boolean) -static void AnimTranslateLinearSingleSineWave(struct Sprite* sprite) +static void AnimTranslateLinearSingleSineWave(struct Sprite *sprite) { InitSpritePosToAnimAttacker(sprite, TRUE); if (GetBattlerSide(gBattleAnimAttacker) != B_SIDE_PLAYER) @@ -2668,7 +2668,7 @@ static void AnimTranslateLinearSingleSineWave(struct Sprite* sprite) sprite->callback = AnimTranslateLinearSingleSineWave_Step; } -static void AnimTranslateLinearSingleSineWave_Step(struct Sprite* sprite) +static void AnimTranslateLinearSingleSineWave_Step(struct Sprite *sprite) { bool8 destroy = FALSE; s16 a = sprite->data[0]; @@ -2706,7 +2706,7 @@ static void AnimTranslateLinearSingleSineWave_Step(struct Sprite* sprite) // arg 2: wave period (higher means faster wave) // arg 3: wave amplitude // arg 4: speedup frame (particles move faster at the end of the animation) -void AnimMoveTwisterParticle(struct Sprite* sprite) +void AnimMoveTwisterParticle(struct Sprite *sprite) { if (IsDoubleBattle() == TRUE) SetAverageBattlerPositions(gBattleAnimTarget, TRUE, &sprite->x, &sprite->y); @@ -2720,7 +2720,7 @@ void AnimMoveTwisterParticle(struct Sprite* sprite) sprite->callback = AnimMoveTwisterParticle_Step; } -static void AnimMoveTwisterParticle_Step(struct Sprite* sprite) +static void AnimMoveTwisterParticle_Step(struct Sprite *sprite) { if (sprite->data[1] == 0xFF) { @@ -2753,7 +2753,7 @@ static void AnimMoveTwisterParticle_Step(struct Sprite* sprite) // arg 1: initial y pixel offset // arg 2: affine anim num // arg 3: num squeezes -static void AnimConstrictBinding(struct Sprite* sprite) +static void AnimConstrictBinding(struct Sprite *sprite) { InitSpritePosToAnimTarget(sprite, FALSE); sprite->affineAnimPaused = 1; @@ -2763,7 +2763,7 @@ static void AnimConstrictBinding(struct Sprite* sprite) sprite->callback = AnimConstrictBinding_Step1; } -static void AnimConstrictBinding_Step1(struct Sprite* sprite) +static void AnimConstrictBinding_Step1(struct Sprite *sprite) { u8 spriteId; @@ -2776,7 +2776,7 @@ static void AnimConstrictBinding_Step1(struct Sprite* sprite) } } -static void AnimConstrictBinding_Step2(struct Sprite* sprite) +static void AnimConstrictBinding_Step2(struct Sprite *sprite) { u8 spriteId = GetAnimBattlerSpriteId(ANIM_TARGET); if (!sprite->data[2]) @@ -2870,7 +2870,7 @@ static void AnimTask_DuplicateAndShrinkToPos_Step2(u8 taskId) // Moves an orb from the target mon to the attacking mon. // arg 0: initial x pixel offset // arg 1: initial y pixel offset -static void AnimMimicOrb(struct Sprite* sprite) +static void AnimMimicOrb(struct Sprite *sprite) { switch (sprite->data[0]) { @@ -2904,7 +2904,7 @@ static void AnimMimicOrb(struct Sprite* sprite) // arg 2: sprite subpriority offset // arg 3: sprite anim num // arg 4: duration -static void AnimIngrainRoot(struct Sprite* sprite) +static void AnimIngrainRoot(struct Sprite *sprite) { if (!sprite->data[0]) { @@ -2952,7 +2952,7 @@ static void AnimFrenzyPlantRoot(struct Sprite *sprite) sFrenzyPlantRootData.targetY = targetY; } -static void AnimRootFlickerOut(struct Sprite* sprite) +static void AnimRootFlickerOut(struct Sprite *sprite) { if (++sprite->data[0] > (sprite->data[2] - 10)) sprite->invisible = sprite->data[0] % 2; @@ -2967,7 +2967,7 @@ static void AnimRootFlickerOut(struct Sprite* sprite) // arg 2: horizontal velocity // arg 3: wave amplitude // arg 4: duration -static void AnimIngrainOrb(struct Sprite* sprite) +static void AnimIngrainOrb(struct Sprite *sprite) { if (!sprite->data[0]) { @@ -2985,7 +2985,7 @@ static void AnimIngrainOrb(struct Sprite* sprite) DestroyAnimSprite(sprite); } -static void InitItemBagData(struct Sprite* sprite, s16 c) +static void InitItemBagData(struct Sprite *sprite, s16 c) { int a = (sprite->x << 8) | sprite->y; int b = (sprite->data[6] << 8) | sprite->data[7]; @@ -2995,7 +2995,7 @@ static void InitItemBagData(struct Sprite* sprite, s16 c) sprite->data[7] = c; } -bool8 moveAlongLinearPath(struct Sprite* sprite) +bool8 moveAlongLinearPath(struct Sprite *sprite) { u16 xStartPos = (u8)(sprite->data[5] >> 8); u16 yStartPos = (u8)sprite->data[5]; @@ -3026,7 +3026,7 @@ bool8 moveAlongLinearPath(struct Sprite* sprite) return FALSE; } -static void AnimItemSteal_Step2(struct Sprite* sprite) +static void AnimItemSteal_Step2(struct Sprite *sprite) { if (sprite->data[0] == 10) StartSpriteAffineAnim(sprite, 1); @@ -3036,7 +3036,7 @@ static void AnimItemSteal_Step2(struct Sprite* sprite) DestroyAnimSprite(sprite); } -static void AnimItemSteal_Step1(struct Sprite* sprite) +static void AnimItemSteal_Step1(struct Sprite *sprite) { sprite->data[0] += sprite->data[3] * 128 / sprite->data[4]; if (sprite->data[0] >= 128) @@ -3054,7 +3054,7 @@ static void AnimItemSteal_Step1(struct Sprite* sprite) } } -static void AnimPresent(struct Sprite* sprite) +static void AnimPresent(struct Sprite *sprite) { s16 targetX; s16 targetY; @@ -3080,7 +3080,7 @@ static void AnimPresent(struct Sprite* sprite) sprite->callback = AnimItemSteal_Step1; } -static void AnimKnockOffOpponentsItem(struct Sprite* sprite) +static void AnimKnockOffOpponentsItem(struct Sprite *sprite) { int zero; sprite->data[0] += ((sprite->data[3] * 128) / sprite->data[4]); @@ -3100,7 +3100,7 @@ static void AnimKnockOffOpponentsItem(struct Sprite* sprite) } } -static void AnimKnockOffItem(struct Sprite* sprite) +static void AnimKnockOffItem(struct Sprite *sprite) { s16 targetY = GetBattlerSpriteCoord(gBattleAnimTarget, BATTLER_COORD_Y); if (GetBattlerSide(gBattleAnimTarget) == B_SIDE_PLAYER) @@ -3131,7 +3131,7 @@ static void AnimKnockOffItem(struct Sprite* sprite) // arg 1: initial y pixel offset // arg 2: vertical velocity // arg 3: unused -static void AnimPresentHealParticle(struct Sprite* sprite) +static void AnimPresentHealParticle(struct Sprite *sprite) { if (!sprite->data[0]) { @@ -3145,7 +3145,7 @@ static void AnimPresentHealParticle(struct Sprite* sprite) DestroyAnimSprite(sprite); } -static void AnimItemSteal(struct Sprite* sprite) +static void AnimItemSteal(struct Sprite *sprite) { s16 attackerX; s16 attackerY; @@ -3171,7 +3171,7 @@ static void AnimItemSteal(struct Sprite* sprite) sprite->callback = AnimItemSteal_Step3; } -static void AnimItemSteal_Step3(struct Sprite* sprite) +static void AnimItemSteal_Step3(struct Sprite *sprite) { int zero; sprite->data[0] += ((sprite->data[3] * 128) / sprite->data[4]); @@ -3198,7 +3198,7 @@ static void AnimItemSteal_Step3(struct Sprite* sprite) // Moves a bag in a circular motion. // arg 0: y position // arg 1: initial wave offset -static void AnimTrickBag(struct Sprite* sprite) +static void AnimTrickBag(struct Sprite *sprite) { int a; int b; @@ -3235,7 +3235,7 @@ static void AnimTrickBag(struct Sprite* sprite) } } -static void AnimTrickBag_Step1(struct Sprite* sprite) +static void AnimTrickBag_Step1(struct Sprite *sprite) { switch (sprite->data[3]) { @@ -3265,7 +3265,7 @@ static void AnimTrickBag_Step1(struct Sprite* sprite) } } -static void AnimTrickBag_Step2(struct Sprite* sprite) +static void AnimTrickBag_Step2(struct Sprite *sprite) { if (sprite->data[2] == gTrickBagCoordinates[sprite->data[0]][1]) { @@ -3295,7 +3295,7 @@ static void AnimTrickBag_Step2(struct Sprite* sprite) } } -static void AnimTrickBag_Step3(struct Sprite* sprite) +static void AnimTrickBag_Step3(struct Sprite *sprite) { if (sprite->data[0] > 20) DestroyAnimSprite(sprite); @@ -3332,8 +3332,8 @@ void AnimTask_LeafBlade(u8 taskId) static void AnimTask_LeafBlade_Step(u8 taskId) { - struct Task* task = &gTasks[taskId]; - struct Sprite* sprite = &gSprites[task->data[2]]; + struct Task *task = &gTasks[taskId]; + struct Sprite *sprite = &gSprites[task->data[2]]; int a = task->data[0]; switch (a) { @@ -3515,7 +3515,7 @@ static void AnimTask_LeafBlade_Step(u8 taskId) } } -static s16 LeafBladeGetPosFactor(struct Sprite* sprite) +static s16 LeafBladeGetPosFactor(struct Sprite *sprite) { s16 var = 8; if (sprite->data[4] < sprite->y) @@ -3524,7 +3524,7 @@ static s16 LeafBladeGetPosFactor(struct Sprite* sprite) return var; } -static void AnimTask_LeafBlade_Step2(struct Task* task, u8 taskId) +static void AnimTask_LeafBlade_Step2(struct Task *task, u8 taskId) { task->data[14]++; if (task->data[14] > 0) @@ -3550,7 +3550,7 @@ static void AnimTask_LeafBlade_Step2(struct Task* task, u8 taskId) } } -static void AnimTask_LeafBlade_Step2_Callback(struct Sprite* sprite) +static void AnimTask_LeafBlade_Step2_Callback(struct Sprite *sprite) { sprite->data[0]++; if (sprite->data[0] > 1) @@ -3566,7 +3566,7 @@ static void AnimTask_LeafBlade_Step2_Callback(struct Sprite* sprite) } } -static void AnimFlyingParticle(struct Sprite* sprite) +static void AnimFlyingParticle(struct Sprite *sprite) { u8 battler; if (!gBattleAnimArgs[6]) @@ -3614,7 +3614,7 @@ static void AnimFlyingParticle(struct Sprite* sprite) sprite->callback = AnimFlyingParticle_Step; } -static void AnimFlyingParticle_Step(struct Sprite* sprite) +static void AnimFlyingParticle_Step(struct Sprite *sprite) { int a = sprite->data[7]; sprite->data[7]++; @@ -3637,7 +3637,7 @@ static void AnimFlyingParticle_Step(struct Sprite* sprite) void AnimTask_CycleMagicalLeafPal(u8 taskId) { - struct Task* task = &gTasks[taskId]; + struct Task *task = &gTasks[taskId]; switch (task->data[0]) { case 0: @@ -3665,7 +3665,7 @@ void AnimTask_CycleMagicalLeafPal(u8 taskId) DestroyAnimVisualTask(taskId); } -static void AnimNeedleArmSpike(struct Sprite* sprite) +static void AnimNeedleArmSpike(struct Sprite *sprite) { u8 a; u8 b; @@ -3721,7 +3721,7 @@ static void AnimNeedleArmSpike(struct Sprite* sprite) } } -static void AnimNeedleArmSpike_Step(struct Sprite* sprite) +static void AnimNeedleArmSpike_Step(struct Sprite *sprite) { if (sprite->data[0]) { @@ -3737,13 +3737,13 @@ static void AnimNeedleArmSpike_Step(struct Sprite* sprite) } } -static void AnimWhipHit_WaitEnd(struct Sprite* sprite) +static void AnimWhipHit_WaitEnd(struct Sprite *sprite) { if (sprite->animEnded) DestroyAnimSprite(sprite); } -static void AnimSlidingHit(struct Sprite* sprite) +static void AnimSlidingHit(struct Sprite *sprite) { if (GetBattlerSide(gBattleAnimAttacker) != B_SIDE_PLAYER) { @@ -3760,7 +3760,7 @@ static void AnimSlidingHit(struct Sprite* sprite) StoreSpriteCallbackInData6(sprite, DestroyAnimSprite); } -static void AnimWhipHit(struct Sprite* sprite) +static void AnimWhipHit(struct Sprite *sprite) { if (GetBattlerSide(gBattleAnimAttacker) == B_SIDE_PLAYER) StartSpriteAnim(sprite, 1); @@ -3770,7 +3770,7 @@ static void AnimWhipHit(struct Sprite* sprite) sprite->y += gBattleAnimArgs[1]; } -static void AnimFlickeringPunch(struct Sprite* sprite) +static void AnimFlickeringPunch(struct Sprite *sprite) { sprite->x += gBattleAnimArgs[0]; sprite->y += gBattleAnimArgs[1]; @@ -3788,7 +3788,7 @@ static void AnimFlickeringPunch(struct Sprite* sprite) // arg 0: initial x pixel offset // arg 1: initial y pixel offset // arg 2: slice direction; 0 = right-to-left, 1 = left-to-right -static void AnimCuttingSlice(struct Sprite* sprite) +static void AnimCuttingSlice(struct Sprite *sprite) { sprite->x = GetBattlerSpriteCoord(gBattleAnimTarget, BATTLER_COORD_X); sprite->y = GetBattlerSpriteCoord(gBattleAnimTarget, BATTLER_COORD_Y); @@ -3814,7 +3814,7 @@ static void AnimCuttingSlice(struct Sprite* sprite) sprite->data[1] = -sprite->data[1]; } -static void AnimAirCutterSlice(struct Sprite* sprite) +static void AnimAirCutterSlice(struct Sprite *sprite) { u8 x, y; switch (gBattleAnimArgs[3]) @@ -3863,7 +3863,7 @@ static void AnimAirCutterSlice(struct Sprite* sprite) sprite->data[1] = -sprite->data[1]; } -static void AnimSlice_Step(struct Sprite* sprite) +static void AnimSlice_Step(struct Sprite *sprite) { sprite->data[3] += sprite->data[1]; sprite->data[4] += sprite->data[2]; @@ -3884,7 +3884,7 @@ static void AnimSlice_Step(struct Sprite* sprite) } } -static void UnusedFlickerAnim(struct Sprite* sprite) +static void UnusedFlickerAnim(struct Sprite *sprite) { if (sprite->data[2] > 1) { @@ -3917,7 +3917,7 @@ static void UnusedFlickerAnim(struct Sprite* sprite) } } -static void AnimCirclingMusicNote(struct Sprite* sprite) +static void AnimCirclingMusicNote(struct Sprite *sprite) { sprite->data[0] = gBattleAnimArgs[2]; if (GetBattlerSide(gBattleAnimAttacker) != B_SIDE_PLAYER) @@ -3933,7 +3933,7 @@ static void AnimCirclingMusicNote(struct Sprite* sprite) sprite->callback(sprite); } -static void AnimCirclingMusicNote_Step(struct Sprite* sprite) +static void AnimCirclingMusicNote_Step(struct Sprite *sprite) { sprite->x2 = Cos(sprite->data[0], 100); sprite->y2 = Sin(sprite->data[0], 20); @@ -3950,7 +3950,7 @@ static void AnimCirclingMusicNote_Step(struct Sprite* sprite) DestroyAnimSprite(sprite); } -static void AnimProtect(struct Sprite* sprite) +static void AnimProtect(struct Sprite *sprite) { if (IsContest()) gBattleAnimArgs[1] += 8; @@ -4013,7 +4013,7 @@ static void AnimProtect_Step(struct Sprite *sprite) } } -static void AnimMilkBottle(struct Sprite* sprite) +static void AnimMilkBottle(struct Sprite *sprite) { sprite->x = GetBattlerSpriteCoord(gBattleAnimTarget, BATTLER_COORD_X_2); sprite->y = GetBattlerSpriteCoord(gBattleAnimTarget, BATTLER_COORD_Y_PIC_OFFSET) + 0xFFE8; @@ -4029,7 +4029,7 @@ static void AnimMilkBottle(struct Sprite* sprite) sprite->callback = AnimMilkBottle_Step1; } -static void AnimMilkBottle_Step1(struct Sprite* sprite) +static void AnimMilkBottle_Step1(struct Sprite *sprite) { switch (sprite->data[0]) { @@ -4102,7 +4102,7 @@ static void AnimMilkBottle_Step1(struct Sprite* sprite) } } -static void AnimMilkBottle_Step2(struct Sprite* sprite, int unk1, int unk2) +static void AnimMilkBottle_Step2(struct Sprite *sprite, int unk1, int unk2) { if (sprite->data[3] <= 11) sprite->data[4] += 2; @@ -4123,7 +4123,7 @@ static void AnimMilkBottle_Step2(struct Sprite* sprite, int unk1, int unk2) sprite->data[3] = 0; } -static void AnimGrantingStars(struct Sprite* sprite) +static void AnimGrantingStars(struct Sprite *sprite) { if (!gBattleAnimArgs[2]) SetSpriteCoordsToAnimAttackerCoords(sprite); @@ -4137,7 +4137,7 @@ static void AnimGrantingStars(struct Sprite* sprite) sprite->callback = TranslateSpriteLinearFixedPoint; } -static void AnimSparkingStars(struct Sprite* sprite) +static void AnimSparkingStars(struct Sprite *sprite) { u8 battler; if (!gBattleAnimArgs[2]) @@ -4174,7 +4174,7 @@ static void AnimSparkingStars(struct Sprite* sprite) sprite->callback = TranslateSpriteLinearFixedPoint; } -static void AnimBubbleBurst(struct Sprite* sprite) +static void AnimBubbleBurst(struct Sprite *sprite) { SetSpriteCoordsToAnimAttackerCoords(sprite); if (GetBattlerSide(gBattleAnimAttacker) == B_SIDE_PLAYER) @@ -4192,7 +4192,7 @@ static void AnimBubbleBurst(struct Sprite* sprite) sprite->callback = AnimBubbleBurst_Step; } -static void AnimBubbleBurst_Step(struct Sprite* sprite) +static void AnimBubbleBurst_Step(struct Sprite *sprite) { if (++sprite->data[0] > 30) { @@ -4205,7 +4205,7 @@ static void AnimBubbleBurst_Step(struct Sprite* sprite) DestroyAnimSprite(sprite); } -static void AnimSleepLetterZ(struct Sprite* sprite) +static void AnimSleepLetterZ(struct Sprite *sprite) { SetSpriteCoordsToAnimAttackerCoords(sprite); if (GetBattlerSide(gBattleAnimAttacker) == B_SIDE_PLAYER) @@ -4225,7 +4225,7 @@ static void AnimSleepLetterZ(struct Sprite* sprite) sprite->callback = AnimSleepLetterZ_Step; } -static void AnimSleepLetterZ_Step(struct Sprite* sprite) +static void AnimSleepLetterZ_Step(struct Sprite *sprite) { sprite->y2 = -(sprite->data[0] / 0x28); sprite->x2 = sprite->data[4] / 10; @@ -4235,7 +4235,7 @@ static void AnimSleepLetterZ_Step(struct Sprite* sprite) DestroySpriteAndMatrix(sprite); } -static void AnimLockOnTarget(struct Sprite* sprite) +static void AnimLockOnTarget(struct Sprite *sprite) { sprite->x -= 32; sprite->y -= 32; @@ -4244,7 +4244,7 @@ static void AnimLockOnTarget(struct Sprite* sprite) StoreSpriteCallbackInData6(sprite, AnimLockOnTarget_Step1); } -static void AnimLockOnTarget_Step1(struct Sprite* sprite) +static void AnimLockOnTarget_Step1(struct Sprite *sprite) { switch (sprite->data[5] & 1) { @@ -4271,7 +4271,7 @@ static void AnimLockOnTarget_Step1(struct Sprite* sprite) sprite->data[5] ^= 1; } -static void AnimLockOnTarget_Step2(struct Sprite* sprite) +static void AnimLockOnTarget_Step2(struct Sprite *sprite) { if ((sprite->data[5] >> 8) == 4) { @@ -4285,7 +4285,7 @@ static void AnimLockOnTarget_Step2(struct Sprite* sprite) } } -static void AnimLockOnTarget_Step3(struct Sprite* sprite) +static void AnimLockOnTarget_Step3(struct Sprite *sprite) { s16 a; s16 b; @@ -4331,7 +4331,7 @@ static void AnimLockOnTarget_Step3(struct Sprite* sprite) } } -static void AnimLockOnTarget_Step4(struct Sprite* sprite) +static void AnimLockOnTarget_Step4(struct Sprite *sprite) { if (sprite->data[2] == 0) { @@ -4358,7 +4358,7 @@ static void AnimLockOnTarget_Step4(struct Sprite* sprite) } } -static void AnimLockOnTarget_Step5(struct Sprite* sprite) +static void AnimLockOnTarget_Step5(struct Sprite *sprite) { if ((u16)gBattleAnimArgs[7] == 0xFFFF) { @@ -4368,7 +4368,7 @@ static void AnimLockOnTarget_Step5(struct Sprite* sprite) } } -static void AnimLockOnTarget_Step6(struct Sprite* sprite) +static void AnimLockOnTarget_Step6(struct Sprite *sprite) { if (sprite->data[0] % 3 == 0) { @@ -4381,7 +4381,7 @@ static void AnimLockOnTarget_Step6(struct Sprite* sprite) DestroyAnimSprite(sprite); } -static void AnimLockOnMoveTarget(struct Sprite* sprite) +static void AnimLockOnMoveTarget(struct Sprite *sprite) { sprite->oam.affineParam = gBattleAnimArgs[0]; if ((s16)sprite->oam.affineParam == 1) @@ -4413,7 +4413,7 @@ static void AnimLockOnMoveTarget(struct Sprite* sprite) sprite->callback(sprite); } -static void AnimBowMon(struct Sprite* sprite) +static void AnimBowMon(struct Sprite *sprite) { sprite->invisible = TRUE; sprite->data[0] = 0; @@ -4434,7 +4434,7 @@ static void AnimBowMon(struct Sprite* sprite) } } -static void AnimBowMon_Step1(struct Sprite* sprite) +static void AnimBowMon_Step1(struct Sprite *sprite) { sprite->data[0] = 6; sprite->data[1] = (GetBattlerSide(gBattleAnimAttacker)) ? 2 : -2; @@ -4444,7 +4444,7 @@ static void AnimBowMon_Step1(struct Sprite* sprite) sprite->callback = TranslateSpriteLinearById; } -static void AnimBowMon_Step1_Callback(struct Sprite* sprite) +static void AnimBowMon_Step1_Callback(struct Sprite *sprite) { if (sprite->data[0] == 0) { @@ -4464,7 +4464,7 @@ static void AnimBowMon_Step1_Callback(struct Sprite* sprite) } } -static void AnimBowMon_Step2(struct Sprite* sprite) +static void AnimBowMon_Step2(struct Sprite *sprite) { sprite->data[0] = 4; sprite->data[1] = (GetBattlerSide(gBattleAnimAttacker)) ? -3 : 3; @@ -4474,7 +4474,7 @@ static void AnimBowMon_Step2(struct Sprite* sprite) sprite->callback = TranslateSpriteLinearById; } -static void AnimBowMon_Step3(struct Sprite* sprite) +static void AnimBowMon_Step3(struct Sprite *sprite) { if (++sprite->data[0] > 8) { @@ -4483,7 +4483,7 @@ static void AnimBowMon_Step3(struct Sprite* sprite) } } -static void AnimBowMon_Step3_Callback(struct Sprite* sprite) +static void AnimBowMon_Step3_Callback(struct Sprite *sprite) { if (sprite->data[0] == 0) { @@ -4511,7 +4511,7 @@ static void AnimBowMon_Step3_Callback(struct Sprite* sprite) } } -static void AnimBowMon_Step4(struct Sprite* sprite) +static void AnimBowMon_Step4(struct Sprite *sprite) { DestroyAnimSprite(sprite); } @@ -4690,7 +4690,7 @@ static void AnimTask_SkullBashPositionSet(u8 taskId) static void AnimTask_SkullBashPositionReset(u8 taskId) { - struct Task* task = &gTasks[taskId]; + struct Task *task = &gTasks[taskId]; if (task->data[3]) { task->data[4] -= task->data[5]; @@ -4705,7 +4705,7 @@ static void AnimTask_SkullBashPositionReset(u8 taskId) } } -static void AnimSlashSlice(struct Sprite* sprite) +static void AnimSlashSlice(struct Sprite *sprite) { if (gBattleAnimArgs[0] == 0) { @@ -4724,7 +4724,7 @@ static void AnimSlashSlice(struct Sprite* sprite) sprite->callback = RunStoredCallbackWhenAnimEnds; } -static void AnimFalseSwipeSlice(struct Sprite* sprite) +static void AnimFalseSwipeSlice(struct Sprite *sprite) { sprite->x = GetBattlerSpriteCoord(gBattleAnimTarget, BATTLER_COORD_X_2) + 0xFFD0; sprite->y = GetBattlerSpriteCoord(gBattleAnimTarget, BATTLER_COORD_Y_PIC_OFFSET); @@ -4732,7 +4732,7 @@ static void AnimFalseSwipeSlice(struct Sprite* sprite) sprite->callback = RunStoredCallbackWhenAnimEnds; } -static void AnimFalseSwipePositionedSlice(struct Sprite* sprite) +static void AnimFalseSwipePositionedSlice(struct Sprite *sprite) { sprite->x = sprite->x = GetBattlerSpriteCoord(gBattleAnimTarget, BATTLER_COORD_X_2) + 0xFFD0 + gBattleAnimArgs[0]; sprite->y = GetBattlerSpriteCoord(gBattleAnimTarget, BATTLER_COORD_Y_PIC_OFFSET); @@ -4742,7 +4742,7 @@ static void AnimFalseSwipePositionedSlice(struct Sprite* sprite) sprite->callback = AnimFalseSwipeSlice_Step3; } -static void AnimFalseSwipeSlice_Step1(struct Sprite* sprite) +static void AnimFalseSwipeSlice_Step1(struct Sprite *sprite) { if (++sprite->data[0] > 8) { @@ -4754,14 +4754,14 @@ static void AnimFalseSwipeSlice_Step1(struct Sprite* sprite) } } -static void AnimFalseSwipeSlice_Step2(struct Sprite* sprite) +static void AnimFalseSwipeSlice_Step2(struct Sprite *sprite) { sprite->data[0] = 0; sprite->data[1] = 0; sprite->callback = AnimFalseSwipeSlice_Step3; } -static void AnimFalseSwipeSlice_Step3(struct Sprite* sprite) +static void AnimFalseSwipeSlice_Step3(struct Sprite *sprite) { if (++sprite->data[0] > 1) { @@ -4772,7 +4772,7 @@ static void AnimFalseSwipeSlice_Step3(struct Sprite* sprite) } } -static void AnimEndureEnergy(struct Sprite* sprite) +static void AnimEndureEnergy(struct Sprite *sprite) { if (gBattleAnimArgs[0] == 0) { @@ -4790,7 +4790,7 @@ static void AnimEndureEnergy(struct Sprite* sprite) sprite->callback = AnimEndureEnergy_Step; } -static void AnimEndureEnergy_Step(struct Sprite* sprite) +static void AnimEndureEnergy_Step(struct Sprite *sprite) { if (++sprite->data[0] > sprite->data[1]) { @@ -4803,7 +4803,7 @@ static void AnimEndureEnergy_Step(struct Sprite* sprite) DestroyAnimSprite(sprite); } -static void AnimSharpenSphere(struct Sprite* sprite) +static void AnimSharpenSphere(struct Sprite *sprite) { sprite->x = GetBattlerSpriteCoord(gBattleAnimAttacker, BATTLER_COORD_X_2); sprite->y = GetBattlerSpriteCoord(gBattleAnimAttacker, BATTLER_COORD_Y_PIC_OFFSET) - 12; @@ -4816,7 +4816,7 @@ static void AnimSharpenSphere(struct Sprite* sprite) sprite->callback = AnimSharpenSphere_Step; } -static void AnimSharpenSphere_Step(struct Sprite* sprite) +static void AnimSharpenSphere_Step(struct Sprite *sprite) { if (++sprite->data[0] >= sprite->data[1]) { @@ -4840,7 +4840,7 @@ static void AnimSharpenSphere_Step(struct Sprite* sprite) DestroyAnimSprite(sprite); } -static void AnimConversion(struct Sprite* sprite) +static void AnimConversion(struct Sprite *sprite) { if (sprite->data[0] == 0) { @@ -4880,7 +4880,7 @@ void AnimTask_ConversionAlphaBlend(u8 taskId) } } -static void AnimConversion2(struct Sprite* sprite) +static void AnimConversion2(struct Sprite *sprite) { InitSpritePosToAnimTarget(sprite, FALSE); sprite->animPaused = 1; @@ -4888,7 +4888,7 @@ static void AnimConversion2(struct Sprite* sprite) sprite->callback = AnimConversion2_Step; } -static void AnimConversion2_Step(struct Sprite* sprite) +static void AnimConversion2_Step(struct Sprite *sprite) { if (sprite->data[0]) { @@ -4943,7 +4943,7 @@ static void AnimTask_ShowBattlersHealthbox(u8 taskId) DestroyAnimVisualTask(taskId); } -static void AnimMoon(struct Sprite* sprite) +static void AnimMoon(struct Sprite *sprite) { if (IsContest()) { @@ -4962,13 +4962,13 @@ static void AnimMoon(struct Sprite* sprite) sprite->callback = AnimMoon_Step; } -static void AnimMoon_Step(struct Sprite* sprite) +static void AnimMoon_Step(struct Sprite *sprite) { if (sprite->data[0]) DestroyAnimSprite(sprite); } -static void AnimMoonlightSparkle(struct Sprite* sprite) +static void AnimMoonlightSparkle(struct Sprite *sprite) { sprite->x = GetBattlerSpriteCoord(gBattleAnimAttacker, BATTLER_COORD_X_2) + gBattleAnimArgs[0]; sprite->y = gBattleAnimArgs[1]; @@ -4980,7 +4980,7 @@ static void AnimMoonlightSparkle(struct Sprite* sprite) sprite->callback = AnimMoonlightSparkle_Step; } -static void AnimMoonlightSparkle_Step(struct Sprite* sprite) +static void AnimMoonlightSparkle_Step(struct Sprite *sprite) { if (++sprite->data[1] > 1) { @@ -5015,7 +5015,7 @@ void AnimTask_MoonlightEndFade(u8 taskId) gTasks[taskId].data[9] = 15; b = GetBattleMonSpritePalettesMask(1, 1, 1, 1); c = a | b; - StorePointerInVars(&gTasks[taskId].data[14], &gTasks[taskId].data[15], (void*)c); + StorePointerInVars(&gTasks[taskId].data[14], &gTasks[taskId].data[15], (void *)c); b = b | (0x10000 << IndexOfSpritePaletteTag(ANIM_TAG_MOON)); d = IndexOfSpritePaletteTag(ANIM_TAG_GREEN_SPARKLE); BeginNormalPaletteFade((0x10000 << d) | b, 0, 0, 16, RGB(27, 29, 31)); @@ -5025,7 +5025,7 @@ void AnimTask_MoonlightEndFade(u8 taskId) static void AnimTask_MoonlightEndFade_Step(u8 taskId) { - struct Task* task = &gTasks[taskId]; + struct Task *task = &gTasks[taskId]; switch (task->data[0]) { case 0: @@ -5101,7 +5101,7 @@ static void AnimTask_MoonlightEndFade_Step(u8 taskId) } } -static void AnimHornHit(struct Sprite* sprite) +static void AnimHornHit(struct Sprite *sprite) { if (gBattleAnimArgs[2] < 2) gBattleAnimArgs[2] = 2; @@ -5148,7 +5148,7 @@ static void AnimHornHit(struct Sprite* sprite) sprite->callback = AnimHornHit_Step; } -static void AnimHornHit_Step(struct Sprite* sprite) +static void AnimHornHit_Step(struct Sprite *sprite) { sprite->data[2] += sprite->data[3]; sprite->data[4] += sprite->data[5]; @@ -5170,7 +5170,7 @@ void AnimTask_DoubleTeam(u8 taskId) int obj; u16 r3; u16 r4; - struct Task* task = &gTasks[taskId]; + struct Task *task = &gTasks[taskId]; task->data[0] = GetAnimBattlerSpriteId(ANIM_ATTACKER); task->data[1] = AllocSpritePalette(ANIM_TAG_BENT_SPOON); r3 = (task->data[1] * 16) + 0x100; @@ -5201,7 +5201,7 @@ void AnimTask_DoubleTeam(u8 taskId) static void AnimTask_DoubleTeam_Step(u8 taskId) { - struct Task* task = &gTasks[taskId]; + struct Task *task = &gTasks[taskId]; if (!task->data[3]) { if (GetBattlerSpriteBGPriorityRank(gBattleAnimAttacker) == 1) @@ -5214,7 +5214,7 @@ static void AnimTask_DoubleTeam_Step(u8 taskId) } } -static void AnimDoubleTeam(struct Sprite* sprite) +static void AnimDoubleTeam(struct Sprite *sprite) { if (++sprite->data[3] > 1) { @@ -5236,7 +5236,7 @@ static void AnimDoubleTeam(struct Sprite* sprite) } } -static void AnimSuperFang(struct Sprite* sprite) +static void AnimSuperFang(struct Sprite *sprite) { StoreSpriteCallbackInData6(sprite, DestroyAnimSprite); sprite->callback = RunStoredCallbackWhenAnimEnds; @@ -5288,7 +5288,7 @@ void AnimTask_MusicNotesClearRainbowBlend(u8 taskId) #define sVelocX data[6] #define sVelocY data[7] -static void AnimWavyMusicNotes(struct Sprite* sprite) +static void AnimWavyMusicNotes(struct Sprite *sprite) { u8 index; u8 x, y; @@ -5317,7 +5317,7 @@ static void AnimWavyMusicNotes(struct Sprite* sprite) sprite->callback = AnimWavyMusicNotes_Step; } -static void AnimWavyMusicNotes_CalcVelocity(s16 x, s16 y, s16* velocX, s16* velocY, s8 xSpeedFactor) +static void AnimWavyMusicNotes_CalcVelocity(s16 x, s16 y, s16 *velocX, s16 *velocY, s8 xSpeedFactor) { int x2; int time; @@ -5333,7 +5333,7 @@ static void AnimWavyMusicNotes_CalcVelocity(s16 x, s16 y, s16* velocX, s16* velo *velocY = (y * 256) / time; } -static void AnimWavyMusicNotes_Step(struct Sprite* sprite) +static void AnimWavyMusicNotes_Step(struct Sprite *sprite) { s16 y, trigIdx; u8 index; @@ -5366,7 +5366,7 @@ static void AnimWavyMusicNotes_Step(struct Sprite* sprite) } } -static void AnimFlyingMusicNotes(struct Sprite* sprite) +static void AnimFlyingMusicNotes(struct Sprite *sprite) { if (GetBattlerSide(gBattleAnimAttacker) == B_SIDE_OPPONENT) gBattleAnimArgs[1] *= -1; @@ -5383,7 +5383,7 @@ static void AnimFlyingMusicNotes(struct Sprite* sprite) sprite->callback = AnimFlyingMusicNotes_Step; } -static void AnimFlyingMusicNotes_Step(struct Sprite* sprite) +static void AnimFlyingMusicNotes_Step(struct Sprite *sprite) { sprite->data[4] += sprite->data[6]; sprite->data[5] += sprite->data[7]; @@ -5402,7 +5402,7 @@ static void AnimFlyingMusicNotes_Step(struct Sprite* sprite) DestroySpriteAndMatrix(sprite); } -static void AnimBellyDrumHand(struct Sprite* sprite) +static void AnimBellyDrumHand(struct Sprite *sprite) { s16 a; if (gBattleAnimArgs[0] == 1) @@ -5422,7 +5422,7 @@ static void AnimBellyDrumHand(struct Sprite* sprite) StoreSpriteCallbackInData6(sprite, DestroyAnimSprite); } -void AnimSlowFlyingMusicNotes(struct Sprite* sprite) +void AnimSlowFlyingMusicNotes(struct Sprite *sprite) { s16 xDiff; u8 index; @@ -5444,7 +5444,7 @@ void AnimSlowFlyingMusicNotes(struct Sprite* sprite) sprite->callback = AnimSlowFlyingMusicNotes_Step; } -static void AnimSlowFlyingMusicNotes_Step(struct Sprite* sprite) +static void AnimSlowFlyingMusicNotes_Step(struct Sprite *sprite) { if (AnimTranslateLinear(sprite) == 0) { @@ -5463,7 +5463,7 @@ static void AnimSlowFlyingMusicNotes_Step(struct Sprite* sprite) } } -void SetSpriteNextToMonHead(u8 battler, struct Sprite* sprite) +void SetSpriteNextToMonHead(u8 battler, struct Sprite *sprite) { if (GetBattlerSide(battler) == B_SIDE_PLAYER) sprite->x = GetBattlerSpriteCoordAttr(battler, BATTLER_COORD_ATTR_RIGHT) + 8; @@ -5473,7 +5473,7 @@ void SetSpriteNextToMonHead(u8 battler, struct Sprite* sprite) sprite->y = GetBattlerSpriteCoord(battler, BATTLER_COORD_Y_PIC_OFFSET) - (s16)GetBattlerSpriteCoordAttr(battler, BATTLER_COORD_ATTR_HEIGHT) / 4; } -static void AnimThoughtBubble(struct Sprite* sprite) +static void AnimThoughtBubble(struct Sprite *sprite) { u8 animNum; u8 battler; @@ -5491,7 +5491,7 @@ static void AnimThoughtBubble(struct Sprite* sprite) sprite->callback = RunStoredCallbackWhenAnimEnds; } -static void AnimThoughtBubble_Step(struct Sprite* sprite) +static void AnimThoughtBubble_Step(struct Sprite *sprite) { if (--sprite->data[0] == 0) { @@ -5501,7 +5501,7 @@ static void AnimThoughtBubble_Step(struct Sprite* sprite) } } -static void AnimMetronomeFinger(struct Sprite* sprite) +static void AnimMetronomeFinger(struct Sprite *sprite) { u8 battler; if (gBattleAnimArgs[0] == 0) @@ -5515,7 +5515,7 @@ static void AnimMetronomeFinger(struct Sprite* sprite) sprite->callback = RunStoredCallbackWhenAffineAnimEnds; } -static void AnimMetronomeFinger_Step(struct Sprite* sprite) +static void AnimMetronomeFinger_Step(struct Sprite *sprite) { if (++sprite->data[0] > 16) { @@ -5525,7 +5525,7 @@ static void AnimMetronomeFinger_Step(struct Sprite* sprite) } } -static void AnimFollowMeFinger(struct Sprite* sprite) +static void AnimFollowMeFinger(struct Sprite *sprite) { u8 battler; if (gBattleAnimArgs[0] == 0) @@ -5547,13 +5547,13 @@ static void AnimFollowMeFinger(struct Sprite* sprite) sprite->callback = RunStoredCallbackWhenAffineAnimEnds; } -static void AnimFollowMeFinger_Step1(struct Sprite* sprite) +static void AnimFollowMeFinger_Step1(struct Sprite *sprite) { if (++sprite->data[4] > 12) sprite->callback = AnimFollowMeFinger_Step2; } -static void AnimFollowMeFinger_Step2(struct Sprite* sprite) +static void AnimFollowMeFinger_Step2(struct Sprite *sprite) { s16 x1, x2; @@ -5583,7 +5583,7 @@ static void AnimFollowMeFinger_Step2(struct Sprite* sprite) sprite->x2 = (x1 >> 3) + (x2 >> 1); } -static void AnimTauntFinger(struct Sprite* sprite) +static void AnimTauntFinger(struct Sprite *sprite) { u8 battler; if (gBattleAnimArgs[0] == 0) @@ -5606,7 +5606,7 @@ static void AnimTauntFinger(struct Sprite* sprite) sprite->callback = AnimTauntFinger_Step1; } -static void AnimTauntFinger_Step1(struct Sprite* sprite) +static void AnimTauntFinger_Step1(struct Sprite *sprite) { if (++sprite->data[1] > 10) { @@ -5617,7 +5617,7 @@ static void AnimTauntFinger_Step1(struct Sprite* sprite) } } -static void AnimTauntFinger_Step2(struct Sprite* sprite) +static void AnimTauntFinger_Step2(struct Sprite *sprite) { if (++sprite->data[1] > 5) DestroyAnimSprite(sprite); diff --git a/src/battle_anim_effects_2.c b/src/battle_anim_effects_2.c index 078b55105..33065c0dd 100755 --- a/src/battle_anim_effects_2.c +++ b/src/battle_anim_effects_2.c @@ -1534,7 +1534,7 @@ static void AnimAirWaveProjectile_Step2(struct Sprite *sprite) static void AnimAirWaveProjectile_Step1(struct Sprite *sprite) { - struct Task* task = &gTasks[sprite->data[7]]; + struct Task *task = &gTasks[sprite->data[7]]; if (sprite->data[0] > task->data[5]) { sprite->data[5] += sprite->data[3]; @@ -1571,7 +1571,7 @@ static void AnimAirWaveProjectile(struct Sprite *sprite) s16 b; s16 c; - struct Task* task = &gTasks[sprite->data[7]]; + struct Task *task = &gTasks[sprite->data[7]]; sprite->data[1] += (-2 & task->data[7]); sprite->data[2] += (-2 & task->data[8]); if (1 & task->data[7]) @@ -1838,7 +1838,7 @@ static void AnimBulletSeed_Step1(struct Sprite *sprite) { int i; u16 rand; - s16* ptr; + s16 *ptr; PlaySE12WithPanning(SE_M_HORN_ATTACK, BattleAnimAdjustPanning(63)); sprite->x += sprite->x2; sprite->y += sprite->y2; @@ -2035,7 +2035,7 @@ static void AnimTask_GrowAndGrayscale_Step(u8 taskId) // No args. void AnimTask_Minimize(u8 taskId) { - struct Task* task = &gTasks[taskId]; + struct Task *task = &gTasks[taskId]; u8 spriteId = GetAnimBattlerSpriteId(ANIM_ATTACKER); task->data[0] = spriteId; PrepareBattlerSpriteForRotScale(spriteId, ST_OAM_OBJ_NORMAL); @@ -2051,7 +2051,7 @@ void AnimTask_Minimize(u8 taskId) static void AnimTask_Minimize_Step(u8 taskId) { - struct Task* task = &gTasks[taskId]; + struct Task *task = &gTasks[taskId]; switch (task->data[1]) { case 0: @@ -2115,7 +2115,7 @@ static void AnimTask_Minimize_Step(u8 taskId) } } -static void CreateMinimizeSprite(struct Task* task, u8 taskId) +static void CreateMinimizeSprite(struct Task *task, u8 taskId) { u16 matrixNum; s16 spriteId = CloneBattlerSpriteWithBlend(ANIM_ATTACKER); @@ -2160,7 +2160,7 @@ static void ClonedMinizeSprite_Step(struct Sprite *sprite) // arg 1: num hops void AnimTask_Splash(u8 taskId) { - struct Task* task = &gTasks[taskId]; + struct Task *task = &gTasks[taskId]; if (gBattleAnimArgs[1] == 0) { DestroyAnimVisualTask(taskId); @@ -2180,7 +2180,7 @@ void AnimTask_Splash(u8 taskId) static void AnimTask_Splash_Step(u8 taskId) { - struct Task* task = &gTasks[taskId]; + struct Task *task = &gTasks[taskId]; switch (task->data[1]) { case 0: @@ -2234,7 +2234,7 @@ static void AnimTask_Splash_Step(u8 taskId) // No args. void AnimTask_GrowAndShrink(u8 taskId) { - struct Task* task = &gTasks[taskId]; + struct Task *task = &gTasks[taskId]; u8 spriteId = GetAnimBattlerSpriteId(ANIM_ATTACKER); PrepareAffineAnimInTaskData(task, spriteId, gGrowAndShrinkAffineAnimCmds); task->func = AnimTask_GrowAndShrink_Step; @@ -2242,7 +2242,7 @@ void AnimTask_GrowAndShrink(u8 taskId) static void AnimTask_GrowAndShrink_Step(u8 taskId) { - struct Task* task = &gTasks[taskId]; + struct Task *task = &gTasks[taskId]; if (!RunAffineAnimFromTaskData(task)) DestroyAnimVisualTask(taskId); } @@ -2301,7 +2301,7 @@ static void AnimAngerMark(struct Sprite *sprite) // left/right movements void AnimTask_ThrashMoveMonHorizontal(u8 taskId) { - struct Task* task = &gTasks[taskId]; + struct Task *task = &gTasks[taskId]; u8 spriteId = GetAnimBattlerSpriteId(ANIM_ATTACKER); task->data[0] = spriteId; task->data[1] = 0; @@ -2311,7 +2311,7 @@ void AnimTask_ThrashMoveMonHorizontal(u8 taskId) static void AnimTask_ThrashMoveMonHorizontal_Step(u8 taskId) { - struct Task* task = &gTasks[taskId]; + struct Task *task = &gTasks[taskId]; if (!RunAffineAnimFromTaskData(task)) DestroyAnimVisualTask(taskId); } @@ -2319,7 +2319,7 @@ static void AnimTask_ThrashMoveMonHorizontal_Step(u8 taskId) // up/down movements void AnimTask_ThrashMoveMonVertical(u8 taskId) { - struct Task* task = &gTasks[taskId]; + struct Task *task = &gTasks[taskId]; task->data[0] = GetAnimBattlerSpriteId(ANIM_ATTACKER); task->data[1] = 0; task->data[2] = 4; @@ -2338,7 +2338,7 @@ void AnimTask_ThrashMoveMonVertical(u8 taskId) static void AnimTask_ThrashMoveMonVertical_Step(u8 taskId) { - struct Task* task = &gTasks[taskId]; + struct Task *task = &gTasks[taskId]; if (++task->data[7] > 2) { task->data[7] = 0; @@ -2389,7 +2389,7 @@ static void AnimTask_ThrashMoveMonVertical_Step(u8 taskId) void AnimTask_SketchDrawMon(u8 taskId) { - struct Task* task = &gTasks[taskId]; + struct Task *task = &gTasks[taskId]; struct ScanlineEffectParams params; s16 i; @@ -2430,7 +2430,7 @@ void AnimTask_SketchDrawMon(u8 taskId) static void AnimTask_SketchDrawMon_Step(u8 taskId) { - struct Task* task = &gTasks[taskId]; + struct Task *task = &gTasks[taskId]; switch (task->data[4]) { @@ -2791,7 +2791,7 @@ static void AnimSoftBoiledEgg_Step4_Callback(struct Sprite *sprite) // Used by Extremespeed void AnimTask_AttackerStretchAndDisappear(u8 taskId) { - struct Task* task = &gTasks[taskId]; + struct Task *task = &gTasks[taskId]; u8 spriteId = GetAnimBattlerSpriteId(ANIM_ATTACKER); task->data[0] = spriteId; PrepareAffineAnimInTaskData(task, spriteId, gStretchAttackerAffineAnimCmds); @@ -2800,7 +2800,7 @@ void AnimTask_AttackerStretchAndDisappear(u8 taskId) static void AnimTask_AttackerStretchAndDisappear_Step(u8 taskId) { - struct Task* task = &gTasks[taskId]; + struct Task *task = &gTasks[taskId]; if (!RunAffineAnimFromTaskData(task)) { gSprites[task->data[0]].y2 = 0; @@ -2811,7 +2811,7 @@ static void AnimTask_AttackerStretchAndDisappear_Step(u8 taskId) void AnimTask_ExtremeSpeedImpact(u8 taskId) { - struct Task* task = &gTasks[taskId]; + struct Task *task = &gTasks[taskId]; task->data[0] = 0; task->data[1] = 0; task->data[2] = 0; @@ -2834,7 +2834,7 @@ void AnimTask_ExtremeSpeedImpact(u8 taskId) static void AnimTask_ExtremeSpeedImpact_Step(u8 taskId) { - struct Task* task = &gTasks[taskId]; + struct Task *task = &gTasks[taskId]; switch (task->data[0]) { @@ -2880,7 +2880,7 @@ static void AnimTask_ExtremeSpeedImpact_Step(u8 taskId) void AnimTask_ExtremeSpeedMonReappear(u8 taskId) { - struct Task* task = &gTasks[taskId]; + struct Task *task = &gTasks[taskId]; task->data[0] = 0; task->data[1] = 0; task->data[2] = 0; @@ -2894,7 +2894,7 @@ void AnimTask_ExtremeSpeedMonReappear(u8 taskId) static void AnimTask_ExtremeSpeedMonReappear_Step(u8 taskId) { - struct Task* task = &gTasks[taskId]; + struct Task *task = &gTasks[taskId]; if (task->data[0] == 0 && ++task->data[1] > task->data[4]) { task->data[1] = 0; @@ -2922,7 +2922,7 @@ static void AnimTask_ExtremeSpeedMonReappear_Step(u8 taskId) void AnimTask_SpeedDust(u8 taskId) { - struct Task* task = &gTasks[taskId]; + struct Task *task = &gTasks[taskId]; task->data[0] = 0; task->data[1] = 4; task->data[2] = 0; @@ -2940,7 +2940,7 @@ void AnimTask_SpeedDust(u8 taskId) static void AnimTask_SpeedDust_Step(u8 taskId) { - struct Task* task = &gTasks[taskId]; + struct Task *task = &gTasks[taskId]; switch (task->data[8]) { case 0: diff --git a/src/battle_anim_flying.c b/src/battle_anim_flying.c index a3534bad3..59474eae3 100644 --- a/src/battle_anim_flying.c +++ b/src/battle_anim_flying.c @@ -595,7 +595,7 @@ static void AnimFallingFeather(struct Sprite *sprite) data->unkA = (gBattleAnimArgs[2] >> 8) & 0xFF; data->unk4 = gBattleAnimArgs[3]; data->unk6 = gBattleAnimArgs[4]; - *(u16*)(data->unkC) = gBattleAnimArgs[5]; + *(u16 *)(data->unkC) = gBattleAnimArgs[5]; if (data->unk2 >= 64 && data->unk2 <= 191) { diff --git a/src/battle_anim_mon_movement.c b/src/battle_anim_mon_movement.c index ba2cbe29a..77e50c9a4 100644 --- a/src/battle_anim_mon_movement.c +++ b/src/battle_anim_mon_movement.c @@ -14,7 +14,7 @@ static void AnimTask_TranslateMonElliptical_Step(u8 taskId); static void DoHorizontalLunge(struct Sprite *sprite); static void ReverseHorizontalLungeDirection(struct Sprite *sprite); static void DoVerticalDip(struct Sprite *sprite); -static void ReverseVerticalDipDirection(struct Sprite* sprite); +static void ReverseVerticalDipDirection(struct Sprite *sprite); static void SlideMonToOriginalPos(struct Sprite *sprite); static void SlideMonToOriginalPos_Step(struct Sprite *sprite); static void SlideMonToOffset(struct Sprite *sprite); diff --git a/src/battle_anim_mons.c b/src/battle_anim_mons.c index a889fc8b5..05b0daf3f 100644 --- a/src/battle_anim_mons.c +++ b/src/battle_anim_mons.c @@ -414,7 +414,7 @@ u8 GetAnimBattlerSpriteId(u8 animBattler) } } -void StoreSpriteCallbackInData6(struct Sprite *sprite, void (*callback)(struct Sprite*)) +void StoreSpriteCallbackInData6(struct Sprite *sprite, void (*callback)(struct Sprite *)) { sprite->data[6] = (u32)(callback) & 0xffff; sprite->data[7] = (u32)(callback) >> 16; diff --git a/src/battle_anim_utility_funcs.c b/src/battle_anim_utility_funcs.c index 217f96c4a..688a6e5ae 100644 --- a/src/battle_anim_utility_funcs.c +++ b/src/battle_anim_utility_funcs.c @@ -27,7 +27,7 @@ static void StartBlendAnimSpriteColor(u8, u32); static void AnimTask_BlendSpriteColor_Step2(u8); static void AnimTask_HardwarePaletteFade_Step(u8); static void AnimTask_TraceMonBlended_Step(u8); -static void AnimMonTrace(struct Sprite*); +static void AnimMonTrace(struct Sprite *); static void AnimTask_DrawFallingWhiteLinesOnAttacker_Step(u8); static void StatsChangeAnimation_Step1(u8); static void StatsChangeAnimation_Step2(u8); diff --git a/src/battle_anim_water.c b/src/battle_anim_water.c index c0898ce81..b7c2df3d1 100644 --- a/src/battle_anim_water.c +++ b/src/battle_anim_water.c @@ -48,11 +48,11 @@ static void AnimTask_SurfWaveScanlineEffect(u8); static void AnimTask_WaterSpoutLaunch_Step(u8); static void AnimTask_WaterSpoutRain_Step(u8); static u8 GetWaterSpoutPowerForAnim(void); -static void CreateWaterSpoutLaunchDroplets(struct Task*, u8); -static void CreateWaterSpoutRainDroplet(struct Task*, u8); +static void CreateWaterSpoutLaunchDroplets(struct Task *, u8); +static void CreateWaterSpoutRainDroplet(struct Task *, u8); static void AnimTask_WaterSport_Step(u8); -static void CreateWaterSportDroplet(struct Task*); -static void CreateWaterPulseRingBubbles(struct Sprite*, int, int); +static void CreateWaterSportDroplet(struct Task *); +static void CreateWaterPulseRingBubbles(struct Sprite *, int, int); static const u8 sUnusedWater_Gfx[] = INCBIN_U8("graphics/battle_anims/unused/water_gfx.4bpp"); static const u8 sUnusedWater[] = INCBIN_U8("graphics/battle_anims/unused/water.bin"); diff --git a/src/battle_arena.c b/src/battle_arena.c index a7c74366b..e405e2795 100644 --- a/src/battle_arena.c +++ b/src/battle_arena.c @@ -719,7 +719,7 @@ void BattleArena_AddSkillPoints(u8 battler) } else if (gMoveResultFlags & MOVE_RESULT_NO_EFFECT) { - if (!(gMoveResultFlags & MOVE_RESULT_MISSED) || gBattleCommunication[6] != 1) + if (!(gMoveResultFlags & MOVE_RESULT_MISSED) || gBattleCommunication[MISS_TYPE] != B_MSG_PROTECTED) skillPoints[battler] -= 2; } else if ((gMoveResultFlags & MOVE_RESULT_SUPER_EFFECTIVE) && (gMoveResultFlags & MOVE_RESULT_NOT_VERY_EFFECTIVE)) diff --git a/src/battle_bg.c b/src/battle_bg.c index ed32c009c..94d4c194e 100644 --- a/src/battle_bg.c +++ b/src/battle_bg.c @@ -760,26 +760,26 @@ void DrawMainBattleBackground(void) { if (gBattleTypeFlags & (BATTLE_TYPE_LINK | BATTLE_TYPE_FRONTIER | BATTLE_TYPE_EREADER_TRAINER | BATTLE_TYPE_RECORDED_LINK)) { - LZDecompressVram(gBattleTerrainTiles_Building, (void*)(BG_CHAR_ADDR(2))); - LZDecompressVram(gBattleTerrainTilemap_Building, (void*)(BG_SCREEN_ADDR(26))); + LZDecompressVram(gBattleTerrainTiles_Building, (void *)(BG_CHAR_ADDR(2))); + LZDecompressVram(gBattleTerrainTilemap_Building, (void *)(BG_SCREEN_ADDR(26))); LoadCompressedPalette(gBattleTerrainPalette_Frontier, 0x20, 0x60); } else if (gBattleTypeFlags & BATTLE_TYPE_GROUDON) { - LZDecompressVram(gBattleTerrainTiles_Cave, (void*)(BG_CHAR_ADDR(2))); - LZDecompressVram(gBattleTerrainTilemap_Cave, (void*)(BG_SCREEN_ADDR(26))); + LZDecompressVram(gBattleTerrainTiles_Cave, (void *)(BG_CHAR_ADDR(2))); + LZDecompressVram(gBattleTerrainTilemap_Cave, (void *)(BG_SCREEN_ADDR(26))); LoadCompressedPalette(gBattleTerrainPalette_Groudon, 0x20, 0x60); } else if (gBattleTypeFlags & BATTLE_TYPE_KYOGRE) { - LZDecompressVram(gBattleTerrainTiles_Water, (void*)(BG_CHAR_ADDR(2))); - LZDecompressVram(gBattleTerrainTilemap_Water, (void*)(BG_SCREEN_ADDR(26))); + LZDecompressVram(gBattleTerrainTiles_Water, (void *)(BG_CHAR_ADDR(2))); + LZDecompressVram(gBattleTerrainTilemap_Water, (void *)(BG_SCREEN_ADDR(26))); LoadCompressedPalette(gBattleTerrainPalette_Kyogre, 0x20, 0x60); } else if (gBattleTypeFlags & BATTLE_TYPE_RAYQUAZA) { - LZDecompressVram(gBattleTerrainTiles_Rayquaza, (void*)(BG_CHAR_ADDR(2))); - LZDecompressVram(gBattleTerrainTilemap_Rayquaza, (void*)(BG_SCREEN_ADDR(26))); + LZDecompressVram(gBattleTerrainTiles_Rayquaza, (void *)(BG_CHAR_ADDR(2))); + LZDecompressVram(gBattleTerrainTilemap_Rayquaza, (void *)(BG_SCREEN_ADDR(26))); LoadCompressedPalette(gBattleTerrainPalette_Rayquaza, 0x20, 0x60); } else @@ -789,15 +789,15 @@ void DrawMainBattleBackground(void) u8 trainerClass = gTrainers[gTrainerBattleOpponent_A].trainerClass; if (trainerClass == TRAINER_CLASS_LEADER) { - LZDecompressVram(gBattleTerrainTiles_Building, (void*)(BG_CHAR_ADDR(2))); - LZDecompressVram(gBattleTerrainTilemap_Building, (void*)(BG_SCREEN_ADDR(26))); + LZDecompressVram(gBattleTerrainTiles_Building, (void *)(BG_CHAR_ADDR(2))); + LZDecompressVram(gBattleTerrainTilemap_Building, (void *)(BG_SCREEN_ADDR(26))); LoadCompressedPalette(gBattleTerrainPalette_BuildingLeader, 0x20, 0x60); return; } else if (trainerClass == TRAINER_CLASS_CHAMPION) { - LZDecompressVram(gBattleTerrainTiles_Stadium, (void*)(BG_CHAR_ADDR(2))); - LZDecompressVram(gBattleTerrainTilemap_Stadium, (void*)(BG_SCREEN_ADDR(26))); + LZDecompressVram(gBattleTerrainTiles_Stadium, (void *)(BG_CHAR_ADDR(2))); + LZDecompressVram(gBattleTerrainTilemap_Stadium, (void *)(BG_SCREEN_ADDR(26))); LoadCompressedPalette(gBattleTerrainPalette_StadiumWallace, 0x20, 0x60); return; } @@ -807,48 +807,48 @@ void DrawMainBattleBackground(void) { default: case MAP_BATTLE_SCENE_NORMAL: - LZDecompressVram(sBattleTerrainTable[gBattleTerrain].tileset, (void*)(BG_CHAR_ADDR(2))); - LZDecompressVram(sBattleTerrainTable[gBattleTerrain].tilemap, (void*)(BG_SCREEN_ADDR(26))); + LZDecompressVram(sBattleTerrainTable[gBattleTerrain].tileset, (void *)(BG_CHAR_ADDR(2))); + LZDecompressVram(sBattleTerrainTable[gBattleTerrain].tilemap, (void *)(BG_SCREEN_ADDR(26))); LoadCompressedPalette(sBattleTerrainTable[gBattleTerrain].palette, 0x20, 0x60); break; case MAP_BATTLE_SCENE_GYM: - LZDecompressVram(gBattleTerrainTiles_Building, (void*)(BG_CHAR_ADDR(2))); - LZDecompressVram(gBattleTerrainTilemap_Building, (void*)(BG_SCREEN_ADDR(26))); + LZDecompressVram(gBattleTerrainTiles_Building, (void *)(BG_CHAR_ADDR(2))); + LZDecompressVram(gBattleTerrainTilemap_Building, (void *)(BG_SCREEN_ADDR(26))); LoadCompressedPalette(gBattleTerrainPalette_BuildingGym, 0x20, 0x60); break; case MAP_BATTLE_SCENE_MAGMA: - LZDecompressVram(gBattleTerrainTiles_Stadium, (void*)(BG_CHAR_ADDR(2))); - LZDecompressVram(gBattleTerrainTilemap_Stadium, (void*)(BG_SCREEN_ADDR(26))); + LZDecompressVram(gBattleTerrainTiles_Stadium, (void *)(BG_CHAR_ADDR(2))); + LZDecompressVram(gBattleTerrainTilemap_Stadium, (void *)(BG_SCREEN_ADDR(26))); LoadCompressedPalette(gBattleTerrainPalette_StadiumMagma, 0x20, 0x60); break; case MAP_BATTLE_SCENE_AQUA: - LZDecompressVram(gBattleTerrainTiles_Stadium, (void*)(BG_CHAR_ADDR(2))); - LZDecompressVram(gBattleTerrainTilemap_Stadium, (void*)(BG_SCREEN_ADDR(26))); + LZDecompressVram(gBattleTerrainTiles_Stadium, (void *)(BG_CHAR_ADDR(2))); + LZDecompressVram(gBattleTerrainTilemap_Stadium, (void *)(BG_SCREEN_ADDR(26))); LoadCompressedPalette(gBattleTerrainPalette_StadiumAqua, 0x20, 0x60); break; case MAP_BATTLE_SCENE_SIDNEY: - LZDecompressVram(gBattleTerrainTiles_Stadium, (void*)(BG_CHAR_ADDR(2))); - LZDecompressVram(gBattleTerrainTilemap_Stadium, (void*)(BG_SCREEN_ADDR(26))); + LZDecompressVram(gBattleTerrainTiles_Stadium, (void *)(BG_CHAR_ADDR(2))); + LZDecompressVram(gBattleTerrainTilemap_Stadium, (void *)(BG_SCREEN_ADDR(26))); LoadCompressedPalette(gBattleTerrainPalette_StadiumSidney, 0x20, 0x60); break; case MAP_BATTLE_SCENE_PHOEBE: - LZDecompressVram(gBattleTerrainTiles_Stadium, (void*)(BG_CHAR_ADDR(2))); - LZDecompressVram(gBattleTerrainTilemap_Stadium, (void*)(BG_SCREEN_ADDR(26))); + LZDecompressVram(gBattleTerrainTiles_Stadium, (void *)(BG_CHAR_ADDR(2))); + LZDecompressVram(gBattleTerrainTilemap_Stadium, (void *)(BG_SCREEN_ADDR(26))); LoadCompressedPalette(gBattleTerrainPalette_StadiumPhoebe, 0x20, 0x60); break; case MAP_BATTLE_SCENE_GLACIA: - LZDecompressVram(gBattleTerrainTiles_Stadium, (void*)(BG_CHAR_ADDR(2))); - LZDecompressVram(gBattleTerrainTilemap_Stadium, (void*)(BG_SCREEN_ADDR(26))); + LZDecompressVram(gBattleTerrainTiles_Stadium, (void *)(BG_CHAR_ADDR(2))); + LZDecompressVram(gBattleTerrainTilemap_Stadium, (void *)(BG_SCREEN_ADDR(26))); LoadCompressedPalette(gBattleTerrainPalette_StadiumGlacia, 0x20, 0x60); break; case MAP_BATTLE_SCENE_DRAKE: - LZDecompressVram(gBattleTerrainTiles_Stadium, (void*)(BG_CHAR_ADDR(2))); - LZDecompressVram(gBattleTerrainTilemap_Stadium, (void*)(BG_SCREEN_ADDR(26))); + LZDecompressVram(gBattleTerrainTiles_Stadium, (void *)(BG_CHAR_ADDR(2))); + LZDecompressVram(gBattleTerrainTilemap_Stadium, (void *)(BG_SCREEN_ADDR(26))); LoadCompressedPalette(gBattleTerrainPalette_StadiumDrake, 0x20, 0x60); break; case MAP_BATTLE_SCENE_FRONTIER: - LZDecompressVram(gBattleTerrainTiles_Building, (void*)(BG_CHAR_ADDR(2))); - LZDecompressVram(gBattleTerrainTilemap_Building, (void*)(BG_SCREEN_ADDR(26))); + LZDecompressVram(gBattleTerrainTiles_Building, (void *)(BG_CHAR_ADDR(2))); + LZDecompressVram(gBattleTerrainTilemap_Building, (void *)(BG_SCREEN_ADDR(26))); LoadCompressedPalette(gBattleTerrainPalette_Frontier, 0x20, 0x60); break; } @@ -857,7 +857,7 @@ void DrawMainBattleBackground(void) void LoadBattleTextboxAndBackground(void) { - LZDecompressVram(gBattleTextboxTiles, (void*)(BG_CHAR_ADDR(0))); + LZDecompressVram(gBattleTextboxTiles, (void *)(BG_CHAR_ADDR(0))); CopyToBgTilemapBuffer(0, gBattleTextboxTilemap, 0, 0); CopyBgTilemapBufferToVram(0); LoadCompressedPalette(gBattleTextboxPalette, 0, 0x40); @@ -1124,8 +1124,8 @@ void DrawBattleEntryBackground(void) { if (gBattleTypeFlags & BATTLE_TYPE_LINK) { - LZDecompressVram(gBattleVSFrame_Gfx, (void*)(BG_CHAR_ADDR(1))); - LZDecompressVram(gVsLettersGfx, (void*)OBJ_VRAM0); + LZDecompressVram(gBattleVSFrame_Gfx, (void *)(BG_CHAR_ADDR(1))); + LZDecompressVram(gVsLettersGfx, (void *)OBJ_VRAM0); LoadCompressedPalette(gBattleVSFrame_Pal, 0x60, 0x20); SetBgAttribute(1, BG_ATTR_SCREENSIZE, 1); SetGpuReg(REG_OFFSET_BG1CNT, 0x5C04); @@ -1143,8 +1143,8 @@ void DrawBattleEntryBackground(void) { if (!(gBattleTypeFlags & BATTLE_TYPE_INGAME_PARTNER) || gPartnerTrainerId == TRAINER_STEVEN_PARTNER) { - LZDecompressVram(gBattleTerrainAnimTiles_Building, (void*)(BG_CHAR_ADDR(1))); - LZDecompressVram(gBattleTerrainAnimTilemap_Building, (void*)(BG_SCREEN_ADDR(28))); + LZDecompressVram(gBattleTerrainAnimTiles_Building, (void *)(BG_CHAR_ADDR(1))); + LZDecompressVram(gBattleTerrainAnimTilemap_Building, (void *)(BG_SCREEN_ADDR(28))); } else { @@ -1160,18 +1160,18 @@ void DrawBattleEntryBackground(void) } else if (gBattleTypeFlags & BATTLE_TYPE_GROUDON) { - LZDecompressVram(gBattleTerrainAnimTiles_Cave, (void*)(BG_CHAR_ADDR(1))); - LZDecompressVram(gBattleTerrainAnimTilemap_Cave, (void*)(BG_SCREEN_ADDR(28))); + LZDecompressVram(gBattleTerrainAnimTiles_Cave, (void *)(BG_CHAR_ADDR(1))); + LZDecompressVram(gBattleTerrainAnimTilemap_Cave, (void *)(BG_SCREEN_ADDR(28))); } else if (gBattleTypeFlags & BATTLE_TYPE_KYOGRE) { - LZDecompressVram(gBattleTerrainAnimTiles_Underwater, (void*)(BG_CHAR_ADDR(1))); - LZDecompressVram(gBattleTerrainAnimTilemap_Underwater, (void*)(BG_SCREEN_ADDR(28))); + LZDecompressVram(gBattleTerrainAnimTiles_Underwater, (void *)(BG_CHAR_ADDR(1))); + LZDecompressVram(gBattleTerrainAnimTilemap_Underwater, (void *)(BG_SCREEN_ADDR(28))); } else if (gBattleTypeFlags & BATTLE_TYPE_RAYQUAZA) { - LZDecompressVram(gBattleTerrainAnimTiles_Rayquaza, (void*)(BG_CHAR_ADDR(1))); - LZDecompressVram(gBattleTerrainAnimTilemap_Rayquaza, (void*)(BG_SCREEN_ADDR(28))); + LZDecompressVram(gBattleTerrainAnimTiles_Rayquaza, (void *)(BG_CHAR_ADDR(1))); + LZDecompressVram(gBattleTerrainAnimTilemap_Rayquaza, (void *)(BG_SCREEN_ADDR(28))); } else { @@ -1180,27 +1180,27 @@ void DrawBattleEntryBackground(void) u8 trainerClass = gTrainers[gTrainerBattleOpponent_A].trainerClass; if (trainerClass == TRAINER_CLASS_LEADER) { - LZDecompressVram(gBattleTerrainAnimTiles_Building, (void*)(BG_CHAR_ADDR(1))); - LZDecompressVram(gBattleTerrainAnimTilemap_Building, (void*)(BG_SCREEN_ADDR(28))); + LZDecompressVram(gBattleTerrainAnimTiles_Building, (void *)(BG_CHAR_ADDR(1))); + LZDecompressVram(gBattleTerrainAnimTilemap_Building, (void *)(BG_SCREEN_ADDR(28))); return; } else if (trainerClass == TRAINER_CLASS_CHAMPION) { - LZDecompressVram(gBattleTerrainAnimTiles_Building, (void*)(BG_CHAR_ADDR(1))); - LZDecompressVram(gBattleTerrainAnimTilemap_Building, (void*)(BG_SCREEN_ADDR(28))); + LZDecompressVram(gBattleTerrainAnimTiles_Building, (void *)(BG_CHAR_ADDR(1))); + LZDecompressVram(gBattleTerrainAnimTilemap_Building, (void *)(BG_SCREEN_ADDR(28))); return; } } if (GetCurrentMapBattleScene() == MAP_BATTLE_SCENE_NORMAL) { - LZDecompressVram(sBattleTerrainTable[gBattleTerrain].entryTileset, (void*)(BG_CHAR_ADDR(1))); - LZDecompressVram(sBattleTerrainTable[gBattleTerrain].entryTilemap, (void*)(BG_SCREEN_ADDR(28))); + LZDecompressVram(sBattleTerrainTable[gBattleTerrain].entryTileset, (void *)(BG_CHAR_ADDR(1))); + LZDecompressVram(sBattleTerrainTable[gBattleTerrain].entryTilemap, (void *)(BG_SCREEN_ADDR(28))); } else { - LZDecompressVram(gBattleTerrainAnimTiles_Building, (void*)(BG_CHAR_ADDR(1))); - LZDecompressVram(gBattleTerrainAnimTilemap_Building, (void*)(BG_SCREEN_ADDR(28))); + LZDecompressVram(gBattleTerrainAnimTiles_Building, (void *)(BG_CHAR_ADDR(1))); + LZDecompressVram(gBattleTerrainAnimTilemap_Building, (void *)(BG_SCREEN_ADDR(28))); } } } @@ -1212,7 +1212,7 @@ bool8 LoadChosenBattleElement(u8 caseId) switch (caseId) { case 0: - LZDecompressVram(gBattleTextboxTiles, (void*)(BG_CHAR_ADDR(0))); + LZDecompressVram(gBattleTextboxTiles, (void *)(BG_CHAR_ADDR(0))); break; case 1: CopyToBgTilemapBuffer(0, gBattleTextboxTilemap, 0, 0); @@ -1224,11 +1224,11 @@ bool8 LoadChosenBattleElement(u8 caseId) case 3: if (gBattleTypeFlags & (BATTLE_TYPE_FRONTIER | BATTLE_TYPE_LINK | BATTLE_TYPE_RECORDED_LINK | BATTLE_TYPE_EREADER_TRAINER)) { - LZDecompressVram(gBattleTerrainTiles_Building, (void*)(BG_CHAR_ADDR(2))); + LZDecompressVram(gBattleTerrainTiles_Building, (void *)(BG_CHAR_ADDR(2))); } else if (gBattleTypeFlags & BATTLE_TYPE_GROUDON) { - LZDecompressVram(gBattleTerrainTiles_Cave, (void*)(BG_CHAR_ADDR(2))); + LZDecompressVram(gBattleTerrainTiles_Cave, (void *)(BG_CHAR_ADDR(2))); } else { @@ -1237,12 +1237,12 @@ bool8 LoadChosenBattleElement(u8 caseId) u8 trainerClass = gTrainers[gTrainerBattleOpponent_A].trainerClass; if (trainerClass == TRAINER_CLASS_LEADER) { - LZDecompressVram(gBattleTerrainTiles_Building, (void*)(BG_CHAR_ADDR(2))); + LZDecompressVram(gBattleTerrainTiles_Building, (void *)(BG_CHAR_ADDR(2))); break; } else if (trainerClass == TRAINER_CLASS_CHAMPION) { - LZDecompressVram(gBattleTerrainTiles_Stadium, (void*)(BG_CHAR_ADDR(2))); + LZDecompressVram(gBattleTerrainTiles_Stadium, (void *)(BG_CHAR_ADDR(2))); break; } } @@ -1251,31 +1251,31 @@ bool8 LoadChosenBattleElement(u8 caseId) { default: case MAP_BATTLE_SCENE_NORMAL: - LZDecompressVram(sBattleTerrainTable[gBattleTerrain].tileset, (void*)(BG_CHAR_ADDR(2))); + LZDecompressVram(sBattleTerrainTable[gBattleTerrain].tileset, (void *)(BG_CHAR_ADDR(2))); break; case MAP_BATTLE_SCENE_GYM: - LZDecompressVram(gBattleTerrainTiles_Building, (void*)(BG_CHAR_ADDR(2))); + LZDecompressVram(gBattleTerrainTiles_Building, (void *)(BG_CHAR_ADDR(2))); break; case MAP_BATTLE_SCENE_MAGMA: - LZDecompressVram(gBattleTerrainTiles_Stadium, (void*)(BG_CHAR_ADDR(2))); + LZDecompressVram(gBattleTerrainTiles_Stadium, (void *)(BG_CHAR_ADDR(2))); break; case MAP_BATTLE_SCENE_AQUA: - LZDecompressVram(gBattleTerrainTiles_Stadium, (void*)(BG_CHAR_ADDR(2))); + LZDecompressVram(gBattleTerrainTiles_Stadium, (void *)(BG_CHAR_ADDR(2))); break; case MAP_BATTLE_SCENE_SIDNEY: - LZDecompressVram(gBattleTerrainTiles_Stadium, (void*)(BG_CHAR_ADDR(2))); + LZDecompressVram(gBattleTerrainTiles_Stadium, (void *)(BG_CHAR_ADDR(2))); break; case MAP_BATTLE_SCENE_PHOEBE: - LZDecompressVram(gBattleTerrainTiles_Stadium, (void*)(BG_CHAR_ADDR(2))); + LZDecompressVram(gBattleTerrainTiles_Stadium, (void *)(BG_CHAR_ADDR(2))); break; case MAP_BATTLE_SCENE_GLACIA: - LZDecompressVram(gBattleTerrainTiles_Stadium, (void*)(BG_CHAR_ADDR(2))); + LZDecompressVram(gBattleTerrainTiles_Stadium, (void *)(BG_CHAR_ADDR(2))); break; case MAP_BATTLE_SCENE_DRAKE: - LZDecompressVram(gBattleTerrainTiles_Stadium, (void*)(BG_CHAR_ADDR(2))); + LZDecompressVram(gBattleTerrainTiles_Stadium, (void *)(BG_CHAR_ADDR(2))); break; case MAP_BATTLE_SCENE_FRONTIER: - LZDecompressVram(gBattleTerrainTiles_Building, (void*)(BG_CHAR_ADDR(2))); + LZDecompressVram(gBattleTerrainTiles_Building, (void *)(BG_CHAR_ADDR(2))); break; } } @@ -1283,14 +1283,14 @@ bool8 LoadChosenBattleElement(u8 caseId) case 4: if (gBattleTypeFlags & (BATTLE_TYPE_FRONTIER | BATTLE_TYPE_LINK | BATTLE_TYPE_RECORDED_LINK | BATTLE_TYPE_EREADER_TRAINER)) { - LZDecompressVram(gBattleTerrainTilemap_Building, (void*)(BG_SCREEN_ADDR(26))); + LZDecompressVram(gBattleTerrainTilemap_Building, (void *)(BG_SCREEN_ADDR(26))); } else if (gBattleTypeFlags & BATTLE_TYPE_KYOGRE_GROUDON) { if (gGameVersion == VERSION_RUBY) - LZDecompressVram(gBattleTerrainTilemap_Cave, (void*)(BG_SCREEN_ADDR(26))); + LZDecompressVram(gBattleTerrainTilemap_Cave, (void *)(BG_SCREEN_ADDR(26))); else - LZDecompressVram(gBattleTerrainTilemap_Water, (void*)(BG_SCREEN_ADDR(26))); + LZDecompressVram(gBattleTerrainTilemap_Water, (void *)(BG_SCREEN_ADDR(26))); } else { @@ -1299,12 +1299,12 @@ bool8 LoadChosenBattleElement(u8 caseId) u8 trainerClass = gTrainers[gTrainerBattleOpponent_A].trainerClass; if (trainerClass == TRAINER_CLASS_LEADER) { - LZDecompressVram(gBattleTerrainTilemap_Building, (void*)(BG_SCREEN_ADDR(26))); + LZDecompressVram(gBattleTerrainTilemap_Building, (void *)(BG_SCREEN_ADDR(26))); break; } else if (trainerClass == TRAINER_CLASS_CHAMPION) { - LZDecompressVram(gBattleTerrainTilemap_Stadium, (void*)(BG_SCREEN_ADDR(26))); + LZDecompressVram(gBattleTerrainTilemap_Stadium, (void *)(BG_SCREEN_ADDR(26))); break; } } @@ -1313,31 +1313,31 @@ bool8 LoadChosenBattleElement(u8 caseId) { default: case MAP_BATTLE_SCENE_NORMAL: - LZDecompressVram(sBattleTerrainTable[gBattleTerrain].tilemap, (void*)(BG_SCREEN_ADDR(26))); + LZDecompressVram(sBattleTerrainTable[gBattleTerrain].tilemap, (void *)(BG_SCREEN_ADDR(26))); break; case MAP_BATTLE_SCENE_GYM: - LZDecompressVram(gBattleTerrainTilemap_Building, (void*)(BG_SCREEN_ADDR(26))); + LZDecompressVram(gBattleTerrainTilemap_Building, (void *)(BG_SCREEN_ADDR(26))); break; case MAP_BATTLE_SCENE_MAGMA: - LZDecompressVram(gBattleTerrainTilemap_Stadium, (void*)(BG_SCREEN_ADDR(26))); + LZDecompressVram(gBattleTerrainTilemap_Stadium, (void *)(BG_SCREEN_ADDR(26))); break; case MAP_BATTLE_SCENE_AQUA: - LZDecompressVram(gBattleTerrainTilemap_Stadium, (void*)(BG_SCREEN_ADDR(26))); + LZDecompressVram(gBattleTerrainTilemap_Stadium, (void *)(BG_SCREEN_ADDR(26))); break; case MAP_BATTLE_SCENE_SIDNEY: - LZDecompressVram(gBattleTerrainTilemap_Stadium, (void*)(BG_SCREEN_ADDR(26))); + LZDecompressVram(gBattleTerrainTilemap_Stadium, (void *)(BG_SCREEN_ADDR(26))); break; case MAP_BATTLE_SCENE_PHOEBE: - LZDecompressVram(gBattleTerrainTilemap_Stadium, (void*)(BG_SCREEN_ADDR(26))); + LZDecompressVram(gBattleTerrainTilemap_Stadium, (void *)(BG_SCREEN_ADDR(26))); break; case MAP_BATTLE_SCENE_GLACIA: - LZDecompressVram(gBattleTerrainTilemap_Stadium, (void*)(BG_SCREEN_ADDR(26))); + LZDecompressVram(gBattleTerrainTilemap_Stadium, (void *)(BG_SCREEN_ADDR(26))); break; case MAP_BATTLE_SCENE_DRAKE: - LZDecompressVram(gBattleTerrainTilemap_Stadium, (void*)(BG_SCREEN_ADDR(26))); + LZDecompressVram(gBattleTerrainTilemap_Stadium, (void *)(BG_SCREEN_ADDR(26))); break; case MAP_BATTLE_SCENE_FRONTIER: - LZDecompressVram(gBattleTerrainTilemap_Building, (void*)(BG_SCREEN_ADDR(26))); + LZDecompressVram(gBattleTerrainTilemap_Building, (void *)(BG_SCREEN_ADDR(26))); break; } } diff --git a/src/battle_controller_link_opponent.c b/src/battle_controller_link_opponent.c index 668dd01b4..a0756b8cb 100644 --- a/src/battle_controller_link_opponent.c +++ b/src/battle_controller_link_opponent.c @@ -627,7 +627,7 @@ static u32 CopyLinkOpponentMonData(u8 monId, u8 *dst) moveData.pp[size] = GetMonData(&gEnemyParty[monId], MON_DATA_PP1 + size); } moveData.ppBonuses = GetMonData(&gEnemyParty[monId], MON_DATA_PP_BONUSES); - src = (u8*)(&moveData); + src = (u8 *)(&moveData); for (size = 0; size < sizeof(moveData); size++) dst[size] = src[size]; break; @@ -1466,7 +1466,7 @@ static void LinkOpponentHandlePrintString(void) gBattle_BG0_X = 0; gBattle_BG0_Y = 0; - stringId = (u16*)(&gBattleBufferA[gActiveBattler][2]); + stringId = (u16 *)(&gBattleBufferA[gActiveBattler][2]); BufferStringBattle(*stringId); BattlePutTextOnWindow(gDisplayedStringBattle, B_WIN_MSG); gBattlerControllerFuncs[gActiveBattler] = CompleteOnInactiveTextPrinter; diff --git a/src/battle_controller_link_partner.c b/src/battle_controller_link_partner.c index 14d806576..c072ae12f 100644 --- a/src/battle_controller_link_partner.c +++ b/src/battle_controller_link_partner.c @@ -514,7 +514,7 @@ static u32 CopyLinkPartnerMonData(u8 monId, u8 *dst) moveData.pp[size] = GetMonData(&gPlayerParty[monId], MON_DATA_PP1 + size); } moveData.ppBonuses = GetMonData(&gPlayerParty[monId], MON_DATA_PP_BONUSES); - src = (u8*)(&moveData); + src = (u8 *)(&moveData); for (size = 0; size < sizeof(moveData); size++) dst[size] = src[size]; break; @@ -1298,7 +1298,7 @@ static void LinkPartnerHandlePrintString(void) gBattle_BG0_X = 0; gBattle_BG0_Y = 0; - stringId = (u16*)(&gBattleBufferA[gActiveBattler][2]); + stringId = (u16 *)(&gBattleBufferA[gActiveBattler][2]); BufferStringBattle(*stringId); BattlePutTextOnWindow(gDisplayedStringBattle, B_WIN_MSG); gBattlerControllerFuncs[gActiveBattler] = CompleteOnInactiveTextPrinter; diff --git a/src/battle_controller_opponent.c b/src/battle_controller_opponent.c index ead5a8768..cf155dc76 100644 --- a/src/battle_controller_opponent.c +++ b/src/battle_controller_opponent.c @@ -627,7 +627,7 @@ static u32 GetOpponentMonData(u8 monId, u8 *dst) moveData.pp[size] = GetMonData(&gEnemyParty[monId], MON_DATA_PP1 + size); } moveData.ppBonuses = GetMonData(&gEnemyParty[monId], MON_DATA_PP_BONUSES); - src = (u8*)(&moveData); + src = (u8 *)(&moveData); for (size = 0; size < sizeof(moveData); size++) dst[size] = src[size]; break; @@ -1519,7 +1519,7 @@ static void OpponentHandlePrintString(void) gBattle_BG0_X = 0; gBattle_BG0_Y = 0; - stringId = (u16*)(&gBattleBufferA[gActiveBattler][2]); + stringId = (u16 *)(&gBattleBufferA[gActiveBattler][2]); BufferStringBattle(*stringId); BattlePutTextOnWindow(gDisplayedStringBattle, B_WIN_MSG); gBattlerControllerFuncs[gActiveBattler] = CompleteOnInactiveTextPrinter; @@ -1552,7 +1552,7 @@ static void OpponentHandleChooseMove(void) else { u8 chosenMoveId; - struct ChooseMoveStruct *moveInfo = (struct ChooseMoveStruct*)(&gBattleBufferA[gActiveBattler][4]); + struct ChooseMoveStruct *moveInfo = (struct ChooseMoveStruct *)(&gBattleBufferA[gActiveBattler][4]); if (gBattleTypeFlags & (BATTLE_TYPE_TRAINER | BATTLE_TYPE_FIRST_BATTLE | BATTLE_TYPE_SAFARI | BATTLE_TYPE_ROAMER)) { diff --git a/src/battle_controller_player.c b/src/battle_controller_player.c index 91546655b..27adb9ee4 100644 --- a/src/battle_controller_player.c +++ b/src/battle_controller_player.c @@ -471,7 +471,7 @@ static void HandleInputChooseTarget(void) static void HandleInputChooseMove(void) { bool32 canSelectTarget = FALSE; - struct ChooseMoveStruct *moveInfo = (struct ChooseMoveStruct*)(&gBattleBufferA[gActiveBattler][4]); + struct ChooseMoveStruct *moveInfo = (struct ChooseMoveStruct *)(&gBattleBufferA[gActiveBattler][4]); if (JOY_HELD(DPAD_ANY) && gSaveBlock2Ptr->optionsButtonMode == OPTIONS_BUTTON_MODE_L_EQUALS_A) gPlayerDpadHoldFrames++; @@ -676,7 +676,7 @@ static void HandleMoveSwitching(void) if (gMoveSelectionCursor[gActiveBattler] != gMultiUsePlayerCursor) { - struct ChooseMoveStruct *moveInfo = (struct ChooseMoveStruct*)(&gBattleBufferA[gActiveBattler][4]); + struct ChooseMoveStruct *moveInfo = (struct ChooseMoveStruct *)(&gBattleBufferA[gActiveBattler][4]); s32 i; // swap moves and pp @@ -1456,7 +1456,7 @@ static void PlayerHandleYesNoInput(void) static void MoveSelectionDisplayMoveNames(void) { s32 i; - struct ChooseMoveStruct *moveInfo = (struct ChooseMoveStruct*)(&gBattleBufferA[gActiveBattler][4]); + struct ChooseMoveStruct *moveInfo = (struct ChooseMoveStruct *)(&gBattleBufferA[gActiveBattler][4]); gNumberOfMovesToChoose = 0; for (i = 0; i < MAX_MON_MOVES; i++) @@ -1485,7 +1485,7 @@ static void MoveSelectionDisplayPpNumber(void) return; SetPpNumbersPaletteInMoveSelection(); - moveInfo = (struct ChooseMoveStruct*)(&gBattleBufferA[gActiveBattler][4]); + moveInfo = (struct ChooseMoveStruct *)(&gBattleBufferA[gActiveBattler][4]); txtPtr = ConvertIntToDecimalStringN(gDisplayedStringBattle, moveInfo->currentPp[gMoveSelectionCursor[gActiveBattler]], STR_CONV_MODE_RIGHT_ALIGN, 2); *(txtPtr)++ = CHAR_SLASH; ConvertIntToDecimalStringN(txtPtr, moveInfo->maxPp[gMoveSelectionCursor[gActiveBattler]], STR_CONV_MODE_RIGHT_ALIGN, 2); @@ -1496,7 +1496,7 @@ static void MoveSelectionDisplayPpNumber(void) static void MoveSelectionDisplayMoveType(void) { u8 *txtPtr; - struct ChooseMoveStruct *moveInfo = (struct ChooseMoveStruct*)(&gBattleBufferA[gActiveBattler][4]); + struct ChooseMoveStruct *moveInfo = (struct ChooseMoveStruct *)(&gBattleBufferA[gActiveBattler][4]); txtPtr = StringCopy(gDisplayedStringBattle, gText_MoveInterfaceType); *(txtPtr)++ = EXT_CTRL_CODE_BEGIN; @@ -1672,7 +1672,7 @@ static u32 CopyPlayerMonData(u8 monId, u8 *dst) moveData.pp[size] = GetMonData(&gPlayerParty[monId], MON_DATA_PP1 + size); } moveData.ppBonuses = GetMonData(&gPlayerParty[monId], MON_DATA_PP_BONUSES); - src = (u8*)(&moveData); + src = (u8 *)(&moveData); for (size = 0; size < sizeof(moveData); size++) dst[size] = src[size]; break; @@ -2546,7 +2546,7 @@ static void PlayerHandlePrintString(void) gBattle_BG0_X = 0; gBattle_BG0_Y = 0; - stringId = (u16*)(&gBattleBufferA[gActiveBattler][2]); + stringId = (u16 *)(&gBattleBufferA[gActiveBattler][2]); BufferStringBattle(*stringId); BattlePutTextOnWindow(gDisplayedStringBattle, B_WIN_MSG); gBattlerControllerFuncs[gActiveBattler] = CompleteOnInactiveTextPrinter2; @@ -2797,7 +2797,7 @@ static void PlayerHandleDMA3Transfer(void) u16 sizeArg = gBattleBufferA[gActiveBattler][5] | (gBattleBufferA[gActiveBattler][6] << 8); const u8 *src = &gBattleBufferA[gActiveBattler][7]; - u8 *dst = (u8*)(dstArg); + u8 *dst = (u8 *)(dstArg); u32 size = sizeArg; while (1) diff --git a/src/battle_controller_player_partner.c b/src/battle_controller_player_partner.c index c2ff08a23..3812a8ffe 100644 --- a/src/battle_controller_player_partner.c +++ b/src/battle_controller_player_partner.c @@ -698,7 +698,7 @@ static u32 CopyPlayerPartnerMonData(u8 monId, u8 *dst) moveData.pp[size] = GetMonData(&gPlayerParty[monId], MON_DATA_PP1 + size); } moveData.ppBonuses = GetMonData(&gPlayerParty[monId], MON_DATA_PP_BONUSES); - src = (u8*)(&moveData); + src = (u8 *)(&moveData); for (size = 0; size < sizeof(moveData); size++) dst[size] = src[size]; break; @@ -1488,7 +1488,7 @@ static void PlayerPartnerHandlePrintString(void) gBattle_BG0_X = 0; gBattle_BG0_Y = 0; - stringId = (u16*)(&gBattleBufferA[gActiveBattler][2]); + stringId = (u16 *)(&gBattleBufferA[gActiveBattler][2]); BufferStringBattle(*stringId); BattlePutTextOnWindow(gDisplayedStringBattle, B_WIN_MSG); gBattlerControllerFuncs[gActiveBattler] = CompleteOnInactiveTextPrinter2; @@ -1513,7 +1513,7 @@ static void PlayerPartnerHandleYesNoBox(void) static void PlayerPartnerHandleChooseMove(void) { u8 chosenMoveId; - struct ChooseMoveStruct *moveInfo = (struct ChooseMoveStruct*)(&gBattleBufferA[gActiveBattler][4]); + struct ChooseMoveStruct *moveInfo = (struct ChooseMoveStruct *)(&gBattleBufferA[gActiveBattler][4]); BattleAI_SetupAIData(0xF); chosenMoveId = BattleAI_ChooseMoveOrAction(); diff --git a/src/battle_controller_recorded_opponent.c b/src/battle_controller_recorded_opponent.c index 4a35ef723..ebfdbc909 100644 --- a/src/battle_controller_recorded_opponent.c +++ b/src/battle_controller_recorded_opponent.c @@ -610,7 +610,7 @@ static u32 CopyRecordedOpponentMonData(u8 monId, u8 *dst) moveData.pp[size] = GetMonData(&gEnemyParty[monId], MON_DATA_PP1 + size); } moveData.ppBonuses = GetMonData(&gEnemyParty[monId], MON_DATA_PP_BONUSES); - src = (u8*)(&moveData); + src = (u8 *)(&moveData); for (size = 0; size < sizeof(moveData); size++) dst[size] = src[size]; break; @@ -1393,7 +1393,7 @@ static void RecordedOpponentHandlePrintString(void) gBattle_BG0_X = 0; gBattle_BG0_Y = 0; - stringId = (u16*)(&gBattleBufferA[gActiveBattler][2]); + stringId = (u16 *)(&gBattleBufferA[gActiveBattler][2]); BufferStringBattle(*stringId); BattlePutTextOnWindow(gDisplayedStringBattle, B_WIN_MSG); gBattlerControllerFuncs[gActiveBattler] = CompleteOnInactiveTextPrinter; diff --git a/src/battle_controller_recorded_player.c b/src/battle_controller_recorded_player.c index e25482fb5..6200b5ef6 100644 --- a/src/battle_controller_recorded_player.c +++ b/src/battle_controller_recorded_player.c @@ -589,7 +589,7 @@ static u32 CopyRecordedPlayerMonData(u8 monId, u8 *dst) moveData.pp[size] = GetMonData(&gPlayerParty[monId], MON_DATA_PP1 + size); } moveData.ppBonuses = GetMonData(&gPlayerParty[monId], MON_DATA_PP_BONUSES); - src = (u8*)(&moveData); + src = (u8 *)(&moveData); for (size = 0; size < sizeof(moveData); size++) dst[size] = src[size]; break; @@ -1399,7 +1399,7 @@ static void RecordedPlayerHandlePrintString(void) gBattle_BG0_X = 0; gBattle_BG0_Y = 0; - stringId = (u16*)(&gBattleBufferA[gActiveBattler][2]); + stringId = (u16 *)(&gBattleBufferA[gActiveBattler][2]); BufferStringBattle(*stringId); BattlePutTextOnWindow(gDisplayedStringBattle, B_WIN_MSG); gBattlerControllerFuncs[gActiveBattler] = CompleteOnInactiveTextPrinter; diff --git a/src/battle_controller_safari.c b/src/battle_controller_safari.c index 78a57a0f7..5e8ef2d28 100644 --- a/src/battle_controller_safari.c +++ b/src/battle_controller_safari.c @@ -422,7 +422,7 @@ static void SafariHandlePrintString(void) gBattle_BG0_X = 0; gBattle_BG0_Y = 0; - stringId = (u16*)(&gBattleBufferA[gActiveBattler][2]); + stringId = (u16 *)(&gBattleBufferA[gActiveBattler][2]); BufferStringBattle(*stringId); BattlePutTextOnWindow(gDisplayedStringBattle, B_WIN_MSG); gBattlerControllerFuncs[gActiveBattler] = CompleteOnInactiveTextPrinter; diff --git a/src/battle_controller_wally.c b/src/battle_controller_wally.c index c4c0c11a9..8e0283177 100644 --- a/src/battle_controller_wally.c +++ b/src/battle_controller_wally.c @@ -516,7 +516,7 @@ static u32 CopyWallyMonData(u8 monId, u8 *dst) moveData.pp[size] = GetMonData(&gPlayerParty[monId], MON_DATA_PP1 + size); } moveData.ppBonuses = GetMonData(&gPlayerParty[monId], MON_DATA_PP_BONUSES); - src = (u8*)(&moveData); + src = (u8 *)(&moveData); for (size = 0; size < sizeof(moveData); size++) dst[size] = src[size]; break; @@ -1176,7 +1176,7 @@ static void WallyHandlePrintString(void) gBattle_BG0_X = 0; gBattle_BG0_Y = 0; - stringId = (u16*)(&gBattleBufferA[gActiveBattler][2]); + stringId = (u16 *)(&gBattleBufferA[gActiveBattler][2]); BufferStringBattle(*stringId); BattlePutTextOnWindow(gDisplayedStringBattle, B_WIN_MSG); gBattlerControllerFuncs[gActiveBattler] = CompleteOnInactiveTextPrinter; diff --git a/src/battle_controllers.c b/src/battle_controllers.c index 369f735f2..42bdba899 100644 --- a/src/battle_controllers.c +++ b/src/battle_controllers.c @@ -99,10 +99,10 @@ void InitBattleControllers(void) } for (i = 0; i < sizeof(gBattleStruct->tvMovePoints); i++) - *((u8*)(&gBattleStruct->tvMovePoints) + i) = 0; + *((u8 *)(&gBattleStruct->tvMovePoints) + i) = 0; for (i = 0; i < sizeof(gBattleStruct->tv); i++) - *((u8*)(&gBattleStruct->tv) + i) = 0; + *((u8 *)(&gBattleStruct->tv) + i) = 0; } static void InitSinglePlayerBtlControllers(void) @@ -930,7 +930,7 @@ void BtlController_EmitSetMonData(u8 bufferId, u8 requestId, u8 monToCheck, u8 b sBattleBuffersTransferData[1] = requestId; sBattleBuffersTransferData[2] = monToCheck; for (i = 0; i < bytes; i++) - sBattleBuffersTransferData[3 + i] = *(u8*)(data++); + sBattleBuffersTransferData[3 + i] = *(u8 *)(data++); PrepareBufferDataTransfer(bufferId, sBattleBuffersTransferData, 3 + bytes); } @@ -942,7 +942,7 @@ void BtlController_EmitSetRawMonData(u8 bufferId, u8 monId, u8 bytes, void *data sBattleBuffersTransferData[1] = monId; sBattleBuffersTransferData[2] = bytes; for (i = 0; i < bytes; i++) - sBattleBuffersTransferData[3 + i] = *(u8*)(data++); + sBattleBuffersTransferData[3 + i] = *(u8 *)(data++); PrepareBufferDataTransfer(bufferId, sBattleBuffersTransferData, bytes + 3); } @@ -1039,7 +1039,7 @@ void BtlController_EmitPause(u8 bufferId, u8 toWait, void *data) sBattleBuffersTransferData[0] = CONTROLLER_PAUSE; sBattleBuffersTransferData[1] = toWait; for (i = 0; i < toWait * 3; i++) - sBattleBuffersTransferData[2 + i] = *(u8*)(data++); + sBattleBuffersTransferData[2 + i] = *(u8 *)(data++); PrepareBufferDataTransfer(bufferId, sBattleBuffersTransferData, toWait * 3 + 2); } @@ -1076,14 +1076,14 @@ void BtlController_EmitMoveAnimation(u8 bufferId, u16 move, u8 turnOfMove, u16 m void BtlController_EmitPrintString(u8 bufferId, u16 stringID) { s32 i; - struct BattleMsgData* stringInfo; + struct BattleMsgData *stringInfo; sBattleBuffersTransferData[0] = CONTROLLER_PRINTSTRING; sBattleBuffersTransferData[1] = gBattleOutcome; sBattleBuffersTransferData[2] = stringID; sBattleBuffersTransferData[3] = (stringID & 0xFF00) >> 8; - stringInfo = (struct BattleMsgData*)(&sBattleBuffersTransferData[4]); + stringInfo = (struct BattleMsgData *)(&sBattleBuffersTransferData[4]); stringInfo->currentMove = gCurrentMove; stringInfo->originallyUsedMove = gChosenMove; stringInfo->lastItem = gLastUsedItem; @@ -1115,7 +1115,7 @@ void BtlController_EmitPrintSelectionString(u8 bufferId, u16 stringID) sBattleBuffersTransferData[2] = stringID; sBattleBuffersTransferData[3] = (stringID & 0xFF00) >> 8; - stringInfo = (struct BattleMsgData*)(&sBattleBuffersTransferData[4]); + stringInfo = (struct BattleMsgData *)(&sBattleBuffersTransferData[4]); stringInfo->currentMove = gCurrentMove; stringInfo->originallyUsedMove = gChosenMove; stringInfo->lastItem = gLastUsedItem; @@ -1164,7 +1164,7 @@ void BtlController_EmitChooseMove(u8 bufferId, bool8 isDoubleBattle, bool8 NoPpN sBattleBuffersTransferData[2] = NoPpNumber; sBattleBuffersTransferData[3] = 0; for (i = 0; i < sizeof(*movePpData); i++) - sBattleBuffersTransferData[4 + i] = *((u8*)(movePpData) + i); + sBattleBuffersTransferData[4 + i] = *((u8 *)(movePpData) + i); PrepareBufferDataTransfer(bufferId, sBattleBuffersTransferData, sizeof(*movePpData) + 4); } @@ -1261,7 +1261,7 @@ void BtlController_EmitDataTransfer(u8 bufferId, u16 size, void *data) sBattleBuffersTransferData[2] = size; sBattleBuffersTransferData[3] = (size & 0xFF00) >> 8; for (i = 0; i < size; i++) - sBattleBuffersTransferData[4 + i] = *(u8*)(data++); + sBattleBuffersTransferData[4 + i] = *(u8 *)(data++); PrepareBufferDataTransfer(bufferId, sBattleBuffersTransferData, size + 4); } @@ -1277,7 +1277,7 @@ void BtlController_EmitDMA3Transfer(u8 bufferId, void *dst, u16 size, void *data sBattleBuffersTransferData[5] = size; sBattleBuffersTransferData[6] = (size & 0xFF00) >> 8; for (i = 0; i < size; i++) - sBattleBuffersTransferData[7 + i] = *(u8*)(data++); + sBattleBuffersTransferData[7 + i] = *(u8 *)(data++); PrepareBufferDataTransfer(bufferId, sBattleBuffersTransferData, size + 7); } @@ -1293,7 +1293,7 @@ void BtlController_EmitPlayBGM(u8 bufferId, u16 songId, void *data) // Nonsense loop using songId as a size // Would go out of bounds for any song id after SE_RG_BAG_POCKET (253) for (i = 0; i < songId; i++) - sBattleBuffersTransferData[3 + i] = *(u8*)(data++); + sBattleBuffersTransferData[3 + i] = *(u8 *)(data++); PrepareBufferDataTransfer(bufferId, sBattleBuffersTransferData, songId + 3); } @@ -1305,7 +1305,7 @@ void BtlController_EmitCmd32(u8 bufferId, u16 size, void *data) sBattleBuffersTransferData[1] = size; sBattleBuffersTransferData[2] = (size & 0xFF00) >> 8; for (i = 0; i < size; i++) - sBattleBuffersTransferData[3 + i] = *(u8*)(data++); + sBattleBuffersTransferData[3 + i] = *(u8 *)(data++); PrepareBufferDataTransfer(bufferId, sBattleBuffersTransferData, size + 3); } @@ -1451,7 +1451,7 @@ void BtlController_EmitDrawPartyStatusSummary(u8 bufferId, struct HpAndStatus* h sBattleBuffersTransferData[2] = (flags & PARTY_SUMM_SKIP_DRAW_DELAY) >> 7; // If true, skip delay after drawing. True during intro sBattleBuffersTransferData[3] = CONTROLLER_DRAWPARTYSTATUSSUMMARY; for (i = 0; i < (s32)(sizeof(struct HpAndStatus) * PARTY_SIZE); i++) - sBattleBuffersTransferData[4 + i] = *(i + (u8*)(hpAndStatus)); + sBattleBuffersTransferData[4 + i] = *(i + (u8 *)(hpAndStatus)); PrepareBufferDataTransfer(bufferId, sBattleBuffersTransferData, sizeof(struct HpAndStatus) * PARTY_SIZE + 4); } diff --git a/src/battle_dome.c b/src/battle_dome.c index 8385e831b..23b5ebdfc 100644 --- a/src/battle_dome.c +++ b/src/battle_dome.c @@ -97,7 +97,7 @@ static void CB2_TourneyTree(void); static void VblankCb_TourneyInfoCard(void); static void DisplayMatchInfoOnCard(u8, u8); static void DisplayTrainerInfoOnCard(u8, u8); -static int BufferDomeWinString(u8, u8*); +static int BufferDomeWinString(u8, u8 *); static u8 GetDomeBrainTrainerPicId(void); static u8 GetDomeBrainTrainerClass(void); static void CopyDomeBrainTrainerName(u8 *); diff --git a/src/battle_factory_screen.c b/src/battle_factory_screen.c index 8edece391..e2b626a63 100644 --- a/src/battle_factory_screen.c +++ b/src/battle_factory_screen.c @@ -2473,7 +2473,7 @@ static void Swap_Task_HandleYesNo(u8 taskId) gTasks[taskId].tSaidYes = TRUE; hiPtr = gTasks[taskId].tFollowUpTaskPtrHi; loPtr = gTasks[taskId].tFollowUpTaskPtrLo; - gTasks[taskId].func = (void*)((hiPtr << 16) | loPtr); + gTasks[taskId].func = (void *)((hiPtr << 16) | loPtr); } else { @@ -2482,7 +2482,7 @@ static void Swap_Task_HandleYesNo(u8 taskId) Swap_ErasePopupMenu(SWAP_WIN_YES_NO); hiPtr = gTasks[taskId].tFollowUpTaskPtrHi; loPtr = gTasks[taskId].tFollowUpTaskPtrLo; - gTasks[taskId].func = (void*)((hiPtr << 16) | loPtr); + gTasks[taskId].func = (void *)((hiPtr << 16) | loPtr); } } else if (JOY_NEW(B_BUTTON)) @@ -2492,7 +2492,7 @@ static void Swap_Task_HandleYesNo(u8 taskId) Swap_ErasePopupMenu(SWAP_WIN_YES_NO); hiPtr = gTasks[taskId].tFollowUpTaskPtrHi; loPtr = gTasks[taskId].tFollowUpTaskPtrLo; - gTasks[taskId].func = (void*)((hiPtr << 16) | loPtr); + gTasks[taskId].func = (void *)((hiPtr << 16) | loPtr); } else if (JOY_REPEAT(DPAD_UP)) { diff --git a/src/battle_gfx_sfx_util.c b/src/battle_gfx_sfx_util.c index d547dec0f..ca6be9d4e 100644 --- a/src/battle_gfx_sfx_util.c +++ b/src/battle_gfx_sfx_util.c @@ -110,7 +110,7 @@ u16 ChooseMoveAndTargetInBattlePalace(void) { s32 i, var1, var2; s32 chosenMoveId = -1; - struct ChooseMoveStruct *moveInfo = (struct ChooseMoveStruct*)(&gBattleBufferA[gActiveBattler][4]); + struct ChooseMoveStruct *moveInfo = (struct ChooseMoveStruct *)(&gBattleBufferA[gActiveBattler][4]); u8 unusableMovesBits = CheckMoveLimitations(gActiveBattler, 0, MOVE_LIMITATIONS_ALL); s32 percent = Random() % 100; @@ -1219,7 +1219,7 @@ void HideBattlerShadowSprite(u8 battlerId) // Color the background tiles surrounding the action selection and move windows void FillAroundBattleWindows(void) { - u16 *vramPtr = (u16*)(VRAM + 0x240); + u16 *vramPtr = (u16 *)(VRAM + 0x240); s32 i; s32 j; diff --git a/src/battle_interface.c b/src/battle_interface.c index dbcab4a9c..1fc25f265 100644 --- a/src/battle_interface.c +++ b/src/battle_interface.c @@ -159,7 +159,7 @@ enum }; static const u8 *GetHealthboxElementGfxPtr(u8); -static u8* AddTextPrinterAndCreateWindowOnHealthbox(const u8 *, u32, u32, u32, u32 *); +static u8 *AddTextPrinterAndCreateWindowOnHealthbox(const u8 *, u32, u32, u32, u32 *); static void RemoveWindowOnHealthbox(u32 windowId); static void UpdateHpTextInHealthboxInDoubles(u8, s16, u8); @@ -908,7 +908,7 @@ u8 CreateBattlerHealthboxSprites(u8 battlerId) healthBarSpritePtr->subspriteMode = SUBSPRITES_IGNORE_PRIORITY; healthBarSpritePtr->oam.priority = 1; - CpuCopy32(GetHealthboxElementGfxPtr(HEALTHBOX_GFX_1), (void*)(OBJ_VRAM0 + healthBarSpritePtr->oam.tileNum * TILE_SIZE_4BPP), 64); + CpuCopy32(GetHealthboxElementGfxPtr(HEALTHBOX_GFX_1), (void *)(OBJ_VRAM0 + healthBarSpritePtr->oam.tileNum * TILE_SIZE_4BPP), 64); gSprites[healthboxLeftSpriteId].hMain_HealthBarSpriteId = healthbarSpriteId; gSprites[healthboxLeftSpriteId].hMain_Battler = battlerId; @@ -1094,7 +1094,7 @@ static void UpdateLvlInHealthbox(u8 healthboxSpriteId, u8 lvl) if (GetBattlerSide(gSprites[healthboxSpriteId].hMain_Battler) == B_SIDE_PLAYER) { - objVram = (void*)(OBJ_VRAM0); + objVram = (void *)(OBJ_VRAM0); if (!IsDoubleBattle()) objVram += spriteTileNum + 0x820; else @@ -1102,7 +1102,7 @@ static void UpdateLvlInHealthbox(u8 healthboxSpriteId, u8 lvl) } else { - objVram = (void*)(OBJ_VRAM0); + objVram = (void *)(OBJ_VRAM0); objVram += spriteTileNum + 0x400; } TextIntoHealthboxObject(objVram, windowTileData, 3); @@ -1123,7 +1123,7 @@ void UpdateHpTextInHealthbox(u8 healthboxSpriteId, s16 value, u8 maxOrCurrent) { ConvertIntToDecimalStringN(text, value, STR_CONV_MODE_RIGHT_ALIGN, 3); windowTileData = AddTextPrinterAndCreateWindowOnHealthbox(text, 0, 5, 2, &windowId); - objVram = (void*)(OBJ_VRAM0); + objVram = (void *)(OBJ_VRAM0); objVram += spriteTileNum + 0xB40; HpTextIntoHealthboxObject(objVram, windowTileData, 2); RemoveWindowOnHealthbox(windowId); @@ -1134,10 +1134,10 @@ void UpdateHpTextInHealthbox(u8 healthboxSpriteId, s16 value, u8 maxOrCurrent) text[3] = CHAR_SLASH; text[4] = EOS; windowTileData = AddTextPrinterAndCreateWindowOnHealthbox(text, 4, 5, 2, &windowId); - objVram = (void*)(OBJ_VRAM0); + objVram = (void *)(OBJ_VRAM0); objVram += spriteTileNum + 0x3E0; HpTextIntoHealthboxObject(objVram, windowTileData, 1); - objVram = (void*)(OBJ_VRAM0); + objVram = (void *)(OBJ_VRAM0); objVram += spriteTileNum + 0xB00; HpTextIntoHealthboxObject(objVram, windowTileData + 0x20, 2); RemoveWindowOnHealthbox(windowId); @@ -1179,7 +1179,7 @@ void UpdateHpTextInHealthbox(u8 healthboxSpriteId, s16 value, u8 maxOrCurrent) for (i = 0; i < 3; i++) { CpuCopy32(&gMonSpritesGfxPtr->barFontGfx[i * 64 + 32], - (void*)((OBJ_VRAM0) + TILE_SIZE_4BPP * (gSprites[healthboxSpriteId].oam.tileNum + var + i)), + (void *)((OBJ_VRAM0) + TILE_SIZE_4BPP * (gSprites[healthboxSpriteId].oam.tileNum + var + i)), 0x20); } } @@ -1198,16 +1198,16 @@ static void UpdateHpTextInHealthboxInDoubles(u8 healthboxSpriteId, s16 value, u8 if (gBattleSpritesDataPtr->battlerData[gSprites[healthboxSpriteId].data[6]].hpNumbersNoBars) // don't print text if only bars are visible { spriteTileNum = gSprites[gSprites[healthboxSpriteId].data[5]].oam.tileNum * TILE_SIZE_4BPP; - objVram = (void*)(OBJ_VRAM0) + spriteTileNum; + objVram = (void *)(OBJ_VRAM0) + spriteTileNum; if (maxOrCurrent != HP_CURRENT) // doubles, max hp { ConvertIntToDecimalStringN(text, value, STR_CONV_MODE_RIGHT_ALIGN, 3); windowTileData = AddTextPrinterAndCreateWindowOnHealthbox(text, 0, 5, 0, &windowId); - HpTextIntoHealthboxObject((void*)(OBJ_VRAM0) + spriteTileNum + 0xC0, windowTileData, 2); + HpTextIntoHealthboxObject((void *)(OBJ_VRAM0) + spriteTileNum + 0xC0, windowTileData, 2); RemoveWindowOnHealthbox(windowId); CpuCopy32(GetHealthboxElementGfxPtr(HEALTHBOX_GFX_FRAME_END), - (void*)(OBJ_VRAM0 + 0x680) + (gSprites[healthboxSpriteId].oam.tileNum * TILE_SIZE_4BPP), + (void *)(OBJ_VRAM0 + 0x680) + (gSprites[healthboxSpriteId].oam.tileNum * TILE_SIZE_4BPP), 0x20); } else @@ -1217,7 +1217,7 @@ static void UpdateHpTextInHealthboxInDoubles(u8 healthboxSpriteId, s16 value, u8 text[4] = EOS; windowTileData = AddTextPrinterAndCreateWindowOnHealthbox(text, 4, 5, 0, &windowId); FillHealthboxObject(objVram, 0, 3); // Erases HP bar leftover. - HpTextIntoHealthboxObject((void*)(OBJ_VRAM0 + 0x60) + spriteTileNum, windowTileData, 3); + HpTextIntoHealthboxObject((void *)(OBJ_VRAM0 + 0x60) + spriteTileNum, windowTileData, 3); RemoveWindowOnHealthbox(windowId); } } @@ -1250,13 +1250,13 @@ static void UpdateHpTextInHealthboxInDoubles(u8 healthboxSpriteId, s16 value, u8 if (i < 3) { CpuCopy32(&gMonSpritesGfxPtr->barFontGfx[((i - var) * 64) + 32], - (void*)((OBJ_VRAM0) + 32 * (1 + gSprites[r7].oam.tileNum + i)), + (void *)((OBJ_VRAM0) + 32 * (1 + gSprites[r7].oam.tileNum + i)), 0x20); } else { CpuCopy32(&gMonSpritesGfxPtr->barFontGfx[((i - var) * 64) + 32], - (void*)((OBJ_VRAM0 + 0x20) + 32 * (i + gSprites[r7].oam.tileNum)), + (void *)((OBJ_VRAM0 + 0x20) + 32 * (i + gSprites[r7].oam.tileNum)), 0x20); } } @@ -1264,16 +1264,16 @@ static void UpdateHpTextInHealthboxInDoubles(u8 healthboxSpriteId, s16 value, u8 if (maxOrCurrent == HP_CURRENT) { CpuCopy32(&gMonSpritesGfxPtr->barFontGfx[224], - (void*)((OBJ_VRAM0) + ((gSprites[r7].oam.tileNum + 4) * TILE_SIZE_4BPP)), + (void *)((OBJ_VRAM0) + ((gSprites[r7].oam.tileNum + 4) * TILE_SIZE_4BPP)), 0x20); - CpuFill32(0, (void*)((OBJ_VRAM0) + (gSprites[r7].oam.tileNum * TILE_SIZE_4BPP)), 0x20); + CpuFill32(0, (void *)((OBJ_VRAM0) + (gSprites[r7].oam.tileNum * TILE_SIZE_4BPP)), 0x20); } else { if (GetBattlerSide(battlerId) == B_SIDE_PLAYER) // Impossible to reach part, because the battlerId is from the opponent's side. { CpuCopy32(GetHealthboxElementGfxPtr(HEALTHBOX_GFX_FRAME_END), - (void*)(OBJ_VRAM0) + ((gSprites[healthboxSpriteId].oam.tileNum + 52) * TILE_SIZE_4BPP), + (void *)(OBJ_VRAM0) + ((gSprites[healthboxSpriteId].oam.tileNum + 52) * TILE_SIZE_4BPP), 0x20); } } @@ -1313,11 +1313,11 @@ static void PrintSafariMonInfo(u8 healthboxSpriteId, struct Pokemon *mon) for (j = 1; j < var + 1; j++) { spriteTileNum = (gSprites[healthboxSpriteId].oam.tileNum + (j - (j / 8 * 8)) + (j / 8 * 64)) * TILE_SIZE_4BPP; - CpuCopy32(barFontGfx, (void*)(OBJ_VRAM0) + (spriteTileNum), 0x20); + CpuCopy32(barFontGfx, (void *)(OBJ_VRAM0) + (spriteTileNum), 0x20); barFontGfx += 0x20; spriteTileNum = (8 + gSprites[healthboxSpriteId].oam.tileNum + (j - (j / 8 * 8)) + (j / 8 * 64)) * TILE_SIZE_4BPP; - CpuCopy32(barFontGfx, (void*)(OBJ_VRAM0) + (spriteTileNum), 0x20); + CpuCopy32(barFontGfx, (void *)(OBJ_VRAM0) + (spriteTileNum), 0x20); barFontGfx += 0x20; } @@ -1334,13 +1334,13 @@ static void PrintSafariMonInfo(u8 healthboxSpriteId, struct Pokemon *mon) if (j <= 1) { CpuCopy32(&gMonSpritesGfxPtr->barFontGfx[0x40 * j + 0x20], - (void*)(OBJ_VRAM0) + (gSprites[healthBarSpriteId].oam.tileNum + 2 + j) * TILE_SIZE_4BPP, + (void *)(OBJ_VRAM0) + (gSprites[healthBarSpriteId].oam.tileNum + 2 + j) * TILE_SIZE_4BPP, 32); } else { CpuCopy32(&gMonSpritesGfxPtr->barFontGfx[0x40 * j + 0x20], - (void*)(OBJ_VRAM0 + 0xC0) + (j + gSprites[healthBarSpriteId].oam.tileNum) * TILE_SIZE_4BPP, + (void *)(OBJ_VRAM0 + 0xC0) + (j + gSprites[healthBarSpriteId].oam.tileNum) * TILE_SIZE_4BPP, 32); } } @@ -1372,7 +1372,7 @@ void SwapHpBarsWithHpText(void) { healthBarSpriteId = gSprites[gHealthboxSpriteIds[i]].hMain_HealthBarSpriteId; - CpuFill32(0, (void*)(OBJ_VRAM0 + gSprites[healthBarSpriteId].oam.tileNum * TILE_SIZE_4BPP), 0x100); + CpuFill32(0, (void *)(OBJ_VRAM0 + gSprites[healthBarSpriteId].oam.tileNum * TILE_SIZE_4BPP), 0x100); UpdateHpTextInHealthboxInDoubles(gHealthboxSpriteIds[i], GetMonData(&gPlayerParty[gBattlerPartyIndexes[i]], MON_DATA_HP), HP_CURRENT); UpdateHpTextInHealthboxInDoubles(gHealthboxSpriteIds[i], GetMonData(&gPlayerParty[gBattlerPartyIndexes[i]], MON_DATA_MAX_HP), HP_MAX); } @@ -1380,7 +1380,7 @@ void SwapHpBarsWithHpText(void) { UpdateStatusIconInHealthbox(gHealthboxSpriteIds[i]); UpdateHealthboxAttribute(gHealthboxSpriteIds[i], &gPlayerParty[gBattlerPartyIndexes[i]], HEALTHBOX_HEALTH_BAR); - CpuCopy32(GetHealthboxElementGfxPtr(HEALTHBOX_GFX_FRAME_END_BAR), (void*)(OBJ_VRAM0 + 0x680 + gSprites[gHealthboxSpriteIds[i]].oam.tileNum * TILE_SIZE_4BPP), 32); + CpuCopy32(GetHealthboxElementGfxPtr(HEALTHBOX_GFX_FRAME_END_BAR), (void *)(OBJ_VRAM0 + 0x680 + gSprites[gHealthboxSpriteIds[i]].oam.tileNum * TILE_SIZE_4BPP), 32); } } else @@ -1924,8 +1924,8 @@ static void UpdateNickInHealthbox(u8 healthboxSpriteId, struct Pokemon *mon) if (GetBattlerSide(gSprites[healthboxSpriteId].data[6]) == B_SIDE_PLAYER) { - TextIntoHealthboxObject((void*)(OBJ_VRAM0 + 0x40 + spriteTileNum), windowTileData, 6); - ptr = (void*)(OBJ_VRAM0); + TextIntoHealthboxObject((void *)(OBJ_VRAM0 + 0x40 + spriteTileNum), windowTileData, 6); + ptr = (void *)(OBJ_VRAM0); if (!IsDoubleBattle()) ptr += spriteTileNum + 0x800; else @@ -1934,7 +1934,7 @@ static void UpdateNickInHealthbox(u8 healthboxSpriteId, struct Pokemon *mon) } else { - TextIntoHealthboxObject((void*)(OBJ_VRAM0 + 0x20 + spriteTileNum), windowTileData, 7); + TextIntoHealthboxObject((void *)(OBJ_VRAM0 + 0x20 + spriteTileNum), windowTileData, 7); } RemoveWindowOnHealthbox(windowId); @@ -1958,9 +1958,9 @@ static void TryAddPokeballIconToHealthbox(u8 healthboxSpriteId, bool8 noStatus) healthBarSpriteId = gSprites[healthboxSpriteId].hMain_HealthBarSpriteId; if (noStatus) - CpuCopy32(GetHealthboxElementGfxPtr(HEALTHBOX_GFX_STATUS_BALL_CAUGHT), (void*)(OBJ_VRAM0 + (gSprites[healthBarSpriteId].oam.tileNum + 8) * TILE_SIZE_4BPP), 32); + CpuCopy32(GetHealthboxElementGfxPtr(HEALTHBOX_GFX_STATUS_BALL_CAUGHT), (void *)(OBJ_VRAM0 + (gSprites[healthBarSpriteId].oam.tileNum + 8) * TILE_SIZE_4BPP), 32); else - CpuFill32(0, (void*)(OBJ_VRAM0 + (gSprites[healthBarSpriteId].oam.tileNum + 8) * TILE_SIZE_4BPP), 32); + CpuFill32(0, (void *)(OBJ_VRAM0 + (gSprites[healthBarSpriteId].oam.tileNum + 8) * TILE_SIZE_4BPP), 32); } static void UpdateStatusIconInHealthbox(u8 healthboxSpriteId) @@ -2018,7 +2018,7 @@ static void UpdateStatusIconInHealthbox(u8 healthboxSpriteId) statusGfxPtr = GetHealthboxElementGfxPtr(HEALTHBOX_GFX_39); for (i = 0; i < 3; i++) - CpuCopy32(statusGfxPtr, (void*)(OBJ_VRAM0 + (gSprites[healthboxSpriteId].oam.tileNum + tileNumAdder + i) * TILE_SIZE_4BPP), 32); + CpuCopy32(statusGfxPtr, (void *)(OBJ_VRAM0 + (gSprites[healthboxSpriteId].oam.tileNum + tileNumAdder + i) * TILE_SIZE_4BPP), 32); if (!gBattleSpritesDataPtr->battlerData[battlerId].hpNumbersNoBars) CpuCopy32(GetHealthboxElementGfxPtr(HEALTHBOX_GFX_1), (void *)(OBJ_VRAM0 + gSprites[healthBarSpriteId].oam.tileNum * TILE_SIZE_4BPP), 64); @@ -2031,14 +2031,14 @@ static void UpdateStatusIconInHealthbox(u8 healthboxSpriteId) pltAdder += battlerId + 12; FillPalette(sStatusIconColors[statusPalId], pltAdder + 0x100, 2); - CpuCopy16(gPlttBufferUnfaded + 0x100 + pltAdder, (void*)(OBJ_PLTT + pltAdder * 2), 2); - CpuCopy32(statusGfxPtr, (void*)(OBJ_VRAM0 + (gSprites[healthboxSpriteId].oam.tileNum + tileNumAdder) * TILE_SIZE_4BPP), 96); + CpuCopy16(gPlttBufferUnfaded + 0x100 + pltAdder, (void *)(OBJ_PLTT + pltAdder * 2), 2); + CpuCopy32(statusGfxPtr, (void *)(OBJ_VRAM0 + (gSprites[healthboxSpriteId].oam.tileNum + tileNumAdder) * TILE_SIZE_4BPP), 96); if (IsDoubleBattle() == TRUE || GetBattlerSide(battlerId) == B_SIDE_OPPONENT) { if (!gBattleSpritesDataPtr->battlerData[battlerId].hpNumbersNoBars) { - CpuCopy32(GetHealthboxElementGfxPtr(HEALTHBOX_GFX_0), (void*)(OBJ_VRAM0 + gSprites[healthBarSpriteId].oam.tileNum * TILE_SIZE_4BPP), 32); - CpuCopy32(GetHealthboxElementGfxPtr(HEALTHBOX_GFX_65), (void*)(OBJ_VRAM0 + (gSprites[healthBarSpriteId].oam.tileNum + 1) * TILE_SIZE_4BPP), 32); + CpuCopy32(GetHealthboxElementGfxPtr(HEALTHBOX_GFX_0), (void *)(OBJ_VRAM0 + gSprites[healthBarSpriteId].oam.tileNum * TILE_SIZE_4BPP), 32); + CpuCopy32(GetHealthboxElementGfxPtr(HEALTHBOX_GFX_65), (void *)(OBJ_VRAM0 + (gSprites[healthBarSpriteId].oam.tileNum + 1) * TILE_SIZE_4BPP), 32); } } TryAddPokeballIconToHealthbox(healthboxSpriteId, FALSE); @@ -2111,8 +2111,8 @@ static void UpdateSafariBallsTextOnHealthbox(u8 healthboxSpriteId) windowTileData = AddTextPrinterAndCreateWindowOnHealthbox(gText_SafariBalls, 0, 3, 2, &windowId); spriteTileNum = gSprites[healthboxSpriteId].oam.tileNum * TILE_SIZE_4BPP; - TextIntoHealthboxObject((void*)(OBJ_VRAM0 + 0x40) + spriteTileNum, windowTileData, 6); - TextIntoHealthboxObject((void*)(OBJ_VRAM0 + 0x800) + spriteTileNum, windowTileData + 0xC0, 2); + TextIntoHealthboxObject((void *)(OBJ_VRAM0 + 0x40) + spriteTileNum, windowTileData, 6); + TextIntoHealthboxObject((void *)(OBJ_VRAM0 + 0x800) + spriteTileNum, windowTileData + 0xC0, 2); RemoveWindowOnHealthbox(windowId); } @@ -2128,8 +2128,8 @@ static void UpdateLeftNoOfBallsTextOnHealthbox(u8 healthboxSpriteId) windowTileData = AddTextPrinterAndCreateWindowOnHealthbox(text, GetStringRightAlignXOffset(FONT_SMALL, text, 0x2F), 3, 2, &windowId); spriteTileNum = gSprites[healthboxSpriteId].oam.tileNum * TILE_SIZE_4BPP; - SafariTextIntoHealthboxObject((void*)(OBJ_VRAM0 + 0x2C0) + spriteTileNum, windowTileData, 2); - SafariTextIntoHealthboxObject((void*)(OBJ_VRAM0 + 0xA00) + spriteTileNum, windowTileData + 0x40, 4); + SafariTextIntoHealthboxObject((void *)(OBJ_VRAM0 + 0x2C0) + spriteTileNum, windowTileData, 2); + SafariTextIntoHealthboxObject((void *)(OBJ_VRAM0 + 0xA00) + spriteTileNum, windowTileData + 0x40, 4); RemoveWindowOnHealthbox(windowId); } @@ -2273,10 +2273,10 @@ static void MoveBattleBarGraphically(u8 battlerId, u8 whichBar) u8 healthbarSpriteId = gSprites[gBattleSpritesDataPtr->battleBars[battlerId].healthboxSpriteId].hMain_HealthBarSpriteId; if (i < 2) CpuCopy32(GetHealthboxElementGfxPtr(barElementId) + array[i] * 32, - (void*)(OBJ_VRAM0 + (gSprites[healthbarSpriteId].oam.tileNum + 2 + i) * TILE_SIZE_4BPP), 32); + (void *)(OBJ_VRAM0 + (gSprites[healthbarSpriteId].oam.tileNum + 2 + i) * TILE_SIZE_4BPP), 32); else CpuCopy32(GetHealthboxElementGfxPtr(barElementId) + array[i] * 32, - (void*)(OBJ_VRAM0 + 64 + (i + gSprites[healthbarSpriteId].oam.tileNum) * TILE_SIZE_4BPP), 32); + (void *)(OBJ_VRAM0 + 64 + (i + gSprites[healthbarSpriteId].oam.tileNum) * TILE_SIZE_4BPP), 32); } break; case EXP_BAR: @@ -2295,10 +2295,10 @@ static void MoveBattleBarGraphically(u8 battlerId, u8 whichBar) { if (i < 4) CpuCopy32(GetHealthboxElementGfxPtr(HEALTHBOX_GFX_12) + array[i] * 32, - (void*)(OBJ_VRAM0 + (gSprites[gBattleSpritesDataPtr->battleBars[battlerId].healthboxSpriteId].oam.tileNum + 0x24 + i) * TILE_SIZE_4BPP), 32); + (void *)(OBJ_VRAM0 + (gSprites[gBattleSpritesDataPtr->battleBars[battlerId].healthboxSpriteId].oam.tileNum + 0x24 + i) * TILE_SIZE_4BPP), 32); else CpuCopy32(GetHealthboxElementGfxPtr(HEALTHBOX_GFX_12) + array[i] * 32, - (void*)(OBJ_VRAM0 + 0xB80 + (i + gSprites[gBattleSpritesDataPtr->battleBars[battlerId].healthboxSpriteId].oam.tileNum) * TILE_SIZE_4BPP), 32); + (void *)(OBJ_VRAM0 + 0xB80 + (i + gSprites[gBattleSpritesDataPtr->battleBars[battlerId].healthboxSpriteId].oam.tileNum) * TILE_SIZE_4BPP), 32); } break; } @@ -2522,7 +2522,7 @@ u8 GetHPBarLevel(s16 hp, s16 maxhp) return result; } -static u8* AddTextPrinterAndCreateWindowOnHealthbox(const u8 *str, u32 x, u32 y, u32 bgColor, u32 *windowId) +static u8 *AddTextPrinterAndCreateWindowOnHealthbox(const u8 *str, u32 x, u32 y, u32 bgColor, u32 *windowId) { u16 winId; u8 color[3]; @@ -2538,7 +2538,7 @@ static u8* AddTextPrinterAndCreateWindowOnHealthbox(const u8 *str, u32 x, u32 y, AddTextPrinterParameterized4(winId, FONT_SMALL, x, y, 0, 0, color, TEXT_SKIP_DRAW, str); *windowId = winId; - return (u8*)(GetWindowAttribute(winId, WINDOW_TILE_DATA)); + return (u8 *)(GetWindowAttribute(winId, WINDOW_TILE_DATA)); } static void RemoveWindowOnHealthbox(u32 windowId) diff --git a/src/battle_main.c b/src/battle_main.c index f61d5eaae..d9469470e 100644 --- a/src/battle_main.c +++ b/src/battle_main.c @@ -118,7 +118,7 @@ static void HandleEndTurn_BattleLost(void); static void HandleEndTurn_RanFromBattle(void); static void HandleEndTurn_MonFled(void); static void HandleEndTurn_FinishBattle(void); -static void SpriteCB_UnusedBattleInit(struct Sprite* sprite); +static void SpriteCB_UnusedBattleInit(struct Sprite *sprite); static void SpriteCB_UnusedBattleInit_Main(struct Sprite *sprite); EWRAM_DATA u16 gBattle_BG0_X = 0; @@ -606,7 +606,7 @@ static void CB2_InitBattleInternal(void) SetHBlankCallback(NULL); SetVBlankCallback(NULL); - CpuFill32(0, (void*)(VRAM), VRAM_SIZE); + CpuFill32(0, (void *)(VRAM), VRAM_SIZE); SetGpuReg(REG_OFFSET_MOSAIC, 0); SetGpuReg(REG_OFFSET_WIN0H, DISPLAY_WIDTH); @@ -1805,7 +1805,7 @@ static void CB2_HandleStartMultiBattle(void) case 8: if (IsLinkTaskFinished()) { - u32* ptr = gBattleStruct->multiBuffer.battleVideo; + u32 *ptr = gBattleStruct->multiBuffer.battleVideo; ptr[0] = gBattleTypeFlags; ptr[1] = gRecordedBattleRngSeed; // UB: overwrites berry data SendBlock(BitmaskAllOtherLinkPlayers(), ptr, sizeof(gBattleStruct->multiBuffer.battleVideo)); @@ -1891,7 +1891,7 @@ void CB2_QuitRecordedBattle(void) #define sState data[0] #define sDelay data[4] -static void SpriteCB_UnusedBattleInit(struct Sprite* sprite) +static void SpriteCB_UnusedBattleInit(struct Sprite *sprite) { sprite->sState = 0; sprite->callback = SpriteCB_UnusedBattleInit_Main; @@ -1899,7 +1899,7 @@ static void SpriteCB_UnusedBattleInit(struct Sprite* sprite) static void SpriteCB_UnusedBattleInit_Main(struct Sprite *sprite) { - u16 *arr = (u16*)gDecompressionBuffer; + u16 *arr = (u16 *)gDecompressionBuffer; switch (sprite->sState) { @@ -2178,7 +2178,7 @@ void CB2_InitEndLinkBattle(void) } else { - CpuFill32(0, (void*)(VRAM), VRAM_SIZE); + CpuFill32(0, (void *)(VRAM), VRAM_SIZE); SetGpuReg(REG_OFFSET_MOSAIC, 0); SetGpuReg(REG_OFFSET_WIN0H, DISPLAY_WIDTH); SetGpuReg(REG_OFFSET_WIN0V, WIN_RANGE(DISPLAY_HEIGHT / 2, DISPLAY_HEIGHT / 2 + 1)); @@ -2319,7 +2319,7 @@ static void EndLinkBattleInSteps(void) } break; case 3: - CpuFill32(0, (void*)VRAM, VRAM_SIZE); + CpuFill32(0, (void *)VRAM, VRAM_SIZE); for (i = 0; i < 2; i++) LoadChosenBattleElement(i); @@ -2406,7 +2406,7 @@ static void CB2_InitAskRecordBattle(void) SetHBlankCallback(NULL); SetVBlankCallback(NULL); - CpuFill32(0, (void*)(VRAM), VRAM_SIZE); + CpuFill32(0, (void *)(VRAM), VRAM_SIZE); ResetPaletteFade(); gBattle_BG0_X = 0; gBattle_BG0_Y = 0; @@ -2787,7 +2787,7 @@ static void SpriteCB_AnimFaintOpponent(struct Sprite *sprite) } else // Erase bottom part of the sprite to create a smooth illusion of mon falling down. { - u8* dst = gMonSpritesGfxPtr->sprites.byte[GetBattlerPosition(sprite->sBattler)] + (gBattleMonForms[sprite->sBattler] << 11) + (sprite->data[3] << 8); + u8 *dst = gMonSpritesGfxPtr->sprites.byte[GetBattlerPosition(sprite->sBattler)] + (gBattleMonForms[sprite->sBattler] << 11) + (sprite->data[3] << 8); for (i = 0; i < 0x100; i++) *(dst++) = 0; @@ -3109,10 +3109,10 @@ static void BattleStartClearSetData(void) *((u8 *)gBattleStruct->usedHeldItems + i) = 0; *((u8 *)gBattleStruct->choicedMove + i) = 0; *((u8 *)gBattleStruct->changedItems + i) = 0; - *(i + 0 * 8 + (u8*)(gBattleStruct->lastTakenMoveFrom) + 0) = 0; - *(i + 1 * 8 + (u8*)(gBattleStruct->lastTakenMoveFrom) + 0) = 0; - *(i + 2 * 8 + (u8*)(gBattleStruct->lastTakenMoveFrom) + 0) = 0; - *(i + 3 * 8 + (u8*)(gBattleStruct->lastTakenMoveFrom) + 0) = 0; + *(i + 0 * 8 + (u8 *)(gBattleStruct->lastTakenMoveFrom) + 0) = 0; + *(i + 1 * 8 + (u8 *)(gBattleStruct->lastTakenMoveFrom) + 0) = 0; + *(i + 2 * 8 + (u8 *)(gBattleStruct->lastTakenMoveFrom) + 0) = 0; + *(i + 3 * 8 + (u8 *)(gBattleStruct->lastTakenMoveFrom) + 0) = 0; } for (i = 0; i < MAX_BATTLERS_COUNT; i++) @@ -3214,14 +3214,14 @@ void SwitchInClearSetData(void) *(gBattleStruct->lastTakenMove + gActiveBattler * 2 + 0) = 0; *(gBattleStruct->lastTakenMove + gActiveBattler * 2 + 1) = 0; - *(0 * 2 + gActiveBattler * 8 + (u8*)(gBattleStruct->lastTakenMoveFrom) + 0) = 0; - *(0 * 2 + gActiveBattler * 8 + (u8*)(gBattleStruct->lastTakenMoveFrom) + 1) = 0; - *(1 * 2 + gActiveBattler * 8 + (u8*)(gBattleStruct->lastTakenMoveFrom) + 0) = 0; - *(1 * 2 + gActiveBattler * 8 + (u8*)(gBattleStruct->lastTakenMoveFrom) + 1) = 0; - *(2 * 2 + gActiveBattler * 8 + (u8*)(gBattleStruct->lastTakenMoveFrom) + 0) = 0; - *(2 * 2 + gActiveBattler * 8 + (u8*)(gBattleStruct->lastTakenMoveFrom) + 1) = 0; - *(3 * 2 + gActiveBattler * 8 + (u8*)(gBattleStruct->lastTakenMoveFrom) + 0) = 0; - *(3 * 2 + gActiveBattler * 8 + (u8*)(gBattleStruct->lastTakenMoveFrom) + 1) = 0; + *(0 * 2 + gActiveBattler * 8 + (u8 *)(gBattleStruct->lastTakenMoveFrom) + 0) = 0; + *(0 * 2 + gActiveBattler * 8 + (u8 *)(gBattleStruct->lastTakenMoveFrom) + 1) = 0; + *(1 * 2 + gActiveBattler * 8 + (u8 *)(gBattleStruct->lastTakenMoveFrom) + 0) = 0; + *(1 * 2 + gActiveBattler * 8 + (u8 *)(gBattleStruct->lastTakenMoveFrom) + 1) = 0; + *(2 * 2 + gActiveBattler * 8 + (u8 *)(gBattleStruct->lastTakenMoveFrom) + 0) = 0; + *(2 * 2 + gActiveBattler * 8 + (u8 *)(gBattleStruct->lastTakenMoveFrom) + 1) = 0; + *(3 * 2 + gActiveBattler * 8 + (u8 *)(gBattleStruct->lastTakenMoveFrom) + 0) = 0; + *(3 * 2 + gActiveBattler * 8 + (u8 *)(gBattleStruct->lastTakenMoveFrom) + 1) = 0; gBattleStruct->palaceFlags &= ~(gBitTable[gActiveBattler]); @@ -3232,12 +3232,12 @@ void SwitchInClearSetData(void) *(gBattleStruct->lastTakenMove + i * 2 + 0) = 0; *(gBattleStruct->lastTakenMove + i * 2 + 1) = 0; } - *(i * 8 + gActiveBattler * 2 + (u8*)(gBattleStruct->lastTakenMoveFrom) + 0) = 0; - *(i * 8 + gActiveBattler * 2 + (u8*)(gBattleStruct->lastTakenMoveFrom) + 1) = 0; + *(i * 8 + gActiveBattler * 2 + (u8 *)(gBattleStruct->lastTakenMoveFrom) + 0) = 0; + *(i * 8 + gActiveBattler * 2 + (u8 *)(gBattleStruct->lastTakenMoveFrom) + 1) = 0; } - *(u8*)((u8*)(&gBattleStruct->choicedMove[gActiveBattler]) + 0) = 0; - *(u8*)((u8*)(&gBattleStruct->choicedMove[gActiveBattler]) + 1) = 0; + *(u8 *)((u8 *)(&gBattleStruct->choicedMove[gActiveBattler]) + 0) = 0; + *(u8 *)((u8 *)(&gBattleStruct->choicedMove[gActiveBattler]) + 1) = 0; gBattleResources->flags->flags[gActiveBattler] = 0; gCurrentMove = 0; @@ -3275,25 +3275,25 @@ void FaintClearSetData(void) for (i = 0; i < sizeof(struct DisableStruct); i++) ptr[i] = 0; - gProtectStructs[gActiveBattler].protected = 0; - gProtectStructs[gActiveBattler].endured = 0; - gProtectStructs[gActiveBattler].noValidMoves = 0; - gProtectStructs[gActiveBattler].helpingHand = 0; - gProtectStructs[gActiveBattler].bounceMove = 0; - gProtectStructs[gActiveBattler].stealMove = 0; - gProtectStructs[gActiveBattler].flag0Unknown = 0; - gProtectStructs[gActiveBattler].prlzImmobility = 0; - gProtectStructs[gActiveBattler].confusionSelfDmg = 0; - gProtectStructs[gActiveBattler].targetNotAffected = 0; - gProtectStructs[gActiveBattler].chargingTurn = 0; + gProtectStructs[gActiveBattler].protected = FALSE; + gProtectStructs[gActiveBattler].endured = FALSE; + gProtectStructs[gActiveBattler].noValidMoves = FALSE; + gProtectStructs[gActiveBattler].helpingHand = FALSE; + gProtectStructs[gActiveBattler].bounceMove = FALSE; + gProtectStructs[gActiveBattler].stealMove = FALSE; + gProtectStructs[gActiveBattler].flag0Unknown = FALSE; + gProtectStructs[gActiveBattler].prlzImmobility = FALSE; + gProtectStructs[gActiveBattler].confusionSelfDmg = FALSE; + gProtectStructs[gActiveBattler].targetNotAffected = FALSE; + gProtectStructs[gActiveBattler].chargingTurn = FALSE; gProtectStructs[gActiveBattler].fleeType = 0; - gProtectStructs[gActiveBattler].usedImprisonedMove = 0; - gProtectStructs[gActiveBattler].loveImmobility = 0; - gProtectStructs[gActiveBattler].usedDisabledMove = 0; - gProtectStructs[gActiveBattler].usedTauntedMove = 0; - gProtectStructs[gActiveBattler].flag2Unknown = 0; - gProtectStructs[gActiveBattler].flinchImmobility = 0; - gProtectStructs[gActiveBattler].notFirstStrike = 0; + gProtectStructs[gActiveBattler].usedImprisonedMove = FALSE; + gProtectStructs[gActiveBattler].loveImmobility = FALSE; + gProtectStructs[gActiveBattler].usedDisabledMove = FALSE; + gProtectStructs[gActiveBattler].usedTauntedMove = FALSE; + gProtectStructs[gActiveBattler].flag2Unknown = FALSE; + gProtectStructs[gActiveBattler].flinchImmobility = FALSE; + gProtectStructs[gActiveBattler].notFirstStrike = FALSE; gDisableStructs[gActiveBattler].isFirstTurn = 2; @@ -3304,19 +3304,19 @@ void FaintClearSetData(void) gLastPrintedMoves[gActiveBattler] = 0; gLastHitBy[gActiveBattler] = 0xFF; - *(u8*)((u8*)(&gBattleStruct->choicedMove[gActiveBattler]) + 0) = 0; - *(u8*)((u8*)(&gBattleStruct->choicedMove[gActiveBattler]) + 1) = 0; + *(u8 *)((u8 *)(&gBattleStruct->choicedMove[gActiveBattler]) + 0) = 0; + *(u8 *)((u8 *)(&gBattleStruct->choicedMove[gActiveBattler]) + 1) = 0; *(gBattleStruct->lastTakenMove + gActiveBattler * 2 + 0) = 0; *(gBattleStruct->lastTakenMove + gActiveBattler * 2 + 1) = 0; - *(0 * 2 + gActiveBattler * 8 + (u8*)(gBattleStruct->lastTakenMoveFrom) + 0) = 0; - *(0 * 2 + gActiveBattler * 8 + (u8*)(gBattleStruct->lastTakenMoveFrom) + 1) = 0; - *(1 * 2 + gActiveBattler * 8 + (u8*)(gBattleStruct->lastTakenMoveFrom) + 0) = 0; - *(1 * 2 + gActiveBattler * 8 + (u8*)(gBattleStruct->lastTakenMoveFrom) + 1) = 0; - *(2 * 2 + gActiveBattler * 8 + (u8*)(gBattleStruct->lastTakenMoveFrom) + 0) = 0; - *(2 * 2 + gActiveBattler * 8 + (u8*)(gBattleStruct->lastTakenMoveFrom) + 1) = 0; - *(3 * 2 + gActiveBattler * 8 + (u8*)(gBattleStruct->lastTakenMoveFrom) + 0) = 0; - *(3 * 2 + gActiveBattler * 8 + (u8*)(gBattleStruct->lastTakenMoveFrom) + 1) = 0; + *(0 * 2 + gActiveBattler * 8 + (u8 *)(gBattleStruct->lastTakenMoveFrom) + 0) = 0; + *(0 * 2 + gActiveBattler * 8 + (u8 *)(gBattleStruct->lastTakenMoveFrom) + 1) = 0; + *(1 * 2 + gActiveBattler * 8 + (u8 *)(gBattleStruct->lastTakenMoveFrom) + 0) = 0; + *(1 * 2 + gActiveBattler * 8 + (u8 *)(gBattleStruct->lastTakenMoveFrom) + 1) = 0; + *(2 * 2 + gActiveBattler * 8 + (u8 *)(gBattleStruct->lastTakenMoveFrom) + 0) = 0; + *(2 * 2 + gActiveBattler * 8 + (u8 *)(gBattleStruct->lastTakenMoveFrom) + 1) = 0; + *(3 * 2 + gActiveBattler * 8 + (u8 *)(gBattleStruct->lastTakenMoveFrom) + 0) = 0; + *(3 * 2 + gActiveBattler * 8 + (u8 *)(gBattleStruct->lastTakenMoveFrom) + 1) = 0; gBattleStruct->palaceFlags &= ~(gBitTable[gActiveBattler]); @@ -3327,8 +3327,8 @@ void FaintClearSetData(void) *(gBattleStruct->lastTakenMove + i * 2 + 0) = 0; *(gBattleStruct->lastTakenMove + i * 2 + 1) = 0; } - *(i * 8 + gActiveBattler * 2 + (u8*)(gBattleStruct->lastTakenMoveFrom) + 0) = 0; - *(i * 8 + gActiveBattler * 2 + (u8*)(gBattleStruct->lastTakenMoveFrom) + 1) = 0; + *(i * 8 + gActiveBattler * 2 + (u8 *)(gBattleStruct->lastTakenMoveFrom) + 0) = 0; + *(i * 8 + gActiveBattler * 2 + (u8 *)(gBattleStruct->lastTakenMoveFrom) + 1) = 0; } gBattleResources->flags->flags[gActiveBattler] = 0; @@ -3395,7 +3395,7 @@ static void BattleIntroDrawTrainersOrMonsSprites(void) } else { - u16* hpOnSwitchout; + u16 *hpOnSwitchout; ptr = (u8 *)&gBattleMons[gActiveBattler]; for (i = 0; i < sizeof(struct BattlePokemon); i++) @@ -4055,7 +4055,7 @@ void SwitchPartyOrder(u8 battler) u8 partyId2; for (i = 0; i < (int)ARRAY_COUNT(gBattlePartyCurrentOrder); i++) - gBattlePartyCurrentOrder[i] = *(battler * 3 + i + (u8*)(gBattleStruct->battlerPartyOrders)); + gBattlePartyCurrentOrder[i] = *(battler * 3 + i + (u8 *)(gBattleStruct->battlerPartyOrders)); partyId1 = GetPartyIdFromBattlePartyId(gBattlerPartyIndexes[battler]); partyId2 = GetPartyIdFromBattlePartyId(*(gBattleStruct->monToSwitchIntoId + battler)); @@ -4065,15 +4065,15 @@ void SwitchPartyOrder(u8 battler) { for (i = 0; i < (int)ARRAY_COUNT(gBattlePartyCurrentOrder); i++) { - *(battler * 3 + i + (u8*)(gBattleStruct->battlerPartyOrders)) = gBattlePartyCurrentOrder[i]; - *(BATTLE_PARTNER(battler) * 3 + i + (u8*)(gBattleStruct->battlerPartyOrders)) = gBattlePartyCurrentOrder[i]; + *(battler * 3 + i + (u8 *)(gBattleStruct->battlerPartyOrders)) = gBattlePartyCurrentOrder[i]; + *(BATTLE_PARTNER(battler) * 3 + i + (u8 *)(gBattleStruct->battlerPartyOrders)) = gBattlePartyCurrentOrder[i]; } } else { for (i = 0; i < (int)ARRAY_COUNT(gBattlePartyCurrentOrder); i++) { - *(battler * 3 + i + (u8*)(gBattleStruct->battlerPartyOrders)) = gBattlePartyCurrentOrder[i]; + *(battler * 3 + i + (u8 *)(gBattleStruct->battlerPartyOrders)) = gBattlePartyCurrentOrder[i]; } } } @@ -4543,13 +4543,13 @@ static void UpdateBattlerPartyOrdersOnSwitch(void) if (gBattleTypeFlags & BATTLE_TYPE_LINK && gBattleTypeFlags & BATTLE_TYPE_MULTI) { - *(gActiveBattler * 3 + (u8*)(gBattleStruct->battlerPartyOrders) + 0) &= 0xF; - *(gActiveBattler * 3 + (u8*)(gBattleStruct->battlerPartyOrders) + 0) |= (gBattleBufferB[gActiveBattler][2] & 0xF0); - *(gActiveBattler * 3 + (u8*)(gBattleStruct->battlerPartyOrders) + 1) = gBattleBufferB[gActiveBattler][3]; + *(gActiveBattler * 3 + (u8 *)(gBattleStruct->battlerPartyOrders) + 0) &= 0xF; + *(gActiveBattler * 3 + (u8 *)(gBattleStruct->battlerPartyOrders) + 0) |= (gBattleBufferB[gActiveBattler][2] & 0xF0); + *(gActiveBattler * 3 + (u8 *)(gBattleStruct->battlerPartyOrders) + 1) = gBattleBufferB[gActiveBattler][3]; - *((gActiveBattler ^ BIT_FLANK) * 3 + (u8*)(gBattleStruct->battlerPartyOrders) + 0) &= (0xF0); - *((gActiveBattler ^ BIT_FLANK) * 3 + (u8*)(gBattleStruct->battlerPartyOrders) + 0) |= (gBattleBufferB[gActiveBattler][2] & 0xF0) >> 4; - *((gActiveBattler ^ BIT_FLANK) * 3 + (u8*)(gBattleStruct->battlerPartyOrders) + 2) = gBattleBufferB[gActiveBattler][3]; + *((gActiveBattler ^ BIT_FLANK) * 3 + (u8 *)(gBattleStruct->battlerPartyOrders) + 0) &= (0xF0); + *((gActiveBattler ^ BIT_FLANK) * 3 + (u8 *)(gBattleStruct->battlerPartyOrders) + 0) |= (gBattleBufferB[gActiveBattler][2] & 0xF0) >> 4; + *((gActiveBattler ^ BIT_FLANK) * 3 + (u8 *)(gBattleStruct->battlerPartyOrders) + 2) = gBattleBufferB[gActiveBattler][3]; } } @@ -4831,7 +4831,7 @@ static void TurnValuesCleanUp(bool8 var0) } else { - dataPtr = (u8*)(&gProtectStructs[gActiveBattler]); + dataPtr = (u8 *)(&gProtectStructs[gActiveBattler]); for (i = 0; i < sizeof(struct ProtectStruct); i++) dataPtr[i] = 0; @@ -4859,7 +4859,7 @@ void SpecialStatusesClear(void) for (gActiveBattler = 0; gActiveBattler < gBattlersCount; gActiveBattler++) { s32 i; - u8 *dataPtr = (u8*)(&gSpecialStatuses[gActiveBattler]); + u8 *dataPtr = (u8 *)(&gSpecialStatuses[gActiveBattler]); for (i = 0; i < sizeof(struct SpecialStatus); i++) dataPtr[i] = 0; diff --git a/src/battle_message.c b/src/battle_message.c index 2776c952b..677bb2fe3 100644 --- a/src/battle_message.c +++ b/src/battle_message.c @@ -1010,7 +1010,7 @@ const u16 gStatUpStringIds[] = [B_MSG_STAT_WONT_INCREASE] = STRINGID_STATSWONTINCREASE, [B_MSG_STAT_ROSE_EMPTY] = STRINGID_EMPTYSTRING3, [B_MSG_STAT_ROSE_ITEM] = STRINGID_USINGITEMSTATOFPKMNROSE, - [B_MSG_USED_DIRE_HIT] = STRINGID_PKMNUSEDXTOGETPUMPED, + [B_MSG_USED_DIRE_HIT] = STRINGID_PKMNUSEDXTOGETPUMPED, }; const u16 gStatDownStringIds[] = @@ -2059,7 +2059,7 @@ void BufferStringBattle(u16 stringID) s32 i; const u8 *stringPtr = NULL; - gBattleMsgDataPtr = (struct BattleMsgData*)(&gBattleBufferA[gActiveBattler][4]); + gBattleMsgDataPtr = (struct BattleMsgData *)(&gBattleBufferA[gActiveBattler][4]); gLastUsedItem = gBattleMsgDataPtr->lastItem; gLastUsedAbility = gBattleMsgDataPtr->lastAbility; gBattleScripting.battler = gBattleMsgDataPtr->scrActive; @@ -2346,17 +2346,17 @@ void BufferStringBattle(u16 stringID) BattleStringExpandPlaceholdersToDisplayedString(stringPtr); } -u32 BattleStringExpandPlaceholdersToDisplayedString(const u8* src) +u32 BattleStringExpandPlaceholdersToDisplayedString(const u8 *src) { BattleStringExpandPlaceholders(src, gDisplayedStringBattle); } -static const u8* TryGetStatusString(u8 *src) +static const u8 *TryGetStatusString(u8 *src) { u32 i; u8 status[8]; u32 chars1, chars2; - u8* statusPtr; + u8 *statusPtr; memcpy(status, sDummyWeirdStatusString, 8); @@ -2369,13 +2369,13 @@ static const u8* TryGetStatusString(u8 *src) statusPtr++; } - chars1 = *(u32*)(&status[0]); - chars2 = *(u32*)(&status[4]); + chars1 = *(u32 *)(&status[0]); + chars2 = *(u32 *)(&status[4]); for (i = 0; i < ARRAY_COUNT(gStatusConditionStringsTable); i++) { - if (chars1 == *(u32*)(&gStatusConditionStringsTable[i][0][0]) - && chars2 == *(u32*)(&gStatusConditionStringsTable[i][0][4])) + if (chars1 == *(u32 *)(&gStatusConditionStringsTable[i][0][0]) + && chars2 == *(u32 *)(&gStatusConditionStringsTable[i][0][4])) return gStatusConditionStringsTable[i][1]; } return NULL; @@ -2966,7 +2966,7 @@ static void ExpandBattleTextBuffPlaceholders(const u8 *src, u8 *dst) // unused, since the value loaded into the buffer is not read; it loaded one of // two particles (either "は" or "の") which works in tandem with ChooseTypeOfMoveUsedString // below to effect changes in the meaning of the line. -static void ChooseMoveUsedParticle(u8* textBuff) +static void ChooseMoveUsedParticle(u8 *textBuff) { s32 counter = 0; u32 i = 0; @@ -3006,7 +3006,7 @@ static void ChooseMoveUsedParticle(u8* textBuff) // // sText_ExclamationMark5 was " こうげき!" This resulted in a translation of // "'s attack!". -static void ChooseTypeOfMoveUsedString(u8* dst) +static void ChooseTypeOfMoveUsedString(u8 *dst) { s32 counter = 0; s32 i = 0; @@ -3119,7 +3119,7 @@ void BattlePutTextOnWindow(const u8 *text, u8 windowId) void SetPpNumbersPaletteInMoveSelection(void) { - struct ChooseMoveStruct *chooseMoveStruct = (struct ChooseMoveStruct*)(&gBattleBufferA[gActiveBattler][4]); + struct ChooseMoveStruct *chooseMoveStruct = (struct ChooseMoveStruct *)(&gBattleBufferA[gActiveBattler][4]); const u16 *palPtr = gPPTextPalette; u8 var = GetCurrentPpToMaxPpState(chooseMoveStruct->currentPp[gMoveSelectionCursor[gActiveBattler]], chooseMoveStruct->maxPp[gMoveSelectionCursor[gActiveBattler]]); diff --git a/src/battle_records.c b/src/battle_records.c index f576d5912..6cab28d21 100644 --- a/src/battle_records.c +++ b/src/battle_records.c @@ -388,7 +388,7 @@ static void RemoveTrainerHillRecordsWindow(u8 windowId) static void ClearVramOamPlttRegs(void) { - DmaClearLarge16(3, (void*)(VRAM), VRAM_SIZE, 0x1000); + DmaClearLarge16(3, (void *)(VRAM), VRAM_SIZE, 0x1000); DmaClear32(3, OAM, OAM_SIZE); DmaClear16(3, PLTT, PLTT_SIZE); diff --git a/src/battle_script_commands.c b/src/battle_script_commands.c index 5f0ecad68..575b9c987 100644 --- a/src/battle_script_commands.c +++ b/src/battle_script_commands.c @@ -52,7 +52,7 @@ #include "constants/songs.h" #include "constants/trainers.h" -extern const u8* const gBattleScriptsForMoveEffects[]; +extern const u8 *const gBattleScriptsForMoveEffects[]; #define DEFENDER_IS_PROTECTED ((gProtectStructs[gBattlerTarget].protected) && (gBattleMoves[gCurrentMove].flags & FLAG_PROTECT_AFFECTED)) @@ -65,7 +65,7 @@ static bool8 IsTwoTurnsMove(u16 move); static void TrySetDestinyBondToHappen(void); static u8 AttacksThisTurn(u8 battlerId, u16 move); // Note: returns 1 if it's a charging turn, otherwise 2. static void CheckWonderGuardAndLevitate(void); -static u8 ChangeStatBuffs(s8 statValue, u8 statId, u8, const u8* BS_ptr); +static u8 ChangeStatBuffs(s8 statValue, u8 statId, u8, const u8 *BS_ptr); static bool32 IsMonGettingExpSentOut(void); static void InitLevelUpBanner(void); static bool8 SlideInLevelUpBanner(void); @@ -74,7 +74,7 @@ static void DrawLevelUpWindow1(void); static void DrawLevelUpWindow2(void); static void PutMonIconOnLvlUpBanner(void); static void DrawLevelUpBannerText(void); -static void SpriteCB_MonIconOnLvlUpBanner(struct Sprite* sprite); +static void SpriteCB_MonIconOnLvlUpBanner(struct Sprite *sprite); static void Cmd_attackcanceler(void); static void Cmd_accuracycheck(void); @@ -624,7 +624,7 @@ static const u32 sStatusFlagsForMoveEffects[NUM_MOVE_EFFECTS] = [MOVE_EFFECT_THRASH] = STATUS2_LOCK_CONFUSE, }; -static const u8* const sMoveEffectBS_Ptrs[] = +static const u8 *const sMoveEffectBS_Ptrs[] = { [0] = BattleScript_MoveEffectSleep, [MOVE_EFFECT_SLEEP] = BattleScript_MoveEffectSleep, @@ -667,7 +667,8 @@ static const u8* const sMoveEffectBS_Ptrs[] = [MOVE_EFFECT_RECOIL_33] = BattleScript_MoveEffectRecoil, }; -static const struct WindowTemplate sUnusedWinTemplate = { +static const struct WindowTemplate sUnusedWinTemplate = +{ .bg = 0, .tilemapLeft = 1, .tilemapTop = 3, @@ -961,7 +962,7 @@ static void Cmd_attackcanceler(void) if (gProtectStructs[gBattlerTarget].bounceMove && gBattleMoves[gCurrentMove].flags & FLAG_MAGIC_COAT_AFFECTED) { PressurePPLose(gBattlerAttacker, gBattlerTarget, MOVE_MAGIC_COAT); - gProtectStructs[gBattlerTarget].bounceMove = 0; + gProtectStructs[gBattlerTarget].bounceMove = FALSE; BattleScriptPushCursor(); gBattlescriptCurrInstr = BattleScript_MagicCoatBounce; return; @@ -972,7 +973,7 @@ static void Cmd_attackcanceler(void) if ((gProtectStructs[gBattlerByTurnOrder[i]].stealMove) && gBattleMoves[gCurrentMove].flags & FLAG_SNATCH_AFFECTED) { PressurePPLose(gBattlerAttacker, gBattlerByTurnOrder[i], MOVE_SNATCH); - gProtectStructs[gBattlerByTurnOrder[i]].stealMove = 0; + gProtectStructs[gBattlerByTurnOrder[i]].stealMove = FALSE; gBattleScripting.battler = gBattlerByTurnOrder[i]; BattleScriptPushCursor(); gBattlescriptCurrInstr = BattleScript_SnatchedMove; @@ -982,7 +983,7 @@ static void Cmd_attackcanceler(void) if (gSpecialStatuses[gBattlerTarget].lightningRodRedirected) { - gSpecialStatuses[gBattlerTarget].lightningRodRedirected = 0; + gSpecialStatuses[gBattlerTarget].lightningRodRedirected = FALSE; gLastUsedAbility = ABILITY_LIGHTNING_ROD; BattleScriptPushCursor(); gBattlescriptCurrInstr = BattleScript_TookAttack; @@ -1175,8 +1176,8 @@ static void Cmd_accuracycheck(void) if ((Random() % 100 + 1) > calc) { gMoveResultFlags |= MOVE_RESULT_MISSED; - if (gBattleTypeFlags & BATTLE_TYPE_DOUBLE && - (gBattleMoves[move].target == MOVE_TARGET_BOTH || gBattleMoves[move].target == MOVE_TARGET_FOES_AND_ALLY)) + if (gBattleTypeFlags & BATTLE_TYPE_DOUBLE + && (gBattleMoves[move].target == MOVE_TARGET_BOTH || gBattleMoves[move].target == MOVE_TARGET_FOES_AND_ALLY)) gBattleCommunication[MISS_TYPE] = B_MSG_AVOIDED_ATK; else gBattleCommunication[MISS_TYPE] = B_MSG_MISSED; @@ -1190,7 +1191,8 @@ static void Cmd_accuracycheck(void) static void Cmd_attackstring(void) { if (gBattleControllerExecFlags) - return; + return; + if (!(gHitMarker & (HITMARKER_NO_ATTACKSTRING | HITMARKER_ATTACKSTRING_PRINTED))) { PrepareStringBattle(STRINGID_USEDMOVE, gBattlerAttacker); @@ -1496,7 +1498,8 @@ static void CheckWonderGuardAndLevitate(void) } } -static void ModulateDmgByType2(u8 multiplier, u16 move, u8* flags) // same as ModulateDmgByType except different arguments +// Same as ModulateDmgByType except different arguments +static void ModulateDmgByType2(u8 multiplier, u16 move, u8 *flags) { gBattleMoveDamage = gBattleMoveDamage * multiplier / 10; if (gBattleMoveDamage == 0 && multiplier != 0) @@ -1694,7 +1697,8 @@ static void Cmd_adjustnormaldamage(void) gBattlescriptCurrInstr++; } -static void Cmd_adjustnormaldamage2(void) // The same as adjustnormaldamage except it doesn't check for false swipe move effect. +// The same as adjustnormaldamage except it doesn't check for false swipe move effect. +static void Cmd_adjustnormaldamage2(void) { u8 holdEffect, param; @@ -1751,8 +1755,8 @@ static void Cmd_attackanimation(void) else { if ((gBattleMoves[gCurrentMove].target & MOVE_TARGET_BOTH - || gBattleMoves[gCurrentMove].target & MOVE_TARGET_FOES_AND_ALLY - || gBattleMoves[gCurrentMove].target & MOVE_TARGET_DEPENDS) + || gBattleMoves[gCurrentMove].target & MOVE_TARGET_FOES_AND_ALLY + || gBattleMoves[gCurrentMove].target & MOVE_TARGET_DEPENDS) && gBattleScripting.animTargetsHit) { gBattlescriptCurrInstr++; @@ -1777,8 +1781,8 @@ static void Cmd_attackanimation(void) multihit = gMultiHitCounter; BtlController_EmitMoveAnimation(BUFFER_A, gCurrentMove, gBattleScripting.animTurn, gBattleMovePower, gBattleMoveDamage, gBattleMons[gBattlerAttacker].friendship, &gDisableStructs[gBattlerAttacker], multihit); - gBattleScripting.animTurn += 1; - gBattleScripting.animTargetsHit += 1; + gBattleScripting.animTurn++; + gBattleScripting.animTargetsHit++; MarkBattlerForControllerExec(gBattlerAttacker); gBattlescriptCurrInstr++; } @@ -2154,7 +2158,7 @@ static void Cmd_printfromtable(void) { if (gBattleControllerExecFlags == 0) { - const u16 *ptr = (const u16*) T1_READ_PTR(gBattlescriptCurrInstr + 1); + const u16 *ptr = (const u16 *) T1_READ_PTR(gBattlescriptCurrInstr + 1); ptr += gBattleCommunication[MULTISTRING_CHOOSER]; PrepareStringBattle(*ptr, gBattlerAttacker); @@ -2168,7 +2172,7 @@ static void Cmd_printselectionstringfromtable(void) { if (gBattleControllerExecFlags == 0) { - const u16 *ptr = (const u16*) T1_READ_PTR(gBattlescriptCurrInstr + 1); + const u16 *ptr = (const u16 *) T1_READ_PTR(gBattlescriptCurrInstr + 1); ptr += gBattleCommunication[MULTISTRING_CHOOSER]; gActiveBattler = gBattlerAttacker; @@ -2474,7 +2478,7 @@ void SetMoveEffect(bool8 primary, u8 certain) || gBattleCommunication[MOVE_EFFECT_BYTE] == MOVE_EFFECT_PARALYSIS || gBattleCommunication[MOVE_EFFECT_BYTE] == MOVE_EFFECT_BURN) { - u8* synchronizeEffect = &gBattleStruct->synchronizeMoveEffect; + u8 *synchronizeEffect = &gBattleStruct->synchronizeMoveEffect; *synchronizeEffect = gBattleCommunication[MOVE_EFFECT_BYTE]; gHitMarker |= HITMARKER_SYNCHRONISE_EFFECT; } @@ -2537,7 +2541,6 @@ void SetMoveEffect(bool8 primary, u8 certain) case MOVE_EFFECT_UPROAR: if (!(gBattleMons[gEffectBattler].status2 & STATUS2_UPROAR)) { - gBattleMons[gEffectBattler].status2 |= STATUS2_MULTIPLETURNS; gLockedMoves[gEffectBattler] = gCurrentMove; gBattleMons[gEffectBattler].status2 |= STATUS2_UPROAR_TURN((Random() & 3) + 2); // 2-5 turns @@ -2641,7 +2644,7 @@ void SetMoveEffect(bool8 primary, u8 certain) case MOVE_EFFECT_EVS_MINUS_1: if (ChangeStatBuffs(SET_STAT_BUFF_VALUE(1) | STAT_BUFF_NEGATIVE, gBattleCommunication[MOVE_EFFECT_BYTE] - MOVE_EFFECT_ATK_MINUS_1 + 1, - affectsUser, 0)) + affectsUser, 0)) { gBattlescriptCurrInstr++; } @@ -2716,20 +2719,20 @@ void SetMoveEffect(bool8 primary, u8 certain) side = GetBattlerSide(gBattlerAttacker); if (GetBattlerSide(gBattlerAttacker) == B_SIDE_OPPONENT && !(gBattleTypeFlags & - (BATTLE_TYPE_EREADER_TRAINER - | BATTLE_TYPE_FRONTIER - | BATTLE_TYPE_LINK - | BATTLE_TYPE_RECORDED_LINK - | BATTLE_TYPE_SECRET_BASE))) + (BATTLE_TYPE_EREADER_TRAINER + | BATTLE_TYPE_FRONTIER + | BATTLE_TYPE_LINK + | BATTLE_TYPE_RECORDED_LINK + | BATTLE_TYPE_SECRET_BASE))) { gBattlescriptCurrInstr++; } else if (!(gBattleTypeFlags & - (BATTLE_TYPE_EREADER_TRAINER - | BATTLE_TYPE_FRONTIER - | BATTLE_TYPE_LINK - | BATTLE_TYPE_RECORDED_LINK - | BATTLE_TYPE_SECRET_BASE)) + (BATTLE_TYPE_EREADER_TRAINER + | BATTLE_TYPE_FRONTIER + | BATTLE_TYPE_LINK + | BATTLE_TYPE_RECORDED_LINK + | BATTLE_TYPE_SECRET_BASE)) && (gWishFutureKnock.knockedOffMons[side] & gBitTable[gBattlerPartyIndexes[gBattlerAttacker]])) { gBattlescriptCurrInstr++; @@ -2752,9 +2755,9 @@ void SetMoveEffect(bool8 primary, u8 certain) } else { - u16* changedItem = &gBattleStruct->changedItems[gBattlerAttacker]; + u16 *changedItem = &gBattleStruct->changedItems[gBattlerAttacker]; gLastUsedItem = *changedItem = gBattleMons[gBattlerTarget].item; - gBattleMons[gBattlerTarget].item = 0; + gBattleMons[gBattlerTarget].item = ITEM_NONE; gActiveBattler = gBattlerAttacker; BtlController_EmitSetMonData(BUFFER_A, REQUEST_HELDITEM_BATTLE, 0, sizeof(gLastUsedItem), &gLastUsedItem); @@ -2767,10 +2770,9 @@ void SetMoveEffect(bool8 primary, u8 certain) BattleScriptPush(gBattlescriptCurrInstr + 1); gBattlescriptCurrInstr = BattleScript_ItemSteal; - *(u8*)((u8*)(&gBattleStruct->choicedMove[gBattlerTarget]) + 0) = 0; - *(u8*)((u8*)(&gBattleStruct->choicedMove[gBattlerTarget]) + 1) = 0; + *(u8 *)((u8 *)(&gBattleStruct->choicedMove[gBattlerTarget]) + 0) = 0; + *(u8 *)((u8 *)(&gBattleStruct->choicedMove[gBattlerTarget]) + 1) = 0; } - } break; case MOVE_EFFECT_PREVENT_ESCAPE: @@ -2834,7 +2836,7 @@ void SetMoveEffect(bool8 primary, u8 certain) case MOVE_EFFECT_KNOCK_OFF: if (gBattleMons[gEffectBattler].ability == ABILITY_STICKY_HOLD) { - if (gBattleMons[gEffectBattler].item == 0) + if (gBattleMons[gEffectBattler].item == ITEM_NONE) { gBattlescriptCurrInstr++; } @@ -2851,14 +2853,14 @@ void SetMoveEffect(bool8 primary, u8 certain) side = GetBattlerSide(gEffectBattler); gLastUsedItem = gBattleMons[gEffectBattler].item; - gBattleMons[gEffectBattler].item = 0; + gBattleMons[gEffectBattler].item = ITEM_NONE; gWishFutureKnock.knockedOffMons[side] |= gBitTable[gBattlerPartyIndexes[gEffectBattler]]; BattleScriptPush(gBattlescriptCurrInstr + 1); gBattlescriptCurrInstr = BattleScript_KnockedOff; - *(u8*)((u8*)(&gBattleStruct->choicedMove[gEffectBattler]) + 0) = 0; - *(u8*)((u8*)(&gBattleStruct->choicedMove[gEffectBattler]) + 1) = 0; + *(u8 *)((u8 *)(&gBattleStruct->choicedMove[gEffectBattler]) + 0) = 0; + *(u8 *)((u8 *)(&gBattleStruct->choicedMove[gEffectBattler]) + 1) = 0; } else { @@ -3053,9 +3055,9 @@ static void Cmd_jumpifstatus(void) { u8 battlerId = GetBattlerForBattleScript(gBattlescriptCurrInstr[1]); u32 flags = T2_READ_32(gBattlescriptCurrInstr + 2); - const u8* jumpPtr = T2_READ_PTR(gBattlescriptCurrInstr + 6); + const u8 *jumpPtr = T2_READ_PTR(gBattlescriptCurrInstr + 6); - if (gBattleMons[battlerId].status1 & flags && gBattleMons[battlerId].hp) + if (gBattleMons[battlerId].status1 & flags && gBattleMons[battlerId].hp != 0) gBattlescriptCurrInstr = jumpPtr; else gBattlescriptCurrInstr += 10; @@ -3065,9 +3067,9 @@ static void Cmd_jumpifstatus2(void) { u8 battlerId = GetBattlerForBattleScript(gBattlescriptCurrInstr[1]); u32 flags = T2_READ_32(gBattlescriptCurrInstr + 2); - const u8* jumpPtr = T2_READ_PTR(gBattlescriptCurrInstr + 6); + const u8 *jumpPtr = T2_READ_PTR(gBattlescriptCurrInstr + 6); - if (gBattleMons[battlerId].status2 & flags && gBattleMons[battlerId].hp) + if (gBattleMons[battlerId].status2 & flags && gBattleMons[battlerId].hp != 0) gBattlescriptCurrInstr = jumpPtr; else gBattlescriptCurrInstr += 10; @@ -3077,7 +3079,7 @@ static void Cmd_jumpifability(void) { u8 battlerId; u8 ability = gBattlescriptCurrInstr[2]; - const u8* jumpPtr = T2_READ_PTR(gBattlescriptCurrInstr + 3); + const u8 *jumpPtr = T2_READ_PTR(gBattlescriptCurrInstr + 3); if (gBattlescriptCurrInstr[1] == BS_ATTACKER_SIDE) { @@ -3124,7 +3126,7 @@ static void Cmd_jumpifsideaffecting(void) { u8 side; u16 flags; - const u8* jumpPtr; + const u8 *jumpPtr; if (gBattlescriptCurrInstr[1] == BS_ATTACKER) side = GET_BATTLER_SIDE(gBattlerAttacker); @@ -3209,7 +3211,7 @@ static void Cmd_jumpiftype(void) { u8 battlerId = GetBattlerForBattleScript(gBattlescriptCurrInstr[1]); u8 type = gBattlescriptCurrInstr[2]; - const u8* jumpPtr = T2_READ_PTR(gBattlescriptCurrInstr + 3); + const u8 *jumpPtr = T2_READ_PTR(gBattlescriptCurrInstr + 3); if (IS_BATTLER_OF_TYPE(battlerId, type)) gBattlescriptCurrInstr = jumpPtr; @@ -3322,7 +3324,7 @@ static void Cmd_getexp(void) else { // music change in wild battle after fainting a poke - if (!(gBattleTypeFlags & BATTLE_TYPE_TRAINER) && gBattleMons[0].hp && !gBattleStruct->wildVictorySong) + if (!(gBattleTypeFlags & BATTLE_TYPE_TRAINER) && gBattleMons[0].hp != 0 && !gBattleStruct->wildVictorySong) { BattleStopLowHpSound(); PlayBGM(MUS_VICTORY_WILD); @@ -3488,8 +3490,8 @@ static void Cmd_getexp(void) if (gBattleControllerExecFlags == 0) { // not sure why gf clears the item and ability here - gBattleMons[gBattlerFainted].item = 0; - gBattleMons[gBattlerFainted].ability = 0; + gBattleMons[gBattlerFainted].item = ITEM_NONE; + gBattleMons[gBattlerFainted].ability = ABILITY_NONE; gBattlescriptCurrInstr += 2; } break; @@ -3625,9 +3627,9 @@ static void Cmd_goto(void) static void Cmd_jumpifbyte(void) { u8 caseID = gBattlescriptCurrInstr[1]; - const u8* memByte = T2_READ_PTR(gBattlescriptCurrInstr + 2); + const u8 *memByte = T2_READ_PTR(gBattlescriptCurrInstr + 2); u8 value = gBattlescriptCurrInstr[6]; - const u8* jumpPtr = T2_READ_PTR(gBattlescriptCurrInstr + 7); + const u8 *jumpPtr = T2_READ_PTR(gBattlescriptCurrInstr + 7); gBattlescriptCurrInstr += 11; @@ -3663,9 +3665,9 @@ static void Cmd_jumpifbyte(void) static void Cmd_jumpifhalfword(void) { u8 caseID = gBattlescriptCurrInstr[1]; - const u16* memHword = T2_READ_PTR(gBattlescriptCurrInstr + 2); + const u16 *memHword = T2_READ_PTR(gBattlescriptCurrInstr + 2); u16 value = T2_READ_16(gBattlescriptCurrInstr + 6); - const u8* jumpPtr = T2_READ_PTR(gBattlescriptCurrInstr + 8); + const u8 *jumpPtr = T2_READ_PTR(gBattlescriptCurrInstr + 8); gBattlescriptCurrInstr += 12; @@ -3701,9 +3703,9 @@ static void Cmd_jumpifhalfword(void) static void Cmd_jumpifword(void) { u8 caseID = gBattlescriptCurrInstr[1]; - const u32* memWord = T2_READ_PTR(gBattlescriptCurrInstr + 2); + const u32 *memWord = T2_READ_PTR(gBattlescriptCurrInstr + 2); u32 value = T1_READ_32(gBattlescriptCurrInstr + 6); - const u8* jumpPtr = T2_READ_PTR(gBattlescriptCurrInstr + 10); + const u8 *jumpPtr = T2_READ_PTR(gBattlescriptCurrInstr + 10); gBattlescriptCurrInstr += 14; @@ -3738,10 +3740,10 @@ static void Cmd_jumpifword(void) static void Cmd_jumpifarrayequal(void) { - const u8* mem1 = T2_READ_PTR(gBattlescriptCurrInstr + 1); - const u8* mem2 = T2_READ_PTR(gBattlescriptCurrInstr + 5); + const u8 *mem1 = T2_READ_PTR(gBattlescriptCurrInstr + 1); + const u8 *mem2 = T2_READ_PTR(gBattlescriptCurrInstr + 5); u32 size = gBattlescriptCurrInstr[9]; - const u8* jumpPtr = T2_READ_PTR(gBattlescriptCurrInstr + 10); + const u8 *jumpPtr = T2_READ_PTR(gBattlescriptCurrInstr + 10); u8 i; for (i = 0; i < size; i++) @@ -3761,10 +3763,10 @@ static void Cmd_jumpifarrayequal(void) static void Cmd_jumpifarraynotequal(void) { u8 equalBytes = 0; - const u8* mem1 = T2_READ_PTR(gBattlescriptCurrInstr + 1); - const u8* mem2 = T2_READ_PTR(gBattlescriptCurrInstr + 5); + const u8 *mem1 = T2_READ_PTR(gBattlescriptCurrInstr + 1); + const u8 *mem2 = T2_READ_PTR(gBattlescriptCurrInstr + 5); u32 size = gBattlescriptCurrInstr[9]; - const u8* jumpPtr = T2_READ_PTR(gBattlescriptCurrInstr + 10); + const u8 *jumpPtr = T2_READ_PTR(gBattlescriptCurrInstr + 10); u8 i; for (i = 0; i < size; i++) @@ -3782,7 +3784,7 @@ static void Cmd_jumpifarraynotequal(void) static void Cmd_setbyte(void) { - u8* memByte = T2_READ_PTR(gBattlescriptCurrInstr + 1); + u8 *memByte = T2_READ_PTR(gBattlescriptCurrInstr + 1); *memByte = gBattlescriptCurrInstr[5]; gBattlescriptCurrInstr += 6; @@ -3790,22 +3792,22 @@ static void Cmd_setbyte(void) static void Cmd_addbyte(void) { - u8* memByte = T2_READ_PTR(gBattlescriptCurrInstr + 1); + u8 *memByte = T2_READ_PTR(gBattlescriptCurrInstr + 1); *memByte += gBattlescriptCurrInstr[5]; gBattlescriptCurrInstr += 6; } static void Cmd_subbyte(void) { - u8* memByte = T2_READ_PTR(gBattlescriptCurrInstr + 1); + u8 *memByte = T2_READ_PTR(gBattlescriptCurrInstr + 1); *memByte -= gBattlescriptCurrInstr[5]; gBattlescriptCurrInstr += 6; } static void Cmd_copyarray(void) { - u8* dest = T2_READ_PTR(gBattlescriptCurrInstr + 1); - const u8* src = T2_READ_PTR(gBattlescriptCurrInstr + 5); + u8 *dest = T2_READ_PTR(gBattlescriptCurrInstr + 1); + const u8 *src = T2_READ_PTR(gBattlescriptCurrInstr + 5); s32 size = gBattlescriptCurrInstr[9]; s32 i; @@ -3817,9 +3819,9 @@ static void Cmd_copyarray(void) static void Cmd_copyarraywithindex(void) { - u8* dest = T2_READ_PTR(gBattlescriptCurrInstr + 1); - const u8* src = T2_READ_PTR(gBattlescriptCurrInstr + 5); - const u8* index = T2_READ_PTR(gBattlescriptCurrInstr + 9); + u8 *dest = T2_READ_PTR(gBattlescriptCurrInstr + 1); + const u8 *src = T2_READ_PTR(gBattlescriptCurrInstr + 5); + const u8 *index = T2_READ_PTR(gBattlescriptCurrInstr + 9); s32 size = gBattlescriptCurrInstr[13]; s32 i; @@ -3831,14 +3833,14 @@ static void Cmd_copyarraywithindex(void) static void Cmd_orbyte(void) { - u8* memByte = T2_READ_PTR(gBattlescriptCurrInstr + 1); + u8 *memByte = T2_READ_PTR(gBattlescriptCurrInstr + 1); *memByte |= gBattlescriptCurrInstr[5]; gBattlescriptCurrInstr += 6; } static void Cmd_orhalfword(void) { - u16* memHword = T2_READ_PTR(gBattlescriptCurrInstr + 1); + u16 *memHword = T2_READ_PTR(gBattlescriptCurrInstr + 1); u16 val = T2_READ_16(gBattlescriptCurrInstr + 5); *memHword |= val; @@ -3847,7 +3849,7 @@ static void Cmd_orhalfword(void) static void Cmd_orword(void) { - u32* memWord = T2_READ_PTR(gBattlescriptCurrInstr + 1); + u32 *memWord = T2_READ_PTR(gBattlescriptCurrInstr + 1); u32 val = T2_READ_32(gBattlescriptCurrInstr + 5); *memWord |= val; @@ -3856,14 +3858,14 @@ static void Cmd_orword(void) static void Cmd_bicbyte(void) { - u8* memByte = T2_READ_PTR(gBattlescriptCurrInstr + 1); + u8 *memByte = T2_READ_PTR(gBattlescriptCurrInstr + 1); *memByte &= ~(gBattlescriptCurrInstr[5]); gBattlescriptCurrInstr += 6; } static void Cmd_bichalfword(void) { - u16* memHword = T2_READ_PTR(gBattlescriptCurrInstr + 1); + u16 *memHword = T2_READ_PTR(gBattlescriptCurrInstr + 1); u16 val = T2_READ_16(gBattlescriptCurrInstr + 5); *memHword &= ~val; @@ -3872,7 +3874,7 @@ static void Cmd_bichalfword(void) static void Cmd_bicword(void) { - u32* memWord = T2_READ_PTR(gBattlescriptCurrInstr + 1); + u32 *memWord = T2_READ_PTR(gBattlescriptCurrInstr + 1); u32 val = T2_READ_32(gBattlescriptCurrInstr + 5); *memWord &= ~val; @@ -3931,7 +3933,8 @@ static void Cmd_end2(void) gCurrentActionFuncId = B_ACTION_TRY_FINISH; } -static void Cmd_end3(void) // pops the main function stack +// Pops the main function stack +static void Cmd_end3(void) { BattleScriptPop(); if (gBattleResources->battleCallbackStack->size != 0) @@ -3970,7 +3973,7 @@ static void Cmd_endselectionscript(void) static void Cmd_playanimation(void) { - const u16* argumentPtr; + const u16 *argumentPtr; gActiveBattler = GetBattlerForBattleScript(gBattlescriptCurrInstr[1]); argumentPtr = T2_READ_PTR(gBattlescriptCurrInstr + 3); @@ -4012,8 +4015,8 @@ static void Cmd_playanimation(void) // Same as playanimation, except it takes a pointer to some animation id, instead of taking the value directly static void Cmd_playanimation_var(void) { - const u16* argumentPtr; - const u8* animationIdPtr; + const u16 *argumentPtr; + const u8 *animationIdPtr; gActiveBattler = GetBattlerForBattleScript(gBattlescriptCurrInstr[1]); animationIdPtr = T2_READ_PTR(gBattlescriptCurrInstr + 2); @@ -4244,7 +4247,7 @@ static void Cmd_moveend(void) effect = TRUE; gBattleScripting.moveendState++; break; - case MOVEEND_ON_DAMAGE_ABILITIES: // Contact abilities and Color Change + case MOVEEND_ON_DAMAGE_ABILITIES: // Such as abilities activating on contact (Effect Spore, Rough Skin, etc.). if (AbilityBattleEffects(ABILITYEFFECT_ON_DAMAGE, gBattlerTarget, 0, 0, 0)) effect = TRUE; gBattleScripting.moveendState++; @@ -4268,24 +4271,24 @@ static void Cmd_moveend(void) { if (gChosenMove == MOVE_BATON_PASS && !(gMoveResultFlags & MOVE_RESULT_FAILED)) { - ++gBattleScripting.moveendState; + gBattleScripting.moveendState++; break; } *choicedMoveAtk = gChosenMove; } - for (i = 0; i < MAX_MON_MOVES; ++i) + for (i = 0; i < MAX_MON_MOVES; i++) { if (gBattleMons[gBattlerAttacker].moves[i] == *choicedMoveAtk) break; } if (i == MAX_MON_MOVES) *choicedMoveAtk = MOVE_NONE; - ++gBattleScripting.moveendState; + gBattleScripting.moveendState++; break; case MOVEEND_CHANGED_ITEMS: // changed held items for (i = 0; i < gBattlersCount; i++) { - u16* changedItem = &gBattleStruct->changedItems[i]; + u16 *changedItem = &gBattleStruct->changedItems[i]; if (*changedItem != ITEM_NONE) { gBattleMons[i].item = *changedItem; @@ -4418,11 +4421,11 @@ static void Cmd_moveend(void) target = gBattlerTarget; attacker = gBattlerAttacker; - *(attacker * 2 + target * 8 + (u8*)(gBattleStruct->lastTakenMoveFrom) + 0) = gChosenMove; + *(attacker * 2 + target * 8 + (u8 *)(gBattleStruct->lastTakenMoveFrom) + 0) = gChosenMove; target = gBattlerTarget; attacker = gBattlerAttacker; - *(attacker * 2 + target * 8 + (u8*)(gBattleStruct->lastTakenMoveFrom) + 1) = gChosenMove >> 8; + *(attacker * 2 + target * 8 + (u8 *)(gBattleStruct->lastTakenMoveFrom) + 1) = gChosenMove >> 8; } gBattleScripting.moveendState++; break; @@ -4596,7 +4599,7 @@ static void Cmd_switchindataupdate(void) gActiveBattler = GetBattlerForBattleScript(gBattlescriptCurrInstr[1]); oldData = gBattleMons[gActiveBattler]; - monData = (u8*)(&gBattleMons[gActiveBattler]); + monData = (u8 *)(&gBattleMons[gActiveBattler]); for (i = 0; i < sizeof(struct BattlePokemon); i++) monData[i] = gBattleBufferB[gActiveBattler][4 + i]; @@ -4609,7 +4612,7 @@ static void Cmd_switchindataupdate(void) i = GetBattlerSide(gActiveBattler); if (gWishFutureKnock.knockedOffMons[i] & gBitTable[gBattlerPartyIndexes[gActiveBattler]]) { - gBattleMons[gActiveBattler].item = 0; + gBattleMons[gActiveBattler].item = ITEM_NONE; } if (gBattleMoves[gCurrentMove].effect == EFFECT_BATON_PASS) @@ -4651,7 +4654,7 @@ static void Cmd_switchinanim(void) | BATTLE_TYPE_RECORDED_LINK | BATTLE_TYPE_TRAINER_HILL | BATTLE_TYPE_FRONTIER))) - HandleSetPokedexFlag(SpeciesToNationalPokedexNum(gBattleMons[gActiveBattler].species), FLAG_SET_SEEN, gBattleMons[gActiveBattler].personality); + HandleSetPokedexFlag(SpeciesToNationalPokedexNum(gBattleMons[gActiveBattler].species), FLAG_SET_SEEN, gBattleMons[gActiveBattler].personality); gAbsentBattlerFlags &= ~(gBitTable[gActiveBattler]); @@ -5157,13 +5160,13 @@ static void Cmd_switchhandleorder(void) if (gBattleTypeFlags & BATTLE_TYPE_LINK && gBattleTypeFlags & BATTLE_TYPE_MULTI) { - *(gActiveBattler * 3 + (u8*)(gBattleStruct->battlerPartyOrders) + 0) &= 0xF; - *(gActiveBattler * 3 + (u8*)(gBattleStruct->battlerPartyOrders) + 0) |= (gBattleBufferB[gActiveBattler][2] & 0xF0); - *(gActiveBattler * 3 + (u8*)(gBattleStruct->battlerPartyOrders) + 1) = gBattleBufferB[gActiveBattler][3]; + *(gActiveBattler * 3 + (u8 *)(gBattleStruct->battlerPartyOrders) + 0) &= 0xF; + *(gActiveBattler * 3 + (u8 *)(gBattleStruct->battlerPartyOrders) + 0) |= (gBattleBufferB[gActiveBattler][2] & 0xF0); + *(gActiveBattler * 3 + (u8 *)(gBattleStruct->battlerPartyOrders) + 1) = gBattleBufferB[gActiveBattler][3]; - *((gActiveBattler ^ BIT_FLANK) * 3 + (u8*)(gBattleStruct->battlerPartyOrders) + 0) &= (0xF0); - *((gActiveBattler ^ BIT_FLANK) * 3 + (u8*)(gBattleStruct->battlerPartyOrders) + 0) |= (gBattleBufferB[gActiveBattler][2] & 0xF0) >> 4; - *((gActiveBattler ^ BIT_FLANK) * 3 + (u8*)(gBattleStruct->battlerPartyOrders) + 2) = gBattleBufferB[gActiveBattler][3]; + *((gActiveBattler ^ BIT_FLANK) * 3 + (u8 *)(gBattleStruct->battlerPartyOrders) + 0) &= (0xF0); + *((gActiveBattler ^ BIT_FLANK) * 3 + (u8 *)(gBattleStruct->battlerPartyOrders) + 0) |= (gBattleBufferB[gActiveBattler][2] & 0xF0) >> 4; + *((gActiveBattler ^ BIT_FLANK) * 3 + (u8 *)(gBattleStruct->battlerPartyOrders) + 2) = gBattleBufferB[gActiveBattler][3]; } else if (gBattleTypeFlags & BATTLE_TYPE_INGAME_PARTNER) { @@ -5242,7 +5245,7 @@ static void Cmd_switchineffects(void) for (i = 0; i < gBattlersCount; i++) { - u16* hpOnSwitchout = &gBattleStruct->hpOnSwitchout[GetBattlerSide(i)]; + u16 *hpOnSwitchout = &gBattleStruct->hpOnSwitchout[GetBattlerSide(i)]; *hpOnSwitchout = gBattleMons[i].hp; } @@ -5251,7 +5254,7 @@ static void Cmd_switchineffects(void) u32 hitmarkerFaintBits = gHitMarker >> 28; gBattlerFainted++; - while (1) + while (TRUE) { if (hitmarkerFaintBits & gBitTable[gBattlerFainted] && !(gAbsentBattlerFlags & gBitTable[gBattlerFainted])) break; @@ -5627,7 +5630,7 @@ static void Cmd_updatebattlermoves(void) if (gBattleControllerExecFlags == 0) { s32 i; - struct BattlePokemon *bufferPoke = (struct BattlePokemon*) &gBattleBufferB[gActiveBattler][4]; + struct BattlePokemon *bufferPoke = (struct BattlePokemon *) &gBattleBufferB[gActiveBattler][4]; for (i = 0; i < MAX_MON_MOVES; i++) { gBattleMons[gActiveBattler].moves[i] = bufferPoke->moves[i]; @@ -5824,7 +5827,8 @@ static void Cmd_cancelallactions(void) gBattlescriptCurrInstr++; } -static void Cmd_adjustsetdamage(void) // The same as adjustnormaldamage, except there's no random damage multiplier. +// The same as adjustnormaldamage, except there's no random damage multiplier. +static void Cmd_adjustsetdamage(void) { u8 holdEffect, param; @@ -5866,13 +5870,13 @@ static void Cmd_adjustsetdamage(void) // The same as adjustnormaldamage, except static void Cmd_removeitem(void) { - u16* usedHeldItem; + u16 *usedHeldItem; gActiveBattler = GetBattlerForBattleScript(gBattlescriptCurrInstr[1]); usedHeldItem = &gBattleStruct->usedHeldItems[gActiveBattler]; *usedHeldItem = gBattleMons[gActiveBattler].item; - gBattleMons[gActiveBattler].item = 0; + gBattleMons[gActiveBattler].item = ITEM_NONE; BtlController_EmitSetMonData(BUFFER_A, REQUEST_HELDITEM_BATTLE, 0, sizeof(gBattleMons[gActiveBattler].item), &gBattleMons[gActiveBattler].item); MarkBattlerForControllerExec(gActiveBattler); @@ -6115,14 +6119,14 @@ static bool8 SlideOutLevelUpBanner(void) static void PutMonIconOnLvlUpBanner(void) { u8 spriteId; - const u16* iconPal; + const u16 *iconPal; struct SpriteSheet iconSheet; struct SpritePalette iconPalSheet; u16 species = GetMonData(&gPlayerParty[gBattleStruct->expGetterMonId], MON_DATA_SPECIES); u32 personality = GetMonData(&gPlayerParty[gBattleStruct->expGetterMonId], MON_DATA_PERSONALITY); - const u8* iconPtr = GetMonIconPtr(species, personality, 1); + const u8 *iconPtr = GetMonIconPtr(species, personality, 1); iconSheet.data = iconPtr; iconSheet.size = 0x200; iconSheet.tag = TAG_LVLUP_BANNER_MON_ICON; @@ -6139,7 +6143,7 @@ static void PutMonIconOnLvlUpBanner(void) gSprites[spriteId].sXOffset = gBattle_BG2_X; } -static void SpriteCB_MonIconOnLvlUpBanner(struct Sprite* sprite) +static void SpriteCB_MonIconOnLvlUpBanner(struct Sprite *sprite) { sprite->x2 = sprite->sXOffset - gBattle_BG2_X; @@ -6223,19 +6227,19 @@ static void Cmd_jumpifplayerran(void) static void Cmd_hpthresholds(void) { - u8 opposingBank; + u8 opposingBattler; s32 result; if (!(gBattleTypeFlags & BATTLE_TYPE_DOUBLE)) { gActiveBattler = GetBattlerForBattleScript(gBattlescriptCurrInstr[1]); - opposingBank = gActiveBattler ^ BIT_SIDE; + opposingBattler = gActiveBattler ^ BIT_SIDE; - result = gBattleMons[opposingBank].hp * 100 / gBattleMons[opposingBank].maxHP; + result = gBattleMons[opposingBattler].hp * 100 / gBattleMons[opposingBattler].maxHP; if (result == 0) result = 1; - if (result > 69 || !gBattleMons[opposingBank].hp) + if (result > 69 || gBattleMons[opposingBattler].hp == 0) gBattleStruct->hpScale = 0; else if (result > 39) gBattleStruct->hpScale = 1; @@ -6250,18 +6254,18 @@ static void Cmd_hpthresholds(void) static void Cmd_hpthresholds2(void) { - u8 opposingBank; + u8 opposingBattler; s32 result; u8 hpSwitchout; if (!(gBattleTypeFlags & BATTLE_TYPE_DOUBLE)) { gActiveBattler = GetBattlerForBattleScript(gBattlescriptCurrInstr[1]); - opposingBank = gActiveBattler ^ BIT_SIDE; - hpSwitchout = *(gBattleStruct->hpOnSwitchout + GetBattlerSide(opposingBank)); - result = (hpSwitchout - gBattleMons[opposingBank].hp) * 100 / hpSwitchout; + opposingBattler = gActiveBattler ^ BIT_SIDE; + hpSwitchout = *(gBattleStruct->hpOnSwitchout + GetBattlerSide(opposingBattler)); + result = (hpSwitchout - gBattleMons[opposingBattler].hp) * 100 / hpSwitchout; - if (gBattleMons[opposingBank].hp >= hpSwitchout) + if (gBattleMons[opposingBattler].hp >= hpSwitchout) gBattleStruct->hpScale = 0; else if (result <= 29) gBattleStruct->hpScale = 1; @@ -6278,7 +6282,7 @@ static void Cmd_useitemonopponent(void) { gBattlerInMenuId = gBattlerAttacker; PokemonUseItemEffects(&gEnemyParty[gBattlerPartyIndexes[gBattlerAttacker]], gLastUsedItem, gBattlerPartyIndexes[gBattlerAttacker], 0, TRUE); - gBattlescriptCurrInstr += 1; + gBattlescriptCurrInstr++; } static void Cmd_various(void) @@ -6335,7 +6339,7 @@ static void Cmd_various(void) break; } if (i == MAX_MON_MOVES) - *choicedMove = 0; + *choicedMove = MOVE_NONE; } break; case VARIOUS_RESET_PLAYER_FAINTED: @@ -6462,7 +6466,8 @@ static void Cmd_various(void) gBattlescriptCurrInstr += 3; } -static void Cmd_setprotectlike(void) // protect and endure + // Protect and Endure +static void Cmd_setprotectlike(void) { bool8 notLastTurn = TRUE; u16 lastMove = gLastResultingMoves[gBattlerAttacker]; @@ -6576,7 +6581,7 @@ static void Cmd_jumpifnexttargetvalid(void) static void Cmd_tryhealhalfhealth(void) { - const u8* failPtr = T1_READ_PTR(gBattlescriptCurrInstr + 1); + const u8 *failPtr = T1_READ_PTR(gBattlescriptCurrInstr + 1); if (gBattlescriptCurrInstr[5] == BS_ATTACKER) gBattlerTarget = gBattlerAttacker; @@ -6606,8 +6611,7 @@ static void Cmd_trymirrormove(void) { if (i != gBattlerAttacker) { - move = *(i * 2 + gBattlerAttacker * 8 + (u8*)(gBattleStruct->lastTakenMoveFrom) + 0) - | (*(i * 2 + gBattlerAttacker * 8 + (u8*)(gBattleStruct->lastTakenMoveFrom) + 1) << 8); + move = T1_READ_16(i * 2 + gBattlerAttacker * 8 + gBattleStruct->lastTakenMoveFrom); if (move != MOVE_NONE && move != MOVE_UNAVAILABLE) { @@ -6617,8 +6621,7 @@ static void Cmd_trymirrormove(void) } } - move = *(gBattleStruct->lastTakenMove + gBattlerAttacker * 2 + 0) - | (*(gBattleStruct->lastTakenMove + gBattlerAttacker * 2 + 1) << 8); + move = T1_READ_16(gBattleStruct->lastTakenMove + gBattlerAttacker * 2); if (move != MOVE_NONE && move != MOVE_UNAVAILABLE) { @@ -6749,7 +6752,7 @@ static void Cmd_trysetrest(void) static void Cmd_jumpifnotfirstturn(void) { - const u8* failJump = T1_READ_PTR(gBattlescriptCurrInstr + 1); + const u8 *failJump = T1_READ_PTR(gBattlescriptCurrInstr + 1); if (gDisableStructs[gBattlerAttacker].isFirstTurn) gBattlescriptCurrInstr += 5; @@ -6831,7 +6834,7 @@ static void Cmd_stockpile(void) static void Cmd_stockpiletobasedamage(void) { - const u8* jumpPtr = T1_READ_PTR(gBattlescriptCurrInstr + 1); + const u8 *jumpPtr = T1_READ_PTR(gBattlescriptCurrInstr + 1); if (gDisableStructs[gBattlerAttacker].stockpileCounter == 0) { gBattlescriptCurrInstr = jumpPtr; @@ -6857,7 +6860,7 @@ static void Cmd_stockpiletobasedamage(void) static void Cmd_stockpiletohpheal(void) { - const u8* jumpPtr = T1_READ_PTR(gBattlescriptCurrInstr + 1); + const u8 *jumpPtr = T1_READ_PTR(gBattlescriptCurrInstr + 1); if (gDisableStructs[gBattlerAttacker].stockpileCounter == 0) { @@ -6895,8 +6898,8 @@ static void Cmd_negativedamage(void) gBattlescriptCurrInstr++; } -#define STAT_BUFF_WORKED 0 -#define STAT_BUFF_DIDNT_WORK 1 +#define STAT_CHANGE_WORKED 0 +#define STAT_CHANGE_DIDNT_WORK 1 static u8 ChangeStatBuffs(s8 statValue, u8 statId, u8 flags, const u8 *BS_ptr) { @@ -6915,9 +6918,9 @@ static u8 ChangeStatBuffs(s8 statValue, u8 statId, u8 flags, const u8 *BS_ptr) certain++; flags &= ~MOVE_EFFECT_CERTAIN; - if (flags & STAT_BUFF_NOT_PROTECT_AFFECTED) + if (flags & STAT_CHANGE_NOT_PROTECT_AFFECTED) notProtectAffected++; - flags &= ~STAT_BUFF_NOT_PROTECT_AFFECTED; + flags &= ~STAT_CHANGE_NOT_PROTECT_AFFECTED; PREPARE_STAT_BUFFER(gBattleTextBuff1, statId) @@ -6926,7 +6929,7 @@ static u8 ChangeStatBuffs(s8 statValue, u8 statId, u8 flags, const u8 *BS_ptr) if (gSideTimers[GET_BATTLER_SIDE(gActiveBattler)].mistTimer && !certain && gCurrentMove != MOVE_CURSE) { - if (flags == STAT_BUFF_ALLOW_PTR) + if (flags == STAT_CHANGE_ALLOW_PTR) { if (gSpecialStatuses[gActiveBattler].statLowered) { @@ -6940,19 +6943,19 @@ static u8 ChangeStatBuffs(s8 statValue, u8 statId, u8 flags, const u8 *BS_ptr) gSpecialStatuses[gActiveBattler].statLowered = 1; } } - return STAT_BUFF_DIDNT_WORK; + return STAT_CHANGE_DIDNT_WORK; } else if (gCurrentMove != MOVE_CURSE && notProtectAffected != TRUE && JumpIfMoveAffectedByProtect(0)) { gBattlescriptCurrInstr = BattleScript_ButItFailed; - return STAT_BUFF_DIDNT_WORK; + return STAT_CHANGE_DIDNT_WORK; } else if ((gBattleMons[gActiveBattler].ability == ABILITY_CLEAR_BODY || gBattleMons[gActiveBattler].ability == ABILITY_WHITE_SMOKE) && !certain && gCurrentMove != MOVE_CURSE) { - if (flags == STAT_BUFF_ALLOW_PTR) + if (flags == STAT_CHANGE_ALLOW_PTR) { if (gSpecialStatuses[gActiveBattler].statLowered) { @@ -6968,12 +6971,12 @@ static u8 ChangeStatBuffs(s8 statValue, u8 statId, u8 flags, const u8 *BS_ptr) gSpecialStatuses[gActiveBattler].statLowered = 1; } } - return STAT_BUFF_DIDNT_WORK; + return STAT_CHANGE_DIDNT_WORK; } else if (gBattleMons[gActiveBattler].ability == ABILITY_KEEN_EYE && !certain && statId == STAT_ACC) { - if (flags == STAT_BUFF_ALLOW_PTR) + if (flags == STAT_CHANGE_ALLOW_PTR) { BattleScriptPush(BS_ptr); gBattleScripting.battler = gActiveBattler; @@ -6981,12 +6984,12 @@ static u8 ChangeStatBuffs(s8 statValue, u8 statId, u8 flags, const u8 *BS_ptr) gLastUsedAbility = gBattleMons[gActiveBattler].ability; RecordAbilityBattle(gActiveBattler, gLastUsedAbility); } - return STAT_BUFF_DIDNT_WORK; + return STAT_CHANGE_DIDNT_WORK; } else if (gBattleMons[gActiveBattler].ability == ABILITY_HYPER_CUTTER && !certain && statId == STAT_ATK) { - if (flags == STAT_BUFF_ALLOW_PTR) + if (flags == STAT_CHANGE_ALLOW_PTR) { BattleScriptPush(BS_ptr); gBattleScripting.battler = gActiveBattler; @@ -6994,11 +6997,11 @@ static u8 ChangeStatBuffs(s8 statValue, u8 statId, u8 flags, const u8 *BS_ptr) gLastUsedAbility = gBattleMons[gActiveBattler].ability; RecordAbilityBattle(gActiveBattler, gLastUsedAbility); } - return STAT_BUFF_DIDNT_WORK; + return STAT_CHANGE_DIDNT_WORK; } else if (gBattleMons[gActiveBattler].ability == ABILITY_SHIELD_DUST && flags == 0) { - return STAT_BUFF_DIDNT_WORK; + return STAT_CHANGE_DIDNT_WORK; } else // try to decrease { @@ -7012,19 +7015,15 @@ static u8 ChangeStatBuffs(s8 statValue, u8 statId, u8 flags, const u8 *BS_ptr) gBattleTextBuff2[3] = STRINGID_STATHARSHLY >> 8; index = 4; } - gBattleTextBuff2[index] = B_BUFF_STRING; - index++; - gBattleTextBuff2[index] = STRINGID_STATFELL; - index++; - gBattleTextBuff2[index] = STRINGID_STATFELL >> 8; - index++; + gBattleTextBuff2[index++] = B_BUFF_STRING; + gBattleTextBuff2[index++] = STRINGID_STATFELL; + gBattleTextBuff2[index++] = STRINGID_STATFELL >> 8; gBattleTextBuff2[index] = B_BUFF_EOS; if (gBattleMons[gActiveBattler].statStages[statId] == MIN_STAT_STAGE) gBattleCommunication[MULTISTRING_CHOOSER] = B_MSG_STAT_WONT_DECREASE; else gBattleCommunication[MULTISTRING_CHOOSER] = (gBattlerTarget == gActiveBattler); // B_MSG_ATTACKER_STAT_FELL or B_MSG_DEFENDER_STAT_FELL - } } else // stat increase @@ -7039,12 +7038,9 @@ static u8 ChangeStatBuffs(s8 statValue, u8 statId, u8 flags, const u8 *BS_ptr) gBattleTextBuff2[3] = STRINGID_STATSHARPLY >> 8; index = 4; } - gBattleTextBuff2[index] = B_BUFF_STRING; - index++; - gBattleTextBuff2[index] = STRINGID_STATROSE; - index++; - gBattleTextBuff2[index] = STRINGID_STATROSE >> 8; - index++; + gBattleTextBuff2[index++] = B_BUFF_STRING; + gBattleTextBuff2[index++] = STRINGID_STATROSE; + gBattleTextBuff2[index++] = STRINGID_STATROSE >> 8; gBattleTextBuff2[index] = B_BUFF_EOS; if (gBattleMons[gActiveBattler].statStages[statId] == MAX_STAT_STAGE) @@ -7059,23 +7055,24 @@ static u8 ChangeStatBuffs(s8 statValue, u8 statId, u8 flags, const u8 *BS_ptr) if (gBattleMons[gActiveBattler].statStages[statId] > MAX_STAT_STAGE) gBattleMons[gActiveBattler].statStages[statId] = MAX_STAT_STAGE; - if (gBattleCommunication[MULTISTRING_CHOOSER] == B_MSG_STAT_WONT_INCREASE && flags & STAT_BUFF_ALLOW_PTR) + if (gBattleCommunication[MULTISTRING_CHOOSER] == B_MSG_STAT_WONT_INCREASE && flags & STAT_CHANGE_ALLOW_PTR) gMoveResultFlags |= MOVE_RESULT_MISSED; - if (gBattleCommunication[MULTISTRING_CHOOSER] == B_MSG_STAT_WONT_INCREASE && !(flags & STAT_BUFF_ALLOW_PTR)) - return STAT_BUFF_DIDNT_WORK; + if (gBattleCommunication[MULTISTRING_CHOOSER] == B_MSG_STAT_WONT_INCREASE && !(flags & STAT_CHANGE_ALLOW_PTR)) + return STAT_CHANGE_DIDNT_WORK; - return STAT_BUFF_WORKED; + return STAT_CHANGE_WORKED; } static void Cmd_statbuffchange(void) { - const u8* jumpPtr = T1_READ_PTR(gBattlescriptCurrInstr + 2); - if (ChangeStatBuffs(gBattleScripting.statChanger & 0xF0, GET_STAT_BUFF_ID(gBattleScripting.statChanger), gBattlescriptCurrInstr[1], jumpPtr) == STAT_BUFF_WORKED) + const u8 *jumpPtr = T1_READ_PTR(gBattlescriptCurrInstr + 2); + if (ChangeStatBuffs(gBattleScripting.statChanger & 0xF0, GET_STAT_BUFF_ID(gBattleScripting.statChanger), gBattlescriptCurrInstr[1], jumpPtr) == STAT_CHANGE_WORKED) gBattlescriptCurrInstr += 6; } -static void Cmd_normalisebuffs(void) // haze +// Haze +static void Cmd_normalisebuffs(void) { s32 i, j; @@ -7161,7 +7158,7 @@ static void Cmd_forcerandomswitch(void) s32 firstMonId; s32 lastMonId = 0; // + 1 s32 monsCount; - struct Pokemon* party = NULL; + struct Pokemon *party = NULL; s32 validMons = 0; s32 minNeeded; @@ -7178,15 +7175,15 @@ static void Cmd_forcerandomswitch(void) { if ((gBattlerTarget & BIT_FLANK) != B_FLANK_LEFT) { - firstMonId = 3; - lastMonId = 6; + firstMonId = PARTY_SIZE / 2; + lastMonId = PARTY_SIZE; } else { firstMonId = 0; - lastMonId = 3; + lastMonId = PARTY_SIZE / 2; } - monsCount = 3; + monsCount = PARTY_SIZE / 2; minNeeded = 1; battler2PartyId = gBattlerPartyIndexes[gBattlerTarget]; battler1PartyId = gBattlerPartyIndexes[gBattlerTarget ^ BIT_FLANK]; @@ -7196,15 +7193,15 @@ static void Cmd_forcerandomswitch(void) { if (GetLinkTrainerFlankId(GetBattlerMultiplayerId(gBattlerTarget)) == B_FLANK_RIGHT) { - firstMonId = 3; - lastMonId = 6; + firstMonId = PARTY_SIZE / 2; + lastMonId = PARTY_SIZE; } else { firstMonId = 0; - lastMonId = 3; + lastMonId = PARTY_SIZE / 2; } - monsCount = 3; + monsCount = PARTY_SIZE / 2; minNeeded = 1; battler2PartyId = gBattlerPartyIndexes[gBattlerTarget]; battler1PartyId = gBattlerPartyIndexes[gBattlerTarget ^ BIT_FLANK]; @@ -7214,23 +7211,23 @@ static void Cmd_forcerandomswitch(void) if (GetBattlerSide(gBattlerTarget) == B_SIDE_PLAYER) { firstMonId = 0; - lastMonId = 6; - monsCount = 6; + lastMonId = PARTY_SIZE; + monsCount = PARTY_SIZE; minNeeded = 2; // since there are two opponents, it has to be a double battle } else { if ((gBattlerTarget & BIT_FLANK) != B_FLANK_LEFT) { - firstMonId = 3; - lastMonId = 6; + firstMonId = PARTY_SIZE / 2; + lastMonId = PARTY_SIZE; } else { firstMonId = 0; - lastMonId = 3; + lastMonId = PARTY_SIZE / 2; } - monsCount = 3; + monsCount = PARTY_SIZE / 2; minNeeded = 1; } battler2PartyId = gBattlerPartyIndexes[gBattlerTarget]; @@ -7239,8 +7236,8 @@ static void Cmd_forcerandomswitch(void) else if (gBattleTypeFlags & BATTLE_TYPE_DOUBLE) { firstMonId = 0; - lastMonId = 6; - monsCount = 6; + lastMonId = PARTY_SIZE; + monsCount = PARTY_SIZE; minNeeded = 2; battler2PartyId = gBattlerPartyIndexes[gBattlerTarget]; battler1PartyId = gBattlerPartyIndexes[gBattlerTarget ^ BIT_FLANK]; @@ -7248,8 +7245,8 @@ static void Cmd_forcerandomswitch(void) else { firstMonId = 0; - lastMonId = 6; - monsCount = 6; + lastMonId = PARTY_SIZE; + monsCount = PARTY_SIZE; minNeeded = 1; battler2PartyId = gBattlerPartyIndexes[gBattlerTarget]; // there is only one pokemon out in single battles battler1PartyId = gBattlerPartyIndexes[gBattlerTarget]; @@ -7309,7 +7306,8 @@ static void Cmd_forcerandomswitch(void) } } -static void Cmd_tryconversiontypechange(void) // randomly changes user's type to one of its moves' type +// Randomly changes user's type to one of its moves' type +static void Cmd_tryconversiontypechange(void) { u8 validMoves = 0; u8 moveChecked; @@ -7349,7 +7347,6 @@ static void Cmd_tryconversiontypechange(void) // randomly changes user's type to { do { - while ((moveChecked = Random() & (MAX_MON_MOVES - 1)) >= validMoves); moveType = gBattleMoves[gBattleMons[gBattlerAttacker].moves[moveChecked]].type; @@ -7497,7 +7494,8 @@ static void Cmd_tryKO(void) } } -static void Cmd_damagetohalftargethp(void) // super fang +// Super Fang +static void Cmd_damagetohalftargethp(void) { gBattleMoveDamage = gBattleMons[gBattlerTarget].hp / 2; if (gBattleMoveDamage == 0) @@ -7707,8 +7705,8 @@ static void Cmd_transformdataexecution(void) PREPARE_SPECIES_BUFFER(gBattleTextBuff1, gBattleMons[gBattlerTarget].species) - battleMonAttacker = (u8*)(&gBattleMons[gBattlerAttacker]); - battleMonTarget = (u8*)(&gBattleMons[gBattlerTarget]); + battleMonAttacker = (u8 *)(&gBattleMons[gBattlerAttacker]); + battleMonTarget = (u8 *)(&gBattleMons[gBattlerTarget]); for (i = 0; i < offsetof(struct BattlePokemon, pp); i++) battleMonAttacker[i] = battleMonTarget[i]; @@ -7793,7 +7791,6 @@ static void Cmd_mimicattackcopy(void) else gBattleMons[gBattlerAttacker].pp[gCurrMovePos] = 5; - PREPARE_MOVE_BUFFER(gBattleTextBuff1, gLastMoves[gBattlerTarget]) gDisableStructs[gBattlerAttacker].mimickedMoves |= gBitTable[gCurrMovePos]; @@ -7808,7 +7805,7 @@ static void Cmd_mimicattackcopy(void) static void Cmd_metronome(void) { - while (1) + while (TRUE) { s32 i; @@ -7819,7 +7816,7 @@ static void Cmd_metronome(void) for (i = 0; i < MAX_MON_MOVES; i++); // ? i = -1; - while (1) + while (TRUE) { i++; if (sMovesForbiddenToCopy[i] == gCurrentMove) @@ -7880,7 +7877,8 @@ static void Cmd_counterdamagecalculator(void) } } -static void Cmd_mirrorcoatdamagecalculator(void) // a copy of Cmd with the physical -> special field changes +// A copy of Cmd with the physical -> special field changes +static void Cmd_mirrorcoatdamagecalculator(void) { u8 sideAttacker = GetBattlerSide(gBattlerAttacker); u8 sideTarget = GetBattlerSide(gProtectStructs[gBattlerAttacker].specialBattlerId); @@ -7966,7 +7964,7 @@ static void Cmd_painsplitdmgcalc(void) { s32 hpDiff = (gBattleMons[gBattlerAttacker].hp + gBattleMons[gBattlerTarget].hp) / 2; s32 painSplitHp = gBattleMoveDamage = gBattleMons[gBattlerTarget].hp - hpDiff; - u8* storeLoc = (void*)(&gBattleScripting.painSplitHp); + u8 *storeLoc = (void *)(&gBattleScripting.painSplitHp); storeLoc[0] = (painSplitHp); storeLoc[1] = (painSplitHp & 0x0000FF00) >> 8; @@ -7984,7 +7982,8 @@ static void Cmd_painsplitdmgcalc(void) } } -static void Cmd_settypetorandomresistance(void) // conversion 2 +// Conversion 2 +static void Cmd_settypetorandomresistance(void) { if (gLastLandedMoves[gBattlerAttacker] == MOVE_NONE || gLastLandedMoves[gBattlerAttacker] == MOVE_UNAVAILABLE) @@ -8052,7 +8051,8 @@ static void Cmd_setalwayshitflag(void) gBattlescriptCurrInstr++; } -static void Cmd_copymovepermanently(void) // sketch +// Sketch +static void Cmd_copymovepermanently(void) { gChosenMove = MOVE_UNAVAILABLE; @@ -8164,7 +8164,6 @@ static void Cmd_trychoosesleeptalkmove(void) { unusableMovesBits |= gBitTable[i]; } - } unusableMovesBits = CheckMoveLimitations(gBattlerAttacker, unusableMovesBits, ~MOVE_LIMITATION_PP); @@ -8609,7 +8608,6 @@ static void Cmd_magnitudedamagecalculation(void) magnitude = 10; } - PREPARE_BYTE_NUMBER_BUFFER(gBattleTextBuff1, 2, magnitude) for (gBattlerTarget = 0; gBattlerTarget < gBattlersCount; gBattlerTarget++) @@ -8684,7 +8682,8 @@ static void Cmd_setsunny(void) gBattlescriptCurrInstr++; } -static void Cmd_maxattackhalvehp(void) // belly drum +// Belly Drum +static void Cmd_maxattackhalvehp(void) { u32 halfHp = gBattleMons[gBattlerAttacker].maxHP / 2; @@ -8707,7 +8706,8 @@ static void Cmd_maxattackhalvehp(void) // belly drum } } -static void Cmd_copyfoestats(void) // psych up +// Psych Up +static void Cmd_copyfoestats(void) { s32 i; @@ -8877,7 +8877,7 @@ static void Cmd_trydobeatup(void) && GetMonData(&party[gBattleCommunication[0]], MON_DATA_SPECIES2) && GetMonData(&party[gBattleCommunication[0]], MON_DATA_SPECIES2) != SPECIES_EGG && !GetMonData(&party[gBattleCommunication[0]], MON_DATA_STATUS)) - break; + break; } if (gBattleCommunication[0] < PARTY_SIZE) { @@ -8985,7 +8985,8 @@ static void Cmd_trymemento(void) } } -static void Cmd_setforcedtarget(void) // follow me +// Follow Me +static void Cmd_setforcedtarget(void) { gSideTimers[GetBattlerSide(gBattlerAttacker)].followmeTimer = 1; gSideTimers[GetBattlerSide(gBattlerAttacker)].followmeTarget = gBattlerAttacker; @@ -9000,7 +9001,8 @@ static void Cmd_setcharge(void) gBattlescriptCurrInstr++; } -static void Cmd_callterrainattack(void) // nature power +// Nature Power +static void Cmd_callterrainattack(void) { gHitMarker &= ~HITMARKER_ATTACKSTRING_PRINTED; gCurrentMove = sNaturePowerMoves[gBattleTerrain]; @@ -9009,7 +9011,8 @@ static void Cmd_callterrainattack(void) // nature power gBattlescriptCurrInstr++; } -static void Cmd_cureifburnedparalysedorpoisoned(void) // refresh +// Refresh +static void Cmd_cureifburnedparalysedorpoisoned(void) { if (gBattleMons[gBattlerAttacker].status1 & (STATUS1_POISON | STATUS1_BURN | STATUS1_PARALYSIS | STATUS1_TOXIC_POISON)) { @@ -9078,7 +9081,8 @@ static void Cmd_trysethelpinghand(void) } } -static void Cmd_tryswapitems(void) // trick +// Trick +static void Cmd_tryswapitems(void) { // opponent can't swap items with player in regular battles if (gBattleTypeFlags & BATTLE_TYPE_TRAINER_HILL @@ -9144,11 +9148,11 @@ static void Cmd_tryswapitems(void) // trick BtlController_EmitSetMonData(BUFFER_A, REQUEST_HELDITEM_BATTLE, 0, sizeof(gBattleMons[gBattlerTarget].item), &gBattleMons[gBattlerTarget].item); MarkBattlerForControllerExec(gBattlerTarget); - *(u8*)((u8*)(&gBattleStruct->choicedMove[gBattlerTarget]) + 0) = 0; - *(u8*)((u8*)(&gBattleStruct->choicedMove[gBattlerTarget]) + 1) = 0; + *(u8 *)((u8 *)(&gBattleStruct->choicedMove[gBattlerTarget]) + 0) = 0; + *(u8 *)((u8 *)(&gBattleStruct->choicedMove[gBattlerTarget]) + 1) = 0; - *(u8*)((u8*)(&gBattleStruct->choicedMove[gBattlerAttacker]) + 0) = 0; - *(u8*)((u8*)(&gBattleStruct->choicedMove[gBattlerAttacker]) + 1) = 0; + *(u8 *)((u8 *)(&gBattleStruct->choicedMove[gBattlerAttacker]) + 0) = 0; + *(u8 *)((u8 *)(&gBattleStruct->choicedMove[gBattlerAttacker]) + 1) = 0; gBattlescriptCurrInstr += 5; @@ -9165,7 +9169,8 @@ static void Cmd_tryswapitems(void) // trick } } -static void Cmd_trycopyability(void) // role play +// Role Play +static void Cmd_trycopyability(void) { if (gBattleMons[gBattlerTarget].ability != ABILITY_NONE && gBattleMons[gBattlerTarget].ability != ABILITY_WONDER_GUARD) @@ -9213,7 +9218,8 @@ static void Cmd_trywish(void) } } -static void Cmd_trysetroots(void) // ingrain +// Ingrain +static void Cmd_trysetroots(void) { if (gStatuses3[gBattlerAttacker] & STATUS3_ROOTED) { @@ -9228,9 +9234,9 @@ static void Cmd_trysetroots(void) // ingrain static void Cmd_doubledamagedealtifdamaged(void) { - if ((gProtectStructs[gBattlerAttacker].physicalDmg + if ((gProtectStructs[gBattlerAttacker].physicalDmg != 0 && gProtectStructs[gBattlerAttacker].physicalBattlerId == gBattlerTarget) - || (gProtectStructs[gBattlerAttacker].specialDmg + || (gProtectStructs[gBattlerAttacker].specialDmg != 0 && gProtectStructs[gBattlerAttacker].specialBattlerId == gBattlerTarget)) { gBattleScripting.dmgMultiplier = 2; @@ -9278,7 +9284,8 @@ static void Cmd_scaledamagebyhealthratio(void) gBattlescriptCurrInstr++; } -static void Cmd_tryswapabilities(void) // skill swap +// Skill Swap +static void Cmd_tryswapabilities(void) { if ((gBattleMons[gBattlerAttacker].ability == ABILITY_NONE && gBattleMons[gBattlerTarget].ability == ABILITY_NONE) @@ -9373,9 +9380,9 @@ static void Cmd_weightdamagecalculation(void) static void Cmd_assistattackselect(void) { s32 chooseableMovesNo = 0; - struct Pokemon* party; + struct Pokemon *party; s32 monId, moveId; - u16* validMoves = gBattleStruct->assistPossibleMoves; + u16 *validMoves = gBattleStruct->assistPossibleMoves; if (GET_BATTLER_SIDE(gBattlerAttacker) != B_SIDE_PLAYER) party = gEnemyParty; @@ -9433,12 +9440,13 @@ static void Cmd_trysetmagiccoat(void) } else { - gProtectStructs[gBattlerAttacker].bounceMove = 1; + gProtectStructs[gBattlerAttacker].bounceMove = TRUE; gBattlescriptCurrInstr += 5; } } -static void Cmd_trysetsnatch(void) // snatch +// Snatch +static void Cmd_trysetsnatch(void) { gSpecialStatuses[gBattlerAttacker].ppNotAffectedByPressure = 1; if (gCurrentTurnActionNumber == gBattlersCount - 1) // moves last turn @@ -9483,7 +9491,7 @@ static void Cmd_switchoutabilities(void) { case ABILITY_NATURAL_CURE: gBattleMons[gActiveBattler].status1 = 0; - BtlController_EmitSetMonData(BUFFER_A, REQUEST_STATUS_BATTLE, + BtlController_EmitSetMonData(BUFFER_A, REQUEST_STATUS_BATTLE, gBitTable[*(gBattleStruct->battlerPartyIndexes + gActiveBattler)], sizeof(gBattleMons[gActiveBattler].status1), &gBattleMons[gActiveBattler].status1); @@ -9642,7 +9650,8 @@ static void Cmd_trycastformdatachange(void) } } -static void Cmd_settypebasedhalvers(void) // water and mud sport +// Water and Mud Sport +static void Cmd_settypebasedhalvers(void) { bool8 worked = FALSE; @@ -9655,7 +9664,7 @@ static void Cmd_settypebasedhalvers(void) // water and mud sport worked = TRUE; } } - else // water sport + else // Water Sport { if (!(gStatuses3[gBattlerAttacker] & STATUS3_WATERSPORT)) { @@ -9766,7 +9775,8 @@ static void Cmd_snatchsetbattlers(void) gBattlescriptCurrInstr++; } -static void Cmd_removelightscreenreflect(void) // brick break +// Brick Break +static void Cmd_removelightscreenreflect(void) { u8 opposingSide = GetBattlerSide(gBattlerAttacker) ^ BIT_SIDE; @@ -10162,7 +10172,7 @@ static void Cmd_trygivecaughtmonnick(void) } break; case 3: - if (gMain.callback2 == BattleMainCB2 && !gPaletteFade.active ) + if (gMain.callback2 == BattleMainCB2 && !gPaletteFade.active) { SetMonData(&gEnemyParty[gBattlerPartyIndexes[gBattlerAttacker ^ BIT_SIDE]], MON_DATA_NICKNAME, gBattleStruct->caughtMonNick); gBattlescriptCurrInstr = T1_READ_PTR(gBattlescriptCurrInstr + 1); diff --git a/src/battle_setup.c b/src/battle_setup.c index be2f7e859..da51a7be6 100644 --- a/src/battle_setup.c +++ b/src/battle_setup.c @@ -600,7 +600,7 @@ void StartRegiBattle(void) static void CB2_EndWildBattle(void) { - CpuFill16(0, (void*)(BG_PLTT), BG_PLTT_SIZE); + CpuFill16(0, (void *)(BG_PLTT), BG_PLTT_SIZE); ResetOamRange(0, 128); if (IsPlayerDefeated(gBattleOutcome) == TRUE && !InBattlePyramid() && !InBattlePike()) @@ -616,7 +616,7 @@ static void CB2_EndWildBattle(void) static void CB2_EndScriptedWildBattle(void) { - CpuFill16(0, (void*)(BG_PLTT), BG_PLTT_SIZE); + CpuFill16(0, (void *)(BG_PLTT), BG_PLTT_SIZE); ResetOamRange(0, 128); if (IsPlayerDefeated(gBattleOutcome) == TRUE) @@ -1037,22 +1037,22 @@ static void InitTrainerBattleVariables(void) static inline void SetU8(void *ptr, u8 value) { - *(u8*)(ptr) = value; + *(u8 *)(ptr) = value; } static inline void SetU16(void *ptr, u16 value) { - *(u16*)(ptr) = value; + *(u16 *)(ptr) = value; } static inline void SetU32(void *ptr, u32 value) { - *(u32*)(ptr) = value; + *(u32 *)(ptr) = value; } -static inline void SetPtr(const void *ptr, const void* value) +static inline void SetPtr(const void *ptr, const void *value) { - *(const void**)(ptr) = value; + *(const void **)(ptr) = value; } static void TrainerBattleLoadArgs(const struct TrainerBattleParameter *specs, const u8 *data) diff --git a/src/battle_tower.c b/src/battle_tower.c index 354a087c4..bebbdee7d 100644 --- a/src/battle_tower.c +++ b/src/battle_tower.c @@ -996,7 +996,7 @@ static bool8 ChooseSpecialBattleTowerTrainer(void) winStreak = GetCurrentBattleTowerWinStreak(lvlMode, battleMode); for (i = 0; i < BATTLE_TOWER_RECORD_COUNT; i++) { - u32 *record = (u32*)(&gSaveBlock2Ptr->frontier.towerRecords[i]); + u32 *record = (u32 *)(&gSaveBlock2Ptr->frontier.towerRecords[i]); u32 recordHasData = 0; u32 checksum = 0; for (j = 0; j < (sizeof(struct EmeraldBattleTowerRecord) - 4) / 4; j++) // - 4, because of the last field being the checksum itself. @@ -2374,7 +2374,7 @@ static void LoadMultiPartnerCandidatesData(void) r10 = 0; for (i = 0; i < BATTLE_TOWER_RECORD_COUNT; i++) { - u32 *record = (u32*)(&gSaveBlock2Ptr->frontier.towerRecords[i]); + u32 *record = (u32 *)(&gSaveBlock2Ptr->frontier.towerRecords[i]); u32 recordHasData = 0; u32 checksum = 0; for (j = 0; j < (sizeof(struct EmeraldBattleTowerRecord) - 4) / 4; j++) // - 4, because of the last field being the checksum itself. @@ -2690,7 +2690,7 @@ static void SetTowerInterviewData(void) static void ValidateBattleTowerRecordChecksums(void) { s32 i, j; - u32 *record = (u32*)(&gSaveBlock2Ptr->frontier.towerPlayer); + u32 *record = (u32 *)(&gSaveBlock2Ptr->frontier.towerPlayer); u32 checksum = 0; for (j = 0; j < (sizeof(struct EmeraldBattleTowerRecord) - 4) / 4; j++) // - 4, because of the last field being the checksum itself. @@ -2702,7 +2702,7 @@ static void ValidateBattleTowerRecordChecksums(void) for (i = 0; i < BATTLE_TOWER_RECORD_COUNT; i++) { - record = (u32*)(&gSaveBlock2Ptr->frontier.towerRecords[i]); + record = (u32 *)(&gSaveBlock2Ptr->frontier.towerRecords[i]); checksum = 0; for (j = 0; j < (sizeof(struct EmeraldBattleTowerRecord) - 4) / 4; j++) // - 4, because of the last field being the checksum itself. { @@ -3195,7 +3195,7 @@ static void ValidateApprenticesChecksums(void) for (i = 0; i < APPRENTICE_COUNT; i++) { - u32 *data = (u32*) &gSaveBlock2Ptr->apprentices[i]; + u32 *data = (u32 *) &gSaveBlock2Ptr->apprentices[i]; u32 checksum = 0; for (j = 0; j < (sizeof(struct Apprentice) - 4) / 4; j++) checksum += data[j]; @@ -3504,7 +3504,7 @@ u8 FacilityClassToGraphicsId(u8 facilityClass) bool32 ValidateBattleTowerRecord(u8 recordId) // unused { s32 i; - u32 *record = (u32*)(&gSaveBlock2Ptr->frontier.towerRecords[recordId]); + u32 *record = (u32 *)(&gSaveBlock2Ptr->frontier.towerRecords[recordId]); u32 checksum = 0; u32 hasData = 0; for (i = 0; i < (sizeof(struct EmeraldBattleTowerRecord) - 4) / 4; i++) // - 4, because of the last fjeld bejng the checksum jtself. diff --git a/src/battle_transition.c b/src/battle_transition.c index c523cbe7b..507d5f230 100644 --- a/src/battle_transition.c +++ b/src/battle_transition.c @@ -2186,7 +2186,7 @@ static bool8 Wave_Init(struct Task *task) static bool8 Wave_Main(struct Task *task) { u8 i, sinIndex; - u16* toStore; + u16 *toStore; bool8 finished; sTransitionData->VBlank_DMA = FALSE; @@ -2347,7 +2347,7 @@ static bool8 Mugshot_SetGfx(struct Task *task) static bool8 Mugshot_ShowBanner(struct Task *task) { u8 i, sinIndex; - u16* toStore; + u16 *toStore; s16 x; s32 mergedValue; @@ -2388,7 +2388,7 @@ static bool8 Mugshot_ShowBanner(struct Task *task) if (task->tBottomBannerX < 0) task->tBottomBannerX = 0; - mergedValue = *(s32*)(&task->tTopBannerX); + mergedValue = *(s32 *)(&task->tTopBannerX); if (mergedValue == DISPLAY_WIDTH) task->tState++; @@ -2401,7 +2401,7 @@ static bool8 Mugshot_ShowBanner(struct Task *task) static bool8 Mugshot_StartOpponentSlide(struct Task *task) { u8 i; - u16* toStore; + u16 *toStore; sTransitionData->VBlank_DMA = FALSE; @@ -3716,8 +3716,8 @@ static void SpriteCB_WhiteBarFade(struct Sprite *sprite) else { u16 i; - u16* ptr1 = &gScanlineEffectRegBuffers[0][sprite->y]; - u16* ptr2 = &gScanlineEffectRegBuffers[0][sprite->y + DISPLAY_HEIGHT]; + u16 *ptr1 = &gScanlineEffectRegBuffers[0][sprite->y]; + u16 *ptr2 = &gScanlineEffectRegBuffers[0][sprite->y + DISPLAY_HEIGHT]; for (i = 0; i < DISPLAY_HEIGHT / NUM_WHITE_BARS; i++) { ptr1[i] = sprite->sFade >> 8; @@ -3783,7 +3783,7 @@ static bool8 GridSquares_Init(struct Task *task) static bool8 GridSquares_Main(struct Task *task) { - u16* tileset; + u16 *tileset; if (task->tDelay == 0) { @@ -4061,7 +4061,7 @@ static void GetBg0TilemapDst(u16 **tileset) { u16 charBase = REG_BG0CNT >> 2; charBase <<= 14; - *tileset = (u16*)(BG_VRAM + charBase); + *tileset = (u16 *)(BG_VRAM + charBase); } void GetBg0TilesDst(u16 **tilemap, u16 **tileset) @@ -4072,8 +4072,8 @@ void GetBg0TilesDst(u16 **tilemap, u16 **tileset) screenBase <<= 11; charBase <<= 14; - *tilemap = (u16*)(BG_VRAM + screenBase); - *tileset = (u16*)(BG_VRAM + charBase); + *tilemap = (u16 *)(BG_VRAM + screenBase); + *tileset = (u16 *)(BG_VRAM + charBase); } static void FadeScreenBlack(void) diff --git a/src/battle_util.c b/src/battle_util.c index 865b0112c..e75d3f01d 100644 --- a/src/battle_util.c +++ b/src/battle_util.c @@ -93,7 +93,7 @@ void HandleAction_UseMove(void) gBattleStruct->atkCancellerTracker = 0; gMoveResultFlags = 0; gMultiHitCounter = 0; - gBattleCommunication[6] = 0; + gBattleCommunication[MISS_TYPE] = 0; gCurrMovePos = gChosenMovePos = *(gBattleStruct->chosenMovePositions + gBattlerAttacker); // choose move @@ -961,7 +961,7 @@ u8 TrySetCantSelectMoveBattleScript(void) u8 limitations = 0; u16 move = gBattleMons[gActiveBattler].moves[gBattleBufferB[gActiveBattler][2]]; u8 holdEffect; - u16* choicedMove = &gBattleStruct->choicedMove[gActiveBattler]; + u16 *choicedMove = &gBattleStruct->choicedMove[gActiveBattler]; if (gDisableStructs[gActiveBattler].disabledMove == move && move != MOVE_NONE) { @@ -1199,7 +1199,7 @@ u8 DoFieldEndTurnEffects(void) // It's stupid, but won't match without it { - u8* var = &gBattleStruct->turnCountersTracker; + u8 *var = &gBattleStruct->turnCountersTracker; (*var)++; gBattleStruct->turnSideTracker = 0; } diff --git a/src/battle_util2.c b/src/battle_util2.c index 767e31492..8a202c986 100644 --- a/src/battle_util2.c +++ b/src/battle_util2.c @@ -109,12 +109,12 @@ void SwitchPartyOrderInGameMulti(u8 battlerId, u8 arg1) { s32 i; for (i = 0; i < (int)ARRAY_COUNT(gBattlePartyCurrentOrder); i++) - gBattlePartyCurrentOrder[i] = *(0 * 3 + i + (u8*)(gBattleStruct->battlerPartyOrders)); + gBattlePartyCurrentOrder[i] = *(0 * 3 + i + (u8 *)(gBattleStruct->battlerPartyOrders)); SwitchPartyMonSlots(GetPartyIdFromBattlePartyId(gBattlerPartyIndexes[battlerId]), GetPartyIdFromBattlePartyId(arg1)); for (i = 0; i < (int)ARRAY_COUNT(gBattlePartyCurrentOrder); i++) - *(0 * 3 + i + (u8*)(gBattleStruct->battlerPartyOrders)) = gBattlePartyCurrentOrder[i]; + *(0 * 3 + i + (u8 *)(gBattleStruct->battlerPartyOrders)) = gBattlePartyCurrentOrder[i]; } } diff --git a/src/berry.c b/src/berry.c index 75373e6b0..389a09a10 100644 --- a/src/berry.c +++ b/src/berry.c @@ -946,7 +946,7 @@ void ClearEnigmaBerries(void) void SetEnigmaBerry(u8 *src) { u32 i; - u8 *dest = (u8*)&gSaveBlock1Ptr->enigmaBerry; + u8 *dest = (u8 *)&gSaveBlock1Ptr->enigmaBerry; for (i = 0; i < sizeof(gSaveBlock1Ptr->enigmaBerry); i++) dest[i] = src[i]; @@ -958,7 +958,7 @@ static u32 GetEnigmaBerryChecksum(struct EnigmaBerry *enigmaBerry) u32 checksum; u8 *dest; - dest = (u8*)enigmaBerry; + dest = (u8 *)enigmaBerry; checksum = 0; for (i = 0; i < sizeof(gSaveBlock1Ptr->enigmaBerry) - sizeof(gSaveBlock1Ptr->enigmaBerry.checksum); i++) checksum += dest[i]; @@ -980,7 +980,7 @@ bool32 IsEnigmaBerryValid(void) const struct Berry *GetBerryInfo(u8 berry) { if (berry == ITEM_TO_BERRY(ITEM_ENIGMA_BERRY) && IsEnigmaBerryValid()) - return (struct Berry*)(&gSaveBlock1Ptr->enigmaBerry.berry); + return (struct Berry *)(&gSaveBlock1Ptr->enigmaBerry.berry); else { if (berry == BERRY_NONE || berry > ITEM_TO_BERRY(LAST_BERRY_INDEX)) @@ -1172,7 +1172,7 @@ void GetBerryNameByBerryType(u8 berry, u8 *string) string[BERRY_NAME_LENGTH] = EOS; } -void GetBerryCountStringByBerryType(u8 berry, u8* dest, u32 berryCount) +void GetBerryCountStringByBerryType(u8 berry, u8 *dest, u32 berryCount) { GetBerryCountString(dest, GetBerryInfo(berry)->name, berryCount); } diff --git a/src/berry_blender.c b/src/berry_blender.c index f7e2c5df5..efede23bd 100644 --- a/src/berry_blender.c +++ b/src/berry_blender.c @@ -215,7 +215,7 @@ static void SetPlayerBerryData(u8, u16); static void Blender_AddTextPrinter(u8, const u8 *, u8, u8, s32, s32); static void ResetLinkCmds(void); static void CreateParticleSprites(void); -static void ShakeBgCoordForHit(s16*, u16); +static void ShakeBgCoordForHit(s16 *, u16); static void TryUpdateProgressBar(u16, u16); static void UpdateRPM(u16); static void RestoreBgCoords(void); @@ -265,7 +265,7 @@ static const u8 sText_Master[] = _("MASTER"); static const u8 sText_Dude[] = _("DUDE"); static const u8 sText_Miss[] = _("MISS"); -static const u8* const sBlenderOpponentsNames[] = +static const u8 *const sBlenderOpponentsNames[] = { [BLENDER_MISTER] = sText_Mister, [BLENDER_LADDIE] = sText_Laddie, @@ -1145,7 +1145,7 @@ static void CB2_LoadBerryBlender(void) #define sYDownSpeed data[7] // For throwing berries into the machine -static void SpriteCB_Berry(struct Sprite* sprite) +static void SpriteCB_Berry(struct Sprite *sprite) { sprite->sX += sprite->sXSpeed; sprite->sY -= sprite->sYUpSpeed; @@ -1166,7 +1166,7 @@ static void SpriteCB_Berry(struct Sprite* sprite) sprite->y = sprite->sY; } -static void SetBerrySpriteData(struct Sprite* sprite, s16 x, s16 y, s16 bounceSpeed, s16 xSpeed, s16 ySpeed) +static void SetBerrySpriteData(struct Sprite *sprite, s16 x, s16 y, s16 bounceSpeed, s16 xSpeed, s16 ySpeed) { sprite->sTargetY = y; sprite->sX = x; @@ -2260,7 +2260,7 @@ static bool8 AreBlenderBerriesSame(struct BlenderBerry* berries, u8 a, u8 b) return FALSE; } -static u32 CalculatePokeblockColor(struct BlenderBerry* berries, s16* _flavors, u8 numPlayers, u8 negativeFlavors) +static u32 CalculatePokeblockColor(struct BlenderBerry* berries, s16 *_flavors, u8 numPlayers, u8 negativeFlavors) { s16 flavors[FLAVOR_COUNT + 1]; s32 i, j; @@ -2494,7 +2494,7 @@ static void CalculatePokeblock(struct BlenderBerry *berries, struct Pokeblock *p } // Unused -static void Debug_CalculatePokeblock(struct BlenderBerry* berries, struct Pokeblock* pokeblock, u8 numPlayers, u8* flavors, u16 maxRPM) +static void Debug_CalculatePokeblock(struct BlenderBerry* berries, struct Pokeblock* pokeblock, u8 numPlayers, u8 *flavors, u16 maxRPM) { CalculatePokeblock(berries, pokeblock, numPlayers, flavors, maxRPM); } @@ -2628,7 +2628,7 @@ static void CB2_EndBlenderGame(void) if (gReceivedRemoteLinkPlayers && gWirelessCommType) { - struct BlenderGameBlock *receivedBlock = (struct BlenderGameBlock*)(&gBlockRecvBuffer); + struct BlenderGameBlock *receivedBlock = (struct BlenderGameBlock *)(&gBlockRecvBuffer); sBerryBlender->maxRPM = receivedBlock->timeRPM.maxRPM; sBerryBlender->gameFrameTime = receivedBlock->timeRPM.time; @@ -2641,7 +2641,7 @@ static void CB2_EndBlenderGame(void) } else { - struct TimeAndRPM *receivedBlock = (struct TimeAndRPM*)(&gBlockRecvBuffer); + struct TimeAndRPM *receivedBlock = (struct TimeAndRPM *)(&gBlockRecvBuffer); sBerryBlender->maxRPM = receivedBlock->maxRPM; sBerryBlender->gameFrameTime = receivedBlock->time; @@ -3159,7 +3159,7 @@ static void SetBgPos(void) SetGpuReg(REG_OFFSET_BG0VOFS, sBerryBlender->bg_Y); } -static void SpriteCB_Particle(struct Sprite* sprite) +static void SpriteCB_Particle(struct Sprite *sprite) { sprite->data[2] += sprite->data[0]; sprite->data[3] += sprite->data[1]; @@ -3194,7 +3194,7 @@ static void CreateParticleSprites(void) } } -static void SpriteCB_ScoreSymbol(struct Sprite* sprite) +static void SpriteCB_ScoreSymbol(struct Sprite *sprite) { sprite->data[0]++; sprite->y2 = -(sprite->data[0] / 3); @@ -3203,7 +3203,7 @@ static void SpriteCB_ScoreSymbol(struct Sprite* sprite) DestroySprite(sprite); } -static void SpriteCB_ScoreSymbolBest(struct Sprite* sprite) +static void SpriteCB_ScoreSymbolBest(struct Sprite *sprite) { sprite->data[0]++; sprite->y2 = -(sprite->data[0] * 2); @@ -3225,7 +3225,7 @@ static void SetPlayerBerryData(u8 playerId, u16 itemId) #define sDelay data[2] #define sAnimId data[3] -static void SpriteCB_CountdownNumber(struct Sprite* sprite) +static void SpriteCB_CountdownNumber(struct Sprite *sprite) { switch (sprite->sState) { @@ -3272,7 +3272,7 @@ static void SpriteCB_CountdownNumber(struct Sprite* sprite) #undef sDelay #undef sAnimId -static void SpriteCB_Start(struct Sprite* sprite) +static void SpriteCB_Start(struct Sprite *sprite) { switch (sprite->data[0]) { @@ -3318,7 +3318,7 @@ static void UpdateProgressBar(u16 value, u16 limit) s32 amountFilled, maxFilledSegment, subSegmentsFilled, i; u16 *vram; - vram = (u16*)(BG_SCREEN_ADDR(12)); + vram = (u16 *)(BG_SCREEN_ADDR(12)); amountFilled = (value * 64) / limit; maxFilledSegment = amountFilled / 8; @@ -3368,22 +3368,22 @@ static void UpdateRPM(u16 speed) digits[i] = currentRPM % 10; currentRPM /= 10; } - *((u16*)(BG_SCREEN_ADDR(12) + 0x458)) = digits[4] + RPM_DIGIT; - *((u16*)(BG_SCREEN_ADDR(12) + 0x45A)) = digits[3] + RPM_DIGIT; - *((u16*)(BG_SCREEN_ADDR(12) + 0x45C)) = digits[2] + RPM_DIGIT; - *((u16*)(BG_SCREEN_ADDR(12) + 0x460)) = digits[1] + RPM_DIGIT; - *((u16*)(BG_SCREEN_ADDR(12) + 0x462)) = digits[0] + RPM_DIGIT; + *((u16 *)(BG_SCREEN_ADDR(12) + 0x458)) = digits[4] + RPM_DIGIT; + *((u16 *)(BG_SCREEN_ADDR(12) + 0x45A)) = digits[3] + RPM_DIGIT; + *((u16 *)(BG_SCREEN_ADDR(12) + 0x45C)) = digits[2] + RPM_DIGIT; + *((u16 *)(BG_SCREEN_ADDR(12) + 0x460)) = digits[1] + RPM_DIGIT; + *((u16 *)(BG_SCREEN_ADDR(12) + 0x462)) = digits[0] + RPM_DIGIT; } // Passed a pointer to the bg x/y // Used when hitting a Best at high RPM -static void ShakeBgCoordForHit(s16* coord, u16 speed) +static void ShakeBgCoordForHit(s16 *coord, u16 speed) { if (*coord == 0) *coord = (Random() % speed) - (speed / 2); } -static void RestoreBgCoord(s16* coord) +static void RestoreBgCoord(s16 *coord) { if (*coord < 0) (*coord)++; @@ -3398,7 +3398,7 @@ static void RestoreBgCoords(void) RestoreBgCoord(&sBerryBlender->bg_Y); } -static void BlenderLandShakeBgCoord(s16* coord, u16 timer) +static void BlenderLandShakeBgCoord(s16 *coord, u16 timer) { s32 strength; @@ -3443,7 +3443,7 @@ static bool8 UpdateBlenderLandScreenShake(void) return FALSE; } -static void SpriteCB_PlayerArrow(struct Sprite* sprite) +static void SpriteCB_PlayerArrow(struct Sprite *sprite) { sprite->x2 = -(sBerryBlender->bg_X); sprite->y2 = -(sBerryBlender->bg_Y); diff --git a/src/berry_crush.c b/src/berry_crush.c index ffc708e6b..88321e68d 100755 --- a/src/berry_crush.c +++ b/src/berry_crush.c @@ -874,7 +874,7 @@ static const struct DigitObjUtilTemplate sDigitObjTemplates[] = .xDelta = 8, .x = 156, .y = 0, - .spriteSheet = (void*) &sSpriteSheets[3], + .spriteSheet = (void *) &sSpriteSheets[3], .spritePal = &sSpritePals[2], }, { // Seconds @@ -886,7 +886,7 @@ static const struct DigitObjUtilTemplate sDigitObjTemplates[] = .xDelta = 8, .x = 180, .y = 0, - .spriteSheet = (void*) &sSpriteSheets[3], + .spriteSheet = (void *) &sSpriteSheets[3], .spritePal = &sSpritePals[2], }, { // 1/60ths of a second @@ -898,7 +898,7 @@ static const struct DigitObjUtilTemplate sDigitObjTemplates[] = .xDelta = 8, .x = 204, .y = 0, - .spriteSheet = (void*) &sSpriteSheets[3], + .spriteSheet = (void *) &sSpriteSheets[3], .spritePal = &sSpritePals[2], } }; diff --git a/src/cable_club.c b/src/cable_club.c index 5c7d32d4b..da32cee9c 100644 --- a/src/cable_club.c +++ b/src/cable_club.c @@ -833,7 +833,7 @@ static void SetLinkBattleTypeFlags(int linkService) static void Task_StartWiredCableClubBattle(u8 taskId) { - struct Task* task = &gTasks[taskId]; + struct Task *task = &gTasks[taskId]; switch (task->tState) { @@ -879,7 +879,7 @@ static void Task_StartWiredCableClubBattle(u8 taskId) static void Task_StartWirelessCableClubBattle(u8 taskId) { int i; - s16* data = gTasks[taskId].data; + s16 *data = gTasks[taskId].data; switch (tState) { @@ -1042,7 +1042,7 @@ void ExitLinkRoom(void) // Note: gSpecialVar_0x8005 contains the id of the seat the player entered static void Task_EnterCableClubSeat(u8 taskId) { - struct Task* task = &gTasks[taskId]; + struct Task *task = &gTasks[taskId]; switch (task->tState) { diff --git a/src/contest.c b/src/contest.c index edaaef7f8..ae0b5c8c1 100644 --- a/src/contest.c +++ b/src/contest.c @@ -859,19 +859,19 @@ static const struct CompressedSpriteSheet sSpriteSheets_ContestantsTurnBlinkEffe static const struct SpritePalette sSpritePalettes_ContestantsTurnBlinkEffect[CONTESTANT_COUNT] = { { - .data = (u16*)(gHeap + 0x1A0A4), + .data = (u16 *)(gHeap + 0x1A0A4), .tag = TAG_BLINK_EFFECT_CONTESTANT0 }, { - .data = (u16*)(gHeap + 0x1A0C4), + .data = (u16 *)(gHeap + 0x1A0C4), .tag = TAG_BLINK_EFFECT_CONTESTANT1 }, { - .data = (u16*)(gHeap + 0x1A0E4), + .data = (u16 *)(gHeap + 0x1A0E4), .tag = TAG_BLINK_EFFECT_CONTESTANT2 }, { - .data = (u16*)(gHeap + 0x1A104), + .data = (u16 *)(gHeap + 0x1A104), .tag = TAG_BLINK_EFFECT_CONTESTANT3 } }; @@ -1396,7 +1396,7 @@ static void Task_RaiseCurtainAtStart(u8 taskId) gTasks[taskId].data[0]++; break; case 1: - *(s16*)&gBattle_BG1_Y += 7; + *(s16 *)&gBattle_BG1_Y += 7; if ((s16)gBattle_BG1_Y <= DISPLAY_HEIGHT) break; gTasks[taskId].data[0]++; diff --git a/src/contest_util.c b/src/contest_util.c index ddec85b2a..941a691a1 100644 --- a/src/contest_util.c +++ b/src/contest_util.c @@ -1196,7 +1196,7 @@ static s32 DrawResultsTextWindow(const u8 *text, u8 spriteId) spriteTilePtrs[0] = (u8 *)(sprite->oam.tileNum * 32 + OBJ_VRAM0); for (i = 1; i < (int)ARRAY_COUNT(spriteTilePtrs); i++) - spriteTilePtrs[i] = (void*)(gSprites[sprite->data[i - 1]].oam.tileNum * 32 + OBJ_VRAM0); + spriteTilePtrs[i] = (void *)(gSprites[sprite->data[i - 1]].oam.tileNum * 32 + OBJ_VRAM0); for (i = 0; i < (int)ARRAY_COUNT(spriteTilePtrs); i++) CpuFill32(0, spriteTilePtrs[i], 0x400); diff --git a/src/decompress.c b/src/decompress.c index 92c840a63..6e94a5475 100644 --- a/src/decompress.c +++ b/src/decompress.c @@ -46,7 +46,7 @@ void LoadCompressedSpritePalette(const struct CompressedSpritePalette *src) struct SpritePalette dest; LZ77UnCompWram(src->data, gDecompressionBuffer); - dest.data = (void*) gDecompressionBuffer; + dest.data = (void *) gDecompressionBuffer; dest.tag = src->tag; LoadSpritePalette(&dest); } @@ -61,7 +61,7 @@ void LoadCompressedSpritePaletteOverrideBuffer(const struct CompressedSpritePale LoadSpritePalette(&dest); } -void DecompressPicFromTable(const struct CompressedSpriteSheet *src, void* buffer, s32 species) +void DecompressPicFromTable(const struct CompressedSpriteSheet *src, void *buffer, s32 species) { if (species > NUM_SPECIES) LZ77UnCompWram(gMonFrontPicTable[0].data, buffer); @@ -263,12 +263,12 @@ u32 GetDecompressedDataSize(const u32 *ptr) return (ptr8[3] << 16) | (ptr8[2] << 8) | (ptr8[1]); } -bool8 LoadCompressedSpriteSheetUsingHeap(const struct CompressedSpriteSheet* src) +bool8 LoadCompressedSpriteSheetUsingHeap(const struct CompressedSpriteSheet *src) { struct SpriteSheet dest; - void* buffer; + void *buffer; - buffer = AllocZeroed(*((u32*)(&src->data[0])) >> 8); + buffer = AllocZeroed(*((u32 *)(&src->data[0])) >> 8); LZ77UnCompWram(src->data, buffer); dest.data = buffer; @@ -283,9 +283,9 @@ bool8 LoadCompressedSpriteSheetUsingHeap(const struct CompressedSpriteSheet* src bool8 LoadCompressedSpritePaletteUsingHeap(const struct CompressedSpritePalette *src) { struct SpritePalette dest; - void* buffer; + void *buffer; - buffer = AllocZeroed(*((u32*)(&src->data[0])) >> 8); + buffer = AllocZeroed(*((u32 *)(&src->data[0])) >> 8); LZ77UnCompWram(src->data, buffer); dest.data = buffer; dest.tag = src->tag; @@ -295,7 +295,7 @@ bool8 LoadCompressedSpritePaletteUsingHeap(const struct CompressedSpritePalette return FALSE; } -void DecompressPicFromTable_2(const struct CompressedSpriteSheet *src, void* buffer, s32 species) // a copy of DecompressPicFromTable +void DecompressPicFromTable_2(const struct CompressedSpriteSheet *src, void *buffer, s32 species) // a copy of DecompressPicFromTable { if (species > NUM_SPECIES) LZ77UnCompWram(gMonFrontPicTable[0].data, buffer); @@ -342,7 +342,7 @@ void HandleLoadSpecialPokePic_2(const struct CompressedSpriteSheet *src, void *d LoadSpecialPokePic_2(src, dest, species, personality, isFrontPic); } -void DecompressPicFromTable_DontHandleDeoxys(const struct CompressedSpriteSheet *src, void* buffer, s32 species) +void DecompressPicFromTable_DontHandleDeoxys(const struct CompressedSpriteSheet *src, void *buffer, s32 species) { if (species > NUM_SPECIES) LZ77UnCompWram(gMonFrontPicTable[0].data, buffer); diff --git a/src/digit_obj_util.c b/src/digit_obj_util.c index f887dafb9..f68f0446c 100644 --- a/src/digit_obj_util.c +++ b/src/digit_obj_util.c @@ -138,7 +138,7 @@ bool32 DigitObjUtil_CreatePrinter(u32 id, s32 num, const struct DigitObjUtilTemp { struct CompressedSpriteSheet compSpriteSheet; - compSpriteSheet = *(struct CompressedSpriteSheet*)(template->spriteSheet); + compSpriteSheet = *(struct CompressedSpriteSheet *)(template->spriteSheet); compSpriteSheet.size = GetDecompressedDataSize(template->spriteSheet->data); sOamWork->array[id].tileStart = LoadCompressedSpriteSheet(&compSpriteSheet); } diff --git a/src/dodrio_berry_picking.c b/src/dodrio_berry_picking.c index b87fe3092..4c84f378d 100644 --- a/src/dodrio_berry_picking.c +++ b/src/dodrio_berry_picking.c @@ -323,7 +323,7 @@ static bool32 TryPickBerry(u8, u8, u8); static void UpdateFallingBerries(void); static void UpdateGame_Leader(void); static void UpdateGame_Member(void); -static void GetActiveBerryColumns(u8, u8*, u8*); +static void GetActiveBerryColumns(u8, u8 *, u8 *); static bool32 AllPlayersReadyToStart(void); static void ResetReadyToStart(void); static bool32 ReadyToEndGame_Leader(void); @@ -1795,7 +1795,7 @@ static void VBlankCB_DodrioGame(void) ProcessSpriteCopyRequests(); } -static void InitMonInfo(struct DodrioGame_MonInfo * monInfo, struct Pokemon * mon) +static void InitMonInfo(struct DodrioGame_MonInfo * monInfo, struct Pokemon *mon) { monInfo->isShiny = IsMonShiny(mon); } diff --git a/src/egg_hatch.c b/src/egg_hatch.c index 5dd83c9b1..cd6889979 100644 --- a/src/egg_hatch.c +++ b/src/egg_hatch.c @@ -69,14 +69,14 @@ extern const u8 gText_NicknameHatchPrompt[]; static void Task_EggHatch(u8); static void CB2_LoadEggHatch(void); static void CB2_EggHatch(void); -static void SpriteCB_Egg_Shake1(struct Sprite*); -static void SpriteCB_Egg_Shake2(struct Sprite*); -static void SpriteCB_Egg_Shake3(struct Sprite*); -static void SpriteCB_Egg_WaitHatch(struct Sprite*); -static void SpriteCB_Egg_Hatch(struct Sprite*); -static void SpriteCB_Egg_Reveal(struct Sprite*); -static void SpriteCB_EggShard(struct Sprite*); -static void EggHatchPrintMessage(u8, u8*, u8, u8, u8); +static void SpriteCB_Egg_Shake1(struct Sprite *); +static void SpriteCB_Egg_Shake2(struct Sprite *); +static void SpriteCB_Egg_Shake3(struct Sprite *); +static void SpriteCB_Egg_WaitHatch(struct Sprite *); +static void SpriteCB_Egg_Hatch(struct Sprite *); +static void SpriteCB_Egg_Reveal(struct Sprite *); +static void SpriteCB_EggShard(struct Sprite *); +static void EggHatchPrintMessage(u8, u8 *, u8, u8, u8); static void CreateRandomEggShardSprite(void); static void CreateEggShardSprite(u8, u8, s16, s16, s16, u8); @@ -363,7 +363,7 @@ static void AddHatchedMonToParty(u8 id) u16 ball; u16 metLevel; u8 metLocation; - struct Pokemon* mon = &gPlayerParty[id]; + struct Pokemon *mon = &gPlayerParty[id]; CreateHatchedMon(mon, &gEnemyParty[0]); SetMonData(mon, MON_DATA_IS_EGG, &isEgg); @@ -420,11 +420,11 @@ bool8 CheckDaycareMonReceivedMail(void) return _CheckDaycareMonReceivedMail(&gSaveBlock1Ptr->daycare, gSpecialVar_0x8004); } -static u8 EggHatchCreateMonSprite(u8 useAlt, u8 state, u8 partyId, u16* speciesLoc) +static u8 EggHatchCreateMonSprite(u8 useAlt, u8 state, u8 partyId, u16 *speciesLoc) { u8 position = 0; u8 spriteId = 0; - struct Pokemon* mon = NULL; + struct Pokemon *mon = NULL; if (useAlt == FALSE) { @@ -728,7 +728,7 @@ static void CB2_EggHatch(void) #define sSinIdx data[1] #define sDelayTimer data[2] -static void SpriteCB_Egg_Shake1(struct Sprite* sprite) +static void SpriteCB_Egg_Shake1(struct Sprite *sprite) { if (++sprite->sTimer > 20) { @@ -750,7 +750,7 @@ static void SpriteCB_Egg_Shake1(struct Sprite* sprite) } } -static void SpriteCB_Egg_Shake2(struct Sprite* sprite) +static void SpriteCB_Egg_Shake2(struct Sprite *sprite) { if (++sprite->sDelayTimer > 30) { @@ -775,7 +775,7 @@ static void SpriteCB_Egg_Shake2(struct Sprite* sprite) } } -static void SpriteCB_Egg_Shake3(struct Sprite* sprite) +static void SpriteCB_Egg_Shake3(struct Sprite *sprite) { if (++sprite->sDelayTimer > 30) { @@ -813,7 +813,7 @@ static void SpriteCB_Egg_Shake3(struct Sprite* sprite) } } -static void SpriteCB_Egg_WaitHatch(struct Sprite* sprite) +static void SpriteCB_Egg_WaitHatch(struct Sprite *sprite) { if (++sprite->sTimer > 50) { @@ -822,7 +822,7 @@ static void SpriteCB_Egg_WaitHatch(struct Sprite* sprite) } } -static void SpriteCB_Egg_Hatch(struct Sprite* sprite) +static void SpriteCB_Egg_Hatch(struct Sprite *sprite) { s16 i; @@ -849,7 +849,7 @@ static void SpriteCB_Egg_Hatch(struct Sprite* sprite) } } -static void SpriteCB_Egg_Reveal(struct Sprite* sprite) +static void SpriteCB_Egg_Reveal(struct Sprite *sprite) { if (sprite->sTimer == 0) { @@ -877,7 +877,7 @@ static void SpriteCB_Egg_Reveal(struct Sprite* sprite) #define sDeltaX data[4] #define sDeltaY data[5] -static void SpriteCB_EggShard(struct Sprite* sprite) +static void SpriteCB_EggShard(struct Sprite *sprite) { sprite->sDeltaX += sprite->sVelocX; sprite->sDeltaY += sprite->sVelocY; @@ -914,7 +914,7 @@ static void CreateEggShardSprite(u8 x, u8 y, s16 velocityX, s16 velocityY, s16 a StartSpriteAnim(&gSprites[spriteId], spriteAnimIndex); } -static void EggHatchPrintMessage(u8 windowId, u8* string, u8 x, u8 y, u8 speed) +static void EggHatchPrintMessage(u8 windowId, u8 *string, u8 x, u8 y, u8 speed) { FillWindowPixelBuffer(windowId, PIXEL_FILL(15)); sEggHatchData->textColor[0] = 0; diff --git a/src/ereader_screen.c b/src/ereader_screen.c index a22b85bab..3baff84a8 100755 --- a/src/ereader_screen.c +++ b/src/ereader_screen.c @@ -397,8 +397,8 @@ static void Task_EReader(u8 taskId) break; case ER_STATE_CONNECTING: AddTextPrinterToWindow1(gJPText_Connecting); - // XXX: This (u32*) cast is discarding the const qualifier from gMultiBootProgram_EReader_Start - EReader_Load(&gEReaderData, gMultiBootProgram_EReader_End - gMultiBootProgram_EReader_Start, (u32*)gMultiBootProgram_EReader_Start); + // XXX: This (u32 *) cast is discarding the const qualifier from gMultiBootProgram_EReader_Start + EReader_Load(&gEReaderData, gMultiBootProgram_EReader_End - gMultiBootProgram_EReader_Start, (u32 *)gMultiBootProgram_EReader_Start); data->state = ER_STATE_TRANSFER; break; case ER_STATE_TRANSFER: diff --git a/src/event_object_movement.c b/src/event_object_movement.c index 90e713e63..7ea712be6 100644 --- a/src/event_object_movement.c +++ b/src/event_object_movement.c @@ -93,33 +93,33 @@ static bool8 IsMetatileDirectionallyImpassable(struct ObjectEvent *, s16, s16, u static bool8 DoesObjectCollideWithObjectAt(struct ObjectEvent *, s16, s16); static void UpdateObjectEventOffscreen(struct ObjectEvent *, struct Sprite *); static void UpdateObjectEventSpriteVisibility(struct ObjectEvent *, struct Sprite *); -static void ObjectEventUpdateMetatileBehaviors(struct ObjectEvent*); -static void GetGroundEffectFlags_Reflection(struct ObjectEvent*, u32*); -static void GetGroundEffectFlags_TallGrassOnSpawn(struct ObjectEvent*, u32*); -static void GetGroundEffectFlags_LongGrassOnSpawn(struct ObjectEvent*, u32*); -static void GetGroundEffectFlags_SandHeap(struct ObjectEvent*, u32*); -static void GetGroundEffectFlags_ShallowFlowingWater(struct ObjectEvent*, u32*); -static void GetGroundEffectFlags_ShortGrass(struct ObjectEvent*, u32*); -static void GetGroundEffectFlags_HotSprings(struct ObjectEvent*, u32*); -static void GetGroundEffectFlags_TallGrassOnBeginStep(struct ObjectEvent*, u32*); -static void GetGroundEffectFlags_LongGrassOnBeginStep(struct ObjectEvent*, u32*); -static void GetGroundEffectFlags_Tracks(struct ObjectEvent*, u32*); -static void GetGroundEffectFlags_Puddle(struct ObjectEvent*, u32*); -static void GetGroundEffectFlags_Ripple(struct ObjectEvent*, u32*); -static void GetGroundEffectFlags_Seaweed(struct ObjectEvent*, u32*); -static void GetGroundEffectFlags_JumpLanding(struct ObjectEvent*, u32*); -static u8 ObjectEventGetNearbyReflectionType(struct ObjectEvent*); +static void ObjectEventUpdateMetatileBehaviors(struct ObjectEvent *); +static void GetGroundEffectFlags_Reflection(struct ObjectEvent *, u32 *); +static void GetGroundEffectFlags_TallGrassOnSpawn(struct ObjectEvent *, u32 *); +static void GetGroundEffectFlags_LongGrassOnSpawn(struct ObjectEvent *, u32 *); +static void GetGroundEffectFlags_SandHeap(struct ObjectEvent *, u32 *); +static void GetGroundEffectFlags_ShallowFlowingWater(struct ObjectEvent *, u32 *); +static void GetGroundEffectFlags_ShortGrass(struct ObjectEvent *, u32 *); +static void GetGroundEffectFlags_HotSprings(struct ObjectEvent *, u32 *); +static void GetGroundEffectFlags_TallGrassOnBeginStep(struct ObjectEvent *, u32 *); +static void GetGroundEffectFlags_LongGrassOnBeginStep(struct ObjectEvent *, u32 *); +static void GetGroundEffectFlags_Tracks(struct ObjectEvent *, u32 *); +static void GetGroundEffectFlags_Puddle(struct ObjectEvent *, u32 *); +static void GetGroundEffectFlags_Ripple(struct ObjectEvent *, u32 *); +static void GetGroundEffectFlags_Seaweed(struct ObjectEvent *, u32 *); +static void GetGroundEffectFlags_JumpLanding(struct ObjectEvent *, u32 *); +static u8 ObjectEventGetNearbyReflectionType(struct ObjectEvent *); static u8 GetReflectionTypeByMetatileBehavior(u32); static void InitObjectPriorityByElevation(struct Sprite *, u8); -static void ObjectEventUpdateSubpriority(struct ObjectEvent*, struct Sprite*); -static void DoTracksGroundEffect_None(struct ObjectEvent*, struct Sprite*, u8); -static void DoTracksGroundEffect_Footprints(struct ObjectEvent*, struct Sprite*, u8); -static void DoTracksGroundEffect_BikeTireTracks(struct ObjectEvent*, struct Sprite*, u8); -static void DoRippleFieldEffect(struct ObjectEvent*, struct Sprite*); -static void DoGroundEffects_OnSpawn(struct ObjectEvent*, struct Sprite*); -static void DoGroundEffects_OnBeginStep(struct ObjectEvent*, struct Sprite*); -static void DoGroundEffects_OnFinishStep(struct ObjectEvent*, struct Sprite*); -static void VirtualObject_UpdateAnim(struct Sprite*); +static void ObjectEventUpdateSubpriority(struct ObjectEvent *, struct Sprite *); +static void DoTracksGroundEffect_None(struct ObjectEvent *, struct Sprite *, u8); +static void DoTracksGroundEffect_Footprints(struct ObjectEvent *, struct Sprite *, u8); +static void DoTracksGroundEffect_BikeTireTracks(struct ObjectEvent *, struct Sprite *, u8); +static void DoRippleFieldEffect(struct ObjectEvent *, struct Sprite *); +static void DoGroundEffects_OnSpawn(struct ObjectEvent *, struct Sprite *); +static void DoGroundEffects_OnBeginStep(struct ObjectEvent *, struct Sprite *); +static void DoGroundEffects_OnFinishStep(struct ObjectEvent *, struct Sprite *); +static void VirtualObject_UpdateAnim(struct Sprite *); static void ApplyLevitateMovement(u8); static bool8 MovementType_Disguise_Callback(struct ObjectEvent *, struct Sprite *); static bool8 MovementType_Buried_Callback(struct ObjectEvent *, struct Sprite *); @@ -1911,9 +1911,9 @@ void SetObjectInvisibility(u8 localId, u8 mapNum, u8 mapGroup, bool8 invisible) void ObjectEventGetLocalIdAndMap(struct ObjectEvent *objectEvent, void *localId, void *mapNum, void *mapGroup) { - *(u8*)(localId) = objectEvent->localId; - *(u8*)(mapNum) = objectEvent->mapNum; - *(u8*)(mapGroup) = objectEvent->mapGroup; + *(u8 *)(localId) = objectEvent->localId; + *(u8 *)(mapNum) = objectEvent->mapNum; + *(u8 *)(mapGroup) = objectEvent->mapGroup; } void AllowObjectAtPosTriggerGroundEffects(s16 x, s16 y) diff --git a/src/evolution_graphics.c b/src/evolution_graphics.c index a6b558195..01465f741 100644 --- a/src/evolution_graphics.c +++ b/src/evolution_graphics.c @@ -10,7 +10,7 @@ #include "palette.h" #include "constants/rgb.h" -static void SpriteCB_Sparkle_Dummy(struct Sprite* sprite); +static void SpriteCB_Sparkle_Dummy(struct Sprite *sprite); static void Task_Sparkles_SpiralUpward_Init(u8 taskId); static void Task_Sparkles_SpiralUpward(u8 taskId); @@ -127,7 +127,7 @@ static void SetEvoSparklesMatrices(void) #define sTrigIdx data[6] #define sTimer data[7] -static void SpriteCB_Sparkle_SpiralUpward(struct Sprite* sprite) +static void SpriteCB_Sparkle_SpiralUpward(struct Sprite *sprite) { if (sprite->y > 8) { @@ -167,7 +167,7 @@ static void CreateSparkle_SpiralUpward(u8 trigIdx) } } -static void SpriteCB_Sparkle_ArcDown(struct Sprite* sprite) +static void SpriteCB_Sparkle_ArcDown(struct Sprite *sprite) { if (sprite->y < 88) { @@ -196,7 +196,7 @@ static void CreateSparkle_ArcDown(u8 trigIdx) } } -static void SpriteCB_Sparkle_CircleInward(struct Sprite* sprite) +static void SpriteCB_Sparkle_CircleInward(struct Sprite *sprite) { if (sprite->sAmplitude > 8) { @@ -225,7 +225,7 @@ static void CreateSparkle_CircleInward(u8 trigIdx, u8 speed) } } -static void SpriteCB_Sparkle_Spray(struct Sprite* sprite) +static void SpriteCB_Sparkle_Spray(struct Sprite *sprite) { if (!(sprite->sTimer & 3)) sprite->y++; @@ -492,7 +492,7 @@ static void Task_Sparkles_SprayAndFlashTrade(u8 taskId) #undef tTimer #undef tSpecies -static void SpriteCB_EvolutionMonSprite(struct Sprite* sprite) +static void SpriteCB_EvolutionMonSprite(struct Sprite *sprite) { } diff --git a/src/evolution_scene.c b/src/evolution_scene.c index 085f88da5..48b514e63 100644 --- a/src/evolution_scene.c +++ b/src/evolution_scene.c @@ -170,7 +170,7 @@ static void CB2_BeginEvolutionScene(void) static void Task_BeginEvolutionScene(u8 taskId) { - struct Pokemon* mon = NULL; + struct Pokemon *mon = NULL; switch (gTasks[taskId].tState) { case 0: @@ -196,7 +196,7 @@ static void Task_BeginEvolutionScene(u8 taskId) } } -void BeginEvolutionScene(struct Pokemon* mon, u16 postEvoSpecies, bool8 canStopEvo, u8 partyId) +void BeginEvolutionScene(struct Pokemon *mon, u16 postEvoSpecies, bool8 canStopEvo, u8 partyId) { u8 taskId = CreateTask(Task_BeginEvolutionScene, 0); gTasks[taskId].tState = 0; @@ -206,7 +206,7 @@ void BeginEvolutionScene(struct Pokemon* mon, u16 postEvoSpecies, bool8 canStopE SetMainCallback2(CB2_BeginEvolutionScene); } -void EvolutionScene(struct Pokemon* mon, u16 postEvoSpecies, bool8 canStopEvo, u8 partyId) +void EvolutionScene(struct Pokemon *mon, u16 postEvoSpecies, bool8 canStopEvo, u8 partyId) { u8 name[20]; u16 currSpecies; @@ -216,7 +216,7 @@ void EvolutionScene(struct Pokemon* mon, u16 postEvoSpecies, bool8 canStopEvo, u SetHBlankCallback(NULL); SetVBlankCallback(NULL); - CpuFill32(0, (void*)(VRAM), VRAM_SIZE); + CpuFill32(0, (void *)(VRAM), VRAM_SIZE); SetGpuReg(REG_OFFSET_MOSAIC, 0); SetGpuReg(REG_OFFSET_WIN0H, 0); @@ -314,7 +314,7 @@ static void CB2_EvolutionSceneLoadGraphics(void) const struct CompressedSpritePalette* pokePal; u16 postEvoSpecies; u32 trainerId, personality; - struct Pokemon* mon = &gPlayerParty[gTasks[sEvoStructPtr->evoTaskId].tPartyId]; + struct Pokemon *mon = &gPlayerParty[gTasks[sEvoStructPtr->evoTaskId].tPartyId]; postEvoSpecies = gTasks[sEvoStructPtr->evoTaskId].tPostEvoSpecies; trainerId = GetMonData(mon, MON_DATA_OT_ID); @@ -322,7 +322,7 @@ static void CB2_EvolutionSceneLoadGraphics(void) SetHBlankCallback(NULL); SetVBlankCallback(NULL); - CpuFill32(0, (void*)(VRAM), VRAM_SIZE); + CpuFill32(0, (void *)(VRAM), VRAM_SIZE); SetGpuReg(REG_OFFSET_MOSAIC, 0); SetGpuReg(REG_OFFSET_WIN0H, 0); @@ -381,7 +381,7 @@ static void CB2_EvolutionSceneLoadGraphics(void) static void CB2_TradeEvolutionSceneLoadGraphics(void) { - struct Pokemon* mon = &gPlayerParty[gTasks[sEvoStructPtr->evoTaskId].tPartyId]; + struct Pokemon *mon = &gPlayerParty[gTasks[sEvoStructPtr->evoTaskId].tPartyId]; u16 postEvoSpecies = gTasks[sEvoStructPtr->evoTaskId].tPostEvoSpecies; switch (gMain.state) @@ -410,7 +410,7 @@ static void CB2_TradeEvolutionSceneLoadGraphics(void) gMain.state++; break; case 2: - InitTradeBg(); + LoadTradeAnimGfx(); gMain.state++; break; case 3: @@ -465,7 +465,7 @@ static void CB2_TradeEvolutionSceneLoadGraphics(void) } } -void TradeEvolutionScene(struct Pokemon* mon, u16 postEvoSpecies, u8 preEvoSpriteId, u8 partyId) +void TradeEvolutionScene(struct Pokemon *mon, u16 postEvoSpecies, u8 preEvoSpriteId, u8 partyId) { u8 name[20]; u16 currSpecies; @@ -545,13 +545,13 @@ static void CB2_TradeEvolutionSceneUpdate(void) RunTasks(); } -static void CreateShedinja(u16 preEvoSpecies, struct Pokemon* mon) +static void CreateShedinja(u16 preEvoSpecies, struct Pokemon *mon) { u32 data = 0; if (gEvolutionTable[preEvoSpecies][0].method == EVO_LEVEL_NINJASK && gPlayerPartyCount < PARTY_SIZE) { s32 i; - struct Pokemon* shedinja = &gPlayerParty[gPlayerPartyCount]; + struct Pokemon *shedinja = &gPlayerParty[gPlayerPartyCount]; CopyMon(&gPlayerParty[gPlayerPartyCount], mon, sizeof(struct Pokemon)); SetMonData(&gPlayerParty[gPlayerPartyCount], MON_DATA_SPECIES, &gEvolutionTable[preEvoSpecies][1].targetSpecies); @@ -632,7 +632,7 @@ enum { static void Task_EvolutionScene(u8 taskId) { u32 var; - struct Pokemon* mon = &gPlayerParty[gTasks[taskId].tPartyId]; + struct Pokemon *mon = &gPlayerParty[gTasks[taskId].tPartyId]; // check if B Button was held, so the evolution gets stopped if (gMain.heldKeys == B_BUTTON @@ -761,7 +761,7 @@ static void Task_EvolutionScene(u8 taskId) BattlePutTextOnWindow(gStringVar4, B_WIN_MSG); PlayBGM(MUS_EVOLVED); gTasks[taskId].tState++; - SetMonData(mon, MON_DATA_SPECIES, (void*)(&gTasks[taskId].tPostEvoSpecies)); + SetMonData(mon, MON_DATA_SPECIES, (void *)(&gTasks[taskId].tPostEvoSpecies)); CalculateMonStats(mon); EvolutionRenameMon(mon, gTasks[taskId].tPreEvoSpecies, gTasks[taskId].tPostEvoSpecies); GetSetPokedexFlag(SpeciesToNationalPokedexNum(gTasks[taskId].tPostEvoSpecies), FLAG_SET_SEEN); @@ -1081,7 +1081,7 @@ enum { static void Task_TradeEvolutionScene(u8 taskId) { u32 var = 0; - struct Pokemon* mon = &gPlayerParty[gTasks[taskId].tPartyId]; + struct Pokemon *mon = &gPlayerParty[gTasks[taskId].tPartyId]; switch (gTasks[taskId].tState) { diff --git a/src/faraway_island.c b/src/faraway_island.c index 9ddb66de5..4f34cf30e 100755 --- a/src/faraway_island.c +++ b/src/faraway_island.c @@ -10,10 +10,10 @@ #include "constants/metatile_behaviors.h" static u8 GetValidMewMoveDirection(u8); -static bool8 ShouldMewMoveNorth(struct ObjectEvent*, u8); -static bool8 ShouldMewMoveSouth(struct ObjectEvent*, u8); -static bool8 ShouldMewMoveEast(struct ObjectEvent*, u8); -static bool8 ShouldMewMoveWest(struct ObjectEvent*, u8); +static bool8 ShouldMewMoveNorth(struct ObjectEvent *, u8); +static bool8 ShouldMewMoveSouth(struct ObjectEvent *, u8); +static bool8 ShouldMewMoveEast(struct ObjectEvent *, u8); +static bool8 ShouldMewMoveWest(struct ObjectEvent *, u8); static u8 GetRandomMewDirectionCandidate(u8); static bool8 CanMewMoveToCoords(s16, s16); diff --git a/src/field_control_avatar.c b/src/field_control_avatar.c index cdb0db6d1..ad02b00c1 100644 --- a/src/field_control_avatar.c +++ b/src/field_control_avatar.c @@ -43,8 +43,8 @@ u8 gSelectedObjectEvent; static void GetPlayerPosition(struct MapPosition *); static void GetInFrontOfPlayerPosition(struct MapPosition *); static u16 GetPlayerCurMetatileBehavior(int); -static bool8 TryStartInteractionScript(struct MapPosition*, u16, u8); -static const u8 *GetInteractionScript(struct MapPosition*, u8, u8); +static bool8 TryStartInteractionScript(struct MapPosition *, u16, u8); +static const u8 *GetInteractionScript(struct MapPosition *, u8, u8); static const u8 *GetInteractedObjectEventScript(struct MapPosition *, u8, u8); static const u8 *GetInteractedBackgroundEventScript(struct MapPosition *, u8, u8); static const u8 *GetInteractedMetatileScript(struct MapPosition *, u8, u8); diff --git a/src/field_effect.c b/src/field_effect.c index ea0374e1e..0bf204631 100644 --- a/src/field_effect.c +++ b/src/field_effect.c @@ -146,10 +146,10 @@ static void EscapeRopeWarpInEffect_Init(struct Task *); static void EscapeRopeWarpInEffect_Spin(struct Task *); static void Task_TeleportWarpOut(u8); -static void TeleportWarpOutFieldEffect_Init(struct Task*); -static void TeleportWarpOutFieldEffect_SpinGround(struct Task*); -static void TeleportWarpOutFieldEffect_SpinExit(struct Task*); -static void TeleportWarpOutFieldEffect_End(struct Task*); +static void TeleportWarpOutFieldEffect_Init(struct Task *); +static void TeleportWarpOutFieldEffect_SpinGround(struct Task *); +static void TeleportWarpOutFieldEffect_SpinExit(struct Task *); +static void TeleportWarpOutFieldEffect_End(struct Task *); static void FieldCallback_TeleportWarpIn(void); static void Task_TeleportWarpIn(u8); @@ -223,11 +223,11 @@ static void FlyInFieldEffect_WaitBirdReturn(struct Task *); static void FlyInFieldEffect_End(struct Task *); static void Task_DestroyDeoxysRock(u8 taskId); -static void DestroyDeoxysRockEffect_CameraShake(s16*, u8); -static void DestroyDeoxysRockEffect_RockFragments(s16*, u8); -static void DestroyDeoxysRockEffect_WaitAndEnd(s16*, u8); -static void CreateDeoxysRockFragments(struct Sprite*); -static void SpriteCB_DeoxysRockFragment(struct Sprite* sprite); +static void DestroyDeoxysRockEffect_CameraShake(s16 *, u8); +static void DestroyDeoxysRockEffect_RockFragments(s16 *, u8); +static void DestroyDeoxysRockEffect_WaitAndEnd(s16 *, u8); +static void CreateDeoxysRockFragments(struct Sprite *); +static void SpriteCB_DeoxysRockFragment(struct Sprite *sprite); static void Task_MoveDeoxysRock(u8 taskId); @@ -3088,15 +3088,15 @@ u8 FldEff_RayquazaSpotlight(void) { for (j = 12; j < 18; j++) { - ((u16*)(BG_SCREEN_ADDR(31)))[i * 32 + j] = 0xBFF4 + i * 6 + j + 1; + ((u16 *)(BG_SCREEN_ADDR(31)))[i * 32 + j] = 0xBFF4 + i * 6 + j + 1; } } for (k = 0; k < 90; k++) { for (i = 0; i < 8; i++) { - *(u16*)(BG_CHAR_ADDR(2) + (k + 1) * 32 + i * 4) = (sSpotlight_Gfx[k * 32 + i * 4 + 1] << 8) + sSpotlight_Gfx[k * 32 + i * 4]; - *(u16*)(BG_CHAR_ADDR(2) + (k + 1) * 32 + i * 4 + 2) = (sSpotlight_Gfx[k * 32 + i * 4 + 3] << 8) + sSpotlight_Gfx[k * 32 + i * 4 + 2]; + *(u16 *)(BG_CHAR_ADDR(2) + (k + 1) * 32 + i * 4) = (sSpotlight_Gfx[k * 32 + i * 4 + 1] << 8) + sSpotlight_Gfx[k * 32 + i * 4]; + *(u16 *)(BG_CHAR_ADDR(2) + (k + 1) * 32 + i * 4 + 2) = (sSpotlight_Gfx[k * 32 + i * 4 + 3] << 8) + sSpotlight_Gfx[k * 32 + i * 4 + 2]; } } return spriteId; @@ -3675,7 +3675,7 @@ static void StartEndingDeoxysRockCameraShake(u8 taskId) #undef tEndDelay #undef tEnding -static void (*const sDestroyDeoxysRockEffectFuncs[])(s16*, u8) = { +static void (*const sDestroyDeoxysRockEffectFuncs[])(s16 *, u8) = { DestroyDeoxysRockEffect_CameraShake, DestroyDeoxysRockEffect_RockFragments, DestroyDeoxysRockEffect_WaitAndEnd, @@ -3689,7 +3689,7 @@ static void Task_DestroyDeoxysRock(u8 taskId) sDestroyDeoxysRockEffectFuncs[tState](data, taskId); } -static void DestroyDeoxysRockEffect_CameraShake(s16* data, u8 taskId) +static void DestroyDeoxysRockEffect_CameraShake(s16 *data, u8 taskId) { u8 newTaskId = CreateTask(Task_DeoxysRockCameraShake, 90); PlaySE(SE_THUNDER2); @@ -3697,7 +3697,7 @@ static void DestroyDeoxysRockEffect_CameraShake(s16* data, u8 taskId) tState++; } -static void DestroyDeoxysRockEffect_RockFragments(s16* data, u8 taskId) +static void DestroyDeoxysRockEffect_RockFragments(s16 *data, u8 taskId) { if (++tTimer > 120) { @@ -3713,7 +3713,7 @@ static void DestroyDeoxysRockEffect_RockFragments(s16* data, u8 taskId) } } -static void DestroyDeoxysRockEffect_WaitAndEnd(s16* data, u8 taskId) +static void DestroyDeoxysRockEffect_WaitAndEnd(s16 *data, u8 taskId) { if (!gPaletteFade.active && !FuncIsActiveTask(Task_DeoxysRockCameraShake)) { @@ -3776,7 +3776,7 @@ static const struct SpriteTemplate sSpriteTemplate_DeoxysRockFragment = { .callback = SpriteCB_DeoxysRockFragment }; -static void CreateDeoxysRockFragments(struct Sprite* sprite) +static void CreateDeoxysRockFragments(struct Sprite *sprite) { int i; int xPos = (s16)gTotalCameraPixelOffsetX + sprite->x + sprite->x2; @@ -3794,7 +3794,7 @@ static void CreateDeoxysRockFragments(struct Sprite* sprite) } } -static void SpriteCB_DeoxysRockFragment(struct Sprite* sprite) +static void SpriteCB_DeoxysRockFragment(struct Sprite *sprite) { // 1 case for each fragment, fly off in 4 different directions switch (sprite->data[0]) @@ -3820,7 +3820,7 @@ static void SpriteCB_DeoxysRockFragment(struct Sprite* sprite) DestroySprite(sprite); } -bool8 FldEff_MoveDeoxysRock(struct Sprite* sprite) +bool8 FldEff_MoveDeoxysRock(struct Sprite *sprite) { u8 objectEventIdBuffer; if (!TryGetObjectEventIdByLocalIdAndMap(gFieldEffectArguments[0], gFieldEffectArguments[1], gFieldEffectArguments[2], &objectEventIdBuffer)) diff --git a/src/field_effect_helpers.c b/src/field_effect_helpers.c index c3332c7fc..5b8123a71 100755 --- a/src/field_effect_helpers.c +++ b/src/field_effect_helpers.c @@ -1525,7 +1525,7 @@ void UpdateRayquazaSpotlightEffect(struct Sprite *sprite) { for (j = 12; j < 18; j++) { - ((u16*)(BG_SCREEN_ADDR(31)))[i * 32 + j] = 0xBFF4 + i * 6 + j + 1; + ((u16 *)(BG_SCREEN_ADDR(31)))[i * 32 + j] = 0xBFF4 + i * 6 + j + 1; } } } @@ -1611,7 +1611,7 @@ void UpdateRayquazaSpotlightEffect(struct Sprite *sprite) { for (j = 12; j < 18; j++) { - ((u16*)(BG_SCREEN_ADDR(31)))[i * 32 + j] = 0; + ((u16 *)(BG_SCREEN_ADDR(31)))[i * 32 + j] = 0; } } SetGpuReg(REG_OFFSET_BG0VOFS, 0); diff --git a/src/field_message_box.c b/src/field_message_box.c index fa792ee56..64734cc20 100755 --- a/src/field_message_box.c +++ b/src/field_message_box.c @@ -8,7 +8,7 @@ static EWRAM_DATA u8 sFieldMessageBoxMode = 0; -static void ExpandStringAndStartDrawFieldMessage(const u8*, bool32); +static void ExpandStringAndStartDrawFieldMessage(const u8 *, bool32); static void StartDrawFieldMessage(void); void InitFieldMessageBox(void) @@ -116,7 +116,7 @@ bool8 ShowFieldMessageFromBuffer(void) return TRUE; } -static void ExpandStringAndStartDrawFieldMessage(const u8* str, bool32 allowSkippingDelayWithButtonPress) +static void ExpandStringAndStartDrawFieldMessage(const u8 *str, bool32 allowSkippingDelayWithButtonPress) { StringExpandPlaceholders(gStringVar4, str); AddTextPrinterForMessage(allowSkippingDelayWithButtonPress); diff --git a/src/fieldmap.c b/src/fieldmap.c index a02355e72..581005af0 100644 --- a/src/fieldmap.c +++ b/src/fieldmap.c @@ -43,7 +43,7 @@ static void FillWestConnection(struct MapHeader const *mapHeader, struct MapHead static void FillEastConnection(struct MapHeader const *mapHeader, struct MapHeader const *connectedMapHeader, s32 offset); static void InitBackupMapLayoutConnections(struct MapHeader *mapHeader); static void LoadSavedMapView(void); -static bool8 SkipCopyingMetatileFromSavedMap(u16* mapBlock, u16 mapWidth, u8 yMode); +static bool8 SkipCopyingMetatileFromSavedMap(u16 *mapBlock, u16 mapWidth, u8 yMode); static struct MapConnection *GetIncomingConnection(u8 direction, int x, int y); static bool8 IsPosInIncomingConnectingMap(u8 direction, int x, int y, struct MapConnection *connection); static bool8 IsCoordInIncomingConnectingMap(int coord, int srcMax, int destMax, int offset); @@ -823,7 +823,7 @@ void MapGridSetMetatileImpassabilityAt(int x, int y, bool32 impassable) } } -static bool8 SkipCopyingMetatileFromSavedMap(u16* mapBlock, u16 mapWidth, u8 yMode) +static bool8 SkipCopyingMetatileFromSavedMap(u16 *mapBlock, u16 mapWidth, u8 yMode) { if (yMode == 0xFF) return FALSE; @@ -879,17 +879,17 @@ void LoadTilesetPalette(struct Tileset const *tileset, u16 destOffset, u16 size) if (tileset->isSecondary == FALSE) { LoadPalette(&black, destOffset, 2); - LoadPalette(((u16*)tileset->palettes) + 1, destOffset + 1, size - 2); + LoadPalette(((u16 *)tileset->palettes) + 1, destOffset + 1, size - 2); FieldmapPaletteDummy(destOffset + 1, (size - 2) >> 1); } else if (tileset->isSecondary == TRUE) { - LoadPalette(((u16*)tileset->palettes) + (NUM_PALS_IN_PRIMARY * 16), destOffset, size); + LoadPalette(((u16 *)tileset->palettes) + (NUM_PALS_IN_PRIMARY * 16), destOffset, size); FieldmapPaletteDummy(destOffset, size >> 1); } else { - LoadCompressedPalette((u32*)tileset->palettes, destOffset, size); + LoadCompressedPalette((u32 *)tileset->palettes, destOffset, size); FieldmapPaletteDummy(destOffset, size >> 1); } } diff --git a/src/hall_of_fame.c b/src/hall_of_fame.c index 324661489..d8c62d25e 100644 --- a/src/hall_of_fame.c +++ b/src/hall_of_fame.c @@ -101,7 +101,7 @@ static void HallOfFame_PrintMonInfo(struct HallofFameMon* currMon, u8 unused1, u static void HallOfFame_PrintWelcomeText(u8 unusedPossiblyWindowId, u8 unused2); static void HallOfFame_PrintPlayerInfo(u8 unused1, u8 unused2); static void Task_DoDomeConfetti(u8 taskId); -static void SpriteCB_HofConfetti(struct Sprite* sprite); +static void SpriteCB_HofConfetti(struct Sprite *sprite); static const struct BgTemplate sHof_BgTemplates[] = { @@ -484,7 +484,7 @@ static void Task_Hof_InitMonData(u8 taskId) static void Task_Hof_InitTeamSaveData(u8 taskId) { u16 i; - struct HallofFameTeam* lastSavedTeam = (struct HallofFameTeam*)(gDecompressionBuffer); + struct HallofFameTeam *lastSavedTeam = (struct HallofFameTeam *)(gDecompressionBuffer); if (!gHasHallOfFameRecords) { @@ -503,8 +503,8 @@ static void Task_Hof_InitTeamSaveData(u8 taskId) } if (i >= HALL_OF_FAME_MAX_TEAMS) { - struct HallofFameTeam *afterTeam = (struct HallofFameTeam*)(gDecompressionBuffer); - struct HallofFameTeam *beforeTeam = (struct HallofFameTeam*)(gDecompressionBuffer); + struct HallofFameTeam *afterTeam = (struct HallofFameTeam *)(gDecompressionBuffer); + struct HallofFameTeam *beforeTeam = (struct HallofFameTeam *)(gDecompressionBuffer); afterTeam++; for (i = 0; i < HALL_OF_FAME_MAX_TEAMS - 1; i++, beforeTeam++, afterTeam++) { @@ -821,7 +821,7 @@ void CB2_DoHallOfFamePC(void) case 3: if (!LoadHofBgs()) { - struct HallofFameTeam *fameTeam = (struct HallofFameTeam*)(gDecompressionBuffer); + struct HallofFameTeam *fameTeam = (struct HallofFameTeam *)(gDecompressionBuffer); fameTeam->mon[0] = sDummyFameMon; ComputerScreenOpenEffect(0, 0, 0); SetVBlankCallback(VBlankCB_HallOfFame); @@ -867,7 +867,7 @@ static void Task_HofPC_CopySaveData(u8 taskId) else { u16 i; - struct HallofFameTeam* savedTeams; + struct HallofFameTeam *savedTeams; CpuCopy16(gDecompressionBuffer, sHofMonPtr, SECTOR_SIZE * NUM_HOF_SECTORS); savedTeams = sHofMonPtr; @@ -890,7 +890,7 @@ static void Task_HofPC_CopySaveData(u8 taskId) static void Task_HofPC_DrawSpritesPrintText(u8 taskId) { - struct HallofFameTeam* savedTeams = sHofMonPtr; + struct HallofFameTeam *savedTeams = sHofMonPtr; struct HallofFameMon* currMon; u16 i; @@ -956,7 +956,7 @@ static void Task_HofPC_DrawSpritesPrintText(u8 taskId) static void Task_HofPC_PrintMonInfo(u8 taskId) { - struct HallofFameTeam* savedTeams = sHofMonPtr; + struct HallofFameTeam *savedTeams = sHofMonPtr; struct HallofFameMon* currMon; u16 i; u16 currMonID; @@ -1042,10 +1042,10 @@ static void Task_HofPC_HandleInput(u8 taskId) static void Task_HofPC_HandlePaletteOnExit(u8 taskId) { - struct HallofFameTeam* fameTeam; + struct HallofFameTeam *fameTeam; CpuCopy16(gPlttBufferFaded, gPlttBufferUnfaded, 0x400); - fameTeam = (struct HallofFameTeam*)(gDecompressionBuffer); + fameTeam = (struct HallofFameTeam *)(gDecompressionBuffer); fameTeam->mon[0] = sDummyFameMon; ComputerScreenCloseEffect(0, 0, 0); gTasks[taskId].func = Task_HofPC_HandleExit; @@ -1369,7 +1369,7 @@ static void SpriteCB_GetOnScreenAndAnimate(struct Sprite *sprite) #define sSineIdx data[0] #define sExtraY data[1] -static void SpriteCB_HofConfetti(struct Sprite* sprite) +static void SpriteCB_HofConfetti(struct Sprite *sprite) { if (sprite->y2 > 120) { @@ -1394,7 +1394,7 @@ static void SpriteCB_HofConfetti(struct Sprite* sprite) static bool8 CreateHofConfettiSprite(void) { u8 spriteID; - struct Sprite* sprite; + struct Sprite *sprite; s16 posX = Random() % DISPLAY_WIDTH; s16 posY = -(Random() % 8); diff --git a/src/image_processing_effects.c b/src/image_processing_effects.c index 60b105163..51a5d1399 100644 --- a/src/image_processing_effects.c +++ b/src/image_processing_effects.c @@ -28,14 +28,14 @@ static void ApplyImageEffect_PersonalityColor(u8); static void ApplyImageEffect_RedChannelGrayscale(u8); static void ApplyImageEffect_RedChannelGrayscaleHighlight(u8); static void AddPointillismPoints(u16); -static u16 ConvertColorToGrayscale(u16*); -static u16 QuantizePixel_Blur(u16*, u16*, u16*); -static u16 QuantizePixel_PersonalityColor(u16*, u8); -static u16 QuantizePixel_BlackAndWhite(u16*); -static u16 QuantizePixel_BlackOutline(u16*, u16*); -static u16 QuantizePixel_Invert(u16*); -static u16 QuantizePixel_BlurHard(u16*, u16*, u16*); -static u16 QuantizePixel_MotionBlur(u16*, u16*); +static u16 ConvertColorToGrayscale(u16 *); +static u16 QuantizePixel_Blur(u16 *, u16 *, u16 *); +static u16 QuantizePixel_PersonalityColor(u16 *, u8); +static u16 QuantizePixel_BlackAndWhite(u16 *); +static u16 QuantizePixel_BlackOutline(u16 *, u16 *); +static u16 QuantizePixel_Invert(u16 *); +static u16 QuantizePixel_BlurHard(u16 *, u16 *, u16 *); +static u16 QuantizePixel_MotionBlur(u16 *, u16 *); static u16 GetColorFromPersonality(u8); static void QuantizePalette_Standard(bool8); static void SetPresetPalette_PrimaryColors(void); @@ -46,10 +46,10 @@ static void SetPresetPalette_GrayscaleSmall(void); static void QuantizePalette_GrayscaleSmall(void); static void SetPresetPalette_BlackAndWhite(void); static void QuantizePalette_BlackAndWhite(void); -static u16 QuantizePixel_Standard(u16*); -static u16 QuantizePixel_GrayscaleSmall(u16*); -static u16 QuantizePixel_Grayscale(u16*); -static u16 QuantizePixel_PrimaryColors(u16*); +static u16 QuantizePixel_Standard(u16 *); +static u16 QuantizePixel_GrayscaleSmall(u16 *); +static u16 QuantizePixel_Grayscale(u16 *); +static u16 QuantizePixel_PrimaryColors(u16 *); #define MAX_DIMENSION 64 @@ -1091,7 +1091,7 @@ static u16 QuantizePixel_Standard(u16 *pixel) return RGB2(red, green, blue); } -static u16 QuantizePixel_PrimaryColors(u16* color) +static u16 QuantizePixel_PrimaryColors(u16 *color) { u16 red = GET_R(*color); u16 green = GET_G(*color); diff --git a/src/international_string_util.c b/src/international_string_util.c index 6a1423e5e..f71734fa7 100644 --- a/src/international_string_util.c +++ b/src/international_string_util.c @@ -48,7 +48,7 @@ int GetMaxWidthInMenuTable(const struct MenuAction *actions, int numActions) return ConvertPixelWidthToTileWidth(maxWidth); } -int GetMaxWidthInSubsetOfMenuTable(const struct MenuAction *actions, const u8* actionIds, int numActions) +int GetMaxWidthInSubsetOfMenuTable(const struct MenuAction *actions, const u8 *actionIds, int numActions) { int i, maxWidth; diff --git a/src/intro_credits_graphics.c b/src/intro_credits_graphics.c index 0942e82f1..cf193018a 100644 --- a/src/intro_credits_graphics.c +++ b/src/intro_credits_graphics.c @@ -1106,7 +1106,7 @@ static void SpriteCB_Player(struct Sprite *sprite) #define sPlayerSpriteId data[0] -static void SpriteCB_Bicycle(struct Sprite* sprite) +static void SpriteCB_Bicycle(struct Sprite *sprite) { sprite->invisible = gSprites[sprite->sPlayerSpriteId].invisible; sprite->x = gSprites[sprite->sPlayerSpriteId].x; @@ -1139,7 +1139,7 @@ static void SpriteCB_FlygonLeftHalf(struct Sprite *sprite) #define sLeftSpriteId data[0] -static void SpriteCB_FlygonRightHalf(struct Sprite* sprite) +static void SpriteCB_FlygonRightHalf(struct Sprite *sprite) { sprite->invisible = gSprites[sprite->sLeftSpriteId].invisible; sprite->y = gSprites[sprite->sLeftSpriteId].y; diff --git a/src/item_menu.c b/src/item_menu.c index fc64fdc22..526952a6b 100755 --- a/src/item_menu.c +++ b/src/item_menu.c @@ -128,7 +128,7 @@ static bool8 LoadBagMenu_Graphics(void); static void LoadBagMenuTextWindows(void); static void AllocateBagItemListBuffers(void); static void LoadBagItemListBuffers(u8); -static void PrintPocketNames(const u8*, const u8*); +static void PrintPocketNames(const u8 *, const u8 *); static void CopyPocketNameToWindow(u32); static void DrawPocketIndicatorSquare(u8, bool8); static void CreatePocketScrollArrowPair(void); @@ -138,10 +138,10 @@ static void PrepareTMHMMoveWindow(void); static bool8 IsWallysBag(void); static void Task_WallyTutorialBagMenu(u8); static void Task_BagMenu_HandleInput(u8); -static void GetItemName(s8*, u16); +static void GetItemName(s8 *, u16); static void PrintItemDescription(int); static void BagMenu_PrintCursorAtPos(u8, u8); -static void BagMenu_Print(u8, u8, const u8*, u8, u8, u8, u8, u8, u8); +static void BagMenu_Print(u8, u8, const u8 *, u8, u8, u8, u8, u8, u8); static void Task_CloseBagMenu(u8); static u8 AddItemMessageWindow(u8); static void RemoveItemMessageWindow(u8); @@ -189,7 +189,7 @@ static void InitPocketListPositions(void); static void InitPocketScrollPositions(void); static u8 CreateBagInputHandlerTask(u8); static void DrawItemListBgRow(u8); -static void BagMenu_MoveCursorCallback(s32, bool8, struct ListMenu*); +static void BagMenu_MoveCursorCallback(s32, bool8, struct ListMenu *); static void BagMenu_ItemPrintCallback(u8, u32, u8); static void ItemMenu_UseOutOfBattle(u8); static void ItemMenu_Toss(u8); @@ -1080,7 +1080,7 @@ void Task_FadeAndCloseBagMenu(u8 taskId) static void Task_CloseBagMenu(u8 taskId) { - s16* data = gTasks[taskId].data; + s16 *data = gTasks[taskId].data; if (!gPaletteFade.active) { DestroyListMenuTask(tListTaskId, &gBagPosition.scrollPosition[gBagPosition.pocket], &gBagPosition.cursorPosition[gBagPosition.pocket]); @@ -1162,7 +1162,7 @@ u8 GetItemListPosition(u8 pocketId) void DisplayItemMessage(u8 taskId, u8 fontId, const u8 *str, void (*callback)(u8 taskId)) { - s16* data = gTasks[taskId].data; + s16 *data = gTasks[taskId].data; tMsgWindowId = AddItemMessageWindow(ITEMWIN_MESSAGE); FillWindowPixelBuffer(tMsgWindowId, PIXEL_FILL(1)); @@ -1172,9 +1172,9 @@ void DisplayItemMessage(u8 taskId, u8 fontId, const u8 *str, void (*callback)(u8 void CloseItemMessage(u8 taskId) { - s16* data = gTasks[taskId].data; - u16* scrollPos = &gBagPosition.scrollPosition[gBagPosition.pocket]; - u16* cursorPos = &gBagPosition.cursorPosition[gBagPosition.pocket]; + s16 *data = gTasks[taskId].data; + u16 *scrollPos = &gBagPosition.scrollPosition[gBagPosition.pocket]; + u16 *cursorPos = &gBagPosition.cursorPosition[gBagPosition.pocket]; RemoveItemMessageWindow(ITEMWIN_MESSAGE); DestroyListMenuTask(tListTaskId, scrollPos, cursorPos); UpdatePocketItemList(gBagPosition.pocket); @@ -1210,9 +1210,9 @@ static void PrintItemSoldAmount(int windowId, int numSold, int moneyEarned) static void Task_BagMenu_HandleInput(u8 taskId) { - s16* data = gTasks[taskId].data; - u16* scrollPos = &gBagPosition.scrollPosition[gBagPosition.pocket]; - u16* cursorPos = &gBagPosition.cursorPosition[gBagPosition.pocket]; + s16 *data = gTasks[taskId].data; + u16 *scrollPos = &gBagPosition.scrollPosition[gBagPosition.pocket]; + u16 *cursorPos = &gBagPosition.cursorPosition[gBagPosition.pocket]; s32 listPosition; if (MenuHelpers_ShouldWaitForLinkRecv() != TRUE && !gPaletteFade.active) @@ -1313,7 +1313,7 @@ static void ChangeBagPocketId(u8 *bagPocketId, s8 deltaBagPocketId) static void SwitchBagPocket(u8 taskId, s16 deltaBagPocketId, bool16 skipEraseList) { - s16* data = gTasks[taskId].data; + s16 *data = gTasks[taskId].data; u8 newPocket; tPocketSwitchState = 0; @@ -1352,7 +1352,7 @@ static void SwitchBagPocket(u8 taskId, s16 deltaBagPocketId, bool16 skipEraseLis static void Task_SwitchBagPocket(u8 taskId) { - s16* data = gTasks[taskId].data; + s16 *data = gTasks[taskId].data; if (!MenuHelpers_IsLinkActive() && !IsWallysBag()) { @@ -1430,7 +1430,7 @@ static bool8 CanSwapItems(void) static void StartItemSwap(u8 taskId) { - s16* data = gTasks[taskId].data; + s16 *data = gTasks[taskId].data; ListMenuSetUnkIndicatorsStructField(tListTaskId, 16, 1); tListPosition = gBagPosition.scrollPosition[gBagPosition.pocket] + gBagPosition.cursorPosition[gBagPosition.pocket]; @@ -1447,7 +1447,7 @@ static void StartItemSwap(u8 taskId) static void Task_HandleSwappingItemsInput(u8 taskId) { - s16* data = gTasks[taskId].data; + s16 *data = gTasks[taskId].data; if (MenuHelpers_ShouldWaitForLinkRecv() != TRUE) { @@ -1485,9 +1485,9 @@ static void Task_HandleSwappingItemsInput(u8 taskId) static void DoItemSwap(u8 taskId) { - s16* data = gTasks[taskId].data; - u16* scrollPos = &gBagPosition.scrollPosition[gBagPosition.pocket]; - u16* cursorPos = &gBagPosition.cursorPosition[gBagPosition.pocket]; + s16 *data = gTasks[taskId].data; + u16 *scrollPos = &gBagPosition.scrollPosition[gBagPosition.pocket]; + u16 *cursorPos = &gBagPosition.cursorPosition[gBagPosition.pocket]; u16 realPos = (*scrollPos + *cursorPos); if (tListPosition == realPos || tListPosition == realPos - 1) @@ -1512,9 +1512,9 @@ static void DoItemSwap(u8 taskId) static void CancelItemSwap(u8 taskId) { - s16* data = gTasks[taskId].data; - u16* scrollPos = &gBagPosition.scrollPosition[gBagPosition.pocket]; - u16* cursorPos = &gBagPosition.cursorPosition[gBagPosition.pocket]; + s16 *data = gTasks[taskId].data; + u16 *scrollPos = &gBagPosition.scrollPosition[gBagPosition.pocket]; + u16 *cursorPos = &gBagPosition.cursorPosition[gBagPosition.pocket]; gBagMenu->toSwapPos = NOT_SWAPPING; DestroyListMenuTask(tListTaskId, scrollPos, cursorPos); @@ -1806,7 +1806,7 @@ static void ItemMenu_UseOutOfBattle(u8 taskId) static void ItemMenu_Toss(u8 taskId) { - s16* data = gTasks[taskId].data; + s16 *data = gTasks[taskId].data; RemoveContextWindow(); tItemCount = 1; @@ -1827,7 +1827,7 @@ static void ItemMenu_Toss(u8 taskId) static void AskTossItems(u8 taskId) { - s16* data = gTasks[taskId].data; + s16 *data = gTasks[taskId].data; CopyItemName(gSpecialVar_ItemId, gStringVar1); ConvertIntToDecimalStringN(gStringVar2, tItemCount, STR_CONV_MODE_LEFT_ALIGN, MAX_ITEM_DIGITS); @@ -1839,7 +1839,7 @@ static void AskTossItems(u8 taskId) static void CancelToss(u8 taskId) { - s16* data = gTasks[taskId].data; + s16 *data = gTasks[taskId].data; PrintItemDescription(tListPosition); BagMenu_PrintCursor(tListTaskId, COLORID_NORMAL); @@ -1848,7 +1848,7 @@ static void CancelToss(u8 taskId) static void Task_ChooseHowManyToToss(u8 taskId) { - s16* data = gTasks[taskId].data; + s16 *data = gTasks[taskId].data; if (AdjustQuantityAccordingToDPadInput(&tItemCount, tQuantity) == TRUE) { @@ -1870,7 +1870,7 @@ static void Task_ChooseHowManyToToss(u8 taskId) static void ConfirmToss(u8 taskId) { - s16* data = gTasks[taskId].data; + s16 *data = gTasks[taskId].data; CopyItemName(gSpecialVar_ItemId, gStringVar1); ConvertIntToDecimalStringN(gStringVar2, tItemCount, STR_CONV_MODE_LEFT_ALIGN, MAX_ITEM_DIGITS); @@ -1884,9 +1884,9 @@ static void ConfirmToss(u8 taskId) // For when items are tossed or deposited static void Task_RemoveItemFromBag(u8 taskId) { - s16* data = gTasks[taskId].data; - u16* scrollPos = &gBagPosition.scrollPosition[gBagPosition.pocket]; - u16* cursorPos = &gBagPosition.cursorPosition[gBagPosition.pocket]; + s16 *data = gTasks[taskId].data; + u16 *scrollPos = &gBagPosition.scrollPosition[gBagPosition.pocket]; + u16 *cursorPos = &gBagPosition.cursorPosition[gBagPosition.pocket]; if (JOY_NEW(A_BUTTON | B_BUTTON)) { @@ -1904,9 +1904,9 @@ static void Task_RemoveItemFromBag(u8 taskId) static void ItemMenu_Register(u8 taskId) { - s16* data = gTasks[taskId].data; - u16* scrollPos = &gBagPosition.scrollPosition[gBagPosition.pocket]; - u16* cursorPos = &gBagPosition.cursorPosition[gBagPosition.pocket]; + s16 *data = gTasks[taskId].data; + u16 *scrollPos = &gBagPosition.scrollPosition[gBagPosition.pocket]; + u16 *cursorPos = &gBagPosition.cursorPosition[gBagPosition.pocket]; if (gSaveBlock1Ptr->registeredItem == gSpecialVar_ItemId) gSaveBlock1Ptr->registeredItem = 0; @@ -1973,7 +1973,7 @@ static void ItemMenu_CheckTag(u8 taskId) static void ItemMenu_Cancel(u8 taskId) { - s16* data = gTasks[taskId].data; + s16 *data = gTasks[taskId].data; RemoveContextWindow(); PrintItemDescription(tListPosition); @@ -2066,7 +2066,7 @@ bool8 UseRegisteredKeyItemOnField(void) static void Task_ItemContext_Sell(u8 taskId) { - s16* data = gTasks[taskId].data; + s16 *data = gTasks[taskId].data; if (ItemId_GetPrice(gSpecialVar_ItemId) == 0) { @@ -2093,7 +2093,7 @@ static void Task_ItemContext_Sell(u8 taskId) static void DisplaySellItemPriceAndConfirm(u8 taskId) { - s16* data = gTasks[taskId].data; + s16 *data = gTasks[taskId].data; ConvertIntToDecimalStringN(gStringVar1, (ItemId_GetPrice(gSpecialVar_ItemId) / 2) * tItemCount, STR_CONV_MODE_LEFT_ALIGN, 6); StringExpandPlaceholders(gStringVar4, gText_ICanPayVar1); @@ -2107,7 +2107,7 @@ static void AskSellItems(u8 taskId) static void CancelSell(u8 taskId) { - s16* data = gTasks[taskId].data; + s16 *data = gTasks[taskId].data; RemoveMoneyWindow(); RemoveItemMessageWindow(ITEMWIN_MESSAGE); @@ -2117,7 +2117,7 @@ static void CancelSell(u8 taskId) static void InitSellHowManyInput(u8 taskId) { - s16* data = gTasks[taskId].data; + s16 *data = gTasks[taskId].data; u8 windowId = BagMenu_AddWindow(ITEMWIN_QUANTITY_WIDE); PrintItemSoldAmount(windowId, 1, (ItemId_GetPrice(gSpecialVar_ItemId) / 2) * tItemCount); @@ -2127,7 +2127,7 @@ static void InitSellHowManyInput(u8 taskId) static void Task_ChooseHowManyToSell(u8 taskId) { - s16* data = gTasks[taskId].data; + s16 *data = gTasks[taskId].data; if (AdjustQuantityAccordingToDPadInput(&tItemCount, tQuantity) == TRUE) { @@ -2152,7 +2152,7 @@ static void Task_ChooseHowManyToSell(u8 taskId) static void ConfirmSell(u8 taskId) { - s16* data = gTasks[taskId].data; + s16 *data = gTasks[taskId].data; CopyItemName(gSpecialVar_ItemId, gStringVar2); ConvertIntToDecimalStringN(gStringVar1, (ItemId_GetPrice(gSpecialVar_ItemId) / 2) * tItemCount, STR_CONV_MODE_LEFT_ALIGN, 6); @@ -2162,9 +2162,9 @@ static void ConfirmSell(u8 taskId) static void SellItem(u8 taskId) { - s16* data = gTasks[taskId].data; - u16* scrollPos = &gBagPosition.scrollPosition[gBagPosition.pocket]; - u16* cursorPos = &gBagPosition.cursorPosition[gBagPosition.pocket]; + s16 *data = gTasks[taskId].data; + u16 *scrollPos = &gBagPosition.scrollPosition[gBagPosition.pocket]; + u16 *cursorPos = &gBagPosition.cursorPosition[gBagPosition.pocket]; PlaySE(SE_SHOP); RemoveBagItem(gSpecialVar_ItemId, tItemCount); @@ -2191,7 +2191,7 @@ static void WaitAfterItemSell(u8 taskId) static void Task_ItemContext_Deposit(u8 taskId) { - s16* data = gTasks[taskId].data; + s16 *data = gTasks[taskId].data; tItemCount = 1; if (tQuantity == 1) @@ -2211,7 +2211,7 @@ static void Task_ItemContext_Deposit(u8 taskId) static void Task_ChooseHowManyToDeposit(u8 taskId) { - s16* data = gTasks[taskId].data; + s16 *data = gTasks[taskId].data; if (AdjustQuantityAccordingToDPadInput(&tItemCount, tQuantity) == TRUE) { @@ -2235,7 +2235,7 @@ static void Task_ChooseHowManyToDeposit(u8 taskId) static void TryDepositItem(u8 taskId) { - s16* data = gTasks[taskId].data; + s16 *data = gTasks[taskId].data; FillWindowPixelBuffer(WIN_DESCRIPTION, PIXEL_FILL(0)); if (ItemId_GetImportance(gSpecialVar_ItemId)) @@ -2263,7 +2263,7 @@ static void TryDepositItem(u8 taskId) static void WaitDepositErrorMessage(u8 taskId) { - s16* data = gTasks[taskId].data; + s16 *data = gTasks[taskId].data; if (JOY_NEW(A_BUTTON | B_BUTTON)) { @@ -2327,7 +2327,7 @@ void DoWallyTutorialBagMenu(void) static void Task_WallyTutorialBagMenu(u8 taskId) { - s16* data = gTasks[taskId].data; + s16 *data = gTasks[taskId].data; if (!gPaletteFade.active) { @@ -2423,19 +2423,19 @@ static void PrintPocketNames(const u8 *pocketName1, const u8 *pocketName2) offset = GetStringCenterAlignXOffset(FONT_NORMAL, pocketName2, 0x40); BagMenu_Print(windowId, FONT_NORMAL, pocketName2, offset + 0x40, 1, 0, 0, TEXT_SKIP_DRAW, COLORID_POCKET_NAME); } - CpuCopy32((u8*)GetWindowAttribute(windowId, WINDOW_TILE_DATA), gBagMenu->pocketNameBuffer, sizeof(gBagMenu->pocketNameBuffer)); + CpuCopy32((u8 *)GetWindowAttribute(windowId, WINDOW_TILE_DATA), gBagMenu->pocketNameBuffer, sizeof(gBagMenu->pocketNameBuffer)); RemoveWindow(windowId); } static void CopyPocketNameToWindow(u32 a) { u8 (* tileDataBuffer)[32][32]; - u8* windowTileData; + u8 *windowTileData; int b; if (a > 8) a = 8; tileDataBuffer = &gBagMenu->pocketNameBuffer; - windowTileData = (u8*)GetWindowAttribute(2, WINDOW_TILE_DATA); + windowTileData = (u8 *)GetWindowAttribute(2, WINDOW_TILE_DATA); CpuCopy32(tileDataBuffer[0][a], windowTileData, 0x100); // Top half of pocket name b = a + 16; CpuCopy32(tileDataBuffer[0][b], windowTileData + 0x100, 0x100); // Bottom half of pocket name @@ -2551,7 +2551,7 @@ static void PrintTMHMMoveData(u16 itemId) { u8 i; u16 moveId; - const u8* text; + const u8 *text; FillWindowPixelBuffer(WIN_TMHM_INFO, PIXEL_FILL(0)); if (itemId == ITEM_NONE) diff --git a/src/item_use.c b/src/item_use.c index fc2425fc0..e3604b064 100755 --- a/src/item_use.c +++ b/src/item_use.c @@ -195,7 +195,7 @@ void ItemUseOutOfBattle_Mail(u8 taskId) void ItemUseOutOfBattle_Bike(u8 taskId) { - s16* data = gTasks[taskId].data; + s16 *data = gTasks[taskId].data; s16 coordsY; s16 coordsX; u8 behavior; @@ -301,7 +301,7 @@ static void Task_UseItemfinder(u8 taskId) u8 playerDir; u8 playerDirToItem; u8 i; - s16* data = gTasks[taskId].data; + s16 *data = gTasks[taskId].data; if (tCounter == 0) { if (tItemfinderBeeps == 4) @@ -843,7 +843,7 @@ void ItemUseOutOfBattle_Repel(u8 taskId) static void Task_StartUseRepel(u8 taskId) { - s16* data = gTasks[taskId].data; + s16 *data = gTasks[taskId].data; if (++data[8] > 7) { diff --git a/src/libisagbprn.c b/src/libisagbprn.c index 7a70cf41f..6fb9d5ec0 100644 --- a/src/libisagbprn.c +++ b/src/libisagbprn.c @@ -160,7 +160,7 @@ void AGBAssert(const char *pFile, int nLine, const char *pExpression, int nStopP /* void NoCashGBAPrint(const char *pBuf) { - *(volatile u32*)NOCASHGBAPRINTADDR2 = (u32)pBuf; + *(volatile u32 *)NOCASHGBAPRINTADDR2 = (u32)pBuf; } void NoCashGBAPrintf(const char *pBuf, ...) diff --git a/src/librfu_intr.c b/src/librfu_intr.c index d902b1c45..ab4392e22 100644 --- a/src/librfu_intr.c +++ b/src/librfu_intr.c @@ -41,7 +41,7 @@ static void sio32intr_clock_master(void) { if (gSTWIStatus->reqNext <= gSTWIStatus->reqLength) { - REG_SIODATA32 = ((u32*)gSTWIStatus->txPacket->rfuPacket8.data)[gSTWIStatus->reqNext]; + REG_SIODATA32 = ((u32 *)gSTWIStatus->txPacket->rfuPacket8.data)[gSTWIStatus->reqNext]; gSTWIStatus->reqNext++; } else @@ -62,7 +62,7 @@ static void sio32intr_clock_master(void) if ((regSIODATA32 & 0xFFFF0000) == 0x99660000) { gSTWIStatus->ackNext = 0; - ((u32*)gSTWIStatus->rxPacket)[gSTWIStatus->ackNext] = regSIODATA32; + ((u32 *)gSTWIStatus->rxPacket)[gSTWIStatus->ackNext] = regSIODATA32; gSTWIStatus->ackNext++; gSTWIStatus->ackActiveCommand = regSIODATA32; gSTWIStatus->ackLength = ackLen = regSIODATA32 >> 8; @@ -85,7 +85,7 @@ static void sio32intr_clock_master(void) } else if (gSTWIStatus->state == 2) // master receive ack { - ((u32*)gSTWIStatus->rxPacket)[gSTWIStatus->ackNext] = regSIODATA32; + ((u32 *)gSTWIStatus->rxPacket)[gSTWIStatus->ackNext] = regSIODATA32; gSTWIStatus->ackNext++; if (gSTWIStatus->ackLength < gSTWIStatus->ackNext) gSTWIStatus->state = 3; // master done ack @@ -158,7 +158,7 @@ static void sio32intr_clock_slave(void) regSIODATA32 = REG_SIODATA32; if (gSTWIStatus->state == 5) // slave receive req init { - ((u32*)gSTWIStatus->rxPacket)[0] = regSIODATA32; + ((u32 *)gSTWIStatus->rxPacket)[0] = regSIODATA32; gSTWIStatus->reqNext = 1; r0 = 0x99660000; // variable reuse required @@ -179,24 +179,24 @@ static void sio32intr_clock_slave(void) ) { gSTWIStatus->ackActiveCommand = gSTWIStatus->reqActiveCommand + 0x80; - ((u32*)gSTWIStatus->txPacket)[0] = 0x99660000 + gSTWIStatus->ackActiveCommand; + ((u32 *)gSTWIStatus->txPacket)[0] = 0x99660000 + gSTWIStatus->ackActiveCommand; gSTWIStatus->ackLength = 0; } else { - ((u32*)gSTWIStatus->txPacket)[0] = 0x996601EE; + ((u32 *)gSTWIStatus->txPacket)[0] = 0x996601EE; if (gSTWIStatus->reqActiveCommand >= 0x10 && gSTWIStatus->reqActiveCommand <= 0x3D) { - ((u32*)gSTWIStatus->txPacket)[1] = 1; + ((u32 *)gSTWIStatus->txPacket)[1] = 1; } else { - ((u32*)gSTWIStatus->txPacket)[1] = 2; + ((u32 *)gSTWIStatus->txPacket)[1] = 2; } gSTWIStatus->ackLength = 1; gSTWIStatus->error = ERR_REQ_CMD_ACK_REJECTION; } - REG_SIODATA32 = ((u32*)gSTWIStatus->txPacket)[0]; + REG_SIODATA32 = ((u32 *)gSTWIStatus->txPacket)[0]; gSTWIStatus->ackNext = 1; gSTWIStatus->state = 7; // slave send ack } @@ -216,7 +216,7 @@ static void sio32intr_clock_slave(void) } else if (gSTWIStatus->state == 6) // slave receive req { - ((u32*)gSTWIStatus->rxPacket)[gSTWIStatus->reqNext] = regSIODATA32; + ((u32 *)gSTWIStatus->rxPacket)[gSTWIStatus->reqNext] = regSIODATA32; gSTWIStatus->reqNext++; if (gSTWIStatus->reqLength < gSTWIStatus->reqNext) { @@ -227,24 +227,24 @@ static void sio32intr_clock_slave(void) ) { gSTWIStatus->ackActiveCommand = gSTWIStatus->reqActiveCommand + 0x80; - ((u32*)gSTWIStatus->txPacket)[0] = 0x99660000 | gSTWIStatus->ackActiveCommand; + ((u32 *)gSTWIStatus->txPacket)[0] = 0x99660000 | gSTWIStatus->ackActiveCommand; gSTWIStatus->ackLength = 0; } else { - ((u32*)gSTWIStatus->txPacket)[0] = 0x996601EE; + ((u32 *)gSTWIStatus->txPacket)[0] = 0x996601EE; if (gSTWIStatus->reqActiveCommand >= 0x10 && gSTWIStatus->reqActiveCommand <= 0x3D) { - ((u32*)gSTWIStatus->txPacket)[1] = 1; + ((u32 *)gSTWIStatus->txPacket)[1] = 1; } else { - ((u32*)gSTWIStatus->txPacket)[1] = 2; + ((u32 *)gSTWIStatus->txPacket)[1] = 2; } gSTWIStatus->ackLength = 1; gSTWIStatus->error = ERR_REQ_CMD_ACK_REJECTION; } - REG_SIODATA32 = ((u32*)gSTWIStatus->txPacket)[0]; + REG_SIODATA32 = ((u32 *)gSTWIStatus->txPacket)[0]; gSTWIStatus->ackNext = 1; gSTWIStatus->state = 7; // slave send ack } @@ -263,7 +263,7 @@ static void sio32intr_clock_slave(void) } else { - REG_SIODATA32 = ((u32*)gSTWIStatus->txPacket)[gSTWIStatus->ackNext]; + REG_SIODATA32 = ((u32 *)gSTWIStatus->txPacket)[gSTWIStatus->ackNext]; gSTWIStatus->ackNext++; } } @@ -336,8 +336,8 @@ static u16 handshake_wait(u16 slot) static void STWI_set_timer_in_RAM(u8 count) { - vu16* regTMCNTL = ®_TMCNT_L(gSTWIStatus->timerSelect); - vu16* regTMCNTH = ®_TMCNT_H(gSTWIStatus->timerSelect); + vu16 *regTMCNTL = ®_TMCNT_L(gSTWIStatus->timerSelect); + vu16 *regTMCNTH = ®_TMCNT_H(gSTWIStatus->timerSelect); REG_IME = 0; switch (count) { diff --git a/src/librfu_stwi.c b/src/librfu_stwi.c index 8d8d10c40..b515f338e 100644 --- a/src/librfu_stwi.c +++ b/src/librfu_stwi.c @@ -235,7 +235,7 @@ void STWI_send_SystemConfigREQ(u16 availSlotFlag, u8 maxMFrame, u8 mcTimer) packetBytes += sizeof(u32); *packetBytes++ = mcTimer; *packetBytes++ = maxMFrame; - *(u16*)packetBytes = availSlotFlag; + *(u16 *)packetBytes = availSlotFlag; STWI_start_Command(); } } diff --git a/src/link_rfu_2.c b/src/link_rfu_2.c index ae151fb1e..c54d6c3d3 100644 --- a/src/link_rfu_2.c +++ b/src/link_rfu_2.c @@ -2747,7 +2747,7 @@ static void Task_RfuReconnectWithParent(u8 taskId) if (CanTryReconnectParent()) { - u8 id = GetPartnerIndexByNameAndTrainerID((u8*)data, ReadU16(&data[8])); + u8 id = GetPartnerIndexByNameAndTrainerID((u8 *)data, ReadU16(&data[8])); if (id != 0xFF) { if (gRfuLinkStatus->partner[id].slot != 0xFF) @@ -2797,7 +2797,7 @@ void CreateTask_RfuReconnectWithParent(const u8 *name, u16 trainerId) gRfu.status = RFU_STATUS_OK; taskId = CreateTask(Task_RfuReconnectWithParent, 3); data = gTasks[taskId].data; - StringCopy((u8*)(data), name); + StringCopy((u8 *)(data), name); data[8] = trainerId; } @@ -2947,7 +2947,7 @@ static void Debug_PrintStatus(void) if ((gRfuLinkStatus->getNameFlag >> i) & 1) { Debug_PrintNum(gRfuLinkStatus->partner[i].serialNo, 1, i + 3, 4); - Debug_PrintString((void*)gRfuLinkStatus->partner[i].gname, 6, i + 3); + Debug_PrintString((void *)gRfuLinkStatus->partner[i].gname, 6, i + 3); Debug_PrintString(gRfuLinkStatus->partner[i].uname, 22, i + 3); } } @@ -2967,7 +2967,7 @@ static void Debug_PrintStatus(void) Debug_PrintString(sASCII_8Spaces, 22, i + 3); } Debug_PrintNum(gRfuLinkStatus->partner[gRfu.childSlot].serialNo, 1, 3, 4); - Debug_PrintString((void*)gRfuLinkStatus->partner[gRfu.childSlot].gname, 6, 3); + Debug_PrintString((void *)gRfuLinkStatus->partner[gRfu.childSlot].gname, 6, 3); Debug_PrintString(gRfuLinkStatus->partner[gRfu.childSlot].uname, 22, 3); } else diff --git a/src/list_menu.c b/src/list_menu.c index 8ba13a6cf..e6736cacf 100644 --- a/src/list_menu.c +++ b/src/list_menu.c @@ -408,7 +408,7 @@ u8 ListMenuInitInRect(struct ListMenuTemplate *listMenuTemplate, struct ListMenu s32 ListMenu_ProcessInput(u8 listTaskId) { - struct ListMenu *list = (void*) gTasks[listTaskId].data; + struct ListMenu *list = (void *) gTasks[listTaskId].data; if (JOY_NEW(A_BUTTON)) { @@ -469,7 +469,7 @@ s32 ListMenu_ProcessInput(u8 listTaskId) void DestroyListMenuTask(u8 listTaskId, u16 *scrollOffset, u16 *selectedRow) { - struct ListMenu *list = (void*) gTasks[listTaskId].data; + struct ListMenu *list = (void *) gTasks[listTaskId].data; if (scrollOffset != NULL) *scrollOffset = list->scrollOffset; @@ -484,7 +484,7 @@ void DestroyListMenuTask(u8 listTaskId, u16 *scrollOffset, u16 *selectedRow) void RedrawListMenu(u8 listTaskId) { - struct ListMenu *list = (void*) gTasks[listTaskId].data; + struct ListMenu *list = (void *) gTasks[listTaskId].data; FillWindowPixelBuffer(list->template.windowId, PIXEL_FILL(list->template.fillValue)); ListMenuPrintEntries(list, list->scrollOffset, 0, list->template.maxShowed); @@ -495,7 +495,7 @@ void RedrawListMenu(u8 listTaskId) // unused void ChangeListMenuPals(u8 listTaskId, u8 cursorPal, u8 fillValue, u8 cursorShadowPal) { - struct ListMenu *list = (void*) gTasks[listTaskId].data; + struct ListMenu *list = (void *) gTasks[listTaskId].data; list->template.cursorPal = cursorPal; list->template.fillValue = fillValue; @@ -505,7 +505,7 @@ void ChangeListMenuPals(u8 listTaskId, u8 cursorPal, u8 fillValue, u8 cursorShad // unused void ChangeListMenuCoords(u8 listTaskId, u8 x, u8 y) { - struct ListMenu *list = (void*) gTasks[listTaskId].data; + struct ListMenu *list = (void *) gTasks[listTaskId].data; SetWindowAttribute(list->template.windowId, WINDOW_TILEMAP_LEFT, x); SetWindowAttribute(list->template.windowId, WINDOW_TILEMAP_TOP, y); @@ -537,7 +537,7 @@ s32 ListMenuTestInput(struct ListMenuTemplate *template, u32 scrollOffset, u32 s void ListMenuGetCurrentItemArrayId(u8 listTaskId, u16 *arrayId) { - struct ListMenu *list = (void*) gTasks[listTaskId].data; + struct ListMenu *list = (void *) gTasks[listTaskId].data; if (arrayId != NULL) *arrayId = list->scrollOffset + list->selectedRow; @@ -545,7 +545,7 @@ void ListMenuGetCurrentItemArrayId(u8 listTaskId, u16 *arrayId) void ListMenuGetScrollAndRow(u8 listTaskId, u16 *scrollOffset, u16 *selectedRow) { - struct ListMenu *list = (void*) gTasks[listTaskId].data; + struct ListMenu *list = (void *) gTasks[listTaskId].data; if (scrollOffset != NULL) *scrollOffset = list->scrollOffset; @@ -555,7 +555,7 @@ void ListMenuGetScrollAndRow(u8 listTaskId, u16 *scrollOffset, u16 *selectedRow) u16 ListMenuGetYCoordForPrintingArrowCursor(u8 listTaskId) { - struct ListMenu *list = (void*) gTasks[listTaskId].data; + struct ListMenu *list = (void *) gTasks[listTaskId].data; u8 yMultiplier = GetFontAttribute(list->template.fontId, FONTATTR_MAX_LETTER_HEIGHT) + list->template.itemVerticalPadding; return list->selectedRow * yMultiplier + list->template.upText_Y; @@ -564,7 +564,7 @@ u16 ListMenuGetYCoordForPrintingArrowCursor(u8 listTaskId) static u8 ListMenuInitInternal(struct ListMenuTemplate *listMenuTemplate, u16 scrollOffset, u16 selectedRow) { u8 listTaskId = CreateTask(ListMenuDummyTask, 0); - struct ListMenu *list = (void*) gTasks[listTaskId].data; + struct ListMenu *list = (void *) gTasks[listTaskId].data; list->template = *listMenuTemplate; list->scrollOffset = scrollOffset; @@ -902,7 +902,7 @@ void ListMenuDefaultCursorMoveFunc(s32 itemIndex, bool8 onInit, struct ListMenu // unused s32 ListMenuGetUnkIndicatorsStructFields(u8 taskId, u8 field) { - struct UnkIndicatorsStruct *data = (void*) gTasks[taskId].data; + struct UnkIndicatorsStruct *data = (void *) gTasks[taskId].data; switch (field) { @@ -946,13 +946,13 @@ s32 ListMenuGetUnkIndicatorsStructFields(u8 taskId, u8 field) void ListMenuSetUnkIndicatorsStructField(u8 taskId, u8 field, s32 value) { - struct UnkIndicatorsStruct *data = (void*) &gTasks[taskId].data; + struct UnkIndicatorsStruct *data = (void *) &gTasks[taskId].data; switch (field) { case 0: case 1: - data->field_4 = (void*)(value); + data->field_4 = (void *)(value); break; case 2: data->field_C = value; @@ -1088,7 +1088,7 @@ u8 AddScrollIndicatorArrowPair(const struct ScrollArrowsTemplate *arrowInfo, u16 } taskId = CreateTask(Task_ScrollIndicatorArrowPair, 0); - data = (void*) gTasks[taskId].data; + data = (void *) gTasks[taskId].data; data->field_0 = 0; data->scrollOffset = scrollOffset; @@ -1140,7 +1140,7 @@ u8 AddScrollIndicatorArrowPairParameterized(u32 arrowType, s32 commonPos, s32 fi static void Task_ScrollIndicatorArrowPair(u8 taskId) { - struct ScrollIndicatorPair *data = (void*) gTasks[taskId].data; + struct ScrollIndicatorPair *data = (void *) gTasks[taskId].data; u16 currItem = (*data->scrollOffset); if (currItem == data->fullyUpThreshold && currItem != 0xFFFF) @@ -1159,7 +1159,7 @@ static void Task_ScrollIndicatorArrowPair(u8 taskId) void Task_ScrollIndicatorArrowPairOnMainMenu(u8 taskId) { s16 *data = gTasks[taskId].data; - struct ScrollIndicatorPair *scrollData = (void*) data; + struct ScrollIndicatorPair *scrollData = (void *) data; if (tIsScrolled) { @@ -1177,7 +1177,7 @@ void Task_ScrollIndicatorArrowPairOnMainMenu(u8 taskId) void RemoveScrollIndicatorArrowPair(u8 taskId) { - struct ScrollIndicatorPair *data = (void*) gTasks[taskId].data; + struct ScrollIndicatorPair *data = (void *) gTasks[taskId].data; if (data->tileTag != TAG_NONE) FreeSpriteTilesByTag(data->tileTag); @@ -1334,7 +1334,7 @@ static u8 ListMenuAddRedOutlineCursorObject(struct CursorStruct *cursor) } taskId = CreateTask(Task_RedOutlineCursor, 0); - data = (void*) gTasks[taskId].data; + data = (void *) gTasks[taskId].data; data->tileTag = cursor->tileTag; data->palTag = cursor->palTag; @@ -1362,7 +1362,7 @@ static u8 ListMenuAddRedOutlineCursorObject(struct CursorStruct *cursor) static void ListMenuUpdateRedOutlineCursorObject(u8 taskId, u16 x, u16 y) { - struct RedOutlineCursor *data = (void*) gTasks[taskId].data; + struct RedOutlineCursor *data = (void *) gTasks[taskId].data; gSprites[data->spriteId].x = x + 120; gSprites[data->spriteId].y = y + 120; @@ -1370,7 +1370,7 @@ static void ListMenuUpdateRedOutlineCursorObject(u8 taskId, u16 x, u16 y) static void ListMenuRemoveRedOutlineCursorObject(u8 taskId) { - struct RedOutlineCursor *data = (void*) gTasks[taskId].data; + struct RedOutlineCursor *data = (void *) gTasks[taskId].data; Free(data->subspritesPtr); @@ -1419,7 +1419,7 @@ static u8 ListMenuAddRedArrowCursorObject(struct CursorStruct *cursor) } taskId = CreateTask(Task_RedArrowCursor, 0); - data = (void*) gTasks[taskId].data; + data = (void *) gTasks[taskId].data; data->tileTag = cursor->tileTag; data->palTag = cursor->palTag; @@ -1442,7 +1442,7 @@ static u8 ListMenuAddRedArrowCursorObject(struct CursorStruct *cursor) static void ListMenuUpdateRedArrowCursorObject(u8 taskId, u16 x, u16 y) { - struct RedArrowCursor *data = (void*) gTasks[taskId].data; + struct RedArrowCursor *data = (void *) gTasks[taskId].data; gSprites[data->spriteId].x = x; gSprites[data->spriteId].y = y; @@ -1450,7 +1450,7 @@ static void ListMenuUpdateRedArrowCursorObject(u8 taskId, u16 x, u16 y) static void ListMenuRemoveRedArrowCursorObject(u8 taskId) { - struct RedArrowCursor *data = (void*) gTasks[taskId].data; + struct RedArrowCursor *data = (void *) gTasks[taskId].data; if (data->tileTag != TAG_NONE) FreeSpriteTilesByTag(data->tileTag); diff --git a/src/load_save.c b/src/load_save.c index f2b12acf0..494a61bcf 100644 --- a/src/load_save.c +++ b/src/load_save.c @@ -73,9 +73,9 @@ void SetSaveBlocksPointers(u16 offset) offset = (offset + Random()) & (SAVEBLOCK_MOVE_RANGE - 4); - gSaveBlock2Ptr = (void*)(&gSaveblock2) + offset; - *sav1_LocalVar = (void*)(&gSaveblock1) + offset; - gPokemonStoragePtr = (void*)(&gPokemonStorage) + offset; + gSaveBlock2Ptr = (void *)(&gSaveblock2) + offset; + *sav1_LocalVar = (void *)(&gSaveblock1) + offset; + gPokemonStoragePtr = (void *)(&gPokemonStorage) + offset; SetBagItemsPointers(); SetDecorationInventoriesPointers(); diff --git a/src/m4a.c b/src/m4a.c index faeef83e7..7774d09cb 100644 --- a/src/m4a.c +++ b/src/m4a.c @@ -1178,7 +1178,7 @@ void CgbSound(void) *nrx3ptr = channels->frequency; else *nrx3ptr = (*nrx3ptr & 0x08) | channels->frequency; - channels->n4 = (channels->n4 & 0xC0) + (*((u8*)(&channels->frequency) + 1)); + channels->n4 = (channels->n4 & 0xC0) + (*((u8 *)(&channels->frequency) + 1)); *nrx4ptr = (s8)(channels->n4 & mask); } diff --git a/src/main_menu.c b/src/main_menu.c index 9f21a4b09..b8abffda5 100644 --- a/src/main_menu.c +++ b/src/main_menu.c @@ -178,8 +178,8 @@ static u32 InitMainMenu(bool8); static void Task_MainMenuCheckSaveFile(u8); static void Task_MainMenuCheckBattery(u8); static void Task_WaitForSaveFileErrorWindow(u8); -static void CreateMainMenuErrorWindow(const u8*); -static void ClearMainMenuWindowTilemap(const struct WindowTemplate*); +static void CreateMainMenuErrorWindow(const u8 *); +static void ClearMainMenuWindowTilemap(const struct WindowTemplate *); static void Task_DisplayMainMenu(u8); static void Task_WaitForBatteryDryErrorWindow(u8); static void MainMenu_FormatSavegameText(void); @@ -209,7 +209,7 @@ static void Task_NewGameBirchSpeech_StartPlayerFadeIn(u8); static void Task_NewGameBirchSpeech_WaitForPlayerFadeIn(u8); static void Task_NewGameBirchSpeech_BoyOrGirl(u8); static void LoadMainMenuWindowFrameTiles(u8, u16); -static void DrawMainMenuWindowBorder(const struct WindowTemplate*, u16); +static void DrawMainMenuWindowBorder(const struct WindowTemplate *, u16); static void Task_HighlightSelectedMainMenuItem(u8); static void Task_NewGameBirchSpeech_WaitToShowGenderMenu(u8); static void Task_NewGameBirchSpeech_ChooseGender(u8); @@ -232,7 +232,7 @@ static void Task_NewGameBirchSpeech_ReshowBirchLotad(u8); static void Task_NewGameBirchSpeech_WaitForSpriteFadeInAndTextPrinter(u8); static void Task_NewGameBirchSpeech_AreYouReady(u8); static void Task_NewGameBirchSpeech_ShrinkPlayer(u8); -static void SpriteCB_MovePlayerDownWhileShrinking(struct Sprite*); +static void SpriteCB_MovePlayerDownWhileShrinking(struct Sprite *); static void Task_NewGameBirchSpeech_WaitForPlayerShrink(u8); static void Task_NewGameBirchSpeech_FadePlayerToWhite(u8); static void Task_NewGameBirchSpeech_Cleanup(u8); @@ -621,7 +621,7 @@ static u32 InitMainMenu(bool8 returningFromOptionsMenu) static void Task_MainMenuCheckSaveFile(u8 taskId) { - s16* data = gTasks[taskId].data; + s16 *data = gTasks[taskId].data; if (!gPaletteFade.active) { @@ -736,7 +736,7 @@ static void Task_WaitForBatteryDryErrorWindow(u8 taskId) static void Task_DisplayMainMenu(u8 taskId) { - s16* data = gTasks[taskId].data; + s16 *data = gTasks[taskId].data; u16 palette; if (!gPaletteFade.active) @@ -880,7 +880,7 @@ static void Task_HighlightSelectedMainMenuItem(u8 taskId) static bool8 HandleMainMenuInput(u8 taskId) { - s16* data = gTasks[taskId].data; + s16 *data = gTasks[taskId].data; if (JOY_NEW(A_BUTTON)) { @@ -1272,8 +1272,8 @@ static void Task_NewGameBirchSpeech_Init(u8 taskId) SetGpuReg(REG_OFFSET_BLDALPHA, 0); SetGpuReg(REG_OFFSET_BLDY, 0); - LZ77UnCompVram(sBirchSpeechShadowGfx, (void*)VRAM); - LZ77UnCompVram(sBirchSpeechBgMap, (void*)(BG_SCREEN_ADDR(7))); + LZ77UnCompVram(sBirchSpeechShadowGfx, (void *)VRAM); + LZ77UnCompVram(sBirchSpeechBgMap, (void *)(BG_SCREEN_ADDR(7))); LoadPalette(sBirchSpeechBgPals, 0, 64); LoadPalette(sBirchSpeechPlatformBlackPal, 1, 16); ScanlineEffect_Stop(); @@ -1807,8 +1807,8 @@ static void CB2_NewGameBirchSpeech_ReturnFromNamingScreen(void) DmaFill32(3, 0, OAM, OAM_SIZE); DmaFill16(3, 0, PLTT, PLTT_SIZE); ResetPaletteFade(); - LZ77UnCompVram(sBirchSpeechShadowGfx, (u8*)VRAM); - LZ77UnCompVram(sBirchSpeechBgMap, (u8*)(BG_SCREEN_ADDR(7))); + LZ77UnCompVram(sBirchSpeechShadowGfx, (u8 *)VRAM); + LZ77UnCompVram(sBirchSpeechBgMap, (u8 *)(BG_SCREEN_ADDR(7))); LoadPalette(sBirchSpeechBgPals, 0, 64); LoadPalette(&sBirchSpeechBgGradientPal[1], 1, 16); ResetTasks(); @@ -2102,7 +2102,7 @@ static s8 NewGameBirchSpeech_ProcessGenderMenuInput(void) static void NewGameBirchSpeech_SetDefaultPlayerName(u8 nameId) { - const u8* name; + const u8 *name; u8 i; if (gSaveBlock2Ptr->playerGender == MALE) @@ -2114,7 +2114,7 @@ static void NewGameBirchSpeech_SetDefaultPlayerName(u8 nameId) gSaveBlock2Ptr->playerName[PLAYER_NAME_LENGTH] = EOS; } -static void CreateMainMenuErrorWindow(const u8* str) +static void CreateMainMenuErrorWindow(const u8 *str) { FillWindowPixelBuffer(7, PIXEL_FILL(1)); AddTextPrinterParameterized(7, FONT_NORMAL, str, 0, 1, 2, 0); @@ -2143,7 +2143,7 @@ static void MainMenu_FormatSavegamePlayer(void) static void MainMenu_FormatSavegameTime(void) { u8 str[0x20]; - u8* ptr; + u8 *ptr; StringExpandPlaceholders(gStringVar4, gText_ContinueMenuTime); AddTextPrinterParameterized3(2, FONT_NORMAL, 0x6C, 17, sTextColor_MenuInfo, TEXT_SKIP_DRAW, gStringVar4); diff --git a/src/map_name_popup.c b/src/map_name_popup.c index 9eaa035ca..41054d16d 100644 --- a/src/map_name_popup.c +++ b/src/map_name_popup.c @@ -303,7 +303,7 @@ static void ShowMapNamePopUpWindow(void) u8 mapDisplayHeader[24]; u8 *withoutPrefixPtr; u8 x; - const u8* mapDisplayHeaderSource; + const u8 *mapDisplayHeaderSource; if (InBattlePyramid()) { diff --git a/src/menu.c b/src/menu.c index c4540942b..8b3b82d98 100644 --- a/src/menu.c +++ b/src/menu.c @@ -2031,14 +2031,14 @@ static void UnusedBlitBitmapRect(const struct Bitmap *src, struct Bitmap *dst, u for (loopSrcX = srcX, loopDstX = dstX; loopSrcX < xEnd; loopSrcX++, loopDstX++) { pixelsSrc = src->pixels + ((loopSrcX >> 1) & 3) + ((loopSrcX >> 3) << 5) + (((loopSrcY >> 3) * multiplierSrcY) << 5) + ((u32)(loopSrcY << 29) >> 27); - pixelsDst = (void*) dst->pixels + ((loopDstX >> 1) & 3) + ((loopDstX >> 3) << 5) + ((( loopDstY >> 3) * multiplierDstY) << 5) + ((u32)(loopDstY << 29) >> 27); + pixelsDst = (void *) dst->pixels + ((loopDstX >> 1) & 3) + ((loopDstX >> 3) << 5) + ((( loopDstY >> 3) * multiplierDstY) << 5) + ((u32)(loopDstY << 29) >> 27); if ((uintptr_t)pixelsDst & 1) { pixelsDst--; if (loopDstX & 1) { - toOrr = *(vu16*)pixelsDst; + toOrr = *(vu16 *)pixelsDst; toOrr &= 0x0fff; if (loopSrcX & 1) toOrr |= ((*pixelsSrc & 0xf0) << 8); @@ -2047,7 +2047,7 @@ static void UnusedBlitBitmapRect(const struct Bitmap *src, struct Bitmap *dst, u } else { - toOrr = *(vu16*)pixelsDst; + toOrr = *(vu16 *)pixelsDst; toOrr &= 0xf0ff; if (loopSrcX & 1) toOrr |= ((*pixelsSrc & 0xf0) << 4); @@ -2059,7 +2059,7 @@ static void UnusedBlitBitmapRect(const struct Bitmap *src, struct Bitmap *dst, u { if (loopDstX & 1) { - toOrr = *(vu16*)pixelsDst; + toOrr = *(vu16 *)pixelsDst; toOrr &= 0xff0f; if (loopSrcX & 1) toOrr |= ((*pixelsSrc & 0xf0) << 0); @@ -2068,7 +2068,7 @@ static void UnusedBlitBitmapRect(const struct Bitmap *src, struct Bitmap *dst, u } else { - toOrr = *(vu16*)pixelsDst; + toOrr = *(vu16 *)pixelsDst; toOrr &= 0xfff0; if (loopSrcX & 1) toOrr |= ((*pixelsSrc & 0xf0) >> 4); @@ -2076,7 +2076,7 @@ static void UnusedBlitBitmapRect(const struct Bitmap *src, struct Bitmap *dst, u toOrr |= ((*pixelsSrc & 0x0f) >> 0); } } - *(vu16*)pixelsDst = toOrr; + *(vu16 *)pixelsDst = toOrr; } } } diff --git a/src/menu_helpers.c b/src/menu_helpers.c index 7decd695c..949a3d89a 100644 --- a/src/menu_helpers.c +++ b/src/menu_helpers.c @@ -98,9 +98,9 @@ void ResetVramOamAndBgCntRegs(void) SetGpuReg(REG_OFFSET_BG2CNT, 0); SetGpuReg(REG_OFFSET_BG1CNT, 0); SetGpuReg(REG_OFFSET_BG0CNT, 0); - CpuFill16(0, (void*) VRAM, VRAM_SIZE); - CpuFill32(0, (void*) OAM, OAM_SIZE); - CpuFill16(0, (void*) PLTT, PLTT_SIZE); + CpuFill16(0, (void *) VRAM, VRAM_SIZE); + CpuFill32(0, (void *) OAM, OAM_SIZE); + CpuFill16(0, (void *) PLTT, PLTT_SIZE); } void ResetAllBgsCoordinates(void) diff --git a/src/mirage_tower.c b/src/mirage_tower.c index 730026298..6cd6e565e 100644 --- a/src/mirage_tower.c +++ b/src/mirage_tower.c @@ -67,12 +67,12 @@ static void IncrementCeilingCrumbleFinishedCount(void); static void WaitCeilingCrumble(u8); static void FinishCeilingCrumbleTask(u8); static void CreateCeilingCrumbleSprites(void); -static void SpriteCB_CeilingCrumble(struct Sprite*); +static void SpriteCB_CeilingCrumble(struct Sprite *); static void DoMirageTowerDisintegration(u8); static void InitMirageTowerShake(u8); static void Task_FossilFallAndSink(u8); static void SpriteCB_FallingFossil(struct Sprite *); -static void UpdateDisintegrationEffect(u8*, u16, u8, u8, u8); +static void UpdateDisintegrationEffect(u8 *, u16, u8, u8, u8); static const u8 sBlankTile_Gfx[32] = {0}; static const u8 sMirageTower_Gfx[] = INCBIN_U8("graphics/misc/mirage_tower.4bpp"); @@ -249,8 +249,8 @@ static const struct SpriteTemplate sSpriteTemplate_CeilingCrumbleLarge = { .callback = SpriteCB_CeilingCrumble }; -EWRAM_DATA static u8* sMirageTowerGfxBuffer = NULL; -EWRAM_DATA static u8* sMirageTowerTilemapBuffer = NULL; +EWRAM_DATA static u8 *sMirageTowerGfxBuffer = NULL; +EWRAM_DATA static u8 *sMirageTowerTilemapBuffer = NULL; EWRAM_DATA static struct FallAnim_Fossil *sFallingFossil = NULL; EWRAM_DATA static struct FallAnim_Tower *sFallingTower = NULL; EWRAM_DATA static struct BgRegOffsets *sBgShakeOffsets = NULL; @@ -463,7 +463,7 @@ static void CreateCeilingCrumbleSprites(void) } } -static void SpriteCB_CeilingCrumble(struct Sprite* sprite) +static void SpriteCB_CeilingCrumble(struct Sprite *sprite) { sprite->data[1] += 2; sprite->y2 = sprite->data[1] / 2; @@ -748,7 +748,7 @@ static void SpriteCB_FallingFossil(struct Sprite *sprite) } } -static void UpdateDisintegrationEffect(u8* tiles, u16 randId, u8 c, u8 size, u8 offset) +static void UpdateDisintegrationEffect(u8 *tiles, u16 randId, u8 c, u8 size, u8 offset) { u8 heightTiles, height, widthTiles, width; u16 var, baseOffset; diff --git a/src/money.c b/src/money.c index 5723974a8..b1f4afbf8 100644 --- a/src/money.c +++ b/src/money.c @@ -69,17 +69,17 @@ static const struct CompressedSpritePalette sSpritePalette_MoneyLabel = .tag = MONEY_LABEL_TAG }; -u32 GetMoney(u32* moneyPtr) +u32 GetMoney(u32 *moneyPtr) { return *moneyPtr ^ gSaveBlock2Ptr->encryptionKey; } -void SetMoney(u32* moneyPtr, u32 newValue) +void SetMoney(u32 *moneyPtr, u32 newValue) { *moneyPtr = gSaveBlock2Ptr->encryptionKey ^ newValue; } -bool8 IsEnoughMoney(u32* moneyPtr, u32 cost) +bool8 IsEnoughMoney(u32 *moneyPtr, u32 cost) { if (GetMoney(moneyPtr) >= cost) return TRUE; @@ -87,7 +87,7 @@ bool8 IsEnoughMoney(u32* moneyPtr, u32 cost) return FALSE; } -void AddMoney(u32* moneyPtr, u32 toAdd) +void AddMoney(u32 *moneyPtr, u32 toAdd) { u32 toSet = GetMoney(moneyPtr); @@ -107,7 +107,7 @@ void AddMoney(u32* moneyPtr, u32 toAdd) SetMoney(moneyPtr, toSet); } -void RemoveMoney(u32* moneyPtr, u32 toSub) +void RemoveMoney(u32 *moneyPtr, u32 toSub) { u32 toSet = GetMoney(moneyPtr); diff --git a/src/mystery_event_script.c b/src/mystery_event_script.c index e0f789bcb..685422967 100644 --- a/src/mystery_event_script.c +++ b/src/mystery_event_script.c @@ -104,7 +104,7 @@ static int CalcRecordMixingGiftChecksum(void) { unsigned int i; int sum = 0; - u8 *data = (u8*)(&gSaveBlock1Ptr->recordMixingGift.data); + u8 *data = (u8 *)(&gSaveBlock1Ptr->recordMixingGift.data); for (i = 0; i < sizeof(gSaveBlock1Ptr->recordMixingGift.data); i++) sum += data[i]; diff --git a/src/naming_screen.c b/src/naming_screen.c index a295cfd3f..613928030 100644 --- a/src/naming_screen.c +++ b/src/naming_screen.c @@ -333,7 +333,7 @@ static const struct SpriteTemplate sSpriteTemplate_Cursor; static const struct SpriteTemplate sSpriteTemplate_InputArrow; static const struct SpriteTemplate sSpriteTemplate_Underscore; static const struct SpriteTemplate sSpriteTemplate_PCIcon; -static const u8* const sNamingScreenKeyboardText[KBPAGE_COUNT][KBROW_COUNT]; +static const u8 *const sNamingScreenKeyboardText[KBPAGE_COUNT][KBROW_COUNT]; static const struct SpriteSheet sSpriteSheets[]; static const struct SpritePalette sSpritePalettes[]; @@ -2520,7 +2520,7 @@ static const struct SpriteTemplate sSpriteTemplate_PCIcon = .callback = SpriteCallbackDummy }; -static const u8* const sNamingScreenKeyboardText[KBPAGE_COUNT][KBROW_COUNT] = +static const u8 *const sNamingScreenKeyboardText[KBPAGE_COUNT][KBROW_COUNT] = { [KEYBOARD_LETTERS_LOWER] = { diff --git a/src/option_menu.c b/src/option_menu.c index 2991913d7..3ca9857e8 100644 --- a/src/option_menu.c +++ b/src/option_menu.c @@ -167,7 +167,7 @@ void CB2_InitOptionMenu(void) gMain.state++; break; case 1: - DmaClearLarge16(3, (void*)(VRAM), VRAM_SIZE, 0x1000); + DmaClearLarge16(3, (void *)(VRAM), VRAM_SIZE, 0x1000); DmaClear32(3, OAM, OAM_SIZE); DmaClear16(3, PLTT, PLTT_SIZE); SetGpuReg(REG_OFFSET_DISPCNT, 0); diff --git a/src/overworld.c b/src/overworld.c index 2e4ce0126..812568d01 100644 --- a/src/overworld.c +++ b/src/overworld.c @@ -127,7 +127,7 @@ static void CreateLinkPlayerSprites(void); static void ClearAllPlayerKeys(void); static void ResetAllPlayerLinkStates(void); static void UpdateHeldKeyCode(u16); -static void UpdateAllLinkPlayers(u16*, s32); +static void UpdateAllLinkPlayers(u16 *, s32); static u8 FlipVerticalAndClearForced(u8, u8); static u8 LinkPlayerDetectCollision(u8, u8, s16, s16); static void CreateLinkPlayerSprite(u8, u8); @@ -2923,7 +2923,7 @@ static void ZeroObjectEvent(struct ObjectEvent *objEvent) // conflict with the usual Event Object struct, thus the definitions. #define linkGender(obj) obj->singleMovementActive // not even one can reference *byte* aligned bitfield members... -#define linkDirection(obj) ((u8*)obj)[offsetof(typeof(*obj), fieldEffectSpriteId) - 1] // -> rangeX +#define linkDirection(obj) ((u8 *)obj)[offsetof(typeof(*obj), fieldEffectSpriteId) - 1] // -> rangeX static void SpawnLinkPlayerObjectEvent(u8 linkPlayerId, s16 x, s16 y, u8 gender) { diff --git a/src/party_menu.c b/src/party_menu.c index 70f00f305..c23d9e36f 100755 --- a/src/party_menu.c +++ b/src/party_menu.c @@ -193,9 +193,9 @@ static void DisplayPartyPokemonDescriptionText(u8, struct PartyMenuBox *, u8); static bool8 IsMonAllowedInMinigame(u8); static void DisplayPartyPokemonDataToTeachMove(u8, u16, u8); static u8 CanMonLearnTMTutor(struct Pokemon *, u16, u8); -static void DisplayPartyPokemonBarDetail(u8, const u8*, u8, const u8*); +static void DisplayPartyPokemonBarDetail(u8, const u8 *, u8, const u8 *); static void DisplayPartyPokemonLevel(u8, struct PartyMenuBox *); -static void DisplayPartyPokemonGender(u8, u16, u8*, struct PartyMenuBox *); +static void DisplayPartyPokemonGender(u8, u16, u8 *, struct PartyMenuBox *); static void DisplayPartyPokemonHP(u16, struct PartyMenuBox *); static void DisplayPartyPokemonMaxHP(u16, struct PartyMenuBox *); static void DisplayPartyPokemonHPBar(u16, u16, struct PartyMenuBox *); @@ -220,12 +220,12 @@ static u8 GetPartyIdFromBattleSlot(u8); static void Task_ClosePartyMenuAndSetCB2(u8); static void UpdatePartyToFieldOrder(void); static void MoveCursorToConfirm(void); -static void HandleChooseMonCancel(u8, s8*); -static void HandleChooseMonSelection(u8, s8*); -static u16 PartyMenuButtonHandler(s8*); -static s8* GetCurrentPartySlotPtr(void); -static bool8 IsSelectedMonNotEgg(u8*); -static void PartyMenuRemoveWindow(u8*); +static void HandleChooseMonCancel(u8, s8 *); +static void HandleChooseMonSelection(u8, s8 *); +static u16 PartyMenuButtonHandler(s8 *); +static s8 *GetCurrentPartySlotPtr(void); +static bool8 IsSelectedMonNotEgg(u8 *); +static void PartyMenuRemoveWindow(u8 *); static void CB2_SetUpExitToBattleScreen(void); static void Task_ClosePartyMenuAfterText(u8); static void TryTutorSelectedMon(u8); @@ -237,26 +237,26 @@ static void Task_TryCreateSelectionWindow(u8); static void FinishTwoMonAction(u8); static void CancelParticipationPrompt(u8); static bool8 DisplayCancelChooseMonYesNo(u8); -static const u8* GetFacilityCancelString(void); +static const u8 *GetFacilityCancelString(void); static void Task_CancelChooseMonYesNo(u8); static void PartyMenuDisplayYesNoMenu(void); static void Task_HandleCancelChooseMonYesNoInput(u8); static void Task_ReturnToChooseMonAfterText(u8); -static void UpdateCurrentPartySelection(s8*, s8); -static void UpdatePartySelectionSingleLayout(s8*, s8); -static void UpdatePartySelectionDoubleLayout(s8*, s8); +static void UpdateCurrentPartySelection(s8 *, s8); +static void UpdatePartySelectionSingleLayout(s8 *, s8); +static void UpdatePartySelectionDoubleLayout(s8 *, s8); static s8 GetNewSlotDoubleLayout(s8, s8); -static void PartyMenuPrintText(const u8*); +static void PartyMenuPrintText(const u8 *); static void Task_PrintAndWaitForText(u8); -static bool16 IsMonAllowedInPokemonJump(struct Pokemon*); -static bool16 IsMonAllowedInDodrioBerryPicking(struct Pokemon*); +static bool16 IsMonAllowedInPokemonJump(struct Pokemon *); +static bool16 IsMonAllowedInDodrioBerryPicking(struct Pokemon *); static void Task_CancelParticipationYesNo(u8); static void Task_HandleCancelParticipationYesNoInput(u8); static bool8 CanLearnTutorMove(u16, u8); static u16 GetTutorMove(u8); static bool8 ShouldUseChooseMonText(void); -static void SetPartyMonFieldSelectionActions(struct Pokemon*, u8); -static u8 GetPartyMenuActionsTypeInBattle(struct Pokemon*); +static void SetPartyMonFieldSelectionActions(struct Pokemon *, u8); +static u8 GetPartyMenuActionsTypeInBattle(struct Pokemon *); static u8 GetPartySlotEntryStatus(s8); static void Task_UpdateHeldItemSprite(u8); static void Task_HandleSelectionMenuInput(u8); @@ -277,7 +277,7 @@ static void Task_HandleSwitchItemsYesNoInput(u8); static void Task_WriteMailToGiveMonAfterText(u8); static void CB2_ReturnToPartyMenuFromWritingMail(void); static void Task_DisplayGaveMailFromPartyMessage(u8); -static void UpdatePartyMonHeldItemSprite(struct Pokemon*, struct PartyMenuBox*); +static void UpdatePartyMonHeldItemSprite(struct Pokemon *, struct PartyMenuBox *); static void Task_TossHeldItemYesNo(u8 taskId); static void Task_HandleTossHeldItemYesNoInput(u8); static void Task_TossHeldItem(u8); @@ -298,20 +298,20 @@ static void Task_FieldMoveExitAreaYesNo(u8); static void Task_HandleFieldMoveExitAreaYesNoInput(u8); static void Task_FieldMoveWaitForFade(u8); static u16 GetFieldMoveMonSpecies(void); -static void UpdatePartyMonHPBar(u8, struct Pokemon*); -static void SpriteCB_UpdatePartyMonIcon(struct Sprite*); -static void SpriteCB_BouncePartyMonIcon(struct Sprite*); -static void ShowOrHideHeldItemSprite(u16, struct PartyMenuBox*); +static void UpdatePartyMonHPBar(u8, struct Pokemon *); +static void SpriteCB_UpdatePartyMonIcon(struct Sprite *); +static void SpriteCB_BouncePartyMonIcon(struct Sprite *); +static void ShowOrHideHeldItemSprite(u16, struct PartyMenuBox *); static void CreateHeldItemSpriteForTrade(u8, bool8); -static void SpriteCB_HeldItem(struct Sprite*); -static void SetPartyMonAilmentGfx(struct Pokemon*, struct PartyMenuBox*); -static void UpdatePartyMonAilmentGfx(u8, struct PartyMenuBox*); +static void SpriteCB_HeldItem(struct Sprite *); +static void SetPartyMonAilmentGfx(struct Pokemon *, struct PartyMenuBox *); +static void UpdatePartyMonAilmentGfx(u8, struct PartyMenuBox *); static u8 GetPartyLayoutFromBattleType(void); static void Task_SetSacredAshCB(u8); static void CB2_ReturnToBagMenu(void); static void Task_DisplayHPRestoredMessage(u8); -static u16 ItemEffectToMonEv(struct Pokemon*, u8); -static void ItemEffectToStatString(u8, u8*); +static u16 ItemEffectToMonEv(struct Pokemon *, u8); +static void ItemEffectToStatString(u8, u8 *); static void ReturnToUseOnWhichMon(u8); static void SetSelectedMoveForPPItem(u8); static void TryUsePPItem(u8); @@ -331,8 +331,8 @@ static void Task_PartyMenuReplaceMove(u8); static void Task_StopLearningMoveYesNo(u8); static void Task_HandleStopLearningMoveYesNoInput(u8); static void Task_TryLearningNextMoveAfterText(u8); -static void BufferMonStatsToTaskData(struct Pokemon*, s16*); -static void UpdateMonDisplayInfoAfterRareCandy(u8, struct Pokemon*); +static void BufferMonStatsToTaskData(struct Pokemon *, s16 *); +static void UpdateMonDisplayInfoAfterRareCandy(u8, struct Pokemon *); static void Task_DisplayLevelUpStatsPg1(u8); static void DisplayLevelUpStatsPg1(u8); static void Task_DisplayLevelUpStatsPg2(u8); @@ -356,14 +356,14 @@ static bool8 ReturnGiveItemToBagOrPC(u16); static void Task_DisplayGaveMailFromBagMessage(u8); static void Task_HandleSwitchItemsFromBagYesNoInput(u8); static void Task_ValidateChosenHalfParty(u8); -static bool8 GetBattleEntryEligibility(struct Pokemon*); +static bool8 GetBattleEntryEligibility(struct Pokemon *); static bool8 HasPartySlotAlreadyBeenSelected(u8); static u8 GetBattleEntryLevelCap(void); static u8 GetMaxBattleEntries(void); static u8 GetMinBattleEntries(void); static void Task_ContinueChoosingHalfParty(u8); -static void BufferBattlePartyOrder(u8*, bool8); -static void BufferBattlePartyOrderBySide(u8*, u8, u8); +static void BufferBattlePartyOrder(u8 *, bool8); +static void BufferBattlePartyOrderBySide(u8 *, u8, u8); static void Task_InitMultiPartnerPartySlideIn(u8); static void Task_MultiPartnerPartySlideIn(u8); static void SlideMultiPartyMenuBoxSpritesOneStep(u8); @@ -376,7 +376,7 @@ static void Task_ChoosePartyMon(u8 taskId); static void Task_ChooseMonForMoveRelearner(u8); static void CB2_ChooseMonForMoveRelearner(void); static void Task_BattlePyramidChooseMonHeldItems(u8); -static void ShiftMoveSlot(struct Pokemon*, u8, u8); +static void ShiftMoveSlot(struct Pokemon *, u8, u8); static void BlitBitmapToPartyWindow_LeftColumn(u8, u8, u8, u8, u8, bool8); static void BlitBitmapToPartyWindow_RightColumn(u8, u8, u8, u8, u8, bool8); static void CursorCb_Summary(u8); @@ -972,7 +972,7 @@ static bool8 RenderPartyMenuBoxes(void) return FALSE; } -static u8* GetPartyMenuBgTile(u16 tileId) +static u8 *GetPartyMenuBgTile(u16 tileId) { return &sPartyBgGfxTilemap[tileId << 5]; } @@ -1203,7 +1203,7 @@ void Task_HandleChooseMonInput(u8 taskId) } } -static s8* GetCurrentPartySlotPtr(void) +static s8 *GetCurrentPartySlotPtr(void) { if (gPartyMenu.action == PARTY_ACTION_SWITCH || gPartyMenu.action == PARTY_ACTION_SOFTBOILED) return &gPartyMenu.slotId2; @@ -1222,14 +1222,14 @@ static void HandleChooseMonSelection(u8 taskId, s8 *slotPtr) switch (gPartyMenu.action) { case PARTY_ACTION_SOFTBOILED: - if (IsSelectedMonNotEgg((u8*)slotPtr)) + if (IsSelectedMonNotEgg((u8 *)slotPtr)) { PartyMenuRemoveWindow(&sPartyMenuInternal->windowId[1]); Task_TryUseSoftboiledOnPartyMon(taskId); } break; case PARTY_ACTION_USE_ITEM: - if (IsSelectedMonNotEgg((u8*)slotPtr)) + if (IsSelectedMonNotEgg((u8 *)slotPtr)) { if (gPartyMenu.menuType == PARTY_MENU_TYPE_IN_BATTLE) sPartyMenuInternal->exitCallback = CB2_SetUpExitToBattleScreen; @@ -1239,7 +1239,7 @@ static void HandleChooseMonSelection(u8 taskId, s8 *slotPtr) } break; case PARTY_ACTION_MOVE_TUTOR: - if (IsSelectedMonNotEgg((u8*)slotPtr)) + if (IsSelectedMonNotEgg((u8 *)slotPtr)) { PlaySE(SE_SELECT); PartyMenuRemoveWindow(&sPartyMenuInternal->windowId[1]); @@ -1247,7 +1247,7 @@ static void HandleChooseMonSelection(u8 taskId, s8 *slotPtr) } break; case PARTY_ACTION_GIVE_MAILBOX_MAIL: - if (IsSelectedMonNotEgg((u8*)slotPtr)) + if (IsSelectedMonNotEgg((u8 *)slotPtr)) { PlaySE(SE_SELECT); PartyMenuRemoveWindow(&sPartyMenuInternal->windowId[1]); @@ -1256,7 +1256,7 @@ static void HandleChooseMonSelection(u8 taskId, s8 *slotPtr) break; case PARTY_ACTION_GIVE_ITEM: case PARTY_ACTION_GIVE_PC_ITEM: - if (IsSelectedMonNotEgg((u8*)slotPtr)) + if (IsSelectedMonNotEgg((u8 *)slotPtr)) { PlaySE(SE_SELECT); PartyMenuRemoveWindow(&sPartyMenuInternal->windowId[1]); @@ -1272,7 +1272,7 @@ static void HandleChooseMonSelection(u8 taskId, s8 *slotPtr) Task_ClosePartyMenu(taskId); break; case PARTY_ACTION_MINIGAME: - if (IsSelectedMonNotEgg((u8*)slotPtr)) + if (IsSelectedMonNotEgg((u8 *)slotPtr)) { TryEnterMonForMinigame(taskId, (u8)*slotPtr); } @@ -1329,7 +1329,7 @@ static void HandleChooseMonCancel(u8 taskId, s8 *slotPtr) static bool8 DisplayCancelChooseMonYesNo(u8 taskId) { - const u8* stringPtr = NULL; + const u8 *stringPtr = NULL; if (gPartyMenu.menuType == PARTY_MENU_TYPE_CONTEST) stringPtr = gText_CancelParticipation; @@ -1617,7 +1617,7 @@ static s8 GetNewSlotDoubleLayout(s8 slotId, s8 movementDir) } } -u8* GetMonNickname(struct Pokemon *mon, u8 *dest) +u8 *GetMonNickname(struct Pokemon *mon, u8 *dest) { GetMonData(mon, MON_DATA_NICKNAME, dest); return StringGet_Nickname(dest); @@ -1625,7 +1625,7 @@ u8* GetMonNickname(struct Pokemon *mon, u8 *dest) #define tKeepOpen data[0] -u8 DisplayPartyMenuMessage(const u8* str, bool8 keepOpen) +u8 DisplayPartyMenuMessage(const u8 *str, bool8 keepOpen) { u8 taskId; @@ -1732,7 +1732,7 @@ static void GiveItemToMon(struct Pokemon *mon, u16 item) SetMonData(mon, MON_DATA_HELD_ITEM, itemBytes); } -static u8 TryTakeMonItem(struct Pokemon* mon) +static u8 TryTakeMonItem(struct Pokemon *mon) { u16 item = GetMonData(mon, MON_DATA_HELD_ITEM); @@ -2064,7 +2064,7 @@ static void CreateCancelConfirmWindows(bool8 chooseHalf) } } -static u16* GetPartyMenuPalBufferPtr(u8 paletteId) +static u16 *GetPartyMenuPalBufferPtr(u8 paletteId) { return &sPartyMenuInternal->palBuffer[paletteId]; } @@ -5655,7 +5655,7 @@ static u8 GetBattleEntryLevelCap(void) } } -static const u8* GetFacilityCancelString(void) +static const u8 *GetFacilityCancelString(void) { u8 facilityNum = VarGet(VAR_FRONTIER_FACILITY); diff --git a/src/player_pc.c b/src/player_pc.c index 07a51a7dd..288b99990 100644 --- a/src/player_pc.c +++ b/src/player_pc.c @@ -161,7 +161,7 @@ static void ItemStorage_HandleRemoveItem(u8); static void ItemStorage_HandleErrorMessageInput(u8); static void ItemStorage_ReturnToListInput(u8); -static const u8* ItemStorage_GetMessage(u16); +static const u8 *ItemStorage_GetMessage(u16); static void CopyItemName_PlayerPC(u8 *, u16); static void ItemStorage_Init(void); @@ -1039,7 +1039,7 @@ static void ItemStorage_PrintMenuItem(u8 windowId, u32 id, u8 yOffset) static void ItemStorage_PrintDescription(s32 id) { - const u8* description; + const u8 *description; u8 windowId = sItemStorageMenu->windowIds[ITEMPC_WIN_MESSAGE]; // Get item description (or Cancel text) @@ -1088,7 +1088,7 @@ static void ItemStorage_DrawSwapArrow(u8 y, u8 b, u8 speed) static void ItemStorage_DrawItemIcon(u16 itemId) { u8 spriteId; - u8* spriteIdLoc = &sItemStorageMenu->spriteId; + u8 *spriteIdLoc = &sItemStorageMenu->spriteId; if (*spriteIdLoc == SPRITE_NONE) { @@ -1107,7 +1107,7 @@ static void ItemStorage_DrawItemIcon(u16 itemId) static void ItemStorage_EraseItemIcon(void) { - u8* spriteIdLoc = &sItemStorageMenu->spriteId; + u8 *spriteIdLoc = &sItemStorageMenu->spriteId; if (*spriteIdLoc != SPRITE_NONE) { FreeSpriteTilesByTag(TAG_ITEM_ICON); @@ -1133,7 +1133,7 @@ static void ItemStorage_CreateListMenu(u8 taskId) s16 *data; bool32 toss; u32 i, x; - const u8* text; + const u8 *text; data = gTasks[taskId].data; for (i = 0; i <= ITEMPC_WIN_LIST_END; i++) @@ -1154,7 +1154,7 @@ static void ItemStorage_CreateListMenu(u8 taskId) gTasks[taskId].func = ItemStorage_ProcessInput; } -static const u8* ItemStorage_GetMessage(u16 itemId) +static const u8 *ItemStorage_GetMessage(u16 itemId) { const u8 *string; diff --git a/src/pokeball.c b/src/pokeball.c index 42751eb31..de23ac1ef 100644 --- a/src/pokeball.c +++ b/src/pokeball.c @@ -667,7 +667,7 @@ static void Task_PlayCryWhenReleasedFromBall(u8 taskId) u16 species = gTasks[taskId].tCryTaskSpecies; u8 battlerId = gTasks[taskId].tCryTaskBattler; u8 monSpriteId = gTasks[taskId].tCryTaskMonSpriteId; - struct Pokemon *mon = (void*)(u32)((gTasks[taskId].tCryTaskMonPtr1 << 16) | (u16)(gTasks[taskId].tCryTaskMonPtr2)); + struct Pokemon *mon = (void *)(u32)((gTasks[taskId].tCryTaskMonPtr1 << 16) | (u16)(gTasks[taskId].tCryTaskMonPtr2)); switch (gTasks[taskId].tCryTaskState) { diff --git a/src/pokeblock_feed.c b/src/pokeblock_feed.c index 14170763f..7e71f255b 100644 --- a/src/pokeblock_feed.c +++ b/src/pokeblock_feed.c @@ -466,7 +466,7 @@ static const struct WindowTemplate sWindowTemplates[] = }; // - 1 excludes PBLOCK_CLR_NONE -static const u32* const sPokeblocksPals[] = +static const u32 *const sPokeblocksPals[] = { [PBLOCK_CLR_RED - 1] = gPokeblockRed_Pal, [PBLOCK_CLR_BLUE - 1] = gPokeblockBlue_Pal, @@ -905,7 +905,7 @@ static void Task_FadeOutPokeblockFeed(u8 taskId) #define sAccel data[1] #define sSpecies data[2] -static u8 CreateMonSprite(struct Pokemon* mon) +static u8 CreateMonSprite(struct Pokemon *mon) { u16 species = GetMonData(mon, MON_DATA_SPECIES2); u8 spriteId = CreateSprite(&gMultiuseSpriteTemplate, MON_X, MON_Y, 2); @@ -937,7 +937,7 @@ static void StartMonJumpForPokeblock(u8 spriteId) gSprites[spriteId].callback = SpriteCB_MonJumpForPokeblock; } -static void SpriteCB_MonJumpForPokeblock(struct Sprite* sprite) +static void SpriteCB_MonJumpForPokeblock(struct Sprite *sprite) { sprite->x += 4; sprite->y += sprite->sSpeed; @@ -982,7 +982,7 @@ static u8 CreatePokeblockSprite(void) return spriteId; } -static void SpriteCB_ThrownPokeblock(struct Sprite* sprite) +static void SpriteCB_ThrownPokeblock(struct Sprite *sprite) { sprite->x -= 4; sprite->y += sprite->sSpeed; diff --git a/src/pokedex.c b/src/pokedex.c index 9592aee9c..fceb065aa 100644 --- a/src/pokedex.c +++ b/src/pokedex.c @@ -239,9 +239,9 @@ static void SpriteCB_RotatingPokeBall(struct Sprite *sprite); static void SpriteCB_SeenOwnInfo(struct Sprite *sprite); static void SpriteCB_DexListStartMenuCursor(struct Sprite *sprite); static void SpriteCB_PokedexListMonSprite(struct Sprite *sprite); -static u8 LoadInfoScreen(struct PokedexListItem*, u8 monSpriteId); +static u8 LoadInfoScreen(struct PokedexListItem *, u8 monSpriteId); static bool8 IsInfoScreenScrolling(u8); -static u8 StartInfoScreenScroll(struct PokedexListItem*, u8); +static u8 StartInfoScreenScroll(struct PokedexListItem *, u8); static void Task_LoadInfoScreen(u8); static void Task_HandleInfoScreenInput(u8); static void Task_SwitchScreensFromInfoScreen(u8); @@ -294,10 +294,10 @@ static void PrintSearchParameterText(u8); static u8 GetSearchModeSelection(u8 taskId, u8 option); static void SetDefaultSearchModeAndOrder(u8); static void CreateSearchParameterScrollArrows(u8); -static void EraseAndPrintSearchTextBox(const u8*); +static void EraseAndPrintSearchTextBox(const u8 *); static void EraseSelectorArrow(u32); static void PrintSelectorArrow(u32); -static void PrintSearchParameterTitle(u32, const u8*); +static void PrintSearchParameterTitle(u32, const u8 *); static void ClearSearchParameterBoxText(void); // const rom data @@ -2154,7 +2154,7 @@ static void LoadPokedexBgPalette(bool8 isSearchResults) static void FreeWindowAndBgBuffers(void) { - void* tilemapBuffer; + void *tilemapBuffer; FreeAllWindowBuffers(); tilemapBuffer = GetBgTilemapBuffer(0); @@ -2317,7 +2317,7 @@ static void CreatePokedexList(u8 dexMode, u8 order) } } -static void PrintMonDexNumAndName(u8 windowId, u8 fontId, const u8* str, u8 left, u8 top) +static void PrintMonDexNumAndName(u8 windowId, u8 fontId, const u8 *str, u8 left, u8 top) { u8 color[3]; @@ -2440,7 +2440,7 @@ static void CreateCaughtBall(bool16 owned, u8 x, u8 y, u16 unused) static u8 CreateMonName(u16 num, u8 left, u8 top) { - const u8* str; + const u8 *str; num = NationalPokedexNumToSpecies(num); if (num) @@ -3160,7 +3160,7 @@ static void SpriteCB_DexListStartMenuCursor(struct Sprite *sprite) } } -static void PrintInfoScreenText(const u8* str, u8 left, u8 top) +static void PrintInfoScreenText(const u8 *str, u8 left, u8 top) { u8 color[3]; color[0] = TEXT_COLOR_TRANSPARENT; @@ -3177,7 +3177,7 @@ static void PrintInfoScreenText(const u8* str, u8 left, u8 top) #define tMonSpriteId data[4] #define tTrainerSpriteId data[5] -static u8 LoadInfoScreen(struct PokedexListItem* item, u8 monSpriteId) +static u8 LoadInfoScreen(struct PokedexListItem *item, u8 monSpriteId) { u8 taskId; @@ -3872,7 +3872,7 @@ static void HighlightScreenSelectBarItem(u8 selectedScreen, u16 unused) { u8 i; u8 j; - u16* ptr = GetBgTilemapBuffer(1); + u16 *ptr = GetBgTilemapBuffer(1); for (i = 0; i < SCREEN_COUNT; i++) { @@ -3899,7 +3899,7 @@ static void HighlightSubmenuScreenSelectBarItem(u8 a, u16 b) { u8 i; u8 j; - u16* ptr = GetBgTilemapBuffer(1); + u16 *ptr = GetBgTilemapBuffer(1); for (i = 0; i < 4; i++) { @@ -4511,7 +4511,7 @@ static u8 PrintCryScreenSpeciesName(u8 windowId, u16 num, u8 left, u8 top) return i; } -static void UnusedPrintMonName(u8 windowId, const u8* name, u8 left, u8 top) +static void UnusedPrintMonName(u8 windowId, const u8 *name, u8 left, u8 top) { u8 str[POKEMON_NAME_LENGTH + 1]; u8 i; @@ -4880,7 +4880,7 @@ static void Task_LoadSearchMenu(u8 taskId) static void FreeSearchWindowAndBgBuffers(void) { - void* tilemapBuffer; + void *tilemapBuffer; FreeAllWindowBuffers(); tilemapBuffer = GetBgTilemapBuffer(0); @@ -5419,7 +5419,7 @@ static void DrawOrEraseSearchParameterBox(bool8 erase) { u16 i; u16 j; - u16* ptr = GetBgTilemapBuffer(3); + u16 *ptr = GetBgTilemapBuffer(3); if (!erase) { @@ -5612,7 +5612,7 @@ static void CreateSearchParameterScrollArrows(u8 taskId) #undef sTaskId #undef sIsDownArrow -static void EraseAndPrintSearchTextBox(const u8* str) +static void EraseAndPrintSearchTextBox(const u8 *str) { ClearSearchMenuRect(8, 120, 224, 32); PrintSearchText(str, 8, 121); @@ -5628,7 +5628,7 @@ static void PrintSelectorArrow(u32 y) PrintSearchText(gText_SelectorArrow, 144, y * 16 + 9); } -static void PrintSearchParameterTitle(u32 y, const u8* str) +static void PrintSearchParameterTitle(u32 y, const u8 *str) { PrintSearchText(str, 152, y * 16 + 9); } diff --git a/src/pokedex_cry_screen.c b/src/pokedex_cry_screen.c index 28e2bd163..406d1377d 100644 --- a/src/pokedex_cry_screen.c +++ b/src/pokedex_cry_screen.c @@ -234,7 +234,7 @@ bool8 LoadCryWaveformWindow(struct CryScreenWindow *window, u8 windowId) if (!sDexCryScreen) { sDexCryScreen = AllocZeroed(sizeof(*sDexCryScreen)); - sCryWaveformWindowTiledata = (u8*)GetWindowAttribute(windowId, WINDOW_TILE_DATA); + sCryWaveformWindowTiledata = (u8 *)GetWindowAttribute(windowId, WINDOW_TILE_DATA); } sDexCryScreen->unk = window->unk0; diff --git a/src/pokemon.c b/src/pokemon.c index 60722fe02..3cd983667 100644 --- a/src/pokemon.c +++ b/src/pokemon.c @@ -61,7 +61,7 @@ static void Task_PlayMapChosenOrBattleBGM(u8 taskId); static bool8 ShouldGetStatBadgeBoost(u16 flagId, u8 battlerId); static u16 GiveMoveToBoxMon(struct BoxPokemon *boxMon, u16 move); static bool8 ShouldSkipFriendshipChange(void); -static u8 SendMonToPC(struct Pokemon* mon); +static u8 SendMonToPC(struct Pokemon *mon); EWRAM_DATA static u8 sLearningMoveTableID = 0; EWRAM_DATA u8 gPlayerPartyCount = 0; @@ -3620,7 +3620,7 @@ static union PokemonSubstruct *GetSubstruct(struct BoxPokemon *boxMon, u32 perso return substruct; } -u32 GetMonData(struct Pokemon *mon, s32 field, u8* data) +u32 GetMonData(struct Pokemon *mon, s32 field, u8 *data) { u32 ret; @@ -4390,7 +4390,7 @@ u8 GiveMonToPlayer(struct Pokemon *mon) return MON_GIVEN_TO_PARTY; } -static u8 SendMonToPC(struct Pokemon* mon) +static u8 SendMonToPC(struct Pokemon *mon) { s32 boxNo, boxPos; @@ -4613,7 +4613,7 @@ void RemoveBattleMonPPBonus(struct BattlePokemon *mon, u8 moveIndex) void CopyPlayerPartyMonToBattleData(u8 battlerId, u8 partyIndex) { - u16* hpSwitchout; + u16 *hpSwitchout; s32 i; u8 nickname[POKEMON_NAME_LENGTH * 2]; @@ -6675,7 +6675,7 @@ const u8 *GetTrainerPartnerName(void) } #define READ_PTR_FROM_TASK(taskId, dataId) \ - (void*)( \ + (void *)( \ ((u16)(gTasks[taskId].data[dataId]) | \ ((u16)(gTasks[taskId].data[dataId + 1]) << 16))) @@ -6707,7 +6707,7 @@ static void Task_PokemonSummaryAnimateAfterDelay(u8 taskId) } } -void BattleAnimateFrontSprite(struct Sprite* sprite, u16 species, bool8 noCry, u8 panMode) +void BattleAnimateFrontSprite(struct Sprite *sprite, u16 species, bool8 noCry, u8 panMode) { if (gHitMarker & HITMARKER_NO_ANIMATIONS && !(gBattleTypeFlags & (BATTLE_TYPE_LINK | BATTLE_TYPE_RECORDED_LINK))) DoMonFrontSpriteAnimation(sprite, species, noCry, panMode | SKIP_FRONT_ANIM); @@ -6715,7 +6715,7 @@ void BattleAnimateFrontSprite(struct Sprite* sprite, u16 species, bool8 noCry, u DoMonFrontSpriteAnimation(sprite, species, noCry, panMode); } -void DoMonFrontSpriteAnimation(struct Sprite* sprite, u16 species, bool8 noCry, u8 panModeAnimFlag) +void DoMonFrontSpriteAnimation(struct Sprite *sprite, u16 species, bool8 noCry, u8 panModeAnimFlag) { s8 pan; switch (panModeAnimFlag & (u8)~SKIP_FRONT_ANIM) // Exclude anim flag to get pan mode @@ -6762,7 +6762,7 @@ void DoMonFrontSpriteAnimation(struct Sprite* sprite, u16 species, bool8 noCry, } } -void PokemonSummaryDoMonAnimation(struct Sprite* sprite, u16 species, bool8 oneFrame) +void PokemonSummaryDoMonAnimation(struct Sprite *sprite, u16 species, bool8 oneFrame) { if (!oneFrame && HasTwoFramesAnimation(species)) StartSpriteAnim(sprite, 1); @@ -6790,7 +6790,7 @@ void StopPokemonAnimationDelayTask(void) DestroyTask(delayTaskId); } -void BattleAnimateBackSprite(struct Sprite* sprite, u16 species) +void BattleAnimateBackSprite(struct Sprite *sprite, u16 species) { if (gHitMarker & HITMARKER_NO_ANIMATIONS && !(gBattleTypeFlags & (BATTLE_TYPE_LINK | BATTLE_TYPE_RECORDED_LINK))) { diff --git a/src/pokemon_icon.c b/src/pokemon_icon.c index 2c010f35e..7f9b146a4 100644 --- a/src/pokemon_icon.c +++ b/src/pokemon_icon.c @@ -1186,12 +1186,12 @@ void SpriteCB_MonIcon(struct Sprite *sprite) UpdateMonIconFrame(sprite); } -const u8* GetMonIconTiles(u16 species, bool32 handleDeoxys) +const u8 *GetMonIconTiles(u16 species, bool32 handleDeoxys) { - const u8* iconSprite = gMonIconTable[species]; + const u8 *iconSprite = gMonIconTable[species]; if (species == SPECIES_DEOXYS && handleDeoxys == TRUE) { - iconSprite = (const u8*)(0x400 + (u32)iconSprite); // use the specific Deoxys form icon (Speed in this case) + iconSprite = (const u8 *)(0x400 + (u32)iconSprite); // use the specific Deoxys form icon (Speed in this case) } return iconSprite; } @@ -1225,7 +1225,7 @@ u8 GetMonIconPaletteIndexFromSpecies(u16 species) return gMonIconPaletteIndices[species]; } -const u16* GetValidMonIconPalettePtr(u16 species) +const u16 *GetValidMonIconPalettePtr(u16 species) { if (species > NUM_SPECIES) species = INVALID_ICON_SPECIES; diff --git a/src/pokemon_jump.c b/src/pokemon_jump.c index 32333ee67..ada9a7948 100755 --- a/src/pokemon_jump.c +++ b/src/pokemon_jump.c @@ -3765,7 +3765,7 @@ static void InitDigitPrinters(void) .xDelta = 8, .x = 108, .y = 6, - .spriteSheet = (void*) &sSpriteSheet_Digits, + .spriteSheet = (void *) &sSpriteSheet_Digits, .spritePal = &sSpritePalette_Digits, }; diff --git a/src/pokemon_storage_system.c b/src/pokemon_storage_system.c index 676d6f229..2073712d1 100644 --- a/src/pokemon_storage_system.c +++ b/src/pokemon_storage_system.c @@ -1337,7 +1337,7 @@ void DrawTextWindowAndBufferTiles(const u8 *string, void *dst, u8 zero1, u8 zero winTemplate.height = 2; windowId = AddWindow(&winTemplate); FillWindowPixelBuffer(windowId, PIXEL_FILL(zero2)); - tileData1 = (u8*) GetWindowAttribute(windowId, WINDOW_TILE_DATA); + tileData1 = (u8 *) GetWindowAttribute(windowId, WINDOW_TILE_DATA); tileData2 = (winTemplate.width * TILE_SIZE_4BPP) + tileData1; if (!zero1) @@ -1385,7 +1385,7 @@ static void UnusedDrawTextWindow(const u8 *string, void *dst, u16 offset, u8 bgC tilesSize = winTemplate.width * TILE_SIZE_4BPP; windowId = AddWindow(&winTemplate); FillWindowPixelBuffer(windowId, PIXEL_FILL(bgColor)); - tileData1 = (u8*) GetWindowAttribute(windowId, WINDOW_TILE_DATA); + tileData1 = (u8 *) GetWindowAttribute(windowId, WINDOW_TILE_DATA); tileData2 = (winTemplate.width * TILE_SIZE_4BPP) + tileData1; txtColor[0] = bgColor; txtColor[1] = fgColor; @@ -3871,7 +3871,7 @@ static void CreateMarkingComboSprite(void) sStorage->markingComboSprite->subpriority = 1; sStorage->markingComboSprite->x = 40; sStorage->markingComboSprite->y = 150; - sStorage->markingComboTilesPtr = (void*) OBJ_VRAM0 + 32 * GetSpriteTileStartByTag(GFXTAG_MARKING_COMBO); + sStorage->markingComboTilesPtr = (void *) OBJ_VRAM0 + 32 * GetSpriteTileStartByTag(GFXTAG_MARKING_COMBO); } static void CreateWaveformSprites(void) @@ -3959,7 +3959,7 @@ static void CreateDisplayMonSprite(void) sStorage->displayMonSprite = &gSprites[spriteId]; sStorage->displayMonPalOffset = palSlot * 16 + 0x100; - sStorage->displayMonTilePtr = (void*) OBJ_VRAM0 + tileStart * TILE_SIZE_4BPP; + sStorage->displayMonTilePtr = (void *) OBJ_VRAM0 + tileStart * TILE_SIZE_4BPP; } while (0); if (sStorage->displayMonSprite == NULL) @@ -5119,7 +5119,7 @@ static u16 TryLoadMonIconTiles(u16 species) sStorage->iconSpeciesList[i] = species; sStorage->numIconsPerSpecies[i]++; offset = 16 * i; - CpuCopy32(GetMonIconTiles(species, TRUE), (void*)(OBJ_VRAM0) + offset * TILE_SIZE_4BPP, 0x200); + CpuCopy32(GetMonIconTiles(species, TRUE), (void *)(OBJ_VRAM0) + offset * TILE_SIZE_4BPP, 0x200); return offset; } @@ -6555,7 +6555,7 @@ static void InitCanReleaseMonVars(void) } GetRestrictedReleaseMoves(sStorage->restrictedMoveList); - sStorage->restrictedReleaseMonMoves = GetMonData(&sStorage->tempMon, MON_DATA_KNOWN_MOVES, (u8*)sStorage->restrictedMoveList); + sStorage->restrictedReleaseMonMoves = GetMonData(&sStorage->tempMon, MON_DATA_KNOWN_MOVES, (u8 *)sStorage->restrictedMoveList); if (sStorage->restrictedReleaseMonMoves != 0) { // Pokémon knows at least one restricted release move @@ -6621,7 +6621,7 @@ static s8 RunCanReleaseMon(void) // Make sure party Pokémon isn't the one we're releasing first if (sStorage->releaseBoxId != TOTAL_BOXES_COUNT || sStorage->releaseBoxPos != i) { - knownMoves = GetMonData(&gPlayerParty[i], MON_DATA_KNOWN_MOVES, (u8*)sStorage->restrictedMoveList); + knownMoves = GetMonData(&gPlayerParty[i], MON_DATA_KNOWN_MOVES, (u8 *)sStorage->restrictedMoveList); sStorage->restrictedReleaseMonMoves &= ~(knownMoves); } } @@ -6646,7 +6646,7 @@ static s8 RunCanReleaseMon(void) // moves the release Pokémon knows for (i = 0; i < IN_BOX_COUNT; i++) { - knownMoves = GetAndCopyBoxMonDataAt(sStorage->releaseCheckBoxId, sStorage->releaseCheckBoxPos, MON_DATA_KNOWN_MOVES, (u8*)sStorage->restrictedMoveList); + knownMoves = GetAndCopyBoxMonDataAt(sStorage->releaseCheckBoxId, sStorage->releaseCheckBoxPos, MON_DATA_KNOWN_MOVES, (u8 *)sStorage->restrictedMoveList); if (knownMoves != 0 && !(sStorage->releaseBoxId == sStorage->releaseCheckBoxId && sStorage->releaseBoxPos == sStorage->releaseCheckBoxPos)) { @@ -8010,7 +8010,7 @@ static void AddMenu(void) sStorage->menuWindowId = AddWindow(&sStorage->menuWindow); ClearWindowTilemap(sStorage->menuWindowId); DrawStdFrameWithCustomTileAndPalette(sStorage->menuWindowId, FALSE, 11, 14); - PrintMenuTable(sStorage->menuWindowId, sStorage->menuItemsCount, (void*)sStorage->menuItems); + PrintMenuTable(sStorage->menuWindowId, sStorage->menuItemsCount, (void *)sStorage->menuItems); InitMenuInUpperLeftCornerNormal(sStorage->menuWindowId, sStorage->menuItemsCount, 0); ScheduleBgCopyTilemapToVram(0); sStorage->menuUnusedField = 0; @@ -8743,7 +8743,7 @@ static void CreateItemIconSprites(void) { spriteSheet.tag = GFXTAG_ITEM_ICON_0 + i; LoadCompressedSpriteSheet(&spriteSheet); - sStorage->itemIcons[i].tiles = GetSpriteTileStartByTag(spriteSheet.tag) * TILE_SIZE_4BPP + (void*)(OBJ_VRAM0); + sStorage->itemIcons[i].tiles = GetSpriteTileStartByTag(spriteSheet.tag) * TILE_SIZE_4BPP + (void *)(OBJ_VRAM0); sStorage->itemIcons[i].palIndex = AllocSpritePalette(PALTAG_ITEM_ICON_0 + i); sStorage->itemIcons[i].palIndex *= 16; sStorage->itemIcons[i].palIndex += 0x100; @@ -9648,7 +9648,7 @@ bool32 AnyStorageMonWithMove(u16 moveId) { if (GetBoxMonData(&gPokemonStoragePtr->boxes[i][j], MON_DATA_SANITY_HAS_SPECIES) && !GetBoxMonData(&gPokemonStoragePtr->boxes[i][j], MON_DATA_SANITY_IS_EGG) - && GetBoxMonData(&gPokemonStoragePtr->boxes[i][j], MON_DATA_KNOWN_MOVES, (u8*)moves)) + && GetBoxMonData(&gPokemonStoragePtr->boxes[i][j], MON_DATA_KNOWN_MOVES, (u8 *)moves)) return TRUE; } } diff --git a/src/pokemon_summary_screen.c b/src/pokemon_summary_screen.c index c25d58ae6..6a4612a20 100644 --- a/src/pokemon_summary_screen.c +++ b/src/pokemon_summary_screen.c @@ -195,8 +195,8 @@ static bool8 LoadGraphics(void); static void CB2_InitSummaryScreen(void); static void InitBGs(void); static bool8 DecompressGraphics(void); -static void CopyMonToSummaryStruct(struct Pokemon*); -static bool8 ExtractMonDataToSummaryStruct(struct Pokemon*); +static void CopyMonToSummaryStruct(struct Pokemon *); +static bool8 ExtractMonDataToSummaryStruct(struct Pokemon *); static void SetDefaultTilemaps(void); static void CloseSummaryScreen(u8); static void Task_HandleInput(u8); @@ -204,7 +204,7 @@ static void ChangeSummaryPokemon(u8, s8); static void Task_ChangeSummaryMon(u8); static s8 AdvanceMonIndex(s8); static s8 AdvanceMultiBattleMonIndex(s8); -static bool8 IsValidToViewInMulti(struct Pokemon*); +static bool8 IsValidToViewInMulti(struct Pokemon *); static void ChangePage(u8, s8); static void PssScrollRight(u8); static void PssScrollRightEnd(u8); @@ -234,8 +234,8 @@ static void Task_ShowAppealJamWindow(u8); static void HandleStatusTilemap(u16, s16); static void Task_ShowStatusWindow(u8); static void TilemapFiveMovesDisplay(u16 *, u16, bool8); -static void DrawPokerusCuredSymbol(struct Pokemon*); -static void DrawExperienceProgressBar(struct Pokemon*); +static void DrawPokerusCuredSymbol(struct Pokemon *); +static void DrawExperienceProgressBar(struct Pokemon *); static void DrawContestMoveHearts(u16); static void LimitEggSummaryPageDisplay(void); static void ResetWindows(void); @@ -1725,7 +1725,7 @@ static s8 AdvanceMultiBattleMonIndex(s8 delta) } } -static bool8 IsValidToViewInMulti(struct Pokemon* mon) +static bool8 IsValidToViewInMulti(struct Pokemon *mon) { if (GetMonData(mon, MON_DATA_SPECIES) == SPECIES_NONE) return FALSE; @@ -2027,7 +2027,7 @@ static void SwitchToMovePositionSwitchMode(u8 taskId) static void Task_HandleInput_MovePositionSwitch(u8 taskId) { - s16* data = gTasks[taskId].data; + s16 *data = gTasks[taskId].data; if (MenuHelpers_ShouldWaitForLinkRecv() != TRUE) { @@ -2168,7 +2168,7 @@ static void Task_SetHandleReplaceMoveInput(u8 taskId) static void Task_HandleReplaceMoveInput(u8 taskId) { - s16* data = gTasks[taskId].data; + s16 *data = gTasks[taskId].data; if (MenuHelpers_ShouldWaitForLinkRecv() != TRUE) { @@ -2244,7 +2244,7 @@ static void ShowCantForgetHMsWindow(u8 taskId) // This redraws the power/accuracy window when the player scrolls out of the "HM Moves can't be forgotten" message static void Task_HandleInputCantForgetHMsMoves(u8 taskId) { - s16* data = gTasks[taskId].data; + s16 *data = gTasks[taskId].data; u16 move; if (FuncIsActiveTask(Task_ShowPowerAccWindow) != 1) { diff --git a/src/pokenav_conditions_gfx.c b/src/pokenav_conditions_gfx.c index 60c505201..5631f5bb2 100644 --- a/src/pokenav_conditions_gfx.c +++ b/src/pokenav_conditions_gfx.c @@ -826,7 +826,7 @@ static void CreateConditionMonPic(u8 id) { menu->monPicSpriteId = spriteId; gSprites[menu->monPicSpriteId].callback = MonPicGfxSpriteCallback; - menu->monGfxPtr = (void*)VRAM + BG_VRAM_SIZE + (menu->monGfxTileStart * 32); + menu->monGfxPtr = (void *)VRAM + BG_VRAM_SIZE + (menu->monGfxTileStart * 32); menu->monPalIndex = (menu->monPalIndex * 16) + 0x100; } } diff --git a/src/pokenav_conditions_search_results.c b/src/pokenav_conditions_search_results.c index 540102ee4..d0d2b7c55 100644 --- a/src/pokenav_conditions_search_results.c +++ b/src/pokenav_conditions_search_results.c @@ -267,7 +267,7 @@ static u32 BuildPartyMonSearchResults(s32 state) item.boxId = TOTAL_BOXES_COUNT; for (i = 0; i < PARTY_SIZE; i++) { - struct Pokemon * pokemon = &gPlayerParty[i]; + struct Pokemon *pokemon = &gPlayerParty[i]; if (!GetMonData(pokemon, MON_DATA_SANITY_HAS_SPECIES)) return LT_INC_AND_CONTINUE; if (!GetMonData(pokemon, MON_DATA_SANITY_IS_EGG)) @@ -697,7 +697,7 @@ static void BufferSearchMonListItem(struct PokenavMonListItem * item, u8 * dest) // Mon is in party if (item->boxId == TOTAL_BOXES_COUNT) { - struct Pokemon * mon = &gPlayerParty[item->monId]; + struct Pokemon *mon = &gPlayerParty[item->monId]; gender = GetMonGender(mon); level = GetLevelFromMonExp(mon); GetMonData(mon, MON_DATA_NICKNAME, gStringVar3); diff --git a/src/pokenav_list.c b/src/pokenav_list.c index 6e5a22eb1..ed3d40dee 100644 --- a/src/pokenav_list.c +++ b/src/pokenav_list.c @@ -665,7 +665,7 @@ static u32 LoopedTask_ReshowListFromCheckPage(s32 state) static void EraseListEntry(struct PokenavListMenuWindow *listWindow, s32 offset, s32 entries) { - u8 *tileData = (u8*)GetWindowAttribute(listWindow->windowId, WINDOW_TILE_DATA); + u8 *tileData = (u8 *)GetWindowAttribute(listWindow->windowId, WINDOW_TILE_DATA); u32 width = listWindow->width * 64; offset = (listWindow->unkA + offset) & 0xF; @@ -694,7 +694,7 @@ static void EraseListEntry(struct PokenavListMenuWindow *listWindow, s32 offset, static void SetListMarginTile(struct PokenavListMenuWindow *listWindow, bool32 draw) { u16 var; - u16 *tilemapBuffer = (u16*)GetBgTilemapBuffer(GetWindowAttribute(listWindow->windowId, WINDOW_BG)); + u16 *tilemapBuffer = (u16 *)GetBgTilemapBuffer(GetWindowAttribute(listWindow->windowId, WINDOW_BG)); tilemapBuffer += (listWindow->unkA << 6) + listWindow->x - 1; if (draw) diff --git a/src/pokenav_main_menu.c b/src/pokenav_main_menu.c index 7d668c67f..c51ab10ba 100644 --- a/src/pokenav_main_menu.c +++ b/src/pokenav_main_menu.c @@ -50,7 +50,7 @@ static void InitHelpBar(void); static u32 LoopedTask_SlideMenuHeaderUp(s32); static u32 LoopedTask_SlideMenuHeaderDown(s32); static void DrawHelpBar(u32); -static void SpriteCB_SpinningPokenav(struct Sprite*); +static void SpriteCB_SpinningPokenav(struct Sprite *); static u32 LoopedTask_InitPokenavMenu(s32); static const u16 sSpinningPokenav_Pal[] = INCBIN_U16("graphics/pokenav/nav_icon.gbapal"); diff --git a/src/pokenav_match_call_list.c b/src/pokenav_match_call_list.c index d56cfdb62..b00c76b48 100755 --- a/src/pokenav_match_call_list.c +++ b/src/pokenav_match_call_list.c @@ -24,7 +24,7 @@ struct Pokenav_MatchCallMenu u16 numSpecialTrainers; bool32 initFinished; u32 loopedTaskId; - u32 (*callback)(struct Pokenav_MatchCallMenu*); + u32 (*callback)(struct Pokenav_MatchCallMenu *); struct PokenavMatchCallEntry matchCallEntries[MAX_REMATCH_ENTRIES - 1]; }; diff --git a/src/pokenav_menu_handler.c b/src/pokenav_menu_handler.c index b72247742..b81b4c892 100644 --- a/src/pokenav_menu_handler.c +++ b/src/pokenav_menu_handler.c @@ -12,7 +12,7 @@ struct Pokenav_Menu u16 currMenuItem; u16 helpBarIndex; u32 menuId; - u32 (*callback)(struct Pokenav_Menu*); + u32 (*callback)(struct Pokenav_Menu *); }; static bool32 UpdateMenuCursorPos(struct Pokenav_Menu *); @@ -28,7 +28,7 @@ static u32 HandleCantOpenRibbonsInput(struct Pokenav_Menu *); static u32 HandleMainMenuInputEndTutorial(struct Pokenav_Menu *); static u32 HandleMainMenuInputTutorial(struct Pokenav_Menu *); static u32 HandleMainMenuInput(struct Pokenav_Menu *); -static u32 (*GetMainMenuInputHandler(void))(struct Pokenav_Menu*); +static u32 (*GetMainMenuInputHandler(void))(struct Pokenav_Menu *); static void SetMenuInputHandler(struct Pokenav_Menu *); // Number of entries - 1 for that menu type @@ -186,7 +186,7 @@ static void SetMenuInputHandler(struct Pokenav_Menu *menu) } } -static u32 (*GetMainMenuInputHandler(void))(struct Pokenav_Menu*) +static u32 (*GetMainMenuInputHandler(void))(struct Pokenav_Menu *) { switch (GetPokenavMode()) { diff --git a/src/pokenav_ribbons_list.c b/src/pokenav_ribbons_list.c index 81e4f38bd..ca5559d96 100644 --- a/src/pokenav_ribbons_list.c +++ b/src/pokenav_ribbons_list.c @@ -22,7 +22,7 @@ enum struct Pokenav_RibbonsMonList { - u32 (*callback)(struct Pokenav_RibbonsMonList*); + u32 (*callback)(struct Pokenav_RibbonsMonList *); u32 loopedTaskId; u16 winid; s32 boxId; @@ -256,7 +256,7 @@ static u32 BuildPartyMonRibbonList(s32 state) item.boxId = TOTAL_BOXES_COUNT; for (i = 0; i < PARTY_SIZE; i++) { - struct Pokemon * pokemon = &gPlayerParty[i]; + struct Pokemon *pokemon = &gPlayerParty[i]; if (!GetMonData(pokemon, MON_DATA_SANITY_HAS_SPECIES)) return LT_INC_AND_CONTINUE; if (!GetMonData(pokemon, MON_DATA_SANITY_IS_EGG) && !GetMonData(pokemon, MON_DATA_SANITY_IS_BAD_EGG)) @@ -707,7 +707,7 @@ static void BufferRibbonMonInfoText(struct PokenavListItem * listItem, u8 * dest // Mon is in party if (item->boxId == TOTAL_BOXES_COUNT) { - struct Pokemon * mon = &gPlayerParty[item->monId]; + struct Pokemon *mon = &gPlayerParty[item->monId]; gender = GetMonGender(mon); level = GetLevelFromMonExp(mon); GetMonData(mon, MON_DATA_NICKNAME, gStringVar3); diff --git a/src/record_mixing.c b/src/record_mixing.c index 18b1d7df2..d19b6f0a2 100644 --- a/src/record_mixing.c +++ b/src/record_mixing.c @@ -1174,7 +1174,7 @@ static void ReceiveApprenticeData(struct Apprentice *records, size_t recordSize, u32 apprenticeSaveId; ShufflePlayerIndices(mixIndices); - mixApprentice = (void*)records + (recordSize * mixIndices[multiplayerId]); + mixApprentice = (void *)records + (recordSize * mixIndices[multiplayerId]); numApprentices = 0; apprenticeId = 0; for (i = 0; i < 2; i++) diff --git a/src/recorded_battle.c b/src/recorded_battle.c index 951572636..8256ce1fc 100644 --- a/src/recorded_battle.c +++ b/src/recorded_battle.c @@ -302,7 +302,7 @@ static bool32 IsRecordedBattleSaveValid(struct RecordedBattleSave *save) return FALSE; if (save->battleFlags & ILLEGAL_BATTLE_TYPES) return FALSE; - if (CalcByteArraySum((void*)(save), sizeof(*save) - 4) != save->checksum) + if (CalcByteArraySum((void *)(save), sizeof(*save) - 4) != save->checksum) return FALSE; return TRUE; @@ -313,9 +313,9 @@ static bool32 RecordedBattleToSave(struct RecordedBattleSave *battleSave, struct memset(saveSector, 0, SECTOR_SIZE); memcpy(saveSector, battleSave, sizeof(*battleSave)); - saveSector->checksum = CalcByteArraySum((void*)(saveSector), sizeof(*saveSector) - 4); + saveSector->checksum = CalcByteArraySum((void *)(saveSector), sizeof(*saveSector) - 4); - if (TryWriteSpecialSaveSector(SECTOR_ID_RECORDED_BATTLE, (void*)(saveSector)) != SAVE_STATUS_OK) + if (TryWriteSpecialSaveSector(SECTOR_ID_RECORDED_BATTLE, (void *)(saveSector)) != SAVE_STATUS_OK) return FALSE; else return TRUE; @@ -481,7 +481,7 @@ bool32 MoveRecordedBattleToSaveData(void) static bool32 TryCopyRecordedBattleSaveData(struct RecordedBattleSave *dst, struct SaveSector *saveBuffer) { - if (TryReadSpecialSaveSector(SECTOR_ID_RECORDED_BATTLE, (void*)(saveBuffer)) != SAVE_STATUS_OK) + if (TryReadSpecialSaveSector(SECTOR_ID_RECORDED_BATTLE, (void *)(saveBuffer)) != SAVE_STATUS_OK) return FALSE; memcpy(dst, saveBuffer, sizeof(struct RecordedBattleSave)); diff --git a/src/reshow_battle_screen.c b/src/reshow_battle_screen.c index 1b49a374c..3a087b7d7 100644 --- a/src/reshow_battle_screen.c +++ b/src/reshow_battle_screen.c @@ -63,7 +63,7 @@ static void CB2_ReshowBattleScreenAfterMenu(void) gBattle_BG3_Y = 0; break; case 1: - CpuFastFill(0, (void*)(VRAM), VRAM_SIZE); + CpuFastFill(0, (void *)(VRAM), VRAM_SIZE); break; case 2: LoadBattleTextboxAndBackground(); diff --git a/src/save.c b/src/save.c index 52cdaa5dd..1f4189fb8 100644 --- a/src/save.c +++ b/src/save.c @@ -689,18 +689,18 @@ static u16 CalculateChecksum(void *data, u16 size) static void UpdateSaveAddresses(void) { int i = SECTOR_ID_SAVEBLOCK2; - gRamSaveSectorLocations[i].data = (void*)(gSaveBlock2Ptr) + sSaveSlotLayout[i].offset; + gRamSaveSectorLocations[i].data = (void *)(gSaveBlock2Ptr) + sSaveSlotLayout[i].offset; gRamSaveSectorLocations[i].size = sSaveSlotLayout[i].size; for (i = SECTOR_ID_SAVEBLOCK1_START; i <= SECTOR_ID_SAVEBLOCK1_END; i++) { - gRamSaveSectorLocations[i].data = (void*)(gSaveBlock1Ptr) + sSaveSlotLayout[i].offset; + gRamSaveSectorLocations[i].data = (void *)(gSaveBlock1Ptr) + sSaveSlotLayout[i].offset; gRamSaveSectorLocations[i].size = sSaveSlotLayout[i].size; } for (; i <= SECTOR_ID_PKMN_STORAGE_END; i++) //setting i to SECTOR_ID_PKMN_STORAGE_START does not match { - gRamSaveSectorLocations[i].data = (void*)(gPokemonStoragePtr) + sSaveSlotLayout[i].offset; + gRamSaveSectorLocations[i].data = (void *)(gPokemonStoragePtr) + sSaveSlotLayout[i].offset; gRamSaveSectorLocations[i].size = sSaveSlotLayout[i].size; } } @@ -924,17 +924,17 @@ u16 GetSaveBlocksPointersBaseOffset(void) return 0; } -u32 TryReadSpecialSaveSector(u8 sector, u8* dst) +u32 TryReadSpecialSaveSector(u8 sector, u8 *dst) { s32 i; s32 size; - u8* savData; + u8 *savData; if (sector != SECTOR_ID_TRAINER_HILL && sector != SECTOR_ID_RECORDED_BATTLE) return SAVE_STATUS_ERROR; ReadFlash(sector, 0, (u8 *)&gSaveDataBuffer, SECTOR_SIZE); - if (*(u32*)(&gSaveDataBuffer.data[0]) != SPECIAL_SECTOR_SENTINEL) + if (*(u32 *)(&gSaveDataBuffer.data[0]) != SPECIAL_SECTOR_SENTINEL) return SAVE_STATUS_ERROR; // Copies whole save sector except u32 counter @@ -946,18 +946,18 @@ u32 TryReadSpecialSaveSector(u8 sector, u8* dst) return SAVE_STATUS_OK; } -u32 TryWriteSpecialSaveSector(u8 sector, u8* src) +u32 TryWriteSpecialSaveSector(u8 sector, u8 *src) { s32 i; s32 size; - u8* savData; - void* savDataBuffer; + u8 *savData; + void *savDataBuffer; if (sector != SECTOR_ID_TRAINER_HILL && sector != SECTOR_ID_RECORDED_BATTLE) return SAVE_STATUS_ERROR; savDataBuffer = &gSaveDataBuffer; - *(u32*)(savDataBuffer) = SPECIAL_SECTOR_SENTINEL; + *(u32 *)(savDataBuffer) = SPECIAL_SECTOR_SENTINEL; // Copies whole save sector except u32 counter i = 0; @@ -978,7 +978,7 @@ u32 TryWriteSpecialSaveSector(u8 sector, u8* src) // Most notably it does save the PC data. void Task_LinkFullSave(u8 taskId) { - s16* data = gTasks[taskId].data; + s16 *data = gTasks[taskId].data; switch (tState) { diff --git a/src/scrcmd.c b/src/scrcmd.c index d6422e898..fe5cf95d7 100644 --- a/src/scrcmd.c +++ b/src/scrcmd.c @@ -2229,7 +2229,7 @@ bool8 ScrCmd_checkmoneventlegal(struct ScriptContext *ctx) bool8 ScrCmd_trywondercardscript(struct ScriptContext *ctx) { - const u8* script = GetSavedRamScriptIfValid(); + const u8 *script = GetSavedRamScriptIfValid(); if (script) { diff --git a/src/script.c b/src/script.c index 4728e739c..9d14a3bc3 100644 --- a/src/script.c +++ b/src/script.c @@ -14,7 +14,7 @@ enum { SCRIPT_MODE_NATIVE, }; -extern const u8* gRamScriptRetAddr; +extern const u8 *gRamScriptRetAddr; static u8 sScriptContext1Status; static struct ScriptContext sScriptContext1; @@ -349,7 +349,7 @@ void TryRunOnWarpIntoMapScript(void) u32 CalculateRamScriptChecksum(void) { - return CalcCRC16WithTable((u8*)(&gSaveBlock1Ptr->ramScript.data), sizeof(gSaveBlock1Ptr->ramScript.data)); + return CalcCRC16WithTable((u8 *)(&gSaveBlock1Ptr->ramScript.data), sizeof(gSaveBlock1Ptr->ramScript.data)); } void ClearRamScript(void) diff --git a/src/shop.c b/src/shop.c index c69bed501..d23c4a564 100755 --- a/src/shop.c +++ b/src/shop.c @@ -63,7 +63,7 @@ static void BuyMenuBuildListMenuTemplate(void); static void BuyMenuInitBgs(void); static void BuyMenuInitWindows(void); static void BuyMenuDecompressBgGraphics(void); -static void BuyMenuSetListEntry(struct ListMenuItem*, u16, u8*); +static void BuyMenuSetListEntry(struct ListMenuItem *, u16, u8 *); static void BuyMenuAddItemIcon(u16, u8); static void BuyMenuRemoveItemIcon(u16, u8); static void BuyMenuPrint(u8 windowId, const u8 *text, u8 x, u8 y, s8 speed, u8 colorSet); @@ -73,7 +73,7 @@ static void BuyMenuCollectObjectEventData(void); static void BuyMenuDrawObjectEvents(void); static void BuyMenuDrawMapBg(void); static bool8 BuyMenuCheckForOverlapWithMenuBg(int, int); -static void BuyMenuDrawMapMetatile(s16, s16, const u16*, u8); +static void BuyMenuDrawMapMetatile(s16, s16, const u16 *, u8); static void BuyMenuDrawMapMetatileLayer(u16 *dest, s16 offset1, s16 offset2, const u16 *src); static bool8 BuyMenuCheckIfObjectEventOverlapsMenuBg(s16 *); static void ExitBuyMenu(u8 taskId); @@ -747,11 +747,11 @@ static void BuyMenuDrawMapBg(void) if (metatile < NUM_METATILES_IN_PRIMARY) { - BuyMenuDrawMapMetatile(i, j, (u16*)mapLayout->primaryTileset->metatiles + metatile * 8, metatileLayerType); + BuyMenuDrawMapMetatile(i, j, (u16 *)mapLayout->primaryTileset->metatiles + metatile * 8, metatileLayerType); } else { - BuyMenuDrawMapMetatile(i, j, (u16*)mapLayout->secondaryTileset->metatiles + ((metatile - NUM_METATILES_IN_PRIMARY) * 8), metatileLayerType); + BuyMenuDrawMapMetatile(i, j, (u16 *)mapLayout->secondaryTileset->metatiles + ((metatile - NUM_METATILES_IN_PRIMARY) * 8), metatileLayerType); } } } diff --git a/src/slot_machine.c b/src/slot_machine.c index cb6a380d6..ffae7f0f4 100644 --- a/src/slot_machine.c +++ b/src/slot_machine.c @@ -605,7 +605,7 @@ static bool8 IsReelTimeSmokeAnimFinished(void); static void DestroyReelTimeSmokeSprite(void); static u8 CreatePikaPowerBoltSprite(s16, s16); static void DestroyPikaPowerBoltSprite(u8); -static u8 CreateDigitalDisplaySprite(u8, void (*callback)(struct Sprite*), s16, s16, s16); +static u8 CreateDigitalDisplaySprite(u8, void (*callback)(struct Sprite *), s16, s16, s16); static void LoadSlotMachineGfx(void); static void LoadReelBackground(void); static void LoadMenuGfx(void); diff --git a/src/sound.c b/src/sound.c index ad9993b54..aa6fb32ee 100644 --- a/src/sound.c +++ b/src/sound.c @@ -156,7 +156,8 @@ void FadeOutAndFadeInNewMapMusic(u16 songNum, u8 fadeOutSpeed, u8 fadeInSpeed) sMapMusicFadeInSpeed = fadeInSpeed; } -void FadeInNewMapMusic(u16 songNum, u8 speed) +// Unused +static void FadeInNewMapMusic(u16 songNum, u8 speed) { FadeInNewBGM(songNum, speed); sCurrentMapMusic = songNum; diff --git a/src/start_menu.c b/src/start_menu.c index 6a5e7c046..316a5063b 100644 --- a/src/start_menu.c +++ b/src/start_menu.c @@ -139,7 +139,7 @@ static bool8 FieldCB_ReturnToFieldStartMenu(void); static const struct WindowTemplate sSafariBallsWindowTemplate = {0, 1, 1, 9, 4, 0xF, 8}; -static const u8* const sPyramidFloorNames[FRONTIER_STAGES_PER_CHALLENGE + 1] = +static const u8 *const sPyramidFloorNames[FRONTIER_STAGES_PER_CHALLENGE + 1] = { gText_Floor1, gText_Floor2, @@ -535,7 +535,7 @@ void ShowReturnToFieldStartMenu(void) void Task_ShowStartMenu(u8 taskId) { - struct Task* task = &gTasks[taskId]; + struct Task *task = &gTasks[taskId]; switch(task->data[0]) { diff --git a/src/trade.c b/src/trade.c index 25614c91a..dc0774e3a 100644 --- a/src/trade.c +++ b/src/trade.c @@ -4821,7 +4821,7 @@ static void CheckPartnersMonForRibbons(void) FlagSet(FLAG_SYS_RIBBON_GET); } -void InitTradeBg(void) +void LoadTradeAnimGfx(void) { InitTradeBgInternal(); } diff --git a/src/trainer_card.c b/src/trainer_card.c index 65f996003..ab7b3c913 100755 --- a/src/trainer_card.c +++ b/src/trainer_card.c @@ -97,8 +97,8 @@ static void CloseTrainerCard(u8 task); static bool8 PrintAllOnCardFront(void); static void DrawTrainerCardWindow(u8); static void CreateTrainerCardTrainerPic(void); -static void DrawCardScreenBackground(u16*); -static void DrawCardFrontOrBack(u16*); +static void DrawCardScreenBackground(u16 *); +static void DrawCardFrontOrBack(u16 *); static void DrawStarsAndBadgesOnCard(void); static void PrintTimeOnCard(void); static void FlipTrainerCard(void); @@ -107,10 +107,10 @@ static bool8 LoadCardGfx(void); static void CB2_InitTrainerCard(void); static u32 GetCappedGameStat(u8 statId, u32 maxValue); static bool8 HasAllFrontierSymbols(void); -static u8 GetRubyTrainerStars(struct TrainerCard*); +static u8 GetRubyTrainerStars(struct TrainerCard *); static u16 GetCaughtMonsCount(void); -static void SetPlayerCardData(struct TrainerCard*, u8); -static void TrainerCard_GenerateCardForPlayer(struct TrainerCard*); +static void SetPlayerCardData(struct TrainerCard *, u8); +static void TrainerCard_GenerateCardForPlayer(struct TrainerCard *); static u8 VersionToCardType(u8); static void SetDataFromTrainerCard(void); static void InitGpuRegs(void); @@ -147,17 +147,17 @@ static void BufferUnionRoomStats(void); static void BufferLinkPokeblocksNum(void); static void BufferLinkContestNum(void); static void BufferBattleFacilityStats(void); -static void PrintStatOnBackOfCard(u8 top, const u8* str1, u8* str2, const u8* color); +static void PrintStatOnBackOfCard(u8 top, const u8 *str1, u8 *str2, const u8 *color); static void LoadStickerGfx(void); static u8 SetCardBgsAndPals(void); static void DrawCardBackStats(void); static void Task_DoCardFlipTask(u8); -static bool8 Task_BeginCardFlip(struct Task* task); -static bool8 Task_AnimateCardFlipDown(struct Task* task); -static bool8 Task_DrawFlippedCardSide(struct Task* task); -static bool8 Task_SetCardFlipped(struct Task* task); -static bool8 Task_AnimateCardFlipUp(struct Task* task); -static bool8 Task_EndCardFlip(struct Task* task); +static bool8 Task_BeginCardFlip(struct Task *task); +static bool8 Task_AnimateCardFlipDown(struct Task *task); +static bool8 Task_DrawFlippedCardSide(struct Task *task); +static bool8 Task_SetCardFlipped(struct Task *task); +static bool8 Task_AnimateCardFlipUp(struct Task *task); +static bool8 Task_EndCardFlip(struct Task *task); static void UpdateCardFlipRegs(u16); static void LoadMonIconGfx(void); @@ -772,7 +772,7 @@ void TrainerCard_GenerateCardForLinkPlayer(struct TrainerCard *trainerCard) trainerCard->version = GAME_VERSION; SetPlayerCardData(trainerCard, CARD_TYPE_EMERALD); trainerCard->linkHasAllFrontierSymbols = HasAllFrontierSymbols(); - *((u16*)&trainerCard->linkPoints.frontier) = gSaveBlock2Ptr->frontier.cardBattlePoints; + *((u16 *)&trainerCard->linkPoints.frontier) = gSaveBlock2Ptr->frontier.cardBattlePoints; if (trainerCard->linkHasAllFrontierSymbols) trainerCard->stars++; @@ -799,7 +799,7 @@ void CopyTrainerCardData(struct TrainerCard *dst, struct TrainerCard *src, u8 ga memcpy(dst, src, 0x60); dst->linkPoints.frontier = 0; dst->hasAllFrontierSymbols = src->linkHasAllFrontierSymbols; - dst->frontierBP = *((u16*)&src->linkPoints.frontier); + dst->frontierBP = *((u16 *)&src->linkPoints.frontier); break; } } @@ -996,7 +996,7 @@ static void BufferTextsVarsForCardPage2(void) static void PrintNameOnCardFront(void) { u8 buffer[32]; - u8* txtPtr; + u8 *txtPtr; txtPtr = StringCopy(buffer, gText_TrainerCardName); StringCopy(txtPtr, sData->trainerCard.playerName); ConvertInternationalString(txtPtr, sData->language); @@ -1009,7 +1009,7 @@ static void PrintNameOnCardFront(void) static void PrintIdOnCard(void) { u8 buffer[32]; - u8* txtPtr; + u8 *txtPtr; s32 xPos; u32 top; txtPtr = StringCopy(buffer, gText_TrainerCardIDNo); @@ -1186,7 +1186,7 @@ static void BufferHofDebutTime(void) } } -static void PrintStatOnBackOfCard(u8 top, const u8* statName, u8* stat, const u8* color) +static void PrintStatOnBackOfCard(u8 top, const u8 *statName, u8 *stat, const u8 *color) { static const u8 xOffsets[] = {8, 16}; static const u8 widths[] = {216, 216}; @@ -1471,7 +1471,7 @@ static void DrawCardScreenBackground(u16 *ptr) CopyBgTilemapBufferToVram(2); } -static void DrawCardFrontOrBack(u16* ptr) +static void DrawCardFrontOrBack(u16 *ptr) { s16 i, j; u16 *dst = sData->cardTilemapBuffer; @@ -1570,7 +1570,7 @@ static void BlinkTimeColon(void) u8 GetTrainerCardStars(u8 cardId) { - struct TrainerCard* trainerCards = gTrainerCards; + struct TrainerCard *trainerCards = gTrainerCards; return trainerCards[cardId].stars; } @@ -1598,7 +1598,7 @@ static void Task_DoCardFlipTask(u8 taskId) ; } -static bool8 Task_BeginCardFlip(struct Task* task) +static bool8 Task_BeginCardFlip(struct Task *task) { u32 i; @@ -1615,7 +1615,7 @@ static bool8 Task_BeginCardFlip(struct Task* task) // Note: Cannot be DISPLAY_HEIGHT / 2, or cardHeight will be 0 #define CARD_FLIP_Y ((DISPLAY_HEIGHT / 2) - 3) -static bool8 Task_AnimateCardFlipDown(struct Task* task) +static bool8 Task_AnimateCardFlipDown(struct Task *task) { u32 cardHeight, r5, r10, cardTop, r6, var_24, cardBottom, var; s16 i; @@ -1660,7 +1660,7 @@ static bool8 Task_AnimateCardFlipDown(struct Task* task) return FALSE; } -static bool8 Task_DrawFlippedCardSide(struct Task* task) +static bool8 Task_DrawFlippedCardSide(struct Task *task) { sData->allowDMACopy = FALSE; if (Overworld_IsRecvQueueAtMax() == TRUE) @@ -1714,7 +1714,7 @@ static bool8 Task_DrawFlippedCardSide(struct Task* task) return FALSE; } -static bool8 Task_SetCardFlipped(struct Task* task) +static bool8 Task_SetCardFlipped(struct Task *task) { sData->allowDMACopy = FALSE; @@ -1734,7 +1734,7 @@ static bool8 Task_SetCardFlipped(struct Task* task) return FALSE; } -static bool8 Task_AnimateCardFlipUp(struct Task* task) +static bool8 Task_AnimateCardFlipUp(struct Task *task) { u32 cardHeight, r5, r10, cardTop, r6, var_24, cardBottom, var; s16 i; diff --git a/src/union_room.c b/src/union_room.c index 07fd30ca7..c1dd298c6 100644 --- a/src/union_room.c +++ b/src/union_room.c @@ -275,7 +275,7 @@ static s32 IsRequestedTypeOrEggInPlayerParty(u32, u32); static bool32 UR_PrintFieldMessage(const u8 *); static s32 GetChatLeaderActionRequestMessage(u8 *, u32, u16 *, struct WirelessLink_URoom *); static void Task_InitUnionRoom(u8 taskId); -static bool8 ArePlayersDifferent(struct RfuPlayerData*, const struct RfuPlayerData*); +static bool8 ArePlayersDifferent(struct RfuPlayerData *, const struct RfuPlayerData *); static void ItemPrintFunc_PossibleGroupMembers(u8, u32, u8); static void ListMenuItemPrintFunc_UnionRoomGroups(u8, u32, u8); static void TradeBoardListMenuItemPrintFunc(u8, u32, u8); @@ -378,7 +378,7 @@ void TryBecomeLinkLeader(void) struct WirelessLink_Leader *data; taskId = CreateTask(Task_TryBecomeLinkLeader, 0); - sWirelessLinkMain.leader = data = (void*)(gTasks[taskId].data); + sWirelessLinkMain.leader = data = (void *)(gTasks[taskId].data); sLeader = data; data->state = LL_STATE_INIT; @@ -971,7 +971,7 @@ void TryJoinLinkGroup(void) struct WirelessLink_Group *data; taskId = CreateTask(Task_TryJoinLinkGroup, 0); - sWirelessLinkMain.group = data = (void*)(gTasks[taskId].data); + sWirelessLinkMain.group = data = (void *)(gTasks[taskId].data); sGroup = data; data->state = LG_STATE_INIT; @@ -1297,7 +1297,7 @@ u8 CreateTask_ListenToWireless(void) struct WirelessLink_Group *data; taskId = CreateTask(Task_ListenToWireless, 0); - sWirelessLinkMain.group = data = (void*)(gTasks[taskId].data); + sWirelessLinkMain.group = data = (void *)(gTasks[taskId].data); data->state = 0; data->textState = 0; @@ -1487,7 +1487,7 @@ static void Task_StartUnionRoomTrade(u8 taskId) case 1: if (GetBlockReceivedStatus() == 3) { - gEnemyParty[0] = *(struct Pokemon*)(gBlockRecvBuffer[GetMultiplayerId() ^ 1]); + gEnemyParty[0] = *(struct Pokemon *)(gBlockRecvBuffer[GetMultiplayerId() ^ 1]); IncrementGameStat(GAME_STAT_NUM_UNION_ROOM_BATTLES); ResetBlockReceivedFlags(); gTasks[taskId].data[0]++; @@ -1750,7 +1750,7 @@ static void Task_StartActivity(u8 taskId) static void Task_RunScriptAndFadeToActivity(u8 taskId) { s16 *data = gTasks[taskId].data; - u16 *sendBuff = (u16*)(gBlockSendBuffer); + u16 *sendBuff = (u16 *)(gBlockSendBuffer); switch (data[0]) { @@ -1869,7 +1869,7 @@ void CreateTask_SendMysteryGift(u32 activity) struct WirelessLink_Leader *data; taskId = CreateTask(Task_SendMysteryGift, 0); - sWirelessLinkMain.leader = data = (void*)(gTasks[taskId].data); + sWirelessLinkMain.leader = data = (void *)(gTasks[taskId].data); data->state = 0; data->textState = 0; @@ -2077,7 +2077,7 @@ void CreateTask_LinkMysteryGiftWithFriend(u32 activity) struct WirelessLink_Group *data; taskId = CreateTask(Task_CardOrNewsWithFriend, 0); - sWirelessLinkMain.group = data = (void*)(gTasks[taskId].data); + sWirelessLinkMain.group = data = (void *)(gTasks[taskId].data); sGroup = data; data->state = 0; @@ -2246,7 +2246,7 @@ void CreateTask_LinkMysteryGiftOverWireless(u32 activity) struct WirelessLink_Group *data; taskId = CreateTask(Task_CardOrNewsOverWireless, 0); - sWirelessLinkMain.group = data = (void*)(gTasks[taskId].data); + sWirelessLinkMain.group = data = (void *)(gTasks[taskId].data); sGroup = data; data->state = 0; @@ -3467,7 +3467,7 @@ static void Task_SearchForChildOrParent(u8 taskId) { s32 i, j; struct RfuPlayerData rfu; - struct RfuIncomingPlayerList **list = (void*) gTasks[taskId].data; + struct RfuIncomingPlayerList **list = (void *) gTasks[taskId].data; bool8 isParent; for (i = 0; i < RFU_CHILD_MAX; i++) @@ -3510,7 +3510,7 @@ static u8 CreateTask_SearchForChildOrParent(struct RfuIncomingPlayerList * paren static void Task_ListenForCompatiblePartners(u8 taskId) { s32 i, j; - struct RfuIncomingPlayerList **list = (void*) gTasks[taskId].data; + struct RfuIncomingPlayerList **list = (void *) gTasks[taskId].data; for (i = 0; i < RFU_CHILD_MAX; i++) { @@ -3553,7 +3553,7 @@ static bool32 HasWonderCardOrNewsByLinkGroup(struct RfuGameData *data, s16 linkG static void Task_ListenForWonderDistributor(u8 taskId) { s32 i; - struct RfuIncomingPlayerList **list = (void*) gTasks[taskId].data; + struct RfuIncomingPlayerList **list = (void *) gTasks[taskId].data; for (i = 0; i < RFU_CHILD_MAX; i++) { @@ -3567,7 +3567,7 @@ static void Task_ListenForWonderDistributor(u8 taskId) static u8 CreateTask_ListenForCompatiblePartners(struct RfuIncomingPlayerList * list, u32 linkGroup) { u8 taskId = CreateTask(Task_ListenForCompatiblePartners, 0); - struct RfuIncomingPlayerList **oldList = (void*) gTasks[taskId].data; + struct RfuIncomingPlayerList **oldList = (void *) gTasks[taskId].data; oldList[0] = list; gTasks[taskId].data[2] = linkGroup; return taskId; @@ -3576,7 +3576,7 @@ static u8 CreateTask_ListenForCompatiblePartners(struct RfuIncomingPlayerList * static u8 CreateTask_ListenForWonderDistributor(struct RfuIncomingPlayerList * list, u32 linkGroup) { u8 taskId = CreateTask(Task_ListenForWonderDistributor, 0); - struct RfuIncomingPlayerList **oldList = (void*) gTasks[taskId].data; + struct RfuIncomingPlayerList **oldList = (void *) gTasks[taskId].data; oldList[0] = list; gTasks[taskId].data[2] = linkGroup; return taskId; diff --git a/src/use_pokeblock.c b/src/use_pokeblock.c index 8f041a6ff..2f16f220a 100644 --- a/src/use_pokeblock.c +++ b/src/use_pokeblock.c @@ -497,7 +497,7 @@ static void LoadUsePokeblockMenu(void) break; case 2: SetVBlankCallback(NULL); - CpuFill32(0, (void*)(VRAM), VRAM_SIZE); + CpuFill32(0, (void *)(VRAM), VRAM_SIZE); sInfo->mainState++; break; case 3: @@ -1232,7 +1232,7 @@ static void UpdateMonPic(u8 loadId) sMenu->curMonSpriteId = spriteId; gSprites[sMenu->curMonSpriteId].callback = SpriteCB_MonPic; gSprites[sMenu->curMonSpriteId].y2 -= 34; - sMenu->curMonTileStart = (void*)(OBJ_VRAM0 + (sMenu->curMonSheet * 32)); + sMenu->curMonTileStart = (void *)(OBJ_VRAM0 + (sMenu->curMonSheet * 32)); sMenu->curMonPalette = (sMenu->curMonPalette * 16) + 0x100; } } diff --git a/src/util.c b/src/util.c index a4e3fa4cf..32f31a26d 100644 --- a/src/util.c +++ b/src/util.c @@ -253,7 +253,7 @@ u16 CalcCRC16WithTable(const u8 *data, u32 length) return ~crc; } -u32 CalcByteArraySum(const u8* data, u32 length) +u32 CalcByteArraySum(const u8 *data, u32 length) { u32 sum, i; for (sum = 0, i = 0; i < length; i++) diff --git a/src/walda_phrase.c b/src/walda_phrase.c index aa85c0d60..025f900e5 100644 --- a/src/walda_phrase.c +++ b/src/walda_phrase.c @@ -140,7 +140,7 @@ static u8 GetLetterTableId(u8 letter) #define KEY data[8] #define NUM_WALLPAPER_DATA_BYTES 9 #define TO_BIT_OFFSET(i) (3 + (8 * (i))) // Convert a position in the phrase to a bit number into the wallpaper data array -static bool32 TryCalculateWallpaper(u16* backgroundClr, u16 *foregroundClr, u8 *iconId, u8 *patternId, u16 trainerId, u8 *phrase) +static bool32 TryCalculateWallpaper(u16 *backgroundClr, u16 *foregroundClr, u8 *iconId, u8 *patternId, u16 trainerId, u8 *phrase) { s32 i; ALIGNED(2) u8 data[NUM_WALLPAPER_DATA_BYTES]; @@ -186,10 +186,10 @@ static bool32 TryCalculateWallpaper(u16* backgroundClr, u16 *foregroundClr, u8 * return FALSE; // Successful phrase, save resulting wallpaper - ptr = (u16*) &BG_COLOR_LO; + ptr = (u16 *) &BG_COLOR_LO; *backgroundClr = *ptr; - ptr = (u16*) &FG_COLOR_LO; + ptr = (u16 *) &FG_COLOR_LO; *foregroundClr = *ptr; *iconId = ICON_ID;