Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[pokedex_plus] refactor #if to C if #3445

Merged
merged 4 commits into from
Oct 22, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -345,6 +345,7 @@ $(C_BUILDDIR)/librfu_intr.o: CC1 := tools/agbcc/bin/agbcc_arm$(EXE)
$(C_BUILDDIR)/librfu_intr.o: CFLAGS := -O2 -mthumb-interwork -quiet
else
$(C_BUILDDIR)/librfu_intr.o: CFLAGS := -mthumb-interwork -O2 -mabi=apcs-gnu -mtune=arm7tdmi -march=armv4t -fno-toplevel-reorder -Wno-pointer-to-int-cast
$(C_BUILDDIR)/pokedex_plus_hgss.o: CFLAGS := -mthumb -mthumb-interwork -O2 -mabi=apcs-gnu -mtune=arm7tdmi -march=armv4t -Wno-pointer-to-int-cast -std=gnu17 -Werror -Wall -Wno-strict-aliasing -Wno-attribute-alias
endif

ifeq ($(DINFO),1)
Expand Down
30 changes: 15 additions & 15 deletions graphics/pokedex/bg_hoenn.pal
Original file line number Diff line number Diff line change
@@ -1,21 +1,21 @@
JASC-PAL
0100
48
193 33 177
249 249 249
225 225 225
201 201 201
169 169 169
129 129 129
249 153 161
233 49 49
193 33 41
145 17 33
249 153 161
193 33 41
141 251 184
52 66 162
194 181 66
123 131 0
255 255 255
222 222 222
189 189 189
164 164 164
98 98 115
41 57 65
41 57 106
0 0 41
255 255 255
238 246 57
255 0 189
49 213 74
24 131 32
189 156 90
0 0 0
123 131 0
255 255 255
Expand Down
30 changes: 15 additions & 15 deletions graphics/pokedex/caught_screen.pal
Original file line number Diff line number Diff line change
@@ -1,21 +1,21 @@
JASC-PAL
0100
48
193 33 177
249 249 249
225 225 225
201 201 201
169 169 169
129 129 129
249 153 161
233 49 49
193 33 41
145 17 33
249 153 161
193 33 41
141 251 184
52 66 162
194 181 66
123 131 0
255 255 255
255 238 0
255 189 0
255 115 0
98 98 115
41 57 65
41 57 106
0 0 41
255 255 255
238 246 57
255 0 189
49 213 74
24 131 32
189 156 90
0 0 0
123 131 0
255 255 255
Expand Down
35 changes: 0 additions & 35 deletions include/graphics.h
Original file line number Diff line number Diff line change
Expand Up @@ -7842,41 +7842,6 @@ extern const u32 gPokedexSearchMenu_Gfx[];
extern const u32 gPokedexSearchMenuHoenn_Tilemap[];
extern const u32 gPokedexSearchMenuNational_Tilemap[];
extern const u16 gPokedexSearchMenu_Pal[];
// pokedex HGSS
#if POKEDEX_PLUS_HGSS == TRUE
extern const u16 gPokedexPlusHGSS_Default_Pal[];
extern const u16 gPokedexPlusHGSS_National_Pal[];
extern const u16 gPokedexPlusHGSS_MenuSearch_Pal[];
extern const u16 gPokedexPlusHGSS_SearchResults_Pal[];
extern const u16 gPokedexPlusHGSS_Default_dark_Pal[];
extern const u16 gPokedexPlusHGSS_National_dark_Pal[];
extern const u16 gPokedexPlusHGSS_MenuSearch_dark_Pal[];
extern const u16 gPokedexPlusHGSS_SearchResults_dark_Pal[];
extern const u32 gPokedexPlusHGSS_MenuList_Gfx[];
extern const u32 gPokedexPlusHGSS_MenuList_DECA_Gfx[];
extern const u32 gPokedexPlusHGSS_Interface_Gfx[];
extern const u32 gPokedexPlusHGSS_Interface_DECA_Gfx[];
extern const u32 gPokedexPlusHGSS_Menu_1_Gfx[];
extern const u32 gPokedexPlusHGSS_Menu_2_Gfx[];
extern const u32 gPokedexPlusHGSS_Menu_3_Gfx[];
extern const u32 gPokedexPlusHGSS_MenuSearch_Gfx[];
extern const u32 gPokedexPlusHGSS_MenuSearch_DECA_Gfx[];
extern const u32 gPokedexPlusHGSS_StartMenuMain_Tilemap[];
extern const u32 gPokedexPlusHGSS_StartMenuSearchResults_Tilemap[];
extern const u32 gPokedexPlusHGSS_ScreenSelectBarSubmenu_Tilemap[];
extern const u32 gPokedexPlusHGSS_ScreenSelectBarSubmenu_Tilemap_Clear[];
extern const u32 gPokedexPlusHGSS_ScreenList_Tilemap[];
extern const u32 gPokedexPlusHGSS_ScreenListUnderlay_Tilemap[];
extern const u32 gPokedexPlusHGSS_ScreenInfo_Tilemap[];
extern const u32 gPokedexPlusHGSS_ScreenStats_Tilemap[];
extern const u32 gPokedexPlusHGSS_ScreenEvolution_Tilemap[];
extern const u32 gPokedexPlusHGSS_ScreenEvolution_Tilemap_PE[];
extern const u32 gPokedexPlusHGSS_ScreenForms_Tilemap[];
extern const u32 gPokedexPlusHGSS_ScreenCry_Tilemap[];
extern const u32 gPokedexPlusHGSS_ScreenSize_Tilemap[];
extern const u32 gPokedexPlusHGSS_ScreenSearchHoenn_Tilemap[];
extern const u32 gPokedexPlusHGSS_ScreenSearchNational_Tilemap[];
#endif

