diff options
Diffstat (limited to 'include')
30 files changed, 682 insertions, 109 deletions
| diff --git a/include/battle_message.h b/include/battle_message.h index 5d811fe69..88ccbb90f 100644 --- a/include/battle_message.h +++ b/include/battle_message.h @@ -154,7 +154,7 @@  {                                                               \      textVar[0] = B_BUFF_PLACEHOLDER_BEGIN;                      \      textVar[1] = B_BUFF_MOVE;                                   \ -    textVar[2] = move;                                          \ +    textVar[2] = (move & 0xFF);                                 \      textVar[3] = (move & 0xFF00) >> 8;                          \      textVar[4] = B_BUFF_EOS;                                    \  } diff --git a/include/berry_crush.h b/include/berry_crush.h index 101450a33..8909ae821 100755 --- a/include/berry_crush.h +++ b/include/berry_crush.h @@ -1,6 +1,8 @@  #ifndef GUARD_BERRY_CRUSH_H  #define GUARD_BERRY_CRUSH_H +#include "main.h" +  void sub_8020C70(MainCallback callback);  #endif // GUARD_BERRY_CRUSH_H diff --git a/include/constants/flags.h b/include/constants/flags.h index 732c68764..7aa5c3ed3 100644 --- a/include/constants/flags.h +++ b/include/constants/flags.h @@ -725,7 +725,7 @@  #define FLAG_HIDE_ROUTE_111_VICTORIA_WINSTRATE                      0x301  #define FLAG_HIDE_ROUTE_111_VIVI_WINSTRATE                          0x302  #define FLAG_HIDE_ROUTE_111_VICKY_WINSTRATE                         0x303 -#define FLAG_HIDE_PETALYBURG_GYM_NORMAN                             0x304 +#define FLAG_HIDE_PETALBURG_GYM_NORMAN                              0x304  #define FLAG_HIDE_SKY_PILLAR_TOP_RAYQUAZA_2                         0x305  #define FLAG_HIDE_LILYCOVE_CONTEST_HALL_CONTEST_ATTENDANT_1         0x306  #define FLAG_HIDE_LILYCOVE_MUSEUM_CURATOR                           0x307 diff --git a/include/constants/map_scripts.h b/include/constants/map_scripts.h index d5fd40156..26de3ebc6 100644 --- a/include/constants/map_scripts.h +++ b/include/constants/map_scripts.h @@ -9,4 +9,4 @@  #define MAP_SCRIPT_ON_DIVE_WARP 6  #define MAP_SCRIPT_ON_RETURN_TO_FIELD 7 -#endif // GUARD_CONSTANTS_MAP_SCRIPTS_H
\ No newline at end of file +#endif // GUARD_CONSTANTS_MAP_SCRIPTS_H diff --git a/include/constants/metatile_labels.h b/include/constants/metatile_labels.h new file mode 100644 index 000000000..8fe95b464 --- /dev/null +++ b/include/constants/metatile_labels.h @@ -0,0 +1,413 @@ +#ifndef GUARD_METATILE_LABELS_H +#define GUARD_METATILE_LABELS_H + +// gTileset_General +#define METATILE_General_Grass               0x001 +#define METATILE_General_TallGrass           0x00D +#define METATILE_General_LongGrass           0x015 +#define METATILE_General_TallGrass_TreeUp    0x025 +#define METATILE_General_Grass_TreeUp        0x00E +#define METATILE_General_TallGrass_TreeLeft  0x1C6 +#define METATILE_General_TallGrass_TreeRight 0x1C7 +#define METATILE_General_Grass_TreeLeft      0x1CE +#define METATILE_General_Grass_TreeRight     0x1CF +#define METATILE_General_MuddySlope_Frame0   0x0E8 +#define METATILE_General_MuddySlope_Frame1   0x0E9 +#define METATILE_General_MuddySlope_Frame2   0x0EA +#define METATILE_General_MuddySlope_Frame3   0x0EB +#define METATILE_General_SandPit_Center      0x121 +#define METATILE_General_CaveEntrance_Top    0x09F +#define METATILE_General_CaveEntrance_Bottom 0x0A7 +#define METATILE_General_RockWall_GrassBase  0x079 +#define METATILE_General_RockWall_RockBase   0x07C +#define METATILE_General_RockWall_SandBase   0x091 +#define METATILE_General_CalmWater           0x170 +#define METATILE_General_RoughWater          0x14E +#define METATILE_General_RoughDeepWater      0x14F +#define METATILE_General_ReflectiveWater     0x0A1 + +// gTileset_Building +#define METATILE_Building_PC_Off 0x004 +#define METATILE_Building_PC_On  0x005 + +// gTileset_MauvilleGym +#define METATILE_MauvilleGym_RaisedSwitch    0x205 +#define METATILE_MauvilleGym_PressedSwitch   0x206 +#define METATILE_MauvilleGym_FloorTile       0x21A +#define METATILE_MauvilleGym_GreenBeamH1_On  0x220 +#define METATILE_MauvilleGym_GreenBeamH2_On  0x221 +#define METATILE_MauvilleGym_GreenBeamH3_On  0x228 +#define METATILE_MauvilleGym_GreenBeamH4_On  0x229 +#define METATILE_MauvilleGym_GreenBeamH1_Off 0x230 +#define METATILE_MauvilleGym_GreenBeamH2_Off 0x231 +#define METATILE_MauvilleGym_GreenBeamH3_Off 0x238 +#define METATILE_MauvilleGym_GreenBeamH4_Off 0x239 +#define METATILE_MauvilleGym_RedBeamH1_On    0x222 +#define METATILE_MauvilleGym_RedBeamH2_On    0x223 +#define METATILE_MauvilleGym_RedBeamH3_On    0x22A +#define METATILE_MauvilleGym_RedBeamH4_On    0x22B +#define METATILE_MauvilleGym_RedBeamH1_Off   0x232 +#define METATILE_MauvilleGym_RedBeamH2_Off   0x233 +#define METATILE_MauvilleGym_RedBeamH3_Off   0x23A +#define METATILE_MauvilleGym_RedBeamH4_Off   0x23B +#define METATILE_MauvilleGym_GreenBeamV1_On  0x240 +#define METATILE_MauvilleGym_GreenBeamV2_On  0x248 +#define METATILE_MauvilleGym_RedBeamV1_On    0x241 +#define METATILE_MauvilleGym_RedBeamV2_On    0x249 +#define METATILE_MauvilleGym_PoleTop_On      0x250 +#define METATILE_MauvilleGym_PoleTop_Off     0x251 +#define METATILE_MauvilleGym_PoleBottom_On   0x242 +#define METATILE_MauvilleGym_PoleBottom_Off  0x243 + +// gTileset_PetalburgGym +#define METATILE_PetalburgGym_RoomEntrance_Left  0x210 +#define METATILE_PetalburgGym_RoomEntrance_Right 0x211 +#define METATILE_PetalburgGym_SlidingDoor_Frame0 0x218 +#define METATILE_PetalburgGym_SlidingDoor_Frame1 0x219 +#define METATILE_PetalburgGym_SlidingDoor_Frame2 0x21A +#define METATILE_PetalburgGym_SlidingDoor_Frame3 0x21B +#define METATILE_PetalburgGym_SlidingDoor_Frame4 0x21C + +// gTileset_MossdeepGym +#define METATILE_MossdeepGym_Obelisk_Top           0x204 +#define METATILE_MossdeepGym_Obelisk_Base          0x20C +#define METATILE_MossdeepGym_Wall_LeftCorner       0x20D +#define METATILE_MossdeepGym_OuterWall_RightCorner 0x205 +#define METATILE_MossdeepGym_Empty0                0x238 +#define METATILE_MossdeepGym_Empty1                0x239 + +// gTileset_BrendansMaysHouse +#define METATILE_BrendansMaysHouse_BrendanPC_Off    0x25A +#define METATILE_BrendansMaysHouse_BrendanPC_On     0x27F +#define METATILE_BrendansMaysHouse_MayPC_Off        0x259 +#define METATILE_BrendansMaysHouse_MayPC_On         0x27E +#define METATILE_BrendansMaysHouse_MovingBox_Closed 0x268 +#define METATILE_BrendansMaysHouse_MovingBox_Open   0x270 +#define METATILE_BrendansMaysHouse_BookOnTable      0x293 + +// gTileset_Shop +#define METATILE_Shop_Laptop1_Normal 0x29D +#define METATILE_Shop_Laptop2_Normal 0x2A5 +#define METATILE_Shop_Laptop1_Flash  0x258 +#define METATILE_Shop_Laptop2_Flash  0x260 + +// gTileset_BattleFrontier +#define METATILE_BattleFrontier_CorridorOpenDoor_Top    0x207 +#define METATILE_BattleFrontier_CorridorOpenDoor_Bottom 0x20F +#define METATILE_BattleFrontier_Elevator_Top0           0x329 +#define METATILE_BattleFrontier_Elevator_Top1           0x32A +#define METATILE_BattleFrontier_Elevator_Top2           0x32B +#define METATILE_BattleFrontier_Elevator_Mid0           0x331 +#define METATILE_BattleFrontier_Elevator_Mid1           0x332 +#define METATILE_BattleFrontier_Elevator_Mid2           0x333 +#define METATILE_BattleFrontier_Elevator_Bottom0        0x339 +#define METATILE_BattleFrontier_Elevator_Bottom1        0x33A +#define METATILE_BattleFrontier_Elevator_Bottom2        0x33B + +// gTileset_Cave +#define METATILE_Cave_EntranceCover                     0x229 +#define METATILE_Cave_SealedChamberEntrance_TopLeft     0x22A +#define METATILE_Cave_SealedChamberEntrance_TopMid      0x22B +#define METATILE_Cave_SealedChamberEntrance_TopRight    0x22C +#define METATILE_Cave_SealedChamberEntrance_BottomLeft  0x232 +#define METATILE_Cave_SealedChamberEntrance_BottomMid   0x233 +#define METATILE_Cave_SealedChamberEntrance_BottomRight 0x234 +#define METATILE_Cave_SealedChamberBraille_Mid          0x235 +#define METATILE_Cave_ShoalCave_DirtPile_Large          0x358 +#define METATILE_Cave_ShoalCave_DirtPile_Small          0x35A +#define METATILE_Cave_ShoalCave_BlueStone_Large         0x359 +#define METATILE_Cave_ShoalCave_BlueStone_Small         0x35B + +// gTileset_Pacifidlog +#define METATILE_Pacifidlog_FloatingLogs_Horizontal0      0x250 +#define METATILE_Pacifidlog_FloatingLogs_Horizontal1      0x251 +#define METATILE_Pacifidlog_HalfSubmergedLogs_Horizontal0 0x252 +#define METATILE_Pacifidlog_HalfSubmergedLogs_Horizontal1 0x253 +#define METATILE_Pacifidlog_SubmergedLogs_Horizontal0     0x254 +#define METATILE_Pacifidlog_SubmergedLogs_Horizontal1     0x255 +#define METATILE_Pacifidlog_FloatingLogs_Vertical0        0x258 +#define METATILE_Pacifidlog_FloatingLogs_Vertical1        0x260 +#define METATILE_Pacifidlog_HalfSubmergedLogs_Vertical0   0x259 +#define METATILE_Pacifidlog_HalfSubmergedLogs_Vertical1   0x261 +#define METATILE_Pacifidlog_SubmergedLogs_Vertical0       0x25A +#define METATILE_Pacifidlog_SubmergedLogs_Vertical1       0x262 +#define METATILE_Pacifidlog_SkyPillar_DoorOpen_Top        0x2AA +#define METATILE_Pacifidlog_SkyPillar_DoorOpen_Bottom     0x2B2 + +// gTileset_Fortree +#define METATILE_Fortree_LongGrass_Root                   0x208 +#define METATILE_Fortree_BridgeOverGrass_Raised           0x24E +#define METATILE_Fortree_BridgeOverGrass_Lowered          0x24F +#define METATILE_Fortree_BridgeOverTrees_Raised           0x256 +#define METATILE_Fortree_BridgeOverTrees_Lowered          0x257 +#define METATILE_Fortree_SecretBase_LongGrass_TopLeft     0x279 +#define METATILE_Fortree_SecretBase_LongGrass_TopMid      0x27A +#define METATILE_Fortree_SecretBase_LongGrass_TopRight    0x27B +#define METATILE_Fortree_SecretBase_LongGrass_BottomLeft  0x281 +#define METATILE_Fortree_SecretBase_LongGrass_BottomMid   0x282 +#define METATILE_Fortree_SecretBase_LongGrass_BottomRight 0x283 +#define METATILE_Fortree_WoodBridge_Kecleon0              0x297 +#define METATILE_Fortree_WoodBridge_Kecleon1              0x29F + +// gTileset_Sootopolis +#define METATILE_Sootopolis_Door_Closed    0x248 +#define METATILE_Sootopolis_GymDoor_Closed 0x250 +#define METATILE_Sootopolis_RoughWater     0x290 + +// gTileset_SootopolisGym +#define METATILE_SootopolisGym_Ice_Cracked 0x20E +#define METATILE_SootopolisGym_Ice_Broken  0x206 +#define METATILE_SootopolisGym_Stairs      0x207 + +// gTileset_Fallarbor +#define METATILE_Fallarbor_AshGrass                 0x20A +#define METATILE_Fallarbor_NormalGrass              0x212 +#define METATILE_Fallarbor_AshField                 0x218 +#define METATILE_Fallarbor_BrownCaveEntrance_Top    0x259 +#define METATILE_Fallarbor_BrownCaveEntrance_Bottom 0x261 +#define METATILE_Fallarbor_RedCaveEntrance_Top      0x347 +#define METATILE_Fallarbor_RedCaveEntrance_Bottom   0x34F +#define METATILE_Fallarbor_BrownRockWall            0x265 +#define METATILE_Fallarbor_RedRockWall              0x269 + +// gTileset_Lavaridge +#define METATILE_Lavaridge_NormalGrass         0x206 +#define METATILE_Lavaridge_AshGrass            0x207 +#define METATILE_Lavaridge_LavaField           0x271 +#define METATILE_Lavaridge_RockWall            0x274 +#define METATILE_Lavaridge_CaveEntrance_Top    0x256 +#define METATILE_Lavaridge_CaveEntrance_Bottom 0x25E + +// gTileset_Mauville +#define METATILE_Mauville_DeepSand_Center    0x251 +#define METATILE_Mauville_DeepSand_BottomMid 0x259 +#define METATILE_Mauville_MirageTower_Tile0  0x3D8 +#define METATILE_Mauville_MirageTower_Tile1  0x3D9 +#define METATILE_Mauville_MirageTower_Tile2  0x3DA +#define METATILE_Mauville_MirageTower_Tile3  0x3E0 +#define METATILE_Mauville_MirageTower_Tile4  0x3E1 +#define METATILE_Mauville_MirageTower_Tile5  0x3E2 +#define METATILE_Mauville_MirageTower_Tile6  0x3E8 +#define METATILE_Mauville_MirageTower_Tile7  0x3E9 +#define METATILE_Mauville_MirageTower_Tile8  0x3EA +#define METATILE_Mauville_MirageTower_Tile9  0x3F0 +#define METATILE_Mauville_MirageTower_TileA  0x3F1 +#define METATILE_Mauville_MirageTower_TileB  0x3F2 +#define METATILE_Mauville_MirageTower_TileC  0x3DB +#define METATILE_Mauville_MirageTower_TileD  0x3DC +#define METATILE_Mauville_MirageTower_TileE  0x3DD +#define METATILE_Mauville_MirageTower_TileF  0x3E3 +#define METATILE_Mauville_MirageTower_Tile10 0x3E4 +#define METATILE_Mauville_MirageTower_Tile11 0x3E5 + +// gTileset_PokemonCenter +#define METATILE_PokemonCenter_Elevator1F_Tile0_Frame0 0x280 +#define METATILE_PokemonCenter_Elevator1F_Tile0_Frame1 0x282 +#define METATILE_PokemonCenter_Elevator1F_Tile0_Frame2 0x284 +#define METATILE_PokemonCenter_Elevator1F_Tile1_Frame0 0x281 +#define METATILE_PokemonCenter_Elevator1F_Tile1_Frame1 0x283 +#define METATILE_PokemonCenter_Elevator1F_Tile1_Frame2 0x285 +#define METATILE_PokemonCenter_Elevator1F_Tile2_Frame0 0x288 +#define METATILE_PokemonCenter_Elevator1F_Tile2_Frame1 0x28A +#define METATILE_PokemonCenter_Elevator1F_Tile2_Frame2 0x28C +#define METATILE_PokemonCenter_Elevator1F_Tile3_Frame0 0x289 +#define METATILE_PokemonCenter_Elevator1F_Tile3_Frame1 0x28B +#define METATILE_PokemonCenter_Elevator1F_Tile3_Frame2 0x28D +#define METATILE_PokemonCenter_Elevator2F_Tile0_Frame0 0x2A0 +#define METATILE_PokemonCenter_Elevator2F_Tile0_Frame1 0x2A2 +#define METATILE_PokemonCenter_Elevator2F_Tile0_Frame2 0x2A4 +#define METATILE_PokemonCenter_Elevator2F_Tile1_Frame0 0x2A1 +#define METATILE_PokemonCenter_Elevator2F_Tile1_Frame1 0x2A3 +#define METATILE_PokemonCenter_Elevator2F_Tile1_Frame2 0x2A5 +#define METATILE_PokemonCenter_Elevator2F_Tile2_Frame0 0x2A8 +#define METATILE_PokemonCenter_Elevator2F_Tile2_Frame1 0x2AA +#define METATILE_PokemonCenter_Elevator2F_Tile2_Frame2 0x2AC +#define METATILE_PokemonCenter_Floor_ShadowTop_Alt     0x2DC +#define METATILE_PokemonCenter_Floor_Plain_Alt         0x2E4 +#define METATILE_PokemonCenter_Floor_ShadowTop         0x21E +#define METATILE_PokemonCenter_CounterBarrier          0x25D + +// gTileset_InsideOfTruck +#define METATILE_InsideOfTruck_ExitLight_Top          0x208 +#define METATILE_InsideOfTruck_ExitLight_Mid          0x210 +#define METATILE_InsideOfTruck_ExitLight_Bottom       0x218 +#define METATILE_InsideOfTruck_DoorClosedFloor_Top    0x20D +#define METATILE_InsideOfTruck_DoorClosedFloor_Mid    0x215 +#define METATILE_InsideOfTruck_DoorClosedFloor_Bottom 0x21D + +// gTileset_MossdeepGameCorner +#define METATILE_MossdeepGameCorner_CounterOpen_Top      0x22C +#define METATILE_MossdeepGameCorner_CounterOpen_Bottom   0x234 +#define METATILE_MossdeepGameCorner_CounterClosed_Top    0x22A +#define METATILE_MossdeepGameCorner_CounterClosed_Bottom 0x232 + +// gTileset_EliteFour +#define METATILE_EliteFour_OpenDoor_Frame           0x344 +#define METATILE_EliteFour_OpenDoor_Opening         0x345 +#define METATILE_EliteFour_OpenDoorChampion_Frame   0x346 +#define METATILE_EliteFour_OpenDoorChampion_Opening 0x347 +#define METATILE_EliteFour_LeftSpotlightOff         0x2DD +#define METATILE_EliteFour_RightSpotlightOff        0x2DE +#define METATILE_EliteFour_EntryDoor_ClosedTop      0x206 +#define METATILE_EliteFour_EntryDoor_ClosedBottom   0x20E + +// gTileset_InsideShip +#define METATILE_InsideShip_InTactDoor0_Bottom 0x233 +#define METATILE_InsideShip_InTactDoor1_Bottom 0x22B +#define METATILE_InsideShip_DoorIndent1        0x21A +#define METATILE_InsideShip_DoorIndent0        0x234 + +// gTileset_BattlePike +#define METATILE_BattlePike_Curtain_Stage0_Tile0 0x24A +#define METATILE_BattlePike_Curtain_Stage0_Tile1 0x251 +#define METATILE_BattlePike_Curtain_Stage0_Tile2 0x252 +#define METATILE_BattlePike_Curtain_Stage0_Tile3 0x253 +#define METATILE_BattlePike_Curtain_Stage0_Tile4 0x259 +#define METATILE_BattlePike_Curtain_Stage0_Tile5 0x25A +#define METATILE_BattlePike_Curtain_Stage0_Tile6 0x25B +#define METATILE_BattlePike_Curtain_Stage1_Tile0 0x22A +#define METATILE_BattlePike_Curtain_Stage1_Tile1 0x231 +#define METATILE_BattlePike_Curtain_Stage1_Tile2 0x232 +#define METATILE_BattlePike_Curtain_Stage1_Tile3 0x233 +#define METATILE_BattlePike_Curtain_Stage1_Tile4 0x239 +#define METATILE_BattlePike_Curtain_Stage1_Tile5 0x23A +#define METATILE_BattlePike_Curtain_Stage1_Tile6 0x23B +#define METATILE_BattlePike_Curtain_Stage2_Tile0 0x20A +#define METATILE_BattlePike_Curtain_Stage2_Tile1 0x211 +#define METATILE_BattlePike_Curtain_Stage2_Tile2 0x212 +#define METATILE_BattlePike_Curtain_Stage2_Tile3 0x213 +#define METATILE_BattlePike_Curtain_Stage2_Tile4 0x219 +#define METATILE_BattlePike_Curtain_Stage2_Tile5 0x21A +#define METATILE_BattlePike_Curtain_Stage2_Tile6 0x21B +#define METATILE_BattlePike_Curtain_Stage3_Tile0 0x2AB +#define METATILE_BattlePike_Curtain_Stage3_Tile1 0x2B2 +#define METATILE_BattlePike_Curtain_Stage3_Tile2 0x2B3 +#define METATILE_BattlePike_Curtain_Stage3_Tile3 0x2B4 +#define METATILE_BattlePike_Curtain_Stage3_Tile4 0x2BA +#define METATILE_BattlePike_Curtain_Stage3_Tile5 0x2BB +#define METATILE_BattlePike_Curtain_Stage3_Tile6 0x2BC + +// gTileset_Lilycove +#define METATILE_Lilycove_Wailmer0     0x290 +#define METATILE_Lilycove_Wailmer1     0x291 +#define METATILE_Lilycove_Wailmer2     0x2A0 +#define METATILE_Lilycove_Wailmer3     0x2A1 +#define METATILE_Lilycove_Wailmer0_Alt 0x298 +#define METATILE_Lilycove_Wailmer1_Alt 0x299 + +// gTileset_Contest +#define METATILE_Contest_WallShadow         0x221 +#define METATILE_Contest_FloorShadow        0x261 +#define METATILE_Contest_CounterFlap_Top    0x2D1 +#define METATILE_Contest_CounterFlap_Bottom 0x2D9 + +// gTileset_LilycoveMuseum +#define METATILE_LilycoveMuseum_Painting0_Left  0x25A +#define METATILE_LilycoveMuseum_Painting0_Right 0x25B +#define METATILE_LilycoveMuseum_Painting1_Left  0x25C +#define METATILE_LilycoveMuseum_Painting1_Right 0x25D +#define METATILE_LilycoveMuseum_Painting2_Left  0x25E +#define METATILE_LilycoveMuseum_Painting2_Right 0x25F +#define METATILE_LilycoveMuseum_Painting3_Left  0x260 +#define METATILE_LilycoveMuseum_Painting3_Right 0x261 +#define METATILE_LilycoveMuseum_Painting4_Left  0x262 +#define METATILE_LilycoveMuseum_Painting4_Right 0x263 + +// gTileset_MeteorFalls +#define METATILE_MeteorFalls_CaveEntrance_Top    0x246 +#define METATILE_MeteorFalls_CaveEntrance_Left   0x24D +#define METATILE_MeteorFalls_CaveEntrance_Bottom 0x24E +#define METATILE_MeteorFalls_CaveEntrance_Right  0x24F + +// gTileset_Facility +#define METATILE_Facility_NewMauvilleDoor_Closed_Tile0 0x314 +#define METATILE_Facility_NewMauvilleDoor_Closed_Tile1 0x315 +#define METATILE_Facility_NewMauvilleDoor_Closed_Tile2 0x316 +#define METATILE_Facility_NewMauvilleDoor_Closed_Tile3 0x31C +#define METATILE_Facility_NewMauvilleDoor_Closed_Tile4 0x31D +#define METATILE_Facility_NewMauvilleDoor_Closed_Tile5 0x31E +#define METATILE_Facility_NewMauvilleDoor_Open_Tile0   0x2C3 +#define METATILE_Facility_NewMauvilleDoor_Open_Tile1   0x2C4 +#define METATILE_Facility_NewMauvilleDoor_Open_Tile2   0x2C5 +#define METATILE_Facility_NewMauvilleDoor_Open_Tile3   0x2CB +#define METATILE_Facility_NewMauvilleDoor_Open_Tile4   0x2CC +#define METATILE_Facility_NewMauvilleDoor_Open_Tile5   0x2CD +#define METATILE_Facility_DataPad                      0x3E4 + +// gTileset_GenericBuilding +#define METATILE_GenericBuilding_TableEdge              0x2F1 +#define METATILE_GenericBuilding_TrickHouse_Door_Closed 0x21B +#define METATILE_GenericBuilding_TrickHouse_Stairs_Down 0x219 + +// gTileset_TrickHousePuzzle +#define METATILE_TrickHousePuzzle_Stairs_Down                0x20B +#define METATILE_TrickHousePuzzle_Lever_Off                  0x23E +#define METATILE_TrickHousePuzzle_Lever_On                   0x23F +#define METATILE_TrickHousePuzzle_Button_Up                  0x258 +#define METATILE_TrickHousePuzzle_Button_Pressed             0x259 +#define METATILE_TrickHousePuzzle_Door_Shuttered             0x26A +#define METATILE_TrickHousePuzzle_Floor_ShadowTop_Alt        0x252 +#define METATILE_TrickHousePuzzle_Floor_ShadowTop            0x255 +#define METATILE_TrickHousePuzzle_BlueDoorH_Open_Tile0       0x24B +#define METATILE_TrickHousePuzzle_BlueDoorH_Open_Tile1       0x24C +#define METATILE_TrickHousePuzzle_BlueDoorH_Open_Tile2       0x253 +#define METATILE_TrickHousePuzzle_BlueDoorH_Open_Tile3       0x254 +#define METATILE_TrickHousePuzzle_BlueDoorH_Closed_Tile0     0x23B +#define METATILE_TrickHousePuzzle_BlueDoorH_Closed_Tile1     0x23C +#define METATILE_TrickHousePuzzle_BlueDoorH_Closed_Tile2     0x243 +#define METATILE_TrickHousePuzzle_BlueDoorH_Closed_Tile3     0x244 +#define METATILE_TrickHousePuzzle_RedDoorH_Open_Tile0        0x248 +#define METATILE_TrickHousePuzzle_RedDoorH_Open_Tile1        0x249 +#define METATILE_TrickHousePuzzle_RedDoorH_Open_Tile2        0x250 +#define METATILE_TrickHousePuzzle_RedDoorH_Open_Tile3        0x251 +#define METATILE_TrickHousePuzzle_RedDoorH_Closed_Tile0      0x238 +#define METATILE_TrickHousePuzzle_RedDoorH_Closed_Tile1      0x239 +#define METATILE_TrickHousePuzzle_RedDoorH_Closed_Tile2      0x240 +#define METATILE_TrickHousePuzzle_RedDoorH_Closed_Tile3      0x241 +#define METATILE_TrickHousePuzzle_BlueDoorV_Retracted        0x24D +#define METATILE_TrickHousePuzzle_RedDoorV_Retracted         0x24A +#define METATILE_TrickHousePuzzle_RedDoorV_Open0             0x23A +#define METATILE_TrickHousePuzzle_RedDoorV_Open1             0x242 +#define METATILE_TrickHousePuzzle_BlueDoorV_Open0            0x23D +#define METATILE_TrickHousePuzzle_BlueDoorV_Open1            0x245 +#define METATILE_TrickHousePuzzle_Arrow_RedOnBlack_Right     0x260 +#define METATILE_TrickHousePuzzle_Arrow_RedOnBlack_Left      0x261 +#define METATILE_TrickHousePuzzle_Arrow_RedOnBlack_Up        0x262 +#define METATILE_TrickHousePuzzle_Arrow_RedOnBlack_Down      0x263 +#define METATILE_TrickHousePuzzle_Arrow_RedOnBlack_Left_Alt  0x27B +#define METATILE_TrickHousePuzzle_Arrow_RedOnBlack_Right_Alt 0x27C + +// gTileset_BikeShop +#define METATILE_BikeShop_Barrier_Hidden_Top      0x269 +#define METATILE_BikeShop_Barrier_Hidden_Bottom   0x271 +#define METATILE_BikeShop_Floor_Shadow_Top        0x26D +#define METATILE_BikeShop_Wall_Edge_Top           0x281 +#define METATILE_BikeShop_Button_Pressed          0x24F +#define METATILE_BikeShop_Button_Green            0x22E +#define METATILE_BikeShop_Button_Blue             0x236 +#define METATILE_BikeShop_Barrier_Green_Top       0x2B6 +#define METATILE_BikeShop_Barrier_Green_TopMid    0x2BE +#define METATILE_BikeShop_Barrier_Green_BottomMid 0x2C6 +#define METATILE_BikeShop_Barrier_Green_Bottom    0x2CE +#define METATILE_BikeShop_Barrier_Blue_Top        0x2B7 +#define METATILE_BikeShop_Barrier_Blue_TopMid     0x2BF +#define METATILE_BikeShop_Barrier_Blue_BottomMid  0x2C7 +#define METATILE_BikeShop_Barrier_Blue_Bottom     0x2CF +#define METATILE_BikeShop_Generator_Off_Tile0     0x2F0 +#define METATILE_BikeShop_Generator_Off_Tile1     0x2F1 +#define METATILE_BikeShop_Generator_Off_Tile2     0x2F2 +#define METATILE_BikeShop_Generator_Off_Tile3     0x2F3 +#define METATILE_BikeShop_Generator_Off_Tile4     0x2F4 +#define METATILE_BikeShop_Generator_Off_Tile5     0x2F5 +#define METATILE_BikeShop_Generator_Off_Tile6     0x2F6 +#define METATILE_BikeShop_Generator_Off_Tile7     0x2F7 + +// gTileset_TrainerHill +#define METATILE_TrainerHill_GreenFloorTile 0x307 +#define METATILE_TrainerHill_CounterDoor    0x334 + +// gTileset_Underwater +#define METATILE_Underwater_RockWall    0x21E +#define METATILE_Underwater_FloorShadow 0x228 + +#endif // GUARD_METATILE_LABELS_H diff --git a/include/constants/pokemon.h b/include/constants/pokemon.h index f63d755ad..5d0e562bc 100644 --- a/include/constants/pokemon.h +++ b/include/constants/pokemon.h @@ -82,4 +82,7 @@  #define NUM_STATS 6  #define NUM_BATTLE_STATS 8 +// Shiny odds +#define SHINY_ODDS 8 // Actual probability is SHINY_ODDS/65536 +  #endif // GUARD_CONSTANTS_POKEMON_H diff --git a/include/constants/trainer_hill.h b/include/constants/trainer_hill.h index e231a6043..4aae1dbbc 100644 --- a/include/constants/trainer_hill.h +++ b/include/constants/trainer_hill.h @@ -26,4 +26,4 @@  #define TRAINER_HILL_PLAYER_STATUS_ECARD_SCANNED 1  #define TRAINER_HILL_PLAYER_STATUS_NORMAL 2 -#endif
\ No newline at end of file +#endif diff --git a/include/constants/trainers.h b/include/constants/trainers.h index 2a6c306b4..c0abfe6b6 100644 --- a/include/constants/trainers.h +++ b/include/constants/trainers.h @@ -202,8 +202,8 @@  #define FACILITY_CLASSES_COUNT               0x52 -#define TRAINER_CLASS_PKMN_TRAINER_1 0x0 -#define TRAINER_CLASS_PKMN_TRAINER_2 0x1 +#define TRAINER_CLASS_PKMN_TRAINER_1 0x0  // Unused +#define TRAINER_CLASS_PKMN_TRAINER_2 0x1  // Unused  #define TRAINER_CLASS_HIKER          0x2  #define TRAINER_CLASS_TEAM_AQUA      0x3  #define TRAINER_CLASS_PKMN_BREEDER   0x4 @@ -250,7 +250,7 @@  #define TRAINER_CLASS_SWIMMER_F      0x2d  #define TRAINER_CLASS_TWINS          0x2e  #define TRAINER_CLASS_SAILOR         0x2f -#define TRAINER_CLASS_COOLTRAINER_UNUSED  0x30 +#define TRAINER_CLASS_COOLTRAINER_2  0x30 // Used for only one trainer.  #define TRAINER_CLASS_MAGMA_ADMIN    0x31  #define TRAINER_CLASS_PKMN_TRAINER_3 0x32  #define TRAINER_CLASS_BUG_CATCHER    0x33 @@ -267,7 +267,7 @@  #define TRAINER_CLASS_FACTORY_HEAD   0x3e  #define TRAINER_CLASS_PIKE_QUEEN     0x3f  #define TRAINER_CLASS_PYRAMID_KING   0x40 -#define TRAINER_CLASS_PKMN_TRAINER_4 0x41 +#define TRAINER_CLASS_RS_PROTAG      0x41  #define TRAINER_ENCOUNTER_MUSIC_MALE         0 // standard male encounter music  #define TRAINER_ENCOUNTER_MUSIC_FEMALE       1 // standard female encounter music diff --git a/include/dodrio_berry_picking.h b/include/dodrio_berry_picking.h new file mode 100644 index 000000000..55e8fa880 --- /dev/null +++ b/include/dodrio_berry_picking.h @@ -0,0 +1,8 @@ +#ifndef GUARD_DODRIO_BERRY_PICKING_H +#define GUARD_DODRIO_BERRY_PICKING_H + +void sub_802493C(u16 a0, void (*callback)(void)); +void sub_8027A5C(void); +void sub_8027AAC(void); + +#endif // GUARD_DODRIO_BERRY_PICKING_H diff --git a/include/fieldmap.h b/include/fieldmap.h index 2384ed46a..be5610a46 100644 --- a/include/fieldmap.h +++ b/include/fieldmap.h @@ -23,9 +23,9 @@ int GetMapBorderIdAt(int x, int y);  int CanCameraMoveInDirection(int direction);  u16 GetBehaviorByMetatileId(u16 metatileId);  void GetCameraFocusCoords(u16 *x, u16 *y); -u8 MapGridGetMetatileLayerTypeAt(s32 x, s32 y); +u8 MapGridGetMetatileLayerTypeAt(int x, int y);  u8 MapGridGetZCoordAt(int x, int y); -u8 CameraMove(s32 deltaX, s32 deltaY); +bool8 CameraMove(int deltaX, int deltaY);  struct MapConnection *sub_8088950(u8 direction, int x, int y);  bool8 sub_80889A8(u8 direction, int x, int y, struct MapConnection *connection);  bool8 sub_8088A0C(int x, int src_width, int dest_width, int offset); diff --git a/include/gba/defines.h b/include/gba/defines.h index b68a2ad1e..9bd695aaa 100644 --- a/include/gba/defines.h +++ b/include/gba/defines.h @@ -6,9 +6,16 @@  #define TRUE  1  #define FALSE 0 +#define BSS_DATA   __attribute__((section(".bss")))  #define IWRAM_DATA __attribute__((section("iwram_data")))  #define EWRAM_DATA __attribute__((section("ewram_data"))) +#if MODERN +#define NOINLINE __attribute__((noinline)) +#else +#define NOINLINE +#endif +  #define ALIGNED(n) __attribute__((aligned(n)))  #define SOUND_INFO_PTR (*(struct SoundInfo **)0x3007FF0) diff --git a/include/global.fieldmap.h b/include/global.fieldmap.h index 3aa44ec9a..b5a86e311 100644 --- a/include/global.fieldmap.h +++ b/include/global.fieldmap.h @@ -8,6 +8,8 @@  #define METATILE_COLLISION_SHIFT 10  #define METATILE_ELEVATION_MASK 0xF000 +#define METATILE_ID(tileset, name) (METATILE_##tileset##_##name) +  enum  {      CONNECTION_SOUTH = 1, diff --git a/include/global.h b/include/global.h index 4523ece21..16f08c895 100644 --- a/include/global.h +++ b/include/global.h @@ -2,6 +2,7 @@  #define GUARD_GLOBAL_H  #include <string.h> +#include <limits.h>  #include "config.h" // we need to define config before gba headers as print stuff needs the functions nulled before defines.  #include "gba/gba.h"  #include "constants/global.h" @@ -18,12 +19,15 @@  #if defined (__APPLE__) || defined (__CYGWIN__) || defined (_MSC_VER)  #define _(x) x  #define __(x) x -#define INCBIN_U8 {0} -#define INCBIN_U16 {0} -#define INCBIN_U32 {0} -#define INCBIN_S8 {0} -#define INCBIN_S16 {0} -#define INCBIN_S32 {0} + +// Fool CLion IDE +#define INCBIN(x) {0} +#define INCBIN_U8 INCBIN +#define INCBIN_U16 INCBIN +#define INCBIN_U32 INCBIN +#define INCBIN_S8 INCBIN +#define INCBIN_S16 INCBIN +#define INCBIN_S32 INCBIN  #endif // IDE support  #define ARRAY_COUNT(array) (size_t)(sizeof(array) / sizeof((array)[0])) @@ -62,6 +66,10 @@  #define min(a, b) ((a) < (b) ? (a) : (b))  #define max(a, b) ((a) >= (b) ? (a) : (b)) +#if MODERN +#define abs(x) (((x) < 0) ? -(x) : (x)) +#endif +  // Extracts the upper 16 bits of a 32-bit number  #define HIHALF(n) (((n) & 0xFFFF0000) >> 16) @@ -86,6 +94,11 @@  #define T2_READ_32(ptr) ((ptr)[0] + ((ptr)[1] << 8) + ((ptr)[2] << 16) + ((ptr)[3] << 24))  #define T2_READ_PTR(ptr) (void*) T2_READ_32(ptr) +// Macros for checking the joypad +#define TEST_BUTTON(field, button) ({(field) & (button);}) +#define JOY_NEW(button) TEST_BUTTON(gMain.newKeys,  button) +#define JOY_HELD(button)  TEST_BUTTON(gMain.heldKeys, button) +  #define S16TOPOSFLOAT(val)   \  ({                           \      s16 v = (val);           \ @@ -153,18 +166,17 @@ struct Pokedex      /*0x44*/ u8 seen[DEX_FLAGS_NO];  }; -struct PokemonJumpResults // possibly used in the game itself? +struct PokemonJumpResults  {      u16 jumpsInRow;      u16 field2;      u16 excellentsInRow;      u16 field6; -    u16 field8; -    u16 fieldA; +    u32 field8;      u32 bestJumpScore;  }; -struct BerryPickingResults // possibly used in the game itself? Size may be wrong as well +struct BerryPickingResults  {      u32 bestScore;      u16 berriesPicked; @@ -235,7 +247,7 @@ struct BattleTowerPokemon      u32 spAttackIV:5;      u32 spDefenseIV:5;      u32 gap:1; -    u32 altAbility:1; +    u32 abilityNum:1;      u32 personality;      u8 nickname[POKEMON_NAME_LENGTH + 1];      u8 friendship; @@ -282,7 +294,7 @@ struct RentalMon      u16 monId;      u32 personality;      u8 ivs; -    u8 abilityBit; +    u8 abilityNum;  };  struct BattleDomeTrainer diff --git a/include/graphics.h b/include/graphics.h index 161633e17..d1d99cc8f 100644 --- a/include/graphics.h +++ b/include/graphics.h @@ -3301,10 +3301,10 @@ extern const u32 gPokedexSearch1_Tilemap[];  extern const u16 gPokedexSearchMenu_Pal[];  // berry tag screen -extern const u32 gUnknown_08D9BB44[]; -extern const u32 gUnknown_08D9BF98[]; -extern const u32 gUnknown_08D9C13C[]; -extern const u32 gUnknown_08D9BEF0[]; +extern const u32 gBerryCheck_Gfx[]; +extern const u32 gBerryCheck_Pal[]; +extern const u32 gBerryTag_Gfx[]; +extern const u32 gBerryTag_Pal[];  // rayquaza scene gfx  extern const u32 gRaySceneGroudon_Gfx[]; @@ -3859,6 +3859,7 @@ extern const u8 gFireRedMenuElements_Gfx[];  // item menu graphics  extern const u32 gBagScreen_Gfx[]; +extern const u32 gBagScreen_GfxTileMap[];  extern const u32 gBagScreenFemale_Pal[];  extern const u32 gBagScreenMale_Pal[];  extern const u8 gBagMenuHMIcon_Gfx[]; @@ -4004,10 +4005,13 @@ extern const u32 gBerryPalette_Starf[];  extern const u32 gBerryPic_Enigma[];  extern const u32 gBerryPalette_Enigma[]; -//credits -extern const u32 gCreditsCopyrightEnd_Gfx[]; -  //pokenav +extern const u16 gPokenavCondition_Pal[]; +extern const u32 gPokenavCondition_Gfx[]; +extern const u32 gPokenavCondition_Tilemap[]; +extern const u16 gPokenavOptions_Tilemap[]; +extern const u32 gPokenavOptions_Gfx[]; +extern const u16 gPokenavOptions_Pal[];  extern const u8 gPokenavConditionMarker_Gfx[];  extern const u16 gPokenavConditionMarker_Pal[];  extern const u16 gPokenavLeftHeader_Pal[]; @@ -4026,6 +4030,9 @@ extern const u32 gPokenavLeftHeaderBeauty_Gfx[];  extern const u32 gPokenavLeftHeaderCute_Gfx[];  extern const u32 gPokenavLeftHeaderSmart_Gfx[];  extern const u32 gPokenavLeftHeaderTough_Gfx[]; +extern const u16 gUnknown_08DDE010[]; +extern const u32 gUnknown_08DDE030[]; +extern const u32 gUnknown_08DDE12C[];  extern const u32 gPageInfoTilemap[];  extern const u32 gUnknown_08D98CC8[]; @@ -4079,7 +4086,7 @@ extern const u32 gContestConfetti_Pal[];  extern const u32 gUnknown_08C093F0[];  extern const u32 gSubstituteDollTilemap[];  extern const u32 gSubstituteDollGfx[]; -extern const u16 gSubstituteDollPal[]; +extern const u32 gSubstituteDollPal[];  extern const u32 gHealthboxSinglesPlayerGfx[];  extern const u32 gHealthboxSinglesOpponentGfx[];  extern const u32 gHealthboxDoublesPlayerGfx[]; @@ -4092,11 +4099,11 @@ extern const u16 gBattleInterface_BallDisplayPal[];  extern const u32 gBagSwapLineGfx[];  extern const u32 gBagSwapLinePal[]; -extern const u32 gUnknown_08D9ADD0[]; -extern const u32 gUnknown_08D9AE04[]; +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 gBattleFrontierGfx_PyramidBag[];  extern const u32 gTitleScreenEmeraldVersionGfx[];  extern const u32 gTitleScreenPressStartGfx[]; @@ -4762,7 +4769,6 @@ extern const u32 gBattleStatMask6_Pal[];  extern const u32 gBattleStatMask7_Pal[];  extern const u32 gBattleStatMask8_Pal[]; -extern const u32 gUnknown_08D9A88C[];  extern const u32 gContestMiscGfx[];  extern const u32 gContestAudienceGfx[];  extern const u8 gContestApplauseMeterGfx[]; @@ -4936,6 +4942,9 @@ extern const u32 gLinkMiscMenu_Tilemap[];  // Use Pokeblock  extern const u8 gPokenavConditionCancel_Gfx[];  extern const u16 gPokenavConditionCancel_Pal[]; +extern const u8 gUsePokeblockUpDown_Gfx[]; +extern const u16 gUsePokeblockUpDown_Pal[]; +extern const u16 gUsePokeblockCondition_Pal[];  // Berry Crush  extern const u32 gUnknown_08DE34B8[]; diff --git a/include/item_menu.h b/include/item_menu.h index 70d6b5a94..5580fa4b4 100644 --- a/include/item_menu.h +++ b/include/item_menu.h @@ -29,9 +29,9 @@ struct BagStruct      u16 scrollPosition[POCKETS_COUNT];  }; -extern struct BagStruct gUnknown_0203CE58; +extern struct BagStruct gBagPositionStruct; -struct UnkBagStruct +struct BagMenuStruct  {      void (*mainCallback2)(void);      u8 tilemapBuffer[0x800]; @@ -61,7 +61,7 @@ struct UnkBagStruct      u8 filler2[4];  }; -extern struct UnkBagStruct *gUnknown_0203CE54; +extern struct BagMenuStruct *gBagMenu;  // Exported RAM declarations @@ -85,7 +85,7 @@ void ResetBagScrollPositions(void);  void sub_81AABF0(void (*callback)(void));  void CB2_ChooseBerry(void);  void unknown_ItemMenu_Confirm(u8 taskId); -void bag_menu_yes_no(u8, u8, const struct YesNoFuncTable*); +void BagMenu_YesNo(u8, u8, const struct YesNoFuncTable*);  void sub_81AB9A8(u8 pocketId); diff --git a/include/item_menu_icons.h b/include/item_menu_icons.h index aee7599df..50f0d5544 100644 --- a/include/item_menu_icons.h +++ b/include/item_menu_icons.h @@ -1,11 +1,11 @@  #ifndef GUARD_ITEM_MENU_ICONS  #define GUARD_ITEM_MENU_ICONS -extern const struct CompressedSpriteSheet gUnknown_0857FB34; -extern const struct CompressedSpriteSheet gUnknown_0857FB3C; -extern const struct CompressedSpritePalette gUnknown_0857FB44; -extern const struct CompressedSpriteSheet gUnknown_0857FDEC; -extern const struct CompressedSpritePalette gUnknown_0857FDF4; +extern const struct CompressedSpriteSheet gBagMaleSpriteSheet; +extern const struct CompressedSpriteSheet gBagFemaleSpriteSheet; +extern const struct CompressedSpritePalette gBagPaletteTable; +extern const struct CompressedSpriteSheet gBerryCheckCircleSpriteSheet; +extern const struct CompressedSpritePalette gBerryCheckCirclePaletteTable;  void RemoveBagSprite(u8 id);  void AddBagVisualSprite(u8 bagPocketId); @@ -19,7 +19,13 @@ void sub_80D4FC8(u8 arg0);  void sub_80D4FEC(u8 arg0);  u8 CreateBerryTagSprite(u8 id, s16 x, s16 y);  void FreeBerryTagSpritePalette(void); -u8 sub_80D511C(u8 berryId, u8 x, u8 y, bool8 startAffine); +u8 LoadSpinningBerryPicGfx(u8 berryId, u8 x, u8 y, bool8 startAffine);  u8 CreateBerryFlavorCircleSprite(s16 x); +#define TAG_BAG_GFX 100 +#define TAG_ROTATING_BALL_GFX 101 +#define TAG_BERRY_CHECK_CIRCLE_GFX 10000 +#define TAG_BERRY_PIC_TILE 0xFFFF +#define TAG_BERRY_PIC_PAL 0x7544 +  #endif // GUARD_ITEM_MENU_ICONS diff --git a/include/link_rfu.h b/include/link_rfu.h index edfd0ed20..d6e1009e1 100644 --- a/include/link_rfu.h +++ b/include/link_rfu.h @@ -275,15 +275,17 @@ void sub_8010FCC(u32 a0, u32 a1, u32 a2);  void sub_8011C84(void);  void sub_8012188(const u8 *name, struct UnkLinkRfuStruct_02022B14 *structPtr, u8 a2);  bool32 sub_8011B90(void); -void sub_800FE50(u16 *a0); +void sub_800FE50(void *a0);  bool32 sub_800E540(u16 id, u8 *name);  void sub_8011DE0(u32 arg0); -u8 sub_801100C(int a0); +u8 sub_801100C(s32 a0);  void sub_800EF7C(void);  bool8 sub_800DE7C(struct UnkLinkRfuStruct_02022B14 *buff1, u8 *buff2, u8 idx);  bool8 sub_800DF34(struct UnkLinkRfuStruct_02022B14 *buff1, u8 *buff2, u8 idx);  s32 sub_800E87C(u8 idx);  void sub_8011BA4(void); +void sub_8010198(void); +void sub_8011AC8(void);  void LinkRfu_FatalError(void);  bool32 sub_8011A9C(void);  void sub_80104B0(void); diff --git a/include/menu.h b/include/menu.h index 08cad40bd..62e2558dc 100644 --- a/include/menu.h +++ b/include/menu.h @@ -25,7 +25,7 @@ void InitStandardTextBoxWindows(void);  void sub_8197200(void);  u16 RunTextPrintersAndIsPrinter0Active(void);  void sub_81973A4(void); -void DrawDialogueFrame(u8, u8); +void DrawDialogueFrame(u8 windowId, bool8 copyToVram);  void ClearStdWindowAndFrame(u8 windowId, bool8 copyToVram);  u16 AddTextPrinterParameterized2(u8 windowId, u8 fontId, const u8 *str, u8 speed, void (*callback)(struct TextPrinterTemplate *, u16), u8 fgColor, u8 bgColor, u8 shadowColor);  void PrintPlayerNameOnWindow(u8, const u8*, u16, u16); diff --git a/include/menu_specialized.h b/include/menu_specialized.h index 014ee2585..14a246468 100644 --- a/include/menu_specialized.h +++ b/include/menu_specialized.h @@ -34,6 +34,7 @@ void sub_81D1EC0(void);  void sub_81D1D04(u8 a0);  void sub_81D1ED4(struct UnknownStruct_81D1ED4 *a0);  void sub_81D2108(struct UnknownStruct_81D1ED4 *arg0); +void sub_81D21DC(u8 bg);  void sub_81D20AC(struct UnknownStruct_81D1ED4 *arg0);  void sub_81D2230(struct UnknownStruct_81D1ED4 *arg0);  bool8 sub_81D20BC(struct UnknownStruct_81D1ED4 *arg0); diff --git a/include/party_menu.h b/include/party_menu.h index 413a89689..c9843e484 100644 --- a/include/party_menu.h +++ b/include/party_menu.h @@ -33,7 +33,7 @@ struct Struct203CEC8      u8 unk8_0:4;      u8 mode:2;      u8 unk8_2:2; -    s8 unk9; +    s8 slotId;      s8 unkA;      u8 unkB;      u16 unkC; diff --git a/include/player_pc.h b/include/player_pc.h index 53bb25c6b..219c11440 100644 --- a/include/player_pc.h +++ b/include/player_pc.h @@ -1,6 +1,8 @@  #ifndef GUARD_PLAYER_PC_H  #define GUARD_PLAYER_PC_H +#include "menu.h" +  // local task defines  #define PAGE_INDEX data[0]  #define ITEMS_ABOVE_TOP data[1] diff --git a/include/pokemon.h b/include/pokemon.h index 26d715d89..07bcff2e3 100644 --- a/include/pokemon.h +++ b/include/pokemon.h @@ -14,7 +14,7 @@  #define MON_DATA_OT_NAME            7  #define MON_DATA_MARKINGS           8  #define MON_DATA_CHECKSUM           9 -#define MON_DATA_10                10 +#define MON_DATA_ENCRYPT_SEPARATOR 10  #define MON_DATA_SPECIES           11  #define MON_DATA_HELD_ITEM         12  #define MON_DATA_MOVE1             13 @@ -50,7 +50,7 @@  #define MON_DATA_SPATK_IV          43  #define MON_DATA_SPDEF_IV          44  #define MON_DATA_IS_EGG            45 -#define MON_DATA_ALT_ABILITY       46 +#define MON_DATA_ABILITY_NUM       46  #define MON_DATA_TOUGH             47  #define MON_DATA_SHEEN             48  #define MON_DATA_OT_GENDER         49 @@ -182,7 +182,7 @@ struct PokemonSubstruct3   /* 0x05 */ u32 spAttackIV:5;   /* 0x06 */ u32 spDefenseIV:5;   /* 0x07 */ u32 isEgg:1; - /* 0x07 */ u32 altAbility:1; + /* 0x07 */ u32 abilityNum:1;   /* 0x08 */ u32 coolRibbon:3;   /* 0x08 */ u32 beautyRibbon:3; @@ -281,7 +281,7 @@ struct BattlePokemon      /*0x16*/ u32 spAttackIV:5;      /*0x17*/ u32 spDefenseIV:5;      /*0x17*/ u32 isEgg:1; -    /*0x17*/ u32 altAbility:1; +    /*0x17*/ u32 abilityNum:1;      /*0x18*/ s8 statStages[NUM_BATTLE_STATS];      /*0x20*/ u8 ability;      /*0x21*/ u8 type1; @@ -295,7 +295,7 @@ struct BattlePokemon      /*0x2E*/ u16 item;      /*0x30*/ u8 nickname[POKEMON_NAME_LENGTH + 1];      /*0x3B*/ u8 ppBonuses; -    /*0x3C*/ u8 otName[8]; +    /*0x3C*/ u8 otName[PLAYER_NAME_LENGTH + 1];      /*0x44*/ u32 experience;      /*0x48*/ u32 personality;      /*0x4C*/ u32 status1; @@ -329,8 +329,7 @@ struct BaseStats   /* 0x13 */ u8 growthRate;   /* 0x14 */ u8 eggGroup1;   /* 0x15 */ u8 eggGroup2; - /* 0x16 */ u8 ability1; - /* 0x17 */ u8 ability2; + /* 0x16 */ u8 abilities[2];   /* 0x18 */ u8 safariZoneFleeRate;   /* 0x19 */ u8 bodyColor : 7;              u8 noFlip : 1; @@ -435,7 +434,7 @@ extern const u8 gPPUpGetMask[];  extern const u8 gPPUpSetMask[];  extern const u8 gPPUpAddMask[];  extern const u8 gStatStageRatios[][2]; -extern const u16 gUnknown_08329D54[]; +extern const u16 gLinkPlayerFacilityClasses[];  extern const struct SpriteTemplate gUnknown_08329D98[];  extern const s8 gNatureStatTable[][5]; @@ -507,7 +506,7 @@ u8 CalculatePlayerPartyCount(void);  u8 CalculateEnemyPartyCount(void);  u8 GetMonsStateToDoubles(void);  u8 GetMonsStateToDoubles_2(void); -u8 GetAbilityBySpecies(u16 species, bool8 altAbility); +u8 GetAbilityBySpecies(u16 species, bool8 abilityNum);  u8 GetMonAbility(struct Pokemon *mon);  void CreateSecretBaseEnemyParty(struct SecretBase *secretBaseRecord);  u8 GetSecretBaseTrainerPicIndex(void); @@ -564,7 +563,7 @@ void PlayBattleBGM(void);  void PlayMapChosenOrBattleBGM(u16 songId);  void sub_806E694(u16 songId);  const u32 *GetMonFrontSpritePal(struct Pokemon *mon); -const u32 *GetFrontSpritePalFromSpeciesAndPersonality(u16 species, u32 otId, u32 personality); +const u32 *GetMonSpritePalFromSpeciesAndPersonality(u16 species, u32 otId, u32 personality);  const struct CompressedSpritePalette *GetMonSpritePalStruct(struct Pokemon *mon);  const struct CompressedSpritePalette *GetMonSpritePalStructFromOtIdPersonality(u16 species, u32 otId , u32 personality);  bool32 IsHMMove2(u16 move); diff --git a/include/pokemon_icon.h b/include/pokemon_icon.h index c7b895028..8af43c753 100644 --- a/include/pokemon_icon.h +++ b/include/pokemon_icon.h @@ -23,6 +23,6 @@ void LoadMonIconPalette(u16 species);  void sub_80D328C(struct Sprite *sprite);  void sub_80D3014(struct Sprite *sprite);  void sub_80D32C8(struct Sprite *sprite, u8 animNum); -u8 sub_80D30A0(u16 species); +u8 GetMonIconPaletteIndexFromSpecies(u16 species);  #endif // GUARD_POKEMON_ICON_H diff --git a/include/pokemon_jump.h b/include/pokemon_jump.h index 9e8a6fade..28b19f9b1 100755..100644 --- a/include/pokemon_jump.h +++ b/include/pokemon_jump.h @@ -5,7 +5,10 @@  void sub_802A9A8(u16 monId, MainCallback callback);  bool32 sub_802C908(u16 species); +void sub_802C920(void); +void ResetPokeJumpResults(void); +void sub_802E3C4(void); +void sub_802EB24(s16 tileTag, s16 palTag, s16 x, s16 y, u8 subpriority); +bool32 sub_802EB84(void);  #endif // GUARD_POKEMON_JUMP_H - - diff --git a/include/pokenav.h b/include/pokenav.h index e181b592c..ecf66de51 100644 --- a/include/pokenav.h +++ b/include/pokenav.h @@ -3,8 +3,21 @@  #include "bg.h"  #include "main.h" +#include "pokemon_storage_system.h" -typedef u32 (*LoopedTask)(int state); +typedef u32 (*LoopedTask)(s32 state); + +struct PokenavSub18 +{ +    u16 unk0; +    u16 unk2; +    struct PokenavMonList +    { +        u8 boxId; +        u8 monId; +        u16 unk6; +    } unk4[TOTAL_BOXES_COUNT * IN_BOX_COUNT + PARTY_SIZE]; +};  // Return values of LoopedTask functions.  #define LT_INC_AND_PAUSE 0 @@ -43,7 +56,7 @@ enum  // pokenav.c  void sub_81C7694(u32); -u16 sub_81C76AC(void); +u32 sub_81C76AC(void);  void CB2_InitPokeNav(void);  u32 CreateLoopedTask(LoopedTask loopedTask, u32 priority); @@ -94,7 +107,7 @@ void sub_81C8234(void);  // pokenav_match_call_data.c  bool32 sub_81D17E8(u32 idx); -u8 sub_81D16DC(u32 idx); +u8 MatchCallMapSecGetByIndex(u32 idx);  bool32 sub_81D1BF8(u32 idx);  bool32 MatchCallFlagGetByIndex(u32 idx);  u32 MatchCall_GetRematchTableIdx(u32 idx); @@ -111,7 +124,7 @@ void sub_81C7850(u32 a0);  u32 sub_81C786C(void);  void LoadLeftHeaderGfxForIndex(u32 arg0);  void sub_81C7FA0(u32 arg0, bool32 arg1, bool32 arg2); -void sub_81C7AC0(int a0); +void sub_81C7AC0(s32 a0);  bool32 sub_81C8010(void);  void InitBgTemplates(const struct BgTemplate *templates, int count);  bool32 IsPaletteFadeActive(void); @@ -127,6 +140,7 @@ void ResumeSpinningPokenavSprite(void);  void sub_81C7E14(u32 arg0);  void sub_81C7FC4(u32 arg0, bool32 arg1);  void sub_81C7880(void); +void sub_81C7990(u32 a0, u16 a1);  // pokenav_unk_1.c  bool32 sub_81C9298(void); @@ -187,4 +201,22 @@ void sub_81CC62C(int);  u32 sub_81CC65C(void);  void sub_81CC670(void); -#endif //GUARD_POKENAV_H +// pokenav_unk_6.c +bool32 sub_81CD3C4(void); +bool32 sub_81CDD5C(void); +struct UnknownStruct_81D1ED4 *sub_81CDC70(void); +u16 sub_81CDC60(void); +u16 sub_81CDC50(void); +u8 sub_81CDDB0(void); +bool32 sub_81CD548(u8 arg0); +u8 sub_81CDD7C(void); +u8 *sub_81CDD04(u8 id); +u8 *sub_81CDD24(u8 id); +u16 sub_81CDD48(void); +void *sub_81CDCB4(u8 id); +void *sub_81CDCD4(u8 id); + +// pokenav_unk_7.c +u8 sub_81CEF14(void); + +#endif // GUARD_POKENAV_H diff --git a/include/shop.h b/include/shop.h index 9a5f8eb14..10e2b1060 100644 --- a/include/shop.h +++ b/include/shop.h @@ -49,4 +49,4 @@ void CreateDecorationShop1Menu(const u16 *);  void CreateDecorationShop2Menu(const u16 *);  void CB2_ExitSellMenu(void); -#endif // GUARD_SHOP_H
\ No newline at end of file +#endif // GUARD_SHOP_H diff --git a/include/sprite.h b/include/sprite.h index 32bdd9c55..9753837fd 100644 --- a/include/sprite.h +++ b/include/sprite.h @@ -275,6 +275,7 @@ void FreeSpriteOamMatrix(struct Sprite *sprite);  void DestroySpriteAndFreeResources(struct Sprite *sprite);  void sub_800142C(u32 a1, u32 a2, u16 *a3, u16 a4, u32 a5);  void AnimateSprite(struct Sprite *sprite); +void sub_8007E18(struct Sprite* sprite, s16 a2, s16 a3);  void StartSpriteAnim(struct Sprite *sprite, u8 animNum);  void StartSpriteAnimIfDifferent(struct Sprite *sprite, u8 animNum);  void SeekSpriteAnim(struct Sprite *sprite, u8 animCmdIndex); diff --git a/include/strings.h b/include/strings.h index 964c46ef2..97285b051 100644 --- a/include/strings.h +++ b/include/strings.h @@ -485,7 +485,6 @@ extern const u8 gText_CryOf[];  extern const u8 gText_SizeComparedTo[];  extern const u8 gText_PokedexRegistration[];  extern const u8 gText_UnkCtrlF908Clear01[]; -extern const u8 sText_TenDashes2[];  extern const u8 gText_5MarksPokemon[];  extern const u8 gText_UnkHeight[];  extern const u8 gText_UnkWeight[]; @@ -1023,6 +1022,7 @@ extern const u8 gText_PokenavMatchCall_CheckTrainerButtons[];  extern const u8 gText_PokenavRibbons_MonListButtons[];  extern const u8 gText_PokenavRibbons_RibbonListButtons[];  extern const u8 gText_PokenavRibbons_RibbonCheckButtons[]; +extern const u8 gText_Number2[];  extern const u8 gUnknown_085EAD37[];  extern const u8 gUnknown_085EAD41[]; @@ -2091,45 +2091,45 @@ extern const u8 gDaycareText_DontLikeOther[];  extern const u8 gDaycareText_PlayOther[];  // party menu -extern const u8 gUnknown_085E9E43[]; -extern const u8 gUnknown_085EA010[]; -extern const u8 gUnknown_085EA02A[]; -extern const u8 gUnknown_085E9E55[]; -extern const u8 gUnknown_085E9E64[]; -extern const u8 gUnknown_085E9E79[]; -extern const u8 gUnknown_085E9E8F[]; -extern const u8 gUnknown_085E9EBC[]; -extern const u8 gUnknown_085E9ED4[]; -extern const u8 gUnknown_085E9EE9[]; -extern const u8 gUnknown_085E9FDB[]; -extern const u8 gUnknown_085EA046[]; -extern const u8 gUnknown_085EA05B[]; -extern const u8 gUnknown_085E9F01[]; -extern const u8 gUnknown_085E9F58[]; -extern const u8 gUnknown_085E9F6F[]; -extern const u8 gUnknown_085E9F81[]; -extern const u8 gUnknown_085E9F90[]; -extern const u8 gUnknown_085E9FA7[]; -extern const u8 gUnknown_085E9FC2[]; -extern const u8 gUnknown_085E9EA6[]; -extern const u8 gUnknown_085E9F16[]; -extern const u8 gUnknown_085E9F2A[]; -extern const u8 gUnknown_085E9F42[]; -extern const u8 gUnknown_085E9FF9[]; -extern const u8 gUnknown_085EA073[]; -extern const u8 gUnknown_085EA091[]; -extern const u8 gUnknown_085EA099[]; -extern const u8 gUnknown_085EA09E[]; -extern const u8 gUnknown_085EA0A4[]; -extern const u8 gUnknown_085EA0AB[]; -extern const u8 gUnknown_085EA0E7[]; -extern const u8 gUnknown_085EA0B1[]; -extern const u8 gUnknown_085EA0B6[]; -extern const u8 gUnknown_085EA0BF[]; -extern const u8 gUnknown_085EA0C5[]; -extern const u8 gUnknown_085EA0CF[]; -extern const u8 gUnknown_085EA0D7[]; -extern const u8 gUnknown_085EA0DC[]; +extern const u8 gText_ChoosePokemon[]; +extern const u8 gText_ChoosePokemonCancel[]; +extern const u8 gText_ChoosePokemonConfirm[]; +extern const u8 gText_MoveToWhere[]; +extern const u8 gText_TeachWhichPokemon[]; +extern const u8 gText_UseOnWhichPokemon[]; +extern const u8 gText_GiveToWhichPokemon[]; +extern const u8 gText_NothingToCut[]; +extern const u8 gText_CantSurfHere[]; +extern const u8 gText_AlreadySurfing[]; +extern const u8 gText_CurrentIsTooFast[]; +extern const u8 gText_EnjoyCycling[]; +extern const u8 gText_InUseAlready_PM[]; +extern const u8 gText_CantUseHere[]; +extern const u8 gText_NoPokemonForBattle[]; +extern const u8 gText_ChoosePokemon2[]; +extern const u8 gText_NotEnoughHp[]; +extern const u8 gText_PokemonAreNeeded[]; +extern const u8 gText_PokemonCantBeSame[]; +extern const u8 gText_NoIdenticalHoldItems[]; +extern const u8 gText_DoWhatWithPokemon[]; +extern const u8 gText_RestoreWhichMove[]; +extern const u8 gText_BoostPp[]; +extern const u8 gText_DoWhatWithItem[]; +extern const u8 gText_DoWhatWithMail[]; +extern const u8 gText_AlreadyHoldingOne[]; +extern const u8 gText_NoUse[]; +extern const u8 gText_Able[]; +extern const u8 gText_First_PM[]; +extern const u8 gText_Second_PM[]; +extern const u8 gText_Third_PM[]; +extern const u8 gText_Fourth[]; +extern const u8 gText_Able2[]; +extern const u8 gText_NotAble[]; +extern const u8 gText_Able3[]; +extern const u8 gText_NotAble2[]; +extern const u8 gText_Learned[]; +extern const u8 gText_Have[]; +extern const u8 gText_DontHave[];  extern const u8 gText_Take[];  extern const u8 gText_Mail[];  extern const u8 gText_Take2[]; @@ -2708,6 +2708,42 @@ extern const u8 gText_Symbols[];  extern const u8 gText_Register2[];  extern const u8 gText_Exit2[]; +// Dodrio Berry Picking +extern const u8 gText_BerryPickingRecords[]; +extern const u8 gText_BerriesPicked[]; +extern const u8 gText_BerriesInRowFivePlayers[]; +extern const u8 gText_BestScore[]; +extern const u8 gText_1Colon[]; +extern const u8 gText_2Colon[]; +extern const u8 gText_3Colon[]; +extern const u8 gText_4Colon[]; +extern const u8 gText_5Colon[]; +extern const u8 gText_SpacePoints[]; +extern const u8 gText_10P30P50P50P[]; +extern const u8 gText_AnnouncingPrizes[]; +extern const u8 gText_AnnouncingRankings[]; +extern const u8 gText_FirstPlacePrize[]; +extern const u8 gText_CantHoldAnyMore[]; +extern const u8 gText_FilledStorageSpace[]; +extern const u8 gText_BerryPickingResults[]; +extern const u8 gText_WantToPlayAgain[]; +extern const u8 gText_CommunicationStandby3[]; +extern const u8 gText_SomeoneDroppedOut[]; + +// Pokemon jump +extern const u8 gText_WantToPlayAgain2[]; +extern const u8 gText_SomeoneDroppedOut2[]; +extern const u8 gText_CommunicationStandby4[]; +extern const u8 gText_AwesomeWonF701F700[]; +extern const u8 gText_FilledStorageSpace2[]; +extern const u8 gText_CantHoldMore[]; +extern const u8 gText_SpacePoints2[]; +extern const u8 gText_SpaceTimes3[]; +extern const u8 gText_PkmnJumpRecords[]; +extern const u8 gText_JumpsInARow[]; +extern const u8 gText_BestScore2[]; +extern const u8 gText_ExcellentsInARow[]; +  // Pokenav Match Call  extern const u8 gText_CallCantBeMadeHere[];  extern const u8 gText_NumberRegistered[]; @@ -2715,4 +2751,35 @@ extern const u8 gText_NumberOfBattles[];  extern const u8 gText_Unknown[];  extern const u8 gText_TrainerCloseBy[]; +// pokenav_unk_2 +extern const u8 gUnknown_085EBCC5[]; +extern const u8 gUnknown_085EBCE8[]; +extern const u8 gUnknown_085EBD01[]; +extern const u8 gUnknown_085EBD1C[]; +extern const u8 gUnknown_085EBD34[]; +extern const u8 gUnknown_085EBD83[]; +extern const u8 gUnknown_085EBDA2[]; +extern const u8 gUnknown_085EBDBF[]; +extern const u8 gUnknown_085EBDDB[]; +extern const u8 gUnknown_085EBDEE[]; +extern const u8 gUnknown_085EBE06[]; +extern const u8 gUnknown_085EBE19[]; +extern const u8 gUnknown_085EBE2D[]; +extern const u8 gUnknown_085EBE41[]; + +// pokenav_unk_4 +extern const u8 gUnknown_085EC017[]; +extern const u8 gUnknown_085EC01C[]; +extern const u8 gUnknown_085EC022[]; + +// pokenav_unk_10 +extern const u8 gText_RibbonsF700[]; + +// use_pokeblock +extern const u8 gText_Coolness[]; +extern const u8 gText_Toughness[]; +extern const u8 gText_Smartness[]; +extern const u8 gText_Cuteness[]; +extern const u8 gText_Beauty3[]; +  #endif // GUARD_STRINGS_H diff --git a/include/text.h b/include/text.h index eba3d0c4e..d3ff663bb 100644 --- a/include/text.h +++ b/include/text.h @@ -166,7 +166,11 @@ struct TextPrinter      void (*callback)(struct TextPrinterTemplate *, u16); // 0x10 -    union __attribute__((packed)) { +    union +#if !MODERN +    __attribute__((packed)) +#endif +    {          struct TextPrinterSubStruct sub;          u8 fields[7];      } subUnion; diff --git a/include/trainer_hill.h b/include/trainer_hill.h index ad2713316..e605ac654 100644 --- a/include/trainer_hill.h +++ b/include/trainer_hill.h @@ -24,7 +24,7 @@ const struct WarpEvent* sub_81D6134(u8 warpEventId);  u16 LocalIdToHillTrainerId(u8 localId);  bool8 GetHillTrainerFlag(u8 eventObjectId);  void SetHillTrainerFlag(void); -const u8 *sub_81D62AC(void); +const u8 *GetTrainerHillTrainerScript(void);  void FillHillTrainerParty(void);  void FillHillTrainersParties(void);  u32 sub_81D63C4(void); | 
