diff options
Diffstat (limited to 'include')
-rw-r--r-- | include/battle.h | 2 | ||||
-rw-r--r-- | include/battle_anim.h | 52 | ||||
-rw-r--r-- | include/battle_scripts.h | 2 | ||||
-rw-r--r-- | include/constants/battle_anim.h | 8 | ||||
-rw-r--r-- | include/constants/flags.h | 11 | ||||
-rw-r--r-- | include/constants/heal_locations.h | 8 | ||||
-rw-r--r-- | include/constants/region_map_sections.h | 12 | ||||
-rw-r--r-- | include/constants/weather.h | 47 | ||||
-rw-r--r-- | include/event_scripts.h | 2 | ||||
-rw-r--r-- | include/graphics.h | 26 | ||||
-rwxr-xr-x | include/pokedex_area_region_map.h | 17 | ||||
-rw-r--r-- | include/pokenav.h | 109 | ||||
-rw-r--r-- | include/random.h | 5 | ||||
-rw-r--r-- | include/region_map.h | 45 | ||||
-rwxr-xr-x | include/unk_pokedex_area_screen_helper.h | 17 |
15 files changed, 204 insertions, 159 deletions
diff --git a/include/battle.h b/include/battle.h index f8c685fb0..b377dc23c 100644 --- a/include/battle.h +++ b/include/battle.h @@ -590,7 +590,7 @@ struct MonSpritesGfx u8 field_F4[0x80]; u8 *barFontGfx; void *field_178; - u16 *field_17C; + u16 *buffer; }; // All battle variables are declared in battle_main.c diff --git a/include/battle_anim.h b/include/battle_anim.h index c3019a5cf..18727cc73 100644 --- a/include/battle_anim.h +++ b/include/battle_anim.h @@ -49,7 +49,7 @@ extern u8 gAnimMoveTurn; extern u8 gBattleAnimAttacker; extern u8 gBattleAnimTarget; extern u16 gAnimBattlerSpecies[MAX_BATTLERS_COUNT]; -extern u8 gUnknown_02038440; +extern u8 gAnimCustomPanning; void ClearBattleAnimationVars(void); void DoMoveAnim(u16 move); @@ -67,18 +67,19 @@ s16 CalculatePanIncrement(s16 sourcePan, s16 targetPan, s16 incrementPan); void sub_80A4720(u16 a, u16 *b, u32 c, u8 d); void sub_80A477C(bool8); -// battle_intro.s +// battle_intro.c void SetAnimBgAttribute(u8 bgId, u8 attributeId, u8 value); void sub_8118FBC(int bgId, u8 arg1, u8 arg2, u8 battlerPosition, u8 arg4, u8 *arg5, u16 *arg6, u16 arg7); void HandleIntroSlide(u8 terrainId); int GetAnimBgAttribute(u8 bgId, u8 attributeId); -// battle_anim_mons.s +// battle_anim_mons.c void TranslateSpriteInEllipseOverDuration(struct Sprite *sprite); void sub_80A8AEC(struct Sprite *sprite); void sub_80A8A6C(struct Sprite *sprite); -void sub_80A8E30(struct Sprite *sprite); -void sub_80A8B64(struct Sprite *sprite); +void AnimWeatherBallUp(struct Sprite *sprite); +void AnimWeatherBallDown(struct Sprite *sprite); +void AnimSpinningSparkle(struct Sprite *sprite); void SetAverageBattlerPositions(u8 battlerId, bool8 respectMonPicOffsets, s16 *x, s16 *y); void DestroySpriteAndMatrix(struct Sprite *sprite); void TranslateSpriteLinearFixedPoint(struct Sprite *sprite); @@ -88,7 +89,6 @@ void StartAnimLinearTranslation(struct Sprite *sprite); void InitAnimArcTranslation(struct Sprite *sprite); bool8 AnimTranslateLinear(struct Sprite *sprite); void TranslateAnimSpriteToTargetMonLocation(struct Sprite *sprite); -void sub_80A8EE4(struct Sprite *sprite); u8 GetBattlerSpriteCoord2(u8 battlerId, u8 attributeId); void sub_80A6FD4(struct Sprite *sprite); u16 ArcTan2Neg(s16 a, s16 b); @@ -101,7 +101,7 @@ void SetAnimSpriteInitialXOffset(struct Sprite *sprite, s16 a2); s16 GetBattlerSpriteCoordAttr(u8 battlerId, u8 a2); u8 GetBattlerYCoordWithElevation(u8 battlerId); void WaitAnimForDuration(struct Sprite *sprite); -void AnimSnoreZ(struct Sprite *sprite); +void AnimTravelDiagonally(struct Sprite *sprite); void InitAnimLinearTranslation(struct Sprite *sprite); void sub_80A6F98(struct Sprite *sprite); u8 GetBattlerSpriteBGPriority(u8 battlerId); @@ -125,7 +125,7 @@ u8 sub_80A77AC(u8 a1); s16 CloneBattlerSpriteWithBlend(u8); void obj_delete_but_dont_free_vram(struct Sprite*); u8 sub_80A89C8(int, u8, int); -void sub_80A6D60(struct BattleAnimBgData*, const void*, u32); +void AnimLoadCompressedBgTilemapHandleContest(struct BattleAnimBgData*, const void*, u32); void AnimLoadCompressedBgGfx(u32, const u32*, u32); void sub_80A6DAC(bool8); void TranslateSpriteInGrowingCircleOverDuration(struct Sprite *); @@ -133,7 +133,6 @@ void sub_80A653C(struct Sprite *); void SetBattlerSpriteYOffsetFromYScale(u8 spriteId); void sub_80A805C(struct Task *task, u8 a2, s16 a3, s16 a4, s16 a5, s16 a6, u16 a7); u8 sub_80A80C8(struct Task *task); -void sub_80A8EE4(struct Sprite *); void DestroyAnimSpriteAndDisableBlend(struct Sprite *); void AnimLoadCompressedBgTilemap(u32 bgId, const void *src); void InitAnimFastLinearTranslationWithSpeed(struct Sprite *sprite); @@ -144,7 +143,7 @@ void TranslateSpriteLinear(struct Sprite *sprite); void AnimSpriteOnMonPos(struct Sprite *sprite); void sub_80A7000(struct Sprite *sprite); void TranslateSpriteInCircleOverDuration(struct Sprite *sprite); -void SetGreyscaleOrOriginalPalette(u16 a1, bool8 a2); +void SetGreyscaleOrOriginalPalette(u16 palNum, bool8 restoreOriginal); void PrepareAffineAnimInTaskData(struct Task *task, u8 spriteId, const union AffineAnimCmd *affineAnimCmds); bool8 RunAffineAnimFromTaskData(struct Task *task); void AnimThrowProjectile(struct Sprite *sprite); @@ -158,6 +157,8 @@ void SetBattlerSpriteYOffsetFromOtherYScale(u8 spriteId, u8 otherSpriteId); u8 GetBattlerSide(u8 battler); u8 GetBattlerPosition(u8 battler); u8 GetBattlerAtPosition(u8 position); +void sub_80A64EC(struct Sprite *sprite); +void sub_80A718C(struct Sprite *sprite); enum { @@ -192,11 +193,7 @@ void SetSpritePrimaryCoordsFromSecondaryCoords(struct Sprite *sprite); u8 GetBattlerSpriteDefault_Y(u8 battlerId); u8 GetSubstituteSpriteDefault_Y(u8 battlerId); -// battle_anim_80A64EC.c -void sub_80A64EC(struct Sprite *sprite); -void sub_80A718C(struct Sprite *sprite); - -// battle_anim_status_effects.s +// battle_anim_status_effects.c #define STAT_ANIM_PLUS1 15 #define STAT_ANIM_PLUS2 39 #define STAT_ANIM_MINUS1 22 @@ -207,8 +204,8 @@ void sub_80A718C(struct Sprite *sprite); #define STAT_ANIM_MULTIPLE_MINUS2 58 void LaunchStatusAnimation(u8 battlerId, u8 statusAnimId); -// ground.c -void sub_81152DC(u8 taskId); +// battle_anim_ground.c +void AnimTask_HorizontalShake(u8 taskId); // battle_anim_special.c void sub_8172EF0(u8 battler, struct Pokemon *mon); @@ -216,21 +213,22 @@ u8 ItemIdToBallId(u16 itemId); u8 AnimateBallOpenParticles(u8 x, u8 y, u8 priority, u8 subpriority, u8 ballId); u8 LaunchBallFadeMonTask(bool8 unFadeLater, u8 battlerId, u32 selectedPalettes, u8 ballId); -// battle_anim_utility_funcs.s +// battle_anim_utility_funcs.c void sub_8116EB4(u8); void sub_8117854(u8 taskId, int unused, u16 arg2, u8 battler1, u8 arg4, u8 arg5, u8 arg6, u8 arg7, const u32 *arg8, const u32 *arg9, const u32 *palette); // battle_anim_effects_1.c void SetSpriteNextToMonHead(u8 battler, struct Sprite* sprite); void AnimMoveTwisterParticle(struct Sprite* sprite); +void AnimParticleBurst(struct Sprite *); -// water.c +// battle_anim_water.c void AnimWaterPulseRing(struct Sprite *sprite); -// flying.c -void sub_810E2C8(struct Sprite *sprite); +// battle_anim_flying.c +void DestroyAnimSpriteAfterTimer(struct Sprite *sprite); -// smokescreen.c +// battle_anim_smokescreen.c u8 SmokescreenImpact(s16 x, s16 y, u8 a3); u32 UnpackSelectedBattleAnimPalettes(s16); @@ -285,4 +283,14 @@ extern const struct OamData gOamData_AffineOff_ObjBlend_16x32; extern const struct CompressedSpriteSheet gBattleAnimPicTable[]; extern const struct CompressedSpritePalette gBattleAnimPaletteTable[]; +extern const struct SpriteTemplate gWaterHitSplatSpriteTemplate; + +extern const union AnimCmd *const gAnims_WaterMudOrb[]; +extern const union AnimCmd *const gAnims_BasicFire[]; +extern const union AffineAnimCmd *const gGrowingRingAffineAnimTable[]; +extern const union AffineAnimCmd *const gAffineAnims_Droplet[]; +extern const union AnimCmd *const gAnims_SmallBubblePair[]; +extern const union AnimCmd *const gAnims_WaterBubble[]; +extern const union AffineAnimCmd *const gAffineAnims_Bite[]; + #endif // GUARD_BATTLE_ANIM_H diff --git a/include/battle_scripts.h b/include/battle_scripts.h index cac3a7652..75abaae3c 100644 --- a/include/battle_scripts.h +++ b/include/battle_scripts.h @@ -199,7 +199,7 @@ extern const u8 BattleScript_BerryPPHealEnd2[]; extern const u8 BattleScript_ItemHealHP_End2[]; extern const u8 BattleScript_ItemHealHP_Ret[]; extern const u8 BattleScript_SelectingNotAllowedMoveChoiceItem[]; -extern const u8 BattleScript_HangedOnMsg[]; +extern const u8 BattleScript_FocusBandActivates[]; extern const u8 BattleScript_BerryConfuseHealEnd2[]; extern const u8 BattleScript_BerryStatRaiseEnd2[]; extern const u8 BattleScript_BerryFocusEnergyEnd2[]; diff --git a/include/constants/battle_anim.h b/include/constants/battle_anim.h index 0fe231cdc..dfdd9f912 100644 --- a/include/constants/battle_anim.h +++ b/include/constants/battle_anim.h @@ -354,9 +354,9 @@ #define B_ANIM_POKEBLOCK_THROW 0x4 #define B_ANIM_ITEM_KNOCKOFF 0x5 #define B_ANIM_TURN_TRAP 0x6 -#define B_ANIM_ITEM_EFFECT 0x7 +#define B_ANIM_HELD_ITEM_EFFECT 0x7 #define B_ANIM_SMOKEBALL_ESCAPE 0x8 -#define B_ANIM_HANGED_ON 0x9 +#define B_ANIM_FOCUS_BAND 0x9 #define B_ANIM_RAIN_CONTINUES 0xA #define B_ANIM_SUN_CONTINUES 0xB #define B_ANIM_SANDSTORM_CONTINUES 0xC @@ -392,8 +392,8 @@ #define B_ANIM_STATUS_NIGHTMARE 0x8 #define B_ANIM_STATUS_WRAPPED 0x9 // does not actually exist -// Most tasks return a value to gBattleAnimArgs[7]. -#define ARG_RET_ID 0x7 +// Tasks with return values often assign them to gBattleAnimArgs[7]. +#define ARG_RET_ID 7 // Trapping Wrap-like moves end turn animation. #define TRAP_ANIM_BIND 0 diff --git a/include/constants/flags.h b/include/constants/flags.h index e0b383d7b..4dd18880f 100644 --- a/include/constants/flags.h +++ b/include/constants/flags.h @@ -459,9 +459,9 @@ #define FLAG_DEFEATED_DEOXYS 0x1AC #define FLAG_BATTLED_DEOXYS 0x1AD -#define FLAG_HAS_EON_TICKET 0x1AE -#define FLAG_HAS_AURORA_TICKET 0x1AF -#define FLAG_HAS_OLD_SEA_MAP 0x1B0 +#define FLAG_SHOWN_EON_TICKET 0x1AE +#define FLAG_SHOWN_AURORA_TICKET 0x1AF +#define FLAG_SHOWN_OLD_SEA_MAP 0x1B0 #define FLAG_MOVE_TUTOR_TAUGHT_SWAGGER 0x1B1 #define FLAG_MOVE_TUTOR_TAUGHT_ROLLOUT 0x1B2 #define FLAG_MOVE_TUTOR_TAUGHT_FURY_CUTTER 0x1B3 @@ -506,7 +506,7 @@ #define FLAG_UNUSED_0x1DA 0x1DA // Unused Flag -#define FLAG_HAS_MYSTIC_TICKET 0x1DB +#define FLAG_SHOWN_MYSTIC_TICKET 0x1DB #define FLAG_DEFEATED_HO_OH 0x1DC #define FLAG_DEFEATED_LUGIA 0x1DD @@ -1448,10 +1448,9 @@ #define FLAG_SYS_REGIROCK_PUZZLE_COMPLETED (SYSTEM_FLAGS + 0x50) #define FLAG_SYS_BRAILLE_REGICE_COMPLETED (SYSTEM_FLAGS + 0x51) #define FLAG_SYS_REGISTEEL_PUZZLE_COMPLETED (SYSTEM_FLAGS + 0x52) -#define FLAG_SYS_HAS_EON_TICKET (SYSTEM_FLAGS + 0x53) +#define FLAG_ENABLE_SHIP_SOUTHERN_ISLAND (SYSTEM_FLAGS + 0x53) #define FLAG_LANDMARK_POKEMON_LEAGUE (SYSTEM_FLAGS + 0x54) - #define FLAG_LANDMARK_ISLAND_CAVE (SYSTEM_FLAGS + 0x55) #define FLAG_LANDMARK_DESERT_RUINS (SYSTEM_FLAGS + 0x56) #define FLAG_LANDMARK_FOSSIL_MANIACS_HOUSE (SYSTEM_FLAGS + 0x57) diff --git a/include/constants/heal_locations.h b/include/constants/heal_locations.h index 64c8956a9..272a69dfa 100644 --- a/include/constants/heal_locations.h +++ b/include/constants/heal_locations.h @@ -11,16 +11,16 @@ #define HEAL_LOCATION_LILYCOVE_CITY 8 #define HEAL_LOCATION_MOSSDEEP_CITY 9 #define HEAL_LOCATION_SOOTOPOLIS_CITY 10 -#define HEAL_LOCATION_EVER_GRANDE_CITY_1 11 -#define HEAL_LOCATION_LITTLEROOT_TOWN_1 12 -#define HEAL_LOCATION_LITTLEROOT_TOWN_2 13 +#define HEAL_LOCATION_EVER_GRANDE_CITY 11 +#define HEAL_LOCATION_LITTLEROOT_TOWN_BRENDANS_HOUSE 12 +#define HEAL_LOCATION_LITTLEROOT_TOWN_MAYS_HOUSE 13 #define HEAL_LOCATION_OLDALE_TOWN 14 #define HEAL_LOCATION_DEWFORD_TOWN 15 #define HEAL_LOCATION_LAVARIDGE_TOWN 16 #define HEAL_LOCATION_FALLARBOR_TOWN 17 #define HEAL_LOCATION_VERDANTURF_TOWN 18 #define HEAL_LOCATION_PACIFIDLOG_TOWN 19 -#define HEAL_LOCATION_EVER_GRANDE_CITY_2 20 +#define HEAL_LOCATION_EVER_GRANDE_CITY_POKEMON_LEAGUE 20 #define HEAL_LOCATION_SOUTHERN_ISLAND_EXTERIOR 21 #define HEAL_LOCATION_BATTLE_FRONTIER_OUTSIDE_EAST 22 diff --git a/include/constants/region_map_sections.h b/include/constants/region_map_sections.h index 42f3f8282..5e64048dd 100644 --- a/include/constants/region_map_sections.h +++ b/include/constants/region_map_sections.h @@ -175,7 +175,7 @@ #define MAPSEC_SEVII_ISLE_22 0xAB #define MAPSEC_SEVII_ISLE_23 0xAC #define MAPSEC_SEVII_ISLE_24 0xAD -#define MAPSEC_NAVEL_ROCK 0xAE +#define MAPSEC_NAVEL_ROCK_FRLG 0xAE #define MAPSEC_MT_EMBER 0xAF #define MAPSEC_BERRY_FOREST 0xB0 #define MAPSEC_ICEFALL_CAVE 0xB1 @@ -184,11 +184,11 @@ #define MAPSEC_DOTTED_HOLE 0xB4 #define MAPSEC_LOST_CAVE 0xB5 #define MAPSEC_PATTERN_BUSH 0xB6 -#define MAPSEC_ALTERING_CAVE 0xB7 +#define MAPSEC_ALTERING_CAVE_FRLG 0xB7 #define MAPSEC_TANOBY_CHAMBERS 0xB8 #define MAPSEC_THREE_ISLE_PATH 0xB9 #define MAPSEC_TANOBY_KEY 0xBA -#define MAPSEC_BIRTH_ISLAND 0xBB +#define MAPSEC_BIRTH_ISLAND_FRLG 0xBB #define MAPSEC_MONEAN_CHAMBER 0xBC #define MAPSEC_LIPTOO_CHAMBER 0xBD #define MAPSEC_WEEPTH_CHAMBER 0xBE @@ -201,7 +201,7 @@ #define MAPSEC_AQUA_HIDEOUT 0xC5 #define MAPSEC_MAGMA_HIDEOUT 0xC6 #define MAPSEC_MIRAGE_TOWER 0xC7 -#define MAPSEC_BIRTH_ISLAND_2 0xC8 +#define MAPSEC_BIRTH_ISLAND 0xC8 #define MAPSEC_FARAWAY_ISLAND 0xC9 #define MAPSEC_ARTISAN_CAVE 0xCA #define MAPSEC_MARINE_CAVE 0xCB @@ -211,8 +211,8 @@ #define MAPSEC_UNDERWATER_UNK1 0xCF #define MAPSEC_UNDERWATER_129 0xD0 #define MAPSEC_DESERT_UNDERPASS 0xD1 -#define MAPSEC_ALTERING_CAVE_2 0xD2 -#define MAPSEC_NAVEL_ROCK2 0xD3 +#define MAPSEC_ALTERING_CAVE 0xD2 +#define MAPSEC_NAVEL_ROCK 0xD3 #define MAPSEC_TRAINER_HILL 0xD4 #define MAPSEC_NONE 0xD5 diff --git a/include/constants/weather.h b/include/constants/weather.h index 98a0a2e1e..aa0309882 100644 --- a/include/constants/weather.h +++ b/include/constants/weather.h @@ -39,28 +39,31 @@ // These are the "abnormal weather events" that are used // to find Kyogre and Groudon. -#define ABNORMAL_WEATHER_COUNT_PER_LEGENDARY 8 -#define ABNORMAL_WEATHER_GROUDON_LOCATIONS_START 1 -#define ABNORMAL_WEATHER_KYOGRE_LOCATIONS_START 1 + ABNORMAL_WEATHER_COUNT_PER_LEGENDARY +#define ABNORMAL_WEATHER_LOCATIONS (MARINE_CAVE_LOCATIONS + TERRA_CAVE_LOCATIONS) +#define ABNORMAL_WEATHER_NONE 0 -#define ABNORMAL_WEATHER_NONE 0 -// Groudon locations -#define ABNORMAL_WEATHER_ROUTE_114_NORTH 1 -#define ABNORMAL_WEATHER_ROUTE_114_SOUTH 2 -#define ABNORMAL_WEATHER_ROUTE_115_WEST 3 -#define ABNORMAL_WEATHER_ROUTE_115_EAST 4 -#define ABNORMAL_WEATHER_ROUTE_116_NORTH 5 -#define ABNORMAL_WEATHER_ROUTE_116_SOUTH 6 -#define ABNORMAL_WEATHER_ROUTE_118_EAST 7 -#define ABNORMAL_WEATHER_ROUTE_118_WEST 8 -// Kyogre locations -#define ABNORMAL_WEATHER_ROUTE_105_NORTH 9 -#define ABNORMAL_WEATHER_ROUTE_105_SOUTH 10 -#define ABNORMAL_WEATHER_ROUTE_125_WEST 11 -#define ABNORMAL_WEATHER_ROUTE_125_EAST 12 -#define ABNORMAL_WEATHER_ROUTE_127_NORTH 13 -#define ABNORMAL_WEATHER_ROUTE_127_SOUTH 14 -#define ABNORMAL_WEATHER_ROUTE_129_WEST 15 -#define ABNORMAL_WEATHER_ROUTE_129_EAST 16 +// Groudon/Terra Cave locations +#define TERRA_CAVE_LOCATIONS_START 1 +#define ABNORMAL_WEATHER_ROUTE_114_NORTH (TERRA_CAVE_LOCATIONS_START + 0) +#define ABNORMAL_WEATHER_ROUTE_114_SOUTH (TERRA_CAVE_LOCATIONS_START + 1) +#define ABNORMAL_WEATHER_ROUTE_115_WEST (TERRA_CAVE_LOCATIONS_START + 2) +#define ABNORMAL_WEATHER_ROUTE_115_EAST (TERRA_CAVE_LOCATIONS_START + 3) +#define ABNORMAL_WEATHER_ROUTE_116_NORTH (TERRA_CAVE_LOCATIONS_START + 4) +#define ABNORMAL_WEATHER_ROUTE_116_SOUTH (TERRA_CAVE_LOCATIONS_START + 5) +#define ABNORMAL_WEATHER_ROUTE_118_EAST (TERRA_CAVE_LOCATIONS_START + 6) +#define ABNORMAL_WEATHER_ROUTE_118_WEST (TERRA_CAVE_LOCATIONS_START + 7) +#define TERRA_CAVE_LOCATIONS 8 + +// Kyogre/Marina Cave locations +#define MARINE_CAVE_LOCATIONS_START (TERRA_CAVE_LOCATIONS_START + TERRA_CAVE_LOCATIONS) +#define ABNORMAL_WEATHER_ROUTE_105_NORTH (MARINE_CAVE_LOCATIONS_START + 0) +#define ABNORMAL_WEATHER_ROUTE_105_SOUTH (MARINE_CAVE_LOCATIONS_START + 1) +#define ABNORMAL_WEATHER_ROUTE_125_WEST (MARINE_CAVE_LOCATIONS_START + 2) +#define ABNORMAL_WEATHER_ROUTE_125_EAST (MARINE_CAVE_LOCATIONS_START + 3) +#define ABNORMAL_WEATHER_ROUTE_127_NORTH (MARINE_CAVE_LOCATIONS_START + 4) +#define ABNORMAL_WEATHER_ROUTE_127_SOUTH (MARINE_CAVE_LOCATIONS_START + 5) +#define ABNORMAL_WEATHER_ROUTE_129_WEST (MARINE_CAVE_LOCATIONS_START + 6) +#define ABNORMAL_WEATHER_ROUTE_129_EAST (MARINE_CAVE_LOCATIONS_START + 7) +#define MARINE_CAVE_LOCATIONS 8 #endif // GUARD_CONSTANTS_WEATHER_H diff --git a/include/event_scripts.h b/include/event_scripts.h index a56ab89e0..d147dd4f1 100644 --- a/include/event_scripts.h +++ b/include/event_scripts.h @@ -4,7 +4,7 @@ extern const u8 EventScript_TestSignpostMsg[]; extern const u8 EventScript_TryGetTrainerScript[]; extern const u8 EventScript_271354[]; -extern const u8 EventScript_DoTainerBattle[]; +extern const u8 EventScript_DoNoIntroTrainerBattle[]; extern const u8 EventScript_TryDoDoubleTrainerBattle[]; extern const u8 EventScript_TryDoNormalTrainerBattle[]; extern const u8 EventScript_TryDoDoubleRematchBattle[]; diff --git a/include/graphics.h b/include/graphics.h index 4dba50833..161ef4271 100644 --- a/include/graphics.h +++ b/include/graphics.h @@ -4634,15 +4634,15 @@ extern const u32 gBattleAnimSpritePal_ThoughtBubble[]; extern const u32 gBattleAnimSpritePal_MagentaHeart[]; extern const u32 gBattleAnimSpritePal_ElectricOrbs[]; extern const u32 gBattleAnimSpritePal_MovementWaves[]; -extern const u32 gUnknown_08C249D0[]; -extern const u32 gUnknown_08C249F8[]; +extern const u32 gBattleAnimBgPalette_ScaryFace[]; +extern const u32 gBattleAnimBgImage_ScaryFace[]; extern const u32 gBattleAnimSpritePal_RedHeart[]; extern const u32 gBattleAnimSpritePal_RedOrb[]; extern const u32 gBattleAnimSpritePal_EyeSparkle[]; extern const u32 gBattleAnimSpritePal_PinkHeart[]; -extern const u32 gUnknown_08C232E0; -extern const u32 gUnknown_08C23D50; -extern const u32 gUnknown_08C23D78; +extern const u32 gBattleAnimBgImage_Attract; +extern const u32 gBattleAnimBgPalette_Attract; +extern const u32 gBattleAnimBgTilemap_Attract; extern const u32 gBattleAnimSpritePal_Angel[]; extern const u32 gBattleAnimSpritePal_Devil[]; extern const u32 gBattleAnimSpritePal_Swipe[]; @@ -4747,9 +4747,9 @@ extern const u32 gBattleAnimBgTilemap_Drill[]; extern const u32 gBattleAnimBgTilemap_DrillContests[]; extern const u32 gBattleAnimBgTilemap_HighspeedOpponent[]; extern const u32 gBattleAnimBgTilemap_HighspeedPlayer[]; -extern const u32 gUnknown_08C2A634[]; -extern const u32 gUnknown_08C2A6D4[]; -extern const u32 gUnknown_08C2A6EC[]; +extern const u32 gBattleAnimMaskImage_LightBeam[]; +extern const u32 gBattleAnimMaskPalette_LightBeam[]; +extern const u32 gBattleAnimMaskTilemap_LightBeam[]; extern const u32 gBattleAnimBgTilemap_Thunder[]; extern const u32 gBattleAnimBgTilemap_GuillotineOpponent[]; extern const u32 gBattleAnimBgTilemap_GuillotinePlayer[]; @@ -4796,9 +4796,9 @@ extern const u32 gContestJudgeGfx[]; extern const u32 gContestJudgeSymbolsGfx[]; extern const u32 gContest3Pal[]; -extern const u32 gUnknown_08D95E00[]; -extern const u32 gUnknown_08D960D0[]; -extern const u32 gUnknown_08D963A4[]; +extern const u32 gBattleAnimBgTilemap_SurfOpponent[]; +extern const u32 gBattleAnimBgTilemap_SurfPlayer[]; +extern const u32 gBattleAnimBgTilemap_SurfContest[]; extern const u32 gBattleAnimBgImage_Surf[]; extern const u32 gBattleAnimBgPalette_Surf[]; extern const u32 gBattleAnimBackgroundImageMuddyWater_Pal[]; @@ -4873,8 +4873,8 @@ extern const u16 gUnknown_08DCF210[]; extern const u16 gUnknown_08DCF230[]; extern const u16 gUnknown_08DCF190[]; -extern const u32 gUnknown_08D8D410[]; -extern const u32 gUnknown_08D8D58C[]; +extern const u32 gBattleAnimBgTilemap_Sandstorm[]; +extern const u32 gBattleAnimBgImage_Sandstorm[]; // Pokedex Area Screen extern const u32 gPokedexAreaScreenAreaUnknown_Gfx[]; diff --git a/include/pokedex_area_region_map.h b/include/pokedex_area_region_map.h new file mode 100755 index 000000000..175f60c74 --- /dev/null +++ b/include/pokedex_area_region_map.h @@ -0,0 +1,17 @@ +#ifndef GUARD_POKEDEX_AREA_REGION_MAP_H +#define GUARD_POKEDEX_AREA_REGION_MAP_H + +struct PokedexAreaMapTemplate +{ + u32 bg:2; + u32 offset:8; + u32 mode:2; + u32 unk:20; // never read +}; + +void LoadPokedexAreaMapGfx(const struct PokedexAreaMapTemplate *); +bool32 sub_81C4E90(void); +void PokedexAreaMapChangeBgY(u32); +void FreePokedexAreaMapBgNum(void); + +#endif // GUARD_POKEDEX_AREA_REGION_MAP_H diff --git a/include/pokenav.h b/include/pokenav.h index fe5616618..3eafe9af2 100644 --- a/include/pokenav.h +++ b/include/pokenav.h @@ -65,24 +65,44 @@ enum POKENAV_MODE_FORCE_CALL_EXIT, // Pokenav tutorial after calling Mr. Stone }; +enum +{ + POKENAV_GFX_MAIN_MENU, + POKENAV_GFX_CONDITION_MENU, + POKENAV_GFX_RIBBONS_MENU, + POKENAV_GFX_MATCH_CALL_MENU, + POKENAV_GFX_MAP_MENU_ZOOMED_OUT, + POKENAV_GFX_MAP_MENU_ZOOMED_IN, + POKENAV_GFX_PARTY_MENU, + POKENAV_GFX_SEARCH_MENU, + POKENAV_GFX_COOL_MENU, + POKENAV_GFX_BEAUTY_MENU, + POKENAV_GFX_CUTE_MENU, + POKENAV_GFX_SMART_MENU, + POKENAV_GFX_TOUGH_MENU, + POKENAV_GFX_MENUS_END, +}; + +#define POKENAV_GFX_SUBMENUS_START POKENAV_GFX_PARTY_MENU + #define POKENAV_MENU_IDS_START 100000 enum { - POKENAV_MENU_0 = POKENAV_MENU_IDS_START, - POKENAV_MENU_1, - POKENAV_MENU_2, - POKENAV_MENU_3, - POKENAV_MENU_4, - POKENAV_MENU_5, - POKENAV_MENU_6, - POKENAV_MENU_7, - POKENAV_MENU_8, - POKENAV_MENU_9, - POKENAV_MENU_A, - POKENAV_MENU_B, - POKENAV_MENU_C, - POKENAV_MENU_D, - POKENAV_MENU_E, + POKENAV_MAIN_MENU = POKENAV_MENU_IDS_START, + POKENAV_MAIN_MENU_CURSOR_ON_MAP, + POKENAV_CONDITION_MENU, + POKENAV_CONDITION_SEARCH_MENU, + POKENAV_MAIN_MENU_CURSOR_ON_MATCH_CALL, + POKENAV_MAIN_MENU_CURSOR_ON_RIBBONS, + POKENAV_REGION_MAP, + POKENAV_CONDITION_PARTY, + POKENAV_CONDITION_SEARCH_RESULTS, + POKENAV_MENU_9, // Condition + POKENAV_MENU_A, // Condition + POKENAV_MATCH_CALL, + POKENAV_RIBBONS_MON_LIST, + POKENAV_MENU_D, // Ribbons + POKENAV_MENU_E, // Ribbons }; enum @@ -220,6 +240,15 @@ enum POKENAV_MC_FUNC_EXIT }; +enum +{ + POKENAV_MAP_FUNC_NONE, + POKENAV_MAP_FUNC_CURSOR_MOVED, + POKENAV_MAP_FUNC_ZOOM_OUT, + POKENAV_MAP_FUNC_ZOOM_IN, + POKENAV_MAP_FUNC_EXIT, +}; + // pokenav.c void SetSelectedConditionSearch(u32); u32 GetSelectedConditionSearch(void); @@ -275,7 +304,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(s32 a0); +void PokenavFadeScreen(s32 fadeType); bool32 sub_81C8010(void); void InitBgTemplates(const struct BgTemplate *templates, int count); bool32 IsPaletteFadeActive(void); @@ -298,30 +327,30 @@ void sub_81C7834(void *func1, void *func2); void ShutdownPokenav(void); // pokenav_menu_handler_1.c -bool32 PokenavCallback_Init_0(void); -bool32 PokenavCallback_Init_4(void); -bool32 PokenavCallback_Init_5(void); -bool32 PokenavCallback_Init_2(void); -bool32 PokenavCallback_Init_3(void); -u32 sub_81C941C(void); -void sub_81C9430(void); +bool32 PokenavCallback_Init_MainMenuCursorOnMap(void); +bool32 PokenavCallback_Init_MainMenuCursorOnMatchCall(void); +bool32 PokenavCallback_Init_MainMenuCursorOnRibbons(void); +bool32 PokenavCallback_Init_ConditionMenu(void); +bool32 PokenavCallback_Init_ConditionSearchMenu(void); +u32 GetMenuHandlerCallback(void); +void FreeMenuHandlerSubstruct1(void); int GetPokenavMenuType(void); int GetPokenavCursorPos(void); int GetCurrentMenuItemId(void); u16 GetHelpBarTextId(void); // pokenav_menu_handler_2.c -bool32 sub_81C9924(void); -bool32 sub_81C9940(void); +bool32 OpenPokenavMenuInitial(void); +bool32 OpenPokenavMenuNotInitial(void); void CreateMenuHandlerLoopedTask(s32 ltIdx); -bool32 sub_81C99C0(void); -void sub_81C99D4(void); +bool32 IsMenuHandlerLoopedTaskActive(void); +void FreeMenuHandlerSubstruct2(void); void sub_81CAADC(void); // pokenav_match_call_1.c -bool32 PokenavCallback_Init_11(void); -u32 sub_81CAB24(void); -void sub_81CAB38(void); +bool32 PokenavCallback_Init_MatchCall(void); +u32 GetMatchCallCallback(void); +void FreeMatchCallSubstruct1(void); int sub_81CAE28(void); int GetNumberRegistered(void); int sub_81CAE48(void); @@ -341,19 +370,19 @@ int GetIndexDeltaOfNextCheckPageUp(int index); bool32 IsRematchEntryRegistered(int index); // pokenav_match_call_2.c -bool32 sub_81CB260(void); +bool32 OpenMatchCall(void); void CreateMatchCallLoopedTask(s32 index); -u32 sub_81CB2CC(void); -void sub_81CB2E0(void); +bool32 IsMatchCallLoopedTaskActive(void); +void FreeMatchCallSubstruct2(void); // pokenav_region_map.c -u32 PokenavCallback_Init_6(void); -void sub_81CC524(void); -u32 sub_81CC554(void); -bool32 sub_81CC5F4(void); -void sub_81CC62C(s32); -u32 sub_81CC65C(void); -void sub_81CC670(void); +u32 PokenavCallback_Init_RegionMap(void); +u32 GetRegionMapCallback(void); +bool32 OpenPokenavRegionMap(void); +void CreateRegionMapLoopedTask(s32); +bool32 IsRegionMapLoopedTaskActive(void); +void FreeRegionMapSubstruct1(void); +void FreeRegionMapSubstruct2(void); // pokenav_conditions_1.c u32 PokenavCallback_Init_7(void); diff --git a/include/random.h b/include/random.h index 79a9d71dc..6bf61de6c 100644 --- a/include/random.h +++ b/include/random.h @@ -11,6 +11,11 @@ u16 Random2(void); //Returns a 32-bit pseudorandom number #define Random32() (Random() | (Random() << 16)) +// The number 1103515245 comes from the example implementation of rand and srand +// in the ISO C standard. +#define ISO_RANDOMIZE1(val)(1103515245 * (val) + 24691) +#define ISO_RANDOMIZE2(val)(1103515245 * (val) + 12345) + //Sets the initial seed value of the pseudorandom number generator void SeedRng(u16 seed); void SeedRng2(u16 seed); diff --git a/include/region_map.h b/include/region_map.h index 0d219643d..97364abd8 100644 --- a/include/region_map.h +++ b/include/region_map.h @@ -4,20 +4,21 @@ #include "bg.h" // Exported type declarations +#define MAP_NAME_LENGTH 16 enum { - INPUT_EVENT_NONE, - INPUT_EVENT_MOVE_START, - INPUT_EVENT_MOVE_CONT, - INPUT_EVENT_MOVE_END, - INPUT_EVENT_A_BUTTON, - INPUT_EVENT_B_BUTTON, + MAP_INPUT_NONE, + MAP_INPUT_MOVE_START, + MAP_INPUT_MOVE_CONT, + MAP_INPUT_MOVE_END, + MAP_INPUT_A_BUTTON, + MAP_INPUT_B_BUTTON, }; enum { MAPSECTYPE_NONE, - MAPSECTYPE_PLAIN, + MAPSECTYPE_ROUTE, MAPSECTYPE_CITY_CANFLY, MAPSECTYPE_CITY_CANTFLY, MAPSECTYPE_BATTLE_FRONTIER @@ -25,9 +26,9 @@ enum { struct RegionMap { /*0x000*/ u16 mapSecId; - /*0x002*/ u8 iconDrawType; + /*0x002*/ u8 mapSecType; /*0x003*/ u8 posWithinMapSec; - /*0x004*/ u8 mapSecName[0x14]; + /*0x004*/ u8 mapSecName[20]; /*0x018*/ u8 (*inputCallback)(void); /*0x01c*/ struct Sprite *cursorSprite; /*0x020*/ struct Sprite *playerIconSprite; @@ -90,28 +91,28 @@ struct RegionMapLocation // Exported RAM declarations // Exported ROM declarations -void sub_8122CF8(struct RegionMap *regionMap, const struct BgTemplate *template, bool8 zoomed); -bool8 sub_8122DB0(void); +void InitRegionMapData(struct RegionMap *regionMap, const struct BgTemplate *template, bool8 zoomed); +bool8 LoadRegionMapGfx(void); void UpdateRegionMapVideoRegs(void); void InitRegionMap(struct RegionMap *regionMap, u8 argument); -u8 sub_81230AC(void); -bool8 sub_8123514(void); +u8 DoRegionMapInputCallback(void); +bool8 UpdateRegionMapZoom(void); void FreeRegionMapIconResources(void); -u16 GetRegionMapSectionIdAt(u16 x, u16 y); +u16 GetRegionMapSecIdAt(u16 x, u16 y); void CreateRegionMapPlayerIcon(u16 x, u16 y); void CreateRegionMapCursor(u16 tileTag, u16 paletteTag); +bool32 IsEventIslandMapSecId(u8 mapSecId); u8 *GetMapName(u8 *, u16, u16); -bool32 sub_8124668(u8 mapSecId); u8 *GetMapNameGeneric(u8 *dest, u16 mapSecId); -u8 *sub_8124610(u8 *dest, u16 mapSecId); +u8 *GetMapNameHandleAquaHideout(u8 *dest, u16 mapSecId); u16 CorrectSpecialMapSecId(u16 mapSecId); -void sub_8122D88(struct RegionMap *regionMap); +void ShowRegionMapForPokedexAreaScreen(struct RegionMap *regionMap); void PokedexAreaScreen_UpdateRegionMapVariablesAndVideoRegs(s16 x, s16 y); -void MCB2_FlyMap(void); -bool8 sub_8124658(void); -void sub_812454C(void); -void sub_8123030(u16 a0, u32 a1); -void sub_8123418(void); +void CB2_OpenFlyMap(void); +bool8 IsRegionMapZoomed(void); +void TrySetPlayerIconBlink(void); +void sub_8123030(u16 color, u32 coeff); +void SetRegionMapDataForZoom(void); extern const struct RegionMapLocation gRegionMapEntries[]; diff --git a/include/unk_pokedex_area_screen_helper.h b/include/unk_pokedex_area_screen_helper.h deleted file mode 100755 index 45beed70e..000000000 --- a/include/unk_pokedex_area_screen_helper.h +++ /dev/null @@ -1,17 +0,0 @@ -#ifndef GUARD_UNK_POKEDEX_AREA_SCREEN_HELPER_H -#define GUARD_UNK_POKEDEX_AREA_SCREEN_HELPER_H - -struct UnkStruct_1C4D70 -{ - u32 bg:2; - u32 unk2:8; - u32 unk10:2; - u32 unk12:20; -}; - -void sub_81C4D70(const struct UnkStruct_1C4D70 *); -bool32 sub_81C4E90(void); -void sub_81C4ED0(u32); -void sub_81C4EB4(void); - -#endif // GUARD_UNK_POKEDEX_AREA_SCREEN_HELPER_H |