// berry tag screen
extern const u32 gBerryCheck_Gfx[];
Expand Down
3 changes: 0 additions & 3 deletions include/pokedex_plus_hgss.h
Original file line number Diff line number Diff line change
@@ -1,10 +1,7 @@
#ifndef GUARD_POKEDEX_PLUS_HGSS_H
#define GUARD_POKEDEX_PLUS_HGSS_H

#if POKEDEX_PLUS_HGSS == TRUE
void CB2_OpenPokedexPlusHGSS(void);
u16 NationalPokedexNumToSpeciesHGSS(u16 nationalNum);
void Task_DisplayCaughtMonDexPageHGSS(u8);
#endif

#endif // GUARD_POKEDEX_PLUS_HGSS_H
128 changes: 0 additions & 128 deletions include/strings.h
Original file line number Diff line number Diff line change
Expand Up @@ -538,134 +538,6 @@ extern const u8 gText_SearchingPleaseWait[];
extern const u8 gText_SearchCompleted[];
extern const u8 gText_NoMatchingPkmnWereFound[];
extern const u8 gText_SelectorArrow[];
//PokedexPlus HGSS_Ui
#if POKEDEX_PLUS_HGSS == TRUE
extern const u8 gText_Stats_Buttons[];
extern const u8 gText_Stats_Buttons_Decapped[];
extern const u8 gText_Stats_HP[];
extern const u8 gText_Stats_Attack[];
extern const u8 gText_Stats_Defense[];
extern const u8 gText_Stats_Speed[];
extern const u8 gText_Stats_SpAttack[];
extern const u8 gText_Stats_SpDefense[];
extern const u8 gText_Stats_EV_Plus1[];
extern const u8 gText_Stats_EV_Plus2[];
extern const u8 gText_Stats_EV_Plus3[];
extern const u8 gText_Stats_EvStr1Str2[];
extern const u8 gText_Stats_MoveSelectedMax[];
extern const u8 gText_Stats_MoveLevel[];
extern const u8 gText_Stats_Gender_0[];
extern const u8 gText_Stats_Gender_12_5[];
extern const u8 gText_Stats_Gender_25[];
extern const u8 gText_Stats_Gender_50[];
extern const u8 gText_Stats_Gender_75[];
extern const u8 gText_Stats_Gender_87_5[];
extern const u8 gText_Stats_Gender_100[];
extern const u8 gText_Stats_CatchRate[];
extern const u8 gText_Stats_CatchRate_Legend[];
extern const u8 gText_Stats_CatchRate_VeryHard[];
extern const u8 gText_Stats_CatchRate_Difficult[];
extern const u8 gText_Stats_CatchRate_Medium[];
extern const u8 gText_Stats_CatchRate_Relaxed[];
extern const u8 gText_Stats_CatchRate_Easy[];
extern const u8 gText_Stats_ExpYield[];
extern const u8 gText_Stats_EggCycles[];
extern const u8 gText_Stats_EggCycles_VeryFast[];
extern const u8 gText_Stats_EggCycles_Fast[];
extern const u8 gText_Stats_EggCycles_Normal[];
extern const u8 gText_Stats_EggCycles_Slow[];
extern const u8 gText_Stats_Growthrate[];
extern const u8 gText_Stats_Friendship[];
extern const u8 gText_Stats_Friendship_BigAnger[];
extern const u8 gText_Stats_Friendship_Neutral[];
extern const u8 gText_Stats_Friendship_Happy[];
extern const u8 gText_Stats_Friendship_BigSmile[];
extern const u8 gText_Stats_MEDIUM_FAST[];
extern const u8 gText_Stats_ERRATIC[];
extern const u8 gText_Stats_FLUCTUATING[];
extern const u8 gText_Stats_MEDIUM_SLOW[];
extern const u8 gText_Stats_FAST[];
extern const u8 gText_Stats_SLOW[];
extern const u8 gText_Stats_ContestHeart[];
extern const u8 gText_PlusSymbol[];
extern const u8 gText_Stats_Minus[];
extern const u8 gText_Stats_eggGroup[];
extern const u8 gText_Stats_eggGroup_Groups[];
extern const u8 gText_Stats_eggGroup_MONSTER[];
extern const u8 gText_Stats_eggGroup_WATER_1[];
extern const u8 gText_Stats_eggGroup_BUG[];
extern const u8 gText_Stats_eggGroup_FLYING[];
extern const u8 gText_Stats_eggGroup_FIELD[];
extern const u8 gText_Stats_eggGroup_FAIRY[];
extern const u8 gText_Stats_eggGroup_GRASS[];
extern const u8 gText_Stats_eggGroup_HUMAN_LIKE[];
extern const u8 gText_Stats_eggGroup_WATER_3[];
extern const u8 gText_Stats_eggGroup_MINERAL[];
extern const u8 gText_Stats_eggGroup_AMORPHOUS[];
extern const u8 gText_Stats_eggGroup_WATER_2[];
extern const u8 gText_Stats_eggGroup_DITTO[];
extern const u8 gText_Stats_eggGroup_DRAGON[];
extern const u8 gText_Stats_eggGroup_UNDISCOVERED[];
extern const u8 gText_Dex_SEEN[];
extern const u8 gText_Dex_OWN[];

