diff --git a/.gitignore b/.gitignore
index b10f4ccc31..2754191b10 100644
--- a/.gitignore
+++ b/.gitignore
@@ -21,7 +21,6 @@ sound/**/*.bin
sound/songs/midi/*.s
tools/agbcc
*.map
-*.ld
*.bat
*.dump
*.sa*
diff --git a/INSTALL.md b/INSTALL.md
index a76d0acc75..920e03c713 100644
--- a/INSTALL.md
+++ b/INSTALL.md
@@ -150,9 +150,9 @@ Note that in msys2, Copy is Ctrl+Insert and Paste is Shift+Insert.
Notes...
- > Note 1: While not shown, msys uses forward slashes `/` instead of backwards slashes `\` as the directory separator.
- > Note 2: If the path has spaces, then the path must be wrapped with quotations, e.g. `cd "Downloads/My Downloads"`.
- > Note 3: Windows path names are case-insensitive so adhering to capitalization isn’t needed.
+ > Note 1: While not shown, msys uses forward slashes `/` instead of backwards slashes `\` as the directory separator.
+ > Note 2: If the path has spaces, then the path must be wrapped with quotations, e.g. `cd "Downloads/My Downloads"`.
+ > Note 3: Windows path names are case-insensitive so adhering to capitalization isn’t needed.
> Note 4: If libpng was saved elsewhere, you will need to specify the full path to where libpng was downloaded, e.g. `cd c:/devkitpro/msys2` if it was saved there.
diff --git a/Makefile b/Makefile
index 720255de06..4405d9cf13 100644
--- a/Makefile
+++ b/Makefile
@@ -119,8 +119,6 @@ ifneq ($(MODERN),1)
CPPFLAGS += -I tools/agbcc/include -I tools/agbcc -nostdinc -undef
endif
-LDFLAGS = -Map ../../$(MAP)
-
SHA1 := $(shell { command -v sha1sum || command -v shasum; } 2>/dev/null) -c
GFX := tools/gbagfx/gbagfx$(EXE)
AIF := tools/aif2pcm/aif2pcm$(EXE)
@@ -236,8 +234,7 @@ clean-tools:
@$(foreach tooldir,$(TOOLDIRS),$(MAKE) clean -C $(tooldir);)
mostlyclean: tidynonmodern tidymodern
- rm -f $(SAMPLE_SUBDIR)/*.bin
- rm -f $(CRY_SUBDIR)/*.bin
+ find sound -iname '*.bin' -exec rm {} +
rm -f $(MID_SUBDIR)/*.s
find . \( -iname '*.1bpp' -o -iname '*.4bpp' -o -iname '*.8bpp' -o -iname '*.gbapal' -o -iname '*.lz' -o -iname '*.rl' -o -iname '*.latfont' -o -iname '*.hwjpnfont' -o -iname '*.fwjpnfont' \) -exec rm {} +
rm -f $(DATA_ASM_SUBDIR)/layouts/layouts.inc $(DATA_ASM_SUBDIR)/layouts/layouts_table.inc
@@ -412,19 +409,20 @@ $(OBJ_DIR)/sym_ewram.ld: sym_ewram.txt
$(RAMSCRGEN) ewram_data $< ENGLISH > $@
ifeq ($(MODERN),0)
-LD_SCRIPT := ld_script.txt
+LD_SCRIPT := ld_script.ld
LD_SCRIPT_DEPS := $(OBJ_DIR)/sym_bss.ld $(OBJ_DIR)/sym_common.ld $(OBJ_DIR)/sym_ewram.ld
else
-LD_SCRIPT := ld_script_modern.txt
+LD_SCRIPT := ld_script_modern.ld
LD_SCRIPT_DEPS :=
endif
$(OBJ_DIR)/ld_script.ld: $(LD_SCRIPT) $(LD_SCRIPT_DEPS)
cd $(OBJ_DIR) && sed "s#tools/#../../tools/#g" ../../$(LD_SCRIPT) > ld_script.ld
+LDFLAGS = -Map ../../$(MAP)
$(ELF): $(OBJ_DIR)/ld_script.ld $(OBJS) libagbsyscall
@echo "cd $(OBJ_DIR) && $(LD) $(LDFLAGS) -T ld_script.ld -o ../../$@ "
- @cd $(OBJ_DIR) && $(LD) $(LDFLAGS) -T ld_script.ld -o ../../$@ $(OBJS_REL) $(LIB)
+ @cd $(OBJ_DIR) && $(LD) $(LDFLAGS) -T ld_script.ld --print-memory-usage -o ../../$@ $(OBJS_REL) $(LIB) | cat
$(FIX) $@ -t"$(TITLE)" -c$(GAME_CODE) -m$(MAKER_CODE) -r$(REVISION) --silent
$(ROM): $(ELF)
diff --git a/README.md b/README.md
index 6f6d67f178..0dde7185fb 100644
--- a/README.md
+++ b/README.md
@@ -12,6 +12,8 @@ There are several branches, each with one main feature (and sometimes some extra
* PID (but not legitimacy) preserving Pokémon nature-changing function
* Function to detect modern emulators/GBA hardware.
+> Note: Unless you have a specific need for it, you should probably use `followers-expanded-id` over this.
+
**icons** branch:
* Everything from the **followers** branch.
* All pokemon icons updated to Gen 6, based on [this repo](https://github.com/msikma/pokesprite/tree/master/icons/pokemon/regular)
@@ -28,36 +30,52 @@ There are several branches, each with one main feature (and sometimes some extra
* WIP interframe-blended lamp lights at night, i.e in Rustboro.
* HGSS-style alpha-blended shadows for object events.
-Additional branches to mention:
+**just-lighting** branch:
+* `lighting-expanded-id` but with following pokémon code & assets completely removed. (This allows for more than 255 OW graphics)
+* Saves with following pokémon can safely be loaded.
+
+**followers-expanded-id** branch:
+* Like `followers`, but includes expands OW graphicsIds to 16-bits
+in a backwards compatible way
+* Includes support for compressed OW graphics
+
+Additional branches to mention:
-* `followers-expanded-id` - like `followers`, but includes backwards-compatible 16-bit graphics IDs for object events.
* `lighting-expanded-id` - like the above but for `lighting`.
To set up the repository, see [INSTALL.md](INSTALL.md).
+## FAQ
+### `(followers*)` Q: Where are the config settings?
+A: Configuration for the follower system is mostly in [event_objects.h](include/constants/event_objects.h):
+```c
+// If true, follower pokemon will bob up and down
+// during their idle & walking animations
+#define OW_MON_BOBBING TRUE
+
+// If true, adds a small amount of overhead
+// to OW code so that large (48x48, 64x64) OWs
+// will display correctly under bridges, etc.
+#define LARGE_OW_SUPPORT TRUE
+```
+
+### `(lighting)` Q: How do I mark certain colors in a palette as light-blended?
+A: Create a `.pla` file in the same folder as the `.pal` with the same name.
+
+In this file you can enter color indices [0,15]
+on separate lines to mark those colors as being light-blended, i.e:
+
+`06.pla:`
+```
+# A comment
+0 # if color 0 is listed, uses it to blend with instead of the default!
+1
+9
+10
+```
+
+You might have to `make mostlyclean` or change the `.pal` file to pick up the changes.
+
## See also
-Other disassembly and/or decompilation projects:
-* [**Pokémon Red and Blue**](https://github.com/pret/pokered)
-* [**Pokémon Gold and Silver (Space World '97 demo)**](https://github.com/pret/pokegold-spaceworld)
-* [**Pokémon Yellow**](https://github.com/pret/pokeyellow)
-* [**Pokémon Trading Card Game**](https://github.com/pret/poketcg)
-* [**Pokémon Pinball**](https://github.com/pret/pokepinball)
-* [**Pokémon Stadium**](https://github.com/pret/pokestadium)
-* [**Pokémon Gold and Silver**](https://github.com/pret/pokegold)
-* [**Pokémon Crystal**](https://github.com/pret/pokecrystal)
-* [**Pokémon Ruby and Sapphire**](https://github.com/pret/pokeruby)
-* [**Pokémon Pinball: Ruby & Sapphire**](https://github.com/pret/pokepinballrs)
-* [**Pokémon FireRed and LeafGreen**](https://github.com/pret/pokefirered)
-* [**Pokémon Mystery Dungeon: Red Rescue Team**](https://github.com/pret/pmd-red)
-* [**Pokémon Diamond and Pearl**](https://github.com/pret/pokediamond)
-* [**Pokémon Platinum**](https://github.com/pret/pokeplatinum)
-* [**Pokémon HeartGold and SoulSilver**](https://github.com/pret/pokeheartgold)
-* [**Pokémon Mystery Dungeon: Explorers of Sky**](https://github.com/pret/pmd-sky)
-
-## Contacts
-
-You can find PRET on:
-
-* [Discord (PRET, #pokeemerald)](https://discord.gg/d5dubZ3)
-* [IRC](https://web.libera.chat/?#pret)
+For contacts and other pret projects, see [pret.github.io](https://pret.github.io/).
diff --git a/constants/gba_constants.inc b/constants/gba_constants.inc
index 3ff857ee8d..9f51b0f02b 100644
--- a/constants/gba_constants.inc
+++ b/constants/gba_constants.inc
@@ -1,3 +1,6 @@
+#ifndef GUARD_CONSTANTS_GBA_CONSTANTS_INC
+#define GUARD_CONSTANTS_GBA_CONSTANTS_INC
+
.set PSR_USR_MODE, 0x00000010
.set PSR_FIQ_MODE, 0x00000011
.set PSR_IRQ_MODE, 0x00000012
@@ -511,3 +514,5 @@
.set BLDCNT_TGT2_OBJ, 1 << 12
.set BLDCNT_TGT2_BD, 1 << 13
.set BLDCNT_TGT2_ALL, BLDCNT_TGT2_BG0 | BLDCNT_TGT2_BG1 | BLDCNT_TGT2_BG2 | BLDCNT_TGT2_BG3 | BLDCNT_TGT2_OBJ | BLDCNT_TGT2_BD
+
+#endif @ GUARD_CONSTANTS_GBA_CONSTANTS_INC
diff --git a/constants/global.inc b/constants/global.inc
index 621ba2af89..b9462fa26b 100644
--- a/constants/global.inc
+++ b/constants/global.inc
@@ -1,3 +1,6 @@
+#ifndef GUARD_CONSTANTS_GLOBAL_INC
+#define GUARD_CONSTANTS_GLOBAL_INC
+
.set TRUE, 1
.set FALSE, 0
@@ -20,3 +23,5 @@
.set OBJ_IMAGE_ANIM_H_FLIP, 1 << 6
.set OBJ_IMAGE_ANIM_V_FLIP, 1 << 7
+
+#endif @ GUARD_CONSTANTS_GLOBAL_INC
diff --git a/constants/m4a_constants.inc b/constants/m4a_constants.inc
index 1a744dc7fb..2599b6c4aa 100644
--- a/constants/m4a_constants.inc
+++ b/constants/m4a_constants.inc
@@ -1,3 +1,6 @@
+#ifndef GUARD_CONSTANTS_M4A_CONSTANTS_INC
+#define GUARD_CONSTANTS_M4A_CONSTANTS_INC
+
.equiv ID_NUMBER, 0x68736d53
.equiv PCM_DMA_BUF_SIZE, 1584
@@ -250,3 +253,5 @@
struct_field o_CgbChannel_nextChannelPointer, 4
struct_field o_CgbChannel_dummy4, 8
struct_field CgbChannel_size, 0
+
+#endif @ GUARD_CONSTANTS_M4A_CONSTANTS_INC
diff --git a/constants/tms_hms.inc b/constants/tms_hms.inc
index 3450aa73ba..4ce6d90328 100644
--- a/constants/tms_hms.inc
+++ b/constants/tms_hms.inc
@@ -1,3 +1,6 @@
+#ifndef GUARD_CONSTANTS_TMS_HMS_INC
+#define GUARD_CONSTANTS_TMS_HMS_INC
+
#include "constants/tms_hms.h"
/* Expands to:
@@ -15,3 +18,5 @@ FOREACH_TM(EQUIV_TM)
FOREACH_HM(EQUIV_HM)
#undef EQUIV_TM
#undef EQUIV_HM
+
+#endif @ GUARD_CONSTANTS_TMS_HMS_INC
diff --git a/data/battle_ai_scripts.s b/data/battle_ai_scripts.s
index c296702a64..a43c889502 100644
--- a/data/battle_ai_scripts.s
+++ b/data/battle_ai_scripts.s
@@ -1,3 +1,4 @@
+#include "config.h"
#include "constants/battle.h"
#include "constants/battle_ai.h"
#include "constants/abilities.h"
@@ -1926,19 +1927,19 @@ AI_CV_Protect_End:
@ BUG: Foresight is only encouraged if the user is Ghost type or
@ has high evasion, but should check target instead
AI_CV_Foresight:
-.ifdef BUGFIX
+#ifdef BUGFIX
get_target_type1
if_equal TYPE_GHOST, AI_CV_Foresight2
get_target_type2
if_equal TYPE_GHOST, AI_CV_Foresight2
if_stat_level_more_than AI_TARGET, STAT_EVASION, 8, AI_CV_Foresight3
-.else
+#else
get_user_type1
if_equal TYPE_GHOST, AI_CV_Foresight2
get_user_type2
if_equal TYPE_GHOST, AI_CV_Foresight2
if_stat_level_more_than AI_USER, STAT_EVASION, 8, AI_CV_Foresight3
-.endif
+#endif
score -2
goto AI_CV_Foresight_End
@@ -2183,13 +2184,13 @@ AI_CV_SemiInvulnerable2:
if_status2 AI_TARGET, STATUS2_CURSED, AI_CV_SemiInvulnerable_TryEncourage
if_status3 AI_TARGET, STATUS3_LEECHSEED, AI_CV_SemiInvulnerable_TryEncourage
get_weather
-.ifdef BUGFIX
+#ifdef BUGFIX
if_equal AI_WEATHER_HAIL, AI_CV_SemiInvulnerable_CheckIceType
if_equal AI_WEATHER_SANDSTORM, AI_CV_SemiInvulnerable_CheckSandstormTypes
-.else
+#else
if_equal AI_WEATHER_HAIL, AI_CV_SemiInvulnerable_CheckSandstormTypes
if_equal AI_WEATHER_SANDSTORM, AI_CV_SemiInvulnerable_CheckIceType
-.endif
+#endif
goto AI_CV_SemiInvulnerable5
AI_CV_SemiInvulnerable_CheckSandstormTypes:
@@ -2254,11 +2255,11 @@ AI_CV_Hail_End:
@ BUG: Facade score is increased if the target is statused, but should be if the user is
AI_CV_Facade:
-.ifdef BUGFIX
+#ifdef BUGFIX
if_not_status AI_USER, STATUS1_POISON | STATUS1_BURN | STATUS1_PARALYSIS | STATUS1_TOXIC_POISON, AI_CV_Facade_End
-.else
+#else
if_not_status AI_TARGET, STATUS1_POISON | STATUS1_BURN | STATUS1_PARALYSIS | STATUS1_TOXIC_POISON, AI_CV_Facade_End
-.endif
+#endif
score +1
AI_CV_Facade_End:
end
@@ -3176,9 +3177,9 @@ AI_HPAware_DiscouragedEffectsWhenTargetLowHP:
AI_TrySunnyDayStart:
if_target_is_ally AI_TryOnAlly
if_not_effect EFFECT_SUNNY_DAY, AI_TrySunnyDayStart_End
-.ifndef BUGFIX @ funcResult has not been set in this script yet, below call is nonsense
+#ifndef BUGFIX @ funcResult has not been set in this script yet, below call is nonsense
if_equal FALSE, AI_TrySunnyDayStart_End
-.endif
+#endif
is_first_turn_for AI_USER
if_equal FALSE, AI_TrySunnyDayStart_End
score +5
diff --git a/data/battle_scripts_1.s b/data/battle_scripts_1.s
index e7f592aacb..0c0dc72831 100644
--- a/data/battle_scripts_1.s
+++ b/data/battle_scripts_1.s
@@ -3208,7 +3208,7 @@ BattleScript_DamagingWeatherLoop::
jumpifword CMP_EQUAL, gBattleMoveDamage, 0, BattleScript_DamagingWeatherLoopIncrement
printfromtable gSandStormHailDmgStringIds
waitmessage B_WAIT_TIME_LONG
- orword gHitMarker, HITMARKER_SKIP_DMG_TRACK | HITMARKER_IGNORE_SUBSTITUTE | HITMARKER_PASSIVE_DAMAGE | HITMARKER_GRUDGE
+ orword gHitMarker, HITMARKER_IGNORE_BIDE | HITMARKER_IGNORE_SUBSTITUTE | HITMARKER_PASSIVE_DAMAGE | HITMARKER_GRUDGE
effectivenesssound
hitanimation BS_ATTACKER
healthbarupdate BS_ATTACKER
@@ -3220,7 +3220,7 @@ BattleScript_DamagingWeatherLoopIncrement::
addbyte gBattleCommunication, 1
jumpifbytenotequal gBattleCommunication, gBattlersCount, BattleScript_DamagingWeatherLoop
BattleScript_DamagingWeatherContinuesEnd::
- bicword gHitMarker, HITMARKER_SKIP_DMG_TRACK | HITMARKER_IGNORE_SUBSTITUTE | HITMARKER_PASSIVE_DAMAGE | HITMARKER_GRUDGE
+ bicword gHitMarker, HITMARKER_IGNORE_BIDE | HITMARKER_IGNORE_SUBSTITUTE | HITMARKER_PASSIVE_DAMAGE | HITMARKER_GRUDGE
end2
BattleScript_SandStormHailEnds::
diff --git a/data/contest_ai_scripts.s b/data/contest_ai_scripts.s
index ecd3103ae2..affaf31d6d 100644
--- a/data/contest_ai_scripts.s
+++ b/data/contest_ai_scripts.s
@@ -1,3 +1,4 @@
+#include "config.h"
#include "constants/global.h"
#include "constants/contest.h"
.include "asm/macros.inc"
@@ -435,11 +436,11 @@ AI_CGM_BetterWhenAudienceExcited:
AI_CGM_BetterWhenAudienceExcited_1stUp:
@ BUG: Should be if_appeal_num_eq 0
@ 1st up on 1st appeal excitement will always be 0
-.ifdef BUGFIX
+#ifdef BUGFIX
if_appeal_num_eq 0, AI_CGM_BetterWhenAudienceExcited_1stAppeal
-.else
+#else
if_appeal_num_not_eq 0, AI_CGM_BetterWhenAudienceExcited_1stAppeal
-.endif
+#endif
if_excitement_eq 4, AI_CGM_BetterWhenAudienceExcited_1AwayFromMax
if_excitement_eq 3, AI_CGM_BetterWhenAudienceExcited_2AwayFromMax
end
@@ -546,11 +547,11 @@ AI_CGM_TargetMonWithJudgesAttention:
end
AI_CGM_TargetMonWithJudgesAttention_CheckMon1:
if_cannot_participate MON_1, AI_CGM_TargetMonWithJudgesAttention_CheckMon2
-.ifdef BUGFIX
+#ifdef BUGFIX
if_not_used_combo_starter MON_1, AI_CGM_TargetMonWithJudgesAttention_CheckMon2
-.else
+#else
if_used_combo_starter MON_1, AI_CGM_TargetMonWithJudgesAttention_CheckMon2
-.endif
+#endif
if_random_less_than 125, AI_CGM_TargetMonWithJudgesAttention_CheckMon2
score +2
if_not_completed_combo MON_1, AI_CGM_TargetMonWithJudgesAttention_CheckMon2
@@ -559,11 +560,11 @@ AI_CGM_TargetMonWithJudgesAttention_CheckMon1:
AI_CGM_TargetMonWithJudgesAttention_CheckMon2:
if_user_order_eq MON_2, AI_CGM_End
if_cannot_participate MON_2, AI_CGM_TargetMonWithJudgesAttention_CheckMon3
-.ifdef BUGFIX
+#ifdef BUGFIX
if_not_used_combo_starter MON_2, AI_CGM_TargetMonWithJudgesAttention_CheckMon3
-.else
+#else
if_used_combo_starter MON_2, AI_CGM_TargetMonWithJudgesAttention_CheckMon3
-.endif
+#endif
if_random_less_than 125, AI_CGM_TargetMonWithJudgesAttention_CheckMon3
score +2
if_not_completed_combo MON_2, AI_CGM_TargetMonWithJudgesAttention_CheckMon3
@@ -572,11 +573,11 @@ AI_CGM_TargetMonWithJudgesAttention_CheckMon2:
AI_CGM_TargetMonWithJudgesAttention_CheckMon3:
if_user_order_eq MON_3, AI_CGM_End
if_cannot_participate MON_3, AI_CGM_End
-.ifdef BUGFIX
+#ifdef BUGFIX
if_not_used_combo_starter MON_3, AI_CGM_End
-.else
+#else
if_used_combo_starter MON_3, AI_CGM_End
-.endif
+#endif
if_random_less_than 125, AI_CGM_End
score +2
if_not_completed_combo MON_3, AI_CGM_End
diff --git a/data/event_scripts.s b/data/event_scripts.s
index 0b2df416b5..fbd69ca133 100644
--- a/data/event_scripts.s
+++ b/data/event_scripts.s
@@ -1,3 +1,4 @@
+#include "config.h"
#include "constants/global.h"
#include "constants/apprentice.h"
#include "constants/battle.h"
diff --git a/data/maps/BattleFrontier_BattleTowerLobby/scripts.inc b/data/maps/BattleFrontier_BattleTowerLobby/scripts.inc
index d1d80719d2..27591cc6b4 100644
--- a/data/maps/BattleFrontier_BattleTowerLobby/scripts.inc
+++ b/data/maps/BattleFrontier_BattleTowerLobby/scripts.inc
@@ -421,18 +421,18 @@ BattleFrontier_BattleTowerLobby_EventScript_SaveBeforeLinkMultisChallenge::
@ to the flash, but not data in PokemonStorage. The SaveGame script that follows asks the player to do a full save,
@ which they can opt out of. As a result the player can save their party and quit without having saved the PC.
@ This allows players to clone pokemon and their held items by withdrawing them (or erase them by despositing).
-.ifndef BUGFIX
+#ifndef BUGFIX
tower_save 0
-.endif
+#endif
call Common_EventScript_SaveGame
setvar VAR_TEMP_CHALLENGE_STATUS, 255
goto_if_eq VAR_RESULT, 0, BattleFrontier_BattleTowerLobby_EventScript_CancelChallengeSaveFailed
@ GAME_STAT_ENTERED_BATTLE_TOWER should not be incremented here, for two reasons:
@ 1. It is incremented again in BattleFrontier_BattleTowerLobby_EventScript_CableLinkSuccessful or BattleFrontier_BattleTowerLobby_EventScript_WirelessLinkSuccessful
-@ 2. If the player tries to save, but fails, the counter will still be incremented even if the player never enters the tower.
-.ifndef BUGFIX
+@ 2. If the player tries to connect, but fails, the counter will still be incremented even if the player never enters the tower.
+#ifndef BUGFIX
incrementgamestat GAME_STAT_ENTERED_BATTLE_TOWER
-.endif
+#endif
specialvar VAR_RESULT, IsWirelessAdapterConnected
goto_if_eq VAR_RESULT, TRUE, BattleFrontier_BattleTowerLobby_EventScript_TryWirelessLink
goto BattleFrontier_BattleTowerLobby_EventScript_TryCableLink
diff --git a/data/maps/MossdeepCity_SpaceCenter_1F/scripts.inc b/data/maps/MossdeepCity_SpaceCenter_1F/scripts.inc
index 263b071056..e17af35724 100644
--- a/data/maps/MossdeepCity_SpaceCenter_1F/scripts.inc
+++ b/data/maps/MossdeepCity_SpaceCenter_1F/scripts.inc
@@ -229,11 +229,11 @@ MossdeepCity_SpaceCenter_1F_EventScript_Grunt2::
copyobjectxytoperm LOCALID_STAIR_GRUNT
switch VAR_FACING
case DIR_WEST, MossdeepCity_SpaceCenter_1F_EventScript_MoveGruntFromStairsWest
- #ifdef BUGFIX
+#ifdef BUGFIX
case DIR_EAST, MossdeepCity_SpaceCenter_1F_EventScript_MoveGruntFromStairsEast
- #else
+#else
case DIR_WEST, MossdeepCity_SpaceCenter_1F_EventScript_MoveGruntFromStairsEast
- #endif
+#endif
applymovement LOCALID_STAIR_GRUNT, MossdeepCity_SpaceCenter_1F_Movement_MoveGruntFromStairs
waitmovement 0
setvar VAR_MOSSDEEP_SPACE_CENTER_STAIR_GUARD_STATE, 2
diff --git a/data/scripts/trainer_hill.inc b/data/scripts/trainer_hill.inc
index b7f8153514..04bbe05e5a 100644
--- a/data/scripts/trainer_hill.inc
+++ b/data/scripts/trainer_hill.inc
@@ -13,9 +13,9 @@ TrainerHill_OnWarp:
TrainerHill_1F_EventScript_DummyOnWarp::
setvar VAR_TEMP_3, 1
-.ifdef BUGFIX
+#ifdef BUGFIX
end @ Missing end. By chance, the next byte (0x02 of VAR_TEMP_2) is also the id for the end cmd
-.endif
+#endif
TrainerHill_OnFrame:
map_script_2 VAR_TEMP_2, 0, TrainerHill_1F_EventScript_DummyWarpToEntranceCounter
diff --git a/gflib/malloc.c b/gflib/malloc.c
index d0b9497635..f54c751a4c 100644
--- a/gflib/malloc.c
+++ b/gflib/malloc.c
@@ -1,8 +1,11 @@
#include "global.h"
+#include "malloc.h"
static void *sHeapStart;
static u32 sHeapSize;
+EWRAM_DATA u8 gHeap[HEAP_SIZE] = {0};
+
#define MALLOC_SYSTEM_ID 0xA3A3
struct MemBlock {
diff --git a/gflib/malloc.h b/gflib/malloc.h
index 851db83a62..72e1a5e1d3 100644
--- a/gflib/malloc.h
+++ b/gflib/malloc.h
@@ -1,7 +1,6 @@
#ifndef GUARD_ALLOC_H
#define GUARD_ALLOC_H
-#define HEAP_SIZE 0x1C000
#define FREE_AND_SET_NULL(ptr) \
{ \
@@ -11,7 +10,8 @@
#define TRY_FREE_AND_SET_NULL(ptr) if (ptr != NULL) FREE_AND_SET_NULL(ptr)
-extern u8 gHeap[];
+#define HEAP_SIZE 0x1C000
+extern u8 gHeap[HEAP_SIZE];
void *Alloc(u32 size);
void *AllocZeroed(u32 size);
diff --git a/gflib/sprite.c b/gflib/sprite.c
index 69d5add853..6bff9baaea 100644
--- a/gflib/sprite.c
+++ b/gflib/sprite.c
@@ -1623,7 +1623,6 @@ u8 LoadSpritePalette(const struct SpritePalette *palette)
{
u8 index = IndexOfSpritePaletteTag(palette->tag);
u8 i;
- u16 *debugPtr = (u16*) 0x0203d800;
if (index != 0xFF)
return index;
@@ -1637,9 +1636,6 @@ u8 LoadSpritePalette(const struct SpritePalette *palette)
else
{
sSpritePaletteTags[index] = palette->tag;
- for (i = 0; i < 16; i++) {
- debugPtr[i] = sSpritePaletteTags[i];
- }
DoLoadSpritePalette(palette->data, PLTT_ID(index));
return index;
}
diff --git a/gflib/string_util.c b/gflib/string_util.c
index 8d969d1bf5..d515c14cda 100644
--- a/gflib/string_util.c
+++ b/gflib/string_util.c
@@ -298,7 +298,7 @@ u8 *ConvertIntToHexStringN(u8 *dest, s32 value, enum StringConvertMode mode, u8
if (state == WRITING_DIGITS)
{
- char *out = dest++;
+ u8 *out = dest++;
if (digit <= 0xF)
c = sDigits[digit];
@@ -309,7 +309,7 @@ u8 *ConvertIntToHexStringN(u8 *dest, s32 value, enum StringConvertMode mode, u8
}
else if (digit != 0 || powerOfSixteen == 1)
{
- char *out;
+ u8 *out;
state = WRITING_DIGITS;
out = dest++;
diff --git a/gflib/text.c b/gflib/text.c
index 1bded26b5a..bc917c7ced 100644
--- a/gflib/text.c
+++ b/gflib/text.c
@@ -554,8 +554,7 @@ void DecompressGlyphTile(const void *src_, void *dest_)
*(dest++) = ((sFontHalfRowLookupTable[sFontHalfRowOffsets[temp & 0xFF]]) << 16) | (sFontHalfRowLookupTable[sFontHalfRowOffsets[temp >> 8]]);
}
-// Unused
-static u8 GetLastTextColor(u8 colorType)
+static u8 UNUSED GetLastTextColor(u8 colorType)
{
switch (colorType)
{
@@ -1224,8 +1223,7 @@ static u16 RenderText(struct TextPrinter *textPrinter)
return RENDER_FINISH;
}
-// Unused
-static u32 GetStringWidthFixedWidthFont(const u8 *str, u8 fontId, u8 letterSpacing)
+static u32 UNUSED GetStringWidthFixedWidthFont(const u8 *str, u8 fontId, u8 letterSpacing)
{
int i;
u8 width;
diff --git a/gflib/window.c b/gflib/window.c
index 76e863f10e..6f7af457d3 100644
--- a/gflib/window.c
+++ b/gflib/window.c
@@ -411,7 +411,7 @@ void BlitBitmapRectToWindow(u8 windowId, const u8 *pixels, u16 srcX, u16 srcY, u
BlitBitmapRect4Bit(&sourceRect, &destRect, srcX, srcY, destX, destY, rectWidth, rectHeight, 0);
}
-static void BlitBitmapRectToWindowWithColorKey(u8 windowId, const u8 *pixels, u16 srcX, u16 srcY, u16 srcWidth, int srcHeight, u16 destX, u16 destY, u16 rectWidth, u16 rectHeight, u8 colorKey)
+static void UNUSED BlitBitmapRectToWindowWithColorKey(u8 windowId, const u8 *pixels, u16 srcX, u16 srcY, u16 srcWidth, int srcHeight, u16 destX, u16 destY, u16 rectWidth, u16 rectHeight, u8 colorKey)
{
struct Bitmap sourceRect;
struct Bitmap destRect;
diff --git a/graphics/fonts/japanese_frlg_female_font.png b/graphics/fonts/japanese_frlg_female.png
similarity index 100%
rename from graphics/fonts/japanese_frlg_female_font.png
rename to graphics/fonts/japanese_frlg_female.png
diff --git a/graphics/fonts/japanese_frlg_male_font.png b/graphics/fonts/japanese_frlg_male.png
similarity index 100%
rename from graphics/fonts/japanese_frlg_male_font.png
rename to graphics/fonts/japanese_frlg_male.png
diff --git a/graphics/spinda_spots/spot_0.png b/graphics/pokemon/spinda/spots/spot_0.png
similarity index 100%
rename from graphics/spinda_spots/spot_0.png
rename to graphics/pokemon/spinda/spots/spot_0.png
diff --git a/graphics/spinda_spots/spot_1.png b/graphics/pokemon/spinda/spots/spot_1.png
similarity index 100%
rename from graphics/spinda_spots/spot_1.png
rename to graphics/pokemon/spinda/spots/spot_1.png
diff --git a/graphics/spinda_spots/spot_2.png b/graphics/pokemon/spinda/spots/spot_2.png
similarity index 100%
rename from graphics/spinda_spots/spot_2.png
rename to graphics/pokemon/spinda/spots/spot_2.png
diff --git a/graphics/spinda_spots/spot_3.png b/graphics/pokemon/spinda/spots/spot_3.png
similarity index 100%
rename from graphics/spinda_spots/spot_3.png
rename to graphics/pokemon/spinda/spots/spot_3.png
diff --git a/graphics/unused/.gitignore b/graphics/unused/.gitignore
new file mode 100644
index 0000000000..b929a6cae7
--- /dev/null
+++ b/graphics/unused/.gitignore
@@ -0,0 +1 @@
+redyellowgreen_frame.bin
\ No newline at end of file
diff --git a/graphics/unused/redyellowgreen_frame.bin b/graphics/unused/redyellowgreen_frame.bin
deleted file mode 100644
index 6852998fb8..0000000000
Binary files a/graphics/unused/redyellowgreen_frame.bin and /dev/null differ
diff --git a/graphics_file_rules.mk b/graphics_file_rules.mk
index 090620ebe8..92cc3338dc 100644
--- a/graphics_file_rules.mk
+++ b/graphics_file_rules.mk
@@ -21,7 +21,7 @@ JPCONTESTGFXDIR := graphics/contest/japanese
POKEDEXGFXDIR := graphics/pokedex
STARTERGFXDIR := graphics/starter_choose
NAMINGGFXDIR := graphics/naming_screen
-SPINDAGFXDIR := graphics/spinda_spots
+SPINDAGFXDIR := graphics/pokemon/spinda/spots
types := normal fight flying poison ground rock bug ghost steel mystery fire water grass electric psychic ice dragon dark
contest_types := cool beauty cute smart tough
@@ -290,10 +290,10 @@ $(FONTGFXDIR)/short.fwjpnfont: $(FONTGFXDIR)/japanese_short.png
$(FONTGFXDIR)/braille.fwjpnfont: $(FONTGFXDIR)/braille.png
$(GFX) $< $@
-$(FONTGFXDIR)/frlg_male.fwjpnfont: $(FONTGFXDIR)/japanese_frlg_male_font.png
+$(FONTGFXDIR)/frlg_male.fwjpnfont: $(FONTGFXDIR)/japanese_frlg_male.png
$(GFX) $< $@
-$(FONTGFXDIR)/frlg_female.fwjpnfont: $(FONTGFXDIR)/japanese_frlg_female_font.png
+$(FONTGFXDIR)/frlg_female.fwjpnfont: $(FONTGFXDIR)/japanese_frlg_female.png
$(GFX) $< $@
diff --git a/include/battle.h b/include/battle.h
index bb0e42fb83..6c4d780186 100644
--- a/include/battle.h
+++ b/include/battle.h
@@ -54,6 +54,9 @@
#define BATTLE_BUFFER_LINK_SIZE 0x1000
+// Special indicator value for shellBellDmg in SpecialStatus
+#define IGNORE_SHELL_BELL 0xFFFF
+
struct ResourceFlags
{
u32 flags[MAX_BATTLERS_COUNT];
@@ -133,7 +136,7 @@ struct SpecialStatus
u32 ppNotAffectedByPressure:1;
u32 faintedHasReplacement:1;
u32 focusBanded:1;
- s32 dmg;
+ s32 shellBellDmg;
s32 physicalDmg;
s32 specialDmg;
u8 physicalBattlerId;
@@ -417,7 +420,7 @@ struct BattleStruct
u8 arenaTurnCounter;
u8 turnSideTracker;
u8 unused_6[3];
- u8 givenExpMons; // Bits for enemy party's pokemon that gave exp to player's party.
+ u8 givenExpMons; // Bits for enemy party's Pokémon that gave exp to player's party.
u8 lastTakenMoveFrom[MAX_BATTLERS_COUNT * MAX_BATTLERS_COUNT * 2]; // a 3-D array [target][attacker][byte]
u16 castformPalette[NUM_CASTFORM_FORMS][16];
union {
@@ -437,7 +440,7 @@ struct BattleStruct
u16 arenaStartHp[2];
u8 arenaLostPlayerMons; // Bits for party member, lost as in referee's decision, not by fainting.
u8 arenaLostOpponentMons;
- u8 alreadyStatusedMoveAttempt; // As bits for battlers; For example when using Thunder Wave on an already paralyzed pokemon.
+ u8 alreadyStatusedMoveAttempt; // As bits for battlers; For example when using Thunder Wave on an already paralyzed Pokémon.
};
// The palaceFlags member of struct BattleStruct contains 1 flag per move to indicate which moves the AI should consider,
@@ -445,9 +448,9 @@ struct BattleStruct
// The assert below is to ensure palaceFlags is large enough to store these flags without overlap.
STATIC_ASSERT(sizeof(((struct BattleStruct *)0)->palaceFlags) * 8 >= MAX_BATTLERS_COUNT + MAX_MON_MOVES, PalaceFlagsTooSmall)
-#define F_DYNAMIC_TYPE_1 (1 << 6)
-#define F_DYNAMIC_TYPE_2 (1 << 7)
-#define DYNAMIC_TYPE_MASK (F_DYNAMIC_TYPE_1 - 1)
+#define DYNAMIC_TYPE_MASK ((1 << 6) - 1)
+#define F_DYNAMIC_TYPE_IGNORE_PHYSICALITY (1 << 6) // If set, the dynamic type's physicality won't be used for certain move effects.
+#define F_DYNAMIC_TYPE_SET (1 << 7) // Set for all dynamic types to distinguish a dynamic type of Normal (0) from no dynamic type.
#define GET_MOVE_TYPE(move, typeArg) \
{ \
@@ -592,7 +595,7 @@ struct BattleSpriteData
struct MonSpritesGfx
{
- void *firstDecompressed; // ptr to the decompressed sprite of the first pokemon
+ void *firstDecompressed; // ptr to the decompressed sprite of the first Pokémon
union {
void *ptr[MAX_BATTLERS_COUNT];
u8 *byte[MAX_BATTLERS_COUNT];
@@ -647,7 +650,7 @@ extern u16 gChosenMove;
extern u16 gCalledMove;
extern s32 gBattleMoveDamage;
extern s32 gHpDealt;
-extern s32 gTakenDmg[MAX_BATTLERS_COUNT];
+extern s32 gBideDmg[MAX_BATTLERS_COUNT];
extern u16 gLastUsedItem;
extern u8 gLastUsedAbility;
extern u8 gBattlerAttacker;
@@ -673,7 +676,7 @@ extern u8 gLastHitBy[MAX_BATTLERS_COUNT];
extern u16 gChosenMoveByBattler[MAX_BATTLERS_COUNT];
extern u8 gMoveResultFlags;
extern u32 gHitMarker;
-extern u8 gTakenDmgByBattler[MAX_BATTLERS_COUNT];
+extern u8 gBideTarget[MAX_BATTLERS_COUNT];
extern u8 gUnusedFirstBattleVar2;
extern u16 gSideStatuses[NUM_BATTLE_SIDES];
extern struct SideTimer gSideTimers[NUM_BATTLE_SIDES];
diff --git a/include/constants/battle.h b/include/constants/battle.h
index ac83feb3a0..50c93083f8 100644
--- a/include/constants/battle.h
+++ b/include/constants/battle.h
@@ -168,7 +168,7 @@
// Not really sure what a "hitmarker" is.
#define HITMARKER_WAKE_UP_CLEAR (1 << 4) // Cleared when waking up. Never set or checked.
-#define HITMARKER_SKIP_DMG_TRACK (1 << 5)
+#define HITMARKER_IGNORE_BIDE (1 << 5)
#define HITMARKER_DESTINYBOND (1 << 6)
#define HITMARKER_NO_ANIMATIONS (1 << 7)
#define HITMARKER_IGNORE_SUBSTITUTE (1 << 8)
@@ -176,7 +176,7 @@
#define HITMARKER_ATTACKSTRING_PRINTED (1 << 10)
#define HITMARKER_NO_PPDEDUCT (1 << 11)
#define HITMARKER_SWAP_ATTACKER_TARGET (1 << 12)
-#define HITMARKER_IGNORE_SAFEGUARD (1 << 13)
+#define HITMARKER_STATUS_ABILITY_EFFECT (1 << 13)
#define HITMARKER_SYNCHRONISE_EFFECT (1 << 14)
#define HITMARKER_RUN (1 << 15)
#define HITMARKER_IGNORE_ON_AIR (1 << 16)
diff --git a/include/constants/battle_palace.h b/include/constants/battle_palace.h
index 8516550892..1d8c2f2dda 100644
--- a/include/constants/battle_palace.h
+++ b/include/constants/battle_palace.h
@@ -16,12 +16,12 @@
#define PALACE_DATA_WIN_STREAK 1
#define PALACE_DATA_WIN_STREAK_ACTIVE 2
-// Pokemon in Battle Palace have a move "group" type preference depending on nature
+// Pokémon in Battle Palace have a move "group" type preference depending on nature
#define PALACE_MOVE_GROUP_ATTACK 0
#define PALACE_MOVE_GROUP_DEFENSE 1
#define PALACE_MOVE_GROUP_SUPPORT 2
-// In palace doubles battles pokemon have a target preference depending on nature
+// In palace doubles battles Pokémon have a target preference depending on nature
#define PALACE_TARGET_STRONGER 0
#define PALACE_TARGET_WEAKER 1
#define PALACE_TARGET_RANDOM 2
diff --git a/include/constants/field_specials.h b/include/constants/field_specials.h
index 6659403313..1e08a47f95 100644
--- a/include/constants/field_specials.h
+++ b/include/constants/field_specials.h
@@ -62,7 +62,7 @@
#define DEPT_STORE_FLOORNUM_11F 14
#define DEPT_STORE_FLOORNUM_ROOFTOP 15
-// Lilycove Pokemon Trainer Fan Club
+// Lilycove Pokémon Trainer Fan Club
#define NUM_TRAINER_FAN_CLUB_MEMBERS 8
#define FANCLUB_GOT_FIRST_FANS 7
diff --git a/include/constants/global.h b/include/constants/global.h
index 2b70378ff5..b409e80eb1 100644
--- a/include/constants/global.h
+++ b/include/constants/global.h
@@ -2,9 +2,9 @@
#define GUARD_CONSTANTS_GLOBAL_H
// Invalid Versions show as "----------" in Gen 4 and Gen 5's summary screen.
// In Gens 6 and 7, invalid versions instead show "a distant land" in the summary screen.
-// In Gen 4 only, migrated Pokemon with Diamond, Pearl, or Platinum's ID show as "----------".
+// In Gen 4 only, migrated Pokémon with Diamond, Pearl, or Platinum's ID show as "----------".
// Gen 5 and up read Diamond, Pearl, or Platinum's ID as "Sinnoh".
-// In Gen 4 and up, migrated Pokemon with HeartGold or SoulSilver's ID show the otherwise unused "Johto" string.
+// In Gen 4 and up, migrated Pokémon with HeartGold or SoulSilver's ID show the otherwise unused "Johto" string.
#define VERSION_SAPPHIRE 1
#define VERSION_RUBY 2
#define VERSION_EMERALD 3
diff --git a/include/constants/items.h b/include/constants/items.h
index 63cbfe6b97..ed9bfb5ec8 100644
--- a/include/constants/items.h
+++ b/include/constants/items.h
@@ -23,7 +23,7 @@
#define FIRST_BALL ITEM_MASTER_BALL
#define LAST_BALL ITEM_PREMIER_BALL
-// Pokemon Items
+// Pokémon Items
#define ITEM_POTION 13
#define ITEM_ANTIDOTE 14
#define ITEM_BURN_HEAL 15
@@ -476,7 +476,7 @@
#define ITEM_B_USE_MEDICINE 1
#define ITEM_B_USE_OTHER 2
-// Check if the item is one that can be used on a Pokemon.
+// Check if the item is one that can be used on a Pokémon.
#define ITEM_HAS_EFFECT(item) ((item) >= ITEM_POTION && (item) <= MAX_BERRY_INDEX)
#endif // GUARD_CONSTANTS_ITEMS_H
diff --git a/include/constants/pokedex.h b/include/constants/pokedex.h
index 7ee1b3760e..c9c51623e5 100644
--- a/include/constants/pokedex.h
+++ b/include/constants/pokedex.h
@@ -1,7 +1,7 @@
#ifndef GUARD_CONSTANTS_POKEDEX_H
#define GUARD_CONSTANTS_POKEDEX_H
-// National Pokedex order
+// National Pokédex order
enum {
NATIONAL_DEX_NONE,
// Kanto
@@ -425,7 +425,7 @@ enum {
#define JOHTO_DEX_COUNT NATIONAL_DEX_CELEBI
#define NATIONAL_DEX_COUNT NATIONAL_DEX_DEOXYS
-// Hoenn Pokedex order
+// Hoenn Pokédex order
enum {
HOENN_DEX_NONE,
HOENN_DEX_TREECKO,
@@ -631,7 +631,7 @@ enum {
HOENN_DEX_JIRACHI,
HOENN_DEX_DEOXYS,
// End of Hoenn Dex (see HOENN_DEX_COUNT)
- // Here below have values but are excluded from the Pokedex
+ // Here below have values but are excluded from the Pokédex
HOENN_DEX_BULBASAUR,
HOENN_DEX_IVYSAUR,
HOENN_DEX_VENUSAUR,
diff --git a/include/constants/pokemon.h b/include/constants/pokemon.h
index e515378d4c..0d6a20e2b9 100644
--- a/include/constants/pokemon.h
+++ b/include/constants/pokemon.h
@@ -1,7 +1,7 @@
#ifndef GUARD_CONSTANTS_POKEMON_H
#define GUARD_CONSTANTS_POKEMON_H
-// Pokemon types
+// Pokémon types
#define TYPE_NONE 255
#define TYPE_NORMAL 0
#define TYPE_FIGHTING 1
@@ -23,27 +23,27 @@
#define TYPE_DARK 17
#define NUMBER_OF_MON_TYPES 18
-// Pokemon egg groups
-#define EGG_GROUP_NONE 0
-#define EGG_GROUP_MONSTER 1
-#define EGG_GROUP_WATER_1 2
-#define EGG_GROUP_BUG 3
-#define EGG_GROUP_FLYING 4
-#define EGG_GROUP_FIELD 5
-#define EGG_GROUP_FAIRY 6
-#define EGG_GROUP_GRASS 7
-#define EGG_GROUP_HUMAN_LIKE 8
-#define EGG_GROUP_WATER_3 9
-#define EGG_GROUP_MINERAL 10
-#define EGG_GROUP_AMORPHOUS 11
-#define EGG_GROUP_WATER_2 12
-#define EGG_GROUP_DITTO 13
-#define EGG_GROUP_DRAGON 14
-#define EGG_GROUP_UNDISCOVERED 15
+// Pokémon egg groups
+#define EGG_GROUP_NONE 0
+#define EGG_GROUP_MONSTER 1
+#define EGG_GROUP_WATER_1 2
+#define EGG_GROUP_BUG 3
+#define EGG_GROUP_FLYING 4
+#define EGG_GROUP_FIELD 5
+#define EGG_GROUP_FAIRY 6
+#define EGG_GROUP_GRASS 7
+#define EGG_GROUP_HUMAN_LIKE 8
+#define EGG_GROUP_WATER_3 9
+#define EGG_GROUP_MINERAL 10
+#define EGG_GROUP_AMORPHOUS 11
+#define EGG_GROUP_WATER_2 12
+#define EGG_GROUP_DITTO 13
+#define EGG_GROUP_DRAGON 14
+#define EGG_GROUP_NO_EGGS_DISCOVERED 15
-#define EGG_GROUPS_PER_MON 2
+#define EGG_GROUPS_PER_MON 2
-// Pokemon natures
+// Pokémon natures
#define NATURE_HARDY 0
#define NATURE_LONELY 1
#define NATURE_BRAVE 2
@@ -71,7 +71,7 @@
#define NATURE_QUIRKY 24
#define NUM_NATURES 25
-// Pokemon Stats
+// Pokémon Stats
#define STAT_HP 0
#define STAT_ATK 1
#define STAT_DEF 2
@@ -220,7 +220,7 @@
#define GROWTH_FAST 4
#define GROWTH_SLOW 5
-// Body colors for pokedex search
+// Body colors for Pokédex search
#define BODY_COLOR_RED 0
#define BODY_COLOR_BLUE 1
#define BODY_COLOR_YELLOW 2
@@ -263,7 +263,7 @@
#define MON_PIC_HEIGHT 64
#define MON_PIC_SIZE (MON_PIC_WIDTH * MON_PIC_HEIGHT / 2)
-// Most pokemon have 2 frames (a default and an alternate for their animation).
+// Most Pokémon have 2 frames (a default and an alternate for their animation).
// There are 4 exceptions:
// - Castform has 4 frames, 1 for each form
// - Deoxys has 2 frames, 1 for each form
diff --git a/include/constants/tv.h b/include/constants/tv.h
index 13ec88ecdc..1b629fb039 100644
--- a/include/constants/tv.h
+++ b/include/constants/tv.h
@@ -170,7 +170,7 @@
#define NUM_SECRET_BASE_FLAGS 32 // by definition, bitfield of 2 u16s
-// TV Show states for Pokemon Contest Live Updates
+// TV Show states for Pokémon Contest Live Updates
#define CONTESTLIVE_STATE_INTRO 0
#define CONTESTLIVE_STATE_WON_BOTH_ROUNDS 1
#define CONTESTLIVE_STATE_BETTER_ROUND2 2
diff --git a/include/contest.h b/include/contest.h
index d0630a8011..9328188b97 100644
--- a/include/contest.h
+++ b/include/contest.h
@@ -209,7 +209,7 @@ struct ContestantStatus
u8 comboAppealBonus;
u8 repeatJam;
u8 nextTurnOrder; // turn position
- u8 attentionLevel; // How much the Pokemon "stood out"
+ u8 attentionLevel; // How much the Pokémon "stood out"
u8 contestantAnimTarget;
};
diff --git a/include/global.h b/include/global.h
index 98a5b4408f..31c463a68d 100644
--- a/include/global.h
+++ b/include/global.h
@@ -138,7 +138,7 @@
#define ROUND_BITS_TO_BYTES(numBits) DIV_ROUND_UP(numBits, 8)
// NUM_DEX_FLAG_BYTES allocates more flags than it needs to, as NUM_SPECIES includes the "old unown"
-// values that don't appear in the Pokedex. NATIONAL_DEX_COUNT does not include these values.
+// values that don't appear in the Pokédex. NATIONAL_DEX_COUNT does not include these values.
#define NUM_DEX_FLAG_BYTES ROUND_BITS_TO_BYTES(NUM_SPECIES)
#define NUM_FLAG_BYTES ROUND_BITS_TO_BYTES(FLAGS_COUNT)
#define NUM_TRENDY_SAYING_BYTES ROUND_BITS_TO_BYTES(NUM_TRENDY_SAYINGS)
@@ -523,7 +523,7 @@ struct SaveBlock2
/*0x90*/ u8 filler_90[0x8];
/*0x98*/ struct Time localTimeOffset;
/*0xA0*/ struct Time lastBerryTreeUpdate;
- /*0xA8*/ u32 gcnLinkFlags; // Read by Pokemon Colosseum/XD
+ /*0xA8*/ u32 gcnLinkFlags; // Read by Pokémon Colosseum/XD
/*0xAC*/ u32 encryptionKey;
/*0xB0*/ struct PlayersApprentice playerApprentice;
/*0xDC*/ struct Apprentice apprentices[APPRENTICE_COUNT];
diff --git a/include/graphics.h b/include/graphics.h
index 9fab084f27..9e2fb79539 100644
--- a/include/graphics.h
+++ b/include/graphics.h
@@ -32,7 +32,7 @@ extern const u32 gBallGfx_Premier[];
extern const u32 gBallPal_Premier[];
extern const u32 gOpenPokeballGfx[];
-// pokemon gfx
+// Pokémon gfx
extern const u32 gMonFrontPic_Bulbasaur[];
extern const u32 gMonPalette_Bulbasaur[];
extern const u32 gMonBackPic_Bulbasaur[];
@@ -881,13 +881,13 @@ extern const u32 gMonShinyPalette_Starmie[];
extern const u32 gMonStillFrontPic_Starmie[];
extern const u8 gMonIcon_Starmie[];
extern const u8 gMonFootprint_Starmie[];
-extern const u32 gMonFrontPic_Mrmime[];
-extern const u32 gMonPalette_Mrmime[];
-extern const u32 gMonBackPic_Mrmime[];
-extern const u32 gMonShinyPalette_Mrmime[];
-extern const u32 gMonStillFrontPic_Mrmime[];
-extern const u8 gMonIcon_Mrmime[];
-extern const u8 gMonFootprint_Mrmime[];
+extern const u32 gMonFrontPic_MrMime[];
+extern const u32 gMonPalette_MrMime[];
+extern const u32 gMonBackPic_MrMime[];
+extern const u32 gMonShinyPalette_MrMime[];
+extern const u32 gMonStillFrontPic_MrMime[];
+extern const u8 gMonIcon_MrMime[];
+extern const u8 gMonFootprint_MrMime[];
extern const u32 gMonFrontPic_Scyther[];
extern const u32 gMonPalette_Scyther[];
extern const u32 gMonBackPic_Scyther[];
@@ -3282,7 +3282,7 @@ extern const u32 gBattleTerrainPalette_StadiumGlacia[];
extern const u32 gBattleTerrainPalette_StadiumDrake[];
extern const u32 gBattleTerrainPalette_StadiumWallace[];
-// pokedex
+// Pokédex
extern const u32 gPokedexInterface_Gfx[];
extern const u16 gPokedexBgHoenn_Pal[];
extern const u32 gPokedexMenu_Gfx[];
@@ -4005,7 +4005,7 @@ extern const u32 gBerryPalette_Starf[];
extern const u32 gBerryPic_Enigma[];
extern const u32 gBerryPalette_Enigma[];
-//pokenav
+//PokéNav
extern const u16 gPokenavCondition_Pal[];
extern const u32 gPokenavCondition_Gfx[];
extern const u32 gPokenavCondition_Tilemap[];
@@ -4879,11 +4879,11 @@ extern const u16 gSlotMachineReelTimePikachu_Pal[];
extern const u32 gBattleAnimBgTilemap_Sandstorm[];
extern const u32 gBattleAnimBgImage_Sandstorm[];
-// Pokedex Area Screen
+// Pokédex Area Screen
extern const u32 gPokedexAreaScreenAreaUnknown_Gfx[];
extern const u16 gPokedexAreaScreenAreaUnknown_Pal[];
-// Pokemon Storage System
+// Pokémon Storage System
extern const u32 gStorageSystemMenu_Gfx[];
extern const u16 gStorageSystemPartyMenu_Pal[];
extern const u32 gStorageSystemPartyMenu_Tilemap[];
@@ -5011,7 +5011,7 @@ extern const u32 gBerryCrush_Crusher_Gfx[];
extern const u16 gBerryCrush_Crusher_Pal[];
extern const u32 gBerryCrush_TextWindows_Tilemap[];
-// Pokenav
+// PokéNav
extern const u32 gPokenavMessageBox_Gfx[];
extern const u32 gPokenavMessageBox_Tilemap[];
extern const u16 gPokenavMessageBox_Pal[];
diff --git a/include/pokemon.h b/include/pokemon.h
index 587e731bff..696298bb3e 100644
--- a/include/pokemon.h
+++ b/include/pokemon.h
@@ -203,7 +203,8 @@ struct BoxPokemon
u8 isBadEgg:1;
u8 hasSpecies:1;
u8 isEgg:1;
- u8 unused:5;
+ u8 blockBoxRS:1; // Unused, but Pokémon Box Ruby & Sapphire will refuse to deposit a Pokémon with this flag set
+ u8 unused:4;
u8 otName[PLAYER_NAME_LENGTH];
u8 markings;
u16 checksum;
diff --git a/include/pokemon_summary_screen.h b/include/pokemon_summary_screen.h
index b026baa533..df9e477524 100755
--- a/include/pokemon_summary_screen.h
+++ b/include/pokemon_summary_screen.h
@@ -14,7 +14,7 @@ void ShowPokemonSummaryScreenHandleDeoxys(u8 mode, struct BoxPokemon *mons, u8 m
u8 GetMoveSlotToReplace(void);
void SummaryScreen_SetAnimDelayTaskId(u8 taskId);
-// The Pokemon Summary Screen can operate in different modes. Certain features,
+// The Pokémon Summary Screen can operate in different modes. Certain features,
// such as move re-ordering, are available in the different modes.
enum PokemonSummaryScreenMode
{
diff --git a/include/pokenav.h b/include/pokenav.h
index c6a8bb253e..174c338e27 100644
--- a/include/pokenav.h
+++ b/include/pokenav.h
@@ -65,8 +65,8 @@ struct PokenavMonList
enum
{
POKENAV_MODE_NORMAL, // Chosen from Start menu.
- POKENAV_MODE_FORCE_CALL_READY, // Pokenav tutorial before calling Mr. Stone
- POKENAV_MODE_FORCE_CALL_EXIT, // Pokenav tutorial after calling Mr. Stone
+ POKENAV_MODE_FORCE_CALL_READY, // PokéNav tutorial before calling Mr. Stone
+ POKENAV_MODE_FORCE_CALL_EXIT, // PokéNav tutorial after calling Mr. Stone
};
enum
@@ -232,8 +232,8 @@ enum
[CHECK_PAGE_INTRO_2] = gText_MatchCall##name##_Intro2}
-// Pokenav Function IDs
-// Indices into the LoopedTask tables for each of the main Pokenav features
+// PokéNav Function IDs
+// Indices into the LoopedTask tables for each of the main PokéNav features
enum RegionMapFuncIds
{
diff --git a/include/siirtc.h b/include/siirtc.h
index de4fd634df..ad13fc62f3 100644
--- a/include/siirtc.h
+++ b/include/siirtc.h
@@ -9,6 +9,10 @@
#define SIIRTCINFO_24HOUR 0x40 // 0: 12-hour mode, 1: 24-hour mode
#define SIIRTCINFO_POWER 0x80 // power on or power failure occurred
+#define HOURS_PER_DAY 24
+#define MINUTES_PER_HOUR 60
+#define SECONDS_PER_MINUTE 60
+
enum
{
MONTH_JAN = 1,
@@ -22,7 +26,8 @@ enum
MONTH_SEP,
MONTH_OCT,
MONTH_NOV,
- MONTH_DEC
+ MONTH_DEC,
+ MONTH_COUNT = MONTH_DEC
};
struct SiiRtcInfo
diff --git a/include/strings.h b/include/strings.h
index eeada2b943..3215f70c88 100644
--- a/include/strings.h
+++ b/include/strings.h
@@ -519,7 +519,7 @@ extern const u8 gText_Speed[];
extern const u8 gText_Dash[];
extern const u8 gText_Plus[];
-//pokedex text
+//Pokédex text
extern const u8 gText_CryOf[];
extern const u8 gText_SizeComparedTo[];
extern const u8 gText_PokedexRegistration[];
@@ -1121,7 +1121,7 @@ extern const u8 gTrickHouse_Mechadoll_Six2[];
extern const u8 gTrickHouse_Mechadoll_Seven2[];
extern const u8 gTrickHouse_Mechadoll_Eight2[];
-// Pokedex strings
+// Pokédex strings
extern const u8 gText_SearchForPkmnBasedOnParameters[];
extern const u8 gText_SwitchPokedexListings[];
extern const u8 gText_ReturnToPokedex[];
@@ -2874,7 +2874,7 @@ extern const u8 gText_WantToPlayAgain[];
extern const u8 gText_CommunicationStandby3[];
extern const u8 gText_SomeoneDroppedOut[];
-// Pokemon jump
+// Pokémon jump
extern const u8 gText_WantToPlayAgain2[];
extern const u8 gText_SomeoneDroppedOut2[];
extern const u8 gText_CommunicationStandby4[];
@@ -2949,7 +2949,7 @@ extern const u8 gText_CutenessContest[];
extern const u8 gText_SmartnessContest[];
extern const u8 gText_ToughnessContest[];
-// Pokenav Match Call
+// PokéNav Match Call
extern const u8 gText_CallCantBeMadeHere[];
extern const u8 gText_NumberRegistered[];
extern const u8 gText_NumberOfBattles[];
@@ -2959,7 +2959,7 @@ extern const u8 gText_Call[];
extern const u8 gText_Check[];
extern const u8 gText_Cancel6[];
-// Pokenav Menu Handler
+// PokéNav Menu Handler
extern const u8 gText_CheckMapOfHoenn[];
extern const u8 gText_CheckPokemonInDetail[];
extern const u8 gText_CallRegisteredTrainer[];
@@ -2976,7 +2976,7 @@ extern const u8 gText_FindToughPokemon[];
extern const u8 gText_ReturnToConditionMenu[];
extern const u8 gText_NoRibbonWinners[];
-// Pokenav
+// PokéNav
extern const u8 gText_NumberIndex[];
extern const u8 gText_RibbonsF700[];
diff --git a/ld_script.txt b/ld_script.ld
similarity index 99%
rename from ld_script.txt
rename to ld_script.ld
index 5f1a3e4ed1..0549a6664e 100644
--- a/ld_script.txt
+++ b/ld_script.ld
@@ -3,19 +3,21 @@ ENTRY(Start)
gNumMusicPlayers = 4;
gMaxLines = 0;
+MEMORY
+{
+ EWRAM (rwx) : ORIGIN = 0x2000000, LENGTH = 256K
+ IWRAM (rwx) : ORIGIN = 0x3000000, LENGTH = 32K
+ ROM (rx) : ORIGIN = 0x8000000, LENGTH = 32M
+}
+
/* Modify the following load addresses as needed to make more room. Alternately, delete both the
declarations below and their references further down to get rid of the gaps. */
SECTIONS {
- . = 0x2000000;
- ewram (NOLOAD) :
+ ewram 0x2000000 (NOLOAD) :
ALIGN(4)
{
- gHeap = .;
-
- . = 0x1C000;
-
INCLUDE "sym_ewram.ld"
src/*.o(ewram_data);
gflib/*.o(ewram_data);
@@ -23,12 +25,9 @@ SECTIONS {
*libc.a:impure.o(.data);
*libc.a:locale.o(.data);
*libc.a:mallocr.o(.data);
- . = 0x40000;
- }
+ } > EWRAM
- . = 0x3000000;
-
- iwram (NOLOAD) :
+ iwram 0x3000000 (NOLOAD) :
ALIGN(4)
{
/* .bss starts at 0x3000000 */
@@ -43,10 +42,9 @@ SECTIONS {
/* COMMON starts at 0x30022A8 */
INCLUDE "sym_common.ld"
*libc.a:sbrkr.o(COMMON);
- end = .;
- . = 0x8000;
- }
+ } > IWRAM
+ /* BEGIN ROM DATA */
. = 0x8000000;
.text :
@@ -341,7 +339,7 @@ SECTIONS {
src/gym_leader_rematch.o(.text);
src/battle_transition_frontier.o(.text);
src/international_string_util.o(.text);
- } =0
+ } > ROM =0
script_data :
ALIGN(4)
@@ -354,7 +352,7 @@ SECTIONS {
data/battle_ai_scripts.o(script_data);
data/contest_ai_scripts.o(script_data);
data/mystery_event_script_cmd_table.o(script_data);
- } =0
+ } > ROM =0
lib_text :
ALIGN(4)
@@ -438,7 +436,7 @@ SECTIONS {
*libc.a:libcfunc.o(.text);
*libc.a:lseekr.o(.text);
*libc.a:readr.o(.text);
- } =0
+ } > ROM =0
.rodata :
ALIGN(4)
@@ -704,7 +702,7 @@ SECTIONS {
data/mystery_gift.o(.rodata);
src/m4a_tables.o(.rodata);
data/sound_data.o(.rodata);
- } =0
+ } > ROM =0
song_data :
ALIGN(4)
@@ -1239,7 +1237,7 @@ SECTIONS {
sound/songs/midi/ph_nurse_blend.o(.rodata);
sound/songs/midi/ph_nurse_held.o(.rodata);
sound/songs/midi/ph_nurse_solo.o(.rodata);
- } =0
+ } > ROM =0
lib_rodata :
SUBALIGN(4)
@@ -1292,7 +1290,7 @@ SECTIONS {
*libc.a:lseekr.o(.rodata);
*libc.a:readr.o(.rodata);
src/libisagbprn.o(.rodata);
- } =0
+ } > ROM =0
multiboot_data :
ALIGN(4)
@@ -1300,19 +1298,19 @@ SECTIONS {
data/multiboot_ereader.o(.rodata);
data/multiboot_berry_glitch_fix.o(.rodata);
data/multiboot_pokemon_colosseum.o(.rodata);
- } =0
+ } > ROM =0
anim_mon_front_pic_data :
ALIGN(4)
{
src/anim_mon_front_pics.o(.rodata);
- } =0
+ } > ROM =0
gfx_data :
ALIGN(4)
{
src/graphics.o(.rodata);
- } =0
+ } > ROM =0
extra :
ALIGN(4)
@@ -1322,7 +1320,7 @@ SECTIONS {
src/*.o(.rodata);
gflib/*.o(.rodata);
data/*.o(.rodata);
- } = 0
+ } > ROM = 0
/* DWARF debug sections.
Symbols in the DWARF debugging sections are relative to the beginning
diff --git a/ld_script_modern.txt b/ld_script_modern.ld
similarity index 89%
rename from ld_script_modern.txt
rename to ld_script_modern.ld
index 549d040e1e..4ccbfbaa0f 100644
--- a/ld_script_modern.txt
+++ b/ld_script_modern.ld
@@ -3,46 +3,40 @@ ENTRY(Start)
gNumMusicPlayers = 4;
gMaxLines = 0;
-SECTIONS {
- . = 0x2000000;
-
- ewram (NOLOAD) :
- ALIGN(4)
- {
- gHeap = .;
-
- . = 0x1C000;
-
- src/*.o(ewram_data);
- gflib/*.o(ewram_data);
-
- . = 0x40000;
+MEMORY
+{
+ EWRAM (rwx) : ORIGIN = 0x2000000, LENGTH = 256K
+ IWRAM (rwx) : ORIGIN = 0x3000000, LENGTH = 32K
+ ROM (rx) : ORIGIN = 0x8000000, LENGTH = 32M
}
- . = 0x3000000;
+SECTIONS {
- iwram (NOLOAD) :
+ ewram 0x2000000 (NOLOAD) :
+ ALIGN(4)
+ {
+ src/*.o(ewram_data);
+ gflib/*.o(ewram_data);
+ } > EWRAM
+
+ iwram 0x3000000 (NOLOAD) :
ALIGN(4)
{
- /* .bss starts at 0x3000000 */
src/*.o(.bss);
gflib/*.o(.bss);
data/*.o(.bss);
*libc.a:*.o(.bss*);
*libnosys.a:*.o(.bss*);
- /* .bss.code starts at 0x3001AA8 */
src/m4a.o(.bss.code);
- /* COMMON starts at 0x30022A8 */
src/*.o(COMMON);
gflib/*.o(COMMON);
*libc.a:*.o(COMMON);
*libnosys.a:*.o(COMMON);
- end = .;
- . = 0x8000;
- }
+ } > IWRAM
+ /* BEGIN ROM DATA */
. = 0x8000000;
.text :
@@ -55,13 +49,13 @@ SECTIONS {
gflib/*.o(.text*);
src/*.o(.text*);
asm/*.o(.text*);
- } =0
+ } > ROM =0
script_data :
ALIGN(4)
{
data/*.o(script_data);
- } =0
+ } > ROM =0
lib_text :
ALIGN(4)
@@ -82,7 +76,7 @@ SECTIONS {
*libc.a:*.o(.text*);
*libnosys.a:*.o(.text*);
src/libisagbprn.o(.text);
- } =0
+ } > ROM =0
.rodata :
ALIGN(4)
@@ -90,13 +84,13 @@ SECTIONS {
src/*.o(.rodata*);
gflib/*.o(.rodata*);
data/*.o(.rodata*);
- } =0
+ } > ROM =0
song_data :
ALIGN(4)
{
sound/songs/*.o(.rodata);
- } =0
+ } > ROM =0
lib_rodata :
SUBALIGN(4)
@@ -121,19 +115,19 @@ SECTIONS {
data/multiboot_ereader.o(.rodata);
data/multiboot_berry_glitch_fix.o(.rodata);
data/multiboot_pokemon_colosseum.o(.rodata);
- } =0
+ } > ROM =0
anim_mon_front_pic_data :
ALIGN(4)
{
src/anim_mon_front_pics.o(.rodata);
- } =0
+ } > ROM =0
gfx_data :
ALIGN(4)
{
src/graphics.o(.rodata);
- } =0
+ } > ROM =0
/* DWARF debug sections.
Symbols in the DWARF debugging sections are relative to the beginning
diff --git a/src/AgbRfu_LinkManager.c b/src/AgbRfu_LinkManager.c
index 747a6c7849..e4ee377f7b 100644
--- a/src/AgbRfu_LinkManager.c
+++ b/src/AgbRfu_LinkManager.c
@@ -229,7 +229,7 @@ u8 rfu_LMAN_CHILD_connectParent(u16 parentId, u16 connect_period)
return 0;
}
-static void rfu_LMAN_PARENT_stopWaitLinkRecoveryAndDisconnect(u8 bm_targetSlot)
+static void UNUSED rfu_LMAN_PARENT_stopWaitLinkRecoveryAndDisconnect(u8 bm_targetSlot)
{
u8 i;
@@ -1295,7 +1295,7 @@ void rfu_LMAN_setMSCCallback(void (*MSC_callback_p)(u16))
rfu_setMSCCallback(rfu_LMAN_MSC_callback);
}
-static void rfu_LMAN_setLMANCallback(void (*func)(u8, u8))
+static void UNUSED rfu_LMAN_setLMANCallback(void (*func)(u8, u8))
{
lman.LMAN_callback = func;
}
@@ -1315,7 +1315,7 @@ u8 rfu_LMAN_setLinkRecovery(u8 enable_flag, u16 recovery_period)
return 0;
}
-static u8 rfu_LMAN_setNIFailCounterLimit(u16 NI_failCounter_limit)
+static u8 UNUSED rfu_LMAN_setNIFailCounterLimit(u16 NI_failCounter_limit)
{
if (gRfuLinkStatus->sendSlotNIFlag | gRfuLinkStatus->recvSlotNIFlag)
{
@@ -1327,7 +1327,7 @@ static u8 rfu_LMAN_setNIFailCounterLimit(u16 NI_failCounter_limit)
return 0;
}
-static u8 rfu_LMAN_setFastSearchParent(u8 enable_flag)
+static u8 UNUSED rfu_LMAN_setFastSearchParent(u8 enable_flag)
{
if (lman.state == LMAN_STATE_START_SEARCH_PARENT || lman.state == LMAN_STATE_POLL_SEARCH_PARENT || lman.state == LMAN_STATE_END_SEARCH_PARENT)
{
diff --git a/src/anim_mon_front_pics.c b/src/anim_mon_front_pics.c
index e36cf3492d..de70146078 100644
--- a/src/anim_mon_front_pics.c
+++ b/src/anim_mon_front_pics.c
@@ -123,7 +123,7 @@ const u32 gMonFrontPic_Goldeen[] = INCBIN_U32("graphics/pokemon/goldeen/anim_fro
const u32 gMonFrontPic_Seaking[] = INCBIN_U32("graphics/pokemon/seaking/anim_front.4bpp.lz");
const u32 gMonFrontPic_Staryu[] = INCBIN_U32("graphics/pokemon/staryu/anim_front.4bpp.lz");
const u32 gMonFrontPic_Starmie[] = INCBIN_U32("graphics/pokemon/starmie/anim_front.4bpp.lz");
-const u32 gMonFrontPic_Mrmime[] = INCBIN_U32("graphics/pokemon/mr_mime/anim_front.4bpp.lz");
+const u32 gMonFrontPic_MrMime[] = INCBIN_U32("graphics/pokemon/mr_mime/anim_front.4bpp.lz");
const u32 gMonFrontPic_Scyther[] = INCBIN_U32("graphics/pokemon/scyther/anim_front.4bpp.lz");
const u32 gMonFrontPic_Jynx[] = INCBIN_U32("graphics/pokemon/jynx/anim_front.4bpp.lz");
const u32 gMonFrontPic_Electabuzz[] = INCBIN_U32("graphics/pokemon/electabuzz/anim_front.4bpp.lz");
diff --git a/src/apprentice.c b/src/apprentice.c
index 9ce5ec0dc2..2280412fe7 100644
--- a/src/apprentice.c
+++ b/src/apprentice.c
@@ -623,6 +623,9 @@ static void CreateApprenticeMenu(u8 menu)
default:
left = 0;
top = 0;
+#ifdef UBFIX
+ return;
+#endif
break;
}
@@ -1278,8 +1281,7 @@ const u8 *GetApprenticeNameInLanguage(u32 apprenticeId, s32 language)
}
}
-// Functionally unused
-static void Task_SwitchToFollowupFuncAfterButtonPress(u8 taskId)
+static void UNUSED Task_SwitchToFollowupFuncAfterButtonPress(u8 taskId)
{
if (JOY_NEW(A_BUTTON) || JOY_NEW(B_BUTTON))
SwitchTaskToFollowupFunc(taskId);
@@ -1302,8 +1304,7 @@ static void ExecuteFuncAfterButtonPress(void (*func)(void))
gTasks[taskId].data[1] = (u32)(func) >> 16;
}
-// Unused
-static void ExecuteFollowupFuncAfterButtonPress(TaskFunc task)
+static void UNUSED ExecuteFollowupFuncAfterButtonPress(TaskFunc task)
{
u8 taskId = CreateTask(Task_SwitchToFollowupFuncAfterButtonPress, 1);
SetTaskFuncWithFollowupFunc(taskId, Task_SwitchToFollowupFuncAfterButtonPress, task);
diff --git a/src/battle_ai_script_commands.c b/src/battle_ai_script_commands.c
index aa34f46ec7..4cb4c51654 100644
--- a/src/battle_ai_script_commands.c
+++ b/src/battle_ai_script_commands.c
@@ -1392,7 +1392,7 @@ static void Cmd_get_ability(void)
}
else
{
- AI_THINKING_STRUCT->funcResult = gSpeciesInfo[gBattleMons[battlerId].species].abilities[1]; // AI can't actually reach this part since no pokemon has ability 2 and no ability 1.
+ AI_THINKING_STRUCT->funcResult = gSpeciesInfo[gBattleMons[battlerId].species].abilities[1]; // AI can't actually reach this part since no Pokémon has ability 2 and no ability 1.
}
}
else
@@ -1445,7 +1445,7 @@ static void Cmd_check_ability(void)
}
else
{
- ability = gSpeciesInfo[gBattleMons[battlerId].species].abilities[1]; // AI can't actually reach this part since no pokemon has ability 2 and no ability 1.
+ ability = gSpeciesInfo[gBattleMons[battlerId].species].abilities[1]; // AI can't actually reach this part since no Pokémon has ability 2 and no ability 1.
}
}
else
@@ -1457,9 +1457,9 @@ static void Cmd_check_ability(void)
if (ability == 0)
AI_THINKING_STRUCT->funcResult = 2; // Unable to answer.
else if (ability == gAIScriptPtr[2])
- AI_THINKING_STRUCT->funcResult = 1; // Pokemon has the ability we wanted to check.
+ AI_THINKING_STRUCT->funcResult = 1; // Pokémon has the ability we wanted to check.
else
- AI_THINKING_STRUCT->funcResult = 0; // Pokemon doesn't have the ability we wanted to check.
+ AI_THINKING_STRUCT->funcResult = 0; // Pokémon doesn't have the ability we wanted to check.
gAIScriptPtr += 3;
}
@@ -1484,7 +1484,13 @@ static void Cmd_get_highest_type_effectiveness(void)
if (gCurrentMove != MOVE_NONE)
{
+ // TypeCalc does not assign to gMoveResultFlags, Cmd_typecalc does
+ // This makes the check for gMoveResultFlags below always fail
+#ifdef BUGFIX
+ gMoveResultFlags = TypeCalc(gCurrentMove, sBattler_AI, gBattlerTarget);
+#else
TypeCalc(gCurrentMove, sBattler_AI, gBattlerTarget);
+#endif
if (gBattleMoveDamage == 120) // Super effective STAB.
gBattleMoveDamage = AI_EFFECTIVENESS_x2;
@@ -1519,7 +1525,16 @@ static void Cmd_if_type_effectiveness(void)
gBattleMoveDamage = AI_EFFECTIVENESS_x1;
gCurrentMove = AI_THINKING_STRUCT->moveConsidered;
+ // TypeCalc does not assign to gMoveResultFlags, Cmd_typecalc does
+ // This makes the check for gMoveResultFlags below always fail
+ // This is how you get the "dual non-immunity" glitch, where AI
+ // will use ineffective moves on immune pokémon if the second type
+ // has a non-neutral, non-immune effectiveness
+#ifdef BUGFIX
+ gMoveResultFlags = TypeCalc(gCurrentMove, sBattler_AI, gBattlerTarget);
+#else
TypeCalc(gCurrentMove, sBattler_AI, gBattlerTarget);
+#endif
if (gBattleMoveDamage == 120) // Super effective STAB.
gBattleMoveDamage = AI_EFFECTIVENESS_x2;
@@ -2252,7 +2267,7 @@ static void AIStackPushVar(const u8 *var)
gBattleResources->AI_ScriptsStack->ptr[gBattleResources->AI_ScriptsStack->size++] = var;
}
-static void AIStackPushVar_cursor(void)
+static void UNUSED AIStackPushVar_cursor(void)
{
gBattleResources->AI_ScriptsStack->ptr[gBattleResources->AI_ScriptsStack->size++] = gAIScriptPtr;
}
diff --git a/src/battle_ai_switch_items.c b/src/battle_ai_switch_items.c
index 06cdd6c82f..5ef15b627a 100644
--- a/src/battle_ai_switch_items.c
+++ b/src/battle_ai_switch_items.c
@@ -51,7 +51,7 @@ static bool8 ShouldSwitchIfWonderGuard(void)
if (gBattleMons[GetBattlerAtPosition(opposingPosition)].ability != ABILITY_WONDER_GUARD)
return FALSE;
- // Check if Pokemon has a super effective move.
+ // Check if Pokémon has a super effective move.
for (opposingBattler = GetBattlerAtPosition(opposingPosition), i = 0; i < MAX_MON_MOVES; i++)
{
move = gBattleMons[gActiveBattler].moves[i];
@@ -81,7 +81,7 @@ static bool8 ShouldSwitchIfWonderGuard(void)
else
party = gEnemyParty;
- // Find a Pokemon in the party that has a super effective move.
+ // Find a Pokémon in the party that has a super effective move.
for (i = firstId; i < lastId; i++)
{
if (GetMonData(&party[i], MON_DATA_HP) == 0)
@@ -113,7 +113,7 @@ static bool8 ShouldSwitchIfWonderGuard(void)
}
}
- return FALSE; // There is not a single Pokemon in the party that has a super effective move against a mon with Wonder Guard.
+ return FALSE; // There is not a single Pokémon in the party that has a super effective move against a mon with Wonder Guard.
}
static bool8 FindMonThatAbsorbsOpponentsMove(void)
diff --git a/src/battle_anim_bug.c b/src/battle_anim_bug.c
index 377665684a..a5875a376f 100644
--- a/src/battle_anim_bug.c
+++ b/src/battle_anim_bug.c
@@ -443,7 +443,7 @@ static void AnimMissileArc_Step(struct Sprite *sprite)
else
{
s16 tempData[8];
- u16 *data = sprite->data;
+ s16 *data = sprite->data;
u16 x1 = sprite->x;
s16 x2 = sprite->x2;
u16 y1 = sprite->y;
diff --git a/src/battle_anim_effects_1.c b/src/battle_anim_effects_1.c
index c0ad548f17..3a558969b5 100644
--- a/src/battle_anim_effects_1.c
+++ b/src/battle_anim_effects_1.c
@@ -2765,7 +2765,7 @@ static void AnimConstrictBinding(struct Sprite *sprite)
static void AnimConstrictBinding_Step1(struct Sprite *sprite)
{
- u8 spriteId;
+ u8 UNUSED spriteId;
if ((u16)gBattleAnimArgs[7] == 0xFFFF)
{
@@ -2778,7 +2778,7 @@ static void AnimConstrictBinding_Step1(struct Sprite *sprite)
static void AnimConstrictBinding_Step2(struct Sprite *sprite)
{
- u8 spriteId = GetAnimBattlerSpriteId(ANIM_TARGET);
+ u8 UNUSED spriteId = GetAnimBattlerSpriteId(ANIM_TARGET);
if (!sprite->data[2])
sprite->data[0] += 11;
else
@@ -3884,7 +3884,7 @@ static void AnimSlice_Step(struct Sprite *sprite)
}
}
-static void UnusedFlickerAnim(struct Sprite *sprite)
+static void UNUSED UnusedFlickerAnim(struct Sprite *sprite)
{
if (sprite->data[2] > 1)
{
@@ -4734,7 +4734,7 @@ static void AnimFalseSwipeSlice(struct Sprite *sprite)
static void AnimFalseSwipePositionedSlice(struct Sprite *sprite)
{
- sprite->x = sprite->x = GetBattlerSpriteCoord(gBattleAnimTarget, BATTLER_COORD_X_2) + 0xFFD0 + gBattleAnimArgs[0];
+ sprite->x = GetBattlerSpriteCoord(gBattleAnimTarget, BATTLER_COORD_X_2) - 48 + gBattleAnimArgs[0];
sprite->y = GetBattlerSpriteCoord(gBattleAnimTarget, BATTLER_COORD_Y_PIC_OFFSET);
StartSpriteAnim(sprite, 1);
sprite->data[0] = 0;
@@ -4917,8 +4917,7 @@ void AnimTask_Conversion2AlphaBlend(u8 taskId)
}
}
-// Unused
-static void AnimTask_HideBattlersHealthbox(u8 taskId)
+static void UNUSED AnimTask_HideBattlersHealthbox(u8 taskId)
{
u8 i;
for (i = 0; i < gBattlersCount; i++)
@@ -4933,8 +4932,7 @@ static void AnimTask_HideBattlersHealthbox(u8 taskId)
DestroyAnimVisualTask(taskId);
}
-// Unused
-static void AnimTask_ShowBattlersHealthbox(u8 taskId)
+static void UNUSED AnimTask_ShowBattlersHealthbox(u8 taskId)
{
u8 i;
for (i = 0; i < gBattlersCount; i++)
diff --git a/src/battle_anim_effects_2.c b/src/battle_anim_effects_2.c
index c10bc02b8e..d26e0ba4c7 100755
--- a/src/battle_anim_effects_2.c
+++ b/src/battle_anim_effects_2.c
@@ -2551,8 +2551,8 @@ static void AnimPencil_Step(struct Sprite *sprite)
static void AnimBlendThinRing(struct Sprite *sprite)
{
u8 battler = 0;
- u16 sp0 = 0;
- u16 sp1 = 0;
+ s16 x = 0;
+ s16 y = 0;
u8 r4;
if (gBattleAnimArgs[2] == 0)
@@ -2563,16 +2563,16 @@ static void AnimBlendThinRing(struct Sprite *sprite)
r4 = gBattleAnimArgs[3] ^ 1;
if (IsDoubleBattle() && IsBattlerSpriteVisible(BATTLE_PARTNER(battler)))
{
- SetAverageBattlerPositions(battler, r4, &sp0, &sp1);
+ SetAverageBattlerPositions(battler, r4, &x, &y);
if (r4 == 0)
r4 = GetBattlerSpriteCoord(battler, BATTLER_COORD_X);
else
r4 = GetBattlerSpriteCoord(battler, BATTLER_COORD_X_2);
if (GetBattlerSide(battler) != B_SIDE_PLAYER)
- gBattleAnimArgs[0] -= (sp0 - r4) - gBattleAnimArgs[0]; // This is weird.
+ gBattleAnimArgs[0] -= (x - r4) - gBattleAnimArgs[0]; // This is weird.
else
- gBattleAnimArgs[0] = sp0 - r4;
+ gBattleAnimArgs[0] = x - r4;
}
sprite->callback = AnimSpriteOnMonPos;
diff --git a/src/battle_anim_effects_3.c b/src/battle_anim_effects_3.c
index 5168641c6a..6b169c5430 100755
--- a/src/battle_anim_effects_3.c
+++ b/src/battle_anim_effects_3.c
@@ -1428,8 +1428,7 @@ static void FadeScreenToWhite_Step(u8 taskId)
static void AnimSpikes(struct Sprite *sprite)
{
- u16 x;
- u16 y;
+ s16 x, y;
InitSpritePosToAnimAttacker(sprite, TRUE);
SetAverageBattlerPositions(gBattleAnimTarget, FALSE, &x, &y);
@@ -4758,8 +4757,8 @@ static void AnimMeteorMashStar_Step(struct Sprite *sprite)
// arg 4: duration
static void AnimMeteorMashStar(struct Sprite *sprite)
{
- s16 y = GetBattlerSpriteCoord(gBattleAnimTarget, BATTLER_COORD_X_2); // unused local variable
- s16 x = GetBattlerSpriteCoord(gBattleAnimTarget, BATTLER_COORD_Y_PIC_OFFSET); // unused local variable
+ s16 UNUSED y = GetBattlerSpriteCoord(gBattleAnimTarget, BATTLER_COORD_X_2);
+ s16 UNUSED x = GetBattlerSpriteCoord(gBattleAnimTarget, BATTLER_COORD_Y_PIC_OFFSET);
if (GetBattlerSide(gBattleAnimTarget) == B_SIDE_PLAYER || IsContest())
{
diff --git a/src/battle_anim_flying.c b/src/battle_anim_flying.c
index 7e5c5e9393..c5e59a65af 100644
--- a/src/battle_anim_flying.c
+++ b/src/battle_anim_flying.c
@@ -1220,8 +1220,7 @@ void AnimSkyAttackBird_Step(struct Sprite *sprite)
DestroySpriteAndMatrix(sprite);
}
-// Unused
-static void AnimTask_SetAttackerVisibility(u8 taskId)
+static void UNUSED AnimTask_SetAttackerVisibility(u8 taskId)
{
if (gBattleAnimArgs[0] == 0)
{
diff --git a/src/battle_anim_mon_movement.c b/src/battle_anim_mon_movement.c
index 247aba1a42..4c8e79cb9f 100644
--- a/src/battle_anim_mon_movement.c
+++ b/src/battle_anim_mon_movement.c
@@ -535,7 +535,7 @@ static void SlideMonToOriginalPos_Step(struct Sprite *sprite)
}
// Linearly translates a mon to a target offset. The horizontal offset
-// is mirrored for the opponent's pokemon, and the vertical offset
+// is mirrored for the opponent's Pokémon, and the vertical offset
// is only mirrored if arg 3 is set to 1.
// arg 0: 0 = attacker, 1 = target
// arg 1: target x pixel offset
diff --git a/src/battle_anim_mons.c b/src/battle_anim_mons.c
index d9fd652311..d28ec804fe 100644
--- a/src/battle_anim_mons.c
+++ b/src/battle_anim_mons.c
@@ -77,7 +77,7 @@ static const u8 sCastformBackSpriteYCoords[NUM_CASTFORM_FORMS] =
[CASTFORM_ICE] = 0,
};
-// Placeholders for pokemon sprites to be created for a move animation effect (e.g. Role Play / Snatch)
+// Placeholders for Pokémon sprites to be created for a move animation effect (e.g. Role Play / Snatch)
#define TAG_MOVE_EFFECT_MON_1 55125
#define TAG_MOVE_EFFECT_MON_2 55126
@@ -485,9 +485,8 @@ void TranslateSpriteInGrowingCircle(struct Sprite *sprite)
}
}
-// Unused
// Exact shape depends on arguments. Can move in a figure-8-like pattern, or circular, etc.
-static void TranslateSpriteInLissajousCurve(struct Sprite *sprite)
+static void UNUSED TranslateSpriteInLissajousCurve(struct Sprite *sprite)
{
if (sprite->sDuration)
{
@@ -639,8 +638,7 @@ static void TranslateSpriteLinearFixedPointIconFrame(struct Sprite *sprite)
UpdateMonIconFrame(sprite);
}
-// Unused
-static void TranslateSpriteToBattleTargetPos(struct Sprite *sprite)
+static void UNUSED TranslateSpriteToBattleTargetPos(struct Sprite *sprite)
{
sprite->sStartX = sprite->x + sprite->x2;
sprite->sStartY = sprite->y + sprite->y2;
@@ -707,8 +705,7 @@ void DestroySpriteAndMatrix(struct Sprite *sprite)
DestroyAnimSprite(sprite);
}
-// Unused
-static void TranslateSpriteToBattleAttackerPos(struct Sprite *sprite)
+static void UNUSED TranslateSpriteToBattleAttackerPos(struct Sprite *sprite)
{
sprite->sStartX = sprite->x + sprite->x2;
sprite->sStartY = sprite->y + sprite->y2;
@@ -723,8 +720,7 @@ static void TranslateSpriteToBattleAttackerPos(struct Sprite *sprite)
#undef sStartY
#undef sTargetY
-// Unused
-static void EndUnkPaletteAnim(struct Sprite *sprite)
+static void UNUSED EndUnkPaletteAnim(struct Sprite *sprite)
{
PaletteStruct_ResetById(sprite->data[5]);
DestroySpriteAndMatrix(sprite);
@@ -1103,8 +1099,7 @@ void StartAnimLinearTranslation(struct Sprite *sprite)
sprite->callback(sprite);
}
-// Unused
-static void StartAnimLinearTranslation_SetCornerVecX(struct Sprite *sprite)
+static void UNUSED StartAnimLinearTranslation_SetCornerVecX(struct Sprite *sprite)
{
sprite->data[1] = sprite->x;
sprite->data[3] = sprite->y;
@@ -1512,8 +1507,7 @@ u8 GetSpritePalIdxByBattler(u8 battler)
return battler;
}
-// Unused
-static u8 GetSpritePalIdxByPosition(u8 position)
+static u8 UNUSED GetSpritePalIdxByPosition(u8 position)
{
return GetBattlerAtPosition(position);
}
@@ -2012,8 +2006,7 @@ void AnimTask_GetFrustrationPowerLevel(u8 taskId)
DestroyAnimVisualTask(taskId);
}
-// Unused
-static void SetPriorityForVisibleBattlers(u8 priority)
+static void UNUSED SetPriorityForVisibleBattlers(u8 priority)
{
if (IsBattlerSpriteVisible(gBattleAnimTarget))
gSprites[gBattlerSpriteIds[gBattleAnimTarget]].oam.priority = priority;
@@ -2092,7 +2085,7 @@ u8 GetBattlerSpriteBGPriorityRank(u8 battlerId)
return 1;
}
-// Create pokemon sprite to be used for a move animation effect (e.g. Role Play / Snatch)
+// Create Pokémon sprite to be used for a move animation effect (e.g. Role Play / Snatch)
u8 CreateAdditionalMonSpriteForMoveAnim(u16 species, bool8 isBackpic, u8 id, s16 x, s16 y, u8 subpriority, u32 personality, u32 trainerId, u32 battlerId, bool32 ignoreDeoxysForm)
{
u8 spriteId;
diff --git a/src/battle_anim_status_effects.c b/src/battle_anim_status_effects.c
index b987ad33a3..cc04843b7f 100644
--- a/src/battle_anim_status_effects.c
+++ b/src/battle_anim_status_effects.c
@@ -270,8 +270,7 @@ static const struct SpriteTemplate sFlashingCircleImpactSpriteTemplate =
.callback = AnimFlashingCircleImpact,
};
-// Unused
-static u8 Task_FlashingCircleImpacts(u8 battlerId, bool8 red)
+static u8 UNUSED Task_FlashingCircleImpacts(u8 battlerId, bool8 red)
{
u8 battlerSpriteId = gBattlerSpriteIds[battlerId];
u8 taskId = CreateTask(Task_UpdateFlashingCircleImpacts, 10);
diff --git a/src/battle_anim_throw.c b/src/battle_anim_throw.c
index fea67a6e3c..8296126f14 100755
--- a/src/battle_anim_throw.c
+++ b/src/battle_anim_throw.c
@@ -2386,11 +2386,11 @@ static void SpriteCB_ShinyStars_Diagonal(struct Sprite *sprite)
void AnimTask_LoadPokeblockGfx(u8 taskId)
{
- u8 paletteIndex;
+ u8 UNUSED paletteIndex;
LoadCompressedSpriteSheetUsingHeap(&gBattleAnimPicTable[ANIM_TAG_POKEBLOCK - ANIM_SPRITES_START]);
LoadCompressedSpritePaletteUsingHeap(&gBattleAnimPaletteTable[ANIM_TAG_POKEBLOCK - ANIM_SPRITES_START]);
- paletteIndex = IndexOfSpritePaletteTag(ANIM_TAG_POKEBLOCK); // unused
+ paletteIndex = IndexOfSpritePaletteTag(ANIM_TAG_POKEBLOCK);
DestroyAnimVisualTask(taskId);
}
diff --git a/src/battle_anim_utility_funcs.c b/src/battle_anim_utility_funcs.c
index ccbc7f902b..18a599a4c1 100644
--- a/src/battle_anim_utility_funcs.c
+++ b/src/battle_anim_utility_funcs.c
@@ -69,6 +69,9 @@ void AnimTask_BlendBattleAnimPalExclude(u8 taskId)
selectedPalettes = 0;
// fall through
case ANIM_ATTACKER:
+#ifdef UBFIX
+ default:
+#endif
animBattlers[0] = gBattleAnimAttacker;
break;
case 3:
@@ -806,7 +809,7 @@ void AnimTask_SetAllNonAttackersInvisiblity(u8 taskId)
DestroyAnimVisualTask(taskId);
}
-void StartMonScrollingBgMask(u8 taskId, int unused, u16 scrollSpeed, u8 battler, bool8 includePartner, u8 numFadeSteps, u8 fadeStepDelay, u8 duration, const u32 *gfx, const u32 *tilemap, const u32 *palette)
+void StartMonScrollingBgMask(u8 taskId, int UNUSED unused, u16 scrollSpeed, u8 battler, bool8 includePartner, u8 numFadeSteps, u8 fadeStepDelay, u8 duration, const u32 *gfx, const u32 *tilemap, const u32 *palette)
{
u16 species;
u8 spriteId, spriteId2;
diff --git a/src/battle_arena.c b/src/battle_arena.c
index 98ec43fc1d..ed3cf16dfd 100644
--- a/src/battle_arena.c
+++ b/src/battle_arena.c
@@ -651,8 +651,7 @@ void BattleArena_DeductSkillPoints(u8 battler, u16 stringId)
}
}
-// Unused
-static void UpdateHPAtStart(u8 battler)
+static void UNUSED UpdateHPAtStart(u8 battler)
{
u16 *hpAtStart = gBattleStruct->arenaStartHp;
diff --git a/src/battle_bg.c b/src/battle_bg.c
index b3091d965e..05073db96d 100644
--- a/src/battle_bg.c
+++ b/src/battle_bg.c
@@ -692,9 +692,9 @@ static const struct BattleBackground sBattleTerrainTable[] =
},
};
-static void CB2_UnusedBattleInit(void);
+static void UNUSED CB2_UnusedBattleInit(void);
-static void UnusedBattleInit(void)
+static void UNUSED UnusedBattleInit(void)
{
u8 spriteId;
@@ -704,7 +704,7 @@ static void UnusedBattleInit(void)
SetMainCallback2(CB2_UnusedBattleInit);
}
-static void CB2_UnusedBattleInit(void)
+static void UNUSED CB2_UnusedBattleInit(void)
{
AnimateSprites();
BuildOamBuffer();
diff --git a/src/battle_controller_link_opponent.c b/src/battle_controller_link_opponent.c
index 2104298775..236db2a428 100644
--- a/src/battle_controller_link_opponent.c
+++ b/src/battle_controller_link_opponent.c
@@ -529,7 +529,7 @@ static void LinkOpponentBufferExecCompleted(void)
static void LinkOpponentHandleGetMonData(void)
{
- u8 monData[sizeof(struct Pokemon) * 2 + 56]; // this allows to get full data of two pokemon, trying to get more will result in overwriting data
+ u8 monData[sizeof(struct Pokemon) * 2 + 56]; // this allows to get full data of two Pokémon, trying to get more will result in overwriting data
u32 size = 0;
u8 monToCheck;
s32 i;
diff --git a/src/battle_controller_link_partner.c b/src/battle_controller_link_partner.c
index 054563ad3a..7a437b958c 100644
--- a/src/battle_controller_link_partner.c
+++ b/src/battle_controller_link_partner.c
@@ -423,7 +423,7 @@ static void CompleteOnFinishedBattleAnimation(void)
static void LinkPartnerHandleGetMonData(void)
{
- u8 monData[sizeof(struct Pokemon) * 2 + 56]; // this allows to get full data of two pokemon, trying to get more will result in overwriting data
+ u8 monData[sizeof(struct Pokemon) * 2 + 56]; // this allows to get full data of two Pokémon, trying to get more will result in overwriting data
u32 size = 0;
u8 monToCheck;
s32 i;
diff --git a/src/battle_controller_opponent.c b/src/battle_controller_opponent.c
index e434e3ee62..e5284f9abc 100644
--- a/src/battle_controller_opponent.c
+++ b/src/battle_controller_opponent.c
@@ -534,7 +534,7 @@ static void OpponentBufferExecCompleted(void)
static void OpponentHandleGetMonData(void)
{
- u8 monData[sizeof(struct Pokemon) * 2 + 56]; // this allows to get full data of two pokemon, trying to get more will result in overwriting data
+ u8 monData[sizeof(struct Pokemon) * 2 + 56]; // this allows to get full data of two Pokémon, trying to get more will result in overwriting data
u32 size = 0;
u8 monToCheck;
s32 i;
diff --git a/src/battle_controller_player.c b/src/battle_controller_player.c
index dbd121d7db..bdff3ad77d 100644
--- a/src/battle_controller_player.c
+++ b/src/battle_controller_player.c
@@ -330,7 +330,7 @@ static void HandleInputChooseAction(void)
}
}
-static void UnusedEndBounceEffect(void)
+static void UNUSED UnusedEndBounceEffect(void)
{
EndBounceEffect(gActiveBattler, BOUNCE_HEALTHBOX);
EndBounceEffect(gActiveBattler, BOUNCE_MON);
@@ -615,7 +615,7 @@ static void HandleInputChooseMove(void)
}
}
-static u32 HandleMoveInputUnused(void)
+static u32 UNUSED HandleMoveInputUnused(void)
{
u32 var = 0;
@@ -982,12 +982,12 @@ static void Intro_TryShinyAnimShowHealthbox(void)
bool32 bgmRestored = FALSE;
bool32 battlerAnimsDone = FALSE;
- // Start shiny animation if applicable for 1st pokemon
+ // Start shiny animation if applicable for 1st Pokémon
if (!gBattleSpritesDataPtr->healthBoxesData[gActiveBattler].triedShinyMonAnim
&& !gBattleSpritesDataPtr->healthBoxesData[gActiveBattler].ballAnimActive)
TryShinyAnimation(gActiveBattler, &gPlayerParty[gBattlerPartyIndexes[gActiveBattler]]);
- // Start shiny animation if applicable for 2nd pokemon
+ // Start shiny animation if applicable for 2nd Pokémon
if (!gBattleSpritesDataPtr->healthBoxesData[BATTLE_PARTNER(gActiveBattler)].triedShinyMonAnim
&& !gBattleSpritesDataPtr->healthBoxesData[BATTLE_PARTNER(gActiveBattler)].ballAnimActive)
TryShinyAnimation(BATTLE_PARTNER(gActiveBattler), &gPlayerParty[gBattlerPartyIndexes[BATTLE_PARTNER(gActiveBattler)]]);
@@ -1582,7 +1582,7 @@ static void PrintLinkStandbyMsg(void)
static void PlayerHandleGetMonData(void)
{
- u8 monData[sizeof(struct Pokemon) * 2 + 56]; // this allows to get full data of two pokemon, trying to get more will result in overwriting data
+ u8 monData[sizeof(struct Pokemon) * 2 + 56]; // this allows to get full data of two Pokémon, trying to get more will result in overwriting data
u32 size = 0;
u8 monToCheck;
s32 i;
diff --git a/src/battle_controller_player_partner.c b/src/battle_controller_player_partner.c
index 236a66ce83..307eeca26a 100644
--- a/src/battle_controller_player_partner.c
+++ b/src/battle_controller_player_partner.c
@@ -607,7 +607,7 @@ static void CompleteOnFinishedBattleAnimation(void)
static void PlayerPartnerHandleGetMonData(void)
{
- u8 monData[sizeof(struct Pokemon) * 2 + 56]; // this allows to get full data of two pokemon, trying to get more will result in overwriting data
+ u8 monData[sizeof(struct Pokemon) * 2 + 56]; // this allows to get full data of two Pokémon, trying to get more will result in overwriting data
u32 size = 0;
u8 monToCheck;
s32 i;
diff --git a/src/battle_controller_recorded_opponent.c b/src/battle_controller_recorded_opponent.c
index b2db595f8a..7cb5839bc5 100644
--- a/src/battle_controller_recorded_opponent.c
+++ b/src/battle_controller_recorded_opponent.c
@@ -186,7 +186,7 @@ static void CompleteOnBattlerSpriteCallbackDummy(void)
RecordedOpponentBufferExecCompleted();
}
-static void CompleteOnBankSpriteCallbackDummy2(void)
+static void UNUSED CompleteOnBankSpriteCallbackDummy2(void)
{
if (gSprites[gBattlerSpriteIds[gActiveBattler]].callback == SpriteCallbackDummy)
RecordedOpponentBufferExecCompleted();
@@ -515,7 +515,7 @@ static void RecordedOpponentBufferExecCompleted(void)
static void RecordedOpponentHandleGetMonData(void)
{
- u8 monData[sizeof(struct Pokemon) * 2 + 56]; // this allows to get full data of two pokemon, trying to get more will result in overwriting data
+ u8 monData[sizeof(struct Pokemon) * 2 + 56]; // this allows to get full data of two Pokémon, trying to get more will result in overwriting data
u32 size = 0;
u8 monToCheck;
s32 i;
diff --git a/src/battle_controller_recorded_player.c b/src/battle_controller_recorded_player.c
index 591ddb67e3..5a7be7f347 100644
--- a/src/battle_controller_recorded_player.c
+++ b/src/battle_controller_recorded_player.c
@@ -498,7 +498,7 @@ static void CompleteOnFinishedBattleAnimation(void)
static void RecordedPlayerHandleGetMonData(void)
{
- u8 monData[sizeof(struct Pokemon) * 2 + 56]; // this allows to get full data of two pokemon, trying to get more will result in overwriting data
+ u8 monData[sizeof(struct Pokemon) * 2 + 56]; // this allows to get full data of two Pokémon, trying to get more will result in overwriting data
u32 size = 0;
u8 monToCheck;
s32 i;
diff --git a/src/battle_controller_safari.c b/src/battle_controller_safari.c
index 5e8ef2d286..157bb6954c 100644
--- a/src/battle_controller_safari.c
+++ b/src/battle_controller_safari.c
@@ -147,7 +147,7 @@ static void (*const sSafariBufferCommands[CONTROLLER_CMDS_COUNT])(void) =
[CONTROLLER_TERMINATOR_NOP] = SafariCmdEnd
};
-static void SpriteCB_Null4(void)
+static void UNUSED SpriteCB_Null4(void)
{
}
@@ -307,7 +307,7 @@ static void SafariBufferExecCompleted(void)
}
}
-static void CompleteOnFinishedStatusAnimation(void)
+static void UNUSED CompleteOnFinishedStatusAnimation(void)
{
if (!gBattleSpritesDataPtr->healthBoxesData[gActiveBattler].statusAnimActive)
SafariBufferExecCompleted();
diff --git a/src/battle_controller_wally.c b/src/battle_controller_wally.c
index 5b94f2dd26..67950b8965 100644
--- a/src/battle_controller_wally.c
+++ b/src/battle_controller_wally.c
@@ -161,7 +161,7 @@ static void (*const sWallyBufferCommands[CONTROLLER_CMDS_COUNT])(void) =
[CONTROLLER_TERMINATOR_NOP] = WallyCmdEnd
};
-static void SpriteCB_Null7(void)
+static void UNUSED SpriteCB_Null7(void)
{
}
@@ -417,7 +417,7 @@ static void WallyBufferExecCompleted(void)
}
}
-static void CompleteOnFinishedStatusAnimation(void)
+static void UNUSED CompleteOnFinishedStatusAnimation(void)
{
if (!gBattleSpritesDataPtr->healthBoxesData[gActiveBattler].statusAnimActive)
WallyBufferExecCompleted();
@@ -425,7 +425,7 @@ static void CompleteOnFinishedStatusAnimation(void)
static void WallyHandleGetMonData(void)
{
- u8 monData[sizeof(struct Pokemon) * 2 + 56]; // this allows to get full data of two pokemon, trying to get more will result in overwriting data
+ u8 monData[sizeof(struct Pokemon) * 2 + 56]; // this allows to get full data of two Pokémon, trying to get more will result in overwriting data
u32 size = 0;
u8 monToCheck;
s32 i;
diff --git a/src/battle_controllers.c b/src/battle_controllers.c
index b93e65fdc0..2ba5d4329d 100644
--- a/src/battle_controllers.c
+++ b/src/battle_controllers.c
@@ -905,8 +905,7 @@ void BtlController_EmitGetMonData(u8 bufferId, u8 requestId, u8 monToCheck)
PrepareBufferDataTransfer(bufferId, sBattleBuffersTransferData, 4);
}
-// Unused
-static void BtlController_EmitGetRawMonData(u8 bufferId, u8 monId, u8 bytes)
+static void UNUSED BtlController_EmitGetRawMonData(u8 bufferId, u8 monId, u8 bytes)
{
sBattleBuffersTransferData[0] = CONTROLLER_GETRAWMONDATA;
sBattleBuffersTransferData[1] = monId;
@@ -927,8 +926,7 @@ void BtlController_EmitSetMonData(u8 bufferId, u8 requestId, u8 monToCheck, u8 b
PrepareBufferDataTransfer(bufferId, sBattleBuffersTransferData, 3 + bytes);
}
-// Unused
-static void BtlController_EmitSetRawMonData(u8 bufferId, u8 monId, u8 bytes, void *data)
+static void UNUSED BtlController_EmitSetRawMonData(u8 bufferId, u8 monId, u8 bytes, void *data)
{
s32 i;
@@ -1001,8 +999,7 @@ void BtlController_EmitFaintAnimation(u8 bufferId)
PrepareBufferDataTransfer(bufferId, sBattleBuffersTransferData, 4);
}
-// Unused
-static void BtlController_EmitPaletteFade(u8 bufferId)
+static void UNUSED BtlController_EmitPaletteFade(u8 bufferId)
{
sBattleBuffersTransferData[0] = CONTROLLER_PALETTEFADE;
sBattleBuffersTransferData[1] = CONTROLLER_PALETTEFADE;
@@ -1011,8 +1008,7 @@ static void BtlController_EmitPaletteFade(u8 bufferId)
PrepareBufferDataTransfer(bufferId, sBattleBuffersTransferData, 4);
}
-// Unused
-static void BtlController_EmitSuccessBallThrowAnim(u8 bufferId)
+static void UNUSED BtlController_EmitSuccessBallThrowAnim(u8 bufferId)
{
sBattleBuffersTransferData[0] = CONTROLLER_SUCCESSBALLTHROWANIM;
sBattleBuffersTransferData[1] = CONTROLLER_SUCCESSBALLTHROWANIM;
@@ -1028,8 +1024,7 @@ void BtlController_EmitBallThrowAnim(u8 bufferId, u8 caseId)
PrepareBufferDataTransfer(bufferId, sBattleBuffersTransferData, 2);
}
-// Unused
-static void BtlController_EmitPause(u8 bufferId, u8 toWait, void *data)
+static void UNUSED BtlController_EmitPause(u8 bufferId, u8 toWait, void *data)
{
s32 i;
@@ -1188,8 +1183,7 @@ void BtlController_EmitChoosePokemon(u8 bufferId, u8 caseId, u8 slotId, u8 abili
PrepareBufferDataTransfer(bufferId, sBattleBuffersTransferData, 8); // Only 7 bytes were written.
}
-// Unused
-static void BtlController_EmitCmd23(u8 bufferId)
+static void UNUSED BtlController_EmitCmd23(u8 bufferId)
{
sBattleBuffersTransferData[0] = CONTROLLER_23;
sBattleBuffersTransferData[1] = CONTROLLER_23;
@@ -1243,8 +1237,7 @@ void BtlController_EmitStatusAnimation(u8 bufferId, bool8 status2, u32 status)
PrepareBufferDataTransfer(bufferId, sBattleBuffersTransferData, 6);
}
-// Unused
-static void BtlController_EmitStatusXor(u8 bufferId, u8 b)
+static void UNUSED BtlController_EmitStatusXor(u8 bufferId, u8 b)
{
sBattleBuffersTransferData[0] = CONTROLLER_STATUSXOR;
sBattleBuffersTransferData[1] = b;
@@ -1264,8 +1257,7 @@ void BtlController_EmitDataTransfer(u8 bufferId, u16 size, void *data)
PrepareBufferDataTransfer(bufferId, sBattleBuffersTransferData, size + 4);
}
-// Unused
-static void BtlController_EmitDMA3Transfer(u8 bufferId, void *dst, u16 size, void *data)
+static void UNUSED BtlController_EmitDMA3Transfer(u8 bufferId, void *dst, u16 size, void *data)
{
s32 i;
@@ -1281,8 +1273,7 @@ static void BtlController_EmitDMA3Transfer(u8 bufferId, void *dst, u16 size, voi
PrepareBufferDataTransfer(bufferId, sBattleBuffersTransferData, size + 7);
}
-// Unused
-static void BtlController_EmitPlayBGM(u8 bufferId, u16 songId, void *data)
+static void UNUSED BtlController_EmitPlayBGM(u8 bufferId, u16 songId, void *data)
{
s32 i;
@@ -1297,8 +1288,7 @@ static void BtlController_EmitPlayBGM(u8 bufferId, u16 songId, void *data)
PrepareBufferDataTransfer(bufferId, sBattleBuffersTransferData, songId + 3);
}
-// Unused
-static void BtlController_EmitCmd32(u8 bufferId, u16 size, void *data)
+static void UNUSED BtlController_EmitCmd32(u8 bufferId, u16 size, void *data)
{
s32 i;
@@ -1348,8 +1338,7 @@ void BtlController_EmitOneReturnValue_Duplicate(u8 bufferId, u16 ret)
PrepareBufferDataTransfer(bufferId, sBattleBuffersTransferData, 4);
}
-// Unused
-static void BtlController_EmitClearUnkVar(u8 bufferId)
+static void UNUSED BtlController_EmitClearUnkVar(u8 bufferId)
{
sBattleBuffersTransferData[0] = CONTROLLER_CLEARUNKVAR;
sBattleBuffersTransferData[1] = CONTROLLER_CLEARUNKVAR;
@@ -1358,16 +1347,14 @@ static void BtlController_EmitClearUnkVar(u8 bufferId)
PrepareBufferDataTransfer(bufferId, sBattleBuffersTransferData, 4);
}
-// Unused
-static void BtlController_EmitSetUnkVar(u8 bufferId, u8 b)
+static void UNUSED BtlController_EmitSetUnkVar(u8 bufferId, u8 b)
{
sBattleBuffersTransferData[0] = CONTROLLER_SETUNKVAR;
sBattleBuffersTransferData[1] = b;
PrepareBufferDataTransfer(bufferId, sBattleBuffersTransferData, 2);
}
-// Unused
-static void BtlController_EmitClearUnkFlag(u8 bufferId)
+static void UNUSED BtlController_EmitClearUnkFlag(u8 bufferId)
{
sBattleBuffersTransferData[0] = CONTROLLER_CLEARUNKFLAG;
sBattleBuffersTransferData[1] = CONTROLLER_CLEARUNKFLAG;
@@ -1376,8 +1363,7 @@ static void BtlController_EmitClearUnkFlag(u8 bufferId)
PrepareBufferDataTransfer(bufferId, sBattleBuffersTransferData, 4);
}
-// Unused
-static void BtlController_EmitToggleUnkFlag(u8 bufferId)
+static void UNUSED BtlController_EmitToggleUnkFlag(u8 bufferId)
{
sBattleBuffersTransferData[0] = CONTROLLER_TOGGLEUNKFLAG;
sBattleBuffersTransferData[1] = CONTROLLER_TOGGLEUNKFLAG;
diff --git a/src/battle_dome.c b/src/battle_dome.c
index 6ecb254baa..68cae14a6e 100644
--- a/src/battle_dome.c
+++ b/src/battle_dome.c
@@ -1667,13 +1667,13 @@ static const u8 sTourneyTreePokeballCoords[DOME_TOURNAMENT_TRAINERS_COUNT + DOME
{.tile = LINE_V_L, .y = 9, .x = 17}, \
{.tile = LINE_V_L, .y = 10, .x = 17}, \
{.tile = LINE_V_L_HALF_LOGO, .y = 11, .x = 17},
-
+
#define LINESECTION_SEMIFINAL_BOTTOM_RIGHT \
{.tile = LINE_V_L_LOGO4, .y = 14, .x = 17}, \
{.tile = LINE_V_L_LOGO3, .y = 13, .x = 17}, \
{.tile = LINE_V_L_LOGO2, .y = 12, .x = 17}, \
{.tile = LINE_V_L_LOGO1, .y = 11, .x = 17},
-
+
#define LINESECTION_FINAL_LEFT \
{.tile = LINE_H_LOGO1, .y = 11, .x = 13}, \
{.tile = LINE_H_LOGO2, .y = 11, .x = 14},
@@ -2588,7 +2588,7 @@ static void CreateDomeOpponentMon(u8 monPartyId, u16 tournamentTrainerId, u8 tou
#ifdef BUGFIX
u8 fixedIv = GetDomeTrainerMonIvs(DOME_TRAINERS[tournamentTrainerId].trainerId);
#else
- u8 fixedIv = GetDomeTrainerMonIvs(tournamentTrainerId); // BUG: Using the wrong ID. As a result, all Pokemon have ivs of 3.
+ u8 fixedIv = GetDomeTrainerMonIvs(tournamentTrainerId); // BUG: Using the wrong ID. As a result, all Pokémon have ivs of 3.
#endif
u8 level = SetFacilityPtrsGetLevel();
CreateMonWithEVSpreadNatureOTID(&gEnemyParty[monPartyId],
@@ -2650,13 +2650,13 @@ static void CreateDomeOpponentMons(u16 tournamentTrainerId)
}
}
-// Returns a bitmask representing which 2 of the trainer's 3 pokemon to select.
+// Returns a bitmask representing which 2 of the trainer's 3 Pokémon to select.
// The choice is calculated solely depending on the type effectiveness of their
-// movesets against the player's pokemon.
+// movesets against the player's Pokémon.
// There is a 50% chance of either a "good" or "bad" selection mode being used.
// In the good mode movesets are preferred which are more effective against the
-// player, and in the bad mode the opposite is true. If all 3 pokemon tie, the
-// other mode will be tried. If they tie again, the pokemon selection is random.
+// player, and in the bad mode the opposite is true. If all 3 Pokémon tie, the
+// other mode will be tried. If they tie again, the Pokémon selection is random.
int GetDomeTrainerSelectedMons(u16 tournamentTrainerId)
{
int selectedMonBits;
@@ -4837,7 +4837,7 @@ static void DisplayMatchInfoOnCard(u8 flags, u8 matchNo)
if (lost[1])
gSprites[sInfoCard->spriteIds[1 + arrId]].oam.paletteNum = 3;
- // Draw left trainer's pokemon icons.
+ // Draw left trainer's Pokémon icons.
for (i = 0; i < FRONTIER_PARTY_SIZE; i++)
{
if (trainerIds[0] == TRAINER_PLAYER)
@@ -4877,7 +4877,7 @@ static void DisplayMatchInfoOnCard(u8 flags, u8 matchNo)
}
}
- // Draw right trainer's pokemon icons.
+ // Draw right trainer's Pokémon icons.
for (i = 0; i < FRONTIER_PARTY_SIZE; i++)
{
if (trainerIds[1] == TRAINER_PLAYER)
@@ -5228,7 +5228,7 @@ static u16 GetWinningMove(int winnerTournamentId, int loserTournamentId, u8 roun
int movePower = 0;
SetFacilityPtrsGetLevel();
- // Calc move points of all 4 moves for all 3 pokemon hitting all 3 target mons.
+ // Calc move points of all 4 moves for all 3 Pokémon hitting all 3 target mons.
for (i = 0; i < FRONTIER_PARTY_SIZE; i++)
{
for (j = 0; j < MAX_MON_MOVES; j++)
diff --git a/src/battle_factory.c b/src/battle_factory.c
index 5905b41917..faed16ebb0 100644
--- a/src/battle_factory.c
+++ b/src/battle_factory.c
@@ -337,7 +337,7 @@ static void GenerateOpponentMons(void)
if (gFacilityTrainerMons[monId].species == SPECIES_UNOWN)
continue;
- // Ensure none of the opponent's pokemon are the same as the potential rental pokemon for the player
+ // Ensure none of the opponent's Pokémon are the same as the potential rental Pokémon for the player
for (j = 0; j < (int)ARRAY_COUNT(gSaveBlock2Ptr->frontier.rentalMons); j++)
{
if (gFacilityTrainerMons[monId].species == gFacilityTrainerMons[gSaveBlock2Ptr->frontier.rentalMons[j].monId].species)
@@ -346,7 +346,7 @@ static void GenerateOpponentMons(void)
if (j != (int)ARRAY_COUNT(gSaveBlock2Ptr->frontier.rentalMons))
continue;
- // "High tier" pokemon are only allowed on open level mode
+ // "High tier" Pokémon are only allowed on open level mode
if (lvlMode == FRONTIER_LVL_50 && monId > FRONTIER_MONS_HIGH_TIER)
continue;
@@ -554,7 +554,7 @@ static void GenerateInitialRentalMons(void)
i = 0;
while (i != PARTY_SIZE)
{
- if (i < rentalRank) // The more times the player has rented, the more initial rentals are generated from a better set of pokemon
+ if (i < rentalRank) // The more times the player has rented, the more initial rentals are generated from a better set of Pokémon
monId = GetFactoryMonId(factoryLvlMode, challengeNum, TRUE);
else
monId = GetFactoryMonId(factoryLvlMode, challengeNum, FALSE);
@@ -562,7 +562,7 @@ static void GenerateInitialRentalMons(void)
if (gFacilityTrainerMons[monId].species == SPECIES_UNOWN)
continue;
- // Cannot have two pokemon of the same species.
+ // Cannot have two Pokémon of the same species.
for (j = firstMonId; j < firstMonId + i; j++)
{
u16 existingMonId = monIds[j];
@@ -741,8 +741,15 @@ u8 GetFactoryMonFixedIV(u8 challengeNum, bool8 isLastBattle)
u8 ivSet;
bool8 useHigherIV = isLastBattle ? TRUE : FALSE;
- if (challengeNum > 8)
- ivSet = 7;
+// The Factory has an out-of-bounds access when generating the rental draft for round 9 (challengeNum==8),
+// or the "elevated" rentals from round 8 (challengeNum+1==8)
+// This happens to land on a number higher than 31, which is interpreted as "random IVs"
+#ifdef BUGFIX
+ if (challengeNum >= ARRAY_COUNT(sFixedIVTable))
+#else
+ if (challengeNum > ARRAY_COUNT(sFixedIVTable))
+#endif
+ ivSet = ARRAY_COUNT(sFixedIVTable) - 1;
else
ivSet = challengeNum;
diff --git a/src/battle_factory_screen.c b/src/battle_factory_screen.c
index a543e64c93..0533d1e2a3 100644
--- a/src/battle_factory_screen.c
+++ b/src/battle_factory_screen.c
@@ -32,15 +32,15 @@
#include "constants/songs.h"
#include "constants/rgb.h"
-// Select_ refers to the first Pokemon selection screen where you choose your initial 3 rental Pokemon.
-// Swap_ refers to the subsequent selection screens where you can swap a Pokemon with one from the beaten trainer
+// Select_ refers to the first Pokémon selection screen where you choose your initial 3 rental Pokémon.
+// Swap_ refers to the subsequent selection screens where you can swap a Pokémon with one from the beaten trainer
// Note that, generally, "Action" will refer to the immediate actions that can be taken on each screen,
-// i.e. selecting a pokemon or selecting the Cancel button
+// i.e. selecting a Pokémon or selecting the Cancel button
// The "Options menu" will refer to the popup menu that shows when some actions have been selected
-#define SWAP_PLAYER_SCREEN 0 // The screen where the player selects which of their pokemon to swap away
-#define SWAP_ENEMY_SCREEN 1 // The screen where the player selects which new pokemon from the defeated party to swap for
+#define SWAP_PLAYER_SCREEN 0 // The screen where the player selects which of their Pokémon to swap away
+#define SWAP_ENEMY_SCREEN 1 // The screen where the player selects which new Pokémon from the defeated party to swap for
#define SELECTABLE_MONS_COUNT 6
@@ -89,7 +89,7 @@ struct FactorySelectableMon
{
u16 monId;
u16 ballSpriteId;
- u8 selectedId; // 0 - not selected, 1 - first pokemon, 2 - second pokemon, 3 - third pokemon
+ u8 selectedId; // 0 - not selected, 1 - first Pokémon, 2 - second Pokémon, 3 - third Pokémon
struct Pokemon monData;
};
@@ -1060,7 +1060,7 @@ static void SpriteCB_Pokeball(struct Sprite *sprite)
{
if (sprite->oam.paletteNum == IndexOfSpritePaletteTag(PALTAG_BALL_SELECTED))
{
- // Pokeball selected, do rocking animation
+ // Poké Ball selected, do rocking animation
if (sprite->animEnded)
{
if (sprite->data[0] != 0)
@@ -1084,7 +1084,7 @@ static void SpriteCB_Pokeball(struct Sprite *sprite)
}
else
{
- // Pokeball not selected, remain still
+ // Poké Ball not selected, remain still
StartSpriteAnimIfDifferent(sprite, 0);
}
}
@@ -1521,7 +1521,7 @@ static void Select_Task_Exit(u8 taskId)
}
}
-// Handles the Yes/No prompt when confirming the 3 selected rental pokemon
+// Handles the Yes/No prompt when confirming the 3 selected rental Pokémon
static void Select_Task_HandleYesNo(u8 taskId)
{
if (sFactorySelectScreen->monPicAnimating == TRUE)
@@ -1543,14 +1543,14 @@ static void Select_Task_HandleYesNo(u8 taskId)
PlaySE(SE_SELECT);
if (sFactorySelectScreen->yesNoCursorPos == 0)
{
- // Selected Yes, confirmed selected pokemon
+ // Selected Yes, confirmed selected Pokémon
Select_HideChosenMons();
gTasks[taskId].tState = 0;
gTasks[taskId].func = Select_Task_Exit;
}
else
{
- // Selected No, continue choosing pokemon
+ // Selected No, continue choosing Pokémon
Select_ErasePopupMenu(SELECT_WIN_YES_NO);
Select_DeclineChosenMons();
sFactorySelectScreen->fadeSpeciesNameActive = TRUE;
@@ -1560,7 +1560,7 @@ static void Select_Task_HandleYesNo(u8 taskId)
}
else if (JOY_NEW(B_BUTTON))
{
- // Pressed B, Continue choosing pokemon
+ // Pressed B, Continue choosing Pokémon
PlaySE(SE_SELECT);
Select_ErasePopupMenu(SELECT_WIN_YES_NO);
Select_DeclineChosenMons();
@@ -1582,7 +1582,7 @@ static void Select_Task_HandleYesNo(u8 taskId)
}
}
-// Handles the popup menu that shows when a pokemon is selected
+// Handles the popup menu that shows when a Pokémon is selected
static void Select_Task_HandleMenu(u8 taskId)
{
switch (gTasks[taskId].tState)
@@ -2415,7 +2415,7 @@ static void Swap_Task_Exit(u8 taskId)
{
case 0:
// Set return value for script
- // TRUE if player kept their current pokemon
+ // TRUE if player kept their current Pokémon
if (sFactorySwapScreen->monSwapped == TRUE)
{
gTasks[taskId].tState++;
@@ -2630,7 +2630,7 @@ static void Swap_Task_HandleMenu(u8 taskId)
}
}
-// Handles input on the two main swap screens (choosing a current pokeon to get rid of, and choosing a new pokemon to receive)
+// Handles input on the two main swap screens (choosing a current pokeon to get rid of, and choosing a new Pokémon to receive)
static void Swap_Task_HandleChooseMons(u8 taskId)
{
switch (gTasks[taskId].tState)
@@ -2645,7 +2645,7 @@ static void Swap_Task_HandleChooseMons(u8 taskId)
case STATE_CHOOSE_MONS_HANDLE_INPUT:
if (JOY_NEW(A_BUTTON))
{
- // Run whatever action is currently selected (a pokeball, the Cancel button, etc.)
+ // Run whatever action is currently selected (a Poké Ball, the Cancel button, etc.)
PlaySE(SE_SELECT);
sFactorySwapScreen->fadeSpeciesNameActive = FALSE;
Swap_PrintMonSpeciesAtFade();
@@ -3553,7 +3553,7 @@ static void Swap_HandleActionCursorChange(u8 cursorId)
{
if (cursorId < FRONTIER_PARTY_SIZE)
{
- // Cursor is on one of the pokemon
+ // Cursor is on one of the Pokémon
gSprites[sFactorySwapScreen->cursorSpriteId].invisible = FALSE;
Swap_HideActionButtonHighlights();
gSprites[sFactorySwapScreen->cursorSpriteId].x = gSprites[sFactorySwapScreen->ballSpriteIds[cursorId]].x;
diff --git a/src/battle_gfx_sfx_util.c b/src/battle_gfx_sfx_util.c
index d98809be46..a17ebcb5ab 100644
--- a/src/battle_gfx_sfx_util.c
+++ b/src/battle_gfx_sfx_util.c
@@ -105,7 +105,7 @@ void FreeBattleSpritesData(void)
FREE_AND_SET_NULL(gBattleSpritesDataPtr);
}
-// Pokemon chooses move to use in Battle Palace rather than player
+// Pokémon chooses move to use in Battle Palace rather than player
u16 ChooseMoveAndTargetInBattlePalace(void)
{
s32 i, var1, var2;
@@ -165,7 +165,7 @@ u16 ChooseMoveAndTargetInBattlePalace(void)
chosenMoveId = BattleAI_ChooseMoveOrAction();
}
- // If no moves matched the selected group, pick a new move from groups the pokemon has
+ // If no moves matched the selected group, pick a new move from groups the Pokémon has
// In this case the AI is not checked again, so the choice may be worse
// If a move is chosen this way, there's a 50% chance that it will be unable to use it anyway
if (chosenMoveId == -1)
@@ -357,7 +357,7 @@ static u16 GetBattlePalaceTarget(void)
return BATTLE_OPPOSITE(gActiveBattler) << 8;
}
-// Wait for the pokemon to finish appearing out from the pokeball on send out
+// Wait for the Pokémon to finish appearing out from the Poké Ball on send out
void SpriteCB_WaitForBattlerBallReleaseAnim(struct Sprite *sprite)
{
u8 spriteId = sprite->data[1];
@@ -378,7 +378,7 @@ void SpriteCB_WaitForBattlerBallReleaseAnim(struct Sprite *sprite)
}
}
-static void UnusedDoBattleSpriteAffineAnim(struct Sprite *sprite, bool8 pointless)
+static void UNUSED UnusedDoBattleSpriteAffineAnim(struct Sprite *sprite, bool8 pointless)
{
sprite->animPaused = TRUE;
sprite->callback = SpriteCallbackDummy;
@@ -690,8 +690,7 @@ void BattleLoadPlayerMonSpriteGfx(struct Pokemon *mon, u8 battlerId)
}
}
-// Unused
-static void BattleGfxSfxDummy1(void)
+static void UNUSED BattleGfxSfxDummy1(void)
{
}
diff --git a/src/battle_interface.c b/src/battle_interface.c
index f9a7be58ea..a417be4a72 100644
--- a/src/battle_interface.c
+++ b/src/battle_interface.c
@@ -841,8 +841,7 @@ static void Debug_DrawNumber(s16 number, u16 *dest, bool8 unk)
}
}
-// Unused
-static void Debug_DrawNumberPair(s16 number1, s16 number2, u16 *dest)
+static void UNUSED Debug_DrawNumberPair(s16 number1, s16 number2, u16 *dest)
{
dest[4] = 0x1E;
Debug_DrawNumber(number2, dest, FALSE);
@@ -2459,9 +2458,8 @@ static u8 CalcBarFilledPixels(s32 maxValue, s32 oldValue, s32 receivedValue, s32
return filledPixels;
}
-// Unused
// These two functions seem as if they were made for testing the health bar.
-static s16 Debug_TestHealthBar(struct TestingBar *barInfo, s32 *currValue, u16 *dest, s32 unused)
+static s16 UNUSED Debug_TestHealthBar(struct TestingBar *barInfo, s32 *currValue, u16 *dest, s32 unused)
{
s16 ret, var;
diff --git a/src/battle_intro.c b/src/battle_intro.c
index 3cdc879a86..5df697e3ae 100644
--- a/src/battle_intro.c
+++ b/src/battle_intro.c
@@ -602,7 +602,7 @@ void DrawBattlerOnBg(int bgId, u8 x, u8 y, u8 battlerPosition, u8 paletteId, u8
LoadBgTilemap(bgId, tilemap, BG_SCREEN_SIZE, 0);
}
-static void DrawBattlerOnBgDMA(u8 x, u8 y, u8 battlerPosition, u8 arg3, u8 paletteId, u16 arg5, u8 arg6, u8 arg7)
+static void UNUSED DrawBattlerOnBgDMA(u8 x, u8 y, u8 battlerPosition, u8 arg3, u8 paletteId, u16 arg5, u8 arg6, u8 arg7)
{
int i, j, offset;
diff --git a/src/battle_main.c b/src/battle_main.c
index ffb9f2ada5..f72ae80c23 100644
--- a/src/battle_main.c
+++ b/src/battle_main.c
@@ -170,7 +170,7 @@ EWRAM_DATA u16 gChosenMove = 0;
EWRAM_DATA u16 gCalledMove = 0;
EWRAM_DATA s32 gBattleMoveDamage = 0;
EWRAM_DATA s32 gHpDealt = 0;
-EWRAM_DATA s32 gTakenDmg[MAX_BATTLERS_COUNT] = {0};
+EWRAM_DATA s32 gBideDmg[MAX_BATTLERS_COUNT] = {0};
EWRAM_DATA u16 gLastUsedItem = 0;
EWRAM_DATA u8 gLastUsedAbility = 0;
EWRAM_DATA u8 gBattlerAttacker = 0;
@@ -197,7 +197,7 @@ EWRAM_DATA u16 gChosenMoveByBattler[MAX_BATTLERS_COUNT] = {0};
EWRAM_DATA u8 gMoveResultFlags = 0;
EWRAM_DATA u32 gHitMarker = 0;
EWRAM_DATA static u8 sUnusedBattlersArray[MAX_BATTLERS_COUNT] = {0};
-EWRAM_DATA u8 gTakenDmgByBattler[MAX_BATTLERS_COUNT] = {0};
+EWRAM_DATA u8 gBideTarget[MAX_BATTLERS_COUNT] = {0};
EWRAM_DATA u8 gUnusedFirstBattleVar2 = 0; // Never read
EWRAM_DATA u16 gSideStatuses[NUM_BATTLE_SIDES] = {0};
EWRAM_DATA struct SideTimer gSideTimers[NUM_BATTLE_SIDES] = {0};
@@ -2073,8 +2073,7 @@ static u8 CreateNPCTrainerParty(struct Pokemon *party, u16 trainerNum, bool8 fir
return gTrainers[trainerNum].partySize;
}
-// Unused
-static void HBlankCB_Battle(void)
+static void UNUSED HBlankCB_Battle(void)
{
if (REG_VCOUNT < DISPLAY_HEIGHT && REG_VCOUNT >= 111)
SetGpuReg(REG_OFFSET_BG0CNT, BGCNT_SCREENBASE(24) | BGCNT_TXT256x512);
@@ -2710,8 +2709,7 @@ void SpriteCallbackDummy_2(struct Sprite *sprite)
#define sNumFlickers data[3]
#define sDelay data[4]
-// Unused
-static void SpriteCB_InitFlicker(struct Sprite *sprite)
+static void UNUSED SpriteCB_InitFlicker(struct Sprite *sprite)
{
sprite->sNumFlickers = 6;
sprite->sDelay = 1;
@@ -2866,8 +2864,7 @@ static void SpriteCB_BattleSpriteSlideLeft(struct Sprite *sprite)
}
}
-// Unused
-static void SetIdleSpriteCallback(struct Sprite *sprite)
+static void UNUSED SetIdleSpriteCallback(struct Sprite *sprite)
{
sprite->callback = SpriteCB_Idle;
}
@@ -3712,8 +3709,7 @@ static void BattleIntroRecordMonsToDex(void)
}
}
-// Unused
-static void BattleIntroSkipRecordMonsToDex(void)
+static void UNUSED BattleIntroSkipRecordMonsToDex(void)
{
if (gBattleControllerExecFlags == 0)
gBattleMainFunc = BattleIntroPrintPlayerSendsOut;
@@ -3816,8 +3812,7 @@ static void BattleIntroPlayer1SendsOutMonAnimation(void)
gBattleMainFunc = TryDoEventsBeforeFirstTurn;
}
-// Unused
-static void BattleIntroSwitchInPlayerMons(void)
+static void UNUSED BattleIntroSwitchInPlayerMons(void)
{
if (gBattleControllerExecFlags == 0)
{
diff --git a/src/battle_message.c b/src/battle_message.c
index f005404ead..e50fcff3de 100644
--- a/src/battle_message.c
+++ b/src/battle_message.c
@@ -2152,7 +2152,7 @@ void BufferStringBattle(u16 stringID)
}
}
break;
- case STRINGID_USEDMOVE: // pokemon used a move msg
+ case STRINGID_USEDMOVE: // Pokémon used a move msg
ChooseMoveUsedParticle(gBattleTextBuff1); // buff1 doesn't appear in the string, leftover from japanese move names
if (gBattleMsgDataPtr->currentMove >= MOVES_COUNT)
@@ -2313,7 +2313,7 @@ u32 BattleStringExpandPlaceholders(const u8 *src, u8 *dst)
{
u32 dstID = 0; // if they used dstID, why not use srcID as well?
const u8 *toCpy = NULL;
- // This buffer may hold either the name of a trainer, pokemon, or item.
+ // This buffer may hold either the name of a trainer, Pokémon, or item.
u8 text[max(max(max(32, TRAINER_NAME_LENGTH + 1), POKEMON_NAME_LENGTH + 1), ITEM_NAME_LENGTH)];
u8 multiplayerId;
s32 i;
diff --git a/src/battle_pike.c b/src/battle_pike.c
index acc9eaee4e..ba24e58ae7 100644
--- a/src/battle_pike.c
+++ b/src/battle_pike.c
@@ -1097,8 +1097,7 @@ static u16 GetNPCRoomGraphicsId(void)
return sNPCTable[sNpcId].graphicsId;
}
-// Unused
-static u8 GetInWildMonRoom(void)
+static bool8 UNUSED GetInWildMonRoom(void)
{
return sInWildMonRoom;
}
@@ -1268,7 +1267,7 @@ static void TryHealMons(u8 healCount)
for (i = 0; i < FRONTIER_PARTY_SIZE; i++)
indices[i] = i;
- // Only 'healCount' number of pokemon will be healed.
+ // Only 'healCount' number of Pokémon will be healed.
// The order in which they're (attempted to be) healed is random,
// and determined by performing 10 random swaps to this index array.
for (k = 0; k < 10; k++)
diff --git a/src/battle_pyramid.c b/src/battle_pyramid.c
index e51f804981..b4bb3cacca 100644
--- a/src/battle_pyramid.c
+++ b/src/battle_pyramid.c
@@ -1479,8 +1479,7 @@ u8 GetTrainerEncounterMusicIdInBattlePyramid(u16 trainerId)
return TRAINER_ENCOUNTER_MUSIC_MALE;
}
-// Unused
-static void BattlePyramidRetireChallenge(void)
+static void UNUSED BattlePyramidRetireChallenge(void)
{
ScriptContext_SetupScript(BattlePyramid_Retire);
}
diff --git a/src/battle_pyramid_bag.c b/src/battle_pyramid_bag.c
index d580cf6800..bf9a7704b1 100644
--- a/src/battle_pyramid_bag.c
+++ b/src/battle_pyramid_bag.c
@@ -174,12 +174,12 @@ enum {
static const struct MenuAction sMenuActions[] =
{
- [ACTION_USE_FIELD] = { gMenuText_Use, BagAction_UseOnField },
- [ACTION_TOSS] = { gMenuText_Toss, BagAction_Toss },
- [ACTION_GIVE] = { gMenuText_Give, BagAction_Give },
- [ACTION_CANCEL] = { gText_Cancel2, BagAction_Cancel },
- [ACTION_USE_BATTLE] = { gMenuText_Use, BagAction_UseInBattle },
- [ACTION_DUMMY] = { gText_EmptyString2, NULL },
+ [ACTION_USE_FIELD] = { gMenuText_Use, {BagAction_UseOnField} },
+ [ACTION_TOSS] = { gMenuText_Toss, {BagAction_Toss} },
+ [ACTION_GIVE] = { gMenuText_Give, {BagAction_Give} },
+ [ACTION_CANCEL] = { gText_Cancel2, {BagAction_Cancel} },
+ [ACTION_USE_BATTLE] = { gMenuText_Use, {BagAction_UseInBattle} },
+ [ACTION_DUMMY] = { gText_EmptyString2, {NULL} },
};
static const u8 sMenuActionIds_Field[] = {ACTION_USE_FIELD, ACTION_GIVE, ACTION_TOSS, ACTION_CANCEL};
@@ -382,8 +382,8 @@ void CB2_PyramidBagMenuFromStartMenu(void)
GoToBattlePyramidBagMenu(PYRAMIDBAG_LOC_FIELD, CB2_ReturnToFieldWithOpenMenu);
}
-// Unused, CB2_BagMenuFromBattle is used instead
-static void OpenBattlePyramidBagInBattle(void)
+// CB2_BagMenuFromBattle is used instead
+static void UNUSED OpenBattlePyramidBagInBattle(void)
{
GoToBattlePyramidBagMenu(PYRAMIDBAG_LOC_BATTLE, CB2_SetUpReshowBattleScreenAfterMenu2);
}
@@ -1468,8 +1468,7 @@ static void DrawTossNumberWindow(u8 windowId)
ScheduleBgCopyTilemapToVram(1);
}
-// Unused
-static u8 GetMenuActionWindowId(u8 windowArrayId)
+static u8 UNUSED GetMenuActionWindowId(u8 windowArrayId)
{
return gPyramidBagMenu->windowIds[windowArrayId];
}
diff --git a/src/battle_script_commands.c b/src/battle_script_commands.c
index bc3e795f59..dfeaa100b1 100644
--- a/src/battle_script_commands.c
+++ b/src/battle_script_commands.c
@@ -1706,7 +1706,7 @@ static inline void ApplyRandomDmgMultiplier(void)
}
}
-static void Unused_ApplyRandomDmgMultiplier(void)
+static void UNUSED Unused_ApplyRandomDmgMultiplier(void)
{
ApplyRandomDmgMultiplier();
}
@@ -1892,6 +1892,7 @@ static void Cmd_healthbarupdate(void)
gBattlescriptCurrInstr += 2;
}
+// Update the active battler's HP and various HP trackers (Substitute, Bide, etc.)
static void Cmd_datahpupdate(void)
{
u32 moveType;
@@ -1899,9 +1900,13 @@ static void Cmd_datahpupdate(void)
if (gBattleControllerExecFlags)
return;
+ // moveType will be used later to record for Counter/Mirror Coat whether this was physical or special damage.
+ // For moves with a dynamic type that have F_DYNAMIC_TYPE_IGNORE_PHYSICALITY set (in vanilla, just Hidden Power) this will ignore
+ // the dynamic type and use the move's base type instead, meaning (as a Normal type) Hidden Power will only ever trigger Counter.
+ // It also means that Hidden Power Fire is unable to defrost targets.
if (gBattleStruct->dynamicMoveType == 0)
moveType = gBattleMoves[gCurrentMove].type;
- else if (!(gBattleStruct->dynamicMoveType & F_DYNAMIC_TYPE_1))
+ else if (!(gBattleStruct->dynamicMoveType & F_DYNAMIC_TYPE_IGNORE_PHYSICALITY))
moveType = gBattleStruct->dynamicMoveType & DYNAMIC_TYPE_MASK;
else
moveType = gBattleMoves[gCurrentMove].type;
@@ -1911,23 +1916,26 @@ static void Cmd_datahpupdate(void)
gActiveBattler = GetBattlerForBattleScript(gBattlescriptCurrInstr[1]);
if (gBattleMons[gActiveBattler].status2 & STATUS2_SUBSTITUTE && gDisableStructs[gActiveBattler].substituteHP && !(gHitMarker & HITMARKER_IGNORE_SUBSTITUTE))
{
+ // Target has an active Substitute, deal damage to that instead.
if (gDisableStructs[gActiveBattler].substituteHP >= gBattleMoveDamage)
{
- if (gSpecialStatuses[gActiveBattler].dmg == 0)
- gSpecialStatuses[gActiveBattler].dmg = gBattleMoveDamage;
+ if (gSpecialStatuses[gActiveBattler].shellBellDmg == 0)
+ gSpecialStatuses[gActiveBattler].shellBellDmg = gBattleMoveDamage;
gDisableStructs[gActiveBattler].substituteHP -= gBattleMoveDamage;
gHpDealt = gBattleMoveDamage;
}
else
{
- if (gSpecialStatuses[gActiveBattler].dmg == 0)
- gSpecialStatuses[gActiveBattler].dmg = gDisableStructs[gActiveBattler].substituteHP;
+ // Substitute has less HP than the damage dealt, set its HP to 0.
+ if (gSpecialStatuses[gActiveBattler].shellBellDmg == 0)
+ gSpecialStatuses[gActiveBattler].shellBellDmg = gDisableStructs[gActiveBattler].substituteHP;
gHpDealt = gDisableStructs[gActiveBattler].substituteHP;
gDisableStructs[gActiveBattler].substituteHP = 0;
}
- // check substitute fading
+
if (gDisableStructs[gActiveBattler].substituteHP == 0)
{
+ // Substitute fades
gBattlescriptCurrInstr += 2;
BattleScriptPushCursor();
gBattlescriptCurrInstr = BattleScript_SubstituteFade;
@@ -1937,28 +1945,30 @@ static void Cmd_datahpupdate(void)
else
{
gHitMarker &= ~HITMARKER_IGNORE_SUBSTITUTE;
- if (gBattleMoveDamage < 0) // hp goes up
+ if (gBattleMoveDamage < 0)
{
- gBattleMons[gActiveBattler].hp -= gBattleMoveDamage;
+ // Negative damage is HP gain
+ gBattleMons[gActiveBattler].hp += -gBattleMoveDamage;
if (gBattleMons[gActiveBattler].hp > gBattleMons[gActiveBattler].maxHP)
gBattleMons[gActiveBattler].hp = gBattleMons[gActiveBattler].maxHP;
-
}
- else // hp goes down
+ else
{
- if (gHitMarker & HITMARKER_SKIP_DMG_TRACK)
+ if (gHitMarker & HITMARKER_IGNORE_BIDE)
{
- gHitMarker &= ~HITMARKER_SKIP_DMG_TRACK;
+ gHitMarker &= ~HITMARKER_IGNORE_BIDE;
}
else
{
- gTakenDmg[gActiveBattler] += gBattleMoveDamage;
+ // Record damage/attacker for Bide
+ gBideDmg[gActiveBattler] += gBattleMoveDamage;
if (gBattlescriptCurrInstr[1] == BS_TARGET)
- gTakenDmgByBattler[gActiveBattler] = gBattlerAttacker;
+ gBideTarget[gActiveBattler] = gBattlerAttacker;
else
- gTakenDmgByBattler[gActiveBattler] = gBattlerTarget;
+ gBideTarget[gActiveBattler] = gBattlerTarget;
}
+ // Deal damage to the battler
if (gBattleMons[gActiveBattler].hp > gBattleMoveDamage)
{
gBattleMons[gActiveBattler].hp -= gBattleMoveDamage;
@@ -1970,11 +1980,16 @@ static void Cmd_datahpupdate(void)
gBattleMons[gActiveBattler].hp = 0;
}
- if (!gSpecialStatuses[gActiveBattler].dmg && !(gHitMarker & HITMARKER_PASSIVE_DAMAGE))
- gSpecialStatuses[gActiveBattler].dmg = gHpDealt;
+ // Record damage for Shell Bell
+ if (gSpecialStatuses[gActiveBattler].shellBellDmg == 0 && !(gHitMarker & HITMARKER_PASSIVE_DAMAGE))
+ gSpecialStatuses[gActiveBattler].shellBellDmg = gHpDealt;
+ // Note: While physicalDmg/specialDmg below are only distinguished between for Counter/Mirror Coat, they are
+ // used in combination as general damage trackers for other purposes. specialDmg is additionally used
+ // to help determine if a fire move should defrost the target.
if (IS_TYPE_PHYSICAL(moveType) && !(gHitMarker & HITMARKER_PASSIVE_DAMAGE) && gCurrentMove != MOVE_PAIN_SPLIT)
{
+ // Record physical damage/attacker for Counter
gProtectStructs[gActiveBattler].physicalDmg = gHpDealt;
gSpecialStatuses[gActiveBattler].physicalDmg = gHpDealt;
if (gBattlescriptCurrInstr[1] == BS_TARGET)
@@ -1990,6 +2005,7 @@ static void Cmd_datahpupdate(void)
}
else if (!IS_TYPE_PHYSICAL(moveType) && !(gHitMarker & HITMARKER_PASSIVE_DAMAGE))
{
+ // Record special damage/attacker for Mirror Coat
gProtectStructs[gActiveBattler].specialDmg = gHpDealt;
gSpecialStatuses[gActiveBattler].specialDmg = gHpDealt;
if (gBattlescriptCurrInstr[1] == BS_TARGET)
@@ -2005,15 +2021,18 @@ static void Cmd_datahpupdate(void)
}
}
gHitMarker &= ~HITMARKER_PASSIVE_DAMAGE;
+
+ // Send updated HP
BtlController_EmitSetMonData(BUFFER_A, REQUEST_HP_BATTLE, 0, sizeof(gBattleMons[gActiveBattler].hp), &gBattleMons[gActiveBattler].hp);
MarkBattlerForControllerExec(gActiveBattler);
}
}
else
{
+ // MOVE_RESULT_NO_EFFECT was set
gActiveBattler = GetBattlerForBattleScript(gBattlescriptCurrInstr[1]);
- if (gSpecialStatuses[gActiveBattler].dmg == 0)
- gSpecialStatuses[gActiveBattler].dmg = 0xFFFF;
+ if (gSpecialStatuses[gActiveBattler].shellBellDmg == 0)
+ gSpecialStatuses[gActiveBattler].shellBellDmg = IGNORE_SHELL_BELL;
}
gBattlescriptCurrInstr += 2;
}
@@ -2283,11 +2302,11 @@ void SetMoveEffect(bool8 primary, u8 certain)
gBattleScripting.battler = gBattlerAttacker;
}
- if (gBattleMons[gEffectBattler].ability == ABILITY_SHIELD_DUST && !(gHitMarker & HITMARKER_IGNORE_SAFEGUARD)
+ if (gBattleMons[gEffectBattler].ability == ABILITY_SHIELD_DUST && !(gHitMarker & HITMARKER_STATUS_ABILITY_EFFECT)
&& !primary && gBattleCommunication[MOVE_EFFECT_BYTE] <= 9)
INCREMENT_RESET_RETURN
- if (gSideStatuses[GET_BATTLER_SIDE(gEffectBattler)] & SIDE_STATUS_SAFEGUARD && !(gHitMarker & HITMARKER_IGNORE_SAFEGUARD)
+ if (gSideStatuses[GET_BATTLER_SIDE(gEffectBattler)] & SIDE_STATUS_SAFEGUARD && !(gHitMarker & HITMARKER_STATUS_ABILITY_EFFECT)
&& !primary && gBattleCommunication[MOVE_EFFECT_BYTE] <= 7)
INCREMENT_RESET_RETURN
@@ -2337,10 +2356,10 @@ void SetMoveEffect(bool8 primary, u8 certain)
BattleScriptPush(gBattlescriptCurrInstr + 1);
gBattlescriptCurrInstr = BattleScript_PSNPrevention;
- if (gHitMarker & HITMARKER_IGNORE_SAFEGUARD)
+ if (gHitMarker & HITMARKER_STATUS_ABILITY_EFFECT)
{
gBattleCommunication[MULTISTRING_CHOOSER] = B_MSG_ABILITY_PREVENTS_ABILITY_STATUS;
- gHitMarker &= ~HITMARKER_IGNORE_SAFEGUARD;
+ gHitMarker &= ~HITMARKER_STATUS_ABILITY_EFFECT;
}
else
{
@@ -2349,7 +2368,7 @@ void SetMoveEffect(bool8 primary, u8 certain)
RESET_RETURN
}
if ((IS_BATTLER_OF_TYPE(gEffectBattler, TYPE_POISON) || IS_BATTLER_OF_TYPE(gEffectBattler, TYPE_STEEL))
- && (gHitMarker & HITMARKER_IGNORE_SAFEGUARD)
+ && (gHitMarker & HITMARKER_STATUS_ABILITY_EFFECT)
&& (primary == TRUE || certain == MOVE_EFFECT_CERTAIN))
{
BattleScriptPush(gBattlescriptCurrInstr + 1);
@@ -2378,10 +2397,10 @@ void SetMoveEffect(bool8 primary, u8 certain)
BattleScriptPush(gBattlescriptCurrInstr + 1);
gBattlescriptCurrInstr = BattleScript_BRNPrevention;
- if (gHitMarker & HITMARKER_IGNORE_SAFEGUARD)
+ if (gHitMarker & HITMARKER_STATUS_ABILITY_EFFECT)
{
gBattleCommunication[MULTISTRING_CHOOSER] = B_MSG_ABILITY_PREVENTS_ABILITY_STATUS;
- gHitMarker &= ~HITMARKER_IGNORE_SAFEGUARD;
+ gHitMarker &= ~HITMARKER_STATUS_ABILITY_EFFECT;
}
else
{
@@ -2390,7 +2409,7 @@ void SetMoveEffect(bool8 primary, u8 certain)
RESET_RETURN
}
if (IS_BATTLER_OF_TYPE(gEffectBattler, TYPE_FIRE)
- && (gHitMarker & HITMARKER_IGNORE_SAFEGUARD)
+ && (gHitMarker & HITMARKER_STATUS_ABILITY_EFFECT)
&& (primary == TRUE || certain == MOVE_EFFECT_CERTAIN))
{
BattleScriptPush(gBattlescriptCurrInstr + 1);
@@ -2434,10 +2453,10 @@ void SetMoveEffect(bool8 primary, u8 certain)
BattleScriptPush(gBattlescriptCurrInstr + 1);
gBattlescriptCurrInstr = BattleScript_PRLZPrevention;
- if (gHitMarker & HITMARKER_IGNORE_SAFEGUARD)
+ if (gHitMarker & HITMARKER_STATUS_ABILITY_EFFECT)
{
gBattleCommunication[MULTISTRING_CHOOSER] = B_MSG_ABILITY_PREVENTS_ABILITY_STATUS;
- gHitMarker &= ~HITMARKER_IGNORE_SAFEGUARD;
+ gHitMarker &= ~HITMARKER_STATUS_ABILITY_EFFECT;
}
else
{
@@ -2462,10 +2481,10 @@ void SetMoveEffect(bool8 primary, u8 certain)
BattleScriptPush(gBattlescriptCurrInstr + 1);
gBattlescriptCurrInstr = BattleScript_PSNPrevention;
- if (gHitMarker & HITMARKER_IGNORE_SAFEGUARD)
+ if (gHitMarker & HITMARKER_STATUS_ABILITY_EFFECT)
{
gBattleCommunication[MULTISTRING_CHOOSER] = B_MSG_ABILITY_PREVENTS_ABILITY_STATUS;
- gHitMarker &= ~HITMARKER_IGNORE_SAFEGUARD;
+ gHitMarker &= ~HITMARKER_STATUS_ABILITY_EFFECT;
}
else
{
@@ -2474,7 +2493,7 @@ void SetMoveEffect(bool8 primary, u8 certain)
RESET_RETURN
}
if ((IS_BATTLER_OF_TYPE(gEffectBattler, TYPE_POISON) || IS_BATTLER_OF_TYPE(gEffectBattler, TYPE_STEEL))
- && (gHitMarker & HITMARKER_IGNORE_SAFEGUARD)
+ && (gHitMarker & HITMARKER_STATUS_ABILITY_EFFECT)
&& (primary == TRUE || certain == MOVE_EFFECT_CERTAIN))
{
BattleScriptPush(gBattlescriptCurrInstr + 1);
@@ -2517,10 +2536,10 @@ void SetMoveEffect(bool8 primary, u8 certain)
BtlController_EmitSetMonData(BUFFER_A, REQUEST_STATUS_BATTLE, 0, sizeof(gBattleMons[gEffectBattler].status1), &gBattleMons[gEffectBattler].status1);
MarkBattlerForControllerExec(gActiveBattler);
- if (gHitMarker & HITMARKER_IGNORE_SAFEGUARD)
+ if (gHitMarker & HITMARKER_STATUS_ABILITY_EFFECT)
{
gBattleCommunication[MULTISTRING_CHOOSER] = B_MSG_STATUSED_BY_ABILITY;
- gHitMarker &= ~HITMARKER_IGNORE_SAFEGUARD;
+ gHitMarker &= ~HITMARKER_STATUS_ABILITY_EFFECT;
}
else
{
@@ -3403,7 +3422,7 @@ static void Cmd_getexp(void)
if (IsTradedMon(&gPlayerParty[gBattleStruct->expGetterMonId]))
{
- // check if the pokemon doesn't belong to the player
+ // check if the Pokémon doesn't belong to the player
if (gBattleTypeFlags & BATTLE_TYPE_INGAME_PARTNER && gBattleStruct->expGetterMonId >= 3)
{
i = STRINGID_EMPTYSTRING4;
@@ -4485,7 +4504,7 @@ static void Cmd_moveend(void)
}
gBattleScripting.moveendState++;
break;
- case MOVEEND_NEXT_TARGET: // For moves hitting two opposing Pokemon.
+ case MOVEEND_NEXT_TARGET: // For moves hitting two opposing Pokémon.
if (!(gHitMarker & HITMARKER_UNABLE_TO_USE_MOVE) && gBattleTypeFlags & BATTLE_TYPE_DOUBLE
&& !gProtectStructs[gBattlerAttacker].chargingTurn && gBattleMoves[gCurrentMove].target == MOVE_TARGET_BOTH
&& !(gHitMarker & HITMARKER_NO_ATTACKSTRING))
@@ -7148,7 +7167,7 @@ static void Cmd_setbide(void)
{
gBattleMons[gBattlerAttacker].status2 |= STATUS2_MULTIPLETURNS;
gLockedMoves[gBattlerAttacker] = gCurrentMove;
- gTakenDmg[gBattlerAttacker] = 0;
+ gBideDmg[gBattlerAttacker] = 0;
gBattleMons[gBattlerAttacker].status2 |= STATUS2_BIDE_TURN(2);
gBattlescriptCurrInstr++;
@@ -7307,7 +7326,7 @@ static void Cmd_forcerandomswitch(void)
lastMonId = PARTY_SIZE;
monsCount = PARTY_SIZE;
minNeeded = 1;
- battler2PartyId = gBattlerPartyIndexes[gBattlerTarget]; // there is only one pokemon out in single battles
+ battler2PartyId = gBattlerPartyIndexes[gBattlerTarget]; // there is only one Pokémon out in single battles
battler1PartyId = gBattlerPartyIndexes[gBattlerTarget];
}
@@ -7798,7 +7817,7 @@ static void Cmd_setsubstitute(void)
}
else
{
- gBattleMoveDamage = gBattleMons[gBattlerAttacker].maxHP / 4; // one bit value will only work for pokemon which max hp can go to 1020(which is more than possible in games)
+ gBattleMoveDamage = gBattleMons[gBattlerAttacker].maxHP / 4; // one bit value will only work for Pokémon which max hp can go to 1020(which is more than possible in games)
if (gBattleMoveDamage == 0)
gBattleMoveDamage = 1;
@@ -8040,7 +8059,7 @@ static void Cmd_painsplitdmgcalc(void)
storeLoc[3] = (painSplitHp & 0xFF000000) >> 24;
gBattleMoveDamage = gBattleMons[gBattlerAttacker].hp - hpDiff;
- gSpecialStatuses[gBattlerTarget].dmg = 0xFFFF;
+ gSpecialStatuses[gBattlerTarget].shellBellDmg = IGNORE_SHELL_BELL;
gBattlescriptCurrInstr += 5;
}
@@ -8878,7 +8897,7 @@ static void Cmd_hiddenpowercalc(void)
gBattleStruct->dynamicMoveType = ((NUMBER_OF_MON_TYPES - 3) * typeBits) / 63 + 1;
if (gBattleStruct->dynamicMoveType >= TYPE_MYSTERY)
gBattleStruct->dynamicMoveType++;
- gBattleStruct->dynamicMoveType |= F_DYNAMIC_TYPE_1 | F_DYNAMIC_TYPE_2;
+ gBattleStruct->dynamicMoveType |= F_DYNAMIC_TYPE_IGNORE_PHYSICALITY | F_DYNAMIC_TYPE_SET;
gBattlescriptCurrInstr++;
}
@@ -9179,7 +9198,7 @@ static void Cmd_tryswapitems(void)
{
gBattlescriptCurrInstr = T1_READ_PTR(gBattlescriptCurrInstr + 1);
}
- // can't swap if two pokemon don't have an item
+ // can't swap if two Pokémon don't have an item
// or if either of them is an enigma berry or a mail
else if ((gBattleMons[gBattlerAttacker].item == ITEM_NONE && gBattleMons[gBattlerTarget].item == ITEM_NONE)
|| gBattleMons[gBattlerAttacker].item == ITEM_ENIGMA_BERRY
@@ -9755,15 +9774,15 @@ static void Cmd_setweatherballtype(void)
if (gBattleWeather & B_WEATHER_ANY)
gBattleScripting.dmgMultiplier = 2;
if (gBattleWeather & B_WEATHER_RAIN)
- *(&gBattleStruct->dynamicMoveType) = TYPE_WATER | F_DYNAMIC_TYPE_2;
+ *(&gBattleStruct->dynamicMoveType) = TYPE_WATER | F_DYNAMIC_TYPE_SET;
else if (gBattleWeather & B_WEATHER_SANDSTORM)
- *(&gBattleStruct->dynamicMoveType) = TYPE_ROCK | F_DYNAMIC_TYPE_2;
+ *(&gBattleStruct->dynamicMoveType) = TYPE_ROCK | F_DYNAMIC_TYPE_SET;
else if (gBattleWeather & B_WEATHER_SUN)
- *(&gBattleStruct->dynamicMoveType) = TYPE_FIRE | F_DYNAMIC_TYPE_2;
+ *(&gBattleStruct->dynamicMoveType) = TYPE_FIRE | F_DYNAMIC_TYPE_SET;
else if (gBattleWeather & B_WEATHER_HAIL)
- *(&gBattleStruct->dynamicMoveType) = TYPE_ICE | F_DYNAMIC_TYPE_2;
+ *(&gBattleStruct->dynamicMoveType) = TYPE_ICE | F_DYNAMIC_TYPE_SET;
else
- *(&gBattleStruct->dynamicMoveType) = TYPE_NORMAL | F_DYNAMIC_TYPE_2;
+ *(&gBattleStruct->dynamicMoveType) = TYPE_NORMAL | F_DYNAMIC_TYPE_SET;
}
gBattlescriptCurrInstr++;
diff --git a/src/battle_setup.c b/src/battle_setup.c
index fc1586a5f2..e87ce6dd27 100644
--- a/src/battle_setup.c
+++ b/src/battle_setup.c
@@ -108,7 +108,7 @@ EWRAM_DATA static u8 *sTrainerBBattleScriptRetAddr = NULL;
EWRAM_DATA static bool8 sShouldCheckTrainerBScript = FALSE;
EWRAM_DATA static u8 sNoOfPossibleTrainerRetScripts = 0;
-// The first transition is used if the enemy pokemon are lower level than our pokemon.
+// The first transition is used if the enemy Pokémon are lower level than our Pokémon.
// Otherwise, the second transition is used.
static const u8 sBattleTransitionTable_Wild[][2] =
{
@@ -845,7 +845,7 @@ static u8 GetTrainerBattleTransition(void)
return B_TRANSITION_AQUA;
if (gTrainers[gTrainerBattleOpponent_A].doubleBattle == TRUE)
- minPartyCount = 2; // double battles always at least have 2 pokemon.
+ minPartyCount = 2; // double battles always at least have 2 Pokémon.
else
minPartyCount = 1;
@@ -1248,7 +1248,7 @@ static void SetBattledTrainersFlags(void)
FlagSet(GetTrainerAFlag());
}
-static void SetBattledTrainerFlag(void)
+static void UNUSED SetBattledTrainerFlag(void)
{
FlagSet(GetTrainerAFlag());
}
diff --git a/src/battle_tent.c b/src/battle_tent.c
index f0f7363f31..c003affebe 100644
--- a/src/battle_tent.c
+++ b/src/battle_tent.c
@@ -309,11 +309,10 @@ static void GenerateInitialRentalMons(void)
i = 0;
while (i != PARTY_SIZE)
{
- // Cannot have two pokemon of the same species.
+ // Cannot have two Pokémon of the same species.
monSetId = Random() % NUM_SLATEPORT_TENT_MONS;
for (j = firstMonId; j < firstMonId + i; j++)
{
- u16 monId = monIds[j];
if (monIds[j] == monSetId)
break;
if (species[j] == gFacilityTrainerMons[monSetId].species)
@@ -391,7 +390,7 @@ static void GenerateOpponentMons(void)
{
sRandMonId = monSet[Random() % numMons];
- // Ensure none of the opponent's pokemon are the same as the potential rental pokemon for the player
+ // Ensure none of the opponent's Pokémon are the same as the potential rental Pokémon for the player
for (j = 0; j < (int)ARRAY_COUNT(gSaveBlock2Ptr->frontier.rentalMons); j++)
{
if (gFacilityTrainerMons[sRandMonId].species == gFacilityTrainerMons[gSaveBlock2Ptr->frontier.rentalMons[j].monId].species)
diff --git a/src/battle_tower.c b/src/battle_tower.c
index 03295aadf2..91db376e53 100644
--- a/src/battle_tower.c
+++ b/src/battle_tower.c
@@ -1129,8 +1129,7 @@ u16 GetRandomScaledFrontierTrainerId(u8 challengeNum, u8 battleNum)
return trainerId;
}
-// Unused
-static void GetRandomScaledFrontierTrainerIdRange(u8 challengeNum, u8 battleNum, u16 *trainerIdPtr, u8 *rangePtr)
+static void UNUSED GetRandomScaledFrontierTrainerIdRange(u8 challengeNum, u8 battleNum, u16 *trainerIdPtr, u8 *rangePtr)
{
u16 trainerId, range;
@@ -1681,8 +1680,8 @@ static void FillTrainerParty(u16 trainerId, u8 firstMonId, u8 monCount)
}
// Regular battle frontier trainer.
- // Attempt to fill the trainer's party with random Pokemon until 3 have been
- // successfully chosen. The trainer's party may not have duplicate pokemon species
+ // Attempt to fill the trainer's party with random Pokémon until 3 have been
+ // successfully chosen. The trainer's party may not have duplicate Pokémon species
// or duplicate held items.
for (bfMonCount = 0; monSet[bfMonCount] != 0xFFFF; bfMonCount++)
;
@@ -1692,12 +1691,12 @@ static void FillTrainerParty(u16 trainerId, u8 firstMonId, u8 monCount)
{
u16 monId = monSet[Random() % bfMonCount];
- // "High tier" pokemon are only allowed on open level mode
+ // "High tier" Pokémon are only allowed on open level mode
// 20 is not a possible value for level here
if ((level == FRONTIER_MAX_LEVEL_50 || level == 20) && monId > FRONTIER_MONS_HIGH_TIER)
continue;
- // Ensure this pokemon species isn't a duplicate.
+ // Ensure this Pokémon species isn't a duplicate.
for (j = 0; j < i + firstMonId; j++)
{
if (GetMonData(&gEnemyParty[j], MON_DATA_SPECIES, NULL) == gFacilityTrainerMons[monId].species)
@@ -1716,7 +1715,7 @@ static void FillTrainerParty(u16 trainerId, u8 firstMonId, u8 monCount)
if (j != i + firstMonId)
continue;
- // Ensure this exact pokemon index isn't a duplicate. This check doesn't seem necessary
+ // Ensure this exact Pokémon index isn't a duplicate. This check doesn't seem necessary
// because the species and held items were already checked directly above.
for (j = 0; j < i; j++)
{
@@ -1728,7 +1727,7 @@ static void FillTrainerParty(u16 trainerId, u8 firstMonId, u8 monCount)
chosenMonIndices[i] = monId;
- // Place the chosen pokemon into the trainer's party.
+ // Place the chosen Pokémon into the trainer's party.
CreateMonWithEVSpreadNatureOTID(&gEnemyParty[i + firstMonId],
gFacilityTrainerMons[monId].species,
level,
@@ -1738,7 +1737,7 @@ static void FillTrainerParty(u16 trainerId, u8 firstMonId, u8 monCount)
otID);
friendship = MAX_FRIENDSHIP;
- // Give the chosen pokemon its specified moves.
+ // Give the chosen Pokémon its specified moves.
for (j = 0; j < MAX_MON_MOVES; j++)
{
SetMonMoveSlot(&gEnemyParty[i + firstMonId], gFacilityTrainerMons[monId].moves[j], j);
@@ -1749,14 +1748,14 @@ static void FillTrainerParty(u16 trainerId, u8 firstMonId, u8 monCount)
SetMonData(&gEnemyParty[i + firstMonId], MON_DATA_FRIENDSHIP, &friendship);
SetMonData(&gEnemyParty[i + firstMonId], MON_DATA_HELD_ITEM, &gBattleFrontierHeldItems[gFacilityTrainerMons[monId].itemTableId]);
- // The pokemon was successfully added to the trainer's party, so it's safe to move on to
+ // The Pokémon was successfully added to the trainer's party, so it's safe to move on to
// the next party slot.
i++;
}
}
// Probably an early draft before the 'CreateApprenticeMon' was written.
-static void Unused_CreateApprenticeMons(u16 trainerId, u8 firstMonId)
+static void UNUSED Unused_CreateApprenticeMons(u16 trainerId, u8 firstMonId)
{
s32 i, j;
u8 friendship = MAX_FRIENDSHIP;
@@ -1805,7 +1804,7 @@ u16 GetRandomFrontierMonFromSet(u16 trainerId)
do
{
- // "High tier" pokemon are only allowed on open level mode
+ // "High tier" Pokémon are only allowed on open level mode
// 20 is not a possible value for level here
monId = monSet[Random() % numMons];
} while((level == FRONTIER_MAX_LEVEL_50 || level == 20) && monId > FRONTIER_MONS_HIGH_TIER);
@@ -1832,12 +1831,14 @@ static void FillFactoryFrontierTrainerParty(u16 trainerId, u8 firstMonId)
if (trainerId < FRONTIER_TRAINERS_COUNT)
{
- u8 lvlMode = gSaveBlock2Ptr->frontier.lvlMode;
- u8 battleMode = VarGet(VAR_FRONTIER_BATTLE_MODE);
// By mistake Battle Tower's Level 50 challenge number is used to determine the IVs for Battle Factory.
#ifdef BUGFIX
+ u8 lvlMode = gSaveBlock2Ptr->frontier.lvlMode;
+ u8 battleMode = VarGet(VAR_FRONTIER_BATTLE_MODE);
u8 challengeNum = gSaveBlock2Ptr->frontier.factoryWinStreaks[battleMode][lvlMode] / FRONTIER_STAGES_PER_CHALLENGE;
#else
+ u8 UNUSED lvlMode = gSaveBlock2Ptr->frontier.lvlMode;
+ u8 battleMode = VarGet(VAR_FRONTIER_BATTLE_MODE);
u8 challengeNum = gSaveBlock2Ptr->frontier.towerWinStreaks[battleMode][FRONTIER_LVL_50] / FRONTIER_STAGES_PER_CHALLENGE;
#endif
if (gSaveBlock2Ptr->frontier.curChallengeBattleNum < FRONTIER_STAGES_PER_CHALLENGE - 1)
@@ -2278,7 +2279,7 @@ static void LoadMultiPartnerCandidatesData(void)
u32 lvlMode, battleMode;
s32 challengeNum;
u32 species1, species2;
- u32 level;
+ u32 UNUSED level;
struct ObjectEventTemplate *objEventTemplates;
objEventTemplates = gSaveBlock1Ptr->objectEventTemplates;
@@ -2453,15 +2454,15 @@ static void GetPotentialPartnerMoveAndSpecies(u16 trainerId, u16 monId)
// These partners can be an NPC or a former/record-mixed Apprentice
// When talked to, their response consists of:
// PARTNER_MSGID_INTRO - A greeting
-// PARTNER_MSGID_MON1 - Naming one pokemon on their team, and a move it has
-// PARTNER_MSGID_MON2_ASK - Naming a second pokemon on their team, a move it has, and asking if they'd like to be their partner
+// PARTNER_MSGID_MON1 - Naming one Pokémon on their team, and a move it has
+// PARTNER_MSGID_MON2_ASK - Naming a second Pokémon on their team, a move it has, and asking if they'd like to be their partner
// PARTNER_MSGID_ACCEPT - If the player agrees to be their partner
// PARTNER_MSGID_REJECT - If the player declines to be their partner
static void ShowPartnerCandidateMessage(void)
{
s32 i, j, partnerId;
s32 monId;
- s32 level = SetFacilityPtrsGetLevel();
+ s32 UNUSED level = SetFacilityPtrsGetLevel();
u16 winStreak = GetCurrentFacilityWinStreak();
s32 challengeNum = winStreak / FRONTIER_STAGES_PER_CHALLENGE;
s32 k = gSpecialVar_LastTalked - 2;
@@ -2772,7 +2773,7 @@ static void AwardBattleTowerRibbons(void)
#ifdef BUGFIX
struct RibbonCounter ribbons[MAX_FRONTIER_PARTY_SIZE];
#else
- struct RibbonCounter ribbons[3]; // BUG: 4 Pokemon can receive ribbons in a double battle mode.
+ struct RibbonCounter ribbons[3]; // BUG: 4 Pokémon can receive ribbons in a double battle mode.
#endif
u8 ribbonType = 0;
u8 lvlMode = gSaveBlock2Ptr->frontier.lvlMode;
@@ -2823,7 +2824,7 @@ static void AwardBattleTowerRibbons(void)
// This is a leftover debugging function that is used to populate the E-Reader
// trainer with the player's current data.
-static void FillEReaderTrainerWithPlayerData(void)
+static void UNUSED FillEReaderTrainerWithPlayerData(void)
{
struct BattleTowerEReaderTrainer *ereaderTrainer = &gSaveBlock2Ptr->frontier.ereaderTrainer;
s32 i, j;
@@ -2981,7 +2982,7 @@ static void FillPartnerParty(u16 trainerId)
#ifdef BUGFIX
j,
#else
- i, // BUG: personality was stored in the 'j' variable. As a result, Steven's pokemon do not have the intended natures.
+ i, // BUG: personality was stored in the 'j' variable. As a result, Steven's Pokémon do not have the intended natures.
#endif
OT_ID_PRESET, STEVEN_OTID);
for (j = 0; j < PARTY_SIZE; j++)
@@ -3408,7 +3409,7 @@ static void FillTentTrainerParty_(u16 trainerId, u8 firstMonId, u8 monCount)
{
u16 monId = monSet[Random() % bfMonCount];
- // Ensure this pokemon species isn't a duplicate.
+ // Ensure this Pokémon species isn't a duplicate.
for (j = 0; j < i + firstMonId; j++)
{
if (GetMonData(&gEnemyParty[j], MON_DATA_SPECIES, NULL) == gFacilityTrainerMons[monId].species)
@@ -3427,7 +3428,7 @@ static void FillTentTrainerParty_(u16 trainerId, u8 firstMonId, u8 monCount)
if (j != i + firstMonId)
continue;
- // Ensure this exact pokemon index isn't a duplicate. This check doesn't seem necessary
+ // Ensure this exact Pokémon index isn't a duplicate. This check doesn't seem necessary
// because the species and held items were already checked directly above.
for (j = 0; j < i; j++)
{
@@ -3439,7 +3440,7 @@ static void FillTentTrainerParty_(u16 trainerId, u8 firstMonId, u8 monCount)
chosenMonIndices[i] = monId;
- // Place the chosen pokemon into the trainer's party.
+ // Place the chosen Pokémon into the trainer's party.
CreateMonWithEVSpreadNatureOTID(&gEnemyParty[i + firstMonId],
gFacilityTrainerMons[monId].species,
level,
@@ -3449,7 +3450,7 @@ static void FillTentTrainerParty_(u16 trainerId, u8 firstMonId, u8 monCount)
otID);
friendship = MAX_FRIENDSHIP;
- // Give the chosen pokemon its specified moves.
+ // Give the chosen Pokémon its specified moves.
for (j = 0; j < MAX_MON_MOVES; j++)
{
SetMonMoveSlot(&gEnemyParty[i + firstMonId], gFacilityTrainerMons[monId].moves[j], j);
@@ -3460,7 +3461,7 @@ static void FillTentTrainerParty_(u16 trainerId, u8 firstMonId, u8 monCount)
SetMonData(&gEnemyParty[i + firstMonId], MON_DATA_FRIENDSHIP, &friendship);
SetMonData(&gEnemyParty[i + firstMonId], MON_DATA_HELD_ITEM, &gBattleFrontierHeldItems[gFacilityTrainerMons[monId].itemTableId]);
- // The pokemon was successfully added to the trainer's party, so it's safe to move on to
+ // The Pokémon was successfully added to the trainer's party, so it's safe to move on to
// the next party slot.
i++;
}
diff --git a/src/battle_transition.c b/src/battle_transition.c
index 2e87b9c1d7..11f9cddf4b 100644
--- a/src/battle_transition.c
+++ b/src/battle_transition.c
@@ -779,7 +779,7 @@ static const TransitionStateFunc sTransitionIntroFuncs[] =
static const struct SpriteFrameImage sSpriteImage_Pokeball[] =
{
- sPokeball_Gfx, sizeof(sPokeball_Gfx)
+ {sPokeball_Gfx, sizeof(sPokeball_Gfx)}
};
static const union AnimCmd sSpriteAnim_Pokeball[] =
@@ -841,12 +841,12 @@ static const struct OamData sOam_UnusedBrendanLass =
static const struct SpriteFrameImage sImageTable_UnusedBrendan[] =
{
- sUnusedBrendan_Gfx, sizeof(sUnusedBrendan_Gfx)
+ {sUnusedBrendan_Gfx, sizeof(sUnusedBrendan_Gfx)}
};
static const struct SpriteFrameImage sImageTable_UnusedLass[] =
{
- sUnusedLass_Gfx, sizeof(sUnusedLass_Gfx)
+ {sUnusedLass_Gfx, sizeof(sUnusedLass_Gfx)}
};
static const union AnimCmd sSpriteAnim_UnusedBrendanLass[] =
@@ -1017,8 +1017,7 @@ static void CB2_TestBattleTransition(void)
UpdatePaletteFade();
}
-// Unused
-static void TestBattleTransition(u8 transitionId)
+static void UNUSED TestBattleTransition(u8 transitionId)
{
sTestingTransitionId = transitionId;
SetMainCallback2(CB2_TestBattleTransition);
diff --git a/src/battle_tv.c b/src/battle_tv.c
index b9008b47a7..e9f518f605 100644
--- a/src/battle_tv.c
+++ b/src/battle_tv.c
@@ -526,7 +526,7 @@ static const u16 *const sPointsArray[] =
};
// Points will always be calculated for these messages
-// even if current pokemon does not have corresponding move
+// even if current Pokémon does not have corresponding move
static const u16 sSpecialBattleStrings[] =
{
STRINGID_PKMNPERISHCOUNTFELL, STRINGID_PKMNWISHCAMETRUE, STRINGID_PKMNLOSTPPGRUDGE,
diff --git a/src/battle_util.c b/src/battle_util.c
index f71c825c1b..d79c61b382 100644
--- a/src/battle_util.c
+++ b/src/battle_util.c
@@ -649,7 +649,7 @@ void HandleAction_NothingIsFainted(void)
gCurrentTurnActionNumber++;
gCurrentActionFuncId = gActionsByTurnOrder[gCurrentTurnActionNumber];
gHitMarker &= ~(HITMARKER_DESTINYBOND | HITMARKER_IGNORE_SUBSTITUTE | HITMARKER_ATTACKSTRING_PRINTED
- | HITMARKER_NO_PPDEDUCT | HITMARKER_IGNORE_SAFEGUARD | HITMARKER_IGNORE_ON_AIR
+ | HITMARKER_NO_PPDEDUCT | HITMARKER_STATUS_ABILITY_EFFECT | HITMARKER_IGNORE_ON_AIR
| HITMARKER_IGNORE_UNDERGROUND | HITMARKER_IGNORE_UNDERWATER | HITMARKER_PASSIVE_DAMAGE
| HITMARKER_OBEYS | HITMARKER_WAKE_UP_CLEAR | HITMARKER_SYNCHRONISE_EFFECT
| HITMARKER_CHARGING | HITMARKER_NEVER_SET);
@@ -662,7 +662,7 @@ void HandleAction_ActionFinished(void)
gCurrentActionFuncId = gActionsByTurnOrder[gCurrentTurnActionNumber];
SpecialStatusesClear();
gHitMarker &= ~(HITMARKER_DESTINYBOND | HITMARKER_IGNORE_SUBSTITUTE | HITMARKER_ATTACKSTRING_PRINTED
- | HITMARKER_NO_PPDEDUCT | HITMARKER_IGNORE_SAFEGUARD | HITMARKER_IGNORE_ON_AIR
+ | HITMARKER_NO_PPDEDUCT | HITMARKER_STATUS_ABILITY_EFFECT | HITMARKER_IGNORE_ON_AIR
| HITMARKER_IGNORE_UNDERGROUND | HITMARKER_IGNORE_UNDERWATER | HITMARKER_PASSIVE_DAMAGE
| HITMARKER_OBEYS | HITMARKER_WAKE_UP_CLEAR | HITMARKER_SYNCHRONISE_EFFECT
| HITMARKER_CHARGING | HITMARKER_NEVER_SET);
@@ -827,8 +827,7 @@ void PressurePPLoseOnUsingPerishSong(u8 attacker)
}
}
-// Unused
-static void MarkAllBattlersForControllerExec(void)
+static void UNUSED MarkAllBattlersForControllerExec(void)
{
int i;
@@ -1449,7 +1448,7 @@ u8 DoBattlerEndTurnEffects(void)
{
u8 effect = 0;
- gHitMarker |= (HITMARKER_GRUDGE | HITMARKER_SKIP_DMG_TRACK);
+ gHitMarker |= (HITMARKER_GRUDGE | HITMARKER_IGNORE_BIDE);
while (gBattleStruct->turnEffectsBattlerId < gBattlersCount && gBattleStruct->turnEffectsTracker <= ENDTURN_BATTLER_COUNT)
{
gActiveBattler = gBattlerAttacker = gBattlerByTurnOrder[gBattleStruct->turnEffectsBattlerId];
@@ -1546,7 +1545,7 @@ u8 DoBattlerEndTurnEffects(void)
if ((gBattleMons[gActiveBattler].status2 & STATUS2_NIGHTMARE) && gBattleMons[gActiveBattler].hp != 0)
{
// R/S does not perform this sleep check, which causes the nightmare effect to
- // persist even after the affected Pokemon has been awakened by Shed Skin.
+ // persist even after the affected Pokémon has been awakened by Shed Skin.
if (gBattleMons[gActiveBattler].status1 & STATUS1_SLEEP)
{
gBattleMoveDamage = gBattleMons[gActiveBattler].maxHP / 4;
@@ -1626,7 +1625,7 @@ u8 DoBattlerEndTurnEffects(void)
}
if (gBattlerAttacker != gBattlersCount)
{
- effect = 2; // a pokemon was awaken
+ effect = 2; // a Pokémon was awaken
break;
}
else
@@ -1686,7 +1685,7 @@ u8 DoBattlerEndTurnEffects(void)
if (gDisableStructs[gActiveBattler].disabledMove == gBattleMons[gActiveBattler].moves[i])
break;
}
- if (i == MAX_MON_MOVES) // pokemon does not have the disabled move anymore
+ if (i == MAX_MON_MOVES) // Pokémon does not have the disabled move anymore
{
gDisableStructs[gActiveBattler].disabledMove = MOVE_NONE;
gDisableStructs[gActiveBattler].disableTimer = 0;
@@ -1703,7 +1702,7 @@ u8 DoBattlerEndTurnEffects(void)
case ENDTURN_ENCORE: // encore
if (gDisableStructs[gActiveBattler].encoreTimer != 0)
{
- if (gBattleMons[gActiveBattler].moves[gDisableStructs[gActiveBattler].encoredMovePos] != gDisableStructs[gActiveBattler].encoredMove) // pokemon does not have the encored move anymore
+ if (gBattleMons[gActiveBattler].moves[gDisableStructs[gActiveBattler].encoredMovePos] != gDisableStructs[gActiveBattler].encoredMove) // Pokémon does not have the encored move anymore
{
gDisableStructs[gActiveBattler].encoredMove = MOVE_NONE;
gDisableStructs[gActiveBattler].encoreTimer = 0;
@@ -1762,13 +1761,13 @@ u8 DoBattlerEndTurnEffects(void)
return effect;
}
}
- gHitMarker &= ~(HITMARKER_GRUDGE | HITMARKER_SKIP_DMG_TRACK);
+ gHitMarker &= ~(HITMARKER_GRUDGE | HITMARKER_IGNORE_BIDE);
return 0;
}
bool8 HandleWishPerishSongOnTurnEnd(void)
{
- gHitMarker |= (HITMARKER_GRUDGE | HITMARKER_SKIP_DMG_TRACK);
+ gHitMarker |= (HITMARKER_GRUDGE | HITMARKER_IGNORE_BIDE);
switch (gBattleStruct->wishPerishSongState)
{
@@ -1797,7 +1796,7 @@ bool8 HandleWishPerishSongOnTurnEnd(void)
gBattlerTarget = gActiveBattler;
gBattlerAttacker = gWishFutureKnock.futureSightAttacker[gActiveBattler];
gBattleMoveDamage = gWishFutureKnock.futureSightDmg[gActiveBattler];
- gSpecialStatuses[gBattlerTarget].dmg = 0xFFFF;
+ gSpecialStatuses[gBattlerTarget].shellBellDmg = IGNORE_SHELL_BELL;
BattleScriptExecute(BattleScript_MonTookFutureAttack);
if (gWishFutureKnock.futureSightCounter[gActiveBattler] == 0
@@ -1868,7 +1867,7 @@ bool8 HandleWishPerishSongOnTurnEnd(void)
break;
}
- gHitMarker &= ~(HITMARKER_GRUDGE | HITMARKER_SKIP_DMG_TRACK);
+ gHitMarker &= ~(HITMARKER_GRUDGE | HITMARKER_IGNORE_BIDE);
return FALSE;
}
@@ -2213,11 +2212,11 @@ u8 AtkCanceller_UnableToUseMove(void)
{
// This is removed in FRLG and Emerald for some reason
//gBattleMons[gBattlerAttacker].status2 &= ~STATUS2_MULTIPLETURNS;
- if (gTakenDmg[gBattlerAttacker])
+ if (gBideDmg[gBattlerAttacker])
{
gCurrentMove = MOVE_BIDE;
- *bideDmg = gTakenDmg[gBattlerAttacker] * 2;
- gBattlerTarget = gTakenDmgByBattler[gBattlerAttacker];
+ *bideDmg = gBideDmg[gBattlerAttacker] * 2;
+ gBattlerTarget = gBideTarget[gBattlerAttacker];
if (gAbsentBattlerFlags & gBitTable[gBattlerTarget])
gBattlerTarget = GetMoveTarget(MOVE_BIDE, MOVE_TARGET_SELECTED + 1);
gBattlescriptCurrInstr = BattleScript_BideAttack;
@@ -2783,7 +2782,7 @@ u8 AbilityBattleEffects(u8 caseID, u8 battler, u8 ability, u8 special, u16 moveA
gBattleCommunication[MOVE_EFFECT_BYTE] += MOVE_EFFECT_AFFECTS_USER;
BattleScriptPushCursor();
gBattlescriptCurrInstr = BattleScript_ApplySecondaryEffect;
- gHitMarker |= HITMARKER_IGNORE_SAFEGUARD;
+ gHitMarker |= HITMARKER_STATUS_ABILITY_EFFECT;
effect++;
}
break;
@@ -2798,7 +2797,7 @@ u8 AbilityBattleEffects(u8 caseID, u8 battler, u8 ability, u8 special, u16 moveA
gBattleCommunication[MOVE_EFFECT_BYTE] = MOVE_EFFECT_AFFECTS_USER | MOVE_EFFECT_POISON;
BattleScriptPushCursor();
gBattlescriptCurrInstr = BattleScript_ApplySecondaryEffect;
- gHitMarker |= HITMARKER_IGNORE_SAFEGUARD;
+ gHitMarker |= HITMARKER_STATUS_ABILITY_EFFECT;
effect++;
}
break;
@@ -2813,7 +2812,7 @@ u8 AbilityBattleEffects(u8 caseID, u8 battler, u8 ability, u8 special, u16 moveA
gBattleCommunication[MOVE_EFFECT_BYTE] = MOVE_EFFECT_AFFECTS_USER | MOVE_EFFECT_PARALYSIS;
BattleScriptPushCursor();
gBattlescriptCurrInstr = BattleScript_ApplySecondaryEffect;
- gHitMarker |= HITMARKER_IGNORE_SAFEGUARD;
+ gHitMarker |= HITMARKER_STATUS_ABILITY_EFFECT;
effect++;
}
break;
@@ -2828,7 +2827,7 @@ u8 AbilityBattleEffects(u8 caseID, u8 battler, u8 ability, u8 special, u16 moveA
gBattleCommunication[MOVE_EFFECT_BYTE] = MOVE_EFFECT_AFFECTS_USER | MOVE_EFFECT_BURN;
BattleScriptPushCursor();
gBattlescriptCurrInstr = BattleScript_ApplySecondaryEffect;
- gHitMarker |= HITMARKER_IGNORE_SAFEGUARD;
+ gHitMarker |= HITMARKER_STATUS_ABILITY_EFFECT;
effect++;
}
break;
@@ -2964,7 +2963,7 @@ u8 AbilityBattleEffects(u8 caseID, u8 battler, u8 ability, u8 special, u16 moveA
gBattleScripting.battler = gBattlerTarget;
BattleScriptPushCursor();
gBattlescriptCurrInstr = BattleScript_SynchronizeActivates;
- gHitMarker |= HITMARKER_IGNORE_SAFEGUARD;
+ gHitMarker |= HITMARKER_STATUS_ABILITY_EFFECT;
effect++;
}
break;
@@ -2980,7 +2979,7 @@ u8 AbilityBattleEffects(u8 caseID, u8 battler, u8 ability, u8 special, u16 moveA
gBattleScripting.battler = gBattlerAttacker;
BattleScriptPushCursor();
gBattlescriptCurrInstr = BattleScript_SynchronizeActivates;
- gHitMarker |= HITMARKER_IGNORE_SAFEGUARD;
+ gHitMarker |= HITMARKER_STATUS_ABILITY_EFFECT;
effect++;
}
break;
@@ -3004,7 +3003,7 @@ u8 AbilityBattleEffects(u8 caseID, u8 battler, u8 ability, u8 special, u16 moveA
if (gBattleMons[i].ability == ABILITY_TRACE && (gStatuses3[i] & STATUS3_TRACE))
{
u8 target2;
- side = BATTLE_OPPOSITE(GetBattlerPosition(i)) & BIT_SIDE; // side of the opposing pokemon
+ side = BATTLE_OPPOSITE(GetBattlerPosition(i)) & BIT_SIDE; // side of the opposing Pokémon
target1 = GetBattlerAtPosition(side);
target2 = GetBattlerAtPosition(side + BIT_FLANK);
if (gBattleTypeFlags & BATTLE_TYPE_DOUBLE)
@@ -3243,8 +3242,8 @@ u8 ItemBattleEffects(u8 caseID, u8 battlerId, bool8 moveTurn)
int i = 0;
u8 effect = ITEM_NO_EFFECT;
u8 changedPP = 0;
- u8 battlerHoldEffect, atkHoldEffect, defHoldEffect;
- u8 battlerHoldEffectParam, atkHoldEffectParam, defHoldEffectParam;
+ u8 battlerHoldEffect, atkHoldEffect, UNUSED defHoldEffect;
+ u8 battlerHoldEffectParam, atkHoldEffectParam, UNUSED defHoldEffectParam;
u16 atkItem, defItem;
gLastUsedItem = gBattleMons[battlerId].item;
@@ -3770,8 +3769,8 @@ u8 ItemBattleEffects(u8 caseID, u8 battlerId, bool8 moveTurn)
break;
case HOLD_EFFECT_SHELL_BELL:
if (!(gMoveResultFlags & MOVE_RESULT_NO_EFFECT)
- && gSpecialStatuses[gBattlerTarget].dmg != 0
- && gSpecialStatuses[gBattlerTarget].dmg != 0xFFFF
+ && gSpecialStatuses[gBattlerTarget].shellBellDmg != 0
+ && gSpecialStatuses[gBattlerTarget].shellBellDmg != IGNORE_SHELL_BELL
&& gBattlerAttacker != gBattlerTarget
&& gBattleMons[gBattlerAttacker].hp != gBattleMons[gBattlerAttacker].maxHP
&& gBattleMons[gBattlerAttacker].hp != 0)
@@ -3779,10 +3778,10 @@ u8 ItemBattleEffects(u8 caseID, u8 battlerId, bool8 moveTurn)
gLastUsedItem = atkItem;
gPotentialItemEffectBattler = gBattlerAttacker;
gBattleScripting.battler = gBattlerAttacker;
- gBattleMoveDamage = (gSpecialStatuses[gBattlerTarget].dmg / atkHoldEffectParam) * -1;
+ gBattleMoveDamage = (gSpecialStatuses[gBattlerTarget].shellBellDmg / atkHoldEffectParam) * -1;
if (gBattleMoveDamage == 0)
gBattleMoveDamage = -1;
- gSpecialStatuses[gBattlerTarget].dmg = 0;
+ gSpecialStatuses[gBattlerTarget].shellBellDmg = 0;
BattleScriptPushCursor();
gBattlescriptCurrInstr = BattleScript_ItemHealHP_Ret;
effect++;
diff --git a/src/berry_blender.c b/src/berry_blender.c
index b882fc12d9..97262a4e2f 100644
--- a/src/berry_blender.c
+++ b/src/berry_blender.c
@@ -2377,8 +2377,7 @@ static void Debug_SetMaxRPMStage(s16 value)
sDebug_MaxRPMStage = value;
}
-// Unused
-static s16 Debug_GetMaxRPMStage(void)
+static s16 UNUSED Debug_GetMaxRPMStage(void)
{
return sDebug_MaxRPMStage;
}
@@ -2388,8 +2387,7 @@ static void Debug_SetGameTimeStage(s16 value)
sDebug_GameTimeStage = value;
}
-// Unued
-static s16 Debug_GetGameTimeStage(void)
+static s16 UNUSED Debug_GetGameTimeStage(void)
{
return sDebug_GameTimeStage;
}
@@ -2501,8 +2499,7 @@ static void CalculatePokeblock(struct BlenderBerry *berries, struct Pokeblock *p
flavors[i] = sPokeblockFlavors[i];
}
-// Unused
-static void Debug_CalculatePokeblock(struct BlenderBerry* berries, struct Pokeblock* pokeblock, u8 numPlayers, u8 *flavors, u16 maxRPM)
+static void UNUSED Debug_CalculatePokeblock(struct BlenderBerry* berries, struct Pokeblock* pokeblock, u8 numPlayers, u8 *flavors, u16 maxRPM)
{
CalculatePokeblock(berries, pokeblock, numPlayers, flavors, maxRPM);
}
@@ -3471,7 +3468,7 @@ static bool8 PrintBlendingResults(void)
struct Pokeblock pokeblock;
u8 flavors[FLAVOR_COUNT + 1];
u8 text[40];
- u16 berryIds[4]; // unused
+ u16 UNUSED berryIds[4];
switch (sBerryBlender->mainState)
{
@@ -3866,6 +3863,9 @@ static void Blender_AddTextPrinter(u8 windowId, const u8 *string, u8 x, u8 y, s3
{
case 0:
case 3:
+#ifdef UBFIX
+ default:
+#endif
txtColor[0] = TEXT_COLOR_WHITE;
txtColor[1] = TEXT_COLOR_DARK_GRAY;
txtColor[2] = TEXT_COLOR_LIGHT_GRAY;
diff --git a/src/berry_crush.c b/src/berry_crush.c
index c0a75b1994..4e789f27a4 100755
--- a/src/berry_crush.c
+++ b/src/berry_crush.c
@@ -1062,7 +1062,7 @@ static void BerryCrush_SetVBlankCB(void)
SetVBlankCallback(VBlankCB);
}
-static void BerryCrush_InitVBlankCB(void)
+static void UNUSED BerryCrush_InitVBlankCB(void)
{
SetVBlankCallback(NULL);
}
diff --git a/src/berry_fix_graphics.c b/src/berry_fix_graphics.c
index d766c39662..80510a4ce1 100644
--- a/src/berry_fix_graphics.c
+++ b/src/berry_fix_graphics.c
@@ -34,8 +34,8 @@ static const struct {
}
};
-// Unused. See berry_fix_program.c
-static void LoadBerryFixGraphics(u32 idx)
+// See berry_fix_program.c
+static void UNUSED LoadBerryFixGraphics(u32 idx)
{
REG_DISPCNT = 0;
REG_BG0HOFS = 0;
diff --git a/src/berry_powder.c b/src/berry_powder.c
index 7066f9d95c..4a9fa421d3 100755
--- a/src/berry_powder.c
+++ b/src/berry_powder.c
@@ -15,8 +15,7 @@
static EWRAM_DATA u8 sBerryPowderVendorWindowId = 0;
-// Unused
-static const struct BgTemplate sBerryPowderBgTemplates[] =
+static const struct BgTemplate UNUSED sBerryPowderBgTemplates[] =
{
{
.bg = 0,
@@ -57,10 +56,9 @@ static const struct BgTemplate sBerryPowderBgTemplates[] =
};
// ? Part of the BG templates?
-static const u32 sUnknown[] = {0xFF, 0x00};
+static const u32 UNUSED sUnknown[] = {0xFF, 0x00};
-// Unused
-static const struct WindowTemplate sBerryPowderWindowTemplates[] =
+static const struct WindowTemplate UNUSED sBerryPowderWindowTemplates[] =
{
{
.bg = 0,
@@ -177,7 +175,7 @@ bool8 GiveBerryPowder(u32 amountToAdd)
}
}
-static bool8 TakeBerryPowder_(u32 cost)
+static bool8 UNUSED TakeBerryPowder_(u32 cost)
{
u32 *powder = &gSaveBlock2Ptr->berryCrush.berryPowderAmount;
if (!HasEnoughBerryPowder_(cost))
diff --git a/src/birch_pc.c b/src/birch_pc.c
index 1f0ab23498..8256a1378b 100644
--- a/src/birch_pc.c
+++ b/src/birch_pc.c
@@ -20,7 +20,7 @@ bool16 ScriptGetPokedexInfo(void)
return IsNationalPokedexEnabled();
}
-// This shows your Hoenn Pokedex rating and not your National Dex.
+// This shows your Hoenn Pokédex rating and not your National Dex.
const u8 *GetPokedexRatingText(u16 count)
{
if (count < 10)
diff --git a/src/braille_puzzles.c b/src/braille_puzzles.c
index ae3ecb15ac..ab0f610fd7 100644
--- a/src/braille_puzzles.c
+++ b/src/braille_puzzles.c
@@ -259,7 +259,7 @@ static void DoBrailleRegisteelEffect(void)
}
// theory: another commented out DoBrailleWait and Task_BrailleWait.
-static void DoBrailleWait(void)
+static void UNUSED DoBrailleWait(void)
{
}
diff --git a/src/cable_club.c b/src/cable_club.c
index b12a50920f..5305326589 100644
--- a/src/cable_club.c
+++ b/src/cable_club.c
@@ -195,8 +195,7 @@ static bool32 CheckSioErrored(u8 taskId)
return FALSE;
}
-// Unused
-static void Task_DelayedBlockRequest(u8 taskId)
+static void UNUSED Task_DelayedBlockRequest(u8 taskId)
{
gTasks[taskId].data[0]++;
if (gTasks[taskId].data[0] == 10)
@@ -1166,14 +1165,13 @@ void PlayerEnteredTradeSeat(void)
CreateTask_EnterCableClubSeat(Task_StartWiredTrade);
}
-// Unused
-static void CreateTask_StartWiredTrade(void)
+static void UNUSED CreateTask_StartWiredTrade(void)
{
CreateTask(Task_StartWiredTrade, 80);
}
-// Unused, implemented in Ruby/Sapphire
-void Script_StartWiredTrade(void)
+// Implemented in Ruby/Sapphire
+void UNUSED Script_StartWiredTrade(void)
{
// CreateTask_StartWiredTrade();
// ScriptContext_Stop();
@@ -1189,10 +1187,9 @@ void ColosseumPlayerSpotTriggered(void)
CreateTask_EnterCableClubSeat(Task_StartWiredCableClubBattle);
}
-// Unused
-static void CreateTask_EnterCableClubSeatNoFollowup(void)
+static UNUSED void CreateTask_EnterCableClubSeatNoFollowup(void)
{
- u8 taskId = CreateTask(Task_EnterCableClubSeat, 80);
+ u8 UNUSED taskId = CreateTask(Task_EnterCableClubSeat, 80);
ScriptContext_Stop();
}
@@ -1262,8 +1259,7 @@ static void Task_WaitExitToScript(u8 taskId)
}
}
-// Unused
-static void ExitLinkToScript(u8 taskId)
+static void UNUSED ExitLinkToScript(u8 taskId)
{
SetCloseLinkCallback();
gTasks[taskId].func = Task_WaitExitToScript;
diff --git a/src/contest.c b/src/contest.c
index 09c07536f1..8f0ad7fbfe 100644
--- a/src/contest.c
+++ b/src/contest.c
@@ -194,7 +194,7 @@ static void SwapMoveDescAndContestTilemaps(void);
#define CONTESTANT_TEXT_COLOR_START 10
enum {
-// The "{Pokemon Name} / {Trainer Name}" windows.
+// The "{Pokémon Name} / {Trainer Name}" windows.
WIN_CONTESTANT0_NAME,
WIN_CONTESTANT1_NAME,
WIN_CONTESTANT2_NAME,
@@ -3251,8 +3251,7 @@ static void DrawMoveEffectSymbol(u16 move, u8 contestant)
}
}
-// Unused
-static void DrawMoveEffectSymbols(void)
+static void UNUSED DrawMoveEffectSymbols(void)
{
s32 i;
@@ -3435,11 +3434,11 @@ static void RankContestants(void)
// For each contestant, find the best rank with their point total.
// Normally, each point total is different, and this will output the
- // rankings as expected. However, if two pokemon are tied, then they
+ // rankings as expected. However, if two Pokémon are tied, then they
// both get the best rank for that point total.
//
// For example if the point totals are [100, 80, 80, 50], the ranks will
- // be [1, 2, 2, 4]. The pokemon with a point total of 80 stop looking
+ // be [1, 2, 2, 4]. The Pokémon with a point total of 80 stop looking
// when they see the first 80 in the array, so they both share the '2'
// rank.
for (i = 0; i < CONTESTANT_COUNT; i++)
@@ -4221,8 +4220,7 @@ static void SpriteCB_EndBlinkContestantBox(struct Sprite *sprite)
ResetBlendForContestantBoxBlink();
}
-// Unused.
-static void ContestDebugTogglePointTotal(void)
+static void UNUSED ContestDebugTogglePointTotal(void)
{
if(eContestDebugMode == CONTEST_DEBUG_MODE_PRINT_POINT_TOTAL)
eContestDebugMode = CONTEST_DEBUG_MODE_OFF;
@@ -4592,10 +4590,10 @@ void MakeContestantNervous(u8 p)
// ContestantStatus::nextTurnOrder field of each contestant. The remaining
// turns are assigned such that the turn order will reverse.
//
-// For example, if no pokemon have a defined nextTurnOrder, then the 4th
+// For example, if no Pokémon have a defined nextTurnOrder, then the 4th
// will become 1st, the 3rd will become 2nd, etc.
//
-// Note: This function assumes that multiple pokemon cannot have the same
+// Note: This function assumes that multiple Pokémon cannot have the same
// nextTurnOrder value.
static void ApplyNextTurnOrder(void)
{
@@ -4876,15 +4874,13 @@ static void Task_ShowAndUpdateApplauseMeter(u8 taskId)
}
}
-// Unused.
-static void HideApplauseMeterNoAnim(void)
+static void UNUSED HideApplauseMeterNoAnim(void)
{
gSprites[eContest.applauseMeterSpriteId].x2 = 0;
gSprites[eContest.applauseMeterSpriteId].invisible = FALSE;
}
-// Unused.
-static void ShowApplauseMeterNoAnim(void)
+static void UNUSED ShowApplauseMeterNoAnim(void)
{
gSprites[eContest.applauseMeterSpriteId].invisible = TRUE;
}
diff --git a/src/credits.c b/src/credits.c
index b412b29e27..c433baf1d1 100644
--- a/src/credits.c
+++ b/src/credits.c
@@ -63,12 +63,12 @@ enum {
struct CreditsData
{
- u16 monToShow[NUM_MON_SLIDES]; // List of Pokemon species ids that will show during the credits
+ u16 monToShow[NUM_MON_SLIDES]; // List of Pokémon species ids that will show during the credits
u16 imgCounter; //how many mon images have been shown
u16 nextImgPos; //if the next image spawns left/center/right
u16 currShownMon; //index into monToShow
- u16 numMonToShow; //number of pokemon to show, always NUM_MON_SLIDES after determine function
- u16 caughtMonIds[NATIONAL_DEX_COUNT]; //temporary location to hold a condensed array of all caught pokemon
+ u16 numMonToShow; //number of Pokémon to show, always NUM_MON_SLIDES after determine function
+ u16 caughtMonIds[NATIONAL_DEX_COUNT]; //temporary location to hold a condensed array of all caught Pokémon
u16 numCaughtMon; //count of filled spaces in caughtMonIds
u16 unused[7];
};
@@ -80,7 +80,7 @@ struct CreditsEntry
const u8 *text;
};
-static EWRAM_DATA s16 sUnkVar = 0; // Never read, only set to 0
+static EWRAM_DATA s16 UNUSED sUnkVar = 0; // Never read, only set to 0
static EWRAM_DATA u16 sSavedTaskId = 0;
EWRAM_DATA bool8 gHasHallOfFameRecords = 0;
static EWRAM_DATA bool8 sUsedSpeedUp = 0; // Never read
@@ -1555,8 +1555,8 @@ static void DeterminePokemonToShow(void)
u16 dexNum;
u16 j;
- // Go through the Pokedex, and anything that has gotten caught we put into our massive array.
- // This basically packs all of the caught pokemon into the front of the array
+ // Go through the Pokédex, and anything that has gotten caught we put into our massive array.
+ // This basically packs all of the caught Pokémon into the front of the array
for (dexNum = 1, j = 0; dexNum < NATIONAL_DEX_COUNT; dexNum++)
{
if (GetSetPokedexFlag(dexNum, FLAG_GET_CAUGHT))
@@ -1570,14 +1570,14 @@ static void DeterminePokemonToShow(void)
for (dexNum = j; dexNum < NATIONAL_DEX_COUNT; dexNum++)
sCreditsData->caughtMonIds[dexNum] = NATIONAL_DEX_NONE;
- // Cap the number of pokemon we care about to NUM_MON_SLIDES, the max we show in the credits scene (-1 for the starter)
+ // Cap the number of Pokémon we care about to NUM_MON_SLIDES, the max we show in the credits scene (-1 for the starter)
sCreditsData->numCaughtMon = j;
if (sCreditsData->numCaughtMon < NUM_MON_SLIDES)
sCreditsData->numMonToShow = j;
else
sCreditsData->numMonToShow = NUM_MON_SLIDES;
- // Loop through our list of caught pokemon and select randomly from it to fill the images to show
+ // Loop through our list of caught Pokémon and select randomly from it to fill the images to show
j = 0;
do
{
@@ -1598,7 +1598,7 @@ static void DeterminePokemonToShow(void)
}
while (sCreditsData->numCaughtMon != 0 && j < NUM_MON_SLIDES);
- // If we don't have enough pokemon in the dex to fill everything, copy the selected mon into the end of the array, so it loops
+ // If we don't have enough Pokémon in the dex to fill everything, copy the selected mon into the end of the array, so it loops
if (sCreditsData->numMonToShow < NUM_MON_SLIDES)
{
for (j = sCreditsData->numMonToShow, page = 0; j < NUM_MON_SLIDES; j++)
@@ -1609,7 +1609,7 @@ static void DeterminePokemonToShow(void)
if (page == sCreditsData->numMonToShow)
page = 0;
}
- // Ensure the last pokemon is our starter
+ // Ensure the last Pokémon is our starter
sCreditsData->monToShow[NUM_MON_SLIDES - 1] = starter;
}
else
@@ -1617,7 +1617,7 @@ static void DeterminePokemonToShow(void)
// Check to see if our starter has already appeared in this list, break if it has
for (dexNum = 0; sCreditsData->monToShow[dexNum] != starter && dexNum < NUM_MON_SLIDES; dexNum++);
- // If it has, swap it with the last pokemon, to ensure our starter is the last image
+ // If it has, swap it with the last Pokémon, to ensure our starter is the last image
if (dexNum < sCreditsData->numMonToShow - 1)
{
sCreditsData->monToShow[dexNum] = sCreditsData->monToShow[NUM_MON_SLIDES-1];
@@ -1625,7 +1625,7 @@ static void DeterminePokemonToShow(void)
}
else
{
- // Ensure the last pokemon is our starter
+ // Ensure the last Pokémon is our starter
sCreditsData->monToShow[NUM_MON_SLIDES - 1] = starter;
}
}
diff --git a/src/data.c b/src/data.c
index 7f1e9bfcc8..04e547644e 100644
--- a/src/data.c
+++ b/src/data.c
@@ -16,100 +16,100 @@ static const u32 sMinigameDigitsThin_Gfx[] = INCBIN_U32("graphics/link/minigame_
const struct SpriteFrameImage gBattlerPicTable_PlayerLeft[] =
{
- BATTLER_OFFSET(0), MON_PIC_SIZE,
- BATTLER_OFFSET(1), MON_PIC_SIZE,
- BATTLER_OFFSET(2), MON_PIC_SIZE,
- BATTLER_OFFSET(3), MON_PIC_SIZE,
+ {BATTLER_OFFSET(0), MON_PIC_SIZE},
+ {BATTLER_OFFSET(1), MON_PIC_SIZE},
+ {BATTLER_OFFSET(2), MON_PIC_SIZE},
+ {BATTLER_OFFSET(3), MON_PIC_SIZE},
};
const struct SpriteFrameImage gBattlerPicTable_OpponentLeft[] =
{
- BATTLER_OFFSET(4), MON_PIC_SIZE,
- BATTLER_OFFSET(5), MON_PIC_SIZE,
- BATTLER_OFFSET(6), MON_PIC_SIZE,
- BATTLER_OFFSET(7), MON_PIC_SIZE,
+ {BATTLER_OFFSET(4), MON_PIC_SIZE},
+ {BATTLER_OFFSET(5), MON_PIC_SIZE},
+ {BATTLER_OFFSET(6), MON_PIC_SIZE},
+ {BATTLER_OFFSET(7), MON_PIC_SIZE},
};
const struct SpriteFrameImage gBattlerPicTable_PlayerRight[] =
{
- BATTLER_OFFSET(8), MON_PIC_SIZE,
- BATTLER_OFFSET(9), MON_PIC_SIZE,
- BATTLER_OFFSET(10), MON_PIC_SIZE,
- BATTLER_OFFSET(11), MON_PIC_SIZE,
+ {BATTLER_OFFSET(8), MON_PIC_SIZE},
+ {BATTLER_OFFSET(9), MON_PIC_SIZE},
+ {BATTLER_OFFSET(10), MON_PIC_SIZE},
+ {BATTLER_OFFSET(11), MON_PIC_SIZE},
};
const struct SpriteFrameImage gBattlerPicTable_OpponentRight[] =
{
- BATTLER_OFFSET(12), MON_PIC_SIZE,
- BATTLER_OFFSET(13), MON_PIC_SIZE,
- BATTLER_OFFSET(14), MON_PIC_SIZE,
- BATTLER_OFFSET(15), MON_PIC_SIZE,
+ {BATTLER_OFFSET(12), MON_PIC_SIZE},
+ {BATTLER_OFFSET(13), MON_PIC_SIZE},
+ {BATTLER_OFFSET(14), MON_PIC_SIZE},
+ {BATTLER_OFFSET(15), MON_PIC_SIZE},
};
const struct SpriteFrameImage gTrainerBackPicTable_Brendan[] =
{
- gTrainerBackPic_Brendan + TRAINER_PIC_SIZE * 0, TRAINER_PIC_SIZE,
- gTrainerBackPic_Brendan + TRAINER_PIC_SIZE * 1, TRAINER_PIC_SIZE,
- gTrainerBackPic_Brendan + TRAINER_PIC_SIZE * 2, TRAINER_PIC_SIZE,
- gTrainerBackPic_Brendan + TRAINER_PIC_SIZE * 3, TRAINER_PIC_SIZE,
+ {gTrainerBackPic_Brendan + TRAINER_PIC_SIZE * 0, TRAINER_PIC_SIZE},
+ {gTrainerBackPic_Brendan + TRAINER_PIC_SIZE * 1, TRAINER_PIC_SIZE},
+ {gTrainerBackPic_Brendan + TRAINER_PIC_SIZE * 2, TRAINER_PIC_SIZE},
+ {gTrainerBackPic_Brendan + TRAINER_PIC_SIZE * 3, TRAINER_PIC_SIZE},
};
const struct SpriteFrameImage gTrainerBackPicTable_May[] =
{
- gTrainerBackPic_May + TRAINER_PIC_SIZE * 0, TRAINER_PIC_SIZE,
- gTrainerBackPic_May + TRAINER_PIC_SIZE * 1, TRAINER_PIC_SIZE,
- gTrainerBackPic_May + TRAINER_PIC_SIZE * 2, TRAINER_PIC_SIZE,
- gTrainerBackPic_May + TRAINER_PIC_SIZE * 3, TRAINER_PIC_SIZE,
+ {gTrainerBackPic_May + TRAINER_PIC_SIZE * 0, TRAINER_PIC_SIZE},
+ {gTrainerBackPic_May + TRAINER_PIC_SIZE * 1, TRAINER_PIC_SIZE},
+ {gTrainerBackPic_May + TRAINER_PIC_SIZE * 2, TRAINER_PIC_SIZE},
+ {gTrainerBackPic_May + TRAINER_PIC_SIZE * 3, TRAINER_PIC_SIZE},
};
const struct SpriteFrameImage gTrainerBackPicTable_Red[] =
{
- gTrainerBackPic_Red + TRAINER_PIC_SIZE * 0, TRAINER_PIC_SIZE,
- gTrainerBackPic_Red + TRAINER_PIC_SIZE * 1, TRAINER_PIC_SIZE,
- gTrainerBackPic_Red + TRAINER_PIC_SIZE * 2, TRAINER_PIC_SIZE,
- gTrainerBackPic_Red + TRAINER_PIC_SIZE * 3, TRAINER_PIC_SIZE,
- gTrainerBackPic_Red + TRAINER_PIC_SIZE * 4, TRAINER_PIC_SIZE,
+ {gTrainerBackPic_Red + TRAINER_PIC_SIZE * 0, TRAINER_PIC_SIZE},
+ {gTrainerBackPic_Red + TRAINER_PIC_SIZE * 1, TRAINER_PIC_SIZE},
+ {gTrainerBackPic_Red + TRAINER_PIC_SIZE * 2, TRAINER_PIC_SIZE},
+ {gTrainerBackPic_Red + TRAINER_PIC_SIZE * 3, TRAINER_PIC_SIZE},
+ {gTrainerBackPic_Red + TRAINER_PIC_SIZE * 4, TRAINER_PIC_SIZE},
};
const struct SpriteFrameImage gTrainerBackPicTable_Leaf[] =
{
- gTrainerBackPic_Leaf + TRAINER_PIC_SIZE * 0, TRAINER_PIC_SIZE,
- gTrainerBackPic_Leaf + TRAINER_PIC_SIZE * 1, TRAINER_PIC_SIZE,
- gTrainerBackPic_Leaf + TRAINER_PIC_SIZE * 2, TRAINER_PIC_SIZE,
- gTrainerBackPic_Leaf + TRAINER_PIC_SIZE * 3, TRAINER_PIC_SIZE,
- gTrainerBackPic_Leaf + TRAINER_PIC_SIZE * 4, TRAINER_PIC_SIZE,
+ {gTrainerBackPic_Leaf + TRAINER_PIC_SIZE * 0, TRAINER_PIC_SIZE},
+ {gTrainerBackPic_Leaf + TRAINER_PIC_SIZE * 1, TRAINER_PIC_SIZE},
+ {gTrainerBackPic_Leaf + TRAINER_PIC_SIZE * 2, TRAINER_PIC_SIZE},
+ {gTrainerBackPic_Leaf + TRAINER_PIC_SIZE * 3, TRAINER_PIC_SIZE},
+ {gTrainerBackPic_Leaf + TRAINER_PIC_SIZE * 4, TRAINER_PIC_SIZE},
};
const struct SpriteFrameImage gTrainerBackPicTable_RubySapphireBrendan[] =
{
- gTrainerBackPic_RubySapphireBrendan + TRAINER_PIC_SIZE * 0, TRAINER_PIC_SIZE,
- gTrainerBackPic_RubySapphireBrendan + TRAINER_PIC_SIZE * 1, TRAINER_PIC_SIZE,
- gTrainerBackPic_RubySapphireBrendan + TRAINER_PIC_SIZE * 2, TRAINER_PIC_SIZE,
- gTrainerBackPic_RubySapphireBrendan + TRAINER_PIC_SIZE * 3, TRAINER_PIC_SIZE,
+ {gTrainerBackPic_RubySapphireBrendan + TRAINER_PIC_SIZE * 0, TRAINER_PIC_SIZE},
+ {gTrainerBackPic_RubySapphireBrendan + TRAINER_PIC_SIZE * 1, TRAINER_PIC_SIZE},
+ {gTrainerBackPic_RubySapphireBrendan + TRAINER_PIC_SIZE * 2, TRAINER_PIC_SIZE},
+ {gTrainerBackPic_RubySapphireBrendan + TRAINER_PIC_SIZE * 3, TRAINER_PIC_SIZE},
};
const struct SpriteFrameImage gTrainerBackPicTable_RubySapphireMay[] =
{
- gTrainerBackPic_RubySapphireMay + TRAINER_PIC_SIZE * 0, TRAINER_PIC_SIZE,
- gTrainerBackPic_RubySapphireMay + TRAINER_PIC_SIZE * 1, TRAINER_PIC_SIZE,
- gTrainerBackPic_RubySapphireMay + TRAINER_PIC_SIZE * 2, TRAINER_PIC_SIZE,
- gTrainerBackPic_RubySapphireMay + TRAINER_PIC_SIZE * 3, TRAINER_PIC_SIZE,
+ {gTrainerBackPic_RubySapphireMay + TRAINER_PIC_SIZE * 0, TRAINER_PIC_SIZE},
+ {gTrainerBackPic_RubySapphireMay + TRAINER_PIC_SIZE * 1, TRAINER_PIC_SIZE},
+ {gTrainerBackPic_RubySapphireMay + TRAINER_PIC_SIZE * 2, TRAINER_PIC_SIZE},
+ {gTrainerBackPic_RubySapphireMay + TRAINER_PIC_SIZE * 3, TRAINER_PIC_SIZE},
};
const struct SpriteFrameImage gTrainerBackPicTable_Wally[] =
{
- gTrainerBackPic_Wally + TRAINER_PIC_SIZE * 0, TRAINER_PIC_SIZE,
- gTrainerBackPic_Wally + TRAINER_PIC_SIZE * 1, TRAINER_PIC_SIZE,
- gTrainerBackPic_Wally + TRAINER_PIC_SIZE * 2, TRAINER_PIC_SIZE,
- gTrainerBackPic_Wally + TRAINER_PIC_SIZE * 3, TRAINER_PIC_SIZE,
+ {gTrainerBackPic_Wally + TRAINER_PIC_SIZE * 0, TRAINER_PIC_SIZE},
+ {gTrainerBackPic_Wally + TRAINER_PIC_SIZE * 1, TRAINER_PIC_SIZE},
+ {gTrainerBackPic_Wally + TRAINER_PIC_SIZE * 2, TRAINER_PIC_SIZE},
+ {gTrainerBackPic_Wally + TRAINER_PIC_SIZE * 3, TRAINER_PIC_SIZE},
};
const struct SpriteFrameImage gTrainerBackPicTable_Steven[] =
{
- gTrainerBackPic_Steven + TRAINER_PIC_SIZE * 0, TRAINER_PIC_SIZE,
- gTrainerBackPic_Steven + TRAINER_PIC_SIZE * 1, TRAINER_PIC_SIZE,
- gTrainerBackPic_Steven + TRAINER_PIC_SIZE * 2, TRAINER_PIC_SIZE,
- gTrainerBackPic_Steven + TRAINER_PIC_SIZE * 3, TRAINER_PIC_SIZE,
+ {gTrainerBackPic_Steven + TRAINER_PIC_SIZE * 0, TRAINER_PIC_SIZE},
+ {gTrainerBackPic_Steven + TRAINER_PIC_SIZE * 1, TRAINER_PIC_SIZE},
+ {gTrainerBackPic_Steven + TRAINER_PIC_SIZE * 2, TRAINER_PIC_SIZE},
+ {gTrainerBackPic_Steven + TRAINER_PIC_SIZE * 3, TRAINER_PIC_SIZE},
};
static const union AnimCmd sAnim_GeneralFrame0[] =
diff --git a/src/data/battle_frontier/battle_frontier_trainer_mons.h b/src/data/battle_frontier/battle_frontier_trainer_mons.h
index 625a602658..f0a203d56d 100644
--- a/src/data/battle_frontier/battle_frontier_trainer_mons.h
+++ b/src/data/battle_frontier/battle_frontier_trainer_mons.h
@@ -4172,7 +4172,7 @@
FRONTIER_MON_##lastmon##_10,\
-1
-// The strong Psychic M/F trainers all use the below pokemon
+// The strong Psychic M/F trainers all use the below Pokémon
// Additionally they use 1 of 3 legendary trios, and Latios or Latias depending on gender
#define FRONTIER_MONS_PSYCHIC_2(lati, legend1, legend2, legend3) \
FRONTIER_MON_WOBBUFFET_1, \
diff --git a/src/data/credits.h b/src/data/credits.h
index 3ae2b1d3be..3b92ae26f7 100644
--- a/src/data/credits.h
+++ b/src/data/credits.h
@@ -221,565 +221,565 @@ static const u8 sCreditsText_MotoyasuTojima[] = _("Motoyasu Toji
static const u8 sCreditsText_NicolaPrattBarlow[] = _("Nicola Pratt-Barlow");
static const u8 sCreditsText_ShellieDow[] = _("Shellie Dow");
static const u8 sCreditsText_ErikJohnson[] = _("Erik Johnson");
-static const struct CreditsEntry sCreditsEntry_EmptyString[] = { 0, FALSE, sCreditsText_EmptyString};
-static const struct CreditsEntry sCreditsEntry_PkmnEmeraldVersion[] = { 7, TRUE, sCreditsText_PkmnEmeraldVersion};
-static const struct CreditsEntry sCreditsEntry_Credits[] = {11, TRUE, sCreditsText_Credits};
-static const struct CreditsEntry sCreditsEntry_ExecutiveDirector[] = { 8, TRUE, sCreditsText_ExecutiveDirector};
-static const struct CreditsEntry sCreditsEntry_Director[] = {12, TRUE, sCreditsText_Director};
-static const struct CreditsEntry sCreditsEntry_ArtDirector[] = {10, TRUE, sCreditsText_ArtDirector};
-static const struct CreditsEntry sCreditsEntry_BattleDirector[] = {10, TRUE, sCreditsText_BattleDirector};
-static const struct CreditsEntry sCreditsEntry_MainProgrammer[] = {10, TRUE, sCreditsText_MainProgrammer};
-static const struct CreditsEntry sCreditsEntry_BattleSystemPgrms[] = { 8, TRUE, sCreditsText_BattleSystemPgrms};
-static const struct CreditsEntry sCreditsEntry_FieldSystemPgrms[] = { 7, TRUE, sCreditsText_FieldSystemPgrms};
-static const struct CreditsEntry sCreditsEntry_Programmers[] = {12, TRUE, sCreditsText_Programmers};
-static const struct CreditsEntry sCreditsEntry_MainGraphicDesigner[] = { 7, TRUE, sCreditsText_MainGraphicDesigner};
-static const struct CreditsEntry sCreditsEntry_GraphicDesigners[] = { 9, TRUE, sCreditsText_GraphicDesigners};
-static const struct CreditsEntry sCreditsEntry_PkmnDesigners[] = {10, TRUE, sCreditsText_PkmnDesigners};
-static const struct CreditsEntry sCreditsEntry_MusicComposition[] = {13, TRUE, sCreditsText_MusicComposition};
-static const struct CreditsEntry sCreditsEntry_SoundEffectsAndPkmnVoices[] = { 4, TRUE, sCreditsText_SoundEffectsAndPkmnVoices};
-static const struct CreditsEntry sCreditsEntry_GameDesigners[] = {11, TRUE, sCreditsText_GameDesigners};
-static const struct CreditsEntry sCreditsEntry_ScenarioPlot[] = {11, TRUE, sCreditsText_ScenarioPlot};
-static const struct CreditsEntry sCreditsEntry_Scenario[] = {13, TRUE, sCreditsText_Scenario};
-static const struct CreditsEntry sCreditsEntry_ScriptDesigners[] = {10, TRUE, sCreditsText_ScriptDesigners};
-static const struct CreditsEntry sCreditsEntry_MapDesigners[] = {11, TRUE, sCreditsText_MapDesigners};
-static const struct CreditsEntry sCreditsEntry_MapDataDesigners[] = { 9, TRUE, sCreditsText_MapDataDesigners};
-static const struct CreditsEntry sCreditsEntry_ParametricDesigners[] = { 9, TRUE, sCreditsText_ParametricDesigners};
-static const struct CreditsEntry sCreditsEntry_PokedexText[] = {11, TRUE, sCreditsText_PokedexText};
-static const struct CreditsEntry sCreditsEntry_EnvAndToolPgrms[] = { 6, TRUE, sCreditsText_EnvAndToolPgrms};
-static const struct CreditsEntry sCreditsEntry_NCLProductTesting[] = {11, TRUE, sCreditsText_NCLProductTesting};
-static const struct CreditsEntry sCreditsEntry_SpecialThanks[] = {10, TRUE, sCreditsText_SpecialThanks};
-static const struct CreditsEntry sCreditsEntry_Coordinators[] = {11, TRUE, sCreditsText_Coordinators};
-static const struct CreditsEntry sCreditsEntry_Producers[] = {11, TRUE, sCreditsText_Producers};
-static const struct CreditsEntry sCreditsEntry_ExecProducers[] = { 7, TRUE, sCreditsText_ExecProducers};
-static const struct CreditsEntry sCreditsEntry_InfoSupervisors[] = {10, TRUE, sCreditsText_InfoSupervisors};
-static const struct CreditsEntry sCreditsEntry_TaskManagers[] = { 8, TRUE, sCreditsText_TaskManagers};
-static const struct CreditsEntry sCreditsEntry_BrailleCodeCheck[] = {10, TRUE, sCreditsText_BrailleCodeCheck};
-static const struct CreditsEntry sCreditsEntry_WorldDirector[] = {10, TRUE, sCreditsText_WorldDirector};
-static const struct CreditsEntry sCreditsEntry_BattleFrontierData[] = { 8, TRUE, sCreditsText_BattleFrontierData};
-static const struct CreditsEntry sCreditsEntry_SupportProgrammers[] = {10, TRUE, sCreditsText_SupportProgrammers};
-static const struct CreditsEntry sCreditsEntry_Artwork[] = {12, TRUE, sCreditsText_Artwork};
-static const struct CreditsEntry sCreditsEntry_LeadProgrammer[] = {10, TRUE, sCreditsText_LeadProgrammer};
-static const struct CreditsEntry sCreditsEntry_LeadGraphicArtist[] = { 9, TRUE, sCreditsText_LeadGraphicArtist};
-static const struct CreditsEntry sCreditsEntry_SatoshiTajiri[] = {11, FALSE, sCreditsText_SatoshiTajiri};
-static const struct CreditsEntry sCreditsEntry_JunichiMasuda[] = {11, FALSE, sCreditsText_JunichiMasuda};
-static const struct CreditsEntry sCreditsEntry_KenSugimori[] = {11, FALSE, sCreditsText_KenSugimori};
-static const struct CreditsEntry sCreditsEntry_ShigekiMorimoto[] = {11, FALSE, sCreditsText_ShigekiMorimoto};
-static const struct CreditsEntry sCreditsEntry_TetsuyaWatanabe[] = {11, FALSE, sCreditsText_TetsuyaWatanabe};
-static const struct CreditsEntry sCreditsEntry_HisashiSogabe[] = {11, FALSE, sCreditsText_HisashiSogabe};
-static const struct CreditsEntry sCreditsEntry_SosukeTamada[] = {11, FALSE, sCreditsText_SosukeTamada};
-static const struct CreditsEntry sCreditsEntry_AkitoMori[] = {11, FALSE, sCreditsText_AkitoMori};
-static const struct CreditsEntry sCreditsEntry_KeitaKagaya[] = {11, FALSE, sCreditsText_KeitaKagaya};
-static const struct CreditsEntry sCreditsEntry_YoshinoriMatsuda[] = {11, FALSE, sCreditsText_YoshinoriMatsuda};
-static const struct CreditsEntry sCreditsEntry_HiroyukiNakamura[] = {11, FALSE, sCreditsText_HiroyukiNakamura};
-static const struct CreditsEntry sCreditsEntry_MasaoTaya[] = {11, FALSE, sCreditsText_MasaoTaya};
-static const struct CreditsEntry sCreditsEntry_SatoshiNohara[] = {11, FALSE, sCreditsText_SatoshiNohara};
-static const struct CreditsEntry sCreditsEntry_TomomichiOhta[] = {11, FALSE, sCreditsText_TomomichiOhta};
-static const struct CreditsEntry sCreditsEntry_MiyukiIwasawa[] = {11, FALSE, sCreditsText_MiyukiIwasawa};
-static const struct CreditsEntry sCreditsEntry_TakenoriOhta[] = {11, FALSE, sCreditsText_TakenoriOhta};
-static const struct CreditsEntry sCreditsEntry_HironobuYoshida[] = {11, FALSE, sCreditsText_HironobuYoshida};
-static const struct CreditsEntry sCreditsEntry_MotofumiFujiwara[] = {11, FALSE, sCreditsText_MotofumiFujiwara};
-static const struct CreditsEntry sCreditsEntry_SatoshiOhta[] = {11, FALSE, sCreditsText_SatoshiOhta};
-static const struct CreditsEntry sCreditsEntry_AsukaIwashita[] = {11, FALSE, sCreditsText_AsukaIwashita};
-static const struct CreditsEntry sCreditsEntry_AimiTomita[] = {11, FALSE, sCreditsText_AimiTomita};
-static const struct CreditsEntry sCreditsEntry_TakaoUnno[] = {11, FALSE, sCreditsText_TakaoUnno};
-static const struct CreditsEntry sCreditsEntry_KanakoEo[] = {11, FALSE, sCreditsText_KanakoEo};
-static const struct CreditsEntry sCreditsEntry_JunOkutani[] = {11, FALSE, sCreditsText_JunOkutani};
-static const struct CreditsEntry sCreditsEntry_AtsukoNishida[] = {11, FALSE, sCreditsText_AtsukoNishida};
-static const struct CreditsEntry sCreditsEntry_MuneoSaito[] = {11, FALSE, sCreditsText_MuneoSaito};
-static const struct CreditsEntry sCreditsEntry_RenaYoshikawa[] = {11, FALSE, sCreditsText_RenaYoshikawa};
-static const struct CreditsEntry sCreditsEntry_GoIchinose[] = {11, FALSE, sCreditsText_GoIchinose};
-static const struct CreditsEntry sCreditsEntry_MorikazuAoki[] = {11, FALSE, sCreditsText_MorikazuAoki};
-static const struct CreditsEntry sCreditsEntry_KojiNishino[] = {11, FALSE, sCreditsText_KojiNishino};
-static const struct CreditsEntry sCreditsEntry_KenjiMatsushima[] = {11, FALSE, sCreditsText_KenjiMatsushima};
-static const struct CreditsEntry sCreditsEntry_TetsujiOhta[] = {11, FALSE, sCreditsText_TetsujiOhta};
-static const struct CreditsEntry sCreditsEntry_HitomiSato[] = {11, FALSE, sCreditsText_HitomiSato};
-static const struct CreditsEntry sCreditsEntry_TakeshiKawachimaru[] = {11, FALSE, sCreditsText_TakeshiKawachimaru};
-static const struct CreditsEntry sCreditsEntry_TeruyukiShimoyamada[] = {11, FALSE, sCreditsText_TeruyukiShimoyamada};
-static const struct CreditsEntry sCreditsEntry_ShigeruOhmori[] = {11, FALSE, sCreditsText_ShigeruOhmori};
-static const struct CreditsEntry sCreditsEntry_TadashiTakahashi[] = {11, FALSE, sCreditsText_TadashiTakahashi};
-static const struct CreditsEntry sCreditsEntry_ToshinobuMatsumiya[] = {11, FALSE, sCreditsText_ToshinobuMatsumiya};
-static const struct CreditsEntry sCreditsEntry_AkihitoTomisawa[] = {11, FALSE, sCreditsText_AkihitoTomisawa};
-static const struct CreditsEntry sCreditsEntry_HirokiEnomoto[] = {11, FALSE, sCreditsText_HirokiEnomoto};
-static const struct CreditsEntry sCreditsEntry_KazuyukiTerada[] = {11, FALSE, sCreditsText_KazuyukiTerada};
-static const struct CreditsEntry sCreditsEntry_YuriSakurai[] = {11, FALSE, sCreditsText_YuriSakurai};
-static const struct CreditsEntry sCreditsEntry_HiromiSagawa[] = {11, FALSE, sCreditsText_HiromiSagawa};
-static const struct CreditsEntry sCreditsEntry_KenjiTominaga[] = {11, FALSE, sCreditsText_KenjiTominaga};
-static const struct CreditsEntry sCreditsEntry_YoshioTajiri[] = {11, FALSE, sCreditsText_YoshioTajiri};
-static const struct CreditsEntry sCreditsEntry_TeikoSasaki[] = {11, FALSE, sCreditsText_TeikoSasaki};
-static const struct CreditsEntry sCreditsEntry_SachikoHamano[] = {11, FALSE, sCreditsText_SachikoHamano};
-static const struct CreditsEntry sCreditsEntry_ChieMatsumiya[] = {11, FALSE, sCreditsText_ChieMatsumiya};
-static const struct CreditsEntry sCreditsEntry_AkikoShinozaki[] = {11, FALSE, sCreditsText_AkikoShinozaki};
-static const struct CreditsEntry sCreditsEntry_AstukoFujii[] = {11, FALSE, sCreditsText_AstukoFujii};
-static const struct CreditsEntry sCreditsEntry_NozomuSaito[] = {11, FALSE, sCreditsText_NozomuSaito};
-static const struct CreditsEntry sCreditsEntry_KenkichiToyama[] = {11, FALSE, sCreditsText_KenkichiToyama};
-static const struct CreditsEntry sCreditsEntry_SuguruNakatsui[] = {11, FALSE, sCreditsText_SuguruNakatsui};
-static const struct CreditsEntry sCreditsEntry_YumiFunasaka[] = {11, FALSE, sCreditsText_YumiFunasaka};
-static const struct CreditsEntry sCreditsEntry_NaokoYanase[] = {11, FALSE, sCreditsText_NaokoYanase};
-static const struct CreditsEntry sCreditsEntry_NCLSuperMarioClub[] = {11, FALSE, sCreditsText_NCLSuperMarioClub};
-static const struct CreditsEntry sCreditsEntry_AtsushiTada[] = {11, FALSE, sCreditsText_AtsushiTada};
-static const struct CreditsEntry sCreditsEntry_TakahiroOhnishi[] = {11, FALSE, sCreditsText_TakahiroOhnishi};
-static const struct CreditsEntry sCreditsEntry_NorihideOkamura[] = {11, FALSE, sCreditsText_NorihideOkamura};
-static const struct CreditsEntry sCreditsEntry_HiroNakamura[] = {11, FALSE, sCreditsText_HiroNakamura};
-static const struct CreditsEntry sCreditsEntry_HiroyukiUesugi[] = {11, FALSE, sCreditsText_HiroyukiUesugi};
-static const struct CreditsEntry sCreditsEntry_TerukiMurakawa[] = {11, FALSE, sCreditsText_TerukiMurakawa};
-static const struct CreditsEntry sCreditsEntry_AkiraKinashi[] = {11, FALSE, sCreditsText_AkiraKinashi};
-static const struct CreditsEntry sCreditsEntry_MichikoTakizawa[] = {11, FALSE, sCreditsText_MichikoTakizawa};
-static const struct CreditsEntry sCreditsEntry_MakikoTakada[] = {11, FALSE, sCreditsText_MakikoTakada};
-static const struct CreditsEntry sCreditsEntry_TakanaoKondo[] = {11, FALSE, sCreditsText_TakanaoKondo};
-static const struct CreditsEntry sCreditsEntry_AiMashima[] = {11, FALSE, sCreditsText_AiMashima};
-static const struct CreditsEntry sCreditsEntry_GakujiNomoto[] = {11, FALSE, sCreditsText_GakujiNomoto};
-static const struct CreditsEntry sCreditsEntry_TakehiroIzushi[] = {11, FALSE, sCreditsText_TakehiroIzushi};
-static const struct CreditsEntry sCreditsEntry_HitoshiYamagami[] = {11, FALSE, sCreditsText_HitoshiYamagami};
-static const struct CreditsEntry sCreditsEntry_KyokoWatanabe[] = {11, FALSE, sCreditsText_KyokoWatanabe};
-static const struct CreditsEntry sCreditsEntry_TakaoNakano[] = {11, FALSE, sCreditsText_TakaoNakano};
-static const struct CreditsEntry sCreditsEntry_HiroyukiJinnai[] = {11, FALSE, sCreditsText_HiroyukiJinnai};
-static const struct CreditsEntry sCreditsEntry_HiroakiTsuru[] = {11, FALSE, sCreditsText_HiroakiTsuru};
-static const struct CreditsEntry sCreditsEntry_TsunekazIshihara[] = {11, FALSE, sCreditsText_TsunekazIshihara};
-static const struct CreditsEntry sCreditsEntry_SatoruIwata[] = {11, FALSE, sCreditsText_SatoruIwata};
-static const struct CreditsEntry sCreditsEntry_KazuyaSuyama[] = {11, FALSE, sCreditsText_KazuyaSuyama};
-static const struct CreditsEntry sCreditsEntry_SatoshiMitsuhara[] = {11, FALSE, sCreditsText_SatoshiMitsuhara};
-static const struct CreditsEntry sCreditsEntry_JapanBrailleLibrary[] = { 9, FALSE, sCreditsText_JapanBrailleLibrary};
-static const struct CreditsEntry sCreditsEntry_TomotakaKomura[] = {11, FALSE, sCreditsText_TomotakaKomura};
-static const struct CreditsEntry sCreditsEntry_MikikoOhhashi[] = {11, FALSE, sCreditsText_MikikoOhhashi};
-static const struct CreditsEntry sCreditsEntry_DaisukeHoshino[] = {11, FALSE, sCreditsText_DaisukeHoshino};
-static const struct CreditsEntry sCreditsEntry_KenjiroIto[] = {11, FALSE, sCreditsText_KenjiroIto};
-static const struct CreditsEntry sCreditsEntry_RuiKawaguchi[] = {11, FALSE, sCreditsText_RuiKawaguchi};
-static const struct CreditsEntry sCreditsEntry_ShunsukeKohori[] = {11, FALSE, sCreditsText_ShunsukeKohori};
-static const struct CreditsEntry sCreditsEntry_SachikoNakamichi[] = {11, FALSE, sCreditsText_SachikoNakamichi};
-static const struct CreditsEntry sCreditsEntry_FujikoNomura[] = {11, FALSE, sCreditsText_FujikoNomura};
-static const struct CreditsEntry sCreditsEntry_KazukiYoshihara[] = {11, FALSE, sCreditsText_KazukiYoshihara};
-static const struct CreditsEntry sCreditsEntry_RetsujiNomoto[] = {11, FALSE, sCreditsText_RetsujiNomoto};
-static const struct CreditsEntry sCreditsEntry_AzusaTajima[] = {11, FALSE, sCreditsText_AzusaTajima};
-static const struct CreditsEntry sCreditsEntry_ShusakuEgami[] = {11, FALSE, sCreditsText_ShusakuEgami};
-static const struct CreditsEntry sCreditsEntry_PackageAndManual[] = { 0, TRUE, sCreditsText_PackageAndManual};
-static const struct CreditsEntry sCreditsEntry_EnglishVersion[] = { 0, TRUE, sCreditsText_EnglishVersion};
-static const struct CreditsEntry sCreditsEntry_Translator[] = { 0, TRUE, sCreditsText_Translator};
-static const struct CreditsEntry sCreditsEntry_TextEditor[] = { 0, TRUE, sCreditsText_TextEditor};
-static const struct CreditsEntry sCreditsEntry_NCLCoordinator[] = { 0, TRUE, sCreditsText_NCLCoordinator};
-static const struct CreditsEntry sCreditsEntry_GraphicDesigner[] = { 0, TRUE, sCreditsText_GraphicDesigner};
-static const struct CreditsEntry sCreditsEntry_NOAProductTesting[] = { 0, TRUE, sCreditsText_NOAProductTesting};
-static const struct CreditsEntry sCreditsEntry_HideyukiNakajima[] = { 0, FALSE, sCreditsText_HideyukiNakajima};
-static const struct CreditsEntry sCreditsEntry_HidenoriSaeki[] = { 0, FALSE, sCreditsText_HidenoriSaeki};
-static const struct CreditsEntry sCreditsEntry_YokoWatanabe[] = { 0, FALSE, sCreditsText_YokoWatanabe};
-static const struct CreditsEntry sCreditsEntry_SakaeKimura[] = { 0, FALSE, sCreditsText_SakaeKimura};
-static const struct CreditsEntry sCreditsEntry_ChiakiShinkai[] = { 0, FALSE, sCreditsText_ChiakiShinkai};
-static const struct CreditsEntry sCreditsEntry_SethMcMahill[] = { 0, FALSE, sCreditsText_SethMcMahill};
-static const struct CreditsEntry sCreditsEntry_NobOgasawara[] = { 0, FALSE, sCreditsText_NobOgasawara};
-static const struct CreditsEntry sCreditsEntry_TeresaLillygren[] = { 0, FALSE, sCreditsText_TeresaLillygren};
-static const struct CreditsEntry sCreditsEntry_KimikoNakamichi[] = { 0, FALSE, sCreditsText_KimikoNakamichi};
-static const struct CreditsEntry sCreditsEntry_SouichiYamamoto[] = { 0, FALSE, sCreditsText_SouichiYamamoto};
-static const struct CreditsEntry sCreditsEntry_YuichiroIto[] = { 0, FALSE, sCreditsText_YuichiroIto};
-static const struct CreditsEntry sCreditsEntry_ThomasHertzog[] = { 0, FALSE, sCreditsText_ThomasHertzog};
-static const struct CreditsEntry sCreditsEntry_MikaKurosawa[] = { 0, FALSE, sCreditsText_MikaKurosawa};
-static const struct CreditsEntry sCreditsEntry_NationalFederationBlind[] = { 0, FALSE, sCreditsText_NationalFederationBlind};
-static const struct CreditsEntry sCreditsEntry_PatriciaAMaurer[] = { 0, FALSE, sCreditsText_PatriciaAMaurer};
-static const struct CreditsEntry sCreditsEntry_EuropeanBlindUnion[] = { 0, FALSE, sCreditsText_EuropeanBlindUnion};
-static const struct CreditsEntry sCreditsEntry_AustralianBrailleAuthority[] = { 0, FALSE, sCreditsText_AustralianBrailleAuthority};
-static const struct CreditsEntry sCreditsEntry_RoyalNewZealandFederationBlind[] = { 0, FALSE, sCreditsText_RoyalNewZealandFederationBlind};
-static const struct CreditsEntry sCreditsEntry_MotoyasuTojima[] = { 0, FALSE, sCreditsText_MotoyasuTojima};
-static const struct CreditsEntry sCreditsEntry_NicolaPrattBarlow[] = { 0, FALSE, sCreditsText_NicolaPrattBarlow};
-static const struct CreditsEntry sCreditsEntry_ShellieDow[] = { 0, FALSE, sCreditsText_ShellieDow};
-static const struct CreditsEntry sCreditsEntry_ErikJohnson[] = { 0, FALSE, sCreditsText_ErikJohnson};
+static const struct CreditsEntry sCreditsEntry_EmptyString = { 0, FALSE, sCreditsText_EmptyString};
+static const struct CreditsEntry sCreditsEntry_PkmnEmeraldVersion = { 7, TRUE, sCreditsText_PkmnEmeraldVersion};
+static const struct CreditsEntry sCreditsEntry_Credits = {11, TRUE, sCreditsText_Credits};
+static const struct CreditsEntry sCreditsEntry_ExecutiveDirector = { 8, TRUE, sCreditsText_ExecutiveDirector};
+static const struct CreditsEntry sCreditsEntry_Director = {12, TRUE, sCreditsText_Director};
+static const struct CreditsEntry sCreditsEntry_ArtDirector = {10, TRUE, sCreditsText_ArtDirector};
+static const struct CreditsEntry sCreditsEntry_BattleDirector = {10, TRUE, sCreditsText_BattleDirector};
+static const struct CreditsEntry sCreditsEntry_MainProgrammer = {10, TRUE, sCreditsText_MainProgrammer};
+static const struct CreditsEntry sCreditsEntry_BattleSystemPgrms = { 8, TRUE, sCreditsText_BattleSystemPgrms};
+static const struct CreditsEntry sCreditsEntry_FieldSystemPgrms = { 7, TRUE, sCreditsText_FieldSystemPgrms};
+static const struct CreditsEntry sCreditsEntry_Programmers = {12, TRUE, sCreditsText_Programmers};
+static const struct CreditsEntry sCreditsEntry_MainGraphicDesigner = { 7, TRUE, sCreditsText_MainGraphicDesigner};
+static const struct CreditsEntry sCreditsEntry_GraphicDesigners = { 9, TRUE, sCreditsText_GraphicDesigners};
+static const struct CreditsEntry sCreditsEntry_PkmnDesigners = {10, TRUE, sCreditsText_PkmnDesigners};
+static const struct CreditsEntry sCreditsEntry_MusicComposition = {13, TRUE, sCreditsText_MusicComposition};
+static const struct CreditsEntry sCreditsEntry_SoundEffectsAndPkmnVoices = { 4, TRUE, sCreditsText_SoundEffectsAndPkmnVoices};
+static const struct CreditsEntry sCreditsEntry_GameDesigners = {11, TRUE, sCreditsText_GameDesigners};
+static const struct CreditsEntry sCreditsEntry_ScenarioPlot = {11, TRUE, sCreditsText_ScenarioPlot};
+static const struct CreditsEntry sCreditsEntry_Scenario = {13, TRUE, sCreditsText_Scenario};
+static const struct CreditsEntry sCreditsEntry_ScriptDesigners = {10, TRUE, sCreditsText_ScriptDesigners};
+static const struct CreditsEntry sCreditsEntry_MapDesigners = {11, TRUE, sCreditsText_MapDesigners};
+static const struct CreditsEntry sCreditsEntry_MapDataDesigners = { 9, TRUE, sCreditsText_MapDataDesigners};
+static const struct CreditsEntry sCreditsEntry_ParametricDesigners = { 9, TRUE, sCreditsText_ParametricDesigners};
+static const struct CreditsEntry sCreditsEntry_PokedexText = {11, TRUE, sCreditsText_PokedexText};
+static const struct CreditsEntry sCreditsEntry_EnvAndToolPgrms = { 6, TRUE, sCreditsText_EnvAndToolPgrms};
+static const struct CreditsEntry sCreditsEntry_NCLProductTesting = {11, TRUE, sCreditsText_NCLProductTesting};
+static const struct CreditsEntry sCreditsEntry_SpecialThanks = {10, TRUE, sCreditsText_SpecialThanks};
+static const struct CreditsEntry sCreditsEntry_Coordinators = {11, TRUE, sCreditsText_Coordinators};
+static const struct CreditsEntry sCreditsEntry_Producers = {11, TRUE, sCreditsText_Producers};
+static const struct CreditsEntry sCreditsEntry_ExecProducers = { 7, TRUE, sCreditsText_ExecProducers};
+static const struct CreditsEntry sCreditsEntry_InfoSupervisors = {10, TRUE, sCreditsText_InfoSupervisors};
+static const struct CreditsEntry sCreditsEntry_TaskManagers = { 8, TRUE, sCreditsText_TaskManagers};
+static const struct CreditsEntry sCreditsEntry_BrailleCodeCheck = {10, TRUE, sCreditsText_BrailleCodeCheck};
+static const struct CreditsEntry sCreditsEntry_WorldDirector = {10, TRUE, sCreditsText_WorldDirector};
+static const struct CreditsEntry sCreditsEntry_BattleFrontierData = { 8, TRUE, sCreditsText_BattleFrontierData};
+static const struct CreditsEntry sCreditsEntry_SupportProgrammers = {10, TRUE, sCreditsText_SupportProgrammers};
+static const struct CreditsEntry sCreditsEntry_Artwork = {12, TRUE, sCreditsText_Artwork};
+static const struct CreditsEntry sCreditsEntry_LeadProgrammer = {10, TRUE, sCreditsText_LeadProgrammer};
+static const struct CreditsEntry sCreditsEntry_LeadGraphicArtist = { 9, TRUE, sCreditsText_LeadGraphicArtist};
+static const struct CreditsEntry sCreditsEntry_SatoshiTajiri = {11, FALSE, sCreditsText_SatoshiTajiri};
+static const struct CreditsEntry sCreditsEntry_JunichiMasuda = {11, FALSE, sCreditsText_JunichiMasuda};
+static const struct CreditsEntry sCreditsEntry_KenSugimori = {11, FALSE, sCreditsText_KenSugimori};
+static const struct CreditsEntry sCreditsEntry_ShigekiMorimoto = {11, FALSE, sCreditsText_ShigekiMorimoto};
+static const struct CreditsEntry sCreditsEntry_TetsuyaWatanabe = {11, FALSE, sCreditsText_TetsuyaWatanabe};
+static const struct CreditsEntry sCreditsEntry_HisashiSogabe = {11, FALSE, sCreditsText_HisashiSogabe};
+static const struct CreditsEntry sCreditsEntry_SosukeTamada = {11, FALSE, sCreditsText_SosukeTamada};
+static const struct CreditsEntry sCreditsEntry_AkitoMori = {11, FALSE, sCreditsText_AkitoMori};
+static const struct CreditsEntry sCreditsEntry_KeitaKagaya = {11, FALSE, sCreditsText_KeitaKagaya};
+static const struct CreditsEntry sCreditsEntry_YoshinoriMatsuda = {11, FALSE, sCreditsText_YoshinoriMatsuda};
+static const struct CreditsEntry sCreditsEntry_HiroyukiNakamura = {11, FALSE, sCreditsText_HiroyukiNakamura};
+static const struct CreditsEntry sCreditsEntry_MasaoTaya = {11, FALSE, sCreditsText_MasaoTaya};
+static const struct CreditsEntry sCreditsEntry_SatoshiNohara = {11, FALSE, sCreditsText_SatoshiNohara};
+static const struct CreditsEntry sCreditsEntry_TomomichiOhta = {11, FALSE, sCreditsText_TomomichiOhta};
+static const struct CreditsEntry sCreditsEntry_MiyukiIwasawa = {11, FALSE, sCreditsText_MiyukiIwasawa};
+static const struct CreditsEntry sCreditsEntry_TakenoriOhta = {11, FALSE, sCreditsText_TakenoriOhta};
+static const struct CreditsEntry sCreditsEntry_HironobuYoshida = {11, FALSE, sCreditsText_HironobuYoshida};
+static const struct CreditsEntry sCreditsEntry_MotofumiFujiwara = {11, FALSE, sCreditsText_MotofumiFujiwara};
+static const struct CreditsEntry sCreditsEntry_SatoshiOhta = {11, FALSE, sCreditsText_SatoshiOhta};
+static const struct CreditsEntry sCreditsEntry_AsukaIwashita = {11, FALSE, sCreditsText_AsukaIwashita};
+static const struct CreditsEntry sCreditsEntry_AimiTomita = {11, FALSE, sCreditsText_AimiTomita};
+static const struct CreditsEntry sCreditsEntry_TakaoUnno = {11, FALSE, sCreditsText_TakaoUnno};
+static const struct CreditsEntry sCreditsEntry_KanakoEo = {11, FALSE, sCreditsText_KanakoEo};
+static const struct CreditsEntry sCreditsEntry_JunOkutani = {11, FALSE, sCreditsText_JunOkutani};
+static const struct CreditsEntry sCreditsEntry_AtsukoNishida = {11, FALSE, sCreditsText_AtsukoNishida};
+static const struct CreditsEntry sCreditsEntry_MuneoSaito = {11, FALSE, sCreditsText_MuneoSaito};
+static const struct CreditsEntry sCreditsEntry_RenaYoshikawa = {11, FALSE, sCreditsText_RenaYoshikawa};
+static const struct CreditsEntry sCreditsEntry_GoIchinose = {11, FALSE, sCreditsText_GoIchinose};
+static const struct CreditsEntry sCreditsEntry_MorikazuAoki = {11, FALSE, sCreditsText_MorikazuAoki};
+static const struct CreditsEntry sCreditsEntry_KojiNishino = {11, FALSE, sCreditsText_KojiNishino};
+static const struct CreditsEntry sCreditsEntry_KenjiMatsushima = {11, FALSE, sCreditsText_KenjiMatsushima};
+static const struct CreditsEntry sCreditsEntry_TetsujiOhta = {11, FALSE, sCreditsText_TetsujiOhta};
+static const struct CreditsEntry sCreditsEntry_HitomiSato = {11, FALSE, sCreditsText_HitomiSato};
+static const struct CreditsEntry sCreditsEntry_TakeshiKawachimaru = {11, FALSE, sCreditsText_TakeshiKawachimaru};
+static const struct CreditsEntry sCreditsEntry_TeruyukiShimoyamada = {11, FALSE, sCreditsText_TeruyukiShimoyamada};
+static const struct CreditsEntry sCreditsEntry_ShigeruOhmori = {11, FALSE, sCreditsText_ShigeruOhmori};
+static const struct CreditsEntry sCreditsEntry_TadashiTakahashi = {11, FALSE, sCreditsText_TadashiTakahashi};
+static const struct CreditsEntry sCreditsEntry_ToshinobuMatsumiya = {11, FALSE, sCreditsText_ToshinobuMatsumiya};
+static const struct CreditsEntry sCreditsEntry_AkihitoTomisawa = {11, FALSE, sCreditsText_AkihitoTomisawa};
+static const struct CreditsEntry sCreditsEntry_HirokiEnomoto = {11, FALSE, sCreditsText_HirokiEnomoto};
+static const struct CreditsEntry sCreditsEntry_KazuyukiTerada = {11, FALSE, sCreditsText_KazuyukiTerada};
+static const struct CreditsEntry sCreditsEntry_YuriSakurai = {11, FALSE, sCreditsText_YuriSakurai};
+static const struct CreditsEntry sCreditsEntry_HiromiSagawa = {11, FALSE, sCreditsText_HiromiSagawa};
+static const struct CreditsEntry sCreditsEntry_KenjiTominaga = {11, FALSE, sCreditsText_KenjiTominaga};
+static const struct CreditsEntry sCreditsEntry_YoshioTajiri = {11, FALSE, sCreditsText_YoshioTajiri};
+static const struct CreditsEntry sCreditsEntry_TeikoSasaki = {11, FALSE, sCreditsText_TeikoSasaki};
+static const struct CreditsEntry sCreditsEntry_SachikoHamano = {11, FALSE, sCreditsText_SachikoHamano};
+static const struct CreditsEntry sCreditsEntry_ChieMatsumiya = {11, FALSE, sCreditsText_ChieMatsumiya};
+static const struct CreditsEntry sCreditsEntry_AkikoShinozaki = {11, FALSE, sCreditsText_AkikoShinozaki};
+static const struct CreditsEntry sCreditsEntry_AstukoFujii = {11, FALSE, sCreditsText_AstukoFujii};
+static const struct CreditsEntry sCreditsEntry_NozomuSaito = {11, FALSE, sCreditsText_NozomuSaito};
+static const struct CreditsEntry sCreditsEntry_KenkichiToyama = {11, FALSE, sCreditsText_KenkichiToyama};
+static const struct CreditsEntry sCreditsEntry_SuguruNakatsui = {11, FALSE, sCreditsText_SuguruNakatsui};
+static const struct CreditsEntry sCreditsEntry_YumiFunasaka = {11, FALSE, sCreditsText_YumiFunasaka};
+static const struct CreditsEntry sCreditsEntry_NaokoYanase = {11, FALSE, sCreditsText_NaokoYanase};
+static const struct CreditsEntry sCreditsEntry_NCLSuperMarioClub = {11, FALSE, sCreditsText_NCLSuperMarioClub};
+static const struct CreditsEntry sCreditsEntry_AtsushiTada = {11, FALSE, sCreditsText_AtsushiTada};
+static const struct CreditsEntry sCreditsEntry_TakahiroOhnishi = {11, FALSE, sCreditsText_TakahiroOhnishi};
+static const struct CreditsEntry sCreditsEntry_NorihideOkamura = {11, FALSE, sCreditsText_NorihideOkamura};
+static const struct CreditsEntry sCreditsEntry_HiroNakamura = {11, FALSE, sCreditsText_HiroNakamura};
+static const struct CreditsEntry sCreditsEntry_HiroyukiUesugi = {11, FALSE, sCreditsText_HiroyukiUesugi};
+static const struct CreditsEntry sCreditsEntry_TerukiMurakawa = {11, FALSE, sCreditsText_TerukiMurakawa};
+static const struct CreditsEntry sCreditsEntry_AkiraKinashi = {11, FALSE, sCreditsText_AkiraKinashi};
+static const struct CreditsEntry sCreditsEntry_MichikoTakizawa = {11, FALSE, sCreditsText_MichikoTakizawa};
+static const struct CreditsEntry sCreditsEntry_MakikoTakada = {11, FALSE, sCreditsText_MakikoTakada};
+static const struct CreditsEntry sCreditsEntry_TakanaoKondo = {11, FALSE, sCreditsText_TakanaoKondo};
+static const struct CreditsEntry sCreditsEntry_AiMashima = {11, FALSE, sCreditsText_AiMashima};
+static const struct CreditsEntry sCreditsEntry_GakujiNomoto = {11, FALSE, sCreditsText_GakujiNomoto};
+static const struct CreditsEntry sCreditsEntry_TakehiroIzushi = {11, FALSE, sCreditsText_TakehiroIzushi};
+static const struct CreditsEntry sCreditsEntry_HitoshiYamagami = {11, FALSE, sCreditsText_HitoshiYamagami};
+static const struct CreditsEntry sCreditsEntry_KyokoWatanabe = {11, FALSE, sCreditsText_KyokoWatanabe};
+static const struct CreditsEntry sCreditsEntry_TakaoNakano = {11, FALSE, sCreditsText_TakaoNakano};
+static const struct CreditsEntry sCreditsEntry_HiroyukiJinnai = {11, FALSE, sCreditsText_HiroyukiJinnai};
+static const struct CreditsEntry sCreditsEntry_HiroakiTsuru = {11, FALSE, sCreditsText_HiroakiTsuru};
+static const struct CreditsEntry sCreditsEntry_TsunekazIshihara = {11, FALSE, sCreditsText_TsunekazIshihara};
+static const struct CreditsEntry sCreditsEntry_SatoruIwata = {11, FALSE, sCreditsText_SatoruIwata};
+static const struct CreditsEntry sCreditsEntry_KazuyaSuyama = {11, FALSE, sCreditsText_KazuyaSuyama};
+static const struct CreditsEntry sCreditsEntry_SatoshiMitsuhara = {11, FALSE, sCreditsText_SatoshiMitsuhara};
+static const struct CreditsEntry sCreditsEntry_JapanBrailleLibrary = { 9, FALSE, sCreditsText_JapanBrailleLibrary};
+static const struct CreditsEntry sCreditsEntry_TomotakaKomura = {11, FALSE, sCreditsText_TomotakaKomura};
+static const struct CreditsEntry sCreditsEntry_MikikoOhhashi = {11, FALSE, sCreditsText_MikikoOhhashi};
+static const struct CreditsEntry sCreditsEntry_DaisukeHoshino = {11, FALSE, sCreditsText_DaisukeHoshino};
+static const struct CreditsEntry sCreditsEntry_KenjiroIto = {11, FALSE, sCreditsText_KenjiroIto};
+static const struct CreditsEntry sCreditsEntry_RuiKawaguchi = {11, FALSE, sCreditsText_RuiKawaguchi};
+static const struct CreditsEntry sCreditsEntry_ShunsukeKohori = {11, FALSE, sCreditsText_ShunsukeKohori};
+static const struct CreditsEntry sCreditsEntry_SachikoNakamichi = {11, FALSE, sCreditsText_SachikoNakamichi};
+static const struct CreditsEntry sCreditsEntry_FujikoNomura = {11, FALSE, sCreditsText_FujikoNomura};
+static const struct CreditsEntry sCreditsEntry_KazukiYoshihara = {11, FALSE, sCreditsText_KazukiYoshihara};
+static const struct CreditsEntry sCreditsEntry_RetsujiNomoto = {11, FALSE, sCreditsText_RetsujiNomoto};
+static const struct CreditsEntry sCreditsEntry_AzusaTajima = {11, FALSE, sCreditsText_AzusaTajima};
+static const struct CreditsEntry sCreditsEntry_ShusakuEgami = {11, FALSE, sCreditsText_ShusakuEgami};
+static const struct CreditsEntry sCreditsEntry_PackageAndManual = { 0, TRUE, sCreditsText_PackageAndManual};
+static const struct CreditsEntry sCreditsEntry_EnglishVersion = { 0, TRUE, sCreditsText_EnglishVersion};
+static const struct CreditsEntry sCreditsEntry_Translator = { 0, TRUE, sCreditsText_Translator};
+static const struct CreditsEntry sCreditsEntry_TextEditor = { 0, TRUE, sCreditsText_TextEditor};
+static const struct CreditsEntry sCreditsEntry_NCLCoordinator = { 0, TRUE, sCreditsText_NCLCoordinator};
+static const struct CreditsEntry sCreditsEntry_GraphicDesigner = { 0, TRUE, sCreditsText_GraphicDesigner};
+static const struct CreditsEntry sCreditsEntry_NOAProductTesting = { 0, TRUE, sCreditsText_NOAProductTesting};
+static const struct CreditsEntry sCreditsEntry_HideyukiNakajima = { 0, FALSE, sCreditsText_HideyukiNakajima};
+static const struct CreditsEntry sCreditsEntry_HidenoriSaeki = { 0, FALSE, sCreditsText_HidenoriSaeki};
+static const struct CreditsEntry sCreditsEntry_YokoWatanabe = { 0, FALSE, sCreditsText_YokoWatanabe};
+static const struct CreditsEntry sCreditsEntry_SakaeKimura = { 0, FALSE, sCreditsText_SakaeKimura};
+static const struct CreditsEntry sCreditsEntry_ChiakiShinkai = { 0, FALSE, sCreditsText_ChiakiShinkai};
+static const struct CreditsEntry sCreditsEntry_SethMcMahill = { 0, FALSE, sCreditsText_SethMcMahill};
+static const struct CreditsEntry sCreditsEntry_NobOgasawara = { 0, FALSE, sCreditsText_NobOgasawara};
+static const struct CreditsEntry sCreditsEntry_TeresaLillygren = { 0, FALSE, sCreditsText_TeresaLillygren};
+static const struct CreditsEntry sCreditsEntry_KimikoNakamichi = { 0, FALSE, sCreditsText_KimikoNakamichi};
+static const struct CreditsEntry sCreditsEntry_SouichiYamamoto = { 0, FALSE, sCreditsText_SouichiYamamoto};
+static const struct CreditsEntry sCreditsEntry_YuichiroIto = { 0, FALSE, sCreditsText_YuichiroIto};
+static const struct CreditsEntry sCreditsEntry_ThomasHertzog = { 0, FALSE, sCreditsText_ThomasHertzog};
+static const struct CreditsEntry sCreditsEntry_MikaKurosawa = { 0, FALSE, sCreditsText_MikaKurosawa};
+static const struct CreditsEntry sCreditsEntry_NationalFederationBlind = { 0, FALSE, sCreditsText_NationalFederationBlind};
+static const struct CreditsEntry sCreditsEntry_PatriciaAMaurer = { 0, FALSE, sCreditsText_PatriciaAMaurer};
+static const struct CreditsEntry sCreditsEntry_EuropeanBlindUnion = { 0, FALSE, sCreditsText_EuropeanBlindUnion};
+static const struct CreditsEntry sCreditsEntry_AustralianBrailleAuthority = { 0, FALSE, sCreditsText_AustralianBrailleAuthority};
+static const struct CreditsEntry sCreditsEntry_RoyalNewZealandFederationBlind = { 0, FALSE, sCreditsText_RoyalNewZealandFederationBlind};
+static const struct CreditsEntry sCreditsEntry_MotoyasuTojima = { 0, FALSE, sCreditsText_MotoyasuTojima};
+static const struct CreditsEntry sCreditsEntry_NicolaPrattBarlow = { 0, FALSE, sCreditsText_NicolaPrattBarlow};
+static const struct CreditsEntry sCreditsEntry_ShellieDow = { 0, FALSE, sCreditsText_ShellieDow};
+static const struct CreditsEntry sCreditsEntry_ErikJohnson = { 0, FALSE, sCreditsText_ErikJohnson};
-#define _ sCreditsEntry_EmptyString
+#define _ &sCreditsEntry_EmptyString
static const struct CreditsEntry *const sCreditsEntryPointerTable[PAGE_COUNT][ENTRIES_PER_PAGE] =
{
[PAGE_TITLE] = {
_,
- sCreditsEntry_PkmnEmeraldVersion,
- sCreditsEntry_Credits,
+ &sCreditsEntry_PkmnEmeraldVersion,
+ &sCreditsEntry_Credits,
_,
_
},
[PAGE_DIRECTOR] = {
_,
- sCreditsEntry_Director,
- sCreditsEntry_ShigekiMorimoto,
+ &sCreditsEntry_Director,
+ &sCreditsEntry_ShigekiMorimoto,
_,
_,
},
[PAGE_ART_DIRECTOR] = {
_,
- sCreditsEntry_ArtDirector,
- sCreditsEntry_KenSugimori,
+ &sCreditsEntry_ArtDirector,
+ &sCreditsEntry_KenSugimori,
_,
_,
},
[PAGE_WORLD_DIRECTOR] = {
_,
- sCreditsEntry_WorldDirector,
- sCreditsEntry_JunichiMasuda,
+ &sCreditsEntry_WorldDirector,
+ &sCreditsEntry_JunichiMasuda,
_,
_,
},
[PAGE_LEAD_PROGRAMMER] = {
- sCreditsEntry_LeadProgrammer,
- sCreditsEntry_HisashiSogabe,
- sCreditsEntry_LeadGraphicArtist,
- sCreditsEntry_MotofumiFujiwara,
+ &sCreditsEntry_LeadProgrammer,
+ &sCreditsEntry_HisashiSogabe,
+ &sCreditsEntry_LeadGraphicArtist,
+ &sCreditsEntry_MotofumiFujiwara,
_,
},
[PAGE_PROGRAMMERS_1] = {
- sCreditsEntry_Programmers,
- sCreditsEntry_HisashiSogabe,
- sCreditsEntry_TomomichiOhta,
- sCreditsEntry_NozomuSaito,
- sCreditsEntry_EmptyString,
+ &sCreditsEntry_Programmers,
+ &sCreditsEntry_HisashiSogabe,
+ &sCreditsEntry_TomomichiOhta,
+ &sCreditsEntry_NozomuSaito,
+ _,
},
[PAGE_PROGRAMMERS_2] = {
- sCreditsEntry_Programmers,
- sCreditsEntry_AkitoMori,
- sCreditsEntry_HiroyukiNakamura,
- sCreditsEntry_MasaoTaya,
+ &sCreditsEntry_Programmers,
+ &sCreditsEntry_AkitoMori,
+ &sCreditsEntry_HiroyukiNakamura,
+ &sCreditsEntry_MasaoTaya,
_,
},
[PAGE_PROGRAMMERS_3] = {
- sCreditsEntry_Programmers,
- sCreditsEntry_SatoshiNohara,
- sCreditsEntry_MiyukiIwasawa,
- sCreditsEntry_YoshinoriMatsuda,
- sCreditsEntry_KeitaKagaya,
+ &sCreditsEntry_Programmers,
+ &sCreditsEntry_SatoshiNohara,
+ &sCreditsEntry_MiyukiIwasawa,
+ &sCreditsEntry_YoshinoriMatsuda,
+ &sCreditsEntry_KeitaKagaya,
},
[PAGE_PROGRAMMERS_4] = {
- sCreditsEntry_Programmers,
- sCreditsEntry_TetsuyaWatanabe,
- sCreditsEntry_SosukeTamada,
- sCreditsEntry_TakenoriOhta,
+ &sCreditsEntry_Programmers,
+ &sCreditsEntry_TetsuyaWatanabe,
+ &sCreditsEntry_SosukeTamada,
+ &sCreditsEntry_TakenoriOhta,
_,
},
[PAGE_GRAPHIC_DESIGNERS_1] = {
_,
- sCreditsEntry_GraphicDesigners,
- sCreditsEntry_MotofumiFujiwara,
- sCreditsEntry_SatoshiOhta,
+ &sCreditsEntry_GraphicDesigners,
+ &sCreditsEntry_MotofumiFujiwara,
+ &sCreditsEntry_SatoshiOhta,
_,
},
[PAGE_GRAPHIC_DESIGNERS_2] = {
- sCreditsEntry_GraphicDesigners,
- sCreditsEntry_KenkichiToyama,
- sCreditsEntry_AsukaIwashita,
- sCreditsEntry_TakaoUnno,
+ &sCreditsEntry_GraphicDesigners,
+ &sCreditsEntry_KenkichiToyama,
+ &sCreditsEntry_AsukaIwashita,
+ &sCreditsEntry_TakaoUnno,
_,
},
[PAGE_GRAPHIC_DESIGNERS_3] = {
- sCreditsEntry_GraphicDesigners,
- sCreditsEntry_KenSugimori,
- sCreditsEntry_HironobuYoshida,
- sCreditsEntry_AimiTomita,
- sCreditsEntry_KanakoEo,
+ &sCreditsEntry_GraphicDesigners,
+ &sCreditsEntry_KenSugimori,
+ &sCreditsEntry_HironobuYoshida,
+ &sCreditsEntry_AimiTomita,
+ &sCreditsEntry_KanakoEo,
},
[PAGE_MUSIC_COMPOSITION] = {
- sCreditsEntry_MusicComposition,
- sCreditsEntry_GoIchinose,
- sCreditsEntry_JunichiMasuda,
- sCreditsEntry_MorikazuAoki,
- sCreditsEntry_HitomiSato,
+ &sCreditsEntry_MusicComposition,
+ &sCreditsEntry_GoIchinose,
+ &sCreditsEntry_JunichiMasuda,
+ &sCreditsEntry_MorikazuAoki,
+ &sCreditsEntry_HitomiSato,
},
[PAGE_SOUND_EFFECTS] = {
_,
- sCreditsEntry_SoundEffectsAndPkmnVoices,
- sCreditsEntry_GoIchinose,
- sCreditsEntry_MorikazuAoki,
+ &sCreditsEntry_SoundEffectsAndPkmnVoices,
+ &sCreditsEntry_GoIchinose,
+ &sCreditsEntry_MorikazuAoki,
_,
},
[PAGE_GAME_DESIGNERS_1] = {
- sCreditsEntry_GameDesigners,
- sCreditsEntry_ShigekiMorimoto,
- sCreditsEntry_TeruyukiShimoyamada,
- sCreditsEntry_TakeshiKawachimaru,
- sCreditsEntry_AkihitoTomisawa,
+ &sCreditsEntry_GameDesigners,
+ &sCreditsEntry_ShigekiMorimoto,
+ &sCreditsEntry_TeruyukiShimoyamada,
+ &sCreditsEntry_TakeshiKawachimaru,
+ &sCreditsEntry_AkihitoTomisawa,
},
[PAGE_GAME_DESIGNERS_2] = {
- sCreditsEntry_GameDesigners,
- sCreditsEntry_SuguruNakatsui,
- sCreditsEntry_TetsujiOhta,
- sCreditsEntry_HitomiSato,
- sCreditsEntry_KenjiMatsushima,
+ &sCreditsEntry_GameDesigners,
+ &sCreditsEntry_SuguruNakatsui,
+ &sCreditsEntry_TetsujiOhta,
+ &sCreditsEntry_HitomiSato,
+ &sCreditsEntry_KenjiMatsushima,
},
[PAGE_GAME_DESIGNERS_3] = {
- sCreditsEntry_GameDesigners,
- sCreditsEntry_JunichiMasuda,
- sCreditsEntry_KojiNishino,
- sCreditsEntry_ShigeruOhmori,
- sCreditsEntry_TadashiTakahashi,
+ &sCreditsEntry_GameDesigners,
+ &sCreditsEntry_JunichiMasuda,
+ &sCreditsEntry_KojiNishino,
+ &sCreditsEntry_ShigeruOhmori,
+ &sCreditsEntry_TadashiTakahashi,
},
[PAGE_SCENARIO_PLOT] = {
- sCreditsEntry_ScenarioPlot,
- sCreditsEntry_AkihitoTomisawa,
- sCreditsEntry_JunichiMasuda,
- sCreditsEntry_KojiNishino,
+ &sCreditsEntry_ScenarioPlot,
+ &sCreditsEntry_AkihitoTomisawa,
+ &sCreditsEntry_JunichiMasuda,
+ &sCreditsEntry_KojiNishino,
_,
},
[PAGE_SCENARIO] = {
- sCreditsEntry_Scenario,
- sCreditsEntry_AkihitoTomisawa,
- sCreditsEntry_HitomiSato,
- sCreditsEntry_ToshinobuMatsumiya,
+ &sCreditsEntry_Scenario,
+ &sCreditsEntry_AkihitoTomisawa,
+ &sCreditsEntry_HitomiSato,
+ &sCreditsEntry_ToshinobuMatsumiya,
_,
},
[PAGE_SCRIPT_DESIGNERS] = {
- sCreditsEntry_ScriptDesigners,
- sCreditsEntry_TomomichiOhta,
- sCreditsEntry_SatoshiNohara,
+ &sCreditsEntry_ScriptDesigners,
+ &sCreditsEntry_TomomichiOhta,
+ &sCreditsEntry_SatoshiNohara,
_,
_,
},
[PAGE_MAP_DESIGNERS] = {
- sCreditsEntry_MapDesigners,
- sCreditsEntry_SuguruNakatsui,
- sCreditsEntry_TeruyukiShimoyamada,
- sCreditsEntry_ShigeruOhmori,
- sCreditsEntry_TetsujiOhta,
+ &sCreditsEntry_MapDesigners,
+ &sCreditsEntry_SuguruNakatsui,
+ &sCreditsEntry_TeruyukiShimoyamada,
+ &sCreditsEntry_ShigeruOhmori,
+ &sCreditsEntry_TetsujiOhta,
},
[PAGE_BATTLE_FRONTIER_DATA] = {
_,
- sCreditsEntry_BattleFrontierData,
- sCreditsEntry_TetsujiOhta,
+ &sCreditsEntry_BattleFrontierData,
+ &sCreditsEntry_TetsujiOhta,
_,
_,
},
[PAGE_PARAMETRIC_DESIGNERS] = {
- sCreditsEntry_ParametricDesigners,
- sCreditsEntry_TeruyukiShimoyamada,
- sCreditsEntry_ShigekiMorimoto,
- sCreditsEntry_TetsujiOhta,
- sCreditsEntry_KojiNishino,
+ &sCreditsEntry_ParametricDesigners,
+ &sCreditsEntry_TeruyukiShimoyamada,
+ &sCreditsEntry_ShigekiMorimoto,
+ &sCreditsEntry_TetsujiOhta,
+ &sCreditsEntry_KojiNishino,
},
[PAGE_POKEDEX_TEXT] = {
_,
- sCreditsEntry_PokedexText,
- sCreditsEntry_KenjiMatsushima,
+ &sCreditsEntry_PokedexText,
+ &sCreditsEntry_KenjiMatsushima,
_,
_,
},
[PAGE_ENVIRONMENT_AND_TOOL_PROGRAMS_1] = {
- sCreditsEntry_EnvAndToolPgrms,
- sCreditsEntry_HisashiSogabe,
- sCreditsEntry_SosukeTamada,
- sCreditsEntry_HiroyukiNakamura,
- sCreditsEntry_AkitoMori,
+ &sCreditsEntry_EnvAndToolPgrms,
+ &sCreditsEntry_HisashiSogabe,
+ &sCreditsEntry_SosukeTamada,
+ &sCreditsEntry_HiroyukiNakamura,
+ &sCreditsEntry_AkitoMori,
},
[PAGE_PKMN_DESIGNERS_1] = {
- sCreditsEntry_PkmnDesigners,
- sCreditsEntry_KenSugimori,
- sCreditsEntry_MotofumiFujiwara,
- sCreditsEntry_ShigekiMorimoto,
+ &sCreditsEntry_PkmnDesigners,
+ &sCreditsEntry_KenSugimori,
+ &sCreditsEntry_MotofumiFujiwara,
+ &sCreditsEntry_ShigekiMorimoto,
_,
},
[PAGE_PKMN_DESIGNERS_2] = {
- sCreditsEntry_PkmnDesigners,
- sCreditsEntry_HironobuYoshida,
- sCreditsEntry_SatoshiOhta,
- sCreditsEntry_AsukaIwashita,
+ &sCreditsEntry_PkmnDesigners,
+ &sCreditsEntry_HironobuYoshida,
+ &sCreditsEntry_SatoshiOhta,
+ &sCreditsEntry_AsukaIwashita,
_,
},
[PAGE_PKMN_DESIGNERS_3] = {
- sCreditsEntry_PkmnDesigners,
- sCreditsEntry_TakaoUnno,
- sCreditsEntry_KanakoEo,
- sCreditsEntry_AimiTomita,
+ &sCreditsEntry_PkmnDesigners,
+ &sCreditsEntry_TakaoUnno,
+ &sCreditsEntry_KanakoEo,
+ &sCreditsEntry_AimiTomita,
_,
},
[PAGE_PKMN_DESIGNERS_4] = {
- sCreditsEntry_PkmnDesigners,
- sCreditsEntry_AtsukoNishida,
- sCreditsEntry_MuneoSaito,
- sCreditsEntry_RenaYoshikawa,
- sCreditsEntry_JunOkutani,
+ &sCreditsEntry_PkmnDesigners,
+ &sCreditsEntry_AtsukoNishida,
+ &sCreditsEntry_MuneoSaito,
+ &sCreditsEntry_RenaYoshikawa,
+ &sCreditsEntry_JunOkutani,
},
[PAGE_SUPPORT_PROGRAMMERS] = {
_,
- sCreditsEntry_SupportProgrammers,
- sCreditsEntry_SatoshiMitsuhara,
- sCreditsEntry_DaisukeHoshino,
+ &sCreditsEntry_SupportProgrammers,
+ &sCreditsEntry_SatoshiMitsuhara,
+ &sCreditsEntry_DaisukeHoshino,
_,
},
[PAGE_NCL_PRODUCT_TESTING] = {
_,
- sCreditsEntry_NCLProductTesting,
- sCreditsEntry_NCLSuperMarioClub,
+ &sCreditsEntry_NCLProductTesting,
+ &sCreditsEntry_NCLSuperMarioClub,
_,
_,
},
[PAGE_PACKAGE_AND_MANUAL] = {
_,
- sCreditsEntry_PackageAndManual,
- sCreditsEntry_KenSugimori,
+ &sCreditsEntry_PackageAndManual,
+ &sCreditsEntry_KenSugimori,
_,
_,
},
[PAGE_SPECIAL_THANKS_1] = {
_,
- sCreditsEntry_SpecialThanks,
- sCreditsEntry_KenjiTominaga,
- sCreditsEntry_HirokiEnomoto,
+ &sCreditsEntry_SpecialThanks,
+ &sCreditsEntry_KenjiTominaga,
+ &sCreditsEntry_HirokiEnomoto,
_,
},
[PAGE_SPECIAL_THANKS_2] = {
- sCreditsEntry_SpecialThanks,
- sCreditsEntry_KazuyaSuyama,
- sCreditsEntry_KenjiroIto,
- sCreditsEntry_MichikoTakizawa,
- sCreditsEntry_MakikoTakada,
+ &sCreditsEntry_SpecialThanks,
+ &sCreditsEntry_KazuyaSuyama,
+ &sCreditsEntry_KenjiroIto,
+ &sCreditsEntry_MichikoTakizawa,
+ &sCreditsEntry_MakikoTakada,
},
[PAGE_SPECIAL_THANKS_3] = {
- sCreditsEntry_SpecialThanks,
- sCreditsEntry_MikikoOhhashi,
- sCreditsEntry_TakanaoKondo,
- sCreditsEntry_RuiKawaguchi,
+ &sCreditsEntry_SpecialThanks,
+ &sCreditsEntry_MikikoOhhashi,
+ &sCreditsEntry_TakanaoKondo,
+ &sCreditsEntry_RuiKawaguchi,
_,
},
[PAGE_SPECIAL_THANKS_4] = {
- sCreditsEntry_SpecialThanks,
- sCreditsEntry_TakahiroOhnishi,
- sCreditsEntry_NorihideOkamura,
- sCreditsEntry_ShunsukeKohori,
+ &sCreditsEntry_SpecialThanks,
+ &sCreditsEntry_TakahiroOhnishi,
+ &sCreditsEntry_NorihideOkamura,
+ &sCreditsEntry_ShunsukeKohori,
_,
},
[PAGE_INFORMATION_SUPERVISORS] = {
- sCreditsEntry_InfoSupervisors,
- sCreditsEntry_KazuyukiTerada,
- sCreditsEntry_YuriSakurai,
- sCreditsEntry_YumiFunasaka,
- sCreditsEntry_NaokoYanase,
+ &sCreditsEntry_InfoSupervisors,
+ &sCreditsEntry_KazuyukiTerada,
+ &sCreditsEntry_YuriSakurai,
+ &sCreditsEntry_YumiFunasaka,
+ &sCreditsEntry_NaokoYanase,
},
[PAGE_ARTWORK_1] = {
_,
- sCreditsEntry_Artwork,
- sCreditsEntry_SachikoNakamichi,
- sCreditsEntry_FujikoNomura,
+ &sCreditsEntry_Artwork,
+ &sCreditsEntry_SachikoNakamichi,
+ &sCreditsEntry_FujikoNomura,
_,
},
[PAGE_ARTWORK_2] = {
_,
- sCreditsEntry_Artwork,
- sCreditsEntry_HideyukiNakajima,
- sCreditsEntry_HidenoriSaeki,
+ &sCreditsEntry_Artwork,
+ &sCreditsEntry_HideyukiNakajima,
+ &sCreditsEntry_HidenoriSaeki,
_,
},
[PAGE_ARTWORK_3] = {
- sCreditsEntry_Artwork,
- sCreditsEntry_YokoWatanabe,
- sCreditsEntry_SakaeKimura,
- sCreditsEntry_ChiakiShinkai,
+ &sCreditsEntry_Artwork,
+ &sCreditsEntry_YokoWatanabe,
+ &sCreditsEntry_SakaeKimura,
+ &sCreditsEntry_ChiakiShinkai,
_,
},
[PAGE_COORDINATORS] = {
- sCreditsEntry_Coordinators,
- sCreditsEntry_KazukiYoshihara,
- sCreditsEntry_AkiraKinashi,
- sCreditsEntry_RetsujiNomoto,
+ &sCreditsEntry_Coordinators,
+ &sCreditsEntry_KazukiYoshihara,
+ &sCreditsEntry_AkiraKinashi,
+ &sCreditsEntry_RetsujiNomoto,
_,
},
[PAGE_ENGLISH_VERSION] = {
_,
- sCreditsEntry_EnglishVersion,
- sCreditsEntry_HiroNakamura,
- sCreditsEntry_SethMcMahill,
+ &sCreditsEntry_EnglishVersion,
+ &sCreditsEntry_HiroNakamura,
+ &sCreditsEntry_SethMcMahill,
_,
},
[PAGE_TRANSLATOR] = {
_,
- sCreditsEntry_Translator,
- sCreditsEntry_NobOgasawara,
+ &sCreditsEntry_Translator,
+ &sCreditsEntry_NobOgasawara,
_,
_,
},
[PAGE_TEXT_EDITOR] = {
_,
- sCreditsEntry_TextEditor,
- sCreditsEntry_TeresaLillygren,
+ &sCreditsEntry_TextEditor,
+ &sCreditsEntry_TeresaLillygren,
_,
_,
},
[PAGE_NCL_COORDINATOR] = {
_,
- sCreditsEntry_NCLCoordinator,
- sCreditsEntry_KimikoNakamichi,
+ &sCreditsEntry_NCLCoordinator,
+ &sCreditsEntry_KimikoNakamichi,
_,
_,
},
[PAGE_PROGRAMMERS_5] = {
- sCreditsEntry_Programmers,
- sCreditsEntry_TerukiMurakawa,
- sCreditsEntry_SouichiYamamoto,
- sCreditsEntry_YuichiroIto,
- sCreditsEntry_AkiraKinashi,
+ &sCreditsEntry_Programmers,
+ &sCreditsEntry_TerukiMurakawa,
+ &sCreditsEntry_SouichiYamamoto,
+ &sCreditsEntry_YuichiroIto,
+ &sCreditsEntry_AkiraKinashi,
},
[PAGE_GRAPHIC_DESIGNER] = {
_,
- sCreditsEntry_GraphicDesigner,
- sCreditsEntry_AkiraKinashi,
+ &sCreditsEntry_GraphicDesigner,
+ &sCreditsEntry_AkiraKinashi,
_,
_,
},
[PAGE_ENVIRONMENT_AND_TOOL_PROGRAMS_2] = {
- sCreditsEntry_EnvAndToolPgrms,
- sCreditsEntry_TerukiMurakawa,
- sCreditsEntry_SouichiYamamoto,
- sCreditsEntry_KimikoNakamichi,
+ &sCreditsEntry_EnvAndToolPgrms,
+ &sCreditsEntry_TerukiMurakawa,
+ &sCreditsEntry_SouichiYamamoto,
+ &sCreditsEntry_KimikoNakamichi,
_,
},
[PAGE_NOA_TESTING] = {
- sCreditsEntry_NOAProductTesting,
- sCreditsEntry_ThomasHertzog,
- sCreditsEntry_ErikJohnson,
- sCreditsEntry_MikaKurosawa,
+ &sCreditsEntry_NOAProductTesting,
+ &sCreditsEntry_ThomasHertzog,
+ &sCreditsEntry_ErikJohnson,
+ &sCreditsEntry_MikaKurosawa,
_,
},
[PAGE_BRAILLE_CODE_CHECK_1] = {
- sCreditsEntry_BrailleCodeCheck,
- sCreditsEntry_NationalFederationBlind,
- sCreditsEntry_PatriciaAMaurer,
- sCreditsEntry_JapanBrailleLibrary,
- sCreditsEntry_EuropeanBlindUnion,
+ &sCreditsEntry_BrailleCodeCheck,
+ &sCreditsEntry_NationalFederationBlind,
+ &sCreditsEntry_PatriciaAMaurer,
+ &sCreditsEntry_JapanBrailleLibrary,
+ &sCreditsEntry_EuropeanBlindUnion,
},
[PAGE_BRAILLE_CODE_CHECK_2] = {
_,
- sCreditsEntry_BrailleCodeCheck,
- sCreditsEntry_AustralianBrailleAuthority,
- sCreditsEntry_RoyalNewZealandFederationBlind,
+ &sCreditsEntry_BrailleCodeCheck,
+ &sCreditsEntry_AustralianBrailleAuthority,
+ &sCreditsEntry_RoyalNewZealandFederationBlind,
_,
},
[PAGE_SPECIAL_THANKS_5] = {
- sCreditsEntry_SpecialThanks,
- sCreditsEntry_HiroyukiUesugi,
- sCreditsEntry_MotoyasuTojima,
- sCreditsEntry_NicolaPrattBarlow,
- sCreditsEntry_ShellieDow,
+ &sCreditsEntry_SpecialThanks,
+ &sCreditsEntry_HiroyukiUesugi,
+ &sCreditsEntry_MotoyasuTojima,
+ &sCreditsEntry_NicolaPrattBarlow,
+ &sCreditsEntry_ShellieDow,
},
[PAGE_TASK_MANAGERS] = {
_,
- sCreditsEntry_TaskManagers,
- sCreditsEntry_AzusaTajima,
- sCreditsEntry_ShusakuEgami,
+ &sCreditsEntry_TaskManagers,
+ &sCreditsEntry_AzusaTajima,
+ &sCreditsEntry_ShusakuEgami,
_,
},
[PAGE_PRODUCERS] = {
- sCreditsEntry_Producers,
- sCreditsEntry_HiroyukiJinnai,
- sCreditsEntry_HitoshiYamagami,
- sCreditsEntry_GakujiNomoto,
- sCreditsEntry_HiroakiTsuru,
+ &sCreditsEntry_Producers,
+ &sCreditsEntry_HiroyukiJinnai,
+ &sCreditsEntry_HitoshiYamagami,
+ &sCreditsEntry_GakujiNomoto,
+ &sCreditsEntry_HiroakiTsuru,
},
[PAGE_EXECUTIVE_DIRECTOR] = {
_,
- sCreditsEntry_ExecutiveDirector,
- sCreditsEntry_SatoshiTajiri,
+ &sCreditsEntry_ExecutiveDirector,
+ &sCreditsEntry_SatoshiTajiri,
_,
_,
},
[PAGE_EXECUTIVE_PRODUCERS_1] = {
_,
- sCreditsEntry_ExecProducers,
- sCreditsEntry_SatoruIwata,
+ &sCreditsEntry_ExecProducers,
+ &sCreditsEntry_SatoruIwata,
_,
_,
},
[PAGE_EXECUTIVE_PRODUCERS_2] = {
_,
- sCreditsEntry_ExecProducers,
- sCreditsEntry_TsunekazIshihara,
+ &sCreditsEntry_ExecProducers,
+ &sCreditsEntry_TsunekazIshihara,
_,
_,
},
diff --git a/src/data/graphics/pokemon.h b/src/data/graphics/pokemon.h
index f69fafec84..fdd9fd87cc 100644
--- a/src/data/graphics/pokemon.h
+++ b/src/data/graphics/pokemon.h
@@ -845,12 +845,12 @@ const u32 gMonShinyPalette_Starmie[] = INCBIN_U32("graphics/pokemon/starmie/shin
const u8 gMonIcon_Starmie[] = INCBIN_U8("graphics/pokemon/starmie/icon.4bpp");
const u8 gMonFootprint_Starmie[] = INCBIN_U8("graphics/pokemon/starmie/footprint.1bpp");
-const u32 gMonStillFrontPic_Mrmime[] = INCBIN_U32("graphics/pokemon/mr_mime/front.4bpp.lz");
-const u32 gMonPalette_Mrmime[] = INCBIN_U32("graphics/pokemon/mr_mime/normal.gbapal.lz");
-const u32 gMonBackPic_Mrmime[] = INCBIN_U32("graphics/pokemon/mr_mime/back.4bpp.lz");
-const u32 gMonShinyPalette_Mrmime[] = INCBIN_U32("graphics/pokemon/mr_mime/shiny.gbapal.lz");
-const u8 gMonIcon_Mrmime[] = INCBIN_U8("graphics/pokemon/mr_mime/icon.4bpp");
-const u8 gMonFootprint_Mrmime[] = INCBIN_U8("graphics/pokemon/mr_mime/footprint.1bpp");
+const u32 gMonStillFrontPic_MrMime[] = INCBIN_U32("graphics/pokemon/mr_mime/front.4bpp.lz");
+const u32 gMonPalette_MrMime[] = INCBIN_U32("graphics/pokemon/mr_mime/normal.gbapal.lz");
+const u32 gMonBackPic_MrMime[] = INCBIN_U32("graphics/pokemon/mr_mime/back.4bpp.lz");
+const u32 gMonShinyPalette_MrMime[] = INCBIN_U32("graphics/pokemon/mr_mime/shiny.gbapal.lz");
+const u8 gMonIcon_MrMime[] = INCBIN_U8("graphics/pokemon/mr_mime/icon.4bpp");
+const u8 gMonFootprint_MrMime[] = INCBIN_U8("graphics/pokemon/mr_mime/footprint.1bpp");
const u32 gMonStillFrontPic_Scyther[] = INCBIN_U32("graphics/pokemon/scyther/front.4bpp.lz");
const u32 gMonPalette_Scyther[] = INCBIN_U32("graphics/pokemon/scyther/normal.gbapal.lz");
diff --git a/src/data/party_menu.h b/src/data/party_menu.h
index 90faab0777..703e8e406e 100644
--- a/src/data/party_menu.h
+++ b/src/data/party_menu.h
@@ -64,7 +64,7 @@ static const struct PartyMenuBoxInfoRects sPartyBoxInfoRects[] =
// Each layout array has an array for each of the 6 party slots
// The array for each slot has the sprite coords of its various sprites in the following order
-// Pokemon icon (x, y), held item (x, y), status condition (x, y), menu pokeball (x, y)
+// Pokémon icon (x, y), held item (x, y), status condition (x, y), menu Poké Ball (x, y)
static const u8 sPartyMenuSpriteCoords[PARTY_LAYOUT_COUNT][PARTY_SIZE][4 * 2] =
{
[PARTY_LAYOUT_SINGLE] =
@@ -902,7 +902,7 @@ static const struct CompressedSpritePalette sSpritePalette_MenuPokeball =
gPartyMenuPokeball_Pal, TAG_POKEBALL
};
-// Used for the pokeball sprite on each party slot / Cancel button
+// Used for the Poké Ball sprite on each party slot / Cancel button
static const struct SpriteTemplate sSpriteTemplate_MenuPokeball =
{
.tileTag = TAG_POKEBALL,
diff --git a/src/data/pointillism_points.h b/src/data/pointillism_points.h
index 708f5c02e6..9d19d13140 100644
--- a/src/data/pointillism_points.h
+++ b/src/data/pointillism_points.h
@@ -2,7 +2,7 @@
#define GET_POINT_COLOR_TYPE(bits) (((bits) >> 1) & 3)
#define GET_POINT_DELTA(bits) (((bits) >> 3) & 7)
-#define PT(x, y, delta, colorType, offsetDownLeft) x, y, (delta << 3) | (colorType << 1) | offsetDownLeft
+#define PT(x, y, delta, colorType, offsetDownLeft) {x, y, (delta << 3) | (colorType << 1) | offsetDownLeft}
static const u8 sPointillismPoints[][3] = {
PT( 0, 29, 3, 2, FALSE),
diff --git a/src/data/pokemon/experience_tables.h b/src/data/pokemon/experience_tables.h
index 15bcadeb29..8f50e10918 100644
--- a/src/data/pokemon/experience_tables.h
+++ b/src/data/pokemon/experience_tables.h
@@ -1,5 +1,5 @@
-#define SQUARE(n)(n * n)
-#define CUBE(n)(n * n * n)
+#define SQUARE(n)((n) * (n))
+#define CUBE(n)((n) * (n) * (n))
#define EXP_SLOW(n)((5 * CUBE(n)) / 4) // (5 * (n)^3) / 4
#define EXP_FAST(n)((4 * CUBE(n)) / 5) // (4 * (n)^3) / 5
diff --git a/src/data/pokemon/level_up_learnset_pointers.h b/src/data/pokemon/level_up_learnset_pointers.h
index 5ac7b3bd74..661458ce38 100644
--- a/src/data/pokemon/level_up_learnset_pointers.h
+++ b/src/data/pokemon/level_up_learnset_pointers.h
@@ -122,7 +122,7 @@ const u16 *const gLevelUpLearnsets[NUM_SPECIES] =
[SPECIES_SEAKING] = sSeakingLevelUpLearnset,
[SPECIES_STARYU] = sStaryuLevelUpLearnset,
[SPECIES_STARMIE] = sStarmieLevelUpLearnset,
- [SPECIES_MR_MIME] = sMrmimeLevelUpLearnset,
+ [SPECIES_MR_MIME] = sMrMimeLevelUpLearnset,
[SPECIES_SCYTHER] = sScytherLevelUpLearnset,
[SPECIES_JYNX] = sJynxLevelUpLearnset,
[SPECIES_ELECTABUZZ] = sElectabuzzLevelUpLearnset,
diff --git a/src/data/pokemon/level_up_learnsets.h b/src/data/pokemon/level_up_learnsets.h
index c78b9ef0a7..212b969a70 100644
--- a/src/data/pokemon/level_up_learnsets.h
+++ b/src/data/pokemon/level_up_learnsets.h
@@ -1681,7 +1681,7 @@ static const u16 sStarmieLevelUpLearnset[] = {
LEVEL_UP_END
};
-static const u16 sMrmimeLevelUpLearnset[] = {
+static const u16 sMrMimeLevelUpLearnset[] = {
LEVEL_UP_MOVE( 1, MOVE_BARRIER),
LEVEL_UP_MOVE( 5, MOVE_CONFUSION),
LEVEL_UP_MOVE( 9, MOVE_SUBSTITUTE),
diff --git a/src/data/pokemon/pokedex_entries.h b/src/data/pokemon/pokedex_entries.h
index 007c73248e..8a15a18567 100644
--- a/src/data/pokemon/pokedex_entries.h
+++ b/src/data/pokemon/pokedex_entries.h
@@ -1469,7 +1469,7 @@ const struct PokedexEntry gPokedexEntries[] =
.categoryName = _("BARRIER"),
.height = 13,
.weight = 545,
- .description = gMrmimePokedexText,
+ .description = gMrMimePokedexText,
.pokemonScale = 258,
.pokemonOffset = 6,
.trainerScale = 256,
diff --git a/src/data/pokemon/pokedex_orders.h b/src/data/pokemon/pokedex_orders.h
index 55b0abcea8..aa09948ec0 100644
--- a/src/data/pokemon/pokedex_orders.h
+++ b/src/data/pokemon/pokedex_orders.h
@@ -25,7 +25,7 @@ const u16 gPokedexOrder_Alphabetical[] =
NATIONAL_DEX_OLD_UNOWN_X,
NATIONAL_DEX_OLD_UNOWN_Y,
NATIONAL_DEX_OLD_UNOWN_Z,
- // Actual pokemon start here.
+ // Actual Pokémon start here.
NATIONAL_DEX_ABRA,
NATIONAL_DEX_ABSOL,
NATIONAL_DEX_AERODACTYL,
diff --git a/src/data/pokemon/pokedex_text.h b/src/data/pokemon/pokedex_text.h
index 0daf7fc86c..ec4a831f86 100644
--- a/src/data/pokemon/pokedex_text.h
+++ b/src/data/pokemon/pokedex_text.h
@@ -730,7 +730,7 @@ const u8 gStarmiePokedexText[] = _(
"reflections of stars that twinkled on\n"
"gentle waves at night.");
-const u8 gMrmimePokedexText[] = _(
+const u8 gMrMimePokedexText[] = _(
"A MR. MIME is a master of pantomime. It can\n"
"convince others that something unseeable\n"
"actually exists. Once believed, the\n"
diff --git a/src/data/pokemon/species_info.h b/src/data/pokemon/species_info.h
index 2ef0629b52..fbd3bcba2a 100644
--- a/src/data/pokemon/species_info.h
+++ b/src/data/pokemon/species_info.h
@@ -2,34 +2,34 @@
// 255 (MON_GENDERLESS) is reserved for genderless Pokémon.
#define PERCENT_FEMALE(percent) min(254, ((percent * 255) / 100))
-#define OLD_UNOWN_SPECIES_INFO \
- { \
- .baseHP = 50, \
- .baseAttack = 150, \
- .baseDefense = 50, \
- .baseSpeed = 150, \
- .baseSpAttack = 150, \
- .baseSpDefense = 50, \
- .types = { TYPE_NORMAL, TYPE_NORMAL}, \
- .catchRate = 3, \
- .expYield = 1, \
- .evYield_HP = 2, \
- .evYield_Attack = 2, \
- .evYield_Defense = 2, \
- .evYield_Speed = 2, \
- .evYield_SpAttack = 2, \
- .evYield_SpDefense = 2, \
- .itemCommon = ITEM_NONE, \
- .itemRare = ITEM_NONE, \
- .genderRatio = MON_GENDERLESS, \
- .eggCycles = 120, \
- .friendship = 0, \
- .growthRate = GROWTH_MEDIUM_FAST, \
- .eggGroups = { EGG_GROUP_UNDISCOVERED, EGG_GROUP_UNDISCOVERED, }, \
- .abilities = {ABILITY_NONE, ABILITY_NONE}, \
- .safariZoneFleeRate = 0, \
- .bodyColor = BODY_COLOR_BLACK, \
- .noFlip = FALSE, \
+#define OLD_UNOWN_SPECIES_INFO \
+ { \
+ .baseHP = 50, \
+ .baseAttack = 150, \
+ .baseDefense = 50, \
+ .baseSpeed = 150, \
+ .baseSpAttack = 150, \
+ .baseSpDefense = 50, \
+ .types = { TYPE_NORMAL, TYPE_NORMAL}, \
+ .catchRate = 3, \
+ .expYield = 1, \
+ .evYield_HP = 2, \
+ .evYield_Attack = 2, \
+ .evYield_Defense = 2, \
+ .evYield_Speed = 2, \
+ .evYield_SpAttack = 2, \
+ .evYield_SpDefense = 2, \
+ .itemCommon = ITEM_NONE, \
+ .itemRare = ITEM_NONE, \
+ .genderRatio = MON_GENDERLESS, \
+ .eggCycles = 120, \
+ .friendship = 0, \
+ .growthRate = GROWTH_MEDIUM_FAST, \
+ .eggGroups = { EGG_GROUP_NO_EGGS_DISCOVERED, EGG_GROUP_NO_EGGS_DISCOVERED, }, \
+ .abilities = {ABILITY_NONE, ABILITY_NONE}, \
+ .safariZoneFleeRate = 0, \
+ .bodyColor = BODY_COLOR_BLACK, \
+ .noFlip = FALSE, \
}
const struct SpeciesInfo gSpeciesInfo[] =
@@ -929,7 +929,7 @@ const struct SpeciesInfo gSpeciesInfo[] =
.eggCycles = 20,
.friendship = STANDARD_FRIENDSHIP,
.growthRate = GROWTH_MEDIUM_SLOW,
- .eggGroups = { EGG_GROUP_UNDISCOVERED, EGG_GROUP_UNDISCOVERED },
+ .eggGroups = { EGG_GROUP_NO_EGGS_DISCOVERED, EGG_GROUP_NO_EGGS_DISCOVERED },
.abilities = {ABILITY_POISON_POINT, ABILITY_NONE},
.safariZoneFleeRate = 0,
.bodyColor = BODY_COLOR_BLUE,
@@ -959,7 +959,7 @@ const struct SpeciesInfo gSpeciesInfo[] =
.eggCycles = 20,
.friendship = STANDARD_FRIENDSHIP,
.growthRate = GROWTH_MEDIUM_SLOW,
- .eggGroups = { EGG_GROUP_UNDISCOVERED, EGG_GROUP_UNDISCOVERED },
+ .eggGroups = { EGG_GROUP_NO_EGGS_DISCOVERED, EGG_GROUP_NO_EGGS_DISCOVERED },
.abilities = {ABILITY_POISON_POINT, ABILITY_NONE},
.safariZoneFleeRate = 0,
.bodyColor = BODY_COLOR_BLUE,
@@ -4349,7 +4349,7 @@ const struct SpeciesInfo gSpeciesInfo[] =
.eggCycles = 80,
.friendship = 35,
.growthRate = GROWTH_SLOW,
- .eggGroups = { EGG_GROUP_UNDISCOVERED, EGG_GROUP_UNDISCOVERED },
+ .eggGroups = { EGG_GROUP_NO_EGGS_DISCOVERED, EGG_GROUP_NO_EGGS_DISCOVERED },
.abilities = {ABILITY_PRESSURE, ABILITY_NONE},
.safariZoneFleeRate = 0,
.bodyColor = BODY_COLOR_BLUE,
@@ -4379,7 +4379,7 @@ const struct SpeciesInfo gSpeciesInfo[] =
.eggCycles = 80,
.friendship = 35,
.growthRate = GROWTH_SLOW,
- .eggGroups = { EGG_GROUP_UNDISCOVERED, EGG_GROUP_UNDISCOVERED },
+ .eggGroups = { EGG_GROUP_NO_EGGS_DISCOVERED, EGG_GROUP_NO_EGGS_DISCOVERED },
.abilities = {ABILITY_PRESSURE, ABILITY_NONE},
.safariZoneFleeRate = 0,
.bodyColor = BODY_COLOR_YELLOW,
@@ -4409,7 +4409,7 @@ const struct SpeciesInfo gSpeciesInfo[] =
.eggCycles = 80,
.friendship = 35,
.growthRate = GROWTH_SLOW,
- .eggGroups = { EGG_GROUP_UNDISCOVERED, EGG_GROUP_UNDISCOVERED },
+ .eggGroups = { EGG_GROUP_NO_EGGS_DISCOVERED, EGG_GROUP_NO_EGGS_DISCOVERED },
.abilities = {ABILITY_PRESSURE, ABILITY_NONE},
.safariZoneFleeRate = 0,
.bodyColor = BODY_COLOR_YELLOW,
@@ -4529,7 +4529,7 @@ const struct SpeciesInfo gSpeciesInfo[] =
.eggCycles = 120,
.friendship = 0,
.growthRate = GROWTH_SLOW,
- .eggGroups = { EGG_GROUP_UNDISCOVERED, EGG_GROUP_UNDISCOVERED },
+ .eggGroups = { EGG_GROUP_NO_EGGS_DISCOVERED, EGG_GROUP_NO_EGGS_DISCOVERED },
.abilities = {ABILITY_PRESSURE, ABILITY_NONE},
.safariZoneFleeRate = 0,
.bodyColor = BODY_COLOR_PURPLE,
@@ -4559,7 +4559,7 @@ const struct SpeciesInfo gSpeciesInfo[] =
.eggCycles = 120,
.friendship = 100,
.growthRate = GROWTH_MEDIUM_SLOW,
- .eggGroups = { EGG_GROUP_UNDISCOVERED, EGG_GROUP_UNDISCOVERED },
+ .eggGroups = { EGG_GROUP_NO_EGGS_DISCOVERED, EGG_GROUP_NO_EGGS_DISCOVERED },
.abilities = {ABILITY_SYNCHRONIZE, ABILITY_NONE},
.safariZoneFleeRate = 0,
.bodyColor = BODY_COLOR_PINK,
@@ -5189,7 +5189,7 @@ const struct SpeciesInfo gSpeciesInfo[] =
.eggCycles = 10,
.friendship = STANDARD_FRIENDSHIP,
.growthRate = GROWTH_MEDIUM_FAST,
- .eggGroups = { EGG_GROUP_UNDISCOVERED, EGG_GROUP_UNDISCOVERED },
+ .eggGroups = { EGG_GROUP_NO_EGGS_DISCOVERED, EGG_GROUP_NO_EGGS_DISCOVERED },
.abilities = {ABILITY_STATIC, ABILITY_NONE},
.safariZoneFleeRate = 0,
.bodyColor = BODY_COLOR_YELLOW,
@@ -5219,7 +5219,7 @@ const struct SpeciesInfo gSpeciesInfo[] =
.eggCycles = 10,
.friendship = 140,
.growthRate = GROWTH_FAST,
- .eggGroups = { EGG_GROUP_UNDISCOVERED, EGG_GROUP_UNDISCOVERED },
+ .eggGroups = { EGG_GROUP_NO_EGGS_DISCOVERED, EGG_GROUP_NO_EGGS_DISCOVERED },
.abilities = {ABILITY_CUTE_CHARM, ABILITY_NONE},
.safariZoneFleeRate = 0,
.bodyColor = BODY_COLOR_PINK,
@@ -5249,7 +5249,7 @@ const struct SpeciesInfo gSpeciesInfo[] =
.eggCycles = 10,
.friendship = STANDARD_FRIENDSHIP,
.growthRate = GROWTH_FAST,
- .eggGroups = { EGG_GROUP_UNDISCOVERED, EGG_GROUP_UNDISCOVERED },
+ .eggGroups = { EGG_GROUP_NO_EGGS_DISCOVERED, EGG_GROUP_NO_EGGS_DISCOVERED },
.abilities = {ABILITY_CUTE_CHARM, ABILITY_NONE},
.safariZoneFleeRate = 0,
.bodyColor = BODY_COLOR_PINK,
@@ -5279,7 +5279,7 @@ const struct SpeciesInfo gSpeciesInfo[] =
.eggCycles = 10,
.friendship = STANDARD_FRIENDSHIP,
.growthRate = GROWTH_FAST,
- .eggGroups = { EGG_GROUP_UNDISCOVERED, EGG_GROUP_UNDISCOVERED },
+ .eggGroups = { EGG_GROUP_NO_EGGS_DISCOVERED, EGG_GROUP_NO_EGGS_DISCOVERED },
.abilities = {ABILITY_HUSTLE, ABILITY_SERENE_GRACE},
.safariZoneFleeRate = 0,
.bodyColor = BODY_COLOR_WHITE,
@@ -6059,7 +6059,7 @@ const struct SpeciesInfo gSpeciesInfo[] =
.eggCycles = 40,
.friendship = STANDARD_FRIENDSHIP,
.growthRate = GROWTH_MEDIUM_FAST,
- .eggGroups = { EGG_GROUP_UNDISCOVERED, EGG_GROUP_UNDISCOVERED },
+ .eggGroups = { EGG_GROUP_NO_EGGS_DISCOVERED, EGG_GROUP_NO_EGGS_DISCOVERED },
.abilities = {ABILITY_LEVITATE, ABILITY_NONE},
.safariZoneFleeRate = 0,
.bodyColor = BODY_COLOR_BLACK,
@@ -7109,7 +7109,7 @@ const struct SpeciesInfo gSpeciesInfo[] =
.eggCycles = 25,
.friendship = STANDARD_FRIENDSHIP,
.growthRate = GROWTH_MEDIUM_FAST,
- .eggGroups = { EGG_GROUP_UNDISCOVERED, EGG_GROUP_UNDISCOVERED },
+ .eggGroups = { EGG_GROUP_NO_EGGS_DISCOVERED, EGG_GROUP_NO_EGGS_DISCOVERED },
.abilities = {ABILITY_GUTS, ABILITY_NONE},
.safariZoneFleeRate = 0,
.bodyColor = BODY_COLOR_PURPLE,
@@ -7169,7 +7169,7 @@ const struct SpeciesInfo gSpeciesInfo[] =
.eggCycles = 25,
.friendship = STANDARD_FRIENDSHIP,
.growthRate = GROWTH_MEDIUM_FAST,
- .eggGroups = { EGG_GROUP_UNDISCOVERED, EGG_GROUP_UNDISCOVERED },
+ .eggGroups = { EGG_GROUP_NO_EGGS_DISCOVERED, EGG_GROUP_NO_EGGS_DISCOVERED },
.abilities = {ABILITY_OBLIVIOUS, ABILITY_NONE},
.safariZoneFleeRate = 0,
.bodyColor = BODY_COLOR_PINK,
@@ -7199,7 +7199,7 @@ const struct SpeciesInfo gSpeciesInfo[] =
.eggCycles = 25,
.friendship = STANDARD_FRIENDSHIP,
.growthRate = GROWTH_MEDIUM_FAST,
- .eggGroups = { EGG_GROUP_UNDISCOVERED, EGG_GROUP_UNDISCOVERED },
+ .eggGroups = { EGG_GROUP_NO_EGGS_DISCOVERED, EGG_GROUP_NO_EGGS_DISCOVERED },
.abilities = {ABILITY_STATIC, ABILITY_NONE},
.safariZoneFleeRate = 0,
.bodyColor = BODY_COLOR_YELLOW,
@@ -7229,7 +7229,7 @@ const struct SpeciesInfo gSpeciesInfo[] =
.eggCycles = 25,
.friendship = STANDARD_FRIENDSHIP,
.growthRate = GROWTH_MEDIUM_FAST,
- .eggGroups = { EGG_GROUP_UNDISCOVERED, EGG_GROUP_UNDISCOVERED },
+ .eggGroups = { EGG_GROUP_NO_EGGS_DISCOVERED, EGG_GROUP_NO_EGGS_DISCOVERED },
.abilities = {ABILITY_FLAME_BODY, ABILITY_NONE},
.safariZoneFleeRate = 0,
.bodyColor = BODY_COLOR_RED,
@@ -7319,7 +7319,7 @@ const struct SpeciesInfo gSpeciesInfo[] =
.eggCycles = 80,
.friendship = 35,
.growthRate = GROWTH_SLOW,
- .eggGroups = { EGG_GROUP_UNDISCOVERED, EGG_GROUP_UNDISCOVERED },
+ .eggGroups = { EGG_GROUP_NO_EGGS_DISCOVERED, EGG_GROUP_NO_EGGS_DISCOVERED },
.abilities = {ABILITY_PRESSURE, ABILITY_NONE},
.safariZoneFleeRate = 0,
.bodyColor = BODY_COLOR_YELLOW,
@@ -7349,7 +7349,7 @@ const struct SpeciesInfo gSpeciesInfo[] =
.eggCycles = 80,
.friendship = 35,
.growthRate = GROWTH_SLOW,
- .eggGroups = { EGG_GROUP_UNDISCOVERED, EGG_GROUP_UNDISCOVERED },
+ .eggGroups = { EGG_GROUP_NO_EGGS_DISCOVERED, EGG_GROUP_NO_EGGS_DISCOVERED },
.abilities = {ABILITY_PRESSURE, ABILITY_NONE},
.safariZoneFleeRate = 0,
.bodyColor = BODY_COLOR_BROWN,
@@ -7379,7 +7379,7 @@ const struct SpeciesInfo gSpeciesInfo[] =
.eggCycles = 80,
.friendship = 35,
.growthRate = GROWTH_SLOW,
- .eggGroups = { EGG_GROUP_UNDISCOVERED, EGG_GROUP_UNDISCOVERED },
+ .eggGroups = { EGG_GROUP_NO_EGGS_DISCOVERED, EGG_GROUP_NO_EGGS_DISCOVERED },
.abilities = {ABILITY_PRESSURE, ABILITY_NONE},
.safariZoneFleeRate = 0,
.bodyColor = BODY_COLOR_BLUE,
@@ -7499,7 +7499,7 @@ const struct SpeciesInfo gSpeciesInfo[] =
.eggCycles = 120,
.friendship = 0,
.growthRate = GROWTH_SLOW,
- .eggGroups = { EGG_GROUP_UNDISCOVERED, EGG_GROUP_UNDISCOVERED },
+ .eggGroups = { EGG_GROUP_NO_EGGS_DISCOVERED, EGG_GROUP_NO_EGGS_DISCOVERED },
.abilities = {ABILITY_PRESSURE, ABILITY_NONE},
.safariZoneFleeRate = 0,
.bodyColor = BODY_COLOR_WHITE,
@@ -7529,7 +7529,7 @@ const struct SpeciesInfo gSpeciesInfo[] =
.eggCycles = 120,
.friendship = 0,
.growthRate = GROWTH_SLOW,
- .eggGroups = { EGG_GROUP_UNDISCOVERED, EGG_GROUP_UNDISCOVERED },
+ .eggGroups = { EGG_GROUP_NO_EGGS_DISCOVERED, EGG_GROUP_NO_EGGS_DISCOVERED },
.abilities = {ABILITY_PRESSURE, ABILITY_NONE},
.safariZoneFleeRate = 0,
.bodyColor = BODY_COLOR_RED,
@@ -7559,7 +7559,7 @@ const struct SpeciesInfo gSpeciesInfo[] =
.eggCycles = 120,
.friendship = 100,
.growthRate = GROWTH_MEDIUM_SLOW,
- .eggGroups = { EGG_GROUP_UNDISCOVERED, EGG_GROUP_UNDISCOVERED },
+ .eggGroups = { EGG_GROUP_NO_EGGS_DISCOVERED, EGG_GROUP_NO_EGGS_DISCOVERED },
.abilities = {ABILITY_NATURAL_CURE, ABILITY_NONE},
.safariZoneFleeRate = 0,
.bodyColor = BODY_COLOR_GREEN,
@@ -9829,7 +9829,7 @@ const struct SpeciesInfo gSpeciesInfo[] =
.eggCycles = 10,
.friendship = STANDARD_FRIENDSHIP,
.growthRate = GROWTH_FAST,
- .eggGroups = { EGG_GROUP_UNDISCOVERED, EGG_GROUP_UNDISCOVERED },
+ .eggGroups = { EGG_GROUP_NO_EGGS_DISCOVERED, EGG_GROUP_NO_EGGS_DISCOVERED },
.abilities = {ABILITY_THICK_FAT, ABILITY_HUGE_POWER},
.safariZoneFleeRate = 0,
.bodyColor = BODY_COLOR_BLUE,
@@ -10129,7 +10129,7 @@ const struct SpeciesInfo gSpeciesInfo[] =
.eggCycles = 20,
.friendship = STANDARD_FRIENDSHIP,
.growthRate = GROWTH_MEDIUM_FAST,
- .eggGroups = { EGG_GROUP_UNDISCOVERED, EGG_GROUP_UNDISCOVERED },
+ .eggGroups = { EGG_GROUP_NO_EGGS_DISCOVERED, EGG_GROUP_NO_EGGS_DISCOVERED },
.abilities = {ABILITY_SHADOW_TAG, ABILITY_NONE},
.safariZoneFleeRate = 0,
.bodyColor = BODY_COLOR_BLUE,
@@ -11359,7 +11359,7 @@ const struct SpeciesInfo gSpeciesInfo[] =
.eggCycles = 80,
.friendship = 35,
.growthRate = GROWTH_SLOW,
- .eggGroups = { EGG_GROUP_UNDISCOVERED, EGG_GROUP_UNDISCOVERED },
+ .eggGroups = { EGG_GROUP_NO_EGGS_DISCOVERED, EGG_GROUP_NO_EGGS_DISCOVERED },
.abilities = {ABILITY_CLEAR_BODY, ABILITY_NONE},
.safariZoneFleeRate = 0,
.bodyColor = BODY_COLOR_BROWN,
@@ -11389,7 +11389,7 @@ const struct SpeciesInfo gSpeciesInfo[] =
.eggCycles = 80,
.friendship = 35,
.growthRate = GROWTH_SLOW,
- .eggGroups = { EGG_GROUP_UNDISCOVERED, EGG_GROUP_UNDISCOVERED },
+ .eggGroups = { EGG_GROUP_NO_EGGS_DISCOVERED, EGG_GROUP_NO_EGGS_DISCOVERED },
.abilities = {ABILITY_CLEAR_BODY, ABILITY_NONE},
.safariZoneFleeRate = 0,
.bodyColor = BODY_COLOR_BLUE,
@@ -11419,7 +11419,7 @@ const struct SpeciesInfo gSpeciesInfo[] =
.eggCycles = 80,
.friendship = 35,
.growthRate = GROWTH_SLOW,
- .eggGroups = { EGG_GROUP_UNDISCOVERED, EGG_GROUP_UNDISCOVERED },
+ .eggGroups = { EGG_GROUP_NO_EGGS_DISCOVERED, EGG_GROUP_NO_EGGS_DISCOVERED },
.abilities = {ABILITY_CLEAR_BODY, ABILITY_NONE},
.safariZoneFleeRate = 0,
.bodyColor = BODY_COLOR_GRAY,
@@ -11449,7 +11449,7 @@ const struct SpeciesInfo gSpeciesInfo[] =
.eggCycles = 120,
.friendship = 0,
.growthRate = GROWTH_SLOW,
- .eggGroups = { EGG_GROUP_UNDISCOVERED, EGG_GROUP_UNDISCOVERED },
+ .eggGroups = { EGG_GROUP_NO_EGGS_DISCOVERED, EGG_GROUP_NO_EGGS_DISCOVERED },
.abilities = {ABILITY_DRIZZLE, ABILITY_NONE},
.safariZoneFleeRate = 0,
.bodyColor = BODY_COLOR_BLUE,
@@ -11479,7 +11479,7 @@ const struct SpeciesInfo gSpeciesInfo[] =
.eggCycles = 120,
.friendship = 0,
.growthRate = GROWTH_SLOW,
- .eggGroups = { EGG_GROUP_UNDISCOVERED, EGG_GROUP_UNDISCOVERED },
+ .eggGroups = { EGG_GROUP_NO_EGGS_DISCOVERED, EGG_GROUP_NO_EGGS_DISCOVERED },
.abilities = {ABILITY_DROUGHT, ABILITY_NONE},
.safariZoneFleeRate = 0,
.bodyColor = BODY_COLOR_RED,
@@ -11509,7 +11509,7 @@ const struct SpeciesInfo gSpeciesInfo[] =
.eggCycles = 120,
.friendship = 0,
.growthRate = GROWTH_SLOW,
- .eggGroups = { EGG_GROUP_UNDISCOVERED, EGG_GROUP_UNDISCOVERED },
+ .eggGroups = { EGG_GROUP_NO_EGGS_DISCOVERED, EGG_GROUP_NO_EGGS_DISCOVERED },
.abilities = {ABILITY_AIR_LOCK, ABILITY_NONE},
.safariZoneFleeRate = 0,
.bodyColor = BODY_COLOR_GREEN,
@@ -11539,7 +11539,7 @@ const struct SpeciesInfo gSpeciesInfo[] =
.eggCycles = 120,
.friendship = 90,
.growthRate = GROWTH_SLOW,
- .eggGroups = { EGG_GROUP_UNDISCOVERED, EGG_GROUP_UNDISCOVERED },
+ .eggGroups = { EGG_GROUP_NO_EGGS_DISCOVERED, EGG_GROUP_NO_EGGS_DISCOVERED },
.abilities = {ABILITY_LEVITATE, ABILITY_NONE},
.safariZoneFleeRate = 0,
.bodyColor = BODY_COLOR_RED,
@@ -11569,7 +11569,7 @@ const struct SpeciesInfo gSpeciesInfo[] =
.eggCycles = 120,
.friendship = 90,
.growthRate = GROWTH_SLOW,
- .eggGroups = { EGG_GROUP_UNDISCOVERED, EGG_GROUP_UNDISCOVERED },
+ .eggGroups = { EGG_GROUP_NO_EGGS_DISCOVERED, EGG_GROUP_NO_EGGS_DISCOVERED },
.abilities = {ABILITY_LEVITATE, ABILITY_NONE},
.safariZoneFleeRate = 0,
.bodyColor = BODY_COLOR_BLUE,
@@ -11599,7 +11599,7 @@ const struct SpeciesInfo gSpeciesInfo[] =
.eggCycles = 120,
.friendship = 100,
.growthRate = GROWTH_SLOW,
- .eggGroups = { EGG_GROUP_UNDISCOVERED, EGG_GROUP_UNDISCOVERED },
+ .eggGroups = { EGG_GROUP_NO_EGGS_DISCOVERED, EGG_GROUP_NO_EGGS_DISCOVERED },
.abilities = {ABILITY_SERENE_GRACE, ABILITY_NONE},
.safariZoneFleeRate = 0,
.bodyColor = BODY_COLOR_YELLOW,
@@ -11629,7 +11629,7 @@ const struct SpeciesInfo gSpeciesInfo[] =
.eggCycles = 120,
.friendship = 0,
.growthRate = GROWTH_SLOW,
- .eggGroups = { EGG_GROUP_UNDISCOVERED, EGG_GROUP_UNDISCOVERED },
+ .eggGroups = { EGG_GROUP_NO_EGGS_DISCOVERED, EGG_GROUP_NO_EGGS_DISCOVERED },
.abilities = {ABILITY_PRESSURE, ABILITY_NONE},
.safariZoneFleeRate = 0,
.bodyColor = BODY_COLOR_RED,
diff --git a/src/data/pokemon_graphics/back_pic_table.h b/src/data/pokemon_graphics/back_pic_table.h
index 9a98927aac..1a51f9ccdd 100644
--- a/src/data/pokemon_graphics/back_pic_table.h
+++ b/src/data/pokemon_graphics/back_pic_table.h
@@ -122,7 +122,7 @@ const struct CompressedSpriteSheet gMonBackPicTable[] =
SPECIES_SPRITE(SEAKING, gMonBackPic_Seaking),
SPECIES_SPRITE(STARYU, gMonBackPic_Staryu),
SPECIES_SPRITE(STARMIE, gMonBackPic_Starmie),
- SPECIES_SPRITE(MR_MIME, gMonBackPic_Mrmime),
+ SPECIES_SPRITE(MR_MIME, gMonBackPic_MrMime),
SPECIES_SPRITE(SCYTHER, gMonBackPic_Scyther),
SPECIES_SPRITE(JYNX, gMonBackPic_Jynx),
SPECIES_SPRITE(ELECTABUZZ, gMonBackPic_Electabuzz),
diff --git a/src/data/pokemon_graphics/footprint_table.h b/src/data/pokemon_graphics/footprint_table.h
index 86ca067901..d63e33e5b7 100644
--- a/src/data/pokemon_graphics/footprint_table.h
+++ b/src/data/pokemon_graphics/footprint_table.h
@@ -122,7 +122,7 @@ const u8 *const gMonFootprintTable[] =
[SPECIES_SEAKING] = gMonFootprint_Seaking,
[SPECIES_STARYU] = gMonFootprint_Staryu,
[SPECIES_STARMIE] = gMonFootprint_Starmie,
- [SPECIES_MR_MIME] = gMonFootprint_Mrmime,
+ [SPECIES_MR_MIME] = gMonFootprint_MrMime,
[SPECIES_SCYTHER] = gMonFootprint_Scyther,
[SPECIES_JYNX] = gMonFootprint_Jynx,
[SPECIES_ELECTABUZZ] = gMonFootprint_Electabuzz,
diff --git a/src/data/pokemon_graphics/front_pic_table.h b/src/data/pokemon_graphics/front_pic_table.h
index 82af860d30..acb0bba252 100644
--- a/src/data/pokemon_graphics/front_pic_table.h
+++ b/src/data/pokemon_graphics/front_pic_table.h
@@ -122,7 +122,7 @@ const struct CompressedSpriteSheet gMonFrontPicTable[] =
SPECIES_SPRITE(SEAKING, gMonFrontPic_Seaking),
SPECIES_SPRITE(STARYU, gMonFrontPic_Staryu),
SPECIES_SPRITE(STARMIE, gMonFrontPic_Starmie),
- SPECIES_SPRITE(MR_MIME, gMonFrontPic_Mrmime),
+ SPECIES_SPRITE(MR_MIME, gMonFrontPic_MrMime),
SPECIES_SPRITE(SCYTHER, gMonFrontPic_Scyther),
SPECIES_SPRITE(JYNX, gMonFrontPic_Jynx),
SPECIES_SPRITE(ELECTABUZZ, gMonFrontPic_Electabuzz),
diff --git a/src/data/pokemon_graphics/palette_table.h b/src/data/pokemon_graphics/palette_table.h
index 35edcc76c1..8bdfd2dbd9 100644
--- a/src/data/pokemon_graphics/palette_table.h
+++ b/src/data/pokemon_graphics/palette_table.h
@@ -122,7 +122,7 @@ const struct CompressedSpritePalette gMonPaletteTable[] =
SPECIES_PAL(SEAKING, gMonPalette_Seaking),
SPECIES_PAL(STARYU, gMonPalette_Staryu),
SPECIES_PAL(STARMIE, gMonPalette_Starmie),
- SPECIES_PAL(MR_MIME, gMonPalette_Mrmime),
+ SPECIES_PAL(MR_MIME, gMonPalette_MrMime),
SPECIES_PAL(SCYTHER, gMonPalette_Scyther),
SPECIES_PAL(JYNX, gMonPalette_Jynx),
SPECIES_PAL(ELECTABUZZ, gMonPalette_Electabuzz),
diff --git a/src/data/pokemon_graphics/shiny_palette_table.h b/src/data/pokemon_graphics/shiny_palette_table.h
index 8b1cfcaaca..1db14d864a 100644
--- a/src/data/pokemon_graphics/shiny_palette_table.h
+++ b/src/data/pokemon_graphics/shiny_palette_table.h
@@ -122,7 +122,7 @@ const struct CompressedSpritePalette gMonShinyPaletteTable[] =
SPECIES_SHINY_PAL(SEAKING, gMonShinyPalette_Seaking),
SPECIES_SHINY_PAL(STARYU, gMonShinyPalette_Staryu),
SPECIES_SHINY_PAL(STARMIE, gMonShinyPalette_Starmie),
- SPECIES_SHINY_PAL(MR_MIME, gMonShinyPalette_Mrmime),
+ SPECIES_SHINY_PAL(MR_MIME, gMonShinyPalette_MrMime),
SPECIES_SHINY_PAL(SCYTHER, gMonShinyPalette_Scyther),
SPECIES_SHINY_PAL(JYNX, gMonShinyPalette_Jynx),
SPECIES_SHINY_PAL(ELECTABUZZ, gMonShinyPalette_Electabuzz),
diff --git a/src/data/pokemon_graphics/still_front_pic_table.h b/src/data/pokemon_graphics/still_front_pic_table.h
index 985a3aa2fd..9a77855ab4 100644
--- a/src/data/pokemon_graphics/still_front_pic_table.h
+++ b/src/data/pokemon_graphics/still_front_pic_table.h
@@ -122,7 +122,7 @@ const struct CompressedSpriteSheet gMonStillFrontPicTable[] =
SPECIES_SPRITE(SEAKING, gMonStillFrontPic_Seaking),
SPECIES_SPRITE(STARYU, gMonStillFrontPic_Staryu),
SPECIES_SPRITE(STARMIE, gMonStillFrontPic_Starmie),
- SPECIES_SPRITE(MR_MIME, gMonStillFrontPic_Mrmime),
+ SPECIES_SPRITE(MR_MIME, gMonStillFrontPic_MrMime),
SPECIES_SPRITE(SCYTHER, gMonStillFrontPic_Scyther),
SPECIES_SPRITE(JYNX, gMonStillFrontPic_Jynx),
SPECIES_SPRITE(ELECTABUZZ, gMonStillFrontPic_Electabuzz),
diff --git a/src/data/trade.h b/src/data/trade.h
index ef7e9231de..ba49f4b874 100644
--- a/src/data/trade.h
+++ b/src/data/trade.h
@@ -372,8 +372,8 @@ static const u8 *const sActionTexts[] =
static const struct MenuAction sSelectTradeMonActions[] =
{
- {sText_Summary2, Task_DrawSelectionSummary},
- {sText_Trade2, Task_DrawSelectionTrade}
+ {sText_Summary2, {Task_DrawSelectionSummary}},
+ {sText_Trade2, {Task_DrawSelectionTrade}}
};
static const u8 *const sMessages[] =
diff --git a/src/daycare.c b/src/daycare.c
index 289495bbc5..72fc79ffc2 100644
--- a/src/daycare.c
+++ b/src/daycare.c
@@ -193,10 +193,10 @@ void StoreSelectedPokemonInDaycare(void)
StorePokemonInEmptyDaycareSlot(&gPlayerParty[monId], &gSaveBlock1Ptr->daycare);
}
-// Shifts the second daycare pokemon slot into the first slot.
+// Shifts the second daycare Pokémon slot into the first slot.
static void ShiftDaycareSlots(struct DayCare *daycare)
{
- // This condition is only satisfied when the player takes out the first pokemon from the daycare.
+ // This condition is only satisfied when the player takes out the first Pokémon from the daycare.
if (GetBoxMonData(&daycare->mons[1].mon, MON_DATA_SPECIES) != SPECIES_NONE
&& GetBoxMonData(&daycare->mons[0].mon, MON_DATA_SPECIES) == SPECIES_NONE)
{
@@ -331,7 +331,7 @@ void GetDaycareCost(void)
gSpecialVar_0x8005 = GetDaycareCostForMon(&gSaveBlock1Ptr->daycare, gSpecialVar_0x8004);
}
-static void Debug_AddDaycareSteps(u16 numSteps)
+static void UNUSED Debug_AddDaycareSteps(u16 numSteps)
{
gSaveBlock1Ptr->daycare.mons[0].steps += numSteps;
gSaveBlock1Ptr->daycare.mons[1].steps += numSteps;
@@ -364,7 +364,7 @@ static void ClearDaycareMon(struct DaycareMon *daycareMon)
ClearDaycareMonMail(&daycareMon->mail);
}
-static void ClearAllDaycareData(struct DayCare *daycare)
+static void UNUSED ClearAllDaycareData(struct DayCare *daycare)
{
u8 i;
@@ -498,8 +498,7 @@ void TriggerPendingDaycareEgg(void)
_TriggerPendingDaycareEgg(&gSaveBlock1Ptr->daycare);
}
-// Unused
-static void TriggerPendingDaycareMaleEgg(void)
+static void UNUSED TriggerPendingDaycareMaleEgg(void)
{
_TriggerPendingDaycareMaleEgg(&gSaveBlock1Ptr->daycare);
}
@@ -597,7 +596,7 @@ static void InheritIVs(struct Pokemon *egg, struct DayCare *daycare)
}
}
-// Counts the number of egg moves a pokemon learns and stores the moves in
+// Counts the number of egg moves a Pokémon learns and stores the moves in
// the given array.
static u8 GetEggMoves(struct Pokemon *pokemon, u16 *eggMoves)
{
@@ -986,7 +985,7 @@ u8 GetDaycareState(void)
return DAYCARE_NO_MONS;
}
-static u8 GetDaycarePokemonCount(void)
+static u8 UNUSED GetDaycarePokemonCount(void)
{
u8 ret = CountPokemonInDaycare(&gSaveBlock1Ptr->daycare);
if (ret)
@@ -1034,7 +1033,7 @@ static u8 GetDaycareCompatibilityScore(struct DayCare *daycare)
}
// check unbreedable egg group
- if (eggGroups[0][0] == EGG_GROUP_UNDISCOVERED || eggGroups[1][0] == EGG_GROUP_UNDISCOVERED)
+ if (eggGroups[0][0] == EGG_GROUP_NO_EGGS_DISCOVERED || eggGroups[1][0] == EGG_GROUP_NO_EGGS_DISCOVERED)
return PARENTS_INCOMPATIBLE;
// two Ditto can't breed
if (eggGroups[0][0] == EGG_GROUP_DITTO && eggGroups[1][0] == EGG_GROUP_DITTO)
@@ -1144,7 +1143,7 @@ static u8 *AppendMonGenderSymbol(u8 *name, struct BoxPokemon *boxMon)
return AppendGenderSymbol(name, GetBoxMonGender(boxMon));
}
-static void GetDaycareLevelMenuText(struct DayCare *daycare, u8 *dest)
+static void UNUSED GetDaycareLevelMenuText(struct DayCare *daycare, u8 *dest)
{
u8 monNames[DAYCARE_MON_COUNT][POKEMON_NAME_BUFFER_SIZE];
u8 i;
@@ -1163,7 +1162,7 @@ static void GetDaycareLevelMenuText(struct DayCare *daycare, u8 *dest)
StringAppend(dest, gText_Exit4);
}
-static void GetDaycareLevelMenuLevelText(struct DayCare *daycare, u8 *dest)
+static void UNUSED GetDaycareLevelMenuLevelText(struct DayCare *daycare, u8 *dest)
{
u8 i;
u8 level;
diff --git a/src/decompress.c b/src/decompress.c
index 0b4a4aca2c..8472863c81 100644
--- a/src/decompress.c
+++ b/src/decompress.c
@@ -142,7 +142,7 @@ void Unused_LZDecompressWramIndirect(const void **src, void *dest)
LZ77UnCompWram(*src, dest);
}
-static void StitchObjectsOn8x8Canvas(s32 object_size, s32 object_count, u8 *src_tiles, u8 *dest_tiles)
+static void UNUSED StitchObjectsOn8x8Canvas(s32 object_size, s32 object_count, u8 *src_tiles, u8 *dest_tiles)
{
/*
This function appears to emulate behaviour found in the GB(C) versions regarding how the Pokemon images
diff --git a/src/decoration.c b/src/decoration.c
index 1e3db736da..119ae96a72 100644
--- a/src/decoration.c
+++ b/src/decoration.c
@@ -113,7 +113,7 @@ EWRAM_DATA static u16 sDecorationsCursorPos = 0;
EWRAM_DATA static u16 sDecorationsScrollOffset = 0;
EWRAM_DATA u8 gCurDecorationIndex = 0;
EWRAM_DATA static u8 sCurDecorationCategory = DECORCAT_DESK;
-EWRAM_DATA static u32 sFiller[2] = {};
+EWRAM_DATA static u32 UNUSED sFiller[2] = {};
EWRAM_DATA static struct DecorationPCContext sDecorationContext = {};
EWRAM_DATA static u8 sDecorMenuWindowIds[WINDOW_COUNT] = {};
EWRAM_DATA static struct DecorationItemsMenu *sDecorationItemsMenu = NULL;
diff --git a/src/dodrio_berry_picking.c b/src/dodrio_berry_picking.c
index 1ba82c6d21..1b4500002c 100644
--- a/src/dodrio_berry_picking.c
+++ b/src/dodrio_berry_picking.c
@@ -2834,9 +2834,8 @@ static void GetScoreResults(struct DodrioGame_ScoreResults *dst, u8 playerId)
*dst = sGame->scoreResults[playerId];
}
-// Unused
// Returns where the specified player's score ranks, 0 being first (highest score)
-static u8 GetScoreRanking(u8 playerId)
+static u8 UNUSED GetScoreRanking(u8 playerId)
{
u8 i, ranking = 0;
u8 numPlayers = sGame->numPlayers;
@@ -3068,12 +3067,12 @@ static const u8 *const sDebug_PlayerNames[] =
sText_Digits
};
-static void Debug_UpdateNumPlayers(void)
+static void UNUSED Debug_UpdateNumPlayers(void)
{
sGame->numPlayers = GetLinkPlayerCount();
}
-static void Debug_SetPlayerNamesAndResults(void)
+static void UNUSED Debug_SetPlayerNamesAndResults(void)
{
u8 i, playerId;
@@ -4253,8 +4252,7 @@ static void SetBerryAnim(u16 id, u8 animNum)
StartSpriteAnim(&gSprites[*sBerrySpriteIds[id]], animNum);
}
-// Unused
-static void UnusedSetSpritePos(u8 spriteId)
+static void UNUSED UnusedSetSpritePos(u8 spriteId)
{
gSprites[spriteId].x = 20 * spriteId + 50;
gSprites[spriteId].y = 50;
@@ -4486,8 +4484,7 @@ static void InitGameGfx(struct DodrioGame_Gfx *ptr)
SetGfxFunc(LoadGfx);
}
-// Unused
-static void FreeAllWindowBuffers_(void)
+static void UNUSED FreeAllWindowBuffers_(void)
{
FreeAllWindowBuffers();
}
diff --git a/src/easy_chat.c b/src/easy_chat.c
index 5c910dced1..8e93ca310e 100644
--- a/src/easy_chat.c
+++ b/src/easy_chat.c
@@ -230,7 +230,7 @@ enum {
PALTAG_TRIANGLE_CURSOR,
PALTAG_RECTANGLE_CURSOR,
PALTAG_MISC_UI,
- PALTAG_RS_INTERVIEW_FRAME,
+ PALTAG_RS_INTERVIEW_FRAME,
};
enum {
@@ -240,7 +240,7 @@ enum {
GFXTAG_START_SELECT_BUTTONS,
GFXTAG_MODE_WINDOW,
GFXTAG_RS_INTERVIEW_FRAME,
- GFXTAG_BUTTON_WINDOW,
+ GFXTAG_BUTTON_WINDOW,
};
@@ -2758,7 +2758,7 @@ static void GetEasyChatConfirmDeletionText(const u8 **str1, const u8 **str2)
*str2 = gText_BeDeletedThatOkay;
}
-static void GetKeyboardCursorColAndRow(u8 *column, u8 *row)
+static void GetKeyboardCursorColAndRow(s8 *column, s8 *row)
{
*column = sEasyChatScreen->keyboardColumn;
*row = sEasyChatScreen->keyboardRow;
@@ -2774,7 +2774,7 @@ static u8 GetKeyboardScrollOffset(void)
return sEasyChatScreen->keyboardScrollOffset;
}
-static void GetWordSelectColAndRow(u8 *column, u8 *row)
+static void GetWordSelectColAndRow(s8 *column, s8 *row)
{
*column = sEasyChatScreen->wordSelectColumn;
*row = sEasyChatScreen->wordSelectRow;
@@ -2790,7 +2790,7 @@ static u8 GetWordSelectLastRow(void)
return sEasyChatScreen->wordSelectLastRow;
}
-static u8 UnusedDummy(void)
+static u8 UNUSED UnusedDummy(void)
{
return FALSE;
}
@@ -5264,7 +5264,7 @@ u8 *ConvertEasyChatWordsToString(u8 *dest, const u16 *src, u16 columns, u16 rows
return dest;
}
-static u8 *UnusedConvertEasyChatWordsToString(u8 *dest, const u16 *src, u16 columns, u16 rows)
+static u8 UNUSED *UnusedConvertEasyChatWordsToString(u8 *dest, const u16 *src, u16 columns, u16 rows)
{
u16 i, j, k;
u16 numColumns;
@@ -5503,8 +5503,7 @@ u16 UnlockRandomTrendySaying(void)
return EC_EMPTY_WORD;
}
-// Unused
-static u16 GetRandomUnlockedTrendySaying(void)
+static u16 UNUSED GetRandomUnlockedTrendySaying(void)
{
u16 i;
u16 n = GetNumTrendySayingsUnlocked();
@@ -5650,8 +5649,7 @@ static u8 GetUnlockedEasyChatGroupId(u8 index)
return sWordData->unlockedGroupIds[index];
}
-// Unused
-static u8 *BufferEasyChatWordGroupName(u8 *dest, u8 groupId, u16 totalChars)
+static u8 UNUSED *BufferEasyChatWordGroupName(u8 *dest, u8 groupId, u16 totalChars)
{
u16 i;
u8 *str = StringCopy(dest, sEasyChatGroupNamePointers[groupId]);
diff --git a/src/egg_hatch.c b/src/egg_hatch.c
index e9d287cf72..abf1aff841 100644
--- a/src/egg_hatch.c
+++ b/src/egg_hatch.c
@@ -781,7 +781,7 @@ static void SpriteCB_Egg_Shake3(struct Sprite *sprite)
{
if (++sprite->sTimer > 38)
{
- u16 species;
+ u16 UNUSED species;
sprite->callback = SpriteCB_Egg_WaitHatch;
sprite->sTimer = 0;
species = GetMonData(&gPlayerParty[sEggHatchData->eggPartyId], MON_DATA_SPECIES);
diff --git a/src/event_object_movement.c b/src/event_object_movement.c
index c52d029ea4..fc24b2be95 100644
--- a/src/event_object_movement.c
+++ b/src/event_object_movement.c
@@ -1374,7 +1374,7 @@ u8 Unref_TryInitLocalObjectEvent(u8 localId)
if (InBattlePyramid())
objectEventCount = GetNumBattlePyramidObjectEvents();
else if (InTrainerHill())
- objectEventCount = 2;
+ objectEventCount = HILL_TRAINERS_PER_FLOOR;
else
objectEventCount = gMapHeader.events->objectEventCount;
@@ -2278,7 +2278,7 @@ void TrySpawnObjectEvents(s16 cameraX, s16 cameraY)
if (InBattlePyramid())
objectCount = GetNumBattlePyramidObjectEvents();
else if (InTrainerHill())
- objectCount = 2;
+ objectCount = HILL_TRAINERS_PER_FLOOR;
else
objectCount = gMapHeader.events->objectEventCount;
@@ -2673,8 +2673,7 @@ u8 LoadObjectEventPalette(u16 paletteTag)
return LoadSpritePaletteIfTagExists(&sObjectEventSpritePalettes[i]);
}
-// Unused
-static void LoadObjectEventPaletteSet(u16 *paletteTags)
+static void UNUSED LoadObjectEventPaletteSet(u16 *paletteTags)
{
u8 i;
@@ -2757,8 +2756,7 @@ static void _PatchObjectPalette(u16 tag, u8 slot)
PatchObjectPalette(tag, slot);
}
-// Unused
-static void IncrementObjectEventCoords(struct ObjectEvent *objectEvent, s16 x, s16 y)
+static void UNUSED IncrementObjectEventCoords(struct ObjectEvent *objectEvent, s16 x, s16 y)
{
objectEvent->previousCoords.x = objectEvent->currentCoords.x;
objectEvent->previousCoords.y = objectEvent->currentCoords.y;
@@ -2957,8 +2955,7 @@ void CameraObjectSetFollowedSpriteId(u8 spriteId)
}
}
-// Unused
-static u8 CameraObjectGetFollowedSpriteId(void)
+static u8 UNUSED CameraObjectGetFollowedSpriteId(void)
{
struct Sprite *camera;
@@ -3058,8 +3055,7 @@ static u16 GetObjectEventFlagIdByObjectEventId(u8 objectEventId)
return GetObjectEventFlagIdByLocalIdAndMap(gObjectEvents[objectEventId].localId, gObjectEvents[objectEventId].mapNum, gObjectEvents[objectEventId].mapGroup);
}
-// Unused
-static u8 GetObjectTrainerTypeByLocalIdAndMap(u8 localId, u8 mapNum, u8 mapGroup)
+static u8 UNUSED GetObjectTrainerTypeByLocalIdAndMap(u8 localId, u8 mapNum, u8 mapGroup)
{
u8 objectEventId;
@@ -3069,8 +3065,7 @@ static u8 GetObjectTrainerTypeByLocalIdAndMap(u8 localId, u8 mapNum, u8 mapGroup
return gObjectEvents[objectEventId].trainerType;
}
-// Unused
-static u8 GetObjectTrainerTypeByObjectEventId(u8 objectEventId)
+static u8 UNUSED GetObjectTrainerTypeByObjectEventId(u8 objectEventId)
{
return gObjectEvents[objectEventId].trainerType;
}
@@ -5814,8 +5809,7 @@ void MoveCoords(u8 direction, s16 *x, s16 *y)
*y += sDirectionToVectors[direction].y;
}
-// Unused
-static void MoveCoordsInMapCoordIncrement(u8 direction, s16 *x, s16 *y)
+static void UNUSED MoveCoordsInMapCoordIncrement(u8 direction, s16 *x, s16 *y)
{
*x += sDirectionToVectors[direction].x << 4;
*y += sDirectionToVectors[direction].y << 4;
@@ -8961,7 +8955,13 @@ static void UpdateObjectEventElevationAndPriority(struct ObjectEvent *objEvent,
// keep subspriteMode synced with player's
// so that it disappears under bridges when they do
sprite->subspriteMode |= gSprites[gPlayerAvatar.spriteId].subspriteMode & SUBSPRITES_IGNORE_PRIORITY;
+ if (!objEvent->currentElevation)
+ objEvent = &gObjectEvents[gPlayerAvatar.objectEventId];
}
+ #else
+ // if transitioning between elevations, use the player's elevation
+ if (!objEvent->currentElevation && objEvent->localId == OBJ_EVENT_ID_FOLLOWER)
+ objEvent = &gObjectEvents[gPlayerAvatar.objectEventId];
#endif
sprite->subspriteTableNum = sElevationToSubspriteTableNum[objEvent->previousElevation];
@@ -9015,6 +9015,10 @@ static void ObjectEventUpdateSubpriority(struct ObjectEvent *objEvent, struct Sp
if (objEvent->fixedPriority)
return;
+ // If transitioning between elevations, use the player's elevation
+ if (!objEvent->currentElevation && objEvent->localId == OBJ_EVENT_ID_FOLLOWER)
+ objEvent = &gObjectEvents[gPlayerAvatar.objectEventId];
+
SetObjectSubpriorityByElevation(objEvent->previousElevation, sprite, 1);
}
@@ -9180,10 +9184,10 @@ static void DoTracksGroundEffect_BikeTireTracks(struct ObjectEvent *objEvent, st
// each byte in that row is for the next direction of the bike in the order
// of down, up, left, right.
static const u8 bikeTireTracks_Transitions[4][4] = {
- 1, 2, 7, 8,
- 1, 2, 6, 5,
- 5, 8, 3, 4,
- 6, 7, 3, 4,
+ {1, 2, 7, 8},
+ {1, 2, 6, 5},
+ {5, 8, 3, 4},
+ {6, 7, 3, 4},
};
if (objEvent->currentCoords.x != objEvent->previousCoords.x || objEvent->currentCoords.y != objEvent->previousCoords.y)
@@ -9899,8 +9903,7 @@ static void SpriteCB_VirtualObject(struct Sprite *sprite)
UpdateObjectEventSpriteInvisibility(sprite, sprite->sInvisible);
}
-// Unused
-static void DestroyVirtualObjects(void)
+static void UNUSED DestroyVirtualObjects(void)
{
int i;
diff --git a/src/evolution_scene.c b/src/evolution_scene.c
index dc19862616..133afe3b0d 100644
--- a/src/evolution_scene.c
+++ b/src/evolution_scene.c
@@ -1634,8 +1634,7 @@ static void StartBgAnimation(bool8 isLink)
CreateBgAnimTask(isLink);
}
-// Unused
-static void PauseBgPaletteAnim(void)
+static void UNUSED PauseBgPaletteAnim(void)
{
u8 taskId = FindTaskIdByFunc(Task_UpdateBgPalette);
diff --git a/src/field_control_avatar.c b/src/field_control_avatar.c
index 3a0c97e8cf..09d6ae7838 100644
--- a/src/field_control_avatar.c
+++ b/src/field_control_avatar.c
@@ -606,8 +606,7 @@ static bool8 TryStartStepCountScript(u16 metatileBehavior)
return FALSE;
}
-// Unused
-static void ClearFriendshipStepCounter(void)
+static void UNUSED ClearFriendshipStepCounter(void)
{
VarSet(VAR_FRIENDSHIP_STEP_COUNTER, 0);
}
diff --git a/src/field_door.c b/src/field_door.c
index 756d0dabf1..255233ec23 100644
--- a/src/field_door.c
+++ b/src/field_door.c
@@ -408,7 +408,7 @@ static bool32 AnimateDoorFrame(struct DoorGraphics *gfx, struct DoorAnimFrame *f
static void Task_AnimateDoor(u8 taskId)
{
- u16 *data = gTasks[taskId].data;
+ u16 *data = (u16*) gTasks[taskId].data;
struct DoorAnimFrame *frames = (struct DoorAnimFrame *)(tFramesHi << 16 | tFramesLo);
struct DoorGraphics *gfx = (struct DoorGraphics *)(tGfxHi << 16 | tGfxLo);
@@ -502,8 +502,8 @@ static s8 GetDoorSoundType(const struct DoorGraphics *gfx, u32 x, u32 y)
return gfx->sound;
}
-// Unused. Debug? Same as FieldAnimateDoorOpen but doesnt return or check if metatile is actually a door
-static void Debug_FieldAnimateDoorOpen(u32 x, u32 y)
+// Debug? Same as FieldAnimateDoorOpen but doesnt return or check if metatile is actually a door
+static void UNUSED Debug_FieldAnimateDoorOpen(u32 x, u32 y)
{
StartDoorOpenAnimation(sDoorAnimGraphicsTable, x, y);
}
diff --git a/src/field_effect.c b/src/field_effect.c
index 3f3834c6b6..69a9a3a8e5 100644
--- a/src/field_effect.c
+++ b/src/field_effect.c
@@ -254,7 +254,7 @@ static const u32 sHofMonitorBig_Gfx[] = INCBIN_U32("graphics/field_effects/pics/
static const u8 sHofMonitorSmall_Gfx[] = INCBIN_U8("graphics/field_effects/pics/hof_monitor_small.4bpp");
static const u16 sHofMonitor_Pal[16] = INCBIN_U16("graphics/field_effects/palettes/hof_monitor.gbapal");
-// Graphics for the lights streaking past your Pokemon when it uses a field move.
+// Graphics for the lights streaking past your Pokémon when it uses a field move.
static const u32 sFieldMoveStreaksOutdoors_Gfx[] = INCBIN_U32("graphics/field_effects/pics/field_move_streaks.4bpp");
static const u16 sFieldMoveStreaksOutdoors_Pal[16] = INCBIN_U16("graphics/field_effects/pics/field_move_streaks.gbapal");
static const u16 sFieldMoveStreaksOutdoors_Tilemap[320] = INCBIN_U16("graphics/field_effects/pics/field_move_streaks.bin");
@@ -900,8 +900,7 @@ u8 CreateTrainerSprite(u8 trainerSpriteID, s16 x, s16 y, u8 subpriority, u8 *buf
return CreateSprite(&spriteTemplate, x, y, subpriority);
}
-// Unused
-static void LoadTrainerGfx_TrainerCard(u8 gender, u16 palOffset, u8 *dest)
+static void UNUSED LoadTrainerGfx_TrainerCard(u8 gender, u16 palOffset, u8 *dest)
{
LZDecompressVram(gTrainerFrontPicTable[gender].data, dest);
LoadCompressedPalette(gTrainerFrontPicPaletteTable[gender].data, palOffset, PLTT_SIZE_4BPP);
@@ -2626,7 +2625,7 @@ static void FieldMoveShowMonOutdoorsEffect_Init(struct Task *task)
{
task->data[11] = REG_WININ;
task->data[12] = REG_WINOUT;
- StoreWordInTwoHalfwords(&task->data[13], (u32)gMain.vblankCallback);
+ StoreWordInTwoHalfwords((u16*) &task->data[13], (u32)gMain.vblankCallback);
task->tWinHoriz = WIN_RANGE(DISPLAY_WIDTH, DISPLAY_WIDTH + 1);
task->tWinVert = WIN_RANGE(DISPLAY_HEIGHT / 2, DISPLAY_HEIGHT / 2 + 1);
task->tWinIn = WININ_WIN0_BG_ALL | WININ_WIN0_OBJ | WININ_WIN0_CLR;
diff --git a/src/field_effect_helpers.c b/src/field_effect_helpers.c
index d09d568280..9d3b9f56e1 100755
--- a/src/field_effect_helpers.c
+++ b/src/field_effect_helpers.c
@@ -42,8 +42,12 @@ static void SpriteCB_UnderwaterSurfBlob(struct Sprite *);
static u32 ShowDisguiseFieldEffect(u8, u8, u8);
u32 FldEff_Shadow(void);
-// Used by several field effects to determine which of a group it is
-#define sFldEff data[1]
+// Data used by all the field effects that share UpdateJumpImpactEffect
+#define sJumpElevation data[0]
+#define sJumpFldEff data[1]
+
+// Data used by all the field effects that share WaitFieldEffectSpriteAnim
+#define sWaitFldEff data[0]
#define sReflectionObjEventId data[0]
#define sReflectionObjEventLocalId data[1]
@@ -61,7 +65,7 @@ void SetUpReflection(struct ObjectEvent *objectEvent, struct Sprite *sprite, boo
{
struct Sprite *reflectionSprite;
- reflectionSprite = &gSprites[CreateCopySpriteAt(sprite, sprite->x, sprite->y, 0x98)];
+ reflectionSprite = &gSprites[CreateCopySpriteAt(sprite, sprite->x, sprite->y, 152)];
reflectionSprite->callback = UpdateObjectReflectionSprite;
reflectionSprite->oam.priority = 3;
reflectionSprite->usingSheet = TRUE;
@@ -179,7 +183,7 @@ static void LoadObjectHighBridgeReflectionPalette(struct ObjectEvent *objectEven
static void UpdateObjectReflectionSprite(struct Sprite *reflectionSprite)
{
- struct ObjectEvent *objectEvent = &gObjectEvents[reflectionSprite->data[0]];
+ struct ObjectEvent *objectEvent = &gObjectEvents[reflectionSprite->sReflectionObjEventId];
struct Sprite *mainSprite = &gSprites[objectEvent->spriteId];
if (!objectEvent->active || !objectEvent->hasReflection || objectEvent->localId != reflectionSprite->sReflectionObjEventLocalId)
@@ -251,15 +255,15 @@ static void UpdateObjectReflectionSprite(struct Sprite *reflectionSprite)
extern const struct SpriteTemplate *const gFieldEffectObjectTemplatePointers[];
+#define sPrevX data[0]
+#define sPrevY data[1]
+
u8 CreateWarpArrowSprite(void)
{
- u8 spriteId;
- struct Sprite *sprite;
-
- spriteId = CreateSpriteAtEnd(gFieldEffectObjectTemplatePointers[FLDEFFOBJ_ARROW], 0, 0, 0x52);
+ u8 spriteId = CreateSpriteAtEnd(gFieldEffectObjectTemplatePointers[FLDEFFOBJ_ARROW], 0, 0, 82);
if (spriteId != MAX_SPRITES)
{
- sprite = &gSprites[spriteId];
+ struct Sprite *sprite = &gSprites[spriteId];
// Can use either gender's palette, so try to use the one that should be loaded
sprite->oam.paletteNum = LoadObjectEventPalette(gSaveBlock2Ptr->playerGender ? FLDEFF_PAL_TAG_MAY : FLDEFF_PAL_TAG_BRENDAN);
sprite->oam.priority = 1;
@@ -276,24 +280,24 @@ void SetSpriteInvisible(u8 spriteId)
void ShowWarpArrowSprite(u8 spriteId, u8 direction, s16 x, s16 y)
{
- s16 x2;
- s16 y2;
- struct Sprite *sprite;
-
- sprite = &gSprites[spriteId];
- if (sprite->invisible || sprite->data[0] != x || sprite->data[1] != y)
+ struct Sprite *sprite = &gSprites[spriteId];
+ if (sprite->invisible || sprite->sPrevX != x || sprite->sPrevY != y)
{
+ s16 x2, y2;
SetSpritePosToMapCoords(x, y, &x2, &y2);
sprite = &gSprites[spriteId];
sprite->x = x2 + 8;
sprite->y = y2 + 8;
sprite->invisible = FALSE;
- sprite->data[0] = x;
- sprite->data[1] = y;
+ sprite->sPrevX = x;
+ sprite->sPrevY = y;
StartSpriteAnim(sprite, direction - 1);
}
}
+#undef sPrevX
+#undef sPrevY
+
static const u8 sShadowEffectTemplateIds[] = {
FLDEFFOBJ_SHADOW_S,
FLDEFFOBJ_SHADOW_M,
@@ -308,6 +312,12 @@ const u16 gShadowVerticalOffsets[] = {
16
};
+// Sprite data for FLDEFF_SHADOW
+#define sLocalId data[0]
+#define sMapNum data[1]
+#define sMapGroup data[2]
+#define sYOffset data[3]
+
u32 FldEff_Shadow(void)
{
u8 objectEventId;
@@ -329,13 +339,13 @@ u32 FldEff_Shadow(void)
// SetGpuReg(REG_OFFSET_BLDALPHA, BLDALPHA_BLEND(8, 12));
gSprites[spriteId].oam.objMode = 1; // BLEND
gSprites[spriteId].coordOffsetEnabled = TRUE;
- gSprites[spriteId].data[0] = gFieldEffectArguments[0];
- gSprites[spriteId].data[1] = gFieldEffectArguments[1];
- gSprites[spriteId].data[2] = gFieldEffectArguments[2];
+ gSprites[spriteId].sLocalId = gFieldEffectArguments[0];
+ gSprites[spriteId].sMapNum = gFieldEffectArguments[1];
+ gSprites[spriteId].sMapGroup = gFieldEffectArguments[2];
#if LARGE_OW_SUPPORT
- gSprites[spriteId].data[3] = gShadowVerticalOffsets[graphicsInfo->shadowSize];
+ gSprites[spriteId].sYOffset = gShadowVerticalOffsets[graphicsInfo->shadowSize];
#else
- gSprites[spriteId].data[3] = (graphicsInfo->height >> 1) - gShadowVerticalOffsets[graphicsInfo->shadowSize];
+ gSprites[spriteId].sYOffset = (graphicsInfo->height >> 1) - gShadowVerticalOffsets[graphicsInfo->shadowSize];
#endif
}
return 0;
@@ -344,24 +354,22 @@ u32 FldEff_Shadow(void)
void UpdateShadowFieldEffect(struct Sprite *sprite)
{
u8 objectEventId;
- struct ObjectEvent *objectEvent;
- struct Sprite *linkedSprite;
- if (TryGetObjectEventIdByLocalIdAndMap(sprite->data[0], sprite->data[1], sprite->data[2], &objectEventId))
+ if (TryGetObjectEventIdByLocalIdAndMap(sprite->sLocalId, sprite->sMapNum, sprite->sMapGroup, &objectEventId))
{
FieldEffectStop(sprite, FLDEFF_SHADOW);
}
else
{
- objectEvent = &gObjectEvents[objectEventId];
- linkedSprite = &gSprites[objectEvent->spriteId];
+ struct ObjectEvent *objectEvent = &gObjectEvents[objectEventId];
+ struct Sprite *linkedSprite = &gSprites[objectEvent->spriteId];
sprite->oam.priority = linkedSprite->oam.priority;
sprite->x = linkedSprite->x;
#if LARGE_OW_SUPPORT
// Read 'live' size from linked sprite
- sprite->y = linkedSprite->y - linkedSprite->centerToCornerVecY - sprite->data[3];
+ sprite->y = linkedSprite->y - linkedSprite->centerToCornerVecY - sprite->sYOffset;
#else
- sprite->y = linkedSprite->y + sprite->data[3];
+ sprite->y = linkedSprite->y + sprite->sYOffset;
#endif
sprite->invisible = linkedSprite->invisible;
if (!objectEvent->active || !objectEvent->hasShadow
@@ -374,6 +382,11 @@ void UpdateShadowFieldEffect(struct Sprite *sprite)
}
}
+#undef sLocalId
+#undef sMapNum
+#undef sMapGroup
+#undef sYOffset
+
// Sprite data for FLDEFF_TALL_GRASS and FLDEFF_LONG_GRASS
#define sElevation data[0]
#define sX data[1]
@@ -386,18 +399,14 @@ void UpdateShadowFieldEffect(struct Sprite *sprite)
u32 FldEff_TallGrass(void)
{
- s16 x;
- s16 y;
u8 spriteId;
- struct Sprite *sprite;
-
- x = gFieldEffectArguments[0];
- y = gFieldEffectArguments[1];
+ s16 x = gFieldEffectArguments[0];
+ s16 y = gFieldEffectArguments[1];
SetSpritePosToOffsetMapCoords(&x, &y, 8, 8);
spriteId = CreateSpriteAtEnd(gFieldEffectObjectTemplatePointers[FLDEFFOBJ_TALL_GRASS], x, y, 0);
if (spriteId != MAX_SPRITES)
{
- sprite = &gSprites[spriteId];
+ struct Sprite *sprite = &gSprites[spriteId];
sprite->coordOffsetEnabled = TRUE;
sprite->oam.priority = gFieldEffectArguments[3];
sprite->sElevation = gFieldEffectArguments[2];
@@ -415,15 +424,12 @@ u32 FldEff_TallGrass(void)
void UpdateTallGrassFieldEffect(struct Sprite *sprite)
{
- u8 mapNum;
- u8 mapGroup;
u8 metatileBehavior;
u8 localId;
u8 objectEventId;
- struct ObjectEvent *objectEvent;
+ u8 mapNum = sprite->sCurrentMap >> 8;
+ u8 mapGroup = sprite->sCurrentMap;
- mapNum = sprite->sCurrentMap >> 8;
- mapGroup = sprite->sCurrentMap;
if (gCamera.active && (gSaveBlock1Ptr->location.mapNum != mapNum || gSaveBlock1Ptr->location.mapGroup != mapGroup))
{
sprite->sX -= gCamera.x;
@@ -444,11 +450,9 @@ void UpdateTallGrassFieldEffect(struct Sprite *sprite)
else
{
// Check if the object that triggered the effect has moved away
- objectEvent = &gObjectEvents[objectEventId];
- if ((objectEvent->currentCoords.x != sprite->sX
- || objectEvent->currentCoords.y != sprite->sY)
- && (objectEvent->previousCoords.x != sprite->sX
- || objectEvent->previousCoords.y != sprite->sY))
+ struct ObjectEvent *objectEvent = &gObjectEvents[objectEventId];
+ if ((objectEvent->currentCoords.x != sprite->sX || objectEvent->currentCoords.y != sprite->sY)
+ && (objectEvent->previousCoords.x != sprite->sX || objectEvent->previousCoords.y != sprite->sY))
sprite->sObjectMoved = TRUE;
// Metatile behavior var re-used as subpriority
@@ -464,31 +468,28 @@ void UpdateTallGrassFieldEffect(struct Sprite *sprite)
u32 FldEff_JumpTallGrass(void)
{
u8 spriteId;
- struct Sprite *sprite;
SetSpritePosToOffsetMapCoords((s16 *)&gFieldEffectArguments[0], (s16 *)&gFieldEffectArguments[1], 8, 12);
spriteId = CreateSpriteAtEnd(gFieldEffectObjectTemplatePointers[FLDEFFOBJ_JUMP_TALL_GRASS], gFieldEffectArguments[0], gFieldEffectArguments[1], 0);
if (spriteId != MAX_SPRITES)
{
- sprite = &gSprites[spriteId];
+ struct Sprite *sprite = &gSprites[spriteId];
sprite->coordOffsetEnabled = TRUE;
sprite->oam.priority = gFieldEffectArguments[3];
- sprite->sElevation = gFieldEffectArguments[2];
- sprite->sFldEff = FLDEFF_JUMP_TALL_GRASS;
+ sprite->sJumpElevation = gFieldEffectArguments[2];
+ sprite->sJumpFldEff = FLDEFF_JUMP_TALL_GRASS;
}
return 0;
}
u8 FindTallGrassFieldEffectSpriteId(u8 localId, u8 mapNum, u8 mapGroup, s16 x, s16 y)
{
- struct Sprite *sprite;
u8 i;
-
for (i = 0; i < MAX_SPRITES; i ++)
{
if (gSprites[i].inUse)
{
- sprite = &gSprites[i];
+ struct Sprite *sprite = &gSprites[i];
if (sprite->callback == UpdateTallGrassFieldEffect
&& (x == sprite->sX && y == sprite->sY)
&& localId == (u8)(sprite->sLocalId)
@@ -502,18 +503,14 @@ u8 FindTallGrassFieldEffectSpriteId(u8 localId, u8 mapNum, u8 mapGroup, s16 x, s
u32 FldEff_LongGrass(void)
{
- s16 x;
- s16 y;
u8 spriteId;
- struct Sprite *sprite;
-
- x = gFieldEffectArguments[0];
- y = gFieldEffectArguments[1];
+ s16 x = gFieldEffectArguments[0];
+ s16 y = gFieldEffectArguments[1];
SetSpritePosToOffsetMapCoords(&x, &y, 8, 8);
spriteId = CreateSpriteAtEnd(gFieldEffectObjectTemplatePointers[FLDEFFOBJ_LONG_GRASS], x, y, 0);
if (spriteId != MAX_SPRITES)
{
- sprite = &gSprites[spriteId];
+ struct Sprite *sprite = &gSprites[spriteId];
sprite->coordOffsetEnabled = TRUE;
sprite->oam.priority = ElevationToPriority(gFieldEffectArguments[2]);
sprite->sElevation = gFieldEffectArguments[2];
@@ -531,15 +528,12 @@ u32 FldEff_LongGrass(void)
void UpdateLongGrassFieldEffect(struct Sprite *sprite)
{
- u8 mapNum;
- u8 mapGroup;
u8 metatileBehavior;
u8 localId;
u8 objectEventId;
- struct ObjectEvent *objectEvent;
+ u8 mapNum = sprite->sCurrentMap >> 8;
+ u8 mapGroup = sprite->sCurrentMap;
- mapNum = sprite->sCurrentMap >> 8;
- mapGroup = sprite->sCurrentMap;
if (gCamera.active && (gSaveBlock1Ptr->location.mapNum != mapNum || gSaveBlock1Ptr->location.mapGroup != mapGroup))
{
sprite->sX -= gCamera.x;
@@ -549,7 +543,7 @@ void UpdateLongGrassFieldEffect(struct Sprite *sprite)
localId = sprite->sLocalId;
mapNum = sprite->sMapNum;
mapGroup = sprite->sMapGroup;
- metatileBehavior = MapGridGetMetatileBehaviorAt(sprite->data[1], sprite->data[2]);
+ metatileBehavior = MapGridGetMetatileBehaviorAt(sprite->sX, sprite->sY);
if (TryGetObjectEventIdByLocalIdAndMap(localId, mapNum, mapGroup, &objectEventId)
|| !MetatileBehavior_IsLongGrass(metatileBehavior)
|| (sprite->sObjectMoved && sprite->animEnded))
@@ -559,11 +553,9 @@ void UpdateLongGrassFieldEffect(struct Sprite *sprite)
else
{
// Check if the object that triggered the effect has moved away
- objectEvent = &gObjectEvents[objectEventId];
- if ((objectEvent->currentCoords.x != sprite->data[1]
- || objectEvent->currentCoords.y != sprite->data[2])
- && (objectEvent->previousCoords.x != sprite->data[1]
- || objectEvent->previousCoords.y != sprite->data[2]))
+ struct ObjectEvent *objectEvent = &gObjectEvents[objectEventId];
+ if ((objectEvent->currentCoords.x != sprite->sX || objectEvent->currentCoords.y != sprite->sY)
+ && (objectEvent->previousCoords.x != sprite->sX || objectEvent->previousCoords.y != sprite->sY))
sprite->sObjectMoved = TRUE;
UpdateObjectEventSpriteInvisibility(sprite, FALSE);
@@ -571,6 +563,7 @@ void UpdateLongGrassFieldEffect(struct Sprite *sprite)
}
}
+#undef sElevation
#undef sX
#undef sY
#undef sMapNum
@@ -584,41 +577,42 @@ void UpdateLongGrassFieldEffect(struct Sprite *sprite)
u32 FldEff_JumpLongGrass(void)
{
u8 spriteId;
- struct Sprite *sprite;
SetSpritePosToOffsetMapCoords((s16 *)&gFieldEffectArguments[0], (s16 *)&gFieldEffectArguments[1], 8, 8);
spriteId = CreateSpriteAtEnd(gFieldEffectObjectTemplatePointers[FLDEFFOBJ_JUMP_LONG_GRASS], gFieldEffectArguments[0], gFieldEffectArguments[1], 0);
if (spriteId != MAX_SPRITES)
{
- sprite = &gSprites[spriteId];
+ struct Sprite *sprite = &gSprites[spriteId];
sprite->coordOffsetEnabled = TRUE;
sprite->oam.priority = gFieldEffectArguments[3];
- sprite->sElevation = gFieldEffectArguments[2];
- sprite->sFldEff = FLDEFF_JUMP_LONG_GRASS;
+ sprite->sJumpElevation = gFieldEffectArguments[2];
+ sprite->sJumpFldEff = FLDEFF_JUMP_LONG_GRASS;
}
return 0;
}
+// Sprite data for FLDEFF_SHORT_GRASS
+#define sLocalId data[0]
+#define sMapNum data[1]
+#define sMapGroup data[2]
+#define sPrevX data[3]
+#define sPrevY data[4]
+
u32 FldEff_ShortGrass(void)
{
- u8 objectEventId;
- struct ObjectEvent *objectEvent;
- u8 spriteId;
- struct Sprite *sprite;
-
- objectEventId = GetObjectEventIdByLocalIdAndMap(gFieldEffectArguments[0], gFieldEffectArguments[1], gFieldEffectArguments[2]);
- objectEvent = &gObjectEvents[objectEventId];
- spriteId = CreateSpriteAtEnd(gFieldEffectObjectTemplatePointers[FLDEFFOBJ_SHORT_GRASS], 0, 0, 0);
+ u8 objectEventId = GetObjectEventIdByLocalIdAndMap(gFieldEffectArguments[0], gFieldEffectArguments[1], gFieldEffectArguments[2]);
+ struct ObjectEvent *objectEvent = &gObjectEvents[objectEventId];
+ u8 spriteId = CreateSpriteAtEnd(gFieldEffectObjectTemplatePointers[FLDEFFOBJ_SHORT_GRASS], 0, 0, 0);
if (spriteId != MAX_SPRITES)
{
- sprite = &(gSprites[spriteId]);
+ struct Sprite *sprite = &(gSprites[spriteId]);
sprite->coordOffsetEnabled = TRUE;
sprite->oam.priority = gSprites[objectEvent->spriteId].oam.priority;
- sprite->data[0] = gFieldEffectArguments[0];
- sprite->data[1] = gFieldEffectArguments[1];
- sprite->data[2] = gFieldEffectArguments[2];
- sprite->data[3] = gSprites[objectEvent->spriteId].x;
- sprite->data[4] = gSprites[objectEvent->spriteId].y;
+ sprite->sLocalId = gFieldEffectArguments[0];
+ sprite->sMapNum = gFieldEffectArguments[1];
+ sprite->sMapGroup = gFieldEffectArguments[2];
+ sprite->sPrevX = gSprites[objectEvent->spriteId].x;
+ sprite->sPrevY = gSprites[objectEvent->spriteId].y;
}
return 0;
}
@@ -626,32 +620,28 @@ u32 FldEff_ShortGrass(void)
void UpdateShortGrassFieldEffect(struct Sprite *sprite)
{
u8 objectEventId;
- s16 x;
- s16 y;
- const struct ObjectEventGraphicsInfo *graphicsInfo;
- struct Sprite *linkedSprite;
- if (TryGetObjectEventIdByLocalIdAndMap(sprite->data[0], sprite->data[1], sprite->data[2], &objectEventId) || !gObjectEvents[objectEventId].inShortGrass)
+ if (TryGetObjectEventIdByLocalIdAndMap(sprite->sLocalId, sprite->sMapNum, sprite->sMapGroup, &objectEventId) || !gObjectEvents[objectEventId].inShortGrass)
{
FieldEffectStop(sprite, FLDEFF_SHORT_GRASS);
}
else
{
- graphicsInfo = GetObjectEventGraphicsInfo(gObjectEvents[objectEventId].graphicsId);
- linkedSprite = &gSprites[gObjectEvents[objectEventId].spriteId];
- y = linkedSprite->y;
- x = linkedSprite->x;
- if (x != sprite->data[3] || y != sprite->data[4])
+ const struct ObjectEventGraphicsInfo *graphicsInfo = GetObjectEventGraphicsInfo(gObjectEvents[objectEventId].graphicsId);
+ struct Sprite *linkedSprite = &gSprites[gObjectEvents[objectEventId].spriteId];
+ s16 parentY = linkedSprite->y;
+ s16 parentX = linkedSprite->x;
+ if (parentX != sprite->sPrevX || parentY != sprite->sPrevY)
{
- sprite->data[3] = x;
- sprite->data[4] = y;
+ // Parent sprite moved, try to restart the animation
+ sprite->sPrevX = parentX;
+ sprite->sPrevY = parentY;
if (sprite->animEnded)
- {
StartSpriteAnim(sprite, 0);
- }
}
- sprite->x = x;
- sprite->y = y;
+ sprite->x = parentX;
+ sprite->y = parentY;
+ // Offset the grass sprite halfway down the parent sprite.
sprite->y2 = (graphicsInfo->height >> 1) - 8;
sprite->subpriority = linkedSprite->subpriority - 1;
sprite->oam.priority = linkedSprite->oam.priority;
@@ -659,19 +649,29 @@ void UpdateShortGrassFieldEffect(struct Sprite *sprite)
}
}
+#undef sLocalId
+#undef sMapNum
+#undef sMapGroup
+#undef sPrevX
+#undef sPrevY
+
+// Sprite data for FLDEFF_SAND_FOOTPRINTS, FLDEFF_DEEP_SAND_FOOTPRINTS, and FLDEFF_BIKE_TIRE_TRACKS
+#define sState data[0]
+#define sTimer data[1]
+#define sFldEff data[7]
+
u32 FldEff_SandFootprints(void)
{
u8 spriteId;
- struct Sprite *sprite;
SetSpritePosToOffsetMapCoords((s16 *)&gFieldEffectArguments[0], (s16 *)&gFieldEffectArguments[1], 8, 8);
spriteId = CreateSpriteAtEnd(gFieldEffectObjectTemplatePointers[FLDEFFOBJ_SAND_FOOTPRINTS], gFieldEffectArguments[0], gFieldEffectArguments[1], gFieldEffectArguments[2]);
if (spriteId != MAX_SPRITES)
{
- sprite = &gSprites[spriteId];
+ struct Sprite *sprite = &gSprites[spriteId];
sprite->coordOffsetEnabled = TRUE;
sprite->oam.priority = gFieldEffectArguments[3];
- sprite->data[7] = FLDEFF_SAND_FOOTPRINTS;
+ sprite->sFldEff = FLDEFF_SAND_FOOTPRINTS;
StartSpriteAnim(sprite, gFieldEffectArguments[4]);
}
return 0;
@@ -680,16 +680,15 @@ u32 FldEff_SandFootprints(void)
u32 FldEff_DeepSandFootprints(void)
{
u8 spriteId;
- struct Sprite *sprite;
SetSpritePosToOffsetMapCoords((s16 *)&gFieldEffectArguments[0], (s16 *)&gFieldEffectArguments[1], 8, 8);
spriteId = CreateSpriteAtEnd(gFieldEffectObjectTemplatePointers[FLDEFFOBJ_DEEP_SAND_FOOTPRINTS], gFieldEffectArguments[0], gFieldEffectArguments[1], gFieldEffectArguments[2]);
if (spriteId != MAX_SPRITES)
{
- sprite = &gSprites[spriteId];
+ struct Sprite *sprite = &gSprites[spriteId];
sprite->coordOffsetEnabled = TRUE;
sprite->oam.priority = gFieldEffectArguments[3];
- sprite->data[7] = FLDEFF_DEEP_SAND_FOOTPRINTS;
+ sprite->sFldEff = FLDEFF_DEEP_SAND_FOOTPRINTS;
StartSpriteAnim(sprite, gFieldEffectArguments[4]);
}
return spriteId;
@@ -734,16 +733,15 @@ u32 FldEff_TracksSpot(void)
u32 FldEff_BikeTireTracks(void)
{
u8 spriteId;
- struct Sprite *sprite;
SetSpritePosToOffsetMapCoords((s16 *)&gFieldEffectArguments[0], (s16 *)&gFieldEffectArguments[1], 8, 8);
spriteId = CreateSpriteAtEnd(gFieldEffectObjectTemplatePointers[FLDEFFOBJ_BIKE_TIRE_TRACKS], gFieldEffectArguments[0], gFieldEffectArguments[1], gFieldEffectArguments[2]);
if (spriteId != MAX_SPRITES)
{
- sprite = &gSprites[spriteId];
+ struct Sprite *sprite = &gSprites[spriteId];
sprite->coordOffsetEnabled = TRUE;
sprite->oam.priority = gFieldEffectArguments[3];
- sprite->data[7] = FLDEFF_BIKE_TIRE_TRACKS;
+ sprite->sFldEff = FLDEFF_BIKE_TIRE_TRACKS;
StartSpriteAnim(sprite, gFieldEffectArguments[4]);
}
return spriteId;
@@ -774,14 +772,14 @@ void (*const gFadeFootprintsTireTracksFuncs[])(struct Sprite *) = {
void UpdateFootprintsTireTracksFieldEffect(struct Sprite *sprite)
{
- gFadeFootprintsTireTracksFuncs[sprite->data[0]](sprite);
+ gFadeFootprintsTireTracksFuncs[sprite->sState](sprite);
}
static void FadeFootprintsTireTracks_Step0(struct Sprite *sprite)
{
// Wait 40 frames before the flickering starts.
- if (++sprite->data[1] > 40)
- sprite->data[0] = 1;
+ if (++sprite->sTimer > 40)
+ sprite->sState = 1;
UpdateObjectEventSpriteInvisibility(sprite, FALSE);
}
@@ -789,36 +787,37 @@ static void FadeFootprintsTireTracks_Step0(struct Sprite *sprite)
static void FadeFootprintsTireTracks_Step1(struct Sprite *sprite)
{
sprite->invisible ^= 1;
- sprite->data[1]++;
+ sprite->sTimer++;
UpdateObjectEventSpriteInvisibility(sprite, sprite->invisible);
- if (sprite->data[1] > 56)
- {
- FieldEffectStop(sprite, sprite->data[7]);
- }
+ if (sprite->sTimer > 56)
+ FieldEffectStop(sprite, sprite->sFldEff);
}
+#undef sState
+#undef sTimer
+#undef sFldEff
+
+// Sprite data for FLDEFF_SPLASH
+#define sLocalId data[0]
+#define sMapNum data[1]
+#define sMapGroup data[2]
+
u32 FldEff_Splash(void)
{
- u8 objectEventId;
- struct ObjectEvent *objectEvent;
- u8 spriteId;
- struct Sprite *sprite;
- const struct ObjectEventGraphicsInfo *graphicsInfo;
- struct Sprite *linkedSprite;
-
- objectEventId = GetObjectEventIdByLocalIdAndMap(gFieldEffectArguments[0], gFieldEffectArguments[1], gFieldEffectArguments[2]);
- objectEvent = &gObjectEvents[objectEventId];
- spriteId = CreateSpriteAtEnd(gFieldEffectObjectTemplatePointers[FLDEFFOBJ_SPLASH], 0, 0, 0);
+ u8 objectEventId = GetObjectEventIdByLocalIdAndMap(gFieldEffectArguments[0], gFieldEffectArguments[1], gFieldEffectArguments[2]);
+ struct ObjectEvent *objectEvent = &gObjectEvents[objectEventId];
+ u8 spriteId = CreateSpriteAtEnd(gFieldEffectObjectTemplatePointers[FLDEFFOBJ_SPLASH], 0, 0, 0);
if (spriteId != MAX_SPRITES)
{
- graphicsInfo = GetObjectEventGraphicsInfo(objectEvent->graphicsId);
- sprite = &gSprites[spriteId];
+ struct Sprite *linkedSprite;
+ const struct ObjectEventGraphicsInfo *graphicsInfo = GetObjectEventGraphicsInfo(objectEvent->graphicsId);
+ struct Sprite *sprite = &gSprites[spriteId];
sprite->coordOffsetEnabled = TRUE;
linkedSprite = &gSprites[objectEvent->spriteId];
sprite->oam.priority = linkedSprite->oam.priority;
- sprite->data[0] = gFieldEffectArguments[0];
- sprite->data[1] = gFieldEffectArguments[1];
- sprite->data[2] = gFieldEffectArguments[2];
+ sprite->sLocalId = gFieldEffectArguments[0];
+ sprite->sMapNum = gFieldEffectArguments[1];
+ sprite->sMapGroup = gFieldEffectArguments[2];
sprite->y2 = (graphicsInfo->height >> 1) - 4;
PlaySE(SE_PUDDLE);
}
@@ -829,7 +828,7 @@ void UpdateSplashFieldEffect(struct Sprite *sprite)
{
u8 objectEventId;
- if (sprite->animEnded || TryGetObjectEventIdByLocalIdAndMap(sprite->data[0], sprite->data[1], sprite->data[2], &objectEventId))
+ if (sprite->animEnded || TryGetObjectEventIdByLocalIdAndMap(sprite->sLocalId, sprite->sMapNum, sprite->sMapGroup, &objectEventId))
{
FieldEffectStop(sprite, FLDEFF_SPLASH);
}
@@ -841,20 +840,23 @@ void UpdateSplashFieldEffect(struct Sprite *sprite)
}
}
+#undef sLocalId
+#undef sMapNum
+#undef sMapGroup
+
u32 FldEff_JumpSmallSplash(void)
{
u8 spriteId;
- struct Sprite *sprite;
SetSpritePosToOffsetMapCoords((s16 *)&gFieldEffectArguments[0], (s16 *)&gFieldEffectArguments[1], 8, 12);
spriteId = CreateSpriteAtEnd(gFieldEffectObjectTemplatePointers[FLDEFFOBJ_JUMP_SMALL_SPLASH], gFieldEffectArguments[0], gFieldEffectArguments[1], 0);
if (spriteId != MAX_SPRITES)
{
- sprite = &gSprites[spriteId];
+ struct Sprite *sprite = &gSprites[spriteId];
sprite->coordOffsetEnabled = TRUE;
sprite->oam.priority = gFieldEffectArguments[3];
- sprite->data[0] = gFieldEffectArguments[2];
- sprite->data[1] = FLDEFF_JUMP_SMALL_SPLASH;
+ sprite->sJumpElevation = gFieldEffectArguments[2];
+ sprite->sJumpFldEff = FLDEFF_JUMP_SMALL_SPLASH;
}
return 0;
}
@@ -862,44 +864,44 @@ u32 FldEff_JumpSmallSplash(void)
u32 FldEff_JumpBigSplash(void)
{
u8 spriteId;
- struct Sprite *sprite;
SetSpritePosToOffsetMapCoords((s16 *)&gFieldEffectArguments[0], (s16 *)&gFieldEffectArguments[1], 8, 8);
spriteId = CreateSpriteAtEnd(gFieldEffectObjectTemplatePointers[FLDEFFOBJ_JUMP_BIG_SPLASH], gFieldEffectArguments[0], gFieldEffectArguments[1], 0);
if (spriteId != MAX_SPRITES)
{
- sprite = &gSprites[spriteId];
+ struct Sprite *sprite = &gSprites[spriteId];
sprite->coordOffsetEnabled = TRUE;
sprite->oam.priority = gFieldEffectArguments[3];
- sprite->data[0] = gFieldEffectArguments[2];
- sprite->data[1] = FLDEFF_JUMP_BIG_SPLASH;
+ sprite->sJumpElevation = gFieldEffectArguments[2];
+ sprite->sJumpFldEff = FLDEFF_JUMP_BIG_SPLASH;
}
return 0;
}
+// Sprite data for FLDEFF_FEET_IN_FLOWING_WATER
+#define sLocalId data[0]
+#define sMapNum data[1]
+#define sMapGroup data[2]
+#define sPrevX data[3]
+#define sPrevY data[4]
+
u32 FldEff_FeetInFlowingWater(void)
{
- u8 objectEventId;
- struct ObjectEvent *objectEvent;
- u8 spriteId;
- struct Sprite *sprite;
- const struct ObjectEventGraphicsInfo *graphicsInfo;
-
- objectEventId = GetObjectEventIdByLocalIdAndMap(gFieldEffectArguments[0], gFieldEffectArguments[1], gFieldEffectArguments[2]);
- objectEvent = &gObjectEvents[objectEventId];
- spriteId = CreateSpriteAtEnd(gFieldEffectObjectTemplatePointers[FLDEFFOBJ_SPLASH], 0, 0, 0);
+ u8 objectEventId = GetObjectEventIdByLocalIdAndMap(gFieldEffectArguments[0], gFieldEffectArguments[1], gFieldEffectArguments[2]);
+ struct ObjectEvent *objectEvent = &gObjectEvents[objectEventId];
+ u8 spriteId = CreateSpriteAtEnd(gFieldEffectObjectTemplatePointers[FLDEFFOBJ_SPLASH], 0, 0, 0);
if (spriteId != MAX_SPRITES)
{
- graphicsInfo = GetObjectEventGraphicsInfo(objectEvent->graphicsId);
- sprite = &gSprites[spriteId];
+ const struct ObjectEventGraphicsInfo *graphicsInfo = GetObjectEventGraphicsInfo(objectEvent->graphicsId);
+ struct Sprite *sprite = &gSprites[spriteId];
sprite->callback = UpdateFeetInFlowingWaterFieldEffect;
sprite->coordOffsetEnabled = TRUE;
sprite->oam.priority = gSprites[objectEvent->spriteId].oam.priority;
- sprite->data[0] = gFieldEffectArguments[0];
- sprite->data[1] = gFieldEffectArguments[1];
- sprite->data[2] = gFieldEffectArguments[2];
- sprite->data[3] = -1;
- sprite->data[4] = -1;
+ sprite->sLocalId = gFieldEffectArguments[0];
+ sprite->sMapNum = gFieldEffectArguments[1];
+ sprite->sMapGroup = gFieldEffectArguments[2];
+ sprite->sPrevX = -1;
+ sprite->sPrevY = -1;
sprite->y2 = (graphicsInfo->height >> 1) - 4;
StartSpriteAnim(sprite, 1);
}
@@ -909,69 +911,70 @@ u32 FldEff_FeetInFlowingWater(void)
static void UpdateFeetInFlowingWaterFieldEffect(struct Sprite *sprite)
{
u8 objectEventId;
- struct Sprite *linkedSprite;
- struct ObjectEvent *objectEvent;
- if (TryGetObjectEventIdByLocalIdAndMap(sprite->data[0], sprite->data[1], sprite->data[2], &objectEventId) || !gObjectEvents[objectEventId].inShallowFlowingWater)
+ if (TryGetObjectEventIdByLocalIdAndMap(sprite->sLocalId, sprite->sMapNum, sprite->sMapGroup, &objectEventId) || !gObjectEvents[objectEventId].inShallowFlowingWater)
{
FieldEffectStop(sprite, FLDEFF_FEET_IN_FLOWING_WATER);
}
else
{
- objectEvent = &gObjectEvents[objectEventId];
- linkedSprite = &gSprites[objectEvent->spriteId];
+ struct ObjectEvent *objectEvent = &gObjectEvents[objectEventId];
+ struct Sprite *linkedSprite = &gSprites[objectEvent->spriteId];
sprite->x = linkedSprite->x;
sprite->y = linkedSprite->y;
sprite->subpriority = linkedSprite->subpriority;
UpdateObjectEventSpriteInvisibility(sprite, FALSE);
- if (objectEvent->currentCoords.x != sprite->data[3] || objectEvent->currentCoords.y != sprite->data[4])
+ if (objectEvent->currentCoords.x != sprite->sPrevX || objectEvent->currentCoords.y != sprite->sPrevY)
{
- sprite->data[3] = objectEvent->currentCoords.x;
- sprite->data[4] = objectEvent->currentCoords.y;
+ sprite->sPrevX = objectEvent->currentCoords.x;
+ sprite->sPrevY = objectEvent->currentCoords.y;
if (!sprite->invisible)
- {
PlaySE(SE_PUDDLE);
- }
}
}
}
+#undef sLocalId
+#undef sMapNum
+#undef sMapGroup
+#undef sPrevX
+#undef sPrevY
+
u32 FldEff_Ripple(void)
{
- u8 spriteId;
- struct Sprite *sprite;
-
- spriteId = CreateSpriteAtEnd(gFieldEffectObjectTemplatePointers[FLDEFFOBJ_RIPPLE], gFieldEffectArguments[0], gFieldEffectArguments[1], gFieldEffectArguments[2]);
+ u8 spriteId = CreateSpriteAtEnd(gFieldEffectObjectTemplatePointers[FLDEFFOBJ_RIPPLE], gFieldEffectArguments[0], gFieldEffectArguments[1], gFieldEffectArguments[2]);
if (spriteId != MAX_SPRITES)
{
- sprite = &gSprites[spriteId];
+ struct Sprite *sprite = &gSprites[spriteId];
sprite->coordOffsetEnabled = TRUE;
sprite->oam.priority = gFieldEffectArguments[3];
- sprite->data[0] = FLDEFF_RIPPLE;
+ sprite->sWaitFldEff = FLDEFF_RIPPLE;
}
return 0;
}
+// Sprite data for FLDEFF_HOT_SPRINGS_WATER
+#define sLocalId data[0]
+#define sMapNum data[1]
+#define sMapGroup data[2]
+#define sPrevX data[3]
+#define sPrevY data[4]
+
u32 FldEff_HotSpringsWater(void)
{
- u8 objectEventId;
- struct ObjectEvent *objectEvent;
- u8 spriteId;
- struct Sprite *sprite;
-
- objectEventId = GetObjectEventIdByLocalIdAndMap(gFieldEffectArguments[0], gFieldEffectArguments[1], gFieldEffectArguments[2]);
- objectEvent = &gObjectEvents[objectEventId];
- spriteId = CreateSpriteAtEnd(gFieldEffectObjectTemplatePointers[FLDEFFOBJ_HOT_SPRINGS_WATER], 0, 0, 0);
+ u8 objectEventId = GetObjectEventIdByLocalIdAndMap(gFieldEffectArguments[0], gFieldEffectArguments[1], gFieldEffectArguments[2]);
+ struct ObjectEvent *objectEvent = &gObjectEvents[objectEventId];
+ u8 spriteId = CreateSpriteAtEnd(gFieldEffectObjectTemplatePointers[FLDEFFOBJ_HOT_SPRINGS_WATER], 0, 0, 0);
if (spriteId != MAX_SPRITES)
{
- sprite = &gSprites[spriteId];
+ struct Sprite *sprite = &gSprites[spriteId];
sprite->coordOffsetEnabled = TRUE;
sprite->oam.priority = gSprites[objectEvent->spriteId].oam.priority;
- sprite->data[0] = gFieldEffectArguments[0];
- sprite->data[1] = gFieldEffectArguments[1];
- sprite->data[2] = gFieldEffectArguments[2];
- sprite->data[3] = gSprites[objectEvent->spriteId].x;
- sprite->data[4] = gSprites[objectEvent->spriteId].y;
+ sprite->sLocalId = gFieldEffectArguments[0];
+ sprite->sMapNum = gFieldEffectArguments[1];
+ sprite->sMapGroup = gFieldEffectArguments[2];
+ sprite->sPrevX = gSprites[objectEvent->spriteId].x; // Unused
+ sprite->sPrevY = gSprites[objectEvent->spriteId].y; // Unused
}
return 0;
}
@@ -979,17 +982,15 @@ u32 FldEff_HotSpringsWater(void)
void UpdateHotSpringsWaterFieldEffect(struct Sprite *sprite)
{
u8 objectEventId;
- const struct ObjectEventGraphicsInfo *graphicsInfo;
- struct Sprite *linkedSprite;
- if (TryGetObjectEventIdByLocalIdAndMap(sprite->data[0], sprite->data[1], sprite->data[2], &objectEventId) || !gObjectEvents[objectEventId].inHotSprings)
+ if (TryGetObjectEventIdByLocalIdAndMap(sprite->sLocalId, sprite->sMapNum, sprite->sMapGroup, &objectEventId) || !gObjectEvents[objectEventId].inHotSprings)
{
FieldEffectStop(sprite, FLDEFF_HOT_SPRINGS_WATER);
}
else
{
- graphicsInfo = GetObjectEventGraphicsInfo(gObjectEvents[objectEventId].graphicsId);
- linkedSprite = &gSprites[gObjectEvents[objectEventId].spriteId];
+ const struct ObjectEventGraphicsInfo *graphicsInfo = GetObjectEventGraphicsInfo(gObjectEvents[objectEventId].graphicsId);
+ struct Sprite *linkedSprite = &gSprites[gObjectEvents[objectEventId].spriteId];
sprite->x = linkedSprite->x;
sprite->y = (graphicsInfo->height >> 1) + linkedSprite->y - 8;
sprite->subpriority = linkedSprite->subpriority - 1;
@@ -997,19 +998,24 @@ void UpdateHotSpringsWaterFieldEffect(struct Sprite *sprite)
}
}
+#undef sLocalId
+#undef sMapNum
+#undef sMapGroup
+#undef sPrevX
+#undef sPrevY
+
u32 FldEff_UnusedGrass(void)
{
u8 spriteId;
- struct Sprite *sprite;
SetSpritePosToOffsetMapCoords((s16 *)&gFieldEffectArguments[0], (s16 *)&gFieldEffectArguments[1], 8, 8);
spriteId = CreateSpriteAtEnd(gFieldEffectObjectTemplatePointers[FLDEFFOBJ_UNUSED_GRASS], gFieldEffectArguments[0], gFieldEffectArguments[1], gFieldEffectArguments[2]);
if (spriteId != MAX_SPRITES)
{
- sprite = &gSprites[spriteId];
+ struct Sprite *sprite = &gSprites[spriteId];
sprite->coordOffsetEnabled = TRUE;
sprite->oam.priority = gFieldEffectArguments[3];
- sprite->data[0] = FLDEFF_UNUSED_GRASS;
+ sprite->sWaitFldEff = FLDEFF_UNUSED_GRASS;
}
return 0;
}
@@ -1017,16 +1023,15 @@ u32 FldEff_UnusedGrass(void)
u32 FldEff_UnusedGrass2(void)
{
u8 spriteId;
- struct Sprite *sprite;
SetSpritePosToOffsetMapCoords((s16 *)&gFieldEffectArguments[0], (s16 *)&gFieldEffectArguments[1], 8, 8);
spriteId = CreateSpriteAtEnd(gFieldEffectObjectTemplatePointers[FLDEFFOBJ_UNUSED_GRASS_2], gFieldEffectArguments[0], gFieldEffectArguments[1], gFieldEffectArguments[2]);
if (spriteId != MAX_SPRITES)
{
- sprite = &gSprites[spriteId];
+ struct Sprite *sprite = &gSprites[spriteId];
sprite->coordOffsetEnabled = TRUE;
sprite->oam.priority = gFieldEffectArguments[3];
- sprite->data[0] = FLDEFF_UNUSED_GRASS_2;
+ sprite->sWaitFldEff = FLDEFF_UNUSED_GRASS_2;
}
return 0;
}
@@ -1034,16 +1039,15 @@ u32 FldEff_UnusedGrass2(void)
u32 FldEff_UnusedSand(void)
{
u8 spriteId;
- struct Sprite *sprite;
SetSpritePosToOffsetMapCoords((s16 *)&gFieldEffectArguments[0], (s16 *)&gFieldEffectArguments[1], 8, 8);
spriteId = CreateSpriteAtEnd(gFieldEffectObjectTemplatePointers[FLDEFFOBJ_UNUSED_SAND], gFieldEffectArguments[0], gFieldEffectArguments[1], gFieldEffectArguments[2]);
if (spriteId != MAX_SPRITES)
{
- sprite = &gSprites[spriteId];
+ struct Sprite *sprite = &gSprites[spriteId];
sprite->coordOffsetEnabled = TRUE;
sprite->oam.priority = gFieldEffectArguments[3];
- sprite->data[0] = FLDEFF_UNUSED_SAND;
+ sprite->sWaitFldEff = FLDEFF_UNUSED_SAND;
}
return 0;
}
@@ -1051,16 +1055,15 @@ u32 FldEff_UnusedSand(void)
u32 FldEff_WaterSurfacing(void)
{
u8 spriteId;
- struct Sprite *sprite;
SetSpritePosToOffsetMapCoords((s16 *)&gFieldEffectArguments[0], (s16 *)&gFieldEffectArguments[1], 8, 8);
spriteId = CreateSpriteAtEnd(gFieldEffectObjectTemplatePointers[FLDEFFOBJ_WATER_SURFACING], gFieldEffectArguments[0], gFieldEffectArguments[1], gFieldEffectArguments[2]);
if (spriteId != MAX_SPRITES)
{
- sprite = &gSprites[spriteId];
+ struct Sprite *sprite = &gSprites[spriteId];
sprite->coordOffsetEnabled = TRUE;
sprite->oam.priority = gFieldEffectArguments[3];
- sprite->data[0] = FLDEFF_WATER_SURFACING;
+ sprite->sWaitFldEff = FLDEFF_WATER_SURFACING;
}
return 0;
}
@@ -1085,18 +1088,15 @@ void StartAshFieldEffect(s16 x, s16 y, u16 metatileId, s16 delay)
u32 FldEff_Ash(void)
{
- s16 x;
- s16 y;
u8 spriteId;
- struct Sprite *sprite;
- x = gFieldEffectArguments[0];
- y = gFieldEffectArguments[1];
+ s16 x = gFieldEffectArguments[0];
+ s16 y = gFieldEffectArguments[1];
SetSpritePosToOffsetMapCoords(&x, &y, 8, 8);
spriteId = CreateSpriteAtEnd(gFieldEffectObjectTemplatePointers[FLDEFFOBJ_ASH], x, y, gFieldEffectArguments[2]);
if (spriteId != MAX_SPRITES)
{
- sprite = &gSprites[spriteId];
+ struct Sprite *sprite = &gSprites[spriteId];
sprite->coordOffsetEnabled = TRUE;
sprite->oam.priority = gFieldEffectArguments[3];
sprite->sX = gFieldEffectArguments[0];
@@ -1150,28 +1150,31 @@ static void UpdateAshFieldEffect_End(struct Sprite *sprite)
#undef sDelay
// Sprite data for FLDEFF_SURF_BLOB
-#define tBitfield data[0]
-#define tPlayerOffset data[1]
-#define tPlayerObjId data[2]
-
+#define sBitfield data[0]
+#define sPlayerOffset data[1]
+#define sPlayerObjId data[2]
+#define sVelocity data[3]
+#define sTimer data[4]
+#define sIntervalIdx data[5]
+#define sPrevX data[6]
+#define sPrevY data[7]
u32 FldEff_SurfBlob(void)
{
u8 spriteId;
- struct Sprite *sprite;
SetSpritePosToOffsetMapCoords((s16 *)&gFieldEffectArguments[0], (s16 *)&gFieldEffectArguments[1], 8, 8);
- spriteId = CreateSpriteAtEnd(gFieldEffectObjectTemplatePointers[FLDEFFOBJ_SURF_BLOB], gFieldEffectArguments[0], gFieldEffectArguments[1], 0x96);
+ spriteId = CreateSpriteAtEnd(gFieldEffectObjectTemplatePointers[FLDEFFOBJ_SURF_BLOB], gFieldEffectArguments[0], gFieldEffectArguments[1], 150);
if (spriteId != MAX_SPRITES)
{
- sprite = &gSprites[spriteId];
+ struct Sprite *sprite = &gSprites[spriteId];
sprite->coordOffsetEnabled = TRUE;
- sprite->tPlayerObjId = gFieldEffectArguments[2];
+ sprite->sPlayerObjId = gFieldEffectArguments[2];
// Can use either gender's palette, so try to use the one that should be loaded
sprite->oam.paletteNum = LoadObjectEventPalette(gSaveBlock2Ptr->playerGender ? FLDEFF_PAL_TAG_MAY : FLDEFF_PAL_TAG_BRENDAN);
- sprite->data[3] = -1;
- sprite->data[6] = -1;
- sprite->data[7] = -1;
+ sprite->sVelocity = -1;
+ sprite->sPrevX = -1;
+ sprite->sPrevY = -1;
}
FieldEffectActiveListRemove(FLDEFF_SURF_BLOB);
return spriteId;
@@ -1180,43 +1183,40 @@ u32 FldEff_SurfBlob(void)
void SetSurfBlob_BobState(u8 spriteId, u8 state)
{
- gSprites[spriteId].data[0] = (gSprites[spriteId].data[0] & ~0xF) | (state & 0xF);
+ gSprites[spriteId].sBitfield = (gSprites[spriteId].sBitfield & ~0xF) | (state & 0xF);
}
void SetSurfBlob_DontSyncAnim(u8 spriteId, bool8 dontSync)
{
- gSprites[spriteId].data[0] = (gSprites[spriteId].data[0] & ~0xF0) | ((dontSync & 0xF) << 4);
+ gSprites[spriteId].sBitfield = (gSprites[spriteId].sBitfield & ~0xF0) | ((dontSync & 0xF) << 4);
}
void SetSurfBlob_PlayerOffset(u8 spriteId, bool8 hasOffset, s16 offset)
{
- gSprites[spriteId].data[0] = (gSprites[spriteId].data[0] & ~0xF00) | ((hasOffset & 0xF) << 8);
- gSprites[spriteId].tPlayerOffset = offset;
+ gSprites[spriteId].sBitfield = (gSprites[spriteId].sBitfield & ~0xF00) | ((hasOffset & 0xF) << 8);
+ gSprites[spriteId].sPlayerOffset = offset;
}
static u8 GetSurfBlob_BobState(struct Sprite *sprite)
{
- return sprite->data[0] & 0xF;
+ return sprite->sBitfield & 0xF;
}
// Never TRUE
static u8 GetSurfBlob_DontSyncAnim(struct Sprite *sprite)
{
- return (sprite->data[0] & 0xF0) >> 4;
+ return (sprite->sBitfield & 0xF0) >> 4;
}
static u8 GetSurfBlob_HasPlayerOffset(struct Sprite *sprite)
{
- return (sprite->data[0] & 0xF00) >> 8;
+ return (sprite->sBitfield & 0xF00) >> 8;
}
void UpdateSurfBlobFieldEffect(struct Sprite *sprite)
{
- struct ObjectEvent *playerObj;
- struct Sprite *playerSprite;
-
- playerObj = &gObjectEvents[sprite->tPlayerObjId];
- playerSprite = &gSprites[playerObj->spriteId];
+ struct ObjectEvent *playerObj = &gObjectEvents[sprite->sPlayerObjId];
+ struct Sprite *playerSprite = &gSprites[playerObj->spriteId];
SynchroniseSurfAnim(playerObj, sprite);
SynchroniseSurfPosition(playerObj, sprite);
UpdateBobbingEffect(playerObj, playerSprite, sprite);
@@ -1249,17 +1249,19 @@ void SynchroniseSurfPosition(struct ObjectEvent *playerObj, struct Sprite *sprit
s16 y = playerObj->currentCoords.y;
s32 spriteY = sprite->y2;
- if (spriteY == 0 && (x != sprite->data[6] || y != sprite->data[7]))
+ if (spriteY == 0 && (x != sprite->sPrevX || y != sprite->sPrevY))
{
- sprite->data[5] = spriteY;
- sprite->data[6] = x;
- sprite->data[7] = y;
- for (i = DIR_SOUTH; i <= DIR_EAST; i++, x = sprite->data[6], y = sprite->data[7])
+ // Player is moving while surfing, update position.
+ sprite->sIntervalIdx = 0;
+ sprite->sPrevX = x;
+ sprite->sPrevY = y;
+ for (i = DIR_SOUTH; i <= DIR_EAST; i++, x = sprite->sPrevX, y = sprite->sPrevY)
{
MoveCoords(i, &x, &y);
if (MapGridGetElevationAt(x, y) == 3)
{
- sprite->data[5]++;
+ // While dismounting the surf blob bobs at a slower rate
+ sprite->sIntervalIdx++;
break;
}
}
@@ -1268,46 +1270,54 @@ void SynchroniseSurfPosition(struct ObjectEvent *playerObj, struct Sprite *sprit
static void UpdateBobbingEffect(struct ObjectEvent *playerObj, struct Sprite *playerSprite, struct Sprite *sprite)
{
- u16 intervals[] = {3, 7};
+ // The frame interval at which to update the blob's y movement.
+ // Normally every 4th frame, but every 8th frame while dismounting.
+ u16 intervals[] = {0x3, 0x7};
+
u8 bobState = GetSurfBlob_BobState(sprite);
if (bobState != BOB_NONE)
{
- // Update bobbing position of surf blob
- if (((u16)(++sprite->data[4]) & intervals[sprite->data[5]]) == 0)
- {
- sprite->y2 += sprite->data[3];
- }
- if ((sprite->data[4] & 15) == 0)
- {
- sprite->data[3] = -sprite->data[3];
- }
+ // Update vertical position of surf blob
+ if (((u16)(++sprite->sTimer) & intervals[sprite->sIntervalIdx]) == 0)
+ sprite->y2 += sprite->sVelocity;
+
+ // Reverse bob direction
+ if ((sprite->sTimer & 15) == 0)
+ sprite->sVelocity = -sprite->sVelocity;
+
if (bobState != BOB_JUST_MON)
{
- // Update bobbing position of player
+ // Update vertical position of player
if (!GetSurfBlob_HasPlayerOffset(sprite))
playerSprite->y2 = sprite->y2;
else
- playerSprite->y2 = sprite->tPlayerOffset + sprite->y2;
+ playerSprite->y2 = sprite->sPlayerOffset + sprite->y2;
sprite->x = playerSprite->x;
sprite->y = playerSprite->y + 8;
}
}
}
+#undef sBitfield
+#undef sPlayerOffset
+#undef sPlayerObjId
+#undef sVelocity
+#undef sTimer
+#undef sIntervalIdx
+#undef sPrevX
+#undef sPrevY
+
#define sSpriteId data[0]
#define sBobY data[1]
#define sTimer data[2]
u8 StartUnderwaterSurfBlobBobbing(u8 blobSpriteId)
{
- u8 spriteId;
- struct Sprite *sprite;
-
// Create a dummy sprite with its own callback
// that tracks the actual surf blob sprite and
// makes it bob up and down underwater
- spriteId = CreateSpriteAtEnd(&gDummySpriteTemplate, 0, 0, -1);
- sprite = &gSprites[spriteId];
+ u8 spriteId = CreateSpriteAtEnd(&gDummySpriteTemplate, 0, 0, -1);
+ struct Sprite *sprite = &gSprites[spriteId];
sprite->callback = SpriteCB_UnderwaterSurfBlob;
sprite->invisible = TRUE;
sprite->sSpriteId = blobSpriteId;
@@ -1317,17 +1327,14 @@ u8 StartUnderwaterSurfBlobBobbing(u8 blobSpriteId)
static void SpriteCB_UnderwaterSurfBlob(struct Sprite *sprite)
{
- struct Sprite *blobSprite;
+ struct Sprite *blobSprite = &gSprites[sprite->sSpriteId];
- blobSprite = &gSprites[sprite->sSpriteId];
+ // Update vertical position of surf blob
if (((sprite->sTimer++) & 3) == 0)
- {
blobSprite->y2 += sprite->sBobY;
- }
+ // Reverse direction
if ((sprite->sTimer & 15) == 0)
- {
sprite->sBobY = -sprite->sBobY;
- }
}
#undef sSpriteId
@@ -1337,43 +1344,43 @@ static void SpriteCB_UnderwaterSurfBlob(struct Sprite *sprite)
u32 FldEff_Dust(void)
{
u8 spriteId;
- struct Sprite *sprite;
SetSpritePosToOffsetMapCoords((s16 *)&gFieldEffectArguments[0], (s16 *)&gFieldEffectArguments[1], 8, 12);
spriteId = CreateSpriteAtEnd(gFieldEffectObjectTemplatePointers[FLDEFFOBJ_GROUND_IMPACT_DUST], gFieldEffectArguments[0], gFieldEffectArguments[1], 0);
if (spriteId != MAX_SPRITES)
{
- sprite = &gSprites[spriteId];
+ struct Sprite *sprite = &gSprites[spriteId];
sprite->coordOffsetEnabled = TRUE;
sprite->oam.priority = gFieldEffectArguments[3];
- sprite->data[0] = gFieldEffectArguments[2];
- sprite->data[1] = FLDEFF_DUST;
+ sprite->sJumpElevation = gFieldEffectArguments[2];
+ sprite->sJumpFldEff = FLDEFF_DUST;
}
return 0;
}
+// Sprite data for FLDEFF_SAND_PILE
+#define sLocalId data[0]
+#define sMapNum data[1]
+#define sMapGroup data[2]
+#define sPrevX data[3]
+#define sPrevY data[4]
+
u32 FldEff_SandPile(void)
{
- u8 objectEventId;
- struct ObjectEvent *objectEvent;
- u8 spriteId;
- struct Sprite *sprite;
- const struct ObjectEventGraphicsInfo *graphicsInfo;
-
- objectEventId = GetObjectEventIdByLocalIdAndMap(gFieldEffectArguments[0], gFieldEffectArguments[1], gFieldEffectArguments[2]);
- objectEvent = &gObjectEvents[objectEventId];
- spriteId = CreateSpriteAtEnd(gFieldEffectObjectTemplatePointers[FLDEFFOBJ_SAND_PILE], 0, 0, 0);
+ u8 objectEventId = GetObjectEventIdByLocalIdAndMap(gFieldEffectArguments[0], gFieldEffectArguments[1], gFieldEffectArguments[2]);
+ struct ObjectEvent *objectEvent = &gObjectEvents[objectEventId];
+ u8 spriteId = CreateSpriteAtEnd(gFieldEffectObjectTemplatePointers[FLDEFFOBJ_SAND_PILE], 0, 0, 0);
if (spriteId != MAX_SPRITES)
{
- graphicsInfo = GetObjectEventGraphicsInfo(objectEvent->graphicsId);
- sprite = &gSprites[spriteId];
+ const struct ObjectEventGraphicsInfo *graphicsInfo = GetObjectEventGraphicsInfo(objectEvent->graphicsId);
+ struct Sprite *sprite = &gSprites[spriteId];
sprite->coordOffsetEnabled = TRUE;
sprite->oam.priority = gSprites[objectEvent->spriteId].oam.priority;
- sprite->data[0] = gFieldEffectArguments[0];
- sprite->data[1] = gFieldEffectArguments[1];
- sprite->data[2] = gFieldEffectArguments[2];
- sprite->data[3] = gSprites[objectEvent->spriteId].x;
- sprite->data[4] = gSprites[objectEvent->spriteId].y;
+ sprite->sLocalId = gFieldEffectArguments[0];
+ sprite->sMapNum = gFieldEffectArguments[1];
+ sprite->sMapGroup = gFieldEffectArguments[2];
+ sprite->sPrevX = gSprites[objectEvent->spriteId].x;
+ sprite->sPrevY = gSprites[objectEvent->spriteId].y;
sprite->y2 = (graphicsInfo->height >> 1) - 2;
SeekSpriteAnim(sprite, 2);
}
@@ -1383,81 +1390,85 @@ u32 FldEff_SandPile(void)
void UpdateSandPileFieldEffect(struct Sprite *sprite)
{
u8 objectEventId;
- s16 x;
- s16 y;
- if (TryGetObjectEventIdByLocalIdAndMap(sprite->data[0], sprite->data[1], sprite->data[2], &objectEventId) || !gObjectEvents[objectEventId].inSandPile)
+ if (TryGetObjectEventIdByLocalIdAndMap(sprite->sLocalId, sprite->sMapNum, sprite->sMapGroup, &objectEventId) || !gObjectEvents[objectEventId].inSandPile)
{
FieldEffectStop(sprite, FLDEFF_SAND_PILE);
}
else
{
- y = gSprites[gObjectEvents[objectEventId].spriteId].y;
- x = gSprites[gObjectEvents[objectEventId].spriteId].x;
- if (x != sprite->data[3] || y != sprite->data[4])
+ s16 parentY = gSprites[gObjectEvents[objectEventId].spriteId].y;
+ s16 parentX = gSprites[gObjectEvents[objectEventId].spriteId].x;
+ if (parentX != sprite->sPrevX || parentY != sprite->sPrevY)
{
- sprite->data[3] = x;
- sprite->data[4] = y;
+ sprite->sPrevX = parentX;
+ sprite->sPrevY = parentY;
if (sprite->animEnded)
- {
StartSpriteAnim(sprite, 0);
- }
}
- sprite->x = x;
- sprite->y = y;
+ sprite->x = parentX;
+ sprite->y = parentY;
sprite->subpriority = gSprites[gObjectEvents[objectEventId].spriteId].subpriority;
UpdateObjectEventSpriteInvisibility(sprite, FALSE);
}
}
+#undef sLocalId
+#undef sMapNum
+#undef sMapGroup
+#undef sPrevX
+#undef sPrevY
+
u32 FldEff_Bubbles(void)
{
u8 spriteId;
- struct Sprite *sprite;
SetSpritePosToOffsetMapCoords((s16 *)&gFieldEffectArguments[0], (s16 *)&gFieldEffectArguments[1], 8, 0);
- spriteId = CreateSpriteAtEnd(gFieldEffectObjectTemplatePointers[FLDEFFOBJ_BUBBLES], gFieldEffectArguments[0], gFieldEffectArguments[1], 0x52);
+ spriteId = CreateSpriteAtEnd(gFieldEffectObjectTemplatePointers[FLDEFFOBJ_BUBBLES], gFieldEffectArguments[0], gFieldEffectArguments[1], 82);
if (spriteId != MAX_SPRITES)
{
- sprite = &gSprites[spriteId];
+ struct Sprite *sprite = &gSprites[spriteId];
sprite->coordOffsetEnabled = TRUE;
sprite->oam.priority = 1;
}
return 0;
}
+#define sY data[0]
+
void UpdateBubblesFieldEffect(struct Sprite *sprite)
{
- sprite->data[0] += 0x80;
- sprite->data[0] &= 0x100;
- sprite->y -= sprite->data[0] >> 8;
+ // Move up 1 every other frame.
+ sprite->sY += ((1 << 8) / 2);
+ sprite->sY &= (1 << 8);
+ sprite->y -= sprite->sY >> 8;
UpdateObjectEventSpriteInvisibility(sprite, FALSE);
if (sprite->invisible || sprite->animEnded)
- {
FieldEffectStop(sprite, FLDEFF_BUBBLES);
- }
}
+#undef sY
+
u32 FldEff_BerryTreeGrowthSparkle(void)
{
u8 spriteId;
- struct Sprite *sprite;
SetSpritePosToOffsetMapCoords((s16 *)&gFieldEffectArguments[0], (s16 *)&gFieldEffectArguments[1], 8, 4);
spriteId = CreateSpriteAtEnd(gFieldEffectObjectTemplatePointers[FLDEFFOBJ_SPARKLE], gFieldEffectArguments[0], gFieldEffectArguments[1], gFieldEffectArguments[2]);
if (spriteId != MAX_SPRITES)
{
- sprite = &gSprites[spriteId];
+ struct Sprite *sprite = &gSprites[spriteId];
sprite->coordOffsetEnabled = TRUE;
sprite->oam.priority = gFieldEffectArguments[3];
UpdateSpritePaletteByTemplate(gFieldEffectObjectTemplatePointers[FLDEFFOBJ_SPARKLE], sprite);
- sprite->data[0] = FLDEFF_BERRY_TREE_GROWTH_SPARKLE;
+ sprite->sWaitFldEff = FLDEFF_BERRY_TREE_GROWTH_SPARKLE;
}
return 0;
}
// Sprite data for FLDEFF_TREE_DISGUISE / FLDEFF_MOUNTAIN_DISGUISE / FLDEFF_SAND_DISGUISE
#define sState data[0]
+#define sFldEff data[1]
#define sLocalId data[2]
#define sMapNum data[3]
#define sMapGroup data[4]
@@ -1481,7 +1492,6 @@ u32 ShowSandDisguiseFieldEffect(void)
static u32 ShowDisguiseFieldEffect(u8 fldEff, u8 fldEffObj, u8 paletteNum)
{
u8 spriteId;
- struct Sprite *sprite;
if (TryGetObjectEventIdByLocalIdAndMap(gFieldEffectArguments[0], gFieldEffectArguments[1], gFieldEffectArguments[2], &spriteId))
{
@@ -1491,7 +1501,7 @@ static u32 ShowDisguiseFieldEffect(u8 fldEff, u8 fldEffObj, u8 paletteNum)
spriteId = CreateSpriteAtEnd(gFieldEffectObjectTemplatePointers[fldEffObj], 0, 0, 0);
if (spriteId != MAX_SPRITES)
{
- sprite = &gSprites[spriteId];
+ struct Sprite *sprite = &gSprites[spriteId];
UpdateSpritePaletteByTemplate(gFieldEffectObjectTemplatePointers[fldEffObj], sprite);
sprite->coordOffsetEnabled ++;
sprite->sFldEff = fldEff;
@@ -1558,6 +1568,7 @@ bool8 UpdateRevealDisguise(struct ObjectEvent *objectEvent)
}
#undef sState
+#undef sFldEff
#undef sLocalId
#undef sMapNum
#undef sMapGroup
@@ -1574,7 +1585,7 @@ u32 FldEff_Sparkle(void)
gFieldEffectArguments[0] += MAP_OFFSET;
gFieldEffectArguments[1] += MAP_OFFSET;
SetSpritePosToOffsetMapCoords((s16 *)&gFieldEffectArguments[0], (s16 *)&gFieldEffectArguments[1], 8, 8);
- spriteId = CreateSpriteAtEnd(gFieldEffectObjectTemplatePointers[FLDEFFOBJ_SMALL_SPARKLE], gFieldEffectArguments[0], gFieldEffectArguments[1], 0x52);
+ spriteId = CreateSpriteAtEnd(gFieldEffectObjectTemplatePointers[FLDEFFOBJ_SMALL_SPARKLE], gFieldEffectArguments[0], gFieldEffectArguments[1], 82);
if (spriteId != MAX_SPRITES)
{
gSprites[spriteId].oam.priority = gFieldEffectArguments[2];
@@ -1602,7 +1613,9 @@ void UpdateSparkleFieldEffect(struct Sprite *sprite)
#undef sEndTimer
#define sTimer data[0]
+#define sMoveTimer data[1]
#define sState data[2]
+#define sVelocity data[3]
#define sStartY data[4]
#define sCounter data[5]
#define sAnimCounter data[6]
@@ -1768,41 +1781,44 @@ void UpdateRayquazaSpotlightEffect(struct Sprite *sprite)
if (sprite->sState == 1)
{
- if ((sprite->data[1] & 7) == 0)
- sprite->y2 += sprite->data[3];
- if ((sprite->data[1] & 15) == 0)
- sprite->data[3] = -sprite->data[3];
- sprite->data[1]++;
+ // Update movement
+ if ((sprite->sMoveTimer & 7) == 0)
+ sprite->y2 += sprite->sVelocity;
+ // Reverse direction
+ if ((sprite->sMoveTimer & 15) == 0)
+ sprite->sVelocity = -sprite->sVelocity;
+ sprite->sMoveTimer++;
}
sprite->sTimer++;
}
#undef sTimer
+#undef sMoveTimer
#undef sState
#undef sStartY
+#undef sVelocity
#undef sCounter
#undef sAnimCounter
#undef sAnimState
-// Used by FLDEFF_JUMP_TALL_GRASS and FLDEFF_JUMP_LONG_GRASS
void UpdateJumpImpactEffect(struct Sprite *sprite)
{
if (sprite->animEnded)
{
- FieldEffectStop(sprite, sprite->sFldEff);
+ FieldEffectStop(sprite, sprite->sJumpFldEff);
}
else
{
UpdateObjectEventSpriteInvisibility(sprite, FALSE);
- SetObjectSubpriorityByElevation(sprite->sElevation, sprite, 0);
+ SetObjectSubpriorityByElevation(sprite->sJumpElevation, sprite, 0);
}
}
void WaitFieldEffectSpriteAnim(struct Sprite *sprite)
{
if (sprite->animEnded)
- FieldEffectStop(sprite, sprite->data[0]);
+ FieldEffectStop(sprite, sprite->sWaitFldEff);
else
UpdateObjectEventSpriteInvisibility(sprite, FALSE);
}
@@ -1811,8 +1827,6 @@ static void UpdateGrassFieldEffectSubpriority(struct Sprite *sprite, u8 elevatio
{
u8 i;
s16 var, xhi, lyhi, yhi, ylo;
- const struct ObjectEventGraphicsInfo *graphicsInfo; // Unused Variable
- struct Sprite *linkedSprite;
SetObjectSubpriorityByElevation(elevation, sprite, subpriority);
for (i = 0; i < OBJECT_EVENTS_COUNT; i ++)
@@ -1820,8 +1834,9 @@ static void UpdateGrassFieldEffectSubpriority(struct Sprite *sprite, u8 elevatio
struct ObjectEvent *objectEvent = &gObjectEvents[i];
if (objectEvent->active)
{
- graphicsInfo = GetObjectEventGraphicsInfo(objectEvent->graphicsId);
- linkedSprite = &gSprites[objectEvent->spriteId];
+ const struct ObjectEventGraphicsInfo UNUSED *graphicsInfo = GetObjectEventGraphicsInfo(objectEvent->graphicsId);
+ struct Sprite *linkedSprite = &gSprites[objectEvent->spriteId];
+
xhi = sprite->x + sprite->centerToCornerVecX;
var = sprite->x - sprite->centerToCornerVecX;
if (xhi < linkedSprite->x && var > linkedSprite->x)
diff --git a/src/field_message_box.c b/src/field_message_box.c
index 64734cc209..b797e1d353 100755
--- a/src/field_message_box.c
+++ b/src/field_message_box.c
@@ -84,7 +84,7 @@ bool8 ShowPokenavFieldMessage(const u8 *str)
StringExpandPlaceholders(gStringVar4, str);
CreateTask(Task_HidePokenavMessageWhenDone, 0);
StartMatchCallFromScript(str);
- sFieldMessageBoxMode = 2;
+ sFieldMessageBoxMode = FIELD_MESSAGE_BOX_NORMAL;
return TRUE;
}
@@ -97,8 +97,7 @@ bool8 ShowFieldAutoScrollMessage(const u8 *str)
return TRUE;
}
-// Unused
-static bool8 ForceShowFieldAutoScrollMessage(const u8 *str)
+static bool8 UNUSED ForceShowFieldAutoScrollMessage(const u8 *str)
{
sFieldMessageBoxMode = FIELD_MESSAGE_BOX_AUTO_SCROLL;
ExpandStringAndStartDrawFieldMessage(str, TRUE);
@@ -148,8 +147,7 @@ bool8 IsFieldMessageBoxHidden(void)
return FALSE;
}
-// Unused
-static void ReplaceFieldMessageWithFrame(void)
+static void UNUSED ReplaceFieldMessageWithFrame(void)
{
DestroyTask_DrawFieldMessage();
DrawStdWindowFrame(0, TRUE);
diff --git a/src/field_specials.c b/src/field_specials.c
index 66ded6c30b..3cb293b60b 100644
--- a/src/field_specials.c
+++ b/src/field_specials.c
@@ -1011,7 +1011,7 @@ static void PCTurnOnEffect(struct Task *task)
if (task->tTimer == 6)
{
task->tTimer = 0;
-
+
// Get where the PC should be, depending on where the player is looking.
playerDirection = GetPlayerFacingDirection();
switch (playerDirection)
@@ -1033,7 +1033,7 @@ static void PCTurnOnEffect(struct Task *task)
// Update map
PCTurnOnEffect_SetMetatile(task->tIsScreenOn, dx, dy);
DrawWholeMapView();
-
+
// Screen flickers 5 times. Odd number and starting with the
// screen off means the animation ends with the screen on.
task->tIsScreenOn ^= 1;
diff --git a/src/field_tasks.c b/src/field_tasks.c
index 8683301f26..a9d11b2d70 100644
--- a/src/field_tasks.c
+++ b/src/field_tasks.c
@@ -172,7 +172,7 @@ static void Task_RunTimeBasedEvents(u8 taskId)
if (!ArePlayerFieldControlsLocked())
{
RunTimeBasedEvents(data);
- UpdateAmbientCry(&tAmbientCryState, &tAmbientCryDelay);
+ UpdateAmbientCry(&tAmbientCryState, (u16*) &tAmbientCryDelay);
}
}
diff --git a/src/field_weather.c b/src/field_weather.c
index 5bde42edaa..5ebea07840 100644
--- a/src/field_weather.c
+++ b/src/field_weather.c
@@ -856,8 +856,7 @@ void ApplyWeatherColorMapToPal(u8 paletteIndex)
ApplyColorMap(paletteIndex, 1, gWeatherPtr->colorMapIndex);
}
-// Unused
-static bool8 IsFirstFrameOfWeatherFadeIn(void)
+static bool8 UNUSED IsFirstFrameOfWeatherFadeIn(void)
{
if (gWeatherPtr->palProcessingState == WEATHER_PAL_STATE_SCREEN_FADING_IN)
return gWeatherPtr->fadeInFirstFrame;
@@ -998,8 +997,8 @@ bool8 Weather_UpdateBlend(void)
return FALSE;
}
-// Unused. Uses the same numbering scheme as the coord events
-static void SetFieldWeather(u8 weather)
+// Uses the same numbering scheme as the coord events
+static void UNUSED SetFieldWeather(u8 weather)
{
switch (weather)
{
diff --git a/src/field_weather_effect.c b/src/field_weather_effect.c
index 566e48e36f..571ea58207 100644
--- a/src/field_weather_effect.c
+++ b/src/field_weather_effect.c
@@ -2435,8 +2435,7 @@ static void UpdateBubbleSprite(struct Sprite *sprite)
//------------------------------------------------------------------------------
-// Unused function.
-static void UnusedSetCurrentAbnormalWeather(u32 weather, u32 unknown)
+static void UNUSED UnusedSetCurrentAbnormalWeather(u32 weather, u32 unknown)
{
sCurrentAbnormalWeather = weather;
sUnusedWeatherRelated = unknown;
diff --git a/src/fieldmap.c b/src/fieldmap.c
index 9534255c78..d9c4fa371a 100644
--- a/src/fieldmap.c
+++ b/src/fieldmap.c
@@ -29,7 +29,7 @@ EWRAM_DATA static u16 ALIGNED(4) sBackupMapData[MAX_MAP_DATA_SIZE] = {0};
EWRAM_DATA struct MapHeader gMapHeader = {0};
EWRAM_DATA struct Camera gCamera = {0};
EWRAM_DATA static struct ConnectionFlags sMapConnectionFlags = {0};
-EWRAM_DATA static u32 sFiller = 0; // without this, the next file won't align properly
+EWRAM_DATA static u32 UNUSED sFiller = 0; // without this, the next file won't align properly
struct BackupMapLayout gBackupMapLayout;
@@ -799,8 +799,7 @@ void GetCameraFocusCoords(u16 *x, u16 *y)
*y = gSaveBlock1Ptr->pos.y + MAP_OFFSET;
}
-// Unused
-static void SetCameraCoords(u16 x, u16 y)
+static void UNUSED SetCameraCoords(u16 x, u16 y)
{
gSaveBlock1Ptr->pos.x = x;
gSaveBlock1Ptr->pos.y = y;
@@ -866,7 +865,7 @@ static void ApplyGlobalTintToPaletteEntries(u16 offset, u16 size)
}
-static void ApplyGlobalTintToPaletteSlot(u8 slot, u8 count)
+static void UNUSED ApplyGlobalTintToPaletteSlot(u8 slot, u8 count)
{
}
diff --git a/src/fldeff_escalator.c b/src/fldeff_escalator.c
index 0dc98c319c..eabbd53549 100644
--- a/src/fldeff_escalator.c
+++ b/src/fldeff_escalator.c
@@ -14,43 +14,43 @@ static void Task_DrawEscalator(u8 taskId);
#define ESCALATOR_STAGES 3
#define LAST_ESCALATOR_STAGE (ESCALATOR_STAGES - 1)
-static const u16 sEscalatorMetatiles_1F_0[ESCALATOR_STAGES] = {
+static const s16 sEscalatorMetatiles_1F_0[ESCALATOR_STAGES] = {
METATILE_PokemonCenter_Escalator1F_Tile0_Frame2,
METATILE_PokemonCenter_Escalator1F_Tile0_Frame1,
METATILE_PokemonCenter_Escalator1F_Tile0_Frame0
};
-static const u16 sEscalatorMetatiles_1F_1[ESCALATOR_STAGES] = {
+static const s16 sEscalatorMetatiles_1F_1[ESCALATOR_STAGES] = {
METATILE_PokemonCenter_Escalator1F_Tile1_Frame2,
METATILE_PokemonCenter_Escalator1F_Tile1_Frame1,
METATILE_PokemonCenter_Escalator1F_Tile1_Frame0
};
-static const u16 sEscalatorMetatiles_1F_2[ESCALATOR_STAGES] = {
+static const s16 sEscalatorMetatiles_1F_2[ESCALATOR_STAGES] = {
METATILE_PokemonCenter_Escalator1F_Tile2_Frame2,
METATILE_PokemonCenter_Escalator1F_Tile2_Frame1,
METATILE_PokemonCenter_Escalator1F_Tile2_Frame0
};
-static const u16 sEscalatorMetatiles_1F_3[ESCALATOR_STAGES] = {
+static const s16 sEscalatorMetatiles_1F_3[ESCALATOR_STAGES] = {
METATILE_PokemonCenter_Escalator1F_Tile3_Frame2,
METATILE_PokemonCenter_Escalator1F_Tile3_Frame1,
METATILE_PokemonCenter_Escalator1F_Tile3_Frame0
};
-static const u16 sEscalatorMetatiles_2F_0[ESCALATOR_STAGES] = {
+static const s16 sEscalatorMetatiles_2F_0[ESCALATOR_STAGES] = {
METATILE_PokemonCenter_Escalator2F_Tile0_Frame0,
METATILE_PokemonCenter_Escalator2F_Tile0_Frame1,
METATILE_PokemonCenter_Escalator2F_Tile0_Frame2
};
-static const u16 sEscalatorMetatiles_2F_1[ESCALATOR_STAGES] = {
+static const s16 sEscalatorMetatiles_2F_1[ESCALATOR_STAGES] = {
METATILE_PokemonCenter_Escalator2F_Tile1_Frame0,
METATILE_PokemonCenter_Escalator2F_Tile1_Frame1,
METATILE_PokemonCenter_Escalator2F_Tile1_Frame2
};
-static const u16 sEscalatorMetatiles_2F_2[ESCALATOR_STAGES] = {
+static const s16 sEscalatorMetatiles_2F_2[ESCALATOR_STAGES] = {
METATILE_PokemonCenter_Escalator2F_Tile2_Frame0,
METATILE_PokemonCenter_Escalator2F_Tile2_Frame1,
METATILE_PokemonCenter_Escalator2F_Tile2_Frame2
diff --git a/src/fldeff_misc.c b/src/fldeff_misc.c
index 0b254b6af3..d3e6982f29 100644
--- a/src/fldeff_misc.c
+++ b/src/fldeff_misc.c
@@ -308,7 +308,7 @@ static const struct SpriteTemplate sSpriteTemplate_RecordMixLights =
.callback = SpriteCallbackDummy,
};
-// For accessing pokemon storage PC or the Hall of Fame PC
+// For accessing Pokémon storage PC or the Hall of Fame PC
void ComputerScreenOpenEffect(u16 increment, u16 unused, u8 priority)
{
CreateComputerScreenEffectTask(Task_ComputerScreenOpenEffect, increment, unused, priority);
diff --git a/src/frontier_util.c b/src/frontier_util.c
index 08b0e68d2e..1858792b4e 100644
--- a/src/frontier_util.c
+++ b/src/frontier_util.c
@@ -326,7 +326,7 @@ static const struct FrontierBrainMon sFrontierBrainsMons[][2][FRONTIER_PARTY_SIZ
},
[FRONTIER_FACILITY_FACTORY] =
{
- // Because Factory's pokemon are random, this facility's Brain also uses random pokemon.
+ // Because Factory's Pokémon are random, this facility's Brain also uses random Pokémon.
// What is interesting, this team is actually the one Steven uses in the multi tag battle alongside the player.
{
{
@@ -2006,7 +2006,7 @@ static void AppendIfValid(u16 species, u16 heldItem, u16 hp, u8 lvlMode, u8 monL
// gSpecialVar_Result is the level mode before and after calls to this function
// gSpecialVar_0x8004 is used to store the return value instead (TRUE if there are insufficient eligible mons)
-// The names of ineligible pokemon that have been caught are also buffered to print
+// The names of ineligible Pokémon that have been caught are also buffered to print
static void CheckPartyIneligibility(void)
{
u16 speciesArray[PARTY_SIZE];
diff --git a/src/graphics.c b/src/graphics.c
index 7c327c4451..8f1bc89ea6 100644
--- a/src/graphics.c
+++ b/src/graphics.c
@@ -362,7 +362,7 @@ const u8 gHealthboxElementsGfxTable[] = INCBIN_U8("graphics/battle_interface/hpb
"graphics/battle_interface/misc_frameend.4bpp",
"graphics/battle_interface/ball_display.4bpp",
"graphics/battle_interface/ball_caught_indicator.4bpp",
- "graphics/battle_interface/status2.4bpp", // these three duplicate sets of graphics are for the opponent/partner pokemon
+ "graphics/battle_interface/status2.4bpp", // these three duplicate sets of graphics are for the opponent/partner Pokémon
"graphics/battle_interface/status3.4bpp",
"graphics/battle_interface/status4.4bpp",
"graphics/battle_interface/healthbox_doubles_frameend.4bpp",
@@ -953,7 +953,7 @@ const u32 gDomeTourneyLineUp_Tilemap[] = INCBIN_U32("graphics/battle_frontier/to
const u32 gDomeTourneyInfoCard_Gfx[] = INCBIN_U32("graphics/battle_frontier/tourney_info_card.4bpp.lz");
const u32 gDomeTourneyInfoCard_Tilemap[] = INCBIN_U32("graphics/battle_frontier/tourney_info_card_tilemap.bin.lz");
const u32 gDomeTourneyInfoCardBg_Tilemap[] = INCBIN_U32("graphics/battle_frontier/tourney_info_card_bg.bin.lz");
-const u32 gDomeTourneyTreeButtons_Gfx[] = INCBIN_U32("graphics/battle_frontier/tourney_buttons.4bpp.lz"); // exit/cancel and pokeball buttons
+const u32 gDomeTourneyTreeButtons_Gfx[] = INCBIN_U32("graphics/battle_frontier/tourney_buttons.4bpp.lz"); // exit/cancel and Poké Ball buttons
const u32 gDomeTourneyTree_Pal[] = INCBIN_U32("graphics/battle_frontier/tourney_tree.gbapal.lz");
const u32 gDomeTourneyTreeButtons_Pal[] = INCBIN_U32("graphics/battle_frontier/tourney_buttons.gbapal.lz");
const u32 gDomeTourneyMatchCardBg_Pal[] = INCBIN_U32("graphics/battle_frontier/tourney_match_card_bg.gbapal.lz");
@@ -1228,7 +1228,7 @@ const u16 gFrontierPassMapCursor_Pal[] = INCBIN_U16("graphics/frontier_pass/map_
const u16 gFrontierPassMedalsSilver_Pal[] = INCBIN_U16("graphics/frontier_pass/silver.gbapal");
const u16 gFrontierPassMedalsGold_Pal[] = INCBIN_U16("graphics/frontier_pass/gold.gbapal");
-// Pokedex
+// Pokédex
const u16 gPokedexBgHoenn_Pal[] = INCBIN_U16("graphics/pokedex/bg_hoenn.gbapal");
const u16 gPokedexCaughtScreen_Pal[] = INCBIN_U16("graphics/pokedex/caught_screen.gbapal");
const u16 gPokedexSearchResults_Pal[] = INCBIN_U16("graphics/pokedex/search_results_bg.gbapal");
@@ -1282,7 +1282,7 @@ const u16 gContestResultsTitle_Smart_Tilemap[] = INCBIN_U16("graphics/contest/r
const u16 gContestResultsTitle_Tough_Tilemap[] = INCBIN_U16("graphics/contest/results_screen/title_tough.bin");
const u16 gContestResultsTitle_Tilemap[] = INCBIN_U16("graphics/contest/results_screen/title.bin");
-// pokenav
+// PokéNav
const u16 gPokenavCondition_Pal[] = INCBIN_U16("graphics/pokenav/condition/graph.gbapal");
const u32 gPokenavCondition_Gfx[] = INCBIN_U32("graphics/pokenav/condition/graph.4bpp.lz");
@@ -1383,7 +1383,7 @@ const u32 gKantoTrainerCardFront_Tilemap[] = INCBIN_U32("graphics/trainer_card/f
const u32 gKantoTrainerCardBack_Tilemap[] = INCBIN_U32("graphics/trainer_card/frlg/back.bin.lz");
const u32 gKantoTrainerCardFrontLink_Tilemap[] = INCBIN_U32("graphics/trainer_card/frlg/front_link.bin.lz");
-// pokemon storage system
+// Pokémon storage system
const u32 gStorageSystemMenu_Gfx[] = INCBIN_U32("graphics/pokemon_storage/menu.4bpp.lz");
const u16 gStorageSystemPartyMenu_Pal[] = INCBIN_U16("graphics/pokemon_storage/party_menu.gbapal");
@@ -1515,7 +1515,7 @@ const u16 gTitleScreenPressStartPal[] = INCBIN_U16("graphics/title_screen/p
const u32 gTitleScreenPressStartGfx[] = INCBIN_U32("graphics/title_screen/press_start.4bpp.lz");
const u32 gTitleScreenPokemonLogoTilemap[] = INCBIN_U32("graphics/title_screen/pokemon_logo.bin.lz");
-const u16 gFrontierPassBg_Pal[][16] = INCBIN_U16("graphics/frontier_pass/bg.gbapal");
+const u16 gFrontierPassBg_Pal[] = INCBIN_U16("graphics/frontier_pass/bg.gbapal"); // 8 x 16
const u32 gFrontierPassBg_Gfx[] = INCBIN_U32("graphics/frontier_pass/bg.4bpp.lz");
const u32 gFrontierPassMapAndCard_Gfx[] = INCBIN_U32("graphics/frontier_pass/map_and_card.8bpp.lz");
const u32 gFrontierPassBg_Tilemap[] = INCBIN_U32("graphics/frontier_pass/bg.bin.lz");
diff --git a/src/hall_of_fame.c b/src/hall_of_fame.c
index 63c7c30c26..91850ec72e 100644
--- a/src/hall_of_fame.c
+++ b/src/hall_of_fame.c
@@ -621,7 +621,7 @@ static void Task_Hof_TryDisplayAnotherMon(u8 taskId)
else
{
sHofFadePalettes |= (0x10000 << gSprites[gTasks[taskId].tMonSpriteId(currPokeID)].oam.paletteNum);
- if (gTasks[taskId].tDisplayedMonId < PARTY_SIZE - 1 && currMon[1].species != SPECIES_NONE) // there is another pokemon to display
+ if (gTasks[taskId].tDisplayedMonId < PARTY_SIZE - 1 && currMon[1].species != SPECIES_NONE) // there is another Pokémon to display
{
gTasks[taskId].tDisplayedMonId++;
BeginNormalPaletteFade(sHofFadePalettes, 0, 12, 12, RGB(16, 29, 24));
diff --git a/src/intro.c b/src/intro.c
index 6a6a58ddd5..195374bba0 100644
--- a/src/intro.c
+++ b/src/intro.c
@@ -169,7 +169,7 @@ extern const struct SpriteTemplate gAncientPowerRockSpriteTemplate[];
#define TIMER_START_LEGENDARIES 43
static EWRAM_DATA u16 sIntroCharacterGender = 0;
-static EWRAM_DATA u16 sUnusedVar = 0;
+static EWRAM_DATA u16 UNUSED sUnusedVar = 0;
static EWRAM_DATA u16 sFlygonYOffset = 0;
u32 gIntroFrameCounter;
@@ -178,7 +178,7 @@ struct GcmbStruct gMultibootProgramStruct;
static const u16 sIntroDrops_Pal[] = INCBIN_U16("graphics/intro/scene_1/drops.gbapal");
static const u16 sIntroLogo_Pal[] = INCBIN_U16("graphics/intro/scene_1/logo.gbapal");
static const u32 sIntroDropsLogo_Gfx[] = INCBIN_U32("graphics/intro/scene_1/drops_logo.4bpp.lz");
-static const u16 sIntro1Bg_Pal[16][16] = INCBIN_U16("graphics/intro/scene_1/bg.gbapal");
+static const u16 sIntro1Bg_Pal[] = INCBIN_U16("graphics/intro/scene_1/bg.gbapal"); // 16 x 16
static const u32 sIntro1Bg0_Tilemap[] = INCBIN_U32("graphics/intro/scene_1/bg0_map.bin.lz");
static const u32 sIntro1Bg1_Tilemap[] = INCBIN_U32("graphics/intro/scene_1/bg1_map.bin.lz");
static const u32 sIntro1Bg2_Tilemap[] = INCBIN_U32("graphics/intro/scene_1/bg2_map.bin.lz");
diff --git a/src/intro_credits_graphics.c b/src/intro_credits_graphics.c
index 05b5a3a050..c4b059fdd7 100644
--- a/src/intro_credits_graphics.c
+++ b/src/intro_credits_graphics.c
@@ -1148,7 +1148,7 @@ static void SpriteCB_FlygonRightHalf(struct Sprite *sprite)
}
// In RS these were for Latios/Latias. In Emerald both are replaced with Flygon and now only 1 is used
-static u8 CreateIntroFlygonSprite_Unused(s16 x, s16 y)
+static u8 UNUSED CreateIntroFlygonSprite_Unused(s16 x, s16 y)
{
u8 leftSpriteId = CreateSprite(&sSpriteTemplate_FlygonLatios, x - 32, y, 5);
u8 rightSpriteId = CreateSprite(&sSpriteTemplate_FlygonLatios, x + 32, y, 6);
diff --git a/src/item_menu.c b/src/item_menu.c
index 223f028d02..f0abfcf62a 100755
--- a/src/item_menu.c
+++ b/src/item_menu.c
@@ -109,7 +109,7 @@ struct ListBuffer1 {
};
struct ListBuffer2 {
- s8 name[MAX_POCKET_ITEMS][ITEM_NAME_LENGTH + 10];
+ u8 name[MAX_POCKET_ITEMS][ITEM_NAME_LENGTH + 10];
};
struct TempWallyBag {
@@ -138,7 +138,7 @@ static void PrepareTMHMMoveWindow(void);
static bool8 IsWallysBag(void);
static void Task_WallyTutorialBagMenu(u8);
static void Task_BagMenu_HandleInput(u8);
-static void GetItemName(s8 *, u16);
+static void GetItemName(u8 *, u16);
static void PrintItemDescription(int);
static void BagMenu_PrintCursorAtPos(u8, u8);
static void BagMenu_Print(u8, u8, const u8 *, u8, u8, u8, u8, u8, u8);
@@ -265,21 +265,21 @@ static const struct ListMenuTemplate sItemListMenu =
};
static const struct MenuAction sItemMenuActions[] = {
- [ACTION_USE] = {gMenuText_Use, ItemMenu_UseOutOfBattle},
- [ACTION_TOSS] = {gMenuText_Toss, ItemMenu_Toss},
- [ACTION_REGISTER] = {gMenuText_Register, ItemMenu_Register},
- [ACTION_GIVE] = {gMenuText_Give, ItemMenu_Give},
- [ACTION_CANCEL] = {gText_Cancel2, ItemMenu_Cancel},
- [ACTION_BATTLE_USE] = {gMenuText_Use, ItemMenu_UseInBattle},
- [ACTION_CHECK] = {gMenuText_Check, ItemMenu_UseOutOfBattle},
- [ACTION_WALK] = {gMenuText_Walk, ItemMenu_UseOutOfBattle},
- [ACTION_DESELECT] = {gMenuText_Deselect, ItemMenu_Register},
- [ACTION_CHECK_TAG] = {gMenuText_CheckTag, ItemMenu_CheckTag},
- [ACTION_CONFIRM] = {gMenuText_Confirm, Task_FadeAndCloseBagMenu},
- [ACTION_SHOW] = {gMenuText_Show, ItemMenu_Show},
- [ACTION_GIVE_FAVOR_LADY] = {gMenuText_Give2, ItemMenu_GiveFavorLady},
- [ACTION_CONFIRM_QUIZ_LADY] = {gMenuText_Confirm, ItemMenu_ConfirmQuizLady},
- [ACTION_DUMMY] = {gText_EmptyString2, NULL}
+ [ACTION_USE] = {gMenuText_Use, {ItemMenu_UseOutOfBattle}},
+ [ACTION_TOSS] = {gMenuText_Toss, {ItemMenu_Toss}},
+ [ACTION_REGISTER] = {gMenuText_Register, {ItemMenu_Register}},
+ [ACTION_GIVE] = {gMenuText_Give, {ItemMenu_Give}},
+ [ACTION_CANCEL] = {gText_Cancel2, {ItemMenu_Cancel}},
+ [ACTION_BATTLE_USE] = {gMenuText_Use, {ItemMenu_UseInBattle}},
+ [ACTION_CHECK] = {gMenuText_Check, {ItemMenu_UseOutOfBattle}},
+ [ACTION_WALK] = {gMenuText_Walk, {ItemMenu_UseOutOfBattle}},
+ [ACTION_DESELECT] = {gMenuText_Deselect, {ItemMenu_Register}},
+ [ACTION_CHECK_TAG] = {gMenuText_CheckTag, {ItemMenu_CheckTag}},
+ [ACTION_CONFIRM] = {gMenuText_Confirm, {Task_FadeAndCloseBagMenu}},
+ [ACTION_SHOW] = {gMenuText_Show, {ItemMenu_Show}},
+ [ACTION_GIVE_FAVOR_LADY] = {gMenuText_Give2, {ItemMenu_GiveFavorLady}},
+ [ACTION_CONFIRM_QUIZ_LADY] = {gMenuText_Confirm, {ItemMenu_ConfirmQuizLady}},
+ [ACTION_DUMMY] = {gText_EmptyString2, {NULL}}
};
// these are all 2D arrays with a width of 2 but are represented as 1D arrays
@@ -894,7 +894,7 @@ static void LoadBagItemListBuffers(u8 pocketId)
gMultiuseListMenuTemplate.maxShowed = gBagMenu->numShownItems[pocketId];
}
-static void GetItemName(s8 *dest, u16 itemId)
+static void GetItemName(u8 *dest, u16 itemId)
{
switch (gBagPosition.pocket)
{
@@ -2466,8 +2466,7 @@ static void BagMenu_Print(u8 windowId, u8 fontId, const u8 *str, u8 left, u8 top
AddTextPrinterParameterized4(windowId, fontId, left, top, letterSpacing, lineSpacing, sFontColorTable[colorIndex], speed, str);
}
-// Unused
-static u8 BagMenu_GetWindowId(u8 windowType)
+static u8 UNUSED BagMenu_GetWindowId(u8 windowType)
{
return gBagMenu->windowIds[windowType];
}
diff --git a/src/item_use.c b/src/item_use.c
index 9737ca7d87..60338e437a 100755
--- a/src/item_use.c
+++ b/src/item_use.c
@@ -724,7 +724,7 @@ static void ItemUseOnFieldCB_WailmerPailBerry(u8 taskId)
static bool8 TryToWaterSudowoodo(void)
{
- u16 x, y;
+ s16 x, y;
u8 elevation;
u8 objId;
GetXYCoordsOneStepInFrontOfPlayer(&x, &y);
diff --git a/src/librfu_rfu.c b/src/librfu_rfu.c
index da37b8fc11..828d6450bc 100644
--- a/src/librfu_rfu.c
+++ b/src/librfu_rfu.c
@@ -1400,7 +1400,11 @@ static u16 rfu_STC_setSendData_org(u8 ni_or_uni, u8 bmSendSlot, u8 subFrameSize,
{
u8 bm_slot_id, sendSlotFlag;
u8 frameSize;
+#ifdef UBFIX
+ u8 *llFrameSize_p = NULL;
+#else
u8 *llFrameSize_p;
+#endif
u8 sending;
u8 i;
u16 imeBak;
@@ -1426,7 +1430,11 @@ static u16 rfu_STC_setSendData_org(u8 ni_or_uni, u8 bmSendSlot, u8 subFrameSize,
else if (gRfuLinkStatus->parentChild == MODE_CHILD)
llFrameSize_p = &gRfuLinkStatus->remainLLFrameSizeChild[bm_slot_id];
frameSize = llsf_struct[gRfuLinkStatus->parentChild].frameSize;
+#ifdef UBFIX
+ if ((llFrameSize_p && subFrameSize > *llFrameSize_p) || subFrameSize <= frameSize)
+#else
if (subFrameSize > *llFrameSize_p || subFrameSize <= frameSize)
+#endif
return ERR_SUBFRAME_SIZE;
imeBak = REG_IME;
REG_IME = 0;
@@ -1464,7 +1472,10 @@ static u16 rfu_STC_setSendData_org(u8 ni_or_uni, u8 bmSendSlot, u8 subFrameSize,
} while (0);
}
gRfuLinkStatus->sendSlotNIFlag |= bmSendSlot;
- *llFrameSize_p -= subFrameSize;
+#ifdef UBFIX
+ if (llFrameSize_p)
+#endif
+ *llFrameSize_p -= subFrameSize;
slotStatus_NI->send.state = SLOT_STATE_SEND_START;
}
else if (ni_or_uni & 0x10)
@@ -1473,7 +1484,10 @@ static u16 rfu_STC_setSendData_org(u8 ni_or_uni, u8 bmSendSlot, u8 subFrameSize,
slotStatus_UNI->send.bmSlot = bmSendSlot;
slotStatus_UNI->send.src = src;
slotStatus_UNI->send.payloadSize = subFrameSize - frameSize;
- *llFrameSize_p -= subFrameSize;
+#ifdef UBFIX
+ if (llFrameSize_p)
+#endif
+ *llFrameSize_p -= subFrameSize;
slotStatus_UNI->send.state = SLOT_STATE_SEND_UNI;
gRfuLinkStatus->sendSlotUNIFlag |= bmSendSlot;
}
diff --git a/src/link.c b/src/link.c
index c51abc9526..f784a36c67 100644
--- a/src/link.c
+++ b/src/link.c
@@ -278,8 +278,7 @@ static void InitLinkTestBG(u8 paletteNum, u8 bgNum, u8 screenBaseBlock, u8 charB
SetGpuReg(REG_OFFSET_BG0VOFS + bgNum * 4, 0);
}
-// Unused
-static void LoadLinkTestBgGfx(u8 paletteNum, u8 bgNum, u8 screenBaseBlock, u8 charBaseBlock)
+static void UNUSED LoadLinkTestBgGfx(u8 paletteNum, u8 bgNum, u8 screenBaseBlock, u8 charBaseBlock)
{
LoadPalette(sLinkTestDigitsPal, BG_PLTT_ID(paletteNum), PLTT_SIZE_4BPP);
DmaCopy16(3, sLinkTestDigitsGfx, (u16 *)BG_CHAR_ADDR(charBaseBlock), sizeof sLinkTestDigitsGfx);
@@ -289,8 +288,7 @@ static void LoadLinkTestBgGfx(u8 paletteNum, u8 bgNum, u8 screenBaseBlock, u8 ch
SetGpuReg(sBGControlRegs[bgNum], BGCNT_SCREENBASE(screenBaseBlock) | BGCNT_CHARBASE(charBaseBlock));
}
-// Unused
-static void LinkTestScreen(void)
+static void UNUSED LinkTestScreen(void)
{
int i;
@@ -779,8 +777,7 @@ u32 LinkDummy_Return2(void)
return 2;
}
-// Unused
-static bool32 IsFullLinkGroupWithNoRS(void)
+static bool32 UNUSED IsFullLinkGroupWithNoRS(void)
{
if (GetLinkPlayerCount() != MAX_LINK_PLAYERS || AreAnyLinkPlayersUsingVersions(VERSION_RUBY, VERSION_SAPPHIRE) < 0)
{
@@ -1012,14 +1009,12 @@ void SetBerryBlenderLinkCallback(void)
gLinkCallback = LinkCB_BerryBlenderSendHeldKeys;
}
-// Unused
-static u32 GetBerryBlenderKeySendAttempts(void)
+static u32 UNUSED GetBerryBlenderKeySendAttempts(void)
{
return gBerryBlenderKeySendAttempts;
}
-// Unused
-static void SendBerryBlenderNoSpaceForPokeblocks(void)
+static void UNUSED SendBerryBlenderNoSpaceForPokeblocks(void)
{
BuildSendCmd(LINKCMD_BLENDER_NO_PBLOCK_SPACE);
}
@@ -1165,7 +1160,7 @@ static void LinkTest_PrintHex(u32 num, u8 x, u8 y, u8 length)
}
}
-static void LinkTest_PrintInt(int num, u8 x, u8 y, u8 length)
+static void UNUSED LinkTest_PrintInt(int num, u8 x, u8 y, u8 length)
{
char buff[16];
int negX;
@@ -1297,8 +1292,7 @@ u8 GetSavedPlayerCount(void)
return gSavedLinkPlayerCount;
}
-// Unused
-static u8 GetSavedMultiplayerId(void)
+static u8 UNUSED GetSavedMultiplayerId(void)
{
return gSavedMultiplayerId;
}
@@ -1335,13 +1329,13 @@ bool8 DoesLinkPlayerCountMatchSaved(void)
void ClearSavedLinkPlayers(void)
{
- int i;
// The CpuSet loop below is incorrectly writing to NULL
// instead of sSavedLinkPlayers.
// Additionally it's using the wrong array size.
#ifdef UBFIX
memset(sSavedLinkPlayers, 0, sizeof(sSavedLinkPlayers));
#else
+ int i;
for (i = 0; i < MAX_LINK_PLAYERS; i++)
CpuSet(&sSavedLinkPlayers[i], NULL, sizeof(struct LinkPlayer));
#endif
@@ -1382,8 +1376,7 @@ bool8 IsLinkMaster(void)
return EXTRACT_MASTER(gLinkStatus);
}
-// Unused
-static u8 GetDummy2(void)
+static u8 UNUSED GetDummy2(void)
{
return sDummy2;
}
diff --git a/src/link_rfu_2.c b/src/link_rfu_2.c
index 6c84ffefe0..9979097a49 100644
--- a/src/link_rfu_2.c
+++ b/src/link_rfu_2.c
@@ -699,8 +699,7 @@ void StopUnionRoomLinkManager(void)
gRfu.state = RFUSTATE_UR_STOP_MANAGER;
}
-// Unused
-static void ReadySendDataForSlots(u8 slots)
+static void UNUSED ReadySendDataForSlots(u8 slots)
{
u8 i;
@@ -2146,7 +2145,7 @@ void RfuSetErrorParams(u32 errorInfo)
}
}
-static void ResetErrorState(void)
+static void UNUSED ResetErrorState(void)
{
gRfu.errorState = RFU_ERROR_STATE_NONE;
}
@@ -2560,8 +2559,7 @@ static void VBlank_RfuIdle(void)
TransferPlttBuffer();
}
-// Unused
-static void Debug_RfuIdle(void)
+static void UNUSED Debug_RfuIdle(void)
{
s32 i;
@@ -2934,7 +2932,7 @@ static void Debug_PrintEmpty(void)
Debug_PrintString(sASCII_30Spaces, 0, i);
}
-static void Debug_PrintStatus(void)
+static void UNUSED Debug_PrintStatus(void)
{
s32 i, j;
Debug_PrintNum(GetBlockReceivedStatus(), 28, 19, 2);
@@ -2990,7 +2988,7 @@ static void Debug_PrintStatus(void)
}
}
-static u32 GetRfuSendQueueLength(void)
+static u32 UNUSED GetRfuSendQueueLength(void)
{
return gRfu.sendQueue.count;
}
diff --git a/src/link_rfu_3.c b/src/link_rfu_3.c
index 6eee8435c9..8a9c28f1b0 100644
--- a/src/link_rfu_3.c
+++ b/src/link_rfu_3.c
@@ -342,7 +342,7 @@ void RfuSendQueue_Reset(struct RfuSendQueue *queue)
queue->full = FALSE;
}
-static void RfuUnusedQueue_Reset(struct RfuUnusedQueue *queue)
+static void UNUSED RfuUnusedQueue_Reset(struct RfuUnusedQueue *queue)
{
s32 i;
s32 j;
@@ -514,7 +514,7 @@ bool8 RfuBackupQueue_Dequeue(struct RfuBackupQueue *queue, u8 *src)
return TRUE;
}
-static void RfuUnusedQueue_Enqueue(struct RfuUnusedQueue *queue, u8 *data)
+static void UNUSED RfuUnusedQueue_Enqueue(struct RfuUnusedQueue *queue, u8 *data)
{
s32 i;
@@ -533,7 +533,7 @@ static void RfuUnusedQueue_Enqueue(struct RfuUnusedQueue *queue, u8 *data)
}
}
-static bool8 RfuUnusedQueue_Dequeue(struct RfuUnusedQueue *queue, u8 *dest)
+static bool8 UNUSED RfuUnusedQueue_Dequeue(struct RfuUnusedQueue *queue, u8 *dest)
{
s32 i;
@@ -549,11 +549,10 @@ static bool8 RfuUnusedQueue_Dequeue(struct RfuUnusedQueue *queue, u8 *dest)
return TRUE;
}
-// Unused
// Populates an array with a sequence of numbers (which numbers depends on the mode)
// and sets the final element to the total of the other elements
#define SEQ_ARRAY_MAX_SIZE 200
-static void PopulateArrayWithSequence(u8 *arr, u8 mode)
+static void UNUSED PopulateArrayWithSequence(u8 *arr, u8 mode)
{
s32 i;
u8 rval;
@@ -607,7 +606,7 @@ static void PopulateArrayWithSequence(u8 *arr, u8 mode)
// File boundary here maybe?
-static void PkmnStrToASCII(u8 *asciiStr, const u8 *pkmnStr)
+static void UNUSED PkmnStrToASCII(u8 *asciiStr, const u8 *pkmnStr)
{
s32 i;
@@ -616,7 +615,7 @@ static void PkmnStrToASCII(u8 *asciiStr, const u8 *pkmnStr)
asciiStr[i] = 0;
}
-static void ASCIIToPkmnStr(u8 *pkmnStr, const u8 *asciiStr)
+static void UNUSED ASCIIToPkmnStr(u8 *pkmnStr, const u8 *asciiStr)
{
s32 i;
diff --git a/src/lottery_corner.c b/src/lottery_corner.c
index f19e9f7b7b..052e2cfc38 100644
--- a/src/lottery_corner.c
+++ b/src/lottery_corner.c
@@ -75,7 +75,7 @@ void PickLotteryCornerTicket(void)
}
}
}
- else // pokemon are always arranged from populated spots first to unpopulated, so the moment a NONE species is found, that's the end of the list.
+ else // Pokémon are always arranged from populated spots first to unpopulated, so the moment a NONE species is found, that's the end of the list.
break;
}
diff --git a/src/m4a_1.s b/src/m4a_1.s
index 3f15788061..20f9197a8d 100644
--- a/src/m4a_1.s
+++ b/src/m4a_1.s
@@ -1395,7 +1395,7 @@ _081DD9F6:
cmp r6, 0
beq _081DDA14
ldrb r0, [r4, o_CgbChannel_modify]
- movs r1, 0x1
+ movs r1, CGB_CHANNEL_MO_VOL
orrs r0, r1
strb r0, [r4, o_CgbChannel_modify]
_081DDA14:
diff --git a/src/m4a_tables.c b/src/m4a_tables.c
index 9a4ea32e69..4d012cea28 100644
--- a/src/m4a_tables.c
+++ b/src/m4a_tables.c
@@ -257,35 +257,34 @@ const u8 gClockTable[] =
const struct PokemonCrySong gPokemonCrySongTemplate =
{
- 1, // track count
- 0, // block count
- 255, // priority
- 0, // reverb
- (struct ToneData *)&voicegroup000,
- NULL,
- NULL,
- 0,
- TUNE, // part 0
- C_V, // TUNE value
- GOTO,
- 0, // GOTO target address
- TUNE, // part 1
- C_V + 16, // TUNE value
- {VOICE, 0}, // part 0 jumps here with GOTO
- VOL,
- 127, // volume
- {XCMD, 0x0D},
- 0, // unk value
- {XCMD, xRELE},
- 0, // release
- PAN,
- C_V, // PAN value
- TIE,
- 60, // TIE key (default is Cn3)
- 127, // TIE velocity
- {XCMD, 0x0C},
- 60, // unk value
- {EOT, FINE} // end
+ .trackCount = 1,
+ .blockCount = 0,
+ .priority = 255,
+ .reverb = 0,
+ .tone = (struct ToneData *)&voicegroup000,
+ .part = {NULL, NULL},
+ .gap = 0,
+ .part0 = TUNE,
+ .tuneValue = C_V,
+ .gotoCmd = GOTO,
+ .gotoTarget = 0,
+ .part1 = TUNE,
+ .tuneValue2 = C_V + 16,
+ .cont = {VOICE, 0}, // part0 jumps here with gotoCmd
+ .volCmd = VOL,
+ .volumeValue = 127,
+ .unkCmd0D = {XCMD, 0x0D},
+ .unkCmd0DParam = 0,
+ .xreleCmd = {XCMD, xRELE},
+ .releaseValue = 0,
+ .panCmd = PAN,
+ .panValue = C_V,
+ .tieCmd = TIE,
+ .tieKeyValue = 60, // default is Cn3
+ .tieVelocityValue = 127,
+ .unkCmd0C = {XCMD, 0x0C},
+ .unkCmd0CParam = 60,
+ .end = {EOT, FINE}
};
const XcmdFunc gXcmdTable[] =
diff --git a/src/mail_data.c b/src/mail_data.c
index 99cf1f9edd..ed152faf2c 100644
--- a/src/mail_data.c
+++ b/src/mail_data.c
@@ -129,7 +129,7 @@ u8 GiveMailToMon(struct Pokemon *mon, struct Mail *mail)
return mailId;
}
-static bool32 DummyMailFunc(void)
+static bool32 UNUSED DummyMailFunc(void)
{
return FALSE;
}
diff --git a/src/main.c b/src/main.c
index 2587ae0a25..d4831b0e24 100644
--- a/src/main.c
+++ b/src/main.c
@@ -76,7 +76,9 @@ static EWRAM_DATA u16 sTrainerId = 0;
static void UpdateLinkAndCallCallbacks(void);
static void InitMainCallbacks(void);
static void CallCallbacks(void);
+#ifdef BUGFIX
static void SeedRngWithRtc(void);
+#endif
static void ReadKeys(void);
void InitIntrHandlers(void);
static void WaitForVBlank(void);
diff --git a/src/main_menu.c b/src/main_menu.c
index ddbcda5fd2..6a6ee99557 100644
--- a/src/main_menu.c
+++ b/src/main_menu.c
@@ -454,8 +454,8 @@ static const union AffineAnimCmd *const sSpriteAffineAnimTable_PlayerShrink[] =
};
static const struct MenuAction sMenuActions_Gender[] = {
- {gText_BirchBoy, NULL},
- {gText_BirchGirl, NULL}
+ {gText_BirchBoy, {NULL}},
+ {gText_BirchGirl, {NULL}}
};
static const u8 *const sMalePresetNames[] = {
diff --git a/src/map_name_popup.c b/src/map_name_popup.c
index 93a2825833..eed2f2b714 100644
--- a/src/map_name_popup.c
+++ b/src/map_name_popup.c
@@ -198,30 +198,52 @@ static const u8 * const sBattlePyramid_MapHeaderStrings[FRONTIER_STAGES_PER_CHAL
sText_Pyramid,
};
-// Unused
-static bool8 StartMenu_ShowMapNamePopup(void)
+static bool8 UNUSED StartMenu_ShowMapNamePopup(void)
{
HideStartMenu();
ShowMapNamePopup();
return TRUE;
}
+// States and data defines for Task_MapNamePopUpWindow
+enum {
+ STATE_SLIDE_IN,
+ STATE_WAIT,
+ STATE_SLIDE_OUT,
+ STATE_UNUSED,
+ STATE_ERASE,
+ STATE_END,
+ STATE_PRINT, // For some reason the first state is numerically last.
+};
+
+#define POPUP_OFFSCREEN_Y 40
+#define POPUP_SLIDE_SPEED 2
+
+#define tState data[0]
+#define tOnscreenTimer data[1]
+#define tYOffset data[2]
+#define tIncomingPopUp data[3]
+#define tPrintTimer data[4]
+
void ShowMapNamePopup(void)
{
if (FlagGet(FLAG_HIDE_MAP_NAME_POPUP) != TRUE)
{
if (!FuncIsActiveTask(Task_MapNamePopUpWindow))
{
+ // New pop up window
sPopupTaskId = CreateTask(Task_MapNamePopUpWindow, 90);
- SetGpuReg(REG_OFFSET_BG0VOFS, 40);
- gTasks[sPopupTaskId].data[0] = 6;
- gTasks[sPopupTaskId].data[2] = 40;
+ SetGpuReg(REG_OFFSET_BG0VOFS, POPUP_OFFSCREEN_Y);
+ gTasks[sPopupTaskId].tState = STATE_PRINT;
+ gTasks[sPopupTaskId].tYOffset = POPUP_OFFSCREEN_Y;
}
else
{
- if (gTasks[sPopupTaskId].data[0] != 2)
- gTasks[sPopupTaskId].data[0] = 2;
- gTasks[sPopupTaskId].data[3] = 1;
+ // There's already a pop up window running.
+ // Hurry the old pop up offscreen so the new one can appear.
+ if (gTasks[sPopupTaskId].tState != STATE_SLIDE_OUT)
+ gTasks[sPopupTaskId].tState = STATE_SLIDE_OUT;
+ gTasks[sPopupTaskId].tIncomingPopUp = TRUE;
}
}
}
@@ -230,61 +252,65 @@ static void Task_MapNamePopUpWindow(u8 taskId)
{
struct Task *task = &gTasks[taskId];
- switch (task->data[0])
+ switch (task->tState)
{
- case 6:
- task->data[4]++;
- if (task->data[4] > 30)
+ case STATE_PRINT:
+ // Wait, then create and print the pop up window
+ if (++task->tPrintTimer > 30)
{
- task->data[0] = 0;
- task->data[4] = 0;
+ task->tState = STATE_SLIDE_IN;
+ task->tPrintTimer = 0;
ShowMapNamePopUpWindow();
}
break;
- case 0:
- task->data[2] -= 2;
- if (task->data[2] <= 0 )
+ case STATE_SLIDE_IN:
+ // Slide the window onscreen.
+ task->tYOffset -= POPUP_SLIDE_SPEED;
+ if (task->tYOffset <= 0 )
{
- task->data[2] = 0;
- task->data[0] = 1;
+ task->tYOffset = 0;
+ task->tState = STATE_WAIT;
gTasks[sPopupTaskId].data[1] = 0;
}
break;
- case 1:
- task->data[1]++;
- if (task->data[1] > 120 )
+ case STATE_WAIT:
+ // Wait while the window is fully onscreen.
+ if (++task->tOnscreenTimer > 120)
{
- task->data[1] = 0;
- task->data[0] = 2;
+ task->tOnscreenTimer = 0;
+ task->tState = STATE_SLIDE_OUT;
}
break;
- case 2:
- task->data[2] += 2;
- if (task->data[2] > 39)
+ case STATE_SLIDE_OUT:
+ // Slide the window offscreen.
+ task->tYOffset += POPUP_SLIDE_SPEED;
+ if (task->tYOffset >= POPUP_OFFSCREEN_Y)
{
- task->data[2] = 40;
- if (task->data[3])
+ task->tYOffset = POPUP_OFFSCREEN_Y;
+ if (task->tIncomingPopUp)
{
- task->data[0] = 6;
- task->data[4] = 0;
- task->data[3] = 0;
+ // A new pop up window is incoming,
+ // return to the first state to show it.
+ task->tState = STATE_PRINT;
+ task->tPrintTimer = 0;
+ task->tIncomingPopUp = FALSE;
}
else
{
- task->data[0] = 4;
+ task->tState = STATE_ERASE;
return;
}
}
break;
- case 4:
+ case STATE_ERASE:
ClearStdWindowAndFrame(GetMapNamePopUpWindowId(), TRUE);
- task->data[0] = 5;
+ task->tState = STATE_END;
break;
- case 5:
+ case STATE_END:
HideMapNamePopUpWindow();
return;
}
- SetGpuReg(REG_OFFSET_BG0VOFS, task->data[2]);
+ SetGpuReg(REG_OFFSET_BG0VOFS, task->tYOffset);
}
void HideMapNamePopUpWindow(void)
diff --git a/src/mauville_old_man.c b/src/mauville_old_man.c
index 36b29ed73b..287419f901 100644
--- a/src/mauville_old_man.c
+++ b/src/mauville_old_man.c
@@ -740,8 +740,7 @@ void SanitizeMauvilleOldManForRuby(union OldMan * oldMan)
}
}
-// Unused
-static void SetMauvilleOldManLanguage(union OldMan * oldMan, u32 language1, u32 language2, u32 language3)
+static void UNUSED SetMauvilleOldManLanguage(union OldMan * oldMan, u32 language1, u32 language2, u32 language3)
{
s32 i;
diff --git a/src/menu.c b/src/menu.c
index ad3381de9b..dd43e310dc 100644
--- a/src/menu.c
+++ b/src/menu.c
@@ -442,14 +442,12 @@ void Menu_LoadStdPalAt(u16 offset)
LoadPalette(gStandardMenuPalette, offset, STD_WINDOW_PALETTE_SIZE);
}
-// Unused
-static const u16 *Menu_GetStdPal(void)
+static UNUSED const u16* Menu_GetStdPal(void)
{
return gStandardMenuPalette;
}
-// Unused
-static u16 Menu_GetStdPalColor(u8 colorNum)
+static u16 UNUSED Menu_GetStdPalColor(u8 colorNum)
{
if (colorNum > 15)
colorNum = 0;
@@ -510,14 +508,12 @@ void RemoveStartMenuWindow(void)
}
}
-// Unused
-static u16 GetDialogFrameBaseTileNum(void)
+static u16 UNUSED GetDialogFrameBaseTileNum(void)
{
return DLG_WINDOW_BASE_TILE_NUM;
}
-// Unused
-static u16 GetStandardFrameBaseTileNum(void)
+static u16 UNUSED GetStandardFrameBaseTileNum(void)
{
return STD_WINDOW_BASE_TILE_NUM;
}
@@ -567,8 +563,7 @@ void DrawDialogFrameWithCustomTileAndPalette(u8 windowId, bool8 copyToVram, u16
CopyWindowToVram(windowId, COPYWIN_FULL);
}
-// Never used.
-static void DrawDialogFrameWithCustomTile(u8 windowId, bool8 copyToVram, u16 tileNum)
+static void UNUSED DrawDialogFrameWithCustomTile(u8 windowId, bool8 copyToVram, u16 tileNum)
{
sTileNum = tileNum;
sPaletteNum = GetWindowAttribute(windowId, WINDOW_PALETTE_NUM);
@@ -877,15 +872,13 @@ void HofPCTopBar_PrintPair(const u8 *string, const u8 *string2, bool8 noBg, u8 l
}
}
-// Unused
-static void HofPCTopBar_CopyToVram(void)
+static void UNUSED HofPCTopBar_CopyToVram(void)
{
if (sHofPCTopBarWindowId != WINDOW_NONE)
CopyWindowToVram(sHofPCTopBarWindowId, COPYWIN_FULL);
}
-// Unused
-static void HofPCTopBar_Clear(void)
+static void UNUSED HofPCTopBar_Clear(void)
{
if (sHofPCTopBarWindowId != WINDOW_NONE)
{
@@ -936,8 +929,7 @@ u8 InitMenuNormal(u8 windowId, u8 fontId, u8 left, u8 top, u8 cursorHeight, u8 n
return InitMenu(windowId, fontId, left, top, cursorHeight, numChoices, initialCursorPos, FALSE);
}
-// Unused
-static u8 InitMenuDefaultCursorHeight(u8 windowId, u8 fontId, u8 left, u8 top, u8 numChoices, u8 initialCursorPos)
+static u8 UNUSED InitMenuDefaultCursorHeight(u8 windowId, u8 fontId, u8 left, u8 top, u8 numChoices, u8 initialCursorPos)
{
u8 cursorHeight = GetMenuCursorDimensionByFont(fontId, 1);
return InitMenuNormal(windowId, fontId, left, top, cursorHeight, numChoices, initialCursorPos);
@@ -1114,8 +1106,7 @@ void PrintMenuActionTextsAtPos(u8 windowId, u8 fontId, u8 left, u8 top, u8 lineH
CopyWindowToVram(windowId, COPYWIN_GFX);
}
-// Unused
-static void PrintMenuActionTextsWithSpacing(u8 windowId, u8 fontId, u8 left, u8 top, u8 lineHeight, u8 itemCount, const struct MenuAction *menuActions, u8 letterSpacing, u8 lineSpacing)
+static void UNUSED PrintMenuActionTextsWithSpacing(u8 windowId, u8 fontId, u8 left, u8 top, u8 lineHeight, u8 itemCount, const struct MenuAction *menuActions, u8 letterSpacing, u8 lineSpacing)
{
u8 i;
for (i = 0; i < itemCount; i++)
@@ -1123,8 +1114,7 @@ static void PrintMenuActionTextsWithSpacing(u8 windowId, u8 fontId, u8 left, u8
CopyWindowToVram(windowId, COPYWIN_GFX);
}
-// Unused
-static void PrintMenuActionTextsAtTop(u8 windowId, u8 fontId, u8 lineHeight, u8 itemCount, const struct MenuAction *menuActions)
+static void UNUSED PrintMenuActionTextsAtTop(u8 windowId, u8 fontId, u8 lineHeight, u8 itemCount, const struct MenuAction *menuActions)
{
PrintMenuActionTextsAtPos(windowId, fontId, GetFontAttribute(fontId, FONTATTR_MAX_LETTER_WIDTH), 1, lineHeight, itemCount, menuActions);
}
@@ -1156,8 +1146,7 @@ void PrintMenuActionTexts(u8 windowId, u8 fontId, u8 left, u8 top, u8 letterSpac
CopyWindowToVram(windowId, COPYWIN_GFX);
}
-// Unused
-static void PrintMenuActionTextsAtTopById(u8 windowId, u8 fontId, u8 lineHeight, u8 itemCount, const struct MenuAction *menuActions, const u8 *actionIds)
+static void UNUSED PrintMenuActionTextsAtTopById(u8 windowId, u8 fontId, u8 lineHeight, u8 itemCount, const struct MenuAction *menuActions, const u8 *actionIds)
{
PrintMenuActionTexts(windowId, fontId, GetFontAttribute(fontId, FONTATTR_MAX_LETTER_WIDTH), 1, GetFontAttribute(fontId, FONTATTR_LETTER_SPACING), lineHeight, itemCount, menuActions, actionIds);
}
@@ -1214,7 +1203,7 @@ static void CreateYesNoMenuAtPos(const struct WindowTemplate *window, u8 fontId,
InitMenuNormal(sYesNoWindowId, fontId, left, top, GetFontAttribute(fontId, FONTATTR_MAX_LETTER_HEIGHT), 2, initialCursorPos);
}
-static void CreateYesNoMenuInTopLeft(const struct WindowTemplate *window, u8 fontId, u16 baseTileNum, u8 paletteNum)
+static void UNUSED CreateYesNoMenuInTopLeft(const struct WindowTemplate *window, u8 fontId, u16 baseTileNum, u8 paletteNum)
{
CreateYesNoMenuAtPos(window, fontId, 0, 1, baseTileNum, paletteNum, 0);
}
@@ -1245,8 +1234,7 @@ static void PrintMenuActionGridText(u8 windowId, u8 fontId, u8 left, u8 top, u8
CopyWindowToVram(windowId, COPYWIN_GFX);
}
-// Unused
-static void PrintMenuActionGridTextAtTop(u8 windowId, u8 fontId, u8 width, u8 height, u8 columns, u8 rows, const struct MenuAction *menuActions)
+static void UNUSED PrintMenuActionGridTextAtTop(u8 windowId, u8 fontId, u8 width, u8 height, u8 columns, u8 rows, const struct MenuAction *menuActions)
{
PrintMenuActionGridText(windowId, fontId, GetFontAttribute(fontId, FONTATTR_MAX_LETTER_WIDTH), 0, width, height, columns, rows, menuActions);
}
@@ -1282,8 +1270,7 @@ void PrintMenuActionGrid(u8 windowId, u8 fontId, u8 left, u8 top, u8 optionWidth
CopyWindowToVram(windowId, COPYWIN_GFX);
}
-// Unused
-static void PrintMenuActionGrid_TopLeft(u8 windowId, u8 fontId, u8 optionWidth, u8 unused, u8 horizontalCount, u8 verticalCount, const struct MenuAction *menuActions, const u8 *actionIds)
+static void UNUSED PrintMenuActionGrid_TopLeft(u8 windowId, u8 fontId, u8 optionWidth, u8 unused, u8 horizontalCount, u8 verticalCount, const struct MenuAction *menuActions, const u8 *actionIds)
{
PrintMenuActionGrid(windowId, fontId, GetFontAttribute(fontId, FONTATTR_MAX_LETTER_WIDTH), 0, optionWidth, horizontalCount, verticalCount, menuActions, actionIds);
}
@@ -1315,8 +1302,7 @@ static u8 InitMenuGrid(u8 windowId, u8 fontId, u8 left, u8 top, u8 optionWidth,
return sMenu.cursorPos;
}
-// Unused
-static u8 InitMenuGridDefaultCursorHeight(u8 windowId, u8 fontId, u8 left, u8 top, u8 width, u8 columns, u8 rows, u8 cursorPos)
+static u8 UNUSED InitMenuGridDefaultCursorHeight(u8 windowId, u8 fontId, u8 left, u8 top, u8 width, u8 columns, u8 rows, u8 cursorPos)
{
u8 cursorHeight = GetMenuCursorDimensionByFont(fontId, 1);
u8 numChoices = columns * rows;
@@ -1408,8 +1394,7 @@ u8 ChangeGridMenuCursorPosition(s8 deltaX, s8 deltaY)
}
}
-// Unused
-static s8 Menu_ProcessGridInput_NoSoundLimit(void)
+static s8 UNUSED Menu_ProcessGridInput_NoSoundLimit(void)
{
if (JOY_NEW(A_BUTTON))
{
@@ -1489,8 +1474,7 @@ s8 Menu_ProcessGridInput(void)
return MENU_NOTHING_CHOSEN;
}
-// Unused
-static s8 Menu_ProcessGridInputRepeat_NoSoundLimit(void)
+static s8 UNUSED Menu_ProcessGridInputRepeat_NoSoundLimit(void)
{
if (JOY_NEW(A_BUTTON))
{
@@ -1529,8 +1513,7 @@ static s8 Menu_ProcessGridInputRepeat_NoSoundLimit(void)
return MENU_NOTHING_CHOSEN;
}
-// Unused
-static s8 Menu_ProcessGridInputRepeat(void)
+static s8 UNUSED Menu_ProcessGridInputRepeat(void)
{
u8 oldPos = sMenu.cursorPos;
@@ -1674,8 +1657,7 @@ void PrintMenuGridTable(u8 windowId, u8 optionWidth, u8 columns, u8 rows, const
CopyWindowToVram(windowId, COPYWIN_GFX);
}
-// Unused
-static void PrintMenuActionGridTextNoSpacing(u8 windowId, u8 optionWidth, u8 columns, u8 rows, const struct MenuAction *menuActions, const u8 *actionIds)
+static void UNUSED PrintMenuActionGridTextNoSpacing(u8 windowId, u8 optionWidth, u8 columns, u8 rows, const struct MenuAction *menuActions, const u8 *actionIds)
{
u8 i;
u8 j;
@@ -2007,7 +1989,7 @@ void PrintPlayerNameOnWindow(u8 windowId, const u8 *src, u16 x, u16 y)
AddTextPrinterParameterized(windowId, 1, gStringVar4, x, y, TEXT_SKIP_DRAW, 0);
}
-static void UnusedBlitBitmapRect(const struct Bitmap *src, struct Bitmap *dst, u16 srcX, u16 srcY, u16 dstX, u16 dstY, u16 width, u16 height)
+static void UNUSED UnusedBlitBitmapRect(const struct Bitmap *src, struct Bitmap *dst, u16 srcX, u16 srcY, u16 dstX, u16 dstY, u16 width, u16 height)
{
int loopSrcY, loopDstY, loopSrcX, loopDstX, xEnd, yEnd, multiplierSrcY, multiplierDstY;
const u8 *pixelsSrc;
@@ -2082,14 +2064,12 @@ static void UnusedBlitBitmapRect(const struct Bitmap *src, struct Bitmap *dst, u
}
}
-// Unused
-static void LoadMonIconPalAtOffset(u8 palOffset, u16 speciesId)
+static void UNUSED LoadMonIconPalAtOffset(u8 palOffset, u16 speciesId)
{
LoadPalette(GetValidMonIconPalettePtr(speciesId), palOffset, PLTT_SIZE_4BPP);
}
-// Unused
-static void DrawMonIconAtPos(u8 windowId, u16 speciesId, u32 personality, u16 x, u16 y)
+static void UNUSED DrawMonIconAtPos(u8 windowId, u16 speciesId, u32 personality, u16 x, u16 y)
{
BlitBitmapToWindow(windowId, GetMonIconPtr(speciesId, personality, 1), x, y, 32, 32);
}
diff --git a/src/menu_specialized.c b/src/menu_specialized.c
index 15fdafbeb2..20ddce1f44 100644
--- a/src/menu_specialized.c
+++ b/src/menu_specialized.c
@@ -236,8 +236,7 @@ void MailboxMenu_RemoveWindow(u8 windowIdx)
sMailboxWindowIds[windowIdx] = WINDOW_NONE;
}
-// Unused
-static u8 MailboxMenu_GetWindowId(u8 windowIdx)
+static u8 UNUSED MailboxMenu_GetWindowId(u8 windowIdx)
{
return sMailboxWindowIds[windowIdx];
}
@@ -588,7 +587,7 @@ static void ConditionGraph_CalcRightHalf(struct ConditionGraph *graph)
// No need for conditional, positions on the Beauty line are always above the Cute line
ConditionGraph_CalcLine(graph, graph->scanlineRight[0], &graph->curPositions[GRAPH_BEAUTY], &graph->curPositions[GRAPH_CUTE], TRUE, NULL);
- // Calculate Cute -> Tough line (includes left scanline because this crosses the halfway point)
+ // Calculate Cute -> Smart line (includes left scanline because this crosses the halfway point)
i = (graph->curPositions[GRAPH_CUTE].y <= graph->curPositions[GRAPH_SMART].y);
ConditionGraph_CalcLine(graph, graph->scanlineRight[0], &graph->curPositions[GRAPH_CUTE], &graph->curPositions[GRAPH_SMART], i, graph->scanlineLeft[0]);
diff --git a/src/mini_printf.c b/src/mini_printf.c
index d96a9379a1..2a8c6e5cb7 100644
--- a/src/mini_printf.c
+++ b/src/mini_printf.c
@@ -41,7 +41,7 @@
#ifndef NDEBUG
-struct mini_buff
+struct mini_buff
{
char *buffer, *pbuffer;
u32 buffer_len;
@@ -95,9 +95,9 @@ static s32 _putsAscii(char *s, s32 len, void *buf)
s32 i;
struct mini_buff *b;
- if (!buf)
+ if (!buf)
return len;
-
+
b = buf;
p0 = b->buffer;
@@ -118,9 +118,9 @@ static s32 _putsEncoded(char *s, s32 len, void *buf)
s32 i;
struct mini_buff *b;
- if (!buf)
+ if (!buf)
return len;
-
+
b = buf;
p0 = b->buffer;
@@ -159,7 +159,7 @@ static s32 mini_itoa(s32 value, u32 radix, s32 uppercase, bool32 unsig, char *bu
}
/* This builds the string back to front ... */
- do
+ do
{
s32 digit = value % radix;
*(pbuffer++) = (digit < 10 ? '0' + digit : (uppercase ? 'A' : 'a') + digit - 10);
@@ -243,7 +243,7 @@ s32 mini_vpprintf(void* buf, const char *fmt, va_list va)
{
len = 1;
len = _putsAscii(&ch, len, buf);
- } else
+ } else
{
char pad_char = ' ';
s32 pad_to = 0;
@@ -270,7 +270,7 @@ s32 mini_vpprintf(void* buf, const char *fmt, va_list va)
ch=*(fmt++);
}
- switch (ch)
+ switch (ch)
{
case 0:
goto end;
@@ -328,7 +328,7 @@ s32 mini_vpprintf(void* buf, const char *fmt, va_list va)
break;
case 'S' : // preproc encoded string handler
ptr = va_arg(va, char*);
- len = StringLength(ptr);
+ len = StringLength((u8*)ptr);
if (pad_to > 0)
{
len = mini_pad(ptr, len, pad_char, pad_to, bf);
diff --git a/src/minigame_countdown.c b/src/minigame_countdown.c
index b4d3b6558b..617922e5aa 100644
--- a/src/minigame_countdown.c
+++ b/src/minigame_countdown.c
@@ -158,8 +158,7 @@ static const TaskFunc sStaticCountdownFuncs[][4] =
#define sId data[4] // Never read
#define sNumberSpriteId data[5] // Never read
-// Unused
-static u32 CreateStaticCountdownTask(u8 funcSetId, u8 taskPriority)
+static u32 UNUSED CreateStaticCountdownTask(u8 funcSetId, u8 taskPriority)
{
u8 taskId = CreateTask(Task_StaticCountdown, taskPriority);
struct Task *task = &gTasks[taskId];
@@ -170,7 +169,7 @@ static u32 CreateStaticCountdownTask(u8 funcSetId, u8 taskPriority)
return taskId;
}
-static bool32 StartStaticCountdown(void)
+static bool32 UNUSED StartStaticCountdown(void)
{
u8 taskId = FindTaskIdByFunc(Task_StaticCountdown);
if (taskId == TASK_NONE)
@@ -180,7 +179,7 @@ static bool32 StartStaticCountdown(void)
return TRUE;
}
-static bool32 IsStaticCountdownRunning(void)
+static bool32 UNUSED IsStaticCountdownRunning(void)
{
return FuncIsActiveTask(Task_StaticCountdown);
}
diff --git a/src/mirage_tower.c b/src/mirage_tower.c
index dce3c3e64c..c9345a4cea 100644
--- a/src/mirage_tower.c
+++ b/src/mirage_tower.c
@@ -435,7 +435,7 @@ void DoMirageTowerCeilingCrumble(void)
static void WaitCeilingCrumble(u8 taskId)
{
- u16 *data = gTasks[taskId].data;
+ u16 *data = (u16*)gTasks[taskId].data;
data[1]++;
// Either wait 1000 frames, or until all 16 crumble sprites and the one screen-shake task are completed.
if (data[1] == 1000 || data[0] == 17)
diff --git a/src/move_relearner.c b/src/move_relearner.c
index af4593e533..975663e4d3 100644
--- a/src/move_relearner.c
+++ b/src/move_relearner.c
@@ -369,7 +369,7 @@ static void VBlankCB_MoveRelearner(void)
TransferPlttBuffer();
}
-// Script arguments: The pokemon to teach is in VAR_0x8004
+// Script arguments: The Pokémon to teach is in VAR_0x8004
void TeachMoveRelearnerMove(void)
{
LockPlayerFieldControls();
diff --git a/src/mystery_gift_menu.c b/src/mystery_gift_menu.c
index c44b7a2620..78e4a45715 100644
--- a/src/mystery_gift_menu.c
+++ b/src/mystery_gift_menu.c
@@ -597,8 +597,7 @@ static void ShowDownArrow(void)
DrawDownArrow(WIN_MSG, DOWN_ARROW_X, DOWN_ARROW_Y, 1, TRUE, &sDownArrowCounterAndYCoordIdx[0], &sDownArrowCounterAndYCoordIdx[1]);
}
-// Unused
-static bool32 HideDownArrowAndWaitButton(u8 * textState)
+static bool32 UNUSED HideDownArrowAndWaitButton(u8 * textState)
{
switch (*textState)
{
@@ -722,7 +721,7 @@ s8 DoMysteryGiftYesNo(u8 * textState, u16 * windowId, bool8 yesNoBoxPlacement, c
// Handle the "Receive/Send/Toss" menu that appears when selecting Wonder Card/News
static s32 HandleGiftSelectMenu(u8 * textState, u16 * windowId, bool32 cannotToss, bool32 cannotSend)
{
- struct WindowTemplate windowTemplate;
+ struct WindowTemplate UNUSED windowTemplate;
s32 input;
switch (*textState)
diff --git a/src/naming_screen.c b/src/naming_screen.c
index 072df9a079..f321d0fbf6 100644
--- a/src/naming_screen.c
+++ b/src/naming_screen.c
@@ -2058,23 +2058,23 @@ static bool8 IsWideLetter(u8 character)
return FALSE;
}
-// Debug? Unused, and arguments aren't sensible for non-player screens.
-static void Debug_NamingScreenPlayer(void)
+// Debug? Arguments aren't sensible for non-player screens.
+static void UNUSED Debug_NamingScreenPlayer(void)
{
DoNamingScreen(NAMING_SCREEN_PLAYER, gSaveBlock2Ptr->playerName, gSaveBlock2Ptr->playerGender, 0, 0, CB2_ReturnToFieldWithOpenMenu);
}
-static void Debug_NamingScreenBox(void)
+static void UNUSED Debug_NamingScreenBox(void)
{
DoNamingScreen(NAMING_SCREEN_BOX, gSaveBlock2Ptr->playerName, gSaveBlock2Ptr->playerGender, 0, 0, CB2_ReturnToFieldWithOpenMenu);
}
-static void Debug_NamingScreenCaughtMon(void)
+static void UNUSED Debug_NamingScreenCaughtMon(void)
{
DoNamingScreen(NAMING_SCREEN_CAUGHT_MON, gSaveBlock2Ptr->playerName, gSaveBlock2Ptr->playerGender, 0, 0, CB2_ReturnToFieldWithOpenMenu);
}
-static void Debug_NamingScreenNickname(void)
+static void UNUSED Debug_NamingScreenNickname(void)
{
DoNamingScreen(NAMING_SCREEN_NICKNAME, gSaveBlock2Ptr->playerName, gSaveBlock2Ptr->playerGender, 0, 0, CB2_ReturnToFieldWithOpenMenu);
}
diff --git a/src/overworld.c b/src/overworld.c
index 937643c5e1..4ecb30f45b 100644
--- a/src/overworld.c
+++ b/src/overworld.c
@@ -135,14 +135,11 @@ static void CreateLinkPlayerSprite(u8, u8);
static void GetLinkPlayerCoords(u8, u16 *, u16 *);
static u8 GetLinkPlayerFacingDirection(u8);
static u8 GetLinkPlayerElevation(u8);
-static s32 GetLinkPlayerObjectStepTimer(u8);
static u8 GetLinkPlayerIdAt(s16, s16);
static void SetPlayerFacingDirection(u8, u8);
static void ZeroObjectEvent(struct ObjectEvent *);
static void SpawnLinkPlayerObjectEvent(u8, s16, s16, u8);
static void InitLinkPlayerObjectEventPos(struct ObjectEvent *, s16, s16);
-static void SetLinkPlayerObjectRange(u8, u8);
-static void DestroyLinkPlayerObject(u8);
static u8 GetSpriteForLinkedPlayer(u8);
static void RunTerminateLinkScript(void);
static u32 GetLinkSendQueueLength(void);
@@ -1008,8 +1005,8 @@ void SetObjectEventLoadFlag(u8 flag)
sObjectEventLoadFlag = flag;
}
-// Unused, sObjectEventLoadFlag is read directly
-static u8 GetObjectEventLoadFlag(void)
+// sObjectEventLoadFlag is read directly
+static u8 UNUSED GetObjectEventLoadFlag(void)
{
return sObjectEventLoadFlag;
}
@@ -1304,7 +1301,7 @@ void UpdateAmbientCry(s16 *state, u16 *delayCounter)
}
}
// Ambient cries after the first one take between 1200-2399 frames (~20-40 seconds)
- // If the player has a pokemon with the ability Swarm in their party, the time is halved to 600-1199 frames (~10-20 seconds)
+ // If the player has a Pokémon with the ability Swarm in their party, the time is halved to 600-1199 frames (~10-20 seconds)
*delayCounter = ((Random() % 1200) + 1200) / divBy;
*state = AMB_CRY_WAIT;
break;
@@ -1316,7 +1313,7 @@ void UpdateAmbientCry(s16 *state, u16 *delayCounter)
}
break;
case AMB_CRY_IDLE:
- // No land/water pokemon on this map
+ // No land/water Pokémon on this map
break;
}
}
@@ -1327,7 +1324,7 @@ static void ChooseAmbientCrySpecies(void)
&& gSaveBlock1Ptr->location.mapNum == MAP_NUM(ROUTE130))
&& !IsMirageIslandPresent())
{
- // Only play water pokemon cries on this route
+ // Only play water Pokémon cries on this route
// when Mirage Island is not present
sIsAmbientCryWaterMon = TRUE;
sAmbientCrySpecies = GetLocalWaterMon();
@@ -2171,7 +2168,7 @@ static void InitObjectEventsLink(void)
static void InitObjectEventsLocal(void)
{
- s16 x, y;
+ u16 x, y;
struct InitialPlayerAvatarState *player;
gTotalCameraPixelOffsetX = 0;
@@ -2668,8 +2665,7 @@ u32 GetCableClubPartnersReady(void)
return CABLE_SEAT_WAITING;
}
-// Unused
-static bool32 IsAnyPlayerExitingCableClub(void)
+static bool32 UNUSED IsAnyPlayerExitingCableClub(void)
{
return IsAnyPlayerInLinkState(PLAYER_LINK_STATE_EXITING_ROOM);
}
@@ -2977,7 +2973,7 @@ static void InitLinkPlayerObjectEventPos(struct ObjectEvent *objEvent, s16 x, s1
ObjectEventUpdateElevation(objEvent, NULL);
}
-static void SetLinkPlayerObjectRange(u8 linkPlayerId, u8 dir)
+static void UNUSED SetLinkPlayerObjectRange(u8 linkPlayerId, u8 dir)
{
if (gLinkPlayerObjectEvents[linkPlayerId].active)
{
@@ -2987,7 +2983,7 @@ static void SetLinkPlayerObjectRange(u8 linkPlayerId, u8 dir)
}
}
-static void DestroyLinkPlayerObject(u8 linkPlayerId)
+static void UNUSED DestroyLinkPlayerObject(u8 linkPlayerId)
{
struct LinkPlayerObjectEvent *linkPlayerObjEvent = &gLinkPlayerObjectEvents[linkPlayerId];
u8 objEventId = linkPlayerObjEvent->objEventId;
@@ -3028,7 +3024,7 @@ static u8 GetLinkPlayerElevation(u8 linkPlayerId)
return objEvent->currentElevation;
}
-static s32 GetLinkPlayerObjectStepTimer(u8 linkPlayerId)
+static s32 UNUSED GetLinkPlayerObjectStepTimer(u8 linkPlayerId)
{
u8 objEventId = gLinkPlayerObjectEvents[linkPlayerId].objEventId;
struct ObjectEvent *objEvent = &gObjectEvents[objEventId];
diff --git a/src/palette.c b/src/palette.c
index 63578d5d49..a9b3d207b3 100644
--- a/src/palette.c
+++ b/src/palette.c
@@ -205,15 +205,13 @@ bool8 BeginNormalPaletteFade(u32 selectedPalettes, s8 delay, u8 startY, u8 targe
}
}
-// Unused
-static bool8 BeginPlttFade(u32 selectedPalettes, u8 delay, u8 startY, u8 targetY, u16 blendColor)
+static bool8 UNUSED BeginPlttFade(u32 selectedPalettes, u8 delay, u8 startY, u8 targetY, u16 blendColor)
{
ReadPlttIntoBuffers();
return BeginNormalPaletteFade(selectedPalettes, delay, startY, targetY, blendColor);
}
-// Unused
-static void PaletteStruct_Run(u8 a1, u32 *unkFlags)
+static void UNUSED PaletteStruct_Run(u8 a1, u32 *unkFlags)
{
u8 i;
@@ -386,14 +384,14 @@ void ResetPaletteFadeControl(void)
gPaletteFade.deltaY = 2;
}
-static void PaletteStruct_SetUnusedFlag(u16 id)
+static void UNUSED PaletteStruct_SetUnusedFlag(u16 id)
{
u8 paletteNum = PaletteStruct_GetPalNum(id);
if (paletteNum != NUM_PALETTE_STRUCTS)
sPaletteStructs[paletteNum].flag = TRUE;
}
-static void PaletteStruct_ClearUnusedFlag(u16 id)
+static void UNUSED PaletteStruct_ClearUnusedFlag(u16 id)
{
u8 paletteNum = PaletteStruct_GetPalNum(id);
if (paletteNum != NUM_PALETTE_STRUCTS)
@@ -1072,8 +1070,7 @@ void BlendPalettesGradually(u32 selectedPalettes, s8 delay, u8 coeff, u8 coeffTa
gTasks[taskId].func(taskId);
}
-// Unused
-static bool32 IsBlendPalettesGraduallyTaskActive(u8 id)
+static bool32 UNUSED IsBlendPalettesGraduallyTaskActive(u8 id)
{
int i;
@@ -1086,8 +1083,7 @@ static bool32 IsBlendPalettesGraduallyTaskActive(u8 id)
return FALSE;
}
-// Unused
-static void DestroyBlendPalettesGraduallyTask(void)
+static void UNUSED DestroyBlendPalettesGraduallyTask(void)
{
u8 taskId;
diff --git a/src/palette_util.c b/src/palette_util.c
index 08239c3363..d24321d580 100755
--- a/src/palette_util.c
+++ b/src/palette_util.c
@@ -39,8 +39,7 @@ u8 RouletteFlash_Add(struct RouletteFlashUtil *flash, u8 id, const struct Roulet
return id;
}
-// Unused
-static u8 RouletteFlash_Remove(struct RouletteFlashUtil *flash, u8 id)
+static u8 UNUSED RouletteFlash_Remove(struct RouletteFlashUtil *flash, u8 id)
{
if (id >= ARRAY_COUNT(flash->palettes))
return 0xFF;
@@ -470,7 +469,7 @@ void SetTilemapRect(u16 *dest, u16 *src, u8 left, u8 top, u8 width, u8 height)
}
}
-static void FillTilemapRect_Unused(void *dest, u16 value, u8 left, u8 top, u8 width, u8 height)
+static void UNUSED FillTilemapRect_Unused(void *dest, u16 value, u8 left, u8 top, u8 width, u8 height)
{
u8 i, j;
u8 x, y;
@@ -486,7 +485,7 @@ static void FillTilemapRect_Unused(void *dest, u16 value, u8 left, u8 top, u8 wi
}
}
-static void SetTilemapRect_Unused(void *dest, const u16 *src, u8 left, u8 top, u8 width, u8 height)
+static void UNUSED SetTilemapRect_Unused(void *dest, const u16 *src, u8 left, u8 top, u8 width, u8 height)
{
u8 i, j;
u8 x, y;
diff --git a/src/party_menu.c b/src/party_menu.c
index abed29e78c..41e7fe1021 100755
--- a/src/party_menu.c
+++ b/src/party_menu.c
@@ -170,7 +170,7 @@ enum {
};
enum {
- // Window ids 0-5 are implicitly assigned to each party pokemon in InitPartyMenuBoxes
+ // Window ids 0-5 are implicitly assigned to each party Pokémon in InitPartyMenuBoxes
WIN_MSG = PARTY_SIZE,
};
@@ -1938,7 +1938,7 @@ u8 GetMonAilment(struct Pokemon *mon)
static void SetPartyMonsAllowedInMinigame(void)
{
- u16 *ptr;
+ s16 *ptr;
if (gPartyMenu.menuType == PARTY_MENU_TYPE_MINIGAME)
{
@@ -4160,9 +4160,9 @@ static void PartyMenuStartSpriteAnim(u8 spriteId, u8 animNum)
StartSpriteAnim(&gSprites[spriteId], animNum);
}
-// Unused. Might explain the large blank section in gPartyMenuPokeballSmall_Gfx
+// Might explain the large blank section in gPartyMenuPokeballSmall_Gfx
// At the very least this is how the unused anim cmds for sSpriteAnimTable_MenuPokeballSmall were meant to be accessed
-static void SpriteCB_BounceConfirmCancelButton(u8 spriteId, u8 spriteId2, u8 animNum)
+static void UNUSED SpriteCB_BounceConfirmCancelButton(u8 spriteId, u8 spriteId2, u8 animNum)
{
if (animNum == 0)
{
@@ -5807,7 +5807,7 @@ static bool8 TrySwitchInPokemon(void)
u8 newSlot;
u8 i;
- // In a multi battle, slots 1, 4, and 5 are the partner's pokemon
+ // In a multi battle, slots 1, 4, and 5 are the partner's Pokémon
if (IsMultiBattle() == TRUE && (slot == 1 || slot == 4 || slot == 5))
{
StringCopy(gStringVar1, GetTrainerPartnerName());
@@ -6101,8 +6101,7 @@ static void UpdatePartyToFieldOrder(void)
Free(partyBuffer);
}
-// Unused
-static void SwitchAliveMonIntoLeadSlot(void)
+static void UNUSED SwitchAliveMonIntoLeadSlot(void)
{
u8 i;
struct Pokemon *mon;
@@ -6204,8 +6203,7 @@ void ChooseMonForDaycare(void)
InitPartyMenu(PARTY_MENU_TYPE_DAYCARE, PARTY_LAYOUT_SINGLE, PARTY_ACTION_CHOOSE_MON, FALSE, PARTY_MSG_CHOOSE_MON_2, Task_HandleChooseMonInput, BufferMonSelection);
}
-// Unused
-static void ChoosePartyMonByMenuType(u8 menuType)
+static void UNUSED ChoosePartyMonByMenuType(u8 menuType)
{
gFieldCallback2 = CB2_FadeFromPartyMenu;
InitPartyMenu(menuType, PARTY_LAYOUT_SINGLE, PARTY_ACTION_CHOOSE_AND_CLOSE, FALSE, PARTY_MSG_CHOOSE_MON, Task_HandleChooseMonInput, CB2_ReturnToField);
diff --git a/src/player_pc.c b/src/player_pc.c
index f53e08f532..009aa7810f 100644
--- a/src/player_pc.c
+++ b/src/player_pc.c
@@ -191,10 +191,10 @@ static const u8 *const sItemStorage_OptionDescriptions[] =
static const struct MenuAction sPlayerPCMenuActions[] =
{
- [MENU_ITEMSTORAGE] = { gText_ItemStorage, PlayerPC_ItemStorage },
- [MENU_MAILBOX] = { gText_Mailbox, PlayerPC_Mailbox },
- [MENU_DECORATION] = { gText_Decoration, PlayerPC_Decoration },
- [MENU_TURNOFF] = { gText_TurnOff, PlayerPC_TurnOff }
+ [MENU_ITEMSTORAGE] = { gText_ItemStorage, {PlayerPC_ItemStorage} },
+ [MENU_MAILBOX] = { gText_Mailbox, {PlayerPC_Mailbox} },
+ [MENU_DECORATION] = { gText_Decoration, {PlayerPC_Decoration} },
+ [MENU_TURNOFF] = { gText_TurnOff, {PlayerPC_TurnOff} }
};
static const u8 sBedroomPC_OptionOrder[] =
@@ -216,13 +216,13 @@ static const u8 sPlayerPC_OptionOrder[] =
static const struct MenuAction sItemStorage_MenuActions[] =
{
- [MENU_WITHDRAW] = { gText_WithdrawItem, ItemStorage_Withdraw },
- [MENU_DEPOSIT] = { gText_DepositItem, ItemStorage_Deposit },
- [MENU_TOSS] = { gText_TossItem, ItemStorage_Toss },
- [MENU_EXIT] = { gText_Cancel, ItemStorage_Exit }
+ [MENU_WITHDRAW] = { gText_WithdrawItem, {ItemStorage_Withdraw} },
+ [MENU_DEPOSIT] = { gText_DepositItem, {ItemStorage_Deposit} },
+ [MENU_TOSS] = { gText_TossItem, {ItemStorage_Toss} },
+ [MENU_EXIT] = { gText_Cancel, {ItemStorage_Exit} }
};
-static const struct ItemSlot sNewGamePCItems[] =
+static const u16 sNewGamePCItems[][2] =
{
{ ITEM_POTION, 1 },
{ ITEM_NONE, 0 }
@@ -230,10 +230,10 @@ static const struct ItemSlot sNewGamePCItems[] =
const struct MenuAction gMailboxMailOptions[] =
{
- { gText_Read, Mailbox_DoMailRead },
- { gText_MoveToBag, Mailbox_MoveToBag },
- { gText_Give2, Mailbox_Give },
- { gText_Cancel2, Mailbox_Cancel }
+ { gText_Read, {Mailbox_DoMailRead} },
+ { gText_MoveToBag, {Mailbox_MoveToBag} },
+ { gText_Give2, {Mailbox_Give} },
+ { gText_Cancel2, {Mailbox_Cancel} }
};
static const struct WindowTemplate sWindowTemplates_MainMenus[] =
@@ -355,16 +355,20 @@ static const struct WindowTemplate sWindowTemplates_ItemStorage[ITEMPC_WIN_COUNT
static const u8 sSwapArrowTextColors[] = {TEXT_COLOR_WHITE, TEXT_COLOR_LIGHT_GRAY, TEXT_COLOR_DARK_GRAY};
-// Macro below is likely a fakematch, equivalent to sNewGamePCItems[i].quantity
-#define GET_QUANTITY(i) ((u16)((u16 *)sNewGamePCItems + 1)[i * 2])
void NewGameInitPCItems(void)
{
u8 i = 0;
ClearItemSlots(gSaveBlock1Ptr->pcItems, PC_ITEMS_COUNT);
- for(; sNewGamePCItems[i].itemId != ITEM_NONE && GET_QUANTITY(i) &&
- AddPCItem(sNewGamePCItems[i].itemId, GET_QUANTITY(i)) == TRUE; i++);
+
+ while (TRUE)
+ {
+ if (sNewGamePCItems[i][0] == ITEM_NONE || sNewGamePCItems[i][1] == 0)
+ break;
+ if (AddPCItem(sNewGamePCItems[i][0], sNewGamePCItems[i][1]) != TRUE)
+ break;
+ i++;
+ }
}
-#undef GET_QUANTITY
void BedroomPC(void)
{
diff --git a/src/pokeball.c b/src/pokeball.c
index 3340ea76c4..47335fe4ec 100644
--- a/src/pokeball.c
+++ b/src/pokeball.c
@@ -1025,10 +1025,10 @@ static u8 LaunchBallFadeMonTaskForPokeball(bool8 unFadeLater, u8 spritePalNum, u
return LaunchBallFadeMonTask(unFadeLater, spritePalNum, selectedPalettes, BALL_POKE);
}
-// Sprite data for the pokemon
+// Sprite data for the Pokémon
#define sSpecies data[7]
-// Sprite data for the pokeball
+// Sprite data for the Poké Ball
#define sMonSpriteId data[0]
#define sDelay data[1]
#define sMonPalNum data[2]
@@ -1038,7 +1038,7 @@ static u8 LaunchBallFadeMonTaskForPokeball(bool8 unFadeLater, u8 spritePalNum, u
#define sFinalMonY data[6]
#define sTrigIdx data[7]
-// Pokeball in Birch intro, and when receiving via trade
+// Poké Ball in Birch intro, and when receiving via trade
void CreatePokeballSpriteToReleaseMon(u8 monSpriteId, u8 monPalNum, u8 x, u8 y, u8 oamPriority, u8 subpriority, u8 delay, u32 fadePalettes, u16 species)
{
u8 spriteId;
@@ -1239,7 +1239,7 @@ static void SpriteCB_TradePokeballEnd(struct Sprite *sprite)
#undef sTimer
// Unreferenced here and in RS, but used in FRLG, possibly by mistake.
-static void DestroySpriteAndFreeResources_Ball(struct Sprite *sprite)
+static void UNUSED DestroySpriteAndFreeResources_Ball(struct Sprite *sprite)
{
DestroySpriteAndFreeResources(sprite);
}
diff --git a/src/pokeblock.c b/src/pokeblock.c
index e490f372c4..e01e821f7e 100644
--- a/src/pokeblock.c
+++ b/src/pokeblock.c
@@ -215,12 +215,12 @@ const u8 *const gPokeblockNames[] =
static const struct MenuAction sPokeblockMenuActions[] =
{
- [PKBL_USE_ON_FIELD] = {gMenuText_Use, PokeblockAction_UseOnField},
- [PKBL_TOSS] = {gMenuText_Toss, PokeblockAction_Toss},
- [PKBL_CANCEL] = {gText_Cancel2, PokeblockAction_Cancel},
- [PKBL_USE_IN_BATTLE] = {gMenuText_Use, PokeblockAction_UseInBattle},
- [PKBL_USE_ON_FEEDER] = {gMenuText_Use, PokeblockAction_UseOnPokeblockFeeder},
- [PKBL_GIVE_TO_LADY] = {gMenuText_Give2, PokeblockAction_GiveToContestLady},
+ [PKBL_USE_ON_FIELD] = {gMenuText_Use, {PokeblockAction_UseOnField}},
+ [PKBL_TOSS] = {gMenuText_Toss, {PokeblockAction_Toss}},
+ [PKBL_CANCEL] = {gText_Cancel2, {PokeblockAction_Cancel}},
+ [PKBL_USE_IN_BATTLE] = {gMenuText_Use, {PokeblockAction_UseInBattle}},
+ [PKBL_USE_ON_FEEDER] = {gMenuText_Use, {PokeblockAction_UseOnPokeblockFeeder}},
+ [PKBL_GIVE_TO_LADY] = {gMenuText_Give2, {PokeblockAction_GiveToContestLady}},
};
static const u8 sActionsOnField[] = {PKBL_USE_ON_FIELD, PKBL_TOSS, PKBL_CANCEL};
diff --git a/src/pokedex.c b/src/pokedex.c
index 3f5ab22431..0d1520a490 100644
--- a/src/pokedex.c
+++ b/src/pokedex.c
@@ -1758,7 +1758,7 @@ static void Task_HandlePokedexStartMenuInput(u8 taskId)
CreateMonSpritesAtPos(sPokedexView->selectedPokemon, 0xE);
gMain.newKeys |= START_BUTTON; //Exit menu
break;
- case 3: //CLOSE POKEDEX
+ case 3: //CLOSE POKéDEX
BeginNormalPaletteFade(PALETTES_ALL, 0, 0, 0x10, RGB_BLACK);
gTasks[taskId].func = Task_ClosePokedex;
PlaySE(SE_PC_OFF);
@@ -1958,12 +1958,12 @@ static void Task_HandleSearchResultsStartMenuInput(u8 taskId)
CreateMonSpritesAtPos(sPokedexView->selectedPokemon, 0xE);
gMain.newKeys |= START_BUTTON;
break;
- case 3: //BACK TO POKEDEX
+ case 3: //BACK TO POKéDEX
BeginNormalPaletteFade(PALETTES_ALL, 0, 0, 0x10, RGB_BLACK);
gTasks[taskId].func = Task_ReturnToPokedexFromSearchResults;
PlaySE(SE_TRUCK_DOOR);
break;
- case 4: //CLOSE POKEDEX
+ case 4: //CLOSE POKéDEX
BeginNormalPaletteFade(PALETTES_ALL, 0, 0, 0x10, RGB_BLACK);
gTasks[taskId].func = Task_ClosePokedexFromSearchResultsStartMenu;
PlaySE(SE_PC_OFF);
@@ -2049,7 +2049,7 @@ static void Task_ClosePokedexFromSearchResultsStartMenu(u8 taskId)
#undef tLoadScreenTaskId
-// For loading main pokedex page or pokedex search results
+// For loading main pokedex page or Pokédex search results
static bool8 LoadPokedexListPage(u8 page)
{
switch (gMain.state)
@@ -4480,7 +4480,7 @@ static void PrintInfoSubMenuText(u8 windowId, const u8 *str, u8 left, u8 top)
AddTextPrinterParameterized4(windowId, FONT_NORMAL, left, top, 0, 0, color, TEXT_SKIP_DRAW, str);
}
-static void UnusedPrintNum(u8 windowId, u16 num, u8 left, u8 top)
+static void UNUSED UnusedPrintNum(u8 windowId, u16 num, u8 left, u8 top)
{
u8 str[4];
@@ -4514,7 +4514,7 @@ static u8 PrintCryScreenSpeciesName(u8 windowId, u16 num, u8 left, u8 top)
return i;
}
-static void UnusedPrintMonName(u8 windowId, const u8 *name, u8 left, u8 top)
+static void UNUSED UnusedPrintMonName(u8 windowId, const u8 *name, u8 left, u8 top)
{
u8 str[POKEMON_NAME_LENGTH + 1];
u8 i;
@@ -4535,7 +4535,7 @@ static void UnusedPrintMonName(u8 windowId, const u8 *name, u8 left, u8 top)
}
// Unused in the English version, used to print height/weight in versions which use metric system.
-static void PrintDecimalNum(u8 windowId, u16 num, u8 left, u8 top)
+static void UNUSED PrintDecimalNum(u8 windowId, u16 num, u8 left, u8 top)
{
u8 str[6];
bool8 outputted = FALSE;
@@ -4606,8 +4606,8 @@ static void DrawFootprint(u8 windowId, u16 dexNum)
CopyToWindowPixelBuffer(windowId, footprint4bpp, sizeof(footprint4bpp), 0);
}
-// Unused Ruby/Sapphire function.
-static void RS_DrawFootprint(u16 offset, u16 tileNum)
+// Ruby/Sapphire function.
+static void UNUSED RS_DrawFootprint(u16 offset, u16 tileNum)
{
*(u16 *)(VRAM + offset * 0x800 + 0x232) = 0xF000 + tileNum + 0;
*(u16 *)(VRAM + offset * 0x800 + 0x234) = 0xF000 + tileNum + 1;
diff --git a/src/pokemon.c b/src/pokemon.c
index c931352c09..314a5e094c 100644
--- a/src/pokemon.c
+++ b/src/pokemon.c
@@ -48,6 +48,14 @@
#include "constants/trainers.h"
#include "constants/union_room.h"
+#define DAY_EVO_HOUR_BEGIN 12
+#define DAY_EVO_HOUR_END HOURS_PER_DAY
+
+#define NIGHT_EVO_HOUR_BEGIN 0
+#define NIGHT_EVO_HOUR_END 12
+
+#define FRIENDSHIP_EVO_THRESHOLD 220
+
struct SpeciesItem
{
u16 species;
@@ -62,7 +70,7 @@ static void Task_PlayMapChosenOrBattleBGM(u8 taskId);
static bool8 ShouldGetStatBadgeBoost(u16 flagId, u8 battlerId);
static u16 GiveMoveToBoxMon(struct BoxPokemon *boxMon, u16 move);
static bool8 ShouldSkipFriendshipChange(void);
-static u8 SendMonToPC(struct Pokemon *mon);
+static u8 CopyMonToPC(struct Pokemon *mon);
EWRAM_DATA static u8 sLearningMoveTableID = 0;
EWRAM_DATA u8 gPlayerPartyCount = 0;
@@ -1346,10 +1354,10 @@ static const u16 sHoennToNationalOrder[NUM_SPECIES - 1] =
const struct SpindaSpot gSpindaSpotGraphics[] =
{
- {.x = 16, .y = 7, .image = INCBIN_U16("graphics/spinda_spots/spot_0.1bpp")},
- {.x = 40, .y = 8, .image = INCBIN_U16("graphics/spinda_spots/spot_1.1bpp")},
- {.x = 22, .y = 25, .image = INCBIN_U16("graphics/spinda_spots/spot_2.1bpp")},
- {.x = 34, .y = 26, .image = INCBIN_U16("graphics/spinda_spots/spot_3.1bpp")}
+ {.x = 16, .y = 7, .image = INCBIN_U16("graphics/pokemon/spinda/spots/spot_0.1bpp")},
+ {.x = 40, .y = 8, .image = INCBIN_U16("graphics/pokemon/spinda/spots/spot_1.1bpp")},
+ {.x = 22, .y = 25, .image = INCBIN_U16("graphics/pokemon/spinda/spots/spot_2.1bpp")},
+ {.x = 34, .y = 26, .image = INCBIN_U16("graphics/pokemon/spinda/spots/spot_3.1bpp")}
};
#include "data/pokemon/item_effects.h"
@@ -4479,14 +4487,14 @@ u8 GiveMonToPlayer(struct Pokemon *mon)
}
if (i >= PARTY_SIZE)
- return SendMonToPC(mon);
+ return CopyMonToPC(mon);
CopyMon(&gPlayerParty[i], mon, sizeof(*mon));
gPlayerPartyCount = i + 1;
return MON_GIVEN_TO_PARTY;
}
-static u8 SendMonToPC(struct Pokemon *mon)
+static u8 CopyMonToPC(struct Pokemon *mon)
{
s32 boxNo, boxPos;
@@ -5575,17 +5583,17 @@ u16 GetEvolutionTargetSpecies(struct Pokemon *mon, u8 mode, u16 evolutionItem)
switch (gEvolutionTable[species][i].method)
{
case EVO_FRIENDSHIP:
- if (friendship >= 220)
+ if (friendship >= FRIENDSHIP_EVO_THRESHOLD)
targetSpecies = gEvolutionTable[species][i].targetSpecies;
break;
case EVO_FRIENDSHIP_DAY:
RtcCalcLocalTime();
- if (gLocalTime.hours >= 12 && gLocalTime.hours < 24 && friendship >= 220)
+ if (gLocalTime.hours >= DAY_EVO_HOUR_BEGIN && gLocalTime.hours < DAY_EVO_HOUR_END && friendship >= FRIENDSHIP_EVO_THRESHOLD)
targetSpecies = gEvolutionTable[species][i].targetSpecies;
break;
case EVO_FRIENDSHIP_NIGHT:
RtcCalcLocalTime();
- if (gLocalTime.hours >= 0 && gLocalTime.hours < 12 && friendship >= 220)
+ if (gLocalTime.hours >= NIGHT_EVO_HOUR_BEGIN && gLocalTime.hours < NIGHT_EVO_HOUR_END && friendship >= FRIENDSHIP_EVO_THRESHOLD)
targetSpecies = gEvolutionTable[species][i].targetSpecies;
break;
case EVO_LEVEL:
@@ -5837,7 +5845,7 @@ u16 SpeciesToCryId(u16 species)
// Same as DrawSpindaSpots but attempts to discern for itself whether or
// not it's the front pic.
-static void DrawSpindaSpotsUnused(u16 species, u32 personality, u8 *dest)
+static void UNUSED DrawSpindaSpotsUnused(u16 species, u32 personality, u8 *dest)
{
if (species == SPECIES_SPINDA
&& dest != gMonSpritesGfxPtr->sprites.ptr[B_POSITION_PLAYER_LEFT]
@@ -6920,9 +6928,9 @@ void BattleAnimateBackSprite(struct Sprite *sprite, u16 species)
}
}
-// Unused, identical to GetOpposingLinkMultiBattlerId but for the player
+// Identical to GetOpposingLinkMultiBattlerId but for the player
// "rightSide" from that team's perspective, i.e. B_POSITION_*_RIGHT
-static u8 GetOwnOpposingLinkMultiBattlerId(bool8 rightSide)
+static u8 UNUSED GetOwnOpposingLinkMultiBattlerId(bool8 rightSide)
{
s32 i;
s32 battlerId = 0;
diff --git a/src/pokemon_animation.c b/src/pokemon_animation.c
index 6afbd20b7d..25c7778f8b 100644
--- a/src/pokemon_animation.c
+++ b/src/pokemon_animation.c
@@ -846,13 +846,13 @@ static const u8 sBackAnimNatureModTable[NUM_NATURES] =
static const union AffineAnimCmd sMonAffineAnim_0[] =
{
AFFINEANIMCMD_FRAME(256, 256, 0, 0),
- AFFINEANIMCMDTYPE_END
+ {AFFINEANIMCMDTYPE_END}
};
static const union AffineAnimCmd sMonAffineAnim_1[] =
{
AFFINEANIMCMD_FRAME(-256, 256, 0, 0),
- AFFINEANIMCMDTYPE_END
+ {AFFINEANIMCMDTYPE_END}
};
static const union AffineAnimCmd *const sMonAffineAnims[] =
diff --git a/src/pokemon_icon.c b/src/pokemon_icon.c
index 8e37018cba..e659eebe21 100644
--- a/src/pokemon_icon.c
+++ b/src/pokemon_icon.c
@@ -146,7 +146,7 @@ const u8 *const gMonIconTable[] =
[SPECIES_SEAKING] = gMonIcon_Seaking,
[SPECIES_STARYU] = gMonIcon_Staryu,
[SPECIES_STARMIE] = gMonIcon_Starmie,
- [SPECIES_MR_MIME] = gMonIcon_Mrmime,
+ [SPECIES_MR_MIME] = gMonIcon_MrMime,
[SPECIES_SCYTHER] = gMonIcon_Scyther,
[SPECIES_JYNX] = gMonIcon_Jynx,
[SPECIES_ELECTABUZZ] = gMonIcon_Electabuzz,
diff --git a/src/pokemon_jump.c b/src/pokemon_jump.c
index 4461d8ad2a..d744ff6650 100755
--- a/src/pokemon_jump.c
+++ b/src/pokemon_jump.c
@@ -3968,7 +3968,7 @@ struct UnusedPacket
// Data packet that's never sent
// No function to read it either
-static void SendPacket_Unused(u32 data)
+static void UNUSED SendPacket_Unused(u32 data)
{
struct UnusedPacket packet;
packet.id = PACKET_UNUSED;
diff --git a/src/pokemon_storage_system.c b/src/pokemon_storage_system.c
index 9db0d77c6c..c8c87961c8 100644
--- a/src/pokemon_storage_system.c
+++ b/src/pokemon_storage_system.c
@@ -199,7 +199,7 @@ enum {
CURSOR_AREA_IN_BOX,
CURSOR_AREA_IN_PARTY,
CURSOR_AREA_BOX_TITLE,
- CURSOR_AREA_BUTTONS, // Party Pokemon and Close Box
+ CURSOR_AREA_BUTTONS, // Party Pokémon and Close Box
};
#define CURSOR_AREA_IN_HAND CURSOR_AREA_BOX_TITLE // Alt name for cursor area used by Move Items
@@ -1370,8 +1370,7 @@ void DrawTextWindowAndBufferTiles(const u8 *string, void *dst, u8 zero1, u8 zero
RemoveWindow(windowId);
}
-// Unused
-static void UnusedDrawTextWindow(const u8 *string, void *dst, u16 offset, u8 bgColor, u8 fgColor, u8 shadowColor)
+static void UNUSED UnusedDrawTextWindow(const u8 *string, void *dst, u16 offset, u8 bgColor, u8 fgColor, u8 shadowColor)
{
u32 tilesSize;
u8 windowId;
@@ -1486,8 +1485,7 @@ u8 *StringCopyAndFillWithSpaces(u8 *dst, const u8 *src, u16 n)
return str;
}
-// Unused
-static void UnusedWriteRectCpu(u16 *dest, u16 dest_left, u16 dest_top, const u16 *src, u16 src_left, u16 src_top, u16 dest_width, u16 dest_height, u16 src_width)
+static void UNUSED UnusedWriteRectCpu(u16 *dest, u16 dest_left, u16 dest_top, const u16 *src, u16 src_left, u16 src_top, u16 dest_width, u16 dest_height, u16 src_width)
{
u16 i;
@@ -1502,8 +1500,7 @@ static void UnusedWriteRectCpu(u16 *dest, u16 dest_left, u16 dest_top, const u16
}
}
-// Unused
-static void UnusedWriteRectDma(u16 *dest, u16 dest_left, u16 dest_top, u16 width, u16 height)
+static void UNUSED UnusedWriteRectDma(u16 *dest, u16 dest_left, u16 dest_top, u16 width, u16 height)
{
u16 i;
@@ -1697,8 +1694,7 @@ static void CB2_ExitPokeStorage(void)
SetMainCallback2(CB2_ReturnToField);
}
-// Unused
-static s16 StorageSystemGetNextMonIndex(struct BoxPokemon *box, s8 startIdx, u8 stopIdx, u8 mode)
+static s16 UNUSED StorageSystemGetNextMonIndex(struct BoxPokemon *box, s8 startIdx, u8 stopIdx, u8 mode)
{
s16 i;
s16 direction;
@@ -7893,8 +7889,7 @@ static void StartCursorAnim(u8 animNum)
StartSpriteAnim(sStorage->cursorSprite, animNum);
}
-// Unused
-static u8 GetMovingMonOriginalBoxId(void)
+static u8 UNUSED GetMovingMonOriginalBoxId(void)
{
return sMovingMonOrigBoxId;
}
@@ -9392,14 +9387,14 @@ static void SpriteCB_ItemIcon_HideParty(struct Sprite *sprite)
//------------------------------------------------------------------------------
-// Unused, leftover from FRLG
-static void BackupPokemonStorage(void/*struct PokemonStorage * dest*/)
+// Leftover from FRLG
+static void UNUSED BackupPokemonStorage(void/*struct PokemonStorage * dest*/)
{
//*dest = *gPokemonStoragePtr;
}
-// Unused, leftover from FRLG
-static void RestorePokemonStorage(void/*struct PokemonStorage * src*/)
+// Leftover from FRLG
+static void UNUSED RestorePokemonStorage(void/*struct PokemonStorage * src*/)
{
//*gPokemonStoragePtr = *src;
}
@@ -9791,8 +9786,7 @@ static void TilemapUtil_Free(void)
Free(sTilemapUtil);
}
-// Unused
-static void TilemapUtil_UpdateAll(void)
+static void UNUSED TilemapUtil_UpdateAll(void)
{
s32 i;
@@ -9856,8 +9850,7 @@ static void TilemapUtil_SetMap(u8 id, u8 bg, const void *tilemap, u16 width, u16
sTilemapUtil[id].active = TRUE;
}
-// Unused
-static void TilemapUtil_SetSavedMap(u8 id, const void *tilemap)
+static void UNUSED TilemapUtil_SetSavedMap(u8 id, const void *tilemap)
{
if (id >= sNumTilemapUtilIds)
return;
@@ -10007,8 +10000,7 @@ static void UnkUtil_Run(void)
}
}
-// Unused
-static bool8 UnkUtil_CpuAdd(u8 *dest, u16 dLeft, u16 dTop, const u8 *src, u16 sLeft, u16 sTop, u16 width, u16 height, u16 unkArg)
+static bool8 UNUSED UnkUtil_CpuAdd(u8 *dest, u16 dLeft, u16 dTop, const u8 *src, u16 sLeft, u16 sTop, u16 width, u16 height, u16 unkArg)
{
struct UnkUtilData *data;
@@ -10038,8 +10030,7 @@ static void UnkUtil_CpuRun(struct UnkUtilData *data)
}
}
-// Unused
-static bool8 UnkUtil_DmaAdd(void *dest, u16 dLeft, u16 dTop, u16 width, u16 height)
+static bool8 UNUSED UnkUtil_DmaAdd(void *dest, u16 dLeft, u16 dTop, u16 width, u16 height)
{
struct UnkUtilData *data;
diff --git a/src/pokemon_summary_screen.c b/src/pokemon_summary_screen.c
index fecf07f0fb..911f1285dc 100644
--- a/src/pokemon_summary_screen.c
+++ b/src/pokemon_summary_screen.c
@@ -88,13 +88,13 @@ enum {
#define PSS_LABEL_WINDOW_PORTRAIT_SPECIES 19 // The lower name
#define PSS_LABEL_WINDOW_END 20
-// Dynamic fields for the Pokemon Info page
+// Dynamic fields for the Pokémon Info page
#define PSS_DATA_WINDOW_INFO_ORIGINAL_TRAINER 0
#define PSS_DATA_WINDOW_INFO_ID 1
#define PSS_DATA_WINDOW_INFO_ABILITY 2
#define PSS_DATA_WINDOW_INFO_MEMO 3
-// Dynamic fields for the Pokemon Skills page
+// Dynamic fields for the Pokémon Skills page
#define PSS_DATA_WINDOW_SKILLS_HELD_ITEM 0
#define PSS_DATA_WINDOW_SKILLS_RIBBON_COUNT 1
#define PSS_DATA_WINDOW_SKILLS_STATS_LEFT 2 // HP, Attack, Defense
@@ -174,7 +174,7 @@ static EWRAM_DATA struct PokemonSummaryScreenData
u8 currPageIndex;
u8 minPageIndex;
u8 maxPageIndex;
- bool8 lockMonFlag; // This is used to prevent the player from changing pokemon in the move deleter select, etc, but it is not needed because the input is handled differently there
+ bool8 lockMonFlag; // This is used to prevent the player from changing Pokémon in the move deleter select, etc, but it is not needed because the input is handled differently there
u16 newMove;
u8 firstMoveIndex;
u8 secondMoveIndex;
@@ -184,7 +184,7 @@ static EWRAM_DATA struct PokemonSummaryScreenData
u8 windowIds[8];
u8 spriteIds[SPRITE_ARR_ID_COUNT];
bool8 handleDeoxys;
- s16 switchCounter; // Used for various switch statement cases that decompress/load graphics or pokemon data
+ s16 switchCounter; // Used for various switch statement cases that decompress/load graphics or Pokémon data
u8 unk_filler4[6];
} *sMonSummaryScreen = NULL;
EWRAM_DATA u8 gLastViewedMonIndex = 0;
@@ -702,8 +702,10 @@ static const u8 sTextColors[][3] =
{0, 7, 8}
};
-static const u8 sAButton_Gfx[] = INCBIN_U8("graphics/summary_screen/a_button.4bpp");
-static const u8 sBButton_Gfx[] = INCBIN_U8("graphics/summary_screen/b_button.4bpp");
+static const u8 sButtons_Gfx[][4 * TILE_SIZE_4BPP] = {
+ INCBIN_U8("graphics/summary_screen/a_button.4bpp"),
+ INCBIN_U8("graphics/summary_screen/b_button.4bpp"),
+};
static void (*const sTextPrinterFunctions[])(void) =
{
@@ -2680,7 +2682,7 @@ static void DrawContestMoveHearts(u16 move)
}
}
-static void LimitEggSummaryPageDisplay(void) // If the pokemon is an egg, limit the number of pages displayed to 1
+static void LimitEggSummaryPageDisplay(void) // If the Pokémon is an egg, limit the number of pages displayed to 1
{
if (sMonSummaryScreen->summary.isEgg)
ChangeBgX(3, 0x10000, BG_COORD_SET);
@@ -2790,8 +2792,13 @@ static void PrintGenderSymbol(struct Pokemon *mon, u16 species)
static void PrintAOrBButtonIcon(u8 windowId, bool8 bButton, u32 x)
{
- // sBButton_Gfx - sizeof(sBButton_Gfx) = sAButton_Gfx
- BlitBitmapToWindow(windowId, (bButton) ? sBButton_Gfx : sBButton_Gfx - sizeof(sBButton_Gfx), x, 0, 16, 16);
+ const u8 *button;
+ if (!bButton)
+ button = sButtons_Gfx[0];
+ else
+ button = sButtons_Gfx[1];
+
+ BlitBitmapToWindow(windowId, button, x, 0, 16, 16);
}
static void PrintPageNamesAndStats(void)
@@ -3995,8 +4002,7 @@ static void SummaryScreen_DestroyAnimDelayTask(void)
}
}
-// unused
-static bool32 IsMonAnimationFinished(void)
+static bool32 UNUSED IsMonAnimationFinished(void)
{
if (gSprites[sMonSummaryScreen->spriteIds[SPRITE_ARR_ID_MON]].callback == SpriteCallbackDummy)
return FALSE;
@@ -4004,7 +4010,7 @@ static bool32 IsMonAnimationFinished(void)
return TRUE;
}
-static void StopPokemonAnimations(void) // A subtle effect, this function stops pokemon animations when leaving the PSS
+static void StopPokemonAnimations(void) // A subtle effect, this function stops Pokémon animations when leaving the PSS
{
u16 i;
u16 paletteIndex;
diff --git a/src/pokenav_conditions_gfx.c b/src/pokenav_conditions_gfx.c
index 9f4b2db612..26d8e99e06 100644
--- a/src/pokenav_conditions_gfx.c
+++ b/src/pokenav_conditions_gfx.c
@@ -548,7 +548,7 @@ static u32 LoopedTask_CloseMonMarkingsWindow(s32 state)
return LT_FINISH;
}
-static u8 *UnusedPrintNumberString(u8 *dst, u16 num)
+static u8 UNUSED *UnusedPrintNumberString(u8 *dst, u16 num)
{
u8 *txtPtr = ConvertIntToDecimalStringN(dst, num, STR_CONV_MODE_RIGHT_ALIGN, 4);
txtPtr = StringCopy(txtPtr, gText_Number2);
diff --git a/src/pokenav_match_call_list.c b/src/pokenav_match_call_list.c
index b00c76b48a..8d1a73f557 100755
--- a/src/pokenav_match_call_list.c
+++ b/src/pokenav_match_call_list.c
@@ -278,22 +278,19 @@ int GetNumberRegistered(void)
return state->numRegistered;
}
-// Unused
-static int GetNumSpecialTrainers(void)
+static int UNUSED GetNumSpecialTrainers(void)
{
struct Pokenav_MatchCallMenu *state = GetSubstructPtr(POKENAV_SUBSTRUCT_MATCH_CALL_MAIN);
return state->numSpecialTrainers;
}
-// Unused
-static int GetNumNormalTrainers(void)
+static int UNUSED GetNumNormalTrainers(void)
{
struct Pokenav_MatchCallMenu *state = GetSubstructPtr(POKENAV_SUBSTRUCT_MATCH_CALL_MAIN);
return state->numRegistered - state->numSpecialTrainers;
}
-// Unused
-static int GetNormalTrainerHeaderId(int index)
+static int UNUSED GetNormalTrainerHeaderId(int index)
{
struct Pokenav_MatchCallMenu *state = GetSubstructPtr(POKENAV_SUBSTRUCT_MATCH_CALL_MAIN);
index += state->numSpecialTrainers;
@@ -468,8 +465,7 @@ int GetIndexDeltaOfNextCheckPageUp(int index)
return 0;
}
-// Unused
-static bool32 HasRematchEntry(void)
+static bool32 UNUSED HasRematchEntry(void)
{
int i;
diff --git a/src/pokenav_menu_handler.c b/src/pokenav_menu_handler.c
index b81b4c892f..d67f61c1ea 100644
--- a/src/pokenav_menu_handler.c
+++ b/src/pokenav_menu_handler.c
@@ -257,7 +257,7 @@ static u32 HandleMainMenuInput(struct Pokenav_Menu *menu)
return POKENAV_MENU_FUNC_NONE;
}
-// Force the player to select Match Call during the call Mr. Stone pokenav tutorial
+// Force the player to select Match Call during the call Mr. Stone PokéNav tutorial
static u32 HandleMainMenuInputTutorial(struct Pokenav_Menu *menu)
{
if (UpdateMenuCursorPos(menu))
@@ -287,7 +287,7 @@ static u32 HandleMainMenuInputTutorial(struct Pokenav_Menu *menu)
return POKENAV_MENU_FUNC_NONE;
}
-// After calling Mr. Stone during the pokenav tutorial, force player to exit or use Match Call again
+// After calling Mr. Stone during the PokéNav tutorial, force player to exit or use Match Call again
static u32 HandleMainMenuInputEndTutorial(struct Pokenav_Menu *menu)
{
if (UpdateMenuCursorPos(menu))
diff --git a/src/pokenav_ribbons_list.c b/src/pokenav_ribbons_list.c
index 344b44f009..05eded6240 100644
--- a/src/pokenav_ribbons_list.c
+++ b/src/pokenav_ribbons_list.c
@@ -227,8 +227,7 @@ static s32 GetRibbonsMonListCount(void)
return list->monList->listCount;
}
-//unused
-static s32 GetMonRibbonSelectedMonData(void)
+static s32 UNUSED GetMonRibbonSelectedMonData(void)
{
struct Pokenav_RibbonsMonList * list = GetSubstructPtr(POKENAV_SUBSTRUCT_RIBBONS_MON_LIST);
s32 idx = PokenavList_GetSelectedIndex();
@@ -343,8 +342,7 @@ static void InsertMonListItem(struct Pokenav_RibbonsMonList *list, struct Pokena
list->monList->listCount++;
}
-// Unused
-static bool32 PlayerHasRibbonsMon(void)
+static bool32 UNUSED PlayerHasRibbonsMon(void)
{
s32 i, j;
diff --git a/src/rayquaza_scene.c b/src/rayquaza_scene.c
index 48fc296cd0..00b7cdd971 100644
--- a/src/rayquaza_scene.c
+++ b/src/rayquaza_scene.c
@@ -1644,7 +1644,7 @@ static void Task_DuoFightAnim(u8 taskId)
static void Task_DuoFight_AnimateClouds(u8 taskId)
{
s16 i;
- u16 *data = gTasks[taskId].data;
+ u16 *data = (u16*)gTasks[taskId].data;
for (i = 24; i < 92; i++)
{
diff --git a/src/recorded_battle.c b/src/recorded_battle.c
index 33228255d2..42866c723b 100644
--- a/src/recorded_battle.c
+++ b/src/recorded_battle.c
@@ -222,8 +222,7 @@ u8 RecordedBattle_GetBattlerAction(u8 battlerId)
}
}
-// Unused
-static u8 GetRecordedBattleMode(void)
+static u8 UNUSED GetRecordedBattleMode(void)
{
return sRecordMode;
}
diff --git a/src/region_map.c b/src/region_map.c
index 7d5fe93654..21c6314d30 100644
--- a/src/region_map.c
+++ b/src/region_map.c
@@ -1434,14 +1434,12 @@ static void FreeRegionMapCursorSprite(void)
}
}
-// Unused
-static void SetUnkCursorSpriteData(void)
+static void UNUSED SetUnkCursorSpriteData(void)
{
sRegionMap->cursorSprite->data[3] = TRUE;
}
-// Unused
-static void ClearUnkCursorSpriteData(void)
+static void UNUSED ClearUnkCursorSpriteData(void)
{
sRegionMap->cursorSprite->data[3] = FALSE;
}
diff --git a/src/rom_header_gf.c b/src/rom_header_gf.c
index 465c0cf410..d5f7d7eefc 100644
--- a/src/rom_header_gf.c
+++ b/src/rom_header_gf.c
@@ -8,9 +8,9 @@
// The purpose of this struct is for outside applications to be
// able to access parts of the ROM or its save file, like a public API.
-// In vanilla, it was used by Colosseum and XD to access pokemon graphics.
-//
-// If this struct is rearranged in any way, it defeats the purpose of
+// In vanilla, it was used by Colosseum and XD to access Pokémon graphics.
+//
+// If this struct is rearranged in any way, it defeats the purpose of
// having it at all. Applications like PKHex or streaming HUDs may find
// these values useful, so there's some potential benefit to keeping it.
// If there's a compilation problem below, just comment out the assignment
diff --git a/src/roulette.c b/src/roulette.c
index d311ad0940..ec4c8cfcfe 100644
--- a/src/roulette.c
+++ b/src/roulette.c
@@ -990,8 +990,8 @@ static const struct RouletteFlashSettings sFlashData_Colors[NUM_ROULETTE_SLOTS +
},
};
-// Data to flash any pokemon icon (F_FLASH_ICON) on the roulette wheel. One entry for each color row
-// Each poke icon flashes with the tint of the row color it belongs to, so the pokemon itself is irrelevant
+// Data to flash any Pokémon icon (F_FLASH_ICON) on the roulette wheel. One entry for each color row
+// Each poke icon flashes with the tint of the row color it belongs to, so the Pokémon itself is irrelevant
static const struct RouletteFlashSettings sFlashData_PokeIcons[NUM_BOARD_COLORS] =
{
[GET_ROW_IDX(ROW_ORANGE)] = {
@@ -2702,7 +2702,7 @@ static const struct SpriteTemplate sSpriteTemplates_GridIcons[NUM_BOARD_POKES] =
}
};
-// Wheel icons are listed clockwise starting from 1 oclock on the roulette wheel (with pokeball upside right)
+// Wheel icons are listed clockwise starting from 1 oclock on the roulette wheel (with Poké Ball upside right)
// They go Wynaut -> Azurill -> Skitty -> Makuhita, and Orange -> Green -> Purple
static const struct SpriteTemplate sSpriteTemplates_WheelIcons[NUM_ROULETTE_SLOTS] =
{
@@ -3556,8 +3556,7 @@ static void CreateGridSprites(void)
}
}
-// Unused
-static void DestroyGridSprites(void)
+static void UNUSED DestroyGridSprites(void)
{
u8 i;
for (i = 0; i < NUM_ROULETTE_SLOTS; i++)
@@ -4353,7 +4352,7 @@ static void CreateShroomishSprite(struct Sprite *ball)
{116, 44},
{116, 112}
};
- struct Roulette *roulette;
+ struct Roulette UNUSED *roulette;
t = ball->data[7] - 2;
roulette = sRoulette; // Unnecessary, needed to match
@@ -4482,7 +4481,7 @@ static void SetBallStuck(struct Sprite *sprite)
// The below slot ids are relative to the slot the ball got stuck on
if ((sRoulette->useTaillow + 1) & sRoulette->partySpeciesFlags)
{
- // If the player has the corresponding pokemon in their party (HAS_SHROOMISH or HAS_TAILLOW),
+ // If the player has the corresponding Pokémon in their party (HAS_SHROOMISH or HAS_TAILLOW),
// there's a 75% chance that the ball will be moved to a spot they bet on
// assuming it was one of the slots identified as a candidate
if (betSlotId && (rand % 256) < 192)
diff --git a/src/rtc.c b/src/rtc.c
index b135a675a8..b79f62a3c4 100644
--- a/src/rtc.c
+++ b/src/rtc.c
@@ -16,20 +16,20 @@ struct Time gLocalTime;
static const struct SiiRtcInfo sRtcDummy = {0, MONTH_JAN, 1}; // 2000 Jan 1
-static const s32 sNumDaysInMonths[12] =
+static const s32 sNumDaysInMonths[MONTH_COUNT] =
{
- 31,
- 28,
- 31,
- 30,
- 31,
- 30,
- 31,
- 31,
- 30,
- 31,
- 30,
- 31,
+ [MONTH_JAN - 1] = 31,
+ [MONTH_FEB - 1] = 28,
+ [MONTH_MAR - 1] = 31,
+ [MONTH_APR - 1] = 30,
+ [MONTH_MAY - 1] = 31,
+ [MONTH_JUN - 1] = 30,
+ [MONTH_JUL - 1] = 31,
+ [MONTH_AUG - 1] = 31,
+ [MONTH_SEP - 1] = 30,
+ [MONTH_OCT - 1] = 31,
+ [MONTH_NOV - 1] = 30,
+ [MONTH_DEC - 1] = 31,
};
void RtcDisableInterrupts(void)
@@ -171,7 +171,7 @@ u16 RtcCheckInfo(struct SiiRtcInfo *rtc)
month = ConvertBcdToBinary(rtc->month);
- if (month == 0xFF || month == 0 || month > 12)
+ if (month == 0xFF || month == 0 || month > MONTH_COUNT)
errorFlags |= RTC_ERR_INVALID_MONTH;
value = ConvertBcdToBinary(rtc->day);
@@ -192,17 +192,17 @@ u16 RtcCheckInfo(struct SiiRtcInfo *rtc)
value = ConvertBcdToBinary(rtc->hour);
- if (value > 24)
+ if (value > HOURS_PER_DAY)
errorFlags |= RTC_ERR_INVALID_HOUR;
value = ConvertBcdToBinary(rtc->minute);
- if (value > 60)
+ if (value > MINUTES_PER_HOUR)
errorFlags |= RTC_ERR_INVALID_MINUTE;
value = ConvertBcdToBinary(rtc->second);
- if (value > 60)
+ if (value > SECONDS_PER_MINUTE)
errorFlags |= RTC_ERR_INVALID_SECOND;
return errorFlags;
@@ -270,19 +270,19 @@ void RtcCalcTimeDifference(struct SiiRtcInfo *rtc, struct Time *result, struct T
if (result->seconds < 0)
{
- result->seconds += 60;
+ result->seconds += SECONDS_PER_MINUTE;
--result->minutes;
}
if (result->minutes < 0)
{
- result->minutes += 60;
+ result->minutes += MINUTES_PER_HOUR;
--result->hours;
}
if (result->hours < 0)
{
- result->hours += 24;
+ result->hours += HOURS_PER_DAY;
--result->days;
}
}
@@ -317,19 +317,19 @@ void CalcTimeDifference(struct Time *result, struct Time *t1, struct Time *t2)
if (result->seconds < 0)
{
- result->seconds += 60;
+ result->seconds += SECONDS_PER_MINUTE;
--result->minutes;
}
if (result->minutes < 0)
{
- result->minutes += 60;
+ result->minutes += MINUTES_PER_HOUR;
--result->hours;
}
if (result->hours < 0)
{
- result->hours += 24;
+ result->hours += HOURS_PER_DAY;
--result->days;
}
}
@@ -337,7 +337,7 @@ void CalcTimeDifference(struct Time *result, struct Time *t1, struct Time *t2)
u32 RtcGetMinuteCount(void)
{
RtcGetInfo(&sRtc);
- return (24 * 60) * RtcGetDayCount(&sRtc) + 60 * sRtc.hour + sRtc.minute;
+ return (HOURS_PER_DAY * MINUTES_PER_HOUR) * RtcGetDayCount(&sRtc) + MINUTES_PER_HOUR * sRtc.hour + sRtc.minute;
}
u32 RtcGetLocalDayCount(void)
diff --git a/src/save_location.c b/src/save_location.c
index 74d2f2c44d..3384200598 100644
--- a/src/save_location.c
+++ b/src/save_location.c
@@ -119,9 +119,9 @@ void TrySetMapSaveWarpStatus(void)
TrySetUnknownWarpStatus();
}
-// In FRLG, only bits 0, 4, and 5 are set when the pokedex is received.
+// In FRLG, only bits 0, 4, and 5 are set when the Pokédex is received.
// Bits 1, 2, 3, and 15 are instead set by SetPostgameFlags.
-// These flags are read by Pokemon Colosseum/XD for linking. XD Additionally requires FLAG_SYS_GAME_CLEAR
+// These flags are read by Pokémon Colosseum/XD for linking. XD Additionally requires FLAG_SYS_GAME_CLEAR
void SetUnlockedPokedexFlags(void)
{
gSaveBlock2Ptr->gcnLinkFlags |= (1 << 15);
diff --git a/src/scrcmd.c b/src/scrcmd.c
index df3a469087..ec1b7d0b7e 100644
--- a/src/scrcmd.c
+++ b/src/scrcmd.c
@@ -77,12 +77,12 @@ void * const gNullScriptPtr = NULL;
static const u8 sScriptConditionTable[6][3] =
{
// < = >
- 1, 0, 0, // <
- 0, 1, 0, // =
- 0, 0, 1, // >
- 1, 1, 0, // <=
- 0, 1, 1, // >=
- 1, 0, 1, // !=
+ {1, 0, 0}, // <
+ {0, 1, 0}, // =
+ {0, 0, 1}, // >
+ {1, 1, 0}, // <=
+ {0, 1, 1}, // >=
+ {1, 0, 1}, // !=
};
static u8 * const sScriptStringVars[] =
diff --git a/src/script_menu.c b/src/script_menu.c
index 6633332f3f..e923f4031a 100644
--- a/src/script_menu.c
+++ b/src/script_menu.c
@@ -64,8 +64,7 @@ bool8 ScriptMenu_MultichoiceWithDefault(u8 left, u8 top, u8 multichoiceId, bool8
}
}
-// Unused
-static u16 GetLengthWithExpandedPlayerName(const u8 *str)
+static u16 UNUSED GetLengthWithExpandedPlayerName(const u8 *str)
{
u16 length = 0;
diff --git a/src/script_pokemon_util.c b/src/script_pokemon_util.c
index 6e5653884b..ed28d47c5a 100755
--- a/src/script_pokemon_util.c
+++ b/src/script_pokemon_util.c
@@ -213,7 +213,7 @@ void ReducePlayerPartyToSelectedMons(void)
CpuFill32(0, party, sizeof party);
- // copy the selected pokemon according to the order.
+ // copy the selected Pokémon according to the order.
for (i = 0; i < MAX_FRONTIER_PARTY_SIZE; i++)
if (gSelectedOrderFromParty[i]) // as long as the order keeps going (did the player select 1 mon? 2? 3?), do not stop
party[i] = gPlayerParty[gSelectedOrderFromParty[i] - 1]; // index is 0 based, not literal
diff --git a/src/slot_machine.c b/src/slot_machine.c
index 20386a2528..5ae0f9f1d5 100644
--- a/src/slot_machine.c
+++ b/src/slot_machine.c
@@ -5813,8 +5813,8 @@ static const struct SpriteFrameImage sImageTable_ReelTimeNumbers[] =
{ gSlotMachineReelTimeNumber5, 0x80 },
};
-static const struct SpriteFrameImage sImageTable_ReelTimeShadow[] = { gSlotMachineReelTimeShadow, 0x200 };
-static const struct SpriteFrameImage sImageTable_ReelTimeNumberGap[] = { gSlotMachineReelTimeNumberGap_Gfx, 0x40 };
+static const struct SpriteFrameImage sImageTable_ReelTimeShadow[] = { {gSlotMachineReelTimeShadow, 0x200} };
+static const struct SpriteFrameImage sImageTable_ReelTimeNumberGap[] = { {gSlotMachineReelTimeNumberGap_Gfx, 0x40} };
static const struct SpriteFrameImage sImageTable_ReelTimeBolt[] =
{
@@ -5822,7 +5822,7 @@ static const struct SpriteFrameImage sImageTable_ReelTimeBolt[] =
{ gSlotMachineReelTimeBolt1, 0x100 },
};
-static const struct SpriteFrameImage sImageTable_ReelTimePikachuAura[] = { gSlotMachineReelTimePikaAura, 0x400 };
+static const struct SpriteFrameImage sImageTable_ReelTimePikachuAura[] = { {gSlotMachineReelTimePikaAura, 0x400} };
static const struct SpriteFrameImage sImageTable_ReelTimeExplosion[] =
{
@@ -5830,9 +5830,9 @@ static const struct SpriteFrameImage sImageTable_ReelTimeExplosion[] =
{ gSlotMachineReelTimeExplosion1, 0x200 },
};
-static const struct SpriteFrameImage sImageTable_ReelTimeDuck[] = { gSlotMachineReelTimeDuck, 0x20};
-static const struct SpriteFrameImage sImageTable_ReelTimeSmoke[] = { gSlotMachineReelTimeSmoke, 0x80};
-static const struct SpriteFrameImage sImageTable_PikaPowerBolt[] = { gSlotMachinePikaPowerBolt, 0x20};
+static const struct SpriteFrameImage sImageTable_ReelTimeDuck[] = { {gSlotMachineReelTimeDuck, 0x20} };
+static const struct SpriteFrameImage sImageTable_ReelTimeSmoke[] = { {gSlotMachineReelTimeSmoke, 0x80} };
+static const struct SpriteFrameImage sImageTable_PikaPowerBolt[] = { {gSlotMachinePikaPowerBolt, 0x20} };
static const union AnimCmd sAnim_SingleFrame[] =
{
@@ -6485,7 +6485,7 @@ static const struct Subsprite sSubsprites_ReelBackground[] =
static const struct SubspriteTable sSubspriteTable_ReelBackground[] =
{
- ARRAY_COUNT(sSubsprites_ReelBackground), sSubsprites_ReelBackground
+ {ARRAY_COUNT(sSubsprites_ReelBackground), sSubsprites_ReelBackground}
};
/* v-- Origin on 3
@@ -6547,7 +6547,7 @@ static const struct Subsprite sSubsprites_ReelTimeMachineAntennae[] =
static const struct SubspriteTable sSubspriteTable_ReelTimeMachineAntennae[] =
{
- ARRAY_COUNT(sSubsprites_ReelTimeMachineAntennae), sSubsprites_ReelTimeMachineAntennae
+ {ARRAY_COUNT(sSubsprites_ReelTimeMachineAntennae), sSubsprites_ReelTimeMachineAntennae}
};
/*
@@ -6587,7 +6587,7 @@ static const struct Subsprite sSubsprites_ReelTimeMachine[] =
static const struct SubspriteTable sSubspriteTable_ReelTimeMachine[] =
{
- ARRAY_COUNT(sSubsprites_ReelTimeMachine), sSubsprites_ReelTimeMachine
+ {ARRAY_COUNT(sSubsprites_ReelTimeMachine), sSubsprites_ReelTimeMachine}
};
/*
@@ -6644,7 +6644,7 @@ static const struct Subsprite sSubsprites_BrokenReelTimeMachine[] =
static const struct SubspriteTable sSubspriteTable_BrokenReelTimeMachine[] =
{
- ARRAY_COUNT(sSubsprites_BrokenReelTimeMachine), sSubsprites_BrokenReelTimeMachine
+ {ARRAY_COUNT(sSubsprites_BrokenReelTimeMachine), sSubsprites_BrokenReelTimeMachine}
};
/* v-- Origin on 3
@@ -6689,7 +6689,7 @@ static const struct Subsprite sSubsprites_ReelTimeShadow[] =
static const struct SubspriteTable sSubspriteTable_ReelTimeShadow[] =
{
- ARRAY_COUNT(sSubsprites_ReelTimeShadow), sSubsprites_ReelTimeShadow
+ {ARRAY_COUNT(sSubsprites_ReelTimeShadow), sSubsprites_ReelTimeShadow}
};
/*
@@ -6727,7 +6727,7 @@ static const struct Subsprite sSubsprites_ReelTimeNumberGap[] =
static const struct SubspriteTable sSubspriteTable_ReelTimeNumberGap[] =
{
- ARRAY_COUNT(sSubsprites_ReelTimeNumberGap), sSubsprites_ReelTimeNumberGap
+ {ARRAY_COUNT(sSubsprites_ReelTimeNumberGap), sSubsprites_ReelTimeNumberGap}
};
/*
@@ -6784,7 +6784,7 @@ static const struct Subsprite sSubsprites_DigitalDisplay_Reel[] =
static const struct SubspriteTable sSubspriteTable_DigitalDisplay_Reel[] =
{
- ARRAY_COUNT(sSubsprites_DigitalDisplay_Reel), sSubsprites_DigitalDisplay_Reel
+ {ARRAY_COUNT(sSubsprites_DigitalDisplay_Reel), sSubsprites_DigitalDisplay_Reel}
};
/* v-- Origin on 3
@@ -6829,7 +6829,7 @@ static const struct Subsprite sSubsprites_DigitalDisplay_Time[] =
static const struct SubspriteTable sSubspriteTable_DigitalDisplay_Time[] =
{
- ARRAY_COUNT(sSubsprites_DigitalDisplay_Time), sSubsprites_DigitalDisplay_Time
+ {ARRAY_COUNT(sSubsprites_DigitalDisplay_Time), sSubsprites_DigitalDisplay_Time}
};
/* v-- Origin on 3
@@ -6874,7 +6874,7 @@ static const struct Subsprite sSubsprites_DigitalDisplay_Insert[] =
static const struct SubspriteTable sSubspriteTable_DigitalDisplay_Insert[] =
{
- ARRAY_COUNT(sSubsprites_DigitalDisplay_Insert), sSubsprites_DigitalDisplay_Insert
+ {ARRAY_COUNT(sSubsprites_DigitalDisplay_Insert), sSubsprites_DigitalDisplay_Insert}
};
/* v-- Origin on 3
@@ -6919,7 +6919,7 @@ static const struct Subsprite sSubsprites_DigitalDisplay_Unused1[] =
static const struct SubspriteTable sSubspriteTable_DigitalDisplay_Unused1[] =
{
- ARRAY_COUNT(sSubsprites_DigitalDisplay_Unused1), sSubsprites_DigitalDisplay_Unused1
+ {ARRAY_COUNT(sSubsprites_DigitalDisplay_Unused1), sSubsprites_DigitalDisplay_Unused1}
};
/* v-- Origin on 3
@@ -6981,7 +6981,7 @@ static const struct Subsprite sSubsprites_DigitalDisplay_Win[] =
static const struct SubspriteTable sSubspriteTable_DigitalDisplay_Win[] =
{
- ARRAY_COUNT(sSubsprites_DigitalDisplay_Win), sSubsprites_DigitalDisplay_Win
+ {ARRAY_COUNT(sSubsprites_DigitalDisplay_Win), sSubsprites_DigitalDisplay_Win}
};
static const struct Subsprite sSubsprites_DigitalDisplay_Smoke[] =
@@ -7010,12 +7010,12 @@ static const struct Subsprite sSubsprites_DigitalDisplay_Unused2[] =
static const struct SubspriteTable sSubspriteTable_DigitalDisplay_Smoke[] =
{
- ARRAY_COUNT(sSubsprites_DigitalDisplay_Smoke), sSubsprites_DigitalDisplay_Smoke
+ {ARRAY_COUNT(sSubsprites_DigitalDisplay_Smoke), sSubsprites_DigitalDisplay_Smoke}
};
static const struct SubspriteTable sSubspriteTable_DigitalDisplay_Unused2[] =
{
- ARRAY_COUNT(sSubsprites_DigitalDisplay_Unused2), sSubsprites_DigitalDisplay_Unused2
+ {ARRAY_COUNT(sSubsprites_DigitalDisplay_Unused2), sSubsprites_DigitalDisplay_Unused2}
};
/*
@@ -7128,7 +7128,7 @@ static const struct Subsprite sSubsprites_DigitalDisplay_Pokeball[] =
static const struct SubspriteTable sSubspriteTable_DigitalDisplay_Pokeball[] =
{
- ARRAY_COUNT(sSubsprites_DigitalDisplay_Pokeball), sSubsprites_DigitalDisplay_Pokeball
+ {ARRAY_COUNT(sSubsprites_DigitalDisplay_Pokeball), sSubsprites_DigitalDisplay_Pokeball}
};
/*
@@ -7166,7 +7166,7 @@ static const struct Subsprite sSubsprites_DigitalDisplay_DPad[] =
static const struct SubspriteTable sSubspriteTable_DigitalDisplay_DPad[] =
{
- ARRAY_COUNT(sSubsprites_DigitalDisplay_DPad), sSubsprites_DigitalDisplay_DPad
+ {ARRAY_COUNT(sSubsprites_DigitalDisplay_DPad), sSubsprites_DigitalDisplay_DPad}
};
/*
@@ -7195,7 +7195,7 @@ static const struct Subsprite sSubsprites_DigitalDisplay_StopS[] =
static const struct SubspriteTable sSubspriteTable_DigitalDisplay_StopS[] =
{
- ARRAY_COUNT(sSubsprites_DigitalDisplay_StopS), sSubsprites_DigitalDisplay_StopS
+ {ARRAY_COUNT(sSubsprites_DigitalDisplay_StopS), sSubsprites_DigitalDisplay_StopS}
};
/*
@@ -7224,7 +7224,7 @@ static const struct Subsprite sSubsprites_DigitalDisplay_StopT[] =
static const struct SubspriteTable sSubspriteTable_DigitalDisplay_StopT[] =
{
- ARRAY_COUNT(sSubsprites_DigitalDisplay_StopT), sSubsprites_DigitalDisplay_StopT
+ {ARRAY_COUNT(sSubsprites_DigitalDisplay_StopT), sSubsprites_DigitalDisplay_StopT}
};
/*
@@ -7253,7 +7253,7 @@ static const struct Subsprite sSubsprites_DigitalDisplay_StopO[] =
static const struct SubspriteTable sSubspriteTable_DigitalDisplay_StopO[] =
{
- ARRAY_COUNT(sSubsprites_DigitalDisplay_StopO), sSubsprites_DigitalDisplay_StopO
+ {ARRAY_COUNT(sSubsprites_DigitalDisplay_StopO), sSubsprites_DigitalDisplay_StopO}
};
/*
@@ -7282,7 +7282,7 @@ static const struct Subsprite sSubsprites_DigitalDisplay_StopP[] =
static const struct SubspriteTable sSubspriteTable_DigitalDisplay_StopP[] =
{
- ARRAY_COUNT(sSubsprites_DigitalDisplay_StopP), sSubsprites_DigitalDisplay_StopP
+ {ARRAY_COUNT(sSubsprites_DigitalDisplay_StopP), sSubsprites_DigitalDisplay_StopP}
};
/*
@@ -7311,7 +7311,7 @@ static const struct Subsprite sSubsprites_DigitalDisplay_BonusB[] =
static const struct SubspriteTable sSubspriteTable_DigitalDisplay_BonusB[] =
{
- ARRAY_COUNT(sSubsprites_DigitalDisplay_BonusB), sSubsprites_DigitalDisplay_BonusB
+ {ARRAY_COUNT(sSubsprites_DigitalDisplay_BonusB), sSubsprites_DigitalDisplay_BonusB}
};
/*
@@ -7340,7 +7340,7 @@ static const struct Subsprite sSubsprites_DigitalDisplay_BonusO[] =
static const struct SubspriteTable sSubspriteTable_DigitalDisplay_BonusO[] =
{
- ARRAY_COUNT(sSubsprites_DigitalDisplay_BonusO), sSubsprites_DigitalDisplay_BonusO
+ {ARRAY_COUNT(sSubsprites_DigitalDisplay_BonusO), sSubsprites_DigitalDisplay_BonusO}
};
/*
@@ -7369,7 +7369,7 @@ static const struct Subsprite sSubsprites_DigitalDisplay_BonusN[] =
static const struct SubspriteTable sSubspriteTable_DigitalDisplay_BonusN[] =
{
- ARRAY_COUNT(sSubsprites_DigitalDisplay_BonusN), sSubsprites_DigitalDisplay_BonusN
+ {ARRAY_COUNT(sSubsprites_DigitalDisplay_BonusN), sSubsprites_DigitalDisplay_BonusN}
};
/*
@@ -7398,7 +7398,7 @@ static const struct Subsprite sSubsprites_DigitalDisplay_BonusU[] =
static const struct SubspriteTable sSubspriteTable_DigitalDisplay_BonusU[] =
{
- ARRAY_COUNT(sSubsprites_DigitalDisplay_BonusU), sSubsprites_DigitalDisplay_BonusU
+ {ARRAY_COUNT(sSubsprites_DigitalDisplay_BonusU), sSubsprites_DigitalDisplay_BonusU}
};
/*
@@ -7427,7 +7427,7 @@ static const struct Subsprite sSubsprites_DigitalDisplay_BonusS[] =
static const struct SubspriteTable sSubspriteTable_DigitalDisplay_BonusS[] =
{
- ARRAY_COUNT(sSubsprites_DigitalDisplay_BonusS), sSubsprites_DigitalDisplay_BonusS
+ {ARRAY_COUNT(sSubsprites_DigitalDisplay_BonusS), sSubsprites_DigitalDisplay_BonusS}
};
/*
@@ -7490,7 +7490,7 @@ static const struct Subsprite sSubsprites_DigitalDisplay_BigB[] =
static const struct SubspriteTable sSubspriteTable_DigitalDisplay_BigB[] =
{
- ARRAY_COUNT(sSubsprites_DigitalDisplay_BigB), sSubsprites_DigitalDisplay_BigB
+ {ARRAY_COUNT(sSubsprites_DigitalDisplay_BigB), sSubsprites_DigitalDisplay_BigB}
};
/*
@@ -7528,7 +7528,7 @@ static const struct Subsprite sSubsprites_DigitalDisplay_BigI[] =
static const struct SubspriteTable sSubspriteTable_DigitalDisplay_BigI[] =
{
- ARRAY_COUNT(sSubsprites_DigitalDisplay_BigI), sSubsprites_DigitalDisplay_BigI
+ {ARRAY_COUNT(sSubsprites_DigitalDisplay_BigI), sSubsprites_DigitalDisplay_BigI}
};
/*
@@ -7591,7 +7591,7 @@ static const struct Subsprite sSubsprites_DigitalDisplay_BigG[] =
static const struct SubspriteTable sSubspriteTable_DigitalDisplay_BigG[] =
{
- ARRAY_COUNT(sSubsprites_DigitalDisplay_BigG), sSubsprites_DigitalDisplay_BigG
+ {ARRAY_COUNT(sSubsprites_DigitalDisplay_BigG), sSubsprites_DigitalDisplay_BigG}
};
/*
@@ -7654,7 +7654,7 @@ static const struct Subsprite sSubsprites_DigitalDisplay_RegR[] =
static const struct SubspriteTable sSubspriteTable_DigitalDisplay_RegR[] =
{
- ARRAY_COUNT(sSubsprites_DigitalDisplay_RegR), sSubsprites_DigitalDisplay_RegR
+ {ARRAY_COUNT(sSubsprites_DigitalDisplay_RegR), sSubsprites_DigitalDisplay_RegR}
};
/*
@@ -7692,7 +7692,7 @@ static const struct Subsprite sSubsprites_DigitalDisplay_RegE[] =
static const struct SubspriteTable sSubspriteTable_DigitalDisplay_RegE[] =
{
- ARRAY_COUNT(sSubsprites_DigitalDisplay_RegE), sSubsprites_DigitalDisplay_RegE
+ {ARRAY_COUNT(sSubsprites_DigitalDisplay_RegE), sSubsprites_DigitalDisplay_RegE}
};
/*
@@ -7755,7 +7755,7 @@ static const struct Subsprite sSubsprites_DigitalDisplay_RegG[] =
static const struct SubspriteTable sSubspriteTable_DigitalDisplay_RegG[] =
{
- ARRAY_COUNT(sSubsprites_DigitalDisplay_RegG), sSubsprites_DigitalDisplay_RegG
+ {ARRAY_COUNT(sSubsprites_DigitalDisplay_RegG), sSubsprites_DigitalDisplay_RegG}
};
static const struct SpriteTemplate *const sSpriteTemplates_DigitalDisplay[NUM_DIG_DISPLAY_SPRITES] =
diff --git a/src/sound.c b/src/sound.c
index 15ebee8312..8685383f78 100644
--- a/src/sound.c
+++ b/src/sound.c
@@ -156,8 +156,7 @@ void FadeOutAndFadeInNewMapMusic(u16 songNum, u8 fadeOutSpeed, u8 fadeInSpeed)
sMapMusicFadeInSpeed = fadeInSpeed;
}
-// Unused
-static void FadeInNewMapMusic(u16 songNum, u8 speed)
+static void UNUSED FadeInNewMapMusic(u16 songNum, u8 speed)
{
FadeInNewBGM(songNum, speed);
sCurrentMapMusic = songNum;
@@ -464,9 +463,9 @@ void PlayCryInternal(u16 species, s8 pan, s8 volume, u8 priority, u8 mode)
SetPokemonCryChorus(chorus);
SetPokemonCryPriority(priority);
- // This is a fancy way to get a cry of a pokemon.
+ // This is a fancy way to get a cry of a Pokémon.
// It creates 4 sets of 128 mini cry tables.
- // If you wish to expand pokemon, you need to
+ // If you wish to expand Pokémon, you need to
// append new cases to the switch.
species = SpeciesToCryId(species);
index = species % 128;
diff --git a/src/start_menu.c b/src/start_menu.c
index e39a5438ee..63914cbb72 100644
--- a/src/start_menu.c
+++ b/src/start_menu.c
@@ -83,7 +83,7 @@ EWRAM_DATA static u8 sBattlePyramidFloorWindowId = 0;
EWRAM_DATA static u8 sStartMenuCursorPos = 0;
EWRAM_DATA static u8 sNumStartMenuActions = 0;
EWRAM_DATA static u8 sCurrentStartMenuActions[9] = {0};
-EWRAM_DATA static u8 sInitStartMenuData[2] = {0};
+EWRAM_DATA static s8 sInitStartMenuData[2] = {0};
EWRAM_DATA static u8 (*sSaveDialogCallback)(void) = NULL;
EWRAM_DATA static u8 sSaveDialogTimer = 0;
@@ -689,7 +689,7 @@ static bool8 StartMenuPokeNavCallback(void)
PlayRainStoppingSoundEffect();
RemoveExtraStartMenuWindows();
CleanupOverworldWindowsAndTilemaps();
- SetMainCallback2(CB2_InitPokeNav); // Display PokeNav
+ SetMainCallback2(CB2_InitPokeNav); // Display PokéNav
return TRUE;
}
@@ -1374,7 +1374,7 @@ static void ShowSaveInfoWindow(void)
if (FlagGet(FLAG_SYS_POKEDEX_GET) == TRUE)
{
- // Print pokedex count
+ // Print Pokédex count
yOffset += 16;
AddTextPrinterParameterized(sSaveInfoWindowId, FONT_NORMAL, gText_SavingPokedex, 0, yOffset, TEXT_SKIP_DRAW, NULL);
BufferSaveMenuText(SAVE_MENU_CAUGHT, gStringVar4, color);
diff --git a/src/starter_choose.c b/src/starter_choose.c
index 3d5291e887..cbbd163b03 100644
--- a/src/starter_choose.c
+++ b/src/starter_choose.c
@@ -26,7 +26,7 @@
#define STARTER_MON_COUNT 3
-// Position of the sprite of the selected starter Pokemon
+// Position of the sprite of the selected starter Pokémon
#define STARTER_PKMN_POS_X (DISPLAY_WIDTH / 2)
#define STARTER_PKMN_POS_Y 64
@@ -446,7 +446,7 @@ void CB2_ChooseStarter(void)
spriteId = CreateSprite(&sSpriteTemplate_Hand, 120, 56, 2);
gSprites[spriteId].data[0] = taskId;
- // Create three Pokeball sprites
+ // Create three Poké Ball sprites
spriteId = CreateSprite(&sSpriteTemplate_Pokeball, sPokeballCoords[0][0], sPokeballCoords[0][1], 2);
gSprites[spriteId].sTaskId = taskId;
gSprites[spriteId].sBallId = 0;
@@ -495,7 +495,7 @@ static void Task_HandleStarterChooseInput(u8 taskId)
spriteId = CreateSprite(&sSpriteTemplate_StarterCircle, sPokeballCoords[selection][0], sPokeballCoords[selection][1], 1);
gTasks[taskId].tCircleSpriteId = spriteId;
- // Create Pokemon sprite
+ // Create Pokémon sprite
spriteId = CreatePokemonFrontSprite(GetStarterPokemon(gTasks[taskId].tStarterSelection), sPokeballCoords[selection][0], sPokeballCoords[selection][1]);
gSprites[spriteId].affineAnims = &sAffineAnims_StarterPokemon;
gSprites[spriteId].callback = SpriteCB_StarterPokemon;
@@ -637,7 +637,7 @@ static u8 CreatePokemonFrontSprite(u16 species, u8 x, u8 y)
static void SpriteCB_SelectionHand(struct Sprite *sprite)
{
- // Float up and down above selected pokeball
+ // Float up and down above selected Poké Ball
sprite->x = sCursorCoords[gTasks[sprite->data[0]].tStarterSelection][0];
sprite->y = sCursorCoords[gTasks[sprite->data[0]].tStarterSelection][1];
sprite->y2 = Sin(sprite->data[1], 8);
@@ -646,7 +646,7 @@ static void SpriteCB_SelectionHand(struct Sprite *sprite)
static void SpriteCB_Pokeball(struct Sprite *sprite)
{
- // Animate pokeball if currently selected
+ // Animate Poké Ball if currently selected
if (gTasks[sprite->sTaskId].tStarterSelection == sprite->sBallId)
StartSpriteAnimIfDifferent(sprite, 1);
else
diff --git a/src/title_screen.c b/src/title_screen.c
index 87bf0d970e..1d605d1fc0 100644
--- a/src/title_screen.c
+++ b/src/title_screen.c
@@ -23,6 +23,12 @@
#include "constants/rgb.h"
#include "constants/songs.h"
+enum {
+ TAG_VERSION = 1000,
+ TAG_PRESS_START_COPYRIGHT,
+ TAG_LOGO_SHINE,
+};
+
#define VERSION_BANNER_RIGHT_TILEOFFSET 64
#define VERSION_BANNER_LEFT_X 98
#define VERSION_BANNER_RIGHT_X 162
@@ -158,8 +164,8 @@ static const union AnimCmd *const sVersionBannerRightAnimTable[] =
static const struct SpriteTemplate sVersionBannerLeftSpriteTemplate =
{
- .tileTag = 1000,
- .paletteTag = 1000,
+ .tileTag = TAG_VERSION,
+ .paletteTag = TAG_VERSION,
.oam = &sVersionBannerLeftOamData,
.anims = sVersionBannerLeftAnimTable,
.images = NULL,
@@ -169,8 +175,8 @@ static const struct SpriteTemplate sVersionBannerLeftSpriteTemplate =
static const struct SpriteTemplate sVersionBannerRightSpriteTemplate =
{
- .tileTag = 1000,
- .paletteTag = 1000,
+ .tileTag = TAG_VERSION,
+ .paletteTag = TAG_VERSION,
.oam = &sVersionBannerRightOamData,
.anims = sVersionBannerRightAnimTable,
.images = NULL,
@@ -183,7 +189,7 @@ static const struct CompressedSpriteSheet sSpriteSheet_EmeraldVersion[] =
{
.data = gTitleScreenEmeraldVersionGfx,
.size = 0x1000,
- .tag = 1000
+ .tag = TAG_VERSION
},
{},
};
@@ -205,75 +211,80 @@ static const struct OamData sOamData_CopyrightBanner =
.affineParam = 0,
};
-static const union AnimCmd sCopyrightBannerAnim0[] =
+static const union AnimCmd sAnim_PressStart_0[] =
{
ANIMCMD_FRAME(1, 4),
ANIMCMD_END,
};
-static const union AnimCmd sCopyrightBannerAnim1[] =
+static const union AnimCmd sAnim_PressStart_1[] =
{
ANIMCMD_FRAME(5, 4),
ANIMCMD_END,
};
-static const union AnimCmd sCopyrightBannerAnim2[] =
+static const union AnimCmd sAnim_PressStart_2[] =
{
ANIMCMD_FRAME(9, 4),
ANIMCMD_END,
};
-static const union AnimCmd sCopyrightBannerAnim3[] =
+static const union AnimCmd sAnim_PressStart_3[] =
{
ANIMCMD_FRAME(13, 4),
ANIMCMD_END,
};
-static const union AnimCmd sCopyrightBannerAnim4[] =
+static const union AnimCmd sAnim_PressStart_4[] =
{
ANIMCMD_FRAME(17, 4),
ANIMCMD_END,
};
-static const union AnimCmd sCopyrightBannerAnim5[] =
+static const union AnimCmd sAnim_Copyright_0[] =
{
ANIMCMD_FRAME(21, 4),
ANIMCMD_END,
};
-static const union AnimCmd sCopyrightBannerAnim6[] =
+static const union AnimCmd sAnim_Copyright_1[] =
{
ANIMCMD_FRAME(25, 4),
ANIMCMD_END,
};
-static const union AnimCmd sCopyrightBannerAnim7[] =
+static const union AnimCmd sAnim_Copyright_2[] =
{
ANIMCMD_FRAME(29, 4),
ANIMCMD_END,
};
-static const union AnimCmd sCopyrightBannerAnim8[] =
+static const union AnimCmd sAnim_Copyright_3[] =
{
ANIMCMD_FRAME(33, 4),
ANIMCMD_END,
};
-static const union AnimCmd sCopyrightBannerAnim9[] =
+static const union AnimCmd sAnim_Copyright_4[] =
{
ANIMCMD_FRAME(37, 4),
ANIMCMD_END,
};
-static const union AnimCmd *const sStartCopyrightBannerAnimTable[] =
+// The "Press Start" and copyright graphics are each 5 32x8 segments long
+#define NUM_PRESS_START_FRAMES 5
+#define NUM_COPYRIGHT_FRAMES 5
+
+static const union AnimCmd *const sStartCopyrightBannerAnimTable[NUM_PRESS_START_FRAMES + NUM_COPYRIGHT_FRAMES] =
{
- sCopyrightBannerAnim0,
- sCopyrightBannerAnim1,
- sCopyrightBannerAnim2,
- sCopyrightBannerAnim3,
- sCopyrightBannerAnim4,
- sCopyrightBannerAnim5,
- sCopyrightBannerAnim6,
- sCopyrightBannerAnim7,
- sCopyrightBannerAnim8,
- sCopyrightBannerAnim9,
+ sAnim_PressStart_0,
+ sAnim_PressStart_1,
+ sAnim_PressStart_2,
+ sAnim_PressStart_3,
+ sAnim_PressStart_4,
+ [NUM_PRESS_START_FRAMES] =
+ sAnim_Copyright_0,
+ sAnim_Copyright_1,
+ sAnim_Copyright_2,
+ sAnim_Copyright_3,
+ sAnim_Copyright_4,
};
static const struct SpriteTemplate sStartCopyrightBannerSpriteTemplate =
{
- .tileTag = 1001,
- .paletteTag = 1001,
+ .tileTag = TAG_PRESS_START_COPYRIGHT,
+ .paletteTag = TAG_PRESS_START_COPYRIGHT,
.oam = &sOamData_CopyrightBanner,
.anims = sStartCopyrightBannerAnimTable,
.images = NULL,
@@ -286,7 +297,7 @@ static const struct CompressedSpriteSheet sSpriteSheet_PressStart[] =
{
.data = gTitleScreenPressStartGfx,
.size = 0x520,
- .tag = 1001
+ .tag = TAG_PRESS_START_COPYRIGHT
},
{},
};
@@ -295,7 +306,7 @@ static const struct SpritePalette sSpritePalette_PressStart[] =
{
{
.data = gTitleScreenPressStartPal,
- .tag = 1001
+ .tag = TAG_PRESS_START_COPYRIGHT
},
{},
};
@@ -330,8 +341,8 @@ static const union AnimCmd *const sPokemonLogoShineAnimTable[] =
static const struct SpriteTemplate sPokemonLogoShineSpriteTemplate =
{
- .tileTag = 1002,
- .paletteTag = 1001,
+ .tileTag = TAG_LOGO_SHINE,
+ .paletteTag = TAG_PRESS_START_COPYRIGHT,
.oam = &sPokemonLogoShineOamData,
.anims = sPokemonLogoShineAnimTable,
.images = NULL,
@@ -344,15 +355,25 @@ static const struct CompressedSpriteSheet sPokemonLogoShineSpriteSheet[] =
{
.data = sTitleScreenLogoShineGfx,
.size = 0x800,
- .tag = 1002
+ .tag = TAG_LOGO_SHINE
},
{},
};
-// code
+// Task data for the main title screen tasks (Task_TitleScreenPhase#)
+#define tCounter data[0]
+#define tSkipToNext data[1]
+#define tPointless data[2] // Incremented but never used to do anything.
+#define tBg2Y data[3]
+#define tBg1Y data[4]
+
+// Sprite data for sVersionBannerLeftSpriteTemplate / sVersionBannerRightSpriteTemplate
+#define sAlphaBlendIdx data[0]
+#define sParentTaskId data[1]
+
static void SpriteCB_VersionBannerLeft(struct Sprite *sprite)
{
- if (gTasks[sprite->data[1]].data[1] != 0)
+ if (gTasks[sprite->sParentTaskId].tSkipToNext)
{
sprite->oam.objMode = ST_OAM_OBJ_NORMAL;
sprite->y = VERSION_BANNER_Y_GOAL;
@@ -361,15 +382,15 @@ static void SpriteCB_VersionBannerLeft(struct Sprite *sprite)
{
if (sprite->y != VERSION_BANNER_Y_GOAL)
sprite->y++;
- if (sprite->data[0] != 0)
- sprite->data[0]--;
- SetGpuReg(REG_OFFSET_BLDALPHA, gTitleScreenAlphaBlend[sprite->data[0]]);
+ if (sprite->sAlphaBlendIdx != 0)
+ sprite->sAlphaBlendIdx--;
+ SetGpuReg(REG_OFFSET_BLDALPHA, gTitleScreenAlphaBlend[sprite->sAlphaBlendIdx]);
}
}
static void SpriteCB_VersionBannerRight(struct Sprite *sprite)
{
- if (gTasks[sprite->data[1]].data[1] != 0)
+ if (gTasks[sprite->sParentTaskId].tSkipToNext)
{
sprite->oam.objMode = ST_OAM_OBJ_NORMAL;
sprite->y = VERSION_BANNER_Y_GOAL;
@@ -381,13 +402,16 @@ static void SpriteCB_VersionBannerRight(struct Sprite *sprite)
}
}
+// Sprite data for SpriteCB_PressStartCopyrightBanner
+#define sAnimate data[0]
+#define sTimer data[1]
+
static void SpriteCB_PressStartCopyrightBanner(struct Sprite *sprite)
{
- if (sprite->data[0] == 1)
+ if (sprite->sAnimate == TRUE)
{
- sprite->data[1]++;
// Alternate between hidden and shown every 16th frame
- if (sprite->data[1] & 16)
+ if (++sprite->sTimer & 16)
sprite->invisible = FALSE;
else
sprite->invisible = TRUE;
@@ -404,11 +428,11 @@ static void CreatePressStartBanner(s16 x, s16 y)
u8 spriteId;
x -= 64;
- for (i = 0; i < 5; i++, x += 32)
+ for (i = 0; i < NUM_PRESS_START_FRAMES; i++, x += 32)
{
spriteId = CreateSprite(&sStartCopyrightBannerSpriteTemplate, x, y, 0);
StartSpriteAnim(&gSprites[spriteId], i);
- gSprites[spriteId].data[0] = 1;
+ gSprites[spriteId].sAnimate = TRUE;
}
}
@@ -418,93 +442,122 @@ static void CreateCopyrightBanner(s16 x, s16 y)
u8 spriteId;
x -= 64;
- for (i = 0; i < 5; i++, x += 32)
+ for (i = 0; i < NUM_COPYRIGHT_FRAMES; i++, x += 32)
{
spriteId = CreateSprite(&sStartCopyrightBannerSpriteTemplate, x, y, 0);
- StartSpriteAnim(&gSprites[spriteId], i + 5);
+ StartSpriteAnim(&gSprites[spriteId], i + NUM_PRESS_START_FRAMES);
}
}
+#undef sAnimate
+#undef sTimer
+
+// Defines for SpriteCB_PokemonLogoShine
+enum {
+ SHINE_MODE_SINGLE_NO_BG_COLOR,
+ SHINE_MODE_DOUBLE,
+ SHINE_MODE_SINGLE,
+};
+
+#define SHINE_SPEED 4
+
+#define sMode data[0]
+#define sBgColor data[1]
+
static void SpriteCB_PokemonLogoShine(struct Sprite *sprite)
{
if (sprite->x < DISPLAY_WIDTH + 32)
{
- if (sprite->data[0]) // Flash background
+ // In any mode except SHINE_MODE_SINGLE_NO_BG_COLOR the background
+ // color will change, in addition to the shine sprite moving.
+ if (sprite->sMode != SHINE_MODE_SINGLE_NO_BG_COLOR)
{
u16 backgroundColor;
if (sprite->x < DISPLAY_WIDTH / 2)
{
// Brighten background color
- if (sprite->data[1] < 31)
- sprite->data[1]++;
- if (sprite->data[1] < 31)
- sprite->data[1]++;
+ if (sprite->sBgColor < 31)
+ sprite->sBgColor++;
+ if (sprite->sBgColor < 31)
+ sprite->sBgColor++;
}
else
{
// Darken background color
- if (sprite->data[1] != 0)
- sprite->data[1]--;
- if (sprite->data[1] != 0)
- sprite->data[1]--;
+ if (sprite->sBgColor != 0)
+ sprite->sBgColor--;
+ if (sprite->sBgColor != 0)
+ sprite->sBgColor--;
}
- backgroundColor = _RGB(sprite->data[1], sprite->data[1], sprite->data[1]);
- if (sprite->x == DISPLAY_WIDTH / 2 + 12
- || sprite->x == DISPLAY_WIDTH / 2 + 16
- || sprite->x == DISPLAY_WIDTH / 2 + 20
- || sprite->x == DISPLAY_WIDTH / 2 + 24)
+ backgroundColor = _RGB(sprite->sBgColor, sprite->sBgColor, sprite->sBgColor);
+
+ // Flash the background green for 4 frames of movement.
+ // Otherwise use the updating color.
+ if (sprite->x == DISPLAY_WIDTH / 2 + (3 * SHINE_SPEED)
+ || sprite->x == DISPLAY_WIDTH / 2 + (4 * SHINE_SPEED)
+ || sprite->x == DISPLAY_WIDTH / 2 + (5 * SHINE_SPEED)
+ || sprite->x == DISPLAY_WIDTH / 2 + (6 * SHINE_SPEED))
gPlttBufferFaded[0] = RGB(24, 31, 12);
else
gPlttBufferFaded[0] = backgroundColor;
}
- sprite->x += 4;
+
+ sprite->x += SHINE_SPEED;
}
else
{
+ // Sprite has moved fully offscreen
gPlttBufferFaded[0] = RGB_BLACK;
DestroySprite(sprite);
}
}
-static void SpriteCB_PokemonLogoShine2(struct Sprite *sprite)
+static void SpriteCB_PokemonLogoShine_Fast(struct Sprite *sprite)
{
if (sprite->x < DISPLAY_WIDTH + 32)
- sprite->x += 8;
+ sprite->x += SHINE_SPEED * 2;
else
DestroySprite(sprite);
}
-static void StartPokemonLogoShine(u8 flashBg)
+static void StartPokemonLogoShine(u8 mode)
{
u8 spriteId;
- switch (flashBg)
+ switch (mode)
{
- case 0:
- case 2:
+ case SHINE_MODE_SINGLE_NO_BG_COLOR:
+ case SHINE_MODE_SINGLE:
+ // Create one regular shine sprite.
+ // If mode is SHINE_MODE_SINGLE it will also change the background color.
spriteId = CreateSprite(&sPokemonLogoShineSpriteTemplate, 0, 68, 0);
gSprites[spriteId].oam.objMode = ST_OAM_OBJ_WINDOW;
- gSprites[spriteId].data[0] = flashBg;
+ gSprites[spriteId].sMode = mode;
break;
- case 1:
+ case SHINE_MODE_DOUBLE:
+ // Create an invisible sprite with mode set to update the background color
spriteId = CreateSprite(&sPokemonLogoShineSpriteTemplate, 0, 68, 0);
gSprites[spriteId].oam.objMode = ST_OAM_OBJ_WINDOW;
- gSprites[spriteId].data[0] = flashBg;
+ gSprites[spriteId].sMode = mode;
gSprites[spriteId].invisible = TRUE;
+ // Create two faster shine sprites
spriteId = CreateSprite(&sPokemonLogoShineSpriteTemplate, 0, 68, 0);
- gSprites[spriteId].callback = SpriteCB_PokemonLogoShine2;
+ gSprites[spriteId].callback = SpriteCB_PokemonLogoShine_Fast;
gSprites[spriteId].oam.objMode = ST_OAM_OBJ_WINDOW;
spriteId = CreateSprite(&sPokemonLogoShineSpriteTemplate, -80, 68, 0);
- gSprites[spriteId].callback = SpriteCB_PokemonLogoShine2;
+ gSprites[spriteId].callback = SpriteCB_PokemonLogoShine_Fast;
gSprites[spriteId].oam.objMode = ST_OAM_OBJ_WINDOW;
break;
}
}
+#undef sMode
+#undef sBgColor
+
static void VBlankCB(void)
{
ScanlineEffect_InitHBlankDmaTransfer();
@@ -514,9 +567,6 @@ static void VBlankCB(void)
SetGpuReg(REG_OFFSET_BG1VOFS, gBattle_BG1_Y);
}
-#define tCounter data[0]
-#define tSkipToNext data[1]
-
void CB2_InitTitleScreen(void)
{
switch (gMain.state)
@@ -573,13 +623,13 @@ void CB2_InitTitleScreen(void)
gTasks[taskId].tCounter = 256;
gTasks[taskId].tSkipToNext = FALSE;
- gTasks[taskId].data[2] = -16;
- gTasks[taskId].data[3] = -32;
+ gTasks[taskId].tPointless = -16;
+ gTasks[taskId].tBg2Y = -32;
gMain.state = 3;
break;
}
case 3:
- BeginNormalPaletteFade(PALETTES_ALL, 1, 0x10, 0, RGB_WHITEALPHA);
+ BeginNormalPaletteFade(PALETTES_ALL, 1, 16, 0, RGB_WHITEALPHA);
SetVBlankCallback(VBlankCB);
gMain.state = 4;
break;
@@ -614,7 +664,7 @@ void CB2_InitTitleScreen(void)
case 5:
if (!UpdatePaletteFade())
{
- StartPokemonLogoShine(0);
+ StartPokemonLogoShine(SHINE_MODE_SINGLE_NO_BG_COLOR);
ScanlineEffect_InitWave(0, DISPLAY_HEIGHT, 4, 4, 0, SCANLINE_EFFECT_REG_BG1HOFS, TRUE);
SetMainCallback2(MainCB2);
}
@@ -630,11 +680,11 @@ static void MainCB2(void)
UpdatePaletteFade();
}
-// Shine the Pokemon logo two more times, and fade in the version banner
+// Shine the Pokémon logo two more times, and fade in the version banner
static void Task_TitleScreenPhase1(u8 taskId)
{
// Skip to next phase when A, B, Start, or Select is pressed
- if (JOY_NEW(A_B_START_SELECT) || gTasks[taskId].data[1] != 0)
+ if (JOY_NEW(A_B_START_SELECT) || gTasks[taskId].tSkipToNext)
{
gTasks[taskId].tSkipToNext = TRUE;
gTasks[taskId].tCounter = 0;
@@ -644,9 +694,9 @@ static void Task_TitleScreenPhase1(u8 taskId)
{
u16 frameNum = gTasks[taskId].tCounter;
if (frameNum == 176)
- StartPokemonLogoShine(1);
+ StartPokemonLogoShine(SHINE_MODE_DOUBLE);
else if (frameNum == 64)
- StartPokemonLogoShine(2);
+ StartPokemonLogoShine(SHINE_MODE_SINGLE);
gTasks[taskId].tCounter--;
}
@@ -663,19 +713,22 @@ static void Task_TitleScreenPhase1(u8 taskId)
// Create left side of version banner
spriteId = CreateSprite(&sVersionBannerLeftSpriteTemplate, VERSION_BANNER_LEFT_X, VERSION_BANNER_Y, 0);
- gSprites[spriteId].data[0] = 64;
- gSprites[spriteId].data[1] = taskId;
+ gSprites[spriteId].sAlphaBlendIdx = ARRAY_COUNT(gTitleScreenAlphaBlend);
+ gSprites[spriteId].sParentTaskId = taskId;
// Create right side of version banner
spriteId = CreateSprite(&sVersionBannerRightSpriteTemplate, VERSION_BANNER_RIGHT_X, VERSION_BANNER_Y, 0);
- gSprites[spriteId].data[1] = taskId;
+ gSprites[spriteId].sParentTaskId = taskId;
gTasks[taskId].tCounter = 144;
gTasks[taskId].func = Task_TitleScreenPhase2;
}
}
-// Create "Press Start" and copyright banners, and slide Pokemon logo up
+#undef sParentTaskId
+#undef sAlphaBlendIdx
+
+// Create "Press Start" and copyright banners, and slide Pokémon logo up
static void Task_TitleScreenPhase2(u8 taskId)
{
u32 yPos;
@@ -705,31 +758,31 @@ static void Task_TitleScreenPhase2(u8 taskId)
| DISPCNT_OBJ_ON);
CreatePressStartBanner(START_BANNER_X, 108);
CreateCopyrightBanner(START_BANNER_X, 148);
- gTasks[taskId].data[4] = 0;
+ gTasks[taskId].tBg1Y = 0;
gTasks[taskId].func = Task_TitleScreenPhase3;
}
- if (!(gTasks[taskId].tCounter & 3) && gTasks[taskId].data[2] != 0)
- gTasks[taskId].data[2]++;
- if (!(gTasks[taskId].tCounter & 1) && gTasks[taskId].data[3] != 0)
- gTasks[taskId].data[3]++;
+ if (!(gTasks[taskId].tCounter & 3) && gTasks[taskId].tPointless != 0)
+ gTasks[taskId].tPointless++;
+ if (!(gTasks[taskId].tCounter & 1) && gTasks[taskId].tBg2Y != 0)
+ gTasks[taskId].tBg2Y++;
- // Slide Pokemon logo up
- yPos = gTasks[taskId].data[3] * 256;
+ // Slide Pokémon logo up
+ yPos = gTasks[taskId].tBg2Y * 256;
SetGpuReg(REG_OFFSET_BG2Y_L, yPos);
SetGpuReg(REG_OFFSET_BG2Y_H, yPos / 0x10000);
- gTasks[taskId].data[5] = 15;
- gTasks[taskId].data[6] = 6;
+ gTasks[taskId].data[5] = 15; // Unused
+ gTasks[taskId].data[6] = 6; // Unused
}
// Show Rayquaza silhouette and process main title screen input
static void Task_TitleScreenPhase3(u8 taskId)
{
- if ((JOY_NEW(A_BUTTON)) || (JOY_NEW(START_BUTTON)))
+ if (JOY_NEW(A_BUTTON) || JOY_NEW(START_BUTTON))
{
FadeOutBGM(4);
- BeginNormalPaletteFade(PALETTES_ALL, 0, 0, 0x10, RGB_WHITEALPHA);
+ BeginNormalPaletteFade(PALETTES_ALL, 0, 0, 16, RGB_WHITEALPHA);
SetMainCallback2(CB2_GoToMainMenu);
}
else if (JOY_HELD(CLEAR_SAVE_BUTTON_COMBO) == CLEAR_SAVE_BUTTON_COMBO)
@@ -740,30 +793,29 @@ static void Task_TitleScreenPhase3(u8 taskId)
&& CanResetRTC() == TRUE)
{
FadeOutBGM(4);
- BeginNormalPaletteFade(PALETTES_ALL, 0, 0, 0x10, RGB_BLACK);
+ BeginNormalPaletteFade(PALETTES_ALL, 0, 0, 16, RGB_BLACK);
SetMainCallback2(CB2_GoToResetRtcScreen);
}
else if (JOY_HELD(BERRY_UPDATE_BUTTON_COMBO) == BERRY_UPDATE_BUTTON_COMBO)
{
FadeOutBGM(4);
- BeginNormalPaletteFade(PALETTES_ALL, 0, 0, 0x10, RGB_BLACK);
+ BeginNormalPaletteFade(PALETTES_ALL, 0, 0, 16, RGB_BLACK);
SetMainCallback2(CB2_GoToBerryFixScreen);
}
else
{
SetGpuReg(REG_OFFSET_BG2Y_L, 0);
SetGpuReg(REG_OFFSET_BG2Y_H, 0);
- gTasks[taskId].tCounter++;
- if (gTasks[taskId].tCounter & 1)
+ if (++gTasks[taskId].tCounter & 1)
{
- gTasks[taskId].data[4]++;
- gBattle_BG1_Y = gTasks[taskId].data[4] / 2;
+ gTasks[taskId].tBg1Y++;
+ gBattle_BG1_Y = gTasks[taskId].tBg1Y / 2;
gBattle_BG1_X = 0;
}
UpdateLegendaryMarkingColor(gTasks[taskId].tCounter);
if ((gMPlayInfo_BGM.status & 0xFFFF) == 0)
{
- BeginNormalPaletteFade(PALETTES_ALL, 0, 0, 0x10, RGB_WHITEALPHA);
+ BeginNormalPaletteFade(PALETTES_ALL, 0, 0, 16, RGB_WHITEALPHA);
SetMainCallback2(CB2_GoToCopyrightScreen);
}
}
diff --git a/src/trade.c b/src/trade.c
index 28e8f89d1c..e07e418d1a 100644
--- a/src/trade.c
+++ b/src/trade.c
@@ -157,7 +157,7 @@ struct InGameTrade {
u32 personality;
u16 heldItem;
u8 mailNum;
- u8 otName[11];
+ u8 otName[TRAINER_NAME_LENGTH + 1];
u8 otGender;
u8 sheen;
u16 requestedSpecies;
@@ -168,7 +168,7 @@ static EWRAM_DATA u8 *sMenuTextTileBuffer = NULL;
// Bytes 0-2 are used for the player's name text
// Bytes 3-5 are used for the partner's name text
// Bytes 6-7 are used for the Cancel text
-// Bytes 8-13 are used for the Choose a Pokemon text
+// Bytes 8-13 are used for the Choose a Pokémon text
// See the corresponding GFXTAGs in src/data/trade.h
static EWRAM_DATA u8 *sMenuTextTileBuffers[NUM_MENU_TEXT_SPRITES] = {NULL};
@@ -1010,25 +1010,25 @@ static void SetActiveMenuOptions(void)
{
if (i < sTradeMenu->partyCounts[TRADE_PLAYER])
{
- // Present player pokemon
+ // Present player Pokémon
gSprites[sTradeMenu->partySpriteIds[TRADE_PLAYER][i]].invisible = FALSE;
sTradeMenu->optionsActive[i] = TRUE;
}
else
{
- // Absent player pokemon
+ // Absent player Pokémon
sTradeMenu->optionsActive[i] = FALSE;
}
if (i < sTradeMenu->partyCounts[TRADE_PARTNER])
{
- // Present partner pokemon
+ // Present partner Pokémon
gSprites[sTradeMenu->partySpriteIds[TRADE_PARTNER][i]].invisible = FALSE;
sTradeMenu->optionsActive[i + PARTY_SIZE] = TRUE;
}
else
{
- // Absent partner pokemon
+ // Absent partner Pokémon
sTradeMenu->optionsActive[i + PARTY_SIZE] = FALSE;
}
}
@@ -1285,7 +1285,7 @@ static void Leader_HandleCommunication(void)
if (sTradeMenu->playerSelectStatus == STATUS_READY
&& sTradeMenu->partnerSelectStatus == STATUS_READY)
{
- // Both players have selected a pokemon to trade
+ // Both players have selected a Pokémon to trade
sTradeMenu->callbackId = CB_SET_SELECTED_MONS;
sTradeMenu->linkData[0] = LINKCMD_SET_MONS_TO_TRADE;
sTradeMenu->linkData[1] = sTradeMenu->cursorPosition;
@@ -1295,7 +1295,7 @@ static void Leader_HandleCommunication(void)
else if (sTradeMenu->playerSelectStatus == STATUS_READY
&& sTradeMenu->partnerSelectStatus == STATUS_CANCEL)
{
- // The player has selected a pokemon to trade,
+ // The player has selected a Pokémon to trade,
// but the partner has selected Cancel
PrintTradeMessage(MSG_CANCELED);
sTradeMenu->linkData[0] = LINKCMD_PARTNER_CANCEL_TRADE;
@@ -1308,7 +1308,7 @@ static void Leader_HandleCommunication(void)
else if (sTradeMenu->playerSelectStatus == STATUS_CANCEL
&& sTradeMenu->partnerSelectStatus == STATUS_READY)
{
- // The partner has selected a pokemon to trade,
+ // The partner has selected a Pokémon to trade,
// but the player has selected cancel
PrintTradeMessage(MSG_FRIEND_WANTS_TO_TRADE);
sTradeMenu->linkData[0] = LINKCMD_PLAYER_CANCEL_TRADE;
@@ -1465,7 +1465,7 @@ static void CB_ProcessMenuInput(void)
if (sTradeMenu->cursorPosition < PARTY_SIZE)
{
- // Selected pokemon in player's party
+ // Selected Pokémon in player's party
DrawTextBorderOuter(1, 1, 14);
FillWindowPixelBuffer(1, PIXEL_FILL(1));
PrintMenuTable(1, ARRAY_COUNT(sSelectTradeMonActions), sSelectTradeMonActions);
@@ -1476,7 +1476,7 @@ static void CB_ProcessMenuInput(void)
}
else if (sTradeMenu->cursorPosition < PARTY_SIZE * 2)
{
- // Selected pokemon in partner's party
+ // Selected Pokémon in partner's party
BeginNormalPaletteFade(PALETTES_ALL, 0, 0, 16, RGB_BLACK);
sTradeMenu->callbackId = CB_SHOW_MON_SUMMARY;
}
@@ -1855,7 +1855,7 @@ static void SetSelectedMon(u8 cursorPosition)
if (sTradeMenu->drawSelectedMonState[whichParty] == 0)
{
// Start the animation to display just the selected
- // pokemon in the middle of the screen
+ // Pokémon in the middle of the screen
sTradeMenu->drawSelectedMonState[whichParty] = 1;
sTradeMenu->selectedMonIdx[whichParty] = cursorPosition;
}
@@ -1889,10 +1889,10 @@ static void DrawSelectedMonScreen(u8 whichParty)
for (i = 0; i < PARTY_SIZE; i++)
ClearWindowTilemap(i + (whichParty * PARTY_SIZE + 2));
- // Re-display the selected pokemon
+ // Re-display the selected Pokémon
gSprites[sTradeMenu->partySpriteIds[selectedMonParty][partyIdx]].invisible = FALSE;
- // Move the selected pokemon to the center
+ // Move the selected Pokémon to the center
gSprites[sTradeMenu->partySpriteIds[selectedMonParty][partyIdx]].data[0] = 20;
gSprites[sTradeMenu->partySpriteIds[selectedMonParty][partyIdx]].data[2] = (sTradeMonSpriteCoords[selectedMonParty * PARTY_SIZE][0]
+ sTradeMonSpriteCoords[selectedMonParty * PARTY_SIZE + 1][0]) / 2 * 8 + 14;
@@ -1900,7 +1900,7 @@ static void DrawSelectedMonScreen(u8 whichParty)
StoreSpriteCallbackInData6(&gSprites[sTradeMenu->partySpriteIds[selectedMonParty][partyIdx]], SpriteCB_MonIcon);
sTradeMenu->drawSelectedMonState[whichParty]++;
Trade_MoveSelectedMonToTarget(&gSprites[sTradeMenu->partySpriteIds[selectedMonParty][partyIdx]]);
-
+
CopyToBgTilemapBufferRect_ChangePalette(1, sTradePartyBoxTilemap, whichParty * 15, 0, 15, 17, 0);
CopyBgTilemapBufferToVram(1);
CopyBgTilemapBufferToVram(0);
@@ -3093,7 +3093,7 @@ static void UpdatePokedexForReceivedMon(u8 partyIdx)
// Functionally nop after commented code
static void TryEnableNationalDexFromLinkPartner(void)
{
- u8 mpId = GetMultiplayerId();
+ u8 UNUSED mpId = GetMultiplayerId();
// Originally in Ruby but commented out
/*if (gLinkPlayers[mpId ^ 1].lp_field_2 == 0x8000)
EnableNationalPokedex();*/
@@ -3109,13 +3109,13 @@ static void TradeMons(u8 playerPartyIdx, u8 partnerPartyIdx)
struct Pokemon *partnerMon = &gEnemyParty[partnerPartyIdx];
u16 partnerMail = GetMonData(partnerMon, MON_DATA_MAIL);
- // The mail attached to the sent Pokemon no longer exists in your file.
+ // The mail attached to the sent Pokémon no longer exists in your file.
if (playerMail != MAIL_NONE)
ClearMail(&gSaveBlock1Ptr->mail[playerMail]);
SWAP(*playerMon, *partnerMon, sTradeAnim->tempMon);
- // By default, a Pokemon received from a trade will have 70 Friendship.
+ // By default, a Pokémon received from a trade will have 70 Friendship.
// Eggs use Friendship to track egg cycles, so don't set this on Eggs.
friendship = 70;
if (!GetMonData(playerMon, MON_DATA_IS_EGG))
diff --git a/src/trainer_hill.c b/src/trainer_hill.c
index 3fbec613ad..018b9f14ba 100644
--- a/src/trainer_hill.c
+++ b/src/trainer_hill.c
@@ -571,7 +571,7 @@ static void IsTrainerHillChallengeActive(void)
gSpecialVar_Result = TRUE;
}
-static void TrainerHillDummy_Unused(void)
+static void UNUSED TrainerHillDummy_Unused(void)
{
}
@@ -650,7 +650,7 @@ void LoadTrainerHillObjectEventTemplates(void)
eventTemplates[i].localId = i + 1;
eventTemplates[i].graphicsId = FacilityClassToGraphicsId(sHillData->floors[floorId].trainers[i].facilityClass);
eventTemplates[i].x = sHillData->floors[floorId].map.trainerCoords[i] & 0xF;
- eventTemplates[i].y = ((sHillData->floors[floorId].map.trainerCoords[i] >> 4) & 0xF) + 5;
+ eventTemplates[i].y = ((sHillData->floors[floorId].map.trainerCoords[i] >> 4) & 0xF) + HILL_FLOOR_HEIGHT_MARGIN;
bits = i << 2;
eventTemplates[i].movementType = ((sHillData->floors[floorId].map.trainerDirections >> bits) & 0xF) + MOVEMENT_TYPE_FACE_UP;
eventTemplates[i].trainerRange_berryTreeId = (sHillData->floors[floorId].map.trainerRanges >> bits) & 0xF;
@@ -769,8 +769,7 @@ u8 GetCurrentTrainerHillMapId(void)
return mapId;
}
-// Unused
-static bool32 OnTrainerHillRoof(void)
+static bool32 UNUSED OnTrainerHillRoof(void)
{
bool32 onRoof;
diff --git a/src/trainer_pokemon_sprites.c b/src/trainer_pokemon_sprites.c
index e7542c65cc..b185e87048 100644
--- a/src/trainer_pokemon_sprites.c
+++ b/src/trainer_pokemon_sprites.c
@@ -11,7 +11,7 @@
#define PICS_COUNT 8
-// Needs to be large enough to store either a decompressed pokemon pic or trainer pic
+// Needs to be large enough to store either a decompressed Pokémon pic or trainer pic
#define PIC_SPRITE_SIZE max(MON_PIC_SIZE, TRAINER_PIC_SIZE)
#define MAX_PIC_FRAMES max(MAX_MON_PIC_FRAMES, MAX_TRAINER_PIC_FRAMES)
@@ -342,8 +342,7 @@ u16 FreeAndDestroyMonPicSpriteNoPalette(u16 spriteId)
return FreeAndDestroyPicSpriteInternal(spriteId, FALSE);
}
-// Unused
-static u16 LoadMonPicInWindow(u16 species, u32 otId, u32 personality, bool8 isFrontPic, u8 paletteSlot, u8 windowId)
+static u16 UNUSED LoadMonPicInWindow(u16 species, u32 otId, u32 personality, bool8 isFrontPic, u8 paletteSlot, u8 windowId)
{
return LoadPicSpriteInWindow(species, otId, personality, isFrontPic, paletteSlot, windowId, FALSE);
}
@@ -364,8 +363,7 @@ u16 FreeAndDestroyTrainerPicSprite(u16 spriteId)
return FreeAndDestroyPicSpriteInternal(spriteId, TRUE);
}
-// Unused
-static u16 LoadTrainerPicInWindow(u16 species, bool8 isFrontPic, u8 paletteSlot, u8 windowId)
+static u16 UNUSED LoadTrainerPicInWindow(u16 species, bool8 isFrontPic, u8 paletteSlot, u8 windowId)
{
return LoadPicSpriteInWindow(species, 0, 0, isFrontPic, paletteSlot, windowId, TRUE);
}
diff --git a/src/trainer_see.c b/src/trainer_see.c
index aa6b9ba015..95b11447f2 100644
--- a/src/trainer_see.c
+++ b/src/trainer_see.c
@@ -761,7 +761,7 @@ static void Task_SetBuriedTrainerMovement(u8 taskId)
struct Task *task = &gTasks[taskId];
struct ObjectEvent *objEvent;
- LoadWordFromTwoHalfwords(&task->tObjEvent, (u32 *)&objEvent);
+ LoadWordFromTwoHalfwords((u16*) &task->tObjEvent, (u32 *)&objEvent);
if (!task->data[7])
{
ObjectEventClearHeldMovement(objEvent);
@@ -783,7 +783,7 @@ static void Task_SetBuriedTrainerMovement(u8 taskId)
// Called when a buried Trainer has the reveal_trainer movement applied, from direct interaction
void SetBuriedTrainerMovement(struct ObjectEvent *objEvent)
{
- StoreWordInTwoHalfwords(&gTasks[CreateTask(Task_SetBuriedTrainerMovement, 0)].tObjEvent, (u32)objEvent);
+ StoreWordInTwoHalfwords((u16*) &gTasks[CreateTask(Task_SetBuriedTrainerMovement, 0)].tObjEvent, (u32)objEvent);
}
void DoTrainerApproach(void)
diff --git a/src/tv.c b/src/tv.c
index 1246faff25..0152dffa3e 100644
--- a/src/tv.c
+++ b/src/tv.c
@@ -3961,8 +3961,7 @@ else \
(langptr) = langfix; \
}
-// Unused
-static void TranslateShowNames(TVShow *show, u32 language)
+static void UNUSED TranslateShowNames(TVShow *show, u32 language)
{
int i;
TVShow **shows;
@@ -6242,7 +6241,7 @@ static void DoTVShowSpotTheCuties(void)
TVShowConvertInternationalString(gStringVar1, show->cuties.playerName, show->cuties.language);
TVShowConvertInternationalString(gStringVar2, show->cuties.nickname, show->cuties.pokemonNameLanguage);
- // Comments following the intro depend on how many ribbons the pokemon has
+ // Comments following the intro depend on how many ribbons the Pokémon has
if (show->cuties.nRibbons < 10)
sTVShowState = SPOTCUTIES_STATE_RIBBONS_LOW;
else if (show->cuties.nRibbons < 20)
diff --git a/src/union_room.c b/src/union_room.c
index 9160fc16ae..1b29863183 100644
--- a/src/union_room.c
+++ b/src/union_room.c
@@ -1043,8 +1043,8 @@ static void Task_TryJoinLinkGroup(u8 taskId)
id = ListMenu_ProcessInput(data->listTaskId);
if (JOY_NEW(A_BUTTON) && id != LIST_NOTHING_CHOSEN)
{
- // this unused variable along with the assignment is needed to match
- u32 activity = data->playerList->players[id].rfu.data.activity;
+ // Needed to match
+ u32 UNUSED activity = data->playerList->players[id].rfu.data.activity;
if (data->playerList->players[id].groupScheduledAnim == UNION_ROOM_SPAWN_IN && !data->playerList->players[id].rfu.data.startedActivity)
{
@@ -2149,8 +2149,8 @@ static void Task_CardOrNewsWithFriend(u8 taskId)
id = ListMenu_ProcessInput(data->listTaskId);
if (JOY_NEW(A_BUTTON) && id != LIST_NOTHING_CHOSEN)
{
- // this unused variable along with the assignment is needed to match
- u32 activity = data->playerList->players[id].rfu.data.activity;
+ // Needed to match
+ u32 UNUSED activity = data->playerList->players[id].rfu.data.activity;
if (data->playerList->players[id].groupScheduledAnim == UNION_ROOM_SPAWN_IN && !data->playerList->players[id].rfu.data.startedActivity)
{
diff --git a/src/union_room_chat.c b/src/union_room_chat.c
index 253e025689..993e36de52 100644
--- a/src/union_room_chat.c
+++ b/src/union_room_chat.c
@@ -744,11 +744,11 @@ static const struct MessageWindowInfo sDisplayStdMessages[] = {
static const u8 sText_Ellipsis[] = _("…");
static const struct MenuAction sKeyboardPageTitleTexts[UNION_ROOM_KB_PAGE_COUNT + 1] = {
- [UNION_ROOM_KB_PAGE_UPPER] = {gText_Upper, NULL},
- [UNION_ROOM_KB_PAGE_LOWER] = {gText_Lower, NULL},
- [UNION_ROOM_KB_PAGE_EMOJI] = {gText_Symbols, NULL},
- [UNION_ROOM_KB_PAGE_REGISTER] = {gText_Register2, NULL},
- [UNION_ROOM_KB_PAGE_COUNT] = {gText_Exit2, NULL},
+ [UNION_ROOM_KB_PAGE_UPPER] = {gText_Upper, {NULL}},
+ [UNION_ROOM_KB_PAGE_LOWER] = {gText_Lower, {NULL}},
+ [UNION_ROOM_KB_PAGE_EMOJI] = {gText_Symbols, {NULL}},
+ [UNION_ROOM_KB_PAGE_REGISTER] = {gText_Register2, {NULL}},
+ [UNION_ROOM_KB_PAGE_COUNT] = {gText_Exit2, {NULL}},
};
static const u16 sUnionRoomChatInterfacePal[] = INCBIN_U16("graphics/union_room_chat/interface.gbapal");
diff --git a/src/use_pokeblock.c b/src/use_pokeblock.c
index 06df5d0a33..c9d5c56e5c 100644
--- a/src/use_pokeblock.c
+++ b/src/use_pokeblock.c
@@ -73,10 +73,10 @@ struct UsePokeblockSession
u8 natureText[34];
};
-// This struct is identical to PokenavMonListItem, the struct used for managing lists of pokemon in the pokenav
+// This struct is identical to PokenavMonListItem, the struct used for managing lists of Pokémon in the PokéNav
// Given that this screen is essentially duplicated in the poknav, this struct was probably the same one with
// a more general name/purpose
-// TODO: Once the pokenav conditions screens are documented, resolve the above
+// TODO: Once the PokéNav conditions screens are documented, resolve the above
struct UsePokeblockMenuPokemon
{
u8 boxId; // Because this screen is never used for the PC this is always set to TOTAL_BOXES_COUNT to refer to party
@@ -1108,15 +1108,14 @@ static u8 GetSelectionIdFromPartyId(u8 partyId)
return partyId - numEggs;
}
-// Unused
-static u8 GetPartyIdFromSelectionId_(u8 selectionId)
+static u8 UNUSED GetPartyIdFromSelectionId_(u8 selectionId)
{
return GetPartyIdFromSelectionId(selectionId);
}
static void LoadAndCreateUpDownSprites(void)
{
- u16 i, spriteId;
+ u16 i;
LoadSpriteSheet(&sSpriteSheet_UpDown);
LoadSpritePalette(&sSpritePalette_UpDown);
@@ -1126,7 +1125,7 @@ static void LoadAndCreateUpDownSprites(void)
{
if (sInfo->enhancements[i] != 0)
{
- spriteId = CreateSprite(&sSpriteTemplate_UpDown, sUpDownCoordsOnGraph[i][0], sUpDownCoordsOnGraph[i][1], 0);
+ u16 spriteId = CreateSprite(&sSpriteTemplate_UpDown, sUpDownCoordsOnGraph[i][0], sUpDownCoordsOnGraph[i][1], 0);
if (spriteId != MAX_SPRITES)
{
if (sInfo->enhancements[i] != 0) // Always true here
@@ -1137,20 +1136,24 @@ static void LoadAndCreateUpDownSprites(void)
}
}
+#define tTimer data[0]
+
static void SpriteCB_UpDown(struct Sprite *sprite)
{
- if (sprite->data[0] < 6)
+ if (sprite->tTimer < 6)
sprite->y2 -= 2;
- else if (sprite->data[0] < 12)
+ else if (sprite->tTimer < 12)
sprite->y2 += 2;
- if (++sprite->data[0] > 60)
+ if (++sprite->tTimer > 60)
{
DestroySprite(sprite);
sInfo->numEnhancements--;
}
}
+#undef tTimer
+
static void LoadPartyInfo(void)
{
u16 i;
@@ -1256,7 +1259,7 @@ static void LoadAndCreateSelectionIcons(void)
LoadSpriteSheets(spriteSheets);
LoadSpritePalettes(spritePals);
- // Fill pokeball selection icons up to number in party
+ // Fill Poké Ball selection icons up to number in party
for (i = 0; i < sMenu->info.numSelections - 1; i++)
{
spriteId = CreateSprite(&spriteTemplate, 226, (i * 20) + 8, 0);
@@ -1486,7 +1489,7 @@ static bool8 LoadNewSelection_CancelToMon(void)
case 2:
if (!ConditionMenu_UpdateMonEnter(&sMenu->graph, &sMenu->curMonXOffset))
{
- // Load the new adjacent pokemon (not the one being shown)
+ // Load the new adjacent Pokémon (not the one being shown)
LoadMonInfo(sMenu->toLoadSelection, sMenu->toLoadId);
sMenu->info.helperState++;
}
@@ -1549,7 +1552,7 @@ static bool8 LoadNewSelection_MonToMon(void)
case 2:
if (!ConditionMenu_UpdateMonEnter(&sMenu->graph, &sMenu->curMonXOffset))
{
- // Load the new adjacent pokemon (not the one being shown)
+ // Load the new adjacent Pokémon (not the one being shown)
LoadMonInfo(sMenu->toLoadSelection, sMenu->toLoadId);
sMenu->info.helperState++;
}
@@ -1590,8 +1593,8 @@ static void SpriteCB_SelectionIconCancel(struct Sprite *sprite)
sprite->oam.paletteNum = IndexOfSpritePaletteTag(TAG_CONDITION_CANCEL);
}
-// Calculate the max id for sparkles/stars that appear around the pokemon on the condition screen
-// All pokemon start with 1 sparkle (added by CreateConditionSparkleSprites), so the number here +1
+// Calculate the max id for sparkles/stars that appear around the Pokémon on the condition screen
+// All Pokémon start with 1 sparkle (added by CreateConditionSparkleSprites), so the number here +1
// is the total number of sparkles that appear
static void CalculateNumAdditionalSparkles(u8 monIndex)
{
@@ -1612,12 +1615,15 @@ static void LoadConditionGfx(void)
LoadSpritePalette(&spritePalette);
}
+#define sSpeed data[0]
+#define sTargetX data[1]
+
static void CreateConditionSprite(void)
{
u16 i;
s16 xDiff, xStart;
int yStart = 17;
- int var = 8;
+ int speed = 8;
struct Sprite **sprites = sMenu->condition;
const struct SpriteTemplate *template = &sSpriteTemplate_Condition;
@@ -1626,9 +1632,9 @@ static void CreateConditionSprite(void)
u8 spriteId = CreateSprite(template, i * xDiff + xStart, yStart, 0);
if (spriteId != MAX_SPRITES)
{
- gSprites[spriteId].data[0] = var;
- gSprites[spriteId].data[1] = (i * xDiff) | 0x20;
- gSprites[spriteId].data[2] = i;
+ gSprites[spriteId].sSpeed = speed;
+ gSprites[spriteId].sTargetX = (i * xDiff) | 0x20;
+ gSprites[spriteId].data[2] = i; // Unused
StartSpriteAnim(&gSprites[spriteId], i);
sprites[i] = &gSprites[spriteId];
}
@@ -1657,11 +1663,15 @@ static void SpriteCB_Condition(struct Sprite *sprite)
{
s16 prevX = sprite->x;
- sprite->x += sprite->data[0];
- if ((prevX <= sprite->data[1] && sprite->x >= sprite->data[1])
- || (prevX >= sprite->data[1] && sprite->x <= sprite->data[1]))
+ // Slide onscreen
+ sprite->x += sprite->sSpeed;
+
+ // Check if target position has been reached/surpassed
+ if ((prevX <= sprite->sTargetX && sprite->x >= sprite->sTargetX)
+ || (prevX >= sprite->sTargetX && sprite->x <= sprite->sTargetX))
{
- sprite->x = sprite->data[1];
+ // End slide onscreen, become static sprite.
+ sprite->x = sprite->sTargetX;
sprite->callback = SpriteCallbackDummy;
}
}
diff --git a/src/wild_encounter.c b/src/wild_encounter.c
index 87d7d866bb..11d01f04ea 100644
--- a/src/wild_encounter.c
+++ b/src/wild_encounter.c
@@ -52,7 +52,11 @@ static void FeebasSeedRng(u16 seed);
static bool8 IsWildLevelAllowedByRepel(u8 level);
static void ApplyFluteEncounterRateMod(u32 *encRate);
static void ApplyCleanseTagEncounterRateMod(u32 *encRate);
+#ifdef BUGFIX
+static bool8 TryGetAbilityInfluencedWildMonIndex(const struct WildPokemon *wildMon, u8 type, u8 ability, u8 *monIndex, u32 size);
+#else
static bool8 TryGetAbilityInfluencedWildMonIndex(const struct WildPokemon *wildMon, u8 type, u8 ability, u8 *monIndex);
+#endif
static bool8 IsAbilityAllowingEncounter(u8 level);
EWRAM_DATA static u8 sWildEncountersDisabled = 0;
@@ -360,7 +364,7 @@ static u8 PickWildMonNature(void)
}
}
}
- // check synchronize for a pokemon with the same ability
+ // check synchronize for a Pokémon with the same ability
if (!GetMonData(&gPlayerParty[0], MON_DATA_SANITY_IS_EGG)
&& GetMonAbility(&gPlayerParty[0]) == ABILITY_SYNCHRONIZE
&& Random() % 2 == 0)
@@ -409,6 +413,11 @@ static void CreateWildMon(u16 species, u8 level)
CreateMonWithNature(&gEnemyParty[0], species, level, USE_RANDOM_IVS, PickWildMonNature());
}
+#ifdef BUGFIX
+#define TRY_GET_ABILITY_INFLUENCED_WILD_MON_INDEX(wildPokemon, type, ability, ptr, count) TryGetAbilityInfluencedWildMonIndex(wildPokemon, type, ability, ptr, count)
+#else
+#define TRY_GET_ABILITY_INFLUENCED_WILD_MON_INDEX(wildPokemon, type, ability, ptr, count) TryGetAbilityInfluencedWildMonIndex(wildPokemon, type, ability, ptr)
+#endif
static bool8 TryGenerateWildMon(const struct WildPokemonInfo *wildMonInfo, u8 area, u8 flags)
{
@@ -418,15 +427,15 @@ static bool8 TryGenerateWildMon(const struct WildPokemonInfo *wildMonInfo, u8 ar
switch (area)
{
case WILD_AREA_LAND:
- if (TryGetAbilityInfluencedWildMonIndex(wildMonInfo->wildPokemon, TYPE_STEEL, ABILITY_MAGNET_PULL, &wildMonIndex))
+ if (TRY_GET_ABILITY_INFLUENCED_WILD_MON_INDEX(wildMonInfo->wildPokemon, TYPE_STEEL, ABILITY_MAGNET_PULL, &wildMonIndex, LAND_WILD_COUNT))
break;
- if (TryGetAbilityInfluencedWildMonIndex(wildMonInfo->wildPokemon, TYPE_ELECTRIC, ABILITY_STATIC, &wildMonIndex))
+ if (TRY_GET_ABILITY_INFLUENCED_WILD_MON_INDEX(wildMonInfo->wildPokemon, TYPE_ELECTRIC, ABILITY_STATIC, &wildMonIndex, LAND_WILD_COUNT))
break;
wildMonIndex = ChooseWildMonIndex_Land();
break;
case WILD_AREA_WATER:
- if (TryGetAbilityInfluencedWildMonIndex(wildMonInfo->wildPokemon, TYPE_ELECTRIC, ABILITY_STATIC, &wildMonIndex))
+ if (TRY_GET_ABILITY_INFLUENCED_WILD_MON_INDEX(wildMonInfo->wildPokemon, TYPE_ELECTRIC, ABILITY_STATIC, &wildMonIndex, WATER_WILD_COUNT))
break;
wildMonIndex = ChooseWildMonIndex_WaterRock();
@@ -803,16 +812,16 @@ u16 GetLocalWildMon(bool8 *isWaterMon)
// Neither
if (landMonsInfo == NULL && waterMonsInfo == NULL)
return SPECIES_NONE;
- // Land Pokemon
+ // Land Pokémon
else if (landMonsInfo != NULL && waterMonsInfo == NULL)
return landMonsInfo->wildPokemon[ChooseWildMonIndex_Land()].species;
- // Water Pokemon
+ // Water Pokémon
else if (landMonsInfo == NULL && waterMonsInfo != NULL)
{
*isWaterMon = TRUE;
return waterMonsInfo->wildPokemon[ChooseWildMonIndex_WaterRock()].species;
}
- // Either land or water Pokemon
+ // Either land or water Pokémon
if ((Random() % 100) < 80)
{
return landMonsInfo->wildPokemon[ChooseWildMonIndex_Land()].species;
@@ -923,8 +932,11 @@ static bool8 TryGetRandomWildMonIndexByType(const struct WildPokemon *wildMon, u
*monIndex = validIndexes[Random() % validMonCount];
return TRUE;
}
-
+#ifdef BUGFIX
+static bool8 TryGetAbilityInfluencedWildMonIndex(const struct WildPokemon *wildMon, u8 type, u8 ability, u8 *monIndex, u32 size)
+#else
static bool8 TryGetAbilityInfluencedWildMonIndex(const struct WildPokemon *wildMon, u8 type, u8 ability, u8 *monIndex)
+#endif
{
if (GetMonData(&gPlayerParty[0], MON_DATA_SANITY_IS_EGG))
return FALSE;
@@ -933,7 +945,11 @@ static bool8 TryGetAbilityInfluencedWildMonIndex(const struct WildPokemon *wildM
else if (Random() % 2 != 0)
return FALSE;
+#ifdef BUGFIX
+ return TryGetRandomWildMonIndexByType(wildMon, type, size, monIndex);
+#else
return TryGetRandomWildMonIndexByType(wildMon, type, LAND_WILD_COUNT, monIndex);
+#endif
}
static void ApplyFluteEncounterRateMod(u32 *encRate)
diff --git a/sym_ewram.txt b/sym_ewram.txt
index 414b7a3b23..31c507ee9b 100644
--- a/sym_ewram.txt
+++ b/sym_ewram.txt
@@ -1,3 +1,4 @@
+ .include "gflib/malloc.o"
.include "src/decompress.o"
.include "src/main.o"
.include "gflib/window.o"
diff --git a/tools/aif2pcm/main.c b/tools/aif2pcm/main.c
index 720db1acae..0824b92da8 100644
--- a/tools/aif2pcm/main.c
+++ b/tools/aif2pcm/main.c
@@ -238,7 +238,7 @@ void read_aif(struct Bytes *aif, AifData *aif_data)
{
FATAL_ERROR("More than one MARK Chunk in file!\n");
}
-
+
markers = calloc(num_markers, sizeof(struct Marker));
// Read each marker.
@@ -289,7 +289,7 @@ void read_aif(struct Bytes *aif, AifData *aif_data)
// Skip NoLooping sustain loop.
pos += 4;
}
-
+
// Skip release loop, we don't need it.
pos += 6;
}
@@ -303,7 +303,7 @@ void read_aif(struct Bytes *aif, AifData *aif_data)
{
uint8_t *sample_data = (uint8_t *)malloc(num_samples * sizeof(uint8_t));
memcpy(sample_data, &aif->data[pos], num_samples);
-
+
aif_data->samples8 = sample_data;
aif_data->real_num_samples = num_samples;
}
@@ -316,7 +316,7 @@ void read_aif(struct Bytes *aif, AifData *aif_data)
{
sample_data_swapped[i] = __builtin_bswap16(sample_data[i]);
}
-
+
aif_data->samples16 = sample_data_swapped;
aif_data->real_num_samples = num_samples;
free(sample_data);
@@ -329,12 +329,12 @@ void read_aif(struct Bytes *aif, AifData *aif_data)
pos += chunk_size;
}
}
-
+
if (markers)
{
// Resolve loop points.
struct Marker *cur_marker = markers;
-
+
// Grab loop start point.
for (int i = 0; i < num_markers; i++, cur_marker++)
{
@@ -573,7 +573,7 @@ void aif2pcm(const char *aif_filename, const char *pcm_filename, bool compress)
struct Bytes *aif = read_bytearray(aif_filename);
AifData aif_data = {0};
read_aif(aif, &aif_data);
-
+
// Convert 16-bit to 8-bit if necessary
if (aif_data.sample_size == 16)
{
diff --git a/tools/gbagfx/font.c b/tools/gbagfx/font.c
index 0dd6fbc3ee..1251b5c647 100644
--- a/tools/gbagfx/font.c
+++ b/tools/gbagfx/font.c
@@ -26,7 +26,7 @@ static void ConvertFromLatinFont(unsigned char *src, unsigned char *dest, unsign
unsigned int pixelsX = (column * 16) + ((glyphTile & 1) * 8);
for (unsigned int i = 0; i < 8; i++) {
- unsigned int pixelsY = (row * 16) + ((glyphTile >> 1) * 8) + i;
+ unsigned int pixelsY = (row * 16) + ((glyphTile >> 1) * 8) + i;
unsigned int destPixelsOffset = (pixelsY * 64) + (pixelsX / 4);
dest[destPixelsOffset] = src[srcPixelsOffset + 1];
@@ -75,7 +75,7 @@ static void ConvertFromHalfwidthJapaneseFont(unsigned char *src, unsigned char *
for (unsigned int i = 0; i < 8; i++) {
unsigned int pixelsY = (row * 16) + (glyphTile * 8) + i;
unsigned int destPixelsOffset = (pixelsY * 32) + (pixelsX / 4);
-
+
dest[destPixelsOffset] = src[srcPixelsOffset + 1];
dest[destPixelsOffset + 1] = src[srcPixelsOffset];
@@ -233,7 +233,7 @@ void ReadHalfwidthJapaneseFont(char *path, struct Image *image)
FATAL_ERROR("The file size (%d) is not a multiple of %d.\n", fileSize, glyphSize);
int numGlyphs = fileSize / glyphSize;
-
+
if (numGlyphs % 16 != 0)
FATAL_ERROR("The number of glyphs (%d) is not a multiple of 16.\n", numGlyphs);
diff --git a/tools/preproc/c_file.cpp b/tools/preproc/c_file.cpp
index c10286ce2e..3aabf38a72 100644
--- a/tools/preproc/c_file.cpp
+++ b/tools/preproc/c_file.cpp
@@ -385,7 +385,7 @@ void CFile::TryConvertIncbin()
if (m_buffer[m_pos] == '\\')
RaiseError("unexpected escape in path string");
-
+
m_pos++;
}
@@ -424,7 +424,7 @@ void CFile::TryConvertIncbin()
m_pos++;
}
-
+
if (m_buffer[m_pos] != ')')
RaiseError("expected ')'");
diff --git a/tools/preproc/charmap.cpp b/tools/preproc/charmap.cpp
index a7bedfe26f..a0c631026c 100644
--- a/tools/preproc/charmap.cpp
+++ b/tools/preproc/charmap.cpp
@@ -119,7 +119,7 @@ Lhs CharmapReader::ReadLhs()
break;
}
}
-
+
if (m_buffer[m_pos] == '\'')
{
m_pos++;
diff --git a/tools/scaninc/source_file.cpp b/tools/scaninc/source_file.cpp
index df31282f80..9d188eb738 100644
--- a/tools/scaninc/source_file.cpp
+++ b/tools/scaninc/source_file.cpp
@@ -41,7 +41,7 @@ SourceFileType GetFileType(std::string& path)
return SourceFileType::Inc;
else
FATAL_ERROR("Unrecognized extension \"%s\"\n", extension.c_str());
-
+
// Unreachable
return SourceFileType::Cpp;
}
@@ -84,7 +84,7 @@ SourceFile::SourceFile(std::string path)
else
incbins.insert(outputPath);
}
-
+
new (&m_source_file.asm_wrapper) SourceFile::InnerUnion::AsmWrapper{incbins, includes};
}
}