Merge branch 'master' of github.com:pret/pokeemerald into pokemon_expansion_sync

This commit is contained in:
ultima-soul 2021-01-28 23:59:08 -08:00
commit 96232ea166
176 changed files with 6429 additions and 5874 deletions

View File

@ -1 +1 @@
gUnknown_030062E8 gFactorySelect_CurrentOptionFunc

View File

@ -1,6 +1,7 @@
.equiv ID_NUMBER, 0x68736d53 .equiv ID_NUMBER, 0x68736d53
.equiv PCM_DMA_BUF_SIZE, 1584 .equiv PCM_DMA_BUF_SIZE, 1584
.equiv MAX_DIRECTSOUND_CHANNELS, 12
.equiv C_V, 0x40 .equiv C_V, 0x40
@ -93,7 +94,7 @@
struct_field o_SoundInfo_plynote, 4 struct_field o_SoundInfo_plynote, 4
struct_field o_SoundInfo_ExtVolPit, 4 struct_field o_SoundInfo_ExtVolPit, 4
struct_field o_SoundInfo_gap2, 16 struct_field o_SoundInfo_gap2, 16
struct_field o_SoundInfo_chans, 768 struct_field o_SoundInfo_chans, MAX_DIRECTSOUND_CHANNELS * 64
struct_field o_SoundInfo_pcmBuffer, PCM_DMA_BUF_SIZE * 2 struct_field o_SoundInfo_pcmBuffer, PCM_DMA_BUF_SIZE * 2
struct_field SoundInfo_size, 0 struct_field SoundInfo_size, 0

View File

@ -462,18 +462,18 @@ AI_CBM_Attract: @ 82DC5F5
get_ability AI_TARGET get_ability AI_TARGET
if_equal ABILITY_OBLIVIOUS, Score_Minus10 if_equal ABILITY_OBLIVIOUS, Score_Minus10
get_gender AI_USER get_gender AI_USER
if_equal 0, AI_CBM_Attract_CheckIfTargetIsFemale if_equal MON_MALE, AI_CBM_Attract_CheckIfTargetIsFemale
if_equal 254, AI_CBM_Attract_CheckIfTargetIsMale if_equal MON_FEMALE, AI_CBM_Attract_CheckIfTargetIsMale
goto Score_Minus10 goto Score_Minus10
AI_CBM_Attract_CheckIfTargetIsFemale: @ 82DC61A AI_CBM_Attract_CheckIfTargetIsFemale: @ 82DC61A
get_gender AI_TARGET get_gender AI_TARGET
if_equal 254, AI_CBM_Attract_End if_equal MON_FEMALE, AI_CBM_Attract_End
goto Score_Minus10 goto Score_Minus10
AI_CBM_Attract_CheckIfTargetIsMale: @ 82DC627 AI_CBM_Attract_CheckIfTargetIsMale: @ 82DC627
get_gender AI_TARGET get_gender AI_TARGET
if_equal 0, AI_CBM_Attract_End if_equal MON_MALE, AI_CBM_Attract_End
goto Score_Minus10 goto Score_Minus10
AI_CBM_Attract_End: @ 82DC634 AI_CBM_Attract_End: @ 82DC634
@ -2057,12 +2057,22 @@ AI_CV_Protect_ScoreDown2:
AI_CV_Protect_End: AI_CV_Protect_End:
end end
@ BUG: Foresight is only encouraged if the user is Ghost type or
@ has high evasion, but should check target instead
AI_CV_Foresight: AI_CV_Foresight:
.ifdef BUGFIX
get_target_type1
if_equal TYPE_GHOST, AI_CV_Foresight2
get_target_type2
if_equal TYPE_GHOST, AI_CV_Foresight2
if_stat_level_more_than AI_TARGET, STAT_EVASION, 8, AI_CV_Foresight3
.else
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
score -2 score -2
goto AI_CV_Foresight_End goto AI_CV_Foresight_End
@ -2329,13 +2339,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:
@ -2404,11 +2414,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

View File

@ -374,41 +374,41 @@ gBattleAnims_Moves::
.align 2 .align 2
gBattleAnims_StatusConditions:: gBattleAnims_StatusConditions::
.4byte Status_Poison .4byte Status_Poison @ B_ANIM_STATUS_PSN
.4byte Status_Confusion .4byte Status_Confusion @ B_ANIM_STATUS_CONFUSION
.4byte Status_Burn .4byte Status_Burn @ B_ANIM_STATUS_BRN
.4byte Status_Infatuation .4byte Status_Infatuation @ B_ANIM_STATUS_INFATUATION
.4byte Status_Sleep .4byte Status_Sleep @ B_ANIM_STATUS_SLP
.4byte Status_Paralysis .4byte Status_Paralysis @ B_ANIM_STATUS_PRZ
.4byte Status_Freeze .4byte Status_Freeze @ B_ANIM_STATUS_FRZ
.4byte Status_Curse .4byte Status_Curse @ B_ANIM_STATUS_CURSED
.4byte Status_Nightmare .4byte Status_Nightmare @ B_ANIM_STATUS_NIGHTMARE
.align 2 .align 2
gBattleAnims_General:: gBattleAnims_General::
.4byte General_CastformChange .4byte General_CastformChange @ B_ANIM_CASTFORM_CHANGE
.4byte General_StatsChange .4byte General_StatsChange @ B_ANIM_STATS_CHANGE
.4byte General_SubstituteFade .4byte General_SubstituteFade @ B_ANIM_SUBSTITUTE_FADE
.4byte General_SubstituteAppear .4byte General_SubstituteAppear @ B_ANIM_SUBSTITUTE_APPEAR
.4byte General_PokeblockThrow .4byte General_PokeblockThrow @ B_ANIM_POKEBLOCK_THROW
.4byte General_ItemKnockoff .4byte General_ItemKnockoff @ B_ANIM_ITEM_KNOCKOFF
.4byte General_TurnTrap .4byte General_TurnTrap @ B_ANIM_TURN_TRAP
.4byte General_HeldItemEffect .4byte General_HeldItemEffect @ B_ANIM_HELD_ITEM_EFFECT
.4byte General_SmokeballEscape .4byte General_SmokeballEscape @ B_ANIM_SMOKEBALL_ESCAPE
.4byte General_FocusBand .4byte General_FocusBand @ B_ANIM_FOCUS_BAND
.4byte General_Rain .4byte General_Rain @ B_ANIM_RAIN_CONTINUES
.4byte General_Sun .4byte General_Sun @ B_ANIM_SUN_CONTINUES
.4byte General_Sandstorm .4byte General_Sandstorm @ B_ANIM_SANDSTORM_CONTINUES
.4byte General_Hail .4byte General_Hail @ B_ANIM_HAIL_CONTINUES
.4byte General_LeechSeedDrain .4byte General_LeechSeedDrain @ B_ANIM_LEECH_SEED_DRAIN
.4byte General_MonHit .4byte General_MonHit @ B_ANIM_MON_HIT
.4byte General_ItemSteal .4byte General_ItemSteal @ B_ANIM_ITEM_STEAL
.4byte General_SnatchMove .4byte General_SnatchMove @ B_ANIM_SNATCH_MOVE
.4byte General_FutureSightHit .4byte General_FutureSightHit @ B_ANIM_FUTURE_SIGHT_HIT
.4byte General_DoomDesireHit .4byte General_DoomDesireHit @ B_ANIM_DOOM_DESIRE_HIT
.4byte General_FocusPunchSetUp .4byte General_FocusPunchSetUp @ B_ANIM_FOCUS_PUNCH_SETUP
.4byte General_IngrainHeal .4byte General_IngrainHeal @ B_ANIM_INGRAIN_HEAL
.4byte General_WishHeal .4byte General_WishHeal @ B_ANIM_WISH_HEAL
.align 2 .align 2
gBattleAnims_Special:: gBattleAnims_Special::

View File

@ -2860,7 +2860,7 @@ BattleScript_FaintedMonTryChooseAnother::
switchhandleorder BS_FAINTED, 0x2 switchhandleorder BS_FAINTED, 0x2
jumpifnotbattletype BATTLE_TYPE_TRAINER, BattleScript_FaintedMonChooseAnother jumpifnotbattletype BATTLE_TYPE_TRAINER, BattleScript_FaintedMonChooseAnother
jumpifbattletype BATTLE_TYPE_LINK, BattleScript_FaintedMonChooseAnother jumpifbattletype BATTLE_TYPE_LINK, BattleScript_FaintedMonChooseAnother
jumpifbattletype BATTLE_TYPE_x2000000, BattleScript_FaintedMonChooseAnother jumpifbattletype BATTLE_TYPE_RECORDED_LINK, BattleScript_FaintedMonChooseAnother
jumpifbattletype BATTLE_TYPE_FRONTIER, BattleScript_FaintedMonChooseAnother jumpifbattletype BATTLE_TYPE_FRONTIER, BattleScript_FaintedMonChooseAnother
jumpifbattletype BATTLE_TYPE_DOUBLE, BattleScript_FaintedMonChooseAnother jumpifbattletype BATTLE_TYPE_DOUBLE, BattleScript_FaintedMonChooseAnother
jumpifword CMP_COMMON_BITS, gHitMarker, HITMARKER_x400000, BattleScript_FaintedMonChooseAnother jumpifword CMP_COMMON_BITS, gHitMarker, HITMARKER_x400000, BattleScript_FaintedMonChooseAnother
@ -2978,7 +2978,7 @@ BattleScript_LocalBattleLostPrintTrainersWinText::
trainerslidein BS_ATTACKER trainerslidein BS_ATTACKER
waitstate waitstate
printstring STRINGID_TRAINER1WINTEXT printstring STRINGID_TRAINER1WINTEXT
jumpifbattletype BATTLE_TYPE_x800000, BattleScript_LocalBattleLostDoTrainer2WinText jumpifbattletype BATTLE_TYPE_TOWER_LINK_MULTI, BattleScript_LocalBattleLostDoTrainer2WinText
jumpifnotbattletype BATTLE_TYPE_TWO_OPPONENTS, BattleScript_LocalBattleLostEnd_ jumpifnotbattletype BATTLE_TYPE_TWO_OPPONENTS, BattleScript_LocalBattleLostEnd_
BattleScript_LocalBattleLostDoTrainer2WinText:: BattleScript_LocalBattleLostDoTrainer2WinText::
trainerslideout B_POSITION_OPPONENT_LEFT trainerslideout B_POSITION_OPPONENT_LEFT
@ -3834,7 +3834,7 @@ BattleScript_MoveUsedIsConfusedNoMore::
return return
BattleScript_PrintPayDayMoneyString:: BattleScript_PrintPayDayMoneyString::
printstring STRINGID_PKMNPICKEDUPITEM printstring STRINGID_PLAYERPICKEDUPMONEY
waitmessage 0x40 waitmessage 0x40
return return

View File

@ -168,7 +168,7 @@ BattleFrontier_BattleFactoryPreBattleRoom_EventScript_SwapMons:: @ 8259DF2
fadescreen FADE_TO_BLACK fadescreen FADE_TO_BLACK
factory_swapmons factory_swapmons
waitstate waitstate
compare VAR_RESULT, 1 compare VAR_RESULT, TRUE @ Did player keep current pokemon
goto_if_eq BattleFrontier_BattleFactoryPreBattleRoom_EventScript_EnterBattleRoom goto_if_eq BattleFrontier_BattleFactoryPreBattleRoom_EventScript_EnterBattleRoom
factory_setswapped factory_setswapped
msgbox BattleFrontier_BattleFactoryPreBattleRoom_Text_YourSwapIsComplete, MSGBOX_DEFAULT msgbox BattleFrontier_BattleFactoryPreBattleRoom_Text_YourSwapIsComplete, MSGBOX_DEFAULT

View File

@ -3,5 +3,5 @@ CaveOfOrigin_1F_MapScripts:: @ 8235768
.byte 0 .byte 0
CaveOfOrigin_1F_OnTransition: @ 823576E CaveOfOrigin_1F_OnTransition: @ 823576E
call_if_set FLAG_UNUSED_RS_LEGENDARY_BATTLE_DONE, CaveOfOrigin_EventScript_SetTempVars call_if_set FLAG_UNUSED_RS_LEGENDARY_BATTLE_DONE, CaveOfOrigin_EventScript_DisableTriggers
end end

View File

@ -3,5 +3,5 @@ CaveOfOrigin_UnusedRubySapphireMap1_MapScripts:: @ 8235778
.byte 0 .byte 0
CaveOfOrigin_UnusedRubySapphireMap1_OnTransition: @ 823577E CaveOfOrigin_UnusedRubySapphireMap1_OnTransition: @ 823577E
call_if_set FLAG_UNUSED_RS_LEGENDARY_BATTLE_DONE, CaveOfOrigin_EventScript_SetTempVars call_if_set FLAG_UNUSED_RS_LEGENDARY_BATTLE_DONE, CaveOfOrigin_EventScript_DisableTriggers
end end

View File

@ -3,6 +3,6 @@ CaveOfOrigin_UnusedRubySapphireMap2_MapScripts:: @ 8235788
.byte 0 .byte 0
CaveOfOrigin_UnusedRubySapphireMap2_OnTransition: @ 823578E CaveOfOrigin_UnusedRubySapphireMap2_OnTransition: @ 823578E
call_if_set FLAG_UNUSED_RS_LEGENDARY_BATTLE_DONE, CaveOfOrigin_EventScript_SetTempVars call_if_set FLAG_UNUSED_RS_LEGENDARY_BATTLE_DONE, CaveOfOrigin_EventScript_DisableTriggers
end end

View File

@ -3,6 +3,6 @@ CaveOfOrigin_UnusedRubySapphireMap3_MapScripts:: @ 8235798
.byte 0 .byte 0
CaveOfOrigin_UnusedRubySapphireMap3_OnTransition: @ 823579E CaveOfOrigin_UnusedRubySapphireMap3_OnTransition: @ 823579E
call_if_set FLAG_UNUSED_RS_LEGENDARY_BATTLE_DONE, CaveOfOrigin_EventScript_SetTempVars call_if_set FLAG_UNUSED_RS_LEGENDARY_BATTLE_DONE, CaveOfOrigin_EventScript_DisableTriggers
end end

View File

@ -209,7 +209,7 @@ gScriptCmdTable:: @ 81DB67C
.4byte ScrCmd_checkmonobedience @ 0xce .4byte ScrCmd_checkmonobedience @ 0xce
.4byte ScrCmd_gotoram @ 0xcf .4byte ScrCmd_gotoram @ 0xcf
.4byte ScrCmd_nop1 @ 0xd0 .4byte ScrCmd_nop1 @ 0xd0
.4byte ScrCmd_warpD1 @ 0xd1 .4byte ScrCmd_warpspinenter @ 0xd1
.4byte ScrCmd_setmonmetlocation @ 0xd2 .4byte ScrCmd_setmonmetlocation @ 0xd2
.4byte ScrCmd_moverotatingtileobjects @ 0xd3 .4byte ScrCmd_moverotatingtileobjects @ 0xd3
.4byte ScrCmd_turnrotatingtileobjects @ 0xd4 .4byte ScrCmd_turnrotatingtileobjects @ 0xd4

View File

@ -36,7 +36,7 @@ CaveOfOrigin_EventScript_Shake:: @ 82722A7
releaseall releaseall
end end
CaveOfOrigin_EventScript_SetTempVars:: @ 82722C1 CaveOfOrigin_EventScript_DisableTriggers:: @ 82722C1
setvar VAR_TEMP_1, 1 setvar VAR_TEMP_1, 1
setvar VAR_TEMP_2, 1 setvar VAR_TEMP_2, 1
setvar VAR_TEMP_3, 1 setvar VAR_TEMP_3, 1

View File

@ -65,7 +65,7 @@ EventScript_PkmnCenterNurse_ReturnPkmn:: @ 82719E2
goto_if_eq EventScript_PkmnCenterNurse_ReturnPkmn2 goto_if_eq EventScript_PkmnCenterNurse_ReturnPkmn2
message gText_RestoredPkmnToFullHealth message gText_RestoredPkmnToFullHealth
waitmessage waitmessage
applymovement VAR_0x800B, EventScript_PkmnCenterNurse_Bow applymovement VAR_0x800B, Movement_PkmnCenterNurse_Bow
waitmovement 0 waitmovement 0
message gText_WeHopeToSeeYouAgain message gText_WeHopeToSeeYouAgain
return return
@ -73,7 +73,7 @@ EventScript_PkmnCenterNurse_ReturnPkmn:: @ 82719E2
EventScript_PkmnCenterNurse_ReturnPkmn2:: @ 8271A03 EventScript_PkmnCenterNurse_ReturnPkmn2:: @ 8271A03
message gText_ThankYouForWaiting message gText_ThankYouForWaiting
waitmessage waitmessage
applymovement VAR_0x800B, EventScript_PkmnCenterNurse_Bow applymovement VAR_0x800B, Movement_PkmnCenterNurse_Bow
waitmovement 0 waitmovement 0
message gText_WeHopeToSeeYouAgain2 message gText_WeHopeToSeeYouAgain2
return return
@ -84,7 +84,7 @@ EventScript_PkmnCenterNurse_PlayerWaitingInUnionRoom:: @ 8271A19
setflag FLAG_NURSE_UNION_ROOM_REMINDER setflag FLAG_NURSE_UNION_ROOM_REMINDER
message CableClub_Text_PlayerIsWaiting message CableClub_Text_PlayerIsWaiting
waitmessage waitmessage
applymovement VAR_0x800B, EventScript_PkmnCenterNurse_Bow applymovement VAR_0x800B, Movement_PkmnCenterNurse_Bow
waitmovement 0 waitmovement 0
message gText_WeHopeToSeeYouAgain message gText_WeHopeToSeeYouAgain
return return
@ -129,7 +129,7 @@ EventScript_PkmnCenterNurse_GoldCardHealPkmn:: @ 8271AC5
goto EventScript_PkmnCenterNurse_HealPkmn goto EventScript_PkmnCenterNurse_HealPkmn
end end
EventScript_PkmnCenterNurse_Bow: @ 8271AD0 Movement_PkmnCenterNurse_Bow: @ 8271AD0
nurse_joy_bow nurse_joy_bow
delay_4 delay_4
step_end step_end

View File

@ -6,16 +6,15 @@ EventScript_MixRecordsPrompt:: @ 8271D5E
compare VAR_RESULT, YES compare VAR_RESULT, YES
goto_if_eq EventScript_MixRecords goto_if_eq EventScript_MixRecords
compare VAR_RESULT, NO compare VAR_RESULT, NO
goto_if_eq EventScript_DeclineMixRecords goto_if_eq EventScript_EndMixRecords
goto EventScript_DeclineMixRecords goto EventScript_EndMixRecords
EventScript_MixRecords:: @ 8271D83 EventScript_MixRecords:: @ 8271D83
special RecordMixingPlayerSpotTriggered special RecordMixingPlayerSpotTriggered
waitstate waitstate
lock lock
faceplayer faceplayer
EventScript_EndMixRecords:: @ 8271D89
EventScript_DeclineMixRecords:: @ 8271D89
message Text_WeHopeToSeeYouAgain message Text_WeHopeToSeeYouAgain
waitmessage waitmessage
waitbuttonpress waitbuttonpress

View File

