diff options
Diffstat (limited to 'include')
| -rw-r--r-- | include/battle_interface.h | 10 | ||||
| -rw-r--r-- | include/battle_message.h | 8 | ||||
| -rw-r--r-- | include/battle_scripts.h | 80 | ||||
| -rw-r--r-- | include/battle_tower.h | 6 | ||||
| -rw-r--r-- | include/battle_util.h | 4 | ||||
| -rw-r--r-- | include/battle_util2.h | 6 | ||||
| -rw-r--r-- | include/constants/battle.h | 2 | ||||
| -rw-r--r-- | include/constants/battle_ai.h | 4 | ||||
| -rw-r--r-- | include/constants/region_map_sections.h | 2 | ||||
| -rw-r--r-- | include/contest.h | 1 | ||||
| -rw-r--r-- | include/event_object_movement.h | 9 | ||||
| -rw-r--r-- | include/gba/io_reg.h | 2 | ||||
| -rw-r--r-- | include/global.berry.h | 8 | ||||
| -rw-r--r-- | include/global.h | 31 | ||||
| -rw-r--r-- | include/overworld.h | 40 | ||||
| -rw-r--r-- | include/pokeball.h | 6 | ||||
| -rw-r--r-- | include/pokemon.h | 2 | ||||
| -rw-r--r-- | include/record_mixing.h | 6 | ||||
| -rw-r--r-- | include/sprite.h | 2 | 
19 files changed, 85 insertions, 144 deletions
| diff --git a/include/battle_interface.h b/include/battle_interface.h index 2d93811f1..3145939d0 100644 --- a/include/battle_interface.h +++ b/include/battle_interface.h @@ -60,21 +60,21 @@ enum      HEALTHBOX_SAFARI_BALLS_TEXT  }; -u8 CreateBattlerHealthboxSprites(u8 bank); +u8 CreateBattlerHealthboxSprites(u8 battler);  u8 CreateSafariPlayerHealthboxSprites(void); -void SetBattleBarStruct(u8 bank, u8 healthboxSpriteId, s32 maxVal, s32 currVal, s32 receivedValue); +void SetBattleBarStruct(u8 battler, u8 healthboxSpriteId, s32 maxVal, s32 currVal, s32 receivedValue);  void SetHealthboxSpriteInvisible(u8 healthboxSpriteId);  void SetHealthboxSpriteVisible(u8 healthboxSpriteId);  void DestoryHealthboxSprite(u8 healthboxSpriteId);  void DummyBattleInterfaceFunc(u8 healthboxSpriteId, bool8 isDoubleBattleBankOnly);  void UpdateOamPriorityInAllHealthboxes(u8 priority); -void InitBattlerHealthboxCoords(u8 bank); +void InitBattlerHealthboxCoords(u8 battler);  void UpdateHpTextInHealthbox(u8 healthboxSpriteId, s16 value, u8 maxOrCurrent);  void SwapHpBarsWithHpText(void); -u8 CreatePartyStatusSummarySprites(u8 bank, struct HpAndStatus *partyInfo, u8 arg2, bool8 isBattleStart); +u8 CreatePartyStatusSummarySprites(u8 battler, struct HpAndStatus *partyInfo, u8 arg2, bool8 isBattleStart);  void Task_HidePartyStatusSummary(u8 taskId);  void UpdateHealthboxAttribute(u8 healthboxSpriteId, struct Pokemon *mon, u8 elementId); -s32 MoveBattleBar(u8 bank, u8 healthboxSpriteId, u8 whichBar, u8 arg3); +s32 MoveBattleBar(u8 battler, u8 healthboxSpriteId, u8 whichBar, u8 arg3);  u8 GetScaledHPFraction(s16 hp, s16 maxhp, u8 scale);  u8 GetHPBarLevel(s16 hp, s16 maxhp); diff --git a/include/battle_message.h b/include/battle_message.h index c68607246..94f584935 100644 --- a/include/battle_message.h +++ b/include/battle_message.h @@ -177,20 +177,20 @@      textVar[4] = B_BUFF_EOS;                                    \  } -#define PREPARE_MON_NICK_WITH_PREFIX_BUFFER(textVar, bank, partyId)         \ +#define PREPARE_MON_NICK_WITH_PREFIX_BUFFER(textVar, battler, partyId)      \  {                                                                           \      textVar[0] = B_BUFF_PLACEHOLDER_BEGIN;                                  \      textVar[1] = B_BUFF_MON_NICK_WITH_PREFIX;                               \ -    textVar[2] = bank;                                                      \ +    textVar[2] = battler;                                                   \      textVar[3] = partyId;                                                   \      textVar[4] = B_BUFF_EOS;                                                \  } -#define PREPARE_MON_NICK_BUFFER(textVar, bank, partyId)         \ +#define PREPARE_MON_NICK_BUFFER(textVar, battler, partyId)      \  {                                                               \      textVar[0] = B_BUFF_PLACEHOLDER_BEGIN;                      \      textVar[1] = B_BUFF_MON_NICK;                               \ -    textVar[2] = bank;                                          \ +    textVar[2] = battler;                                       \      textVar[3] = partyId;                                       \      textVar[4] = B_BUFF_EOS;                                    \  } diff --git a/include/battle_scripts.h b/include/battle_scripts.h index 1197dfb6e..9c4537363 100644 --- a/include/battle_scripts.h +++ b/include/battle_scripts.h @@ -26,16 +26,9 @@ extern const u8 BattleScript_LocalBattleLost[];  extern const u8 BattleScript_LocalBattleLostPrintWhiteOut[];  extern const u8 BattleScript_LocalBattleLostEnd[];  extern const u8 BattleScript_CheckDomeDrew[]; -extern const u8 BattleScript_82DAA0B[]; -extern const u8 BattleScript_82DAA31[]; +extern const u8 BattleScript_FlushMessageBox[];  extern const u8 BattleScript_LinkBattleWonOrLost[]; -extern const u8 BattleScript_82DAA5C[]; -extern const u8 BattleScript_82DAA83[];  extern const u8 BattleScript_FrontierTrainerBattleWon[]; -extern const u8 BattleScript_82DAAAB[]; -extern const u8 BattleScript_82DAAAE[]; -extern const u8 BattleScript_82DAACB[]; -extern const u8 BattleScript_82DAADA[];  extern const u8 BattleScript_SmokeBallEscape[];  extern const u8 BattleScript_RanAwayUsingMonAbility[];  extern const u8 BattleScript_GotAwaySafely[]; @@ -45,11 +38,6 @@ extern const u8 BattleScript_PrintFailedToRunString[];  extern const u8 BattleScript_PrintCantEscapeFromBattle[];  extern const u8 BattleScript_PrintFullBox[];  extern const u8 BattleScript_ActionSwitch[]; -extern const u8 BattleScript_82DAB35[]; -extern const u8 BattleScript_82DAB37[]; -extern const u8 BattleScript_82DAB44[]; -extern const u8 BattleScript_82DAB77[]; -extern const u8 BattleScript_82DABB8[];  extern const u8 BattleScript_Pausex20[];  extern const u8 BattleScript_LevelUp[];  extern const u8 BattleScript_RainContinuesOrEnds[]; @@ -62,13 +50,10 @@ extern const u8 BattleScript_SideStatusWoreOff[];  extern const u8 BattleScript_SafeguardProtected[];  extern const u8 BattleScript_SafeguardEnds[];  extern const u8 BattleScript_LeechSeedTurnDrain[]; -extern const u8 BattleScript_82DAD47[]; -extern const u8 BattleScript_82DAD4D[];  extern const u8 BattleScript_BideStoringEnergy[];  extern const u8 BattleScript_BideAttack[];  extern const u8 BattleScript_BideNoEnergyToAttack[];  extern const u8 BattleScript_SuccessForceOut[]; -extern const u8 BattleScript_82DADF1[];  extern const u8 BattleScript_MistProtected[];  extern const u8 BattleScript_RageIsBuilding[];  extern const u8 BattleScript_MoveUsedIsDisabled[]; @@ -79,32 +64,16 @@ extern const u8 BattleScript_SelectingUnusableMoveInPalace[];  extern const u8 BattleScript_EncoredNoMore[];  extern const u8 BattleScript_DestinyBondTakesLife[];  extern const u8 BattleScript_SpikesOnAttacker[]; -extern const u8 BattleScript_82DAE7A[];  extern const u8 BattleScript_SpikesOnTarget[]; -extern const u8 BattleScript_82DAEB1[];  extern const u8 BattleScript_SpikesOnFaintedBattler[]; -extern const u8 BattleScript_82DAEE8[]; -extern const u8 BattleScript_82DAEFE[];  extern const u8 BattleScript_PerishSongTakesLife[];  extern const u8 BattleScript_PerishSongCountGoesDown[];  extern const u8 BattleScript_AllStatsUp[]; -extern const u8 BattleScript_82DAF54[]; -extern const u8 BattleScript_82DAF72[]; -extern const u8 BattleScript_82DAF86[]; -extern const u8 BattleScript_82DAF9A[]; -extern const u8 BattleScript_82DAFAE[]; -extern const u8 BattleScript_82DAFC2[];  extern const u8 BattleScript_RapidSpinAway[];  extern const u8 BattleScript_WrapFree[];  extern const u8 BattleScript_LeechSeedFree[];  extern const u8 BattleScript_SpikesFree[];  extern const u8 BattleScript_MonTookFutureAttack[]; -extern const u8 BattleScript_82DB001[]; -extern const u8 BattleScript_82DB008[]; -extern const u8 BattleScript_82DB020[]; -extern const u8 BattleScript_82DB027[]; -extern const u8 BattleScript_82DB03F[]; -extern const u8 BattleScript_82DB058[];  extern const u8 BattleScript_NoMovesLeft[];  extern const u8 BattleScript_SelectingMoveWithNoPP[];  extern const u8 BattleScript_NoPPForMove[]; @@ -117,8 +86,6 @@ extern const u8 BattleScript_SelectingNotAllowedMoveTauntInPalace[];  extern const u8 BattleScript_WishComesTrue[];  extern const u8 BattleScript_IngrainTurnHeal[];  extern const u8 BattleScript_AtkDefDown[]; -extern const u8 BattleScript_82DB144[]; -extern const u8 BattleScript_82DB167[];  extern const u8 BattleScript_KnockedOff[];  extern const u8 BattleScript_MoveUsedIsImprisoned[];  extern const u8 BattleScript_SelectingImprisionedMove[]; @@ -129,15 +96,11 @@ extern const u8 BattleScript_SnatchedMove[];  extern const u8 BattleScript_EnduredMsg[];  extern const u8 BattleScript_OneHitKOMsg[];  extern const u8 BattleScript_SAtkDown2[]; -extern const u8 BattleScript_82DB1FE[];  extern const u8 BattleScript_FocusPunchSetUp[];  extern const u8 BattleScript_MoveUsedIsAsleep[];  extern const u8 BattleScript_MoveUsedWokeUp[];  extern const u8 BattleScript_MonWokeUpInUproar[];  extern const u8 BattleScript_PoisonTurnDmg[]; -extern const u8 BattleScript_82DB243[]; -extern const u8 BattleScript_82DB245[]; -extern const u8 BattleScript_82DB25E[];  extern const u8 BattleScript_BurnTurnDmg[];  extern const u8 BattleScript_MoveUsedIsFrozen[];  extern const u8 BattleScript_MoveUsedUnfroze[]; @@ -147,8 +110,6 @@ extern const u8 BattleScript_MoveUsedFlinched[];  extern const u8 BattleScript_PrintUproarOverTurns[];  extern const u8 BattleScript_ThrashConfuses[];  extern const u8 BattleScript_MoveUsedIsConfused[]; -extern const u8 BattleScript_82DB2D4[]; -extern const u8 BattleScript_82DB2FF[];  extern const u8 BattleScript_MoveUsedIsConfusedNoMore[];  extern const u8 BattleScript_PrintPayDayMoneyString[];  extern const u8 BattleScript_WrapTurnDmg[]; @@ -159,7 +120,6 @@ extern const u8 BattleScript_NightmareTurnDmg[];  extern const u8 BattleScript_CurseTurnDmg[];  extern const u8 BattleScript_TargetPRLZHeal[];  extern const u8 BattleScript_MoveEffectSleep[]; -extern const u8 BattleScript_82DB374[];  extern const u8 BattleScript_YawnMakesAsleep[];  extern const u8 BattleScript_MoveEffectPoison[];  extern const u8 BattleScript_MoveEffectBurn[]; @@ -170,7 +130,7 @@ extern const u8 BattleScript_MoveEffectToxic[];  extern const u8 BattleScript_MoveEffectPayDay[];  extern const u8 BattleScript_MoveEffectWrap[];  extern const u8 BattleScript_MoveEffectConfusion[]; -extern const u8 BattleScript_MoveEffectRecoil33[]; +extern const u8 BattleScript_MoveEffectRecoil[];  extern const u8 BattleScript_DoRecoil33[];  extern const u8 BattleScript_Recoil33End[];  extern const u8 BattleScript_ItemSteal[]; @@ -183,14 +143,8 @@ extern const u8 BattleScript_ShedSkinActivates[];  extern const u8 BattleScript_WeatherFormChanges[];  extern const u8 BattleScript_WeatherFormChangesLoop[];  extern const u8 BattleScript_CastformChange[]; -extern const u8 BattleScript_82DB4AF[]; -extern const u8 BattleScript_82DB4B8[]; -extern const u8 BattleScript_82DB4BE[]; -extern const u8 BattleScript_82DB4C1[]; -extern const u8 BattleScript_82DB4CD[]; -extern const u8 BattleScript_82DB510[]; -extern const u8 BattleScript_82DB51B[]; -extern const u8 BattleScript_82DB51C[]; +extern const u8 BattleScript_IntimidateActivatesEnd3[]; +extern const u8 BattleScript_IntimidateActivates[];  extern const u8 BattleScript_DroughtActivates[];  extern const u8 BattleScript_TookAttack[];  extern const u8 BattleScript_SturdyPreventsOHKO[]; @@ -218,12 +172,11 @@ extern const u8 BattleScript_ApplySecondaryEffect[];  extern const u8 BattleScript_SynchronizeActivates[];  extern const u8 BattleScript_NoItemSteal[];  extern const u8 BattleScript_AbilityCuredStatus[]; -extern const u8 BattleScript_82DB695[]; +extern const u8 BattleScript_IgnoresWhileAsleep[];  extern const u8 BattleScript_IgnoresAndUsesRandomMove[];  extern const u8 BattleScript_MoveUsedLoafingAround[]; -extern const u8 BattleScript_82DB6C7[];  extern const u8 BattleScript_IgnoresAndFallsAsleep[]; -extern const u8 BattleScript_82DB6F0[]; +extern const u8 BattleScript_IgnoresAndHitsItself[];  extern const u8 BattleScript_SubstituteFade[];  extern const u8 BattleScript_BerryCurePrlzEnd2[];  extern const u8 BattleScript_BerryCureParRet[]; @@ -249,18 +202,12 @@ extern const u8 BattleScript_SelectingNotAllowedMoveChoiceItem[];  extern const u8 BattleScript_HangedOnMsg[];  extern const u8 BattleScript_BerryConfuseHealEnd2[];  extern const u8 BattleScript_BerryStatRaiseEnd2[]; -extern const u8 BattleScript_82DB85B[];  extern const u8 BattleScript_BerryFocusEnergyEnd2[];  extern const u8 BattleScript_ActionSelectionItemsCantBeUsed[]; -extern const u8 BattleScript_82DB87D[]; -extern const u8 BattleScript_82DB881[]; -extern const u8 BattleScript_82DB887[]; -extern const u8 BattleScript_82DB89D[];  extern const u8 BattleScript_ArenaTurnBeginning[]; -extern const u8 BattleScript_82DB8E0[]; +extern const u8 BattleScript_82DB881[];  extern const u8 BattleScript_82DB8F3[]; -extern const u8 BattleScript_82DB973[]; -extern const u8 BattleScript_82DB992[]; +extern const u8 BattleScript_82DAA0B[];  extern const u8 BattleScript_AskIfWantsToForfeitMatch[];  extern const u8 BattleScript_PrintPlayerForfeited[];  extern const u8 BattleScript_PrintPlayerForfeitedLinkBattle[]; @@ -268,23 +215,12 @@ extern const u8 BattleScript_BallThrow[];  extern const u8 BattleScript_BallThrowByWally[];  extern const u8 BattleScript_SafariBallThrow[];  extern const u8 BattleScript_SuccessBallThrow[]; -extern const u8 BattleScript_82DBD92[]; -extern const u8 BattleScript_82DBDA5[]; -extern const u8 BattleScript_82DBDC2[]; -extern const u8 BattleScript_82DBDC3[];  extern const u8 BattleScript_WallyBallThrow[];  extern const u8 BattleScript_ShakeBallThrow[]; -extern const u8 BattleScript_82DBE01[];  extern const u8 BattleScript_TrainerBallBlock[]; -extern const u8 BattleScript_82DBE12[]; -extern const u8 BattleScript_82DBE1C[]; -extern const u8 BattleScript_82DBE4B[]; -extern const u8 BattleScript_82DBE6F[]; -extern const u8 BattleScript_82DBE91[];  extern const u8 BattleScript_RunByUsingItem[];  extern const u8 BattleScript_ActionWatchesCarefully[];  extern const u8 BattleScript_ActionGetNear[];  extern const u8 BattleScript_ActionThrowPokeblock[]; -extern const u8 BattleScript_82DBEE3[];  #endif // GUARD_BATTLE_SCRIPTS_H diff --git a/include/battle_tower.h b/include/battle_tower.h index d7ff70006..f07e9e544 100644 --- a/include/battle_tower.h +++ b/include/battle_tower.h @@ -6,7 +6,7 @@ struct RSBattleTowerRecord      /*0x00*/ u8 battleTowerLevelType; // 0 = level 50, 1 = level 100      /*0x01*/ u8 trainerClass;      /*0x02*/ u16 winStreak; -    /*0x04*/ u8 name[8]; +    /*0x04*/ u8 name[PLAYER_NAME_LENGTH + 1];      /*0x0C*/ u8 trainerId[4];      /*0x10*/ struct {          u16 easyChat[6]; @@ -22,10 +22,12 @@ union BattleTowerRecord      struct EmeraldBattleTowerRecord emerald;  }; +#define FRONTIER_TRAINER_NAME_LENGTH 7 +  struct BattleFrontierTrainer  {      u32 facilityClass; -    u8 trainerName[8]; +    u8 trainerName[FRONTIER_TRAINER_NAME_LENGTH + 1];      u16 speechBefore[6];      u16 speechWin[6];      u16 speechLose[6]; diff --git a/include/battle_util.h b/include/battle_util.h index be9b5f1fe..b3fff196e 100644 --- a/include/battle_util.h +++ b/include/battle_util.h @@ -12,7 +12,7 @@  #define ABILITYEFFECT_ENDTURN                    0x1  #define ABILITYEFFECT_MOVES_BLOCK                0x2  #define ABILITYEFFECT_ABSORBING                  0x3 -#define ABILITYEFFECT_CONTACT                    0x4 +#define ABILITYEFFECT_MOVE_END                   0x4  #define ABILITYEFFECT_IMMUNITY                   0x5  #define ABILITYEFFECT_FORECAST                   0x6  #define ABILITYEFFECT_SYNCHRONIZE                0x7 @@ -35,6 +35,8 @@  #define ABILITY_ON_FIELD2(abilityId)(AbilityBattleEffects(ABILITYEFFECT_FIELD_SPORT, 0, abilityId, 0, 0))  #define ITEMEFFECT_ON_SWITCH_IN                 0x0 +#define ITEMEFFECT_MOVE_END                     0x3 +#define ITEMEFFECT_KINGSROCK_SHELLBELL          0x4  #define WEATHER_HAS_EFFECT ((!ABILITY_ON_FIELD(ABILITY_CLOUD_NINE) && !ABILITY_ON_FIELD(ABILITY_AIR_LOCK)))  #define WEATHER_HAS_EFFECT2 ((!ABILITY_ON_FIELD2(ABILITY_CLOUD_NINE) && !ABILITY_ON_FIELD2(ABILITY_AIR_LOCK))) diff --git a/include/battle_util2.h b/include/battle_util2.h index 3954e42dc..336698ea3 100644 --- a/include/battle_util2.h +++ b/include/battle_util2.h @@ -3,8 +3,8 @@  void AllocateBattleResources(void);  void FreeBattleResources(void); -void AdjustFriendshipOnBattleFaint(u8 bank); -void sub_80571DC(u8 bank, u8 arg1); -u32 sub_805725C(u8 bank); +void AdjustFriendshipOnBattleFaint(u8 battler); +void sub_80571DC(u8 battler, u8 arg1); +u32 sub_805725C(u8 battler);  #endif // GUARD_BATTLE_UTIL_H diff --git a/include/constants/battle.h b/include/constants/battle.h index b3f9d919a..e5ca9d7ae 100644 --- a/include/constants/battle.h +++ b/include/constants/battle.h @@ -252,7 +252,7 @@  #define MOVE_EFFECT_RAPIDSPIN           0x23  #define MOVE_EFFECT_REMOVE_PARALYSIS    0x24  #define MOVE_EFFECT_ATK_DEF_DOWN        0x25 -#define MOVE_EFFECT_RECOIL_33_PARALYSIS 0x26 +#define MOVE_EFFECT_RECOIL_33           0x26  #define MOVE_EFFECT_ATK_PLUS_2          0x27  #define MOVE_EFFECT_DEF_PLUS_2          0x28  #define MOVE_EFFECT_SPD_PLUS_2          0x29 diff --git a/include/constants/battle_ai.h b/include/constants/battle_ai.h index 7d2c70307..4c3a45dc6 100644 --- a/include/constants/battle_ai.h +++ b/include/constants/battle_ai.h @@ -35,8 +35,8 @@  // script's table id to bit  #define AI_SCRIPT_CHECK_BAD_MOVE (1 << 0) -#define AI_SCRIPT_CHECK_VIABILITY (1 << 1) -#define AI_SCRIPT_TRY_TO_FAINT (1 << 2) +#define AI_SCRIPT_TRY_TO_FAINT (1 << 1) +#define AI_SCRIPT_CHECK_VIABILITY (1 << 2)  #define AI_SCRIPT_SETUP_FIRST_TURN (1 << 3)  #define AI_SCRIPT_RISKY (1 << 4)  #define AI_SCRIPT_PREFER_STRONGEST_MOVE (1 << 5) diff --git a/include/constants/region_map_sections.h b/include/constants/region_map_sections.h index 8ff75dfa9..12c894367 100644 --- a/include/constants/region_map_sections.h +++ b/include/constants/region_map_sections.h @@ -220,4 +220,6 @@  #define MAPSEC_IN_GAME_TRADE                0xFE  #define MAPSEC_FATEFUL_ENCOUNTER            0xFF +#define MAPSEC_SUBTRACT_KANTO (MAPSEC_SPECIAL_AREA - MAPSEC_DYNAMIC) +  #endif //GUARD_REGIONMAPSEC_H diff --git a/include/contest.h b/include/contest.h index 33080225b..0a8fa4436 100644 --- a/include/contest.h +++ b/include/contest.h @@ -8,6 +8,7 @@ enum      CONTEST_CATEGORY_CUTE,      CONTEST_CATEGORY_SMART,      CONTEST_CATEGORY_TOUGH, +    CONTEST_CATEGORIES_COUNT,  };  enum diff --git a/include/event_object_movement.h b/include/event_object_movement.h index 1a473eea9..d43dd78ea 100644 --- a/include/event_object_movement.h +++ b/include/event_object_movement.h @@ -89,10 +89,10 @@ u8 GetEventObjectIdByXY(s16, s16);  void SetEventObjectDirection(struct EventObject *, u8);  u8 GetFirstInactiveEventObjectId(void);  void RemoveEventObjectByLocalIdAndMap(u8, u8, u8); -void npc_load_two_palettes__no_record(u16, u8); -void npc_load_two_palettes__and_record(u16, u8); +void LoadPlayerObjectReflectionPalette(u16, u8); +void LoadSpecialObjectReflectionPalette(u16, u8);  void sub_808EBA8(u8, u8, u8, s16, s16); -void pal_patch_for_npc(u16, u8); +void PatchObjectPalette(u16, u8);  void sub_808E16C(s16, s16);  void sub_808F28C(u8 localId, u8 mapNum, u8 mapGroup, u8 decorCat);  void sub_8092FF0(s16, s16, s16 *, s16 *); @@ -113,7 +113,7 @@ void EventObjectTurn(struct EventObject *, u8);  void EventObjectTurnByLocalIdAndMap(u8, u8, u8, u8);  const struct EventObjectGraphicsInfo *GetEventObjectGraphicsInfo(u8);  void npc_by_local_id_and_map_set_field_1_bit_x20(u8, u8, u8, u8); -void gpu_pal_allocator_reset__manage_upper_four(void); +void FreeAndReserveObjectSpritePalettes(void);  void sub_808E82C(u8, u8, u8, s16, s16);  void sub_808E7E4(u8, u8, u8);  void sub_808E78C(u8, u8, u8, u8); @@ -122,6 +122,7 @@ void EventObjectGetLocalIdAndMap(struct EventObject *eventObject, void *localId,  void ShiftEventObjectCoords(struct EventObject *, s16, s16);  void sub_808EB08(struct EventObject *, s16, s16);  void sub_808F254(u8, u8, u8); +void InitEventObjectPalettes(u8 palSlot);  void UpdateEventObjectCurrentMovement(struct EventObject *, struct Sprite *, bool8(struct EventObject *, struct Sprite *));  u8 EventObjectFaceOppositeDirection(struct EventObject *, u8);  u8 GetOppositeDirection(u8); diff --git a/include/gba/io_reg.h b/include/gba/io_reg.h index 9327d6cb0..03faa1a87 100644 --- a/include/gba/io_reg.h +++ b/include/gba/io_reg.h @@ -574,8 +574,6 @@  #define WINOUT_WINOBJ_OBJ   (1 << 12)  #define WINOUT_WINOBJ_CLR   (1 << 13) -#define WINHV_COORDS(m, n)     (((m) << 8) | (n)) -  // BLDCNT  // Bits 0-5 select layers for the 1st target  #define BLDCNT_TGT1_BG0      (1 << 0) diff --git a/include/global.berry.h b/include/global.berry.h index 5c8a43a02..8046d344e 100644 --- a/include/global.berry.h +++ b/include/global.berry.h @@ -1,12 +1,12 @@  #ifndef GUARD_GLOBAL_BERRY_H  #define GUARD_GLOBAL_BERRY_H -#define BERRY_NAME_COUNT 7 +#define BERRY_NAME_LENGTH 6  #define BERRY_ITEM_EFFECT_COUNT 18  struct Berry  { -    const u8 name[BERRY_NAME_COUNT]; +    const u8 name[BERRY_NAME_LENGTH + 1];      u8 firmness;      u16 size;      u8 maxYield; @@ -26,7 +26,7 @@ struct Berry  struct Berry2  { -    u8 name[BERRY_NAME_COUNT]; +    u8 name[BERRY_NAME_LENGTH + 1];      u8 firmness;      u16 size;      u8 maxYield; @@ -53,7 +53,7 @@ struct EnigmaBerry  struct BattleEnigmaBerry  { -    /*0x00*/ u8 name[BERRY_NAME_COUNT]; +    /*0x00*/ u8 name[BERRY_NAME_LENGTH + 1];      /*0x07*/ u8 holdEffect;      /*0x08*/ u8 itemEffect[BERRY_ITEM_EFFECT_COUNT];      /*0x1A*/ u8 holdEffectParam; diff --git a/include/global.h b/include/global.h index 0fff11d09..6977d4059 100644 --- a/include/global.h +++ b/include/global.h @@ -57,8 +57,6 @@  #define PARTY_SIZE 6  #define POKEMON_SLOTS_NUMBER 412 -#define POKEMON_NAME_LENGTH 10 -#define OT_NAME_LENGTH 7  #define min(a, b) ((a) < (b) ? (a) : (b))  #define max(a, b) ((a) >= (b) ? (a) : (b)) @@ -134,8 +132,7 @@ enum LanguageId  // string lengths  #define ITEM_NAME_LENGTH    14  #define POKEMON_NAME_LENGTH 10 -#define OT_NAME_LENGTH      7 -#define PLAYER_NAME_LENGTH  8 +#define PLAYER_NAME_LENGTH  7  #define MAIL_WORDS_COUNT    9  enum @@ -326,7 +323,7 @@ struct EmeraldBattleTowerRecord      /*0x00*/ u8 battleTowerLevelType; // 0 = level 50, 1 = level 100      /*0x01*/ u8 trainerClass;      /*0x02*/ u16 winStreak; -    /*0x04*/ u8 name[8]; +    /*0x04*/ u8 name[PLAYER_NAME_LENGTH + 1];      /*0x0C*/ u8 trainerId[4];      /*0x10*/ struct {          u16 easyChat[6]; @@ -450,7 +447,7 @@ struct BattleFrontier      /*0xEBF*/ u8 field_EBF;      /*0xEC0*/ u16 field_EC0[16];      /*0xEE0*/ u8 field_EE0; -    /*0xEE1*/ u8 field_EE1[2][PLAYER_NAME_LENGTH]; +    /*0xEE1*/ u8 field_EE1[2][PLAYER_NAME_LENGTH + 1];      /*0xEF1*/ u8 field_EF1[2][4];      /*0xEF9*/ u8 field_EF9;      /*0xEFA*/ u8 field_EFA; @@ -460,7 +457,7 @@ struct BattleFrontier  struct SaveBlock2  { -    /*0x00*/ u8 playerName[PLAYER_NAME_LENGTH]; +    /*0x00*/ u8 playerName[PLAYER_NAME_LENGTH + 1];      /*0x08*/ u8 playerGender; // MALE, FEMALE      /*0x09*/ u8 specialSaveWarp;      /*0x0A*/ u8 playerTrainerId[4]; @@ -516,7 +513,7 @@ struct SecretBaseRecord      /*0x1A9D*/ u8 gender:1;      /*0x1A9D*/ u8 sbr_field_1_5:1;      /*0x1A9D*/ u8 sbr_field_1_6:2; -    /*0x1A9E*/ u8 trainerName[OT_NAME_LENGTH]; +    /*0x1A9E*/ u8 trainerName[PLAYER_NAME_LENGTH];      /*0x1AA5*/ u8 trainerId[4]; // byte 0 is used for determining trainer class      /*0x1AA9*/ u8 language;      /*0x1AAA*/ u16 sbr_field_e; @@ -602,7 +599,7 @@ struct EasyChatPair  struct MailStruct  {      /*0x00*/ u16 words[MAIL_WORDS_COUNT]; -    /*0x12*/ u8 playerName[PLAYER_NAME_LENGTH]; +    /*0x12*/ u8 playerName[PLAYER_NAME_LENGTH + 1];      /*0x1A*/ u8 trainerId[4];      /*0x1E*/ u16 species;      /*0x20*/ u16 itemId; @@ -691,7 +688,7 @@ struct RecordMixing_UnknownStruct  struct LinkBattleRecord  { -    u8 name[8]; +    u8 name[PLAYER_NAME_LENGTH + 1];      u16 trainerId;      u16 wins;      u16 losses; @@ -724,15 +721,15 @@ struct ContestWinner      u32 trainerId;      u16 species;      u8 contestCategory; -    u8 monName[11]; -    u8 trainerName[8]; +    u8 monName[POKEMON_NAME_LENGTH + 1]; +    u8 trainerName[PLAYER_NAME_LENGTH + 1];      u8 contestRank;  };  struct DayCareMail  {      struct MailStruct message; -    u8 OT_name[OT_NAME_LENGTH + 1]; +    u8 OT_name[PLAYER_NAME_LENGTH + 1];      u8 monName[POKEMON_NAME_LENGTH + 1];      u8 gameLanguage:4;      u8 monLanguage:4; @@ -773,7 +770,7 @@ struct LilycoveLadyQuiz      /*0x002*/ u16 unk_002[9];      /*0x014*/ u16 unk_014;      /*0x016*/ u16 unk_016; -    /*0x018*/ u8 playerName[8]; +    /*0x018*/ u8 playerName[PLAYER_NAME_LENGTH + 1];      /*0x020*/ u16 playerTrainerId[4];      /*0x028*/ u16 itemId;      /*0x02a*/ u8 unk_02a; @@ -788,7 +785,7 @@ struct LilycoveLadyFavour      /*0x001*/ u8 phase;      /*0x002*/ u8 unk_002;      /*0x003*/ u8 unk_003; -    /*0x004*/ u8 playerName[8]; +    /*0x004*/ u8 playerName[PLAYER_NAME_LENGTH + 1];      /*0x00c*/ u8 unk_00c;      /*0x00e*/ u16 itemId;      /*0x010*/ u16 unk_010; @@ -801,7 +798,7 @@ struct LilycoveLadyContest      /*0x001*/ u8 phase;      /*0x002*/ u8 fave_pkblk;      /*0x003*/ u8 other_pkblk; -    /*0x004*/ u8 playerName[8]; +    /*0x004*/ u8 playerName[PLAYER_NAME_LENGTH + 1];      /*0x00c*/ u8 max_sheen;      /*0x00d*/ u8 category;      /*0x00e*/ u8 language; @@ -828,7 +825,7 @@ struct WaldaPhrase  struct UnkSaveSubstruct_3b98 {      u32 trainerId; -    u8 trainerName[8]; +    u8 trainerName[PLAYER_NAME_LENGTH + 1];  };  struct SaveBlock1 diff --git a/include/overworld.h b/include/overworld.h index 341e44278..f6856ab0c 100644 --- a/include/overworld.h +++ b/include/overworld.h @@ -1,10 +1,10 @@  #ifndef GUARD_OVERWORLD_H  #define GUARD_OVERWORLD_H -struct UnkPlayerStruct +struct InitialPlayerAvatarState  { -    u8 player_field_0; -    u8 player_field_1; +    u8 transitionFlags; +    u8 direction;  };  struct LinkPlayerEventObject @@ -16,7 +16,7 @@ struct LinkPlayerEventObject  };  // Exported RAM declarations -extern struct WarpData gUnknown_020322DC; +extern struct WarpData gLastUsedWarp;  extern struct LinkPlayerEventObject gLinkPlayerEventObjects[4];  extern u16 *gBGTilemapBuffers1; @@ -26,7 +26,7 @@ extern u16 *gBGTilemapBuffers3;  extern void (*gFieldCallback)(void);  // Exported ROM declarations -extern const struct UCoords32 gUnknown_08339D64[]; +extern const struct UCoords32 gDirectionToVectors[];  void DoWhiteOut(void);  void Overworld_ResetStateAfterFly(void); @@ -45,13 +45,13 @@ const struct MapLayout *GetMapLayout(void);  void ApplyCurrentWarp(void);  void set_warp2_warp3_to_neg_1(void);  void SetWarpData(struct WarpData *warp, s8 mapGroup, s8 mapNum, s8 warpId, s8 x, s8 y); -bool32 warp_data_is_not_neg_1(struct WarpData *warp); +bool32 IsDummyWarp(struct WarpData *warp);  struct MapHeader const *const Overworld_GetMapHeaderByGroupAndId(u16 mapGroup, u16 mapNum); -struct MapHeader const *const warp1_get_mapheader(void); -void set_current_map_header_from_sav1_save_old_name(void); +struct MapHeader const *const GetDestinationWarpMapHeader(void); +void LoadCurrentMapData(void);  void LoadSaveblockMapHeader(void); -void update_camera_pos_from_warpid(void); -void warp_in(void); +void SetPlayerCoordsFromWarp(void); +void WarpIntoMap(void);  void Overworld_SetWarpDestination(s8 mapGroup, s8 mapNum, s8 warpId, s8 x, s8 y);  void warp1_set_2(s8 mapGroup, s8 mapNum, s8 warpId);  void saved_warp2_set(s32 unused, s8 mapGroup, s8 mapNum, s8 warpId); @@ -63,21 +63,21 @@ void Overworld_SetHealLocationWarp(u8 healLocationId);  void sub_8084D5C(s16 a1, s16 a2);  void sub_8084DD4(s8 mapGroup, s8 mapNum, s8 warpId, s8 x, s8 y);  void sub_8084E14(void); -void sub_8084E2C(s8 mapGroup, s8 mapNum, s8 warpId, s8 x, s8 y); -void warp1_set_to_warp2(void); -void sub_8084E80(s8 mapGroup, s8 mapNum, s8 warpId, s8 x, s8 y); -void sub_8084EBC(s16 x, s16 y); +void SetFixedDiveWarp(s8 mapGroup, s8 mapNum, s8 warpId, s8 x, s8 y); +void SetFixedDiveWarpAsDestination(void); +void SetFixedHoleWarp(s8 mapGroup, s8 mapNum, s8 warpId, s8 x, s8 y); +void SetFixedHoleWarpAsDestination(s16 x, s16 y);  void warp1_set_to_sav1w(void);  void sub_8084F2C(s8 mapGroup, s8 mapNum, s8 warpId, s8 x, s8 y);  void sub_8084F6C(u8 a1);  void sub_8084FAC(void);  const struct MapConnection *GetMapConnection(u8 dir); -bool8 sub_8084FF8(u8 dir, u16 x, u16 y); -bool8 sub_8085058(u16 x, u16 y); -bool8 sub_8085078(u16 x, u16 y); +bool8 SetDiveWarp(u8 dir, u16 x, u16 y); +bool8 SetDiveWarpEmerge(u16 x, u16 y); +bool8 SetDiveWarpDive(u16 x, u16 y);  void mliX_load_map(u8 mapGroup, u8 mapNum); -void player_avatar_init_params_reset(void); -void walkrun_find_lowest_active_bit_in_bitfield(void); +void ResetInitialPlayerAvatarState(void); +void StoreInitialPlayerAvatarState(void);  bool32 Overworld_IsBikingAllowed(void);  void SetDefaultFlashLevel(void);  void Overworld_SetFlashLevel(s32 flashLevel); @@ -96,7 +96,7 @@ void Overworld_ChangeMusicToDefault(void);  void Overworld_ChangeMusicTo(u16 newMusic);  u8 GetMapMusicFadeoutSpeed(void);  void music_something(void); -bool8 sub_80859A0(void); +bool8 BGMusicStopped(void);  void Overworld_FadeOutMapMusic(void);  void UpdateAmbientCry(s16 *state, u16 *delayCounter);  u8 GetMapTypeByGroupAndId(s8 mapGroup, s8 mapNum); diff --git a/include/pokeball.h b/include/pokeball.h index 30a1d8b11..8e1d8b8ec 100644 --- a/include/pokeball.h +++ b/include/pokeball.h @@ -24,10 +24,10 @@ extern const struct SpriteTemplate gBallSpriteTemplates[];  #define POKEBALL_OPPONENT_SENDOUT   0xFE  u8 DoPokeballSendOutAnimation(s16 pan, u8 kindOfThrow); -void CreatePokeballSpriteToReleaseMon(u8 monSpriteId, u8 bank, u8 x, u8 y, u8 oamPriority, u8 subpriortiy, u8 g, u32 h, u16 species); +void CreatePokeballSpriteToReleaseMon(u8 monSpriteId, u8 battler, u8 x, u8 y, u8 oamPriority, u8 subpriortiy, u8 g, u32 h, u16 species);  u8 sub_807671C(u8 a, u8 b, u8 x, u8 y, u8 oamPriority, u8 subPriority, u8 g, u32 h); -void sub_8076918(u8 bank); -void DoHitAnimHealthboxEffect(u8 bank); +void sub_8076918(u8 battler); +void DoHitAnimHealthboxEffect(u8 battler);  void LoadBallGfx(u8 ballId);  void FreeBallGfx(u8 ballId); diff --git a/include/pokemon.h b/include/pokemon.h index 09496b5c3..abfb360f0 100644 --- a/include/pokemon.h +++ b/include/pokemon.h @@ -205,7 +205,7 @@ struct BoxPokemon      u8 hasSpecies:1;      u8 isEgg:1;      u8 unused:5; -    u8 otName[OT_NAME_LENGTH]; +    u8 otName[PLAYER_NAME_LENGTH];      u8 markings;      u16 checksum;      u16 unknown; diff --git a/include/record_mixing.h b/include/record_mixing.h index 3cd4d649e..f1b74c143 100644 --- a/include/record_mixing.h +++ b/include/record_mixing.h @@ -6,7 +6,7 @@ struct UnkRecordMixingStruct2a  {      u8 playerId[4];      u16 field_4; -    u8 playerName[PLAYER_NAME_LENGTH]; +    u8 playerName[PLAYER_NAME_LENGTH + 1];      u8 language;  }; @@ -15,8 +15,8 @@ struct UnkRecordMixingStruct2b      u8 playerId1[4];      u8 playerId2[4];      u16 field_8; -    u8 playerName1[PLAYER_NAME_LENGTH]; -    u8 playerName2[PLAYER_NAME_LENGTH]; +    u8 playerName1[PLAYER_NAME_LENGTH + 1]; +    u8 playerName2[PLAYER_NAME_LENGTH + 1];      u8 language;  }; diff --git a/include/sprite.h b/include/sprite.h index f972d09cc..26263737b 100644 --- a/include/sprite.h +++ b/include/sprite.h @@ -26,6 +26,8 @@ struct SpriteFrameImage  #define obj_frame_tiles(ptr) {.data = (u8 *)ptr, .size = sizeof ptr} +#define overworld_frame(ptr, width, height, frame) {.data = (u8 *)ptr + (width * height * frame * 64)/2, .size = (width * height * 64)/2} +  struct SpritePalette  {      const u16 *data;  // Raw uncompressed palette data | 
