Merge branch 'master' into followers

This commit is contained in:
Ariel A 2023-12-31 01:25:51 -05:00
commit 7d7531f2fa
218 changed files with 2173 additions and 2117 deletions

1
.gitignore vendored
View File

@ -21,7 +21,6 @@ sound/**/*.bin
sound/songs/midi/*.s sound/songs/midi/*.s
tools/agbcc tools/agbcc
*.map *.map
*.ld
*.bat *.bat
*.dump *.dump
*.sa* *.sa*

View File

@ -119,8 +119,6 @@ ifneq ($(MODERN),1)
CPPFLAGS += -I tools/agbcc/include -I tools/agbcc -nostdinc -undef CPPFLAGS += -I tools/agbcc/include -I tools/agbcc -nostdinc -undef
endif endif
LDFLAGS = -Map ../../$(MAP)
SHA1 := $(shell { command -v sha1sum || command -v shasum; } 2>/dev/null) -c SHA1 := $(shell { command -v sha1sum || command -v shasum; } 2>/dev/null) -c
GFX := tools/gbagfx/gbagfx$(EXE) GFX := tools/gbagfx/gbagfx$(EXE)
AIF := tools/aif2pcm/aif2pcm$(EXE) AIF := tools/aif2pcm/aif2pcm$(EXE)
@ -236,8 +234,7 @@ clean-tools:
@$(foreach tooldir,$(TOOLDIRS),$(MAKE) clean -C $(tooldir);) @$(foreach tooldir,$(TOOLDIRS),$(MAKE) clean -C $(tooldir);)
mostlyclean: tidynonmodern tidymodern mostlyclean: tidynonmodern tidymodern
rm -f $(SAMPLE_SUBDIR)/*.bin find sound -iname '*.bin' -exec rm {} +
rm -f $(CRY_SUBDIR)/*.bin
rm -f $(MID_SUBDIR)/*.s 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 {} + 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 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 > $@ $(RAMSCRGEN) ewram_data $< ENGLISH > $@
ifeq ($(MODERN),0) 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 LD_SCRIPT_DEPS := $(OBJ_DIR)/sym_bss.ld $(OBJ_DIR)/sym_common.ld $(OBJ_DIR)/sym_ewram.ld
else else
LD_SCRIPT := ld_script_modern.txt LD_SCRIPT := ld_script_modern.ld
LD_SCRIPT_DEPS := LD_SCRIPT_DEPS :=
endif endif
$(OBJ_DIR)/ld_script.ld: $(LD_SCRIPT) $(LD_SCRIPT_DEPS) $(OBJ_DIR)/ld_script.ld: $(LD_SCRIPT) $(LD_SCRIPT_DEPS)
cd $(OBJ_DIR) && sed "s#tools/#../../tools/#g" ../../$(LD_SCRIPT) > ld_script.ld cd $(OBJ_DIR) && sed "s#tools/#../../tools/#g" ../../$(LD_SCRIPT) > ld_script.ld
LDFLAGS = -Map ../../$(MAP)
$(ELF): $(OBJ_DIR)/ld_script.ld $(OBJS) libagbsyscall $(ELF): $(OBJ_DIR)/ld_script.ld $(OBJS) libagbsyscall
@echo "cd $(OBJ_DIR) && $(LD) $(LDFLAGS) -T ld_script.ld -o ../../$@ <objects> <lib>" @echo "cd $(OBJ_DIR) && $(LD) $(LDFLAGS) -T ld_script.ld -o ../../$@ <objects> <lib>"
@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 $(FIX) $@ -t"$(TITLE)" -c$(GAME_CODE) -m$(MAKER_CODE) -r$(REVISION) --silent
$(ROM): $(ELF) $(ROM): $(ELF)

View File

@ -41,27 +41,4 @@ To set up the repository, see [INSTALL.md](INSTALL.md).
## See also ## See also
Other disassembly and/or decompilation projects: For contacts and other pret projects, see [pret.github.io](https://pret.github.io/).
* [**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)

View File

@ -1,3 +1,6 @@
#ifndef GUARD_CONSTANTS_GBA_CONSTANTS_INC
#define GUARD_CONSTANTS_GBA_CONSTANTS_INC
.set PSR_USR_MODE, 0x00000010 .set PSR_USR_MODE, 0x00000010
.set PSR_FIQ_MODE, 0x00000011 .set PSR_FIQ_MODE, 0x00000011
.set PSR_IRQ_MODE, 0x00000012 .set PSR_IRQ_MODE, 0x00000012
@ -511,3 +514,5 @@
.set BLDCNT_TGT2_OBJ, 1 << 12 .set BLDCNT_TGT2_OBJ, 1 << 12
.set BLDCNT_TGT2_BD, 1 << 13 .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 .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

View File

@ -1,3 +1,6 @@
#ifndef GUARD_CONSTANTS_GLOBAL_INC
#define GUARD_CONSTANTS_GLOBAL_INC
.set TRUE, 1 .set TRUE, 1
.set FALSE, 0 .set FALSE, 0
@ -20,3 +23,5 @@
.set OBJ_IMAGE_ANIM_H_FLIP, 1 << 6 .set OBJ_IMAGE_ANIM_H_FLIP, 1 << 6
.set OBJ_IMAGE_ANIM_V_FLIP, 1 << 7 .set OBJ_IMAGE_ANIM_V_FLIP, 1 << 7
#endif @ GUARD_CONSTANTS_GLOBAL_INC

View File

@ -1,3 +1,6 @@
#ifndef GUARD_CONSTANTS_M4A_CONSTANTS_INC
#define GUARD_CONSTANTS_M4A_CONSTANTS_INC
.equiv ID_NUMBER, 0x68736d53 .equiv ID_NUMBER, 0x68736d53
.equiv PCM_DMA_BUF_SIZE, 1584 .equiv PCM_DMA_BUF_SIZE, 1584
@ -250,3 +253,5 @@
struct_field o_CgbChannel_nextChannelPointer, 4 struct_field o_CgbChannel_nextChannelPointer, 4
struct_field o_CgbChannel_dummy4, 8 struct_field o_CgbChannel_dummy4, 8
struct_field CgbChannel_size, 0 struct_field CgbChannel_size, 0
#endif @ GUARD_CONSTANTS_M4A_CONSTANTS_INC

View File

@ -1,3 +1,6 @@
#ifndef GUARD_CONSTANTS_TMS_HMS_INC
#define GUARD_CONSTANTS_TMS_HMS_INC
#include "constants/tms_hms.h" #include "constants/tms_hms.h"
/* Expands to: /* Expands to:
@ -15,3 +18,5 @@ FOREACH_TM(EQUIV_TM)
FOREACH_HM(EQUIV_HM) FOREACH_HM(EQUIV_HM)
#undef EQUIV_TM #undef EQUIV_TM
#undef EQUIV_HM #undef EQUIV_HM
#endif @ GUARD_CONSTANTS_TMS_HMS_INC

View File

@ -1,3 +1,4 @@
#include "config.h"
#include "constants/battle.h" #include "constants/battle.h"
#include "constants/battle_ai.h" #include "constants/battle_ai.h"
#include "constants/abilities.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 @ BUG: Foresight is only encouraged if the user is Ghost type or
@ has high evasion, but should check target instead @ has high evasion, but should check target instead
AI_CV_Foresight: AI_CV_Foresight:
.ifdef BUGFIX #ifdef BUGFIX
get_target_type1 get_target_type1
if_equal TYPE_GHOST, AI_CV_Foresight2 if_equal TYPE_GHOST, AI_CV_Foresight2
get_target_type2 get_target_type2
if_equal TYPE_GHOST, AI_CV_Foresight2 if_equal TYPE_GHOST, AI_CV_Foresight2
if_stat_level_more_than AI_TARGET, STAT_EVASION, 8, AI_CV_Foresight3 if_stat_level_more_than AI_TARGET, STAT_EVASION, 8, AI_CV_Foresight3
.else #else
get_user_type1 get_user_type1
if_equal TYPE_GHOST, AI_CV_Foresight2 if_equal TYPE_GHOST, AI_CV_Foresight2
get_user_type2 get_user_type2
if_equal TYPE_GHOST, AI_CV_Foresight2 if_equal TYPE_GHOST, AI_CV_Foresight2
if_stat_level_more_than AI_USER, STAT_EVASION, 8, AI_CV_Foresight3 if_stat_level_more_than AI_USER, STAT_EVASION, 8, AI_CV_Foresight3
.endif #endif
score -2 score -2
goto AI_CV_Foresight_End goto AI_CV_Foresight_End
@ -2183,13 +2184,13 @@ AI_CV_SemiInvulnerable2:
if_status2 AI_TARGET, STATUS2_CURSED, AI_CV_SemiInvulnerable_TryEncourage if_status2 AI_TARGET, STATUS2_CURSED, AI_CV_SemiInvulnerable_TryEncourage
if_status3 AI_TARGET, STATUS3_LEECHSEED, AI_CV_SemiInvulnerable_TryEncourage if_status3 AI_TARGET, STATUS3_LEECHSEED, AI_CV_SemiInvulnerable_TryEncourage
get_weather get_weather
.ifdef BUGFIX #ifdef BUGFIX
if_equal AI_WEATHER_HAIL, AI_CV_SemiInvulnerable_CheckIceType if_equal AI_WEATHER_HAIL, AI_CV_SemiInvulnerable_CheckIceType
if_equal AI_WEATHER_SANDSTORM, AI_CV_SemiInvulnerable_CheckSandstormTypes if_equal AI_WEATHER_SANDSTORM, AI_CV_SemiInvulnerable_CheckSandstormTypes
.else #else
if_equal AI_WEATHER_HAIL, AI_CV_SemiInvulnerable_CheckSandstormTypes if_equal AI_WEATHER_HAIL, AI_CV_SemiInvulnerable_CheckSandstormTypes
if_equal AI_WEATHER_SANDSTORM, AI_CV_SemiInvulnerable_CheckIceType if_equal AI_WEATHER_SANDSTORM, AI_CV_SemiInvulnerable_CheckIceType
.endif #endif
goto AI_CV_SemiInvulnerable5 goto AI_CV_SemiInvulnerable5
AI_CV_SemiInvulnerable_CheckSandstormTypes: 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 @ BUG: Facade score is increased if the target is statused, but should be if the user is
AI_CV_Facade: 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 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 if_not_status AI_TARGET, STATUS1_POISON | STATUS1_BURN | STATUS1_PARALYSIS | STATUS1_TOXIC_POISON, AI_CV_Facade_End
.endif #endif
score +1 score +1
AI_CV_Facade_End: AI_CV_Facade_End:
end end
@ -3176,9 +3177,9 @@ AI_HPAware_DiscouragedEffectsWhenTargetLowHP:
AI_TrySunnyDayStart: AI_TrySunnyDayStart:
if_target_is_ally AI_TryOnAlly if_target_is_ally AI_TryOnAlly
if_not_effect EFFECT_SUNNY_DAY, AI_TrySunnyDayStart_End 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 if_equal FALSE, AI_TrySunnyDayStart_End
.endif #endif
is_first_turn_for AI_USER is_first_turn_for AI_USER
if_equal FALSE, AI_TrySunnyDayStart_End if_equal FALSE, AI_TrySunnyDayStart_End
score +5 score +5

View File

@ -3208,7 +3208,7 @@ BattleScript_DamagingWeatherLoop::
jumpifword CMP_EQUAL, gBattleMoveDamage, 0, BattleScript_DamagingWeatherLoopIncrement jumpifword CMP_EQUAL, gBattleMoveDamage, 0, BattleScript_DamagingWeatherLoopIncrement
printfromtable gSandStormHailDmgStringIds printfromtable gSandStormHailDmgStringIds
waitmessage B_WAIT_TIME_LONG 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 effectivenesssound
hitanimation BS_ATTACKER hitanimation BS_ATTACKER
healthbarupdate BS_ATTACKER healthbarupdate BS_ATTACKER
@ -3220,7 +3220,7 @@ BattleScript_DamagingWeatherLoopIncrement::
addbyte gBattleCommunication, 1 addbyte gBattleCommunication, 1
jumpifbytenotequal gBattleCommunication, gBattlersCount, BattleScript_DamagingWeatherLoop jumpifbytenotequal gBattleCommunication, gBattlersCount, BattleScript_DamagingWeatherLoop
BattleScript_DamagingWeatherContinuesEnd:: 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 end2
BattleScript_SandStormHailEnds:: BattleScript_SandStormHailEnds::

View File

@ -1,3 +1,4 @@
#include "config.h"
#include "constants/global.h" #include "constants/global.h"
#include "constants/contest.h" #include "constants/contest.h"
.include "asm/macros.inc" .include "asm/macros.inc"
@ -435,11 +436,11 @@ AI_CGM_BetterWhenAudienceExcited:
AI_CGM_BetterWhenAudienceExcited_1stUp: AI_CGM_BetterWhenAudienceExcited_1stUp:
@ BUG: Should be if_appeal_num_eq 0 @ BUG: Should be if_appeal_num_eq 0
@ 1st up on 1st appeal excitement will always be 0 @ 1st up on 1st appeal excitement will always be 0
.ifdef BUGFIX #ifdef BUGFIX
if_appeal_num_eq 0, AI_CGM_BetterWhenAudienceExcited_1stAppeal if_appeal_num_eq 0, AI_CGM_BetterWhenAudienceExcited_1stAppeal
.else #else
if_appeal_num_not_eq 0, AI_CGM_BetterWhenAudienceExcited_1stAppeal if_appeal_num_not_eq 0, AI_CGM_BetterWhenAudienceExcited_1stAppeal
.endif #endif
if_excitement_eq 4, AI_CGM_BetterWhenAudienceExcited_1AwayFromMax if_excitement_eq 4, AI_CGM_BetterWhenAudienceExcited_1AwayFromMax
if_excitement_eq 3, AI_CGM_BetterWhenAudienceExcited_2AwayFromMax if_excitement_eq 3, AI_CGM_BetterWhenAudienceExcited_2AwayFromMax
end end
@ -546,11 +547,11 @@ AI_CGM_TargetMonWithJudgesAttention:
end end
AI_CGM_TargetMonWithJudgesAttention_CheckMon1: AI_CGM_TargetMonWithJudgesAttention_CheckMon1:
if_cannot_participate MON_1, AI_CGM_TargetMonWithJudgesAttention_CheckMon2 if_cannot_participate MON_1, AI_CGM_TargetMonWithJudgesAttention_CheckMon2
.ifdef BUGFIX #ifdef BUGFIX
if_not_used_combo_starter MON_1, AI_CGM_TargetMonWithJudgesAttention_CheckMon2 if_not_used_combo_starter MON_1, AI_CGM_TargetMonWithJudgesAttention_CheckMon2
.else #else
if_used_combo_starter MON_1, AI_CGM_TargetMonWithJudgesAttention_CheckMon2 if_used_combo_starter MON_1, AI_CGM_TargetMonWithJudgesAttention_CheckMon2
.endif #endif
if_random_less_than 125, AI_CGM_TargetMonWithJudgesAttention_CheckMon2 if_random_less_than 125, AI_CGM_TargetMonWithJudgesAttention_CheckMon2
score +2 score +2
if_not_completed_combo MON_1, AI_CGM_TargetMonWithJudgesAttention_CheckMon2 if_not_completed_combo MON_1, AI_CGM_TargetMonWithJudgesAttention_CheckMon2
@ -559,11 +560,11 @@ AI_CGM_TargetMonWithJudgesAttention_CheckMon1:
AI_CGM_TargetMonWithJudgesAttention_CheckMon2: AI_CGM_TargetMonWithJudgesAttention_CheckMon2:
if_user_order_eq MON_2, AI_CGM_End if_user_order_eq MON_2, AI_CGM_End
if_cannot_participate MON_2, AI_CGM_TargetMonWithJudgesAttention_CheckMon3 if_cannot_participate MON_2, AI_CGM_TargetMonWithJudgesAttention_CheckMon3
.ifdef BUGFIX #ifdef BUGFIX
if_not_used_combo_starter MON_2, AI_CGM_TargetMonWithJudgesAttention_CheckMon3 if_not_used_combo_starter MON_2, AI_CGM_TargetMonWithJudgesAttention_CheckMon3
.else #else
if_used_combo_starter MON_2, AI_CGM_TargetMonWithJudgesAttention_CheckMon3 if_used_combo_starter MON_2, AI_CGM_TargetMonWithJudgesAttention_CheckMon3
.endif #endif
if_random_less_than 125, AI_CGM_TargetMonWithJudgesAttention_CheckMon3 if_random_less_than 125, AI_CGM_TargetMonWithJudgesAttention_CheckMon3
score +2 score +2
if_not_completed_combo MON_2, AI_CGM_TargetMonWithJudgesAttention_CheckMon3 if_not_completed_combo MON_2, AI_CGM_TargetMonWithJudgesAttention_CheckMon3
@ -572,11 +573,11 @@ AI_CGM_TargetMonWithJudgesAttention_CheckMon2:
AI_CGM_TargetMonWithJudgesAttention_CheckMon3: AI_CGM_TargetMonWithJudgesAttention_CheckMon3:
if_user_order_eq MON_3, AI_CGM_End if_user_order_eq MON_3, AI_CGM_End
if_cannot_participate 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 if_not_used_combo_starter MON_3, AI_CGM_End
.else #else
if_used_combo_starter MON_3, AI_CGM_End if_used_combo_starter MON_3, AI_CGM_End
.endif #endif
if_random_less_than 125, AI_CGM_End if_random_less_than 125, AI_CGM_End
score +2 score +2
if_not_completed_combo MON_3, AI_CGM_End if_not_completed_combo MON_3, AI_CGM_End

View File

@ -1,3 +1,4 @@
#include "config.h"
#include "constants/global.h" #include "constants/global.h"
#include "constants/apprentice.h" #include "constants/apprentice.h"
#include "constants/battle.h" #include "constants/battle.h"

View File

@ -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, @ 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. @ 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). @ 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 tower_save 0
.endif #endif
call Common_EventScript_SaveGame call Common_EventScript_SaveGame
setvar VAR_TEMP_CHALLENGE_STATUS, 255 setvar VAR_TEMP_CHALLENGE_STATUS, 255
goto_if_eq VAR_RESULT, 0, BattleFrontier_BattleTowerLobby_EventScript_CancelChallengeSaveFailed goto_if_eq VAR_RESULT, 0, BattleFrontier_BattleTowerLobby_EventScript_CancelChallengeSaveFailed
@ GAME_STAT_ENTERED_BATTLE_TOWER should not be incremented here, for two reasons: @ 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 @ 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. @ 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 #ifndef BUGFIX
incrementgamestat GAME_STAT_ENTERED_BATTLE_TOWER incrementgamestat GAME_STAT_ENTERED_BATTLE_TOWER
.endif #endif
specialvar VAR_RESULT, IsWirelessAdapterConnected specialvar VAR_RESULT, IsWirelessAdapterConnected
goto_if_eq VAR_RESULT, TRUE, BattleFrontier_BattleTowerLobby_EventScript_TryWirelessLink goto_if_eq VAR_RESULT, TRUE, BattleFrontier_BattleTowerLobby_EventScript_TryWirelessLink
goto BattleFrontier_BattleTowerLobby_EventScript_TryCableLink goto BattleFrontier_BattleTowerLobby_EventScript_TryCableLink

View File

@ -13,9 +13,9 @@ TrainerHill_OnWarp:
TrainerHill_1F_EventScript_DummyOnWarp:: TrainerHill_1F_EventScript_DummyOnWarp::
setvar VAR_TEMP_3, 1 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 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: TrainerHill_OnFrame:
map_script_2 VAR_TEMP_2, 0, TrainerHill_1F_EventScript_DummyWarpToEntranceCounter map_script_2 VAR_TEMP_2, 0, TrainerHill_1F_EventScript_DummyWarpToEntranceCounter

View File

@ -1,8 +1,11 @@
#include "global.h" #include "global.h"
#include "malloc.h"
static void *sHeapStart; static void *sHeapStart;
static u32 sHeapSize; static u32 sHeapSize;
EWRAM_DATA u8 gHeap[HEAP_SIZE] = {0};
#define MALLOC_SYSTEM_ID 0xA3A3 #define MALLOC_SYSTEM_ID 0xA3A3
struct MemBlock { struct MemBlock {

View File

@ -1,7 +1,6 @@
#ifndef GUARD_ALLOC_H #ifndef GUARD_ALLOC_H
#define GUARD_ALLOC_H #define GUARD_ALLOC_H
#define HEAP_SIZE 0x1C000
#define FREE_AND_SET_NULL(ptr) \ #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) #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 *Alloc(u32 size);
void *AllocZeroed(u32 size); void *AllocZeroed(u32 size);

View File

@ -298,7 +298,7 @@ u8 *ConvertIntToHexStringN(u8 *dest, s32 value, enum StringConvertMode mode, u8
if (state == WRITING_DIGITS) if (state == WRITING_DIGITS)
{ {
char *out = dest++; u8 *out = dest++;
if (digit <= 0xF) if (digit <= 0xF)
c = sDigits[digit]; c = sDigits[digit];
@ -309,7 +309,7 @@ u8 *ConvertIntToHexStringN(u8 *dest, s32 value, enum StringConvertMode mode, u8
} }
else if (digit != 0 || powerOfSixteen == 1) else if (digit != 0 || powerOfSixteen == 1)
{ {
char *out; u8 *out;
state = WRITING_DIGITS; state = WRITING_DIGITS;
out = dest++; out = dest++;

View File

@ -554,8 +554,7 @@ void DecompressGlyphTile(const void *src_, void *dest_)
*(dest++) = ((sFontHalfRowLookupTable[sFontHalfRowOffsets[temp & 0xFF]]) << 16) | (sFontHalfRowLookupTable[sFontHalfRowOffsets[temp >> 8]]); *(dest++) = ((sFontHalfRowLookupTable[sFontHalfRowOffsets[temp & 0xFF]]) << 16) | (sFontHalfRowLookupTable[sFontHalfRowOffsets[temp >> 8]]);
} }
// Unused static u8 UNUSED GetLastTextColor(u8 colorType)
static u8 GetLastTextColor(u8 colorType)
{ {
switch (colorType) switch (colorType)
{ {
@ -1224,8 +1223,7 @@ static u16 RenderText(struct TextPrinter *textPrinter)
return RENDER_FINISH; return RENDER_FINISH;
} }
// Unused static u32 UNUSED GetStringWidthFixedWidthFont(const u8 *str, u8 fontId, u8 letterSpacing)
static u32 GetStringWidthFixedWidthFont(const u8 *str, u8 fontId, u8 letterSpacing)
{ {
int i; int i;
u8 width; u8 width;

View File

@ -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); 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 sourceRect;
struct Bitmap destRect; struct Bitmap destRect;

View File

Before

Width:  |  Height:  |  Size: 4.4 KiB

After

Width:  |  Height:  |  Size: 4.4 KiB

View File

Before

Width:  |  Height:  |  Size: 4.4 KiB

After

Width:  |  Height:  |  Size: 4.4 KiB

View File

Before

Width:  |  Height:  |  Size: 111 B

After

Width:  |  Height:  |  Size: 111 B

View File

Before

Width:  |  Height:  |  Size: 112 B

After

Width:  |  Height:  |  Size: 112 B

View File

Before

Width:  |  Height:  |  Size: 99 B

After

Width:  |  Height:  |  Size: 99 B

View File

Before

Width:  |  Height:  |  Size: 99 B

After

Width:  |  Height:  |  Size: 99 B

1
graphics/unused/.gitignore vendored Normal file
View File

@ -0,0 +1 @@
redyellowgreen_frame.bin

View File

@ -21,7 +21,7 @@ JPCONTESTGFXDIR := graphics/contest/japanese
POKEDEXGFXDIR := graphics/pokedex POKEDEXGFXDIR := graphics/pokedex
STARTERGFXDIR := graphics/starter_choose STARTERGFXDIR := graphics/starter_choose
NAMINGGFXDIR := graphics/naming_screen 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 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 contest_types := cool beauty cute smart tough
@ -290,10 +290,10 @@ $(FONTGFXDIR)/short.fwjpnfont: $(FONTGFXDIR)/japanese_short.png
$(FONTGFXDIR)/braille.fwjpnfont: $(FONTGFXDIR)/braille.png $(FONTGFXDIR)/braille.fwjpnfont: $(FONTGFXDIR)/braille.png
$(GFX) $< $@ $(GFX) $< $@
$(FONTGFXDIR)/frlg_male.fwjpnfont: $(FONTGFXDIR)/japanese_frlg_male_font.png $(FONTGFXDIR)/frlg_male.fwjpnfont: $(FONTGFXDIR)/japanese_frlg_male.png
$(GFX) $< $@ $(GFX) $< $@
$(FONTGFXDIR)/frlg_female.fwjpnfont: $(FONTGFXDIR)/japanese_frlg_female_font.png $(FONTGFXDIR)/frlg_female.fwjpnfont: $(FONTGFXDIR)/japanese_frlg_female.png
$(GFX) $< $@ $(GFX) $< $@

View File

@ -54,6 +54,9 @@
#define BATTLE_BUFFER_LINK_SIZE 0x1000 #define BATTLE_BUFFER_LINK_SIZE 0x1000
// Special indicator value for shellBellDmg in SpecialStatus
#define IGNORE_SHELL_BELL 0xFFFF
struct ResourceFlags struct ResourceFlags
{ {
u32 flags[MAX_BATTLERS_COUNT]; u32 flags[MAX_BATTLERS_COUNT];
@ -133,7 +136,7 @@ struct SpecialStatus
u32 ppNotAffectedByPressure:1; u32 ppNotAffectedByPressure:1;
u32 faintedHasReplacement:1; u32 faintedHasReplacement:1;
u32 focusBanded:1; u32 focusBanded:1;
s32 dmg; s32 shellBellDmg;
s32 physicalDmg; s32 physicalDmg;
s32 specialDmg; s32 specialDmg;
u8 physicalBattlerId; u8 physicalBattlerId;
@ -417,7 +420,7 @@ struct BattleStruct
u8 arenaTurnCounter; u8 arenaTurnCounter;
u8 turnSideTracker; u8 turnSideTracker;
u8 unused_6[3]; 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] u8 lastTakenMoveFrom[MAX_BATTLERS_COUNT * MAX_BATTLERS_COUNT * 2]; // a 3-D array [target][attacker][byte]
u16 castformPalette[NUM_CASTFORM_FORMS][16]; u16 castformPalette[NUM_CASTFORM_FORMS][16];
union { union {
@ -437,7 +440,7 @@ struct BattleStruct
u16 arenaStartHp[2]; u16 arenaStartHp[2];
u8 arenaLostPlayerMons; // Bits for party member, lost as in referee's decision, not by fainting. u8 arenaLostPlayerMons; // Bits for party member, lost as in referee's decision, not by fainting.
u8 arenaLostOpponentMons; 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, // 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. // 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) STATIC_ASSERT(sizeof(((struct BattleStruct *)0)->palaceFlags) * 8 >= MAX_BATTLERS_COUNT + MAX_MON_MOVES, PalaceFlagsTooSmall)
#define F_DYNAMIC_TYPE_1 (1 << 6) #define DYNAMIC_TYPE_MASK ((1 << 6) - 1)
#define F_DYNAMIC_TYPE_2 (1 << 7) #define F_DYNAMIC_TYPE_IGNORE_PHYSICALITY (1 << 6) // If set, the dynamic type's physicality won't be used for certain move effects.
#define DYNAMIC_TYPE_MASK (F_DYNAMIC_TYPE_1 - 1) #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) \ #define GET_MOVE_TYPE(move, typeArg) \
{ \ { \
@ -592,7 +595,7 @@ struct BattleSpriteData
struct MonSpritesGfx 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 { union {
void *ptr[MAX_BATTLERS_COUNT]; void *ptr[MAX_BATTLERS_COUNT];
u8 *byte[MAX_BATTLERS_COUNT]; u8 *byte[MAX_BATTLERS_COUNT];
@ -647,7 +650,7 @@ extern u16 gChosenMove;
extern u16 gCalledMove; extern u16 gCalledMove;
extern s32 gBattleMoveDamage; extern s32 gBattleMoveDamage;
extern s32 gHpDealt; extern s32 gHpDealt;
extern s32 gTakenDmg[MAX_BATTLERS_COUNT]; extern s32 gBideDmg[MAX_BATTLERS_COUNT];
extern u16 gLastUsedItem; extern u16 gLastUsedItem;
extern u8 gLastUsedAbility; extern u8 gLastUsedAbility;
extern u8 gBattlerAttacker; extern u8 gBattlerAttacker;
@ -673,7 +676,7 @@ extern u8 gLastHitBy[MAX_BATTLERS_COUNT];
extern u16 gChosenMoveByBattler[MAX_BATTLERS_COUNT]; extern u16 gChosenMoveByBattler[MAX_BATTLERS_COUNT];
extern u8 gMoveResultFlags; extern u8 gMoveResultFlags;
extern u32 gHitMarker; extern u32 gHitMarker;
extern u8 gTakenDmgByBattler[MAX_BATTLERS_COUNT]; extern u8 gBideTarget[MAX_BATTLERS_COUNT];
extern u8 gUnusedFirstBattleVar2; extern u8 gUnusedFirstBattleVar2;
extern u16 gSideStatuses[NUM_BATTLE_SIDES]; extern u16 gSideStatuses[NUM_BATTLE_SIDES];
extern struct SideTimer gSideTimers[NUM_BATTLE_SIDES]; extern struct SideTimer gSideTimers[NUM_BATTLE_SIDES];

View File

@ -168,7 +168,7 @@
// Not really sure what a "hitmarker" is. // Not really sure what a "hitmarker" is.
#define HITMARKER_WAKE_UP_CLEAR (1 << 4) // Cleared when waking up. Never set or checked. #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_DESTINYBOND (1 << 6)
#define HITMARKER_NO_ANIMATIONS (1 << 7) #define HITMARKER_NO_ANIMATIONS (1 << 7)
#define HITMARKER_IGNORE_SUBSTITUTE (1 << 8) #define HITMARKER_IGNORE_SUBSTITUTE (1 << 8)
@ -176,7 +176,7 @@
#define HITMARKER_ATTACKSTRING_PRINTED (1 << 10) #define HITMARKER_ATTACKSTRING_PRINTED (1 << 10)
#define HITMARKER_NO_PPDEDUCT (1 << 11) #define HITMARKER_NO_PPDEDUCT (1 << 11)
#define HITMARKER_SWAP_ATTACKER_TARGET (1 << 12) #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_SYNCHRONISE_EFFECT (1 << 14)
#define HITMARKER_RUN (1 << 15) #define HITMARKER_RUN (1 << 15)
#define HITMARKER_IGNORE_ON_AIR (1 << 16) #define HITMARKER_IGNORE_ON_AIR (1 << 16)

View File

@ -16,12 +16,12 @@
#define PALACE_DATA_WIN_STREAK 1 #define PALACE_DATA_WIN_STREAK 1
#define PALACE_DATA_WIN_STREAK_ACTIVE 2 #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_ATTACK 0
#define PALACE_MOVE_GROUP_DEFENSE 1 #define PALACE_MOVE_GROUP_DEFENSE 1
#define PALACE_MOVE_GROUP_SUPPORT 2 #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_STRONGER 0
#define PALACE_TARGET_WEAKER 1 #define PALACE_TARGET_WEAKER 1
#define PALACE_TARGET_RANDOM 2 #define PALACE_TARGET_RANDOM 2

View File

@ -62,7 +62,7 @@
#define DEPT_STORE_FLOORNUM_11F 14 #define DEPT_STORE_FLOORNUM_11F 14
#define DEPT_STORE_FLOORNUM_ROOFTOP 15 #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 NUM_TRAINER_FAN_CLUB_MEMBERS 8
#define FANCLUB_GOT_FIRST_FANS 7 #define FANCLUB_GOT_FIRST_FANS 7

View File

@ -2,9 +2,9 @@
#define GUARD_CONSTANTS_GLOBAL_H #define GUARD_CONSTANTS_GLOBAL_H
// Invalid Versions show as "----------" in Gen 4 and Gen 5's summary screen. // 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 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". // 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_SAPPHIRE 1
#define VERSION_RUBY 2 #define VERSION_RUBY 2
#define VERSION_EMERALD 3 #define VERSION_EMERALD 3

View File

@ -23,7 +23,7 @@
#define FIRST_BALL ITEM_MASTER_BALL #define FIRST_BALL ITEM_MASTER_BALL
#define LAST_BALL ITEM_PREMIER_BALL #define LAST_BALL ITEM_PREMIER_BALL
// Pokemon Items // Pokémon Items
#define ITEM_POTION 13 #define ITEM_POTION 13
#define ITEM_ANTIDOTE 14 #define ITEM_ANTIDOTE 14
#define ITEM_BURN_HEAL 15 #define ITEM_BURN_HEAL 15
@ -476,7 +476,7 @@
#define ITEM_B_USE_MEDICINE 1 #define ITEM_B_USE_MEDICINE 1
#define ITEM_B_USE_OTHER 2 #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) #define ITEM_HAS_EFFECT(item) ((item) >= ITEM_POTION && (item) <= MAX_BERRY_INDEX)
#endif // GUARD_CONSTANTS_ITEMS_H #endif // GUARD_CONSTANTS_ITEMS_H

View File

@ -1,7 +1,7 @@
#ifndef GUARD_CONSTANTS_POKEDEX_H #ifndef GUARD_CONSTANTS_POKEDEX_H
#define GUARD_CONSTANTS_POKEDEX_H #define GUARD_CONSTANTS_POKEDEX_H
// National Pokedex order // National Pokédex order
enum { enum {
NATIONAL_DEX_NONE, NATIONAL_DEX_NONE,
// Kanto // Kanto
@ -425,7 +425,7 @@ enum {
#define JOHTO_DEX_COUNT NATIONAL_DEX_CELEBI #define JOHTO_DEX_COUNT NATIONAL_DEX_CELEBI
#define NATIONAL_DEX_COUNT NATIONAL_DEX_DEOXYS #define NATIONAL_DEX_COUNT NATIONAL_DEX_DEOXYS
// Hoenn Pokedex order // Hoenn Pokédex order
enum { enum {
HOENN_DEX_NONE, HOENN_DEX_NONE,
HOENN_DEX_TREECKO, HOENN_DEX_TREECKO,
@ -631,7 +631,7 @@ enum {
HOENN_DEX_JIRACHI, HOENN_DEX_JIRACHI,
HOENN_DEX_DEOXYS, HOENN_DEX_DEOXYS,
// End of Hoenn Dex (see HOENN_DEX_COUNT) // 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_BULBASAUR,
HOENN_DEX_IVYSAUR, HOENN_DEX_IVYSAUR,
HOENN_DEX_VENUSAUR, HOENN_DEX_VENUSAUR,

View File

@ -1,7 +1,7 @@
#ifndef GUARD_CONSTANTS_POKEMON_H #ifndef GUARD_CONSTANTS_POKEMON_H
#define GUARD_CONSTANTS_POKEMON_H #define GUARD_CONSTANTS_POKEMON_H
// Pokemon types // Pokémon types
#define TYPE_NONE 255 #define TYPE_NONE 255
#define TYPE_NORMAL 0 #define TYPE_NORMAL 0
#define TYPE_FIGHTING 1 #define TYPE_FIGHTING 1
@ -23,7 +23,7 @@
#define TYPE_DARK 17 #define TYPE_DARK 17
#define NUMBER_OF_MON_TYPES 18 #define NUMBER_OF_MON_TYPES 18
// Pokemon egg groups // Pokémon egg groups
#define EGG_GROUP_NONE 0 #define EGG_GROUP_NONE 0
#define EGG_GROUP_MONSTER 1 #define EGG_GROUP_MONSTER 1
#define EGG_GROUP_WATER_1 2 #define EGG_GROUP_WATER_1 2
@ -39,11 +39,11 @@
#define EGG_GROUP_WATER_2 12 #define EGG_GROUP_WATER_2 12
#define EGG_GROUP_DITTO 13 #define EGG_GROUP_DITTO 13
#define EGG_GROUP_DRAGON 14 #define EGG_GROUP_DRAGON 14
#define EGG_GROUP_UNDISCOVERED 15 #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_HARDY 0
#define NATURE_LONELY 1 #define NATURE_LONELY 1
#define NATURE_BRAVE 2 #define NATURE_BRAVE 2
@ -71,7 +71,7 @@
#define NATURE_QUIRKY 24 #define NATURE_QUIRKY 24
#define NUM_NATURES 25 #define NUM_NATURES 25
// Pokemon Stats // Pokémon Stats
#define STAT_HP 0 #define STAT_HP 0
#define STAT_ATK 1 #define STAT_ATK 1
#define STAT_DEF 2 #define STAT_DEF 2
@ -220,7 +220,7 @@
#define GROWTH_FAST 4 #define GROWTH_FAST 4
#define GROWTH_SLOW 5 #define GROWTH_SLOW 5
// Body colors for pokedex search // Body colors for Pokédex search
#define BODY_COLOR_RED 0 #define BODY_COLOR_RED 0
#define BODY_COLOR_BLUE 1 #define BODY_COLOR_BLUE 1
#define BODY_COLOR_YELLOW 2 #define BODY_COLOR_YELLOW 2
@ -263,7 +263,7 @@
#define MON_PIC_HEIGHT 64 #define MON_PIC_HEIGHT 64
#define MON_PIC_SIZE (MON_PIC_WIDTH * MON_PIC_HEIGHT / 2) #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: // There are 4 exceptions:
// - Castform has 4 frames, 1 for each form // - Castform has 4 frames, 1 for each form
// - Deoxys has 2 frames, 1 for each form // - Deoxys has 2 frames, 1 for each form

View File

@ -170,7 +170,7 @@
#define NUM_SECRET_BASE_FLAGS 32 // by definition, bitfield of 2 u16s #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_INTRO 0
#define CONTESTLIVE_STATE_WON_BOTH_ROUNDS 1 #define CONTESTLIVE_STATE_WON_BOTH_ROUNDS 1
#define CONTESTLIVE_STATE_BETTER_ROUND2 2 #define CONTESTLIVE_STATE_BETTER_ROUND2 2

View File

@ -209,7 +209,7 @@ struct ContestantStatus
u8 comboAppealBonus; u8 comboAppealBonus;
u8 repeatJam; u8 repeatJam;
u8 nextTurnOrder; // turn position u8 nextTurnOrder; // turn position
u8 attentionLevel; // How much the Pokemon "stood out" u8 attentionLevel; // How much the Pokémon "stood out"
u8 contestantAnimTarget; u8 contestantAnimTarget;
}; };

View File

@ -137,7 +137,7 @@
#define ROUND_BITS_TO_BYTES(numBits) DIV_ROUND_UP(numBits, 8) #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" // 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_DEX_FLAG_BYTES ROUND_BITS_TO_BYTES(NUM_SPECIES)
#define NUM_FLAG_BYTES ROUND_BITS_TO_BYTES(FLAGS_COUNT) #define NUM_FLAG_BYTES ROUND_BITS_TO_BYTES(FLAGS_COUNT)
#define NUM_TRENDY_SAYING_BYTES ROUND_BITS_TO_BYTES(NUM_TRENDY_SAYINGS) #define NUM_TRENDY_SAYING_BYTES ROUND_BITS_TO_BYTES(NUM_TRENDY_SAYINGS)
@ -522,7 +522,7 @@ struct SaveBlock2
/*0x90*/ u8 filler_90[0x8]; /*0x90*/ u8 filler_90[0x8];
/*0x98*/ struct Time localTimeOffset; /*0x98*/ struct Time localTimeOffset;
/*0xA0*/ struct Time lastBerryTreeUpdate; /*0xA0*/ struct Time lastBerryTreeUpdate;
/*0xA8*/ u32 gcnLinkFlags; // Read by Pokemon Colosseum/XD /*0xA8*/ u32 gcnLinkFlags; // Read by Pokémon Colosseum/XD
/*0xAC*/ u32 encryptionKey; /*0xAC*/ u32 encryptionKey;
/*0xB0*/ struct PlayersApprentice playerApprentice; /*0xB0*/ struct PlayersApprentice playerApprentice;
/*0xDC*/ struct Apprentice apprentices[APPRENTICE_COUNT]; /*0xDC*/ struct Apprentice apprentices[APPRENTICE_COUNT];

