diff options
Diffstat (limited to 'include')
-rw-r--r-- | include/bike.h | 10 | ||||
-rw-r--r-- | include/constants/battle_anim.h | 6 | ||||
-rw-r--r-- | include/constants/battle_frontier.h | 49 | ||||
-rw-r--r-- | include/constants/battle_move_effects.h | 2 | ||||
-rwxr-xr-x | include/constants/event_object_movement.h | 81 | ||||
-rw-r--r-- | include/constants/global.h | 15 | ||||
-rw-r--r-- | include/constants/items.h | 2 | ||||
-rw-r--r-- | include/constants/metatile_labels.h | 1 | ||||
-rw-r--r-- | include/daycare.h | 9 | ||||
-rwxr-xr-x | include/ereader_helpers.h | 28 | ||||
-rw-r--r-- | include/event_object_movement.h | 2 | ||||
-rw-r--r-- | include/field_player_avatar.h | 10 | ||||
-rw-r--r-- | include/global.fieldmap.h | 21 | ||||
-rw-r--r-- | include/global.h | 94 | ||||
-rw-r--r-- | include/graphics.h | 60 | ||||
-rw-r--r-- | include/link.h | 7 | ||||
-rw-r--r-- | include/mail.h | 10 | ||||
-rw-r--r-- | include/main.h | 1 | ||||
-rw-r--r-- | include/menu.h | 3 | ||||
-rw-r--r-- | include/record_mixing.h | 4 | ||||
-rw-r--r-- | include/trade.h | 6 |
21 files changed, 259 insertions, 162 deletions
diff --git a/include/bike.h b/include/bike.h index 893b0b19e..afe773d42 100644 --- a/include/bike.h +++ b/include/bike.h @@ -17,11 +17,11 @@ struct BikeHistoryInputInfo // Player speeds enum { - SPEED_STANDING, - SPEED_NORMAL, - SPEED_FAST, - SPEED_FASTER, - SPEED_FASTEST, + BIKE_SPEED_STANDING, + BIKE_SPEED_NORMAL, + BIKE_SPEED_FAST, + BIKE_SPEED_FASTER, + BIKE_SPEED_FASTEST, }; // mach bike transitions enum diff --git a/include/constants/battle_anim.h b/include/constants/battle_anim.h index 48de594e2..2ff9318be 100644 --- a/include/constants/battle_anim.h +++ b/include/constants/battle_anim.h @@ -342,9 +342,9 @@ #define BG_FISSURE 21 #define BG_BUG_OPPONENT 22 #define BG_BUG_PLAYER 23 -#define BG_SOLARBEAM_OPPONENT 24 -#define BG_SOLARBEAM_PLAYER 25 -#define BG_SOLARBEAM_CONTESTS 26 +#define BG_SOLAR_BEAM_OPPONENT 24 +#define BG_SOLAR_BEAM_PLAYER 25 +#define BG_SOLAR_BEAM_CONTESTS 26 // table ids for general animations (gBattleAnims_General) #define B_ANIM_CASTFORM_CHANGE 0 diff --git a/include/constants/battle_frontier.h b/include/constants/battle_frontier.h index 68c5a42ef..b6d15e6b2 100644 --- a/include/constants/battle_frontier.h +++ b/include/constants/battle_frontier.h @@ -17,11 +17,6 @@ #define FACILITY_UNION_ROOM 8 #define FACILITY_MULTI_OR_EREADER 9 // Direct Corner multi battles, multi battle with Steven, and e-Reader battles -// Battle Frontier lvl modes. -#define FRONTIER_LVL_50 0 -#define FRONTIER_LVL_OPEN 1 -#define FRONTIER_LVL_TENT 2 - // Battle Frontier battle modes. #define FRONTIER_MODE_SINGLES 0 #define FRONTIER_MODE_DOUBLES 1 @@ -53,28 +48,28 @@ // These sets of facility ids would be redundant if the order was consistent // The order is important for this set so that all the non-link records can be continuous -#define RANKING_HALL_BATTLE_TOWER_SINGLES 0 -#define RANKING_HALL_BATTLE_TOWER_DOUBLES 1 -#define RANKING_HALL_BATTLE_TOWER_MULTIS 2 -#define RANKING_HALL_BATTLE_DOME 3 -#define RANKING_HALL_BATTLE_PALACE 4 -#define RANKING_HALL_BATTLE_ARENA 5 -#define RANKING_HALL_BATTLE_FACTORY 6 -#define RANKING_HALL_BATTLE_PIKE 7 -#define RANKING_HALL_BATTLE_PYRAMID 8 -#define RANKING_HALL_BATTLE_TOWER_LINK 9 - -#define FRONTIER_MANIAC_BATTLE_TOWER_SINGLES 0 -#define FRONTIER_MANIAC_BATTLE_TOWER_DOUBLES 1 -#define FRONTIER_MANIAC_BATTLE_TOWER_MULTIS 2 -#define FRONTIER_MANIAC_BATTLE_TOWER_LINK 3 -#define FRONTIER_MANIAC_BATTLE_DOME 4 -#define FRONTIER_MANIAC_BATTLE_FACTORY 5 -#define FRONTIER_MANIAC_BATTLE_PALACE 6 -#define FRONTIER_MANIAC_BATTLE_ARENA 7 -#define FRONTIER_MANIAC_BATTLE_PIKE 8 -#define FRONTIER_MANIAC_BATTLE_PYRAMID 9 -#define FRONTIER_MANIAC_FACILITY_COUNT 10 +#define RANKING_HALL_TOWER_SINGLES 0 +#define RANKING_HALL_TOWER_DOUBLES 1 +#define RANKING_HALL_TOWER_MULTIS 2 +#define RANKING_HALL_DOME 3 +#define RANKING_HALL_PALACE 4 +#define RANKING_HALL_ARENA 5 +#define RANKING_HALL_FACTORY 6 +#define RANKING_HALL_PIKE 7 +#define RANKING_HALL_PYRAMID 8 +#define RANKING_HALL_TOWER_LINK 9 + +#define FRONTIER_MANIAC_TOWER_SINGLES 0 +#define FRONTIER_MANIAC_TOWER_DOUBLES 1 +#define FRONTIER_MANIAC_TOWER_MULTIS 2 +#define FRONTIER_MANIAC_TOWER_LINK 3 +#define FRONTIER_MANIAC_DOME 4 +#define FRONTIER_MANIAC_FACTORY 5 +#define FRONTIER_MANIAC_PALACE 6 +#define FRONTIER_MANIAC_ARENA 7 +#define FRONTIER_MANIAC_PIKE 8 +#define FRONTIER_MANIAC_PYRAMID 9 +#define FRONTIER_MANIAC_FACILITY_COUNT 10 #define FRONTIER_MANIAC_MESSAGE_COUNT 3 diff --git a/include/constants/battle_move_effects.h b/include/constants/battle_move_effects.h index cc62208fa..c4f79efc3 100644 --- a/include/constants/battle_move_effects.h +++ b/include/constants/battle_move_effects.h @@ -152,7 +152,7 @@ #define EFFECT_FUTURE_SIGHT 148 #define EFFECT_GUST 149 #define EFFECT_FLINCH_MINIMIZE_HIT 150 // STOMP ASTONISH EXTRASENSORY NEEDLE_ARM -#define EFFECT_SOLARBEAM 151 +#define EFFECT_SOLAR_BEAM 151 #define EFFECT_THUNDER 152 #define EFFECT_TELEPORT 153 #define EFFECT_BEAT_UP 154 diff --git a/include/constants/event_object_movement.h b/include/constants/event_object_movement.h index 13e91c415..e7238b56e 100755 --- a/include/constants/event_object_movement.h +++ b/include/constants/event_object_movement.h @@ -128,10 +128,10 @@ #define MOVEMENT_ACTION_RIDE_WATER_CURRENT_UP 0x2A #define MOVEMENT_ACTION_RIDE_WATER_CURRENT_LEFT 0x2B #define MOVEMENT_ACTION_RIDE_WATER_CURRENT_RIGHT 0x2C -#define MOVEMENT_ACTION_WALK_FASTEST_DOWN 0x2D -#define MOVEMENT_ACTION_WALK_FASTEST_UP 0x2E -#define MOVEMENT_ACTION_WALK_FASTEST_LEFT 0x2F -#define MOVEMENT_ACTION_WALK_FASTEST_RIGHT 0x30 +#define MOVEMENT_ACTION_WALK_FASTER_DOWN 0x2D +#define MOVEMENT_ACTION_WALK_FASTER_UP 0x2E +#define MOVEMENT_ACTION_WALK_FASTER_LEFT 0x2F +#define MOVEMENT_ACTION_WALK_FASTER_RIGHT 0x30 #define MOVEMENT_ACTION_SLIDE_DOWN 0x31 #define MOVEMENT_ACTION_SLIDE_UP 0x32 #define MOVEMENT_ACTION_SLIDE_LEFT 0x33 @@ -245,4 +245,77 @@ #define MOVEMENT_ACTION_STEP_END 0xFE #define MOVEMENT_ACTION_NONE 0xFF +#define ANIM_STD_FACE_SOUTH 0 +#define ANIM_STD_FACE_NORTH 1 +#define ANIM_STD_FACE_WEST 2 +#define ANIM_STD_FACE_EAST 3 +#define ANIM_STD_GO_SOUTH 4 +#define ANIM_STD_GO_NORTH 5 +#define ANIM_STD_GO_WEST 6 +#define ANIM_STD_GO_EAST 7 +#define ANIM_STD_GO_FAST_SOUTH 8 +#define ANIM_STD_GO_FAST_NORTH 9 +#define ANIM_STD_GO_FAST_WEST 10 +#define ANIM_STD_GO_FAST_EAST 11 +#define ANIM_STD_GO_FASTER_SOUTH 12 +#define ANIM_STD_GO_FASTER_NORTH 13 +#define ANIM_STD_GO_FASTER_WEST 14 +#define ANIM_STD_GO_FASTER_EAST 15 +#define ANIM_STD_GO_FASTEST_SOUTH 16 +#define ANIM_STD_GO_FASTEST_NORTH 17 +#define ANIM_STD_GO_FASTEST_WEST 18 +#define ANIM_STD_GO_FASTEST_EAST 19 +#define ANIM_STD_COUNT 20 + +#define ANIM_RUN_SOUTH (ANIM_STD_COUNT + 0) +#define ANIM_RUN_NORTH (ANIM_STD_COUNT + 1) +#define ANIM_RUN_WEST (ANIM_STD_COUNT + 2) +#define ANIM_RUN_EAST (ANIM_STD_COUNT + 3) + +#define ANIM_BUNNY_HOPPY_BACK_WHEEL_SOUTH (ANIM_STD_COUNT + 0) +#define ANIM_BUNNY_HOPPY_BACK_WHEEL_NORTH (ANIM_STD_COUNT + 1) +#define ANIM_BUNNY_HOPPY_BACK_WHEEL_WEST (ANIM_STD_COUNT + 2) +#define ANIM_BUNNY_HOPPY_BACK_WHEEL_EAST (ANIM_STD_COUNT + 3) +#define ANIM_BUNNY_HOPPY_FRONT_WHEEL_SOUTH (ANIM_STD_COUNT + 4) +#define ANIM_BUNNY_HOPPY_FRONT_WHEEL_NORTH (ANIM_STD_COUNT + 5) +#define ANIM_BUNNY_HOPPY_FRONT_WHEEL_WEST (ANIM_STD_COUNT + 6) +#define ANIM_BUNNY_HOPPY_FRONT_WHEEL_EAST (ANIM_STD_COUNT + 7) +#define ANIM_STANDING_WHEELIE_BACK_WHEEL_SOUTH (ANIM_STD_COUNT + 8) +#define ANIM_STANDING_WHEELIE_BACK_WHEEL_NORTH (ANIM_STD_COUNT + 9) +#define ANIM_STANDING_WHEELIE_BACK_WHEEL_WEST (ANIM_STD_COUNT + 10) +#define ANIM_STANDING_WHEELIE_BACK_WHEEL_EAST (ANIM_STD_COUNT + 11) +#define ANIM_STANDING_WHEELIE_FRONT_WHEEL_SOUTH (ANIM_STD_COUNT + 12) +#define ANIM_STANDING_WHEELIE_FRONT_WHEEL_NORTH (ANIM_STD_COUNT + 13) +#define ANIM_STANDING_WHEELIE_FRONT_WHEEL_WEST (ANIM_STD_COUNT + 14) +#define ANIM_STANDING_WHEELIE_FRONT_WHEEL_EAST (ANIM_STD_COUNT + 15) +#define ANIM_MOVING_WHEELIE_SOUTH (ANIM_STD_COUNT + 16) +#define ANIM_MOVING_WHEELIE_NORTH (ANIM_STD_COUNT + 17) +#define ANIM_MOVING_WHEELIE_WEST (ANIM_STD_COUNT + 18) +#define ANIM_MOVING_WHEELIE_EAST (ANIM_STD_COUNT + 19) + +#define ANIM_GET_ON_OFF_POKEMON_SOUTH (ANIM_STD_COUNT + 0) +#define ANIM_GET_ON_OFF_POKEMON_NORTH (ANIM_STD_COUNT + 1) +#define ANIM_GET_ON_OFF_POKEMON_WEST (ANIM_STD_COUNT + 2) +#define ANIM_GET_ON_OFF_POKEMON_EAST (ANIM_STD_COUNT + 3) + +#define ANIM_NURSE_BOW (ANIM_STD_COUNT + 0) + +#define ANIM_FIELD_MOVE 0 + +#define ANIM_STAY_STILL 0 +#define ANIM_REMOVE_OBSTACLE 1 + +#define ANIM_TAKE_OUT_ROD_SOUTH 0 +#define ANIM_TAKE_OUT_ROD_NORTH 1 +#define ANIM_TAKE_OUT_ROD_WEST 2 +#define ANIM_TAKE_OUT_ROD_EAST 3 +#define ANIM_PUT_AWAY_ROD_SOUTH 4 +#define ANIM_PUT_AWAY_ROD_NORTH 5 +#define ANIM_PUT_AWAY_ROD_WEST 6 +#define ANIM_PUT_AWAY_ROD_EAST 7 +#define ANIM_HOOKED_POKEMON_SOUTH 8 +#define ANIM_HOOKED_POKEMON_NORTH 9 +#define ANIM_HOOKED_POKEMON_WEST 10 +#define ANIM_HOOKED_POKEMON_EAST 11 + #endif // GUARD_CONSTANTS_EVENT_OBJECT_MOVEMENT_H diff --git a/include/constants/global.h b/include/constants/global.h index bd73d7999..ef7861e9e 100644 --- a/include/constants/global.h +++ b/include/constants/global.h @@ -53,9 +53,20 @@ #define UNION_ROOM_KB_ROW_COUNT 10 #define GIFT_RIBBONS_COUNT 11 #define SAVED_TRENDS_COUNT 5 - #define PYRAMID_BAG_ITEMS_COUNT 10 -#define HALL_FACILITIES_COUNT 9 // 7 facilities for single mode + tower double mode + tower multi mode. + +// Number of facilities for Ranking Hall. +// 7 facilities for single mode + tower double mode + tower multi mode. +// Excludes link modes. See RANKING_HALL_* in include/constants/battle_frontier.h +#define HALL_FACILITIES_COUNT 9 +// Received via record mixing, 1 for each player other than yourself +#define HALL_RECORDS_COUNT 3 + +// Battle Frontier level modes. +#define FRONTIER_LVL_50 0 +#define FRONTIER_LVL_OPEN 1 +#define FRONTIER_LVL_MODE_COUNT 2 +#define FRONTIER_LVL_TENT FRONTIER_LVL_MODE_COUNT // Special usage for indicating Battle Tent #define TRAINER_ID_LENGTH 4 #define MAX_MON_MOVES 4 diff --git a/include/constants/items.h b/include/constants/items.h index c596dd3b8..e9d889cfa 100644 --- a/include/constants/items.h +++ b/include/constants/items.h @@ -402,7 +402,7 @@ #define ITEM_TM19_GIGA_DRAIN ITEM_TM19 #define ITEM_TM20_SAFEGUARD ITEM_TM20 #define ITEM_TM21_FRUSTRATION ITEM_TM21 -#define ITEM_TM22_SOLARBEAM ITEM_TM22 +#define ITEM_TM22_SOLAR_BEAM ITEM_TM22 #define ITEM_TM23_IRON_TAIL ITEM_TM23 #define ITEM_TM24_THUNDERBOLT ITEM_TM24 #define ITEM_TM25_THUNDER ITEM_TM25 diff --git a/include/constants/metatile_labels.h b/include/constants/metatile_labels.h index b4ee3eacf..519120082 100644 --- a/include/constants/metatile_labels.h +++ b/include/constants/metatile_labels.h @@ -352,6 +352,7 @@ #define METATILE_InsideShip_IntactDoor_Bottom_Interior 0x297 // gTileset_BattlePike +#define METATILE_BattlePike_CurtainFrames_Start 0x201 #define METATILE_BattlePike_Curtain_Stage0_Tile0 0x24A #define METATILE_BattlePike_Curtain_Stage0_Tile1 0x251 #define METATILE_BattlePike_Curtain_Stage0_Tile2 0x252 diff --git a/include/daycare.h b/include/daycare.h index d6c0d4201..62a7918ff 100644 --- a/include/daycare.h +++ b/include/daycare.h @@ -3,10 +3,17 @@ #include "constants/daycare.h" +struct RecordMixingDaycareMail +{ + struct DaycareMail mail[DAYCARE_MON_COUNT]; + u32 numDaycareMons; + bool16 cantHoldItem[DAYCARE_MON_COUNT]; +}; + u8 *GetMonNickname2(struct Pokemon *mon, u8 *dest); u8 *GetBoxMonNickname(struct BoxPokemon *mon, u8 *dest); u8 CountPokemonInDaycare(struct DayCare *daycare); -void InitDaycareMailRecordMixing(struct DayCare *daycare, struct RecordMixingDaycareMail *daycareMail); +void InitDaycareMailRecordMixing(struct DayCare *daycare, struct RecordMixingDaycareMail *mixMail); void StoreSelectedPokemonInDaycare(void); u16 TakePokemonFromDaycare(void); void GetDaycareCost(void); diff --git a/include/ereader_helpers.h b/include/ereader_helpers.h index 064b61ed7..8bf3dc43b 100755 --- a/include/ereader_helpers.h +++ b/include/ereader_helpers.h @@ -3,6 +3,34 @@ #include "trainer_hill.h" +enum { + EREADER_XFR_STATE_INIT = 0, + EREADER_XFR_STATE_HANDSHAKE, + EREADER_XFR_STATE_START, + EREADER_XFR_STATE_TRANSFER, + EREADER_XFR_STATE_TRANSFER_DONE, + EREADER_XFR_STATE_CHECKSUM, + EREADER_XFR_STATE_DONE +}; + +#define EREADER_XFER_EXE 1 +#define EREADER_XFER_CHK 2 +#define EREADER_XFER_SHIFT 0 +#define EREADER_XFER_MASK ((EREADER_XFER_EXE | EREADER_XFER_CHK) << EREADER_XFER_SHIFT) + +#define EREADER_CANCEL_TIMEOUT 1 +#define EREADER_CANCEL_KEY 2 +#define EREADER_CANCEL_SHIFT 2 +#define EREADER_CANCEL_TIMEOUT_MASK (EREADER_CANCEL_TIMEOUT << EREADER_CANCEL_SHIFT) +#define EREADER_CANCEL_KEY_MASK (EREADER_CANCEL_KEY << EREADER_CANCEL_SHIFT) +#define EREADER_CANCEL_MASK ((EREADER_CANCEL_TIMEOUT | EREADER_CANCEL_KEY) << EREADER_CANCEL_SHIFT) + +#define EREADER_CHECKSUM_OK 1 +#define EREADER_CHECKSUM_ERR 2 +#define EREADER_CHECKSUM_SHIFT 4 +#define EREADER_CHECKSUM_OK_MASK (EREADER_CHECKSUM_OK << EREADER_CHECKSUM_SHIFT) +#define EREADER_CHECKSUM_MASK ((EREADER_CHECKSUM_OK | EREADER_CHECKSUM_ERR) << EREADER_CHECKSUM_SHIFT) + struct EReaderTrainerHillTrainer { u8 trainerNum; diff --git a/include/event_object_movement.h b/include/event_object_movement.h index a935502e6..11dac813d 100644 --- a/include/event_object_movement.h +++ b/include/event_object_movement.h @@ -136,7 +136,7 @@ u8 GetFaceDirectionMovementAction(u32); u8 GetWalkNormalMovementAction(u32); u8 GetWalkFastMovementAction(u32); u8 GetRideWaterCurrentMovementAction(u32); -u8 GetWalkFastestMovementAction(u32); +u8 GetWalkFasterMovementAction(u32); u8 GetPlayerRunMovementAction(u32); u8 GetJumpInPlaceMovementAction(u32); u8 GetAcroWheelieFaceDirectionMovementAction(u32); diff --git a/include/field_player_avatar.h b/include/field_player_avatar.h index 903fe6ef1..823564f22 100644 --- a/include/field_player_avatar.h +++ b/include/field_player_avatar.h @@ -11,10 +11,10 @@ void PlayerGetDestCoords(s16 *, s16 *); u8 GetPlayerFacingDirection(void); u8 GetPlayerMovementDirection(void); u8 PlayerGetCopyableMovement(void); -void PlayerGoSpeed1(u8); -void PlayerGoSpeed2(u8); +void PlayerWalkNormal(u8); +void PlayerWalkFast(u8); void PlayerRideWaterCurrent(u8); -void PlayerGoSpeed4(u8); +void PlayerWalkFaster(u8); void PlayerOnBikeCollide(u8); void PlayerFaceDirection(u8 a); void PlayerTurnInPlace(u8 a); @@ -32,10 +32,10 @@ void PlayerOnBikeCollideWithFarawayIslandMew(u8 direction); u8 CheckForObjectEventCollision(struct ObjectEvent *a, s16 b, s16 c, u8 d, u8 e); u8 PlayerGetZCoord(void); void SetPlayerAvatarTransitionFlags(u16 a); -void sub_808BCE8(void); +void CancelPlayerForcedMovement(void); void InitPlayerAvatar(s16 a, s16 b, u8 c, u8 d); void PlayerFreeze(void); -void sub_808BCF4(void); +void StopPlayerAvatar(void); void SetSpinStartFacingDir(u8); void GetXYCoordsOneStepInFrontOfPlayer(s16 *xPtr, s16 *yPtr); u8 GetRivalAvatarGraphicsIdByStateIdAndGender(u8, u8); diff --git a/include/global.fieldmap.h b/include/global.fieldmap.h index 41b8539ff..71ccd7068 100644 --- a/include/global.fieldmap.h +++ b/include/global.fieldmap.h @@ -11,6 +11,11 @@ #define METATILE_ID(tileset, name) (METATILE_##tileset##_##name) +// Rows of metatiles do not actually have a strict width. +// This constant is used for calculations for finding the next row of metatiles +// for constructing large tiles, such as the Battle Pike's curtain tile. +#define METATILE_ROW_WIDTH 8 + enum { CONNECTION_INVALID = -1, @@ -241,14 +246,14 @@ enum { PLAYER_AVATAR_STATE_WATERING, }; -#define PLAYER_AVATAR_FLAG_ON_FOOT (1 << 0) -#define PLAYER_AVATAR_FLAG_MACH_BIKE (1 << 1) -#define PLAYER_AVATAR_FLAG_ACRO_BIKE (1 << 2) -#define PLAYER_AVATAR_FLAG_SURFING (1 << 3) -#define PLAYER_AVATAR_FLAG_UNDERWATER (1 << 4) -#define PLAYER_AVATAR_FLAG_5 (1 << 5) -#define PLAYER_AVATAR_FLAG_FORCED_MOVE (1 << 6) -#define PLAYER_AVATAR_FLAG_DASH (1 << 7) +#define PLAYER_AVATAR_FLAG_ON_FOOT (1 << 0) +#define PLAYER_AVATAR_FLAG_MACH_BIKE (1 << 1) +#define PLAYER_AVATAR_FLAG_ACRO_BIKE (1 << 2) +#define PLAYER_AVATAR_FLAG_SURFING (1 << 3) +#define PLAYER_AVATAR_FLAG_UNDERWATER (1 << 4) +#define PLAYER_AVATAR_FLAG_CONTROLLABLE (1 << 5) +#define PLAYER_AVATAR_FLAG_FORCED_MOVE (1 << 6) +#define PLAYER_AVATAR_FLAG_DASH (1 << 7) enum { diff --git a/include/global.h b/include/global.h index 03b023024..dd02a1790 100644 --- a/include/global.h +++ b/include/global.h @@ -207,11 +207,10 @@ struct BerryPickingResults u8 field_F; }; -// two arrays for lvl50 and open level struct PyramidBag { - u16 itemId[2][PYRAMID_BAG_ITEMS_COUNT]; - u8 quantity[2][PYRAMID_BAG_ITEMS_COUNT]; + u16 itemId[FRONTIER_LVL_MODE_COUNT][PYRAMID_BAG_ITEMS_COUNT]; + u8 quantity[FRONTIER_LVL_MODE_COUNT][PYRAMID_BAG_ITEMS_COUNT]; }; struct BerryCrush @@ -352,8 +351,8 @@ struct BattleFrontier /*0xCB2*/ u16 curChallengeBattleNum; // Battle number / room number (Pike) / floor number (Pyramid) /*0xCB4*/ u16 trainerIds[20]; /*0xCDC*/ u32 winStreakActiveFlags; - /*0xCE0*/ u16 towerWinStreaks[4][2]; - /*0xCF0*/ u16 towerRecordWinStreaks[4][2]; + /*0xCE0*/ u16 towerWinStreaks[4][FRONTIER_LVL_MODE_COUNT]; + /*0xCF0*/ u16 towerRecordWinStreaks[4][FRONTIER_LVL_MODE_COUNT]; /*0xD00*/ u16 battledBrainFlags; /*0xD02*/ u16 towerSinglesStreak; // Never read /*0xD04*/ u16 towerNumWins; // Increments to MAX_STREAK but never read otherwise @@ -370,33 +369,33 @@ struct BattleFrontier /*0xD09*/ u8 domeUnused; /*0xD0A*/ u8 domeLvlMode; /*0xD0B*/ u8 domeBattleMode; - /*0xD0C*/ u16 domeWinStreaks[2][2]; - /*0xD14*/ u16 domeRecordWinStreaks[2][2]; - /*0xD1C*/ u16 domeTotalChampionships[2][2]; + /*0xD0C*/ u16 domeWinStreaks[2][FRONTIER_LVL_MODE_COUNT]; + /*0xD14*/ u16 domeRecordWinStreaks[2][FRONTIER_LVL_MODE_COUNT]; + /*0xD1C*/ u16 domeTotalChampionships[2][FRONTIER_LVL_MODE_COUNT]; /*0xD24*/ struct BattleDomeTrainer domeTrainers[DOME_TOURNAMENT_TRAINERS_COUNT]; /*0xD64*/ u16 domeMonIds[DOME_TOURNAMENT_TRAINERS_COUNT][FRONTIER_PARTY_SIZE]; /*0xDC4*/ u16 unused_DC4; /*0xDC6*/ u16 palacePrize; - /*0xDC8*/ u16 palaceWinStreaks[2][2]; - /*0xDD0*/ u16 palaceRecordWinStreaks[2][2]; + /*0xDC8*/ u16 palaceWinStreaks[2][FRONTIER_LVL_MODE_COUNT]; + /*0xDD0*/ u16 palaceRecordWinStreaks[2][FRONTIER_LVL_MODE_COUNT]; /*0xDD8*/ u16 arenaPrize; - /*0xDDA*/ u16 arenaWinStreaks[2]; - /*0xDDE*/ u16 arenaRecordStreaks[2]; - /*0xDE2*/ u16 factoryWinStreaks[2][2]; - /*0xDEA*/ u16 factoryRecordWinStreaks[2][2]; - /*0xDF6*/ u16 factoryRentsCount[2][2]; - /*0xDFA*/ u16 factoryRecordRentsCount[2][2]; + /*0xDDA*/ u16 arenaWinStreaks[FRONTIER_LVL_MODE_COUNT]; + /*0xDDE*/ u16 arenaRecordStreaks[FRONTIER_LVL_MODE_COUNT]; + /*0xDE2*/ u16 factoryWinStreaks[2][FRONTIER_LVL_MODE_COUNT]; + /*0xDEA*/ u16 factoryRecordWinStreaks[2][FRONTIER_LVL_MODE_COUNT]; + /*0xDF6*/ u16 factoryRentsCount[2][FRONTIER_LVL_MODE_COUNT]; + /*0xDFA*/ u16 factoryRecordRentsCount[2][FRONTIER_LVL_MODE_COUNT]; /*0xE02*/ u16 pikePrize; - /*0xE04*/ u16 pikeWinStreaks[2]; - /*0xE08*/ u16 pikeRecordStreaks[2]; - /*0xE0C*/ u16 pikeTotalStreaks[2]; + /*0xE04*/ u16 pikeWinStreaks[FRONTIER_LVL_MODE_COUNT]; + /*0xE08*/ u16 pikeRecordStreaks[FRONTIER_LVL_MODE_COUNT]; + /*0xE0C*/ u16 pikeTotalStreaks[FRONTIER_LVL_MODE_COUNT]; /*0xE10*/ u8 pikeHintedRoomIndex:3; /*0xE10*/ u8 pikeHintedRoomType:4; /*0xE10*/ u8 pikeHealingRoomsDisabled:1; /*0xE12*/ u16 pikeHeldItemsBackup[FRONTIER_PARTY_SIZE]; /*0xE18*/ u16 pyramidPrize; - /*0xE1A*/ u16 pyramidWinStreaks[2]; - /*0xE1E*/ u16 pyramidRecordStreaks[2]; + /*0xE1A*/ u16 pyramidWinStreaks[FRONTIER_LVL_MODE_COUNT]; + /*0xE1E*/ u16 pyramidRecordStreaks[FRONTIER_LVL_MODE_COUNT]; /*0xE22*/ u16 pyramidRandoms[4]; /*0xE2A*/ u8 pyramidTrainerFlags; /*0xE2C*/ struct PyramidBag pyramidBag; @@ -410,8 +409,8 @@ struct BattleFrontier /*0xEBC*/ u32 battlesCount; /*0xEC0*/ u16 domeWinningMoves[DOME_TOURNAMENT_TRAINERS_COUNT]; /*0xEE0*/ u8 trainerFlags; - /*0xEE1*/ u8 opponentNames[2][PLAYER_NAME_LENGTH + 1]; - /*0xEF1*/ u8 opponentTrainerIds[2][TRAINER_ID_LENGTH]; + /*0xEE1*/ u8 opponentNames[FRONTIER_LVL_MODE_COUNT][PLAYER_NAME_LENGTH + 1]; + /*0xEF1*/ u8 opponentTrainerIds[FRONTIER_LVL_MODE_COUNT][TRAINER_ID_LENGTH]; /*0xEF9*/ u8 unk_EF9:7; // Never read /*0xEF9*/ u8 savedGame:1; /*0xEFA*/ u8 unused_EFA; @@ -487,8 +486,8 @@ struct SaveBlock2 /*0x1EC*/ struct BerryCrush berryCrush; /*0x1FC*/ struct PokemonJumpRecords pokeJump; /*0x20C*/ struct BerryPickingResults berryPick; - /*0x21C*/ struct RankingHall1P hallRecords1P[HALL_FACILITIES_COUNT][2][3]; // From record mixing. - /*0x57C*/ struct RankingHall2P hallRecords2P[2][3]; // From record mixing. + /*0x21C*/ struct RankingHall1P hallRecords1P[HALL_FACILITIES_COUNT][FRONTIER_LVL_MODE_COUNT][HALL_RECORDS_COUNT]; // From record mixing. + /*0x57C*/ struct RankingHall2P hallRecords2P[FRONTIER_LVL_MODE_COUNT][HALL_RECORDS_COUNT]; // From record mixing. /*0x624*/ u16 contestLinkResults[CONTEST_CATEGORIES_COUNT][CONTESTANT_COUNT]; /*0x64C*/ struct BattleFrontier frontier; }; // sizeof=0xF2C @@ -596,15 +595,6 @@ struct DewfordTrend u16 words[2]; }; /*size = 0x8*/ -struct MailStruct -{ - /*0x00*/ u16 words[MAIL_WORDS_COUNT]; - /*0x12*/ u8 playerName[PLAYER_NAME_LENGTH + 1]; - /*0x1A*/ u8 trainerId[TRAINER_ID_LENGTH]; - /*0x1E*/ u16 species; - /*0x20*/ u16 itemId; -}; - struct MauvilleManCommon { u8 id; @@ -670,20 +660,6 @@ typedef union OldMan u8 filler[0x40]; } OldMan; -struct RecordMixing_UnknownStructSub -{ - u32 unk0; - u8 data[0x34]; - //u8 data[0x38]; -}; - -struct RecordMixing_UnknownStruct -{ - struct RecordMixing_UnknownStructSub data[2]; - u32 unk70; - u16 unk74[0x2]; -}; - #define LINK_B_RECORDS_COUNT 5 struct LinkBattleRecord @@ -726,10 +702,19 @@ struct ContestWinner u8 contestRank; }; +struct Mail +{ + /*0x00*/ u16 words[MAIL_WORDS_COUNT]; + /*0x12*/ u8 playerName[PLAYER_NAME_LENGTH + 1]; + /*0x1A*/ u8 trainerId[TRAINER_ID_LENGTH]; + /*0x1E*/ u16 species; + /*0x20*/ u16 itemId; +}; + struct DaycareMail { - struct MailStruct message; - u8 OT_name[PLAYER_NAME_LENGTH + 1]; + struct Mail message; + u8 otName[PLAYER_NAME_LENGTH + 1]; u8 monName[POKEMON_NAME_LENGTH + 1]; u8 gameLanguage:4; u8 monLanguage:4; @@ -749,13 +734,6 @@ struct DayCare u8 stepCounter; }; -struct RecordMixingDaycareMail -{ - struct DaycareMail mail[DAYCARE_MON_COUNT]; - u32 numDaycareMons; - bool16 holdsItem[DAYCARE_MON_COUNT]; -}; - struct LilycoveLadyQuiz { /*0x000*/ u8 id; @@ -1002,7 +980,7 @@ struct SaveBlock1 /*0x2BBC*/ u16 easyChatBattleStart[EASY_CHAT_BATTLE_WORDS_COUNT]; /*0x2BC8*/ u16 easyChatBattleWon[EASY_CHAT_BATTLE_WORDS_COUNT]; /*0x2BD4*/ u16 easyChatBattleLost[EASY_CHAT_BATTLE_WORDS_COUNT]; - /*0x2BE0*/ struct MailStruct mail[MAIL_COUNT]; + /*0x2BE0*/ struct Mail mail[MAIL_COUNT]; /*0x2E20*/ u8 additionalPhrases[8]; // bitfield for 33 additional phrases in easy chat system /*0x2E28*/ OldMan oldMan; /*0x2e64*/ struct DewfordTrend dewfordTrends[SAVED_TRENDS_COUNT]; diff --git a/include/graphics.h b/include/graphics.h index dcb47a226..a58b0f0f1 100644 --- a/include/graphics.h +++ b/include/graphics.h @@ -3208,12 +3208,12 @@ extern const u16 gBerryFixWindow_Pal[]; extern const u32 gBattleTextboxTiles[]; extern const u32 gBattleTextboxTilemap[]; extern const u32 gBattleTextboxPalette[]; -extern const u32 gUnknown_08D778F0[]; extern const u32 gVsLettersGfx[]; -extern const u32 gUnknown_08D77AE4[]; -extern const u32 gUnknown_08D779D8[]; -extern const u32 gUnknown_08D857A8[]; -extern const u32 gUnknown_08D85A1C[]; +extern const u32 gBattleVSFrame_Gfx[]; +extern const u32 gBattleVSFrame_Pal[]; +extern const u32 gBattleVSFrame_Tilemap[]; +extern const u32 gMultiBattleIntroBg_Opponent_Tilemap[]; +extern const u32 gMultiBattleIntroBg_Player_Tilemap[]; // battle terrains extern const u32 gBattleTerrainTiles_TallGrass[]; @@ -4032,16 +4032,16 @@ extern const u16 gPokenavRibbonsSummaryBg_Pal[]; extern const u32 gPokenavRibbonsSummaryBg_Gfx[]; extern const u32 gPokenavRibbonsSummaryBg_Tilemap[]; -extern const u32 gPageInfoTilemap[]; -extern const u32 gUnknown_08D98CC8[]; -extern const u32 gPageSkillsTilemap[]; -extern const u32 gPageBattleMovesTilemap[]; -extern const u32 gPageContestMovesTilemap[]; -extern const u32 gStatusScreenPalette[]; -extern const u16 gUnknown_08D85620[]; +extern const u32 gSummaryScreen_Gfx[]; +extern const u32 gSummaryScreen_Pal[]; +extern const u32 gSummaryPage_Info_Tilemap[]; +extern const u32 gSummaryPage_InfoCopy_Tilemap[]; +extern const u32 gSummaryPage_Skills_Tilemap[]; +extern const u32 gSummaryPage_BattleMoves_Tilemap[]; +extern const u32 gSummaryPage_ContestMoves_Tilemap[]; +extern const u16 gPPTextPalette[]; extern const u16 gSummaryScreenWindow_Tilemap[]; extern const u32 gMoveTypes_Pal[]; -extern const u32 gStatusScreenBitmap[]; extern const u16 gSummaryScreenPowAcc_Tilemap[]; extern const u16 gSummaryScreenAppealJam_Tilemap[]; @@ -4081,7 +4081,7 @@ extern const u32 gPokeblockFeedBg_Tilemap[]; extern const u32 gConfetti_Gfx[]; extern const u32 gConfetti_Pal[]; -extern const u32 gUnknown_08C093F0[]; +extern const u32 gBattleInterfaceGfx_BattleBar[]; extern const u32 gSubstituteDollBackGfx[]; extern const u32 gSubstituteDollFrontGfx[]; extern const u32 gSubstituteDollPal[]; @@ -4097,17 +4097,19 @@ extern const u16 gBattleInterface_BallDisplayPal[]; extern const u32 gBagSwapLineGfx[]; extern const u32 gBagSwapLinePal[]; -extern const u32 gBattleFrontierGfx_PyramidBag[]; -extern const u32 gBattleFrontierGfx_PyramidBag_Pal[]; -extern const u32 gBattleFrontierGfx_PyramidBagTileMap[]; -extern const u32 gUnknown_08D9AF44[]; -extern const u16 gUnknown_0860F074[]; +extern const u32 gBattlePyramidBag_Gfx[]; +extern const u32 gBattlePyramidBag_Pal[]; +extern const u32 gBattlePyramidBagTilemap[]; +extern const u32 gBattlePyramidBagInterface_Pal[]; +extern const u16 gBattlePyramidFloor_Pal[][16]; + +extern const u16 gStandardMenuPalette[]; extern const u32 gTitleScreenEmeraldVersionGfx[]; extern const u32 gTitleScreenPressStartGfx[]; extern const u32 gTitleScreenPokemonLogoGfx[]; -extern const u32 gUnknown_08DE0644[]; -extern const u32 gUnknown_08DDE458[]; +extern const u32 gTitleScreenPokemonLogoTilemap[]; +extern const u32 gTitleScreenCloudsTilemap[]; extern const u16 gTitleScreenBgPalettes[]; extern const u16 gTitleScreenPressStartPal[]; extern const u16 gTitleScreenEmeraldVersionPal[]; @@ -4731,7 +4733,7 @@ extern const u32 gBattleAnimBgPalette_Sky[]; extern const u32 gBattleAnimBgPalette_Aurora[]; extern const u32 gBattleAnimBgPalette_Fissure[]; extern const u32 gBattleAnimBgPalette_Bug[]; -extern const u32 gBattleAnimBgPalette_Solarbeam[]; +extern const u32 gBattleAnimBgPalette_SolarBeam[]; extern const u32 gBattleAnimBgTilemap_Dark[]; extern const u32 gBattleAnimBgTilemap_Ghost[]; extern const u32 gBattleAnimBgTilemap_Psychic[]; @@ -4773,15 +4775,15 @@ extern const u32 gBattleStatMask6_Pal[]; extern const u32 gBattleStatMask7_Pal[]; extern const u32 gBattleStatMask8_Pal[]; -extern const u32 gContestMiscGfx[]; +extern const u32 gContestInterfaceGfx[]; extern const u32 gContestAudienceGfx[]; extern const u8 gContestApplauseMeterGfx[]; extern const u8 gContestNextTurnNumbersGfx[]; extern const u8 gContestNextTurnRandomGfx[]; -extern const u32 gOldContestGfx[]; -extern const u32 gOldContestPalette[]; -extern const u32 gUnknown_08C17170[]; -extern const u32 gUnknown_08C17980[]; +extern const u32 gContestAudienceTilemap[]; +extern const u32 gContestInterfaceAudiencePalette[]; +extern const u32 gContestInterfaceTilemap[]; +extern const u32 gContestCurtainTilemap[]; extern const u32 gContestSliderHeart_Gfx[]; extern const u32 gContestNextTurnGfx[]; extern const u16 gContestPal[]; @@ -4789,7 +4791,7 @@ extern const u32 gContestFaces_Gfx[]; extern const u32 gContestApplauseGfx[]; extern const u32 gContestJudgeGfx[]; extern const u32 gContestJudgeSymbolsGfx[]; -extern const u32 gContest3Pal[]; +extern const u32 gContestJudgeSymbolsPal[]; extern const u32 gBattleAnimBgTilemap_SurfOpponent[]; extern const u32 gBattleAnimBgTilemap_SurfPlayer[]; @@ -4899,7 +4901,7 @@ extern const u16 gCableCar_Pal[]; // Trade extern const u16 gTradeMenu_Pal[]; extern const u8 gTradeMenu_Gfx[]; -extern const u16 gUnknown_08DDCF04[]; +extern const u16 gTradeMenu_Tilemap[]; extern const u16 gTradeGba2_Pal[]; extern const u8 gTradeGba_Gfx[]; extern const u16 gTradeMenuMonBox_Tilemap[]; diff --git a/include/link.h b/include/link.h index 4e0491356..6061745af 100644 --- a/include/link.h +++ b/include/link.h @@ -124,8 +124,9 @@ struct LinkStatus u32 errors:7; }; -#define MASTER_HANDSHAKE 0x8FFF -#define SLAVE_HANDSHAKE 0xB9A0 +#define MASTER_HANDSHAKE 0x8FFF +#define SLAVE_HANDSHAKE 0xB9A0 +#define EREADER_HANDSHAKE 0xCCD0 #define SIO_MULTI_CNT ((struct SioMultiCnt *)REG_ADDR_SIOCNT) @@ -208,7 +209,7 @@ struct Link /* 0x001 */ u8 state; /* 0x002 */ u8 localId; // local multi-player ID /* 0x003 */ u8 playerCount; - /* 0x004 */ u16 tempRecvBuffer[4]; + /* 0x004 */ u16 handshakeBuffer[MAX_LINK_PLAYERS]; /* 0x00c */ bool8 receivedNothing; /* 0x00d */ s8 serialIntrCounter; /* 0x00e */ bool8 handshakeAsMaster; diff --git a/include/mail.h b/include/mail.h index 042586653..8236811cb 100644 --- a/include/mail.h +++ b/include/mail.h @@ -15,16 +15,16 @@ || itemId == ITEM_RETRO_MAIL)) // mail.h -void ReadMail(struct MailStruct *mail, void (*callback)(void), bool8 flag); +void ReadMail(struct Mail *mail, void (*callback)(void), bool8 flag); // mail_data.h -void ClearMailData(void); -void ClearMailStruct(struct MailStruct *mail); +void ClearAllMail(void); +void ClearMail(struct Mail *mail); bool8 MonHasMail(struct Pokemon *mon); -u8 GiveMailToMon(struct Pokemon *mon, u16 itemId); +u8 GiveMailToMonByItemId(struct Pokemon *mon, u16 itemId); u16 SpeciesToMailSpecies(u16 species, u32 personality); u16 MailSpeciesToSpecies(u16 mailSpecies, u16 *buffer); -u8 GiveMailToMon2(struct Pokemon *mon, struct MailStruct *mail); +u8 GiveMailToMon(struct Pokemon *mon, struct Mail *mail); void TakeMailFromMon(struct Pokemon *mon); void ClearMailItemId(u8 mailId); u8 TakeMailFromMon2(struct Pokemon *mon); diff --git a/include/main.h b/include/main.h index 79d56d31f..5ccb20df8 100644 --- a/include/main.h +++ b/include/main.h @@ -72,6 +72,5 @@ void RestoreSerialTimer3IntrHandlers(void); void StartTimer1(void); void SeedRngAndSetTrainerId(void); u16 GetGeneratedTrainerIdLower(void); -void sub_819789C(void); #endif // GUARD_MAIN_H diff --git a/include/menu.h b/include/menu.h index 07e00eb73..eb391e565 100644 --- a/include/menu.h +++ b/include/menu.h @@ -41,7 +41,7 @@ struct MenuAction } func; }; -extern const u16 gUnknown_0860F074[]; +extern const u16 gStandardMenuPalette[]; void FreeAllOverworldWindowBuffers(void); void InitStandardTextBoxWindows(void); @@ -125,5 +125,6 @@ void ResetBgPositions(void); void AddTextPrinterWithCustomSpeedForMessage(bool8 allowSkippingDelayWithButtonPress, u8 speed); void sub_8198C78(void); void PrintTextArray(u8 windowId, u8 fontId, u8 left, u8 top, u8 lineHeight, u8 itemCount, const struct MenuAction *strs); +void Menu_LoadStdPal(void); #endif // GUARD_MENU_H diff --git a/include/record_mixing.h b/include/record_mixing.h index 4cd231e8a..fec4952b8 100644 --- a/include/record_mixing.h +++ b/include/record_mixing.h @@ -3,8 +3,8 @@ struct PlayerHallRecords { - struct RankingHall1P onePlayer[9][2]; - struct RankingHall2P twoPlayers[2]; + struct RankingHall1P onePlayer[HALL_FACILITIES_COUNT][FRONTIER_LVL_MODE_COUNT]; + struct RankingHall2P twoPlayers[FRONTIER_LVL_MODE_COUNT]; }; void RecordMixingPlayerSpotTriggered(void); diff --git a/include/trade.h b/include/trade.h index 05a905ab3..a0cb320a8 100644 --- a/include/trade.h +++ b/include/trade.h @@ -4,13 +4,9 @@ #include "link_rfu.h" #include "constants/trade.h" -// Exported type declarations - -// Exported RAM declarations -extern struct MailStruct gTradeMail[PARTY_SIZE]; +extern struct Mail gTradeMail[PARTY_SIZE]; extern u8 gSelectedTradeMonPositions[2]; -// Exported ROM declarations extern const struct WindowTemplate gTradeEvolutionSceneYesNoWindowTemplate; s32 GetGameProgressForLinkTrade(void); |