From 769ddf22c266c2bf41d3353c5972bca8fa49c085 Mon Sep 17 00:00:00 2001 From: GriffinR Date: Thu, 24 Dec 2020 16:18:47 -0500 Subject: Label remaining subs in battle_tower.c --- include/battle_tower.h | 2 +- include/constants/battle_tower.h | 2 +- include/pokemon.h | 4 ++-- include/recorded_battle.h | 2 +- 4 files changed, 5 insertions(+), 5 deletions(-) (limited to 'include') diff --git a/include/battle_tower.h b/include/battle_tower.h index 30649719b..a80314592 100644 --- a/include/battle_tower.h +++ b/include/battle_tower.h @@ -83,6 +83,6 @@ u8 GetFrontierEnemyMonLevel(u8 lvlMode); s32 GetHighestLevelInPlayerParty(void); u8 FacilityClassToGraphicsId(u8 facilityClass); bool32 ValidateBattleTowerRecord(u8 recordId); // unused -void sub_8166188(void); +void TrySetLinkBattleTowerEnemyPartyLevel(void); #endif //GUARD_BATTLE_TOWER_H diff --git a/include/constants/battle_tower.h b/include/constants/battle_tower.h index b372c3ad5..f661ddc0b 100644 --- a/include/constants/battle_tower.h +++ b/include/constants/battle_tower.h @@ -14,7 +14,7 @@ #define BATTLE_TOWER_FUNC_LOAD_PARTNERS 10 #define BATTLE_TOWER_FUNC_PARTNER_MSG 11 #define BATTLE_TOWER_FUNC_LOAD_LINK_OPPONENTS 12 -#define BATTLE_TOWER_FUNC_13 13 +#define BATTLE_TOWER_FUNC_TRY_CLOSE_LINK 13 #define BATTLE_TOWER_FUNC_SET_PARTNER_GFX 14 #define BATTLE_TOWER_FUNC_SET_INTERVIEW_DATA 15 diff --git a/include/pokemon.h b/include/pokemon.h index a956b9c40..497e8070b 100644 --- a/include/pokemon.h +++ b/include/pokemon.h @@ -275,7 +275,7 @@ void CreateBattleTowerMon(struct Pokemon *mon, struct BattleTowerPokemon *src); void CreateBattleTowerMon2(struct Pokemon *mon, struct BattleTowerPokemon *src, bool8 lvl50); void CreateApprenticeMon(struct Pokemon *mon, const struct Apprentice *src, u8 monId); void CreateMonWithEVSpreadNatureOTID(struct Pokemon *mon, u16 species, u8 level, u8 nature, u8 fixedIV, u8 evSpread, u32 otId); -void sub_80686FC(struct Pokemon *mon, struct BattleTowerPokemon *dest); +void ConvertPokemonToBattleTowerPokemon(struct Pokemon *mon, struct BattleTowerPokemon *dest); void CreateObedientMon(struct Pokemon *mon, u16 species, u8 level, u8 fixedIV, u8 hasFixedPersonality, u32 fixedPersonality, u8 otIdType, u32 fixedOtId); bool8 sub_80688F8(u8 caseId, u8 battlerId); void SetDeoxysStats(void); @@ -381,7 +381,7 @@ void ClearBattleMonForms(void); u16 GetBattleBGM(void); void PlayBattleBGM(void); void PlayMapChosenOrBattleBGM(u16 songId); -void sub_806E694(u16 songId); +void CreateTask_PlayMapChosenOrBattleBGM(u16 songId); const u32 *GetMonFrontSpritePal(struct Pokemon *mon); const u32 *GetMonSpritePalFromSpeciesAndPersonality(u16 species, u32 otId, u32 personality); const struct CompressedSpritePalette *GetMonSpritePalStruct(struct Pokemon *mon); diff --git a/include/recorded_battle.h b/include/recorded_battle.h index 84c5c2ea2..252b25502 100644 --- a/include/recorded_battle.h +++ b/include/recorded_battle.h @@ -30,7 +30,7 @@ void sub_818603C(u8 arg0); u32 GetAiScriptsInRecordedBattle(void); void sub_8186444(void); bool8 sub_8186450(void); -void sub_8186468(u8 *dst); +void GetRecordedBattleRecordMixFriendName(u8 *dst); u8 GetRecordedBattleRecordMixFriendClass(void); u8 GetRecordedBattleApprenticeId(void); u8 GetRecordedBattleRecordMixFriendLanguage(void); -- cgit v1.2.3 From 2f426e0e7d70217d50f281484a6772c25e2e39b0 Mon Sep 17 00:00:00 2001 From: GriffinR Date: Tue, 29 Dec 2020 16:51:44 -0500 Subject: Index battle controller cmd tables --- include/battle_controllers.h | 26 +++++++++++++------------- 1 file changed, 13 insertions(+), 13 deletions(-) (limited to 'include') diff --git a/include/battle_controllers.h b/include/battle_controllers.h index 32918fefb..5b1ada11a 100644 --- a/include/battle_controllers.h +++ b/include/battle_controllers.h @@ -85,8 +85,8 @@ enum struct UnusedControllerStruct { - u8 field_0:7; - u8 flag_x80:1; + u8 unk:7; + u8 flag:1; }; struct HpAndStatus @@ -145,19 +145,19 @@ enum CONTROLLER_STATUSXOR, CONTROLLER_DATATRANSFER, CONTROLLER_DMA3TRANSFER, - CONTROLLER_31, + CONTROLLER_PLAYBGM, CONTROLLER_32, CONTROLLER_TWORETURNVALUES, CONTROLLER_CHOSENMONRETURNVALUE, CONTROLLER_ONERETURNVALUE, CONTROLLER_ONERETURNVALUE_DUPLICATE, - CONTROLLER_37, - CONTROLLER_38, - CONTROLLER_39, - CONTROLLER_40, + CONTROLLER_CLEARUNKVAR, + CONTROLLER_SETUNKVAR, + CONTROLLER_CLEARUNKFLAG, + CONTROLLER_TOGGLEUNKFLAG, CONTROLLER_HITANIMATION, CONTROLLER_42, - CONTROLLER_EFFECTIVENESSSOUND, + CONTROLLER_PLAYSE, CONTROLLER_PLAYFANFAREORBGM, CONTROLLER_FAINTINGCRY, CONTROLLER_INTROSLIDE, @@ -175,7 +175,7 @@ enum CONTROLLER_CMDS_COUNT }; -extern struct UnusedControllerStruct gUnknown_02022D0C; +extern struct UnusedControllerStruct gUnusedControllerStruct; // general functions void HandleLinkBattleSetup(void); @@ -222,10 +222,10 @@ void BtlController_EmitTwoReturnValues(u8 bufferId, u8 arg1, u16 arg2); void BtlController_EmitChosenMonReturnValue(u8 bufferId, u8 b, u8 *c); void BtlController_EmitOneReturnValue(u8 bufferId, u16 arg1); void BtlController_EmitOneReturnValue_Duplicate(u8 bufferId, u16 b); -void BtlController_EmitCmd37(u8 bufferId); // unused -void BtlController_EmitCmd38(u8 bufferId, u8 b); // unused -void BtlController_EmitCmd39(u8 bufferId); // unused -void BtlController_EmitCmd40(u8 bufferId); // unused +void BtlController_EmitClearUnkVar(u8 bufferId); // unused +void BtlController_EmitSetUnkVar(u8 bufferId, u8 b); // unused +void BtlController_EmitClearUnkFlag(u8 bufferId); // unused +void BtlController_EmitToggleUnkFlag(u8 bufferId); // unused void BtlController_EmitHitAnimation(u8 bufferId); void BtlController_EmitCmd42(u8 bufferId); void BtlController_EmitPlaySE(u8 bufferId, u16 songId); -- cgit v1.2.3 From 0bf49198f62484284994f6f54c68597608013eb2 Mon Sep 17 00:00:00 2001 From: GriffinR Date: Mon, 28 Dec 2020 17:32:08 -0500 Subject: Resume factory screen doc --- include/graphics.h | 5 +++++ include/strings.h | 27 +++++++++++++++++++++++++++ 2 files changed, 32 insertions(+) (limited to 'include') diff --git a/include/graphics.h b/include/graphics.h index d9189622a..b5e9396d0 100644 --- a/include/graphics.h +++ b/include/graphics.h @@ -5013,4 +5013,9 @@ extern const u16 gPokenavMessageBox_Pal[]; extern const u32 gPokenavOptions_Gfx[]; extern const u16 gPokenavOptions_Pal[]; +// Battle Factory Screen +extern const u8 gFrontierFactorySelectMenu_Gfx[]; +extern const u8 gFrontierFactorySelectMenu_Tilemap[]; +extern const u16 gFrontierFactorySelectMenu_Pal[]; + #endif //GUARD_GRAPHICS_H diff --git a/include/strings.h b/include/strings.h index 7018f9e0d..294ab8aa6 100644 --- a/include/strings.h +++ b/include/strings.h @@ -2988,4 +2988,31 @@ extern const u8 gText_SavingDontTurnOff2[]; extern const u8 gText_BlenderMaxSpeedRecord[]; extern const u8 gText_234Players[]; +// Battle Factory Screen +extern const u8 gText_RentalPkmn2[]; +extern const u8 gText_SelectFirstPkmn[]; +extern const u8 gText_SelectSecondPkmn[]; +extern const u8 gText_SelectThirdPkmn[]; +extern const u8 gText_TheseThreePkmnOkay[]; +extern const u8 gText_CantSelectSamePkmn[]; +extern const u8 gText_Summary[]; +extern const u8 gText_Rechoose[]; +extern const u8 gText_Deselect[]; +extern const u8 gText_Rent[]; +extern const u8 gText_Others2[]; +extern const u8 gText_Yes2[]; +extern const u8 gText_Yes3[]; +extern const u8 gText_No2[]; +extern const u8 gText_No3[]; +extern const u8 gText_QuitSwapping[]; +extern const u8 gText_AcceptThisPkmn[]; +extern const u8 gText_SelectPkmnToAccept[]; +extern const u8 gText_SelectPkmnToSwap[]; +extern const u8 gText_PkmnSwap[]; +extern const u8 gText_Swap[]; +extern const u8 gText_Summary2[]; +extern const u8 gText_PkmnForSwap[]; +extern const u8 gText_SamePkmnInPartyAlready[]; +extern const u8 gText_Cancel3[]; + #endif // GUARD_STRINGS_H -- cgit v1.2.3 From c711a2f73ba9fbea609c378298a429f99274dab9 Mon Sep 17 00:00:00 2001 From: GriffinR Date: Fri, 1 Jan 2021 15:34:21 -0500 Subject: Document warp spin functions --- include/field_player_avatar.h | 10 +++++----- include/field_screen_effect.h | 4 ++-- 2 files changed, 7 insertions(+), 7 deletions(-) (limited to 'include') diff --git a/include/field_player_avatar.h b/include/field_player_avatar.h index 722fe4444..aa1a2e0dc 100644 --- a/include/field_player_avatar.h +++ b/include/field_player_avatar.h @@ -36,7 +36,7 @@ void sub_808BCE8(void); void InitPlayerAvatar(s16 a, s16 b, u8 c, u8 d); void sub_808B864(void); void sub_808BCF4(void); -void sub_808D074(u8); +void SetSpinStartFacingDir(u8); void GetXYCoordsOneStepInFrontOfPlayer(s16 *xPtr, s16 *yPtr); u8 GetRivalAvatarGraphicsIdByStateIdAndGender(u8, u8); void SetPlayerAvatarFieldMove(void); @@ -57,10 +57,10 @@ void PlayerWheelieMove(u8 direction); void PlayerPopWheelieWhileMoving(u8 direction); void PlayerUseAcroBikeOnBumpySlope(u8 direction); void PlayerEndWheelieWhileMoving(u8 direction); -void sub_808D194(void); -void sub_808D1C8(void); -bool32 sub_808D1B4(void); -bool32 sub_808D1E8(void); +void DoPlayerSpinEntrance(void); +void DoPlayerSpinExit(void); +bool32 IsPlayerSpinEntranceActive(void); +bool32 IsPlayerSpinExitActive(void); void SetPlayerInvisibility(bool8 invisible); u8 player_get_pos_including_state_based_drift(s16 *x, s16 *y); void StartFishing(u8 rod); diff --git a/include/field_screen_effect.h b/include/field_screen_effect.h index 951bf0788..deb80f3dd 100644 --- a/include/field_screen_effect.h +++ b/include/field_screen_effect.h @@ -35,8 +35,8 @@ void DoCableClubWarp(void); void DoContestHallWarp(void); void AnimateFlash(u8 flashLevel); void WriteBattlePyramidViewScanlineEffectBuffer(void); -void sub_80B0244(void); -void sub_80B0268(void); +void DoSpinEnterWarp(void); +void DoSpinExitWarp(void); void DoOrbEffect(void); void FadeOutOrbEffect(void); void sub_80B05B4(void); -- cgit v1.2.3 From 88e951bfe39066d9109e714968410a5277c3cfac Mon Sep 17 00:00:00 2001 From: GriffinR Date: Fri, 1 Jan 2021 17:02:03 -0500 Subject: Label some ReturnToField funcs --- include/field_screen_effect.h | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'include') diff --git a/include/field_screen_effect.h b/include/field_screen_effect.h index deb80f3dd..4e4725041 100644 --- a/include/field_screen_effect.h +++ b/include/field_screen_effect.h @@ -18,8 +18,8 @@ void FieldCB_WarpExitFadeFromBlack(void); void FieldCB_WarpExitFadeFromWhite(void); bool8 FieldCB_ReturnToFieldOpenStartMenu(void); void ReturnToFieldOpenStartMenu(void); -void sub_80AF6D4(void); -void sub_80AF6F0(void); +void FieldCB_ReturnToFieldNoScript(void); +void FieldCB_ReturnToFieldNoScriptCheckMusic(void); void DoWarp(void); void DoDiveWarp(void); void DoSootopolisLegendWarp(void); -- cgit v1.2.3 From e0c0143f4191cb05e3e70af32df0f3eb6b0e3675 Mon Sep 17 00:00:00 2001 From: GriffinR Date: Mon, 4 Jan 2021 10:14:01 -0500 Subject: Fix substitute back sprite --- include/graphics.h | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'include') diff --git a/include/graphics.h b/include/graphics.h index 5c15b7a66..d3d01bc57 100644 --- a/include/graphics.h +++ b/include/graphics.h @@ -4087,8 +4087,8 @@ extern const u32 gConfetti_Gfx[]; extern const u32 gConfetti_Pal[]; extern const u32 gUnknown_08C093F0[]; -extern const u32 gSubstituteDollTilemap[]; -extern const u32 gSubstituteDollGfx[]; +extern const u32 gSubstituteDollBackGfx[]; +extern const u32 gSubstituteDollFrontGfx[]; extern const u32 gSubstituteDollPal[]; extern const u32 gHealthboxSinglesPlayerGfx[]; extern const u32 gHealthboxSinglesOpponentGfx[]; -- cgit v1.2.3 From 3c2a33b9b25b3bba33c29a10e66d5256b10c537d Mon Sep 17 00:00:00 2001 From: SphericalIce Date: Thu, 7 Jan 2021 22:13:14 +0000 Subject: Use constants for max IVs & the random IV generation flag --- include/constants/pokemon.h | 3 +++ 1 file changed, 3 insertions(+) (limited to 'include') diff --git a/include/constants/pokemon.h b/include/constants/pokemon.h index bac914fec..d4f6e5684 100644 --- a/include/constants/pokemon.h +++ b/include/constants/pokemon.h @@ -232,6 +232,9 @@ #define STATUS_PRIMARY_POKERUS 6 #define STATUS_PRIMARY_FAINTED 7 +#define MAX_PER_STAT_IVS 31 +#define MAX_IV_MASK 31 +#define USE_RANDOM_IVS (MAX_PER_STAT_IVS + 1) #define MAX_PER_STAT_EVS 255 #define MAX_TOTAL_EVS 510 #define EV_ITEM_RAISE_LIMIT 100 -- cgit v1.2.3 From cbaf9b38b2b3b857652752da37f5906aff47ead8 Mon Sep 17 00:00:00 2001 From: opakedragon <46143024+opakedragon@users.noreply.github.com> Date: Mon, 11 Jan 2021 08:48:00 -0500 Subject: rename string id to reflect usage --- include/constants/battle_string_ids.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'include') diff --git a/include/constants/battle_string_ids.h b/include/constants/battle_string_ids.h index 9e0d8e0be..1886043f1 100644 --- a/include/constants/battle_string_ids.h +++ b/include/constants/battle_string_ids.h @@ -124,7 +124,7 @@ #define STRINGID_PKMNSTORINGENERGY 120 #define STRINGID_PKMNUNLEASHEDENERGY 121 #define STRINGID_PKMNFATIGUECONFUSION 122 -#define STRINGID_PKMNPICKEDUPITEM 123 +#define STRINGID_PLAYERPICKEDUPMONEY 123 #define STRINGID_PKMNUNAFFECTED 124 #define STRINGID_PKMNTRANSFORMEDINTO 125 #define STRINGID_PKMNMADESUBSTITUTE 126 -- cgit v1.2.3 From 92de664f793d845277ea0adde8d76431574a536d Mon Sep 17 00:00:00 2001 From: GriffinR Date: Mon, 11 Jan 2021 16:07:16 -0500 Subject: List battle animation indexes alongside tables --- include/constants/battle_anim.h | 86 ++++++++++++++++++++--------------------- 1 file changed, 43 insertions(+), 43 deletions(-) (limited to 'include') diff --git a/include/constants/battle_anim.h b/include/constants/battle_anim.h index ebc422b18..5f8900bf6 100644 --- a/include/constants/battle_anim.h +++ b/include/constants/battle_anim.h @@ -346,51 +346,51 @@ #define BG_SOLARBEAM_PLAYER 25 #define BG_SOLARBEAM_CONTESTS 26 -// table ids for general animations -#define B_ANIM_CASTFORM_CHANGE 0x0 -#define B_ANIM_STATS_CHANGE 0x1 -#define B_ANIM_SUBSTITUTE_FADE 0x2 -#define B_ANIM_SUBSTITUTE_APPEAR 0x3 -#define B_ANIM_POKEBLOCK_THROW 0x4 -#define B_ANIM_ITEM_KNOCKOFF 0x5 -#define B_ANIM_TURN_TRAP 0x6 -#define B_ANIM_HELD_ITEM_EFFECT 0x7 -#define B_ANIM_SMOKEBALL_ESCAPE 0x8 -#define B_ANIM_FOCUS_BAND 0x9 -#define B_ANIM_RAIN_CONTINUES 0xA -#define B_ANIM_SUN_CONTINUES 0xB -#define B_ANIM_SANDSTORM_CONTINUES 0xC -#define B_ANIM_HAIL_CONTINUES 0xD -#define B_ANIM_LEECH_SEED_DRAIN 0xE -#define B_ANIM_MON_HIT 0xF -#define B_ANIM_ITEM_STEAL 0x10 -#define B_ANIM_SNATCH_MOVE 0x11 -#define B_ANIM_FUTURE_SIGHT_HIT 0x12 -#define B_ANIM_DOOM_DESIRE_HIT 0x13 -#define B_ANIM_FOCUS_PUNCH_SETUP 0x14 -#define B_ANIM_INGRAIN_HEAL 0x15 -#define B_ANIM_WISH_HEAL 0x16 +// table ids for general animations (gBattleAnims_General) +#define B_ANIM_CASTFORM_CHANGE 0 +#define B_ANIM_STATS_CHANGE 1 +#define B_ANIM_SUBSTITUTE_FADE 2 +#define B_ANIM_SUBSTITUTE_APPEAR 3 +#define B_ANIM_POKEBLOCK_THROW 4 +#define B_ANIM_ITEM_KNOCKOFF 5 +#define B_ANIM_TURN_TRAP 6 +#define B_ANIM_HELD_ITEM_EFFECT 7 +#define B_ANIM_SMOKEBALL_ESCAPE 8 +#define B_ANIM_FOCUS_BAND 9 +#define B_ANIM_RAIN_CONTINUES 10 +#define B_ANIM_SUN_CONTINUES 11 +#define B_ANIM_SANDSTORM_CONTINUES 12 +#define B_ANIM_HAIL_CONTINUES 13 +#define B_ANIM_LEECH_SEED_DRAIN 14 +#define B_ANIM_MON_HIT 15 +#define B_ANIM_ITEM_STEAL 16 +#define B_ANIM_SNATCH_MOVE 17 +#define B_ANIM_FUTURE_SIGHT_HIT 18 +#define B_ANIM_DOOM_DESIRE_HIT 19 +#define B_ANIM_FOCUS_PUNCH_SETUP 20 +#define B_ANIM_INGRAIN_HEAL 21 +#define B_ANIM_WISH_HEAL 22 -// special animations table -#define B_ANIM_LVL_UP 0x0 -#define B_ANIM_SWITCH_OUT_PLAYER_MON 0x1 -#define B_ANIM_SWITCH_OUT_OPPONENT_MON 0x2 -#define B_ANIM_BALL_THROW 0x3 -#define B_ANIM_BALL_THROW_WITH_TRAINER 0x4 -#define B_ANIM_SUBSTITUTE_TO_MON 0x5 -#define B_ANIM_MON_TO_SUBSTITUTE 0x6 +// special animations table (gBattleAnims_Special) +#define B_ANIM_LVL_UP 0 +#define B_ANIM_SWITCH_OUT_PLAYER_MON 1 +#define B_ANIM_SWITCH_OUT_OPPONENT_MON 2 +#define B_ANIM_BALL_THROW 3 +#define B_ANIM_BALL_THROW_WITH_TRAINER 4 +#define B_ANIM_SUBSTITUTE_TO_MON 5 +#define B_ANIM_MON_TO_SUBSTITUTE 6 -// status animation table -#define B_ANIM_STATUS_PSN 0x0 -#define B_ANIM_STATUS_CONFUSION 0x1 -#define B_ANIM_STATUS_BRN 0x2 -#define B_ANIM_STATUS_INFATUATION 0x3 -#define B_ANIM_STATUS_SLP 0x4 -#define B_ANIM_STATUS_PRZ 0x5 -#define B_ANIM_STATUS_FRZ 0x6 -#define B_ANIM_STATUS_CURSED 0x7 -#define B_ANIM_STATUS_NIGHTMARE 0x8 -#define B_ANIM_STATUS_WRAPPED 0x9 // does not actually exist +// status animation table (gBattleAnims_StatusConditions) +#define B_ANIM_STATUS_PSN 0 +#define B_ANIM_STATUS_CONFUSION 1 +#define B_ANIM_STATUS_BRN 2 +#define B_ANIM_STATUS_INFATUATION 3 +#define B_ANIM_STATUS_SLP 4 +#define B_ANIM_STATUS_PRZ 5 +#define B_ANIM_STATUS_FRZ 6 +#define B_ANIM_STATUS_CURSED 7 +#define B_ANIM_STATUS_NIGHTMARE 8 +#define B_ANIM_STATUS_WRAPPED 9 // does not actually exist // Tasks with return values often assign them to gBattleAnimArgs[7]. #define ARG_RET_ID 7 -- cgit v1.2.3 From b9e1b050e10c8d7d62eb49fb1a4ab1a30a1bdaa8 Mon Sep 17 00:00:00 2001 From: GriffinR Date: Wed, 13 Jan 2021 15:17:32 -0500 Subject: Label remaining battle types --- include/constants/battle.h | 64 +++++++++++++++++++++++----------------------- include/recorded_battle.h | 2 +- 2 files changed, 33 insertions(+), 33 deletions(-) (limited to 'include') diff --git a/include/constants/battle.h b/include/constants/battle.h index fa8f422c4..e6ebc85e4 100644 --- a/include/constants/battle.h +++ b/include/constants/battle.h @@ -44,38 +44,38 @@ #define BIT_FLANK 2 // Battle Type Flags -#define BATTLE_TYPE_DOUBLE (1 << 0) -#define BATTLE_TYPE_LINK (1 << 1) -#define BATTLE_TYPE_IS_MASTER (1 << 2) // In not-link battles, it's always set. -#define BATTLE_TYPE_TRAINER (1 << 3) -#define BATTLE_TYPE_FIRST_BATTLE (1 << 4) -#define BATTLE_TYPE_20 (1 << 5) -#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_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_PIKE (1 << 20) -#define BATTLE_TYPE_PYRAMID (1 << 21) -#define BATTLE_TYPE_INGAME_PARTNER (1 << 22) -#define BATTLE_TYPE_x800000 (1 << 23) -#define BATTLE_TYPE_RECORDED (1 << 24) -#define BATTLE_TYPE_x2000000 (1 << 25) -#define BATTLE_TYPE_TRAINER_HILL (1 << 26) -#define BATTLE_TYPE_SECRET_BASE (1 << 27) -#define BATTLE_TYPE_GROUDON (1 << 28) -#define BATTLE_TYPE_KYOGRE (1 << 29) -#define BATTLE_TYPE_RAYQUAZA (1 << 30) -#define BATTLE_TYPE_x80000000 (1 << 31) +#define BATTLE_TYPE_DOUBLE (1 << 0) +#define BATTLE_TYPE_LINK (1 << 1) +#define BATTLE_TYPE_IS_MASTER (1 << 2) // In not-link battles, it's always set. +#define BATTLE_TYPE_TRAINER (1 << 3) +#define BATTLE_TYPE_FIRST_BATTLE (1 << 4) +#define BATTLE_TYPE_LINK_IN_BATTLE (1 << 5) // Set on battle entry, cleared on exit. Checked rarely +#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_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_PIKE (1 << 20) +#define BATTLE_TYPE_PYRAMID (1 << 21) +#define BATTLE_TYPE_INGAME_PARTNER (1 << 22) +#define BATTLE_TYPE_TOWER_LINK_MULTI (1 << 23) +#define BATTLE_TYPE_RECORDED (1 << 24) +#define BATTLE_TYPE_RECORDED_LINK (1 << 25) +#define BATTLE_TYPE_TRAINER_HILL (1 << 26) +#define BATTLE_TYPE_SECRET_BASE (1 << 27) +#define BATTLE_TYPE_GROUDON (1 << 28) +#define BATTLE_TYPE_KYOGRE (1 << 29) +#define BATTLE_TYPE_RAYQUAZA (1 << 30) +#define BATTLE_TYPE_RECORDED_IS_MASTER (1 << 31) #define BATTLE_TYPE_FRONTIER (BATTLE_TYPE_BATTLE_TOWER | BATTLE_TYPE_DOME | BATTLE_TYPE_PALACE | BATTLE_TYPE_ARENA | BATTLE_TYPE_FACTORY | BATTLE_TYPE_PIKE | BATTLE_TYPE_PYRAMID) #define BATTLE_TYPE_FRONTIER_NO_PYRAMID (BATTLE_TYPE_BATTLE_TOWER | BATTLE_TYPE_DOME | BATTLE_TYPE_PALACE | BATTLE_TYPE_ARENA | BATTLE_TYPE_FACTORY | BATTLE_TYPE_PIKE) diff --git a/include/recorded_battle.h b/include/recorded_battle.h index 252b25502..55353a6d1 100644 --- a/include/recorded_battle.h +++ b/include/recorded_battle.h @@ -3,7 +3,7 @@ extern u32 gRecordedBattleRngSeed; extern u32 gBattlePalaceMoveSelectionRngValue; -extern u8 gUnknown_0203C7B4; +extern u8 gRecordedBattleMultiplayerId; void sub_8184DA4(u8 arg0); void sub_8184E58(void); -- cgit v1.2.3 From 564278fd4927901edf06e1b31d44c27909db405c Mon Sep 17 00:00:00 2001 From: GriffinR Date: Thu, 14 Jan 2021 06:29:59 -0500 Subject: Document battle tv data --- include/constants/battle_move_effects.h | 2 ++ include/tv.h | 2 +- 2 files changed, 3 insertions(+), 1 deletion(-) (limited to 'include') diff --git a/include/constants/battle_move_effects.h b/include/constants/battle_move_effects.h index b54f01353..cc62208fa 100644 --- a/include/constants/battle_move_effects.h +++ b/include/constants/battle_move_effects.h @@ -216,4 +216,6 @@ #define EFFECT_DRAGON_DANCE 212 #define EFFECT_CAMOUFLAGE 213 +#define NUM_BATTLE_MOVE_EFFECTS 214 + #endif // GUARD_CONSTANTS_BATTLE_MOVE_EFFECTS_H diff --git a/include/tv.h b/include/tv.h index 4dc14143c..482909499 100644 --- a/include/tv.h +++ b/include/tv.h @@ -8,7 +8,7 @@ extern u8 *const gTVStringVarPtrs[3]; void ClearTVShowData(void); void sub_80EE184(void); -void sub_80EE35C(u16 foeSpecies, u16 species, u8 moveIdx, const u16 *movePtr, u16 betterMove); +void TryPutBattleSeminarOnAir(u16 foeSpecies, u16 species, u8 moveIdx, const u16 *movePtr, u16 betterMove); void TryPutFrontierTVShowOnAir(u16 winStreak, u8 facility); void DoTVShow(void); void DoTVShowInSearchOfTrainers(void); -- cgit v1.2.3 From 2da0c3436eede0ac9e2d407bbc9fde2377926a04 Mon Sep 17 00:00:00 2001 From: GriffinR Date: Fri, 15 Jan 2021 00:14:46 -0500 Subject: Make filler in PokemonSubstruct0 explicit --- include/pokemon.h | 1 + 1 file changed, 1 insertion(+) (limited to 'include') diff --git a/include/pokemon.h b/include/pokemon.h index 497e8070b..addf580e9 100644 --- a/include/pokemon.h +++ b/include/pokemon.h @@ -11,6 +11,7 @@ struct PokemonSubstruct0 u32 experience; u8 ppBonuses; u8 friendship; + u16 filler; }; struct PokemonSubstruct1 -- cgit v1.2.3 From bc20fda6041244d83775f6e3084f74ebe81a5fda Mon Sep 17 00:00:00 2001 From: GriffinR Date: Tue, 19 Jan 2021 04:03:16 -0500 Subject: Use GET_UNOWN_LETTER macro --- include/pokemon.h | 9 +++++++++ 1 file changed, 9 insertions(+) (limited to 'include') diff --git a/include/pokemon.h b/include/pokemon.h index addf580e9..0320da1f2 100644 --- a/include/pokemon.h +++ b/include/pokemon.h @@ -238,6 +238,15 @@ struct Evolution u16 targetSpecies; }; +#define NUM_UNOWN_FORMS 28 + +#define GET_UNOWN_LETTER(personality) (( \ + ((personality & 0x03000000) >> 18) \ + | ((personality & 0x00030000) >> 12) \ + | ((personality & 0x00000300) >> 6) \ + | ((personality & 0x00000003) >> 0) \ +) % NUM_UNOWN_FORMS) + extern u8 gPlayerPartyCount; extern struct Pokemon gPlayerParty[PARTY_SIZE]; extern u8 gEnemyPartyCount; -- cgit v1.2.3 From cf9f8d01c513f13b014da3fe3995aef3071e542b Mon Sep 17 00:00:00 2001 From: GriffinR Date: Tue, 19 Jan 2021 05:49:20 -0500 Subject: Add misc item data constants --- include/constants/items.h | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) (limited to 'include') diff --git a/include/constants/items.h b/include/constants/items.h index 95c6aacfe..21f0608a7 100644 --- a/include/constants/items.h +++ b/include/constants/items.h @@ -490,6 +490,8 @@ #define ITEM_TO_BERRY(itemId)(((itemId - FIRST_BERRY_INDEX) + 1)) +#define FIRST_MAIL_INDEX ITEM_ORANGE_MAIL + #define NUM_TECHNICAL_MACHINES 50 #define NUM_HIDDEN_MACHINES 8 @@ -506,6 +508,21 @@ #define GOOD_ROD 1 #define SUPER_ROD 2 +// Secondary IDs for bikes +#define MACH_BIKE 0 +#define ACRO_BIKE 1 + +// Item type IDs (used to determine the exit callback) +#define ITEM_USE_MAIL 0 +#define ITEM_USE_PARTY_MENU 1 +#define ITEM_USE_FIELD 2 +#define ITEM_USE_PBLOCK_CASE 3 +#define ITEM_USE_BAG_MENU 4 // No exit callback, stays in bag menu + +// Item battle usage IDs (only checked to see if nonzero) +#define ITEM_B_USE_MEDICINE 1 +#define ITEM_B_USE_OTHER 2 + // Check if the item is one that can be used on a Pokemon. #define ITEM_HAS_EFFECT(item) ((item) >= ITEM_POTION && (item) <= ITEM_0B2) -- cgit v1.2.3 From 8de76ed5338b819784e426bd9d6c7d0164e23a61 Mon Sep 17 00:00:00 2001 From: SphericalIce Date: Tue, 19 Jan 2021 17:15:12 +0000 Subject: Make broader use of RGB macros --- include/constants/rgb.h | 23 +++++++++++++---------- 1 file changed, 13 insertions(+), 10 deletions(-) (limited to 'include') diff --git a/include/constants/rgb.h b/include/constants/rgb.h index 1896250d2..6af947f60 100644 --- a/include/constants/rgb.h +++ b/include/constants/rgb.h @@ -5,18 +5,21 @@ #define GET_G(color) (((color) >> 5) & 0x1F) #define GET_B(color) (((color) >> 10) & 0x1F) -#define RGB(r, g, b) ((r) | ((g) << 5) | ((b) << 10)) +#define RGB(r, g, b) ((r) | ((g) << 5) | ((b) << 10)) #define RGB2(r, g, b) (((b) << 10) | ((g) << 5) | (r)) #define _RGB(r, g, b) ((((b) & 0x1F) << 10) + (((g) & 0x1F) << 5) + ((r) & 0x1F)) -#define RGB_BLACK RGB(0, 0, 0) -#define RGB_WHITE RGB(31, 31, 31) -#define RGB_RED RGB(31, 0, 0) -#define RGB_GREEN RGB(0, 31, 0) -#define RGB_BLUE RGB(0, 0, 31) -#define RGB_YELLOW RGB(31, 31, 0) -#define RGB_MAGENTA RGB(31, 0, 31) -#define RGB_CYAN RGB(0, 31, 31) -#define RGB_WHITEALPHA (RGB_WHITE | 0x8000) +#define RGB_ALPHA (1 << 15) +#define IS_ALPHA(color) (color & RGB_ALPHA) + +#define RGB_BLACK RGB(0, 0, 0) +#define RGB_WHITE RGB(31, 31, 31) +#define RGB_RED RGB(31, 0, 0) +#define RGB_GREEN RGB(0, 31, 0) +#define RGB_BLUE RGB(0, 0, 31) +#define RGB_YELLOW RGB(31, 31, 0) +#define RGB_MAGENTA RGB(31, 0, 31) +#define RGB_CYAN RGB(0, 31, 31) +#define RGB_WHITEALPHA (RGB_WHITE | RGB_ALPHA) #endif // GUARD_RGB_H -- cgit v1.2.3 From 305ebdbc4a41960faa4fdde2422b443036f1edad Mon Sep 17 00:00:00 2001 From: GriffinR Date: Tue, 19 Jan 2021 12:36:36 -0500 Subject: Parentheses for GET_UNOWN_LETTER --- include/pokemon.h | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) (limited to 'include') diff --git a/include/pokemon.h b/include/pokemon.h index 0320da1f2..0ff635a3f 100644 --- a/include/pokemon.h +++ b/include/pokemon.h @@ -240,11 +240,11 @@ struct Evolution #define NUM_UNOWN_FORMS 28 -#define GET_UNOWN_LETTER(personality) (( \ - ((personality & 0x03000000) >> 18) \ - | ((personality & 0x00030000) >> 12) \ - | ((personality & 0x00000300) >> 6) \ - | ((personality & 0x00000003) >> 0) \ +#define GET_UNOWN_LETTER(personality) (( \ + (((personality) & 0x03000000) >> 18) \ + | (((personality) & 0x00030000) >> 12) \ + | (((personality) & 0x00000300) >> 6) \ + | (((personality) & 0x00000003) >> 0) \ ) % NUM_UNOWN_FORMS) extern u8 gPlayerPartyCount; -- cgit v1.2.3 From 2dfaba9472c933f5a659a38fa2581ecf3d3f0ef7 Mon Sep 17 00:00:00 2001 From: SphericalIce Date: Tue, 19 Jan 2021 17:59:36 +0000 Subject: Name color return values more accurately --- include/constants/rgb.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'include') diff --git a/include/constants/rgb.h b/include/constants/rgb.h index 6af947f60..be3049d3c 100644 --- a/include/constants/rgb.h +++ b/include/constants/rgb.h @@ -10,7 +10,7 @@ #define _RGB(r, g, b) ((((b) & 0x1F) << 10) + (((g) & 0x1F) << 5) + ((r) & 0x1F)) #define RGB_ALPHA (1 << 15) -#define IS_ALPHA(color) (color & RGB_ALPHA) +#define IS_ALPHA(color) ((color) & RGB_ALPHA) #define RGB_BLACK RGB(0, 0, 0) #define RGB_WHITE RGB(31, 31, 31) -- cgit v1.2.3 From 752982552e212dcb33d57c66342f87eba3ce9089 Mon Sep 17 00:00:00 2001 From: GriffinR Date: Tue, 19 Jan 2021 13:39:18 -0500 Subject: Add FIRST_BALL, some FIRST_BERRY_INDEX usage --- include/constants/items.h | 17 +++++++++++------ 1 file changed, 11 insertions(+), 6 deletions(-) (limited to 'include') diff --git a/include/constants/items.h b/include/constants/items.h index 21f0608a7..71338da8e 100644 --- a/include/constants/items.h +++ b/include/constants/items.h @@ -17,7 +17,11 @@ #define ITEM_LUXURY_BALL 11 #define ITEM_PREMIER_BALL 12 -#define LAST_BALL ITEM_PREMIER_BALL +// Note: If moving ball IDs around, updating FIRST_BALL/LAST_BALL is not sufficient +// Several places expect the ball IDs to be first and contiguous (e.g. gBattlescriptsForBallThrow and MON_DATA_POKEBALL) +// If adding new balls, it's easiest to insert them after the last ball and increment the below IDs (and removing ITEM_034 for example) +#define FIRST_BALL ITEM_MASTER_BALL +#define LAST_BALL ITEM_PREMIER_BALL // Pokemon Items #define ITEM_POTION 13 @@ -145,6 +149,8 @@ #define ITEM_FAB_MAIL 131 #define ITEM_RETRO_MAIL 132 +#define FIRST_MAIL_INDEX ITEM_ORANGE_MAIL + // Berries #define ITEM_CHERI_BERRY 133 #define ITEM_CHESTO_BERRY 134 @@ -189,6 +195,10 @@ #define ITEM_LANSAT_BERRY 173 #define ITEM_STARF_BERRY 174 #define ITEM_ENIGMA_BERRY 175 + +#define FIRST_BERRY_INDEX ITEM_CHERI_BERRY +#define LAST_BERRY_INDEX ITEM_ENIGMA_BERRY + #define ITEM_0B0 176 #define ITEM_0B1 177 #define ITEM_0B2 178 @@ -467,9 +477,6 @@ #define ITEMS_COUNT 377 #define ITEM_FIELD_ARROW ITEMS_COUNT -#define FIRST_BERRY_INDEX ITEM_CHERI_BERRY -#define LAST_BERRY_INDEX ITEM_ENIGMA_BERRY - // Range of berries given out by various NPCS #define FIRST_BERRY_MASTER_BERRY ITEM_POMEG_BERRY #define LAST_BERRY_MASTER_BERRY ITEM_NOMEL_BERRY @@ -490,8 +497,6 @@ #define ITEM_TO_BERRY(itemId)(((itemId - FIRST_BERRY_INDEX) + 1)) -#define FIRST_MAIL_INDEX ITEM_ORANGE_MAIL - #define NUM_TECHNICAL_MACHINES 50 #define NUM_HIDDEN_MACHINES 8 -- cgit v1.2.3 From 6dd973012bce48295e14fcb1c203c4ca72a36cd4 Mon Sep 17 00:00:00 2001 From: SphericalIce Date: Tue, 19 Jan 2021 23:21:50 +0000 Subject: Correct ground effect flag names for reflections & document sprite data usage --- include/event_object_movement.h | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) (limited to 'include') diff --git a/include/event_object_movement.h b/include/event_object_movement.h index 9b4d9302f..919c75399 100644 --- a/include/event_object_movement.h +++ b/include/event_object_movement.h @@ -16,14 +16,22 @@ enum SpinnerRunnerFollowPatterns RUNFOLLOW_SOUTH_EAST_WEST }; +enum ReflectionTypes +{ + REFL_TYPE_NONE, + REFL_TYPE_ICE, + REFL_TYPE_WATER +}; +#define NUM_REFLECTION_TYPES 2 + #define FIGURE_8_LENGTH 72 #define GROUND_EFFECT_FLAG_TALL_GRASS_ON_SPAWN (1 << 0) #define GROUND_EFFECT_FLAG_TALL_GRASS_ON_MOVE (1 << 1) #define GROUND_EFFECT_FLAG_LONG_GRASS_ON_SPAWN (1 << 2) #define GROUND_EFFECT_FLAG_LONG_GRASS_ON_MOVE (1 << 3) -#define GROUND_EFFECT_FLAG_ICE_REFLECTION (1 << 4) -#define GROUND_EFFECT_FLAG_REFLECTION (1 << 5) +#define GROUND_EFFECT_FLAG_WATER_REFLECTION (1 << 4) +#define GROUND_EFFECT_FLAG_ICE_REFLECTION (1 << 5) #define GROUND_EFFECT_FLAG_SHALLOW_FLOWING_WATER (1 << 6) #define GROUND_EFFECT_FLAG_SAND (1 << 7) #define GROUND_EFFECT_FLAG_DEEP_SAND (1 << 8) -- cgit v1.2.3 From 2746fd1f95b13f6cade1a7499917cc377d7b93be Mon Sep 17 00:00:00 2001 From: SphericalIce Date: Tue, 19 Jan 2021 23:35:57 +0000 Subject: Name object event ID arguments properly --- include/event_object_movement.h | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) (limited to 'include') diff --git a/include/event_object_movement.h b/include/event_object_movement.h index 919c75399..6abb4416f 100644 --- a/include/event_object_movement.h +++ b/include/event_object_movement.h @@ -422,10 +422,10 @@ u8 MovementType_RunInPlace_Step0(struct ObjectEvent *, struct Sprite *); u8 MovementType_Invisible_Step0(struct ObjectEvent *, struct Sprite *); u8 MovementType_Invisible_Step1(struct ObjectEvent *, struct Sprite *); u8 MovementType_Invisible_Step2(struct ObjectEvent *, struct Sprite *); -void SetObjectEventSpriteInvisibility(u8 var, bool32 var2); -bool32 IsObjectEventSpriteInvisible(u8 var); -void SetObjectEventSpriteGraphics(u8 var1, u8 graphicsId); -void SetObjectEventSpriteAnim(u8 var1, u8 var2); -bool32 IsObjectEventSpriteAnimating(u8 var); +void SetObjectEventSpriteInvisibility(u8 objectEventId, bool32 invisible); +bool32 IsObjectEventSpriteInvisible(u8 objectEventId); +void SetObjectEventSpriteGraphics(u8 objectEventId, u8 graphicsId); +void SetObjectEventSpriteAnim(u8 objectEventId, u8 animNum); +bool32 IsObjectEventSpriteAnimating(u8 objectEventId); #endif //GUARD_EVENT_OBJECT_MOVEMENT_H -- cgit v1.2.3 From 4334f7a3793af278846dab3471fe943cb96b3883 Mon Sep 17 00:00:00 2001 From: SphericalIce Date: Wed, 20 Jan 2021 10:17:07 +0000 Subject: Include NUM_REFLECTION_TYPES in the ReflectionTypes enum --- include/event_object_movement.h | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'include') diff --git a/include/event_object_movement.h b/include/event_object_movement.h index 6abb4416f..cd76cac11 100644 --- a/include/event_object_movement.h +++ b/include/event_object_movement.h @@ -20,9 +20,9 @@ enum ReflectionTypes { REFL_TYPE_NONE, REFL_TYPE_ICE, - REFL_TYPE_WATER + REFL_TYPE_WATER, + NUM_REFLECTION_TYPES }; -#define NUM_REFLECTION_TYPES 2 #define FIGURE_8_LENGTH 72 -- cgit v1.2.3 From 4eca05ccf5cce480e8018527798d3632ee43e551 Mon Sep 17 00:00:00 2001 From: GriffinR Date: Fri, 22 Jan 2021 02:48:22 -0500 Subject: Document remainder of battle_controllers.c --- include/battle.h | 4 ++-- include/battle_controllers.h | 16 ++++++++-------- include/battle_main.h | 2 +- include/battle_scripts.h | 2 +- include/battle_util.h | 2 +- include/recorded_battle.h | 8 +++++--- 6 files changed, 18 insertions(+), 16 deletions(-) (limited to 'include') diff --git a/include/battle.h b/include/battle.h index 53a78024a..547ac6b51 100644 --- a/include/battle.h +++ b/include/battle.h @@ -617,7 +617,7 @@ extern u8 gBattleTextBuff2[TEXT_BUFF_ARRAY_COUNT]; extern u8 gBattleTextBuff3[TEXT_BUFF_ARRAY_COUNT]; extern u32 gBattleTypeFlags; extern u8 gBattleTerrain; -extern u32 gUnknown_02022FF4; +extern u32 gUnusedFirstBattleVar1; extern u8 *gUnknown_0202305C; extern u8 *gUnknown_02023060; extern u8 gBattleBufferA[MAX_BATTLERS_COUNT][0x200]; @@ -667,7 +667,7 @@ extern u16 gChosenMoveByBattler[MAX_BATTLERS_COUNT]; extern u8 gMoveResultFlags; extern u32 gHitMarker; extern u8 gTakenDmgByBattler[MAX_BATTLERS_COUNT]; -extern u8 gUnknown_0202428C; +extern u8 gUnusedFirstBattleVar2; extern u16 gSideStatuses[2]; extern struct SideTimer gSideTimers[2]; extern u32 gStatuses3[MAX_BATTLERS_COUNT]; diff --git a/include/battle_controllers.h b/include/battle_controllers.h index 5b1ada11a..682212ccc 100644 --- a/include/battle_controllers.h +++ b/include/battle_controllers.h @@ -133,7 +133,7 @@ enum CONTROLLER_PRINTSTRING, CONTROLLER_PRINTSTRINGPLAYERONLY, CONTROLLER_CHOOSEACTION, - CONTROLLER_UNKNOWNYESNOBOX, + CONTROLLER_YESNOBOX, CONTROLLER_CHOOSEMOVE, CONTROLLER_OPENBAG, CONTROLLER_CHOOSEPOKEMON, @@ -169,7 +169,7 @@ enum CONTROLLER_BATTLEANIMATION, CONTROLLER_LINKSTANDBYMSG, CONTROLLER_RESETACTIONMOVESELECTION, - CONTROLLER_55, + CONTROLLER_ENDLINKBATTLE, /*new controllers should go here*/ CONTROLLER_TERMINATOR_NOP, CONTROLLER_CMDS_COUNT @@ -180,8 +180,8 @@ extern struct UnusedControllerStruct gUnusedControllerStruct; // general functions void HandleLinkBattleSetup(void); void SetUpBattleVarsAndBirchZigzagoon(void); -void sub_8032768(void); -void sub_8033648(void); +void InitBattleControllers(void); +void TryReceiveLinkBattleData(void); void PrepareBufferDataTransferLink(u8 bufferId, u16 size, u8 *data); // emitters @@ -204,7 +204,7 @@ void BtlController_EmitMoveAnimation(u8 bufferId, u16 move, u8 turnOfMove, u16 m void BtlController_EmitPrintString(u8 bufferId, u16 stringId); void BtlController_EmitPrintSelectionString(u8 bufferId, u16 stringId); void BtlController_EmitChooseAction(u8 bufferId, u8 arg1, u16 arg2); -void BtlController_EmitUnknownYesNoBox(u8 bufferId); +void BtlController_EmitYesNoBox(u8 bufferId); void BtlController_EmitChooseMove(u8 bufferId, bool8 isDoubleBattle, bool8 NoPpNumber, struct ChooseMoveStruct *movePpData); void BtlController_EmitChooseItem(u8 bufferId, u8* arg1); void BtlController_EmitChoosePokemon(u8 bufferId, u8 caseId, u8 arg2, u8 abilityId, u8* arg4); @@ -238,13 +238,13 @@ void BtlController_EmitHidePartyStatusSummary(u8 bufferId); void BtlController_EmitEndBounceEffect(u8 bufferId); void BtlController_EmitSpriteInvisibility(u8 bufferId, bool8 isInvisible); void BtlController_EmitBattleAnimation(u8 bufferId, u8 animationId, u16 argument); -void BtlController_EmitLinkStandbyMsg(u8 bufferId, u8 arg1, bool32 arg2); +void BtlController_EmitLinkStandbyMsg(u8 bufferId, u8 arg1, bool32 record); void BtlController_EmitResetActionMoveSelection(u8 bufferId, u8 caseId); -void BtlController_EmitCmd55(u8 bufferId, u8 battleOutcome); +void BtlController_EmitEndLinkBattle(u8 bufferId, u8 battleOutcome); // player controller void SetControllerToPlayer(void); -void nullsub_21(void); +void BattleControllerDummy(void); void PlayerHandleGetRawMonData(void); void sub_80587B0(void); void sub_805CC00(struct Sprite *sprite); diff --git a/include/battle_main.h b/include/battle_main.h index 0176f7f24..250839202 100644 --- a/include/battle_main.h +++ b/include/battle_main.h @@ -69,7 +69,7 @@ void SpriteCb_PlayerMonFromBall(struct Sprite *sprite); void sub_8039E60(struct Sprite *sprite); void SpriteCB_TrainerThrowObject(struct Sprite *sprite); void sub_8039E9C(struct Sprite *sprite); -void nullsub_20(void); +void BeginBattleIntroDummy(void); void BeginBattleIntro(void); void SwitchInClearSetData(void); void FaintClearSetData(void); diff --git a/include/battle_scripts.h b/include/battle_scripts.h index 706d41097..cf39de3c4 100644 --- a/include/battle_scripts.h +++ b/include/battle_scripts.h @@ -207,7 +207,7 @@ extern const u8 BattleScript_ActionSelectionItemsCantBeUsed[]; extern const u8 BattleScript_ArenaTurnBeginning[]; extern const u8 BattleScript_PalacePrintFlavorText[]; extern const u8 BattleScript_ArenaDoJudgment[]; -extern const u8 BattleScript_82DAA0B[]; +extern const u8 BattleScript_FrontierLinkBattleLost[]; extern const u8 BattleScript_AskIfWantsToForfeitMatch[]; extern const u8 BattleScript_PrintPlayerForfeited[]; extern const u8 BattleScript_PrintPlayerForfeitedLinkBattle[]; diff --git a/include/battle_util.h b/include/battle_util.h index 81443f463..e4ef99e0b 100644 --- a/include/battle_util.h +++ b/include/battle_util.h @@ -60,7 +60,7 @@ void PressurePPLoseOnUsingPerishSong(u8 attacker); void PressurePPLoseOnUsingImprison(u8 attacker); void MarkAllBattlersForControllerExec(void); // unused void MarkBattlerForControllerExec(u8 battlerId); -void sub_803F850(u8 arg0); +void MarkBattlerReceivedLinkData(u8 arg0); void CancelMultiTurnMoves(u8 battlerId); bool8 WasUnableToUseMove(u8 battlerId); void PrepareStringBattle(u16 stringId, u8 battlerId); diff --git a/include/recorded_battle.h b/include/recorded_battle.h index 55353a6d1..ba223c6fc 100644 --- a/include/recorded_battle.h +++ b/include/recorded_battle.h @@ -5,13 +5,15 @@ extern u32 gRecordedBattleRngSeed; extern u32 gBattlePalaceMoveSelectionRngValue; extern u8 gRecordedBattleMultiplayerId; -void sub_8184DA4(u8 arg0); +#define B_RECORD_MODE_RECORDING 1 +#define B_RECORD_MODE_PLAYBACK 2 + +void RecordedBattle_Init(u8 arg0); void sub_8184E58(void); void RecordedBattle_SetBattlerAction(u8 battlerId, u8 action); void RecordedBattle_ClearBattlerAction(u8 battlerId, u8 bytesToClear); u8 RecordedBattle_GetBattlerAction(u8 battlerId); -u8 sub_81850D0(void); -u8 sub_81850DC(u8 *arg0); +u8 RecordedBattle_GetAllNewBattlerData(u8 *dst); void sub_81851A8(u8 *arg0); bool32 CanCopyRecordedBattleSaveData(void); bool32 MoveRecordedBattleToSaveData(void); -- cgit v1.2.3 From 63a78287725167a9c048b2eac5e92b4da4b339d1 Mon Sep 17 00:00:00 2001 From: GriffinR Date: Fri, 22 Jan 2021 20:03:21 -0500 Subject: Document battle_controller_player.c --- include/battle.h | 18 +++++++++--------- include/battle_controllers.h | 6 +++--- include/battle_gfx_sfx_util.h | 13 ++++++------- include/battle_main.h | 4 ++-- include/pokeball.h | 2 +- include/recorded_battle.h | 4 ++-- include/reshow_battle_screen.h | 2 +- 7 files changed, 24 insertions(+), 25 deletions(-) (limited to 'include') diff --git a/include/battle.h b/include/battle.h index 547ac6b51..ead6efe91 100644 --- a/include/battle.h +++ b/include/battle.h @@ -385,7 +385,7 @@ struct BattleStruct u8 chosenMovePositions[MAX_BATTLERS_COUNT]; u8 stateIdAfterSelScript[MAX_BATTLERS_COUNT]; u8 unused_3[3]; - u8 field_8B; // related to player's pokemon switching + u8 prevSelectedPartySlot; u8 unused_4[2]; u8 stringMoveType; u8 expGetterBattlerId; @@ -523,7 +523,7 @@ struct BattleAnimationInfo u8 field_6; u8 field_7; u8 ballThrowCaseId; - u8 field_9_x1:1; + u8 introAnimActive:1; u8 wildMonInvisible:1; u8 field_9_x1C:3; u8 field_9_x20:1; @@ -548,17 +548,17 @@ struct BattleHealthboxInfo u8 triedShinyMonAnim:1; u8 finishedShinyMonAnim:1; u8 field_1_x1E:4; - u8 field_1_x20:1; - u8 field_1_x40:1; - u8 field_1_x80:1; + u8 bgmRestored:1; + u8 waitForCry:1; + u8 healthboxSlideInStarted:1; u8 healthboxBounceSpriteId; u8 battlerBounceSpriteId; u8 animationState; - u8 field_5; + u8 partyStatusDelayTimer; u8 matrixNum; u8 shadowSpriteId; - u8 field_8; - u8 field_9; + u8 soundTimer; + u8 introEndDelay; u8 field_A; u8 field_B; }; @@ -714,6 +714,6 @@ extern void (*gBattlerControllerFuncs[MAX_BATTLERS_COUNT])(void); extern u8 gHealthboxSpriteIds[MAX_BATTLERS_COUNT]; extern u8 gMultiUsePlayerCursor; extern u8 gNumberOfMovesToChoose; -extern u8 gUnknown_03005D7C[MAX_BATTLERS_COUNT]; +extern u8 gBattleControllerData[MAX_BATTLERS_COUNT]; #endif // GUARD_BATTLE_H diff --git a/include/battle_controllers.h b/include/battle_controllers.h index 682212ccc..da76ab0c6 100644 --- a/include/battle_controllers.h +++ b/include/battle_controllers.h @@ -246,11 +246,11 @@ void BtlController_EmitEndLinkBattle(u8 bufferId, u8 battleOutcome); void SetControllerToPlayer(void); void BattleControllerDummy(void); void PlayerHandleGetRawMonData(void); -void sub_80587B0(void); -void sub_805CC00(struct Sprite *sprite); +void SetBattleEndCallbacks(void); +void SpriteCB_FreePlayerSpriteLoadMonSprite(struct Sprite *sprite); void CB2_SetUpReshowBattleScreenAfterMenu(void); void CB2_SetUpReshowBattleScreenAfterMenu2(void); -void c3_0802FDF4(u8 taskId); +void Task_PlayerController_RestoreBgmAfterCry(u8 taskId); void ActionSelectionCreateCursorAt(u8 cursorPos, u8 unused); void ActionSelectionDestroyCursorAt(u8 cursorPos); void InitMoveSelectionsVarsAndStrings(void); diff --git a/include/battle_gfx_sfx_util.h b/include/battle_gfx_sfx_util.h index 16253e760..0a14e72c4 100644 --- a/include/battle_gfx_sfx_util.h +++ b/include/battle_gfx_sfx_util.h @@ -4,21 +4,20 @@ void AllocateBattleSpritesData(void); void FreeBattleSpritesData(void); u16 ChooseMoveAndTargetInBattlePalace(void); -void sub_805D714(struct Sprite *sprite); +void SpriteCB_WaitForBattlerBallReleaseAnim(struct Sprite *sprite); void sub_805D770(struct Sprite *sprite, bool8 arg1); -void sub_805D7AC(struct Sprite *sprite); +void SpriteCB_TrainerSlideIn(struct Sprite *sprite); void InitAndLaunchChosenStatusAnimation(bool8 isStatus2, u32 status); bool8 TryHandleLaunchBattleTableAnimation(u8 activeBattlerId, u8 attacker, u8 target, u8 tableId, u16 argument); void InitAndLaunchSpecialAnimation(u8 activeBattlerId, u8 attacker, u8 target, u8 tableId); bool8 IsMoveWithoutAnimation(u16 moveId, u8 animationTurn); -bool8 mplay_80342A4(u8 battlerId); +bool8 IsBattleSEPlaying(u8 battlerId); void BattleLoadOpponentMonSpriteGfx(struct Pokemon *mon, u8 battlerId); void BattleLoadPlayerMonSpriteGfx(struct Pokemon *mon, u8 battlerId); -void nullsub_23(void); -void nullsub_24(u16 species); +void BattleGfxSfxDummy2(u16 species); void DecompressTrainerFrontPic(u16 frontPicId, u8 battlerId); void DecompressTrainerBackPic(u16 backPicId, u8 battlerId); -void nullsub_25(u8 arg0); +void BattleGfxSfxDummy3(u8 gender); void FreeTrainerFrontPicPalette(u16 frontPicId); void sub_805DFFC(void); bool8 BattleLoadAllHealthBoxesGfx(u8 state); @@ -36,7 +35,7 @@ void HandleLowHpMusicChange(struct Pokemon *mon, u8 battlerId); void BattleStopLowHpSound(void); u8 GetMonHPBarLevel(struct Pokemon *mon); void HandleBattleLowHpMusicChange(void); -void sub_805EB9C(u8 affineMode); +void SetBattlerSpriteAffineMode(u8 affineMode); void LoadAndCreateEnemyShadowSprites(void); void SpriteCB_SetInvisible(struct Sprite *sprite); void SetBattlerShadowSpriteCallback(u8 battlerId, u16 species); diff --git a/include/battle_main.h b/include/battle_main.h index 250839202..1060c4660 100644 --- a/include/battle_main.h +++ b/include/battle_main.h @@ -51,7 +51,7 @@ void sub_8038A04(void); // unused void VBlankCB_Battle(void); void nullsub_17(struct Sprite *sprite); void sub_8038B74(struct Sprite *sprite); -void sub_8038D64(void); +void CB2_InitEndLinkBattle(void); u32 sub_80391E0(u8 arrayId, u8 caseId); u32 sub_80397C4(u32 setId, u32 tableId); void SpriteCb_WildMon(struct Sprite *sprite); @@ -62,7 +62,7 @@ void SpriteCb_HideAsMoveTarget(struct Sprite *sprite); void SpriteCb_OpponentMonFromBall(struct Sprite *sprite); void sub_8039BB4(struct Sprite *sprite); void sub_80105DC(struct Sprite *sprite); -void sub_8039C00(struct Sprite *sprite); +void SpriteCB_FaintSlideAnim(struct Sprite *sprite); void DoBounceEffect(u8 battlerId, u8 b, s8 c, s8 d); void EndBounceEffect(u8 battlerId, bool8 b); void SpriteCb_PlayerMonFromBall(struct Sprite *sprite); diff --git a/include/pokeball.h b/include/pokeball.h index 1cdb08f94..8ea675ce4 100644 --- a/include/pokeball.h +++ b/include/pokeball.h @@ -34,7 +34,7 @@ extern const struct SpriteTemplate gBallSpriteTemplates[]; u8 DoPokeballSendOutAnimation(s16 pan, u8 kindOfThrow); void CreatePokeballSpriteToReleaseMon(u8 monSpriteId, u8 battler, u8 x, u8 y, u8 oamPriority, u8 subpriortiy, u8 g, u32 h, u16 species); u8 CreateTradePokeballSprite(u8 a, u8 b, u8 x, u8 y, u8 oamPriority, u8 subPriority, u8 g, u32 h); -void sub_8076918(u8 battler); +void StartHealthboxSlideIn(u8 battler); void DoHitAnimHealthboxEffect(u8 battler); void LoadBallGfx(u8 ballId); void FreeBallGfx(u8 ballId); diff --git a/include/recorded_battle.h b/include/recorded_battle.h index ba223c6fc..3a6a8129a 100644 --- a/include/recorded_battle.h +++ b/include/recorded_battle.h @@ -13,8 +13,8 @@ void sub_8184E58(void); void RecordedBattle_SetBattlerAction(u8 battlerId, u8 action); void RecordedBattle_ClearBattlerAction(u8 battlerId, u8 bytesToClear); u8 RecordedBattle_GetBattlerAction(u8 battlerId); -u8 RecordedBattle_GetAllNewBattlerData(u8 *dst); -void sub_81851A8(u8 *arg0); +u8 RecordedBattle_BufferNewBattlerData(u8 *dst); +void RecordedBattle_RecordAllBattlerData(u8 *data); bool32 CanCopyRecordedBattleSaveData(void); bool32 MoveRecordedBattleToSaveData(void); void PlayRecordedBattle(void (*CB2_After)(void)); diff --git a/include/reshow_battle_screen.h b/include/reshow_battle_screen.h index c22135280..174fb4157 100644 --- a/include/reshow_battle_screen.h +++ b/include/reshow_battle_screen.h @@ -1,7 +1,7 @@ #ifndef GUARD_RESHOW_BATTLE_SCREEN_H #define GUARD_RESHOW_BATTLE_SCREEN_H -void nullsub_35(void); +void ReshowBattleScreenDummy(void); void ReshowBattleScreenAfterMenu(void); #endif // GUARD_RESHOW_BATTLE_SCREEN_H -- cgit v1.2.3 From c106f7f130e013231cdb54a47e61f3b45cc4cd80 Mon Sep 17 00:00:00 2001 From: GriffinR Date: Fri, 22 Jan 2021 21:35:16 -0500 Subject: Document battle_controller_opponent.c --- include/battle.h | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'include') diff --git a/include/battle.h b/include/battle.h index ead6efe91..5070ab3d6 100644 --- a/include/battle.h +++ b/include/battle.h @@ -700,8 +700,8 @@ extern u32 gTransformedPersonalities[MAX_BATTLERS_COUNT]; extern u8 gPlayerDpadHoldFrames; extern struct BattleSpriteData *gBattleSpritesDataPtr; extern struct MonSpritesGfx *gMonSpritesGfxPtr; -extern struct BattleHealthboxInfo *gUnknown_020244D8; -extern struct BattleHealthboxInfo *gUnknown_020244DC; +extern struct BattleHealthboxInfo *gBattleControllerOpponentHealthboxData; +extern struct BattleHealthboxInfo *gBattleControllerOpponentFlankHealthboxData; extern u16 gBattleMovePower; extern u16 gMoveToLearn; extern u8 gBattleMonForms[MAX_BATTLERS_COUNT]; -- cgit v1.2.3 From a392cca92811c27524f1d10cd69d2fc96ea69b74 Mon Sep 17 00:00:00 2001 From: GriffinR Date: Fri, 22 Jan 2021 23:22:37 -0500 Subject: Misc battle documentation --- include/battle.h | 4 ++-- include/battle_anim.h | 2 +- include/battle_gfx_sfx_util.h | 1 - include/battle_main.h | 15 +++++++-------- include/data.h | 16 ++++++++-------- include/pokemon.h | 4 ++-- 6 files changed, 20 insertions(+), 22 deletions(-) (limited to 'include') diff --git a/include/battle.h b/include/battle.h index 5070ab3d6..c0baaf313 100644 --- a/include/battle.h +++ b/include/battle.h @@ -421,8 +421,8 @@ struct BattleStruct u16 castformPalette[MAX_BATTLERS_COUNT][16]; u8 field_180; // weird field, used in battle_main.c, once accessed as an array of u32 overwriting the field below u8 field_181; - u8 field_182; - u8 field_183; + u8 vsScreenHealthFlagsLo; + u8 vsScreenHealthFlagsHi; // Last bit is 'has frontier pass' struct BattleEnigmaBerry battleEnigmaBerry; u8 wishPerishSongState; u8 wishPerishSongBattlerId; diff --git a/include/battle_anim.h b/include/battle_anim.h index 096d533e2..65ff449d4 100644 --- a/include/battle_anim.h +++ b/include/battle_anim.h @@ -148,7 +148,7 @@ void PrepareAffineAnimInTaskData(struct Task *task, u8 spriteId, const union Aff bool8 RunAffineAnimFromTaskData(struct Task *task); void AnimThrowProjectile(struct Sprite *sprite); void sub_80A6BFC(struct BattleAnimBgData *unk, u8 unused); -u8 sub_80A8394(u16 species, bool8 isBackpic, u8 a3, s16 x, s16 y, u8 subpriority, u32 personality, u32 trainerId, u32 battlerId, u32 a10); +u8 CreateAdditionalMonSpriteForMoveAnim(u16 species, bool8 isBackpic, u8 a3, s16 x, s16 y, u8 subpriority, u32 personality, u32 trainerId, u32 battlerId, bool32 ignoreDeoxysForm); void sub_80A749C(struct Sprite *sprite); void TradeMenuBouncePartySprites(struct Sprite *sprite); void DestroyAnimVisualTaskAndDisableBlend(u8 taskId); diff --git a/include/battle_gfx_sfx_util.h b/include/battle_gfx_sfx_util.h index 0a14e72c4..e3f549aa9 100644 --- a/include/battle_gfx_sfx_util.h +++ b/include/battle_gfx_sfx_util.h @@ -5,7 +5,6 @@ void AllocateBattleSpritesData(void); void FreeBattleSpritesData(void); u16 ChooseMoveAndTargetInBattlePalace(void); void SpriteCB_WaitForBattlerBallReleaseAnim(struct Sprite *sprite); -void sub_805D770(struct Sprite *sprite, bool8 arg1); void SpriteCB_TrainerSlideIn(struct Sprite *sprite); void InitAndLaunchChosenStatusAnimation(bool8 isStatus2, u32 status); bool8 TryHandleLaunchBattleTableAnimation(u8 activeBattlerId, u8 attacker, u8 target, u8 tableId, u16 argument); diff --git a/include/battle_main.h b/include/battle_main.h index 1060c4660..78cf353df 100644 --- a/include/battle_main.h +++ b/include/battle_main.h @@ -49,19 +49,18 @@ void CB2_QuitRecordedBattle(void); void sub_8038528(struct Sprite* sprite); void sub_8038A04(void); // unused void VBlankCB_Battle(void); -void nullsub_17(struct Sprite *sprite); -void sub_8038B74(struct Sprite *sprite); +void SpriteCB_VsLetterDummy(struct Sprite *sprite); +void SpriteCB_VsLetterInit(struct Sprite *sprite); void CB2_InitEndLinkBattle(void); -u32 sub_80391E0(u8 arrayId, u8 caseId); -u32 sub_80397C4(u32 setId, u32 tableId); +u32 GetBattleBgTemplateData(u8 arrayId, u8 caseId); +u32 GetBattleWindowTemplatePixelWidth(u32 setId, u32 tableId); void SpriteCb_WildMon(struct Sprite *sprite); void SpriteCallbackDummy_2(struct Sprite *sprite); void SpriteCB_FaintOpponentMon(struct Sprite *sprite); void SpriteCb_ShowAsMoveTarget(struct Sprite *sprite); void SpriteCb_HideAsMoveTarget(struct Sprite *sprite); void SpriteCb_OpponentMonFromBall(struct Sprite *sprite); -void sub_8039BB4(struct Sprite *sprite); -void sub_80105DC(struct Sprite *sprite); +void SpriteCB_BattleSpriteStartSlideLeft(struct Sprite *sprite); void SpriteCB_FaintSlideAnim(struct Sprite *sprite); void DoBounceEffect(u8 battlerId, u8 b, s8 c, s8 d); void EndBounceEffect(u8 battlerId, bool8 b); @@ -86,8 +85,8 @@ void SpecialStatusesClear(void); extern struct UnknownPokemonStruct4 gMultiPartnerParty[MULTI_PARTY_SIZE]; extern const struct SpriteTemplate gUnknown_0831AC88; -extern const struct OamData gOamData_831ACA8; -extern const struct OamData gOamData_831ACB0; +extern const struct OamData gOamData_BattleSpriteOpponentSide; +extern const struct OamData gOamData_BattleSpritePlayerSide; extern const u8 gTypeEffectiveness[336]; extern const u8 gTypeNames[NUMBER_OF_MON_TYPES][TYPE_NAME_LENGTH + 1]; extern const struct TrainerMoney gTrainerMoneyTable[]; diff --git a/include/data.h b/include/data.h index 260c18152..2f8c44746 100644 --- a/include/data.h +++ b/include/data.h @@ -69,13 +69,13 @@ struct Trainer #define TRAINER_ENCOUNTER_MUSIC(trainer)((gTrainers[trainer].encounterMusic_gender & 0x7F)) -extern const u16 gUnknown_082FF1D8[]; -extern const u32 gUnknown_082FF1F8[]; +extern const u16 gMinigameDigits_Pal[]; +extern const u32 gMinigameDigits_Gfx[]; -extern const struct SpriteFrameImage gUnknown_082FF3A8[]; -extern const struct SpriteFrameImage gUnknown_082FF3C8[]; -extern const struct SpriteFrameImage gUnknown_082FF3E8[]; -extern const struct SpriteFrameImage gUnknown_082FF408[]; +extern const struct SpriteFrameImage gBattlerPicTable_PlayerLeft[]; +extern const struct SpriteFrameImage gBattlerPicTable_OpponentLeft[]; +extern const struct SpriteFrameImage gBattlerPicTable_PlayerRight[]; +extern const struct SpriteFrameImage gBattlerPicTable_OpponentRight[]; extern const struct SpriteFrameImage gTrainerBackPicTable_Brendan[]; extern const struct SpriteFrameImage gTrainerBackPicTable_May[]; extern const struct SpriteFrameImage gTrainerBackPicTable_Red[]; @@ -85,8 +85,8 @@ extern const struct SpriteFrameImage gTrainerBackPicTable_RubySapphireMay[]; extern const struct SpriteFrameImage gTrainerBackPicTable_Wally[]; extern const struct SpriteFrameImage gTrainerBackPicTable_Steven[]; -extern const union AffineAnimCmd *const gUnknown_082FF618[]; -extern const union AffineAnimCmd *const gUnknown_082FF694[]; +extern const union AffineAnimCmd *const gAffineAnims_BattleSpritePlayerSide[]; +extern const union AffineAnimCmd *const gAffineAnims_BattleSpriteOpponentSide[]; extern const union AffineAnimCmd *const gUnknown_082FF6C0[]; extern const union AnimCmd *const gUnknown_082FF70C[]; diff --git a/include/pokemon.h b/include/pokemon.h index 0ff635a3f..654af3031 100644 --- a/include/pokemon.h +++ b/include/pokemon.h @@ -266,7 +266,7 @@ extern const u8 gPPUpSetMask[]; extern const u8 gPPUpAddMask[]; extern const u8 gStatStageRatios[MAX_STAT_STAGE + 1][2]; extern const u16 gLinkPlayerFacilityClasses[]; -extern const struct SpriteTemplate gUnknown_08329D98[]; +extern const struct SpriteTemplate gBattlerSpriteTemplates[]; extern const s8 gNatureStatTable[][5]; void ZeroBoxMonData(struct BoxPokemon *boxMon); @@ -287,7 +287,7 @@ void CreateApprenticeMon(struct Pokemon *mon, const struct Apprentice *src, u8 m void CreateMonWithEVSpreadNatureOTID(struct Pokemon *mon, u16 species, u8 level, u8 nature, u8 fixedIV, u8 evSpread, u32 otId); void ConvertPokemonToBattleTowerPokemon(struct Pokemon *mon, struct BattleTowerPokemon *dest); void CreateObedientMon(struct Pokemon *mon, u16 species, u8 level, u8 fixedIV, u8 hasFixedPersonality, u32 fixedPersonality, u8 otIdType, u32 fixedOtId); -bool8 sub_80688F8(u8 caseId, u8 battlerId); +bool8 ShouldIgnoreDeoxysForm(u8 caseId, u8 battlerId); void SetDeoxysStats(void); u16 GetUnionRoomTrainerPic(void); u16 GetUnionRoomTrainerClass(void); -- cgit v1.2.3 From 3fd5e143a986334985c2c786c324663dbba2db9b Mon Sep 17 00:00:00 2001 From: GriffinR Date: Sat, 23 Jan 2021 00:40:46 -0500 Subject: Misc battle anim documentation --- include/battle_anim.h | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) (limited to 'include') diff --git a/include/battle_anim.h b/include/battle_anim.h index 65ff449d4..046ddb08c 100644 --- a/include/battle_anim.h +++ b/include/battle_anim.h @@ -90,7 +90,7 @@ void InitAnimArcTranslation(struct Sprite *sprite); bool8 AnimTranslateLinear(struct Sprite *sprite); void TranslateAnimSpriteToTargetMonLocation(struct Sprite *sprite); u8 GetBattlerSpriteCoord2(u8 battlerId, u8 attributeId); -void sub_80A6FD4(struct Sprite *sprite); +void InitAnimLinearTranslationWithSpeed(struct Sprite *sprite); u16 ArcTan2Neg(s16 a, s16 b); void TrySetSpriteRotScale(struct Sprite *sprite, bool8 a2, s16 xScale, s16 yScale, u16 rotation); void RunStoredCallbackWhenAffineAnimEnds(struct Sprite *sprite); @@ -103,7 +103,7 @@ u8 GetBattlerYCoordWithElevation(u8 battlerId); void WaitAnimForDuration(struct Sprite *sprite); void AnimTravelDiagonally(struct Sprite *sprite); void InitAnimLinearTranslation(struct Sprite *sprite); -void sub_80A6F98(struct Sprite *sprite); +void AnimTranslateLinear_WaitEnd(struct Sprite *sprite); u8 GetBattlerSpriteBGPriority(u8 battlerId); void *LoadPointerFromVars(s16 bottom, s16 top); void StorePointerInVars(s16 *bottom, s16 *top, const void *ptr); @@ -121,7 +121,7 @@ void PrepareBattlerSpriteForRotScale(u8 spriteId, u8 objMode); void SetBattlerSpriteYOffsetFromRotation(u8 spriteId); u32 sub_80A75AC(u8 a1, u8 a2, u8 a3, u8 a4, u8 a5, u8 a6, u8 a7); u32 sub_80A76C4(u8 a1, u8 a2, u8 a3, u8 a4); -u8 sub_80A77AC(u8 a1); +u8 AnimDummyReturnArg(u8 battler); s16 CloneBattlerSpriteWithBlend(u8); void obj_delete_but_dont_free_vram(struct Sprite*); u8 sub_80A89C8(int, u8, int); @@ -141,7 +141,7 @@ void InitAndRunAnimFastLinearTranslation(struct Sprite *sprite); void TranslateMonSpriteLinear(struct Sprite *sprite); void TranslateSpriteLinear(struct Sprite *sprite); void AnimSpriteOnMonPos(struct Sprite *sprite); -void sub_80A7000(struct Sprite *sprite); +void InitAnimLinearTranslationWithSpeedAndPos(struct Sprite *sprite); void TranslateSpriteInCircleOverDuration(struct Sprite *sprite); void SetGreyscaleOrOriginalPalette(u16 palNum, bool8 restoreOriginal); void PrepareAffineAnimInTaskData(struct Task *task, u8 spriteId, const union AffineAnimCmd *affineAnimCmds); @@ -158,7 +158,7 @@ u8 GetBattlerSide(u8 battler); u8 GetBattlerPosition(u8 battler); u8 GetBattlerAtPosition(u8 position); void sub_80A64EC(struct Sprite *sprite); -void sub_80A718C(struct Sprite *sprite); +void InitAnimFastLinearTranslationWithSpeedAndPos(struct Sprite *sprite); enum { -- cgit v1.2.3 From 0064333e4aa1bacb42f840ba67d38a9aced8816e Mon Sep 17 00:00:00 2001 From: GriffinR Date: Tue, 26 Jan 2021 02:16:26 -0500 Subject: Clean up scrcmd.c --- include/constants/weather.h | 5 +++-- include/event_object_movement.h | 6 +++--- 2 files changed, 6 insertions(+), 5 deletions(-) (limited to 'include') diff --git a/include/constants/weather.h b/include/constants/weather.h index aa0309882..becbdda87 100644 --- a/include/constants/weather.h +++ b/include/constants/weather.h @@ -39,8 +39,6 @@ // These are the "abnormal weather events" that are used // to find Kyogre and Groudon. -#define ABNORMAL_WEATHER_LOCATIONS (MARINE_CAVE_LOCATIONS + TERRA_CAVE_LOCATIONS) -#define ABNORMAL_WEATHER_NONE 0 // Groudon/Terra Cave locations #define TERRA_CAVE_LOCATIONS_START 1 @@ -66,4 +64,7 @@ #define ABNORMAL_WEATHER_ROUTE_129_EAST (MARINE_CAVE_LOCATIONS_START + 7) #define MARINE_CAVE_LOCATIONS 8 +#define ABNORMAL_WEATHER_LOCATIONS (MARINE_CAVE_LOCATIONS + TERRA_CAVE_LOCATIONS) +#define ABNORMAL_WEATHER_NONE 0 + #endif // GUARD_CONSTANTS_WEATHER_H diff --git a/include/event_object_movement.h b/include/event_object_movement.h index cd76cac11..5b008ead6 100644 --- a/include/event_object_movement.h +++ b/include/event_object_movement.h @@ -106,11 +106,11 @@ void ObjectEventSetGraphicsId(struct ObjectEvent *, u8 graphicsId); void ObjectEventTurn(struct ObjectEvent *, u8); void ObjectEventTurnByLocalIdAndMap(u8, u8, u8, u8); const struct ObjectEventGraphicsInfo *GetObjectEventGraphicsInfo(u8 graphicsId); -void npc_by_local_id_and_map_set_field_1_bit_x20(u8, u8, u8, u8); +void SetObjectInvisibility(u8, u8, u8, bool8); void FreeAndReserveObjectSpritePalettes(void); void SetObjectEventSpritePosByLocalIdAndMap(u8 localId, u8 mapNum, u8 mapGroup, s16 x, s16 y); -void sub_808E7E4(u8, u8, u8); -void sub_808E78C(u8, u8, u8, u8); +void ResetObjectPriority(u8, u8, u8); +void SetObjectPriority(u8, u8, u8, u8); void sub_808E75C(s16, s16); void ObjectEventGetLocalIdAndMap(struct ObjectEvent *objectEvent, void *localId, void *mapNum, void *mapGroup); void ShiftObjectEventCoords(struct ObjectEvent *, s16, s16); -- cgit v1.2.3 From 9e5958122011a2d5092db57f07f14fd511fb6f42 Mon Sep 17 00:00:00 2001 From: GriffinR Date: Tue, 26 Jan 2021 04:41:13 -0500 Subject: Document object lock and some trainer approach --- include/battle_setup.h | 4 ++-- include/bike.h | 2 +- include/event_object_lock.h | 8 ++++---- include/event_object_movement.h | 2 +- include/event_scripts.h | 2 +- include/field_player_avatar.h | 2 +- include/trainer_see.h | 4 ++-- 7 files changed, 12 insertions(+), 12 deletions(-) (limited to 'include') diff --git a/include/battle_setup.h b/include/battle_setup.h index 7fa0457a8..8f78bba3c 100644 --- a/include/battle_setup.h +++ b/include/battle_setup.h @@ -37,7 +37,7 @@ void ConfigureAndSetUpOneTrainerBattle(u8 trainerObjEventId, const u8 *trainerSc void ConfigureTwoTrainersBattle(u8 trainerObjEventId, const u8 *trainerScript); void SetUpTwoTrainersBattle(void); bool32 GetTrainerFlagFromScriptPointer(const u8 *data); -void SetUpTrainerMovement(void); +void SetTrainerFacingDirection(void); u8 GetTrainerBattleMode(void); bool8 GetTrainerFlag(void); bool8 HasTrainerBeenFought(u16 trainerId); @@ -49,7 +49,7 @@ void ShowTrainerIntroSpeech(void); const u8 *BattleSetup_GetScriptAddrAfterBattle(void); const u8 *BattleSetup_GetTrainerPostBattleScript(void); void ShowTrainerCantBattleSpeech(void); -void SetUpTrainerEncounterMusic(void); +void PlayTrainerEncounterMusic(void); const u8 *GetTrainerALoseText(void); const u8 *GetTrainerBLoseText(void); const u8 *GetTrainerWonSpeech(void); diff --git a/include/bike.h b/include/bike.h index 46b668169..893b0b19e 100644 --- a/include/bike.h +++ b/include/bike.h @@ -71,7 +71,7 @@ void MovePlayerOnBike(u8 direction, u16 newKeys, u16 heldKeys); void Bike_TryAcroBikeHistoryUpdate(u16 newKeys, u16 heldKeys); bool8 RS_IsRunningDisallowed(u8 tile); bool8 IsBikingDisallowedByPlayer(void); -bool8 player_should_look_direction_be_enforced_upon_movement(void); +bool8 IsPlayerNotUsingAcroBikeOnBumpySlope(void); void GetOnOffBike(u8 transitionFlags); void BikeClearState(int newDirHistory, int newAbStartHistory); void Bike_UpdateBikeCounterSpeed(u8 counter); diff --git a/include/event_object_lock.h b/include/event_object_lock.h index 0226eb632..9d31a25fd 100644 --- a/include/event_object_lock.h +++ b/include/event_object_lock.h @@ -1,12 +1,12 @@ #ifndef GUARD_EVENT_OBJECT_LOCK_H #define GUARD_EVENT_OBJECT_LOCK_H -bool8 sub_80983C4(void); +bool8 IsFreezePlayerFinished(void); void ScriptFreezeObjectEvents(void); -bool8 sub_809847C(void); +bool8 IsFreezeSelectedObjectAndPlayerFinished(void); void LockSelectedObjectEvent(void); -void sub_8098630(void); -bool8 sub_8098734(void); +void FreezeForApproachingTrainers(void); +bool8 IsFreezeObjectAndPlayerFinished(void); void ScriptUnfreezeObjectEvents(void); void UnionRoom_UnlockPlayerAndChatPartner(void); diff --git a/include/event_object_movement.h b/include/event_object_movement.h index 5b008ead6..ba2b5e5f6 100644 --- a/include/event_object_movement.h +++ b/include/event_object_movement.h @@ -189,7 +189,7 @@ void DestroyExtraMovementTask(u8); void UnfreezeObjectEvents(void); void FreezeObjectEventsExceptOne(u8 objectEventId); void TurnObjectEventSprite(u8, u8); -void sub_8098074(u8 var1, u8 var2); +void FreezeObjectEventsExceptTwo(u8 objectEventId1, u8 objectEventId2); void FreezeObjectEvents(void); bool8 FreezeObjectEvent(struct ObjectEvent *objectEvent); u8 GetMoveDirectionFastAnimNum(u8); diff --git a/include/event_scripts.h b/include/event_scripts.h index 851559724..199686655 100644 --- a/include/event_scripts.h +++ b/include/event_scripts.h @@ -3,7 +3,7 @@ extern const u8 EventScript_TestSignpostMsg[]; extern const u8 EventScript_TryGetTrainerScript[]; -extern const u8 EventScript_271354[]; +extern const u8 EventScript_StartTrainerApproach[]; extern const u8 EventScript_DoNoIntroTrainerBattle[]; extern const u8 EventScript_TryDoDoubleTrainerBattle[]; extern const u8 EventScript_TryDoNormalTrainerBattle[]; diff --git a/include/field_player_avatar.h b/include/field_player_avatar.h index aa1a2e0dc..c30ce0b6f 100644 --- a/include/field_player_avatar.h +++ b/include/field_player_avatar.h @@ -34,7 +34,7 @@ u8 PlayerGetZCoord(void); void SetPlayerAvatarTransitionFlags(u16 a); void sub_808BCE8(void); void InitPlayerAvatar(s16 a, s16 b, u8 c, u8 d); -void sub_808B864(void); +void PlayerFreeze(void); void sub_808BCF4(void); void SetSpinStartFacingDir(u8); void GetXYCoordsOneStepInFrontOfPlayer(s16 *xPtr, s16 *yPtr); diff --git a/include/trainer_see.h b/include/trainer_see.h index 9d88e05fa..7a20671ea 100644 --- a/include/trainer_see.h +++ b/include/trainer_see.h @@ -17,8 +17,8 @@ extern bool8 gTrainerApproachedPlayer; extern u8 gApproachingTrainerId; bool8 CheckForTrainersWantingBattle(void); -void sub_80B4578(struct ObjectEvent *var); -void EndTrainerApproach(void); +void SetHiddenTrainerMovement(struct ObjectEvent *var); +void DoTrainerApproach(void); void TryPrepareSecondApproachingTrainer(void); u8 FldEff_ExclamationMarkIcon(void); u8 FldEff_QuestionMarkIcon(void); -- cgit v1.2.3 From 92bd6400b7ded57bde9a41206d10a5dcbd9f6383 Mon Sep 17 00:00:00 2001 From: GriffinR Date: Tue, 26 Jan 2021 05:16:01 -0500 Subject: Fix up berry sparkle --- include/berry.h | 4 +++- include/event_object_movement.h | 12 ++++++------ include/global.berry.h | 2 +- 3 files changed, 10 insertions(+), 8 deletions(-) (limited to 'include') diff --git a/include/berry.h b/include/berry.h index afd1bc499..3412caae5 100644 --- a/include/berry.h +++ b/include/berry.h @@ -1,6 +1,8 @@ #ifndef GUARD_BERRY_H #define GUARD_BERRY_H +#include "constants/berry.h" + void ClearEnigmaBerries(void); void SetEnigmaBerry(u8 *src); bool32 IsEnigmaBerryValid(void); @@ -24,7 +26,7 @@ void ObjectEventInteractionPlantBerryTree(void); void ObjectEventInteractionPickBerryTree(void); void ObjectEventInteractionRemoveBerryTree(void); bool8 PlayerHasBerries(void); -void ResetBerryTreeSparkleFlags(void); +void SetBerryTreesSeen(void); extern const struct Berry gBerries[]; diff --git a/include/event_object_movement.h b/include/event_object_movement.h index ba2b5e5f6..247db9efc 100644 --- a/include/event_object_movement.h +++ b/include/event_object_movement.h @@ -203,7 +203,7 @@ s16 GetFigure8XOffset(s16 idx); s16 GetFigure8YOffset(s16 idx); void CameraObjectReset2(void); u8 GetObjectEventBerryTreeId(u8 objectEventId); -void sub_8092EF0(u8 mapId, u8 mapNumber, u8 mapGroup); +void SetBerryTreeJustPicked(u8 mapId, u8 mapNumber, u8 mapGroup); bool8 IsBerryTreeSparkling(u8, u8, u8); void MovementType_None(struct Sprite *); @@ -307,11 +307,11 @@ u8 MovementType_WanderLeftAndRight_Step6(struct ObjectEvent *, struct Sprite *); u8 MovementType_FaceDirection_Step0(struct ObjectEvent *, struct Sprite *); u8 MovementType_FaceDirection_Step1(struct ObjectEvent *, struct Sprite *); u8 MovementType_FaceDirection_Step2(struct ObjectEvent *, struct Sprite *); -u8 MovementType_BerryTreeGrowth_Step0(struct ObjectEvent *, struct Sprite *); -u8 MovementType_BerryTreeGrowth_Step1(struct ObjectEvent *, struct Sprite *); -u8 MovementType_BerryTreeGrowth_Step2(struct ObjectEvent *, struct Sprite *); -u8 MovementType_BerryTreeGrowth_Step3(struct ObjectEvent *, struct Sprite *); -u8 MovementType_BerryTreeGrowth_Step4(struct ObjectEvent *, struct Sprite *); +u8 MovementType_BerryTreeGrowth_Normal(struct ObjectEvent *, struct Sprite *); +u8 MovementType_BerryTreeGrowth_Move(struct ObjectEvent *, struct Sprite *); +u8 MovementType_BerryTreeGrowth_SparkleStart(struct ObjectEvent *, struct Sprite *); +u8 MovementType_BerryTreeGrowth_Sparkle(struct ObjectEvent *, struct Sprite *); +u8 MovementType_BerryTreeGrowth_SparkleEnd(struct ObjectEvent *, struct Sprite *); u8 MovementType_FaceDownAndUp_Step0(struct ObjectEvent *, struct Sprite *); u8 MovementType_FaceDownAndUp_Step1(struct ObjectEvent *, struct Sprite *); u8 MovementType_FaceDownAndUp_Step2(struct ObjectEvent *, struct Sprite *); diff --git a/include/global.berry.h b/include/global.berry.h index 8046d344e..8d1aa369d 100644 --- a/include/global.berry.h +++ b/include/global.berry.h @@ -63,7 +63,7 @@ struct BerryTree { u8 berry; u8 stage:7; - u8 growthSparkle:1; + u8 stopGrowth:1; u16 minutesUntilNextStage; u8 berryYield; u8 regrowthCount:4; -- cgit v1.2.3 From 89b85a49ec30d613244bd5c76f0a86ab1022bc48 Mon Sep 17 00:00:00 2001 From: GriffinR Date: Thu, 28 Jan 2021 15:42:51 -0500 Subject: Index gBardSounds_Moves and gBardSounds_Pokemon with constants --- include/bard_music.h | 8 ++------ include/easy_chat.h | 2 +- 2 files changed, 3 insertions(+), 7 deletions(-) (limited to 'include') diff --git a/include/bard_music.h b/include/bard_music.h index 882606b27..ca4c285db 100644 --- a/include/bard_music.h +++ b/include/bard_music.h @@ -34,12 +34,8 @@ struct BardSong /*0x30*/ const struct BardSound *sound; }; -// Exported RAM declarations - -// Exported ROM declarations - -extern const u16 gNumSpeciesNames; -extern const u16 gUnknown_085FA1D4; +extern const u16 gNumBardWords_Species; +extern const u16 gNumBardWords_Moves; const struct BardSound *GetWordSounds(u16 word); void GetWordPhonemes(struct BardSong *song, u16 word); diff --git a/include/easy_chat.h b/include/easy_chat.h index f2ef066d4..2fa7f7b3e 100644 --- a/include/easy_chat.h +++ b/include/easy_chat.h @@ -127,7 +127,7 @@ u8 * CopyEasyChatWord(u8 *dest, u16 word); bool32 sub_811F8D8(int word); void InitializeEasyChatWordArray(u16 *words, u16 length); u8 *ConvertEasyChatWordsToString(u8 *dest, const u16 *src, u16 columns, u16 rows); -bool8 ECWord_CheckIfOutsideOfValidRange(u16 word); +bool8 IsBardWordInvalid(u16 word); u16 GetRandomEasyChatWordFromGroup(u16 group); u16 GetNewHipsterPhraseToTeach(void); u16 EasyChat_GetNumWordsInGroup(u8); -- cgit v1.2.3 From 12af03cd62732bd63c0bc482d63f59ee97bc17f2 Mon Sep 17 00:00:00 2001 From: GriffinR Date: Thu, 28 Jan 2021 16:36:56 -0500 Subject: Label bard music pitch table --- include/bard_music.h | 3 --- 1 file changed, 3 deletions(-) (limited to 'include') diff --git a/include/bard_music.h b/include/bard_music.h index ca4c285db..2825d16e6 100644 --- a/include/bard_music.h +++ b/include/bard_music.h @@ -1,9 +1,6 @@ #ifndef GUARD_BARD_MUSIC_H #define GUARD_BARD_MUSIC_H -// Exported type declarations - - struct BardSound { /*0x00*/ u8 var00; -- cgit v1.2.3 From 15906ca1433279d80de8770646aec36dc868faaa Mon Sep 17 00:00:00 2001 From: GriffinR Date: Wed, 3 Feb 2021 15:04:25 -0500 Subject: Document evolution scene --- include/evolution_graphics.h | 14 ++++++-------- 1 file changed, 6 insertions(+), 8 deletions(-) (limited to 'include') diff --git a/include/evolution_graphics.h b/include/evolution_graphics.h index f52105815..61051c69a 100644 --- a/include/evolution_graphics.h +++ b/include/evolution_graphics.h @@ -3,13 +3,11 @@ void LoadEvoSparkleSpriteAndPal(void); -u8 LaunchTask_PreEvoSparklesSet1(u16 arg0); -u8 LaunchTask_PreEvoSparklesSet2(void); -u8 LaunchTask_PostEvoSparklesSet1(void); -u8 LaunchTask_PostEvoSparklesSet2AndFlash(u16 species); -u8 LaunchTask_PostEvoSparklesSet2AndFlash_Trade(u16 species); -u8 sub_817C3A0(u8 preEvoSpriteID, u8 postEvoSpriteID); - -#define EvoGraphicsTaskEvoStop data[8] +u8 EvolutionSparkles_SpiralUpward(u16 arg0); +u8 EvolutionSparkles_ArcDown(void); +u8 EvolutionSparkles_CircleInward(void); +u8 EvolutionSparkles_SprayAndFlash(u16 species); +u8 EvolutionSparkles_SprayAndFlash_Trade(u16 species); +u8 CycleEvolutionMonSprite(u8 preEvoSpriteID, u8 postEvoSpriteID); #endif // GUARD_EVOLUTION_GRAPHICS_H -- cgit v1.2.3 From ac43365d58868e1aa1be2bc8ed31e5a23980ffe5 Mon Sep 17 00:00:00 2001 From: Deokishisu <6993375+Deokishisu@users.noreply.github.com> Date: Fri, 5 Feb 2021 01:27:11 -0500 Subject: Fix "Compatibility" Misspelling Someone misspelled "compatibility" as "compatability" in the daycare-related files. This commit spells them correctly. --- include/constants/daycare.h | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'include') diff --git a/include/constants/daycare.h b/include/constants/daycare.h index adb62fab5..e412d2ab7 100644 --- a/include/constants/daycare.h +++ b/include/constants/daycare.h @@ -1,11 +1,11 @@ #ifndef GUARD_DAYCARE_CONSTANTS_H #define GUARD_DAYCARE_CONSTANTS_H -// Parent compatability scores +// Parent compatibility scores #define PARENTS_INCOMPATIBLE 0 #define PARENTS_LOW_COMPATIBILITY 20 -#define PARENTS_MED_COMPATABILITY 50 -#define PARENTS_MAX_COMPATABILITY 70 +#define PARENTS_MED_COMPATIBILITY 50 +#define PARENTS_MAX_COMPATIBILITY 70 // Daycare state #define DAYCARE_NO_MONS 0 -- cgit v1.2.3 From a240481d5ffe7f9c7a62faf0617dff888d84d745 Mon Sep 17 00:00:00 2001 From: GriffinR Date: Fri, 5 Feb 2021 12:08:25 -0500 Subject: Document secret_base.c --- include/constants/global.h | 2 +- include/constants/secret_bases.h | 58 ++++++++++++++++++++++++++++++++++++++-- include/global.h | 4 +-- 3 files changed, 59 insertions(+), 5 deletions(-) (limited to 'include') diff --git a/include/constants/global.h b/include/constants/global.h index 55830ae8b..bc611879e 100644 --- a/include/constants/global.h +++ b/include/constants/global.h @@ -70,7 +70,7 @@ // party sizes #define PARTY_SIZE 6 -#define MULTI_PARTY_SIZE PARTY_SIZE / 2 +#define MULTI_PARTY_SIZE (PARTY_SIZE / 2) #define FRONTIER_PARTY_SIZE 3 #define FRONTIER_DOUBLES_PARTY_SIZE 4 #define FRONTIER_MULTI_PARTY_SIZE 2 diff --git a/include/constants/secret_bases.h b/include/constants/secret_bases.h index 2f405317d..e9188fbf5 100755 --- a/include/constants/secret_bases.h +++ b/include/constants/secret_bases.h @@ -12,106 +12,160 @@ // The secret base's map is determined by (id / 10). The ones // digit is used to differentiate secret bases using the same map. // Therefore, each secret base map can be used by up to 10 different -// secret bases in the game. These ids are 1-based, but there is no -// apparent reason for that. +// secret bases in the game. + +// * 4 is for each byte of data per secret base group in sSecretBaseEntrancePositions +// They are the map number, the entrance warp id, and the x/y position in front of the computer +#define SECRET_BASE_GROUP(idx) ((idx) * 4) +#define SECRET_BASE_ID_TO_GROUP(baseId) SECRET_BASE_GROUP((baseId) / 10) #define SECRET_BASE_RED_CAVE1_1 1 #define SECRET_BASE_RED_CAVE1_2 2 #define SECRET_BASE_RED_CAVE1_3 3 +#define SECRET_BASE_RED_CAVE1 SECRET_BASE_GROUP(0) + #define SECRET_BASE_RED_CAVE2_1 11 #define SECRET_BASE_RED_CAVE2_2 12 #define SECRET_BASE_RED_CAVE2_3 13 +#define SECRET_BASE_RED_CAVE2 SECRET_BASE_GROUP(1) + #define SECRET_BASE_RED_CAVE3_1 21 #define SECRET_BASE_RED_CAVE3_2 22 #define SECRET_BASE_RED_CAVE3_3 23 +#define SECRET_BASE_RED_CAVE3 SECRET_BASE_GROUP(2) + #define SECRET_BASE_RED_CAVE4_1 31 #define SECRET_BASE_RED_CAVE4_2 32 #define SECRET_BASE_RED_CAVE4_3 33 +#define SECRET_BASE_RED_CAVE4 SECRET_BASE_GROUP(3) + #define SECRET_BASE_BROWN_CAVE1_1 41 #define SECRET_BASE_BROWN_CAVE1_2 42 #define SECRET_BASE_BROWN_CAVE1_3 43 +#define SECRET_BASE_BROWN_CAVE1 SECRET_BASE_GROUP(4) + #define SECRET_BASE_BROWN_CAVE2_1 51 #define SECRET_BASE_BROWN_CAVE2_2 52 #define SECRET_BASE_BROWN_CAVE2_3 53 +#define SECRET_BASE_BROWN_CAVE2 SECRET_BASE_GROUP(5) + #define SECRET_BASE_BROWN_CAVE3_1 61 #define SECRET_BASE_BROWN_CAVE3_2 62 #define SECRET_BASE_BROWN_CAVE3_3 63 +#define SECRET_BASE_BROWN_CAVE3 SECRET_BASE_GROUP(6) + #define SECRET_BASE_BROWN_CAVE4_1 71 #define SECRET_BASE_BROWN_CAVE4_2 72 #define SECRET_BASE_BROWN_CAVE4_3 73 +#define SECRET_BASE_BROWN_CAVE4 SECRET_BASE_GROUP(7) + #define SECRET_BASE_BLUE_CAVE1_1 81 #define SECRET_BASE_BLUE_CAVE1_2 82 #define SECRET_BASE_BLUE_CAVE1_3 83 +#define SECRET_BASE_BLUE_CAVE1 SECRET_BASE_GROUP(8) + #define SECRET_BASE_BLUE_CAVE2_1 91 #define SECRET_BASE_BLUE_CAVE2_2 92 #define SECRET_BASE_BLUE_CAVE2_3 93 +#define SECRET_BASE_BLUE_CAVE2 SECRET_BASE_GROUP(9) + #define SECRET_BASE_BLUE_CAVE3_1 101 #define SECRET_BASE_BLUE_CAVE3_2 102 #define SECRET_BASE_BLUE_CAVE3_3 103 +#define SECRET_BASE_BLUE_CAVE3 SECRET_BASE_GROUP(10) + #define SECRET_BASE_BLUE_CAVE4_1 111 #define SECRET_BASE_BLUE_CAVE4_2 112 #define SECRET_BASE_BLUE_CAVE4_3 113 +#define SECRET_BASE_BLUE_CAVE4 SECRET_BASE_GROUP(11) + #define SECRET_BASE_YELLOW_CAVE1_1 121 #define SECRET_BASE_YELLOW_CAVE1_2 122 #define SECRET_BASE_YELLOW_CAVE1_3 123 +#define SECRET_BASE_YELLOW_CAVE1 SECRET_BASE_GROUP(12) + #define SECRET_BASE_YELLOW_CAVE2_1 131 #define SECRET_BASE_YELLOW_CAVE2_2 132 #define SECRET_BASE_YELLOW_CAVE2_3 133 +#define SECRET_BASE_YELLOW_CAVE2 SECRET_BASE_GROUP(13) + #define SECRET_BASE_YELLOW_CAVE3_1 141 #define SECRET_BASE_YELLOW_CAVE3_2 142 #define SECRET_BASE_YELLOW_CAVE3_3 143 +#define SECRET_BASE_YELLOW_CAVE3 SECRET_BASE_GROUP(14) + #define SECRET_BASE_YELLOW_CAVE4_1 151 #define SECRET_BASE_YELLOW_CAVE4_2 152 #define SECRET_BASE_YELLOW_CAVE4_3 153 +#define SECRET_BASE_YELLOW_CAVE4 SECRET_BASE_GROUP(15) + #define SECRET_BASE_TREE1_1 161 #define SECRET_BASE_TREE1_2 162 #define SECRET_BASE_TREE1_3 163 #define SECRET_BASE_TREE1_4 164 +#define SECRET_BASE_TREE1 SECRET_BASE_GROUP(16) + #define SECRET_BASE_TREE2_1 171 #define SECRET_BASE_TREE2_2 172 #define SECRET_BASE_TREE2_3 173 #define SECRET_BASE_TREE2_4 174 +#define SECRET_BASE_TREE2 SECRET_BASE_GROUP(17) + #define SECRET_BASE_TREE3_1 181 #define SECRET_BASE_TREE3_2 182 #define SECRET_BASE_TREE3_3 183 +#define SECRET_BASE_TREE3 SECRET_BASE_GROUP(18) + #define SECRET_BASE_TREE4_1 191 #define SECRET_BASE_TREE4_2 192 #define SECRET_BASE_TREE4_3 193 +#define SECRET_BASE_TREE4 SECRET_BASE_GROUP(19) + #define SECRET_BASE_SHRUB1_1 201 #define SECRET_BASE_SHRUB1_2 202 #define SECRET_BASE_SHRUB1_3 203 #define SECRET_BASE_SHRUB1_4 204 +#define SECRET_BASE_SHRUB1 SECRET_BASE_GROUP(20) + #define SECRET_BASE_SHRUB2_1 211 #define SECRET_BASE_SHRUB2_2 212 #define SECRET_BASE_SHRUB2_3 213 +#define SECRET_BASE_SHRUB2 SECRET_BASE_GROUP(21) + #define SECRET_BASE_SHRUB3_1 221 #define SECRET_BASE_SHRUB3_2 222 #define SECRET_BASE_SHRUB3_3 223 +#define SECRET_BASE_SHRUB3 SECRET_BASE_GROUP(22) + #define SECRET_BASE_SHRUB4_1 231 #define SECRET_BASE_SHRUB4_2 232 #define SECRET_BASE_SHRUB4_3 233 +#define SECRET_BASE_SHRUB4 SECRET_BASE_GROUP(23) + +#define NUM_SECRET_BASE_GROUPS 24 + #endif // GUARD_CONSTANTS_SECRET_BASES_H diff --git a/include/global.h b/include/global.h index 4ccd2be50..ca3cf4452 100644 --- a/include/global.h +++ b/include/global.h @@ -500,7 +500,7 @@ struct SecretBaseParty struct SecretBase { /*0x1A9C*/ u8 secretBaseId; - /*0x1A9D*/ u8 sbr_field_1_0:4; + /*0x1A9D*/ bool8 toRegister:4; /*0x1A9D*/ u8 gender:1; /*0x1A9D*/ u8 battledOwnerToday:1; /*0x1A9D*/ u8 registryStatus:2; @@ -509,7 +509,7 @@ struct SecretBase /*0x1AA9*/ u8 language; /*0x1AAA*/ u16 numSecretBasesReceived; /*0x1AAC*/ u8 numTimesEntered; - /*0x1AAD*/ u8 sbr_field_11; + /*0x1AAD*/ u8 unused; /*0x1AAE*/ u8 decorations[DECOR_MAX_SECRET_BASE]; /*0x1ABE*/ u8 decorationPositions[DECOR_MAX_SECRET_BASE]; /*0x1AD0*/ struct SecretBaseParty party; -- cgit v1.2.3 From 0851c34bac0f38699e3442d8b79c4d7fe52ca71c Mon Sep 17 00:00:00 2001 From: GriffinR Date: Fri, 5 Feb 2021 15:25:12 -0500 Subject: Add berry tree id constants --- include/berry.h | 2 - include/constants/berry.h | 97 ++++++++++++++++++++++++++++++++++++++++++++++ include/constants/global.h | 1 - include/global.h | 1 + 4 files changed, 98 insertions(+), 3 deletions(-) (limited to 'include') diff --git a/include/berry.h b/include/berry.h index 3412caae5..4a5a46615 100644 --- a/include/berry.h +++ b/include/berry.h @@ -1,8 +1,6 @@ #ifndef GUARD_BERRY_H #define GUARD_BERRY_H -#include "constants/berry.h" - void ClearEnigmaBerries(void); void SetEnigmaBerry(u8 *src); bool32 IsEnigmaBerryValid(void); diff --git a/include/constants/berry.h b/include/constants/berry.h index 8f1e7cd82..fee1ee5f1 100644 --- a/include/constants/berry.h +++ b/include/constants/berry.h @@ -32,4 +32,101 @@ // - BERRY_STAGE_FLOWERING #define NUM_WATER_STAGES 4 +// IDs for berry tree objects, indexes into berryTrees in SaveBlock1 +// Named for whatever berry is initially planted there on a new game +// Those with no initial berry are named "soil" +#define BERRY_TREE_ROUTE_102_ORAN 1 +#define BERRY_TREE_ROUTE_102_PECHA 2 +#define BERRY_TREE_ROUTE_104_SOIL_1 3 +#define BERRY_TREE_ROUTE_104_ORAN_1 4 +#define BERRY_TREE_ROUTE_103_CHERI_1 5 +#define BERRY_TREE_ROUTE_103_LEPPA 6 +#define BERRY_TREE_ROUTE_103_CHERI_2 7 +#define BERRY_TREE_ROUTE_104_CHERI_1 8 +#define BERRY_TREE_ROUTE_104_SOIL_2 9 +#define BERRY_TREE_ROUTE_104_LEPPA 10 +#define BERRY_TREE_ROUTE_104_ORAN_2 11 +#define BERRY_TREE_ROUTE_104_SOIL_3 12 +#define BERRY_TREE_ROUTE_104_PECHA 13 +#define BERRY_TREE_ROUTE_123_QUALOT_1 14 +#define BERRY_TREE_ROUTE_123_POMEG_1 15 +#define BERRY_TREE_ROUTE_110_NANAB_1 16 +#define BERRY_TREE_ROUTE_110_NANAB_2 17 +#define BERRY_TREE_ROUTE_110_NANAB_3 18 +#define BERRY_TREE_ROUTE_111_RAZZ_1 19 +#define BERRY_TREE_ROUTE_111_RAZZ_2 20 +#define BERRY_TREE_ROUTE_112_RAWST_1 21 +#define BERRY_TREE_ROUTE_112_PECHA_1 22 +#define BERRY_TREE_ROUTE_112_PECHA_2 23 +#define BERRY_TREE_ROUTE_112_RAWST_2 24 +#define BERRY_TREE_ROUTE_116_PINAP_1 25 +#define BERRY_TREE_ROUTE_116_CHESTO_1 26 +#define BERRY_TREE_ROUTE_117_WEPEAR_1 27 +#define BERRY_TREE_ROUTE_117_WEPEAR_2 28 +#define BERRY_TREE_ROUTE_117_WEPEAR_3 29 +#define BERRY_TREE_ROUTE_123_POMEG_2 30 +#define BERRY_TREE_ROUTE_118_SITRUS_1 31 +#define BERRY_TREE_ROUTE_118_SOIL 32 +#define BERRY_TREE_ROUTE_118_SITRUS_2 33 +#define BERRY_TREE_ROUTE_119_POMEG_1 34 +#define BERRY_TREE_ROUTE_119_POMEG_2 35 +#define BERRY_TREE_ROUTE_119_POMEG_3 36 +#define BERRY_TREE_ROUTE_120_ASPEAR_1 37 +#define BERRY_TREE_ROUTE_120_ASPEAR_2 38 +#define BERRY_TREE_ROUTE_120_ASPEAR_3 39 +#define BERRY_TREE_ROUTE_120_PECHA_1 40 +#define BERRY_TREE_ROUTE_120_PECHA_2 41 +#define BERRY_TREE_ROUTE_120_PECHA_3 42 +#define BERRY_TREE_ROUTE_120_RAZZ 43 +#define BERRY_TREE_ROUTE_120_NANAB 44 +#define BERRY_TREE_ROUTE_120_PINAP 45 +#define BERRY_TREE_ROUTE_120_WEPEAR 46 +#define BERRY_TREE_ROUTE_121_PERSIM 47 +#define BERRY_TREE_ROUTE_121_ASPEAR 48 +#define BERRY_TREE_ROUTE_121_RAWST 49 +#define BERRY_TREE_ROUTE_121_CHESTO 50 +#define BERRY_TREE_ROUTE_121_SOIL_1 51 +#define BERRY_TREE_ROUTE_121_NANAB_1 52 +#define BERRY_TREE_ROUTE_121_NANAB_2 53 +#define BERRY_TREE_ROUTE_121_SOIL_2 54 +#define BERRY_TREE_ROUTE_115_BLUK_1 55 +#define BERRY_TREE_ROUTE_115_BLUK_2 56 +#define BERRY_TREE_UNUSED 57 +#define BERRY_TREE_ROUTE_123_POMEG_3 58 +#define BERRY_TREE_ROUTE_123_POMEG_4 59 +#define BERRY_TREE_ROUTE_123_GREPA_1 60 +#define BERRY_TREE_ROUTE_123_GREPA_2 61 +#define BERRY_TREE_ROUTE_123_LEPPA_1 62 +#define BERRY_TREE_ROUTE_123_SOIL 63 +#define BERRY_TREE_ROUTE_123_LEPPA_2 64 +#define BERRY_TREE_ROUTE_123_GREPA_3 65 +#define BERRY_TREE_ROUTE_116_CHESTO_2 66 +#define BERRY_TREE_ROUTE_116_PINAP_2 67 +#define BERRY_TREE_ROUTE_114_PERSIM_1 68 +#define BERRY_TREE_ROUTE_115_KELPSY_1 69 +#define BERRY_TREE_ROUTE_115_KELPSY_2 70 +#define BERRY_TREE_ROUTE_115_KELPSY_3 71 +#define BERRY_TREE_ROUTE_123_GREPA_4 72 +#define BERRY_TREE_ROUTE_123_QUALOT_2 73 +#define BERRY_TREE_ROUTE_123_QUALOT_3 74 +#define BERRY_TREE_ROUTE_104_SOIL_4 75 +#define BERRY_TREE_ROUTE_104_CHERI_2 76 +#define BERRY_TREE_ROUTE_114_PERSIM_2 77 +#define BERRY_TREE_ROUTE_114_PERSIM_3 78 +#define BERRY_TREE_ROUTE_123_QUALOT_4 79 +#define BERRY_TREE_ROUTE_111_ORAN_1 80 +#define BERRY_TREE_ROUTE_111_ORAN_2 81 +#define BERRY_TREE_ROUTE_130_LIECHI 82 +#define BERRY_TREE_ROUTE_119_HONDEW_1 83 +#define BERRY_TREE_ROUTE_119_HONDEW_2 84 +#define BERRY_TREE_ROUTE_119_SITRUS 85 +#define BERRY_TREE_ROUTE_119_LEPPA 86 +#define BERRY_TREE_ROUTE_123_PECHA 87 +#define BERRY_TREE_ROUTE_123_SITRUS 88 +#define BERRY_TREE_ROUTE_123_RAWST 89 + +// Remainder are unused + +#define BERRY_TREES_COUNT 128 + #endif // GUARD_CONSTANTS_BERRY_H diff --git a/include/constants/global.h b/include/constants/global.h index 55830ae8b..8033dec87 100644 --- a/include/constants/global.h +++ b/include/constants/global.h @@ -33,7 +33,6 @@ #define DAYCARE_MON_COUNT 2 #define POKEBLOCKS_COUNT 40 #define OBJECT_EVENTS_COUNT 16 -#define BERRY_TREES_COUNT 128 #define MAIL_COUNT 16 #define SECRET_BASES_COUNT 20 #define TV_SHOWS_COUNT 25 diff --git a/include/global.h b/include/global.h index 4ccd2be50..9587eb1f3 100644 --- a/include/global.h +++ b/include/global.h @@ -9,6 +9,7 @@ #include "constants/flags.h" #include "constants/vars.h" #include "constants/species.h" +#include "constants/berry.h" // Prevent cross-jump optimization. #define BLOCK_CROSS_JUMP asm(""); -- cgit v1.2.3 From 2237d0748f5ae4440403443ec86c831d2e9c5d2f Mon Sep 17 00:00:00 2001 From: GriffinR Date: Mon, 8 Feb 2021 05:01:24 -0500 Subject: Label unused layouts --- include/constants/layouts.h | 50 ++++++++--------- include/constants/map_groups.h | 122 ++++++++++++++++++++--------------------- 2 files changed, 86 insertions(+), 86 deletions(-) (limited to 'include') diff --git a/include/constants/layouts.h b/include/constants/layouts.h index 9d5e877b0..db92c9594 100755 --- a/include/constants/layouts.h +++ b/include/constants/layouts.h @@ -79,7 +79,7 @@ #define LAYOUT_FALLARBOR_TOWN_LEFTOVER_RSCONTEST_LOBBY 72 #define LAYOUT_FALLARBOR_TOWN_LEFTOVER_RSCONTEST_HALL 73 #define LAYOUT_LILYCOVE_CITY_HOUSE2 74 -#define LAYOUT_UNKNOWN_08428450 75 +#define LAYOUT_UNUSED_CONTEST_ROOM1 75 #define LAYOUT_VERDANTURF_TOWN_WANDAS_HOUSE 76 #define LAYOUT_PACIFIDLOG_TOWN_HOUSE1 77 #define LAYOUT_PACIFIDLOG_TOWN_HOUSE2 78 @@ -87,8 +87,8 @@ #define LAYOUT_HOUSE_WITH_BED 80 #define LAYOUT_SLATEPORT_CITY_STERNS_SHIPYARD_1F 81 #define LAYOUT_SLATEPORT_CITY_STERNS_SHIPYARD_2F 82 -#define LAYOUT_UNKNOWN_084294C4 83 -#define LAYOUT_UNKNOWN_084294E8 84 +#define LAYOUT_UNUSED_CONTEST_ROOM2 83 +#define LAYOUT_UNUSED_CONTEST_ROOM3 84 #define LAYOUT_SLATEPORT_CITY_POKEMON_FAN_CLUB 85 #define LAYOUT_SLATEPORT_CITY_OCEANIC_MUSEUM_1F 86 #define LAYOUT_SLATEPORT_CITY_OCEANIC_MUSEUM_2F 87 @@ -174,20 +174,20 @@ #define LAYOUT_SHOAL_CAVE_LOW_TIDE_LOWER_ROOM 167 #define LAYOUT_SHOAL_CAVE_HIGH_TIDE_ENTRANCE_ROOM 168 #define LAYOUT_SHOAL_CAVE_HIGH_TIDE_INNER_ROOM 169 -#define LAYOUT_UNKNOWN_0843E6C0 170 -#define LAYOUT_UNKNOWN_0843E6E4 171 -#define LAYOUT_UNKNOWN_0843E708 172 -#define LAYOUT_UNKNOWN_0843E72C 173 -#define LAYOUT_UNKNOWN_0843E750 174 -#define LAYOUT_UNKNOWN_0843E774 175 -#define LAYOUT_UNKNOWN_0843E798 176 -#define LAYOUT_UNKNOWN_0843E7BC 177 -#define LAYOUT_UNKNOWN_0843E7E0 178 -#define LAYOUT_UNKNOWN_0843E804 179 -#define LAYOUT_UNKNOWN_0843E828 180 -#define LAYOUT_UNKNOWN_0843E84C 181 -#define LAYOUT_UNKNOWN_0843E870 182 -#define LAYOUT_UNKNOWN_0843E894 183 +#define LAYOUT_UNUSED_CAVE1 170 +#define LAYOUT_UNUSED_CAVE2 171 +#define LAYOUT_UNUSED_CAVE3 172 +#define LAYOUT_UNUSED_CAVE4 173 +#define LAYOUT_UNUSED_CAVE5 174 +#define LAYOUT_UNUSED_CAVE6 175 +#define LAYOUT_UNUSED_CAVE7 176 +#define LAYOUT_UNUSED_CAVE8 177 +#define LAYOUT_UNUSED_CAVE9 178 +#define LAYOUT_UNUSED_CAVE10 179 +#define LAYOUT_UNUSED_CAVE11 180 +#define LAYOUT_UNUSED_CAVE12 181 +#define LAYOUT_UNUSED_CAVE13 182 +#define LAYOUT_UNUSED_CAVE14 183 #define LAYOUT_NEW_MAUVILLE_ENTRANCE 184 #define LAYOUT_NEW_MAUVILLE_INSIDE 185 #define LAYOUT_ABANDONED_SHIP_DECK 186 @@ -230,12 +230,12 @@ #define LAYOUT_RECORD_CORNER 223 #define LAYOUT_BATTLE_COLOSSEUM_4P 224 #define LAYOUT_CONTEST_HALL 225 -#define LAYOUT_UNKNOWN_LINK_CONTEST_ROOM_25_29 226 -#define LAYOUT_UNKNOWN_LINK_CONTEST_ROOM_25_30 227 -#define LAYOUT_UNKNOWN_LINK_CONTEST_ROOM_25_31 228 -#define LAYOUT_UNKNOWN_LINK_CONTEST_ROOM_25_32 229 -#define LAYOUT_UNKNOWN_LINK_CONTEST_ROOM_25_33 230 -#define LAYOUT_UNKNOWN_LINK_CONTEST_ROOM_25_34 231 +#define LAYOUT_UNUSED_CONTEST_HALL1 226 +#define LAYOUT_UNUSED_CONTEST_HALL2 227 +#define LAYOUT_UNUSED_CONTEST_HALL3 228 +#define LAYOUT_UNUSED_CONTEST_HALL4 229 +#define LAYOUT_UNUSED_CONTEST_HALL5 230 +#define LAYOUT_UNUSED_CONTEST_HALL6 231 #define LAYOUT_CONTEST_HALL_BEAUTY 232 #define LAYOUT_CONTEST_HALL_TOUGH 233 #define LAYOUT_CONTEST_HALL_COOL 234 @@ -246,7 +246,7 @@ #define LAYOUT_SAFARI_ZONE_NORTH 239 #define LAYOUT_SAFARI_ZONE_SOUTHWEST 240 #define LAYOUT_SAFARI_ZONE_SOUTH 241 -#define LAYOUT_UNKNOWN_08447028 242 +#define LAYOUT_UNUSED_OUTDOOR_AREA 242 #define LAYOUT_ROUTE109_SEASHORE_HOUSE 243 #define LAYOUT_ROUTE110_TRICK_HOUSE_ENTRANCE 244 #define LAYOUT_ROUTE110_TRICK_HOUSE_END 245 @@ -363,7 +363,7 @@ #define LAYOUT_BATTLE_FRONTIER_BATTLE_ARENA_BATTLE_ROOM 356 #define LAYOUT_SOOTOPOLIS_CITY_LEGENDS_BATTLE 357 #define LAYOUT_BATTLE_FRONTIER_BATTLE_PIKE_ROOM_WILD_MONS 358 -#define LAYOUT_UNKNOWN_084693AC 359 +#define LAYOUT_BATTLE_FRONTIER_BATTLE_PIKE_ROOM_UNUSED 359 #define LAYOUT_BATTLE_FRONTIER_BATTLE_PYRAMID_LOBBY 360 #define LAYOUT_BATTLE_FRONTIER_BATTLE_PYRAMID_FLOOR 361 #define LAYOUT_BATTLE_PYRAMID_SQUARE01 362 diff --git a/include/constants/map_groups.h b/include/constants/map_groups.h index 69355635b..c650600e8 100755 --- a/include/constants/map_groups.h +++ b/include/constants/map_groups.h @@ -402,67 +402,67 @@ #define MAP_METEOR_FALLS_STEVENS_CAVE (107 | (24 << 8)) // Map Group 25 -#define MAP_SECRET_BASE_RED_CAVE1 (0 | (25 << 8)) -#define MAP_SECRET_BASE_BROWN_CAVE1 (1 | (25 << 8)) -#define MAP_SECRET_BASE_BLUE_CAVE1 (2 | (25 << 8)) -#define MAP_SECRET_BASE_YELLOW_CAVE1 (3 | (25 << 8)) -#define MAP_SECRET_BASE_TREE1 (4 | (25 << 8)) -#define MAP_SECRET_BASE_SHRUB1 (5 | (25 << 8)) -#define MAP_SECRET_BASE_RED_CAVE2 (6 | (25 << 8)) -#define MAP_SECRET_BASE_BROWN_CAVE2 (7 | (25 << 8)) -#define MAP_SECRET_BASE_BLUE_CAVE2 (8 | (25 << 8)) -#define MAP_SECRET_BASE_YELLOW_CAVE2 (9 | (25 << 8)) -#define MAP_SECRET_BASE_TREE2 (10 | (25 << 8)) -#define MAP_SECRET_BASE_SHRUB2 (11 | (25 << 8)) -#define MAP_SECRET_BASE_RED_CAVE3 (12 | (25 << 8)) -#define MAP_SECRET_BASE_BROWN_CAVE3 (13 | (25 << 8)) -#define MAP_SECRET_BASE_BLUE_CAVE3 (14 | (25 << 8)) -#define MAP_SECRET_BASE_YELLOW_CAVE3 (15 | (25 << 8)) -#define MAP_SECRET_BASE_TREE3 (16 | (25 << 8)) -#define MAP_SECRET_BASE_SHRUB3 (17 | (25 << 8)) -#define MAP_SECRET_BASE_RED_CAVE4 (18 | (25 << 8)) -#define MAP_SECRET_BASE_BROWN_CAVE4 (19 | (25 << 8)) -#define MAP_SECRET_BASE_BLUE_CAVE4 (20 | (25 << 8)) -#define MAP_SECRET_BASE_YELLOW_CAVE4 (21 | (25 << 8)) -#define MAP_SECRET_BASE_TREE4 (22 | (25 << 8)) -#define MAP_SECRET_BASE_SHRUB4 (23 | (25 << 8)) -#define MAP_BATTLE_COLOSSEUM_2P (24 | (25 << 8)) -#define MAP_TRADE_CENTER (25 | (25 << 8)) -#define MAP_RECORD_CORNER (26 | (25 << 8)) -#define MAP_BATTLE_COLOSSEUM_4P (27 | (25 << 8)) -#define MAP_CONTEST_HALL (28 | (25 << 8)) -#define MAP_UNKNOWN_LINK_CONTEST_ROOM_25_29 (29 | (25 << 8)) -#define MAP_UNKNOWN_LINK_CONTEST_ROOM_25_30 (30 | (25 << 8)) -#define MAP_UNKNOWN_LINK_CONTEST_ROOM_25_31 (31 | (25 << 8)) -#define MAP_UNKNOWN_LINK_CONTEST_ROOM_25_32 (32 | (25 << 8)) -#define MAP_UNKNOWN_LINK_CONTEST_ROOM_25_33 (33 | (25 << 8)) -#define MAP_UNKNOWN_LINK_CONTEST_ROOM_25_34 (34 | (25 << 8)) -#define MAP_CONTEST_HALL_BEAUTY (35 | (25 << 8)) -#define MAP_CONTEST_HALL_TOUGH (36 | (25 << 8)) -#define MAP_CONTEST_HALL_COOL (37 | (25 << 8)) -#define MAP_CONTEST_HALL_SMART (38 | (25 << 8)) -#define MAP_CONTEST_HALL_CUTE (39 | (25 << 8)) -#define MAP_INSIDE_OF_TRUCK (40 | (25 << 8)) -#define MAP_SS_TIDAL_CORRIDOR (41 | (25 << 8)) -#define MAP_SS_TIDAL_LOWER_DECK (42 | (25 << 8)) -#define MAP_SS_TIDAL_ROOMS (43 | (25 << 8)) -#define MAP_BATTLE_PYRAMID_SQUARE01 (44 | (25 << 8)) -#define MAP_BATTLE_PYRAMID_SQUARE02 (45 | (25 << 8)) -#define MAP_BATTLE_PYRAMID_SQUARE03 (46 | (25 << 8)) -#define MAP_BATTLE_PYRAMID_SQUARE04 (47 | (25 << 8)) -#define MAP_BATTLE_PYRAMID_SQUARE05 (48 | (25 << 8)) -#define MAP_BATTLE_PYRAMID_SQUARE06 (49 | (25 << 8)) -#define MAP_BATTLE_PYRAMID_SQUARE07 (50 | (25 << 8)) -#define MAP_BATTLE_PYRAMID_SQUARE08 (51 | (25 << 8)) -#define MAP_BATTLE_PYRAMID_SQUARE09 (52 | (25 << 8)) -#define MAP_BATTLE_PYRAMID_SQUARE10 (53 | (25 << 8)) -#define MAP_BATTLE_PYRAMID_SQUARE11 (54 | (25 << 8)) -#define MAP_BATTLE_PYRAMID_SQUARE12 (55 | (25 << 8)) -#define MAP_BATTLE_PYRAMID_SQUARE13 (56 | (25 << 8)) -#define MAP_BATTLE_PYRAMID_SQUARE14 (57 | (25 << 8)) -#define MAP_BATTLE_PYRAMID_SQUARE15 (58 | (25 << 8)) -#define MAP_BATTLE_PYRAMID_SQUARE16 (59 | (25 << 8)) -#define MAP_UNION_ROOM (60 | (25 << 8)) +#define MAP_SECRET_BASE_RED_CAVE1 (0 | (25 << 8)) +#define MAP_SECRET_BASE_BROWN_CAVE1 (1 | (25 << 8)) +#define MAP_SECRET_BASE_BLUE_CAVE1 (2 | (25 << 8)) +#define MAP_SECRET_BASE_YELLOW_CAVE1 (3 | (25 << 8)) +#define MAP_SECRET_BASE_TREE1 (4 | (25 << 8)) +#define MAP_SECRET_BASE_SHRUB1 (5 | (25 << 8)) +#define MAP_SECRET_BASE_RED_CAVE2 (6 | (25 << 8)) +#define MAP_SECRET_BASE_BROWN_CAVE2 (7 | (25 << 8)) +#define MAP_SECRET_BASE_BLUE_CAVE2 (8 | (25 << 8)) +#define MAP_SECRET_BASE_YELLOW_CAVE2 (9 | (25 << 8)) +#define MAP_SECRET_BASE_TREE2 (10 | (25 << 8)) +#define MAP_SECRET_BASE_SHRUB2 (11 | (25 << 8)) +#define MAP_SECRET_BASE_RED_CAVE3 (12 | (25 << 8)) +#define MAP_SECRET_BASE_BROWN_CAVE3 (13 | (25 << 8)) +#define MAP_SECRET_BASE_BLUE_CAVE3 (14 | (25 << 8)) +#define MAP_SECRET_BASE_YELLOW_CAVE3 (15 | (25 << 8)) +#define MAP_SECRET_BASE_TREE3 (16 | (25 << 8)) +#define MAP_SECRET_BASE_SHRUB3 (17 | (25 << 8)) +#define MAP_SECRET_BASE_RED_CAVE4 (18 | (25 << 8)) +#define MAP_SECRET_BASE_BROWN_CAVE4 (19 | (25 << 8)) +#define MAP_SECRET_BASE_BLUE_CAVE4 (20 | (25 << 8)) +#define MAP_SECRET_BASE_YELLOW_CAVE4 (21 | (25 << 8)) +#define MAP_SECRET_BASE_TREE4 (22 | (25 << 8)) +#define MAP_SECRET_BASE_SHRUB4 (23 | (25 << 8)) +#define MAP_BATTLE_COLOSSEUM_2P (24 | (25 << 8)) +#define MAP_TRADE_CENTER (25 | (25 << 8)) +#define MAP_RECORD_CORNER (26 | (25 << 8)) +#define MAP_BATTLE_COLOSSEUM_4P (27 | (25 << 8)) +#define MAP_CONTEST_HALL (28 | (25 << 8)) +#define MAP_UNUSED_CONTEST_HALL1 (29 | (25 << 8)) +#define MAP_UNUSED_CONTEST_HALL2 (30 | (25 << 8)) +#define MAP_UNUSED_CONTEST_HALL3 (31 | (25 << 8)) +#define MAP_UNUSED_CONTEST_HALL4 (32 | (25 << 8)) +#define MAP_UNUSED_CONTEST_HALL5 (33 | (25 << 8)) +#define MAP_UNUSED_CONTEST_HALL6 (34 | (25 << 8)) +#define MAP_CONTEST_HALL_BEAUTY (35 | (25 << 8)) +#define MAP_CONTEST_HALL_TOUGH (36 | (25 << 8)) +#define MAP_CONTEST_HALL_COOL (37 | (25 << 8)) +#define MAP_CONTEST_HALL_SMART (38 | (25 << 8)) +#define MAP_CONTEST_HALL_CUTE (39 | (25 << 8)) +#define MAP_INSIDE_OF_TRUCK (40 | (25 << 8)) +#define MAP_SS_TIDAL_CORRIDOR (41 | (25 << 8)) +#define MAP_SS_TIDAL_LOWER_DECK (42 | (25 << 8)) +#define MAP_SS_TIDAL_ROOMS (43 | (25 << 8)) +#define MAP_BATTLE_PYRAMID_SQUARE01 (44 | (25 << 8)) +#define MAP_BATTLE_PYRAMID_SQUARE02 (45 | (25 << 8)) +#define MAP_BATTLE_PYRAMID_SQUARE03 (46 | (25 << 8)) +#define MAP_BATTLE_PYRAMID_SQUARE04 (47 | (25 << 8)) +#define MAP_BATTLE_PYRAMID_SQUARE05 (48 | (25 << 8)) +#define MAP_BATTLE_PYRAMID_SQUARE06 (49 | (25 << 8)) +#define MAP_BATTLE_PYRAMID_SQUARE07 (50 | (25 << 8)) +#define MAP_BATTLE_PYRAMID_SQUARE08 (51 | (25 << 8)) +#define MAP_BATTLE_PYRAMID_SQUARE09 (52 | (25 << 8)) +#define MAP_BATTLE_PYRAMID_SQUARE10 (53 | (25 << 8)) +#define MAP_BATTLE_PYRAMID_SQUARE11 (54 | (25 << 8)) +#define MAP_BATTLE_PYRAMID_SQUARE12 (55 | (25 << 8)) +#define MAP_BATTLE_PYRAMID_SQUARE13 (56 | (25 << 8)) +#define MAP_BATTLE_PYRAMID_SQUARE14 (57 | (25 << 8)) +#define MAP_BATTLE_PYRAMID_SQUARE15 (58 | (25 << 8)) +#define MAP_BATTLE_PYRAMID_SQUARE16 (59 | (25 << 8)) +#define MAP_UNION_ROOM (60 | (25 << 8)) // Map Group 26 #define MAP_SAFARI_ZONE_NORTHWEST (0 | (26 << 8)) -- cgit v1.2.3 From 20b76c6071ee6630a825aee9c34cf72efcc9a35f Mon Sep 17 00:00:00 2001 From: GriffinR Date: Wed, 10 Feb 2021 16:26:09 -0500 Subject: Fix swapped route 102 berries --- include/constants/berry.h | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'include') diff --git a/include/constants/berry.h b/include/constants/berry.h index fee1ee5f1..3ba59c0f5 100644 --- a/include/constants/berry.h +++ b/include/constants/berry.h @@ -35,8 +35,8 @@ // IDs for berry tree objects, indexes into berryTrees in SaveBlock1 // Named for whatever berry is initially planted there on a new game // Those with no initial berry are named "soil" -#define BERRY_TREE_ROUTE_102_ORAN 1 -#define BERRY_TREE_ROUTE_102_PECHA 2 +#define BERRY_TREE_ROUTE_102_PECHA 1 +#define BERRY_TREE_ROUTE_102_ORAN 2 #define BERRY_TREE_ROUTE_104_SOIL_1 3 #define BERRY_TREE_ROUTE_104_ORAN_1 4 #define BERRY_TREE_ROUTE_103_CHERI_1 5 -- cgit v1.2.3 From 21ee6cb9fb1cdfbafe6018372826d731325f1de2 Mon Sep 17 00:00:00 2001 From: LOuroboros Date: Fri, 12 Feb 2021 06:53:04 -0300 Subject: Added constant labels for EV manipulating item effects --- include/constants/item_effects.h | 4 ++++ 1 file changed, 4 insertions(+) (limited to 'include') diff --git a/include/constants/item_effects.h b/include/constants/item_effects.h index 6e61c4d7f..f9f329f0f 100644 --- a/include/constants/item_effects.h +++ b/include/constants/item_effects.h @@ -56,6 +56,10 @@ #define ITEM6_HEAL_HALF ((u8) -2) #define ITEM6_HEAL_LVL_UP ((u8) -3) +// Amount of EV modified by ITEM4_EV_HP, ITEM4_EV_ATK, ITEM5_EV_DEF, ITEM5_EV_SPEED, ITEM5_EV_SPDEF and ITEM5_EV_SPATK +#define ITEM6_ADD_EV 10 +#define ITEM6_SUBTRACT_EV -10 + // Used for GetItemEffectType. #define ITEM_EFFECT_X_ITEM 0 #define ITEM_EFFECT_RAISE_LEVEL 1 -- cgit v1.2.3 From 8634710996fc440105d8be6dc354b1e9fef303b1 Mon Sep 17 00:00:00 2001 From: GriffinR Date: Fri, 12 Feb 2021 14:54:11 -0500 Subject: Document PokemonUseItemEffects --- include/constants/item_effects.h | 12 ++++++++---- include/constants/pokemon.h | 6 ++++++ 2 files changed, 14 insertions(+), 4 deletions(-) (limited to 'include') diff --git a/include/constants/item_effects.h b/include/constants/item_effects.h index f9f329f0f..9a6bcd05e 100644 --- a/include/constants/item_effects.h +++ b/include/constants/item_effects.h @@ -31,7 +31,7 @@ #define ITEM4_EV_HP 0x1 #define ITEM4_EV_ATK 0x2 #define ITEM4_HEAL_HP 0x4 -#define ITEM4_HEAL_PP_ALL 0x8 +#define ITEM4_HEAL_PP 0x8 #define ITEM4_HEAL_PP_ONE 0x10 #define ITEM4_PP_UP 0x20 #define ITEM4_REVIVE 0x40 @@ -50,11 +50,15 @@ #define ITEM5_FRIENDSHIP_ALL (ITEM5_FRIENDSHIP_LOW | ITEM5_FRIENDSHIP_MID | ITEM5_FRIENDSHIP_HIGH) // fields 6 and onwards are item-specific arguments +#define ITEM_EFFECT_ARG_START 6 // Special HP recovery amounts for ITEM4_HEAL_HP -#define ITEM6_HEAL_FULL ((u8) -1) -#define ITEM6_HEAL_HALF ((u8) -2) -#define ITEM6_HEAL_LVL_UP ((u8) -3) +#define ITEM6_HEAL_HP_FULL ((u8) -1) +#define ITEM6_HEAL_HP_HALF ((u8) -2) +#define ITEM6_HEAL_HP_LVL_UP ((u8) -3) + +// Special PP recovery amounts for ITEM4_HEAL_PP +#define ITEM6_HEAL_PP_FULL 0x7F // Amount of EV modified by ITEM4_EV_HP, ITEM4_EV_ATK, ITEM5_EV_DEF, ITEM5_EV_SPEED, ITEM5_EV_SPDEF and ITEM5_EV_SPATK #define ITEM6_ADD_EV 10 diff --git a/include/constants/pokemon.h b/include/constants/pokemon.h index d4f6e5684..006a17c21 100644 --- a/include/constants/pokemon.h +++ b/include/constants/pokemon.h @@ -290,6 +290,12 @@ #define EVOS_PER_MON 5 +// Evolution 'modes,' for GetEvolutionTargetSpecies +#define EVO_MODE_NORMAL 0 +#define EVO_MODE_TRADE 1 +#define EVO_MODE_ITEM_USE 2 +#define EVO_MODE_ITEM_CHECK 3 // If an Everstone is being held, still want to show that the stone *could* be used on that Pokémon to evolve + #define NUM_MALE_LINK_FACILITY_CLASSES 8 #define NUM_FEMALE_LINK_FACILITY_CLASSES 8 -- cgit v1.2.3 From 70ff6c3b848ed16eaf63f0ff8445a8a6706250b7 Mon Sep 17 00:00:00 2001 From: SphericalIce Date: Sun, 14 Feb 2021 19:25:23 +0000 Subject: Rename 'hidden' Trainers/obj events to 'buried' --- include/constants/event_object_movement.h | 2 +- include/event_object_movement.h | 4 ++-- include/trainer_see.h | 2 +- 3 files changed, 4 insertions(+), 4 deletions(-) (limited to 'include') diff --git a/include/constants/event_object_movement.h b/include/constants/event_object_movement.h index 6a4405b65..223650081 100755 --- a/include/constants/event_object_movement.h +++ b/include/constants/event_object_movement.h @@ -64,7 +64,7 @@ #define MOVEMENT_TYPE_COPY_PLAYER_OPPOSITE_IN_GRASS 0x3C #define MOVEMENT_TYPE_COPY_PLAYER_COUNTERCLOCKWISE_IN_GRASS 0x3D #define MOVEMENT_TYPE_COPY_PLAYER_CLOCKWISE_IN_GRASS 0x3E -#define MOVEMENT_TYPE_HIDDEN 0x3F +#define MOVEMENT_TYPE_BURIED 0x3F #define MOVEMENT_TYPE_WALK_IN_PLACE_DOWN 0x40 #define MOVEMENT_TYPE_WALK_IN_PLACE_UP 0x41 #define MOVEMENT_TYPE_WALK_IN_PLACE_LEFT 0x42 diff --git a/include/event_object_movement.h b/include/event_object_movement.h index 247db9efc..1e754dcd9 100644 --- a/include/event_object_movement.h +++ b/include/event_object_movement.h @@ -255,7 +255,7 @@ void MovementType_CopyPlayer(struct Sprite *); void MovementType_TreeDisguise(struct Sprite *); void MovementType_MountainDisguise(struct Sprite *); void MovementType_CopyPlayerInGrass(struct Sprite *); -void MovementType_Hidden(struct Sprite *); +void MovementType_Buried(struct Sprite *); void MovementType_WalkInPlace(struct Sprite *); void MovementType_JogInPlace(struct Sprite *); void MovementType_RunInPlace(struct Sprite *); @@ -413,7 +413,7 @@ bool8 cph_IM_DIFFERENT(struct ObjectEvent *, struct Sprite *, u8, bool8(u8)); bool8 CopyablePlayerMovement_GoSpeed4(struct ObjectEvent *, struct Sprite *, u8, bool8(u8)); bool8 CopyablePlayerMovement_Jump(struct ObjectEvent *, struct Sprite *, u8, bool8(u8)); u8 MovementType_CopyPlayerInGrass_Step1(struct ObjectEvent *, struct Sprite *); -u8 MovementType_Hidden_Step0(struct ObjectEvent *, struct Sprite *); +u8 MovementType_Buried_Step0(struct ObjectEvent *, struct Sprite *); u8 MovementType_WalkInPlace_Step0(struct ObjectEvent *, struct Sprite *); u8 MovementType_MoveInPlace_Step1(struct ObjectEvent *, struct Sprite *); u8 MovementType_WalkSlowlyInPlace_Step0(struct ObjectEvent *, struct Sprite *); diff --git a/include/trainer_see.h b/include/trainer_see.h index 7a20671ea..ab808c720 100644 --- a/include/trainer_see.h +++ b/include/trainer_see.h @@ -17,7 +17,7 @@ extern bool8 gTrainerApproachedPlayer; extern u8 gApproachingTrainerId; bool8 CheckForTrainersWantingBattle(void); -void SetHiddenTrainerMovement(struct ObjectEvent *var); +void SetBuriedTrainerMovement(struct ObjectEvent *var); void DoTrainerApproach(void); void TryPrepareSecondApproachingTrainer(void); u8 FldEff_ExclamationMarkIcon(void); -- cgit v1.2.3 From 56e047f949dd773e2c10c0b4ecd59169f2705a47 Mon Sep 17 00:00:00 2001 From: SphericalIce Date: Sun, 14 Feb 2021 21:38:39 +0000 Subject: Fix Lilcove Motel typos --- include/constants/flags.h | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'include') diff --git a/include/constants/flags.h b/include/constants/flags.h index 9be269105..21b730de3 100644 --- a/include/constants/flags.h +++ b/include/constants/flags.h @@ -829,7 +829,7 @@ #define FLAG_HIDE_LITTLEROOT_TOWN_BRENDANS_HOUSE_RIVAL_MOM 0x310 #define FLAG_HIDE_LITTLEROOT_TOWN_MAYS_HOUSE_RIVAL_MOM 0x311 #define FLAG_HIDE_ROUTE_119_SCOTT 0x312 -#define FLAG_HIDE_LILCOVE_MOTEL_SCOTT 0x313 +#define FLAG_HIDE_LILYCOVE_MOTEL_SCOTT 0x313 #define FLAG_HIDE_MOSSDEEP_CITY_SCOTT 0x314 #define FLAG_HIDE_FANCLUB_OLD_LADY 0x315 #define FLAG_HIDE_FANCLUB_BOY 0x316 @@ -967,7 +967,7 @@ #define FLAG_HIDE_ROUTE_110_RIVAL_ON_BIKE 0x39A #define FLAG_HIDE_ROUTE_119_RIVAL_ON_BIKE 0x39B #define FLAG_HIDE_AQUA_HIDEOUT_GRUNTS 0x39C -#define FLAG_HIDE_LILCOVE_MOTEL_GAME_DESIGNERS 0x39D +#define FLAG_HIDE_LILYCOVE_MOTEL_GAME_DESIGNERS 0x39D #define FLAG_HIDE_MT_CHIMNEY_TEAM_AQUA 0x39E #define FLAG_HIDE_MT_CHIMNEY_TEAM_MAGMA 0x39F #define FLAG_HIDE_FALLARBOR_HOUSE_PROF_COZMO 0x3A0 -- cgit v1.2.3 From b89c3e901e1de2f3513d74fa548373d82d3f26d0 Mon Sep 17 00:00:00 2001 From: Deokishisu <6993375+Deokishisu@users.noreply.github.com> Date: Mon, 15 Feb 2021 11:40:16 -0500 Subject: Fix giftRibbons Field in SaveBlock1 & Relabel Gift Ribbons in pokemon.h MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit The giftRibbons field has been split out into proper subfields. The new ExternalEvent structs deal with interconnectivity between external games/peripherals and Emerald, such as PokéCoupon storage and the flag for receiving Wishmaker Jirachi. The giftRibbon fields in `PokemonSubstruct3` have also been renamed to their appropriate ribbons, and commented with distribution info if applicable. The previous `fatefulEncounter` field was actually filler, and relabeled as such, while the obedient bit was renamed `fatefulEncounter`. All relevant constants and functions dealing with the Pokémon data structure were renamed with these changes in mind. --- include/constants/pokemon.h | 18 +++++++++--------- include/global.h | 39 ++++++++++++++++++++++++++++++++++++++- include/pokemon.h | 22 +++++++++++----------- 3 files changed, 58 insertions(+), 21 deletions(-) (limited to 'include') diff --git a/include/constants/pokemon.h b/include/constants/pokemon.h index d4f6e5684..18791e926 100644 --- a/include/constants/pokemon.h +++ b/include/constants/pokemon.h @@ -164,15 +164,15 @@ #define MON_DATA_VICTORY_RIBBON 69 #define MON_DATA_ARTIST_RIBBON 70 #define MON_DATA_EFFORT_RIBBON 71 -#define MON_DATA_GIFT_RIBBON_1 72 -#define MON_DATA_GIFT_RIBBON_2 73 -#define MON_DATA_GIFT_RIBBON_3 74 -#define MON_DATA_GIFT_RIBBON_4 75 -#define MON_DATA_GIFT_RIBBON_5 76 -#define MON_DATA_GIFT_RIBBON_6 77 -#define MON_DATA_GIFT_RIBBON_7 78 -#define MON_DATA_FATEFUL_ENCOUNTER 79 -#define MON_DATA_OBEDIENCE 80 +#define MON_DATA_MARINE_RIBBON 72 +#define MON_DATA_LAND_RIBBON 73 +#define MON_DATA_SKY_RIBBON 74 +#define MON_DATA_COUNTRY_RIBBON 75 +#define MON_DATA_NATIONAL_RIBBON 76 +#define MON_DATA_EARTH_RIBBON 77 +#define MON_DATA_WORLD_RIBBON 78 +#define MON_DATA_FILLER 79 +#define MON_DATA_FATEFUL_ENCOUNTER 80 #define MON_DATA_KNOWN_MOVES 81 #define MON_DATA_RIBBON_COUNT 82 #define MON_DATA_RIBBONS 83 diff --git a/include/global.h b/include/global.h index 9587eb1f3..8eef06e38 100644 --- a/include/global.h +++ b/include/global.h @@ -898,6 +898,41 @@ struct MysteryEventStruct /*0x344 0x3570*/ u32 unk_344[2][5]; }; // 0x36C 0x3598 +// For external event data storage. The majority of these may have never been used. +struct ExternalEventData +{ + u8 unknownExternalDataFields1[7]; // if actually used, may be broken up into different fields. + u32 currentPokeCoupons; // PokéCoupons stored by Pokémon Colosseum and XD from Mt. Battle runs. Earned PokéCoupons are also added to totalEarnedPokeCoupons. + u32 totalEarnedPokeCoupons; // Used by the JP Colosseum bonus disc. Determines PokéCoupon rank to distribute rewards. Unread in International games. + u8 unknownExternalDataFields2[5]; // if actually used, may be broken up into different fields. +} __attribute__((packed)); /*size = 0x14*/ + +// For external event flags. The majority of these may have never been used. +struct ExternalEventFlags +{ + u8 unknownFlag1; + u8 receivedWishmakerJirachi; // may also be used for Ageto Celebi? + u8 unknownFlag3; + u8 unknownFlag4; + u8 unknownFlag5; + u8 unknownFlag6; + u8 unknownFlag7; + u8 unknownFlag8; + u8 unknownFlag9; + u8 unknownFlag10; + u8 unknownFlag11; + u8 unknownFlag12; + u8 unknownFlag13; + u8 unknownFlag14; + u8 unknownFlag15; + u8 unknownFlag16; + u8 unknownFlag17; + u8 unknownFlag18; + u8 unknownFlag19; + u8 unknownFlag20; + +};/*size = 0x14*/ + struct SaveBlock1 { /*0x00*/ struct Coords16 pos; @@ -971,7 +1006,9 @@ struct SaveBlock1 /*0x2e90*/ struct ContestWinner contestWinners[NUM_CONTEST_WINNERS]; // see CONTEST_WINNER_* /*0x3030*/ struct DayCare daycare; /*0x3150*/ struct LinkBattleRecords linkBattleRecords; - /*0x31A8*/ u8 giftRibbons[52]; + /*0x31A8*/ u8 giftRibbons[11]; + /*0x31B3*/ struct ExternalEventData externalEventData; + /*0x31C7*/ struct ExternalEventFlags externalEventFlags; /*0x31DC*/ struct Roamer roamer; /*0x31F8*/ struct EnigmaBerry enigmaBerry; /*0x322C*/ struct MEventBuffers unk_322C; diff --git a/include/pokemon.h b/include/pokemon.h index 654af3031..bec660532 100644 --- a/include/pokemon.h +++ b/include/pokemon.h @@ -65,15 +65,15 @@ struct PokemonSubstruct3 /* 0x0A */ u32 victoryRibbon:1; /* 0x0A */ u32 artistRibbon:1; /* 0x0A */ u32 effortRibbon:1; - /* 0x0A */ u32 giftRibbon1:1; - /* 0x0A */ u32 giftRibbon2:1; - /* 0x0A */ u32 giftRibbon3:1; - /* 0x0A */ u32 giftRibbon4:1; - /* 0x0B */ u32 giftRibbon5:1; - /* 0x0B */ u32 giftRibbon6:1; - /* 0x0B */ u32 giftRibbon7:1; - /* 0x0B */ u32 fatefulEncounter:4; - /* 0x0B */ u32 obedient:1; + /* 0x0A */ u32 marineRibbon:1; //never distributed + /* 0x0A */ u32 landRibbon:1; //never distributed + /* 0x0A */ u32 skyRibbon:1; //never distributed + /* 0x0A */ u32 countryRibbon:1; //distributed during Pokémon Festa '04 and '05 to tournament winners + /* 0x0B */ u32 nationalRibbon:1; + /* 0x0B */ u32 earthRibbon:1; + /* 0x0B */ u32 worldRibbon:1; //distributed during Pokémon Festa '04 and '05 to tournament winners + /* 0x0B */ u32 filler:4; + /* 0x0B */ u32 fatefulEncounter:1; //controls Mew and Deoxys obedience }; union PokemonSubstruct @@ -286,12 +286,12 @@ void CreateBattleTowerMon2(struct Pokemon *mon, struct BattleTowerPokemon *src, void CreateApprenticeMon(struct Pokemon *mon, const struct Apprentice *src, u8 monId); void CreateMonWithEVSpreadNatureOTID(struct Pokemon *mon, u16 species, u8 level, u8 nature, u8 fixedIV, u8 evSpread, u32 otId); void ConvertPokemonToBattleTowerPokemon(struct Pokemon *mon, struct BattleTowerPokemon *dest); -void CreateObedientMon(struct Pokemon *mon, u16 species, u8 level, u8 fixedIV, u8 hasFixedPersonality, u32 fixedPersonality, u8 otIdType, u32 fixedOtId); +void CreateFatefulEncounterMon(struct Pokemon *mon, u16 species, u8 level, u8 fixedIV, u8 hasFixedPersonality, u32 fixedPersonality, u8 otIdType, u32 fixedOtId); bool8 ShouldIgnoreDeoxysForm(u8 caseId, u8 battlerId); void SetDeoxysStats(void); u16 GetUnionRoomTrainerPic(void); u16 GetUnionRoomTrainerClass(void); -void CreateObedientEnemyMon(void); +void CreateFatefulEncounterEnemyMon(void); void CalculateMonStats(struct Pokemon *mon); void BoxMonToMon(const struct BoxPokemon *src, struct Pokemon *dest); u8 GetLevelFromMonExp(struct Pokemon *mon); -- cgit v1.2.3 From 7b2bf8c7e2249f66a04eabdbaeb2a8018855955f Mon Sep 17 00:00:00 2001 From: Deokishisu <6993375+Deokishisu@users.noreply.github.com> Date: Mon, 15 Feb 2021 14:54:35 -0500 Subject: Rename obedient/fatefulEncounter to eventLegal Per discussion on pret, `obedient`/`fatefulEncounter` has been renamed to `eventLegal`, and all related functions and constants have been modified with this in mind. Additionally, fixed some whitespace alignment issues in `script_cmd_table.h`, `pokemon.h`, and `tv.c` from the last commit. --- include/constants/pokemon.h | 16 ++++++++-------- include/pokemon.h | 16 ++++++++-------- 2 files changed, 16 insertions(+), 16 deletions(-) (limited to 'include') diff --git a/include/constants/pokemon.h b/include/constants/pokemon.h index 18791e926..e32ddf496 100644 --- a/include/constants/pokemon.h +++ b/include/constants/pokemon.h @@ -165,14 +165,14 @@ #define MON_DATA_ARTIST_RIBBON 70 #define MON_DATA_EFFORT_RIBBON 71 #define MON_DATA_MARINE_RIBBON 72 -#define MON_DATA_LAND_RIBBON 73 -#define MON_DATA_SKY_RIBBON 74 -#define MON_DATA_COUNTRY_RIBBON 75 -#define MON_DATA_NATIONAL_RIBBON 76 -#define MON_DATA_EARTH_RIBBON 77 -#define MON_DATA_WORLD_RIBBON 78 -#define MON_DATA_FILLER 79 -#define MON_DATA_FATEFUL_ENCOUNTER 80 +#define MON_DATA_LAND_RIBBON 73 +#define MON_DATA_SKY_RIBBON 74 +#define MON_DATA_COUNTRY_RIBBON 75 +#define MON_DATA_NATIONAL_RIBBON 76 +#define MON_DATA_EARTH_RIBBON 77 +#define MON_DATA_WORLD_RIBBON 78 +#define MON_DATA_FILLER 79 +#define MON_DATA_EVENT_LEGAL 80 #define MON_DATA_KNOWN_MOVES 81 #define MON_DATA_RIBBON_COUNT 82 #define MON_DATA_RIBBONS 83 diff --git a/include/pokemon.h b/include/pokemon.h index bec660532..7d6e960d7 100644 --- a/include/pokemon.h +++ b/include/pokemon.h @@ -65,15 +65,15 @@ struct PokemonSubstruct3 /* 0x0A */ u32 victoryRibbon:1; /* 0x0A */ u32 artistRibbon:1; /* 0x0A */ u32 effortRibbon:1; - /* 0x0A */ u32 marineRibbon:1; //never distributed - /* 0x0A */ u32 landRibbon:1; //never distributed - /* 0x0A */ u32 skyRibbon:1; //never distributed - /* 0x0A */ u32 countryRibbon:1; //distributed during Pokémon Festa '04 and '05 to tournament winners + /* 0x0A */ u32 marineRibbon:1; // never distributed + /* 0x0A */ u32 landRibbon:1; // never distributed + /* 0x0A */ u32 skyRibbon:1; // never distributed + /* 0x0A */ u32 countryRibbon:1; // distributed during Pokémon Festa '04 and '05 to tournament winners /* 0x0B */ u32 nationalRibbon:1; /* 0x0B */ u32 earthRibbon:1; - /* 0x0B */ u32 worldRibbon:1; //distributed during Pokémon Festa '04 and '05 to tournament winners + /* 0x0B */ u32 worldRibbon:1; // distributed during Pokémon Festa '04 and '05 to tournament winners /* 0x0B */ u32 filler:4; - /* 0x0B */ u32 fatefulEncounter:1; //controls Mew and Deoxys obedience + /* 0x0B */ u32 eventLegal:1; // controls Mew & Deoxys obedience; if set, Pokémon is a fateful encounter in Gen 4+; set for in-game event island legendaries, some distributed events, and Pokémon from XD: Gale of Darkness. }; union PokemonSubstruct @@ -286,12 +286,12 @@ void CreateBattleTowerMon2(struct Pokemon *mon, struct BattleTowerPokemon *src, void CreateApprenticeMon(struct Pokemon *mon, const struct Apprentice *src, u8 monId); void CreateMonWithEVSpreadNatureOTID(struct Pokemon *mon, u16 species, u8 level, u8 nature, u8 fixedIV, u8 evSpread, u32 otId); void ConvertPokemonToBattleTowerPokemon(struct Pokemon *mon, struct BattleTowerPokemon *dest); -void CreateFatefulEncounterMon(struct Pokemon *mon, u16 species, u8 level, u8 fixedIV, u8 hasFixedPersonality, u32 fixedPersonality, u8 otIdType, u32 fixedOtId); +void CreateEventLegalMon(struct Pokemon *mon, u16 species, u8 level, u8 fixedIV, u8 hasFixedPersonality, u32 fixedPersonality, u8 otIdType, u32 fixedOtId); bool8 ShouldIgnoreDeoxysForm(u8 caseId, u8 battlerId); void SetDeoxysStats(void); u16 GetUnionRoomTrainerPic(void); u16 GetUnionRoomTrainerClass(void); -void CreateFatefulEncounterEnemyMon(void); +void CreateEventLegalEnemyMon(void); void CalculateMonStats(struct Pokemon *mon); void BoxMonToMon(const struct BoxPokemon *src, struct Pokemon *dest); u8 GetLevelFromMonExp(struct Pokemon *mon); -- cgit v1.2.3 From cd89d17b1206f5d5b0c731f30a6c0185078cdd3b Mon Sep 17 00:00:00 2001 From: Deokishisu <6993375+Deokishisu@users.noreply.github.com> Date: Tue, 16 Feb 2021 09:41:07 -0500 Subject: Document More External Events Did research to determine how the Japanese Colosseum Bonus Disc modifies the ExternalEventData fields. The Ageto Celebi flag, as well as the flag for the three PokeCoupon title rewards, have been documented and included into the struct. The PokeCoupon fields are actually 3-byte fields, so they have been turned into bitfields, since u24 isn't possible. Also discovered that Channel and US Colosseum Bonus Disc Jirachi use the same flag, so renamed that flag and commented to explain. Also made general comments explaining how the ExternalEventData and ExternalEventFlags are applicable to Emerald specifically. --- include/global.h | 16 ++++++++++++---- 1 file changed, 12 insertions(+), 4 deletions(-) (limited to 'include') diff --git a/include/global.h b/include/global.h index 5b1a7b44b..f81192ce7 100644 --- a/include/global.h +++ b/include/global.h @@ -899,19 +899,27 @@ struct MysteryEventStruct }; // 0x36C 0x3598 // For external event data storage. The majority of these may have never been used. +// In Emerald, the only known used fields are the PokeCoupon ones, but hacking the distribution discs allows Emerald to receive events and set the others struct ExternalEventData { u8 unknownExternalDataFields1[7]; // if actually used, may be broken up into different fields. - u32 currentPokeCoupons; // PokéCoupons stored by Pokémon Colosseum and XD from Mt. Battle runs. Earned PokéCoupons are also added to totalEarnedPokeCoupons. - u32 totalEarnedPokeCoupons; // Used by the JP Colosseum bonus disc. Determines PokéCoupon rank to distribute rewards. Unread in International games. - u8 unknownExternalDataFields2[5]; // if actually used, may be broken up into different fields. + u32 unknownExternalDataFields2:8; + u32 currentPokeCoupons:24; // PokéCoupons stored by Pokémon Colosseum and XD from Mt. Battle runs. Earned PokéCoupons are also added to totalEarnedPokeCoupons. Colosseum/XD caps this at 9,999,999, but will read up to 16,777,215. + u32 gotGoldPokeCouponTitleReward:1; // PP Max from JP Colosseum Bonus Disc; for reaching 2500 totalEarnedPokeCoupons + u32 gotSilverPokeCouponTitleReward:1; // Light Ball Pikachu from JP Colosseum Bonus Disc; for reaching 5000 totalEarnedPokeCoupons + u32 gotBronzePokeCouponTitleReward:1; // Master Ball from Jp Colosseum Bonus Disc; for reaching 30,000 totalEarnedPokeCoupons + u32 receivedAgetoCelebi:1; // from JP Colosseum Bonus Disc + u32 unknownExternalDataFields3:4; + u32 totalEarnedPokeCoupons:24; // Used by the JP Colosseum bonus disc. Determines PokéCoupon rank to distribute rewards. Unread in International games. Colosseum/XD caps this at 9,999,999. + u8 unknownExternalDataFields4[5]; // if actually used, may be broken up into different fields. } __attribute__((packed)); /*size = 0x14*/ // For external event flags. The majority of these may have never been used. +// In Emerald, Jirachi cannot normally be received, but hacking the distribution discs allows Emerald to receive Jirachi and set the flag struct ExternalEventFlags { u8 unknownFlag1; - u8 receivedWishmakerJirachi; // may also be used for Ageto Celebi? + u8 receivedGCNJirachi; // Both the US Colosseum Bonus Disc and PAL/AUS Pokémon Channel use this field. One cannot receive a WISHMKR Jirachi and CHANNEL Jirachi with the same savefile. u8 unknownFlag3; u8 unknownFlag4; u8 unknownFlag5; -- cgit v1.2.3 From fb60e036ce97d436285eb1401c356df52a73dad2 Mon Sep 17 00:00:00 2001 From: Deokishisu <6993375+Deokishisu@users.noreply.github.com> Date: Tue, 16 Feb 2021 15:37:58 -0500 Subject: Document Box: Ruby & Sapphire Fields MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Labeled another field in the ExternalEventData struct used by Pokémon Box: Ruby & Sapphire. Special thanks to Citrus Bolt#4642. --- include/global.h | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) (limited to 'include') diff --git a/include/global.h b/include/global.h index f81192ce7..72ac97cc1 100644 --- a/include/global.h +++ b/include/global.h @@ -899,7 +899,7 @@ struct MysteryEventStruct }; // 0x36C 0x3598 // For external event data storage. The majority of these may have never been used. -// In Emerald, the only known used fields are the PokeCoupon ones, but hacking the distribution discs allows Emerald to receive events and set the others +// In Emerald, the only known used fields are the PokeCoupon and BoxRS ones, but hacking the distribution discs allows Emerald to receive events and set the others struct ExternalEventData { u8 unknownExternalDataFields1[7]; // if actually used, may be broken up into different fields. @@ -912,7 +912,10 @@ struct ExternalEventData u32 unknownExternalDataFields3:4; u32 totalEarnedPokeCoupons:24; // Used by the JP Colosseum bonus disc. Determines PokéCoupon rank to distribute rewards. Unread in International games. Colosseum/XD caps this at 9,999,999. u8 unknownExternalDataFields4[5]; // if actually used, may be broken up into different fields. -} __attribute__((packed)); /*size = 0x14*/ + u8 usedBoxRS:1; // Set by Pokémon Box: Ruby & Sapphire; denotes whether this save has connected to it and triggered the free False Swipe Swablu Egg giveaway. + u8 boxRSEggsUnlocked:2; // Set by Pokémon Box: Ruby & Sapphire; denotes the number of Eggs unlocked from deposits; 1 for ExtremeSpeed Zigzagoon (at 100 deposited), 2 for Pay Day Skitty (at 500 deposited), 3 for Surf Pichu (at 1500 deposited) + u8 padding:5; +} __attribute__((packed)); /*size = 0x15*/ // For external event flags. The majority of these may have never been used. // In Emerald, Jirachi cannot normally be received, but hacking the distribution discs allows Emerald to receive Jirachi and set the flag -- cgit v1.2.3 From 7f55bf875c881e04765a316cfcc91c4545f0e32e Mon Sep 17 00:00:00 2001 From: Deokishisu <6993375+Deokishisu@users.noreply.github.com> Date: Tue, 16 Feb 2021 16:01:18 -0500 Subject: Move BoxRS Data Down to ExternalEventFlags As suggested, moved the BoxRS data fields into ExternalEventFlags and packed that struct. --- include/global.h | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) (limited to 'include') diff --git a/include/global.h b/include/global.h index 72ac97cc1..d882785d6 100644 --- a/include/global.h +++ b/include/global.h @@ -912,15 +912,15 @@ struct ExternalEventData u32 unknownExternalDataFields3:4; u32 totalEarnedPokeCoupons:24; // Used by the JP Colosseum bonus disc. Determines PokéCoupon rank to distribute rewards. Unread in International games. Colosseum/XD caps this at 9,999,999. u8 unknownExternalDataFields4[5]; // if actually used, may be broken up into different fields. - u8 usedBoxRS:1; // Set by Pokémon Box: Ruby & Sapphire; denotes whether this save has connected to it and triggered the free False Swipe Swablu Egg giveaway. - u8 boxRSEggsUnlocked:2; // Set by Pokémon Box: Ruby & Sapphire; denotes the number of Eggs unlocked from deposits; 1 for ExtremeSpeed Zigzagoon (at 100 deposited), 2 for Pay Day Skitty (at 500 deposited), 3 for Surf Pichu (at 1500 deposited) - u8 padding:5; -} __attribute__((packed)); /*size = 0x15*/ +} __attribute__((packed)); /*size = 0x14*/ // For external event flags. The majority of these may have never been used. // In Emerald, Jirachi cannot normally be received, but hacking the distribution discs allows Emerald to receive Jirachi and set the flag struct ExternalEventFlags { + u8 usedBoxRS:1; // Set by Pokémon Box: Ruby & Sapphire; denotes whether this save has connected to it and triggered the free False Swipe Swablu Egg giveaway. + u8 boxRSEggsUnlocked:2; // Set by Pokémon Box: Ruby & Sapphire; denotes the number of Eggs unlocked from deposits; 1 for ExtremeSpeed Zigzagoon (at 100 deposited), 2 for Pay Day Skitty (at 500 deposited), 3 for Surf Pichu (at 1500 deposited) + u8 padding:5; u8 unknownFlag1; u8 receivedGCNJirachi; // Both the US Colosseum Bonus Disc and PAL/AUS Pokémon Channel use this field. One cannot receive a WISHMKR Jirachi and CHANNEL Jirachi with the same savefile. u8 unknownFlag3; @@ -942,7 +942,7 @@ struct ExternalEventFlags u8 unknownFlag19; u8 unknownFlag20; -};/*size = 0x14*/ +} __attribute__((packed));/*size = 0x15*/ struct SaveBlock1 { -- cgit v1.2.3 From 1dda9939ab86844176bf8b00fd78c4afbea21fae Mon Sep 17 00:00:00 2001 From: Deokishisu <6993375+Deokishisu@users.noreply.github.com> Date: Tue, 16 Feb 2021 16:08:58 -0500 Subject: Fix Swapped Comments on PokeCoupon Tiers --- include/global.h | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'include') diff --git a/include/global.h b/include/global.h index d882785d6..38850d6fa 100644 --- a/include/global.h +++ b/include/global.h @@ -905,9 +905,9 @@ struct ExternalEventData u8 unknownExternalDataFields1[7]; // if actually used, may be broken up into different fields. u32 unknownExternalDataFields2:8; u32 currentPokeCoupons:24; // PokéCoupons stored by Pokémon Colosseum and XD from Mt. Battle runs. Earned PokéCoupons are also added to totalEarnedPokeCoupons. Colosseum/XD caps this at 9,999,999, but will read up to 16,777,215. - u32 gotGoldPokeCouponTitleReward:1; // PP Max from JP Colosseum Bonus Disc; for reaching 2500 totalEarnedPokeCoupons + u32 gotGoldPokeCouponTitleReward:1; // Master Ball from Jp Colosseum Bonus Disc; for reaching 30,000 totalEarnedPokeCoupons u32 gotSilverPokeCouponTitleReward:1; // Light Ball Pikachu from JP Colosseum Bonus Disc; for reaching 5000 totalEarnedPokeCoupons - u32 gotBronzePokeCouponTitleReward:1; // Master Ball from Jp Colosseum Bonus Disc; for reaching 30,000 totalEarnedPokeCoupons + u32 gotBronzePokeCouponTitleReward:1; // PP Max from JP Colosseum Bonus Disc; for reaching 2500 totalEarnedPokeCoupons u32 receivedAgetoCelebi:1; // from JP Colosseum Bonus Disc u32 unknownExternalDataFields3:4; u32 totalEarnedPokeCoupons:24; // Used by the JP Colosseum bonus disc. Determines PokéCoupon rank to distribute rewards. Unread in International games. Colosseum/XD caps this at 9,999,999. -- cgit v1.2.3 From e059c4fdfa0fe36aceac4b283176825ad759fe5d Mon Sep 17 00:00:00 2001 From: GriffinR Date: Wed, 17 Feb 2021 14:11:45 -0500 Subject: Use new gift ribbons size, label unused ribbons --- include/constants/global.h | 1 + include/constants/pokemon.h | 2 +- include/global.h | 6 +++--- include/pokemon.h | 2 +- 4 files changed, 6 insertions(+), 5 deletions(-) (limited to 'include') diff --git a/include/constants/global.h b/include/constants/global.h index ee2fd3abc..d8dad0f45 100644 --- a/include/constants/global.h +++ b/include/constants/global.h @@ -51,6 +51,7 @@ #define MAX_REMATCH_ENTRIES 100 // only REMATCH_TABLE_ENTRIES (78) are used #define NUM_CONTEST_WINNERS 13 #define UNION_ROOM_KB_ROW_COUNT 10 +#define GIFT_RIBBONS_COUNT 11 #define PYRAMID_BAG_ITEMS_COUNT 10 #define HALL_FACILITIES_COUNT 9 // 7 facilities for single mode + tower double mode + tower multi mode. diff --git a/include/constants/pokemon.h b/include/constants/pokemon.h index e32ddf496..3d757bed1 100644 --- a/include/constants/pokemon.h +++ b/include/constants/pokemon.h @@ -171,7 +171,7 @@ #define MON_DATA_NATIONAL_RIBBON 76 #define MON_DATA_EARTH_RIBBON 77 #define MON_DATA_WORLD_RIBBON 78 -#define MON_DATA_FILLER 79 +#define MON_DATA_UNUSED_RIBBONS 79 #define MON_DATA_EVENT_LEGAL 80 #define MON_DATA_KNOWN_MOVES 81 #define MON_DATA_RIBBON_COUNT 82 diff --git a/include/global.h b/include/global.h index 38850d6fa..44df26a9b 100644 --- a/include/global.h +++ b/include/global.h @@ -905,7 +905,7 @@ struct ExternalEventData u8 unknownExternalDataFields1[7]; // if actually used, may be broken up into different fields. u32 unknownExternalDataFields2:8; u32 currentPokeCoupons:24; // PokéCoupons stored by Pokémon Colosseum and XD from Mt. Battle runs. Earned PokéCoupons are also added to totalEarnedPokeCoupons. Colosseum/XD caps this at 9,999,999, but will read up to 16,777,215. - u32 gotGoldPokeCouponTitleReward:1; // Master Ball from Jp Colosseum Bonus Disc; for reaching 30,000 totalEarnedPokeCoupons + u32 gotGoldPokeCouponTitleReward:1; // Master Ball from JP Colosseum Bonus Disc; for reaching 30,000 totalEarnedPokeCoupons u32 gotSilverPokeCouponTitleReward:1; // Light Ball Pikachu from JP Colosseum Bonus Disc; for reaching 5000 totalEarnedPokeCoupons u32 gotBronzePokeCouponTitleReward:1; // PP Max from JP Colosseum Bonus Disc; for reaching 2500 totalEarnedPokeCoupons u32 receivedAgetoCelebi:1; // from JP Colosseum Bonus Disc @@ -919,7 +919,7 @@ struct ExternalEventData struct ExternalEventFlags { u8 usedBoxRS:1; // Set by Pokémon Box: Ruby & Sapphire; denotes whether this save has connected to it and triggered the free False Swipe Swablu Egg giveaway. - u8 boxRSEggsUnlocked:2; // Set by Pokémon Box: Ruby & Sapphire; denotes the number of Eggs unlocked from deposits; 1 for ExtremeSpeed Zigzagoon (at 100 deposited), 2 for Pay Day Skitty (at 500 deposited), 3 for Surf Pichu (at 1500 deposited) + u8 boxRSEggsUnlocked:2; // Set by Pokémon Box: Ruby & Sapphire; denotes the number of Eggs unlocked from deposits; 1 for ExtremeSpeed Zigzagoon (at 100 deposited), 2 for Pay Day Skitty (at 500 deposited), 3 for Surf Pichu (at 1499 deposited) u8 padding:5; u8 unknownFlag1; u8 receivedGCNJirachi; // Both the US Colosseum Bonus Disc and PAL/AUS Pokémon Channel use this field. One cannot receive a WISHMKR Jirachi and CHANNEL Jirachi with the same savefile. @@ -1017,7 +1017,7 @@ struct SaveBlock1 /*0x2e90*/ struct ContestWinner contestWinners[NUM_CONTEST_WINNERS]; // see CONTEST_WINNER_* /*0x3030*/ struct DayCare daycare; /*0x3150*/ struct LinkBattleRecords linkBattleRecords; - /*0x31A8*/ u8 giftRibbons[11]; + /*0x31A8*/ u8 giftRibbons[GIFT_RIBBONS_COUNT]; /*0x31B3*/ struct ExternalEventData externalEventData; /*0x31C7*/ struct ExternalEventFlags externalEventFlags; /*0x31DC*/ struct Roamer roamer; diff --git a/include/pokemon.h b/include/pokemon.h index 7d6e960d7..82cdefeac 100644 --- a/include/pokemon.h +++ b/include/pokemon.h @@ -72,7 +72,7 @@ struct PokemonSubstruct3 /* 0x0B */ u32 nationalRibbon:1; /* 0x0B */ u32 earthRibbon:1; /* 0x0B */ u32 worldRibbon:1; // distributed during Pokémon Festa '04 and '05 to tournament winners - /* 0x0B */ u32 filler:4; + /* 0x0B */ u32 unusedRibbons:4; // discarded in Gen 4 /* 0x0B */ u32 eventLegal:1; // controls Mew & Deoxys obedience; if set, Pokémon is a fateful encounter in Gen 4+; set for in-game event island legendaries, some distributed events, and Pokémon from XD: Gale of Darkness. }; -- cgit v1.2.3 From 02c1fbd733da15e82687ec2d346b8151ca00ccf8 Mon Sep 17 00:00:00 2001 From: GriffinR Date: Thu, 18 Feb 2021 09:59:24 -0500 Subject: Document ribbon TV show, add new ribbon IDs/size --- include/constants/pokemon.h | 49 +++++++++++++++++++++++++++++++++++++++++++++ include/constants/tv.h | 18 +++++++++++++++++ include/event_scripts.h | 32 ++++++++++++++--------------- 3 files changed, 83 insertions(+), 16 deletions(-) (limited to 'include') diff --git a/include/constants/pokemon.h b/include/constants/pokemon.h index 3d757bed1..af603d789 100644 --- a/include/constants/pokemon.h +++ b/include/constants/pokemon.h @@ -182,6 +182,55 @@ #define MON_DATA_SPATK2 87 #define MON_DATA_SPDEF2 88 +// Ribbon IDs used by TV and Pokénav +#define CHAMPION_RIBBON 0 +#define COOL_RIBBON_NORMAL 1 +#define COOL_RIBBON_SUPER 2 +#define COOL_RIBBON_HYPER 3 +#define COOL_RIBBON_MASTER 4 +#define BEAUTY_RIBBON_NORMAL 5 +#define BEAUTY_RIBBON_SUPER 6 +#define BEAUTY_RIBBON_HYPER 7 +#define BEAUTY_RIBBON_MASTER 8 +#define CUTE_RIBBON_NORMAL 9 +#define CUTE_RIBBON_SUPER 10 +#define CUTE_RIBBON_HYPER 11 +#define CUTE_RIBBON_MASTER 12 +#define SMART_RIBBON_NORMAL 13 +#define SMART_RIBBON_SUPER 14 +#define SMART_RIBBON_HYPER 15 +#define SMART_RIBBON_MASTER 16 +#define TOUGH_RIBBON_NORMAL 17 +#define TOUGH_RIBBON_SUPER 18 +#define TOUGH_RIBBON_HYPER 19 +#define TOUGH_RIBBON_MASTER 20 +#define WINNING_RIBBON 21 +#define VICTORY_RIBBON 22 +#define ARTIST_RIBBON 23 +#define EFFORT_RIBBON 24 +#define MARINE_RIBBON 25 +#define LAND_RIBBON 26 +#define SKY_RIBBON 27 +#define COUNTRY_RIBBON 28 +#define NATIONAL_RIBBON 29 +#define EARTH_RIBBON 30 +#define WORLD_RIBBON 31 + +#define FIRST_GIFT_RIBBON MARINE_RIBBON +#define LAST_GIFT_RIBBON WORLD_RIBBON +#define NUM_GIFT_RIBBONS (1 + LAST_GIFT_RIBBON - FIRST_GIFT_RIBBON) + +// The above gift ribbons (Marine - World) are +// special distribution ribbons that correspond to +// 1 bit each in the Pokémon struct. Gen 4 hard-codes +// each of these to the given name. In Gen 3 they're +// used to get an index into giftRibbons in the save block, +// which can have a value 0-64 (0 is 'no ribbon') that +// corresponds to one of the special ribbons listed +// in gGiftRibbonDescriptionPointers. Most of these were +// never distributed +#define MAX_GIFT_RIBBON 64 + #define MIN_LEVEL 1 #define MAX_LEVEL 100 diff --git a/include/constants/tv.h b/include/constants/tv.h index 4b5f9115b..72eae3f1c 100644 --- a/include/constants/tv.h +++ b/include/constants/tv.h @@ -188,4 +188,22 @@ #define CONTESTLIVE_FLAG_LAST_BOTH_ROUNDS (1 << 6) #define CONTESTLIVE_FLAG_NO_APPEALS (1 << 7) +// TV Show states for Spot the Cuties +#define SPOTCUTIES_STATE_INTRO 0 +#define SPOTCUTIES_STATE_RIBBONS_LOW 1 +#define SPOTCUTIES_STATE_RIBBONS_MID 2 +#define SPOTCUTIES_STATE_RIBBONS_HIGH 3 +#define SPOTCUTIES_STATE_RIBBON_INTRO 4 +#define SPOTCUTIES_STATE_RIBBON_CHAMPION 5 +#define SPOTCUTIES_STATE_RIBBON_COOL 6 +#define SPOTCUTIES_STATE_RIBBON_BEAUTY 7 +#define SPOTCUTIES_STATE_RIBBON_CUTE 8 +#define SPOTCUTIES_STATE_RIBBON_SMART 9 +#define SPOTCUTIES_STATE_RIBBON_TOUGH 10 +#define SPOTCUTIES_STATE_RIBBON_WINNING 11 +#define SPOTCUTIES_STATE_RIBBON_VICTORY 12 +#define SPOTCUTIES_STATE_RIBBON_ARTIST 13 +#define SPOTCUTIES_STATE_RIBBON_EFFORT 14 +#define SPOTCUTIES_STATE_OUTRO 15 + #endif //GUARD_CONSTANTS_TV_H diff --git a/include/event_scripts.h b/include/event_scripts.h index 199686655..79ef0ea14 100644 --- a/include/event_scripts.h +++ b/include/event_scripts.h @@ -196,22 +196,22 @@ extern const u8 gTVTrainerFanClubText08[]; extern const u8 gTVTrainerFanClubText09[]; extern const u8 gTVTrainerFanClubText10[]; extern const u8 gTVTrainerFanClubText11[]; -extern const u8 gTVCutiesText00[]; -extern const u8 gTVCutiesText01[]; -extern const u8 gTVCutiesText02[]; -extern const u8 gTVCutiesText03[]; -extern const u8 gTVCutiesText04[]; -extern const u8 gTVCutiesText05[]; -extern const u8 gTVCutiesText06[]; -extern const u8 gTVCutiesText07[]; -extern const u8 gTVCutiesText08[]; -extern const u8 gTVCutiesText09[]; -extern const u8 gTVCutiesText10[]; -extern const u8 gTVCutiesText11[]; -extern const u8 gTVCutiesText12[]; -extern const u8 gTVCutiesText13[]; -extern const u8 gTVCutiesText14[]; -extern const u8 gTVCutiesText15[]; +extern const u8 TVSpotTheCuties_Text_Intro[]; +extern const u8 TVSpotTheCuties_Text_RibbonsLow[]; +extern const u8 TVSpotTheCuties_Text_RibbonsMid[]; +extern const u8 TVSpotTheCuties_Text_RibbonsHigh[]; +extern const u8 TVSpotTheCuties_Text_RibbonIntro[]; +extern const u8 TVSpotTheCuties_Text_RibbonChampion[]; +extern const u8 TVSpotTheCuties_Text_RibbonCool[]; +extern const u8 TVSpotTheCuties_Text_RibbonBeauty[]; +extern const u8 TVSpotTheCuties_Text_RibbonCute[]; +extern const u8 TVSpotTheCuties_Text_RibbonSmart[]; +extern const u8 TVSpotTheCuties_Text_RibbonTough[]; +extern const u8 TVSpotTheCuties_Text_RibbonWinning[]; +extern const u8 TVSpotTheCuties_Text_RibbonVictory[]; +extern const u8 TVSpotTheCuties_Text_RibbonArtist[]; +extern const u8 TVSpotTheCuties_Text_RibbonEffort[]; +extern const u8 TVSpotTheCuties_Text_Outro[]; extern const u8 gTVPokemonNewsBattleFrontierText00[]; extern const u8 gTVPokemonNewsBattleFrontierText01[]; extern const u8 gTVPokemonNewsBattleFrontierText02[]; -- cgit v1.2.3 From d62f89b20cb0f503f7063a4cd81459b9dac7166d Mon Sep 17 00:00:00 2001 From: GriffinR Date: Thu, 18 Feb 2021 10:00:07 -0500 Subject: Minor window/bg cleanup --- include/gba/defines.h | 2 ++ 1 file changed, 2 insertions(+) (limited to 'include') diff --git a/include/gba/defines.h b/include/gba/defines.h index 2df9a3feb..78c688593 100644 --- a/include/gba/defines.h +++ b/include/gba/defines.h @@ -50,6 +50,8 @@ #define BG_TILE_H_FLIP(n) (0x400 + (n)) #define BG_TILE_V_FLIP(n) (0x800 + (n)) +#define NUM_BACKGROUNDS 4 + // text-mode BG #define OBJ_VRAM0 (VRAM + 0x10000) #define OBJ_VRAM0_SIZE 0x8000 -- cgit v1.2.3 From 64fc585cc3a5ac830d4de8e921d4833ad0cc8136 Mon Sep 17 00:00:00 2001 From: GriffinR Date: Thu, 18 Feb 2021 10:00:27 -0500 Subject: Document pokenav ribbons summary screen --- include/graphics.h | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'include') diff --git a/include/graphics.h b/include/graphics.h index d3d01bc57..bade0b0a7 100644 --- a/include/graphics.h +++ b/include/graphics.h @@ -4033,9 +4033,9 @@ extern const u32 gPokenavLeftHeaderBeauty_Gfx[]; extern const u32 gPokenavLeftHeaderCute_Gfx[]; extern const u32 gPokenavLeftHeaderSmart_Gfx[]; extern const u32 gPokenavLeftHeaderTough_Gfx[]; -extern const u16 gUnknown_08DDE010[]; -extern const u32 gUnknown_08DDE030[]; -extern const u32 gUnknown_08DDE12C[]; +extern const u16 gPokenavRibbonsSummaryBg_Pal[]; +extern const u32 gPokenavRibbonsSummaryBg_Gfx[]; +extern const u32 gPokenavRibbonsSummaryBg_Tilemap[]; extern const u32 gPageInfoTilemap[]; extern const u32 gUnknown_08D98CC8[]; -- cgit v1.2.3 From 381116b3c4962b7b33a3cd2ebef24aaec7f41caf Mon Sep 17 00:00:00 2001 From: SphericalIce Date: Mon, 22 Feb 2021 15:29:14 +0000 Subject: Add labels for cracked floor metatiles --- include/constants/metatile_labels.h | 3 +++ 1 file changed, 3 insertions(+) (limited to 'include') diff --git a/include/constants/metatile_labels.h b/include/constants/metatile_labels.h index f7405f46a..836ab6ef2 100644 --- a/include/constants/metatile_labels.h +++ b/include/constants/metatile_labels.h @@ -165,6 +165,8 @@ // gTileset_Cave #define METATILE_Cave_EntranceCover 0x229 +#define METATILE_Cave_CrackedFloor_Hole 0x206 +#define METATILE_Cave_CrackedFloor 0x22F #define METATILE_Cave_SealedChamberEntrance_TopLeft 0x22A #define METATILE_Cave_SealedChamberEntrance_TopMid 0x22B #define METATILE_Cave_SealedChamberEntrance_TopRight 0x22C @@ -191,6 +193,7 @@ #define METATILE_Pacifidlog_HalfSubmergedLogs_Vertical1 0x261 #define METATILE_Pacifidlog_SubmergedLogs_Vertical0 0x25A #define METATILE_Pacifidlog_SubmergedLogs_Vertical1 0x262 +#define METATILE_Pacifidlog_SkyPillar_CrackedFloor_Hole 0x237 #define METATILE_Pacifidlog_SkyPillar_DoorOpen_Top 0x2AA #define METATILE_Pacifidlog_SkyPillar_DoorOpen_Bottom 0x2B2 -- cgit v1.2.3 From e52b46ab43d50b02734d1b1b9eeeccdc8daf9789 Mon Sep 17 00:00:00 2001 From: GriffinR Date: Fri, 19 Feb 2021 18:52:24 -0500 Subject: Clean up script.c --- include/script.h | 2 -- 1 file changed, 2 deletions(-) (limited to 'include') diff --git a/include/script.h b/include/script.h index f9fb09b5d..63f6f5aef 100644 --- a/include/script.h +++ b/include/script.h @@ -26,8 +26,6 @@ u8 SetupBytecodeScript(struct ScriptContext *ctx, const u8 *ptr); void SetupNativeScript(struct ScriptContext *ctx, bool8 (*ptr)(void)); void StopScript(struct ScriptContext *ctx); bool8 RunScriptCommand(struct ScriptContext *ctx); -u8 ScriptPush(struct ScriptContext *ctx, const u8 *ptr); -const u8 *ScriptPop(struct ScriptContext *ctx); void ScriptJump(struct ScriptContext *ctx, const u8 *ptr); void ScriptCall(struct ScriptContext *ctx, const u8 *ptr); void ScriptReturn(struct ScriptContext *ctx); -- cgit v1.2.3 From a5852d57d124c49fd1b80510e968c18404a436a3 Mon Sep 17 00:00:00 2001 From: GriffinR Date: Fri, 19 Feb 2021 23:22:26 -0500 Subject: Use TASK_NONE constant --- include/player_pc.h | 2 +- include/task.h | 1 + 2 files changed, 2 insertions(+), 1 deletion(-) (limited to 'include') diff --git a/include/player_pc.h b/include/player_pc.h index 219c11440..bdf4a4e0e 100644 --- a/include/player_pc.h +++ b/include/player_pc.h @@ -73,7 +73,7 @@ struct PlayerPCItemPageStruct u8 pageItems; u8 count; u8 filler[3]; - u8 scrollIndicatorId; + u8 scrollIndicatorTaskId; }; // Exported type declarations diff --git a/include/task.h b/include/task.h index d0ca34f7f..9d1ee42c4 100644 --- a/include/task.h +++ b/include/task.h @@ -3,6 +3,7 @@ #define HEAD_SENTINEL 0xFE #define TAIL_SENTINEL 0xFF +#define TASK_NONE TAIL_SENTINEL #define NUM_TASKS 16 #define NUM_TASK_DATA 16 -- cgit v1.2.3 From 1cac608dbedeaaccd2446891c38a71f10230bfc0 Mon Sep 17 00:00:00 2001 From: GriffinR Date: Sat, 20 Feb 2021 15:15:38 -0500 Subject: Document mail --- include/constants/items.h | 4 +++- include/constants/pokemon.h | 2 -- include/graphics.h | 38 +++++++++++++++++++++++++++++++++++++ include/international_string_util.h | 4 ++-- include/pokemon_icon.h | 6 +++--- 5 files changed, 46 insertions(+), 8 deletions(-) (limited to 'include') diff --git a/include/constants/items.h b/include/constants/items.h index 71338da8e..8f77e80de 100644 --- a/include/constants/items.h +++ b/include/constants/items.h @@ -495,7 +495,9 @@ #define NUM_ROUTE_114_MAN_BERRIES (LAST_ROUTE_114_MAN_BERRY - FIRST_ROUTE_114_MAN_BERRY + 1) #define NUM_ROUTE_114_MAN_BERRIES_SKIPPED (FIRST_ROUTE_114_MAN_BERRY - FIRST_BERRY_INDEX) -#define ITEM_TO_BERRY(itemId)(((itemId - FIRST_BERRY_INDEX) + 1)) +#define ITEM_TO_BERRY(itemId)(((itemId) - FIRST_BERRY_INDEX) + 1) +#define ITEM_TO_MAIL(itemId)((itemId) - FIRST_MAIL_INDEX) +#define MAIL_NONE 0xFF #define NUM_TECHNICAL_MACHINES 50 #define NUM_HIDDEN_MACHINES 8 diff --git a/include/constants/pokemon.h b/include/constants/pokemon.h index a0bb2c7ce..11a7c7fc5 100644 --- a/include/constants/pokemon.h +++ b/include/constants/pokemon.h @@ -288,8 +288,6 @@ #define MAX_TOTAL_EVS 510 #define EV_ITEM_RAISE_LIMIT 100 -#define UNOWN_FORM_COUNT 28 - // Battle move flags #define FLAG_MAKES_CONTACT (1 << 0) #define FLAG_PROTECT_AFFECTED (1 << 1) diff --git a/include/graphics.h b/include/graphics.h index bade0b0a7..a78498d16 100644 --- a/include/graphics.h +++ b/include/graphics.h @@ -5025,4 +5025,42 @@ extern const u16 gObjectEventPal_May[]; extern const u16 gObjectEventPal_RubySapphireBrendan[]; extern const u16 gObjectEventPal_RubySapphireMay[]; +// Mail +extern const u16 gMailPalette_Orange[]; +extern const u16 gMailPalette_Harbor[]; +extern const u16 gMailPalette_Glitter[]; +extern const u16 gMailPalette_Mech[]; +extern const u16 gMailPalette_Wood[]; +extern const u16 gMailPalette_Wave[]; +extern const u16 gMailPalette_Bead[]; +extern const u16 gMailPalette_Shadow[]; +extern const u16 gMailPalette_Tropic[]; +extern const u16 gMailPalette_Dream[]; +extern const u16 gMailPalette_Fab[]; +extern const u16 gMailPalette_Retro[]; +extern const u8 gMailTiles_Orange[]; +extern const u8 gMailTilemap_Orange[]; +extern const u8 gMailTiles_Harbor[]; +extern const u8 gMailTilemap_Harbor[]; +extern const u8 gMailTiles_Glitter[]; +extern const u8 gMailTilemap_Glitter[]; +extern const u8 gMailTiles_Mech[]; +extern const u8 gMailTilemap_Mech[]; +extern const u8 gMailTiles_Wood[]; +extern const u8 gMailTilemap_Wood[]; +extern const u8 gMailTiles_Wave[]; +extern const u8 gMailTilemap_Wave[]; +extern const u8 gMailTiles_Bead[]; +extern const u8 gMailTilemap_Bead[]; +extern const u8 gMailTiles_Shadow[]; +extern const u8 gMailTilemap_Shadow[]; +extern const u8 gMailTiles_Tropic[]; +extern const u8 gMailTilemap_Tropic[]; +extern const u8 gMailTiles_Dream[]; +extern const u8 gMailTilemap_Dream[]; +extern const u8 gMailTiles_Fab[]; +extern const u8 gMailTilemap_Fab[]; +extern const u8 gMailTiles_Retro[]; +extern const u8 gMailTilemap_Retro[]; + #endif //GUARD_GRAPHICS_H diff --git a/include/international_string_util.h b/include/international_string_util.h index cf3c5f723..f76fc5be1 100644 --- a/include/international_string_util.h +++ b/include/international_string_util.h @@ -4,7 +4,7 @@ #include "menu.h" #include "list_menu.h" -void sub_81DB52C(u8 *src); +void ConvertInternationalPlayerName(u8 *src); void TVShowConvertInternationalString(u8 *dest, const u8 *src, int language); int GetStringCenterAlignXOffset(int fontId, const u8 *str, int totalWidth); int GetStringRightAlignXOffset(int fontId, const u8 *str, int totalWidth); @@ -16,7 +16,7 @@ int Intl_GetListMenuWidth(const struct ListMenuTemplate *listMenu); void CopyMonCategoryText(int dexNum, u8 *dest); u8 *sub_81DB494(u8 *str, int fontId, const u8 *str2, int totalStringWidth); void PadNameString(u8 *dest, u8 padChar); -void sub_81DB554(u8 *, u8); +void ConvertInternationalPlayerNameStripChar(u8 *, u8); void sub_81DB5AC(u8 *); int sub_81DB604(u8 *); void sub_81DB620(int windowId, int columnStart, int rowStart, int numFillTiles, int numRows); diff --git a/include/pokemon_icon.h b/include/pokemon_icon.h index dbd7f2895..c0f823bb1 100644 --- a/include/pokemon_icon.h +++ b/include/pokemon_icon.h @@ -10,14 +10,14 @@ const u8 *GetMonIconPtr(u16 speciesId, u32 personality, u32 frameNo); const u16 *GetValidMonIconPalettePtr(u16 speciesId); u16 GetIconSpecies(u16 species, u32 personality); u16 GetUnownLetterByPersonality(u32 personality); -u16 sub_80D2E84(u16 speciesId); +u16 GetIconSpeciesNoPersonality(u16 speciesId); void LoadMonIconPalettes(void); void LoadMonIconPalette(u16 species); void FreeMonIconPalettes(void); -u8 sub_80D2D78(u16 species, void (*callback)(struct Sprite *), s16 x, s16 y, u8 subpriority, bool32 extra); +u8 CreateMonIconNoPersonality(u16 species, void (*callback)(struct Sprite *), s16 x, s16 y, u8 subpriority, bool32 handleDeoxys); void FreeMonIconPalette(u16 species); void FreeAndDestroyMonIconSprite(struct Sprite *sprite); -u8 CreateMonIcon(u16 species, void (*callback)(struct Sprite *), s16 x, s16 y, u8 subpriority, u32 personality, bool32 extra); +u8 CreateMonIcon(u16 species, void (*callback)(struct Sprite *), s16 x, s16 y, u8 subpriority, u32 personality, bool32 handleDeoxys); u8 UpdateMonIconFrame(struct Sprite *sprite); void LoadMonIconPalette(u16 species); void sub_80D328C(struct Sprite *sprite); -- cgit v1.2.3 From c6141fea831a30a0d2de24b3c02375a01014ec97 Mon Sep 17 00:00:00 2001 From: GriffinR Date: Mon, 22 Feb 2021 12:12:35 -0500 Subject: Document easy chat --- include/constants/easy_chat.h | 61 ++++++++++++++----------- include/constants/global.h | 1 + include/dewford_trend.h | 2 +- include/easy_chat.h | 102 +++++++++++++++++++++--------------------- include/global.h | 2 +- include/graphics.h | 8 ++-- include/mevent.h | 4 +- 7 files changed, 95 insertions(+), 85 deletions(-) (limited to 'include') diff --git a/include/constants/easy_chat.h b/include/constants/easy_chat.h index 8e82cfef0..069f17fcb 100644 --- a/include/constants/easy_chat.h +++ b/include/constants/easy_chat.h @@ -28,29 +28,29 @@ #define EASY_CHAT_PERSON_BOY 2 #define EASY_CHAT_PERSON_DISPLAY_NONE 3 -#define EC_GROUP_POKEMON 0x0 -#define EC_GROUP_TRAINER 0x1 -#define EC_GROUP_STATUS 0x2 -#define EC_GROUP_BATTLE 0x3 -#define EC_GROUP_GREETINGS 0x4 -#define EC_GROUP_PEOPLE 0x5 -#define EC_GROUP_VOICES 0x6 -#define EC_GROUP_SPEECH 0x7 -#define EC_GROUP_ENDINGS 0x8 -#define EC_GROUP_FEELINGS 0x9 -#define EC_GROUP_CONDITIONS 0xa -#define EC_GROUP_ACTIONS 0xb -#define EC_GROUP_LIFESTYLE 0xc -#define EC_GROUP_HOBBIES 0xd -#define EC_GROUP_TIME 0xe -#define EC_GROUP_MISC 0xf -#define EC_GROUP_ADJECTIVES 0x10 -#define EC_GROUP_EVENTS 0x11 -#define EC_GROUP_MOVE_1 0x12 -#define EC_GROUP_MOVE_2 0x13 -#define EC_GROUP_TRENDY_SAYING 0x14 -#define EC_GROUP_POKEMON_2 0x15 -#define EC_NUM_GROUPS 0x16 +#define EC_GROUP_POKEMON 0 +#define EC_GROUP_TRAINER 1 +#define EC_GROUP_STATUS 2 +#define EC_GROUP_BATTLE 3 +#define EC_GROUP_GREETINGS 4 +#define EC_GROUP_PEOPLE 5 +#define EC_GROUP_VOICES 6 +#define EC_GROUP_SPEECH 7 +#define EC_GROUP_ENDINGS 8 +#define EC_GROUP_FEELINGS 9 +#define EC_GROUP_CONDITIONS 10 +#define EC_GROUP_ACTIONS 11 +#define EC_GROUP_LIFESTYLE 12 +#define EC_GROUP_HOBBIES 13 +#define EC_GROUP_TIME 14 +#define EC_GROUP_MISC 15 +#define EC_GROUP_ADJECTIVES 16 +#define EC_GROUP_EVENTS 17 +#define EC_GROUP_MOVE_1 18 +#define EC_GROUP_MOVE_2 19 +#define EC_GROUP_TRENDY_SAYING 20 +#define EC_GROUP_POKEMON_NATIONAL 21 +#define EC_NUM_GROUPS 22 // TRAINER #define EC_WORD_I_CHOOSE_YOU (EC_GROUP_TRAINER << 9) | 0x0 @@ -1105,13 +1105,22 @@ #define PHRASE_COOL_LATIOS 4 #define PHRASE_SUPER_HUSTLE 5 +#define EC_NUM_ALPHABET_GROUPS 27 // 26 (1 for each letter) + 1 (Others) + +#define EC_MAX_WORDS_IN_GROUP 270 // The closest is words by letter S, at 262 + +#define EC_MASK_GROUP 0x7F +#define EC_MASK_INDEX 0x1FF + #define EC_POKEMON(mon) ((EC_GROUP_POKEMON << 9) | SPECIES_##mon) -#define EC_POKEMON2(mon) ((EC_GROUP_POKEMON_2 << 9) | SPECIES_##mon) +#define EC_POKEMON_NATIONAL(mon) ((EC_GROUP_POKEMON_NATIONAL << 9) | SPECIES_##mon) #define EC_MOVE(move) ((EC_GROUP_MOVE_1 << 9) | MOVE_##move) #define EC_MOVE2(move) ((EC_GROUP_MOVE_2 << 9) | MOVE_##move) #define EC_GROUP(word) ((word) >> 9) -#define EC_INDEX(word) ((word) & 0x1FF) -#define EC_WORD(group, index) ((((group) & 0x7F) << 9) | ((index) & 0x1FF)) +#define EC_INDEX(word) ((word) & EC_MASK_INDEX) +#define EC_WORD(group, index) ((((group) & EC_MASK_GROUP) << 9) | ((index) & EC_MASK_INDEX)) + +#define EC_EMPTY_WORD 0xFFFF #endif // GUARD_CONSTANTS_EASY_CHAT_H diff --git a/include/constants/global.h b/include/constants/global.h index d8dad0f45..213ccca5b 100644 --- a/include/constants/global.h +++ b/include/constants/global.h @@ -84,6 +84,7 @@ #define MAIL_WORDS_COUNT 9 #define EASY_CHAT_BATTLE_WORDS_COUNT 6 #define MOVE_NAME_LENGTH 12 +#define NUM_QUESTIONNAIRE_WORDS 4 #define MALE 0 #define FEMALE 1 diff --git a/include/dewford_trend.h b/include/dewford_trend.h index bdb0fc95c..a7ed006f0 100644 --- a/include/dewford_trend.h +++ b/include/dewford_trend.h @@ -4,7 +4,7 @@ void InitDewfordTrend(void); void UpdateDewfordTrendPerDay(u16); void UpdateDewfordTrendPerDay(u16 days); -bool8 sub_81226D8(u16 *a); +bool8 IsPhraseTrendy(u16 *a); void ReceiveEasyChatPairsData(struct EasyChatPair *a, size_t b, u8 unused); diff --git a/include/easy_chat.h b/include/easy_chat.h index 2fa7f7b3e..4d2bc7c98 100644 --- a/include/easy_chat.h +++ b/include/easy_chat.h @@ -24,55 +24,55 @@ struct EasyChatScreen /*0x01*/ u8 templateId; /*0x02*/ u8 numColumns; /*0x03*/ u8 numRows; - /*0x04*/ u8 state; + /*0x04*/ u8 inputState; /*0x05*/ s8 mainCursorColumn; /*0x06*/ s8 mainCursorRow; - /*0x07*/ u8 unk_07; - /*0x08*/ u8 stateBackup; - /*0x09*/ u8 unk_09; - /*0x0A*/ s8 unk_0a; - /*0x0B*/ s8 unk_0b; - /*0x0C*/ u8 unk_0c; - /*0x0D*/ u8 unk_0d; - /*0x0E*/ u8 unk_0e; - /*0x0F*/ u8 unk_0f; - /*0x10*/ s8 unk_10; - /*0x11*/ s8 unk_11; + /*0x07*/ u8 maxWords; + /*0x08*/ u8 inputStateBackup; + /*0x09*/ bool8 inAlphabetMode; + /*0x0A*/ s8 keyboardColumn; + /*0x0B*/ s8 keyboardRow; + /*0x0C*/ u8 keyboardScrollOffset; + /*0x0D*/ u8 keyboardLastRow; + /*0x0E*/ u8 wordSelectScrollOffset; + /*0x0F*/ u8 wordSelectLastRow; + /*0x10*/ s8 wordSelectColumn; + /*0x11*/ s8 wordSelectRow; /*0x12*/ u8 displayedPersonType; - /*0x13*/ u8 unk_13; - /*0x14*/ u8 unk_14[0x20]; + /*0x13*/ u8 unused; // Set to 0, never read + /*0x14*/ u8 quizTitle[32]; /*0x34*/ const u8 *titleText; - /*0x38*/ u16 *words; - /*0x3C*/ u16 ecWordBuffer[9]; + /*0x38*/ u16 *savedPhrase; + /*0x3C*/ u16 currentPhrase[9]; }; -struct Unk203A11C +struct EasyChatScreenControl { - u16 unk0; + u16 funcState; u16 windowId; - u16 unk4; - u8 unk6; - u8 unk7; - s8 unk8; - u8 unk9; - u8 unkA; - u8 unkB[0xC1]; - u8 unkCC[0x202]; - u16 unk2CE; - int unk2D0; - int unk2D4; - struct Sprite *unk2D8; - struct Sprite *unk2DC; - struct Sprite *unk2E0; - struct Sprite *unk2E4; - struct Sprite *unk2E8; - struct Sprite *unk2EC; - struct Sprite *unk2F0; - struct Sprite *unk2F4; - struct Sprite *unk2F8; - struct Sprite *unk2FC; - u16 unk300[BG_SCREEN_SIZE / 2]; - u16 unkB00[BG_SCREEN_SIZE / 2]; + u16 currentFuncId; + u8 curWindowAnimState; + u8 destWindowAnimState; + s8 windowAnimStateDir; + u8 modeWindowState; + bool8 fourFooterOptions; // Never read (template is used directly instead) + u8 phrasePrintBuffer[193]; + u8 wordSelectPrintBuffer[514]; + u16 scrollOffset; + int scrollDest; + int scrollSpeed; + struct Sprite *mainCursorSprite; + struct Sprite *rectangleCursorSpriteRight; + struct Sprite *rectangleCursorSpriteLeft; + struct Sprite *wordSelectCursorSprite; + struct Sprite *buttonWindowSprite; + struct Sprite *modeWindowSprite; + struct Sprite *scrollIndicatorUpSprite; + struct Sprite *scrollIndicatorDownSprite; + struct Sprite *startButtonSprite; + struct Sprite *selectButtonSprite; + u16 bg1TilemapBuffer[BG_SCREEN_SIZE / 2]; + u16 bg3TilemapBuffer[BG_SCREEN_SIZE / 2]; }; struct EasyChatPhraseFrameDimensions @@ -104,15 +104,15 @@ struct EasyChatGroup u16 numEnabledWords; }; -struct Unk203A120 +struct EasyChatScreenWordData { - u16 unk0; - u16 unk2[EC_NUM_GROUPS]; - u16 unk2E[27]; - u16 unk64[27][270]; - u8 filler3958[0x2C]; - u16 unk3984[0x10E]; - u16 unk3BA0; + u16 numUnlockedGroups; + u16 unlockedGroupIds[EC_NUM_GROUPS]; + u16 numUnlockedAlphabetWords[EC_NUM_ALPHABET_GROUPS]; + u16 unlockedAlphabetWords[EC_NUM_ALPHABET_GROUPS][EC_MAX_WORDS_IN_GROUP]; + u8 unused[44]; + u16 selectedGroupWords[EC_MAX_WORDS_IN_GROUP]; + u16 numSelectedGroupWords; }; /*size = 0x3BA4*/ struct EasyChatWordsByLetter @@ -124,7 +124,7 @@ struct EasyChatWordsByLetter void InitEasyChatPhrases(void); void ShowEasyChatScreen(void); u8 * CopyEasyChatWord(u8 *dest, u16 word); -bool32 sub_811F8D8(int word); +bool32 IsEasyChatAnswerUnlocked(int word); void InitializeEasyChatWordArray(u16 *words, u16 length); u8 *ConvertEasyChatWordsToString(u8 *dest, const u16 *src, u16 columns, u16 rows); bool8 IsBardWordInvalid(u16 word); @@ -133,7 +133,7 @@ u16 GetNewHipsterPhraseToTeach(void); u16 EasyChat_GetNumWordsInGroup(u8); u16 GetRandomEasyChatWordFromUnlockedGroup(u16); void DoEasyChatScreen(u8 type, u16 *words, MainCallback callback, u8 displayedPersonType); -void sub_811F8BC(void); +void InitQuestionnaireWords(void); void UnlockAdditionalPhrase(u8 additionalPhraseId); #endif // GUARD_EASYCHAT_H diff --git a/include/global.h b/include/global.h index 44df26a9b..3d3ea0229 100644 --- a/include/global.h +++ b/include/global.h @@ -893,7 +893,7 @@ struct MysteryEventStruct /*0x000 0x322C*/ struct WonderNewsSaveStruct wonderNews; /*0x1c0 0x33EC*/ struct WonderCardSaveStruct wonderCard; /*0x310 0x353C*/ struct MEventBuffer_3430 buffer_310; - /*0x338 0x3564*/ u16 unk_338[4]; + /*0x338 0x3564*/ u16 questionnaireWords[NUM_QUESTIONNAIRE_WORDS]; /*0x340 0x356C*/ struct MysteryEventStruct unk_340; /*0x344 0x3570*/ u32 unk_344[2][5]; }; // 0x36C 0x3598 diff --git a/include/graphics.h b/include/graphics.h index a78498d16..c0bd13e5b 100644 --- a/include/graphics.h +++ b/include/graphics.h @@ -4977,10 +4977,10 @@ extern const u32 gEasyChatWindow_Gfx[]; extern const u32 gEasyChatWindow_Tilemap[]; extern const u32 gEasyChatMode_Gfx[]; extern const u16 gEasyChatMode_Pal[]; -extern const u32 gEasyChatCursor_Gfx[]; -extern const u16 gEasyChatCursor_Pal[]; -extern const u32 gEasyChatRightWindow_Gfx[]; -extern const u16 gEasyChatRightWindow_Pal[]; +extern const u32 gEasyChatRectangleCursor_Gfx[]; +extern const u16 gEasyChatRectangleCursor_Pal[]; +extern const u32 gEasyChatButtonWindow_Gfx[]; +extern const u16 gEasyChatButtonWindow_Pal[]; // Use Pokeblock extern const u32 gUsePokeblockCondition_Gfx[]; diff --git a/include/mevent.h b/include/mevent.h index 8c0ebbad7..4b7d39b0c 100755 --- a/include/mevent.h +++ b/include/mevent.h @@ -21,7 +21,7 @@ struct MEventStruct_Unk1442CC u16 unk_0C; u32 unk_10; u16 unk_14; - u16 unk_16[4]; + u16 unk_16[NUM_QUESTIONNAIRE_WORDS]; struct MEventBuffer_3430_Sub unk_20; u8 unk_44; u8 unk_45[7]; @@ -36,7 +36,7 @@ struct WonderNews *GetSavedWonderNews(void); struct WonderCard *GetSavedWonderCard(void); struct MEventBuffer_3430_Sub *sav1_get_mevent_buffer_2(void); struct MysteryEventStruct *sub_801B044(void); -u16 *sub_801B058(void); +u16 *GetQuestionnaireWordsPtr(void); void DestroyWonderNews(void); bool32 sub_801B078(const struct WonderNews *src); bool32 ValidateReceivedWonderNews(void); -- cgit v1.2.3 From b71b10623b31065a9a29b43938cf602087bcfc73 Mon Sep 17 00:00:00 2001 From: GriffinR Date: Wed, 24 Feb 2021 11:01:02 -0500 Subject: Add palette selection constants --- include/palette.h | 4 ++++ 1 file changed, 4 insertions(+) (limited to 'include') diff --git a/include/palette.h b/include/palette.h index f874bcd74..072edef56 100644 --- a/include/palette.h +++ b/include/palette.h @@ -14,6 +14,10 @@ #define PALETTE_FADE_STATUS_DONE 0 #define PALETTE_FADE_STATUS_LOADING 0xFF +#define PALETTES_BG 0x0000FFFF +#define PALETTES_OBJECTS 0xFFFF0000 +#define PALETTES_ALL (PALETTES_BG | PALETTES_OBJECTS) + enum { FAST_FADE_IN_FROM_WHITE, -- cgit v1.2.3 From f172ff84c9892f9d2648158d96f4942846e8dcaf Mon Sep 17 00:00:00 2001 From: GriffinR Date: Wed, 24 Feb 2021 14:53:32 -0500 Subject: Clean up save_failed_screen --- include/save.h | 5 +++++ 1 file changed, 5 insertions(+) (limited to 'include') diff --git a/include/save.h b/include/save.h index 18b57502b..948530406 100644 --- a/include/save.h +++ b/include/save.h @@ -29,6 +29,11 @@ struct SaveSectionOffsets u16 size; }; +// Each 4 KiB flash sector contains 3968 bytes of actual data followed by a 128 byte footer +#define SECTOR_DATA_SIZE 3968 +#define SECTOR_FOOTER_SIZE 128 +#define SECTOR_SIZE (SECTOR_DATA_SIZE + SECTOR_FOOTER_SIZE) + // Emerald changes this definition to be the sectors per slot. #define NUM_SECTORS_PER_SLOT 16 -- cgit v1.2.3 From 117b90a2610438df4c3f8b72d2fe9147f34dc2a4 Mon Sep 17 00:00:00 2001 From: GriffinR Date: Thu, 25 Feb 2021 04:37:25 -0500 Subject: Document pokemon jump --- include/global.h | 10 +++++----- include/pokemon_jump.h | 4 ++-- 2 files changed, 7 insertions(+), 7 deletions(-) (limited to 'include') diff --git a/include/global.h b/include/global.h index 44df26a9b..ec625d3bf 100644 --- a/include/global.h +++ b/include/global.h @@ -175,13 +175,13 @@ struct Pokedex /*0x44*/ u8 seen[DEX_FLAGS_NO]; }; -struct PokemonJumpResults +struct PokemonJumpRecords { u16 jumpsInRow; - u16 field2; + u16 unused1; // Set to 0, never read u16 excellentsInRow; - u16 field6; - u32 field8; + u16 gamesWithMaxPlayers; + u32 unused2; // Set to 0, never read u32 bestJumpScore; }; @@ -478,7 +478,7 @@ struct SaveBlock2 /*0xB0*/ struct PlayersApprentice playerApprentice; /*0xDC*/ struct Apprentice apprentices[APPRENTICE_COUNT]; /*0x1EC*/ struct BerryCrush berryCrush; - /*0x1FC*/ struct PokemonJumpResults pokeJump; + /*0x1FC*/ struct PokemonJumpRecords pokeJump; /*0x20C*/ struct BerryPickingResults berryPick; /*0x21C*/ struct RankingHall1P hallRecords1P[HALL_FACILITIES_COUNT][2][3]; // From record mixing. /*0x57C*/ struct RankingHall2P hallRecords2P[2][3]; // From record mixing. diff --git a/include/pokemon_jump.h b/include/pokemon_jump.h index 91733b385..3aaa4fafb 100644 --- a/include/pokemon_jump.h +++ b/include/pokemon_jump.h @@ -3,10 +3,10 @@ #include "main.h" -void StartPokemonJump(u16 monId, MainCallback callback); +void StartPokemonJump(u16 partyId, MainCallback exitCallback); bool32 IsSpeciesAllowedInPokemonJump(u16 species); void IsPokemonJumpSpeciesInParty(void); -void ResetPokeJumpResults(void); +void ResetPokemonJumpRecords(void); void ShowPokemonJumpRecords(void); #endif // GUARD_POKEMON_JUMP_H -- cgit v1.2.3 From c323e7f061152a732fba39cb4a7c05ffb121d63b Mon Sep 17 00:00:00 2001 From: Marcus Huderle Date: Sat, 27 Feb 2021 11:04:45 -0600 Subject: Document some battle anim funcs and data --- include/battle_anim.h | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) (limited to 'include') diff --git a/include/battle_anim.h b/include/battle_anim.h index 046ddb08c..c1231c2de 100644 --- a/include/battle_anim.h +++ b/include/battle_anim.h @@ -108,7 +108,7 @@ u8 GetBattlerSpriteBGPriority(u8 battlerId); void *LoadPointerFromVars(s16 bottom, s16 top); void StorePointerInVars(s16 *bottom, s16 *top, const void *ptr); void sub_80A8278(void); -void sub_80A6B30(struct BattleAnimBgData*); +void GetDefaultBattleAnimBgData(struct BattleAnimBgData*); void sub_80A6B90(struct BattleAnimBgData*, u32 arg1); u8 GetBattlerSpriteSubpriority(u8 battlerId); bool8 TranslateAnimHorizontalArc(struct Sprite *sprite); @@ -127,12 +127,12 @@ void obj_delete_but_dont_free_vram(struct Sprite*); u8 sub_80A89C8(int, u8, int); void AnimLoadCompressedBgTilemapHandleContest(struct BattleAnimBgData*, const void*, u32); void AnimLoadCompressedBgGfx(u32, const u32*, u32); -void sub_80A6DAC(bool8); +void UpdateAnimBg3ScreenSize(bool8); void TranslateSpriteInGrowingCircleOverDuration(struct Sprite *); void sub_80A653C(struct Sprite *); void SetBattlerSpriteYOffsetFromYScale(u8 spriteId); -void sub_80A805C(struct Task *task, u8 a2, s16 a3, s16 a4, s16 a5, s16 a6, u16 a7); -u8 sub_80A80C8(struct Task *task); +void PrepareEruptAnimTaskData(struct Task *task, u8 a2, s16 a3, s16 a4, s16 a5, s16 a6, u16 a7); +u8 UpdateEruptAnimTask(struct Task *task); void DestroyAnimSpriteAndDisableBlend(struct Sprite *); void AnimLoadCompressedBgTilemap(u32 bgId, const void *src); void InitAnimFastLinearTranslationWithSpeed(struct Sprite *sprite); @@ -149,7 +149,7 @@ bool8 RunAffineAnimFromTaskData(struct Task *task); void AnimThrowProjectile(struct Sprite *sprite); void sub_80A6BFC(struct BattleAnimBgData *unk, u8 unused); u8 CreateAdditionalMonSpriteForMoveAnim(u16 species, bool8 isBackpic, u8 a3, s16 x, s16 y, u8 subpriority, u32 personality, u32 trainerId, u32 battlerId, bool32 ignoreDeoxysForm); -void sub_80A749C(struct Sprite *sprite); +void ResetSpriteRotScale_PreserveAffine(struct Sprite *sprite); void TradeMenuBouncePartySprites(struct Sprite *sprite); void DestroyAnimVisualTaskAndDisableBlend(u8 taskId); void DestroySpriteAndFreeResources_(struct Sprite *sprite); -- cgit v1.2.3 From a85fada3146e5efa68e2ce259d81ad785765bedd Mon Sep 17 00:00:00 2001 From: Marcus Huderle Date: Sat, 27 Feb 2021 17:41:30 -0600 Subject: Document more battle anim effects --- include/battle_anim.h | 24 ++++++++++++------------ include/field_weather.h | 2 +- include/graphics.h | 8 ++++---- 3 files changed, 17 insertions(+), 17 deletions(-) (limited to 'include') diff --git a/include/battle_anim.h b/include/battle_anim.h index c1231c2de..d1ee73f0f 100644 --- a/include/battle_anim.h +++ b/include/battle_anim.h @@ -65,7 +65,7 @@ s8 BattleAnimAdjustPanning2(s8 pan); s16 KeepPanInRange(s16 a, int oldPan); s16 CalculatePanIncrement(s16 sourcePan, s16 targetPan, s16 incrementPan); void sub_80A4720(u16 a, u16 *b, u32 c, u8 d); -void sub_80A477C(bool8); +void ResetBattleAnimBg(bool8); // battle_intro.c void SetAnimBgAttribute(u8 bgId, u8 attributeId, u8 value); @@ -75,8 +75,8 @@ int GetAnimBgAttribute(u8 bgId, u8 attributeId); // battle_anim_mons.c void TranslateSpriteInEllipseOverDuration(struct Sprite *sprite); -void sub_80A8AEC(struct Sprite *sprite); -void sub_80A8A6C(struct Sprite *sprite); +void AnimUnused_80A8AEC(struct Sprite *sprite); +void AnimUnused_80A8A6C(struct Sprite *sprite); void AnimWeatherBallUp(struct Sprite *sprite); void AnimWeatherBallDown(struct Sprite *sprite); void AnimSpinningSparkle(struct Sprite *sprite); @@ -108,8 +108,8 @@ u8 GetBattlerSpriteBGPriority(u8 battlerId); void *LoadPointerFromVars(s16 bottom, s16 top); void StorePointerInVars(s16 *bottom, s16 *top, const void *ptr); void sub_80A8278(void); -void GetDefaultBattleAnimBgData(struct BattleAnimBgData*); -void sub_80A6B90(struct BattleAnimBgData*, u32 arg1); +void GetBattleAnimBg1Data(struct BattleAnimBgData*); +void GetBattleAnimBgData(struct BattleAnimBgData*, u32 arg1); u8 GetBattlerSpriteSubpriority(u8 battlerId); bool8 TranslateAnimHorizontalArc(struct Sprite *sprite); void sub_80A6630(struct Sprite *sprite); @@ -119,12 +119,12 @@ void SetSpriteRotScale(u8 spriteId, s16 xScale, s16 yScale, u16 rotation); void InitSpriteDataForLinearTranslation(struct Sprite *sprite); void PrepareBattlerSpriteForRotScale(u8 spriteId, u8 objMode); void SetBattlerSpriteYOffsetFromRotation(u8 spriteId); -u32 sub_80A75AC(u8 a1, u8 a2, u8 a3, u8 a4, u8 a5, u8 a6, u8 a7); -u32 sub_80A76C4(u8 a1, u8 a2, u8 a3, u8 a4); +u32 GetBattleBgPalettesMask(u8 a1, u8 a2, u8 a3, u8 a4, u8 a5, u8 a6, u8 a7); +u32 GetBattleMonSpritePalettesMask(u8 a1, u8 a2, u8 a3, u8 a4); u8 AnimDummyReturnArg(u8 battler); s16 CloneBattlerSpriteWithBlend(u8); void obj_delete_but_dont_free_vram(struct Sprite*); -u8 sub_80A89C8(int, u8, int); +u8 CreateInvisibleSpriteCopy(int, u8, int); void AnimLoadCompressedBgTilemapHandleContest(struct BattleAnimBgData*, const void*, u32); void AnimLoadCompressedBgGfx(u32, const u32*, u32); void UpdateAnimBg3ScreenSize(bool8); @@ -183,7 +183,7 @@ enum u8 GetBattlerSpriteCoord(u8 battlerId, u8 attributeId); bool8 IsBattlerSpritePresent(u8 battlerId); -void sub_80A6C68(u32 arg0); +void ClearBattleAnimBg(u32 arg0); u8 GetAnimBattlerSpriteId(u8 wantedBattler); bool8 IsDoubleBattle(void); u8 GetBattleBgPaletteNum(void); @@ -214,8 +214,8 @@ u8 AnimateBallOpenParticles(u8 x, u8 y, u8 priority, u8 subpriority, u8 ballId); u8 LaunchBallFadeMonTask(bool8 unFadeLater, u8 battlerId, u32 selectedPalettes, u8 ballId); // battle_anim_utility_funcs.c -void sub_8116EB4(u8); -void sub_8117854(u8 taskId, int unused, u16 arg2, u8 battler1, u8 arg4, u8 arg5, u8 arg6, u8 arg7, const u32 *arg8, const u32 *arg9, const u32 *palette); +void InitStatsChangeAnimation(u8); +void StartMonScrollingBgMask(u8 taskId, int unused, u16 arg2, u8 battler1, u8 arg4, u8 arg5, u8 arg6, u8 arg7, const u32 *arg8, const u32 *arg9, const u32 *palette); // battle_anim_effects_1.c void SetSpriteNextToMonHead(u8 battler, struct Sprite* sprite); @@ -231,7 +231,7 @@ void DestroyAnimSpriteAfterTimer(struct Sprite *sprite); // battle_anim_smokescreen.c u8 SmokescreenImpact(s16 x, s16 y, u8 a3); -u32 UnpackSelectedBattleAnimPalettes(s16); +u32 UnpackSelectedBattleBgPalettes(s16); u8 GetBattlerSpriteFinal_Y(u8, u16, u8); diff --git a/include/field_weather.h b/include/field_weather.h index 1af320151..9ecf52501 100644 --- a/include/field_weather.h +++ b/include/field_weather.h @@ -117,7 +117,7 @@ struct Weather // field_weather.c extern struct Weather gWeather; extern struct Weather *const gWeatherPtr; -extern const u16 gUnknown_083970E8[]; +extern const u16 gFogPalette[]; // field_weather_effect.c extern const u8 gWeatherFogHorizontalTiles[]; diff --git a/include/graphics.h b/include/graphics.h index c0bd13e5b..0057563c4 100644 --- a/include/graphics.h +++ b/include/graphics.h @@ -4199,8 +4199,8 @@ extern const u32 gBattleAnimSpriteGfx_HumanoidFoot[]; extern const u32 gBattleAnimSpriteGfx_MonsterFoot[]; extern const u32 gBattleAnimSpriteGfx_HumanoidHand[]; extern const u32 gBattleAnimSpriteGfx_NoiseLine[]; -extern const u32 gUnknown_08C2EA50[]; -extern const u32 gUnknown_08C2EA9C[]; +extern const u32 UnusedLevelupAnimationGfx[]; +extern const u32 UnusedLevelupAnimationTilemap[]; extern const u32 gBattleAnimSpriteGfx_YellowUnk[]; extern const u32 gBattleAnimSpriteGfx_RedFist[]; extern const u32 gBattleAnimSpriteGfx_SlamHit[]; @@ -4764,8 +4764,8 @@ extern const u32 gMetalShineGfx[]; extern const u32 gMetalShinePalette[]; extern const u32 gMetalShineTilemap[]; -extern const u32 gUnknown_08C20668[]; -extern const u32 gUnknown_08C20684[]; +extern const u32 gBattleAnimMaskImage_Curse[]; +extern const u32 gBattleAnimMaskTilemap_Curse[]; extern const u32 gBattleStatMask_Gfx[]; extern const u32 gBattleStatMask1_Tilemap[]; extern const u32 gBattleStatMask2_Tilemap[]; -- cgit v1.2.3 From c900de35e753a8657cd3c337ca602871cb64c887 Mon Sep 17 00:00:00 2001 From: Marcus Huderle Date: Sun, 28 Feb 2021 09:47:03 -0600 Subject: Fix build and cleanup mistakes --- include/battle_anim.h | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'include') diff --git a/include/battle_anim.h b/include/battle_anim.h index d1ee73f0f..34bd774fe 100644 --- a/include/battle_anim.h +++ b/include/battle_anim.h @@ -119,8 +119,8 @@ void SetSpriteRotScale(u8 spriteId, s16 xScale, s16 yScale, u16 rotation); void InitSpriteDataForLinearTranslation(struct Sprite *sprite); void PrepareBattlerSpriteForRotScale(u8 spriteId, u8 objMode); void SetBattlerSpriteYOffsetFromRotation(u8 spriteId); -u32 GetBattleBgPalettesMask(u8 a1, u8 a2, u8 a3, u8 a4, u8 a5, u8 a6, u8 a7); -u32 GetBattleMonSpritePalettesMask(u8 a1, u8 a2, u8 a3, u8 a4); +u32 GetBattleBgPalettesMask(u8 battleBackground, u8 attacker, u8 target, u8 attackerPartner, u8 targetPartner, u8 a6, u8 a7); +u32 GetBattleMonSpritePalettesMask(u8 playerLeft, u8 playerRight, u8 opponentLeft, u8 opponentRight); u8 AnimDummyReturnArg(u8 battler); s16 CloneBattlerSpriteWithBlend(u8); void obj_delete_but_dont_free_vram(struct Sprite*); -- cgit v1.2.3 From cab3728e96ff5aa62fc61c118513aea241dbb506 Mon Sep 17 00:00:00 2001 From: N <71219152+PokeCodec@users.noreply.github.com> Date: Thu, 18 Feb 2021 20:07:33 -0500 Subject: Strangest match --- include/item_icon.h | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'include') diff --git a/include/item_icon.h b/include/item_icon.h index af03473fb..c93a519bb 100644 --- a/include/item_icon.h +++ b/include/item_icon.h @@ -1,8 +1,8 @@ #ifndef GUARD_ITEM_ICON_H #define GUARD_ITEM_ICON_H -extern void *gItemIconDecompressionBuffer; -extern void *gItemIcon4x4Buffer; +extern u8 *gItemIconDecompressionBuffer; +extern u8 *gItemIcon4x4Buffer; extern const struct SpriteTemplate gItemIconSpriteTemplate; -- cgit v1.2.3 From 031da44cab0d99210aff87533333d59a71a0b85f Mon Sep 17 00:00:00 2001 From: GriffinR Date: Sun, 28 Feb 2021 17:22:26 -0500 Subject: Document mon markings --- include/graphics.h | 5 +++-- include/mon_markings.h | 59 +++++++++++++++++++++++++------------------------- 2 files changed, 32 insertions(+), 32 deletions(-) (limited to 'include') diff --git a/include/graphics.h b/include/graphics.h index 0057563c4..b1a781fff 100644 --- a/include/graphics.h +++ b/include/graphics.h @@ -4015,8 +4015,6 @@ extern const u32 gPokenavCondition_Tilemap[]; extern const u16 gPokenavOptions_Tilemap[]; extern const u32 gPokenavOptions_Gfx[]; extern const u16 gPokenavOptions_Pal[]; -extern const u8 gPokenavConditionMarker_Gfx[]; -extern const u16 gPokenavConditionMarker_Pal[]; extern const u16 gPokenavLeftHeader_Pal[]; extern const u16 gPokenavHeader_Pal[]; extern const u32 gPokenavHeader_Gfx[]; @@ -5063,4 +5061,7 @@ extern const u8 gMailTilemap_Fab[]; extern const u8 gMailTiles_Retro[]; extern const u8 gMailTilemap_Retro[]; +extern const u8 gMonMarkingsMenu_Gfx[]; +extern const u16 gMonMarkingsMenu_Pal[]; + #endif //GUARD_GRAPHICS_H diff --git a/include/mon_markings.h b/include/mon_markings.h index 3cb04ad48..7ac88d8d2 100644 --- a/include/mon_markings.h +++ b/include/mon_markings.h @@ -1,37 +1,36 @@ -#ifndef POKEEMERALD_MON_MARKINGS_H -#define POKEEMERALD_MON_MARKINGS_H +#ifndef MON_MARKINGS_H +#define MON_MARKINGS_H #define NUM_MON_MARKINGS 4 struct PokemonMarkMenu { - /*0x0000*/ u16 baseTileTag; - /*0x0002*/ u16 basePaletteTag; - /*0x0004*/ u8 markings; // bit flags - /*0x0005*/ s8 cursorPos; - /*0x0006*/ bool8 markingsArray[NUM_MON_MARKINGS]; - /*0x000A*/ u8 cursorBaseY; - /*0x000B*/ bool8 spriteSheetLoadRequired; - /*0x000C*/ struct Sprite *menuWindowSprites[2]; // upper and lower halves of menu window - /*0x0014*/ struct Sprite *menuMarkingSprites[NUM_MON_MARKINGS]; - /*0x0024*/ struct Sprite *unkSprite; - /*0x0028*/ struct Sprite *menuTextSprite; - /*0x002C*/ const u8 *frameTiles; - /*0x0030*/ const u16 *framePalette; - /*0x0034*/ u8 menuWindowSpriteTiles[0x1000]; - /*0x1034*/ u8 filler1030[0x80]; - /*0x10B4*/ u8 tileLoadState; -}; // 10b8 + u16 baseTileTag; + u16 basePaletteTag; + u8 markings; // bit flags + s8 cursorPos; + bool8 markingsArray[NUM_MON_MARKINGS]; + u8 cursorBaseY; + bool8 spriteSheetLoadRequired; + struct Sprite *windowSprites[2]; // upper and lower halves of menu window + struct Sprite *markingSprites[NUM_MON_MARKINGS]; + struct Sprite *cursorSprite; + struct Sprite *textSprite; + const u8 *frameTiles; + const u16 *framePalette; + u8 windowSpriteTiles[0x1000]; + u8 unused[0x80]; + u8 tileLoadState; +}; -void sub_811F90C(struct PokemonMarkMenu *ptr); -void sub_811F918(void); -bool8 sub_811F960(void); -void sub_811FA90(void); -void sub_811FAA4(u8 markings, s16 x, s16 y); -void sub_811FAF8(void); -bool8 MonMarkingsMenuHandleInput(void); -struct Sprite *CreateMonMarkingsSpriteWithPal(u16 tileTag, u16 paletteTag, const u16 *palette); -struct Sprite *sub_811FFB4(u16 tileTag, u16 paletteTag, const u16 *palette); -void sub_8120084(u8 markings, void *dest); +void InitMonMarkingsMenu(struct PokemonMarkMenu *ptr); +void BufferMonMarkingsMenuWindowTiles(void); +void BufferMonMarkingsMenuTiles(void); +void OpenMonMarkingsMenu(u8 markings, s16 x, s16 y); +void FreeMonMarkingsMenu(void); +bool8 HandleMonMarkingsMenuInput(void); +struct Sprite *CreateMonMarkingAllCombosSprite(u16 tileTag, u16 paletteTag, const u16 *palette); +struct Sprite *CreateMonMarkingComboSprite(u16 tileTag, u16 paletteTag, const u16 *palette); +void UpdateMonMarkingTiles(u8 markings, void *dest); -#endif //POKEEMERALD_MON_MARKINGS_H +#endif //MON_MARKINGS_H -- cgit v1.2.3 From ed0347476c73122ec9fb36a14b47ab3850c00231 Mon Sep 17 00:00:00 2001 From: GriffinR Date: Sun, 28 Feb 2021 17:39:21 -0500 Subject: Remove old declaration and define --- include/mon_markings.h | 1 - 1 file changed, 1 deletion(-) (limited to 'include') diff --git a/include/mon_markings.h b/include/mon_markings.h index 7ac88d8d2..4053c5f68 100644 --- a/include/mon_markings.h +++ b/include/mon_markings.h @@ -24,7 +24,6 @@ struct PokemonMarkMenu }; void InitMonMarkingsMenu(struct PokemonMarkMenu *ptr); -void BufferMonMarkingsMenuWindowTiles(void); void BufferMonMarkingsMenuTiles(void); void OpenMonMarkingsMenu(u8 markings, s16 x, s16 y); void FreeMonMarkingsMenu(void); -- cgit v1.2.3 From 91ab30fa71dfe800215e9e7b3309f366ccc6173e Mon Sep 17 00:00:00 2001 From: GriffinR Date: Sun, 28 Feb 2021 17:42:11 -0500 Subject: Rename mon markings struct --- include/mon_markings.h | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'include') diff --git a/include/mon_markings.h b/include/mon_markings.h index 4053c5f68..fda7ad563 100644 --- a/include/mon_markings.h +++ b/include/mon_markings.h @@ -3,7 +3,7 @@ #define NUM_MON_MARKINGS 4 -struct PokemonMarkMenu +struct MonMarkingsMenu { u16 baseTileTag; u16 basePaletteTag; @@ -23,7 +23,7 @@ struct PokemonMarkMenu u8 tileLoadState; }; -void InitMonMarkingsMenu(struct PokemonMarkMenu *ptr); +void InitMonMarkingsMenu(struct MonMarkingsMenu *ptr); void BufferMonMarkingsMenuTiles(void); void OpenMonMarkingsMenu(u8 markings, s16 x, s16 y); void FreeMonMarkingsMenu(void); -- cgit v1.2.3 From b9c733495b40950a06650d842116decffbf681bd Mon Sep 17 00:00:00 2001 From: GriffinR Date: Mon, 1 Mar 2021 01:54:51 -0500 Subject: Document dodrio berry picking --- include/dodrio_berry_picking.h | 2 +- include/link_rfu.h | 2 +- include/sound.h | 21 +++++++++++++++++++++ 3 files changed, 23 insertions(+), 2 deletions(-) (limited to 'include') diff --git a/include/dodrio_berry_picking.h b/include/dodrio_berry_picking.h index 5decbeccb..a93fb27cd 100644 --- a/include/dodrio_berry_picking.h +++ b/include/dodrio_berry_picking.h @@ -1,7 +1,7 @@ #ifndef GUARD_DODRIO_BERRY_PICKING_H #define GUARD_DODRIO_BERRY_PICKING_H -void StartDodrioBerryPicking(u16 a0, void (*callback)(void)); +void StartDodrioBerryPicking(u16 partyId, void (*exitCallback)(void)); void IsDodrioInParty(void); void ShowDodrioBerryPickingRecords(void); diff --git a/include/link_rfu.h b/include/link_rfu.h index 9476da6b7..e1c3a6fba 100644 --- a/include/link_rfu.h +++ b/include/link_rfu.h @@ -262,7 +262,7 @@ bool8 LinkRfu_GetNameIfSerial7F7D(struct GFtgtGname *buff1, u8 *buff2, u8 idx); s32 sub_800E87C(u8 idx); void CreateTask_RfuIdle(void); void DestroyTask_RfuIdle(void); -void sub_8011AC8(void); +void ClearRecvCommands(void); void LinkRfu_FatalError(void); bool32 sub_8011A9C(void); void sub_80104B0(void); diff --git a/include/sound.h b/include/sound.h index 7d47b7456..25ffa2d6e 100644 --- a/include/sound.h +++ b/include/sound.h @@ -1,6 +1,27 @@ #ifndef GUARD_SOUND_H #define GUARD_SOUND_H +enum { + FANFARE_LEVEL_UP, + FANFARE_OBTAIN_ITEM, + FANFARE_EVOLVED, + FANFARE_OBTAIN_TMHM, + FANFARE_HEAL, + FANFARE_OBTAIN_BADGE, + FANFARE_MOVE_DELETED, + FANFARE_OBTAIN_BERRY, + FANFARE_AWAKEN_LEGEND, + FANFARE_SLOTS_JACKPOT, + FANFARE_SLOTS_WIN, + FANFARE_TOO_BAD, + FANFARE_RG_POKE_FLUTE, + FANFARE_RG_OBTAIN_KEY_ITEM, + FANFARE_RG_DEX_RATING, + FANFARE_OBTAIN_B_POINTS, + FANFARE_OBTAIN_SYMBOL, + FANFARE_REGISTER_MATCH_CALL, +}; + void InitMapMusic(void); void MapMusicMain(void); void ResetMapMusic(void); -- cgit v1.2.3 From 55a40b901f82483411931f6cf137fa344ba12dd8 Mon Sep 17 00:00:00 2001 From: GriffinR Date: Thu, 4 Mar 2021 17:48:40 -0500 Subject: Label battle tower link script --- include/cable_club.h | 2 +- include/constants/battle_tower.h | 8 ++++---- 2 files changed, 5 insertions(+), 5 deletions(-) (limited to 'include') diff --git a/include/cable_club.h b/include/cable_club.h index 7340742ea..a5a6acfa4 100644 --- a/include/cable_club.h +++ b/include/cable_club.h @@ -7,7 +7,7 @@ void CreateTask_EnterCableClubSeat(TaskFunc taskFunc); u8 CreateTask_ReestablishCableClubLink(void); void CB2_ReturnFromCableClubBattle(void); bool32 AreBattleTowerLinkSpeciesSame(u16 *speciesList1, u16 *speciesList2); -void sub_80B3AF8(u8 taskId); +void Task_ReconnectWithLinkPlayers(u8 taskId); void Task_WaitForLinkPlayerConnection(u8 taskId); bool32 GetLinkTrainerCardColor(u8 linkPlayerIndex); diff --git a/include/constants/battle_tower.h b/include/constants/battle_tower.h index f661ddc0b..002422d85 100644 --- a/include/constants/battle_tower.h +++ b/include/constants/battle_tower.h @@ -33,9 +33,9 @@ #define BATTLE_TOWER_LINK_CONTINUE 0 #define BATTLE_TOWER_LINK_RETIRE 1 -#define BATTLE_TOWER_LINKSTAT_CONTINUE 0 -#define BATTLE_TOWER_LINKSTAT_BOTH_RETIRE 1 -#define BATTLE_TOWER_LINKSTAT_PARTNER_RETIRE 2 -#define BATTLE_TOWER_LINKSTAT_PLAYER_RETIRE 3 +#define BATTLE_TOWER_LINKSTAT_CONTINUE 0 +#define BATTLE_TOWER_LINKSTAT_BOTH_RETIRE 1 +#define BATTLE_TOWER_LINKSTAT_MEMBER_RETIRE 2 +#define BATTLE_TOWER_LINKSTAT_LEADER_RETIRE 3 #endif //GUARD_CONSTANTS_BATTLE_TOWER_H -- cgit v1.2.3 From b1a69d95ea169f77b9187f6601021da97139119d Mon Sep 17 00:00:00 2001 From: GriffinR Date: Thu, 11 Mar 2021 14:16:40 -0500 Subject: Document minigame countdown --- include/link.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'include') diff --git a/include/link.h b/include/link.h index 086bf787b..34710597f 100644 --- a/include/link.h +++ b/include/link.h @@ -62,7 +62,7 @@ #define LINKCMD_0x6666 0x6666 #define LINKCMD_0x7777 0x7777 #define LINKCMD_BLENDER_PLAY_AGAIN 0x7779 -#define LINKCMD_0x7FFF 0x7FFF +#define LINKCMD_COUNTDOWN 0x7FFF #define LINKCMD_CONT_BLOCK 0x8888 #define LINKCMD_BLENDER_NO_BERRIES 0x9999 #define LINKCMD_BLENDER_NO_PBLOCK_SPACE 0xAAAA -- cgit v1.2.3 From e32a1571afc4a9c855c35b6ba17e84603d1b82e8 Mon Sep 17 00:00:00 2001 From: PikalaxALT Date: Fri, 12 Mar 2021 15:37:31 -0500 Subject: Resolve link comm buffers in gBattleStruct --- include/battle.h | 18 +++++++++++++----- 1 file changed, 13 insertions(+), 5 deletions(-) (limited to 'include') diff --git a/include/battle.h b/include/battle.h index c0baaf313..fa6c3aa96 100644 --- a/include/battle.h +++ b/include/battle.h @@ -344,6 +344,15 @@ struct BattleTvMovePoints s16 points[2][PARTY_SIZE * 4]; }; +struct MultiPartnerEnigmaBerry +{ + u8 field_0; + u8 field_1; + u8 vsScreenHealthFlagsLo; + u8 vsScreenHealthFlagsHi; + struct BattleEnigmaBerry battleEnigmaBerry; +}; + struct BattleStruct { u8 turnEffectsTracker; @@ -419,11 +428,10 @@ struct BattleStruct u8 givenExpMons; // Bits for enemy party's pokemon that gave exp to player's party. u8 lastTakenMoveFrom[MAX_BATTLERS_COUNT * MAX_BATTLERS_COUNT * 2]; // a 3-D array [target][attacker][byte] u16 castformPalette[MAX_BATTLERS_COUNT][16]; - u8 field_180; // weird field, used in battle_main.c, once accessed as an array of u32 overwriting the field below - u8 field_181; - u8 vsScreenHealthFlagsLo; - u8 vsScreenHealthFlagsHi; // Last bit is 'has frontier pass' - struct BattleEnigmaBerry battleEnigmaBerry; + union { + struct MultiPartnerEnigmaBerry multiPartnerEnigmaBerry; + u32 battleVideo[2]; + } multiBuffer; u8 wishPerishSongState; u8 wishPerishSongBattlerId; bool8 overworldWeatherDone; -- cgit v1.2.3 From 8d4dcb228afaf8dfc8198b1955d42d1794ac3d81 Mon Sep 17 00:00:00 2001 From: PikalaxALT Date: Fri, 12 Mar 2021 16:55:58 -0500 Subject: More documentation in battle_main --- include/battle.h | 4 ++-- include/main.h | 2 +- include/recorded_battle.h | 6 +++--- 3 files changed, 6 insertions(+), 6 deletions(-) (limited to 'include') diff --git a/include/battle.h b/include/battle.h index fa6c3aa96..34910781b 100644 --- a/include/battle.h +++ b/include/battle.h @@ -346,8 +346,8 @@ struct BattleTvMovePoints struct MultiPartnerEnigmaBerry { - u8 field_0; - u8 field_1; + u8 versionSignatureLo; + u8 versionSignatureHi; u8 vsScreenHealthFlagsLo; u8 vsScreenHealthFlagsHi; struct BattleEnigmaBerry battleEnigmaBerry; diff --git a/include/main.h b/include/main.h index 16ac31df2..ef5430cd8 100644 --- a/include/main.h +++ b/include/main.h @@ -37,7 +37,7 @@ struct Main /*0x439*/ u8 oamLoadDisabled:1; /*0x439*/ u8 inBattle:1; - /*0x439*/ u8 field_439_x4:1; + /*0x439*/ u8 isFrontierBattle:1; }; extern const u8 gGameVersion; diff --git a/include/recorded_battle.h b/include/recorded_battle.h index 3a6a8129a..5ae4ac12d 100644 --- a/include/recorded_battle.h +++ b/include/recorded_battle.h @@ -22,9 +22,9 @@ u8 GetRecordedBattleFrontierFacility(void); u8 GetRecordedBattleFronterBrainSymbol(void); void RecordedBattle_SaveParties(void); u8 GetActiveBattlerLinkPlayerGender(void); -void sub_8185F84(void); -void sub_8185F90(u16 arg0); -u8 sub_8185FAC(void); +void RecordedBattle_ClearFrontierPassFlag(void); +void RecordedBattle_SetFrontierPassFlagFromHword(u16 arg0); +u8 RecordedBattle_GetFrontierPassFlag(void); u8 GetBattleSceneInRecordedBattle(void); u8 GetTextSpeedInRecordedBattle(void); void RecordedBattle_CopyBattlerMoves(void); -- cgit v1.2.3 From 925e68c03ffe27b6f3467f1ee33be240f879f6b5 Mon Sep 17 00:00:00 2001 From: PikalaxALT Date: Mon, 15 Mar 2021 15:22:41 -0400 Subject: Update newly named fields --- include/battle.h | 4 ++-- include/main.h | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) (limited to 'include') diff --git a/include/battle.h b/include/battle.h index 34910781b..954d33b07 100644 --- a/include/battle.h +++ b/include/battle.h @@ -344,7 +344,7 @@ struct BattleTvMovePoints s16 points[2][PARTY_SIZE * 4]; }; -struct MultiPartnerEnigmaBerry +struct LinkBattlerHeader { u8 versionSignatureLo; u8 versionSignatureHi; @@ -429,7 +429,7 @@ struct BattleStruct u8 lastTakenMoveFrom[MAX_BATTLERS_COUNT * MAX_BATTLERS_COUNT * 2]; // a 3-D array [target][attacker][byte] u16 castformPalette[MAX_BATTLERS_COUNT][16]; union { - struct MultiPartnerEnigmaBerry multiPartnerEnigmaBerry; + struct LinkBattlerHeader linkBattlerHeader; u32 battleVideo[2]; } multiBuffer; u8 wishPerishSongState; diff --git a/include/main.h b/include/main.h index ef5430cd8..cad5c0ef9 100644 --- a/include/main.h +++ b/include/main.h @@ -37,7 +37,7 @@ struct Main /*0x439*/ u8 oamLoadDisabled:1; /*0x439*/ u8 inBattle:1; - /*0x439*/ u8 isFrontierBattle:1; + /*0x439*/ u8 anyLinkBattlerHasFrontierPass:1; }; extern const u8 gGameVersion; -- cgit v1.2.3 From 22e2c0a47ca876313604f0dd031abb324477186f Mon Sep 17 00:00:00 2001 From: GriffinR Date: Tue, 16 Mar 2021 05:40:42 -0400 Subject: Document Berry Crush --- include/berry.h | 8 ++++---- include/berry_crush.h | 2 +- include/constants/game_stat.h | 2 +- include/global.h | 2 +- include/graphics.h | 6 +++--- include/strings.h | 2 +- 6 files changed, 11 insertions(+), 11 deletions(-) (limited to 'include') diff --git a/include/berry.h b/include/berry.h index 4a5a46615..22b9158ee 100644 --- a/include/berry.h +++ b/include/berry.h @@ -28,11 +28,11 @@ void SetBerryTreesSeen(void); extern const struct Berry gBerries[]; -struct UnkStruct_0858AB24 { - u8 unk0; - u16 unk1; +struct BerryCrushBerryData { + u8 difficulty; // The number of A presses required to crush it + u16 powder; }; -extern const struct UnkStruct_0858AB24 gUnknown_0858AB24[]; +extern const struct BerryCrushBerryData gBerryCrush_BerryData[]; #endif // GUARD_BERRY_H diff --git a/include/berry_crush.h b/include/berry_crush.h index a08f1f699..02dcce506 100755 --- a/include/berry_crush.h +++ b/include/berry_crush.h @@ -3,6 +3,6 @@ #include "main.h" -void StartBerryCrush(MainCallback callback); +void StartBerryCrush(MainCallback exitCallback); #endif // GUARD_BERRY_CRUSH_H diff --git a/include/constants/game_stat.h b/include/constants/game_stat.h index e302f1345..2acdfd8a3 100644 --- a/include/constants/game_stat.h +++ b/include/constants/game_stat.h @@ -52,7 +52,7 @@ #define GAME_STAT_RODE_CABLE_CAR 48 #define GAME_STAT_ENTERED_HOT_SPRINGS 49 #define GAME_STAT_NUM_UNION_ROOM_BATTLES 50 -#define GAME_STAT_51 51 +#define GAME_STAT_PLAYED_BERRY_CRUSH 51 #define NUM_USED_GAME_STATS 52 #define NUM_GAME_STATS 64 diff --git a/include/global.h b/include/global.h index 1992ff819..7daed8621 100644 --- a/include/global.h +++ b/include/global.h @@ -209,7 +209,7 @@ struct PyramidBag struct BerryCrush { - u16 berryCrushResults[4]; + u16 pressingSpeeds[4]; // For the record with each possible group size, 2-5 players u32 berryPowderAmount; u32 unk; }; diff --git a/include/graphics.h b/include/graphics.h index b1a781fff..9be05f38e 100644 --- a/include/graphics.h +++ b/include/graphics.h @@ -5001,9 +5001,9 @@ extern const u16 gUsePokeblockUpDown_Pal[]; extern const u16 gUsePokeblockCondition_Pal[]; // Berry Crush -extern const u32 gUnknown_08DE34B8[]; -extern const u16 gUnknown_08DE3398[]; -extern const u32 gUnknown_08DE3FD4[]; +extern const u32 gBerryCrush_Crusher_Gfx[]; +extern const u16 gBerryCrush_Crusher_Pal[]; +extern const u32 gBerryCrush_Crusher_Tilemap[]; // Pokenav extern const u32 gPokenavMessageBox_Gfx[]; diff --git a/include/strings.h b/include/strings.h index 294ab8aa6..8880f3a5c 100644 --- a/include/strings.h +++ b/include/strings.h @@ -2904,7 +2904,7 @@ extern const u8 gText_CrushingResults[]; extern const u8 gText_BerryCrush2[]; extern const u8 gText_PressingSpeedRankings[]; extern const u8 gText_Var1Players[]; -extern const u8 gText_ReadyToBerryCrush[]; +extern const u8 gText_ReadyPickBerry[]; extern const u8 gText_WaitForAllChooseBerry[]; extern const u8 gText_EndedWithXUnitsPowder[]; extern const u8 gText_RecordingGameResults[]; -- cgit v1.2.3 From 5b910a11b4f6d548b6643455ccb806c0e60f48a2 Mon Sep 17 00:00:00 2001 From: Kurausukun Date: Thu, 18 Mar 2021 20:35:39 -0400 Subject: port miscellaneous fr documentation --- include/overworld.h | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) (limited to 'include') diff --git a/include/overworld.h b/include/overworld.h index a2eac7e29..6efaa6ccb 100644 --- a/include/overworld.h +++ b/include/overworld.h @@ -152,10 +152,10 @@ u16 sub_8087288(void); u16 sub_808729C(void); u16 QueueExitLinkRoomKey(void); u16 sub_80872C4(void); -bool32 sub_8087598(void); -bool32 sub_80875C8(void); -bool32 sub_8087634(void); -bool32 sub_808766C(void); +bool32 Overworld_LinkRecvQueueLengthMoreThan2(void); +bool32 Overworld_RecvKeysFromLinkIsRunning(void); +bool32 Overworld_SendKeysToLinkIsRunning(void); +bool32 IsSendingKeysOverCable(void); void ClearLinkPlayerObjectEvents(void); #endif // GUARD_OVERWORLD_H -- cgit v1.2.3 From 557152b06eab9320987f9c3b676b903141beb026 Mon Sep 17 00:00:00 2001 From: GriffinR Date: Fri, 19 Mar 2021 14:10:13 -0400 Subject: Minor link cleanup --- include/link.h | 29 +++++++++++++++-------------- 1 file changed, 15 insertions(+), 14 deletions(-) (limited to 'include') diff --git a/include/link.h b/include/link.h index 34710597f..3b621e6c1 100644 --- a/include/link.h +++ b/include/link.h @@ -56,17 +56,17 @@ #define LINKCMD_BLENDER_SEND_KEYS 0x4444 #define LINKCMD_BLENDER_SCORE_BEST 0x4523 #define LINKCMD_BLENDER_SCORE_GOOD 0x5432 -#define LINKCMD_0x5555 0x5555 -#define LINKCMD_0x5566 0x5566 +#define LINKCMD_DUMMY_1 0x5555 +#define LINKCMD_DUMMY_2 0x5566 #define LINKCMD_READY_CLOSE_LINK 0x5FFF -#define LINKCMD_0x6666 0x6666 -#define LINKCMD_0x7777 0x7777 +#define LINKCMD_SEND_EMPTY 0x6666 +#define LINKCMD_SEND_0xEE 0x7777 #define LINKCMD_BLENDER_PLAY_AGAIN 0x7779 #define LINKCMD_COUNTDOWN 0x7FFF #define LINKCMD_CONT_BLOCK 0x8888 #define LINKCMD_BLENDER_NO_BERRIES 0x9999 #define LINKCMD_BLENDER_NO_PBLOCK_SPACE 0xAAAA -#define LINKCMD_0xAAAB 0xAAAB +#define LINKCMD_SEND_ITEM 0xAAAB #define LINKCMD_READY_TO_TRADE 0xAABB #define LINKCMD_READY_FINISH_TRADE 0xABCD #define LINKCMD_INIT_BLOCK 0xBBBB @@ -76,17 +76,18 @@ #define LINKCMD_START_TRADE 0xCCDD #define LINKCMD_CONFIRM_FINISH_TRADE 0xDCBA #define LINKCMD_SET_MONS_TO_TRADE 0xDDDD -#define LINKCMD_0xDDEE 0xDDEE +#define LINKCMD_PLAYER_CANCEL_TRADE 0xDDEE #define LINKCMD_REQUEST_CANCEL 0xEEAA -#define LINKCMD_CANCEL_TRADE 0xEEBB -#define LINKCMD_0xEECC 0xEECC +#define LINKCMD_BOTH_CANCEL_TRADE 0xEEBB +#define LINKCMD_PARTNER_CANCEL_TRADE 0xEECC +#define LINKCMD_NONE 0xEFFF #define LINKTYPE_TRADE 0x1111 #define LINKTYPE_TRADE_CONNECTING 0x1122 #define LINKTYPE_TRADE_SETUP 0x1133 #define LINKTYPE_TRADE_DISCONNECTED 0x1144 #define LINKTYPE_BATTLE 0x2211 -#define LINKTYPE_0x2222 0x2222 // unused battle? +#define LINKTYPE_UNUSED_BATTLE 0x2222 // Unused, inferred from gap #define LINKTYPE_SINGLE_BATTLE 0x2233 #define LINKTYPE_DOUBLE_BATTLE 0x2244 #define LINKTYPE_MULTI_BATTLE 0x2255 @@ -98,7 +99,7 @@ #define LINKTYPE_BERRY_BLENDER_SETUP 0x4411 #define LINKTYPE_BERRY_BLENDER 0x4422 #define LINKTYPE_MYSTERY_EVENT 0x5501 -#define LINKTYPE_0x5502 0x5502 // unused? +#define LINKTYPE_UNUSED_EREADER 0x5502 // Unused, inferred from gap #define LINKTYPE_EREADER 0x5503 #define LINKTYPE_CONTEST_GMODE 0x6601 #define LINKTYPE_CONTEST_EMODE 0x6602 @@ -290,17 +291,17 @@ bool8 HandleLinkConnection(void); void SetLinkDebugValues(u32 seed, u32 flags); void SetBerryBlenderLinkCallback(void); void SetSuppressLinkErrorMessage(bool8 flag); -void sub_800B524(struct LinkPlayer *linkPlayer); +void ConvertLinkPlayerName(struct LinkPlayer *linkPlayer); u8 GetSioMultiSI(void); void ClearSavedLinkPlayers(void); -void BufferLinkErrorInfo(u32 status, u8 lastSendQueueCount, u8 lastRecvQueueCount, u8 unk_06); -void sub_800B348(void); +void BufferLinkErrorInfo(u32 status, u8 lastSendQueueCount, u8 lastRecvQueueCount, bool8 disconnected); +void LocalLinkPlayerToBlock(void); void LinkPlayerFromBlock(u32 who); bool32 Link_AnyPartnersPlayingFRLG_JP(void); void ResetLinkPlayerCount(void); void SaveLinkPlayers(u8 a0); void SetWirelessCommType0(void); -bool32 sub_800B504(void); +bool32 IsLinkRecvQueueLengthAtLeast3(void); extern u16 gLinkPartnersHeldKeys[6]; extern u32 gLinkDebugSeed; -- cgit v1.2.3 From dfc6ee0e9e20658a80e4080da16c2f6423b85457 Mon Sep 17 00:00:00 2001 From: GriffinR Date: Fri, 19 Mar 2021 18:17:43 -0400 Subject: Add SAFE_DIV --- include/global.h | 8 ++++++++ 1 file changed, 8 insertions(+) (limited to 'include') diff --git a/include/global.h b/include/global.h index 1992ff819..112d2cbc4 100644 --- a/include/global.h +++ b/include/global.h @@ -74,6 +74,14 @@ #define abs(x) (((x) < 0) ? -(x) : (x)) #endif +// Used in cases where division by 0 can occur in the retail version. +// Avoids invalid opcodes on some emulators, and the otherwise UB. +#ifdef UBFIX +#define SAFE_DIV(a, b) ((b) ? (a) / (b) : 0) +#else +#define SAFE_DIV(a, b) ((a) / (b)) +#endif + // Extracts the upper 16 bits of a 32-bit number #define HIHALF(n) (((n) & 0xFFFF0000) >> 16) -- cgit v1.2.3 From 6127c6f32e25aec976c290b717a2e4fddffc30d1 Mon Sep 17 00:00:00 2001 From: GriffinR Date: Sat, 20 Mar 2021 23:47:08 -0400 Subject: Misc labels in battle facilities --- include/constants/battle_pike.h | 4 ++-- include/trainer_hill.h | 1 - 2 files changed, 2 insertions(+), 3 deletions(-) (limited to 'include') diff --git a/include/constants/battle_pike.h b/include/constants/battle_pike.h index 9187ae28c..76309436e 100644 --- a/include/constants/battle_pike.h +++ b/include/constants/battle_pike.h @@ -42,8 +42,8 @@ #define BATTLE_PIKE_FUNC_SET_IN_WILD_MON_ROOM 6 #define BATTLE_PIKE_FUNC_CLEAR_IN_WILD_MON_ROOM 7 #define BATTLE_PIKE_FUNC_SAVE 8 -#define BATTLE_PIKE_FUNC_NULL_9 9 -#define BATTLE_PIKE_FUNC_NULL_10 10 +#define BATTLE_PIKE_FUNC_DUMMY_1 9 +#define BATTLE_PIKE_FUNC_DUMMY_2 10 #define BATTLE_PIKE_FUNC_GET_ROOM_STATUS 11 #define BATTLE_PIKE_FUNC_GET_ROOM_STATUS_MON 12 #define BATTLE_PIKE_FUNC_HEAL_ONE_TWO_MONS 13 diff --git a/include/trainer_hill.h b/include/trainer_hill.h index 94d29a7ca..acf8facca 100644 --- a/include/trainer_hill.h +++ b/include/trainer_hill.h @@ -66,7 +66,6 @@ void InitTrainerHillBattleStruct(void); void FreeTrainerHillBattleStruct(void); void CopyTrainerHillTrainerText(u8 which, u16 trainerId); bool8 InTrainerHillChallenge(void); -void nullsub_129(void); void PrintOnTrainerHillRecordsWindow(void); void LoadTrainerHillObjectEventTemplates(void); bool32 LoadTrainerHillFloorObjectEventScripts(void); -- cgit v1.2.3 From 7a5c6d4d869b314ce748fe2ccff493c468fa0a91 Mon Sep 17 00:00:00 2001 From: GriffinR Date: Thu, 25 Mar 2021 13:26:22 -0400 Subject: Standardize Friendship/Happiness --- include/constants/hold_effects.h | 2 +- include/constants/vars.h | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) (limited to 'include') diff --git a/include/constants/hold_effects.h b/include/constants/hold_effects.h index b653f5a92..5853f1708 100644 --- a/include/constants/hold_effects.h +++ b/include/constants/hold_effects.h @@ -28,7 +28,7 @@ #define HOLD_EFFECT_MACHO_BRACE 24 #define HOLD_EFFECT_EXP_SHARE 25 #define HOLD_EFFECT_QUICK_CLAW 26 -#define HOLD_EFFECT_HAPPINESS_UP 27 +#define HOLD_EFFECT_FRIENDSHIP_UP 27 #define HOLD_EFFECT_CURE_ATTRACT 28 #define HOLD_EFFECT_CHOICE_BAND 29 #define HOLD_EFFECT_FLINCH 30 diff --git a/include/constants/vars.h b/include/constants/vars.h index 625c37aa9..d3d1aba87 100644 --- a/include/constants/vars.h +++ b/include/constants/vars.h @@ -56,7 +56,7 @@ #define VAR_CYCLING_ROAD_RECORD_COLLISIONS 0x4027 #define VAR_CYCLING_ROAD_RECORD_TIME_L 0x4028 #define VAR_CYCLING_ROAD_RECORD_TIME_H 0x4029 -#define VAR_HAPPINESS_STEP_COUNTER 0x402A +#define VAR_FRIENDSHIP_STEP_COUNTER 0x402A #define VAR_POISON_STEP_COUNTER 0x402B #define VAR_RESET_RTC_ENABLE 0x402C #define VAR_ENIGMA_BERRY_AVAILABLE 0x402D -- cgit v1.2.3 From c86cc8b371efa875446796fb44c7e285c4b26f70 Mon Sep 17 00:00:00 2001 From: GriffinR Date: Fri, 5 Mar 2021 15:13:08 -0500 Subject: Document intro, start intro_credits/credits --- include/graphics.h | 16 ++++++------ include/intro_credits_graphics.h | 53 +++++++++++++++++++++++----------------- include/title_screen.h | 2 +- 3 files changed, 38 insertions(+), 33 deletions(-) (limited to 'include') diff --git a/include/graphics.h b/include/graphics.h index b1a781fff..9af68a052 100644 --- a/include/graphics.h +++ b/include/graphics.h @@ -3874,8 +3874,8 @@ extern const u32 gBagPalette[]; extern const u32 gBerryCheckCircle_Gfx[]; //intro graphics -extern const u32 gIntro1SparkleGfx[]; -extern const u32 gIntro1FlygonGfx[]; +extern const u32 gIntro1Sparkle_Gfx[]; +extern const u32 gIntro1Flygon_Gfx[]; extern const u16 gIntro3LightningPal[]; extern const u32 gIntroCopyright_Gfx[]; extern const u32 gIntroCopyright_Tilemap[]; @@ -3886,8 +3886,8 @@ extern const u32 gIntro2ManectricGfx[]; extern const u16 gIntro2VolbeatPal[]; extern const u16 gIntro2TorchicPal[]; extern const u16 gIntro2ManectricPal[]; -extern const u32 gIntro2BubblesGfx[]; -extern const u16 gIntro2BubblesPal[]; +extern const u32 gIntro3Bubbles_Gfx[]; +extern const u16 gIntro3Bubbles_Pal[]; extern const u32 gIntro3LightningGfx[]; extern const u32 gIntro3GroudonGfx[]; extern const u32 gIntro3GroudonTilemap[]; @@ -3907,11 +3907,9 @@ extern const u32 gIntro3RayquazaTilemap[]; extern const u32 gIntro3RayquazaGfx[]; extern const u32 gIntro3Clouds2Gfx[]; extern const u16 gIntro1GameFreakTextFadePal[]; - -//intro/credits graphics -extern const u32 gIntro2BrendanNoTurnGfx[]; -extern const u32 gIntro2MayNoTurnGfx[]; -extern const u16 gIntro2BrendanNoTurnPal[]; +extern const u32 gIntro2BrendanGfx[]; +extern const u32 gIntro2MayGfx[]; +extern const u16 gIntro2PlayerPal[]; extern const u16 gIntro2FlygonPal[]; extern const u32 gIntro2FlygonGfx[]; diff --git a/include/intro_credits_graphics.h b/include/intro_credits_graphics.h index 2c7ceaf57..431446ed2 100644 --- a/include/intro_credits_graphics.h +++ b/include/intro_credits_graphics.h @@ -1,30 +1,37 @@ #ifndef GUARD_INTRO_CREDITS_GRAPHICS_H #define GUARD_INTRO_CREDITS_GRAPHICS_H -extern u16 gUnknown_0203BD24; -extern s16 gUnknown_0203BD26; -extern s16 gUnknown_0203BD28; +// States for gIntroCredits_MovingSceneryState +enum { + INTROCRED_SCENERY_MOVING, + INTROCRED_SCENERY_DESTROY, + INTROCRED_SCENERY_FROZEN, +}; -extern const struct CompressedSpriteSheet gIntro2BrendanSpriteSheet[]; -extern const struct CompressedSpriteSheet gIntro2MaySpriteSheet[]; -extern const struct CompressedSpriteSheet gIntro2BicycleSpriteSheet[]; -extern const struct CompressedSpriteSheet gIntro2FlygonSpriteSheet[]; -extern const struct SpritePalette gIntroBikeAndFlygonPalette[]; -extern const struct CompressedSpriteSheet gUnknown_085F5334[]; -extern const struct CompressedSpriteSheet gUnknown_085F5344[]; -extern const struct CompressedSpriteSheet gUnknown_085F5354[]; -extern const struct CompressedSpriteSheet gUnknown_085F53AC[]; -extern const struct CompressedSpriteSheet gUnknown_085F53BC[]; -extern const struct SpritePalette gUnknown_085F5384[]; +extern u16 gIntroCredits_MovingSceneryVBase; +extern s16 gIntroCredits_MovingSceneryVOffset; +extern s16 gIntroCredits_MovingSceneryState; -void load_intro_part2_graphics(u8 a); -void sub_817B150(u8 a); -void sub_817B1C8(u8); -void sub_817B3A8(u8); -u8 CreateBicycleAnimationTask(u8 a, u16 b, u16 c, u16 d); -void sub_817B540(u8); -u8 intro_create_brendan_sprite(s16 a, s16 b); -u8 intro_create_may_sprite(s16 a, s16 b); -u8 intro_create_flygon_sprite(s16 a, s16 b); +extern const struct CompressedSpriteSheet gSpriteSheet_IntroBrendan[]; +extern const struct CompressedSpriteSheet gSpriteSheet_IntroMay[]; +extern const struct CompressedSpriteSheet gSpriteSheet_IntroBicycle[]; +extern const struct CompressedSpriteSheet gSpriteSheet_IntroFlygon[]; +extern const struct SpritePalette gSpritePalettes_IntroPlayerFlygon[]; +extern const struct CompressedSpriteSheet gSpriteSheet_CreditsBrendan[]; +extern const struct CompressedSpriteSheet gSpriteSheet_CreditsMay[]; +extern const struct CompressedSpriteSheet gSpriteSheet_CreditsBicycle[]; +extern const struct CompressedSpriteSheet gSpriteSheet_CreditsRivalBrendan[]; +extern const struct CompressedSpriteSheet gSpriteSheet_CreditsRivalMay[]; +extern const struct SpritePalette gSpritePalettes_Credits[]; + +void LoadIntroPart2Graphics(u8 scene); +void SetIntroPart2BgCnt(u8 a); +void LoadCreditsSceneGraphics(u8); +void SetCreditsSceneBgCnt(u8); +u8 CreateBicycleBgAnimationTask(u8 a, u16 b, u16 c, u16 d); +void CycleSceneryPalette(u8); +u8 CreateIntroBrendanSprite(s16 x, s16 y); +u8 CreateIntroMaySprite(s16 x, s16 y); +u8 CreateIntroFlygonSprite(s16 x, s16 y); #endif // GUARD_INTRO_CREDITS_GRAPHICS_H diff --git a/include/title_screen.h b/include/title_screen.h index b7100f124..0c80db5bf 100644 --- a/include/title_screen.h +++ b/include/title_screen.h @@ -1,7 +1,7 @@ #ifndef GUARD_TITLE_SCREEN_H #define GUARD_TITLE_SCREEN_H -extern const u16 gIntroWaterDropAlphaBlend[]; +extern const u16 gTitleScreenAlphaBlend[64]; void CB2_InitTitleScreen(void); -- cgit v1.2.3 From 357c5439f5170ec1ebb1fe52c00d8d934b65c6bc Mon Sep 17 00:00:00 2001 From: GriffinR Date: Sun, 28 Mar 2021 23:56:42 -0400 Subject: Document some credits --- include/credits.h | 4 ---- include/intro_credits_graphics.h | 2 +- 2 files changed, 1 insertion(+), 5 deletions(-) (limited to 'include') diff --git a/include/credits.h b/include/credits.h index f7dfa9997..2e8c7e0c3 100644 --- a/include/credits.h +++ b/include/credits.h @@ -1,12 +1,8 @@ #ifndef GUARD_CREDITS_H #define GUARD_CREDITS_H -// Exported type declarations - -// Exported RAM declarations extern EWRAM_DATA bool8 gHasHallOfFameRecords; -// Exported ROM declarations void CB2_StartCreditsSequence(void); #endif // GUARD_CREDITS_H diff --git a/include/intro_credits_graphics.h b/include/intro_credits_graphics.h index 431446ed2..df3854aef 100644 --- a/include/intro_credits_graphics.h +++ b/include/intro_credits_graphics.h @@ -3,7 +3,7 @@ // States for gIntroCredits_MovingSceneryState enum { - INTROCRED_SCENERY_MOVING, + INTROCRED_SCENERY_NORMAL, INTROCRED_SCENERY_DESTROY, INTROCRED_SCENERY_FROZEN, }; -- cgit v1.2.3 From 62968895ca220cf5b6f7c066e9061cf45fe7913e Mon Sep 17 00:00:00 2001 From: GriffinR Date: Mon, 29 Mar 2021 09:38:19 -0400 Subject: Add MON_PIC_SIZE constant --- include/constants/pokemon.h | 2 ++ 1 file changed, 2 insertions(+) (limited to 'include') diff --git a/include/constants/pokemon.h b/include/constants/pokemon.h index 11a7c7fc5..51ef0c015 100644 --- a/include/constants/pokemon.h +++ b/include/constants/pokemon.h @@ -346,4 +346,6 @@ #define NUM_MALE_LINK_FACILITY_CLASSES 8 #define NUM_FEMALE_LINK_FACILITY_CLASSES 8 +#define MON_PIC_SIZE (64 * 64 / 2) + #endif // GUARD_CONSTANTS_POKEMON_H -- cgit v1.2.3 From 09ff1524b4fd89a3d0b9291f03cb8f0655ed69b7 Mon Sep 17 00:00:00 2001 From: GriffinR Date: Mon, 29 Mar 2021 12:39:49 -0400 Subject: Finish documenting credits --- include/intro_credits_graphics.h | 9 +++++++++ 1 file changed, 9 insertions(+) (limited to 'include') diff --git a/include/intro_credits_graphics.h b/include/intro_credits_graphics.h index df3854aef..bed30ffe8 100644 --- a/include/intro_credits_graphics.h +++ b/include/intro_credits_graphics.h @@ -8,6 +8,15 @@ enum { INTROCRED_SCENERY_FROZEN, }; +// Scenes for the Credits sequence +enum { + SCENE_OCEAN_MORNING, + SCENE_OCEAN_SUNSET, + SCENE_FOREST_RIVAL_ARRIVE, + SCENE_FOREST_CATCH_RIVAL, + SCENE_CITY_NIGHT, +}; + extern u16 gIntroCredits_MovingSceneryVBase; extern s16 gIntroCredits_MovingSceneryVOffset; extern s16 gIntroCredits_MovingSceneryState; -- cgit v1.2.3 From dea07dc8656c8fb32f5b389b9f4f9a30fe26e555 Mon Sep 17 00:00:00 2001 From: GriffinR Date: Mon, 29 Mar 2021 20:31:21 -0400 Subject: Standardize intro gfx names --- include/graphics.h | 69 +++++++++++++++++++++++++++--------------------------- 1 file changed, 34 insertions(+), 35 deletions(-) (limited to 'include') diff --git a/include/graphics.h b/include/graphics.h index 9af68a052..1d39eb1f5 100644 --- a/include/graphics.h +++ b/include/graphics.h @@ -3874,44 +3874,43 @@ extern const u32 gBagPalette[]; extern const u32 gBerryCheckCircle_Gfx[]; //intro graphics -extern const u32 gIntro1Sparkle_Gfx[]; -extern const u32 gIntro1Flygon_Gfx[]; -extern const u16 gIntro3LightningPal[]; +extern const u32 gIntroSparkle_Gfx[]; +extern const u32 gIntroFlygonSilhouette_Gfx[]; +extern const u32 gIntroLightning_Gfx[]; +extern const u16 gIntroLightning_Pal[]; extern const u32 gIntroCopyright_Gfx[]; extern const u32 gIntroCopyright_Tilemap[]; extern const u16 gIntroCopyright_Pal[16]; -extern const u32 gIntro2VolbeatGfx[]; -extern const u32 gIntro2TorchicGfx[]; -extern const u32 gIntro2ManectricGfx[]; -extern const u16 gIntro2VolbeatPal[]; -extern const u16 gIntro2TorchicPal[]; -extern const u16 gIntro2ManectricPal[]; -extern const u32 gIntro3Bubbles_Gfx[]; -extern const u16 gIntro3Bubbles_Pal[]; -extern const u32 gIntro3LightningGfx[]; -extern const u32 gIntro3GroudonGfx[]; -extern const u32 gIntro3GroudonTilemap[]; -extern const u32 gIntro3LegendBgGfx[]; -extern const u32 gIntro3GroudonBgTilemap[]; -extern const u32 gIntro3GroudonBgTilemap[]; -extern const u8 gIntro3BgPal[0x200]; -extern const u32 gIntro3KyogreGfx[]; -extern const u32 gIntro3KyogreTilemap[]; -extern const u32 gIntro3KyogreBgTilemap[]; -extern const u32 gIntro3CloudsGfx[]; -extern const u32 gIntro3Clouds1Tilemap[]; -extern const u32 gIntro3Clouds2Tilemap[]; -extern const u32 gIntro3Clouds3Tilemap[]; -extern const u32 gIntro3Clouds4Tilemap[]; -extern const u32 gIntro3RayquazaTilemap[]; -extern const u32 gIntro3RayquazaGfx[]; -extern const u32 gIntro3Clouds2Gfx[]; -extern const u16 gIntro1GameFreakTextFadePal[]; -extern const u32 gIntro2BrendanGfx[]; -extern const u32 gIntro2MayGfx[]; -extern const u16 gIntro2PlayerPal[]; -extern const u16 gIntro2FlygonPal[]; -extern const u32 gIntro2FlygonGfx[]; +extern const u32 gIntroVolbeat_Gfx[]; +extern const u16 gIntroVolbeat_Pal[]; +extern const u32 gIntroTorchic_Gfx[]; +extern const u16 gIntroTorchic_Pal[]; +extern const u32 gIntroManectric_Gfx[]; +extern const u16 gIntroManectric_Pal[]; +extern const u32 gIntroBubbles_Gfx[]; +extern const u16 gIntroBubbles_Pal[]; +extern const u32 gIntroGroudon_Gfx[]; +extern const u32 gIntroGroudon_Tilemap[]; +extern const u32 gIntroLegendBg_Gfx[]; +extern const u32 gIntroGroudonBg_Tilemap[]; +extern const u8 gIntro3Bg_Pal[0x200]; +extern const u32 gIntroKyogre_Gfx[]; +extern const u32 gIntroKyogre_Tilemap[]; +extern const u32 gIntroKyogreBg_Tilemap[]; +extern const u32 gIntroClouds_Gfx[]; +extern const u32 gIntroCloudsLeft_Tilemap[]; +extern const u32 gIntroCloudsRight_Tilemap[]; +extern const u32 gIntroCloudsSun_Tilemap[]; +extern const u32 gIntroRayquaza_Tilemap[]; +extern const u32 gIntroRayquaza_Gfx[]; +extern const u32 gIntroRayquazaClouds_Gfx[]; +extern const u32 gIntroRayquazaClouds_Tilemap[]; +extern const u16 gIntroGameFreakTextFade_Pal[]; +extern const u32 gIntroBrendan_Gfx[]; +extern const u32 gIntroMay_Gfx[]; +extern const u16 gIntroPlayer_Pal[]; +extern const u16 gIntroFlygon_Pal[]; +extern const u32 gIntroFlygon_Gfx[]; // party menu graphics extern const u32 gPartyMenuBg_Gfx[]; -- cgit v1.2.3 From 86856098a35b58eabb74db1d41cb9a2853c6746f Mon Sep 17 00:00:00 2001 From: GriffinR Date: Wed, 31 Mar 2021 15:53:01 -0400 Subject: Document Dewford Trend --- include/constants/flags.h | 2 +- include/constants/global.h | 1 + include/dewford_trend.h | 5 ++--- include/global.h | 13 +++++++------ include/tv.h | 2 +- 5 files changed, 12 insertions(+), 11 deletions(-) (limited to 'include') diff --git a/include/constants/flags.h b/include/constants/flags.h index 21b730de3..798b42d4d 100644 --- a/include/constants/flags.h +++ b/include/constants/flags.h @@ -1402,7 +1402,7 @@ #define FLAG_SYS_TV_HOME (SYSTEM_FLAGS + 0x30) #define FLAG_SYS_TV_WATCH (SYSTEM_FLAGS + 0x31) #define FLAG_SYS_TV_START (SYSTEM_FLAGS + 0x32) -#define FLAG_SYS_POPWORD_INPUT (SYSTEM_FLAGS + 0x33) +#define FLAG_SYS_CHANGED_DEWFORD_TREND (SYSTEM_FLAGS + 0x33) #define FLAG_SYS_MIX_RECORD (SYSTEM_FLAGS + 0x34) #define FLAG_SYS_CLOCK_SET (SYSTEM_FLAGS + 0x35) #define FLAG_SYS_NATIONAL_DEX (SYSTEM_FLAGS + 0x36) diff --git a/include/constants/global.h b/include/constants/global.h index 213ccca5b..9b0c46ce4 100644 --- a/include/constants/global.h +++ b/include/constants/global.h @@ -52,6 +52,7 @@ #define NUM_CONTEST_WINNERS 13 #define UNION_ROOM_KB_ROW_COUNT 10 #define GIFT_RIBBONS_COUNT 11 +#define SAVED_TRENDS_COUNT 5 #define PYRAMID_BAG_ITEMS_COUNT 10 #define HALL_FACILITIES_COUNT 9 // 7 facilities for single mode + tower double mode + tower multi mode. diff --git a/include/dewford_trend.h b/include/dewford_trend.h index a7ed006f0..6a3194468 100644 --- a/include/dewford_trend.h +++ b/include/dewford_trend.h @@ -2,10 +2,9 @@ #define GUARD_DEWFORDTREND_H void InitDewfordTrend(void); -void UpdateDewfordTrendPerDay(u16); void UpdateDewfordTrendPerDay(u16 days); -bool8 IsPhraseTrendy(u16 *a); -void ReceiveEasyChatPairsData(struct EasyChatPair *a, size_t b, u8 unused); +bool8 TrySetTrendyPhrase(u16 *phrase); +void ReceiveDewfordTrendData(struct DewfordTrend *linkedTrends, size_t size, u8 unused); #endif // GUARD_DEWFORDTREND_H diff --git a/include/global.h b/include/global.h index 7806c0b59..497fb40b1 100644 --- a/include/global.h +++ b/include/global.h @@ -587,12 +587,13 @@ struct RamScript struct RamScriptData data; }; -struct EasyChatPair +// See dewford_trend.c +struct DewfordTrend { - u16 unk0_0:7; - u16 unk0_7:7; - u16 unk1_6:1; - u16 unk2; + u16 trendiness:7; + u16 maxTrendiness:7; + u16 gainingTrendiness:1; + u16 rand; u16 words[2]; }; /*size = 0x8*/ @@ -1021,7 +1022,7 @@ struct SaveBlock1 /*0x2BE0*/ struct MailStruct mail[MAIL_COUNT]; /*0x2E20*/ u8 additionalPhrases[8]; // bitfield for 33 additional phrases in easy chat system /*0x2E28*/ OldMan oldMan; - /*0x2e64*/ struct EasyChatPair easyChatPairs[5]; //Dewford trend [0] and some other stuff + /*0x2e64*/ struct DewfordTrend dewfordTrends[SAVED_TRENDS_COUNT]; /*0x2e90*/ struct ContestWinner contestWinners[NUM_CONTEST_WINNERS]; // see CONTEST_WINNER_* /*0x3030*/ struct DayCare daycare; /*0x3150*/ struct LinkBattleRecords linkBattleRecords; diff --git a/include/tv.h b/include/tv.h index 482909499..f94c5b7e5 100644 --- a/include/tv.h +++ b/include/tv.h @@ -31,7 +31,7 @@ void AlertTVThatPlayerPlayedRoulette(u16 nCoinsSpent); void AlertTVOfNewCoinTotal(u16 nCoinsPaidOut); void TryPutSecretBaseSecretsOnAir(void); void TryPutTodaysRivalTrainerOnAir(void); -void sub_80EDC60(const u16 *words); +void TryPutTrendWatcherOnAir(const u16 *words); void sub_80EDA80(void); void ReceivePokeNewsData(void *src, u32 size, u8 masterIdx); void sub_80F0BB8(void); -- cgit v1.2.3 From 771a4347309cd2f486072794d7de2c41b84c9b12 Mon Sep 17 00:00:00 2001 From: GriffinR Date: Wed, 31 Mar 2021 16:29:42 -0400 Subject: Label Trend Watcher TV show texts --- include/constants/tv.h | 9 +++++++++ include/event_scripts.h | 14 +++++++------- 2 files changed, 16 insertions(+), 7 deletions(-) (limited to 'include') diff --git a/include/constants/tv.h b/include/constants/tv.h index 72eae3f1c..57da9837b 100644 --- a/include/constants/tv.h +++ b/include/constants/tv.h @@ -206,4 +206,13 @@ #define SPOTCUTIES_STATE_RIBBON_EFFORT 14 #define SPOTCUTIES_STATE_OUTRO 15 +// TV Show states for Trend Watcher +#define TRENDWATCHER_STATE_INTRO 0 +#define TRENDWATCHER_STATE_TAUGHT_MALE 1 +#define TRENDWATCHER_STATE_TAUGHT_FEMALE 2 +#define TRENDWATCHER_STATE_PHRASE_HOPELESS 3 +#define TRENDWATCHER_STATE_BIGGER_MALE 4 +#define TRENDWATCHER_STATE_BIGGER_FEMALE 5 +#define TRENDWATCHER_STATE_OUTRO 6 + #endif //GUARD_CONSTANTS_TV_H diff --git a/include/event_scripts.h b/include/event_scripts.h index 79ef0ea14..ecb40c266 100644 --- a/include/event_scripts.h +++ b/include/event_scripts.h @@ -135,13 +135,13 @@ extern const u8 gTVTodaysRivalTrainerText03[]; extern const u8 gTVTodaysRivalTrainerText04[]; extern const u8 gTVTodaysRivalTrainerText05[]; extern const u8 gTVTodaysRivalTrainerText06[]; -extern const u8 gTVDewfordTrendWatcherNetworkText00[]; -extern const u8 gTVDewfordTrendWatcherNetworkText01[]; -extern const u8 gTVDewfordTrendWatcherNetworkText02[]; -extern const u8 gTVDewfordTrendWatcherNetworkText03[]; -extern const u8 gTVDewfordTrendWatcherNetworkText04[]; -extern const u8 gTVDewfordTrendWatcherNetworkText05[]; -extern const u8 gTVDewfordTrendWatcherNetworkText06[]; +extern const u8 TrendWatcher_Text_Intro[]; +extern const u8 TrendWatcher_Text_MaleTaughtMePhrase[]; +extern const u8 TrendWatcher_Text_FemaleTaughtMePhrase[]; +extern const u8 TrendWatcher_Text_PhraseWasHopeless[]; +extern const u8 TrendWatcher_Text_MaleTellMeBigger[]; +extern const u8 TrendWatcher_Text_FemaleTellMeBigger[]; +extern const u8 TrendWatcher_Text_Outro[]; extern const u8 gTVHoennTreasureInvestigatorsText00[]; extern const u8 gTVHoennTreasureInvestigatorsText01[]; extern const u8 gTVHoennTreasureInvestigatorsText02[]; -- cgit v1.2.3 From f58465a274fbae2275766c50206be1a364f21abc Mon Sep 17 00:00:00 2001 From: GriffinR Date: Thu, 1 Apr 2021 02:35:14 -0400 Subject: Document match_call.c --- include/match_call.h | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'include') diff --git a/include/match_call.h b/include/match_call.h index bc5f374bd..8aebb3bc7 100644 --- a/include/match_call.h +++ b/include/match_call.h @@ -17,7 +17,7 @@ bool32 IsMatchCallTaskActive(void); void StartMatchCallFromScript(const u8 *message); void BufferPokedexRatingForMatchCall(u8 *destStr); bool32 SelectMatchCallMessage(int, u8 *); -void sub_8197184(u32 windowId, u32 destOffset, u32 paletteId); -void sub_81971C4(u32 windowId, u32 tileOffset, u32 paletteId); +void LoadMatchCallWindowGfx(u32 windowId, u32 destOffset, u32 paletteId); +void DrawMatchCallTextBoxBorder(u32 windowId, u32 tileOffset, u32 paletteId); #endif //GUARD_MATCH_CALL_H -- cgit v1.2.3 From 8be2c5d60b54347c9df22410d97255d836d9fc9d Mon Sep 17 00:00:00 2001 From: GriffinR Date: Fri, 2 Apr 2021 01:49:38 -0400 Subject: Document Contest Lady TV Show --- include/constants/lilycove_lady.h | 10 ++++++++-- include/constants/tv.h | 8 +++++++- include/event_scripts.h | 8 ++++---- include/global.tv.h | 4 ++-- include/lilycove_lady.h | 2 +- 5 files changed, 22 insertions(+), 10 deletions(-) (limited to 'include') diff --git a/include/constants/lilycove_lady.h b/include/constants/lilycove_lady.h index 01f60ccf4..11b9b31e9 100644 --- a/include/constants/lilycove_lady.h +++ b/include/constants/lilycove_lady.h @@ -21,6 +21,12 @@ #define QUIZ_AUTHOR_NAME_PLAYER 1 #define QUIZ_AUTHOR_NAME_OTHER_PLAYER 2 -#define QUIZ_QUESTION_LEN 9 +#define QUIZ_QUESTION_LEN 9 -#endif +// Constants for how many good Pokéblocks the Contest Lady was given +// This determines how her performance is described when her TV show comes on +#define CONTEST_LADY_NORMAL 0 +#define CONTEST_LADY_GOOD 1 +#define CONTEST_LADY_BAD 2 + +#endif // GUARD_LILYCOVE_LADY_CONSTANTS_H diff --git a/include/constants/tv.h b/include/constants/tv.h index 57da9837b..f7b091f49 100644 --- a/include/constants/tv.h +++ b/include/constants/tv.h @@ -19,7 +19,7 @@ #define TVSHOW_3_CHEERS_FOR_POKEBLOCKS 9 #define TVSHOW_BATTLE_UPDATE 10 #define TVSHOW_FAN_CLUB_SPECIAL 11 -#define TVSHOW_CONTEST_LIVE_UPDATES_2 12 +#define TVSHOW_LILYCOVE_CONTEST_LADY 12 // // #define TVSHOW_POKEMON_TODAY_CAUGHT 21 #define TVSHOW_SMART_SHOPPER 22 @@ -215,4 +215,10 @@ #define TRENDWATCHER_STATE_BIGGER_FEMALE 5 #define TRENDWATCHER_STATE_OUTRO 6 +// TV Show states for the Contest Lady's Live Updates show +#define CONTESTLADYLIVE_STATE_INTRO 0 +#define CONTESTLADYLIVE_STATE_WON 1 +#define CONTESTLADYLIVE_STATE_LOST 2 +#define CONTESTLADYLIVE_STATE_LOST_BADLY 3 + #endif //GUARD_CONSTANTS_TV_H diff --git a/include/event_scripts.h b/include/event_scripts.h index ecb40c266..122af54cc 100644 --- a/include/event_scripts.h +++ b/include/event_scripts.h @@ -344,10 +344,10 @@ extern const u8 gTVInSearchOfTrainersText05[]; extern const u8 gTVInSearchOfTrainersText06[]; extern const u8 gTVInSearchOfTrainersText07[]; extern const u8 gTVInSearchOfTrainersText08[]; -extern const u8 gTVPokemonContestLiveUpdates2Text00[]; -extern const u8 gTVPokemonContestLiveUpdates2Text01[]; -extern const u8 gTVPokemonContestLiveUpdates2Text02[]; -extern const u8 gTVPokemonContestLiveUpdates2Text03[]; +extern const u8 ContestLadyShow_Text_Intro[]; +extern const u8 ContestLadyShow_Text_Won[]; +extern const u8 ContestLadyShow_Text_Lost[]; +extern const u8 ContestLadyShow_Text_LostBadly[]; extern const u8 gPokeNewsTextSlateport_Upcoming[]; extern const u8 gPokeNewsTextSlateport_Ongoing[]; extern const u8 gPokeNewsTextSlateport_Ending[]; diff --git a/include/global.tv.h b/include/global.tv.h index 8e1a898b6..64e6a984e 100644 --- a/include/global.tv.h +++ b/include/global.tv.h @@ -179,7 +179,7 @@ typedef union // size = 0x24 /*0x18*/ u8 idolNameLanguage; } fanClubSpecial; - // TVSHOW_CONTEST_LIVE_UPDATES_2 + // TVSHOW_LILYCOVE_CONTEST_LADY struct { /*0x00*/ u8 kind; /*0x01*/ bool8 active; @@ -189,7 +189,7 @@ typedef union // size = 0x24 /*0x16*/ u8 pokeblockState; /*0x17*/ u8 language; /*0x18*/ u8 pokemonNameLanguage; - } contestLiveUpdates2; + } contestLady; // Record Mixing Shows // TVSHOW_POKEMON_TODAY_CAUGHT diff --git a/include/lilycove_lady.h b/include/lilycove_lady.h index 1ec327be9..d3cce4ca8 100644 --- a/include/lilycove_lady.h +++ b/include/lilycove_lady.h @@ -12,6 +12,6 @@ void BufferContestLadyMonName(u8 *dest1, u8 *dest2); void BufferContestLadyPlayerName(u8 *dest); void BufferContestLadyLanguage(u8 *dest); void BufferContestName(u8 *dest, u8 category); -u8 sub_818E880(void); +u8 GetContestLadyPokeblockState(void); #endif //GUARD_LILYCOVE_LADY_H -- cgit v1.2.3 From c9d3b26ff7de11b39ceeb0c713cb7b821f2b03d3 Mon Sep 17 00:00:00 2001 From: GriffinR Date: Fri, 2 Apr 2021 02:12:46 -0400 Subject: Label miss string indexes --- include/constants/battle_script_commands.h | 1 + include/constants/battle_string_ids.h | 7 +++++++ 2 files changed, 8 insertions(+) (limited to 'include') diff --git a/include/constants/battle_script_commands.h b/include/constants/battle_script_commands.h index 9372377c4..cef0b184d 100644 --- a/include/constants/battle_script_commands.h +++ b/include/constants/battle_script_commands.h @@ -32,6 +32,7 @@ #define cEFFECT_CHOOSER gBattleCommunication + 3 #define cMULTISTRING_CHOOSER gBattleCommunication + 5 +#define cMISS_TYPE gBattleCommunication + 6 // Battle Script defines for getting the wanted battler #define BS_TARGET 0 diff --git a/include/constants/battle_string_ids.h b/include/constants/battle_string_ids.h index 1886043f1..f5b036b5d 100644 --- a/include/constants/battle_string_ids.h +++ b/include/constants/battle_string_ids.h @@ -383,4 +383,11 @@ #define STRINGID_TRAINER1WINTEXT 379 #define STRINGID_TRAINER2WINTEXT 380 +// Indexes into gMissStringIds +#define B_MSG_MISSED 0 +#define B_MSG_PROTECTED 1 +#define B_MSG_AVOIDED_ATK 2 +#define B_MSG_AVOIDED_DMG 3 +#define B_MSG_GROUND_MISS 4 + #endif // GUARD_CONSTANTS_BATTLE_STRING_IDS_H -- cgit v1.2.3 From 1b8d405b5e39de986954f8c3c7c3e15ea4a4967c Mon Sep 17 00:00:00 2001 From: GriffinR Date: Fri, 2 Apr 2021 12:54:40 -0400 Subject: Add missing include guard suffixes --- include/battle_gfx_sfx_util.h | 6 +++--- include/constants/metatile_behaviors.h | 6 +++--- include/gba/defines.h | 6 +++--- include/item_menu_icons.h | 6 +++--- include/metatile_behavior.h | 6 +++--- include/script_pokemon_util.h | 6 +++--- 6 files changed, 18 insertions(+), 18 deletions(-) (limited to 'include') diff --git a/include/battle_gfx_sfx_util.h b/include/battle_gfx_sfx_util.h index e3f549aa9..3288204d1 100644 --- a/include/battle_gfx_sfx_util.h +++ b/include/battle_gfx_sfx_util.h @@ -1,5 +1,5 @@ -#ifndef GUARD_BATTLE_GFX_SFX_UTIL -#define GUARD_BATTLE_GFX_SFX_UTIL +#ifndef GUARD_BATTLE_GFX_SFX_UTIL_H +#define GUARD_BATTLE_GFX_SFX_UTIL_H void AllocateBattleSpritesData(void); void FreeBattleSpritesData(void); @@ -45,4 +45,4 @@ void AllocateMonSpritesGfx(void); void FreeMonSpritesGfx(void); bool32 ShouldPlayNormalMonCry(struct Pokemon *mon); -#endif // GUARD_BATTLE_GFX_SFX_UTIL +#endif // GUARD_BATTLE_GFX_SFX_UTIL_H diff --git a/include/constants/metatile_behaviors.h b/include/constants/metatile_behaviors.h index 94cb0ffca..cc069c66c 100755 --- a/include/constants/metatile_behaviors.h +++ b/include/constants/metatile_behaviors.h @@ -1,5 +1,5 @@ -#ifndef GUARD_METATILE_BEHAVIORS -#define GUARD_METATILE_BEHAVIORS +#ifndef GUARD_METATILE_BEHAVIORS_H +#define GUARD_METATILE_BEHAVIORS_H #define MB_NORMAL 0x00 #define MB_SECRET_BASE_WALL 0x01 @@ -242,4 +242,4 @@ #define MB_UNUSED_EE 0xEE #define MB_UNUSED_EF 0xEF -#endif // GUARD_METATILE_BEHAVIORS +#endif // GUARD_METATILE_BEHAVIORS_H diff --git a/include/gba/defines.h b/include/gba/defines.h index 78c688593..ad06aaad2 100644 --- a/include/gba/defines.h +++ b/include/gba/defines.h @@ -1,5 +1,5 @@ -#ifndef GUARD_GBA_DEFINES -#define GUARD_GBA_DEFINES +#ifndef GUARD_GBA_DEFINES_H +#define GUARD_GBA_DEFINES_H #include @@ -76,4 +76,4 @@ #define TOTAL_OBJ_TILE_COUNT 1024 -#endif // GUARD_GBA_DEFINES +#endif // GUARD_GBA_DEFINES_H diff --git a/include/item_menu_icons.h b/include/item_menu_icons.h index e061149fc..7ff6ace94 100644 --- a/include/item_menu_icons.h +++ b/include/item_menu_icons.h @@ -1,5 +1,5 @@ -#ifndef GUARD_ITEM_MENU_ICONS -#define GUARD_ITEM_MENU_ICONS +#ifndef GUARD_ITEM_MENU_ICONS_H +#define GUARD_ITEM_MENU_ICONS_H extern const struct CompressedSpriteSheet gBagMaleSpriteSheet; extern const struct CompressedSpriteSheet gBagFemaleSpriteSheet; @@ -28,4 +28,4 @@ u8 CreateBerryFlavorCircleSprite(s16 x); #define TAG_BERRY_PIC_TILE 0xFFFF #define TAG_BERRY_PIC_PAL 0x7544 -#endif // GUARD_ITEM_MENU_ICONS +#endif // GUARD_ITEM_MENU_ICONS_H diff --git a/include/metatile_behavior.h b/include/metatile_behavior.h index d4bd9e683..584b3e546 100644 --- a/include/metatile_behavior.h +++ b/include/metatile_behavior.h @@ -1,5 +1,5 @@ -#ifndef GUARD_METATILE_BEHAVIOR -#define GUARD_METATILE_BEHAVIOR +#ifndef GUARD_METATILE_BEHAVIOR_H +#define GUARD_METATILE_BEHAVIOR_H bool8 MetatileBehavior_IsATile(u8); bool8 MetatileBehavior_IsEncounterTile(u8); @@ -146,4 +146,4 @@ bool8 MetatileBehavior_IsLongGrass_Duplicate(u8); bool8 MetatileBehavior_IsLongGrassSouthEdge(u8); bool8 MetatileBehavior_IsTrainerHillTimer(u8); -#endif // GUARD_METATILE_BEHAVIOR +#endif // GUARD_METATILE_BEHAVIOR_H diff --git a/include/script_pokemon_util.h b/include/script_pokemon_util.h index 120c28a63..cae16e40a 100644 --- a/include/script_pokemon_util.h +++ b/include/script_pokemon_util.h @@ -1,5 +1,5 @@ -#ifndef GUARD_SCRIPT_POKEMON_UTIL -#define GUARD_SCRIPT_POKEMON_UTIL +#ifndef GUARD_SCRIPT_POKEMON_UTIL_H +#define GUARD_SCRIPT_POKEMON_UTIL_H u8 ScriptGiveMon(u16, u8, u16, u32, u32, u8); u8 ScriptGiveEgg(u16); @@ -8,4 +8,4 @@ void ScriptSetMonMoveSlot(u8, u16, u8); void ReducePlayerPartyToSelectedMons(void); void HealPlayerParty(void); -#endif // GUARD_SCRIPT_POKEMON_UTIL +#endif // GUARD_SCRIPT_POKEMON_UTIL_H -- cgit v1.2.3 From 9ea9ffde09c9f3ca1772045935b3b0bd858232a0 Mon Sep 17 00:00:00 2001 From: GriffinR Date: Fri, 2 Apr 2021 02:27:12 -0400 Subject: Add remaining multistring chooser constants --- include/battle.h | 21 ++-- include/battle_ai_switch_items.h | 20 ++++ include/battle_message.h | 3 +- include/constants/battle.h | 4 + include/constants/battle_string_ids.h | 208 +++++++++++++++++++++++++++++++++- 5 files changed, 238 insertions(+), 18 deletions(-) (limited to 'include') diff --git a/include/battle.h b/include/battle.h index 954d33b07..14ecfbdd3 100644 --- a/include/battle.h +++ b/include/battle.h @@ -40,16 +40,17 @@ #define MAX_TRAINER_ITEMS 4 // array entries for battle communication -#define MULTIUSE_STATE 0x0 -#define CURSOR_POSITION 0x1 -#define TASK_ID 0x1 // task Id and cursor position share the same field -#define SPRITES_INIT_STATE1 0x1 // shares the Id as well -#define SPRITES_INIT_STATE2 0x2 -#define MOVE_EFFECT_BYTE 0x3 -#define ACTIONS_CONFIRMED_COUNT 0x4 -#define MULTISTRING_CHOOSER 0x5 -#define MSG_DISPLAY 0x7 -#define BATTLE_COMMUNICATION_ENTRIES_COUNT 0x8 +#define MULTIUSE_STATE 0 +#define CURSOR_POSITION 1 +#define TASK_ID 1 // task Id and cursor position share the same field +#define SPRITES_INIT_STATE1 1 // shares the Id as well +#define SPRITES_INIT_STATE2 2 +#define MOVE_EFFECT_BYTE 3 +#define ACTIONS_CONFIRMED_COUNT 4 +#define MULTISTRING_CHOOSER 5 +#define MISS_TYPE 6 +#define MSG_DISPLAY 7 +#define BATTLE_COMMUNICATION_ENTRIES_COUNT 8 #define MOVE_TARGET_SELECTED 0x0 #define MOVE_TARGET_DEPENDS 0x1 diff --git a/include/battle_ai_switch_items.h b/include/battle_ai_switch_items.h index 0a230e7f6..db390346d 100644 --- a/include/battle_ai_switch_items.h +++ b/include/battle_ai_switch_items.h @@ -11,6 +11,26 @@ enum AI_ITEM_NOT_RECOGNIZABLE }; +enum { + AI_HEAL_CONFUSION, + AI_HEAL_PARALYSIS, + AI_HEAL_FREEZE, + AI_HEAL_BURN, + AI_HEAL_POISON, + AI_HEAL_SLEEP, +}; + +enum { + AI_X_ATTACK, + AI_X_DEFEND, + AI_X_SPEED, + AI_X_SPATK, + AI_X_SPDEF, // Unused + AI_X_ACCURACY, + AI_X_EVASION, // Unused + AI_DIRE_HIT, +}; + void AI_TrySwitchOrUseItem(void); u8 GetMostSuitableMonToSwitchInto(void); diff --git a/include/battle_message.h b/include/battle_message.h index 011a1cb0c..da3009d63 100644 --- a/include/battle_message.h +++ b/include/battle_message.h @@ -223,7 +223,6 @@ extern const u8* const gBattleStringsTable[]; extern const u8* const gStatNamesTable[]; extern const u8* const gPokeblockWasTooXStringTable[]; extern const u8* const gRefereeStringsTable[]; -extern const u8* const gStatNamesTable2[]; extern const u8 *const gRoundsStringTable[]; extern const u8 gText_PkmnIsEvolving[]; @@ -269,7 +268,7 @@ extern const u8 gText_Win[]; extern const u8 gText_Loss[]; extern const u8 gText_Draw[]; extern const u8 gText_StatRose[]; -extern const u8 gText_PkmnsStatChanged2[]; +extern const u8 gText_DefendersStatRose[]; extern const u8 gText_PkmnGettingPumped[]; extern const u8 gText_PkmnShroudedInMist[]; extern const u8 gText_PkmnsXPreventsSwitching[]; diff --git a/include/constants/battle.h b/include/constants/battle.h index e6ebc85e4..3dbd83255 100644 --- a/include/constants/battle.h +++ b/include/constants/battle.h @@ -302,4 +302,8 @@ #define BATTLE_TERRAIN_BUILDING 8 #define BATTLE_TERRAIN_PLAIN 9 +#define B_WAIT_TIME_LONG 64 +#define B_WAIT_TIME_MED 48 +#define B_WAIT_TIME_SHORT 32 + #endif // GUARD_CONSTANTS_BATTLE_H diff --git a/include/constants/battle_string_ids.h b/include/constants/battle_string_ids.h index f5b036b5d..f1c589fee 100644 --- a/include/constants/battle_string_ids.h +++ b/include/constants/battle_string_ids.h @@ -214,10 +214,10 @@ #define STRINGID_STATROSE 210 #define STRINGID_STATHARSHLY 211 #define STRINGID_STATFELL 212 -#define STRINGID_PKMNSSTATCHANGED 213 -#define STRINGID_PKMNSSTATCHANGED2 214 -#define STRINGID_PKMNSSTATCHANGED3 215 -#define STRINGID_PKMNSSTATCHANGED4 216 +#define STRINGID_ATTACKERSSTATROSE 213 +#define STRINGID_DEFENDERSSTATROSE 214 +#define STRINGID_ATTACKERSSTATFELL 215 +#define STRINGID_DEFENDERSSTATFELL 216 #define STRINGID_CRITICALHIT 217 #define STRINGID_ONEHITKO 218 #define STRINGID_123POOF 219 @@ -326,7 +326,7 @@ #define STRINGID_SOOTHINGAROMA 322 #define STRINGID_ITEMSCANTBEUSEDNOW 323 #define STRINGID_FORXCOMMAYZ 324 -#define STRINGID_USINGXTHEYOFZN 325 +#define STRINGID_USINGITEMSTATOFPKMNROSE 325 #define STRINGID_PKMNUSEDXTOGETPUMPED 326 #define STRINGID_PKMNSXMADEYUSELESS 327 #define STRINGID_PKMNTRAPPEDBYSANDTOMB 328 @@ -383,11 +383,207 @@ #define STRINGID_TRAINER1WINTEXT 379 #define STRINGID_TRAINER2WINTEXT 380 -// Indexes into gMissStringIds + +// The below IDs are all indexes into battle message tables, +// used to determine which of a set of messages to print. +// They are assigned to the MULTISTRING_CHOOSER byte of gBattleCommunication +// and read when e.g. the command printfromtable is used. + +// gStatUpStringIds +#define B_MSG_ATTACKER_STAT_ROSE 0 +#define B_MSG_DEFENDER_STAT_ROSE 1 +#define B_MSG_STAT_WONT_INCREASE 2 +#define B_MSG_STAT_ROSE_EMPTY 3 +#define B_MSG_STAT_ROSE_ITEM 4 +#define B_MSG_USED_DIRE_HIT 5 + +// gStatDownStringIds +#define B_MSG_ATTACKER_STAT_FELL 0 +#define B_MSG_DEFENDER_STAT_FELL 1 +#define B_MSG_STAT_WONT_DECREASE 2 +#define B_MSG_STAT_FELL_EMPTY 3 + +// gMissStringIds #define B_MSG_MISSED 0 #define B_MSG_PROTECTED 1 #define B_MSG_AVOIDED_ATK 2 #define B_MSG_AVOIDED_DMG 3 #define B_MSG_GROUND_MISS 4 +// gAbsorbDrainStringIds +#define B_MSG_ABSORB 0 +#define B_MSG_ABSORB_OOZE 1 + +// gLeechSeedStringIds +#define B_MSG_LEECH_SEED_SET 0 +#define B_MSG_LEECH_SEED_MISS 1 +#define B_MSG_LEECH_SEED_FAIL 2 +#define B_MSG_LEECH_SEED_DRAIN 3 +#define B_MSG_LEECH_SEED_OOZE 4 + +// gBattlePalaceFlavorTextTable +#define B_MSG_GLINT_IN_EYE 0 +#define B_MSG_GETTING_IN_POS 1 +#define B_MSG_GROWL_DEEPLY 2 +#define B_MSG_EAGER_FOR_MORE 3 + +// gFirstTurnOfTwoStringIds +#define B_MSG_TURN1_RAZOR_WIND 0 +#define B_MSG_TURN1_SOLAR_BEAM 1 +#define B_MSG_TURN1_SKULL_BASH 2 +#define B_MSG_TURN1_SKY_ATTACK 3 +#define B_MSG_TURN1_FLY 4 +#define B_MSG_TURN1_DIG 5 +#define B_MSG_TURN1_DIVE 6 +#define B_MSG_TURN1_BOUNCE 7 + +// gMoveWeatherChangeStringIds +#define B_MSG_STARTED_RAIN 0 +#define B_MSG_STARTED_DOWNPOUR 1 +#define B_MSG_WEATHER_FAILED 2 +#define B_MSG_STARTED_SANDSTORM 3 +#define B_MSG_STARTED_SUNLIGHT 4 +#define B_MSG_STARTED_HAIL 5 + +// gRainContinuesStringIds +#define B_MSG_RAIN_CONTINUES 0 +#define B_MSG_DOWNPOUR_CONTINUES 1 +#define B_MSG_RAIN_STOPPED 2 + +// gSandStormHailContinuesStringIds / gSandStormHailDmgStringIds/ gSandStormHailEndStringIds +#define B_MSG_SANDSTORM 0 +#define B_MSG_HAIL 1 + +// gReflectLightScreenSafeguardStringIds +#define B_MSG_SIDE_STATUS_FAILED 0 +#define B_MSG_SET_REFLECT_SINGLE 1 +#define B_MSG_SET_REFLECT_DOUBLE 2 +#define B_MSG_SET_LIGHTSCREEN_SINGLE 3 +#define B_MSG_SET_LIGHTSCREEN_DOUBLE 4 +#define B_MSG_SET_SAFEGUARD 5 + +// gProtectLikeUsedStringIds +#define B_MSG_PROTECTED_ITSELF 0 +#define B_MSG_BRACED_ITSELF 1 +#define B_MSG_PROTECT_FAILED 2 + +// gRestUsedStringIds +#define B_MSG_REST 0 +#define B_MSG_REST_STATUSED 1 + +// gWokeUpStringIds +#define B_MSG_WOKE_UP 0 +#define B_MSG_WOKE_UP_UPROAR 1 + +// gUproarAwakeStringIds +#define B_MSG_CANT_SLEEP_UPROAR 0 +#define B_MSG_UPROAR_KEPT_AWAKE 1 +#define B_MSG_STAYED_AWAKE_USING 2 + +// gUproarOverTurnStringIds +#define B_MSG_UPROAR_CONTINUES 0 +#define B_MSG_UPROAR_ENDS 1 + +// gStockpileUsedStringIds +#define B_MSG_STOCKPILED 0 +#define B_MSG_CANT_STOCKPILE 1 + +// gSwallowFailStringIds +#define B_MSG_SWALLOW_FAILED 0 +#define B_MSG_SWALLOW_FULL_HP 1 + +// gKOFailedStringIds +#define B_MSG_KO_MISS 0 +#define B_MSG_KO_UNAFFECTED 1 + +// gMistUsedStringIds +#define B_MSG_SET_MIST 0 +#define B_MSG_MIST_FAILED 1 + +// gFocusEnergyUsedStringIds +#define B_MSG_GETTING_PUMPED 0 +#define B_MSG_FOCUS_ENERGY_FAILED 1 + +// gTransformUsedStringIds +#define B_MSG_TRANSFORMED 0 +#define B_MSG_TRANSFORM_FAILED 1 + +// gSubsituteUsedStringIds +#define B_MSG_SET_SUBSTITUTE 0 +#define B_MSG_SUBSTITUTE_FAILED 1 + +// gPartyStatusHealStringIds +#define B_MSG_BELL 0 +#define B_MSG_BELL_SOUNDPROOF_ATTACKER 1 +#define B_MSG_BELL_SOUNDPROOF_PARTNER 2 +#define B_MSG_BELL_BOTH_SOUNDPROOF 3 +#define B_MSG_SOOTHING_AROMA 4 + +// gFutureMoveUsedStringIds +#define B_MSG_FUTURE_SIGHT 0 +#define B_MSG_DOOM_DESIRE 1 + +// gItemSwapStringIds +#define B_MSG_ITEM_SWAP_TAKEN 0 +#define B_MSG_ITEM_SWAP_GIVEN 1 +#define B_MSG_ITEM_SWAP_BOTH 2 + +// gSportsUsedStringIds +#define B_MSG_WEAKEN_ELECTRIC 0 +#define B_MSG_WEAKEN_FIRE 1 + +// gCaughtMonStringIds +#define B_MSG_SENT_SOMEONES_PC 0 +#define B_MSG_SENT_LANETTES_PC 1 +#define B_MSG_SOMEONES_BOX_FULL 2 +#define B_MSG_LANETTES_BOX_FULL 3 + +// gInobedientStringIds +#define B_MSG_LOAFING 0 +#define B_MSG_WONT_OBEY 1 +#define B_MSG_TURNED_AWAY 2 +#define B_MSG_PRETEND_NOT_NOTICE 3 +#define B_MSG_INCAPABLE_OF_POWER 4 +// For randomly selecting a disobey string +// Skips the one used for Battle Palace +#define NUM_LOAF_STRINGS 4 + +// gSafariGetNearStringIds +#define B_MSG_CREPT_CLOSER 0 +#define B_MSG_CANT_GET_CLOSER 1 + +// gSafariPokeblockResultStringIds +#define B_MSG_MON_CURIOUS 0 +#define B_MSG_MON_ENTHRALLED 1 +#define B_MSG_MON_IGNORED 2 + +// gFlashFireStringIds +#define B_MSG_FLASH_FIRE_BOOST 0 +#define B_MSG_FLASH_FIRE_NO_BOOST 1 + +// gBerryEffectStringIds +#define B_MSG_CURED_PROBLEM 0 +#define B_MSG_NORMALIZED_STATUS 1 + +// gNoEscapeStringIds +#define B_MSG_CANT_ESCAPE 0 +#define B_MSG_DONT_LEAVE_BIRCH 1 +#define B_MSG_PREVENTS_ESCAPE 2 +#define B_MSG_CANT_ESCAPE_2 3 +#define B_MSG_ATTACKER_CANT_ESCAPE 4 + +// gGotPoisonedStringIds / gGotParalyzedStringIds / gFellAsleepStringIds +// gGotBurnedStringIds / gGotFrozenStringIds / gAttractUsedStringIds +#define B_MSG_STATUSED 0 +#define B_MSG_STATUSED_BY_ABILITY 1 + +// gBRNPreventionStringIds / gPRLZPreventionStringIds / gPSNPreventionStringIds +#define B_MSG_ABILITY_PREVENTS_MOVE_STATUS 0 +#define B_MSG_ABILITY_PREVENTS_ABILITY_STATUS 1 +#define B_MSG_STATUS_HAD_NO_EFFECT 2 + +// gGotDefrostedStringIds +#define B_MSG_DEFROSTED 0 +#define B_MSG_DEFROSTED_BY_MOVE 1 + #endif // GUARD_CONSTANTS_BATTLE_STRING_IDS_H -- cgit v1.2.3 From f4d8a91ba44d7bcf0f9df8db7ca5f7aeb688497f Mon Sep 17 00:00:00 2001 From: GriffinR Date: Sat, 3 Apr 2021 12:38:07 -0400 Subject: Misc battle script cleanup --- include/battle_controllers.h | 4 +-- include/constants/battle_script_commands.h | 48 ++++++++++++++++-------------- include/constants/battle_string_ids.h | 23 ++++++++++---- 3 files changed, 45 insertions(+), 30 deletions(-) (limited to 'include') diff --git a/include/battle_controllers.h b/include/battle_controllers.h index da76ab0c6..34e916b0f 100644 --- a/include/battle_controllers.h +++ b/include/battle_controllers.h @@ -156,7 +156,7 @@ enum CONTROLLER_CLEARUNKFLAG, CONTROLLER_TOGGLEUNKFLAG, CONTROLLER_HITANIMATION, - CONTROLLER_42, + CONTROLLER_CANTSWITCH, CONTROLLER_PLAYSE, CONTROLLER_PLAYFANFAREORBGM, CONTROLLER_FAINTINGCRY, @@ -227,7 +227,7 @@ void BtlController_EmitSetUnkVar(u8 bufferId, u8 b); // unused void BtlController_EmitClearUnkFlag(u8 bufferId); // unused void BtlController_EmitToggleUnkFlag(u8 bufferId); // unused void BtlController_EmitHitAnimation(u8 bufferId); -void BtlController_EmitCmd42(u8 bufferId); +void BtlController_EmitCantSwitch(u8 bufferId); void BtlController_EmitPlaySE(u8 bufferId, u16 songId); void BtlController_EmitPlayFanfareOrBGM(u8 bufferId, u16 songId, bool8 playBGM); void BtlController_EmitFaintingCry(u8 bufferId); diff --git a/include/constants/battle_script_commands.h b/include/constants/battle_script_commands.h index cef0b184d..9794589af 100644 --- a/include/constants/battle_script_commands.h +++ b/include/constants/battle_script_commands.h @@ -39,8 +39,10 @@ #define BS_ATTACKER 1 #define BS_EFFECT_BATTLER 2 #define BS_FAINTED 3 -#define BS_BATTLER_0 7 #define BS_ATTACKER_WITH_PARTNER 4 // for Cmd_updatestatusicon +#define BS_UNK_5 5 +#define BS_UNK_6 6 +#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 @@ -55,12 +57,12 @@ #define ACC_CURR_MOVE 0 // compare operands -#define CMP_EQUAL 0x0 -#define CMP_NOT_EQUAL 0x1 -#define CMP_GREATER_THAN 0x2 -#define CMP_LESS_THAN 0x3 -#define CMP_COMMON_BITS 0x4 -#define CMP_NO_COMMON_BITS 0x5 +#define CMP_EQUAL 0 +#define CMP_NOT_EQUAL 1 +#define CMP_GREATER_THAN 2 +#define CMP_LESS_THAN 3 +#define CMP_COMMON_BITS 4 +#define CMP_NO_COMMON_BITS 5 // Cmd_various #define VARIOUS_CANCEL_MULTI_TURN_MOVES 0 @@ -93,27 +95,29 @@ #define DMG_DOUBLED 2 // Cmd_jumpifcantswitch -#define SWITCH_IGNORE_ESCAPE_PREVENTION 0x80 +#define SWITCH_IGNORE_ESCAPE_PREVENTION (1 << 7) // Cmd_statbuffchange -#define STAT_BUFF_ALLOW_PTR 0x1 // If set, allow use of jumpptr. Set in every use of statbuffchange -#define STAT_BUFF_NOT_PROTECT_AFFECTED 0x20 +#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) // stat change flags for Cmd_playstatchangeanimation -#define STAT_CHANGE_NEGATIVE 0x1 -#define STAT_CHANGE_BY_TWO 0x2 -#define STAT_CHANGE_MULTIPLE_STATS 0x4 -#define STAT_CHANGE_CANT_PREVENT 0x8 +#define STAT_CHANGE_NEGATIVE (1 << 0) +#define STAT_CHANGE_BY_TWO (1 << 1) +#define STAT_CHANGE_MULTIPLE_STATS (1 << 2) +#define STAT_CHANGE_CANT_PREVENT (1 << 3) // stat flags for Cmd_playstatchangeanimation -#define BIT_HP 0x1 -#define BIT_ATK 0x2 -#define BIT_DEF 0x4 -#define BIT_SPEED 0x8 -#define BIT_SPATK 0x10 -#define BIT_SPDEF 0x20 -#define BIT_ACC 0x40 -#define BIT_EVASION 0x80 +#define BIT_HP (1 << 0) +#define BIT_ATK (1 << 1) +#define BIT_DEF (1 << 2) +#define BIT_SPEED (1 << 3) +#define BIT_SPATK (1 << 4) +#define BIT_SPDEF (1 << 5) +#define BIT_ACC (1 << 6) +#define BIT_EVASION (1 << 7) + +#define PARTY_SCREEN_OPTIONAL (1 << 7) // Flag for first argument to openpartyscreen // cases for Cmd_moveend #define MOVEEND_RAGE 0 diff --git a/include/constants/battle_string_ids.h b/include/constants/battle_string_ids.h index f1c589fee..f22541272 100644 --- a/include/constants/battle_string_ids.h +++ b/include/constants/battle_string_ids.h @@ -421,12 +421,6 @@ #define B_MSG_LEECH_SEED_DRAIN 3 #define B_MSG_LEECH_SEED_OOZE 4 -// gBattlePalaceFlavorTextTable -#define B_MSG_GLINT_IN_EYE 0 -#define B_MSG_GETTING_IN_POS 1 -#define B_MSG_GROWL_DEEPLY 2 -#define B_MSG_EAGER_FOR_MORE 3 - // gFirstTurnOfTwoStringIds #define B_MSG_TURN1_RAZOR_WIND 0 #define B_MSG_TURN1_SOLAR_BEAM 1 @@ -586,4 +580,21 @@ #define B_MSG_DEFROSTED 0 #define B_MSG_DEFROSTED_BY_MOVE 1 +// gBattlePalaceFlavorTextTable +#define B_MSG_GLINT_IN_EYE 0 +#define B_MSG_GETTING_IN_POS 1 +#define B_MSG_GROWL_DEEPLY 2 +#define B_MSG_EAGER_FOR_MORE 3 + +// gRefereeStringsTable +#define B_MSG_REF_NOTHING_IS_DECIDED 0 +#define B_MSG_REF_THATS_IT 1 +#define B_MSG_REF_JUDGE_MIND 2 +#define B_MSG_REF_JUDGE_SKILL 3 +#define B_MSG_REF_JUDGE_BODY 4 +#define B_MSG_REF_PLAYER_WON 5 +#define B_MSG_REF_OPPONENT_WON 6 +#define B_MSG_REF_DRAW 7 +#define B_MSG_REF_COMMENCE_BATTLE 8 + #endif // GUARD_CONSTANTS_BATTLE_STRING_IDS_H -- cgit v1.2.3 From b6711441f548dfac4a9b1c69d19aa3d28a3b1ec3 Mon Sep 17 00:00:00 2001 From: GriffinR Date: Sat, 3 Apr 2021 15:18:17 -0400 Subject: Fix AI Guard Spec use, and Specs->Spec --- include/battle_ai_switch_items.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'include') diff --git a/include/battle_ai_switch_items.h b/include/battle_ai_switch_items.h index db390346d..a0b6fe62c 100644 --- a/include/battle_ai_switch_items.h +++ b/include/battle_ai_switch_items.h @@ -7,7 +7,7 @@ enum AI_ITEM_HEAL_HP, AI_ITEM_CURE_CONDITION, AI_ITEM_X_STAT, - AI_ITEM_GUARD_SPECS, + AI_ITEM_GUARD_SPEC, AI_ITEM_NOT_RECOGNIZABLE }; -- cgit v1.2.3 From 1494a8303579e2bd92d24554b1f3e1cebd97a273 Mon Sep 17 00:00:00 2001 From: GriffinR Date: Sat, 3 Apr 2021 22:47:58 -0400 Subject: Sync drought with pokefirered, add weather tags --- include/field_weather.h | 28 +++++++++++++++++++++------- 1 file changed, 21 insertions(+), 7 deletions(-) (limited to 'include') diff --git a/include/field_weather.h b/include/field_weather.h index 9ecf52501..894c661be 100644 --- a/include/field_weather.h +++ b/include/field_weather.h @@ -4,6 +4,21 @@ #include "sprite.h" #include "constants/field_weather.h" +#define TAG_WEATHER_START 0x1200 +enum { + GFXTAG_CLOUD = TAG_WEATHER_START, + GFXTAG_FOG_H, + GFXTAG_ASH, + GFXTAG_FOG_D, + GFXTAG_SANDSTORM, + GFXTAG_BUBBLE, + GFXTAG_RAIN, +}; +enum { + PALTAG_WEATHER = TAG_WEATHER_START, + PALTAG_WEATHER_2 +}; + struct Weather { union @@ -105,10 +120,10 @@ struct Weather u8 blendFrameCounter; u8 blendDelay; u8 filler_73B[0x3C-0x3B]; - s16 unknown_73C; - s16 unknown_73E; - s16 unknown_740; - s16 unknown_742; + s16 droughtBrightnessStage; + s16 droughtLastBrightnessStage; + s16 droughtTimer; + s16 droughtState; u8 filler_744[0xD-4]; s8 loadDroughtPalsIndex; u8 loadDroughtPalsOffset; @@ -136,9 +151,8 @@ u8 sub_80ABF20(void); void LoadCustomWeatherSpritePalette(const u16 *palette); void ResetDroughtWeatherPaletteLoading(void); bool8 LoadDroughtWeatherPalettes(void); -void sub_80ABFE0(s8 gammaIndex); -void sub_80ABFF0(void); -void sub_80AC01C(void); +void DroughtStateInit(void); +void DroughtStateRun(void); void Weather_SetBlendCoeffs(u8 eva, u8 evb); void Weather_SetTargetBlendCoeffs(u8 eva, u8 evb, int delay); bool8 Weather_UpdateBlend(void); -- cgit v1.2.3 From b926fa6b0741cc878e4de5fe81183af12275d267 Mon Sep 17 00:00:00 2001 From: GriffinR Date: Sun, 4 Apr 2021 00:23:06 -0400 Subject: Document thunderstorm --- include/field_weather.h | 43 ++++++++++++++++++++++++------------------- 1 file changed, 24 insertions(+), 19 deletions(-) (limited to 'include') diff --git a/include/field_weather.h b/include/field_weather.h index 894c661be..48118c9a6 100644 --- a/include/field_weather.h +++ b/include/field_weather.h @@ -46,11 +46,11 @@ struct Weather u8 gammaStepDelay; u8 gammaStepFrameCounter; u16 fadeDestColor; - /*0x6C6*/ u8 palProcessingState; - /*0x6C7*/ u8 fadeScreenCounter; - /*0x6C8*/ bool8 readyForInit; - /*0x6C9*/ u8 taskId; - /*0x6CA*/ u8 unknown_6CA; + u8 palProcessingState; + u8 fadeScreenCounter; + bool8 readyForInit; + u8 taskId; + u8 unknown_6CA; u8 unknown_6CB; u16 initStep; u16 finishStep; @@ -60,6 +60,7 @@ struct Weather bool8 weatherChangeComplete; u8 weatherPicSpritePalIndex; u8 altGammaSpritePalIndex; + // Rain u16 rainSpriteVisibleCounter; u8 curRainSpriteIndex; u8 targetRainSpriteCount; @@ -67,37 +68,41 @@ struct Weather u8 rainSpriteVisibleDelay; u8 isDownpour; u8 rainStrength; - /*0x6DE*/ u8 cloudSpritesCreated; - u8 filler_6DF[1]; + u8 cloudSpritesCreated; + // Snow u16 snowflakeVisibleCounter; u16 unknown_6E2; u8 snowflakeSpriteCount; u8 targetSnowflakeSpriteCount; - u16 unknown_6E6; + // Thunderstorm + u16 thunderDelay; u16 thunderCounter; - u8 unknown_6EA; - u8 unknown_6EB; - u8 unknown_6EC; - u8 thunderTriggered; + bool8 thunderAllowEnd; + bool8 thunderSkipShort; + u8 thunderShortRetries; + bool8 thunderTriggered; + // Horizontal fog u16 fogHScrollPosX; u16 fogHScrollCounter; u16 fogHScrollOffset; u8 lightenedFogSpritePals[6]; u8 lightenedFogSpritePalsCount; u8 fogHSpritesCreated; + // Ash u16 ashBaseSpritesX; u16 unknown_6FE; u8 ashSpritesCreated; - u8 filler_701[3]; + // Sandstorm u32 sandstormXOffset; u32 sandstormYOffset; - u8 filler_70C[2]; + u16 sandstormUnused; u16 sandstormBaseSpritesX; u16 sandstormPosY; u16 sandstormWaveIndex; u16 sandstormWaveCounter; u8 sandstormSpritesCreated; u8 sandstormSwirlSpritesCreated; + // Diagonal fog u16 fogDBaseSpritesX; u16 fogDPosY; u16 fogDScrollXCounter; @@ -105,13 +110,13 @@ struct Weather u16 fogDXOffset; u16 fogDYOffset; u8 fogDSpritesCreated; - u8 filler_725[1]; + // Bubbles u16 bubblesDelayCounter; u16 bubblesDelayIndex; u16 bubblesCoordsIndex; u16 bubblesSpriteCount; u8 bubblesSpritesCreated; - u8 filler_72F; + u16 currBlendEVA; u16 currBlendEVB; u16 targetBlendEVA; @@ -119,12 +124,12 @@ struct Weather u8 blendUpdateCounter; u8 blendFrameCounter; u8 blendDelay; - u8 filler_73B[0x3C-0x3B]; + // Drought s16 droughtBrightnessStage; s16 droughtLastBrightnessStage; s16 droughtTimer; s16 droughtState; - u8 filler_744[0xD-4]; + u8 droughtUnused[9]; s8 loadDroughtPalsIndex; u8 loadDroughtPalsOffset; }; @@ -141,7 +146,7 @@ void StartWeather(void); void SetNextWeather(u8 weather); void SetCurrentAndNextWeather(u8 weather); void SetCurrentAndNextWeatherNoDelay(u8 weather); -void sub_80ABC48(s8 gammaIndex); +void ApplyWeatherGammaShiftIfIdle(s8 gammaIndex); void sub_80ABC7C(u8 gammaIndex, u8 gammaTargetIndex, u8 gammaStepDelay); void FadeScreen(u8 mode, s8 delay); bool8 IsWeatherNotFadingIn(void); -- cgit v1.2.3 From 5fa20534f9843d5ede403474e675be5330b8060d Mon Sep 17 00:00:00 2001 From: GriffinR Date: Sun, 4 Apr 2021 00:52:17 -0400 Subject: Label remaining fields in Weather struct --- include/field_weather.h | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) (limited to 'include') diff --git a/include/field_weather.h b/include/field_weather.h index 48118c9a6..696864983 100644 --- a/include/field_weather.h +++ b/include/field_weather.h @@ -50,8 +50,8 @@ struct Weather u8 fadeScreenCounter; bool8 readyForInit; u8 taskId; - u8 unknown_6CA; - u8 unknown_6CB; + u8 fadeInFirstFrame; + u8 fadeInTimer; u16 initStep; u16 finishStep; u8 currWeather; @@ -71,7 +71,7 @@ struct Weather u8 cloudSpritesCreated; // Snow u16 snowflakeVisibleCounter; - u16 unknown_6E2; + u16 snowflakeTimer; u8 snowflakeSpriteCount; u8 targetSnowflakeSpriteCount; // Thunderstorm @@ -90,7 +90,7 @@ struct Weather u8 fogHSpritesCreated; // Ash u16 ashBaseSpritesX; - u16 unknown_6FE; + u16 ashUnused; u8 ashSpritesCreated; // Sandstorm u32 sandstormXOffset; @@ -152,7 +152,6 @@ void FadeScreen(u8 mode, s8 delay); bool8 IsWeatherNotFadingIn(void); void UpdateSpritePaletteWithWeather(u8 spritePaletteIndex); void ApplyWeatherGammaShiftToPal(u8 paletteIndex); -u8 sub_80ABF20(void); void LoadCustomWeatherSpritePalette(const u16 *palette); void ResetDroughtWeatherPaletteLoading(void); bool8 LoadDroughtWeatherPalettes(void); -- cgit v1.2.3 From f90026826a0c4fb1f85a3e1648026392cb5072f9 Mon Sep 17 00:00:00 2001 From: GriffinR Date: Sun, 4 Apr 2021 17:52:07 -0400 Subject: Document some weather, field effects --- include/event_object_movement.h | 2 +- include/field_weather.h | 3 +-- 2 files changed, 2 insertions(+), 3 deletions(-) (limited to 'include') diff --git a/include/event_object_movement.h b/include/event_object_movement.h index 1e754dcd9..79b8921f0 100644 --- a/include/event_object_movement.h +++ b/include/event_object_movement.h @@ -198,7 +198,7 @@ u8 GetMoveDirectionFastestAnimNum(u8); u8 GetLedgeJumpDirection(s16, s16, u8); void CameraObjectSetFollowedObjectId(u8 objectId); u16 GetObjectPaletteTag(u8 palSlot); -void UpdateObjectEventSpriteVisibility(struct Sprite *sprite, bool8 invisible); +void UpdateObjectEventSpriteInvisibility(struct Sprite *sprite, bool8 invisible); s16 GetFigure8XOffset(s16 idx); s16 GetFigure8YOffset(s16 idx); void CameraObjectReset2(void); diff --git a/include/field_weather.h b/include/field_weather.h index 696864983..9c6a4ab7a 100644 --- a/include/field_weather.h +++ b/include/field_weather.h @@ -160,13 +160,12 @@ void DroughtStateRun(void); void Weather_SetBlendCoeffs(u8 eva, u8 evb); void Weather_SetTargetBlendCoeffs(u8 eva, u8 evb, int delay); bool8 Weather_UpdateBlend(void); -void sub_80AC274(u8 a); u8 GetCurrentWeather(void); void SetRainStrengthFromSoundEffect(u16 soundEffect); void PlayRainStoppingSoundEffect(void); u8 IsWeatherChangeComplete(void); void SetWeatherScreenFadeOut(void); -void sub_80AC3E4(void); +void SetWeatherPalStateIdle(void); void PreservePaletteInWeather(u8 preservedPalIndex); void ResetPreservedPalettesInWeather(void); -- cgit v1.2.3 From 553fe6239ab55ac456e80528bfe3a1697a05c2ed Mon Sep 17 00:00:00 2001 From: GriffinR Date: Mon, 5 Apr 2021 10:32:33 -0400 Subject: Document more field effects --- include/field_effect_helpers.h | 22 ++++++++++++++-------- 1 file changed, 14 insertions(+), 8 deletions(-) (limited to 'include') diff --git a/include/field_effect_helpers.h b/include/field_effect_helpers.h index 9b7b6ffd5..9795d96e8 100644 --- a/include/field_effect_helpers.h +++ b/include/field_effect_helpers.h @@ -1,16 +1,22 @@ #ifndef GUARD_FIELD_EFFECT_HELPERS_H #define GUARD_FIELD_EFFECT_HELPERS_H -// Exported type declarations +// States for bobbing up and down while surfing +enum { + // No bobbing + BOB_NONE, + // Both the surf blob/mon should bob up and down + BOB_PLAYER_AND_MON, + // Only the surf blob/mon should bob up and down + // For when the player has jumped/flown off + BOB_JUST_MON, +}; -// Exported RAM declarations - -// Exported ROM declarations u8 CreateWarpArrowSprite(void); -u8 sub_8155800(u8 oldSpriteId); -void SetSurfBobState(u8 spriteId, u8 value); -void SetSurfBobWhileFlyingOutState(u8 spriteId, u8 value); -void SetSurfBobWhileFishingState(u8 spriteId, u8 value, s16 data1); +u8 StartUnderwaterSurfBlobBobbing(u8 oldSpriteId); +void SetSurfBlob_BobState(u8 spriteId, u8 state); +void SetSurfBlob_DontSyncAnim(u8 spriteId, bool8 dontSync); +void SetSurfBlob_PlayerOffset(u8 spriteId, bool8 hasOffset, s16 offset); bool8 sub_8155DA0(struct ObjectEvent *); void sub_8155D78(struct ObjectEvent *); void StartAshFieldEffect(s16, s16, u16, s16); -- cgit v1.2.3 From 806abe2999ebb94b544c2d1db961fcec66c16537 Mon Sep 17 00:00:00 2001 From: GriffinR Date: Mon, 5 Apr 2021 19:52:35 -0400 Subject: Document some objev anims, make objevgfx info static --- include/event_object_movement.h | 1 - 1 file changed, 1 deletion(-) (limited to 'include') diff --git a/include/event_object_movement.h b/include/event_object_movement.h index 79b8921f0..446d0dd4e 100644 --- a/include/event_object_movement.h +++ b/include/event_object_movement.h @@ -65,7 +65,6 @@ struct LockedAnimObjectEvents u8 count; }; -extern const struct SpriteFrameImage gObjectEventPicTable_PechaBerryTree[]; extern const struct OamData gObjectEventBaseOam_32x8; extern const struct OamData gObjectEventBaseOam_32x32; extern const struct SpriteTemplate *const gFieldEffectObjectTemplatePointers[]; -- cgit v1.2.3 From 00c3044c96631b6e54bdf308d0b2ff9e3d27b9b7 Mon Sep 17 00:00:00 2001 From: GriffinR Date: Tue, 6 Apr 2021 02:38:15 -0400 Subject: Clarify Groudon/Kyogre/Rayquaza gfx names --- include/constants/event_objects.h | 16 ++++++++-------- include/constants/flags.h | 18 +++++++++--------- 2 files changed, 17 insertions(+), 17 deletions(-) (limited to 'include') diff --git a/include/constants/event_objects.h b/include/constants/event_objects.h index 8e026ef2d..7a224940f 100644 --- a/include/constants/event_objects.h +++ b/include/constants/event_objects.h @@ -42,7 +42,7 @@ #define OBJ_EVENT_GFX_SCHOOL_KID_M 38 #define OBJ_EVENT_GFX_MANIAC 39 #define OBJ_EVENT_GFX_HEX_MANIAC 40 -#define OBJ_EVENT_GFX_RAYQUAZA_1 41 +#define OBJ_EVENT_GFX_RAYQUAZA_STILL 41 #define OBJ_EVENT_GFX_SWIMMER_M 42 #define OBJ_EVENT_GFX_SWIMMER_F 43 #define OBJ_EVENT_GFX_BLACK_BELT 44 @@ -198,17 +198,17 @@ #define OBJ_EVENT_GFX_MAY_DECORATING 194 #define OBJ_EVENT_GFX_ARCHIE 195 #define OBJ_EVENT_GFX_MAXIE 196 -#define OBJ_EVENT_GFX_KYOGRE_1 197 -#define OBJ_EVENT_GFX_GROUDON_1 198 +#define OBJ_EVENT_GFX_KYOGRE_FRONT 197 +#define OBJ_EVENT_GFX_GROUDON_FRONT 198 #define OBJ_EVENT_GFX_FOSSIL 199 #define OBJ_EVENT_GFX_REGIROCK 200 #define OBJ_EVENT_GFX_REGICE 201 #define OBJ_EVENT_GFX_REGISTEEL 202 #define OBJ_EVENT_GFX_SKITTY 203 #define OBJ_EVENT_GFX_KECLEON 204 -#define OBJ_EVENT_GFX_KYOGRE_2 205 -#define OBJ_EVENT_GFX_GROUDON_2 206 -#define OBJ_EVENT_GFX_RAYQUAZA_2 207 +#define OBJ_EVENT_GFX_KYOGRE_ASLEEP 205 +#define OBJ_EVENT_GFX_GROUDON_ASLEEP 206 +#define OBJ_EVENT_GFX_RAYQUAZA 207 #define OBJ_EVENT_GFX_ZIGZAGOON_2 208 #define OBJ_EVENT_GFX_PIKACHU 209 #define OBJ_EVENT_GFX_AZUMARILL 210 @@ -222,8 +222,8 @@ #define OBJ_EVENT_GFX_JUAN 218 #define OBJ_EVENT_GFX_SCOTT 219 #define OBJ_EVENT_GFX_POOCHYENA 220 -#define OBJ_EVENT_GFX_KYOGRE_3 221 -#define OBJ_EVENT_GFX_GROUDON_3 222 +#define OBJ_EVENT_GFX_KYOGRE_SIDE 221 +#define OBJ_EVENT_GFX_GROUDON_SIDE 222 #define OBJ_EVENT_GFX_MYSTERY_GIFT_MAN 223 #define OBJ_EVENT_GFX_TRICK_HOUSE_STATUE 224 #define OBJ_EVENT_GFX_KIRLIA 225 diff --git a/include/constants/flags.h b/include/constants/flags.h index 798b42d4d..48606962a 100644 --- a/include/constants/flags.h +++ b/include/constants/flags.h @@ -91,10 +91,10 @@ #define FLAG_UNUSED_0x04F 0x4F // Unused Flag // Scripts -#define FLAG_HIDE_RAYQUAZA_SKY_TOWER_SUMMIT 0x50 -#define FLAG_SET_WALL_CLOCK 0x51 -#define FLAG_RESCUED_BIRCH 0x52 -#define FLAG_LEGENDARIES_IN_SOOTOPOLIS 0x53 +#define FLAG_HIDE_SKY_PILLAR_TOP_RAYQUAZA_STILL 0x50 +#define FLAG_SET_WALL_CLOCK 0x51 +#define FLAG_RESCUED_BIRCH 0x52 +#define FLAG_LEGENDARIES_IN_SOOTOPOLIS 0x53 #define FLAG_UNUSED_0x054 0x54 // Unused Flag #define FLAG_UNUSED_0x055 0x55 // Unused Flag @@ -775,7 +775,7 @@ #define FLAG_HIDE_LILYCOVE_FAN_CLUB_INTERVIEWER 0x2DA #define FLAG_HIDE_RUSTBORO_CITY_AQUA_GRUNT 0x2DB #define FLAG_HIDE_RUSTBORO_CITY_DEVON_EMPLOYEE_1 0x2DC -#define FLAG_HIDE_SEAFLOOR_CAVERN_ROOM_9_KYOGRE_2 0x2DD +#define FLAG_HIDE_SEAFLOOR_CAVERN_ROOM_9_KYOGRE_ASLEEP 0x2DD #define FLAG_HIDE_PLAYERS_HOUSE_DAD 0x2DE #define FLAG_HIDE_LITTLEROOT_TOWN_BRENDANS_HOUSE_RIVAL_SIBLING 0x2DF #define FLAG_HIDE_LITTLEROOT_TOWN_MAYS_HOUSE_RIVAL_SIBLING 0x2E0 @@ -815,7 +815,7 @@ #define FLAG_HIDE_ROUTE_111_VIVI_WINSTRATE 0x302 #define FLAG_HIDE_ROUTE_111_VICKY_WINSTRATE 0x303 #define FLAG_HIDE_PETALBURG_GYM_NORMAN 0x304 -#define FLAG_HIDE_SKY_PILLAR_TOP_RAYQUAZA_2 0x305 +#define FLAG_HIDE_SKY_PILLAR_TOP_RAYQUAZA 0x305 #define FLAG_HIDE_LILYCOVE_CONTEST_HALL_CONTEST_ATTENDANT_1 0x306 #define FLAG_HIDE_LILYCOVE_MUSEUM_CURATOR 0x307 #define FLAG_HIDE_LILYCOVE_MUSEUM_PATRON_1 0x308 @@ -892,16 +892,16 @@ #define FLAG_HIDE_JAGGED_PASS_MAGMA_GUARD 0x34F #define FLAG_HIDE_SLATEPORT_CITY_HARBOR_SUBMARINE_SHADOW 0x350 #define FLAG_HIDE_LITTLEROOT_TOWN_MAYS_HOUSE_2F_PICHU_DOLL 0x351 -#define FLAG_HIDE_MAGMA_HIDEOUT_4F_GROUDON_2 0x352 +#define FLAG_HIDE_MAGMA_HIDEOUT_4F_GROUDON_ASLEEP 0x352 #define FLAG_HIDE_ROUTE_119_RIVAL 0x353 #define FLAG_HIDE_LILYCOVE_CITY_AQUA_GRUNTS 0x354 -#define FLAG_HIDE_MAGMA_HIDEOUT_4F_GROUDON_1 0x355 +#define FLAG_HIDE_MAGMA_HIDEOUT_4F_GROUDON 0x355 #define FLAG_HIDE_SOOTOPOLIS_CITY_RESIDENTS 0x356 #define FLAG_HIDE_SKY_PILLAR_WALLACE 0x357 #define FLAG_HIDE_MT_PYRE_SUMMIT_MAXIE 0x358 #define FLAG_HIDE_MAGMA_HIDEOUT_GRUNTS 0x359 #define FLAG_HIDE_VICTORY_ROAD_ENTRANCE_WALLY 0x35A -#define FLAG_HIDE_SEAFLOOR_CAVERN_ROOM_9_KYOGRE_1 0x35B +#define FLAG_HIDE_SEAFLOOR_CAVERN_ROOM_9_KYOGRE 0x35B #define FLAG_HIDE_SLATEPORT_CITY_HARBOR_SS_TIDAL 0x35C #define FLAG_HIDE_LILYCOVE_HARBOR_SSTIDAL 0x35D #define FLAG_HIDE_MOSSDEEP_CITY_SPACE_CENTER_2F_TEAM_MAGMA 0x35E -- cgit v1.2.3 From 756fad0e61e62e71af6cf451257f882691c004b0 Mon Sep 17 00:00:00 2001 From: GriffinR Date: Tue, 6 Apr 2021 05:05:33 -0400 Subject: Document some event object movement --- include/constants/event_object_movement.h | 3 ++- include/event_object_movement.h | 16 ++++------------ include/field_player_avatar.h | 2 +- 3 files changed, 7 insertions(+), 14 deletions(-) (limited to 'include') diff --git a/include/constants/event_object_movement.h b/include/constants/event_object_movement.h index 223650081..13e91c415 100755 --- a/include/constants/event_object_movement.h +++ b/include/constants/event_object_movement.h @@ -237,11 +237,12 @@ #define MOVEMENT_ACTION_WALK_RIGHT_AFFINE 0x97 #define MOVEMENT_ACTION_LEVITATE 0x98 #define MOVEMENT_ACTION_STOP_LEVITATE 0x99 -#define MOVEMENT_ACTION_DESTROY_EXTRA_TASK_IF_AT_TOP 0x9A +#define MOVEMENT_ACTION_STOP_LEVITATE_AT_TOP 0x9A #define MOVEMENT_ACTION_FIGURE_8 0x9B #define MOVEMENT_ACTION_FLY_UP 0x9C #define MOVEMENT_ACTION_FLY_DOWN 0x9D #define MOVEMENT_ACTION_STEP_END 0xFE +#define MOVEMENT_ACTION_NONE 0xFF #endif // GUARD_CONSTANTS_EVENT_OBJECT_MOVEMENT_H diff --git a/include/event_object_movement.h b/include/event_object_movement.h index 446d0dd4e..9deacfbb7 100644 --- a/include/event_object_movement.h +++ b/include/event_object_movement.h @@ -86,9 +86,9 @@ void LoadPlayerObjectReflectionPalette(u16, u8); void LoadSpecialObjectReflectionPalette(u16, u8); void TryMoveObjectEventToMapCoords(u8, u8, u8, s16, s16); void PatchObjectPalette(u16, u8); -void sub_808E16C(s16, s16); +void SpawnObjectEventsOnReturnToField(s16, s16); void OverrideSecretBaseDecorationSpriteScript(u8 localId, u8 mapNum, u8 mapGroup, u8 decorCat); -void sub_8092FF0(s16, s16, s16 *, s16 *); +void GetMapCoordsFromSpritePos(s16, s16, s16 *, s16 *); u8 GetFaceDirectionAnimNum(u8); void SetSpritePosToOffsetMapCoords(s16 *, s16 *, s16, s16); void ObjectEventClearHeldMovement(struct ObjectEvent *); @@ -110,7 +110,7 @@ void FreeAndReserveObjectSpritePalettes(void); void SetObjectEventSpritePosByLocalIdAndMap(u8 localId, u8 mapNum, u8 mapGroup, s16 x, s16 y); void ResetObjectPriority(u8, u8, u8); void SetObjectPriority(u8, u8, u8, u8); -void sub_808E75C(s16, s16); +void AllowObjectAtPosTriggerGroundEffects(s16, s16); void ObjectEventGetLocalIdAndMap(struct ObjectEvent *objectEvent, void *localId, void *mapNum, void *mapGroup); void ShiftObjectEventCoords(struct ObjectEvent *, s16, s16); void MoveObjectEventToMapCoords(struct ObjectEvent *, s16, s16); @@ -175,16 +175,8 @@ bool8 IsZCoordMismatchAt(u8, s16, s16); void UnfreezeObjectEvent(struct ObjectEvent *); u8 FindLockedObjectEventIndex(struct ObjectEvent *); bool8 obj_npc_ministep(struct Sprite *sprite); -bool8 sub_80976EC(struct Sprite *sprite); -void sub_80976DC(struct Sprite *, u8); -void sub_809783C(struct Sprite *, u8, u8, u8); -void DoShadowFieldEffect(struct ObjectEvent *); -u8 sub_809785C(struct Sprite *); -u8 sub_80978E4(struct Sprite *); void SetAndStartSpriteAnim(struct Sprite *, u8, u8); bool8 SpriteAnimEnded(struct Sprite *); -void CreateLevitateMovementTask(struct ObjectEvent *); -void DestroyExtraMovementTask(u8); void UnfreezeObjectEvents(void); void FreezeObjectEventsExceptOne(u8 objectEventId); void TurnObjectEventSprite(u8, u8); @@ -195,7 +187,7 @@ u8 GetMoveDirectionFastAnimNum(u8); u8 GetMoveDirectionFasterAnimNum(u8); u8 GetMoveDirectionFastestAnimNum(u8); u8 GetLedgeJumpDirection(s16, s16, u8); -void CameraObjectSetFollowedObjectId(u8 objectId); +void CameraObjectSetFollowedSpriteId(u8 objectId); u16 GetObjectPaletteTag(u8 palSlot); void UpdateObjectEventSpriteInvisibility(struct Sprite *sprite, bool8 invisible); s16 GetFigure8XOffset(s16 idx); diff --git a/include/field_player_avatar.h b/include/field_player_avatar.h index c30ce0b6f..903fe6ef1 100644 --- a/include/field_player_avatar.h +++ b/include/field_player_avatar.h @@ -6,7 +6,7 @@ void ClearPlayerAvatarInfo(void); void SetPlayerAvatarExtraStateTransition(u8, u8); u8 GetPlayerAvatarGenderByGraphicsId(u8); bool8 TestPlayerAvatarFlags(u8); -u8 GetPlayerAvatarObjectId(void); +u8 GetPlayerAvatarSpriteId(void); void PlayerGetDestCoords(s16 *, s16 *); u8 GetPlayerFacingDirection(void); u8 GetPlayerMovementDirection(void); -- cgit v1.2.3 From 8bad478b4999e762eb26cef0a9b6b07891236370 Mon Sep 17 00:00:00 2001 From: GriffinR Date: Tue, 6 Apr 2021 14:51:39 -0400 Subject: Document disguise field effects --- include/field_effect_helpers.h | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'include') diff --git a/include/field_effect_helpers.h b/include/field_effect_helpers.h index 9795d96e8..528492d81 100644 --- a/include/field_effect_helpers.h +++ b/include/field_effect_helpers.h @@ -17,8 +17,8 @@ u8 StartUnderwaterSurfBlobBobbing(u8 oldSpriteId); void SetSurfBlob_BobState(u8 spriteId, u8 state); void SetSurfBlob_DontSyncAnim(u8 spriteId, bool8 dontSync); void SetSurfBlob_PlayerOffset(u8 spriteId, bool8 hasOffset, s16 offset); -bool8 sub_8155DA0(struct ObjectEvent *); -void sub_8155D78(struct ObjectEvent *); +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*); -- cgit v1.2.3 From 86a9d94ce1eb7930cb9a59ad8f968388a627c58a Mon Sep 17 00:00:00 2001 From: GriffinR Date: Tue, 6 Apr 2021 16:05:43 -0400 Subject: Document fieldmap --- include/constants/metatile_behaviors.h | 1 + include/fieldmap.h | 7 ++----- include/global.fieldmap.h | 5 ++++- 3 files changed, 7 insertions(+), 6 deletions(-) (limited to 'include') diff --git a/include/constants/metatile_behaviors.h b/include/constants/metatile_behaviors.h index 94cb0ffca..5120bd9dc 100755 --- a/include/constants/metatile_behaviors.h +++ b/include/constants/metatile_behaviors.h @@ -241,5 +241,6 @@ #define MB_UNUSED_ED 0xED #define MB_UNUSED_EE 0xEE #define MB_UNUSED_EF 0xEF +#define MB_INVALID 0xFF #endif // GUARD_METATILE_BEHAVIORS diff --git a/include/fieldmap.h b/include/fieldmap.h index 438fb4787..5bcbe20ea 100644 --- a/include/fieldmap.h +++ b/include/fieldmap.h @@ -20,16 +20,13 @@ void MapGridSetMetatileEntryAt(int, int, u16); void GetCameraCoords(u16*, u16*); bool8 MapGridIsImpassableAt(int, int); int GetMapBorderIdAt(int x, int y); -int CanCameraMoveInDirection(int direction); +bool32 CanCameraMoveInDirection(int direction); u16 GetBehaviorByMetatileId(u16 metatileId); void GetCameraFocusCoords(u16 *x, u16 *y); u8 MapGridGetMetatileLayerTypeAt(int x, int y); u8 MapGridGetZCoordAt(int x, int y); bool8 CameraMove(int deltaX, int deltaY); -struct MapConnection *sub_8088950(u8 direction, int x, int y); -bool8 sub_80889A8(u8 direction, int x, int y, struct MapConnection *connection); -bool8 sub_8088A0C(int x, int src_width, int dest_width, int offset); -void save_serialize_map(void); +void SaveMapView(void); void SetCameraFocusCoords(u16 x, u16 y); void InitMap(void); void InitMapFromSavedGame(void); diff --git a/include/global.fieldmap.h b/include/global.fieldmap.h index c4d7be35d..a3d99ee21 100644 --- a/include/global.fieldmap.h +++ b/include/global.fieldmap.h @@ -1,6 +1,7 @@ #ifndef GUARD_GLOBAL_FIELDMAP_H #define GUARD_GLOBAL_FIELDMAP_H +#define METATILE_BEHAVIOR_MASK 0x00FF #define METATILE_COLLISION_MASK 0x0C00 #define METATILE_ID_MASK 0x03FF #define METATILE_ID_UNDEFINED 0x03FF @@ -12,7 +13,9 @@ enum { - CONNECTION_SOUTH = 1, + CONNECTION_INVALID = -1, + CONNECTION_NONE, + CONNECTION_SOUTH, CONNECTION_NORTH, CONNECTION_WEST, CONNECTION_EAST, -- cgit v1.2.3 From 4a1cfbead245b3cac609b498dfca6b6d238f7f7a Mon Sep 17 00:00:00 2001 From: GriffinR Date: Tue, 6 Apr 2021 16:55:33 -0400 Subject: Document remaining overworld --- include/cable_club.h | 1 + include/constants/cable_club.h | 4 ++++ include/event_scripts.h | 2 +- include/global.h | 10 ---------- include/overworld.h | 17 ++++++++--------- 5 files changed, 14 insertions(+), 20 deletions(-) (limited to 'include') diff --git a/include/cable_club.h b/include/cable_club.h index a5a6acfa4..c493691c1 100644 --- a/include/cable_club.h +++ b/include/cable_club.h @@ -2,6 +2,7 @@ #define GUARD_CABLE_CLUB_H #include "task.h" +#include "constants/cable_club.h" void CreateTask_EnterCableClubSeat(TaskFunc taskFunc); u8 CreateTask_ReestablishCableClubLink(void); diff --git a/include/constants/cable_club.h b/include/constants/cable_club.h index cbdd049db..3515ffa2c 100644 --- a/include/constants/cable_club.h +++ b/include/constants/cable_club.h @@ -28,4 +28,8 @@ #define LINKUP_FAILED_BATTLE_TOWER 11 #define LINKUP_FOREIGN_GAME 12 +#define CABLE_SEAT_WAITING 0 +#define CABLE_SEAT_SUCCESS 1 +#define CABLE_SEAT_FAILED 2 + #endif //GUARD_CONSTANTS_CABLE_CLUB_H diff --git a/include/event_scripts.h b/include/event_scripts.h index ecb40c266..f5151ce20 100644 --- a/include/event_scripts.h +++ b/include/event_scripts.h @@ -607,7 +607,7 @@ extern const u8 EventScript_BattleColosseum_2P_PlayerSpot0[]; extern const u8 EventScript_BattleColosseum_2P_PlayerSpot1[]; extern const u8 EventScript_TradeCenter_Chair1[]; extern const u8 EventScript_TradeCenter_Chair0[]; -extern const u8 EventScript_ConfirmLeaveTradeRoom[]; +extern const u8 EventScript_ConfirmLeaveCableClubRoom[]; extern const u8 EventScript_TerminateLink[]; #endif // GUARD_EVENT_SCRIPTS_H diff --git a/include/global.h b/include/global.h index 497fb40b1..18e2bfea7 100644 --- a/include/global.h +++ b/include/global.h @@ -1055,14 +1055,4 @@ struct MapPosition s8 height; }; -struct TradeRoomPlayer -{ - u8 playerId; - u8 isLocalPlayer; - u8 c; - u8 facing; - struct MapPosition pos; - u16 field_C; -}; - #endif // GUARD_GLOBAL_H diff --git a/include/overworld.h b/include/overworld.h index 6efaa6ccb..16c75861c 100644 --- a/include/overworld.h +++ b/include/overworld.h @@ -7,17 +7,17 @@ #define LINK_KEY_CODE_DPAD_UP 0x13 #define LINK_KEY_CODE_DPAD_LEFT 0x14 #define LINK_KEY_CODE_DPAD_RIGHT 0x15 -#define LINK_KEY_CODE_UNK_2 0x16 +#define LINK_KEY_CODE_READY 0x16 #define LINK_KEY_CODE_EXIT_ROOM 0x17 #define LINK_KEY_CODE_START_BUTTON 0x18 #define LINK_KEY_CODE_A_BUTTON 0x19 -#define LINK_KEY_CODE_UNK_4 0x1A // I'd guess this is the B button? +#define LINK_KEY_CODE_IDLE 0x1A // These two are a hack to stop user input until link stuff can be // resolved. #define LINK_KEY_CODE_HANDLE_RECV_QUEUE 0x1B #define LINK_KEY_CODE_HANDLE_SEND_QUEUE 0x1C -#define LINK_KEY_CODE_UNK_7 0x1D +#define LINK_KEY_CODE_EXIT_SEAT 0x1D #define LINK_KEY_CODE_UNK_8 0x1E #define MOVEMENT_MODE_FREE 0 @@ -143,15 +143,14 @@ void CB2_ReturnToFieldFromMultiplayer(void); void CB2_ReturnToFieldWithOpenMenu(void); void CB2_ReturnToFieldContinueScript(void); void CB2_ReturnToFieldContinueScriptPlayMapMusic(void); -void sub_80861E8(void); +void CB2_ReturnToFieldFadeFromBlack(void); void CB2_ContinueSavedGame(void); void ResetAllMultiplayerState(void); -u32 sub_8087214(void); -bool32 sub_808727C(void); -u16 sub_8087288(void); -u16 sub_808729C(void); +u32 GetCableClubPartnersReady(void); +u16 SetInCableClubSeat(void); +u16 SetLinkWaitingForScript(void); u16 QueueExitLinkRoomKey(void); -u16 sub_80872C4(void); +u16 SetStartedCableClubActivity(void); bool32 Overworld_LinkRecvQueueLengthMoreThan2(void); bool32 Overworld_RecvKeysFromLinkIsRunning(void); bool32 Overworld_SendKeysToLinkIsRunning(void); -- cgit v1.2.3 From 0dc7ff89945d471a62659b3d9f21cb7f50f331eb Mon Sep 17 00:00:00 2001 From: GriffinR Date: Tue, 6 Apr 2021 17:17:41 -0400 Subject: Minor misc field doc --- include/field_camera.h | 7 +------ 1 file changed, 1 insertion(+), 6 deletions(-) (limited to 'include') diff --git a/include/field_camera.h b/include/field_camera.h index 2bed02b20..b245fca84 100644 --- a/include/field_camera.h +++ b/include/field_camera.h @@ -1,8 +1,6 @@ #ifndef GUARD_FIELD_CAMERA_H #define GUARD_FIELD_CAMERA_H -// Exported type declarations - struct CameraObject { void (*callback)(struct CameraObject *); @@ -13,18 +11,15 @@ struct CameraObject s32 y; }; -// Exported RAM declarations extern struct CameraObject gFieldCamera; extern u16 gTotalCameraPixelOffsetX; extern u16 gTotalCameraPixelOffsetY; -// Exported ROM declarations void DrawWholeMapView(void); void CurrentMapDrawMetatileAt(int x, int y); -void sub_8089C08(s16 *a0, s16 *a1); +void GetCameraOffsetWithPan(s16 *a0, s16 *a1); void DrawDoorMetatileAt(int x, int y, u16 *arr); void ResetFieldCamera(void); -void sub_8057A58(void); void ResetCameraUpdateInfo(void); u32 InitCameraUpdateCallback(u8 a); void CameraUpdate(void); -- cgit v1.2.3 From d717a635c89e9fc44feb45153c267f3ff38ef497 Mon Sep 17 00:00:00 2001 From: GriffinR Date: Tue, 6 Apr 2021 17:55:29 -0400 Subject: event_object_movement cleanup --- include/event_object_movement.h | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) (limited to 'include') diff --git a/include/event_object_movement.h b/include/event_object_movement.h index 9deacfbb7..a935502e6 100644 --- a/include/event_object_movement.h +++ b/include/event_object_movement.h @@ -47,7 +47,7 @@ enum ReflectionTypes #define GROUND_EFFECT_FLAG_HOT_SPRINGS (1 << 18) #define GROUND_EFFECT_FLAG_SEAWEED (1 << 19) -struct UnkStruct_085094AC +struct StepAnimTable { const union AnimCmd *const *anims; u8 animPos[4]; @@ -174,7 +174,6 @@ void SetObjectSubpriorityByZCoord(u8, struct Sprite *, u8); bool8 IsZCoordMismatchAt(u8, s16, s16); void UnfreezeObjectEvent(struct ObjectEvent *); u8 FindLockedObjectEventIndex(struct ObjectEvent *); -bool8 obj_npc_ministep(struct Sprite *sprite); void SetAndStartSpriteAnim(struct Sprite *, u8, u8); bool8 SpriteAnimEnded(struct Sprite *); void UnfreezeObjectEvents(void); -- cgit v1.2.3 From 72ba8cf58de8297c56d2269e0519064dc2de5f76 Mon Sep 17 00:00:00 2001 From: GriffinR Date: Fri, 9 Apr 2021 12:41:02 -0400 Subject: Document pokemon animation types --- include/constants/battle_anim.h | 29 ------- include/pokemon_animation.h | 182 +++++++++++++++++++++++++++++++++++++++ include/pokemon_summary_screen.h | 3 +- 3 files changed, 183 insertions(+), 31 deletions(-) (limited to 'include') diff --git a/include/constants/battle_anim.h b/include/constants/battle_anim.h index 5f8900bf6..4622876cc 100644 --- a/include/constants/battle_anim.h +++ b/include/constants/battle_anim.h @@ -410,33 +410,4 @@ #define ANIM_WEATHER_SANDSTORM 3 #define ANIM_WEATHER_HAIL 4 -// Battle mon back animations. -#define BACK_ANIM_NONE 0x00 -#define BACK_ANIM_H_SLIDE_QUICK 0x01 -#define BACK_ANIM_H_SLIDE 0x02 -#define BACK_ANIM_H_SLIDE_WITH_V_COMPRESS_1 0x03 -#define BACK_ANIM_H_SLIDE_WITH_V_COMPRESS_2 0x04 -#define BACK_ANIM_SHRINK_GROW_1 0x05 -#define BACK_ANIM_GROW_1 0x06 -#define BACK_ANIM_CIRCLE_MOVE_COUNTERCLOCKWISE 0x07 -#define BACK_ANIM_HORIZONTAL_SHAKE 0x08 -#define BACK_ANIM_VERTICAL_SHAKE 0x09 -#define BACK_ANIM_V_SHAKE_WITH_H_SLIDE 0x0a -#define BACK_ANIM_VERTICAL_STRETCH 0x0b -#define BACK_ANIM_HORIZONTAL_STRETCH 0x0c -#define BACK_ANIM_GROW_2 0x0d -#define BACK_ANIM_V_SHAKE_WITH_PAUSE 0x0e -#define BACK_ANIM_CIRCLE_MOVE_CLOCKWISE 0x0f -#define BACK_ANIM_CONCAVE_DOWN_ARC_SWAY_SMALL 0x10 -#define BACK_ANIM_CONCAVE_DOWN_ARC_SWAY_LARGE 0x11 -#define BACK_ANIM_CONCAVE_UP_ARC_SWAY_LARGE 0x12 -#define BACK_ANIM_DIP_RIGHT_SIDE 0x13 -#define BACK_ANIM_SHRINK_GROW_2 0x14 -#define BACK_ANIM_JOLT_RIGHT 0x15 -#define BACK_ANIM_FLASH_YELLOW_WITH_SHAKE 0x16 -#define BACK_ANIM_FADE_RED_WITH_SHAKE 0x17 -#define BACK_ANIM_FADE_GREEN_WITH_SHAKE 0x18 -#define BACK_ANIM_FADE_BLUE_WITH_SHAKE 0x19 - - #endif // GUARD_CONSTANTS_BATTLE_ANIM_H diff --git a/include/pokemon_animation.h b/include/pokemon_animation.h index c1ab8d817..5174c8a77 100644 --- a/include/pokemon_animation.h +++ b/include/pokemon_animation.h @@ -7,4 +7,186 @@ void StartMonSummaryAnimation(struct Sprite *sprite, u8 frontAnimId); void LaunchAnimationTaskForBackSprite(struct Sprite *sprite, u8 backAnimSet); void SetSpriteCB_MonAnimDummy(struct Sprite *sprite); +// Pokémon back animation sets +#define BACK_ANIM_NONE 0 +#define BACK_ANIM_H_VIBRATE 1 +#define BACK_ANIM_H_SLIDE 2 +#define BACK_ANIM_H_SPRING 3 +#define BACK_ANIM_H_SPRING_REPEATED 4 +#define BACK_ANIM_SHRINK_GROW 5 +#define BACK_ANIM_GROW 6 +#define BACK_ANIM_CIRCLE_COUNTERCLOCKWISE 7 +#define BACK_ANIM_H_SHAKE 8 +#define BACK_ANIM_V_SHAKE 9 +#define BACK_ANIM_V_SHAKE_H_SLIDE 10 +#define BACK_ANIM_V_STRETCH 11 +#define BACK_ANIM_H_STRETCH 12 +#define BACK_ANIM_GROW_STUTTER 13 +#define BACK_ANIM_V_SHAKE_LOW 14 +#define BACK_ANIM_TRIANGLE_DOWN 15 +#define BACK_ANIM_CONCAVE_ARC_LARGE 16 +#define BACK_ANIM_CONVEX_DOUBLE_ARC 17 +#define BACK_ANIM_CONCAVE_ARC_SMALL 18 +#define BACK_ANIM_DIP_RIGHT_SIDE 19 +#define BACK_ANIM_SHRINK_GROW_VIBRATE 20 +#define BACK_ANIM_JOLT_RIGHT 21 +#define BACK_ANIM_SHAKE_FLASH_YELLOW 22 +#define BACK_ANIM_SHAKE_GLOW_RED 23 +#define BACK_ANIM_SHAKE_GLOW_GREEN 24 +#define BACK_ANIM_SHAKE_GLOW_BLUE 25 + +// Pokémon animation function ids (for front and back) +// Each front anim uses 1, and each back anim uses a set of 3 +#define ANIM_V_SQUISH_AND_BOUNCE 0 +#define ANIM_CIRCULAR_STRETCH_TWICE 1 +#define ANIM_H_VIBRATE 2 +#define ANIM_H_SLIDE 3 +#define ANIM_V_SLIDE 4 +#define ANIM_BOUNCE_ROTATE_TO_SIDES 5 +#define ANIM_V_JUMPS_H_JUMPS 6 +#define ANIM_ROTATE_TO_SIDES 7 +#define ANIM_ROTATE_TO_SIDES_TWICE 8 +#define ANIM_GROW_VIBRATE 9 +#define ANIM_ZIGZAG_FAST 10 +#define ANIM_SWING_CONCAVE 11 +#define ANIM_SWING_CONCAVE_FAST 12 +#define ANIM_SWING_CONVEX 13 +#define ANIM_SWING_CONVEX_FAST 14 +#define ANIM_H_SHAKE 15 +#define ANIM_V_SHAKE 16 +#define ANIM_CIRCULAR_VIBRATE 17 +#define ANIM_TWIST 18 +#define ANIM_SHRINK_GROW 19 +#define ANIM_CIRCLE_C_CLOCKWISE 20 +#define ANIM_GLOW_BLACK 21 +#define ANIM_H_STRETCH 22 +#define ANIM_V_STRETCH 23 +#define ANIM_RISING_WOBBLE 24 +#define ANIM_V_SHAKE_TWICE 25 +#define ANIM_TIP_MOVE_FORWARD 26 +#define ANIM_H_PIVOT 27 +#define ANIM_V_SLIDE_WOBBLE 28 +#define ANIM_H_SLIDE_WOBBLE 29 +#define ANIM_V_JUMPS_BIG 30 +#define ANIM_SPIN_LONG 31 +#define ANIM_GLOW_ORANGE 32 +#define ANIM_GLOW_RED 33 +#define ANIM_GLOW_BLUE 34 +#define ANIM_GLOW_YELLOW 35 +#define ANIM_GLOW_PURPLE 36 +#define ANIM_BACK_AND_LUNGE 37 +#define ANIM_BACK_FLIP 38 +#define ANIM_FLICKER 39 +#define ANIM_BACK_FLIP_BIG 40 +#define ANIM_FRONT_FLIP 41 +#define ANIM_TUMBLING_FRONT_FLIP 42 +#define ANIM_FIGURE_8 43 +#define ANIM_FLASH_YELLOW 44 +#define ANIM_SWING_CONCAVE_FAST_SHORT 45 +#define ANIM_SWING_CONVEX_FAST_SHORT 46 +#define ANIM_ROTATE_UP_SLAM_DOWN 47 +#define ANIM_DEEP_V_SQUISH_AND_BOUNCE 48 +#define ANIM_H_JUMPS 49 +#define ANIM_H_JUMPS_V_STRETCH 50 +#define ANIM_ROTATE_TO_SIDES_FAST 51 +#define ANIM_ROTATE_UP_TO_SIDES 52 +#define ANIM_FLICKER_INCREASING 53 +#define ANIM_TIP_HOP_FORWARD 54 +#define ANIM_PIVOT_SHAKE 55 +#define ANIM_TIP_AND_SHAKE 56 +#define ANIM_VIBRATE_TO_CORNERS 57 +#define ANIM_GROW_IN_STAGES 58 +#define ANIM_V_SPRING 59 +#define ANIM_V_REPEATED_SPRING 60 +#define ANIM_SPRING_RISING 61 +#define ANIM_H_SPRING 62 +#define ANIM_H_REPEATED_SPRING_SLOW 63 +#define ANIM_H_SLIDE_SHRINK 64 +#define ANIM_LUNGE_GROW 65 +#define ANIM_CIRCLE_INTO_BG 66 +#define ANIM_RAPID_H_HOPS 67 +#define ANIM_FOUR_PETAL 68 +#define ANIM_V_SQUISH_AND_BOUNCE_SLOW 69 +#define ANIM_H_SLIDE_SLOW 70 +#define ANIM_V_SLIDE_SLOW 71 +#define ANIM_BOUNCE_ROTATE_TO_SIDES_SMALL 72 +#define ANIM_BOUNCE_ROTATE_TO_SIDES_SLOW 73 +#define ANIM_BOUNCE_ROTATE_TO_SIDES_SMALL_SLOW 74 +#define ANIM_ZIGZAG_SLOW 75 +#define ANIM_H_SHAKE_SLOW 76 +#define ANIM_V_SHAKE_SLOW 77 +#define ANIM_TWIST_TWICE 78 +#define ANIM_CIRCLE_C_CLOCKWISE_SLOW 79 +#define ANIM_V_SHAKE_TWICE_SLOW 80 +#define ANIM_V_SLIDE_WOBBLE_SMALL 81 +#define ANIM_V_JUMPS_SMALL 82 +#define ANIM_SPIN 83 +#define ANIM_TUMBLING_FRONT_FLIP_TWICE 84 +#define ANIM_DEEP_V_SQUISH_AND_BOUNCE_TWICE 85 +#define ANIM_H_JUMPS_V_STRETCH_TWICE 86 +#define ANIM_V_SHAKE_BACK 87 +#define ANIM_V_SHAKE_BACK_SLOW 88 +#define ANIM_V_SHAKE_H_SLIDE_SLOW 89 +#define ANIM_V_STRETCH_BOTH_ENDS_SLOW 90 +#define ANIM_H_STRETCH_FAR_SLOW 91 +#define ANIM_V_SHAKE_LOW_TWICE 92 +#define ANIM_H_SHAKE_FAST 93 +#define ANIM_H_SLIDE_FAST 94 +#define ANIM_H_VIBRATE_FAST 95 +#define ANIM_H_VIBRATE_FASTEST 96 +#define ANIM_V_SHAKE_BACK_FAST 97 +#define ANIM_V_SHAKE_LOW_TWICE_SLOW 98 +#define ANIM_V_SHAKE_LOW_TWICE_FAST 99 +#define ANIM_CIRCLE_C_CLOCKWISE_LONG 100 +#define ANIM_GROW_STUTTER_SLOW 101 +#define ANIM_V_SHAKE_H_SLIDE 102 +#define ANIM_V_SHAKE_H_SLIDE_FAST 103 +#define ANIM_TRIANGLE_DOWN_SLOW 104 +#define ANIM_TRIANGLE_DOWN 105 +#define ANIM_TRIANGLE_DOWN_TWICE 106 +#define ANIM_GROW 107 +#define ANIM_GROW_TWICE 108 +#define ANIM_H_SPRING_FAST 109 +#define ANIM_H_SPRING_SLOW 110 +#define ANIM_H_REPEATED_SPRING_FAST 111 +#define ANIM_H_REPEATED_SPRING 112 +#define ANIM_SHRINK_GROW_FAST 113 +#define ANIM_SHRINK_GROW_SLOW 114 +#define ANIM_V_STRETCH_BOTH_ENDS 115 +#define ANIM_V_STRETCH_BOTH_ENDS_TWICE 116 +#define ANIM_H_STRETCH_FAR_TWICE 117 +#define ANIM_H_STRETCH_FAR 118 +#define ANIM_GROW_STUTTER_TWICE 119 +#define ANIM_GROW_STUTTER 120 +#define ANIM_CONCAVE_ARC_LARGE_SLOW 121 +#define ANIM_CONCAVE_ARC_LARGE 122 +#define ANIM_CONCAVE_ARC_LARGE_TWICE 123 +#define ANIM_CONVEX_DOUBLE_ARC_SLOW 124 +#define ANIM_CONVEX_DOUBLE_ARC 125 +#define ANIM_CONVEX_DOUBLE_ARC_TWICE 126 +#define ANIM_CONCAVE_ARC_SMALL_SLOW 127 +#define ANIM_CONCAVE_ARC_SMALL 128 +#define ANIM_CONCAVE_ARC_SMALL_TWICE 129 +#define ANIM_H_DIP 130 +#define ANIM_H_DIP_FAST 131 +#define ANIM_H_DIP_TWICE 132 +#define ANIM_SHRINK_GROW_VIBRATE_FAST 133 +#define ANIM_SHRINK_GROW_VIBRATE 134 +#define ANIM_SHRINK_GROW_VIBRATE_SLOW 135 +#define ANIM_JOLT_RIGHT_FAST 136 +#define ANIM_JOLT_RIGHT 137 +#define ANIM_JOLT_RIGHT_SLOW 138 +#define ANIM_SHAKE_FLASH_YELLOW_FAST 139 +#define ANIM_SHAKE_FLASH_YELLOW 140 +#define ANIM_SHAKE_FLASH_YELLOW_SLOW 141 +#define ANIM_SHAKE_GLOW_RED_FAST 142 +#define ANIM_SHAKE_GLOW_RED 143 +#define ANIM_SHAKE_GLOW_RED_SLOW 144 +#define ANIM_SHAKE_GLOW_GREEN_FAST 145 +#define ANIM_SHAKE_GLOW_GREEN 146 +#define ANIM_SHAKE_GLOW_GREEN_SLOW 147 +#define ANIM_SHAKE_GLOW_BLUE_FAST 148 +#define ANIM_SHAKE_GLOW_BLUE 149 +#define ANIM_SHAKE_GLOW_BLUE_SLOW 150 + #endif // GUARD_POKEMON_ANIMATION_H diff --git a/include/pokemon_summary_screen.h b/include/pokemon_summary_screen.h index 6413dcdec..151ea3af8 100755 --- a/include/pokemon_summary_screen.h +++ b/include/pokemon_summary_screen.h @@ -12,8 +12,7 @@ void ShowPokemonSummaryScreen(u8 mode, void *mons, u8 monIndex, u8 maxMonIndex, void ShowSelectMovePokemonSummaryScreen(struct Pokemon *mons, u8 monIndex, u8 maxMonIndex, void (*callback)(void), u16 newMove); void ShowPokemonSummaryScreenSet40EF(u8 mode, struct BoxPokemon *mons, u8 monIndex, u8 maxMonIndex, void (*callback)(void)); u8 GetMoveSlotToReplace(void); -void SummaryScreen_SetUnknownTaskId(u8 taskId); -void SummaryScreen_DestroyUnknownTask(void); +void SummaryScreen_SetAnimDelayTaskId(u8 taskId); // The Pokemon Summary Screen can operate in different modes. Certain features, // such as move re-ordering, are available in the different modes. -- cgit v1.2.3 From c786a9b20c7d70546523a13406d7871f5fa5be2b Mon Sep 17 00:00:00 2001 From: GriffinR Date: Sun, 11 Apr 2021 16:23:10 -0400 Subject: Document pokeblock menu --- include/item_menu_icons.h | 6 +++--- include/menu_helpers.h | 10 +++++----- include/pokeblock.h | 3 +-- 3 files changed, 9 insertions(+), 10 deletions(-) (limited to 'include') diff --git a/include/item_menu_icons.h b/include/item_menu_icons.h index 7ff6ace94..50e11dfd9 100644 --- a/include/item_menu_icons.h +++ b/include/item_menu_icons.h @@ -14,9 +14,9 @@ void ShakeBagSprite(void); void AddSwitchPocketRotatingBallSprite(s16 rotationDirection); void AddBagItemIconSprite(u16 itemId, u8 id); void RemoveBagItemIconSprite(u8 id); -void sub_80D4FAC(void); -void sub_80D4FC8(u8 arg0); -void sub_80D4FEC(u8 arg0); +void CreateItemMenuSwapLine(void); +void SetItemMenuSwapLineInvisibility(bool8 invisible); +void UpdateItemMenuSwapLinePos(u8 y); u8 CreateBerryTagSprite(u8 id, s16 x, s16 y); void FreeBerryTagSpritePalette(void); u8 CreateSpinningBerrySprite(u8 berryId, u8 x, u8 y, bool8 startAffine); diff --git a/include/menu_helpers.h b/include/menu_helpers.h index 4557ebbb1..c4401354b 100644 --- a/include/menu_helpers.h +++ b/include/menu_helpers.h @@ -35,10 +35,10 @@ bool8 MenuHelpers_CallLinkSomething(void); void sub_812220C(struct ItemSlot *slots, u8 count, u8 *arg2, u8 *usedSlotsCount, u8 maxUsedSlotsCount); void sub_812225C(u16 *scrollOffset, u16 *cursorPos, u8 maxShownItems, u8 numItems); void sub_8122298(u16 *arg0, u16 *arg1, u8 arg2, u8 arg3, u8 arg4); -void LoadListMenuArrowsGfx(void); -void sub_8122344(u8 *spriteIds, u8 count); -void sub_81223B0(u8 *spriteIds, u8 count); -void sub_81223FC(u8 *spriteIds, u8 count, bool8 invisible); -void sub_8122448(u8 *spriteIds, u8 count, s16 x, u16 y); +void LoadListMenuSwapLineGfx(void); +void CreateSwapLineSprites(u8 *spriteIds, u8 count); +void DestroySwapLineSprites(u8 *spriteIds, u8 count); +void SetSwapLineSpritesInvisibility(u8 *spriteIds, u8 count, bool8 invisible); +void UpdateSwapLineSpritesPos(u8 *spriteIds, u8 count, s16 x, u16 y); #endif //GUARD_MENU_HELPERS_H diff --git a/include/pokeblock.h b/include/pokeblock.h index c82e99d8f..4c5a40488 100644 --- a/include/pokeblock.h +++ b/include/pokeblock.h @@ -4,8 +4,7 @@ #include "constants/berry.h" #include "constants/pokemon.h" -#define GFX_TAG_POKEBLOCK 14818 -#define GFX_TAG_POKEBLOCK_CASE 14800 +#define TAG_POKEBLOCK 14818 enum { -- cgit v1.2.3 From 042a2ecc417001be93bd363cbaff5415be65308c Mon Sep 17 00:00:00 2001 From: GriffinR Date: Mon, 12 Apr 2021 12:33:06 -0400 Subject: Document pokeblock feed scene --- include/graphics.h | 2 +- include/pokeblock.h | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) (limited to 'include') diff --git a/include/graphics.h b/include/graphics.h index 7c36b9cf5..cea8bbab1 100644 --- a/include/graphics.h +++ b/include/graphics.h @@ -4076,7 +4076,7 @@ extern const u8 gNamingScreenCursor_Gfx[]; extern const u8 gNamingScreenInputArrow_Gfx[]; extern const u8 gNamingScreenUnderscore_Gfx[]; -extern const u32 gUnknown_08D9BA44[]; +extern const u32 gPokeblockFeedBg_Tilemap[]; extern const u32 gConfetti_Gfx[]; extern const u32 gConfetti_Pal[]; diff --git a/include/pokeblock.h b/include/pokeblock.h index 4c5a40488..9e0161495 100644 --- a/include/pokeblock.h +++ b/include/pokeblock.h @@ -51,7 +51,7 @@ extern s16 gPokeblockGain; void ChooseMonToGivePokeblock(struct Pokeblock *pokeblock, void (*callback)(void)); // pokeblock feed -void CB2_PreparePokeblockFeedScene(void); +void PreparePokeblockFeedScene(void); // pokeblock extern const s8 gPokeblockFlavorCompatibilityTable[NUM_NATURES * FLAVOR_COUNT]; -- cgit v1.2.3 From 33ea2a10613df0d6ef25b146b175f8b3712896c3 Mon Sep 17 00:00:00 2001 From: GriffinR Date: Tue, 13 Apr 2021 02:50:50 -0400 Subject: Remove unnecessary scope for TEST_BUTTON --- include/global.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'include') diff --git a/include/global.h b/include/global.h index 18e2bfea7..19605ca57 100644 --- a/include/global.h +++ b/include/global.h @@ -107,7 +107,7 @@ #define T2_READ_PTR(ptr) (void*) T2_READ_32(ptr) // Macros for checking the joypad -#define TEST_BUTTON(field, button) ({(field) & (button);}) +#define TEST_BUTTON(field, button) ((field) & (button)) #define JOY_NEW(button) TEST_BUTTON(gMain.newKeys, button) #define JOY_HELD(button) TEST_BUTTON(gMain.heldKeys, button) #define JOY_HELD_RAW(button) TEST_BUTTON(gMain.heldKeysRaw, button) -- cgit v1.2.3 From a1ed59450e133a9dd84c59869418d449e48fc1ce Mon Sep 17 00:00:00 2001 From: GriffinR Date: Thu, 15 Apr 2021 14:06:25 -0400 Subject: Doc storage - wallpaper and titles --- include/pokemon_storage_system.h | 2 -- 1 file changed, 2 deletions(-) (limited to 'include') diff --git a/include/pokemon_storage_system.h b/include/pokemon_storage_system.h index 7b6a38678..4e5ccfcda 100644 --- a/include/pokemon_storage_system.h +++ b/include/pokemon_storage_system.h @@ -51,8 +51,6 @@ void ZeroBoxMonAt(u8 boxId, u8 boxPosition); void BoxMonAtToMon(u8 boxId, u8 boxPosition, struct Pokemon *dst); struct BoxPokemon *GetBoxedMonPtr(u8 boxId, u8 boxPosition); u8 *GetBoxNamePtr(u8 boxId); -u8 GetBoxWallpaper(u8 boxId); -void SetBoxWallpaper(u8 boxId, u8 wallpaperId); s16 sub_80D214C(struct BoxPokemon *boxMons, u8 currIndex, u8 maxIndex, u8 arg3); bool8 CheckFreePokemonStorageSpace(void); bool32 CheckBoxMonSanityAt(u32 boxId, u32 boxPosition); -- cgit v1.2.3 From 838a452363c1296e3c9a0d92ce41f59a75e9c844 Mon Sep 17 00:00:00 2001 From: GriffinR Date: Thu, 15 Apr 2021 17:31:50 -0400 Subject: Doc storage - choose box menu, move wallpaper gfx --- include/pokemon_storage_system.h | 1 + include/pokemon_summary_screen.h | 17 ++++------------- 2 files changed, 5 insertions(+), 13 deletions(-) (limited to 'include') diff --git a/include/pokemon_storage_system.h b/include/pokemon_storage_system.h index 4e5ccfcda..6e5eab3f9 100644 --- a/include/pokemon_storage_system.h +++ b/include/pokemon_storage_system.h @@ -57,6 +57,7 @@ bool32 CheckBoxMonSanityAt(u32 boxId, u32 boxPosition); u32 CountStorageNonEggMons(void); u32 CountAllStorageMons(void); bool32 AnyStorageMonWithMove(u16 moveId); + void ResetWaldaWallpaper(void); void SetWaldaWallpaperLockedOrUnlocked(bool32 unlocked); bool32 IsWaldaWallpaperUnlocked(void); diff --git a/include/pokemon_summary_screen.h b/include/pokemon_summary_screen.h index 151ea3af8..3996c8e15 100755 --- a/include/pokemon_summary_screen.h +++ b/include/pokemon_summary_screen.h @@ -18,19 +18,10 @@ void SummaryScreen_SetAnimDelayTaskId(u8 taskId); // such as move re-ordering, are available in the different modes. enum PokemonSummaryScreenMode { - PSS_MODE_NORMAL, - PSS_MODE_LOCK_MOVES, - PSS_MODE_BOX, - PSS_MODE_SELECT_MOVE, -}; - -enum PokemonSummaryScreenPage -{ - PSS_PAGE_INFO, - PSS_PAGE_SKILLS, - PSS_PAGE_BATTLE_MOVES, - PSS_PAGE_CONTEST_MOVES, - PSS_PAGE_COUNT, + SUMMARY_MODE_NORMAL, + SUMMARY_MODE_LOCK_MOVES, + SUMMARY_MODE_BOX, + SUMMARY_MODE_SELECT_MOVE, }; #endif // GUARD_POKEMON_SUMMARY_SCREEN_H -- cgit v1.2.3 From 80cc7d46aeab92cf00e508d6c595cb7b590b3615 Mon Sep 17 00:00:00 2001 From: GriffinR Date: Fri, 16 Apr 2021 05:14:35 -0400 Subject: Doc storage - fix row/column flip --- include/pokemon_storage_system.h | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) (limited to 'include') diff --git a/include/pokemon_storage_system.h b/include/pokemon_storage_system.h index 6e5eab3f9..24e92a449 100644 --- a/include/pokemon_storage_system.h +++ b/include/pokemon_storage_system.h @@ -2,13 +2,13 @@ #define GUARD_POKEMON_STORAGE_SYSTEM_H #define TOTAL_BOXES_COUNT 14 -#define IN_BOX_ROWS 6 -#define IN_BOX_COLUMNS 5 +#define IN_BOX_ROWS 5 // Number of rows, 6 Pokémon per row +#define IN_BOX_COLUMNS 6 // Number of columns, 5 Pokémon per column #define IN_BOX_COUNT (IN_BOX_ROWS * IN_BOX_COLUMNS) -/* - ROWS -COLUMNS 0 1 2 3 4 5 +/* + COLUMNS +ROWS 0 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 -- cgit v1.2.3 From cd2a99b7c44bb875135c2c97589ecc160dad71f0 Mon Sep 17 00:00:00 2001 From: GriffinR Date: Sat, 17 Apr 2021 00:49:51 -0400 Subject: Doc storage - misc cleanup, some item/cursor --- include/graphics.h | 6 +++--- include/pokemon_storage_system.h | 2 +- 2 files changed, 4 insertions(+), 4 deletions(-) (limited to 'include') diff --git a/include/graphics.h b/include/graphics.h index cea8bbab1..ee5677f3c 100644 --- a/include/graphics.h +++ b/include/graphics.h @@ -4875,12 +4875,12 @@ extern const u32 gPokedexAreaScreenAreaUnknown_Gfx[]; extern const u16 gPokedexAreaScreenAreaUnknown_Pal[]; // Pokemon Storage System -extern const u32 gPSSMenu_Gfx[]; -extern const u16 gPSSMenu_Pal[]; +extern const u32 gStorageSystemMenu_Gfx[]; +extern const u16 gStorageSystemPartyMenu_Pal[]; +extern const u32 gStorageSystemPartyMenu_Tilemap[]; extern const u32 gWallpaperIcon_Plusle[]; extern const u32 gWallpaperIcon_Cross[]; extern const u32 gWallpaperIcon_Bolt[]; -extern const u32 gUnknown_08DD36C8[]; extern const u32 gWallpaperTiles_Ribbon[]; extern const u32 gWallpaperTilemap_Ribbon[]; extern const u16 gWallpaperPalettes_Ribbon[][16]; diff --git a/include/pokemon_storage_system.h b/include/pokemon_storage_system.h index 24e92a449..73a7833ee 100644 --- a/include/pokemon_storage_system.h +++ b/include/pokemon_storage_system.h @@ -51,7 +51,7 @@ void ZeroBoxMonAt(u8 boxId, u8 boxPosition); void BoxMonAtToMon(u8 boxId, u8 boxPosition, struct Pokemon *dst); struct BoxPokemon *GetBoxedMonPtr(u8 boxId, u8 boxPosition); u8 *GetBoxNamePtr(u8 boxId); -s16 sub_80D214C(struct BoxPokemon *boxMons, u8 currIndex, u8 maxIndex, u8 arg3); +s16 AdvanceStorageMonIndex(struct BoxPokemon *boxMons, u8 currIndex, u8 maxIndex, u8 arg3); bool8 CheckFreePokemonStorageSpace(void); bool32 CheckBoxMonSanityAt(u32 boxId, u32 boxPosition); u32 CountStorageNonEggMons(void); -- cgit v1.2.3 From 04af378904dc5e7ded00bb8e50c8e6b554c3571b Mon Sep 17 00:00:00 2001 From: GriffinR Date: Sun, 18 Apr 2021 20:12:12 -0400 Subject: Document trade sequence animation, some trade cleanup --- include/graphics.h | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'include') diff --git a/include/graphics.h b/include/graphics.h index cea8bbab1..786420472 100644 --- a/include/graphics.h +++ b/include/graphics.h @@ -4903,8 +4903,8 @@ extern const u16 gUnknown_08DDCF04[]; extern const u16 gTradeGba2_Pal[]; extern const u8 gTradeGba_Gfx[]; extern const u16 gTradeMenuMonBox_Tilemap[]; -extern const u8 gTradeButtons_Gfx[]; -extern const u16 gUnknown_08DDB444[]; +extern const u8 gTradeCursor_Gfx[]; +extern const u16 gTradeCursor_Pal[]; // Party menu extern const u32 gPartyMenuPokeball_Gfx[]; -- cgit v1.2.3 From a2a9f226129317c2557b908883903df47701324c Mon Sep 17 00:00:00 2001 From: GriffinR Date: Tue, 20 Apr 2021 21:16:47 -0400 Subject: Clean up contest_util --- include/graphics.h | 28 ++++++++++++++-------------- 1 file changed, 14 insertions(+), 14 deletions(-) (limited to 'include') diff --git a/include/graphics.h b/include/graphics.h index cea8bbab1..6262d8862 100644 --- a/include/graphics.h +++ b/include/graphics.h @@ -4924,21 +4924,21 @@ extern const u32 gRouletteMultiplier_Gfx[]; // Contest util extern const u32 gContestResults_Gfx[]; -extern const u32 gUnknown_08C19EEC[]; -extern const u32 gUnknown_08C1A000[]; -extern const u32 gUnknown_08C1A12C[]; +extern const u32 gContestResults_WinnerBanner_Tilemap[]; +extern const u32 gContestResults_Interface_Tilemap[]; +extern const u32 gContestResults_Bg_Tilemap[]; extern const u32 gContestResults_Pal[]; -extern const u16 gLinkContestResults_Tilemap[]; -extern const u16 gNormalContestResults_Tilemap[]; -extern const u16 gSuperContestResults_Tilemap[]; -extern const u16 gHyperContestResults_Tilemap[]; -extern const u16 gMasterContestResults_Tilemap[]; -extern const u16 gCoolContestResults_Tilemap[]; -extern const u16 gBeautyContestResults_Tilemap[]; -extern const u16 gCuteContestResults_Tilemap[]; -extern const u16 gSmartContestResults_Tilemap[]; -extern const u16 gToughContestResults_Tilemap[]; -extern const u16 gContestResults_Tilemap[]; +extern const u16 gContestResultsTitle_Link_Tilemap[]; +extern const u16 gContestResultsTitle_Normal_Tilemap[]; +extern const u16 gContestResultsTitle_Super_Tilemap[]; +extern const u16 gContestResultsTitle_Hyper_Tilemap[]; +extern const u16 gContestResultsTitle_Master_Tilemap[]; +extern const u16 gContestResultsTitle_Cool_Tilemap[]; +extern const u16 gContestResultsTitle_Beauty_Tilemap[]; +extern const u16 gContestResultsTitle_Cute_Tilemap[]; +extern const u16 gContestResultsTitle_Smart_Tilemap[]; +extern const u16 gContestResultsTitle_Tough_Tilemap[]; +extern const u16 gContestResultsTitle_Tilemap[]; // Trainer Card. extern const u16 gHoennTrainerCard0Star_Pal[]; -- cgit v1.2.3 From dbe24f0baa560aaa30f3084f1dfb21fb3cfb04db Mon Sep 17 00:00:00 2001 From: GriffinR Date: Wed, 21 Apr 2021 20:04:12 -0400 Subject: Clean up contest_painting --- include/constants/contest.h | 16 +++++++++++++--- include/contest.h | 8 ++++---- include/contest_util.h | 2 +- 3 files changed, 18 insertions(+), 8 deletions(-) (limited to 'include') diff --git a/include/constants/contest.h b/include/constants/contest.h index 9eb6b26e4..c18af0817 100644 --- a/include/constants/contest.h +++ b/include/constants/contest.h @@ -22,7 +22,9 @@ #define CONTEST_TYPE_NPC_MASTER (CONTEST_RANK_MASTER + 1) #define CONTEST_TYPE_LINK (CONTEST_RANK_LINK + 1) -#define CONTEST_WINNER_ARTIST 0 // Winner shown by the artist, painting not necessarily saved +// IDs below - 1 are indexes into gSaveBlock1Ptr->contestWinners[] +// CONTEST_WINNER_ARTIST is for the winner of the most recent contest, and is not saved. +#define CONTEST_WINNER_ARTIST 0 #define CONTEST_WINNER_HALL_1 1 #define CONTEST_WINNER_HALL_2 2 #define CONTEST_WINNER_HALL_3 3 @@ -30,8 +32,8 @@ #define CONTEST_WINNER_HALL_5 5 #define CONTEST_WINNER_HALL_6 6 #define NUM_CONTEST_HALL_WINNERS 6 -#define CONTEST_WINNER_7 7 -#define CONTEST_WINNER_8 8 +#define CONTEST_WINNER_HALL_UNUSED 7 +#define CONTEST_WINNER_MUSEUM_UNUSED 8 #define CONTEST_WINNER_MUSEUM_COOL 9 #define CONTEST_WINNER_MUSEUM_BEAUTY 10 #define CONTEST_WINNER_MUSEUM_CUTE 11 @@ -39,6 +41,14 @@ #define CONTEST_WINNER_MUSEUM_TOUGH 13 // NUM_CONTEST_WINNERS in constants/global.h +#define MUSEUM_CONTEST_WINNERS_START CONTEST_WINNER_MUSEUM_UNUSED + +// The number of possible captions for a Contest painting, per category +#define NUM_PAINTING_CAPTIONS 3 + +#define CONTEST_SAVE_FOR_MUSEUM ((u8)-1) +#define CONTEST_SAVE_FOR_ARTIST ((u8)-2) + #define CANT_ENTER_CONTEST 0 #define CAN_ENTER_CONTEST_EQUAL_RANK 1 #define CAN_ENTER_CONTEST_HIGH_RANK 2 diff --git a/include/contest.h b/include/contest.h index 1dd4340bd..6469bf628 100644 --- a/include/contest.h +++ b/include/contest.h @@ -326,8 +326,8 @@ extern u8 gHighestRibbonRank; extern struct ContestResources *gContestResources; extern u8 sContestBgCopyFlags; extern struct ContestWinner gCurContestWinner; -extern u8 gUnknown_02039F5C; -extern u8 gUnknown_02039F5D; +extern u8 gCurContestWinnerIsForArtist; +extern u8 gCurContestWinnerSaveIdx; extern u32 gContestRngValue; // contest.c @@ -351,8 +351,8 @@ s8 Contest_GetMoveExcitement(u16 move); bool8 IsContestantAllowedToCombo(u8 contestant); void Contest_PrintTextToBg0WindowAt(u32 windowId, u8 *currChar, s32 x, s32 y, s32 fontId); void ResetContestLinkResults(void); -bool8 sub_80DEDA8(u8 a); -u8 sub_80DEFA8(u8 a, u8 b); +bool8 SaveContestWinner(u8 rank); +u8 GetContestWinnerSaveIdx(u8 rank, bool8 shift); void ClearContestWinnerPicsInContestHall(void); void StripPlayerAndMonNamesForLinkContest(struct ContestPokemon *mon, s32 language); diff --git a/include/contest_util.h b/include/contest_util.h index 76f9ae522..5b0c5559a 100644 --- a/include/contest_util.h +++ b/include/contest_util.h @@ -7,7 +7,7 @@ void StartContest(void); void BufferContestantMonSpecies(void); void ShowContestResults(void); void ContestLinkTransfer(u8); -void ShowContestWinnerPainting(void); +void ShowContestPainting(void); u16 GetContestRand(void); u8 CountPlayerContestPaintings(void); -- cgit v1.2.3 From bc9fc382547aadfb321c7c55571786d20c5e9663 Mon Sep 17 00:00:00 2001 From: GriffinR Date: Thu, 22 Apr 2021 14:30:45 -0400 Subject: Misc contest cleanup --- include/constants/contest.h | 12 ++++++------ include/contest.h | 8 ++++---- include/contest_util.h | 2 +- include/international_string_util.h | 2 +- 4 files changed, 12 insertions(+), 12 deletions(-) (limited to 'include') diff --git a/include/constants/contest.h b/include/constants/contest.h index c18af0817..28b02e9c0 100644 --- a/include/constants/contest.h +++ b/include/constants/contest.h @@ -32,8 +32,8 @@ #define CONTEST_WINNER_HALL_5 5 #define CONTEST_WINNER_HALL_6 6 #define NUM_CONTEST_HALL_WINNERS 6 -#define CONTEST_WINNER_HALL_UNUSED 7 -#define CONTEST_WINNER_MUSEUM_UNUSED 8 +#define CONTEST_WINNER_HALL_UNUSED_1 7 // These two have data for gDefaultContestWinners +#define CONTEST_WINNER_HALL_UNUSED_2 8 // but there are only 6 paintings in the Contest Hall #define CONTEST_WINNER_MUSEUM_COOL 9 #define CONTEST_WINNER_MUSEUM_BEAUTY 10 #define CONTEST_WINNER_MUSEUM_CUTE 11 @@ -41,14 +41,14 @@ #define CONTEST_WINNER_MUSEUM_TOUGH 13 // NUM_CONTEST_WINNERS in constants/global.h -#define MUSEUM_CONTEST_WINNERS_START CONTEST_WINNER_MUSEUM_UNUSED - -// The number of possible captions for a Contest painting, per category -#define NUM_PAINTING_CAPTIONS 3 +#define MUSEUM_CONTEST_WINNERS_START (CONTEST_WINNER_MUSEUM_COOL - 1) #define CONTEST_SAVE_FOR_MUSEUM ((u8)-1) #define CONTEST_SAVE_FOR_ARTIST ((u8)-2) +// The number of possible captions for a Contest painting, per category +#define NUM_PAINTING_CAPTIONS 3 + #define CANT_ENTER_CONTEST 0 #define CAN_ENTER_CONTEST_EQUAL_RANK 1 #define CAN_ENTER_CONTEST_HIGH_RANK 2 diff --git a/include/contest.h b/include/contest.h index 6469bf628..9bac63eda 100644 --- a/include/contest.h +++ b/include/contest.h @@ -111,11 +111,11 @@ struct ContestPokemon u32 otId; }; -struct Shared1A004 +struct ContestTempSave { u16 cachedWindowPalettes[16][16]; // Saved palette data before a move happens? - u16 unk18204[PLTT_BUFFER_SIZE]; // Saved copy of gPlttBufferUnfaded - u16 unk18604[PLTT_BUFFER_SIZE]; // Saved copy of gPlttBufferFaded + u16 cachedPlttBufferUnfaded[PLTT_BUFFER_SIZE]; + u16 cachedPlttBufferFaded[PLTT_BUFFER_SIZE]; u8 savedJunk[0x800]; }; @@ -306,7 +306,7 @@ struct ContestResources #define eUnzippedContestAudience_Gfx (gHeap + 0x18000) #define eContestAudienceFrame2_Gfx (gHeap + 0x19000) #define eContestDebugMode (gHeap[0x1a000]) -#define eUnknownHeap1A004 (*(struct Shared1A004 *)(gHeap + 0x1a004)) +#define eContestTempSave (*(struct ContestTempSave *)(gHeap + 0x1a004)) extern struct ContestPokemon gContestMons[CONTESTANT_COUNT]; extern s16 gContestMonRound1Points[CONTESTANT_COUNT]; diff --git a/include/contest_util.h b/include/contest_util.h index 5b0c5559a..1e97d91d3 100644 --- a/include/contest_util.h +++ b/include/contest_util.h @@ -9,6 +9,6 @@ void ShowContestResults(void); void ContestLinkTransfer(u8); void ShowContestPainting(void); u16 GetContestRand(void); -u8 CountPlayerContestPaintings(void); +u8 CountPlayerMuseumPaintings(void); #endif // GUARD_CONTEST_UTIL_H diff --git a/include/international_string_util.h b/include/international_string_util.h index f76fc5be1..fe7e85b41 100644 --- a/include/international_string_util.h +++ b/include/international_string_util.h @@ -17,7 +17,7 @@ void CopyMonCategoryText(int dexNum, u8 *dest); u8 *sub_81DB494(u8 *str, int fontId, const u8 *str2, int totalStringWidth); void PadNameString(u8 *dest, u8 padChar); void ConvertInternationalPlayerNameStripChar(u8 *, u8); -void sub_81DB5AC(u8 *); +void ConvertInternationalContestantName(u8 *); int sub_81DB604(u8 *); void sub_81DB620(int windowId, int columnStart, int rowStart, int numFillTiles, int numRows); -- cgit v1.2.3 From 8c820878bfa91e7a00953e02a5e93847c5428468 Mon Sep 17 00:00:00 2001 From: GriffinR Date: Thu, 22 Apr 2021 18:49:54 -0400 Subject: Document Battle Pyramid Bag --- include/battle_pyramid_bag.h | 54 ++++++++++++++++++++++++++++++++------------ include/menu.h | 4 ++-- include/menu_helpers.h | 2 +- include/strings.h | 3 ++- 4 files changed, 44 insertions(+), 19 deletions(-) (limited to 'include') diff --git a/include/battle_pyramid_bag.h b/include/battle_pyramid_bag.h index df111b939..de571714c 100644 --- a/include/battle_pyramid_bag.h +++ b/include/battle_pyramid_bag.h @@ -3,48 +3,72 @@ #include "list_menu.h" -struct PyramidBagResources +enum { + PYRAMIDBAG_LOC_FIELD, + PYRAMIDBAG_LOC_BATTLE, + PYRAMIDBAG_LOC_PARTY, + PYRAMIDBAG_LOC_CHOOSE_TOSS, + PYRAMIDBAG_LOC_PREV, +}; + +enum { + PBAG_SPRITE_BAG, + PBAG_SPRITE_ITEM_ICON, + PBAG_SPRITE_ITEM_ICON_ALT, + PBAG_SPRITE_SWAP_LINE_START, // Swap line consists of 8 sprites + PBAG_SPRITE_SWAP_LINE_2, + PBAG_SPRITE_SWAP_LINE_3, + PBAG_SPRITE_SWAP_LINE_4, + PBAG_SPRITE_SWAP_LINE_5, + PBAG_SPRITE_SWAP_LINE_6, + PBAG_SPRITE_SWAP_LINE_7, + PBAG_SPRITE_SWAP_LINE_END, + PBAG_SPRITE_COUNT +}; +#define NUM_SWAP_LINE_SPRITES (1 + PBAG_SPRITE_SWAP_LINE_END - PBAG_SPRITE_SWAP_LINE_START) + +struct PyramidBagMenu { - void (*callback2)(void); - u8 tilemapBuffer[0x800]; - u8 itemsSpriteIds[PYRAMID_BAG_ITEMS_COUNT + 1]; + void (*exitCallback)(void); + u8 tilemapBuffer[BG_SCREEN_SIZE]; + u8 spriteIds[PBAG_SPRITE_COUNT]; u8 windowIds[5]; - u8 unk814; - u8 unk815; + u8 toSwapPos; + bool8 isAltIcon; // Two item icons loaded at a time. Tracks which to show next u8 scrollIndicatorsTaskId; const u8 *menuActionIds; - u8 filler81C[0x820 - 0x81C]; + u8 unused1[4]; u8 menuActionsCount; u8 listMenuCount; u8 listMenuMaxShown; struct ListMenuItem bagListItems[PYRAMID_BAG_ITEMS_COUNT + 1]; u8 itemStrings[PYRAMID_BAG_ITEMS_COUNT + 1][ITEM_NAME_LENGTH + 10]; s16 state; - u8 filler986[0x98C - 0x986]; + u8 unused2[4]; }; -struct PyramidBagCursorData +struct PyramidBagMenuState { void (*callback)(void); - u8 unk4; + u8 location; u16 cursorPosition; u16 scrollPosition; }; -extern struct PyramidBagResources *gPyramidBagResources; -extern struct PyramidBagCursorData gPyramidBagCursorData; +extern struct PyramidBagMenu *gPyramidBagMenu; +extern struct PyramidBagMenuState gPyramidBagMenuState; void InitBattlePyramidBagCursorPosition(void); void CB2_PyramidBagMenuFromStartMenu(void); void CB2_ReturnToPyramidBagMenu(void); -void sub_81C5924(void); -void sub_81C59BC(void); +void UpdatePyramidBagList(void); +void UpdatePyramidBagCursorPos(void); void sub_81C4EFC(void); void GoToBattlePyramidBagMenu(u8 a0, void (*callback)(void)); void Task_CloseBattlePyramidBagMessage(u8 taskId); void TryStoreHeldItemsInPyramidBag(void); void ChooseItemsToTossFromPyramidBag(void); -void CloseBattlePyramidBagAndSetCallback(u8 taskId); +void CloseBattlePyramidBag(u8 taskId); void DisplayItemMessageInBattlePyramid(u8 taskId, const u8 *str, void (*callback)(u8 taskId)); #endif // GUARD_BATTLE_PYRAMID_BAG_H diff --git a/include/menu.h b/include/menu.h index c9d8e374d..07e00eb73 100644 --- a/include/menu.h +++ b/include/menu.h @@ -90,8 +90,8 @@ void *malloc_and_decompress(const void *src, u32 *sizeOut); u16 copy_decompressed_tile_data_to_vram(u8 bgId, const void *src, u16 size, u16 offset, u8 mode); void AddTextPrinterForMessage(bool8 allowSkippingDelayWithButtonPress); void AddItemMenuActionTextPrinters(u8 windowId, u8 fontId, u8 left, u8 top, u8 letterSpacing, u8 lineHeight, u8 itemCount, const struct MenuAction *strs, const u8 *a8); -void sub_8198DBC(u8 windowId, u8 fontId, u8 left, u8 top, u8 a4, u8 itemCount, u8 itemCount2, const struct MenuAction *strs, const u8 *a8); -u8 sub_8199944(u8 windowId, u8 optionWidth, u8 columns, u8 rows, u8 initialCursorPos); +void PrintMenuActionGrid(u8 windowId, u8 fontId, u8 left, u8 top, u8 a4, u8 itemCount, u8 itemCount2, const struct MenuAction *strs, const u8 *a8); +u8 InitMenuActionGrid(u8 windowId, u8 optionWidth, u8 columns, u8 rows, u8 initialCursorPos); u8 ChangeListMenuCursorPosition(s8 deltaX, s8 deltaY); u8 GetStartMenuWindowId(void); void ListMenuLoadStdPalAt(u8, u8); diff --git a/include/menu_helpers.h b/include/menu_helpers.h index c4401354b..9909437a2 100644 --- a/include/menu_helpers.h +++ b/include/menu_helpers.h @@ -29,7 +29,7 @@ bool8 AdjustQuantityAccordingToDPadInput(s16 *arg0, u16 arg1); u8 GetLRKeysPressed(void); u8 GetLRKeysPressedAndHeld(void); bool8 sub_8122148(u16 itemId); -bool8 itemid_80BF6D8_mail_related(u16 itemId); +bool8 IsWritingMailAllowed(u16 itemId); bool8 MenuHelpers_LinkSomething(void); bool8 MenuHelpers_CallLinkSomething(void); void sub_812220C(struct ItemSlot *slots, u8 count, u8 *arg2, u8 *usedSlotsCount, u8 maxUsedSlotsCount); diff --git a/include/strings.h b/include/strings.h index 8880f3a5c..04283db0e 100644 --- a/include/strings.h +++ b/include/strings.h @@ -982,7 +982,8 @@ extern const u8 gText_RibbonsVar1[]; extern const u8 gText_OneDash[]; extern const u8 gText_TwoDashes[]; -extern const u8 *const gReturnToXStringsTable2[]; +extern const u8 *const gBagMenu_ReturnToStrings[]; +extern const u8 *const gPyramidBagMenu_ReturnToStrings[]; extern const u8 gText_NumPlayerLink[]; extern const u8 gText_ConfirmLinkWhenPlayersReady[]; -- cgit v1.2.3 From 004c37bf022f9ab8a4307306f84cb20ac1dc9518 Mon Sep 17 00:00:00 2001 From: GriffinR Date: Fri, 23 Apr 2021 17:04:44 -0400 Subject: Sync ereader_helpers with pokefirered --- include/ereader_helpers.h | 8 ++++---- include/link.h | 2 +- 2 files changed, 5 insertions(+), 5 deletions(-) (limited to 'include') diff --git a/include/ereader_helpers.h b/include/ereader_helpers.h index 8dc3b907a..7cced65cb 100755 --- a/include/ereader_helpers.h +++ b/include/ereader_helpers.h @@ -24,11 +24,11 @@ struct EReaderTrainerHillSet bool8 EReader_IsReceivedDataValid(struct EReaderTrainerHillSet *buffer); bool32 TryWriteTrainerHill(struct EReaderTrainerHillSet *arg0); bool32 ReadTrainerHillAndValidate(void); -int EReaderHandleTransfer(u8, u32, u32*, u32*); -void sub_81D3F9C(void); -void sub_81D3FAC(void); +int EReaderHandleTransfer(u8, size_t, const void *, void *); +void EReaderHelper_Timer3Callback(void); +void EReaderHelper_SerialCallback(void); void EReaderHelper_SaveRegsState(void); void EReaderHelper_RestoreRegsState(void); -void sub_81D4238(void); +void EReaderHelper_ClearSendRecvMgr(void); #endif // GUARD_EREADER_HELPERS_H diff --git a/include/link.h b/include/link.h index 3b621e6c1..407dbabb9 100644 --- a/include/link.h +++ b/include/link.h @@ -323,7 +323,7 @@ extern bool8 gSavedLinkPlayerCount; extern u8 gSavedMultiplayerId; extern struct LinkTestBGInfo gLinkTestBGInfo; extern void (*gLinkCallback)(void); -extern bool8 gShouldAdvanceLinkState; +extern u8 gShouldAdvanceLinkState; extern u16 gLinkTestBlockChecksums[MAX_LINK_PLAYERS]; extern u8 gBlockRequestType; extern u8 gLastSendQueueCount; -- cgit v1.2.3 From 86475c5ded028032a5b02c2700af77de2ab140c6 Mon Sep 17 00:00:00 2001 From: GriffinR Date: Sat, 24 Apr 2021 18:04:27 -0400 Subject: Document trainer hill ereader --- include/constants/trainer_hill.h | 5 +++-- include/ereader_helpers.h | 15 +++++++-------- 2 files changed, 10 insertions(+), 10 deletions(-) (limited to 'include') diff --git a/include/constants/trainer_hill.h b/include/constants/trainer_hill.h index 27357e99c..0e802bba8 100644 --- a/include/constants/trainer_hill.h +++ b/include/constants/trainer_hill.h @@ -37,8 +37,9 @@ #define TRAINER_HILL_TEXT_PLAYER_WON 4 #define TRAINER_HILL_TEXT_AFTER 5 -#define NUM_TRAINER_HILL_TRAINERS (NUM_TRAINER_HILL_FLOORS * 2) -#define NUM_TRAINER_HILL_TRAINERS_JP (NUM_TRAINER_HILL_FLOORS_JP * 2) +#define TRAINER_HILL_TRAINERS_PER_FLOOR 2 +#define NUM_TRAINER_HILL_TRAINERS (NUM_TRAINER_HILL_FLOORS * TRAINER_HILL_TRAINERS_PER_FLOOR) +#define NUM_TRAINER_HILL_TRAINERS_JP (NUM_TRAINER_HILL_FLOORS_JP * TRAINER_HILL_TRAINERS_PER_FLOOR) // Values returned by TrainerHillGetChallengeStatus #define TRAINER_HILL_PLAYER_STATUS_LOST 0 diff --git a/include/ereader_helpers.h b/include/ereader_helpers.h index 7cced65cb..937cfaca1 100755 --- a/include/ereader_helpers.h +++ b/include/ereader_helpers.h @@ -5,24 +5,23 @@ struct EReaderTrainerHillTrainer { - u8 unk0; - struct TrainerHillTrainer unk4; - struct TrHillDisplay unk14C; + u8 trainerNum; + struct TrainerHillTrainer trainer; + struct TrHillDisplay display; u32 checksum; }; // size=0x274 struct EReaderTrainerHillSet { - u8 count; + u8 numTrainers; u8 id; - u16 dummy; u32 checksum; - struct EReaderTrainerHillTrainer unk_8[6]; + struct EReaderTrainerHillTrainer trainers[6]; u8 unk_ec0[40]; }; // size = 0xf00 -bool8 EReader_IsReceivedDataValid(struct EReaderTrainerHillSet *buffer); -bool32 TryWriteTrainerHill(struct EReaderTrainerHillSet *arg0); +bool8 ValidateTrainerHillData(struct EReaderTrainerHillSet *); +bool32 TryWriteTrainerHill(struct EReaderTrainerHillSet *); bool32 ReadTrainerHillAndValidate(void); int EReaderHandleTransfer(u8, size_t, const void *, void *); void EReaderHelper_Timer3Callback(void); -- cgit v1.2.3 From e065c0c28576509f1873d76168618e4e57692f86 Mon Sep 17 00:00:00 2001 From: GriffinR Date: Sat, 24 Apr 2021 18:26:25 -0400 Subject: Label more unused battle anims --- include/battle_anim.h | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'include') diff --git a/include/battle_anim.h b/include/battle_anim.h index 34bd774fe..476480489 100644 --- a/include/battle_anim.h +++ b/include/battle_anim.h @@ -75,8 +75,8 @@ int GetAnimBgAttribute(u8 bgId, u8 attributeId); // battle_anim_mons.c void TranslateSpriteInEllipseOverDuration(struct Sprite *sprite); -void AnimUnused_80A8AEC(struct Sprite *sprite); -void AnimUnused_80A8A6C(struct Sprite *sprite); +void AnimTranslateLinearAndFlicker(struct Sprite *sprite); +void AnimTranslateLinearAndFlicker_Flipped(struct Sprite *sprite); void AnimWeatherBallUp(struct Sprite *sprite); void AnimWeatherBallDown(struct Sprite *sprite); void AnimSpinningSparkle(struct Sprite *sprite); -- cgit v1.2.3 From bee60f4c64e6cdf2bfa3777b59067ff63450e4e3 Mon Sep 17 00:00:00 2001 From: GriffinR Date: Sat, 24 Apr 2021 23:29:49 -0400 Subject: Document battler sprite affine anims, default pokeball throw --- include/data.h | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) (limited to 'include') diff --git a/include/data.h b/include/data.h index 2f8c44746..f94f55a8f 100644 --- a/include/data.h +++ b/include/data.h @@ -5,6 +5,12 @@ #define SPECIES_SHINY_TAG 500 +enum { + BATTLER_AFFINE_NORMAL, + BATTLER_AFFINE_EMERGE, + BATTLER_AFFINE_RETURN, +}; + struct MonCoords { // This would use a bitfield, but some function @@ -87,9 +93,9 @@ extern const struct SpriteFrameImage gTrainerBackPicTable_Steven[]; extern const union AffineAnimCmd *const gAffineAnims_BattleSpritePlayerSide[]; extern const union AffineAnimCmd *const gAffineAnims_BattleSpriteOpponentSide[]; -extern const union AffineAnimCmd *const gUnknown_082FF6C0[]; +extern const union AffineAnimCmd *const gAffineAnims_BattleSpriteContest[]; -extern const union AnimCmd *const gUnknown_082FF70C[]; +extern const union AnimCmd *const gAnims_MonPic[]; extern const struct MonCoords gMonFrontPicCoords[]; extern const struct CompressedSpriteSheet gMonStillFrontPicTable[]; extern const struct MonCoords gMonBackPicCoords[]; -- cgit v1.2.3 From aad090e154d4cb1397468f3b19071ddad688a7bc Mon Sep 17 00:00:00 2001 From: GriffinR Date: Sun, 25 Apr 2021 17:22:45 -0400 Subject: Document TV --- include/constants/battle_frontier.h | 15 +++++++++++++++ include/constants/easy_chat.h | 2 +- include/constants/metatile_labels.h | 2 ++ include/constants/tv.h | 38 +++++++++++++++++++++++++++++++++---- include/daycare.h | 2 +- include/global.h | 8 ++++---- include/global.tv.h | 22 +++++++++++---------- include/mauville_old_man.h | 2 +- include/tv.h | 30 +++++++++++++---------------- 9 files changed, 83 insertions(+), 38 deletions(-) (limited to 'include') diff --git a/include/constants/battle_frontier.h b/include/constants/battle_frontier.h index bbe6db81c..68c5a42ef 100644 --- a/include/constants/battle_frontier.h +++ b/include/constants/battle_frontier.h @@ -78,6 +78,21 @@ #define FRONTIER_MANIAC_MESSAGE_COUNT 3 +// Frontier TV Show +#define FRONTIER_SHOW_TOWER_SINGLES 1 +#define FRONTIER_SHOW_TOWER_DOUBLES 2 +#define FRONTIER_SHOW_TOWER_MULTIS 3 +#define FRONTIER_SHOW_TOWER_LINK_MULTIS 4 +#define FRONTIER_SHOW_DOME_SINGLES 5 +#define FRONTIER_SHOW_DOME_DOUBLES 6 +#define FRONTIER_SHOW_FACTORY_SINGLES 7 +#define FRONTIER_SHOW_FACTORY_DOUBLES 8 +#define FRONTIER_SHOW_PIKE 9 +#define FRONTIER_SHOW_ARENA 10 +#define FRONTIER_SHOW_PALACE_SINGLES 11 +#define FRONTIER_SHOW_PALACE_DOUBLES 12 +#define FRONTIER_SHOW_PYRAMID 13 + // Frontier Gambler #define FRONTIER_GAMBLER_WAITING 0 #define FRONTIER_GAMBLER_PLACED_BET 1 diff --git a/include/constants/easy_chat.h b/include/constants/easy_chat.h index 069f17fcb..f98cedbb7 100644 --- a/include/constants/easy_chat.h +++ b/include/constants/easy_chat.h @@ -9,7 +9,7 @@ #define EASY_CHAT_TYPE_INTERVIEW 5 #define EASY_CHAT_TYPE_BARD_SONG 6 #define EASY_CHAT_TYPE_FAN_CLUB 7 -#define EASY_CHAT_TYPE_UNK_8 8 +#define EASY_CHAT_TYPE_DUMMY_SHOW 8 #define EASY_CHAT_TYPE_TRENDY_PHRASE 9 #define EASY_CHAT_TYPE_GABBY_AND_TY 10 #define EASY_CHAT_TYPE_CONTEST_INTERVIEW 11 diff --git a/include/constants/metatile_labels.h b/include/constants/metatile_labels.h index 836ab6ef2..b5ef69046 100644 --- a/include/constants/metatile_labels.h +++ b/include/constants/metatile_labels.h @@ -42,6 +42,8 @@ #define METATILE_General_BlueCaveOpen 0x1B1 // gTileset_Building +#define METATILE_Building_TV_Off 0x002 +#define METATILE_Building_TV_On 0x003 #define METATILE_Building_PC_Off 0x004 #define METATILE_Building_PC_On 0x005 diff --git a/include/constants/tv.h b/include/constants/tv.h index f7b091f49..1b28f6e6e 100644 --- a/include/constants/tv.h +++ b/include/constants/tv.h @@ -6,12 +6,22 @@ #define POKENEWS_GAME_CORNER 2 #define POKENEWS_LILYCOVE 3 #define POKENEWS_BLENDMASTER 4 +#define NUM_POKENEWS_TYPES 4 // Excludes NONE + +// TV shows are categorized as being in one of 3 groups +// - TVGROUP_NORMAL, TV shows that can appear without Record Mixing +// - TVGROUP_RECORD_MIX, TV shows that can only appear via Record Mixing +// - TVGROUP_OUTBREAK, just contains TVSHOW_MASS_OUTBREAK +// Each group was allotted 20 spaces arbitrarily, though none use all 20 #define TVSHOW_OFF_AIR 0 + +// TVGROUP_NORMAL +#define TVGROUP_NORMAL_START 1 #define TVSHOW_FAN_CLUB_LETTER 1 #define TVSHOW_RECENT_HAPPENINGS 2 #define TVSHOW_PKMN_FAN_CLUB_OPINIONS 3 -#define TVSHOW_UNKN_SHOWTYPE_04 4 +#define TVSHOW_DUMMY 4 #define TVSHOW_NAME_RATER_SHOW 5 #define TVSHOW_BRAVO_TRAINER_POKEMON_PROFILE 6 #define TVSHOW_BRAVO_TRAINER_BATTLE_TOWER_PROFILE 7 @@ -20,7 +30,11 @@ #define TVSHOW_BATTLE_UPDATE 10 #define TVSHOW_FAN_CLUB_SPECIAL 11 #define TVSHOW_LILYCOVE_CONTEST_LADY 12 -// // +// +#define TVGROUP_NORMAL_END 20 + +// TVGROUP_RECORD_MIX +#define TVGROUP_RECORD_MIX_START 21 #define TVSHOW_POKEMON_TODAY_CAUGHT 21 #define TVSHOW_SMART_SHOPPER 22 #define TVSHOW_POKEMON_TODAY_FAILED 23 @@ -40,8 +54,22 @@ #define TVSHOW_NUMBER_ONE 37 #define TVSHOW_SECRET_BASE_SECRETS 38 #define TVSHOW_SAFARI_FAN_CLUB 39 -// // -#define TVSHOW_MASS_OUTBREAK 41 +#define TVGROUP_RECORD_MIX_END 40 + +// TVGROUP_OUTBREAK +#define TVGROUP_OUTBREAK_START 41 +#define TVSHOW_MASS_OUTBREAK 41 +// +#define TVGROUP_OUTBREAK_END 60 + +// The first 5 elements of gSaveBlock1Ptr->tvShows are reserved +// for TV shows from TVGROUP_NORMAL. The remainder are for TV +// shows from TVGROUP_RECORD_MIX. +#define NUM_NORMAL_TVSHOW_SLOTS 5 + +#define PLAYERS_HOUSE_TV_NONE 0 +#define PLAYERS_HOUSE_TV_LATI 1 +#define PLAYERS_HOUSE_TV_MOVIE 2 // Number of ribbons to put Spot the Cuties on air #define NUM_CUTIES_RIBBONS 4 @@ -221,4 +249,6 @@ #define CONTESTLADYLIVE_STATE_LOST 2 #define CONTESTLADYLIVE_STATE_LOST_BADLY 3 +#define SMARTSHOPPER_NUM_ITEMS 3 + #endif //GUARD_CONSTANTS_TV_H diff --git a/include/daycare.h b/include/daycare.h index 7d6f2fb19..d6c0d4201 100644 --- a/include/daycare.h +++ b/include/daycare.h @@ -6,7 +6,7 @@ u8 *GetMonNickname2(struct Pokemon *mon, u8 *dest); u8 *GetBoxMonNickname(struct BoxPokemon *mon, u8 *dest); u8 CountPokemonInDaycare(struct DayCare *daycare); -void InitDaycareMailRecordMixing(struct DayCare *daycare, struct RecordMixingDayCareMail *daycareMail); +void InitDaycareMailRecordMixing(struct DayCare *daycare, struct RecordMixingDaycareMail *daycareMail); void StoreSelectedPokemonInDaycare(void); u16 TakePokemonFromDaycare(void); void GetDaycareCost(void); diff --git a/include/global.h b/include/global.h index 19605ca57..e4c11f9ef 100644 --- a/include/global.h +++ b/include/global.h @@ -727,7 +727,7 @@ struct ContestWinner u8 contestRank; }; -struct DayCareMail +struct DaycareMail { struct MailStruct message; u8 OT_name[PLAYER_NAME_LENGTH + 1]; @@ -739,7 +739,7 @@ struct DayCareMail struct DaycareMon { struct BoxPokemon mon; - struct DayCareMail mail; + struct DaycareMail mail; u32 steps; }; @@ -750,9 +750,9 @@ struct DayCare u8 stepCounter; }; -struct RecordMixingDayCareMail +struct RecordMixingDaycareMail { - struct DayCareMail mail[DAYCARE_MON_COUNT]; + struct DaycareMail mail[DAYCARE_MON_COUNT]; u32 numDaycareMons; bool16 holdsItem[DAYCARE_MON_COUNT]; }; diff --git a/include/global.tv.h b/include/global.tv.h index 64e6a984e..2bc7dda99 100644 --- a/include/global.tv.h +++ b/include/global.tv.h @@ -1,13 +1,15 @@ #ifndef GUARD_GLOBAL_TV_H #define GUARD_GLOBAL_TV_H +#include "constants/tv.h" + typedef union // size = 0x24 { // Common struct { /*0x00*/ u8 kind; /*0x01*/ bool8 active; - /*0x02*/ u8 pad02[26]; + /*0x02*/ u8 data[26]; /*0x1C*/ u8 srcTrainerId3Lo; /*0x1D*/ u8 srcTrainerId3Hi; /*0x1E*/ u8 srcTrainerId2Lo; @@ -22,7 +24,7 @@ typedef union // size = 0x24 struct { /*0x00*/ u8 kind; /*0x01*/ bool8 active; - /*0x02*/ u8 pad02[34]; + /*0x02*/ u8 data[34]; } commonInit; // Local shows @@ -40,7 +42,7 @@ typedef union // size = 0x24 struct { /*0x00*/ u8 kind; /*0x01*/ bool8 active; - /*0x02*/ u16 var02; + /*0x02*/ u16 species; /*0x04*/ u16 words[6]; /*0x10*/ u8 playerName[PLAYER_NAME_LENGTH + 1]; /*0x18*/ u8 language; @@ -62,16 +64,16 @@ typedef union // size = 0x24 /*0x1C*/ u16 words[4]; } fanclubOpinions; - // TVSHOW_UNKN_SHOWTYPE_04 (dummied out) + // TVSHOW_DUMMY struct { /*0x00*/ u8 kind; /*0x01*/ bool8 active; /*0x02*/ u16 words[2]; - /*0x06*/ u16 var06; + /*0x06*/ u16 species; /*0x08*/ u8 pad_08[3]; - /*0x0b*/ u8 string_0b[12]; + /*0x0b*/ u8 name[12]; /*0x17*/ u8 language; - } unkShow04; + } dummy; // TVSHOW_NAME_RATER_SHOW struct { @@ -212,8 +214,8 @@ typedef union // size = 0x24 /*0x02*/ u8 priceReduced; /*0x03*/ u8 language; /*0x04*/ u8 pad04[2]; - /*0x06*/ u16 itemIds[3]; - /*0x0C*/ u16 itemAmounts[3]; + /*0x06*/ u16 itemIds[SMARTSHOPPER_NUM_ITEMS]; + /*0x0C*/ u16 itemAmounts[SMARTSHOPPER_NUM_ITEMS]; /*0x12*/ u8 shopLocation; /*0x13*/ u8 playerName[PLAYER_NAME_LENGTH + 1]; } smartshopperShow; @@ -401,7 +403,7 @@ typedef union // size = 0x24 /*0x08*/ u16 species3; /*0x0a*/ u16 species4; /*0x0c*/ u8 language; - /*0x0d*/ u8 facility; + /*0x0d*/ u8 facilityAndMode; /*0x0e*/ u8 filler_0e[5]; /*0x13*/ u8 playerName[PLAYER_NAME_LENGTH + 1]; } frontier; diff --git a/include/mauville_old_man.h b/include/mauville_old_man.h index 29c66a992..603d585da 100644 --- a/include/mauville_old_man.h +++ b/include/mauville_old_man.h @@ -7,7 +7,7 @@ void SetMauvilleOldMan(void); u8 GetCurrentMauvilleOldMan(void); void ScrSpecial_SetMauvilleOldManObjEventGfx(void); u8 sub_81201C8(void); -void sub_8120B70(OldMan *dest); +void SanitizeMauvilleOldManForRuby(OldMan *dest); void sub_8120670(void); void SanitizeReceivedRubyOldMan(union OldMan * oldMan, u32 r1, u32 r6); void SanitizeReceivedEmeraldOldMan(union OldMan * oldMan, u32 unused, u32 a2); diff --git a/include/tv.h b/include/tv.h index f94c5b7e5..30cd13326 100644 --- a/include/tv.h +++ b/include/tv.h @@ -1,13 +1,10 @@ #ifndef GUARD_TV_H #define GUARD_TV_H -#define SLOT_MACHINE 0 -#define ROULETTE 1 - extern u8 *const gTVStringVarPtrs[3]; void ClearTVShowData(void); -void sub_80EE184(void); +void TryPutBreakingNewsOnAir(void); void TryPutBattleSeminarOnAir(u16 foeSpecies, u16 species, u8 moveIdx, const u16 *movePtr, u16 betterMove); void TryPutFrontierTVShowOnAir(u16 winStreak, u8 facility); void DoTVShow(void); @@ -23,41 +20,37 @@ void ReceiveTvShowsData(void *src, u32 size, u8 masterIdx); void TryPutSpotTheCutiesOnAir(struct Pokemon *pokemon, u8 ribbonMonDataIdx); u32 GetPlayerIDAsU32(void); bool8 GetPriceReduction(u8 newsKind); -void sub_80F14F8(TVShow *shows); +void SanitizeTVShowLocationsForRuby(TVShow *shows); size_t CountDigits(int value); u8 GetRibbonCount(struct Pokemon *pokemon); void AlertTVThatPlayerPlayedSlotMachine(u16 nCoinsSpent); void AlertTVThatPlayerPlayedRoulette(u16 nCoinsSpent); -void AlertTVOfNewCoinTotal(u16 nCoinsPaidOut); +void TryPutFindThatGamerOnAir(u16 nCoinsPaidOut); void TryPutSecretBaseSecretsOnAir(void); void TryPutTodaysRivalTrainerOnAir(void); void TryPutTrendWatcherOnAir(const u16 *words); -void sub_80EDA80(void); void ReceivePokeNewsData(void *src, u32 size, u8 masterIdx); -void sub_80F0BB8(void); +void DeactivateAllNormalTVShows(void); void RecordFishingAttemptForTV(bool8 caughtFish); void IncrementDailySlotsUses(void); void IncrementDailyRouletteUses(void); void IncrementDailyWildBattles(void); void IncrementDailyBerryBlender(void); -void sub_80F1208(TVShow *shows); -void sub_80EE44C(u8 nMonsCaught, u8 nPkblkUsed); -void sub_80F14F8(TVShow *shows); -size_t sub_80EF370(int value); +void SanitizeTVShowsForRuby(TVShow *shows); +void TryPutSafariFanClubOnAir(u8 nMonsCaught, u8 nPkblkUsed); bool8 Put3CheersForPokeblocksOnTheAir(const u8 *partnersName, u8 flavor, u8 unused, u8 sheen, u8 language); void SetPokemonAnglerSpecies(u16 species); void UpdateTVShowsPerDay(u16 days); -void PutPokemonTodayCaughtOnAir(void); -void TV_PutSecretBaseVisitOnTheAir(void); +void TryPutPokemonTodayOnAir(void); +void TryPutSecretBaseVisitOnAir(void); void PutBattleUpdateOnTheAir(u8 opponentLinkPlayerId, u16 move, u16 speciesPlayer, u16 speciesOpponent); void BravoTrainerPokemonProfile_BeforeInterview1(u16 move); void InterviewBefore(void); void InterviewAfter(void); void UpdateTVScreensOnMap(int, int); -void TV_PrintIntToStringVar(u8 varIdx, int value); -void SaveRecordedItemPurchasesForTVShow(void); +void ConvertIntToDecimalString(u8 varIdx, int value); +void TryPutSmartShopperOnAir(void); bool8 ShouldAirFrontierTVShow(void); -void sub_80EE8C8(u16 winStreak, u8 facilityAndMode); void BravoTrainerPokemonProfile_BeforeInterview2(u8 contestStandingPlace); void ContestLiveUpdates_Init(u8 round1Placing); void ContestLiveUpdates_SetRound2Placing(u8 round2Placing); @@ -65,5 +58,8 @@ void ContestLiveUpdates_SetWinnerAppealFlag(u8 flag); void ContestLiveUpdates_SetWinnerMoveUsed(u16 move); void ContestLiveUpdates_SetLoserData(u8 flag, u8 loser); void ResetGabbyAndTy(void); +u8 CheckForPlayersHouseNews(void); +bool8 IsGabbyAndTyShowOnTheAir(void); +void TryPutTrainerFanClubOnAir(void); #endif //GUARD_TV_H -- cgit v1.2.3 From 6ce27c0ff0f8d6b3addea73ef2c49584c510e60b Mon Sep 17 00:00:00 2001 From: GriffinR Date: Tue, 4 May 2021 15:43:24 -0400 Subject: Restore EReaderTrainerHillSet dummy --- include/ereader_helpers.h | 1 + 1 file changed, 1 insertion(+) (limited to 'include') diff --git a/include/ereader_helpers.h b/include/ereader_helpers.h index 937cfaca1..064b61ed7 100755 --- a/include/ereader_helpers.h +++ b/include/ereader_helpers.h @@ -15,6 +15,7 @@ struct EReaderTrainerHillSet { u8 numTrainers; u8 id; + u16 dummy; // Only read in an assert. u32 checksum; struct EReaderTrainerHillTrainer trainers[6]; u8 unk_ec0[40]; -- cgit v1.2.3 From a8fab62c89dcdfc662bcb49c8a1b538ebc70d4b9 Mon Sep 17 00:00:00 2001 From: Flametix <44883711+Flametix@users.noreply.github.com> Date: Thu, 6 May 2021 20:49:04 -0400 Subject: Fix Substitute typo --- include/constants/battle_string_ids.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'include') diff --git a/include/constants/battle_string_ids.h b/include/constants/battle_string_ids.h index f22541272..c8d37aac6 100644 --- a/include/constants/battle_string_ids.h +++ b/include/constants/battle_string_ids.h @@ -502,7 +502,7 @@ #define B_MSG_TRANSFORMED 0 #define B_MSG_TRANSFORM_FAILED 1 -// gSubsituteUsedStringIds +// gSubstituteUsedStringIds #define B_MSG_SET_SUBSTITUTE 0 #define B_MSG_SUBSTITUTE_FAILED 1 -- cgit v1.2.3 From 65fd3342562106c5a9ffa93f6b46a02c7ebe9ef5 Mon Sep 17 00:00:00 2001 From: GriffinR Date: Wed, 28 Apr 2021 16:06:27 -0400 Subject: Name map groups --- include/constants/map_groups.h | 68 +++++++++++++++++++++--------------------- 1 file changed, 34 insertions(+), 34 deletions(-) (limited to 'include') diff --git a/include/constants/map_groups.h b/include/constants/map_groups.h index c650600e8..eaf40a525 100755 --- a/include/constants/map_groups.h +++ b/include/constants/map_groups.h @@ -5,7 +5,7 @@ // DO NOT MODIFY THIS FILE! It is auto-generated from data/maps/map_groups.json // -// Map Group 0 +// gMapGroup_TownsAndRoutes #define MAP_PETALBURG_CITY (0 | (0 << 8)) #define MAP_SLATEPORT_CITY (1 | (0 << 8)) #define MAP_MAUVILLE_CITY (2 | (0 << 8)) @@ -64,21 +64,21 @@ #define MAP_UNDERWATER_ROUTE105 (55 | (0 << 8)) #define MAP_UNDERWATER_ROUTE125 (56 | (0 << 8)) -// Map Group 1 +// gMapGroup_IndoorLittleroot #define MAP_LITTLEROOT_TOWN_BRENDANS_HOUSE_1F (0 | (1 << 8)) #define MAP_LITTLEROOT_TOWN_BRENDANS_HOUSE_2F (1 | (1 << 8)) #define MAP_LITTLEROOT_TOWN_MAYS_HOUSE_1F (2 | (1 << 8)) #define MAP_LITTLEROOT_TOWN_MAYS_HOUSE_2F (3 | (1 << 8)) #define MAP_LITTLEROOT_TOWN_PROFESSOR_BIRCHS_LAB (4 | (1 << 8)) -// Map Group 2 +// gMapGroup_IndoorOldale #define MAP_OLDALE_TOWN_HOUSE1 (0 | (2 << 8)) #define MAP_OLDALE_TOWN_HOUSE2 (1 | (2 << 8)) #define MAP_OLDALE_TOWN_POKEMON_CENTER_1F (2 | (2 << 8)) #define MAP_OLDALE_TOWN_POKEMON_CENTER_2F (3 | (2 << 8)) #define MAP_OLDALE_TOWN_MART (4 | (2 << 8)) -// Map Group 3 +// gMapGroup_IndoorDewford #define MAP_DEWFORD_TOWN_HOUSE1 (0 | (3 << 8)) #define MAP_DEWFORD_TOWN_POKEMON_CENTER_1F (1 | (3 << 8)) #define MAP_DEWFORD_TOWN_POKEMON_CENTER_2F (2 | (3 << 8)) @@ -86,7 +86,7 @@ #define MAP_DEWFORD_TOWN_HALL (4 | (3 << 8)) #define MAP_DEWFORD_TOWN_HOUSE2 (5 | (3 << 8)) -// Map Group 4 +// gMapGroup_IndoorLavaridge #define MAP_LAVARIDGE_TOWN_HERB_SHOP (0 | (4 << 8)) #define MAP_LAVARIDGE_TOWN_GYM_1F (1 | (4 << 8)) #define MAP_LAVARIDGE_TOWN_GYM_B1F (2 | (4 << 8)) @@ -95,7 +95,7 @@ #define MAP_LAVARIDGE_TOWN_POKEMON_CENTER_1F (5 | (4 << 8)) #define MAP_LAVARIDGE_TOWN_POKEMON_CENTER_2F (6 | (4 << 8)) -// Map Group 5 +// gMapGroup_IndoorFallarbor #define MAP_FALLARBOR_TOWN_MART (0 | (5 << 8)) #define MAP_FALLARBOR_TOWN_BATTLE_TENT_LOBBY (1 | (5 << 8)) #define MAP_FALLARBOR_TOWN_BATTLE_TENT_CORRIDOR (2 | (5 << 8)) @@ -105,7 +105,7 @@ #define MAP_FALLARBOR_TOWN_COZMOS_HOUSE (6 | (5 << 8)) #define MAP_FALLARBOR_TOWN_MOVE_RELEARNERS_HOUSE (7 | (5 << 8)) -// Map Group 6 +// gMapGroup_IndoorVerdanturf #define MAP_VERDANTURF_TOWN_BATTLE_TENT_LOBBY (0 | (6 << 8)) #define MAP_VERDANTURF_TOWN_BATTLE_TENT_CORRIDOR (1 | (6 << 8)) #define MAP_VERDANTURF_TOWN_BATTLE_TENT_BATTLE_ROOM (2 | (6 << 8)) @@ -116,7 +116,7 @@ #define MAP_VERDANTURF_TOWN_FRIENDSHIP_RATERS_HOUSE (7 | (6 << 8)) #define MAP_VERDANTURF_TOWN_HOUSE (8 | (6 << 8)) -// Map Group 7 +// gMapGroup_IndoorPacifidlog #define MAP_PACIFIDLOG_TOWN_POKEMON_CENTER_1F (0 | (7 << 8)) #define MAP_PACIFIDLOG_TOWN_POKEMON_CENTER_2F (1 | (7 << 8)) #define MAP_PACIFIDLOG_TOWN_HOUSE1 (2 | (7 << 8)) @@ -125,7 +125,7 @@ #define MAP_PACIFIDLOG_TOWN_HOUSE4 (5 | (7 << 8)) #define MAP_PACIFIDLOG_TOWN_HOUSE5 (6 | (7 << 8)) -// Map Group 8 +// gMapGroup_IndoorPetalburg #define MAP_PETALBURG_CITY_WALLYS_HOUSE (0 | (8 << 8)) #define MAP_PETALBURG_CITY_GYM (1 | (8 << 8)) #define MAP_PETALBURG_CITY_HOUSE1 (2 | (8 << 8)) @@ -134,7 +134,7 @@ #define MAP_PETALBURG_CITY_POKEMON_CENTER_2F (5 | (8 << 8)) #define MAP_PETALBURG_CITY_MART (6 | (8 << 8)) -// Map Group 9 +// gMapGroup_IndoorSlateport #define MAP_SLATEPORT_CITY_STERNS_SHIPYARD_1F (0 | (9 << 8)) #define MAP_SLATEPORT_CITY_STERNS_SHIPYARD_2F (1 | (9 << 8)) #define MAP_SLATEPORT_CITY_BATTLE_TENT_LOBBY (2 | (9 << 8)) @@ -150,7 +150,7 @@ #define MAP_SLATEPORT_CITY_POKEMON_CENTER_2F (12 | (9 << 8)) #define MAP_SLATEPORT_CITY_MART (13 | (9 << 8)) -// Map Group 10 +// gMapGroup_IndoorMauville #define MAP_MAUVILLE_CITY_GYM (0 | (10 << 8)) #define MAP_MAUVILLE_CITY_BIKE_SHOP (1 | (10 << 8)) #define MAP_MAUVILLE_CITY_HOUSE1 (2 | (10 << 8)) @@ -160,7 +160,7 @@ #define MAP_MAUVILLE_CITY_POKEMON_CENTER_2F (6 | (10 << 8)) #define MAP_MAUVILLE_CITY_MART (7 | (10 << 8)) -// Map Group 11 +// gMapGroup_IndoorRustboro #define MAP_RUSTBORO_CITY_DEVON_CORP_1F (0 | (11 << 8)) #define MAP_RUSTBORO_CITY_DEVON_CORP_2F (1 | (11 << 8)) #define MAP_RUSTBORO_CITY_DEVON_CORP_3F (2 | (11 << 8)) @@ -179,7 +179,7 @@ #define MAP_RUSTBORO_CITY_FLAT2_3F (15 | (11 << 8)) #define MAP_RUSTBORO_CITY_HOUSE3 (16 | (11 << 8)) -// Map Group 12 +// gMapGroup_IndoorFortree #define MAP_FORTREE_CITY_HOUSE1 (0 | (12 << 8)) #define MAP_FORTREE_CITY_GYM (1 | (12 << 8)) #define MAP_FORTREE_CITY_POKEMON_CENTER_1F (2 | (12 << 8)) @@ -191,7 +191,7 @@ #define MAP_FORTREE_CITY_HOUSE5 (8 | (12 << 8)) #define MAP_FORTREE_CITY_DECORATION_SHOP (9 | (12 << 8)) -// Map Group 13 +// gMapGroup_IndoorLilycove #define MAP_LILYCOVE_CITY_COVE_LILY_MOTEL_1F (0 | (13 << 8)) #define MAP_LILYCOVE_CITY_COVE_LILY_MOTEL_2F (1 | (13 << 8)) #define MAP_LILYCOVE_CITY_LILYCOVE_MUSEUM_1F (2 | (13 << 8)) @@ -216,7 +216,7 @@ #define MAP_LILYCOVE_CITY_DEPARTMENT_STORE_ROOFTOP (21 | (13 << 8)) #define MAP_LILYCOVE_CITY_DEPARTMENT_STORE_ELEVATOR (22 | (13 << 8)) -// Map Group 14 +// gMapGroup_IndoorMossdeep #define MAP_MOSSDEEP_CITY_GYM (0 | (14 << 8)) #define MAP_MOSSDEEP_CITY_HOUSE1 (1 | (14 << 8)) #define MAP_MOSSDEEP_CITY_HOUSE2 (2 | (14 << 8)) @@ -231,7 +231,7 @@ #define MAP_MOSSDEEP_CITY_GAME_CORNER_1F (11 | (14 << 8)) #define MAP_MOSSDEEP_CITY_GAME_CORNER_B1F (12 | (14 << 8)) -// Map Group 15 +// gMapGroup_IndoorSootopolis #define MAP_SOOTOPOLIS_CITY_GYM_1F (0 | (15 << 8)) #define MAP_SOOTOPOLIS_CITY_GYM_B1F (1 | (15 << 8)) #define MAP_SOOTOPOLIS_CITY_POKEMON_CENTER_1F (2 | (15 << 8)) @@ -248,7 +248,7 @@ #define MAP_SOOTOPOLIS_CITY_MYSTERY_EVENTS_HOUSE_1F (13 | (15 << 8)) #define MAP_SOOTOPOLIS_CITY_MYSTERY_EVENTS_HOUSE_B1F (14 | (15 << 8)) -// Map Group 16 +// gMapGroup_IndoorEverGrande #define MAP_EVER_GRANDE_CITY_SIDNEYS_ROOM (0 | (16 << 8)) #define MAP_EVER_GRANDE_CITY_PHOEBES_ROOM (1 | (16 << 8)) #define MAP_EVER_GRANDE_CITY_GLACIAS_ROOM (2 | (16 << 8)) @@ -265,33 +265,33 @@ #define MAP_EVER_GRANDE_CITY_POKEMON_CENTER_2F (13 | (16 << 8)) #define MAP_EVER_GRANDE_CITY_POKEMON_LEAGUE_2F (14 | (16 << 8)) -// Map Group 17 +// gMapGroup_IndoorRoute104 #define MAP_ROUTE104_MR_BRINEYS_HOUSE (0 | (17 << 8)) #define MAP_ROUTE104_PRETTY_PETAL_FLOWER_SHOP (1 | (17 << 8)) -// Map Group 18 +// gMapGroup_IndoorRoute111 #define MAP_ROUTE111_WINSTRATE_FAMILYS_HOUSE (0 | (18 << 8)) #define MAP_ROUTE111_OLD_LADYS_REST_STOP (1 | (18 << 8)) -// Map Group 19 +// gMapGroup_IndoorRoute112 #define MAP_ROUTE112_CABLE_CAR_STATION (0 | (19 << 8)) #define MAP_MT_CHIMNEY_CABLE_CAR_STATION (1 | (19 << 8)) -// Map Group 20 +// gMapGroup_IndoorRoute114 #define MAP_ROUTE114_FOSSIL_MANIACS_HOUSE (0 | (20 << 8)) #define MAP_ROUTE114_FOSSIL_MANIACS_TUNNEL (1 | (20 << 8)) #define MAP_ROUTE114_LANETTES_HOUSE (2 | (20 << 8)) -// Map Group 21 +// gMapGroup_IndoorRoute116 #define MAP_ROUTE116_TUNNELERS_REST_HOUSE (0 | (21 << 8)) -// Map Group 22 +// gMapGroup_IndoorRoute117 #define MAP_ROUTE117_POKEMON_DAY_CARE (0 | (22 << 8)) -// Map Group 23 +// gMapGroup_IndoorRoute121 #define MAP_ROUTE121_SAFARI_ZONE_ENTRANCE (0 | (23 << 8)) -// Map Group 24 +// gMapGroup_Dungeons #define MAP_METEOR_FALLS_1F_1R (0 | (24 << 8)) #define MAP_METEOR_FALLS_1F_2R (1 | (24 << 8)) #define MAP_METEOR_FALLS_B1F_1R (2 | (24 << 8)) @@ -401,7 +401,7 @@ #define MAP_ALTERING_CAVE (106 | (24 << 8)) #define MAP_METEOR_FALLS_STEVENS_CAVE (107 | (24 << 8)) -// Map Group 25 +// gMapGroup_IndoorDynamic #define MAP_SECRET_BASE_RED_CAVE1 (0 | (25 << 8)) #define MAP_SECRET_BASE_BROWN_CAVE1 (1 | (25 << 8)) #define MAP_SECRET_BASE_BLUE_CAVE1 (2 | (25 << 8)) @@ -464,7 +464,7 @@ #define MAP_BATTLE_PYRAMID_SQUARE16 (59 | (25 << 8)) #define MAP_UNION_ROOM (60 | (25 << 8)) -// Map Group 26 +// gMapGroup_SpecialArea #define MAP_SAFARI_ZONE_NORTHWEST (0 | (26 << 8)) #define MAP_SAFARI_ZONE_NORTH (1 | (26 << 8)) #define MAP_SAFARI_ZONE_SOUTHWEST (2 | (26 << 8)) @@ -555,14 +555,14 @@ #define MAP_NAVEL_ROCK_BOTTOM (87 | (26 << 8)) #define MAP_TRAINER_HILL_ELEVATOR (88 | (26 << 8)) -// Map Group 27 +// gMapGroup_IndoorRoute104Prototype #define MAP_ROUTE104_PROTOTYPE (0 | (27 << 8)) #define MAP_ROUTE104_PROTOTYPE_PRETTY_PETAL_FLOWER_SHOP (1 | (27 << 8)) -// Map Group 28 +// gMapGroup_IndoorRoute109 #define MAP_ROUTE109_SEASHORE_HOUSE (0 | (28 << 8)) -// Map Group 29 +// gMapGroup_IndoorRoute110 #define MAP_ROUTE110_TRICK_HOUSE_ENTRANCE (0 | (29 << 8)) #define MAP_ROUTE110_TRICK_HOUSE_END (1 | (29 << 8)) #define MAP_ROUTE110_TRICK_HOUSE_CORRIDOR (2 | (29 << 8)) @@ -577,18 +577,18 @@ #define MAP_ROUTE110_SEASIDE_CYCLING_ROAD_NORTH_ENTRANCE (11 | (29 << 8)) #define MAP_ROUTE110_SEASIDE_CYCLING_ROAD_SOUTH_ENTRANCE (12 | (29 << 8)) -// Map Group 30 +// gMapGroup_IndoorRoute113 #define MAP_ROUTE113_GLASS_WORKSHOP (0 | (30 << 8)) -// Map Group 31 +// gMapGroup_IndoorRoute123 #define MAP_ROUTE123_BERRY_MASTERS_HOUSE (0 | (31 << 8)) -// Map Group 32 +// gMapGroup_IndoorRoute119 #define MAP_ROUTE119_WEATHER_INSTITUTE_1F (0 | (32 << 8)) #define MAP_ROUTE119_WEATHER_INSTITUTE_2F (1 | (32 << 8)) #define MAP_ROUTE119_HOUSE (2 | (32 << 8)) -// Map Group 33 +// gMapGroup_IndoorRoute124 #define MAP_ROUTE124_DIVING_TREASURE_HUNTERS_HOUSE (0 | (33 << 8)) #define MAP_GROUPS_COUNT 34 -- cgit v1.2.3 From 2be29cdb77afd5ffcb8ce70fbc9bef0c77db556a Mon Sep 17 00:00:00 2001 From: gAlfonso-bit <83477269+gAlfonso-bit@users.noreply.github.com> Date: Wed, 12 May 2021 17:00:42 -0400 Subject: Update IsPokemonCryPlaying --- include/gba/m4a_internal.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'include') diff --git a/include/gba/m4a_internal.h b/include/gba/m4a_internal.h index 2d0e1bb1c..2ccbb18f5 100644 --- a/include/gba/m4a_internal.h +++ b/include/gba/m4a_internal.h @@ -447,7 +447,7 @@ void SetPokemonCryPitch(s16 val); void SetPokemonCryLength(u16 val); void SetPokemonCryRelease(u8 val); void SetPokemonCryProgress(u32 val); -int IsPokemonCryPlaying(struct MusicPlayerInfo *mplayInfo); +bool32 IsPokemonCryPlaying(struct MusicPlayerInfo *mplayInfo); void SetPokemonCryChorus(s8 val); void SetPokemonCryStereo(u32 val); void SetPokemonCryPriority(u8 val); -- cgit v1.2.3 From 2bbaf71998337cba3c912143302f816b4116e851 Mon Sep 17 00:00:00 2001 From: Kurausukun Date: Mon, 31 May 2021 00:19:26 -0400 Subject: [LEAK-INFORMED] fix CreateShedinja fakematch info: the header change is required. accesses to the struct need to be treated as non-const, even though the array must be const. thanks to jiang for figuring this out. --- include/pokemon.h | 1 - 1 file changed, 1 deletion(-) (limited to 'include') diff --git a/include/pokemon.h b/include/pokemon.h index 82cdefeac..3565bd966 100644 --- a/include/pokemon.h +++ b/include/pokemon.h @@ -258,7 +258,6 @@ extern const u8 gFacilityClassToPicIndex[]; extern const u8 gFacilityClassToTrainerClass[]; extern const struct BaseStats gBaseStats[]; extern const u8 *const gItemEffectTable[]; -extern const struct Evolution gEvolutionTable[][EVOS_PER_MON]; extern const u32 gExperienceTables[][MAX_LEVEL + 1]; extern const u16 *const gLevelUpLearnsets[]; extern const u8 gPPUpGetMask[]; -- cgit v1.2.3