extern const u8 gText_EVO_Buttons[];
extern const u8 gText_EVO_Buttons_Decapped[];
extern const u8 gText_EVO_Buttons_PE[];
extern const u8 gText_EVO_Buttons_Decapped_PE[];
extern const u8 gText_EVO_Name[];
extern const u8 gText_EVO_PreEvo[];
extern const u8 gText_EVO_PreEvo_PE_Mega[];
extern const u8 gText_EVO_FRIENDSHIP[];
extern const u8 gText_EVO_FRIENDSHIP_DAY[];
extern const u8 gText_EVO_FRIENDSHIP_NIGHT[];
extern const u8 gText_EVO_FRIENDSHIP_MOVE_TYPE[];
extern const u8 gText_EVO_LEVEL[];
extern const u8 gText_EVO_TRADE[];
extern const u8 gText_EVO_TRADE_ITEM[];
extern const u8 gText_EVO_ITEM[];
extern const u8 gText_EVO_LEVEL_ATK_GT_DEF[];
extern const u8 gText_EVO_LEVEL_ATK_EQ_DEF[];
extern const u8 gText_EVO_LEVEL_ATK_LT_DEF[];
extern const u8 gText_EVO_LEVEL_SILCOON[];
extern const u8 gText_EVO_LEVEL_CASCOON[];
extern const u8 gText_EVO_LEVEL_NINJASK[];
extern const u8 gText_EVO_LEVEL_SHEDINJA[];
extern const u8 gText_EVO_BEAUTY[];
extern const u8 gText_EVO_LEVEL_FEMALE[];
extern const u8 gText_EVO_LEVEL_MALE[];
extern const u8 gText_EVO_LEVEL_NIGHT[];
extern const u8 gText_EVO_LEVEL_DAY[];
extern const u8 gText_EVO_LEVEL_DUSK[];
extern const u8 gText_EVO_ITEM_HOLD_DAY[];
extern const u8 gText_EVO_ITEM_HOLD_NIGHT[];
extern const u8 gText_EVO_MOVE[];
extern const u8 gText_EVO_MAPSEC[];
extern const u8 gText_EVO_ITEM_MALE[];
extern const u8 gText_EVO_ITEM_FEMALE[];
extern const u8 gText_EVO_LEVEL_RAIN[];
extern const u8 gText_EVO_SPECIFIC_MON_IN_PARTY[];
extern const u8 gText_EVO_LEVEL_DARK_TYPE_MON_IN_PARTY[];
extern const u8 gText_EVO_TRADE_SPECIFIC_MON[];
extern const u8 gText_EVO_SPECIFIC_MAP[];
extern const u8 gText_EVO_LEVEL_NATURE_AMPED[];
extern const u8 gText_EVO_LEVEL_NATURE_LOW_KEY[];
extern const u8 gText_EVO_CRITICAL_HITS[];
extern const u8 gText_EVO_SCRIPT_TRIGGER_DMG[];
extern const u8 gText_EVO_DARK_SCROLL[];
extern const u8 gText_EVO_WATER_SCROLL[];
extern const u8 gText_EVO_ITEM_NIGHT[];
extern const u8 gText_EVO_ITEM_DAY[];
extern const u8 gText_EVO_ITEM_HOLD[];
extern const u8 gText_EVO_UNKNOWN[];
extern const u8 gText_EVO_NONE[];