@ -1,7 +1,7 @@
# Bugs and Glitches # Bugs and Glitches
These are known bugs and glitches in the original Pokémon Emerald game: code that clearly does not work as intended, or that only works in limited circumstances but has the possibility to fail or crash. Defining the `BUGFIX` preprocessor variable will fix some of these automatically. These are known bugs and glitches in the original Pokémon Emerald game: code that clearly does not work as intended, or that only works in limited circumstances but has the possibility to fail or crash. Defining the `BUGFIX` and `UBFIX` preprocessor variables will fix some of these automatically. `UBFIX` will already be defined for MODERN builds.
Fixes are written in the `diff` format. If you've used Git before, this should look familiar: Fixes are written in the `diff` format. If you've used Git before, this should look familiar:
@ -13,55 +13,9 @@ Fixes are written in the `diff` format. If you've used Git before, this should l
## Contents ## Contents
- [RNG does not get seeded](#rng-does-not-get-seeded)
- [Scrolling through items in the bag causes the image to flicker](#scrolling-through-items-in-the-bag-causes-the-image-to-flicker) - [Scrolling through items in the bag causes the image to flicker](#scrolling-through-items-in-the-bag-causes-the-image-to-flicker)
## RNG does not get seeded
**Fix:** Add the following function to [src/main.c](https://github.com/pret/pokeemerald/blob/master/src/main.c):
```diff
+static void SeedRngWithRtc(void)
+{
+ u32 seed = RtcGetMinuteCount();
+ seed = (seed >> 16) ^ (seed & 0xFFFF);
+ SeedRng(seed);
+}
```
And edit `AgbMain`:
```diff
...
RtcInit();
CheckForFlashMemory();
InitMainCallbacks();
InitMapMusic();
+ SeedRngWithRtc();
ClearDma3Requests();
...
```
This restores the code of Ruby/Sapphire.
**Alternate Fix:** Edit the following function in [src/title_screen.c](https://github.com/pret/pokeemerald/blob/master/src/title_screen.c):
```diff
void CB2_InitTitleScreen(void)
{
switch (gMain.state)
{
default:
case 0:
SetVBlankCallback(NULL);
+ StartTimer1();
SetGpuReg(REG_OFFSET_BLDCNT, 0);
SetGpuReg(REG_OFFSET_BLDALPHA, 0);
SetGpuReg(REG_OFFSET_BLDY, 0);
...
```
This matches what FRLG does and obtains the seed differently than RS, independently of the RTC.
## Scrolling through items in the bag causes the image to flicker ## Scrolling through items in the bag causes the image to flicker
**Fix:** Add the following function to [src/item_menu_icons.c](https://github.com/pret/pokeemerald/blob/master/src/item_menu_icons.c): **Fix:** Add the following function to [src/item_menu_icons.c](https://github.com/pret/pokeemerald/blob/master/src/item_menu_icons.c):
@ -89,27 +43,9 @@ Then edit `BagMenu_MoveCursorCallback` in [src/item_menu.c](https://github.com/p
```diff ```diff
... ...
{ {
- RemoveBagItemIconSprite(1 ^ gBagMenu->unk81B_1); - RemoveBagItemIconSprite(1 ^ gBagMenu->itemIconSlot);
+ HideBagItemIconSprite(gBagMenu->unk81B_1 ^ 1); + HideBagItemIconSprite(gBagMenu->itemIconSlot ^ 1);
+ RemoveBagItemIconSprite(gBagMenu->unk81B_1); + RemoveBagItemIconSprite(gBagMenu->itemIconSlot);
if (a != -2) if (itemIndex != LIST_CANCEL)
... ...
``` ```
## Pokémon that have an affine transform as part of their entry animation glitch when going in and out of Poké Balls without a screen transition in between
**Fix:** Edit `sub_817F77C` in [src/pokemon_animation.c](https://github.com/pret/pokeemerald/blob/master/src/pokemon_animation.c#L1028):
```diff
...
-#ifdef BUGFIX
else
{
// FIX: Reset these back to normal after they were changed so Poké Ball catch/release
// animations without a screen transition in between don't break
sprite->affineAnimPaused = FALSE;
sprite->affineAnims = gUnknown_082FF694;
}
-#endif // BUGFIX
}
```

View File

@ -2,7 +2,7 @@
static void *sHeapStart; static void *sHeapStart;
static u32 sHeapSize; static u32 sHeapSize;
static u32 malloc_c_unused_0300000c; // needed to align dma3_manager.o(.bss) static u32 sFiller; // needed to align dma3_manager.o(.bss)
#define MALLOC_SYSTEM_ID 0xA3A3 #define MALLOC_SYSTEM_ID 0xA3A3

View File

@ -1320,6 +1320,11 @@ void ApplyAffineAnimFrameRelativeAndUpdateMatrix(u8 matrixNum, struct AffineAnim
s16 ConvertScaleParam(s16 scale) s16 ConvertScaleParam(s16 scale)
{ {
s32 val = 0x10000; s32 val = 0x10000;
// UB: possible division by zero
#ifdef UBFIX
if (scale == 0)
return 0;
#endif //UBFIX
return val / scale; return val / scale;
} }

View File

@ -165,7 +165,6 @@ bool16 AddTextPrinter(struct TextPrinterTemplate *printerTemplate, u8 speed, voi
{ {
int i; int i;
u16 j; u16 j;
u8 *ptr;
if (!gFonts) if (!gFonts)
return FALSE; return FALSE;
@ -1235,7 +1234,6 @@ s32 GetStringWidth(u8 fontId, const u8 *str, s16 letterSpacing)
bool8 isJapanese; bool8 isJapanese;
int minGlyphWidth; int minGlyphWidth;
u32 (*func)(u16 glyphId, bool32 isJapanese); u32 (*func)(u16 glyphId, bool32 isJapanese);
s32 result;
int localLetterSpacing; int localLetterSpacing;
u32 lineWidth; u32 lineWidth;
const u8 *bufferPointer; const u8 *bufferPointer;

Binary file not shown.

After

Width:  |  Height:  |  Size: 405 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 156 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 134 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 165 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 139 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 139 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 167 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 135 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 132 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 138 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 158 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 263 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 211 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 115 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 75 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 72 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 99 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 77 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 110 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 82 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 82 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 98 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 78 B

View File

@ -1,19 +0,0 @@
JASC-PAL
0100
16
0 0 0
213 255 238
213 255 238
213 255 238
213 255 238
213 255 238
213 255 238
213 255 238
213 255 238
213 255 238
213 255 238
213 255 238
213 255 238
213 255 238
213 255 238
213 255 238

View File

@ -85,8 +85,8 @@ enum
struct UnusedControllerStruct struct UnusedControllerStruct
{ {
u8 field_0:7; u8 unk:7;
u8 flag_x80:1; u8 flag:1;
}; };
struct HpAndStatus struct HpAndStatus
@ -145,19 +145,19 @@ enum
CONTROLLER_STATUSXOR, CONTROLLER_STATUSXOR,
CONTROLLER_DATATRANSFER, CONTROLLER_DATATRANSFER,
CONTROLLER_DMA3TRANSFER, CONTROLLER_DMA3TRANSFER,
CONTROLLER_31, CONTROLLER_PLAYBGM,
CONTROLLER_32, CONTROLLER_32,
CONTROLLER_TWORETURNVALUES, CONTROLLER_TWORETURNVALUES,
CONTROLLER_CHOSENMONRETURNVALUE, CONTROLLER_CHOSENMONRETURNVALUE,
CONTROLLER_ONERETURNVALUE, CONTROLLER_ONERETURNVALUE,
CONTROLLER_ONERETURNVALUE_DUPLICATE, CONTROLLER_ONERETURNVALUE_DUPLICATE,
CONTROLLER_37, CONTROLLER_CLEARUNKVAR,
CONTROLLER_38, CONTROLLER_SETUNKVAR,
CONTROLLER_39, CONTROLLER_CLEARUNKFLAG,
CONTROLLER_40, CONTROLLER_TOGGLEUNKFLAG,
CONTROLLER_HITANIMATION, CONTROLLER_HITANIMATION,
CONTROLLER_42, CONTROLLER_42,
CONTROLLER_EFFECTIVENESSSOUND, CONTROLLER_PLAYSE,
CONTROLLER_PLAYFANFAREORBGM, CONTROLLER_PLAYFANFAREORBGM,
CONTROLLER_FAINTINGCRY, CONTROLLER_FAINTINGCRY,
CONTROLLER_INTROSLIDE, CONTROLLER_INTROSLIDE,
@ -175,7 +175,7 @@ enum
CONTROLLER_CMDS_COUNT CONTROLLER_CMDS_COUNT
}; };
extern struct UnusedControllerStruct gUnknown_02022D0C; extern struct UnusedControllerStruct gUnusedControllerStruct;
// general functions // general functions
void HandleLinkBattleSetup(void); void HandleLinkBattleSetup(void);
@ -222,10 +222,10 @@ void BtlController_EmitTwoReturnValues(u8 bufferId, u8 arg1, u16 arg2);
void BtlController_EmitChosenMonReturnValue(u8 bufferId, u8 b, u8 *c); void BtlController_EmitChosenMonReturnValue(u8 bufferId, u8 b, u8 *c);
void BtlController_EmitOneReturnValue(u8 bufferId, u16 arg1); void BtlController_EmitOneReturnValue(u8 bufferId, u16 arg1);
void BtlController_EmitOneReturnValue_Duplicate(u8 bufferId, u16 b); void BtlController_EmitOneReturnValue_Duplicate(u8 bufferId, u16 b);
void BtlController_EmitCmd37(u8 bufferId); // unused void BtlController_EmitClearUnkVar(u8 bufferId); // unused
void BtlController_EmitCmd38(u8 bufferId, u8 b); // unused void BtlController_EmitSetUnkVar(u8 bufferId, u8 b); // unused
void BtlController_EmitCmd39(u8 bufferId); // unused void BtlController_EmitClearUnkFlag(u8 bufferId); // unused
void BtlController_EmitCmd40(u8 bufferId); // unused void BtlController_EmitToggleUnkFlag(u8 bufferId); // unused
void BtlController_EmitHitAnimation(u8 bufferId); void BtlController_EmitHitAnimation(u8 bufferId);
void BtlController_EmitCmd42(u8 bufferId); void BtlController_EmitCmd42(u8 bufferId);
void BtlController_EmitPlaySE(u8 bufferId, u16 songId); void BtlController_EmitPlaySE(u8 bufferId, u16 songId);

View File

@ -44,38 +44,38 @@
#define BIT_FLANK 2 #define BIT_FLANK 2
// Battle Type Flags // Battle Type Flags
#define BATTLE_TYPE_DOUBLE (1 << 0) #define BATTLE_TYPE_DOUBLE (1 << 0)
#define BATTLE_TYPE_LINK (1 << 1) #define BATTLE_TYPE_LINK (1 << 1)
#define BATTLE_TYPE_IS_MASTER (1 << 2) // In not-link battles, it's always set. #define BATTLE_TYPE_IS_MASTER (1 << 2) // In not-link battles, it's always set.
#define BATTLE_TYPE_TRAINER (1 << 3) #define BATTLE_TYPE_TRAINER (1 << 3)
#define BATTLE_TYPE_FIRST_BATTLE (1 << 4) #define BATTLE_TYPE_FIRST_BATTLE (1 << 4)
#define BATTLE_TYPE_20 (1 << 5) #define BATTLE_TYPE_LINK_IN_BATTLE (1 << 5) // Set on battle entry, cleared on exit. Checked rarely
#define BATTLE_TYPE_MULTI (1 << 6) #define BATTLE_TYPE_MULTI (1 << 6)
#define BATTLE_TYPE_SAFARI (1 << 7) #define BATTLE_TYPE_SAFARI (1 << 7)
#define BATTLE_TYPE_BATTLE_TOWER (1 << 8) #define BATTLE_TYPE_BATTLE_TOWER (1 << 8)
#define BATTLE_TYPE_WALLY_TUTORIAL (1 << 9) #define BATTLE_TYPE_WALLY_TUTORIAL (1 << 9)
#define BATTLE_TYPE_ROAMER (1 << 10) #define BATTLE_TYPE_ROAMER (1 << 10)
#define BATTLE_TYPE_EREADER_TRAINER (1 << 11) #define BATTLE_TYPE_EREADER_TRAINER (1 << 11)
#define BATTLE_TYPE_KYOGRE_GROUDON (1 << 12) #define BATTLE_TYPE_KYOGRE_GROUDON (1 << 12)
#define BATTLE_TYPE_LEGENDARY (1 << 13) #define BATTLE_TYPE_LEGENDARY (1 << 13)
#define BATTLE_TYPE_REGI (1 << 14) #define BATTLE_TYPE_REGI (1 << 14)
#define BATTLE_TYPE_TWO_OPPONENTS (1 << 15) #define BATTLE_TYPE_TWO_OPPONENTS (1 << 15)
#define BATTLE_TYPE_DOME (1 << 16) #define BATTLE_TYPE_DOME (1 << 16)
#define BATTLE_TYPE_PALACE (1 << 17) #define BATTLE_TYPE_PALACE (1 << 17)
#define BATTLE_TYPE_ARENA (1 << 18) #define BATTLE_TYPE_ARENA (1 << 18)
#define BATTLE_TYPE_FACTORY (1 << 19) #define BATTLE_TYPE_FACTORY (1 << 19)
#define BATTLE_TYPE_PIKE (1 << 20) #define BATTLE_TYPE_PIKE (1 << 20)
#define BATTLE_TYPE_PYRAMID (1 << 21) #define BATTLE_TYPE_PYRAMID (1 << 21)
#define BATTLE_TYPE_INGAME_PARTNER (1 << 22) #define BATTLE_TYPE_INGAME_PARTNER (1 << 22)
#define BATTLE_TYPE_x800000 (1 << 23) #define BATTLE_TYPE_TOWER_LINK_MULTI (1 << 23)
#define BATTLE_TYPE_RECORDED (1 << 24) #define BATTLE_TYPE_RECORDED (1 << 24)
#define BATTLE_TYPE_x2000000 (1 << 25) #define BATTLE_TYPE_RECORDED_LINK (1 << 25)
#define BATTLE_TYPE_TRAINER_HILL (1 << 26) #define BATTLE_TYPE_TRAINER_HILL (1 << 26)
#define BATTLE_TYPE_SECRET_BASE (1 << 27) #define BATTLE_TYPE_SECRET_BASE (1 << 27)
#define BATTLE_TYPE_GROUDON (1 << 28) #define BATTLE_TYPE_GROUDON (1 << 28)
#define BATTLE_TYPE_KYOGRE (1 << 29) #define BATTLE_TYPE_KYOGRE (1 << 29)
#define BATTLE_TYPE_RAYQUAZA (1 << 30) #define BATTLE_TYPE_RAYQUAZA (1 << 30)
#define BATTLE_TYPE_x80000000 (1 << 31) #define BATTLE_TYPE_RECORDED_IS_MASTER (1 << 31)
#define BATTLE_TYPE_FRONTIER (BATTLE_TYPE_BATTLE_TOWER | BATTLE_TYPE_DOME | BATTLE_TYPE_PALACE | BATTLE_TYPE_ARENA | BATTLE_TYPE_FACTORY | BATTLE_TYPE_PIKE | BATTLE_TYPE_PYRAMID) #define BATTLE_TYPE_FRONTIER (BATTLE_TYPE_BATTLE_TOWER | BATTLE_TYPE_DOME | BATTLE_TYPE_PALACE | BATTLE_TYPE_ARENA | BATTLE_TYPE_FACTORY | BATTLE_TYPE_PIKE | BATTLE_TYPE_PYRAMID)
#define BATTLE_TYPE_FRONTIER_NO_PYRAMID (BATTLE_TYPE_BATTLE_TOWER | BATTLE_TYPE_DOME | BATTLE_TYPE_PALACE | BATTLE_TYPE_ARENA | BATTLE_TYPE_FACTORY | BATTLE_TYPE_PIKE) #define BATTLE_TYPE_FRONTIER_NO_PYRAMID (BATTLE_TYPE_BATTLE_TOWER | BATTLE_TYPE_DOME | BATTLE_TYPE_PALACE | BATTLE_TYPE_ARENA | BATTLE_TYPE_FACTORY | BATTLE_TYPE_PIKE)

View File

@ -346,51 +346,51 @@
#define BG_SOLARBEAM_PLAYER 25 #define BG_SOLARBEAM_PLAYER 25
#define BG_SOLARBEAM_CONTESTS 26 #define BG_SOLARBEAM_CONTESTS 26
// table ids for general animations // table ids for general animations (gBattleAnims_General)
#define B_ANIM_CASTFORM_CHANGE 0x0 #define B_ANIM_CASTFORM_CHANGE 0
#define B_ANIM_STATS_CHANGE 0x1 #define B_ANIM_STATS_CHANGE 1
#define B_ANIM_SUBSTITUTE_FADE 0x2 #define B_ANIM_SUBSTITUTE_FADE 2
#define B_ANIM_SUBSTITUTE_APPEAR 0x3 #define B_ANIM_SUBSTITUTE_APPEAR 3
#define B_ANIM_POKEBLOCK_THROW 0x4 #define B_ANIM_POKEBLOCK_THROW 4
#define B_ANIM_ITEM_KNOCKOFF 0x5 #define B_ANIM_ITEM_KNOCKOFF 5
#define B_ANIM_TURN_TRAP 0x6 #define B_ANIM_TURN_TRAP 6
#define B_ANIM_HELD_ITEM_EFFECT 0x7 #define B_ANIM_HELD_ITEM_EFFECT 7
#define B_ANIM_SMOKEBALL_ESCAPE 0x8 #define B_ANIM_SMOKEBALL_ESCAPE 8
#define B_ANIM_FOCUS_BAND 0x9 #define B_ANIM_FOCUS_BAND 9
#define B_ANIM_RAIN_CONTINUES 0xA #define B_ANIM_RAIN_CONTINUES 10
#define B_ANIM_SUN_CONTINUES 0xB #define B_ANIM_SUN_CONTINUES 11
#define B_ANIM_SANDSTORM_CONTINUES 0xC #define B_ANIM_SANDSTORM_CONTINUES 12
#define B_ANIM_HAIL_CONTINUES 0xD #define B_ANIM_HAIL_CONTINUES 13
#define B_ANIM_LEECH_SEED_DRAIN 0xE #define B_ANIM_LEECH_SEED_DRAIN 14
#define B_ANIM_MON_HIT 0xF #define B_ANIM_MON_HIT 15
#define B_ANIM_ITEM_STEAL 0x10 #define B_ANIM_ITEM_STEAL 16
#define B_ANIM_SNATCH_MOVE 0x11 #define B_ANIM_SNATCH_MOVE 17
#define B_ANIM_FUTURE_SIGHT_HIT 0x12 #define B_ANIM_FUTURE_SIGHT_HIT 18
#define B_ANIM_DOOM_DESIRE_HIT 0x13 #define B_ANIM_DOOM_DESIRE_HIT 19
#define B_ANIM_FOCUS_PUNCH_SETUP 0x14 #define B_ANIM_FOCUS_PUNCH_SETUP 20
#define B_ANIM_INGRAIN_HEAL 0x15 #define B_ANIM_INGRAIN_HEAL 21
#define B_ANIM_WISH_HEAL 0x16 #define B_ANIM_WISH_HEAL 22
// special animations table // special animations table (gBattleAnims_Special)
#define B_ANIM_LVL_UP 0x0 #define B_ANIM_LVL_UP 0
#define B_ANIM_SWITCH_OUT_PLAYER_MON 0x1 #define B_ANIM_SWITCH_OUT_PLAYER_MON 1
#define B_ANIM_SWITCH_OUT_OPPONENT_MON 0x2 #define B_ANIM_SWITCH_OUT_OPPONENT_MON 2
#define B_ANIM_BALL_THROW 0x3 #define B_ANIM_BALL_THROW 3
#define B_ANIM_BALL_THROW_WITH_TRAINER 0x4 #define B_ANIM_BALL_THROW_WITH_TRAINER 4
#define B_ANIM_SUBSTITUTE_TO_MON 0x5 #define B_ANIM_SUBSTITUTE_TO_MON 5
#define B_ANIM_MON_TO_SUBSTITUTE 0x6 #define B_ANIM_MON_TO_SUBSTITUTE 6
// status animation table // status animation table (gBattleAnims_StatusConditions)
#define B_ANIM_STATUS_PSN 0x0 #define B_ANIM_STATUS_PSN 0
#define B_ANIM_STATUS_CONFUSION 0x1 #define B_ANIM_STATUS_CONFUSION 1
#define B_ANIM_STATUS_BRN 0x2 #define B_ANIM_STATUS_BRN 2
#define B_ANIM_STATUS_INFATUATION 0x3 #define B_ANIM_STATUS_INFATUATION 3
#define B_ANIM_STATUS_SLP 0x4 #define B_ANIM_STATUS_SLP 4
#define B_ANIM_STATUS_PRZ 0x5 #define B_ANIM_STATUS_PRZ 5
#define B_ANIM_STATUS_FRZ 0x6 #define B_ANIM_STATUS_FRZ 6
#define B_ANIM_STATUS_CURSED 0x7 #define B_ANIM_STATUS_CURSED 7
#define B_ANIM_STATUS_NIGHTMARE 0x8 #define B_ANIM_STATUS_NIGHTMARE 8
#define B_ANIM_STATUS_WRAPPED 0x9 // does not actually exist #define B_ANIM_STATUS_WRAPPED 9 // does not actually exist
// Tasks with return values often assign them to gBattleAnimArgs[7]. // Tasks with return values often assign them to gBattleAnimArgs[7].
#define ARG_RET_ID 7 #define ARG_RET_ID 7

View File

@ -216,4 +216,6 @@
#define EFFECT_DRAGON_DANCE 212 #define EFFECT_DRAGON_DANCE 212
#define EFFECT_CAMOUFLAGE 213 #define EFFECT_CAMOUFLAGE 213
#define NUM_BATTLE_MOVE_EFFECTS 214
#endif // GUARD_CONSTANTS_BATTLE_MOVE_EFFECTS_H #endif // GUARD_CONSTANTS_BATTLE_MOVE_EFFECTS_H

View File

@ -124,7 +124,7 @@
#define STRINGID_PKMNSTORINGENERGY 120 #define STRINGID_PKMNSTORINGENERGY 120
#define STRINGID_PKMNUNLEASHEDENERGY 121 #define STRINGID_PKMNUNLEASHEDENERGY 121
#define STRINGID_PKMNFATIGUECONFUSION 122 #define STRINGID_PKMNFATIGUECONFUSION 122
#define STRINGID_PKMNPICKEDUPITEM 123 #define STRINGID_PLAYERPICKEDUPMONEY 123
#define STRINGID_PKMNUNAFFECTED 124 #define STRINGID_PKMNUNAFFECTED 124
#define STRINGID_PKMNTRANSFORMEDINTO 125 #define STRINGID_PKMNTRANSFORMEDINTO 125
#define STRINGID_PKMNMADESUBSTITUTE 126 #define STRINGID_PKMNMADESUBSTITUTE 126

View File

@ -17,7 +17,11 @@
#define ITEM_LUXURY_BALL 11 #define ITEM_LUXURY_BALL 11
#define ITEM_PREMIER_BALL 12 #define ITEM_PREMIER_BALL 12
#define LAST_BALL ITEM_PREMIER_BALL // Note: If moving ball IDs around, updating FIRST_BALL/LAST_BALL is not sufficient
// Several places expect the ball IDs to be first and contiguous (e.g. gBattlescriptsForBallThrow and MON_DATA_POKEBALL)
// If adding new balls, it's easiest to insert them after the last ball and increment the below IDs (and removing ITEM_034 for example)
#define FIRST_BALL ITEM_MASTER_BALL
#define LAST_BALL ITEM_PREMIER_BALL
// Pokemon Items // Pokemon Items
#define ITEM_POTION 13 #define ITEM_POTION 13
@ -145,6 +149,8 @@
#define ITEM_FAB_MAIL 131 #define ITEM_FAB_MAIL 131
#define ITEM_RETRO_MAIL 132 #define ITEM_RETRO_MAIL 132
#define FIRST_MAIL_INDEX ITEM_ORANGE_MAIL
// Berries // Berries
#define ITEM_CHERI_BERRY 133 #define ITEM_CHERI_BERRY 133
#define ITEM_CHESTO_BERRY 134 #define ITEM_CHESTO_BERRY 134
@ -189,6 +195,10 @@
#define ITEM_LANSAT_BERRY 173 #define ITEM_LANSAT_BERRY 173
#define ITEM_STARF_BERRY 174 #define ITEM_STARF_BERRY 174
#define ITEM_ENIGMA_BERRY 175 #define ITEM_ENIGMA_BERRY 175
#define FIRST_BERRY_INDEX ITEM_CHERI_BERRY
#define LAST_BERRY_INDEX ITEM_ENIGMA_BERRY
#define ITEM_0B0 176 #define ITEM_0B0 176
#define ITEM_0B1 177 #define ITEM_0B1 177
#define ITEM_0B2 178 #define ITEM_0B2 178
@ -467,9 +477,6 @@
#define ITEMS_COUNT 377 #define ITEMS_COUNT 377
#define ITEM_FIELD_ARROW ITEMS_COUNT #define ITEM_FIELD_ARROW ITEMS_COUNT
#define FIRST_BERRY_INDEX ITEM_CHERI_BERRY
#define LAST_BERRY_INDEX ITEM_ENIGMA_BERRY
// Range of berries given out by various NPCS // Range of berries given out by various NPCS
#define FIRST_BERRY_MASTER_BERRY ITEM_POMEG_BERRY #define FIRST_BERRY_MASTER_BERRY ITEM_POMEG_BERRY
#define LAST_BERRY_MASTER_BERRY ITEM_NOMEL_BERRY #define LAST_BERRY_MASTER_BERRY ITEM_NOMEL_BERRY
@ -506,6 +513,21 @@
#define GOOD_ROD 1 #define GOOD_ROD 1
#define SUPER_ROD 2 #define SUPER_ROD 2
// Secondary IDs for bikes
#define MACH_BIKE 0
#define ACRO_BIKE 1
// Item type IDs (used to determine the exit callback)
#define ITEM_USE_MAIL 0
#define ITEM_USE_PARTY_MENU 1
#define ITEM_USE_FIELD 2
#define ITEM_USE_PBLOCK_CASE 3
#define ITEM_USE_BAG_MENU 4 // No exit callback, stays in bag menu
// Item battle usage IDs (only checked to see if nonzero)
#define ITEM_B_USE_MEDICINE 1
#define ITEM_B_USE_OTHER 2
// Check if the item is one that can be used on a Pokemon. // Check if the item is one that can be used on a Pokemon.
#define ITEM_HAS_EFFECT(item) ((item) >= ITEM_POTION && (item) <= ITEM_0B2) #define ITEM_HAS_EFFECT(item) ((item) >= ITEM_POTION && (item) <= ITEM_0B2)

View File

@ -233,6 +233,9 @@
#define STATUS_PRIMARY_POKERUS 6 #define STATUS_PRIMARY_POKERUS 6
#define STATUS_PRIMARY_FAINTED 7 #define STATUS_PRIMARY_FAINTED 7
#define MAX_PER_STAT_IVS 31
#define MAX_IV_MASK 31
#define USE_RANDOM_IVS (MAX_PER_STAT_IVS + 1)
#define MAX_PER_STAT_EVS 255 #define MAX_PER_STAT_EVS 255
#define MAX_TOTAL_EVS 510 #define MAX_TOTAL_EVS 510
#define EV_ITEM_RAISE_LIMIT 100 #define EV_ITEM_RAISE_LIMIT 100

View File

@ -5,19 +5,22 @@
#define GET_G(color) (((color) >> 5) & 0x1F) #define GET_G(color) (((color) >> 5) & 0x1F)
#define GET_B(color) (((color) >> 10) & 0x1F) #define GET_B(color) (((color) >> 10) & 0x1F)
#define RGB(r, g, b) ((r) | ((g) << 5) | ((b) << 10)) #define RGB(r, g, b) ((r) | ((g) << 5) | ((b) << 10))
#define RGB2(r, g, b) (((b) << 10) | ((g) << 5) | (r)) #define RGB2(r, g, b) (((b) << 10) | ((g) << 5) | (r))
#define _RGB(r, g, b) ((((b) & 0x1F) << 10) + (((g) & 0x1F) << 5) + ((r) & 0x1F)) #define _RGB(r, g, b) ((((b) & 0x1F) << 10) + (((g) & 0x1F) << 5) + ((r) & 0x1F))
#define RGB_BLACK RGB(0, 0, 0) #define RGB_ALPHA (1 << 15)
#define RGB_WHITE RGB(31, 31, 31) #define IS_ALPHA(color) ((color) & RGB_ALPHA)
#define RGB_RED RGB(31, 0, 0)
#define RGB_GREEN RGB(0, 31, 0) #define RGB_BLACK RGB(0, 0, 0)
#define RGB_BLUE RGB(0, 0, 31) #define RGB_WHITE RGB(31, 31, 31)
#define RGB_PURPLE RGB(24, 0, 24) #define RGB_RED RGB(31, 0, 0)
#define RGB_YELLOW RGB(31, 31, 0) #define RGB_GREEN RGB(0, 31, 0)
#define RGB_MAGENTA RGB(31, 0, 31) #define RGB_BLUE RGB(0, 0, 31)
#define RGB_CYAN RGB(0, 31, 31) #define RGB_PURPLE RGB(24, 0, 24)
#define RGB_WHITEALPHA (RGB_WHITE | 0x8000) #define RGB_YELLOW RGB(31, 31, 0)
#define RGB_MAGENTA RGB(31, 0, 31)
#define RGB_CYAN RGB(0, 31, 31)
#define RGB_WHITEALPHA (RGB_WHITE | RGB_ALPHA)
#endif // GUARD_RGB_H #endif // GUARD_RGB_H

View File

@ -16,14 +16,22 @@ enum SpinnerRunnerFollowPatterns
RUNFOLLOW_SOUTH_EAST_WEST RUNFOLLOW_SOUTH_EAST_WEST
}; };
enum ReflectionTypes
{
REFL_TYPE_NONE,
REFL_TYPE_ICE,
REFL_TYPE_WATER,
NUM_REFLECTION_TYPES
};
#define FIGURE_8_LENGTH 72 #define FIGURE_8_LENGTH 72
#define GROUND_EFFECT_FLAG_TALL_GRASS_ON_SPAWN (1 << 0) #define GROUND_EFFECT_FLAG_TALL_GRASS_ON_SPAWN (1 << 0)
#define GROUND_EFFECT_FLAG_TALL_GRASS_ON_MOVE (1 << 1) #define GROUND_EFFECT_FLAG_TALL_GRASS_ON_MOVE (1 << 1)
#define GROUND_EFFECT_FLAG_LONG_GRASS_ON_SPAWN (1 << 2) #define GROUND_EFFECT_FLAG_LONG_GRASS_ON_SPAWN (1 << 2)
#define GROUND_EFFECT_FLAG_LONG_GRASS_ON_MOVE (1 << 3) #define GROUND_EFFECT_FLAG_LONG_GRASS_ON_MOVE (1 << 3)
#define GROUND_EFFECT_FLAG_ICE_REFLECTION (1 << 4) #define GROUND_EFFECT_FLAG_WATER_REFLECTION (1 << 4)
#define GROUND_EFFECT_FLAG_REFLECTION (1 << 5) #define GROUND_EFFECT_FLAG_ICE_REFLECTION (1 << 5)
#define GROUND_EFFECT_FLAG_SHALLOW_FLOWING_WATER (1 << 6) #define GROUND_EFFECT_FLAG_SHALLOW_FLOWING_WATER (1 << 6)
#define GROUND_EFFECT_FLAG_SAND (1 << 7) #define GROUND_EFFECT_FLAG_SAND (1 << 7)
#define GROUND_EFFECT_FLAG_DEEP_SAND (1 << 8) #define GROUND_EFFECT_FLAG_DEEP_SAND (1 << 8)
@ -414,10 +422,10 @@ u8 MovementType_RunInPlace_Step0(struct ObjectEvent *, struct Sprite *);
u8 MovementType_Invisible_Step0(struct ObjectEvent *, struct Sprite *); u8 MovementType_Invisible_Step0(struct ObjectEvent *, struct Sprite *);
u8 MovementType_Invisible_Step1(struct ObjectEvent *, struct Sprite *); u8 MovementType_Invisible_Step1(struct ObjectEvent *, struct Sprite *);
u8 MovementType_Invisible_Step2(struct ObjectEvent *, struct Sprite *); u8 MovementType_Invisible_Step2(struct ObjectEvent *, struct Sprite *);
void SetObjectEventSpriteInvisibility(u8 var, bool32 var2); void SetObjectEventSpriteInvisibility(u8 objectEventId, bool32 invisible);
bool32 IsObjectEventSpriteInvisible(u8 var); bool32 IsObjectEventSpriteInvisible(u8 objectEventId);
void SetObjectEventSpriteGraphics(u8 var1, u8 graphicsId); void SetObjectEventSpriteGraphics(u8 objectEventId, u8 graphicsId);
void SetObjectEventSpriteAnim(u8 var1, u8 var2); void SetObjectEventSpriteAnim(u8 objectEventId, u8 animNum);
bool32 IsObjectEventSpriteAnimating(u8 var); bool32 IsObjectEventSpriteAnimating(u8 objectEventId);
#endif //GUARD_EVENT_OBJECT_MOVEMENT_H #endif //GUARD_EVENT_OBJECT_MOVEMENT_H

View File

@ -36,7 +36,7 @@ void sub_808BCE8(void);
void InitPlayerAvatar(s16 a, s16 b, u8 c, u8 d); void InitPlayerAvatar(s16 a, s16 b, u8 c, u8 d);
void sub_808B864(void); void sub_808B864(void);
void sub_808BCF4(void); void sub_808BCF4(void);
void sub_808D074(u8); void SetSpinStartFacingDir(u8);
void GetXYCoordsOneStepInFrontOfPlayer(s16 *xPtr, s16 *yPtr); void GetXYCoordsOneStepInFrontOfPlayer(s16 *xPtr, s16 *yPtr);
u8 GetRivalAvatarGraphicsIdByStateIdAndGender(u8, u8); u8 GetRivalAvatarGraphicsIdByStateIdAndGender(u8, u8);
void SetPlayerAvatarFieldMove(void); void SetPlayerAvatarFieldMove(void);
@ -57,10 +57,10 @@ void PlayerWheelieMove(u8 direction);
void PlayerPopWheelieWhileMoving(u8 direction); void PlayerPopWheelieWhileMoving(u8 direction);
void PlayerUseAcroBikeOnBumpySlope(u8 direction); void PlayerUseAcroBikeOnBumpySlope(u8 direction);
void PlayerEndWheelieWhileMoving(u8 direction); void PlayerEndWheelieWhileMoving(u8 direction);
void sub_808D194(void); void DoPlayerSpinEntrance(void);
void sub_808D1C8(void); void DoPlayerSpinExit(void);
bool32 sub_808D1B4(void); bool32 IsPlayerSpinEntranceActive(void);
bool32 sub_808D1E8(void); bool32 IsPlayerSpinExitActive(void);
void SetPlayerInvisibility(bool8 invisible); void SetPlayerInvisibility(bool8 invisible);
u8 player_get_pos_including_state_based_drift(s16 *x, s16 *y); u8 player_get_pos_including_state_based_drift(s16 *x, s16 *y);
void StartFishing(u8 rod); void StartFishing(u8 rod);

View File

@ -18,8 +18,8 @@ void FieldCB_WarpExitFadeFromBlack(void);
void FieldCB_WarpExitFadeFromWhite(void); void FieldCB_WarpExitFadeFromWhite(void);
bool8 FieldCB_ReturnToFieldOpenStartMenu(void); bool8 FieldCB_ReturnToFieldOpenStartMenu(void);
void ReturnToFieldOpenStartMenu(void); void ReturnToFieldOpenStartMenu(void);
void sub_80AF6D4(void); void FieldCB_ReturnToFieldNoScript(void);
void sub_80AF6F0(void); void FieldCB_ReturnToFieldNoScriptCheckMusic(void);
void DoWarp(void); void DoWarp(void);
void DoDiveWarp(void); void DoDiveWarp(void);
void DoSootopolisLegendWarp(void); void DoSootopolisLegendWarp(void);
@ -35,8 +35,8 @@ void DoCableClubWarp(void);
void DoContestHallWarp(void); void DoContestHallWarp(void);
void AnimateFlash(u8 flashLevel); void AnimateFlash(u8 flashLevel);
void WriteBattlePyramidViewScanlineEffectBuffer(void); void WriteBattlePyramidViewScanlineEffectBuffer(void);
void sub_80B0244(void); void DoSpinEnterWarp(void);
void sub_80B0268(void); void DoSpinExitWarp(void);
void DoOrbEffect(void); void DoOrbEffect(void);
void FadeOutOrbEffect(void); void FadeOutOrbEffect(void);
void sub_80B05B4(void); void sub_80B05B4(void);

View File

@ -7529,8 +7529,8 @@ extern const u32 gConfetti_Gfx[];
extern const u32 gConfetti_Pal[]; extern const u32 gConfetti_Pal[];
extern const u32 gUnknown_08C093F0[]; extern const u32 gUnknown_08C093F0[];
extern const u32 gSubstituteDollTilemap[]; extern const u32 gSubstituteDollBackGfx[];
extern const u32 gSubstituteDollGfx[]; extern const u32 gSubstituteDollFrontGfx[];
extern const u32 gSubstituteDollPal[]; extern const u32 gSubstituteDollPal[];
extern const u32 gHealthboxSinglesPlayerGfx[]; extern const u32 gHealthboxSinglesPlayerGfx[];
extern const u32 gHealthboxSinglesOpponentGfx[]; extern const u32 gHealthboxSinglesOpponentGfx[];
@ -8456,6 +8456,11 @@ extern const u16 gPokenavMessageBox_Pal[];
extern const u32 gPokenavOptions_Gfx[]; extern const u32 gPokenavOptions_Gfx[];
extern const u16 gPokenavOptions_Pal[]; extern const u16 gPokenavOptions_Pal[];
// Battle Factory Screen
extern const u8 gFrontierFactorySelectMenu_Gfx[];
extern const u8 gFrontierFactorySelectMenu_Tilemap[];
extern const u16 gFrontierFactorySelectMenu_Pal[];
// Object event pals // Object event pals
extern const u16 gObjectEventPal_Brendan[]; extern const u16 gObjectEventPal_Brendan[];
extern const u16 gObjectEventPal_May[]; extern const u16 gObjectEventPal_May[];

View File

@ -16,6 +16,7 @@ struct PokemonSubstruct0
u32 experience; u32 experience;
u8 ppBonuses; u8 ppBonuses;
u8 friendship; u8 friendship;
u16 filler;
}; };
struct PokemonSubstruct1 struct PokemonSubstruct1
@ -243,6 +244,15 @@ struct Evolution
u16 targetSpecies; u16 targetSpecies;
}; };
#define NUM_UNOWN_FORMS 28
#define GET_UNOWN_LETTER(personality) (( \
(((personality) & 0x03000000) >> 18) \
| (((personality) & 0x00030000) >> 12) \
| (((personality) & 0x00000300) >> 6) \
| (((personality) & 0x00000003) >> 0) \
) % NUM_UNOWN_FORMS)
extern u8 gPlayerPartyCount; extern u8 gPlayerPartyCount;
extern struct Pokemon gPlayerParty[PARTY_SIZE]; extern struct Pokemon gPlayerParty[PARTY_SIZE];
extern u8 gEnemyPartyCount; extern u8 gEnemyPartyCount;

View File

@ -3,7 +3,7 @@
extern u32 gRecordedBattleRngSeed; extern u32 gRecordedBattleRngSeed;
extern u32 gBattlePalaceMoveSelectionRngValue; extern u32 gBattlePalaceMoveSelectionRngValue;
extern u8 gUnknown_0203C7B4; extern u8 gRecordedBattleMultiplayerId;
void sub_8184DA4(u8 arg0); void sub_8184DA4(u8 arg0);
void sub_8184E58(void); void sub_8184E58(void);

View File

@ -2988,4 +2988,31 @@ extern const u8 gText_SavingDontTurnOff2[];
extern const u8 gText_BlenderMaxSpeedRecord[]; extern const u8 gText_BlenderMaxSpeedRecord[];
extern const u8 gText_234Players[]; extern const u8 gText_234Players[];
// Battle Factory Screen
extern const u8 gText_RentalPkmn2[];
extern const u8 gText_SelectFirstPkmn[];
extern const u8 gText_SelectSecondPkmn[];
extern const u8 gText_SelectThirdPkmn[];
extern const u8 gText_TheseThreePkmnOkay[];
extern const u8 gText_CantSelectSamePkmn[];
extern const u8 gText_Summary[];
extern const u8 gText_Rechoose[];
extern const u8 gText_Deselect[];
extern const u8 gText_Rent[];
extern const u8 gText_Others2[];
extern const u8 gText_Yes2[];
extern const u8 gText_Yes3[];
extern const u8 gText_No2[];
extern const u8 gText_No3[];
extern const u8 gText_QuitSwapping[];
extern const u8 gText_AcceptThisPkmn[];
extern const u8 gText_SelectPkmnToAccept[];
extern const u8 gText_SelectPkmnToSwap[];
extern const u8 gText_PkmnSwap[];
extern const u8 gText_Swap[];
extern const u8 gText_Summary2[];
extern const u8 gText_PkmnForSwap[];
extern const u8 gText_SamePkmnInPartyAlready[];
extern const u8 gText_Cancel3[];
#endif // GUARD_STRINGS_H #endif // GUARD_STRINGS_H

View File

@ -8,7 +8,7 @@ extern u8 *const gTVStringVarPtrs[3];
void ClearTVShowData(void); void ClearTVShowData(void);
void sub_80EE184(void); void sub_80EE184(void);
void sub_80EE35C(u16 foeSpecies, u16 species, u8 moveIdx, const u16 *movePtr, u16 betterMove); void TryPutBattleSeminarOnAir(u16 foeSpecies, u16 species, u8 moveIdx, const u16 *movePtr, u16 betterMove);
void TryPutFrontierTVShowOnAir(u16 winStreak, u8 facility); void TryPutFrontierTVShowOnAir(u16 winStreak, u8 facility);
void DoTVShow(void); void DoTVShow(void);
void DoTVShowInSearchOfTrainers(void); void DoTVShowInSearchOfTrainers(void);

View File

@ -25,8 +25,8 @@ const struct BardSound *GetWordSounds(u16 word)
{ {
return gBardSound_InvalidWord; return gBardSound_InvalidWord;
} }
category = word >> 9; category = EC_GROUP(word);
subword = word & 0x1ff; subword = EC_INDEX(word);
switch (category) switch (category)
{ {
case EC_GROUP_POKEMON: case EC_GROUP_POKEMON:

View File

@ -293,7 +293,7 @@ void BattleAI_HandleItemUseBeforeAISetup(u8 defaultScoreMoves)
if ((gBattleTypeFlags & BATTLE_TYPE_TRAINER) if ((gBattleTypeFlags & BATTLE_TYPE_TRAINER)
&& !(gBattleTypeFlags & (BATTLE_TYPE_LINK | BATTLE_TYPE_SAFARI | BATTLE_TYPE_BATTLE_TOWER && !(gBattleTypeFlags & (BATTLE_TYPE_LINK | BATTLE_TYPE_SAFARI | BATTLE_TYPE_BATTLE_TOWER
| BATTLE_TYPE_EREADER_TRAINER | BATTLE_TYPE_SECRET_BASE | BATTLE_TYPE_FRONTIER | BATTLE_TYPE_EREADER_TRAINER | BATTLE_TYPE_SECRET_BASE | BATTLE_TYPE_FRONTIER
| BATTLE_TYPE_INGAME_PARTNER | BATTLE_TYPE_x2000000) | BATTLE_TYPE_INGAME_PARTNER | BATTLE_TYPE_RECORDED_LINK)
) )
) )
{ {

View File

@ -62,7 +62,7 @@ static bool8 ShouldSwitchIfWonderGuard(void)
} }
// Get party information. // Get party information.
if (gBattleTypeFlags & (BATTLE_TYPE_TWO_OPPONENTS | BATTLE_TYPE_x800000)) if (gBattleTypeFlags & (BATTLE_TYPE_TWO_OPPONENTS | BATTLE_TYPE_TOWER_LINK_MULTI))
{ {
if ((gActiveBattler & BIT_FLANK) == B_FLANK_LEFT) if ((gActiveBattler & BIT_FLANK) == B_FLANK_LEFT)
firstId = 0, lastId = 3; firstId = 0, lastId = 3;
@ -158,7 +158,7 @@ static bool8 FindMonThatAbsorbsOpponentsMove(void)
if (gBattleMons[gActiveBattler].ability == absorbingTypeAbility) if (gBattleMons[gActiveBattler].ability == absorbingTypeAbility)
return FALSE; return FALSE;
if (gBattleTypeFlags & (BATTLE_TYPE_TWO_OPPONENTS | BATTLE_TYPE_x800000)) if (gBattleTypeFlags & (BATTLE_TYPE_TWO_OPPONENTS | BATTLE_TYPE_TOWER_LINK_MULTI))
{ {
if ((gActiveBattler & BIT_FLANK) == B_FLANK_LEFT) if ((gActiveBattler & BIT_FLANK) == B_FLANK_LEFT)
firstId = 0, lastId = 3; firstId = 0, lastId = 3;
@ -353,7 +353,7 @@ static bool8 FindMonWithFlagsAndSuperEffective(u8 flags, u8 moduloPercent)
battlerIn2 = gActiveBattler; battlerIn2 = gActiveBattler;
} }
if (gBattleTypeFlags & (BATTLE_TYPE_TWO_OPPONENTS | BATTLE_TYPE_x800000)) if (gBattleTypeFlags & (BATTLE_TYPE_TWO_OPPONENTS | BATTLE_TYPE_TOWER_LINK_MULTI))
{ {
if ((gActiveBattler & BIT_FLANK) == 0) if ((gActiveBattler & BIT_FLANK) == 0)
firstId = 0, lastId = 3; firstId = 0, lastId = 3;
@ -464,7 +464,7 @@ static bool8 ShouldSwitch(void)
battlerIn2 = *activeBattlerPtr; battlerIn2 = *activeBattlerPtr;
} }
if (gBattleTypeFlags & (BATTLE_TYPE_TWO_OPPONENTS | BATTLE_TYPE_x800000)) if (gBattleTypeFlags & (BATTLE_TYPE_TWO_OPPONENTS | BATTLE_TYPE_TOWER_LINK_MULTI))
{ {
if ((gActiveBattler & BIT_FLANK) == B_FLANK_LEFT) if ((gActiveBattler & BIT_FLANK) == B_FLANK_LEFT)
firstId = 0, lastId = 3; firstId = 0, lastId = 3;
@ -555,7 +555,7 @@ void AI_TrySwitchOrUseItem(void)
battlerIn2 = GetBattlerAtPosition(battlerIdentity ^ BIT_FLANK); battlerIn2 = GetBattlerAtPosition(battlerIdentity ^ BIT_FLANK);
} }
if (gBattleTypeFlags & (BATTLE_TYPE_TWO_OPPONENTS | BATTLE_TYPE_x800000)) if (gBattleTypeFlags & (BATTLE_TYPE_TWO_OPPONENTS | BATTLE_TYPE_TOWER_LINK_MULTI))
{ {
if ((gActiveBattler & BIT_FLANK) == B_FLANK_LEFT) if ((gActiveBattler & BIT_FLANK) == B_FLANK_LEFT)
firstId = 0, lastId = 3; firstId = 0, lastId = 3;
@ -661,7 +661,7 @@ u8 GetMostSuitableMonToSwitchInto(void)
battlerIn2 = gActiveBattler; battlerIn2 = gActiveBattler;
} }
if (gBattleTypeFlags & (BATTLE_TYPE_TWO_OPPONENTS | BATTLE_TYPE_x800000)) if (gBattleTypeFlags & (BATTLE_TYPE_TWO_OPPONENTS | BATTLE_TYPE_TOWER_LINK_MULTI))
{ {
if ((gActiveBattler & BIT_FLANK) == B_FLANK_LEFT) if ((gActiveBattler & BIT_FLANK) == B_FLANK_LEFT)
firstId = 0, lastId = 3; firstId = 0, lastId = 3;

View File

@ -4947,7 +4947,6 @@ static void AnimTask_OdorSleuthMovementWaitFinish(u8 taskId)
static void MoveOdorSleuthClone(struct Sprite *sprite) static void MoveOdorSleuthClone(struct Sprite *sprite)
{ {
int zero = 0;
if (++sprite->data[1] > 1) if (++sprite->data[1] > 1)
{ {
sprite->data[1] = 0; sprite->data[1] = 0;

View File

@ -708,7 +708,6 @@ static void sub_810E520(struct Sprite *sprite)
} }
} }
data->unk0_0d = 0; data->unk0_0d = 0;
data->unk2;
} }
data->unk0_1 = 0; data->unk0_1 = 0;
break; break;

View File

@ -564,8 +564,6 @@ static void AnimTask_BlendColorCycleExcludeLoop(u8 taskId)
// See AnimTask_BlendColorCycle. Same, but selects palette by ANIM_TAG_* // See AnimTask_BlendColorCycle. Same, but selects palette by ANIM_TAG_*
void AnimTask_BlendColorCycleByTag(u8 taskId) void AnimTask_BlendColorCycleByTag(u8 taskId)
{ {
u8 paletteIndex;
gTasks[taskId].tPalTag = gBattleAnimArgs[0]; gTasks[taskId].tPalTag = gBattleAnimArgs[0];
gTasks[taskId].tDelay = gBattleAnimArgs[1]; gTasks[taskId].tDelay = gBattleAnimArgs[1];
gTasks[taskId].tNumBlends = gBattleAnimArgs[2]; gTasks[taskId].tNumBlends = gBattleAnimArgs[2];

View File

@ -1551,8 +1551,6 @@ static void SpriteCB_Ball_Block_Step(struct Sprite *sprite)
static void LoadBallParticleGfx(u8 ballId) static void LoadBallParticleGfx(u8 ballId)
{ {
u8 taskId;
if (GetSpriteTileStartByTag(sBallParticleSpriteSheets[ballId].tag) == 0xFFFF) if (GetSpriteTileStartByTag(sBallParticleSpriteSheets[ballId].tag) == 0xFFFF)
{ {
LoadCompressedSpriteSheetUsingHeap(&sBallParticleSpriteSheets[ballId]); LoadCompressedSpriteSheetUsingHeap(&sBallParticleSpriteSheets[ballId]);

View File

@ -881,8 +881,6 @@ static void AnimTask_CreateSurfWave_Step1(u8 taskId)
u16 rgbBuffer; u16 rgbBuffer;
u16 *BGptrX = &gBattle_BG1_X; u16 *BGptrX = &gBattle_BG1_X;
u16 *BGptrY = &gBattle_BG1_Y; u16 *BGptrY = &gBattle_BG1_Y;
u32 palOffset;
u16 palNum;
*BGptrX += gTasks[taskId].data[0]; *BGptrX += gTasks[taskId].data[0];
*BGptrY += gTasks[taskId].data[1]; *BGptrY += gTasks[taskId].data[1];

View File

@ -759,7 +759,7 @@ void LoadBattleMenuWindowGfx(void)
void DrawMainBattleBackground(void) void DrawMainBattleBackground(void)
{ {
if (gBattleTypeFlags & (BATTLE_TYPE_LINK | BATTLE_TYPE_FRONTIER | BATTLE_TYPE_EREADER_TRAINER | BATTLE_TYPE_x2000000)) if (gBattleTypeFlags & (BATTLE_TYPE_LINK | BATTLE_TYPE_FRONTIER | BATTLE_TYPE_EREADER_TRAINER | BATTLE_TYPE_RECORDED_LINK))
{ {
LZDecompressVram(gBattleTerrainTiles_Building, (void*)(BG_CHAR_ADDR(2))); LZDecompressVram(gBattleTerrainTiles_Building, (void*)(BG_CHAR_ADDR(2)));
LZDecompressVram(gBattleTerrainTilemap_Building, (void*)(BG_SCREEN_ADDR(26))); LZDecompressVram(gBattleTerrainTilemap_Building, (void*)(BG_SCREEN_ADDR(26)));
@ -1140,7 +1140,7 @@ void DrawBattleEntryBackground(void)
gBattle_BG2_Y = 0xFF5C; gBattle_BG2_Y = 0xFF5C;
LoadCompressedSpriteSheetUsingHeap(&sVsLettersSpriteSheet); LoadCompressedSpriteSheetUsingHeap(&sVsLettersSpriteSheet);
} }
else if (gBattleTypeFlags & (BATTLE_TYPE_FRONTIER | BATTLE_TYPE_LINK | BATTLE_TYPE_x2000000 | BATTLE_TYPE_EREADER_TRAINER)) else if (gBattleTypeFlags & (BATTLE_TYPE_FRONTIER | BATTLE_TYPE_LINK | BATTLE_TYPE_RECORDED_LINK | BATTLE_TYPE_EREADER_TRAINER))
{ {
if (!(gBattleTypeFlags & BATTLE_TYPE_INGAME_PARTNER) || gPartnerTrainerId == TRAINER_STEVEN_PARTNER) if (!(gBattleTypeFlags & BATTLE_TYPE_INGAME_PARTNER) || gPartnerTrainerId == TRAINER_STEVEN_PARTNER)
{ {
@ -1221,7 +1221,7 @@ bool8 LoadChosenBattleElement(u8 caseId)
LoadCompressedPalette(gBattleTextboxPalette, 0, 0x40); LoadCompressedPalette(gBattleTextboxPalette, 0, 0x40);
break; break;
case 3: case 3:
if (gBattleTypeFlags & (BATTLE_TYPE_FRONTIER | BATTLE_TYPE_LINK | BATTLE_TYPE_x2000000 | BATTLE_TYPE_EREADER_TRAINER)) if (gBattleTypeFlags & (BATTLE_TYPE_FRONTIER | BATTLE_TYPE_LINK | BATTLE_TYPE_RECORDED_LINK | BATTLE_TYPE_EREADER_TRAINER))
{ {
LZDecompressVram(gBattleTerrainTiles_Building, (void*)(BG_CHAR_ADDR(2))); LZDecompressVram(gBattleTerrainTiles_Building, (void*)(BG_CHAR_ADDR(2)));
} }
@ -1280,7 +1280,7 @@ bool8 LoadChosenBattleElement(u8 caseId)
} }
break; break;
case 4: case 4:
if (gBattleTypeFlags & (BATTLE_TYPE_FRONTIER | BATTLE_TYPE_LINK | BATTLE_TYPE_x2000000 | BATTLE_TYPE_EREADER_TRAINER)) if (gBattleTypeFlags & (BATTLE_TYPE_FRONTIER | BATTLE_TYPE_LINK | BATTLE_TYPE_RECORDED_LINK | BATTLE_TYPE_EREADER_TRAINER))
{ {
LZDecompressVram(gBattleTerrainTilemap_Building, (void*)(BG_SCREEN_ADDR(26))); LZDecompressVram(gBattleTerrainTilemap_Building, (void*)(BG_SCREEN_ADDR(26)));
} }
@ -1342,7 +1342,7 @@ bool8 LoadChosenBattleElement(u8 caseId)
} }
break; break;
case 5: case 5:
if (gBattleTypeFlags & (BATTLE_TYPE_FRONTIER | BATTLE_TYPE_LINK | BATTLE_TYPE_x2000000 | BATTLE_TYPE_EREADER_TRAINER)) if (gBattleTypeFlags & (BATTLE_TYPE_FRONTIER | BATTLE_TYPE_LINK | BATTLE_TYPE_RECORDED_LINK | BATTLE_TYPE_EREADER_TRAINER))
{ {
LoadCompressedPalette(gBattleTerrainPalette_Frontier, 0x20, 0x60); LoadCompressedPalette(gBattleTerrainPalette_Frontier, 0x20, 0x60);
} }

View File

@ -69,10 +69,10 @@ static void LinkOpponentHandleTwoReturnValues(void);
static void LinkOpponentHandleChosenMonReturnValue(void); static void LinkOpponentHandleChosenMonReturnValue(void);
static void LinkOpponentHandleOneReturnValue(void); static void LinkOpponentHandleOneReturnValue(void);
static void LinkOpponentHandleOneReturnValue_Duplicate(void); static void LinkOpponentHandleOneReturnValue_Duplicate(void);
static void LinkOpponentHandleCmd37(void); static void LinkOpponentHandleClearUnkVar(void);
static void LinkOpponentHandleCmd38(void); static void LinkOpponentHandleSetUnkVar(void);
static void LinkOpponentHandleCmd39(void); static void LinkOpponentHandleClearUnkFlag(void);
static void LinkOpponentHandleCmd40(void); static void LinkOpponentHandleToggleUnkFlag(void);
static void LinkOpponentHandleHitAnimation(void); static void LinkOpponentHandleHitAnimation(void);
static void LinkOpponentHandleCmd42(void); static void LinkOpponentHandleCmd42(void);
static void LinkOpponentHandlePlaySE(void); static void LinkOpponentHandlePlaySE(void);
@ -104,63 +104,63 @@ static void sub_806782C(void);
static void (*const sLinkOpponentBufferCommands[CONTROLLER_CMDS_COUNT])(void) = static void (*const sLinkOpponentBufferCommands[CONTROLLER_CMDS_COUNT])(void) =
{ {
LinkOpponentHandleGetMonData, [CONTROLLER_GETMONDATA] = LinkOpponentHandleGetMonData,
LinkOpponentHandleGetRawMonData, [CONTROLLER_GETRAWMONDATA] = LinkOpponentHandleGetRawMonData,
LinkOpponentHandleSetMonData, [CONTROLLER_SETMONDATA] = LinkOpponentHandleSetMonData,
LinkOpponentHandleSetRawMonData, [CONTROLLER_SETRAWMONDATA] = LinkOpponentHandleSetRawMonData,
LinkOpponentHandleLoadMonSprite, [CONTROLLER_LOADMONSPRITE] = LinkOpponentHandleLoadMonSprite,
LinkOpponentHandleSwitchInAnim, [CONTROLLER_SWITCHINANIM] = LinkOpponentHandleSwitchInAnim,
LinkOpponentHandleReturnMonToBall, [CONTROLLER_RETURNMONTOBALL] = LinkOpponentHandleReturnMonToBall,
LinkOpponentHandleDrawTrainerPic, [CONTROLLER_DRAWTRAINERPIC] = LinkOpponentHandleDrawTrainerPic,
LinkOpponentHandleTrainerSlide, [CONTROLLER_TRAINERSLIDE] = LinkOpponentHandleTrainerSlide,
LinkOpponentHandleTrainerSlideBack, [CONTROLLER_TRAINERSLIDEBACK] = LinkOpponentHandleTrainerSlideBack,
LinkOpponentHandleFaintAnimation, [CONTROLLER_FAINTANIMATION] = LinkOpponentHandleFaintAnimation,
LinkOpponentHandlePaletteFade, [CONTROLLER_PALETTEFADE] = LinkOpponentHandlePaletteFade,
LinkOpponentHandleSuccessBallThrowAnim, [CONTROLLER_SUCCESSBALLTHROWANIM] = LinkOpponentHandleSuccessBallThrowAnim,
LinkOpponentHandleBallThrowAnim, [CONTROLLER_BALLTHROWANIM] = LinkOpponentHandleBallThrowAnim,
LinkOpponentHandlePause, [CONTROLLER_PAUSE] = LinkOpponentHandlePause,
LinkOpponentHandleMoveAnimation, [CONTROLLER_MOVEANIMATION] = LinkOpponentHandleMoveAnimation,
LinkOpponentHandlePrintString, [CONTROLLER_PRINTSTRING] = LinkOpponentHandlePrintString,
LinkOpponentHandlePrintSelectionString, [CONTROLLER_PRINTSTRINGPLAYERONLY] = LinkOpponentHandlePrintSelectionString,
LinkOpponentHandleChooseAction, [CONTROLLER_CHOOSEACTION] = LinkOpponentHandleChooseAction,
LinkOpponentHandleUnknownYesNoBox, [CONTROLLER_UNKNOWNYESNOBOX] = LinkOpponentHandleUnknownYesNoBox,
LinkOpponentHandleChooseMove, [CONTROLLER_CHOOSEMOVE] = LinkOpponentHandleChooseMove,
LinkOpponentHandleChooseItem, [CONTROLLER_OPENBAG] = LinkOpponentHandleChooseItem,
LinkOpponentHandleChoosePokemon, [CONTROLLER_CHOOSEPOKEMON] = LinkOpponentHandleChoosePokemon,
LinkOpponentHandleCmd23, [CONTROLLER_23] = LinkOpponentHandleCmd23,
LinkOpponentHandleHealthBarUpdate, [CONTROLLER_HEALTHBARUPDATE] = LinkOpponentHandleHealthBarUpdate,
LinkOpponentHandleExpUpdate, [CONTROLLER_EXPUPDATE] = LinkOpponentHandleExpUpdate,
LinkOpponentHandleStatusIconUpdate, [CONTROLLER_STATUSICONUPDATE] = LinkOpponentHandleStatusIconUpdate,
LinkOpponentHandleStatusAnimation, [CONTROLLER_STATUSANIMATION] = LinkOpponentHandleStatusAnimation,
LinkOpponentHandleStatusXor, [CONTROLLER_STATUSXOR] = LinkOpponentHandleStatusXor,
LinkOpponentHandleDataTransfer, [CONTROLLER_DATATRANSFER] = LinkOpponentHandleDataTransfer,
LinkOpponentHandleDMA3Transfer, [CONTROLLER_DMA3TRANSFER] = LinkOpponentHandleDMA3Transfer,
LinkOpponentHandlePlayBGM, [CONTROLLER_PLAYBGM] = LinkOpponentHandlePlayBGM,
LinkOpponentHandleCmd32, [CONTROLLER_32] = LinkOpponentHandleCmd32,
LinkOpponentHandleTwoReturnValues, [CONTROLLER_TWORETURNVALUES] = LinkOpponentHandleTwoReturnValues,
LinkOpponentHandleChosenMonReturnValue, [CONTROLLER_CHOSENMONRETURNVALUE] = LinkOpponentHandleChosenMonReturnValue,
LinkOpponentHandleOneReturnValue, [CONTROLLER_ONERETURNVALUE] = LinkOpponentHandleOneReturnValue,
LinkOpponentHandleOneReturnValue_Duplicate, [CONTROLLER_ONERETURNVALUE_DUPLICATE] = LinkOpponentHandleOneReturnValue_Duplicate,
LinkOpponentHandleCmd37, [CONTROLLER_CLEARUNKVAR] = LinkOpponentHandleClearUnkVar,
LinkOpponentHandleCmd38, [CONTROLLER_SETUNKVAR] = LinkOpponentHandleSetUnkVar,
LinkOpponentHandleCmd39, [CONTROLLER_CLEARUNKFLAG] = LinkOpponentHandleClearUnkFlag,
LinkOpponentHandleCmd40, [CONTROLLER_TOGGLEUNKFLAG] = LinkOpponentHandleToggleUnkFlag,
LinkOpponentHandleHitAnimation, [CONTROLLER_HITANIMATION] = LinkOpponentHandleHitAnimation,
LinkOpponentHandleCmd42, [CONTROLLER_42] = LinkOpponentHandleCmd42,
LinkOpponentHandlePlaySE, [CONTROLLER_PLAYSE] = LinkOpponentHandlePlaySE,
LinkOpponentHandlePlayFanfareOrBGM, [CONTROLLER_PLAYFANFAREORBGM] = LinkOpponentHandlePlayFanfareOrBGM,
LinkOpponentHandleFaintingCry, [CONTROLLER_FAINTINGCRY] = LinkOpponentHandleFaintingCry,
LinkOpponentHandleIntroSlide, [CONTROLLER_INTROSLIDE] = LinkOpponentHandleIntroSlide,
LinkOpponentHandleIntroTrainerBallThrow, [CONTROLLER_INTROTRAINERBALLTHROW] = LinkOpponentHandleIntroTrainerBallThrow,
LinkOpponentHandleDrawPartyStatusSummary, [CONTROLLER_DRAWPARTYSTATUSSUMMARY] = LinkOpponentHandleDrawPartyStatusSummary,
LinkOpponentHandleHidePartyStatusSummary, [CONTROLLER_HIDEPARTYSTATUSSUMMARY] = LinkOpponentHandleHidePartyStatusSummary,
LinkOpponentHandleEndBounceEffect, [CONTROLLER_ENDBOUNCE] = LinkOpponentHandleEndBounceEffect,
LinkOpponentHandleSpriteInvisibility, [CONTROLLER_SPRITEINVISIBILITY] = LinkOpponentHandleSpriteInvisibility,
LinkOpponentHandleBattleAnimation, [CONTROLLER_BATTLEANIMATION] = LinkOpponentHandleBattleAnimation,
LinkOpponentHandleLinkStandbyMsg, [CONTROLLER_LINKSTANDBYMSG] = LinkOpponentHandleLinkStandbyMsg,
LinkOpponentHandleResetActionMoveSelection, [CONTROLLER_RESETACTIONMOVESELECTION] = LinkOpponentHandleResetActionMoveSelection,
LinkOpponentHandleCmd55, [CONTROLLER_55] = LinkOpponentHandleCmd55,
LinkOpponentCmdEnd [CONTROLLER_TERMINATOR_NOP] = LinkOpponentCmdEnd
}; };
static void nullsub_28(void) static void nullsub_28(void)
@ -1603,27 +1603,27 @@ static void LinkOpponentHandleOneReturnValue_Duplicate(void)
LinkOpponentBufferExecCompleted(); LinkOpponentBufferExecCompleted();
} }
static void LinkOpponentHandleCmd37(void) static void LinkOpponentHandleClearUnkVar(void)
{ {
gUnknown_02022D0C.field_0 = 0; gUnusedControllerStruct.unk = 0;
LinkOpponentBufferExecCompleted(); LinkOpponentBufferExecCompleted();
} }
static void LinkOpponentHandleCmd38(void) static void LinkOpponentHandleSetUnkVar(void)
{ {
gUnknown_02022D0C.field_0 = gBattleBufferA[gActiveBattler][1]; gUnusedControllerStruct.unk = gBattleBufferA[gActiveBattler][1];
LinkOpponentBufferExecCompleted(); LinkOpponentBufferExecCompleted();
} }
static void LinkOpponentHandleCmd39(void) static void LinkOpponentHandleClearUnkFlag(void)
{ {
gUnknown_02022D0C.flag_x80 = 0; gUnusedControllerStruct.flag = 0;
LinkOpponentBufferExecCompleted(); LinkOpponentBufferExecCompleted();
} }
static void LinkOpponentHandleCmd40(void) static void LinkOpponentHandleToggleUnkFlag(void)
{ {
gUnknown_02022D0C.flag_x80 ^= 1; gUnusedControllerStruct.flag ^= 1;
LinkOpponentBufferExecCompleted(); LinkOpponentBufferExecCompleted();
} }
@ -1692,7 +1692,6 @@ static void LinkOpponentHandleIntroSlide(void)
static void LinkOpponentHandleIntroTrainerBallThrow(void) static void LinkOpponentHandleIntroTrainerBallThrow(void)
{ {
u8 paletteNum;
u8 taskId; u8 taskId;
SetSpritePrimaryCoordsFromSecondaryCoords(&gSprites[gBattlerSpriteIds[gActiveBattler]]); SetSpritePrimaryCoordsFromSecondaryCoords(&gSprites[gBattlerSpriteIds[gActiveBattler]]);

View File

@ -67,10 +67,10 @@ static void LinkPartnerHandleTwoReturnValues(void);
static void LinkPartnerHandleChosenMonReturnValue(void); static void LinkPartnerHandleChosenMonReturnValue(void);
static void LinkPartnerHandleOneReturnValue(void); static void LinkPartnerHandleOneReturnValue(void);
static void LinkPartnerHandleOneReturnValue_Duplicate(void); static void LinkPartnerHandleOneReturnValue_Duplicate(void);
static void LinkPartnerHandleCmd37(void); static void LinkPartnerHandleClearUnkVar(void);
static void LinkPartnerHandleCmd38(void); static void LinkPartnerHandleSetUnkVar(void);
static void LinkPartnerHandleCmd39(void); static void LinkPartnerHandleClearUnkFlag(void);
static void LinkPartnerHandleCmd40(void); static void LinkPartnerHandleToggleUnkFlag(void);
static void LinkPartnerHandleHitAnimation(void); static void LinkPartnerHandleHitAnimation(void);
static void LinkPartnerHandleCmd42(void); static void LinkPartnerHandleCmd42(void);
static void LinkPartnerHandlePlaySE(void); static void LinkPartnerHandlePlaySE(void);
@ -101,63 +101,63 @@ static void sub_814DE9C(void);
static void (*const sLinkPartnerBufferCommands[CONTROLLER_CMDS_COUNT])(void) = static void (*const sLinkPartnerBufferCommands[CONTROLLER_CMDS_COUNT])(void) =
{ {
LinkPartnerHandleGetMonData, [CONTROLLER_GETMONDATA] = LinkPartnerHandleGetMonData,
LinkPartnerHandleGetRawMonData, [CONTROLLER_GETRAWMONDATA] = LinkPartnerHandleGetRawMonData,
LinkPartnerHandleSetMonData, [CONTROLLER_SETMONDATA] = LinkPartnerHandleSetMonData,
LinkPartnerHandleSetRawMonData, [CONTROLLER_SETRAWMONDATA] = LinkPartnerHandleSetRawMonData,
LinkPartnerHandleLoadMonSprite, [CONTROLLER_LOADMONSPRITE] = LinkPartnerHandleLoadMonSprite,
LinkPartnerHandleSwitchInAnim, [CONTROLLER_SWITCHINANIM] = LinkPartnerHandleSwitchInAnim,
LinkPartnerHandleReturnMonToBall, [CONTROLLER_RETURNMONTOBALL] = LinkPartnerHandleReturnMonToBall,
LinkPartnerHandleDrawTrainerPic, [CONTROLLER_DRAWTRAINERPIC] = LinkPartnerHandleDrawTrainerPic,
LinkPartnerHandleTrainerSlide, [CONTROLLER_TRAINERSLIDE] = LinkPartnerHandleTrainerSlide,
LinkPartnerHandleTrainerSlideBack, [CONTROLLER_TRAINERSLIDEBACK] = LinkPartnerHandleTrainerSlideBack,
LinkPartnerHandleFaintAnimation, [CONTROLLER_FAINTANIMATION] = LinkPartnerHandleFaintAnimation,
LinkPartnerHandlePaletteFade, [CONTROLLER_PALETTEFADE] = LinkPartnerHandlePaletteFade,
LinkPartnerHandleSuccessBallThrowAnim, [CONTROLLER_SUCCESSBALLTHROWANIM] = LinkPartnerHandleSuccessBallThrowAnim,
LinkPartnerHandleBallThrowAnim, [CONTROLLER_BALLTHROWANIM] = LinkPartnerHandleBallThrowAnim,
LinkPartnerHandlePause, [CONTROLLER_PAUSE] = LinkPartnerHandlePause,
LinkPartnerHandleMoveAnimation, [CONTROLLER_MOVEANIMATION] = LinkPartnerHandleMoveAnimation,
LinkPartnerHandlePrintString, [CONTROLLER_PRINTSTRING] = LinkPartnerHandlePrintString,
LinkPartnerHandlePrintSelectionString, [CONTROLLER_PRINTSTRINGPLAYERONLY] = LinkPartnerHandlePrintSelectionString,
LinkPartnerHandleChooseAction, [CONTROLLER_CHOOSEACTION] = LinkPartnerHandleChooseAction,
LinkPartnerHandleUnknownYesNoBox, [CONTROLLER_UNKNOWNYESNOBOX] = LinkPartnerHandleUnknownYesNoBox,
LinkPartnerHandleChooseMove, [CONTROLLER_CHOOSEMOVE] = LinkPartnerHandleChooseMove,
LinkPartnerHandleChooseItem, [CONTROLLER_OPENBAG] = LinkPartnerHandleChooseItem,
LinkPartnerHandleChoosePokemon, [CONTROLLER_CHOOSEPOKEMON] = LinkPartnerHandleChoosePokemon,
LinkPartnerHandleCmd23, [CONTROLLER_23] = LinkPartnerHandleCmd23,
LinkPartnerHandleHealthBarUpdate, [CONTROLLER_HEALTHBARUPDATE] = LinkPartnerHandleHealthBarUpdate,
LinkPartnerHandleExpUpdate, [CONTROLLER_EXPUPDATE] = LinkPartnerHandleExpUpdate,
LinkPartnerHandleStatusIconUpdate, [CONTROLLER_STATUSICONUPDATE] = LinkPartnerHandleStatusIconUpdate,
LinkPartnerHandleStatusAnimation, [CONTROLLER_STATUSANIMATION] = LinkPartnerHandleStatusAnimation,
LinkPartnerHandleStatusXor, [CONTROLLER_STATUSXOR] = LinkPartnerHandleStatusXor,
LinkPartnerHandleDataTransfer, [CONTROLLER_DATATRANSFER] = LinkPartnerHandleDataTransfer,
LinkPartnerHandleDMA3Transfer, [CONTROLLER_DMA3TRANSFER] = LinkPartnerHandleDMA3Transfer,
LinkPartnerHandlePlayBGM, [CONTROLLER_PLAYBGM] = LinkPartnerHandlePlayBGM,
LinkPartnerHandleCmd32, [CONTROLLER_32] = LinkPartnerHandleCmd32,
LinkPartnerHandleTwoReturnValues, [CONTROLLER_TWORETURNVALUES] = LinkPartnerHandleTwoReturnValues,
LinkPartnerHandleChosenMonReturnValue, [CONTROLLER_CHOSENMONRETURNVALUE] = LinkPartnerHandleChosenMonReturnValue,
LinkPartnerHandleOneReturnValue, [CONTROLLER_ONERETURNVALUE] = LinkPartnerHandleOneReturnValue,
LinkPartnerHandleOneReturnValue_Duplicate, [CONTROLLER_ONERETURNVALUE_DUPLICATE] = LinkPartnerHandleOneReturnValue_Duplicate,
LinkPartnerHandleCmd37, [CONTROLLER_CLEARUNKVAR] = LinkPartnerHandleClearUnkVar,
LinkPartnerHandleCmd38, [CONTROLLER_SETUNKVAR] = LinkPartnerHandleSetUnkVar,
LinkPartnerHandleCmd39, [CONTROLLER_CLEARUNKFLAG] = LinkPartnerHandleClearUnkFlag,
LinkPartnerHandleCmd40, [CONTROLLER_TOGGLEUNKFLAG] = LinkPartnerHandleToggleUnkFlag,
LinkPartnerHandleHitAnimation, [CONTROLLER_HITANIMATION] = LinkPartnerHandleHitAnimation,
LinkPartnerHandleCmd42, [CONTROLLER_42] = LinkPartnerHandleCmd42,
LinkPartnerHandlePlaySE, [CONTROLLER_PLAYSE] = LinkPartnerHandlePlaySE,
LinkPartnerHandlePlayFanfareOrBGM, [CONTROLLER_PLAYFANFAREORBGM] = LinkPartnerHandlePlayFanfareOrBGM,
LinkPartnerHandleFaintingCry, [CONTROLLER_FAINTINGCRY] = LinkPartnerHandleFaintingCry,
LinkPartnerHandleIntroSlide, [CONTROLLER_INTROSLIDE] = LinkPartnerHandleIntroSlide,
LinkPartnerHandleIntroTrainerBallThrow, [CONTROLLER_INTROTRAINERBALLTHROW] = LinkPartnerHandleIntroTrainerBallThrow,
LinkPartnerHandleDrawPartyStatusSummary, [CONTROLLER_DRAWPARTYSTATUSSUMMARY] = LinkPartnerHandleDrawPartyStatusSummary,
LinkPartnerHandleHidePartyStatusSummary, [CONTROLLER_HIDEPARTYSTATUSSUMMARY] = LinkPartnerHandleHidePartyStatusSummary,
LinkPartnerHandleEndBounceEffect, [CONTROLLER_ENDBOUNCE] = LinkPartnerHandleEndBounceEffect,
LinkPartnerHandleSpriteInvisibility, [CONTROLLER_SPRITEINVISIBILITY] = LinkPartnerHandleSpriteInvisibility,
LinkPartnerHandleBattleAnimation, [CONTROLLER_BATTLEANIMATION] = LinkPartnerHandleBattleAnimation,
LinkPartnerHandleLinkStandbyMsg, [CONTROLLER_LINKSTANDBYMSG] = LinkPartnerHandleLinkStandbyMsg,
LinkPartnerHandleResetActionMoveSelection, [CONTROLLER_RESETACTIONMOVESELECTION] = LinkPartnerHandleResetActionMoveSelection,
LinkPartnerHandleCmd55, [CONTROLLER_55] = LinkPartnerHandleCmd55,
LinkPartnerCmdEnd [CONTROLLER_TERMINATOR_NOP] = LinkPartnerCmdEnd
}; };
static void SpriteCB_Null2(void) static void SpriteCB_Null2(void)
@ -1427,27 +1427,27 @@ static void LinkPartnerHandleOneReturnValue_Duplicate(void)
LinkPartnerBufferExecCompleted(); LinkPartnerBufferExecCompleted();
} }
static void LinkPartnerHandleCmd37(void) static void LinkPartnerHandleClearUnkVar(void)
{ {
gUnknown_02022D0C.field_0 = 0; gUnusedControllerStruct.unk = 0;
LinkPartnerBufferExecCompleted(); LinkPartnerBufferExecCompleted();
} }
static void LinkPartnerHandleCmd38(void) static void LinkPartnerHandleSetUnkVar(void)
{ {
gUnknown_02022D0C.field_0 = gBattleBufferA[gActiveBattler][1]; gUnusedControllerStruct.unk = gBattleBufferA[gActiveBattler][1];
LinkPartnerBufferExecCompleted(); LinkPartnerBufferExecCompleted();
} }
static void LinkPartnerHandleCmd39(void) static void LinkPartnerHandleClearUnkFlag(void)
{ {
gUnknown_02022D0C.flag_x80 = 0; gUnusedControllerStruct.flag = 0;
LinkPartnerBufferExecCompleted(); LinkPartnerBufferExecCompleted();
} }
static void LinkPartnerHandleCmd40(void) static void LinkPartnerHandleToggleUnkFlag(void)
{ {
gUnknown_02022D0C.flag_x80 ^= 1; gUnusedControllerStruct.flag ^= 1;
LinkPartnerBufferExecCompleted(); LinkPartnerBufferExecCompleted();
} }

View File

@ -74,10 +74,10 @@ static void OpponentHandleTwoReturnValues(void);
static void OpponentHandleChosenMonReturnValue(void); static void OpponentHandleChosenMonReturnValue(void);
static void OpponentHandleOneReturnValue(void); static void OpponentHandleOneReturnValue(void);
static void OpponentHandleOneReturnValue_Duplicate(void); static void OpponentHandleOneReturnValue_Duplicate(void);
static void OpponentHandleCmd37(void); static void OpponentHandleClearUnkVar(void);
static void OpponentHandleCmd38(void); static void OpponentHandleSetUnkVar(void);
static void OpponentHandleCmd39(void); static void OpponentHandleClearUnkFlag(void);
static void OpponentHandleCmd40(void); static void OpponentHandleToggleUnkFlag(void);
static void OpponentHandleHitAnimation(void); static void OpponentHandleHitAnimation(void);
static void OpponentHandleCmd42(void); static void OpponentHandleCmd42(void);
static void OpponentHandlePlaySE(void); static void OpponentHandlePlaySE(void);
@ -109,67 +109,67 @@ static void sub_8062A2C(void);
static void (*const sOpponentBufferCommands[CONTROLLER_CMDS_COUNT])(void) = static void (*const sOpponentBufferCommands[CONTROLLER_CMDS_COUNT])(void) =
{ {
OpponentHandleGetMonData, [CONTROLLER_GETMONDATA] = OpponentHandleGetMonData,
OpponentHandleGetRawMonData, [CONTROLLER_GETRAWMONDATA] = OpponentHandleGetRawMonData,
OpponentHandleSetMonData, [CONTROLLER_SETMONDATA] = OpponentHandleSetMonData,
OpponentHandleSetRawMonData, [CONTROLLER_SETRAWMONDATA] = OpponentHandleSetRawMonData,
OpponentHandleLoadMonSprite, [CONTROLLER_LOADMONSPRITE] = OpponentHandleLoadMonSprite,
OpponentHandleSwitchInAnim, [CONTROLLER_SWITCHINANIM] = OpponentHandleSwitchInAnim,
OpponentHandleReturnMonToBall, [CONTROLLER_RETURNMONTOBALL] = OpponentHandleReturnMonToBall,
OpponentHandleDrawTrainerPic, [CONTROLLER_DRAWTRAINERPIC] = OpponentHandleDrawTrainerPic,
OpponentHandleTrainerSlide, [CONTROLLER_TRAINERSLIDE] = OpponentHandleTrainerSlide,
OpponentHandleTrainerSlideBack, [CONTROLLER_TRAINERSLIDEBACK] = OpponentHandleTrainerSlideBack,
OpponentHandleFaintAnimation, [CONTROLLER_FAINTANIMATION] = OpponentHandleFaintAnimation,
OpponentHandlePaletteFade, [CONTROLLER_PALETTEFADE] = OpponentHandlePaletteFade,
OpponentHandleSuccessBallThrowAnim, [CONTROLLER_SUCCESSBALLTHROWANIM] = OpponentHandleSuccessBallThrowAnim,
OpponentHandleBallThrow, [CONTROLLER_BALLTHROWANIM] = OpponentHandleBallThrow,
OpponentHandlePause, [CONTROLLER_PAUSE] = OpponentHandlePause,
OpponentHandleMoveAnimation, [CONTROLLER_MOVEANIMATION] = OpponentHandleMoveAnimation,
OpponentHandlePrintString, [CONTROLLER_PRINTSTRING] = OpponentHandlePrintString,
OpponentHandlePrintSelectionString, [CONTROLLER_PRINTSTRINGPLAYERONLY] = OpponentHandlePrintSelectionString,
OpponentHandleChooseAction, [CONTROLLER_CHOOSEACTION] = OpponentHandleChooseAction,
OpponentHandleUnknownYesNoBox, [CONTROLLER_UNKNOWNYESNOBOX] = OpponentHandleUnknownYesNoBox,
OpponentHandleChooseMove, [CONTROLLER_CHOOSEMOVE] = OpponentHandleChooseMove,
OpponentHandleChooseItem, [CONTROLLER_OPENBAG] = OpponentHandleChooseItem,
OpponentHandleChoosePokemon, [CONTROLLER_CHOOSEPOKEMON] = OpponentHandleChoosePokemon,
OpponentHandleCmd23, [CONTROLLER_23] = OpponentHandleCmd23,
OpponentHandleHealthBarUpdate, [CONTROLLER_HEALTHBARUPDATE] = OpponentHandleHealthBarUpdate,
OpponentHandleExpUpdate, [CONTROLLER_EXPUPDATE] = OpponentHandleExpUpdate,
OpponentHandleStatusIconUpdate, [CONTROLLER_STATUSICONUPDATE] = OpponentHandleStatusIconUpdate,
OpponentHandleStatusAnimation, [CONTROLLER_STATUSANIMATION] = OpponentHandleStatusAnimation,
OpponentHandleStatusXor, [CONTROLLER_STATUSXOR] = OpponentHandleStatusXor,
OpponentHandleDataTransfer, [CONTROLLER_DATATRANSFER] = OpponentHandleDataTransfer,
OpponentHandleDMA3Transfer, [CONTROLLER_DMA3TRANSFER] = OpponentHandleDMA3Transfer,
OpponentHandlePlayBGM, [CONTROLLER_PLAYBGM] = OpponentHandlePlayBGM,
OpponentHandleCmd32, [CONTROLLER_32] = OpponentHandleCmd32,
OpponentHandleTwoReturnValues, [CONTROLLER_TWORETURNVALUES] = OpponentHandleTwoReturnValues,
OpponentHandleChosenMonReturnValue, [CONTROLLER_CHOSENMONRETURNVALUE] = OpponentHandleChosenMonReturnValue,
OpponentHandleOneReturnValue, [CONTROLLER_ONERETURNVALUE] = OpponentHandleOneReturnValue,
OpponentHandleOneReturnValue_Duplicate, [CONTROLLER_ONERETURNVALUE_DUPLICATE] = OpponentHandleOneReturnValue_Duplicate,
OpponentHandleCmd37, [CONTROLLER_CLEARUNKVAR] = OpponentHandleClearUnkVar,
OpponentHandleCmd38, [CONTROLLER_SETUNKVAR] = OpponentHandleSetUnkVar,
OpponentHandleCmd39, [CONTROLLER_CLEARUNKFLAG] = OpponentHandleClearUnkFlag,
OpponentHandleCmd40, [CONTROLLER_TOGGLEUNKFLAG] = OpponentHandleToggleUnkFlag,
OpponentHandleHitAnimation, [CONTROLLER_HITANIMATION] = OpponentHandleHitAnimation,
OpponentHandleCmd42, [CONTROLLER_42] = OpponentHandleCmd42,
OpponentHandlePlaySE, [CONTROLLER_PLAYSE] = OpponentHandlePlaySE,
OpponentHandlePlayFanfareOrBGM, [CONTROLLER_PLAYFANFAREORBGM] = OpponentHandlePlayFanfareOrBGM,
OpponentHandleFaintingCry, [CONTROLLER_FAINTINGCRY] = OpponentHandleFaintingCry,
OpponentHandleIntroSlide, [CONTROLLER_INTROSLIDE] = OpponentHandleIntroSlide,
OpponentHandleIntroTrainerBallThrow, [CONTROLLER_INTROTRAINERBALLTHROW] = OpponentHandleIntroTrainerBallThrow,
OpponentHandleDrawPartyStatusSummary, [CONTROLLER_DRAWPARTYSTATUSSUMMARY] = OpponentHandleDrawPartyStatusSummary,
OpponentHandleHidePartyStatusSummary, [CONTROLLER_HIDEPARTYSTATUSSUMMARY] = OpponentHandleHidePartyStatusSummary,
OpponentHandleEndBounceEffect, [CONTROLLER_ENDBOUNCE] = OpponentHandleEndBounceEffect,
OpponentHandleSpriteInvisibility, [CONTROLLER_SPRITEINVISIBILITY] = OpponentHandleSpriteInvisibility,
OpponentHandleBattleAnimation, [CONTROLLER_BATTLEANIMATION] = OpponentHandleBattleAnimation,
OpponentHandleLinkStandbyMsg, [CONTROLLER_LINKSTANDBYMSG] = OpponentHandleLinkStandbyMsg,
OpponentHandleResetActionMoveSelection, [CONTROLLER_RESETACTIONMOVESELECTION] = OpponentHandleResetActionMoveSelection,
OpponentHandleCmd55, [CONTROLLER_55] = OpponentHandleCmd55,
OpponentCmdEnd [CONTROLLER_TERMINATOR_NOP] = OpponentCmdEnd
}; };
// unknown unused data // unknown unused data
static const u8 sUnknown_0831C7AC[] = {0xB0, 0xB0, 0xC8, 0x98, 0x28, 0x28, 0x28, 0x20}; static const u8 sUnused[] = {0xB0, 0xB0, 0xC8, 0x98, 0x28, 0x28, 0x28, 0x20};
static void nullsub_26(void) static void nullsub_26(void)
{ {
@ -1259,7 +1259,7 @@ static void OpponentHandleDrawTrainerPic(void)
} }
else if (gBattleTypeFlags & BATTLE_TYPE_FRONTIER) else if (gBattleTypeFlags & BATTLE_TYPE_FRONTIER)
{ {
if (gBattleTypeFlags & (BATTLE_TYPE_TWO_OPPONENTS | BATTLE_TYPE_x800000)) if (gBattleTypeFlags & (BATTLE_TYPE_TWO_OPPONENTS | BATTLE_TYPE_TOWER_LINK_MULTI))
{ {
if (gActiveBattler == 1) if (gActiveBattler == 1)
trainerPicId = GetFrontierTrainerFrontSpriteId(gTrainerBattleOpponent_A); trainerPicId = GetFrontierTrainerFrontSpriteId(gTrainerBattleOpponent_A);
@ -1343,7 +1343,7 @@ static void OpponentHandleTrainerSlide(void)
} }
else if (gBattleTypeFlags & BATTLE_TYPE_FRONTIER) else if (gBattleTypeFlags & BATTLE_TYPE_FRONTIER)
{ {
if (gBattleTypeFlags & (BATTLE_TYPE_TWO_OPPONENTS | BATTLE_TYPE_x800000)) if (gBattleTypeFlags & (BATTLE_TYPE_TWO_OPPONENTS | BATTLE_TYPE_TOWER_LINK_MULTI))
{ {
if (gActiveBattler == 1) if (gActiveBattler == 1)
trainerPicId = GetFrontierTrainerFrontSpriteId(gTrainerBattleOpponent_A); trainerPicId = GetFrontierTrainerFrontSpriteId(gTrainerBattleOpponent_A);
@ -1631,7 +1631,7 @@ static void OpponentHandleChoosePokemon(void)
battler2 = GetBattlerAtPosition(B_POSITION_OPPONENT_RIGHT); battler2 = GetBattlerAtPosition(B_POSITION_OPPONENT_RIGHT);
} }
if (gBattleTypeFlags & (BATTLE_TYPE_TWO_OPPONENTS | BATTLE_TYPE_x800000)) if (gBattleTypeFlags & (BATTLE_TYPE_TWO_OPPONENTS | BATTLE_TYPE_TOWER_LINK_MULTI))
{ {
if (gActiveBattler == 1) if (gActiveBattler == 1)
firstId = 0, lastId = 3; firstId = 0, lastId = 3;
@ -1768,27 +1768,27 @@ static void OpponentHandleOneReturnValue_Duplicate(void)
OpponentBufferExecCompleted(); OpponentBufferExecCompleted();
} }
static void OpponentHandleCmd37(void) static void OpponentHandleClearUnkVar(void)
{ {
gUnknown_02022D0C.field_0 = 0; gUnusedControllerStruct.unk = 0;
OpponentBufferExecCompleted(); OpponentBufferExecCompleted();
} }
static void OpponentHandleCmd38(void) static void OpponentHandleSetUnkVar(void)
{ {
gUnknown_02022D0C.field_0 = gBattleBufferA[gActiveBattler][1]; gUnusedControllerStruct.unk = gBattleBufferA[gActiveBattler][1];
OpponentBufferExecCompleted(); OpponentBufferExecCompleted();
} }
static void OpponentHandleCmd39(void) static void OpponentHandleClearUnkFlag(void)
{ {
gUnknown_02022D0C.flag_x80 = 0; gUnusedControllerStruct.flag = 0;
OpponentBufferExecCompleted(); OpponentBufferExecCompleted();
} }
static void OpponentHandleCmd40(void) static void OpponentHandleToggleUnkFlag(void)
{ {
gUnknown_02022D0C.flag_x80 ^= 1; gUnusedControllerStruct.flag ^= 1;
OpponentBufferExecCompleted(); OpponentBufferExecCompleted();
} }
@ -1857,7 +1857,6 @@ static void OpponentHandleIntroSlide(void)
static void OpponentHandleIntroTrainerBallThrow(void) static void OpponentHandleIntroTrainerBallThrow(void)
{ {
u8 paletteNum;
u8 taskId; u8 taskId;
SetSpritePrimaryCoordsFromSecondaryCoords(&gSprites[gBattlerSpriteIds[gActiveBattler]]); SetSpritePrimaryCoordsFromSecondaryCoords(&gSprites[gBattlerSpriteIds[gActiveBattler]]);

View File

@ -75,10 +75,10 @@ static void PlayerHandleTwoReturnValues(void);
static void PlayerHandleChosenMonReturnValue(void); static void PlayerHandleChosenMonReturnValue(void);
static void PlayerHandleOneReturnValue(void); static void PlayerHandleOneReturnValue(void);
static void PlayerHandleOneReturnValue_Duplicate(void); static void PlayerHandleOneReturnValue_Duplicate(void);
static void PlayerHandleCmd37(void); static void PlayerHandleClearUnkVar(void);
static void PlayerHandleCmd38(void); static void PlayerHandleSetUnkVar(void);
static void PlayerHandleCmd39(void); static void PlayerHandleClearUnkFlag(void);
static void PlayerHandleCmd40(void); static void PlayerHandleToggleUnkFlag(void);
static void PlayerHandleHitAnimation(void); static void PlayerHandleHitAnimation(void);
static void PlayerHandleCmd42(void); static void PlayerHandleCmd42(void);
static void PlayerHandlePlaySE(void); static void PlayerHandlePlaySE(void);
@ -125,69 +125,69 @@ static void sub_805CE38(void);
static void (*const sPlayerBufferCommands[CONTROLLER_CMDS_COUNT])(void) = static void (*const sPlayerBufferCommands[CONTROLLER_CMDS_COUNT])(void) =
{ {
PlayerHandleGetMonData, [CONTROLLER_GETMONDATA] = PlayerHandleGetMonData,
PlayerHandleGetRawMonData, [CONTROLLER_GETRAWMONDATA] = PlayerHandleGetRawMonData,
PlayerHandleSetMonData, [CONTROLLER_SETMONDATA] = PlayerHandleSetMonData,
PlayerHandleSetRawMonData, [CONTROLLER_SETRAWMONDATA] = PlayerHandleSetRawMonData,
PlayerHandleLoadMonSprite, [CONTROLLER_LOADMONSPRITE] = PlayerHandleLoadMonSprite,
PlayerHandleSwitchInAnim, [CONTROLLER_SWITCHINANIM] = PlayerHandleSwitchInAnim,
PlayerHandleReturnMonToBall, [CONTROLLER_RETURNMONTOBALL] = PlayerHandleReturnMonToBall,
PlayerHandleDrawTrainerPic, [CONTROLLER_DRAWTRAINERPIC] = PlayerHandleDrawTrainerPic,
PlayerHandleTrainerSlide, [CONTROLLER_TRAINERSLIDE] = PlayerHandleTrainerSlide,
PlayerHandleTrainerSlideBack, [CONTROLLER_TRAINERSLIDEBACK] = PlayerHandleTrainerSlideBack,
PlayerHandleFaintAnimation, [CONTROLLER_FAINTANIMATION] = PlayerHandleFaintAnimation,
PlayerHandlePaletteFade, [CONTROLLER_PALETTEFADE] = PlayerHandlePaletteFade,
PlayerHandleSuccessBallThrowAnim, [CONTROLLER_SUCCESSBALLTHROWANIM] = PlayerHandleSuccessBallThrowAnim,
PlayerHandleBallThrowAnim, [CONTROLLER_BALLTHROWANIM] = PlayerHandleBallThrowAnim,
PlayerHandlePause, [CONTROLLER_PAUSE] = PlayerHandlePause,
PlayerHandleMoveAnimation, [CONTROLLER_MOVEANIMATION] = PlayerHandleMoveAnimation,
PlayerHandlePrintString, [CONTROLLER_PRINTSTRING] = PlayerHandlePrintString,
PlayerHandlePrintSelectionString, [CONTROLLER_PRINTSTRINGPLAYERONLY] = PlayerHandlePrintSelectionString,
PlayerHandleChooseAction, [CONTROLLER_CHOOSEACTION] = PlayerHandleChooseAction,
PlayerHandleUnknownYesNoBox, [CONTROLLER_UNKNOWNYESNOBOX] = PlayerHandleUnknownYesNoBox,
PlayerHandleChooseMove, [CONTROLLER_CHOOSEMOVE] = PlayerHandleChooseMove,
PlayerHandleChooseItem, [CONTROLLER_OPENBAG] = PlayerHandleChooseItem,
PlayerHandleChoosePokemon, [CONTROLLER_CHOOSEPOKEMON] = PlayerHandleChoosePokemon,
PlayerHandleCmd23, [CONTROLLER_23] = PlayerHandleCmd23,
PlayerHandleHealthBarUpdate, [CONTROLLER_HEALTHBARUPDATE] = PlayerHandleHealthBarUpdate,
PlayerHandleExpUpdate, [CONTROLLER_EXPUPDATE] = PlayerHandleExpUpdate,
PlayerHandleStatusIconUpdate, [CONTROLLER_STATUSICONUPDATE] = PlayerHandleStatusIconUpdate,
PlayerHandleStatusAnimation, [CONTROLLER_STATUSANIMATION] = PlayerHandleStatusAnimation,
PlayerHandleStatusXor, [CONTROLLER_STATUSXOR] = PlayerHandleStatusXor,
PlayerHandleDataTransfer, [CONTROLLER_DATATRANSFER] = PlayerHandleDataTransfer,
PlayerHandleDMA3Transfer, [CONTROLLER_DMA3TRANSFER] = PlayerHandleDMA3Transfer,
PlayerHandlePlayBGM, [CONTROLLER_PLAYBGM] = PlayerHandlePlayBGM,
PlayerHandleCmd32, [CONTROLLER_32] = PlayerHandleCmd32,
PlayerHandleTwoReturnValues, [CONTROLLER_TWORETURNVALUES] = PlayerHandleTwoReturnValues,
PlayerHandleChosenMonReturnValue, [CONTROLLER_CHOSENMONRETURNVALUE] = PlayerHandleChosenMonReturnValue,
PlayerHandleOneReturnValue, [CONTROLLER_ONERETURNVALUE] = PlayerHandleOneReturnValue,
PlayerHandleOneReturnValue_Duplicate, [CONTROLLER_ONERETURNVALUE_DUPLICATE] = PlayerHandleOneReturnValue_Duplicate,
PlayerHandleCmd37, [CONTROLLER_CLEARUNKVAR] = PlayerHandleClearUnkVar,
PlayerHandleCmd38, [CONTROLLER_SETUNKVAR] = PlayerHandleSetUnkVar,
PlayerHandleCmd39, [CONTROLLER_CLEARUNKFLAG] = PlayerHandleClearUnkFlag,
PlayerHandleCmd40, [CONTROLLER_TOGGLEUNKFLAG] = PlayerHandleToggleUnkFlag,
PlayerHandleHitAnimation, [CONTROLLER_HITANIMATION] = PlayerHandleHitAnimation,
PlayerHandleCmd42, [CONTROLLER_42] = PlayerHandleCmd42,
PlayerHandlePlaySE, [CONTROLLER_PLAYSE] = PlayerHandlePlaySE,
PlayerHandlePlayFanfareOrBGM, [CONTROLLER_PLAYFANFAREORBGM] = PlayerHandlePlayFanfareOrBGM,
PlayerHandleFaintingCry, [CONTROLLER_FAINTINGCRY] = PlayerHandleFaintingCry,
PlayerHandleIntroSlide, [CONTROLLER_INTROSLIDE] = PlayerHandleIntroSlide,
PlayerHandleIntroTrainerBallThrow, [CONTROLLER_INTROTRAINERBALLTHROW] = PlayerHandleIntroTrainerBallThrow,
PlayerHandleDrawPartyStatusSummary, [CONTROLLER_DRAWPARTYSTATUSSUMMARY] = PlayerHandleDrawPartyStatusSummary,
PlayerHandleHidePartyStatusSummary, [CONTROLLER_HIDEPARTYSTATUSSUMMARY] = PlayerHandleHidePartyStatusSummary,
PlayerHandleEndBounceEffect, [CONTROLLER_ENDBOUNCE] = PlayerHandleEndBounceEffect,
PlayerHandleSpriteInvisibility, [CONTROLLER_SPRITEINVISIBILITY] = PlayerHandleSpriteInvisibility,
PlayerHandleBattleAnimation, [CONTROLLER_BATTLEANIMATION] = PlayerHandleBattleAnimation,
PlayerHandleLinkStandbyMsg, [CONTROLLER_LINKSTANDBYMSG] = PlayerHandleLinkStandbyMsg,
PlayerHandleResetActionMoveSelection, [CONTROLLER_RESETACTIONMOVESELECTION] = PlayerHandleResetActionMoveSelection,
PlayerHandleCmd55, [CONTROLLER_55] = PlayerHandleCmd55,
PlayerCmdEnd [CONTROLLER_TERMINATOR_NOP] = PlayerCmdEnd
}; };
static const u8 sTargetIdentities[] = {B_POSITION_PLAYER_LEFT, B_POSITION_PLAYER_RIGHT, B_POSITION_OPPONENT_RIGHT, B_POSITION_OPPONENT_LEFT}; static const u8 sTargetIdentities[] = {B_POSITION_PLAYER_LEFT, B_POSITION_PLAYER_RIGHT, B_POSITION_OPPONENT_RIGHT, B_POSITION_OPPONENT_LEFT};
// unknown unused data // unknown unused data
static const u8 sUnknown_0831C5FC[] = {0x48, 0x48, 0x20, 0x5a, 0x50, 0x50, 0x50, 0x58}; static const u8 sUnused[] = {0x48, 0x48, 0x20, 0x5a, 0x50, 0x50, 0x50, 0x58};
void nullsub_21(void) void nullsub_21(void)
{ {
@ -2821,27 +2821,27 @@ static void PlayerHandleOneReturnValue_Duplicate(void)
PlayerBufferExecCompleted(); PlayerBufferExecCompleted();
} }
static void PlayerHandleCmd37(void) static void PlayerHandleClearUnkVar(void)
{ {
gUnknown_02022D0C.field_0 = 0; gUnusedControllerStruct.unk = 0;
PlayerBufferExecCompleted(); PlayerBufferExecCompleted();
} }
static void PlayerHandleCmd38(void) static void PlayerHandleSetUnkVar(void)
{ {
gUnknown_02022D0C.field_0 = gBattleBufferA[gActiveBattler][1]; gUnusedControllerStruct.unk = gBattleBufferA[gActiveBattler][1];
PlayerBufferExecCompleted(); PlayerBufferExecCompleted();
} }
static void PlayerHandleCmd39(void) static void PlayerHandleClearUnkFlag(void)
{ {
gUnknown_02022D0C.flag_x80 = 0; gUnusedControllerStruct.flag = 0;
PlayerBufferExecCompleted(); PlayerBufferExecCompleted();
} }
static void PlayerHandleCmd40(void) static void PlayerHandleToggleUnkFlag(void)
{ {
gUnknown_02022D0C.flag_x80 ^= 1; gUnusedControllerStruct.flag ^= 1;
PlayerBufferExecCompleted(); PlayerBufferExecCompleted();
} }

View File

@ -65,10 +65,10 @@ static void PlayerPartnerHandleTwoReturnValues(void);
static void PlayerPartnerHandleChosenMonReturnValue(void); static void PlayerPartnerHandleChosenMonReturnValue(void);
static void PlayerPartnerHandleOneReturnValue(void); static void PlayerPartnerHandleOneReturnValue(void);
static void PlayerPartnerHandleOneReturnValue_Duplicate(void); static void PlayerPartnerHandleOneReturnValue_Duplicate(void);
static void PlayerPartnerHandleCmd37(void); static void PlayerPartnerHandleClearUnkVar(void);
static void PlayerPartnerHandleCmd38(void); static void PlayerPartnerHandleSetUnkVar(void);
static void PlayerPartnerHandleCmd39(void); static void PlayerPartnerHandleClearUnkFlag(void);
static void PlayerPartnerHandleCmd40(void); static void PlayerPartnerHandleToggleUnkFlag(void);
static void PlayerPartnerHandleHitAnimation(void); static void PlayerPartnerHandleHitAnimation(void);
static void PlayerPartnerHandleCmd42(void); static void PlayerPartnerHandleCmd42(void);
static void PlayerPartnerHandlePlaySE(void); static void PlayerPartnerHandlePlaySE(void);
@ -105,67 +105,67 @@ static void sub_81BE498(void);
static void (*const sPlayerPartnerBufferCommands[CONTROLLER_CMDS_COUNT])(void) = static void (*const sPlayerPartnerBufferCommands[CONTROLLER_CMDS_COUNT])(void) =
{ {
PlayerPartnerHandleGetMonData, [CONTROLLER_GETMONDATA] = PlayerPartnerHandleGetMonData,
PlayerPartnerHandleGetRawMonData, [CONTROLLER_GETRAWMONDATA] = PlayerPartnerHandleGetRawMonData,
PlayerPartnerHandleSetMonData, [CONTROLLER_SETMONDATA] = PlayerPartnerHandleSetMonData,
PlayerPartnerHandleSetRawMonData, [CONTROLLER_SETRAWMONDATA] = PlayerPartnerHandleSetRawMonData,
PlayerPartnerHandleLoadMonSprite, [CONTROLLER_LOADMONSPRITE] = PlayerPartnerHandleLoadMonSprite,
PlayerPartnerHandleSwitchInAnim, [CONTROLLER_SWITCHINANIM] = PlayerPartnerHandleSwitchInAnim,
PlayerPartnerHandleReturnMonToBall, [CONTROLLER_RETURNMONTOBALL] = PlayerPartnerHandleReturnMonToBall,
PlayerPartnerHandleDrawTrainerPic, [CONTROLLER_DRAWTRAINERPIC] = PlayerPartnerHandleDrawTrainerPic,
PlayerPartnerHandleTrainerSlide, [CONTROLLER_TRAINERSLIDE] = PlayerPartnerHandleTrainerSlide,
PlayerPartnerHandleTrainerSlideBack, [CONTROLLER_TRAINERSLIDEBACK] = PlayerPartnerHandleTrainerSlideBack,
PlayerPartnerHandleFaintAnimation, [CONTROLLER_FAINTANIMATION] = PlayerPartnerHandleFaintAnimation,
PlayerPartnerHandlePaletteFade, [CONTROLLER_PALETTEFADE] = PlayerPartnerHandlePaletteFade,
PlayerPartnerHandleSuccessBallThrowAnim, [CONTROLLER_SUCCESSBALLTHROWANIM] = PlayerPartnerHandleSuccessBallThrowAnim,
PlayerPartnerHandleBallThrowAnim, [CONTROLLER_BALLTHROWANIM] = PlayerPartnerHandleBallThrowAnim,
PlayerPartnerHandlePause, [CONTROLLER_PAUSE] = PlayerPartnerHandlePause,
PlayerPartnerHandleMoveAnimation, [CONTROLLER_MOVEANIMATION] = PlayerPartnerHandleMoveAnimation,
PlayerPartnerHandlePrintString, [CONTROLLER_PRINTSTRING] = PlayerPartnerHandlePrintString,
PlayerPartnerHandlePrintSelectionString, [CONTROLLER_PRINTSTRINGPLAYERONLY] = PlayerPartnerHandlePrintSelectionString,
PlayerPartnerHandleChooseAction, [CONTROLLER_CHOOSEACTION] = PlayerPartnerHandleChooseAction,
PlayerPartnerHandleUnknownYesNoBox, [CONTROLLER_UNKNOWNYESNOBOX] = PlayerPartnerHandleUnknownYesNoBox,
PlayerPartnerHandleChooseMove, [CONTROLLER_CHOOSEMOVE] = PlayerPartnerHandleChooseMove,
PlayerPartnerHandleChooseItem, [CONTROLLER_OPENBAG] = PlayerPartnerHandleChooseItem,
PlayerPartnerHandleChoosePokemon, [CONTROLLER_CHOOSEPOKEMON] = PlayerPartnerHandleChoosePokemon,
PlayerPartnerHandleCmd23, [CONTROLLER_23] = PlayerPartnerHandleCmd23,
PlayerPartnerHandleHealthBarUpdate, [CONTROLLER_HEALTHBARUPDATE] = PlayerPartnerHandleHealthBarUpdate,
PlayerPartnerHandleExpUpdate, [CONTROLLER_EXPUPDATE] = PlayerPartnerHandleExpUpdate,
PlayerPartnerHandleStatusIconUpdate, [CONTROLLER_STATUSICONUPDATE] = PlayerPartnerHandleStatusIconUpdate,
PlayerPartnerHandleStatusAnimation, [CONTROLLER_STATUSANIMATION] = PlayerPartnerHandleStatusAnimation,
PlayerPartnerHandleStatusXor, [CONTROLLER_STATUSXOR] = PlayerPartnerHandleStatusXor,
PlayerPartnerHandleDataTransfer, [CONTROLLER_DATATRANSFER] = PlayerPartnerHandleDataTransfer,
PlayerPartnerHandleDMA3Transfer, [CONTROLLER_DMA3TRANSFER] = PlayerPartnerHandleDMA3Transfer,
PlayerPartnerHandlePlayBGM, [CONTROLLER_PLAYBGM] = PlayerPartnerHandlePlayBGM,
PlayerPartnerHandleCmd32, [CONTROLLER_32] = PlayerPartnerHandleCmd32,
PlayerPartnerHandleTwoReturnValues, [CONTROLLER_TWORETURNVALUES] = PlayerPartnerHandleTwoReturnValues,
PlayerPartnerHandleChosenMonReturnValue, [CONTROLLER_CHOSENMONRETURNVALUE] = PlayerPartnerHandleChosenMonReturnValue,
PlayerPartnerHandleOneReturnValue, [CONTROLLER_ONERETURNVALUE] = PlayerPartnerHandleOneReturnValue,
PlayerPartnerHandleOneReturnValue_Duplicate, [CONTROLLER_ONERETURNVALUE_DUPLICATE] = PlayerPartnerHandleOneReturnValue_Duplicate,
PlayerPartnerHandleCmd37, [CONTROLLER_CLEARUNKVAR] = PlayerPartnerHandleClearUnkVar,
PlayerPartnerHandleCmd38, [CONTROLLER_SETUNKVAR] = PlayerPartnerHandleSetUnkVar,
PlayerPartnerHandleCmd39, [CONTROLLER_CLEARUNKFLAG] = PlayerPartnerHandleClearUnkFlag,
PlayerPartnerHandleCmd40, [CONTROLLER_TOGGLEUNKFLAG] = PlayerPartnerHandleToggleUnkFlag,
PlayerPartnerHandleHitAnimation, [CONTROLLER_HITANIMATION] = PlayerPartnerHandleHitAnimation,
PlayerPartnerHandleCmd42, [CONTROLLER_42] = PlayerPartnerHandleCmd42,
PlayerPartnerHandlePlaySE, [CONTROLLER_PLAYSE] = PlayerPartnerHandlePlaySE,
PlayerPartnerHandlePlayFanfareOrBGM, [CONTROLLER_PLAYFANFAREORBGM] = PlayerPartnerHandlePlayFanfareOrBGM,
PlayerPartnerHandleFaintingCry, [CONTROLLER_FAINTINGCRY] = PlayerPartnerHandleFaintingCry,
PlayerPartnerHandleIntroSlide, [CONTROLLER_INTROSLIDE] = PlayerPartnerHandleIntroSlide,
PlayerPartnerHandleIntroTrainerBallThrow, [CONTROLLER_INTROTRAINERBALLTHROW] = PlayerPartnerHandleIntroTrainerBallThrow,
PlayerPartnerHandleDrawPartyStatusSummary, [CONTROLLER_DRAWPARTYSTATUSSUMMARY] = PlayerPartnerHandleDrawPartyStatusSummary,
PlayerPartnerHandleHidePartyStatusSummary, [CONTROLLER_HIDEPARTYSTATUSSUMMARY] = PlayerPartnerHandleHidePartyStatusSummary,
PlayerPartnerHandleEndBounceEffect, [CONTROLLER_ENDBOUNCE] = PlayerPartnerHandleEndBounceEffect,
PlayerPartnerHandleSpriteInvisibility, [CONTROLLER_SPRITEINVISIBILITY] = PlayerPartnerHandleSpriteInvisibility,
PlayerPartnerHandleBattleAnimation, [CONTROLLER_BATTLEANIMATION] = PlayerPartnerHandleBattleAnimation,
PlayerPartnerHandleLinkStandbyMsg, [CONTROLLER_LINKSTANDBYMSG] = PlayerPartnerHandleLinkStandbyMsg,
PlayerPartnerHandleResetActionMoveSelection, [CONTROLLER_RESETACTIONMOVESELECTION] = PlayerPartnerHandleResetActionMoveSelection,
PlayerPartnerHandleCmd55, [CONTROLLER_55] = PlayerPartnerHandleCmd55,
PlayerPartnerCmdEnd [CONTROLLER_TERMINATOR_NOP] = PlayerPartnerCmdEnd
}; };
// unknown unused data // unknown unused data
static const u8 sUnknown_08617254[] = static const u8 sUnused[] =
{ {
0x83, 0x4d, 0xf3, 0x5f, 0x6f, 0x4f, 0xeb, 0x3e, 0x83, 0x4d, 0xf3, 0x5f, 0x6f, 0x4f, 0xeb, 0x3e,
0x67, 0x2e, 0x10, 0x46, 0x8c, 0x3d, 0x28, 0x35, 0x67, 0x2e, 0x10, 0x46, 0x8c, 0x3d, 0x28, 0x35,
@ -1678,27 +1678,27 @@ static void PlayerPartnerHandleOneReturnValue_Duplicate(void)
PlayerPartnerBufferExecCompleted(); PlayerPartnerBufferExecCompleted();
} }
static void PlayerPartnerHandleCmd37(void) static void PlayerPartnerHandleClearUnkVar(void)
{ {
gUnknown_02022D0C.field_0 = 0; gUnusedControllerStruct.unk = 0;
PlayerPartnerBufferExecCompleted(); PlayerPartnerBufferExecCompleted();
} }
static void PlayerPartnerHandleCmd38(void) static void PlayerPartnerHandleSetUnkVar(void)
{ {
gUnknown_02022D0C.field_0 = gBattleBufferA[gActiveBattler][1]; gUnusedControllerStruct.unk = gBattleBufferA[gActiveBattler][1];
PlayerPartnerBufferExecCompleted(); PlayerPartnerBufferExecCompleted();
} }
static void PlayerPartnerHandleCmd39(void) static void PlayerPartnerHandleClearUnkFlag(void)
{ {
gUnknown_02022D0C.flag_x80 = 0; gUnusedControllerStruct.flag = 0;
PlayerPartnerBufferExecCompleted(); PlayerPartnerBufferExecCompleted();
} }
static void PlayerPartnerHandleCmd40(void) static void PlayerPartnerHandleToggleUnkFlag(void)
{ {
gUnknown_02022D0C.flag_x80 ^= 1; gUnusedControllerStruct.flag ^= 1;
PlayerPartnerBufferExecCompleted(); PlayerPartnerBufferExecCompleted();
} }

View File

@ -69,10 +69,10 @@ static void RecordedOpponentHandleTwoReturnValues(void);
static void RecordedOpponentHandleChosenMonReturnValue(void); static void RecordedOpponentHandleChosenMonReturnValue(void);
static void RecordedOpponentHandleOneReturnValue(void); static void RecordedOpponentHandleOneReturnValue(void);
static void RecordedOpponentHandleOneReturnValue_Duplicate(void); static void RecordedOpponentHandleOneReturnValue_Duplicate(void);
static void RecordedOpponentHandleCmd37(void); static void RecordedOpponentHandleClearUnkVar(void);
static void RecordedOpponentHandleCmd38(void); static void RecordedOpponentHandleSetUnkVar(void);
static void RecordedOpponentHandleCmd39(void); static void RecordedOpponentHandleClearUnkFlag(void);
static void RecordedOpponentHandleCmd40(void); static void RecordedOpponentHandleToggleUnkFlag(void);
static void RecordedOpponentHandleHitAnimation(void); static void RecordedOpponentHandleHitAnimation(void);
static void RecordedOpponentHandleCmd42(void); static void RecordedOpponentHandleCmd42(void);
static void RecordedOpponentHandlePlaySE(void); static void RecordedOpponentHandlePlaySE(void);
@ -104,63 +104,63 @@ static void sub_818975C(void);
static void (*const sRecordedOpponentBufferCommands[CONTROLLER_CMDS_COUNT])(void) = static void (*const sRecordedOpponentBufferCommands[CONTROLLER_CMDS_COUNT])(void) =
{ {
RecordedOpponentHandleGetMonData, [CONTROLLER_GETMONDATA] = RecordedOpponentHandleGetMonData,
RecordedOpponentHandleGetRawMonData, [CONTROLLER_GETRAWMONDATA] = RecordedOpponentHandleGetRawMonData,
RecordedOpponentHandleSetMonData, [CONTROLLER_SETMONDATA] = RecordedOpponentHandleSetMonData,
RecordedOpponentHandleSetRawMonData, [CONTROLLER_SETRAWMONDATA] = RecordedOpponentHandleSetRawMonData,
RecordedOpponentHandleLoadMonSprite, [CONTROLLER_LOADMONSPRITE] = RecordedOpponentHandleLoadMonSprite,
RecordedOpponentHandleSwitchInAnim, [CONTROLLER_SWITCHINANIM] = RecordedOpponentHandleSwitchInAnim,
RecordedOpponentHandleReturnMonToBall, [CONTROLLER_RETURNMONTOBALL] = RecordedOpponentHandleReturnMonToBall,
RecordedOpponentHandleDrawTrainerPic, [CONTROLLER_DRAWTRAINERPIC] = RecordedOpponentHandleDrawTrainerPic,
RecordedOpponentHandleTrainerSlide, [CONTROLLER_TRAINERSLIDE] = RecordedOpponentHandleTrainerSlide,
RecordedOpponentHandleTrainerSlideBack, [CONTROLLER_TRAINERSLIDEBACK] = RecordedOpponentHandleTrainerSlideBack,
RecordedOpponentHandleFaintAnimation, [CONTROLLER_FAINTANIMATION] = RecordedOpponentHandleFaintAnimation,
RecordedOpponentHandlePaletteFade, [CONTROLLER_PALETTEFADE] = RecordedOpponentHandlePaletteFade,
RecordedOpponentHandleSuccessBallThrowAnim, [CONTROLLER_SUCCESSBALLTHROWANIM] = RecordedOpponentHandleSuccessBallThrowAnim,
RecordedOpponentHandleBallThrowAnim, [CONTROLLER_BALLTHROWANIM] = RecordedOpponentHandleBallThrowAnim,
RecordedOpponentHandlePause, [CONTROLLER_PAUSE] = RecordedOpponentHandlePause,
RecordedOpponentHandleMoveAnimation, [CONTROLLER_MOVEANIMATION] = RecordedOpponentHandleMoveAnimation,
RecordedOpponentHandlePrintString, [CONTROLLER_PRINTSTRING] = RecordedOpponentHandlePrintString,
RecordedOpponentHandlePrintSelectionString, [CONTROLLER_PRINTSTRINGPLAYERONLY] = RecordedOpponentHandlePrintSelectionString,
RecordedOpponentHandleChooseAction, [CONTROLLER_CHOOSEACTION] = RecordedOpponentHandleChooseAction,
RecordedOpponentHandleUnknownYesNoBox, [CONTROLLER_UNKNOWNYESNOBOX] = RecordedOpponentHandleUnknownYesNoBox,
RecordedOpponentHandleChooseMove, [CONTROLLER_CHOOSEMOVE] = RecordedOpponentHandleChooseMove,
RecordedOpponentHandleChooseItem, [CONTROLLER_OPENBAG] = RecordedOpponentHandleChooseItem,
RecordedOpponentHandleChoosePokemon, [CONTROLLER_CHOOSEPOKEMON] = RecordedOpponentHandleChoosePokemon,
RecordedOpponentHandleCmd23, [CONTROLLER_23] = RecordedOpponentHandleCmd23,
RecordedOpponentHandleHealthBarUpdate, [CONTROLLER_HEALTHBARUPDATE] = RecordedOpponentHandleHealthBarUpdate,
RecordedOpponentHandleExpUpdate, [CONTROLLER_EXPUPDATE] = RecordedOpponentHandleExpUpdate,
RecordedOpponentHandleStatusIconUpdate, [CONTROLLER_STATUSICONUPDATE] = RecordedOpponentHandleStatusIconUpdate,
RecordedOpponentHandleStatusAnimation, [CONTROLLER_STATUSANIMATION] = RecordedOpponentHandleStatusAnimation,
RecordedOpponentHandleStatusXor, [CONTROLLER_STATUSXOR] = RecordedOpponentHandleStatusXor,
RecordedOpponentHandleDataTransfer, [CONTROLLER_DATATRANSFER] = RecordedOpponentHandleDataTransfer,
RecordedOpponentHandleDMA3Transfer, [CONTROLLER_DMA3TRANSFER] = RecordedOpponentHandleDMA3Transfer,
RecordedOpponentHandlePlayBGM, [CONTROLLER_PLAYBGM] = RecordedOpponentHandlePlayBGM,
RecordedOpponentHandleCmd32, [CONTROLLER_32] = RecordedOpponentHandleCmd32,
RecordedOpponentHandleTwoReturnValues, [CONTROLLER_TWORETURNVALUES] = RecordedOpponentHandleTwoReturnValues,
RecordedOpponentHandleChosenMonReturnValue, [CONTROLLER_CHOSENMONRETURNVALUE] = RecordedOpponentHandleChosenMonReturnValue,
RecordedOpponentHandleOneReturnValue, [CONTROLLER_ONERETURNVALUE] = RecordedOpponentHandleOneReturnValue,
RecordedOpponentHandleOneReturnValue_Duplicate, [CONTROLLER_ONERETURNVALUE_DUPLICATE] = RecordedOpponentHandleOneReturnValue_Duplicate,
RecordedOpponentHandleCmd37, [CONTROLLER_CLEARUNKVAR] = RecordedOpponentHandleClearUnkVar,
RecordedOpponentHandleCmd38, [CONTROLLER_SETUNKVAR] = RecordedOpponentHandleSetUnkVar,
RecordedOpponentHandleCmd39, [CONTROLLER_CLEARUNKFLAG] = RecordedOpponentHandleClearUnkFlag,
RecordedOpponentHandleCmd40, [CONTROLLER_TOGGLEUNKFLAG] = RecordedOpponentHandleToggleUnkFlag,
RecordedOpponentHandleHitAnimation, [CONTROLLER_HITANIMATION] = RecordedOpponentHandleHitAnimation,
RecordedOpponentHandleCmd42, [CONTROLLER_42] = RecordedOpponentHandleCmd42,
RecordedOpponentHandlePlaySE, [CONTROLLER_PLAYSE] = RecordedOpponentHandlePlaySE,
RecordedOpponentHandlePlayFanfareOrBGM, [CONTROLLER_PLAYFANFAREORBGM] = RecordedOpponentHandlePlayFanfareOrBGM,
RecordedOpponentHandleFaintingCry, [CONTROLLER_FAINTINGCRY] = RecordedOpponentHandleFaintingCry,
RecordedOpponentHandleIntroSlide, [CONTROLLER_INTROSLIDE] = RecordedOpponentHandleIntroSlide,
RecordedOpponentHandleIntroTrainerBallThrow, [CONTROLLER_INTROTRAINERBALLTHROW] = RecordedOpponentHandleIntroTrainerBallThrow,
RecordedOpponentHandleDrawPartyStatusSummary, [CONTROLLER_DRAWPARTYSTATUSSUMMARY] = RecordedOpponentHandleDrawPartyStatusSummary,
RecordedOpponentHandleHidePartyStatusSummary, [CONTROLLER_HIDEPARTYSTATUSSUMMARY] = RecordedOpponentHandleHidePartyStatusSummary,
RecordedOpponentHandleEndBounceEffect, [CONTROLLER_ENDBOUNCE] = RecordedOpponentHandleEndBounceEffect,
RecordedOpponentHandleSpriteInvisibility, [CONTROLLER_SPRITEINVISIBILITY] = RecordedOpponentHandleSpriteInvisibility,
RecordedOpponentHandleBattleAnimation, [CONTROLLER_BATTLEANIMATION] = RecordedOpponentHandleBattleAnimation,
RecordedOpponentHandleLinkStandbyMsg, [CONTROLLER_LINKSTANDBYMSG] = RecordedOpponentHandleLinkStandbyMsg,
RecordedOpponentHandleResetActionMoveSelection, [CONTROLLER_RESETACTIONMOVESELECTION] = RecordedOpponentHandleResetActionMoveSelection,
RecordedOpponentHandleCmd55, [CONTROLLER_55] = RecordedOpponentHandleCmd55,
RecordedOpponentCmdEnd [CONTROLLER_TERMINATOR_NOP] = RecordedOpponentCmdEnd
}; };
static void nullsub_70(void) static void nullsub_70(void)
@ -1235,7 +1235,7 @@ static void RecordedOpponentHandleDrawTrainerPic(void)
} }
else else
{ {
trainerPicId = PlayerGenderToFrontTrainerPicId(gLinkPlayers[gUnknown_0203C7B4 ^ BIT_SIDE].gender); trainerPicId = PlayerGenderToFrontTrainerPicId(gLinkPlayers[gRecordedBattleMultiplayerId ^ BIT_SIDE].gender);
} }
} }
@ -1543,27 +1543,27 @@ static void RecordedOpponentHandleOneReturnValue_Duplicate(void)
RecordedOpponentBufferExecCompleted(); RecordedOpponentBufferExecCompleted();
} }
static void RecordedOpponentHandleCmd37(void) static void RecordedOpponentHandleClearUnkVar(void)
{ {
gUnknown_02022D0C.field_0 = 0; gUnusedControllerStruct.unk = 0;
RecordedOpponentBufferExecCompleted(); RecordedOpponentBufferExecCompleted();
} }
static void RecordedOpponentHandleCmd38(void) static void RecordedOpponentHandleSetUnkVar(void)
{ {
gUnknown_02022D0C.field_0 = gBattleBufferA[gActiveBattler][1]; gUnusedControllerStruct.unk = gBattleBufferA[gActiveBattler][1];
RecordedOpponentBufferExecCompleted(); RecordedOpponentBufferExecCompleted();
} }
static void RecordedOpponentHandleCmd39(void) static void RecordedOpponentHandleClearUnkFlag(void)
{ {
gUnknown_02022D0C.flag_x80 = 0; gUnusedControllerStruct.flag = 0;
RecordedOpponentBufferExecCompleted(); RecordedOpponentBufferExecCompleted();
} }
static void RecordedOpponentHandleCmd40(void) static void RecordedOpponentHandleToggleUnkFlag(void)
{ {
gUnknown_02022D0C.flag_x80 ^= 1; gUnusedControllerStruct.flag ^= 1;
RecordedOpponentBufferExecCompleted(); RecordedOpponentBufferExecCompleted();
} }
@ -1632,7 +1632,6 @@ static void RecordedOpponentHandleIntroSlide(void)
static void RecordedOpponentHandleIntroTrainerBallThrow(void) static void RecordedOpponentHandleIntroTrainerBallThrow(void)
{ {
u8 paletteNum;
u8 taskId; u8 taskId;
SetSpritePrimaryCoordsFromSecondaryCoords(&gSprites[gBattlerSpriteIds[gActiveBattler]]); SetSpritePrimaryCoordsFromSecondaryCoords(&gSprites[gBattlerSpriteIds[gActiveBattler]]);

View File

@ -65,10 +65,10 @@ static void RecordedPlayerHandleTwoReturnValues(void);
static void RecordedPlayerHandleChosenMonReturnValue(void); static void RecordedPlayerHandleChosenMonReturnValue(void);
static void RecordedPlayerHandleOneReturnValue(void); static void RecordedPlayerHandleOneReturnValue(void);
static void RecordedPlayerHandleOneReturnValue_Duplicate(void); static void RecordedPlayerHandleOneReturnValue_Duplicate(void);
static void RecordedPlayerHandleCmd37(void); static void RecordedPlayerHandleClearUnkVar(void);
static void RecordedPlayerHandleCmd38(void); static void RecordedPlayerHandleSetUnkVar(void);
static void RecordedPlayerHandleCmd39(void); static void RecordedPlayerHandleClearUnkFlag(void);
static void RecordedPlayerHandleCmd40(void); static void RecordedPlayerHandleToggleUnkFlag(void);
static void RecordedPlayerHandleHitAnimation(void); static void RecordedPlayerHandleHitAnimation(void);
static void RecordedPlayerHandleCmd42(void); static void RecordedPlayerHandleCmd42(void);
static void RecordedPlayerHandlePlaySE(void); static void RecordedPlayerHandlePlaySE(void);
@ -99,63 +99,63 @@ static void sub_818CDF4(void);
static void (*const sRecordedPlayerBufferCommands[CONTROLLER_CMDS_COUNT])(void) = static void (*const sRecordedPlayerBufferCommands[CONTROLLER_CMDS_COUNT])(void) =
{ {
RecordedPlayerHandleGetMonData, [CONTROLLER_GETMONDATA] = RecordedPlayerHandleGetMonData,
RecordedPlayerHandleGetRawMonData, [CONTROLLER_GETRAWMONDATA] = RecordedPlayerHandleGetRawMonData,
RecordedPlayerHandleSetMonData, [CONTROLLER_SETMONDATA] = RecordedPlayerHandleSetMonData,
RecordedPlayerHandleSetRawMonData, [CONTROLLER_SETRAWMONDATA] = RecordedPlayerHandleSetRawMonData,
RecordedPlayerHandleLoadMonSprite, [CONTROLLER_LOADMONSPRITE] = RecordedPlayerHandleLoadMonSprite,
RecordedPlayerHandleSwitchInAnim, [CONTROLLER_SWITCHINANIM] = RecordedPlayerHandleSwitchInAnim,
RecordedPlayerHandleReturnMonToBall, [CONTROLLER_RETURNMONTOBALL] = RecordedPlayerHandleReturnMonToBall,
RecordedPlayerHandleDrawTrainerPic, [CONTROLLER_DRAWTRAINERPIC] = RecordedPlayerHandleDrawTrainerPic,
RecordedPlayerHandleTrainerSlide, [CONTROLLER_TRAINERSLIDE] = RecordedPlayerHandleTrainerSlide,
RecordedPlayerHandleTrainerSlideBack, [CONTROLLER_TRAINERSLIDEBACK] = RecordedPlayerHandleTrainerSlideBack,
RecordedPlayerHandleFaintAnimation, [CONTROLLER_FAINTANIMATION] = RecordedPlayerHandleFaintAnimation,
RecordedPlayerHandlePaletteFade, [CONTROLLER_PALETTEFADE] = RecordedPlayerHandlePaletteFade,
RecordedPlayerHandleSuccessBallThrowAnim, [CONTROLLER_SUCCESSBALLTHROWANIM] = RecordedPlayerHandleSuccessBallThrowAnim,
RecordedPlayerHandleBallThrowAnim, [CONTROLLER_BALLTHROWANIM] = RecordedPlayerHandleBallThrowAnim,
RecordedPlayerHandlePause, [CONTROLLER_PAUSE] = RecordedPlayerHandlePause,
RecordedPlayerHandleMoveAnimation, [CONTROLLER_MOVEANIMATION] = RecordedPlayerHandleMoveAnimation,
RecordedPlayerHandlePrintString, [CONTROLLER_PRINTSTRING] = RecordedPlayerHandlePrintString,
RecordedPlayerHandlePrintSelectionString, [CONTROLLER_PRINTSTRINGPLAYERONLY] = RecordedPlayerHandlePrintSelectionString,
RecordedPlayerHandleChooseAction, [CONTROLLER_CHOOSEACTION] = RecordedPlayerHandleChooseAction,
RecordedPlayerHandleUnknownYesNoBox, [CONTROLLER_UNKNOWNYESNOBOX] = RecordedPlayerHandleUnknownYesNoBox,
RecordedPlayerHandleChooseMove, [CONTROLLER_CHOOSEMOVE] = RecordedPlayerHandleChooseMove,
RecordedPlayerHandleChooseItem, [CONTROLLER_OPENBAG] = RecordedPlayerHandleChooseItem,
RecordedPlayerHandleChoosePokemon, [CONTROLLER_CHOOSEPOKEMON] = RecordedPlayerHandleChoosePokemon,
RecordedPlayerHandleCmd23, [CONTROLLER_23] = RecordedPlayerHandleCmd23,
RecordedPlayerHandleHealthBarUpdate, [CONTROLLER_HEALTHBARUPDATE] = RecordedPlayerHandleHealthBarUpdate,
RecordedPlayerHandleExpUpdate, [CONTROLLER_EXPUPDATE] = RecordedPlayerHandleExpUpdate,
RecordedPlayerHandleStatusIconUpdate, [CONTROLLER_STATUSICONUPDATE] = RecordedPlayerHandleStatusIconUpdate,
RecordedPlayerHandleStatusAnimation, [CONTROLLER_STATUSANIMATION] = RecordedPlayerHandleStatusAnimation,
RecordedPlayerHandleStatusXor, [CONTROLLER_STATUSXOR] = RecordedPlayerHandleStatusXor,
RecordedPlayerHandleDataTransfer, [CONTROLLER_DATATRANSFER] = RecordedPlayerHandleDataTransfer,
RecordedPlayerHandleDMA3Transfer, [CONTROLLER_DMA3TRANSFER] = RecordedPlayerHandleDMA3Transfer,
RecordedPlayerHandlePlayBGM, [CONTROLLER_PLAYBGM] = RecordedPlayerHandlePlayBGM,
RecordedPlayerHandleCmd32, [CONTROLLER_32] = RecordedPlayerHandleCmd32,
RecordedPlayerHandleTwoReturnValues, [CONTROLLER_TWORETURNVALUES] = RecordedPlayerHandleTwoReturnValues,
RecordedPlayerHandleChosenMonReturnValue, [CONTROLLER_CHOSENMONRETURNVALUE] = RecordedPlayerHandleChosenMonReturnValue,
RecordedPlayerHandleOneReturnValue, [CONTROLLER_ONERETURNVALUE] = RecordedPlayerHandleOneReturnValue,
RecordedPlayerHandleOneReturnValue_Duplicate, [CONTROLLER_ONERETURNVALUE_DUPLICATE] = RecordedPlayerHandleOneReturnValue_Duplicate,
RecordedPlayerHandleCmd37, [CONTROLLER_CLEARUNKVAR] = RecordedPlayerHandleClearUnkVar,
RecordedPlayerHandleCmd38, [CONTROLLER_SETUNKVAR] = RecordedPlayerHandleSetUnkVar,
RecordedPlayerHandleCmd39, [CONTROLLER_CLEARUNKFLAG] = RecordedPlayerHandleClearUnkFlag,
RecordedPlayerHandleCmd40, [CONTROLLER_TOGGLEUNKFLAG] = RecordedPlayerHandleToggleUnkFlag,
RecordedPlayerHandleHitAnimation, [CONTROLLER_HITANIMATION] = RecordedPlayerHandleHitAnimation,
RecordedPlayerHandleCmd42, [CONTROLLER_42] = RecordedPlayerHandleCmd42,
RecordedPlayerHandlePlaySE, [CONTROLLER_PLAYSE] = RecordedPlayerHandlePlaySE,
RecordedPlayerHandlePlayFanfareOrBGM, [CONTROLLER_PLAYFANFAREORBGM] = RecordedPlayerHandlePlayFanfareOrBGM,
RecordedPlayerHandleFaintingCry, [CONTROLLER_FAINTINGCRY] = RecordedPlayerHandleFaintingCry,
RecordedPlayerHandleIntroSlide, [CONTROLLER_INTROSLIDE] = RecordedPlayerHandleIntroSlide,
RecordedPlayerHandleIntroTrainerBallThrow, [CONTROLLER_INTROTRAINERBALLTHROW] = RecordedPlayerHandleIntroTrainerBallThrow,
RecordedPlayerHandleDrawPartyStatusSummary, [CONTROLLER_DRAWPARTYSTATUSSUMMARY] = RecordedPlayerHandleDrawPartyStatusSummary,
RecordedPlayerHandleHidePartyStatusSummary, [CONTROLLER_HIDEPARTYSTATUSSUMMARY] = RecordedPlayerHandleHidePartyStatusSummary,
RecordedPlayerHandleEndBounceEffect, [CONTROLLER_ENDBOUNCE] = RecordedPlayerHandleEndBounceEffect,
RecordedPlayerHandleSpriteInvisibility, [CONTROLLER_SPRITEINVISIBILITY] = RecordedPlayerHandleSpriteInvisibility,
RecordedPlayerHandleBattleAnimation, [CONTROLLER_BATTLEANIMATION] = RecordedPlayerHandleBattleAnimation,
RecordedPlayerHandleLinkStandbyMsg, [CONTROLLER_LINKSTANDBYMSG] = RecordedPlayerHandleLinkStandbyMsg,
RecordedPlayerHandleResetActionMoveSelection, [CONTROLLER_RESETACTIONMOVESELECTION] = RecordedPlayerHandleResetActionMoveSelection,
RecordedPlayerHandleCmd55, [CONTROLLER_55] = RecordedPlayerHandleCmd55,
RecordedPlayerCmdEnd [CONTROLLER_TERMINATOR_NOP] = RecordedPlayerCmdEnd
}; };
static void nullsub_120(void) static void nullsub_120(void)
@ -1186,12 +1186,12 @@ static void RecordedPlayerHandleDrawTrainerPic(void)
s16 xPos, yPos; s16 xPos, yPos;
u32 trainerPicId; u32 trainerPicId;
if (gBattleTypeFlags & BATTLE_TYPE_x2000000) if (gBattleTypeFlags & BATTLE_TYPE_RECORDED_LINK)
{ {
if (gBattleTypeFlags & BATTLE_TYPE_MULTI) if (gBattleTypeFlags & BATTLE_TYPE_MULTI)
trainerPicId = GetActiveBattlerLinkPlayerGender(); trainerPicId = GetActiveBattlerLinkPlayerGender();
else else
trainerPicId = gLinkPlayers[gUnknown_0203C7B4].gender; trainerPicId = gLinkPlayers[gRecordedBattleMultiplayerId].gender;
} }
else else
{ {
@ -1560,27 +1560,27 @@ static void RecordedPlayerHandleOneReturnValue_Duplicate(void)
RecordedPlayerBufferExecCompleted(); RecordedPlayerBufferExecCompleted();
} }
static void RecordedPlayerHandleCmd37(void) static void RecordedPlayerHandleClearUnkVar(void)
{ {
gUnknown_02022D0C.field_0 = 0; gUnusedControllerStruct.unk = 0;
RecordedPlayerBufferExecCompleted(); RecordedPlayerBufferExecCompleted();
} }
static void RecordedPlayerHandleCmd38(void) static void RecordedPlayerHandleSetUnkVar(void)
{ {
gUnknown_02022D0C.field_0 = gBattleBufferA[gActiveBattler][1]; gUnusedControllerStruct.unk = gBattleBufferA[gActiveBattler][1];
RecordedPlayerBufferExecCompleted(); RecordedPlayerBufferExecCompleted();
} }
static void RecordedPlayerHandleCmd39(void) static void RecordedPlayerHandleClearUnkFlag(void)
{ {
gUnknown_02022D0C.flag_x80 = 0; gUnusedControllerStruct.flag = 0;
RecordedPlayerBufferExecCompleted(); RecordedPlayerBufferExecCompleted();
} }
static void RecordedPlayerHandleCmd40(void) static void RecordedPlayerHandleToggleUnkFlag(void)
{ {
gUnknown_02022D0C.flag_x80 ^= 1; gUnusedControllerStruct.flag ^= 1;
RecordedPlayerBufferExecCompleted(); RecordedPlayerBufferExecCompleted();
} }
@ -1665,7 +1665,7 @@ static void RecordedPlayerHandleIntroTrainerBallThrow(void)
StartSpriteAnim(&gSprites[gBattlerSpriteIds[gActiveBattler]], 1); StartSpriteAnim(&gSprites[gBattlerSpriteIds[gActiveBattler]], 1);
paletteNum = AllocSpritePalette(0xD6F9); paletteNum = AllocSpritePalette(0xD6F9);
if (gBattleTypeFlags & BATTLE_TYPE_x2000000) if (gBattleTypeFlags & BATTLE_TYPE_RECORDED_LINK)
trainerPicId = gLinkPlayers[GetBattlerMultiplayerId(gActiveBattler)].gender; trainerPicId = gLinkPlayers[GetBattlerMultiplayerId(gActiveBattler)].gender;
else else
trainerPicId = gSaveBlock2Ptr->playerGender; trainerPicId = gSaveBlock2Ptr->playerGender;

View File

@ -62,10 +62,10 @@ static void SafariHandleTwoReturnValues(void);
static void SafariHandleChosenMonReturnValue(void); static void SafariHandleChosenMonReturnValue(void);
static void SafariHandleOneReturnValue(void); static void SafariHandleOneReturnValue(void);
static void SafariHandleOneReturnValue_Duplicate(void); static void SafariHandleOneReturnValue_Duplicate(void);
static void SafariHandleCmd37(void); static void SafariHandleClearUnkVar(void);
static void SafariHandleCmd38(void); static void SafariHandleSetUnkVar(void);
static void SafariHandleCmd39(void); static void SafariHandleClearUnkFlag(void);
static void SafariHandleCmd40(void); static void SafariHandleToggleUnkFlag(void);
static void SafariHandleHitAnimation(void); static void SafariHandleHitAnimation(void);
static void SafariHandleCmd42(void); static void SafariHandleCmd42(void);
static void SafariHandlePlaySE(void); static void SafariHandlePlaySE(void);
@ -89,63 +89,63 @@ static void CompleteWhenChosePokeblock(void);
static void (*const sSafariBufferCommands[CONTROLLER_CMDS_COUNT])(void) = static void (*const sSafariBufferCommands[CONTROLLER_CMDS_COUNT])(void) =
{ {
SafariHandleGetMonData, [CONTROLLER_GETMONDATA] = SafariHandleGetMonData,
SafariHandleGetRawMonData, [CONTROLLER_GETRAWMONDATA] = SafariHandleGetRawMonData,
SafariHandleSetMonData, [CONTROLLER_SETMONDATA] = SafariHandleSetMonData,
SafariHandleSetRawMonData, [CONTROLLER_SETRAWMONDATA] = SafariHandleSetRawMonData,
SafariHandleLoadMonSprite, [CONTROLLER_LOADMONSPRITE] = SafariHandleLoadMonSprite,
SafariHandleSwitchInAnim, [CONTROLLER_SWITCHINANIM] = SafariHandleSwitchInAnim,
SafariHandleReturnMonToBall, [CONTROLLER_RETURNMONTOBALL] = SafariHandleReturnMonToBall,
SafariHandleDrawTrainerPic, [CONTROLLER_DRAWTRAINERPIC] = SafariHandleDrawTrainerPic,
SafariHandleTrainerSlide, [CONTROLLER_TRAINERSLIDE] = SafariHandleTrainerSlide,
SafariHandleTrainerSlideBack, [CONTROLLER_TRAINERSLIDEBACK] = SafariHandleTrainerSlideBack,
SafariHandleFaintAnimation, [CONTROLLER_FAINTANIMATION] = SafariHandleFaintAnimation,
SafariHandlePaletteFade, [CONTROLLER_PALETTEFADE] = SafariHandlePaletteFade,
SafariHandleSuccessBallThrowAnim, [CONTROLLER_SUCCESSBALLTHROWANIM] = SafariHandleSuccessBallThrowAnim,
SafariHandleBallThrowAnim, [CONTROLLER_BALLTHROWANIM] = SafariHandleBallThrowAnim,
SafariHandlePause, [CONTROLLER_PAUSE] = SafariHandlePause,
SafariHandleMoveAnimation, [CONTROLLER_MOVEANIMATION] = SafariHandleMoveAnimation,
SafariHandlePrintString, [CONTROLLER_PRINTSTRING] = SafariHandlePrintString,
SafariHandlePrintSelectionString, [CONTROLLER_PRINTSTRINGPLAYERONLY] = SafariHandlePrintSelectionString,
SafariHandleChooseAction, [CONTROLLER_CHOOSEACTION] = SafariHandleChooseAction,
SafariHandleUnknownYesNoBox, [CONTROLLER_UNKNOWNYESNOBOX] = SafariHandleUnknownYesNoBox,
SafariHandleChooseMove, [CONTROLLER_CHOOSEMOVE] = SafariHandleChooseMove,
SafariHandleChooseItem, [CONTROLLER_OPENBAG] = SafariHandleChooseItem,
SafariHandleChoosePokemon, [CONTROLLER_CHOOSEPOKEMON] = SafariHandleChoosePokemon,
SafariHandleCmd23, [CONTROLLER_23] = SafariHandleCmd23,
SafariHandleHealthBarUpdate, [CONTROLLER_HEALTHBARUPDATE] = SafariHandleHealthBarUpdate,
SafariHandleExpUpdate, [CONTROLLER_EXPUPDATE] = SafariHandleExpUpdate,
SafariHandleStatusIconUpdate, [CONTROLLER_STATUSICONUPDATE] = SafariHandleStatusIconUpdate,
SafariHandleStatusAnimation, [CONTROLLER_STATUSANIMATION] = SafariHandleStatusAnimation,
SafariHandleStatusXor, [CONTROLLER_STATUSXOR] = SafariHandleStatusXor,
SafariHandleDataTransfer, [CONTROLLER_DATATRANSFER] = SafariHandleDataTransfer,
SafariHandleDMA3Transfer, [CONTROLLER_DMA3TRANSFER] = SafariHandleDMA3Transfer,
SafariHandlePlayBGM, [CONTROLLER_PLAYBGM] = SafariHandlePlayBGM,
SafariHandleCmd32, [CONTROLLER_32] = SafariHandleCmd32,
SafariHandleTwoReturnValues, [CONTROLLER_TWORETURNVALUES] = SafariHandleTwoReturnValues,
SafariHandleChosenMonReturnValue, [CONTROLLER_CHOSENMONRETURNVALUE] = SafariHandleChosenMonReturnValue,
SafariHandleOneReturnValue, [CONTROLLER_ONERETURNVALUE] = SafariHandleOneReturnValue,
SafariHandleOneReturnValue_Duplicate, [CONTROLLER_ONERETURNVALUE_DUPLICATE] = SafariHandleOneReturnValue_Duplicate,
SafariHandleCmd37, [CONTROLLER_CLEARUNKVAR] = SafariHandleClearUnkVar,
SafariHandleCmd38, [CONTROLLER_SETUNKVAR] = SafariHandleSetUnkVar,
SafariHandleCmd39, [CONTROLLER_CLEARUNKFLAG] = SafariHandleClearUnkFlag,
SafariHandleCmd40, [CONTROLLER_TOGGLEUNKFLAG] = SafariHandleToggleUnkFlag,
SafariHandleHitAnimation, [CONTROLLER_HITANIMATION] = SafariHandleHitAnimation,
SafariHandleCmd42, [CONTROLLER_42] = SafariHandleCmd42,
SafariHandlePlaySE, [CONTROLLER_PLAYSE] = SafariHandlePlaySE,
SafariHandlePlayFanfareOrBGM, [CONTROLLER_PLAYFANFAREORBGM] = SafariHandlePlayFanfareOrBGM,
SafariHandleFaintingCry, [CONTROLLER_FAINTINGCRY] = SafariHandleFaintingCry,
SafariHandleIntroSlide, [CONTROLLER_INTROSLIDE] = SafariHandleIntroSlide,
SafariHandleIntroTrainerBallThrow, [CONTROLLER_INTROTRAINERBALLTHROW] = SafariHandleIntroTrainerBallThrow,
SafariHandleDrawPartyStatusSummary, [CONTROLLER_DRAWPARTYSTATUSSUMMARY] = SafariHandleDrawPartyStatusSummary,
SafariHandleHidePartyStatusSummary, [CONTROLLER_HIDEPARTYSTATUSSUMMARY] = SafariHandleHidePartyStatusSummary,
SafariHandleEndBounceEffect, [CONTROLLER_ENDBOUNCE] = SafariHandleEndBounceEffect,
SafariHandleSpriteInvisibility, [CONTROLLER_SPRITEINVISIBILITY] = SafariHandleSpriteInvisibility,
SafariHandleBattleAnimation, [CONTROLLER_BATTLEANIMATION] = SafariHandleBattleAnimation,
SafariHandleLinkStandbyMsg, [CONTROLLER_LINKSTANDBYMSG] = SafariHandleLinkStandbyMsg,
SafariHandleResetActionMoveSelection, [CONTROLLER_RESETACTIONMOVESELECTION] = SafariHandleResetActionMoveSelection,
SafariHandleCmd55, [CONTROLLER_55] = SafariHandleCmd55,
SafariCmdEnd [CONTROLLER_TERMINATOR_NOP] = SafariCmdEnd
}; };
static void SpriteCB_Null4(void) static void SpriteCB_Null4(void)
@ -470,8 +470,6 @@ static void SafariHandleChooseMove(void)
static void SafariHandleChooseItem(void) static void SafariHandleChooseItem(void)
{ {
s32 i;
BeginNormalPaletteFade(0xFFFFFFFF, 0, 0, 0x10, RGB_BLACK); BeginNormalPaletteFade(0xFFFFFFFF, 0, 0, 0x10, RGB_BLACK);
gBattlerControllerFuncs[gActiveBattler] = SafariOpenPokeblockCase; gBattlerControllerFuncs[gActiveBattler] = SafariOpenPokeblockCase;
gBattlerInMenuId = gActiveBattler; gBattlerInMenuId = gActiveBattler;
@ -553,22 +551,22 @@ static void SafariHandleOneReturnValue_Duplicate(void)
SafariBufferExecCompleted(); SafariBufferExecCompleted();
} }
static void SafariHandleCmd37(void) static void SafariHandleClearUnkVar(void)
{ {
SafariBufferExecCompleted(); SafariBufferExecCompleted();
} }
static void SafariHandleCmd38(void) static void SafariHandleSetUnkVar(void)
{ {
SafariBufferExecCompleted(); SafariBufferExecCompleted();
} }
static void SafariHandleCmd39(void) static void SafariHandleClearUnkFlag(void)
{ {
SafariBufferExecCompleted(); SafariBufferExecCompleted();
} }
static void SafariHandleCmd40(void) static void SafariHandleToggleUnkFlag(void)
{ {
SafariBufferExecCompleted(); SafariBufferExecCompleted();
} }

View File

@ -70,10 +70,10 @@ static void WallyHandleTwoReturnValues(void);
static void WallyHandleChosenMonReturnValue(void); static void WallyHandleChosenMonReturnValue(void);
static void WallyHandleOneReturnValue(void); static void WallyHandleOneReturnValue(void);
static void WallyHandleOneReturnValue_Duplicate(void); static void WallyHandleOneReturnValue_Duplicate(void);
static void WallyHandleCmd37(void); static void WallyHandleClearUnkVar(void);
static void WallyHandleCmd38(void); static void WallyHandleSetUnkVar(void);
static void WallyHandleCmd39(void); static void WallyHandleClearUnkFlag(void);
static void WallyHandleCmd40(void); static void WallyHandleToggleUnkFlag(void);
static void WallyHandleHitAnimation(void); static void WallyHandleHitAnimation(void);
static void WallyHandleCmd42(void); static void WallyHandleCmd42(void);
static void WallyHandlePlaySE(void); static void WallyHandlePlaySE(void);
@ -102,63 +102,63 @@ static void sub_816AC04(u8 taskId);
static void (*const sWallyBufferCommands[CONTROLLER_CMDS_COUNT])(void) = static void (*const sWallyBufferCommands[CONTROLLER_CMDS_COUNT])(void) =
{ {
WallyHandleGetMonData, [CONTROLLER_GETMONDATA] = WallyHandleGetMonData,
WallyHandleGetRawMonData, [CONTROLLER_GETRAWMONDATA] = WallyHandleGetRawMonData,
WallyHandleSetMonData, [CONTROLLER_SETMONDATA] = WallyHandleSetMonData,
WallyHandleSetRawMonData, [CONTROLLER_SETRAWMONDATA] = WallyHandleSetRawMonData,
WallyHandleLoadMonSprite, [CONTROLLER_LOADMONSPRITE] = WallyHandleLoadMonSprite,
WallyHandleSwitchInAnim, [CONTROLLER_SWITCHINANIM] = WallyHandleSwitchInAnim,
WallyHandleReturnMonToBall, [CONTROLLER_RETURNMONTOBALL] = WallyHandleReturnMonToBall,
WallyHandleDrawTrainerPic, [CONTROLLER_DRAWTRAINERPIC] = WallyHandleDrawTrainerPic,
WallyHandleTrainerSlide, [CONTROLLER_TRAINERSLIDE] = WallyHandleTrainerSlide,
WallyHandleTrainerSlideBack, [CONTROLLER_TRAINERSLIDEBACK] = WallyHandleTrainerSlideBack,
WallyHandleFaintAnimation, [CONTROLLER_FAINTANIMATION] = WallyHandleFaintAnimation,
WallyHandlePaletteFade, [CONTROLLER_PALETTEFADE] = WallyHandlePaletteFade,
WallyHandleSuccessBallThrowAnim, [CONTROLLER_SUCCESSBALLTHROWANIM] = WallyHandleSuccessBallThrowAnim,
WallyHandleBallThrowAnim, [CONTROLLER_BALLTHROWANIM] = WallyHandleBallThrowAnim,
WallyHandlePause, [CONTROLLER_PAUSE] = WallyHandlePause,
WallyHandleMoveAnimation, [CONTROLLER_MOVEANIMATION] = WallyHandleMoveAnimation,
WallyHandlePrintString, [CONTROLLER_PRINTSTRING] = WallyHandlePrintString,
WallyHandlePrintSelectionString, [CONTROLLER_PRINTSTRINGPLAYERONLY] = WallyHandlePrintSelectionString,
WallyHandleChooseAction, [CONTROLLER_CHOOSEACTION] = WallyHandleChooseAction,
WallyHandleUnknownYesNoBox, [CONTROLLER_UNKNOWNYESNOBOX] = WallyHandleUnknownYesNoBox,
WallyHandleChooseMove, [CONTROLLER_CHOOSEMOVE] = WallyHandleChooseMove,
WallyHandleChooseItem, [CONTROLLER_OPENBAG] = WallyHandleChooseItem,
WallyHandleChoosePokemon, [CONTROLLER_CHOOSEPOKEMON] = WallyHandleChoosePokemon,
WallyHandleCmd23, [CONTROLLER_23] = WallyHandleCmd23,
WallyHandleHealthBarUpdate, [CONTROLLER_HEALTHBARUPDATE] = WallyHandleHealthBarUpdate,
WallyHandleExpUpdate, [CONTROLLER_EXPUPDATE] = WallyHandleExpUpdate,
WallyHandleStatusIconUpdate, [CONTROLLER_STATUSICONUPDATE] = WallyHandleStatusIconUpdate,
WallyHandleStatusAnimation, [CONTROLLER_STATUSANIMATION] = WallyHandleStatusAnimation,
WallyHandleStatusXor, [CONTROLLER_STATUSXOR] = WallyHandleStatusXor,
WallyHandleDataTransfer, [CONTROLLER_DATATRANSFER] = WallyHandleDataTransfer,
WallyHandleDMA3Transfer, [CONTROLLER_DMA3TRANSFER] = WallyHandleDMA3Transfer,
WallyHandlePlayBGM, [CONTROLLER_PLAYBGM] = WallyHandlePlayBGM,
WallyHandleCmd32, [CONTROLLER_32] = WallyHandleCmd32,
WallyHandleTwoReturnValues, [CONTROLLER_TWORETURNVALUES] = WallyHandleTwoReturnValues,
WallyHandleChosenMonReturnValue, [CONTROLLER_CHOSENMONRETURNVALUE] = WallyHandleChosenMonReturnValue,
WallyHandleOneReturnValue, [CONTROLLER_ONERETURNVALUE] = WallyHandleOneReturnValue,
WallyHandleOneReturnValue_Duplicate, [CONTROLLER_ONERETURNVALUE_DUPLICATE] = WallyHandleOneReturnValue_Duplicate,
WallyHandleCmd37, [CONTROLLER_CLEARUNKVAR] = WallyHandleClearUnkVar,
WallyHandleCmd38, [CONTROLLER_SETUNKVAR] = WallyHandleSetUnkVar,
WallyHandleCmd39, [CONTROLLER_CLEARUNKFLAG] = WallyHandleClearUnkFlag,
WallyHandleCmd40, [CONTROLLER_TOGGLEUNKFLAG] = WallyHandleToggleUnkFlag,
WallyHandleHitAnimation, [CONTROLLER_HITANIMATION] = WallyHandleHitAnimation,
WallyHandleCmd42, [CONTROLLER_42] = WallyHandleCmd42,
WallyHandlePlaySE, [CONTROLLER_PLAYSE] = WallyHandlePlaySE,
WallyHandlePlayFanfareOrBGM, [CONTROLLER_PLAYFANFAREORBGM] = WallyHandlePlayFanfareOrBGM,
WallyHandleFaintingCry, [CONTROLLER_FAINTINGCRY] = WallyHandleFaintingCry,
WallyHandleIntroSlide, [CONTROLLER_INTROSLIDE] = WallyHandleIntroSlide,
WallyHandleIntroTrainerBallThrow, [CONTROLLER_INTROTRAINERBALLTHROW] = WallyHandleIntroTrainerBallThrow,
WallyHandleDrawPartyStatusSummary, [CONTROLLER_DRAWPARTYSTATUSSUMMARY] = WallyHandleDrawPartyStatusSummary,
WallyHandleHidePartyStatusSummary, [CONTROLLER_HIDEPARTYSTATUSSUMMARY] = WallyHandleHidePartyStatusSummary,
WallyHandleEndBounceEffect, [CONTROLLER_ENDBOUNCE] = WallyHandleEndBounceEffect,
WallyHandleSpriteInvisibility, [CONTROLLER_SPRITEINVISIBILITY] = WallyHandleSpriteInvisibility,
WallyHandleBattleAnimation, [CONTROLLER_BATTLEANIMATION] = WallyHandleBattleAnimation,
WallyHandleLinkStandbyMsg, [CONTROLLER_LINKSTANDBYMSG] = WallyHandleLinkStandbyMsg,
WallyHandleResetActionMoveSelection, [CONTROLLER_RESETACTIONMOVESELECTION] = WallyHandleResetActionMoveSelection,
WallyHandleCmd55, [CONTROLLER_55] = WallyHandleCmd55,
WallyCmdEnd [CONTROLLER_TERMINATOR_NOP] = WallyCmdEnd
}; };
static void SpriteCB_Null7(void) static void SpriteCB_Null7(void)
@ -1345,22 +1345,22 @@ static void WallyHandleOneReturnValue_Duplicate(void)
WallyBufferExecCompleted(); WallyBufferExecCompleted();
} }
static void WallyHandleCmd37(void) static void WallyHandleClearUnkVar(void)
{ {
WallyBufferExecCompleted(); WallyBufferExecCompleted();
} }
static void WallyHandleCmd38(void) static void WallyHandleSetUnkVar(void)
{ {
WallyBufferExecCompleted(); WallyBufferExecCompleted();
} }
static void WallyHandleCmd39(void) static void WallyHandleClearUnkFlag(void)
{ {
WallyBufferExecCompleted(); WallyBufferExecCompleted();
} }
static void WallyHandleCmd40(void) static void WallyHandleToggleUnkFlag(void)
{ {
WallyBufferExecCompleted(); WallyBufferExecCompleted();
} }

View File

@ -17,7 +17,7 @@
static EWRAM_DATA u8 sLinkSendTaskId = 0; static EWRAM_DATA u8 sLinkSendTaskId = 0;
static EWRAM_DATA u8 sLinkReceiveTaskId = 0; static EWRAM_DATA u8 sLinkReceiveTaskId = 0;
static EWRAM_DATA u8 sUnknown_02022D0A = 0; static EWRAM_DATA u8 sUnknown_02022D0A = 0;
EWRAM_DATA struct UnusedControllerStruct gUnknown_02022D0C = {}; EWRAM_DATA struct UnusedControllerStruct gUnusedControllerStruct = {}; // Debug? Unused code that writes to it, never read
static EWRAM_DATA u8 sBattleBuffersTransferData[0x100] = {}; static EWRAM_DATA u8 sBattleBuffersTransferData[0x100] = {};
// this file's funcionts // this file's funcionts
@ -64,7 +64,7 @@ void SetUpBattleVarsAndBirchZigzagoon(void)
if (gBattleTypeFlags & BATTLE_TYPE_FIRST_BATTLE) if (gBattleTypeFlags & BATTLE_TYPE_FIRST_BATTLE)
{ {
ZeroEnemyPartyMons(); ZeroEnemyPartyMons();
CreateMon(&gEnemyParty[0], SPECIES_ZIGZAGOON, 2, 32, 0, 0, OT_ID_PLAYER_ID, 0); CreateMon(&gEnemyParty[0], SPECIES_ZIGZAGOON, 2, USE_RANDOM_IVS, 0, 0, OT_ID_PLAYER_ID, 0);
i = 0; i = 0;
SetMonData(&gEnemyParty[0], MON_DATA_HELD_ITEM, &i); SetMonData(&gEnemyParty[0], MON_DATA_HELD_ITEM, &i);
} }
@ -174,9 +174,9 @@ static void InitSinglePlayerBtlControllers(void)
if (gBattleTypeFlags & BATTLE_TYPE_RECORDED) if (gBattleTypeFlags & BATTLE_TYPE_RECORDED)
{ {
if (gBattleTypeFlags & BATTLE_TYPE_x2000000) if (gBattleTypeFlags & BATTLE_TYPE_RECORDED_LINK)
{ {
if (gBattleTypeFlags & BATTLE_TYPE_x80000000) if (gBattleTypeFlags & BATTLE_TYPE_RECORDED_IS_MASTER)
{ {
gBattleMainFunc = BeginBattleIntro; gBattleMainFunc = BeginBattleIntro;
@ -259,9 +259,9 @@ static void InitSinglePlayerBtlControllers(void)
} }
else if (gBattleTypeFlags & BATTLE_TYPE_MULTI) else if (gBattleTypeFlags & BATTLE_TYPE_MULTI)
{ {
u8 var; // multiplayer Id in a recorded battle? u8 multiplayerId;
for (var = gUnknown_0203C7B4, i = 0; i < MAX_BATTLERS_COUNT; i++) for (multiplayerId = gRecordedBattleMultiplayerId, i = 0; i < MAX_BATTLERS_COUNT; i++)
{ {
switch (gLinkPlayers[i].id) switch (gLinkPlayers[i].id)
{ {
@ -275,7 +275,7 @@ static void InitSinglePlayerBtlControllers(void)
break; break;
} }
if (i == var) if (i == multiplayerId)
{ {
gBattlerControllerFuncs[gLinkPlayers[i].id] = SetControllerToRecordedPlayer; gBattlerControllerFuncs[gLinkPlayers[i].id] = SetControllerToRecordedPlayer;
switch (gLinkPlayers[i].id) switch (gLinkPlayers[i].id)
@ -292,8 +292,8 @@ static void InitSinglePlayerBtlControllers(void)
break; break;
} }
} }
else if ((!(gLinkPlayers[i].id & 1) && !(gLinkPlayers[var].id & 1)) else if ((!(gLinkPlayers[i].id & 1) && !(gLinkPlayers[multiplayerId].id & 1))
|| ((gLinkPlayers[i].id & 1) && (gLinkPlayers[var].id & 1))) || ((gLinkPlayers[i].id & 1) && (gLinkPlayers[multiplayerId].id & 1)))
{ {
gBattlerControllerFuncs[gLinkPlayers[i].id] = SetControllerToRecordedPlayer; gBattlerControllerFuncs[gLinkPlayers[i].id] = SetControllerToRecordedPlayer;
switch (gLinkPlayers[i].id) switch (gLinkPlayers[i].id)
@ -337,7 +337,7 @@ static void InitSinglePlayerBtlControllers(void)
gBattlerControllerFuncs[2] = SetControllerToRecordedPlayer; gBattlerControllerFuncs[2] = SetControllerToRecordedPlayer;
gBattlerPositions[2] = B_POSITION_PLAYER_RIGHT; gBattlerPositions[2] = B_POSITION_PLAYER_RIGHT;
if (gBattleTypeFlags & BATTLE_TYPE_x2000000) if (gBattleTypeFlags & BATTLE_TYPE_RECORDED_LINK)
{ {
gBattlerControllerFuncs[1] = SetControllerToRecordedOpponent; gBattlerControllerFuncs[1] = SetControllerToRecordedOpponent;
gBattlerPositions[1] = B_POSITION_OPPONENT_LEFT; gBattlerPositions[1] = B_POSITION_OPPONENT_LEFT;
@ -362,7 +362,7 @@ static void InitSinglePlayerBtlControllers(void)
gBattlerControllerFuncs[3] = SetControllerToRecordedPlayer; gBattlerControllerFuncs[3] = SetControllerToRecordedPlayer;
gBattlerPositions[3] = B_POSITION_PLAYER_RIGHT; gBattlerPositions[3] = B_POSITION_PLAYER_RIGHT;
if (gBattleTypeFlags & BATTLE_TYPE_x2000000) if (gBattleTypeFlags & BATTLE_TYPE_RECORDED_LINK)
{ {
gBattlerControllerFuncs[0] = SetControllerToRecordedOpponent; gBattlerControllerFuncs[0] = SetControllerToRecordedOpponent;
gBattlerPositions[0] = B_POSITION_OPPONENT_LEFT; gBattlerPositions[0] = B_POSITION_OPPONENT_LEFT;
@ -825,7 +825,7 @@ void sub_8033648(void)
s32 j; s32 j;
u8 *recvBuffer; u8 *recvBuffer;
if (gReceivedRemoteLinkPlayers != 0 && (gBattleTypeFlags & BATTLE_TYPE_20)) if (gReceivedRemoteLinkPlayers != 0 && (gBattleTypeFlags & BATTLE_TYPE_LINK_IN_BATTLE))
{ {
DestroyTask_RfuIdle(); DestroyTask_RfuIdle();
for (i = 0; i < GetLinkPlayerCount(); i++) for (i = 0; i < GetLinkPlayerCount(); i++)
@ -1282,7 +1282,7 @@ void BtlController_EmitPlayBGM(u8 bufferId, u16 songId, void *unusedDumbDataPara
{ {
s32 i; s32 i;
sBattleBuffersTransferData[0] = CONTROLLER_31; sBattleBuffersTransferData[0] = CONTROLLER_PLAYBGM;
sBattleBuffersTransferData[1] = songId; sBattleBuffersTransferData[1] = songId;
sBattleBuffersTransferData[2] = (songId & 0xFF00) >> 8; sBattleBuffersTransferData[2] = (songId & 0xFF00) >> 8;
for (i = 0; i < songId; i++) // ???? for (i = 0; i < songId; i++) // ????
@ -1340,37 +1340,37 @@ void BtlController_EmitOneReturnValue_Duplicate(u8 bufferId, u16 b)
PrepareBufferDataTransfer(bufferId, sBattleBuffersTransferData, 4); PrepareBufferDataTransfer(bufferId, sBattleBuffersTransferData, 4);
} }
void BtlController_EmitCmd37(u8 bufferId) void BtlController_EmitClearUnkVar(u8 bufferId)
{ {
sBattleBuffersTransferData[0] = CONTROLLER_37; sBattleBuffersTransferData[0] = CONTROLLER_CLEARUNKVAR;
sBattleBuffersTransferData[1] = CONTROLLER_37; sBattleBuffersTransferData[1] = CONTROLLER_CLEARUNKVAR;
sBattleBuffersTransferData[2] = CONTROLLER_37; sBattleBuffersTransferData[2] = CONTROLLER_CLEARUNKVAR;
sBattleBuffersTransferData[3] = CONTROLLER_37; sBattleBuffersTransferData[3] = CONTROLLER_CLEARUNKVAR;
PrepareBufferDataTransfer(bufferId, sBattleBuffersTransferData, 4); PrepareBufferDataTransfer(bufferId, sBattleBuffersTransferData, 4);
} }
void BtlController_EmitCmd38(u8 bufferId, u8 b) void BtlController_EmitSetUnkVar(u8 bufferId, u8 b)
{ {
sBattleBuffersTransferData[0] = CONTROLLER_38; sBattleBuffersTransferData[0] = CONTROLLER_SETUNKVAR;
sBattleBuffersTransferData[1] = b; sBattleBuffersTransferData[1] = b;
PrepareBufferDataTransfer(bufferId, sBattleBuffersTransferData, 2); PrepareBufferDataTransfer(bufferId, sBattleBuffersTransferData, 2);
} }
void BtlController_EmitCmd39(u8 bufferId) void BtlController_EmitClearUnkFlag(u8 bufferId)
{ {
sBattleBuffersTransferData[0] = CONTROLLER_39; sBattleBuffersTransferData[0] = CONTROLLER_CLEARUNKFLAG;
sBattleBuffersTransferData[1] = CONTROLLER_39; sBattleBuffersTransferData[1] = CONTROLLER_CLEARUNKFLAG;
sBattleBuffersTransferData[2] = CONTROLLER_39; sBattleBuffersTransferData[2] = CONTROLLER_CLEARUNKFLAG;
sBattleBuffersTransferData[3] = CONTROLLER_39; sBattleBuffersTransferData[3] = CONTROLLER_CLEARUNKFLAG;
PrepareBufferDataTransfer(bufferId, sBattleBuffersTransferData, 4); PrepareBufferDataTransfer(bufferId, sBattleBuffersTransferData, 4);
} }
void BtlController_EmitCmd40(u8 bufferId) void BtlController_EmitToggleUnkFlag(u8 bufferId)
{ {
sBattleBuffersTransferData[0] = CONTROLLER_40; sBattleBuffersTransferData[0] = CONTROLLER_TOGGLEUNKFLAG;
sBattleBuffersTransferData[1] = CONTROLLER_40; sBattleBuffersTransferData[1] = CONTROLLER_TOGGLEUNKFLAG;
sBattleBuffersTransferData[2] = CONTROLLER_40; sBattleBuffersTransferData[2] = CONTROLLER_TOGGLEUNKFLAG;
sBattleBuffersTransferData[3] = CONTROLLER_40; sBattleBuffersTransferData[3] = CONTROLLER_TOGGLEUNKFLAG;
PrepareBufferDataTransfer(bufferId, sBattleBuffersTransferData, 4); PrepareBufferDataTransfer(bufferId, sBattleBuffersTransferData, 4);
} }
@ -1394,7 +1394,7 @@ void BtlController_EmitCmd42(u8 bufferId)
void BtlController_EmitPlaySE(u8 bufferId, u16 songId) void BtlController_EmitPlaySE(u8 bufferId, u16 songId)
{ {
sBattleBuffersTransferData[0] = CONTROLLER_EFFECTIVENESSSOUND; sBattleBuffersTransferData[0] = CONTROLLER_PLAYSE;
sBattleBuffersTransferData[1] = songId; sBattleBuffersTransferData[1] = songId;
sBattleBuffersTransferData[2] = (songId & 0xFF00) >> 8; sBattleBuffersTransferData[2] = (songId & 0xFF00) >> 8;
sBattleBuffersTransferData[3] = 0; sBattleBuffersTransferData[3] = 0;

View File

@ -2875,7 +2875,7 @@ static u8 GetDomeTrainerMonIvs(u16 trainerId)
else if (trainerId <= FRONTIER_TRAINER_TESS) // 200 - 219 else if (trainerId <= FRONTIER_TRAINER_TESS) // 200 - 219
fixedIv = 21; fixedIv = 21;
else // 220+ (- 299) else // 220+ (- 299)
fixedIv = 31; fixedIv = MAX_PER_STAT_IVS;
return fixedIv; return fixedIv;
} }

View File

@ -25,8 +25,8 @@ static void InitFactoryChallenge(void);
static void GetBattleFactoryData(void); static void GetBattleFactoryData(void);
static void SetBattleFactoryData(void); static void SetBattleFactoryData(void);
static void SaveFactoryChallenge(void); static void SaveFactoryChallenge(void);
static void nullsub_75(void); static void FactoryDummy1(void);
static void nullsub_123(void); static void FactoryDummy2(void);
static void SelectInitialRentalMons(void); static void SelectInitialRentalMons(void);
static void SwapRentalMons(void); static void SwapRentalMons(void);
static void SetPerformedRentalSwap(void); static void SetPerformedRentalSwap(void);
@ -41,8 +41,16 @@ static void RestorePlayerPartyHeldItems(void);
static u16 GetFactoryMonId(u8 lvlMode, u8 challengeNum, bool8 arg2); static u16 GetFactoryMonId(u8 lvlMode, u8 challengeNum, bool8 arg2);
static u8 GetMoveBattleStyle(u16 move); static u8 GetMoveBattleStyle(u16 move);
// Const rom data. // Number of moves needed on the team to be considered using a certain battle style
static const u8 sRequiredMoveCounts[] = {3, 3, 3, 2, 2, 2, 2}; static const u8 sRequiredMoveCounts[FACTORY_NUM_STYLES - 1] = {
[FACTORY_STYLE_PREPARATION - 1] = 3,
[FACTORY_STYLE_SLOW_STEADY - 1] = 3,
[FACTORY_STYLE_ENDURANCE - 1] = 3,
[FACTORY_STYLE_HIGH_RISK - 1] = 2,
[FACTORY_STYLE_WEAKENING - 1] = 2,
[FACTORY_STYLE_UNPREDICTABLE - 1] = 2,
[FACTORY_STYLE_WEATHER - 1] = 2
};
static const u16 sMoves_TotalPreparation[] = static const u16 sMoves_TotalPreparation[] =
{ {
@ -119,8 +127,8 @@ static void (* const sBattleFactoryFunctions[])(void) =
[BATTLE_FACTORY_FUNC_GET_DATA] = GetBattleFactoryData, [BATTLE_FACTORY_FUNC_GET_DATA] = GetBattleFactoryData,
[BATTLE_FACTORY_FUNC_SET_DATA] = SetBattleFactoryData, [BATTLE_FACTORY_FUNC_SET_DATA] = SetBattleFactoryData,
[BATTLE_FACTORY_FUNC_SAVE] = SaveFactoryChallenge, [BATTLE_FACTORY_FUNC_SAVE] = SaveFactoryChallenge,
[BATTLE_FACTORY_FUNC_NULL] = nullsub_75, [BATTLE_FACTORY_FUNC_NULL] = FactoryDummy1,
[BATTLE_FACTORY_FUNC_NULL2] = nullsub_123, [BATTLE_FACTORY_FUNC_NULL2] = FactoryDummy2,
[BATTLE_FACTORY_FUNC_SELECT_RENT_MONS] = SelectInitialRentalMons, [BATTLE_FACTORY_FUNC_SELECT_RENT_MONS] = SelectInitialRentalMons,
[BATTLE_FACTORY_FUNC_SWAP_RENT_MONS] = SwapRentalMons, [BATTLE_FACTORY_FUNC_SWAP_RENT_MONS] = SwapRentalMons,
[BATTLE_FACTORY_FUNC_SET_SWAPPED] = SetPerformedRentalSwap, [BATTLE_FACTORY_FUNC_SET_SWAPPED] = SetPerformedRentalSwap,
@ -266,12 +274,12 @@ static void SaveFactoryChallenge(void)
SaveGameFrontier(); SaveGameFrontier();
} }
static void nullsub_75(void) static void FactoryDummy1(void)
{ {
} }
static void nullsub_123(void) static void FactoryDummy2(void)
{ {
} }
@ -376,10 +384,10 @@ static void SetRentalsToOpponentParty(void)
for (i = 0; i < FRONTIER_PARTY_SIZE; i++) for (i = 0; i < FRONTIER_PARTY_SIZE; i++)
{ {
gSaveBlock2Ptr->frontier.rentalMons[i + 3].monId = gFrontierTempParty[i]; gSaveBlock2Ptr->frontier.rentalMons[i + FRONTIER_PARTY_SIZE].monId = gFrontierTempParty[i];
gSaveBlock2Ptr->frontier.rentalMons[i + 3].ivs = GetBoxMonData(&gEnemyParty[i].box, MON_DATA_ATK_IV, NULL); gSaveBlock2Ptr->frontier.rentalMons[i + FRONTIER_PARTY_SIZE].ivs = GetBoxMonData(&gEnemyParty[i].box, MON_DATA_ATK_IV, NULL);
gSaveBlock2Ptr->frontier.rentalMons[i + 3].personality = GetMonData(&gEnemyParty[i], MON_DATA_PERSONALITY, NULL); gSaveBlock2Ptr->frontier.rentalMons[i + FRONTIER_PARTY_SIZE].personality = GetMonData(&gEnemyParty[i], MON_DATA_PERSONALITY, NULL);
gSaveBlock2Ptr->frontier.rentalMons[i + 3].abilityNum = GetBoxMonData(&gEnemyParty[i].box, MON_DATA_ABILITY_NUM, NULL); gSaveBlock2Ptr->frontier.rentalMons[i + FRONTIER_PARTY_SIZE].abilityNum = GetBoxMonData(&gEnemyParty[i].box, MON_DATA_ABILITY_NUM, NULL);
SetMonData(&gEnemyParty[i], MON_DATA_HELD_ITEM, &gBattleFrontierHeldItems[gFacilityTrainerMons[gFrontierTempParty[i]].itemTableId]); SetMonData(&gEnemyParty[i], MON_DATA_HELD_ITEM, &gBattleFrontierHeldItems[gFacilityTrainerMons[gFrontierTempParty[i]].itemTableId]);
} }
} }
@ -455,13 +463,13 @@ static void SetPlayerAndOpponentParties(void)
case 2: case 2:
for (i = 0; i < FRONTIER_PARTY_SIZE; i++) for (i = 0; i < FRONTIER_PARTY_SIZE; i++)
{ {
monId = gSaveBlock2Ptr->frontier.rentalMons[i + 3].monId; monId = gSaveBlock2Ptr->frontier.rentalMons[i + FRONTIER_PARTY_SIZE].monId;
ivs = gSaveBlock2Ptr->frontier.rentalMons[i + 3].ivs; ivs = gSaveBlock2Ptr->frontier.rentalMons[i + FRONTIER_PARTY_SIZE].ivs;
CreateMon(&gEnemyParty[i], CreateMon(&gEnemyParty[i],
gFacilityTrainerMons[monId].species, gFacilityTrainerMons[monId].species,
monLevel, monLevel,
ivs, ivs,
TRUE, gSaveBlock2Ptr->frontier.rentalMons[i + 3].personality, TRUE, gSaveBlock2Ptr->frontier.rentalMons[i + FRONTIER_PARTY_SIZE].personality,
OT_ID_PLAYER_ID, 0); OT_ID_PLAYER_ID, 0);
count = 0; count = 0;
@ -484,7 +492,7 @@ static void SetPlayerAndOpponentParties(void)
for (k = 0; k < MAX_MON_MOVES; k++) for (k = 0; k < MAX_MON_MOVES; k++)
SetMonMoveAvoidReturn(&gEnemyParty[i], gFacilityTrainerMons[monId].moves[k], k); SetMonMoveAvoidReturn(&gEnemyParty[i], gFacilityTrainerMons[monId].moves[k], k);
SetMonData(&gEnemyParty[i], MON_DATA_HELD_ITEM, &gBattleFrontierHeldItems[gFacilityTrainerMons[monId].itemTableId]); SetMonData(&gEnemyParty[i], MON_DATA_HELD_ITEM, &gBattleFrontierHeldItems[gFacilityTrainerMons[monId].itemTableId]);
SetMonData(&gEnemyParty[i], MON_DATA_ABILITY_NUM, &gSaveBlock2Ptr->frontier.rentalMons[i + 3].abilityNum); SetMonData(&gEnemyParty[i], MON_DATA_ABILITY_NUM, &gSaveBlock2Ptr->frontier.rentalMons[i + FRONTIER_PARTY_SIZE].abilityNum);
} }
break; break;
} }
@ -639,7 +647,7 @@ static void GetOpponentBattleStyle(void)
} }
} }
gSpecialVar_Result = 0; gSpecialVar_Result = FACTORY_STYLE_NONE;
for (i = 1; i < FACTORY_NUM_STYLES; i++) for (i = 1; i < FACTORY_NUM_STYLES; i++)
{ {
if (stylePoints[i] >= sRequiredMoveCounts[i - 1]) if (stylePoints[i] >= sRequiredMoveCounts[i - 1])

File diff suppressed because it is too large Load Diff

View File

@ -988,11 +988,11 @@ void BattleLoadSubstituteOrMonSpriteGfx(u8 battlerId, bool8 loadMonSprite)
position = GetBattlerPosition(battlerId); position = GetBattlerPosition(battlerId);
if (IsContest()) if (IsContest())
LZDecompressVram(gSubstituteDollTilemap, gMonSpritesGfxPtr->sprites.ptr[position]); LZDecompressVram(gSubstituteDollBackGfx, gMonSpritesGfxPtr->sprites.ptr[position]);
else if (GetBattlerSide(battlerId) != B_SIDE_PLAYER) else if (GetBattlerSide(battlerId) != B_SIDE_PLAYER)
LZDecompressVram(gSubstituteDollGfx, gMonSpritesGfxPtr->sprites.ptr[position]); LZDecompressVram(gSubstituteDollFrontGfx, gMonSpritesGfxPtr->sprites.ptr[position]);
else else
LZDecompressVram(gSubstituteDollTilemap, gMonSpritesGfxPtr->sprites.ptr[position]); LZDecompressVram(gSubstituteDollBackGfx, gMonSpritesGfxPtr->sprites.ptr[position]);
for (i = 1; i < 4; i++) for (i = 1; i < 4; i++)
{ {

View File

@ -1897,7 +1897,6 @@ static void UpdateNickInHealthbox(u8 healthboxSpriteId, struct Pokemon *mon)
{ {
u8 nickname[POKEMON_NAME_LENGTH + 1]; u8 nickname[POKEMON_NAME_LENGTH + 1];
void *ptr; void *ptr;
const u8 *genderTxt;
u32 windowId, spriteTileNum; u32 windowId, spriteTileNum;
u8 *windowTileData; u8 *windowTileData;
u16 species; u16 species;

View File

@ -357,7 +357,7 @@ static void BattleIntroSlide3(u8 taskId)
SetGpuReg(REG_OFFSET_BLDALPHA, BLDALPHA_BLEND(8, 8)); SetGpuReg(REG_OFFSET_BLDALPHA, BLDALPHA_BLEND(8, 8));
SetGpuReg(REG_OFFSET_BLDY, 0); SetGpuReg(REG_OFFSET_BLDY, 0);
gTasks[taskId].data[4] = BLDALPHA_BLEND(8, 8); gTasks[taskId].data[4] = BLDALPHA_BLEND(8, 8);
if (gBattleTypeFlags & (BATTLE_TYPE_LINK | BATTLE_TYPE_x2000000)) if (gBattleTypeFlags & (BATTLE_TYPE_LINK | BATTLE_TYPE_RECORDED_LINK))
{ {
gTasks[taskId].data[2] = 16; gTasks[taskId].data[2] = 16;
gTasks[taskId].data[0]++; gTasks[taskId].data[0]++;

View File

@ -572,13 +572,9 @@ const u8 * const gStatusConditionStringsTable[7][2] =
{gStatusConditionString_LoveJpn, gText_Love} {gStatusConditionString_LoveJpn, gText_Love}
}; };
static const u8 sPkblToEscapeFactor[][3] = {{0, 0, 0}, {3, 5, 0}, {2, 3, 0}, {1, 2, 0}, {1, 1, 0}}; // code
static const u8 sGoNearCounterToCatchFactor[] = {4, 3, 2, 1};
static const u8 sGoNearCounterToEscapeFactor[] = {4, 4, 4, 4};
void CB2_InitBattle(void) void CB2_InitBattle(void)
{ {
u32 i;
MoveSaveBlocks_ResetHeap(); MoveSaveBlocks_ResetHeap();
AllocateBattleResources(); AllocateBattleResources();
AllocateBattleSpritesData(); AllocateBattleSpritesData();
@ -1112,7 +1108,7 @@ static void CB2_HandleStartBattle(void)
SetMainCallback2(BattleMainCB2); SetMainCallback2(BattleMainCB2);
if (gBattleTypeFlags & BATTLE_TYPE_LINK) if (gBattleTypeFlags & BATTLE_TYPE_LINK)
{ {
gBattleTypeFlags |= BATTLE_TYPE_20; gBattleTypeFlags |= BATTLE_TYPE_LINK_IN_BATTLE;
} }
} }
break; break;
@ -1366,7 +1362,7 @@ static void CB2_HandleStartMultiPartnerBattle(void)
SetMainCallback2(BattleMainCB2); SetMainCallback2(BattleMainCB2);
if (gBattleTypeFlags & BATTLE_TYPE_LINK) if (gBattleTypeFlags & BATTLE_TYPE_LINK)
{ {
gBattleTypeFlags |= BATTLE_TYPE_20; gBattleTypeFlags |= BATTLE_TYPE_LINK_IN_BATTLE;
} }
} }
break; break;
@ -1818,7 +1814,7 @@ static void CB2_HandleStartMultiBattle(void)
if (gBattleTypeFlags & BATTLE_TYPE_LINK) if (gBattleTypeFlags & BATTLE_TYPE_LINK)
{ {
gTrainerBattleOpponent_A = TRAINER_LINK_OPPONENT; gTrainerBattleOpponent_A = TRAINER_LINK_OPPONENT;
gBattleTypeFlags |= BATTLE_TYPE_20; gBattleTypeFlags |= BATTLE_TYPE_LINK_IN_BATTLE;
} }
} }
break; break;
@ -1971,7 +1967,7 @@ static u8 CreateNPCTrainerParty(struct Pokemon *party, u16 trainerNum, bool8 fir
nameHash += gSpeciesNames[partyData[i].species][j]; nameHash += gSpeciesNames[partyData[i].species][j];
personalityValue += nameHash << 8; personalityValue += nameHash << 8;
fixedIV = partyData[i].iv * 31 / 255; fixedIV = partyData[i].iv * MAX_PER_STAT_IVS / 255;
CreateMon(&party[i], partyData[i].species, partyData[i].lvl, fixedIV, TRUE, personalityValue, OT_ID_RANDOM_NO_SHINY, 0); CreateMon(&party[i], partyData[i].species, partyData[i].lvl, fixedIV, TRUE, personalityValue, OT_ID_RANDOM_NO_SHINY, 0);
break; break;
} }
@ -1983,7 +1979,7 @@ static u8 CreateNPCTrainerParty(struct Pokemon *party, u16 trainerNum, bool8 fir
nameHash += gSpeciesNames[partyData[i].species][j]; nameHash += gSpeciesNames[partyData[i].species][j];
personalityValue += nameHash << 8; personalityValue += nameHash << 8;
fixedIV = partyData[i].iv * 31 / 255; fixedIV = partyData[i].iv * MAX_PER_STAT_IVS / 255;
CreateMon(&party[i], partyData[i].species, partyData[i].lvl, fixedIV, TRUE, personalityValue, OT_ID_RANDOM_NO_SHINY, 0); CreateMon(&party[i], partyData[i].species, partyData[i].lvl, fixedIV, TRUE, personalityValue, OT_ID_RANDOM_NO_SHINY, 0);
for (j = 0; j < MAX_MON_MOVES; j++) for (j = 0; j < MAX_MON_MOVES; j++)
@ -2001,7 +1997,7 @@ static u8 CreateNPCTrainerParty(struct Pokemon *party, u16 trainerNum, bool8 fir
nameHash += gSpeciesNames[partyData[i].species][j]; nameHash += gSpeciesNames[partyData[i].species][j];
personalityValue += nameHash << 8; personalityValue += nameHash << 8;
fixedIV = partyData[i].iv * 31 / 255; fixedIV = partyData[i].iv * MAX_PER_STAT_IVS / 255;
CreateMon(&party[i], partyData[i].species, partyData[i].lvl, fixedIV, TRUE, personalityValue, OT_ID_RANDOM_NO_SHINY, 0); CreateMon(&party[i], partyData[i].species, partyData[i].lvl, fixedIV, TRUE, personalityValue, OT_ID_RANDOM_NO_SHINY, 0);
SetMonData(&party[i], MON_DATA_HELD_ITEM, &partyData[i].heldItem); SetMonData(&party[i], MON_DATA_HELD_ITEM, &partyData[i].heldItem);
@ -2015,7 +2011,7 @@ static u8 CreateNPCTrainerParty(struct Pokemon *party, u16 trainerNum, bool8 fir
nameHash += gSpeciesNames[partyData[i].species][j]; nameHash += gSpeciesNames[partyData[i].species][j];
personalityValue += nameHash << 8; personalityValue += nameHash << 8;
fixedIV = partyData[i].iv * 31 / 255; fixedIV = partyData[i].iv * MAX_PER_STAT_IVS / 255;
CreateMon(&party[i], partyData[i].species, partyData[i].lvl, fixedIV, TRUE, personalityValue, OT_ID_RANDOM_NO_SHINY, 0); CreateMon(&party[i], partyData[i].species, partyData[i].lvl, fixedIV, TRUE, personalityValue, OT_ID_RANDOM_NO_SHINY, 0);
SetMonData(&party[i], MON_DATA_HELD_ITEM, &partyData[i].heldItem); SetMonData(&party[i], MON_DATA_HELD_ITEM, &partyData[i].heldItem);
@ -2182,7 +2178,7 @@ void sub_8038D64(void)
SetHBlankCallback(NULL); SetHBlankCallback(NULL);
SetVBlankCallback(NULL); SetVBlankCallback(NULL);
gBattleTypeFlags &= ~(BATTLE_TYPE_20); gBattleTypeFlags &= ~(BATTLE_TYPE_LINK_IN_BATTLE);
if (gBattleTypeFlags & BATTLE_TYPE_FRONTIER) if (gBattleTypeFlags & BATTLE_TYPE_FRONTIER)
{ {
@ -2798,7 +2794,7 @@ void SpriteCb_OpponentMonFromBall(struct Sprite *sprite)
{ {
if (sprite->affineAnimEnded) if (sprite->affineAnimEnded)
{ {
if (!(gHitMarker & HITMARKER_NO_ANIMATIONS) || gBattleTypeFlags & (BATTLE_TYPE_LINK | BATTLE_TYPE_x2000000)) if (!(gHitMarker & HITMARKER_NO_ANIMATIONS) || gBattleTypeFlags & (BATTLE_TYPE_LINK | BATTLE_TYPE_RECORDED_LINK))
{ {
if (HasTwoFramesAnimation(sprite->sSpeciesId)) if (HasTwoFramesAnimation(sprite->sSpeciesId))
StartSpriteAnim(sprite, 1); StartSpriteAnim(sprite, 1);
@ -3036,7 +3032,7 @@ static void BattleStartClearSetData(void)
if (!(gBattleTypeFlags & BATTLE_TYPE_LINK) && gSaveBlock2Ptr->optionsBattleSceneOff == TRUE) if (!(gBattleTypeFlags & BATTLE_TYPE_LINK) && gSaveBlock2Ptr->optionsBattleSceneOff == TRUE)
gHitMarker |= HITMARKER_NO_ANIMATIONS; gHitMarker |= HITMARKER_NO_ANIMATIONS;
} }
else if (!(gBattleTypeFlags & (BATTLE_TYPE_LINK | BATTLE_TYPE_x2000000)) && GetBattleSceneInRecordedBattle()) else if (!(gBattleTypeFlags & (BATTLE_TYPE_LINK | BATTLE_TYPE_RECORDED_LINK)) && GetBattleSceneInRecordedBattle())
gHitMarker |= HITMARKER_NO_ANIMATIONS; gHitMarker |= HITMARKER_NO_ANIMATIONS;
gBattleScripting.battleStyle = gSaveBlock2Ptr->optionsBattleStyle; gBattleScripting.battleStyle = gSaveBlock2Ptr->optionsBattleStyle;
@ -3391,7 +3387,7 @@ static void BattleIntroDrawTrainersOrMonsSprites(void)
&& !(gBattleTypeFlags & (BATTLE_TYPE_EREADER_TRAINER && !(gBattleTypeFlags & (BATTLE_TYPE_EREADER_TRAINER
| BATTLE_TYPE_FRONTIER | BATTLE_TYPE_FRONTIER
| BATTLE_TYPE_LINK | BATTLE_TYPE_LINK
| BATTLE_TYPE_x2000000 | BATTLE_TYPE_RECORDED_LINK
| BATTLE_TYPE_TRAINER_HILL))) | BATTLE_TYPE_TRAINER_HILL)))
{ {
HandleSetPokedexFlag(SpeciesToNationalPokedexNum(gBattleMons[gActiveBattler].species), FLAG_SET_SEEN, gBattleMons[gActiveBattler].personality); HandleSetPokedexFlag(SpeciesToNationalPokedexNum(gBattleMons[gActiveBattler].species), FLAG_SET_SEEN, gBattleMons[gActiveBattler].personality);
@ -3404,7 +3400,7 @@ static void BattleIntroDrawTrainersOrMonsSprites(void)
if (!(gBattleTypeFlags & (BATTLE_TYPE_EREADER_TRAINER if (!(gBattleTypeFlags & (BATTLE_TYPE_EREADER_TRAINER
| BATTLE_TYPE_FRONTIER | BATTLE_TYPE_FRONTIER
| BATTLE_TYPE_LINK | BATTLE_TYPE_LINK
| BATTLE_TYPE_x2000000 | BATTLE_TYPE_RECORDED_LINK
| BATTLE_TYPE_TRAINER_HILL))) | BATTLE_TYPE_TRAINER_HILL)))
{ {
HandleSetPokedexFlag(SpeciesToNationalPokedexNum(gBattleMons[gActiveBattler].species), FLAG_SET_SEEN, gBattleMons[gActiveBattler].personality); HandleSetPokedexFlag(SpeciesToNationalPokedexNum(gBattleMons[gActiveBattler].species), FLAG_SET_SEEN, gBattleMons[gActiveBattler].personality);
@ -3539,9 +3535,9 @@ static void BattleIntroPrintOpponentSendsOut(void)
if (!(gBattleTypeFlags & BATTLE_TYPE_RECORDED)) if (!(gBattleTypeFlags & BATTLE_TYPE_RECORDED))
position = B_POSITION_OPPONENT_LEFT; position = B_POSITION_OPPONENT_LEFT;
else if (gBattleTypeFlags & BATTLE_TYPE_x2000000) else if (gBattleTypeFlags & BATTLE_TYPE_RECORDED_LINK)
{ {
if (gBattleTypeFlags & BATTLE_TYPE_x80000000) if (gBattleTypeFlags & BATTLE_TYPE_RECORDED_IS_MASTER)
position = B_POSITION_OPPONENT_LEFT; position = B_POSITION_OPPONENT_LEFT;
else else
position = B_POSITION_PLAYER_LEFT; position = B_POSITION_PLAYER_LEFT;
@ -3559,9 +3555,9 @@ static void BattleIntroOpponent2SendsOutMonAnimation(void)
if (!(gBattleTypeFlags & BATTLE_TYPE_RECORDED)) if (!(gBattleTypeFlags & BATTLE_TYPE_RECORDED))
position = B_POSITION_OPPONENT_RIGHT; position = B_POSITION_OPPONENT_RIGHT;
else if (gBattleTypeFlags & BATTLE_TYPE_x2000000) else if (gBattleTypeFlags & BATTLE_TYPE_RECORDED_LINK)
{ {
if (gBattleTypeFlags & BATTLE_TYPE_x80000000) if (gBattleTypeFlags & BATTLE_TYPE_RECORDED_IS_MASTER)
position = B_POSITION_OPPONENT_RIGHT; position = B_POSITION_OPPONENT_RIGHT;
else else
position = B_POSITION_PLAYER_RIGHT; position = B_POSITION_PLAYER_RIGHT;
@ -3587,9 +3583,9 @@ static void BattleIntroOpponent1SendsOutMonAnimation(void)
if (gBattleTypeFlags & BATTLE_TYPE_RECORDED) if (gBattleTypeFlags & BATTLE_TYPE_RECORDED)
{ {
if (gBattleTypeFlags & BATTLE_TYPE_x2000000) if (gBattleTypeFlags & BATTLE_TYPE_RECORDED_LINK)
{ {
if (gBattleTypeFlags & BATTLE_TYPE_x80000000) if (gBattleTypeFlags & BATTLE_TYPE_RECORDED_IS_MASTER)
position = B_POSITION_OPPONENT_LEFT; position = B_POSITION_OPPONENT_LEFT;
else else
position = B_POSITION_PLAYER_LEFT; position = B_POSITION_PLAYER_LEFT;
@ -3630,7 +3626,7 @@ static void BattleIntroRecordMonsToDex(void)
&& !(gBattleTypeFlags & (BATTLE_TYPE_EREADER_TRAINER && !(gBattleTypeFlags & (BATTLE_TYPE_EREADER_TRAINER
| BATTLE_TYPE_FRONTIER | BATTLE_TYPE_FRONTIER
| BATTLE_TYPE_LINK | BATTLE_TYPE_LINK
| BATTLE_TYPE_x2000000 | BATTLE_TYPE_RECORDED_LINK
| BATTLE_TYPE_TRAINER_HILL))) | BATTLE_TYPE_TRAINER_HILL)))
{ {
HandleSetPokedexFlag(SpeciesToNationalPokedexNum(gBattleMons[gActiveBattler].species), FLAG_SET_SEEN, gBattleMons[gActiveBattler].personality); HandleSetPokedexFlag(SpeciesToNationalPokedexNum(gBattleMons[gActiveBattler].species), FLAG_SET_SEEN, gBattleMons[gActiveBattler].personality);
@ -3654,9 +3650,9 @@ static void BattleIntroPrintPlayerSendsOut(void)
if (!(gBattleTypeFlags & BATTLE_TYPE_RECORDED)) if (!(gBattleTypeFlags & BATTLE_TYPE_RECORDED))
position = B_POSITION_PLAYER_LEFT; position = B_POSITION_PLAYER_LEFT;
else if (gBattleTypeFlags & BATTLE_TYPE_x2000000) else if (gBattleTypeFlags & BATTLE_TYPE_RECORDED_LINK)
{ {
if (gBattleTypeFlags & BATTLE_TYPE_x80000000) if (gBattleTypeFlags & BATTLE_TYPE_RECORDED_IS_MASTER)
position = B_POSITION_PLAYER_LEFT; position = B_POSITION_PLAYER_LEFT;
else else
position = B_POSITION_OPPONENT_LEFT; position = B_POSITION_OPPONENT_LEFT;
@ -3677,9 +3673,9 @@ static void BattleIntroPlayer2SendsOutMonAnimation(void)
if (!(gBattleTypeFlags & BATTLE_TYPE_RECORDED)) if (!(gBattleTypeFlags & BATTLE_TYPE_RECORDED))
position = B_POSITION_PLAYER_RIGHT; position = B_POSITION_PLAYER_RIGHT;
else if (gBattleTypeFlags & BATTLE_TYPE_x2000000) else if (gBattleTypeFlags & BATTLE_TYPE_RECORDED_LINK)
{ {
if (gBattleTypeFlags & BATTLE_TYPE_x80000000) if (gBattleTypeFlags & BATTLE_TYPE_RECORDED_IS_MASTER)
position = B_POSITION_PLAYER_RIGHT; position = B_POSITION_PLAYER_RIGHT;
else else
position = B_POSITION_OPPONENT_RIGHT; position = B_POSITION_OPPONENT_RIGHT;
@ -3709,9 +3705,9 @@ static void BattleIntroPlayer1SendsOutMonAnimation(void)
if (!(gBattleTypeFlags & BATTLE_TYPE_RECORDED)) if (!(gBattleTypeFlags & BATTLE_TYPE_RECORDED))
position = B_POSITION_PLAYER_LEFT; position = B_POSITION_PLAYER_LEFT;
else if (gBattleTypeFlags & BATTLE_TYPE_x2000000) else if (gBattleTypeFlags & BATTLE_TYPE_RECORDED_LINK)
{ {
if (gBattleTypeFlags & BATTLE_TYPE_x80000000) if (gBattleTypeFlags & BATTLE_TYPE_RECORDED_IS_MASTER)
position = B_POSITION_PLAYER_LEFT; position = B_POSITION_PLAYER_LEFT;
else else
position = B_POSITION_OPPONENT_LEFT; position = B_POSITION_OPPONENT_LEFT;
@ -4150,7 +4146,7 @@ static void HandleTurnActionSelectionState(void)
if (gBattleTypeFlags & (BATTLE_TYPE_LINK if (gBattleTypeFlags & (BATTLE_TYPE_LINK
| BATTLE_TYPE_FRONTIER_NO_PYRAMID | BATTLE_TYPE_FRONTIER_NO_PYRAMID
| BATTLE_TYPE_EREADER_TRAINER | BATTLE_TYPE_EREADER_TRAINER
| BATTLE_TYPE_x2000000)) | BATTLE_TYPE_RECORDED_LINK))
{ {
RecordedBattle_ClearBattlerAction(gActiveBattler, 1); RecordedBattle_ClearBattlerAction(gActiveBattler, 1);
gSelectionBattleScripts[gActiveBattler] = BattleScript_ActionSelectionItemsCantBeUsed; gSelectionBattleScripts[gActiveBattler] = BattleScript_ActionSelectionItemsCantBeUsed;
@ -4258,7 +4254,7 @@ static void HandleTurnActionSelectionState(void)
return; return;
} }
else if (gBattleTypeFlags & BATTLE_TYPE_TRAINER else if (gBattleTypeFlags & BATTLE_TYPE_TRAINER
&& !(gBattleTypeFlags & (BATTLE_TYPE_LINK | BATTLE_TYPE_x2000000)) && !(gBattleTypeFlags & (BATTLE_TYPE_LINK | BATTLE_TYPE_RECORDED_LINK))
&& gBattleBufferB[gActiveBattler][1] == B_ACTION_RUN) && gBattleBufferB[gActiveBattler][1] == B_ACTION_RUN)
{ {
BattleScriptExecute(BattleScript_PrintCantRunFromTrainer); BattleScriptExecute(BattleScript_PrintCantRunFromTrainer);
@ -4569,7 +4565,7 @@ u8 GetWhoStrikesFirst(u8 battler1, u8 battler2, bool8 ignoreChosenMoves)
} }
// badge boost // badge boost
if (!(gBattleTypeFlags & (BATTLE_TYPE_LINK | BATTLE_TYPE_x2000000 | BATTLE_TYPE_FRONTIER)) if (!(gBattleTypeFlags & (BATTLE_TYPE_LINK | BATTLE_TYPE_RECORDED_LINK | BATTLE_TYPE_FRONTIER))
&& FlagGet(FLAG_BADGE03_GET) && FlagGet(FLAG_BADGE03_GET)
&& GetBattlerSide(battler1) == B_SIDE_PLAYER) && GetBattlerSide(battler1) == B_SIDE_PLAYER)
{ {
@ -4603,7 +4599,7 @@ u8 GetWhoStrikesFirst(u8 battler1, u8 battler2, bool8 ignoreChosenMoves)
} }
// badge boost // badge boost
if (!(gBattleTypeFlags & (BATTLE_TYPE_LINK | BATTLE_TYPE_x2000000 | BATTLE_TYPE_FRONTIER)) if (!(gBattleTypeFlags & (BATTLE_TYPE_LINK | BATTLE_TYPE_RECORDED_LINK | BATTLE_TYPE_FRONTIER))
&& FlagGet(FLAG_BADGE03_GET) && FlagGet(FLAG_BADGE03_GET)
&& GetBattlerSide(battler2) == B_SIDE_PLAYER) && GetBattlerSide(battler2) == B_SIDE_PLAYER)
{ {
@ -4887,7 +4883,7 @@ static void HandleEndTurn_BattleWon(void)
{ {
gCurrentActionFuncId = 0; gCurrentActionFuncId = 0;
if (gBattleTypeFlags & (BATTLE_TYPE_LINK | BATTLE_TYPE_x2000000)) if (gBattleTypeFlags & (BATTLE_TYPE_LINK | BATTLE_TYPE_RECORDED_LINK))
{ {
gSpecialVar_Result = gBattleOutcome; gSpecialVar_Result = gBattleOutcome;
gBattleTextBuff1[0] = gBattleOutcome; gBattleTextBuff1[0] = gBattleOutcome;
@ -4945,7 +4941,7 @@ static void HandleEndTurn_BattleLost(void)
{ {
gCurrentActionFuncId = 0; gCurrentActionFuncId = 0;
if (gBattleTypeFlags & (BATTLE_TYPE_LINK | BATTLE_TYPE_x2000000)) if (gBattleTypeFlags & (BATTLE_TYPE_LINK | BATTLE_TYPE_RECORDED_LINK))
{ {
if (gBattleTypeFlags & BATTLE_TYPE_FRONTIER) if (gBattleTypeFlags & BATTLE_TYPE_FRONTIER)
{ {
@ -5026,7 +5022,7 @@ static void HandleEndTurn_FinishBattle(void)
if (gCurrentActionFuncId == B_ACTION_TRY_FINISH || gCurrentActionFuncId == B_ACTION_FINISHED) if (gCurrentActionFuncId == B_ACTION_TRY_FINISH || gCurrentActionFuncId == B_ACTION_FINISHED)
{ {
if (!(gBattleTypeFlags & (BATTLE_TYPE_LINK if (!(gBattleTypeFlags & (BATTLE_TYPE_LINK
| BATTLE_TYPE_x2000000 | BATTLE_TYPE_RECORDED_LINK
| BATTLE_TYPE_FIRST_BATTLE | BATTLE_TYPE_FIRST_BATTLE
| BATTLE_TYPE_SAFARI | BATTLE_TYPE_SAFARI
| BATTLE_TYPE_EREADER_TRAINER | BATTLE_TYPE_EREADER_TRAINER
@ -5053,7 +5049,7 @@ static void HandleEndTurn_FinishBattle(void)
} }
if (!(gBattleTypeFlags & (BATTLE_TYPE_LINK if (!(gBattleTypeFlags & (BATTLE_TYPE_LINK
| BATTLE_TYPE_x2000000 | BATTLE_TYPE_RECORDED_LINK
| BATTLE_TYPE_TRAINER | BATTLE_TYPE_TRAINER
| BATTLE_TYPE_FIRST_BATTLE | BATTLE_TYPE_FIRST_BATTLE
| BATTLE_TYPE_SAFARI | BATTLE_TYPE_SAFARI

View File

@ -180,7 +180,7 @@ static const u8 sText_PkmnStayedAwakeUsing[] = _("{B_DEF_NAME_WITH_PREFIX} staye
static const u8 sText_PkmnStoringEnergy[] = _("{B_ATK_NAME_WITH_PREFIX} is storing\nenergy!"); static const u8 sText_PkmnStoringEnergy[] = _("{B_ATK_NAME_WITH_PREFIX} is storing\nenergy!");
static const u8 sText_PkmnUnleashedEnergy[] = _("{B_ATK_NAME_WITH_PREFIX} unleashed\nenergy!"); static const u8 sText_PkmnUnleashedEnergy[] = _("{B_ATK_NAME_WITH_PREFIX} unleashed\nenergy!");
static const u8 sText_PkmnFatigueConfusion[] = _("{B_ATK_NAME_WITH_PREFIX} became\nconfused due to fatigue!"); static const u8 sText_PkmnFatigueConfusion[] = _("{B_ATK_NAME_WITH_PREFIX} became\nconfused due to fatigue!");
static const u8 sText_PkmnPickedUpItem[] = _("{B_PLAYER_NAME} picked up\n¥{B_BUFF1}!\p"); static const u8 sText_PlayerPickedUpMoney[] = _("{B_PLAYER_NAME} picked up\n¥{B_BUFF1}!\p");
static const u8 sText_PkmnUnaffected[] = _("{B_DEF_NAME_WITH_PREFIX} is\nunaffected!"); static const u8 sText_PkmnUnaffected[] = _("{B_DEF_NAME_WITH_PREFIX} is\nunaffected!");
static const u8 sText_PkmnTransformedInto[] = _("{B_ATK_NAME_WITH_PREFIX} transformed\ninto {B_BUFF1}!"); static const u8 sText_PkmnTransformedInto[] = _("{B_ATK_NAME_WITH_PREFIX} transformed\ninto {B_BUFF1}!");
static const u8 sText_PkmnMadeSubstitute[] = _("{B_ATK_NAME_WITH_PREFIX} made\na SUBSTITUTE!"); static const u8 sText_PkmnMadeSubstitute[] = _("{B_ATK_NAME_WITH_PREFIX} made\na SUBSTITUTE!");
@ -340,9 +340,9 @@ static const u8 sText_ButItFailed[] = _("But it failed!");
static const u8 sText_ItHurtConfusion[] = _("It hurt itself in its\nconfusion!"); static const u8 sText_ItHurtConfusion[] = _("It hurt itself in its\nconfusion!");
static const u8 sText_MirrorMoveFailed[] = _("The MIRROR MOVE failed!"); static const u8 sText_MirrorMoveFailed[] = _("The MIRROR MOVE failed!");
static const u8 sText_StartedToRain[] = _("It started to rain!"); static const u8 sText_StartedToRain[] = _("It started to rain!");
static const u8 sText_DownpourStarted[] = _("A downpour started!"); static const u8 sText_DownpourStarted[] = _("A downpour started!"); // corresponds to DownpourText in pokegold and pokecrystal and is used by Rain Dance in GSC
static const u8 sText_RainContinues[] = _("Rain continues to fall."); static const u8 sText_RainContinues[] = _("Rain continues to fall.");
static const u8 sText_DownpourContinues[] = _("The downpour continues."); static const u8 sText_DownpourContinues[] = _("The downpour continues."); // unused
static const u8 sText_RainStopped[] = _("The rain stopped."); static const u8 sText_RainStopped[] = _("The rain stopped.");
static const u8 sText_SandstormBrewed[] = _("A sandstorm brewed!"); static const u8 sText_SandstormBrewed[] = _("A sandstorm brewed!");
static const u8 sText_SandstormRages[] = _("The sandstorm rages."); static const u8 sText_SandstormRages[] = _("The sandstorm rages.");
@ -632,7 +632,7 @@ const u8 * const gBattleStringsTable[BATTLESTRINGS_COUNT] =
[STRINGID_PKMNSTORINGENERGY - 12] = sText_PkmnStoringEnergy, [STRINGID_PKMNSTORINGENERGY - 12] = sText_PkmnStoringEnergy,
[STRINGID_PKMNUNLEASHEDENERGY - 12] = sText_PkmnUnleashedEnergy, [STRINGID_PKMNUNLEASHEDENERGY - 12] = sText_PkmnUnleashedEnergy,
[STRINGID_PKMNFATIGUECONFUSION - 12] = sText_PkmnFatigueConfusion, [STRINGID_PKMNFATIGUECONFUSION - 12] = sText_PkmnFatigueConfusion,
[STRINGID_PKMNPICKEDUPITEM - 12] = sText_PkmnPickedUpItem, [STRINGID_PLAYERPICKEDUPMONEY - 12] = sText_PlayerPickedUpMoney,
[STRINGID_PKMNUNAFFECTED - 12] = sText_PkmnUnaffected, [STRINGID_PKMNUNAFFECTED - 12] = sText_PkmnUnaffected,
[STRINGID_PKMNTRANSFORMEDINTO - 12] = sText_PkmnTransformedInto, [STRINGID_PKMNTRANSFORMEDINTO - 12] = sText_PkmnTransformedInto,
[STRINGID_PKMNMADESUBSTITUTE - 12] = sText_PkmnMadeSubstitute, [STRINGID_PKMNMADESUBSTITUTE - 12] = sText_PkmnMadeSubstitute,
@ -2009,9 +2009,9 @@ void BufferStringBattle(u16 stringID)
case STRINGID_INTROMSG: // first battle msg case STRINGID_INTROMSG: // first battle msg
if (gBattleTypeFlags & BATTLE_TYPE_TRAINER) if (gBattleTypeFlags & BATTLE_TYPE_TRAINER)
{ {
if (gBattleTypeFlags & (BATTLE_TYPE_LINK | BATTLE_TYPE_x2000000)) if (gBattleTypeFlags & (BATTLE_TYPE_LINK | BATTLE_TYPE_RECORDED_LINK))
{ {
if (gBattleTypeFlags & BATTLE_TYPE_x800000) if (gBattleTypeFlags & BATTLE_TYPE_TOWER_LINK_MULTI)
{ {
stringPtr = sText_TwoTrainersWantToBattle; stringPtr = sText_TwoTrainersWantToBattle;
} }
@ -2079,18 +2079,18 @@ void BufferStringBattle(u16 stringID)
{ {
if (gBattleTypeFlags & BATTLE_TYPE_TWO_OPPONENTS) if (gBattleTypeFlags & BATTLE_TYPE_TWO_OPPONENTS)
stringPtr = sText_TwoTrainersSentPkmn; stringPtr = sText_TwoTrainersSentPkmn;
else if (gBattleTypeFlags & BATTLE_TYPE_x800000) else if (gBattleTypeFlags & BATTLE_TYPE_TOWER_LINK_MULTI)
stringPtr = sText_TwoTrainersSentPkmn; stringPtr = sText_TwoTrainersSentPkmn;
else if (gBattleTypeFlags & BATTLE_TYPE_MULTI) else if (gBattleTypeFlags & BATTLE_TYPE_MULTI)
stringPtr = sText_TwoLinkTrainersSentOutPkmn; stringPtr = sText_TwoLinkTrainersSentOutPkmn;
else if (gBattleTypeFlags & (BATTLE_TYPE_LINK | BATTLE_TYPE_x2000000)) else if (gBattleTypeFlags & (BATTLE_TYPE_LINK | BATTLE_TYPE_RECORDED_LINK))
stringPtr = sText_LinkTrainerSentOutTwoPkmn; stringPtr = sText_LinkTrainerSentOutTwoPkmn;
else else
stringPtr = sText_Trainer1SentOutTwoPkmn; stringPtr = sText_Trainer1SentOutTwoPkmn;
} }
else else
{ {
if (!(gBattleTypeFlags & (BATTLE_TYPE_LINK | BATTLE_TYPE_x2000000))) if (!(gBattleTypeFlags & (BATTLE_TYPE_LINK | BATTLE_TYPE_RECORDED_LINK)))
stringPtr = sText_Trainer1SentOutPkmn; stringPtr = sText_Trainer1SentOutPkmn;
else if (gTrainerBattleOpponent_A == TRAINER_UNION_ROOM) else if (gTrainerBattleOpponent_A == TRAINER_UNION_ROOM)
stringPtr = sText_Trainer1SentOutPkmn; stringPtr = sText_Trainer1SentOutPkmn;
@ -2113,7 +2113,7 @@ void BufferStringBattle(u16 stringID)
} }
else else
{ {
if (gTrainerBattleOpponent_A == TRAINER_LINK_OPPONENT || gBattleTypeFlags & BATTLE_TYPE_x2000000) if (gTrainerBattleOpponent_A == TRAINER_LINK_OPPONENT || gBattleTypeFlags & BATTLE_TYPE_RECORDED_LINK)
{ {
if (gBattleTypeFlags & BATTLE_TYPE_MULTI) if (gBattleTypeFlags & BATTLE_TYPE_MULTI)
stringPtr = sText_LinkTrainer2WithdrewPkmn; stringPtr = sText_LinkTrainer2WithdrewPkmn;
@ -2140,9 +2140,9 @@ void BufferStringBattle(u16 stringID)
} }
else else
{ {
if (gBattleTypeFlags & (BATTLE_TYPE_LINK | BATTLE_TYPE_x2000000)) if (gBattleTypeFlags & (BATTLE_TYPE_LINK | BATTLE_TYPE_RECORDED_LINK))
{ {
if (gBattleTypeFlags & BATTLE_TYPE_x800000) if (gBattleTypeFlags & BATTLE_TYPE_TOWER_LINK_MULTI)
{ {
if (gBattleScripting.battler == 1) if (gBattleScripting.battler == 1)
stringPtr = sText_Trainer1SentOutPkmn2; stringPtr = sText_Trainer1SentOutPkmn2;
@ -2210,7 +2210,7 @@ void BufferStringBattle(u16 stringID)
switch (gBattleTextBuff1[0]) switch (gBattleTextBuff1[0])
{ {
case B_OUTCOME_WON: case B_OUTCOME_WON:
if (gBattleTypeFlags & BATTLE_TYPE_x800000) if (gBattleTypeFlags & BATTLE_TYPE_TOWER_LINK_MULTI)
stringPtr = sText_TwoInGameTrainersDefeated; stringPtr = sText_TwoInGameTrainersDefeated;
else else
stringPtr = sText_TwoLinkTrainersDefeated; stringPtr = sText_TwoLinkTrainersDefeated;
@ -2336,8 +2336,8 @@ u32 BattleStringExpandPlaceholders(const u8 *src, u8 *dst)
u8 multiplayerId; u8 multiplayerId;
s32 i; s32 i;
if (gBattleTypeFlags & BATTLE_TYPE_x2000000) if (gBattleTypeFlags & BATTLE_TYPE_RECORDED_LINK)
multiplayerId = gUnknown_0203C7B4; multiplayerId = gRecordedBattleMultiplayerId;
else else
multiplayerId = GetMultiplayerId(); multiplayerId = GetMultiplayerId();
@ -2477,7 +2477,7 @@ u32 BattleStringExpandPlaceholders(const u8 *src, u8 *dst)
toCpy = gMoveNames[gBattleMsgDataPtr->originallyUsedMove]; toCpy = gMoveNames[gBattleMsgDataPtr->originallyUsedMove];
break; break;
case B_TXT_LAST_ITEM: // last used item case B_TXT_LAST_ITEM: // last used item
if (gBattleTypeFlags & (BATTLE_TYPE_LINK | BATTLE_TYPE_x2000000)) if (gBattleTypeFlags & (BATTLE_TYPE_LINK | BATTLE_TYPE_RECORDED_LINK))
{ {
if (gLastUsedItem == ITEM_ENIGMA_BERRY) if (gLastUsedItem == ITEM_ENIGMA_BERRY)
{ {
@ -2858,7 +2858,7 @@ static void ExpandBattleTextBuffPlaceholders(const u8 *src, u8 *dst)
break; break;
case B_BUFF_ITEM: // item name case B_BUFF_ITEM: // item name
hword = T1_READ_16(&src[srcID + 1]); hword = T1_READ_16(&src[srcID + 1]);
if (gBattleTypeFlags & (BATTLE_TYPE_LINK | BATTLE_TYPE_x2000000)) if (gBattleTypeFlags & (BATTLE_TYPE_LINK | BATTLE_TYPE_RECORDED_LINK))
{ {
if (hword == ITEM_ENIGMA_BERRY) if (hword == ITEM_ENIGMA_BERRY)
{ {
@ -3018,7 +3018,7 @@ void BattlePutTextOnWindow(const u8 *text, u8 windowId)
if (windowId == 0 || windowId == 0x16) if (windowId == 0 || windowId == 0x16)
{ {
if (gBattleTypeFlags & (BATTLE_TYPE_LINK | BATTLE_TYPE_x2000000)) if (gBattleTypeFlags & (BATTLE_TYPE_LINK | BATTLE_TYPE_RECORDED_LINK))
speed = 1; speed = 1;
else if (gBattleTypeFlags & BATTLE_TYPE_RECORDED) else if (gBattleTypeFlags & BATTLE_TYPE_RECORDED)
speed = sRecordedBattleTextSpeeds[GetTextSpeedInRecordedBattle()]; speed = sRecordedBattleTextSpeeds[GetTextSpeedInRecordedBattle()];

View File

@ -2713,7 +2713,7 @@ void SetMoveEffect(bool8 primary, u8 certain)
(BATTLE_TYPE_EREADER_TRAINER (BATTLE_TYPE_EREADER_TRAINER
| BATTLE_TYPE_FRONTIER | BATTLE_TYPE_FRONTIER
| BATTLE_TYPE_LINK | BATTLE_TYPE_LINK
| BATTLE_TYPE_x2000000 | BATTLE_TYPE_RECORDED_LINK
| BATTLE_TYPE_SECRET_BASE))) | BATTLE_TYPE_SECRET_BASE)))
{ {
gBattlescriptCurrInstr++; gBattlescriptCurrInstr++;
@ -2722,7 +2722,7 @@ void SetMoveEffect(bool8 primary, u8 certain)
(BATTLE_TYPE_EREADER_TRAINER (BATTLE_TYPE_EREADER_TRAINER
| BATTLE_TYPE_FRONTIER | BATTLE_TYPE_FRONTIER
| BATTLE_TYPE_LINK | BATTLE_TYPE_LINK
| BATTLE_TYPE_x2000000 | BATTLE_TYPE_RECORDED_LINK
| BATTLE_TYPE_SECRET_BASE)) | BATTLE_TYPE_SECRET_BASE))
&& (gWishFutureKnock.knockedOffMons[side] & gBitTable[gBattlerPartyIndexes[gBattlerAttacker]])) && (gWishFutureKnock.knockedOffMons[side] & gBitTable[gBattlerPartyIndexes[gBattlerAttacker]]))
{ {
@ -3228,7 +3228,7 @@ static void Cmd_getexp(void)
case 0: // check if should receive exp at all case 0: // check if should receive exp at all
if (GetBattlerSide(gBattlerFainted) != B_SIDE_OPPONENT || (gBattleTypeFlags & if (GetBattlerSide(gBattlerFainted) != B_SIDE_OPPONENT || (gBattleTypeFlags &
(BATTLE_TYPE_LINK (BATTLE_TYPE_LINK
| BATTLE_TYPE_x2000000 | BATTLE_TYPE_RECORDED_LINK
| BATTLE_TYPE_TRAINER_HILL | BATTLE_TYPE_TRAINER_HILL
| BATTLE_TYPE_FRONTIER | BATTLE_TYPE_FRONTIER
| BATTLE_TYPE_SAFARI | BATTLE_TYPE_SAFARI
@ -3533,7 +3533,7 @@ static void Cmd_unknown_24(void)
if (HP_count == 0) if (HP_count == 0)
gBattleOutcome |= B_OUTCOME_WON; gBattleOutcome |= B_OUTCOME_WON;
if (gBattleOutcome == 0 && (gBattleTypeFlags & (BATTLE_TYPE_LINK | BATTLE_TYPE_x2000000))) if (gBattleOutcome == 0 && (gBattleTypeFlags & (BATTLE_TYPE_LINK | BATTLE_TYPE_RECORDED_LINK)))
{ {
s32 foundPlayer = 0; s32 foundPlayer = 0;
s32 foundOpponent; s32 foundOpponent;
@ -4634,7 +4634,7 @@ static void Cmd_switchinanim(void)
if (GetBattlerSide(gActiveBattler) == B_SIDE_OPPONENT if (GetBattlerSide(gActiveBattler) == B_SIDE_OPPONENT
&& !(gBattleTypeFlags & (BATTLE_TYPE_LINK && !(gBattleTypeFlags & (BATTLE_TYPE_LINK
| BATTLE_TYPE_EREADER_TRAINER | BATTLE_TYPE_EREADER_TRAINER
| BATTLE_TYPE_x2000000 | BATTLE_TYPE_RECORDED_LINK
| BATTLE_TYPE_TRAINER_HILL | BATTLE_TYPE_TRAINER_HILL
| BATTLE_TYPE_FRONTIER))) | BATTLE_TYPE_FRONTIER)))
HandleSetPokedexFlag(SpeciesToNationalPokedexNum(gBattleMons[gActiveBattler].species), FLAG_SET_SEEN, gBattleMons[gActiveBattler].personality); HandleSetPokedexFlag(SpeciesToNationalPokedexNum(gBattleMons[gActiveBattler].species), FLAG_SET_SEEN, gBattleMons[gActiveBattler].personality);
@ -4691,7 +4691,7 @@ static void Cmd_jumpifcantswitch(void)
} }
else if (gBattleTypeFlags & BATTLE_TYPE_MULTI) else if (gBattleTypeFlags & BATTLE_TYPE_MULTI)
{ {
if (gBattleTypeFlags & BATTLE_TYPE_x800000) if (gBattleTypeFlags & BATTLE_TYPE_TOWER_LINK_MULTI)
{ {
if (GetBattlerSide(gActiveBattler) == B_SIDE_PLAYER) if (GetBattlerSide(gActiveBattler) == B_SIDE_PLAYER)
{ {
@ -7137,7 +7137,7 @@ static void Cmd_forcerandomswitch(void)
party = gEnemyParty; party = gEnemyParty;
if ((gBattleTypeFlags & BATTLE_TYPE_BATTLE_TOWER && gBattleTypeFlags & BATTLE_TYPE_LINK) if ((gBattleTypeFlags & BATTLE_TYPE_BATTLE_TOWER && gBattleTypeFlags & BATTLE_TYPE_LINK)
|| (gBattleTypeFlags & BATTLE_TYPE_BATTLE_TOWER && gBattleTypeFlags & BATTLE_TYPE_x2000000) || (gBattleTypeFlags & BATTLE_TYPE_BATTLE_TOWER && gBattleTypeFlags & BATTLE_TYPE_RECORDED_LINK)
|| (gBattleTypeFlags & BATTLE_TYPE_INGAME_PARTNER)) || (gBattleTypeFlags & BATTLE_TYPE_INGAME_PARTNER))
{ {
if ((gBattlerTarget & BIT_FLANK) != 0) if ((gBattlerTarget & BIT_FLANK) != 0)
@ -7156,7 +7156,7 @@ static void Cmd_forcerandomswitch(void)
battler1PartyId = gBattlerPartyIndexes[gBattlerTarget ^ BIT_FLANK]; battler1PartyId = gBattlerPartyIndexes[gBattlerTarget ^ BIT_FLANK];
} }
else if ((gBattleTypeFlags & BATTLE_TYPE_MULTI && gBattleTypeFlags & BATTLE_TYPE_LINK) else if ((gBattleTypeFlags & BATTLE_TYPE_MULTI && gBattleTypeFlags & BATTLE_TYPE_LINK)
|| (gBattleTypeFlags & BATTLE_TYPE_MULTI && gBattleTypeFlags & BATTLE_TYPE_x2000000)) || (gBattleTypeFlags & BATTLE_TYPE_MULTI && gBattleTypeFlags & BATTLE_TYPE_RECORDED_LINK))
{ {
if (GetLinkTrainerFlankId(GetBattlerMultiplayerId(gBattlerTarget)) == 1) if (GetLinkTrainerFlankId(GetBattlerMultiplayerId(gBattlerTarget)) == 1)
{ {
@ -7256,8 +7256,8 @@ static void Cmd_forcerandomswitch(void)
if ((gBattleTypeFlags & BATTLE_TYPE_LINK && gBattleTypeFlags & BATTLE_TYPE_BATTLE_TOWER) if ((gBattleTypeFlags & BATTLE_TYPE_LINK && gBattleTypeFlags & BATTLE_TYPE_BATTLE_TOWER)
|| (gBattleTypeFlags & BATTLE_TYPE_LINK && gBattleTypeFlags & BATTLE_TYPE_MULTI) || (gBattleTypeFlags & BATTLE_TYPE_LINK && gBattleTypeFlags & BATTLE_TYPE_MULTI)
|| (gBattleTypeFlags & BATTLE_TYPE_x2000000 && gBattleTypeFlags & BATTLE_TYPE_BATTLE_TOWER) || (gBattleTypeFlags & BATTLE_TYPE_RECORDED_LINK && gBattleTypeFlags & BATTLE_TYPE_BATTLE_TOWER)
|| (gBattleTypeFlags & BATTLE_TYPE_x2000000 && gBattleTypeFlags & BATTLE_TYPE_MULTI)) || (gBattleTypeFlags & BATTLE_TYPE_RECORDED_LINK && gBattleTypeFlags & BATTLE_TYPE_MULTI))
{ {
SwitchPartyOrderLinkMulti(gBattlerTarget, i, 0); SwitchPartyOrderLinkMulti(gBattlerTarget, i, 0);
SwitchPartyOrderLinkMulti(gBattlerTarget ^ BIT_FLANK, i, 1); SwitchPartyOrderLinkMulti(gBattlerTarget ^ BIT_FLANK, i, 1);
@ -7337,7 +7337,7 @@ static void Cmd_tryconversiontypechange(void) // randomly changes user's type to
static void Cmd_givepaydaymoney(void) static void Cmd_givepaydaymoney(void)
{ {
if (!(gBattleTypeFlags & (BATTLE_TYPE_LINK | BATTLE_TYPE_x2000000)) && gPaydayMoney != 0) if (!(gBattleTypeFlags & (BATTLE_TYPE_LINK | BATTLE_TYPE_RECORDED_LINK)) && gPaydayMoney != 0)
{ {
u32 bonusMoney = gPaydayMoney * gBattleStruct->moneyMultiplier; u32 bonusMoney = gPaydayMoney * gBattleStruct->moneyMultiplier;
AddMoney(&gSaveBlock1Ptr->money, bonusMoney); AddMoney(&gSaveBlock1Ptr->money, bonusMoney);
@ -9044,7 +9044,7 @@ static void Cmd_tryswapitems(void) // trick
| BATTLE_TYPE_EREADER_TRAINER | BATTLE_TYPE_EREADER_TRAINER
| BATTLE_TYPE_FRONTIER | BATTLE_TYPE_FRONTIER
| BATTLE_TYPE_SECRET_BASE | BATTLE_TYPE_SECRET_BASE
| BATTLE_TYPE_x2000000)))) | BATTLE_TYPE_RECORDED_LINK))))
{ {
gBattlescriptCurrInstr = T1_READ_PTR(gBattlescriptCurrInstr + 1); gBattlescriptCurrInstr = T1_READ_PTR(gBattlescriptCurrInstr + 1);
} }
@ -9058,7 +9058,7 @@ static void Cmd_tryswapitems(void) // trick
| BATTLE_TYPE_EREADER_TRAINER | BATTLE_TYPE_EREADER_TRAINER
| BATTLE_TYPE_FRONTIER | BATTLE_TYPE_FRONTIER
| BATTLE_TYPE_SECRET_BASE | BATTLE_TYPE_SECRET_BASE
| BATTLE_TYPE_x2000000)) | BATTLE_TYPE_RECORDED_LINK))
&& (gWishFutureKnock.knockedOffMons[sideAttacker] & gBitTable[gBattlerPartyIndexes[gBattlerAttacker]] && (gWishFutureKnock.knockedOffMons[sideAttacker] & gBitTable[gBattlerPartyIndexes[gBattlerAttacker]]
|| gWishFutureKnock.knockedOffMons[sideTarget] & gBitTable[gBattlerPartyIndexes[gBattlerTarget]])) || gWishFutureKnock.knockedOffMons[sideTarget] & gBitTable[gBattlerPartyIndexes[gBattlerTarget]]))
{ {

View File

@ -607,7 +607,7 @@ static void CB2_EndWildBattle(void)
else else
{ {
SetMainCallback2(CB2_ReturnToField); SetMainCallback2(CB2_ReturnToField);
gFieldCallback = sub_80AF6F0; gFieldCallback = FieldCB_ReturnToFieldNoScriptCheckMusic;
} }
} }

View File

@ -775,7 +775,7 @@ struct
{ {
{ {
.species = SPECIES_METANG, .species = SPECIES_METANG,
.fixedIV = 31, .fixedIV = MAX_PER_STAT_IVS,
.level = 42, .level = 42,
.nature = NATURE_BRAVE, .nature = NATURE_BRAVE,
.evs = {0, 252, 252, 0, 6, 0}, .evs = {0, 252, 252, 0, 6, 0},
@ -783,7 +783,7 @@ struct
}, },
{ {
.species = SPECIES_SKARMORY, .species = SPECIES_SKARMORY,
.fixedIV = 31, .fixedIV = MAX_PER_STAT_IVS,
.level = 43, .level = 43,
.nature = NATURE_IMPISH, .nature = NATURE_IMPISH,
.evs = {252, 0, 0, 0, 6, 252}, .evs = {252, 0, 0, 0, 6, 252},
@ -791,7 +791,7 @@ struct
}, },
{ {
.species = SPECIES_AGGRON, .species = SPECIES_AGGRON,
.fixedIV = 31, .fixedIV = MAX_PER_STAT_IVS,
.level = 44, .level = 44,
.nature = NATURE_ADAMANT, .nature = NATURE_ADAMANT,
.evs = {0, 252, 0, 0, 252, 6}, .evs = {0, 252, 0, 0, 252, 6},
@ -1854,7 +1854,7 @@ static void FillFactoryFrontierTrainerParty(u16 trainerId, u8 firstMonId)
} }
else else
{ {
fixedIV = 31; fixedIV = MAX_PER_STAT_IVS;
} }
level = SetFacilityPtrsGetLevel(); level = SetFacilityPtrsGetLevel();
@ -2024,7 +2024,7 @@ void DoSpecialTrainerBattle(void)
gBattleTypeFlags |= BATTLE_TYPE_DOUBLE | BATTLE_TYPE_INGAME_PARTNER | BATTLE_TYPE_MULTI | BATTLE_TYPE_TWO_OPPONENTS; gBattleTypeFlags |= BATTLE_TYPE_DOUBLE | BATTLE_TYPE_INGAME_PARTNER | BATTLE_TYPE_MULTI | BATTLE_TYPE_TWO_OPPONENTS;
break; break;
case FRONTIER_MODE_LINK_MULTIS: case FRONTIER_MODE_LINK_MULTIS:
gBattleTypeFlags |= BATTLE_TYPE_DOUBLE | BATTLE_TYPE_LINK | BATTLE_TYPE_MULTI | BATTLE_TYPE_x800000; gBattleTypeFlags |= BATTLE_TYPE_DOUBLE | BATTLE_TYPE_LINK | BATTLE_TYPE_MULTI | BATTLE_TYPE_TOWER_LINK_MULTI;
FillFrontierTrainersParties(FRONTIER_MULTI_PARTY_SIZE); FillFrontierTrainersParties(FRONTIER_MULTI_PARTY_SIZE);
break; break;
} }
@ -3295,7 +3295,7 @@ static u8 GetFrontierTrainerFixedIvs(u16 trainerId)
else if (trainerId <= FRONTIER_TRAINER_TESS) // 200 - 219 else if (trainerId <= FRONTIER_TRAINER_TESS) // 200 - 219
fixedIv = 21; fixedIv = 21;
else // 220+ (- 299) else // 220+ (- 299)
fixedIv = 31; fixedIv = MAX_PER_STAT_IVS;
return fixedIv; return fixedIv;
} }
@ -3521,7 +3521,7 @@ bool32 ValidateBattleTowerRecord(u8 recordId) // unused
void TrySetLinkBattleTowerEnemyPartyLevel(void) void TrySetLinkBattleTowerEnemyPartyLevel(void)
{ {
if (gBattleTypeFlags & (BATTLE_TYPE_LINK | BATTLE_TYPE_x2000000)) if (gBattleTypeFlags & (BATTLE_TYPE_LINK | BATTLE_TYPE_RECORDED_LINK))
{ {
s32 i; s32 i;
u8 enemyLevel = SetFacilityPtrsGetLevel(); u8 enemyLevel = SetFacilityPtrsGetLevel();

File diff suppressed because it is too large Load Diff

View File

@ -452,7 +452,7 @@ void HandleAction_Run(void)
{ {
gBattlerAttacker = gBattlerByTurnOrder[gCurrentTurnActionNumber]; gBattlerAttacker = gBattlerByTurnOrder[gCurrentTurnActionNumber];
if (gBattleTypeFlags & (BATTLE_TYPE_LINK | BATTLE_TYPE_x2000000)) if (gBattleTypeFlags & (BATTLE_TYPE_LINK | BATTLE_TYPE_RECORDED_LINK))
{ {
gCurrentTurnActionNumber = gBattlersCount; gCurrentTurnActionNumber = gBattlersCount;
@ -2245,7 +2245,7 @@ bool8 HasNoMonsToSwitch(u8 battler, u8 partyIdBattlerOn1, u8 partyIdBattlerOn2)
} }
else if (gBattleTypeFlags & BATTLE_TYPE_MULTI) else if (gBattleTypeFlags & BATTLE_TYPE_MULTI)
{ {
if (gBattleTypeFlags & BATTLE_TYPE_x800000) if (gBattleTypeFlags & BATTLE_TYPE_TOWER_LINK_MULTI)
{ {
if (GetBattlerSide(battler) == B_SIDE_PLAYER) if (GetBattlerSide(battler) == B_SIDE_PLAYER)
{ {
@ -3966,7 +3966,7 @@ u8 IsMonDisobedient(void)
s32 calc; s32 calc;
u8 obedienceLevel = 0; u8 obedienceLevel = 0;
if (gBattleTypeFlags & (BATTLE_TYPE_LINK | BATTLE_TYPE_x2000000)) if (gBattleTypeFlags & (BATTLE_TYPE_LINK | BATTLE_TYPE_RECORDED_LINK))
return 0; return 0;
if (GetBattlerSide(gBattlerAttacker) == B_SIDE_OPPONENT) if (GetBattlerSide(gBattlerAttacker) == B_SIDE_OPPONENT)
return 0; return 0;

View File

@ -2390,7 +2390,7 @@ static s16 Debug_GetGameTimeStage(void)
static void CalculatePokeblock(struct BlenderBerry *berries, struct Pokeblock *pokeblock, u8 numPlayers, u8 *flavors, u16 maxRPM) static void CalculatePokeblock(struct BlenderBerry *berries, struct Pokeblock *pokeblock, u8 numPlayers, u8 *flavors, u16 maxRPM)
{ {
s32 i, j; s32 i, j;
s32 multiuseVar, var2; s32 multiuseVar;
u8 numNegatives; u8 numNegatives;
for (i = 0; i < FLAVOR_COUNT + 1; i++) for (i = 0; i < FLAVOR_COUNT + 1; i++)

View File

@ -877,7 +877,7 @@ void StartBerryCrush(MainCallback callback)
static void GetBerryFromBag(void) static void GetBerryFromBag(void)
{ {
if (gSpecialVar_ItemId < FIRST_BERRY_INDEX || gSpecialVar_ItemId > LAST_BERRY_INDEX + 1) if (gSpecialVar_ItemId < FIRST_BERRY_INDEX || gSpecialVar_ItemId > LAST_BERRY_INDEX + 1)
gSpecialVar_ItemId = ITEM_CHERI_BERRY; gSpecialVar_ItemId = FIRST_BERRY_INDEX;
else else
RemoveBagItem(gSpecialVar_ItemId, 1); RemoveBagItem(gSpecialVar_ItemId, 1);
@ -1573,7 +1573,6 @@ static void Task_ShowBerryCrushRankings(u8 taskId)
u8 i = 0, j, xPos, yPos; u8 i = 0, j, xPos, yPos;
u32 score = 0; u32 score = 0;
s16 *data = gTasks[taskId].data; s16 *data = gTasks[taskId].data;
u8 *str;
switch (data[0]) switch (data[0])
{ {
@ -1714,8 +1713,7 @@ void sub_8022588(struct BerryCrushGame *r5)
void sub_8022600(struct BerryCrushGame *r6) void sub_8022600(struct BerryCrushGame *r6)
{ {
u8 r7, r2; u8 r7;
u8 *r4;
for (r7 = 0; r7 < r6->unk9; ++r7) for (r7 = 0; r7 < r6->unk9; ++r7)
{ {

View File

@ -128,8 +128,6 @@ static void UpdateLinkPlayerCountDisplay(u8 taskId, u8 numPlayers)
static u32 ExchangeDataAndGetLinkupStatus(u8 minPlayers, u8 maxPlayers) static u32 ExchangeDataAndGetLinkupStatus(u8 minPlayers, u8 maxPlayers)
{ {
int playerCount;
switch (GetLinkPlayerDataExchangeStatusTimed(minPlayers, maxPlayers)) switch (GetLinkPlayerDataExchangeStatusTimed(minPlayers, maxPlayers))
{ {
case EXCHANGE_COMPLETE: case EXCHANGE_COMPLETE:
@ -511,7 +509,6 @@ static void FinishLinkup(u16 *linkupStatus, u32 taskId)
static void Task_LinkupAwaitTrainerCardData(u8 taskId) static void Task_LinkupAwaitTrainerCardData(u8 taskId)
{ {
u8 index; u8 index;
struct TrainerCard *trainerCards;
if (CheckLinkErrored(taskId) == TRUE) if (CheckLinkErrored(taskId) == TRUE)
return; return;
@ -993,7 +990,7 @@ static void CB2_ReturnFromUnionRoomBattle(void)
void CB2_ReturnFromCableClubBattle(void) void CB2_ReturnFromCableClubBattle(void)
{ {
gBattleTypeFlags &= ~BATTLE_TYPE_20; gBattleTypeFlags &= ~BATTLE_TYPE_LINK_IN_BATTLE;
Overworld_ResetMapMusic(); Overworld_ResetMapMusic();
LoadPlayerParty(); LoadPlayerParty();
SavePlayerBag(); SavePlayerBag();

View File

@ -4419,7 +4419,6 @@ static void CalculateAppealMoveImpact(u8 contestant)
u16 move; u16 move;
u8 effect; u8 effect;
u8 rnd; u8 rnd;
bool8 canUseTurn;
s32 i; s32 i;
eContestantStatus[contestant].appeal = 0; eContestantStatus[contestant].appeal = 0;

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