From 5b910a11b4f6d548b6643455ccb806c0e60f48a2 Mon Sep 17 00:00:00 2001 From: Kurausukun Date: Thu, 18 Mar 2021 20:35:39 -0400 Subject: port miscellaneous fr documentation --- include/overworld.h | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) (limited to 'include') diff --git a/include/overworld.h b/include/overworld.h index a2eac7e29..6efaa6ccb 100644 --- a/include/overworld.h +++ b/include/overworld.h @@ -152,10 +152,10 @@ u16 sub_8087288(void); u16 sub_808729C(void); u16 QueueExitLinkRoomKey(void); u16 sub_80872C4(void); -bool32 sub_8087598(void); -bool32 sub_80875C8(void); -bool32 sub_8087634(void); -bool32 sub_808766C(void); +bool32 Overworld_LinkRecvQueueLengthMoreThan2(void); +bool32 Overworld_RecvKeysFromLinkIsRunning(void); +bool32 Overworld_SendKeysToLinkIsRunning(void); +bool32 IsSendingKeysOverCable(void); void ClearLinkPlayerObjectEvents(void); #endif // GUARD_OVERWORLD_H -- cgit v1.2.3 From c86cc8b371efa875446796fb44c7e285c4b26f70 Mon Sep 17 00:00:00 2001 From: GriffinR Date: Fri, 5 Mar 2021 15:13:08 -0500 Subject: Document intro, start intro_credits/credits --- include/graphics.h | 16 ++++++------ include/intro_credits_graphics.h | 53 +++++++++++++++++++++++----------------- include/title_screen.h | 2 +- 3 files changed, 38 insertions(+), 33 deletions(-) (limited to 'include') diff --git a/include/graphics.h b/include/graphics.h index b1a781fff..9af68a052 100644 --- a/include/graphics.h +++ b/include/graphics.h @@ -3874,8 +3874,8 @@ extern const u32 gBagPalette[]; extern const u32 gBerryCheckCircle_Gfx[]; //intro graphics -extern const u32 gIntro1SparkleGfx[]; -extern const u32 gIntro1FlygonGfx[]; +extern const u32 gIntro1Sparkle_Gfx[]; +extern const u32 gIntro1Flygon_Gfx[]; extern const u16 gIntro3LightningPal[]; extern const u32 gIntroCopyright_Gfx[]; extern const u32 gIntroCopyright_Tilemap[]; @@ -3886,8 +3886,8 @@ extern const u32 gIntro2ManectricGfx[]; extern const u16 gIntro2VolbeatPal[]; extern const u16 gIntro2TorchicPal[]; extern const u16 gIntro2ManectricPal[]; -extern const u32 gIntro2BubblesGfx[]; -extern const u16 gIntro2BubblesPal[]; +extern const u32 gIntro3Bubbles_Gfx[]; +extern const u16 gIntro3Bubbles_Pal[]; extern const u32 gIntro3LightningGfx[]; extern const u32 gIntro3GroudonGfx[]; extern const u32 gIntro3GroudonTilemap[]; @@ -3907,11 +3907,9 @@ extern const u32 gIntro3RayquazaTilemap[]; extern const u32 gIntro3RayquazaGfx[]; extern const u32 gIntro3Clouds2Gfx[]; extern const u16 gIntro1GameFreakTextFadePal[]; - -//intro/credits graphics -extern const u32 gIntro2BrendanNoTurnGfx[]; -extern const u32 gIntro2MayNoTurnGfx[]; -extern const u16 gIntro2BrendanNoTurnPal[]; +extern const u32 gIntro2BrendanGfx[]; +extern const u32 gIntro2MayGfx[]; +extern const u16 gIntro2PlayerPal[]; extern const u16 gIntro2FlygonPal[]; extern const u32 gIntro2FlygonGfx[]; diff --git a/include/intro_credits_graphics.h b/include/intro_credits_graphics.h index 2c7ceaf57..431446ed2 100644 --- a/include/intro_credits_graphics.h +++ b/include/intro_credits_graphics.h @@ -1,30 +1,37 @@ #ifndef GUARD_INTRO_CREDITS_GRAPHICS_H #define GUARD_INTRO_CREDITS_GRAPHICS_H -extern u16 gUnknown_0203BD24; -extern s16 gUnknown_0203BD26; -extern s16 gUnknown_0203BD28; +// States for gIntroCredits_MovingSceneryState +enum { + INTROCRED_SCENERY_MOVING, + INTROCRED_SCENERY_DESTROY, + INTROCRED_SCENERY_FROZEN, +}; -extern const struct CompressedSpriteSheet gIntro2BrendanSpriteSheet[]; -extern const struct CompressedSpriteSheet gIntro2MaySpriteSheet[]; -extern const struct CompressedSpriteSheet gIntro2BicycleSpriteSheet[]; -extern const struct CompressedSpriteSheet gIntro2FlygonSpriteSheet[]; -extern const struct SpritePalette gIntroBikeAndFlygonPalette[]; -extern const struct CompressedSpriteSheet gUnknown_085F5334[]; -extern const struct CompressedSpriteSheet gUnknown_085F5344[]; -extern const struct CompressedSpriteSheet gUnknown_085F5354[]; -extern const struct CompressedSpriteSheet gUnknown_085F53AC[]; -extern const struct CompressedSpriteSheet gUnknown_085F53BC[]; -extern const struct SpritePalette gUnknown_085F5384[]; +extern u16 gIntroCredits_MovingSceneryVBase; +extern s16 gIntroCredits_MovingSceneryVOffset; +extern s16 gIntroCredits_MovingSceneryState; -void load_intro_part2_graphics(u8 a); -void sub_817B150(u8 a); -void sub_817B1C8(u8); -void sub_817B3A8(u8); -u8 CreateBicycleAnimationTask(u8 a, u16 b, u16 c, u16 d); -void sub_817B540(u8); -u8 intro_create_brendan_sprite(s16 a, s16 b); -u8 intro_create_may_sprite(s16 a, s16 b); -u8 intro_create_flygon_sprite(s16 a, s16 b); +extern const struct CompressedSpriteSheet gSpriteSheet_IntroBrendan[]; +extern const struct CompressedSpriteSheet gSpriteSheet_IntroMay[]; +extern const struct CompressedSpriteSheet gSpriteSheet_IntroBicycle[]; +extern const struct CompressedSpriteSheet gSpriteSheet_IntroFlygon[]; +extern const struct SpritePalette gSpritePalettes_IntroPlayerFlygon[]; +extern const struct CompressedSpriteSheet gSpriteSheet_CreditsBrendan[]; +extern const struct CompressedSpriteSheet gSpriteSheet_CreditsMay[]; +extern const struct CompressedSpriteSheet gSpriteSheet_CreditsBicycle[]; +extern const struct CompressedSpriteSheet gSpriteSheet_CreditsRivalBrendan[]; +extern const struct CompressedSpriteSheet gSpriteSheet_CreditsRivalMay[]; +extern const struct SpritePalette gSpritePalettes_Credits[]; + +void LoadIntroPart2Graphics(u8 scene); +void SetIntroPart2BgCnt(u8 a); +void LoadCreditsSceneGraphics(u8); +void SetCreditsSceneBgCnt(u8); +u8 CreateBicycleBgAnimationTask(u8 a, u16 b, u16 c, u16 d); +void CycleSceneryPalette(u8); +u8 CreateIntroBrendanSprite(s16 x, s16 y); +u8 CreateIntroMaySprite(s16 x, s16 y); +u8 CreateIntroFlygonSprite(s16 x, s16 y); #endif // GUARD_INTRO_CREDITS_GRAPHICS_H diff --git a/include/title_screen.h b/include/title_screen.h index b7100f124..0c80db5bf 100644 --- a/include/title_screen.h +++ b/include/title_screen.h @@ -1,7 +1,7 @@ #ifndef GUARD_TITLE_SCREEN_H #define GUARD_TITLE_SCREEN_H -extern const u16 gIntroWaterDropAlphaBlend[]; +extern const u16 gTitleScreenAlphaBlend[64]; void CB2_InitTitleScreen(void); -- cgit v1.2.3 From 357c5439f5170ec1ebb1fe52c00d8d934b65c6bc Mon Sep 17 00:00:00 2001 From: GriffinR Date: Sun, 28 Mar 2021 23:56:42 -0400 Subject: Document some credits --- include/credits.h | 4 ---- include/intro_credits_graphics.h | 2 +- 2 files changed, 1 insertion(+), 5 deletions(-) (limited to 'include') diff --git a/include/credits.h b/include/credits.h index f7dfa9997..2e8c7e0c3 100644 --- a/include/credits.h +++ b/include/credits.h @@ -1,12 +1,8 @@ #ifndef GUARD_CREDITS_H #define GUARD_CREDITS_H -// Exported type declarations - -// Exported RAM declarations extern EWRAM_DATA bool8 gHasHallOfFameRecords; -// Exported ROM declarations void CB2_StartCreditsSequence(void); #endif // GUARD_CREDITS_H diff --git a/include/intro_credits_graphics.h b/include/intro_credits_graphics.h index 431446ed2..df3854aef 100644 --- a/include/intro_credits_graphics.h +++ b/include/intro_credits_graphics.h @@ -3,7 +3,7 @@ // States for gIntroCredits_MovingSceneryState enum { - INTROCRED_SCENERY_MOVING, + INTROCRED_SCENERY_NORMAL, INTROCRED_SCENERY_DESTROY, INTROCRED_SCENERY_FROZEN, }; -- cgit v1.2.3 From 62968895ca220cf5b6f7c066e9061cf45fe7913e Mon Sep 17 00:00:00 2001 From: GriffinR Date: Mon, 29 Mar 2021 09:38:19 -0400 Subject: Add MON_PIC_SIZE constant --- include/constants/pokemon.h | 2 ++ 1 file changed, 2 insertions(+) (limited to 'include') diff --git a/include/constants/pokemon.h b/include/constants/pokemon.h index 11a7c7fc5..51ef0c015 100644 --- a/include/constants/pokemon.h +++ b/include/constants/pokemon.h @@ -346,4 +346,6 @@ #define NUM_MALE_LINK_FACILITY_CLASSES 8 #define NUM_FEMALE_LINK_FACILITY_CLASSES 8 +#define MON_PIC_SIZE (64 * 64 / 2) + #endif // GUARD_CONSTANTS_POKEMON_H -- cgit v1.2.3 From 09ff1524b4fd89a3d0b9291f03cb8f0655ed69b7 Mon Sep 17 00:00:00 2001 From: GriffinR Date: Mon, 29 Mar 2021 12:39:49 -0400 Subject: Finish documenting credits --- include/intro_credits_graphics.h | 9 +++++++++ 1 file changed, 9 insertions(+) (limited to 'include') diff --git a/include/intro_credits_graphics.h b/include/intro_credits_graphics.h index df3854aef..bed30ffe8 100644 --- a/include/intro_credits_graphics.h +++ b/include/intro_credits_graphics.h @@ -8,6 +8,15 @@ enum { INTROCRED_SCENERY_FROZEN, }; +// Scenes for the Credits sequence +enum { + SCENE_OCEAN_MORNING, + SCENE_OCEAN_SUNSET, + SCENE_FOREST_RIVAL_ARRIVE, + SCENE_FOREST_CATCH_RIVAL, + SCENE_CITY_NIGHT, +}; + extern u16 gIntroCredits_MovingSceneryVBase; extern s16 gIntroCredits_MovingSceneryVOffset; extern s16 gIntroCredits_MovingSceneryState; -- cgit v1.2.3 From dea07dc8656c8fb32f5b389b9f4f9a30fe26e555 Mon Sep 17 00:00:00 2001 From: GriffinR Date: Mon, 29 Mar 2021 20:31:21 -0400 Subject: Standardize intro gfx names --- include/graphics.h | 69 +++++++++++++++++++++++++++--------------------------- 1 file changed, 34 insertions(+), 35 deletions(-) (limited to 'include') diff --git a/include/graphics.h b/include/graphics.h index 9af68a052..1d39eb1f5 100644 --- a/include/graphics.h +++ b/include/graphics.h @@ -3874,44 +3874,43 @@ extern const u32 gBagPalette[]; extern const u32 gBerryCheckCircle_Gfx[]; //intro graphics -extern const u32 gIntro1Sparkle_Gfx[]; -extern const u32 gIntro1Flygon_Gfx[]; -extern const u16 gIntro3LightningPal[]; +extern const u32 gIntroSparkle_Gfx[]; +extern const u32 gIntroFlygonSilhouette_Gfx[]; +extern const u32 gIntroLightning_Gfx[]; +extern const u16 gIntroLightning_Pal[]; extern const u32 gIntroCopyright_Gfx[]; extern const u32 gIntroCopyright_Tilemap[]; extern const u16 gIntroCopyright_Pal[16]; -extern const u32 gIntro2VolbeatGfx[]; -extern const u32 gIntro2TorchicGfx[]; -extern const u32 gIntro2ManectricGfx[]; -extern const u16 gIntro2VolbeatPal[]; -extern const u16 gIntro2TorchicPal[]; -extern const u16 gIntro2ManectricPal[]; -extern const u32 gIntro3Bubbles_Gfx[]; -extern const u16 gIntro3Bubbles_Pal[]; -extern const u32 gIntro3LightningGfx[]; -extern const u32 gIntro3GroudonGfx[]; -extern const u32 gIntro3GroudonTilemap[]; -extern const u32 gIntro3LegendBgGfx[]; -extern const u32 gIntro3GroudonBgTilemap[]; -extern const u32 gIntro3GroudonBgTilemap[]; -extern const u8 gIntro3BgPal[0x200]; -extern const u32 gIntro3KyogreGfx[]; -extern const u32 gIntro3KyogreTilemap[]; -extern const u32 gIntro3KyogreBgTilemap[]; -extern const u32 gIntro3CloudsGfx[]; -extern const u32 gIntro3Clouds1Tilemap[]; -extern const u32 gIntro3Clouds2Tilemap[]; -extern const u32 gIntro3Clouds3Tilemap[]; -extern const u32 gIntro3Clouds4Tilemap[]; -extern const u32 gIntro3RayquazaTilemap[]; -extern const u32 gIntro3RayquazaGfx[]; -extern const u32 gIntro3Clouds2Gfx[]; -extern const u16 gIntro1GameFreakTextFadePal[]; -extern const u32 gIntro2BrendanGfx[]; -extern const u32 gIntro2MayGfx[]; -extern const u16 gIntro2PlayerPal[]; -extern const u16 gIntro2FlygonPal[]; -extern const u32 gIntro2FlygonGfx[]; +extern const u32 gIntroVolbeat_Gfx[]; +extern const u16 gIntroVolbeat_Pal[]; +extern const u32 gIntroTorchic_Gfx[]; +extern const u16 gIntroTorchic_Pal[]; +extern const u32 gIntroManectric_Gfx[]; +extern const u16 gIntroManectric_Pal[]; +extern const u32 gIntroBubbles_Gfx[]; +extern const u16 gIntroBubbles_Pal[]; +extern const u32 gIntroGroudon_Gfx[]; +extern const u32 gIntroGroudon_Tilemap[]; +extern const u32 gIntroLegendBg_Gfx[]; +extern const u32 gIntroGroudonBg_Tilemap[]; +extern const u8 gIntro3Bg_Pal[0x200]; +extern const u32 gIntroKyogre_Gfx[]; +extern const u32 gIntroKyogre_Tilemap[]; +extern const u32 gIntroKyogreBg_Tilemap[]; +extern const u32 gIntroClouds_Gfx[]; +extern const u32 gIntroCloudsLeft_Tilemap[]; +extern const u32 gIntroCloudsRight_Tilemap[]; +extern const u32 gIntroCloudsSun_Tilemap[]; +extern const u32 gIntroRayquaza_Tilemap[]; +extern const u32 gIntroRayquaza_Gfx[]; +extern const u32 gIntroRayquazaClouds_Gfx[]; +extern const u32 gIntroRayquazaClouds_Tilemap[]; +extern const u16 gIntroGameFreakTextFade_Pal[]; +extern const u32 gIntroBrendan_Gfx[]; +extern const u32 gIntroMay_Gfx[]; +extern const u16 gIntroPlayer_Pal[]; +extern const u16 gIntroFlygon_Pal[]; +extern const u32 gIntroFlygon_Gfx[]; // party menu graphics extern const u32 gPartyMenuBg_Gfx[]; -- cgit v1.2.3 From 86856098a35b58eabb74db1d41cb9a2853c6746f Mon Sep 17 00:00:00 2001 From: GriffinR Date: Wed, 31 Mar 2021 15:53:01 -0400 Subject: Document Dewford Trend --- include/constants/flags.h | 2 +- include/constants/global.h | 1 + include/dewford_trend.h | 5 ++--- include/global.h | 13 +++++++------ include/tv.h | 2 +- 5 files changed, 12 insertions(+), 11 deletions(-) (limited to 'include') diff --git a/include/constants/flags.h b/include/constants/flags.h index 21b730de3..798b42d4d 100644 --- a/include/constants/flags.h +++ b/include/constants/flags.h @@ -1402,7 +1402,7 @@ #define FLAG_SYS_TV_HOME (SYSTEM_FLAGS + 0x30) #define FLAG_SYS_TV_WATCH (SYSTEM_FLAGS + 0x31) #define FLAG_SYS_TV_START (SYSTEM_FLAGS + 0x32) -#define FLAG_SYS_POPWORD_INPUT (SYSTEM_FLAGS + 0x33) +#define FLAG_SYS_CHANGED_DEWFORD_TREND (SYSTEM_FLAGS + 0x33) #define FLAG_SYS_MIX_RECORD (SYSTEM_FLAGS + 0x34) #define FLAG_SYS_CLOCK_SET (SYSTEM_FLAGS + 0x35) #define FLAG_SYS_NATIONAL_DEX (SYSTEM_FLAGS + 0x36) diff --git a/include/constants/global.h b/include/constants/global.h index 213ccca5b..9b0c46ce4 100644 --- a/include/constants/global.h +++ b/include/constants/global.h @@ -52,6 +52,7 @@ #define NUM_CONTEST_WINNERS 13 #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. diff --git a/include/dewford_trend.h b/include/dewford_trend.h index a7ed006f0..6a3194468 100644 --- a/include/dewford_trend.h +++ b/include/dewford_trend.h @@ -2,10 +2,9 @@ #define GUARD_DEWFORDTREND_H void InitDewfordTrend(void); -void UpdateDewfordTrendPerDay(u16); void UpdateDewfordTrendPerDay(u16 days); -bool8 IsPhraseTrendy(u16 *a); -void ReceiveEasyChatPairsData(struct EasyChatPair *a, size_t b, u8 unused); +bool8 TrySetTrendyPhrase(u16 *phrase); +void ReceiveDewfordTrendData(struct DewfordTrend *linkedTrends, size_t size, u8 unused); #endif // GUARD_DEWFORDTREND_H diff --git a/include/global.h b/include/global.h index 7806c0b59..497fb40b1 100644 --- a/include/global.h +++ b/include/global.h @@ -587,12 +587,13 @@ struct RamScript struct RamScriptData data; }; -struct EasyChatPair +// See dewford_trend.c +struct DewfordTrend { - u16 unk0_0:7; - u16 unk0_7:7; - u16 unk1_6:1; - u16 unk2; + u16 trendiness:7; + u16 maxTrendiness:7; + u16 gainingTrendiness:1; + u16 rand; u16 words[2]; }; /*size = 0x8*/ @@ -1021,7 +1022,7 @@ struct SaveBlock1 /*0x2BE0*/ struct MailStruct mail[MAIL_COUNT]; /*0x2E20*/ u8 additionalPhrases[8]; // bitfield for 33 additional phrases in easy chat system /*0x2E28*/ OldMan oldMan; - /*0x2e64*/ struct EasyChatPair easyChatPairs[5]; //Dewford trend [0] and some other stuff + /*0x2e64*/ struct DewfordTrend dewfordTrends[SAVED_TRENDS_COUNT]; /*0x2e90*/ struct ContestWinner contestWinners[NUM_CONTEST_WINNERS]; // see CONTEST_WINNER_* /*0x3030*/ struct DayCare daycare; /*0x3150*/ struct LinkBattleRecords linkBattleRecords; diff --git a/include/tv.h b/include/tv.h index 482909499..f94c5b7e5 100644 --- a/include/tv.h +++ b/include/tv.h @@ -31,7 +31,7 @@ void AlertTVThatPlayerPlayedRoulette(u16 nCoinsSpent); void AlertTVOfNewCoinTotal(u16 nCoinsPaidOut); void TryPutSecretBaseSecretsOnAir(void); void TryPutTodaysRivalTrainerOnAir(void); -void sub_80EDC60(const u16 *words); +void TryPutTrendWatcherOnAir(const u16 *words); void sub_80EDA80(void); void ReceivePokeNewsData(void *src, u32 size, u8 masterIdx); void sub_80F0BB8(void); -- cgit v1.2.3 From 771a4347309cd2f486072794d7de2c41b84c9b12 Mon Sep 17 00:00:00 2001 From: GriffinR Date: Wed, 31 Mar 2021 16:29:42 -0400 Subject: Label Trend Watcher TV show texts --- include/constants/tv.h | 9 +++++++++ include/event_scripts.h | 14 +++++++------- 2 files changed, 16 insertions(+), 7 deletions(-) (limited to 'include') diff --git a/include/constants/tv.h b/include/constants/tv.h index 72eae3f1c..57da9837b 100644 --- a/include/constants/tv.h +++ b/include/constants/tv.h @@ -206,4 +206,13 @@ #define SPOTCUTIES_STATE_RIBBON_EFFORT 14 #define SPOTCUTIES_STATE_OUTRO 15 +// TV Show states for Trend Watcher +#define TRENDWATCHER_STATE_INTRO 0 +#define TRENDWATCHER_STATE_TAUGHT_MALE 1 +#define TRENDWATCHER_STATE_TAUGHT_FEMALE 2 +#define TRENDWATCHER_STATE_PHRASE_HOPELESS 3 +#define TRENDWATCHER_STATE_BIGGER_MALE 4 +#define TRENDWATCHER_STATE_BIGGER_FEMALE 5 +#define TRENDWATCHER_STATE_OUTRO 6 + #endif //GUARD_CONSTANTS_TV_H diff --git a/include/event_scripts.h b/include/event_scripts.h index 79ef0ea14..ecb40c266 100644 --- a/include/event_scripts.h +++ b/include/event_scripts.h @@ -135,13 +135,13 @@ extern const u8 gTVTodaysRivalTrainerText03[]; extern const u8 gTVTodaysRivalTrainerText04[]; extern const u8 gTVTodaysRivalTrainerText05[]; extern const u8 gTVTodaysRivalTrainerText06[]; -extern const u8 gTVDewfordTrendWatcherNetworkText00[]; -extern const u8 gTVDewfordTrendWatcherNetworkText01[]; -extern const u8 gTVDewfordTrendWatcherNetworkText02[]; -extern const u8 gTVDewfordTrendWatcherNetworkText03[]; -extern const u8 gTVDewfordTrendWatcherNetworkText04[]; -extern const u8 gTVDewfordTrendWatcherNetworkText05[]; -extern const u8 gTVDewfordTrendWatcherNetworkText06[]; +extern const u8 TrendWatcher_Text_Intro[]; +extern const u8 TrendWatcher_Text_MaleTaughtMePhrase[]; +extern const u8 TrendWatcher_Text_FemaleTaughtMePhrase[]; +extern const u8 TrendWatcher_Text_PhraseWasHopeless[]; +extern const u8 TrendWatcher_Text_MaleTellMeBigger[]; +extern const u8 TrendWatcher_Text_FemaleTellMeBigger[]; +extern const u8 TrendWatcher_Text_Outro[]; extern const u8 gTVHoennTreasureInvestigatorsText00[]; extern const u8 gTVHoennTreasureInvestigatorsText01[]; extern const u8 gTVHoennTreasureInvestigatorsText02[]; -- cgit v1.2.3 From f58465a274fbae2275766c50206be1a364f21abc Mon Sep 17 00:00:00 2001 From: GriffinR Date: Thu, 1 Apr 2021 02:35:14 -0400 Subject: Document match_call.c --- include/match_call.h | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'include') diff --git a/include/match_call.h b/include/match_call.h index bc5f374bd..8aebb3bc7 100644 --- a/include/match_call.h +++ b/include/match_call.h @@ -17,7 +17,7 @@ bool32 IsMatchCallTaskActive(void); void StartMatchCallFromScript(const u8 *message); void BufferPokedexRatingForMatchCall(u8 *destStr); bool32 SelectMatchCallMessage(int, u8 *); -void sub_8197184(u32 windowId, u32 destOffset, u32 paletteId); -void sub_81971C4(u32 windowId, u32 tileOffset, u32 paletteId); +void LoadMatchCallWindowGfx(u32 windowId, u32 destOffset, u32 paletteId); +void DrawMatchCallTextBoxBorder(u32 windowId, u32 tileOffset, u32 paletteId); #endif //GUARD_MATCH_CALL_H -- cgit v1.2.3 From 8be2c5d60b54347c9df22410d97255d836d9fc9d Mon Sep 17 00:00:00 2001 From: GriffinR Date: Fri, 2 Apr 2021 01:49:38 -0400 Subject: Document Contest Lady TV Show --- include/constants/lilycove_lady.h | 10 ++++++++-- include/constants/tv.h | 8 +++++++- include/event_scripts.h | 8 ++++---- include/global.tv.h | 4 ++-- include/lilycove_lady.h | 2 +- 5 files changed, 22 insertions(+), 10 deletions(-) (limited to 'include') diff --git a/include/constants/lilycove_lady.h b/include/constants/lilycove_lady.h index 01f60ccf4..11b9b31e9 100644 --- a/include/constants/lilycove_lady.h +++ b/include/constants/lilycove_lady.h @@ -21,6 +21,12 @@ #define QUIZ_AUTHOR_NAME_PLAYER 1 #define QUIZ_AUTHOR_NAME_OTHER_PLAYER 2 -#define QUIZ_QUESTION_LEN 9 +#define QUIZ_QUESTION_LEN 9 -#endif +// Constants for how many good Pokéblocks the Contest Lady was given +// This determines how her performance is described when her TV show comes on +#define CONTEST_LADY_NORMAL 0 +#define CONTEST_LADY_GOOD 1 +#define CONTEST_LADY_BAD 2 + +#endif // GUARD_LILYCOVE_LADY_CONSTANTS_H diff --git a/include/constants/tv.h b/include/constants/tv.h index 57da9837b..f7b091f49 100644 --- a/include/constants/tv.h +++ b/include/constants/tv.h @@ -19,7 +19,7 @@ #define TVSHOW_3_CHEERS_FOR_POKEBLOCKS 9 #define TVSHOW_BATTLE_UPDATE 10 #define TVSHOW_FAN_CLUB_SPECIAL 11 -#define TVSHOW_CONTEST_LIVE_UPDATES_2 12 +#define TVSHOW_LILYCOVE_CONTEST_LADY 12 // // #define TVSHOW_POKEMON_TODAY_CAUGHT 21 #define TVSHOW_SMART_SHOPPER 22 @@ -215,4 +215,10 @@ #define TRENDWATCHER_STATE_BIGGER_FEMALE 5 #define TRENDWATCHER_STATE_OUTRO 6 +// TV Show states for the Contest Lady's Live Updates show +#define CONTESTLADYLIVE_STATE_INTRO 0 +#define CONTESTLADYLIVE_STATE_WON 1 +#define CONTESTLADYLIVE_STATE_LOST 2 +#define CONTESTLADYLIVE_STATE_LOST_BADLY 3 + #endif //GUARD_CONSTANTS_TV_H diff --git a/include/event_scripts.h b/include/event_scripts.h index ecb40c266..122af54cc 100644 --- a/include/event_scripts.h +++ b/include/event_scripts.h @@ -344,10 +344,10 @@ extern const u8 gTVInSearchOfTrainersText05[]; extern const u8 gTVInSearchOfTrainersText06[]; extern const u8 gTVInSearchOfTrainersText07[]; extern const u8 gTVInSearchOfTrainersText08[]; -extern const u8 gTVPokemonContestLiveUpdates2Text00[]; -extern const u8 gTVPokemonContestLiveUpdates2Text01[]; -extern const u8 gTVPokemonContestLiveUpdates2Text02[]; -extern const u8 gTVPokemonContestLiveUpdates2Text03[]; +extern const u8 ContestLadyShow_Text_Intro[]; +extern const u8 ContestLadyShow_Text_Won[]; +extern const u8 ContestLadyShow_Text_Lost[]; +extern const u8 ContestLadyShow_Text_LostBadly[]; extern const u8 gPokeNewsTextSlateport_Upcoming[]; extern const u8 gPokeNewsTextSlateport_Ongoing[]; extern const u8 gPokeNewsTextSlateport_Ending[]; diff --git a/include/global.tv.h b/include/global.tv.h index 8e1a898b6..64e6a984e 100644 --- a/include/global.tv.h +++ b/include/global.tv.h @@ -179,7 +179,7 @@ typedef union // size = 0x24 /*0x18*/ u8 idolNameLanguage; } fanClubSpecial; - // TVSHOW_CONTEST_LIVE_UPDATES_2 + // TVSHOW_LILYCOVE_CONTEST_LADY struct { /*0x00*/ u8 kind; /*0x01*/ bool8 active; @@ -189,7 +189,7 @@ typedef union // size = 0x24 /*0x16*/ u8 pokeblockState; /*0x17*/ u8 language; /*0x18*/ u8 pokemonNameLanguage; - } contestLiveUpdates2; + } contestLady; // Record Mixing Shows // TVSHOW_POKEMON_TODAY_CAUGHT diff --git a/include/lilycove_lady.h b/include/lilycove_lady.h index 1ec327be9..d3cce4ca8 100644 --- a/include/lilycove_lady.h +++ b/include/lilycove_lady.h @@ -12,6 +12,6 @@ void BufferContestLadyMonName(u8 *dest1, u8 *dest2); void BufferContestLadyPlayerName(u8 *dest); void BufferContestLadyLanguage(u8 *dest); void BufferContestName(u8 *dest, u8 category); -u8 sub_818E880(void); +u8 GetContestLadyPokeblockState(void); #endif //GUARD_LILYCOVE_LADY_H -- cgit v1.2.3 From c9d3b26ff7de11b39ceeb0c713cb7b821f2b03d3 Mon Sep 17 00:00:00 2001 From: GriffinR Date: Fri, 2 Apr 2021 02:12:46 -0400 Subject: Label miss string indexes --- include/constants/battle_script_commands.h | 1 + include/constants/battle_string_ids.h | 7 +++++++ 2 files changed, 8 insertions(+) (limited to 'include') diff --git a/include/constants/battle_script_commands.h b/include/constants/battle_script_commands.h index 9372377c4..cef0b184d 100644 --- a/include/constants/battle_script_commands.h +++ b/include/constants/battle_script_commands.h @@ -32,6 +32,7 @@ #define cEFFECT_CHOOSER gBattleCommunication + 3 #define cMULTISTRING_CHOOSER gBattleCommunication + 5 +#define cMISS_TYPE gBattleCommunication + 6 // Battle Script defines for getting the wanted battler #define BS_TARGET 0 diff --git a/include/constants/battle_string_ids.h b/include/constants/battle_string_ids.h index 1886043f1..f5b036b5d 100644 --- a/include/constants/battle_string_ids.h +++ b/include/constants/battle_string_ids.h @@ -383,4 +383,11 @@ #define STRINGID_TRAINER1WINTEXT 379 #define STRINGID_TRAINER2WINTEXT 380 +// Indexes into gMissStringIds +#define B_MSG_MISSED 0 +#define B_MSG_PROTECTED 1 +#define B_MSG_AVOIDED_ATK 2 +#define B_MSG_AVOIDED_DMG 3 +#define B_MSG_GROUND_MISS 4 + #endif // GUARD_CONSTANTS_BATTLE_STRING_IDS_H -- cgit v1.2.3 From 1b8d405b5e39de986954f8c3c7c3e15ea4a4967c Mon Sep 17 00:00:00 2001 From: GriffinR Date: Fri, 2 Apr 2021 12:54:40 -0400 Subject: Add missing include guard suffixes --- include/battle_gfx_sfx_util.h | 6 +++--- include/constants/metatile_behaviors.h | 6 +++--- include/gba/defines.h | 6 +++--- include/item_menu_icons.h | 6 +++--- include/metatile_behavior.h | 6 +++--- include/script_pokemon_util.h | 6 +++--- 6 files changed, 18 insertions(+), 18 deletions(-) (limited to 'include') diff --git a/include/battle_gfx_sfx_util.h b/include/battle_gfx_sfx_util.h index e3f549aa9..3288204d1 100644 --- a/include/battle_gfx_sfx_util.h +++ b/include/battle_gfx_sfx_util.h @@ -1,5 +1,5 @@ -#ifndef GUARD_BATTLE_GFX_SFX_UTIL -#define GUARD_BATTLE_GFX_SFX_UTIL +#ifndef GUARD_BATTLE_GFX_SFX_UTIL_H +#define GUARD_BATTLE_GFX_SFX_UTIL_H void AllocateBattleSpritesData(void); void FreeBattleSpritesData(void); @@ -45,4 +45,4 @@ void AllocateMonSpritesGfx(void); void FreeMonSpritesGfx(void); bool32 ShouldPlayNormalMonCry(struct Pokemon *mon); -#endif // GUARD_BATTLE_GFX_SFX_UTIL +#endif // GUARD_BATTLE_GFX_SFX_UTIL_H diff --git a/include/constants/metatile_behaviors.h b/include/constants/metatile_behaviors.h index 94cb0ffca..cc069c66c 100755 --- a/include/constants/metatile_behaviors.h +++ b/include/constants/metatile_behaviors.h @@ -1,5 +1,5 @@ -#ifndef GUARD_METATILE_BEHAVIORS -#define GUARD_METATILE_BEHAVIORS +#ifndef GUARD_METATILE_BEHAVIORS_H +#define GUARD_METATILE_BEHAVIORS_H #define MB_NORMAL 0x00 #define MB_SECRET_BASE_WALL 0x01 @@ -242,4 +242,4 @@ #define MB_UNUSED_EE 0xEE #define MB_UNUSED_EF 0xEF -#endif // GUARD_METATILE_BEHAVIORS +#endif // GUARD_METATILE_BEHAVIORS_H diff --git a/include/gba/defines.h b/include/gba/defines.h index 78c688593..ad06aaad2 100644 --- a/include/gba/defines.h +++ b/include/gba/defines.h @@ -1,5 +1,5 @@ -#ifndef GUARD_GBA_DEFINES -#define GUARD_GBA_DEFINES +#ifndef GUARD_GBA_DEFINES_H +#define GUARD_GBA_DEFINES_H #include @@ -76,4 +76,4 @@ #define TOTAL_OBJ_TILE_COUNT 1024 -#endif // GUARD_GBA_DEFINES +#endif // GUARD_GBA_DEFINES_H diff --git a/include/item_menu_icons.h b/include/item_menu_icons.h index e061149fc..7ff6ace94 100644 --- a/include/item_menu_icons.h +++ b/include/item_menu_icons.h @@ -1,5 +1,5 @@ -#ifndef GUARD_ITEM_MENU_ICONS -#define GUARD_ITEM_MENU_ICONS +#ifndef GUARD_ITEM_MENU_ICONS_H +#define GUARD_ITEM_MENU_ICONS_H extern const struct CompressedSpriteSheet gBagMaleSpriteSheet; extern const struct CompressedSpriteSheet gBagFemaleSpriteSheet; @@ -28,4 +28,4 @@ u8 CreateBerryFlavorCircleSprite(s16 x); #define TAG_BERRY_PIC_TILE 0xFFFF #define TAG_BERRY_PIC_PAL 0x7544 -#endif // GUARD_ITEM_MENU_ICONS +#endif // GUARD_ITEM_MENU_ICONS_H diff --git a/include/metatile_behavior.h b/include/metatile_behavior.h index d4bd9e683..584b3e546 100644 --- a/include/metatile_behavior.h +++ b/include/metatile_behavior.h @@ -1,5 +1,5 @@ -#ifndef GUARD_METATILE_BEHAVIOR -#define GUARD_METATILE_BEHAVIOR +#ifndef GUARD_METATILE_BEHAVIOR_H +#define GUARD_METATILE_BEHAVIOR_H bool8 MetatileBehavior_IsATile(u8); bool8 MetatileBehavior_IsEncounterTile(u8); @@ -146,4 +146,4 @@ bool8 MetatileBehavior_IsLongGrass_Duplicate(u8); bool8 MetatileBehavior_IsLongGrassSouthEdge(u8); bool8 MetatileBehavior_IsTrainerHillTimer(u8); -#endif // GUARD_METATILE_BEHAVIOR +#endif // GUARD_METATILE_BEHAVIOR_H diff --git a/include/script_pokemon_util.h b/include/script_pokemon_util.h index 120c28a63..cae16e40a 100644 --- a/include/script_pokemon_util.h +++ b/include/script_pokemon_util.h @@ -1,5 +1,5 @@ -#ifndef GUARD_SCRIPT_POKEMON_UTIL -#define GUARD_SCRIPT_POKEMON_UTIL +#ifndef GUARD_SCRIPT_POKEMON_UTIL_H +#define GUARD_SCRIPT_POKEMON_UTIL_H u8 ScriptGiveMon(u16, u8, u16, u32, u32, u8); u8 ScriptGiveEgg(u16); @@ -8,4 +8,4 @@ void ScriptSetMonMoveSlot(u8, u16, u8); void ReducePlayerPartyToSelectedMons(void); void HealPlayerParty(void); -#endif // GUARD_SCRIPT_POKEMON_UTIL +#endif // GUARD_SCRIPT_POKEMON_UTIL_H -- cgit v1.2.3 From 9ea9ffde09c9f3ca1772045935b3b0bd858232a0 Mon Sep 17 00:00:00 2001 From: GriffinR Date: Fri, 2 Apr 2021 02:27:12 -0400 Subject: Add remaining multistring chooser constants --- include/battle.h | 21 ++-- include/battle_ai_switch_items.h | 20 ++++ include/battle_message.h | 3 +- include/constants/battle.h | 4 + include/constants/battle_string_ids.h | 208 +++++++++++++++++++++++++++++++++- 5 files changed, 238 insertions(+), 18 deletions(-) (limited to 'include') diff --git a/include/battle.h b/include/battle.h index 954d33b07..14ecfbdd3 100644 --- a/include/battle.h +++ b/include/battle.h @@ -40,16 +40,17 @@ #define MAX_TRAINER_ITEMS 4 // array entries for battle communication -#define MULTIUSE_STATE 0x0 -#define CURSOR_POSITION 0x1 -#define TASK_ID 0x1 // task Id and cursor position share the same field -#define SPRITES_INIT_STATE1 0x1 // shares the Id as well -#define SPRITES_INIT_STATE2 0x2 -#define MOVE_EFFECT_BYTE 0x3 -#define ACTIONS_CONFIRMED_COUNT 0x4 -#define MULTISTRING_CHOOSER 0x5 -#define MSG_DISPLAY 0x7 -#define BATTLE_COMMUNICATION_ENTRIES_COUNT 0x8 +#define MULTIUSE_STATE 0 +#define CURSOR_POSITION 1 +#define TASK_ID 1 // task Id and cursor position share the same field +#define SPRITES_INIT_STATE1 1 // shares the Id as well +#define SPRITES_INIT_STATE2 2 +#define MOVE_EFFECT_BYTE 3 +#define ACTIONS_CONFIRMED_COUNT 4 +#define MULTISTRING_CHOOSER 5 +#define MISS_TYPE 6 +#define MSG_DISPLAY 7 +#define BATTLE_COMMUNICATION_ENTRIES_COUNT 8 #define MOVE_TARGET_SELECTED 0x0 #define MOVE_TARGET_DEPENDS 0x1 diff --git a/include/battle_ai_switch_items.h b/include/battle_ai_switch_items.h index 0a230e7f6..db390346d 100644 --- a/include/battle_ai_switch_items.h +++ b/include/battle_ai_switch_items.h @@ -11,6 +11,26 @@ enum AI_ITEM_NOT_RECOGNIZABLE }; +enum { + AI_HEAL_CONFUSION, + AI_HEAL_PARALYSIS, + AI_HEAL_FREEZE, + AI_HEAL_BURN, + AI_HEAL_POISON, + AI_HEAL_SLEEP, +}; + +enum { + AI_X_ATTACK, + AI_X_DEFEND, + AI_X_SPEED, + AI_X_SPATK, + AI_X_SPDEF, // Unused + AI_X_ACCURACY, + AI_X_EVASION, // Unused + AI_DIRE_HIT, +}; + void AI_TrySwitchOrUseItem(void); u8 GetMostSuitableMonToSwitchInto(void); diff --git a/include/battle_message.h b/include/battle_message.h index 011a1cb0c..da3009d63 100644 --- a/include/battle_message.h +++ b/include/battle_message.h @@ -223,7 +223,6 @@ extern const u8* const gBattleStringsTable[]; extern const u8* const gStatNamesTable[]; extern const u8* const gPokeblockWasTooXStringTable[]; extern const u8* const gRefereeStringsTable[]; -extern const u8* const gStatNamesTable2[]; extern const u8 *const gRoundsStringTable[]; extern const u8 gText_PkmnIsEvolving[]; @@ -269,7 +268,7 @@ extern const u8 gText_Win[]; extern const u8 gText_Loss[]; extern const u8 gText_Draw[]; extern const u8 gText_StatRose[]; -extern const u8 gText_PkmnsStatChanged2[]; +extern const u8 gText_DefendersStatRose[]; extern const u8 gText_PkmnGettingPumped[]; extern const u8 gText_PkmnShroudedInMist[]; extern const u8 gText_PkmnsXPreventsSwitching[]; diff --git a/include/constants/battle.h b/include/constants/battle.h index e6ebc85e4..3dbd83255 100644 --- a/include/constants/battle.h +++ b/include/constants/battle.h @@ -302,4 +302,8 @@ #define BATTLE_TERRAIN_BUILDING 8 #define BATTLE_TERRAIN_PLAIN 9 +#define B_WAIT_TIME_LONG 64 +#define B_WAIT_TIME_MED 48 +#define B_WAIT_TIME_SHORT 32 + #endif // GUARD_CONSTANTS_BATTLE_H diff --git a/include/constants/battle_string_ids.h b/include/constants/battle_string_ids.h index f5b036b5d..f1c589fee 100644 --- a/include/constants/battle_string_ids.h +++ b/include/constants/battle_string_ids.h @@ -214,10 +214,10 @@ #define STRINGID_STATROSE 210 #define STRINGID_STATHARSHLY 211 #define STRINGID_STATFELL 212 -#define STRINGID_PKMNSSTATCHANGED 213 -#define STRINGID_PKMNSSTATCHANGED2 214 -#define STRINGID_PKMNSSTATCHANGED3 215 -#define STRINGID_PKMNSSTATCHANGED4 216 +#define STRINGID_ATTACKERSSTATROSE 213 +#define STRINGID_DEFENDERSSTATROSE 214 +#define STRINGID_ATTACKERSSTATFELL 215 +#define STRINGID_DEFENDERSSTATFELL 216 #define STRINGID_CRITICALHIT 217 #define STRINGID_ONEHITKO 218 #define STRINGID_123POOF 219 @@ -326,7 +326,7 @@ #define STRINGID_SOOTHINGAROMA 322 #define STRINGID_ITEMSCANTBEUSEDNOW 323 #define STRINGID_FORXCOMMAYZ 324 -#define STRINGID_USINGXTHEYOFZN 325 +#define STRINGID_USINGITEMSTATOFPKMNROSE 325 #define STRINGID_PKMNUSEDXTOGETPUMPED 326 #define STRINGID_PKMNSXMADEYUSELESS 327 #define STRINGID_PKMNTRAPPEDBYSANDTOMB 328 @@ -383,11 +383,207 @@ #define STRINGID_TRAINER1WINTEXT 379 #define STRINGID_TRAINER2WINTEXT 380 -// Indexes into gMissStringIds + +// The below IDs are all indexes into battle message tables, +// used to determine which of a set of messages to print. +// They are assigned to the MULTISTRING_CHOOSER byte of gBattleCommunication +// and read when e.g. the command printfromtable is used. + +// gStatUpStringIds +#define B_MSG_ATTACKER_STAT_ROSE 0 +#define B_MSG_DEFENDER_STAT_ROSE 1 +#define B_MSG_STAT_WONT_INCREASE 2 +#define B_MSG_STAT_ROSE_EMPTY 3 +#define B_MSG_STAT_ROSE_ITEM 4 +#define B_MSG_USED_DIRE_HIT 5 + +// gStatDownStringIds +#define B_MSG_ATTACKER_STAT_FELL 0 +#define B_MSG_DEFENDER_STAT_FELL 1 +#define B_MSG_STAT_WONT_DECREASE 2 +#define B_MSG_STAT_FELL_EMPTY 3 + +// gMissStringIds #define B_MSG_MISSED 0 #define B_MSG_PROTECTED 1 #define B_MSG_AVOIDED_ATK 2 #define B_MSG_AVOIDED_DMG 3 #define B_MSG_GROUND_MISS 4 +// gAbsorbDrainStringIds +#define B_MSG_ABSORB 0 +#define B_MSG_ABSORB_OOZE 1 + +// gLeechSeedStringIds +#define B_MSG_LEECH_SEED_SET 0 +#define B_MSG_LEECH_SEED_MISS 1 +#define B_MSG_LEECH_SEED_FAIL 2 +#define B_MSG_LEECH_SEED_DRAIN 3 +#define B_MSG_LEECH_SEED_OOZE 4 + +// gBattlePalaceFlavorTextTable +#define B_MSG_GLINT_IN_EYE 0 +#define B_MSG_GETTING_IN_POS 1 +#define B_MSG_GROWL_DEEPLY 2 +#define B_MSG_EAGER_FOR_MORE 3 + +// gFirstTurnOfTwoStringIds +#define B_MSG_TURN1_RAZOR_WIND 0 +#define B_MSG_TURN1_SOLAR_BEAM 1 +#define B_MSG_TURN1_SKULL_BASH 2 +#define B_MSG_TURN1_SKY_ATTACK 3 +#define B_MSG_TURN1_FLY 4 +#define B_MSG_TURN1_DIG 5 +#define B_MSG_TURN1_DIVE 6 +#define B_MSG_TURN1_BOUNCE 7 + +// gMoveWeatherChangeStringIds +#define B_MSG_STARTED_RAIN 0 +#define B_MSG_STARTED_DOWNPOUR 1 +#define B_MSG_WEATHER_FAILED 2 +#define B_MSG_STARTED_SANDSTORM 3 +#define B_MSG_STARTED_SUNLIGHT 4 +#define B_MSG_STARTED_HAIL 5 + +// gRainContinuesStringIds +#define B_MSG_RAIN_CONTINUES 0 +#define B_MSG_DOWNPOUR_CONTINUES 1 +#define B_MSG_RAIN_STOPPED 2 + +// gSandStormHailContinuesStringIds / gSandStormHailDmgStringIds/ gSandStormHailEndStringIds +#define B_MSG_SANDSTORM 0 +#define B_MSG_HAIL 1 + +// gReflectLightScreenSafeguardStringIds +#define B_MSG_SIDE_STATUS_FAILED 0 +#define B_MSG_SET_REFLECT_SINGLE 1 +#define B_MSG_SET_REFLECT_DOUBLE 2 +#define B_MSG_SET_LIGHTSCREEN_SINGLE 3 +#define B_MSG_SET_LIGHTSCREEN_DOUBLE 4 +#define B_MSG_SET_SAFEGUARD 5 + +// gProtectLikeUsedStringIds +#define B_MSG_PROTECTED_ITSELF 0 +#define B_MSG_BRACED_ITSELF 1 +#define B_MSG_PROTECT_FAILED 2 + +// gRestUsedStringIds +#define B_MSG_REST 0 +#define B_MSG_REST_STATUSED 1 + +// gWokeUpStringIds +#define B_MSG_WOKE_UP 0 +#define B_MSG_WOKE_UP_UPROAR 1 + +// gUproarAwakeStringIds +#define B_MSG_CANT_SLEEP_UPROAR 0 +#define B_MSG_UPROAR_KEPT_AWAKE 1 +#define B_MSG_STAYED_AWAKE_USING 2 + +// gUproarOverTurnStringIds +#define B_MSG_UPROAR_CONTINUES 0 +#define B_MSG_UPROAR_ENDS 1 + +// gStockpileUsedStringIds +#define B_MSG_STOCKPILED 0 +#define B_MSG_CANT_STOCKPILE 1 + +// gSwallowFailStringIds +#define B_MSG_SWALLOW_FAILED 0 +#define B_MSG_SWALLOW_FULL_HP 1 + +// gKOFailedStringIds +#define B_MSG_KO_MISS 0 +#define B_MSG_KO_UNAFFECTED 1 + +// gMistUsedStringIds +#define B_MSG_SET_MIST 0 +#define B_MSG_MIST_FAILED 1 + +// gFocusEnergyUsedStringIds +#define B_MSG_GETTING_PUMPED 0 +#define B_MSG_FOCUS_ENERGY_FAILED 1 + +// gTransformUsedStringIds +#define B_MSG_TRANSFORMED 0 +#define B_MSG_TRANSFORM_FAILED 1 + +// gSubsituteUsedStringIds +#define B_MSG_SET_SUBSTITUTE 0 +#define B_MSG_SUBSTITUTE_FAILED 1 + +// gPartyStatusHealStringIds +#define B_MSG_BELL 0 +#define B_MSG_BELL_SOUNDPROOF_ATTACKER 1 +#define B_MSG_BELL_SOUNDPROOF_PARTNER 2 +#define B_MSG_BELL_BOTH_SOUNDPROOF 3 +#define B_MSG_SOOTHING_AROMA 4 + +// gFutureMoveUsedStringIds +#define B_MSG_FUTURE_SIGHT 0 +#define B_MSG_DOOM_DESIRE 1 + +// gItemSwapStringIds +#define B_MSG_ITEM_SWAP_TAKEN 0 +#define B_MSG_ITEM_SWAP_GIVEN 1 +#define B_MSG_ITEM_SWAP_BOTH 2 + +// gSportsUsedStringIds +#define B_MSG_WEAKEN_ELECTRIC 0 +#define B_MSG_WEAKEN_FIRE 1 + +// gCaughtMonStringIds +#define B_MSG_SENT_SOMEONES_PC 0 +#define B_MSG_SENT_LANETTES_PC 1 +#define B_MSG_SOMEONES_BOX_FULL 2 +#define B_MSG_LANETTES_BOX_FULL 3 + +// gInobedientStringIds +#define B_MSG_LOAFING 0 +#define B_MSG_WONT_OBEY 1 +#define B_MSG_TURNED_AWAY 2 +#define B_MSG_PRETEND_NOT_NOTICE 3 +#define B_MSG_INCAPABLE_OF_POWER 4 +// For randomly selecting a disobey string +// Skips the one used for Battle Palace +#define NUM_LOAF_STRINGS 4 + +// gSafariGetNearStringIds +#define B_MSG_CREPT_CLOSER 0 +#define B_MSG_CANT_GET_CLOSER 1 + +// gSafariPokeblockResultStringIds +#define B_MSG_MON_CURIOUS 0 +#define B_MSG_MON_ENTHRALLED 1 +#define B_MSG_MON_IGNORED 2 + +// gFlashFireStringIds +#define B_MSG_FLASH_FIRE_BOOST 0 +#define B_MSG_FLASH_FIRE_NO_BOOST 1 + +// gBerryEffectStringIds +#define B_MSG_CURED_PROBLEM 0 +#define B_MSG_NORMALIZED_STATUS 1 + +// gNoEscapeStringIds +#define B_MSG_CANT_ESCAPE 0 +#define B_MSG_DONT_LEAVE_BIRCH 1 +#define B_MSG_PREVENTS_ESCAPE 2 +#define B_MSG_CANT_ESCAPE_2 3 +#define B_MSG_ATTACKER_CANT_ESCAPE 4 + +// gGotPoisonedStringIds / gGotParalyzedStringIds / gFellAsleepStringIds +// gGotBurnedStringIds / gGotFrozenStringIds / gAttractUsedStringIds +#define B_MSG_STATUSED 0 +#define B_MSG_STATUSED_BY_ABILITY 1 + +// gBRNPreventionStringIds / gPRLZPreventionStringIds / gPSNPreventionStringIds +#define B_MSG_ABILITY_PREVENTS_MOVE_STATUS 0 +#define B_MSG_ABILITY_PREVENTS_ABILITY_STATUS 1 +#define B_MSG_STATUS_HAD_NO_EFFECT 2 + +// gGotDefrostedStringIds +#define B_MSG_DEFROSTED 0 +#define B_MSG_DEFROSTED_BY_MOVE 1 + #endif // GUARD_CONSTANTS_BATTLE_STRING_IDS_H -- cgit v1.2.3 From f4d8a91ba44d7bcf0f9df8db7ca5f7aeb688497f Mon Sep 17 00:00:00 2001 From: GriffinR Date: Sat, 3 Apr 2021 12:38:07 -0400 Subject: Misc battle script cleanup --- include/battle_controllers.h | 4 +-- include/constants/battle_script_commands.h | 48 ++++++++++++++++-------------- include/constants/battle_string_ids.h | 23 ++++++++++---- 3 files changed, 45 insertions(+), 30 deletions(-) (limited to 'include') diff --git a/include/battle_controllers.h b/include/battle_controllers.h index da76ab0c6..34e916b0f 100644 --- a/include/battle_controllers.h +++ b/include/battle_controllers.h @@ -156,7 +156,7 @@ enum CONTROLLER_CLEARUNKFLAG, CONTROLLER_TOGGLEUNKFLAG, CONTROLLER_HITANIMATION, - CONTROLLER_42, + CONTROLLER_CANTSWITCH, CONTROLLER_PLAYSE, CONTROLLER_PLAYFANFAREORBGM, CONTROLLER_FAINTINGCRY, @@ -227,7 +227,7 @@ void BtlController_EmitSetUnkVar(u8 bufferId, u8 b); // unused void BtlController_EmitClearUnkFlag(u8 bufferId); // unused void BtlController_EmitToggleUnkFlag(u8 bufferId); // unused void BtlController_EmitHitAnimation(u8 bufferId); -void BtlController_EmitCmd42(u8 bufferId); +void BtlController_EmitCantSwitch(u8 bufferId); void BtlController_EmitPlaySE(u8 bufferId, u16 songId); void BtlController_EmitPlayFanfareOrBGM(u8 bufferId, u16 songId, bool8 playBGM); void BtlController_EmitFaintingCry(u8 bufferId); diff --git a/include/constants/battle_script_commands.h b/include/constants/battle_script_commands.h index cef0b184d..9794589af 100644 --- a/include/constants/battle_script_commands.h +++ b/include/constants/battle_script_commands.h @@ -39,8 +39,10 @@ #define BS_ATTACKER 1 #define BS_EFFECT_BATTLER 2 #define BS_FAINTED 3 -#define BS_BATTLER_0 7 #define BS_ATTACKER_WITH_PARTNER 4 // for Cmd_updatestatusicon +#define BS_UNK_5 5 +#define BS_UNK_6 6 +#define BS_BATTLER_0 7 #define BS_ATTACKER_SIDE 8 // for Cmd_jumpifability #define BS_NOT_ATTACKER_SIDE 9 // for Cmd_jumpifability #define BS_SCRIPTING 10 @@ -55,12 +57,12 @@ #define ACC_CURR_MOVE 0 // compare operands -#define CMP_EQUAL 0x0 -#define CMP_NOT_EQUAL 0x1 -#define CMP_GREATER_THAN 0x2 -#define CMP_LESS_THAN 0x3 -#define CMP_COMMON_BITS 0x4 -#define CMP_NO_COMMON_BITS 0x5 +#define CMP_EQUAL 0 +#define CMP_NOT_EQUAL 1 +#define CMP_GREATER_THAN 2 +#define CMP_LESS_THAN 3 +#define CMP_COMMON_BITS 4 +#define CMP_NO_COMMON_BITS 5 // Cmd_various #define VARIOUS_CANCEL_MULTI_TURN_MOVES 0 @@ -93,27 +95,29 @@ #define DMG_DOUBLED 2 // Cmd_jumpifcantswitch -#define SWITCH_IGNORE_ESCAPE_PREVENTION 0x80 +#define SWITCH_IGNORE_ESCAPE_PREVENTION (1 << 7) // Cmd_statbuffchange -#define STAT_BUFF_ALLOW_PTR 0x1 // If set, allow use of jumpptr. Set in every use of statbuffchange -#define STAT_BUFF_NOT_PROTECT_AFFECTED 0x20 +#define STAT_BUFF_ALLOW_PTR (1 << 0) // If set, allow use of jumpptr. Set in every use of statbuffchange +#define STAT_BUFF_NOT_PROTECT_AFFECTED (1 << 5) // stat change flags for Cmd_playstatchangeanimation -#define STAT_CHANGE_NEGATIVE 0x1 -#define STAT_CHANGE_BY_TWO 0x2 -#define STAT_CHANGE_MULTIPLE_STATS 0x4 -#define STAT_CHANGE_CANT_PREVENT 0x8 +#define STAT_CHANGE_NEGATIVE (1 << 0) +#define STAT_CHANGE_BY_TWO (1 << 1) +#define STAT_CHANGE_MULTIPLE_STATS (1 << 2) +#define STAT_CHANGE_CANT_PREVENT (1 << 3) // stat flags for Cmd_playstatchangeanimation -#define BIT_HP 0x1 -#define BIT_ATK 0x2 -#define BIT_DEF 0x4 -#define BIT_SPEED 0x8 -#define BIT_SPATK 0x10 -#define BIT_SPDEF 0x20 -#define BIT_ACC 0x40 -#define BIT_EVASION 0x80 +#define BIT_HP (1 << 0) +#define BIT_ATK (1 << 1) +#define BIT_DEF (1 << 2) +#define BIT_SPEED (1 << 3) +#define BIT_SPATK (1 << 4) +#define BIT_SPDEF (1 << 5) +#define BIT_ACC (1 << 6) +#define BIT_EVASION (1 << 7) + +#define PARTY_SCREEN_OPTIONAL (1 << 7) // Flag for first argument to openpartyscreen // cases for Cmd_moveend #define MOVEEND_RAGE 0 diff --git a/include/constants/battle_string_ids.h b/include/constants/battle_string_ids.h index f1c589fee..f22541272 100644 --- a/include/constants/battle_string_ids.h +++ b/include/constants/battle_string_ids.h @@ -421,12 +421,6 @@ #define B_MSG_LEECH_SEED_DRAIN 3 #define B_MSG_LEECH_SEED_OOZE 4 -// gBattlePalaceFlavorTextTable -#define B_MSG_GLINT_IN_EYE 0 -#define B_MSG_GETTING_IN_POS 1 -#define B_MSG_GROWL_DEEPLY 2 -#define B_MSG_EAGER_FOR_MORE 3 - // gFirstTurnOfTwoStringIds #define B_MSG_TURN1_RAZOR_WIND 0 #define B_MSG_TURN1_SOLAR_BEAM 1 @@ -586,4 +580,21 @@ #define B_MSG_DEFROSTED 0 #define B_MSG_DEFROSTED_BY_MOVE 1 +// gBattlePalaceFlavorTextTable +#define B_MSG_GLINT_IN_EYE 0 +#define B_MSG_GETTING_IN_POS 1 +#define B_MSG_GROWL_DEEPLY 2 +#define B_MSG_EAGER_FOR_MORE 3 + +// gRefereeStringsTable +#define B_MSG_REF_NOTHING_IS_DECIDED 0 +#define B_MSG_REF_THATS_IT 1 +#define B_MSG_REF_JUDGE_MIND 2 +#define B_MSG_REF_JUDGE_SKILL 3 +#define B_MSG_REF_JUDGE_BODY 4 +#define B_MSG_REF_PLAYER_WON 5 +#define B_MSG_REF_OPPONENT_WON 6 +#define B_MSG_REF_DRAW 7 +#define B_MSG_REF_COMMENCE_BATTLE 8 + #endif // GUARD_CONSTANTS_BATTLE_STRING_IDS_H -- cgit v1.2.3 From b6711441f548dfac4a9b1c69d19aa3d28a3b1ec3 Mon Sep 17 00:00:00 2001 From: GriffinR Date: Sat, 3 Apr 2021 15:18:17 -0400 Subject: Fix AI Guard Spec use, and Specs->Spec --- include/battle_ai_switch_items.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'include') diff --git a/include/battle_ai_switch_items.h b/include/battle_ai_switch_items.h index db390346d..a0b6fe62c 100644 --- a/include/battle_ai_switch_items.h +++ b/include/battle_ai_switch_items.h @@ -7,7 +7,7 @@ enum AI_ITEM_HEAL_HP, AI_ITEM_CURE_CONDITION, AI_ITEM_X_STAT, - AI_ITEM_GUARD_SPECS, + AI_ITEM_GUARD_SPEC, AI_ITEM_NOT_RECOGNIZABLE }; -- cgit v1.2.3 From 1494a8303579e2bd92d24554b1f3e1cebd97a273 Mon Sep 17 00:00:00 2001 From: GriffinR Date: Sat, 3 Apr 2021 22:47:58 -0400 Subject: Sync drought with pokefirered, add weather tags --- include/field_weather.h | 28 +++++++++++++++++++++------- 1 file changed, 21 insertions(+), 7 deletions(-) (limited to 'include') diff --git a/include/field_weather.h b/include/field_weather.h index 9ecf52501..894c661be 100644 --- a/include/field_weather.h +++ b/include/field_weather.h @@ -4,6 +4,21 @@ #include "sprite.h" #include "constants/field_weather.h" +#define TAG_WEATHER_START 0x1200 +enum { + GFXTAG_CLOUD = TAG_WEATHER_START, + GFXTAG_FOG_H, + GFXTAG_ASH, + GFXTAG_FOG_D, + GFXTAG_SANDSTORM, + GFXTAG_BUBBLE, + GFXTAG_RAIN, +}; +enum { + PALTAG_WEATHER = TAG_WEATHER_START, + PALTAG_WEATHER_2 +}; + struct Weather { union @@ -105,10 +120,10 @@ struct Weather u8 blendFrameCounter; u8 blendDelay; u8 filler_73B[0x3C-0x3B]; - s16 unknown_73C; - s16 unknown_73E; - s16 unknown_740; - s16 unknown_742; + s16 droughtBrightnessStage; + s16 droughtLastBrightnessStage; + s16 droughtTimer; + s16 droughtState; u8 filler_744[0xD-4]; s8 loadDroughtPalsIndex; u8 loadDroughtPalsOffset; @@ -136,9 +151,8 @@ u8 sub_80ABF20(void); void LoadCustomWeatherSpritePalette(const u16 *palette); void ResetDroughtWeatherPaletteLoading(void); bool8 LoadDroughtWeatherPalettes(void); -void sub_80ABFE0(s8 gammaIndex); -void sub_80ABFF0(void); -void sub_80AC01C(void); +void DroughtStateInit(void); +void DroughtStateRun(void); void Weather_SetBlendCoeffs(u8 eva, u8 evb); void Weather_SetTargetBlendCoeffs(u8 eva, u8 evb, int delay); bool8 Weather_UpdateBlend(void); -- cgit v1.2.3 From b926fa6b0741cc878e4de5fe81183af12275d267 Mon Sep 17 00:00:00 2001 From: GriffinR Date: Sun, 4 Apr 2021 00:23:06 -0400 Subject: Document thunderstorm --- include/field_weather.h | 43 ++++++++++++++++++++++++------------------- 1 file changed, 24 insertions(+), 19 deletions(-) (limited to 'include') diff --git a/include/field_weather.h b/include/field_weather.h index 894c661be..48118c9a6 100644 --- a/include/field_weather.h +++ b/include/field_weather.h @@ -46,11 +46,11 @@ struct Weather u8 gammaStepDelay; u8 gammaStepFrameCounter; u16 fadeDestColor; - /*0x6C6*/ u8 palProcessingState; - /*0x6C7*/ u8 fadeScreenCounter; - /*0x6C8*/ bool8 readyForInit; - /*0x6C9*/ u8 taskId; - /*0x6CA*/ u8 unknown_6CA; + u8 palProcessingState; + u8 fadeScreenCounter; + bool8 readyForInit; + u8 taskId; + u8 unknown_6CA; u8 unknown_6CB; u16 initStep; u16 finishStep; @@ -60,6 +60,7 @@ struct Weather bool8 weatherChangeComplete; u8 weatherPicSpritePalIndex; u8 altGammaSpritePalIndex; + // Rain u16 rainSpriteVisibleCounter; u8 curRainSpriteIndex; u8 targetRainSpriteCount; @@ -67,37 +68,41 @@ struct Weather u8 rainSpriteVisibleDelay; u8 isDownpour; u8 rainStrength; - /*0x6DE*/ u8 cloudSpritesCreated; - u8 filler_6DF[1]; + u8 cloudSpritesCreated; + // Snow u16 snowflakeVisibleCounter; u16 unknown_6E2; u8 snowflakeSpriteCount; u8 targetSnowflakeSpriteCount; - u16 unknown_6E6; + // Thunderstorm + u16 thunderDelay; u16 thunderCounter; - u8 unknown_6EA; - u8 unknown_6EB; - u8 unknown_6EC; - u8 thunderTriggered; + bool8 thunderAllowEnd; + bool8 thunderSkipShort; + u8 thunderShortRetries; + bool8 thunderTriggered; + // Horizontal fog u16 fogHScrollPosX; u16 fogHScrollCounter; u16 fogHScrollOffset; u8 lightenedFogSpritePals[6]; u8 lightenedFogSpritePalsCount; u8 fogHSpritesCreated; + // Ash u16 ashBaseSpritesX; u16 unknown_6FE; u8 ashSpritesCreated; - u8 filler_701[3]; + // Sandstorm u32 sandstormXOffset; u32 sandstormYOffset; - u8 filler_70C[2]; + u16 sandstormUnused; u16 sandstormBaseSpritesX; u16 sandstormPosY; u16 sandstormWaveIndex; u16 sandstormWaveCounter; u8 sandstormSpritesCreated; u8 sandstormSwirlSpritesCreated; + // Diagonal fog u16 fogDBaseSpritesX; u16 fogDPosY; u16 fogDScrollXCounter; @@ -105,13 +110,13 @@ struct Weather u16 fogDXOffset; u16 fogDYOffset; u8 fogDSpritesCreated; - u8 filler_725[1]; + // Bubbles u16 bubblesDelayCounter; u16 bubblesDelayIndex; u16 bubblesCoordsIndex; u16 bubblesSpriteCount; u8 bubblesSpritesCreated; - u8 filler_72F; + u16 currBlendEVA; u16 currBlendEVB; u16 targetBlendEVA; @@ -119,12 +124,12 @@ struct Weather u8 blendUpdateCounter; u8 blendFrameCounter; u8 blendDelay; - u8 filler_73B[0x3C-0x3B]; + // Drought s16 droughtBrightnessStage; s16 droughtLastBrightnessStage; s16 droughtTimer; s16 droughtState; - u8 filler_744[0xD-4]; + u8 droughtUnused[9]; s8 loadDroughtPalsIndex; u8 loadDroughtPalsOffset; }; @@ -141,7 +146,7 @@ void StartWeather(void); void SetNextWeather(u8 weather); void SetCurrentAndNextWeather(u8 weather); void SetCurrentAndNextWeatherNoDelay(u8 weather); -void sub_80ABC48(s8 gammaIndex); +void ApplyWeatherGammaShiftIfIdle(s8 gammaIndex); void sub_80ABC7C(u8 gammaIndex, u8 gammaTargetIndex, u8 gammaStepDelay); void FadeScreen(u8 mode, s8 delay); bool8 IsWeatherNotFadingIn(void); -- cgit v1.2.3 From 5fa20534f9843d5ede403474e675be5330b8060d Mon Sep 17 00:00:00 2001 From: GriffinR Date: Sun, 4 Apr 2021 00:52:17 -0400 Subject: Label remaining fields in Weather struct --- include/field_weather.h | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) (limited to 'include') diff --git a/include/field_weather.h b/include/field_weather.h index 48118c9a6..696864983 100644 --- a/include/field_weather.h +++ b/include/field_weather.h @@ -50,8 +50,8 @@ struct Weather u8 fadeScreenCounter; bool8 readyForInit; u8 taskId; - u8 unknown_6CA; - u8 unknown_6CB; + u8 fadeInFirstFrame; + u8 fadeInTimer; u16 initStep; u16 finishStep; u8 currWeather; @@ -71,7 +71,7 @@ struct Weather u8 cloudSpritesCreated; // Snow u16 snowflakeVisibleCounter; - u16 unknown_6E2; + u16 snowflakeTimer; u8 snowflakeSpriteCount; u8 targetSnowflakeSpriteCount; // Thunderstorm @@ -90,7 +90,7 @@ struct Weather u8 fogHSpritesCreated; // Ash u16 ashBaseSpritesX; - u16 unknown_6FE; + u16 ashUnused; u8 ashSpritesCreated; // Sandstorm u32 sandstormXOffset; @@ -152,7 +152,6 @@ void FadeScreen(u8 mode, s8 delay); bool8 IsWeatherNotFadingIn(void); void UpdateSpritePaletteWithWeather(u8 spritePaletteIndex); void ApplyWeatherGammaShiftToPal(u8 paletteIndex); -u8 sub_80ABF20(void); void LoadCustomWeatherSpritePalette(const u16 *palette); void ResetDroughtWeatherPaletteLoading(void); bool8 LoadDroughtWeatherPalettes(void); -- cgit v1.2.3 From f90026826a0c4fb1f85a3e1648026392cb5072f9 Mon Sep 17 00:00:00 2001 From: GriffinR Date: Sun, 4 Apr 2021 17:52:07 -0400 Subject: Document some weather, field effects --- include/event_object_movement.h | 2 +- include/field_weather.h | 3 +-- 2 files changed, 2 insertions(+), 3 deletions(-) (limited to 'include') diff --git a/include/event_object_movement.h b/include/event_object_movement.h index 1e754dcd9..79b8921f0 100644 --- a/include/event_object_movement.h +++ b/include/event_object_movement.h @@ -198,7 +198,7 @@ u8 GetMoveDirectionFastestAnimNum(u8); u8 GetLedgeJumpDirection(s16, s16, u8); void CameraObjectSetFollowedObjectId(u8 objectId); u16 GetObjectPaletteTag(u8 palSlot); -void UpdateObjectEventSpriteVisibility(struct Sprite *sprite, bool8 invisible); +void UpdateObjectEventSpriteInvisibility(struct Sprite *sprite, bool8 invisible); s16 GetFigure8XOffset(s16 idx); s16 GetFigure8YOffset(s16 idx); void CameraObjectReset2(void); diff --git a/include/field_weather.h b/include/field_weather.h index 696864983..9c6a4ab7a 100644 --- a/include/field_weather.h +++ b/include/field_weather.h @@ -160,13 +160,12 @@ void DroughtStateRun(void); void Weather_SetBlendCoeffs(u8 eva, u8 evb); void Weather_SetTargetBlendCoeffs(u8 eva, u8 evb, int delay); bool8 Weather_UpdateBlend(void); -void sub_80AC274(u8 a); u8 GetCurrentWeather(void); void SetRainStrengthFromSoundEffect(u16 soundEffect); void PlayRainStoppingSoundEffect(void); u8 IsWeatherChangeComplete(void); void SetWeatherScreenFadeOut(void); -void sub_80AC3E4(void); +void SetWeatherPalStateIdle(void); void PreservePaletteInWeather(u8 preservedPalIndex); void ResetPreservedPalettesInWeather(void); -- cgit v1.2.3 From 553fe6239ab55ac456e80528bfe3a1697a05c2ed Mon Sep 17 00:00:00 2001 From: GriffinR Date: Mon, 5 Apr 2021 10:32:33 -0400 Subject: Document more field effects --- include/field_effect_helpers.h | 22 ++++++++++++++-------- 1 file changed, 14 insertions(+), 8 deletions(-) (limited to 'include') diff --git a/include/field_effect_helpers.h b/include/field_effect_helpers.h index 9b7b6ffd5..9795d96e8 100644 --- a/include/field_effect_helpers.h +++ b/include/field_effect_helpers.h @@ -1,16 +1,22 @@ #ifndef GUARD_FIELD_EFFECT_HELPERS_H #define GUARD_FIELD_EFFECT_HELPERS_H -// Exported type declarations +// States for bobbing up and down while surfing +enum { + // No bobbing + BOB_NONE, + // Both the surf blob/mon should bob up and down + BOB_PLAYER_AND_MON, + // Only the surf blob/mon should bob up and down + // For when the player has jumped/flown off + BOB_JUST_MON, +}; -// Exported RAM declarations - -// Exported ROM declarations u8 CreateWarpArrowSprite(void); -u8 sub_8155800(u8 oldSpriteId); -void SetSurfBobState(u8 spriteId, u8 value); -void SetSurfBobWhileFlyingOutState(u8 spriteId, u8 value); -void SetSurfBobWhileFishingState(u8 spriteId, u8 value, s16 data1); +u8 StartUnderwaterSurfBlobBobbing(u8 oldSpriteId); +void SetSurfBlob_BobState(u8 spriteId, u8 state); +void SetSurfBlob_DontSyncAnim(u8 spriteId, bool8 dontSync); +void SetSurfBlob_PlayerOffset(u8 spriteId, bool8 hasOffset, s16 offset); bool8 sub_8155DA0(struct ObjectEvent *); void sub_8155D78(struct ObjectEvent *); void StartAshFieldEffect(s16, s16, u16, s16); -- cgit v1.2.3 From 806abe2999ebb94b544c2d1db961fcec66c16537 Mon Sep 17 00:00:00 2001 From: GriffinR Date: Mon, 5 Apr 2021 19:52:35 -0400 Subject: Document some objev anims, make objevgfx info static --- include/event_object_movement.h | 1 - 1 file changed, 1 deletion(-) (limited to 'include') diff --git a/include/event_object_movement.h b/include/event_object_movement.h index 79b8921f0..446d0dd4e 100644 --- a/include/event_object_movement.h +++ b/include/event_object_movement.h @@ -65,7 +65,6 @@ struct LockedAnimObjectEvents u8 count; }; -extern const struct SpriteFrameImage gObjectEventPicTable_PechaBerryTree[]; extern const struct OamData gObjectEventBaseOam_32x8; extern const struct OamData gObjectEventBaseOam_32x32; extern const struct SpriteTemplate *const gFieldEffectObjectTemplatePointers[]; -- cgit v1.2.3 From 00c3044c96631b6e54bdf308d0b2ff9e3d27b9b7 Mon Sep 17 00:00:00 2001 From: GriffinR Date: Tue, 6 Apr 2021 02:38:15 -0400 Subject: Clarify Groudon/Kyogre/Rayquaza gfx names --- include/constants/event_objects.h | 16 ++++++++-------- include/constants/flags.h | 18 +++++++++--------- 2 files changed, 17 insertions(+), 17 deletions(-) (limited to 'include') diff --git a/include/constants/event_objects.h b/include/constants/event_objects.h index 8e026ef2d..7a224940f 100644 --- a/include/constants/event_objects.h +++ b/include/constants/event_objects.h @@ -42,7 +42,7 @@ #define OBJ_EVENT_GFX_SCHOOL_KID_M 38 #define OBJ_EVENT_GFX_MANIAC 39 #define OBJ_EVENT_GFX_HEX_MANIAC 40 -#define OBJ_EVENT_GFX_RAYQUAZA_1 41 +#define OBJ_EVENT_GFX_RAYQUAZA_STILL 41 #define OBJ_EVENT_GFX_SWIMMER_M 42 #define OBJ_EVENT_GFX_SWIMMER_F 43 #define OBJ_EVENT_GFX_BLACK_BELT 44 @@ -198,17 +198,17 @@ #define OBJ_EVENT_GFX_MAY_DECORATING 194 #define OBJ_EVENT_GFX_ARCHIE 195 #define OBJ_EVENT_GFX_MAXIE 196 -#define OBJ_EVENT_GFX_KYOGRE_1 197 -#define OBJ_EVENT_GFX_GROUDON_1 198 +#define OBJ_EVENT_GFX_KYOGRE_FRONT 197 +#define OBJ_EVENT_GFX_GROUDON_FRONT 198 #define OBJ_EVENT_GFX_FOSSIL 199 #define OBJ_EVENT_GFX_REGIROCK 200 #define OBJ_EVENT_GFX_REGICE 201 #define OBJ_EVENT_GFX_REGISTEEL 202 #define OBJ_EVENT_GFX_SKITTY 203 #define OBJ_EVENT_GFX_KECLEON 204 -#define OBJ_EVENT_GFX_KYOGRE_2 205 -#define OBJ_EVENT_GFX_GROUDON_2 206 -#define OBJ_EVENT_GFX_RAYQUAZA_2 207 +#define OBJ_EVENT_GFX_KYOGRE_ASLEEP 205 +#define OBJ_EVENT_GFX_GROUDON_ASLEEP 206 +#define OBJ_EVENT_GFX_RAYQUAZA 207 #define OBJ_EVENT_GFX_ZIGZAGOON_2 208 #define OBJ_EVENT_GFX_PIKACHU 209 #define OBJ_EVENT_GFX_AZUMARILL 210 @@ -222,8 +222,8 @@ #define OBJ_EVENT_GFX_JUAN 218 #define OBJ_EVENT_GFX_SCOTT 219 #define OBJ_EVENT_GFX_POOCHYENA 220 -#define OBJ_EVENT_GFX_KYOGRE_3 221 -#define OBJ_EVENT_GFX_GROUDON_3 222 +#define OBJ_EVENT_GFX_KYOGRE_SIDE 221 +#define OBJ_EVENT_GFX_GROUDON_SIDE 222 #define OBJ_EVENT_GFX_MYSTERY_GIFT_MAN 223 #define OBJ_EVENT_GFX_TRICK_HOUSE_STATUE 224 #define OBJ_EVENT_GFX_KIRLIA 225 diff --git a/include/constants/flags.h b/include/constants/flags.h index 798b42d4d..48606962a 100644 --- a/include/constants/flags.h +++ b/include/constants/flags.h @@ -91,10 +91,10 @@ #define FLAG_UNUSED_0x04F 0x4F // Unused Flag // Scripts -#define FLAG_HIDE_RAYQUAZA_SKY_TOWER_SUMMIT 0x50 -#define FLAG_SET_WALL_CLOCK 0x51 -#define FLAG_RESCUED_BIRCH 0x52 -#define FLAG_LEGENDARIES_IN_SOOTOPOLIS 0x53 +#define FLAG_HIDE_SKY_PILLAR_TOP_RAYQUAZA_STILL 0x50 +#define FLAG_SET_WALL_CLOCK 0x51 +#define FLAG_RESCUED_BIRCH 0x52 +#define FLAG_LEGENDARIES_IN_SOOTOPOLIS 0x53 #define FLAG_UNUSED_0x054 0x54 // Unused Flag #define FLAG_UNUSED_0x055 0x55 // Unused Flag @@ -775,7 +775,7 @@ #define FLAG_HIDE_LILYCOVE_FAN_CLUB_INTERVIEWER 0x2DA #define FLAG_HIDE_RUSTBORO_CITY_AQUA_GRUNT 0x2DB #define FLAG_HIDE_RUSTBORO_CITY_DEVON_EMPLOYEE_1 0x2DC -#define FLAG_HIDE_SEAFLOOR_CAVERN_ROOM_9_KYOGRE_2 0x2DD +#define FLAG_HIDE_SEAFLOOR_CAVERN_ROOM_9_KYOGRE_ASLEEP 0x2DD #define FLAG_HIDE_PLAYERS_HOUSE_DAD 0x2DE #define FLAG_HIDE_LITTLEROOT_TOWN_BRENDANS_HOUSE_RIVAL_SIBLING 0x2DF #define FLAG_HIDE_LITTLEROOT_TOWN_MAYS_HOUSE_RIVAL_SIBLING 0x2E0 @@ -815,7 +815,7 @@ #define FLAG_HIDE_ROUTE_111_VIVI_WINSTRATE 0x302 #define FLAG_HIDE_ROUTE_111_VICKY_WINSTRATE 0x303 #define FLAG_HIDE_PETALBURG_GYM_NORMAN 0x304 -#define FLAG_HIDE_SKY_PILLAR_TOP_RAYQUAZA_2 0x305 +#define FLAG_HIDE_SKY_PILLAR_TOP_RAYQUAZA 0x305 #define FLAG_HIDE_LILYCOVE_CONTEST_HALL_CONTEST_ATTENDANT_1 0x306 #define FLAG_HIDE_LILYCOVE_MUSEUM_CURATOR 0x307 #define FLAG_HIDE_LILYCOVE_MUSEUM_PATRON_1 0x308 @@ -892,16 +892,16 @@ #define FLAG_HIDE_JAGGED_PASS_MAGMA_GUARD 0x34F #define FLAG_HIDE_SLATEPORT_CITY_HARBOR_SUBMARINE_SHADOW 0x350 #define FLAG_HIDE_LITTLEROOT_TOWN_MAYS_HOUSE_2F_PICHU_DOLL 0x351 -#define FLAG_HIDE_MAGMA_HIDEOUT_4F_GROUDON_2 0x352 +#define FLAG_HIDE_MAGMA_HIDEOUT_4F_GROUDON_ASLEEP 0x352 #define FLAG_HIDE_ROUTE_119_RIVAL 0x353 #define FLAG_HIDE_LILYCOVE_CITY_AQUA_GRUNTS 0x354 -#define FLAG_HIDE_MAGMA_HIDEOUT_4F_GROUDON_1 0x355 +#define FLAG_HIDE_MAGMA_HIDEOUT_4F_GROUDON 0x355 #define FLAG_HIDE_SOOTOPOLIS_CITY_RESIDENTS 0x356 #define FLAG_HIDE_SKY_PILLAR_WALLACE 0x357 #define FLAG_HIDE_MT_PYRE_SUMMIT_MAXIE 0x358 #define FLAG_HIDE_MAGMA_HIDEOUT_GRUNTS 0x359 #define FLAG_HIDE_VICTORY_ROAD_ENTRANCE_WALLY 0x35A -#define FLAG_HIDE_SEAFLOOR_CAVERN_ROOM_9_KYOGRE_1 0x35B +#define FLAG_HIDE_SEAFLOOR_CAVERN_ROOM_9_KYOGRE 0x35B #define FLAG_HIDE_SLATEPORT_CITY_HARBOR_SS_TIDAL 0x35C #define FLAG_HIDE_LILYCOVE_HARBOR_SSTIDAL 0x35D #define FLAG_HIDE_MOSSDEEP_CITY_SPACE_CENTER_2F_TEAM_MAGMA 0x35E -- cgit v1.2.3 From 756fad0e61e62e71af6cf451257f882691c004b0 Mon Sep 17 00:00:00 2001 From: GriffinR Date: Tue, 6 Apr 2021 05:05:33 -0400 Subject: Document some event object movement --- include/constants/event_object_movement.h | 3 ++- include/event_object_movement.h | 16 ++++------------ include/field_player_avatar.h | 2 +- 3 files changed, 7 insertions(+), 14 deletions(-) (limited to 'include') diff --git a/include/constants/event_object_movement.h b/include/constants/event_object_movement.h index 223650081..13e91c415 100755 --- a/include/constants/event_object_movement.h +++ b/include/constants/event_object_movement.h @@ -237,11 +237,12 @@ #define MOVEMENT_ACTION_WALK_RIGHT_AFFINE 0x97 #define MOVEMENT_ACTION_LEVITATE 0x98 #define MOVEMENT_ACTION_STOP_LEVITATE 0x99 -#define MOVEMENT_ACTION_DESTROY_EXTRA_TASK_IF_AT_TOP 0x9A +#define MOVEMENT_ACTION_STOP_LEVITATE_AT_TOP 0x9A #define MOVEMENT_ACTION_FIGURE_8 0x9B #define MOVEMENT_ACTION_FLY_UP 0x9C #define MOVEMENT_ACTION_FLY_DOWN 0x9D #define MOVEMENT_ACTION_STEP_END 0xFE +#define MOVEMENT_ACTION_NONE 0xFF #endif // GUARD_CONSTANTS_EVENT_OBJECT_MOVEMENT_H diff --git a/include/event_object_movement.h b/include/event_object_movement.h index 446d0dd4e..9deacfbb7 100644 --- a/include/event_object_movement.h +++ b/include/event_object_movement.h @@ -86,9 +86,9 @@ void LoadPlayerObjectReflectionPalette(u16, u8); void LoadSpecialObjectReflectionPalette(u16, u8); void TryMoveObjectEventToMapCoords(u8, u8, u8, s16, s16); void PatchObjectPalette(u16, u8); -void sub_808E16C(s16, s16); +void SpawnObjectEventsOnReturnToField(s16, s16); void OverrideSecretBaseDecorationSpriteScript(u8 localId, u8 mapNum, u8 mapGroup, u8 decorCat); -void sub_8092FF0(s16, s16, s16 *, s16 *); +void GetMapCoordsFromSpritePos(s16, s16, s16 *, s16 *); u8 GetFaceDirectionAnimNum(u8); void SetSpritePosToOffsetMapCoords(s16 *, s16 *, s16, s16); void ObjectEventClearHeldMovement(struct ObjectEvent *); @@ -110,7 +110,7 @@ void FreeAndReserveObjectSpritePalettes(void); void SetObjectEventSpritePosByLocalIdAndMap(u8 localId, u8 mapNum, u8 mapGroup, s16 x, s16 y); void ResetObjectPriority(u8, u8, u8); void SetObjectPriority(u8, u8, u8, u8); -void sub_808E75C(s16, s16); +void AllowObjectAtPosTriggerGroundEffects(s16, s16); void ObjectEventGetLocalIdAndMap(struct ObjectEvent *objectEvent, void *localId, void *mapNum, void *mapGroup); void ShiftObjectEventCoords(struct ObjectEvent *, s16, s16); void MoveObjectEventToMapCoords(struct ObjectEvent *, s16, s16); @@ -175,16 +175,8 @@ bool8 IsZCoordMismatchAt(u8, s16, s16); void UnfreezeObjectEvent(struct ObjectEvent *); u8 FindLockedObjectEventIndex(struct ObjectEvent *); bool8 obj_npc_ministep(struct Sprite *sprite); -bool8 sub_80976EC(struct Sprite *sprite); -void sub_80976DC(struct Sprite *, u8); -void sub_809783C(struct Sprite *, u8, u8, u8); -void DoShadowFieldEffect(struct ObjectEvent *); -u8 sub_809785C(struct Sprite *); -u8 sub_80978E4(struct Sprite *); void SetAndStartSpriteAnim(struct Sprite *, u8, u8); bool8 SpriteAnimEnded(struct Sprite *); -void CreateLevitateMovementTask(struct ObjectEvent *); -void DestroyExtraMovementTask(u8); void UnfreezeObjectEvents(void); void FreezeObjectEventsExceptOne(u8 objectEventId); void TurnObjectEventSprite(u8, u8); @@ -195,7 +187,7 @@ u8 GetMoveDirectionFastAnimNum(u8); u8 GetMoveDirectionFasterAnimNum(u8); u8 GetMoveDirectionFastestAnimNum(u8); u8 GetLedgeJumpDirection(s16, s16, u8); -void CameraObjectSetFollowedObjectId(u8 objectId); +void CameraObjectSetFollowedSpriteId(u8 objectId); u16 GetObjectPaletteTag(u8 palSlot); void UpdateObjectEventSpriteInvisibility(struct Sprite *sprite, bool8 invisible); s16 GetFigure8XOffset(s16 idx); diff --git a/include/field_player_avatar.h b/include/field_player_avatar.h index c30ce0b6f..903fe6ef1 100644 --- a/include/field_player_avatar.h +++ b/include/field_player_avatar.h @@ -6,7 +6,7 @@ void ClearPlayerAvatarInfo(void); void SetPlayerAvatarExtraStateTransition(u8, u8); u8 GetPlayerAvatarGenderByGraphicsId(u8); bool8 TestPlayerAvatarFlags(u8); -u8 GetPlayerAvatarObjectId(void); +u8 GetPlayerAvatarSpriteId(void); void PlayerGetDestCoords(s16 *, s16 *); u8 GetPlayerFacingDirection(void); u8 GetPlayerMovementDirection(void); -- cgit v1.2.3 From 8bad478b4999e762eb26cef0a9b6b07891236370 Mon Sep 17 00:00:00 2001 From: GriffinR Date: Tue, 6 Apr 2021 14:51:39 -0400 Subject: Document disguise field effects --- include/field_effect_helpers.h | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'include') diff --git a/include/field_effect_helpers.h b/include/field_effect_helpers.h index 9795d96e8..528492d81 100644 --- a/include/field_effect_helpers.h +++ b/include/field_effect_helpers.h @@ -17,8 +17,8 @@ u8 StartUnderwaterSurfBlobBobbing(u8 oldSpriteId); void SetSurfBlob_BobState(u8 spriteId, u8 state); void SetSurfBlob_DontSyncAnim(u8 spriteId, bool8 dontSync); void SetSurfBlob_PlayerOffset(u8 spriteId, bool8 hasOffset, s16 offset); -bool8 sub_8155DA0(struct ObjectEvent *); -void sub_8155D78(struct ObjectEvent *); +bool8 UpdateRevealDisguise(struct ObjectEvent *); +void StartRevealDisguise(struct ObjectEvent *); void StartAshFieldEffect(s16, s16, u16, s16); void SetUpReflection(struct ObjectEvent*, struct Sprite*, u8); u32 StartFieldEffectForObjectEvent(u8, struct ObjectEvent*); -- cgit v1.2.3 From 86a9d94ce1eb7930cb9a59ad8f968388a627c58a Mon Sep 17 00:00:00 2001 From: GriffinR Date: Tue, 6 Apr 2021 16:05:43 -0400 Subject: Document fieldmap --- include/constants/metatile_behaviors.h | 1 + include/fieldmap.h | 7 ++----- include/global.fieldmap.h | 5 ++++- 3 files changed, 7 insertions(+), 6 deletions(-) (limited to 'include') diff --git a/include/constants/metatile_behaviors.h b/include/constants/metatile_behaviors.h index 94cb0ffca..5120bd9dc 100755 --- a/include/constants/metatile_behaviors.h +++ b/include/constants/metatile_behaviors.h @@ -241,5 +241,6 @@ #define MB_UNUSED_ED 0xED #define MB_UNUSED_EE 0xEE #define MB_UNUSED_EF 0xEF +#define MB_INVALID 0xFF #endif // GUARD_METATILE_BEHAVIORS diff --git a/include/fieldmap.h b/include/fieldmap.h index 438fb4787..5bcbe20ea 100644 --- a/include/fieldmap.h +++ b/include/fieldmap.h @@ -20,16 +20,13 @@ void MapGridSetMetatileEntryAt(int, int, u16); void GetCameraCoords(u16*, u16*); bool8 MapGridIsImpassableAt(int, int); int GetMapBorderIdAt(int x, int y); -int CanCameraMoveInDirection(int direction); +bool32 CanCameraMoveInDirection(int direction); u16 GetBehaviorByMetatileId(u16 metatileId); void GetCameraFocusCoords(u16 *x, u16 *y); u8 MapGridGetMetatileLayerTypeAt(int x, int y); u8 MapGridGetZCoordAt(int x, int y); 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); -void save_serialize_map(void); +void SaveMapView(void); void SetCameraFocusCoords(u16 x, u16 y); void InitMap(void); void InitMapFromSavedGame(void); diff --git a/include/global.fieldmap.h b/include/global.fieldmap.h index c4d7be35d..a3d99ee21 100644 --- a/include/global.fieldmap.h +++ b/include/global.fieldmap.h @@ -1,6 +1,7 @@ #ifndef GUARD_GLOBAL_FIELDMAP_H #define GUARD_GLOBAL_FIELDMAP_H +#define METATILE_BEHAVIOR_MASK 0x00FF #define METATILE_COLLISION_MASK 0x0C00 #define METATILE_ID_MASK 0x03FF #define METATILE_ID_UNDEFINED 0x03FF @@ -12,7 +13,9 @@ enum { - CONNECTION_SOUTH = 1, + CONNECTION_INVALID = -1, + CONNECTION_NONE, + CONNECTION_SOUTH, CONNECTION_NORTH, CONNECTION_WEST, CONNECTION_EAST, -- cgit v1.2.3 From 4a1cfbead245b3cac609b498dfca6b6d238f7f7a Mon Sep 17 00:00:00 2001 From: GriffinR Date: Tue, 6 Apr 2021 16:55:33 -0400 Subject: Document remaining overworld --- include/cable_club.h | 1 + include/constants/cable_club.h | 4 ++++ include/event_scripts.h | 2 +- include/global.h | 10 ---------- include/overworld.h | 17 ++++++++--------- 5 files changed, 14 insertions(+), 20 deletions(-) (limited to 'include') diff --git a/include/cable_club.h b/include/cable_club.h index a5a6acfa4..c493691c1 100644 --- a/include/cable_club.h +++ b/include/cable_club.h @@ -2,6 +2,7 @@ #define GUARD_CABLE_CLUB_H #include "task.h" +#include "constants/cable_club.h" void CreateTask_EnterCableClubSeat(TaskFunc taskFunc); u8 CreateTask_ReestablishCableClubLink(void); diff --git a/include/constants/cable_club.h b/include/constants/cable_club.h index cbdd049db..3515ffa2c 100644 --- a/include/constants/cable_club.h +++ b/include/constants/cable_club.h @@ -28,4 +28,8 @@ #define LINKUP_FAILED_BATTLE_TOWER 11 #define LINKUP_FOREIGN_GAME 12 +#define CABLE_SEAT_WAITING 0 +#define CABLE_SEAT_SUCCESS 1 +#define CABLE_SEAT_FAILED 2 + #endif //GUARD_CONSTANTS_CABLE_CLUB_H diff --git a/include/event_scripts.h b/include/event_scripts.h index ecb40c266..f5151ce20 100644 --- a/include/event_scripts.h +++ b/include/event_scripts.h @@ -607,7 +607,7 @@ extern const u8 EventScript_BattleColosseum_2P_PlayerSpot0[]; extern const u8 EventScript_BattleColosseum_2P_PlayerSpot1[]; extern const u8 EventScript_TradeCenter_Chair1[]; extern const u8 EventScript_TradeCenter_Chair0[]; -extern const u8 EventScript_ConfirmLeaveTradeRoom[]; +extern const u8 EventScript_ConfirmLeaveCableClubRoom[]; extern const u8 EventScript_TerminateLink[]; #endif // GUARD_EVENT_SCRIPTS_H diff --git a/include/global.h b/include/global.h index 497fb40b1..18e2bfea7 100644 --- a/include/global.h +++ b/include/global.h @@ -1055,14 +1055,4 @@ struct MapPosition s8 height; }; -struct TradeRoomPlayer -{ - u8 playerId; - u8 isLocalPlayer; - u8 c; - u8 facing; - struct MapPosition pos; - u16 field_C; -}; - #endif // GUARD_GLOBAL_H diff --git a/include/overworld.h b/include/overworld.h index 6efaa6ccb..16c75861c 100644 --- a/include/overworld.h +++ b/include/overworld.h @@ -7,17 +7,17 @@ #define LINK_KEY_CODE_DPAD_UP 0x13 #define LINK_KEY_CODE_DPAD_LEFT 0x14 #define LINK_KEY_CODE_DPAD_RIGHT 0x15 -#define LINK_KEY_CODE_UNK_2 0x16 +#define LINK_KEY_CODE_READY 0x16 #define LINK_KEY_CODE_EXIT_ROOM 0x17 #define LINK_KEY_CODE_START_BUTTON 0x18 #define LINK_KEY_CODE_A_BUTTON 0x19 -#define LINK_KEY_CODE_UNK_4 0x1A // I'd guess this is the B button? +#define LINK_KEY_CODE_IDLE 0x1A // These two are a hack to stop user input until link stuff can be // resolved. #define LINK_KEY_CODE_HANDLE_RECV_QUEUE 0x1B #define LINK_KEY_CODE_HANDLE_SEND_QUEUE 0x1C -#define LINK_KEY_CODE_UNK_7 0x1D +#define LINK_KEY_CODE_EXIT_SEAT 0x1D #define LINK_KEY_CODE_UNK_8 0x1E #define MOVEMENT_MODE_FREE 0 @@ -143,15 +143,14 @@ void CB2_ReturnToFieldFromMultiplayer(void); void CB2_ReturnToFieldWithOpenMenu(void); void CB2_ReturnToFieldContinueScript(void); void CB2_ReturnToFieldContinueScriptPlayMapMusic(void); -void sub_80861E8(void); +void CB2_ReturnToFieldFadeFromBlack(void); void CB2_ContinueSavedGame(void); void ResetAllMultiplayerState(void); -u32 sub_8087214(void); -bool32 sub_808727C(void); -u16 sub_8087288(void); -u16 sub_808729C(void); +u32 GetCableClubPartnersReady(void); +u16 SetInCableClubSeat(void); +u16 SetLinkWaitingForScript(void); u16 QueueExitLinkRoomKey(void); -u16 sub_80872C4(void); +u16 SetStartedCableClubActivity(void); bool32 Overworld_LinkRecvQueueLengthMoreThan2(void); bool32 Overworld_RecvKeysFromLinkIsRunning(void); bool32 Overworld_SendKeysToLinkIsRunning(void); -- cgit v1.2.3 From 0dc7ff89945d471a62659b3d9f21cb7f50f331eb Mon Sep 17 00:00:00 2001 From: GriffinR Date: Tue, 6 Apr 2021 17:17:41 -0400 Subject: Minor misc field doc --- include/field_camera.h | 7 +------ 1 file changed, 1 insertion(+), 6 deletions(-) (limited to 'include') diff --git a/include/field_camera.h b/include/field_camera.h index 2bed02b20..b245fca84 100644 --- a/include/field_camera.h +++ b/include/field_camera.h @@ -1,8 +1,6 @@ #ifndef GUARD_FIELD_CAMERA_H #define GUARD_FIELD_CAMERA_H -// Exported type declarations - struct CameraObject { void (*callback)(struct CameraObject *); @@ -13,18 +11,15 @@ struct CameraObject s32 y; }; -// Exported RAM declarations extern struct CameraObject gFieldCamera; extern u16 gTotalCameraPixelOffsetX; extern u16 gTotalCameraPixelOffsetY; -// Exported ROM declarations void DrawWholeMapView(void); void CurrentMapDrawMetatileAt(int x, int y); -void sub_8089C08(s16 *a0, s16 *a1); +void GetCameraOffsetWithPan(s16 *a0, s16 *a1); void DrawDoorMetatileAt(int x, int y, u16 *arr); void ResetFieldCamera(void); -void sub_8057A58(void); void ResetCameraUpdateInfo(void); u32 InitCameraUpdateCallback(u8 a); void CameraUpdate(void); -- cgit v1.2.3 From d717a635c89e9fc44feb45153c267f3ff38ef497 Mon Sep 17 00:00:00 2001 From: GriffinR Date: Tue, 6 Apr 2021 17:55:29 -0400 Subject: event_object_movement cleanup --- include/event_object_movement.h | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) (limited to 'include') diff --git a/include/event_object_movement.h b/include/event_object_movement.h index 9deacfbb7..a935502e6 100644 --- a/include/event_object_movement.h +++ b/include/event_object_movement.h @@ -47,7 +47,7 @@ enum ReflectionTypes #define GROUND_EFFECT_FLAG_HOT_SPRINGS (1 << 18) #define GROUND_EFFECT_FLAG_SEAWEED (1 << 19) -struct UnkStruct_085094AC +struct StepAnimTable { const union AnimCmd *const *anims; u8 animPos[4]; @@ -174,7 +174,6 @@ void SetObjectSubpriorityByZCoord(u8, struct Sprite *, u8); bool8 IsZCoordMismatchAt(u8, s16, s16); void UnfreezeObjectEvent(struct ObjectEvent *); u8 FindLockedObjectEventIndex(struct ObjectEvent *); -bool8 obj_npc_ministep(struct Sprite *sprite); void SetAndStartSpriteAnim(struct Sprite *, u8, u8); bool8 SpriteAnimEnded(struct Sprite *); void UnfreezeObjectEvents(void); -- cgit v1.2.3 From 72ba8cf58de8297c56d2269e0519064dc2de5f76 Mon Sep 17 00:00:00 2001 From: GriffinR Date: Fri, 9 Apr 2021 12:41:02 -0400 Subject: Document pokemon animation types --- include/constants/battle_anim.h | 29 ------- include/pokemon_animation.h | 182 +++++++++++++++++++++++++++++++++++++++ include/pokemon_summary_screen.h | 3 +- 3 files changed, 183 insertions(+), 31 deletions(-) (limited to 'include') diff --git a/include/constants/battle_anim.h b/include/constants/battle_anim.h index 5f8900bf6..4622876cc 100644 --- a/include/constants/battle_anim.h +++ b/include/constants/battle_anim.h @@ -410,33 +410,4 @@ #define ANIM_WEATHER_SANDSTORM 3 #define ANIM_WEATHER_HAIL 4 -// Battle mon back animations. -#define BACK_ANIM_NONE 0x00 -#define BACK_ANIM_H_SLIDE_QUICK 0x01 -#define BACK_ANIM_H_SLIDE 0x02 -#define BACK_ANIM_H_SLIDE_WITH_V_COMPRESS_1 0x03 -#define BACK_ANIM_H_SLIDE_WITH_V_COMPRESS_2 0x04 -#define BACK_ANIM_SHRINK_GROW_1 0x05 -#define BACK_ANIM_GROW_1 0x06 -#define BACK_ANIM_CIRCLE_MOVE_COUNTERCLOCKWISE 0x07 -#define BACK_ANIM_HORIZONTAL_SHAKE 0x08 -#define BACK_ANIM_VERTICAL_SHAKE 0x09 -#define BACK_ANIM_V_SHAKE_WITH_H_SLIDE 0x0a -#define BACK_ANIM_VERTICAL_STRETCH 0x0b -#define BACK_ANIM_HORIZONTAL_STRETCH 0x0c -#define BACK_ANIM_GROW_2 0x0d -#define BACK_ANIM_V_SHAKE_WITH_PAUSE 0x0e -#define BACK_ANIM_CIRCLE_MOVE_CLOCKWISE 0x0f -#define BACK_ANIM_CONCAVE_DOWN_ARC_SWAY_SMALL 0x10 -#define BACK_ANIM_CONCAVE_DOWN_ARC_SWAY_LARGE 0x11 -#define BACK_ANIM_CONCAVE_UP_ARC_SWAY_LARGE 0x12 -#define BACK_ANIM_DIP_RIGHT_SIDE 0x13 -#define BACK_ANIM_SHRINK_GROW_2 0x14 -#define BACK_ANIM_JOLT_RIGHT 0x15 -#define BACK_ANIM_FLASH_YELLOW_WITH_SHAKE 0x16 -#define BACK_ANIM_FADE_RED_WITH_SHAKE 0x17 -#define BACK_ANIM_FADE_GREEN_WITH_SHAKE 0x18 -#define BACK_ANIM_FADE_BLUE_WITH_SHAKE 0x19 - - #endif // GUARD_CONSTANTS_BATTLE_ANIM_H diff --git a/include/pokemon_animation.h b/include/pokemon_animation.h index c1ab8d817..5174c8a77 100644 --- a/include/pokemon_animation.h +++ b/include/pokemon_animation.h @@ -7,4 +7,186 @@ void StartMonSummaryAnimation(struct Sprite *sprite, u8 frontAnimId); void LaunchAnimationTaskForBackSprite(struct Sprite *sprite, u8 backAnimSet); void SetSpriteCB_MonAnimDummy(struct Sprite *sprite); +// Pokémon back animation sets +#define BACK_ANIM_NONE 0 +#define BACK_ANIM_H_VIBRATE 1 +#define BACK_ANIM_H_SLIDE 2 +#define BACK_ANIM_H_SPRING 3 +#define BACK_ANIM_H_SPRING_REPEATED 4 +#define BACK_ANIM_SHRINK_GROW 5 +#define BACK_ANIM_GROW 6 +#define BACK_ANIM_CIRCLE_COUNTERCLOCKWISE 7 +#define BACK_ANIM_H_SHAKE 8 +#define BACK_ANIM_V_SHAKE 9 +#define BACK_ANIM_V_SHAKE_H_SLIDE 10 +#define BACK_ANIM_V_STRETCH 11 +#define BACK_ANIM_H_STRETCH 12 +#define BACK_ANIM_GROW_STUTTER 13 +#define BACK_ANIM_V_SHAKE_LOW 14 +#define BACK_ANIM_TRIANGLE_DOWN 15 +#define BACK_ANIM_CONCAVE_ARC_LARGE 16 +#define BACK_ANIM_CONVEX_DOUBLE_ARC 17 +#define BACK_ANIM_CONCAVE_ARC_SMALL 18 +#define BACK_ANIM_DIP_RIGHT_SIDE 19 +#define BACK_ANIM_SHRINK_GROW_VIBRATE 20 +#define BACK_ANIM_JOLT_RIGHT 21 +#define BACK_ANIM_SHAKE_FLASH_YELLOW 22 +#define BACK_ANIM_SHAKE_GLOW_RED 23 +#define BACK_ANIM_SHAKE_GLOW_GREEN 24 +#define BACK_ANIM_SHAKE_GLOW_BLUE 25 + +// Pokémon animation function ids (for front and back) +// Each front anim uses 1, and each back anim uses a set of 3 +#define ANIM_V_SQUISH_AND_BOUNCE 0 +#define ANIM_CIRCULAR_STRETCH_TWICE 1 +#define ANIM_H_VIBRATE 2 +#define ANIM_H_SLIDE 3 +#define ANIM_V_SLIDE 4 +#define ANIM_BOUNCE_ROTATE_TO_SIDES 5 +#define ANIM_V_JUMPS_H_JUMPS 6 +#define ANIM_ROTATE_TO_SIDES 7 +#define ANIM_ROTATE_TO_SIDES_TWICE 8 +#define ANIM_GROW_VIBRATE 9 +#define ANIM_ZIGZAG_FAST 10 +#define ANIM_SWING_CONCAVE 11 +#define ANIM_SWING_CONCAVE_FAST 12 +#define ANIM_SWING_CONVEX 13 +#define ANIM_SWING_CONVEX_FAST 14 +#define ANIM_H_SHAKE 15 +#define ANIM_V_SHAKE 16 +#define ANIM_CIRCULAR_VIBRATE 17 +#define ANIM_TWIST 18 +#define ANIM_SHRINK_GROW 19 +#define ANIM_CIRCLE_C_CLOCKWISE 20 +#define ANIM_GLOW_BLACK 21 +#define ANIM_H_STRETCH 22 +#define ANIM_V_STRETCH 23 +#define ANIM_RISING_WOBBLE 24 +#define ANIM_V_SHAKE_TWICE 25 +#define ANIM_TIP_MOVE_FORWARD 26 +#define ANIM_H_PIVOT 27 +#define ANIM_V_SLIDE_WOBBLE 28 +#define ANIM_H_SLIDE_WOBBLE 29 +#define ANIM_V_JUMPS_BIG 30 +#define ANIM_SPIN_LONG 31 +#define ANIM_GLOW_ORANGE 32 +#define ANIM_GLOW_RED 33 +#define ANIM_GLOW_BLUE 34 +#define ANIM_GLOW_YELLOW 35 +#define ANIM_GLOW_PURPLE 36 +#define ANIM_BACK_AND_LUNGE 37 +#define ANIM_BACK_FLIP 38 +#define ANIM_FLICKER 39 +#define ANIM_BACK_FLIP_BIG 40 +#define ANIM_FRONT_FLIP 41 +#define ANIM_TUMBLING_FRONT_FLIP 42 +#define ANIM_FIGURE_8 43 +#define ANIM_FLASH_YELLOW 44 +#define ANIM_SWING_CONCAVE_FAST_SHORT 45 +#define ANIM_SWING_CONVEX_FAST_SHORT 46 +#define ANIM_ROTATE_UP_SLAM_DOWN 47 +#define ANIM_DEEP_V_SQUISH_AND_BOUNCE 48 +#define ANIM_H_JUMPS 49 +#define ANIM_H_JUMPS_V_STRETCH 50 +#define ANIM_ROTATE_TO_SIDES_FAST 51 +#define ANIM_ROTATE_UP_TO_SIDES 52 +#define ANIM_FLICKER_INCREASING 53 +#define ANIM_TIP_HOP_FORWARD 54 +#define ANIM_PIVOT_SHAKE 55 +#define ANIM_TIP_AND_SHAKE 56 +#define ANIM_VIBRATE_TO_CORNERS 57 +#define ANIM_GROW_IN_STAGES 58 +#define ANIM_V_SPRING 59 +#define ANIM_V_REPEATED_SPRING 60 +#define ANIM_SPRING_RISING 61 +#define ANIM_H_SPRING 62 +#define ANIM_H_REPEATED_SPRING_SLOW 63 +#define ANIM_H_SLIDE_SHRINK 64 +#define ANIM_LUNGE_GROW 65 +#define ANIM_CIRCLE_INTO_BG 66 +#define ANIM_RAPID_H_HOPS 67 +#define ANIM_FOUR_PETAL 68 +#define ANIM_V_SQUISH_AND_BOUNCE_SLOW 69 +#define ANIM_H_SLIDE_SLOW 70 +#define ANIM_V_SLIDE_SLOW 71 +#define ANIM_BOUNCE_ROTATE_TO_SIDES_SMALL 72 +#define ANIM_BOUNCE_ROTATE_TO_SIDES_SLOW 73 +#define ANIM_BOUNCE_ROTATE_TO_SIDES_SMALL_SLOW 74 +#define ANIM_ZIGZAG_SLOW 75 +#define ANIM_H_SHAKE_SLOW 76 +#define ANIM_V_SHAKE_SLOW 77 +#define ANIM_TWIST_TWICE 78 +#define ANIM_CIRCLE_C_CLOCKWISE_SLOW 79 +#define ANIM_V_SHAKE_TWICE_SLOW 80 +#define ANIM_V_SLIDE_WOBBLE_SMALL 81 +#define ANIM_V_JUMPS_SMALL 82 +#define ANIM_SPIN 83 +#define ANIM_TUMBLING_FRONT_FLIP_TWICE 84 +#define ANIM_DEEP_V_SQUISH_AND_BOUNCE_TWICE 85 +#define ANIM_H_JUMPS_V_STRETCH_TWICE 86 +#define ANIM_V_SHAKE_BACK 87 +#define ANIM_V_SHAKE_BACK_SLOW 88 +#define ANIM_V_SHAKE_H_SLIDE_SLOW 89 +#define ANIM_V_STRETCH_BOTH_ENDS_SLOW 90 +#define ANIM_H_STRETCH_FAR_SLOW 91 +#define ANIM_V_SHAKE_LOW_TWICE 92 +#define ANIM_H_SHAKE_FAST 93 +#define ANIM_H_SLIDE_FAST 94 +#define ANIM_H_VIBRATE_FAST 95 +#define ANIM_H_VIBRATE_FASTEST 96 +#define ANIM_V_SHAKE_BACK_FAST 97 +#define ANIM_V_SHAKE_LOW_TWICE_SLOW 98 +#define ANIM_V_SHAKE_LOW_TWICE_FAST 99 +#define ANIM_CIRCLE_C_CLOCKWISE_LONG 100 +#define ANIM_GROW_STUTTER_SLOW 101 +#define ANIM_V_SHAKE_H_SLIDE 102 +#define ANIM_V_SHAKE_H_SLIDE_FAST 103 +#define ANIM_TRIANGLE_DOWN_SLOW 104 +#define ANIM_TRIANGLE_DOWN 105 +#define ANIM_TRIANGLE_DOWN_TWICE 106 +#define ANIM_GROW 107 +#define ANIM_GROW_TWICE 108 +#define ANIM_H_SPRING_FAST 109 +#define ANIM_H_SPRING_SLOW 110 +#define ANIM_H_REPEATED_SPRING_FAST 111 +#define ANIM_H_REPEATED_SPRING 112 +#define ANIM_SHRINK_GROW_FAST 113 +#define ANIM_SHRINK_GROW_SLOW 114 +#define ANIM_V_STRETCH_BOTH_ENDS 115 +#define ANIM_V_STRETCH_BOTH_ENDS_TWICE 116 +#define ANIM_H_STRETCH_FAR_TWICE 117 +#define ANIM_H_STRETCH_FAR 118 +#define ANIM_GROW_STUTTER_TWICE 119 +#define ANIM_GROW_STUTTER 120 +#define ANIM_CONCAVE_ARC_LARGE_SLOW 121 +#define ANIM_CONCAVE_ARC_LARGE 122 +#define ANIM_CONCAVE_ARC_LARGE_TWICE 123 +#define ANIM_CONVEX_DOUBLE_ARC_SLOW 124 +#define ANIM_CONVEX_DOUBLE_ARC 125 +#define ANIM_CONVEX_DOUBLE_ARC_TWICE 126 +#define ANIM_CONCAVE_ARC_SMALL_SLOW 127 +#define ANIM_CONCAVE_ARC_SMALL 128 +#define ANIM_CONCAVE_ARC_SMALL_TWICE 129 +#define ANIM_H_DIP 130 +#define ANIM_H_DIP_FAST 131 +#define ANIM_H_DIP_TWICE 132 +#define ANIM_SHRINK_GROW_VIBRATE_FAST 133 +#define ANIM_SHRINK_GROW_VIBRATE 134 +#define ANIM_SHRINK_GROW_VIBRATE_SLOW 135 +#define ANIM_JOLT_RIGHT_FAST 136 +#define ANIM_JOLT_RIGHT 137 +#define ANIM_JOLT_RIGHT_SLOW 138 +#define ANIM_SHAKE_FLASH_YELLOW_FAST 139 +#define ANIM_SHAKE_FLASH_YELLOW 140 +#define ANIM_SHAKE_FLASH_YELLOW_SLOW 141 +#define ANIM_SHAKE_GLOW_RED_FAST 142 +#define ANIM_SHAKE_GLOW_RED 143 +#define ANIM_SHAKE_GLOW_RED_SLOW 144 +#define ANIM_SHAKE_GLOW_GREEN_FAST 145 +#define ANIM_SHAKE_GLOW_GREEN 146 +#define ANIM_SHAKE_GLOW_GREEN_SLOW 147 +#define ANIM_SHAKE_GLOW_BLUE_FAST 148 +#define ANIM_SHAKE_GLOW_BLUE 149 +#define ANIM_SHAKE_GLOW_BLUE_SLOW 150 + #endif // GUARD_POKEMON_ANIMATION_H diff --git a/include/pokemon_summary_screen.h b/include/pokemon_summary_screen.h index 6413dcdec..151ea3af8 100755 --- a/include/pokemon_summary_screen.h +++ b/include/pokemon_summary_screen.h @@ -12,8 +12,7 @@ void ShowPokemonSummaryScreen(u8 mode, void *mons, u8 monIndex, u8 maxMonIndex, void ShowSelectMovePokemonSummaryScreen(struct Pokemon *mons, u8 monIndex, u8 maxMonIndex, void (*callback)(void), u16 newMove); void ShowPokemonSummaryScreenSet40EF(u8 mode, struct BoxPokemon *mons, u8 monIndex, u8 maxMonIndex, void (*callback)(void)); u8 GetMoveSlotToReplace(void); -void SummaryScreen_SetUnknownTaskId(u8 taskId); -void SummaryScreen_DestroyUnknownTask(void); +void SummaryScreen_SetAnimDelayTaskId(u8 taskId); // The Pokemon Summary Screen can operate in different modes. Certain features, // such as move re-ordering, are available in the different modes. -- cgit v1.2.3 From c786a9b20c7d70546523a13406d7871f5fa5be2b Mon Sep 17 00:00:00 2001 From: GriffinR Date: Sun, 11 Apr 2021 16:23:10 -0400 Subject: Document pokeblock menu --- include/item_menu_icons.h | 6 +++--- include/menu_helpers.h | 10 +++++----- include/pokeblock.h | 3 +-- 3 files changed, 9 insertions(+), 10 deletions(-) (limited to 'include') diff --git a/include/item_menu_icons.h b/include/item_menu_icons.h index 7ff6ace94..50e11dfd9 100644 --- a/include/item_menu_icons.h +++ b/include/item_menu_icons.h @@ -14,9 +14,9 @@ void ShakeBagSprite(void); void AddSwitchPocketRotatingBallSprite(s16 rotationDirection); void AddBagItemIconSprite(u16 itemId, u8 id); void RemoveBagItemIconSprite(u8 id); -void sub_80D4FAC(void); -void sub_80D4FC8(u8 arg0); -void sub_80D4FEC(u8 arg0); +void CreateItemMenuSwapLine(void); +void SetItemMenuSwapLineInvisibility(bool8 invisible); +void UpdateItemMenuSwapLinePos(u8 y); u8 CreateBerryTagSprite(u8 id, s16 x, s16 y); void FreeBerryTagSpritePalette(void); u8 CreateSpinningBerrySprite(u8 berryId, u8 x, u8 y, bool8 startAffine); diff --git a/include/menu_helpers.h b/include/menu_helpers.h index 4557ebbb1..c4401354b 100644 --- a/include/menu_helpers.h +++ b/include/menu_helpers.h @@ -35,10 +35,10 @@ bool8 MenuHelpers_CallLinkSomething(void); void sub_812220C(struct ItemSlot *slots, u8 count, u8 *arg2, u8 *usedSlotsCount, u8 maxUsedSlotsCount); void sub_812225C(u16 *scrollOffset, u16 *cursorPos, u8 maxShownItems, u8 numItems); void sub_8122298(u16 *arg0, u16 *arg1, u8 arg2, u8 arg3, u8 arg4); -void LoadListMenuArrowsGfx(void); -void sub_8122344(u8 *spriteIds, u8 count); -void sub_81223B0(u8 *spriteIds, u8 count); -void sub_81223FC(u8 *spriteIds, u8 count, bool8 invisible); -void sub_8122448(u8 *spriteIds, u8 count, s16 x, u16 y); +void LoadListMenuSwapLineGfx(void); +void CreateSwapLineSprites(u8 *spriteIds, u8 count); +void DestroySwapLineSprites(u8 *spriteIds, u8 count); +void SetSwapLineSpritesInvisibility(u8 *spriteIds, u8 count, bool8 invisible); +void UpdateSwapLineSpritesPos(u8 *spriteIds, u8 count, s16 x, u16 y); #endif //GUARD_MENU_HELPERS_H diff --git a/include/pokeblock.h b/include/pokeblock.h index c82e99d8f..4c5a40488 100644 --- a/include/pokeblock.h +++ b/include/pokeblock.h @@ -4,8 +4,7 @@ #include "constants/berry.h" #include "constants/pokemon.h" -#define GFX_TAG_POKEBLOCK 14818 -#define GFX_TAG_POKEBLOCK_CASE 14800 +#define TAG_POKEBLOCK 14818 enum { -- cgit v1.2.3 From 042a2ecc417001be93bd363cbaff5415be65308c Mon Sep 17 00:00:00 2001 From: GriffinR Date: Mon, 12 Apr 2021 12:33:06 -0400 Subject: Document pokeblock feed scene --- include/graphics.h | 2 +- include/pokeblock.h | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) (limited to 'include') diff --git a/include/graphics.h b/include/graphics.h index 7c36b9cf5..cea8bbab1 100644 --- a/include/graphics.h +++ b/include/graphics.h @@ -4076,7 +4076,7 @@ extern const u8 gNamingScreenCursor_Gfx[]; extern const u8 gNamingScreenInputArrow_Gfx[]; extern const u8 gNamingScreenUnderscore_Gfx[]; -extern const u32 gUnknown_08D9BA44[]; +extern const u32 gPokeblockFeedBg_Tilemap[]; extern const u32 gConfetti_Gfx[]; extern const u32 gConfetti_Pal[]; diff --git a/include/pokeblock.h b/include/pokeblock.h index 4c5a40488..9e0161495 100644 --- a/include/pokeblock.h +++ b/include/pokeblock.h @@ -51,7 +51,7 @@ extern s16 gPokeblockGain; void ChooseMonToGivePokeblock(struct Pokeblock *pokeblock, void (*callback)(void)); // pokeblock feed -void CB2_PreparePokeblockFeedScene(void); +void PreparePokeblockFeedScene(void); // pokeblock extern const s8 gPokeblockFlavorCompatibilityTable[NUM_NATURES * FLAVOR_COUNT]; -- cgit v1.2.3 From 33ea2a10613df0d6ef25b146b175f8b3712896c3 Mon Sep 17 00:00:00 2001 From: GriffinR Date: Tue, 13 Apr 2021 02:50:50 -0400 Subject: Remove unnecessary scope for TEST_BUTTON --- include/global.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'include') diff --git a/include/global.h b/include/global.h index 18e2bfea7..19605ca57 100644 --- a/include/global.h +++ b/include/global.h @@ -107,7 +107,7 @@ #define T2_READ_PTR(ptr) (void*) T2_READ_32(ptr) // Macros for checking the joypad -#define TEST_BUTTON(field, button) ({(field) & (button);}) +#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 JOY_HELD_RAW(button) TEST_BUTTON(gMain.heldKeysRaw, button) -- cgit v1.2.3 From a1ed59450e133a9dd84c59869418d449e48fc1ce Mon Sep 17 00:00:00 2001 From: GriffinR Date: Thu, 15 Apr 2021 14:06:25 -0400 Subject: Doc storage - wallpaper and titles --- include/pokemon_storage_system.h | 2 -- 1 file changed, 2 deletions(-) (limited to 'include') diff --git a/include/pokemon_storage_system.h b/include/pokemon_storage_system.h index 7b6a38678..4e5ccfcda 100644 --- a/include/pokemon_storage_system.h +++ b/include/pokemon_storage_system.h @@ -51,8 +51,6 @@ void ZeroBoxMonAt(u8 boxId, u8 boxPosition); void BoxMonAtToMon(u8 boxId, u8 boxPosition, struct Pokemon *dst); struct BoxPokemon *GetBoxedMonPtr(u8 boxId, u8 boxPosition); u8 *GetBoxNamePtr(u8 boxId); -u8 GetBoxWallpaper(u8 boxId); -void SetBoxWallpaper(u8 boxId, u8 wallpaperId); s16 sub_80D214C(struct BoxPokemon *boxMons, u8 currIndex, u8 maxIndex, u8 arg3); bool8 CheckFreePokemonStorageSpace(void); bool32 CheckBoxMonSanityAt(u32 boxId, u32 boxPosition); -- cgit v1.2.3 From 838a452363c1296e3c9a0d92ce41f59a75e9c844 Mon Sep 17 00:00:00 2001 From: GriffinR Date: Thu, 15 Apr 2021 17:31:50 -0400 Subject: Doc storage - choose box menu, move wallpaper gfx --- include/pokemon_storage_system.h | 1 + include/pokemon_summary_screen.h | 17 ++++------------- 2 files changed, 5 insertions(+), 13 deletions(-) (limited to 'include') diff --git a/include/pokemon_storage_system.h b/include/pokemon_storage_system.h index 4e5ccfcda..6e5eab3f9 100644 --- a/include/pokemon_storage_system.h +++ b/include/pokemon_storage_system.h @@ -57,6 +57,7 @@ bool32 CheckBoxMonSanityAt(u32 boxId, u32 boxPosition); u32 CountStorageNonEggMons(void); u32 CountAllStorageMons(void); bool32 AnyStorageMonWithMove(u16 moveId); + void ResetWaldaWallpaper(void); void SetWaldaWallpaperLockedOrUnlocked(bool32 unlocked); bool32 IsWaldaWallpaperUnlocked(void); diff --git a/include/pokemon_summary_screen.h b/include/pokemon_summary_screen.h index 151ea3af8..3996c8e15 100755 --- a/include/pokemon_summary_screen.h +++ b/include/pokemon_summary_screen.h @@ -18,19 +18,10 @@ void SummaryScreen_SetAnimDelayTaskId(u8 taskId); // such as move re-ordering, are available in the different modes. enum PokemonSummaryScreenMode { - PSS_MODE_NORMAL, - PSS_MODE_LOCK_MOVES, - PSS_MODE_BOX, - PSS_MODE_SELECT_MOVE, -}; - -enum PokemonSummaryScreenPage -{ - PSS_PAGE_INFO, - PSS_PAGE_SKILLS, - PSS_PAGE_BATTLE_MOVES, - PSS_PAGE_CONTEST_MOVES, - PSS_PAGE_COUNT, + SUMMARY_MODE_NORMAL, + SUMMARY_MODE_LOCK_MOVES, + SUMMARY_MODE_BOX, + SUMMARY_MODE_SELECT_MOVE, }; #endif // GUARD_POKEMON_SUMMARY_SCREEN_H -- cgit v1.2.3 From 80cc7d46aeab92cf00e508d6c595cb7b590b3615 Mon Sep 17 00:00:00 2001 From: GriffinR Date: Fri, 16 Apr 2021 05:14:35 -0400 Subject: Doc storage - fix row/column flip --- include/pokemon_storage_system.h | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) (limited to 'include') diff --git a/include/pokemon_storage_system.h b/include/pokemon_storage_system.h index 6e5eab3f9..24e92a449 100644 --- a/include/pokemon_storage_system.h +++ b/include/pokemon_storage_system.h @@ -2,13 +2,13 @@ #define GUARD_POKEMON_STORAGE_SYSTEM_H #define TOTAL_BOXES_COUNT 14 -#define IN_BOX_ROWS 6 -#define IN_BOX_COLUMNS 5 +#define IN_BOX_ROWS 5 // Number of rows, 6 Pokémon per row +#define IN_BOX_COLUMNS 6 // Number of columns, 5 Pokémon per column #define IN_BOX_COUNT (IN_BOX_ROWS * IN_BOX_COLUMNS) -/* - ROWS -COLUMNS 0 1 2 3 4 5 +/* + COLUMNS +ROWS 0 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 -- cgit v1.2.3 From cd2a99b7c44bb875135c2c97589ecc160dad71f0 Mon Sep 17 00:00:00 2001 From: GriffinR Date: Sat, 17 Apr 2021 00:49:51 -0400 Subject: Doc storage - misc cleanup, some item/cursor --- include/graphics.h | 6 +++--- include/pokemon_storage_system.h | 2 +- 2 files changed, 4 insertions(+), 4 deletions(-) (limited to 'include') diff --git a/include/graphics.h b/include/graphics.h index cea8bbab1..ee5677f3c 100644 --- a/include/graphics.h +++ b/include/graphics.h @@ -4875,12 +4875,12 @@ extern const u32 gPokedexAreaScreenAreaUnknown_Gfx[]; extern const u16 gPokedexAreaScreenAreaUnknown_Pal[]; // Pokemon Storage System -extern const u32 gPSSMenu_Gfx[]; -extern const u16 gPSSMenu_Pal[]; +extern const u32 gStorageSystemMenu_Gfx[]; +extern const u16 gStorageSystemPartyMenu_Pal[]; +extern const u32 gStorageSystemPartyMenu_Tilemap[]; extern const u32 gWallpaperIcon_Plusle[]; extern const u32 gWallpaperIcon_Cross[]; extern const u32 gWallpaperIcon_Bolt[]; -extern const u32 gUnknown_08DD36C8[]; extern const u32 gWallpaperTiles_Ribbon[]; extern const u32 gWallpaperTilemap_Ribbon[]; extern const u16 gWallpaperPalettes_Ribbon[][16]; diff --git a/include/pokemon_storage_system.h b/include/pokemon_storage_system.h index 24e92a449..73a7833ee 100644 --- a/include/pokemon_storage_system.h +++ b/include/pokemon_storage_system.h @@ -51,7 +51,7 @@ void ZeroBoxMonAt(u8 boxId, u8 boxPosition); void BoxMonAtToMon(u8 boxId, u8 boxPosition, struct Pokemon *dst); struct BoxPokemon *GetBoxedMonPtr(u8 boxId, u8 boxPosition); u8 *GetBoxNamePtr(u8 boxId); -s16 sub_80D214C(struct BoxPokemon *boxMons, u8 currIndex, u8 maxIndex, u8 arg3); +s16 AdvanceStorageMonIndex(struct BoxPokemon *boxMons, u8 currIndex, u8 maxIndex, u8 arg3); bool8 CheckFreePokemonStorageSpace(void); bool32 CheckBoxMonSanityAt(u32 boxId, u32 boxPosition); u32 CountStorageNonEggMons(void); -- cgit v1.2.3 From 04af378904dc5e7ded00bb8e50c8e6b554c3571b Mon Sep 17 00:00:00 2001 From: GriffinR Date: Sun, 18 Apr 2021 20:12:12 -0400 Subject: Document trade sequence animation, some trade cleanup --- include/graphics.h | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'include') diff --git a/include/graphics.h b/include/graphics.h index cea8bbab1..786420472 100644 --- a/include/graphics.h +++ b/include/graphics.h @@ -4903,8 +4903,8 @@ extern const u16 gUnknown_08DDCF04[]; extern const u16 gTradeGba2_Pal[]; extern const u8 gTradeGba_Gfx[]; extern const u16 gTradeMenuMonBox_Tilemap[]; -extern const u8 gTradeButtons_Gfx[]; -extern const u16 gUnknown_08DDB444[]; +extern const u8 gTradeCursor_Gfx[]; +extern const u16 gTradeCursor_Pal[]; // Party menu extern const u32 gPartyMenuPokeball_Gfx[]; -- cgit v1.2.3 From a2a9f226129317c2557b908883903df47701324c Mon Sep 17 00:00:00 2001 From: GriffinR Date: Tue, 20 Apr 2021 21:16:47 -0400 Subject: Clean up contest_util --- include/graphics.h | 28 ++++++++++++++-------------- 1 file changed, 14 insertions(+), 14 deletions(-) (limited to 'include') diff --git a/include/graphics.h b/include/graphics.h index cea8bbab1..6262d8862 100644 --- a/include/graphics.h +++ b/include/graphics.h @@ -4924,21 +4924,21 @@ extern const u32 gRouletteMultiplier_Gfx[]; // Contest util extern const u32 gContestResults_Gfx[]; -extern const u32 gUnknown_08C19EEC[]; -extern const u32 gUnknown_08C1A000[]; -extern const u32 gUnknown_08C1A12C[]; +extern const u32 gContestResults_WinnerBanner_Tilemap[]; +extern const u32 gContestResults_Interface_Tilemap[]; +extern const u32 gContestResults_Bg_Tilemap[]; extern const u32 gContestResults_Pal[]; -extern const u16 gLinkContestResults_Tilemap[]; -extern const u16 gNormalContestResults_Tilemap[]; -extern const u16 gSuperContestResults_Tilemap[]; -extern const u16 gHyperContestResults_Tilemap[]; -extern const u16 gMasterContestResults_Tilemap[]; -extern const u16 gCoolContestResults_Tilemap[]; -extern const u16 gBeautyContestResults_Tilemap[]; -extern const u16 gCuteContestResults_Tilemap[]; -extern const u16 gSmartContestResults_Tilemap[]; -extern const u16 gToughContestResults_Tilemap[]; -extern const u16 gContestResults_Tilemap[]; +extern const u16 gContestResultsTitle_Link_Tilemap[]; +extern const u16 gContestResultsTitle_Normal_Tilemap[]; +extern const u16 gContestResultsTitle_Super_Tilemap[]; +extern const u16 gContestResultsTitle_Hyper_Tilemap[]; +extern const u16 gContestResultsTitle_Master_Tilemap[]; +extern const u16 gContestResultsTitle_Cool_Tilemap[]; +extern const u16 gContestResultsTitle_Beauty_Tilemap[]; +extern const u16 gContestResultsTitle_Cute_Tilemap[]; +extern const u16 gContestResultsTitle_Smart_Tilemap[]; +extern const u16 gContestResultsTitle_Tough_Tilemap[]; +extern const u16 gContestResultsTitle_Tilemap[]; // Trainer Card. extern const u16 gHoennTrainerCard0Star_Pal[]; -- cgit v1.2.3 From dbe24f0baa560aaa30f3084f1dfb21fb3cfb04db Mon Sep 17 00:00:00 2001 From: GriffinR Date: Wed, 21 Apr 2021 20:04:12 -0400 Subject: Clean up contest_painting --- include/constants/contest.h | 16 +++++++++++++--- include/contest.h | 8 ++++---- include/contest_util.h | 2 +- 3 files changed, 18 insertions(+), 8 deletions(-) (limited to 'include') diff --git a/include/constants/contest.h b/include/constants/contest.h index 9eb6b26e4..c18af0817 100644 --- a/include/constants/contest.h +++ b/include/constants/contest.h @@ -22,7 +22,9 @@ #define CONTEST_TYPE_NPC_MASTER (CONTEST_RANK_MASTER + 1) #define CONTEST_TYPE_LINK (CONTEST_RANK_LINK + 1) -#define CONTEST_WINNER_ARTIST 0 // Winner shown by the artist, painting not necessarily saved +// IDs below - 1 are indexes into gSaveBlock1Ptr->contestWinners[] +// CONTEST_WINNER_ARTIST is for the winner of the most recent contest, and is not saved. +#define CONTEST_WINNER_ARTIST 0 #define CONTEST_WINNER_HALL_1 1 #define CONTEST_WINNER_HALL_2 2 #define CONTEST_WINNER_HALL_3 3 @@ -30,8 +32,8 @@ #define CONTEST_WINNER_HALL_5 5 #define CONTEST_WINNER_HALL_6 6 #define NUM_CONTEST_HALL_WINNERS 6 -#define CONTEST_WINNER_7 7 -#define CONTEST_WINNER_8 8 +#define CONTEST_WINNER_HALL_UNUSED 7 +#define CONTEST_WINNER_MUSEUM_UNUSED 8 #define CONTEST_WINNER_MUSEUM_COOL 9 #define CONTEST_WINNER_MUSEUM_BEAUTY 10 #define CONTEST_WINNER_MUSEUM_CUTE 11 @@ -39,6 +41,14 @@ #define CONTEST_WINNER_MUSEUM_TOUGH 13 // NUM_CONTEST_WINNERS in constants/global.h +#define MUSEUM_CONTEST_WINNERS_START CONTEST_WINNER_MUSEUM_UNUSED + +// The number of possible captions for a Contest painting, per category +#define NUM_PAINTING_CAPTIONS 3 + +#define CONTEST_SAVE_FOR_MUSEUM ((u8)-1) +#define CONTEST_SAVE_FOR_ARTIST ((u8)-2) + #define CANT_ENTER_CONTEST 0 #define CAN_ENTER_CONTEST_EQUAL_RANK 1 #define CAN_ENTER_CONTEST_HIGH_RANK 2 diff --git a/include/contest.h b/include/contest.h index 1dd4340bd..6469bf628 100644 --- a/include/contest.h +++ b/include/contest.h @@ -326,8 +326,8 @@ extern u8 gHighestRibbonRank; extern struct ContestResources *gContestResources; extern u8 sContestBgCopyFlags; extern struct ContestWinner gCurContestWinner; -extern u8 gUnknown_02039F5C; -extern u8 gUnknown_02039F5D; +extern u8 gCurContestWinnerIsForArtist; +extern u8 gCurContestWinnerSaveIdx; extern u32 gContestRngValue; // contest.c @@ -351,8 +351,8 @@ s8 Contest_GetMoveExcitement(u16 move); bool8 IsContestantAllowedToCombo(u8 contestant); void Contest_PrintTextToBg0WindowAt(u32 windowId, u8 *currChar, s32 x, s32 y, s32 fontId); void ResetContestLinkResults(void); -bool8 sub_80DEDA8(u8 a); -u8 sub_80DEFA8(u8 a, u8 b); +bool8 SaveContestWinner(u8 rank); +u8 GetContestWinnerSaveIdx(u8 rank, bool8 shift); void ClearContestWinnerPicsInContestHall(void); void StripPlayerAndMonNamesForLinkContest(struct ContestPokemon *mon, s32 language); diff --git a/include/contest_util.h b/include/contest_util.h index 76f9ae522..5b0c5559a 100644 --- a/include/contest_util.h +++ b/include/contest_util.h @@ -7,7 +7,7 @@ void StartContest(void); void BufferContestantMonSpecies(void); void ShowContestResults(void); void ContestLinkTransfer(u8); -void ShowContestWinnerPainting(void); +void ShowContestPainting(void); u16 GetContestRand(void); u8 CountPlayerContestPaintings(void); -- cgit v1.2.3 From bc9fc382547aadfb321c7c55571786d20c5e9663 Mon Sep 17 00:00:00 2001 From: GriffinR Date: Thu, 22 Apr 2021 14:30:45 -0400 Subject: Misc contest cleanup --- include/constants/contest.h | 12 ++++++------ include/contest.h | 8 ++++---- include/contest_util.h | 2 +- include/international_string_util.h | 2 +- 4 files changed, 12 insertions(+), 12 deletions(-) (limited to 'include') diff --git a/include/constants/contest.h b/include/constants/contest.h index c18af0817..28b02e9c0 100644 --- a/include/constants/contest.h +++ b/include/constants/contest.h @@ -32,8 +32,8 @@ #define CONTEST_WINNER_HALL_5 5 #define CONTEST_WINNER_HALL_6 6 #define NUM_CONTEST_HALL_WINNERS 6 -#define CONTEST_WINNER_HALL_UNUSED 7 -#define CONTEST_WINNER_MUSEUM_UNUSED 8 +#define CONTEST_WINNER_HALL_UNUSED_1 7 // These two have data for gDefaultContestWinners +#define CONTEST_WINNER_HALL_UNUSED_2 8 // but there are only 6 paintings in the Contest Hall #define CONTEST_WINNER_MUSEUM_COOL 9 #define CONTEST_WINNER_MUSEUM_BEAUTY 10 #define CONTEST_WINNER_MUSEUM_CUTE 11 @@ -41,14 +41,14 @@ #define CONTEST_WINNER_MUSEUM_TOUGH 13 // NUM_CONTEST_WINNERS in constants/global.h -#define MUSEUM_CONTEST_WINNERS_START CONTEST_WINNER_MUSEUM_UNUSED - -// The number of possible captions for a Contest painting, per category -#define NUM_PAINTING_CAPTIONS 3 +#define MUSEUM_CONTEST_WINNERS_START (CONTEST_WINNER_MUSEUM_COOL - 1) #define CONTEST_SAVE_FOR_MUSEUM ((u8)-1) #define CONTEST_SAVE_FOR_ARTIST ((u8)-2) +// The number of possible captions for a Contest painting, per category +#define NUM_PAINTING_CAPTIONS 3 + #define CANT_ENTER_CONTEST 0 #define CAN_ENTER_CONTEST_EQUAL_RANK 1 #define CAN_ENTER_CONTEST_HIGH_RANK 2 diff --git a/include/contest.h b/include/contest.h index 6469bf628..9bac63eda 100644 --- a/include/contest.h +++ b/include/contest.h @@ -111,11 +111,11 @@ struct ContestPokemon u32 otId; }; -struct Shared1A004 +struct ContestTempSave { u16 cachedWindowPalettes[16][16]; // Saved palette data before a move happens? - u16 unk18204[PLTT_BUFFER_SIZE]; // Saved copy of gPlttBufferUnfaded - u16 unk18604[PLTT_BUFFER_SIZE]; // Saved copy of gPlttBufferFaded + u16 cachedPlttBufferUnfaded[PLTT_BUFFER_SIZE]; + u16 cachedPlttBufferFaded[PLTT_BUFFER_SIZE]; u8 savedJunk[0x800]; }; @@ -306,7 +306,7 @@ struct ContestResources #define eUnzippedContestAudience_Gfx (gHeap + 0x18000) #define eContestAudienceFrame2_Gfx (gHeap + 0x19000) #define eContestDebugMode (gHeap[0x1a000]) -#define eUnknownHeap1A004 (*(struct Shared1A004 *)(gHeap + 0x1a004)) +#define eContestTempSave (*(struct ContestTempSave *)(gHeap + 0x1a004)) extern struct ContestPokemon gContestMons[CONTESTANT_COUNT]; extern s16 gContestMonRound1Points[CONTESTANT_COUNT]; diff --git a/include/contest_util.h b/include/contest_util.h index 5b0c5559a..1e97d91d3 100644 --- a/include/contest_util.h +++ b/include/contest_util.h @@ -9,6 +9,6 @@ void ShowContestResults(void); void ContestLinkTransfer(u8); void ShowContestPainting(void); u16 GetContestRand(void); -u8 CountPlayerContestPaintings(void); +u8 CountPlayerMuseumPaintings(void); #endif // GUARD_CONTEST_UTIL_H diff --git a/include/international_string_util.h b/include/international_string_util.h index f76fc5be1..fe7e85b41 100644 --- a/include/international_string_util.h +++ b/include/international_string_util.h @@ -17,7 +17,7 @@ void CopyMonCategoryText(int dexNum, u8 *dest); u8 *sub_81DB494(u8 *str, int fontId, const u8 *str2, int totalStringWidth); void PadNameString(u8 *dest, u8 padChar); void ConvertInternationalPlayerNameStripChar(u8 *, u8); -void sub_81DB5AC(u8 *); +void ConvertInternationalContestantName(u8 *); int sub_81DB604(u8 *); void sub_81DB620(int windowId, int columnStart, int rowStart, int numFillTiles, int numRows); -- cgit v1.2.3 From 8c820878bfa91e7a00953e02a5e93847c5428468 Mon Sep 17 00:00:00 2001 From: GriffinR Date: Thu, 22 Apr 2021 18:49:54 -0400 Subject: Document Battle Pyramid Bag --- include/battle_pyramid_bag.h | 54 ++++++++++++++++++++++++++++++++------------ include/menu.h | 4 ++-- include/menu_helpers.h | 2 +- include/strings.h | 3 ++- 4 files changed, 44 insertions(+), 19 deletions(-) (limited to 'include') diff --git a/include/battle_pyramid_bag.h b/include/battle_pyramid_bag.h index df111b939..de571714c 100644 --- a/include/battle_pyramid_bag.h +++ b/include/battle_pyramid_bag.h @@ -3,48 +3,72 @@ #include "list_menu.h" -struct PyramidBagResources +enum { + PYRAMIDBAG_LOC_FIELD, + PYRAMIDBAG_LOC_BATTLE, + PYRAMIDBAG_LOC_PARTY, + PYRAMIDBAG_LOC_CHOOSE_TOSS, + PYRAMIDBAG_LOC_PREV, +}; + +enum { + PBAG_SPRITE_BAG, + PBAG_SPRITE_ITEM_ICON, + PBAG_SPRITE_ITEM_ICON_ALT, + PBAG_SPRITE_SWAP_LINE_START, // Swap line consists of 8 sprites + PBAG_SPRITE_SWAP_LINE_2, + PBAG_SPRITE_SWAP_LINE_3, + PBAG_SPRITE_SWAP_LINE_4, + PBAG_SPRITE_SWAP_LINE_5, + PBAG_SPRITE_SWAP_LINE_6, + PBAG_SPRITE_SWAP_LINE_7, + PBAG_SPRITE_SWAP_LINE_END, + PBAG_SPRITE_COUNT +}; +#define NUM_SWAP_LINE_SPRITES (1 + PBAG_SPRITE_SWAP_LINE_END - PBAG_SPRITE_SWAP_LINE_START) + +struct PyramidBagMenu { - void (*callback2)(void); - u8 tilemapBuffer[0x800]; - u8 itemsSpriteIds[PYRAMID_BAG_ITEMS_COUNT + 1]; + void (*exitCallback)(void); + u8 tilemapBuffer[BG_SCREEN_SIZE]; + u8 spriteIds[PBAG_SPRITE_COUNT]; u8 windowIds[5]; - u8 unk814; - u8 unk815; + u8 toSwapPos; + bool8 isAltIcon; // Two item icons loaded at a time. Tracks which to show next u8 scrollIndicatorsTaskId; const u8 *menuActionIds; - u8 filler81C[0x820 - 0x81C]; + u8 unused1[4]; u8 menuActionsCount; u8 listMenuCount; u8 listMenuMaxShown; struct ListMenuItem bagListItems[PYRAMID_BAG_ITEMS_COUNT + 1]; u8 itemStrings[PYRAMID_BAG_ITEMS_COUNT + 1][ITEM_NAME_LENGTH + 10]; s16 state; - u8 filler986[0x98C - 0x986]; + u8 unused2[4]; }; -struct PyramidBagCursorData +struct PyramidBagMenuState { void (*callback)(void); - u8 unk4; + u8 location; u16 cursorPosition; u16 scrollPosition; }; -extern struct PyramidBagResources *gPyramidBagResources; -extern struct PyramidBagCursorData gPyramidBagCursorData; +extern struct PyramidBagMenu *gPyramidBagMenu; +extern struct PyramidBagMenuState gPyramidBagMenuState; void InitBattlePyramidBagCursorPosition(void); void CB2_PyramidBagMenuFromStartMenu(void); void CB2_ReturnToPyramidBagMenu(void); -void sub_81C5924(void); -void sub_81C59BC(void); +void UpdatePyramidBagList(void); +void UpdatePyramidBagCursorPos(void); void sub_81C4EFC(void); void GoToBattlePyramidBagMenu(u8 a0, void (*callback)(void)); void Task_CloseBattlePyramidBagMessage(u8 taskId); void TryStoreHeldItemsInPyramidBag(void); void ChooseItemsToTossFromPyramidBag(void); -void CloseBattlePyramidBagAndSetCallback(u8 taskId); +void CloseBattlePyramidBag(u8 taskId); void DisplayItemMessageInBattlePyramid(u8 taskId, const u8 *str, void (*callback)(u8 taskId)); #endif // GUARD_BATTLE_PYRAMID_BAG_H diff --git a/include/menu.h b/include/menu.h index c9d8e374d..07e00eb73 100644 --- a/include/menu.h +++ b/include/menu.h @@ -90,8 +90,8 @@ void *malloc_and_decompress(const void *src, u32 *sizeOut); u16 copy_decompressed_tile_data_to_vram(u8 bgId, const void *src, u16 size, u16 offset, u8 mode); void AddTextPrinterForMessage(bool8 allowSkippingDelayWithButtonPress); void AddItemMenuActionTextPrinters(u8 windowId, u8 fontId, u8 left, u8 top, u8 letterSpacing, u8 lineHeight, u8 itemCount, const struct MenuAction *strs, const u8 *a8); -void sub_8198DBC(u8 windowId, u8 fontId, u8 left, u8 top, u8 a4, u8 itemCount, u8 itemCount2, const struct MenuAction *strs, const u8 *a8); -u8 sub_8199944(u8 windowId, u8 optionWidth, u8 columns, u8 rows, u8 initialCursorPos); +void PrintMenuActionGrid(u8 windowId, u8 fontId, u8 left, u8 top, u8 a4, u8 itemCount, u8 itemCount2, const struct MenuAction *strs, const u8 *a8); +u8 InitMenuActionGrid(u8 windowId, u8 optionWidth, u8 columns, u8 rows, u8 initialCursorPos); u8 ChangeListMenuCursorPosition(s8 deltaX, s8 deltaY); u8 GetStartMenuWindowId(void); void ListMenuLoadStdPalAt(u8, u8); diff --git a/include/menu_helpers.h b/include/menu_helpers.h index c4401354b..9909437a2 100644 --- a/include/menu_helpers.h +++ b/include/menu_helpers.h @@ -29,7 +29,7 @@ bool8 AdjustQuantityAccordingToDPadInput(s16 *arg0, u16 arg1); u8 GetLRKeysPressed(void); u8 GetLRKeysPressedAndHeld(void); bool8 sub_8122148(u16 itemId); -bool8 itemid_80BF6D8_mail_related(u16 itemId); +bool8 IsWritingMailAllowed(u16 itemId); bool8 MenuHelpers_LinkSomething(void); bool8 MenuHelpers_CallLinkSomething(void); void sub_812220C(struct ItemSlot *slots, u8 count, u8 *arg2, u8 *usedSlotsCount, u8 maxUsedSlotsCount); diff --git a/include/strings.h b/include/strings.h index 8880f3a5c..04283db0e 100644 --- a/include/strings.h +++ b/include/strings.h @@ -982,7 +982,8 @@ extern const u8 gText_RibbonsVar1[]; extern const u8 gText_OneDash[]; extern const u8 gText_TwoDashes[]; -extern const u8 *const gReturnToXStringsTable2[]; +extern const u8 *const gBagMenu_ReturnToStrings[]; +extern const u8 *const gPyramidBagMenu_ReturnToStrings[]; extern const u8 gText_NumPlayerLink[]; extern const u8 gText_ConfirmLinkWhenPlayersReady[]; -- cgit v1.2.3 From 004c37bf022f9ab8a4307306f84cb20ac1dc9518 Mon Sep 17 00:00:00 2001 From: GriffinR Date: Fri, 23 Apr 2021 17:04:44 -0400 Subject: Sync ereader_helpers with pokefirered --- include/ereader_helpers.h | 8 ++++---- include/link.h | 2 +- 2 files changed, 5 insertions(+), 5 deletions(-) (limited to 'include') diff --git a/include/ereader_helpers.h b/include/ereader_helpers.h index 8dc3b907a..7cced65cb 100755 --- a/include/ereader_helpers.h +++ b/include/ereader_helpers.h @@ -24,11 +24,11 @@ struct EReaderTrainerHillSet bool8 EReader_IsReceivedDataValid(struct EReaderTrainerHillSet *buffer); bool32 TryWriteTrainerHill(struct EReaderTrainerHillSet *arg0); bool32 ReadTrainerHillAndValidate(void); -int EReaderHandleTransfer(u8, u32, u32*, u32*); -void sub_81D3F9C(void); -void sub_81D3FAC(void); +int EReaderHandleTransfer(u8, size_t, const void *, void *); +void EReaderHelper_Timer3Callback(void); +void EReaderHelper_SerialCallback(void); void EReaderHelper_SaveRegsState(void); void EReaderHelper_RestoreRegsState(void); -void sub_81D4238(void); +void EReaderHelper_ClearSendRecvMgr(void); #endif // GUARD_EREADER_HELPERS_H diff --git a/include/link.h b/include/link.h index 3b621e6c1..407dbabb9 100644 --- a/include/link.h +++ b/include/link.h @@ -323,7 +323,7 @@ extern bool8 gSavedLinkPlayerCount; extern u8 gSavedMultiplayerId; extern struct LinkTestBGInfo gLinkTestBGInfo; extern void (*gLinkCallback)(void); -extern bool8 gShouldAdvanceLinkState; +extern u8 gShouldAdvanceLinkState; extern u16 gLinkTestBlockChecksums[MAX_LINK_PLAYERS]; extern u8 gBlockRequestType; extern u8 gLastSendQueueCount; -- cgit v1.2.3 From 86475c5ded028032a5b02c2700af77de2ab140c6 Mon Sep 17 00:00:00 2001 From: GriffinR Date: Sat, 24 Apr 2021 18:04:27 -0400 Subject: Document trainer hill ereader --- include/constants/trainer_hill.h | 5 +++-- include/ereader_helpers.h | 15 +++++++-------- 2 files changed, 10 insertions(+), 10 deletions(-) (limited to 'include') diff --git a/include/constants/trainer_hill.h b/include/constants/trainer_hill.h index 27357e99c..0e802bba8 100644 --- a/include/constants/trainer_hill.h +++ b/include/constants/trainer_hill.h @@ -37,8 +37,9 @@ #define TRAINER_HILL_TEXT_PLAYER_WON 4 #define TRAINER_HILL_TEXT_AFTER 5 -#define NUM_TRAINER_HILL_TRAINERS (NUM_TRAINER_HILL_FLOORS * 2) -#define NUM_TRAINER_HILL_TRAINERS_JP (NUM_TRAINER_HILL_FLOORS_JP * 2) +#define TRAINER_HILL_TRAINERS_PER_FLOOR 2 +#define NUM_TRAINER_HILL_TRAINERS (NUM_TRAINER_HILL_FLOORS * TRAINER_HILL_TRAINERS_PER_FLOOR) +#define NUM_TRAINER_HILL_TRAINERS_JP (NUM_TRAINER_HILL_FLOORS_JP * TRAINER_HILL_TRAINERS_PER_FLOOR) // Values returned by TrainerHillGetChallengeStatus #define TRAINER_HILL_PLAYER_STATUS_LOST 0 diff --git a/include/ereader_helpers.h b/include/ereader_helpers.h index 7cced65cb..937cfaca1 100755 --- a/include/ereader_helpers.h +++ b/include/ereader_helpers.h @@ -5,24 +5,23 @@ struct EReaderTrainerHillTrainer { - u8 unk0; - struct TrainerHillTrainer unk4; - struct TrHillDisplay unk14C; + u8 trainerNum; + struct TrainerHillTrainer trainer; + struct TrHillDisplay display; u32 checksum; }; // size=0x274 struct EReaderTrainerHillSet { - u8 count; + u8 numTrainers; u8 id; - u16 dummy; u32 checksum; - struct EReaderTrainerHillTrainer unk_8[6]; + struct EReaderTrainerHillTrainer trainers[6]; u8 unk_ec0[40]; }; // size = 0xf00 -bool8 EReader_IsReceivedDataValid(struct EReaderTrainerHillSet *buffer); -bool32 TryWriteTrainerHill(struct EReaderTrainerHillSet *arg0); +bool8 ValidateTrainerHillData(struct EReaderTrainerHillSet *); +bool32 TryWriteTrainerHill(struct EReaderTrainerHillSet *); bool32 ReadTrainerHillAndValidate(void); int EReaderHandleTransfer(u8, size_t, const void *, void *); void EReaderHelper_Timer3Callback(void); -- cgit v1.2.3 From e065c0c28576509f1873d76168618e4e57692f86 Mon Sep 17 00:00:00 2001 From: GriffinR Date: Sat, 24 Apr 2021 18:26:25 -0400 Subject: Label more unused battle anims --- include/battle_anim.h | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'include') diff --git a/include/battle_anim.h b/include/battle_anim.h index 34bd774fe..476480489 100644 --- a/include/battle_anim.h +++ b/include/battle_anim.h @@ -75,8 +75,8 @@ int GetAnimBgAttribute(u8 bgId, u8 attributeId); // battle_anim_mons.c void TranslateSpriteInEllipseOverDuration(struct Sprite *sprite); -void AnimUnused_80A8AEC(struct Sprite *sprite); -void AnimUnused_80A8A6C(struct Sprite *sprite); +void AnimTranslateLinearAndFlicker(struct Sprite *sprite); +void AnimTranslateLinearAndFlicker_Flipped(struct Sprite *sprite); void AnimWeatherBallUp(struct Sprite *sprite); void AnimWeatherBallDown(struct Sprite *sprite); void AnimSpinningSparkle(struct Sprite *sprite); -- cgit v1.2.3 From bee60f4c64e6cdf2bfa3777b59067ff63450e4e3 Mon Sep 17 00:00:00 2001 From: GriffinR Date: Sat, 24 Apr 2021 23:29:49 -0400 Subject: Document battler sprite affine anims, default pokeball throw --- include/data.h | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) (limited to 'include') diff --git a/include/data.h b/include/data.h index 2f8c44746..f94f55a8f 100644 --- a/include/data.h +++ b/include/data.h @@ -5,6 +5,12 @@ #define SPECIES_SHINY_TAG 500 +enum { + BATTLER_AFFINE_NORMAL, + BATTLER_AFFINE_EMERGE, + BATTLER_AFFINE_RETURN, +}; + struct MonCoords { // This would use a bitfield, but some function @@ -87,9 +93,9 @@ extern const struct SpriteFrameImage gTrainerBackPicTable_Steven[]; extern const union AffineAnimCmd *const gAffineAnims_BattleSpritePlayerSide[]; extern const union AffineAnimCmd *const gAffineAnims_BattleSpriteOpponentSide[]; -extern const union AffineAnimCmd *const gUnknown_082FF6C0[]; +extern const union AffineAnimCmd *const gAffineAnims_BattleSpriteContest[]; -extern const union AnimCmd *const gUnknown_082FF70C[]; +extern const union AnimCmd *const gAnims_MonPic[]; extern const struct MonCoords gMonFrontPicCoords[]; extern const struct CompressedSpriteSheet gMonStillFrontPicTable[]; extern const struct MonCoords gMonBackPicCoords[]; -- cgit v1.2.3 From aad090e154d4cb1397468f3b19071ddad688a7bc Mon Sep 17 00:00:00 2001 From: GriffinR Date: Sun, 25 Apr 2021 17:22:45 -0400 Subject: Document TV --- include/constants/battle_frontier.h | 15 +++++++++++++++ include/constants/easy_chat.h | 2 +- include/constants/metatile_labels.h | 2 ++ include/constants/tv.h | 38 +++++++++++++++++++++++++++++++++---- include/daycare.h | 2 +- include/global.h | 8 ++++---- include/global.tv.h | 22 +++++++++++---------- include/mauville_old_man.h | 2 +- include/tv.h | 30 +++++++++++++---------------- 9 files changed, 83 insertions(+), 38 deletions(-) (limited to 'include') diff --git a/include/constants/battle_frontier.h b/include/constants/battle_frontier.h index bbe6db81c..68c5a42ef 100644 --- a/include/constants/battle_frontier.h +++ b/include/constants/battle_frontier.h @@ -78,6 +78,21 @@ #define FRONTIER_MANIAC_MESSAGE_COUNT 3 +// Frontier TV Show +#define FRONTIER_SHOW_TOWER_SINGLES 1 +#define FRONTIER_SHOW_TOWER_DOUBLES 2 +#define FRONTIER_SHOW_TOWER_MULTIS 3 +#define FRONTIER_SHOW_TOWER_LINK_MULTIS 4 +#define FRONTIER_SHOW_DOME_SINGLES 5 +#define FRONTIER_SHOW_DOME_DOUBLES 6 +#define FRONTIER_SHOW_FACTORY_SINGLES 7 +#define FRONTIER_SHOW_FACTORY_DOUBLES 8 +#define FRONTIER_SHOW_PIKE 9 +#define FRONTIER_SHOW_ARENA 10 +#define FRONTIER_SHOW_PALACE_SINGLES 11 +#define FRONTIER_SHOW_PALACE_DOUBLES 12 +#define FRONTIER_SHOW_PYRAMID 13 + // Frontier Gambler #define FRONTIER_GAMBLER_WAITING 0 #define FRONTIER_GAMBLER_PLACED_BET 1 diff --git a/include/constants/easy_chat.h b/include/constants/easy_chat.h index 069f17fcb..f98cedbb7 100644 --- a/include/constants/easy_chat.h +++ b/include/constants/easy_chat.h @@ -9,7 +9,7 @@ #define EASY_CHAT_TYPE_INTERVIEW 5 #define EASY_CHAT_TYPE_BARD_SONG 6 #define EASY_CHAT_TYPE_FAN_CLUB 7 -#define EASY_CHAT_TYPE_UNK_8 8 +#define EASY_CHAT_TYPE_DUMMY_SHOW 8 #define EASY_CHAT_TYPE_TRENDY_PHRASE 9 #define EASY_CHAT_TYPE_GABBY_AND_TY 10 #define EASY_CHAT_TYPE_CONTEST_INTERVIEW 11 diff --git a/include/constants/metatile_labels.h b/include/constants/metatile_labels.h index 836ab6ef2..b5ef69046 100644 --- a/include/constants/metatile_labels.h +++ b/include/constants/metatile_labels.h @@ -42,6 +42,8 @@ #define METATILE_General_BlueCaveOpen 0x1B1 // gTileset_Building +#define METATILE_Building_TV_Off 0x002 +#define METATILE_Building_TV_On 0x003 #define METATILE_Building_PC_Off 0x004 #define METATILE_Building_PC_On 0x005 diff --git a/include/constants/tv.h b/include/constants/tv.h index f7b091f49..1b28f6e6e 100644 --- a/include/constants/tv.h +++ b/include/constants/tv.h @@ -6,12 +6,22 @@ #define POKENEWS_GAME_CORNER 2 #define POKENEWS_LILYCOVE 3 #define POKENEWS_BLENDMASTER 4 +#define NUM_POKENEWS_TYPES 4 // Excludes NONE + +// TV shows are categorized as being in one of 3 groups +// - TVGROUP_NORMAL, TV shows that can appear without Record Mixing +// - TVGROUP_RECORD_MIX, TV shows that can only appear via Record Mixing +// - TVGROUP_OUTBREAK, just contains TVSHOW_MASS_OUTBREAK +// Each group was allotted 20 spaces arbitrarily, though none use all 20 #define TVSHOW_OFF_AIR 0 + +// TVGROUP_NORMAL +#define TVGROUP_NORMAL_START 1 #define TVSHOW_FAN_CLUB_LETTER 1 #define TVSHOW_RECENT_HAPPENINGS 2 #define TVSHOW_PKMN_FAN_CLUB_OPINIONS 3 -#define TVSHOW_UNKN_SHOWTYPE_04 4 +#define TVSHOW_DUMMY 4 #define TVSHOW_NAME_RATER_SHOW 5 #define TVSHOW_BRAVO_TRAINER_POKEMON_PROFILE 6 #define TVSHOW_BRAVO_TRAINER_BATTLE_TOWER_PROFILE 7 @@ -20,7 +30,11 @@ #define TVSHOW_BATTLE_UPDATE 10 #define TVSHOW_FAN_CLUB_SPECIAL 11 #define TVSHOW_LILYCOVE_CONTEST_LADY 12 -// // +// +#define TVGROUP_NORMAL_END 20 + +// TVGROUP_RECORD_MIX +#define TVGROUP_RECORD_MIX_START 21 #define TVSHOW_POKEMON_TODAY_CAUGHT 21 #define TVSHOW_SMART_SHOPPER 22 #define TVSHOW_POKEMON_TODAY_FAILED 23 @@ -40,8 +54,22 @@ #define TVSHOW_NUMBER_ONE 37 #define TVSHOW_SECRET_BASE_SECRETS 38 #define TVSHOW_SAFARI_FAN_CLUB 39 -// // -#define TVSHOW_MASS_OUTBREAK 41 +#define TVGROUP_RECORD_MIX_END 40 + +// TVGROUP_OUTBREAK +#define TVGROUP_OUTBREAK_START 41 +#define TVSHOW_MASS_OUTBREAK 41 +// +#define TVGROUP_OUTBREAK_END 60 + +// The first 5 elements of gSaveBlock1Ptr->tvShows are reserved +// for TV shows from TVGROUP_NORMAL. The remainder are for TV +// shows from TVGROUP_RECORD_MIX. +#define NUM_NORMAL_TVSHOW_SLOTS 5 + +#define PLAYERS_HOUSE_TV_NONE 0 +#define PLAYERS_HOUSE_TV_LATI 1 +#define PLAYERS_HOUSE_TV_MOVIE 2 // Number of ribbons to put Spot the Cuties on air #define NUM_CUTIES_RIBBONS 4 @@ -221,4 +249,6 @@ #define CONTESTLADYLIVE_STATE_LOST 2 #define CONTESTLADYLIVE_STATE_LOST_BADLY 3 +#define SMARTSHOPPER_NUM_ITEMS 3 + #endif //GUARD_CONSTANTS_TV_H diff --git a/include/daycare.h b/include/daycare.h index 7d6f2fb19..d6c0d4201 100644 --- a/include/daycare.h +++ b/include/daycare.h @@ -6,7 +6,7 @@ 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 *daycareMail); void StoreSelectedPokemonInDaycare(void); u16 TakePokemonFromDaycare(void); void GetDaycareCost(void); diff --git a/include/global.h b/include/global.h index 19605ca57..e4c11f9ef 100644 --- a/include/global.h +++ b/include/global.h @@ -727,7 +727,7 @@ struct ContestWinner u8 contestRank; }; -struct DayCareMail +struct DaycareMail { struct MailStruct message; u8 OT_name[PLAYER_NAME_LENGTH + 1]; @@ -739,7 +739,7 @@ struct DayCareMail struct DaycareMon { struct BoxPokemon mon; - struct DayCareMail mail; + struct DaycareMail mail; u32 steps; }; @@ -750,9 +750,9 @@ struct DayCare u8 stepCounter; }; -struct RecordMixingDayCareMail +struct RecordMixingDaycareMail { - struct DayCareMail mail[DAYCARE_MON_COUNT]; + struct DaycareMail mail[DAYCARE_MON_COUNT]; u32 numDaycareMons; bool16 holdsItem[DAYCARE_MON_COUNT]; }; diff --git a/include/global.tv.h b/include/global.tv.h index 64e6a984e..2bc7dda99 100644 --- a/include/global.tv.h +++ b/include/global.tv.h @@ -1,13 +1,15 @@ #ifndef GUARD_GLOBAL_TV_H #define GUARD_GLOBAL_TV_H +#include "constants/tv.h" + typedef union // size = 0x24 { // Common struct { /*0x00*/ u8 kind; /*0x01*/ bool8 active; - /*0x02*/ u8 pad02[26]; + /*0x02*/ u8 data[26]; /*0x1C*/ u8 srcTrainerId3Lo; /*0x1D*/ u8 srcTrainerId3Hi; /*0x1E*/ u8 srcTrainerId2Lo; @@ -22,7 +24,7 @@ typedef union // size = 0x24 struct { /*0x00*/ u8 kind; /*0x01*/ bool8 active; - /*0x02*/ u8 pad02[34]; + /*0x02*/ u8 data[34]; } commonInit; // Local shows @@ -40,7 +42,7 @@ typedef union // size = 0x24 struct { /*0x00*/ u8 kind; /*0x01*/ bool8 active; - /*0x02*/ u16 var02; + /*0x02*/ u16 species; /*0x04*/ u16 words[6]; /*0x10*/ u8 playerName[PLAYER_NAME_LENGTH + 1]; /*0x18*/ u8 language; @@ -62,16 +64,16 @@ typedef union // size = 0x24 /*0x1C*/ u16 words[4]; } fanclubOpinions; - // TVSHOW_UNKN_SHOWTYPE_04 (dummied out) + // TVSHOW_DUMMY struct { /*0x00*/ u8 kind; /*0x01*/ bool8 active; /*0x02*/ u16 words[2]; - /*0x06*/ u16 var06; + /*0x06*/ u16 species; /*0x08*/ u8 pad_08[3]; - /*0x0b*/ u8 string_0b[12]; + /*0x0b*/ u8 name[12]; /*0x17*/ u8 language; - } unkShow04; + } dummy; // TVSHOW_NAME_RATER_SHOW struct { @@ -212,8 +214,8 @@ typedef union // size = 0x24 /*0x02*/ u8 priceReduced; /*0x03*/ u8 language; /*0x04*/ u8 pad04[2]; - /*0x06*/ u16 itemIds[3]; - /*0x0C*/ u16 itemAmounts[3]; + /*0x06*/ u16 itemIds[SMARTSHOPPER_NUM_ITEMS]; + /*0x0C*/ u16 itemAmounts[SMARTSHOPPER_NUM_ITEMS]; /*0x12*/ u8 shopLocation; /*0x13*/ u8 playerName[PLAYER_NAME_LENGTH + 1]; } smartshopperShow; @@ -401,7 +403,7 @@ typedef union // size = 0x24 /*0x08*/ u16 species3; /*0x0a*/ u16 species4; /*0x0c*/ u8 language; - /*0x0d*/ u8 facility; + /*0x0d*/ u8 facilityAndMode; /*0x0e*/ u8 filler_0e[5]; /*0x13*/ u8 playerName[PLAYER_NAME_LENGTH + 1]; } frontier; diff --git a/include/mauville_old_man.h b/include/mauville_old_man.h index 29c66a992..603d585da 100644 --- a/include/mauville_old_man.h +++ b/include/mauville_old_man.h @@ -7,7 +7,7 @@ void SetMauvilleOldMan(void); u8 GetCurrentMauvilleOldMan(void); void ScrSpecial_SetMauvilleOldManObjEventGfx(void); u8 sub_81201C8(void); -void sub_8120B70(OldMan *dest); +void SanitizeMauvilleOldManForRuby(OldMan *dest); void sub_8120670(void); void SanitizeReceivedRubyOldMan(union OldMan * oldMan, u32 r1, u32 r6); void SanitizeReceivedEmeraldOldMan(union OldMan * oldMan, u32 unused, u32 a2); diff --git a/include/tv.h b/include/tv.h index f94c5b7e5..30cd13326 100644 --- a/include/tv.h +++ b/include/tv.h @@ -1,13 +1,10 @@ #ifndef GUARD_TV_H #define GUARD_TV_H -#define SLOT_MACHINE 0 -#define ROULETTE 1 - extern u8 *const gTVStringVarPtrs[3]; void ClearTVShowData(void); -void sub_80EE184(void); +void TryPutBreakingNewsOnAir(void); void TryPutBattleSeminarOnAir(u16 foeSpecies, u16 species, u8 moveIdx, const u16 *movePtr, u16 betterMove); void TryPutFrontierTVShowOnAir(u16 winStreak, u8 facility); void DoTVShow(void); @@ -23,41 +20,37 @@ void ReceiveTvShowsData(void *src, u32 size, u8 masterIdx); void TryPutSpotTheCutiesOnAir(struct Pokemon *pokemon, u8 ribbonMonDataIdx); u32 GetPlayerIDAsU32(void); bool8 GetPriceReduction(u8 newsKind); -void sub_80F14F8(TVShow *shows); +void SanitizeTVShowLocationsForRuby(TVShow *shows); size_t CountDigits(int value); u8 GetRibbonCount(struct Pokemon *pokemon); void AlertTVThatPlayerPlayedSlotMachine(u16 nCoinsSpent); void AlertTVThatPlayerPlayedRoulette(u16 nCoinsSpent); -void AlertTVOfNewCoinTotal(u16 nCoinsPaidOut); +void TryPutFindThatGamerOnAir(u16 nCoinsPaidOut); void TryPutSecretBaseSecretsOnAir(void); void TryPutTodaysRivalTrainerOnAir(void); void TryPutTrendWatcherOnAir(const u16 *words); -void sub_80EDA80(void); void ReceivePokeNewsData(void *src, u32 size, u8 masterIdx); -void sub_80F0BB8(void); +void DeactivateAllNormalTVShows(void); void RecordFishingAttemptForTV(bool8 caughtFish); void IncrementDailySlotsUses(void); void IncrementDailyRouletteUses(void); void IncrementDailyWildBattles(void); void IncrementDailyBerryBlender(void); -void sub_80F1208(TVShow *shows); -void sub_80EE44C(u8 nMonsCaught, u8 nPkblkUsed); -void sub_80F14F8(TVShow *shows); -size_t sub_80EF370(int value); +void SanitizeTVShowsForRuby(TVShow *shows); +void TryPutSafariFanClubOnAir(u8 nMonsCaught, u8 nPkblkUsed); bool8 Put3CheersForPokeblocksOnTheAir(const u8 *partnersName, u8 flavor, u8 unused, u8 sheen, u8 language); void SetPokemonAnglerSpecies(u16 species); void UpdateTVShowsPerDay(u16 days); -void PutPokemonTodayCaughtOnAir(void); -void TV_PutSecretBaseVisitOnTheAir(void); +void TryPutPokemonTodayOnAir(void); +void TryPutSecretBaseVisitOnAir(void); void PutBattleUpdateOnTheAir(u8 opponentLinkPlayerId, u16 move, u16 speciesPlayer, u16 speciesOpponent); void BravoTrainerPokemonProfile_BeforeInterview1(u16 move); void InterviewBefore(void); void InterviewAfter(void); void UpdateTVScreensOnMap(int, int); -void TV_PrintIntToStringVar(u8 varIdx, int value); -void SaveRecordedItemPurchasesForTVShow(void); +void ConvertIntToDecimalString(u8 varIdx, int value); +void TryPutSmartShopperOnAir(void); bool8 ShouldAirFrontierTVShow(void); -void sub_80EE8C8(u16 winStreak, u8 facilityAndMode); void BravoTrainerPokemonProfile_BeforeInterview2(u8 contestStandingPlace); void ContestLiveUpdates_Init(u8 round1Placing); void ContestLiveUpdates_SetRound2Placing(u8 round2Placing); @@ -65,5 +58,8 @@ void ContestLiveUpdates_SetWinnerAppealFlag(u8 flag); void ContestLiveUpdates_SetWinnerMoveUsed(u16 move); void ContestLiveUpdates_SetLoserData(u8 flag, u8 loser); void ResetGabbyAndTy(void); +u8 CheckForPlayersHouseNews(void); +bool8 IsGabbyAndTyShowOnTheAir(void); +void TryPutTrainerFanClubOnAir(void); #endif //GUARD_TV_H -- cgit v1.2.3 From 4206359862da51e3cc3d6b36ab0a3280c1123b9e Mon Sep 17 00:00:00 2001 From: GriffinR Date: Tue, 4 May 2021 01:21:50 -0400 Subject: Fix some object lock names --- include/event_object_lock.h | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'include') diff --git a/include/event_object_lock.h b/include/event_object_lock.h index 9d31a25fd..0b1f5f098 100644 --- a/include/event_object_lock.h +++ b/include/event_object_lock.h @@ -2,9 +2,9 @@ #define GUARD_EVENT_OBJECT_LOCK_H bool8 IsFreezePlayerFinished(void); -void ScriptFreezeObjectEvents(void); bool8 IsFreezeSelectedObjectAndPlayerFinished(void); -void LockSelectedObjectEvent(void); +void FreezeObjects_WaitForPlayer(void); +void FreezeObjects_WaitForPlayerAndSelected(void); void FreezeForApproachingTrainers(void); bool8 IsFreezeObjectAndPlayerFinished(void); void ScriptUnfreezeObjectEvents(void); -- cgit v1.2.3 From 6ce27c0ff0f8d6b3addea73ef2c49584c510e60b Mon Sep 17 00:00:00 2001 From: GriffinR Date: Tue, 4 May 2021 15:43:24 -0400 Subject: Restore EReaderTrainerHillSet dummy --- include/ereader_helpers.h | 1 + 1 file changed, 1 insertion(+) (limited to 'include') diff --git a/include/ereader_helpers.h b/include/ereader_helpers.h index 937cfaca1..064b61ed7 100755 --- a/include/ereader_helpers.h +++ b/include/ereader_helpers.h @@ -15,6 +15,7 @@ struct EReaderTrainerHillSet { u8 numTrainers; u8 id; + u16 dummy; // Only read in an assert. u32 checksum; struct EReaderTrainerHillTrainer trainers[6]; u8 unk_ec0[40]; -- cgit v1.2.3 From a8fab62c89dcdfc662bcb49c8a1b538ebc70d4b9 Mon Sep 17 00:00:00 2001 From: Flametix <44883711+Flametix@users.noreply.github.com> Date: Thu, 6 May 2021 20:49:04 -0400 Subject: Fix Substitute typo --- include/constants/battle_string_ids.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'include') diff --git a/include/constants/battle_string_ids.h b/include/constants/battle_string_ids.h index f22541272..c8d37aac6 100644 --- a/include/constants/battle_string_ids.h +++ b/include/constants/battle_string_ids.h @@ -502,7 +502,7 @@ #define B_MSG_TRANSFORMED 0 #define B_MSG_TRANSFORM_FAILED 1 -// gSubsituteUsedStringIds +// gSubstituteUsedStringIds #define B_MSG_SET_SUBSTITUTE 0 #define B_MSG_SUBSTITUTE_FAILED 1 -- cgit v1.2.3 From 65fd3342562106c5a9ffa93f6b46a02c7ebe9ef5 Mon Sep 17 00:00:00 2001 From: GriffinR Date: Wed, 28 Apr 2021 16:06:27 -0400 Subject: Name map groups --- include/constants/map_groups.h | 68 +++++++++++++++++++++--------------------- 1 file changed, 34 insertions(+), 34 deletions(-) (limited to 'include') diff --git a/include/constants/map_groups.h b/include/constants/map_groups.h index c650600e8..eaf40a525 100755 --- a/include/constants/map_groups.h +++ b/include/constants/map_groups.h @@ -5,7 +5,7 @@ // DO NOT MODIFY THIS FILE! It is auto-generated from data/maps/map_groups.json // -// Map Group 0 +// gMapGroup_TownsAndRoutes #define MAP_PETALBURG_CITY (0 | (0 << 8)) #define MAP_SLATEPORT_CITY (1 | (0 << 8)) #define MAP_MAUVILLE_CITY (2 | (0 << 8)) @@ -64,21 +64,21 @@ #define MAP_UNDERWATER_ROUTE105 (55 | (0 << 8)) #define MAP_UNDERWATER_ROUTE125 (56 | (0 << 8)) -// Map Group 1 +// gMapGroup_IndoorLittleroot #define MAP_LITTLEROOT_TOWN_BRENDANS_HOUSE_1F (0 | (1 << 8)) #define MAP_LITTLEROOT_TOWN_BRENDANS_HOUSE_2F (1 | (1 << 8)) #define MAP_LITTLEROOT_TOWN_MAYS_HOUSE_1F (2 | (1 << 8)) #define MAP_LITTLEROOT_TOWN_MAYS_HOUSE_2F (3 | (1 << 8)) #define MAP_LITTLEROOT_TOWN_PROFESSOR_BIRCHS_LAB (4 | (1 << 8)) -// Map Group 2 +// gMapGroup_IndoorOldale #define MAP_OLDALE_TOWN_HOUSE1 (0 | (2 << 8)) #define MAP_OLDALE_TOWN_HOUSE2 (1 | (2 << 8)) #define MAP_OLDALE_TOWN_POKEMON_CENTER_1F (2 | (2 << 8)) #define MAP_OLDALE_TOWN_POKEMON_CENTER_2F (3 | (2 << 8)) #define MAP_OLDALE_TOWN_MART (4 | (2 << 8)) -// Map Group 3 +// gMapGroup_IndoorDewford #define MAP_DEWFORD_TOWN_HOUSE1 (0 | (3 << 8)) #define MAP_DEWFORD_TOWN_POKEMON_CENTER_1F (1 | (3 << 8)) #define MAP_DEWFORD_TOWN_POKEMON_CENTER_2F (2 | (3 << 8)) @@ -86,7 +86,7 @@ #define MAP_DEWFORD_TOWN_HALL (4 | (3 << 8)) #define MAP_DEWFORD_TOWN_HOUSE2 (5 | (3 << 8)) -// Map Group 4 +// gMapGroup_IndoorLavaridge #define MAP_LAVARIDGE_TOWN_HERB_SHOP (0 | (4 << 8)) #define MAP_LAVARIDGE_TOWN_GYM_1F (1 | (4 << 8)) #define MAP_LAVARIDGE_TOWN_GYM_B1F (2 | (4 << 8)) @@ -95,7 +95,7 @@ #define MAP_LAVARIDGE_TOWN_POKEMON_CENTER_1F (5 | (4 << 8)) #define MAP_LAVARIDGE_TOWN_POKEMON_CENTER_2F (6 | (4 << 8)) -// Map Group 5 +// gMapGroup_IndoorFallarbor #define MAP_FALLARBOR_TOWN_MART (0 | (5 << 8)) #define MAP_FALLARBOR_TOWN_BATTLE_TENT_LOBBY (1 | (5 << 8)) #define MAP_FALLARBOR_TOWN_BATTLE_TENT_CORRIDOR (2 | (5 << 8)) @@ -105,7 +105,7 @@ #define MAP_FALLARBOR_TOWN_COZMOS_HOUSE (6 | (5 << 8)) #define MAP_FALLARBOR_TOWN_MOVE_RELEARNERS_HOUSE (7 | (5 << 8)) -// Map Group 6 +// gMapGroup_IndoorVerdanturf #define MAP_VERDANTURF_TOWN_BATTLE_TENT_LOBBY (0 | (6 << 8)) #define MAP_VERDANTURF_TOWN_BATTLE_TENT_CORRIDOR (1 | (6 << 8)) #define MAP_VERDANTURF_TOWN_BATTLE_TENT_BATTLE_ROOM (2 | (6 << 8)) @@ -116,7 +116,7 @@ #define MAP_VERDANTURF_TOWN_FRIENDSHIP_RATERS_HOUSE (7 | (6 << 8)) #define MAP_VERDANTURF_TOWN_HOUSE (8 | (6 << 8)) -// Map Group 7 +// gMapGroup_IndoorPacifidlog #define MAP_PACIFIDLOG_TOWN_POKEMON_CENTER_1F (0 | (7 << 8)) #define MAP_PACIFIDLOG_TOWN_POKEMON_CENTER_2F (1 | (7 << 8)) #define MAP_PACIFIDLOG_TOWN_HOUSE1 (2 | (7 << 8)) @@ -125,7 +125,7 @@ #define MAP_PACIFIDLOG_TOWN_HOUSE4 (5 | (7 << 8)) #define MAP_PACIFIDLOG_TOWN_HOUSE5 (6 | (7 << 8)) -// Map Group 8 +// gMapGroup_IndoorPetalburg #define MAP_PETALBURG_CITY_WALLYS_HOUSE (0 | (8 << 8)) #define MAP_PETALBURG_CITY_GYM (1 | (8 << 8)) #define MAP_PETALBURG_CITY_HOUSE1 (2 | (8 << 8)) @@ -134,7 +134,7 @@ #define MAP_PETALBURG_CITY_POKEMON_CENTER_2F (5 | (8 << 8)) #define MAP_PETALBURG_CITY_MART (6 | (8 << 8)) -// Map Group 9 +// gMapGroup_IndoorSlateport #define MAP_SLATEPORT_CITY_STERNS_SHIPYARD_1F (0 | (9 << 8)) #define MAP_SLATEPORT_CITY_STERNS_SHIPYARD_2F (1 | (9 << 8)) #define MAP_SLATEPORT_CITY_BATTLE_TENT_LOBBY (2 | (9 << 8)) @@ -150,7 +150,7 @@ #define MAP_SLATEPORT_CITY_POKEMON_CENTER_2F (12 | (9 << 8)) #define MAP_SLATEPORT_CITY_MART (13 | (9 << 8)) -// Map Group 10 +// gMapGroup_IndoorMauville #define MAP_MAUVILLE_CITY_GYM (0 | (10 << 8)) #define MAP_MAUVILLE_CITY_BIKE_SHOP (1 | (10 << 8)) #define MAP_MAUVILLE_CITY_HOUSE1 (2 | (10 << 8)) @@ -160,7 +160,7 @@ #define MAP_MAUVILLE_CITY_POKEMON_CENTER_2F (6 | (10 << 8)) #define MAP_MAUVILLE_CITY_MART (7 | (10 << 8)) -// Map Group 11 +// gMapGroup_IndoorRustboro #define MAP_RUSTBORO_CITY_DEVON_CORP_1F (0 | (11 << 8)) #define MAP_RUSTBORO_CITY_DEVON_CORP_2F (1 | (11 << 8)) #define MAP_RUSTBORO_CITY_DEVON_CORP_3F (2 | (11 << 8)) @@ -179,7 +179,7 @@ #define MAP_RUSTBORO_CITY_FLAT2_3F (15 | (11 << 8)) #define MAP_RUSTBORO_CITY_HOUSE3 (16 | (11 << 8)) -// Map Group 12 +// gMapGroup_IndoorFortree #define MAP_FORTREE_CITY_HOUSE1 (0 | (12 << 8)) #define MAP_FORTREE_CITY_GYM (1 | (12 << 8)) #define MAP_FORTREE_CITY_POKEMON_CENTER_1F (2 | (12 << 8)) @@ -191,7 +191,7 @@ #define MAP_FORTREE_CITY_HOUSE5 (8 | (12 << 8)) #define MAP_FORTREE_CITY_DECORATION_SHOP (9 | (12 << 8)) -// Map Group 13 +// gMapGroup_IndoorLilycove #define MAP_LILYCOVE_CITY_COVE_LILY_MOTEL_1F (0 | (13 << 8)) #define MAP_LILYCOVE_CITY_COVE_LILY_MOTEL_2F (1 | (13 << 8)) #define MAP_LILYCOVE_CITY_LILYCOVE_MUSEUM_1F (2 | (13 << 8)) @@ -216,7 +216,7 @@ #define MAP_LILYCOVE_CITY_DEPARTMENT_STORE_ROOFTOP (21 | (13 << 8)) #define MAP_LILYCOVE_CITY_DEPARTMENT_STORE_ELEVATOR (22 | (13 << 8)) -// Map Group 14 +// gMapGroup_IndoorMossdeep #define MAP_MOSSDEEP_CITY_GYM (0 | (14 << 8)) #define MAP_MOSSDEEP_CITY_HOUSE1 (1 | (14 << 8)) #define MAP_MOSSDEEP_CITY_HOUSE2 (2 | (14 << 8)) @@ -231,7 +231,7 @@ #define MAP_MOSSDEEP_CITY_GAME_CORNER_1F (11 | (14 << 8)) #define MAP_MOSSDEEP_CITY_GAME_CORNER_B1F (12 | (14 << 8)) -// Map Group 15 +// gMapGroup_IndoorSootopolis #define MAP_SOOTOPOLIS_CITY_GYM_1F (0 | (15 << 8)) #define MAP_SOOTOPOLIS_CITY_GYM_B1F (1 | (15 << 8)) #define MAP_SOOTOPOLIS_CITY_POKEMON_CENTER_1F (2 | (15 << 8)) @@ -248,7 +248,7 @@ #define MAP_SOOTOPOLIS_CITY_MYSTERY_EVENTS_HOUSE_1F (13 | (15 << 8)) #define MAP_SOOTOPOLIS_CITY_MYSTERY_EVENTS_HOUSE_B1F (14 | (15 << 8)) -// Map Group 16 +// gMapGroup_IndoorEverGrande #define MAP_EVER_GRANDE_CITY_SIDNEYS_ROOM (0 | (16 << 8)) #define MAP_EVER_GRANDE_CITY_PHOEBES_ROOM (1 | (16 << 8)) #define MAP_EVER_GRANDE_CITY_GLACIAS_ROOM (2 | (16 << 8)) @@ -265,33 +265,33 @@ #define MAP_EVER_GRANDE_CITY_POKEMON_CENTER_2F (13 | (16 << 8)) #define MAP_EVER_GRANDE_CITY_POKEMON_LEAGUE_2F (14 | (16 << 8)) -// Map Group 17 +// gMapGroup_IndoorRoute104 #define MAP_ROUTE104_MR_BRINEYS_HOUSE (0 | (17 << 8)) #define MAP_ROUTE104_PRETTY_PETAL_FLOWER_SHOP (1 | (17 << 8)) -// Map Group 18 +// gMapGroup_IndoorRoute111 #define MAP_ROUTE111_WINSTRATE_FAMILYS_HOUSE (0 | (18 << 8)) #define MAP_ROUTE111_OLD_LADYS_REST_STOP (1 | (18 << 8)) -// Map Group 19 +// gMapGroup_IndoorRoute112 #define MAP_ROUTE112_CABLE_CAR_STATION (0 | (19 << 8)) #define MAP_MT_CHIMNEY_CABLE_CAR_STATION (1 | (19 << 8)) -// Map Group 20 +// gMapGroup_IndoorRoute114 #define MAP_ROUTE114_FOSSIL_MANIACS_HOUSE (0 | (20 << 8)) #define MAP_ROUTE114_FOSSIL_MANIACS_TUNNEL (1 | (20 << 8)) #define MAP_ROUTE114_LANETTES_HOUSE (2 | (20 << 8)) -// Map Group 21 +// gMapGroup_IndoorRoute116 #define MAP_ROUTE116_TUNNELERS_REST_HOUSE (0 | (21 << 8)) -// Map Group 22 +// gMapGroup_IndoorRoute117 #define MAP_ROUTE117_POKEMON_DAY_CARE (0 | (22 << 8)) -// Map Group 23 +// gMapGroup_IndoorRoute121 #define MAP_ROUTE121_SAFARI_ZONE_ENTRANCE (0 | (23 << 8)) -// Map Group 24 +// gMapGroup_Dungeons #define MAP_METEOR_FALLS_1F_1R (0 | (24 << 8)) #define MAP_METEOR_FALLS_1F_2R (1 | (24 << 8)) #define MAP_METEOR_FALLS_B1F_1R (2 | (24 << 8)) @@ -401,7 +401,7 @@ #define MAP_ALTERING_CAVE (106 | (24 << 8)) #define MAP_METEOR_FALLS_STEVENS_CAVE (107 | (24 << 8)) -// Map Group 25 +// gMapGroup_IndoorDynamic #define MAP_SECRET_BASE_RED_CAVE1 (0 | (25 << 8)) #define MAP_SECRET_BASE_BROWN_CAVE1 (1 | (25 << 8)) #define MAP_SECRET_BASE_BLUE_CAVE1 (2 | (25 << 8)) @@ -464,7 +464,7 @@ #define MAP_BATTLE_PYRAMID_SQUARE16 (59 | (25 << 8)) #define MAP_UNION_ROOM (60 | (25 << 8)) -// Map Group 26 +// gMapGroup_SpecialArea #define MAP_SAFARI_ZONE_NORTHWEST (0 | (26 << 8)) #define MAP_SAFARI_ZONE_NORTH (1 | (26 << 8)) #define MAP_SAFARI_ZONE_SOUTHWEST (2 | (26 << 8)) @@ -555,14 +555,14 @@ #define MAP_NAVEL_ROCK_BOTTOM (87 | (26 << 8)) #define MAP_TRAINER_HILL_ELEVATOR (88 | (26 << 8)) -// Map Group 27 +// gMapGroup_IndoorRoute104Prototype #define MAP_ROUTE104_PROTOTYPE (0 | (27 << 8)) #define MAP_ROUTE104_PROTOTYPE_PRETTY_PETAL_FLOWER_SHOP (1 | (27 << 8)) -// Map Group 28 +// gMapGroup_IndoorRoute109 #define MAP_ROUTE109_SEASHORE_HOUSE (0 | (28 << 8)) -// Map Group 29 +// gMapGroup_IndoorRoute110 #define MAP_ROUTE110_TRICK_HOUSE_ENTRANCE (0 | (29 << 8)) #define MAP_ROUTE110_TRICK_HOUSE_END (1 | (29 << 8)) #define MAP_ROUTE110_TRICK_HOUSE_CORRIDOR (2 | (29 << 8)) @@ -577,18 +577,18 @@ #define MAP_ROUTE110_SEASIDE_CYCLING_ROAD_NORTH_ENTRANCE (11 | (29 << 8)) #define MAP_ROUTE110_SEASIDE_CYCLING_ROAD_SOUTH_ENTRANCE (12 | (29 << 8)) -// Map Group 30 +// gMapGroup_IndoorRoute113 #define MAP_ROUTE113_GLASS_WORKSHOP (0 | (30 << 8)) -// Map Group 31 +// gMapGroup_IndoorRoute123 #define MAP_ROUTE123_BERRY_MASTERS_HOUSE (0 | (31 << 8)) -// Map Group 32 +// gMapGroup_IndoorRoute119 #define MAP_ROUTE119_WEATHER_INSTITUTE_1F (0 | (32 << 8)) #define MAP_ROUTE119_WEATHER_INSTITUTE_2F (1 | (32 << 8)) #define MAP_ROUTE119_HOUSE (2 | (32 << 8)) -// Map Group 33 +// gMapGroup_IndoorRoute124 #define MAP_ROUTE124_DIVING_TREASURE_HUNTERS_HOUSE (0 | (33 << 8)) #define MAP_GROUPS_COUNT 34 -- cgit v1.2.3 From 2be29cdb77afd5ffcb8ce70fbc9bef0c77db556a Mon Sep 17 00:00:00 2001 From: gAlfonso-bit <83477269+gAlfonso-bit@users.noreply.github.com> Date: Wed, 12 May 2021 17:00:42 -0400 Subject: Update IsPokemonCryPlaying --- include/gba/m4a_internal.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'include') diff --git a/include/gba/m4a_internal.h b/include/gba/m4a_internal.h index 2d0e1bb1c..2ccbb18f5 100644 --- a/include/gba/m4a_internal.h +++ b/include/gba/m4a_internal.h @@ -447,7 +447,7 @@ void SetPokemonCryPitch(s16 val); void SetPokemonCryLength(u16 val); void SetPokemonCryRelease(u8 val); void SetPokemonCryProgress(u32 val); -int IsPokemonCryPlaying(struct MusicPlayerInfo *mplayInfo); +bool32 IsPokemonCryPlaying(struct MusicPlayerInfo *mplayInfo); void SetPokemonCryChorus(s8 val); void SetPokemonCryStereo(u32 val); void SetPokemonCryPriority(u8 val); -- cgit v1.2.3 From 2bbaf71998337cba3c912143302f816b4116e851 Mon Sep 17 00:00:00 2001 From: Kurausukun Date: Mon, 31 May 2021 00:19:26 -0400 Subject: [LEAK-INFORMED] fix CreateShedinja fakematch info: the header change is required. accesses to the struct need to be treated as non-const, even though the array must be const. thanks to jiang for figuring this out. --- include/pokemon.h | 1 - 1 file changed, 1 deletion(-) (limited to 'include') diff --git a/include/pokemon.h b/include/pokemon.h index 82cdefeac..3565bd966 100644 --- a/include/pokemon.h +++ b/include/pokemon.h @@ -258,7 +258,6 @@ extern const u8 gFacilityClassToPicIndex[]; extern const u8 gFacilityClassToTrainerClass[]; extern const struct BaseStats gBaseStats[]; extern const u8 *const gItemEffectTable[]; -extern const struct Evolution gEvolutionTable[][EVOS_PER_MON]; extern const u32 gExperienceTables[][MAX_LEVEL + 1]; extern const u16 *const gLevelUpLearnsets[]; extern const u8 gPPUpGetMask[]; -- cgit v1.2.3 From 3ed06c2cc269c70c2d9a76bd4a063740de6688cd Mon Sep 17 00:00:00 2001 From: ExpoSeed <> Date: Thu, 10 Jun 2021 11:36:10 -0500 Subject: Remove remaining grey and replace with gray --- include/battle_anim.h | 2 +- include/strings.h | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) (limited to 'include') diff --git a/include/battle_anim.h b/include/battle_anim.h index 476480489..ad160e74d 100644 --- a/include/battle_anim.h +++ b/include/battle_anim.h @@ -143,7 +143,7 @@ void TranslateSpriteLinear(struct Sprite *sprite); void AnimSpriteOnMonPos(struct Sprite *sprite); void InitAnimLinearTranslationWithSpeedAndPos(struct Sprite *sprite); void TranslateSpriteInCircleOverDuration(struct Sprite *sprite); -void SetGreyscaleOrOriginalPalette(u16 palNum, bool8 restoreOriginal); +void SetGrayscaleOrOriginalPalette(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); diff --git a/include/strings.h b/include/strings.h index 04283db0e..9b3be0538 100644 --- a/include/strings.h +++ b/include/strings.h @@ -596,7 +596,7 @@ extern const u8 gText_TooImportantToToss[]; extern const u8 gText_ConfirmTossItems[]; extern const u8 gText_MoveVar1Where[]; -extern const u8 gText_ColorLightShadowDarkGrey[]; +extern const u8 gText_ColorLightShadowDarkGray[]; extern const u8 gText_ColorBlue[]; extern const u8 gText_Friend[]; extern const u8 gText_Tristan[]; @@ -2512,7 +2512,7 @@ extern const u8 gText_MatchCallMay_Intro1[]; extern const u8 gText_MatchCallMay_Intro2[]; // Contest Link -extern const u8 gText_ColorDarkGrey[]; +extern const u8 gText_ColorDarkGray[]; extern const u8 gText_CommunicationStandby[]; extern const u8 gText_AnnouncingResults[]; extern const u8 gText_PreliminaryResults[]; -- cgit v1.2.3 From b6b0062bd60eb57d66b6c79fc48bdbb55d8a5bf5 Mon Sep 17 00:00:00 2001 From: ExpoSeed <43502820+ExpoSeed@users.noreply.github.com> Date: Sun, 13 Jun 2021 16:32:00 -0500 Subject: Change map header flags to use a bitfield --- include/global.fieldmap.h | 16 ++++++---------- 1 file changed, 6 insertions(+), 10 deletions(-) (limited to 'include') diff --git a/include/global.fieldmap.h b/include/global.fieldmap.h index a3d99ee21..6bafa9747 100644 --- a/include/global.fieldmap.h +++ b/include/global.fieldmap.h @@ -142,19 +142,15 @@ struct MapHeader /* 0x16 */ u8 weather; /* 0x17 */ u8 mapType; /* 0x18 */ u8 filler_18[2]; - /* 0x1A */ u8 flags; + // fields correspond to the arguments in the map_header_flags macro + /* 0x1A */ bool8 allowCycling:1; + bool8 allowEscaping:1; // Escape Rope and Dig + bool8 allowRunning:1; + bool8 showMapName:5; // the last 4 bits are unused + // but the 5 bit sized bitfield is required to match /* 0x1B */ u8 battleType; }; -// Flags for gMapHeader.flags, as defined in the map_header_flags macro -#define MAP_ALLOW_CYCLING (1 << 0) -#define MAP_ALLOW_ESCAPING (1 << 1) // Escape Rope and Dig -#define MAP_ALLOW_RUNNING (1 << 2) -#define MAP_SHOW_MAP_NAME (1 << 3) -#define UNUSED_MAP_FLAGS (1 << 4 | 1 << 5 | 1 << 6 | 1 << 7) - -#define SHOW_MAP_NAME_ENABLED ((gMapHeader.flags & (MAP_SHOW_MAP_NAME | UNUSED_MAP_FLAGS)) == MAP_SHOW_MAP_NAME) - struct ObjectEvent { -- cgit v1.2.3 From 8b59909ac5eb6e3540aeb78396943d57a9702e4d Mon Sep 17 00:00:00 2001 From: Kurausukun Date: Thu, 17 Jun 2021 22:09:48 -0400 Subject: remove gflib --- include/bg.h | 85 ++++++++++ include/blit.h | 17 ++ include/dma3.h | 55 +++++++ include/gpu_regs.h | 19 +++ include/io_reg.h | 7 + include/malloc.h | 22 +++ include/sprite.h | 324 +++++++++++++++++++++++++++++++++++++ include/string_util.h | 46 ++++++ include/text.h | 436 ++++++++++++++++++++++++++++++++++++++++++++++++++ include/window.h | 80 +++++++++ 10 files changed, 1091 insertions(+) create mode 100644 include/bg.h create mode 100644 include/blit.h create mode 100644 include/dma3.h create mode 100644 include/gpu_regs.h create mode 100644 include/io_reg.h create mode 100644 include/malloc.h create mode 100644 include/sprite.h create mode 100644 include/string_util.h create mode 100644 include/text.h create mode 100644 include/window.h (limited to 'include') diff --git a/include/bg.h b/include/bg.h new file mode 100644 index 000000000..58fd1282c --- /dev/null +++ b/include/bg.h @@ -0,0 +1,85 @@ +#ifndef GUARD_BG_H +#define GUARD_BG_H + +struct BGCntrlBitfield // for the I/O registers +{ + volatile u16 priority:2; + volatile u16 charBaseBlock:2; + volatile u16 field_0_2:4; + volatile u16 field_1_0:5; + volatile u16 areaOverflowMode:1; + volatile u16 screenSize:2; +}; + +enum +{ + BG_ATTR_CHARBASEINDEX = 1, + BG_ATTR_MAPBASEINDEX, + BG_ATTR_SCREENSIZE, + BG_ATTR_PALETTEMODE, + BG_ATTR_MOSAIC, + BG_ATTR_WRAPAROUND, + BG_ATTR_PRIORITY, + BG_ATTR_METRIC, + BG_ATTR_TYPE, + BG_ATTR_BASETILE, +}; + +struct BgTemplate +{ + u16 bg:2; // 0x1, 0x2 -> 0x3 + u16 charBaseIndex:2; // 0x4, 0x8 -> 0xC + u16 mapBaseIndex:5; // 0x10, 0x20, 0x40, 0x80, 0x100 -> 0x1F0 + u16 screenSize:2; // 0x200, 0x400 -> 0x600 + u16 paletteMode:1; // 0x800 + u16 priority:2; // 0x1000, 0x2000 > 0x3000 + u16 baseTile:10; +}; + +void ResetBgs(void); +u8 GetBgMode(void); +void ResetBgControlStructs(void); +void Unused_ResetBgControlStruct(u8 bg); +u8 LoadBgVram(u8 bg, const void *src, u16 size, u16 destOffset, u8 mode); +void SetTextModeAndHideBgs(void); +bool8 IsInvalidBg(u8 bg); +int DummiedOutFireRedLeafGreenTileAllocFunc(int a1, int a2, int a3, int a4); +void ResetBgsAndClearDma3BusyFlags(u32 leftoverFireRedLeafGreenVariable); +void InitBgsFromTemplates(u8 bgMode, const struct BgTemplate *templates, u8 numTemplates); +void InitBgFromTemplate(const struct BgTemplate *template); +void SetBgMode(u8 bgMode); +u16 LoadBgTiles(u8 bg, const void* src, u16 size, u16 destOffset); +u16 LoadBgTilemap(u8 bg, const void *src, u16 size, u16 destOffset); +u16 Unused_LoadBgPalette(u8 bg, const void *src, u16 size, u16 destOffset); +bool8 IsDma3ManagerBusyWithBgCopy(void); +void ShowBg(u8 bg); +void HideBg(u8 bg); +void SetBgAttribute(u8 bg, u8 attributeId, u8 value); +u16 GetBgAttribute(u8 bg, u8 attributeId); +s32 ChangeBgX(u8 bg, s32 value, u8 op); +s32 GetBgX(u8 bg); +s32 ChangeBgY(u8 bg, s32 value, u8 op); +s32 ChangeBgY_ScreenOff(u8 bg, s32 value, u8 op); +s32 GetBgY(u8 bg); +void SetBgAffine(u8 bg, s32 srcCenterX, s32 srcCenterY, s16 dispCenterX, s16 dispCenterY, s16 scaleX, s16 scaleY, u16 rotationAngle); +u8 Unused_AdjustBgMosaic(u8 a1, u8 a2); +void SetBgTilemapBuffer(u8 bg, void *tilemap); +void UnsetBgTilemapBuffer(u8 bg); +void* GetBgTilemapBuffer(u8 bg); +void CopyToBgTilemapBuffer(u8 bg, const void *src, u16 mode, u16 destOffset); +void CopyBgTilemapBufferToVram(u8 bg); +void CopyToBgTilemapBufferRect(u8 bg, const void* src, u8 destX, u8 destY, u8 width, u8 height); +void CopyToBgTilemapBufferRect_ChangePalette(u8 bg, const void *src, u8 destX, u8 destY, u8 rectWidth, u8 rectHeight, u8 palette); +void CopyRectToBgTilemapBufferRect(u8 bg, const void *src, u8 srcX, u8 srcY, u8 srcWidth, u8 unused, u8 srcHeight, u8 destX, u8 destY, u8 rectWidth, u8 rectHeight, s16 palette1, s16 tileOffset); +void FillBgTilemapBufferRect_Palette0(u8 bg, u16 tileNum, u8 x, u8 y, u8 width, u8 height); +void FillBgTilemapBufferRect(u8 bg, u16 tileNum, u8 x, u8 y, u8 width, u8 height, u8 palette); +void WriteSequenceToBgTilemapBuffer(u8 bg, u16 firstTileNum, u8 x, u8 y, u8 width, u8 height, u8 paletteSlot, s16 tileNumDelta); +u16 GetBgMetricTextMode(u8 bg, u8 whichMetric); +u32 GetBgMetricAffineMode(u8 bg, u8 whichMetric); +u32 GetTileMapIndexFromCoords(s32 x, s32 y, s32 screenSize, u32 screenWidth, u32 screenHeight); +void CopyTileMapEntry(const u16 *src, u16 *dest, s32 palette1, s32 tileOffset, s32 palette2); +u32 GetBgType(u8 bg); +bool32 IsInvalidBg32(u8 bg); +bool32 IsTileMapOutsideWram(u8 bg); + +#endif // GUARD_BG_H diff --git a/include/blit.h b/include/blit.h new file mode 100644 index 000000000..78f67766e --- /dev/null +++ b/include/blit.h @@ -0,0 +1,17 @@ +#ifndef GUARD_BLIT_H +#define GUARD_BLIT_H + +struct Bitmap +{ + u8 *pixels; + u32 width:16; + u32 height:16; +}; + +void BlitBitmapRect4BitWithoutColorKey(const struct Bitmap *src, struct Bitmap *dst, u16 srcX, u16 srcY, u16 dstX, u16 dstY, u16 width, u16 height); +void BlitBitmapRect4Bit(const struct Bitmap *src, struct Bitmap *dst, u16 srcX, u16 srcY, u16 dstX, u16 dstY, u16 width, u16 height, u8 colorKey); +void FillBitmapRect4Bit(struct Bitmap *surface, u16 x, u16 y, u16 width, u16 height, u8 fillValue); +void BlitBitmapRect4BitTo8Bit(const struct Bitmap *src, struct Bitmap *dst, u16 srcX, u16 srcY, u16 dstX, u16 dstY, u16 width, u16 height, u8 colorKey, u8 paletteOffset); +void FillBitmapRect8Bit(struct Bitmap *surface, u16 x, u16 y, u16 width, u16 height, u8 fillValue); + +#endif // GUARD_BLIT_H diff --git a/include/dma3.h b/include/dma3.h new file mode 100644 index 000000000..8eff34f55 --- /dev/null +++ b/include/dma3.h @@ -0,0 +1,55 @@ +#ifndef GUARD_DMA3_H +#define GUARD_DMA3_H + +// Maximum amount of data we will transfer in one operation +#define MAX_DMA_BLOCK_SIZE 0x1000 + +#define Dma3CopyLarge_(src, dest, size, bit) \ +{ \ + const void *_src = src; \ + void *_dest = dest; \ + u32 _size = size; \ + while (1) \ + { \ + if (_size <= MAX_DMA_BLOCK_SIZE) \ + { \ + DmaCopy##bit(3, _src, _dest, _size); \ + break; \ + } \ + DmaCopy##bit(3, _src, _dest, MAX_DMA_BLOCK_SIZE); \ + _src += MAX_DMA_BLOCK_SIZE; \ + _dest += MAX_DMA_BLOCK_SIZE; \ + _size -= MAX_DMA_BLOCK_SIZE; \ + } \ +} + +#define Dma3CopyLarge16_(src, dest, size) Dma3CopyLarge_(src, dest, size, 16) +#define Dma3CopyLarge32_(src, dest, size) Dma3CopyLarge_(src, dest, size, 32) + +#define Dma3FillLarge_(value, dest, size, bit) \ +{ \ + void *_dest = dest; \ + u32 _size = size; \ + while (1) \ + { \ + if (_size <= MAX_DMA_BLOCK_SIZE) \ + { \ + DmaFill##bit(3, value, _dest, _size); \ + break; \ + } \ + DmaFill##bit(3, value, _dest, MAX_DMA_BLOCK_SIZE); \ + _dest += MAX_DMA_BLOCK_SIZE; \ + _size -= MAX_DMA_BLOCK_SIZE; \ + } \ +} + +#define Dma3FillLarge16_(value, dest, size) Dma3FillLarge_(value, dest, size, 16) +#define Dma3FillLarge32_(value, dest, size) Dma3FillLarge_(value, dest, size, 32) + +void ClearDma3Requests(void); +void ProcessDma3Requests(void); +s16 RequestDma3Copy(const void *src, void *dest, u16 size, u8 mode); +s16 RequestDma3Fill(s32 value, void *dest, u16 size, u8 mode); +s16 CheckForSpaceForDma3Request(s16 index); + +#endif // GUARD_DMA3_H diff --git a/include/gpu_regs.h b/include/gpu_regs.h new file mode 100644 index 000000000..89e0cb64b --- /dev/null +++ b/include/gpu_regs.h @@ -0,0 +1,19 @@ +#ifndef GUARD_GPU_REGS_H +#define GUARD_GPU_REGS_H + +// Exported type declarations + +// Exported RAM declarations + +// Exported ROM declarations +void InitGpuRegManager(void); +void CopyBufferedValuesToGpuRegs(void); +void SetGpuReg(u8 regOffset, u16 value); +void SetGpuReg_ForcedBlank(u8 regOffset, u16 value); +u16 GetGpuReg(u8 regOffset); +void SetGpuRegBits(u8 regOffset, u16 mask); +void ClearGpuRegBits(u8 regOffset, u16 mask); +void EnableInterrupts(u16 mask); +void DisableInterrupts(u16 mask); + +#endif //GUARD_GPU_REGS_H diff --git a/include/io_reg.h b/include/io_reg.h new file mode 100644 index 000000000..82d2fc5ed --- /dev/null +++ b/include/io_reg.h @@ -0,0 +1,7 @@ +#ifndef GUARD_IO_REG_H +#define GUARD_IO_REG_H + +extern const u16 gOverworldBackgroundLayerFlags[]; +extern const u16 gOrbEffectBackgroundLayerFlags[]; + +#endif // GUARD_IO_REG_H diff --git a/include/malloc.h b/include/malloc.h new file mode 100644 index 000000000..f2dcf6d46 --- /dev/null +++ b/include/malloc.h @@ -0,0 +1,22 @@ +#ifndef GUARD_ALLOC_H +#define GUARD_ALLOC_H + +#define HEAP_SIZE 0x1C000 +#define malloc Alloc +#define calloc(ct, sz) AllocZeroed((ct) * (sz)) +#define free Free + +#define FREE_AND_SET_NULL(ptr) \ +{ \ + free(ptr); \ + ptr = NULL; \ +} + +extern u8 gHeap[]; + +void *Alloc(u32 size); +void *AllocZeroed(u32 size); +void Free(void *pointer); +void InitHeap(void *pointer, u32 size); + +#endif // GUARD_ALLOC_H diff --git a/include/sprite.h b/include/sprite.h new file mode 100644 index 000000000..4a3b48225 --- /dev/null +++ b/include/sprite.h @@ -0,0 +1,324 @@ +#ifndef GUARD_SPRITE_H +#define GUARD_SPRITE_H + +#define MAX_SPRITES 64 +#define SPRITE_NONE 0xFF +#define SPRITE_INVALID_TAG 0xFFFF + +struct SpriteSheet +{ + const void *data; // Raw uncompressed pixel data + u16 size; + u16 tag; +}; + +struct CompressedSpriteSheet +{ + const u32 *data; // LZ77 compressed pixel data + u16 size; // Uncompressed size of pixel data + u16 tag; +}; + +struct SpriteFrameImage +{ + const void *data; + u16 size; +}; + +#define obj_frame_tiles(ptr) {.data = (u8 *)ptr, .size = sizeof ptr} + +#define overworld_frame(ptr, width, height, frame) {.data = (u8 *)ptr + (width * height * frame * 64)/2, .size = (width * height * 64)/2} + +struct SpritePalette +{ + const u16 *data; // Raw uncompressed palette data + u16 tag; +}; + +struct CompressedSpritePalette +{ + const u32 *data; // LZ77 compressed palette data + u16 tag; +}; + +struct AnimFrameCmd +{ + // If the sprite has an array of images, this is the array index. + // If the sprite has a sheet, this is the tile offset. + u32 imageValue:16; + + u32 duration:6; + u32 hFlip:1; + u32 vFlip:1; +}; + +struct AnimLoopCmd +{ + u32 type:16; + u32 count:6; +}; + +struct AnimJumpCmd +{ + u32 type:16; + u32 target:6; +}; + +// The first halfword of this union specifies the type of command. +// If it -2, then it is a jump command. If it is -1, then it is the end of the script. +// Otherwise, it is the imageValue for a frame command. +union AnimCmd +{ + s16 type; + struct AnimFrameCmd frame; + struct AnimLoopCmd loop; + struct AnimJumpCmd jump; +}; + +#define ANIMCMD_FRAME(...) \ + {.frame = {__VA_ARGS__}} +#define ANIMCMD_LOOP(_count) \ + {.loop = {.type = -3, .count = _count}} +#define ANIMCMD_JUMP(_target) \ + {.jump = {.type = -2, .target = _target}} +#define ANIMCMD_END \ + {.type = -1} + +struct AffineAnimFrameCmd +{ + s16 xScale; + s16 yScale; + u8 rotation; + u8 duration; +}; + +struct AffineAnimLoopCmd +{ + s16 type; + s16 count; +}; + +struct AffineAnimJumpCmd +{ + s16 type; + u16 target; +}; + +struct AffineAnimEndCmdAlt +{ + s16 type; + u16 val; +}; + +union AffineAnimCmd +{ + s16 type; + struct AffineAnimFrameCmd frame; + struct AffineAnimLoopCmd loop; + struct AffineAnimJumpCmd jump; + struct AffineAnimEndCmdAlt end; // unused in code +}; + +#define AFFINEANIMCMDTYPE_LOOP 0x7FFD +#define AFFINEANIMCMDTYPE_JUMP 0x7FFE +#define AFFINEANIMCMDTYPE_END 0x7FFF + +#define AFFINEANIMCMD_FRAME(_xScale, _yScale, _rotation, _duration) \ + {.frame = {.xScale = _xScale, .yScale = _yScale, .rotation = _rotation, .duration = _duration}} +#define AFFINEANIMCMD_LOOP(_count) \ + {.loop = {.type = AFFINEANIMCMDTYPE_LOOP, .count = _count}} +#define AFFINEANIMCMD_JUMP(_target) \ + {.jump = {.type = AFFINEANIMCMDTYPE_JUMP, .target = _target}} +#define AFFINEANIMCMD_END \ + {.type = AFFINEANIMCMDTYPE_END} +#define AFFINEANIMCMD_END_ALT(_val) \ + {.end = {.type = AFFINEANIMCMDTYPE_END, .val = _val}} + +struct AffineAnimState +{ + u8 animNum; + u8 animCmdIndex; + u8 delayCounter; + u8 loopCounter; + s16 xScale; + s16 yScale; + u16 rotation; +}; + +enum +{ + SUBSPRITES_OFF, + SUBSPRITES_ON, + SUBSPRITES_IGNORE_PRIORITY, // on but priority is ignored +}; + +struct Subsprite +{ + s8 x; // was u16 in R/S + s8 y; // was u16 in R/S + u16 shape:2; + u16 size:2; + u16 tileOffset:10; + u16 priority:2; +}; + +struct SubspriteTable +{ + u8 subspriteCount; + const struct Subsprite *subsprites; +}; + +struct Sprite; + +typedef void (*SpriteCallback)(struct Sprite *); + +struct SpriteTemplate +{ + u16 tileTag; + u16 paletteTag; + const struct OamData *oam; + const union AnimCmd *const *anims; + const struct SpriteFrameImage *images; + const union AffineAnimCmd *const *affineAnims; + SpriteCallback callback; +}; + +// UB: template pointer is often used to point to temporary storage, +// then later dereferenced after being freed. Usually this won't +// be visible in-game, but this is (part of) what causes the item +// icon palette to flicker when changing items in the bag. +struct Sprite +{ + /*0x00*/ struct OamData oam; + /*0x08*/ const union AnimCmd *const *anims; + /*0x0C*/ const struct SpriteFrameImage *images; + /*0x10*/ const union AffineAnimCmd *const *affineAnims; + /*0x14*/ const struct SpriteTemplate *template; + /*0x18*/ const struct SubspriteTable *subspriteTables; + /*0x1C*/ SpriteCallback callback; + + /*0x20*/ struct Coords16 pos1; + /*0x24*/ struct Coords16 pos2; + /*0x28*/ s8 centerToCornerVecX; + /*0x29*/ s8 centerToCornerVecY; + + /*0x2A*/ u8 animNum; + /*0x2B*/ u8 animCmdIndex; + /*0x2C*/ u8 animDelayCounter:6; + bool8 animPaused:1; + bool8 affineAnimPaused:1; + /*0x2D*/ u8 animLoopCounter; + + // general purpose data fields + /*0x2E*/ s16 data[8]; + + /*0x3E*/ bool16 inUse:1; //1 + bool16 coordOffsetEnabled:1; //2 + bool16 invisible:1; //4 + bool16 flags_3:1; //8 + bool16 flags_4:1; //0x10 + bool16 flags_5:1; //0x20 + bool16 flags_6:1; //0x40 + bool16 flags_7:1; //0x80 + /*0x3F*/ bool16 hFlip:1; //1 + bool16 vFlip:1; //2 + bool16 animBeginning:1; //4 + bool16 affineAnimBeginning:1; //8 + bool16 animEnded:1; //0x10 + bool16 affineAnimEnded:1; //0x20 + bool16 usingSheet:1; //0x40 + bool16 flags_f:1; //0x80 + + /*0x40*/ u16 sheetTileStart; + + /*0x42*/ u8 subspriteTableNum:6; + u8 subspriteMode:2; + + /*0x43*/ u8 subpriority; +}; + +struct OamMatrix +{ + s16 a; + s16 b; + s16 c; + s16 d; +}; + +extern const struct OamData gDummyOamData; +extern const union AnimCmd *const gDummySpriteAnimTable[]; +extern const union AffineAnimCmd *const gDummySpriteAffineAnimTable[]; +extern const struct SpriteTemplate gDummySpriteTemplate; + +extern u8 gReservedSpritePaletteCount; +extern struct Sprite gSprites[]; +extern u8 gOamLimit; +extern u16 gReservedSpriteTileCount; +extern s16 gSpriteCoordOffsetX; +extern s16 gSpriteCoordOffsetY; +extern struct OamMatrix gOamMatrices[]; +extern bool8 gAffineAnimsDisabled; + +void ResetSpriteData(void); +void AnimateSprites(void); +void BuildOamBuffer(void); +u8 CreateSprite(const struct SpriteTemplate *template, s16 x, s16 y, u8 subpriority); +u8 CreateSpriteAtEnd(const struct SpriteTemplate *template, s16 x, s16 y, u8 subpriority); +u8 CreateInvisibleSprite(void (*callback)(struct Sprite *)); +u8 CreateSpriteAndAnimate(const struct SpriteTemplate *template, s16 x, s16 y, u8 subpriority); +void DestroySprite(struct Sprite *sprite); +void ResetOamRange(u8 a, u8 b); +void LoadOam(void); +void SetOamMatrix(u8 matrixNum, u16 a, u16 b, u16 c, u16 d); +void CalcCenterToCornerVec(struct Sprite *sprite, u8 shape, u8 size, u8 affineMode); +void SpriteCallbackDummy(struct Sprite *sprite); +void ProcessSpriteCopyRequests(void); +void RequestSpriteCopy(const u8 *src, u8 *dest, u16 size); +void FreeSpriteTiles(struct Sprite *sprite); +void FreeSpritePalette(struct Sprite *sprite); +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); +void StartSpriteAffineAnim(struct Sprite *sprite, u8 animNum); +void StartSpriteAffineAnimIfDifferent(struct Sprite *sprite, u8 animNum); +void ChangeSpriteAffineAnim(struct Sprite *sprite, u8 animNum); +void ChangeSpriteAffineAnimIfDifferent(struct Sprite *sprite, u8 animNum); +void SetSpriteSheetFrameTileNum(struct Sprite *sprite); +u8 AllocOamMatrix(void); +void FreeOamMatrix(u8 matrixNum); +void InitSpriteAffineAnim(struct Sprite *sprite); +void SetOamMatrixRotationScaling(u8 matrixNum, s16 xScale, s16 yScale, u16 rotation); +u16 LoadSpriteSheet(const struct SpriteSheet *sheet); +void LoadSpriteSheets(const struct SpriteSheet *sheets); +u16 AllocTilesForSpriteSheet(struct SpriteSheet *sheet); +void AllocTilesForSpriteSheets(struct SpriteSheet *sheets); +void LoadTilesForSpriteSheet(const struct SpriteSheet *sheet); +void LoadTilesForSpriteSheets(struct SpriteSheet *sheets); +void FreeSpriteTilesByTag(u16 tag); +void FreeSpriteTileRanges(void); +u16 GetSpriteTileStartByTag(u16 tag); +u16 GetSpriteTileTagByTileStart(u16 start); +void RequestSpriteSheetCopy(const struct SpriteSheet *sheet); +u16 LoadSpriteSheetDeferred(const struct SpriteSheet *sheet); +void FreeAllSpritePalettes(void); +u8 LoadSpritePalette(const struct SpritePalette *palette); +void LoadSpritePalettes(const struct SpritePalette *palettes); +u8 AllocSpritePalette(u16 tag); +u8 IndexOfSpritePaletteTag(u16 tag); +u16 GetSpritePaletteTagByPaletteNum(u8 paletteNum); +void FreeSpritePaletteByTag(u16 tag); +void SetSubspriteTables(struct Sprite *sprite, const struct SubspriteTable *subspriteTables); +bool8 AddSpriteToOamBuffer(struct Sprite *object, u8 *oamIndex); +bool8 AddSubspritesToOamBuffer(struct Sprite *sprite, struct OamData *destOam, u8 *oamIndex); +void CopyToSprites(u8 *src); +void CopyFromSprites(u8 *dest); +u8 SpriteTileAllocBitmapOp(u16 bit, u8 op); +void ClearSpriteCopyRequests(void); +void ResetAffineAnimData(void); + +#endif //GUARD_SPRITE_H diff --git a/include/string_util.h b/include/string_util.h new file mode 100644 index 000000000..229193d52 --- /dev/null +++ b/include/string_util.h @@ -0,0 +1,46 @@ +#ifndef GUARD_STRING_UTIL_H +#define GUARD_STRING_UTIL_H + +extern u8 gStringVar1[0x100]; +extern u8 gStringVar2[0x100]; +extern u8 gStringVar3[0x100]; +extern u8 gStringVar4[0x3E8]; + +enum StringConvertMode +{ + STR_CONV_MODE_LEFT_ALIGN, + STR_CONV_MODE_RIGHT_ALIGN, + STR_CONV_MODE_LEADING_ZEROS +}; + +u8 *StringCopy10(u8 *dest, const u8 *src); +u8 *StringGetEnd10(u8 *str); +u8 *StringCopy7(u8 *dest, const u8 *src); +u8 *StringCopy(u8 *dest, const u8 *src); +u8 *StringAppend(u8 *dest, const u8 *src); +u8 *StringCopyN(u8 *dest, const u8 *src, u8 n); +u8 *StringAppendN(u8 *dest, const u8 *src, u8 n); +u16 StringLength(const u8 *str); +s32 StringCompare(const u8 *str1, const u8 *str2); +s32 StringCompareN(const u8 *str1, const u8 *str2, u32 n); +bool8 IsStringLengthAtLeast(const u8 *str, s32 n); +u8 *ConvertIntToDecimalStringN(u8 *dest, s32 value, enum StringConvertMode mode, u8 n); +u8 *ConvertUIntToDecimalStringN(u8 *dest, u32 value, enum StringConvertMode mode, u8 n); +u8 *ConvertIntToHexStringN(u8 *dest, s32 value, enum StringConvertMode mode, u8 n); +u8 *StringExpandPlaceholders(u8 *dest, const u8 *src); +u8 *StringBraille(u8 *dest, const u8 *src); +const u8 *GetExpandedPlaceholder(u32 id); +u8 *StringFill(u8 *dest, u8 c, u16 n); +u8 *StringCopyPadded(u8 *dest, const u8 *src, u8 c, u16 n); +u8 *StringFillWithTerminator(u8 *dest, u16 n); +u8 *StringCopyN_Multibyte(u8 *dest, u8 *src, u32 n); +u32 StringLength_Multibyte(const u8 *str); +u8 *WriteColorChangeControlCode(u8 *dest, u32 colorType, u8 color); +bool32 IsStringJapanese(u8 *str); +bool32 sub_800924C(u8 *str, s32 n); +u8 GetExtCtrlCodeLength(u8 code); +s32 StringCompareWithoutExtCtrlCodes(const u8 *str1, const u8 *str2); +void ConvertInternationalString(u8 *s, u8 language); +void StripExtCtrlCodes(u8 *str); + +#endif // GUARD_STRING_UTIL_H diff --git a/include/text.h b/include/text.h new file mode 100644 index 000000000..3edd0fc62 --- /dev/null +++ b/include/text.h @@ -0,0 +1,436 @@ +#ifndef GUARD_TEXT_H +#define GUARD_TEXT_H + +#define CHAR_SPACE 0x00 +#define CHAR_A_GRAVE 0x01 +#define CHAR_A_ACUTE 0x02 +#define CHAR_A_CIRCUMFLEX 0x03 +#define CHAR_C_CEDILLA 0x04 +#define CHAR_E_GRAVE 0x05 +#define CHAR_E_ACUTE 0x06 +#define CHAR_E_CIRCUMFLEX 0x07 +#define CHAR_E_DIAERESIS 0x08 +#define CHAR_I_GRAVE 0x09 +//#define CHAR_I_ACUTE 0x0A // Is 0x5A instead +#define CHAR_I_CIRCUMFLEX 0x0B +#define CHAR_I_DIAERESIS 0x0C +#define CHAR_O_GRAVE 0x0D +#define CHAR_O_ACUTE 0x0E +#define CHAR_O_CIRCUMFLEX 0x0F +#define CHAR_OE 0x10 +#define CHAR_U_GRAVE 0x11 +#define CHAR_U_ACUTE 0x12 +#define CHAR_U_CIRCUMFLEX 0x13 +#define CHAR_N_TILDE 0x14 +#define CHAR_ESZETT 0x15 +#define CHAR_a_GRAVE 0x16 +#define CHAR_a_ACUTE 0x17 +//#define CHAR_a_CIRCUMFLEX 0x18 // Is 0x68 instead +#define CHAR_c_CEDILLA 0x19 +#define CHAR_e_GRAVE 0x1A +#define CHAR_e_ACUTE 0x1B +#define CHAR_e_CIRCUMFLEX 0x1C +#define CHAR_e_DIAERESIS 0x1D +#define CHAR_i_GRAVE 0x1E +//#define CHAR_i_ACUTE 0x1F // Is 0x6F instead +#define CHAR_i_CIRCUMFLEX 0x20 +#define CHAR_i_DIAERESIS 0x21 +#define CHAR_o_GRAVE 0x22 +#define CHAR_o_ACUTE 0x23 +#define CHAR_o_CIRCUMFLEX 0x24 +#define CHAR_oe 0x25 +#define CHAR_u_GRAVE 0x26 +#define CHAR_u_ACUTE 0x27 +#define CHAR_u_CIRCUMFLEX 0x28 +#define CHAR_n_TILDE 0x29 +#define CHAR_MASCULINE_ORDINAL 0x2A +#define CHAR_FEMININE_ORDINAL 0x2B +#define CHAR_SUPER_ER 0x2C +#define CHAR_AMPERSAND 0x2D +#define CHAR_PLUS 0x2E +// +#define CHAR_LV 0x34 +#define CHAR_EQUALS 0x35 +#define CHAR_SEMICOLON 0x36 +// +#define CHAR_INV_QUESTION_MARK 0x51 +#define CHAR_INV_EXCL_MARK 0x52 +#define CHAR_PK 0x53 +#define CHAR_MN 0x54 +#define CHAR_PO 0x55 +#define CHAR_KE 0x56 +#define CHAR_BLOCK_1 0x57 // Each of these 3 +#define CHAR_BLOCK_2 0x58 // chars contains 1/3 +#define CHAR_BLOCK_3 0x59 // of the word BLOCK +#define CHAR_I_ACUTE 0x5A +#define CHAR_PERCENT 0x5B +#define CHAR_LEFT_PAREN 0x5C +#define CHAR_RIGHT_PAREN 0x5D +// +#define CHAR_a_CIRCUMFLEX 0x68 +// +#define CHAR_i_ACUTE 0x6F +// +#define CHAR_GENDERLESS 0x77 // Empty space for lack of gender icon +// +#define CHAR_UP_ARROW 0x79 +#define CHAR_DOWN_ARROW 0x7A +#define CHAR_LEFT_ARROW 0x7B +#define CHAR_RIGHT_ARROW 0x7C +// +#define CHAR_SUPER_E 0x84 +#define CHAR_LESS_THAN 0x85 +#define CHAR_GREATER_THAN 0x86 +// +#define CHAR_SUPER_RE 0xA0 +#define CHAR_0 0xA1 +#define CHAR_1 0xA2 +#define CHAR_2 0xA3 +#define CHAR_3 0xA4 +#define CHAR_4 0xA5 +#define CHAR_5 0xA6 +#define CHAR_6 0xA7 +#define CHAR_7 0xA8 +#define CHAR_8 0xA9 +#define CHAR_9 0xAA +#define CHAR_EXCL_MARK 0xAB +#define CHAR_QUESTION_MARK 0xAC +#define CHAR_PERIOD 0xAD +#define CHAR_HYPHEN 0xAE +#define CHAR_BULLET 0xAF +#define CHAR_ELLIPSIS 0xB0 +#define CHAR_DBL_QUOT_LEFT 0xB1 +#define CHAR_DBL_QUOT_RIGHT 0xB2 +#define CHAR_SGL_QUOT_LEFT 0xB3 +#define CHAR_SGL_QUOT_RIGHT 0xB4 +#define CHAR_MALE 0xB5 +#define CHAR_FEMALE 0xB6 +#define CHAR_CURRENCY 0xB7 +#define CHAR_COMMA 0xB8 +#define CHAR_MULT_SIGN 0xB9 +#define CHAR_SLASH 0xBA +#define CHAR_A 0xBB +#define CHAR_B 0xBC +#define CHAR_C 0xBD +#define CHAR_D 0xBE +#define CHAR_E 0xBF +#define CHAR_F 0xC0 +#define CHAR_G 0xC1 +#define CHAR_H 0xC2 +#define CHAR_I 0xC3 +#define CHAR_J 0xC4 +#define CHAR_K 0xC5 +#define CHAR_L 0xC6 +#define CHAR_M 0xC7 +#define CHAR_N 0xC8 +#define CHAR_O 0xC9 +#define CHAR_P 0xCA +#define CHAR_Q 0xCB +#define CHAR_R 0xCC +#define CHAR_S 0xCD +#define CHAR_T 0xCE +#define CHAR_U 0xCF +#define CHAR_V 0xD0 +#define CHAR_W 0xD1 +#define CHAR_X 0xD2 +#define CHAR_Y 0xD3 +#define CHAR_Z 0xD4 +#define CHAR_a 0xD5 +#define CHAR_b 0xD6 +#define CHAR_c 0xD7 +#define CHAR_d 0xD8 +#define CHAR_e 0xD9 +#define CHAR_f 0xDA +#define CHAR_g 0xDB +#define CHAR_h 0xDC +#define CHAR_i 0xDD +#define CHAR_j 0xDE +#define CHAR_k 0xDF +#define CHAR_l 0xE0 +#define CHAR_m 0xE1 +#define CHAR_n 0xE2 +#define CHAR_o 0xE3 +#define CHAR_p 0xE4 +#define CHAR_q 0xE5 +#define CHAR_r 0xE6 +#define CHAR_s 0xE7 +#define CHAR_t 0xE8 +#define CHAR_u 0xE9 +#define CHAR_v 0xEA +#define CHAR_w 0xEB +#define CHAR_x 0xEC +#define CHAR_y 0xED +#define CHAR_z 0xEE +#define CHAR_BLACK_TRIANGLE 0xEF +#define CHAR_COLON 0xF0 +#define CHAR_A_DIAERESIS 0xF1 +#define CHAR_O_DIAERESIS 0xF2 +#define CHAR_U_DIAERESIS 0xF3 +#define CHAR_a_DIAERESIS 0xF4 +#define CHAR_o_DIAERESIS 0xF5 +#define CHAR_u_DIAERESIS 0xF6 +#define CHAR_DYNAMIC 0xF7 +#define CHAR_KEYPAD_ICON 0xF8 +#define CHAR_EXTRA_SYMBOL 0xF9 +#define CHAR_PROMPT_SCROLL 0xFA // waits for button press and scrolls dialog +#define CHAR_PROMPT_CLEAR 0xFB // waits for button press and clears dialog +#define EXT_CTRL_CODE_BEGIN 0xFC // extended control code +#define PLACEHOLDER_BEGIN 0xFD // string placeholder +#define CHAR_NEWLINE 0xFE +#define EOS 0xFF // end of string + +// CHAR_KEYPAD_ICON chars +#define CHAR_A_BUTTON 0x00 +#define CHAR_B_BUTTON 0x01 +#define CHAR_L_BUTTON 0x02 +#define CHAR_R_BUTTON 0x03 +#define CHAR_START_BUTTON 0x04 +#define CHAR_SELECT_BUTTON 0x05 +#define CHAR_DPAD_UP 0x06 +#define CHAR_DPAD_DOWN 0x07 +#define CHAR_DPAD_LEFT 0x08 +#define CHAR_DPAD_RIGHT 0x09 +#define CHAR_DPAD_UPDOWN 0x0A +#define CHAR_DPAD_LEFTRIGHT 0x0B +#define CHAR_DPAD_NONE 0x0C + +// CHAR_EXTRA_SYMBOL chars +#define CHAR_UP_ARROW_2 0x00 +#define CHAR_DOWN_ARROW_2 0x01 +#define CHAR_LEFT_ARROW_2 0x02 +#define CHAR_RIGHT_ARROW_2 0x03 +#define CHAR_PLUS_2 0x04 +#define CHAR_LV_2 0x05 +#define CHAR_PP 0x06 +#define CHAR_ID 0x07 +#define CHAR_NO 0x08 +#define CHAR_UNDERSCORE 0x09 + +#define EXT_CTRL_CODE_COLOR 0x01 +#define EXT_CTRL_CODE_HIGHLIGHT 0x02 +#define EXT_CTRL_CODE_SHADOW 0x03 +#define EXT_CTRL_CODE_COLOR_HIGHLIGHT_SHADOW 0x04 +#define EXT_CTRL_CODE_PALETTE 0x05 +#define EXT_CTRL_CODE_SIZE 0x06 +#define EXT_CTRL_CODE_RESET_SIZE 0x07 +#define EXT_CTRL_CODE_PAUSE 0x08 +#define EXT_CTRL_CODE_PAUSE_UNTIL_PRESS 0x09 +#define EXT_CTRL_CODE_WAIT_SE 0x0A +#define EXT_CTRL_CODE_PLAY_BGM 0x0B +#define EXT_CTRL_CODE_ESCAPE 0x0C +#define EXT_CTRL_CODE_SHIFT_TEXT 0x0D +#define EXT_CTRL_CODE_SHIFT_DOWN 0x0E +#define EXT_CTRL_CODE_FILL_WINDOW 0x0F +#define EXT_CTRL_CODE_PLAY_SE 0x10 +#define EXT_CTRL_CODE_CLEAR 0x11 +#define EXT_CTRL_CODE_SKIP 0x12 +#define EXT_CTRL_CODE_CLEAR_TO 0x13 +#define EXT_CTRL_CODE_MIN_LETTER_SPACING 0x14 +#define EXT_CTRL_CODE_JPN 0x15 +#define EXT_CTRL_CODE_ENG 0x16 +#define EXT_CTRL_CODE_PAUSE_MUSIC 0x17 +#define EXT_CTRL_CODE_RESUME_MUSIC 0x18 + +#define TEXT_COLOR_TRANSPARENT 0x0 +#define TEXT_COLOR_WHITE 0x1 +#define TEXT_COLOR_DARK_GRAY 0x2 +#define TEXT_COLOR_LIGHT_GRAY 0x3 +#define TEXT_COLOR_RED 0x4 +#define TEXT_COLOR_LIGHT_RED 0x5 +#define TEXT_COLOR_GREEN 0x6 +#define TEXT_COLOR_LIGHT_GREEN 0x7 +#define TEXT_COLOR_BLUE 0x8 +#define TEXT_COLOR_LIGHT_BLUE 0x9 +#define TEXT_DYNAMIC_COLOR_1 0xA // Usually white +#define TEXT_DYNAMIC_COLOR_2 0xB // Usually white w/ tinge of green +#define TEXT_DYNAMIC_COLOR_3 0xC // Usually white +#define TEXT_DYNAMIC_COLOR_4 0xD // Usually aquamarine +#define TEXT_DYNAMIC_COLOR_5 0xE // Usually blue-green +#define TEXT_DYNAMIC_COLOR_6 0xF // Usually cerulean + +#define PLACEHOLDER_ID_UNKNOWN 0x0 +#define PLACEHOLDER_ID_PLAYER 0x1 +#define PLACEHOLDER_ID_STRING_VAR_1 0x2 +#define PLACEHOLDER_ID_STRING_VAR_2 0x3 +#define PLACEHOLDER_ID_STRING_VAR_3 0x4 +#define PLACEHOLDER_ID_KUN 0x5 +#define PLACEHOLDER_ID_RIVAL 0x6 +#define PLACEHOLDER_ID_VERSION 0x7 +#define PLACEHOLDER_ID_AQUA 0x8 +#define PLACEHOLDER_ID_MAGMA 0x9 +#define PLACEHOLDER_ID_ARCHIE 0xA +#define PLACEHOLDER_ID_MAXIE 0xB +#define PLACEHOLDER_ID_KYOGRE 0xC +#define PLACEHOLDER_ID_GROUDON 0xD + +// battle placeholders are located in battle_message.h + +#define NUM_TEXT_PRINTERS 32 + +#define TEXT_SPEED_FF 0xFF + +enum +{ + FONTATTR_MAX_LETTER_WIDTH, + FONTATTR_MAX_LETTER_HEIGHT, + FONTATTR_LETTER_SPACING, + FONTATTR_LINE_SPACING, + FONTATTR_UNKNOWN, // dunno what this is yet + FONTATTR_COLOR_FOREGROUND, + FONTATTR_COLOR_BACKGROUND, + FONTATTR_COLOR_SHADOW +}; + +struct TextPrinterSubStruct +{ + u8 glyphId:4; // 0x14 + bool8 hasPrintBeenSpedUp:1; + u8 unk:3; + u8 downArrowDelay:5; + u8 downArrowYPosIdx:2; + bool8 hasGlyphIdBeenSet:1; + u8 autoScrollDelay; +}; + +struct TextPrinterTemplate +{ + const u8* currentChar; + u8 windowId; + u8 fontId; + u8 x; + u8 y; + u8 currentX; // 0x8 + u8 currentY; + u8 letterSpacing; + u8 lineSpacing; + u8 unk:4; // 0xC + u8 fgColor:4; + u8 bgColor:4; + u8 shadowColor:4; +}; + +struct TextPrinter +{ + struct TextPrinterTemplate printerTemplate; + + void (*callback)(struct TextPrinterTemplate *, u16); // 0x10 + + u8 subStructFields[7]; // always cast to struct TextPrinterSubStruct... so why bother + u8 active; + u8 state; // 0x1C + u8 textSpeed; + u8 delayCounter; + u8 scrollDistance; + u8 minLetterSpacing; // 0x20 + u8 japanese; +}; + +struct FontInfo +{ + u16 (*fontFunction)(struct TextPrinter *x); + u8 maxLetterWidth; + u8 maxLetterHeight; + u8 letterSpacing; + u8 lineSpacing; + u8 unk:4; + u8 fgColor:4; + u8 bgColor:4; + u8 shadowColor:4; +}; + +extern const struct FontInfo *gFonts; + +struct GlyphWidthFunc +{ + u32 fontId; + u32 (*func)(u16 glyphId, bool32 isJapanese); +}; + +struct KeypadIcon +{ + u16 tileOffset; + u8 width; + u8 height; +}; + +typedef struct { + bool8 canABSpeedUpPrint:1; + bool8 useAlternateDownArrow:1; + bool8 autoScroll:1; + bool8 forceMidTextSpeed:1; +} TextFlags; + +struct TextGlyph +{ + u32 gfxBufferTop[16]; + u32 gfxBufferBottom[16]; + u8 width; + u8 height; +}; + +extern TextFlags gTextFlags; + +extern u8 gDisableTextPrinters; +extern struct TextGlyph gCurGlyph; + +void SetFontsPointer(const struct FontInfo *fonts); +void DeactivateAllTextPrinters(void); +u16 AddTextPrinterParameterized(u8 windowId, u8 fontId, const u8 *str, u8 x, u8 y, u8 speed, void (*callback)(struct TextPrinterTemplate *, u16)); +bool16 AddTextPrinter(struct TextPrinterTemplate *template, u8 speed, void (*callback)(struct TextPrinterTemplate *, u16)); +void RunTextPrinters(void); +bool16 IsTextPrinterActive(u8 id); +u32 RenderFont(struct TextPrinter *textPrinter); +void GenerateFontHalfRowLookupTable(u8 fgColor, u8 bgColor, u8 shadowColor); +void SaveTextColors(u8 *fgColor, u8 *bgColor, u8 *shadowColor); +void RestoreTextColors(u8 *fgColor, u8 *bgColor, u8 *shadowColor); +void DecompressGlyphTile(const void *src_, void *dest_); +u8 GetLastTextColor(u8 colorType); +void CopyGlyphToWindow(struct TextPrinter *x); +void ClearTextSpan(struct TextPrinter *textPrinter, u32 width); +u8 GetMenuCursorDimensionByFont(u8, u8); + +u16 Font0Func(struct TextPrinter *textPrinter); +u16 Font1Func(struct TextPrinter *textPrinter); +u16 Font2Func(struct TextPrinter *textPrinter); +u16 Font3Func(struct TextPrinter *textPrinter); +u16 Font4Func(struct TextPrinter *textPrinter); +u16 Font5Func(struct TextPrinter *textPrinter); +u16 Font7Func(struct TextPrinter *textPrinter); +u16 Font8Func(struct TextPrinter *textPrinter); + +void TextPrinterInitDownArrowCounters(struct TextPrinter *textPrinter); +void TextPrinterDrawDownArrow(struct TextPrinter *textPrinter); +void TextPrinterClearDownArrow(struct TextPrinter *textPrinter); +bool8 TextPrinterWaitAutoMode(struct TextPrinter *textPrinter); +bool16 TextPrinterWaitWithDownArrow(struct TextPrinter *textPrinter); +bool16 TextPrinterWait(struct TextPrinter *textPrinter); +void DrawDownArrow(u8 windowId, u16 x, u16 y, u8 bgColor, bool8 drawArrow, u8 *counter, u8 *yCoordIndex); +u16 RenderText(struct TextPrinter *textPrinter); +u32 GetStringWidthFixedWidthFont(const u8 *str, u8 fontId, u8 letterSpacing); +u32 (*GetFontWidthFunc(u8 glyphId))(u16, bool32); +s32 GetStringWidth(u8 fontId, const u8 *str, s16 letterSpacing); +u8 RenderTextFont9(u8 *pixels, u8 fontId, u8 *str); +u8 DrawKeypadIcon(u8 windowId, u8 keypadIconId, u16 x, u16 y); +u8 GetKeypadIconTileOffset(u8 keypadIconId); +u8 GetKeypadIconWidth(u8 keypadIconId); +u8 GetKeypadIconHeight(u8 keypadIconId); +void SetDefaultFontsPointer(void); +u8 GetFontAttribute(u8 fontId, u8 attributeId); +u8 GetMenuCursorDimensionByFont(u8 fontId, u8 whichDimension); +void DecompressGlyphFont0(u16 glyphId, bool32 isJapanese); +u32 GetGlyphWidthFont0(u16 glyphId, bool32 isJapanese); +void DecompressGlyphFont7(u16 glyphId, bool32 isJapanese); +u32 GetGlyphWidthFont7(u16 glyphId, bool32 isJapanese); +void DecompressGlyphFont8(u16 glyphId, bool32 isJapanese); +u32 GetGlyphWidthFont8(u16 glyphId, bool32 isJapanese); +void DecompressGlyphFont2(u16 glyphId, bool32 isJapanese); +u32 GetGlyphWidthFont2(u16 glyphId, bool32 isJapanese); +void DecompressGlyphFont1(u16 glyphId, bool32 isJapanese); +u32 GetGlyphWidthFont1(u16 glyphId, bool32 isJapanese); +void DecompressGlyphFont9(u16 glyphId); + +// unk_text_util_2.c +u16 Font6Func(struct TextPrinter *textPrinter); +u32 GetGlyphWidthFont6(u16 glyphId, bool32 isJapanese); + +#endif // GUARD_TEXT_H diff --git a/include/window.h b/include/window.h new file mode 100644 index 000000000..3eac75a28 --- /dev/null +++ b/include/window.h @@ -0,0 +1,80 @@ +#ifndef GUARD_WINDOW_H +#define GUARD_WINDOW_H + +#define PIXEL_FILL(num) ((num) | ((num) << 4)) + +enum +{ + WINDOW_BG, + WINDOW_TILEMAP_LEFT, + WINDOW_TILEMAP_TOP, + WINDOW_WIDTH, + WINDOW_HEIGHT, + WINDOW_PALETTE_NUM, + WINDOW_BASE_BLOCK, + WINDOW_TILE_DATA +}; + +struct WindowTemplate +{ + u8 bg; + u8 tilemapLeft; + u8 tilemapTop; + u8 width; + u8 height; + u8 paletteNum; + u16 baseBlock; +}; + +#define DUMMY_WIN_TEMPLATE \ +{ \ + 0xFF, \ + 0, \ + 0, \ + 0, \ + 0, \ + 0, \ + 0, \ +} + +#define WINDOW_NONE 0xFF + +struct Window +{ + struct WindowTemplate window; + u8 *tileData; +}; + +bool16 InitWindows(const struct WindowTemplate *templates); +u16 AddWindow(const struct WindowTemplate *template); +int AddWindowWithoutTileMap(const struct WindowTemplate *template); +void RemoveWindow(u8 windowId); +void FreeAllWindowBuffers(void); +void CopyWindowToVram(u8 windowId, u8 mode); +void CopyWindowRectToVram(u32 windowId, u32 mode, u32 x, u32 y, u32 w, u32 h); +void PutWindowTilemap(u8 windowId); +void PutWindowRectTilemapOverridePalette(u8 windowId, u8 x, u8 y, u8 width, u8 height, u8 palette); +void ClearWindowTilemap(u8 windowId); +void PutWindowRectTilemap(u8 windowId, u8 x, u8 y, u8 width, u8 height); +void BlitBitmapToWindow(u8 windowId, const u8 *pixels, u16 x, u16 y, u16 width, u16 height); +void BlitBitmapRectToWindow(u8 windowId, const u8 *pixels, u16 srcX, u16 srcY, u16 srcWidth, int srcHeight, u16 destX, u16 destY, u16 rectWidth, u16 rectHeight); +void FillWindowPixelRect(u8 windowId, u8 fillValue, u16 x, u16 y, u16 width, u16 height); +void CopyToWindowPixelBuffer(u8 windowId, const void *src, u16 size, u16 tileOffset); +void FillWindowPixelBuffer(u8 windowId, u8 fillValue); +void ScrollWindow(u8 windowId, u8 direction, u8 distance, u8 fillValue); +void CallWindowFunction(u8 windowId, void ( *func)(u8, u8, u8, u8, u8, u8)); +bool8 SetWindowAttribute(u8 windowId, u8 attributeId, u32 value); +u32 GetWindowAttribute(u8 windowId, u8 attributeId); +u16 AddWindow8Bit(const struct WindowTemplate *template); +void FillWindowPixelBuffer8Bit(u8 windowId, u8 fillValue); +void FillWindowPixelRect8Bit(u8 windowId, u8 fillValue, u16 x, u16 y, u16 width, u16 height); +void BlitBitmapRectToWindow4BitTo8Bit(u8 windowId, const u8 *pixels, u16 srcX, u16 srcY, u16 srcWidth, int srcHeight, u16 destX, u16 destY, u16 rectWidth, u16 rectHeight, u8 paletteNum); +void CopyWindowToVram8Bit(u8 windowId, u8 mode); + +extern struct Window gWindows[]; +extern void* gWindowBgTilemapBuffers[]; +extern u32 gUnusedWindowVar1; +extern u32 gUnusedWindowVar2; +extern u32 gUnusedWindowVar3; + +#endif // GUARD_WINDOW_H -- cgit v1.2.3 From 10c80230c4b24074a8a9e46661db91fa8d465780 Mon Sep 17 00:00:00 2001 From: Kurausukun Date: Fri, 18 Jun 2021 00:15:45 -0400 Subject: change printItemFunc to use u32 instead of s32 also change a use of -2 to LIST_CANCEL --- include/list_menu.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'include') diff --git a/include/list_menu.h b/include/list_menu.h index 0a54a069a..1c18f3dff 100644 --- a/include/list_menu.h +++ b/include/list_menu.h @@ -31,7 +31,7 @@ struct ListMenuTemplate { const struct ListMenuItem *items; void (* moveCursorFunc)(s32 itemIndex, bool8 onInit, struct ListMenu *list); - void (* itemPrintFunc)(u8 windowId, s32 itemId, u8 y); + void (* itemPrintFunc)(u8 windowId, u32 itemId, u8 y); u16 totalItems; u16 maxShowed; u8 windowId; -- cgit v1.2.3 From 810b51f96c9f2043a726b782a4884a06430192f2 Mon Sep 17 00:00:00 2001 From: GriffinR Date: Mon, 21 Jun 2021 13:48:03 -0400 Subject: Clarify contest heart tiles --- include/constants/contest.h | 1 + 1 file changed, 1 insertion(+) (limited to 'include') diff --git a/include/constants/contest.h b/include/constants/contest.h index 28b02e9c0..775dcbe62 100644 --- a/include/constants/contest.h +++ b/include/constants/contest.h @@ -4,6 +4,7 @@ #define APPLAUSE_METER_SIZE 5 #define CONTEST_NUM_APPEALS 5 #define CONTEST_LAST_APPEAL (CONTEST_NUM_APPEALS - 1) +#define MAX_CONTEST_MOVE_HEARTS 8 #define LINK_CONTEST_FLAG_IS_LINK (1 << 0) #define LINK_CONTEST_FLAG_IS_WIRELESS (1 << 1) -- cgit v1.2.3 From 10886a586b75eb80a68f341bcc61b7c0343ddfe2 Mon Sep 17 00:00:00 2001 From: GriffinR Date: Tue, 27 Apr 2021 02:30:26 -0400 Subject: Clean up mirage tower --- include/constants/event_objects.h | 4 ++++ 1 file changed, 4 insertions(+) (limited to 'include') diff --git a/include/constants/event_objects.h b/include/constants/event_objects.h index 7a224940f..357251548 100644 --- a/include/constants/event_objects.h +++ b/include/constants/event_objects.h @@ -279,7 +279,11 @@ #define FIRST_DECORATION_SPRITE_GFX OBJ_EVENT_GFX_PICHU_DOLL +// Special object event local ids #define OBJ_EVENT_ID_PLAYER 0xFF #define OBJ_EVENT_ID_CAMERA 0x7F +// Object event local ids referenced in C files +#define LOCALID_ROUTE111_PLAYER_FALLING 45 + #endif // GUARD_CONSTANTS_EVENT_OBJECTS_H -- cgit v1.2.3 From fe89a4d1471413a03c1b24b8d5721b04b20b04ae Mon Sep 17 00:00:00 2001 From: GriffinR Date: Fri, 2 Jul 2021 00:52:36 -0400 Subject: Label remaining region_map symbols --- include/region_map.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'include') diff --git a/include/region_map.h b/include/region_map.h index 97364abd8..02d711afa 100644 --- a/include/region_map.h +++ b/include/region_map.h @@ -111,7 +111,7 @@ void PokedexAreaScreen_UpdateRegionMapVariablesAndVideoRegs(s16 x, s16 y); void CB2_OpenFlyMap(void); bool8 IsRegionMapZoomed(void); void TrySetPlayerIconBlink(void); -void sub_8123030(u16 color, u32 coeff); +void BlendRegionMap(u16 color, u32 coeff); void SetRegionMapDataForZoom(void); extern const struct RegionMapLocation gRegionMapEntries[]; -- cgit v1.2.3 From 8f43d1ebebfec0dd021fb2476d39979c2a77ce3c Mon Sep 17 00:00:00 2001 From: GriffinR Date: Fri, 2 Jul 2021 01:45:23 -0400 Subject: Document smart shopper TV show --- include/constants/tv.h | 15 +++++++++++++++ include/event_scripts.h | 26 +++++++++++++------------- 2 files changed, 28 insertions(+), 13 deletions(-) (limited to 'include') diff --git a/include/constants/tv.h b/include/constants/tv.h index 1b28f6e6e..095a6ddca 100644 --- a/include/constants/tv.h +++ b/include/constants/tv.h @@ -249,6 +249,21 @@ #define CONTESTLADYLIVE_STATE_LOST 2 #define CONTESTLADYLIVE_STATE_LOST_BADLY 3 +// TV Show states for Smart Shopper +#define SMARTSHOPPER_STATE_INTRO 0 +#define SMARTSHOPPER_STATE_CLERK_NORMAL 1 +#define SMARTSHOPPER_STATE_RAND_COMMENT_1 2 +#define SMARTSHOPPER_STATE_RAND_COMMENT_2 3 +#define SMARTSHOPPER_STATE_RAND_COMMENT_3 4 +#define SMARTSHOPPER_STATE_RAND_COMMENT_4 5 +#define SMARTSHOPPER_STATE_SECOND_ITEM 6 +#define SMARTSHOPPER_STATE_THIRD_ITEM 7 +#define SMARTSHOPPER_STATE_DURING_SALE 8 +#define SMARTSHOPPER_STATE_OUTRO_NORMAL 9 +#define SMARTSHOPPER_STATE_IS_VIP 10 +#define SMARTSHOPPER_STATE_CLERK_MAX 11 +#define SMARTSHOPPER_STATE_OUTRO_MAX 12 + #define SMARTSHOPPER_NUM_ITEMS 3 #endif //GUARD_CONSTANTS_TV_H diff --git a/include/event_scripts.h b/include/event_scripts.h index 925b4389d..3340da6f5 100644 --- a/include/event_scripts.h +++ b/include/event_scripts.h @@ -108,19 +108,19 @@ extern const u8 gTVPokemonTodaySuccessfulText08[]; extern const u8 gTVPokemonTodaySuccessfulText09[]; extern const u8 gTVPokemonTodaySuccessfulText10[]; extern const u8 gTVPokemonTodaySuccessfulText11[]; -extern const u8 gTVTodaysSmartShopperText00[]; -extern const u8 gTVTodaysSmartShopperText01[]; -extern const u8 gTVTodaysSmartShopperText02[]; -extern const u8 gTVTodaysSmartShopperText03[]; -extern const u8 gTVTodaysSmartShopperText04[]; -extern const u8 gTVTodaysSmartShopperText05[]; -extern const u8 gTVTodaysSmartShopperText06[]; -extern const u8 gTVTodaysSmartShopperText07[]; -extern const u8 gTVTodaysSmartShopperText08[]; -extern const u8 gTVTodaysSmartShopperText09[]; -extern const u8 gTVTodaysSmartShopperText10[]; -extern const u8 gTVTodaysSmartShopperText11[]; -extern const u8 gTVTodaysSmartShopperText12[]; +extern const u8 SmartShopper_Text_Intro[]; +extern const u8 SmartShopper_Text_ClerkNormal[]; +extern const u8 SmartShopper_Text_RandomComment1[]; +extern const u8 SmartShopper_Text_RandomComment2[]; +extern const u8 SmartShopper_Text_RandomComment3[]; +extern const u8 SmartShopper_Text_RandomComment4[]; +extern const u8 SmartShopper_Text_SecondItem[]; +extern const u8 SmartShopper_Text_ThirdItem[]; +extern const u8 SmartShopper_Text_DuringSale[]; +extern const u8 SmartShopper_Text_OutroNormal[]; +extern const u8 SmartShopper_Text_IsVIP[]; +extern const u8 SmartShopper_Text_ClerkMax[]; +extern const u8 SmartShopper_Text_OutroMax[]; extern const u8 gTVWorldOfMastersText00[]; extern const u8 gTVWorldOfMastersText01[]; extern const u8 gTVWorldOfMastersText02[]; -- cgit v1.2.3 From 64d06f4c8fe9710863a370911cc4dd3405992d31 Mon Sep 17 00:00:00 2001 From: GriffinR Date: Fri, 2 Jul 2021 02:40:10 -0400 Subject: Condense battle AI scripts, minor clean up --- include/constants/battle_ai.h | 28 ++++++++++++++-------------- 1 file changed, 14 insertions(+), 14 deletions(-) (limited to 'include') diff --git a/include/constants/battle_ai.h b/include/constants/battle_ai.h index 4c3a45dc6..5ade58d50 100644 --- a/include/constants/battle_ai.h +++ b/include/constants/battle_ai.h @@ -29,24 +29,24 @@ #define AI_WEATHER_HAIL 3 // get_how_powerful_move_is -#define MOVE_POWER_DISCOURAGED 0 +#define MOVE_POWER_OTHER 0 #define MOVE_NOT_MOST_POWERFUL 1 #define MOVE_MOST_POWERFUL 2 // script's table id to bit -#define AI_SCRIPT_CHECK_BAD_MOVE (1 << 0) -#define AI_SCRIPT_TRY_TO_FAINT (1 << 1) -#define AI_SCRIPT_CHECK_VIABILITY (1 << 2) -#define AI_SCRIPT_SETUP_FIRST_TURN (1 << 3) -#define AI_SCRIPT_RISKY (1 << 4) -#define AI_SCRIPT_PREFER_STRONGEST_MOVE (1 << 5) -#define AI_SCRIPT_PREFER_BATON_PASS (1 << 6) -#define AI_SCRIPT_DOUBLE_BATTLE (1 << 7) -#define AI_SCRIPT_HP_AWARE (1 << 8) -#define AI_SCRIPT_UNKNOWN (1 << 9) +#define AI_SCRIPT_CHECK_BAD_MOVE (1 << 0) +#define AI_SCRIPT_TRY_TO_FAINT (1 << 1) +#define AI_SCRIPT_CHECK_VIABILITY (1 << 2) +#define AI_SCRIPT_SETUP_FIRST_TURN (1 << 3) +#define AI_SCRIPT_RISKY (1 << 4) +#define AI_SCRIPT_PREFER_POWER_EXTREMES (1 << 5) +#define AI_SCRIPT_PREFER_BATON_PASS (1 << 6) +#define AI_SCRIPT_DOUBLE_BATTLE (1 << 7) +#define AI_SCRIPT_HP_AWARE (1 << 8) +#define AI_SCRIPT_TRY_SUNNY_DAY_START (1 << 9) // 10 - 28 are not used -#define AI_SCRIPT_ROAMING (1 << 29) -#define AI_SCRIPT_SAFARI (1 << 30) -#define AI_SCRIPT_FIRST_BATTLE (1 << 31) +#define AI_SCRIPT_ROAMING (1 << 29) +#define AI_SCRIPT_SAFARI (1 << 30) +#define AI_SCRIPT_FIRST_BATTLE (1 << 31) #endif // GUARD_CONSTANTS_BATTLE_AI_H -- cgit v1.2.3 From 42730a8315be6abceeb95bc1cd29f4c54077bd2e Mon Sep 17 00:00:00 2001 From: Kurausukun Date: Sat, 3 Jul 2021 17:39:33 -0400 Subject: Revert "remove gflib" This reverts commit 8b59909ac5eb6e3540aeb78396943d57a9702e4d. --- include/bg.h | 85 ---------- include/blit.h | 17 -- include/dma3.h | 55 ------- include/gpu_regs.h | 19 --- include/io_reg.h | 7 - include/malloc.h | 22 --- include/sprite.h | 324 ------------------------------------- include/string_util.h | 46 ------ include/text.h | 436 -------------------------------------------------- include/window.h | 80 --------- 10 files changed, 1091 deletions(-) delete mode 100644 include/bg.h delete mode 100644 include/blit.h delete mode 100644 include/dma3.h delete mode 100644 include/gpu_regs.h delete mode 100644 include/io_reg.h delete mode 100644 include/malloc.h delete mode 100644 include/sprite.h delete mode 100644 include/string_util.h delete mode 100644 include/text.h delete mode 100644 include/window.h (limited to 'include') diff --git a/include/bg.h b/include/bg.h deleted file mode 100644 index 58fd1282c..000000000 --- a/include/bg.h +++ /dev/null @@ -1,85 +0,0 @@ -#ifndef GUARD_BG_H -#define GUARD_BG_H - -struct BGCntrlBitfield // for the I/O registers -{ - volatile u16 priority:2; - volatile u16 charBaseBlock:2; - volatile u16 field_0_2:4; - volatile u16 field_1_0:5; - volatile u16 areaOverflowMode:1; - volatile u16 screenSize:2; -}; - -enum -{ - BG_ATTR_CHARBASEINDEX = 1, - BG_ATTR_MAPBASEINDEX, - BG_ATTR_SCREENSIZE, - BG_ATTR_PALETTEMODE, - BG_ATTR_MOSAIC, - BG_ATTR_WRAPAROUND, - BG_ATTR_PRIORITY, - BG_ATTR_METRIC, - BG_ATTR_TYPE, - BG_ATTR_BASETILE, -}; - -struct BgTemplate -{ - u16 bg:2; // 0x1, 0x2 -> 0x3 - u16 charBaseIndex:2; // 0x4, 0x8 -> 0xC - u16 mapBaseIndex:5; // 0x10, 0x20, 0x40, 0x80, 0x100 -> 0x1F0 - u16 screenSize:2; // 0x200, 0x400 -> 0x600 - u16 paletteMode:1; // 0x800 - u16 priority:2; // 0x1000, 0x2000 > 0x3000 - u16 baseTile:10; -}; - -void ResetBgs(void); -u8 GetBgMode(void); -void ResetBgControlStructs(void); -void Unused_ResetBgControlStruct(u8 bg); -u8 LoadBgVram(u8 bg, const void *src, u16 size, u16 destOffset, u8 mode); -void SetTextModeAndHideBgs(void); -bool8 IsInvalidBg(u8 bg); -int DummiedOutFireRedLeafGreenTileAllocFunc(int a1, int a2, int a3, int a4); -void ResetBgsAndClearDma3BusyFlags(u32 leftoverFireRedLeafGreenVariable); -void InitBgsFromTemplates(u8 bgMode, const struct BgTemplate *templates, u8 numTemplates); -void InitBgFromTemplate(const struct BgTemplate *template); -void SetBgMode(u8 bgMode); -u16 LoadBgTiles(u8 bg, const void* src, u16 size, u16 destOffset); -u16 LoadBgTilemap(u8 bg, const void *src, u16 size, u16 destOffset); -u16 Unused_LoadBgPalette(u8 bg, const void *src, u16 size, u16 destOffset); -bool8 IsDma3ManagerBusyWithBgCopy(void); -void ShowBg(u8 bg); -void HideBg(u8 bg); -void SetBgAttribute(u8 bg, u8 attributeId, u8 value); -u16 GetBgAttribute(u8 bg, u8 attributeId); -s32 ChangeBgX(u8 bg, s32 value, u8 op); -s32 GetBgX(u8 bg); -s32 ChangeBgY(u8 bg, s32 value, u8 op); -s32 ChangeBgY_ScreenOff(u8 bg, s32 value, u8 op); -s32 GetBgY(u8 bg); -void SetBgAffine(u8 bg, s32 srcCenterX, s32 srcCenterY, s16 dispCenterX, s16 dispCenterY, s16 scaleX, s16 scaleY, u16 rotationAngle); -u8 Unused_AdjustBgMosaic(u8 a1, u8 a2); -void SetBgTilemapBuffer(u8 bg, void *tilemap); -void UnsetBgTilemapBuffer(u8 bg); -void* GetBgTilemapBuffer(u8 bg); -void CopyToBgTilemapBuffer(u8 bg, const void *src, u16 mode, u16 destOffset); -void CopyBgTilemapBufferToVram(u8 bg); -void CopyToBgTilemapBufferRect(u8 bg, const void* src, u8 destX, u8 destY, u8 width, u8 height); -void CopyToBgTilemapBufferRect_ChangePalette(u8 bg, const void *src, u8 destX, u8 destY, u8 rectWidth, u8 rectHeight, u8 palette); -void CopyRectToBgTilemapBufferRect(u8 bg, const void *src, u8 srcX, u8 srcY, u8 srcWidth, u8 unused, u8 srcHeight, u8 destX, u8 destY, u8 rectWidth, u8 rectHeight, s16 palette1, s16 tileOffset); -void FillBgTilemapBufferRect_Palette0(u8 bg, u16 tileNum, u8 x, u8 y, u8 width, u8 height); -void FillBgTilemapBufferRect(u8 bg, u16 tileNum, u8 x, u8 y, u8 width, u8 height, u8 palette); -void WriteSequenceToBgTilemapBuffer(u8 bg, u16 firstTileNum, u8 x, u8 y, u8 width, u8 height, u8 paletteSlot, s16 tileNumDelta); -u16 GetBgMetricTextMode(u8 bg, u8 whichMetric); -u32 GetBgMetricAffineMode(u8 bg, u8 whichMetric); -u32 GetTileMapIndexFromCoords(s32 x, s32 y, s32 screenSize, u32 screenWidth, u32 screenHeight); -void CopyTileMapEntry(const u16 *src, u16 *dest, s32 palette1, s32 tileOffset, s32 palette2); -u32 GetBgType(u8 bg); -bool32 IsInvalidBg32(u8 bg); -bool32 IsTileMapOutsideWram(u8 bg); - -#endif // GUARD_BG_H diff --git a/include/blit.h b/include/blit.h deleted file mode 100644 index 78f67766e..000000000 --- a/include/blit.h +++ /dev/null @@ -1,17 +0,0 @@ -#ifndef GUARD_BLIT_H -#define GUARD_BLIT_H - -struct Bitmap -{ - u8 *pixels; - u32 width:16; - u32 height:16; -}; - -void BlitBitmapRect4BitWithoutColorKey(const struct Bitmap *src, struct Bitmap *dst, u16 srcX, u16 srcY, u16 dstX, u16 dstY, u16 width, u16 height); -void BlitBitmapRect4Bit(const struct Bitmap *src, struct Bitmap *dst, u16 srcX, u16 srcY, u16 dstX, u16 dstY, u16 width, u16 height, u8 colorKey); -void FillBitmapRect4Bit(struct Bitmap *surface, u16 x, u16 y, u16 width, u16 height, u8 fillValue); -void BlitBitmapRect4BitTo8Bit(const struct Bitmap *src, struct Bitmap *dst, u16 srcX, u16 srcY, u16 dstX, u16 dstY, u16 width, u16 height, u8 colorKey, u8 paletteOffset); -void FillBitmapRect8Bit(struct Bitmap *surface, u16 x, u16 y, u16 width, u16 height, u8 fillValue); - -#endif // GUARD_BLIT_H diff --git a/include/dma3.h b/include/dma3.h deleted file mode 100644 index 8eff34f55..000000000 --- a/include/dma3.h +++ /dev/null @@ -1,55 +0,0 @@ -#ifndef GUARD_DMA3_H -#define GUARD_DMA3_H - -// Maximum amount of data we will transfer in one operation -#define MAX_DMA_BLOCK_SIZE 0x1000 - -#define Dma3CopyLarge_(src, dest, size, bit) \ -{ \ - const void *_src = src; \ - void *_dest = dest; \ - u32 _size = size; \ - while (1) \ - { \ - if (_size <= MAX_DMA_BLOCK_SIZE) \ - { \ - DmaCopy##bit(3, _src, _dest, _size); \ - break; \ - } \ - DmaCopy##bit(3, _src, _dest, MAX_DMA_BLOCK_SIZE); \ - _src += MAX_DMA_BLOCK_SIZE; \ - _dest += MAX_DMA_BLOCK_SIZE; \ - _size -= MAX_DMA_BLOCK_SIZE; \ - } \ -} - -#define Dma3CopyLarge16_(src, dest, size) Dma3CopyLarge_(src, dest, size, 16) -#define Dma3CopyLarge32_(src, dest, size) Dma3CopyLarge_(src, dest, size, 32) - -#define Dma3FillLarge_(value, dest, size, bit) \ -{ \ - void *_dest = dest; \ - u32 _size = size; \ - while (1) \ - { \ - if (_size <= MAX_DMA_BLOCK_SIZE) \ - { \ - DmaFill##bit(3, value, _dest, _size); \ - break; \ - } \ - DmaFill##bit(3, value, _dest, MAX_DMA_BLOCK_SIZE); \ - _dest += MAX_DMA_BLOCK_SIZE; \ - _size -= MAX_DMA_BLOCK_SIZE; \ - } \ -} - -#define Dma3FillLarge16_(value, dest, size) Dma3FillLarge_(value, dest, size, 16) -#define Dma3FillLarge32_(value, dest, size) Dma3FillLarge_(value, dest, size, 32) - -void ClearDma3Requests(void); -void ProcessDma3Requests(void); -s16 RequestDma3Copy(const void *src, void *dest, u16 size, u8 mode); -s16 RequestDma3Fill(s32 value, void *dest, u16 size, u8 mode); -s16 CheckForSpaceForDma3Request(s16 index); - -#endif // GUARD_DMA3_H diff --git a/include/gpu_regs.h b/include/gpu_regs.h deleted file mode 100644 index 89e0cb64b..000000000 --- a/include/gpu_regs.h +++ /dev/null @@ -1,19 +0,0 @@ -#ifndef GUARD_GPU_REGS_H -#define GUARD_GPU_REGS_H - -// Exported type declarations - -// Exported RAM declarations - -// Exported ROM declarations -void InitGpuRegManager(void); -void CopyBufferedValuesToGpuRegs(void); -void SetGpuReg(u8 regOffset, u16 value); -void SetGpuReg_ForcedBlank(u8 regOffset, u16 value); -u16 GetGpuReg(u8 regOffset); -void SetGpuRegBits(u8 regOffset, u16 mask); -void ClearGpuRegBits(u8 regOffset, u16 mask); -void EnableInterrupts(u16 mask); -void DisableInterrupts(u16 mask); - -#endif //GUARD_GPU_REGS_H diff --git a/include/io_reg.h b/include/io_reg.h deleted file mode 100644 index 82d2fc5ed..000000000 --- a/include/io_reg.h +++ /dev/null @@ -1,7 +0,0 @@ -#ifndef GUARD_IO_REG_H -#define GUARD_IO_REG_H - -extern const u16 gOverworldBackgroundLayerFlags[]; -extern const u16 gOrbEffectBackgroundLayerFlags[]; - -#endif // GUARD_IO_REG_H diff --git a/include/malloc.h b/include/malloc.h deleted file mode 100644 index f2dcf6d46..000000000 --- a/include/malloc.h +++ /dev/null @@ -1,22 +0,0 @@ -#ifndef GUARD_ALLOC_H -#define GUARD_ALLOC_H - -#define HEAP_SIZE 0x1C000 -#define malloc Alloc -#define calloc(ct, sz) AllocZeroed((ct) * (sz)) -#define free Free - -#define FREE_AND_SET_NULL(ptr) \ -{ \ - free(ptr); \ - ptr = NULL; \ -} - -extern u8 gHeap[]; - -void *Alloc(u32 size); -void *AllocZeroed(u32 size); -void Free(void *pointer); -void InitHeap(void *pointer, u32 size); - -#endif // GUARD_ALLOC_H diff --git a/include/sprite.h b/include/sprite.h deleted file mode 100644 index 4a3b48225..000000000 --- a/include/sprite.h +++ /dev/null @@ -1,324 +0,0 @@ -#ifndef GUARD_SPRITE_H -#define GUARD_SPRITE_H - -#define MAX_SPRITES 64 -#define SPRITE_NONE 0xFF -#define SPRITE_INVALID_TAG 0xFFFF - -struct SpriteSheet -{ - const void *data; // Raw uncompressed pixel data - u16 size; - u16 tag; -}; - -struct CompressedSpriteSheet -{ - const u32 *data; // LZ77 compressed pixel data - u16 size; // Uncompressed size of pixel data - u16 tag; -}; - -struct SpriteFrameImage -{ - const void *data; - u16 size; -}; - -#define obj_frame_tiles(ptr) {.data = (u8 *)ptr, .size = sizeof ptr} - -#define overworld_frame(ptr, width, height, frame) {.data = (u8 *)ptr + (width * height * frame * 64)/2, .size = (width * height * 64)/2} - -struct SpritePalette -{ - const u16 *data; // Raw uncompressed palette data - u16 tag; -}; - -struct CompressedSpritePalette -{ - const u32 *data; // LZ77 compressed palette data - u16 tag; -}; - -struct AnimFrameCmd -{ - // If the sprite has an array of images, this is the array index. - // If the sprite has a sheet, this is the tile offset. - u32 imageValue:16; - - u32 duration:6; - u32 hFlip:1; - u32 vFlip:1; -}; - -struct AnimLoopCmd -{ - u32 type:16; - u32 count:6; -}; - -struct AnimJumpCmd -{ - u32 type:16; - u32 target:6; -}; - -// The first halfword of this union specifies the type of command. -// If it -2, then it is a jump command. If it is -1, then it is the end of the script. -// Otherwise, it is the imageValue for a frame command. -union AnimCmd -{ - s16 type; - struct AnimFrameCmd frame; - struct AnimLoopCmd loop; - struct AnimJumpCmd jump; -}; - -#define ANIMCMD_FRAME(...) \ - {.frame = {__VA_ARGS__}} -#define ANIMCMD_LOOP(_count) \ - {.loop = {.type = -3, .count = _count}} -#define ANIMCMD_JUMP(_target) \ - {.jump = {.type = -2, .target = _target}} -#define ANIMCMD_END \ - {.type = -1} - -struct AffineAnimFrameCmd -{ - s16 xScale; - s16 yScale; - u8 rotation; - u8 duration; -}; - -struct AffineAnimLoopCmd -{ - s16 type; - s16 count; -}; - -struct AffineAnimJumpCmd -{ - s16 type; - u16 target; -}; - -struct AffineAnimEndCmdAlt -{ - s16 type; - u16 val; -}; - -union AffineAnimCmd -{ - s16 type; - struct AffineAnimFrameCmd frame; - struct AffineAnimLoopCmd loop; - struct AffineAnimJumpCmd jump; - struct AffineAnimEndCmdAlt end; // unused in code -}; - -#define AFFINEANIMCMDTYPE_LOOP 0x7FFD -#define AFFINEANIMCMDTYPE_JUMP 0x7FFE -#define AFFINEANIMCMDTYPE_END 0x7FFF - -#define AFFINEANIMCMD_FRAME(_xScale, _yScale, _rotation, _duration) \ - {.frame = {.xScale = _xScale, .yScale = _yScale, .rotation = _rotation, .duration = _duration}} -#define AFFINEANIMCMD_LOOP(_count) \ - {.loop = {.type = AFFINEANIMCMDTYPE_LOOP, .count = _count}} -#define AFFINEANIMCMD_JUMP(_target) \ - {.jump = {.type = AFFINEANIMCMDTYPE_JUMP, .target = _target}} -#define AFFINEANIMCMD_END \ - {.type = AFFINEANIMCMDTYPE_END} -#define AFFINEANIMCMD_END_ALT(_val) \ - {.end = {.type = AFFINEANIMCMDTYPE_END, .val = _val}} - -struct AffineAnimState -{ - u8 animNum; - u8 animCmdIndex; - u8 delayCounter; - u8 loopCounter; - s16 xScale; - s16 yScale; - u16 rotation; -}; - -enum -{ - SUBSPRITES_OFF, - SUBSPRITES_ON, - SUBSPRITES_IGNORE_PRIORITY, // on but priority is ignored -}; - -struct Subsprite -{ - s8 x; // was u16 in R/S - s8 y; // was u16 in R/S - u16 shape:2; - u16 size:2; - u16 tileOffset:10; - u16 priority:2; -}; - -struct SubspriteTable -{ - u8 subspriteCount; - const struct Subsprite *subsprites; -}; - -struct Sprite; - -typedef void (*SpriteCallback)(struct Sprite *); - -struct SpriteTemplate -{ - u16 tileTag; - u16 paletteTag; - const struct OamData *oam; - const union AnimCmd *const *anims; - const struct SpriteFrameImage *images; - const union AffineAnimCmd *const *affineAnims; - SpriteCallback callback; -}; - -// UB: template pointer is often used to point to temporary storage, -// then later dereferenced after being freed. Usually this won't -// be visible in-game, but this is (part of) what causes the item -// icon palette to flicker when changing items in the bag. -struct Sprite -{ - /*0x00*/ struct OamData oam; - /*0x08*/ const union AnimCmd *const *anims; - /*0x0C*/ const struct SpriteFrameImage *images; - /*0x10*/ const union AffineAnimCmd *const *affineAnims; - /*0x14*/ const struct SpriteTemplate *template; - /*0x18*/ const struct SubspriteTable *subspriteTables; - /*0x1C*/ SpriteCallback callback; - - /*0x20*/ struct Coords16 pos1; - /*0x24*/ struct Coords16 pos2; - /*0x28*/ s8 centerToCornerVecX; - /*0x29*/ s8 centerToCornerVecY; - - /*0x2A*/ u8 animNum; - /*0x2B*/ u8 animCmdIndex; - /*0x2C*/ u8 animDelayCounter:6; - bool8 animPaused:1; - bool8 affineAnimPaused:1; - /*0x2D*/ u8 animLoopCounter; - - // general purpose data fields - /*0x2E*/ s16 data[8]; - - /*0x3E*/ bool16 inUse:1; //1 - bool16 coordOffsetEnabled:1; //2 - bool16 invisible:1; //4 - bool16 flags_3:1; //8 - bool16 flags_4:1; //0x10 - bool16 flags_5:1; //0x20 - bool16 flags_6:1; //0x40 - bool16 flags_7:1; //0x80 - /*0x3F*/ bool16 hFlip:1; //1 - bool16 vFlip:1; //2 - bool16 animBeginning:1; //4 - bool16 affineAnimBeginning:1; //8 - bool16 animEnded:1; //0x10 - bool16 affineAnimEnded:1; //0x20 - bool16 usingSheet:1; //0x40 - bool16 flags_f:1; //0x80 - - /*0x40*/ u16 sheetTileStart; - - /*0x42*/ u8 subspriteTableNum:6; - u8 subspriteMode:2; - - /*0x43*/ u8 subpriority; -}; - -struct OamMatrix -{ - s16 a; - s16 b; - s16 c; - s16 d; -}; - -extern const struct OamData gDummyOamData; -extern const union AnimCmd *const gDummySpriteAnimTable[]; -extern const union AffineAnimCmd *const gDummySpriteAffineAnimTable[]; -extern const struct SpriteTemplate gDummySpriteTemplate; - -extern u8 gReservedSpritePaletteCount; -extern struct Sprite gSprites[]; -extern u8 gOamLimit; -extern u16 gReservedSpriteTileCount; -extern s16 gSpriteCoordOffsetX; -extern s16 gSpriteCoordOffsetY; -extern struct OamMatrix gOamMatrices[]; -extern bool8 gAffineAnimsDisabled; - -void ResetSpriteData(void); -void AnimateSprites(void); -void BuildOamBuffer(void); -u8 CreateSprite(const struct SpriteTemplate *template, s16 x, s16 y, u8 subpriority); -u8 CreateSpriteAtEnd(const struct SpriteTemplate *template, s16 x, s16 y, u8 subpriority); -u8 CreateInvisibleSprite(void (*callback)(struct Sprite *)); -u8 CreateSpriteAndAnimate(const struct SpriteTemplate *template, s16 x, s16 y, u8 subpriority); -void DestroySprite(struct Sprite *sprite); -void ResetOamRange(u8 a, u8 b); -void LoadOam(void); -void SetOamMatrix(u8 matrixNum, u16 a, u16 b, u16 c, u16 d); -void CalcCenterToCornerVec(struct Sprite *sprite, u8 shape, u8 size, u8 affineMode); -void SpriteCallbackDummy(struct Sprite *sprite); -void ProcessSpriteCopyRequests(void); -void RequestSpriteCopy(const u8 *src, u8 *dest, u16 size); -void FreeSpriteTiles(struct Sprite *sprite); -void FreeSpritePalette(struct Sprite *sprite); -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); -void StartSpriteAffineAnim(struct Sprite *sprite, u8 animNum); -void StartSpriteAffineAnimIfDifferent(struct Sprite *sprite, u8 animNum); -void ChangeSpriteAffineAnim(struct Sprite *sprite, u8 animNum); -void ChangeSpriteAffineAnimIfDifferent(struct Sprite *sprite, u8 animNum); -void SetSpriteSheetFrameTileNum(struct Sprite *sprite); -u8 AllocOamMatrix(void); -void FreeOamMatrix(u8 matrixNum); -void InitSpriteAffineAnim(struct Sprite *sprite); -void SetOamMatrixRotationScaling(u8 matrixNum, s16 xScale, s16 yScale, u16 rotation); -u16 LoadSpriteSheet(const struct SpriteSheet *sheet); -void LoadSpriteSheets(const struct SpriteSheet *sheets); -u16 AllocTilesForSpriteSheet(struct SpriteSheet *sheet); -void AllocTilesForSpriteSheets(struct SpriteSheet *sheets); -void LoadTilesForSpriteSheet(const struct SpriteSheet *sheet); -void LoadTilesForSpriteSheets(struct SpriteSheet *sheets); -void FreeSpriteTilesByTag(u16 tag); -void FreeSpriteTileRanges(void); -u16 GetSpriteTileStartByTag(u16 tag); -u16 GetSpriteTileTagByTileStart(u16 start); -void RequestSpriteSheetCopy(const struct SpriteSheet *sheet); -u16 LoadSpriteSheetDeferred(const struct SpriteSheet *sheet); -void FreeAllSpritePalettes(void); -u8 LoadSpritePalette(const struct SpritePalette *palette); -void LoadSpritePalettes(const struct SpritePalette *palettes); -u8 AllocSpritePalette(u16 tag); -u8 IndexOfSpritePaletteTag(u16 tag); -u16 GetSpritePaletteTagByPaletteNum(u8 paletteNum); -void FreeSpritePaletteByTag(u16 tag); -void SetSubspriteTables(struct Sprite *sprite, const struct SubspriteTable *subspriteTables); -bool8 AddSpriteToOamBuffer(struct Sprite *object, u8 *oamIndex); -bool8 AddSubspritesToOamBuffer(struct Sprite *sprite, struct OamData *destOam, u8 *oamIndex); -void CopyToSprites(u8 *src); -void CopyFromSprites(u8 *dest); -u8 SpriteTileAllocBitmapOp(u16 bit, u8 op); -void ClearSpriteCopyRequests(void); -void ResetAffineAnimData(void); - -#endif //GUARD_SPRITE_H diff --git a/include/string_util.h b/include/string_util.h deleted file mode 100644 index 229193d52..000000000 --- a/include/string_util.h +++ /dev/null @@ -1,46 +0,0 @@ -#ifndef GUARD_STRING_UTIL_H -#define GUARD_STRING_UTIL_H - -extern u8 gStringVar1[0x100]; -extern u8 gStringVar2[0x100]; -extern u8 gStringVar3[0x100]; -extern u8 gStringVar4[0x3E8]; - -enum StringConvertMode -{ - STR_CONV_MODE_LEFT_ALIGN, - STR_CONV_MODE_RIGHT_ALIGN, - STR_CONV_MODE_LEADING_ZEROS -}; - -u8 *StringCopy10(u8 *dest, const u8 *src); -u8 *StringGetEnd10(u8 *str); -u8 *StringCopy7(u8 *dest, const u8 *src); -u8 *StringCopy(u8 *dest, const u8 *src); -u8 *StringAppend(u8 *dest, const u8 *src); -u8 *StringCopyN(u8 *dest, const u8 *src, u8 n); -u8 *StringAppendN(u8 *dest, const u8 *src, u8 n); -u16 StringLength(const u8 *str); -s32 StringCompare(const u8 *str1, const u8 *str2); -s32 StringCompareN(const u8 *str1, const u8 *str2, u32 n); -bool8 IsStringLengthAtLeast(const u8 *str, s32 n); -u8 *ConvertIntToDecimalStringN(u8 *dest, s32 value, enum StringConvertMode mode, u8 n); -u8 *ConvertUIntToDecimalStringN(u8 *dest, u32 value, enum StringConvertMode mode, u8 n); -u8 *ConvertIntToHexStringN(u8 *dest, s32 value, enum StringConvertMode mode, u8 n); -u8 *StringExpandPlaceholders(u8 *dest, const u8 *src); -u8 *StringBraille(u8 *dest, const u8 *src); -const u8 *GetExpandedPlaceholder(u32 id); -u8 *StringFill(u8 *dest, u8 c, u16 n); -u8 *StringCopyPadded(u8 *dest, const u8 *src, u8 c, u16 n); -u8 *StringFillWithTerminator(u8 *dest, u16 n); -u8 *StringCopyN_Multibyte(u8 *dest, u8 *src, u32 n); -u32 StringLength_Multibyte(const u8 *str); -u8 *WriteColorChangeControlCode(u8 *dest, u32 colorType, u8 color); -bool32 IsStringJapanese(u8 *str); -bool32 sub_800924C(u8 *str, s32 n); -u8 GetExtCtrlCodeLength(u8 code); -s32 StringCompareWithoutExtCtrlCodes(const u8 *str1, const u8 *str2); -void ConvertInternationalString(u8 *s, u8 language); -void StripExtCtrlCodes(u8 *str); - -#endif // GUARD_STRING_UTIL_H diff --git a/include/text.h b/include/text.h deleted file mode 100644 index 3edd0fc62..000000000 --- a/include/text.h +++ /dev/null @@ -1,436 +0,0 @@ -#ifndef GUARD_TEXT_H -#define GUARD_TEXT_H - -#define CHAR_SPACE 0x00 -#define CHAR_A_GRAVE 0x01 -#define CHAR_A_ACUTE 0x02 -#define CHAR_A_CIRCUMFLEX 0x03 -#define CHAR_C_CEDILLA 0x04 -#define CHAR_E_GRAVE 0x05 -#define CHAR_E_ACUTE 0x06 -#define CHAR_E_CIRCUMFLEX 0x07 -#define CHAR_E_DIAERESIS 0x08 -#define CHAR_I_GRAVE 0x09 -//#define CHAR_I_ACUTE 0x0A // Is 0x5A instead -#define CHAR_I_CIRCUMFLEX 0x0B -#define CHAR_I_DIAERESIS 0x0C -#define CHAR_O_GRAVE 0x0D -#define CHAR_O_ACUTE 0x0E -#define CHAR_O_CIRCUMFLEX 0x0F -#define CHAR_OE 0x10 -#define CHAR_U_GRAVE 0x11 -#define CHAR_U_ACUTE 0x12 -#define CHAR_U_CIRCUMFLEX 0x13 -#define CHAR_N_TILDE 0x14 -#define CHAR_ESZETT 0x15 -#define CHAR_a_GRAVE 0x16 -#define CHAR_a_ACUTE 0x17 -//#define CHAR_a_CIRCUMFLEX 0x18 // Is 0x68 instead -#define CHAR_c_CEDILLA 0x19 -#define CHAR_e_GRAVE 0x1A -#define CHAR_e_ACUTE 0x1B -#define CHAR_e_CIRCUMFLEX 0x1C -#define CHAR_e_DIAERESIS 0x1D -#define CHAR_i_GRAVE 0x1E -//#define CHAR_i_ACUTE 0x1F // Is 0x6F instead -#define CHAR_i_CIRCUMFLEX 0x20 -#define CHAR_i_DIAERESIS 0x21 -#define CHAR_o_GRAVE 0x22 -#define CHAR_o_ACUTE 0x23 -#define CHAR_o_CIRCUMFLEX 0x24 -#define CHAR_oe 0x25 -#define CHAR_u_GRAVE 0x26 -#define CHAR_u_ACUTE 0x27 -#define CHAR_u_CIRCUMFLEX 0x28 -#define CHAR_n_TILDE 0x29 -#define CHAR_MASCULINE_ORDINAL 0x2A -#define CHAR_FEMININE_ORDINAL 0x2B -#define CHAR_SUPER_ER 0x2C -#define CHAR_AMPERSAND 0x2D -#define CHAR_PLUS 0x2E -// -#define CHAR_LV 0x34 -#define CHAR_EQUALS 0x35 -#define CHAR_SEMICOLON 0x36 -// -#define CHAR_INV_QUESTION_MARK 0x51 -#define CHAR_INV_EXCL_MARK 0x52 -#define CHAR_PK 0x53 -#define CHAR_MN 0x54 -#define CHAR_PO 0x55 -#define CHAR_KE 0x56 -#define CHAR_BLOCK_1 0x57 // Each of these 3 -#define CHAR_BLOCK_2 0x58 // chars contains 1/3 -#define CHAR_BLOCK_3 0x59 // of the word BLOCK -#define CHAR_I_ACUTE 0x5A -#define CHAR_PERCENT 0x5B -#define CHAR_LEFT_PAREN 0x5C -#define CHAR_RIGHT_PAREN 0x5D -// -#define CHAR_a_CIRCUMFLEX 0x68 -// -#define CHAR_i_ACUTE 0x6F -// -#define CHAR_GENDERLESS 0x77 // Empty space for lack of gender icon -// -#define CHAR_UP_ARROW 0x79 -#define CHAR_DOWN_ARROW 0x7A -#define CHAR_LEFT_ARROW 0x7B -#define CHAR_RIGHT_ARROW 0x7C -// -#define CHAR_SUPER_E 0x84 -#define CHAR_LESS_THAN 0x85 -#define CHAR_GREATER_THAN 0x86 -// -#define CHAR_SUPER_RE 0xA0 -#define CHAR_0 0xA1 -#define CHAR_1 0xA2 -#define CHAR_2 0xA3 -#define CHAR_3 0xA4 -#define CHAR_4 0xA5 -#define CHAR_5 0xA6 -#define CHAR_6 0xA7 -#define CHAR_7 0xA8 -#define CHAR_8 0xA9 -#define CHAR_9 0xAA -#define CHAR_EXCL_MARK 0xAB -#define CHAR_QUESTION_MARK 0xAC -#define CHAR_PERIOD 0xAD -#define CHAR_HYPHEN 0xAE -#define CHAR_BULLET 0xAF -#define CHAR_ELLIPSIS 0xB0 -#define CHAR_DBL_QUOT_LEFT 0xB1 -#define CHAR_DBL_QUOT_RIGHT 0xB2 -#define CHAR_SGL_QUOT_LEFT 0xB3 -#define CHAR_SGL_QUOT_RIGHT 0xB4 -#define CHAR_MALE 0xB5 -#define CHAR_FEMALE 0xB6 -#define CHAR_CURRENCY 0xB7 -#define CHAR_COMMA 0xB8 -#define CHAR_MULT_SIGN 0xB9 -#define CHAR_SLASH 0xBA -#define CHAR_A 0xBB -#define CHAR_B 0xBC -#define CHAR_C 0xBD -#define CHAR_D 0xBE -#define CHAR_E 0xBF -#define CHAR_F 0xC0 -#define CHAR_G 0xC1 -#define CHAR_H 0xC2 -#define CHAR_I 0xC3 -#define CHAR_J 0xC4 -#define CHAR_K 0xC5 -#define CHAR_L 0xC6 -#define CHAR_M 0xC7 -#define CHAR_N 0xC8 -#define CHAR_O 0xC9 -#define CHAR_P 0xCA -#define CHAR_Q 0xCB -#define CHAR_R 0xCC -#define CHAR_S 0xCD -#define CHAR_T 0xCE -#define CHAR_U 0xCF -#define CHAR_V 0xD0 -#define CHAR_W 0xD1 -#define CHAR_X 0xD2 -#define CHAR_Y 0xD3 -#define CHAR_Z 0xD4 -#define CHAR_a 0xD5 -#define CHAR_b 0xD6 -#define CHAR_c 0xD7 -#define CHAR_d 0xD8 -#define CHAR_e 0xD9 -#define CHAR_f 0xDA -#define CHAR_g 0xDB -#define CHAR_h 0xDC -#define CHAR_i 0xDD -#define CHAR_j 0xDE -#define CHAR_k 0xDF -#define CHAR_l 0xE0 -#define CHAR_m 0xE1 -#define CHAR_n 0xE2 -#define CHAR_o 0xE3 -#define CHAR_p 0xE4 -#define CHAR_q 0xE5 -#define CHAR_r 0xE6 -#define CHAR_s 0xE7 -#define CHAR_t 0xE8 -#define CHAR_u 0xE9 -#define CHAR_v 0xEA -#define CHAR_w 0xEB -#define CHAR_x 0xEC -#define CHAR_y 0xED -#define CHAR_z 0xEE -#define CHAR_BLACK_TRIANGLE 0xEF -#define CHAR_COLON 0xF0 -#define CHAR_A_DIAERESIS 0xF1 -#define CHAR_O_DIAERESIS 0xF2 -#define CHAR_U_DIAERESIS 0xF3 -#define CHAR_a_DIAERESIS 0xF4 -#define CHAR_o_DIAERESIS 0xF5 -#define CHAR_u_DIAERESIS 0xF6 -#define CHAR_DYNAMIC 0xF7 -#define CHAR_KEYPAD_ICON 0xF8 -#define CHAR_EXTRA_SYMBOL 0xF9 -#define CHAR_PROMPT_SCROLL 0xFA // waits for button press and scrolls dialog -#define CHAR_PROMPT_CLEAR 0xFB // waits for button press and clears dialog -#define EXT_CTRL_CODE_BEGIN 0xFC // extended control code -#define PLACEHOLDER_BEGIN 0xFD // string placeholder -#define CHAR_NEWLINE 0xFE -#define EOS 0xFF // end of string - -// CHAR_KEYPAD_ICON chars -#define CHAR_A_BUTTON 0x00 -#define CHAR_B_BUTTON 0x01 -#define CHAR_L_BUTTON 0x02 -#define CHAR_R_BUTTON 0x03 -#define CHAR_START_BUTTON 0x04 -#define CHAR_SELECT_BUTTON 0x05 -#define CHAR_DPAD_UP 0x06 -#define CHAR_DPAD_DOWN 0x07 -#define CHAR_DPAD_LEFT 0x08 -#define CHAR_DPAD_RIGHT 0x09 -#define CHAR_DPAD_UPDOWN 0x0A -#define CHAR_DPAD_LEFTRIGHT 0x0B -#define CHAR_DPAD_NONE 0x0C - -// CHAR_EXTRA_SYMBOL chars -#define CHAR_UP_ARROW_2 0x00 -#define CHAR_DOWN_ARROW_2 0x01 -#define CHAR_LEFT_ARROW_2 0x02 -#define CHAR_RIGHT_ARROW_2 0x03 -#define CHAR_PLUS_2 0x04 -#define CHAR_LV_2 0x05 -#define CHAR_PP 0x06 -#define CHAR_ID 0x07 -#define CHAR_NO 0x08 -#define CHAR_UNDERSCORE 0x09 - -#define EXT_CTRL_CODE_COLOR 0x01 -#define EXT_CTRL_CODE_HIGHLIGHT 0x02 -#define EXT_CTRL_CODE_SHADOW 0x03 -#define EXT_CTRL_CODE_COLOR_HIGHLIGHT_SHADOW 0x04 -#define EXT_CTRL_CODE_PALETTE 0x05 -#define EXT_CTRL_CODE_SIZE 0x06 -#define EXT_CTRL_CODE_RESET_SIZE 0x07 -#define EXT_CTRL_CODE_PAUSE 0x08 -#define EXT_CTRL_CODE_PAUSE_UNTIL_PRESS 0x09 -#define EXT_CTRL_CODE_WAIT_SE 0x0A -#define EXT_CTRL_CODE_PLAY_BGM 0x0B -#define EXT_CTRL_CODE_ESCAPE 0x0C -#define EXT_CTRL_CODE_SHIFT_TEXT 0x0D -#define EXT_CTRL_CODE_SHIFT_DOWN 0x0E -#define EXT_CTRL_CODE_FILL_WINDOW 0x0F -#define EXT_CTRL_CODE_PLAY_SE 0x10 -#define EXT_CTRL_CODE_CLEAR 0x11 -#define EXT_CTRL_CODE_SKIP 0x12 -#define EXT_CTRL_CODE_CLEAR_TO 0x13 -#define EXT_CTRL_CODE_MIN_LETTER_SPACING 0x14 -#define EXT_CTRL_CODE_JPN 0x15 -#define EXT_CTRL_CODE_ENG 0x16 -#define EXT_CTRL_CODE_PAUSE_MUSIC 0x17 -#define EXT_CTRL_CODE_RESUME_MUSIC 0x18 - -#define TEXT_COLOR_TRANSPARENT 0x0 -#define TEXT_COLOR_WHITE 0x1 -#define TEXT_COLOR_DARK_GRAY 0x2 -#define TEXT_COLOR_LIGHT_GRAY 0x3 -#define TEXT_COLOR_RED 0x4 -#define TEXT_COLOR_LIGHT_RED 0x5 -#define TEXT_COLOR_GREEN 0x6 -#define TEXT_COLOR_LIGHT_GREEN 0x7 -#define TEXT_COLOR_BLUE 0x8 -#define TEXT_COLOR_LIGHT_BLUE 0x9 -#define TEXT_DYNAMIC_COLOR_1 0xA // Usually white -#define TEXT_DYNAMIC_COLOR_2 0xB // Usually white w/ tinge of green -#define TEXT_DYNAMIC_COLOR_3 0xC // Usually white -#define TEXT_DYNAMIC_COLOR_4 0xD // Usually aquamarine -#define TEXT_DYNAMIC_COLOR_5 0xE // Usually blue-green -#define TEXT_DYNAMIC_COLOR_6 0xF // Usually cerulean - -#define PLACEHOLDER_ID_UNKNOWN 0x0 -#define PLACEHOLDER_ID_PLAYER 0x1 -#define PLACEHOLDER_ID_STRING_VAR_1 0x2 -#define PLACEHOLDER_ID_STRING_VAR_2 0x3 -#define PLACEHOLDER_ID_STRING_VAR_3 0x4 -#define PLACEHOLDER_ID_KUN 0x5 -#define PLACEHOLDER_ID_RIVAL 0x6 -#define PLACEHOLDER_ID_VERSION 0x7 -#define PLACEHOLDER_ID_AQUA 0x8 -#define PLACEHOLDER_ID_MAGMA 0x9 -#define PLACEHOLDER_ID_ARCHIE 0xA -#define PLACEHOLDER_ID_MAXIE 0xB -#define PLACEHOLDER_ID_KYOGRE 0xC -#define PLACEHOLDER_ID_GROUDON 0xD - -// battle placeholders are located in battle_message.h - -#define NUM_TEXT_PRINTERS 32 - -#define TEXT_SPEED_FF 0xFF - -enum -{ - FONTATTR_MAX_LETTER_WIDTH, - FONTATTR_MAX_LETTER_HEIGHT, - FONTATTR_LETTER_SPACING, - FONTATTR_LINE_SPACING, - FONTATTR_UNKNOWN, // dunno what this is yet - FONTATTR_COLOR_FOREGROUND, - FONTATTR_COLOR_BACKGROUND, - FONTATTR_COLOR_SHADOW -}; - -struct TextPrinterSubStruct -{ - u8 glyphId:4; // 0x14 - bool8 hasPrintBeenSpedUp:1; - u8 unk:3; - u8 downArrowDelay:5; - u8 downArrowYPosIdx:2; - bool8 hasGlyphIdBeenSet:1; - u8 autoScrollDelay; -}; - -struct TextPrinterTemplate -{ - const u8* currentChar; - u8 windowId; - u8 fontId; - u8 x; - u8 y; - u8 currentX; // 0x8 - u8 currentY; - u8 letterSpacing; - u8 lineSpacing; - u8 unk:4; // 0xC - u8 fgColor:4; - u8 bgColor:4; - u8 shadowColor:4; -}; - -struct TextPrinter -{ - struct TextPrinterTemplate printerTemplate; - - void (*callback)(struct TextPrinterTemplate *, u16); // 0x10 - - u8 subStructFields[7]; // always cast to struct TextPrinterSubStruct... so why bother - u8 active; - u8 state; // 0x1C - u8 textSpeed; - u8 delayCounter; - u8 scrollDistance; - u8 minLetterSpacing; // 0x20 - u8 japanese; -}; - -struct FontInfo -{ - u16 (*fontFunction)(struct TextPrinter *x); - u8 maxLetterWidth; - u8 maxLetterHeight; - u8 letterSpacing; - u8 lineSpacing; - u8 unk:4; - u8 fgColor:4; - u8 bgColor:4; - u8 shadowColor:4; -}; - -extern const struct FontInfo *gFonts; - -struct GlyphWidthFunc -{ - u32 fontId; - u32 (*func)(u16 glyphId, bool32 isJapanese); -}; - -struct KeypadIcon -{ - u16 tileOffset; - u8 width; - u8 height; -}; - -typedef struct { - bool8 canABSpeedUpPrint:1; - bool8 useAlternateDownArrow:1; - bool8 autoScroll:1; - bool8 forceMidTextSpeed:1; -} TextFlags; - -struct TextGlyph -{ - u32 gfxBufferTop[16]; - u32 gfxBufferBottom[16]; - u8 width; - u8 height; -}; - -extern TextFlags gTextFlags; - -extern u8 gDisableTextPrinters; -extern struct TextGlyph gCurGlyph; - -void SetFontsPointer(const struct FontInfo *fonts); -void DeactivateAllTextPrinters(void); -u16 AddTextPrinterParameterized(u8 windowId, u8 fontId, const u8 *str, u8 x, u8 y, u8 speed, void (*callback)(struct TextPrinterTemplate *, u16)); -bool16 AddTextPrinter(struct TextPrinterTemplate *template, u8 speed, void (*callback)(struct TextPrinterTemplate *, u16)); -void RunTextPrinters(void); -bool16 IsTextPrinterActive(u8 id); -u32 RenderFont(struct TextPrinter *textPrinter); -void GenerateFontHalfRowLookupTable(u8 fgColor, u8 bgColor, u8 shadowColor); -void SaveTextColors(u8 *fgColor, u8 *bgColor, u8 *shadowColor); -void RestoreTextColors(u8 *fgColor, u8 *bgColor, u8 *shadowColor); -void DecompressGlyphTile(const void *src_, void *dest_); -u8 GetLastTextColor(u8 colorType); -void CopyGlyphToWindow(struct TextPrinter *x); -void ClearTextSpan(struct TextPrinter *textPrinter, u32 width); -u8 GetMenuCursorDimensionByFont(u8, u8); - -u16 Font0Func(struct TextPrinter *textPrinter); -u16 Font1Func(struct TextPrinter *textPrinter); -u16 Font2Func(struct TextPrinter *textPrinter); -u16 Font3Func(struct TextPrinter *textPrinter); -u16 Font4Func(struct TextPrinter *textPrinter); -u16 Font5Func(struct TextPrinter *textPrinter); -u16 Font7Func(struct TextPrinter *textPrinter); -u16 Font8Func(struct TextPrinter *textPrinter); - -void TextPrinterInitDownArrowCounters(struct TextPrinter *textPrinter); -void TextPrinterDrawDownArrow(struct TextPrinter *textPrinter); -void TextPrinterClearDownArrow(struct TextPrinter *textPrinter); -bool8 TextPrinterWaitAutoMode(struct TextPrinter *textPrinter); -bool16 TextPrinterWaitWithDownArrow(struct TextPrinter *textPrinter); -bool16 TextPrinterWait(struct TextPrinter *textPrinter); -void DrawDownArrow(u8 windowId, u16 x, u16 y, u8 bgColor, bool8 drawArrow, u8 *counter, u8 *yCoordIndex); -u16 RenderText(struct TextPrinter *textPrinter); -u32 GetStringWidthFixedWidthFont(const u8 *str, u8 fontId, u8 letterSpacing); -u32 (*GetFontWidthFunc(u8 glyphId))(u16, bool32); -s32 GetStringWidth(u8 fontId, const u8 *str, s16 letterSpacing); -u8 RenderTextFont9(u8 *pixels, u8 fontId, u8 *str); -u8 DrawKeypadIcon(u8 windowId, u8 keypadIconId, u16 x, u16 y); -u8 GetKeypadIconTileOffset(u8 keypadIconId); -u8 GetKeypadIconWidth(u8 keypadIconId); -u8 GetKeypadIconHeight(u8 keypadIconId); -void SetDefaultFontsPointer(void); -u8 GetFontAttribute(u8 fontId, u8 attributeId); -u8 GetMenuCursorDimensionByFont(u8 fontId, u8 whichDimension); -void DecompressGlyphFont0(u16 glyphId, bool32 isJapanese); -u32 GetGlyphWidthFont0(u16 glyphId, bool32 isJapanese); -void DecompressGlyphFont7(u16 glyphId, bool32 isJapanese); -u32 GetGlyphWidthFont7(u16 glyphId, bool32 isJapanese); -void DecompressGlyphFont8(u16 glyphId, bool32 isJapanese); -u32 GetGlyphWidthFont8(u16 glyphId, bool32 isJapanese); -void DecompressGlyphFont2(u16 glyphId, bool32 isJapanese); -u32 GetGlyphWidthFont2(u16 glyphId, bool32 isJapanese); -void DecompressGlyphFont1(u16 glyphId, bool32 isJapanese); -u32 GetGlyphWidthFont1(u16 glyphId, bool32 isJapanese); -void DecompressGlyphFont9(u16 glyphId); - -// unk_text_util_2.c -u16 Font6Func(struct TextPrinter *textPrinter); -u32 GetGlyphWidthFont6(u16 glyphId, bool32 isJapanese); - -#endif // GUARD_TEXT_H diff --git a/include/window.h b/include/window.h deleted file mode 100644 index 3eac75a28..000000000 --- a/include/window.h +++ /dev/null @@ -1,80 +0,0 @@ -#ifndef GUARD_WINDOW_H -#define GUARD_WINDOW_H - -#define PIXEL_FILL(num) ((num) | ((num) << 4)) - -enum -{ - WINDOW_BG, - WINDOW_TILEMAP_LEFT, - WINDOW_TILEMAP_TOP, - WINDOW_WIDTH, - WINDOW_HEIGHT, - WINDOW_PALETTE_NUM, - WINDOW_BASE_BLOCK, - WINDOW_TILE_DATA -}; - -struct WindowTemplate -{ - u8 bg; - u8 tilemapLeft; - u8 tilemapTop; - u8 width; - u8 height; - u8 paletteNum; - u16 baseBlock; -}; - -#define DUMMY_WIN_TEMPLATE \ -{ \ - 0xFF, \ - 0, \ - 0, \ - 0, \ - 0, \ - 0, \ - 0, \ -} - -#define WINDOW_NONE 0xFF - -struct Window -{ - struct WindowTemplate window; - u8 *tileData; -}; - -bool16 InitWindows(const struct WindowTemplate *templates); -u16 AddWindow(const struct WindowTemplate *template); -int AddWindowWithoutTileMap(const struct WindowTemplate *template); -void RemoveWindow(u8 windowId); -void FreeAllWindowBuffers(void); -void CopyWindowToVram(u8 windowId, u8 mode); -void CopyWindowRectToVram(u32 windowId, u32 mode, u32 x, u32 y, u32 w, u32 h); -void PutWindowTilemap(u8 windowId); -void PutWindowRectTilemapOverridePalette(u8 windowId, u8 x, u8 y, u8 width, u8 height, u8 palette); -void ClearWindowTilemap(u8 windowId); -void PutWindowRectTilemap(u8 windowId, u8 x, u8 y, u8 width, u8 height); -void BlitBitmapToWindow(u8 windowId, const u8 *pixels, u16 x, u16 y, u16 width, u16 height); -void BlitBitmapRectToWindow(u8 windowId, const u8 *pixels, u16 srcX, u16 srcY, u16 srcWidth, int srcHeight, u16 destX, u16 destY, u16 rectWidth, u16 rectHeight); -void FillWindowPixelRect(u8 windowId, u8 fillValue, u16 x, u16 y, u16 width, u16 height); -void CopyToWindowPixelBuffer(u8 windowId, const void *src, u16 size, u16 tileOffset); -void FillWindowPixelBuffer(u8 windowId, u8 fillValue); -void ScrollWindow(u8 windowId, u8 direction, u8 distance, u8 fillValue); -void CallWindowFunction(u8 windowId, void ( *func)(u8, u8, u8, u8, u8, u8)); -bool8 SetWindowAttribute(u8 windowId, u8 attributeId, u32 value); -u32 GetWindowAttribute(u8 windowId, u8 attributeId); -u16 AddWindow8Bit(const struct WindowTemplate *template); -void FillWindowPixelBuffer8Bit(u8 windowId, u8 fillValue); -void FillWindowPixelRect8Bit(u8 windowId, u8 fillValue, u16 x, u16 y, u16 width, u16 height); -void BlitBitmapRectToWindow4BitTo8Bit(u8 windowId, const u8 *pixels, u16 srcX, u16 srcY, u16 srcWidth, int srcHeight, u16 destX, u16 destY, u16 rectWidth, u16 rectHeight, u8 paletteNum); -void CopyWindowToVram8Bit(u8 windowId, u8 mode); - -extern struct Window gWindows[]; -extern void* gWindowBgTilemapBuffers[]; -extern u32 gUnusedWindowVar1; -extern u32 gUnusedWindowVar2; -extern u32 gUnusedWindowVar3; - -#endif // GUARD_WINDOW_H -- cgit v1.2.3 From 0f538102d9f1327cb699261bde969c89e02b3503 Mon Sep 17 00:00:00 2001 From: GriffinR Date: Mon, 5 Jul 2021 13:54:43 -0400 Subject: Add local id constants for C --- include/constants/event_objects.h | 26 ++++++++++++++++++++++++++ 1 file changed, 26 insertions(+) (limited to 'include') diff --git a/include/constants/event_objects.h b/include/constants/event_objects.h index 357251548..1958c792e 100644 --- a/include/constants/event_objects.h +++ b/include/constants/event_objects.h @@ -285,5 +285,31 @@ // Object event local ids referenced in C files #define LOCALID_ROUTE111_PLAYER_FALLING 45 +#define LOCALID_BIRTH_ISLAND_EXTERIOR_ROCK 1 +#define LOCALID_FARAWAY_ISLAND_MEW 1 +#define LOCALID_UNION_ROOM_PLAYER_4 2 +#define LOCALID_UNION_ROOM_PLAYER_8 3 +#define LOCALID_UNION_ROOM_PLAYER_7 4 +#define LOCALID_UNION_ROOM_PLAYER_6 5 +#define LOCALID_UNION_ROOM_PLAYER_5 6 +#define LOCALID_UNION_ROOM_PLAYER_3 7 +#define LOCALID_UNION_ROOM_PLAYER_2 8 +#define LOCALID_UNION_ROOM_PLAYER_1 9 +#define LOCALID_BATTLE_TOWER_LOBBY_REPORTER 5 +#define LOCALID_TRUCK_BOX_TOP 1 +#define LOCALID_TRUCK_BOX_BOTTOM_L 2 +#define LOCALID_TRUCK_BOX_BOTTOM_R 3 +#define LOCALID_OLDALE_MART_CLERK 1 +#define LOCALID_LAVARIDGE_MART_CLERK 1 +#define LOCALID_FALLARBOR_MART_CLERK 1 +#define LOCALID_VERDANTURF_MART_CLERK 1 +#define LOCALID_PETALBURG_MART_CLERK 1 +#define LOCALID_SLATEPORT_MART_CLERK 1 +#define LOCALID_MAUVILLE_MART_CLERK 1 +#define LOCALID_RUSTBORO_MART_CLERK 1 +#define LOCALID_FORTREE_MART_CLERK 1 +#define LOCALID_MOSSDEEP_MART_CLERK 1 +#define LOCALID_SOOTOPOLIS_MART_CLERK 1 +#define LOCALID_BATTLE_FRONTIER_MART_CLERK 1 #endif // GUARD_CONSTANTS_EVENT_OBJECTS_H -- cgit v1.2.3 From bfa824f76104404a6110aed65fe0b29b6697218f Mon Sep 17 00:00:00 2001 From: LOuroboros Date: Fri, 23 Jul 2021 13:18:24 -0300 Subject: Removed unused status ailment constants --- include/constants/pokemon.h | 9 --------- 1 file changed, 9 deletions(-) (limited to 'include') diff --git a/include/constants/pokemon.h b/include/constants/pokemon.h index 51ef0c015..63c031824 100644 --- a/include/constants/pokemon.h +++ b/include/constants/pokemon.h @@ -272,15 +272,6 @@ #define MAX_FRIENDSHIP 0xFF -#define STATUS_PRIMARY_NONE 0 -#define STATUS_PRIMARY_POISON 1 -#define STATUS_PRIMARY_PARALYSIS 2 -#define STATUS_PRIMARY_SLEEP 3 -#define STATUS_PRIMARY_FREEZE 4 -#define STATUS_PRIMARY_BURN 5 -#define STATUS_PRIMARY_POKERUS 6 -#define STATUS_PRIMARY_FAINTED 7 - #define MAX_PER_STAT_IVS 31 #define MAX_IV_MASK 31 #define USE_RANDOM_IVS (MAX_PER_STAT_IVS + 1) -- cgit v1.2.3 From 8012f4b25a5802bbfc0c10e2237b08f268fe114c Mon Sep 17 00:00:00 2001 From: LOuroboros Date: Mon, 26 Jul 2021 20:14:19 -0300 Subject: Re-ordered the hidden item flags list Instead of sorting them by location, it makes more sense to sort them by their value. --- include/constants/flags.h | 140 +++++++++++++++++++++++----------------------- 1 file changed, 70 insertions(+), 70 deletions(-) (limited to 'include') diff --git a/include/constants/flags.h b/include/constants/flags.h index 48606962a..950fd28f1 100644 --- a/include/constants/flags.h +++ b/include/constants/flags.h @@ -535,120 +535,120 @@ #define FLAG_MYSTERY_EVENT_14 0x1F2 #define FLAG_MYSTERY_EVENT_15 0x1F3 -// Hidden Items -- sorted by location +// Hidden Items #define FLAG_HIDDEN_ITEMS_START 0x1F4 +#define FLAG_HIDDEN_ITEM_LAVARIDGE_TOWN_ICE_HEAL (FLAG_HIDDEN_ITEMS_START + 0x00) #define FLAG_HIDDEN_ITEM_TRICK_HOUSE_NUGGET (FLAG_HIDDEN_ITEMS_START + 0x01) +#define FLAG_HIDDEN_ITEM_ROUTE_111_STARDUST (FLAG_HIDDEN_ITEMS_START + 0x02) +#define FLAG_HIDDEN_ITEM_ROUTE_113_ETHER (FLAG_HIDDEN_ITEMS_START + 0x03) +#define FLAG_HIDDEN_ITEM_ROUTE_114_CARBOS (FLAG_HIDDEN_ITEMS_START + 0x04) +#define FLAG_HIDDEN_ITEM_ROUTE_119_CALCIUM (FLAG_HIDDEN_ITEMS_START + 0x05) +#define FLAG_HIDDEN_ITEM_ROUTE_119_ULTRA_BALL (FLAG_HIDDEN_ITEMS_START + 0x06) +#define FLAG_HIDDEN_ITEM_ROUTE_123_SUPER_REPEL (FLAG_HIDDEN_ITEMS_START + 0x07) #define FLAG_HIDDEN_ITEM_UNDERWATER_124_CARBOS (FLAG_HIDDEN_ITEMS_START + 0x08) #define FLAG_HIDDEN_ITEM_UNDERWATER_124_GREEN_SHARD (FLAG_HIDDEN_ITEMS_START + 0x09) #define FLAG_HIDDEN_ITEM_UNDERWATER_124_PEARL (FLAG_HIDDEN_ITEMS_START + 0x0A) #define FLAG_HIDDEN_ITEM_UNDERWATER_124_BIG_PEARL (FLAG_HIDDEN_ITEMS_START + 0x0B) +#define FLAG_HIDDEN_ITEM_UNDERWATER_126_BLUE_SHARD (FLAG_HIDDEN_ITEMS_START + 0x0C) #define FLAG_HIDDEN_ITEM_UNDERWATER_124_HEART_SCALE_1 (FLAG_HIDDEN_ITEMS_START + 0x0D) -#define FLAG_HIDDEN_ITEM_UNDERWATER_124_CALCIUM (FLAG_HIDDEN_ITEMS_START + 0x24) -#define FLAG_HIDDEN_ITEM_UNDERWATER_124_HEART_SCALE_2 (FLAG_HIDDEN_ITEMS_START + 0x26) #define FLAG_HIDDEN_ITEM_UNDERWATER_126_HEART_SCALE (FLAG_HIDDEN_ITEMS_START + 0x0E) #define FLAG_HIDDEN_ITEM_UNDERWATER_126_ULTRA_BALL (FLAG_HIDDEN_ITEMS_START + 0x0F) #define FLAG_HIDDEN_ITEM_UNDERWATER_126_STARDUST (FLAG_HIDDEN_ITEMS_START + 0x10) #define FLAG_HIDDEN_ITEM_UNDERWATER_126_PEARL (FLAG_HIDDEN_ITEMS_START + 0x11) -#define FLAG_HIDDEN_ITEM_UNDERWATER_126_IRON (FLAG_HIDDEN_ITEMS_START + 0x13) #define FLAG_HIDDEN_ITEM_UNDERWATER_126_YELLOW_SHARD (FLAG_HIDDEN_ITEMS_START + 0x12) +#define FLAG_HIDDEN_ITEM_UNDERWATER_126_IRON (FLAG_HIDDEN_ITEMS_START + 0x13) #define FLAG_HIDDEN_ITEM_UNDERWATER_126_BIG_PEARL (FLAG_HIDDEN_ITEMS_START + 0x14) -#define FLAG_HIDDEN_ITEM_UNDERWATER_126_BLUE_SHARD (FLAG_HIDDEN_ITEMS_START + 0x0C) #define FLAG_HIDDEN_ITEM_UNDERWATER_127_STAR_PIECE (FLAG_HIDDEN_ITEMS_START + 0x15) #define FLAG_HIDDEN_ITEM_UNDERWATER_127_HP_UP (FLAG_HIDDEN_ITEMS_START + 0x16) #define FLAG_HIDDEN_ITEM_UNDERWATER_127_HEART_SCALE (FLAG_HIDDEN_ITEMS_START + 0x17) #define FLAG_HIDDEN_ITEM_UNDERWATER_127_RED_SHARD (FLAG_HIDDEN_ITEMS_START + 0x18) #define FLAG_HIDDEN_ITEM_UNDERWATER_128_PROTEIN (FLAG_HIDDEN_ITEMS_START + 0x19) #define FLAG_HIDDEN_ITEM_UNDERWATER_128_PEARL (FLAG_HIDDEN_ITEMS_START + 0x1A) +#define FLAG_HIDDEN_ITEM_LILYCOVE_CITY_HEART_SCALE (FLAG_HIDDEN_ITEMS_START + 0x1B) #define FLAG_HIDDEN_ITEM_FALLARBOR_TOWN_NUGGET (FLAG_HIDDEN_ITEMS_START + 0x1C) -#define FLAG_HIDDEN_ITEM_LAVARIDGE_TOWN_ICE_HEAL (FLAG_HIDDEN_ITEMS_START + 0x00) +#define FLAG_HIDDEN_ITEM_MT_PYRE_EXTERIOR_ULTRA_BALL (FLAG_HIDDEN_ITEMS_START + 0x1D) +#define FLAG_HIDDEN_ITEM_ROUTE_113_TM_32 (FLAG_HIDDEN_ITEMS_START + 0x1E) #define FLAG_HIDDEN_ITEM_ABANDONED_SHIP_RM_1_KEY (FLAG_HIDDEN_ITEMS_START + 0x1F) #define FLAG_HIDDEN_ITEM_ABANDONED_SHIP_RM_2_KEY (FLAG_HIDDEN_ITEMS_START + 0x20) #define FLAG_HIDDEN_ITEM_ABANDONED_SHIP_RM_4_KEY (FLAG_HIDDEN_ITEMS_START + 0x21) #define FLAG_HIDDEN_ITEM_ABANDONED_SHIP_RM_6_KEY (FLAG_HIDDEN_ITEMS_START + 0x22) -#define FLAG_HIDDEN_ITEM_ARTISAN_CAVE_B1F_CALCIUM (FLAG_HIDDEN_ITEMS_START + 0x65) -#define FLAG_HIDDEN_ITEM_ARTISAN_CAVE_B1F_ZINC (FLAG_HIDDEN_ITEMS_START + 0x66) -#define FLAG_HIDDEN_ITEM_ARTISAN_CAVE_B1F_PROTEIN (FLAG_HIDDEN_ITEMS_START + 0x67) -#define FLAG_HIDDEN_ITEM_ARTISAN_CAVE_B1F_IRON (FLAG_HIDDEN_ITEMS_START + 0x68) -#define FLAG_HIDDEN_ITEM_GRANITE_CAVE_B2F_EVERSTONE_1 (FLAG_HIDDEN_ITEMS_START + 0x30) -#define FLAG_HIDDEN_ITEM_GRANITE_CAVE_B2F_EVERSTONE_2 (FLAG_HIDDEN_ITEMS_START + 0x31) -#define FLAG_HIDDEN_ITEM_JAGGED_PASS_GREAT_BALL (FLAG_HIDDEN_ITEMS_START + 0x4C) -#define FLAG_HIDDEN_ITEM_JAGGED_PASS_FULL_HEAL (FLAG_HIDDEN_ITEMS_START + 0x4D) -#define FLAG_HIDDEN_ITEM_LILYCOVE_CITY_HEART_SCALE (FLAG_HIDDEN_ITEMS_START + 0x1B) -#define FLAG_HIDDEN_ITEM_LILYCOVE_CITY_PP_UP (FLAG_HIDDEN_ITEMS_START + 0x2B) -#define FLAG_HIDDEN_ITEM_LILYCOVE_CITY_POKE_BALL (FLAG_HIDDEN_ITEMS_START + 0x4B) -#define FLAG_HIDDEN_ITEM_MT_PYRE_EXTERIOR_ULTRA_BALL (FLAG_HIDDEN_ITEMS_START + 0x1D) -#define FLAG_HIDDEN_ITEM_MT_PYRE_EXTERIOR_MAX_ETHER (FLAG_HIDDEN_ITEMS_START + 0x4E) -#define FLAG_HIDDEN_ITEM_MT_PYRE_SUMMIT_ZINC (FLAG_HIDDEN_ITEMS_START + 0x4F) -#define FLAG_HIDDEN_ITEM_MT_PYRE_SUMMIT_RARE_CANDY (FLAG_HIDDEN_ITEMS_START + 0x50) -#define FLAG_HIDDEN_ITEM_NAVEL_ROCK_TOP_SACRED_ASH (FLAG_HIDDEN_ITEMS_START + 0x6D) -#define FLAG_HIDDEN_ITEM_PETALBURG_CITY_RARE_CANDY (FLAG_HIDDEN_ITEMS_START + 0x5F) -#define FLAG_HIDDEN_ITEM_PETALBURG_WOODS_POTION (FLAG_HIDDEN_ITEMS_START + 0x3A) -#define FLAG_HIDDEN_ITEM_PETALBURG_WOODS_TINY_MUSHROOM_1 (FLAG_HIDDEN_ITEMS_START + 0x3B) -#define FLAG_HIDDEN_ITEM_PETALBURG_WOODS_TINY_MUSHROOM_2 (FLAG_HIDDEN_ITEMS_START + 0x3C) -#define FLAG_HIDDEN_ITEM_PETALBURG_WOODS_POKE_BALL (FLAG_HIDDEN_ITEMS_START + 0x3D) -#define FLAG_HIDDEN_ITEM_VICTORY_ROAD_B2F_ELIXIR (FLAG_HIDDEN_ITEMS_START + 0x52) -#define FLAG_HIDDEN_ITEM_VICTORY_ROAD_B2F_MAX_REPEL (FLAG_HIDDEN_ITEMS_START + 0x53) -#define FLAG_HIDDEN_ITEM_SAFARI_ZONE_NORTH_EAST_RARE_CANDY (FLAG_HIDDEN_ITEMS_START + 0x6A) -#define FLAG_HIDDEN_ITEM_SAFARI_ZONE_NORTH_EAST_ZINC (FLAG_HIDDEN_ITEMS_START + 0x6B) -#define FLAG_HIDDEN_ITEM_SAFARI_ZONE_SOUTH_EAST_PP_UP (FLAG_HIDDEN_ITEMS_START + 0x6C) -#define FLAG_HIDDEN_ITEM_SAFARI_ZONE_SOUTH_EAST_FULL_RESTORE (FLAG_HIDDEN_ITEMS_START + 0x69) #define FLAG_HIDDEN_ITEM_SS_TIDAL_LOWER_DECK_LEFTOVERS (FLAG_HIDDEN_ITEMS_START + 0x23) -#define FLAG_HIDDEN_ITEM_VICTORY_ROAD_1F_ULTRA_BALL (FLAG_HIDDEN_ITEMS_START + 0x51) -#define FLAG_HIDDEN_ITEM_ROUTE_104_SUPER_POTION (FLAG_HIDDEN_ITEMS_START + 0x2C) -#define FLAG_HIDDEN_ITEM_ROUTE_104_POKE_BALL (FLAG_HIDDEN_ITEMS_START + 0x3E) +#define FLAG_HIDDEN_ITEM_UNDERWATER_124_CALCIUM (FLAG_HIDDEN_ITEMS_START + 0x24) #define FLAG_HIDDEN_ITEM_ROUTE_104_POTION (FLAG_HIDDEN_ITEMS_START + 0x25) -#define FLAG_HIDDEN_ITEM_ROUTE_104_ANTIDOTE (FLAG_HIDDEN_ITEMS_START + 0x55) -#define FLAG_HIDDEN_ITEM_ROUTE_104_HEART_SCALE (FLAG_HIDDEN_ITEMS_START + 0x58) -#define FLAG_HIDDEN_ITEM_ROUTE_105_HEART_SCALE (FLAG_HIDDEN_ITEMS_START + 0x59) -#define FLAG_HIDDEN_ITEM_ROUTE_105_BIG_PEARL (FLAG_HIDDEN_ITEMS_START + 0x6F) -#define FLAG_HIDDEN_ITEM_ROUTE_106_POKE_BALL (FLAG_HIDDEN_ITEMS_START + 0x3F) +#define FLAG_HIDDEN_ITEM_UNDERWATER_124_HEART_SCALE_2 (FLAG_HIDDEN_ITEMS_START + 0x26) +#define FLAG_HIDDEN_ITEM_ROUTE_121_HP_UP (FLAG_HIDDEN_ITEMS_START + 0x27) +#define FLAG_HIDDEN_ITEM_ROUTE_121_NUGGET (FLAG_HIDDEN_ITEMS_START + 0x28) +#define FLAG_HIDDEN_ITEM_ROUTE_123_REVIVE (FLAG_HIDDEN_ITEMS_START + 0x29) +#define FLAG_HIDDEN_ITEM_ROUTE_113_REVIVE (FLAG_HIDDEN_ITEMS_START + 0x2A) +#define FLAG_HIDDEN_ITEM_LILYCOVE_CITY_PP_UP (FLAG_HIDDEN_ITEMS_START + 0x2B) +#define FLAG_HIDDEN_ITEM_ROUTE_104_SUPER_POTION (FLAG_HIDDEN_ITEMS_START + 0x2C) +#define FLAG_HIDDEN_ITEM_ROUTE_116_SUPER_POTION (FLAG_HIDDEN_ITEMS_START + 0x2D) #define FLAG_HIDDEN_ITEM_ROUTE_106_STARDUST (FLAG_HIDDEN_ITEMS_START + 0x2E) #define FLAG_HIDDEN_ITEM_ROUTE_106_HEART_SCALE (FLAG_HIDDEN_ITEMS_START + 0x2F) -#define FLAG_HIDDEN_ITEM_ROUTE_108_RARE_CANDY (FLAG_HIDDEN_ITEMS_START + 0x56) +#define FLAG_HIDDEN_ITEM_GRANITE_CAVE_B2F_EVERSTONE_1 (FLAG_HIDDEN_ITEMS_START + 0x30) +#define FLAG_HIDDEN_ITEM_GRANITE_CAVE_B2F_EVERSTONE_2 (FLAG_HIDDEN_ITEMS_START + 0x31) #define FLAG_HIDDEN_ITEM_ROUTE_109_REVIVE (FLAG_HIDDEN_ITEMS_START + 0x32) -#define FLAG_HIDDEN_ITEM_ROUTE_109_HEART_SCALE_1 (FLAG_HIDDEN_ITEMS_START + 0x34) #define FLAG_HIDDEN_ITEM_ROUTE_109_GREAT_BALL (FLAG_HIDDEN_ITEMS_START + 0x33) -#define FLAG_HIDDEN_ITEM_ROUTE_109_ETHER (FLAG_HIDDEN_ITEMS_START + 0x40) -#define FLAG_HIDDEN_ITEM_ROUTE_109_HEART_SCALE_2 (FLAG_HIDDEN_ITEMS_START + 0x5A) -#define FLAG_HIDDEN_ITEM_ROUTE_109_HEART_SCALE_3 (FLAG_HIDDEN_ITEMS_START + 0x5B) -#define FLAG_HIDDEN_ITEM_ROUTE_110_REVIVE (FLAG_HIDDEN_ITEMS_START + 0x36) +#define FLAG_HIDDEN_ITEM_ROUTE_109_HEART_SCALE_1 (FLAG_HIDDEN_ITEMS_START + 0x34) #define FLAG_HIDDEN_ITEM_ROUTE_110_GREAT_BALL (FLAG_HIDDEN_ITEMS_START + 0x35) -#define FLAG_HIDDEN_ITEM_ROUTE_110_POKE_BALL (FLAG_HIDDEN_ITEMS_START + 0x41) +#define FLAG_HIDDEN_ITEM_ROUTE_110_REVIVE (FLAG_HIDDEN_ITEMS_START + 0x36) #define FLAG_HIDDEN_ITEM_ROUTE_110_FULL_HEAL (FLAG_HIDDEN_ITEMS_START + 0x37) -#define FLAG_HIDDEN_ITEM_ROUTE_111_STARDUST (FLAG_HIDDEN_ITEMS_START + 0x02) #define FLAG_HIDDEN_ITEM_ROUTE_111_PROTEIN (FLAG_HIDDEN_ITEMS_START + 0x38) #define FLAG_HIDDEN_ITEM_ROUTE_111_RARE_CANDY (FLAG_HIDDEN_ITEMS_START + 0x39) -#define FLAG_HIDDEN_ITEM_ROUTE_113_ETHER (FLAG_HIDDEN_ITEMS_START + 0x03) -#define FLAG_HIDDEN_ITEM_ROUTE_113_TM_32 (FLAG_HIDDEN_ITEMS_START + 0x1E) -#define FLAG_HIDDEN_ITEM_ROUTE_113_NUGGET (FLAG_HIDDEN_ITEMS_START + 0x62) -#define FLAG_HIDDEN_ITEM_ROUTE_114_CARBOS (FLAG_HIDDEN_ITEMS_START + 0x04) -#define FLAG_HIDDEN_ITEM_ROUTE_113_REVIVE (FLAG_HIDDEN_ITEMS_START + 0x2A) -#define FLAG_HIDDEN_ITEM_ROUTE_115_HEART_SCALE (FLAG_HIDDEN_ITEMS_START + 0x61) -#define FLAG_HIDDEN_ITEM_ROUTE_116_SUPER_POTION (FLAG_HIDDEN_ITEMS_START + 0x2D) -#define FLAG_HIDDEN_ITEM_ROUTE_116_BLACK_GLASSES (FLAG_HIDDEN_ITEMS_START + 0x60) -#define FLAG_HIDDEN_ITEM_ROUTE_117_REPEL (FLAG_HIDDEN_ITEMS_START + 0x48) +#define FLAG_HIDDEN_ITEM_PETALBURG_WOODS_POTION (FLAG_HIDDEN_ITEMS_START + 0x3A) +#define FLAG_HIDDEN_ITEM_PETALBURG_WOODS_TINY_MUSHROOM_1 (FLAG_HIDDEN_ITEMS_START + 0x3B) +#define FLAG_HIDDEN_ITEM_PETALBURG_WOODS_TINY_MUSHROOM_2 (FLAG_HIDDEN_ITEMS_START + 0x3C) +#define FLAG_HIDDEN_ITEM_PETALBURG_WOODS_POKE_BALL (FLAG_HIDDEN_ITEMS_START + 0x3D) +#define FLAG_HIDDEN_ITEM_ROUTE_104_POKE_BALL (FLAG_HIDDEN_ITEMS_START + 0x3E) +#define FLAG_HIDDEN_ITEM_ROUTE_106_POKE_BALL (FLAG_HIDDEN_ITEMS_START + 0x3F) +#define FLAG_HIDDEN_ITEM_ROUTE_109_ETHER (FLAG_HIDDEN_ITEMS_START + 0x40) +#define FLAG_HIDDEN_ITEM_ROUTE_110_POKE_BALL (FLAG_HIDDEN_ITEMS_START + 0x41) #define FLAG_HIDDEN_ITEM_ROUTE_118_HEART_SCALE (FLAG_HIDDEN_ITEMS_START + 0x42) #define FLAG_HIDDEN_ITEM_ROUTE_118_IRON (FLAG_HIDDEN_ITEMS_START + 0x43) -#define FLAG_HIDDEN_ITEM_ROUTE_119_CALCIUM (FLAG_HIDDEN_ITEMS_START + 0x05) -#define FLAG_HIDDEN_ITEM_ROUTE_119_ULTRA_BALL (FLAG_HIDDEN_ITEMS_START + 0x06) #define FLAG_HIDDEN_ITEM_ROUTE_119_FULL_HEAL (FLAG_HIDDEN_ITEMS_START + 0x44) -#define FLAG_HIDDEN_ITEM_ROUTE_119_MAX_ETHER (FLAG_HIDDEN_ITEMS_START + 0x57) -#define FLAG_HIDDEN_ITEM_ROUTE_120_RARE_CANDY_1 (FLAG_HIDDEN_ITEMS_START + 0x47) -#define FLAG_HIDDEN_ITEM_ROUTE_120_REVIVE (FLAG_HIDDEN_ITEMS_START + 0x54) #define FLAG_HIDDEN_ITEM_ROUTE_120_RARE_CANDY_2 (FLAG_HIDDEN_ITEMS_START + 0x45) #define FLAG_HIDDEN_ITEM_ROUTE_120_ZINC (FLAG_HIDDEN_ITEMS_START + 0x46) -#define FLAG_HIDDEN_ITEM_ROUTE_121_HP_UP (FLAG_HIDDEN_ITEMS_START + 0x27) -#define FLAG_HIDDEN_ITEM_ROUTE_121_NUGGET (FLAG_HIDDEN_ITEMS_START + 0x28) +#define FLAG_HIDDEN_ITEM_ROUTE_120_RARE_CANDY_1 (FLAG_HIDDEN_ITEMS_START + 0x47) +#define FLAG_HIDDEN_ITEM_ROUTE_117_REPEL (FLAG_HIDDEN_ITEMS_START + 0x48) #define FLAG_HIDDEN_ITEM_ROUTE_121_FULL_HEAL (FLAG_HIDDEN_ITEMS_START + 0x49) -#define FLAG_HIDDEN_ITEM_ROUTE_121_MAX_REVIVE (FLAG_HIDDEN_ITEMS_START + 0x64) -#define FLAG_HIDDEN_ITEM_ROUTE_123_SUPER_REPEL (FLAG_HIDDEN_ITEMS_START + 0x07) -#define FLAG_HIDDEN_ITEM_ROUTE_123_REVIVE (FLAG_HIDDEN_ITEMS_START + 0x29) #define FLAG_HIDDEN_ITEM_ROUTE_123_HYPER_POTION (FLAG_HIDDEN_ITEMS_START + 0x4A) -#define FLAG_HIDDEN_ITEM_ROUTE_123_PP_UP (FLAG_HIDDEN_ITEMS_START + 0x63) -#define FLAG_HIDDEN_ITEM_ROUTE_123_RARE_CANDY (FLAG_HIDDEN_ITEMS_START + 0x6E) +#define FLAG_HIDDEN_ITEM_LILYCOVE_CITY_POKE_BALL (FLAG_HIDDEN_ITEMS_START + 0x4B) +#define FLAG_HIDDEN_ITEM_JAGGED_PASS_GREAT_BALL (FLAG_HIDDEN_ITEMS_START + 0x4C) +#define FLAG_HIDDEN_ITEM_JAGGED_PASS_FULL_HEAL (FLAG_HIDDEN_ITEMS_START + 0x4D) +#define FLAG_HIDDEN_ITEM_MT_PYRE_EXTERIOR_MAX_ETHER (FLAG_HIDDEN_ITEMS_START + 0x4E) +#define FLAG_HIDDEN_ITEM_MT_PYRE_SUMMIT_ZINC (FLAG_HIDDEN_ITEMS_START + 0x4F) +#define FLAG_HIDDEN_ITEM_MT_PYRE_SUMMIT_RARE_CANDY (FLAG_HIDDEN_ITEMS_START + 0x50) +#define FLAG_HIDDEN_ITEM_VICTORY_ROAD_1F_ULTRA_BALL (FLAG_HIDDEN_ITEMS_START + 0x51) +#define FLAG_HIDDEN_ITEM_VICTORY_ROAD_B2F_ELIXIR (FLAG_HIDDEN_ITEMS_START + 0x52) +#define FLAG_HIDDEN_ITEM_VICTORY_ROAD_B2F_MAX_REPEL (FLAG_HIDDEN_ITEMS_START + 0x53) +#define FLAG_HIDDEN_ITEM_ROUTE_120_REVIVE (FLAG_HIDDEN_ITEMS_START + 0x54) +#define FLAG_HIDDEN_ITEM_ROUTE_104_ANTIDOTE (FLAG_HIDDEN_ITEMS_START + 0x55) +#define FLAG_HIDDEN_ITEM_ROUTE_108_RARE_CANDY (FLAG_HIDDEN_ITEMS_START + 0x56) +#define FLAG_HIDDEN_ITEM_ROUTE_119_MAX_ETHER (FLAG_HIDDEN_ITEMS_START + 0x57) +#define FLAG_HIDDEN_ITEM_ROUTE_104_HEART_SCALE (FLAG_HIDDEN_ITEMS_START + 0x58) +#define FLAG_HIDDEN_ITEM_ROUTE_105_HEART_SCALE (FLAG_HIDDEN_ITEMS_START + 0x59) +#define FLAG_HIDDEN_ITEM_ROUTE_109_HEART_SCALE_2 (FLAG_HIDDEN_ITEMS_START + 0x5A) +#define FLAG_HIDDEN_ITEM_ROUTE_109_HEART_SCALE_3 (FLAG_HIDDEN_ITEMS_START + 0x5B) #define FLAG_HIDDEN_ITEM_ROUTE_128_HEART_SCALE_1 (FLAG_HIDDEN_ITEMS_START + 0x5C) #define FLAG_HIDDEN_ITEM_ROUTE_128_HEART_SCALE_2 (FLAG_HIDDEN_ITEMS_START + 0x5D) #define FLAG_HIDDEN_ITEM_ROUTE_128_HEART_SCALE_3 (FLAG_HIDDEN_ITEMS_START + 0x5E) +#define FLAG_HIDDEN_ITEM_PETALBURG_CITY_RARE_CANDY (FLAG_HIDDEN_ITEMS_START + 0x5F) +#define FLAG_HIDDEN_ITEM_ROUTE_116_BLACK_GLASSES (FLAG_HIDDEN_ITEMS_START + 0x60) +#define FLAG_HIDDEN_ITEM_ROUTE_115_HEART_SCALE (FLAG_HIDDEN_ITEMS_START + 0x61) +#define FLAG_HIDDEN_ITEM_ROUTE_113_NUGGET (FLAG_HIDDEN_ITEMS_START + 0x62) +#define FLAG_HIDDEN_ITEM_ROUTE_123_PP_UP (FLAG_HIDDEN_ITEMS_START + 0x63) +#define FLAG_HIDDEN_ITEM_ROUTE_121_MAX_REVIVE (FLAG_HIDDEN_ITEMS_START + 0x64) +#define FLAG_HIDDEN_ITEM_ARTISAN_CAVE_B1F_CALCIUM (FLAG_HIDDEN_ITEMS_START + 0x65) +#define FLAG_HIDDEN_ITEM_ARTISAN_CAVE_B1F_ZINC (FLAG_HIDDEN_ITEMS_START + 0x66) +#define FLAG_HIDDEN_ITEM_ARTISAN_CAVE_B1F_PROTEIN (FLAG_HIDDEN_ITEMS_START + 0x67) +#define FLAG_HIDDEN_ITEM_ARTISAN_CAVE_B1F_IRON (FLAG_HIDDEN_ITEMS_START + 0x68) +#define FLAG_HIDDEN_ITEM_SAFARI_ZONE_SOUTH_EAST_FULL_RESTORE (FLAG_HIDDEN_ITEMS_START + 0x69) +#define FLAG_HIDDEN_ITEM_SAFARI_ZONE_NORTH_EAST_RARE_CANDY (FLAG_HIDDEN_ITEMS_START + 0x6A) +#define FLAG_HIDDEN_ITEM_SAFARI_ZONE_NORTH_EAST_ZINC (FLAG_HIDDEN_ITEMS_START + 0x6B) +#define FLAG_HIDDEN_ITEM_SAFARI_ZONE_SOUTH_EAST_PP_UP (FLAG_HIDDEN_ITEMS_START + 0x6C) +#define FLAG_HIDDEN_ITEM_NAVEL_ROCK_TOP_SACRED_ASH (FLAG_HIDDEN_ITEMS_START + 0x6D) +#define FLAG_HIDDEN_ITEM_ROUTE_123_RARE_CANDY (FLAG_HIDDEN_ITEMS_START + 0x6E) +#define FLAG_HIDDEN_ITEM_ROUTE_105_BIG_PEARL (FLAG_HIDDEN_ITEMS_START + 0x6F) #define FLAG_UNUSED_0x264 0x264 // Unused Flag #define FLAG_UNUSED_0x265 0x265 // Unused Flag -- cgit v1.2.3