View File

@ -32,7 +32,7 @@ extern const u32 gBallGfx_Premier[];
extern const u32 gBallPal_Premier[]; extern const u32 gBallPal_Premier[];
extern const u32 gOpenPokeballGfx[]; extern const u32 gOpenPokeballGfx[];
// pokemon gfx // Pokémon gfx
extern const u32 gMonFrontPic_Bulbasaur[]; extern const u32 gMonFrontPic_Bulbasaur[];
extern const u32 gMonPalette_Bulbasaur[]; extern const u32 gMonPalette_Bulbasaur[];
extern const u32 gMonBackPic_Bulbasaur[]; extern const u32 gMonBackPic_Bulbasaur[];
@ -881,13 +881,13 @@ extern const u32 gMonShinyPalette_Starmie[];
extern const u32 gMonStillFrontPic_Starmie[]; extern const u32 gMonStillFrontPic_Starmie[];
extern const u8 gMonIcon_Starmie[]; extern const u8 gMonIcon_Starmie[];
extern const u8 gMonFootprint_Starmie[]; extern const u8 gMonFootprint_Starmie[];
extern const u32 gMonFrontPic_Mrmime[]; extern const u32 gMonFrontPic_MrMime[];
extern const u32 gMonPalette_Mrmime[]; extern const u32 gMonPalette_MrMime[];
extern const u32 gMonBackPic_Mrmime[]; extern const u32 gMonBackPic_MrMime[];
extern const u32 gMonShinyPalette_Mrmime[]; extern const u32 gMonShinyPalette_MrMime[];
extern const u32 gMonStillFrontPic_Mrmime[]; extern const u32 gMonStillFrontPic_MrMime[];
extern const u8 gMonIcon_Mrmime[]; extern const u8 gMonIcon_MrMime[];
extern const u8 gMonFootprint_Mrmime[]; extern const u8 gMonFootprint_MrMime[];
extern const u32 gMonFrontPic_Scyther[]; extern const u32 gMonFrontPic_Scyther[];
extern const u32 gMonPalette_Scyther[]; extern const u32 gMonPalette_Scyther[];
extern const u32 gMonBackPic_Scyther[]; extern const u32 gMonBackPic_Scyther[];
@ -3282,7 +3282,7 @@ extern const u32 gBattleTerrainPalette_StadiumGlacia[];
extern const u32 gBattleTerrainPalette_StadiumDrake[]; extern const u32 gBattleTerrainPalette_StadiumDrake[];
extern const u32 gBattleTerrainPalette_StadiumWallace[]; extern const u32 gBattleTerrainPalette_StadiumWallace[];
// pokedex // Pokédex
extern const u32 gPokedexInterface_Gfx[]; extern const u32 gPokedexInterface_Gfx[];
extern const u16 gPokedexBgHoenn_Pal[]; extern const u16 gPokedexBgHoenn_Pal[];
extern const u32 gPokedexMenu_Gfx[]; extern const u32 gPokedexMenu_Gfx[];
@ -4005,7 +4005,7 @@ extern const u32 gBerryPalette_Starf[];
extern const u32 gBerryPic_Enigma[]; extern const u32 gBerryPic_Enigma[];
extern const u32 gBerryPalette_Enigma[]; extern const u32 gBerryPalette_Enigma[];
//pokenav //PokéNav
extern const u16 gPokenavCondition_Pal[]; extern const u16 gPokenavCondition_Pal[];
extern const u32 gPokenavCondition_Gfx[]; extern const u32 gPokenavCondition_Gfx[];
extern const u32 gPokenavCondition_Tilemap[]; extern const u32 gPokenavCondition_Tilemap[];
@ -4879,11 +4879,11 @@ extern const u16 gSlotMachineReelTimePikachu_Pal[];
extern const u32 gBattleAnimBgTilemap_Sandstorm[]; extern const u32 gBattleAnimBgTilemap_Sandstorm[];
extern const u32 gBattleAnimBgImage_Sandstorm[]; extern const u32 gBattleAnimBgImage_Sandstorm[];
// Pokedex Area Screen // Pokédex Area Screen
extern const u32 gPokedexAreaScreenAreaUnknown_Gfx[]; extern const u32 gPokedexAreaScreenAreaUnknown_Gfx[];
extern const u16 gPokedexAreaScreenAreaUnknown_Pal[]; extern const u16 gPokedexAreaScreenAreaUnknown_Pal[];
// Pokemon Storage System // Pokémon Storage System
extern const u32 gStorageSystemMenu_Gfx[]; extern const u32 gStorageSystemMenu_Gfx[];
extern const u16 gStorageSystemPartyMenu_Pal[]; extern const u16 gStorageSystemPartyMenu_Pal[];
extern const u32 gStorageSystemPartyMenu_Tilemap[]; extern const u32 gStorageSystemPartyMenu_Tilemap[];
@ -5011,7 +5011,7 @@ extern const u32 gBerryCrush_Crusher_Gfx[];
extern const u16 gBerryCrush_Crusher_Pal[]; extern const u16 gBerryCrush_Crusher_Pal[];
extern const u32 gBerryCrush_TextWindows_Tilemap[]; extern const u32 gBerryCrush_TextWindows_Tilemap[];
// Pokenav // PokéNav
extern const u32 gPokenavMessageBox_Gfx[]; extern const u32 gPokenavMessageBox_Gfx[];
extern const u32 gPokenavMessageBox_Tilemap[]; extern const u32 gPokenavMessageBox_Tilemap[];
extern const u16 gPokenavMessageBox_Pal[]; extern const u16 gPokenavMessageBox_Pal[];

View File

