diff --git a/include/applications/pokemon_summary_screen/3d_anim.h b/include/applications/pokemon_summary_screen/3d_anim.h new file mode 100644 index 0000000000..2237c1e108 --- /dev/null +++ b/include/applications/pokemon_summary_screen/3d_anim.h @@ -0,0 +1,16 @@ +#ifndef POKEPLATINUM_POKEMON_SUMMARY_SCREEN_3D_ANIM_H +#define POKEPLATINUM_POKEMON_SUMMARY_SCREEN_3D_ANIM_H + +#include "applications/pokemon_summary_screen/main.h" + +void PokemonSummaryScreen_Setup3DGfx(PokemonSummaryScreen *summaryScreen); +void PokemonSummaryScreen_Update3DGfx(PokemonSummaryScreen *summaryScreen); +void PokemonSummaryScreen_FreeCameraAndMonSprite(PokemonSummaryScreen *summaryScreen); +void PokemonSummaryScreen_SetupCamera(PokemonSummaryScreen *summaryScreen); +void PokemonSummaryScreen_InitConditionRects(PokemonSummaryScreen *summaryScreen); +void PokemonSummaryScreen_InitMaxAndDeltaConditionRects(PokemonSummaryScreen *summaryScreen); +void PokemonSummaryScreen_LoadMonSprite(PokemonSummaryScreen *summaryScreen); +void PokemonSummaryScreen_LoadMonAnimation(PokemonSummaryScreen *summaryScreen); +void PokemonSummaryScreen_ChangeMonSprite(PokemonSummaryScreen *summaryScreen); + +#endif // POKEPLATINUM_POKEMON_SUMMARY_SCREEN_3D_ANIM_H diff --git a/include/applications/pokemon_summary_screen/main.h b/include/applications/pokemon_summary_screen/main.h index 80af958449..706038c982 100644 --- a/include/applications/pokemon_summary_screen/main.h +++ b/include/applications/pokemon_summary_screen/main.h @@ -1,6 +1,8 @@ #ifndef POKEPLATINUM_POKEMON_SUMMARY_SCREEN_MAIN_H #define POKEPLATINUM_POKEMON_SUMMARY_SCREEN_MAIN_H +#include + #include "constants/moves.h" #include "struct_decls/cell_actor_data.h" @@ -12,7 +14,6 @@ #include "struct_defs/archived_poke_sprite_data.h" #include "struct_defs/chatot_cry.h" #include "struct_defs/sprite_animation_frame.h" -#include "struct_defs/struct_02091850.h" #include "bg_window.h" #include "camera.h" @@ -24,142 +25,300 @@ #include "savedata.h" #include "strbuf.h" #include "string_template.h" +#include "text.h" #include "trainer_info.h" -enum PSSMode { - PSS_MODE_NORMAL = 0, - PSS_MODE_LOCK_MOVES, - PSS_MODE_SELECT_MOVE, - PSS_MODE_POFFIN, - PSS_MODE_CONDITION, +enum SummaryMode { + SUMMARY_MODE_NORMAL = 0, + SUMMARY_MODE_LOCK_MOVES, + SUMMARY_MODE_SELECT_MOVE, + SUMMARY_MODE_POFFIN, + SUMMARY_MODE_CONDITION, }; -enum PSSPage { - PSS_PAGE_INFO = 0, - PSS_PAGE_MEMO, - PSS_PAGE_SKILLS, - PSS_PAGE_BATTLE_MOVES, - PSS_PAGE_CONDITION, - PSS_PAGE_CONTEST_MOVES, - PSS_PAGE_RIBBONS, - PSS_PAGE_EXIT, +enum SummaryPage { + SUMMARY_PAGE_INFO = 0, + SUMMARY_PAGE_MEMO, + SUMMARY_PAGE_SKILLS, + SUMMARY_PAGE_BATTLE_MOVES, + SUMMARY_PAGE_CONDITION, + SUMMARY_PAGE_CONTEST_MOVES, + SUMMARY_PAGE_RIBBONS, + SUMMARY_PAGE_EXIT, + + SUMMARY_PAGE_MAX, + + SUMMARY_PAGE_NONE = 0xFF +}; - PSS_PAGE_MAX, +enum SummaryDataType { + SUMMARY_DATA_MON = 0, + SUMMARY_DATA_PARTY_MON, + SUMMARY_DATA_BOX_MON, +}; - PSS_PAGE_NONE = 0xFF +enum SummaryReturnMode { + SUMMARY_RETURN_SELECT = 0, + SUMMARY_RETURN_CANCEL, }; -enum PSSState { - PSS_STATE_TRANSITION_IN = 0, - PSS_STATE_WAIT_TRANSITION, - PSS_STATE_HANDLE_INPUT, - PSS_STATE_SETUP_BATTLE_MOVE_INFO, - PSS_STATE_HIDE_BATTLE_MOVE_INFO, - PSS_STATE_SETUP_CONTEST_MOVE_INFO, - PSS_STATE_HIDE_CONTEST_MOVE_INFO, - PSS_STATE_MOVE_SELECT, - PSS_STATE_MOVE_SWAP, - PSS_STATE_LEARN_MOVE, - PSS_STATE_WAIT_HM_MSG_INPUT, - PSS_STATE_SETUP_RIBBON_INFO, - PSS_STATE_HIDE_RIBBON_INFO, - PSS_STATE_RIBBON_SELECT, - PSS_STATE_SUBSCREEN_INPUT, - PSS_STATE_SETUP_POFFIN_FEED, - PSS_STATE_PRINT_CONTEST_STAT_MSGS, - PSS_STATE_WAIT_FINISH_POFFIN_FEED, - PSS_STATE_TRANSITION_OUT, - PSS_STATE_WAIT_EXIT, +enum SummarySubscreenType { + SUMMARY_SUBSCREEN_TYPE_NORMAL = 0, + SUMMARY_SUBSCREEN_TYPE_NO_CONTEST_INFO, + SUMMARY_SUBSCREEN_TYPE_UNUSED_MOVES_ONLY, // only shows battle and contest move pages, never used + + SUMMARY_SUBSCREEN_TYPE_NO_BUTTONS = 0xF, }; -enum PSSDataType { - PSS_DATA_MON = 0, - PSS_DATA_PARTY_MON, - PSS_DATA_BOX_MON, +enum SummaryStaticWindow { + SUMMARY_WINDOW_LABEL_INFO = 0, + SUMMARY_WINDOW_LABEL_MEMO, + SUMMARY_WINDOW_LABEL_SKILLS, + SUMMARY_WINDOW_LABEL_CONDITION, + SUMMARY_WINDOW_LABEL_BATTLE_MOVES, + SUMMARY_WINDOW_LABEL_CONTEST_MOVES, + SUMMARY_WINDOW_LABEL_ITEM, + SUMMARY_WINDOW_LABEL_DEX_NUM, + SUMMARY_WINDOW_LABEL_SPECIES_NAME, + SUMMARY_WINDOW_LABEL_TYPE, + SUMMARY_WINDOW_LABEL_OT_NAME, + SUMMARY_WINDOW_LABEL_OT_ID, + SUMMARY_WINDOW_LABEL_EXP, + SUMMARY_WINDOW_LABEL_EXP_NEXT_LV, + SUMMARY_WINDOW_DUMMY_14, + SUMMARY_WINDOW_LABEL_HP, + SUMMARY_WINDOW_LABEL_ATTACK, + SUMMARY_WINDOW_LABEL_DEFENSE, + SUMMARY_WINDOW_LABEL_SP_ATTACK, + SUMMARY_WINDOW_LABEL_SP_DEFENSE, + SUMMARY_WINDOW_LABEL_SPEED, + SUMMARY_WINDOW_LABEL_ABILITY, + SUMMARY_WINDOW_LABEL_SHEEN, + SUMMARY_WINDOW_DUMMY_23, + SUMMARY_WINDOW_LABEL_MOVE_CANCEL, + SUMMARY_WINDOW_LABEL_MOVE_CATEGORY, + SUMMARY_WINDOW_LABEL_MOVE_POWER, + SUMMARY_WINDOW_LABEL_MOVE_ACCURACY, + SUMMARY_WINDOW_LABEL_CLOSE_WINDOW, + SUMMARY_WINDOW_LABEL_APPEAL_POINTS, + SUMMARY_WINDOW_LABEL_RIBBON_COUNT, + SUMMARY_WINDOW_LABEL_RIBBONS, + SUMMARY_WINDOW_ITEM_NAME, + SUMMARY_WINDOW_MON_LEVEL, + SUMMARY_WINDOW_MON_NICKNAME_GENDER, + SUMMARY_WINDOW_BUTTON_PROMPT, + + SUMMARY_STATIC_WINDOW_MAX }; -// todo: consolidate this with more generic ones if this scheme is used elsewhere -enum PSSTextAlignment { - PSS_ALIGNMENT_LEFT = 0, - PSS_ALIGNMENT_RIGHT, - PSS_ALIGNMENT_CENTER, +enum SummaryExtraWindowInfo { + SUMMARY_WINDOW_DEX_NUM = 0, + SUMMARY_WINDOW_SPECIES_NAME, + SUMMARY_WINDOW_OT_NAME, + SUMMARY_WINDOW_OT_ID, + SUMMARY_WINDOW_EXP, + SUMMARY_WINDOW_EXP_NEXT_LV, + + SUMMARY_INFO_WINDOW_MAX, }; -enum PSSSubscreenType { - PSS_SUBSCREEN_TYPE_NORMAL = 0, - PSS_SUBSCREEN_TYPE_NO_CONTEST_INFO, - PSS_SUBSCREEN_TYPE_UNUSED_MOVES_ONLY, // only shows battle and contest move pages, never used +enum SummaryExtraWindowMemo { + SUMMARY_WINDOW_MEMO = 0, + + SUMMARY_MEMO_WINDOW_MAX, +}; - PSS_SUBSCREEN_TYPE_NO_BUTTONS = 0xF, +enum SummaryExtraWindowSkills { + SUMMARY_WINDOW_HP = 0, + SUMMARY_WINDOW_ATTACK, + SUMMARY_WINDOW_DEFENSE, + SUMMARY_WINDOW_SP_ATTACK, + SUMMARY_WINDOW_SP_DEFENSE, + SUMMARY_WINDOW_SPEED, + SUMMARY_WINDOW_ABILITY, + SUMMARY_WINDOW_ABILITY_DESCRIPTION, + + SUMMARY_SKILLS_WINDOW_MAX, }; -enum PSSStaticWindow { - PSS_STATIC_WINDOW_0 = 0, - PSS_STATIC_WINDOW_1, - PSS_STATIC_WINDOW_2, - PSS_STATIC_WINDOW_3, - PSS_STATIC_WINDOW_4, - PSS_STATIC_WINDOW_5, - PSS_WINDOW_ITEM_LABEL, - PSS_STATIC_WINDOW_7, - PSS_STATIC_WINDOW_8, - PSS_STATIC_WINDOW_9, - PSS_STATIC_WINDOW_10, - PSS_STATIC_WINDOW_11, - PSS_STATIC_WINDOW_12, - PSS_STATIC_WINDOW_13, - PSS_STATIC_WINDOW_14, - PSS_STATIC_WINDOW_15, - PSS_STATIC_WINDOW_16, - PSS_STATIC_WINDOW_17, - PSS_STATIC_WINDOW_18, - PSS_STATIC_WINDOW_19, - PSS_STATIC_WINDOW_20, - PSS_STATIC_WINDOW_21, - PSS_STATIC_WINDOW_22, - PSS_STATIC_WINDOW_23, - PSS_STATIC_WINDOW_24, - PSS_STATIC_WINDOW_25, - PSS_WINDOW_MOVE_POWER, - PSS_WINDOW_MOVE_ACCURACY, - PSS_STATIC_WINDOW_28, - PSS_STATIC_WINDOW_29, - PSS_STATIC_WINDOW_30, - PSS_STATIC_WINDOW_31, - PSS_WINDOW_ITEM_NAME, - PSS_WINDOW_MON_LEVEL, - PSS_WINDOW_MON_NICKNAME, - PSS_WINDOW_BUTTON_PROMPT, - - PSS_STATIC_WINDOW_MAX +enum SummaryExtraWindowBattleMoves { + SUMMARY_WINDOW_BATTLE_MOVE_1 = 0, + SUMMARY_WINDOW_BATTLE_MOVE_2, + SUMMARY_WINDOW_BATTLE_MOVE_3, + SUMMARY_WINDOW_BATTLE_MOVE_4, + SUMMARY_WINDOW_BATTLE_MOVE_5, + SUMMARY_WINDOW_BATTLE_MOVE_POWER, + SUMMARY_WINDOW_BATTLE_MOVE_ACCURACY, + SUMMARY_WINDOW_BATTLE_MOVE_DESCRIPTION, + + SUMMARY_BATTLE_MOVES_WINDOW_MAX, }; -// somewhat bewilderingly, the message order does not follow the contest stat order -enum PSSPoffinFeedMsg { - PSS_MSG_COOLNESS_ENHANCED = 0, - PSS_MSG_BEAUTY_ENHANCED, - PSS_MSG_CUTENESS_ENHANCED, - PSS_MSG_SMARTNESS_ENHANCED, - PSS_MSG_TOUGHNESS_ENHANCED, +enum SummaryExtraWindowContestMoves { + SUMMARY_WINDOW_CONTEST_MOVE_1 = 0, + SUMMARY_WINDOW_CONTEST_MOVE_2, + SUMMARY_WINDOW_CONTEST_MOVE_3, + SUMMARY_WINDOW_CONTEST_MOVE_4, + SUMMARY_WINDOW_CONTEST_MOVE_5, + SUMMARY_WINDOW_CONTEST_MOVE_DESCRIPTION, - PSS_MSG_NOTHING_CHANGED = 0xFE, - PSS_MSG_MON_WONT_EAT_MORE = 0xFF, + SUMMARY_CONTEST_MOVES_WINDOW_MAX, }; -#define PSS_MOVE_NONE -1 -#define PSS_SUBSCREEN_BUTTON_NONE 0xFF +enum SummaryExtraWindowRibbons { + SUMMARY_WINDOW_RIBBON_COUNT = 0, + SUMMARY_WINDOW_RIBBON_INDEX, + SUMMARY_WINDOW_RIBBON_NAME, + SUMMARY_WINDOW_RIBBON_DESCRIPTION, -#define POINTS_PER_APPEAL_HEART 10 -#define MAX_APPEAL_HEARTS 6 -#define EMPTY_HEART_BASE_TILE 0x12E -#define FILLED_HEART_BASE_TILE 0x12C + SUMMARY_RIBBONS_WINDOW_MAX, +}; -#define GREEN_HEALTHBAR_BASE_TILE 0xC0 -#define YELLOW_HEALTHBAR_BASE_TILE 0xE0 -#define RED_HEALTHBAR_BASE_TILE 0x100 -#define PALETTE_SLOT_10_MASK 0xA000 +enum SummaryExtraWindowCondition { + SUMMARY_WINDOW_POFFIN_BUTTON_PROMPT = 0, + SUMMARY_WINDOW_FAVORITE_FOOD, + SUMMARY_WINDOW_POFFIN_FEED_MSG, -#define RIBBONS_PER_ROW 4 + SUMMARY_CONDITION_WINDOW_MAX, +}; + +enum SummarySprite { + SUMMARY_SPRITE_TAB_INFO = 0, + SUMMARY_SPRITE_TAB_MEMO, + SUMMARY_SPRITE_TAB_SKILLS, + SUMMARY_SPRITE_TAB_BATTLE_MOVES, + SUMMARY_SPRITE_TAB_CONDITION, + SUMMARY_SPRITE_TAB_CONTEST_MOVES, + SUMMARY_SPRITE_TAB_RIBBONS, + SUMMARY_SPRITE_TAB_EXIT, + SUMMARY_SPRITE_CAUGHT_BALL, + SUMMARY_SPRITE_MOVE_SELECTOR_1, + SUMMARY_SPRITE_MOVE_SELECTOR_2, + SUMMARY_SPRITE_MON_TYPE_ICON_1, + SUMMARY_SPRITE_MON_TYPE_ICON_2, + + SUMMARY_MOVE_TYPE_ICON_SPRITE_START, + SUMMARY_SPRITE_MOVE_TYPE_ICON_1 = SUMMARY_MOVE_TYPE_ICON_SPRITE_START, + SUMMARY_SPRITE_MOVE_TYPE_ICON_2, + SUMMARY_SPRITE_MOVE_TYPE_ICON_3, + SUMMARY_SPRITE_MOVE_TYPE_ICON_4, + SUMMARY_SPRITE_MOVE_TYPE_ICON_5, + SUMMARY_MOVE_TYPE_ICON_SPRITE_END = SUMMARY_SPRITE_MOVE_TYPE_ICON_5, + + SUMMARY_SPRITE_MOVE_CATEGORY_ICON, + SUMMARY_SPRITE_MON_ICON, + SUMMARY_SPRITE_STATUS_ICON, + SUMMARY_SPRITE_PAGE_ARROW_LEFT, + SUMMARY_SPRITE_PAGE_ARROW_RIGHT, + + SUMMARY_MARKING_SPRITES_START, + SUMMARY_SPRITE_MARKING_CIRCLE = SUMMARY_MARKING_SPRITES_START, + SUMMARY_SPRITE_MARKING_TRIANGLE, + SUMMARY_SPRITE_MARKING_SQUARE, + SUMMARY_SPRITE_MARKING_HEART, + SUMMARY_SPRITE_MARKING_STAR, + SUMMARY_SPRITE_MARKING_DIAMOND, + SUMMARY_MARKING_SPRITES_END = SUMMARY_SPRITE_MARKING_DIAMOND, + + SUMMARY_SHEEN_SPRITES_START, + SUMMARY_SPRITE_SHEEN_1 = SUMMARY_SHEEN_SPRITES_START, + SUMMARY_SPRITE_SHEEN_2, + SUMMARY_SPRITE_SHEEN_3, + SUMMARY_SPRITE_SHEEN_4, + SUMMARY_SPRITE_SHEEN_5, + SUMMARY_SPRITE_SHEEN_6, + SUMMARY_SPRITE_SHEEN_7, + SUMMARY_SPRITE_SHEEN_8, + SUMMARY_SPRITE_SHEEN_9, + SUMMARY_SPRITE_SHEEN_10, + SUMMARY_SPRITE_SHEEN_11, + SUMMARY_SPRITE_SHEEN_12, + SUMMARY_SHEEN_SPRITES_END = SUMMARY_SPRITE_SHEEN_12, + + SUMMARY_SPRITE_BUTTON_TAP_CIRCLE, + + SUMMARY_CONDITION_ARROW_SPRITES_START, + SUMMARY_SPRITE_CONDITION_ARROW_COOL = SUMMARY_CONDITION_ARROW_SPRITES_START, + SUMMARY_SPRITE_CONDITION_ARROW_BEAUTY, + SUMMARY_SPRITE_CONDITION_ARROW_CUTE, + SUMMARY_SPRITE_CONDITION_ARROW_SMART, + SUMMARY_SPRITE_CONDITION_ARROW_TOUGH, + SUMMARY_CONDITION_ARROW_SPRITES_END = SUMMARY_SPRITE_CONDITION_ARROW_TOUGH, + + SUMMARY_SPRITE_A_BUTTON, + SUMMARY_SPRITE_CONTEST_STAT_DOT_COOL, + SUMMARY_SPRITE_CONTEST_STAT_DOT_BEAUTY, + SUMMARY_SPRITE_CONTEST_STAT_DOT_CUTE, + SUMMARY_SPRITE_CONTEST_STAT_DOT_SMART, + SUMMARY_SPRITE_CONTEST_STAT_DOT_TOUGH, + SUMMARY_SPRITE_SHINY_ICON, + SUMMARY_SPRITE_POKERUS_CURED_ICON, + + SUMMARY_RIBBON_SPRITES_START, + SUMMARY_SPRITE_RIBBON_1 = SUMMARY_RIBBON_SPRITES_START, + SUMMARY_SPRITE_RIBBON_2, + SUMMARY_SPRITE_RIBBON_3, + SUMMARY_SPRITE_RIBBON_4, + SUMMARY_SPRITE_RIBBON_5, + SUMMARY_SPRITE_RIBBON_6, + SUMMARY_SPRITE_RIBBON_7, + SUMMARY_SPRITE_RIBBON_8, + SUMMARY_SPRITE_RIBBON_9, + SUMMARY_SPRITE_RIBBON_10, + SUMMARY_SPRITE_RIBBON_11, + SUMMARY_SPRITE_RIBBON_12, + SUMMARY_RIBBON_SPRITES_END = SUMMARY_SPRITE_RIBBON_12, + + SUMMARY_SPRITE_RIBBON_CURSOR, + SUMMARY_SPRITE_RIBBON_ARROW_UP, + SUMMARY_SPRITE_RIBBON_ARROW_DOWN, + SUMMARY_SPRITE_RIBBON_FLASH, + + SUMMARY_CONDITION_FLASH_SPRITES_START, + SUMMARY_SPRITE_CONDITION_FLASH_COOL = SUMMARY_CONDITION_FLASH_SPRITES_START, + SUMMARY_SPRITE_CONDITION_FLASH_BEAUTY, + SUMMARY_SPRITE_CONDITION_FLASH_CUTE, + SUMMARY_SPRITE_CONDITION_FLASH_SMART, + SUMMARY_SPRITE_CONDITION_FLASH_TOUGH, + SUMMARY_CONDITION_FLASH_SPRITES_END = SUMMARY_SPRITE_CONDITION_FLASH_TOUGH, + + SUMMARY_SPRITE_POKERUS_ICON, + + SUMMARY_SPRITE_MAX = 77, +}; + +enum SummaryPokerusState { + SUMMARY_POKERUS_NONE = 0, + SUMMARY_POKERUS_INFECTED, + SUMMARY_POKERUS_CURED, +}; + +enum ConditionRect { + CONDITION_RECT_Q1 = 0, + CONDITION_RECT_Q2, + CONDITION_RECT_Q3, + CONDITION_RECT_Q4, + + MAX_CONDITION_RECT +}; + +#define SUMMARY_SUBSCREEN_BUTTON_NONE 0xFF + +#define RIBBONS_PER_ROW 4 +#define RIBBONS_PER_PAGE 12 + +#define SUMMARY_TEXT_BLACK TEXT_COLOR(1, 2, 0) +#define SUMMARY_TEXT_WHITE TEXT_COLOR(15, 14, 0) +#define SUMMARY_TEXT_BLUE TEXT_COLOR(3, 4, 0) +#define SUMMARY_TEXT_RED TEXT_COLOR(5, 6, 0) +#define SUMMARY_TEXT_BLACK_DARK_SHADOW TEXT_COLOR(1, 2, 15) + +typedef struct ConditionRectangle { + VecFx16 topLeft; + VecFx16 topRight; + VecFx16 bottomLeft; + VecFx16 bottomRight; +} ConditionRectangle; typedef struct PokemonSummary { void *monData; @@ -171,7 +330,7 @@ typedef struct PokemonSummary { u8 mode; u8 max; u8 pos; - u8 pageFlag; + u8 pageFlags; u8 selectedSlot; u8 returnMode; u16 move; @@ -179,7 +338,7 @@ typedef struct PokemonSummary { u8 padding_1A[2]; u32 dexMode; - void *ribbons; + void *specialRibbons; void *poffin; ChatotCry *chatotCry; BOOL showContest; @@ -196,7 +355,7 @@ typedef struct PokemonSummaryMonData { u8 type1; u8 type2; u8 level : 7; - u8 showGender : 1; + u8 hideGender : 1; u8 gender : 2; u8 caughtBall : 6; @@ -250,7 +409,7 @@ typedef struct PokemonSummaryMonSpriteData { typedef struct PokemonSummaryScreen { BgConfig *bgConfig; - Window staticWindows[PSS_STATIC_WINDOW_MAX]; + Window staticWindows[SUMMARY_STATIC_WINDOW_MAX]; Window *extraWindows; u32 numExtraWindows; @@ -258,15 +417,15 @@ typedef struct PokemonSummaryScreen { PokemonSummaryMonData monData; PokemonSummaryMonSpriteData monSprite; - UnkStruct_02091850 unk_2F0[4]; - UnkStruct_02091850 unk_350[4]; - UnkStruct_02091850 unk_3B0[4]; - u32 unk_410; + ConditionRectangle currRects[MAX_CONDITION_RECT]; + ConditionRectangle deltaRects[MAX_CONDITION_RECT]; + ConditionRectangle maxRects[MAX_CONDITION_RECT]; + u32 conditionState; SpriteRenderer *renderer; SpriteGfxHandler *gfxHandler; - CellActor *unk_41C[77]; - CellActorData *actor[77]; + CellActor *sprites[SUMMARY_SPRITE_MAX]; + CellActorData *actor[SUMMARY_SPRITE_MAX]; UnkStruct_0200C440 *unk_684; MessageLoader *msgLoader; @@ -280,7 +439,8 @@ typedef struct PokemonSummaryScreen { s8 page; u8 cursor : 4; u8 cursorTmp : 4; - u8 subscreen; + u8 pageState; + u8 subscreenType : 4; u8 subscreenExit : 4; diff --git a/include/applications/pokemon_summary_screen/sprite.h b/include/applications/pokemon_summary_screen/sprite.h index 4bf2af12c7..19a4ec2f1d 100644 --- a/include/applications/pokemon_summary_screen/sprite.h +++ b/include/applications/pokemon_summary_screen/sprite.h @@ -5,37 +5,37 @@ #include "bg_window.h" -void sub_0208EA44(PokemonSummaryScreen *param0); -void sub_0208EAF4(PokemonSummaryScreen *param0); -void sub_0208EB14(PokemonSummaryScreen *param0); -void sub_0208EB64(PokemonSummaryScreen *param0); -void sub_0208ECF4(PokemonSummaryScreen *param0); -void sub_0208EDC4(PokemonSummaryScreen *param0); +void PokemonSummaryScreen_InitSpriteResources(PokemonSummaryScreen *summaryScreen); +void PokemonSummaryScreen_FreeSpriteResources(PokemonSummaryScreen *summaryScreen); +void PokemonSummaryScreen_UpdateArrowAndTapAnims(PokemonSummaryScreen *summaryScreen); +void PokemonSummaryScreen_SetDefaultSpriteStates(PokemonSummaryScreen *summaryScreen); +void PokemonSummaryScreen_UpdatePageTabSprites(PokemonSummaryScreen *summaryScreen); +void PokemonSummaryScreen_SetPageArrowsPos(PokemonSummaryScreen *summaryScreen); void PokemonSummaryScreen_UpdatePageArrows(PokemonSummaryScreen *summaryScreen, BOOL showArrows); -void sub_0208EE3C(PokemonSummaryScreen *param0); -void sub_0208EE9C(PokemonSummaryScreen *param0); -void sub_0208EF58(PokemonSummaryScreen *param0); -void sub_0208F16C(PokemonSummaryScreen *param0); -void sub_0208F22C(PokemonSummaryScreen *param0, u8 param1, u8 param2); +void PokemonSummaryScreen_SetCaughtBallGfx(PokemonSummaryScreen *summaryScreen); +void PokemonSummaryScreen_UpdateStatusIcon(PokemonSummaryScreen *summaryScreen); +void PokemonSummaryScreen_UpdateTypeIcons(PokemonSummaryScreen *summaryScreen); +void PokemonSummaryScreen_SetMonTypeIcons(PokemonSummaryScreen *summaryScreen); +void PokemonSummaryScreen_SwapMoveTypeIcons(PokemonSummaryScreen *summaryScreen, u8 moveIndex1, u8 moveIndex2); void PokemonSummaryScreen_UpdateMoveCategoryIcon(PokemonSummaryScreen *summaryScreen, u32 move); void PokemonSummaryScreen_UpdateMoveSelectorPos(PokemonSummaryScreen *summaryScreen); -void sub_0208F310(PokemonSummaryScreen *param0); -void sub_0208F34C(PokemonSummaryScreen *param0); +void PokemonSummaryScreen_SetMoveSelector2Pos(PokemonSummaryScreen *summaryScreen); +void PokemonSummaryScreen_InitSheenSprites(PokemonSummaryScreen *summaryScreen); void PokemonSummaryScreen_DrawSheenSprites(PokemonSummaryScreen *summaryScreen); -void sub_0208F574(PokemonSummaryScreen *param0); -void sub_0208F600(PokemonSummaryScreen *param0); -void sub_0208F684(PokemonSummaryScreen *param0); -void sub_0208F6A4(PokemonSummaryScreen *param0); +void PokemonSummaryScreen_UpdateMiscMonDataSprites(PokemonSummaryScreen *summaryScreen); +void PokemonSummaryScreen_ButtonTapAnim(PokemonSummaryScreen *summaryScreen); +void PokemonSummaryScreen_HideButtonTapCircle(PokemonSummaryScreen *summaryScreen); +void PokemonSummaryScreen_UpdateConditionArrowSprites(PokemonSummaryScreen *summaryScreen); void PokemonSummaryScreen_UpdateAButtonSprite(PokemonSummaryScreen *summaryScreen, Window *window); -void sub_0208F71C(PokemonSummaryScreen *param0); +void PokemonSummaryScreen_SetMonIcon(PokemonSummaryScreen *summaryScreen); void PokemonSummaryScreen_ShowMonIcon(PokemonSummaryScreen *summaryScreen); void PokemonSummaryScreen_DrawContestStatDots(PokemonSummaryScreen *summaryScreen); void PokemonSummaryScreen_HideContestStatDots(PokemonSummaryScreen *summaryScreen); -void sub_0208FA04(PokemonSummaryScreen *param0); +void PokemonSummaryScreen_UpdateRibbonSprites(PokemonSummaryScreen *summaryScreen); void PokemonSummaryScreen_UpdateShownRibbonRows(PokemonSummaryScreen *summaryScreen); void PokemonSummaryScreen_UpdateRibbonCursorPos(PokemonSummaryScreen *summaryScreen); -void sub_0208FB30(PokemonSummaryScreen *param0); -void sub_0208FB54(PokemonSummaryScreen *param0, u8 param1); -void sub_0208FCD4(PokemonSummaryScreen *param0); +void PokemonSummaryScreen_UpdateRibbonFlashAnim(PokemonSummaryScreen *summaryScreen); +void PokemonSummaryScreen_UpdateConditionFlashSprites(PokemonSummaryScreen *summaryScreen, BOOL showFlashes); +void PokemonSummaryScreen_UpdateConditionFlashAnim(PokemonSummaryScreen *summaryScreen); #endif // POKEPLATINUM_POKEMON_SUMMARY_SCREEN_SPRITE_H diff --git a/include/applications/pokemon_summary_screen/subscreen.h b/include/applications/pokemon_summary_screen/subscreen.h index 9feb98de00..6a36fa5e4e 100644 --- a/include/applications/pokemon_summary_screen/subscreen.h +++ b/include/applications/pokemon_summary_screen/subscreen.h @@ -7,7 +7,7 @@ void PokemonSummaryScreen_SetSubscreenType(PokemonSummaryScreen *summaryScreen); void PokemonSummaryScreen_UpdateSubscreenButtonGfx(PokemonSummaryScreen *summaryScreen); u8 PokemonSummaryScreen_CheckSubscreenButtonPress(PokemonSummaryScreen *summaryScreen); u8 PokemonSummaryScreen_DrawSubscreenButtonAnim(PokemonSummaryScreen *summaryScreen); -void PokemonSummaryScreen_CalcSubscreenButtonCirclePos(PokemonSummaryScreen *summaryScreen, s16 *outX, s16 *outY); +void PokemonSummaryScreen_CalcSubscreenButtonTapAnimPos(PokemonSummaryScreen *summaryScreen, s16 *outX, s16 *outY); u8 PokemonSummaryScreen_GetSubscreenButtonPage(PokemonSummaryScreen *summaryScreen, u8 button); #endif // POKEPLATINUM_POKEMON_SUMMARY_SCREEN_SUBSCREEN_H diff --git a/include/applications/pokemon_summary_screen/window.h b/include/applications/pokemon_summary_screen/window.h index 3524059581..5267cb8a38 100644 --- a/include/applications/pokemon_summary_screen/window.h +++ b/include/applications/pokemon_summary_screen/window.h @@ -3,25 +3,36 @@ #include "applications/pokemon_summary_screen/main.h" -void sub_0208FCF8(PokemonSummaryScreen *param0); -void sub_0208FD40(PokemonSummaryScreen *param0); +enum SummaryPoffinFeedMsg { + SUMMARY_MSG_COOLNESS_ENHANCED = 0, + SUMMARY_MSG_BEAUTY_ENHANCED, + SUMMARY_MSG_CUTENESS_ENHANCED, + SUMMARY_MSG_SMARTNESS_ENHANCED, + SUMMARY_MSG_TOUGHNESS_ENHANCED, + + SUMMARY_MSG_NOTHING_CHANGED = 0xFE, + SUMMARY_MSG_MON_WONT_EAT_MORE = 0xFF, +}; + +void PokemonSummaryScreen_DrawStaticWindows(PokemonSummaryScreen *summaryScreen); +void PokemonSummaryScreen_AddExtraWindows(PokemonSummaryScreen *summaryScreen); void PokemonSummaryScreen_RemoveExtraWindows(PokemonSummaryScreen *summaryScreen); void PokemonSummaryScreen_RemoveWindows(PokemonSummaryScreen *summaryScreen); -void sub_0208FEA4(PokemonSummaryScreen *param0); -void sub_0208FF3C(PokemonSummaryScreen *param0); -void sub_0208FFE0(PokemonSummaryScreen *param0); +void PokemonSummaryScreen_PrintNicknameAndGender(PokemonSummaryScreen *summaryScreen); +void PokemonSummaryScreen_PrintLevel(PokemonSummaryScreen *summaryScreen); +void PokemonSummaryScreen_PrintItemName(PokemonSummaryScreen *summaryScreen); void PokemonSummaryScreen_ClearAndPrintButtonPrompt(PokemonSummaryScreen *summaryScreen, u32 entryID); -void sub_020904C4(PokemonSummaryScreen *param0); +void PokemonSummaryScreen_DrawExtraWindows(PokemonSummaryScreen *summaryScreen); void PokemonSummaryScreen_PrintRibbonIndexAndMax(PokemonSummaryScreen *summaryScreen); void PokemonSummaryScreen_PrintRibbonNameAndDesc(PokemonSummaryScreen *summaryScreen); -void PokemonSummaryScreen_PrintBattleMoveInfo(PokemonSummaryScreen *summaryScreen, u32 move); -void PokemonSummaryScreen_ClearBattleInfoWindows(PokemonSummaryScreen *summaryScreen); -void ShowMoveInfoOrCancel(PokemonSummaryScreen *summaryScreen); -void HideMoveCancelText(PokemonSummaryScreen *summaryScreen); -void sub_02091474(PokemonSummaryScreen *param0); +void PokemonSummaryScreen_PrintBattleMoveAttributes(PokemonSummaryScreen *summaryScreen, u32 move); +void PokemonSummaryScreen_ClearBattleAttributeWindows(PokemonSummaryScreen *summaryScreen); +void PokemonSummaryScreen_ShowMove5OrCancel(PokemonSummaryScreen *summaryScreen); +void PokemonSummaryScreen_HideMoveCancelText(PokemonSummaryScreen *summaryScreen); +void PokemonSummaryScreen_SwapMoveNameAndPP(PokemonSummaryScreen *summaryScreen); void PokemonSummaryScreen_PrintHMMovesCantBeForgotten(PokemonSummaryScreen *summaryScreen); -void PokemonSummaryScreen_PrintContestMoveInfo(PokemonSummaryScreen *summaryScreen, u32 move); -void PokemonSummaryScreen_ClearContestInfoWindows(PokemonSummaryScreen *summaryScreen); -void PokemonSummaryScreen_PrintPoffinFeedMsg(PokemonSummaryScreen *summaryScreen, enum PSSPoffinFeedMsg msg); +void PokemonSummaryScreen_PrintContestMoveAttributes(PokemonSummaryScreen *summaryScreen, u32 move); +void PokemonSummaryScreen_ClearContestAttributeWindows(PokemonSummaryScreen *summaryScreen); +void PokemonSummaryScreen_PrintPoffinFeedMsg(PokemonSummaryScreen *summaryScreen, enum SummaryPoffinFeedMsg msg); #endif // POKEPLATINUM_POKEMON_SUMMARY_SCREEN_WINDOW_H diff --git a/include/constants/pokemon.h b/include/constants/pokemon.h index 2888e99323..941eccd959 100644 --- a/include/constants/pokemon.h +++ b/include/constants/pokemon.h @@ -24,8 +24,11 @@ enum { #define MAX_EVS_SINGLE_STAT 255 #define MAX_EVS_ALL_STATS 510 -#define MAX_POKEMON_LEVEL 100 -#define MAX_POKEMON_SHEEN 255 +#define MAX_CONTEST_STAT 255 + +#define MAX_POKEMON_SHEEN 255 +#define MAX_POKEMON_MARKINGS 6 +#define MAX_POKEMON_LEVEL 100 #define LEARNSET_NO_MOVE_TO_LEARN 0 #define LEARNSET_MOVE_ALREADY_KNOWN 0xFFFE diff --git a/include/pokemon.h b/include/pokemon.h index 305db7a518..05001bfa4c 100644 --- a/include/pokemon.h +++ b/include/pokemon.h @@ -839,7 +839,7 @@ u8 Pokemon_HasPokerus(Party *party, u8 param1); void Party_UpdatePokerusStatus(Party *party, s32 param1); void Pokemon_ValidatePokerus(Party *party); BOOL Pokemon_InfectedWithPokerus(Pokemon *mon); -BOOL Pokemon_CanSpreadPokerus(Pokemon *mon); +BOOL Pokemon_HasCuredPokerus(Pokemon *mon); /** * @brief Sets Arceus' form based on its held item. Has no effect if the given Pokemon is not an Arceus diff --git a/include/struct_defs/struct_02091850.h b/include/struct_defs/struct_02091850.h deleted file mode 100644 index 267280fb4f..0000000000 --- a/include/struct_defs/struct_02091850.h +++ /dev/null @@ -1,13 +0,0 @@ -#ifndef POKEPLATINUM_STRUCT_02091850_H -#define POKEPLATINUM_STRUCT_02091850_H - -#include - -typedef struct { - VecFx16 unk_00; - VecFx16 unk_06; - VecFx16 unk_0C; - VecFx16 unk_12; -} UnkStruct_02091850; - -#endif // POKEPLATINUM_STRUCT_02091850_H diff --git a/include/unk_020916B4.h b/include/unk_020916B4.h deleted file mode 100644 index f1a72ee775..0000000000 --- a/include/unk_020916B4.h +++ /dev/null @@ -1,16 +0,0 @@ -#ifndef POKEPLATINUM_UNK_020916B4_H -#define POKEPLATINUM_UNK_020916B4_H - -#include "applications/pokemon_summary_screen/main.h" - -void sub_020916B4(PokemonSummaryScreen *param0); -void PokemonSummaryScreen_Update3DGfx(PokemonSummaryScreen *summaryScreen); -void PokemonSummaryScreen_FreeCameraAndSpriteData(PokemonSummaryScreen *summaryScreen); -void sub_020917E0(PokemonSummaryScreen *param0); -void sub_020919E8(PokemonSummaryScreen *param0); -void sub_02091D50(PokemonSummaryScreen *param0); -void sub_02091F8C(PokemonSummaryScreen *param0); -void PokemonSummaryScreen_LoadMonAnimation(PokemonSummaryScreen *summaryScreen); -void sub_02092098(PokemonSummaryScreen *param0); - -#endif // POKEPLATINUM_UNK_020916B4_H diff --git a/platinum.us/main.lsf b/platinum.us/main.lsf index a20ae68300..102ddbbe4f 100644 --- a/platinum.us/main.lsf +++ b/platinum.us/main.lsf @@ -321,7 +321,7 @@ Static main Object main.nef.p/src_applications_pokemon_summary_screen_main.c.o Object main.nef.p/src_applications_pokemon_summary_screen_sprite.c.o Object main.nef.p/src_applications_pokemon_summary_screen_window.c.o - Object main.nef.p/src_unk_020916B4.c.o + Object main.nef.p/src_applications_pokemon_summary_screen_3d_anim.c.o Object main.nef.p/src_applications_pokemon_summary_screen_subscreen.c.o Object main.nef.p/src_ribbon.c.o Object main.nef.p/src_unk_02092494.c.o diff --git a/res/graphics/pokemon_summary_screen/balls/cherish_ball.png b/res/graphics/pokemon_summary_screen/balls/cherish_ball.png index 516785b816..e595b8cbcd 100644 Binary files a/res/graphics/pokemon_summary_screen/balls/cherish_ball.png and b/res/graphics/pokemon_summary_screen/balls/cherish_ball.png differ diff --git a/res/graphics/pokemon_summary_screen/balls/dusk_ball.png b/res/graphics/pokemon_summary_screen/balls/dusk_ball.png index 167c5a6a9a..f69f2fda07 100644 Binary files a/res/graphics/pokemon_summary_screen/balls/dusk_ball.png and b/res/graphics/pokemon_summary_screen/balls/dusk_ball.png differ diff --git a/res/graphics/pokemon_summary_screen/balls/master_ball.png b/res/graphics/pokemon_summary_screen/balls/master_ball.png index ab2b9704cf..ac9a0180f7 100644 Binary files a/res/graphics/pokemon_summary_screen/balls/master_ball.png and b/res/graphics/pokemon_summary_screen/balls/master_ball.png differ diff --git a/res/graphics/pokemon_summary_screen/balls/poke_ball.png b/res/graphics/pokemon_summary_screen/balls/poke_ball.png index 1ef8b71772..1d241da657 100644 Binary files a/res/graphics/pokemon_summary_screen/balls/poke_ball.png and b/res/graphics/pokemon_summary_screen/balls/poke_ball.png differ diff --git a/res/graphics/pokemon_summary_screen/balls/quick_ball.png b/res/graphics/pokemon_summary_screen/balls/quick_ball.png index 13f907a84e..9c4ad31000 100644 Binary files a/res/graphics/pokemon_summary_screen/balls/quick_ball.png and b/res/graphics/pokemon_summary_screen/balls/quick_ball.png differ diff --git a/res/graphics/pokemon_summary_screen/balls/repeat_ball.png b/res/graphics/pokemon_summary_screen/balls/repeat_ball.png index b8666d028b..99415687c0 100644 Binary files a/res/graphics/pokemon_summary_screen/balls/repeat_ball.png and b/res/graphics/pokemon_summary_screen/balls/repeat_ball.png differ diff --git a/res/graphics/pokemon_summary_screen/balls/safari_ball.png b/res/graphics/pokemon_summary_screen/balls/safari_ball.png index 06255499a6..a498422d24 100644 Binary files a/res/graphics/pokemon_summary_screen/balls/safari_ball.png and b/res/graphics/pokemon_summary_screen/balls/safari_ball.png differ diff --git a/res/graphics/pokemon_summary_screen/balls/ultra_ball.png b/res/graphics/pokemon_summary_screen/balls/ultra_ball.png index 2269447b18..8f7c18107a 100644 Binary files a/res/graphics/pokemon_summary_screen/balls/ultra_ball.png and b/res/graphics/pokemon_summary_screen/balls/ultra_ball.png differ diff --git a/res/graphics/pokemon_summary_screen/condition_dot_flash.png b/res/graphics/pokemon_summary_screen/condition_flash.png similarity index 100% rename from res/graphics/pokemon_summary_screen/condition_dot_flash.png rename to res/graphics/pokemon_summary_screen/condition_flash.png diff --git a/res/graphics/pokemon_summary_screen/condition_dot_flash_anim.json b/res/graphics/pokemon_summary_screen/condition_flash_anim.json similarity index 100% rename from res/graphics/pokemon_summary_screen/condition_dot_flash_anim.json rename to res/graphics/pokemon_summary_screen/condition_flash_anim.json diff --git a/res/graphics/pokemon_summary_screen/condition_dot_flash_cell.json b/res/graphics/pokemon_summary_screen/condition_flash_cell.json similarity index 100% rename from res/graphics/pokemon_summary_screen/condition_dot_flash_cell.json rename to res/graphics/pokemon_summary_screen/condition_flash_cell.json diff --git a/res/graphics/pokemon_summary_screen/condition_dot.png b/res/graphics/pokemon_summary_screen/contest_stat_dot.png similarity index 100% rename from res/graphics/pokemon_summary_screen/condition_dot.png rename to res/graphics/pokemon_summary_screen/contest_stat_dot.png diff --git a/res/graphics/pokemon_summary_screen/condition_dot_anim.json b/res/graphics/pokemon_summary_screen/contest_stat_dot_anim.json similarity index 100% rename from res/graphics/pokemon_summary_screen/condition_dot_anim.json rename to res/graphics/pokemon_summary_screen/contest_stat_dot_anim.json diff --git a/res/graphics/pokemon_summary_screen/condition_dot_cell.json b/res/graphics/pokemon_summary_screen/contest_stat_dot_cell.json similarity index 100% rename from res/graphics/pokemon_summary_screen/condition_dot_cell.json rename to res/graphics/pokemon_summary_screen/contest_stat_dot_cell.json diff --git a/res/graphics/pokemon_summary_screen/meson.build b/res/graphics/pokemon_summary_screen/meson.build index be8a636db7..0e9ae3e940 100644 --- a/res/graphics/pokemon_summary_screen/meson.build +++ b/res/graphics/pokemon_summary_screen/meson.build @@ -30,8 +30,8 @@ sprites_png_clobbersize = files( 'condition_arrow.png', 'a_button.png', 'ribbon_arrow.png', - 'condition_dot.png', - 'condition_dot_flash.png', + 'contest_stat_dot.png', + 'condition_flash.png', 'marking_circle.png', 'marking_star.png', 'marking_diamond.png', @@ -145,8 +145,8 @@ sprites_ncgr_clobbersize = ncgr_gen.process( sprites_cell_json = files( 'condition_arrow_cell.json', 'ribbon_arrow_cell.json', - 'condition_dot_cell.json', - 'condition_dot_flash_cell.json', + 'contest_stat_dot_cell.json', + 'condition_flash_cell.json', 'markings_cell.json', 'tab_arrow_cell.json', 'status_icons_cell.json', @@ -165,8 +165,8 @@ sprites_ncer = ncer_gen.process(sprites_cell_json) sprites_anim_json = files( 'condition_arrow_anim.json', 'ribbon_arrow_anim.json', - 'condition_dot_anim.json', - 'condition_dot_flash_anim.json', + 'contest_stat_dot_anim.json', + 'condition_flash_anim.json', 'markings_anim.json', 'tab_arrow_anim.json', 'status_icons_anim.json', diff --git a/res/graphics/pokemon_summary_screen/pokemon_summary_screen.order b/res/graphics/pokemon_summary_screen/pokemon_summary_screen.order index 9c144d8eee..e7946d5737 100644 --- a/res/graphics/pokemon_summary_screen/pokemon_summary_screen.order +++ b/res/graphics/pokemon_summary_screen/pokemon_summary_screen.order @@ -42,12 +42,12 @@ balls_3.NCLR ribbon_arrow_anim.NANR ribbon_arrow_cell.NCER ribbon_arrow.NCGR -condition_dot_anim.NANR -condition_dot_cell.NCER -condition_dot.NCGR -condition_dot_flash_anim.NANR -condition_dot_flash_cell.NCER -condition_dot_flash.NCGR +contest_stat_dot_anim.NANR +contest_stat_dot_cell.NCER +contest_stat_dot.NCGR +condition_flash_anim.NANR +condition_flash_cell.NCER +condition_flash.NCGR markings_anim.NANR markings_cell.NCER marking_circle.NCGR diff --git a/res/text/meson.build b/res/text/meson.build index 4107cadd97..2a74446501 100644 --- a/res/text/meson.build +++ b/res/text/meson.build @@ -209,7 +209,7 @@ message_bank_files = files( 'message_bank_contest_judge_names.gmm', 'message_bank_unk_0208.gmm', 'message_bank_unk_0209.gmm', - 'message_bank_unk_0210.gmm', + 'message_bank_contest_effects.gmm', 'message_bank_unk_0211.gmm', 'message_bank_unk_0212.gmm', 'message_bank_common_strings.gmm', @@ -609,7 +609,7 @@ message_bank_files = files( 'message_bank_unk_0609.gmm', 'message_bank_ability_names.gmm', 'message_bank_unk_0611.gmm', - 'message_bank_unk_0612.gmm', + 'message_bank_ability_descriptions.gmm', 'message_bank_unk_0613.gmm', 'message_bank_unk_0614.gmm', 'message_bank_unk_0615.gmm', diff --git a/res/text/message_bank_unk_0612.gmm b/res/text/message_bank_ability_descriptions.gmm similarity index 100% rename from res/text/message_bank_unk_0612.gmm rename to res/text/message_bank_ability_descriptions.gmm diff --git a/res/text/message_bank_unk_0210.gmm b/res/text/message_bank_contest_effects.gmm similarity index 100% rename from res/text/message_bank_unk_0210.gmm rename to res/text/message_bank_contest_effects.gmm diff --git a/res/text/message_bank_pokemon_summary_screen.gmm b/res/text/message_bank_pokemon_summary_screen.gmm index 79192bd254..437fb6a2aa 100644 --- a/res/text/message_bank_pokemon_summary_screen.gmm +++ b/res/text/message_bank_pokemon_summary_screen.gmm @@ -1,83 +1,83 @@ - + used {STRVAR_1 1, 0, 0} - + used - + used - + used {STRVAR_1 52, 0, 0} - + used Item - + used {STRVAR_1 8, 0, 0} - + used None - + used POKéMON INFO - + used Pokédex No. - + used {STRVAR_1 52, 0, 0} - + used Name - + used {STRVAR_1 0, 0, 0} - + used Type - + used OT - + used {STRVAR_1 3, 0, 0} - + used ID No. - + used {STRVAR_1 54, 0, 0} - + used Exp. Points - + used {STRVAR_1 56, 0, 0} - + used To Next Lv. @@ -86,15 +86,15 @@ XX - + used {STRVAR_1 55, 0, 0} - + used ??? - + used TRAINER MEMO @@ -438,87 +438,87 @@ used “The Egg Watch”\nIt looks like this Egg\nwill take a long time to\nhatch. - + used POKéMON SKILLS - + used HP - + used Attack - + used Defense - + used Sp. Atk - + used Sp. Def - + used Speed - + used Ability - + used / - + used {STRVAR_1 52, 0, 0} - + used {STRVAR_1 52, 0, 0} - + used {STRVAR_1 52, 0, 0} - + used {STRVAR_1 52, 0, 0} - + used {STRVAR_1 52, 0, 0} - + used {STRVAR_1 52, 0, 0} - + used {STRVAR_1 52, 0, 0} - + used {STRVAR_1 5, 0, 0} - + used CONDITION - + used SHEEN - + used BATTLE MOVES - + used INFO @@ -586,27 +586,27 @@ used {STRVAR_1 51, 0, 0} - + used CANCEL - + used POWER - + used ACCURACY - + used CATEGORY - + used {STRVAR_1 52, 0, 0} - + used {STRVAR_1 52, 0, 0} @@ -618,11 +618,11 @@ used -- - + used --- - + used OK @@ -630,31 +630,31 @@ used HM moves can’t be\nforgotten now. - + used CONTEST MOVES - + used INFO - + used OK - + used APPEAL POINTS - + used EXIT - + used Close window. - + used OK @@ -663,27 +663,27 @@ XXX - + used FAVORITE FOOD - + used Likes it {COLOR 2}spicy{COLOR 0}. - + used Likes it {COLOR 2}dry{COLOR 0}. - + used Likes it {COLOR 2}sweet{COLOR 0}. - + used Likes it {COLOR 2}bitter{COLOR 0}. - + used Likes it {COLOR 2}sour{COLOR 0}. @@ -691,39 +691,39 @@ used Eats anything. - + used Coolness was enhanced! - + used Toughness was enhanced! - + used Beauty was enhanced! - + used Cuteness was enhanced! - + used Smartness was enhanced! - + used Nothing changed! - + used It won’t eat any more... - + used RIBBONS - + used INFO @@ -731,23 +731,23 @@ used CANCEL - + used No. of Ribbons: - + used {STRVAR_1 52, 0, 0} - + used {STRVAR_1 52, 0, 0} - + used / - + used {STRVAR_1 52, 0, 0} diff --git a/res/text/message_bank_ribbon_names.gmm b/res/text/message_bank_ribbon_names.gmm index d3b31cdc4b..a23e0846f1 100644 --- a/res/text/message_bank_ribbon_names.gmm +++ b/res/text/message_bank_ribbon_names.gmm @@ -321,267 +321,267 @@ used Premier Ribbon - + used Ribbon for clearing the Pokémon League and\nentering the Hall of Fame in another region. - + used Hoenn Cool Contest\nNormal Rank winner! - + used Hoenn Cool Contest\nSuper Rank winner! - + used Hoenn Cool Contest\nHyper Rank winner! - + used Hoenn Cool Contest\nMaster Rank winner! - + used Hoenn Beauty Contest\nNormal Rank winner! - + used Hoenn Beauty Contest\nSuper Rank winner! - + used Hoenn Beauty Contest\nHyper Rank winner! - + used Hoenn Beauty Contest\nMaster Rank winner! - + used Hoenn Cute Contest\nNormal Rank winner! - + used Hoenn Cute Contest\nSuper Rank winner! - + used Hoenn Cute Contest\nHyper Rank winner! - + used Hoenn Cute Contest\nMaster Rank winner! - + used Hoenn Smart Contest\nNormal Rank winner! - + used Hoenn Smart Contest\nSuper Rank winner! - + used Hoenn Smart Contest\nHyper Rank winner! - + used Hoenn Smart Contest\nMaster Rank winner! - + used Hoenn Tough Contest\nNormal Rank winner! - + used Hoenn Tough Contest\nSuper Rank winner! - + used Hoenn Tough Contest\nHyper Rank winner! - + used Hoenn Tough Contest\nMaster Rank winner! - + used Ribbon awarded for clearing the Hoenn\nBattle Tower’s Lv. 50 challenge. - + used Ribbon awarded for clearing the Hoenn\nBattle Tower’s Lv. 100 challenge. - + used Ribbon awarded for being chosen as\na super sketch model in Hoenn. - + used Ribbon awarded for being an exceptionally\nhard worker. - + used Ribbon awarded for beating the Sinnoh\nChampion and entering the Hall of Fame. - + used Super Contest Cool Category\nNormal Rank winner! - + used Super Contest Cool Category\nGreat Rank winner! - + used Super Contest Cool Category\nUltra Rank winner! - + used Super Contest Cool Category\nMaster Rank winner! - + used Super Contest Beauty Category\nNormal Rank winner! - + used Super Contest Beauty Category\nGreat Rank winner! - + used Super Contest Beauty Category\nUltra Rank winner! - + used Super Contest Beauty Category\nMaster Rank winner! - + used Super Contest Cute Category\nNormal Rank winner! - + used Super Contest Cute Category\nGreat Rank winner! - + used Super Contest Cute Category\nUltra Rank winner! - + used Super Contest Cute Category\nMaster Rank winner! - + used Super Contest Smart Category\nNormal Rank winner! - + used Super Contest Smart Category\nGreat Rank winner! - + used Super Contest Smart Category\nUltra Rank winner! - + used Super Contest Smart Category\nMaster Rank winner! - + used Super Contest Tough Category\nNormal Rank winner! - + used Super Contest Tough Category\nGreat Rank winner! - + used Super Contest Tough Category\nUltra Rank winner! - + used Super Contest Tough Category\nMaster Rank winner! - + used A Ribbon awarded for defeating the\nTower Tycoon at the Battle Tower. - + used A Ribbon awarded for defeating the\nTower Tycoon at the Battle Tower. - + used A Ribbon awarded for completing the\nSinnoh Battle Tower Double challenge. - + used A Ribbon awarded for completing the\nSinnoh Battle Tower Multi challenge. - + used A Ribbon awarded for completing the\nSinnoh Battle Tower Link Multi challenge. - + used A Ribbon awarded for completing the\nSinnoh Wi-Fi Battle Tower challenge. - + used A Ribbon for recalling an invigorating\nevent that created life energy. - + used A Ribbon for recalling a thrilling event\nthat made life more exciting. - + used A Ribbon for recalling feelings of sadness\nthat added spice to life. - + used A Ribbon for recalling a careless error\nthat helped steer life decisions. - + used A Ribbon for recalling a refreshing\nevent that added sparkle to life. - + used A Ribbon for recalling a deep slumber\nthat made life soothing. - + used A Ribbon for recalling that smiles\nenrich the quality of life. - + used An extraordinarily gorgeous and\nextravagant Ribbon. - + used An incredibly regal Ribbon with an air\nof nobility. - + used A gorgeous and regal Ribbon that\nis the peak of fabulous. - + used A Ribbon awarded to a Pokémon deemed\nto have a top-quality footprint. - + used A Ribbon awarded for setting an\nincredible record. - + used A Ribbon awarded for setting a historical\nrecord. - + used A Ribbon awarded for setting a legendary\nrecord. @@ -713,7 +713,7 @@ used Pokémon Battle Cup\nParticipation Ribbon - + used Pokémon League\nChampion Ribbon @@ -761,11 +761,11 @@ used A Ribbon awarded for overcoming\ndifficult challenges. - + used A Ribbon awarded for overcoming all\ndifficult challenges. - + used A Ribbon awarded for winning 100\nmatches in a row. diff --git a/res/text/message_banks.order b/res/text/message_banks.order index 3b9a071ddf..a47121a679 100644 --- a/res/text/message_banks.order +++ b/res/text/message_banks.order @@ -208,7 +208,7 @@ message_bank_unk_0206 message_bank_contest_judge_names message_bank_unk_0208 message_bank_unk_0209 -message_bank_unk_0210 +message_bank_contest_effects message_bank_unk_0211 message_bank_unk_0212 message_bank_common_strings @@ -610,7 +610,7 @@ message_bank_times_of_day message_bank_unk_0609 message_bank_ability_names message_bank_unk_0611 -message_bank_unk_0612 +message_bank_ability_descriptions message_bank_unk_0613 message_bank_unk_0614 message_bank_unk_0615 diff --git a/src/applications/pokemon_summary_screen/3d_anim.c b/src/applications/pokemon_summary_screen/3d_anim.c new file mode 100644 index 0000000000..424ba9513f --- /dev/null +++ b/src/applications/pokemon_summary_screen/3d_anim.c @@ -0,0 +1,383 @@ +#include "applications/pokemon_summary_screen/3d_anim.h" + +#include +#include + +#include "constants/pokemon.h" + +#include "struct_defs/archived_sprite.h" + +#include "applications/pokemon_summary_screen/main.h" +#include "applications/pokemon_summary_screen/sprite.h" +#include "overlay115/camera_angle.h" + +#include "camera.h" +#include "gx_layers.h" +#include "pokemon.h" +#include "unk_0200762C.h" +#include "unk_02015F84.h" +#include "unk_0202419C.h" + +typedef struct { + VecFx16 max; + VecFx16 min; + VecFx16 valueLength; +} ConditionVtxBounds; + +enum ConditionState { + CONDITION_STATE_INITIAL = 0, + // the states inbetween are never referred to directly, but involve drawing the rectangles + CONDITION_STATE_FINISH_DRAW = 3, + CONDITION_STATE_FLASH, +}; + +enum ConditionRectVertices { + VTX_TOP_LEFT = 0, + VTX_TOP_RIGHT, + VTX_BOTTOM_LEFT, + VTX_BOTTOM_RIGHT, + + MAX_CONDITION_RECT_VTX +}; + +static void DrawConditionRects(ConditionRectangle *rect); +static void UpdateConditionVec(VecFx16 *currVec, VecFx16 *deltaVec); +static void UpdateConditionRectsOrFlash(PokemonSummaryScreen *summaryScreen); +static void SetConditionVecFromStat(const ConditionVtxBounds *bounds, VecFx16 *outVec, u8 statValue); +static void SetConditionVecDifference(VecFx16 *startVec, VecFx16 *endVec, VecFx16 *outVec); + +static const ConditionVtxBounds sConditionRectBounds[][MAX_CONDITION_RECT_VTX] = { + [CONDITION_RECT_Q1] = { + [VTX_TOP_LEFT] = { + .max = { 5138, 3784, 0 }, + .min = { 5138, 735, 0 }, + .valueLength = { 0, 12, 0 }, + }, + [VTX_TOP_RIGHT] = { + .max = { 8344, 965, 0 }, + .min = { 5538, 383, 0 }, + .valueLength = { 11, 2, 0 }, + }, + [VTX_BOTTOM_LEFT] = { + .max = { 7079, -2955, 0 }, + .min = { 5380, -106, 0 }, + .valueLength = { 7, -11, 0 }, + }, + [VTX_BOTTOM_RIGHT] = { + .max = { 5138, 300, 0 }, + .min = { 5138, 300, 0 }, + .valueLength = { 0, 0, 0 }, + }, + }, + [CONDITION_RECT_Q2] = { + [VTX_TOP_LEFT] = { + .max = { 1843, 965, 0 }, + .min = { 4645, 383, 0 }, + .valueLength = { -11, 2, 0 }, + }, + [VTX_TOP_RIGHT] = { + .max = { 5045, 3784, 0 }, + .min = { 5045, 735, 0 }, + .valueLength = { 0, 12, 0 }, + }, + [VTX_BOTTOM_LEFT] = { + .max = { 5045, 300, 0 }, + .min = { 5045, 300, 0 }, + .valueLength = { 0, 0, 0 }, + }, + [VTX_BOTTOM_RIGHT] = { + .max = { 3106, -2955, 0 }, + .min = { 4803, -106, 0 }, + .valueLength = { -7, -11, 0 }, + }, + }, + [CONDITION_RECT_Q3] = { + [VTX_TOP_LEFT] = { + .max = { 1843, 965, 0 }, + .min = { 4645, 383, 0 }, + .valueLength = { -11, 2, 0 }, + }, + [VTX_TOP_RIGHT] = { + .max = { 5045, 300, 0 }, + .min = { 5045, 300, 0 }, + .valueLength = { 0, 0, 0 }, + }, + [VTX_BOTTOM_LEFT] = { + .max = { 7079, -2955, 0 }, + .min = { 5299, -106, 0 }, + .valueLength = { 7, -11, 0 }, + }, + [VTX_BOTTOM_RIGHT] = { + .max = { 3106, -2955, 0 }, + .min = { 4803, -106, 0 }, + .valueLength = { -7, -11, 0 }, + }, + }, + [CONDITION_RECT_Q4] = { + [VTX_TOP_LEFT] = { + .max = { 5138, 300, 0 }, + .min = { 5138, 300, 0 }, + .valueLength = { 0, 0, 0 }, + }, + [VTX_TOP_RIGHT] = { + .max = { 8344, 965, 0 }, + .min = { 5538, 383, 0 }, + .valueLength = { 11, 2, 0 }, + }, + [VTX_BOTTOM_LEFT] = { + .max = { 7079, -2955, 0 }, + .min = { 5380, -106, 0 }, + .valueLength = { 7, -11, 0 }, + }, + [VTX_BOTTOM_RIGHT] = { + .max = { 3106, -2955, 0 }, + .min = { 4884, -106, 0 }, + .valueLength = { -7, -11, 0 }, + }, + }, +}; + +void PokemonSummaryScreen_Setup3DGfx(PokemonSummaryScreen *summaryScreen) +{ + NNS_G3dInit(); + + G3X_Init(); + G3X_InitMtxStack(); + G3X_SetShading(GX_SHADING_TOON); + G3X_AlphaTest(0, 0); + G3X_AlphaBlend(1); + G3X_AntiAlias(1); + G3X_EdgeMarking(0); + G3X_SetFog(0, 0, 0, 0); + G3X_SetClearColor(0, 0, 0x7FFF, 63, 0); + G3_SwapBuffers(GX_SORTMODE_AUTO, GX_BUFFERMODE_Z); + G3_ViewPort(0, 0, 255, 191); + + GXLayers_EngineAToggleLayers(GX_PLANEMASK_BG0, 1); + + G2_SetBG0Priority(2); +} + +void PokemonSummaryScreen_Update3DGfx(PokemonSummaryScreen *summaryScreen) +{ + if (summaryScreen->page == SUMMARY_PAGE_CONDITION) { + sub_020241B4(); + Camera_ComputeViewMatrix(); + + G3_MtxMode(GX_MTXMODE_PROJECTION); + G3_Identity(); + G3_MtxMode(GX_MTXMODE_POSITION_VECTOR); + G3_Identity(); + + NNS_G3dGlbFlush(); + DrawConditionRects(summaryScreen->currRects); + NNS_G3dGlbFlush(); + UpdateConditionRectsOrFlash(summaryScreen); + } + + NNS_G2dSetupSoftwareSpriteCamera(); + sub_02007768(summaryScreen->monSprite.spriteManager); + + G3_SwapBuffers(GX_SORTMODE_MANUAL, GX_BUFFERMODE_Z); +} + +void PokemonSummaryScreen_FreeCameraAndMonSprite(PokemonSummaryScreen *summaryScreen) +{ + Camera_Delete(summaryScreen->monSprite.camera); + sub_02016114(summaryScreen->monSprite.animationSys, 0); + sub_02015FB8(summaryScreen->monSprite.animationSys); + sub_02007B6C(summaryScreen->monSprite.spriteManager); +} + +void PokemonSummaryScreen_SetupCamera(PokemonSummaryScreen *summaryScreen) +{ + VecFx32 pos = { 0, 0, 0x10000 }; + CameraAngle angle = { 0, 0, 0 }; + fx32 distance = 0x10000; + u16 fovY = 0x5C1; + + summaryScreen->monSprite.camera = Camera_Alloc(HEAP_ID_POKEMON_SUMMARY_SCREEN); + + Camera_InitWithPosition(&pos, distance, &angle, fovY, 1, summaryScreen->monSprite.camera); + Camera_SetClipping(0, FX32_CONST(100), summaryScreen->monSprite.camera); + Camera_ReleaseTarget(summaryScreen->monSprite.camera); + Camera_SetAsActive(summaryScreen->monSprite.camera); +} + +static void DrawConditionRects(ConditionRectangle *rects) +{ + G3_PolygonAttr(GX_LIGHTMASK_NONE, GX_POLYGONMODE_MODULATE, GX_CULL_NONE, 18, 20, 0); + G3_Begin(GX_BEGIN_QUADS); + + for (u32 i = 0; i < MAX_CONDITION_RECT; i++) { + G3_Color(GX_RGB(8, 31, 15)); + G3_Vtx(rects[i].topLeft.x, rects[i].topLeft.y, rects[i].topLeft.z); + G3_Color(GX_RGB(8, 31, 15)); + G3_Vtx(rects[i].topRight.x, rects[i].topRight.y, rects[i].topRight.z); + G3_Color(GX_RGB(8, 31, 15)); + G3_Vtx(rects[i].bottomRight.x, rects[i].bottomRight.y, rects[i].bottomRight.z); + G3_Color(GX_RGB(8, 31, 15)); + G3_Vtx(rects[i].bottomLeft.x, rects[i].bottomLeft.y, rects[i].bottomLeft.z); + } + + G3_End(); +} + +static void UpdateConditionVec(VecFx16 *currVec, VecFx16 *deltaVec) +{ + currVec->x += deltaVec->x; + currVec->y += deltaVec->y; + currVec->z += deltaVec->z; +} + +static void UpdateConditionRectsOrFlash(PokemonSummaryScreen *summaryScreen) +{ + if (summaryScreen->conditionState == CONDITION_STATE_FLASH) { + PokemonSummaryScreen_UpdateConditionFlashAnim(summaryScreen); + return; + } + + u32 i; + + if (summaryScreen->conditionState == CONDITION_STATE_FINISH_DRAW) { + for (i = 0; i < MAX_CONDITION_RECT; i++) { + summaryScreen->currRects[i] = summaryScreen->maxRects[i]; + } + } else { + for (i = 0; i < MAX_CONDITION_RECT; i++) { + UpdateConditionVec(&summaryScreen->currRects[i].topLeft, &summaryScreen->deltaRects[i].topLeft); + UpdateConditionVec(&summaryScreen->currRects[i].topRight, &summaryScreen->deltaRects[i].topRight); + UpdateConditionVec(&summaryScreen->currRects[i].bottomLeft, &summaryScreen->deltaRects[i].bottomLeft); + UpdateConditionVec(&summaryScreen->currRects[i].bottomRight, &summaryScreen->deltaRects[i].bottomRight); + } + } + + summaryScreen->conditionState++; + + if (summaryScreen->conditionState == CONDITION_STATE_FLASH) { + PokemonSummaryScreen_UpdateConditionFlashSprites(summaryScreen, TRUE); + } else { + PokemonSummaryScreen_UpdateConditionFlashSprites(summaryScreen, FALSE); + } +} + +void PokemonSummaryScreen_InitConditionRects(PokemonSummaryScreen *summaryScreen) +{ + if (summaryScreen->page != SUMMARY_PAGE_CONDITION) { + return; + } + + summaryScreen->currRects[CONDITION_RECT_Q1].topLeft = sConditionRectBounds[CONDITION_RECT_Q1][VTX_BOTTOM_RIGHT].min; + summaryScreen->currRects[CONDITION_RECT_Q1].topRight = sConditionRectBounds[CONDITION_RECT_Q1][VTX_BOTTOM_RIGHT].min; + summaryScreen->currRects[CONDITION_RECT_Q1].bottomLeft = sConditionRectBounds[CONDITION_RECT_Q1][VTX_BOTTOM_RIGHT].min; + summaryScreen->currRects[CONDITION_RECT_Q1].bottomRight = sConditionRectBounds[CONDITION_RECT_Q1][VTX_BOTTOM_RIGHT].min; + + summaryScreen->currRects[CONDITION_RECT_Q2].topLeft = sConditionRectBounds[CONDITION_RECT_Q2][VTX_BOTTOM_LEFT].min; + summaryScreen->currRects[CONDITION_RECT_Q2].topRight = sConditionRectBounds[CONDITION_RECT_Q2][VTX_BOTTOM_LEFT].min; + summaryScreen->currRects[CONDITION_RECT_Q2].bottomLeft = sConditionRectBounds[CONDITION_RECT_Q2][VTX_BOTTOM_LEFT].min; + summaryScreen->currRects[CONDITION_RECT_Q2].bottomRight = sConditionRectBounds[CONDITION_RECT_Q2][VTX_BOTTOM_LEFT].min; + + summaryScreen->currRects[CONDITION_RECT_Q3].topLeft = sConditionRectBounds[CONDITION_RECT_Q3][VTX_TOP_RIGHT].min; + summaryScreen->currRects[CONDITION_RECT_Q3].topRight = sConditionRectBounds[CONDITION_RECT_Q3][VTX_TOP_RIGHT].min; + summaryScreen->currRects[CONDITION_RECT_Q3].bottomLeft = sConditionRectBounds[CONDITION_RECT_Q3][VTX_TOP_RIGHT].min; + summaryScreen->currRects[CONDITION_RECT_Q3].bottomRight = sConditionRectBounds[CONDITION_RECT_Q3][VTX_TOP_RIGHT].min; + + summaryScreen->currRects[CONDITION_RECT_Q4].topLeft = sConditionRectBounds[CONDITION_RECT_Q4][VTX_TOP_LEFT].min; + summaryScreen->currRects[CONDITION_RECT_Q4].topRight = sConditionRectBounds[CONDITION_RECT_Q4][VTX_TOP_LEFT].min; + summaryScreen->currRects[CONDITION_RECT_Q4].bottomLeft = sConditionRectBounds[CONDITION_RECT_Q4][VTX_TOP_LEFT].min; + summaryScreen->currRects[CONDITION_RECT_Q4].bottomRight = sConditionRectBounds[CONDITION_RECT_Q4][VTX_TOP_LEFT].min; + + PokemonSummaryScreen_InitMaxAndDeltaConditionRects(summaryScreen); +} + +static void SetConditionVecFromStat(const ConditionVtxBounds *bounds, VecFx16 *outVec, u8 statValue) +{ + if (statValue == MAX_CONTEST_STAT) { + *outVec = bounds->max; + } else if (statValue == 0) { + *outVec = bounds->min; + } else { + outVec->x = bounds->min.x + bounds->valueLength.x * statValue; + outVec->y = bounds->min.y + bounds->valueLength.y * statValue; + outVec->z = bounds->min.z + bounds->valueLength.z * statValue; + } +} + +static void SetConditionVecDifference(VecFx16 *startVec, VecFx16 *endVec, VecFx16 *outVec) +{ + outVec->x = FX_F32_TO_FX16(FX_FX16_TO_F32(endVec->x - startVec->x) / 4); + outVec->y = FX_F32_TO_FX16(FX_FX16_TO_F32(endVec->y - startVec->y) / 4); + outVec->z = FX_F32_TO_FX16(FX_FX16_TO_F32(endVec->z - startVec->z) / 4); +} + +void PokemonSummaryScreen_InitMaxAndDeltaConditionRects(PokemonSummaryScreen *summaryScreen) +{ + SetConditionVecFromStat(&sConditionRectBounds[CONDITION_RECT_Q1][VTX_TOP_LEFT], &summaryScreen->maxRects[CONDITION_RECT_Q1].topLeft, summaryScreen->monData.cool); + SetConditionVecFromStat(&sConditionRectBounds[CONDITION_RECT_Q1][VTX_TOP_RIGHT], &summaryScreen->maxRects[CONDITION_RECT_Q1].topRight, summaryScreen->monData.beauty); + SetConditionVecFromStat(&sConditionRectBounds[CONDITION_RECT_Q1][VTX_BOTTOM_LEFT], &summaryScreen->maxRects[CONDITION_RECT_Q1].bottomRight, summaryScreen->monData.cute); + SetConditionVecFromStat(&sConditionRectBounds[CONDITION_RECT_Q1][VTX_BOTTOM_RIGHT], &summaryScreen->maxRects[CONDITION_RECT_Q1].bottomLeft, 0); + + SetConditionVecFromStat(&sConditionRectBounds[CONDITION_RECT_Q2][VTX_TOP_LEFT], &summaryScreen->maxRects[CONDITION_RECT_Q2].topLeft, summaryScreen->monData.tough); + SetConditionVecFromStat(&sConditionRectBounds[CONDITION_RECT_Q2][VTX_TOP_RIGHT], &summaryScreen->maxRects[CONDITION_RECT_Q2].topRight, summaryScreen->monData.cool); + SetConditionVecFromStat(&sConditionRectBounds[CONDITION_RECT_Q2][VTX_BOTTOM_LEFT], &summaryScreen->maxRects[CONDITION_RECT_Q2].bottomRight, 0); + SetConditionVecFromStat(&sConditionRectBounds[CONDITION_RECT_Q2][VTX_BOTTOM_RIGHT], &summaryScreen->maxRects[CONDITION_RECT_Q2].bottomLeft, summaryScreen->monData.smart); + + SetConditionVecFromStat(&sConditionRectBounds[CONDITION_RECT_Q3][VTX_TOP_LEFT], &summaryScreen->maxRects[CONDITION_RECT_Q3].topLeft, summaryScreen->monData.tough); + SetConditionVecFromStat(&sConditionRectBounds[CONDITION_RECT_Q3][VTX_TOP_RIGHT], &summaryScreen->maxRects[CONDITION_RECT_Q3].topRight, 0); + SetConditionVecFromStat(&sConditionRectBounds[CONDITION_RECT_Q3][VTX_BOTTOM_LEFT], &summaryScreen->maxRects[CONDITION_RECT_Q3].bottomRight, summaryScreen->monData.cute); + SetConditionVecFromStat(&sConditionRectBounds[CONDITION_RECT_Q3][VTX_BOTTOM_RIGHT], &summaryScreen->maxRects[CONDITION_RECT_Q3].bottomLeft, summaryScreen->monData.smart); + + SetConditionVecFromStat(&sConditionRectBounds[CONDITION_RECT_Q4][VTX_TOP_LEFT], &summaryScreen->maxRects[CONDITION_RECT_Q4].topLeft, 0); + SetConditionVecFromStat(&sConditionRectBounds[CONDITION_RECT_Q4][VTX_TOP_RIGHT], &summaryScreen->maxRects[CONDITION_RECT_Q4].topRight, summaryScreen->monData.beauty); + SetConditionVecFromStat(&sConditionRectBounds[CONDITION_RECT_Q4][VTX_BOTTOM_LEFT], &summaryScreen->maxRects[CONDITION_RECT_Q4].bottomRight, summaryScreen->monData.cute); + SetConditionVecFromStat(&sConditionRectBounds[CONDITION_RECT_Q4][VTX_BOTTOM_RIGHT], &summaryScreen->maxRects[CONDITION_RECT_Q4].bottomLeft, summaryScreen->monData.smart); + + for (u32 i = 0; i < MAX_CONDITION_RECT; i++) { + SetConditionVecDifference(&summaryScreen->currRects[i].topLeft, &summaryScreen->maxRects[i].topLeft, &summaryScreen->deltaRects[i].topLeft); + SetConditionVecDifference(&summaryScreen->currRects[i].topRight, &summaryScreen->maxRects[i].topRight, &summaryScreen->deltaRects[i].topRight); + SetConditionVecDifference(&summaryScreen->currRects[i].bottomLeft, &summaryScreen->maxRects[i].bottomLeft, &summaryScreen->deltaRects[i].bottomLeft); + SetConditionVecDifference(&summaryScreen->currRects[i].bottomRight, &summaryScreen->maxRects[i].bottomRight, &summaryScreen->deltaRects[i].bottomRight); + } + + summaryScreen->conditionState = CONDITION_STATE_INITIAL; +} + +void PokemonSummaryScreen_LoadMonSprite(PokemonSummaryScreen *summaryScreen) +{ + summaryScreen->monSprite.spriteManager = sub_0200762C(HEAP_ID_POKEMON_SUMMARY_SCREEN); + + void *monData = PokemonSummaryScreen_MonData(summaryScreen); + + ArchivedSprite sprite; + + if (summaryScreen->data->dataType == SUMMARY_DATA_BOX_MON) { + BoxPokemon_BuildArchivedSprite(&sprite, monData, 2, 0); + } else { + Pokemon_BuildArchivedSprite(&sprite, monData, 2); + } + + PokeSprite_LoadAnimationFrames(summaryScreen->narcPlPokeData, summaryScreen->monSprite.frames, summaryScreen->monData.species, 1); + + summaryScreen->monSprite.flip = PokemonPersonalData_GetFormValue(summaryScreen->monData.species, summaryScreen->monData.form, 28) ^ 1; + summaryScreen->monSprite.sprite = sub_02007C34(summaryScreen->monSprite.spriteManager, &sprite, 52, 104, 0, 0, summaryScreen->monSprite.frames, NULL); + + sub_02007DEC(summaryScreen->monSprite.sprite, 35, summaryScreen->monSprite.flip); +} + +void PokemonSummaryScreen_LoadMonAnimation(PokemonSummaryScreen *summaryScreen) +{ + if (summaryScreen->monData.isEgg != FALSE) { + PokeSprite_LoadAnimation(summaryScreen->narcPlPokeData, summaryScreen->monSprite.animationSys, summaryScreen->monSprite.sprite, 0, 2, summaryScreen->monSprite.flip, 0); + } else { + sub_02007B98(summaryScreen->monSprite.sprite, 1); + PokeSprite_LoadAnimation(summaryScreen->narcPlPokeData, summaryScreen->monSprite.animationSys, summaryScreen->monSprite.sprite, summaryScreen->monData.species, 2, summaryScreen->monSprite.flip, 0); + } +} + +void PokemonSummaryScreen_ChangeMonSprite(PokemonSummaryScreen *summaryScreen) +{ + sub_02016114(summaryScreen->monSprite.animationSys, 0); + sub_02007B6C(summaryScreen->monSprite.spriteManager); + PokemonSummaryScreen_LoadMonSprite(summaryScreen); + PokemonSummaryScreen_LoadMonAnimation(summaryScreen); +} diff --git a/src/applications/pokemon_summary_screen/main.c b/src/applications/pokemon_summary_screen/main.c index bec27a2fd9..22ff76475b 100644 --- a/src/applications/pokemon_summary_screen/main.c +++ b/src/applications/pokemon_summary_screen/main.c @@ -13,10 +13,12 @@ #include "struct_defs/struct_02099F80.h" +#include "applications/pokemon_summary_screen/3d_anim.h" #include "applications/pokemon_summary_screen/main.h" #include "applications/pokemon_summary_screen/sprite.h" #include "applications/pokemon_summary_screen/subscreen.h" #include "applications/pokemon_summary_screen/window.h" +#include "graphics/pokemon_summary_screen/pl_pst_gra.naix" #include "text/gmm/message_bank_pokemon_summary_screen.h" #include "text/pl_msg.naix" @@ -56,15 +58,71 @@ #include "unk_0201E3D8.h" #include "unk_020393C8.h" #include "unk_0208C098.h" -#include "unk_020916B4.h" #include "unk_02094EDC.h" #include "unk_020989DC.h" #include "vars_flags.h" #include "constdata/const_020F410C.h" +enum SummaryState { + SUMMARY_STATE_TRANSITION_IN = 0, + SUMMARY_STATE_WAIT_TRANSITION, + SUMMARY_STATE_HANDLE_INPUT, + SUMMARY_STATE_SETUP_BATTLE_MOVE_INFO, + SUMMARY_STATE_HIDE_BATTLE_MOVE_INFO, + SUMMARY_STATE_SETUP_CONTEST_MOVE_INFO, + SUMMARY_STATE_HIDE_CONTEST_MOVE_INFO, + SUMMARY_STATE_MOVE_SELECT, + SUMMARY_STATE_MOVE_SWAP, + SUMMARY_STATE_LEARN_MOVE, + SUMMARY_STATE_WAIT_HM_MSG_INPUT, + SUMMARY_STATE_SETUP_RIBBON_INFO, + SUMMARY_STATE_HIDE_RIBBON_INFO, + SUMMARY_STATE_RIBBON_SELECT, + SUMMARY_STATE_SUBSCREEN_INPUT, + SUMMARY_STATE_SETUP_POFFIN_FEED, + SUMMARY_STATE_PRINT_CONTEST_STAT_MSGS, + SUMMARY_STATE_WAIT_FINISH_POFFIN_FEED, + SUMMARY_STATE_TRANSITION_OUT, + SUMMARY_STATE_WAIT_EXIT, +}; + +enum SummaryPageState { + PAGE_STATE_INITIAL = 0, + PAGE_STATE_SCROLLING, + PAGE_STATE_SCROLL_FINISHED, +}; + +// also used by pageState, specifically for the condition page +#define STAT_INCREASE_NONE 0 +#define COOL_INCREASED (1 << 0) +#define BEAUTY_INCREASED (1 << 1) +#define CUTE_INCREASED (1 << 2) +#define SMART_INCREASED (1 << 3) +#define TOUGH_INCREASED (1 << 4) + #define HEAP_ALLOCATION_SIZE 0x40000 +#define SUMMARY_MOVE_NONE -1 + +#define POINTS_PER_APPEAL_HEART 10 +#define MAX_APPEAL_HEARTS 6 +#define EMPTY_HEART_BASE_TILE 0x12E +#define FILLED_HEART_BASE_TILE 0x12C + +#define HEALTHBAR_BASE_X 24 +#define HEALTHBAR_Y 6 +#define GREEN_HEALTHBAR_BASE_TILE 0xC0 +#define YELLOW_HEALTHBAR_BASE_TILE 0xE0 +#define RED_HEALTHBAR_BASE_TILE 0x100 +#define HEALTHBAR_TILES_MAX 6 +#define PALETTE_SLOT_10_MASK 0xA000 + +#define EXPBAR_BASE_X 23 +#define EXPBAR_Y 23 +#define EXPBAR_BASE_TILE 0xAC +#define EXPBAR_TILES_MAX 7 + static int PokemonSummaryScreen_Init(OverlayManager *ovyManager, int *state); static int PokemonSummaryScreen_Main(OverlayManager *ovyManager, int *state); static int PokemonSummaryScreen_Exit(OverlayManager *ovyManager, int *state); @@ -115,11 +173,11 @@ static s8 TryAdvanceBoxMonIndex(PokemonSummaryScreen *summaryScreen, s8 delta); static u8 SetupBattleMoveInfo(PokemonSummaryScreen *summaryScreen); static u8 HideBattleMoveInfo(PokemonSummaryScreen *summaryScreen); static u8 TryChangeSelectedMove(PokemonSummaryScreen *summaryScreen, s8 delta); -static void UpdateMoveInfo(PokemonSummaryScreen *summaryScreen); +static void UpdateMoveAttributes(PokemonSummaryScreen *summaryScreen); static void SwapSelectedMoves(PokemonSummaryScreen *summaryScreen); static void SetupMoveInfoNoTransition(PokemonSummaryScreen *summaryScreen); -static void UpdateBattleMoveInfo(PokemonSummaryScreen *summaryScreen, u32 move); -static void UpdateContestMoveInfo(PokemonSummaryScreen *summaryScreen, u32 move); +static void UpdateBattleMoveAttributes(PokemonSummaryScreen *summaryScreen, u32 move); +static void UpdateContestMoveAttributes(PokemonSummaryScreen *summaryScreen, u32 move); static void ClearMoveInfoWindows(PokemonSummaryScreen *summaryScreen); static void SetupMoveInfoFromSubscreenButton(PokemonSummaryScreen *summaryScreen); static u8 SetupContestMoveInfo(PokemonSummaryScreen *summaryScreen); @@ -178,18 +236,18 @@ static int PokemonSummaryScreen_Init(OverlayManager *ovyManager, int *state) SetupBgs(summaryScreen->bgConfig); LoadBgGraphics(summaryScreen, narc); SetAlphaBlending(); - sub_020916B4(summaryScreen); + PokemonSummaryScreen_Setup3DGfx(summaryScreen); InitializeStringsAndCopyOTName(summaryScreen); SetMonData(summaryScreen); - sub_0208EA44(summaryScreen); - sub_0208EB64(summaryScreen); - sub_02091F8C(summaryScreen); - sub_0208EE3C(summaryScreen); - sub_0208EE9C(summaryScreen); - sub_0208FCF8(summaryScreen); + PokemonSummaryScreen_InitSpriteResources(summaryScreen); + PokemonSummaryScreen_SetDefaultSpriteStates(summaryScreen); + PokemonSummaryScreen_LoadMonSprite(summaryScreen); + PokemonSummaryScreen_SetCaughtBallGfx(summaryScreen); + PokemonSummaryScreen_UpdateStatusIcon(summaryScreen); + PokemonSummaryScreen_DrawStaticWindows(summaryScreen); SetupInitialPageGfx(summaryScreen); PokemonSummaryScreen_SetSubscreenType(summaryScreen); - sub_020917E0(summaryScreen); + PokemonSummaryScreen_SetupCamera(summaryScreen); SetMainCallback(PokemonSummaryScreenVBlank, summaryScreen); GXLayers_TurnBothDispOn(); sub_02004550(61, 0, 0); @@ -204,74 +262,74 @@ static int PokemonSummaryScreen_Main(OverlayManager *ovyManager, int *state) PokemonSummaryScreen *summaryScreen = OverlayManager_Data(ovyManager); switch (*state) { - case PSS_STATE_TRANSITION_IN: + case SUMMARY_STATE_TRANSITION_IN: sub_0208C120(0, 19); - *state = PSS_STATE_WAIT_TRANSITION; + *state = SUMMARY_STATE_WAIT_TRANSITION; break; - case PSS_STATE_WAIT_TRANSITION: + case SUMMARY_STATE_WAIT_TRANSITION: *state = WaitSummaryScreenTransition(summaryScreen); break; - case PSS_STATE_HANDLE_INPUT: + case SUMMARY_STATE_HANDLE_INPUT: *state = HandleInput_Main(summaryScreen); break; - case PSS_STATE_SETUP_BATTLE_MOVE_INFO: + case SUMMARY_STATE_SETUP_BATTLE_MOVE_INFO: *state = WaitSetupBattleMoveInfo(summaryScreen); break; - case PSS_STATE_HIDE_BATTLE_MOVE_INFO: + case SUMMARY_STATE_HIDE_BATTLE_MOVE_INFO: *state = WaitHideBattleMoveInfo(summaryScreen); break; - case PSS_STATE_SETUP_CONTEST_MOVE_INFO: + case SUMMARY_STATE_SETUP_CONTEST_MOVE_INFO: *state = WaitSetupContestMoveInfo(summaryScreen); break; - case PSS_STATE_HIDE_CONTEST_MOVE_INFO: + case SUMMARY_STATE_HIDE_CONTEST_MOVE_INFO: *state = WaitHideContestMoveInfo(summaryScreen); break; - case PSS_STATE_MOVE_SELECT: + case SUMMARY_STATE_MOVE_SELECT: *state = HandleInput_MoveSelect(summaryScreen); break; - case PSS_STATE_MOVE_SWAP: + case SUMMARY_STATE_MOVE_SWAP: *state = HandleInput_MoveSwap(summaryScreen); break; - case PSS_STATE_LEARN_MOVE: + case SUMMARY_STATE_LEARN_MOVE: *state = HandleInput_LearnMove(summaryScreen); break; - case PSS_STATE_WAIT_HM_MSG_INPUT: + case SUMMARY_STATE_WAIT_HM_MSG_INPUT: *state = WaitForHMMsgInput(summaryScreen); break; - case PSS_STATE_SETUP_RIBBON_INFO: + case SUMMARY_STATE_SETUP_RIBBON_INFO: *state = WaitSetupRibbonInfo(summaryScreen); break; - case PSS_STATE_HIDE_RIBBON_INFO: + case SUMMARY_STATE_HIDE_RIBBON_INFO: *state = WaitHideRibbonInfo(summaryScreen); break; - case PSS_STATE_RIBBON_SELECT: + case SUMMARY_STATE_RIBBON_SELECT: *state = HandleInput_RibbonSelect(summaryScreen); break; - case PSS_STATE_SUBSCREEN_INPUT: + case SUMMARY_STATE_SUBSCREEN_INPUT: *state = HandleInput_Subscreen(summaryScreen); break; - case PSS_STATE_SETUP_POFFIN_FEED: + case SUMMARY_STATE_SETUP_POFFIN_FEED: *state = SetupPoffinFeedConditionPage(summaryScreen); break; - case PSS_STATE_PRINT_CONTEST_STAT_MSGS: + case SUMMARY_STATE_PRINT_CONTEST_STAT_MSGS: *state = PrintContestStatChangeMsgs(summaryScreen); break; - case PSS_STATE_WAIT_FINISH_POFFIN_FEED: + case SUMMARY_STATE_WAIT_FINISH_POFFIN_FEED: *state = WaitForPoffinFeedMsgInput(summaryScreen); break; - case PSS_STATE_TRANSITION_OUT: + case SUMMARY_STATE_TRANSITION_OUT: *state = SummaryScreenTransitionOut(summaryScreen); break; - case PSS_STATE_WAIT_EXIT: + case SUMMARY_STATE_WAIT_EXIT: if (ScreenTransitionIsDone(summaryScreen) == TRUE) { return TRUE; } break; } - sub_0208EB14(summaryScreen); + PokemonSummaryScreen_UpdateArrowAndTapAnims(summaryScreen); PokemonSummaryScreen_DrawSheenSprites(summaryScreen); - sub_0208FB30(summaryScreen); + PokemonSummaryScreen_UpdateRibbonFlashAnim(summaryScreen); sub_0200C7EC(summaryScreen->gfxHandler); PokemonSummaryScreen_Update3DGfx(summaryScreen); @@ -283,8 +341,8 @@ static int PokemonSummaryScreen_Exit(OverlayManager *ovyManager, int *state) PokemonSummaryScreen *summaryScreen = OverlayManager_Data(ovyManager); SetMainCallback(NULL, NULL); - PokemonSummaryScreen_FreeCameraAndSpriteData(summaryScreen); - sub_0208EAF4(summaryScreen); + PokemonSummaryScreen_FreeCameraAndMonSprite(summaryScreen); + PokemonSummaryScreen_FreeSpriteResources(summaryScreen); PokemonSummaryScreen_RemoveWindows(summaryScreen); TeardownBgs(summaryScreen->bgConfig); sub_0201E530(); @@ -379,7 +437,7 @@ static void SetupBgs(BgConfig *bgConfig) Bg_InitFromTemplate(bgConfig, BG_LAYER_MAIN_2, &bgMain2, BG_TYPE_STATIC); Bg_ClearTilemap(bgConfig, BG_LAYER_MAIN_2); - Bg_ScheduleScroll(bgConfig, BG_LAYER_MAIN_2, 0, 136); + Bg_ScheduleScroll(bgConfig, BG_LAYER_MAIN_2, BG_OFFSET_UPDATE_SET_X, 136); BgTemplate bgMain3 = { .x = 0, @@ -456,16 +514,16 @@ static void TeardownBgs(BgConfig *bgConfig) static void LoadBgGraphics(PokemonSummaryScreen *summaryScreen, NARC *narc) { - Graphics_LoadTilesToBgLayerFromOpenNARC(narc, 0, summaryScreen->bgConfig, BG_LAYER_MAIN_3, 0, 0, FALSE, HEAP_ID_POKEMON_SUMMARY_SCREEN); - Graphics_LoadTilemapToBgLayerFromOpenNARC(narc, 3, summaryScreen->bgConfig, BG_LAYER_MAIN_3, 0, 0, FALSE, HEAP_ID_POKEMON_SUMMARY_SCREEN); - Graphics_LoadPaletteFromOpenNARC(narc, 1, PAL_LOAD_MAIN_BG, 0, 0, HEAP_ID_POKEMON_SUMMARY_SCREEN); + Graphics_LoadTilesToBgLayerFromOpenNARC(narc, tiles_main_NCGR, summaryScreen->bgConfig, BG_LAYER_MAIN_3, 0, 0, FALSE, HEAP_ID_POKEMON_SUMMARY_SCREEN); + Graphics_LoadTilemapToBgLayerFromOpenNARC(narc, page_info_NSCR, summaryScreen->bgConfig, BG_LAYER_MAIN_3, 0, 0, FALSE, HEAP_ID_POKEMON_SUMMARY_SCREEN); + Graphics_LoadPaletteFromOpenNARC(narc, tiles_main_NCLR, PAL_LOAD_MAIN_BG, 0, 0, HEAP_ID_POKEMON_SUMMARY_SCREEN); - Graphics_LoadTilemapToBgLayerFromOpenNARC(narc, 11, summaryScreen->bgConfig, BG_LAYER_MAIN_2, 0, 0, FALSE, HEAP_ID_POKEMON_SUMMARY_SCREEN); + Graphics_LoadTilemapToBgLayerFromOpenNARC(narc, move_info_NSCR, summaryScreen->bgConfig, BG_LAYER_MAIN_2, 0, 0, FALSE, HEAP_ID_POKEMON_SUMMARY_SCREEN); - Graphics_LoadTilesToBgLayerFromOpenNARC(narc, 2, summaryScreen->bgConfig, BG_LAYER_SUB_0, 0, 0, FALSE, HEAP_ID_POKEMON_SUMMARY_SCREEN); - Graphics_LoadTilesToBgLayerFromOpenNARC(narc, 16, summaryScreen->bgConfig, BG_LAYER_SUB_1, 0, 0, FALSE, HEAP_ID_POKEMON_SUMMARY_SCREEN); - Graphics_LoadTilemapToBgLayerFromOpenNARC(narc, 15, summaryScreen->bgConfig, BG_LAYER_SUB_1, 0, 0, FALSE, HEAP_ID_POKEMON_SUMMARY_SCREEN); - Graphics_LoadPaletteFromOpenNARC(narc, 14, PAL_LOAD_SUB_BG, 0, 0, HEAP_ID_POKEMON_SUMMARY_SCREEN); + Graphics_LoadTilesToBgLayerFromOpenNARC(narc, sub_buttons_NCGR, summaryScreen->bgConfig, BG_LAYER_SUB_0, 0, 0, FALSE, HEAP_ID_POKEMON_SUMMARY_SCREEN); + Graphics_LoadTilesToBgLayerFromOpenNARC(narc, tiles_sub_NCGR, summaryScreen->bgConfig, BG_LAYER_SUB_1, 0, 0, FALSE, HEAP_ID_POKEMON_SUMMARY_SCREEN); + Graphics_LoadTilemapToBgLayerFromOpenNARC(narc, tiles_sub_NSCR, summaryScreen->bgConfig, BG_LAYER_SUB_1, 0, 0, FALSE, HEAP_ID_POKEMON_SUMMARY_SCREEN); + Graphics_LoadPaletteFromOpenNARC(narc, tiles_sub_NCLR, PAL_LOAD_SUB_BG, 0, 0, HEAP_ID_POKEMON_SUMMARY_SCREEN); } static void SetAlphaBlending(void) @@ -511,120 +569,120 @@ static int WaitSummaryScreenTransition(PokemonSummaryScreen *summaryScreen) PokemonSummaryScreen_LoadMonAnimation(summaryScreen); PlayMonCry(summaryScreen); - if (summaryScreen->data->mode == PSS_MODE_SELECT_MOVE) { - return PSS_STATE_LEARN_MOVE; - } else if (summaryScreen->data->mode == PSS_MODE_CONDITION) { - return PSS_STATE_SETUP_POFFIN_FEED; + if (summaryScreen->data->mode == SUMMARY_MODE_SELECT_MOVE) { + return SUMMARY_STATE_LEARN_MOVE; + } else if (summaryScreen->data->mode == SUMMARY_MODE_CONDITION) { + return SUMMARY_STATE_SETUP_POFFIN_FEED; } else { - return PSS_STATE_HANDLE_INPUT; + return SUMMARY_STATE_HANDLE_INPUT; } } - return PSS_STATE_WAIT_TRANSITION; + return SUMMARY_STATE_WAIT_TRANSITION; } static int HandleInput_Main(PokemonSummaryScreen *summaryScreen) { if (summaryScreen->subscreenExit == TRUE) { - summaryScreen->data->returnMode = 1; - return PSS_STATE_TRANSITION_OUT; + summaryScreen->data->returnMode = SUMMARY_RETURN_CANCEL; + return SUMMARY_STATE_TRANSITION_OUT; } if (JOY_REPEAT(PAD_KEY_LEFT)) { ChangePage(summaryScreen, -1); - return PSS_STATE_HANDLE_INPUT; + return SUMMARY_STATE_HANDLE_INPUT; } if (JOY_REPEAT(PAD_KEY_RIGHT)) { ChangePage(summaryScreen, 1); - return PSS_STATE_HANDLE_INPUT; + return SUMMARY_STATE_HANDLE_INPUT; } if (JOY_REPEAT(PAD_KEY_UP)) { ChangeSummaryMon(summaryScreen, -1); - return PSS_STATE_HANDLE_INPUT; + return SUMMARY_STATE_HANDLE_INPUT; } if (JOY_REPEAT(PAD_KEY_DOWN)) { ChangeSummaryMon(summaryScreen, 1); - return PSS_STATE_HANDLE_INPUT; + return SUMMARY_STATE_HANDLE_INPUT; } if (JOY_NEW(PAD_BUTTON_B)) { Sound_PlayEffect(SEQ_SE_DP_DECIDE); - summaryScreen->data->returnMode = 1; - return PSS_STATE_TRANSITION_OUT; + summaryScreen->data->returnMode = SUMMARY_RETURN_CANCEL; + return SUMMARY_STATE_TRANSITION_OUT; } if (JOY_NEW(PAD_BUTTON_A)) { - if (summaryScreen->data->mode == PSS_MODE_POFFIN && summaryScreen->page == PSS_MODE_CONDITION) { + if (summaryScreen->data->mode == SUMMARY_MODE_POFFIN && summaryScreen->page == SUMMARY_MODE_CONDITION) { Sound_PlayEffect(SEQ_SE_DP_DECIDE); return TryFeedPoffin(summaryScreen); } - if (summaryScreen->page == PSS_PAGE_BATTLE_MOVES) { + if (summaryScreen->page == SUMMARY_PAGE_BATTLE_MOVES) { Sound_PlayEffect(SEQ_SE_DP_SYU01); - summaryScreen->subscreen = 0; - return PSS_STATE_SETUP_BATTLE_MOVE_INFO; - } else if (summaryScreen->page == PSS_PAGE_CONTEST_MOVES) { + summaryScreen->pageState = PAGE_STATE_INITIAL; + return SUMMARY_STATE_SETUP_BATTLE_MOVE_INFO; + } else if (summaryScreen->page == SUMMARY_PAGE_CONTEST_MOVES) { Sound_PlayEffect(SEQ_SE_DP_SYU01); - summaryScreen->subscreen = 0; - return PSS_STATE_SETUP_CONTEST_MOVE_INFO; - } else if (summaryScreen->page == PSS_PAGE_RIBBONS) { + summaryScreen->pageState = PAGE_STATE_INITIAL; + return SUMMARY_STATE_SETUP_CONTEST_MOVE_INFO; + } else if (summaryScreen->page == SUMMARY_PAGE_RIBBONS) { if (summaryScreen->ribbonMax != 0) { Sound_PlayEffect(SEQ_SE_DP_DECIDE); - summaryScreen->subscreen = 0; - return PSS_STATE_SETUP_RIBBON_INFO; + summaryScreen->pageState = PAGE_STATE_INITIAL; + return SUMMARY_STATE_SETUP_RIBBON_INFO; } - } else if (summaryScreen->page == PSS_PAGE_EXIT) { + } else if (summaryScreen->page == SUMMARY_PAGE_EXIT) { Sound_PlayEffect(SEQ_SE_DP_DECIDE); - summaryScreen->data->returnMode = 1; - return PSS_STATE_TRANSITION_OUT; + summaryScreen->data->returnMode = SUMMARY_RETURN_CANCEL; + return SUMMARY_STATE_TRANSITION_OUT; } } if (CheckSubscreenPressAndSetButton(summaryScreen) == TRUE) { - summaryScreen->subscreen = 2; - return PSS_STATE_SUBSCREEN_INPUT; + summaryScreen->pageState = PAGE_STATE_SCROLL_FINISHED; + return SUMMARY_STATE_SUBSCREEN_INPUT; } - return PSS_STATE_HANDLE_INPUT; + return SUMMARY_STATE_HANDLE_INPUT; } static int WaitSetupBattleMoveInfo(PokemonSummaryScreen *summaryScreen) { if (SetupBattleMoveInfo(summaryScreen) == TRUE) { - return PSS_STATE_MOVE_SELECT; + return SUMMARY_STATE_MOVE_SELECT; } - return PSS_STATE_SETUP_BATTLE_MOVE_INFO; + return SUMMARY_STATE_SETUP_BATTLE_MOVE_INFO; } static int WaitHideBattleMoveInfo(PokemonSummaryScreen *summaryScreen) { if (HideBattleMoveInfo(summaryScreen) == TRUE) { - return PSS_STATE_HANDLE_INPUT; + return SUMMARY_STATE_HANDLE_INPUT; } - return PSS_STATE_HIDE_BATTLE_MOVE_INFO; + return SUMMARY_STATE_HIDE_BATTLE_MOVE_INFO; } static int WaitSetupContestMoveInfo(PokemonSummaryScreen *summaryScreen) { if (SetupContestMoveInfo(summaryScreen) == TRUE) { - return PSS_STATE_MOVE_SELECT; + return SUMMARY_STATE_MOVE_SELECT; } - return PSS_STATE_SETUP_CONTEST_MOVE_INFO; + return SUMMARY_STATE_SETUP_CONTEST_MOVE_INFO; } static int WaitHideContestMoveInfo(PokemonSummaryScreen *summaryScreen) { if (HideContestMoveInfo(summaryScreen) == TRUE) { - return PSS_STATE_HANDLE_INPUT; + return SUMMARY_STATE_HANDLE_INPUT; } - return PSS_STATE_HIDE_CONTEST_MOVE_INFO; + return SUMMARY_STATE_HIDE_CONTEST_MOVE_INFO; } static int HandleInput_MoveSelect(PokemonSummaryScreen *summaryScreen) @@ -632,51 +690,51 @@ static int HandleInput_MoveSelect(PokemonSummaryScreen *summaryScreen) if (JOY_NEW(PAD_KEY_UP)) { if (TryChangeSelectedMove(summaryScreen, -1) == TRUE) { Sound_PlayEffect(SEQ_SE_CONFIRM); - UpdateMoveInfo(summaryScreen); + UpdateMoveAttributes(summaryScreen); } - return PSS_STATE_MOVE_SELECT; + return SUMMARY_STATE_MOVE_SELECT; } if (JOY_NEW(PAD_KEY_DOWN)) { if (TryChangeSelectedMove(summaryScreen, 1) == TRUE) { Sound_PlayEffect(SEQ_SE_CONFIRM); - UpdateMoveInfo(summaryScreen); + UpdateMoveAttributes(summaryScreen); } - return PSS_STATE_MOVE_SELECT; + return SUMMARY_STATE_MOVE_SELECT; } if (JOY_NEW(PAD_BUTTON_A)) { if (summaryScreen->cursor == LEARNED_MOVES_MAX) { Sound_PlayEffect(SEQ_SE_DP_SYU01); - summaryScreen->subscreen = 0; + summaryScreen->pageState = PAGE_STATE_INITIAL; - if (summaryScreen->page == PSS_PAGE_BATTLE_MOVES) { - return PSS_STATE_HIDE_BATTLE_MOVE_INFO; + if (summaryScreen->page == SUMMARY_PAGE_BATTLE_MOVES) { + return SUMMARY_STATE_HIDE_BATTLE_MOVE_INFO; } else { - return PSS_STATE_HIDE_CONTEST_MOVE_INFO; + return SUMMARY_STATE_HIDE_CONTEST_MOVE_INFO; } - } else if (summaryScreen->data->mode != PSS_MODE_LOCK_MOVES) { + } else if (summaryScreen->data->mode != SUMMARY_MODE_LOCK_MOVES) { Sound_PlayEffect(SEQ_SE_DP_DECIDE); - sub_0208F310(summaryScreen); + PokemonSummaryScreen_SetMoveSelector2Pos(summaryScreen); summaryScreen->cursorTmp = summaryScreen->cursor; - return PSS_STATE_MOVE_SWAP; + return SUMMARY_STATE_MOVE_SWAP; } } if (JOY_NEW(PAD_BUTTON_B)) { Sound_PlayEffect(SEQ_SE_DP_SYU01); - summaryScreen->subscreen = 0; + summaryScreen->pageState = PAGE_STATE_INITIAL; - if (summaryScreen->page == PSS_PAGE_BATTLE_MOVES) { - return PSS_STATE_HIDE_BATTLE_MOVE_INFO; + if (summaryScreen->page == SUMMARY_PAGE_BATTLE_MOVES) { + return SUMMARY_STATE_HIDE_BATTLE_MOVE_INFO; } else { - return PSS_STATE_HIDE_CONTEST_MOVE_INFO; + return SUMMARY_STATE_HIDE_CONTEST_MOVE_INFO; } } - return PSS_STATE_MOVE_SELECT; + return SUMMARY_STATE_MOVE_SELECT; } static int HandleInput_MoveSwap(PokemonSummaryScreen *summaryScreen) @@ -684,74 +742,74 @@ static int HandleInput_MoveSwap(PokemonSummaryScreen *summaryScreen) if (JOY_NEW(PAD_KEY_UP)) { if (TryChangeSelectedMove(summaryScreen, -1) == TRUE) { Sound_PlayEffect(SEQ_SE_CONFIRM); - UpdateMoveInfo(summaryScreen); + UpdateMoveAttributes(summaryScreen); } - return PSS_STATE_MOVE_SWAP; + return SUMMARY_STATE_MOVE_SWAP; } if (JOY_NEW(PAD_KEY_DOWN)) { if (TryChangeSelectedMove(summaryScreen, 1) == TRUE) { Sound_PlayEffect(SEQ_SE_CONFIRM); - UpdateMoveInfo(summaryScreen); + UpdateMoveAttributes(summaryScreen); } - return PSS_STATE_MOVE_SWAP; + return SUMMARY_STATE_MOVE_SWAP; } if (JOY_NEW(PAD_BUTTON_A)) { - CellActor_SetDrawFlag(summaryScreen->unk_41C[10], FALSE); + CellActor_SetDrawFlag(summaryScreen->sprites[SUMMARY_SPRITE_MOVE_SELECTOR_2], FALSE); if (summaryScreen->cursor != LEARNED_MOVES_MAX && summaryScreen->cursor != summaryScreen->cursorTmp) { Sound_PlayEffect(SEQ_SE_DP_DECIDE); SwapSelectedMoves(summaryScreen); - sub_0208F22C(summaryScreen, summaryScreen->cursor, summaryScreen->cursorTmp); - sub_02091474(summaryScreen); - UpdateMoveInfo(summaryScreen); + PokemonSummaryScreen_SwapMoveTypeIcons(summaryScreen, summaryScreen->cursor, summaryScreen->cursorTmp); + PokemonSummaryScreen_SwapMoveNameAndPP(summaryScreen); + UpdateMoveAttributes(summaryScreen); } else { Sound_PlayEffect(SEQ_SE_DP_DECIDE); } - return PSS_STATE_MOVE_SELECT; + return SUMMARY_STATE_MOVE_SELECT; } if (JOY_NEW(PAD_BUTTON_B)) { Sound_PlayEffect(SEQ_SE_DP_DECIDE); - CellActor_SetDrawFlag(summaryScreen->unk_41C[10], FALSE); - return PSS_STATE_MOVE_SELECT; + CellActor_SetDrawFlag(summaryScreen->sprites[SUMMARY_SPRITE_MOVE_SELECTOR_2], FALSE); + return SUMMARY_STATE_MOVE_SELECT; } - return PSS_STATE_MOVE_SWAP; + return SUMMARY_STATE_MOVE_SWAP; } static int HandleInput_LearnMove(PokemonSummaryScreen *summaryScreen) { if (JOY_NEW(PAD_KEY_LEFT)) { ChangePage(summaryScreen, -1); - return PSS_STATE_LEARN_MOVE; + return SUMMARY_STATE_LEARN_MOVE; } if (JOY_NEW(PAD_KEY_RIGHT)) { ChangePage(summaryScreen, 1); - return PSS_STATE_LEARN_MOVE; + return SUMMARY_STATE_LEARN_MOVE; } if (JOY_NEW(PAD_KEY_UP)) { if (TryChangeSelectedMove(summaryScreen, -1) == TRUE) { Sound_PlayEffect(SEQ_SE_CONFIRM); - UpdateMoveInfo(summaryScreen); + UpdateMoveAttributes(summaryScreen); } - return PSS_STATE_LEARN_MOVE; + return SUMMARY_STATE_LEARN_MOVE; } if (JOY_NEW(PAD_KEY_DOWN)) { if (TryChangeSelectedMove(summaryScreen, 1) == TRUE) { Sound_PlayEffect(SEQ_SE_CONFIRM); - UpdateMoveInfo(summaryScreen); + UpdateMoveAttributes(summaryScreen); } - return PSS_STATE_LEARN_MOVE; + return SUMMARY_STATE_LEARN_MOVE; } if (JOY_NEW(PAD_BUTTON_A)) { @@ -759,102 +817,102 @@ static int HandleInput_LearnMove(PokemonSummaryScreen *summaryScreen) if (summaryScreen->cursor != LEARNED_MOVES_MAX) { if (Item_IsHMMove(summaryScreen->monData.moves[summaryScreen->cursor]) == TRUE && summaryScreen->data->move != MOVE_NONE) { - SpriteActor_DrawSprite(summaryScreen->unk_41C[18], FALSE); + SpriteActor_DrawSprite(summaryScreen->sprites[SUMMARY_SPRITE_MOVE_CATEGORY_ICON], FALSE); DrawEmptyHearts(summaryScreen); PokemonSummaryScreen_PrintHMMovesCantBeForgotten(summaryScreen); - return PSS_STATE_WAIT_HM_MSG_INPUT; + return SUMMARY_STATE_WAIT_HM_MSG_INPUT; } } summaryScreen->data->selectedSlot = summaryScreen->cursor; - summaryScreen->data->returnMode = 0; - return PSS_STATE_TRANSITION_OUT; + summaryScreen->data->returnMode = SUMMARY_RETURN_SELECT; + return SUMMARY_STATE_TRANSITION_OUT; } if (JOY_NEW(PAD_BUTTON_B)) { Sound_PlayEffect(SEQ_SE_DP_DECIDE); summaryScreen->data->selectedSlot = 4; - summaryScreen->data->returnMode = 1; - return PSS_STATE_TRANSITION_OUT; + summaryScreen->data->returnMode = SUMMARY_RETURN_CANCEL; + return SUMMARY_STATE_TRANSITION_OUT; } - return PSS_STATE_LEARN_MOVE; + return SUMMARY_STATE_LEARN_MOVE; } static int WaitForHMMsgInput(PokemonSummaryScreen *summaryScreen) { if (JOY_NEW(PAD_BUTTON_A | PAD_BUTTON_B)) { - UpdateMoveInfo(summaryScreen); - return PSS_STATE_LEARN_MOVE; + UpdateMoveAttributes(summaryScreen); + return SUMMARY_STATE_LEARN_MOVE; } - return PSS_STATE_WAIT_HM_MSG_INPUT; + return SUMMARY_STATE_WAIT_HM_MSG_INPUT; } static int WaitSetupRibbonInfo(PokemonSummaryScreen *summaryScreen) { if (SetupRibbonInfo(summaryScreen) == TRUE) { - return PSS_STATE_RIBBON_SELECT; + return SUMMARY_STATE_RIBBON_SELECT; } - return PSS_STATE_SETUP_RIBBON_INFO; + return SUMMARY_STATE_SETUP_RIBBON_INFO; } static int WaitHideRibbonInfo(PokemonSummaryScreen *summaryScreen) { if (HideRibbonInfo(summaryScreen) == TRUE) { - return PSS_STATE_HANDLE_INPUT; + return SUMMARY_STATE_HANDLE_INPUT; } - return PSS_STATE_HIDE_RIBBON_INFO; + return SUMMARY_STATE_HIDE_RIBBON_INFO; } static int HandleInput_RibbonSelect(PokemonSummaryScreen *summaryScreen) { if (JOY_REPEAT(PAD_KEY_LEFT)) { ChangeSelectedRibbon(summaryScreen, -1); - return PSS_STATE_RIBBON_SELECT; + return SUMMARY_STATE_RIBBON_SELECT; } if (JOY_REPEAT(PAD_KEY_RIGHT)) { ChangeSelectedRibbon(summaryScreen, 1); - return PSS_STATE_RIBBON_SELECT; + return SUMMARY_STATE_RIBBON_SELECT; } if (JOY_REPEAT(PAD_KEY_UP)) { ChangeSelectedRibbon(summaryScreen, -1 * RIBBONS_PER_ROW); - return PSS_STATE_RIBBON_SELECT; + return SUMMARY_STATE_RIBBON_SELECT; } if (JOY_REPEAT(PAD_KEY_DOWN)) { ChangeSelectedRibbon(summaryScreen, RIBBONS_PER_ROW); - return PSS_STATE_RIBBON_SELECT; + return SUMMARY_STATE_RIBBON_SELECT; } if (JOY_NEW(PAD_BUTTON_B | PAD_BUTTON_A)) { Sound_PlayEffect(SEQ_SE_DP_DECIDE); - summaryScreen->subscreen = 0; - return PSS_STATE_HIDE_RIBBON_INFO; + summaryScreen->pageState = PAGE_STATE_INITIAL; + return SUMMARY_STATE_HIDE_RIBBON_INFO; } - return PSS_STATE_RIBBON_SELECT; + return SUMMARY_STATE_RIBBON_SELECT; } static int HandleInput_Subscreen(PokemonSummaryScreen *summaryScreen) { if (PokemonSummaryScreen_DrawSubscreenButtonAnim(summaryScreen) == TRUE) { - return summaryScreen->subscreen; + return summaryScreen->pageState; } if (summaryScreen->buttonState == 1) { u8 page = PokemonSummaryScreen_GetSubscreenButtonPage(summaryScreen, summaryScreen->buttonCurrent); - if (page == PSS_PAGE_EXIT) { + if (page == SUMMARY_PAGE_EXIT) { summaryScreen->subscreenExit = TRUE; } if (summaryScreen->monData.isEgg == TRUE) { - if (page == PSS_PAGE_MEMO || page == PSS_PAGE_EXIT) { + if (page == SUMMARY_PAGE_MEMO || page == SUMMARY_PAGE_EXIT) { SetupPageFromSubscreenButton(summaryScreen, page); } } else { @@ -862,7 +920,7 @@ static int HandleInput_Subscreen(PokemonSummaryScreen *summaryScreen) } } - return PSS_STATE_SUBSCREEN_INPUT; + return SUMMARY_STATE_SUBSCREEN_INPUT; } static int SetupPoffinFeedConditionPage(PokemonSummaryScreen *summaryScreen) @@ -871,7 +929,7 @@ static int SetupPoffinFeedConditionPage(PokemonSummaryScreen *summaryScreen) BoxPokemon *boxMon; Pokemon *mon; - if (summaryScreen->data->dataType == PSS_DATA_BOX_MON) { + if (summaryScreen->data->dataType == SUMMARY_DATA_BOX_MON) { boxMon = PokemonSummaryScreen_MonData(summaryScreen); mon = Pokemon_New(HEAP_ID_POKEMON_SUMMARY_SCREEN); Pokemon_FromBoxPokemon(boxMon, mon); @@ -881,98 +939,98 @@ static int SetupPoffinFeedConditionPage(PokemonSummaryScreen *summaryScreen) sub_02098EF8(summaryScreen->data->poffin, mon); - summaryScreen->subscreen = 0; + summaryScreen->pageState = STAT_INCREASE_NONE; u8 monValue = summaryScreen->monData.cool; summaryScreen->monData.cool = Pokemon_GetValue(mon, MON_DATA_COOL, NULL); if (monValue != summaryScreen->monData.cool) { - summaryScreen->subscreen |= 1; + summaryScreen->pageState |= COOL_INCREASED; } monValue = summaryScreen->monData.beauty; summaryScreen->monData.beauty = Pokemon_GetValue(mon, MON_DATA_BEAUTY, NULL); if (monValue != summaryScreen->monData.beauty) { - summaryScreen->subscreen |= 2; + summaryScreen->pageState |= BEAUTY_INCREASED; } monValue = summaryScreen->monData.cute; summaryScreen->monData.cute = Pokemon_GetValue(mon, MON_DATA_CUTE, NULL); if (monValue != summaryScreen->monData.cute) { - summaryScreen->subscreen |= 4; + summaryScreen->pageState |= CUTE_INCREASED; } monValue = summaryScreen->monData.smart; summaryScreen->monData.smart = Pokemon_GetValue(mon, MON_DATA_SMART, NULL); if (monValue != summaryScreen->monData.smart) { - summaryScreen->subscreen |= 8; + summaryScreen->pageState |= SMART_INCREASED; } monValue = summaryScreen->monData.tough; summaryScreen->monData.tough = Pokemon_GetValue(mon, MON_DATA_TOUGH, NULL); if (monValue != summaryScreen->monData.tough) { - summaryScreen->subscreen |= 16; + summaryScreen->pageState |= TOUGH_INCREASED; } summaryScreen->monData.sheen = Pokemon_GetValue(mon, MON_DATA_SHEEN, NULL); - if (summaryScreen->data->dataType == PSS_DATA_BOX_MON) { + if (summaryScreen->data->dataType == SUMMARY_DATA_BOX_MON) { Heap_FreeToHeap(mon); } Font_LoadScreenIndicatorsPalette(0, PLTT_OFFSET(14), HEAP_ID_POKEMON_SUMMARY_SCREEN); LoadMessageBoxGraphics(summaryScreen->bgConfig, BG_LAYER_MAIN_1, (1024 - (18 + 12)), 13, Options_Frame(summaryScreen->data->options), HEAP_ID_POKEMON_SUMMARY_SCREEN); - if (summaryScreen->subscreen == 0) { - PokemonSummaryScreen_PrintPoffinFeedMsg(summaryScreen, PSS_MSG_NOTHING_CHANGED); - return PSS_STATE_WAIT_FINISH_POFFIN_FEED; + if (summaryScreen->pageState == STAT_INCREASE_NONE) { + PokemonSummaryScreen_PrintPoffinFeedMsg(summaryScreen, SUMMARY_MSG_NOTHING_CHANGED); + return SUMMARY_STATE_WAIT_FINISH_POFFIN_FEED; } else { - sub_02091D50(summaryScreen); - sub_0208F34C(summaryScreen); - sub_0208F6A4(summaryScreen); - return PSS_STATE_PRINT_CONTEST_STAT_MSGS; + PokemonSummaryScreen_InitMaxAndDeltaConditionRects(summaryScreen); + PokemonSummaryScreen_InitSheenSprites(summaryScreen); + PokemonSummaryScreen_UpdateConditionArrowSprites(summaryScreen); + return SUMMARY_STATE_PRINT_CONTEST_STAT_MSGS; } } - return PSS_STATE_SETUP_POFFIN_FEED; + return SUMMARY_STATE_SETUP_POFFIN_FEED; } static int PrintContestStatChangeMsgs(PokemonSummaryScreen *summaryScreen) { if (JOY_NEW(PAD_BUTTON_A | PAD_BUTTON_B)) { for (u8 i = 0; i < CONTEST_TYPE_MAX; i++) { - if (summaryScreen->subscreen & (1 << i)) { + if (summaryScreen->pageState & (1 << i)) { PokemonSummaryScreen_PrintPoffinFeedMsg(summaryScreen, i); - summaryScreen->subscreen ^= (1 << i); + summaryScreen->pageState ^= (1 << i); - if (summaryScreen->subscreen == 0) { - return PSS_STATE_WAIT_FINISH_POFFIN_FEED; + if (summaryScreen->pageState == STAT_INCREASE_NONE) { + return SUMMARY_STATE_WAIT_FINISH_POFFIN_FEED; } break; } } } - return PSS_STATE_PRINT_CONTEST_STAT_MSGS; + return SUMMARY_STATE_PRINT_CONTEST_STAT_MSGS; } static int WaitForPoffinFeedMsgInput(PokemonSummaryScreen *dummy) { if (JOY_NEW(PAD_BUTTON_A | PAD_BUTTON_B)) { - return PSS_STATE_TRANSITION_OUT; + return SUMMARY_STATE_TRANSITION_OUT; } - return PSS_STATE_WAIT_FINISH_POFFIN_FEED; + return SUMMARY_STATE_WAIT_FINISH_POFFIN_FEED; } static u8 SummaryScreenTransitionOut(PokemonSummaryScreen *dummy) { sub_0208C120(1, 19); - return PSS_STATE_WAIT_EXIT; + return SUMMARY_STATE_WAIT_EXIT; } static u8 ScreenTransitionIsDone(PokemonSummaryScreen *dummy) @@ -984,7 +1042,7 @@ static void SetMonData(PokemonSummaryScreen *summaryScreen) { void *monData = PokemonSummaryScreen_MonData(summaryScreen); - if (summaryScreen->data->dataType == PSS_DATA_BOX_MON) { + if (summaryScreen->data->dataType == SUMMARY_DATA_BOX_MON) { SetMonDataFromBoxMon(summaryScreen, monData, &summaryScreen->monData); } else { SetMonDataFromMon(summaryScreen, monData, &summaryScreen->monData); @@ -1006,15 +1064,15 @@ static void SetMonDataFromMon(PokemonSummaryScreen *summaryScreen, Pokemon *mon, monData->species = Pokemon_GetValue(mon, MON_DATA_SPECIES, NULL); BoxPokemon *boxMon = Pokemon_GetBoxPokemon(mon); - MessageLoader_GetStrbuf(summaryScreen->msgLoader, pss_species_name_template, summaryScreen->strbuf); + MessageLoader_GetStrbuf(summaryScreen->msgLoader, summary_species_name_template, summaryScreen->strbuf); StringTemplate_SetSpeciesName(summaryScreen->strFormatter, 0, boxMon); StringTemplate_Format(summaryScreen->strFormatter, summaryScreen->monData.speciesName, summaryScreen->strbuf); - MessageLoader_GetStrbuf(summaryScreen->msgLoader, pss_nickname_template, summaryScreen->strbuf); + MessageLoader_GetStrbuf(summaryScreen->msgLoader, summary_nickname_template, summaryScreen->strbuf); StringTemplate_SetNickname(summaryScreen->strFormatter, 0, boxMon); StringTemplate_Format(summaryScreen->strFormatter, summaryScreen->monData.nickname, summaryScreen->strbuf); - MessageLoader_GetStrbuf(summaryScreen->msgLoader, pss_otname_template, summaryScreen->strbuf); + MessageLoader_GetStrbuf(summaryScreen->msgLoader, summary_otname_template, summaryScreen->strbuf); StringTemplate_SetOTName(summaryScreen->strFormatter, 0, boxMon); StringTemplate_Format(summaryScreen->strFormatter, summaryScreen->monData.OTName, summaryScreen->strbuf); @@ -1023,9 +1081,9 @@ static void SetMonDataFromMon(PokemonSummaryScreen *summaryScreen, Pokemon *mon, monData->isEgg = Pokemon_GetValue(mon, MON_DATA_IS_EGG, NULL); if (Pokemon_GetValue(mon, MON_DATA_NIDORAN_HAS_NICKNAME, NULL) == TRUE && monData->isEgg == FALSE) { - monData->showGender = FALSE; + monData->hideGender = FALSE; } else { - monData->showGender = TRUE; + monData->hideGender = TRUE; } monData->gender = Pokemon_GetGender(mon); @@ -1081,16 +1139,16 @@ static void SetMonDataFromMon(PokemonSummaryScreen *summaryScreen, Pokemon *mon, monData->form = Pokemon_GetValue(mon, MON_DATA_FORM, NULL); monData->status = PokemonSummaryScreen_StatusIconAnimIdx(mon); - if (Pokemon_CanSpreadPokerus(mon) == TRUE) { - monData->pokerus = 2; + if (Pokemon_HasCuredPokerus(mon) == TRUE) { + monData->pokerus = SUMMARY_POKERUS_CURED; } else if (Pokemon_InfectedWithPokerus(mon) == TRUE) { - monData->pokerus = 1; + monData->pokerus = SUMMARY_POKERUS_INFECTED; if (monData->status == 7) { monData->status = 0; } } else { - monData->pokerus = 0; + monData->pokerus = SUMMARY_POKERUS_NONE; } if (Pokemon_IsShiny(mon) == TRUE) { @@ -1107,7 +1165,7 @@ static void SetMonDataFromMon(PokemonSummaryScreen *summaryScreen, Pokemon *mon, for (i = 0; i < RIBBON_MAX; i++) { if (Pokemon_GetValue(mon, Ribbon_GetData(i, RIBBON_DATA_RIBBON_ID), NULL) != 0) { - monData->ribbons[i / 32] |= (1 << (i & 0x1f)); + monData->ribbons[i / 32] |= (1 << (i & 0x1F)); summaryScreen->ribbonMax++; } } @@ -1134,50 +1192,50 @@ static void PlayMonCry(PokemonSummaryScreen *summaryScreen) static void SetupInitialPageGfx(PokemonSummaryScreen *summaryScreen) { switch (summaryScreen->data->mode) { - case PSS_MODE_NORMAL: - case PSS_MODE_LOCK_MOVES: + case SUMMARY_MODE_NORMAL: + case SUMMARY_MODE_LOCK_MOVES: if (summaryScreen->monData.isEgg == FALSE) { - summaryScreen->page = PSS_PAGE_INFO; + summaryScreen->page = SUMMARY_PAGE_INFO; } else { - summaryScreen->page = PSS_PAGE_MEMO; + summaryScreen->page = SUMMARY_PAGE_MEMO; } break; - case PSS_MODE_SELECT_MOVE: - summaryScreen->page = PSS_PAGE_BATTLE_MOVES; + case SUMMARY_MODE_SELECT_MOVE: + summaryScreen->page = SUMMARY_PAGE_BATTLE_MOVES; break; - case PSS_MODE_POFFIN: - case PSS_MODE_CONDITION: - summaryScreen->page = PSS_PAGE_CONDITION; + case SUMMARY_MODE_POFFIN: + case SUMMARY_MODE_CONDITION: + summaryScreen->page = SUMMARY_PAGE_CONDITION; break; } PokemonSummaryScreen_UpdateAButtonSprite(summaryScreen, NULL); - sub_0208ECF4(summaryScreen); - sub_0208EF58(summaryScreen); - sub_0208FA04(summaryScreen); - sub_0208EDC4(summaryScreen); - sub_0208F574(summaryScreen); - sub_0208F34C(summaryScreen); - sub_0208FD40(summaryScreen); - sub_020904C4(summaryScreen); + PokemonSummaryScreen_UpdatePageTabSprites(summaryScreen); + PokemonSummaryScreen_UpdateTypeIcons(summaryScreen); + PokemonSummaryScreen_UpdateRibbonSprites(summaryScreen); + PokemonSummaryScreen_SetPageArrowsPos(summaryScreen); + PokemonSummaryScreen_UpdateMiscMonDataSprites(summaryScreen); + PokemonSummaryScreen_InitSheenSprites(summaryScreen); + PokemonSummaryScreen_AddExtraWindows(summaryScreen); + PokemonSummaryScreen_DrawExtraWindows(summaryScreen); LoadCurrentPageTilemap(summaryScreen); - sub_020919E8(summaryScreen); + PokemonSummaryScreen_InitConditionRects(summaryScreen); - if (summaryScreen->data->mode == PSS_MODE_SELECT_MOVE) { + if (summaryScreen->data->mode == SUMMARY_MODE_SELECT_MOVE) { SetupMoveInfoNoTransition(summaryScreen); } } void PokemonSummaryScreen_FlagVisiblePages(PokemonSummary *summary, const u8 *pages) { - summary->pageFlag = 0; + summary->pageFlags = 0; - for (u8 i = 0; i < PSS_PAGE_MAX; i++) { - if (pages[i] == PSS_PAGE_MAX) { + for (u8 i = 0; i < SUMMARY_PAGE_MAX; i++) { + if (pages[i] == SUMMARY_PAGE_MAX) { break; } - summary->pageFlag |= (1 << pages[i]); + summary->pageFlags |= (1 << pages[i]); } } @@ -1187,26 +1245,26 @@ static void TryHideContestPages(PokemonSummaryScreen *summaryScreen) return; } - if (summaryScreen->data->pageFlag & (1 << PSS_PAGE_CONDITION)) { - summaryScreen->data->pageFlag ^= (1 << PSS_PAGE_CONDITION); + if (summaryScreen->data->pageFlags & (1 << SUMMARY_PAGE_CONDITION)) { + summaryScreen->data->pageFlags ^= (1 << SUMMARY_PAGE_CONDITION); } - if (summaryScreen->data->pageFlag & (1 << PSS_PAGE_CONTEST_MOVES)) { - summaryScreen->data->pageFlag ^= (1 << PSS_PAGE_CONTEST_MOVES); + if (summaryScreen->data->pageFlags & (1 << SUMMARY_PAGE_CONTEST_MOVES)) { + summaryScreen->data->pageFlags ^= (1 << SUMMARY_PAGE_CONTEST_MOVES); } - if (summaryScreen->data->pageFlag & (1 << PSS_PAGE_RIBBONS)) { - summaryScreen->data->pageFlag ^= (1 << PSS_PAGE_RIBBONS); + if (summaryScreen->data->pageFlags & (1 << SUMMARY_PAGE_RIBBONS)) { + summaryScreen->data->pageFlags ^= (1 << SUMMARY_PAGE_RIBBONS); } } u8 PokemonSummaryScreen_PageIsVisble(PokemonSummaryScreen *summaryScreen, u32 page) { - if (summaryScreen->monData.isEgg != FALSE && page != PSS_PAGE_MEMO && page != PSS_PAGE_EXIT) { + if (summaryScreen->monData.isEgg != FALSE && page != SUMMARY_PAGE_MEMO && page != SUMMARY_PAGE_EXIT) { return FALSE; } - return summaryScreen->data->pageFlag & (1 << page); + return summaryScreen->data->pageFlags & (1 << page); } u8 PokemonSummaryScreen_CountVisiblePages(PokemonSummaryScreen *summaryScreen) @@ -1214,8 +1272,8 @@ u8 PokemonSummaryScreen_CountVisiblePages(PokemonSummaryScreen *summaryScreen) u8 page; u8 countVisible = 0; - for (page = 0; page < PSS_PAGE_MAX; page++) { - if (summaryScreen->data->pageFlag & (1 << page)) { + for (page = 0; page < SUMMARY_PAGE_MAX; page++) { + if (summaryScreen->data->pageFlags & (1 << page)) { countVisible++; } } @@ -1231,7 +1289,7 @@ static void SetupPageFromSubscreenButton(PokemonSummaryScreen *summaryScreen, u8 // this code path is never reached because the select move mode // doesn't handle subscreen input - if (summaryScreen->data->mode == PSS_MODE_SELECT_MOVE) { + if (summaryScreen->data->mode == SUMMARY_MODE_SELECT_MOVE) { ClearMoveInfoWindows(summaryScreen); } @@ -1239,22 +1297,22 @@ static void SetupPageFromSubscreenButton(PokemonSummaryScreen *summaryScreen, u8 summaryScreen->page = page; PokemonSummaryScreen_UpdateAButtonSprite(summaryScreen, NULL); - sub_0208ECF4(summaryScreen); - sub_0208EDC4(summaryScreen); - sub_0208EF58(summaryScreen); - sub_0208FA04(summaryScreen); - sub_0208F34C(summaryScreen); - sub_0208FD40(summaryScreen); - sub_0208FB54(summaryScreen, 0); + PokemonSummaryScreen_UpdatePageTabSprites(summaryScreen); + PokemonSummaryScreen_SetPageArrowsPos(summaryScreen); + PokemonSummaryScreen_UpdateTypeIcons(summaryScreen); + PokemonSummaryScreen_UpdateRibbonSprites(summaryScreen); + PokemonSummaryScreen_InitSheenSprites(summaryScreen); + PokemonSummaryScreen_AddExtraWindows(summaryScreen); + PokemonSummaryScreen_UpdateConditionFlashSprites(summaryScreen, FALSE); Bg_FillTilemapRect(summaryScreen->bgConfig, BG_LAYER_MAIN_1, 0, 14, 4, 19, 20, 0); Bg_CopyTilemapBufferToVRAM(summaryScreen->bgConfig, BG_LAYER_MAIN_1); - sub_020904C4(summaryScreen); + PokemonSummaryScreen_DrawExtraWindows(summaryScreen); LoadCurrentPageTilemap(summaryScreen); - sub_020919E8(summaryScreen); + PokemonSummaryScreen_InitConditionRects(summaryScreen); // this code path is also never reached - if (summaryScreen->data->mode == PSS_MODE_SELECT_MOVE) { + if (summaryScreen->data->mode == SUMMARY_MODE_SELECT_MOVE) { SetupMoveInfoFromSubscreenButton(summaryScreen); } } @@ -1266,19 +1324,19 @@ static void ChangePage(PokemonSummaryScreen *summaryScreen, s8 delta) while (TRUE) { page += delta; - if (page < PSS_PAGE_INFO) { - page = PSS_PAGE_EXIT; - } else if (page > PSS_PAGE_EXIT) { - page = PSS_PAGE_INFO; + if (page < SUMMARY_PAGE_INFO) { + page = SUMMARY_PAGE_EXIT; + } else if (page > SUMMARY_PAGE_EXIT) { + page = SUMMARY_PAGE_INFO; } if (summaryScreen->monData.isEgg == FALSE) { - if ((summaryScreen->data->pageFlag & (1 << page)) != 0) { + if ((summaryScreen->data->pageFlags & (1 << page)) != 0) { break; } } else { - if ((summaryScreen->data->pageFlag & (1 << page)) != 0 - && (page == PSS_PAGE_MEMO || page == PSS_PAGE_EXIT)) { + if ((summaryScreen->data->pageFlags & (1 << page)) != 0 + && (page == SUMMARY_PAGE_MEMO || page == SUMMARY_PAGE_EXIT)) { break; } } @@ -1290,7 +1348,7 @@ static void ChangePage(PokemonSummaryScreen *summaryScreen, s8 delta) Sound_PlayEffect(SEQ_SE_DP_SELECT5); PokemonSummaryScreen_UpdateSubscreenButtonGfx(summaryScreen); - sub_0208FB54(summaryScreen, 0); + PokemonSummaryScreen_UpdateConditionFlashSprites(summaryScreen, FALSE); SetupPageFromSubscreenButton(summaryScreen, page); } @@ -1298,7 +1356,7 @@ static u8 CheckSubscreenPressAndSetButton(PokemonSummaryScreen *summaryScreen) { u8 button = PokemonSummaryScreen_CheckSubscreenButtonPress(summaryScreen); - if (button == PSS_SUBSCREEN_BUTTON_NONE) { + if (button == SUMMARY_SUBSCREEN_BUTTON_NONE) { return FALSE; } @@ -1312,14 +1370,14 @@ static u8 CheckSubscreenPressAndSetButton(PokemonSummaryScreen *summaryScreen) static void LoadCurrentPageTilemap(PokemonSummaryScreen *summaryScreen) { u32 memberIndex; - if (summaryScreen->data->mode == PSS_MODE_SELECT_MOVE && summaryScreen->data->move != MOVE_NONE) { - if (summaryScreen->page == PSS_PAGE_BATTLE_MOVES) { - memberIndex = 12; + if (summaryScreen->data->mode == SUMMARY_MODE_SELECT_MOVE && summaryScreen->data->move != MOVE_NONE) { + if (summaryScreen->page == SUMMARY_PAGE_BATTLE_MOVES) { + memberIndex = page_battle_moves_select_mode_NSCR; } else { - memberIndex = 13; + memberIndex = page_contest_moves_select_mode_NSCR; } } else { - memberIndex = 3 + summaryScreen->page; + memberIndex = page_info_NSCR + summaryScreen->page; } void *memberBuffer = NARC_AllocAndReadWholeMemberByIndexPair(NARC_INDEX_GRAPHIC__PL_PST_GRA, memberIndex, HEAP_ID_POKEMON_SUMMARY_SCREEN); @@ -1330,9 +1388,9 @@ static void LoadCurrentPageTilemap(PokemonSummaryScreen *summaryScreen) Bg_ScheduleTilemapTransfer(summaryScreen->bgConfig, BG_LAYER_MAIN_3); Heap_FreeToHeap(memberBuffer); - if (summaryScreen->page == PSS_PAGE_INFO) { + if (summaryScreen->page == SUMMARY_PAGE_INFO) { DrawExperienceProgressBar(summaryScreen); - } else if (summaryScreen->page == PSS_PAGE_SKILLS) { + } else if (summaryScreen->page == SUMMARY_PAGE_SKILLS) { DrawHealthBar(summaryScreen); } } @@ -1358,14 +1416,14 @@ static void DrawHealthBar(PokemonSummaryScreen *summaryScreen) u8 pixelCount = App_PixelCount(summaryScreen->monData.curHP, summaryScreen->monData.maxHP, 48); u16 tile; - for (u8 i = 0; i < 6; i++) { + for (u8 i = 0; i < HEALTHBAR_TILES_MAX; i++) { if (pixelCount >= 8) { tile = baseTile + 8; } else { tile = baseTile + pixelCount; } - Bg_FillTilemapRect(summaryScreen->bgConfig, BG_LAYER_MAIN_3, tile, 24 + i, 6, 1, 1, TILEMAP_FILL_VAL_INCLUDES_PALETTE); + Bg_FillTilemapRect(summaryScreen->bgConfig, BG_LAYER_MAIN_3, tile, HEALTHBAR_BASE_X + i, HEALTHBAR_Y, 1, 1, TILEMAP_FILL_VAL_INCLUDES_PALETTE); if (pixelCount < 8) { pixelCount = 0; @@ -1379,28 +1437,28 @@ static void DrawHealthBar(PokemonSummaryScreen *summaryScreen) static void DrawExperienceProgressBar(PokemonSummaryScreen *summaryScreen) { - u32 v0; - u32 v1; + u32 maxExp; + u32 curExp; if (summaryScreen->monData.level < MAX_POKEMON_LEVEL) { - v0 = summaryScreen->monData.nextLevelExp - summaryScreen->monData.curLevelExp; - v1 = summaryScreen->monData.curExp - summaryScreen->monData.curLevelExp; + maxExp = summaryScreen->monData.nextLevelExp - summaryScreen->monData.curLevelExp; + curExp = summaryScreen->monData.curExp - summaryScreen->monData.curLevelExp; } else { - v0 = 0; - v1 = 0; + maxExp = 0; + curExp = 0; } - u8 pixelCount = App_PixelCount(v1, v0, 56); - u16 v2; + u8 pixelCount = App_PixelCount(curExp, maxExp, 56); + u16 tile; - for (u8 i = 0; i < 7; i++) { + for (u8 i = 0; i < EXPBAR_TILES_MAX; i++) { if (pixelCount >= 8) { - v2 = 0xac + 8; + tile = EXPBAR_BASE_TILE + 8; } else { - v2 = 0xac + pixelCount; + tile = EXPBAR_BASE_TILE + pixelCount; } - Bg_FillTilemapRect(summaryScreen->bgConfig, BG_LAYER_MAIN_3, v2, 23 + i, 23, 1, 1, 17); + Bg_FillTilemapRect(summaryScreen->bgConfig, BG_LAYER_MAIN_3, tile, EXPBAR_BASE_X + i, EXPBAR_Y, 1, 1, TILEMAP_FILL_VAL_INCLUDES_PALETTE); if (pixelCount < 8) { pixelCount = 0; @@ -1424,41 +1482,41 @@ static void ChangeSummaryMon(PokemonSummaryScreen *summaryScreen, s8 delta) SetMonData(summaryScreen); PlayMonCry(summaryScreen); - sub_0208FEA4(summaryScreen); - sub_0208FF3C(summaryScreen); - sub_0208FFE0(summaryScreen); + PokemonSummaryScreen_PrintNicknameAndGender(summaryScreen); + PokemonSummaryScreen_PrintLevel(summaryScreen); + PokemonSummaryScreen_PrintItemName(summaryScreen); - if (summaryScreen->page == PSS_PAGE_INFO) { + if (summaryScreen->page == SUMMARY_PAGE_INFO) { DrawExperienceProgressBar(summaryScreen); - } else if (summaryScreen->page == PSS_PAGE_SKILLS) { + } else if (summaryScreen->page == SUMMARY_PAGE_SKILLS) { DrawHealthBar(summaryScreen); - } else if (summaryScreen->page == PSS_PAGE_CONDITION) { - sub_02091D50(summaryScreen); + } else if (summaryScreen->page == SUMMARY_PAGE_CONDITION) { + PokemonSummaryScreen_InitMaxAndDeltaConditionRects(summaryScreen); } - sub_02092098(summaryScreen); + PokemonSummaryScreen_ChangeMonSprite(summaryScreen); PokemonSummaryScreen_UpdateAButtonSprite(summaryScreen, NULL); - sub_0208ECF4(summaryScreen); - sub_0208EDC4(summaryScreen); - sub_0208F16C(summaryScreen); - sub_0208EF58(summaryScreen); - sub_0208FA04(summaryScreen); - sub_0208F71C(summaryScreen); - sub_0208EE3C(summaryScreen); - sub_0208EE9C(summaryScreen); - sub_0208F34C(summaryScreen); - sub_0208F574(summaryScreen); - sub_020904C4(summaryScreen); + PokemonSummaryScreen_UpdatePageTabSprites(summaryScreen); + PokemonSummaryScreen_SetPageArrowsPos(summaryScreen); + PokemonSummaryScreen_SetMonTypeIcons(summaryScreen); + PokemonSummaryScreen_UpdateTypeIcons(summaryScreen); + PokemonSummaryScreen_UpdateRibbonSprites(summaryScreen); + PokemonSummaryScreen_SetMonIcon(summaryScreen); + PokemonSummaryScreen_SetCaughtBallGfx(summaryScreen); + PokemonSummaryScreen_UpdateStatusIcon(summaryScreen); + PokemonSummaryScreen_InitSheenSprites(summaryScreen); + PokemonSummaryScreen_UpdateMiscMonDataSprites(summaryScreen); + PokemonSummaryScreen_DrawExtraWindows(summaryScreen); } static s8 TryAdvanceSummaryMonIndex(PokemonSummaryScreen *summaryScreen, s8 delta) { switch (summaryScreen->data->dataType) { - case PSS_DATA_MON: + case SUMMARY_DATA_MON: return TryAdvanceMonIndex(summaryScreen, delta); - case PSS_DATA_PARTY_MON: + case SUMMARY_DATA_PARTY_MON: return TryAdvancePartyMonIndex(summaryScreen, delta); - case PSS_DATA_BOX_MON: + case SUMMARY_DATA_BOX_MON: return TryAdvanceBoxMonIndex(summaryScreen, delta); } @@ -1467,11 +1525,11 @@ static s8 TryAdvanceSummaryMonIndex(PokemonSummaryScreen *summaryScreen, s8 delt static BOOL CanAdvanceToEgg(PokemonSummaryScreen *summaryScreen) { - if (summaryScreen->data->mode == PSS_MODE_POFFIN) { + if (summaryScreen->data->mode == SUMMARY_MODE_POFFIN) { return FALSE; } - if (summaryScreen->page != PSS_PAGE_MEMO && summaryScreen->page != PSS_PAGE_EXIT) { + if (summaryScreen->page != SUMMARY_PAGE_MEMO && summaryScreen->page != SUMMARY_PAGE_EXIT) { return FALSE; } @@ -1508,7 +1566,7 @@ static s8 TryAdvanceMonIndex(PokemonSummaryScreen *summaryScreen, s8 delta) static s8 TryAdvancePartyMonIndex(PokemonSummaryScreen *summaryScreen, s8 delta) { - s8 monIndex = (s8)summaryScreen->data->pos; + s8 monIndex = summaryScreen->data->pos; while (TRUE) { monIndex += delta; @@ -1564,11 +1622,11 @@ static s8 TryAdvanceBoxMonIndex(PokemonSummaryScreen *summaryScreen, s8 delta) void *PokemonSummaryScreen_MonData(PokemonSummaryScreen *summaryScreen) { switch (summaryScreen->data->dataType) { - case PSS_DATA_MON: + case SUMMARY_DATA_MON: return summaryScreen->data->monData + (Pokemon_GetStructSize() * summaryScreen->data->pos); - case PSS_DATA_PARTY_MON: + case SUMMARY_DATA_PARTY_MON: return Party_GetPokemonBySlotIndex(summaryScreen->data->monData, summaryScreen->data->pos); - case PSS_DATA_BOX_MON: + case SUMMARY_DATA_BOX_MON: return summaryScreen->data->monData + (BoxPokemon_GetStructSize() * summaryScreen->data->pos); } @@ -1577,47 +1635,47 @@ void *PokemonSummaryScreen_MonData(PokemonSummaryScreen *summaryScreen) static u8 SetupBattleMoveInfo(PokemonSummaryScreen *summaryScreen) { - switch (summaryScreen->subscreen) { - case 0: + switch (summaryScreen->pageState) { + case PAGE_STATE_INITIAL: Bg_ScheduleScroll(summaryScreen->bgConfig, BG_LAYER_MAIN_2, BG_OFFSET_UPDATE_SET_X, 136); Bg_ScheduleScroll(summaryScreen->bgConfig, BG_LAYER_MAIN_2, BG_OFFSET_UPDATE_SET_Y, 0); PokemonSummaryScreen_UpdatePageArrows(summaryScreen, FALSE); - Window_ClearAndScheduleCopyToVRAM(&summaryScreen->staticWindows[PSS_WINDOW_MON_LEVEL]); - Window_ClearAndScheduleCopyToVRAM(&summaryScreen->staticWindows[PSS_WINDOW_ITEM_LABEL]); - Window_ClearAndScheduleCopyToVRAM(&summaryScreen->staticWindows[PSS_WINDOW_ITEM_NAME]); - Window_ClearAndScheduleCopyToVRAM(&summaryScreen->staticWindows[PSS_WINDOW_BUTTON_PROMPT]); + Window_ClearAndScheduleCopyToVRAM(&summaryScreen->staticWindows[SUMMARY_WINDOW_MON_LEVEL]); + Window_ClearAndScheduleCopyToVRAM(&summaryScreen->staticWindows[SUMMARY_WINDOW_LABEL_ITEM]); + Window_ClearAndScheduleCopyToVRAM(&summaryScreen->staticWindows[SUMMARY_WINDOW_ITEM_NAME]); + Window_ClearAndScheduleCopyToVRAM(&summaryScreen->staticWindows[SUMMARY_WINDOW_BUTTON_PROMPT]); PokemonSummaryScreen_UpdateAButtonSprite(summaryScreen, NULL); summaryScreen->cursor = 0; - summaryScreen->subscreen = 1; + summaryScreen->pageState = PAGE_STATE_SCROLLING; break; - case 1: { + case PAGE_STATE_SCROLLING: { int xOffset = Bg_GetXOffset(summaryScreen->bgConfig, BG_LAYER_MAIN_2); if (xOffset <= 64) { Bg_ScheduleScroll(summaryScreen->bgConfig, BG_LAYER_MAIN_2, BG_OFFSET_UPDATE_SET_X, 0); - summaryScreen->subscreen = 2; + summaryScreen->pageState = PAGE_STATE_SCROLL_FINISHED; } else { Bg_ScheduleScroll(summaryScreen->bgConfig, BG_LAYER_MAIN_2, BG_OFFSET_UPDATE_SUB_X, 64); } } break; - case 2: - ShowMoveInfoOrCancel(summaryScreen); + case PAGE_STATE_SCROLL_FINISHED: + PokemonSummaryScreen_ShowMove5OrCancel(summaryScreen); - if (summaryScreen->data->mode != PSS_MODE_LOCK_MOVES) { + if (summaryScreen->data->mode != SUMMARY_MODE_LOCK_MOVES) { PokemonSummaryScreen_ClearAndPrintButtonPrompt(summaryScreen, 152); - PokemonSummaryScreen_UpdateAButtonSprite(summaryScreen, &summaryScreen->staticWindows[PSS_WINDOW_BUTTON_PROMPT]); + PokemonSummaryScreen_UpdateAButtonSprite(summaryScreen, &summaryScreen->staticWindows[SUMMARY_WINDOW_BUTTON_PROMPT]); } - UpdateMoveInfo(summaryScreen); - SpriteActor_DrawSprite(summaryScreen->unk_41C[11], TRUE); + UpdateMoveAttributes(summaryScreen); + SpriteActor_DrawSprite(summaryScreen->sprites[SUMMARY_SPRITE_MON_TYPE_ICON_1], TRUE); PokemonSummaryScreen_ShowMonIcon(summaryScreen); if (summaryScreen->monData.type1 != summaryScreen->monData.type2) { - SpriteActor_DrawSprite(summaryScreen->unk_41C[12], TRUE); + SpriteActor_DrawSprite(summaryScreen->sprites[SUMMARY_SPRITE_MON_TYPE_ICON_2], TRUE); } - CellActor_SetDrawFlag(summaryScreen->unk_41C[9], TRUE); + CellActor_SetDrawFlag(summaryScreen->sprites[SUMMARY_SPRITE_MOVE_SELECTOR_1], TRUE); return TRUE; } @@ -1626,36 +1684,36 @@ static u8 SetupBattleMoveInfo(PokemonSummaryScreen *summaryScreen) static u8 HideBattleMoveInfo(PokemonSummaryScreen *summaryScreen) { - switch (summaryScreen->subscreen) { - case 0: - SpriteActor_DrawSprite(summaryScreen->unk_41C[11], FALSE); - SpriteActor_DrawSprite(summaryScreen->unk_41C[12], FALSE); - SpriteActor_DrawSprite(summaryScreen->unk_41C[18], FALSE); - SpriteActor_DrawSprite(summaryScreen->unk_41C[19], FALSE); - CellActor_SetDrawFlag(summaryScreen->unk_41C[9], FALSE); - Window_ClearAndScheduleCopyToVRAM(&summaryScreen->staticWindows[PSS_WINDOW_BUTTON_PROMPT]); + switch (summaryScreen->pageState) { + case PAGE_STATE_INITIAL: + SpriteActor_DrawSprite(summaryScreen->sprites[SUMMARY_SPRITE_MON_TYPE_ICON_1], FALSE); + SpriteActor_DrawSprite(summaryScreen->sprites[SUMMARY_SPRITE_MON_TYPE_ICON_2], FALSE); + SpriteActor_DrawSprite(summaryScreen->sprites[SUMMARY_SPRITE_MOVE_CATEGORY_ICON], FALSE); + SpriteActor_DrawSprite(summaryScreen->sprites[SUMMARY_SPRITE_MON_ICON], FALSE); + CellActor_SetDrawFlag(summaryScreen->sprites[SUMMARY_SPRITE_MOVE_SELECTOR_1], FALSE); + Window_ClearAndScheduleCopyToVRAM(&summaryScreen->staticWindows[SUMMARY_WINDOW_BUTTON_PROMPT]); PokemonSummaryScreen_UpdateAButtonSprite(summaryScreen, NULL); - HideMoveCancelText(summaryScreen); - PokemonSummaryScreen_ClearBattleInfoWindows(summaryScreen); - summaryScreen->subscreen = 1; + PokemonSummaryScreen_HideMoveCancelText(summaryScreen); + PokemonSummaryScreen_ClearBattleAttributeWindows(summaryScreen); + summaryScreen->pageState = PAGE_STATE_SCROLLING; break; - case 1: { + case PAGE_STATE_SCROLLING: { int xOffset = Bg_GetXOffset(summaryScreen->bgConfig, BG_LAYER_MAIN_2); if (xOffset >= 128) { Bg_ScheduleScroll(summaryScreen->bgConfig, BG_LAYER_MAIN_2, BG_OFFSET_UPDATE_SET_X, 136); - summaryScreen->subscreen = 2; + summaryScreen->pageState = PAGE_STATE_SCROLL_FINISHED; } else { Bg_ScheduleScroll(summaryScreen->bgConfig, BG_LAYER_MAIN_2, BG_OFFSET_UPDATE_ADD_X, 64); } } break; - case 2: - Window_ScheduleCopyToVRAM(&summaryScreen->staticWindows[PSS_WINDOW_MON_LEVEL]); - Window_ScheduleCopyToVRAM(&summaryScreen->staticWindows[PSS_WINDOW_ITEM_LABEL]); - Window_ScheduleCopyToVRAM(&summaryScreen->staticWindows[PSS_WINDOW_ITEM_NAME]); + case PAGE_STATE_SCROLL_FINISHED: + Window_ScheduleCopyToVRAM(&summaryScreen->staticWindows[SUMMARY_WINDOW_MON_LEVEL]); + Window_ScheduleCopyToVRAM(&summaryScreen->staticWindows[SUMMARY_WINDOW_LABEL_ITEM]); + Window_ScheduleCopyToVRAM(&summaryScreen->staticWindows[SUMMARY_WINDOW_ITEM_NAME]); PokemonSummaryScreen_ClearAndPrintButtonPrompt(summaryScreen, 129); PokemonSummaryScreen_UpdatePageArrows(summaryScreen, TRUE); - PokemonSummaryScreen_UpdateAButtonSprite(summaryScreen, &summaryScreen->staticWindows[PSS_WINDOW_BUTTON_PROMPT]); + PokemonSummaryScreen_UpdateAButtonSprite(summaryScreen, &summaryScreen->staticWindows[SUMMARY_WINDOW_BUTTON_PROMPT]); return TRUE; } @@ -1688,53 +1746,53 @@ static u8 TryChangeSelectedMove(PokemonSummaryScreen *summaryScreen, s8 delta) return FALSE; } -static void UpdateMoveInfo(PokemonSummaryScreen *summaryScreen) +static void UpdateMoveAttributes(PokemonSummaryScreen *summaryScreen) { PokemonSummaryScreen_UpdateMoveSelectorPos(summaryScreen); if (summaryScreen->cursor == LEARNED_MOVES_MAX) { if (summaryScreen->data->move != MOVE_NONE) { - if (summaryScreen->page == PSS_PAGE_BATTLE_MOVES) { - UpdateBattleMoveInfo(summaryScreen, summaryScreen->data->move); + if (summaryScreen->page == SUMMARY_PAGE_BATTLE_MOVES) { + UpdateBattleMoveAttributes(summaryScreen, summaryScreen->data->move); } else { - UpdateContestMoveInfo(summaryScreen, summaryScreen->data->move); + UpdateContestMoveAttributes(summaryScreen, summaryScreen->data->move); } } else { - if (summaryScreen->page == PSS_PAGE_BATTLE_MOVES) { - UpdateBattleMoveInfo(summaryScreen, PSS_MOVE_NONE); + if (summaryScreen->page == SUMMARY_PAGE_BATTLE_MOVES) { + UpdateBattleMoveAttributes(summaryScreen, SUMMARY_MOVE_NONE); } else { - UpdateContestMoveInfo(summaryScreen, PSS_MOVE_NONE); + UpdateContestMoveAttributes(summaryScreen, SUMMARY_MOVE_NONE); } } } else { - if (summaryScreen->page == PSS_PAGE_BATTLE_MOVES) { - UpdateBattleMoveInfo(summaryScreen, summaryScreen->monData.moves[summaryScreen->cursor]); + if (summaryScreen->page == SUMMARY_PAGE_BATTLE_MOVES) { + UpdateBattleMoveAttributes(summaryScreen, summaryScreen->monData.moves[summaryScreen->cursor]); } else { - UpdateContestMoveInfo(summaryScreen, summaryScreen->monData.moves[summaryScreen->cursor]); + UpdateContestMoveAttributes(summaryScreen, summaryScreen->monData.moves[summaryScreen->cursor]); } } } -static void UpdateBattleMoveInfo(PokemonSummaryScreen *summaryScreen, u32 move) +static void UpdateBattleMoveAttributes(PokemonSummaryScreen *summaryScreen, u32 move) { - if (move == PSS_MOVE_NONE) { - PokemonSummaryScreen_ClearBattleInfoWindows(summaryScreen); - SpriteActor_DrawSprite(summaryScreen->unk_41C[18], FALSE); + if (move == SUMMARY_MOVE_NONE) { + PokemonSummaryScreen_ClearBattleAttributeWindows(summaryScreen); + SpriteActor_DrawSprite(summaryScreen->sprites[SUMMARY_SPRITE_MOVE_CATEGORY_ICON], FALSE); } else { - PokemonSummaryScreen_PrintBattleMoveInfo(summaryScreen, move); + PokemonSummaryScreen_PrintBattleMoveAttributes(summaryScreen, move); PokemonSummaryScreen_UpdateMoveCategoryIcon(summaryScreen, move); - SpriteActor_DrawSprite(summaryScreen->unk_41C[18], TRUE); + SpriteActor_DrawSprite(summaryScreen->sprites[SUMMARY_SPRITE_MOVE_CATEGORY_ICON], TRUE); } } -static void UpdateContestMoveInfo(PokemonSummaryScreen *summaryScreen, u32 move) +static void UpdateContestMoveAttributes(PokemonSummaryScreen *summaryScreen, u32 move) { UpdateAppealHearts(summaryScreen, move); - if (move == PSS_MOVE_NONE) { - PokemonSummaryScreen_ClearContestInfoWindows(summaryScreen); + if (move == SUMMARY_MOVE_NONE) { + PokemonSummaryScreen_ClearContestAttributeWindows(summaryScreen); } else { - PokemonSummaryScreen_PrintContestMoveInfo(summaryScreen, move); + PokemonSummaryScreen_PrintContestMoveAttributes(summaryScreen, move); } } @@ -1742,7 +1800,7 @@ static void SwapSelectedMoves(PokemonSummaryScreen *summaryScreen) { void *monData = PokemonSummaryScreen_MonData(summaryScreen); - if (summaryScreen->data->dataType == PSS_DATA_BOX_MON) { + if (summaryScreen->data->dataType == SUMMARY_DATA_BOX_MON) { BoxPokemon_SwapMoveSlots(monData, summaryScreen->cursor, summaryScreen->cursorTmp); } else { Pokemon_SwapMoveSlots(monData, summaryScreen->cursor, summaryScreen->cursorTmp); @@ -1763,63 +1821,63 @@ static void SwapSelectedMoves(PokemonSummaryScreen *summaryScreen) static void SetupMoveInfoNoTransition(PokemonSummaryScreen *summaryScreen) { - Window_ClearAndScheduleCopyToVRAM(&summaryScreen->staticWindows[PSS_WINDOW_MON_LEVEL]); - Window_ClearAndScheduleCopyToVRAM(&summaryScreen->staticWindows[PSS_WINDOW_ITEM_LABEL]); - Window_ClearAndScheduleCopyToVRAM(&summaryScreen->staticWindows[PSS_WINDOW_ITEM_NAME]); + Window_ClearAndScheduleCopyToVRAM(&summaryScreen->staticWindows[SUMMARY_WINDOW_MON_LEVEL]); + Window_ClearAndScheduleCopyToVRAM(&summaryScreen->staticWindows[SUMMARY_WINDOW_LABEL_ITEM]); + Window_ClearAndScheduleCopyToVRAM(&summaryScreen->staticWindows[SUMMARY_WINDOW_ITEM_NAME]); Bg_ScheduleScroll(summaryScreen->bgConfig, BG_LAYER_MAIN_2, BG_OFFSET_UPDATE_SET_X, 0); - ShowMoveInfoOrCancel(summaryScreen); - UpdateMoveInfo(summaryScreen); + PokemonSummaryScreen_ShowMove5OrCancel(summaryScreen); + UpdateMoveAttributes(summaryScreen); - SpriteActor_DrawSprite(summaryScreen->unk_41C[11], TRUE); + SpriteActor_DrawSprite(summaryScreen->sprites[SUMMARY_SPRITE_MON_TYPE_ICON_1], TRUE); PokemonSummaryScreen_ShowMonIcon(summaryScreen); if (summaryScreen->monData.type1 != summaryScreen->monData.type2) { - SpriteActor_DrawSprite(summaryScreen->unk_41C[12], TRUE); + SpriteActor_DrawSprite(summaryScreen->sprites[SUMMARY_SPRITE_MON_TYPE_ICON_2], TRUE); } - CellActor_SetDrawFlag(summaryScreen->unk_41C[9], TRUE); + CellActor_SetDrawFlag(summaryScreen->sprites[SUMMARY_SPRITE_MOVE_SELECTOR_1], TRUE); } static u8 SetupContestMoveInfo(PokemonSummaryScreen *summaryScreen) { - switch (summaryScreen->subscreen) { - case 0: + switch (summaryScreen->pageState) { + case PAGE_STATE_INITIAL: Bg_ScheduleScroll(summaryScreen->bgConfig, BG_LAYER_MAIN_2, BG_OFFSET_UPDATE_SET_X, 136); Bg_ScheduleScroll(summaryScreen->bgConfig, BG_LAYER_MAIN_2, BG_OFFSET_UPDATE_SET_Y, 256); - UpdateAppealHearts(summaryScreen, PSS_MOVE_NONE); + UpdateAppealHearts(summaryScreen, SUMMARY_MOVE_NONE); PokemonSummaryScreen_UpdatePageArrows(summaryScreen, FALSE); - Window_ClearAndScheduleCopyToVRAM(&summaryScreen->staticWindows[PSS_WINDOW_MON_LEVEL]); - Window_ClearAndScheduleCopyToVRAM(&summaryScreen->staticWindows[PSS_WINDOW_ITEM_LABEL]); - Window_ClearAndScheduleCopyToVRAM(&summaryScreen->staticWindows[PSS_WINDOW_ITEM_NAME]); - Window_ClearAndScheduleCopyToVRAM(&summaryScreen->staticWindows[PSS_WINDOW_BUTTON_PROMPT]); + Window_ClearAndScheduleCopyToVRAM(&summaryScreen->staticWindows[SUMMARY_WINDOW_MON_LEVEL]); + Window_ClearAndScheduleCopyToVRAM(&summaryScreen->staticWindows[SUMMARY_WINDOW_LABEL_ITEM]); + Window_ClearAndScheduleCopyToVRAM(&summaryScreen->staticWindows[SUMMARY_WINDOW_ITEM_NAME]); + Window_ClearAndScheduleCopyToVRAM(&summaryScreen->staticWindows[SUMMARY_WINDOW_BUTTON_PROMPT]); PokemonSummaryScreen_UpdateAButtonSprite(summaryScreen, NULL); summaryScreen->cursor = 0; - summaryScreen->subscreen = 1; + summaryScreen->pageState = PAGE_STATE_SCROLLING; break; - case 1: { + case PAGE_STATE_SCROLLING: { int xOffset = Bg_GetXOffset(summaryScreen->bgConfig, BG_LAYER_MAIN_2); if (xOffset <= 64) { Bg_ScheduleScroll(summaryScreen->bgConfig, BG_LAYER_MAIN_2, BG_OFFSET_UPDATE_SET_X, 0); - summaryScreen->subscreen = 2; + summaryScreen->pageState = PAGE_STATE_SCROLL_FINISHED; } else { Bg_ScheduleScroll(summaryScreen->bgConfig, BG_LAYER_MAIN_2, BG_OFFSET_UPDATE_SUB_X, 64); } } break; - case 2: - ShowMoveInfoOrCancel(summaryScreen); + case PAGE_STATE_SCROLL_FINISHED: + PokemonSummaryScreen_ShowMove5OrCancel(summaryScreen); - if (summaryScreen->data->mode != PSS_MODE_LOCK_MOVES) { + if (summaryScreen->data->mode != SUMMARY_MODE_LOCK_MOVES) { PokemonSummaryScreen_ClearAndPrintButtonPrompt(summaryScreen, 152); - PokemonSummaryScreen_UpdateAButtonSprite(summaryScreen, &summaryScreen->staticWindows[PSS_WINDOW_BUTTON_PROMPT]); + PokemonSummaryScreen_UpdateAButtonSprite(summaryScreen, &summaryScreen->staticWindows[SUMMARY_WINDOW_BUTTON_PROMPT]); } - UpdateMoveInfo(summaryScreen); + UpdateMoveAttributes(summaryScreen); PokemonSummaryScreen_ShowMonIcon(summaryScreen); PokemonSummaryScreen_DrawContestStatDots(summaryScreen); - CellActor_SetDrawFlag(summaryScreen->unk_41C[9], TRUE); + CellActor_SetDrawFlag(summaryScreen->sprites[SUMMARY_SPRITE_MOVE_SELECTOR_1], TRUE); return TRUE; } @@ -1829,35 +1887,35 @@ static u8 SetupContestMoveInfo(PokemonSummaryScreen *summaryScreen) static u8 HideContestMoveInfo(PokemonSummaryScreen *summaryScreen) { - switch (summaryScreen->subscreen) { - case 0: + switch (summaryScreen->pageState) { + case PAGE_STATE_INITIAL: PokemonSummaryScreen_HideContestStatDots(summaryScreen); - SpriteActor_DrawSprite(summaryScreen->unk_41C[19], FALSE); - UpdateAppealHearts(summaryScreen, PSS_MOVE_NONE); - CellActor_SetDrawFlag(summaryScreen->unk_41C[9], FALSE); - Window_ClearAndScheduleCopyToVRAM(&summaryScreen->staticWindows[PSS_WINDOW_BUTTON_PROMPT]); + SpriteActor_DrawSprite(summaryScreen->sprites[SUMMARY_SPRITE_MON_ICON], FALSE); + UpdateAppealHearts(summaryScreen, SUMMARY_MOVE_NONE); + CellActor_SetDrawFlag(summaryScreen->sprites[SUMMARY_SPRITE_MOVE_SELECTOR_1], FALSE); + Window_ClearAndScheduleCopyToVRAM(&summaryScreen->staticWindows[SUMMARY_WINDOW_BUTTON_PROMPT]); PokemonSummaryScreen_UpdateAButtonSprite(summaryScreen, NULL); - HideMoveCancelText(summaryScreen); - PokemonSummaryScreen_ClearContestInfoWindows(summaryScreen); - summaryScreen->subscreen = 1; + PokemonSummaryScreen_HideMoveCancelText(summaryScreen); + PokemonSummaryScreen_ClearContestAttributeWindows(summaryScreen); + summaryScreen->pageState = PAGE_STATE_SCROLLING; break; - case 1: { + case PAGE_STATE_SCROLLING: { int xOffset = Bg_GetXOffset(summaryScreen->bgConfig, BG_LAYER_MAIN_2); if (xOffset >= 128) { Bg_ScheduleScroll(summaryScreen->bgConfig, BG_LAYER_MAIN_2, BG_OFFSET_UPDATE_SET_X, 136); - summaryScreen->subscreen = 2; + summaryScreen->pageState = PAGE_STATE_SCROLL_FINISHED; } else { Bg_ScheduleScroll(summaryScreen->bgConfig, BG_LAYER_MAIN_2, BG_OFFSET_UPDATE_ADD_X, 64); } } break; - case 2: - Window_ScheduleCopyToVRAM(&summaryScreen->staticWindows[PSS_WINDOW_MON_LEVEL]); - Window_ScheduleCopyToVRAM(&summaryScreen->staticWindows[PSS_WINDOW_ITEM_LABEL]); - Window_ScheduleCopyToVRAM(&summaryScreen->staticWindows[PSS_WINDOW_ITEM_NAME]); + case PAGE_STATE_SCROLL_FINISHED: + Window_ScheduleCopyToVRAM(&summaryScreen->staticWindows[SUMMARY_WINDOW_MON_LEVEL]); + Window_ScheduleCopyToVRAM(&summaryScreen->staticWindows[SUMMARY_WINDOW_LABEL_ITEM]); + Window_ScheduleCopyToVRAM(&summaryScreen->staticWindows[SUMMARY_WINDOW_ITEM_NAME]); PokemonSummaryScreen_ClearAndPrintButtonPrompt(summaryScreen, 158); PokemonSummaryScreen_UpdatePageArrows(summaryScreen, TRUE); - PokemonSummaryScreen_UpdateAButtonSprite(summaryScreen, &summaryScreen->staticWindows[PSS_WINDOW_BUTTON_PROMPT]); + PokemonSummaryScreen_UpdateAButtonSprite(summaryScreen, &summaryScreen->staticWindows[SUMMARY_WINDOW_BUTTON_PROMPT]); return TRUE; } @@ -1889,7 +1947,7 @@ static void UpdateAppealHearts(PokemonSummaryScreen *summaryScreen, u32 move) DrawEmptyHearts(summaryScreen); - if (move != PSS_MOVE_NONE) { + if (move != SUMMARY_MOVE_NONE) { effect = MoveTable_LoadParam(move, MOVEATTRIBUTE_CONTEST_EFFECT); numHearts = sub_02095734(effect) / POINTS_PER_APPEAL_HEART; @@ -1903,10 +1961,10 @@ static void UpdateAppealHearts(PokemonSummaryScreen *summaryScreen, u32 move) static void ClearMoveInfoWindows(PokemonSummaryScreen *summaryScreen) { - if (summaryScreen->page == PSS_PAGE_BATTLE_MOVES) { - PokemonSummaryScreen_ClearBattleInfoWindows(summaryScreen); + if (summaryScreen->page == SUMMARY_PAGE_BATTLE_MOVES) { + PokemonSummaryScreen_ClearBattleAttributeWindows(summaryScreen); } else { - PokemonSummaryScreen_ClearContestInfoWindows(summaryScreen); + PokemonSummaryScreen_ClearContestAttributeWindows(summaryScreen); } } @@ -1914,16 +1972,16 @@ static void ClearMoveInfoWindows(PokemonSummaryScreen *summaryScreen) // subscreen input static void SetupMoveInfoFromSubscreenButton(PokemonSummaryScreen *summaryScreen) { - ShowMoveInfoOrCancel(summaryScreen); - UpdateMoveInfo(summaryScreen); + PokemonSummaryScreen_ShowMove5OrCancel(summaryScreen); + UpdateMoveAttributes(summaryScreen); PokemonSummaryScreen_ShowMonIcon(summaryScreen); - if (summaryScreen->page == PSS_PAGE_BATTLE_MOVES) { + if (summaryScreen->page == SUMMARY_PAGE_BATTLE_MOVES) { PokemonSummaryScreen_HideContestStatDots(summaryScreen); - SpriteActor_DrawSprite(summaryScreen->unk_41C[11], TRUE); + SpriteActor_DrawSprite(summaryScreen->sprites[SUMMARY_SPRITE_MON_TYPE_ICON_1], TRUE); if (summaryScreen->monData.type1 != summaryScreen->monData.type2) { - SpriteActor_DrawSprite(summaryScreen->unk_41C[12], TRUE); + SpriteActor_DrawSprite(summaryScreen->sprites[SUMMARY_SPRITE_MON_TYPE_ICON_2], TRUE); } Bg_ScheduleScroll(summaryScreen->bgConfig, BG_LAYER_MAIN_2, 3, 0); @@ -1935,42 +1993,42 @@ static void SetupMoveInfoFromSubscreenButton(PokemonSummaryScreen *summaryScreen static u8 SetupRibbonInfo(PokemonSummaryScreen *summaryScreen) { - switch (summaryScreen->subscreen) { - case 0: + switch (summaryScreen->pageState) { + case PAGE_STATE_INITIAL: Bg_ScheduleScroll(summaryScreen->bgConfig, BG_LAYER_MAIN_2, BG_OFFSET_UPDATE_SET_X, 256); Bg_ScheduleScroll(summaryScreen->bgConfig, BG_LAYER_MAIN_2, BG_OFFSET_UPDATE_SET_Y, 0); PokemonSummaryScreen_UpdatePageArrows(summaryScreen, FALSE); - Window_ClearAndScheduleCopyToVRAM(&summaryScreen->staticWindows[PSS_WINDOW_ITEM_LABEL]); - Window_ClearAndScheduleCopyToVRAM(&summaryScreen->staticWindows[PSS_WINDOW_ITEM_NAME]); - Window_ClearAndScheduleCopyToVRAM(&summaryScreen->staticWindows[30]); - Window_ClearAndScheduleCopyToVRAM(&summaryScreen->staticWindows[PSS_WINDOW_BUTTON_PROMPT]); - Window_ClearAndScheduleCopyToVRAM(&summaryScreen->extraWindows[0]); + Window_ClearAndScheduleCopyToVRAM(&summaryScreen->staticWindows[SUMMARY_WINDOW_LABEL_ITEM]); + Window_ClearAndScheduleCopyToVRAM(&summaryScreen->staticWindows[SUMMARY_WINDOW_ITEM_NAME]); + Window_ClearAndScheduleCopyToVRAM(&summaryScreen->staticWindows[SUMMARY_WINDOW_LABEL_RIBBON_COUNT]); + Window_ClearAndScheduleCopyToVRAM(&summaryScreen->staticWindows[SUMMARY_WINDOW_BUTTON_PROMPT]); + Window_ClearAndScheduleCopyToVRAM(&summaryScreen->extraWindows[SUMMARY_WINDOW_RIBBON_COUNT]); PokemonSummaryScreen_UpdateAButtonSprite(summaryScreen, NULL); summaryScreen->ribbonCol = 0; summaryScreen->ribbonRow = 0; - summaryScreen->subscreen = 1; + summaryScreen->pageState = PAGE_STATE_SCROLLING; break; - case 1: { + case PAGE_STATE_SCROLLING: { int yOffset = Bg_GetYOffset(summaryScreen->bgConfig, BG_LAYER_MAIN_2); if (yOffset >= 48) { Bg_ScheduleScroll(summaryScreen->bgConfig, BG_LAYER_MAIN_2, BG_OFFSET_UPDATE_SET_Y, 56); - summaryScreen->subscreen = 2; + summaryScreen->pageState = PAGE_STATE_SCROLL_FINISHED; } else { Bg_ScheduleScroll(summaryScreen->bgConfig, BG_LAYER_MAIN_2, BG_OFFSET_UPDATE_ADD_Y, 16); } } break; - case 2: + case PAGE_STATE_SCROLL_FINISHED: PokemonSummaryScreen_ClearAndPrintButtonPrompt(summaryScreen, 181); - PokemonSummaryScreen_UpdateAButtonSprite(summaryScreen, &summaryScreen->staticWindows[PSS_WINDOW_BUTTON_PROMPT]); - CellActor_SetDrawFlag(summaryScreen->unk_41C[67], TRUE); - CellActor_SetDrawFlag(summaryScreen->unk_41C[70], TRUE); - CellActor_SetDrawFlag(summaryScreen->unk_41C[63], FALSE); - CellActor_SetDrawFlag(summaryScreen->unk_41C[64], FALSE); - CellActor_SetDrawFlag(summaryScreen->unk_41C[65], FALSE); - CellActor_SetDrawFlag(summaryScreen->unk_41C[66], FALSE); + PokemonSummaryScreen_UpdateAButtonSprite(summaryScreen, &summaryScreen->staticWindows[SUMMARY_WINDOW_BUTTON_PROMPT]); + CellActor_SetDrawFlag(summaryScreen->sprites[SUMMARY_SPRITE_RIBBON_CURSOR], TRUE); + CellActor_SetDrawFlag(summaryScreen->sprites[SUMMARY_SPRITE_RIBBON_FLASH], TRUE); + CellActor_SetDrawFlag(summaryScreen->sprites[SUMMARY_SPRITE_RIBBON_9], FALSE); + CellActor_SetDrawFlag(summaryScreen->sprites[SUMMARY_SPRITE_RIBBON_10], FALSE); + CellActor_SetDrawFlag(summaryScreen->sprites[SUMMARY_SPRITE_RIBBON_11], FALSE); + CellActor_SetDrawFlag(summaryScreen->sprites[SUMMARY_SPRITE_RIBBON_12], FALSE); ChangeSelectedRibbon(summaryScreen, 0); return TRUE; @@ -1981,37 +2039,37 @@ static u8 SetupRibbonInfo(PokemonSummaryScreen *summaryScreen) static u8 HideRibbonInfo(PokemonSummaryScreen *summaryScreen) { - switch (summaryScreen->subscreen) { - case 0: + switch (summaryScreen->pageState) { + case PAGE_STATE_INITIAL: summaryScreen->ribbonCol = 0; summaryScreen->ribbonRow = 0; - Window_ClearAndScheduleCopyToVRAM(&summaryScreen->extraWindows[1]); - Window_ClearAndScheduleCopyToVRAM(&summaryScreen->extraWindows[2]); - Window_ClearAndScheduleCopyToVRAM(&summaryScreen->extraWindows[3]); - Window_ClearAndScheduleCopyToVRAM(&summaryScreen->staticWindows[PSS_WINDOW_BUTTON_PROMPT]); + Window_ClearAndScheduleCopyToVRAM(&summaryScreen->extraWindows[SUMMARY_WINDOW_RIBBON_INDEX]); + Window_ClearAndScheduleCopyToVRAM(&summaryScreen->extraWindows[SUMMARY_WINDOW_RIBBON_NAME]); + Window_ClearAndScheduleCopyToVRAM(&summaryScreen->extraWindows[SUMMARY_WINDOW_RIBBON_DESCRIPTION]); + Window_ClearAndScheduleCopyToVRAM(&summaryScreen->staticWindows[SUMMARY_WINDOW_BUTTON_PROMPT]); PokemonSummaryScreen_UpdateAButtonSprite(summaryScreen, NULL); - sub_0208FA04(summaryScreen); - summaryScreen->subscreen = 1; + PokemonSummaryScreen_UpdateRibbonSprites(summaryScreen); + summaryScreen->pageState = PAGE_STATE_SCROLLING; break; - case 1: { + case PAGE_STATE_SCROLLING: { int yOffset = Bg_GetYOffset(summaryScreen->bgConfig, BG_LAYER_MAIN_2); if (yOffset <= 8) { Bg_ScheduleScroll(summaryScreen->bgConfig, BG_LAYER_MAIN_2, BG_OFFSET_UPDATE_SET_Y, 0); - summaryScreen->subscreen = 2; + summaryScreen->pageState = PAGE_STATE_SCROLL_FINISHED; } else { Bg_ScheduleScroll(summaryScreen->bgConfig, BG_LAYER_MAIN_2, BG_OFFSET_UPDATE_SUB_Y, 16); } } break; - case 2: - Window_ScheduleCopyToVRAM(&summaryScreen->staticWindows[PSS_WINDOW_ITEM_LABEL]); - Window_ScheduleCopyToVRAM(&summaryScreen->staticWindows[PSS_WINDOW_ITEM_NAME]); - Window_ScheduleCopyToVRAM(&summaryScreen->staticWindows[30]); - Window_ScheduleCopyToVRAM(&summaryScreen->staticWindows[PSS_WINDOW_BUTTON_PROMPT]); - Window_ScheduleCopyToVRAM(&summaryScreen->extraWindows[0]); + case PAGE_STATE_SCROLL_FINISHED: + Window_ScheduleCopyToVRAM(&summaryScreen->staticWindows[SUMMARY_WINDOW_LABEL_ITEM]); + Window_ScheduleCopyToVRAM(&summaryScreen->staticWindows[SUMMARY_WINDOW_ITEM_NAME]); + Window_ScheduleCopyToVRAM(&summaryScreen->staticWindows[SUMMARY_WINDOW_LABEL_RIBBON_COUNT]); + Window_ScheduleCopyToVRAM(&summaryScreen->staticWindows[SUMMARY_WINDOW_BUTTON_PROMPT]); + Window_ScheduleCopyToVRAM(&summaryScreen->extraWindows[SUMMARY_WINDOW_RIBBON_COUNT]); PokemonSummaryScreen_ClearAndPrintButtonPrompt(summaryScreen, 180); PokemonSummaryScreen_UpdatePageArrows(summaryScreen, TRUE); - PokemonSummaryScreen_UpdateAButtonSprite(summaryScreen, &summaryScreen->staticWindows[PSS_WINDOW_BUTTON_PROMPT]); + PokemonSummaryScreen_UpdateAButtonSprite(summaryScreen, &summaryScreen->staticWindows[SUMMARY_WINDOW_BUTTON_PROMPT]); return TRUE; } @@ -2080,15 +2138,15 @@ static void ChangeSelectedRibbon(PokemonSummaryScreen *summaryScreen, s8 delta) PokemonSummaryScreen_PrintRibbonIndexAndMax(summaryScreen); if (summaryScreen->ribbonRow != 0) { - CellActor_SetDrawFlag(summaryScreen->unk_41C[68], TRUE); + CellActor_SetDrawFlag(summaryScreen->sprites[SUMMARY_SPRITE_RIBBON_ARROW_UP], TRUE); } else { - CellActor_SetDrawFlag(summaryScreen->unk_41C[68], FALSE); + CellActor_SetDrawFlag(summaryScreen->sprites[SUMMARY_SPRITE_RIBBON_ARROW_UP], FALSE); } if ((summaryScreen->ribbonRow * RIBBONS_PER_ROW + RIBBONS_PER_ROW * 2) < summaryScreen->ribbonMax) { - CellActor_SetDrawFlag(summaryScreen->unk_41C[69], TRUE); + CellActor_SetDrawFlag(summaryScreen->sprites[SUMMARY_SPRITE_RIBBON_ARROW_DOWN], TRUE); } else { - CellActor_SetDrawFlag(summaryScreen->unk_41C[69], FALSE); + CellActor_SetDrawFlag(summaryScreen->sprites[SUMMARY_SPRITE_RIBBON_ARROW_DOWN], FALSE); } } @@ -2116,14 +2174,14 @@ static int TryFeedPoffin(PokemonSummaryScreen *summaryScreen) if (summaryScreen->monData.sheen == MAX_POKEMON_SHEEN) { Font_LoadScreenIndicatorsPalette(0, PLTT_OFFSET(14), HEAP_ID_POKEMON_SUMMARY_SCREEN); LoadMessageBoxGraphics(summaryScreen->bgConfig, BG_LAYER_MAIN_1, (1024 - (18 + 12)), 13, Options_Frame(summaryScreen->data->options), HEAP_ID_POKEMON_SUMMARY_SCREEN); - PokemonSummaryScreen_PrintPoffinFeedMsg(summaryScreen, PSS_MSG_MON_WONT_EAT_MORE); - summaryScreen->data->returnMode = 1; + PokemonSummaryScreen_PrintPoffinFeedMsg(summaryScreen, SUMMARY_MSG_MON_WONT_EAT_MORE); + summaryScreen->data->returnMode = SUMMARY_RETURN_CANCEL; - return PSS_STATE_WAIT_FINISH_POFFIN_FEED; + return SUMMARY_STATE_WAIT_FINISH_POFFIN_FEED; } - summaryScreen->data->returnMode = 0; - return PSS_STATE_TRANSITION_OUT; + summaryScreen->data->returnMode = SUMMARY_RETURN_SELECT; + return SUMMARY_STATE_TRANSITION_OUT; } void PokemonSummaryScreen_SetPlayerProfile(PokemonSummary *summary, const TrainerInfo *trainerInfo) diff --git a/src/applications/pokemon_summary_screen/sprite.c b/src/applications/pokemon_summary_screen/sprite.c index 37c40ca95a..d120b5314c 100644 --- a/src/applications/pokemon_summary_screen/sprite.c +++ b/src/applications/pokemon_summary_screen/sprite.c @@ -4,9 +4,12 @@ #include #include "constants/narc.h" +#include "constants/pokemon.h" +#include "consts/items.h" #include "applications/pokemon_summary_screen/main.h" #include "applications/pokemon_summary_screen/subscreen.h" +#include "graphics/pokemon_summary_screen/pl_pst_gra.naix" #include "overlay007/struct_ov7_0224F2EC.h" #include "overlay007/struct_ov7_0224F358.h" #include "overlay104/struct_ov104_022412F4.h" @@ -23,280 +26,351 @@ #include "unk_0201DBEC.h" #include "unk_0207C908.h" -static void sub_0208F194(PokemonSummaryScreen *param0, u8 param1, u8 param2, u8 param3); -static void sub_0208EF0C(PokemonSummaryScreen *param0); -static void sub_0208FC30(CellActor *param0, u32 param1, u32 param2, const s16 *param3); +static void SetTypeIcon(PokemonSummaryScreen *summaryScreen, u8 spriteIndex, u8 param2, u8 type); +static void SetMonAndTypeIcons(PokemonSummaryScreen *summaryScreen); +static void DrawConditionFlash(CellActor *sprite, u32 statValue, u32 highestValue, const s16 *bounds); + +// the summary screen refers to the contest stats in the order they appear in the condition +// screen clock-wise, not the order used elsewhere +enum SummaryContestType { + SUMMARY_CONTEST_TYPE_COOL = 0, + SUMMARY_CONTEST_TYPE_BEAUTY, + SUMMARY_CONTEST_TYPE_CUTE, + SUMMARY_CONTEST_TYPE_SMART, + SUMMARY_CONTEST_TYPE_TOUGH, +}; + +enum ConditionFlashBounds { + FLASH_MAX_X = 0, + FLASH_MAX_Y, + FLASH_MIN_X, + FLASH_MIN_Y, + + FLASH_BOUNDS_MAX, +}; + +#define MAX_SHEEN_SPRITES SUMMARY_SHEEN_SPRITES_END - SUMMARY_SHEEN_SPRITES_START + 1 +#define MAX_CONDITION_ARROW_SPRITES SUMMARY_CONDITION_ARROW_SPRITES_END - SUMMARY_CONDITION_ARROW_SPRITES_START + 1 +#define MAX_CONDITION_FLASH_SPRITES SUMMARY_CONDITION_FLASH_SPRITES_END - SUMMARY_CONDITION_FLASH_SPRITES_START + 1 + +#define RIBBON_CURSOR_BASE_X 132 +#define RIBBON_CURSOR_BASE_Y 56 +#define RIBBON_SPACING_X 32 +#define RIBBON_SPACING_Y 40 + +#define MOVE_SELECTOR_X 194 +#define MOVE_SELECTOR_BASE_Y 48 +#define PIXELS_BETWEEN_MOVES 32 + +#define CENTERED_TAB_POS_X 188 +#define FOCUSED_TAB_WIDTH 24 +#define UNFOCUSED_TAB_WIDTH 16 + +#define PAGE_ARROW_LEFT_X -12 +#define PAGE_ARROW_RIGHT_X -4 +#define PAGE_ARROW_Y 24 + +// info page type icons +#define INFO_SOLO_MON_TYPE_ICON_X 216 +#define INFO_MON_TYPE_ICON_1_X 199 +#define INFO_MON_TYPE_ICON_2_X 233 +#define INFO_MON_TYPE_ICON_Y 80 + +// moves page type icons +#define MOVES_MON_TYPE_ICON_1_X 63 +#define MOVES_MON_TYPE_ICON_2_X 97 +#define MOVES_MON_TYPE_ICON_Y 52 + +#define MOVE_TYPE_ICON_X 151 +#define MOVE_TYPE_ICON_BASE_Y 42 + +#define MOVE_CATEGORY_ICON_X 108 +#define MOVE_CATEGORY_ICON_Y 72 + +// contest stat dot position info for the contest move info +#define COOL_MAX_X 88 +#define COOL_MIN_X 88 +#define COOL_MAX_Y 49 +#define COOL_MIN_Y 73 + +#define BEAUTY_MAX_X 110 +#define BEAUTY_MIN_X 88 +#define BEAUTY_MAX_Y 65 +#define BEAUTY_MIN_Y 73 + +#define CUTE_MAX_X 103 +#define CUTE_MIN_X 88 +#define CUTE_MAX_Y 92 +#define CUTE_MIN_Y 73 + +#define SMART_MAX_X 72 +#define SMART_MIN_X 87 +#define SMART_MAX_Y 92 +#define SMART_MIN_Y 73 + +#define TOUGH_MAX_X 65 +#define TOUGH_MIN_X 87 +#define TOUGH_MAX_Y 65 +#define TOUGH_MIN_Y 73 + +#define DOT_MAX_POS 300 +#define DOT_MIN_POS 44 static const UnkStruct_ov7_0224F358 Unk_020F41A8[] = { - { 0x1, 0x80, 0x18, 0x0, 0x0, 0x1, 0x1, NNS_G2D_VRAM_TYPE_2DMAIN, 0x0, 0x0, 0x0, 0x0 }, - { 0x1, 0x90, 0x18, 0x0, 0x1, 0x1, 0x1, NNS_G2D_VRAM_TYPE_2DMAIN, 0x0, 0x0, 0x0, 0x0 }, - { 0x1, 0xA0, 0x18, 0x0, 0x2, 0x1, 0x1, NNS_G2D_VRAM_TYPE_2DMAIN, 0x0, 0x0, 0x0, 0x0 }, - { 0x1, 0xB0, 0x18, 0x0, 0x3, 0x1, 0x2, NNS_G2D_VRAM_TYPE_2DMAIN, 0x0, 0x0, 0x0, 0x0 }, - { 0x1, 0xC0, 0x18, 0x0, 0x4, 0x1, 0x1, NNS_G2D_VRAM_TYPE_2DMAIN, 0x0, 0x0, 0x0, 0x0 }, - { 0x1, 0xD0, 0x18, 0x0, 0x5, 0x1, 0x2, NNS_G2D_VRAM_TYPE_2DMAIN, 0x0, 0x0, 0x0, 0x0 }, - { 0x1, 0xE0, 0x18, 0x0, 0x6, 0x1, 0x2, NNS_G2D_VRAM_TYPE_2DMAIN, 0x0, 0x0, 0x0, 0x0 }, - { 0x1, 0xF0, 0x18, 0x0, 0x7, 0x1, 0x2, NNS_G2D_VRAM_TYPE_2DMAIN, 0x0, 0x0, 0x0, 0x0 }, - { 0x0, 0x10, 0x20, 0x0, 0x0, 0x0, 0xC, NNS_G2D_VRAM_TYPE_2DMAIN, 0x0, 0x0, 0x0, 0x0 }, - { 0x2, 0xC2, 0x30, 0x0, 0x0, 0x1, 0x2, NNS_G2D_VRAM_TYPE_2DMAIN, 0x0, 0x0, 0x0, 0x0 }, - { 0x2, 0xC2, 0x30, 0x0, 0x1, 0x0, 0x2, NNS_G2D_VRAM_TYPE_2DMAIN, 0x0, 0x0, 0x0, 0x0 }, - { 0x3, 0x0, 0x0, 0x0, 0x0, 0x0, 0x1, NNS_G2D_VRAM_TYPE_2DMAIN, 0x0, 0x0, 0x0, 0x0 }, - { 0x4, 0x0, 0x0, 0x0, 0x0, 0x0, 0x1, NNS_G2D_VRAM_TYPE_2DMAIN, 0x0, 0x0, 0x0, 0x0 }, - { 0x5, 0x0, 0x0, 0x0, 0x0, 0x0, 0x1, NNS_G2D_VRAM_TYPE_2DMAIN, 0x0, 0x0, 0x0, 0x0 }, - { 0x6, 0x0, 0x0, 0x0, 0x0, 0x0, 0x1, NNS_G2D_VRAM_TYPE_2DMAIN, 0x0, 0x0, 0x0, 0x0 }, - { 0x7, 0x0, 0x0, 0x0, 0x0, 0x0, 0x1, NNS_G2D_VRAM_TYPE_2DMAIN, 0x0, 0x0, 0x0, 0x0 }, - { 0x8, 0x0, 0x0, 0x0, 0x0, 0x0, 0x1, NNS_G2D_VRAM_TYPE_2DMAIN, 0x0, 0x0, 0x0, 0x0 }, - { 0x9, 0x0, 0x0, 0x0, 0x0, 0x0, 0x1, NNS_G2D_VRAM_TYPE_2DMAIN, 0x0, 0x0, 0x0, 0x0 }, - { 0xA, 0x0, 0x0, 0x0, 0x0, 0x0, 0x1, NNS_G2D_VRAM_TYPE_2DMAIN, 0x0, 0x0, 0x0, 0x0 }, - { 0xB, 0x18, 0x30, 0x0, 0x0, 0x0, 0x4, NNS_G2D_VRAM_TYPE_2DMAIN, 0x0, 0x0, 0x0, 0x0 }, - { 0xC, 0x50, 0x34, 0x0, 0x0, 0x0, 0x6, NNS_G2D_VRAM_TYPE_2DMAIN, 0x0, 0x0, 0x0, 0x0 }, - { 0xE, 0x0, 0x18, 0x0, 0x0, 0x0, 0x1, NNS_G2D_VRAM_TYPE_2DMAIN, 0x0, 0x0, 0x0, 0x0 }, - { 0xE, 0x0, 0x18, 0x0, 0x1, 0x0, 0x1, NNS_G2D_VRAM_TYPE_2DMAIN, 0x0, 0x0, 0x0, 0x0 }, - { 0x12, 0x30, 0x96, 0x0, 0x0, 0x0, 0x0, NNS_G2D_VRAM_TYPE_2DMAIN, 0x0, 0x0, 0x0, 0x0 }, - { 0x13, 0x38, 0x96, 0x0, 0x0, 0x0, 0x0, NNS_G2D_VRAM_TYPE_2DMAIN, 0x0, 0x0, 0x0, 0x0 }, - { 0x14, 0x40, 0x96, 0x0, 0x0, 0x0, 0x0, NNS_G2D_VRAM_TYPE_2DMAIN, 0x0, 0x0, 0x0, 0x0 }, - { 0x15, 0x48, 0x96, 0x0, 0x0, 0x0, 0x0, NNS_G2D_VRAM_TYPE_2DMAIN, 0x0, 0x0, 0x0, 0x0 }, - { 0x16, 0x50, 0x96, 0x0, 0x0, 0x0, 0x0, NNS_G2D_VRAM_TYPE_2DMAIN, 0x0, 0x0, 0x0, 0x0 }, - { 0x17, 0x58, 0x96, 0x0, 0x0, 0x0, 0x0, NNS_G2D_VRAM_TYPE_2DMAIN, 0x0, 0x0, 0x0, 0x0 }, - { 0xD, 0x98, 0xA8, 0x0, 0x0, 0x0, 0x2, NNS_G2D_VRAM_TYPE_2DMAIN, 0x0, 0x0, 0x0, 0x0 }, - { 0xD, 0xA0, 0xA8, 0x0, 0x0, 0x0, 0x2, NNS_G2D_VRAM_TYPE_2DMAIN, 0x0, 0x0, 0x0, 0x0 }, - { 0xD, 0xA8, 0xA8, 0x0, 0x0, 0x0, 0x2, NNS_G2D_VRAM_TYPE_2DMAIN, 0x0, 0x0, 0x0, 0x0 }, - { 0xD, 0xB0, 0xA8, 0x0, 0x0, 0x0, 0x2, NNS_G2D_VRAM_TYPE_2DMAIN, 0x0, 0x0, 0x0, 0x0 }, - { 0xD, 0xB8, 0xA8, 0x0, 0x0, 0x0, 0x2, NNS_G2D_VRAM_TYPE_2DMAIN, 0x0, 0x0, 0x0, 0x0 }, - { 0xD, 0xC0, 0xA8, 0x0, 0x0, 0x0, 0x2, NNS_G2D_VRAM_TYPE_2DMAIN, 0x0, 0x0, 0x0, 0x0 }, - { 0xD, 0xC8, 0xA8, 0x0, 0x0, 0x0, 0x2, NNS_G2D_VRAM_TYPE_2DMAIN, 0x0, 0x0, 0x0, 0x0 }, - { 0xD, 0xD0, 0xA8, 0x0, 0x0, 0x0, 0x2, NNS_G2D_VRAM_TYPE_2DMAIN, 0x0, 0x0, 0x0, 0x0 }, - { 0xD, 0xD8, 0xA8, 0x0, 0x0, 0x0, 0x2, NNS_G2D_VRAM_TYPE_2DMAIN, 0x0, 0x0, 0x0, 0x0 }, - { 0xD, 0xE0, 0xA8, 0x0, 0x0, 0x0, 0x2, NNS_G2D_VRAM_TYPE_2DMAIN, 0x0, 0x0, 0x0, 0x0 }, - { 0xD, 0xE8, 0xA8, 0x0, 0x0, 0x0, 0x2, NNS_G2D_VRAM_TYPE_2DMAIN, 0x0, 0x0, 0x0, 0x0 }, - { 0xD, 0xF0, 0xA8, 0x0, 0x0, 0x0, 0x2, NNS_G2D_VRAM_TYPE_2DMAIN, 0x0, 0x0, 0x0, 0x0 }, - { 0xF, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, NNS_G2D_VRAM_TYPE_2DMAIN, 0x0, 0x0, 0x0, 0x0 }, - { 0x10, 0xD0, 0x30, 0x0, 0x0, 0x0, 0x0, NNS_G2D_VRAM_TYPE_2DMAIN, 0x0, 0x0, 0x0, 0x0 }, - { 0x10, 0xE0, 0x58, 0x0, 0x0, 0x0, 0x0, NNS_G2D_VRAM_TYPE_2DMAIN, 0x0, 0x0, 0x0, 0x0 }, - { 0x10, 0xD8, 0x78, 0x0, 0x0, 0x0, 0x0, NNS_G2D_VRAM_TYPE_2DMAIN, 0x0, 0x0, 0x0, 0x0 }, - { 0x10, 0x90, 0x78, 0x0, 0x0, 0x0, 0x0, NNS_G2D_VRAM_TYPE_2DMAIN, 0x0, 0x0, 0x0, 0x0 }, - { 0x10, 0x88, 0x58, 0x0, 0x0, 0x0, 0x0, NNS_G2D_VRAM_TYPE_2DMAIN, 0x0, 0x0, 0x0, 0x0 }, - { 0x11, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, NNS_G2D_VRAM_TYPE_2DMAIN, 0x0, 0x0, 0x0, 0x0 }, - { 0x19, 0x0, 0x0, 0x0, 0x0, 0x0, 0x2, NNS_G2D_VRAM_TYPE_2DMAIN, 0x0, 0x0, 0x0, 0x0 }, - { 0x19, 0x0, 0x0, 0x0, 0x1, 0x0, 0x1, NNS_G2D_VRAM_TYPE_2DMAIN, 0x0, 0x0, 0x0, 0x0 }, - { 0x19, 0x0, 0x0, 0x0, 0x3, 0x0, 0x2, NNS_G2D_VRAM_TYPE_2DMAIN, 0x0, 0x0, 0x0, 0x0 }, - { 0x19, 0x0, 0x0, 0x0, 0x2, 0x0, 0x1, NNS_G2D_VRAM_TYPE_2DMAIN, 0x0, 0x0, 0x0, 0x0 }, - { 0x19, 0x0, 0x0, 0x0, 0x4, 0x0, 0x0, NNS_G2D_VRAM_TYPE_2DMAIN, 0x0, 0x0, 0x0, 0x0 }, - { 0x18, 0x62, 0x48, 0x0, 0x0, 0x0, 0x2, NNS_G2D_VRAM_TYPE_2DMAIN, 0x0, 0x0, 0x0, 0x0 }, - { 0x18, 0x62, 0x84, 0x0, 0x1, 0x0, 0x2, NNS_G2D_VRAM_TYPE_2DMAIN, 0x0, 0x0, 0x0, 0x0 }, - { 0x1A, 0x84, 0x38, 0x0, 0x0, 0x0, 0x0, NNS_G2D_VRAM_TYPE_2DMAIN, 0x0, 0x0, 0x0, 0x0 }, - { 0x1B, 0xA4, 0x38, 0x0, 0x0, 0x0, 0x0, NNS_G2D_VRAM_TYPE_2DMAIN, 0x0, 0x0, 0x0, 0x0 }, - { 0x1C, 0xC4, 0x38, 0x0, 0x0, 0x0, 0x0, NNS_G2D_VRAM_TYPE_2DMAIN, 0x0, 0x0, 0x0, 0x0 }, - { 0x1D, 0xE4, 0x38, 0x0, 0x0, 0x0, 0x0, NNS_G2D_VRAM_TYPE_2DMAIN, 0x0, 0x0, 0x0, 0x0 }, - { 0x1E, 0x84, 0x60, 0x0, 0x0, 0x0, 0x0, NNS_G2D_VRAM_TYPE_2DMAIN, 0x0, 0x0, 0x0, 0x0 }, - { 0x1F, 0xA4, 0x60, 0x0, 0x0, 0x0, 0x0, NNS_G2D_VRAM_TYPE_2DMAIN, 0x0, 0x0, 0x0, 0x0 }, - { 0x20, 0xC4, 0x60, 0x0, 0x0, 0x0, 0x0, NNS_G2D_VRAM_TYPE_2DMAIN, 0x0, 0x0, 0x0, 0x0 }, - { 0x21, 0xE4, 0x60, 0x0, 0x0, 0x0, 0x0, NNS_G2D_VRAM_TYPE_2DMAIN, 0x0, 0x0, 0x0, 0x0 }, - { 0x22, 0x84, 0x88, 0x0, 0x0, 0x0, 0x0, NNS_G2D_VRAM_TYPE_2DMAIN, 0x0, 0x0, 0x0, 0x0 }, - { 0x23, 0xA4, 0x88, 0x0, 0x0, 0x0, 0x0, NNS_G2D_VRAM_TYPE_2DMAIN, 0x0, 0x0, 0x0, 0x0 }, - { 0x24, 0xC4, 0x88, 0x0, 0x0, 0x0, 0x0, NNS_G2D_VRAM_TYPE_2DMAIN, 0x0, 0x0, 0x0, 0x0 }, - { 0x25, 0xE4, 0x88, 0x0, 0x0, 0x0, 0x0, NNS_G2D_VRAM_TYPE_2DMAIN, 0x0, 0x0, 0x0, 0x0 }, - { 0x26, 0x84, 0x38, 0x0, 0x0, 0x0, 0x2, NNS_G2D_VRAM_TYPE_2DMAIN, 0x0, 0x0, 0x0, 0x0 }, - { 0x27, 0xB4, 0x20, 0x0, 0x1, 0x0, 0x1, NNS_G2D_VRAM_TYPE_2DMAIN, 0x0, 0x0, 0x0, 0x0 }, - { 0x27, 0xB4, 0x78, 0x0, 0x0, 0x0, 0x1, NNS_G2D_VRAM_TYPE_2DMAIN, 0x0, 0x0, 0x0, 0x0 }, - { 0x28, 0x8, 0x84, 0x0, 0x0, 0x0, 0x2, NNS_G2D_VRAM_TYPE_2DMAIN, 0x0, 0x0, 0x0, 0x0 }, - { 0x29, 0x84, 0x38, 0x0, 0x0, 0x0, 0x2, NNS_G2D_VRAM_TYPE_2DMAIN, 0x0, 0x0, 0x0, 0x0 }, - { 0x29, 0x84, 0x38, 0x0, 0x0, 0x0, 0x2, NNS_G2D_VRAM_TYPE_2DMAIN, 0x0, 0x0, 0x0, 0x0 }, - { 0x29, 0x84, 0x38, 0x0, 0x0, 0x0, 0x2, NNS_G2D_VRAM_TYPE_2DMAIN, 0x0, 0x0, 0x0, 0x0 }, - { 0x29, 0x84, 0x38, 0x0, 0x0, 0x0, 0x2, NNS_G2D_VRAM_TYPE_2DMAIN, 0x0, 0x0, 0x0, 0x0 }, - { 0x29, 0x84, 0x38, 0x0, 0x0, 0x0, 0x2, NNS_G2D_VRAM_TYPE_2DMAIN, 0x0, 0x0, 0x0, 0x0 }, - { 0x2A, 0x4C, 0x30, 0x0, 0x0, 0x0, 0x1, NNS_G2D_VRAM_TYPE_2DMAIN, 0x0, 0x0, 0x0, 0x0 } + [SUMMARY_SPRITE_TAB_INFO] = { 0x1, 0x80, 0x18, 0x0, 0x0, 0x1, 0x1, NNS_G2D_VRAM_TYPE_2DMAIN, 0x0, 0x0, 0x0, 0x0 }, + [SUMMARY_SPRITE_TAB_MEMO] = { 0x1, 0x90, 0x18, 0x0, 0x1, 0x1, 0x1, NNS_G2D_VRAM_TYPE_2DMAIN, 0x0, 0x0, 0x0, 0x0 }, + [SUMMARY_SPRITE_TAB_SKILLS] = { 0x1, 0xA0, 0x18, 0x0, 0x2, 0x1, 0x1, NNS_G2D_VRAM_TYPE_2DMAIN, 0x0, 0x0, 0x0, 0x0 }, + [SUMMARY_SPRITE_TAB_BATTLE_MOVES] = { 0x1, 0xB0, 0x18, 0x0, 0x3, 0x1, 0x2, NNS_G2D_VRAM_TYPE_2DMAIN, 0x0, 0x0, 0x0, 0x0 }, + [SUMMARY_SPRITE_TAB_CONDITION] = { 0x1, 0xC0, 0x18, 0x0, 0x4, 0x1, 0x1, NNS_G2D_VRAM_TYPE_2DMAIN, 0x0, 0x0, 0x0, 0x0 }, + [SUMMARY_SPRITE_TAB_CONTEST_MOVES] = { 0x1, 0xD0, 0x18, 0x0, 0x5, 0x1, 0x2, NNS_G2D_VRAM_TYPE_2DMAIN, 0x0, 0x0, 0x0, 0x0 }, + [SUMMARY_SPRITE_TAB_RIBBONS] = { 0x1, 0xE0, 0x18, 0x0, 0x6, 0x1, 0x2, NNS_G2D_VRAM_TYPE_2DMAIN, 0x0, 0x0, 0x0, 0x0 }, + [SUMMARY_SPRITE_TAB_EXIT] = { 0x1, 0xF0, 0x18, 0x0, 0x7, 0x1, 0x2, NNS_G2D_VRAM_TYPE_2DMAIN, 0x0, 0x0, 0x0, 0x0 }, + [SUMMARY_SPRITE_CAUGHT_BALL] = { 0x0, 0x10, 0x20, 0x0, 0x0, 0x0, 0xC, NNS_G2D_VRAM_TYPE_2DMAIN, 0x0, 0x0, 0x0, 0x0 }, + [SUMMARY_SPRITE_MOVE_SELECTOR_1] = { 0x2, 0xC2, 0x30, 0x0, 0x0, 0x1, 0x2, NNS_G2D_VRAM_TYPE_2DMAIN, 0x0, 0x0, 0x0, 0x0 }, + [SUMMARY_SPRITE_MOVE_SELECTOR_2] = { 0x2, 0xC2, 0x30, 0x0, 0x1, 0x0, 0x2, NNS_G2D_VRAM_TYPE_2DMAIN, 0x0, 0x0, 0x0, 0x0 }, + [SUMMARY_SPRITE_MON_TYPE_ICON_1] = { 0x3, 0x0, 0x0, 0x0, 0x0, 0x0, 0x1, NNS_G2D_VRAM_TYPE_2DMAIN, 0x0, 0x0, 0x0, 0x0 }, + [SUMMARY_SPRITE_MON_TYPE_ICON_2] = { 0x4, 0x0, 0x0, 0x0, 0x0, 0x0, 0x1, NNS_G2D_VRAM_TYPE_2DMAIN, 0x0, 0x0, 0x0, 0x0 }, + [SUMMARY_SPRITE_MOVE_TYPE_ICON_1] = { 0x5, 0x0, 0x0, 0x0, 0x0, 0x0, 0x1, NNS_G2D_VRAM_TYPE_2DMAIN, 0x0, 0x0, 0x0, 0x0 }, + [SUMMARY_SPRITE_MOVE_TYPE_ICON_2] = { 0x6, 0x0, 0x0, 0x0, 0x0, 0x0, 0x1, NNS_G2D_VRAM_TYPE_2DMAIN, 0x0, 0x0, 0x0, 0x0 }, + [SUMMARY_SPRITE_MOVE_TYPE_ICON_3] = { 0x7, 0x0, 0x0, 0x0, 0x0, 0x0, 0x1, NNS_G2D_VRAM_TYPE_2DMAIN, 0x0, 0x0, 0x0, 0x0 }, + [SUMMARY_SPRITE_MOVE_TYPE_ICON_4] = { 0x8, 0x0, 0x0, 0x0, 0x0, 0x0, 0x1, NNS_G2D_VRAM_TYPE_2DMAIN, 0x0, 0x0, 0x0, 0x0 }, + [SUMMARY_SPRITE_MOVE_TYPE_ICON_5] = { 0x9, 0x0, 0x0, 0x0, 0x0, 0x0, 0x1, NNS_G2D_VRAM_TYPE_2DMAIN, 0x0, 0x0, 0x0, 0x0 }, + [SUMMARY_SPRITE_MOVE_CATEGORY_ICON] = { 0xA, 0x0, 0x0, 0x0, 0x0, 0x0, 0x1, NNS_G2D_VRAM_TYPE_2DMAIN, 0x0, 0x0, 0x0, 0x0 }, + [SUMMARY_SPRITE_MON_ICON] = { 0xB, 0x18, 0x30, 0x0, 0x0, 0x0, 0x4, NNS_G2D_VRAM_TYPE_2DMAIN, 0x0, 0x0, 0x0, 0x0 }, + [SUMMARY_SPRITE_STATUS_ICON] = { 0xC, 0x50, 0x34, 0x0, 0x0, 0x0, 0x6, NNS_G2D_VRAM_TYPE_2DMAIN, 0x0, 0x0, 0x0, 0x0 }, + [SUMMARY_SPRITE_PAGE_ARROW_LEFT] = { 0xE, 0x0, 0x18, 0x0, 0x0, 0x0, 0x1, NNS_G2D_VRAM_TYPE_2DMAIN, 0x0, 0x0, 0x0, 0x0 }, + [SUMMARY_SPRITE_PAGE_ARROW_RIGHT] = { 0xE, 0x0, 0x18, 0x0, 0x1, 0x0, 0x1, NNS_G2D_VRAM_TYPE_2DMAIN, 0x0, 0x0, 0x0, 0x0 }, + [SUMMARY_SPRITE_MARKING_CIRCLE] = { 0x12, 0x30, 0x96, 0x0, 0x0, 0x0, 0x0, NNS_G2D_VRAM_TYPE_2DMAIN, 0x0, 0x0, 0x0, 0x0 }, + [SUMMARY_SPRITE_MARKING_TRIANGLE] = { 0x13, 0x38, 0x96, 0x0, 0x0, 0x0, 0x0, NNS_G2D_VRAM_TYPE_2DMAIN, 0x0, 0x0, 0x0, 0x0 }, + [SUMMARY_SPRITE_MARKING_SQUARE] = { 0x14, 0x40, 0x96, 0x0, 0x0, 0x0, 0x0, NNS_G2D_VRAM_TYPE_2DMAIN, 0x0, 0x0, 0x0, 0x0 }, + [SUMMARY_SPRITE_MARKING_HEART] = { 0x15, 0x48, 0x96, 0x0, 0x0, 0x0, 0x0, NNS_G2D_VRAM_TYPE_2DMAIN, 0x0, 0x0, 0x0, 0x0 }, + [SUMMARY_SPRITE_MARKING_STAR] = { 0x16, 0x50, 0x96, 0x0, 0x0, 0x0, 0x0, NNS_G2D_VRAM_TYPE_2DMAIN, 0x0, 0x0, 0x0, 0x0 }, + [SUMMARY_SPRITE_MARKING_DIAMOND] = { 0x17, 0x58, 0x96, 0x0, 0x0, 0x0, 0x0, NNS_G2D_VRAM_TYPE_2DMAIN, 0x0, 0x0, 0x0, 0x0 }, + [SUMMARY_SPRITE_SHEEN_1] = { 0xD, 0x98, 0xA8, 0x0, 0x0, 0x0, 0x2, NNS_G2D_VRAM_TYPE_2DMAIN, 0x0, 0x0, 0x0, 0x0 }, + [SUMMARY_SPRITE_SHEEN_2] = { 0xD, 0xA0, 0xA8, 0x0, 0x0, 0x0, 0x2, NNS_G2D_VRAM_TYPE_2DMAIN, 0x0, 0x0, 0x0, 0x0 }, + [SUMMARY_SPRITE_SHEEN_3] = { 0xD, 0xA8, 0xA8, 0x0, 0x0, 0x0, 0x2, NNS_G2D_VRAM_TYPE_2DMAIN, 0x0, 0x0, 0x0, 0x0 }, + [SUMMARY_SPRITE_SHEEN_4] = { 0xD, 0xB0, 0xA8, 0x0, 0x0, 0x0, 0x2, NNS_G2D_VRAM_TYPE_2DMAIN, 0x0, 0x0, 0x0, 0x0 }, + [SUMMARY_SPRITE_SHEEN_5] = { 0xD, 0xB8, 0xA8, 0x0, 0x0, 0x0, 0x2, NNS_G2D_VRAM_TYPE_2DMAIN, 0x0, 0x0, 0x0, 0x0 }, + [SUMMARY_SPRITE_SHEEN_6] = { 0xD, 0xC0, 0xA8, 0x0, 0x0, 0x0, 0x2, NNS_G2D_VRAM_TYPE_2DMAIN, 0x0, 0x0, 0x0, 0x0 }, + [SUMMARY_SPRITE_SHEEN_7] = { 0xD, 0xC8, 0xA8, 0x0, 0x0, 0x0, 0x2, NNS_G2D_VRAM_TYPE_2DMAIN, 0x0, 0x0, 0x0, 0x0 }, + [SUMMARY_SPRITE_SHEEN_8] = { 0xD, 0xD0, 0xA8, 0x0, 0x0, 0x0, 0x2, NNS_G2D_VRAM_TYPE_2DMAIN, 0x0, 0x0, 0x0, 0x0 }, + [SUMMARY_SPRITE_SHEEN_9] = { 0xD, 0xD8, 0xA8, 0x0, 0x0, 0x0, 0x2, NNS_G2D_VRAM_TYPE_2DMAIN, 0x0, 0x0, 0x0, 0x0 }, + [SUMMARY_SPRITE_SHEEN_10] = { 0xD, 0xE0, 0xA8, 0x0, 0x0, 0x0, 0x2, NNS_G2D_VRAM_TYPE_2DMAIN, 0x0, 0x0, 0x0, 0x0 }, + [SUMMARY_SPRITE_SHEEN_11] = { 0xD, 0xE8, 0xA8, 0x0, 0x0, 0x0, 0x2, NNS_G2D_VRAM_TYPE_2DMAIN, 0x0, 0x0, 0x0, 0x0 }, + [SUMMARY_SPRITE_SHEEN_12] = { 0xD, 0xF0, 0xA8, 0x0, 0x0, 0x0, 0x2, NNS_G2D_VRAM_TYPE_2DMAIN, 0x0, 0x0, 0x0, 0x0 }, + [SUMMARY_SPRITE_BUTTON_TAP_CIRCLE] = { 0xF, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, NNS_G2D_VRAM_TYPE_2DMAIN, 0x0, 0x0, 0x0, 0x0 }, + [SUMMARY_SPRITE_CONDITION_ARROW_COOL] = { 0x10, 0xD0, 0x30, 0x0, 0x0, 0x0, 0x0, NNS_G2D_VRAM_TYPE_2DMAIN, 0x0, 0x0, 0x0, 0x0 }, + [SUMMARY_SPRITE_CONDITION_ARROW_BEAUTY] = { 0x10, 0xE0, 0x58, 0x0, 0x0, 0x0, 0x0, NNS_G2D_VRAM_TYPE_2DMAIN, 0x0, 0x0, 0x0, 0x0 }, + [SUMMARY_SPRITE_CONDITION_ARROW_CUTE] = { 0x10, 0xD8, 0x78, 0x0, 0x0, 0x0, 0x0, NNS_G2D_VRAM_TYPE_2DMAIN, 0x0, 0x0, 0x0, 0x0 }, + [SUMMARY_SPRITE_CONDITION_ARROW_SMART] = { 0x10, 0x90, 0x78, 0x0, 0x0, 0x0, 0x0, NNS_G2D_VRAM_TYPE_2DMAIN, 0x0, 0x0, 0x0, 0x0 }, + [SUMMARY_SPRITE_CONDITION_ARROW_TOUGH] = { 0x10, 0x88, 0x58, 0x0, 0x0, 0x0, 0x0, NNS_G2D_VRAM_TYPE_2DMAIN, 0x0, 0x0, 0x0, 0x0 }, + [SUMMARY_SPRITE_A_BUTTON] = { 0x11, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, NNS_G2D_VRAM_TYPE_2DMAIN, 0x0, 0x0, 0x0, 0x0 }, + [SUMMARY_SPRITE_CONTEST_STAT_DOT_COOL] = { 0x19, 0x0, 0x0, 0x0, 0x0, 0x0, 0x2, NNS_G2D_VRAM_TYPE_2DMAIN, 0x0, 0x0, 0x0, 0x0 }, + [SUMMARY_SPRITE_CONTEST_STAT_DOT_BEAUTY] = { 0x19, 0x0, 0x0, 0x0, 0x1, 0x0, 0x1, NNS_G2D_VRAM_TYPE_2DMAIN, 0x0, 0x0, 0x0, 0x0 }, + [SUMMARY_SPRITE_CONTEST_STAT_DOT_CUTE] = { 0x19, 0x0, 0x0, 0x0, 0x3, 0x0, 0x2, NNS_G2D_VRAM_TYPE_2DMAIN, 0x0, 0x0, 0x0, 0x0 }, + [SUMMARY_SPRITE_CONTEST_STAT_DOT_SMART] = { 0x19, 0x0, 0x0, 0x0, 0x2, 0x0, 0x1, NNS_G2D_VRAM_TYPE_2DMAIN, 0x0, 0x0, 0x0, 0x0 }, + [SUMMARY_SPRITE_CONTEST_STAT_DOT_TOUGH] = { 0x19, 0x0, 0x0, 0x0, 0x4, 0x0, 0x0, NNS_G2D_VRAM_TYPE_2DMAIN, 0x0, 0x0, 0x0, 0x0 }, + [SUMMARY_SPRITE_SHINY_ICON] = { 0x18, 0x62, 0x48, 0x0, 0x0, 0x0, 0x2, NNS_G2D_VRAM_TYPE_2DMAIN, 0x0, 0x0, 0x0, 0x0 }, + [SUMMARY_SPRITE_POKERUS_CURED_ICON] = { 0x18, 0x62, 0x84, 0x0, 0x1, 0x0, 0x2, NNS_G2D_VRAM_TYPE_2DMAIN, 0x0, 0x0, 0x0, 0x0 }, + [SUMMARY_SPRITE_RIBBON_1] = { 0x1A, 0x84, 0x38, 0x0, 0x0, 0x0, 0x0, NNS_G2D_VRAM_TYPE_2DMAIN, 0x0, 0x0, 0x0, 0x0 }, + [SUMMARY_SPRITE_RIBBON_2] = { 0x1B, 0xA4, 0x38, 0x0, 0x0, 0x0, 0x0, NNS_G2D_VRAM_TYPE_2DMAIN, 0x0, 0x0, 0x0, 0x0 }, + [SUMMARY_SPRITE_RIBBON_3] = { 0x1C, 0xC4, 0x38, 0x0, 0x0, 0x0, 0x0, NNS_G2D_VRAM_TYPE_2DMAIN, 0x0, 0x0, 0x0, 0x0 }, + [SUMMARY_SPRITE_RIBBON_4] = { 0x1D, 0xE4, 0x38, 0x0, 0x0, 0x0, 0x0, NNS_G2D_VRAM_TYPE_2DMAIN, 0x0, 0x0, 0x0, 0x0 }, + [SUMMARY_SPRITE_RIBBON_5] = { 0x1E, 0x84, 0x60, 0x0, 0x0, 0x0, 0x0, NNS_G2D_VRAM_TYPE_2DMAIN, 0x0, 0x0, 0x0, 0x0 }, + [SUMMARY_SPRITE_RIBBON_6] = { 0x1F, 0xA4, 0x60, 0x0, 0x0, 0x0, 0x0, NNS_G2D_VRAM_TYPE_2DMAIN, 0x0, 0x0, 0x0, 0x0 }, + [SUMMARY_SPRITE_RIBBON_7] = { 0x20, 0xC4, 0x60, 0x0, 0x0, 0x0, 0x0, NNS_G2D_VRAM_TYPE_2DMAIN, 0x0, 0x0, 0x0, 0x0 }, + [SUMMARY_SPRITE_RIBBON_8] = { 0x21, 0xE4, 0x60, 0x0, 0x0, 0x0, 0x0, NNS_G2D_VRAM_TYPE_2DMAIN, 0x0, 0x0, 0x0, 0x0 }, + [SUMMARY_SPRITE_RIBBON_9] = { 0x22, 0x84, 0x88, 0x0, 0x0, 0x0, 0x0, NNS_G2D_VRAM_TYPE_2DMAIN, 0x0, 0x0, 0x0, 0x0 }, + [SUMMARY_SPRITE_RIBBON_10] = { 0x23, 0xA4, 0x88, 0x0, 0x0, 0x0, 0x0, NNS_G2D_VRAM_TYPE_2DMAIN, 0x0, 0x0, 0x0, 0x0 }, + [SUMMARY_SPRITE_RIBBON_11] = { 0x24, 0xC4, 0x88, 0x0, 0x0, 0x0, 0x0, NNS_G2D_VRAM_TYPE_2DMAIN, 0x0, 0x0, 0x0, 0x0 }, + [SUMMARY_SPRITE_RIBBON_12] = { 0x25, 0xE4, 0x88, 0x0, 0x0, 0x0, 0x0, NNS_G2D_VRAM_TYPE_2DMAIN, 0x0, 0x0, 0x0, 0x0 }, + [SUMMARY_SPRITE_RIBBON_CURSOR] = { 0x26, 0x84, 0x38, 0x0, 0x0, 0x0, 0x2, NNS_G2D_VRAM_TYPE_2DMAIN, 0x0, 0x0, 0x0, 0x0 }, + [SUMMARY_SPRITE_RIBBON_ARROW_UP] = { 0x27, 0xB4, 0x20, 0x0, 0x1, 0x0, 0x1, NNS_G2D_VRAM_TYPE_2DMAIN, 0x0, 0x0, 0x0, 0x0 }, + [SUMMARY_SPRITE_RIBBON_ARROW_DOWN] = { 0x27, 0xB4, 0x78, 0x0, 0x0, 0x0, 0x1, NNS_G2D_VRAM_TYPE_2DMAIN, 0x0, 0x0, 0x0, 0x0 }, + [SUMMARY_SPRITE_RIBBON_FLASH] = { 0x28, 0x8, 0x84, 0x0, 0x0, 0x0, 0x2, NNS_G2D_VRAM_TYPE_2DMAIN, 0x0, 0x0, 0x0, 0x0 }, + [SUMMARY_SPRITE_CONDITION_FLASH_COOL] = { 0x29, 0x84, 0x38, 0x0, 0x0, 0x0, 0x2, NNS_G2D_VRAM_TYPE_2DMAIN, 0x0, 0x0, 0x0, 0x0 }, + [SUMMARY_SPRITE_CONDITION_FLASH_BEAUTY] = { 0x29, 0x84, 0x38, 0x0, 0x0, 0x0, 0x2, NNS_G2D_VRAM_TYPE_2DMAIN, 0x0, 0x0, 0x0, 0x0 }, + [SUMMARY_SPRITE_CONDITION_FLASH_CUTE] = { 0x29, 0x84, 0x38, 0x0, 0x0, 0x0, 0x2, NNS_G2D_VRAM_TYPE_2DMAIN, 0x0, 0x0, 0x0, 0x0 }, + [SUMMARY_SPRITE_CONDITION_FLASH_SMART] = { 0x29, 0x84, 0x38, 0x0, 0x0, 0x0, 0x2, NNS_G2D_VRAM_TYPE_2DMAIN, 0x0, 0x0, 0x0, 0x0 }, + [SUMMARY_SPRITE_CONDITION_FLASH_TOUGH] = { 0x29, 0x84, 0x38, 0x0, 0x0, 0x0, 0x2, NNS_G2D_VRAM_TYPE_2DMAIN, 0x0, 0x0, 0x0, 0x0 }, + [SUMMARY_SPRITE_POKERUS_ICON] = { 0x2A, 0x4C, 0x30, 0x0, 0x0, 0x0, 0x1, NNS_G2D_VRAM_TYPE_2DMAIN, 0x0, 0x0, 0x0, 0x0 } }; -static const u8 Unk_020F411C[] = { - 0x2, - 0x0, - 0x2, - 0x2, - 0x0, - 0x1, - 0x1, - 0x1, - 0x1, - 0x2, - 0x2, - 0x2, - 0x2, - 0x3, - 0x3, - 0x2, - 0x0 +static const u8 sBallIDToPaletteNum[] = { + [ITEM_NONE] = 2, + [ITEM_MASTER_BALL] = 0, + [ITEM_ULTRA_BALL] = 2, + [ITEM_GREAT_BALL] = 2, + [ITEM_POKE_BALL] = 0, + [ITEM_SAFARI_BALL] = 1, + [ITEM_NET_BALL] = 1, + [ITEM_DIVE_BALL] = 1, + [ITEM_NEST_BALL] = 1, + [ITEM_REPEAT_BALL] = 2, + [ITEM_TIMER_BALL] = 2, + [ITEM_LUXURY_BALL] = 2, + [ITEM_PREMIER_BALL] = 2, + [ITEM_DUSK_BALL] = 3, + [ITEM_HEAL_BALL] = 3, + [ITEM_QUICK_BALL] = 2, + [ITEM_CHERISH_BALL] = 0, }; -void sub_0208EA44(PokemonSummaryScreen *param0) +void PokemonSummaryScreen_InitSpriteResources(PokemonSummaryScreen *summaryScreen) { - GXLayers_EngineAToggleLayers(GX_PLANEMASK_OBJ, 1); - GXLayers_EngineBToggleLayers(GX_PLANEMASK_OBJ, 1); - VRAMTransferManager_New(32, 19); + GXLayers_EngineAToggleLayers(GX_PLANEMASK_OBJ, TRUE); + GXLayers_EngineBToggleLayers(GX_PLANEMASK_OBJ, TRUE); + VRAMTransferManager_New(32, HEAP_ID_POKEMON_SUMMARY_SCREEN); - param0->renderer = sub_0200C6E4(19); - param0->gfxHandler = sub_0200C704(param0->renderer); + summaryScreen->renderer = sub_0200C6E4(HEAP_ID_POKEMON_SUMMARY_SCREEN); + summaryScreen->gfxHandler = sub_0200C704(summaryScreen->renderer); - { - UnkStruct_ov104_0224133C v0 = { - 0, - 128, - 0, - 32, - 0, - 128, - 0, - 32, - }; - UnkStruct_ov104_022412F4 v1 = { - 77, - 1024, - 1024, - GX_OBJVRAMMODE_CHAR_1D_32K, - GX_OBJVRAMMODE_CHAR_1D_32K - }; + UnkStruct_ov104_0224133C v0 = { + 0, + 128, + 0, + 32, + 0, + 128, + 0, + 32, + }; - sub_0200C73C(param0->renderer, &v0, &v1, 32); - sub_0200C7C0(param0->renderer, param0->gfxHandler, 77); - } + UnkStruct_ov104_022412F4 v1 = { + 77, + 1024, + 1024, + GX_OBJVRAMMODE_CHAR_1D_32K, + GX_OBJVRAMMODE_CHAR_1D_32K + }; - { - UnkStruct_ov7_0224F2EC v2 = { - "data/pst_chr.resdat", - "data/pst_pal.resdat", - "data/pst_cell.resdat", - "data/pst_canm.resdat", - NULL, - NULL, - "data/pst_h.cldat" - }; + sub_0200C73C(summaryScreen->renderer, &v0, &v1, 32); + sub_0200C7C0(summaryScreen->renderer, summaryScreen->gfxHandler, SUMMARY_SPRITE_MAX); - sub_0200C8F0(param0->renderer, param0->gfxHandler, &v2); - } + UnkStruct_ov7_0224F2EC v2 = { + "data/pst_chr.resdat", + "data/pst_pal.resdat", + "data/pst_cell.resdat", + "data/pst_canm.resdat", + NULL, + NULL, + "data/pst_h.cldat" + }; + + sub_0200C8F0(summaryScreen->renderer, summaryScreen->gfxHandler, &v2); } -void sub_0208EAF4(PokemonSummaryScreen *summaryScreen) +void PokemonSummaryScreen_FreeSpriteResources(PokemonSummaryScreen *summaryScreen) { sub_0200C8B0(summaryScreen->renderer, summaryScreen->gfxHandler); sub_0200C8D4(summaryScreen->renderer); } -void sub_0208EB14(PokemonSummaryScreen *summaryScreen) +void PokemonSummaryScreen_UpdateArrowAndTapAnims(PokemonSummaryScreen *summaryScreen) { - CellActor_UpdateAnim(summaryScreen->unk_41C[21], FX32_ONE); - CellActor_UpdateAnim(summaryScreen->unk_41C[22], FX32_ONE); - CellActor_UpdateAnim(summaryScreen->unk_41C[41], FX32_ONE); - CellActor_UpdateAnim(summaryScreen->unk_41C[68], FX32_ONE); - CellActor_UpdateAnim(summaryScreen->unk_41C[69], FX32_ONE); + CellActor_UpdateAnim(summaryScreen->sprites[SUMMARY_SPRITE_PAGE_ARROW_LEFT], FX32_ONE); + CellActor_UpdateAnim(summaryScreen->sprites[SUMMARY_SPRITE_PAGE_ARROW_RIGHT], FX32_ONE); + CellActor_UpdateAnim(summaryScreen->sprites[SUMMARY_SPRITE_BUTTON_TAP_CIRCLE], FX32_ONE); + CellActor_UpdateAnim(summaryScreen->sprites[SUMMARY_SPRITE_RIBBON_ARROW_UP], FX32_ONE); + CellActor_UpdateAnim(summaryScreen->sprites[SUMMARY_SPRITE_RIBBON_ARROW_DOWN], FX32_ONE); } -void sub_0208EB64(PokemonSummaryScreen *param0) +void PokemonSummaryScreen_SetDefaultSpriteStates(PokemonSummaryScreen *summaryScreen) { - u16 v0; - - for (v0 = 0; v0 < 77; v0++) { - param0->unk_41C[v0] = sub_0200CA08(param0->renderer, param0->gfxHandler, &Unk_020F41A8[v0]); + for (u16 i = 0; i < SUMMARY_SPRITE_MAX; i++) { + summaryScreen->sprites[i] = sub_0200CA08(summaryScreen->renderer, summaryScreen->gfxHandler, &Unk_020F41A8[i]); } - sub_0208EF0C(param0); + SetMonAndTypeIcons(summaryScreen); - CellActor_SetDrawFlag(param0->unk_41C[9], 0); - CellActor_SetDrawFlag(param0->unk_41C[10], 0); - CellActor_SetDrawFlag(param0->unk_41C[41], 0); - - CellActor_SetDrawFlag(param0->unk_41C[42], 0); - CellActor_SetDrawFlag(param0->unk_41C[43], 0); - CellActor_SetDrawFlag(param0->unk_41C[44], 0); - CellActor_SetDrawFlag(param0->unk_41C[45], 0); - CellActor_SetDrawFlag(param0->unk_41C[46], 0); - - CellActor_SetDrawFlag(param0->unk_41C[47], 0); - - CellActor_SetDrawFlag(param0->unk_41C[48], 0); - CellActor_SetDrawFlag(param0->unk_41C[49], 0); - CellActor_SetDrawFlag(param0->unk_41C[50], 0); - CellActor_SetDrawFlag(param0->unk_41C[51], 0); - CellActor_SetDrawFlag(param0->unk_41C[52], 0); - - CellActor_SetDrawFlag(param0->unk_41C[71], 0); - CellActor_SetDrawFlag(param0->unk_41C[72], 0); - CellActor_SetDrawFlag(param0->unk_41C[73], 0); - CellActor_SetDrawFlag(param0->unk_41C[74], 0); - CellActor_SetDrawFlag(param0->unk_41C[75], 0); - - CellActor_SetDrawFlag(param0->unk_41C[76], 0); + CellActor_SetDrawFlag(summaryScreen->sprites[SUMMARY_SPRITE_MOVE_SELECTOR_1], FALSE); + CellActor_SetDrawFlag(summaryScreen->sprites[SUMMARY_SPRITE_MOVE_SELECTOR_2], FALSE); + CellActor_SetDrawFlag(summaryScreen->sprites[SUMMARY_SPRITE_BUTTON_TAP_CIRCLE], FALSE); + CellActor_SetDrawFlag(summaryScreen->sprites[SUMMARY_SPRITE_CONDITION_ARROW_COOL], FALSE); + CellActor_SetDrawFlag(summaryScreen->sprites[SUMMARY_SPRITE_CONDITION_ARROW_BEAUTY], FALSE); + CellActor_SetDrawFlag(summaryScreen->sprites[SUMMARY_SPRITE_CONDITION_ARROW_CUTE], FALSE); + CellActor_SetDrawFlag(summaryScreen->sprites[SUMMARY_SPRITE_CONDITION_ARROW_SMART], FALSE); + CellActor_SetDrawFlag(summaryScreen->sprites[SUMMARY_SPRITE_CONDITION_ARROW_TOUGH], FALSE); + CellActor_SetDrawFlag(summaryScreen->sprites[SUMMARY_SPRITE_A_BUTTON], FALSE); + CellActor_SetDrawFlag(summaryScreen->sprites[SUMMARY_SPRITE_CONTEST_STAT_DOT_COOL], FALSE); + CellActor_SetDrawFlag(summaryScreen->sprites[SUMMARY_SPRITE_CONTEST_STAT_DOT_BEAUTY], FALSE); + CellActor_SetDrawFlag(summaryScreen->sprites[SUMMARY_SPRITE_CONTEST_STAT_DOT_CUTE], FALSE); + CellActor_SetDrawFlag(summaryScreen->sprites[SUMMARY_SPRITE_CONTEST_STAT_DOT_SMART], FALSE); + CellActor_SetDrawFlag(summaryScreen->sprites[SUMMARY_SPRITE_CONTEST_STAT_DOT_TOUGH], FALSE); + CellActor_SetDrawFlag(summaryScreen->sprites[SUMMARY_SPRITE_CONDITION_FLASH_COOL], FALSE); + CellActor_SetDrawFlag(summaryScreen->sprites[SUMMARY_SPRITE_CONDITION_FLASH_BEAUTY], FALSE); + CellActor_SetDrawFlag(summaryScreen->sprites[SUMMARY_SPRITE_CONDITION_FLASH_CUTE], FALSE); + CellActor_SetDrawFlag(summaryScreen->sprites[SUMMARY_SPRITE_CONDITION_FLASH_SMART], FALSE); + CellActor_SetDrawFlag(summaryScreen->sprites[SUMMARY_SPRITE_CONDITION_FLASH_TOUGH], FALSE); + CellActor_SetDrawFlag(summaryScreen->sprites[SUMMARY_SPRITE_POKERUS_ICON], FALSE); } -static u8 sub_0208ECB8(PokemonSummaryScreen *param0) +static u8 CalcPageTabsBaseXPos(PokemonSummaryScreen *summaryScreen) { - u8 v0, v1 = 0; + u8 page, visiblePageCount = 0; - for (v0 = 0; v0 < 8; v0++) { - if (PokemonSummaryScreen_PageIsVisble(param0, v0) != 0) { - v1++; + for (page = 0; page < SUMMARY_PAGE_MAX; page++) { + if (PokemonSummaryScreen_PageIsVisble(summaryScreen, page) != FALSE) { + visiblePageCount++; } } - return (23 * 8 + 4) - (24 + (v1 - 1) * 16) / 2; + return CENTERED_TAB_POS_X - (FOCUSED_TAB_WIDTH + (visiblePageCount - 1) * UNFOCUSED_TAB_WIDTH) / 2; } -void sub_0208ECF4(PokemonSummaryScreen *param0) +void PokemonSummaryScreen_UpdatePageTabSprites(PokemonSummaryScreen *summaryScreen) { - CellActor **v0; - s16 v1, v2; - s16 v3; - u16 v4; - u8 v5; - u8 v6 = 0; + s16 x, y; + u16 activeAnim; + u8 page; - v3 = sub_0208ECB8(param0); - v0 = ¶m0->unk_41C[0]; - v6 = 0; + s16 baseXPos = CalcPageTabsBaseXPos(summaryScreen); + CellActor **sprites = &summaryScreen->sprites[0]; + u8 visiblePageCount = 0; - for (v5 = 0; v5 < 8; v5++) { - if (PokemonSummaryScreen_PageIsVisble(param0, v5) == 0) { - CellActor_SetDrawFlag(v0[v5], 0); + for (page = 0; page < SUMMARY_PAGE_MAX; page++) { + if (PokemonSummaryScreen_PageIsVisble(summaryScreen, page) == FALSE) { + CellActor_SetDrawFlag(sprites[page], FALSE); continue; } - v4 = CellActor_GetActiveAnim(v0[v5]); + activeAnim = CellActor_GetActiveAnim(sprites[page]); - if (param0->page == v5) { - if (v4 < 8) { - CellActor_SetAnim(v0[v5], v4 + 8); + if (summaryScreen->page == page) { + if (activeAnim < 8) { + CellActor_SetAnim(sprites[page], activeAnim + 8); } } else { - if (v4 >= 8) { - CellActor_SetAnim(v0[v5], v4 - 8); + if (activeAnim >= 8) { + CellActor_SetAnim(sprites[page], activeAnim - 8); } } - sub_0200D50C(v0[v5], &v1, &v2); + sub_0200D50C(sprites[page], &x, &y); - if (param0->page >= v5) { - v1 = v3 + v6 * 16; + if (summaryScreen->page >= page) { + x = baseXPos + visiblePageCount * UNFOCUSED_TAB_WIDTH; } else { - v1 = v3 + 24 + (v6 - 1) * 16; + x = baseXPos + FOCUSED_TAB_WIDTH + (visiblePageCount - 1) * UNFOCUSED_TAB_WIDTH; } - SpriteActor_SetPositionXY(param0->unk_41C[v5], v1, v2); - CellActor_SetDrawFlag(v0[v5], 1); + SpriteActor_SetPositionXY(summaryScreen->sprites[page], x, y); + CellActor_SetDrawFlag(sprites[page], TRUE); - v6++; + visiblePageCount++; } } -void sub_0208EDC4(PokemonSummaryScreen *param0) +void PokemonSummaryScreen_SetPageArrowsPos(PokemonSummaryScreen *summaryScreen) { - u8 v0; - - if (PokemonSummaryScreen_CountVisiblePages(param0) <= 1) { - PokemonSummaryScreen_UpdatePageArrows(param0, FALSE); + if (PokemonSummaryScreen_CountVisiblePages(summaryScreen) <= 1) { + PokemonSummaryScreen_UpdatePageArrows(summaryScreen, FALSE); } - v0 = sub_0208ECB8(param0); + u8 baseXPos = CalcPageTabsBaseXPos(summaryScreen); - SpriteActor_SetPositionXY(param0->unk_41C[21], v0 + -12, 24); - SpriteActor_SetPositionXY(param0->unk_41C[22], (23 * 8 + 4) + ((23 * 8 + 4) - v0) + -4, 24); + SpriteActor_SetPositionXY(summaryScreen->sprites[SUMMARY_SPRITE_PAGE_ARROW_LEFT], baseXPos + PAGE_ARROW_LEFT_X, PAGE_ARROW_Y); + SpriteActor_SetPositionXY(summaryScreen->sprites[SUMMARY_SPRITE_PAGE_ARROW_RIGHT], CENTERED_TAB_POS_X + (CENTERED_TAB_POS_X - baseXPos) + PAGE_ARROW_RIGHT_X, PAGE_ARROW_Y); } void PokemonSummaryScreen_UpdatePageArrows(PokemonSummaryScreen *summaryScreen, BOOL showArrows) @@ -305,159 +379,153 @@ void PokemonSummaryScreen_UpdatePageArrows(PokemonSummaryScreen *summaryScreen, showArrows = FALSE; } - CellActor_SetDrawFlag(summaryScreen->unk_41C[21], showArrows); - CellActor_SetDrawFlag(summaryScreen->unk_41C[22], showArrows); + CellActor_SetDrawFlag(summaryScreen->sprites[SUMMARY_SPRITE_PAGE_ARROW_LEFT], showArrows); + CellActor_SetDrawFlag(summaryScreen->sprites[SUMMARY_SPRITE_PAGE_ARROW_RIGHT], showArrows); } -void sub_0208EE3C(PokemonSummaryScreen *param0) +void PokemonSummaryScreen_SetCaughtBallGfx(PokemonSummaryScreen *summaryScreen) { - u32 v0; + u32 ballMember; - if (param0->monData.caughtBall == 0) { - v0 = 21; + if (summaryScreen->monData.caughtBall == ITEM_NONE) { + ballMember = master_ball_NCGR; } else { - v0 = 21 + param0->monData.caughtBall - 1; + ballMember = master_ball_NCGR + summaryScreen->monData.caughtBall - 1; } - sub_0200D948(param0->renderer, param0->gfxHandler, 39, v0, 0, 0); - sub_0200D97C(param0->renderer, param0->gfxHandler, 39, 37 + Unk_020F411C[param0->monData.caughtBall], 0, 6); + sub_0200D948(summaryScreen->renderer, summaryScreen->gfxHandler, NARC_INDEX_GRAPHIC__PL_PST_GRA, ballMember, FALSE, 0); + sub_0200D97C(summaryScreen->renderer, summaryScreen->gfxHandler, NARC_INDEX_GRAPHIC__PL_PST_GRA, balls_0_NCLR + sBallIDToPaletteNum[summaryScreen->monData.caughtBall], FALSE, 6); } -void sub_0208EE9C(PokemonSummaryScreen *param0) +void PokemonSummaryScreen_UpdateStatusIcon(PokemonSummaryScreen *summaryScreen) { - if (param0->monData.status == 7) { - CellActor_SetDrawFlag(param0->unk_41C[20], 0); - CellActor_SetDrawFlag(param0->unk_41C[76], 0); - } else if (param0->monData.status != 0) { - CellActor_SetDrawFlag(param0->unk_41C[76], 0); - CellActor_SetDrawFlag(param0->unk_41C[20], 1); - CellActor_SetAnim(param0->unk_41C[20], param0->monData.status); + if (summaryScreen->monData.status == 7) { + CellActor_SetDrawFlag(summaryScreen->sprites[SUMMARY_SPRITE_STATUS_ICON], FALSE); + CellActor_SetDrawFlag(summaryScreen->sprites[SUMMARY_SPRITE_POKERUS_ICON], FALSE); + } else if (summaryScreen->monData.status != 0) { + CellActor_SetDrawFlag(summaryScreen->sprites[SUMMARY_SPRITE_POKERUS_ICON], FALSE); + CellActor_SetDrawFlag(summaryScreen->sprites[SUMMARY_SPRITE_STATUS_ICON], TRUE); + CellActor_SetAnim(summaryScreen->sprites[SUMMARY_SPRITE_STATUS_ICON], summaryScreen->monData.status); } else { - CellActor_SetDrawFlag(param0->unk_41C[76], 1); - CellActor_SetDrawFlag(param0->unk_41C[20], 0); + CellActor_SetDrawFlag(summaryScreen->sprites[SUMMARY_SPRITE_POKERUS_ICON], TRUE); + CellActor_SetDrawFlag(summaryScreen->sprites[SUMMARY_SPRITE_STATUS_ICON], FALSE); } } -static void sub_0208EF0C(PokemonSummaryScreen *param0) +static void SetMonAndTypeIcons(PokemonSummaryScreen *summaryScreen) { - u16 v0; + PokemonSummaryScreen_SetMonTypeIcons(summaryScreen); - sub_0208F16C(param0); - - for (v0 = 0; v0 < 4; v0++) { - if (param0->monData.moves[v0] == 0) { + for (u16 i = 0; i < LEARNED_MOVES_MAX; i++) { + if (summaryScreen->monData.moves[i] == MOVE_NONE) { continue; } - sub_0208F194(param0, 13 + v0, 5 + v0, MoveTable_LoadParam(param0->monData.moves[v0], MOVEATTRIBUTE_TYPE)); + SetTypeIcon(summaryScreen, SUMMARY_MOVE_TYPE_ICON_SPRITE_START + i, 5 + i, MoveTable_LoadParam(summaryScreen->monData.moves[i], MOVEATTRIBUTE_TYPE)); } - sub_0208F71C(param0); + PokemonSummaryScreen_SetMonIcon(summaryScreen); } -void sub_0208EF58(PokemonSummaryScreen *param0) +void PokemonSummaryScreen_UpdateTypeIcons(PokemonSummaryScreen *summaryScreen) { - u16 v0; - - for (v0 = 11; v0 <= 19; v0++) { - SpriteActor_DrawSprite(param0->unk_41C[v0], 0); + u16 i; + for (i = SUMMARY_SPRITE_MON_TYPE_ICON_1; i <= SUMMARY_SPRITE_MON_ICON; i++) { + SpriteActor_DrawSprite(summaryScreen->sprites[i], FALSE); } - switch (param0->page) { - case 0: - SpriteActor_DrawSprite(param0->unk_41C[11], 1); + switch (summaryScreen->page) { + case SUMMARY_PAGE_INFO: + SpriteActor_DrawSprite(summaryScreen->sprites[SUMMARY_SPRITE_MON_TYPE_ICON_1], TRUE); - if (param0->monData.type1 == param0->monData.type2) { - SpriteActor_SetPositionXY(param0->unk_41C[11], 216, 80); + if (summaryScreen->monData.type1 == summaryScreen->monData.type2) { + SpriteActor_SetPositionXY(summaryScreen->sprites[SUMMARY_SPRITE_MON_TYPE_ICON_1], INFO_SOLO_MON_TYPE_ICON_X, INFO_MON_TYPE_ICON_Y); } else { - SpriteActor_SetPositionXY(param0->unk_41C[11], 199, 80); - SpriteActor_DrawSprite(param0->unk_41C[12], 1); - SpriteActor_SetPositionXY( - param0->unk_41C[12], 233, 80); + SpriteActor_SetPositionXY(summaryScreen->sprites[SUMMARY_SPRITE_MON_TYPE_ICON_1], INFO_MON_TYPE_ICON_1_X, INFO_MON_TYPE_ICON_Y); + SpriteActor_DrawSprite(summaryScreen->sprites[SUMMARY_SPRITE_MON_TYPE_ICON_2], TRUE); + SpriteActor_SetPositionXY(summaryScreen->sprites[SUMMARY_SPRITE_MON_TYPE_ICON_2], INFO_MON_TYPE_ICON_2_X, INFO_MON_TYPE_ICON_Y); } break; - case 3: - for (v0 = 0; v0 < 4; v0++) { - if (param0->monData.moves[v0] == 0) { + case SUMMARY_PAGE_BATTLE_MOVES: + for (i = 0; i < LEARNED_MOVES_MAX; i++) { + if (summaryScreen->monData.moves[i] == MOVE_NONE) { continue; } - sub_0208F194(param0, 13 + v0, 5 + v0, MoveTable_LoadParam(param0->monData.moves[v0], MOVEATTRIBUTE_TYPE)); - SpriteActor_DrawSprite(param0->unk_41C[13 + v0], 1); - SpriteActor_SetPositionXY(param0->unk_41C[13 + v0], 151, 42 + v0 * 32); + SetTypeIcon(summaryScreen, SUMMARY_MOVE_TYPE_ICON_SPRITE_START + i, 5 + i, MoveTable_LoadParam(summaryScreen->monData.moves[i], MOVEATTRIBUTE_TYPE)); + SpriteActor_DrawSprite(summaryScreen->sprites[SUMMARY_MOVE_TYPE_ICON_SPRITE_START + i], TRUE); + SpriteActor_SetPositionXY(summaryScreen->sprites[SUMMARY_MOVE_TYPE_ICON_SPRITE_START + i], MOVE_TYPE_ICON_X, MOVE_TYPE_ICON_BASE_Y + i * PIXELS_BETWEEN_MOVES); } - if (param0->data->move != 0) { - sub_0208F194(param0, 13 + 4, 5 + 4, MoveTable_LoadParam(param0->data->move, MOVEATTRIBUTE_TYPE)); - SpriteActor_DrawSprite(param0->unk_41C[13 + 4], 1); - SpriteActor_SetPositionXY(param0->unk_41C[13 + 4], 151, 42 + 4 * 32); + if (summaryScreen->data->move != MOVE_NONE) { + SetTypeIcon(summaryScreen, SUMMARY_SPRITE_MOVE_TYPE_ICON_5, 5 + 4, MoveTable_LoadParam(summaryScreen->data->move, MOVEATTRIBUTE_TYPE)); + SpriteActor_DrawSprite(summaryScreen->sprites[SUMMARY_SPRITE_MOVE_TYPE_ICON_5], TRUE); + SpriteActor_SetPositionXY(summaryScreen->sprites[SUMMARY_SPRITE_MOVE_TYPE_ICON_5], MOVE_TYPE_ICON_X, MOVE_TYPE_ICON_BASE_Y + LEARNED_MOVES_MAX * PIXELS_BETWEEN_MOVES); } - SpriteActor_SetPositionXY(param0->unk_41C[11], 63, 52); - SpriteActor_SetPositionXY(param0->unk_41C[12], 63 + 34, 52); - SpriteActor_SetPositionXY(param0->unk_41C[18], (92 + 16), 72); + SpriteActor_SetPositionXY(summaryScreen->sprites[SUMMARY_SPRITE_MON_TYPE_ICON_1], MOVES_MON_TYPE_ICON_1_X, MOVES_MON_TYPE_ICON_Y); + SpriteActor_SetPositionXY(summaryScreen->sprites[SUMMARY_SPRITE_MON_TYPE_ICON_2], MOVES_MON_TYPE_ICON_2_X, MOVES_MON_TYPE_ICON_Y); + SpriteActor_SetPositionXY(summaryScreen->sprites[SUMMARY_SPRITE_MOVE_CATEGORY_ICON], MOVE_CATEGORY_ICON_X, MOVE_CATEGORY_ICON_Y); break; - case 5: - for (v0 = 0; v0 < 4; v0++) { - if (param0->monData.moves[v0] == 0) { + case SUMMARY_PAGE_CONTEST_MOVES: + for (i = 0; i < LEARNED_MOVES_MAX; i++) { + if (summaryScreen->monData.moves[i] == MOVE_NONE) { continue; } - sub_0208F194(param0, 13 + v0, 5 + v0, MoveTable_LoadParam(param0->monData.moves[v0], MOVEATTRIBUTE_CONTEST_TYPE) + 18); - SpriteActor_DrawSprite(param0->unk_41C[13 + v0], 1); - SpriteActor_SetPositionXY(param0->unk_41C[13 + v0], 151, 42 + v0 * 32); + SetTypeIcon(summaryScreen, SUMMARY_MOVE_TYPE_ICON_SPRITE_START + i, 5 + i, MoveTable_LoadParam(summaryScreen->monData.moves[i], MOVEATTRIBUTE_CONTEST_TYPE) + 18); + SpriteActor_DrawSprite(summaryScreen->sprites[SUMMARY_MOVE_TYPE_ICON_SPRITE_START + i], 1); + SpriteActor_SetPositionXY(summaryScreen->sprites[SUMMARY_MOVE_TYPE_ICON_SPRITE_START + i], MOVE_TYPE_ICON_X, MOVE_TYPE_ICON_BASE_Y + i * PIXELS_BETWEEN_MOVES); } - if (param0->data->move != 0) { - sub_0208F194(param0, 13 + 4, 5 + 4, MoveTable_LoadParam(param0->data->move, MOVEATTRIBUTE_CONTEST_TYPE) + 18); - SpriteActor_DrawSprite(param0->unk_41C[13 + 4], 1); - SpriteActor_SetPositionXY(param0->unk_41C[13 + 4], 151, 42 + 4 * 32); + if (summaryScreen->data->move != MOVE_NONE) { + SetTypeIcon(summaryScreen, SUMMARY_SPRITE_MOVE_TYPE_ICON_5, 5 + 4, MoveTable_LoadParam(summaryScreen->data->move, MOVEATTRIBUTE_CONTEST_TYPE) + 18); + SpriteActor_DrawSprite(summaryScreen->sprites[SUMMARY_SPRITE_MOVE_TYPE_ICON_5], 1); + SpriteActor_SetPositionXY(summaryScreen->sprites[SUMMARY_SPRITE_MOVE_TYPE_ICON_5], MOVE_TYPE_ICON_X, MOVE_TYPE_ICON_BASE_Y + LEARNED_MOVES_MAX * PIXELS_BETWEEN_MOVES); } - SpriteActor_SetPositionXY(param0->unk_41C[11], 63, 52); - SpriteActor_SetPositionXY(param0->unk_41C[12], 63 + 34, 52); - SpriteActor_SetPositionXY(param0->unk_41C[18], (92 + 16), 72); + SpriteActor_SetPositionXY(summaryScreen->sprites[SUMMARY_SPRITE_MON_TYPE_ICON_1], MOVES_MON_TYPE_ICON_1_X, MOVES_MON_TYPE_ICON_Y); + SpriteActor_SetPositionXY(summaryScreen->sprites[SUMMARY_SPRITE_MON_TYPE_ICON_2], MOVES_MON_TYPE_ICON_2_X, MOVES_MON_TYPE_ICON_Y); + SpriteActor_SetPositionXY(summaryScreen->sprites[SUMMARY_SPRITE_MOVE_CATEGORY_ICON], MOVE_CATEGORY_ICON_X, MOVE_CATEGORY_ICON_Y); break; } } -void sub_0208F16C(PokemonSummaryScreen *param0) +void PokemonSummaryScreen_SetMonTypeIcons(PokemonSummaryScreen *summaryScreen) { - sub_0208F194(param0, 11, 3, param0->monData.type1); - sub_0208F194(param0, 12, 4, param0->monData.type2); + SetTypeIcon(summaryScreen, SUMMARY_SPRITE_MON_TYPE_ICON_1, 3, summaryScreen->monData.type1); + SetTypeIcon(summaryScreen, SUMMARY_SPRITE_MON_TYPE_ICON_2, 4, summaryScreen->monData.type2); } -static void sub_0208F194(PokemonSummaryScreen *param0, u8 param1, u8 param2, u8 param3) +static void SetTypeIcon(PokemonSummaryScreen *summaryScreen, u8 spriteIndex, u8 param2, u8 type) { - sub_0200D948(param0->renderer, param0->gfxHandler, sub_0207C944(), sub_0207C908(param3), 1, param2); - sub_0200D414(param0->unk_41C[param1], sub_0207C92C(param3) + 3); + sub_0200D948(summaryScreen->renderer, summaryScreen->gfxHandler, sub_0207C944(), sub_0207C908(type), 1, param2); + sub_0200D414(summaryScreen->sprites[spriteIndex], sub_0207C92C(type) + 3); } -static void sub_0208F1E4(PokemonSummaryScreen *param0, u8 *param1, s16 *param2, s16 *param3) +static void GetMoveTypeIconPos(PokemonSummaryScreen *summaryScreen, u8 *moveIndex, s16 *outX, s16 *outY) { - s16 v0, v1; - - v1 = 42 + *param1 * 32; + s16 newYPos = MOVE_TYPE_ICON_BASE_Y + *moveIndex * PIXELS_BETWEEN_MOVES; - for (v0 = 0; v0 < 4; v0++) { - sub_0200D50C(param0->unk_41C[13 + v0], param2, param3); + for (s16 i = 0; i < LEARNED_MOVES_MAX; i++) { + sub_0200D50C(summaryScreen->sprites[SUMMARY_MOVE_TYPE_ICON_SPRITE_START + i], outX, outY); - if (v1 == *param3) { - *param1 = (u8)v0; + if (newYPos == *outY) { + *moveIndex = i; break; } } } -void sub_0208F22C(PokemonSummaryScreen *param0, u8 param1, u8 param2) +void PokemonSummaryScreen_SwapMoveTypeIcons(PokemonSummaryScreen *summaryScreen, u8 moveIndex1, u8 moveIndex2) { - s16 v0, v1, v2, v3; + s16 xPos1, yPos1, xPos2, yPos2; - sub_0208F1E4(param0, ¶m1, &v0, &v1); - sub_0208F1E4(param0, ¶m2, &v2, &v3); + GetMoveTypeIconPos(summaryScreen, &moveIndex1, &xPos1, &yPos1); + GetMoveTypeIconPos(summaryScreen, &moveIndex2, &xPos2, &yPos2); - SpriteActor_SetPositionXY(param0->unk_41C[13 + param1], v2, v3); - SpriteActor_SetPositionXY(param0->unk_41C[13 + param2], v0, v1); + SpriteActor_SetPositionXY(summaryScreen->sprites[SUMMARY_MOVE_TYPE_ICON_SPRITE_START + moveIndex1], xPos2, yPos2); + SpriteActor_SetPositionXY(summaryScreen->sprites[SUMMARY_MOVE_TYPE_ICON_SPRITE_START + moveIndex2], xPos1, yPos1); } void PokemonSummaryScreen_UpdateMoveCategoryIcon(PokemonSummaryScreen *summaryScreen, u32 move) @@ -465,48 +533,45 @@ void PokemonSummaryScreen_UpdateMoveCategoryIcon(PokemonSummaryScreen *summarySc u32 category = MoveTable_LoadParam(move, MOVEATTRIBUTE_CLASS); sub_0200D948(summaryScreen->renderer, summaryScreen->gfxHandler, sub_0207CAC0(), sub_0207CA90(category), 1, 10); - sub_0200D414(summaryScreen->unk_41C[18], sub_0207CAA8(category) + 3); + sub_0200D414(summaryScreen->sprites[SUMMARY_SPRITE_MOVE_CATEGORY_ICON], sub_0207CAA8(category) + 3); } void PokemonSummaryScreen_UpdateMoveSelectorPos(PokemonSummaryScreen *summaryScreen) { - SpriteActor_SetPositionXY(summaryScreen->unk_41C[9], 194, 48 + summaryScreen->cursor * 32); + SpriteActor_SetPositionXY(summaryScreen->sprites[SUMMARY_SPRITE_MOVE_SELECTOR_1], MOVE_SELECTOR_X, MOVE_SELECTOR_BASE_Y + summaryScreen->cursor * PIXELS_BETWEEN_MOVES); } -void sub_0208F310(PokemonSummaryScreen *summaryScreen) +void PokemonSummaryScreen_SetMoveSelector2Pos(PokemonSummaryScreen *summaryScreen) { - s16 v0, v1; - - sub_0200D50C(summaryScreen->unk_41C[9], &v0, &v1); - SpriteActor_SetPositionXY(summaryScreen->unk_41C[10], v0, v1); - CellActor_SetDrawFlag(summaryScreen->unk_41C[10], TRUE); + s16 x, y; + sub_0200D50C(summaryScreen->sprites[SUMMARY_SPRITE_MOVE_SELECTOR_1], &x, &y); + SpriteActor_SetPositionXY(summaryScreen->sprites[SUMMARY_SPRITE_MOVE_SELECTOR_2], x, y); + CellActor_SetDrawFlag(summaryScreen->sprites[SUMMARY_SPRITE_MOVE_SELECTOR_2], TRUE); } -void sub_0208F34C(PokemonSummaryScreen *param0) +void PokemonSummaryScreen_InitSheenSprites(PokemonSummaryScreen *summaryScreen) { - u32 v0; + summaryScreen->sheenState = 0; + summaryScreen->sheenCount = 0; + summaryScreen->sheenPos = 0; - param0->sheenState = 0; - param0->sheenCount = 0; - param0->sheenPos = 0; - - if (param0->monData.sheen == 0) { - param0->sheenMax = 0; - } else if (param0->monData.sheen == 255) { - param0->sheenMax = 12; + if (summaryScreen->monData.sheen == 0) { + summaryScreen->sheenMax = 0; + } else if (summaryScreen->monData.sheen == MAX_POKEMON_SHEEN) { + summaryScreen->sheenMax = MAX_SHEEN_SPRITES; } else { - param0->sheenMax = (((12 << 8) / 255) * param0->monData.sheen) >> 8; + summaryScreen->sheenMax = (((MAX_SHEEN_SPRITES << 8) / MAX_POKEMON_SHEEN) * summaryScreen->monData.sheen) >> 8; } - for (v0 = 29; v0 <= 40; v0++) { - CellActor_SetDrawFlag(param0->unk_41C[v0], 0); - SpriteActor_SetAnimFrame(param0->unk_41C[v0], 0); + for (u32 spriteIndex = SUMMARY_SHEEN_SPRITES_START; spriteIndex <= SUMMARY_SHEEN_SPRITES_END; spriteIndex++) { + CellActor_SetDrawFlag(summaryScreen->sprites[spriteIndex], FALSE); + SpriteActor_SetAnimFrame(summaryScreen->sprites[spriteIndex], 0); } } void PokemonSummaryScreen_DrawSheenSprites(PokemonSummaryScreen *summaryScreen) { - if (summaryScreen->page != PSS_PAGE_CONDITION) { + if (summaryScreen->page != SUMMARY_PAGE_CONDITION) { return; } @@ -528,9 +593,9 @@ void PokemonSummaryScreen_DrawSheenSprites(PokemonSummaryScreen *summaryScreen) break; case 1: if (summaryScreen->sheenCount == 0) { - CellActor_SetDrawFlag(summaryScreen->unk_41C[29 + summaryScreen->sheenPos], TRUE); - SpriteActor_SetAnimFrame(summaryScreen->unk_41C[29 + summaryScreen->sheenPos], FALSE); - CellActor_SetAnim(summaryScreen->unk_41C[29 + summaryScreen->sheenPos], FALSE); + CellActor_SetDrawFlag(summaryScreen->sprites[SUMMARY_SHEEN_SPRITES_START + summaryScreen->sheenPos], TRUE); + SpriteActor_SetAnimFrame(summaryScreen->sprites[SUMMARY_SHEEN_SPRITES_START + summaryScreen->sheenPos], FALSE); + CellActor_SetAnim(summaryScreen->sprites[SUMMARY_SHEEN_SPRITES_START + summaryScreen->sheenPos], FALSE); summaryScreen->sheenPos++; @@ -543,7 +608,7 @@ void PokemonSummaryScreen_DrawSheenSprites(PokemonSummaryScreen *summaryScreen) summaryScreen->sheenCount = (summaryScreen->sheenCount + 1) % 10; break; case 2: - if (CellActor_GetDrawFlag(summaryScreen->unk_41C[29 + summaryScreen->sheenMax - 1]) == FALSE) { + if (CellActor_GetDrawFlag(summaryScreen->sprites[SUMMARY_SHEEN_SPRITES_START + summaryScreen->sheenMax - 1]) == FALSE) { summaryScreen->sheenCount = 0; summaryScreen->sheenState = 3; break; @@ -553,10 +618,10 @@ void PokemonSummaryScreen_DrawSheenSprites(PokemonSummaryScreen *summaryScreen) summaryScreen->sheenCount++; if (summaryScreen->sheenCount == 32) { - for (i = 29; i < 29 + summaryScreen->sheenMax; i++) { - CellActor_SetDrawFlag(summaryScreen->unk_41C[i], TRUE); - SpriteActor_SetAnimFrame(summaryScreen->unk_41C[i], FALSE); - CellActor_SetAnim(summaryScreen->unk_41C[i], FALSE); + for (i = SUMMARY_SHEEN_SPRITES_START; i < SUMMARY_SHEEN_SPRITES_START + summaryScreen->sheenMax; i++) { + CellActor_SetDrawFlag(summaryScreen->sprites[i], TRUE); + SpriteActor_SetAnimFrame(summaryScreen->sprites[i], FALSE); + CellActor_SetAnim(summaryScreen->sprites[i], FALSE); } summaryScreen->sheenCount = 0; @@ -574,74 +639,70 @@ void PokemonSummaryScreen_DrawSheenSprites(PokemonSummaryScreen *summaryScreen) break; } - for (i = 29; i < 29 + summaryScreen->sheenMax; i++) { - if (CellActor_GetDrawFlag(summaryScreen->unk_41C[i]) == FALSE) { + for (i = SUMMARY_SHEEN_SPRITES_START; i < SUMMARY_SHEEN_SPRITES_START + summaryScreen->sheenMax; i++) { + if (CellActor_GetDrawFlag(summaryScreen->sprites[i]) == FALSE) { continue; } - CellActor_UpdateAnim(summaryScreen->unk_41C[i], FX32_ONE); + CellActor_UpdateAnim(summaryScreen->sprites[i], FX32_ONE); - if (CellActor_GetAnimFrame(summaryScreen->unk_41C[i]) == 6) { - CellActor_SetDrawFlag(summaryScreen->unk_41C[i], FALSE); + if (CellActor_GetAnimFrame(summaryScreen->sprites[i]) == 6) { + CellActor_SetDrawFlag(summaryScreen->sprites[i], FALSE); } } } -void sub_0208F574(PokemonSummaryScreen *param0) +void PokemonSummaryScreen_UpdateMiscMonDataSprites(PokemonSummaryScreen *summaryScreen) { - u32 v0; - - for (v0 = 0; v0 < 6; v0++) { - if (param0->monData.markings & (1 << v0)) { - CellActor_SetAnim(param0->unk_41C[23 + v0], 1); + for (u32 marking = 0; marking < MAX_POKEMON_MARKINGS; marking++) { + if (summaryScreen->monData.markings & (1 << marking)) { + CellActor_SetAnim(summaryScreen->sprites[SUMMARY_MARKING_SPRITES_START + marking], TRUE); } else { - CellActor_SetAnim(param0->unk_41C[23 + v0], 0); + CellActor_SetAnim(summaryScreen->sprites[SUMMARY_MARKING_SPRITES_START + marking], FALSE); } } - if ((param0->monData.isShiny == 1) && (param0->monData.isEgg == 0)) { - SpriteActor_DrawSprite(param0->unk_41C[53], 1); + if (summaryScreen->monData.isShiny == TRUE && summaryScreen->monData.isEgg == FALSE) { + SpriteActor_DrawSprite(summaryScreen->sprites[SUMMARY_SPRITE_SHINY_ICON], TRUE); } else { - SpriteActor_DrawSprite(param0->unk_41C[53], 0); + SpriteActor_DrawSprite(summaryScreen->sprites[SUMMARY_SPRITE_SHINY_ICON], FALSE); } - if (param0->monData.pokerus == 2) { - SpriteActor_DrawSprite(param0->unk_41C[54], 1); + if (summaryScreen->monData.pokerus == SUMMARY_POKERUS_CURED) { + SpriteActor_DrawSprite(summaryScreen->sprites[SUMMARY_SPRITE_POKERUS_CURED_ICON], TRUE); } else { - SpriteActor_DrawSprite(param0->unk_41C[54], 0); + SpriteActor_DrawSprite(summaryScreen->sprites[SUMMARY_SPRITE_POKERUS_CURED_ICON], FALSE); } } -void sub_0208F600(PokemonSummaryScreen *summaryScreen) +void PokemonSummaryScreen_ButtonTapAnim(PokemonSummaryScreen *summaryScreen) { - CellActor_SetDrawFlag(summaryScreen->unk_41C[41], TRUE); - SpriteActor_SetAnimFrame(summaryScreen->unk_41C[41], 0); - CellActor_SetAnim(summaryScreen->unk_41C[41], 0); + CellActor_SetDrawFlag(summaryScreen->sprites[SUMMARY_SPRITE_BUTTON_TAP_CIRCLE], TRUE); + SpriteActor_SetAnimFrame(summaryScreen->sprites[SUMMARY_SPRITE_BUTTON_TAP_CIRCLE], 0); + CellActor_SetAnim(summaryScreen->sprites[SUMMARY_SPRITE_BUTTON_TAP_CIRCLE], 0); s16 x, y; - PokemonSummaryScreen_CalcSubscreenButtonCirclePos(summaryScreen, &x, &y); + PokemonSummaryScreen_CalcSubscreenButtonTapAnimPos(summaryScreen, &x, &y); - if (summaryScreen->subscreenType == PSS_SUBSCREEN_TYPE_NORMAL) { - SpriteActor_SetPositionXY(summaryScreen->unk_41C[41], x, y + 192); + if (summaryScreen->subscreenType == SUMMARY_SUBSCREEN_TYPE_NORMAL) { + SpriteActor_SetPositionXY(summaryScreen->sprites[SUMMARY_SPRITE_BUTTON_TAP_CIRCLE], x, y + 192); } else { - SpriteActor_SetPositionXY(summaryScreen->unk_41C[41], x - 4, y + 192); + SpriteActor_SetPositionXY(summaryScreen->sprites[SUMMARY_SPRITE_BUTTON_TAP_CIRCLE], x - 4, y + 192); } } -void sub_0208F684(PokemonSummaryScreen *param0) +void PokemonSummaryScreen_HideButtonTapCircle(PokemonSummaryScreen *summaryScreen) { - if (CellActor_GetAnimFrame(param0->unk_41C[41]) == 2) { - CellActor_SetDrawFlag(param0->unk_41C[41], 0); + if (CellActor_GetAnimFrame(summaryScreen->sprites[SUMMARY_SPRITE_BUTTON_TAP_CIRCLE]) == 2) { + CellActor_SetDrawFlag(summaryScreen->sprites[SUMMARY_SPRITE_BUTTON_TAP_CIRCLE], FALSE); } } -void sub_0208F6A4(PokemonSummaryScreen *param0) +void PokemonSummaryScreen_UpdateConditionArrowSprites(PokemonSummaryScreen *summaryScreen) { - u8 v0; - - for (v0 = 0; v0 < 5; v0++) { - if (param0->subscreen & (1 << v0)) { - CellActor_SetDrawFlag(param0->unk_41C[42 + v0], 1); + for (u8 i = 0; i < MAX_CONDITION_ARROW_SPRITES; i++) { + if (summaryScreen->pageState & (1 << i)) { + CellActor_SetDrawFlag(summaryScreen->sprites[SUMMARY_CONDITION_ARROW_SPRITES_START + i], TRUE); } } } @@ -649,217 +710,211 @@ void sub_0208F6A4(PokemonSummaryScreen *param0) void PokemonSummaryScreen_UpdateAButtonSprite(PokemonSummaryScreen *summaryScreen, Window *window) { if (window == NULL) { - CellActor_SetDrawFlag(summaryScreen->unk_41C[47], FALSE); + CellActor_SetDrawFlag(summaryScreen->sprites[SUMMARY_SPRITE_A_BUTTON], FALSE); return; } - SpriteActor_SetPositionXY(summaryScreen->unk_41C[47], Window_GetXPos(window) * 8 - 10, 8); - CellActor_SetDrawFlag(summaryScreen->unk_41C[47], TRUE); + SpriteActor_SetPositionXY(summaryScreen->sprites[SUMMARY_SPRITE_A_BUTTON], Window_GetXPos(window) * 8 - 10, 8); + CellActor_SetDrawFlag(summaryScreen->sprites[SUMMARY_SPRITE_A_BUTTON], TRUE); } -void sub_0208F71C(PokemonSummaryScreen *param0) +void PokemonSummaryScreen_SetMonIcon(PokemonSummaryScreen *summaryScreen) { - void *v0 = PokemonSummaryScreen_MonData(param0); - u32 v1; + void *monData = PokemonSummaryScreen_MonData(summaryScreen); + u32 iconIndex; - if (param0->data->dataType == 2) { - v1 = BoxPokemon_IconSpriteIndex(v0); + if (summaryScreen->data->dataType == SUMMARY_DATA_BOX_MON) { + iconIndex = BoxPokemon_IconSpriteIndex(monData); } else { - v1 = Pokemon_IconSpriteIndex(v0); + iconIndex = Pokemon_IconSpriteIndex(monData); } - sub_0200D948(param0->renderer, param0->gfxHandler, 19, v1, 0, 11); - sub_0200D414(param0->unk_41C[19], PokeIconPaletteIndex(param0->monData.species, param0->monData.form, param0->monData.isEgg) + 7); - CellActor_SetFlipMode(param0->unk_41C[19], (PokemonPersonalData_GetFormValue(param0->monData.species, param0->monData.form, 28) ^ 1)); + sub_0200D948(summaryScreen->renderer, summaryScreen->gfxHandler, NARC_INDEX_POKETOOL__ICONGRA__PL_POKE_ICON, iconIndex, 0, 11); + sub_0200D414(summaryScreen->sprites[SUMMARY_SPRITE_MON_ICON], PokeIconPaletteIndex(summaryScreen->monData.species, summaryScreen->monData.form, summaryScreen->monData.isEgg) + 7); + CellActor_SetFlipMode(summaryScreen->sprites[SUMMARY_SPRITE_MON_ICON], (PokemonPersonalData_GetFormValue(summaryScreen->monData.species, summaryScreen->monData.form, 28) ^ 1)); } void PokemonSummaryScreen_ShowMonIcon(PokemonSummaryScreen *summaryScreen) { sub_0200D97C(summaryScreen->renderer, summaryScreen->gfxHandler, NARC_INDEX_POKETOOL__ICONGRA__PL_POKE_ICON, PokeIconPalettesFileIndex(), FALSE, 5); - if (summaryScreen->page == PSS_PAGE_BATTLE_MOVES) { - SpriteActor_SetPositionXY(summaryScreen->unk_41C[19], 24, 48); + if (summaryScreen->page == SUMMARY_PAGE_BATTLE_MOVES) { + SpriteActor_SetPositionXY(summaryScreen->sprites[SUMMARY_SPRITE_MON_ICON], 24, 48); } else { - SpriteActor_SetPositionXY(summaryScreen->unk_41C[19], 32, 68); + SpriteActor_SetPositionXY(summaryScreen->sprites[SUMMARY_SPRITE_MON_ICON], 32, 68); } - SpriteActor_DrawSprite(summaryScreen->unk_41C[19], TRUE); + SpriteActor_DrawSprite(summaryScreen->sprites[SUMMARY_SPRITE_MON_ICON], TRUE); } -static s16 sub_0208F800(u32 param0, s16 param1, s16 param2) +static s16 CalcContestStatDotPos(u32 statValue, s16 max, s16 min) { - u32 v0; + u32 pos; - param0 += 44; + statValue += DOT_MIN_POS; - if (param2 > param1) { - v0 = ((param2 - param1) * param0) << 16; - v0 = (v0 / 300) >> 16; + if (min > max) { + pos = ((min - max) * statValue) << 16; + pos = (pos / DOT_MAX_POS) >> 16; - return param2 + (s16)v0 * -1; + return min + (s16)pos * -1; } - v0 = ((param1 - param2) * param0) << 16; - v0 = (v0 / 300) >> 16; + pos = ((max - min) * statValue) << 16; + pos = (pos / DOT_MAX_POS) >> 16; - return param2 + (s16)v0; + return min + (s16)pos; } void PokemonSummaryScreen_DrawContestStatDots(PokemonSummaryScreen *summaryScreen) { - SpriteActor_SetPositionXY(summaryScreen->unk_41C[48], sub_0208F800(summaryScreen->monData.cool, 88, 88), sub_0208F800(summaryScreen->monData.cool, 49, 73)); - SpriteActor_SetPositionXY(summaryScreen->unk_41C[49], sub_0208F800(summaryScreen->monData.beauty, 110, 88), sub_0208F800(summaryScreen->monData.beauty, 65, 73)); - SpriteActor_SetPositionXY(summaryScreen->unk_41C[50], sub_0208F800(summaryScreen->monData.cute, 103, 88), sub_0208F800(summaryScreen->monData.cute, 92, 73)); - SpriteActor_SetPositionXY(summaryScreen->unk_41C[51], sub_0208F800(summaryScreen->monData.smart, 72, 87), sub_0208F800(summaryScreen->monData.smart, 92, 73)); - SpriteActor_SetPositionXY(summaryScreen->unk_41C[52], sub_0208F800(summaryScreen->monData.tough, 65, 87), sub_0208F800(summaryScreen->monData.tough, 65, 73)); + SpriteActor_SetPositionXY(summaryScreen->sprites[SUMMARY_SPRITE_CONTEST_STAT_DOT_COOL], CalcContestStatDotPos(summaryScreen->monData.cool, COOL_MAX_X, COOL_MIN_X), CalcContestStatDotPos(summaryScreen->monData.cool, COOL_MAX_Y, COOL_MIN_Y)); + SpriteActor_SetPositionXY(summaryScreen->sprites[SUMMARY_SPRITE_CONTEST_STAT_DOT_BEAUTY], CalcContestStatDotPos(summaryScreen->monData.beauty, BEAUTY_MAX_X, BEAUTY_MIN_X), CalcContestStatDotPos(summaryScreen->monData.beauty, BEAUTY_MAX_Y, BEAUTY_MIN_Y)); + SpriteActor_SetPositionXY(summaryScreen->sprites[SUMMARY_SPRITE_CONTEST_STAT_DOT_CUTE], CalcContestStatDotPos(summaryScreen->monData.cute, CUTE_MAX_X, CUTE_MIN_X), CalcContestStatDotPos(summaryScreen->monData.cute, CUTE_MAX_Y, CUTE_MIN_Y)); + SpriteActor_SetPositionXY(summaryScreen->sprites[SUMMARY_SPRITE_CONTEST_STAT_DOT_SMART], CalcContestStatDotPos(summaryScreen->monData.smart, SMART_MAX_X, SMART_MIN_X), CalcContestStatDotPos(summaryScreen->monData.smart, SMART_MAX_Y, SMART_MIN_Y)); + SpriteActor_SetPositionXY(summaryScreen->sprites[SUMMARY_SPRITE_CONTEST_STAT_DOT_TOUGH], CalcContestStatDotPos(summaryScreen->monData.tough, TOUGH_MAX_X, TOUGH_MIN_X), CalcContestStatDotPos(summaryScreen->monData.tough, TOUGH_MAX_Y, TOUGH_MIN_Y)); - CellActor_SetDrawFlag(summaryScreen->unk_41C[48], TRUE); - CellActor_SetDrawFlag(summaryScreen->unk_41C[49], TRUE); - CellActor_SetDrawFlag(summaryScreen->unk_41C[50], TRUE); - CellActor_SetDrawFlag(summaryScreen->unk_41C[51], TRUE); - CellActor_SetDrawFlag(summaryScreen->unk_41C[52], TRUE); + CellActor_SetDrawFlag(summaryScreen->sprites[SUMMARY_SPRITE_CONTEST_STAT_DOT_COOL], TRUE); + CellActor_SetDrawFlag(summaryScreen->sprites[SUMMARY_SPRITE_CONTEST_STAT_DOT_BEAUTY], TRUE); + CellActor_SetDrawFlag(summaryScreen->sprites[SUMMARY_SPRITE_CONTEST_STAT_DOT_CUTE], TRUE); + CellActor_SetDrawFlag(summaryScreen->sprites[SUMMARY_SPRITE_CONTEST_STAT_DOT_SMART], TRUE); + CellActor_SetDrawFlag(summaryScreen->sprites[SUMMARY_SPRITE_CONTEST_STAT_DOT_TOUGH], TRUE); } void PokemonSummaryScreen_HideContestStatDots(PokemonSummaryScreen *summaryScreen) { - CellActor_SetDrawFlag(summaryScreen->unk_41C[48], FALSE); - CellActor_SetDrawFlag(summaryScreen->unk_41C[49], FALSE); - CellActor_SetDrawFlag(summaryScreen->unk_41C[50], FALSE); - CellActor_SetDrawFlag(summaryScreen->unk_41C[51], FALSE); - CellActor_SetDrawFlag(summaryScreen->unk_41C[52], FALSE); + CellActor_SetDrawFlag(summaryScreen->sprites[SUMMARY_SPRITE_CONTEST_STAT_DOT_COOL], FALSE); + CellActor_SetDrawFlag(summaryScreen->sprites[SUMMARY_SPRITE_CONTEST_STAT_DOT_BEAUTY], FALSE); + CellActor_SetDrawFlag(summaryScreen->sprites[SUMMARY_SPRITE_CONTEST_STAT_DOT_CUTE], FALSE); + CellActor_SetDrawFlag(summaryScreen->sprites[SUMMARY_SPRITE_CONTEST_STAT_DOT_SMART], FALSE); + CellActor_SetDrawFlag(summaryScreen->sprites[SUMMARY_SPRITE_CONTEST_STAT_DOT_TOUGH], FALSE); } -static void sub_0208F9B0(PokemonSummaryScreen *summaryScreen, u8 ribbonNum, u8 param2) +static void SetRibbonSpriteGfx(PokemonSummaryScreen *summaryScreen, u8 ribbonNum, u8 ribbonIndex) { - sub_0200D948(summaryScreen->renderer, summaryScreen->gfxHandler, 39, Ribbon_GetData(ribbonNum, RIBBON_DATA_SPRITE_ID), 0, 26 + param2); - sub_0200D414(summaryScreen->unk_41C[55 + param2], Ribbon_GetData(ribbonNum, RIBBON_DATA_PALETTE_NUM) + 7); + sub_0200D948(summaryScreen->renderer, summaryScreen->gfxHandler, NARC_INDEX_GRAPHIC__PL_PST_GRA, Ribbon_GetData(ribbonNum, RIBBON_DATA_SPRITE_ID), 0, 26 + ribbonIndex); + sub_0200D414(summaryScreen->sprites[SUMMARY_SPRITE_RIBBON_1 + ribbonIndex], Ribbon_GetData(ribbonNum, RIBBON_DATA_PALETTE_NUM) + 7); } -void sub_0208FA04(PokemonSummaryScreen *summaryScreen) +void PokemonSummaryScreen_UpdateRibbonSprites(PokemonSummaryScreen *summaryScreen) { u16 i; - - for (i = 55; i <= 70; i++) { - CellActor_SetDrawFlag(summaryScreen->unk_41C[i], 0); + for (i = SUMMARY_RIBBON_SPRITES_START; i <= SUMMARY_SPRITE_RIBBON_FLASH; i++) { + CellActor_SetDrawFlag(summaryScreen->sprites[i], FALSE); } - if (summaryScreen->page != PSS_PAGE_RIBBONS) { + if (summaryScreen->page != SUMMARY_PAGE_RIBBONS) { return; } - sub_0200D97C(summaryScreen->renderer, summaryScreen->gfxHandler, 39, 136, 0, 5); + sub_0200D97C(summaryScreen->renderer, summaryScreen->gfxHandler, NARC_INDEX_GRAPHIC__PL_PST_GRA, ribbons_NCLR, FALSE, 5); - for (i = 0; i < 12; i++) { + for (i = 0; i < RIBBONS_PER_PAGE; i++) { if (i < summaryScreen->ribbonMax) { - CellActor_SetDrawFlag(summaryScreen->unk_41C[55 + i], TRUE); - sub_0208F9B0(summaryScreen, PokemonSummaryScreen_RibbonNumAt(summaryScreen, i), i); + CellActor_SetDrawFlag(summaryScreen->sprites[SUMMARY_RIBBON_SPRITES_START + i], TRUE); + SetRibbonSpriteGfx(summaryScreen, PokemonSummaryScreen_RibbonNumAt(summaryScreen, i), i); } } - CellActor_SetAnim(summaryScreen->unk_41C[70], 0); + CellActor_SetAnim(summaryScreen->sprites[SUMMARY_SPRITE_RIBBON_FLASH], 0); } void PokemonSummaryScreen_UpdateShownRibbonRows(PokemonSummaryScreen *summaryScreen) { for (u16 i = 0; i < RIBBONS_PER_ROW * 2; i++) { if ((summaryScreen->ribbonRow * RIBBONS_PER_ROW + i) < summaryScreen->ribbonMax) { - CellActor_SetDrawFlag(summaryScreen->unk_41C[55 + i], TRUE); - sub_0208F9B0(summaryScreen, PokemonSummaryScreen_RibbonNumAt(summaryScreen, i), i); + CellActor_SetDrawFlag(summaryScreen->sprites[SUMMARY_RIBBON_SPRITES_START + i], TRUE); + SetRibbonSpriteGfx(summaryScreen, PokemonSummaryScreen_RibbonNumAt(summaryScreen, i), i); } else { - CellActor_SetDrawFlag(summaryScreen->unk_41C[55 + i], FALSE); + CellActor_SetDrawFlag(summaryScreen->sprites[SUMMARY_RIBBON_SPRITES_START + i], FALSE); } } } void PokemonSummaryScreen_UpdateRibbonCursorPos(PokemonSummaryScreen *summaryScreen) { - SpriteActor_SetPositionXY( - summaryScreen->unk_41C[67], 132 + (summaryScreen->ribbonCol & (RIBBONS_PER_ROW - 1)) * 32, 56 + (summaryScreen->ribbonCol / RIBBONS_PER_ROW) * 40); + SpriteActor_SetPositionXY(summaryScreen->sprites[SUMMARY_SPRITE_RIBBON_CURSOR], RIBBON_CURSOR_BASE_X + (summaryScreen->ribbonCol & (RIBBONS_PER_ROW - 1)) * RIBBON_SPACING_X, RIBBON_CURSOR_BASE_Y + (summaryScreen->ribbonCol / RIBBONS_PER_ROW) * RIBBON_SPACING_Y); } -void sub_0208FB30(PokemonSummaryScreen *summaryScreen) +void PokemonSummaryScreen_UpdateRibbonFlashAnim(PokemonSummaryScreen *summaryScreen) { - if (CellActor_GetDrawFlag(summaryScreen->unk_41C[70]) == TRUE) { - CellActor_UpdateAnim(summaryScreen->unk_41C[70], FX32_ONE); + if (CellActor_GetDrawFlag(summaryScreen->sprites[SUMMARY_SPRITE_RIBBON_FLASH]) == TRUE) { + CellActor_UpdateAnim(summaryScreen->sprites[SUMMARY_SPRITE_RIBBON_FLASH], FX32_ONE); } } -static const s16 Unk_020F4180[][4] = { - { 0xB4, 0x39, 0xB4, 0x5A }, - { 0xD5, 0x55, 0xB8, 0x5D }, - { 0xC8, 0x7D, 0xB6, 0x61 }, - { 0x9F, 0x7D, 0xB2, 0x61 }, - { 0x92, 0x55, 0xB0, 0x5D } +static const s16 sConditionFlashCoordBounds[][FLASH_BOUNDS_MAX] = { + [SUMMARY_CONTEST_TYPE_COOL] = { 180, 57, 180, 90 }, + [SUMMARY_CONTEST_TYPE_BEAUTY] = { 213, 85, 184, 93 }, + [SUMMARY_CONTEST_TYPE_CUTE] = { 200, 125, 182, 97 }, + [SUMMARY_CONTEST_TYPE_SMART] = { 159, 125, 178, 97 }, + [SUMMARY_CONTEST_TYPE_TOUGH] = { 146, 85, 176, 93 } }; -void sub_0208FB54(PokemonSummaryScreen *param0, u8 param1) +void PokemonSummaryScreen_UpdateConditionFlashSprites(PokemonSummaryScreen *summaryScreen, BOOL showFlashes) { - u16 v0, v1; - - if (param1 == 0) { - for (v0 = 0; v0 < 5; v0++) { - CellActor_SetDrawFlag(param0->unk_41C[71 + v0], 0); + if (showFlashes == FALSE) { + for (u16 i = 0; i < MAX_CONDITION_FLASH_SPRITES; i++) { + CellActor_SetDrawFlag(summaryScreen->sprites[SUMMARY_CONDITION_FLASH_SPRITES_START + i], FALSE); } } else { - v1 = param0->monData.cool; + u16 highestValue = summaryScreen->monData.cool; - if (v1 < param0->monData.beauty) { - v1 = param0->monData.beauty; + if (highestValue < summaryScreen->monData.beauty) { + highestValue = summaryScreen->monData.beauty; } - if (v1 < param0->monData.cute) { - v1 = param0->monData.cute; + if (highestValue < summaryScreen->monData.cute) { + highestValue = summaryScreen->monData.cute; } - if (v1 < param0->monData.smart) { - v1 = param0->monData.smart; + if (highestValue < summaryScreen->monData.smart) { + highestValue = summaryScreen->monData.smart; } - if (v1 < param0->monData.tough) { - v1 = param0->monData.tough; + if (highestValue < summaryScreen->monData.tough) { + highestValue = summaryScreen->monData.tough; } - sub_0208FC30(param0->unk_41C[71], param0->monData.cool, v1, Unk_020F4180[0]); - sub_0208FC30(param0->unk_41C[72], param0->monData.beauty, v1, Unk_020F4180[1]); - sub_0208FC30(param0->unk_41C[73], param0->monData.cute, v1, Unk_020F4180[2]); - sub_0208FC30(param0->unk_41C[74], param0->monData.smart, v1, Unk_020F4180[3]); - sub_0208FC30(param0->unk_41C[75], param0->monData.tough, v1, Unk_020F4180[4]); + DrawConditionFlash(summaryScreen->sprites[SUMMARY_SPRITE_CONDITION_FLASH_COOL], summaryScreen->monData.cool, highestValue, sConditionFlashCoordBounds[SUMMARY_CONTEST_TYPE_COOL]); + DrawConditionFlash(summaryScreen->sprites[SUMMARY_SPRITE_CONDITION_FLASH_BEAUTY], summaryScreen->monData.beauty, highestValue, sConditionFlashCoordBounds[SUMMARY_CONTEST_TYPE_BEAUTY]); + DrawConditionFlash(summaryScreen->sprites[SUMMARY_SPRITE_CONDITION_FLASH_CUTE], summaryScreen->monData.cute, highestValue, sConditionFlashCoordBounds[SUMMARY_CONTEST_TYPE_CUTE]); + DrawConditionFlash(summaryScreen->sprites[SUMMARY_SPRITE_CONDITION_FLASH_SMART], summaryScreen->monData.smart, highestValue, sConditionFlashCoordBounds[SUMMARY_CONTEST_TYPE_SMART]); + DrawConditionFlash(summaryScreen->sprites[SUMMARY_SPRITE_CONDITION_FLASH_TOUGH], summaryScreen->monData.tough, highestValue, sConditionFlashCoordBounds[SUMMARY_CONTEST_TYPE_TOUGH]); } } -static void sub_0208FC30(CellActor *param0, u32 param1, u32 param2, const s16 *param3) +static void DrawConditionFlash(CellActor *sprite, u32 statValue, u32 highestValue, const s16 *bounds) { - s32 v0, v1; - - if ((param1 == 0) || (param1 != param2)) { - CellActor_SetDrawFlag(param0, 0); + if (statValue == 0 || statValue != highestValue) { + CellActor_SetDrawFlag(sprite, FALSE); return; } - CellActor_SetDrawFlag(param0, 1); + CellActor_SetDrawFlag(sprite, TRUE); - if (param3[0] >= param3[2]) { - v0 = param3[2] + (((((param3[0] - param3[2]) << 8) / 256) * param1) >> 8); + s32 x, y; + + if (bounds[FLASH_MAX_X] >= bounds[FLASH_MIN_X]) { + x = bounds[FLASH_MIN_X] + (((((bounds[FLASH_MAX_X] - bounds[FLASH_MIN_X]) << 8) / 256) * statValue) >> 8); } else { - v0 = param3[2] - (((((param3[2] - param3[0]) << 8) / 256) * param1) >> 8); + x = bounds[FLASH_MIN_X] - (((((bounds[FLASH_MIN_X] - bounds[FLASH_MAX_X]) << 8) / 256) * statValue) >> 8); } - if (param3[1] >= param3[3]) { - v1 = param3[3] + (((((param3[1] - param3[3]) << 8) / 256) * param1) >> 8); + if (bounds[FLASH_MAX_Y] >= bounds[FLASH_MIN_Y]) { + y = bounds[FLASH_MIN_Y] + (((((bounds[FLASH_MAX_Y] - bounds[FLASH_MIN_Y]) << 8) / 256) * statValue) >> 8); } else { - v1 = param3[3] - (((((param3[3] - param3[1]) << 8) / 256) * param1) >> 8); + y = bounds[FLASH_MIN_Y] - (((((bounds[FLASH_MIN_Y] - bounds[FLASH_MAX_Y]) << 8) / 256) * statValue) >> 8); } - SpriteActor_SetPositionXY(param0, v0, v1); - SpriteActor_SetAnimFrame(param0, 0); - CellActor_SetAnim(param0, 0); + SpriteActor_SetPositionXY(sprite, x, y); + SpriteActor_SetAnimFrame(sprite, 0); + CellActor_SetAnim(sprite, 0); } -void sub_0208FCD4(PokemonSummaryScreen *param0) +void PokemonSummaryScreen_UpdateConditionFlashAnim(PokemonSummaryScreen *summaryScreen) { - u32 v0; - - for (v0 = 0; v0 < 5; v0++) { - CellActor_UpdateAnim(param0->unk_41C[71 + v0], FX32_ONE); + for (u32 i = 0; i < MAX_CONDITION_FLASH_SPRITES; i++) { + CellActor_UpdateAnim(summaryScreen->sprites[SUMMARY_CONDITION_FLASH_SPRITES_START + i], FX32_ONE); } } diff --git a/src/applications/pokemon_summary_screen/subscreen.c b/src/applications/pokemon_summary_screen/subscreen.c index 5758ac7e22..e9315a5b9e 100644 --- a/src/applications/pokemon_summary_screen/subscreen.c +++ b/src/applications/pokemon_summary_screen/subscreen.c @@ -13,47 +13,47 @@ #include "touch_screen.h" #include "unk_02005474.h" -typedef struct PSSSubscreenButton { +typedef struct SummarySubscreenButton { u8 page; u8 paletteNum; u8 x; u8 y; -} PSSSubscreenButton; +} SummarySubscreenButton; static void sub_0223D0BC(PokemonSummaryScreen *summaryScreen); static int CheckSubscreenRectanglePress(PokemonSummaryScreen *summaryScreen); -static const PSSSubscreenButton sSubscreenButtons_Normal[] = { - { PSS_PAGE_INFO, 1, 1, 4 }, - { PSS_PAGE_MEMO, 1, 2, 10 }, - { PSS_PAGE_SKILLS, 2, 5, 15 }, - { PSS_PAGE_BATTLE_MOVES, 3, 10, 18 }, - { PSS_PAGE_CONDITION, 2, 17, 18 }, - { PSS_PAGE_CONTEST_MOVES, 3, 22, 15 }, - { PSS_PAGE_RIBBONS, 4, 25, 10 }, - { PSS_PAGE_EXIT, 4, 26, 4 }, - { PSS_PAGE_NONE, -1, -1, -1 } +static const SummarySubscreenButton sSubscreenButtons_Normal[] = { + { SUMMARY_PAGE_INFO, 1, 1, 4 }, + { SUMMARY_PAGE_MEMO, 1, 2, 10 }, + { SUMMARY_PAGE_SKILLS, 2, 5, 15 }, + { SUMMARY_PAGE_BATTLE_MOVES, 3, 10, 18 }, + { SUMMARY_PAGE_CONDITION, 2, 17, 18 }, + { SUMMARY_PAGE_CONTEST_MOVES, 3, 22, 15 }, + { SUMMARY_PAGE_RIBBONS, 4, 25, 10 }, + { SUMMARY_PAGE_EXIT, 4, 26, 4 }, + { SUMMARY_PAGE_NONE, -1, -1, -1 } }; -static const PSSSubscreenButton sSubscreenButtons_NoContestInfo[] = { - { PSS_PAGE_INFO, 1, 2, 9 }, - { PSS_PAGE_MEMO, 1, 6, 15 }, - { PSS_PAGE_SKILLS, 2, 14, 18 }, - { PSS_PAGE_BATTLE_MOVES, 3, 22, 15 }, - { PSS_PAGE_EXIT, 4, 26, 9 }, - { PSS_PAGE_NONE, -1, -1, -1 } +static const SummarySubscreenButton sSubscreenButtons_NoContestInfo[] = { + { SUMMARY_PAGE_INFO, 1, 2, 9 }, + { SUMMARY_PAGE_MEMO, 1, 6, 15 }, + { SUMMARY_PAGE_SKILLS, 2, 14, 18 }, + { SUMMARY_PAGE_BATTLE_MOVES, 3, 22, 15 }, + { SUMMARY_PAGE_EXIT, 4, 26, 9 }, + { SUMMARY_PAGE_NONE, -1, -1, -1 } }; -static const PSSSubscreenButton sSubscreenButtons_UnusedMovesOnly[] = { - { PSS_PAGE_BATTLE_MOVES, 3, 10, 18 }, - { PSS_PAGE_CONTEST_MOVES, 3, 17, 18 }, - { PSS_PAGE_NONE, -1, -1, -1 } +static const SummarySubscreenButton sSubscreenButtons_UnusedMovesOnly[] = { + { SUMMARY_PAGE_BATTLE_MOVES, 3, 10, 18 }, + { SUMMARY_PAGE_CONTEST_MOVES, 3, 17, 18 }, + { SUMMARY_PAGE_NONE, -1, -1, -1 } }; -static const PSSSubscreenButton *sSubscreenButtonTypes[] = { - [PSS_SUBSCREEN_TYPE_NORMAL] = sSubscreenButtons_Normal, - [PSS_SUBSCREEN_TYPE_NO_CONTEST_INFO] = sSubscreenButtons_NoContestInfo, - [PSS_SUBSCREEN_TYPE_UNUSED_MOVES_ONLY] = sSubscreenButtons_UnusedMovesOnly +static const SummarySubscreenButton *sSubscreenButtonTypes[] = { + [SUMMARY_SUBSCREEN_TYPE_NORMAL] = sSubscreenButtons_Normal, + [SUMMARY_SUBSCREEN_TYPE_NO_CONTEST_INFO] = sSubscreenButtons_NoContestInfo, + [SUMMARY_SUBSCREEN_TYPE_UNUSED_MOVES_ONLY] = sSubscreenButtons_UnusedMovesOnly }; static const TouchScreenRect sSubscreenRectangles_Normal[] = { @@ -84,33 +84,33 @@ static const TouchScreenRect sSubscreenRectangles_UnusedMovesOnly[] = { }; static const TouchScreenRect *sSubscreenRectangles[] = { - [PSS_SUBSCREEN_TYPE_NORMAL] = sSubscreenRectangles_Normal, - [PSS_SUBSCREEN_TYPE_NO_CONTEST_INFO] = sSubscreenRectangles_NoContestInfo, - [PSS_SUBSCREEN_TYPE_UNUSED_MOVES_ONLY] = sSubscreenRectangles_UnusedMovesOnly + [SUMMARY_SUBSCREEN_TYPE_NORMAL] = sSubscreenRectangles_Normal, + [SUMMARY_SUBSCREEN_TYPE_NO_CONTEST_INFO] = sSubscreenRectangles_NoContestInfo, + [SUMMARY_SUBSCREEN_TYPE_UNUSED_MOVES_ONLY] = sSubscreenRectangles_UnusedMovesOnly }; void PokemonSummaryScreen_SetSubscreenType(PokemonSummaryScreen *summaryScreen) { switch (summaryScreen->data->mode) { - case PSS_MODE_NORMAL: - case PSS_MODE_LOCK_MOVES: + case SUMMARY_MODE_NORMAL: + case SUMMARY_MODE_LOCK_MOVES: if (summaryScreen->data->showContest != FALSE) { - summaryScreen->subscreenType = PSS_SUBSCREEN_TYPE_NORMAL; + summaryScreen->subscreenType = SUMMARY_SUBSCREEN_TYPE_NORMAL; } else { - summaryScreen->subscreenType = PSS_SUBSCREEN_TYPE_NO_CONTEST_INFO; + summaryScreen->subscreenType = SUMMARY_SUBSCREEN_TYPE_NO_CONTEST_INFO; Bg_ScheduleScroll(summaryScreen->bgConfig, BG_LAYER_SUB_0, BG_OFFSET_UPDATE_SET_X, 4); } break; - case PSS_MODE_SELECT_MOVE: - case PSS_MODE_POFFIN: + case SUMMARY_MODE_SELECT_MOVE: + case SUMMARY_MODE_POFFIN: default: - summaryScreen->subscreenType = PSS_SUBSCREEN_TYPE_NO_BUTTONS; + summaryScreen->subscreenType = SUMMARY_SUBSCREEN_TYPE_NO_BUTTONS; } PokemonSummaryScreen_UpdateSubscreenButtonGfx(summaryScreen); } -static void UpdateSubscreenButtonTilemap(PokemonSummaryScreen *summaryScreen, const PSSSubscreenButton *button, u8 animID) +static void UpdateSubscreenButtonTilemap(PokemonSummaryScreen *summaryScreen, const SummarySubscreenButton *button, u8 animID) { u16 *bgSub0Tilemap = (u16 *)Bg_GetTilemapBuffer(summaryScreen->bgConfig, BG_LAYER_SUB_0); u16 baseTile = (button->page & 1) * 15 + (button->page / 2) * (30 * 5) + animID * 5 + 30; @@ -125,15 +125,15 @@ static void UpdateSubscreenButtonTilemap(PokemonSummaryScreen *summaryScreen, co void PokemonSummaryScreen_UpdateSubscreenButtonGfx(PokemonSummaryScreen *summaryScreen) { - if (summaryScreen->subscreenType == PSS_SUBSCREEN_TYPE_NO_BUTTONS) { + if (summaryScreen->subscreenType == SUMMARY_SUBSCREEN_TYPE_NO_BUTTONS) { return; } - const PSSSubscreenButton *buttonList = sSubscreenButtonTypes[summaryScreen->subscreenType]; + const SummarySubscreenButton *buttonList = sSubscreenButtonTypes[summaryScreen->subscreenType]; u8 button = 0; while (TRUE) { - if (buttonList[button].page == PSS_PAGE_NONE) { + if (buttonList[button].page == SUMMARY_PAGE_NONE) { break; } @@ -152,12 +152,12 @@ u8 PokemonSummaryScreen_CheckSubscreenButtonPress(PokemonSummaryScreen *summaryS return button; } - return PSS_SUBSCREEN_BUTTON_NONE; + return SUMMARY_SUBSCREEN_BUTTON_NONE; } static int CheckSubscreenRectanglePress(PokemonSummaryScreen *summaryScreen) { - if (summaryScreen->subscreenType == PSS_SUBSCREEN_TYPE_NO_BUTTONS) { + if (summaryScreen->subscreenType == SUMMARY_SUBSCREEN_TYPE_NO_BUTTONS) { return TOUCHSCREEN_INPUT_NONE; } @@ -168,14 +168,14 @@ static int sub_02092224(PokemonSummaryScreen *summaryScreen) { int v0; - if (summaryScreen->subscreenType == PSS_SUBSCREEN_TYPE_NO_BUTTONS) { + if (summaryScreen->subscreenType == SUMMARY_SUBSCREEN_TYPE_NO_BUTTONS) { return TOUCHSCREEN_INPUT_NONE; } v0 = sub_02022644(sSubscreenRectangles[summaryScreen->subscreenType]); if (v0 != TOUCHSCREEN_INPUT_NONE) { - u16 v1 = 0xfffe; + u16 v1 = 0xFFFE; if (Bg_DoesPixelAtXYMatchVal(summaryScreen->bgConfig, BG_LAYER_SUB_0, gCoreSys.touchX, gCoreSys.touchY, &v1) == 0) { return TOUCHSCREEN_INPUT_NONE; @@ -187,7 +187,7 @@ static int sub_02092224(PokemonSummaryScreen *summaryScreen) u8 PokemonSummaryScreen_DrawSubscreenButtonAnim(PokemonSummaryScreen *summaryScreen) { - const PSSSubscreenButton *buttonList = sSubscreenButtonTypes[summaryScreen->subscreenType]; + const SummarySubscreenButton *buttonList = sSubscreenButtonTypes[summaryScreen->subscreenType]; switch (summaryScreen->buttonState) { case 0: @@ -195,7 +195,7 @@ u8 PokemonSummaryScreen_DrawSubscreenButtonAnim(PokemonSummaryScreen *summaryScr PokemonSummaryScreen_UpdateSubscreenButtonGfx(summaryScreen); UpdateSubscreenButtonTilemap(summaryScreen, &buttonList[summaryScreen->buttonCurrent], 2); Bg_ScheduleTilemapTransfer(summaryScreen->bgConfig, BG_LAYER_SUB_0); - sub_0208F600(summaryScreen); + PokemonSummaryScreen_ButtonTapAnim(summaryScreen); summaryScreen->buttonCount = 0; summaryScreen->buttonState = 1; break; @@ -210,12 +210,12 @@ u8 PokemonSummaryScreen_DrawSubscreenButtonAnim(PokemonSummaryScreen *summaryScr break; } - sub_0208F684(summaryScreen); + PokemonSummaryScreen_HideButtonTapCircle(summaryScreen); if (sub_02092224(summaryScreen) != summaryScreen->buttonCurrent) { if (summaryScreen->monData.isEgg != FALSE - && buttonList[summaryScreen->buttonCurrent].page != PSS_PAGE_MEMO - && buttonList[summaryScreen->buttonCurrent].page != PSS_PAGE_EXIT) { + && buttonList[summaryScreen->buttonCurrent].page != SUMMARY_PAGE_MEMO + && buttonList[summaryScreen->buttonCurrent].page != SUMMARY_PAGE_EXIT) { UpdateSubscreenButtonTilemap(summaryScreen, &buttonList[summaryScreen->buttonCurrent], 0); } else { UpdateSubscreenButtonTilemap(summaryScreen, &buttonList[summaryScreen->buttonCurrent], 1); @@ -229,9 +229,9 @@ u8 PokemonSummaryScreen_DrawSubscreenButtonAnim(PokemonSummaryScreen *summaryScr return FALSE; } -void PokemonSummaryScreen_CalcSubscreenButtonCirclePos(PokemonSummaryScreen *summaryScreen, s16 *outX, s16 *outY) +void PokemonSummaryScreen_CalcSubscreenButtonTapAnimPos(PokemonSummaryScreen *summaryScreen, s16 *outX, s16 *outY) { - const PSSSubscreenButton *buttonList = sSubscreenButtonTypes[summaryScreen->subscreenType]; + const SummarySubscreenButton *buttonList = sSubscreenButtonTypes[summaryScreen->subscreenType]; *outX = buttonList[summaryScreen->buttonCurrent].x * 8 + (5 * 8) / 2; *outY = buttonList[summaryScreen->buttonCurrent].y * 8 + (5 * 8) / 2; @@ -239,6 +239,6 @@ void PokemonSummaryScreen_CalcSubscreenButtonCirclePos(PokemonSummaryScreen *sum u8 PokemonSummaryScreen_GetSubscreenButtonPage(PokemonSummaryScreen *summaryScreen, u8 button) { - const PSSSubscreenButton *buttonList = sSubscreenButtonTypes[summaryScreen->subscreenType]; + const SummarySubscreenButton *buttonList = sSubscreenButtonTypes[summaryScreen->subscreenType]; return buttonList[button].page; } diff --git a/src/applications/pokemon_summary_screen/window.c b/src/applications/pokemon_summary_screen/window.c index 80269f6175..ce62e2202d 100644 --- a/src/applications/pokemon_summary_screen/window.c +++ b/src/applications/pokemon_summary_screen/window.c @@ -3,6 +3,9 @@ #include #include +#include "consts/gender.h" +#include "consts/items.h" + #include "struct_defs/struct_02090800.h" #include "applications/pokemon_summary_screen/main.h" @@ -26,193 +29,775 @@ #include "unk_02092494.h" #include "unk_02094EDC.h" -static void PrintTextToWindow(PokemonSummaryScreen *summaryScreen, Window *window, TextColor color, enum PSSTextAlignment alignment); -static void sub_02090158(PokemonSummaryScreen *param0, u32 param1, u32 param2, TextColor param3, u32 param4); -static void sub_020902B0(PokemonSummaryScreen *param0); -static void PrintMoveInfo(PokemonSummaryScreen *param0, u32 param1); -static void sub_02090578(PokemonSummaryScreen *param0); -static void sub_020908CC(PokemonSummaryScreen *param0); -static void sub_0209093C(PokemonSummaryScreen *param0); -static void sub_02090BDC(PokemonSummaryScreen *param0); -static void sub_02090CD4(PokemonSummaryScreen *param0); -static void sub_02090D90(PokemonSummaryScreen *param0); -static void sub_02090E4C(PokemonSummaryScreen *param0); -static void sub_02090EC8(PokemonSummaryScreen *param0); - -static const WindowTemplate sPSSStaticWindowTemplates[] = { - [PSS_STATIC_WINDOW_0] = { 0x1, 0x1, 0x0, 0xD, 0x2, 0xF, 0x1 }, - [PSS_STATIC_WINDOW_1] = { 0x1, 0x1, 0x0, 0xB, 0x2, 0xF, 0x1B }, - [PSS_STATIC_WINDOW_2] = { 0x1, 0x1, 0x0, 0xE, 0x2, 0xF, 0x31 }, - [PSS_STATIC_WINDOW_3] = { 0x1, 0x1, 0x0, 0xB, 0x2, 0xF, 0x4D }, - [PSS_STATIC_WINDOW_4] = { 0x1, 0x1, 0x0, 0x9, 0x2, 0xF, 0x63 }, - [PSS_STATIC_WINDOW_5] = { 0x1, 0x1, 0x0, 0xB, 0x2, 0xF, 0x75 }, - [PSS_WINDOW_ITEM_LABEL] = { 0x1, 0x1, 0x14, 0x6, 0x2, 0xF, 0x8B }, - [PSS_STATIC_WINDOW_7] = { 0x1, 0xE, 0x5, 0x9, 0x2, 0xF, 0x97 }, - [PSS_STATIC_WINDOW_8] = { 0x1, 0xE, 0x7, 0x5, 0x2, 0xF, 0xA9 }, - [PSS_STATIC_WINDOW_9] = { 0x1, 0xE, 0x9, 0x5, 0x2, 0xF, 0xB3 }, - [PSS_STATIC_WINDOW_10] = { 0x1, 0xE, 0xB, 0x5, 0x2, 0xF, 0xBD }, - [PSS_STATIC_WINDOW_11] = { 0x1, 0xE, 0xD, 0x5, 0x2, 0xF, 0xC7 }, - [PSS_STATIC_WINDOW_12] = { 0x1, 0xE, 0xF, 0xF, 0x2, 0xF, 0xD1 }, - [PSS_STATIC_WINDOW_13] = { 0x1, 0xE, 0x13, 0xC, 0x2, 0xF, 0xEF }, - [PSS_STATIC_WINDOW_14] = { 0x1, 0x13, 0x15, 0x3, 0x2, 0xF, 0x107 }, - [PSS_STATIC_WINDOW_15] = { 0x1, 0x12, 0x4, 0x2, 0x2, 0xF, 0x10D }, - [PSS_STATIC_WINDOW_16] = { 0x1, 0x10, 0x7, 0x6, 0x2, 0xF, 0x111 }, - [PSS_STATIC_WINDOW_17] = { 0x1, 0x10, 0x9, 0x6, 0x2, 0xF, 0x11D }, - [PSS_STATIC_WINDOW_18] = { 0x1, 0x10, 0xB, 0x6, 0x2, 0xF, 0x129 }, - [PSS_STATIC_WINDOW_19] = { 0x1, 0x10, 0xD, 0x6, 0x2, 0xF, 0x135 }, - [PSS_STATIC_WINDOW_20] = { 0x1, 0x10, 0xF, 0x6, 0x2, 0xF, 0x141 }, - [PSS_STATIC_WINDOW_21] = { 0x1, 0xE, 0x12, 0x6, 0x2, 0xF, 0x14D }, - [PSS_STATIC_WINDOW_22] = { 0x1, 0xE, 0x14, 0x5, 0x2, 0xF, 0x159 }, - [PSS_STATIC_WINDOW_23] = { 0x1, 0x1, 0x16, 0x6, 0x2, 0xF, 0x163 }, - [PSS_STATIC_WINDOW_24] = { 0x1, 0x15, 0x14, 0x5, 0x2, 0xF, 0x16F }, - [PSS_STATIC_WINDOW_25] = { 0x1, 0x1, 0x8, 0x6, 0x2, 0xF, 0x179 }, - [PSS_WINDOW_MOVE_POWER] = { 0x1, 0x1, 0xA, 0x6, 0x2, 0xF, 0x185 }, - [PSS_WINDOW_MOVE_ACCURACY] = { 0x1, 0x1, 0xC, 0x8, 0x2, 0xF, 0x191 }, - [PSS_STATIC_WINDOW_28] = { 0x1, 0x12, 0xB, 0x9, 0x2, 0xF, 0x1A1 }, - [PSS_STATIC_WINDOW_29] = { 0x1, 0x2, 0xD, 0xC, 0x2, 0xF, 0x1B3 }, - [PSS_STATIC_WINDOW_30] = { 0x1, 0xE, 0x15, 0xC, 0x2, 0xF, 0x1CB }, - [PSS_STATIC_WINDOW_31] = { 0x1, 0x1, 0x0, 0xB, 0x2, 0xF, 0x1E3 }, - [PSS_WINDOW_ITEM_NAME] = { 0x1, 0x1, 0x16, 0xC, 0x2, 0xF, 0x1F9 }, - [PSS_WINDOW_MON_LEVEL] = { 0x1, 0x1, 0x5, 0x6, 0x2, 0xF, 0x211 }, - [PSS_WINDOW_MON_NICKNAME] = { 0x1, 0x3, 0x3, 0x9, 0x2, 0xF, 0x21D }, - [PSS_WINDOW_BUTTON_PROMPT] = { 0x1, 0x1A, 0x0, 0x6, 0x2, 0xF, 0x22F } +// todo: consolidate this with more generic ones if this scheme is used elsewhere +enum SummaryTextAlignment { + ALIGN_LEFT = 0, + ALIGN_RIGHT, + ALIGN_CENTER, }; -static const WindowTemplate Unk_020F4E20[] = { - { 0x1, 0x18, 0x5, 0x6, 0x2, 0xF, 0x23B }, - { 0x1, 0x17, 0x7, 0x8, 0x2, 0xF, 0x247 }, - { 0x1, 0x17, 0xB, 0x8, 0x2, 0xF, 0x257 }, - { 0x1, 0x19, 0xD, 0x4, 0x2, 0xF, 0x267 }, - { 0x1, 0x18, 0x11, 0x6, 0x2, 0xF, 0x271 }, - { 0x1, 0x18, 0x15, 0x6, 0x2, 0xF, 0x27F } +static void PrintStrbufToWindow(PokemonSummaryScreen *summaryScreen, Window *window, TextColor color, enum SummaryTextAlignment alignment); +static void PrintTextToStaticWindow(PokemonSummaryScreen *summaryScreen, enum SummaryStaticWindow windowIndex, u32 entryID, TextColor color, enum SummaryTextAlignment alignment); +static void PrintStaticWindows(PokemonSummaryScreen *summaryScreen); +static void PrintMoveNameAndPP(PokemonSummaryScreen *summaryScreen, u32 moveIndex); +static void DrawInfoPageWindows(PokemonSummaryScreen *summaryScreen); +static void DrawMemoPageWindows(PokemonSummaryScreen *summaryScreen); +static void DrawSkillsPageWindows(PokemonSummaryScreen *summaryScreen); +static void DrawConditionPageWindows(PokemonSummaryScreen *summaryScreen); +static void DrawBattleMovesPageWindows(PokemonSummaryScreen *summaryScreen); +static void DrawContestMovesPageWindows(PokemonSummaryScreen *summaryScreen); +static void DrawRibbonsPageWindows(PokemonSummaryScreen *summaryScreen); +static void DrawExitPageWindows(PokemonSummaryScreen *summaryScreen); + +static const WindowTemplate sStaticWindowTemplates[] = { + [SUMMARY_WINDOW_LABEL_INFO] = { + .bgLayer = BG_LAYER_MAIN_1, + .tilemapLeft = 1, + .tilemapTop = 0, + .width = 13, + .height = 2, + .palette = 15, + .baseTile = 0x1, + }, + [SUMMARY_WINDOW_LABEL_MEMO] = { + .bgLayer = BG_LAYER_MAIN_1, + .tilemapLeft = 1, + .tilemapTop = 0, + .width = 11, + .height = 2, + .palette = 15, + .baseTile = 0x1B, + }, + [SUMMARY_WINDOW_LABEL_SKILLS] = { + .bgLayer = BG_LAYER_MAIN_1, + .tilemapLeft = 1, + .tilemapTop = 0, + .width = 14, + .height = 2, + .palette = 15, + .baseTile = 0x31, + }, + [SUMMARY_WINDOW_LABEL_CONDITION] = { + .bgLayer = BG_LAYER_MAIN_1, + .tilemapLeft = 1, + .tilemapTop = 0, + .width = 11, + .height = 2, + .palette = 15, + .baseTile = 0x4D, + }, + [SUMMARY_WINDOW_LABEL_BATTLE_MOVES] = { + .bgLayer = BG_LAYER_MAIN_1, + .tilemapLeft = 1, + .tilemapTop = 0, + .width = 9, + .height = 2, + .palette = 15, + .baseTile = 0x63, + }, + [SUMMARY_WINDOW_LABEL_CONTEST_MOVES] = { + .bgLayer = BG_LAYER_MAIN_1, + .tilemapLeft = 1, + .tilemapTop = 0, + .width = 11, + .height = 2, + .palette = 15, + .baseTile = 0x75, + }, + [SUMMARY_WINDOW_LABEL_ITEM] = { + .bgLayer = BG_LAYER_MAIN_1, + .tilemapLeft = 1, + .tilemapTop = 20, + .width = 6, + .height = 2, + .palette = 15, + .baseTile = 0x8B, + }, + [SUMMARY_WINDOW_LABEL_DEX_NUM] = { + .bgLayer = BG_LAYER_MAIN_1, + .tilemapLeft = 14, + .tilemapTop = 5, + .width = 9, + .height = 2, + .palette = 15, + .baseTile = 0x97, + }, + [SUMMARY_WINDOW_LABEL_SPECIES_NAME] = { + .bgLayer = BG_LAYER_MAIN_1, + .tilemapLeft = 14, + .tilemapTop = 7, + .width = 5, + .height = 2, + .palette = 15, + .baseTile = 0xA9, + }, + [SUMMARY_WINDOW_LABEL_TYPE] = { + .bgLayer = BG_LAYER_MAIN_1, + .tilemapLeft = 14, + .tilemapTop = 9, + .width = 5, + .height = 2, + .palette = 15, + .baseTile = 0xB3, + }, + [SUMMARY_WINDOW_LABEL_OT_NAME] = { + .bgLayer = BG_LAYER_MAIN_1, + .tilemapLeft = 14, + .tilemapTop = 11, + .width = 5, + .height = 2, + .palette = 15, + .baseTile = 0xBD, + }, + [SUMMARY_WINDOW_LABEL_OT_ID] = { + .bgLayer = BG_LAYER_MAIN_1, + .tilemapLeft = 14, + .tilemapTop = 13, + .width = 5, + .height = 2, + .palette = 15, + .baseTile = 0xC7, + }, + [SUMMARY_WINDOW_LABEL_EXP] = { + .bgLayer = BG_LAYER_MAIN_1, + .tilemapLeft = 14, + .tilemapTop = 15, + .width = 15, + .height = 2, + .palette = 15, + .baseTile = 0xD1, + }, + [SUMMARY_WINDOW_LABEL_EXP_NEXT_LV] = { + .bgLayer = BG_LAYER_MAIN_1, + .tilemapLeft = 14, + .tilemapTop = 19, + .width = 12, + .height = 2, + .palette = 15, + .baseTile = 0xEF, + }, + [SUMMARY_WINDOW_DUMMY_14] = { + .bgLayer = BG_LAYER_MAIN_1, + .tilemapLeft = 19, + .tilemapTop = 21, + .width = 3, + .height = 2, + .palette = 15, + .baseTile = 0x107, + }, + [SUMMARY_WINDOW_LABEL_HP] = { + .bgLayer = BG_LAYER_MAIN_1, + .tilemapLeft = 18, + .tilemapTop = 4, + .width = 2, + .height = 2, + .palette = 15, + .baseTile = 0x10D, + }, + [SUMMARY_WINDOW_LABEL_ATTACK] = { + .bgLayer = BG_LAYER_MAIN_1, + .tilemapLeft = 16, + .tilemapTop = 7, + .width = 6, + .height = 2, + .palette = 15, + .baseTile = 0x111, + }, + [SUMMARY_WINDOW_LABEL_DEFENSE] = { + .bgLayer = BG_LAYER_MAIN_1, + .tilemapLeft = 16, + .tilemapTop = 9, + .width = 6, + .height = 2, + .palette = 15, + .baseTile = 0x11D, + }, + [SUMMARY_WINDOW_LABEL_SP_ATTACK] = { + .bgLayer = BG_LAYER_MAIN_1, + .tilemapLeft = 16, + .tilemapTop = 11, + .width = 6, + .height = 2, + .palette = 15, + .baseTile = 0x129, + }, + [SUMMARY_WINDOW_LABEL_SP_DEFENSE] = { + .bgLayer = BG_LAYER_MAIN_1, + .tilemapLeft = 16, + .tilemapTop = 13, + .width = 6, + .height = 2, + .palette = 15, + .baseTile = 0x135, + }, + [SUMMARY_WINDOW_LABEL_SPEED] = { + .bgLayer = BG_LAYER_MAIN_1, + .tilemapLeft = 16, + .tilemapTop = 15, + .width = 6, + .height = 2, + .palette = 15, + .baseTile = 0x141, + }, + [SUMMARY_WINDOW_LABEL_ABILITY] = { + .bgLayer = BG_LAYER_MAIN_1, + .tilemapLeft = 14, + .tilemapTop = 18, + .width = 6, + .height = 2, + .palette = 15, + .baseTile = 0x14D, + }, + [SUMMARY_WINDOW_LABEL_SHEEN] = { + .bgLayer = BG_LAYER_MAIN_1, + .tilemapLeft = 14, + .tilemapTop = 20, + .width = 5, + .height = 2, + .palette = 15, + .baseTile = 0x159, + }, + [SUMMARY_WINDOW_DUMMY_23] = { + .bgLayer = BG_LAYER_MAIN_1, + .tilemapLeft = 1, + .tilemapTop = 22, + .width = 6, + .height = 2, + .palette = 15, + .baseTile = 0x163, + }, + [SUMMARY_WINDOW_LABEL_MOVE_CANCEL] = { + .bgLayer = BG_LAYER_MAIN_1, + .tilemapLeft = 21, + .tilemapTop = 20, + .width = 5, + .height = 2, + .palette = 15, + .baseTile = 0x16F, + }, + [SUMMARY_WINDOW_LABEL_MOVE_CATEGORY] = { + .bgLayer = BG_LAYER_MAIN_1, + .tilemapLeft = 1, + .tilemapTop = 8, + .width = 6, + .height = 2, + .palette = 15, + .baseTile = 0x179, + }, + [SUMMARY_WINDOW_LABEL_MOVE_POWER] = { + .bgLayer = BG_LAYER_MAIN_1, + .tilemapLeft = 1, + .tilemapTop = 10, + .width = 6, + .height = 2, + .palette = 15, + .baseTile = 0x185, + }, + [SUMMARY_WINDOW_LABEL_MOVE_ACCURACY] = { + .bgLayer = BG_LAYER_MAIN_1, + .tilemapLeft = 1, + .tilemapTop = 12, + .width = 8, + .height = 2, + .palette = 15, + .baseTile = 0x191, + }, + [SUMMARY_WINDOW_LABEL_CLOSE_WINDOW] = { + .bgLayer = BG_LAYER_MAIN_1, + .tilemapLeft = 18, + .tilemapTop = 11, + .width = 9, + .height = 2, + .palette = 15, + .baseTile = 0x1A1, + }, + [SUMMARY_WINDOW_LABEL_APPEAL_POINTS] = { + .bgLayer = BG_LAYER_MAIN_1, + .tilemapLeft = 2, + .tilemapTop = 13, + .width = 12, + .height = 2, + .palette = 15, + .baseTile = 0x1B3, + }, + [SUMMARY_WINDOW_LABEL_RIBBON_COUNT] = { + .bgLayer = BG_LAYER_MAIN_1, + .tilemapLeft = 14, + .tilemapTop = 21, + .width = 12, + .height = 2, + .palette = 15, + .baseTile = 0x1CB, + }, + [SUMMARY_WINDOW_LABEL_RIBBONS] = { + .bgLayer = BG_LAYER_MAIN_1, + .tilemapLeft = 1, + .tilemapTop = 0, + .width = 11, + .height = 2, + .palette = 15, + .baseTile = 0x1E3, + }, + [SUMMARY_WINDOW_ITEM_NAME] = { + .bgLayer = BG_LAYER_MAIN_1, + .tilemapLeft = 1, + .tilemapTop = 22, + .width = 12, + .height = 2, + .palette = 15, + .baseTile = 0x1F9, + }, + [SUMMARY_WINDOW_MON_LEVEL] = { + .bgLayer = BG_LAYER_MAIN_1, + .tilemapLeft = 1, + .tilemapTop = 5, + .width = 6, + .height = 2, + .palette = 15, + .baseTile = 0x211, + }, + [SUMMARY_WINDOW_MON_NICKNAME_GENDER] = { + .bgLayer = BG_LAYER_MAIN_1, + .tilemapLeft = 3, + .tilemapTop = 3, + .width = 9, + .height = 2, + .palette = 15, + .baseTile = 0x21D, + }, + [SUMMARY_WINDOW_BUTTON_PROMPT] = { + .bgLayer = BG_LAYER_MAIN_1, + .tilemapLeft = 26, + .tilemapTop = 0, + .width = 6, + .height = 2, + .palette = 15, + .baseTile = 0x22F, + }, }; -static const WindowTemplate Unk_020F4DB0[] = { - { 0x1, 0xE, 0x5, 0x11, 0x12, 0xF, 0x23B } +static const WindowTemplate sExtraWindowTemplates_Info[] = { + [SUMMARY_WINDOW_DEX_NUM] = { + .bgLayer = BG_LAYER_MAIN_1, + .tilemapLeft = 24, + .tilemapTop = 5, + .width = 6, + .height = 2, + .palette = 15, + .baseTile = 0x23B, + }, + [SUMMARY_WINDOW_SPECIES_NAME] = { + .bgLayer = BG_LAYER_MAIN_1, + .tilemapLeft = 23, + .tilemapTop = 7, + .width = 8, + .height = 2, + .palette = 15, + .baseTile = 0x247, + }, + [SUMMARY_WINDOW_OT_NAME] = { + .bgLayer = BG_LAYER_MAIN_1, + .tilemapLeft = 23, + .tilemapTop = 11, + .width = 8, + .height = 2, + .palette = 15, + .baseTile = 0x257, + }, + [SUMMARY_WINDOW_OT_ID] = { + .bgLayer = BG_LAYER_MAIN_1, + .tilemapLeft = 25, + .tilemapTop = 13, + .width = 4, + .height = 2, + .palette = 15, + .baseTile = 0x267, + }, + [SUMMARY_WINDOW_EXP] = { + .bgLayer = BG_LAYER_MAIN_1, + .tilemapLeft = 24, + .tilemapTop = 17, + .width = 6, + .height = 2, + .palette = 15, + .baseTile = 0x271, + }, + [SUMMARY_WINDOW_EXP_NEXT_LV] = { + .bgLayer = BG_LAYER_MAIN_1, + .tilemapLeft = 24, + .tilemapTop = 21, + .width = 6, + .height = 2, + .palette = 15, + .baseTile = 0x27F, + }, }; -static const WindowTemplate Unk_020F4E50[] = { - { 0x1, 0x17, 0x4, 0x7, 0x2, 0xF, 0x23B }, - { 0x1, 0x19, 0x7, 0x3, 0x2, 0xF, 0x249 }, - { 0x1, 0x19, 0x9, 0x3, 0x2, 0xF, 0x24F }, - { 0x1, 0x19, 0xB, 0x3, 0x2, 0xF, 0x255 }, - { 0x1, 0x19, 0xD, 0x3, 0x2, 0xF, 0x25B }, - { 0x1, 0x19, 0xF, 0x3, 0x2, 0xF, 0x261 }, - { 0x1, 0x15, 0x12, 0xB, 0x2, 0xF, 0x267 }, - { 0x1, 0xE, 0x14, 0x12, 0x4, 0xF, 0x27D } +static const WindowTemplate sExtraWindowTemplates_Memo[] = { + [SUMMARY_WINDOW_MEMO] = { + .bgLayer = BG_LAYER_MAIN_1, + .tilemapLeft = 14, + .tilemapTop = 5, + .width = 17, + .height = 18, + .palette = 15, + .baseTile = 0x23B, + }, }; -static const WindowTemplate Unk_020F4E90[] = { - { 0x1, 0x15, 0x4, 0xB, 0x4, 0xF, 0x23B }, - { 0x1, 0x15, 0x8, 0xB, 0x4, 0xF, 0x267 }, - { 0x1, 0x15, 0xC, 0xB, 0x4, 0xF, 0x293 }, - { 0x1, 0x15, 0x10, 0xB, 0x4, 0xF, 0x2BF }, - { 0x1, 0x15, 0x14, 0xB, 0x4, 0xF, 0x2EB }, - { 0x1, 0xC, 0xA, 0x3, 0x2, 0xF, 0x317 }, - { 0x1, 0xC, 0xC, 0x3, 0x2, 0xF, 0x31D }, - { 0x1, 0x1, 0xE, 0xF, 0xA, 0xF, 0x323 } +static const WindowTemplate sExtraWindowTemplates_Skills[] = { + [SUMMARY_WINDOW_HP] = { + .bgLayer = BG_LAYER_MAIN_1, + .tilemapLeft = 23, + .tilemapTop = 4, + .width = 7, + .height = 2, + .palette = 15, + .baseTile = 0x23B, + }, + [SUMMARY_WINDOW_ATTACK] = { + .bgLayer = BG_LAYER_MAIN_1, + .tilemapLeft = 25, + .tilemapTop = 7, + .width = 3, + .height = 2, + .palette = 15, + .baseTile = 0x249, + }, + [SUMMARY_WINDOW_DEFENSE] = { + .bgLayer = BG_LAYER_MAIN_1, + .tilemapLeft = 25, + .tilemapTop = 9, + .width = 3, + .height = 2, + .palette = 15, + .baseTile = 0x24F, + }, + [SUMMARY_WINDOW_SP_ATTACK] = { + .bgLayer = BG_LAYER_MAIN_1, + .tilemapLeft = 25, + .tilemapTop = 11, + .width = 3, + .height = 2, + .palette = 15, + .baseTile = 0x255, + }, + [SUMMARY_WINDOW_SP_DEFENSE] = { + .bgLayer = BG_LAYER_MAIN_1, + .tilemapLeft = 25, + .tilemapTop = 13, + .width = 3, + .height = 2, + .palette = 15, + .baseTile = 0x25B, + }, + [SUMMARY_WINDOW_SPEED] = { + .bgLayer = BG_LAYER_MAIN_1, + .tilemapLeft = 25, + .tilemapTop = 15, + .width = 3, + .height = 2, + .palette = 15, + .baseTile = 0x261, + }, + [SUMMARY_WINDOW_ABILITY] = { + .bgLayer = BG_LAYER_MAIN_1, + .tilemapLeft = 21, + .tilemapTop = 18, + .width = 11, + .height = 2, + .palette = 15, + .baseTile = 0x267, + }, + [SUMMARY_WINDOW_ABILITY_DESCRIPTION] = { + .bgLayer = BG_LAYER_MAIN_1, + .tilemapLeft = 14, + .tilemapTop = 20, + .width = 18, + .height = 4, + .palette = 15, + .baseTile = 0x27D, + }, }; -static const WindowTemplate Unk_020F4DF0[] = { - { 0x1, 0x15, 0x4, 0xB, 0x4, 0xF, 0x23B }, - { 0x1, 0x15, 0x8, 0xB, 0x4, 0xF, 0x267 }, - { 0x1, 0x15, 0xC, 0xB, 0x4, 0xF, 0x293 }, - { 0x1, 0x15, 0x10, 0xB, 0x4, 0xF, 0x2BF }, - { 0x1, 0x15, 0x14, 0xB, 0x4, 0xF, 0x2EB }, - { 0x1, 0x1, 0x12, 0xF, 0x6, 0xF, 0x317 } +static const WindowTemplate sExtraWindowTemplates_BattleMoves[] = { + [SUMMARY_WINDOW_BATTLE_MOVE_1] = { + .bgLayer = BG_LAYER_MAIN_1, + .tilemapLeft = 21, + .tilemapTop = 4, + .width = 11, + .height = 4, + .palette = 15, + .baseTile = 0x23B, + }, + [SUMMARY_WINDOW_BATTLE_MOVE_2] = { + .bgLayer = BG_LAYER_MAIN_1, + .tilemapLeft = 21, + .tilemapTop = 8, + .width = 11, + .height = 4, + .palette = 15, + .baseTile = 0x267, + }, + [SUMMARY_WINDOW_BATTLE_MOVE_3] = { + .bgLayer = BG_LAYER_MAIN_1, + .tilemapLeft = 21, + .tilemapTop = 12, + .width = 11, + .height = 4, + .palette = 15, + .baseTile = 0x293, + }, + [SUMMARY_WINDOW_BATTLE_MOVE_4] = { + .bgLayer = BG_LAYER_MAIN_1, + .tilemapLeft = 21, + .tilemapTop = 16, + .width = 11, + .height = 4, + .palette = 15, + .baseTile = 0x2BF, + }, + [SUMMARY_WINDOW_BATTLE_MOVE_5] = { + .bgLayer = BG_LAYER_MAIN_1, + .tilemapLeft = 21, + .tilemapTop = 20, + .width = 11, + .height = 4, + .palette = 15, + .baseTile = 0x2EB, + }, + [SUMMARY_WINDOW_BATTLE_MOVE_POWER] = { + .bgLayer = BG_LAYER_MAIN_1, + .tilemapLeft = 12, + .tilemapTop = 10, + .width = 3, + .height = 2, + .palette = 15, + .baseTile = 0x317, + }, + [SUMMARY_WINDOW_BATTLE_MOVE_ACCURACY] = { + .bgLayer = BG_LAYER_MAIN_1, + .tilemapLeft = 12, + .tilemapTop = 12, + .width = 3, + .height = 2, + .palette = 15, + .baseTile = 0x31D, + }, + [SUMMARY_WINDOW_BATTLE_MOVE_DESCRIPTION] = { + .bgLayer = BG_LAYER_MAIN_1, + .tilemapLeft = 1, + .tilemapTop = 14, + .width = 15, + .height = 10, + .palette = 15, + .baseTile = 0x323, + }, }; -static const WindowTemplate Unk_020F4DD0[] = { - { 0x1, 0x1A, 0x15, 0x5, 0x2, 0xF, 0x23B }, - { 0x1, 0x18, 0xF, 0x7, 0x2, 0xF, 0x245 }, - { 0x1, 0x1, 0x12, 0x15, 0x2, 0xF, 0x253 }, - { 0x1, 0x1, 0x14, 0x1E, 0x4, 0xF, 0x27D } +static const WindowTemplate sExtraWindowTemplates_ContestMoves[] = { + [SUMMARY_WINDOW_CONTEST_MOVE_1] = { + .bgLayer = BG_LAYER_MAIN_1, + .tilemapLeft = 21, + .tilemapTop = 4, + .width = 11, + .height = 4, + .palette = 15, + .baseTile = 0x23B, + }, + [SUMMARY_WINDOW_CONTEST_MOVE_2] = { + .bgLayer = BG_LAYER_MAIN_1, + .tilemapLeft = 21, + .tilemapTop = 8, + .width = 11, + .height = 4, + .palette = 15, + .baseTile = 0x267, + }, + [SUMMARY_WINDOW_CONTEST_MOVE_3] = { + .bgLayer = BG_LAYER_MAIN_1, + .tilemapLeft = 21, + .tilemapTop = 12, + .width = 11, + .height = 4, + .palette = 15, + .baseTile = 0x293, + }, + [SUMMARY_WINDOW_CONTEST_MOVE_4] = { + .bgLayer = BG_LAYER_MAIN_1, + .tilemapLeft = 21, + .tilemapTop = 16, + .width = 11, + .height = 4, + .palette = 15, + .baseTile = 0x2BF, + }, + [SUMMARY_WINDOW_CONTEST_MOVE_5] = { + .bgLayer = BG_LAYER_MAIN_1, + .tilemapLeft = 21, + .tilemapTop = 20, + .width = 11, + .height = 4, + .palette = 15, + .baseTile = 0x2EB, + }, + [SUMMARY_WINDOW_CONTEST_MOVE_DESCRIPTION] = { + .bgLayer = BG_LAYER_MAIN_1, + .tilemapLeft = 1, + .tilemapTop = 18, + .width = 15, + .height = 6, + .palette = 15, + .baseTile = 0x317, + }, }; -static const WindowTemplate Unk_020F4DB8[] = { - { 0x1, 0x1A, 0x0, 0x5, 0x2, 0xF, 0x23B }, - { 0x1, 0x1, 0x14, 0xC, 0x4, 0xF, 0x24D }, - { 0x1, 0x2, 0x15, 0x1B, 0x2, 0xE, 0x27D } +static const WindowTemplate sExtraWindowTemplates_Ribbons[] = { + [SUMMARY_WINDOW_RIBBON_COUNT] = { + .bgLayer = BG_LAYER_MAIN_1, + .tilemapLeft = 26, + .tilemapTop = 21, + .width = 5, + .height = 2, + .palette = 15, + .baseTile = 0x23B, + }, + [SUMMARY_WINDOW_RIBBON_INDEX] = { + .bgLayer = BG_LAYER_MAIN_1, + .tilemapLeft = 24, + .tilemapTop = 15, + .width = 7, + .height = 2, + .palette = 15, + .baseTile = 0x245, + }, + [SUMMARY_WINDOW_RIBBON_NAME] = { + .bgLayer = BG_LAYER_MAIN_1, + .tilemapLeft = 1, + .tilemapTop = 18, + .width = 21, + .height = 2, + .palette = 15, + .baseTile = 0x253, + }, + [SUMMARY_WINDOW_RIBBON_DESCRIPTION] = { + .bgLayer = BG_LAYER_MAIN_1, + .tilemapLeft = 1, + .tilemapTop = 20, + .width = 30, + .height = 4, + .palette = 15, + .baseTile = 0x27D, + }, }; -void sub_0208FCF8(PokemonSummaryScreen *param0) -{ - u16 v0; +static const WindowTemplate sExtraWindowTemplates_Condition[] = { + [SUMMARY_WINDOW_POFFIN_BUTTON_PROMPT] = { + .bgLayer = BG_LAYER_MAIN_1, + .tilemapLeft = 26, + .tilemapTop = 0, + .width = 5, + .height = 2, + .palette = 15, + .baseTile = 0x23B, + }, + [SUMMARY_WINDOW_FAVORITE_FOOD] = { + .bgLayer = BG_LAYER_MAIN_1, + .tilemapLeft = 1, + .tilemapTop = 20, + .width = 12, + .height = 4, + .palette = 15, + .baseTile = 0x24D, + }, + [SUMMARY_WINDOW_POFFIN_FEED_MSG] = { + .bgLayer = BG_LAYER_MAIN_1, + .tilemapLeft = 2, + .tilemapTop = 21, + .width = 27, + .height = 2, + .palette = 14, + .baseTile = 0x27D, + }, +}; - for (v0 = 0; v0 < 36; v0++) { - Window_AddFromTemplate(param0->bgConfig, ¶m0->staticWindows[v0], &sPSSStaticWindowTemplates[v0]); - Window_FillTilemap(¶m0->staticWindows[v0], 0); +void PokemonSummaryScreen_DrawStaticWindows(PokemonSummaryScreen *summaryScreen) +{ + for (u16 window = 0; window < SUMMARY_STATIC_WINDOW_MAX; window++) { + Window_AddFromTemplate(summaryScreen->bgConfig, &summaryScreen->staticWindows[window], &sStaticWindowTemplates[window]); + Window_FillTilemap(&summaryScreen->staticWindows[window], 0); } - sub_020902B0(param0); - sub_0208FEA4(param0); - sub_0208FF3C(param0); - sub_0208FFE0(param0); + PrintStaticWindows(summaryScreen); + PokemonSummaryScreen_PrintNicknameAndGender(summaryScreen); + PokemonSummaryScreen_PrintLevel(summaryScreen); + PokemonSummaryScreen_PrintItemName(summaryScreen); } -void sub_0208FD40(PokemonSummaryScreen *param0) +void PokemonSummaryScreen_AddExtraWindows(PokemonSummaryScreen *summaryScreen) { - const WindowTemplate *v0; - u32 v1; + const WindowTemplate *extraWindows; - switch (param0->page) { - case 0: - v0 = Unk_020F4E20; - param0->numExtraWindows = 6; + switch (summaryScreen->page) { + case SUMMARY_PAGE_INFO: + extraWindows = sExtraWindowTemplates_Info; + summaryScreen->numExtraWindows = SUMMARY_INFO_WINDOW_MAX; break; - case 1: - v0 = Unk_020F4DB0; - param0->numExtraWindows = 1; + case SUMMARY_PAGE_MEMO: + extraWindows = sExtraWindowTemplates_Memo; + summaryScreen->numExtraWindows = SUMMARY_MEMO_WINDOW_MAX; break; - case 2: - v0 = Unk_020F4E50; - param0->numExtraWindows = 8; + case SUMMARY_PAGE_SKILLS: + extraWindows = sExtraWindowTemplates_Skills; + summaryScreen->numExtraWindows = SUMMARY_SKILLS_WINDOW_MAX; break; - case 3: - v0 = Unk_020F4E90; - param0->numExtraWindows = 8; + case SUMMARY_PAGE_BATTLE_MOVES: + extraWindows = sExtraWindowTemplates_BattleMoves; + summaryScreen->numExtraWindows = SUMMARY_BATTLE_MOVES_WINDOW_MAX; break; - case 5: - v0 = Unk_020F4DF0; - param0->numExtraWindows = 6; + case SUMMARY_PAGE_CONTEST_MOVES: + extraWindows = sExtraWindowTemplates_ContestMoves; + summaryScreen->numExtraWindows = SUMMARY_CONTEST_MOVES_WINDOW_MAX; break; - case 6: - v0 = Unk_020F4DD0; - param0->numExtraWindows = 4; + case SUMMARY_PAGE_RIBBONS: + extraWindows = sExtraWindowTemplates_Ribbons; + summaryScreen->numExtraWindows = SUMMARY_RIBBONS_WINDOW_MAX; break; - case 4: - case 7: - if ((param0->data->mode != 3) && (param0->data->mode != 4)) { + case SUMMARY_PAGE_CONDITION: + case SUMMARY_PAGE_EXIT: + // the exit page shows the "favorite food" condition extra window when feeding poffins + if (summaryScreen->data->mode != SUMMARY_MODE_POFFIN && summaryScreen->data->mode != SUMMARY_MODE_CONDITION) { return; } - v0 = Unk_020F4DB8; - param0->numExtraWindows = 3; + extraWindows = sExtraWindowTemplates_Condition; + summaryScreen->numExtraWindows = SUMMARY_CONDITION_WINDOW_MAX; break; default: return; } - param0->extraWindows = Window_New(19, param0->numExtraWindows); + summaryScreen->extraWindows = Window_New(HEAP_ID_POKEMON_SUMMARY_SCREEN, summaryScreen->numExtraWindows); - for (v1 = 0; v1 < param0->numExtraWindows; v1++) { - Window_AddFromTemplate(param0->bgConfig, ¶m0->extraWindows[v1], &v0[v1]); + for (u32 i = 0; i < summaryScreen->numExtraWindows; i++) { + Window_AddFromTemplate(summaryScreen->bgConfig, &summaryScreen->extraWindows[i], &extraWindows[i]); } } void PokemonSummaryScreen_RemoveExtraWindows(PokemonSummaryScreen *summaryScreen) { switch (summaryScreen->page) { - case PSS_PAGE_INFO: - case PSS_PAGE_MEMO: - case PSS_PAGE_SKILLS: - case PSS_PAGE_BATTLE_MOVES: - case PSS_PAGE_CONTEST_MOVES: - case PSS_PAGE_RIBBONS: + case SUMMARY_PAGE_INFO: + case SUMMARY_PAGE_MEMO: + case SUMMARY_PAGE_SKILLS: + case SUMMARY_PAGE_BATTLE_MOVES: + case SUMMARY_PAGE_CONTEST_MOVES: + case SUMMARY_PAGE_RIBBONS: break; - case PSS_PAGE_CONDITION: - case PSS_PAGE_EXIT: - if (summaryScreen->data->mode != PSS_MODE_POFFIN && summaryScreen->data->mode != PSS_MODE_CONDITION) { + case SUMMARY_PAGE_CONDITION: + case SUMMARY_PAGE_EXIT: + // the exit page shows the "favorite food" condition extra window when feeding poffins + if (summaryScreen->data->mode != SUMMARY_MODE_POFFIN && summaryScreen->data->mode != SUMMARY_MODE_CONDITION) { return; } break; @@ -227,107 +812,103 @@ void PokemonSummaryScreen_RemoveWindows(PokemonSummaryScreen *summaryScreen) { PokemonSummaryScreen_RemoveExtraWindows(summaryScreen); - for (u32 i = 0; i < PSS_STATIC_WINDOW_MAX; i++) { + for (u32 i = 0; i < SUMMARY_STATIC_WINDOW_MAX; i++) { Window_Remove(&summaryScreen->staticWindows[i]); } } -void sub_0208FEA4(PokemonSummaryScreen *param0) +void PokemonSummaryScreen_PrintNicknameAndGender(PokemonSummaryScreen *summaryScreen) { - Window *v0; - u32 v1; - - v0 = ¶m0->staticWindows[34]; - - Window_FillTilemap(v0, 0); - Text_AddPrinterWithParamsAndColor(v0, FONT_SYSTEM, param0->monData.nickname, 0, 0, TEXT_SPEED_NO_TRANSFER, TEXT_COLOR(15, 14, 0), NULL); + Window *window = &summaryScreen->staticWindows[SUMMARY_WINDOW_MON_NICKNAME_GENDER]; - if (param0->monData.showGender == 0) { - if (param0->monData.gender == 0) { - MessageLoader_GetStrbuf(param0->msgLoader, 1, param0->strbuf); - PrintTextToWindow(param0, v0, TEXT_COLOR(3, 4, 0), PSS_ALIGNMENT_RIGHT); - } else if (param0->monData.gender == 1) { - MessageLoader_GetStrbuf(param0->msgLoader, 2, param0->strbuf); - PrintTextToWindow(param0, v0, TEXT_COLOR(5, 6, 0), PSS_ALIGNMENT_RIGHT); + Window_FillTilemap(window, 0); + Text_AddPrinterWithParamsAndColor(window, FONT_SYSTEM, summaryScreen->monData.nickname, 0, 0, TEXT_SPEED_NO_TRANSFER, SUMMARY_TEXT_WHITE, NULL); + + if (summaryScreen->monData.hideGender == FALSE) { + if (summaryScreen->monData.gender == GENDER_MALE) { + MessageLoader_GetStrbuf(summaryScreen->msgLoader, summary_male_symbol, summaryScreen->strbuf); + PrintStrbufToWindow(summaryScreen, window, SUMMARY_TEXT_BLUE, ALIGN_RIGHT); + } else if (summaryScreen->monData.gender == GENDER_FEMALE) { + MessageLoader_GetStrbuf(summaryScreen->msgLoader, summary_female_symbol, summaryScreen->strbuf); + PrintStrbufToWindow(summaryScreen, window, SUMMARY_TEXT_RED, ALIGN_RIGHT); } } - Window_ScheduleCopyToVRAM(v0); + Window_ScheduleCopyToVRAM(window); } -void sub_0208FF3C(PokemonSummaryScreen *param0) +void PokemonSummaryScreen_PrintLevel(PokemonSummaryScreen *summaryScreen) { - Window *v0; - Strbuf *v1; - - v0 = ¶m0->staticWindows[33]; - - Window_FillTilemap(v0, 0); + Window *window = &summaryScreen->staticWindows[SUMMARY_WINDOW_MON_LEVEL]; + Window_FillTilemap(window, 0); - if (param0->monData.isEgg == 0) { - sub_0200C578(param0->unk_684, 1, v0, 0, 5); + Strbuf *buf; + if (summaryScreen->monData.isEgg == FALSE) { + sub_0200C578(summaryScreen->unk_684, 1, window, 0, 5); - v1 = MessageLoader_GetNewStrbuf(param0->msgLoader, 3); + buf = MessageLoader_GetNewStrbuf(summaryScreen->msgLoader, summary_template_mon_level); - StringTemplate_SetNumber(param0->strFormatter, 0, param0->monData.level, 3, 0, 1); - StringTemplate_Format(param0->strFormatter, param0->strbuf, v1); - Strbuf_Free(v1); - Text_AddPrinterWithParamsAndColor(v0, FONT_SYSTEM, param0->strbuf, 16, 0, TEXT_SPEED_NO_TRANSFER, TEXT_COLOR(1, 2, 0), NULL); + StringTemplate_SetNumber(summaryScreen->strFormatter, 0, summaryScreen->monData.level, 3, PADDING_MODE_NONE, CHARSET_MODE_EN); + StringTemplate_Format(summaryScreen->strFormatter, summaryScreen->strbuf, buf); + Strbuf_Free(buf); + Text_AddPrinterWithParamsAndColor(window, FONT_SYSTEM, summaryScreen->strbuf, 16, 0, TEXT_SPEED_NO_TRANSFER, SUMMARY_TEXT_BLACK, NULL); } - Window_ScheduleCopyToVRAM(v0); + Window_ScheduleCopyToVRAM(window); } -void sub_0208FFE0(PokemonSummaryScreen *param0) +void PokemonSummaryScreen_PrintItemName(PokemonSummaryScreen *summaryScreen) { - Strbuf *v0; + Strbuf *buf; - Window_FillTilemap(¶m0->staticWindows[32], 0); + Window_FillTilemap(&summaryScreen->staticWindows[SUMMARY_WINDOW_ITEM_NAME], 0); - if (param0->monData.heldItem != 0) { - StringTemplate_SetItemName(param0->strFormatter, 0, param0->monData.heldItem); - v0 = MessageLoader_GetNewStrbuf(param0->msgLoader, 5); - StringTemplate_Format(param0->strFormatter, param0->strbuf, v0); - Strbuf_Free(v0); + if (summaryScreen->monData.heldItem != ITEM_NONE) { + StringTemplate_SetItemName(summaryScreen->strFormatter, 0, summaryScreen->monData.heldItem); + buf = MessageLoader_GetNewStrbuf(summaryScreen->msgLoader, summary_template_item_name); + StringTemplate_Format(summaryScreen->strFormatter, summaryScreen->strbuf, buf); + Strbuf_Free(buf); } else { - MessageLoader_GetStrbuf(param0->msgLoader, 6, param0->strbuf); + MessageLoader_GetStrbuf(summaryScreen->msgLoader, summary_none, summaryScreen->strbuf); } - PrintTextToWindow(param0, ¶m0->staticWindows[32], TEXT_COLOR(1, 2, 0), PSS_ALIGNMENT_LEFT); - Window_ScheduleCopyToVRAM(¶m0->staticWindows[6]); - Window_ScheduleCopyToVRAM(¶m0->staticWindows[32]); + PrintStrbufToWindow(summaryScreen, &summaryScreen->staticWindows[SUMMARY_WINDOW_ITEM_NAME], SUMMARY_TEXT_BLACK, ALIGN_LEFT); + Window_ScheduleCopyToVRAM(&summaryScreen->staticWindows[SUMMARY_WINDOW_LABEL_ITEM]); + Window_ScheduleCopyToVRAM(&summaryScreen->staticWindows[SUMMARY_WINDOW_ITEM_NAME]); } void PokemonSummaryScreen_ClearAndPrintButtonPrompt(PokemonSummaryScreen *summaryScreen, u32 entryID) { - Window_FillTilemap(&summaryScreen->staticWindows[PSS_WINDOW_BUTTON_PROMPT], 0); - sub_02090158(summaryScreen, 35, entryID, TEXT_COLOR(15, 14, 0), 0); - Window_ScheduleCopyToVRAM(&summaryScreen->staticWindows[PSS_WINDOW_BUTTON_PROMPT]); + Window_FillTilemap(&summaryScreen->staticWindows[SUMMARY_WINDOW_BUTTON_PROMPT], 0); + PrintTextToStaticWindow(summaryScreen, SUMMARY_WINDOW_BUTTON_PROMPT, entryID, SUMMARY_TEXT_WHITE, ALIGN_LEFT); + Window_ScheduleCopyToVRAM(&summaryScreen->staticWindows[SUMMARY_WINDOW_BUTTON_PROMPT]); } -static BOOL sub_02090098(PokemonSummaryScreen *param0) +static BOOL DoesMonOTMatchPlayer(PokemonSummaryScreen *summaryScreen) { - if ((param0->monData.OTID == param0->data->OTID) && (param0->monData.OTGender == param0->data->OTGender) && (Strbuf_Compare(param0->monData.OTName, param0->playerName) == 0)) { - return 1; + if (summaryScreen->monData.OTID == summaryScreen->data->OTID + && summaryScreen->monData.OTGender == summaryScreen->data->OTGender + && Strbuf_Compare(summaryScreen->monData.OTName, summaryScreen->playerName) == 0) { + return TRUE; } - return 0; + return FALSE; } -static void PrintTextToWindow(PokemonSummaryScreen *summaryScreen, Window *window, TextColor color, enum PSSTextAlignment alignment) +static void PrintStrbufToWindow(PokemonSummaryScreen *summaryScreen, Window *window, TextColor color, enum SummaryTextAlignment alignment) { u8 strWidth, windowWidth, xOffset; switch (alignment) { - case PSS_ALIGNMENT_LEFT: + case ALIGN_LEFT: xOffset = 0; break; - case PSS_ALIGNMENT_RIGHT: + case ALIGN_RIGHT: strWidth = Font_CalcStrbufWidth(FONT_SYSTEM, summaryScreen->strbuf, 0); windowWidth = Window_GetWidth(window) * 8; xOffset = windowWidth - strWidth; break; - case PSS_ALIGNMENT_CENTER: + case ALIGN_CENTER: strWidth = Font_CalcStrbufWidth(FONT_SYSTEM, summaryScreen->strbuf, 0); windowWidth = Window_GetWidth(window) * 8; xOffset = (windowWidth - strWidth) / 2; @@ -337,14 +918,10 @@ static void PrintTextToWindow(PokemonSummaryScreen *summaryScreen, Window *windo Text_AddPrinterWithParamsAndColor(window, FONT_SYSTEM, summaryScreen->strbuf, xOffset, 0, TEXT_SPEED_NO_TRANSFER, color, NULL); } -static void sub_02090158(PokemonSummaryScreen *param0, u32 param1, u32 entryID, TextColor param3, u32 param4) +static void PrintTextToStaticWindow(PokemonSummaryScreen *summaryScreen, enum SummaryStaticWindow windowIndex, u32 entryID, TextColor color, enum SummaryTextAlignment alignment) { - u8 v0; - u8 v1; - u8 v2; - - MessageLoader_GetStrbuf(param0->msgLoader, entryID, param0->strbuf); - PrintTextToWindow(param0, ¶m0->staticWindows[param1], param3, param4); + MessageLoader_GetStrbuf(summaryScreen->msgLoader, entryID, summaryScreen->strbuf); + PrintStrbufToWindow(summaryScreen, &summaryScreen->staticWindows[windowIndex], color, alignment); } static void SetAndFormatNumberBuf(PokemonSummaryScreen *summaryScreen, u32 entryID, u32 number, u8 digits, u8 paddingMode) @@ -355,412 +932,390 @@ static void SetAndFormatNumberBuf(PokemonSummaryScreen *summaryScreen, u32 entry Strbuf_Free(buf); } -static void PrintMovePPInfo(PokemonSummaryScreen *summaryScreen, u32 moveIndex, u32 slashEntryID, u32 curPPEntryID, u32 maxPPEntryID, u16 curPP, u16 maxPP, u8 digits, u8 xOffset, u8 yOffset) +static void PrintCurrentAndMaxInfo(PokemonSummaryScreen *summaryScreen, u32 moveIndex, u32 slashEntryID, u32 curEntryID, u32 maxEntryID, u16 curValue, u16 maxValue, u8 digits, u8 xOffset, u8 yOffset) { Window *window = &summaryScreen->extraWindows[moveIndex]; MessageLoader_GetStrbuf(summaryScreen->msgLoader, slashEntryID, summaryScreen->strbuf); u32 strWidth = Font_CalcStrbufWidth(FONT_SYSTEM, summaryScreen->strbuf, 0); - u16 curPPXOffset = xOffset - strWidth / 2; - u16 maxPPXOffset = curPPXOffset + strWidth; + u16 curXOffset = xOffset - strWidth / 2; + u16 maxXOffset = curXOffset + strWidth; - Text_AddPrinterWithParamsAndColor(window, FONT_SYSTEM, summaryScreen->strbuf, curPPXOffset, yOffset, TEXT_SPEED_NO_TRANSFER, TEXT_COLOR(1, 2, 0), NULL); - SetAndFormatNumberBuf(summaryScreen, curPPEntryID, curPP, digits, PADDING_MODE_NONE); + Text_AddPrinterWithParamsAndColor(window, FONT_SYSTEM, summaryScreen->strbuf, curXOffset, yOffset, TEXT_SPEED_NO_TRANSFER, SUMMARY_TEXT_BLACK, NULL); + SetAndFormatNumberBuf(summaryScreen, curEntryID, curValue, digits, PADDING_MODE_NONE); strWidth = Font_CalcStrbufWidth(FONT_SYSTEM, summaryScreen->strbuf, 0); - Text_AddPrinterWithParamsAndColor(window, FONT_SYSTEM, summaryScreen->strbuf, curPPXOffset - strWidth, yOffset, TEXT_SPEED_NO_TRANSFER, TEXT_COLOR(1, 2, 0), NULL); - SetAndFormatNumberBuf(summaryScreen, maxPPEntryID, maxPP, digits, PADDING_MODE_NONE); - Text_AddPrinterWithParamsAndColor(window, FONT_SYSTEM, summaryScreen->strbuf, maxPPXOffset, yOffset, TEXT_SPEED_NO_TRANSFER, TEXT_COLOR(1, 2, 0), NULL); -} - -static void sub_020902B0(PokemonSummaryScreen *param0) -{ - sub_02090158(param0, 0, 7, TEXT_COLOR(15, 14, 0), 0); - sub_02090158(param0, 1, 23, TEXT_COLOR(15, 14, 0), 0); - sub_02090158(param0, 2, 109, TEXT_COLOR(15, 14, 0), 0); - sub_02090158(param0, 3, 126, TEXT_COLOR(15, 14, 0), 0); - sub_02090158(param0, 4, 128, TEXT_COLOR(15, 14, 0), 0); - sub_02090158(param0, 5, 157, TEXT_COLOR(15, 14, 0), 0); - sub_02090158(param0, 6, 4, TEXT_COLOR(15, 14, 0), 0); - sub_02090158(param0, 7, 8, TEXT_COLOR(15, 14, 0), 0); - sub_02090158(param0, 8, 10, TEXT_COLOR(15, 14, 0), 0); - sub_02090158(param0, 9, 12, TEXT_COLOR(15, 14, 0), 0); - sub_02090158(param0, 10, 13, TEXT_COLOR(15, 14, 0), 0); - sub_02090158(param0, 11, 15, TEXT_COLOR(15, 14, 0), 0); - sub_02090158(param0, 12, 17, TEXT_COLOR(15, 14, 0), 0); - sub_02090158(param0, 13, 19, TEXT_COLOR(15, 14, 0), 0); - sub_02090158(param0, 15, 110, TEXT_COLOR(15, 14, 0), 0); - sub_02090158(param0, 16, 111, TEXT_COLOR(15, 14, 0), 0); - sub_02090158(param0, 17, 112, TEXT_COLOR(15, 14, 0), 0); - sub_02090158(param0, 18, 113, TEXT_COLOR(15, 14, 0), 0); - sub_02090158(param0, 19, 114, TEXT_COLOR(15, 14, 0), 0); - sub_02090158(param0, 20, 115, TEXT_COLOR(15, 14, 0), 0); - sub_02090158(param0, 21, 116, TEXT_COLOR(15, 14, 0), 0); - sub_02090158(param0, 22, 127, TEXT_COLOR(15, 14, 0), 0); - - { - MessageLoader_GetStrbuf(param0->msgLoader, 146, param0->strbuf); - Text_AddPrinterWithParamsAndColor(¶m0->staticWindows[24], FONT_SYSTEM, param0->strbuf, 0, 2, TEXT_SPEED_NO_TRANSFER, TEXT_COLOR(15, 14, 0), NULL); - } - - sub_02090158(param0, 25, 149, TEXT_COLOR(15, 14, 0), 0); - sub_02090158(param0, 26, 147, TEXT_COLOR(15, 14, 0), 0); - sub_02090158(param0, 27, 148, TEXT_COLOR(15, 14, 0), 0); - sub_02090158(param0, 28, 162, TEXT_COLOR(15, 14, 0), 2); - sub_02090158(param0, 29, 160, TEXT_COLOR(1, 2, 0), 2); - sub_02090158(param0, 30, 182, TEXT_COLOR(1, 2, 0), 0); - sub_02090158(param0, 31, 179, TEXT_COLOR(15, 14, 0), 0); -} - -void sub_020904C4(PokemonSummaryScreen *param0) -{ - Bg_FillTilemapRect(param0->bgConfig, 1, 0, 0, 0, 32, 2, 16); - Bg_FillTilemapRect(param0->bgConfig, 1, 0, 14, 2, 18, 22, 16); - - switch (param0->page) { - case 0: - sub_02090578(param0); + Text_AddPrinterWithParamsAndColor(window, FONT_SYSTEM, summaryScreen->strbuf, curXOffset - strWidth, yOffset, TEXT_SPEED_NO_TRANSFER, SUMMARY_TEXT_BLACK, NULL); + SetAndFormatNumberBuf(summaryScreen, maxEntryID, maxValue, digits, PADDING_MODE_NONE); + Text_AddPrinterWithParamsAndColor(window, FONT_SYSTEM, summaryScreen->strbuf, maxXOffset, yOffset, TEXT_SPEED_NO_TRANSFER, SUMMARY_TEXT_BLACK, NULL); +} + +static void PrintStaticWindows(PokemonSummaryScreen *summaryScreen) +{ + PrintTextToStaticWindow(summaryScreen, SUMMARY_WINDOW_LABEL_INFO, summary_page_title_info, SUMMARY_TEXT_WHITE, ALIGN_LEFT); + PrintTextToStaticWindow(summaryScreen, SUMMARY_WINDOW_LABEL_MEMO, summary_page_title_memo, SUMMARY_TEXT_WHITE, ALIGN_LEFT); + PrintTextToStaticWindow(summaryScreen, SUMMARY_WINDOW_LABEL_SKILLS, summary_page_title_skills, SUMMARY_TEXT_WHITE, ALIGN_LEFT); + PrintTextToStaticWindow(summaryScreen, SUMMARY_WINDOW_LABEL_CONDITION, summary_page_title_condition, SUMMARY_TEXT_WHITE, ALIGN_LEFT); + PrintTextToStaticWindow(summaryScreen, SUMMARY_WINDOW_LABEL_BATTLE_MOVES, summary_page_title_battle_moves, SUMMARY_TEXT_WHITE, ALIGN_LEFT); + PrintTextToStaticWindow(summaryScreen, SUMMARY_WINDOW_LABEL_CONTEST_MOVES, summary_page_title_contest_moves, SUMMARY_TEXT_WHITE, ALIGN_LEFT); + PrintTextToStaticWindow(summaryScreen, SUMMARY_WINDOW_LABEL_ITEM, summary_label_item, SUMMARY_TEXT_WHITE, ALIGN_LEFT); + PrintTextToStaticWindow(summaryScreen, SUMMARY_WINDOW_LABEL_DEX_NUM, summary_label_dex_num, SUMMARY_TEXT_WHITE, ALIGN_LEFT); + PrintTextToStaticWindow(summaryScreen, SUMMARY_WINDOW_LABEL_SPECIES_NAME, summary_label_species_name, SUMMARY_TEXT_WHITE, ALIGN_LEFT); + PrintTextToStaticWindow(summaryScreen, SUMMARY_WINDOW_LABEL_TYPE, summary_label_type, SUMMARY_TEXT_WHITE, ALIGN_LEFT); + PrintTextToStaticWindow(summaryScreen, SUMMARY_WINDOW_LABEL_OT_NAME, summary_label_ot_name, SUMMARY_TEXT_WHITE, ALIGN_LEFT); + PrintTextToStaticWindow(summaryScreen, SUMMARY_WINDOW_LABEL_OT_ID, summary_label_ot_id, SUMMARY_TEXT_WHITE, ALIGN_LEFT); + PrintTextToStaticWindow(summaryScreen, SUMMARY_WINDOW_LABEL_EXP, summary_label_exp, SUMMARY_TEXT_WHITE, ALIGN_LEFT); + PrintTextToStaticWindow(summaryScreen, SUMMARY_WINDOW_LABEL_EXP_NEXT_LV, summary_label_exp_next_lv, SUMMARY_TEXT_WHITE, ALIGN_LEFT); + PrintTextToStaticWindow(summaryScreen, SUMMARY_WINDOW_LABEL_HP, summary_label_hp, SUMMARY_TEXT_WHITE, ALIGN_LEFT); + PrintTextToStaticWindow(summaryScreen, SUMMARY_WINDOW_LABEL_ATTACK, summary_label_attack, SUMMARY_TEXT_WHITE, ALIGN_LEFT); + PrintTextToStaticWindow(summaryScreen, SUMMARY_WINDOW_LABEL_DEFENSE, summary_label_defense, SUMMARY_TEXT_WHITE, ALIGN_LEFT); + PrintTextToStaticWindow(summaryScreen, SUMMARY_WINDOW_LABEL_SP_ATTACK, summary_label_sp_attack, SUMMARY_TEXT_WHITE, ALIGN_LEFT); + PrintTextToStaticWindow(summaryScreen, SUMMARY_WINDOW_LABEL_SP_DEFENSE, summary_label_sp_defense, SUMMARY_TEXT_WHITE, ALIGN_LEFT); + PrintTextToStaticWindow(summaryScreen, SUMMARY_WINDOW_LABEL_SPEED, summary_label_speed, SUMMARY_TEXT_WHITE, ALIGN_LEFT); + PrintTextToStaticWindow(summaryScreen, SUMMARY_WINDOW_LABEL_ABILITY, summary_label_ability, SUMMARY_TEXT_WHITE, ALIGN_LEFT); + PrintTextToStaticWindow(summaryScreen, SUMMARY_WINDOW_LABEL_SHEEN, summary_label_sheen, SUMMARY_TEXT_WHITE, ALIGN_LEFT); + + MessageLoader_GetStrbuf(summaryScreen->msgLoader, summary_move_cancel, summaryScreen->strbuf); + Text_AddPrinterWithParamsAndColor(&summaryScreen->staticWindows[SUMMARY_WINDOW_LABEL_MOVE_CANCEL], FONT_SYSTEM, summaryScreen->strbuf, 0, 2, TEXT_SPEED_NO_TRANSFER, SUMMARY_TEXT_WHITE, NULL); + + PrintTextToStaticWindow(summaryScreen, SUMMARY_WINDOW_LABEL_MOVE_CATEGORY, summary_label_move_category, SUMMARY_TEXT_WHITE, ALIGN_LEFT); + PrintTextToStaticWindow(summaryScreen, SUMMARY_WINDOW_LABEL_MOVE_POWER, summary_label_move_power, SUMMARY_TEXT_WHITE, ALIGN_LEFT); + PrintTextToStaticWindow(summaryScreen, SUMMARY_WINDOW_LABEL_MOVE_ACCURACY, summary_label_move_accuracy, SUMMARY_TEXT_WHITE, ALIGN_LEFT); + PrintTextToStaticWindow(summaryScreen, SUMMARY_WINDOW_LABEL_CLOSE_WINDOW, summary_close_window, SUMMARY_TEXT_WHITE, ALIGN_CENTER); + PrintTextToStaticWindow(summaryScreen, SUMMARY_WINDOW_LABEL_APPEAL_POINTS, summary_label_appeal_points, SUMMARY_TEXT_BLACK, ALIGN_CENTER); + PrintTextToStaticWindow(summaryScreen, SUMMARY_WINDOW_LABEL_RIBBON_COUNT, summary_label_ribbon_count, SUMMARY_TEXT_BLACK, ALIGN_LEFT); + PrintTextToStaticWindow(summaryScreen, SUMMARY_WINDOW_LABEL_RIBBONS, summary_page_title_ribbons, SUMMARY_TEXT_WHITE, ALIGN_LEFT); +} + +void PokemonSummaryScreen_DrawExtraWindows(PokemonSummaryScreen *summaryScreen) +{ + Bg_FillTilemapRect(summaryScreen->bgConfig, BG_LAYER_MAIN_1, 0, 0, 0, 32, 2, 16); + Bg_FillTilemapRect(summaryScreen->bgConfig, BG_LAYER_MAIN_1, 0, 14, 2, 18, 22, 16); + + switch (summaryScreen->page) { + case SUMMARY_PAGE_INFO: + DrawInfoPageWindows(summaryScreen); break; - case 1: - sub_020908CC(param0); + case SUMMARY_PAGE_MEMO: + DrawMemoPageWindows(summaryScreen); break; - case 2: - sub_0209093C(param0); + case SUMMARY_PAGE_SKILLS: + DrawSkillsPageWindows(summaryScreen); break; - case 4: - sub_02090BDC(param0); + case SUMMARY_PAGE_CONDITION: + DrawConditionPageWindows(summaryScreen); break; - case 3: - sub_02090CD4(param0); + case SUMMARY_PAGE_BATTLE_MOVES: + DrawBattleMovesPageWindows(summaryScreen); break; - case 5: - sub_02090D90(param0); + case SUMMARY_PAGE_CONTEST_MOVES: + DrawContestMovesPageWindows(summaryScreen); break; - case 6: - sub_02090E4C(param0); + case SUMMARY_PAGE_RIBBONS: + DrawRibbonsPageWindows(summaryScreen); break; - case 7: - sub_02090EC8(param0); + case SUMMARY_PAGE_EXIT: + DrawExitPageWindows(summaryScreen); break; } } -static void sub_02090578(PokemonSummaryScreen *param0) +static void DrawInfoPageWindows(PokemonSummaryScreen *summaryScreen) { - Window_ScheduleCopyToVRAM(¶m0->staticWindows[0]); - Window_ScheduleCopyToVRAM(¶m0->staticWindows[7]); - Window_ScheduleCopyToVRAM(¶m0->staticWindows[8]); - Window_ScheduleCopyToVRAM(¶m0->staticWindows[9]); - Window_ScheduleCopyToVRAM(¶m0->staticWindows[10]); - Window_ScheduleCopyToVRAM(¶m0->staticWindows[11]); - Window_ScheduleCopyToVRAM(¶m0->staticWindows[12]); - Window_ScheduleCopyToVRAM(¶m0->staticWindows[13]); - Window_ScheduleCopyToVRAM(¶m0->staticWindows[14]); - - Window_FillTilemap(¶m0->extraWindows[0], 0); - Window_FillTilemap(¶m0->extraWindows[1], 0); - Window_FillTilemap(¶m0->extraWindows[2], 0); - Window_FillTilemap(¶m0->extraWindows[3], 0); - Window_FillTilemap(¶m0->extraWindows[4], 0); - Window_FillTilemap(¶m0->extraWindows[5], 0); - - { - u32 v0 = sub_0207A294(param0->data->dexMode, param0->monData.species); - - if (v0 != 0) { - SetAndFormatNumberBuf(param0, 9, v0, 3, PADDING_MODE_ZEROES); - } else { - MessageLoader_GetStrbuf(param0->msgLoader, 22, param0->strbuf); - } + Window_ScheduleCopyToVRAM(&summaryScreen->staticWindows[SUMMARY_WINDOW_LABEL_INFO]); + Window_ScheduleCopyToVRAM(&summaryScreen->staticWindows[SUMMARY_WINDOW_LABEL_DEX_NUM]); + Window_ScheduleCopyToVRAM(&summaryScreen->staticWindows[SUMMARY_WINDOW_LABEL_SPECIES_NAME]); + Window_ScheduleCopyToVRAM(&summaryScreen->staticWindows[SUMMARY_WINDOW_LABEL_TYPE]); + Window_ScheduleCopyToVRAM(&summaryScreen->staticWindows[SUMMARY_WINDOW_LABEL_OT_NAME]); + Window_ScheduleCopyToVRAM(&summaryScreen->staticWindows[SUMMARY_WINDOW_LABEL_OT_ID]); + Window_ScheduleCopyToVRAM(&summaryScreen->staticWindows[SUMMARY_WINDOW_LABEL_EXP]); + Window_ScheduleCopyToVRAM(&summaryScreen->staticWindows[SUMMARY_WINDOW_LABEL_EXP_NEXT_LV]); + Window_ScheduleCopyToVRAM(&summaryScreen->staticWindows[SUMMARY_WINDOW_DUMMY_14]); + + Window_FillTilemap(&summaryScreen->extraWindows[SUMMARY_WINDOW_DEX_NUM], 0); + Window_FillTilemap(&summaryScreen->extraWindows[SUMMARY_WINDOW_SPECIES_NAME], 0); + Window_FillTilemap(&summaryScreen->extraWindows[SUMMARY_WINDOW_OT_NAME], 0); + Window_FillTilemap(&summaryScreen->extraWindows[SUMMARY_WINDOW_OT_ID], 0); + Window_FillTilemap(&summaryScreen->extraWindows[SUMMARY_WINDOW_EXP], 0); + Window_FillTilemap(&summaryScreen->extraWindows[SUMMARY_WINDOW_EXP_NEXT_LV], 0); + + u32 dexNum = sub_0207A294(summaryScreen->data->dexMode, summaryScreen->monData.species); + + if (dexNum != 0) { + SetAndFormatNumberBuf(summaryScreen, summary_dex_number_template, dexNum, 3, PADDING_MODE_ZEROES); + } else { + MessageLoader_GetStrbuf(summaryScreen->msgLoader, summary_three_question_marks, summaryScreen->strbuf); } - if (param0->monData.isShiny == 0) { - PrintTextToWindow(param0, ¶m0->extraWindows[0], TEXT_COLOR(1, 2, 0), PSS_ALIGNMENT_CENTER); + if (summaryScreen->monData.isShiny == FALSE) { + PrintStrbufToWindow(summaryScreen, &summaryScreen->extraWindows[SUMMARY_WINDOW_DEX_NUM], SUMMARY_TEXT_BLACK, ALIGN_CENTER); } else { - PrintTextToWindow(param0, ¶m0->extraWindows[0], TEXT_COLOR(5, 6, 0), PSS_ALIGNMENT_CENTER); + PrintStrbufToWindow(summaryScreen, &summaryScreen->extraWindows[SUMMARY_WINDOW_DEX_NUM], SUMMARY_TEXT_RED, ALIGN_CENTER); } - { - u32 v1 = Font_CalcStrbufWidth(FONT_SYSTEM, param0->monData.speciesName, 0); - u32 v2 = (param0->extraWindows[1].width * 8 - v1) / 2; + u32 speciesWidth = Font_CalcStrbufWidth(FONT_SYSTEM, summaryScreen->monData.speciesName, 0); + u32 speciesX = (summaryScreen->extraWindows[SUMMARY_WINDOW_SPECIES_NAME].width * 8 - speciesWidth) / 2; - Text_AddPrinterWithParamsAndColor(¶m0->extraWindows[1], FONT_SYSTEM, param0->monData.speciesName, v2, 0, TEXT_SPEED_NO_TRANSFER, TEXT_COLOR(1, 2, 0), NULL); - } + Text_AddPrinterWithParamsAndColor(&summaryScreen->extraWindows[SUMMARY_WINDOW_SPECIES_NAME], FONT_SYSTEM, summaryScreen->monData.speciesName, speciesX, 0, TEXT_SPEED_NO_TRANSFER, SUMMARY_TEXT_BLACK, NULL); - { - u32 v3 = Font_CalcStrbufWidth(FONT_SYSTEM, param0->monData.OTName, 0); - u32 v4 = (param0->extraWindows[2].width * 8 - v3) / 2; + u32 OTNameWidth = Font_CalcStrbufWidth(FONT_SYSTEM, summaryScreen->monData.OTName, 0); + u32 OTNameX = (summaryScreen->extraWindows[SUMMARY_WINDOW_OT_NAME].width * 8 - OTNameWidth) / 2; - if (param0->monData.OTGender == 0) { - Text_AddPrinterWithParamsAndColor( - ¶m0->extraWindows[2], FONT_SYSTEM, param0->monData.OTName, v4, 0, TEXT_SPEED_NO_TRANSFER, TEXT_COLOR(3, 4, 0), NULL); - } else { - Text_AddPrinterWithParamsAndColor( - ¶m0->extraWindows[2], FONT_SYSTEM, param0->monData.OTName, v4, 0, TEXT_SPEED_NO_TRANSFER, TEXT_COLOR(5, 6, 0), NULL); - } + if (summaryScreen->monData.OTGender == GENDER_MALE) { + Text_AddPrinterWithParamsAndColor(&summaryScreen->extraWindows[SUMMARY_WINDOW_OT_NAME], FONT_SYSTEM, summaryScreen->monData.OTName, OTNameX, 0, TEXT_SPEED_NO_TRANSFER, SUMMARY_TEXT_BLUE, NULL); + } else { + Text_AddPrinterWithParamsAndColor(&summaryScreen->extraWindows[SUMMARY_WINDOW_OT_NAME], FONT_SYSTEM, summaryScreen->monData.OTName, OTNameX, 0, TEXT_SPEED_NO_TRANSFER, SUMMARY_TEXT_RED, NULL); } - SetAndFormatNumberBuf(param0, 16, (param0->monData.OTID & 0xffff), 5, PADDING_MODE_ZEROES); - PrintTextToWindow(param0, ¶m0->extraWindows[3], TEXT_COLOR(1, 2, 0), PSS_ALIGNMENT_CENTER); - SetAndFormatNumberBuf(param0, 18, param0->monData.curExp, 7, PADDING_MODE_SPACES); - PrintTextToWindow(param0, ¶m0->extraWindows[4], TEXT_COLOR(1, 2, 0), PSS_ALIGNMENT_CENTER); + SetAndFormatNumberBuf(summaryScreen, summary_template_ot_id, (summaryScreen->monData.OTID & 0xFFFF), 5, PADDING_MODE_ZEROES); + PrintStrbufToWindow(summaryScreen, &summaryScreen->extraWindows[SUMMARY_WINDOW_OT_ID], SUMMARY_TEXT_BLACK, ALIGN_CENTER); + + SetAndFormatNumberBuf(summaryScreen, summary_template_exp, summaryScreen->monData.curExp, 7, PADDING_MODE_SPACES); + PrintStrbufToWindow(summaryScreen, &summaryScreen->extraWindows[SUMMARY_WINDOW_EXP], SUMMARY_TEXT_BLACK, ALIGN_CENTER); - if (param0->monData.level < 100) { - SetAndFormatNumberBuf(param0, 21, param0->monData.nextLevelExp - param0->monData.curExp, 7, PADDING_MODE_SPACES); + if (summaryScreen->monData.level < MAX_POKEMON_LEVEL) { + SetAndFormatNumberBuf(summaryScreen, summary_template_exp_next_lv, summaryScreen->monData.nextLevelExp - summaryScreen->monData.curExp, 7, PADDING_MODE_SPACES); } else { - SetAndFormatNumberBuf(param0, 21, 0, 7, PADDING_MODE_SPACES); + SetAndFormatNumberBuf(summaryScreen, summary_template_exp_next_lv, 0, 7, PADDING_MODE_SPACES); } - PrintTextToWindow(param0, ¶m0->extraWindows[5], TEXT_COLOR(1, 2, 0), PSS_ALIGNMENT_CENTER); - Window_ScheduleCopyToVRAM(¶m0->extraWindows[0]); - Window_ScheduleCopyToVRAM(¶m0->extraWindows[1]); - Window_ScheduleCopyToVRAM(¶m0->extraWindows[2]); - Window_ScheduleCopyToVRAM(¶m0->extraWindows[3]); - Window_ScheduleCopyToVRAM(¶m0->extraWindows[4]); - Window_ScheduleCopyToVRAM(¶m0->extraWindows[5]); + PrintStrbufToWindow(summaryScreen, &summaryScreen->extraWindows[SUMMARY_WINDOW_EXP_NEXT_LV], SUMMARY_TEXT_BLACK, ALIGN_CENTER); + Window_ScheduleCopyToVRAM(&summaryScreen->extraWindows[SUMMARY_WINDOW_DEX_NUM]); + Window_ScheduleCopyToVRAM(&summaryScreen->extraWindows[SUMMARY_WINDOW_SPECIES_NAME]); + Window_ScheduleCopyToVRAM(&summaryScreen->extraWindows[SUMMARY_WINDOW_OT_NAME]); + Window_ScheduleCopyToVRAM(&summaryScreen->extraWindows[SUMMARY_WINDOW_OT_ID]); + Window_ScheduleCopyToVRAM(&summaryScreen->extraWindows[SUMMARY_WINDOW_EXP]); + Window_ScheduleCopyToVRAM(&summaryScreen->extraWindows[SUMMARY_WINDOW_EXP_NEXT_LV]); } -static void sub_02090800(Window *param0, Pokemon *param1, BOOL param2) +static void PrintTrainerMemo(Window *window, Pokemon *mon, BOOL monOTMatches) { - PokemonInfoDisplayStruct *v0 = sub_02092494(param1, param2, 19); + PokemonInfoDisplayStruct *infoDisplay = sub_02092494(mon, monOTMatches, HEAP_ID_POKEMON_SUMMARY_SCREEN); - if (v0->unk_14.unk_04 != NULL) { - Text_AddPrinterWithParamsAndColor(param0, FONT_SYSTEM, v0->unk_14.unk_04, 0, 0 + (v0->unk_14.unk_00 - 1) * 16, TEXT_SPEED_NO_TRANSFER, TEXT_COLOR(1, 2, 0), NULL); + if (infoDisplay->unk_14.unk_04 != NULL) { + Text_AddPrinterWithParamsAndColor(window, FONT_SYSTEM, infoDisplay->unk_14.unk_04, 0, (infoDisplay->unk_14.unk_00 - 1) * 16, TEXT_SPEED_NO_TRANSFER, SUMMARY_TEXT_BLACK, NULL); } - if (v0->unk_1C.unk_04 != NULL) { - Text_AddPrinterWithParamsAndColor(param0, FONT_SYSTEM, v0->unk_1C.unk_04, 0, 0 + (v0->unk_1C.unk_00 - 1) * 16, TEXT_SPEED_NO_TRANSFER, TEXT_COLOR(1, 2, 0), NULL); + if (infoDisplay->unk_1C.unk_04 != NULL) { + Text_AddPrinterWithParamsAndColor(window, FONT_SYSTEM, infoDisplay->unk_1C.unk_04, 0, (infoDisplay->unk_1C.unk_00 - 1) * 16, TEXT_SPEED_NO_TRANSFER, SUMMARY_TEXT_BLACK, NULL); } - if (v0->unk_24.unk_04 != NULL) { - Text_AddPrinterWithParamsAndColor(param0, FONT_SYSTEM, v0->unk_24.unk_04, 0, 0 + (v0->unk_24.unk_00 - 1) * 16, TEXT_SPEED_NO_TRANSFER, TEXT_COLOR(1, 2, 0), NULL); + if (infoDisplay->unk_24.unk_04 != NULL) { + Text_AddPrinterWithParamsAndColor(window, FONT_SYSTEM, infoDisplay->unk_24.unk_04, 0, (infoDisplay->unk_24.unk_00 - 1) * 16, TEXT_SPEED_NO_TRANSFER, SUMMARY_TEXT_BLACK, NULL); } - if (v0->unk_2C.unk_04 != NULL) { - Text_AddPrinterWithParamsAndColor(param0, FONT_SYSTEM, v0->unk_2C.unk_04, 0, 0 + (v0->unk_2C.unk_00 - 1) * 16, TEXT_SPEED_NO_TRANSFER, TEXT_COLOR(1, 2, 0), NULL); + if (infoDisplay->unk_2C.unk_04 != NULL) { + Text_AddPrinterWithParamsAndColor(window, FONT_SYSTEM, infoDisplay->unk_2C.unk_04, 0, (infoDisplay->unk_2C.unk_00 - 1) * 16, TEXT_SPEED_NO_TRANSFER, SUMMARY_TEXT_BLACK, NULL); } - if (v0->unk_34.unk_04 != NULL) { - Text_AddPrinterWithParamsAndColor(param0, FONT_SYSTEM, v0->unk_34.unk_04, 0, 0 + (v0->unk_34.unk_00 - 1) * 16, TEXT_SPEED_NO_TRANSFER, TEXT_COLOR(1, 2, 0), NULL); + if (infoDisplay->unk_34.unk_04 != NULL) { + Text_AddPrinterWithParamsAndColor(window, FONT_SYSTEM, infoDisplay->unk_34.unk_04, 0, (infoDisplay->unk_34.unk_00 - 1) * 16, TEXT_SPEED_NO_TRANSFER, SUMMARY_TEXT_BLACK, NULL); } - sub_0209282C(v0); + sub_0209282C(infoDisplay); } -static void sub_020908CC(PokemonSummaryScreen *param0) +static void DrawMemoPageWindows(PokemonSummaryScreen *summaryScreen) { - Strbuf *v0; + Window_ScheduleCopyToVRAM(&summaryScreen->staticWindows[SUMMARY_WINDOW_LABEL_MEMO]); + Window_FillTilemap(&summaryScreen->extraWindows[SUMMARY_WINDOW_MEMO], 0); - Window_ScheduleCopyToVRAM(¶m0->staticWindows[1]); - Window_FillTilemap(¶m0->extraWindows[0], 0); + void *monData = PokemonSummaryScreen_MonData(summaryScreen); + BOOL monOTMatches = DoesMonOTMatchPlayer(summaryScreen); - { - void *v1 = PokemonSummaryScreen_MonData(param0); - BOOL v2 = sub_02090098(param0); + if (summaryScreen->data->dataType == SUMMARY_DATA_BOX_MON) { + Pokemon *mon = Pokemon_New(HEAP_ID_POKEMON_SUMMARY_SCREEN); - if (param0->data->dataType == 2) { - { - Pokemon *v3 = Pokemon_New(19); - - Pokemon_FromBoxPokemon(v1, v3); - sub_02090800(¶m0->extraWindows[0], v3, v2); - Heap_FreeToHeap(v3); - } - } else { - sub_02090800(¶m0->extraWindows[0], v1, v2); - } + Pokemon_FromBoxPokemon(monData, mon); + PrintTrainerMemo(&summaryScreen->extraWindows[SUMMARY_WINDOW_MEMO], mon, monOTMatches); + Heap_FreeToHeap(mon); + } else { + PrintTrainerMemo(&summaryScreen->extraWindows[SUMMARY_WINDOW_MEMO], monData, monOTMatches); } - Window_ScheduleCopyToVRAM(¶m0->extraWindows[0]); + Window_ScheduleCopyToVRAM(&summaryScreen->extraWindows[SUMMARY_WINDOW_MEMO]); } -static void sub_0209093C(PokemonSummaryScreen *param0) +static void DrawSkillsPageWindows(PokemonSummaryScreen *summaryScreen) { - u32 v0; - - Window_ScheduleCopyToVRAM(¶m0->staticWindows[2]); - Window_ScheduleCopyToVRAM(¶m0->staticWindows[15]); - Window_ScheduleCopyToVRAM(¶m0->staticWindows[16]); - Window_ScheduleCopyToVRAM(¶m0->staticWindows[17]); - Window_ScheduleCopyToVRAM(¶m0->staticWindows[18]); - Window_ScheduleCopyToVRAM(¶m0->staticWindows[19]); - Window_ScheduleCopyToVRAM(¶m0->staticWindows[20]); - Window_ScheduleCopyToVRAM(¶m0->staticWindows[21]); - - Window_FillTilemap(¶m0->extraWindows[0], 0); - Window_FillTilemap(¶m0->extraWindows[1], 0); - Window_FillTilemap(¶m0->extraWindows[2], 0); - Window_FillTilemap(¶m0->extraWindows[3], 0); - Window_FillTilemap(¶m0->extraWindows[4], 0); - Window_FillTilemap(¶m0->extraWindows[5], 0); - Window_FillTilemap(¶m0->extraWindows[6], 0); - Window_FillTilemap(¶m0->extraWindows[7], 0); - - v0 = Window_GetWidth(¶m0->extraWindows[0]) * 8; - - PrintMovePPInfo(param0, 0, 117, 119, 118, param0->monData.curHP, param0->monData.maxHP, 3, v0 / 2, 0); - SetAndFormatNumberBuf(param0, 120, param0->monData.attack, 3, PADDING_MODE_NONE); - PrintTextToWindow(param0, ¶m0->extraWindows[1], TEXT_COLOR(1, 2, 0), PSS_ALIGNMENT_RIGHT); - SetAndFormatNumberBuf(param0, 121, param0->monData.defense, 3, PADDING_MODE_NONE); - PrintTextToWindow(param0, ¶m0->extraWindows[2], TEXT_COLOR(1, 2, 0), PSS_ALIGNMENT_RIGHT); - SetAndFormatNumberBuf(param0, 122, param0->monData.spAttack, 3, PADDING_MODE_NONE); - PrintTextToWindow(param0, ¶m0->extraWindows[3], TEXT_COLOR(1, 2, 0), PSS_ALIGNMENT_RIGHT); - SetAndFormatNumberBuf(param0, 123, param0->monData.spDefense, 3, PADDING_MODE_NONE); - PrintTextToWindow(param0, ¶m0->extraWindows[4], TEXT_COLOR(1, 2, 0), PSS_ALIGNMENT_RIGHT); - SetAndFormatNumberBuf(param0, 124, param0->monData.speed, 3, PADDING_MODE_NONE); - PrintTextToWindow(param0, ¶m0->extraWindows[5], TEXT_COLOR(1, 2, 0), PSS_ALIGNMENT_RIGHT); - - { - MessageLoader *v1; - Strbuf *v2; - - StringTemplate_SetAbilityName(param0->strFormatter, 0, param0->monData.ability); - - v2 = MessageLoader_GetNewStrbuf(param0->msgLoader, 125); - StringTemplate_Format(param0->strFormatter, param0->strbuf, v2); - Strbuf_Free(v2); - PrintTextToWindow(param0, ¶m0->extraWindows[6], TEXT_COLOR(1, 2, 0), PSS_ALIGNMENT_LEFT); - - v1 = MessageLoader_Init(1, 26, 612, 19); - MessageLoader_GetStrbuf(v1, param0->monData.ability, param0->strbuf); - MessageLoader_Free(v1); - PrintTextToWindow(param0, ¶m0->extraWindows[7], TEXT_COLOR(1, 2, 0), PSS_ALIGNMENT_LEFT); - } + Window_ScheduleCopyToVRAM(&summaryScreen->staticWindows[SUMMARY_WINDOW_LABEL_SKILLS]); + Window_ScheduleCopyToVRAM(&summaryScreen->staticWindows[SUMMARY_WINDOW_LABEL_HP]); + Window_ScheduleCopyToVRAM(&summaryScreen->staticWindows[SUMMARY_WINDOW_LABEL_ATTACK]); + Window_ScheduleCopyToVRAM(&summaryScreen->staticWindows[SUMMARY_WINDOW_LABEL_DEFENSE]); + Window_ScheduleCopyToVRAM(&summaryScreen->staticWindows[SUMMARY_WINDOW_LABEL_SP_ATTACK]); + Window_ScheduleCopyToVRAM(&summaryScreen->staticWindows[SUMMARY_WINDOW_LABEL_SP_DEFENSE]); + Window_ScheduleCopyToVRAM(&summaryScreen->staticWindows[SUMMARY_WINDOW_LABEL_SPEED]); + Window_ScheduleCopyToVRAM(&summaryScreen->staticWindows[SUMMARY_WINDOW_LABEL_ABILITY]); + + Window_FillTilemap(&summaryScreen->extraWindows[SUMMARY_WINDOW_HP], 0); + Window_FillTilemap(&summaryScreen->extraWindows[SUMMARY_WINDOW_ATTACK], 0); + Window_FillTilemap(&summaryScreen->extraWindows[SUMMARY_WINDOW_DEFENSE], 0); + Window_FillTilemap(&summaryScreen->extraWindows[SUMMARY_WINDOW_SP_ATTACK], 0); + Window_FillTilemap(&summaryScreen->extraWindows[SUMMARY_WINDOW_SP_DEFENSE], 0); + Window_FillTilemap(&summaryScreen->extraWindows[SUMMARY_WINDOW_SPEED], 0); + Window_FillTilemap(&summaryScreen->extraWindows[SUMMARY_WINDOW_ABILITY], 0); + Window_FillTilemap(&summaryScreen->extraWindows[SUMMARY_WINDOW_ABILITY_DESCRIPTION], 0); + + u32 hpWindowWidth = Window_GetWidth(&summaryScreen->extraWindows[SUMMARY_WINDOW_HP]) * 8; + + PrintCurrentAndMaxInfo(summaryScreen, 0, summary_slash, summary_template_current_hp, summary_template_max_hp, summaryScreen->monData.curHP, summaryScreen->monData.maxHP, 3, hpWindowWidth / 2, 0); + SetAndFormatNumberBuf(summaryScreen, summary_template_attack, summaryScreen->monData.attack, 3, PADDING_MODE_NONE); + PrintStrbufToWindow(summaryScreen, &summaryScreen->extraWindows[SUMMARY_WINDOW_ATTACK], SUMMARY_TEXT_BLACK, ALIGN_RIGHT); + SetAndFormatNumberBuf(summaryScreen, summary_template_defense, summaryScreen->monData.defense, 3, PADDING_MODE_NONE); + PrintStrbufToWindow(summaryScreen, &summaryScreen->extraWindows[SUMMARY_WINDOW_DEFENSE], SUMMARY_TEXT_BLACK, ALIGN_RIGHT); + SetAndFormatNumberBuf(summaryScreen, summary_template_sp_attack, summaryScreen->monData.spAttack, 3, PADDING_MODE_NONE); + PrintStrbufToWindow(summaryScreen, &summaryScreen->extraWindows[SUMMARY_WINDOW_SP_ATTACK], SUMMARY_TEXT_BLACK, ALIGN_RIGHT); + SetAndFormatNumberBuf(summaryScreen, summary_template_sp_defense, summaryScreen->monData.spDefense, 3, PADDING_MODE_NONE); + PrintStrbufToWindow(summaryScreen, &summaryScreen->extraWindows[SUMMARY_WINDOW_SP_DEFENSE], SUMMARY_TEXT_BLACK, ALIGN_RIGHT); + SetAndFormatNumberBuf(summaryScreen, summary_template_speed, summaryScreen->monData.speed, 3, PADDING_MODE_NONE); + PrintStrbufToWindow(summaryScreen, &summaryScreen->extraWindows[SUMMARY_WINDOW_SPEED], SUMMARY_TEXT_BLACK, ALIGN_RIGHT); + + StringTemplate_SetAbilityName(summaryScreen->strFormatter, 0, summaryScreen->monData.ability); + Strbuf *buf = MessageLoader_GetNewStrbuf(summaryScreen->msgLoader, summary_template_ability); + StringTemplate_Format(summaryScreen->strFormatter, summaryScreen->strbuf, buf); + Strbuf_Free(buf); - Window_ScheduleCopyToVRAM(¶m0->extraWindows[0]); - Window_ScheduleCopyToVRAM(¶m0->extraWindows[1]); - Window_ScheduleCopyToVRAM(¶m0->extraWindows[2]); - Window_ScheduleCopyToVRAM(¶m0->extraWindows[3]); - Window_ScheduleCopyToVRAM(¶m0->extraWindows[4]); - Window_ScheduleCopyToVRAM(¶m0->extraWindows[5]); - Window_ScheduleCopyToVRAM(¶m0->extraWindows[6]); - Window_ScheduleCopyToVRAM(¶m0->extraWindows[7]); + PrintStrbufToWindow(summaryScreen, &summaryScreen->extraWindows[SUMMARY_WINDOW_ABILITY], SUMMARY_TEXT_BLACK, ALIGN_LEFT); + MessageLoader *msgLoader = MessageLoader_Init(MESSAGE_LOADER_NARC_HANDLE, NARC_INDEX_MSGDATA__PL_MSG, message_bank_ability_descriptions, HEAP_ID_POKEMON_SUMMARY_SCREEN); + MessageLoader_GetStrbuf(msgLoader, summaryScreen->monData.ability, summaryScreen->strbuf); + MessageLoader_Free(msgLoader); + PrintStrbufToWindow(summaryScreen, &summaryScreen->extraWindows[SUMMARY_WINDOW_ABILITY_DESCRIPTION], SUMMARY_TEXT_BLACK, ALIGN_LEFT); + + Window_ScheduleCopyToVRAM(&summaryScreen->extraWindows[SUMMARY_WINDOW_HP]); + Window_ScheduleCopyToVRAM(&summaryScreen->extraWindows[SUMMARY_WINDOW_ATTACK]); + Window_ScheduleCopyToVRAM(&summaryScreen->extraWindows[SUMMARY_WINDOW_DEFENSE]); + Window_ScheduleCopyToVRAM(&summaryScreen->extraWindows[SUMMARY_WINDOW_SP_ATTACK]); + Window_ScheduleCopyToVRAM(&summaryScreen->extraWindows[SUMMARY_WINDOW_SP_DEFENSE]); + Window_ScheduleCopyToVRAM(&summaryScreen->extraWindows[SUMMARY_WINDOW_SPEED]); + Window_ScheduleCopyToVRAM(&summaryScreen->extraWindows[SUMMARY_WINDOW_ABILITY]); + Window_ScheduleCopyToVRAM(&summaryScreen->extraWindows[SUMMARY_WINDOW_ABILITY_DESCRIPTION]); } -static void sub_02090BDC(PokemonSummaryScreen *param0) +static void DrawConditionPageWindows(PokemonSummaryScreen *summaryScreen) { - Window_ScheduleCopyToVRAM(¶m0->staticWindows[3]); - Window_ScheduleCopyToVRAM(¶m0->staticWindows[22]); + Window_ScheduleCopyToVRAM(&summaryScreen->staticWindows[SUMMARY_WINDOW_LABEL_CONDITION]); + Window_ScheduleCopyToVRAM(&summaryScreen->staticWindows[SUMMARY_WINDOW_LABEL_SHEEN]); - if ((param0->data->mode != 3) && (param0->data->mode != 4)) { + if (summaryScreen->data->mode != SUMMARY_MODE_POFFIN && summaryScreen->data->mode != SUMMARY_MODE_CONDITION) { return; } - Window_FillTilemap(¶m0->extraWindows[1], 0); - MessageLoader_GetStrbuf(param0->msgLoader, 165, param0->strbuf); - PrintTextToWindow(param0, ¶m0->extraWindows[1], TEXT_COLOR(15, 14, 0), PSS_ALIGNMENT_LEFT); - MessageLoader_GetStrbuf(param0->msgLoader, 166 + param0->monData.preferredFlavor, param0->strbuf); - Text_AddPrinterWithParamsAndColor(¶m0->extraWindows[1], FONT_SYSTEM, param0->strbuf, 0, 16, TEXT_SPEED_NO_TRANSFER, TEXT_COLOR(1, 2, 0), NULL); - Window_ScheduleCopyToVRAM(¶m0->extraWindows[1]); - - if (param0->data->mode == 3) { - Window_FillTilemap(¶m0->extraWindows[0], 0); - MessageLoader_GetStrbuf(param0->msgLoader, 163, param0->strbuf); - PrintTextToWindow(param0, ¶m0->extraWindows[0], TEXT_COLOR(15, 14, 0), PSS_ALIGNMENT_LEFT); - Window_ScheduleCopyToVRAM(¶m0->extraWindows[0]); - PokemonSummaryScreen_UpdateAButtonSprite(param0, ¶m0->extraWindows[0]); + Window_FillTilemap(&summaryScreen->extraWindows[SUMMARY_WINDOW_FAVORITE_FOOD], 0); + MessageLoader_GetStrbuf(summaryScreen->msgLoader, summary_favorite_food, summaryScreen->strbuf); + PrintStrbufToWindow(summaryScreen, &summaryScreen->extraWindows[SUMMARY_WINDOW_FAVORITE_FOOD], SUMMARY_TEXT_WHITE, ALIGN_LEFT); + MessageLoader_GetStrbuf(summaryScreen->msgLoader, summary_template_likes_spicy + summaryScreen->monData.preferredFlavor, summaryScreen->strbuf); + Text_AddPrinterWithParamsAndColor(&summaryScreen->extraWindows[SUMMARY_WINDOW_FAVORITE_FOOD], FONT_SYSTEM, summaryScreen->strbuf, 0, 16, TEXT_SPEED_NO_TRANSFER, SUMMARY_TEXT_BLACK, NULL); + Window_ScheduleCopyToVRAM(&summaryScreen->extraWindows[SUMMARY_WINDOW_FAVORITE_FOOD]); + + if (summaryScreen->data->mode == SUMMARY_MODE_POFFIN) { + Window_FillTilemap(&summaryScreen->extraWindows[SUMMARY_WINDOW_POFFIN_BUTTON_PROMPT], 0); + MessageLoader_GetStrbuf(summaryScreen->msgLoader, summary_poffin_feed_ok, summaryScreen->strbuf); + PrintStrbufToWindow(summaryScreen, &summaryScreen->extraWindows[SUMMARY_WINDOW_POFFIN_BUTTON_PROMPT], SUMMARY_TEXT_WHITE, ALIGN_LEFT); + Window_ScheduleCopyToVRAM(&summaryScreen->extraWindows[SUMMARY_WINDOW_POFFIN_BUTTON_PROMPT]); + PokemonSummaryScreen_UpdateAButtonSprite(summaryScreen, &summaryScreen->extraWindows[SUMMARY_WINDOW_POFFIN_BUTTON_PROMPT]); } } -static void sub_02090CD4(PokemonSummaryScreen *param0) +static void DrawBattleMovesPageWindows(PokemonSummaryScreen *summaryScreen) { - Window_ScheduleCopyToVRAM(¶m0->staticWindows[4]); + Window_ScheduleCopyToVRAM(&summaryScreen->staticWindows[SUMMARY_WINDOW_LABEL_BATTLE_MOVES]); - if (param0->data->mode == 2) { - PokemonSummaryScreen_ClearAndPrintButtonPrompt(param0, 155); + if (summaryScreen->data->mode == SUMMARY_MODE_SELECT_MOVE) { + PokemonSummaryScreen_ClearAndPrintButtonPrompt(summaryScreen, summary_select_battle_move_ok); } else { - PokemonSummaryScreen_ClearAndPrintButtonPrompt(param0, 129); + PokemonSummaryScreen_ClearAndPrintButtonPrompt(summaryScreen, summary_select_battle_move_info); } - PokemonSummaryScreen_UpdateAButtonSprite(param0, ¶m0->staticWindows[PSS_WINDOW_BUTTON_PROMPT]); + PokemonSummaryScreen_UpdateAButtonSprite(summaryScreen, &summaryScreen->staticWindows[SUMMARY_WINDOW_BUTTON_PROMPT]); - Window_FillTilemap(¶m0->extraWindows[0], 0); - Window_FillTilemap(¶m0->extraWindows[1], 0); - Window_FillTilemap(¶m0->extraWindows[2], 0); - Window_FillTilemap(¶m0->extraWindows[3], 0); + Window_FillTilemap(&summaryScreen->extraWindows[SUMMARY_WINDOW_BATTLE_MOVE_1], 0); + Window_FillTilemap(&summaryScreen->extraWindows[SUMMARY_WINDOW_BATTLE_MOVE_2], 0); + Window_FillTilemap(&summaryScreen->extraWindows[SUMMARY_WINDOW_BATTLE_MOVE_3], 0); + Window_FillTilemap(&summaryScreen->extraWindows[SUMMARY_WINDOW_BATTLE_MOVE_4], 0); - PrintMoveInfo(param0, 0); - PrintMoveInfo(param0, 1); - PrintMoveInfo(param0, 2); - PrintMoveInfo(param0, 3); + PrintMoveNameAndPP(summaryScreen, 0); + PrintMoveNameAndPP(summaryScreen, 1); + PrintMoveNameAndPP(summaryScreen, 2); + PrintMoveNameAndPP(summaryScreen, 3); - Window_ScheduleCopyToVRAM(¶m0->extraWindows[0]); - Window_ScheduleCopyToVRAM(¶m0->extraWindows[1]); - Window_ScheduleCopyToVRAM(¶m0->extraWindows[2]); - Window_ScheduleCopyToVRAM(¶m0->extraWindows[3]); + Window_ScheduleCopyToVRAM(&summaryScreen->extraWindows[SUMMARY_WINDOW_BATTLE_MOVE_1]); + Window_ScheduleCopyToVRAM(&summaryScreen->extraWindows[SUMMARY_WINDOW_BATTLE_MOVE_2]); + Window_ScheduleCopyToVRAM(&summaryScreen->extraWindows[SUMMARY_WINDOW_BATTLE_MOVE_3]); + Window_ScheduleCopyToVRAM(&summaryScreen->extraWindows[SUMMARY_WINDOW_BATTLE_MOVE_4]); } -static void sub_02090D90(PokemonSummaryScreen *param0) +static void DrawContestMovesPageWindows(PokemonSummaryScreen *summaryScreen) { - Window_ScheduleCopyToVRAM(¶m0->staticWindows[5]); + Window_ScheduleCopyToVRAM(&summaryScreen->staticWindows[SUMMARY_WINDOW_LABEL_CONTEST_MOVES]); - if (param0->data->mode == 2) { - PokemonSummaryScreen_ClearAndPrintButtonPrompt(param0, 159); + if (summaryScreen->data->mode == SUMMARY_MODE_SELECT_MOVE) { + PokemonSummaryScreen_ClearAndPrintButtonPrompt(summaryScreen, summary_select_contest_move_ok); } else { - PokemonSummaryScreen_ClearAndPrintButtonPrompt(param0, 158); + PokemonSummaryScreen_ClearAndPrintButtonPrompt(summaryScreen, summary_select_contest_move_info); } - PokemonSummaryScreen_UpdateAButtonSprite(param0, ¶m0->staticWindows[PSS_WINDOW_BUTTON_PROMPT]); + PokemonSummaryScreen_UpdateAButtonSprite(summaryScreen, &summaryScreen->staticWindows[SUMMARY_WINDOW_BUTTON_PROMPT]); - Window_FillTilemap(¶m0->extraWindows[0], 0); - Window_FillTilemap(¶m0->extraWindows[1], 0); - Window_FillTilemap(¶m0->extraWindows[2], 0); - Window_FillTilemap(¶m0->extraWindows[3], 0); + Window_FillTilemap(&summaryScreen->extraWindows[SUMMARY_WINDOW_CONTEST_MOVE_1], 0); + Window_FillTilemap(&summaryScreen->extraWindows[SUMMARY_WINDOW_CONTEST_MOVE_2], 0); + Window_FillTilemap(&summaryScreen->extraWindows[SUMMARY_WINDOW_CONTEST_MOVE_3], 0); + Window_FillTilemap(&summaryScreen->extraWindows[SUMMARY_WINDOW_CONTEST_MOVE_4], 0); - PrintMoveInfo(param0, 0); - PrintMoveInfo(param0, 1); - PrintMoveInfo(param0, 2); - PrintMoveInfo(param0, 3); + PrintMoveNameAndPP(summaryScreen, 0); + PrintMoveNameAndPP(summaryScreen, 1); + PrintMoveNameAndPP(summaryScreen, 2); + PrintMoveNameAndPP(summaryScreen, 3); - Window_ScheduleCopyToVRAM(¶m0->extraWindows[0]); - Window_ScheduleCopyToVRAM(¶m0->extraWindows[1]); - Window_ScheduleCopyToVRAM(¶m0->extraWindows[2]); - Window_ScheduleCopyToVRAM(¶m0->extraWindows[3]); + Window_ScheduleCopyToVRAM(&summaryScreen->extraWindows[SUMMARY_WINDOW_CONTEST_MOVE_1]); + Window_ScheduleCopyToVRAM(&summaryScreen->extraWindows[SUMMARY_WINDOW_CONTEST_MOVE_2]); + Window_ScheduleCopyToVRAM(&summaryScreen->extraWindows[SUMMARY_WINDOW_CONTEST_MOVE_3]); + Window_ScheduleCopyToVRAM(&summaryScreen->extraWindows[SUMMARY_WINDOW_CONTEST_MOVE_4]); } -static void sub_02090E4C(PokemonSummaryScreen *param0) +static void DrawRibbonsPageWindows(PokemonSummaryScreen *summaryScreen) { - Window_ScheduleCopyToVRAM(¶m0->staticWindows[31]); - Window_ScheduleCopyToVRAM(¶m0->staticWindows[30]); + Window_ScheduleCopyToVRAM(&summaryScreen->staticWindows[SUMMARY_WINDOW_LABEL_RIBBONS]); + Window_ScheduleCopyToVRAM(&summaryScreen->staticWindows[SUMMARY_WINDOW_LABEL_RIBBON_COUNT]); - Window_FillTilemap(¶m0->extraWindows[0], 0); - SetAndFormatNumberBuf(param0, 183, param0->ribbonMax, 3, PADDING_MODE_NONE); - PrintTextToWindow(param0, ¶m0->extraWindows[0], TEXT_COLOR(1, 2, 0), PSS_ALIGNMENT_LEFT); - Window_ScheduleCopyToVRAM(¶m0->extraWindows[0]); + Window_FillTilemap(&summaryScreen->extraWindows[SUMMARY_WINDOW_RIBBON_COUNT], 0); + SetAndFormatNumberBuf(summaryScreen, summary_template_ribbon_count, summaryScreen->ribbonMax, 3, PADDING_MODE_NONE); + PrintStrbufToWindow(summaryScreen, &summaryScreen->extraWindows[SUMMARY_WINDOW_RIBBON_COUNT], SUMMARY_TEXT_BLACK, ALIGN_LEFT); + Window_ScheduleCopyToVRAM(&summaryScreen->extraWindows[SUMMARY_WINDOW_RIBBON_COUNT]); - if (param0->ribbonMax != 0) { - PokemonSummaryScreen_ClearAndPrintButtonPrompt(param0, 180); - PokemonSummaryScreen_UpdateAButtonSprite(param0, ¶m0->staticWindows[PSS_WINDOW_BUTTON_PROMPT]); + if (summaryScreen->ribbonMax != 0) { + PokemonSummaryScreen_ClearAndPrintButtonPrompt(summaryScreen, summary_ribbon_select_info); + PokemonSummaryScreen_UpdateAButtonSprite(summaryScreen, &summaryScreen->staticWindows[SUMMARY_WINDOW_BUTTON_PROMPT]); } } -static void sub_02090EC8(PokemonSummaryScreen *param0) +static void DrawExitPageWindows(PokemonSummaryScreen *summaryScreen) { - Window_ScheduleCopyToVRAM(¶m0->staticWindows[28]); - PokemonSummaryScreen_ClearAndPrintButtonPrompt(param0, 161); - PokemonSummaryScreen_UpdateAButtonSprite(param0, ¶m0->staticWindows[PSS_WINDOW_BUTTON_PROMPT]); + Window_ScheduleCopyToVRAM(&summaryScreen->staticWindows[SUMMARY_WINDOW_LABEL_CLOSE_WINDOW]); + PokemonSummaryScreen_ClearAndPrintButtonPrompt(summaryScreen, summary_prompt_exit); + PokemonSummaryScreen_UpdateAButtonSprite(summaryScreen, &summaryScreen->staticWindows[SUMMARY_WINDOW_BUTTON_PROMPT]); - if ((param0->data->mode != 3) && (param0->data->mode != 4)) { + // the exit page shows the "favorite food" condition extra window when feeding poffins + if (summaryScreen->data->mode != SUMMARY_MODE_POFFIN && summaryScreen->data->mode != SUMMARY_MODE_CONDITION) { return; } - Window_FillTilemap(¶m0->extraWindows[1], 0); + Window_FillTilemap(&summaryScreen->extraWindows[SUMMARY_WINDOW_FAVORITE_FOOD], 0); - MessageLoader_GetStrbuf(param0->msgLoader, 165, param0->strbuf); - PrintTextToWindow(param0, ¶m0->extraWindows[1], TEXT_COLOR(15, 14, 0), PSS_ALIGNMENT_LEFT); + MessageLoader_GetStrbuf(summaryScreen->msgLoader, summary_favorite_food, summaryScreen->strbuf); + PrintStrbufToWindow(summaryScreen, &summaryScreen->extraWindows[SUMMARY_WINDOW_FAVORITE_FOOD], SUMMARY_TEXT_WHITE, ALIGN_LEFT); - MessageLoader_GetStrbuf(param0->msgLoader, 166 + param0->monData.preferredFlavor, param0->strbuf); - Text_AddPrinterWithParamsAndColor(¶m0->extraWindows[1], FONT_SYSTEM, param0->strbuf, 0, 16, TEXT_SPEED_NO_TRANSFER, TEXT_COLOR(1, 2, 0), NULL); + MessageLoader_GetStrbuf(summaryScreen->msgLoader, summary_template_likes_spicy + summaryScreen->monData.preferredFlavor, summaryScreen->strbuf); + Text_AddPrinterWithParamsAndColor(&summaryScreen->extraWindows[SUMMARY_WINDOW_FAVORITE_FOOD], FONT_SYSTEM, summaryScreen->strbuf, 0, 16, TEXT_SPEED_NO_TRANSFER, SUMMARY_TEXT_BLACK, NULL); - Window_ScheduleCopyToVRAM(¶m0->extraWindows[1]); + Window_ScheduleCopyToVRAM(&summaryScreen->extraWindows[SUMMARY_WINDOW_FAVORITE_FOOD]); } void PokemonSummaryScreen_PrintRibbonIndexAndMax(PokemonSummaryScreen *summaryScreen) { - Window_FillTilemap(&summaryScreen->extraWindows[1], 0); + Window_FillTilemap(&summaryScreen->extraWindows[SUMMARY_WINDOW_RIBBON_INDEX], 0); - Strbuf *buf = MessageLoader_GetNewStrbuf(summaryScreen->msgLoader, pss_ribbon_max_number); + Strbuf *buf = MessageLoader_GetNewStrbuf(summaryScreen->msgLoader, summary_ribbon_max_number); StringTemplate_SetNumber(summaryScreen->strFormatter, 0, summaryScreen->ribbonMax, 3, PADDING_MODE_NONE, CHARSET_MODE_EN); StringTemplate_Format(summaryScreen->strFormatter, summaryScreen->strbuf, buf); @@ -769,16 +1324,16 @@ void PokemonSummaryScreen_PrintRibbonIndexAndMax(PokemonSummaryScreen *summarySc u8 strWidth = Font_CalcStrbufWidth(FONT_SYSTEM, summaryScreen->strbuf, 0); u8 xOffset = 7 * 8 - strWidth; - Text_AddPrinterWithParamsAndColor(&summaryScreen->extraWindows[1], FONT_SYSTEM, summaryScreen->strbuf, xOffset, 0, TEXT_SPEED_NO_TRANSFER, TEXT_COLOR(1, 2, 0), NULL); + Text_AddPrinterWithParamsAndColor(&summaryScreen->extraWindows[SUMMARY_WINDOW_RIBBON_INDEX], FONT_SYSTEM, summaryScreen->strbuf, xOffset, 0, TEXT_SPEED_NO_TRANSFER, SUMMARY_TEXT_BLACK, NULL); - buf = MessageLoader_GetNewStrbuf(summaryScreen->msgLoader, pss_ribbon_number_slash); + buf = MessageLoader_GetNewStrbuf(summaryScreen->msgLoader, summary_ribbon_number_slash); strWidth = Font_CalcStrbufWidth(FONT_SYSTEM, buf, 0); xOffset -= strWidth; - Text_AddPrinterWithParamsAndColor(&summaryScreen->extraWindows[1], FONT_SYSTEM, buf, xOffset, 0, TEXT_SPEED_NO_TRANSFER, TEXT_COLOR(1, 2, 0), NULL); + Text_AddPrinterWithParamsAndColor(&summaryScreen->extraWindows[SUMMARY_WINDOW_RIBBON_INDEX], FONT_SYSTEM, buf, xOffset, 0, TEXT_SPEED_NO_TRANSFER, SUMMARY_TEXT_BLACK, NULL); Strbuf_Free(buf); - buf = MessageLoader_GetNewStrbuf(summaryScreen->msgLoader, pss_ribbon_index_number); + buf = MessageLoader_GetNewStrbuf(summaryScreen->msgLoader, summary_ribbon_index_number); StringTemplate_SetNumber(summaryScreen->strFormatter, 0, summaryScreen->ribbonCol + summaryScreen->ribbonRow * RIBBONS_PER_ROW + 1, 3, PADDING_MODE_NONE, CHARSET_MODE_EN); StringTemplate_Format(summaryScreen->strFormatter, summaryScreen->strbuf, buf); @@ -787,26 +1342,26 @@ void PokemonSummaryScreen_PrintRibbonIndexAndMax(PokemonSummaryScreen *summarySc strWidth = Font_CalcStrbufWidth(FONT_SYSTEM, summaryScreen->strbuf, 0); xOffset -= strWidth; - Text_AddPrinterWithParamsAndColor(&summaryScreen->extraWindows[1], FONT_SYSTEM, summaryScreen->strbuf, xOffset, 0, TEXT_SPEED_NO_TRANSFER, TEXT_COLOR(1, 2, 0), NULL); - Window_ScheduleCopyToVRAM(&summaryScreen->extraWindows[1]); + Text_AddPrinterWithParamsAndColor(&summaryScreen->extraWindows[SUMMARY_WINDOW_RIBBON_INDEX], FONT_SYSTEM, summaryScreen->strbuf, xOffset, 0, TEXT_SPEED_NO_TRANSFER, SUMMARY_TEXT_BLACK, NULL); + Window_ScheduleCopyToVRAM(&summaryScreen->extraWindows[SUMMARY_WINDOW_RIBBON_INDEX]); } void PokemonSummaryScreen_PrintRibbonNameAndDesc(PokemonSummaryScreen *summaryScreen) { - Window_FillTilemap(&summaryScreen->extraWindows[2], 0); - Window_FillTilemap(&summaryScreen->extraWindows[3], 0); + Window_FillTilemap(&summaryScreen->extraWindows[SUMMARY_WINDOW_RIBBON_NAME], 0); + Window_FillTilemap(&summaryScreen->extraWindows[SUMMARY_WINDOW_RIBBON_DESCRIPTION], 0); MessageLoader_GetStrbuf(summaryScreen->ribbonLoader, Ribbon_GetData(summaryScreen->ribbonNum, RIBBON_DATA_NAME_ID), summaryScreen->strbuf); - PrintTextToWindow(summaryScreen, &summaryScreen->extraWindows[2], TEXT_COLOR(15, 14, 0), PSS_ALIGNMENT_LEFT); + PrintStrbufToWindow(summaryScreen, &summaryScreen->extraWindows[SUMMARY_WINDOW_RIBBON_NAME], SUMMARY_TEXT_WHITE, ALIGN_LEFT); - MessageLoader_GetStrbuf(summaryScreen->ribbonLoader, PokemonSummaryScreen_GetRibbonDescriptionID(summaryScreen->data->ribbons, summaryScreen->ribbonNum), summaryScreen->strbuf); - PrintTextToWindow(summaryScreen, &summaryScreen->extraWindows[3], TEXT_COLOR(1, 2, 0), PSS_ALIGNMENT_LEFT); + MessageLoader_GetStrbuf(summaryScreen->ribbonLoader, PokemonSummaryScreen_GetRibbonDescriptionID(summaryScreen->data->specialRibbons, summaryScreen->ribbonNum), summaryScreen->strbuf); + PrintStrbufToWindow(summaryScreen, &summaryScreen->extraWindows[SUMMARY_WINDOW_RIBBON_DESCRIPTION], SUMMARY_TEXT_BLACK, ALIGN_LEFT); - Window_ScheduleCopyToVRAM(&summaryScreen->extraWindows[2]); - Window_ScheduleCopyToVRAM(&summaryScreen->extraWindows[3]); + Window_ScheduleCopyToVRAM(&summaryScreen->extraWindows[SUMMARY_WINDOW_RIBBON_NAME]); + Window_ScheduleCopyToVRAM(&summaryScreen->extraWindows[SUMMARY_WINDOW_RIBBON_DESCRIPTION]); } -static void PrintMoveInfo(PokemonSummaryScreen *summaryScreen, u32 moveIndex) +static void PrintMoveNameAndPP(PokemonSummaryScreen *summaryScreen, u32 moveIndex) { u16 moveName; u8 curPP, maxPP; @@ -824,177 +1379,173 @@ static void PrintMoveInfo(PokemonSummaryScreen *summaryScreen, u32 moveIndex) } MessageLoader_GetStrbuf(summaryScreen->moveNameLoader, moveName, summaryScreen->strbuf); - Text_AddPrinterWithParamsAndColor(window, FONT_SYSTEM, summaryScreen->strbuf, 1, 2, TEXT_SPEED_NO_TRANSFER, TEXT_COLOR(15, 14, 0), NULL); + Text_AddPrinterWithParamsAndColor(window, FONT_SYSTEM, summaryScreen->strbuf, 1, 2, TEXT_SPEED_NO_TRANSFER, SUMMARY_TEXT_WHITE, NULL); if (moveName != MOVE_NONE) { MessageLoader_GetStrbuf(summaryScreen->msgLoader, 135, summaryScreen->strbuf); - Text_AddPrinterWithParamsAndColor(window, FONT_SYSTEM, summaryScreen->strbuf, 16, 16, TEXT_SPEED_NO_TRANSFER, TEXT_COLOR(1, 2, 0), NULL); - PrintMovePPInfo(summaryScreen, moveIndex, 117, 136 + moveIndex, 141 + moveIndex, curPP, maxPP, 2, (40 + 20), 16); + Text_AddPrinterWithParamsAndColor(window, FONT_SYSTEM, summaryScreen->strbuf, 16, 16, TEXT_SPEED_NO_TRANSFER, SUMMARY_TEXT_BLACK, NULL); + PrintCurrentAndMaxInfo(summaryScreen, moveIndex, 117, 136 + moveIndex, 141 + moveIndex, curPP, maxPP, 2, (40 + 20), 16); } else { MessageLoader_GetStrbuf(summaryScreen->msgLoader, 153, summaryScreen->strbuf); u32 strWidth = Font_CalcStrbufWidth(FONT_SYSTEM, summaryScreen->strbuf, 0); - Text_AddPrinterWithParamsAndColor(window, FONT_SYSTEM, summaryScreen->strbuf, (40 + 20) - strWidth / 2, 16, TEXT_SPEED_NO_TRANSFER, TEXT_COLOR(1, 2, 0), NULL); + Text_AddPrinterWithParamsAndColor(window, FONT_SYSTEM, summaryScreen->strbuf, (40 + 20) - strWidth / 2, 16, TEXT_SPEED_NO_TRANSFER, SUMMARY_TEXT_BLACK, NULL); } } -void PokemonSummaryScreen_PrintBattleMoveInfo(PokemonSummaryScreen *summaryScreen, u32 move) +void PokemonSummaryScreen_PrintBattleMoveAttributes(PokemonSummaryScreen *summaryScreen, u32 move) { - Window_ScheduleCopyToVRAM(&summaryScreen->staticWindows[25]); - Window_ScheduleCopyToVRAM(&summaryScreen->staticWindows[26]); - Window_ScheduleCopyToVRAM(&summaryScreen->staticWindows[27]); + Window_ScheduleCopyToVRAM(&summaryScreen->staticWindows[SUMMARY_WINDOW_LABEL_MOVE_CATEGORY]); + Window_ScheduleCopyToVRAM(&summaryScreen->staticWindows[SUMMARY_WINDOW_LABEL_MOVE_POWER]); + Window_ScheduleCopyToVRAM(&summaryScreen->staticWindows[SUMMARY_WINDOW_LABEL_MOVE_ACCURACY]); - Window_FillTilemap(&summaryScreen->extraWindows[5], 0); - Window_FillTilemap(&summaryScreen->extraWindows[6], 0); - Window_FillTilemap(&summaryScreen->extraWindows[7], 0); + Window_FillTilemap(&summaryScreen->extraWindows[SUMMARY_WINDOW_BATTLE_MOVE_POWER], 0); + Window_FillTilemap(&summaryScreen->extraWindows[SUMMARY_WINDOW_BATTLE_MOVE_ACCURACY], 0); + Window_FillTilemap(&summaryScreen->extraWindows[SUMMARY_WINDOW_BATTLE_MOVE_DESCRIPTION], 0); u32 moveAttribute = MoveTable_LoadParam(move, MOVEATTRIBUTE_POWER); if (moveAttribute <= 1) { - MessageLoader_GetStrbuf(summaryScreen->msgLoader, pss_three_dashes, summaryScreen->strbuf); + MessageLoader_GetStrbuf(summaryScreen->msgLoader, summary_three_dashes, summaryScreen->strbuf); } else { - SetAndFormatNumberBuf(summaryScreen, pss_move_power_template, moveAttribute, 3, PADDING_MODE_SPACES); + SetAndFormatNumberBuf(summaryScreen, summary_move_power_template, moveAttribute, 3, PADDING_MODE_SPACES); } - PrintTextToWindow(summaryScreen, &summaryScreen->extraWindows[5], TEXT_COLOR(1, 2, 0), PSS_ALIGNMENT_CENTER); + PrintStrbufToWindow(summaryScreen, &summaryScreen->extraWindows[SUMMARY_WINDOW_BATTLE_MOVE_POWER], SUMMARY_TEXT_BLACK, ALIGN_CENTER); moveAttribute = MoveTable_LoadParam(move, MOVEATTRIBUTE_ACCURACY); if (moveAttribute == 0) { - MessageLoader_GetStrbuf(summaryScreen->msgLoader, pss_three_dashes, summaryScreen->strbuf); + MessageLoader_GetStrbuf(summaryScreen->msgLoader, summary_three_dashes, summaryScreen->strbuf); } else { - SetAndFormatNumberBuf(summaryScreen, pss_move_accuracy_template, moveAttribute, 3, PADDING_MODE_SPACES); + SetAndFormatNumberBuf(summaryScreen, summary_move_accuracy_template, moveAttribute, 3, PADDING_MODE_SPACES); } - PrintTextToWindow(summaryScreen, &summaryScreen->extraWindows[6], TEXT_COLOR(1, 2, 0), PSS_ALIGNMENT_CENTER); + PrintStrbufToWindow(summaryScreen, &summaryScreen->extraWindows[SUMMARY_WINDOW_BATTLE_MOVE_ACCURACY], SUMMARY_TEXT_BLACK, ALIGN_CENTER); MessageLoader *msgLoader = MessageLoader_Init(MESSAGE_LOADER_NARC_HANDLE, NARC_INDEX_MSGDATA__PL_MSG, message_bank_move_descriptions, HEAP_ID_POKEMON_SUMMARY_SCREEN); MessageLoader_GetStrbuf(msgLoader, move, summaryScreen->strbuf); - PrintTextToWindow(summaryScreen, &summaryScreen->extraWindows[7], TEXT_COLOR(1, 2, 0), PSS_ALIGNMENT_LEFT); + PrintStrbufToWindow(summaryScreen, &summaryScreen->extraWindows[SUMMARY_WINDOW_BATTLE_MOVE_DESCRIPTION], SUMMARY_TEXT_BLACK, ALIGN_LEFT); MessageLoader_Free(msgLoader); - Window_ScheduleCopyToVRAM(&summaryScreen->extraWindows[5]); - Window_ScheduleCopyToVRAM(&summaryScreen->extraWindows[6]); - Window_ScheduleCopyToVRAM(&summaryScreen->extraWindows[7]); + Window_ScheduleCopyToVRAM(&summaryScreen->extraWindows[SUMMARY_WINDOW_BATTLE_MOVE_POWER]); + Window_ScheduleCopyToVRAM(&summaryScreen->extraWindows[SUMMARY_WINDOW_BATTLE_MOVE_ACCURACY]); + Window_ScheduleCopyToVRAM(&summaryScreen->extraWindows[SUMMARY_WINDOW_BATTLE_MOVE_DESCRIPTION]); } -void PokemonSummaryScreen_ClearBattleInfoWindows(PokemonSummaryScreen *summaryScreen) +void PokemonSummaryScreen_ClearBattleAttributeWindows(PokemonSummaryScreen *summaryScreen) { - Window_ClearAndScheduleCopyToVRAM(&summaryScreen->staticWindows[25]); - Window_ClearAndScheduleCopyToVRAM(&summaryScreen->staticWindows[26]); - Window_ClearAndScheduleCopyToVRAM(&summaryScreen->staticWindows[27]); - Window_ClearAndScheduleCopyToVRAM(&summaryScreen->extraWindows[5]); - Window_ClearAndScheduleCopyToVRAM(&summaryScreen->extraWindows[6]); - Window_ClearAndScheduleCopyToVRAM(&summaryScreen->extraWindows[7]); + Window_ClearAndScheduleCopyToVRAM(&summaryScreen->staticWindows[SUMMARY_WINDOW_LABEL_MOVE_CATEGORY]); + Window_ClearAndScheduleCopyToVRAM(&summaryScreen->staticWindows[SUMMARY_WINDOW_LABEL_MOVE_POWER]); + Window_ClearAndScheduleCopyToVRAM(&summaryScreen->staticWindows[SUMMARY_WINDOW_LABEL_MOVE_ACCURACY]); + Window_ClearAndScheduleCopyToVRAM(&summaryScreen->extraWindows[SUMMARY_WINDOW_BATTLE_MOVE_POWER]); + Window_ClearAndScheduleCopyToVRAM(&summaryScreen->extraWindows[SUMMARY_WINDOW_BATTLE_MOVE_ACCURACY]); + Window_ClearAndScheduleCopyToVRAM(&summaryScreen->extraWindows[SUMMARY_WINDOW_BATTLE_MOVE_DESCRIPTION]); } -void ShowMoveInfoOrCancel(PokemonSummaryScreen *summaryScreen) +void PokemonSummaryScreen_ShowMove5OrCancel(PokemonSummaryScreen *summaryScreen) { if (summaryScreen->data->move != MOVE_NONE) { - Window_FillTilemap(&summaryScreen->extraWindows[4], 0); - PrintMoveInfo(summaryScreen, LEARNED_MOVES_MAX); - Window_ScheduleCopyToVRAM(&summaryScreen->extraWindows[4]); + Window_FillTilemap(&summaryScreen->extraWindows[SUMMARY_WINDOW_BATTLE_MOVE_5], 0); + PrintMoveNameAndPP(summaryScreen, LEARNED_MOVES_MAX); + Window_ScheduleCopyToVRAM(&summaryScreen->extraWindows[SUMMARY_WINDOW_BATTLE_MOVE_5]); } else { - Window_ScheduleCopyToVRAM(&summaryScreen->staticWindows[24]); + Window_ScheduleCopyToVRAM(&summaryScreen->staticWindows[SUMMARY_WINDOW_LABEL_MOVE_CANCEL]); } } -void HideMoveCancelText(PokemonSummaryScreen *summaryScreen) +void PokemonSummaryScreen_HideMoveCancelText(PokemonSummaryScreen *summaryScreen) { - Window_ClearAndScheduleCopyToVRAM(&summaryScreen->staticWindows[24]); + Window_ClearAndScheduleCopyToVRAM(&summaryScreen->staticWindows[SUMMARY_WINDOW_LABEL_MOVE_CANCEL]); Bg_ScheduleTilemapTransfer(summaryScreen->bgConfig, BG_LAYER_MAIN_1); } -void sub_02091474(PokemonSummaryScreen *param0) +void PokemonSummaryScreen_SwapMoveNameAndPP(PokemonSummaryScreen *summaryScreen) { - Window_FillTilemap(¶m0->extraWindows[0 + param0->cursor], 0); - Window_FillTilemap(¶m0->extraWindows[0 + param0->cursorTmp], 0); + Window_FillTilemap(&summaryScreen->extraWindows[summaryScreen->cursor], 0); + Window_FillTilemap(&summaryScreen->extraWindows[summaryScreen->cursorTmp], 0); - PrintMoveInfo(param0, param0->cursor); - PrintMoveInfo(param0, param0->cursorTmp); + PrintMoveNameAndPP(summaryScreen, summaryScreen->cursor); + PrintMoveNameAndPP(summaryScreen, summaryScreen->cursorTmp); - Window_ScheduleCopyToVRAM(¶m0->extraWindows[0 + param0->cursor]); - Window_ScheduleCopyToVRAM(¶m0->extraWindows[0 + param0->cursorTmp]); + Window_ScheduleCopyToVRAM(&summaryScreen->extraWindows[summaryScreen->cursor]); + Window_ScheduleCopyToVRAM(&summaryScreen->extraWindows[summaryScreen->cursorTmp]); } void PokemonSummaryScreen_PrintHMMovesCantBeForgotten(PokemonSummaryScreen *summaryScreen) { Window *window; - if (summaryScreen->page == 3) { - Window_ClearAndScheduleCopyToVRAM(&summaryScreen->extraWindows[5]); - Window_ClearAndScheduleCopyToVRAM(&summaryScreen->extraWindows[6]); - Window_ClearAndScheduleCopyToVRAM(&summaryScreen->extraWindows[7]); - window = &summaryScreen->extraWindows[7]; + if (summaryScreen->page == SUMMARY_PAGE_BATTLE_MOVES) { + Window_ClearAndScheduleCopyToVRAM(&summaryScreen->extraWindows[SUMMARY_WINDOW_BATTLE_MOVE_POWER]); + Window_ClearAndScheduleCopyToVRAM(&summaryScreen->extraWindows[SUMMARY_WINDOW_BATTLE_MOVE_ACCURACY]); + Window_ClearAndScheduleCopyToVRAM(&summaryScreen->extraWindows[SUMMARY_WINDOW_BATTLE_MOVE_DESCRIPTION]); + window = &summaryScreen->extraWindows[SUMMARY_WINDOW_BATTLE_MOVE_DESCRIPTION]; } else { - window = &summaryScreen->extraWindows[5]; + window = &summaryScreen->extraWindows[SUMMARY_WINDOW_CONTEST_MOVE_DESCRIPTION]; } Window_FillTilemap(window, 0); MessageLoader_GetStrbuf(summaryScreen->msgLoader, 156, summaryScreen->strbuf); - PrintTextToWindow(summaryScreen, window, TEXT_COLOR(1, 2, 0), PSS_ALIGNMENT_LEFT); + PrintStrbufToWindow(summaryScreen, window, SUMMARY_TEXT_BLACK, ALIGN_LEFT); Window_ScheduleCopyToVRAM(window); } -void PokemonSummaryScreen_PrintContestMoveInfo(PokemonSummaryScreen *param0, u32 param1) +void PokemonSummaryScreen_PrintContestMoveAttributes(PokemonSummaryScreen *summaryScreen, u32 move) { - MessageLoader *v0; - u32 v1; - u32 v2; - - Window_FillTilemap(¶m0->extraWindows[5], 0); + Window_FillTilemap(&summaryScreen->extraWindows[SUMMARY_WINDOW_CONTEST_MOVE_DESCRIPTION], 0); - v1 = MoveTable_LoadParam(param1, MOVEATTRIBUTE_CONTEST_EFFECT); - v2 = sub_0209577C(v1); - v0 = MessageLoader_Init(0, 26, 210, 19); + u32 contestEffect = MoveTable_LoadParam(move, MOVEATTRIBUTE_CONTEST_EFFECT); + u32 descEntryID = sub_0209577C(contestEffect); + MessageLoader *msgLoader = MessageLoader_Init(MESSAGE_LOADER_BANK_HANDLE, NARC_INDEX_MSGDATA__PL_MSG, message_bank_contest_effects, HEAP_ID_POKEMON_SUMMARY_SCREEN); - MessageLoader_GetStrbuf(v0, v2, param0->strbuf); - Text_AddPrinterWithParamsAndColor(¶m0->extraWindows[5], FONT_SYSTEM, param0->strbuf, 0, 0, TEXT_SPEED_NO_TRANSFER, TEXT_COLOR(1, 2, 0), NULL); + MessageLoader_GetStrbuf(msgLoader, descEntryID, summaryScreen->strbuf); + Text_AddPrinterWithParamsAndColor(&summaryScreen->extraWindows[SUMMARY_WINDOW_CONTEST_MOVE_DESCRIPTION], FONT_SYSTEM, summaryScreen->strbuf, 0, 0, TEXT_SPEED_NO_TRANSFER, SUMMARY_TEXT_BLACK, NULL); - MessageLoader_Free(v0); + MessageLoader_Free(msgLoader); - Window_ScheduleCopyToVRAM(¶m0->staticWindows[29]); - Window_ScheduleCopyToVRAM(¶m0->extraWindows[5]); + Window_ScheduleCopyToVRAM(&summaryScreen->staticWindows[SUMMARY_WINDOW_LABEL_APPEAL_POINTS]); + Window_ScheduleCopyToVRAM(&summaryScreen->extraWindows[SUMMARY_WINDOW_CONTEST_MOVE_DESCRIPTION]); } -void PokemonSummaryScreen_ClearContestInfoWindows(PokemonSummaryScreen *param0) +void PokemonSummaryScreen_ClearContestAttributeWindows(PokemonSummaryScreen *summaryScreen) { - Window_ClearAndScheduleCopyToVRAM(¶m0->staticWindows[29]); - Window_ClearAndScheduleCopyToVRAM(¶m0->extraWindows[5]); + Window_ClearAndScheduleCopyToVRAM(&summaryScreen->staticWindows[SUMMARY_WINDOW_LABEL_APPEAL_POINTS]); + Window_ClearAndScheduleCopyToVRAM(&summaryScreen->extraWindows[SUMMARY_WINDOW_CONTEST_MOVE_DESCRIPTION]); } -void PokemonSummaryScreen_PrintPoffinFeedMsg(PokemonSummaryScreen *summaryScreen, enum PSSPoffinFeedMsg msg) +void PokemonSummaryScreen_PrintPoffinFeedMsg(PokemonSummaryScreen *summaryScreen, enum SummaryPoffinFeedMsg msg) { u32 entryID; switch (msg) { - case PSS_MSG_COOLNESS_ENHANCED: - entryID = pss_coolness_enhanced; + case SUMMARY_MSG_COOLNESS_ENHANCED: + entryID = summary_coolness_enhanced; break; - case PSS_MSG_BEAUTY_ENHANCED: - entryID = pss_beauty_enhanced; + case SUMMARY_MSG_BEAUTY_ENHANCED: + entryID = summary_beauty_enhanced; break; - case PSS_MSG_CUTENESS_ENHANCED: - entryID = pss_cuteness_enhanced; + case SUMMARY_MSG_CUTENESS_ENHANCED: + entryID = summary_cuteness_enhanced; break; - case PSS_MSG_SMARTNESS_ENHANCED: - entryID = pss_smartness_enhanced; + case SUMMARY_MSG_SMARTNESS_ENHANCED: + entryID = summary_smartness_enhanced; break; - case PSS_MSG_TOUGHNESS_ENHANCED: - entryID = pss_toughness_enhanced; + case SUMMARY_MSG_TOUGHNESS_ENHANCED: + entryID = summary_toughness_enhanced; break; - case PSS_MSG_NOTHING_CHANGED: - entryID = pss_nothing_changed; + case SUMMARY_MSG_NOTHING_CHANGED: + entryID = summary_nothing_changed; break; default: - entryID = pss_pokemon_wont_eat_more; + entryID = summary_pokemon_wont_eat_more; } - Window *window = &summaryScreen->extraWindows[2]; + Window *window = &summaryScreen->extraWindows[SUMMARY_WINDOW_POFFIN_FEED_MSG]; Window_DrawMessageBoxWithScrollCursor(window, TRUE, (1024 - (18 + 12)), 13); Window_FillTilemap(window, 15); MessageLoader_GetStrbuf(summaryScreen->msgLoader, entryID, summaryScreen->strbuf); - Text_AddPrinterWithParamsAndColor(window, FONT_MESSAGE, summaryScreen->strbuf, 0, 0, TEXT_SPEED_NO_TRANSFER, TEXT_COLOR(1, 2, 15), NULL); + Text_AddPrinterWithParamsAndColor(window, FONT_MESSAGE, summaryScreen->strbuf, 0, 0, TEXT_SPEED_NO_TRANSFER, SUMMARY_TEXT_BLACK_DARK_SHADOW, NULL); Window_ScheduleCopyToVRAM(window); } diff --git a/src/field_menu.c b/src/field_menu.c index e394741610..b00f221f8b 100644 --- a/src/field_menu.c +++ b/src/field_menu.c @@ -1040,7 +1040,7 @@ BOOL sub_0203B7C0(FieldTask *taskMan) v3->max = (u8)Party_GetCurrentCount(v3->monData); v3->move = 0; v3->mode = 0; - v3->ribbons = sub_0202D79C(fieldSystem->saveData); + v3->specialRibbons = sub_0202D79C(fieldSystem->saveData); v3->dexMode = sub_0207A274(fieldSystem->saveData); v3->showContest = PokemonSummaryScreen_ShowContestData(fieldSystem->saveData); v3->chatotCry = NULL; diff --git a/src/meson.build b/src/meson.build index 7fa697aa78..17f9330bee 100644 --- a/src/meson.build +++ b/src/meson.build @@ -305,7 +305,7 @@ pokeplatinum_c = files( 'applications/pokemon_summary_screen/main.c', 'applications/pokemon_summary_screen/sprite.c', 'applications/pokemon_summary_screen/window.c', - 'unk_020916B4.c', + 'applications/pokemon_summary_screen/3d_anim.c', 'applications/pokemon_summary_screen/subscreen.c', 'ribbon.c', 'unk_02092494.c', diff --git a/src/overlay019/ov19_021D0D80.c b/src/overlay019/ov19_021D0D80.c index 305e7ed1ef..b090d15fcb 100644 --- a/src/overlay019/ov19_021D0D80.c +++ b/src/overlay019/ov19_021D0D80.c @@ -879,7 +879,7 @@ static void ov19_021D1C84(UnkStruct_ov19_021D5DF8 *param0) param0->unk_12C.chatotCry = NULL; param0->unk_12C.dexMode = sub_0207A274(param0->unk_11C); param0->unk_12C.showContest = PokemonSummaryScreen_ShowContestData(param0->unk_11C); - param0->unk_12C.ribbons = sub_0202D79C(param0->unk_11C); + param0->unk_12C.specialRibbons = sub_0202D79C(param0->unk_11C); PokemonSummaryScreen_FlagVisiblePages(&(param0->unk_12C), v0); PokemonSummaryScreen_SetPlayerProfile(&(param0->unk_12C), SaveData_GetTrainerInfo(param0->unk_11C)); diff --git a/src/overlay088/ov88_0223B140.c b/src/overlay088/ov88_0223B140.c index e41431612d..a9423965f7 100644 --- a/src/overlay088/ov88_0223B140.c +++ b/src/overlay088/ov88_0223B140.c @@ -1747,7 +1747,7 @@ static void ov88_0223D1EC(UnkStruct_02095E80 *param0, int param1) param0->unk_0C.showContest = PokemonSummaryScreen_ShowContestData(param0->unk_08->unk_10); param0->unk_0C.dexMode = param0->unk_08->unk_30; param0->unk_0C.options = param0->unk_08->unk_18; - param0->unk_0C.ribbons = sub_0202D79C(param0->unk_08->unk_10); + param0->unk_0C.specialRibbons = sub_0202D79C(param0->unk_08->unk_10); PokemonSummaryScreen_FlagVisiblePages(¶m0->unk_0C, Unk_ov88_0223F13C); diff --git a/src/overlay094/ov94_022443E0.c b/src/overlay094/ov94_022443E0.c index b350f2a6c6..adf39992f1 100644 --- a/src/overlay094/ov94_022443E0.c +++ b/src/overlay094/ov94_022443E0.c @@ -37,7 +37,7 @@ int ov94_022443E0(UnkStruct_ov94_0223FD4C *param0, int param1) param0->unk_B8.showContest = PokemonSummaryScreen_ShowContestData(param0->unk_00->unk_20); param0->unk_B8.dexMode = param0->unk_00->unk_34; param0->unk_B8.options = param0->unk_00->unk_24; - param0->unk_B8.ribbons = sub_0202D79C(param0->unk_00->unk_20); + param0->unk_B8.specialRibbons = sub_0202D79C(param0->unk_00->unk_20); PokemonSummaryScreen_FlagVisiblePages(¶m0->unk_B8, Unk_ov94_02246360); PokemonSummaryScreen_SetPlayerProfile(¶m0->unk_B8, param0->unk_00->unk_1C); diff --git a/src/overlay104/ov104_02239C58.c b/src/overlay104/ov104_02239C58.c index 9c7b26a9a5..e8cdfd6ea2 100644 --- a/src/overlay104/ov104_02239C58.c +++ b/src/overlay104/ov104_02239C58.c @@ -207,7 +207,7 @@ static void ov104_02239FB0(UnkStruct_0209B75C *param0, UnkStruct_0209BBA4 *param param1->unk_AC->max = (u8)Party_GetCurrentCount(param1->unk_AC->monData); param1->unk_AC->move = 0; param1->unk_AC->mode = 0; - param1->unk_AC->ribbons = sub_0202D79C(param1->unk_00); + param1->unk_AC->specialRibbons = sub_0202D79C(param1->unk_00); PokemonSummaryScreen_FlagVisiblePages(param1->unk_AC, v0); PokemonSummaryScreen_SetPlayerProfile(param1->unk_AC, SaveData_GetTrainerInfo(param1->unk_00)); diff --git a/src/pokemon.c b/src/pokemon.c index 7744370271..7b3319a368 100644 --- a/src/pokemon.c +++ b/src/pokemon.c @@ -130,7 +130,7 @@ static void BoxPokemon_SetMoveSlot(BoxPokemon *boxMon, u16 moveID, u8 moveSlot); static BOOL Pokemon_HasMove(Pokemon *mon, u16 moveID); static s8 BoxPokemon_GetFlavorAffinity(BoxPokemon *boxMon, int flavor); static BOOL IsBoxPokemonInfectedWithPokerus(BoxPokemon *boxMon); -static BOOL CanBoxPokemonSpreadPokerus(BoxPokemon *boxMon); +static BOOL BoxPokemonHasCuredPokerus(BoxPokemon *boxMon); static void InitializeBoxPokemonAfterCapture(BoxPokemon *boxMon, TrainerInfo *param1, int monPokeball, int param3, int param4, int param5); static void PostCaptureBoxPokemonProcessing(BoxPokemon *boxMon, TrainerInfo *param1, int monPokeball, int param3, int param4, int param5); static BOOL CanBoxPokemonLearnTM(BoxPokemon *boxMon, u8 tmID); @@ -4009,20 +4009,20 @@ static BOOL IsBoxPokemonInfectedWithPokerus(BoxPokemon *boxMon) return (BoxPokemon_GetValue(boxMon, MON_DATA_POKERUS, NULL) & 0xf) != 0; } -BOOL Pokemon_CanSpreadPokerus(Pokemon *mon) +BOOL Pokemon_HasCuredPokerus(Pokemon *mon) { - return CanBoxPokemonSpreadPokerus(&mon->box); + return BoxPokemonHasCuredPokerus(&mon->box); } -static BOOL CanBoxPokemonSpreadPokerus(BoxPokemon *boxMon) +static BOOL BoxPokemonHasCuredPokerus(BoxPokemon *boxMon) { u8 monPokerus = BoxPokemon_GetValue(boxMon, MON_DATA_POKERUS, NULL); - if (monPokerus & 0xf) { - return 0; + if (monPokerus & 0xF) { + return FALSE; } - return (monPokerus & 0xf0) != 0; + return (monPokerus & 0xF0) != 0; } void Pokemon_SetArceusForm(Pokemon *mon) diff --git a/src/ribbon.c b/src/ribbon.c index 0385f41472..c8c1924762 100644 --- a/src/ribbon.c +++ b/src/ribbon.c @@ -3,6 +3,7 @@ #include #include +#include "graphics/pokemon_summary_screen/pl_pst_gra.naix" #include "text/gmm/message_bank_ribbon_names.h" typedef struct { @@ -19,86 +20,566 @@ typedef struct { #define SPECIAL_DESCRIPTIONS_START 146 static const RibbonData sRibbonDataTable[] = { - [RIBBON_HOENN_CHAMPION] = { 0x62, 0x48, 0x0, ribbon_name_hoenn_champion, 0x50 }, - [RIBBON_HOENN_COOL] = { 0x4E, 0x49, 0x0, ribbon_name_hoenn_cool, 0x51 }, - [RIBBON_HOENN_COOL_SUPER] = { 0x4F, 0x4A, 0x0, ribbon_name_hoenn_cool_super, 0x52 }, - [RIBBON_HOENN_COOL_HYPER] = { 0x50, 0x4B, 0x0, ribbon_name_hoenn_cool_hyper, 0x53 }, - [RIBBON_HOENN_COOL_MASTER] = { 0x51, 0x4C, 0x0, ribbon_name_hoenn_cool_master, 0x54 }, - [RIBBON_HOENN_BEAUTY] = { 0x52, 0x49, 0x1, ribbon_name_hoenn_beauty, 0x55 }, - [RIBBON_HOENN_BEAUTY_SUPER] = { 0x53, 0x4A, 0x1, ribbon_name_hoenn_beauty_super, 0x56 }, - [RIBBON_HOENN_BEAUTY_HYPER] = { 0x54, 0x4B, 0x1, ribbon_name_hoenn_beauty_hyper, 0x57 }, - [RIBBON_HOENN_BEAUTY_MASTER] = { 0x55, 0x4C, 0x1, ribbon_name_hoenn_beauty_master, 0x58 }, - [RIBBON_HOENN_CUTE] = { 0x56, 0x49, 0x2, ribbon_name_hoenn_cute, 0x59 }, - [RIBBON_HOENN_CUTE_SUPER] = { 0x57, 0x4A, 0x2, ribbon_name_hoenn_cute_super, 0x5A }, - [RIBBON_HOENN_CUTE_HYPER] = { 0x58, 0x4B, 0x2, ribbon_name_hoenn_cute_hyper, 0x5B }, - [RIBBON_HOENN_CUTE_MASTER] = { 0x59, 0x4C, 0x2, ribbon_name_hoenn_cute_master, 0x5C }, - [RIBBON_HOENN_SMART] = { 0x5A, 0x49, 0x3, ribbon_name_hoenn_smart, 0x5D }, - [RIBBON_HOENN_SMART_SUPER] = { 0x5B, 0x4A, 0x3, ribbon_name_hoenn_smart_super, 0x5E }, - [RIBBON_HOENN_SMART_HYPER] = { 0x5C, 0x4B, 0x3, ribbon_name_hoenn_smart_hyper, 0x5F }, - [RIBBON_HOENN_SMART_MASTER] = { 0x5D, 0x4C, 0x3, ribbon_name_hoenn_smart_master, 0x60 }, - [RIBBON_HOENN_TOUGH] = { 0x5E, 0x49, 0x4, ribbon_name_hoenn_tough, 0x61 }, - [RIBBON_HOENN_TOUGH_SUPER] = { 0x5F, 0x4A, 0x4, ribbon_name_hoenn_tough_super, 0x62 }, - [RIBBON_HOENN_TOUGH_HYPER] = { 0x60, 0x4B, 0x4, ribbon_name_hoenn_tough_hyper, 0x63 }, - [RIBBON_HOENN_TOUGH_MASTER] = { 0x61, 0x4C, 0x4, ribbon_name_hoenn_tough_master, 0x64 }, - [RIBBON_HOENN_WINNING] = { 0x63, 0x4E, 0x0, ribbon_name_hoenn_winning, 0x65 }, - [RIBBON_HOENN_VICTORY] = { 0x64, 0x4D, 0x0, ribbon_name_hoenn_victory, 0x66 }, - [RIBBON_HOENN_ARTIST] = { 0x65, 0x4F, 0x1, ribbon_name_hoenn_artist, 0x67 }, - [RIBBON_HOENN_EFFORT] = { 0x66, 0x50, 0x2, ribbon_name_hoenn_effort, 0x68 }, - [RIBBON_HOENN_MARINE] = { 0x67, 0x51, 0x1, ribbon_name_hoenn_marine, 0x8000 }, - [RIBBON_HOENN_LAND] = { 0x68, 0x51, 0x3, ribbon_name_hoenn_land, 0x8001 }, - [RIBBON_HOENN_SKY] = { 0x69, 0x51, 0x4, ribbon_name_hoenn_sky, 0x8002 }, - [RIBBON_HOENN_COUNTRY] = { 0x6A, 0x52, 0x3, ribbon_name_hoenn_country, 0xB2 }, - [RIBBON_HOENN_NATIONAL] = { 0x6B, 0x52, 0x4, ribbon_name_hoenn_national, 0xBE }, - [RIBBON_HOENN_EARTH] = { 0x6C, 0x53, 0x0, ribbon_name_hoenn_earth, 0xBF }, - [RIBBON_HOENN_WORLD] = { 0x6D, 0x53, 0x1, ribbon_name_hoenn_world, 0xB2 }, - [RIBBON_SINNOH_CHAMP] = { 0x19, 0x58, 0x0, ribbon_name_sinnoh_champ, 0x69 }, - [RIBBON_COOL] = { 0x7B, 0x59, 0x0, ribbon_name_cool, 0x6A }, - [RIBBON_COOL_GREAT] = { 0x7C, 0x5A, 0x0, ribbon_name_cool_great, 0x6B }, - [RIBBON_COOL_ULTRA] = { 0x7D, 0x5B, 0x0, ribbon_name_cool_ultra, 0x6C }, - [RIBBON_COOL_MASTER] = { 0x7E, 0x5C, 0x0, ribbon_name_cool_master, 0x6D }, - [RIBBON_BEAUTY] = { 0x7F, 0x59, 0x1, ribbon_name_beauty, 0x6E }, - [RIBBON_BEAUTY_GREAT] = { 0x80, 0x5A, 0x1, ribbon_name_beauty_great, 0x6F }, - [RIBBON_BEAUTY_ULTRA] = { 0x81, 0x5B, 0x1, ribbon_name_beauty_ultra, 0x70 }, - [RIBBON_BEAUTY_MASTER] = { 0x82, 0x5C, 0x1, ribbon_name_beauty_master, 0x71 }, - [RIBBON_CUTE] = { 0x83, 0x59, 0x2, ribbon_name_cute, 0x72 }, - [RIBBON_CUTE_GREAT] = { 0x84, 0x5A, 0x2, ribbon_name_cute_great, 0x73 }, - [RIBBON_CUTE_ULTRA] = { 0x85, 0x5B, 0x2, ribbon_name_cute_ultra, 0x74 }, - [RIBBON_CUTE_MASTER] = { 0x86, 0x5C, 0x2, ribbon_name_cute_master, 0x75 }, - [RIBBON_SMART] = { 0x87, 0x59, 0x3, ribbon_name_smart, 0x76 }, - [RIBBON_SMART_GREAT] = { 0x88, 0x5A, 0x3, ribbon_name_smart_great, 0x77 }, - [RIBBON_SMART_ULTRA] = { 0x89, 0x5B, 0x3, ribbon_name_smart_ultra, 0x78 }, - [RIBBON_SMART_MASTER] = { 0x8A, 0x5C, 0x3, ribbon_name_smart_master, 0x79 }, - [RIBBON_TOUGH] = { 0x8B, 0x59, 0x4, ribbon_name_tough, 0x7A }, - [RIBBON_TOUGH_GREAT] = { 0x8C, 0x5A, 0x4, ribbon_name_tough_great, 0x7B }, - [RIBBON_TOUGH_ULTRA] = { 0x8D, 0x5B, 0x4, ribbon_name_tough_ultra, 0x7C }, - [RIBBON_TOUGH_MASTER] = { 0x8E, 0x5C, 0x4, ribbon_name_tough_master, 0x7D }, - [RIBBON_ABILITY] = { 0x1A, 0x5D, 0x0, ribbon_name_ability, 0x7E }, - [RIBBON_GREAT_ABILITY] = { 0x1B, 0x5E, 0x0, ribbon_name_great_ability, 0x7F }, - [RIBBON_DOUBLE_ABILITY] = { 0x1C, 0x5F, 0x0, ribbon_name_double_ability, 0x80 }, - [RIBBON_MULTI_ABILITY] = { 0x1D, 0x60, 0x0, ribbon_name_multi_ability, 0x81 }, - [RIBBON_PAIR_ABILITY] = { 0x1E, 0x61, 0x0, ribbon_name_pair_ability, 0x82 }, - [RIBBON_WORLD_ABILITY] = { 0x1F, 0x62, 0x0, ribbon_name_world_ability, 0x83 }, - [RIBBON_ALERT] = { 0x20, 0x63, 0x2, ribbon_name_alert, 0x84 }, - [RIBBON_SHOCK] = { 0x21, 0x64, 0x0, ribbon_name_shock, 0x85 }, - [RIBBON_DOWNCAST] = { 0x22, 0x65, 0x1, ribbon_name_downcast, 0x86 }, - [RIBBON_CARELESS] = { 0x23, 0x66, 0x2, ribbon_name_careless, 0x87 }, - [RIBBON_RELAX] = { 0x24, 0x67, 0x3, ribbon_name_relax, 0x88 }, - [RIBBON_SNOOZE] = { 0x25, 0x68, 0x0, ribbon_name_snooze, 0x89 }, - [RIBBON_SMILE] = { 0x26, 0x69, 0x2, ribbon_name_smile, 0x8A }, - [RIBBON_GORGEOUS] = { 0x27, 0x6A, 0x1, ribbon_name_gorgeous, 0x8B }, - [RIBBON_ROYAL] = { 0x28, 0x6B, 0x3, ribbon_name_royal, 0x8C }, - [RIBBON_GORGEOUS_ROYAL] = { 0x29, 0x6C, 0x0, ribbon_name_gorgeous_royal, 0x8D }, - [RIBBON_FOOTPRINT] = { 0x2A, 0x6D, 0x0, ribbon_name_footprint, 0x8E }, - [RIBBON_RECORD] = { 0x2B, 0x6E, 0x1, ribbon_name_record, 0x8F }, - [RIBBON_HISTORY] = { 0x2C, 0x6F, 0x3, ribbon_name_history, 0x90 }, - [RIBBON_LEGEND] = { 0x2D, 0x70, 0x0, ribbon_name_legend, 0x91 }, - [RIBBON_RED] = { 0x2E, 0x71, 0x0, ribbon_name_red, 0x8007 }, - [RIBBON_GREEN] = { 0x2F, 0x72, 0x3, ribbon_name_green, 0x8008 }, - [RIBBON_BLUE] = { 0x30, 0x73, 0x1, ribbon_name_blue, 0x8009 }, - [RIBBON_FESTIVAL] = { 0x31, 0x74, 0x1, ribbon_name_festival, 0x800A }, - [RIBBON_CARNIVAL] = { 0x32, 0x75, 0x0, ribbon_name_carnival, 0x800B }, - [RIBBON_CLASSIC] = { 0x33, 0x76, 0x1, ribbon_name_classic, 0x800C }, - [RIBBON_PREMIER] = { 0x34, 0x77, 0x0, ribbon_name_premier, 0x800D }, + [RIBBON_HOENN_CHAMPION] = { + .ribbonID = 98, + .spriteID = hoenn_champion_NCGR, + .paletteNum = 0, + .nameID = ribbon_name_hoenn_champion, + .descriptionID = ribbon_desc_hoenn_champion, + }, + [RIBBON_HOENN_COOL] = { + .ribbonID = 78, + .spriteID = hoenn_contest_NCGR, + .paletteNum = 0, + .nameID = ribbon_name_hoenn_cool, + .descriptionID = ribbon_desc_hoenn_cool, + }, + [RIBBON_HOENN_COOL_SUPER] = { + .ribbonID = 79, + .spriteID = hoenn_contest_super_NCGR, + .paletteNum = 0, + .nameID = ribbon_name_hoenn_cool_super, + .descriptionID = ribbon_desc_hoenn_cool_super, + }, + [RIBBON_HOENN_COOL_HYPER] = { + .ribbonID = 80, + .spriteID = hoenn_contest_hyper_NCGR, + .paletteNum = 0, + .nameID = ribbon_name_hoenn_cool_hyper, + .descriptionID = ribbon_desc_hoenn_cool_hyper, + }, + [RIBBON_HOENN_COOL_MASTER] = { + .ribbonID = 81, + .spriteID = hoenn_contest_master_NCGR, + .paletteNum = 0, + .nameID = ribbon_name_hoenn_cool_master, + .descriptionID = ribbon_desc_hoenn_cool_master, + }, + [RIBBON_HOENN_BEAUTY] = { + .ribbonID = 82, + .spriteID = hoenn_contest_NCGR, + .paletteNum = 1, + .nameID = ribbon_name_hoenn_beauty, + .descriptionID = ribbon_desc_hoenn_beauty, + }, + [RIBBON_HOENN_BEAUTY_SUPER] = { + .ribbonID = 83, + .spriteID = hoenn_contest_super_NCGR, + .paletteNum = 1, + .nameID = ribbon_name_hoenn_beauty_super, + .descriptionID = ribbon_desc_hoenn_beauty_super, + }, + [RIBBON_HOENN_BEAUTY_HYPER] = { + .ribbonID = 84, + .spriteID = hoenn_contest_hyper_NCGR, + .paletteNum = 1, + .nameID = ribbon_name_hoenn_beauty_hyper, + .descriptionID = ribbon_desc_hoenn_beauty_hyper, + }, + [RIBBON_HOENN_BEAUTY_MASTER] = { + .ribbonID = 85, + .spriteID = hoenn_contest_master_NCGR, + .paletteNum = 1, + .nameID = ribbon_name_hoenn_beauty_master, + .descriptionID = ribbon_desc_hoenn_beauty_master, + }, + [RIBBON_HOENN_CUTE] = { + .ribbonID = 86, + .spriteID = hoenn_contest_NCGR, + .paletteNum = 2, + .nameID = ribbon_name_hoenn_cute, + .descriptionID = ribbon_desc_hoenn_cute, + }, + [RIBBON_HOENN_CUTE_SUPER] = { + .ribbonID = 87, + .spriteID = hoenn_contest_super_NCGR, + .paletteNum = 2, + .nameID = ribbon_name_hoenn_cute_super, + .descriptionID = ribbon_desc_hoenn_cute_super, + }, + [RIBBON_HOENN_CUTE_HYPER] = { + .ribbonID = 88, + .spriteID = hoenn_contest_hyper_NCGR, + .paletteNum = 2, + .nameID = ribbon_name_hoenn_cute_hyper, + .descriptionID = ribbon_desc_hoenn_cute_hyper, + }, + [RIBBON_HOENN_CUTE_MASTER] = { + .ribbonID = 89, + .spriteID = hoenn_contest_master_NCGR, + .paletteNum = 2, + .nameID = ribbon_name_hoenn_cute_master, + .descriptionID = ribbon_desc_hoenn_cute_master, + }, + [RIBBON_HOENN_SMART] = { + .ribbonID = 90, + .spriteID = hoenn_contest_NCGR, + .paletteNum = 3, + .nameID = ribbon_name_hoenn_smart, + .descriptionID = ribbon_desc_hoenn_smart, + }, + [RIBBON_HOENN_SMART_SUPER] = { + .ribbonID = 91, + .spriteID = hoenn_contest_super_NCGR, + .paletteNum = 3, + .nameID = ribbon_name_hoenn_smart_super, + .descriptionID = ribbon_desc_hoenn_smart_super, + }, + [RIBBON_HOENN_SMART_HYPER] = { + .ribbonID = 92, + .spriteID = hoenn_contest_hyper_NCGR, + .paletteNum = 3, + .nameID = ribbon_name_hoenn_smart_hyper, + .descriptionID = ribbon_desc_hoenn_smart_hyper, + }, + [RIBBON_HOENN_SMART_MASTER] = { + .ribbonID = 93, + .spriteID = hoenn_contest_master_NCGR, + .paletteNum = 3, + .nameID = ribbon_name_hoenn_smart_master, + .descriptionID = ribbon_desc_hoenn_smart_master, + }, + [RIBBON_HOENN_TOUGH] = { + .ribbonID = 94, + .spriteID = hoenn_contest_NCGR, + .paletteNum = 4, + .nameID = ribbon_name_hoenn_tough, + .descriptionID = ribbon_desc_hoenn_tough, + }, + [RIBBON_HOENN_TOUGH_SUPER] = { + .ribbonID = 95, + .spriteID = hoenn_contest_super_NCGR, + .paletteNum = 4, + .nameID = ribbon_name_hoenn_tough_super, + .descriptionID = ribbon_desc_hoenn_tough_super, + }, + [RIBBON_HOENN_TOUGH_HYPER] = { + .ribbonID = 96, + .spriteID = hoenn_contest_hyper_NCGR, + .paletteNum = 4, + .nameID = ribbon_name_hoenn_tough_hyper, + .descriptionID = ribbon_desc_hoenn_tough_hyper, + }, + [RIBBON_HOENN_TOUGH_MASTER] = { + .ribbonID = 97, + .spriteID = hoenn_contest_master_NCGR, + .paletteNum = 4, + .nameID = ribbon_name_hoenn_tough_master, + .descriptionID = ribbon_desc_hoenn_tough_master, + }, + [RIBBON_HOENN_WINNING] = { + .ribbonID = 99, + .spriteID = hoenn_winning_NCGR, + .paletteNum = 0, + .nameID = ribbon_name_hoenn_winning, + .descriptionID = ribbon_desc_hoenn_winning, + }, + [RIBBON_HOENN_VICTORY] = { + .ribbonID = 100, + .spriteID = hoenn_victory_NCGR, + .paletteNum = 0, + .nameID = ribbon_name_hoenn_victory, + .descriptionID = ribbon_desc_hoenn_victory, + }, + [RIBBON_HOENN_ARTIST] = { + .ribbonID = 101, + .spriteID = hoenn_artist_NCGR, + .paletteNum = 1, + .nameID = ribbon_name_hoenn_artist, + .descriptionID = ribbon_desc_hoenn_artist, + }, + [RIBBON_HOENN_EFFORT] = { + .ribbonID = 102, + .spriteID = hoenn_effort_NCGR, + .paletteNum = 2, + .nameID = ribbon_name_hoenn_effort, + .descriptionID = ribbon_desc_hoenn_effort, + }, + [RIBBON_HOENN_MARINE] = { + .ribbonID = 103, + .spriteID = hoenn_marine_land_sky_NCGR, + .paletteNum = 1, + .nameID = ribbon_name_hoenn_marine, + .descriptionID = SPECIAL_DESCRIPTION_MASK | 0, + }, + [RIBBON_HOENN_LAND] = { + .ribbonID = 104, + .spriteID = hoenn_marine_land_sky_NCGR, + .paletteNum = 3, + .nameID = ribbon_name_hoenn_land, + .descriptionID = SPECIAL_DESCRIPTION_MASK | 1, + }, + [RIBBON_HOENN_SKY] = { + .ribbonID = 105, + .spriteID = hoenn_marine_land_sky_NCGR, + .paletteNum = 4, + .nameID = ribbon_name_hoenn_sky, + .descriptionID = SPECIAL_DESCRIPTION_MASK | 2, + }, + [RIBBON_HOENN_COUNTRY] = { + .ribbonID = 106, + .spriteID = hoenn_country_national_NCGR, + .paletteNum = 3, + .nameID = ribbon_name_hoenn_country, + .descriptionID = ribbon_desc_hoenn_country_world, + }, + [RIBBON_HOENN_NATIONAL] = { + .ribbonID = 107, + .spriteID = hoenn_country_national_NCGR, + .paletteNum = 4, + .nameID = ribbon_name_hoenn_national, + .descriptionID = ribbon_desc_hoenn_national, + }, + [RIBBON_HOENN_EARTH] = { + .ribbonID = 108, + .spriteID = hoenn_earth_world_NCGR, + .paletteNum = 0, + .nameID = ribbon_name_hoenn_earth, + .descriptionID = ribbon_desc_hoenn_earth, + }, + [RIBBON_HOENN_WORLD] = { + .ribbonID = 109, + .spriteID = hoenn_earth_world_NCGR, + .paletteNum = 1, + .nameID = ribbon_name_hoenn_world, + .descriptionID = ribbon_desc_hoenn_country_world, + }, + [RIBBON_SINNOH_CHAMP] = { + .ribbonID = 25, + .spriteID = sinnoh_champion_NCGR, + .paletteNum = 0, + .nameID = ribbon_name_sinnoh_champ, + .descriptionID = ribbon_desc_sinnoh_champ, + }, + [RIBBON_COOL] = { + .ribbonID = 123, + .spriteID = sinnoh_contest_NCGR, + .paletteNum = 0, + .nameID = ribbon_name_cool, + .descriptionID = ribbon_desc_cool, + }, + [RIBBON_COOL_GREAT] = { + .ribbonID = 124, + .spriteID = sinnoh_contest_great_NCGR, + .paletteNum = 0, + .nameID = ribbon_name_cool_great, + .descriptionID = ribbon_desc_cool_great, + }, + [RIBBON_COOL_ULTRA] = { + .ribbonID = 125, + .spriteID = sinnoh_contest_ultra_NCGR, + .paletteNum = 0, + .nameID = ribbon_name_cool_ultra, + .descriptionID = ribbon_desc_cool_ultra, + }, + [RIBBON_COOL_MASTER] = { + .ribbonID = 126, + .spriteID = sinnoh_contest_master_NCGR, + .paletteNum = 0, + .nameID = ribbon_name_cool_master, + .descriptionID = ribbon_desc_cool_master, + }, + [RIBBON_BEAUTY] = { + .ribbonID = 127, + .spriteID = sinnoh_contest_NCGR, + .paletteNum = 1, + .nameID = ribbon_name_beauty, + .descriptionID = ribbon_desc_beauty, + }, + [RIBBON_BEAUTY_GREAT] = { + .ribbonID = 128, + .spriteID = sinnoh_contest_great_NCGR, + .paletteNum = 1, + .nameID = ribbon_name_beauty_great, + .descriptionID = ribbon_desc_beauty_great, + }, + [RIBBON_BEAUTY_ULTRA] = { + .ribbonID = 129, + .spriteID = sinnoh_contest_ultra_NCGR, + .paletteNum = 1, + .nameID = ribbon_name_beauty_ultra, + .descriptionID = ribbon_desc_beauty_ultra, + }, + [RIBBON_BEAUTY_MASTER] = { + .ribbonID = 130, + .spriteID = sinnoh_contest_master_NCGR, + .paletteNum = 1, + .nameID = ribbon_name_beauty_master, + .descriptionID = ribbon_desc_beauty_master, + }, + [RIBBON_CUTE] = { + .ribbonID = 131, + .spriteID = sinnoh_contest_NCGR, + .paletteNum = 2, + .nameID = ribbon_name_cute, + .descriptionID = ribbon_desc_cute, + }, + [RIBBON_CUTE_GREAT] = { + .ribbonID = 132, + .spriteID = sinnoh_contest_great_NCGR, + .paletteNum = 2, + .nameID = ribbon_name_cute_great, + .descriptionID = ribbon_desc_cute_great, + }, + [RIBBON_CUTE_ULTRA] = { + .ribbonID = 133, + .spriteID = sinnoh_contest_ultra_NCGR, + .paletteNum = 2, + .nameID = ribbon_name_cute_ultra, + .descriptionID = ribbon_desc_cute_ultra, + }, + [RIBBON_CUTE_MASTER] = { + .ribbonID = 134, + .spriteID = sinnoh_contest_master_NCGR, + .paletteNum = 2, + .nameID = ribbon_name_cute_master, + .descriptionID = ribbon_desc_cute_master, + }, + [RIBBON_SMART] = { + .ribbonID = 135, + .spriteID = sinnoh_contest_NCGR, + .paletteNum = 3, + .nameID = ribbon_name_smart, + .descriptionID = ribbon_desc_smart, + }, + [RIBBON_SMART_GREAT] = { + .ribbonID = 136, + .spriteID = sinnoh_contest_great_NCGR, + .paletteNum = 3, + .nameID = ribbon_name_smart_great, + .descriptionID = ribbon_desc_smart_great, + }, + [RIBBON_SMART_ULTRA] = { + .ribbonID = 137, + .spriteID = sinnoh_contest_ultra_NCGR, + .paletteNum = 3, + .nameID = ribbon_name_smart_ultra, + .descriptionID = ribbon_desc_smart_ultra, + }, + [RIBBON_SMART_MASTER] = { + .ribbonID = 138, + .spriteID = sinnoh_contest_master_NCGR, + .paletteNum = 3, + .nameID = ribbon_name_smart_master, + .descriptionID = ribbon_desc_smart_master, + }, + [RIBBON_TOUGH] = { + .ribbonID = 139, + .spriteID = sinnoh_contest_NCGR, + .paletteNum = 4, + .nameID = ribbon_name_tough, + .descriptionID = ribbon_desc_tough, + }, + [RIBBON_TOUGH_GREAT] = { + .ribbonID = 140, + .spriteID = sinnoh_contest_great_NCGR, + .paletteNum = 4, + .nameID = ribbon_name_tough_great, + .descriptionID = ribbon_desc_tough_great, + }, + [RIBBON_TOUGH_ULTRA] = { + .ribbonID = 141, + .spriteID = sinnoh_contest_ultra_NCGR, + .paletteNum = 4, + .nameID = ribbon_name_tough_ultra, + .descriptionID = ribbon_desc_tough_ultra, + }, + [RIBBON_TOUGH_MASTER] = { + .ribbonID = 142, + .spriteID = sinnoh_contest_master_NCGR, + .paletteNum = 4, + .nameID = ribbon_name_tough_master, + .descriptionID = ribbon_desc_tough_master, + }, + [RIBBON_ABILITY] = { + .ribbonID = 26, + .spriteID = ability_NCGR, + .paletteNum = 0, + .nameID = ribbon_name_ability, + .descriptionID = ribbon_desc_ability, + }, + [RIBBON_GREAT_ABILITY] = { + .ribbonID = 27, + .spriteID = great_ability_NCGR, + .paletteNum = 0, + .nameID = ribbon_name_great_ability, + .descriptionID = ribbon_desc_great_ability, + }, + [RIBBON_DOUBLE_ABILITY] = { + .ribbonID = 28, + .spriteID = double_ability_NCGR, + .paletteNum = 0, + .nameID = ribbon_name_double_ability, + .descriptionID = ribbon_desc_double_ability, + }, + [RIBBON_MULTI_ABILITY] = { + .ribbonID = 29, + .spriteID = multi_ability_NCGR, + .paletteNum = 0, + .nameID = ribbon_name_multi_ability, + .descriptionID = ribbon_desc_multi_ability, + }, + [RIBBON_PAIR_ABILITY] = { + .ribbonID = 30, + .spriteID = pair_ability_NCGR, + .paletteNum = 0, + .nameID = ribbon_name_pair_ability, + .descriptionID = ribbon_desc_pair_ability, + }, + [RIBBON_WORLD_ABILITY] = { + .ribbonID = 31, + .spriteID = world_ability_NCGR, + .paletteNum = 0, + .nameID = ribbon_name_world_ability, + .descriptionID = ribbon_desc_world_ability, + }, + [RIBBON_ALERT] = { + .ribbonID = 32, + .spriteID = alert_NCGR, + .paletteNum = 2, + .nameID = ribbon_name_alert, + .descriptionID = ribbon_desc_alert, + }, + [RIBBON_SHOCK] = { + .ribbonID = 33, + .spriteID = shock_NCGR, + .paletteNum = 0, + .nameID = ribbon_name_shock, + .descriptionID = ribbon_desc_shock, + }, + [RIBBON_DOWNCAST] = { + .ribbonID = 34, + .spriteID = downcast_NCGR, + .paletteNum = 1, + .nameID = ribbon_name_downcast, + .descriptionID = ribbon_desc_downcast, + }, + [RIBBON_CARELESS] = { + .ribbonID = 35, + .spriteID = careless_NCGR, + .paletteNum = 2, + .nameID = ribbon_name_careless, + .descriptionID = ribbon_desc_careless, + }, + [RIBBON_RELAX] = { + .ribbonID = 36, + .spriteID = relax_NCGR, + .paletteNum = 3, + .nameID = ribbon_name_relax, + .descriptionID = ribbon_desc_relax, + }, + [RIBBON_SNOOZE] = { + .ribbonID = 37, + .spriteID = snooze_NCGR, + .paletteNum = 0, + .nameID = ribbon_name_snooze, + .descriptionID = ribbon_desc_snooze, + }, + [RIBBON_SMILE] = { + .ribbonID = 38, + .spriteID = smile_NCGR, + .paletteNum = 2, + .nameID = ribbon_name_smile, + .descriptionID = ribbon_desc_smile, + }, + [RIBBON_GORGEOUS] = { + .ribbonID = 39, + .spriteID = gorgeous_NCGR, + .paletteNum = 1, + .nameID = ribbon_name_gorgeous, + .descriptionID = ribbon_desc_gorgeous, + }, + [RIBBON_ROYAL] = { + .ribbonID = 40, + .spriteID = royal_NCGR, + .paletteNum = 3, + .nameID = ribbon_name_royal, + .descriptionID = ribbon_desc_royal, + }, + [RIBBON_GORGEOUS_ROYAL] = { + .ribbonID = 41, + .spriteID = gorgeous_royal_NCGR, + .paletteNum = 0, + .nameID = ribbon_name_gorgeous_royal, + .descriptionID = ribbon_desc_gorgeous_royal, + }, + [RIBBON_FOOTPRINT] = { + .ribbonID = 42, + .spriteID = footprint_NCGR, + .paletteNum = 0, + .nameID = ribbon_name_footprint, + .descriptionID = ribbon_desc_footprint, + }, + [RIBBON_RECORD] = { + .ribbonID = 43, + .spriteID = record_NCGR, + .paletteNum = 1, + .nameID = ribbon_name_record, + .descriptionID = ribbon_desc_record, + }, + [RIBBON_HISTORY] = { + .ribbonID = 44, + .spriteID = history_NCGR, + .paletteNum = 3, + .nameID = ribbon_name_history, + .descriptionID = ribbon_desc_history, + }, + [RIBBON_LEGEND] = { + .ribbonID = 45, + .spriteID = legend_NCGR, + .paletteNum = 0, + .nameID = ribbon_name_legend, + .descriptionID = ribbon_desc_legend, + }, + [RIBBON_RED] = { + .ribbonID = 46, + .spriteID = red_NCGR, + .paletteNum = 0, + .nameID = ribbon_name_red, + .descriptionID = SPECIAL_DESCRIPTION_MASK | 7, + }, + [RIBBON_GREEN] = { + .ribbonID = 47, + .spriteID = green_NCGR, + .paletteNum = 3, + .nameID = ribbon_name_green, + .descriptionID = SPECIAL_DESCRIPTION_MASK | 8, + }, + [RIBBON_BLUE] = { + .ribbonID = 48, + .spriteID = blue_NCGR, + .paletteNum = 1, + .nameID = ribbon_name_blue, + .descriptionID = SPECIAL_DESCRIPTION_MASK | 9, + }, + [RIBBON_FESTIVAL] = { + .ribbonID = 49, + .spriteID = festival_NCGR, + .paletteNum = 1, + .nameID = ribbon_name_festival, + .descriptionID = SPECIAL_DESCRIPTION_MASK | 10, + }, + [RIBBON_CARNIVAL] = { + .ribbonID = 50, + .spriteID = carnival_NCGR, + .paletteNum = 0, + .nameID = ribbon_name_carnival, + .descriptionID = SPECIAL_DESCRIPTION_MASK | 11, + }, + [RIBBON_CLASSIC] = { + .ribbonID = 51, + .spriteID = classic_NCGR, + .paletteNum = 1, + .nameID = ribbon_name_classic, + .descriptionID = SPECIAL_DESCRIPTION_MASK | 12, + }, + [RIBBON_PREMIER] = { + .ribbonID = 52, + .spriteID = premier_NCGR, + .paletteNum = 0, + .nameID = ribbon_name_premier, + .descriptionID = SPECIAL_DESCRIPTION_MASK | 13, + }, }; u32 Ribbon_GetData(u8 ribbonNum, enum RibbonDataField field) @@ -119,10 +600,10 @@ u32 Ribbon_GetData(u8 ribbonNum, enum RibbonDataField field) return 0; } -u32 PokemonSummaryScreen_GetRibbonDescriptionID(u8 *ribbons, u8 ribbonNum) +u32 PokemonSummaryScreen_GetRibbonDescriptionID(u8 *specialRibbons, u8 ribbonNum) { if (sRibbonDataTable[ribbonNum].descriptionID & SPECIAL_DESCRIPTION_MASK) { - return SPECIAL_DESCRIPTIONS_START + ribbons[sRibbonDataTable[ribbonNum].descriptionID & 0xFF]; + return SPECIAL_DESCRIPTIONS_START + specialRibbons[sRibbonDataTable[ribbonNum].descriptionID & 0xFF]; } return sRibbonDataTable[ribbonNum].descriptionID; diff --git a/src/unk_0203D1B8.c b/src/unk_0203D1B8.c index 40e0643a66..f294dcf331 100644 --- a/src/unk_0203D1B8.c +++ b/src/unk_0203D1B8.c @@ -553,7 +553,7 @@ void *sub_0203D5C8(int param0, FieldSystem *fieldSystem, int param2) v0->max = (u8)Party_GetCurrentCount(v0->monData); v0->move = 0; v0->mode = 0; - v0->ribbons = sub_0202D79C(fieldSystem->saveData); + v0->specialRibbons = sub_0202D79C(fieldSystem->saveData); v0->dexMode = sub_0207A274(fieldSystem->saveData); v0->showContest = PokemonSummaryScreen_ShowContestData(fieldSystem->saveData); v0->chatotCry = NULL; @@ -597,7 +597,7 @@ PokemonSummary *sub_0203D670(FieldSystem *fieldSystem, int param1, int param2) v0->mode = param2; v0->dexMode = sub_0207A274(v1); v0->showContest = PokemonSummaryScreen_ShowContestData(v1); - v0->ribbons = sub_0202D79C(v1); + v0->specialRibbons = sub_0202D79C(v1); PokemonSummaryScreen_FlagVisiblePages(v0, v2); PokemonSummaryScreen_SetPlayerProfile(v0, SaveData_GetTrainerInfo(v1)); @@ -1772,7 +1772,7 @@ void *sub_0203E63C(int param0, FieldSystem *fieldSystem, u16 param2, u16 param3) v0->max = 1; v0->move = param3; v0->mode = 2; - v0->ribbons = sub_0202D79C(fieldSystem->saveData); + v0->specialRibbons = sub_0202D79C(fieldSystem->saveData); v0->dexMode = sub_0207A274(fieldSystem->saveData); v0->showContest = SystemFlag_CheckContestHallVisited(SaveData_GetVarsFlags(fieldSystem->saveData)); v0->chatotCry = NULL; diff --git a/src/unk_0204F13C.c b/src/unk_0204F13C.c index fcb482e0f2..c8129870f3 100644 --- a/src/unk_0204F13C.c +++ b/src/unk_0204F13C.c @@ -430,7 +430,7 @@ static int sub_0204F628(UnkStruct_0204F470 *param0, FieldSystem *fieldSystem, in v0->max = (u8)Party_GetCurrentCount(v0->monData); v0->move = 0; v0->mode = 0; - v0->ribbons = sub_0202D79C(v1); + v0->specialRibbons = sub_0202D79C(v1); PokemonSummaryScreen_FlagVisiblePages(v0, v2); PokemonSummaryScreen_SetPlayerProfile(v0, SaveData_GetTrainerInfo(v1)); diff --git a/src/unk_0204FAB4.c b/src/unk_0204FAB4.c index 714078a320..afd6ae5d38 100644 --- a/src/unk_0204FAB4.c +++ b/src/unk_0204FAB4.c @@ -336,7 +336,7 @@ static int sub_0204FF6C(UnkStruct_0204FE50 *param0, FieldSystem *fieldSystem, in v0->max = (u8)Party_GetCurrentCount(v0->monData); v0->move = 0; v0->mode = 0; - v0->ribbons = sub_0202D79C(v1); + v0->specialRibbons = sub_0202D79C(v1); PokemonSummaryScreen_FlagVisiblePages(v0, v2); PokemonSummaryScreen_SetPlayerProfile(v0, SaveData_GetTrainerInfo(v1)); diff --git a/src/unk_0205003C.c b/src/unk_0205003C.c index af9d2717b9..aa160ae16e 100644 --- a/src/unk_0205003C.c +++ b/src/unk_0205003C.c @@ -324,7 +324,7 @@ static int sub_02050498(UnkStruct_0205037C *param0, FieldSystem *fieldSystem, in v0->max = (u8)Party_GetCurrentCount(v0->monData); v0->move = 0; v0->mode = 0; - v0->ribbons = sub_0202D79C(v1); + v0->specialRibbons = sub_0202D79C(v1); PokemonSummaryScreen_FlagVisiblePages(v0, v2); PokemonSummaryScreen_SetPlayerProfile(v0, SaveData_GetTrainerInfo(v1)); diff --git a/src/unk_0205A0D8.c b/src/unk_0205A0D8.c index a2a26ffc7c..72eb6654fe 100644 --- a/src/unk_0205A0D8.c +++ b/src/unk_0205A0D8.c @@ -139,7 +139,7 @@ static void sub_0205A0D8(UnkStruct_0205A0D8 *param0, FieldSystem *fieldSystem, P v0->max = (u8)Party_GetCurrentCount(v0->monData); v0->move = 0; v0->mode = param4; - v0->ribbons = sub_0202D79C(v1); + v0->specialRibbons = sub_0202D79C(v1); PokemonSummaryScreen_FlagVisiblePages(v0, v2); FieldSystem_StartChildProcess(fieldSystem, &gPokemonSummaryScreenApp, v0); diff --git a/src/unk_0206B9D8.c b/src/unk_0206B9D8.c index 096be9f53f..f0cb260a4f 100644 --- a/src/unk_0206B9D8.c +++ b/src/unk_0206B9D8.c @@ -146,7 +146,7 @@ static int sub_0206BAE0(UnkStruct_0206B9D8 *param0, FieldSystem *fieldSystem, in v0->max = (u8)Party_GetCurrentCount(v0->monData); v0->move = 0; v0->mode = param0->unk_09; - v0->ribbons = sub_0202D79C(v1); + v0->specialRibbons = sub_0202D79C(v1); PokemonSummaryScreen_FlagVisiblePages(v0, v2); PokemonSummaryScreen_SetPlayerProfile(v0, SaveData_GetTrainerInfo(v1)); diff --git a/src/unk_020916B4.c b/src/unk_020916B4.c deleted file mode 100644 index 59e97debe8..0000000000 --- a/src/unk_020916B4.c +++ /dev/null @@ -1,377 +0,0 @@ - - -#include "unk_020916B4.h" - -#include -#include - -#include "struct_defs/archived_sprite.h" -#include "struct_defs/struct_02091850.h" - -#include "applications/pokemon_summary_screen/main.h" -#include "applications/pokemon_summary_screen/sprite.h" -#include "overlay115/camera_angle.h" - -#include "camera.h" -#include "gx_layers.h" -#include "pokemon.h" -#include "unk_0200762C.h" -#include "unk_02015F84.h" -#include "unk_0202419C.h" - -typedef struct { - VecFx16 unk_00; - VecFx16 unk_06; - VecFx16 unk_0C; -} UnkStruct_02091B78; - -static void sub_02091850(UnkStruct_02091850 *param0); -static void sub_020918CC(VecFx16 *param0, VecFx16 *param1); -static void sub_020918EC(PokemonSummaryScreen *param0); -static void sub_02091B78(const UnkStruct_02091B78 *param0, VecFx16 *param1, u8 param2); -static void sub_02091BD4(VecFx16 *param0, VecFx16 *param1, VecFx16 *param2); - -static const UnkStruct_02091B78 Unk_020F4FFC[][4] = { - { - { - { 0x1412, 0xEC8, 0x0 }, - { 0x1412, 0x2DF, 0x0 }, - { 0x0, 0xC, 0x0 }, - }, - { - { 0x2098, 0x3C5, 0x0 }, - { 0x15A2, 0x17F, 0x0 }, - { 0xB, 0x2, 0x0 }, - }, - { - { 0x1BA7, 0xFFFFFFFFFFFFF475, 0x0 }, - { 0x1504, 0xFFFFFFFFFFFFFF96, 0x0 }, - { 0x7, 0xFFFFFFFFFFFFFFF5, 0x0 }, - }, - { - { 0x1412, 0x12C, 0x0 }, - { 0x1412, 0x12C, 0x0 }, - { 0x0, 0x0, 0x0 }, - }, - }, - { - { - { 0x733, 0x3C5, 0x0 }, - { 0x1225, 0x17F, 0x0 }, - { 0xFFFFFFFFFFFFFFF5, 0x2, 0x0 }, - }, - { - { 0x13B5, 0xEC8, 0x0 }, - { 0x13B5, 0x2DF, 0x0 }, - { 0x0, 0xC, 0x0 }, - }, - { - { 0x13B5, 0x12C, 0x0 }, - { 0x13B5, 0x12C, 0x0 }, - { 0x0, 0x0, 0x0 }, - }, - { - { 0xC22, 0xFFFFFFFFFFFFF475, 0x0 }, - { 0x12C3, 0xFFFFFFFFFFFFFF96, 0x0 }, - { 0xFFFFFFFFFFFFFFF9, 0xFFFFFFFFFFFFFFF5, 0x0 }, - }, - }, - { - { - { 0x733, 0x3C5, 0x0 }, - { 0x1225, 0x17F, 0x0 }, - { 0xFFFFFFFFFFFFFFF5, 0x2, 0x0 }, - }, - { - { 0x13B5, 0x12C, 0x0 }, - { 0x13B5, 0x12C, 0x0 }, - { 0x0, 0x0, 0x0 }, - }, - { - { 0x1BA7, 0xFFFFFFFFFFFFF475, 0x0 }, - { 0x14B3, 0xFFFFFFFFFFFFFF96, 0x0 }, - { 0x7, 0xFFFFFFFFFFFFFFF5, 0x0 }, - }, - { - { 0xC22, 0xFFFFFFFFFFFFF475, 0x0 }, - { 0x12C3, 0xFFFFFFFFFFFFFF96, 0x0 }, - { 0xFFFFFFFFFFFFFFF9, 0xFFFFFFFFFFFFFFF5, 0x0 }, - }, - }, - { - { - { 0x1412, 0x12C, 0x0 }, - { 0x1412, 0x12C, 0x0 }, - { 0x0, 0x0, 0x0 }, - }, - { - { 0x2098, 0x3C5, 0x0 }, - { 0x15A2, 0x17F, 0x0 }, - { 0xB, 0x2, 0x0 }, - }, - { - { 0x1BA7, 0xFFFFFFFFFFFFF475, 0x0 }, - { 0x1504, 0xFFFFFFFFFFFFFF96, 0x0 }, - { 0x7, 0xFFFFFFFFFFFFFFF5, 0x0 }, - }, - { - { 0xC22, 0xFFFFFFFFFFFFF475, 0x0 }, - { 0x1314, 0xFFFFFFFFFFFFFF96, 0x0 }, - { 0xFFFFFFFFFFFFFFF9, 0xFFFFFFFFFFFFFFF5, 0x0 }, - }, - }, -}; - -void sub_020916B4(PokemonSummaryScreen *param0) -{ - NNS_G3dInit(); - - G3X_Init(); - G3X_InitMtxStack(); - G3X_SetShading(GX_SHADING_TOON); - G3X_AlphaTest(0, 0); - G3X_AlphaBlend(1); - G3X_AntiAlias(1); - G3X_EdgeMarking(0); - G3X_SetFog(0, 0, 0, 0); - G3X_SetClearColor(0, 0, 0x7fff, 63, 0); - G3_SwapBuffers(GX_SORTMODE_AUTO, GX_BUFFERMODE_Z); - G3_ViewPort(0, 0, 255, 191); - - GXLayers_EngineAToggleLayers(GX_PLANEMASK_BG0, 1); - - G2_SetBG0Priority(2); -} - -void PokemonSummaryScreen_Update3DGfx(PokemonSummaryScreen *summaryScreen) -{ - if (summaryScreen->page == PSS_PAGE_CONDITION) { - sub_020241B4(); - Camera_ComputeViewMatrix(); - - G3_MtxMode(GX_MTXMODE_PROJECTION); - G3_Identity(); - G3_MtxMode(GX_MTXMODE_POSITION_VECTOR); - G3_Identity(); - - NNS_G3dGlbFlush(); - sub_02091850(summaryScreen->unk_2F0); - NNS_G3dGlbFlush(); - sub_020918EC(summaryScreen); - } - - NNS_G2dSetupSoftwareSpriteCamera(); - sub_02007768(summaryScreen->monSprite.spriteManager); - - G3_SwapBuffers(GX_SORTMODE_MANUAL, GX_BUFFERMODE_Z); -} - -void PokemonSummaryScreen_FreeCameraAndSpriteData(PokemonSummaryScreen *summaryScreen) -{ - Camera_Delete(summaryScreen->monSprite.camera); - sub_02016114(summaryScreen->monSprite.animationSys, 0); - sub_02015FB8(summaryScreen->monSprite.animationSys); - sub_02007B6C(summaryScreen->monSprite.spriteManager); -} - -void sub_020917E0(PokemonSummaryScreen *param0) -{ - VecFx32 v0 = { 0, 0, 0x10000 }; - CameraAngle v1 = { 0, 0, 0 }; - fx32 v2 = 0x10000; - u16 v3 = 0x5c1; - - param0->monSprite.camera = Camera_Alloc(19); - - Camera_InitWithPosition(&v0, v2, &v1, v3, 1, param0->monSprite.camera); - Camera_SetClipping(0, FX32_CONST(100), param0->monSprite.camera); - Camera_ReleaseTarget(param0->monSprite.camera); - Camera_SetAsActive(param0->monSprite.camera); -} - -static void sub_02091850(UnkStruct_02091850 *param0) -{ - G3_PolygonAttr(GX_LIGHTMASK_NONE, GX_POLYGONMODE_MODULATE, GX_CULL_NONE, 18, 20, 0); - G3_Begin(GX_BEGIN_QUADS); - - { - u32 v0; - - for (v0 = 0; v0 < 4; v0++) { - G3_Color(GX_RGB(8, 31, 15)); - G3_Vtx(param0[v0].unk_00.x, param0[v0].unk_00.y, param0[v0].unk_00.z); - G3_Color(GX_RGB(8, 31, 15)); - G3_Vtx(param0[v0].unk_06.x, param0[v0].unk_06.y, param0[v0].unk_06.z); - G3_Color(GX_RGB(8, 31, 15)); - G3_Vtx(param0[v0].unk_12.x, param0[v0].unk_12.y, param0[v0].unk_12.z); - G3_Color(GX_RGB(8, 31, 15)); - G3_Vtx(param0[v0].unk_0C.x, param0[v0].unk_0C.y, param0[v0].unk_0C.z); - } - } - - G3_End(); -} - -static void sub_020918CC(VecFx16 *param0, VecFx16 *param1) -{ - param0->x += param1->x; - param0->y += param1->y; - param0->z += param1->z; -} - -static void sub_020918EC(PokemonSummaryScreen *param0) -{ - u32 v0; - - if (param0->unk_410 == 4) { - sub_0208FCD4(param0); - return; - } - - if (param0->unk_410 == 3) { - for (v0 = 0; v0 < 4; v0++) { - param0->unk_2F0[v0] = param0->unk_3B0[v0]; - } - } else { - for (v0 = 0; v0 < 4; v0++) { - sub_020918CC(¶m0->unk_2F0[v0].unk_00, ¶m0->unk_350[v0].unk_00); - sub_020918CC(¶m0->unk_2F0[v0].unk_06, ¶m0->unk_350[v0].unk_06); - sub_020918CC(¶m0->unk_2F0[v0].unk_0C, ¶m0->unk_350[v0].unk_0C); - sub_020918CC(¶m0->unk_2F0[v0].unk_12, ¶m0->unk_350[v0].unk_12); - } - } - - param0->unk_410++; - - if (param0->unk_410 == 4) { - sub_0208FB54(param0, 1); - } else { - sub_0208FB54(param0, 0); - } -} - -void sub_020919E8(PokemonSummaryScreen *param0) -{ - u32 v0; - - if (param0->page != 4) { - return; - } - - param0->unk_2F0[0].unk_00 = Unk_020F4FFC[0][3].unk_06; - param0->unk_2F0[0].unk_06 = Unk_020F4FFC[0][3].unk_06; - param0->unk_2F0[0].unk_0C = Unk_020F4FFC[0][3].unk_06; - param0->unk_2F0[0].unk_12 = Unk_020F4FFC[0][3].unk_06; - - param0->unk_2F0[1].unk_00 = Unk_020F4FFC[1][2].unk_06; - param0->unk_2F0[1].unk_06 = Unk_020F4FFC[1][2].unk_06; - param0->unk_2F0[1].unk_0C = Unk_020F4FFC[1][2].unk_06; - param0->unk_2F0[1].unk_12 = Unk_020F4FFC[1][2].unk_06; - - param0->unk_2F0[2].unk_00 = Unk_020F4FFC[2][1].unk_06; - param0->unk_2F0[2].unk_06 = Unk_020F4FFC[2][1].unk_06; - param0->unk_2F0[2].unk_0C = Unk_020F4FFC[2][1].unk_06; - param0->unk_2F0[2].unk_12 = Unk_020F4FFC[2][1].unk_06; - - param0->unk_2F0[3].unk_00 = Unk_020F4FFC[3][0].unk_06; - param0->unk_2F0[3].unk_06 = Unk_020F4FFC[3][0].unk_06; - param0->unk_2F0[3].unk_0C = Unk_020F4FFC[3][0].unk_06; - param0->unk_2F0[3].unk_12 = Unk_020F4FFC[3][0].unk_06; - - sub_02091D50(param0); -} - -static void sub_02091B78(const UnkStruct_02091B78 *param0, VecFx16 *param1, u8 param2) -{ - if (param2 == 0xff) { - *param1 = param0->unk_00; - } else if (param2 == 0) { - *param1 = param0->unk_06; - } else { - param1->x = param0->unk_06.x + param0->unk_0C.x * param2; - param1->y = param0->unk_06.y + param0->unk_0C.y * param2; - param1->z = param0->unk_06.z + param0->unk_0C.z * param2; - } -} - -static void sub_02091BD4(VecFx16 *param0, VecFx16 *param1, VecFx16 *param2) -{ - param2->x = FX_F32_TO_FX16(FX_FX16_TO_F32(param1->x - param0->x) / 4); - param2->y = FX_F32_TO_FX16(FX_FX16_TO_F32(param1->y - param0->y) / 4); - param2->z = FX_F32_TO_FX16(FX_FX16_TO_F32(param1->z - param0->z) / 4); -} - -void sub_02091D50(PokemonSummaryScreen *param0) -{ - u32 v0; - - sub_02091B78(&Unk_020F4FFC[0][0], ¶m0->unk_3B0[0].unk_00, param0->monData.cool); - sub_02091B78(&Unk_020F4FFC[0][1], ¶m0->unk_3B0[0].unk_06, param0->monData.beauty); - sub_02091B78(&Unk_020F4FFC[0][2], ¶m0->unk_3B0[0].unk_12, param0->monData.cute); - sub_02091B78(&Unk_020F4FFC[0][3], ¶m0->unk_3B0[0].unk_0C, 0); - - sub_02091B78(&Unk_020F4FFC[1][0], ¶m0->unk_3B0[1].unk_00, param0->monData.tough); - sub_02091B78(&Unk_020F4FFC[1][1], ¶m0->unk_3B0[1].unk_06, param0->monData.cool); - sub_02091B78(&Unk_020F4FFC[1][2], ¶m0->unk_3B0[1].unk_12, 0); - sub_02091B78(&Unk_020F4FFC[1][3], ¶m0->unk_3B0[1].unk_0C, param0->monData.smart); - - sub_02091B78(&Unk_020F4FFC[2][0], ¶m0->unk_3B0[2].unk_00, param0->monData.tough); - sub_02091B78(&Unk_020F4FFC[2][1], ¶m0->unk_3B0[2].unk_06, 0); - sub_02091B78(&Unk_020F4FFC[2][2], ¶m0->unk_3B0[2].unk_12, param0->monData.cute); - sub_02091B78(&Unk_020F4FFC[2][3], ¶m0->unk_3B0[2].unk_0C, param0->monData.smart); - - sub_02091B78(&Unk_020F4FFC[3][0], ¶m0->unk_3B0[3].unk_00, 0); - sub_02091B78(&Unk_020F4FFC[3][1], ¶m0->unk_3B0[3].unk_06, param0->monData.beauty); - sub_02091B78(&Unk_020F4FFC[3][2], ¶m0->unk_3B0[3].unk_12, param0->monData.cute); - sub_02091B78(&Unk_020F4FFC[3][3], ¶m0->unk_3B0[3].unk_0C, param0->monData.smart); - - for (v0 = 0; v0 < 4; v0++) { - sub_02091BD4(¶m0->unk_2F0[v0].unk_00, ¶m0->unk_3B0[v0].unk_00, ¶m0->unk_350[v0].unk_00); - sub_02091BD4(¶m0->unk_2F0[v0].unk_06, ¶m0->unk_3B0[v0].unk_06, ¶m0->unk_350[v0].unk_06); - sub_02091BD4(¶m0->unk_2F0[v0].unk_0C, ¶m0->unk_3B0[v0].unk_0C, ¶m0->unk_350[v0].unk_0C); - sub_02091BD4(¶m0->unk_2F0[v0].unk_12, ¶m0->unk_3B0[v0].unk_12, ¶m0->unk_350[v0].unk_12); - } - - param0->unk_410 = 0; -} - -void sub_02091F8C(PokemonSummaryScreen *param0) -{ - ArchivedSprite v0; - void *v1; - - param0->monSprite.spriteManager = sub_0200762C(19); - - v1 = PokemonSummaryScreen_MonData(param0); - - if (param0->data->dataType == 2) { - BoxPokemon_BuildArchivedSprite(&v0, v1, 2, 0); - } else { - Pokemon_BuildArchivedSprite(&v0, v1, 2); - } - - PokeSprite_LoadAnimationFrames(param0->narcPlPokeData, param0->monSprite.frames, param0->monData.species, 1); - - param0->monSprite.flip = PokemonPersonalData_GetFormValue(param0->monData.species, param0->monData.form, 28) ^ 1; - param0->monSprite.sprite = sub_02007C34(param0->monSprite.spriteManager, &v0, 52, 104, 0, 0, param0->monSprite.frames, NULL); - - sub_02007DEC(param0->monSprite.sprite, 35, param0->monSprite.flip); -} - -void PokemonSummaryScreen_LoadMonAnimation(PokemonSummaryScreen *summaryScreen) -{ - if (summaryScreen->monData.isEgg != FALSE) { - PokeSprite_LoadAnimation(summaryScreen->narcPlPokeData, summaryScreen->monSprite.animationSys, summaryScreen->monSprite.sprite, 0, 2, summaryScreen->monSprite.flip, 0); - } else { - sub_02007B98(summaryScreen->monSprite.sprite, 1); - PokeSprite_LoadAnimation(summaryScreen->narcPlPokeData, summaryScreen->monSprite.animationSys, summaryScreen->monSprite.sprite, summaryScreen->monData.species, 2, summaryScreen->monSprite.flip, 0); - } -} - -void sub_02092098(PokemonSummaryScreen *param0) -{ - sub_02016114(param0->monSprite.animationSys, 0); - sub_02007B6C(param0->monSprite.spriteManager); - sub_02091F8C(param0); - PokemonSummaryScreen_LoadMonAnimation(param0); -} diff --git a/src/unk_020989DC.c b/src/unk_020989DC.c index 78ba105286..79307245de 100644 --- a/src/unk_020989DC.c +++ b/src/unk_020989DC.c @@ -343,21 +343,20 @@ static int sub_02098CB0(UnkStruct_02098BE4 *param0) static int sub_02098D38(UnkStruct_02098BE4 *param0) { - PokemonSummary *v0; - u8 v1; + PokemonSummary *summaryScreen; if (!sub_02098AF8(¶m0->unk_14)) { return 3; } - v0 = (PokemonSummary *)param0->unk_10; - v1 = v0->returnMode; + summaryScreen = (PokemonSummary *)param0->unk_10; + u8 returnMode = summaryScreen->returnMode; - param0->unk_08 = v0->pos; + param0->unk_08 = summaryScreen->pos; Heap_FreeToHeap(param0->unk_10); - if (v1 == 1) { + if (returnMode == SUMMARY_RETURN_CANCEL) { return 0; }