diff options
Diffstat (limited to 'include')
80 files changed, 2406 insertions, 417 deletions
diff --git a/include/battle.h b/include/battle.h index 10cdfaa73..9875f265e 100644 --- a/include/battle.h +++ b/include/battle.h @@ -5,6 +5,7 @@ #include "battle_util.h" #include "battle_script_commands.h" #include "battle_2.h" +#include "battle_ai_switch_items.h" /* Banks are a name given to what could be called a 'battlerId' or 'monControllerId'. @@ -77,6 +78,7 @@ #define BATTLE_PLAYER_TELEPORTED 0x5 #define BATTLE_POKE_FLED 0x6 #define BATTLE_CAUGHT 0x7 +#define BATTLE_SAFARI_OUT_OF_BALLS 0x8 #define BATTLE_FORFEITED 0x9 #define BATTLE_OPPONENT_TELEPORTED 0xA @@ -498,7 +500,7 @@ struct BattleHistory struct UsedMoves usedMoves[BATTLE_BANKS_COUNT]; u8 abilities[BATTLE_BANKS_COUNT]; u8 itemEffects[BATTLE_BANKS_COUNT]; - u16 TrainerItems[BATTLE_BANKS_COUNT]; + u16 trainerItems[BATTLE_BANKS_COUNT]; u8 itemsNo; }; @@ -549,11 +551,11 @@ struct BattleResults u8 playerSwitchesCounter; // 0x2 u8 unk3; // 0x3 u8 unk4; // 0x4 - u8 unk5_0:1; // 0x5 , 0x1 - u8 unk5_1:1; // 0x5 , 0x2 - u8 caughtMonBall:4; // 0x5 , 0x4/0x8/0x10/0x20 - u8 unk5_6:1; // 0x5 , 0x40 - u8 unk5_7:1; // 0x5 , 0x80 + u8 unk5_0:1; // 0x5 + u8 usedMasterBall:1; // 0x5 + u8 caughtMonBall:4; // 0x5 + u8 unk5_6:1; // 0x5 + u8 unk5_7:1; // 0x5 u16 playerMon1Species; // 0x6 u8 playerMon1Name[11]; // 0x8 u8 battleTurnCounter; // 0x13 @@ -566,7 +568,7 @@ struct BattleResults u16 caughtMonSpecies; // 0x28 u8 caughtMonNick[10]; // 0x2A u8 filler34[2]; - u8 catchAttempts[12]; // 0x36 + u8 catchAttempts[11]; // 0x36 }; extern struct BattleResults gBattleResults; @@ -626,7 +628,7 @@ struct BattleStruct u8 field_8B; u8 field_8C; u8 field_8D; - u8 field_8E; + u8 stringMoveType; u8 expGetterBank; u8 field_90; u8 field_91; @@ -654,8 +656,8 @@ struct BattleStruct void (*savedCallback)(void); u16 usedHeldItems[BATTLE_BANKS_COUNT]; u8 field_C0[4]; - u8 field_C4[2]; - u8 field_C6[2]; + u8 AI_itemType[2]; + u8 AI_itemFlags[2]; u16 choicedMove[BATTLE_BANKS_COUNT]; u16 changedItems[BATTLE_BANKS_COUNT]; u8 intimidateBank; @@ -830,8 +832,8 @@ struct BattleScripting u8 atk6C_state; u8 learnMoveState; u8 field_20; - u8 field_21; - u8 field_22; + u8 reshowMainState; + u8 reshowHelperState; u8 field_23; u8 field_24; u8 multiplayerId; @@ -861,9 +863,29 @@ void FreeBattleSpritesData(void); void AllocateMonSpritesGfx(void); void FreeMonSpritesGfx(void); void BattleMusicStop(void); -void sub_805E990(struct Pokemon* mon, u8 bank); +void sub_805E990(struct Pokemon *mon, u8 bank); void sub_805EF14(void); bool8 BattleInitAllSprites(u8 *state1, u8 *state2); +void sub_805E350(void); +bool8 BattleLoadAllHealthBoxesGfx(u8 state); +void LoadAndCreateEnemyShadowSprites(void); +void SetBankEnemyShadowSpriteCallback(u8 bank, u16 species); +void BattleLoadPlayerMonSpriteGfx(struct Pokemon *mon, u8 bank); +void BattleLoadOpponentMonSpriteGfx(struct Pokemon *mon, u8 bank); +void BattleLoadSubstituteSpriteGfx(u8 bank, bool8 arg1); + +enum +{ + BACK_PIC_BRENDAN, + BACK_PIC_MAY, + BACK_PIC_RED, + BACK_PIC_LEAF, + BACK_PIC_RS_BRENDAN, + BACK_PIC_RS_MAY, + BACK_PIC_WALLY, + BACK_PIC_STEVEN +}; +void LoadBackTrainerBankSpriteGfx(u8 backPicId, u8 bank); // rom_80A5C6C u8 GetBankSide(u8 bank); @@ -923,6 +945,10 @@ struct MonSpritesGfx struct SpriteTemplate templates[4]; }; +extern struct BattleSpritesGfx* gMonSpritesGfx; +extern u8 gBattleOutcome; +extern u16 gLastUsedItem; +extern u32 gBattleTypeFlags; extern struct MonSpritesGfx* gMonSpritesGfxPtr; #endif // GUARD_BATTLE_H diff --git a/include/battle_2.h b/include/battle_2.h index edd6b6ef3..677bf0505 100644 --- a/include/battle_2.h +++ b/include/battle_2.h @@ -15,6 +15,7 @@ void SwapTurnOrder(u8 id1, u8 id2); void BattleTurnPassed(void); void RunBattleScriptCommands_PopCallbacksStack(void); void RunBattleScriptCommands(void); +u32 sub_80397C4(u32 setId, u32 tableId); void sub_8039E9C(struct Sprite *sprite); extern const u8 gStatusConditionString_PoisonJpn[8]; @@ -25,6 +26,6 @@ extern const u8 gStatusConditionString_IceJpn[8]; extern const u8 gStatusConditionString_ConfusionJpn[8]; extern const u8 gStatusConditionString_LoveJpn[8]; -extern const u8 * const gStatusConditionStringsTable[][2]; +extern const u8 * const gStatusConditionStringsTable[7][2]; #endif // GUARD_BATTLE_2_H diff --git a/include/battle_ai_switch_items.h b/include/battle_ai_switch_items.h new file mode 100644 index 000000000..0a230e7f6 --- /dev/null +++ b/include/battle_ai_switch_items.h @@ -0,0 +1,17 @@ +#ifndef GUARD_BATTLE_AI_SWITCH_ITEMS_H +#define GUARD_BATTLE_AI_SWITCH_ITEMS_H + +enum +{ + AI_ITEM_FULL_RESTORE = 1, + AI_ITEM_HEAL_HP, + AI_ITEM_CURE_CONDITION, + AI_ITEM_X_STAT, + AI_ITEM_GUARD_SPECS, + AI_ITEM_NOT_RECOGNIZABLE +}; + +void AI_TrySwitchOrUseItem(void); +u8 GetMostSuitableMonToSwitchInto(void); + +#endif // GUARD_BATTLE_AI_SWITCH_ITEMS_H diff --git a/include/battle_controller_player.h b/include/battle_controller_player.h new file mode 100644 index 000000000..6d095efe7 --- /dev/null +++ b/include/battle_controller_player.h @@ -0,0 +1,7 @@ +#ifndef GUARD_BATTLE_CONTROLLER_PLAYER_H +#define GUARD_BATTLE_CONTROLLER_PLAYER_H + +void ActionSelectionCreateCursorAt(u8 cursorPos, u8 unused); +void ActionSelectionDestroyCursorAt(u8 cursorPos); + +#endif // GUARD_BATTLE_CONTROLLER_PLAYER_H diff --git a/include/battle_controllers.h b/include/battle_controllers.h index 2281fdaff..e710deea5 100644 --- a/include/battle_controllers.h +++ b/include/battle_controllers.h @@ -1,6 +1,8 @@ #ifndef GUARD_BATTLE_CONTROLLERS_H #define GUARD_BATTLE_CONTROLLERS_H +#include "battle_controller_player.h" + #define REQUEST_ALL_BATTLE 0x0 #define REQUEST_SPECIES_BATTLE 0x1 #define REQUEST_HELDITEM_BATTLE 0x2 @@ -39,8 +41,8 @@ struct MovePpInfo struct ChooseMoveStruct { u16 moves[4]; - u8 ppNumbers[4]; - u8 ppWithBonusNumbers[4]; + u8 currentPp[4]; + u8 maxPp[4]; u16 species; u8 monType1; u8 monType2; @@ -84,5 +86,6 @@ void Emit_x32(u8 bufferId); void EmitPrintString(u8 bufferId, u16 stringId); void EmitResetActionMoveSelection(u8 bufferId, u8 caseId); void EmitBallThrow(u8 bufferId, u8 caseId); +void EmitCmd_x21(u8 bufferId, u8 arg1, u16 arg2); #endif // GUARD_BATTLE_CONTROLLERS_H diff --git a/include/battle_frontier_2.h b/include/battle_frontier_2.h new file mode 100644 index 000000000..4f37248cc --- /dev/null +++ b/include/battle_frontier_2.h @@ -0,0 +1,9 @@ +#ifndef GUARD_BATTLE_FRONTIER_2_H +#define GUARD_BATTLE_FRONTIER_2_H + +void sub_81A8934(u8); +void sub_81A895C(void); +u16 sub_81A89A0(u8); +void sub_81A8AF8(void); + +#endif // GUARD_BATTLE_FRONTIER_2_H diff --git a/include/battle_interface.h b/include/battle_interface.h new file mode 100644 index 000000000..cecc7bd1f --- /dev/null +++ b/include/battle_interface.h @@ -0,0 +1,28 @@ +#ifndef GUARD_BATTLE_INTERFACE_H +#define GUARD_BATTLE_INTERFACE_H + +enum +{ + HEALTHBOX_ALL, + HEALTHBOX_CURRENT_HP, + HEALTHBOX_MAX_HP, + HEALTHBOX_LEVEL, + HEALTHBOX_NICK, + HEALTHBOX_HEALTH_BAR, + HEALTHBOX_EXP_BAR, + HEALTHBOX_7, + HEALTHBOX_8, + HEALTHBOX_STATUS_ICON, + HEALTHBOX_SAFARI_ALL_TEXT, + HEALTHBOX_SAFARI_BALLS_TEXT +}; + +u8 CreateBankHealthboxSprites(u8 bank); +u8 CreateSafariPlayerHealthboxSprites(void); +void SetBankHealthboxSpritePos(u8 bank); +void SetHealthboxSpriteVisible(u8 healthboxSpriteId); +void SetHealthboxSpriteInvisible(u8 healthboxSpriteId); +void UpdateHealthboxAttribute(u8 healthboxSpriteId, struct Pokemon *mon, u8 elementId); +void nullsub_30(u8 healthboxSpriteId, bool8 isDoubleBattleBankOnly); + +#endif // GUARD_BATTLE_INTERFACE_H diff --git a/include/battle_message.h b/include/battle_message.h index 3bc7117bb..3b154c5a6 100644 --- a/include/battle_message.h +++ b/include/battle_message.h @@ -3,59 +3,59 @@ // for 0xFD -#define B_TXT_BUFF1 00 -#define B_TXT_BUFF2 01 -#define B_TXT_COPY_VAR_1 02 -#define B_TXT_COPY_VAR_2 03 -#define B_TXT_COPY_VAR_3 04 -#define B_TXT_PLAYER_MON1_NAME 05 -#define B_TXT_OPPONENT_MON1_NAME 06 -#define B_TXT_PLAYER_MON2_NAME 07 -#define B_TXT_OPPONENT_MON2_NAME 08 -#define B_TXT_LINK_PLAYER_MON1_NAME 09 -#define B_TXT_LINK_OPPONENT_MON1_NAME 0A -#define B_TXT_LINK_PLAYER_MON2_NAME 0B -#define B_TXT_LINK_OPPONENT_MON2_NAME 0C -#define B_TXT_ATK_NAME_WITH_PREFIX_MON1 0D -#define B_TXT_ATK_NAME 0E -#define B_TXT_ATK_NAME_WITH_PREFIX 0F -#define B_TXT_DEF_NAME_WITH_PREFIX 10 -#define B_TXT_EFF_NAME_WITH_PREFIX 11 // EFF = short for gEffectBank -#define B_TXT_SCR_ACTIVE_NAME_WITH_PREFIX 12 -#define B_TXT_ACTIVE_NAME_WITH_PREFIX 13 -#define B_TXT_CURRENT_MOVE 14 -#define B_TXT_LAST_MOVE 15 -#define B_TXT_LAST_ITEM 16 -#define B_TXT_LAST_ABILITY 17 -#define B_TXT_ATK_ABILITY 18 -#define B_TXT_DEF_ABILITY 19 -#define B_TXT_SCR_ACTIVE_ABILITY 1A -#define B_TXT_EFF_ABILITY 1B -#define B_TXT_TRAINER1_CLASS 1C -#define B_TXT_TRAINER1_NAME 1D -#define B_TXT_1E 1E // trainer name for a link player -#define B_TXT_1F 1F // trainer name for a link player -#define B_TXT_20 20 // trainer name for a link player -#define B_TXT_21 21 // trainer name for a link player -#define B_TXT_22 22 // trainer name for a link player -#define B_TXT_PLAYER_NAME 23 -#define B_TXT_TRAINER1_LOSE_TEXT 24 -#define B_TXT_TRAINER1_WIN_TEXT 25 -#define B_TXT_26 26 -#define B_TXT_PC_CREATOR_NAME 27 -#define B_TXT_ATK_PREFIX1 28 -#define B_TXT_DEF_PREFIX1 29 -#define B_TXT_ATK_PREFIX2 2A -#define B_TXT_DEF_PREFIX2 2B -#define B_TXT_ATK_PREFIX3 2C -#define B_TXT_DEF_PREFIX3 2D -#define B_TXT_TRAINER2_CLASS 2E -#define B_TXT_TRAINER2_NAME 2F -#define B_TXT_TRAINER2_LOSE_TEXT 30 -#define B_TXT_TRAINER2_WIN_TEXT 31 -#define B_TXT_PARTNER_CLASS 32 -#define B_TXT_PARTNER_NAME 33 -#define B_TXT_BUFF3 34 +#define B_TXT_BUFF1 0x0 +#define B_TXT_BUFF2 0x1 +#define B_TXT_COPY_VAR_1 0x2 +#define B_TXT_COPY_VAR_2 0x3 +#define B_TXT_COPY_VAR_3 0x4 +#define B_TXT_PLAYER_MON1_NAME 0x5 +#define B_TXT_OPPONENT_MON1_NAME 0x6 +#define B_TXT_PLAYER_MON2_NAME 0x7 +#define B_TXT_OPPONENT_MON2_NAME 0x8 +#define B_TXT_LINK_PLAYER_MON1_NAME 0x9 +#define B_TXT_LINK_OPPONENT_MON1_NAME 0xA +#define B_TXT_LINK_PLAYER_MON2_NAME 0xB +#define B_TXT_LINK_OPPONENT_MON2_NAME 0xC +#define B_TXT_ATK_NAME_WITH_PREFIX_MON1 0xD +#define B_TXT_ATK_PARTNER_NAME 0xE +#define B_TXT_ATK_NAME_WITH_PREFIX 0xF +#define B_TXT_DEF_NAME_WITH_PREFIX 0x10 +#define B_TXT_EFF_NAME_WITH_PREFIX 0x11 // EFF = short for gEffectBank +#define B_TXT_ACTIVE_NAME_WITH_PREFIX 0x12 +#define B_TXT_SCR_ACTIVE_NAME_WITH_PREFIX 0x13 +#define B_TXT_CURRENT_MOVE 0x14 +#define B_TXT_LAST_MOVE 0x15 +#define B_TXT_LAST_ITEM 0x16 +#define B_TXT_LAST_ABILITY 0x17 +#define B_TXT_ATK_ABILITY 0x18 +#define B_TXT_DEF_ABILITY 0x19 +#define B_TXT_SCR_ACTIVE_ABILITY 0x1A +#define B_TXT_EFF_ABILITY 0x1B +#define B_TXT_TRAINER1_CLASS 0x1C +#define B_TXT_TRAINER1_NAME 0x1D +#define B_TXT_1E 0x1E // trainer name for a link player +#define B_TXT_1F 0x1F // trainer name for a link player +#define B_TXT_20 0x20 // trainer name for a link player +#define B_TXT_21 0x21 // trainer name for a link player +#define B_TXT_22 0x22 // trainer name for a link player +#define B_TXT_PLAYER_NAME 0x23 +#define B_TXT_TRAINER1_LOSE_TEXT 0x24 +#define B_TXT_TRAINER1_WIN_TEXT 0x25 +#define B_TXT_26 0x26 +#define B_TXT_PC_CREATOR_NAME 0x27 +#define B_TXT_ATK_PREFIX1 0x28 +#define B_TXT_DEF_PREFIX1 0x29 +#define B_TXT_ATK_PREFIX2 0x2A +#define B_TXT_DEF_PREFIX2 0x2B +#define B_TXT_ATK_PREFIX3 0x2C +#define B_TXT_DEF_PREFIX3 0x2D +#define B_TXT_TRAINER2_CLASS 0x2E +#define B_TXT_TRAINER2_NAME 0x2F +#define B_TXT_TRAINER2_LOSE_TEXT 0x30 +#define B_TXT_TRAINER2_WIN_TEXT 0x31 +#define B_TXT_PARTNER_CLASS 0x32 +#define B_TXT_PARTNER_NAME 0x33 +#define B_TXT_BUFF3 0x34 // for B_TXT_BUFF1, B_TXT_BUFF2 and B_TXT_BUFF3 @@ -205,12 +205,22 @@ void BufferStringBattle(u16 stringID); u32 BattleStringExpandPlaceholdersToDisplayedString(const u8* src); u32 BattleStringExpandPlaceholders(const u8* src, u8* dst); void sub_814F9EC(const u8* text, u8 arg1); +void SetPpNumbersPaletteInMoveSelection(void); +u8 GetCurrentPpToMaxPpState(u8 currentPp, u8 maxPp); -extern u8 gBattleTextBuff1[]; -extern u8 gBattleTextBuff2[]; -extern u8 gBattleTextBuff3[]; -extern u8 gDisplayedStringBattle[]; +#define TEXT_BUFF_ARRAY_COUNT 16 +extern u8 gDisplayedStringBattle[300]; +extern u8 gBattleTextBuff1[TEXT_BUFF_ARRAY_COUNT]; +extern u8 gBattleTextBuff2[TEXT_BUFF_ARRAY_COUNT]; +extern u8 gBattleTextBuff3[TEXT_BUFF_ARRAY_COUNT]; + +extern const u8* const gStatNamesTable[]; +extern const u8* const gPokeblockWasTooXStringTable[]; extern const u8* const gRefereeStringsTable[]; +extern const u8* const gStatNamesTable2[]; + +extern const u16 gMissStringIds[]; +extern const u16 gTrappingMoves[]; #endif // GUARD_BATTLE_MESSAGE_H diff --git a/include/battle_script_commands.h b/include/battle_script_commands.h index ae0d20f28..590944f02 100644 --- a/include/battle_script_commands.h +++ b/include/battle_script_commands.h @@ -43,7 +43,7 @@ void AI_CalcDmg(u8 bankAtk, u8 bankDef); u8 TypeCalc(u16 move, u8 bankAtk, u8 bankDef); -u8 AI_TypeCalc(u16 move, u16 species, u8 ability); +u8 AI_TypeCalc(u16 move, u16 targetSpecies, u8 targetAbility); u8 BankGetTurnOrder(u8 bank); void SetMoveEffect(bool8 primary, u8 certain); void BattleDestroyCursorAt(u8 cursorPosition); diff --git a/include/battle_setup.h b/include/battle_setup.h index 80fb55da2..e4acd8601 100644 --- a/include/battle_setup.h +++ b/include/battle_setup.h @@ -1,6 +1,15 @@ #ifndef GUARD_BATTLE_SETUP_H #define GUARD_BATTLE_SETUP_H +void BattleSetup_StartScriptedWildBattle(void); u8 BattleSetup_GetTerrainId(void); +u8 *BattleSetup_ConfigureTrainerBattle(const u8 *data); + +u8 HasTrainerAlreadyBeenFought(u16); +void trainer_flag_set(u16); +void trainer_flag_clear(u16); +void BattleSetup_StartTrainerBattle(void); +u8 *BattleSetup_GetScriptAddrAfterBattle(void); +u8 *BattleSetup_GetTrainerPostBattleScript(void); #endif // GUARD_BATTLE_SETUP_H diff --git a/include/battle_string_ids.h b/include/battle_string_ids.h new file mode 100644 index 000000000..f242284b0 --- /dev/null +++ b/include/battle_string_ids.h @@ -0,0 +1,387 @@ +#ifndef GUARD_BATTLE_STRING_IDS_H +#define GUARD_BATTLE_STRING_IDS_H + +#define BATTLESTRINGS_COUNT 369 + +#define BATTLESTRINGS_ID_ADDER 12 // all battlestrings have its ID + 12, because first 5 are reserved + +#define STRINGID_INTROMSG 0 +#define STRINGID_INTROSENDOUT 1 +#define STRINGID_RETURNMON 2 +#define STRINGID_SWITCHINMON 3 +#define STRINGID_USEDMOVE 4 +#define STRINGID_BATTLEEND 5 + + +// todo: make some of those names less vague: attacker/target vs pkmn, etc. +#define STRINGID_TRAINER1LOSETEXT 12 +#define STRINGID_PKMNGAINEDEXP 13 +#define STRINGID_PKMNGREWTOLV 14 +#define STRINGID_PKMNLEARNEDMOVE 15 +#define STRINGID_TRYTOLEARNMOVE1 16 +#define STRINGID_TRYTOLEARNMOVE2 17 +#define STRINGID_TRYTOLEARNMOVE3 18 +#define STRINGID_PKMNFORGOTMOVE 19 +#define STRINGID_STOPLEARNINGMOVE 20 +#define STRINGID_DIDNOTLEARNMOVE 21 +#define STRINGID_PKMNLEARNEDMOVE2 22 +#define STRINGID_ATTACKMISSED 23 +#define STRINGID_PKMNPROTECTEDITSELF 24 +#define STRINGID_STATSWONTINCREASE2 25 +#define STRINGID_AVOIDEDDAMAGE 26 +#define STRINGID_ITDOESNTAFFECT 27 +#define STRINGID_ATTACKERFAINTED 28 +#define STRINGID_TARGETFAINTED 29 +#define STRINGID_PLAYERGOTMONEY 30 +#define STRINGID_PLAYERWHITEOUT 31 +#define STRINGID_PLAYERWHITEOUT2 32 +#define STRINGID_PREVENTSESCAPE 33 +#define STRINGID_HITXTIMES 34 +#define STRINGID_PKMNFELLASLEEP 35 +#define STRINGID_PKMNMADESLEEP 36 +#define STRINGID_PKMNALREADYASLEEP 37 +#define STRINGID_PKMNALREADYASLEEP2 38 +#define STRINGID_PKMNWASNTAFFECTED 39 +#define STRINGID_PKMNWASPOISONED 40 +#define STRINGID_PKMNPOISONEDBY 41 +#define STRINGID_PKMNHURTBYPOISON 42 +#define STRINGID_PKMNALREADYPOISONED 43 +#define STRINGID_PKMNBADLYPOISONED 44 +#define STRINGID_PKMNENERGYDRAINED 45 +#define STRINGID_PKMNWASBURNED 46 +#define STRINGID_PKMNBURNEDBY 47 +#define STRINGID_PKMNHURTBYBURN 48 +#define STRINGID_PKMNWASFROZEN 49 +#define STRINGID_PKMNFROZENBY 50 +#define STRINGID_PKMNISFROZEN 51 +#define STRINGID_PKMNWASDEFROSTED 52 +#define STRINGID_PKMNWASDEFROSTED2 53 +#define STRINGID_PKMNWASDEFROSTEDBY 54 +#define STRINGID_PKMNWASPARALYZED 55 +#define STRINGID_PKMNWASPARALYZEDBY 56 +#define STRINGID_PKMNISPARALYZED 57 +#define STRINGID_PKMNISALREADYPARALYZED 58 +#define STRINGID_PKMNHEALEDPARALYSIS 59 +#define STRINGID_PKMNDREAMEATEN 60 +#define STRINGID_STATSWONTINCREASE 61 +#define STRINGID_STATSWONTDECREASE 62 +#define STRINGID_TEAMSTOPPEDWORKING 63 +#define STRINGID_FOESTOPPEDWORKING 64 +#define STRINGID_PKMNISCONFUSED 65 +#define STRINGID_PKMNHEALEDCONFUSION 66 +#define STRINGID_PKMNWASCONFUSED 67 +#define STRINGID_PKMNALREADYCONFUSED 68 +#define STRINGID_PKMNFELLINLOVE 69 +#define STRINGID_PKMNINLOVE 70 +#define STRINGID_PKMNIMMOBILIZEDBYLOVE 71 +#define STRINGID_PKMNBLOWNAWAY 72 +#define STRINGID_PKMNCHANGEDTYPE 73 +#define STRINGID_PKMNFLINCHED 74 +#define STRINGID_PKMNREGAINEDHEALTH 75 +#define STRINGID_PKMNHPFULL 76 +#define STRINGID_PKMNRAISEDSPDEF 77 +#define STRINGID_PKMNRAISEDDEF 78 +#define STRINGID_PKMNCOVEREDBYVEIL 79 +#define STRINGID_PKMNUSEDSAFEGUARD 80 +#define STRINGID_PKMNSAFEGUARDEXPIRED 81 +#define STRINGID_PKMNWENTTOSLEEP 82 +#define STRINGID_PKMNSLEPTHEALTHY 83 +#define STRINGID_PKMNWHIPPEDWHIRLWIND 84 +#define STRINGID_PKMNTOOKSUNLIGHT 85 +#define STRINGID_PKMNLOWEREDHEAD 86 +#define STRINGID_PKMNISGLOWING 87 +#define STRINGID_PKMNFLEWHIGH 88 +#define STRINGID_PKMNDUGHOLE 89 +#define STRINGID_PKMNSQUEEZEDBYBIND 90 +#define STRINGID_PKMNTRAPPEDINVORTEX 91 +#define STRINGID_PKMNWRAPPEDBY 92 +#define STRINGID_PKMNCLAMPED 93 +#define STRINGID_PKMNHURTBY 94 +#define STRINGID_PKMNFREEDFROM 95 +#define STRINGID_PKMNCRASHED 96 +#define STRINGID_PKMNSHROUDEDINMIST 97 +#define STRINGID_PKMNPROTECTEDBYMIST 98 +#define STRINGID_PKMNGETTINGPUMPED 99 +#define STRINGID_PKMNHITWITHRECOIL 100 +#define STRINGID_PKMNPROTECTEDITSELF2 101 +#define STRINGID_PKMNBUFFETEDBYSANDSTORM 102 +#define STRINGID_PKMNPELTEDBYHAIL 103 +#define STRINGID_PKMNSEEDED 104 +#define STRINGID_PKMNEVADEDATTACK 105 +#define STRINGID_PKMNSAPPEDBYLEECHSEED 106 +#define STRINGID_PKMNFASTASLEEP 107 +#define STRINGID_PKMNWOKEUP 108 +#define STRINGID_PKMNUPROARKEPTAWAKE 109 +#define STRINGID_PKMNWOKEUPINUPROAR 110 +#define STRINGID_PKMNCAUSEDUPROAR 111 +#define STRINGID_PKMNMAKINGUPROAR 112 +#define STRINGID_PKMNCALMEDDOWN 113 +#define STRINGID_PKMNCANTSLEEPINUPROAR 114 +#define STRINGID_PKMNSTOCKPILED 115 +#define STRINGID_PKMNCANTSTOCKPILE 116 +#define STRINGID_PKMNCANTSLEEPINUPROAR2 117 +#define STRINGID_UPROARKEPTPKMNAWAKE 118 +#define STRINGID_PKMNSTAYEDAWAKEUSING 119 +#define STRINGID_PKMNSTORINGENERGY 120 +#define STRINGID_PKMNUNLEASHEDENERGY 121 +#define STRINGID_PKMNFATIGUECONFUSION 122 +#define STRINGID_PKMNPICKEDUPITEM 123 +#define STRINGID_PKMNUNAFFECTED 124 +#define STRINGID_PKMNTRANSFORMEDINTO 125 +#define STRINGID_PKMNMADESUBSTITUTE 126 +#define STRINGID_PKMNHASSUBSTITUTE 127 +#define STRINGID_SUBSTITUTEDAMAGED 128 +#define STRINGID_PKMNSUBSTITUTEFADED 129 +#define STRINGID_PKMNMUSTRECHARGE 130 +#define STRINGID_PKMNRAGEBUILDING 131 +#define STRINGID_PKMNMOVEWASDISABLED 132 +#define STRINGID_PKMNMOVEISDISABLED 133 +#define STRINGID_PKMNMOVEDISABLEDNOMORE 134 +#define STRINGID_PKMNGOTENCORE 135 +#define STRINGID_PKMNENCOREENDED 136 +#define STRINGID_PKMNTOOKAIM 137 +#define STRINGID_PKMNSKETCHEDMOVE 138 +#define STRINGID_PKMNTRYINGTOTAKEFOE 139 +#define STRINGID_PKMNTOOKFOE 140 +#define STRINGID_PKMNREDUCEDPP 141 +#define STRINGID_PKMNSTOLEITEM 142 +#define STRINGID_TARGETCANTESCAPENOW 143 +#define STRINGID_PKMNFELLINTONIGHTMARE 144 +#define STRINGID_PKMNLOCKEDINNIGHTMARE 145 +#define STRINGID_PKMNLAIDCURSE 146 +#define STRINGID_PKMNAFFLICTEDBYCURSE 147 +#define STRINGID_SPIKESSCATTERED 148 +#define STRINGID_PKMNHURTBYSPIKES 149 +#define STRINGID_PKMNIDENTIFIED 150 +#define STRINGID_PKMNPERISHCOUNTFELL 151 +#define STRINGID_PKMNBRACEDITSELF 152 +#define STRINGID_PKMNENDUREDHIT 153 +#define STRINGID_MAGNITUDESTRENGTH 154 +#define STRINGID_PKMNCUTHPMAXEDATTACK 155 +#define STRINGID_PKMNCOPIEDSTATCHANGES 156 +#define STRINGID_PKMNGOTFREE 157 +#define STRINGID_PKMNSHEDLEECHSEED 158 +#define STRINGID_PKMNBLEWAWAYSPIKES 159 +#define STRINGID_PKMNFLEDFROMBATTLE 160 +#define STRINGID_PKMNFORESAWATTACK 161 +#define STRINGID_PKMNTOOKATTACK 162 +#define STRINGID_PKMNATTACK 163 +#define STRINGID_PKMNCENTERATTENTION 164 +#define STRINGID_PKMNCHARGINGPOWER 165 +#define STRINGID_NATUREPOWERTURNEDINTO 166 +#define STRINGID_PKMNSTATUSNORMAL 167 +#define STRINGID_PKMNHASNOMOVESLEFT 168 +#define STRINGID_PKMNSUBJECTEDTOTORMENT 169 +#define STRINGID_PKMNCANTUSEMOVETORMENT 170 +#define STRINGID_PKMNTIGHTENINGFOCUS 171 +#define STRINGID_PKMNFELLFORTAUNT 172 +#define STRINGID_PKMNCANTUSEMOVETAUNT 173 +#define STRINGID_PKMNREADYTOHELP 174 +#define STRINGID_PKMNSWITCHEDITEMS 175 +#define STRINGID_PKMNCOPIEDFOE 176 +#define STRINGID_PKMNMADEWISH 177 +#define STRINGID_PKMNWISHCAMETRUE 178 +#define STRINGID_PKMNPLANTEDROOTS 179 +#define STRINGID_PKMNABSORBEDNUTRIENTS 180 +#define STRINGID_PKMNANCHOREDITSELF 181 +#define STRINGID_PKMNWASMADEDROWSY 182 +#define STRINGID_PKMNKNOCKEDOFF 183 +#define STRINGID_PKMNSWAPPEDABILITIES 184 +#define STRINGID_PKMNSEALEDOPPONENTMOVE 185 +#define STRINGID_PKMNCANTUSEMOVESEALED 186 +#define STRINGID_PKMNWANTSGRUDGE 187 +#define STRINGID_PKMNLOSTPPGRUDGE 188 +#define STRINGID_PKMNSHROUDEDITSELF 189 +#define STRINGID_PKMNMOVEBOUNCED 190 +#define STRINGID_PKMNWAITSFORTARGET 191 +#define STRINGID_PKMNSNATCHEDMOVE 192 +#define STRINGID_PKMNMADEITRAIN 193 +#define STRINGID_PKMNRAISEDSPEED 194 +#define STRINGID_PKMNPROTECTEDBY 195 +#define STRINGID_PKMNPREVENTSUSAGE 196 +#define STRINGID_PKMNRESTOREDHPUSING 197 +#define STRINGID_PKMNCHANGEDTYPEWITH 198 +#define STRINGID_PKMNPREVENTSPARALYSISWITH 199 +#define STRINGID_PKMNPREVENTSROMANCEWITH 200 +#define STRINGID_PKMNPREVENTSPOISONINGWITH 201 +#define STRINGID_PKMNPREVENTSCONFUSIONWITH 202 +#define STRINGID_PKMNRAISEDFIREPOWERWITH 203 +#define STRINGID_PKMNANCHORSITSELFWITH 204 +#define STRINGID_PKMNCUTSATTACKWITH 205 +#define STRINGID_PKMNPREVENTSSTATLOSSWITH 206 +#define STRINGID_PKMNHURTSWITH 207 +#define STRINGID_PKMNTRACED 208 +#define STRINGID_STATSHARPLY 209 +#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_CRITICALHIT 217 +#define STRINGID_ONEHITKO 218 +#define STRINGID_123POOF 219 +#define STRINGID_ANDELLIPSIS 220 +#define STRINGID_NOTVERYEFFECTIVE 221 +#define STRINGID_SUPEREFFECTIVE 222 +#define STRINGID_GOTAWAYSAFELY 223 +#define STRINGID_WILDPKMNFLED 224 +#define STRINGID_NORUNNINGFROMTRAINERS 225 +#define STRINGID_CANTESCAPE 226 +#define STRINGID_DONTLEAVEBIRCH 227 +#define STRINGID_BUTNOTHINGHAPPENED 228 +#define STRINGID_BUTITFAILED 229 +#define STRINGID_ITHURTCONFUSION 230 +#define STRINGID_MIRRORMOVEFAILED 231 +#define STRINGID_STARTEDTORAIN 232 +#define STRINGID_DOWNPOURSTARTED 233 +#define STRINGID_RAINCONTINUES 234 +#define STRINGID_DOWNPOURCONTINUES 235 +#define STRINGID_RAINSTOPPED 236 +#define STRINGID_SANDSTORMBREWED 237 +#define STRINGID_SANDSTORMRAGES 238 +#define STRINGID_SANDSTORMSUBSIDED 239 +#define STRINGID_SUNLIGHTGOTBRIGHT 240 +#define STRINGID_SUNLIGHTSTRONG 241 +#define STRINGID_SUNLIGHTFADED 242 +#define STRINGID_STARTEDHAIL 243 +#define STRINGID_HAILCONTINUES 244 +#define STRINGID_HAILSTOPPED 245 +#define STRINGID_FAILEDTOSPITUP 246 +#define STRINGID_FAILEDTOSWALLOW 247 +#define STRINGID_WINDBECAMEHEATWAVE 248 +#define STRINGID_STATCHANGESGONE 249 +#define STRINGID_COINSSCATTERED 250 +#define STRINGID_TOOWEAKFORSUBSTITUTE 251 +#define STRINGID_SHAREDPAIN 252 +#define STRINGID_BELLCHIMED 253 +#define STRINGID_FAINTINTHREE 254 +#define STRINGID_NOPPLEFT 255 +#define STRINGID_BUTNOPPLEFT 256 +#define STRINGID_PLAYERUSEDITEM 257 +#define STRINGID_WALLYUSEDITEM 258 +#define STRINGID_TRAINERBLOCKEDBALL 259 +#define STRINGID_DONTBEATHIEF 260 +#define STRINGID_ITDODGEDBALL 261 +#define STRINGID_YOUMISSEDPKMN 262 +#define STRINGID_PKMNBROKEFREE 263 +#define STRINGID_ITAPPEAREDCAUGHT 264 +#define STRINGID_AARGHALMOSTHADIT 265 +#define STRINGID_SHOOTSOCLOSE 266 +#define STRINGID_GOTCHAPKMNCAUGHT 267 +#define STRINGID_GOTCHAPKMNCAUGHT2 268 +#define STRINGID_GIVENICKNAMECAPTURED 269 +#define STRINGID_PKMNSENTTOPC 270 +#define STRINGID_PKMNDATAADDEDTODEX 271 +#define STRINGID_ITISRAINING 272 +#define STRINGID_SANDSTORMISRAGING 273 +#define STRINGID_CANTESCAPE2 274 +#define STRINGID_PKMNIGNORESASLEEP 275 +#define STRINGID_PKMNIGNOREDORDERS 276 +#define STRINGID_PKMNBEGANTONAP 277 +#define STRINGID_PKMNLOAFING 278 +#define STRINGID_PKMNWONTOBEY 279 +#define STRINGID_PKMNTURNEDAWAY 280 +#define STRINGID_PKMNPRETENDNOTNOTICE 281 +#define STRINGID_ENEMYABOUTTOSWITCHPKMN 282 +#define STRINGID_CREPTCLOSER 283 +#define STRINGID_CANTGETCLOSER 284 +#define STRINGID_PKMNWATCHINGCAREFULLY 285 +#define STRINGID_PKMNCURIOUSABOUTX 286 +#define STRINGID_PKMNENTHRALLEDBYX 287 +#define STRINGID_PKMNIGNOREDX 288 +#define STRINGID_THREWPOKEBLOCKATPKMN 289 +#define STRINGID_OUTOFSAFARIBALLS 290 +#define STRINGID_PKMNSITEMCUREDPARALYSIS 291 +#define STRINGID_PKMNSITEMCUREDPOISON 292 +#define STRINGID_PKMNSITEMHEALEDBURN 293 +#define STRINGID_PKMNSITEMDEFROSTEDIT 294 +#define STRINGID_PKMNSITEMWOKEIT 295 +#define STRINGID_PKMNSITEMSNAPPEDOUT 296 +#define STRINGID_PKMNSITEMCUREDPROBLEM 297 +#define STRINGID_PKMNSITEMRESTOREDHEALTH 298 +#define STRINGID_PKMNSITEMRESTOREDPP 299 +#define STRINGID_PKMNSITEMRESTOREDSTATUS 300 +#define STRINGID_PKMNSITEMRESTOREDHPALITTLE 301 +#define STRINGID_ITEMALLOWSONLYYMOVE 302 +#define STRINGID_PKMNHUNGONWITHX 303 +#define STRINGID_EMPTYSTRING3 304 +#define STRINGID_PKMNSXPREVENTSBURNS 305 +#define STRINGID_PKMNSXBLOCKSY 306 +#define STRINGID_PKMNSXRESTOREDHPALITTLE2 307 +#define STRINGID_PKMNSXWHIPPEDUPSANDSTORM 308 +#define STRINGID_PKMNSXPREVENTSYLOSS 309 +#define STRINGID_PKMNSXINFATUATEDY 310 +#define STRINGID_PKMNSXMADEYINEFFECTIVE 311 +#define STRINGID_PKMNSXCUREDYPROBLEM 312 +#define STRINGID_ITSUCKEDLIQUIDOOZE 313 +#define STRINGID_PKMNTRANSFORMED 314 +#define STRINGID_ELECTRICITYWEAKENED 315 +#define STRINGID_FIREWEAKENED 316 +#define STRINGID_PKMNHIDUNDERWATER 317 +#define STRINGID_PKMNSPRANGUP 318 +#define STRINGID_HMMOVESCANTBEFORGOTTEN 319 +#define STRINGID_XFOUNDONEY 320 +#define STRINGID_PLAYERDEFEATEDTRAINER1 321 +#define STRINGID_SOOTHINGAROMA 322 +#define STRINGID_ITEMSCANTBEUSEDNOW 323 +#define STRINGID_FORXCOMMAYZ 324 +#define STRINGID_USINGXTHEYOFZN 325 +#define STRINGID_PKMNUSEDXTOGETPUMPED 326 +#define STRINGID_PKMNSXMADEYUSELESS 327 +#define STRINGID_PKMNTRAPPEDBYSANDTOMB 328 +#define STRINGID_EMPTYSTRING4 329 +#define STRINGID_ABOOSTED 330 +#define STRINGID_PKMNSXINTENSIFIEDSUN 331 +#define STRINGID_PKMNMAKESGROUNDMISS 332 +#define STRINGID_YOUTHROWABALLNOWRIGHT 333 +#define STRINGID_PKMNSXTOOKATTACK 334 +#define STRINGID_PKMNCHOSEXASDESTINY 335 +#define STRINGID_PKMNLOSTFOCUS 336 +#define STRINGID_USENEXTPKMN 337 +#define STRINGID_PKMNFLEDUSINGITS 338 +#define STRINGID_PKMNFLEDUSING 339 +#define STRINGID_PKMNWASDRAGGEDOUT 340 +#define STRINGID_PREVENTEDFROMWORKING 341 +#define STRINGID_PKMNSITEMNORMALIZEDSTATUS 342 +#define STRINGID_TRAINER1USEDITEM 343 +#define STRINGID_BOXISFULL 344 +#define STRINGID_PKMNAVOIDEDATTACK 345 +#define STRINGID_PKMNSXMADEITINEFFECTIVE 346 +#define STRINGID_PKMNSXPREVENTSFLINCHING 347 +#define STRINGID_PKMNALREADYHASBURN 348 +#define STRINGID_STATSWONTDECREASE2 349 +#define STRINGID_PKMNSXBLOCKSY2 350 +#define STRINGID_PKMNSXWOREOFF 351 +#define STRINGID_PKMNRAISEDDEFALITTLE 352 +#define STRINGID_PKMNRAISEDSPDEFALITTLE 353 +#define STRINGID_THEWALLSHATTERED 354 +#define STRINGID_PKMNSXPREVENTSYSZ 355 +#define STRINGID_PKMNSXCUREDITSYPROBLEM 356 +#define STRINGID_ATTACKERCANTESCAPE 357 +#define STRINGID_PKMNOBTAINEDX 358 +#define STRINGID_PKMNOBTAINEDX2 359 +#define STRINGID_PKMNOBTAINEDXYOBTAINEDZ 360 +#define STRINGID_BUTNOEFFECT 361 +#define STRINGID_PKMNSXHADNOEFFECTONY 362 +#define STRINGID_TWOENEMIESDEFEATED 363 +#define STRINGID_TRAINER2LOSETEXT 364 +#define STRINGID_PKMNINCAPABLEOFPOWER 365 +#define STRINGID_GLINTAPPEARSINEYE 366 +#define STRINGID_PKMNGETTINGINTOPOSITION 367 +#define STRINGID_PKMNBEGANGROWLINGDEEPLY 368 +#define STRINGID_PKMNEAGERFORMORE 369 +#define STRINGID_DEFEATEDOPPONENTBYREFEREE 370 +#define STRINGID_LOSTTOOPPONENTBYREFEREE 371 +#define STRINGID_TIEDOPPONENTBYREFEREE 372 +#define STRINGID_QUESTIONFORFEITMATCH 373 +#define STRINGID_FORFEITEDMATCH 374 +#define STRINGID_PKMNTRANSFERREDSOMEONESPC 375 +#define STRINGID_PKMNTRANSFERREDLANETTESPC 376 +#define STRINGID_PKMNBOXSOMEONESPCFULL 377 +#define STRINGID_PKMNBOXLANETTESPCFULL 378 +#define STRINGID_TRAINER1WINTEXT 379 +#define STRINGID_TRAINER2WINTEXT 380 + +#endif // GUARD_BATTLE_STRING_IDS_H diff --git a/include/battle_tower.h b/include/battle_tower.h new file mode 100644 index 000000000..25b439c1b --- /dev/null +++ b/include/battle_tower.h @@ -0,0 +1,6 @@ +#ifndef GUARD_BATTLE_TOWER_H +#define GUARD_BATTLE_TOWER_H + +u16 sub_8164FCC(u8, u8); + +#endif //GUARD_BATTLE_TOWER_H diff --git a/include/bg.h b/include/bg.h index 0dcb84a34..0c6b4ac26 100644 --- a/include/bg.h +++ b/include/bg.h @@ -1,6 +1,16 @@ #ifndef GUARD_BG_H #define GUARD_BG_H +struct BGCntrlBitfield // for the I/O registers +{ + volatile u16 priority:2; + volatile u16 charBaseBlock:2; + volatile u16 field_0_2:4; + volatile u16 field_1_0:5; + volatile u16 areaOverflowMode:1; + volatile u16 screenSize:2; +}; + enum { BG_CTRL_ATTR_VISIBLE = 1, diff --git a/include/clock.h b/include/clock.h new file mode 100644 index 000000000..4e6560c91 --- /dev/null +++ b/include/clock.h @@ -0,0 +1,8 @@ +#ifndef GUARD_CLOCK_H +#define GUARD_CLOCK_H + +// TODO: time of day and seconds in a day defines + +void DoTimeBasedEvents(void); + +#endif diff --git a/include/coins.h b/include/coins.h index 43434b227..996519605 100644 --- a/include/coins.h +++ b/include/coins.h @@ -6,7 +6,7 @@ void ShowCoinsWindow(u32 coinAmount, u8 x, u8 y); void HideCoinsWindow(void); u16 GetCoins(void); void SetCoins(u16 coinAmount); -bool8 AddCoins(u16 toAdd); -bool8 SubtractCoins(u16 toSub); +bool8 GiveCoins(u16 toAdd); +bool8 TakeCoins(u16 toSub); #endif // GUARD_COINS_H diff --git a/include/contest.h b/include/contest.h new file mode 100644 index 000000000..5c473bd2c --- /dev/null +++ b/include/contest.h @@ -0,0 +1,18 @@ +#ifndef GUARD_CONTEST_H +#define GUARD_CONTEST_H + +struct ContestStruct_02039E00 { + u16 unk_00; + u8 unk_02[11]; + u8 unk_0d[8]; + u8 filler_15[9]; + u8 filler_1E[34]; +}; + +extern struct ContestStruct_02039E00 gUnknown_02039E00[4]; +extern u8 gUnknown_02039F24; +extern EWRAM_DATA u16 gScriptContestCategory; +extern EWRAM_DATA u8 gUnknown_02039F2E; +extern EWRAM_DATA u8 gUnknown_02039F30; + +#endif //GUARD_CONTEST_H diff --git a/include/contest_link_80F57C4.h b/include/contest_link_80F57C4.h new file mode 100644 index 000000000..98523c175 --- /dev/null +++ b/include/contest_link_80F57C4.h @@ -0,0 +1,8 @@ +#ifndef GUARD_CONTEST_LINK_80F57C4_H +#define GUARD_CONTEST_LINK_80F57C4_H + +void sub_80F840C(void); +void sub_80F8484(void); +void sub_80F84C4(u8); + +#endif // GUARD_CONTEST_LINK_80F57C4_H diff --git a/include/contest_painting.h b/include/contest_painting.h new file mode 100644 index 000000000..f8366a997 --- /dev/null +++ b/include/contest_painting.h @@ -0,0 +1,6 @@ +#ifndef GUARD_CONTESTPAINTING_H +#define GUARD_CONTESTPAINTING_H + +void sub_812FDA8(u32); + +#endif diff --git a/include/data2.h b/include/data2.h new file mode 100644 index 000000000..db9532811 --- /dev/null +++ b/include/data2.h @@ -0,0 +1,19 @@ +#ifndef GUARD_DATA2_H +#define GUARD_DATA2_H + +struct MonCoords +{ + // This would use a bitfield, but some function + // uses it as a u8 and casting won't match. + u8 coords; // u8 x:4, y:4; + u8 y_offset; +}; + +extern struct MonCoords gTrainerBackPicCoords[]; + +extern const u8 gSpeciesNames[][POKEMON_NAME_LENGTH + 1]; +extern const u8 gMoveNames[][13]; +extern const u8 gAbilityNames[][13]; +extern const u8 gTypeNames[][7]; + +#endif // GUARD_DATA2_H diff --git a/include/decoration.h b/include/decoration.h new file mode 100644 index 000000000..bbb77d127 --- /dev/null +++ b/include/decoration.h @@ -0,0 +1,142 @@ +#ifndef GUARD_DECORATION_H +#define GUARD_DECORATION_H + +enum DecoId { + /*000*/ DECOR_NONE, + /*001*/ DECOR_SMALL_DESK, + /*002*/ DECOR_POKEMON_DESK, + /*003*/ DECOR_HEAVY_DESK, + /*004*/ DECOR_RAGGED_DESK, + /*005*/ DECOR_COMFORT_DESK, + /*006*/ DECOR_PRETTY_DESK, + /*007*/ DECOR_BRICK_DESK, + /*008*/ DECOR_CAMP_DESK, + /*009*/ DECOR_HARD_DESK, + /*010*/ DECOR_SMALL_CHAIR, + /*011*/ DECOR_POKEMON_CHAIR, + /*012*/ DECOR_HEAVY_CHAIR, + /*013*/ DECOR_PRETTY_CHAIR, + /*014*/ DECOR_COMFORT_CHAIR, + /*015*/ DECOR_RAGGED_CHAIR, + /*016*/ DECOR_BRICK_CHAIR, + /*017*/ DECOR_CAMP_CHAIR, + /*018*/ DECOR_HARD_CHAIR, + /*019*/ DECOR_RED_PLANT, + /*020*/ DECOR_TROPICAL_PLANT, + /*021*/ DECOR_PRETTY_FLOWERS, + /*022*/ DECOR_COLORFUL_PLANT, + /*023*/ DECOR_BIG_PLANT, + /*024*/ DECOR_GORGEOUS_PLANT, + /*025*/ DECOR_RED_BRICK, + /*026*/ DECOR_YELLOW_BRICK, + /*027*/ DECOR_BLUE_BRICK, + /*028*/ DECOR_RED_BALLOON, + /*029*/ DECOR_BLUE_BALLOON, + /*030*/ DECOR_YELLOW_BALLOON, + /*031*/ DECOR_RED_TENT, + /*032*/ DECOR_BLUE_TENT, + /*033*/ DECOR_SOLID_BOARD, + /*034*/ DECOR_SLIDE, + /*035*/ DECOR_FENCE_LENGTH, + /*036*/ DECOR_FENCE_WIDTH, + /*037*/ DECOR_TIRE, + /*038*/ DECOR_STAND, + /*039*/ DECOR_MUD_BALL, + /*040*/ DECOR_BREAKABLE_DOOR, + /*041*/ DECOR_SAND_ORNAMENT, + /*042*/ DECOR_SILVER_SHIELD, + /*043*/ DECOR_GOLD_SHIELD, + /*044*/ DECOR_GLASS_ORNAMENT, + /*045*/ DECOR_TV, + /*046*/ DECOR_ROUND_TV, + /*047*/ DECOR_CUTE_TV, + /*048*/ DECOR_GLITTER_MAT, + /*049*/ DECOR_JUMP_MAT, + /*050*/ DECOR_SPIN_MAT, + /*051*/ DECOR_C_LOW_NOTE_MAT, + /*052*/ DECOR_D_NOTE_MAT, + /*053*/ DECOR_E_NOTE_MAT, + /*054*/ DECOR_F_NOTE_MAT, + /*055*/ DECOR_G_NOTE_MAT, + /*056*/ DECOR_A_NOTE_MAT, + /*057*/ DECOR_B_NOTE_MAT, + /*058*/ DECOR_C_HIGH_NOTE_MAT, + /*059*/ DECOR_SURF_MAT, + /*060*/ DECOR_THUNDER_MAT, + /*061*/ DECOR_FIRE_BLAST_MAT, + /*062*/ DECOR_POWDER_SNOW_MAT, + /*063*/ DECOR_ATTRACT_MAT, + /*064*/ DECOR_FISSURE_MAT, + /*065*/ DECOR_SPIKES_MAT, + /*066*/ DECOR_BALL_POSTER, + /*067*/ DECOR_GREEN_POSTER, + /*068*/ DECOR_RED_POSTER, + /*069*/ DECOR_BLUE_POSTER, + /*070*/ DECOR_CUTE_POSTER, + /*071*/ DECOR_PIKA_POSTER, + /*072*/ DECOR_LONG_POSTER, + /*073*/ DECOR_SEA_POSTER, + /*074*/ DECOR_SKY_POSTER, + /*075*/ DECOR_KISS_POSTER, + /*076*/ DECOR_PICHU_DOLL, + /*077*/ DECOR_PIKACHU_DOLL, + /*078*/ DECOR_MARILL_DOLL, + /*079*/ DECOR_TOGEPI_DOLL, + /*080*/ DECOR_CYNDAQUIL_DOLL, + /*081*/ DECOR_CHIKORITA_DOLL, + /*082*/ DECOR_TOTODILE_DOLL, + /*083*/ DECOR_JIGGLYPUFF_DOLL, + /*084*/ DECOR_MEOWTH_DOLL, + /*085*/ DECOR_CLEFAIRY_DOLL, + /*086*/ DECOR_DITTO_DOLL, + /*087*/ DECOR_SMOOCHUM_DOLL, + /*088*/ DECOR_TREECKO_DOLL, + /*089*/ DECOR_TORCHIC_DOLL, + /*090*/ DECOR_MUDKIP_DOLL, + /*091*/ DECOR_DUSKULL_DOLL, + /*092*/ DECOR_WYNAUT_DOLL, + /*093*/ DECOR_BALTOY_DOLL, + /*094*/ DECOR_KECLEON_DOLL, + /*095*/ DECOR_AZURILL_DOLL, + /*096*/ DECOR_SKITTY_DOLL, + /*097*/ DECOR_SWABLU_DOLL, + /*098*/ DECOR_GULPIN_DOLL, + /*099*/ DECOR_LOTAD_DOLL, + /*100*/ DECOR_SEEDOT_DOLL, + /*101*/ DECOR_PIKA_CUSHION, + /*102*/ DECOR_ROUND_CUSHION, + /*103*/ DECOR_KISS_CUSHION, + /*104*/ DECOR_ZIGZAG_CUSHION, + /*105*/ DECOR_SPIN_CUSHION, + /*106*/ DECOR_DIAMOND_CUSHION, + /*107*/ DECOR_BALL_CUSHION, + /*108*/ DECOR_GRASS_CUSHION, + /*109*/ DECOR_FIRE_CUSHION, + /*110*/ DECOR_WATER_CUSHION, + /*111*/ DECOR_SNORLAX_DOLL, + /*112*/ DECOR_RHYDON_DOLL, + /*113*/ DECOR_LAPRAS_DOLL, + /*114*/ DECOR_VENUSAUR_DOLL, + /*115*/ DECOR_CHARIZARD_DOLL, + /*116*/ DECOR_BLASTOISE_DOLL, + /*117*/ DECOR_WAILMER_DOLL, + /*118*/ DECOR_REGIROCK_DOLL, + /*119*/ DECOR_REGICE_DOLL, + /*120*/ DECOR_REGISTEEL_DOLL +}; + +struct Decoration +{ + /*0x00*/ u8 id; + /*0x01*/ u8 name[16]; + /*0x11*/ u8 permission; + /*0x12*/ u8 shape; + /*0x13*/ u8 category; + /*0x14*/ u16 price; + /*0x18*/ const u8 *description; + /*0x1c*/ const u16 *tiles; +}; + +extern const struct Decoration gDecorations[]; + +#endif //GUARD_DECORATION_H diff --git a/include/decoration_inventory.h b/include/decoration_inventory.h new file mode 100644 index 000000000..5ca345933 --- /dev/null +++ b/include/decoration_inventory.h @@ -0,0 +1,10 @@ +#ifndef GUARD_DECORATION_INVENTORY_H +#define GUARD_DECORATION_INVENTORY_H + +void ClearDecorationInventories(void); +u8 CheckHasDecoration(u8); +u8 DecorationAdd(u8); +u8 DecorationCheckSpace(u8); +s8 DecorationRemove(u8); + +#endif // GUARD_DECORATION_INVENTORY_H diff --git a/include/diploma.h b/include/diploma.h new file mode 100644 index 000000000..8d730fa05 --- /dev/null +++ b/include/diploma.h @@ -0,0 +1,6 @@ +#ifndef GUARD_DIPLOMA_H +#define GUARD_DIPLOMA_H + +void CB2_ShowDiploma(void); + +#endif // GUARD_DIPLOMA_H diff --git a/include/easy_chat.h b/include/easy_chat.h index fc44b6a8a..b0a217320 100644 --- a/include/easy_chat.h +++ b/include/easy_chat.h @@ -30,7 +30,9 @@ enum void InitEasyChatPhrases(void); void easy_chat_input_maybe(void); -void CopyEasyChatWord(u8 *, u16); -bool32 sub_811F8D8(u16); +void CopyEasyChatWord(u8 *dest, u16 word); +bool32 sub_811F8D8(u16 word); +void InitializeEasyChatWordArray(u16 *words, u16 length); +void ConvertEasyChatWordsToString(u8 *dest, const u16 *src, u16 length1, u16 length2); #endif // GUARD_EASYCHAT_H diff --git a/include/event_data.h b/include/event_data.h index a2a501283..0bd11fdcd 100644 --- a/include/event_data.h +++ b/include/event_data.h @@ -27,7 +27,7 @@ bool8 VarSet(u16 id, u16 value); u8 VarGetFieldObjectGraphicsId(u8 id); u8 *GetFlagPointer(u16 id); u8 FlagSet(u16 id); -u8 FlagReset(u16 id); +u8 FlagClear(u16 id); bool8 FlagGet(u16 id); extern u16 gSpecialVar_0x8000; diff --git a/include/event_scripts.h b/include/event_scripts.h index f1abdd6f6..bb0d6731b 100755 --- a/include/event_scripts.h +++ b/include/event_scripts.h @@ -8,4 +8,353 @@ extern const u8 gUnknown_082766A2[]; extern const u8 gUnknown_082766A6[]; +extern const u8 gTVBravoTrainerText00[]; +extern const u8 gTVBravoTrainerText01[]; +extern const u8 gTVBravoTrainerText02[]; +extern const u8 gTVBravoTrainerText03[]; +extern const u8 gTVBravoTrainerText04[]; +extern const u8 gTVBravoTrainerText05[]; +extern const u8 gTVBravoTrainerText06[]; +extern const u8 gTVBravoTrainerText07[]; +extern const u8 gTVBravoTrainerText08[]; +extern const u8 gTVBravoTrainerBattleTowerText00[]; +extern const u8 gTVBravoTrainerBattleTowerText01[]; +extern const u8 gTVBravoTrainerBattleTowerText02[]; +extern const u8 gTVBravoTrainerBattleTowerText03[]; +extern const u8 gTVBravoTrainerBattleTowerText04[]; +extern const u8 gTVBravoTrainerBattleTowerText05[]; +extern const u8 gTVBravoTrainerBattleTowerText06[]; +extern const u8 gTVBravoTrainerBattleTowerText07[]; +extern const u8 gTVBravoTrainerBattleTowerText08[]; +extern const u8 gTVBravoTrainerBattleTowerText09[]; +extern const u8 gTVBravoTrainerBattleTowerText10[]; +extern const u8 gTVBravoTrainerBattleTowerText11[]; +extern const u8 gTVBravoTrainerBattleTowerText12[]; +extern const u8 gTVBravoTrainerBattleTowerText13[]; +extern const u8 gTVBravoTrainerBattleTowerText14[]; +extern const u8 gTVFanClubOpinionsText00[]; +extern const u8 gTVFanClubOpinionsText01[]; +extern const u8 gTVFanClubOpinionsText02[]; +extern const u8 gTVFanClubOpinionsText03[]; +extern const u8 gTVFanClubOpinionsText04[]; +extern const u8 gTVFanClubText00[]; +extern const u8 gTVFanClubText01[]; +extern const u8 gTVFanClubText02[]; +extern const u8 gTVFanClubText03[]; +extern const u8 gTVFanClubText04[]; +extern const u8 gTVFanClubText05[]; +extern const u8 gTVFanClubText06[]; +extern const u8 gTVFanClubText07[]; +extern const u8 gTVRecentHappeningsText00[]; +extern const u8 gTVRecentHappeningsText01[]; +extern const u8 gTVRecentHappeningsText02[]; +extern const u8 gTVRecentHappeningsText03[]; +extern const u8 gTVRecentHappeningsText04[]; +extern const u8 gTVRecentHappeningsText05[]; +extern const u8 gTVMassOutbreakText00[]; +extern const u8 gTV3CheersForPokeblocksText00[]; +extern const u8 gTV3CheersForPokeblocksText01[]; +extern const u8 gTV3CheersForPokeblocksText02[]; +extern const u8 gTV3CheersForPokeblocksText03[]; +extern const u8 gTV3CheersForPokeblocksText04[]; +extern const u8 gTV3CheersForPokeblocksText05[]; +extern const u8 gTVTrainerFanClubSpecialText00[]; +extern const u8 gTVTrainerFanClubSpecialText01[]; +extern const u8 gTVTrainerFanClubSpecialText02[]; +extern const u8 gTVTrainerFanClubSpecialText03[]; +extern const u8 gTVTrainerFanClubSpecialText04[]; +extern const u8 gTVTrainerFanClubSpecialText05[]; +extern const u8 gTVNameRaterText00[]; +extern const u8 gTVNameRaterText01[]; +extern const u8 gTVNameRaterText02[]; +extern const u8 gTVNameRaterText03[]; +extern const u8 gTVNameRaterText04[]; +extern const u8 gTVNameRaterText05[]; +extern const u8 gTVNameRaterText06[]; +extern const u8 gTVNameRaterText07[]; +extern const u8 gTVNameRaterText08[]; +extern const u8 gTVNameRaterText09[]; +extern const u8 gTVNameRaterText10[]; +extern const u8 gTVNameRaterText11[]; +extern const u8 gTVNameRaterText12[]; +extern const u8 gTVNameRaterText13[]; +extern const u8 gTVNameRaterText14[]; +extern const u8 gTVNameRaterText15[]; +extern const u8 gTVNameRaterText16[]; +extern const u8 gTVNameRaterText17[]; +extern const u8 gTVNameRaterText18[]; +extern const u8 gTVPokemonAnglerText00[]; +extern const u8 gTVPokemonAnglerText01[]; +extern const u8 gTVPokemonTodayFailedText00[]; +extern const u8 gTVPokemonTodayFailedText01[]; +extern const u8 gTVPokemonTodayFailedText02[]; +extern const u8 gTVPokemonTodayFailedText03[]; +extern const u8 gTVPokemonTodayFailedText04[]; +extern const u8 gTVPokemonTodayFailedText05[]; +extern const u8 gTVPokemonTodayFailedText06[]; +extern const u8 gTVPokemonTodaySuccessfulText00[]; +extern const u8 gTVPokemonTodaySuccessfulText01[]; +extern const u8 gTVPokemonTodaySuccessfulText02[]; +extern const u8 gTVPokemonTodaySuccessfulText03[]; +extern const u8 gTVPokemonTodaySuccessfulText04[]; +extern const u8 gTVPokemonTodaySuccessfulText05[]; +extern const u8 gTVPokemonTodaySuccessfulText06[]; +extern const u8 gTVPokemonTodaySuccessfulText07[]; +extern const u8 gTVPokemonTodaySuccessfulText08[]; +extern const u8 gTVPokemonTodaySuccessfulText09[]; +extern const u8 gTVPokemonTodaySuccessfulText10[]; +extern const u8 gTVPokemonTodaySuccessfulText11[]; +extern const u8 gTVTodaysSmartShopperText00[]; +extern const u8 gTVTodaysSmartShopperText01[]; +extern const u8 gTVTodaysSmartShopperText02[]; +extern const u8 gTVTodaysSmartShopperText03[]; +extern const u8 gTVTodaysSmartShopperText04[]; +extern const u8 gTVTodaysSmartShopperText05[]; +extern const u8 gTVTodaysSmartShopperText06[]; +extern const u8 gTVTodaysSmartShopperText07[]; +extern const u8 gTVTodaysSmartShopperText08[]; +extern const u8 gTVTodaysSmartShopperText09[]; +extern const u8 gTVTodaysSmartShopperText10[]; +extern const u8 gTVTodaysSmartShopperText11[]; +extern const u8 gTVTodaysSmartShopperText12[]; +extern const u8 gTVWorldOfMastersText00[]; +extern const u8 gTVWorldOfMastersText01[]; +extern const u8 gTVWorldOfMastersText02[]; +extern const u8 gTVTodaysRivalTrainerText00[]; +extern const u8 gTVTodaysRivalTrainerText07[]; +extern const u8 gTVTodaysRivalTrainerText08[]; +extern const u8 gTVTodaysRivalTrainerText09[]; +extern const u8 gTVTodaysRivalTrainerText10[]; +extern const u8 gTVTodaysRivalTrainerText01[]; +extern const u8 gTVTodaysRivalTrainerText02[]; +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 gTVHoennTreasureInvestigatorsText00[]; +extern const u8 gTVHoennTreasureInvestigatorsText01[]; +extern const u8 gTVHoennTreasureInvestigatorsText02[]; +extern const u8 gTVFindThatGamerText00[]; +extern const u8 gTVFindThatGamerText01[]; +extern const u8 gTVFindThatGamerText02[]; +extern const u8 gTVFindThatGamerText03[]; +extern const u8 gTVBreakingNewsText00[]; +extern const u8 gTVBreakingNewsText01[]; +extern const u8 gTVBreakingNewsText02[]; +extern const u8 gTVBreakingNewsText03[]; +extern const u8 gTVBreakingNewsText04[]; +extern const u8 gTVBreakingNewsText05[]; +extern const u8 gTVBreakingNewsText06[]; +extern const u8 gTVBreakingNewsText07[]; +extern const u8 gTVBreakingNewsText12[]; +extern const u8 gTVBreakingNewsText08[]; +extern const u8 gTVBreakingNewsText09[]; +extern const u8 gTVBreakingNewsText10[]; +extern const u8 gTVBreakingNewsText11[]; +extern const u8 gTVSecretBaseVisitText00[]; +extern const u8 gTVSecretBaseVisitText01[]; +extern const u8 gTVSecretBaseVisitText02[]; +extern const u8 gTVSecretBaseVisitText03[]; +extern const u8 gTVSecretBaseVisitText04[]; +extern const u8 gTVSecretBaseVisitText05[]; +extern const u8 gTVSecretBaseVisitText06[]; +extern const u8 gTVSecretBaseVisitText07[]; +extern const u8 gTVSecretBaseVisitText08[]; +extern const u8 gTVSecretBaseVisitText09[]; +extern const u8 gTVSecretBaseVisitText10[]; +extern const u8 gTVSecretBaseVisitText11[]; +extern const u8 gTVSecretBaseVisitText12[]; +extern const u8 gTVSecretBaseVisitText13[]; +extern const u8 gTVPokemonLotteryWinnerFlashReportText00[]; +extern const u8 gTVThePokemonBattleSeminarText00[]; +extern const u8 gTVThePokemonBattleSeminarText01[]; +extern const u8 gTVThePokemonBattleSeminarText02[]; +extern const u8 gTVThePokemonBattleSeminarText03[]; +extern const u8 gTVThePokemonBattleSeminarText04[]; +extern const u8 gTVThePokemonBattleSeminarText05[]; +extern const u8 gTVThePokemonBattleSeminarText06[]; +extern const u8 gTVTrainerFanClubText00[]; +extern const u8 gTVTrainerFanClubText01[]; +extern const u8 gTVTrainerFanClubText02[]; +extern const u8 gTVTrainerFanClubText03[]; +extern const u8 gTVTrainerFanClubText04[]; +extern const u8 gTVTrainerFanClubText05[]; +extern const u8 gTVTrainerFanClubText06[]; +extern const u8 gTVTrainerFanClubText07[]; +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 gTVPokemonNewsBattleFrontierText00[]; +extern const u8 gTVPokemonNewsBattleFrontierText01[]; +extern const u8 gTVPokemonNewsBattleFrontierText02[]; +extern const u8 gTVPokemonNewsBattleFrontierText03[]; +extern const u8 gTVPokemonNewsBattleFrontierText04[]; +extern const u8 gTVPokemonNewsBattleFrontierText05[]; +extern const u8 gTVPokemonNewsBattleFrontierText06[]; +extern const u8 gTVPokemonNewsBattleFrontierText07[]; +extern const u8 gTVPokemonNewsBattleFrontierText08[]; +extern const u8 gTVPokemonNewsBattleFrontierText09[]; +extern const u8 gTVPokemonNewsBattleFrontierText10[]; +extern const u8 gTVPokemonNewsBattleFrontierText11[]; +extern const u8 gTVPokemonNewsBattleFrontierText12[]; +extern const u8 gTVPokemonNewsBattleFrontierText13[]; +extern const u8 gTVPokemonNewsBattleFrontierText14[]; +extern const u8 gTVPokemonNewsBattleFrontierText15[]; +extern const u8 gTVPokemonNewsBattleFrontierText16[]; +extern const u8 gTVPokemonNewsBattleFrontierText17[]; +extern const u8 gTVPokemonNewsBattleFrontierText18[]; +extern const u8 gTVWhatsNo1InHoennTodayText00[]; +extern const u8 gTVWhatsNo1InHoennTodayText01[]; +extern const u8 gTVWhatsNo1InHoennTodayText02[]; +extern const u8 gTVWhatsNo1InHoennTodayText03[]; +extern const u8 gTVWhatsNo1InHoennTodayText04[]; +extern const u8 gTVWhatsNo1InHoennTodayText05[]; +extern const u8 gTVWhatsNo1InHoennTodayText06[]; +extern const u8 gTVWhatsNo1InHoennTodayText07[]; +extern const u8 gTVWhatsNo1InHoennTodayText08[]; +extern const u8 gTVSecretBaseSecretsText00[]; +extern const u8 gTVSecretBaseSecretsText01[]; +extern const u8 gTVSecretBaseSecretsText02[]; +extern const u8 gTVSecretBaseSecretsText03[]; +extern const u8 gTVSecretBaseSecretsText04[]; +extern const u8 gTVSecretBaseSecretsText05[]; +extern const u8 gTVSecretBaseSecretsText06[]; +extern const u8 gTVSecretBaseSecretsText07[]; +extern const u8 gTVSecretBaseSecretsText08[]; +extern const u8 gTVSecretBaseSecretsText09[]; +extern const u8 gTVSecretBaseSecretsText10[]; +extern const u8 gTVSecretBaseSecretsText11[]; +extern const u8 gTVSecretBaseSecretsText12[]; +extern const u8 gTVSecretBaseSecretsText13[]; +extern const u8 gTVSecretBaseSecretsText14[]; +extern const u8 gTVSecretBaseSecretsText15[]; +extern const u8 gTVSecretBaseSecretsText16[]; +extern const u8 gTVSecretBaseSecretsText17[]; +extern const u8 gTVSecretBaseSecretsText18[]; +extern const u8 gTVSecretBaseSecretsText19[]; +extern const u8 gTVSecretBaseSecretsText20[]; +extern const u8 gTVSecretBaseSecretsText21[]; +extern const u8 gTVSecretBaseSecretsText22[]; +extern const u8 gTVSecretBaseSecretsText23[]; +extern const u8 gTVSecretBaseSecretsText24[]; +extern const u8 gTVSecretBaseSecretsText25[]; +extern const u8 gTVSecretBaseSecretsText26[]; +extern const u8 gTVSecretBaseSecretsText27[]; +extern const u8 gTVSecretBaseSecretsText28[]; +extern const u8 gTVSecretBaseSecretsText29[]; +extern const u8 gTVSecretBaseSecretsText30[]; +extern const u8 gTVSecretBaseSecretsText31[]; +extern const u8 gTVSecretBaseSecretsText32[]; +extern const u8 gTVSecretBaseSecretsText33[]; +extern const u8 gTVSecretBaseSecretsText34[]; +extern const u8 gTVSecretBaseSecretsText35[]; +extern const u8 gTVSecretBaseSecretsText36[]; +extern const u8 gTVSecretBaseSecretsText37[]; +extern const u8 gTVSecretBaseSecretsText38[]; +extern const u8 gTVSecretBaseSecretsText39[]; +extern const u8 gTVSecretBaseSecretsText40[]; +extern const u8 gTVSecretBaseSecretsText41[]; +extern const u8 gTVSecretBaseSecretsText42[]; +extern const u8 gTVSafariFanClubText00[]; +extern const u8 gTVSafariFanClubText01[]; +extern const u8 gTVSafariFanClubText02[]; +extern const u8 gTVSafariFanClubText03[]; +extern const u8 gTVSafariFanClubText04[]; +extern const u8 gTVSafariFanClubText05[]; +extern const u8 gTVSafariFanClubText06[]; +extern const u8 gTVSafariFanClubText07[]; +extern const u8 gTVSafariFanClubText08[]; +extern const u8 gTVSafariFanClubText09[]; +extern const u8 gTVSafariFanClubText10[]; +extern const u8 gTVContestLiveUpdatesText00[]; +extern const u8 gTVContestLiveUpdatesText01[]; +extern const u8 gTVContestLiveUpdatesText02[]; +extern const u8 gTVContestLiveUpdatesText03[]; +extern const u8 gTVContestLiveUpdatesText04[]; +extern const u8 gTVContestLiveUpdatesText05[]; +extern const u8 gTVContestLiveUpdatesText06[]; +extern const u8 gTVContestLiveUpdatesText07[]; +extern const u8 gTVContestLiveUpdatesText08[]; +extern const u8 gTVContestLiveUpdatesText09[]; +extern const u8 gTVContestLiveUpdatesText10[]; +extern const u8 gTVContestLiveUpdatesText11[]; +extern const u8 gTVContestLiveUpdatesText12[]; +extern const u8 gTVContestLiveUpdatesText13[]; +extern const u8 gTVContestLiveUpdatesText14[]; +extern const u8 gTVContestLiveUpdatesText15[]; +extern const u8 gTVContestLiveUpdatesText16[]; +extern const u8 gTVContestLiveUpdatesText17[]; +extern const u8 gTVContestLiveUpdatesText18[]; +extern const u8 gTVContestLiveUpdatesText19[]; +extern const u8 gTVContestLiveUpdatesText20[]; +extern const u8 gTVContestLiveUpdatesText21[]; +extern const u8 gTVContestLiveUpdatesText22[]; +extern const u8 gTVContestLiveUpdatesText23[]; +extern const u8 gTVContestLiveUpdatesText24[]; +extern const u8 gTVContestLiveUpdatesText25[]; +extern const u8 gTVContestLiveUpdatesText26[]; +extern const u8 gTVContestLiveUpdatesText27[]; +extern const u8 gTVContestLiveUpdatesText28[]; +extern const u8 gTVContestLiveUpdatesText29[]; +extern const u8 gTVContestLiveUpdatesText30[]; +extern const u8 gTVContestLiveUpdatesText31[]; +extern const u8 gTVContestLiveUpdatesText32[]; +extern const u8 gTVPokemonBattleUpdateText00[]; +extern const u8 gTVPokemonBattleUpdateText01[]; +extern const u8 gTVPokemonBattleUpdateText02[]; +extern const u8 gTVPokemonBattleUpdateText03[]; +extern const u8 gTVPokemonBattleUpdateText04[]; +extern const u8 gTVPokemonBattleUpdateText05[]; +extern const u8 gTVPokemonBattleUpdateText06[]; +extern const u8 gTVPokemonBattleUpdateText07[]; +extern const u8 gTVInSearchOfTrainersText00[]; +extern const u8 gTVInSearchOfTrainersText01[]; +extern const u8 gTVInSearchOfTrainersText02[]; +extern const u8 gTVInSearchOfTrainersText03[]; +extern const u8 gTVInSearchOfTrainersText04[]; +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 gPokeNewsTextSlateport_Upcoming[]; +extern const u8 gPokeNewsTextSlateport_Ongoing[]; +extern const u8 gPokeNewsTextSlateport_Ending[]; +extern const u8 gPokeNewsTextGameCorner_Upcoming[]; +extern const u8 gPokeNewsTextGameCorner_Ongoing[]; +extern const u8 gPokeNewsTextGameCorner_Ending[]; +extern const u8 gPokeNewsTextLilycove_Upcoming[]; +extern const u8 gPokeNewsTextLilycove_Ongoing[]; +extern const u8 gPokeNewsTextLilycove_Ending[]; +extern const u8 gPokeNewsTextBlendMaster_Upcoming[]; +extern const u8 gPokeNewsTextBlendMaster_Ongoing[]; +extern const u8 gPokeNewsTextBlendMaster_Ending[]; + #endif //GUARD_EVENT_SCRIPTS_H diff --git a/include/field_camera.h b/include/field_camera.h index 9fbaac6a2..f74fadd86 100644 --- a/include/field_camera.h +++ b/include/field_camera.h @@ -22,4 +22,6 @@ extern u16 gUnknown_03005DE8; // Exported ROM declarations +void DrawWholeMapView(void); + #endif //GUARD_FIELD_CAMERA_H diff --git a/include/field_door.h b/include/field_door.h new file mode 100644 index 000000000..f1dfc551d --- /dev/null +++ b/include/field_door.h @@ -0,0 +1,11 @@ +#ifndef GUARD_FIELDDOOR_H +#define GUARD_FIELDDOOR_H + +void FieldSetDoorOpened(u32, u32); +void FieldSetDoorClosed(u32, u32); +s8 FieldAnimateDoorClose(u32, u32); +s8 FieldAnimateDoorOpen(u32, u32); +bool8 FieldIsDoorAnimationRunning(void); +u32 GetDoorSoundEffect(u32 x, u32 y); + +#endif diff --git a/include/field_effect.h b/include/field_effect.h index 7ec26b3d7..aa3f7eba0 100644 --- a/include/field_effect.h +++ b/include/field_effect.h @@ -1,7 +1,3 @@ -// -// Created by Scott Norton on 9/15/17. -// - #ifndef GUARD_FIELD_EFFECTS_H #define GUARD_FIELD_EFFECTS_H @@ -73,8 +69,9 @@ enum FieldEffectScriptIdx FLDEFF_USE_TELEPORT }; -extern u32 gFieldEffectSpawnParams[8]; - u8 FieldEffectStart(u8); +bool8 FieldEffectActiveListContains(u8 id); + +extern u32 gFieldEffectArguments[8]; #endif //GUARD_FIELD_EFFECTS_H diff --git a/include/field_fadetransition.h b/include/field_fadetransition.h new file mode 100644 index 000000000..7c2d16a24 --- /dev/null +++ b/include/field_fadetransition.h @@ -0,0 +1,12 @@ +#ifndef GUARD_FIELD_FADETRANSITION_H +#define GUARD_FIELD_FADETRANSITION_H + +void sub_80AF734(void); +void sp13E_warp_to_last_warp(void); +void sub_80AF7D0(void); +void sp13F_fall_to_last_warp(void); + +void sub_80AF848(void); +void sub_80AF87C(void); + +#endif // GUARD_FIELD_FADETRANSITION_H diff --git a/include/field_map_obj.h b/include/field_map_obj.h index 40cc64054..b18b6cfd3 100755 --- a/include/field_map_obj.h +++ b/include/field_map_obj.h @@ -33,6 +33,7 @@ u8 sub_808D4F4(void); void RemoveFieldObjectByLocalIdAndMap(u8, u8, u8); void npc_load_two_palettes__no_record(u16, u8); void npc_load_two_palettes__and_record(u16, u8); +void sub_808EBA8(u8, u8, u8, s16, s16); void pal_patch_for_npc(u16, u8); void sub_808E16C(s16, s16); void sub_8092FF0(s16, s16, s16 *, s16 *); @@ -63,6 +64,7 @@ void npc_coords_shift(struct MapObject *, s16, s16); void sub_808EB08(struct MapObject *, s16, s16); void sub_808F254(u8, u8, u8); void FieldObjectStep(struct MapObject *, struct Sprite *, bool8(struct MapObject *, struct Sprite *)); +u8 FieldObjectFaceOppositeDirection(struct MapObject *, u8); u8 GetOppositeDirection(u8); u8 GetStepInPlaceDelay4AnimId(u32); u8 GetStepInPlaceDelay8AnimId(u32); @@ -71,6 +73,7 @@ u8 GetStepInPlaceDelay32AnimId(u32); u8 npc_block_way(struct MapObject *, s16, s16, u32); void MoveCoords(u8, s16 *, s16 *); bool8 FieldObjectIsSpecialAnimActive(struct MapObject *); +u8 FieldObjectClearAnimIfSpecialAnimFinished(struct MapObject *); // Exported data declarations diff --git a/include/field_map_obj_helpers.h b/include/field_map_obj_helpers.h new file mode 100644 index 000000000..ba797ec98 --- /dev/null +++ b/include/field_map_obj_helpers.h @@ -0,0 +1,7 @@ +#ifndef GUARD_FIELDMAPOBJHELP_H +#define GUARD_FIELDMAPOBJHELP_H + +void UnfreezeMapObjects(void); +void sub_8097B78(u8, u8); + +#endif diff --git a/include/field_message_box.h b/include/field_message_box.h new file mode 100644 index 000000000..432c9078b --- /dev/null +++ b/include/field_message_box.h @@ -0,0 +1,10 @@ +#ifndef GUARD_FIELD_MESSAGE_BOX_H +#define GUARD_FIELD_MESSAGE_BOX_H + +bool8 ShowFieldMessage(const u8 *message); +bool8 sub_8098238(const u8 *message); +bool8 ShowFieldAutoScrollMessage(const u8 *message); +void HideFieldMessageBox(void); +bool8 IsFieldMessageBoxHidden(void); + +#endif // GUARD_FIELD_MESSAGE_BOX_H diff --git a/include/field_player_avatar.h b/include/field_player_avatar.h index a787cf805..5c16e9414 100644 --- a/include/field_player_avatar.h +++ b/include/field_player_avatar.h @@ -1,7 +1,3 @@ -// -// Created by Scott Norton on 9/6/17. -// - #ifndef GUARD_FIELD_PLAYER_AVATAR_H #define GUARD_FIELD_PLAYER_AVATAR_H @@ -14,4 +10,6 @@ u8 player_get_direction_lower_nybble(void); u8 player_get_direction_upper_nybble(void); u8 player_get_x22(void); +void sub_808D074(u8); + #endif //GUARD_FIELD_PLAYER_AVATAR_H diff --git a/include/field_screen_effect.h b/include/field_screen_effect.h new file mode 100644 index 000000000..ef81c2f9e --- /dev/null +++ b/include/field_screen_effect.h @@ -0,0 +1,8 @@ +#ifndef GUARD_FIELD_SCREEN_EFFECT_H +#define GUARD_FIELD_SCREEN_EFFECT_H + +void sub_80AF79C(void); +void sub_80B009C(u8); +void sub_80B0244(void); + +#endif // GUARD_FIELD_SCREEN_EFFECT_H diff --git a/include/field_specials.h b/include/field_specials.h new file mode 100644 index 000000000..1f8fbf147 --- /dev/null +++ b/include/field_specials.h @@ -0,0 +1,6 @@ +#ifndef GUARD_FIELD_SPECIALS_H +#define GUARD_FIELD_SPECIALS_H + +u8 GetLeadMonIndex(void); + +#endif // GUARD_FIELD_SPECIALS_H diff --git a/include/field_tasks.h b/include/field_tasks.h new file mode 100644 index 000000000..2a2a772d8 --- /dev/null +++ b/include/field_tasks.h @@ -0,0 +1,6 @@ +#ifndef GUARD_FIELD_TASKS_H +#define GUARD_FIELD_TASKS_H + +void ActivatePerStepCallback(u8); + +#endif // GUARD_FIELD_TASKS_H diff --git a/include/field_weather.h b/include/field_weather.h new file mode 100644 index 000000000..e12107e70 --- /dev/null +++ b/include/field_weather.h @@ -0,0 +1,12 @@ +#ifndef GUARD_WEATHER_H +#define GUARD_WEATHER_H + +void fade_screen(u8, s8); + +void SetSav1Weather(u32); +u8 GetSav1Weather(void); +void sub_80AEDBC(void); + +void DoCurrentWeather(void); + +#endif // GUARD_WEATHER_H diff --git a/include/fieldmap.h b/include/fieldmap.h index 7174d98cc..3efc5e36f 100644 --- a/include/fieldmap.h +++ b/include/fieldmap.h @@ -1,16 +1,13 @@ -// -// Created by scott on 9/16/2017. -// - #ifndef GUARD_FIELDMAP_H #define GUARD_FIELDMAP_H -// Exported type declarations - -// Exported RAM declarations +extern struct MapCoords { + int width; + int height; +} gUnknown_03005DC0; -// Exported ROM declarations -u8 MapGridGetMetatileBehaviorAt(s16, s16); +u32 MapGridGetMetatileBehaviorAt(int, int); +void MapGridSetMetatileIdAt(int, int, u16); void GetCameraCoords(u16*, u16*); bool8 MapGridIsImpassableAt(s16, s16); s32 GetMapBorderIdAt(s16, s16); diff --git a/include/flags.h b/include/flags.h index 020fc59cb..7d825feba 100644 --- a/include/flags.h +++ b/include/flags.h @@ -3,7 +3,7 @@ #define TRAINER_FLAG_START 0x500 #define TRAINERS_FLAG_NO 0x356 -#define CODE_FLAGS (TRAINER_FLAG_START + TRAINERS_FLAG_NO + 0xA) +#define CODE_FLAGS (TRAINER_FLAG_START + TRAINERS_FLAG_NO + 0xA) // 0x860 // SYSTEM FLAGS @@ -84,6 +84,20 @@ #define SYS_CTRL_OBJ_DELETE CODE_FLAGS + 0x61 #define SYS_RESET_RTC_ENABLE CODE_FLAGS + 0x62 +#define SYS_TOWER_SILVER CODE_FLAGS + 0x64 +#define SYS_TOWER_GOLD CODE_FLAGS + 0x65 +#define SYS_DOME_SILVER CODE_FLAGS + 0x66 +#define SYS_DOME_GOLD CODE_FLAGS + 0x67 +#define SYS_PALACE_SILVER CODE_FLAGS + 0x68 +#define SYS_PALACE_GOLD CODE_FLAGS + 0x69 +#define SYS_ARENA_SILVER CODE_FLAGS + 0x6A +#define SYS_ARENA_GOLD CODE_FLAGS + 0x6B +#define SYS_FACTORY_SILVER CODE_FLAGS + 0x6C +#define SYS_FACTORY_GOLD CODE_FLAGS + 0x6D +#define SYS_PIKE_SILVER CODE_FLAGS + 0x6E +#define SYS_PIKE_GOLD CODE_FLAGS + 0x6F +#define SYS_PYRAMID_SILVER CODE_FLAGS + 0x70 +#define SYS_PYRAMID_GOLD CODE_FLAGS + 0x71 #define SYS_FRONTIER_PASS CODE_FLAGS + 0x72 #define SYS_STORAGE_UNKNOWN_FLAG CODE_FLAGS + 0x77 diff --git a/include/game_stat.h b/include/game_stat.h index b8a5c3232..5979c531c 100644 --- a/include/game_stat.h +++ b/include/game_stat.h @@ -56,4 +56,7 @@ #define NUM_GAME_STATS 64 +void IncrementGameStat(u8); +u32 GetGameStat(u8); + #endif // GUARD_GAME_STAT_H diff --git a/include/global.h b/include/global.h index e0c09d29a..58a0d79dc 100644 --- a/include/global.h +++ b/include/global.h @@ -197,7 +197,13 @@ struct SaveBlock2 // All below could be a one giant struct - /*0x64C*/ u8 field_64C[1629]; + /*0x64C*/ u8 field_64C[0x588]; + /*0xBD4*/ u16 field_BD4; + /*0xBD6*/ u16 field_BD6; + /*0xBD8*/ u8 field_BD8[11]; + /*0xBE3*/ u8 filler_BE3[8]; + /*0xBEB*/ u8 field_BEB; + /*0xBE3*/ u8 filler_BEC[189]; /*0xCA9*/ u8 frontierChosenLvl : 2; // 0x1, 0x2 -> 0x3 /*0xCA9*/ u8 field_CA9_a : 1; // 0x4 /*0xCA9*/ u8 field_CA9_b : 1; // 0x8 @@ -205,7 +211,10 @@ struct SaveBlock2 /*0xCA9*/ u8 field_CA9_d : 1; // 0x20 /*0xCA9*/ u8 field_CA9_e : 1; // 0x40 /*0xCA9*/ u8 field_CA9_f : 1; // 0x80 - /*0xCAA*/ u8 field_CAA[368]; + /*0xCAA*/ u16 field_CAA[0x2e]; + /*0xD06*/ u8 field_D06; + /*0xD07*/ u8 field_D07; + /*0xd08*/ u8 filler_D08[0x112]; /*0xE1A*/ u16 battlePyramidFloor; // possibly? /*0xE1C*/ u8 field_E1C[16]; /*0xE2C*/ struct PyramidBag pyramidBag; @@ -225,29 +234,31 @@ extern struct SaveBlock2 *gSaveBlock2Ptr; struct SecretBaseRecord { - /*ID?*/ /*0x1A08*/ u8 sbr_field_0; - /*0x1A09*/ u8 sbr_field_1_0:4; - /*0x1A09*/ u8 gender:1; - /*0x1A09*/ u8 sbr_field_1_5:1; - /*0x1A09*/ u8 sbr_field_1_6:2; - /*0x1A0A*/ u8 sbr_field_2[7]; // 0xFF bytes? - /*0x1A12*/ u8 trainerId[4]; // byte 0 is used for determining trainer class - /*0x1A16*/ u16 sbr_field_e; - /*0x1A18*/ u8 sbr_field_10; - /*0x1A19*/ u8 sbr_field_11; - /*0x1A1A*/ u8 decorations[16]; - /*0x1A2A*/ u8 decorationPos[16]; - /*0x1A3A*/ u32 partyPersonality[6]; - /*0x1A54*/ u16 partyMoves[6 * 4]; - /*0x1A84*/ u16 partySpecies[6]; - /*0x1A90*/ u16 partyHeldItems[6]; - /*0x1A9C*/ u8 partyLevels[6]; - /*0x1AA2*/ u8 partyEVs[6]; + /*ID?*/ /*0x1A9C*/ u8 sbr_field_0; + /*0x1A9D*/ u8 sbr_field_1_0:4; + /*0x1A9D*/ u8 gender:1; + /*0x1A9D*/ u8 sbr_field_1_5:1; + /*0x1A9D*/ u8 sbr_field_1_6:2; + /*0x1A9E*/ u8 trainerName[7]; // 0xFF bytes? + /*0x1AA5*/ u8 trainerId[4]; // byte 0 is used for determining trainer class + /*0x1AA9*/ u8 language; + /*0x1AAA*/ u16 sbr_field_e; + /*0x1AAC*/ u8 sbr_field_10; + /*0x1AAD*/ u8 sbr_field_11; + /*0x1AAE*/ u8 decorations[16]; + /*0x1ABE*/ u8 decorationPos[16]; + /*0x1ACE*/ u32 partyPersonality[6]; + /*0x1AE6*/ u16 partyMoves[6 * 4]; + /*0x1B16*/ u16 partySpecies[6]; + /*0x1B22*/ u16 partyHeldItems[6]; + /*0x1B2E*/ u8 partyLevels[6]; + /*0x1B34*/ u8 partyEVs[6]; }; #include "game_stat.h" #include "global.fieldmap.h" #include "global.berry.h" +#include "global.tv.h" #include "pokemon.h" struct WarpData @@ -316,218 +327,6 @@ struct EasyChatPair u16 words[2]; }; /*size = 0x8*/ -struct TVShowCommon -{ - /*0x00*/ u8 var00; - /*0x01*/ u8 var01; - /*0x02*/ u8 pad02[20]; - /*0x16*/ u16 var16[3]; - /*0x1C*/ u8 srcTrainerId3Lo; - /*0x1D*/ u8 srcTrainerId3Hi; - /*0x1E*/ u8 srcTrainerId2Lo; - /*0x1F*/ u8 srcTrainerId2Hi; - /*0x20*/ u8 srcTrainerIdLo; - /*0x21*/ u8 srcTrainerIdHi; - /*0x22*/ u8 trainerIdLo; - /*0x23*/ u8 trainerIdHi; -}; - -struct TVShowFanClubLetter -{ - /*0x00*/ u8 var00; - /*0x01*/ u8 var01; - /*0x02*/ u16 species; - /*0x04*/ u16 pad04[6]; - /*0x10*/ u8 playerName[8]; - /*0x18*/ u8 language; -}; - -struct TVShowRecentHappenings -{ - /*0x00*/ u8 var00; - /*0x01*/ u8 var01; - /*0x02*/ u16 var02; - /*0x04*/ u16 var04[6]; - /*0x10*/ u8 playerName[8]; - /*0x18*/ u8 language; - /*0x19*/ u8 pad19[10]; -}; - -struct TVShowFanclubOpinions -{ - /*0x00*/ u8 var00; - /*0x01*/ u8 var01; - /*0x02*/ u16 var02; - /*0x04*/ u8 var04A:4; - /*0x04*/ u8 var04B:4; - /*0x05*/ u8 playerName[8]; - /*0x0D*/ u8 language; - /*0x0E*/ u8 var0E; - /*0x0F*/ u8 var0F; - /*0x10*/ u8 var10[8]; - /*0x18*/ u16 var18[2]; - /*0x1C*/ u16 var1C[4]; -}; - -struct TVShowUnknownType04 -{ - /*0x00*/ u8 var00; - /*0x01*/ u8 var01; - /*0x02*/ u8 pad02[4]; - /*0x06*/ u16 var06; -}; - -struct TVShowNameRaterShow -{ - /*0x00*/ u8 var00; - /*0x01*/ u8 var01; - /*0x02*/ u16 species; - /*0x04*/ u8 pokemonName[11]; - /*0x0F*/ u8 trainerName[11]; - /*0x1A*/ u8 random; - /*0x1B*/ u8 random2; - /*0x1C*/ u16 var1C; - /*0x1E*/ u8 language; - /*0x1F*/ u8 pokemonNameLanguage; -}; - -struct TVShowBravoTrainerPokemonProfiles -{ - /*0x00*/ u8 var00; - /*0x01*/ u8 var01; - /*0x02*/ u16 species; - /*0x04*/ u16 var04[2]; - /*0x08*/ u8 pokemonNickname[11]; - /*0x13*/ u8 contestCategory:3; - /*0x13*/ u8 contestRank:2; - /*0x13*/ u8 contestResult:2; - /*0x13*/ u8 var13_7:1; - /*0x14*/ u16 var14; - /*0x16*/ u8 playerName[8]; - /*0x1E*/ u8 language; - /*0x1F*/ u8 var1f; -}; - -struct TVShowBravoTrainerBattleTowerSpotlight -{ - /*0x00*/ u8 var00; - /*0x01*/ u8 var01; - /*0x02*/ u8 trainerName[8]; - /*0x0A*/ u16 species; - /*0x0C*/ u8 pokemonName[8]; - /*0x14*/ u16 defeatedSpecies; - /*0x16*/ u16 var16; - /*0x18*/ u16 var18[1]; - /*0x1A*/ u8 btLevel; - /*0x1B*/ u8 var1b; - /*0x1C*/ u8 var1c; - /*0x1D*/ u8 language; -}; - -struct TVShowPokemonToday -{ - /*0x00*/ u8 var00; - /*0x01*/ u8 var01; - /*0x02*/ u8 language; - /*0x03*/ u8 language2; - /*0x04*/ u8 nickname[11]; - /*0x0F*/ u8 ball; - /*0x10*/ u16 species; - /*0x12*/ u8 var12; - /*0x13*/ u8 playerName[8]; -}; - -struct TVShowSmartShopper -{ - /*0x00*/ u8 var00; - /*0x01*/ u8 var01; - /*0x02*/ u8 priceReduced; - /*0x03*/ u8 language; - /*0x04*/ u8 pad04[2]; - /*0x06*/ u16 itemIds[3]; - /*0x0C*/ u16 itemAmounts[3]; - /*0x12*/ u8 shopLocation; - /*0x13*/ u8 playerName[8]; -}; - -struct TVShowPokemonTodayFailed -{ - /*0x00*/ u8 var00; - /*0x01*/ u8 var01; - /*0x02*/ u8 language; - /*0x03*/ u8 pad03[9]; - /*0x0c*/ u16 species; - /*0x0e*/ u16 species2; - /*0x10*/ u8 var10; - /*0x11*/ u8 var11; - /*0x12*/ u8 var12; - /*0x13*/ u8 playerName[8]; -}; - -struct TVShowPokemonAngler -{ - /*0x00*/ u8 var00; - /*0x01*/ u8 var01; - /*0x02*/ u8 var02; - /*0x03*/ u8 var03; - /*0x04*/ u16 var04; - /*0x06*/ u8 language; - u8 pad07[12]; - /*0x13*/ u8 playerName[8]; -}; - -struct TVShowWorldOfMasters -{ - /*0x00*/ u8 var00; - /*0x01*/ u8 var01; - /*0x02*/ u16 var02; - /*0x04*/ u16 var04; - /*0x06*/ u16 var06; - /*0x08*/ u16 var08; - /*0x0a*/ u8 var0a; - /*0x0b*/ u8 language; - u8 pad0c[7]; - /*0x13*/ u8 playerName[8]; -}; - -struct TVShowMassOutbreak -{ - /*0x00*/ u8 var00; - /*0x01*/ u8 var01; - /*0x02*/ u8 var02; - /*0x03*/ u8 var03; - /*0x04*/ u16 moves[4]; - /*0x0C*/ u16 species; - /*0x0E*/ u16 var0E; - /*0x10*/ u8 locationMapNum; - /*0x11*/ u8 locationMapGroup; - /*0x12*/ u8 var12; - /*0x13*/ u8 probability; - /*0x14*/ u8 level; - /*0x15*/ u8 var15; - /*0x16*/ u16 var16; - /*0x18*/ u8 language; - u8 pad19[11]; -}; - -typedef union TVShow -{ - struct TVShowCommon common; - struct TVShowFanClubLetter fanclubLetter; - struct TVShowRecentHappenings recentHappenings; - struct TVShowFanclubOpinions fanclubOpinions; - struct TVShowUnknownType04 unkShow04; - struct TVShowNameRaterShow nameRaterShow; - struct TVShowBravoTrainerPokemonProfiles bravoTrainer; - struct TVShowBravoTrainerBattleTowerSpotlight bravoTrainerTower; - struct TVShowPokemonToday pokemonToday; - struct TVShowSmartShopper smartshopperShow; - struct TVShowPokemonTodayFailed pokemonTodayFailed; - struct TVShowPokemonAngler pokemonAngler; - struct TVShowWorldOfMasters worldOfMasters; - struct TVShowMassOutbreak massOutbreak; -} TVShow; - struct MailStruct { /*0x00*/ u16 words[9]; @@ -575,35 +374,6 @@ typedef union OldMan u8 filler[0x40]; } OldMan; -struct UnknownSaveStruct2ABC -{ - u8 val0; - u8 val1; - u16 val2; -}; - -struct GabbyAndTyData -{ - /*2b10*/ u16 mon1; - /*2b12*/ u16 mon2; - /*2b14*/ u16 lastMove; - /*2b16*/ u16 quote; - /*2b18*/ u8 mapnum; - /*2b19*/ u8 battleNum; - /*2b1a*/ u8 valA_0:1; - /*2b1a*/ u8 valA_1:1; - /*2b1a*/ u8 valA_2:1; - /*2b1a*/ u8 valA_3:1; - /*2b1a*/ u8 valA_4:1; - /*2b1a*/ u8 valA_5:3; - /*2b1b*/ u8 valB_0:1; - /*2b1b*/ u8 valB_1:1; - /*2b1b*/ u8 valB_2:1; - /*2b1b*/ u8 valB_3:1; - /*2b1b*/ u8 valB_4:1; - /*2b1b*/ u8 valB_5:3; -}; - struct RecordMixing_UnknownStructSub { u32 unk0; @@ -780,22 +550,22 @@ struct SaveBlock1 /*0x????*/ u8 decorCushion[10]; /*0x27CA*/ u8 padding_27CA[2]; /*0x27CC*/ TVShow tvShows[25]; - /*0x2B50*/ struct UnknownSaveStruct2ABC pokeNews[16]; + /*0x2B50*/ PokeNews pokeNews[16]; /*0x2B90*/ u16 outbreakPokemonSpecies; - /*0x????*/ u8 outbreakLocationMapNum; - /*0x????*/ u8 outbreakLocationMapGroup; - /*0x????*/ u8 outbreakPokemonLevel; - /*0x????*/ u8 outbreakUnk1; - /*0x????*/ u16 outbreakUnk2; - /*0x????*/ u16 outbreakPokemonMoves[4]; - /*0x????*/ u8 outbreakUnk4; - /*0x????*/ u8 outbreakPokemonProbability; - /*0x????*/ u16 outbreakUnk5; + /*0x2B92*/ u8 outbreakLocationMapNum; + /*0x2B93*/ u8 outbreakLocationMapGroup; + /*0x2B94*/ u8 outbreakPokemonLevel; + /*0x2B95*/ u8 outbreakUnk1; + /*0x2B96*/ u16 outbreakUnk2; + /*0x2B98*/ u16 outbreakPokemonMoves[4]; + /*0x2BA0*/ u8 outbreakUnk4; + /*0x2BA1*/ u8 outbreakPokemonProbability; + /*0x2BA2*/ u16 outbreakDaysLeft; /*0x2BA4*/ struct GabbyAndTyData gabbyAndTyData; - /*0x????*/ u16 unk2B1C[6]; - /*0x????*/ u16 unk2B28[6]; - /*0x????*/ u16 unk2B34[6]; - /*0x????*/ u16 unk2B3A[3]; + /*0x2BB0*/ u16 unk2BB0[6]; + /*0x2BBC*/ u16 unk2BBC[6]; + /*0x2BC8*/ u16 unk2BC8[6]; + /*0x2BD4*/ u16 unk2BD4[3]; /*0x2BE0*/ struct MailStruct mail[16]; /*0x2E20*/ u8 additionalPhrases[5]; // bitfield for 33 additional phrases in easy chat system /*0x2E25*/ u8 unk2E25[3]; // possibly padding? @@ -805,7 +575,8 @@ struct SaveBlock1 /*0x2e90*/ struct ContestWinner contestWinners[13]; // 0 - 5 used in contest hall, 6 - 7 unused?, 8 - 12 museum /*0x3030*/ struct DaycareData daycare; /*0x3150*/ struct LinkBattleRecord linkBattleRecords[5]; - /*0x31A0*/ u8 filler_31A0[8]; + /*0x31A0*/ u8 unk_31A0; + /*0x31A1*/ u8 filler_31A1[7]; /*0x31A8*/ u8 giftRibbons[52]; /*0x31DC*/ struct Roamer roamer; /*0x31F8*/ struct EnigmaBerry enigmaBerry; diff --git a/include/global.tv.h b/include/global.tv.h new file mode 100644 index 000000000..5f65aa8e0 --- /dev/null +++ b/include/global.tv.h @@ -0,0 +1,535 @@ +#ifndef GUARD_GLOBAL_TV_H +#define GUARD_GLOBAL_TV_H + +enum +{ + TVSHOW_OFF_AIR, + + TVSHOW_FAN_CLUB_LETTER = 1, + TVSHOW_RECENT_HAPPENINGS, + TVSHOW_PKMN_FAN_CLUB_OPINIONS, + TVSHOW_UNKN_SHOWTYPE_04, + TVSHOW_NAME_RATER_SHOW, + TVSHOW_BRAVO_TRAINER_POKEMON_PROFILE, + TVSHOW_BRAVO_TRAINER_BATTLE_TOWER_PROFILE, + TVSHOW_CONTEST_LIVE_UPDATES, + TVSHOW_3_CHEERS_FOR_POKEBLOCKS, + TVSHOW_BATTLE_UPDATE, + TVSHOW_FAN_CLUB_SPECIAL, + TVSHOW_CONTEST_LIVE_UPDATES_2, + + TVSHOW_POKEMON_TODAY_CAUGHT = 21, + TVSHOW_SMART_SHOPPER, + TVSHOW_POKEMON_TODAY_FAILED, + TVSHOW_FISHING_ADVICE, + TVSHOW_WORLD_OF_MASTERS, + TVSHOW_TODAYS_RIVAL_TRAINER, + TVSHOW_TREND_WATCHER, + TVSHOW_TREASURE_INVESTIGATORS, + TVSHOW_FIND_THAT_GAMER, + TVSHOW_BREAKING_NEWS, + TVSHOW_SECRET_BASE_VISIT, + TVSHOW_LOTTO_WINNER, + TVSHOW_BATTLE_SEMINAR, + TVSHOW_TRAINER_FAN_CLUB, + TVSHOW_CUTIES, + TVSHOW_FRONTIER, + TVSHOW_NUMBER_ONE, + TVSHOW_SECRET_BASE_SECRETS, + TVSHOW_SAFARI_FAN_CLUB, + + TVSHOW_MASS_OUTBREAK = 41, +}; + +typedef union // size = 0x24 +{ + // Common + struct { + /*0x00*/ u8 kind; + /*0x01*/ bool8 active; + /*0x02*/ u8 pad02[26]; + /*0x1C*/ u8 srcTrainerId3Lo; + /*0x1D*/ u8 srcTrainerId3Hi; + /*0x1E*/ u8 srcTrainerId2Lo; + /*0x1F*/ u8 srcTrainerId2Hi; + /*0x20*/ u8 srcTrainerIdLo; + /*0x21*/ u8 srcTrainerIdHi; + /*0x22*/ u8 trainerIdLo; + /*0x23*/ u8 trainerIdHi; + } common; + + // Local shows + // TVSHOW_FAN_CLUB_LETTER + struct { + /*0x00*/ u8 kind; + /*0x01*/ bool8 active; + /*0x02*/ u16 species; + /*0x04*/ u16 words[6]; + /*0x10*/ u8 playerName[8]; + /*0x18*/ u8 language; + } fanclubLetter; + + // TVSHOW_RECENT_HAPPENINGS + struct { + /*0x00*/ u8 kind; + /*0x01*/ bool8 active; + /*0x02*/ u16 var02; + /*0x04*/ u16 words[6]; + /*0x10*/ u8 playerName[8]; + /*0x18*/ u8 language; + } recentHappenings; + + // TVSHOW_PKMN_FAN_CLUB_OPINIONS + struct { + /*0x00*/ u8 kind; + /*0x01*/ bool8 active; + /*0x02*/ u16 species; + /*0x04*/ u8 friendshipHighNybble:4; + /*0x04*/ u8 questionAsked:4; + /*0x05*/ u8 playerName[8]; + /*0x0D*/ u8 language; + /*0x0E*/ u8 pokemonNameLanguage; + /*0x0F*/ u8 filler_0F[1]; + /*0x10*/ u8 nickname[8]; + /*0x18*/ u8 filler_18[4]; + /*0x1C*/ u16 words[4]; + } fanclubOpinions; + + // TVSHOW_UNKN_SHOWTYPE_04 (dummied out) + struct { + /*0x00*/ u8 kind; + /*0x01*/ bool8 active; + /*0x02*/ u8 pad02[4]; + /*0x06*/ u16 var06; + /*0x08*/ u8 pad_08[3]; + /*0x0b*/ u8 string_0b[12]; + /*0x17*/ u8 language; + } unkShow04; + + // TVSHOW_NAME_RATER_SHOW + struct { + /*0x00*/ u8 kind; + /*0x01*/ bool8 active; + /*0x02*/ u16 species; + /*0x04*/ u8 pokemonName[11]; + /*0x0F*/ u8 trainerName[11]; + /*0x1A*/ u8 random; + /*0x1B*/ u8 random2; + /*0x1C*/ u16 randomSpecies; + /*0x1E*/ u8 language; + /*0x1F*/ u8 pokemonNameLanguage; + } nameRaterShow; + + // TVSHOW_BRAVO_TRAINER_POKEMON_PROFILE (contest) + struct { + /*0x00*/ u8 kind; + /*0x01*/ bool8 active; + /*0x02*/ u16 species; + /*0x04*/ u16 words[2]; + /*0x08*/ u8 pokemonNickname[11]; + /*0x13*/ u8 contestCategory:3; + /*0x13*/ u8 contestRank:2; + /*0x13*/ u8 contestResult:2; + /*0x14*/ u16 move; + /*0x16*/ u8 playerName[8]; + /*0x1E*/ u8 language; + /*0x1F*/ u8 pokemonNameLanguage; + } bravoTrainer; + + // TVSHOW_BRAVO_TRAINER_BATTLE_TOWER_PROFILE + struct { + /*0x00*/ u8 kind; + /*0x01*/ bool8 active; + /*0x02*/ u8 trainerName[8]; + /*0x0A*/ u16 species; + /*0x0C*/ u8 pokemonName[8]; + /*0x14*/ u16 defeatedSpecies; + /*0x16*/ u16 numFights; + /*0x18*/ u16 words[1]; + /*0x1A*/ u8 btLevel; + /*0x1B*/ u8 interviewResponse; + /*0x1C*/ bool8 wonTheChallenge; + /*0x1D*/ u8 language; + /*0x1E*/ u8 pokemonNameLanguage; + } bravoTrainerTower; + + // TVSHOW_CONTEST_LIVE_UPDATES + struct { + /*0x00*/ u8 kind; + /*0x01*/ bool8 active; + /*0x02*/ u16 winningSpecies; + /*0x04*/ u8 winningTrainerName[8]; + /*0x0C*/ u8 appealFlags2; + /*0x0D*/ u8 round1Rank; + /*0x0e*/ u8 round2Rank; + /*0x0f*/ u8 appealFlags1; + /*0x10*/ u16 move; + /*0x12*/ u16 species; + /*0x14*/ u8 playerName[8]; + /*0x1C*/ u8 category; + /*0x1D*/ u8 language; + /*0x1E*/ u8 winningTrainerLanguage; + } contestLiveUpdates; + + // TVSHOW_3_CHEERS_FOR_POKEBLOCKS + struct { + /*0x00*/ u8 kind; + /*0x01*/ bool8 active; + /*0x02*/ u8 sheen; + /*0x03*/ u8 flavor:3; + /*0x03*/ u8 unk_03_3:2; + /*0x04*/ u8 worstBlenderName[8]; + /*0x0C*/ u8 playerName[8]; + /*0x14*/ u8 language; + /*0x15*/ u8 worstBlenderLanguage; + } threeCheers; + + // TVSHOW_BATTLE_UPDATE + struct { + /*0x00*/ u8 kind; + /*0x01*/ bool8 active; + /*0x02*/ u16 species; + /*0x04*/ u8 playerName[8]; + /*0x0C*/ u8 linkOpponentName[8]; + /*0x14*/ u16 move; + /*0x16*/ u16 species2; + /*0x18*/ u8 battleType; + /*0x19*/ u8 language; + /*0x1A*/ u8 linkOpponentLanguage; + } battleUpdate; + + // TVSHOW_FAN_CLUB_SPECIAL + struct { + /*0x00*/ u8 kind; + /*0x01*/ bool8 active; + /*0x02*/ u8 playerName[8]; + /*0x0a*/ u8 idLo; + /*0x0b*/ u8 idHi; + /*0x0c*/ u8 idolName[8]; + /*0x14*/ u16 words[1]; + /*0x16*/ u8 score; + /*0x17*/ u8 language; + /*0x18*/ u8 idolNameLanguage; + } fanClubSpecial; + + // TVSHOW_CONTEST_LIVE_UPDATES_2 + struct { + /*0x00*/ u8 kind; + /*0x01*/ bool8 active; + /*0x02*/ u8 playerName[8]; + /*0x0a*/ u8 contestCategory; + /*0x0b*/ u8 nickname[11]; + /*0x16*/ u8 pokeblockState; + /*0x17*/ u8 language; + /*0x18*/ u8 pokemonNameLanguage; + } contestLiveUpdates2; + + // Record Mixing Shows + // TVSHOW_POKEMON_TODAY_CAUGHT + struct { + /*0x00*/ u8 kind; + /*0x01*/ bool8 active; + /*0x02*/ u8 language; + /*0x03*/ u8 language2; + /*0x04*/ u8 nickname[11]; + /*0x0F*/ u8 ball; + /*0x10*/ u16 species; + /*0x12*/ u8 nBallsUsed; + /*0x13*/ u8 playerName[8]; + } pokemonToday; + + // TVSHOW_SMART_SHOPPER + struct { + /*0x00*/ u8 kind; + /*0x01*/ bool8 active; + /*0x02*/ u8 priceReduced; + /*0x03*/ u8 language; + /*0x04*/ u8 pad04[2]; + /*0x06*/ u16 itemIds[3]; + /*0x0C*/ u16 itemAmounts[3]; + /*0x12*/ u8 shopLocation; + /*0x13*/ u8 playerName[8]; + } smartshopperShow; + + // TVSHOW_POKEMON_TODAY_FAILED + struct { + /*0x00*/ u8 kind; + /*0x01*/ bool8 active; + /*0x02*/ u8 language; + /*0x03*/ u8 pad03[9]; + /*0x0c*/ u16 species; + /*0x0e*/ u16 species2; + /*0x10*/ u8 nBallsUsed; + /*0x11*/ u8 outcome; + /*0x12*/ u8 location; + /*0x13*/ u8 playerName[8]; + } pokemonTodayFailed; + + // TVSHOW_FISHING_ADVICE + struct { + /*0x00*/ u8 kind; + /*0x01*/ bool8 active; + /*0x02*/ u8 nBites; + /*0x03*/ u8 nFails; + /*0x04*/ u16 species; + /*0x06*/ u8 language; + /*0x07*/ u8 pad07[12]; + /*0x13*/ u8 playerName[8]; + } pokemonAngler; + + // TVSHOW_WORLD_OF_MASTERS + struct { + /*0x00*/ u8 kind; + /*0x01*/ bool8 active; + /*0x02*/ u16 numPokeCaught; + /*0x04*/ u16 caughtPoke; + /*0x06*/ u16 steps; + /*0x08*/ u16 species; + /*0x0a*/ u8 location; + /*0x0b*/ u8 language; + /*0x0c*/ u8 pad0c[7]; + /*0x13*/ u8 playerName[8]; + } worldOfMasters; + + // TVSHOW_TODAYS_RIVAL_TRAINER + struct { + /*0x00*/ u8 kind; + /*0x01*/ bool8 active; + /*0x02*/ u16 dexCount; + /*0x04*/ u8 badgeCount; + /*0x05*/ u8 nSilverSymbols; + /*0x06*/ u8 nGoldSymbols; + /*0x07*/ u8 location; + /*0x08*/ u16 battlePoints; + /*0x0a*/ u16 mapDataId; + /*0x0c*/ u8 language; + /*0x0d*/ u8 filler_0d[6]; + /*0x13*/ u8 playerName[8]; + } rivalTrainer; + + // TVSHOW_TREND_WATCHER + struct { + /*0x00*/ u8 kind; + /*0x01*/ bool8 active; + /*0x02*/ u8 filler_02[2]; + /*0x04*/ u16 words[2]; + /*0x08*/ u8 gender; + /*0x09*/ u8 language; + /*0x0a*/ u8 filler_0a[9]; + /*0x13*/ u8 playerName[8]; + } trendWatcher; + + // TVSHOW_TREASURE_INVESTIGATORS + struct { + /*0x00*/ u8 kind; + /*0x01*/ bool8 active; + /*0x02*/ u16 item; + /*0x04*/ u8 location; + /*0x05*/ u8 language; + /*0x06*/ u16 mapDataId; + /*0x08*/ u8 filler_08[11]; + /*0x13*/ u8 playerName[8]; + } treasureInvestigators; + + // TVSHOW_FIND_THAT_GAMER + struct { + /*0x00*/ u8 kind; + /*0x01*/ bool8 active; + /*0x02*/ u8 won; + /*0x03*/ u8 whichGame; + /*0x04*/ u16 nCoins; + /*0x06*/ u8 filler_06[2]; + /*0x08*/ u8 language; + /*0x09*/ u8 filler_09[10]; + /*0x13*/ u8 playerName[8]; + } findThatGamer; + + // TVSHOW_BREAKING_NEWS + struct { + /*0x00*/ u8 kind; + /*0x01*/ bool8 active; + /*0x02*/ u16 lastOpponentSpecies; + /*0x04*/ u8 location; + /*0x05*/ u8 outcome; + /*0x06*/ u16 caughtMonBall; + /*0x08*/ u16 balls; + /*0x0a*/ u16 poke1Species; + /*0x0c*/ u16 lastUsedMove; + /*0x0e*/ u8 language; + /*0x0f*/ u8 filler_0f[4]; + /*0x13*/ u8 playerName[8]; + } breakingNews; + + // TVSHOW_SECRET_BASE_VISIT + struct { + /*0x00*/ u8 kind; + /*0x01*/ bool8 active; + /*0x02*/ u8 avgLevel; + /*0x03*/ u8 nDecorations; + /*0x04*/ u8 decorations[4]; + /*0x08*/ u16 species; + /*0x0a*/ u16 move; + /*0x0c*/ u8 language; + /*0x0d*/ u8 filler_0d[6]; + /*0x13*/ u8 playerName[8]; + } secretBaseVisit; + + // TVSHOW_LOTTO_WINNER + struct { + /*0x00*/ u8 kind; + /*0x01*/ bool8 active; + /*0x02*/ u16 item; + /*0x04*/ u8 whichPrize; + /*0x05*/ u8 language; + /*0x06*/ u8 filler_06[13]; + /*0x13*/ u8 playerName[8]; + } lottoWinner; + + // TVSHOW_BATTLE_SEMINAR + struct { + /*0x00*/ u8 kind; + /*0x01*/ bool8 active; + /*0x02*/ u16 move; + /*0x04*/ u16 foeSpecies; + /*0x06*/ u16 species; + /*0x08*/ u16 otherMoves[3]; + /*0x0e*/ u16 betterMove; + /*0x10*/ u8 nOtherMoves; + /*0x11*/ u8 language; + /*0x12*/ u8 filler_12[1]; + /*0x13*/ u8 playerName[8]; + } battleSeminar; + + // TVSHOW_TRAINER_FAN_CLUB + struct { + /*0x00*/ u8 kind; + /*0x01*/ bool8 active; + /*0x02*/ u8 filler_02[2]; + /*0x04*/ u16 words[2]; + /*0x08*/ u8 language; + /*0x09*/ u8 filler_09[10]; + /*0x13*/ u8 playerName[8]; + } trainerFanClub; + + // TVSHOW_CUTIES + struct { + /*0x00*/ u8 kind; + /*0x01*/ bool8 active; + /*0x02*/ u8 nRibbons; + /*0x03*/ u8 selectedRibbon; + /*0x04*/ u8 nickname[11]; + /*0x0f*/ u8 language; + /*0x10*/ u8 pokemonNameLanguage; + /*0x11*/ u8 filler_12[2]; + /*0x13*/ u8 playerName[8]; + } cuties; + + // TVSHOW_FRONTIER + struct { + /*0x00*/ u8 kind; + /*0x01*/ bool8 active; + /*0x02*/ u16 winStreak; + /*0x04*/ u16 species1; + /*0x06*/ u16 species2; + /*0x08*/ u16 species3; + /*0x0a*/ u16 species4; + /*0x0c*/ u8 language; + /*0x0d*/ u8 facility; + /*0x0e*/ u8 filler_0e[5]; + /*0x13*/ u8 playerName[8]; + } frontier; + + // TVSHOW_NUMBER_ONE + struct { + /*0x00*/ u8 kind; + /*0x01*/ bool8 active; + /*0x02*/ u16 count; + /*0x04*/ u8 actionIdx; + /*0x05*/ u8 language; + /*0x06*/ u8 filler_06[13]; + /*0x13*/ u8 playerName[8]; + } numberOne; + + // TVSHOW_SECRET_BASE_SECRETS + struct { + /*0x00*/ u8 kind; + /*0x01*/ bool8 active; + /*0x02*/ u16 stepsInBase; + /*0x04*/ u8 baseOwnersName[8]; + /*0x0c*/ u32 flags; + /*0x10*/ u16 item; + /*0x12*/ u8 savedState; + /*0x13*/ u8 playerName[8]; + /*0x1b*/ u8 language; + /*0x1c*/ u8 baseOwnersNameLanguage; + } secretBaseSecrets; + + // TVSHOW_SAFARI_FAN_CLUB + struct { + /*0x00*/ u8 kind; + /*0x01*/ bool8 active; + /*0x02*/ u8 nMonsCaught; + /*0x03*/ u8 nPkblkUsed; + /*0x04*/ u8 language; + /*0x05*/ u8 filler_05[14]; + /*0x13*/ u8 playerName[8]; + } safariFanClub; + + // Mass Outbreak + // TVSHOW_MASS_OUTBREAK + struct { + /*0x00*/ u8 kind; + /*0x01*/ bool8 active; + /*0x02*/ u8 var02; + /*0x03*/ u8 var03; + /*0x04*/ u16 moves[4]; + /*0x0C*/ u16 species; + /*0x0E*/ u16 var0E; + /*0x10*/ u8 locationMapNum; + /*0x11*/ u8 locationMapGroup; + /*0x12*/ u8 var12; + /*0x13*/ u8 probability; + /*0x14*/ u8 level; + /*0x15*/ u8 var15; + /*0x16*/ u16 daysLeft; + /*0x18*/ u8 language; + } massOutbreak; +} TVShow; + +enum { + POKENEWS_NONE, + POKENEWS_SLATEPORT, + POKENEWS_GAME_CORNER, + POKENEWS_LILYCOVE, + POKENEWS_BLENDMASTER +}; + +typedef struct // 2b50 +{ + u8 kind; + u8 state; + u16 days; +} PokeNews; + +struct GabbyAndTyData +{ + /*2ba4*/ u16 mon1; + /*2ba6*/ u16 mon2; + /*2ba8*/ u16 lastMove; + /*2baa*/ u16 quote[1]; + /*2bac*/ u8 mapnum; + /*2bad*/ u8 battleNum; + /*2bae*/ u8 battleTookMoreThanOneTurn:1; + /*2bae*/ u8 playerLostAMon:1; + /*2bae*/ u8 playerUsedAnItem:1; + /*2bae*/ u8 playerThrewABall:1; + /*2bae*/ u8 onAir:1; + /*2bae*/ u8 valA_5:3; + /*2baf*/ u8 battleTookMoreThanOneTurn2:1; + /*2baf*/ u8 playerLostAMon2:1; + /*2baf*/ u8 playerUsedAnItem2:1; + /*2baf*/ u8 playerThrewABall2:1; + /*2baf*/ u8 valB_4:4; +}; + +#endif //GUARD_GLOBAL_TV_H diff --git a/include/international_string_util.h b/include/international_string_util.h new file mode 100644 index 000000000..11b5c633c --- /dev/null +++ b/include/international_string_util.h @@ -0,0 +1,21 @@ +#ifndef GUARD_INTERNATIONAL_STRING_UTIL_H +#define GUARD_INTERNATIONAL_STRING_UTIL_H + +s32 GetStringCenterAlignXOffset(s32 fontId, const u8 *str, s32 totalWidth); +s32 GetStringRightAlignXOffset(s32 fontId, const u8 *str, s32 totalWidth); +s32 GetStringCenterAlignXOffsetWithLetterSpacing(s32 fontId, const u8 *str, s32 totalWidth, s32 letterSpacing); +s32 GetStringWidthDifference(s32 fontId, const u8 *str, s32 totalWidth, s32 letterSpacing); +s32 GetMaxWidthInMenuTable(const u8 **str, s32 arg1); +s32 sub_81DB3D8(const u8 **str, u8* arg1, s32 arg2); +// sub_81DB41C +// sub_81DB468 +// sub_81DB494 +// sub_81DB4DC +// sub_81DB52C +// sub_81DB554 +// sub_81DB5AC +void TVShowConvertInternationalString(u8 *dest, const u8 *src, u8 language); +u32 sub_81DB604(const u8 *); +// sub_81DB620 + +#endif // GUARD_INTERNATIONAL_STRING_UTIL_H diff --git a/include/item.h b/include/item.h index eaefa0298..a136f03ec 100644 --- a/include/item.h +++ b/include/item.h @@ -31,6 +31,7 @@ extern struct BagPocket gBagPockets[]; void GetBerryCountString(u8* dst, const u8* berryName, u32 quantity); void CopyItemName(u16 itemId, u8 *string); +void CopyItemNameHandlePlural(u16 itemId, u8 *string, u32 quantity); bool8 IsBagPocketNonEmpty(u8 pocket); bool8 CheckBagHasItem(u16 itemId, u16 count); bool8 CheckBagHasSpace(u16 itemId, u16 count); @@ -58,5 +59,6 @@ ItemUseFunc ItemId_GetFieldFunc(u16 itemId); u8 ItemId_GetBattleUsage(u16 itemId); ItemUseFunc ItemId_GetBattleFunc(u16 itemId); u8 ItemId_GetSecondaryId(u16 itemId); +u16 itemid_get_market_price(u16 itemId); #endif // ITEM_H diff --git a/include/link.h b/include/link.h index 012c90480..5f5654e4d 100644 --- a/include/link.h +++ b/include/link.h @@ -177,12 +177,12 @@ u32 LinkMain1(u8 *, u16 *, u16[CMD_LENGTH][MAX_LINK_PLAYERS]); void LinkVSync(void); void Timer3Intr(void); void SerialCB(void); +u8 GetLinkPlayerCount(void); void sub_800E0E8(void); bool8 sub_800A520(void); bool8 sub_8010500(void); void sub_800DFB4(u8, u8); void sub_800ADF8(void); -u8 sub_8009FCC(void); #endif // GUARD_LINK_H diff --git a/include/malloc.h b/include/malloc.h index 4568e244a..f3a731797 100644 --- a/include/malloc.h +++ b/include/malloc.h @@ -2,7 +2,7 @@ #define GUARD_MALLOC_H #define malloc Alloc -#define calloc AllocZeroed +#define calloc(ct, sz) AllocZeroed((ct) * (sz)) #define free Free extern u8 gHeap[]; diff --git a/include/map_obj_lock.h b/include/map_obj_lock.h new file mode 100644 index 000000000..a10648f2f --- /dev/null +++ b/include/map_obj_lock.h @@ -0,0 +1,11 @@ +#ifndef GUARD_MAP_OBJ_LOCK_H +#define GUARD_MAP_OBJ_LOCK_H + +bool8 sub_80983C4(void); +void ScriptFreezeMapObjects(void); +bool8 sub_809847C(void); +void LockSelectedMapObject(void); +void sub_8098630(void); +bool8 sub_8098734(void); + +#endif // GUARD_MAP_OBJ_LOCK_H diff --git a/include/menu.h b/include/menu.h index 766aa9d39..66ac73e03 100644 --- a/include/menu.h +++ b/include/menu.h @@ -19,5 +19,6 @@ void box_print(u8, u8, u8, u8, const void *, s8, const u8 *); void sub_8198070(u8 windowId, bool8 copyToVram); void SetWindowTemplateFields(struct WindowTemplate* template, u8 priority, u8 tilemapLeft, u8 tilemapTop, u8 width, u8 height, u8 palNum, u16 baseBlock); void SetWindowBorderStyle(u8 windowId, bool8 copyToVram, u16 tileStart, u8 palette); +void sub_8198A50(struct WindowTemplate*, u8, u8, u8, u8, u8, u8, u16); // returns something but it isn't used, fix when menu.s is decomp'd #endif // GUARD_MENU_H diff --git a/include/money.h b/include/money.h index 22a3657f6..5c7c1c984 100644 --- a/include/money.h +++ b/include/money.h @@ -5,7 +5,7 @@ u32 GetMoney(u32* moneyPtr); void SetMoney(u32* moneyPtr, u32 newValue); bool8 IsEnoughMoney(u32* moneyPtr, u32 cost); void AddMoney(u32* moneyPtr, u32 toAdd); -void SubtractMoney(u32* moneyPtr, u32 toSub); +void RemoveMoney(u32* moneyPtr, u32 toSub); bool8 IsEnoughForCostInVar0x8005(void); void SubtractMoneyFromVar0x8005(void); void PrintMoneyAmountInMoneyBox(u8 windowId, int amount, u8 speed); diff --git a/include/moves.h b/include/moves.h index bc213cbc7..682f59506 100644 --- a/include/moves.h +++ b/include/moves.h @@ -359,6 +359,7 @@ enum MOVE_DOOM_DESIRE, MOVE_PSYCHO_BOOST, }; +extern const u8 gMoveNames[][13]; #define LAST_MOVE_INDEX MOVE_PSYCHO_BOOST diff --git a/include/mystery_event_script.h b/include/mystery_event_script.h new file mode 100644 index 000000000..ab23a8d00 --- /dev/null +++ b/include/mystery_event_script.h @@ -0,0 +1,8 @@ +#ifndef GUARD_MYSTERY_EVENT_SCRIPT_H +#define GUARD_MYSTERY_EVENT_SCRIPT_H + +u32 RunMysteryEventScript(u8 *); +void SetMysteryEventScriptStatus(u32 val); +u16 GetRecordMixingGift(void); + +#endif // GUARD_MYSTERY_EVENT_SCRIPT_H diff --git a/include/new_menu_helpers.h b/include/new_menu_helpers.h new file mode 100644 index 000000000..6377897d3 --- /dev/null +++ b/include/new_menu_helpers.h @@ -0,0 +1,9 @@ +#ifndef GUARD_NEW_MENU_HELPERS_H +#define GUARD_NEW_MENU_HELPERS_H + +void sub_81973A4(void); +void sub_81973C4(u8, u8); +void sub_819746C(u8 windowId, bool8 copyToVram); +void sub_81973FC(u8, u8); + +#endif // GUARD_NEW_MENU_HELPERS_H diff --git a/include/overworld.h b/include/overworld.h new file mode 100644 index 000000000..0475e8e8c --- /dev/null +++ b/include/overworld.h @@ -0,0 +1,58 @@ +#ifndef GUARD_ROM4_H +#define GUARD_ROM4_H + +struct UnkPlayerStruct +{ + u8 player_field_0; + u8 player_field_1; +}; + +struct LinkPlayerMapObject +{ + u8 active; + u8 linkPlayerId; + u8 mapObjId; + u8 mode; +}; + +struct UCoords32 +{ + u32 x, y; +}; + +extern struct LinkPlayerMapObject gLinkPlayerMapObjects[4]; + +void IncrementGameStat(u8 index); + +void Overworld_SetMapObjTemplateCoords(u8, s16, s16); +void Overworld_SetMapObjTemplateMovementType(u8, u8); + +void Overworld_SetWarpDestination(s8 mapGroup, s8 mapNum, s8 warpId, s8 x, s8 y); + +void saved_warp2_set_2(int unused, s8 mapGroup, s8 mapNum, s8 warpId, s8 x, s8 y); +void Overworld_SetHealLocationWarp(u8); +void sub_8084DD4(s8 mapGroup, s8 mapNum, s8 warpId, s8 x, s8 y); +void sub_8084E2C(s8, s8, s8, s8, s8); +void sub_8084E80(s8, s8, s8, s8, s8); +void sub_8084EBC(s16, s16); + +void player_avatar_init_params_reset(void); + +void Overworld_SetFlashLevel(s32 a1); +//u8 Overworld_GetFlashLevel(void); +void sub_8085524(u16); + +void Overworld_SetSavedMusic(u16); +void Overworld_ChangeMusicToDefault(void); +void Overworld_ChangeMusicTo(u16); + +bool32 is_c1_link_related_active(void); + +void strange_npc_table_clear(void); +const struct MapHeader *get_mapheader_by_bank_and_number(u8, u8); +void FieldObjectMoveDestCoords(struct MapObject *, u32, s16 *, s16 *); +void sub_8086230(void); +void c2_exit_to_overworld_2_switch(void); +void c2_exit_to_overworld_1_continue_scripts_restart_music(void); + +#endif //GUARD_ROM4_H diff --git a/include/palette.h b/include/palette.h index de2cf0083..d3bcd2271 100644 --- a/include/palette.h +++ b/include/palette.h @@ -8,6 +8,9 @@ #define gPaletteFade_delay (gPaletteFade.multipurpose2) // normal and hardware fade #define gPaletteFade_submode (gPaletteFade.multipurpose2) // fast fade +#define PLTT_BUFFER_SIZE 0x200 +#define PLTT_DECOMP_BUFFER_SIZE (PLTT_BUFFER_SIZE * 2) + enum { FAST_FADE_IN_FROM_WHITE, diff --git a/include/party_menu.h b/include/party_menu.h new file mode 100644 index 000000000..175aba639 --- /dev/null +++ b/include/party_menu.h @@ -0,0 +1,6 @@ +#ifndef GUARD_PARTY_MENU_H +#define GUARD_PARTY_MENU_H + +bool8 pokemon_has_move(struct Pokemon *, u16); + +#endif // GUARD_PARTY_MENU_H diff --git a/include/pokedex.h b/include/pokedex.h index 38aca0915..79721899f 100644 --- a/include/pokedex.h +++ b/include/pokedex.h @@ -16,6 +16,8 @@ enum FLAG_SET_CAUGHT }; -u8 GetSetPokedexFlag(u16 nationalNum, u8 caseId); +s8 GetSetPokedexFlag(u16 nationalNum, u8 caseId); +u16 pokedex_count(u8); +u16 sub_80C0844(u8); #endif // GUARD_POKEDEX_H diff --git a/include/pokemon.h b/include/pokemon.h index 263a37426..c26c28afa 100644 --- a/include/pokemon.h +++ b/include/pokemon.h @@ -642,6 +642,7 @@ void UpdatePartyPokerusTime(u16 days); void PartySpreadPokerus(struct Pokemon *party); s8 GetMonFlavourRelation(struct Pokemon *mon, u8 a2); s8 GetFlavourRelationByPersonality(u32 personality, u8 a2); +u8 GetItemEffectParamOffset(u16 itemId, u8 effectByte, u8 effectBit); #include "sprite.h" diff --git a/include/pokemon_3.h b/include/pokemon_3.h new file mode 100644 index 000000000..5c9862d57 --- /dev/null +++ b/include/pokemon_3.h @@ -0,0 +1,7 @@ +#ifndef GUARD_POKEMON_3_H +#define GUARD_POKEMON_3_H + +const u8* GetTrainerClassNameFromId(u16 trainerId); +const u8* GetTrainerNameFromId(u16 trainerId); + +#endif // GUARD_POKEMON_3_H diff --git a/include/pokemon_item_effects.h b/include/pokemon_item_effects.h index 88f341317..505cc0f25 100644 --- a/include/pokemon_item_effects.h +++ b/include/pokemon_item_effects.h @@ -3,6 +3,60 @@ #include "pokemon.h" +// TODO once pokemon item effects is decompiled +/* +struct PokemonItemEffect +{ + //field 0 + u8 xAtk : 4; // x1, x2, x4, x8 = xF + u8 field_0_x10 : 1; // x10 + u8 critRatioUp : 1; // x20 + u8 field_0_x40 : 1; // x40 + u8 cureInfatuation : 1; // x80 + + /*field 1 + u8 xSpeed : 4; // x1, x2, x4, x8 = xF + u8 xDefense : 4; // x10, x20, x40, xF0 + + /*field 2 + u8 xSpAtk : 4; // x1, x2, x4, x8 = xF + u8 xAccuracy : 4; // x10, x20, x40, xF0 + + /*field 3 + u8 cureConfusion : 1; // x1 + u8 cureParalysis : 1; // x2 + u8 cureFreeze : 1; // x4 + u8 cureBurn : 1; // x8 + u8 curePoison : 1; // x10 + u8 cureSleep : 1; // x20 + u8 field_3_x40 : 1; // x40 + u8 cantLowerStats : 1; // x80 + + /*field 4 + u8 hpEv : 1; // x1 + u8 attackEv : 1; // x2 + u8 healHp : 1; // x4 + u8 field_4_x8 : 1; // x8 + u8 field_4_x10 : 1; // x10 + u8 ppUp : 1; // x20 + u8 levelUp : 1; // x40 + u8 evolutionStone : 1; // x80 + + /*field 5 + u8 defEv: 1; // x1 + u8 speedEv : 1; // x2 + u8 spDefEv : 1; // x4 + u8 spAtkEv : 1; // x8 + u8 ppMax : 1; // x10 + u8 field_5_x20 : 1; // x20 + u8 field_5_x40 : 1; // x40 + u8 field_5_x80 : 1; // x80 + + /*field 6 + u8 value; +}; +*/ + bool8 ExecuteTableBasedItemEffect(struct Pokemon *mon, u16 itemId, u8 partyId, u8 monMoveIndex, u8 a5); #endif // GUARD_POKEMON_ITEM_EFFECTS diff --git a/include/pokemon_storage_system.h b/include/pokemon_storage_system.h index 5216e8450..49680793d 100644 --- a/include/pokemon_storage_system.h +++ b/include/pokemon_storage_system.h @@ -2,5 +2,7 @@ #define GUARD_POKEMON_STORAGE_SYSTEM_H u8* GetBoxNamePtr(u8 boxNumber); +struct BoxPokemon *GetBoxedMonPtr(u8, u8); +void SetBoxMonNickFromAnyBox(u8, u8, u8 *); #endif // GUARD_POKEMON_STORAGE_SYSTEM_H diff --git a/include/region_map.h b/include/region_map.h new file mode 100644 index 000000000..52e7376be --- /dev/null +++ b/include/region_map.h @@ -0,0 +1,227 @@ +#ifndef GUARD_REGION_MAP_H +#define GUARD_REGION_MAP_H + +// Exported type declarations + +enum { + REGION_MAP_LITTLEROOT_TOWN, + REGION_MAP_OLDALE_TOWN, + REGION_MAP_DEWFORD_TOWN, + REGION_MAP_LAVARIDGE_TOWN, + REGION_MAP_FALLARBOR_TOWN, + REGION_MAP_VERDANTURF_TOWN, + REGION_MAP_PACIFIDLOG_TOWN, + REGION_MAP_PETALBURG_CITY, + REGION_MAP_SLATEPORT_CITY, + REGION_MAP_MAUVILLE_CITY, + REGION_MAP_RUSTBORO_CITY, + REGION_MAP_FORTREE_CITY, + REGION_MAP_LILYCOVE_CITY, + REGION_MAP_MOSSDEEP_CITY, + REGION_MAP_SOOTOPOLIS_CITY, + REGION_MAP_EVER_GRANDE_CITY, + REGION_MAP_ROUTE_101, + REGION_MAP_ROUTE_102, + REGION_MAP_ROUTE_103, + REGION_MAP_ROUTE_104, + REGION_MAP_ROUTE_105, + REGION_MAP_ROUTE_106, + REGION_MAP_ROUTE_107, + REGION_MAP_ROUTE_108, + REGION_MAP_ROUTE_109, + REGION_MAP_ROUTE_110, + REGION_MAP_ROUTE_111, + REGION_MAP_ROUTE_112, + REGION_MAP_ROUTE_113, + REGION_MAP_ROUTE_114, + REGION_MAP_ROUTE_115, + REGION_MAP_ROUTE_116, + REGION_MAP_ROUTE_117, + REGION_MAP_ROUTE_118, + REGION_MAP_ROUTE_119, + REGION_MAP_ROUTE_120, + REGION_MAP_ROUTE_121, + REGION_MAP_ROUTE_122, + REGION_MAP_ROUTE_123, + REGION_MAP_ROUTE_124, + REGION_MAP_ROUTE_125, + REGION_MAP_ROUTE_126, + REGION_MAP_ROUTE_127, + REGION_MAP_ROUTE_128, + REGION_MAP_ROUTE_129, + REGION_MAP_ROUTE_130, + REGION_MAP_ROUTE_131, + REGION_MAP_ROUTE_132, + REGION_MAP_ROUTE_133, + REGION_MAP_ROUTE_134, + REGION_MAP_UNDERWATER_124, + REGION_MAP_UNDERWATER_125, + REGION_MAP_UNDERWATER_126, + REGION_MAP_UNDERWATER_127, + REGION_MAP_UNDERWATER_128, + REGION_MAP_GRANITE_CAVE, + REGION_MAP_MT_CHIMNEY, + REGION_MAP_SAFARI_ZONE, + REGION_MAP_BATTLE_FRONTIER, + REGION_MAP_PETALBURG_WOODS, + REGION_MAP_RUSTURF_TUNNEL, + REGION_MAP_ABANDONED_SHIP, + REGION_MAP_NEW_MAUVILLE, + REGION_MAP_METEOR_FALLS, + REGION_MAP_METEOR_FALLS2, + REGION_MAP_MT_PYRE, + REGION_MAP_AQUA_HIDEOUT_OLD, + REGION_MAP_SHOAL_CAVE, + REGION_MAP_SEAFLOOR_CAVERN, + REGION_MAP_UNDERWATER, + REGION_MAP_VICTORY_ROAD, + REGION_MAP_MIRAGE_ISLAND, + REGION_MAP_CAVE_OF_ORIGIN, + REGION_MAP_SOUTHERN_ISLAND, + REGION_MAP_FIERY_PATH, + REGION_MAP_FIERY_PATH2, + REGION_MAP_JAGGED_PASS, + REGION_MAP_JAGGED_PASS2, + REGION_MAP_SEALED_CHAMBER, + REGION_MAP_UNDERWATER_SEALED_CHAMBER, + REGION_MAP_SCORCHED_SLAB, + REGION_MAP_ISLAND_CAVE, + REGION_MAP_DESERT_RUINS, + REGION_MAP_ANCIENT_TOMB, + REGION_MAP_INSIDE_OF_TRUCK, + REGION_MAP_SKY_PILLAR, + REGION_MAP_SECRET_BASE, + REGION_MAP_NONE, + REGION_MAP_PALLET_TOWN, + REGION_MAP_VIRIDIAN_CITY, + REGION_MAP_PEWTER_CITY, + REGION_MAP_CERULEAN_CITY, + REGION_MAP_LAVENDER_TOWN, + REGION_MAP_VERMILION_CITY, + REGION_MAP_CELADON_CITY, + REGION_MAP_FUCHSIA_CITY, + REGION_MAP_CINNABAR_ISLAND, + REGION_MAP_INDIGO_PLATEAU, + REGION_MAP_SAFFRON_CITY, + REGION_MAP_ROUTE_4, + REGION_MAP_ROUTE_10, + REGION_MAP_ROUTE_1, + REGION_MAP_ROUTE_2, + REGION_MAP_ROUTE_3, + REGION_MAP_ROUTE_4_2, + REGION_MAP_ROUTE_5, + REGION_MAP_ROUTE_6, + REGION_MAP_ROUTE_7, + REGION_MAP_ROUTE_8, + REGION_MAP_ROUTE_9, + REGION_MAP_ROUTE_10_2, + REGION_MAP_ROUTE_11, + REGION_MAP_ROUTE_12, + REGION_MAP_ROUTE_13, + REGION_MAP_ROUTE_14, + REGION_MAP_ROUTE_15, + REGION_MAP_ROUTE_16, + REGION_MAP_ROUTE_17, + REGION_MAP_ROUTE_18, + REGION_MAP_ROUTE_19, + REGION_MAP_ROUTE_20, + REGION_MAP_ROUTE_21, + REGION_MAP_ROUTE_22, + REGION_MAP_ROUTE_23, + REGION_MAP_ROUTE_24, + REGION_MAP_ROUTE_25, + REGION_MAP_VIRIDIAN_FOREST, + REGION_MAP_MT_MOON, + REGION_MAP_S_S_ANNE, + REGION_MAP_UNDERGROUND_PATH, + REGION_MAP_UNDERGROUND_PATH_2, + REGION_MAP_DIGLETTS_CAVE, + REGION_MAP_KANTO_VICTORY_ROAD, + REGION_MAP_ROCKET_HIDEOUT, + REGION_MAP_SILPH_CO, + REGION_MAP_POKEMON_MANSION, + REGION_MAP_KANTO_SAFARI_ZONE, + REGION_MAP_POKEMON_LEAGUE, + REGION_MAP_ROCK_TUNNEL, + REGION_MAP_SEAFOAM_ISLANDS, + REGION_MAP_POKEMON_TOWER, + REGION_MAP_CERULEAN_CAVE, + REGION_MAP_POWER_PLANT, + REGION_MAP_ONE_ISLAND, + REGION_MAP_TWO_ISLAND, + REGION_MAP_THREE_ISLAND, + REGION_MAP_FOUR_ISLAND, + REGION_MAP_FIVE_ISLAND, + REGION_MAP_SEVEN_ISLAND, + REGION_MAP_SIX_ISLAND, + REGION_MAP_KINDLE_ROAD, + REGION_MAP_TREASURE_BEACH, + REGION_MAP_CAPE_BRINK, + REGION_MAP_BOND_BRIDGE, + REGION_MAP_THREE_ISLE_PORT, + REGION_MAP_SEVII_ISLE_6, + REGION_MAP_SEVII_ISLE_7, + REGION_MAP_SEVII_ISLE_8, + REGION_MAP_SEVII_ISLE_9, + REGION_MAP_RESORT_GORGEOUS, + REGION_MAP_WATER_LABYRINTH, + REGION_MAP_FIVE_ISLE_MEADOW, + REGION_MAP_MEMORIAL_PILLAR, + REGION_MAP_OUTCAST_ISLAND, + REGION_MAP_GREEN_PATH, + REGION_MAP_WATER_PATH, + REGION_MAP_RUIN_VALLEY, + REGION_MAP_TRAINER_TOWER, + REGION_MAP_CANYON_ENTRANCE, + REGION_MAP_SEVAULT_CANYON, + REGION_MAP_TANOBY_RUINS, + REGION_MAP_SEVII_ISLE_22, + REGION_MAP_SEVII_ISLE_23, + REGION_MAP_SEVII_ISLE_24, + REGION_MAP_NAVEL_ROCK, + REGION_MAP_MT_EMBER, + REGION_MAP_BERRY_FOREST, + REGION_MAP_ICEFALL_CAVE, + REGION_MAP_ROCKET_WAREHOUSE, + REGION_MAP_TRAINER_TOWER_2, + REGION_MAP_DOTTED_HOLE, + REGION_MAP_LOST_CAVE, + REGION_MAP_PATTERN_BUSH, + REGION_MAP_ALTERING_CAVE, + REGION_MAP_TANOBY_CHAMBERS, + REGION_MAP_THREE_ISLE_PATH, + REGION_MAP_TANOBY_KEY, + REGION_MAP_BIRTH_ISLAND, + REGION_MAP_MONEAN_CHAMBER, + REGION_MAP_LIPTOO_CHAMBER, + REGION_MAP_WEEPTH_CHAMBER, + REGION_MAP_DILFORD_CHAMBER, + REGION_MAP_SCUFIB_CHAMBER, + REGION_MAP_RIXY_CHAMBER, + REGION_MAP_VIAPOIS_CHAMBER, + REGION_MAP_EMBER_SPA, + REGION_MAP_SPECIAL_AREA, + REGION_MAP_AQUA_HIDEOUT, + REGION_MAP_MAGMA_HIDEOUT, + REGION_MAP_MIRAGE_TOWER, + REGION_MAP_BIRTH_ISLAND_2, + REGION_MAP_FARAWAY_ISLAND, + REGION_MAP_ARTISAN_CAVE, + REGION_MAP_MARINE_CAVE, + REGION_MAP_UNDERWATER_MARINE_CAVE, + REGION_MAP_TERRA_CAVE, + REGION_MAP_UNDERWATER_TERRA_CAVE, + REGION_MAP_UNDERWATER_UNK1, + REGION_MAP_UNDERWATER_UNK2, + REGION_MAP_DESERT_UNDERPASS, + REGION_MAP_ALTERING_CAVE_2, + REGION_MAP_NAVEL_ROCK2, + REGION_MAP_TRAINER_HILL +}; + +// Exported RAM declarations + +// Exported ROM declarations +void GetMapName(u8 *, u16, u16); + +#endif //GUARD_REGION_MAP_H diff --git a/include/reshow_battle_screen.h b/include/reshow_battle_screen.h index 62773b48b..c22135280 100644 --- a/include/reshow_battle_screen.h +++ b/include/reshow_battle_screen.h @@ -1,6 +1,7 @@ #ifndef GUARD_RESHOW_BATTLE_SCREEN_H #define GUARD_RESHOW_BATTLE_SCREEN_H +void nullsub_35(void); void ReshowBattleScreenAfterMenu(void); #endif // GUARD_RESHOW_BATTLE_SCREEN_H diff --git a/include/rom4.h b/include/rom4.h deleted file mode 100644 index e19d277a6..000000000 --- a/include/rom4.h +++ /dev/null @@ -1,33 +0,0 @@ - -#ifndef GUARD_ROM4_H -#define GUARD_ROM4_H - -struct UnkPlayerStruct -{ - u8 player_field_0; - u8 player_field_1; -}; - -struct LinkPlayerMapObject -{ - u8 active; - u8 linkPlayerId; - u8 mapObjId; - u8 mode; -}; - -struct UCoords32 -{ - u32 x, y; -}; - - -extern struct LinkPlayerMapObject gLinkPlayerMapObjects[4]; - -void strange_npc_table_clear(void); -const struct MapHeader *get_mapheader_by_bank_and_number(u8, u8); -void FieldObjectMoveDestCoords(struct MapObject *, u32, s16 *, s16 *); -void sub_8086230(void); -void c2_exit_to_overworld_2_switch(void); - -#endif //GUARD_ROM4_H diff --git a/include/rom6.h b/include/rom6.h index 15070616d..0e9927855 100644 --- a/include/rom6.h +++ b/include/rom6.h @@ -2,5 +2,6 @@ #define GUARD_ROM6_H void sub_81357FC(u8, void(void)); +u8 GetLeadMonIndex(void); #endif //GUARD_ROM6_H diff --git a/include/save_location.h b/include/save_location.h new file mode 100644 index 000000000..95b3a7d7d --- /dev/null +++ b/include/save_location.h @@ -0,0 +1,9 @@ +#ifndef GUARD_SAVE_LOCATION_H +#define GUARD_SAVE_LOCATION_H + +bool32 sub_81AFCEC(void); +void TrySetMapSaveWarpStatus(void); +void sub_81AFDA0(void); +void sub_81AFDD0(void); + +#endif // GUARD_SAVE_LOCATION_H diff --git a/include/script.h b/include/script.h index ec6a212bc..2b5f8c2ce 100644 --- a/include/script.h +++ b/include/script.h @@ -28,8 +28,8 @@ 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, u8 *ptr); -void ScriptCall(struct ScriptContext *ctx, u8 *ptr); +void ScriptJump(struct ScriptContext *ctx, const u8 *ptr); +void ScriptCall(struct ScriptContext *ctx, const u8 *ptr); void ScriptReturn(struct ScriptContext *ctx); u16 ScriptReadHalfword(struct ScriptContext *ctx); u32 ScriptReadWord(struct ScriptContext *ctx); diff --git a/include/script_menu.h b/include/script_menu.h new file mode 100644 index 000000000..717eda041 --- /dev/null +++ b/include/script_menu.h @@ -0,0 +1,13 @@ +#ifndef GUARD_SCRIPT_MENU_H +#define GUARD_SCRIPT_MENU_H + +extern const u8 *const gUnknown_0858BAF0[9]; + +bool8 ScriptMenu_Multichoice(u8 left, u8 top, u8 var3, u8 var4); +bool8 ScriptMenu_MultichoiceWithDefault(u8 left, u8 top, u8 var3, u8 var4, u8 var5); +bool8 ScriptMenu_YesNo(u8 var1, u8 var2); +bool8 ScriptMenu_MultichoiceGrid(u8 left, u8 top, u8 multichoiceId, u8 a4, u8 columnCount); +bool8 ScriptMenu_ShowPokemonPic(u16 var1, u8 var2, u8 var3); +bool8 (*ScriptMenu_GetPicboxWaitFunc(void))(void); + +#endif //GUARD_SCRIPT_MENU_H diff --git a/include/script_movement.h b/include/script_movement.h new file mode 100644 index 000000000..4c3fa6002 --- /dev/null +++ b/include/script_movement.h @@ -0,0 +1,8 @@ +#ifndef GUARD_SCRIPT_MOVEMENT_H +#define GUARD_SCRIPT_MOVEMENT_H + +bool8 ScriptMovement_StartObjectMovementScript(u8, u8, u8, const u8 *); +bool8 ScriptMovement_IsObjectMovementFinished(u8, u8, u8); +void sub_80D338C(void); + +#endif // GUARD_SCRIPT_MOVEMENT_H diff --git a/include/script_pokemon_80F8.h b/include/script_pokemon_80F8.h new file mode 100644 index 000000000..8dd7ed0c0 --- /dev/null +++ b/include/script_pokemon_80F8.h @@ -0,0 +1,10 @@ +#ifndef GUARD_SCRIPTPOKE80F8_H +#define GUARD_SCRIPTPOKE80F8_H + +void ShowContestWinner(void); +u8 ScriptGiveMon(u16, u8, u16, u32, u32, u8); +u8 ScriptGiveEgg(u16); +void CreateScriptedWildMon(u16, u8, u16); +void ScriptSetMonMoveSlot(u8, u16, u8); + +#endif diff --git a/include/script_pokemon_81B9.h b/include/script_pokemon_81B9.h new file mode 100644 index 000000000..1b8563ee6 --- /dev/null +++ b/include/script_pokemon_81B9.h @@ -0,0 +1,6 @@ +#ifndef GUARD_SCRIPTPOKE81B9_H +#define GUARD_SCRIPTPOKE81B9_H + +void sub_81B9404(void); + +#endif diff --git a/include/secret_base.h b/include/secret_base.h new file mode 100644 index 000000000..4f7b411da --- /dev/null +++ b/include/secret_base.h @@ -0,0 +1,11 @@ +#ifndef GUARD_SECRET_BASE_H +#define GUARD_SECRET_BASE_H + +// Exported type declarations + +// Exported RAM declarations + +// Exported ROM declarations +void sub_80E980C(void); + +#endif //GUARD_SECRET_BASE_H diff --git a/include/shop.h b/include/shop.h new file mode 100644 index 000000000..d3e86408c --- /dev/null +++ b/include/shop.h @@ -0,0 +1,10 @@ +#ifndef GUARD_SHOP_H +#define GUARD_SHOP_H + +extern EWRAM_DATA struct ItemSlot gUnknown_02039F80[3]; + +void CreatePokemartMenu(const u16 *); +void CreateDecorationShop1Menu(const u16 *); +void CreateDecorationShop2Menu(const u16 *); + +#endif // GUARD_SHOP_H diff --git a/include/slot_machine.h b/include/slot_machine.h new file mode 100644 index 000000000..8334e56fc --- /dev/null +++ b/include/slot_machine.h @@ -0,0 +1,6 @@ +#ifndef GUARD_SLOT_MACHINE_H +#define GUARD_SLOT_MACHINE_H + +void PlaySlotMachine(u8, void *); + +#endif // GUARD_SLOT_MACHINE_H diff --git a/include/species.h b/include/species.h index 9ab0565cb..ac0797418 100644 --- a/include/species.h +++ b/include/species.h @@ -449,5 +449,6 @@ enum }; #define NUM_SPECIES SPECIES_EGG +extern const u8 gSpeciesNames[][11]; #endif // GUARD_SPECIES_H diff --git a/include/string_util.h b/include/string_util.h index 382f52251..f26646082 100644 --- a/include/string_util.h +++ b/include/string_util.h @@ -31,7 +31,7 @@ u8 *StringFillWithTerminator(u8 *dest, u16 n); u8 *StringCopyN_Multibyte(u8 *dest, u8 *src, u32 n); u32 StringLength_Multibyte(u8 *str); u8 *WriteColorChangeControlCode(u8 *dest, u32 colorType, u8 color); -bool32 sub_8009228(u8 *str); +bool32 IsStringJapanese(u8 *str); bool32 sub_800924C(u8 *str, s32 n); u8 GetExtCtrlCodeLength(u8 code); static const u8 *SkipExtCtrlCode(const u8 *s); diff --git a/include/strings.h b/include/strings.h new file mode 100644 index 000000000..5d1a9bba0 --- /dev/null +++ b/include/strings.h @@ -0,0 +1,33 @@ +#ifndef GUARD_strings_H +#define GUARD_strings_H + +extern const u8 gText_Lv50[]; +extern const u8 gText_OpenLevel[]; +extern const u8 gText_Mom[]; +extern const u8 gText_Dad[]; +extern const u8 gText_Cool[]; +extern const u8 gText_Beauty[]; +extern const u8 gText_Cute[]; +extern const u8 gText_Smart[]; +extern const u8 gText_Tough[]; +extern const u8 gText_Single[]; +extern const u8 gText_Double[]; +extern const u8 gText_Spicy2[]; +extern const u8 gText_Dry2[]; +extern const u8 gText_Sweet2[]; +extern const u8 gText_Bitter2[]; +extern const u8 gText_Sour2[]; +extern const u8 gText_Excellent[]; +extern const u8 gText_VeryGood[]; +extern const u8 gText_Good[]; +extern const u8 gText_SoSo[]; +extern const u8 gText_Bad[]; +extern const u8 gText_TheWorst[]; +extern const u8 gText_Slots[]; +extern const u8 gText_Roulette[]; +extern const u8 gText_Jackpot[]; +extern const u8 gText_First[]; +extern const u8 gText_Second[]; +extern const u8 gText_Third[]; + +#endif //GUARD_strings_H diff --git a/include/text.h b/include/text.h index 217de0687..594661717 100644 --- a/include/text.h +++ b/include/text.h @@ -103,7 +103,7 @@ struct TextPrinterSubStruct struct TextSubPrinter // TODO: Better name { - u8* current_text_offset; + const u8* current_text_offset; u8 windowId; u8 fontId; u8 x; @@ -170,6 +170,7 @@ typedef struct { u8 flag_0:1; u8 flag_1:1; u8 flag_2:1; + u8 flag_3:1; } TextFlags; extern TextFlags gTextFlags; @@ -195,7 +196,7 @@ u8 gGlyphDimensions[0x2]; void SetFontsPointer(const struct FontInfo *fonts); void DeactivateAllTextPrinters(void); -u16 PrintTextOnWindow(u8 windowId, u8 fontId, u8 *str, u8 x, u8 y, u8 speed, void (*callback)(struct TextSubPrinter *, u16)); +u16 PrintTextOnWindow(u8 windowId, u8 fontId, const u8 *str, u8 x, u8 y, u8 speed, void (*callback)(struct TextSubPrinter *, u16)); bool16 AddTextPrinter(struct TextSubPrinter *textSubPrinter, u8 speed, void (*callback)(struct TextSubPrinter *, u16)); void RunTextPrinters(void); bool16 IsTextPrinterActive(u8 id); diff --git a/include/trainer_see.h b/include/trainer_see.h index 3f39783b8..ab035d9f8 100644 --- a/include/trainer_see.h +++ b/include/trainer_see.h @@ -2,6 +2,7 @@ #define GUARD_TRAINER_SEE_H void sub_80B4578(struct MapObject *); +u8 sub_80B47BC(void); void sub_8155D78(struct MapObject *); #endif //GUARD_TRAINER_SEE_H diff --git a/include/tv.h b/include/tv.h new file mode 100644 index 000000000..9495387ef --- /dev/null +++ b/include/tv.h @@ -0,0 +1,15 @@ +#ifndef GUARD_TV_H +#define GUARD_TV_H + +extern u8 *const gTVStringVarPtrs[3]; + +void ClearTVShowData(void); +void PutPokemonTodayCaughtOnAir(void); +u32 GetPlayerIDAsU32(void); +bool8 GetPriceReduction(u8 newsKind); +u8 GetRibbonCount(struct Pokemon *pokemon); +void sub_80EE184(void); +void sub_80F14F8(TVShow *shows); +size_t sub_80EF370(int value); + +#endif //GUARD_TV_H diff --git a/include/vars.h b/include/vars.h index 7c0edeb77..67c0b67fc 100644 --- a/include/vars.h +++ b/include/vars.h @@ -53,4 +53,14 @@ #define VAR_0x40BC 0x40BC #define VAR_0x40C2 0x40C2 +#define VAR_FRONTIER_FACILITY 0x40CF + +#define VAR_DAILY_SLOTS 0x40E6 +#define VAR_DAILY_WILDS 0x40E7 +#define VAR_DAILY_BLENDER 0x40E8 +#define VAR_DAILY_PLANTED_BERRIES 0x40E9 +#define VAR_DAILY_PICKED_BERRIES 0x40EA +#define VAR_DAILY_ROULETTE 0x40EB +#define VAR_DAILY_BP 0x40F1 + #endif // GUARD_VARS_H |