extern const u8 gText_FORMS_Buttons_PE[];
extern const u8 gText_FORMS_Buttons_Decapped_PE[];
extern const u8 gText_FORMS_Buttons_Submenu_PE[];
extern const u8 gText_FORMS_Buttons_Submenu_Decapped_PE[];
extern const u8 gText_FORMS_NONE[];
#endif

// birch dex rating text
extern const u8 gBirchDexRatingText_LessThan10[];
Expand Down
2 changes: 1 addition & 1 deletion src/daycare.c
Original file line number Diff line number Diff line change
Expand Up @@ -1076,7 +1076,7 @@ static void _GiveEggFromDaycare(struct DayCare *daycare)
{
struct Pokemon egg;
u16 species;
u8 parentSlots[DAYCARE_MON_COUNT];
u8 parentSlots[DAYCARE_MON_COUNT] = {0};
bool8 isEgg;

species = DetermineEggSpeciesAndParentSlots(daycare, parentSlots);
Expand Down
35 changes: 0 additions & 35 deletions src/graphics.c
Original file line number Diff line number Diff line change
Expand Up @@ -1739,41 +1739,6 @@ const u16 gPokedexSearchMenu_Pal[] = INCBIN_U16("graphics/pokedex/search_menu.gb
const u32 gPokedexSearchMenu_Gfx[] = INCBIN_U32("graphics/pokedex/search_menu.4bpp.lz");
const u32 gPokedexSearchMenuNational_Tilemap[] = INCBIN_U32("graphics/pokedex/search_menu_national.bin.lz");
const u32 gPokedexSearchMenuHoenn_Tilemap[] = INCBIN_U32("graphics/pokedex/search_menu_hoenn.bin.lz");
// Pokedex HGSS
#if POKEDEX_PLUS_HGSS == TRUE
const u16 gPokedexPlusHGSS_Default_Pal[] = INCBIN_U16("graphics/pokedex/hgss/palette_default.gbapal");
const u16 gPokedexPlusHGSS_National_Pal[] = INCBIN_U16("graphics/pokedex/hgss/palette_national.gbapal");
const u16 gPokedexPlusHGSS_MenuSearch_Pal[] = INCBIN_U16("graphics/pokedex/hgss/palette_search_menu.gbapal");
const u16 gPokedexPlusHGSS_SearchResults_Pal[] = INCBIN_U16("graphics/pokedex/hgss/palette_search_results.gbapal");
const u16 gPokedexPlusHGSS_Default_dark_Pal[] = INCBIN_U16("graphics/pokedex/hgss/palette_default_dark.gbapal");
const u16 gPokedexPlusHGSS_National_dark_Pal[] = INCBIN_U16("graphics/pokedex/hgss/palette_national_dark.gbapal");
const u16 gPokedexPlusHGSS_MenuSearch_dark_Pal[] = INCBIN_U16("graphics/pokedex/hgss/palette_search_menu_dark.gbapal");
const u16 gPokedexPlusHGSS_SearchResults_dark_Pal[] = INCBIN_U16("graphics/pokedex/hgss/palette_search_results_dark.gbapal");
const u32 gPokedexPlusHGSS_MenuList_Gfx[] = INCBIN_U32("graphics/pokedex/hgss/tileset_menu_list.4bpp.lz");
const u32 gPokedexPlusHGSS_MenuList_DECA_Gfx[] = INCBIN_U32("graphics/pokedex/hgss/tileset_menu_list_DECA.4bpp.lz");
const u32 gPokedexPlusHGSS_Interface_Gfx[] = INCBIN_U32("graphics/pokedex/hgss/tileset_interface.4bpp.lz");
const u32 gPokedexPlusHGSS_Interface_DECA_Gfx[] = INCBIN_U32("graphics/pokedex/hgss/tileset_interface_DECA.4bpp.lz");
const u32 gPokedexPlusHGSS_Menu_1_Gfx[] = INCBIN_U32("graphics/pokedex/hgss/tileset_menu1.4bpp.lz");
const u32 gPokedexPlusHGSS_Menu_2_Gfx[] = INCBIN_U32("graphics/pokedex/hgss/tileset_menu2.4bpp.lz");
const u32 gPokedexPlusHGSS_Menu_3_Gfx[] = INCBIN_U32("graphics/pokedex/hgss/tileset_menu3.4bpp.lz");
const u32 gPokedexPlusHGSS_MenuSearch_Gfx[] = INCBIN_U32("graphics/pokedex/hgss/tileset_menu_search.4bpp.lz");
const u32 gPokedexPlusHGSS_MenuSearch_DECA_Gfx[] = INCBIN_U32("graphics/pokedex/hgss/tileset_menu_search_DECA.4bpp.lz");
const u32 gPokedexPlusHGSS_StartMenuMain_Tilemap[] = INCBIN_U32("graphics/pokedex/hgss/tilemap_start_menu.bin.lz");
const u32 gPokedexPlusHGSS_StartMenuSearchResults_Tilemap[] = INCBIN_U32("graphics/pokedex/hgss/tilemap_start_menu_search_results.bin.lz");
const u32 gPokedexPlusHGSS_ScreenSelectBarSubmenu_Tilemap[] = INCBIN_U32("graphics/pokedex/hgss/SelectBar.bin.lz");
const u32 gPokedexPlusHGSS_ScreenSelectBarSubmenu_Tilemap_Clear[] = INCBIN_U32("graphics/pokedex/hgss/SelectBar_clear.bin.lz");
const u32 gPokedexPlusHGSS_ScreenList_Tilemap[] = INCBIN_U32("graphics/pokedex/hgss/tilemap_list_screen.bin.lz");
const u32 gPokedexPlusHGSS_ScreenListUnderlay_Tilemap[] = INCBIN_U32("graphics/pokedex/hgss/tilemap_list_screen_underlay.bin.lz");
const u32 gPokedexPlusHGSS_ScreenInfo_Tilemap[] = INCBIN_U32("graphics/pokedex/hgss/tilemap_info_screen.bin.lz");
const u32 gPokedexPlusHGSS_ScreenStats_Tilemap[] = INCBIN_U32("graphics/pokedex/hgss/tilemap_stats_screen.bin.lz");
const u32 gPokedexPlusHGSS_ScreenEvolution_Tilemap[] = INCBIN_U32("graphics/pokedex/hgss/tilemap_evo_screen.bin.lz");
const u32 gPokedexPlusHGSS_ScreenEvolution_Tilemap_PE[] = INCBIN_U32("graphics/pokedex/hgss/tilemap_evo_screen_PE.bin.lz");
const u32 gPokedexPlusHGSS_ScreenForms_Tilemap[] = INCBIN_U32("graphics/pokedex/hgss/tilemap_forms_screen.bin.lz");
const u32 gPokedexPlusHGSS_ScreenCry_Tilemap[] = INCBIN_U32("graphics/pokedex/hgss/tilemap_cry_screen.bin.lz");
const u32 gPokedexPlusHGSS_ScreenSize_Tilemap[] = INCBIN_U32("graphics/pokedex/hgss/tilemap_size_screen.bin.lz");
const u32 gPokedexPlusHGSS_ScreenSearchHoenn_Tilemap[] = INCBIN_U32("graphics/pokedex/hgss/tilemap_search_screen_hoenn.bin.lz");
const u32 gPokedexPlusHGSS_ScreenSearchNational_Tilemap[] = INCBIN_U32("graphics/pokedex/hgss/tilemap_search_screen_national.bin.lz");
#endif

const u16 gSummaryScreen_MoveEffect_Battle_Tilemap[] = INCBIN_U16("graphics/summary_screen/effect_battle.bin");
const u16 gSummaryScreen_MoveEffect_Contest_Tilemap[] = INCBIN_U16("graphics/summary_screen/effect_contest.bin");
Expand Down
14 changes: 7 additions & 7 deletions src/pokedex.c
Original file line number Diff line number Diff line change
Expand Up @@ -1591,10 +1591,11 @@ static void ResetPokedexView(struct PokedexView *pokedexView)

void CB2_OpenPokedex(void)
{
#if POKEDEX_PLUS_HGSS == TRUE
CB2_OpenPokedexPlusHGSS();
return;
#endif
if (POKEDEX_PLUS_HGSS)
{
CB2_OpenPokedexPlusHGSS();
return;
}

switch (gMain.state)
{
Expand Down Expand Up @@ -3944,11 +3945,10 @@ static void HighlightSubmenuScreenSelectBarItem(u8 a, u16 b)
u8 DisplayCaughtMonDexPage(u16 dexNum, u32 otId, u32 personality)
{
u8 taskId = 0;
#if POKEDEX_PLUS_HGSS
if (POKEDEX_PLUS_HGSS)
taskId = CreateTask(Task_DisplayCaughtMonDexPageHGSS, 0);
#else
else
taskId = CreateTask(Task_DisplayCaughtMonDexPage, 0);
#endif // POKEDEX_PLUS_HGSS

gTasks[taskId].tState = 0;
gTasks[taskId].tDexNum = dexNum;
Expand Down
Loading
Loading