@ -203,7 +203,8 @@ struct BoxPokemon
u8 isBadEgg:1; u8 isBadEgg:1;
u8 hasSpecies:1; u8 hasSpecies:1;
u8 isEgg: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 otName[PLAYER_NAME_LENGTH];
u8 markings; u8 markings;
u16 checksum; u16 checksum;

View File

@ -14,7 +14,7 @@ void ShowPokemonSummaryScreenHandleDeoxys(u8 mode, struct BoxPokemon *mons, u8 m
u8 GetMoveSlotToReplace(void); u8 GetMoveSlotToReplace(void);
void SummaryScreen_SetAnimDelayTaskId(u8 taskId); 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. // such as move re-ordering, are available in the different modes.
enum PokemonSummaryScreenMode enum PokemonSummaryScreenMode
{ {

View File

@ -65,8 +65,8 @@ struct PokenavMonList
enum enum
{ {
POKENAV_MODE_NORMAL, // Chosen from Start menu. POKENAV_MODE_NORMAL, // Chosen from Start menu.
POKENAV_MODE_FORCE_CALL_READY, // Pokenav tutorial before calling Mr. Stone POKENAV_MODE_FORCE_CALL_READY, // PokéNav tutorial before calling Mr. Stone
POKENAV_MODE_FORCE_CALL_EXIT, // Pokenav tutorial after calling Mr. Stone POKENAV_MODE_FORCE_CALL_EXIT, // PokéNav tutorial after calling Mr. Stone
}; };
enum enum
@ -232,8 +232,8 @@ enum
[CHECK_PAGE_INTRO_2] = gText_MatchCall##name##_Intro2} [CHECK_PAGE_INTRO_2] = gText_MatchCall##name##_Intro2}
// Pokenav Function IDs // PokéNav Function IDs
// Indices into the LoopedTask tables for each of the main Pokenav features // Indices into the LoopedTask tables for each of the main PokéNav features
enum RegionMapFuncIds enum RegionMapFuncIds
{ {

View File

@ -9,6 +9,10 @@
#define SIIRTCINFO_24HOUR 0x40 // 0: 12-hour mode, 1: 24-hour mode #define SIIRTCINFO_24HOUR 0x40 // 0: 12-hour mode, 1: 24-hour mode
#define SIIRTCINFO_POWER 0x80 // power on or power failure occurred #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 enum
{ {
MONTH_JAN = 1, MONTH_JAN = 1,
@ -22,7 +26,8 @@ enum
MONTH_SEP, MONTH_SEP,
MONTH_OCT, MONTH_OCT,
MONTH_NOV, MONTH_NOV,
MONTH_DEC MONTH_DEC,
MONTH_COUNT = MONTH_DEC
}; };
struct SiiRtcInfo struct SiiRtcInfo

View File

@ -519,7 +519,7 @@ extern const u8 gText_Speed[];
extern const u8 gText_Dash[]; extern const u8 gText_Dash[];
extern const u8 gText_Plus[]; extern const u8 gText_Plus[];
//pokedex text //Pokédex text
extern const u8 gText_CryOf[]; extern const u8 gText_CryOf[];
extern const u8 gText_SizeComparedTo[]; extern const u8 gText_SizeComparedTo[];
extern const u8 gText_PokedexRegistration[]; 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_Seven2[];
extern const u8 gTrickHouse_Mechadoll_Eight2[]; extern const u8 gTrickHouse_Mechadoll_Eight2[];
// Pokedex strings // Pokédex strings
extern const u8 gText_SearchForPkmnBasedOnParameters[]; extern const u8 gText_SearchForPkmnBasedOnParameters[];
extern const u8 gText_SwitchPokedexListings[]; extern const u8 gText_SwitchPokedexListings[];
extern const u8 gText_ReturnToPokedex[]; extern const u8 gText_ReturnToPokedex[];
@ -2874,7 +2874,7 @@ extern const u8 gText_WantToPlayAgain[];
extern const u8 gText_CommunicationStandby3[]; extern const u8 gText_CommunicationStandby3[];
extern const u8 gText_SomeoneDroppedOut[]; extern const u8 gText_SomeoneDroppedOut[];
// Pokemon jump // Pokémon jump
extern const u8 gText_WantToPlayAgain2[]; extern const u8 gText_WantToPlayAgain2[];
extern const u8 gText_SomeoneDroppedOut2[]; extern const u8 gText_SomeoneDroppedOut2[];
extern const u8 gText_CommunicationStandby4[]; extern const u8 gText_CommunicationStandby4[];
@ -2949,7 +2949,7 @@ extern const u8 gText_CutenessContest[];
extern const u8 gText_SmartnessContest[]; extern const u8 gText_SmartnessContest[];
extern const u8 gText_ToughnessContest[]; extern const u8 gText_ToughnessContest[];
// Pokenav Match Call // PokéNav Match Call
extern const u8 gText_CallCantBeMadeHere[]; extern const u8 gText_CallCantBeMadeHere[];
extern const u8 gText_NumberRegistered[]; extern const u8 gText_NumberRegistered[];
extern const u8 gText_NumberOfBattles[]; extern const u8 gText_NumberOfBattles[];
@ -2959,7 +2959,7 @@ extern const u8 gText_Call[];
extern const u8 gText_Check[]; extern const u8 gText_Check[];
extern const u8 gText_Cancel6[]; extern const u8 gText_Cancel6[];
// Pokenav Menu Handler // PokéNav Menu Handler
extern const u8 gText_CheckMapOfHoenn[]; extern const u8 gText_CheckMapOfHoenn[];
extern const u8 gText_CheckPokemonInDetail[]; extern const u8 gText_CheckPokemonInDetail[];
extern const u8 gText_CallRegisteredTrainer[]; extern const u8 gText_CallRegisteredTrainer[];
@ -2976,7 +2976,7 @@ extern const u8 gText_FindToughPokemon[];
extern const u8 gText_ReturnToConditionMenu[]; extern const u8 gText_ReturnToConditionMenu[];
extern const u8 gText_NoRibbonWinners[]; extern const u8 gText_NoRibbonWinners[];
// Pokenav // PokéNav
extern const u8 gText_NumberIndex[]; extern const u8 gText_NumberIndex[];
extern const u8 gText_RibbonsF700[]; extern const u8 gText_RibbonsF700[];

View File

@ -3,19 +3,21 @@ ENTRY(Start)
gNumMusicPlayers = 4; gNumMusicPlayers = 4;
gMaxLines = 0; 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 /* 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. */ declarations below and their references further down to get rid of the gaps. */
SECTIONS { SECTIONS {
. = 0x2000000;
ewram (NOLOAD) : ewram 0x2000000 (NOLOAD) :
ALIGN(4) ALIGN(4)
{ {
gHeap = .;
. = 0x1C000;
INCLUDE "sym_ewram.ld" INCLUDE "sym_ewram.ld"
src/*.o(ewram_data); src/*.o(ewram_data);
gflib/*.o(ewram_data); gflib/*.o(ewram_data);
@ -23,12 +25,9 @@ SECTIONS {
*libc.a:impure.o(.data); *libc.a:impure.o(.data);
*libc.a:locale.o(.data); *libc.a:locale.o(.data);
*libc.a:mallocr.o(.data); *libc.a:mallocr.o(.data);
. = 0x40000; } > EWRAM
}
. = 0x3000000; iwram 0x3000000 (NOLOAD) :
iwram (NOLOAD) :
ALIGN(4) ALIGN(4)
{ {
/* .bss starts at 0x3000000 */ /* .bss starts at 0x3000000 */
@ -43,10 +42,9 @@ SECTIONS {
/* COMMON starts at 0x30022A8 */ /* COMMON starts at 0x30022A8 */
INCLUDE "sym_common.ld" INCLUDE "sym_common.ld"
*libc.a:sbrkr.o(COMMON); *libc.a:sbrkr.o(COMMON);
end = .; } > IWRAM
. = 0x8000;
}
/* BEGIN ROM DATA */
. = 0x8000000; . = 0x8000000;
.text : .text :
@ -341,7 +339,7 @@ SECTIONS {
src/gym_leader_rematch.o(.text); src/gym_leader_rematch.o(.text);
src/battle_transition_frontier.o(.text); src/battle_transition_frontier.o(.text);
src/international_string_util.o(.text); src/international_string_util.o(.text);
} =0 } > ROM =0
script_data : script_data :
ALIGN(4) ALIGN(4)
@ -354,7 +352,7 @@ SECTIONS {
data/battle_ai_scripts.o(script_data); data/battle_ai_scripts.o(script_data);
data/contest_ai_scripts.o(script_data); data/contest_ai_scripts.o(script_data);
data/mystery_event_script_cmd_table.o(script_data); data/mystery_event_script_cmd_table.o(script_data);
} =0 } > ROM =0
lib_text : lib_text :
ALIGN(4) ALIGN(4)
@ -438,7 +436,7 @@ SECTIONS {
*libc.a:libcfunc.o(.text); *libc.a:libcfunc.o(.text);
*libc.a:lseekr.o(.text); *libc.a:lseekr.o(.text);
*libc.a:readr.o(.text); *libc.a:readr.o(.text);
} =0 } > ROM =0
.rodata : .rodata :
ALIGN(4) ALIGN(4)
@ -704,7 +702,7 @@ SECTIONS {
data/mystery_gift.o(.rodata); data/mystery_gift.o(.rodata);
src/m4a_tables.o(.rodata); src/m4a_tables.o(.rodata);
data/sound_data.o(.rodata); data/sound_data.o(.rodata);
} =0 } > ROM =0
song_data : song_data :
ALIGN(4) ALIGN(4)
@ -1239,7 +1237,7 @@ SECTIONS {
sound/songs/midi/ph_nurse_blend.o(.rodata); sound/songs/midi/ph_nurse_blend.o(.rodata);
sound/songs/midi/ph_nurse_held.o(.rodata); sound/songs/midi/ph_nurse_held.o(.rodata);
sound/songs/midi/ph_nurse_solo.o(.rodata); sound/songs/midi/ph_nurse_solo.o(.rodata);
} =0 } > ROM =0
lib_rodata : lib_rodata :
SUBALIGN(4) SUBALIGN(4)
@ -1292,7 +1290,7 @@ SECTIONS {
*libc.a:lseekr.o(.rodata); *libc.a:lseekr.o(.rodata);
*libc.a:readr.o(.rodata); *libc.a:readr.o(.rodata);
src/libisagbprn.o(.rodata); src/libisagbprn.o(.rodata);
} =0 } > ROM =0
multiboot_data : multiboot_data :
ALIGN(4) ALIGN(4)
@ -1300,19 +1298,19 @@ SECTIONS {
data/multiboot_ereader.o(.rodata); data/multiboot_ereader.o(.rodata);
data/multiboot_berry_glitch_fix.o(.rodata); data/multiboot_berry_glitch_fix.o(.rodata);
data/multiboot_pokemon_colosseum.o(.rodata); data/multiboot_pokemon_colosseum.o(.rodata);
} =0 } > ROM =0
anim_mon_front_pic_data : anim_mon_front_pic_data :
ALIGN(4) ALIGN(4)
{ {
src/anim_mon_front_pics.o(.rodata); src/anim_mon_front_pics.o(.rodata);
} =0 } > ROM =0
gfx_data : gfx_data :
ALIGN(4) ALIGN(4)
{ {
src/graphics.o(.rodata); src/graphics.o(.rodata);
} =0 } > ROM =0
extra : extra :
ALIGN(4) ALIGN(4)
@ -1322,7 +1320,7 @@ SECTIONS {
src/*.o(.rodata); src/*.o(.rodata);
gflib/*.o(.rodata); gflib/*.o(.rodata);
data/*.o(.rodata); data/*.o(.rodata);
} = 0 } > ROM = 0
/* DWARF debug sections. /* DWARF debug sections.
Symbols in the DWARF debugging sections are relative to the beginning Symbols in the DWARF debugging sections are relative to the beginning

View File

@ -3,46 +3,40 @@ ENTRY(Start)
gNumMusicPlayers = 4; gNumMusicPlayers = 4;
gMaxLines = 0; gMaxLines = 0;
SECTIONS { MEMORY
. = 0x2000000;
ewram (NOLOAD) :
ALIGN(4)
{ {
gHeap = .; EWRAM (rwx) : ORIGIN = 0x2000000, LENGTH = 256K
IWRAM (rwx) : ORIGIN = 0x3000000, LENGTH = 32K
. = 0x1C000; ROM (rx) : ORIGIN = 0x8000000, LENGTH = 32M
src/*.o(ewram_data);
gflib/*.o(ewram_data);
. = 0x40000;
} }
. = 0x3000000; SECTIONS {
iwram (NOLOAD) : ewram 0x2000000 (NOLOAD) :
ALIGN(4)
{
src/*.o(ewram_data);
gflib/*.o(ewram_data);
} > EWRAM
iwram 0x3000000 (NOLOAD) :
ALIGN(4) ALIGN(4)
{ {
/* .bss starts at 0x3000000 */
src/*.o(.bss); src/*.o(.bss);
gflib/*.o(.bss); gflib/*.o(.bss);
data/*.o(.bss); data/*.o(.bss);
*libc.a:*.o(.bss*); *libc.a:*.o(.bss*);
*libnosys.a:*.o(.bss*); *libnosys.a:*.o(.bss*);
/* .bss.code starts at 0x3001AA8 */
src/m4a.o(.bss.code); src/m4a.o(.bss.code);
/* COMMON starts at 0x30022A8 */
src/*.o(COMMON); src/*.o(COMMON);
gflib/*.o(COMMON); gflib/*.o(COMMON);
*libc.a:*.o(COMMON); *libc.a:*.o(COMMON);
*libnosys.a:*.o(COMMON); *libnosys.a:*.o(COMMON);
end = .; } > IWRAM
. = 0x8000;
}
/* BEGIN ROM DATA */
. = 0x8000000; . = 0x8000000;
.text : .text :
@ -55,13 +49,13 @@ SECTIONS {
gflib/*.o(.text*); gflib/*.o(.text*);
src/*.o(.text*); src/*.o(.text*);
asm/*.o(.text*); asm/*.o(.text*);
} =0 } > ROM =0
script_data : script_data :
ALIGN(4) ALIGN(4)
{ {
data/*.o(script_data); data/*.o(script_data);
} =0 } > ROM =0
lib_text : lib_text :
ALIGN(4) ALIGN(4)
@ -82,7 +76,7 @@ SECTIONS {
*libc.a:*.o(.text*); *libc.a:*.o(.text*);
*libnosys.a:*.o(.text*); *libnosys.a:*.o(.text*);
src/libisagbprn.o(.text); src/libisagbprn.o(.text);
} =0 } > ROM =0
.rodata : .rodata :
ALIGN(4) ALIGN(4)
@ -90,13 +84,13 @@ SECTIONS {
src/*.o(.rodata*); src/*.o(.rodata*);
gflib/*.o(.rodata*); gflib/*.o(.rodata*);
data/*.o(.rodata*); data/*.o(.rodata*);
} =0 } > ROM =0
song_data : song_data :
ALIGN(4) ALIGN(4)
{ {
sound/songs/*.o(.rodata); sound/songs/*.o(.rodata);
} =0 } > ROM =0
lib_rodata : lib_rodata :
SUBALIGN(4) SUBALIGN(4)
@ -121,19 +115,19 @@ SECTIONS {
data/multiboot_ereader.o(.rodata); data/multiboot_ereader.o(.rodata);
data/multiboot_berry_glitch_fix.o(.rodata); data/multiboot_berry_glitch_fix.o(.rodata);
data/multiboot_pokemon_colosseum.o(.rodata); data/multiboot_pokemon_colosseum.o(.rodata);
} =0 } > ROM =0
anim_mon_front_pic_data : anim_mon_front_pic_data :
ALIGN(4) ALIGN(4)
{ {
src/anim_mon_front_pics.o(.rodata); src/anim_mon_front_pics.o(.rodata);
} =0 } > ROM =0
gfx_data : gfx_data :
ALIGN(4) ALIGN(4)
{ {
src/graphics.o(.rodata); src/graphics.o(.rodata);
} =0 } > ROM =0
/* DWARF debug sections. /* DWARF debug sections.
Symbols in the DWARF debugging sections are relative to the beginning Symbols in the DWARF debugging sections are relative to the beginning

View File

@ -229,7 +229,7 @@ u8 rfu_LMAN_CHILD_connectParent(u16 parentId, u16 connect_period)
return 0; return 0;
} }
static void rfu_LMAN_PARENT_stopWaitLinkRecoveryAndDisconnect(u8 bm_targetSlot) static void UNUSED rfu_LMAN_PARENT_stopWaitLinkRecoveryAndDisconnect(u8 bm_targetSlot)
{ {
u8 i; u8 i;
@ -1295,7 +1295,7 @@ void rfu_LMAN_setMSCCallback(void (*MSC_callback_p)(u16))
rfu_setMSCCallback(rfu_LMAN_MSC_callback); 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; lman.LMAN_callback = func;
} }
@ -1315,7 +1315,7 @@ u8 rfu_LMAN_setLinkRecovery(u8 enable_flag, u16 recovery_period)
return 0; 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) if (gRfuLinkStatus->sendSlotNIFlag | gRfuLinkStatus->recvSlotNIFlag)
{ {
@ -1327,7 +1327,7 @@ static u8 rfu_LMAN_setNIFailCounterLimit(u16 NI_failCounter_limit)
return 0; 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) if (lman.state == LMAN_STATE_START_SEARCH_PARENT || lman.state == LMAN_STATE_POLL_SEARCH_PARENT || lman.state == LMAN_STATE_END_SEARCH_PARENT)
{ {

View File

@ -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_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_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_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_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_Jynx[] = INCBIN_U32("graphics/pokemon/jynx/anim_front.4bpp.lz");
const u32 gMonFrontPic_Electabuzz[] = INCBIN_U32("graphics/pokemon/electabuzz/anim_front.4bpp.lz"); const u32 gMonFrontPic_Electabuzz[] = INCBIN_U32("graphics/pokemon/electabuzz/anim_front.4bpp.lz");

View File

@ -623,6 +623,9 @@ static void CreateApprenticeMenu(u8 menu)
default: default:
left = 0; left = 0;
top = 0; top = 0;
#ifdef UBFIX
return;
#endif
break; break;
} }
@ -1278,8 +1281,7 @@ const u8 *GetApprenticeNameInLanguage(u32 apprenticeId, s32 language)
} }
} }
// Functionally unused static void UNUSED Task_SwitchToFollowupFuncAfterButtonPress(u8 taskId)
static void Task_SwitchToFollowupFuncAfterButtonPress(u8 taskId)
{ {
if (JOY_NEW(A_BUTTON) || JOY_NEW(B_BUTTON)) if (JOY_NEW(A_BUTTON) || JOY_NEW(B_BUTTON))
SwitchTaskToFollowupFunc(taskId); SwitchTaskToFollowupFunc(taskId);
@ -1302,8 +1304,7 @@ static void ExecuteFuncAfterButtonPress(void (*func)(void))
gTasks[taskId].data[1] = (u32)(func) >> 16; gTasks[taskId].data[1] = (u32)(func) >> 16;
} }
// Unused static void UNUSED ExecuteFollowupFuncAfterButtonPress(TaskFunc task)
static void ExecuteFollowupFuncAfterButtonPress(TaskFunc task)
{ {
u8 taskId = CreateTask(Task_SwitchToFollowupFuncAfterButtonPress, 1); u8 taskId = CreateTask(Task_SwitchToFollowupFuncAfterButtonPress, 1);
SetTaskFuncWithFollowupFunc(taskId, Task_SwitchToFollowupFuncAfterButtonPress, task); SetTaskFuncWithFollowupFunc(taskId, Task_SwitchToFollowupFuncAfterButtonPress, task);

View File

@ -1392,7 +1392,7 @@ static void Cmd_get_ability(void)
} }
else 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 else
@ -1445,7 +1445,7 @@ static void Cmd_check_ability(void)
} }
else 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 else
@ -1457,9 +1457,9 @@ static void Cmd_check_ability(void)
if (ability == 0) if (ability == 0)
AI_THINKING_STRUCT->funcResult = 2; // Unable to answer. AI_THINKING_STRUCT->funcResult = 2; // Unable to answer.
else if (ability == gAIScriptPtr[2]) 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 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; gAIScriptPtr += 3;
} }
@ -1484,7 +1484,13 @@ static void Cmd_get_highest_type_effectiveness(void)
if (gCurrentMove != MOVE_NONE) 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); TypeCalc(gCurrentMove, sBattler_AI, gBattlerTarget);
#endif
if (gBattleMoveDamage == 120) // Super effective STAB. if (gBattleMoveDamage == 120) // Super effective STAB.
gBattleMoveDamage = AI_EFFECTIVENESS_x2; gBattleMoveDamage = AI_EFFECTIVENESS_x2;
@ -1519,7 +1525,16 @@ static void Cmd_if_type_effectiveness(void)
gBattleMoveDamage = AI_EFFECTIVENESS_x1; gBattleMoveDamage = AI_EFFECTIVENESS_x1;
gCurrentMove = AI_THINKING_STRUCT->moveConsidered; 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); TypeCalc(gCurrentMove, sBattler_AI, gBattlerTarget);
#endif
if (gBattleMoveDamage == 120) // Super effective STAB. if (gBattleMoveDamage == 120) // Super effective STAB.
gBattleMoveDamage = AI_EFFECTIVENESS_x2; gBattleMoveDamage = AI_EFFECTIVENESS_x2;
@ -2252,7 +2267,7 @@ static void AIStackPushVar(const u8 *var)
gBattleResources->AI_ScriptsStack->ptr[gBattleResources->AI_ScriptsStack->size++] = 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; gBattleResources->AI_ScriptsStack->ptr[gBattleResources->AI_ScriptsStack->size++] = gAIScriptPtr;
} }

View File

@ -51,7 +51,7 @@ static bool8 ShouldSwitchIfWonderGuard(void)
if (gBattleMons[GetBattlerAtPosition(opposingPosition)].ability != ABILITY_WONDER_GUARD) if (gBattleMons[GetBattlerAtPosition(opposingPosition)].ability != ABILITY_WONDER_GUARD)
return FALSE; 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++) for (opposingBattler = GetBattlerAtPosition(opposingPosition), i = 0; i < MAX_MON_MOVES; i++)
{ {
move = gBattleMons[gActiveBattler].moves[i]; move = gBattleMons[gActiveBattler].moves[i];
@ -81,7 +81,7 @@ static bool8 ShouldSwitchIfWonderGuard(void)
else else
party = gEnemyParty; 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++) for (i = firstId; i < lastId; i++)
{ {
if (GetMonData(&party[i], MON_DATA_HP) == 0) 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) static bool8 FindMonThatAbsorbsOpponentsMove(void)

View File

@ -443,7 +443,7 @@ static void AnimMissileArc_Step(struct Sprite *sprite)
else else
{ {
s16 tempData[8]; s16 tempData[8];
u16 *data = sprite->data; s16 *data = sprite->data;
u16 x1 = sprite->x; u16 x1 = sprite->x;
s16 x2 = sprite->x2; s16 x2 = sprite->x2;
u16 y1 = sprite->y; u16 y1 = sprite->y;

View File

@ -2765,7 +2765,7 @@ static void AnimConstrictBinding(struct Sprite *sprite)
static void AnimConstrictBinding_Step1(struct Sprite *sprite) static void AnimConstrictBinding_Step1(struct Sprite *sprite)
{ {
u8 spriteId; u8 UNUSED spriteId;
if ((u16)gBattleAnimArgs[7] == 0xFFFF) if ((u16)gBattleAnimArgs[7] == 0xFFFF)
{ {
@ -2778,7 +2778,7 @@ static void AnimConstrictBinding_Step1(struct Sprite *sprite)
static void AnimConstrictBinding_Step2(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]) if (!sprite->data[2])
sprite->data[0] += 11; sprite->data[0] += 11;
else 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) if (sprite->data[2] > 1)
{ {
@ -4734,7 +4734,7 @@ static void AnimFalseSwipeSlice(struct Sprite *sprite)
static void AnimFalseSwipePositionedSlice(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); sprite->y = GetBattlerSpriteCoord(gBattleAnimTarget, BATTLER_COORD_Y_PIC_OFFSET);
StartSpriteAnim(sprite, 1); StartSpriteAnim(sprite, 1);
sprite->data[0] = 0; sprite->data[0] = 0;
@ -4917,8 +4917,7 @@ void AnimTask_Conversion2AlphaBlend(u8 taskId)
} }
} }
// Unused static void UNUSED AnimTask_HideBattlersHealthbox(u8 taskId)
static void AnimTask_HideBattlersHealthbox(u8 taskId)
{ {
u8 i; u8 i;
for (i = 0; i < gBattlersCount; i++) for (i = 0; i < gBattlersCount; i++)
@ -4933,8 +4932,7 @@ static void AnimTask_HideBattlersHealthbox(u8 taskId)
DestroyAnimVisualTask(taskId); DestroyAnimVisualTask(taskId);
} }
// Unused static void UNUSED AnimTask_ShowBattlersHealthbox(u8 taskId)
static void AnimTask_ShowBattlersHealthbox(u8 taskId)
{ {
u8 i; u8 i;
for (i = 0; i < gBattlersCount; i++) for (i = 0; i < gBattlersCount; i++)

View File

@ -2551,8 +2551,8 @@ static void AnimPencil_Step(struct Sprite *sprite)
static void AnimBlendThinRing(struct Sprite *sprite) static void AnimBlendThinRing(struct Sprite *sprite)
{ {
u8 battler = 0; u8 battler = 0;
u16 sp0 = 0; s16 x = 0;
u16 sp1 = 0; s16 y = 0;
u8 r4; u8 r4;
if (gBattleAnimArgs[2] == 0) if (gBattleAnimArgs[2] == 0)
@ -2563,16 +2563,16 @@ static void AnimBlendThinRing(struct Sprite *sprite)
r4 = gBattleAnimArgs[3] ^ 1; r4 = gBattleAnimArgs[3] ^ 1;
if (IsDoubleBattle() && IsBattlerSpriteVisible(BATTLE_PARTNER(battler))) if (IsDoubleBattle() && IsBattlerSpriteVisible(BATTLE_PARTNER(battler)))
{ {
SetAverageBattlerPositions(battler, r4, &sp0, &sp1); SetAverageBattlerPositions(battler, r4, &x, &y);
if (r4 == 0) if (r4 == 0)
r4 = GetBattlerSpriteCoord(battler, BATTLER_COORD_X); r4 = GetBattlerSpriteCoord(battler, BATTLER_COORD_X);
else else
r4 = GetBattlerSpriteCoord(battler, BATTLER_COORD_X_2); r4 = GetBattlerSpriteCoord(battler, BATTLER_COORD_X_2);
if (GetBattlerSide(battler) != B_SIDE_PLAYER) 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 else
gBattleAnimArgs[0] = sp0 - r4; gBattleAnimArgs[0] = x - r4;
} }
sprite->callback = AnimSpriteOnMonPos; sprite->callback = AnimSpriteOnMonPos;

View File

@ -1428,8 +1428,7 @@ static void FadeScreenToWhite_Step(u8 taskId)
static void AnimSpikes(struct Sprite *sprite) static void AnimSpikes(struct Sprite *sprite)
{ {
u16 x; s16 x, y;
u16 y;
InitSpritePosToAnimAttacker(sprite, TRUE); InitSpritePosToAnimAttacker(sprite, TRUE);
SetAverageBattlerPositions(gBattleAnimTarget, FALSE, &x, &y); SetAverageBattlerPositions(gBattleAnimTarget, FALSE, &x, &y);
@ -4758,8 +4757,8 @@ static void AnimMeteorMashStar_Step(struct Sprite *sprite)
// arg 4: duration // arg 4: duration
static void AnimMeteorMashStar(struct Sprite *sprite) static void AnimMeteorMashStar(struct Sprite *sprite)
{ {
s16 y = GetBattlerSpriteCoord(gBattleAnimTarget, BATTLER_COORD_X_2); // unused local variable s16 UNUSED y = GetBattlerSpriteCoord(gBattleAnimTarget, BATTLER_COORD_X_2);
s16 x = GetBattlerSpriteCoord(gBattleAnimTarget, BATTLER_COORD_Y_PIC_OFFSET); // unused local variable s16 UNUSED x = GetBattlerSpriteCoord(gBattleAnimTarget, BATTLER_COORD_Y_PIC_OFFSET);
if (GetBattlerSide(gBattleAnimTarget) == B_SIDE_PLAYER || IsContest()) if (GetBattlerSide(gBattleAnimTarget) == B_SIDE_PLAYER || IsContest())
{ {

View File

@ -1220,8 +1220,7 @@ void AnimSkyAttackBird_Step(struct Sprite *sprite)
DestroySpriteAndMatrix(sprite); DestroySpriteAndMatrix(sprite);
} }
// Unused static void UNUSED AnimTask_SetAttackerVisibility(u8 taskId)
static void AnimTask_SetAttackerVisibility(u8 taskId)
{ {
if (gBattleAnimArgs[0] == 0) if (gBattleAnimArgs[0] == 0)
{ {

View File

@ -535,7 +535,7 @@ static void SlideMonToOriginalPos_Step(struct Sprite *sprite)
} }
// Linearly translates a mon to a target offset. The horizontal offset // 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. // is only mirrored if arg 3 is set to 1.
// arg 0: 0 = attacker, 1 = target // arg 0: 0 = attacker, 1 = target
// arg 1: target x pixel offset // arg 1: target x pixel offset

View File

@ -77,7 +77,7 @@ static const u8 sCastformBackSpriteYCoords[NUM_CASTFORM_FORMS] =
[CASTFORM_ICE] = 0, [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_1 55125
#define TAG_MOVE_EFFECT_MON_2 55126 #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. // 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) if (sprite->sDuration)
{ {
@ -639,8 +638,7 @@ static void TranslateSpriteLinearFixedPointIconFrame(struct Sprite *sprite)
UpdateMonIconFrame(sprite); UpdateMonIconFrame(sprite);
} }
// Unused static void UNUSED TranslateSpriteToBattleTargetPos(struct Sprite *sprite)
static void TranslateSpriteToBattleTargetPos(struct Sprite *sprite)
{ {
sprite->sStartX = sprite->x + sprite->x2; sprite->sStartX = sprite->x + sprite->x2;
sprite->sStartY = sprite->y + sprite->y2; sprite->sStartY = sprite->y + sprite->y2;
@ -707,8 +705,7 @@ void DestroySpriteAndMatrix(struct Sprite *sprite)
DestroyAnimSprite(sprite); DestroyAnimSprite(sprite);
} }
// Unused static void UNUSED TranslateSpriteToBattleAttackerPos(struct Sprite *sprite)
static void TranslateSpriteToBattleAttackerPos(struct Sprite *sprite)
{ {
sprite->sStartX = sprite->x + sprite->x2; sprite->sStartX = sprite->x + sprite->x2;
sprite->sStartY = sprite->y + sprite->y2; sprite->sStartY = sprite->y + sprite->y2;
@ -723,8 +720,7 @@ static void TranslateSpriteToBattleAttackerPos(struct Sprite *sprite)
#undef sStartY #undef sStartY
#undef sTargetY #undef sTargetY
// Unused static void UNUSED EndUnkPaletteAnim(struct Sprite *sprite)
static void EndUnkPaletteAnim(struct Sprite *sprite)
{ {
PaletteStruct_ResetById(sprite->data[5]); PaletteStruct_ResetById(sprite->data[5]);
DestroySpriteAndMatrix(sprite); DestroySpriteAndMatrix(sprite);
@ -1103,8 +1099,7 @@ void StartAnimLinearTranslation(struct Sprite *sprite)
sprite->callback(sprite); sprite->callback(sprite);
} }
// Unused static void UNUSED StartAnimLinearTranslation_SetCornerVecX(struct Sprite *sprite)
static void StartAnimLinearTranslation_SetCornerVecX(struct Sprite *sprite)
{ {
sprite->data[1] = sprite->x; sprite->data[1] = sprite->x;
sprite->data[3] = sprite->y; sprite->data[3] = sprite->y;
@ -1512,8 +1507,7 @@ u8 GetSpritePalIdxByBattler(u8 battler)
return battler; return battler;
} }
// Unused static u8 UNUSED GetSpritePalIdxByPosition(u8 position)
static u8 GetSpritePalIdxByPosition(u8 position)
{ {
return GetBattlerAtPosition(position); return GetBattlerAtPosition(position);
} }
@ -2012,8 +2006,7 @@ void AnimTask_GetFrustrationPowerLevel(u8 taskId)
DestroyAnimVisualTask(taskId); DestroyAnimVisualTask(taskId);
} }
// Unused static void UNUSED SetPriorityForVisibleBattlers(u8 priority)
static void SetPriorityForVisibleBattlers(u8 priority)
{ {
if (IsBattlerSpriteVisible(gBattleAnimTarget)) if (IsBattlerSpriteVisible(gBattleAnimTarget))
gSprites[gBattlerSpriteIds[gBattleAnimTarget]].oam.priority = priority; gSprites[gBattlerSpriteIds[gBattleAnimTarget]].oam.priority = priority;
@ -2092,7 +2085,7 @@ u8 GetBattlerSpriteBGPriorityRank(u8 battlerId)
return 1; 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 CreateAdditionalMonSpriteForMoveAnim(u16 species, bool8 isBackpic, u8 id, s16 x, s16 y, u8 subpriority, u32 personality, u32 trainerId, u32 battlerId, bool32 ignoreDeoxysForm)
{ {
u8 spriteId; u8 spriteId;

View File

@ -270,8 +270,7 @@ static const struct SpriteTemplate sFlashingCircleImpactSpriteTemplate =
.callback = AnimFlashingCircleImpact, .callback = AnimFlashingCircleImpact,
}; };
// Unused static u8 UNUSED Task_FlashingCircleImpacts(u8 battlerId, bool8 red)
static u8 Task_FlashingCircleImpacts(u8 battlerId, bool8 red)
{ {
u8 battlerSpriteId = gBattlerSpriteIds[battlerId]; u8 battlerSpriteId = gBattlerSpriteIds[battlerId];
u8 taskId = CreateTask(Task_UpdateFlashingCircleImpacts, 10); u8 taskId = CreateTask(Task_UpdateFlashingCircleImpacts, 10);

View File

@ -2386,11 +2386,11 @@ static void SpriteCB_ShinyStars_Diagonal(struct Sprite *sprite)
void AnimTask_LoadPokeblockGfx(u8 taskId) void AnimTask_LoadPokeblockGfx(u8 taskId)
{ {
u8 paletteIndex; u8 UNUSED paletteIndex;
LoadCompressedSpriteSheetUsingHeap(&gBattleAnimPicTable[ANIM_TAG_POKEBLOCK - ANIM_SPRITES_START]); LoadCompressedSpriteSheetUsingHeap(&gBattleAnimPicTable[ANIM_TAG_POKEBLOCK - ANIM_SPRITES_START]);
LoadCompressedSpritePaletteUsingHeap(&gBattleAnimPaletteTable[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); DestroyAnimVisualTask(taskId);
} }

View File

@ -69,6 +69,9 @@ void AnimTask_BlendBattleAnimPalExclude(u8 taskId)
selectedPalettes = 0; selectedPalettes = 0;
// fall through // fall through
case ANIM_ATTACKER: case ANIM_ATTACKER:
#ifdef UBFIX
default:
#endif
animBattlers[0] = gBattleAnimAttacker; animBattlers[0] = gBattleAnimAttacker;
break; break;
case 3: case 3:
@ -806,7 +809,7 @@ void AnimTask_SetAllNonAttackersInvisiblity(u8 taskId)
DestroyAnimVisualTask(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; u16 species;
u8 spriteId, spriteId2; u8 spriteId, spriteId2;

View File

@ -651,8 +651,7 @@ void BattleArena_DeductSkillPoints(u8 battler, u16 stringId)
} }
} }
// Unused static void UNUSED UpdateHPAtStart(u8 battler)
static void UpdateHPAtStart(u8 battler)
{ {
u16 *hpAtStart = gBattleStruct->arenaStartHp; u16 *hpAtStart = gBattleStruct->arenaStartHp;

View File

@ -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; u8 spriteId;
@ -704,7 +704,7 @@ static void UnusedBattleInit(void)
SetMainCallback2(CB2_UnusedBattleInit); SetMainCallback2(CB2_UnusedBattleInit);
} }
static void CB2_UnusedBattleInit(void) static void UNUSED CB2_UnusedBattleInit(void)
{ {
AnimateSprites(); AnimateSprites();
BuildOamBuffer(); BuildOamBuffer();

View File

@ -529,7 +529,7 @@ static void LinkOpponentBufferExecCompleted(void)
static void LinkOpponentHandleGetMonData(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; u32 size = 0;
u8 monToCheck; u8 monToCheck;
s32 i; s32 i;

View File

@ -423,7 +423,7 @@ static void CompleteOnFinishedBattleAnimation(void)
static void LinkPartnerHandleGetMonData(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; u32 size = 0;
u8 monToCheck; u8 monToCheck;
s32 i; s32 i;

View File

@ -534,7 +534,7 @@ static void OpponentBufferExecCompleted(void)
static void OpponentHandleGetMonData(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; u32 size = 0;
u8 monToCheck; u8 monToCheck;
s32 i; s32 i;

View File

@ -330,7 +330,7 @@ static void HandleInputChooseAction(void)
} }
} }
static void UnusedEndBounceEffect(void) static void UNUSED UnusedEndBounceEffect(void)
{ {
EndBounceEffect(gActiveBattler, BOUNCE_HEALTHBOX); EndBounceEffect(gActiveBattler, BOUNCE_HEALTHBOX);
EndBounceEffect(gActiveBattler, BOUNCE_MON); EndBounceEffect(gActiveBattler, BOUNCE_MON);
@ -615,7 +615,7 @@ static void HandleInputChooseMove(void)
} }
} }
static u32 HandleMoveInputUnused(void) static u32 UNUSED HandleMoveInputUnused(void)
{ {
u32 var = 0; u32 var = 0;
@ -982,12 +982,12 @@ static void Intro_TryShinyAnimShowHealthbox(void)
bool32 bgmRestored = FALSE; bool32 bgmRestored = FALSE;
bool32 battlerAnimsDone = 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 if (!gBattleSpritesDataPtr->healthBoxesData[gActiveBattler].triedShinyMonAnim
&& !gBattleSpritesDataPtr->healthBoxesData[gActiveBattler].ballAnimActive) && !gBattleSpritesDataPtr->healthBoxesData[gActiveBattler].ballAnimActive)
TryShinyAnimation(gActiveBattler, &gPlayerParty[gBattlerPartyIndexes[gActiveBattler]]); 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 if (!gBattleSpritesDataPtr->healthBoxesData[BATTLE_PARTNER(gActiveBattler)].triedShinyMonAnim
&& !gBattleSpritesDataPtr->healthBoxesData[BATTLE_PARTNER(gActiveBattler)].ballAnimActive) && !gBattleSpritesDataPtr->healthBoxesData[BATTLE_PARTNER(gActiveBattler)].ballAnimActive)
TryShinyAnimation(BATTLE_PARTNER(gActiveBattler), &gPlayerParty[gBattlerPartyIndexes[BATTLE_PARTNER(gActiveBattler)]]); TryShinyAnimation(BATTLE_PARTNER(gActiveBattler), &gPlayerParty[gBattlerPartyIndexes[BATTLE_PARTNER(gActiveBattler)]]);
@ -1582,7 +1582,7 @@ static void PrintLinkStandbyMsg(void)
static void PlayerHandleGetMonData(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; u32 size = 0;
u8 monToCheck; u8 monToCheck;
s32 i; s32 i;

View File

@ -607,7 +607,7 @@ static void CompleteOnFinishedBattleAnimation(void)
static void PlayerPartnerHandleGetMonData(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; u32 size = 0;
u8 monToCheck; u8 monToCheck;
s32 i; s32 i;

View File

@ -186,7 +186,7 @@ static void CompleteOnBattlerSpriteCallbackDummy(void)
RecordedOpponentBufferExecCompleted(); RecordedOpponentBufferExecCompleted();
} }
static void CompleteOnBankSpriteCallbackDummy2(void) static void UNUSED CompleteOnBankSpriteCallbackDummy2(void)
{ {
if (gSprites[gBattlerSpriteIds[gActiveBattler]].callback == SpriteCallbackDummy) if (gSprites[gBattlerSpriteIds[gActiveBattler]].callback == SpriteCallbackDummy)
RecordedOpponentBufferExecCompleted(); RecordedOpponentBufferExecCompleted();
@ -515,7 +515,7 @@ static void RecordedOpponentBufferExecCompleted(void)
static void RecordedOpponentHandleGetMonData(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; u32 size = 0;
u8 monToCheck; u8 monToCheck;
s32 i; s32 i;

View File

@ -498,7 +498,7 @@ static void CompleteOnFinishedBattleAnimation(void)
static void RecordedPlayerHandleGetMonData(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; u32 size = 0;
u8 monToCheck; u8 monToCheck;
s32 i; s32 i;

View File

@ -147,7 +147,7 @@ static void (*const sSafariBufferCommands[CONTROLLER_CMDS_COUNT])(void) =
[CONTROLLER_TERMINATOR_NOP] = SafariCmdEnd [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) if (!gBattleSpritesDataPtr->healthBoxesData[gActiveBattler].statusAnimActive)
SafariBufferExecCompleted(); SafariBufferExecCompleted();

View File

@ -161,7 +161,7 @@ static void (*const sWallyBufferCommands[CONTROLLER_CMDS_COUNT])(void) =
[CONTROLLER_TERMINATOR_NOP] = WallyCmdEnd [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) if (!gBattleSpritesDataPtr->healthBoxesData[gActiveBattler].statusAnimActive)
WallyBufferExecCompleted(); WallyBufferExecCompleted();
@ -425,7 +425,7 @@ static void CompleteOnFinishedStatusAnimation(void)
static void WallyHandleGetMonData(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; u32 size = 0;
u8 monToCheck; u8 monToCheck;
s32 i; s32 i;

View File

@ -905,8 +905,7 @@ void BtlController_EmitGetMonData(u8 bufferId, u8 requestId, u8 monToCheck)
PrepareBufferDataTransfer(bufferId, sBattleBuffersTransferData, 4); PrepareBufferDataTransfer(bufferId, sBattleBuffersTransferData, 4);
} }
// Unused static void UNUSED BtlController_EmitGetRawMonData(u8 bufferId, u8 monId, u8 bytes)
static void BtlController_EmitGetRawMonData(u8 bufferId, u8 monId, u8 bytes)
{ {
sBattleBuffersTransferData[0] = CONTROLLER_GETRAWMONDATA; sBattleBuffersTransferData[0] = CONTROLLER_GETRAWMONDATA;
sBattleBuffersTransferData[1] = monId; sBattleBuffersTransferData[1] = monId;
@ -927,8 +926,7 @@ void BtlController_EmitSetMonData(u8 bufferId, u8 requestId, u8 monToCheck, u8 b
PrepareBufferDataTransfer(bufferId, sBattleBuffersTransferData, 3 + bytes); PrepareBufferDataTransfer(bufferId, sBattleBuffersTransferData, 3 + bytes);
} }
// Unused static void UNUSED BtlController_EmitSetRawMonData(u8 bufferId, u8 monId, u8 bytes, void *data)
static void BtlController_EmitSetRawMonData(u8 bufferId, u8 monId, u8 bytes, void *data)
{ {
s32 i; s32 i;
@ -1001,8 +999,7 @@ void BtlController_EmitFaintAnimation(u8 bufferId)
PrepareBufferDataTransfer(bufferId, sBattleBuffersTransferData, 4); PrepareBufferDataTransfer(bufferId, sBattleBuffersTransferData, 4);
} }
// Unused static void UNUSED BtlController_EmitPaletteFade(u8 bufferId)
static void BtlController_EmitPaletteFade(u8 bufferId)
{ {
sBattleBuffersTransferData[0] = CONTROLLER_PALETTEFADE; sBattleBuffersTransferData[0] = CONTROLLER_PALETTEFADE;
sBattleBuffersTransferData[1] = CONTROLLER_PALETTEFADE; sBattleBuffersTransferData[1] = CONTROLLER_PALETTEFADE;
@ -1011,8 +1008,7 @@ static void BtlController_EmitPaletteFade(u8 bufferId)
PrepareBufferDataTransfer(bufferId, sBattleBuffersTransferData, 4); PrepareBufferDataTransfer(bufferId, sBattleBuffersTransferData, 4);
} }
// Unused static void UNUSED BtlController_EmitSuccessBallThrowAnim(u8 bufferId)
static void BtlController_EmitSuccessBallThrowAnim(u8 bufferId)
{ {
sBattleBuffersTransferData[0] = CONTROLLER_SUCCESSBALLTHROWANIM; sBattleBuffersTransferData[0] = CONTROLLER_SUCCESSBALLTHROWANIM;
sBattleBuffersTransferData[1] = CONTROLLER_SUCCESSBALLTHROWANIM; sBattleBuffersTransferData[1] = CONTROLLER_SUCCESSBALLTHROWANIM;
@ -1028,8 +1024,7 @@ void BtlController_EmitBallThrowAnim(u8 bufferId, u8 caseId)
PrepareBufferDataTransfer(bufferId, sBattleBuffersTransferData, 2); PrepareBufferDataTransfer(bufferId, sBattleBuffersTransferData, 2);
} }
// Unused static void UNUSED BtlController_EmitPause(u8 bufferId, u8 toWait, void *data)
static void BtlController_EmitPause(u8 bufferId, u8 toWait, void *data)
{ {
s32 i; 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. PrepareBufferDataTransfer(bufferId, sBattleBuffersTransferData, 8); // Only 7 bytes were written.
} }
// Unused static void UNUSED BtlController_EmitCmd23(u8 bufferId)
static void BtlController_EmitCmd23(u8 bufferId)
{ {
sBattleBuffersTransferData[0] = CONTROLLER_23; sBattleBuffersTransferData[0] = CONTROLLER_23;
sBattleBuffersTransferData[1] = CONTROLLER_23; sBattleBuffersTransferData[1] = CONTROLLER_23;
@ -1243,8 +1237,7 @@ void BtlController_EmitStatusAnimation(u8 bufferId, bool8 status2, u32 status)
PrepareBufferDataTransfer(bufferId, sBattleBuffersTransferData, 6); PrepareBufferDataTransfer(bufferId, sBattleBuffersTransferData, 6);
} }
// Unused static void UNUSED BtlController_EmitStatusXor(u8 bufferId, u8 b)
static void BtlController_EmitStatusXor(u8 bufferId, u8 b)
{ {
sBattleBuffersTransferData[0] = CONTROLLER_STATUSXOR; sBattleBuffersTransferData[0] = CONTROLLER_STATUSXOR;
sBattleBuffersTransferData[1] = b; sBattleBuffersTransferData[1] = b;
@ -1264,8 +1257,7 @@ void BtlController_EmitDataTransfer(u8 bufferId, u16 size, void *data)
PrepareBufferDataTransfer(bufferId, sBattleBuffersTransferData, size + 4); PrepareBufferDataTransfer(bufferId, sBattleBuffersTransferData, size + 4);
} }
// Unused static void UNUSED BtlController_EmitDMA3Transfer(u8 bufferId, void *dst, u16 size, void *data)
static void BtlController_EmitDMA3Transfer(u8 bufferId, void *dst, u16 size, void *data)
{ {
s32 i; s32 i;
@ -1281,8 +1273,7 @@ static void BtlController_EmitDMA3Transfer(u8 bufferId, void *dst, u16 size, voi
PrepareBufferDataTransfer(bufferId, sBattleBuffersTransferData, size + 7); PrepareBufferDataTransfer(bufferId, sBattleBuffersTransferData, size + 7);
} }
// Unused static void UNUSED BtlController_EmitPlayBGM(u8 bufferId, u16 songId, void *data)
static void BtlController_EmitPlayBGM(u8 bufferId, u16 songId, void *data)
{ {
s32 i; s32 i;
@ -1297,8 +1288,7 @@ static void BtlController_EmitPlayBGM(u8 bufferId, u16 songId, void *data)
PrepareBufferDataTransfer(bufferId, sBattleBuffersTransferData, songId + 3); PrepareBufferDataTransfer(bufferId, sBattleBuffersTransferData, songId + 3);
} }
// Unused static void UNUSED BtlController_EmitCmd32(u8 bufferId, u16 size, void *data)
static void BtlController_EmitCmd32(u8 bufferId, u16 size, void *data)
{ {
s32 i; s32 i;
@ -1348,8 +1338,7 @@ void BtlController_EmitOneReturnValue_Duplicate(u8 bufferId, u16 ret)
PrepareBufferDataTransfer(bufferId, sBattleBuffersTransferData, 4); PrepareBufferDataTransfer(bufferId, sBattleBuffersTransferData, 4);
} }
// Unused static void UNUSED BtlController_EmitClearUnkVar(u8 bufferId)
static void BtlController_EmitClearUnkVar(u8 bufferId)
{ {
sBattleBuffersTransferData[0] = CONTROLLER_CLEARUNKVAR; sBattleBuffersTransferData[0] = CONTROLLER_CLEARUNKVAR;
sBattleBuffersTransferData[1] = CONTROLLER_CLEARUNKVAR; sBattleBuffersTransferData[1] = CONTROLLER_CLEARUNKVAR;
@ -1358,16 +1347,14 @@ static void BtlController_EmitClearUnkVar(u8 bufferId)
PrepareBufferDataTransfer(bufferId, sBattleBuffersTransferData, 4); PrepareBufferDataTransfer(bufferId, sBattleBuffersTransferData, 4);
} }
// Unused static void UNUSED BtlController_EmitSetUnkVar(u8 bufferId, u8 b)
static void BtlController_EmitSetUnkVar(u8 bufferId, u8 b)
{ {
sBattleBuffersTransferData[0] = CONTROLLER_SETUNKVAR; sBattleBuffersTransferData[0] = CONTROLLER_SETUNKVAR;
sBattleBuffersTransferData[1] = b; sBattleBuffersTransferData[1] = b;
PrepareBufferDataTransfer(bufferId, sBattleBuffersTransferData, 2); PrepareBufferDataTransfer(bufferId, sBattleBuffersTransferData, 2);
} }
// Unused static void UNUSED BtlController_EmitClearUnkFlag(u8 bufferId)
static void BtlController_EmitClearUnkFlag(u8 bufferId)
{ {
sBattleBuffersTransferData[0] = CONTROLLER_CLEARUNKFLAG; sBattleBuffersTransferData[0] = CONTROLLER_CLEARUNKFLAG;
sBattleBuffersTransferData[1] = CONTROLLER_CLEARUNKFLAG; sBattleBuffersTransferData[1] = CONTROLLER_CLEARUNKFLAG;
@ -1376,8 +1363,7 @@ static void BtlController_EmitClearUnkFlag(u8 bufferId)
PrepareBufferDataTransfer(bufferId, sBattleBuffersTransferData, 4); PrepareBufferDataTransfer(bufferId, sBattleBuffersTransferData, 4);
} }
// Unused static void UNUSED BtlController_EmitToggleUnkFlag(u8 bufferId)
static void BtlController_EmitToggleUnkFlag(u8 bufferId)
{ {
sBattleBuffersTransferData[0] = CONTROLLER_TOGGLEUNKFLAG; sBattleBuffersTransferData[0] = CONTROLLER_TOGGLEUNKFLAG;
sBattleBuffersTransferData[1] = CONTROLLER_TOGGLEUNKFLAG; sBattleBuffersTransferData[1] = CONTROLLER_TOGGLEUNKFLAG;

View File

@ -2588,7 +2588,7 @@ static void CreateDomeOpponentMon(u8 monPartyId, u16 tournamentTrainerId, u8 tou
#ifdef BUGFIX #ifdef BUGFIX
u8 fixedIv = GetDomeTrainerMonIvs(DOME_TRAINERS[tournamentTrainerId].trainerId); u8 fixedIv = GetDomeTrainerMonIvs(DOME_TRAINERS[tournamentTrainerId].trainerId);
#else #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 #endif
u8 level = SetFacilityPtrsGetLevel(); u8 level = SetFacilityPtrsGetLevel();
CreateMonWithEVSpreadNatureOTID(&gEnemyParty[monPartyId], 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 // 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. // 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 // 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 // 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 pokemon selection is random. // other mode will be tried. If they tie again, the Pokémon selection is random.
int GetDomeTrainerSelectedMons(u16 tournamentTrainerId) int GetDomeTrainerSelectedMons(u16 tournamentTrainerId)
{ {
int selectedMonBits; int selectedMonBits;
@ -4837,7 +4837,7 @@ static void DisplayMatchInfoOnCard(u8 flags, u8 matchNo)
if (lost[1]) if (lost[1])
gSprites[sInfoCard->spriteIds[1 + arrId]].oam.paletteNum = 3; 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++) for (i = 0; i < FRONTIER_PARTY_SIZE; i++)
{ {
if (trainerIds[0] == TRAINER_PLAYER) 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++) for (i = 0; i < FRONTIER_PARTY_SIZE; i++)
{ {
if (trainerIds[1] == TRAINER_PLAYER) if (trainerIds[1] == TRAINER_PLAYER)
@ -5228,7 +5228,7 @@ static u16 GetWinningMove(int winnerTournamentId, int loserTournamentId, u8 roun
int movePower = 0; int movePower = 0;
SetFacilityPtrsGetLevel(); 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 (i = 0; i < FRONTIER_PARTY_SIZE; i++)
{ {
for (j = 0; j < MAX_MON_MOVES; j++) for (j = 0; j < MAX_MON_MOVES; j++)

View File

@ -337,7 +337,7 @@ static void GenerateOpponentMons(void)
if (gFacilityTrainerMons[monId].species == SPECIES_UNOWN) if (gFacilityTrainerMons[monId].species == SPECIES_UNOWN)
continue; 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++) for (j = 0; j < (int)ARRAY_COUNT(gSaveBlock2Ptr->frontier.rentalMons); j++)
{ {
if (gFacilityTrainerMons[monId].species == gFacilityTrainerMons[gSaveBlock2Ptr->frontier.rentalMons[j].monId].species) 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)) if (j != (int)ARRAY_COUNT(gSaveBlock2Ptr->frontier.rentalMons))
continue; 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) if (lvlMode == FRONTIER_LVL_50 && monId > FRONTIER_MONS_HIGH_TIER)
continue; continue;
@ -554,7 +554,7 @@ static void GenerateInitialRentalMons(void)
i = 0; i = 0;
while (i != PARTY_SIZE) 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); monId = GetFactoryMonId(factoryLvlMode, challengeNum, TRUE);
else else
monId = GetFactoryMonId(factoryLvlMode, challengeNum, FALSE); monId = GetFactoryMonId(factoryLvlMode, challengeNum, FALSE);
@ -562,7 +562,7 @@ static void GenerateInitialRentalMons(void)
if (gFacilityTrainerMons[monId].species == SPECIES_UNOWN) if (gFacilityTrainerMons[monId].species == SPECIES_UNOWN)
continue; 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++) for (j = firstMonId; j < firstMonId + i; j++)
{ {
u16 existingMonId = monIds[j]; u16 existingMonId = monIds[j];
@ -741,8 +741,15 @@ u8 GetFactoryMonFixedIV(u8 challengeNum, bool8 isLastBattle)
u8 ivSet; u8 ivSet;
bool8 useHigherIV = isLastBattle ? TRUE : FALSE; bool8 useHigherIV = isLastBattle ? TRUE : FALSE;
if (challengeNum > 8) // The Factory has an out-of-bounds access when generating the rental draft for round 9 (challengeNum==8),
ivSet = 7; // 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 else
ivSet = challengeNum; ivSet = challengeNum;

View File

@ -32,15 +32,15 @@
#include "constants/songs.h" #include "constants/songs.h"
#include "constants/rgb.h" #include "constants/rgb.h"
// Select_ refers to the first Pokemon selection screen where you choose your initial 3 rental Pokemon. // 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 Pokemon with one from the beaten trainer // 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, // 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 // 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_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 pokemon from the defeated party to swap for #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 #define SELECTABLE_MONS_COUNT 6
@ -89,7 +89,7 @@ struct FactorySelectableMon
{ {
u16 monId; u16 monId;
u16 ballSpriteId; 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; struct Pokemon monData;
}; };
@ -1060,7 +1060,7 @@ static void SpriteCB_Pokeball(struct Sprite *sprite)
{ {
if (sprite->oam.paletteNum == IndexOfSpritePaletteTag(PALTAG_BALL_SELECTED)) if (sprite->oam.paletteNum == IndexOfSpritePaletteTag(PALTAG_BALL_SELECTED))
{ {
// Pokeball selected, do rocking animation // Poké Ball selected, do rocking animation
if (sprite->animEnded) if (sprite->animEnded)
{ {
if (sprite->data[0] != 0) if (sprite->data[0] != 0)
@ -1084,7 +1084,7 @@ static void SpriteCB_Pokeball(struct Sprite *sprite)
} }
else else
{ {
// Pokeball not selected, remain still // Poké Ball not selected, remain still
StartSpriteAnimIfDifferent(sprite, 0); 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) static void Select_Task_HandleYesNo(u8 taskId)
{ {
if (sFactorySelectScreen->monPicAnimating == TRUE) if (sFactorySelectScreen->monPicAnimating == TRUE)
@ -1543,14 +1543,14 @@ static void Select_Task_HandleYesNo(u8 taskId)
PlaySE(SE_SELECT); PlaySE(SE_SELECT);
if (sFactorySelectScreen->yesNoCursorPos == 0) if (sFactorySelectScreen->yesNoCursorPos == 0)
{ {
// Selected Yes, confirmed selected pokemon // Selected Yes, confirmed selected Pokémon
Select_HideChosenMons(); Select_HideChosenMons();
gTasks[taskId].tState = 0; gTasks[taskId].tState = 0;
gTasks[taskId].func = Select_Task_Exit; gTasks[taskId].func = Select_Task_Exit;
} }
else else
{ {
// Selected No, continue choosing pokemon // Selected No, continue choosing Pokémon
Select_ErasePopupMenu(SELECT_WIN_YES_NO); Select_ErasePopupMenu(SELECT_WIN_YES_NO);
Select_DeclineChosenMons(); Select_DeclineChosenMons();
sFactorySelectScreen->fadeSpeciesNameActive = TRUE; sFactorySelectScreen->fadeSpeciesNameActive = TRUE;
@ -1560,7 +1560,7 @@ static void Select_Task_HandleYesNo(u8 taskId)
} }
else if (JOY_NEW(B_BUTTON)) else if (JOY_NEW(B_BUTTON))
{ {
// Pressed B, Continue choosing pokemon // Pressed B, Continue choosing Pokémon
PlaySE(SE_SELECT); PlaySE(SE_SELECT);
Select_ErasePopupMenu(SELECT_WIN_YES_NO); Select_ErasePopupMenu(SELECT_WIN_YES_NO);
Select_DeclineChosenMons(); 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) static void Select_Task_HandleMenu(u8 taskId)
{ {
switch (gTasks[taskId].tState) switch (gTasks[taskId].tState)
@ -2415,7 +2415,7 @@ static void Swap_Task_Exit(u8 taskId)
{ {
case 0: case 0:
// Set return value for script // Set return value for script
// TRUE if player kept their current pokemon // TRUE if player kept their current Pokémon
if (sFactorySwapScreen->monSwapped == TRUE) if (sFactorySwapScreen->monSwapped == TRUE)
{ {
gTasks[taskId].tState++; 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) static void Swap_Task_HandleChooseMons(u8 taskId)
{ {
switch (gTasks[taskId].tState) switch (gTasks[taskId].tState)
@ -2645,7 +2645,7 @@ static void Swap_Task_HandleChooseMons(u8 taskId)
case STATE_CHOOSE_MONS_HANDLE_INPUT: case STATE_CHOOSE_MONS_HANDLE_INPUT:
if (JOY_NEW(A_BUTTON)) 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); PlaySE(SE_SELECT);
sFactorySwapScreen->fadeSpeciesNameActive = FALSE; sFactorySwapScreen->fadeSpeciesNameActive = FALSE;
Swap_PrintMonSpeciesAtFade(); Swap_PrintMonSpeciesAtFade();
@ -3553,7 +3553,7 @@ static void Swap_HandleActionCursorChange(u8 cursorId)
{ {
if (cursorId < FRONTIER_PARTY_SIZE) 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; gSprites[sFactorySwapScreen->cursorSpriteId].invisible = FALSE;
Swap_HideActionButtonHighlights(); Swap_HideActionButtonHighlights();
gSprites[sFactorySwapScreen->cursorSpriteId].x = gSprites[sFactorySwapScreen->ballSpriteIds[cursorId]].x; gSprites[sFactorySwapScreen->cursorSpriteId].x = gSprites[sFactorySwapScreen->ballSpriteIds[cursorId]].x;

View File

@ -105,7 +105,7 @@ void FreeBattleSpritesData(void)
FREE_AND_SET_NULL(gBattleSpritesDataPtr); 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) u16 ChooseMoveAndTargetInBattlePalace(void)
{ {
s32 i, var1, var2; s32 i, var1, var2;
@ -165,7 +165,7 @@ u16 ChooseMoveAndTargetInBattlePalace(void)
chosenMoveId = BattleAI_ChooseMoveOrAction(); 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 // 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 a move is chosen this way, there's a 50% chance that it will be unable to use it anyway
if (chosenMoveId == -1) if (chosenMoveId == -1)
@ -357,7 +357,7 @@ static u16 GetBattlePalaceTarget(void)
return BATTLE_OPPOSITE(gActiveBattler) << 8; 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) void SpriteCB_WaitForBattlerBallReleaseAnim(struct Sprite *sprite)
{ {
u8 spriteId = sprite->data[1]; 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->animPaused = TRUE;
sprite->callback = SpriteCallbackDummy; sprite->callback = SpriteCallbackDummy;
@ -690,8 +690,7 @@ void BattleLoadPlayerMonSpriteGfx(struct Pokemon *mon, u8 battlerId)
} }
} }
// Unused static void UNUSED BattleGfxSfxDummy1(void)
static void BattleGfxSfxDummy1(void)
{ {
} }

View File

@ -841,8 +841,7 @@ static void Debug_DrawNumber(s16 number, u16 *dest, bool8 unk)
} }
} }
// Unused static void UNUSED Debug_DrawNumberPair(s16 number1, s16 number2, u16 *dest)
static void Debug_DrawNumberPair(s16 number1, s16 number2, u16 *dest)
{ {
dest[4] = 0x1E; dest[4] = 0x1E;
Debug_DrawNumber(number2, dest, FALSE); Debug_DrawNumber(number2, dest, FALSE);
@ -2459,9 +2458,8 @@ static u8 CalcBarFilledPixels(s32 maxValue, s32 oldValue, s32 receivedValue, s32
return filledPixels; return filledPixels;
} }
// Unused
// These two functions seem as if they were made for testing the health bar. // 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; s16 ret, var;

View File

@ -602,7 +602,7 @@ void DrawBattlerOnBg(int bgId, u8 x, u8 y, u8 battlerPosition, u8 paletteId, u8
LoadBgTilemap(bgId, tilemap, BG_SCREEN_SIZE, 0); 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; int i, j, offset;

View File

@ -170,7 +170,7 @@ EWRAM_DATA u16 gChosenMove = 0;
EWRAM_DATA u16 gCalledMove = 0; EWRAM_DATA u16 gCalledMove = 0;
EWRAM_DATA s32 gBattleMoveDamage = 0; EWRAM_DATA s32 gBattleMoveDamage = 0;
EWRAM_DATA s32 gHpDealt = 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 u16 gLastUsedItem = 0;
EWRAM_DATA u8 gLastUsedAbility = 0; EWRAM_DATA u8 gLastUsedAbility = 0;
EWRAM_DATA u8 gBattlerAttacker = 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 u8 gMoveResultFlags = 0;
EWRAM_DATA u32 gHitMarker = 0; EWRAM_DATA u32 gHitMarker = 0;
EWRAM_DATA static u8 sUnusedBattlersArray[MAX_BATTLERS_COUNT] = {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 u8 gUnusedFirstBattleVar2 = 0; // Never read
EWRAM_DATA u16 gSideStatuses[NUM_BATTLE_SIDES] = {0}; EWRAM_DATA u16 gSideStatuses[NUM_BATTLE_SIDES] = {0};
EWRAM_DATA struct SideTimer gSideTimers[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; return gTrainers[trainerNum].partySize;
} }
// Unused static void UNUSED HBlankCB_Battle(void)
static void HBlankCB_Battle(void)
{ {
if (REG_VCOUNT < DISPLAY_HEIGHT && REG_VCOUNT >= 111) if (REG_VCOUNT < DISPLAY_HEIGHT && REG_VCOUNT >= 111)
SetGpuReg(REG_OFFSET_BG0CNT, BGCNT_SCREENBASE(24) | BGCNT_TXT256x512); SetGpuReg(REG_OFFSET_BG0CNT, BGCNT_SCREENBASE(24) | BGCNT_TXT256x512);
@ -2710,8 +2709,7 @@ void SpriteCallbackDummy_2(struct Sprite *sprite)
#define sNumFlickers data[3] #define sNumFlickers data[3]
#define sDelay data[4] #define sDelay data[4]
// Unused static void UNUSED SpriteCB_InitFlicker(struct Sprite *sprite)
static void SpriteCB_InitFlicker(struct Sprite *sprite)
{ {
sprite->sNumFlickers = 6; sprite->sNumFlickers = 6;
sprite->sDelay = 1; sprite->sDelay = 1;
@ -2866,8 +2864,7 @@ static void SpriteCB_BattleSpriteSlideLeft(struct Sprite *sprite)
} }
} }
// Unused static void UNUSED SetIdleSpriteCallback(struct Sprite *sprite)
static void SetIdleSpriteCallback(struct Sprite *sprite)
{ {
sprite->callback = SpriteCB_Idle; sprite->callback = SpriteCB_Idle;
} }
@ -3712,8 +3709,7 @@ static void BattleIntroRecordMonsToDex(void)
} }
} }
// Unused static void UNUSED BattleIntroSkipRecordMonsToDex(void)
static void BattleIntroSkipRecordMonsToDex(void)
{ {
if (gBattleControllerExecFlags == 0) if (gBattleControllerExecFlags == 0)
gBattleMainFunc = BattleIntroPrintPlayerSendsOut; gBattleMainFunc = BattleIntroPrintPlayerSendsOut;
@ -3816,8 +3812,7 @@ static void BattleIntroPlayer1SendsOutMonAnimation(void)
gBattleMainFunc = TryDoEventsBeforeFirstTurn; gBattleMainFunc = TryDoEventsBeforeFirstTurn;
} }
// Unused static void UNUSED BattleIntroSwitchInPlayerMons(void)
static void BattleIntroSwitchInPlayerMons(void)
{ {
if (gBattleControllerExecFlags == 0) if (gBattleControllerExecFlags == 0)
{ {

View File

@ -2152,7 +2152,7 @@ void BufferStringBattle(u16 stringID)
} }
} }
break; 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 ChooseMoveUsedParticle(gBattleTextBuff1); // buff1 doesn't appear in the string, leftover from japanese move names
if (gBattleMsgDataPtr->currentMove >= MOVES_COUNT) 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? u32 dstID = 0; // if they used dstID, why not use srcID as well?
const u8 *toCpy = NULL; 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 text[max(max(max(32, TRAINER_NAME_LENGTH + 1), POKEMON_NAME_LENGTH + 1), ITEM_NAME_LENGTH)];
u8 multiplayerId; u8 multiplayerId;
s32 i; s32 i;

View File

@ -1097,8 +1097,7 @@ static u16 GetNPCRoomGraphicsId(void)
return sNPCTable[sNpcId].graphicsId; return sNPCTable[sNpcId].graphicsId;
} }
// Unused static bool8 UNUSED GetInWildMonRoom(void)
static u8 GetInWildMonRoom(void)
{ {
return sInWildMonRoom; return sInWildMonRoom;
} }
@ -1268,7 +1267,7 @@ static void TryHealMons(u8 healCount)
for (i = 0; i < FRONTIER_PARTY_SIZE; i++) for (i = 0; i < FRONTIER_PARTY_SIZE; i++)
indices[i] = 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, // The order in which they're (attempted to be) healed is random,
// and determined by performing 10 random swaps to this index array. // and determined by performing 10 random swaps to this index array.
for (k = 0; k < 10; k++) for (k = 0; k < 10; k++)

View File

@ -1479,8 +1479,7 @@ u8 GetTrainerEncounterMusicIdInBattlePyramid(u16 trainerId)
return TRAINER_ENCOUNTER_MUSIC_MALE; return TRAINER_ENCOUNTER_MUSIC_MALE;
} }
// Unused static void UNUSED BattlePyramidRetireChallenge(void)
static void BattlePyramidRetireChallenge(void)
{ {
ScriptContext_SetupScript(BattlePyramid_Retire); ScriptContext_SetupScript(BattlePyramid_Retire);
} }

View File

@ -174,12 +174,12 @@ enum {
static const struct MenuAction sMenuActions[] = static const struct MenuAction sMenuActions[] =
{ {
[ACTION_USE_FIELD] = { gMenuText_Use, BagAction_UseOnField }, [ACTION_USE_FIELD] = { gMenuText_Use, {BagAction_UseOnField} },
[ACTION_TOSS] = { gMenuText_Toss, BagAction_Toss }, [ACTION_TOSS] = { gMenuText_Toss, {BagAction_Toss} },
[ACTION_GIVE] = { gMenuText_Give, BagAction_Give }, [ACTION_GIVE] = { gMenuText_Give, {BagAction_Give} },
[ACTION_CANCEL] = { gText_Cancel2, BagAction_Cancel }, [ACTION_CANCEL] = { gText_Cancel2, {BagAction_Cancel} },
[ACTION_USE_BATTLE] = { gMenuText_Use, BagAction_UseInBattle }, [ACTION_USE_BATTLE] = { gMenuText_Use, {BagAction_UseInBattle} },
[ACTION_DUMMY] = { gText_EmptyString2, NULL }, [ACTION_DUMMY] = { gText_EmptyString2, {NULL} },
}; };
static const u8 sMenuActionIds_Field[] = {ACTION_USE_FIELD, ACTION_GIVE, ACTION_TOSS, ACTION_CANCEL}; 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); GoToBattlePyramidBagMenu(PYRAMIDBAG_LOC_FIELD, CB2_ReturnToFieldWithOpenMenu);
} }
// Unused, CB2_BagMenuFromBattle is used instead // CB2_BagMenuFromBattle is used instead
static void OpenBattlePyramidBagInBattle(void) static void UNUSED OpenBattlePyramidBagInBattle(void)
{ {
GoToBattlePyramidBagMenu(PYRAMIDBAG_LOC_BATTLE, CB2_SetUpReshowBattleScreenAfterMenu2); GoToBattlePyramidBagMenu(PYRAMIDBAG_LOC_BATTLE, CB2_SetUpReshowBattleScreenAfterMenu2);
} }
@ -1468,8 +1468,7 @@ static void DrawTossNumberWindow(u8 windowId)
ScheduleBgCopyTilemapToVram(1); ScheduleBgCopyTilemapToVram(1);
} }
// Unused static u8 UNUSED GetMenuActionWindowId(u8 windowArrayId)
static u8 GetMenuActionWindowId(u8 windowArrayId)
{ {
return gPyramidBagMenu->windowIds[windowArrayId]; return gPyramidBagMenu->windowIds[windowArrayId];
} }

View File

@ -1706,7 +1706,7 @@ static inline void ApplyRandomDmgMultiplier(void)
} }
} }
static void Unused_ApplyRandomDmgMultiplier(void) static void UNUSED Unused_ApplyRandomDmgMultiplier(void)
{ {
ApplyRandomDmgMultiplier(); ApplyRandomDmgMultiplier();
} }
@ -1892,6 +1892,7 @@ static void Cmd_healthbarupdate(void)
gBattlescriptCurrInstr += 2; gBattlescriptCurrInstr += 2;
} }
// Update the active battler's HP and various HP trackers (Substitute, Bide, etc.)
static void Cmd_datahpupdate(void) static void Cmd_datahpupdate(void)
{ {
u32 moveType; u32 moveType;
@ -1899,9 +1900,13 @@ static void Cmd_datahpupdate(void)
if (gBattleControllerExecFlags) if (gBattleControllerExecFlags)
return; 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) if (gBattleStruct->dynamicMoveType == 0)
moveType = gBattleMoves[gCurrentMove].type; 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; moveType = gBattleStruct->dynamicMoveType & DYNAMIC_TYPE_MASK;
else else
moveType = gBattleMoves[gCurrentMove].type; moveType = gBattleMoves[gCurrentMove].type;
@ -1911,23 +1916,26 @@ static void Cmd_datahpupdate(void)
gActiveBattler = GetBattlerForBattleScript(gBattlescriptCurrInstr[1]); gActiveBattler = GetBattlerForBattleScript(gBattlescriptCurrInstr[1]);
if (gBattleMons[gActiveBattler].status2 & STATUS2_SUBSTITUTE && gDisableStructs[gActiveBattler].substituteHP && !(gHitMarker & HITMARKER_IGNORE_SUBSTITUTE)) 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 (gDisableStructs[gActiveBattler].substituteHP >= gBattleMoveDamage)
{ {
if (gSpecialStatuses[gActiveBattler].dmg == 0) if (gSpecialStatuses[gActiveBattler].shellBellDmg == 0)
gSpecialStatuses[gActiveBattler].dmg = gBattleMoveDamage; gSpecialStatuses[gActiveBattler].shellBellDmg = gBattleMoveDamage;
gDisableStructs[gActiveBattler].substituteHP -= gBattleMoveDamage; gDisableStructs[gActiveBattler].substituteHP -= gBattleMoveDamage;
gHpDealt = gBattleMoveDamage; gHpDealt = gBattleMoveDamage;
} }
else else
{ {
if (gSpecialStatuses[gActiveBattler].dmg == 0) // Substitute has less HP than the damage dealt, set its HP to 0.
gSpecialStatuses[gActiveBattler].dmg = gDisableStructs[gActiveBattler].substituteHP; if (gSpecialStatuses[gActiveBattler].shellBellDmg == 0)
gSpecialStatuses[gActiveBattler].shellBellDmg = gDisableStructs[gActiveBattler].substituteHP;
gHpDealt = gDisableStructs[gActiveBattler].substituteHP; gHpDealt = gDisableStructs[gActiveBattler].substituteHP;
gDisableStructs[gActiveBattler].substituteHP = 0; gDisableStructs[gActiveBattler].substituteHP = 0;
} }
// check substitute fading
if (gDisableStructs[gActiveBattler].substituteHP == 0) if (gDisableStructs[gActiveBattler].substituteHP == 0)
{ {
// Substitute fades
gBattlescriptCurrInstr += 2; gBattlescriptCurrInstr += 2;
BattleScriptPushCursor(); BattleScriptPushCursor();
gBattlescriptCurrInstr = BattleScript_SubstituteFade; gBattlescriptCurrInstr = BattleScript_SubstituteFade;
@ -1937,28 +1945,30 @@ static void Cmd_datahpupdate(void)
else else
{ {
gHitMarker &= ~HITMARKER_IGNORE_SUBSTITUTE; 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) if (gBattleMons[gActiveBattler].hp > gBattleMons[gActiveBattler].maxHP)
gBattleMons[gActiveBattler].hp = gBattleMons[gActiveBattler].maxHP; gBattleMons[gActiveBattler].hp = gBattleMons[gActiveBattler].maxHP;
}
else // hp goes down
{
if (gHitMarker & HITMARKER_SKIP_DMG_TRACK)
{
gHitMarker &= ~HITMARKER_SKIP_DMG_TRACK;
} }
else else
{ {
gTakenDmg[gActiveBattler] += gBattleMoveDamage; if (gHitMarker & HITMARKER_IGNORE_BIDE)
{
gHitMarker &= ~HITMARKER_IGNORE_BIDE;
}
else
{
// Record damage/attacker for Bide
gBideDmg[gActiveBattler] += gBattleMoveDamage;
if (gBattlescriptCurrInstr[1] == BS_TARGET) if (gBattlescriptCurrInstr[1] == BS_TARGET)
gTakenDmgByBattler[gActiveBattler] = gBattlerAttacker; gBideTarget[gActiveBattler] = gBattlerAttacker;
else else
gTakenDmgByBattler[gActiveBattler] = gBattlerTarget; gBideTarget[gActiveBattler] = gBattlerTarget;
} }
// Deal damage to the battler
if (gBattleMons[gActiveBattler].hp > gBattleMoveDamage) if (gBattleMons[gActiveBattler].hp > gBattleMoveDamage)
{ {
gBattleMons[gActiveBattler].hp -= gBattleMoveDamage; gBattleMons[gActiveBattler].hp -= gBattleMoveDamage;
@ -1970,11 +1980,16 @@ static void Cmd_datahpupdate(void)
gBattleMons[gActiveBattler].hp = 0; gBattleMons[gActiveBattler].hp = 0;
} }
if (!gSpecialStatuses[gActiveBattler].dmg && !(gHitMarker & HITMARKER_PASSIVE_DAMAGE)) // Record damage for Shell Bell
gSpecialStatuses[gActiveBattler].dmg = gHpDealt; 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) if (IS_TYPE_PHYSICAL(moveType) && !(gHitMarker & HITMARKER_PASSIVE_DAMAGE) && gCurrentMove != MOVE_PAIN_SPLIT)
{ {
// Record physical damage/attacker for Counter
gProtectStructs[gActiveBattler].physicalDmg = gHpDealt; gProtectStructs[gActiveBattler].physicalDmg = gHpDealt;
gSpecialStatuses[gActiveBattler].physicalDmg = gHpDealt; gSpecialStatuses[gActiveBattler].physicalDmg = gHpDealt;
if (gBattlescriptCurrInstr[1] == BS_TARGET) if (gBattlescriptCurrInstr[1] == BS_TARGET)
@ -1990,6 +2005,7 @@ static void Cmd_datahpupdate(void)
} }
else if (!IS_TYPE_PHYSICAL(moveType) && !(gHitMarker & HITMARKER_PASSIVE_DAMAGE)) else if (!IS_TYPE_PHYSICAL(moveType) && !(gHitMarker & HITMARKER_PASSIVE_DAMAGE))
{ {
// Record special damage/attacker for Mirror Coat
gProtectStructs[gActiveBattler].specialDmg = gHpDealt; gProtectStructs[gActiveBattler].specialDmg = gHpDealt;
gSpecialStatuses[gActiveBattler].specialDmg = gHpDealt; gSpecialStatuses[gActiveBattler].specialDmg = gHpDealt;
if (gBattlescriptCurrInstr[1] == BS_TARGET) if (gBattlescriptCurrInstr[1] == BS_TARGET)
@ -2005,15 +2021,18 @@ static void Cmd_datahpupdate(void)
} }
} }
gHitMarker &= ~HITMARKER_PASSIVE_DAMAGE; gHitMarker &= ~HITMARKER_PASSIVE_DAMAGE;
// Send updated HP
BtlController_EmitSetMonData(BUFFER_A, REQUEST_HP_BATTLE, 0, sizeof(gBattleMons[gActiveBattler].hp), &gBattleMons[gActiveBattler].hp); BtlController_EmitSetMonData(BUFFER_A, REQUEST_HP_BATTLE, 0, sizeof(gBattleMons[gActiveBattler].hp), &gBattleMons[gActiveBattler].hp);
MarkBattlerForControllerExec(gActiveBattler); MarkBattlerForControllerExec(gActiveBattler);
} }
} }
else else
{ {
// MOVE_RESULT_NO_EFFECT was set
gActiveBattler = GetBattlerForBattleScript(gBattlescriptCurrInstr[1]); gActiveBattler = GetBattlerForBattleScript(gBattlescriptCurrInstr[1]);
if (gSpecialStatuses[gActiveBattler].dmg == 0) if (gSpecialStatuses[gActiveBattler].shellBellDmg == 0)
gSpecialStatuses[gActiveBattler].dmg = 0xFFFF; gSpecialStatuses[gActiveBattler].shellBellDmg = IGNORE_SHELL_BELL;
} }
gBattlescriptCurrInstr += 2; gBattlescriptCurrInstr += 2;
} }
@ -2283,11 +2302,11 @@ void SetMoveEffect(bool8 primary, u8 certain)
gBattleScripting.battler = gBattlerAttacker; 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) && !primary && gBattleCommunication[MOVE_EFFECT_BYTE] <= 9)
INCREMENT_RESET_RETURN 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) && !primary && gBattleCommunication[MOVE_EFFECT_BYTE] <= 7)
INCREMENT_RESET_RETURN INCREMENT_RESET_RETURN
@ -2337,10 +2356,10 @@ void SetMoveEffect(bool8 primary, u8 certain)
BattleScriptPush(gBattlescriptCurrInstr + 1); BattleScriptPush(gBattlescriptCurrInstr + 1);
gBattlescriptCurrInstr = BattleScript_PSNPrevention; gBattlescriptCurrInstr = BattleScript_PSNPrevention;
if (gHitMarker & HITMARKER_IGNORE_SAFEGUARD) if (gHitMarker & HITMARKER_STATUS_ABILITY_EFFECT)
{ {
gBattleCommunication[MULTISTRING_CHOOSER] = B_MSG_ABILITY_PREVENTS_ABILITY_STATUS; gBattleCommunication[MULTISTRING_CHOOSER] = B_MSG_ABILITY_PREVENTS_ABILITY_STATUS;
gHitMarker &= ~HITMARKER_IGNORE_SAFEGUARD; gHitMarker &= ~HITMARKER_STATUS_ABILITY_EFFECT;
} }
else else
{ {
@ -2349,7 +2368,7 @@ void SetMoveEffect(bool8 primary, u8 certain)
RESET_RETURN RESET_RETURN
} }
if ((IS_BATTLER_OF_TYPE(gEffectBattler, TYPE_POISON) || IS_BATTLER_OF_TYPE(gEffectBattler, TYPE_STEEL)) 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)) && (primary == TRUE || certain == MOVE_EFFECT_CERTAIN))
{ {
BattleScriptPush(gBattlescriptCurrInstr + 1); BattleScriptPush(gBattlescriptCurrInstr + 1);
@ -2378,10 +2397,10 @@ void SetMoveEffect(bool8 primary, u8 certain)
BattleScriptPush(gBattlescriptCurrInstr + 1); BattleScriptPush(gBattlescriptCurrInstr + 1);
gBattlescriptCurrInstr = BattleScript_BRNPrevention; gBattlescriptCurrInstr = BattleScript_BRNPrevention;
if (gHitMarker & HITMARKER_IGNORE_SAFEGUARD) if (gHitMarker & HITMARKER_STATUS_ABILITY_EFFECT)
{ {
gBattleCommunication[MULTISTRING_CHOOSER] = B_MSG_ABILITY_PREVENTS_ABILITY_STATUS; gBattleCommunication[MULTISTRING_CHOOSER] = B_MSG_ABILITY_PREVENTS_ABILITY_STATUS;
gHitMarker &= ~HITMARKER_IGNORE_SAFEGUARD; gHitMarker &= ~HITMARKER_STATUS_ABILITY_EFFECT;
} }
else else
{ {
@ -2390,7 +2409,7 @@ void SetMoveEffect(bool8 primary, u8 certain)
RESET_RETURN RESET_RETURN
} }
if (IS_BATTLER_OF_TYPE(gEffectBattler, TYPE_FIRE) if (IS_BATTLER_OF_TYPE(gEffectBattler, TYPE_FIRE)
&& (gHitMarker & HITMARKER_IGNORE_SAFEGUARD) && (gHitMarker & HITMARKER_STATUS_ABILITY_EFFECT)
&& (primary == TRUE || certain == MOVE_EFFECT_CERTAIN)) && (primary == TRUE || certain == MOVE_EFFECT_CERTAIN))
{ {
BattleScriptPush(gBattlescriptCurrInstr + 1); BattleScriptPush(gBattlescriptCurrInstr + 1);
@ -2434,10 +2453,10 @@ void SetMoveEffect(bool8 primary, u8 certain)
BattleScriptPush(gBattlescriptCurrInstr + 1); BattleScriptPush(gBattlescriptCurrInstr + 1);
gBattlescriptCurrInstr = BattleScript_PRLZPrevention; gBattlescriptCurrInstr = BattleScript_PRLZPrevention;
if (gHitMarker & HITMARKER_IGNORE_SAFEGUARD) if (gHitMarker & HITMARKER_STATUS_ABILITY_EFFECT)
{ {
gBattleCommunication[MULTISTRING_CHOOSER] = B_MSG_ABILITY_PREVENTS_ABILITY_STATUS; gBattleCommunication[MULTISTRING_CHOOSER] = B_MSG_ABILITY_PREVENTS_ABILITY_STATUS;
gHitMarker &= ~HITMARKER_IGNORE_SAFEGUARD; gHitMarker &= ~HITMARKER_STATUS_ABILITY_EFFECT;
} }
else else
{ {
@ -2462,10 +2481,10 @@ void SetMoveEffect(bool8 primary, u8 certain)
BattleScriptPush(gBattlescriptCurrInstr + 1); BattleScriptPush(gBattlescriptCurrInstr + 1);
gBattlescriptCurrInstr = BattleScript_PSNPrevention; gBattlescriptCurrInstr = BattleScript_PSNPrevention;
if (gHitMarker & HITMARKER_IGNORE_SAFEGUARD) if (gHitMarker & HITMARKER_STATUS_ABILITY_EFFECT)
{ {
gBattleCommunication[MULTISTRING_CHOOSER] = B_MSG_ABILITY_PREVENTS_ABILITY_STATUS; gBattleCommunication[MULTISTRING_CHOOSER] = B_MSG_ABILITY_PREVENTS_ABILITY_STATUS;
gHitMarker &= ~HITMARKER_IGNORE_SAFEGUARD; gHitMarker &= ~HITMARKER_STATUS_ABILITY_EFFECT;
} }
else else
{ {
@ -2474,7 +2493,7 @@ void SetMoveEffect(bool8 primary, u8 certain)
RESET_RETURN RESET_RETURN
} }
if ((IS_BATTLER_OF_TYPE(gEffectBattler, TYPE_POISON) || IS_BATTLER_OF_TYPE(gEffectBattler, TYPE_STEEL)) 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)) && (primary == TRUE || certain == MOVE_EFFECT_CERTAIN))
{ {
BattleScriptPush(gBattlescriptCurrInstr + 1); 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); BtlController_EmitSetMonData(BUFFER_A, REQUEST_STATUS_BATTLE, 0, sizeof(gBattleMons[gEffectBattler].status1), &gBattleMons[gEffectBattler].status1);
MarkBattlerForControllerExec(gActiveBattler); MarkBattlerForControllerExec(gActiveBattler);
if (gHitMarker & HITMARKER_IGNORE_SAFEGUARD) if (gHitMarker & HITMARKER_STATUS_ABILITY_EFFECT)
{ {
gBattleCommunication[MULTISTRING_CHOOSER] = B_MSG_STATUSED_BY_ABILITY; gBattleCommunication[MULTISTRING_CHOOSER] = B_MSG_STATUSED_BY_ABILITY;
gHitMarker &= ~HITMARKER_IGNORE_SAFEGUARD; gHitMarker &= ~HITMARKER_STATUS_ABILITY_EFFECT;
} }
else else
{ {
@ -3403,7 +3422,7 @@ static void Cmd_getexp(void)
if (IsTradedMon(&gPlayerParty[gBattleStruct->expGetterMonId])) 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) if (gBattleTypeFlags & BATTLE_TYPE_INGAME_PARTNER && gBattleStruct->expGetterMonId >= 3)
{ {
i = STRINGID_EMPTYSTRING4; i = STRINGID_EMPTYSTRING4;
@ -4485,7 +4504,7 @@ static void Cmd_moveend(void)
} }
gBattleScripting.moveendState++; gBattleScripting.moveendState++;
break; 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 if (!(gHitMarker & HITMARKER_UNABLE_TO_USE_MOVE) && gBattleTypeFlags & BATTLE_TYPE_DOUBLE
&& !gProtectStructs[gBattlerAttacker].chargingTurn && gBattleMoves[gCurrentMove].target == MOVE_TARGET_BOTH && !gProtectStructs[gBattlerAttacker].chargingTurn && gBattleMoves[gCurrentMove].target == MOVE_TARGET_BOTH
&& !(gHitMarker & HITMARKER_NO_ATTACKSTRING)) && !(gHitMarker & HITMARKER_NO_ATTACKSTRING))
@ -7148,7 +7167,7 @@ static void Cmd_setbide(void)
{ {
gBattleMons[gBattlerAttacker].status2 |= STATUS2_MULTIPLETURNS; gBattleMons[gBattlerAttacker].status2 |= STATUS2_MULTIPLETURNS;
gLockedMoves[gBattlerAttacker] = gCurrentMove; gLockedMoves[gBattlerAttacker] = gCurrentMove;
gTakenDmg[gBattlerAttacker] = 0; gBideDmg[gBattlerAttacker] = 0;
gBattleMons[gBattlerAttacker].status2 |= STATUS2_BIDE_TURN(2); gBattleMons[gBattlerAttacker].status2 |= STATUS2_BIDE_TURN(2);
gBattlescriptCurrInstr++; gBattlescriptCurrInstr++;
@ -7307,7 +7326,7 @@ static void Cmd_forcerandomswitch(void)
lastMonId = PARTY_SIZE; lastMonId = PARTY_SIZE;
monsCount = PARTY_SIZE; monsCount = PARTY_SIZE;
minNeeded = 1; 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]; battler1PartyId = gBattlerPartyIndexes[gBattlerTarget];
} }
@ -7798,7 +7817,7 @@ static void Cmd_setsubstitute(void)
} }
else 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) if (gBattleMoveDamage == 0)
gBattleMoveDamage = 1; gBattleMoveDamage = 1;
@ -8040,7 +8059,7 @@ static void Cmd_painsplitdmgcalc(void)
storeLoc[3] = (painSplitHp & 0xFF000000) >> 24; storeLoc[3] = (painSplitHp & 0xFF000000) >> 24;
gBattleMoveDamage = gBattleMons[gBattlerAttacker].hp - hpDiff; gBattleMoveDamage = gBattleMons[gBattlerAttacker].hp - hpDiff;
gSpecialStatuses[gBattlerTarget].dmg = 0xFFFF; gSpecialStatuses[gBattlerTarget].shellBellDmg = IGNORE_SHELL_BELL;
gBattlescriptCurrInstr += 5; gBattlescriptCurrInstr += 5;
} }
@ -8878,7 +8897,7 @@ static void Cmd_hiddenpowercalc(void)
gBattleStruct->dynamicMoveType = ((NUMBER_OF_MON_TYPES - 3) * typeBits) / 63 + 1; gBattleStruct->dynamicMoveType = ((NUMBER_OF_MON_TYPES - 3) * typeBits) / 63 + 1;
if (gBattleStruct->dynamicMoveType >= TYPE_MYSTERY) if (gBattleStruct->dynamicMoveType >= TYPE_MYSTERY)
gBattleStruct->dynamicMoveType++; gBattleStruct->dynamicMoveType++;
gBattleStruct->dynamicMoveType |= F_DYNAMIC_TYPE_1 | F_DYNAMIC_TYPE_2; gBattleStruct->dynamicMoveType |= F_DYNAMIC_TYPE_IGNORE_PHYSICALITY | F_DYNAMIC_TYPE_SET;
gBattlescriptCurrInstr++; gBattlescriptCurrInstr++;
} }
@ -9179,7 +9198,7 @@ static void Cmd_tryswapitems(void)
{ {
gBattlescriptCurrInstr = T1_READ_PTR(gBattlescriptCurrInstr + 1); 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 // or if either of them is an enigma berry or a mail
else if ((gBattleMons[gBattlerAttacker].item == ITEM_NONE && gBattleMons[gBattlerTarget].item == ITEM_NONE) else if ((gBattleMons[gBattlerAttacker].item == ITEM_NONE && gBattleMons[gBattlerTarget].item == ITEM_NONE)
|| gBattleMons[gBattlerAttacker].item == ITEM_ENIGMA_BERRY || gBattleMons[gBattlerAttacker].item == ITEM_ENIGMA_BERRY
@ -9755,15 +9774,15 @@ static void Cmd_setweatherballtype(void)
if (gBattleWeather & B_WEATHER_ANY) if (gBattleWeather & B_WEATHER_ANY)
gBattleScripting.dmgMultiplier = 2; gBattleScripting.dmgMultiplier = 2;
if (gBattleWeather & B_WEATHER_RAIN) 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) 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) 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) else if (gBattleWeather & B_WEATHER_HAIL)
*(&gBattleStruct->dynamicMoveType) = TYPE_ICE | F_DYNAMIC_TYPE_2; *(&gBattleStruct->dynamicMoveType) = TYPE_ICE | F_DYNAMIC_TYPE_SET;
else else
*(&gBattleStruct->dynamicMoveType) = TYPE_NORMAL | F_DYNAMIC_TYPE_2; *(&gBattleStruct->dynamicMoveType) = TYPE_NORMAL | F_DYNAMIC_TYPE_SET;
} }
gBattlescriptCurrInstr++; gBattlescriptCurrInstr++;

View File

@ -108,7 +108,7 @@ EWRAM_DATA static u8 *sTrainerBBattleScriptRetAddr = NULL;
EWRAM_DATA static bool8 sShouldCheckTrainerBScript = FALSE; EWRAM_DATA static bool8 sShouldCheckTrainerBScript = FALSE;
EWRAM_DATA static u8 sNoOfPossibleTrainerRetScripts = 0; 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. // Otherwise, the second transition is used.
static const u8 sBattleTransitionTable_Wild[][2] = static const u8 sBattleTransitionTable_Wild[][2] =
{ {
@ -845,7 +845,7 @@ static u8 GetTrainerBattleTransition(void)
return B_TRANSITION_AQUA; return B_TRANSITION_AQUA;
if (gTrainers[gTrainerBattleOpponent_A].doubleBattle == TRUE) 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 else
minPartyCount = 1; minPartyCount = 1;
@ -1248,7 +1248,7 @@ static void SetBattledTrainersFlags(void)
FlagSet(GetTrainerAFlag()); FlagSet(GetTrainerAFlag());
} }
static void SetBattledTrainerFlag(void) static void UNUSED SetBattledTrainerFlag(void)
{ {
FlagSet(GetTrainerAFlag()); FlagSet(GetTrainerAFlag());
} }

View File

@ -309,11 +309,10 @@ static void GenerateInitialRentalMons(void)
i = 0; i = 0;
while (i != PARTY_SIZE) 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; monSetId = Random() % NUM_SLATEPORT_TENT_MONS;
for (j = firstMonId; j < firstMonId + i; j++) for (j = firstMonId; j < firstMonId + i; j++)
{ {
u16 monId = monIds[j];
if (monIds[j] == monSetId) if (monIds[j] == monSetId)
break; break;
if (species[j] == gFacilityTrainerMons[monSetId].species) if (species[j] == gFacilityTrainerMons[monSetId].species)
@ -391,7 +390,7 @@ static void GenerateOpponentMons(void)
{ {
sRandMonId = monSet[Random() % numMons]; 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++) for (j = 0; j < (int)ARRAY_COUNT(gSaveBlock2Ptr->frontier.rentalMons); j++)
{ {
if (gFacilityTrainerMons[sRandMonId].species == gFacilityTrainerMons[gSaveBlock2Ptr->frontier.rentalMons[j].monId].species) if (gFacilityTrainerMons[sRandMonId].species == gFacilityTrainerMons[gSaveBlock2Ptr->frontier.rentalMons[j].monId].species)

View File

@ -1129,8 +1129,7 @@ u16 GetRandomScaledFrontierTrainerId(u8 challengeNum, u8 battleNum)
return trainerId; return trainerId;
} }
// Unused static void UNUSED GetRandomScaledFrontierTrainerIdRange(u8 challengeNum, u8 battleNum, u16 *trainerIdPtr, u8 *rangePtr)
static void GetRandomScaledFrontierTrainerIdRange(u8 challengeNum, u8 battleNum, u16 *trainerIdPtr, u8 *rangePtr)
{ {
u16 trainerId, range; u16 trainerId, range;
@ -1681,8 +1680,8 @@ static void FillTrainerParty(u16 trainerId, u8 firstMonId, u8 monCount)
} }
// Regular battle frontier trainer. // Regular battle frontier trainer.
// Attempt to fill the trainer's party with random Pokemon until 3 have been // 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 pokemon species // successfully chosen. The trainer's party may not have duplicate Pokémon species
// or duplicate held items. // or duplicate held items.
for (bfMonCount = 0; monSet[bfMonCount] != 0xFFFF; bfMonCount++) 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]; 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 // 20 is not a possible value for level here
if ((level == FRONTIER_MAX_LEVEL_50 || level == 20) && monId > FRONTIER_MONS_HIGH_TIER) if ((level == FRONTIER_MAX_LEVEL_50 || level == 20) && monId > FRONTIER_MONS_HIGH_TIER)
continue; 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++) for (j = 0; j < i + firstMonId; j++)
{ {
if (GetMonData(&gEnemyParty[j], MON_DATA_SPECIES, NULL) == gFacilityTrainerMons[monId].species) 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) if (j != i + firstMonId)
continue; 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. // because the species and held items were already checked directly above.
for (j = 0; j < i; j++) for (j = 0; j < i; j++)
{ {
@ -1728,7 +1727,7 @@ static void FillTrainerParty(u16 trainerId, u8 firstMonId, u8 monCount)
chosenMonIndices[i] = monId; 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], CreateMonWithEVSpreadNatureOTID(&gEnemyParty[i + firstMonId],
gFacilityTrainerMons[monId].species, gFacilityTrainerMons[monId].species,
level, level,
@ -1738,7 +1737,7 @@ static void FillTrainerParty(u16 trainerId, u8 firstMonId, u8 monCount)
otID); otID);
friendship = MAX_FRIENDSHIP; 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++) for (j = 0; j < MAX_MON_MOVES; j++)
{ {
SetMonMoveSlot(&gEnemyParty[i + firstMonId], gFacilityTrainerMons[monId].moves[j], 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_FRIENDSHIP, &friendship);
SetMonData(&gEnemyParty[i + firstMonId], MON_DATA_HELD_ITEM, &gBattleFrontierHeldItems[gFacilityTrainerMons[monId].itemTableId]); 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. // the next party slot.
i++; i++;
} }
} }
// Probably an early draft before the 'CreateApprenticeMon' was written. // 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; s32 i, j;
u8 friendship = MAX_FRIENDSHIP; u8 friendship = MAX_FRIENDSHIP;
@ -1805,7 +1804,7 @@ u16 GetRandomFrontierMonFromSet(u16 trainerId)
do 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 // 20 is not a possible value for level here
monId = monSet[Random() % numMons]; monId = monSet[Random() % numMons];
} while((level == FRONTIER_MAX_LEVEL_50 || level == 20) && monId > FRONTIER_MONS_HIGH_TIER); } 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) 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. // By mistake Battle Tower's Level 50 challenge number is used to determine the IVs for Battle Factory.
#ifdef BUGFIX #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; u8 challengeNum = gSaveBlock2Ptr->frontier.factoryWinStreaks[battleMode][lvlMode] / FRONTIER_STAGES_PER_CHALLENGE;
#else #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; u8 challengeNum = gSaveBlock2Ptr->frontier.towerWinStreaks[battleMode][FRONTIER_LVL_50] / FRONTIER_STAGES_PER_CHALLENGE;
#endif #endif
if (gSaveBlock2Ptr->frontier.curChallengeBattleNum < FRONTIER_STAGES_PER_CHALLENGE - 1) if (gSaveBlock2Ptr->frontier.curChallengeBattleNum < FRONTIER_STAGES_PER_CHALLENGE - 1)
@ -2278,7 +2279,7 @@ static void LoadMultiPartnerCandidatesData(void)
u32 lvlMode, battleMode; u32 lvlMode, battleMode;
s32 challengeNum; s32 challengeNum;
u32 species1, species2; u32 species1, species2;
u32 level; u32 UNUSED level;
struct ObjectEventTemplate *objEventTemplates; struct ObjectEventTemplate *objEventTemplates;
objEventTemplates = gSaveBlock1Ptr->objectEventTemplates; 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 // These partners can be an NPC or a former/record-mixed Apprentice
// When talked to, their response consists of: // When talked to, their response consists of:
// PARTNER_MSGID_INTRO - A greeting // PARTNER_MSGID_INTRO - A greeting
// PARTNER_MSGID_MON1 - Naming one pokemon on their team, and a move it has // PARTNER_MSGID_MON1 - Naming one Pokémon 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_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_ACCEPT - If the player agrees to be their partner
// PARTNER_MSGID_REJECT - If the player declines to be their partner // PARTNER_MSGID_REJECT - If the player declines to be their partner
static void ShowPartnerCandidateMessage(void) static void ShowPartnerCandidateMessage(void)
{ {
s32 i, j, partnerId; s32 i, j, partnerId;
s32 monId; s32 monId;
s32 level = SetFacilityPtrsGetLevel(); s32 UNUSED level = SetFacilityPtrsGetLevel();
u16 winStreak = GetCurrentFacilityWinStreak(); u16 winStreak = GetCurrentFacilityWinStreak();
s32 challengeNum = winStreak / FRONTIER_STAGES_PER_CHALLENGE; s32 challengeNum = winStreak / FRONTIER_STAGES_PER_CHALLENGE;
s32 k = gSpecialVar_LastTalked - 2; s32 k = gSpecialVar_LastTalked - 2;
@ -2772,7 +2773,7 @@ static void AwardBattleTowerRibbons(void)
#ifdef BUGFIX #ifdef BUGFIX
struct RibbonCounter ribbons[MAX_FRONTIER_PARTY_SIZE]; struct RibbonCounter ribbons[MAX_FRONTIER_PARTY_SIZE];
#else #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 #endif
u8 ribbonType = 0; u8 ribbonType = 0;
u8 lvlMode = gSaveBlock2Ptr->frontier.lvlMode; 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 // This is a leftover debugging function that is used to populate the E-Reader
// trainer with the player's current data. // trainer with the player's current data.
static void FillEReaderTrainerWithPlayerData(void) static void UNUSED FillEReaderTrainerWithPlayerData(void)
{ {
struct BattleTowerEReaderTrainer *ereaderTrainer = &gSaveBlock2Ptr->frontier.ereaderTrainer; struct BattleTowerEReaderTrainer *ereaderTrainer = &gSaveBlock2Ptr->frontier.ereaderTrainer;
s32 i, j; s32 i, j;
@ -2981,7 +2982,7 @@ static void FillPartnerParty(u16 trainerId)
#ifdef BUGFIX #ifdef BUGFIX
j, j,
#else #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 #endif
OT_ID_PRESET, STEVEN_OTID); OT_ID_PRESET, STEVEN_OTID);
for (j = 0; j < PARTY_SIZE; j++) 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]; 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++) for (j = 0; j < i + firstMonId; j++)
{ {
if (GetMonData(&gEnemyParty[j], MON_DATA_SPECIES, NULL) == gFacilityTrainerMons[monId].species) 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) if (j != i + firstMonId)
continue; 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. // because the species and held items were already checked directly above.
for (j = 0; j < i; j++) for (j = 0; j < i; j++)
{ {
@ -3439,7 +3440,7 @@ static void FillTentTrainerParty_(u16 trainerId, u8 firstMonId, u8 monCount)
chosenMonIndices[i] = monId; 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], CreateMonWithEVSpreadNatureOTID(&gEnemyParty[i + firstMonId],
gFacilityTrainerMons[monId].species, gFacilityTrainerMons[monId].species,
level, level,
@ -3449,7 +3450,7 @@ static void FillTentTrainerParty_(u16 trainerId, u8 firstMonId, u8 monCount)
otID); otID);
friendship = MAX_FRIENDSHIP; 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++) for (j = 0; j < MAX_MON_MOVES; j++)
{ {
SetMonMoveSlot(&gEnemyParty[i + firstMonId], gFacilityTrainerMons[monId].moves[j], 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_FRIENDSHIP, &friendship);
SetMonData(&gEnemyParty[i + firstMonId], MON_DATA_HELD_ITEM, &gBattleFrontierHeldItems[gFacilityTrainerMons[monId].itemTableId]); 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. // the next party slot.
i++; i++;
} }

View File

@ -779,7 +779,7 @@ static const TransitionStateFunc sTransitionIntroFuncs[] =
static const struct SpriteFrameImage sSpriteImage_Pokeball[] = static const struct SpriteFrameImage sSpriteImage_Pokeball[] =
{ {
sPokeball_Gfx, sizeof(sPokeball_Gfx) {sPokeball_Gfx, sizeof(sPokeball_Gfx)}
}; };
static const union AnimCmd sSpriteAnim_Pokeball[] = static const union AnimCmd sSpriteAnim_Pokeball[] =
@ -841,12 +841,12 @@ static const struct OamData sOam_UnusedBrendanLass =
static const struct SpriteFrameImage sImageTable_UnusedBrendan[] = static const struct SpriteFrameImage sImageTable_UnusedBrendan[] =
{ {
sUnusedBrendan_Gfx, sizeof(sUnusedBrendan_Gfx) {sUnusedBrendan_Gfx, sizeof(sUnusedBrendan_Gfx)}
}; };
static const struct SpriteFrameImage sImageTable_UnusedLass[] = static const struct SpriteFrameImage sImageTable_UnusedLass[] =
{ {
sUnusedLass_Gfx, sizeof(sUnusedLass_Gfx) {sUnusedLass_Gfx, sizeof(sUnusedLass_Gfx)}
}; };
static const union AnimCmd sSpriteAnim_UnusedBrendanLass[] = static const union AnimCmd sSpriteAnim_UnusedBrendanLass[] =
@ -1017,8 +1017,7 @@ static void CB2_TestBattleTransition(void)
UpdatePaletteFade(); UpdatePaletteFade();
} }
// Unused static void UNUSED TestBattleTransition(u8 transitionId)
static void TestBattleTransition(u8 transitionId)
{ {
sTestingTransitionId = transitionId; sTestingTransitionId = transitionId;
SetMainCallback2(CB2_TestBattleTransition); SetMainCallback2(CB2_TestBattleTransition);

View File

@ -526,7 +526,7 @@ static const u16 *const sPointsArray[] =
}; };
// Points will always be calculated for these messages // 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[] = static const u16 sSpecialBattleStrings[] =
{ {
STRINGID_PKMNPERISHCOUNTFELL, STRINGID_PKMNWISHCAMETRUE, STRINGID_PKMNLOSTPPGRUDGE, STRINGID_PKMNPERISHCOUNTFELL, STRINGID_PKMNWISHCAMETRUE, STRINGID_PKMNLOSTPPGRUDGE,

View File

@ -649,7 +649,7 @@ void HandleAction_NothingIsFainted(void)
gCurrentTurnActionNumber++; gCurrentTurnActionNumber++;
gCurrentActionFuncId = gActionsByTurnOrder[gCurrentTurnActionNumber]; gCurrentActionFuncId = gActionsByTurnOrder[gCurrentTurnActionNumber];
gHitMarker &= ~(HITMARKER_DESTINYBOND | HITMARKER_IGNORE_SUBSTITUTE | HITMARKER_ATTACKSTRING_PRINTED 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_IGNORE_UNDERGROUND | HITMARKER_IGNORE_UNDERWATER | HITMARKER_PASSIVE_DAMAGE
| HITMARKER_OBEYS | HITMARKER_WAKE_UP_CLEAR | HITMARKER_SYNCHRONISE_EFFECT | HITMARKER_OBEYS | HITMARKER_WAKE_UP_CLEAR | HITMARKER_SYNCHRONISE_EFFECT
| HITMARKER_CHARGING | HITMARKER_NEVER_SET); | HITMARKER_CHARGING | HITMARKER_NEVER_SET);
@ -662,7 +662,7 @@ void HandleAction_ActionFinished(void)
gCurrentActionFuncId = gActionsByTurnOrder[gCurrentTurnActionNumber]; gCurrentActionFuncId = gActionsByTurnOrder[gCurrentTurnActionNumber];
SpecialStatusesClear(); SpecialStatusesClear();
gHitMarker &= ~(HITMARKER_DESTINYBOND | HITMARKER_IGNORE_SUBSTITUTE | HITMARKER_ATTACKSTRING_PRINTED 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_IGNORE_UNDERGROUND | HITMARKER_IGNORE_UNDERWATER | HITMARKER_PASSIVE_DAMAGE
| HITMARKER_OBEYS | HITMARKER_WAKE_UP_CLEAR | HITMARKER_SYNCHRONISE_EFFECT | HITMARKER_OBEYS | HITMARKER_WAKE_UP_CLEAR | HITMARKER_SYNCHRONISE_EFFECT
| HITMARKER_CHARGING | HITMARKER_NEVER_SET); | HITMARKER_CHARGING | HITMARKER_NEVER_SET);
@ -827,8 +827,7 @@ void PressurePPLoseOnUsingPerishSong(u8 attacker)
} }
} }
// Unused static void UNUSED MarkAllBattlersForControllerExec(void)
static void MarkAllBattlersForControllerExec(void)
{ {
int i; int i;
@ -1449,7 +1448,7 @@ u8 DoBattlerEndTurnEffects(void)
{ {
u8 effect = 0; 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) while (gBattleStruct->turnEffectsBattlerId < gBattlersCount && gBattleStruct->turnEffectsTracker <= ENDTURN_BATTLER_COUNT)
{ {
gActiveBattler = gBattlerAttacker = gBattlerByTurnOrder[gBattleStruct->turnEffectsBattlerId]; gActiveBattler = gBattlerAttacker = gBattlerByTurnOrder[gBattleStruct->turnEffectsBattlerId];
@ -1546,7 +1545,7 @@ u8 DoBattlerEndTurnEffects(void)
if ((gBattleMons[gActiveBattler].status2 & STATUS2_NIGHTMARE) && gBattleMons[gActiveBattler].hp != 0) if ((gBattleMons[gActiveBattler].status2 & STATUS2_NIGHTMARE) && gBattleMons[gActiveBattler].hp != 0)
{ {
// R/S does not perform this sleep check, which causes the nightmare effect to // 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) if (gBattleMons[gActiveBattler].status1 & STATUS1_SLEEP)
{ {
gBattleMoveDamage = gBattleMons[gActiveBattler].maxHP / 4; gBattleMoveDamage = gBattleMons[gActiveBattler].maxHP / 4;
@ -1626,7 +1625,7 @@ u8 DoBattlerEndTurnEffects(void)
} }
if (gBattlerAttacker != gBattlersCount) if (gBattlerAttacker != gBattlersCount)
{ {
effect = 2; // a pokemon was awaken effect = 2; // a Pokémon was awaken
break; break;
} }
else else
@ -1686,7 +1685,7 @@ u8 DoBattlerEndTurnEffects(void)
if (gDisableStructs[gActiveBattler].disabledMove == gBattleMons[gActiveBattler].moves[i]) if (gDisableStructs[gActiveBattler].disabledMove == gBattleMons[gActiveBattler].moves[i])
break; 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].disabledMove = MOVE_NONE;
gDisableStructs[gActiveBattler].disableTimer = 0; gDisableStructs[gActiveBattler].disableTimer = 0;
@ -1703,7 +1702,7 @@ u8 DoBattlerEndTurnEffects(void)
case ENDTURN_ENCORE: // encore case ENDTURN_ENCORE: // encore
if (gDisableStructs[gActiveBattler].encoreTimer != 0) 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].encoredMove = MOVE_NONE;
gDisableStructs[gActiveBattler].encoreTimer = 0; gDisableStructs[gActiveBattler].encoreTimer = 0;
@ -1762,13 +1761,13 @@ u8 DoBattlerEndTurnEffects(void)
return effect; return effect;
} }
} }
gHitMarker &= ~(HITMARKER_GRUDGE | HITMARKER_SKIP_DMG_TRACK); gHitMarker &= ~(HITMARKER_GRUDGE | HITMARKER_IGNORE_BIDE);
return 0; return 0;
} }
bool8 HandleWishPerishSongOnTurnEnd(void) bool8 HandleWishPerishSongOnTurnEnd(void)
{ {
gHitMarker |= (HITMARKER_GRUDGE | HITMARKER_SKIP_DMG_TRACK); gHitMarker |= (HITMARKER_GRUDGE | HITMARKER_IGNORE_BIDE);
switch (gBattleStruct->wishPerishSongState) switch (gBattleStruct->wishPerishSongState)
{ {
@ -1797,7 +1796,7 @@ bool8 HandleWishPerishSongOnTurnEnd(void)
gBattlerTarget = gActiveBattler; gBattlerTarget = gActiveBattler;
gBattlerAttacker = gWishFutureKnock.futureSightAttacker[gActiveBattler]; gBattlerAttacker = gWishFutureKnock.futureSightAttacker[gActiveBattler];
gBattleMoveDamage = gWishFutureKnock.futureSightDmg[gActiveBattler]; gBattleMoveDamage = gWishFutureKnock.futureSightDmg[gActiveBattler];
gSpecialStatuses[gBattlerTarget].dmg = 0xFFFF; gSpecialStatuses[gBattlerTarget].shellBellDmg = IGNORE_SHELL_BELL;
BattleScriptExecute(BattleScript_MonTookFutureAttack); BattleScriptExecute(BattleScript_MonTookFutureAttack);
if (gWishFutureKnock.futureSightCounter[gActiveBattler] == 0 if (gWishFutureKnock.futureSightCounter[gActiveBattler] == 0
@ -1868,7 +1867,7 @@ bool8 HandleWishPerishSongOnTurnEnd(void)
break; break;
} }
gHitMarker &= ~(HITMARKER_GRUDGE | HITMARKER_SKIP_DMG_TRACK); gHitMarker &= ~(HITMARKER_GRUDGE | HITMARKER_IGNORE_BIDE);
return FALSE; return FALSE;
} }
@ -2213,11 +2212,11 @@ u8 AtkCanceller_UnableToUseMove(void)
{ {
// This is removed in FRLG and Emerald for some reason // This is removed in FRLG and Emerald for some reason
//gBattleMons[gBattlerAttacker].status2 &= ~STATUS2_MULTIPLETURNS; //gBattleMons[gBattlerAttacker].status2 &= ~STATUS2_MULTIPLETURNS;
if (gTakenDmg[gBattlerAttacker]) if (gBideDmg[gBattlerAttacker])
{ {
gCurrentMove = MOVE_BIDE; gCurrentMove = MOVE_BIDE;
*bideDmg = gTakenDmg[gBattlerAttacker] * 2; *bideDmg = gBideDmg[gBattlerAttacker] * 2;
gBattlerTarget = gTakenDmgByBattler[gBattlerAttacker]; gBattlerTarget = gBideTarget[gBattlerAttacker];
if (gAbsentBattlerFlags & gBitTable[gBattlerTarget]) if (gAbsentBattlerFlags & gBitTable[gBattlerTarget])
gBattlerTarget = GetMoveTarget(MOVE_BIDE, MOVE_TARGET_SELECTED + 1); gBattlerTarget = GetMoveTarget(MOVE_BIDE, MOVE_TARGET_SELECTED + 1);
gBattlescriptCurrInstr = BattleScript_BideAttack; 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; gBattleCommunication[MOVE_EFFECT_BYTE] += MOVE_EFFECT_AFFECTS_USER;
BattleScriptPushCursor(); BattleScriptPushCursor();
gBattlescriptCurrInstr = BattleScript_ApplySecondaryEffect; gBattlescriptCurrInstr = BattleScript_ApplySecondaryEffect;
gHitMarker |= HITMARKER_IGNORE_SAFEGUARD; gHitMarker |= HITMARKER_STATUS_ABILITY_EFFECT;
effect++; effect++;
} }
break; 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; gBattleCommunication[MOVE_EFFECT_BYTE] = MOVE_EFFECT_AFFECTS_USER | MOVE_EFFECT_POISON;
BattleScriptPushCursor(); BattleScriptPushCursor();
gBattlescriptCurrInstr = BattleScript_ApplySecondaryEffect; gBattlescriptCurrInstr = BattleScript_ApplySecondaryEffect;
gHitMarker |= HITMARKER_IGNORE_SAFEGUARD; gHitMarker |= HITMARKER_STATUS_ABILITY_EFFECT;
effect++; effect++;
} }
break; 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; gBattleCommunication[MOVE_EFFECT_BYTE] = MOVE_EFFECT_AFFECTS_USER | MOVE_EFFECT_PARALYSIS;
BattleScriptPushCursor(); BattleScriptPushCursor();
gBattlescriptCurrInstr = BattleScript_ApplySecondaryEffect; gBattlescriptCurrInstr = BattleScript_ApplySecondaryEffect;
gHitMarker |= HITMARKER_IGNORE_SAFEGUARD; gHitMarker |= HITMARKER_STATUS_ABILITY_EFFECT;
effect++; effect++;
} }
break; 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; gBattleCommunication[MOVE_EFFECT_BYTE] = MOVE_EFFECT_AFFECTS_USER | MOVE_EFFECT_BURN;
BattleScriptPushCursor(); BattleScriptPushCursor();
gBattlescriptCurrInstr = BattleScript_ApplySecondaryEffect; gBattlescriptCurrInstr = BattleScript_ApplySecondaryEffect;
gHitMarker |= HITMARKER_IGNORE_SAFEGUARD; gHitMarker |= HITMARKER_STATUS_ABILITY_EFFECT;
effect++; effect++;
} }
break; break;
@ -2964,7 +2963,7 @@ u8 AbilityBattleEffects(u8 caseID, u8 battler, u8 ability, u8 special, u16 moveA
gBattleScripting.battler = gBattlerTarget; gBattleScripting.battler = gBattlerTarget;
BattleScriptPushCursor(); BattleScriptPushCursor();
gBattlescriptCurrInstr = BattleScript_SynchronizeActivates; gBattlescriptCurrInstr = BattleScript_SynchronizeActivates;
gHitMarker |= HITMARKER_IGNORE_SAFEGUARD; gHitMarker |= HITMARKER_STATUS_ABILITY_EFFECT;
effect++; effect++;
} }
break; break;
@ -2980,7 +2979,7 @@ u8 AbilityBattleEffects(u8 caseID, u8 battler, u8 ability, u8 special, u16 moveA
gBattleScripting.battler = gBattlerAttacker; gBattleScripting.battler = gBattlerAttacker;
BattleScriptPushCursor(); BattleScriptPushCursor();
gBattlescriptCurrInstr = BattleScript_SynchronizeActivates; gBattlescriptCurrInstr = BattleScript_SynchronizeActivates;
gHitMarker |= HITMARKER_IGNORE_SAFEGUARD; gHitMarker |= HITMARKER_STATUS_ABILITY_EFFECT;
effect++; effect++;
} }
break; 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)) if (gBattleMons[i].ability == ABILITY_TRACE && (gStatuses3[i] & STATUS3_TRACE))
{ {
u8 target2; 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); target1 = GetBattlerAtPosition(side);
target2 = GetBattlerAtPosition(side + BIT_FLANK); target2 = GetBattlerAtPosition(side + BIT_FLANK);
if (gBattleTypeFlags & BATTLE_TYPE_DOUBLE) if (gBattleTypeFlags & BATTLE_TYPE_DOUBLE)
@ -3243,8 +3242,8 @@ u8 ItemBattleEffects(u8 caseID, u8 battlerId, bool8 moveTurn)
int i = 0; int i = 0;
u8 effect = ITEM_NO_EFFECT; u8 effect = ITEM_NO_EFFECT;
u8 changedPP = 0; u8 changedPP = 0;
u8 battlerHoldEffect, atkHoldEffect, defHoldEffect; u8 battlerHoldEffect, atkHoldEffect, UNUSED defHoldEffect;
u8 battlerHoldEffectParam, atkHoldEffectParam, defHoldEffectParam; u8 battlerHoldEffectParam, atkHoldEffectParam, UNUSED defHoldEffectParam;
u16 atkItem, defItem; u16 atkItem, defItem;
gLastUsedItem = gBattleMons[battlerId].item; gLastUsedItem = gBattleMons[battlerId].item;
@ -3770,8 +3769,8 @@ u8 ItemBattleEffects(u8 caseID, u8 battlerId, bool8 moveTurn)
break; break;
case HOLD_EFFECT_SHELL_BELL: case HOLD_EFFECT_SHELL_BELL:
if (!(gMoveResultFlags & MOVE_RESULT_NO_EFFECT) if (!(gMoveResultFlags & MOVE_RESULT_NO_EFFECT)
&& gSpecialStatuses[gBattlerTarget].dmg != 0 && gSpecialStatuses[gBattlerTarget].shellBellDmg != 0
&& gSpecialStatuses[gBattlerTarget].dmg != 0xFFFF && gSpecialStatuses[gBattlerTarget].shellBellDmg != IGNORE_SHELL_BELL
&& gBattlerAttacker != gBattlerTarget && gBattlerAttacker != gBattlerTarget
&& gBattleMons[gBattlerAttacker].hp != gBattleMons[gBattlerAttacker].maxHP && gBattleMons[gBattlerAttacker].hp != gBattleMons[gBattlerAttacker].maxHP
&& gBattleMons[gBattlerAttacker].hp != 0) && gBattleMons[gBattlerAttacker].hp != 0)
@ -3779,10 +3778,10 @@ u8 ItemBattleEffects(u8 caseID, u8 battlerId, bool8 moveTurn)
gLastUsedItem = atkItem; gLastUsedItem = atkItem;
gPotentialItemEffectBattler = gBattlerAttacker; gPotentialItemEffectBattler = gBattlerAttacker;
gBattleScripting.battler = gBattlerAttacker; gBattleScripting.battler = gBattlerAttacker;
gBattleMoveDamage = (gSpecialStatuses[gBattlerTarget].dmg / atkHoldEffectParam) * -1; gBattleMoveDamage = (gSpecialStatuses[gBattlerTarget].shellBellDmg / atkHoldEffectParam) * -1;
if (gBattleMoveDamage == 0) if (gBattleMoveDamage == 0)
gBattleMoveDamage = -1; gBattleMoveDamage = -1;
gSpecialStatuses[gBattlerTarget].dmg = 0; gSpecialStatuses[gBattlerTarget].shellBellDmg = 0;
BattleScriptPushCursor(); BattleScriptPushCursor();
gBattlescriptCurrInstr = BattleScript_ItemHealHP_Ret; gBattlescriptCurrInstr = BattleScript_ItemHealHP_Ret;
effect++; effect++;

View File

@ -2377,8 +2377,7 @@ static void Debug_SetMaxRPMStage(s16 value)
sDebug_MaxRPMStage = value; sDebug_MaxRPMStage = value;
} }
// Unused static s16 UNUSED Debug_GetMaxRPMStage(void)
static s16 Debug_GetMaxRPMStage(void)
{ {
return sDebug_MaxRPMStage; return sDebug_MaxRPMStage;
} }
@ -2388,8 +2387,7 @@ static void Debug_SetGameTimeStage(s16 value)
sDebug_GameTimeStage = value; sDebug_GameTimeStage = value;
} }
// Unued static s16 UNUSED Debug_GetGameTimeStage(void)
static s16 Debug_GetGameTimeStage(void)
{ {
return sDebug_GameTimeStage; return sDebug_GameTimeStage;
} }
@ -2501,8 +2499,7 @@ static void CalculatePokeblock(struct BlenderBerry *berries, struct Pokeblock *p
flavors[i] = sPokeblockFlavors[i]; flavors[i] = sPokeblockFlavors[i];
} }
// Unused static void UNUSED Debug_CalculatePokeblock(struct BlenderBerry* berries, struct Pokeblock* pokeblock, u8 numPlayers, u8 *flavors, u16 maxRPM)
static void Debug_CalculatePokeblock(struct BlenderBerry* berries, struct Pokeblock* pokeblock, u8 numPlayers, u8 *flavors, u16 maxRPM)
{ {
CalculatePokeblock(berries, pokeblock, numPlayers, flavors, maxRPM); CalculatePokeblock(berries, pokeblock, numPlayers, flavors, maxRPM);
} }
@ -3471,7 +3468,7 @@ static bool8 PrintBlendingResults(void)
struct Pokeblock pokeblock; struct Pokeblock pokeblock;
u8 flavors[FLAVOR_COUNT + 1]; u8 flavors[FLAVOR_COUNT + 1];
u8 text[40]; u8 text[40];
u16 berryIds[4]; // unused u16 UNUSED berryIds[4];
switch (sBerryBlender->mainState) switch (sBerryBlender->mainState)
{ {
@ -3866,6 +3863,9 @@ static void Blender_AddTextPrinter(u8 windowId, const u8 *string, u8 x, u8 y, s3
{ {
case 0: case 0:
case 3: case 3:
#ifdef UBFIX
default:
#endif
txtColor[0] = TEXT_COLOR_WHITE; txtColor[0] = TEXT_COLOR_WHITE;
txtColor[1] = TEXT_COLOR_DARK_GRAY; txtColor[1] = TEXT_COLOR_DARK_GRAY;
txtColor[2] = TEXT_COLOR_LIGHT_GRAY; txtColor[2] = TEXT_COLOR_LIGHT_GRAY;

View File

@ -1062,7 +1062,7 @@ static void BerryCrush_SetVBlankCB(void)
SetVBlankCallback(VBlankCB); SetVBlankCallback(VBlankCB);
} }
static void BerryCrush_InitVBlankCB(void) static void UNUSED BerryCrush_InitVBlankCB(void)
{ {
SetVBlankCallback(NULL); SetVBlankCallback(NULL);
} }

View File

@ -34,8 +34,8 @@ static const struct {
} }
}; };
// Unused. See berry_fix_program.c // See berry_fix_program.c
static void LoadBerryFixGraphics(u32 idx) static void UNUSED LoadBerryFixGraphics(u32 idx)
{ {
REG_DISPCNT = 0; REG_DISPCNT = 0;
REG_BG0HOFS = 0; REG_BG0HOFS = 0;

View File

@ -15,8 +15,7 @@
static EWRAM_DATA u8 sBerryPowderVendorWindowId = 0; static EWRAM_DATA u8 sBerryPowderVendorWindowId = 0;
// Unused static const struct BgTemplate UNUSED sBerryPowderBgTemplates[] =
static const struct BgTemplate sBerryPowderBgTemplates[] =
{ {
{ {
.bg = 0, .bg = 0,
@ -57,10 +56,9 @@ static const struct BgTemplate sBerryPowderBgTemplates[] =
}; };
// ? Part of the BG templates? // ? Part of the BG templates?
static const u32 sUnknown[] = {0xFF, 0x00}; static const u32 UNUSED sUnknown[] = {0xFF, 0x00};
// Unused static const struct WindowTemplate UNUSED sBerryPowderWindowTemplates[] =
static const struct WindowTemplate sBerryPowderWindowTemplates[] =
{ {
{ {
.bg = 0, .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; u32 *powder = &gSaveBlock2Ptr->berryCrush.berryPowderAmount;
if (!HasEnoughBerryPowder_(cost)) if (!HasEnoughBerryPowder_(cost))

View File

@ -20,7 +20,7 @@ bool16 ScriptGetPokedexInfo(void)
return IsNationalPokedexEnabled(); 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) const u8 *GetPokedexRatingText(u16 count)
{ {
if (count < 10) if (count < 10)

View File

@ -259,7 +259,7 @@ static void DoBrailleRegisteelEffect(void)
} }
// theory: another commented out DoBrailleWait and Task_BrailleWait. // theory: another commented out DoBrailleWait and Task_BrailleWait.
static void DoBrailleWait(void) static void UNUSED DoBrailleWait(void)
{ {
} }

View File

@ -195,8 +195,7 @@ static bool32 CheckSioErrored(u8 taskId)
return FALSE; return FALSE;
} }
// Unused static void UNUSED Task_DelayedBlockRequest(u8 taskId)
static void Task_DelayedBlockRequest(u8 taskId)
{ {
gTasks[taskId].data[0]++; gTasks[taskId].data[0]++;
if (gTasks[taskId].data[0] == 10) if (gTasks[taskId].data[0] == 10)
@ -1166,14 +1165,13 @@ void PlayerEnteredTradeSeat(void)
CreateTask_EnterCableClubSeat(Task_StartWiredTrade); CreateTask_EnterCableClubSeat(Task_StartWiredTrade);
} }
// Unused static void UNUSED CreateTask_StartWiredTrade(void)
static void CreateTask_StartWiredTrade(void)
{ {
CreateTask(Task_StartWiredTrade, 80); CreateTask(Task_StartWiredTrade, 80);
} }
// Unused, implemented in Ruby/Sapphire // Implemented in Ruby/Sapphire
void Script_StartWiredTrade(void) void UNUSED Script_StartWiredTrade(void)
{ {
// CreateTask_StartWiredTrade(); // CreateTask_StartWiredTrade();
// ScriptContext_Stop(); // ScriptContext_Stop();
@ -1189,10 +1187,9 @@ void ColosseumPlayerSpotTriggered(void)
CreateTask_EnterCableClubSeat(Task_StartWiredCableClubBattle); CreateTask_EnterCableClubSeat(Task_StartWiredCableClubBattle);
} }
// Unused static UNUSED void CreateTask_EnterCableClubSeatNoFollowup(void)
static void CreateTask_EnterCableClubSeatNoFollowup(void)
{ {
u8 taskId = CreateTask(Task_EnterCableClubSeat, 80); u8 UNUSED taskId = CreateTask(Task_EnterCableClubSeat, 80);
ScriptContext_Stop(); ScriptContext_Stop();
} }
@ -1262,8 +1259,7 @@ static void Task_WaitExitToScript(u8 taskId)
} }
} }
// Unused static void UNUSED ExitLinkToScript(u8 taskId)
static void ExitLinkToScript(u8 taskId)
{ {
SetCloseLinkCallback(); SetCloseLinkCallback();
gTasks[taskId].func = Task_WaitExitToScript; gTasks[taskId].func = Task_WaitExitToScript;

View File

@ -194,7 +194,7 @@ static void SwapMoveDescAndContestTilemaps(void);
#define CONTESTANT_TEXT_COLOR_START 10 #define CONTESTANT_TEXT_COLOR_START 10
enum { enum {
// The "{Pokemon Name} / {Trainer Name}" windows. // The "{Pokémon Name} / {Trainer Name}" windows.
WIN_CONTESTANT0_NAME, WIN_CONTESTANT0_NAME,
WIN_CONTESTANT1_NAME, WIN_CONTESTANT1_NAME,
WIN_CONTESTANT2_NAME, WIN_CONTESTANT2_NAME,
@ -3251,8 +3251,7 @@ static void DrawMoveEffectSymbol(u16 move, u8 contestant)
} }
} }
// Unused static void UNUSED DrawMoveEffectSymbols(void)
static void DrawMoveEffectSymbols(void)
{ {
s32 i; s32 i;
@ -3435,11 +3434,11 @@ static void RankContestants(void)
// For each contestant, find the best rank with their point total. // For each contestant, find the best rank with their point total.
// Normally, each point total is different, and this will output the // 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. // both get the best rank for that point total.
// //
// For example if the point totals are [100, 80, 80, 50], the ranks will // 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' // when they see the first 80 in the array, so they both share the '2'
// rank. // rank.
for (i = 0; i < CONTESTANT_COUNT; i++) for (i = 0; i < CONTESTANT_COUNT; i++)
@ -4221,8 +4220,7 @@ static void SpriteCB_EndBlinkContestantBox(struct Sprite *sprite)
ResetBlendForContestantBoxBlink(); ResetBlendForContestantBoxBlink();
} }
// Unused. static void UNUSED ContestDebugTogglePointTotal(void)
static void ContestDebugTogglePointTotal(void)
{ {
if(eContestDebugMode == CONTEST_DEBUG_MODE_PRINT_POINT_TOTAL) if(eContestDebugMode == CONTEST_DEBUG_MODE_PRINT_POINT_TOTAL)
eContestDebugMode = CONTEST_DEBUG_MODE_OFF; eContestDebugMode = CONTEST_DEBUG_MODE_OFF;
@ -4592,10 +4590,10 @@ void MakeContestantNervous(u8 p)
// ContestantStatus::nextTurnOrder field of each contestant. The remaining // ContestantStatus::nextTurnOrder field of each contestant. The remaining
// turns are assigned such that the turn order will reverse. // 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. // 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. // nextTurnOrder value.
static void ApplyNextTurnOrder(void) static void ApplyNextTurnOrder(void)
{ {
@ -4876,15 +4874,13 @@ static void Task_ShowAndUpdateApplauseMeter(u8 taskId)
} }
} }
// Unused. static void UNUSED HideApplauseMeterNoAnim(void)
static void HideApplauseMeterNoAnim(void)
{ {
gSprites[eContest.applauseMeterSpriteId].x2 = 0; gSprites[eContest.applauseMeterSpriteId].x2 = 0;
gSprites[eContest.applauseMeterSpriteId].invisible = FALSE; gSprites[eContest.applauseMeterSpriteId].invisible = FALSE;
} }
// Unused. static void UNUSED ShowApplauseMeterNoAnim(void)
static void ShowApplauseMeterNoAnim(void)
{ {
gSprites[eContest.applauseMeterSpriteId].invisible = TRUE; gSprites[eContest.applauseMeterSpriteId].invisible = TRUE;
} }

View File

@ -63,12 +63,12 @@ enum {
struct CreditsData 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 imgCounter; //how many mon images have been shown
u16 nextImgPos; //if the next image spawns left/center/right u16 nextImgPos; //if the next image spawns left/center/right
u16 currShownMon; //index into monToShow u16 currShownMon; //index into monToShow
u16 numMonToShow; //number of pokemon to show, always NUM_MON_SLIDES after determine function 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 pokemon 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 numCaughtMon; //count of filled spaces in caughtMonIds
u16 unused[7]; u16 unused[7];
}; };
@ -80,7 +80,7 @@ struct CreditsEntry
const u8 *text; 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; static EWRAM_DATA u16 sSavedTaskId = 0;
EWRAM_DATA bool8 gHasHallOfFameRecords = 0; EWRAM_DATA bool8 gHasHallOfFameRecords = 0;
static EWRAM_DATA bool8 sUsedSpeedUp = 0; // Never read static EWRAM_DATA bool8 sUsedSpeedUp = 0; // Never read
@ -1555,8 +1555,8 @@ static void DeterminePokemonToShow(void)
u16 dexNum; u16 dexNum;
u16 j; u16 j;
// Go through the Pokedex, and anything that has gotten caught we put into our massive 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 pokemon into the front of the 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++) for (dexNum = 1, j = 0; dexNum < NATIONAL_DEX_COUNT; dexNum++)
{ {
if (GetSetPokedexFlag(dexNum, FLAG_GET_CAUGHT)) if (GetSetPokedexFlag(dexNum, FLAG_GET_CAUGHT))
@ -1570,14 +1570,14 @@ static void DeterminePokemonToShow(void)
for (dexNum = j; dexNum < NATIONAL_DEX_COUNT; dexNum++) for (dexNum = j; dexNum < NATIONAL_DEX_COUNT; dexNum++)
sCreditsData->caughtMonIds[dexNum] = NATIONAL_DEX_NONE; 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; sCreditsData->numCaughtMon = j;
if (sCreditsData->numCaughtMon < NUM_MON_SLIDES) if (sCreditsData->numCaughtMon < NUM_MON_SLIDES)
sCreditsData->numMonToShow = j; sCreditsData->numMonToShow = j;
else else
sCreditsData->numMonToShow = NUM_MON_SLIDES; 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; j = 0;
do do
{ {
@ -1598,7 +1598,7 @@ static void DeterminePokemonToShow(void)
} }
while (sCreditsData->numCaughtMon != 0 && j < NUM_MON_SLIDES); 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) if (sCreditsData->numMonToShow < NUM_MON_SLIDES)
{ {
for (j = sCreditsData->numMonToShow, page = 0; j < NUM_MON_SLIDES; j++) for (j = sCreditsData->numMonToShow, page = 0; j < NUM_MON_SLIDES; j++)
@ -1609,7 +1609,7 @@ static void DeterminePokemonToShow(void)
if (page == sCreditsData->numMonToShow) if (page == sCreditsData->numMonToShow)
page = 0; page = 0;
} }
// Ensure the last pokemon is our starter // Ensure the last Pokémon is our starter
sCreditsData->monToShow[NUM_MON_SLIDES - 1] = starter; sCreditsData->monToShow[NUM_MON_SLIDES - 1] = starter;
} }
else 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 // 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++); 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) if (dexNum < sCreditsData->numMonToShow - 1)
{ {
sCreditsData->monToShow[dexNum] = sCreditsData->monToShow[NUM_MON_SLIDES-1]; sCreditsData->monToShow[dexNum] = sCreditsData->monToShow[NUM_MON_SLIDES-1];
@ -1625,7 +1625,7 @@ static void DeterminePokemonToShow(void)
} }
else else
{ {
// Ensure the last pokemon is our starter // Ensure the last Pokémon is our starter
sCreditsData->monToShow[NUM_MON_SLIDES - 1] = starter; sCreditsData->monToShow[NUM_MON_SLIDES - 1] = starter;
} }
} }

Some files were not shown because too many files have changed in this diff Show More