Merge branch 'master' into dodrio_berry_picking
This commit is contained in:
@@ -1,5 +1,6 @@
|
||||
#include "global.h"
|
||||
#include "battle.h"
|
||||
#include "battle_anim.h"
|
||||
#include "battle_ai_script_commands.h"
|
||||
#include "battle_factory.h"
|
||||
#include "battle_setup.h"
|
||||
|
||||
@@ -1,5 +1,6 @@
|
||||
#include "global.h"
|
||||
#include "battle.h"
|
||||
#include "battle_anim.h"
|
||||
#include "battle_controllers.h"
|
||||
#include "pokemon.h"
|
||||
#include "random.h"
|
||||
|
||||
File diff suppressed because it is too large
Load Diff
@@ -1093,7 +1093,7 @@ const struct SpriteTemplate gUnknown_085928D0 =
|
||||
.callback = sub_8100A50,
|
||||
};
|
||||
|
||||
const struct SpriteTemplate gUnknown_085928E8 =
|
||||
const struct SpriteTemplate gVineWhipSpriteTemplate =
|
||||
{
|
||||
.tileTag = ANIM_TAG_WHIP_HIT,
|
||||
.paletteTag = ANIM_TAG_WHIP_HIT,
|
||||
@@ -2336,7 +2336,7 @@ void AnimHyperBeamOrb(struct Sprite* sprite)
|
||||
{
|
||||
u16 speed;
|
||||
u16 animNum = Random2();
|
||||
|
||||
|
||||
StartSpriteAnim(sprite, animNum % 8);
|
||||
sprite->pos1.x = GetBattlerSpriteCoord(gBattleAnimAttacker, BATTLER_COORD_X_2);
|
||||
sprite->pos1.y = GetBattlerSpriteCoord(gBattleAnimAttacker, BATTLER_COORD_Y_PIC_OFFSET);
|
||||
@@ -2660,7 +2660,7 @@ static void AnimTranslateLinearSingleSineWaveStep(struct Sprite* sprite)
|
||||
s16 a = sprite->data[0];
|
||||
s16 b = sprite->data[7];
|
||||
s16 r0;
|
||||
|
||||
|
||||
sprite->data[0] = 1;
|
||||
TranslateAnimHorizontalArc(sprite);
|
||||
r0 = sprite->data[7];
|
||||
@@ -2675,7 +2675,7 @@ static void AnimTranslateLinearSingleSineWaveStep(struct Sprite* sprite)
|
||||
if (sprite->oam.affineParam == 30)
|
||||
destroy = TRUE;
|
||||
}
|
||||
|
||||
|
||||
if (sprite->pos1.x + sprite->pos2.x > 256
|
||||
|| sprite->pos1.x + sprite->pos2.x < -16
|
||||
|| sprite->pos1.y + sprite->pos2.y > 160
|
||||
@@ -3748,7 +3748,7 @@ void sub_81009F8(struct Sprite* sprite)
|
||||
|
||||
void sub_8100A50(struct Sprite* sprite)
|
||||
{
|
||||
if (GetBattlerSide(gBattleAnimAttacker) == 0)
|
||||
if (GetBattlerSide(gBattleAnimAttacker) == B_SIDE_PLAYER)
|
||||
StartSpriteAnim(sprite, 1);
|
||||
|
||||
sprite->callback = sub_81009DC;
|
||||
@@ -3770,7 +3770,7 @@ void sub_8100A94(struct Sprite* sprite)
|
||||
}
|
||||
|
||||
// Moves the sprite in a diagonally slashing motion across the target mon.
|
||||
// Used by moves such as MOVE_CUT and MOVE_AERIAL_ACE.
|
||||
// Used by moves such as MOVE_CUT and MOVE_AERIAL_ACE.
|
||||
// arg 0: initial x pixel offset
|
||||
// arg 1: initial y pixel offset
|
||||
// arg 2: slice direction; 0 = right-to-left, 1 = left-to-right
|
||||
@@ -5350,10 +5350,10 @@ static void sub_8102DE4(struct Sprite* sprite)
|
||||
|
||||
void sub_8102EB0(struct Sprite* sprite)
|
||||
{
|
||||
int a;
|
||||
int a;
|
||||
if (GetBattlerSide(gBattleAnimAttacker) == B_SIDE_OPPONENT)
|
||||
{
|
||||
a = gBattleAnimArgs[1];
|
||||
a = gBattleAnimArgs[1];
|
||||
(u16)gBattleAnimArgs[1] = -a;
|
||||
}
|
||||
|
||||
|
||||
@@ -889,7 +889,7 @@ const struct SpriteTemplate gUnknown_08593958 =
|
||||
.callback = sub_8105DE8,
|
||||
};
|
||||
|
||||
const struct SpriteTemplate gUnknown_08593970 =
|
||||
const struct SpriteTemplate gMagentaHeartSpriteTemplate =
|
||||
{
|
||||
.tileTag = ANIM_TAG_MAGENTA_HEART,
|
||||
.paletteTag = ANIM_TAG_MAGENTA_HEART,
|
||||
@@ -3286,7 +3286,7 @@ static void sub_810627C(struct Sprite *sprite)
|
||||
}
|
||||
}
|
||||
|
||||
void sub_81062E8(u8 taskId)
|
||||
void AnimTask_HeartsBackground(u8 taskId)
|
||||
{
|
||||
struct BattleAnimBgData animBg;
|
||||
|
||||
|
||||
+1
-1
@@ -709,7 +709,7 @@ void LoadBattleMenuWindowGfx(void)
|
||||
|
||||
if (gBattleTypeFlags & BATTLE_TYPE_ARENA)
|
||||
{
|
||||
sub_81978B0(0x70);
|
||||
Menu_LoadStdPalAt(0x70);
|
||||
LoadMessageBoxGfx(0, 0x30, 0x70);
|
||||
gPlttBufferUnfaded[0x76] = 0;
|
||||
CpuCopy16(&gPlttBufferUnfaded[0x76], &gPlttBufferFaded[0x76], 2);
|
||||
|
||||
+11
-12
@@ -1,5 +1,6 @@
|
||||
#include "global.h"
|
||||
#include "battle.h"
|
||||
#include "battle_anim.h"
|
||||
#include "battle_ai_script_commands.h"
|
||||
#include "battle_arena.h"
|
||||
#include "battle_controllers.h"
|
||||
@@ -292,35 +293,31 @@ static const u8 sText_ShedinjaJpnName[] = _("ヌケニン"); // Nukenin
|
||||
const struct OamData gOamData_831ACA8 =
|
||||
{
|
||||
.y = 0,
|
||||
.affineMode = 1,
|
||||
.objMode = 0,
|
||||
.mosaic = 0,
|
||||
.bpp = 0,
|
||||
.affineMode = ST_OAM_AFFINE_NORMAL,
|
||||
.objMode = ST_OAM_OBJ_NORMAL,
|
||||
.bpp = ST_OAM_4BPP,
|
||||
.shape = SPRITE_SHAPE(64x64),
|
||||
.x = 0,
|
||||
.matrixNum = 0,
|
||||
.size = SPRITE_SIZE(64x64),
|
||||
.tileNum = 0,
|
||||
.priority = 2,
|
||||
.paletteNum = 0,
|
||||
.affineParam = 0
|
||||
.affineParam = 0,
|
||||
};
|
||||
|
||||
const struct OamData gOamData_831ACB0 =
|
||||
{
|
||||
.y = 0,
|
||||
.affineMode = 1,
|
||||
.objMode = 0,
|
||||
.mosaic = 0,
|
||||
.bpp = 0,
|
||||
.affineMode = ST_OAM_AFFINE_NORMAL,
|
||||
.objMode = ST_OAM_OBJ_NORMAL,
|
||||
.bpp = ST_OAM_4BPP,
|
||||
.shape = SPRITE_SHAPE(64x64),
|
||||
.x = 0,
|
||||
.matrixNum = 0,
|
||||
.size = SPRITE_SIZE(64x64),
|
||||
.tileNum = 0,
|
||||
.priority = 2,
|
||||
.paletteNum = 2,
|
||||
.affineParam = 0
|
||||
.affineParam = 0,
|
||||
};
|
||||
|
||||
// Unknown and unused data. Feel free to remove.
|
||||
@@ -5890,3 +5887,5 @@ static void HandleAction_ActionFinished(void)
|
||||
gBattleScripting.multihitMoveEffect = 0;
|
||||
gBattleResources->battleScriptsStack->size = 0;
|
||||
}
|
||||
|
||||
|
||||
|
||||
@@ -1,5 +1,6 @@
|
||||
#include "global.h"
|
||||
#include "battle.h"
|
||||
#include "battle_anim.h"
|
||||
#include "battle_controllers.h"
|
||||
#include "battle_message.h"
|
||||
#include "battle_setup.h"
|
||||
|
||||
@@ -296,7 +296,7 @@ static void atkDA_tryswapabilities(void);
|
||||
static void atkDB_tryimprison(void);
|
||||
static void atkDC_trysetgrudge(void);
|
||||
static void atkDD_weightdamagecalculation(void);
|
||||
static void atkDE_asistattackselect(void);
|
||||
static void atkDE_assistattackselect(void);
|
||||
static void atkDF_trysetmagiccoat(void);
|
||||
static void atkE0_trysetsnatch(void);
|
||||
static void atkE1_trygetintimidatetarget(void);
|
||||
@@ -548,7 +548,7 @@ void (* const gBattleScriptingCommandsTable[])(void) =
|
||||
atkDB_tryimprison,
|
||||
atkDC_trysetgrudge,
|
||||
atkDD_weightdamagecalculation,
|
||||
atkDE_asistattackselect,
|
||||
atkDE_assistattackselect,
|
||||
atkDF_trysetmagiccoat,
|
||||
atkE0_trysetsnatch,
|
||||
atkE1_trygetintimidatetarget,
|
||||
@@ -4480,28 +4480,6 @@ static void atk48_playstatchangeanimation(void)
|
||||
}
|
||||
}
|
||||
|
||||
enum
|
||||
{
|
||||
ATK49_RAGE,
|
||||
ATK49_DEFROST,
|
||||
ATK49_SYNCHRONIZE_TARGET,
|
||||
ATK49_MOVE_END_ABILITIES,
|
||||
ATK49_STATUS_IMMUNITY_ABILITIES,
|
||||
ATK49_SYNCHRONIZE_ATTACKER,
|
||||
ATK49_CHOICE_MOVE,
|
||||
ATK49_CHANGED_ITEMS,
|
||||
ATK49_ATTACKER_INVISIBLE,
|
||||
ATK49_ATTACKER_VISIBLE,
|
||||
ATK49_TARGET_VISIBLE,
|
||||
ATK49_ITEM_EFFECTS_ALL,
|
||||
ATK49_KINGSROCK_SHELLBELL,
|
||||
ATK49_SUBSTITUTE,
|
||||
ATK49_UPDATE_LAST_MOVES,
|
||||
ATK49_MIRROR_MOVE,
|
||||
ATK49_NEXT_TARGET,
|
||||
ATK49_COUNT,
|
||||
};
|
||||
|
||||
static void atk49_moveend(void)
|
||||
{
|
||||
s32 i;
|
||||
@@ -6317,16 +6295,16 @@ static void sub_804F100(void)
|
||||
{
|
||||
struct StatsArray currentStats;
|
||||
|
||||
GetMonLevelUpWindowStats(&gPlayerParty[gBattleStruct->expGetterMonId], ¤tStats);
|
||||
DrawLevelUpWindowPg1(0xD, gBattleResources->statsBeforeLvlUp, ¤tStats, 0xE, 0xD, 0xF);
|
||||
GetMonLevelUpWindowStats(&gPlayerParty[gBattleStruct->expGetterMonId], (u16*) ¤tStats);
|
||||
DrawLevelUpWindowPg1(0xD, (u16*) gBattleResources->statsBeforeLvlUp,(u16*) ¤tStats, 0xE, 0xD, 0xF);
|
||||
}
|
||||
|
||||
static void sub_804F144(void)
|
||||
{
|
||||
struct StatsArray currentStats;
|
||||
|
||||
GetMonLevelUpWindowStats(&gPlayerParty[gBattleStruct->expGetterMonId], ¤tStats);
|
||||
DrawLevelUpWindowPg2(0xD, ¤tStats, 0xE, 0xD, 0xF);
|
||||
GetMonLevelUpWindowStats(&gPlayerParty[gBattleStruct->expGetterMonId], (u16*) ¤tStats);
|
||||
DrawLevelUpWindowPg2(0xD, (u16*) ¤tStats, 0xE, 0xD, 0xF);
|
||||
}
|
||||
|
||||
static void sub_804F17C(void)
|
||||
@@ -7210,6 +7188,9 @@ static void atk88_negativedamage(void)
|
||||
gBattlescriptCurrInstr++;
|
||||
}
|
||||
|
||||
#define STAT_CHANGE_WORKED 0
|
||||
#define STAT_CHANGE_DIDNT_WORK 1
|
||||
|
||||
static u8 ChangeStatBuffs(s8 statValue, u8 statId, u8 flags, const u8 *BS_ptr)
|
||||
{
|
||||
bool8 certain = FALSE;
|
||||
@@ -9679,7 +9660,7 @@ static void atkDD_weightdamagecalculation(void)
|
||||
gBattlescriptCurrInstr++;
|
||||
}
|
||||
|
||||
static void atkDE_asistattackselect(void)
|
||||
static void atkDE_assistattackselect(void)
|
||||
{
|
||||
s32 chooseableMovesNo = 0;
|
||||
struct Pokemon* party;
|
||||
|
||||
+80
-80
@@ -232,84 +232,84 @@ static const struct TrainerBattleParameter sTrainerBContinueScriptBattleParams[]
|
||||
|
||||
const struct RematchTrainer gRematchTable[REMATCH_TABLE_ENTRIES] =
|
||||
{
|
||||
{{TRAINER_ROSE_1, TRAINER_ROSE_2, TRAINER_ROSE_3, TRAINER_ROSE_4, TRAINER_ROSE_5}, 0x0, 0x21},
|
||||
{{TRAINER_ANDRES_1, TRAINER_ANDRES_2, TRAINER_ANDRES_3, TRAINER_ANDRES_4, TRAINER_ANDRES_5}, 0x0, 0x14},
|
||||
{{TRAINER_DUSTY_1, TRAINER_DUSTY_2, TRAINER_DUSTY_3, TRAINER_DUSTY_4, TRAINER_DUSTY_5}, 0x0, 0x1a},
|
||||
{{TRAINER_LOLA_1, TRAINER_LOLA_2, TRAINER_LOLA_3, TRAINER_LOLA_4, TRAINER_LOLA_5}, 0x0, 0x18},
|
||||
{{TRAINER_RICKY_1, TRAINER_RICKY_2, TRAINER_RICKY_3, TRAINER_RICKY_4, TRAINER_RICKY_5}, 0x0, 0x18},
|
||||
{{TRAINER_LILA_AND_ROY_1, TRAINER_LILA_AND_ROY_2, TRAINER_LILA_AND_ROY_3, TRAINER_LILA_AND_ROY_4, TRAINER_LILA_AND_ROY_5}, 0x0, 0x27},
|
||||
{{TRAINER_CRISTIN_1, TRAINER_CRISTIN_2, TRAINER_CRISTIN_3, TRAINER_CRISTIN_4, TRAINER_CRISTIN_5}, 0x0, 0x24},
|
||||
{{TRAINER_BROOKE_1, TRAINER_BROOKE_2, TRAINER_BROOKE_3, TRAINER_BROOKE_4, TRAINER_BROOKE_5}, 0x0, 0x1a},
|
||||
{{TRAINER_WILTON_1, TRAINER_WILTON_2, TRAINER_WILTON_3, TRAINER_WILTON_4, TRAINER_WILTON_5}, 0x0, 0x1a},
|
||||
{{TRAINER_VALERIE_1, TRAINER_VALERIE_2, TRAINER_VALERIE_3, TRAINER_VALERIE_4, TRAINER_VALERIE_5}, 0x18, 0x14},
|
||||
{{TRAINER_CINDY_1, TRAINER_CINDY_3, TRAINER_CINDY_4, TRAINER_CINDY_5, TRAINER_CINDY_6}, 0x0, 0x13},
|
||||
{{TRAINER_THALIA_1, TRAINER_THALIA_2, TRAINER_THALIA_3, TRAINER_THALIA_4, TRAINER_THALIA_5}, 0x18, 0x38},
|
||||
{{TRAINER_JESSICA_1, TRAINER_JESSICA_2, TRAINER_JESSICA_3, TRAINER_JESSICA_4, TRAINER_JESSICA_5}, 0x0, 0x24},
|
||||
{{TRAINER_WINSTON_1, TRAINER_WINSTON_2, TRAINER_WINSTON_3, TRAINER_WINSTON_4, TRAINER_WINSTON_5}, 0x0, 0x13},
|
||||
{{TRAINER_STEVE_1, TRAINER_STEVE_2, TRAINER_STEVE_3, TRAINER_STEVE_4, TRAINER_STEVE_5}, 0x0, 0x1d},
|
||||
{{TRAINER_TONY_1, TRAINER_TONY_2, TRAINER_TONY_3, TRAINER_TONY_4, TRAINER_TONY_5}, 0x0, 0x16},
|
||||
{{TRAINER_NOB_1, TRAINER_NOB_2, TRAINER_NOB_3, TRAINER_NOB_4, TRAINER_NOB_5}, 0x0, 0x1e},
|
||||
{{TRAINER_KOJI_1, TRAINER_KOJI_2, TRAINER_KOJI_3, TRAINER_KOJI_4, TRAINER_KOJI_5}, 0x0, 0x2a},
|
||||
{{TRAINER_FERNANDO_1, TRAINER_FERNANDO_2, TRAINER_FERNANDO_3, TRAINER_FERNANDO_4, TRAINER_FERNANDO_5}, 0x0, 0x26},
|
||||
{{TRAINER_DALTON_1, TRAINER_DALTON_2, TRAINER_DALTON_3, TRAINER_DALTON_4, TRAINER_DALTON_5}, 0x0, 0x21},
|
||||
{{TRAINER_BERNIE_1, TRAINER_BERNIE_2, TRAINER_BERNIE_3, TRAINER_BERNIE_4, TRAINER_BERNIE_5}, 0x0, 0x1d},
|
||||
{{TRAINER_ETHAN_1, TRAINER_ETHAN_2, TRAINER_ETHAN_3, TRAINER_ETHAN_4, TRAINER_ETHAN_5}, 0x18, 0xd},
|
||||
{{TRAINER_JOHN_AND_JAY_1, TRAINER_JOHN_AND_JAY_2, TRAINER_JOHN_AND_JAY_3, TRAINER_JOHN_AND_JAY_4, TRAINER_JOHN_AND_JAY_5}, 0x18, 0x1},
|
||||
{{TRAINER_JEFFREY_1, TRAINER_JEFFREY_2, TRAINER_JEFFREY_3, TRAINER_JEFFREY_4, TRAINER_JEFFREY_5}, 0x0, 0x23},
|
||||
{{TRAINER_CAMERON_1, TRAINER_CAMERON_2, TRAINER_CAMERON_3, TRAINER_CAMERON_4, TRAINER_CAMERON_5}, 0x0, 0x26},
|
||||
{{TRAINER_JACKI_1, TRAINER_JACKI_2, TRAINER_JACKI_3, TRAINER_JACKI_4, TRAINER_JACKI_5}, 0x0, 0x26},
|
||||
{{TRAINER_WALTER_1, TRAINER_WALTER_2, TRAINER_WALTER_3, TRAINER_WALTER_4, TRAINER_WALTER_5}, 0x0, 0x24},
|
||||
{{TRAINER_KAREN_1, TRAINER_KAREN_2, TRAINER_KAREN_3, TRAINER_KAREN_4, TRAINER_KAREN_5}, 0x0, 0x1f},
|
||||
{{TRAINER_JERRY_1, TRAINER_JERRY_2, TRAINER_JERRY_3, TRAINER_JERRY_4, TRAINER_JERRY_5}, 0x0, 0x1f},
|
||||
{{TRAINER_ANNA_AND_MEG_1, TRAINER_ANNA_AND_MEG_2, TRAINER_ANNA_AND_MEG_3, TRAINER_ANNA_AND_MEG_4, TRAINER_ANNA_AND_MEG_5}, 0x0, 0x20},
|
||||
{{TRAINER_ISABEL_1, TRAINER_ISABEL_2, TRAINER_ISABEL_3, TRAINER_ISABEL_4, TRAINER_ISABEL_5}, 0x0, 0x19},
|
||||
{{TRAINER_MIGUEL_1, TRAINER_MIGUEL_2, TRAINER_MIGUEL_3, TRAINER_MIGUEL_4, TRAINER_MIGUEL_5}, 0x0, 0x12},
|
||||
{{TRAINER_TIMOTHY_1, TRAINER_TIMOTHY_2, TRAINER_TIMOTHY_3, TRAINER_TIMOTHY_4, TRAINER_TIMOTHY_5}, 0x0, 0x1e},
|
||||
{{TRAINER_SHELBY_1, TRAINER_SHELBY_2, TRAINER_SHELBY_3, TRAINER_SHELBY_4, TRAINER_SHELBY_5}, 0x18, 0xc},
|
||||
{{TRAINER_CALVIN_1, TRAINER_CALVIN_2, TRAINER_CALVIN_3, TRAINER_CALVIN_4, TRAINER_CALVIN_5}, 0x0, 0x11},
|
||||
{{TRAINER_ELLIOT_1, TRAINER_ELLIOT_2, TRAINER_ELLIOT_3, TRAINER_ELLIOT_4, TRAINER_ELLIOT_5}, 0x0, 0x15},
|
||||
{{TRAINER_ISAIAH_1, TRAINER_ISAIAH_2, TRAINER_ISAIAH_3, TRAINER_ISAIAH_4, TRAINER_ISAIAH_5}, 0x0, 0x2b},
|
||||
{{TRAINER_MARIA_1, TRAINER_MARIA_2, TRAINER_MARIA_3, TRAINER_MARIA_4, TRAINER_MARIA_5}, 0x0, 0x20},
|
||||
{{TRAINER_ABIGAIL_1, TRAINER_ABIGAIL_2, TRAINER_ABIGAIL_3, TRAINER_ABIGAIL_4, TRAINER_ABIGAIL_5}, 0x0, 0x19},
|
||||
{{TRAINER_DYLAN_1, TRAINER_DYLAN_2, TRAINER_DYLAN_3, TRAINER_DYLAN_4, TRAINER_DYLAN_5}, 0x0, 0x20},
|
||||
{{TRAINER_KATELYN_1, TRAINER_KATELYN_2, TRAINER_KATELYN_3, TRAINER_KATELYN_4, TRAINER_KATELYN_5}, 0x0, 0x2b},
|
||||
{{TRAINER_BENJAMIN_1, TRAINER_BENJAMIN_2, TRAINER_BENJAMIN_3, TRAINER_BENJAMIN_4, TRAINER_BENJAMIN_5}, 0x0, 0x19},
|
||||
{{TRAINER_PABLO_1, TRAINER_PABLO_2, TRAINER_PABLO_3, TRAINER_PABLO_4, TRAINER_PABLO_5}, 0x0, 0x29},
|
||||
{{TRAINER_NICOLAS_1, TRAINER_NICOLAS_2, TRAINER_NICOLAS_3, TRAINER_NICOLAS_4, TRAINER_NICOLAS_5}, 0x18, 0x1},
|
||||
{{TRAINER_ROBERT_1, TRAINER_ROBERT_2, TRAINER_ROBERT_3, TRAINER_ROBERT_4, TRAINER_ROBERT_5}, 0x0, 0x23},
|
||||
{{TRAINER_LAO_1, TRAINER_LAO_2, TRAINER_LAO_3, TRAINER_LAO_4, TRAINER_LAO_5}, 0x0, 0x1c},
|
||||
{{TRAINER_CYNDY_1, TRAINER_CYNDY_2, TRAINER_CYNDY_3, TRAINER_CYNDY_4, TRAINER_CYNDY_5}, 0x0, 0x1e},
|
||||
{{TRAINER_MADELINE_1, TRAINER_MADELINE_2, TRAINER_MADELINE_3, TRAINER_MADELINE_4, TRAINER_MADELINE_5}, 0x0, 0x1c},
|
||||
{{TRAINER_JENNY_1, TRAINER_JENNY_2, TRAINER_JENNY_3, TRAINER_JENNY_4, TRAINER_JENNY_5}, 0x0, 0x27},
|
||||
{{TRAINER_DIANA_1, TRAINER_DIANA_2, TRAINER_DIANA_3, TRAINER_DIANA_4, TRAINER_DIANA_5}, 0x18, 0xd},
|
||||
{{TRAINER_AMY_AND_LIV_1, TRAINER_AMY_AND_LIV_2, TRAINER_AMY_AND_LIV_4, TRAINER_AMY_AND_LIV_5, TRAINER_AMY_AND_LIV_6}, 0x0, 0x12},
|
||||
{{TRAINER_ERNEST_1, TRAINER_ERNEST_2, TRAINER_ERNEST_3, TRAINER_ERNEST_4, TRAINER_ERNEST_5}, 0x0, 0x28},
|
||||
{{TRAINER_CORY_1, TRAINER_CORY_2, TRAINER_CORY_3, TRAINER_CORY_4, TRAINER_CORY_5}, 0x0, 0x17},
|
||||
{{TRAINER_EDWIN_1, TRAINER_EDWIN_2, TRAINER_EDWIN_3, TRAINER_EDWIN_4, TRAINER_EDWIN_5}, 0x0, 0x19},
|
||||
{{TRAINER_LYDIA_1, TRAINER_LYDIA_2, TRAINER_LYDIA_3, TRAINER_LYDIA_4, TRAINER_LYDIA_5}, 0x0, 0x20},
|
||||
{{TRAINER_ISAAC_1, TRAINER_ISAAC_2, TRAINER_ISAAC_3, TRAINER_ISAAC_4, TRAINER_ISAAC_5}, 0x0, 0x20},
|
||||
{{TRAINER_GABRIELLE_1, TRAINER_GABRIELLE_2, TRAINER_GABRIELLE_3, TRAINER_GABRIELLE_4, TRAINER_GABRIELLE_5}, 0x18, 0x11},
|
||||
{{TRAINER_CATHERINE_1, TRAINER_CATHERINE_2, TRAINER_CATHERINE_3, TRAINER_CATHERINE_4, TRAINER_CATHERINE_5}, 0x0, 0x22},
|
||||
{{TRAINER_JACKSON_1, TRAINER_JACKSON_2, TRAINER_JACKSON_3, TRAINER_JACKSON_4, TRAINER_JACKSON_5}, 0x0, 0x22},
|
||||
{{TRAINER_HALEY_1, TRAINER_HALEY_2, TRAINER_HALEY_3, TRAINER_HALEY_4, TRAINER_HALEY_5}, 0x0, 0x13},
|
||||
{{TRAINER_JAMES_1, TRAINER_JAMES_2, TRAINER_JAMES_3, TRAINER_JAMES_4, TRAINER_JAMES_5}, 0x18, 0xb},
|
||||
{{TRAINER_TRENT_1, TRAINER_TRENT_2, TRAINER_TRENT_3, TRAINER_TRENT_4, TRAINER_TRENT_5}, 0x0, 0x1b},
|
||||
{{TRAINER_SAWYER_1, TRAINER_SAWYER_2, TRAINER_SAWYER_3, TRAINER_SAWYER_4, TRAINER_SAWYER_5}, 0x18, 0xc},
|
||||
{{TRAINER_KIRA_AND_DAN_1, TRAINER_KIRA_AND_DAN_2, TRAINER_KIRA_AND_DAN_3, TRAINER_KIRA_AND_DAN_4, TRAINER_KIRA_AND_DAN_5}, 0x18, 0x3e},
|
||||
{{TRAINER_WALLY_3, TRAINER_WALLY_4, TRAINER_WALLY_5, TRAINER_WALLY_6, TRAINER_WALLY_6}, 0x18, 0x2b},
|
||||
{{TRAINER_ROXANNE_1, TRAINER_ROXANNE_2, TRAINER_ROXANNE_3, TRAINER_ROXANNE_4, TRAINER_ROXANNE_5}, 0x0, 0x3},
|
||||
{{TRAINER_BRAWLY_1, TRAINER_BRAWLY_2, TRAINER_BRAWLY_3, TRAINER_BRAWLY_4, TRAINER_BRAWLY_5}, 0x0, 0xb},
|
||||
{{TRAINER_WATTSON_1, TRAINER_WATTSON_2, TRAINER_WATTSON_3, TRAINER_WATTSON_4, TRAINER_WATTSON_5}, 0x0, 0x2},
|
||||
{{TRAINER_FLANNERY_1, TRAINER_FLANNERY_2, TRAINER_FLANNERY_3, TRAINER_FLANNERY_4, TRAINER_FLANNERY_5}, 0x0, 0xc},
|
||||
{{TRAINER_NORMAN_1, TRAINER_NORMAN_2, TRAINER_NORMAN_3, TRAINER_NORMAN_4, TRAINER_NORMAN_5}, 0x0, 0x0},
|
||||
{{TRAINER_WINONA_1, TRAINER_WINONA_2, TRAINER_WINONA_3, TRAINER_WINONA_4, TRAINER_WINONA_5}, 0x0, 0x4},
|
||||
{{TRAINER_TATE_AND_LIZA_1, TRAINER_TATE_AND_LIZA_2, TRAINER_TATE_AND_LIZA_3, TRAINER_TATE_AND_LIZA_4, TRAINER_TATE_AND_LIZA_5}, 0x0, 0x6},
|
||||
{{TRAINER_JUAN_1, TRAINER_JUAN_2, TRAINER_JUAN_3, TRAINER_JUAN_4, TRAINER_JUAN_5}, 0x0, 0x7},
|
||||
{{TRAINER_SIDNEY, TRAINER_SIDNEY, TRAINER_SIDNEY, TRAINER_SIDNEY, TRAINER_SIDNEY}, 0x0, 0x8},
|
||||
{{TRAINER_PHOEBE, TRAINER_PHOEBE, TRAINER_PHOEBE, TRAINER_PHOEBE, TRAINER_PHOEBE}, 0x0, 0x8},
|
||||
{{TRAINER_GLACIA, TRAINER_GLACIA, TRAINER_GLACIA, TRAINER_GLACIA, TRAINER_GLACIA}, 0x0, 0x8},
|
||||
{{TRAINER_DRAKE, TRAINER_DRAKE, TRAINER_DRAKE, TRAINER_DRAKE, TRAINER_DRAKE}, 0x0, 0x8},
|
||||
{{TRAINER_WALLACE, TRAINER_WALLACE, TRAINER_WALLACE, TRAINER_WALLACE, TRAINER_WALLACE}, 0x0, 0x8},
|
||||
[REMATCH_ROSE] = {{TRAINER_ROSE_1, TRAINER_ROSE_2, TRAINER_ROSE_3, TRAINER_ROSE_4, TRAINER_ROSE_5}, 0x0, 0x21},
|
||||
[REMATCH_ANDRES] = {{TRAINER_ANDRES_1, TRAINER_ANDRES_2, TRAINER_ANDRES_3, TRAINER_ANDRES_4, TRAINER_ANDRES_5}, 0x0, 0x14},
|
||||
[REMATCH_DUSTY] = {{TRAINER_DUSTY_1, TRAINER_DUSTY_2, TRAINER_DUSTY_3, TRAINER_DUSTY_4, TRAINER_DUSTY_5}, 0x0, 0x1a},
|
||||
[REMATCH_LOLA] = {{TRAINER_LOLA_1, TRAINER_LOLA_2, TRAINER_LOLA_3, TRAINER_LOLA_4, TRAINER_LOLA_5}, 0x0, 0x18},
|
||||
[REMATCH_RICKY] = {{TRAINER_RICKY_1, TRAINER_RICKY_2, TRAINER_RICKY_3, TRAINER_RICKY_4, TRAINER_RICKY_5}, 0x0, 0x18},
|
||||
[REMATCH_LILA_AND_ROY] = {{TRAINER_LILA_AND_ROY_1, TRAINER_LILA_AND_ROY_2, TRAINER_LILA_AND_ROY_3, TRAINER_LILA_AND_ROY_4, TRAINER_LILA_AND_ROY_5}, 0x0, 0x27},
|
||||
[REMATCH_CRISTIN] = {{TRAINER_CRISTIN_1, TRAINER_CRISTIN_2, TRAINER_CRISTIN_3, TRAINER_CRISTIN_4, TRAINER_CRISTIN_5}, 0x0, 0x24},
|
||||
[REMATCH_BROOKE] = {{TRAINER_BROOKE_1, TRAINER_BROOKE_2, TRAINER_BROOKE_3, TRAINER_BROOKE_4, TRAINER_BROOKE_5}, 0x0, 0x1a},
|
||||
[REMATCH_WILTON] = {{TRAINER_WILTON_1, TRAINER_WILTON_2, TRAINER_WILTON_3, TRAINER_WILTON_4, TRAINER_WILTON_5}, 0x0, 0x1a},
|
||||
[REMATCH_VALERIE] = {{TRAINER_VALERIE_1, TRAINER_VALERIE_2, TRAINER_VALERIE_3, TRAINER_VALERIE_4, TRAINER_VALERIE_5}, 0x18, 0x14},
|
||||
[REMATCH_CINDY] = {{TRAINER_CINDY_1, TRAINER_CINDY_3, TRAINER_CINDY_4, TRAINER_CINDY_5, TRAINER_CINDY_6}, 0x0, 0x13},
|
||||
[REMATCH_THALIA] = {{TRAINER_THALIA_1, TRAINER_THALIA_2, TRAINER_THALIA_3, TRAINER_THALIA_4, TRAINER_THALIA_5}, 0x18, 0x38},
|
||||
[REMATCH_JESSICA] = {{TRAINER_JESSICA_1, TRAINER_JESSICA_2, TRAINER_JESSICA_3, TRAINER_JESSICA_4, TRAINER_JESSICA_5}, 0x0, 0x24},
|
||||
[REMATCH_WINSTON] = {{TRAINER_WINSTON_1, TRAINER_WINSTON_2, TRAINER_WINSTON_3, TRAINER_WINSTON_4, TRAINER_WINSTON_5}, 0x0, 0x13},
|
||||
[REMATCH_STEVE] = {{TRAINER_STEVE_1, TRAINER_STEVE_2, TRAINER_STEVE_3, TRAINER_STEVE_4, TRAINER_STEVE_5}, 0x0, 0x1d},
|
||||
[REMATCH_TONY] = {{TRAINER_TONY_1, TRAINER_TONY_2, TRAINER_TONY_3, TRAINER_TONY_4, TRAINER_TONY_5}, 0x0, 0x16},
|
||||
[REMATCH_NOB] = {{TRAINER_NOB_1, TRAINER_NOB_2, TRAINER_NOB_3, TRAINER_NOB_4, TRAINER_NOB_5}, 0x0, 0x1e},
|
||||
[REMATCH_KOJI] = {{TRAINER_KOJI_1, TRAINER_KOJI_2, TRAINER_KOJI_3, TRAINER_KOJI_4, TRAINER_KOJI_5}, 0x0, 0x2a},
|
||||
[REMATCH_FERNANDO] = {{TRAINER_FERNANDO_1, TRAINER_FERNANDO_2, TRAINER_FERNANDO_3, TRAINER_FERNANDO_4, TRAINER_FERNANDO_5}, 0x0, 0x26},
|
||||
[REMATCH_DALTON] = {{TRAINER_DALTON_1, TRAINER_DALTON_2, TRAINER_DALTON_3, TRAINER_DALTON_4, TRAINER_DALTON_5}, 0x0, 0x21},
|
||||
[REMATCH_BERNIE] = {{TRAINER_BERNIE_1, TRAINER_BERNIE_2, TRAINER_BERNIE_3, TRAINER_BERNIE_4, TRAINER_BERNIE_5}, 0x0, 0x1d},
|
||||
[REMATCH_ETHAN] = {{TRAINER_ETHAN_1, TRAINER_ETHAN_2, TRAINER_ETHAN_3, TRAINER_ETHAN_4, TRAINER_ETHAN_5}, 0x18, 0xd},
|
||||
[REMATCH_JOHN_AND_JAY] = {{TRAINER_JOHN_AND_JAY_1, TRAINER_JOHN_AND_JAY_2, TRAINER_JOHN_AND_JAY_3, TRAINER_JOHN_AND_JAY_4, TRAINER_JOHN_AND_JAY_5}, 0x18, 0x1},
|
||||
[REMATCH_JEFFREY] = {{TRAINER_JEFFREY_1, TRAINER_JEFFREY_2, TRAINER_JEFFREY_3, TRAINER_JEFFREY_4, TRAINER_JEFFREY_5}, 0x0, 0x23},
|
||||
[REMATCH_CAMERON] = {{TRAINER_CAMERON_1, TRAINER_CAMERON_2, TRAINER_CAMERON_3, TRAINER_CAMERON_4, TRAINER_CAMERON_5}, 0x0, 0x26},
|
||||
[REMATCH_JACKI] = {{TRAINER_JACKI_1, TRAINER_JACKI_2, TRAINER_JACKI_3, TRAINER_JACKI_4, TRAINER_JACKI_5}, 0x0, 0x26},
|
||||
[REMATCH_WALTER] = {{TRAINER_WALTER_1, TRAINER_WALTER_2, TRAINER_WALTER_3, TRAINER_WALTER_4, TRAINER_WALTER_5}, 0x0, 0x24},
|
||||
[REMATCH_KAREN] = {{TRAINER_KAREN_1, TRAINER_KAREN_2, TRAINER_KAREN_3, TRAINER_KAREN_4, TRAINER_KAREN_5}, 0x0, 0x1f},
|
||||
[REMATCH_JERRY] = {{TRAINER_JERRY_1, TRAINER_JERRY_2, TRAINER_JERRY_3, TRAINER_JERRY_4, TRAINER_JERRY_5}, 0x0, 0x1f},
|
||||
[REMATCH_ANNA_AND_MEG] = {{TRAINER_ANNA_AND_MEG_1, TRAINER_ANNA_AND_MEG_2, TRAINER_ANNA_AND_MEG_3, TRAINER_ANNA_AND_MEG_4, TRAINER_ANNA_AND_MEG_5}, 0x0, 0x20},
|
||||
[REMATCH_ISABEL] = {{TRAINER_ISABEL_1, TRAINER_ISABEL_2, TRAINER_ISABEL_3, TRAINER_ISABEL_4, TRAINER_ISABEL_5}, 0x0, 0x19},
|
||||
[REMATCH_MIGUEL] = {{TRAINER_MIGUEL_1, TRAINER_MIGUEL_2, TRAINER_MIGUEL_3, TRAINER_MIGUEL_4, TRAINER_MIGUEL_5}, 0x0, 0x12},
|
||||
[REMATCH_TIMOTHY] = {{TRAINER_TIMOTHY_1, TRAINER_TIMOTHY_2, TRAINER_TIMOTHY_3, TRAINER_TIMOTHY_4, TRAINER_TIMOTHY_5}, 0x0, 0x1e},
|
||||
[REMATCH_SHELBY] = {{TRAINER_SHELBY_1, TRAINER_SHELBY_2, TRAINER_SHELBY_3, TRAINER_SHELBY_4, TRAINER_SHELBY_5}, 0x18, 0xc},
|
||||
[REMATCH_CALVIN] = {{TRAINER_CALVIN_1, TRAINER_CALVIN_2, TRAINER_CALVIN_3, TRAINER_CALVIN_4, TRAINER_CALVIN_5}, 0x0, 0x11},
|
||||
[REMATCH_ELLIOT] = {{TRAINER_ELLIOT_1, TRAINER_ELLIOT_2, TRAINER_ELLIOT_3, TRAINER_ELLIOT_4, TRAINER_ELLIOT_5}, 0x0, 0x15},
|
||||
[REMATCH_ISAIAH] = {{TRAINER_ISAIAH_1, TRAINER_ISAIAH_2, TRAINER_ISAIAH_3, TRAINER_ISAIAH_4, TRAINER_ISAIAH_5}, 0x0, 0x2b},
|
||||
[REMATCH_MARIA] = {{TRAINER_MARIA_1, TRAINER_MARIA_2, TRAINER_MARIA_3, TRAINER_MARIA_4, TRAINER_MARIA_5}, 0x0, 0x20},
|
||||
[REMATCH_ABIGAIL] = {{TRAINER_ABIGAIL_1, TRAINER_ABIGAIL_2, TRAINER_ABIGAIL_3, TRAINER_ABIGAIL_4, TRAINER_ABIGAIL_5}, 0x0, 0x19},
|
||||
[REMATCH_DYLAN] = {{TRAINER_DYLAN_1, TRAINER_DYLAN_2, TRAINER_DYLAN_3, TRAINER_DYLAN_4, TRAINER_DYLAN_5}, 0x0, 0x20},
|
||||
[REMATCH_KATELYN] = {{TRAINER_KATELYN_1, TRAINER_KATELYN_2, TRAINER_KATELYN_3, TRAINER_KATELYN_4, TRAINER_KATELYN_5}, 0x0, 0x2b},
|
||||
[REMATCH_BENJAMIN] = {{TRAINER_BENJAMIN_1, TRAINER_BENJAMIN_2, TRAINER_BENJAMIN_3, TRAINER_BENJAMIN_4, TRAINER_BENJAMIN_5}, 0x0, 0x19},
|
||||
[REMATCH_PABLO] = {{TRAINER_PABLO_1, TRAINER_PABLO_2, TRAINER_PABLO_3, TRAINER_PABLO_4, TRAINER_PABLO_5}, 0x0, 0x29},
|
||||
[REMATCH_NICOLAS] = {{TRAINER_NICOLAS_1, TRAINER_NICOLAS_2, TRAINER_NICOLAS_3, TRAINER_NICOLAS_4, TRAINER_NICOLAS_5}, 0x18, 0x1},
|
||||
[REMATCH_ROBERT] = {{TRAINER_ROBERT_1, TRAINER_ROBERT_2, TRAINER_ROBERT_3, TRAINER_ROBERT_4, TRAINER_ROBERT_5}, 0x0, 0x23},
|
||||
[REMATCH_LAO] = {{TRAINER_LAO_1, TRAINER_LAO_2, TRAINER_LAO_3, TRAINER_LAO_4, TRAINER_LAO_5}, 0x0, 0x1c},
|
||||
[REMATCH_CYNDY] = {{TRAINER_CYNDY_1, TRAINER_CYNDY_2, TRAINER_CYNDY_3, TRAINER_CYNDY_4, TRAINER_CYNDY_5}, 0x0, 0x1e},
|
||||
[REMATCH_MADELINE] = {{TRAINER_MADELINE_1, TRAINER_MADELINE_2, TRAINER_MADELINE_3, TRAINER_MADELINE_4, TRAINER_MADELINE_5}, 0x0, 0x1c},
|
||||
[REMATCH_JENNY] = {{TRAINER_JENNY_1, TRAINER_JENNY_2, TRAINER_JENNY_3, TRAINER_JENNY_4, TRAINER_JENNY_5}, 0x0, 0x27},
|
||||
[REMATCH_DIANA] = {{TRAINER_DIANA_1, TRAINER_DIANA_2, TRAINER_DIANA_3, TRAINER_DIANA_4, TRAINER_DIANA_5}, 0x18, 0xd},
|
||||
[REMATCH_AMY_AND_LIV] = {{TRAINER_AMY_AND_LIV_1, TRAINER_AMY_AND_LIV_2, TRAINER_AMY_AND_LIV_4, TRAINER_AMY_AND_LIV_5, TRAINER_AMY_AND_LIV_6}, 0x0, 0x12},
|
||||
[REMATCH_ERNEST] = {{TRAINER_ERNEST_1, TRAINER_ERNEST_2, TRAINER_ERNEST_3, TRAINER_ERNEST_4, TRAINER_ERNEST_5}, 0x0, 0x28},
|
||||
[REMATCH_CORY] = {{TRAINER_CORY_1, TRAINER_CORY_2, TRAINER_CORY_3, TRAINER_CORY_4, TRAINER_CORY_5}, 0x0, 0x17},
|
||||
[REMATCH_EDWIN] = {{TRAINER_EDWIN_1, TRAINER_EDWIN_2, TRAINER_EDWIN_3, TRAINER_EDWIN_4, TRAINER_EDWIN_5}, 0x0, 0x19},
|
||||
[REMATCH_LYDIA] = {{TRAINER_LYDIA_1, TRAINER_LYDIA_2, TRAINER_LYDIA_3, TRAINER_LYDIA_4, TRAINER_LYDIA_5}, 0x0, 0x20},
|
||||
[REMATCH_ISAAC] = {{TRAINER_ISAAC_1, TRAINER_ISAAC_2, TRAINER_ISAAC_3, TRAINER_ISAAC_4, TRAINER_ISAAC_5}, 0x0, 0x20},
|
||||
[REMATCH_GABRIELLE] = {{TRAINER_GABRIELLE_1, TRAINER_GABRIELLE_2, TRAINER_GABRIELLE_3, TRAINER_GABRIELLE_4, TRAINER_GABRIELLE_5}, 0x18, 0x11},
|
||||
[REMATCH_CATHERINE] = {{TRAINER_CATHERINE_1, TRAINER_CATHERINE_2, TRAINER_CATHERINE_3, TRAINER_CATHERINE_4, TRAINER_CATHERINE_5}, 0x0, 0x22},
|
||||
[REMATCH_JACKSON] = {{TRAINER_JACKSON_1, TRAINER_JACKSON_2, TRAINER_JACKSON_3, TRAINER_JACKSON_4, TRAINER_JACKSON_5}, 0x0, 0x22},
|
||||
[REMATCH_HALEY] = {{TRAINER_HALEY_1, TRAINER_HALEY_2, TRAINER_HALEY_3, TRAINER_HALEY_4, TRAINER_HALEY_5}, 0x0, 0x13},
|
||||
[REMATCH_JAMES] = {{TRAINER_JAMES_1, TRAINER_JAMES_2, TRAINER_JAMES_3, TRAINER_JAMES_4, TRAINER_JAMES_5}, 0x18, 0xb},
|
||||
[REMATCH_TRENT] = {{TRAINER_TRENT_1, TRAINER_TRENT_2, TRAINER_TRENT_3, TRAINER_TRENT_4, TRAINER_TRENT_5}, 0x0, 0x1b},
|
||||
[REMATCH_SAWYER] = {{TRAINER_SAWYER_1, TRAINER_SAWYER_2, TRAINER_SAWYER_3, TRAINER_SAWYER_4, TRAINER_SAWYER_5}, 0x18, 0xc},
|
||||
[REMATCH_KIRA_AND_DAN] = {{TRAINER_KIRA_AND_DAN_1, TRAINER_KIRA_AND_DAN_2, TRAINER_KIRA_AND_DAN_3, TRAINER_KIRA_AND_DAN_4, TRAINER_KIRA_AND_DAN_5}, 0x18, 0x3e},
|
||||
[REMATCH_WALLY_3] = {{TRAINER_WALLY_3, TRAINER_WALLY_4, TRAINER_WALLY_5, TRAINER_WALLY_6, TRAINER_WALLY_6}, 0x18, 0x2b},
|
||||
[REMATCH_ROXANNE] = {{TRAINER_ROXANNE_1, TRAINER_ROXANNE_2, TRAINER_ROXANNE_3, TRAINER_ROXANNE_4, TRAINER_ROXANNE_5}, 0x0, 0x3},
|
||||
[REMATCH_BRAWLY] = {{TRAINER_BRAWLY_1, TRAINER_BRAWLY_2, TRAINER_BRAWLY_3, TRAINER_BRAWLY_4, TRAINER_BRAWLY_5}, 0x0, 0xb},
|
||||
[REMATCH_WATTSON] = {{TRAINER_WATTSON_1, TRAINER_WATTSON_2, TRAINER_WATTSON_3, TRAINER_WATTSON_4, TRAINER_WATTSON_5}, 0x0, 0x2},
|
||||
[REMATCH_FLANNERY] = {{TRAINER_FLANNERY_1, TRAINER_FLANNERY_2, TRAINER_FLANNERY_3, TRAINER_FLANNERY_4, TRAINER_FLANNERY_5}, 0x0, 0xc},
|
||||
[REMATCH_NORMAN] = {{TRAINER_NORMAN_1, TRAINER_NORMAN_2, TRAINER_NORMAN_3, TRAINER_NORMAN_4, TRAINER_NORMAN_5}, 0x0, 0x0},
|
||||
[REMATCH_WINONA] = {{TRAINER_WINONA_1, TRAINER_WINONA_2, TRAINER_WINONA_3, TRAINER_WINONA_4, TRAINER_WINONA_5}, 0x0, 0x4},
|
||||
[REMATCH_TATE_AND_LIZA] = {{TRAINER_TATE_AND_LIZA_1, TRAINER_TATE_AND_LIZA_2, TRAINER_TATE_AND_LIZA_3, TRAINER_TATE_AND_LIZA_4, TRAINER_TATE_AND_LIZA_5}, 0x0, 0x6},
|
||||
[REMATCH_JUAN] = {{TRAINER_JUAN_1, TRAINER_JUAN_2, TRAINER_JUAN_3, TRAINER_JUAN_4, TRAINER_JUAN_5}, 0x0, 0x7},
|
||||
[REMATCH_SIDNEY] = {{TRAINER_SIDNEY, TRAINER_SIDNEY, TRAINER_SIDNEY, TRAINER_SIDNEY, TRAINER_SIDNEY}, 0x0, 0x8},
|
||||
[REMATCH_PHOEBE] = {{TRAINER_PHOEBE, TRAINER_PHOEBE, TRAINER_PHOEBE, TRAINER_PHOEBE, TRAINER_PHOEBE}, 0x0, 0x8},
|
||||
[REMATCH_GLACIA] = {{TRAINER_GLACIA, TRAINER_GLACIA, TRAINER_GLACIA, TRAINER_GLACIA, TRAINER_GLACIA}, 0x0, 0x8},
|
||||
[REMATCH_DRAKE] = {{TRAINER_DRAKE, TRAINER_DRAKE, TRAINER_DRAKE, TRAINER_DRAKE, TRAINER_DRAKE}, 0x0, 0x8},
|
||||
[REMATCH_WALLACE] = {{TRAINER_WALLACE, TRAINER_WALLACE, TRAINER_WALLACE, TRAINER_WALLACE, TRAINER_WALLACE}, 0x0, 0x8},
|
||||
};
|
||||
|
||||
static const u16 sBadgeFlags[8] =
|
||||
@@ -1545,7 +1545,7 @@ static bool32 sub_80B1D94(s32 rematchTableId)
|
||||
{
|
||||
if (rematchTableId >= REMATCH_ELITE_FOUR_ENTRIES)
|
||||
return TRUE;
|
||||
else if (rematchTableId == REMATCH_WALLY_ENTRY)
|
||||
else if (rematchTableId == REMATCH_WALLY_3)
|
||||
return (FlagGet(FLAG_DEFEATED_WALLY_VICTORY_ROAD) == FALSE);
|
||||
else
|
||||
return FALSE;
|
||||
@@ -1573,7 +1573,7 @@ static bool32 UpdateRandomTrainerRematches(const struct RematchTrainer *table, u
|
||||
s32 i;
|
||||
bool32 ret = FALSE;
|
||||
|
||||
for (i = 0; i <= REMATCH_WALLY_ENTRY; i++)
|
||||
for (i = 0; i <= REMATCH_WALLY_3; i++)
|
||||
{
|
||||
if (table[i].mapGroup == mapGroup && table[i].mapNum == mapNum && !sub_80B1D94(i))
|
||||
{
|
||||
|
||||
@@ -1,6 +1,7 @@
|
||||
#include "global.h"
|
||||
#include "pokemon.h"
|
||||
#include "battle.h"
|
||||
#include "battle_anim.h"
|
||||
#include "battle_tv.h"
|
||||
#include "constants/battle_string_ids.h"
|
||||
#include "constants/battle_anim.h"
|
||||
|
||||
@@ -1,5 +1,6 @@
|
||||
#include "global.h"
|
||||
#include "battle.h"
|
||||
#include "battle_anim.h"
|
||||
#include "constants/battle_script_commands.h"
|
||||
#include "constants/abilities.h"
|
||||
#include "constants/moves.h"
|
||||
|
||||
@@ -1,5 +1,6 @@
|
||||
#include "global.h"
|
||||
#include "battle.h"
|
||||
#include "battle_anim.h"
|
||||
#include "battle_controllers.h"
|
||||
#include "alloc.h"
|
||||
#include "pokemon.h"
|
||||
|
||||
+1
-1
@@ -940,7 +940,7 @@ static void InitBerryBlenderWindows(void)
|
||||
FillWindowPixelBuffer(i, PIXEL_FILL(0));
|
||||
|
||||
FillBgTilemapBufferRect_Palette0(0, 0, 0, 0, 0x1E, 0x14);
|
||||
sub_81978B0(0xE0);
|
||||
Menu_LoadStdPalAt(0xE0);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Executable
+775
@@ -0,0 +1,775 @@
|
||||
#include "global.h"
|
||||
#include "alloc.h"
|
||||
#include "berry_powder.h"
|
||||
#include "bg.h"
|
||||
#include "event_data.h"
|
||||
#include "gpu_regs.h"
|
||||
#include "graphics.h"
|
||||
#include "item_icon.h"
|
||||
#include "item_menu.h"
|
||||
#include "link.h"
|
||||
#include "link_rfu.h"
|
||||
#include "main.h"
|
||||
#include "math_util.h"
|
||||
#include "menu.h"
|
||||
#include "overworld.h"
|
||||
#include "palette.h"
|
||||
#include "rom_8034C54.h"
|
||||
#include "scanline_effect.h"
|
||||
#include "sound.h"
|
||||
#include "sprite.h"
|
||||
#include "string_util.h"
|
||||
#include "task.h"
|
||||
#include "text.h"
|
||||
#include "trig.h"
|
||||
#include "window.h"
|
||||
#include "constants/items.h"
|
||||
#include "constants/rgb.h"
|
||||
#include "constants/songs.h"
|
||||
|
||||
struct BerryCrushGame_Player
|
||||
{
|
||||
u16 unk0;
|
||||
u8 filler2[0x12];
|
||||
u8 unk14[0xC];
|
||||
};
|
||||
|
||||
struct BerryCrushGame_PlayersSeparate
|
||||
{
|
||||
struct BerryCrushGame_Player player;
|
||||
struct BerryCrushGame_Player others[4];
|
||||
};
|
||||
|
||||
typedef union BerryCrushGame_Players
|
||||
{
|
||||
struct BerryCrushGame_Player players[5];
|
||||
struct BerryCrushGame_PlayersSeparate separate;
|
||||
} BerryCrushGame_Players;
|
||||
|
||||
struct BerryCrushGame_138_C
|
||||
{
|
||||
u8 filler0[0x8];
|
||||
s16 unk8;
|
||||
u16 unkA;
|
||||
};
|
||||
|
||||
struct BerryCrushGame_138
|
||||
{
|
||||
u8 filler0[0xC];
|
||||
struct BerryCrushGame_138_C *unkC[5];
|
||||
u8 filler1C[0x4];
|
||||
struct Sprite *unk24[5];
|
||||
struct Sprite *unk38[5];
|
||||
struct Sprite *unk4C[5];
|
||||
struct Sprite *unk60[5];
|
||||
struct Sprite *unk74[5];
|
||||
};
|
||||
|
||||
struct BerryCrushGame_4E
|
||||
{
|
||||
u8 filler0[0x4];
|
||||
u8 unk4;
|
||||
u8 filler5[0x5];
|
||||
u16 unkA;
|
||||
u16 unkC;
|
||||
};
|
||||
|
||||
struct __attribute__((packed)) BerryCrushGame_40
|
||||
{
|
||||
u8 filler0[0xE];
|
||||
struct BerryCrushGame_4E unkE;
|
||||
};
|
||||
|
||||
struct BerryCrushGame
|
||||
{
|
||||
MainCallback unk0;
|
||||
void (* unk4)(struct BerryCrushGame *, u8 *);
|
||||
u8 unk8;
|
||||
u8 unk9;
|
||||
u8 unkA;
|
||||
u8 unkB;
|
||||
u8 unkC;
|
||||
u8 fillerD[0x1];
|
||||
u8 unkE;
|
||||
u8 unkF;
|
||||
u8 filler10[0x2];
|
||||
u16 unk12;
|
||||
u8 filler14[0x2];
|
||||
u16 unk16;
|
||||
u8 filler18[0x4];
|
||||
int unk1C;
|
||||
u8 filler20[0x5];
|
||||
u8 unk25_0:1;
|
||||
u8 unk25_1:1;
|
||||
u8 unk25_2:1;
|
||||
u8 filler26[0x2];
|
||||
u16 unk28;
|
||||
u16 unk2A;
|
||||
u16 unk2C;
|
||||
u8 filler2E[0x8];
|
||||
u8 unk36[0xA];
|
||||
struct BerryCrushGame_40 unk40;
|
||||
u8 filler60[0x8];
|
||||
int unk68;
|
||||
u16 unk6C;
|
||||
u8 filler6E[0x4];
|
||||
u16 unk72;
|
||||
u8 filler74[0x10];
|
||||
BerryCrushGame_Players unk84;
|
||||
u8 filler124[0x14];
|
||||
struct BerryCrushGame_138 unk138;
|
||||
u8 unk1C0[0x1000];
|
||||
u8 unk11C0[0x1000];
|
||||
u8 unk21C0[0x1000];
|
||||
u8 unk31C0[0x1000];
|
||||
};
|
||||
|
||||
static void sub_8020F74(void);
|
||||
static void sub_8020F88(void);
|
||||
static void sub_8020FA0(u8);
|
||||
void sub_8020FC4(struct BerryCrushGame *);
|
||||
void sub_8022BEC(u16, u8, u8 *);
|
||||
void sub_8024604(u8 *, u8, s8, u8, u8, u8, u8);
|
||||
static int sub_8021450(struct BerryCrushGame *);
|
||||
void sub_8022588(struct BerryCrushGame *);
|
||||
void sub_8022600(struct BerryCrushGame *);
|
||||
void sub_80226D0(struct BerryCrushGame *);
|
||||
void sub_8022730(struct BerryCrushGame *);
|
||||
void sub_8022960(struct BerryCrushGame *);
|
||||
void sub_8022524(struct BerryCrushGame_138 *, u16);
|
||||
void sub_8022B28(struct Sprite *);
|
||||
|
||||
static EWRAM_DATA struct BerryCrushGame *gUnknown_02022C90 = NULL;
|
||||
|
||||
extern const struct BgTemplate gUnknown_082F32C8[4];
|
||||
extern const u8 gBerryCrushGrinderTopTilemap[];
|
||||
extern const u8 gBerryCrushContainerCapTilemap[];
|
||||
extern const u8 gBerryCrushBackgroundTilemap[];
|
||||
extern const struct SpriteTemplate gUnknown_082F436C;
|
||||
extern const u16 gUnknown_082F41E8[];
|
||||
extern const s8 gUnknown_082F41CC[][2];
|
||||
extern const s8 gUnknown_082F41D2[][2];
|
||||
|
||||
struct BerryCrushGame *sub_8020C00(void)
|
||||
{
|
||||
return gUnknown_02022C90;
|
||||
}
|
||||
|
||||
int sub_8020C0C(MainCallback callback)
|
||||
{
|
||||
if (!gUnknown_02022C90)
|
||||
return 2;
|
||||
|
||||
if (!callback)
|
||||
callback = gUnknown_02022C90->unk0;
|
||||
|
||||
DestroyTask(gUnknown_02022C90->unkA);
|
||||
FREE_AND_SET_NULL(gUnknown_02022C90);
|
||||
SetMainCallback2(callback);
|
||||
if (callback == CB2_ReturnToField)
|
||||
{
|
||||
gTextFlags.autoScroll = 1;
|
||||
PlayNewMapMusic(MUS_POKECEN);
|
||||
SetMainCallback1(CB1_Overworld);
|
||||
}
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
void sub_8020C70(MainCallback callback)
|
||||
{
|
||||
u8 playerCount = 0;
|
||||
u8 multiplayerId;
|
||||
|
||||
if (!gReceivedRemoteLinkPlayers || gWirelessCommType == 0)
|
||||
{
|
||||
SetMainCallback2(callback);
|
||||
gUnknown_03005000.unk_10 = 0;
|
||||
gUnknown_03005000.unk_12 = 0;
|
||||
gUnknown_03005000.unk_ee = 1;
|
||||
return;
|
||||
}
|
||||
|
||||
playerCount = GetLinkPlayerCount();
|
||||
multiplayerId = GetMultiplayerId();
|
||||
if (playerCount < 2 || multiplayerId >= playerCount)
|
||||
{
|
||||
SetMainCallback2(callback);
|
||||
gUnknown_03005000.unk_10 = 0;
|
||||
gUnknown_03005000.unk_12 = 0;
|
||||
gUnknown_03005000.unk_ee = 1;
|
||||
return;
|
||||
}
|
||||
|
||||
gUnknown_02022C90 = AllocZeroed(sizeof(*gUnknown_02022C90));
|
||||
if (!gUnknown_02022C90)
|
||||
{
|
||||
SetMainCallback2(callback);
|
||||
gUnknown_03005000.unk_10 = 0;
|
||||
gUnknown_03005000.unk_12 = 0;
|
||||
gUnknown_03005000.unk_ee = 1;
|
||||
return;
|
||||
}
|
||||
|
||||
gUnknown_02022C90->unk0 = callback;
|
||||
gUnknown_02022C90->unk8 = multiplayerId;
|
||||
gUnknown_02022C90->unk9 = playerCount;
|
||||
sub_8020FC4(gUnknown_02022C90);
|
||||
gUnknown_02022C90->unk12 = 1;
|
||||
gUnknown_02022C90->unkE = 1;
|
||||
gUnknown_02022C90->unkF = 6;
|
||||
sub_8024604(gUnknown_02022C90->unk36, 1, -1, 0, 16, 0, 0);
|
||||
sub_8022BEC(4, 1, gUnknown_02022C90->unk36);
|
||||
SetMainCallback2(sub_8020F88);
|
||||
gUnknown_02022C90->unkA = CreateTask(sub_8020FA0, 8);
|
||||
gTextFlags.autoScroll = 0;
|
||||
}
|
||||
|
||||
static void sub_8020D8C(void)
|
||||
{
|
||||
if (gSpecialVar_ItemId < FIRST_BERRY_INDEX || gSpecialVar_ItemId > LAST_BERRY_INDEX + 1)
|
||||
gSpecialVar_ItemId = ITEM_CHERI_BERRY;
|
||||
else
|
||||
RemoveBagItem(gSpecialVar_ItemId, 1);
|
||||
|
||||
gUnknown_02022C90->unk84.separate.others[gUnknown_02022C90->unk8].unk0 = gSpecialVar_ItemId - FIRST_BERRY_INDEX;
|
||||
gUnknown_02022C90->unkE = 1;
|
||||
gUnknown_02022C90->unkF = 9;
|
||||
sub_8024604(gUnknown_02022C90->unk36, 0, -1, 0, 16, 0, 0);
|
||||
sub_8022BEC(4, 1, gUnknown_02022C90->unk36);
|
||||
gUnknown_02022C90->unkA = CreateTask(sub_8020FA0, 8);
|
||||
SetMainCallback2(sub_8020F88);
|
||||
}
|
||||
|
||||
void sub_8020E1C(void)
|
||||
{
|
||||
DestroyTask(gUnknown_02022C90->unkA);
|
||||
sub_81AABF0(sub_8020D8C);
|
||||
}
|
||||
|
||||
static void sub_8020E3C(void)
|
||||
{
|
||||
SetVBlankCallback(sub_8020F74);
|
||||
}
|
||||
|
||||
void sub_8020E4C(void)
|
||||
{
|
||||
SetVBlankCallback(NULL);
|
||||
}
|
||||
|
||||
void sub_8020E58(void)
|
||||
{
|
||||
u32 var0, var1;
|
||||
|
||||
var0 = gUnknown_02022C90->unk6C;
|
||||
var0 <<= 8;
|
||||
var0 = sub_81515FC(var0, 60 << 8);
|
||||
var1 = gUnknown_02022C90->unk72;
|
||||
var1 <<= 8;
|
||||
var1 = sub_81515FC(var1, var0) & 0xFFFF;
|
||||
gUnknown_02022C90->unk16 = var1;
|
||||
switch (gUnknown_02022C90->unk9)
|
||||
{
|
||||
case 2:
|
||||
if (gUnknown_02022C90->unk16 > gSaveBlock2Ptr->berryCrush.berryCrushResults[0])
|
||||
{
|
||||
gUnknown_02022C90->unk25_1 = 1;
|
||||
gSaveBlock2Ptr->berryCrush.berryCrushResults[0] = gUnknown_02022C90->unk16;
|
||||
}
|
||||
break;
|
||||
case 3:
|
||||
if (gUnknown_02022C90->unk16 > gSaveBlock2Ptr->berryCrush.berryCrushResults[1])
|
||||
{
|
||||
gUnknown_02022C90->unk25_1 = 1;
|
||||
gSaveBlock2Ptr->berryCrush.berryCrushResults[1] = gUnknown_02022C90->unk16;
|
||||
}
|
||||
break;
|
||||
case 4:
|
||||
if (gUnknown_02022C90->unk16 > gSaveBlock2Ptr->berryCrush.berryCrushResults[2])
|
||||
{
|
||||
gUnknown_02022C90->unk25_1 = 1;
|
||||
gSaveBlock2Ptr->berryCrush.berryCrushResults[2] = gUnknown_02022C90->unk16;
|
||||
}
|
||||
break;
|
||||
case 5:
|
||||
if (gUnknown_02022C90->unk16 > gSaveBlock2Ptr->berryCrush.berryCrushResults[3])
|
||||
{
|
||||
gUnknown_02022C90->unk25_1 = 1;
|
||||
gSaveBlock2Ptr->berryCrush.berryCrushResults[3] = gUnknown_02022C90->unk16;
|
||||
}
|
||||
break;
|
||||
}
|
||||
|
||||
gUnknown_02022C90->unk1C = gUnknown_02022C90->unk68;
|
||||
if (GiveBerryPowder(gUnknown_02022C90->unk1C))
|
||||
return;
|
||||
|
||||
gUnknown_02022C90->unk25_0 = 1;
|
||||
}
|
||||
|
||||
static void sub_8020F74(void)
|
||||
{
|
||||
TransferPlttBuffer();
|
||||
LoadOam();
|
||||
ProcessSpriteCopyRequests();
|
||||
}
|
||||
|
||||
static void sub_8020F88(void)
|
||||
{
|
||||
RunTasks();
|
||||
RunTextPrinters();
|
||||
AnimateSprites();
|
||||
BuildOamBuffer();
|
||||
}
|
||||
|
||||
static void sub_8020FA0(u8 taskId)
|
||||
{
|
||||
if (gUnknown_02022C90->unk4)
|
||||
gUnknown_02022C90->unk4(gUnknown_02022C90, gUnknown_02022C90->unk36);
|
||||
|
||||
sub_8021450(gUnknown_02022C90);
|
||||
}
|
||||
|
||||
#ifdef NONMATCHING
|
||||
void sub_8020FC4(struct BerryCrushGame *arg0)
|
||||
{
|
||||
u8 i;
|
||||
|
||||
for (i = 0; i < arg0->unk9; i++)
|
||||
StringCopy(arg0->unk84.players[i].unk14, gLinkPlayers[i].name);
|
||||
|
||||
for (; i < 5; i++)
|
||||
{
|
||||
memset(arg0->unk84.players[i].unk14, 1, PLAYER_NAME_LENGTH);
|
||||
arg0->unk84.players[i].unk14[PLAYER_NAME_LENGTH] = EOS;
|
||||
}
|
||||
|
||||
switch (gSaveBlock2Ptr->optionsTextSpeed)
|
||||
{
|
||||
case OPTIONS_TEXT_SPEED_SLOW:
|
||||
arg0->unkB = 8;
|
||||
break;
|
||||
case OPTIONS_TEXT_SPEED_MID:
|
||||
arg0->unkB = 4;
|
||||
break;
|
||||
case OPTIONS_TEXT_SPEED_FAST:
|
||||
arg0->unkB = 1;
|
||||
break;
|
||||
}
|
||||
}
|
||||
#else
|
||||
NAKED
|
||||
void sub_8020FC4(struct BerryCrushGame *arg0)
|
||||
{
|
||||
asm_unified("\n\
|
||||
push {r4-r6,lr}\n\
|
||||
adds r6, r0, 0\n\
|
||||
movs r5, 0\n\
|
||||
b _08020FE6\n\
|
||||
LOOP_1:\n\
|
||||
lsls r0, r5, 5\n\
|
||||
adds r0, 0x98\n\
|
||||
adds r0, r6, r0\n\
|
||||
lsls r1, r5, 3\n\
|
||||
subs r1, r5\n\
|
||||
lsls r1, 2\n\
|
||||
ldr r2, =gLinkPlayers + 8\n\
|
||||
adds r1, r2\n\
|
||||
bl StringCopy\n\
|
||||
adds r0, r5, 0x1\n\
|
||||
lsls r0, 24\n\
|
||||
lsrs r5, r0, 24\n\
|
||||
_08020FE6:\n\
|
||||
ldrb r0, [r6, 0x9]\n\
|
||||
cmp r5, r0\n\
|
||||
bcc LOOP_1\n\
|
||||
cmp r5, 0x4\n\
|
||||
bhi _08021012\n\
|
||||
_08020FF0:\n\
|
||||
lsls r4, r5, 5\n\
|
||||
adds r0, r4, 0\n\
|
||||
adds r0, 0x98\n\
|
||||
adds r0, r6, r0\n\
|
||||
movs r1, 0x1\n\
|
||||
movs r2, 0x7\n\
|
||||
bl memset\n\
|
||||
adds r4, r6, r4\n\
|
||||
adds r4, 0x9F\n\
|
||||
movs r0, 0xFF\n\
|
||||
strb r0, [r4]\n\
|
||||
adds r0, r5, 0x1\n\
|
||||
lsls r0, 24\n\
|
||||
lsrs r5, r0, 24\n\
|
||||
cmp r5, 0x4\n\
|
||||
bls _08020FF0\n\
|
||||
_08021012:\n\
|
||||
ldr r0, =gSaveBlock2Ptr\n\
|
||||
ldr r0, [r0]\n\
|
||||
ldrb r0, [r0, 0x14]\n\
|
||||
lsls r0, 29\n\
|
||||
lsrs r0, 29\n\
|
||||
cmp r0, 0x1\n\
|
||||
beq _0802103E\n\
|
||||
cmp r0, 0x1\n\
|
||||
bgt _08021034\n\
|
||||
cmp r0, 0\n\
|
||||
beq _0802103A\n\
|
||||
b _08021046\n\
|
||||
.pool\n\
|
||||
_08021034:\n\
|
||||
cmp r0, 0x2\n\
|
||||
beq _08021042\n\
|
||||
b _08021046\n\
|
||||
_0802103A:\n\
|
||||
movs r0, 0x8\n\
|
||||
b _08021044\n\
|
||||
_0802103E:\n\
|
||||
movs r0, 0x4\n\
|
||||
b _08021044\n\
|
||||
_08021042:\n\
|
||||
movs r0, 0x1\n\
|
||||
_08021044:\n\
|
||||
strb r0, [r6, 0xB]\n\
|
||||
_08021046:\n\
|
||||
pop {r4-r6}\n\
|
||||
pop {r0}\n\
|
||||
bx r0");
|
||||
}
|
||||
#endif // NONMATCHING
|
||||
|
||||
int sub_802104C(void)
|
||||
{
|
||||
struct BerryCrushGame *var0 = sub_8020C00();
|
||||
if (!var0)
|
||||
return -1;
|
||||
|
||||
switch (var0->unkC)
|
||||
{
|
||||
case 0:
|
||||
SetVBlankCallback(NULL);
|
||||
SetHBlankCallback(NULL);
|
||||
SetGpuReg(REG_OFFSET_DISPCNT, 0);
|
||||
ScanlineEffect_Stop();
|
||||
reset_temp_tile_data_buffers();
|
||||
break;
|
||||
case 1:
|
||||
CpuFill16(0, (void *)OAM, OAM_SIZE);
|
||||
gReservedSpritePaletteCount = 0;
|
||||
sub_8034C54(3);
|
||||
break;
|
||||
case 2:
|
||||
ResetPaletteFade();
|
||||
ResetSpriteData();
|
||||
FreeAllSpritePalettes();
|
||||
break;
|
||||
case 3:
|
||||
ResetBgsAndClearDma3BusyFlags(0);
|
||||
InitBgsFromTemplates(0, gUnknown_082F32C8, ARRAY_COUNT(gUnknown_082F32C8));
|
||||
SetBgTilemapBuffer(1, var0->unk1C0);
|
||||
SetBgTilemapBuffer(2, var0->unk21C0);
|
||||
SetBgTilemapBuffer(3, var0->unk31C0);
|
||||
ChangeBgX(0, 0, 0);
|
||||
ChangeBgY(0, 0, 0);
|
||||
ChangeBgX(2, 0, 0);
|
||||
ChangeBgY(2, 0, 0);
|
||||
ChangeBgX(3, 0, 0);
|
||||
ChangeBgY(3, 0, 0);
|
||||
SetGpuReg(REG_OFFSET_BLDCNT, 0);
|
||||
SetGpuReg(REG_OFFSET_BLDALPHA, 0);
|
||||
break;
|
||||
case 4:
|
||||
FillBgTilemapBufferRect_Palette0(0, 0, 0, 0, 32, 32);
|
||||
FillBgTilemapBufferRect_Palette0(1, 0, 0, 0, 32, 64);
|
||||
FillBgTilemapBufferRect_Palette0(2, 0, 0, 0, 32, 32);
|
||||
FillBgTilemapBufferRect_Palette0(3, 0, 0, 0, 32, 32);
|
||||
break;
|
||||
case 5:
|
||||
CopyBgTilemapBufferToVram(0);
|
||||
CopyBgTilemapBufferToVram(1);
|
||||
CopyBgTilemapBufferToVram(2);
|
||||
CopyBgTilemapBufferToVram(3);
|
||||
decompress_and_copy_tile_data_to_vram(1, gUnknown_08DE34B8, 0, 0, 0);
|
||||
break;
|
||||
case 6:
|
||||
if (free_temp_tile_data_buffers_if_possible())
|
||||
return 0;
|
||||
|
||||
InitStandardTextBoxWindows();
|
||||
sub_8197200();
|
||||
sub_8022588(var0);
|
||||
sub_8022600(var0);
|
||||
gPaletteFade.bufferTransferDisabled = 1;
|
||||
break;
|
||||
case 7:
|
||||
LoadPalette(gUnknown_08DE3398, 0, 0x180);
|
||||
CopyToBgTilemapBuffer(1, gBerryCrushGrinderTopTilemap, 0, 0);
|
||||
CopyToBgTilemapBuffer(2, gBerryCrushContainerCapTilemap, 0, 0);
|
||||
CopyToBgTilemapBuffer(3, gBerryCrushBackgroundTilemap, 0, 0);
|
||||
sub_80226D0(var0);
|
||||
CopyBgTilemapBufferToVram(1);
|
||||
CopyBgTilemapBufferToVram(2);
|
||||
CopyBgTilemapBufferToVram(3);
|
||||
break;
|
||||
case 8:
|
||||
sub_800E0E8();
|
||||
CreateWirelessStatusIndicatorSprite(0, 0);
|
||||
sub_8022730(var0);
|
||||
SetGpuReg(REG_OFFSET_BG1VOFS, -gSpriteCoordOffsetY);
|
||||
ChangeBgX(1, 0, 0);
|
||||
ChangeBgY(1, 0, 0);
|
||||
break;
|
||||
case 9:
|
||||
gPaletteFade.bufferTransferDisabled = 0;
|
||||
BlendPalettes(0xFFFFFFFF, 16, RGB_BLACK);
|
||||
ShowBg(0);
|
||||
ShowBg(1);
|
||||
ShowBg(2);
|
||||
ShowBg(3);
|
||||
SetGpuRegBits(REG_OFFSET_DISPCNT, DISPCNT_OBJ_ON | DISPCNT_OBJ_1D_MAP);
|
||||
sub_8020E3C();
|
||||
var0->unkC = 0;
|
||||
return 1;
|
||||
}
|
||||
|
||||
var0->unkC++;
|
||||
return 0;
|
||||
}
|
||||
|
||||
int sub_802130C(void)
|
||||
{
|
||||
struct BerryCrushGame *var0 = sub_8020C00();
|
||||
if (!var0)
|
||||
return -1;
|
||||
|
||||
switch (var0->unkC)
|
||||
{
|
||||
case 0:
|
||||
sub_8010434();
|
||||
break;
|
||||
case 1:
|
||||
if (!IsLinkTaskFinished())
|
||||
return 0;
|
||||
// fall through. The original author forgot to use "break" here
|
||||
// because this will call BeginNormalPaletteFade() twice.
|
||||
case 2:
|
||||
BeginNormalPaletteFade(0xFFFFFFFF, 0, 0, 16, RGB_BLACK);
|
||||
UpdatePaletteFade();
|
||||
break;
|
||||
case 3:
|
||||
if (UpdatePaletteFade())
|
||||
return 0;
|
||||
break;
|
||||
case 4:
|
||||
FillBgTilemapBufferRect_Palette0(0, 0, 0, 0, 32, 32);
|
||||
FillBgTilemapBufferRect_Palette0(1, 0, 0, 0, 32, 32);
|
||||
FillBgTilemapBufferRect_Palette0(2, 0, 0, 0, 32, 32);
|
||||
FillBgTilemapBufferRect_Palette0(3, 0, 0, 0, 32, 32);
|
||||
CopyBgTilemapBufferToVram(0);
|
||||
CopyBgTilemapBufferToVram(1);
|
||||
CopyBgTilemapBufferToVram(2);
|
||||
CopyBgTilemapBufferToVram(3);
|
||||
break;
|
||||
case 5:
|
||||
FreeAllWindowBuffers();
|
||||
HideBg(0);
|
||||
UnsetBgTilemapBuffer(0);
|
||||
HideBg(1);
|
||||
UnsetBgTilemapBuffer(1);
|
||||
HideBg(2);
|
||||
UnsetBgTilemapBuffer(2);
|
||||
HideBg(3);
|
||||
UnsetBgTilemapBuffer(3);
|
||||
ClearGpuRegBits(REG_OFFSET_DISPCNT, DISPCNT_OBJ_ON | DISPCNT_OBJ_1D_MAP);
|
||||
break;
|
||||
case 6:
|
||||
DestroyWirelessStatusIndicatorSprite();
|
||||
sub_8022960(var0);
|
||||
sub_8034CC8();
|
||||
break;
|
||||
case 7:
|
||||
var0->unkC = 0;
|
||||
return 1;
|
||||
}
|
||||
|
||||
var0->unkC++;
|
||||
return 0;
|
||||
}
|
||||
|
||||
static int sub_8021450(struct BerryCrushGame *arg0)
|
||||
{
|
||||
gSpriteCoordOffsetY = arg0->unk2A + arg0->unk2C;
|
||||
SetGpuReg(REG_OFFSET_BG1VOFS, -gSpriteCoordOffsetY);
|
||||
if (arg0->unk12 == 7)
|
||||
{
|
||||
sub_8022524(&arg0->unk138, arg0->unk28);
|
||||
}
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
void sub_8021488(struct BerryCrushGame *arg0)
|
||||
{
|
||||
arg0->unk2A = -104;
|
||||
arg0->unk2C = 0;
|
||||
gSpriteCoordOffsetX = 0;
|
||||
gSpriteCoordOffsetY = -104;
|
||||
}
|
||||
|
||||
void sub_80214A8(struct BerryCrushGame *arg0, struct BerryCrushGame_138 *arg1)
|
||||
{
|
||||
u8 i;
|
||||
u8 spriteId;
|
||||
s16 var0, var1;
|
||||
s16 *data;
|
||||
int var3;
|
||||
s16 var5;
|
||||
u32 var6;
|
||||
|
||||
for (i = 0; i < arg0->unk9; i++)
|
||||
{
|
||||
spriteId = AddCustomItemIconSprite(
|
||||
&gUnknown_082F436C,
|
||||
gUnknown_082F41E8[i],
|
||||
gUnknown_082F41E8[i],
|
||||
arg0->unk84.separate.others[i].unk0 + 133);
|
||||
arg1->unk38[i] = &gSprites[spriteId];
|
||||
arg1->unk38[i]->oam.priority = 3;
|
||||
arg1->unk38[i]->affineAnimPaused = 1;
|
||||
arg1->unk38[i]->pos1.x = arg1->unkC[i]->unk8 + 120;
|
||||
arg1->unk38[i]->pos1.y = -16;
|
||||
data = arg1->unk38[i]->data;
|
||||
var5 = 512;
|
||||
data[1] = var5;
|
||||
data[2] = 32;
|
||||
data[7] = 112;
|
||||
var0 = arg1->unkC[i]->unkA - arg1->unkC[i]->unk8;
|
||||
var3 = var0;
|
||||
if (var0 < 0)
|
||||
var3 += 3;
|
||||
|
||||
data[6] = var3 >> 2;
|
||||
var0 *= 128;
|
||||
var6 = var5 + 32;
|
||||
var6 = var6 / 2;
|
||||
var1 = sub_81515D4(7, 0x3F80, var6);
|
||||
data[0] = (u16)arg1->unk38[i]->pos1.x * 128;
|
||||
data[3] = sub_81515D4(7, var0, var1);
|
||||
var1 = sub_8151550(7, var1, 85);
|
||||
data[4] = 0;
|
||||
data[5] = sub_81515D4(7, 0x3F80, var1);
|
||||
data[7] |= 0x8000;
|
||||
if (arg1->unkC[i]->unk8 < 0)
|
||||
StartSpriteAffineAnim(arg1->unk38[i], 1);
|
||||
}
|
||||
}
|
||||
|
||||
void sub_8021608(struct Sprite *sprite)
|
||||
{
|
||||
s16 *data = sprite->data;
|
||||
|
||||
data[1] += data[2];
|
||||
sprite->pos2.y += data[1] >> 8;
|
||||
if (data[7] & 0x8000)
|
||||
{
|
||||
sprite->data[0] += data[3];
|
||||
data[4] += data[5];
|
||||
sprite->pos2.x = Sin(data[4] >> 7, data[6]);
|
||||
if ((data[7] & 0x8000) && (data[4] >> 7) > 126)
|
||||
{
|
||||
sprite->pos2.x = 0;
|
||||
data[7] &= 0x7FFF;
|
||||
}
|
||||
}
|
||||
|
||||
sprite->pos1.x = data[0] >> 7;
|
||||
if (sprite->pos1.y + sprite->pos2.y >= (data[7] & 0x7FFF))
|
||||
{
|
||||
sprite->callback = SpriteCallbackDummy;
|
||||
FreeSpriteOamMatrix(sprite);
|
||||
DestroySprite(sprite);
|
||||
}
|
||||
}
|
||||
|
||||
void sub_80216A8(struct BerryCrushGame *arg0)
|
||||
{
|
||||
u8 i;
|
||||
for (i = 0; i < arg0->unk9; i++)
|
||||
{
|
||||
FreeSpritePaletteByTag(gUnknown_082F41E8[i]);
|
||||
FreeSpriteTilesByTag(gUnknown_082F41E8[i]);
|
||||
}
|
||||
}
|
||||
|
||||
// void sub_80216E0(struct BerryCrushGame *arg0, struct BerryCrushGame_138 *arg1)
|
||||
// {
|
||||
// u8 sp4;
|
||||
// struct BerryCrushGame_4E *var4E;
|
||||
// u8 i;
|
||||
// u16 var0;
|
||||
|
||||
// sp4 = 0;
|
||||
// var4E = &arg0->unk40.unkE;
|
||||
// for (i = 0; i < arg0->unk9; i++)
|
||||
// {
|
||||
// var0 = var4E->unkA >> (i * 3);
|
||||
// var0 &= 7;
|
||||
// if (var0)
|
||||
// {
|
||||
// int offset;
|
||||
// sp4++;
|
||||
// if (var0 & 0x4)
|
||||
// StartSpriteAnim(arg1->unk24[i], 1);
|
||||
// else
|
||||
// StartSpriteAnim(arg1->unk24[i], 0);
|
||||
|
||||
// arg1->unk24[i]->invisible = 0;
|
||||
// arg1->unk24[i]->animPaused = 0;
|
||||
// offset = (var0 % 4) - 1;
|
||||
// arg1->unk24[i]->pos2.x = gUnknown_082F41CC[offset][0];
|
||||
// arg1->unk24[i]->pos2.y = gUnknown_082F41CC[offset][1];
|
||||
// }
|
||||
// }
|
||||
|
||||
// if (sp4 == 0)
|
||||
// {
|
||||
// arg0->unk25_2 = 0;
|
||||
// }
|
||||
// else
|
||||
// {
|
||||
// u8 var3 = arg0->unk28 % 3;
|
||||
// u16 var2 = var3;
|
||||
// for (i = 0; i < var4E->unkC * 2 + 3; i++)
|
||||
// {
|
||||
// if (arg1->unk4C[i]->invisible)
|
||||
// {
|
||||
// arg1->unk4C[i]->callback = sub_8022B28;
|
||||
// arg1->unk4C[i]->pos1.x = gUnknown_082F41D2[i][0] + 120;
|
||||
// arg1->unk4C[i]->pos1.y = gUnknown_082F41D2[i][1] + (136 - var2 * 4);
|
||||
// arg1->unk4C[i]->pos2.x = gUnknown_082F41D2[i][0] / (var3 * 4);
|
||||
// arg1->unk4C[i]->pos2.y = gUnknown_082F41D2[i][1];
|
||||
// if (var4E->unk4 & 0x2)
|
||||
// StartSpriteAnim(arg1->unk4C[i], 1);
|
||||
// else
|
||||
// StartSpriteAnim(arg1->unk4C[i], 0);
|
||||
|
||||
// var2++;
|
||||
// if (var2 > 3)
|
||||
// var2 = 0;
|
||||
// }
|
||||
// }
|
||||
|
||||
// if (arg0->unk25_2)
|
||||
// {
|
||||
// arg0->unk25_2 = 0;
|
||||
// }
|
||||
// else
|
||||
// {
|
||||
// if (sp4 == 1)
|
||||
// PlaySE(SE_TOY_DANGO);
|
||||
// else
|
||||
// PlaySE(SE_TOY_KABE);
|
||||
|
||||
// arg0->unk25_2 = 1;
|
||||
// }
|
||||
// }
|
||||
// }
|
||||
+36
-36
@@ -25,42 +25,42 @@ EWRAM_DATA static u8 sBraillePuzzleCallbackFlag = 0;
|
||||
|
||||
static const u8 gRegicePathCoords[][2] =
|
||||
{
|
||||
{0x04, 0x15},
|
||||
{0x05, 0x15},
|
||||
{0x06, 0x15},
|
||||
{0x07, 0x15},
|
||||
{0x08, 0x15},
|
||||
{0x09, 0x15},
|
||||
{0x0a, 0x15},
|
||||
{0x0b, 0x15},
|
||||
{0x0c, 0x15},
|
||||
{0x0c, 0x16},
|
||||
{0x0c, 0x17},
|
||||
{0x0d, 0x17},
|
||||
{0x0d, 0x18},
|
||||
{0x0d, 0x19},
|
||||
{0x0d, 0x1a},
|
||||
{0x0d, 0x1b},
|
||||
{0x0c, 0x1b},
|
||||
{0x0c, 0x1c},
|
||||
{0x04, 0x1d},
|
||||
{0x05, 0x1d},
|
||||
{0x06, 0x1d},
|
||||
{0x07, 0x1d},
|
||||
{0x08, 0x1d},
|
||||
{0x09, 0x1d},
|
||||
{0x0a, 0x1d},
|
||||
{0x0b, 0x1d},
|
||||
{0x0c, 0x1d},
|
||||
{0x04, 0x1c},
|
||||
{0x04, 0x1b},
|
||||
{0x03, 0x1b},
|
||||
{0x03, 0x1a},
|
||||
{0x03, 0x19},
|
||||
{0x03, 0x18},
|
||||
{0x03, 0x17},
|
||||
{0x04, 0x17},
|
||||
{0x04, 0x16},
|
||||
{4, 21},
|
||||
{5, 21},
|
||||
{6, 21},
|
||||
{7, 21},
|
||||
{8, 21},
|
||||
{9, 21},
|
||||
{10, 21},
|
||||
{11, 21},
|
||||
{12, 21},
|
||||
{12, 22},
|
||||
{12, 23},
|
||||
{13, 23},
|
||||
{13, 24},
|
||||
{13, 25},
|
||||
{13, 26},
|
||||
{13, 27},
|
||||
{12, 27},
|
||||
{12, 28},
|
||||
{4, 29},
|
||||
{5, 29},
|
||||
{6, 29},
|
||||
{7, 29},
|
||||
{8, 29},
|
||||
{9, 29},
|
||||
{10, 29},
|
||||
{11, 29},
|
||||
{12, 29},
|
||||
{4, 28},
|
||||
{4, 27},
|
||||
{3, 27},
|
||||
{3, 26},
|
||||
{3, 25},
|
||||
{3, 24},
|
||||
{3, 23},
|
||||
{4, 23},
|
||||
{4, 22},
|
||||
};
|
||||
|
||||
void SealedChamberShakingEffect(u8);
|
||||
|
||||
@@ -6,7 +6,7 @@
|
||||
|
||||
void sub_8110368(struct Sprite *);
|
||||
void sub_8110438(struct Sprite *);
|
||||
void sub_81104E4(struct Sprite *);
|
||||
void AnimTranslateWebThread(struct Sprite *);
|
||||
void sub_81105B4(struct Sprite *);
|
||||
void sub_811067C(struct Sprite *);
|
||||
void AnimTranslateStinger(struct Sprite *);
|
||||
@@ -90,7 +90,7 @@ const struct SpriteTemplate gUnknown_085969C8 =
|
||||
.callback = sub_8110438,
|
||||
};
|
||||
|
||||
const struct SpriteTemplate gUnknown_085969E0 =
|
||||
const struct SpriteTemplate gWebThreadSpriteTemplate =
|
||||
{
|
||||
.tileTag = ANIM_TAG_WEB_THREAD,
|
||||
.paletteTag = ANIM_TAG_WEB_THREAD,
|
||||
@@ -98,7 +98,7 @@ const struct SpriteTemplate gUnknown_085969E0 =
|
||||
.anims = gDummySpriteAnimTable,
|
||||
.images = NULL,
|
||||
.affineAnims = gDummySpriteAffineAnimTable,
|
||||
.callback = sub_81104E4,
|
||||
.callback = AnimTranslateWebThread,
|
||||
};
|
||||
|
||||
const struct SpriteTemplate gUnknown_085969F8 =
|
||||
@@ -124,7 +124,7 @@ const union AffineAnimCmd *const gUnknown_08596A28[] =
|
||||
gUnknown_08596A10,
|
||||
};
|
||||
|
||||
const struct SpriteTemplate gUnknown_08596A2C =
|
||||
const struct SpriteTemplate gSpiderWebSpriteTemplate =
|
||||
{
|
||||
.tileTag = ANIM_TAG_SPIDER_WEB,
|
||||
.paletteTag = ANIM_TAG_SPIDER_WEB,
|
||||
@@ -247,12 +247,19 @@ void sub_8110438(struct Sprite *sprite)
|
||||
StoreSpriteCallbackInData6(sprite, DestroyAnimSprite);
|
||||
}
|
||||
|
||||
void sub_81104E4(struct Sprite *sprite)
|
||||
// Creates a single web thread that travels from attacker to target.
|
||||
// Used by MOVE_STRING_SHOT and MOVE_SPIDER_WEB in their first move phase.
|
||||
// arg 0: x
|
||||
// arg 1: y
|
||||
// arg 2: controls the left-to-right movement
|
||||
// arg 3: amplitude
|
||||
// arg 4: if targets both opponents
|
||||
void AnimTranslateWebThread(struct Sprite *sprite)
|
||||
{
|
||||
if (IsContest())
|
||||
gBattleAnimArgs[2] /= 2;
|
||||
|
||||
InitSpritePosToAnimAttacker(sprite, 1);
|
||||
InitSpritePosToAnimAttacker(sprite, TRUE);
|
||||
sprite->data[0] = gBattleAnimArgs[2];
|
||||
sprite->data[1] = sprite->pos1.x;
|
||||
sprite->data[3] = sprite->pos1.y;
|
||||
|
||||
Executable → Regular
+35
-18
@@ -151,25 +151,46 @@ const struct SpritePalette gUnknown_085CDB74[] = {
|
||||
{ }
|
||||
};
|
||||
|
||||
const struct OamData gOamData_85CDB84 = {
|
||||
const struct OamData gOamData_85CDB84 =
|
||||
{
|
||||
.y = 0,
|
||||
.affineMode = ST_OAM_AFFINE_DOUBLE,
|
||||
.objMode = ST_OAM_OBJ_NORMAL,
|
||||
.bpp = ST_OAM_4BPP,
|
||||
.shape = SPRITE_SHAPE(64x64),
|
||||
.x = 0,
|
||||
.size = SPRITE_SIZE(64x64),
|
||||
.priority = 2
|
||||
.tileNum = 0,
|
||||
.priority = 2,
|
||||
.paletteNum = 0,
|
||||
};
|
||||
|
||||
const struct OamData gOamData_85CDB8C = {
|
||||
const struct OamData gOamData_85CDB8C =
|
||||
{
|
||||
.y = 0,
|
||||
.affineMode = ST_OAM_AFFINE_DOUBLE,
|
||||
.objMode = ST_OAM_OBJ_NORMAL,
|
||||
.bpp = ST_OAM_4BPP,
|
||||
.shape = SPRITE_SHAPE(16x8),
|
||||
.x = 0,
|
||||
.size = SPRITE_SIZE(16x8),
|
||||
.priority = 2
|
||||
.tileNum = 0,
|
||||
.priority = 2,
|
||||
.paletteNum = 0,
|
||||
};
|
||||
|
||||
const struct OamData gOamData_85CDB94 = {
|
||||
const struct OamData gOamData_85CDB94 =
|
||||
{
|
||||
.y = 0,
|
||||
.affineMode = ST_OAM_AFFINE_DOUBLE,
|
||||
.objMode = ST_OAM_OBJ_NORMAL,
|
||||
.bpp = ST_OAM_4BPP,
|
||||
.shape = SPRITE_SHAPE(16x16),
|
||||
.x = 0,
|
||||
.size = SPRITE_SIZE(16x16),
|
||||
.priority = 2
|
||||
.tileNum = 0,
|
||||
.priority = 2,
|
||||
.paletteNum = 0,
|
||||
};
|
||||
|
||||
const struct SpriteTemplate gSpriteTemplate_85CDB9C[] =
|
||||
@@ -407,13 +428,12 @@ static void sub_81503E4(u8 taskId)
|
||||
case WEATHER_ASH:
|
||||
if (gWeatherPtr->sprites.s2.ashSprites[0] != NULL && gWeatherPtr->sprites.s2.ashSprites[0]->oam.priority != 0)
|
||||
{
|
||||
for (; i < 20; i++)
|
||||
for (; i < NUM_ASH_SPRITES; i++)
|
||||
{
|
||||
if (gWeatherPtr->sprites.s2.ashSprites[i] != NULL)
|
||||
{
|
||||
if (gWeatherPtr->sprites.s2.ashSprites[i])
|
||||
gWeatherPtr->sprites.s2.ashSprites[i]->oam.priority = 0;
|
||||
}
|
||||
}
|
||||
|
||||
sCableCar->state = 2;
|
||||
}
|
||||
break;
|
||||
@@ -424,12 +444,10 @@ static void sub_81503E4(u8 taskId)
|
||||
}
|
||||
else if (sCableCar->timer >= sCableCar->unk4 + 8)
|
||||
{
|
||||
for (; i < 20; i++)
|
||||
for (; i < NUM_ASH_SPRITES; i++)
|
||||
{
|
||||
if (gWeatherPtr->sprites.s2.ashSprites[i] != NULL)
|
||||
{
|
||||
gWeatherPtr->sprites.s2.ashSprites[i]->invisible ^= TRUE;
|
||||
}
|
||||
if (gWeatherPtr->sprites.s2.ashSprites[i])
|
||||
gWeatherPtr->sprites.s2.ashSprites[i]->invisible ^= 1;
|
||||
}
|
||||
}
|
||||
break;
|
||||
@@ -445,9 +463,7 @@ static void sub_81503E4(u8 taskId)
|
||||
break;
|
||||
case 3:
|
||||
if (!gPaletteFade.active)
|
||||
{
|
||||
sCableCar->state = 0xFF;
|
||||
}
|
||||
break;
|
||||
case 0xFF:
|
||||
SetVBlankCallback(NULL);
|
||||
@@ -536,7 +552,7 @@ static void sub_8150664(u8 taskId)
|
||||
if (sCableCar->timer < sCableCar->unk4)
|
||||
gSpriteCoordOffsetX = (gSpriteCoordOffsetX + 247) % 248;
|
||||
else
|
||||
gWeatherPtr->unknown_6FC = (gWeatherPtr->unknown_6FC + 247) % 248;
|
||||
gWeatherPtr->ashBaseSpritesX = (gWeatherPtr->ashBaseSpritesX + 247) % 248;
|
||||
}
|
||||
|
||||
static void CableCarVblankCallback(void)
|
||||
@@ -1007,3 +1023,4 @@ static void sub_81514C8(u8 arg0)
|
||||
|
||||
sCableCar->unk1C = 0;
|
||||
}
|
||||
|
||||
|
||||
+2
-1
@@ -17,7 +17,8 @@
|
||||
#include "menu.h"
|
||||
#include "overworld.h"
|
||||
#include "palette.h"
|
||||
#include "rom_8011DC0.h"
|
||||
#include "union_room.h"
|
||||
#include "mevent2.h"
|
||||
#include "script.h"
|
||||
#include "script_pokemon_util_80F87D8.h"
|
||||
#include "sound.h"
|
||||
|
||||
+600
-33
@@ -218,12 +218,6 @@ EWRAM_DATA u8 gUnknown_02039F5D = 0;
|
||||
// IWRAM common vars.
|
||||
u32 gContestRngValue;
|
||||
|
||||
extern const u16 gUnknown_08587C30[];
|
||||
extern const struct BgTemplate gUnknown_08587F34[4];
|
||||
extern const struct WindowTemplate gUnknown_08587F44[];
|
||||
extern const u8 *const gUnknown_08587D90[];
|
||||
extern const u8 *const gUnknown_08587F08[];
|
||||
extern const u8 *const gUnknown_08587F1C[];
|
||||
extern const u8 *const gUnknown_0827E8DA[];
|
||||
extern const u8 gText_0827D55A[];
|
||||
extern const u8 gText_0827E793[];
|
||||
@@ -248,33 +242,604 @@ extern const u8 gText_Contest_Fear[];
|
||||
extern const u8 gText_BDot[];
|
||||
extern const u8 gText_CDot[];
|
||||
extern const u8 *const gUnknown_08587E10[];
|
||||
extern const struct ContestPokemon gContestOpponents[96];
|
||||
extern const u8 gUnknown_085898A4[96];
|
||||
extern const struct CompressedSpriteSheet gUnknown_08587C00;
|
||||
extern const struct SpriteTemplate gSpriteTemplate_8587BE8;
|
||||
extern const struct CompressedSpriteSheet gUnknown_08587C08;
|
||||
extern const struct CompressedSpritePalette gUnknown_08587C10;
|
||||
extern const struct SpriteTemplate gSpriteTemplate_8587C18;
|
||||
extern const union AffineAnimCmd *const gUnknown_082FF6C0[];
|
||||
extern const union AffineAnimCmd *const gUnknown_082FF694[];
|
||||
extern const u8 *const gContestEffectDescriptionPointers[];
|
||||
extern const struct SpriteSheet gUnknown_08587A74;
|
||||
extern const u8 gUnknown_08587A6C[];
|
||||
extern const struct SpriteTemplate gSpriteTemplate_8587AD0;
|
||||
extern const struct SpritePalette gUnknown_08587B08;
|
||||
extern const struct CompressedSpriteSheet gUnknown_08587AE8[];
|
||||
extern const struct SpriteTemplate gSpriteTemplate_8587B18[];
|
||||
extern const u8 gUnknown_08587A70[];
|
||||
extern const struct SubspriteTable gSubspriteTables_8587B80[];
|
||||
extern const struct CompressedSpriteSheet gUnknown_08587BB0;
|
||||
extern const struct SpritePalette gUnknown_08587BB8;
|
||||
extern const struct SpriteTemplate gSpriteTemplate_8587BC8;
|
||||
extern void (*const gContestEffectFuncs[])(void);
|
||||
extern const s8 gContestExcitementTable[][5];
|
||||
extern const struct ContestWinner gUnknown_08587FA4[];
|
||||
extern const struct CompressedSpriteSheet gUnknown_08589904[];
|
||||
extern const struct SpritePalette gUnknown_08589924[];
|
||||
extern const struct SpriteTemplate gSpriteTemplate_858998C[];
|
||||
|
||||
static const u8 gUnknown_08587A6C[] =
|
||||
{
|
||||
0x24, 0x4C, 0x74, 0x9C
|
||||
};
|
||||
|
||||
static const u8 gUnknown_08587A70[] =
|
||||
{
|
||||
0x24, 0x4C, 0x74, 0x9C
|
||||
};
|
||||
|
||||
static const struct SpriteSheet gUnknown_08587A74 =
|
||||
{
|
||||
.data = gTiles_8C19450,
|
||||
.size = 0x20,
|
||||
.tag = 0x4E20
|
||||
};
|
||||
|
||||
static const struct OamData gOamData_8587A7C =
|
||||
{
|
||||
.y = 0,
|
||||
.affineMode = 0,
|
||||
.objMode = 0,
|
||||
.mosaic = 0,
|
||||
.bpp = 0,
|
||||
.shape = SPRITE_SHAPE(8x8),
|
||||
.x = 0,
|
||||
.matrixNum = 0,
|
||||
.size = SPRITE_SIZE(8x8),
|
||||
.tileNum = 0,
|
||||
.priority = 0,
|
||||
.paletteNum = 0,
|
||||
.affineParam = 0
|
||||
};
|
||||
|
||||
static const union AffineAnimCmd gSpriteAffineAnim_8587A84[] =
|
||||
{
|
||||
AFFINEANIMCMD_FRAME(0x100, 0x100, 0, 0),
|
||||
AFFINEANIMCMD_END,
|
||||
};
|
||||
|
||||
static const union AffineAnimCmd gSpriteAffineAnim_8587A94[] =
|
||||
{
|
||||
AFFINEANIMCMD_FRAME(0x100, 0x100, 0, 0),
|
||||
AFFINEANIMCMD_FRAME(0xFFF6, 0xFFF6, -20, 20),
|
||||
AFFINEANIMCMD_END
|
||||
};
|
||||
|
||||
static const union AffineAnimCmd gSpriteAffineAnim_8587AAC[] =
|
||||
{
|
||||
AFFINEANIMCMD_FRAME(0x38, 0x38, 0, 0),
|
||||
AFFINEANIMCMD_FRAME(10, 10, 20, 20),
|
||||
AFFINEANIMCMD_END
|
||||
};
|
||||
|
||||
static const union AffineAnimCmd* const gSpriteAffineAnimTable_8587AC4[] =
|
||||
{
|
||||
gSpriteAffineAnim_8587A84,
|
||||
gSpriteAffineAnim_8587A94,
|
||||
gSpriteAffineAnim_8587AAC
|
||||
};
|
||||
|
||||
static const struct SpriteTemplate gSpriteTemplate_8587AD0 =
|
||||
{
|
||||
.tileTag = 0x4E20,
|
||||
.paletteTag = 0xABE0,
|
||||
.oam = &gOamData_8587A7C,
|
||||
.anims = gDummySpriteAnimTable,
|
||||
.images = NULL,
|
||||
.affineAnims = gSpriteAffineAnimTable_8587AC4,
|
||||
.callback = SpriteCallbackDummy
|
||||
};
|
||||
|
||||
static const struct CompressedSpriteSheet gUnknown_08587AE8[] =
|
||||
{
|
||||
{
|
||||
.data = gContestNextTurnGfx,
|
||||
.size = 0x100,
|
||||
.tag = 0x4E22
|
||||
},
|
||||
{
|
||||
.data = gContestNextTurnGfx,
|
||||
.size = 0x100,
|
||||
.tag = 0x4E23
|
||||
},
|
||||
{
|
||||
.data = gContestNextTurnGfx,
|
||||
.size = 0x100,
|
||||
.tag = 0x4E24
|
||||
},
|
||||
{
|
||||
.data = gContestNextTurnGfx,
|
||||
.size = 0x100,
|
||||
.tag = 0x4E25
|
||||
}
|
||||
};
|
||||
|
||||
static const struct SpritePalette gUnknown_08587B08 =
|
||||
{
|
||||
.data = gContestPal,
|
||||
.tag = 0x4E22
|
||||
};
|
||||
|
||||
static const struct OamData gOamData_8587B10 =
|
||||
{
|
||||
.y = 0,
|
||||
.affineMode = 0,
|
||||
.objMode = 0,
|
||||
.mosaic = 0,
|
||||
.bpp = 0,
|
||||
.shape = SPRITE_SHAPE(32x8),
|
||||
.x = 0,
|
||||
.matrixNum = 0,
|
||||
.size = SPRITE_SIZE(32x8),
|
||||
.tileNum = 0,
|
||||
.priority = 0,
|
||||
.paletteNum = 0,
|
||||
.affineParam = 0
|
||||
};
|
||||
|
||||
static const struct SpriteTemplate gSpriteTemplate_8587B18[] =
|
||||
{
|
||||
{
|
||||
.tileTag = 0x4E22,
|
||||
.paletteTag = 0x4E22,
|
||||
.oam = &gOamData_8587B10,
|
||||
.anims = gDummySpriteAnimTable,
|
||||
.images = NULL,
|
||||
.affineAnims = gDummySpriteAffineAnimTable,
|
||||
.callback = SpriteCallbackDummy,
|
||||
},
|
||||
{
|
||||
.tileTag = 0x4E23,
|
||||
.paletteTag = 0x4E22,
|
||||
.oam = &gOamData_8587B10,
|
||||
.anims = gDummySpriteAnimTable,
|
||||
.images = NULL,
|
||||
.affineAnims = gDummySpriteAffineAnimTable,
|
||||
.callback = SpriteCallbackDummy,
|
||||
},
|
||||
{
|
||||
.tileTag = 0x4E24,
|
||||
.paletteTag = 0x4E22,
|
||||
.oam = &gOamData_8587B10,
|
||||
.anims = gDummySpriteAnimTable,
|
||||
.images = NULL,
|
||||
.affineAnims = gDummySpriteAffineAnimTable,
|
||||
.callback = SpriteCallbackDummy,
|
||||
},
|
||||
{
|
||||
.tileTag = 0x4E25,
|
||||
.paletteTag = 0x4E22,
|
||||
.oam = &gOamData_8587B10,
|
||||
.anims = gDummySpriteAnimTable,
|
||||
.images = NULL,
|
||||
.affineAnims = gDummySpriteAffineAnimTable,
|
||||
.callback = SpriteCallbackDummy,
|
||||
}
|
||||
};
|
||||
|
||||
const struct Subsprite gSubspriteTable_8587B78[] =
|
||||
{
|
||||
{
|
||||
.x = -28,
|
||||
.y = -4,
|
||||
.shape = ST_OAM_H_RECTANGLE,
|
||||
.size = 1,
|
||||
.tileOffset = 0,
|
||||
.priority = 0
|
||||
},
|
||||
{
|
||||
.x = 4,
|
||||
.y = -4,
|
||||
.shape = ST_OAM_H_RECTANGLE,
|
||||
.size = 1,
|
||||
.tileOffset = 4,
|
||||
.priority = 0
|
||||
}
|
||||
};
|
||||
|
||||
const struct SubspriteTable gSubspriteTables_8587B80[] =
|
||||
{
|
||||
{
|
||||
.subspriteCount = 2,
|
||||
.subsprites = gSubspriteTable_8587B78
|
||||
}
|
||||
};
|
||||
|
||||
const struct CompressedSpriteSheet gUnknown_08587B88 =
|
||||
{
|
||||
.data = gUnknown_08C19168,
|
||||
.size = 0x180,
|
||||
.tag = 0xABE1
|
||||
};
|
||||
|
||||
const struct OamData gOamData_8587B90 =
|
||||
{
|
||||
.y = 0,
|
||||
.affineMode = ST_OAM_AFFINE_OFF,
|
||||
.objMode = ST_OAM_OBJ_NORMAL,
|
||||
.bpp = ST_OAM_4BPP,
|
||||
.shape = SPRITE_SHAPE(16x16),
|
||||
.x = 0,
|
||||
.size = SPRITE_SIZE(16x16),
|
||||
.tileNum = 0,
|
||||
.priority = 0,
|
||||
.paletteNum = 0,
|
||||
};
|
||||
|
||||
const struct SpriteTemplate gSpriteTemplate_8587B98 =
|
||||
{
|
||||
.tileTag = 0xABE1,
|
||||
.paletteTag = 0xABE0,
|
||||
.oam = &gOamData_8587B90,
|
||||
.anims = gDummySpriteAnimTable,
|
||||
.images = NULL,
|
||||
.affineAnims = gDummySpriteAffineAnimTable,
|
||||
.callback = SpriteCallbackDummy
|
||||
};
|
||||
|
||||
const struct CompressedSpriteSheet gUnknown_08587BB0 =
|
||||
{
|
||||
.data = gContestApplauseGfx,
|
||||
.size = 0x400,
|
||||
.tag = 0xABE2
|
||||
};
|
||||
|
||||
const struct SpritePalette gUnknown_08587BB8 =
|
||||
{
|
||||
.data = gContestPal,
|
||||
.tag = 0xABE2
|
||||
};
|
||||
|
||||
const struct OamData gOamData_8587BC0 =
|
||||
{
|
||||
.y = 0,
|
||||
.affineMode = ST_OAM_AFFINE_OFF,
|
||||
.objMode = ST_OAM_OBJ_NORMAL,
|
||||
.bpp = ST_OAM_4BPP,
|
||||
.shape = SPRITE_SHAPE(64x32),
|
||||
.x = 0,
|
||||
.size = SPRITE_SIZE(64x32),
|
||||
.tileNum = 0,
|
||||
.priority = 0,
|
||||
.paletteNum = 0,
|
||||
};
|
||||
|
||||
const struct SpriteTemplate gSpriteTemplate_8587BC8 =
|
||||
{
|
||||
.tileTag = 0xABE2,
|
||||
.paletteTag = 0xABE2,
|
||||
.oam = &gOamData_8587BC0,
|
||||
.anims = gDummySpriteAnimTable,
|
||||
.images = NULL,
|
||||
.affineAnims = gDummySpriteAffineAnimTable,
|
||||
.callback = SpriteCallbackDummy
|
||||
};
|
||||
|
||||
const struct OamData gOamData_8587BE0 =
|
||||
{
|
||||
.y = 0,
|
||||
.affineMode = ST_OAM_AFFINE_OFF,
|
||||
.objMode = ST_OAM_OBJ_NORMAL,
|
||||
.bpp = ST_OAM_4BPP,
|
||||
.shape = SPRITE_SHAPE(64x64),
|
||||
.x = 0,
|
||||
.size = SPRITE_SIZE(64x64),
|
||||
.tileNum = 0,
|
||||
.priority = 3,
|
||||
.paletteNum = 2,
|
||||
};
|
||||
|
||||
const struct SpriteTemplate gSpriteTemplate_8587BE8 =
|
||||
{
|
||||
.tileTag = 0x4E21,
|
||||
.paletteTag = 0x4E21,
|
||||
.oam = &gOamData_8587BE0,
|
||||
.anims = gDummySpriteAnimTable,
|
||||
.images = NULL,
|
||||
.affineAnims = gDummySpriteAffineAnimTable,
|
||||
.callback = SpriteCallbackDummy
|
||||
};
|
||||
|
||||
const struct CompressedSpriteSheet gUnknown_08587C00 =
|
||||
{
|
||||
.data = gContestJudgeGfx,
|
||||
.size = 0x800,
|
||||
.tag = 0x4E21
|
||||
};
|
||||
|
||||
const struct CompressedSpriteSheet gUnknown_08587C08 =
|
||||
{
|
||||
.data = gContestJudgeSymbolsGfx,
|
||||
.size = 0x380,
|
||||
.tag = 0xABE0
|
||||
};
|
||||
|
||||
const struct CompressedSpritePalette gUnknown_08587C10 =
|
||||
{
|
||||
.data = gContest3Pal,
|
||||
.tag = 0xABE0
|
||||
};
|
||||
|
||||
const struct SpriteTemplate gSpriteTemplate_8587C18 =
|
||||
{
|
||||
.tileTag = 0xABE0,
|
||||
.paletteTag = 0xABE0,
|
||||
.oam = &gUnknown_0852490C,
|
||||
.anims = gDummySpriteAnimTable,
|
||||
.images = NULL,
|
||||
.affineAnims = gDummySpriteAffineAnimTable,
|
||||
.callback = SpriteCallbackDummy
|
||||
};
|
||||
|
||||
const u16 gUnknown_08587C30[] = INCBIN_U16("graphics/unknown/unknown_587C30.gbapal");
|
||||
|
||||
#include "data/contest_text_tables.h"
|
||||
|
||||
const struct BgTemplate gUnknown_08587F34[] =
|
||||
{
|
||||
{
|
||||
.bg = 0,
|
||||
.charBaseIndex = 0,
|
||||
.mapBaseIndex = 0x18,
|
||||
.screenSize = 2,
|
||||
.paletteMode = 0,
|
||||
.priority = 0,
|
||||
.baseTile = 0
|
||||
},
|
||||
{
|
||||
.bg = 1,
|
||||
.charBaseIndex = 2,
|
||||
.mapBaseIndex = 0x1E,
|
||||
.screenSize = 2,
|
||||
.paletteMode = 0,
|
||||
.priority = 1,
|
||||
.baseTile = 0
|
||||
},
|
||||
{
|
||||
.bg = 2,
|
||||
.charBaseIndex = 0,
|
||||
.mapBaseIndex = 0x1C,
|
||||
.screenSize = 2,
|
||||
.paletteMode = 0,
|
||||
.priority = 0,
|
||||
.baseTile = 0
|
||||
},
|
||||
{
|
||||
.bg = 3,
|
||||
.charBaseIndex = 0,
|
||||
.mapBaseIndex = 0x1A,
|
||||
.screenSize = 0,
|
||||
.paletteMode = 0,
|
||||
.priority = 3,
|
||||
.baseTile = 0
|
||||
}
|
||||
};
|
||||
|
||||
const struct WindowTemplate gUnknown_08587F44[] =
|
||||
{
|
||||
{
|
||||
.bg = 0,
|
||||
.tilemapLeft = 18,
|
||||
.tilemapTop = 0,
|
||||
.width = 12,
|
||||
.height = 2,
|
||||
.paletteNum = 0xF,
|
||||
.baseBlock = 0x200
|
||||
},
|
||||
{
|
||||
.bg = 0,
|
||||
.tilemapLeft = 18,
|
||||
.tilemapTop = 5,
|
||||
.width = 12,
|
||||
.height = 2,
|
||||
.paletteNum = 0xF,
|
||||
.baseBlock = 0x218
|
||||
},
|
||||
{
|
||||
.bg = 0,
|
||||
.tilemapLeft = 18,
|
||||
.tilemapTop = 10,
|
||||
.width = 12,
|
||||
.height = 2,
|
||||
.paletteNum = 0xF,
|
||||
.baseBlock = 0x230
|
||||
},
|
||||
{
|
||||
.bg = 0,
|
||||
.tilemapLeft = 18,
|
||||
.tilemapTop = 15,
|
||||
.width = 12,
|
||||
.height = 2,
|
||||
.paletteNum = 0xF,
|
||||
.baseBlock = 0x248
|
||||
},
|
||||
{
|
||||
.bg = 0,
|
||||
.tilemapLeft = 1,
|
||||
.tilemapTop = 15,
|
||||
.width = 17,
|
||||
.height = 4,
|
||||
.paletteNum = 0xF,
|
||||
.baseBlock = 0x260
|
||||
},
|
||||
{
|
||||
.bg = 0,
|
||||
.tilemapLeft = 1,
|
||||
.tilemapTop = 0x1F,
|
||||
.width = 9,
|
||||
.height = 2,
|
||||
.paletteNum = 0xF,
|
||||
.baseBlock = 0x2A4
|
||||
},
|
||||
{
|
||||
.bg = 0,
|
||||
.tilemapLeft = 1,
|
||||
.tilemapTop = 0x21,
|
||||
.width = 9,
|
||||
.height = 2,
|
||||
.paletteNum = 0xF,
|
||||
.baseBlock = 0x2B6
|
||||
},
|
||||
{
|
||||
.bg = 0,
|
||||
.tilemapLeft = 1,
|
||||
.tilemapTop = 0x23,
|
||||
.width = 9,
|
||||
.height = 2,
|
||||
.paletteNum = 0xF,
|
||||
.baseBlock = 0x2C8
|
||||
},
|
||||
{
|
||||
.bg = 0,
|
||||
.tilemapLeft = 1,
|
||||
.tilemapTop = 0x25,
|
||||
.width = 9,
|
||||
.height = 2,
|
||||
.paletteNum = 0xF,
|
||||
.baseBlock = 0x2DA
|
||||
},
|
||||
{
|
||||
.bg = 0,
|
||||
.tilemapLeft = 16,
|
||||
.tilemapTop = 0x1F,
|
||||
.width = 1,
|
||||
.height = 2,
|
||||
.paletteNum = 0xF,
|
||||
.baseBlock = 0x2EC
|
||||
},
|
||||
{
|
||||
.bg = 0,
|
||||
.tilemapLeft = 11,
|
||||
.tilemapTop = 0x23,
|
||||
.width = 18,
|
||||
.height = 4,
|
||||
.paletteNum = 0xF,
|
||||
.baseBlock = 0x2EE
|
||||
},
|
||||
DUMMY_WIN_TEMPLATE
|
||||
};
|
||||
|
||||
#include "data/contest_opponents.h"
|
||||
|
||||
static const struct CompressedSpriteSheet sUnknown_08589904[] =
|
||||
{
|
||||
{
|
||||
.data = gBlankGfxCompressed,
|
||||
.size = 0x1000,
|
||||
.tag = 0x80E8
|
||||
},
|
||||
{
|
||||
.data = gBlankGfxCompressed,
|
||||
.size = 0x1000,
|
||||
.tag = 0x80E9
|
||||
},
|
||||
{
|
||||
.data = gBlankGfxCompressed,
|
||||
.size = 0x1000,
|
||||
.tag = 0x80EA
|
||||
},
|
||||
{
|
||||
.data = gBlankGfxCompressed,
|
||||
.size = 0x1000,
|
||||
.tag = 0x80EB
|
||||
}
|
||||
};
|
||||
|
||||
// Yup this is super dangerous but that's how it is here
|
||||
static const struct SpritePalette sUnknown_08589924[] =
|
||||
{
|
||||
{
|
||||
.data = (u16*)(gHeap + 0x1A0A4),
|
||||
.tag = 0x80E8
|
||||
},
|
||||
{
|
||||
.data = (u16*)(gHeap + 0x1A0C4),
|
||||
.tag = 0x80E9
|
||||
},
|
||||
{
|
||||
.data = (u16*)(gHeap + 0x1A0E4),
|
||||
.tag = 0x80EA
|
||||
},
|
||||
{
|
||||
.data = (u16*)(gHeap + 0x1A104),
|
||||
.tag = 0x80EB
|
||||
}
|
||||
};
|
||||
|
||||
const struct OamData gOamData_8589944 =
|
||||
{
|
||||
.y = 0,
|
||||
.affineMode = ST_OAM_AFFINE_DOUBLE,
|
||||
.objMode = ST_OAM_OBJ_BLEND,
|
||||
.bpp = ST_OAM_4BPP,
|
||||
.shape = SPRITE_SHAPE(64x64),
|
||||
.x = 0,
|
||||
.size = SPRITE_SIZE(64x64),
|
||||
.tileNum = 0,
|
||||
.priority = 0,
|
||||
.paletteNum = 0,
|
||||
.affineParam = 0,
|
||||
};
|
||||
|
||||
const union AffineAnimCmd gSpriteAffineAnim_858994C[] =
|
||||
{
|
||||
AFFINEANIMCMD_FRAME(0x100, 0x100, 0, 0),
|
||||
AFFINEANIMCMD_END
|
||||
};
|
||||
|
||||
const union AffineAnimCmd gSpriteAffineAnim_858995C[] =
|
||||
{
|
||||
AFFINEANIMCMD_FRAME(3, 3, 0, 15),
|
||||
AFFINEANIMCMD_FRAME(-3, -3, 0, 15),
|
||||
AFFINEANIMCMD_FRAME(3, 3, 0, 15),
|
||||
AFFINEANIMCMD_FRAME(-3, -3, 0, 15),
|
||||
AFFINEANIMCMD_END
|
||||
};
|
||||
|
||||
const union AffineAnimCmd *const gSpriteAffineAnimTable_8589984[] =
|
||||
{
|
||||
gSpriteAffineAnim_858994C,
|
||||
gSpriteAffineAnim_858995C
|
||||
};
|
||||
|
||||
const struct SpriteTemplate gSpriteTemplate_858998C[] =
|
||||
{
|
||||
{
|
||||
.tileTag = 0x80E8,
|
||||
.paletteTag = 0x80E8,
|
||||
.oam = &gOamData_8589944,
|
||||
.anims = gDummySpriteAnimTable,
|
||||
.images = NULL,
|
||||
.affineAnims = gSpriteAffineAnimTable_8589984,
|
||||
.callback = SpriteCallbackDummy
|
||||
},
|
||||
{
|
||||
.tileTag = 0x80E9,
|
||||
.paletteTag = 0x80E9,
|
||||
.oam = &gOamData_8589944,
|
||||
.anims = gDummySpriteAnimTable,
|
||||
.images = NULL,
|
||||
.affineAnims = gSpriteAffineAnimTable_8589984,
|
||||
.callback = SpriteCallbackDummy
|
||||
},
|
||||
{
|
||||
.tileTag = 0x80EA,
|
||||
.paletteTag = 0x80EA,
|
||||
.oam = &gOamData_8589944,
|
||||
.anims = gDummySpriteAnimTable,
|
||||
.images = NULL,
|
||||
.affineAnims = gSpriteAffineAnimTable_8589984,
|
||||
.callback = SpriteCallbackDummy
|
||||
},
|
||||
{
|
||||
.tileTag = 0x80EB,
|
||||
.paletteTag = 0x80EB,
|
||||
.oam = &gOamData_8589944,
|
||||
.anims = gDummySpriteAnimTable,
|
||||
.images = NULL,
|
||||
.affineAnims = gSpriteAffineAnimTable_8589984,
|
||||
.callback = SpriteCallbackDummy
|
||||
}
|
||||
};
|
||||
|
||||
const s8 gContestExcitementTable[][5] =
|
||||
{
|
||||
{ 1, 0, -1, -1, 0},
|
||||
{ 0, 1, 0, -1, -1},
|
||||
{-1, 0, 1, 0, -1},
|
||||
{-1, -1, 0, 1, 0},
|
||||
{ 0, -1, -1, 0, 1}
|
||||
};
|
||||
|
||||
static void TaskDummy1(u8 taskId)
|
||||
{
|
||||
@@ -2118,7 +2683,7 @@ void sub_80DAB8C(u8 contestType, u8 rank)
|
||||
r7 = TRUE;
|
||||
|
||||
// Find all suitable opponents
|
||||
r3 = gUnknown_085898A4;
|
||||
r3 = gPostgameContestOpponentFilter;
|
||||
for (i = 0; i < ARRAY_COUNT(gContestOpponents); i++)
|
||||
{
|
||||
if (rank == gContestOpponents[i].whichRank)
|
||||
@@ -2178,12 +2743,12 @@ void sub_80DACBC(u8 contestType, u8 rank, bool32 isPostgame)
|
||||
|
||||
if (isPostgame == TRUE)
|
||||
{
|
||||
if (gUnknown_085898A4[i] == 1)
|
||||
if (gPostgameContestOpponentFilter[i] == CONTEST_FILTER_NO_POSTGAME)
|
||||
continue;
|
||||
}
|
||||
else
|
||||
{
|
||||
if (gUnknown_085898A4[i] == 2)
|
||||
if (gPostgameContestOpponentFilter[i] == CONTEST_FILTER_ONLY_POSTGAME)
|
||||
continue;
|
||||
}
|
||||
if ((contestType == CONTEST_CATEGORY_COOL && gContestOpponents[i].aiPool_Cool)
|
||||
@@ -3317,8 +3882,8 @@ static u8 sub_80DC9EC(u8 a)
|
||||
u8 spriteId1, spriteId2;
|
||||
u8 x = gUnknown_02039F26[a] * 40 + 32;
|
||||
|
||||
LoadCompressedSpriteSheet(&gUnknown_08589904[a]);
|
||||
LoadSpritePalette(&gUnknown_08589924[a]);
|
||||
LoadCompressedSpriteSheet(&sUnknown_08589904[a]);
|
||||
LoadSpritePalette(&sUnknown_08589924[a]);
|
||||
spriteId1 = CreateSprite(&gSpriteTemplate_858998C[a], 184, x, 29);
|
||||
spriteId2 = CreateSprite(&gSpriteTemplate_858998C[a], 248, x, 29);
|
||||
gSprites[spriteId2].oam.tileNum += 64;
|
||||
@@ -5186,3 +5751,5 @@ void sub_80DFA08(struct ContestPokemon *mon, s32 language)
|
||||
name[PLAYER_NAME_LENGTH] = EOS;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
||||
@@ -778,7 +778,7 @@ static void sub_80F677C(u8 taskId)
|
||||
if (!gReceivedRemoteLinkPlayers)
|
||||
{
|
||||
if (gIsLinkContest & 0x2)
|
||||
sub_800E084();
|
||||
DestroyWirelessStatusIndicatorSprite();
|
||||
|
||||
sub_80F7144();
|
||||
gTasks[taskId].func = sub_80F67C4;
|
||||
|
||||
@@ -152,16 +152,14 @@ const struct OamData gUnknown_085B0830 =
|
||||
.y = 0,
|
||||
.affineMode = ST_OAM_AFFINE_OFF,
|
||||
.objMode = ST_OAM_OBJ_NORMAL,
|
||||
.mosaic = 1,
|
||||
.mosaic = TRUE,
|
||||
.bpp = ST_OAM_8BPP,
|
||||
.shape = SPRITE_SHAPE(64x64),
|
||||
.x = 0,
|
||||
.matrixNum = 0,
|
||||
.size = SPRITE_SIZE(64x64),
|
||||
.tileNum = 0,
|
||||
.priority = 0,
|
||||
.paletteNum = 0,
|
||||
.affineParam = 0,
|
||||
};
|
||||
|
||||
const u16 gUnknown_085B0838[] = {RGB(0, 0, 0), RGB(0, 0, 0)};
|
||||
@@ -705,3 +703,4 @@ static void sub_8130884(u8 arg0, u8 arg1)
|
||||
sub_8130688(arg0);
|
||||
sub_8130430(arg0, arg1);
|
||||
}
|
||||
|
||||
|
||||
+26
-18
@@ -803,17 +803,23 @@ void sub_81144BC(struct Sprite *sprite)
|
||||
StoreSpriteCallbackInData6(sprite, DestroyAnimSprite);
|
||||
}
|
||||
|
||||
void sub_81144F8(u8 taskId)
|
||||
// Makes the attacker metallic and shining.
|
||||
// Used by MOVE_HARDEN and MOVE_IRON_DEFENSE.
|
||||
// arg0: if true won't change battler's palette back
|
||||
// arg1: if true, use custom color
|
||||
// arg2: custom color
|
||||
// Custom color argument is used in MOVE_POISON_TAIL to make the mon turn purplish/pinkish as if became cloaked in poison.
|
||||
void AnimTask_MetallicShine(u8 taskId)
|
||||
{
|
||||
u16 species;
|
||||
u8 spriteId;
|
||||
u8 newSpriteId;
|
||||
u16 paletteNum;
|
||||
struct BattleAnimBgData animBg;
|
||||
int var0 = 0;
|
||||
bool32 priorityChanged = FALSE;
|
||||
|
||||
gBattle_WIN0H = var0;
|
||||
gBattle_WIN0V = var0;
|
||||
gBattle_WIN0H = 0;
|
||||
gBattle_WIN0V = 0;
|
||||
SetGpuReg(REG_OFFSET_WININ, WININ_WIN0_BG_ALL | WININ_WIN0_OBJ | WININ_WIN0_CLR | WININ_WIN1_BG_ALL | WININ_WIN1_OBJ | WININ_WIN1_CLR);
|
||||
SetGpuReg(REG_OFFSET_WINOUT, WINOUT_WINOBJ_BG_ALL | WINOUT_WINOBJ_OBJ | WINOUT_WINOBJ_CLR | WINOUT_WIN01_BG0 | WINOUT_WIN01_BG2 | WINOUT_WIN01_BG3 | WINOUT_WIN01_OBJ | WINOUT_WIN01_CLR);
|
||||
SetGpuRegBits(REG_OFFSET_DISPCNT, DISPCNT_OBJWIN_ON);
|
||||
@@ -832,7 +838,7 @@ void sub_81144F8(u8 taskId)
|
||||
{
|
||||
gSprites[gBattlerSpriteIds[BATTLE_PARTNER(gBattleAnimAttacker)]].oam.priority--;
|
||||
SetAnimBgAttribute(1, BG_ANIM_PRIORITY, 1);
|
||||
var0 = 1;
|
||||
priorityChanged = TRUE;
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -861,7 +867,7 @@ void sub_81144F8(u8 taskId)
|
||||
gBattle_BG1_Y = -gSprites[spriteId].pos1.y + 32;
|
||||
paletteNum = 16 + gSprites[spriteId].oam.paletteNum;
|
||||
|
||||
if (gBattleAnimArgs[1] == 0)
|
||||
if (gBattleAnimArgs[1] == 0)
|
||||
SetGreyscaleOrOriginalPalette(paletteNum, FALSE);
|
||||
else
|
||||
BlendPalette(paletteNum * 16, 16, 11, gBattleAnimArgs[2]);
|
||||
@@ -870,7 +876,7 @@ void sub_81144F8(u8 taskId)
|
||||
gTasks[taskId].data[1] = gBattleAnimArgs[0];
|
||||
gTasks[taskId].data[2] = gBattleAnimArgs[1];
|
||||
gTasks[taskId].data[3] = gBattleAnimArgs[2];
|
||||
gTasks[taskId].data[6] = var0;
|
||||
gTasks[taskId].data[6] = priorityChanged;
|
||||
gTasks[taskId].func = sub_8114748;
|
||||
}
|
||||
|
||||
@@ -879,29 +885,28 @@ static void sub_8114748(u8 taskId)
|
||||
struct BattleAnimBgData animBg;
|
||||
u16 paletteNum;
|
||||
u8 spriteId;
|
||||
u8 taskIdCopy = taskId;
|
||||
|
||||
gTasks[taskIdCopy].data[10] += 4;
|
||||
gTasks[taskId].data[10] += 4;
|
||||
gBattle_BG1_X -= 4;
|
||||
if (gTasks[taskIdCopy].data[10] == 128)
|
||||
if (gTasks[taskId].data[10] == 128)
|
||||
{
|
||||
gTasks[taskIdCopy].data[10] = 0;
|
||||
gTasks[taskId].data[10] = 0;
|
||||
gBattle_BG1_X += 128;
|
||||
gTasks[taskIdCopy].data[11]++;
|
||||
if (gTasks[taskIdCopy].data[11] == 2)
|
||||
gTasks[taskId].data[11]++;
|
||||
if (gTasks[taskId].data[11] == 2)
|
||||
{
|
||||
spriteId = GetAnimBattlerSpriteId(ANIM_ATTACKER);
|
||||
paletteNum = 16 + gSprites[spriteId].oam.paletteNum;
|
||||
if (gTasks[taskIdCopy].data[1] == 0)
|
||||
if (gTasks[taskId].data[1] == 0)
|
||||
SetGreyscaleOrOriginalPalette(paletteNum, 1);
|
||||
|
||||
DestroySprite(&gSprites[gTasks[taskIdCopy].data[0]]);
|
||||
DestroySprite(&gSprites[gTasks[taskId].data[0]]);
|
||||
sub_80A6B30(&animBg);
|
||||
sub_80A6C68(animBg.bgId);
|
||||
if (gTasks[taskIdCopy].data[6] == 1)
|
||||
if (gTasks[taskId].data[6] == 1)
|
||||
gSprites[gBattlerSpriteIds[BATTLE_PARTNER(gBattleAnimAttacker)]].oam.priority++;
|
||||
}
|
||||
else if (gTasks[taskIdCopy].data[11] == 3)
|
||||
else if (gTasks[taskId].data[11] == 3)
|
||||
{
|
||||
gBattle_WIN0H = 0;
|
||||
gBattle_WIN0V = 0;
|
||||
@@ -918,7 +923,10 @@ static void sub_8114748(u8 taskId)
|
||||
}
|
||||
}
|
||||
|
||||
void sub_811489C(u8 taskId)
|
||||
// Changes battler's palette to either greyscale or original.
|
||||
// arg0: which battler
|
||||
// arg1: 0 grayscale, 1 original
|
||||
void AnimTask_SetGreyscaleOrOriginalPal(u8 taskId)
|
||||
{
|
||||
u8 spriteId;
|
||||
u8 battler;
|
||||
|
||||
@@ -2,7 +2,7 @@
|
||||
#define GUARD_DATA_BARD_MUSIC_POKEMON_H
|
||||
#include "constants/species.h"
|
||||
|
||||
const u16 gUnknown_085F5490 = NUM_SPECIES;
|
||||
const u16 gNumSpeciesNames = NUM_SPECIES;
|
||||
|
||||
const struct BardSound gBardSounds_Pokemon[][6] = {
|
||||
{
|
||||
|
||||
File diff suppressed because it is too large
Load Diff
@@ -0,0 +1,414 @@
|
||||
|
||||
#include "global.h"
|
||||
|
||||
extern const u8 gContestEffect00hDescription[];
|
||||
extern const u8 gContestEffect01hDescription[];
|
||||
extern const u8 gContestEffect02hDescription[];
|
||||
extern const u8 gContestEffect03hDescription[];
|
||||
extern const u8 gContestEffect04hDescription[];
|
||||
extern const u8 gContestEffect05hDescription[];
|
||||
extern const u8 gContestEffect06hDescription[];
|
||||
extern const u8 gContestEffect07hDescription[];
|
||||
extern const u8 gContestEffect08hDescription[];
|
||||
extern const u8 gContestEffect09hDescription[];
|
||||
extern const u8 gContestEffect0AhDescription[];
|
||||
extern const u8 gContestEffect0BhDescription[];
|
||||
extern const u8 gContestEffect0ChDescription[];
|
||||
extern const u8 gContestEffect0DhDescription[];
|
||||
extern const u8 gContestEffect0EhDescription[];
|
||||
extern const u8 gContestEffect0FhDescription[];
|
||||
extern const u8 gContestEffect10hDescription[];
|
||||
extern const u8 gContestEffect11hDescription[];
|
||||
extern const u8 gContestEffect12hDescription[];
|
||||
extern const u8 gContestEffect13hDescription[];
|
||||
extern const u8 gContestEffect14hDescription[];
|
||||
extern const u8 gContestEffect15hDescription[];
|
||||
extern const u8 gContestEffect16hDescription[];
|
||||
extern const u8 gContestEffect17hDescription[];
|
||||
extern const u8 gContestEffect18hDescription[];
|
||||
extern const u8 gContestEffect19hDescription[];
|
||||
extern const u8 gContestEffect1AhDescription[];
|
||||
extern const u8 gContestEffect1BhDescription[];
|
||||
extern const u8 gContestEffect1ChDescription[];
|
||||
extern const u8 gContestEffect1DhDescription[];
|
||||
extern const u8 gContestEffect1EhDescription[];
|
||||
extern const u8 gContestEffect1FhDescription[];
|
||||
extern const u8 gContestEffect20hDescription[];
|
||||
extern const u8 gContestEffect21hDescription[];
|
||||
extern const u8 gContestEffect22hDescription[];
|
||||
extern const u8 gContestEffect23hDescription[];
|
||||
extern const u8 gContestEffect24hDescription[];
|
||||
extern const u8 gContestEffect25hDescription[];
|
||||
extern const u8 gContestEffect26hDescription[];
|
||||
extern const u8 gContestEffect27hDescription[];
|
||||
extern const u8 gContestEffect28hDescription[];
|
||||
extern const u8 gContestEffect29hDescription[];
|
||||
extern const u8 gContestEffect2AhDescription[];
|
||||
extern const u8 gContestEffect2BhDescription[];
|
||||
extern const u8 gContestEffect2ChDescription[];
|
||||
extern const u8 gContestEffect2DhDescription[];
|
||||
extern const u8 gContestEffect2EhDescription[];
|
||||
extern const u8 gContestEffect2FhDescription[];
|
||||
|
||||
extern const u8 gUnusedContestMoveName0[];
|
||||
extern const u8 gUnusedContestMoveName1[];
|
||||
extern const u8 gUnusedContestMoveName2[];
|
||||
extern const u8 gUnusedContestMoveName3[];
|
||||
extern const u8 gUnusedContestMoveName4[];
|
||||
extern const u8 gUnusedContestMoveName5[];
|
||||
extern const u8 gUnusedContestMoveName6[];
|
||||
extern const u8 gUnusedContestMoveName7[];
|
||||
extern const u8 gUnusedContestMoveName8[];
|
||||
extern const u8 gUnusedContestMoveName9[];
|
||||
extern const u8 gUnusedContestMoveName10[];
|
||||
extern const u8 gUnusedContestMoveName11[];
|
||||
extern const u8 gUnusedContestMoveName12[];
|
||||
|
||||
extern const u8 gContestMoveTypeCoolText[];
|
||||
extern const u8 gContestMoveTypeBeautyText[];
|
||||
extern const u8 gContestMoveTypeCuteText[];
|
||||
extern const u8 gContestMoveTypeSmartText[];
|
||||
extern const u8 gContestMoveTypeToughText[];
|
||||
|
||||
extern const u8 gText_0827D5C1[];
|
||||
extern const u8 gText_0827D5DC[];
|
||||
extern const u8 gText_0827D600[];
|
||||
extern const u8 gText_0827D612[];
|
||||
extern const u8 gText_0827D612[];
|
||||
extern const u8 gText_0827D62D[];
|
||||
extern const u8 gText_0827D654[];
|
||||
extern const u8 gText_0827D67E[];
|
||||
extern const u8 gText_0827D69C[];
|
||||
extern const u8 gText_0827D6BA[];
|
||||
extern const u8 gText_0827D6E5[];
|
||||
extern const u8 gText_0827D706[];
|
||||
extern const u8 gText_0827D71D[];
|
||||
|
||||
extern const u8 gText_0827D743[];
|
||||
extern const u8 gText_0827D764[];
|
||||
extern const u8 gText_0827D785[];
|
||||
extern const u8 gText_0827D7A5[];
|
||||
extern const u8 gText_0827D7C8[];
|
||||
extern const u8 gText_0827D7E8[];
|
||||
extern const u8 gText_0827D831[];
|
||||
extern const u8 gText_0827D855[];
|
||||
extern const u8 gText_0827D830[];
|
||||
extern const u8 gText_0827D872[];
|
||||
extern const u8 gText_0827D88F[];
|
||||
extern const u8 gText_0827D8B5[];
|
||||
extern const u8 gText_0827D8E4[];
|
||||
extern const u8 gText_0827D8FE[];
|
||||
extern const u8 gText_0827D926[];
|
||||
extern const u8 gText_0827D947[];
|
||||
extern const u8 gText_0827D961[];
|
||||
extern const u8 gText_0827D986[];
|
||||
extern const u8 gText_0827D9B1[];
|
||||
extern const u8 gText_0827D9D9[];
|
||||
extern const u8 gText_0827DA03[];
|
||||
extern const u8 gText_0827DA31[];
|
||||
extern const u8 gText_0827DA5B[];
|
||||
extern const u8 gText_0827DA85[];
|
||||
extern const u8 gText_0827DAB2[];
|
||||
extern const u8 gText_0827DADA[];
|
||||
extern const u8 gText_0827DB03[];
|
||||
extern const u8 gText_0827D830[];
|
||||
extern const u8 gText_0827D830[];
|
||||
extern const u8 gText_0827D830[];
|
||||
extern const u8 gText_0827DB1F[];
|
||||
extern const u8 gText_0827DB4E[];
|
||||
|
||||
extern const u8 gText_827DB75[];
|
||||
extern const u8 gText_827DBB0[];
|
||||
extern const u8 gText_827DBE0[];
|
||||
extern const u8 gText_827DC0F[];
|
||||
extern const u8 gText_827DC45[];
|
||||
extern const u8 gText_827DC7C[];
|
||||
extern const u8 gText_827DCB4[];
|
||||
extern const u8 gText_827DCE7[];
|
||||
extern const u8 gText_827DD12[];
|
||||
extern const u8 gText_827DD3D[];
|
||||
extern const u8 gText_827DD6F[];
|
||||
extern const u8 gText_827DD8E[];
|
||||
extern const u8 gText_827DDC7[];
|
||||
extern const u8 gText_827DDF2[];
|
||||
extern const u8 gText_827DE14[];
|
||||
extern const u8 gText_827DE44[];
|
||||
extern const u8 gText_827DE73[];
|
||||
extern const u8 gText_827DEA5[];
|
||||
extern const u8 gText_827DED9[];
|
||||
extern const u8 gText_827DF02[];
|
||||
extern const u8 gText_827DF3A[];
|
||||
extern const u8 gText_827DF63[];
|
||||
extern const u8 gText_827DF8C[];
|
||||
extern const u8 gText_827DFB8[];
|
||||
extern const u8 gText_827DFE2[];
|
||||
extern const u8 gText_827E00C[];
|
||||
extern const u8 gText_827E02F[];
|
||||
extern const u8 gText_827E05F[];
|
||||
extern const u8 gText_827E08B[];
|
||||
extern const u8 gText_827E0B5[];
|
||||
extern const u8 gText_827E0DD[];
|
||||
extern const u8 gText_827E107[];
|
||||
extern const u8 gText_827E143[];
|
||||
extern const u8 gText_827E17F[];
|
||||
extern const u8 gText_827E1BB[];
|
||||
extern const u8 gText_827E1F3[];
|
||||
extern const u8 gText_827E220[];
|
||||
extern const u8 gText_827E254[];
|
||||
extern const u8 gText_827E289[];
|
||||
extern const u8 gText_827E2C5[];
|
||||
extern const u8 gText_0827E2FE[];
|
||||
extern const u8 gText_0827E32E[];
|
||||
extern const u8 gText_0827E35B[];
|
||||
extern const u8 gText_0827E38D[];
|
||||
extern const u8 gText_0827E3C1[];
|
||||
extern const u8 gText_0827E3EB[];
|
||||
extern const u8 gText_0827E416[];
|
||||
extern const u8 gText_0827E448[];
|
||||
extern const u8 gText_0827E473[];
|
||||
extern const u8 gText_0827E4A6[];
|
||||
extern const u8 gText_0827E4D5[];
|
||||
extern const u8 gText_0827E504[];
|
||||
extern const u8 gText_0827E531[];
|
||||
extern const u8 gText_0827E55A[];
|
||||
extern const u8 gText_0827E5B2[];
|
||||
extern const u8 gText_0827E5D0[];
|
||||
extern const u8 gText_0827E606[];
|
||||
extern const u8 gText_0827E638[];
|
||||
extern const u8 gText_0827E658[];
|
||||
extern const u8 gText_0827E68B[];
|
||||
extern const u8 gText_0827E6C4[];
|
||||
extern const u8 gText_0827E7BA[];
|
||||
|
||||
extern const u8 gText_0827E85F[];
|
||||
extern const u8 gText_0827E868[];
|
||||
extern const u8 gText_0827E86F[];
|
||||
extern const u8 gText_0827E878[];
|
||||
extern const u8 gText_0827E882[];
|
||||
|
||||
extern const u8 gText_0827E894[];
|
||||
extern const u8 gText_0827E89E[];
|
||||
extern const u8 gText_0827E8AA[];
|
||||
extern const u8 gText_0827E8B4[];
|
||||
extern const u8 gText_0827E8BF[];
|
||||
extern const u8 gText_0827E8CA[];
|
||||
|
||||
const u8 *const gContestEffectDescriptionPointers[] =
|
||||
{
|
||||
gContestEffect00hDescription,
|
||||
gContestEffect01hDescription,
|
||||
gContestEffect02hDescription,
|
||||
gContestEffect03hDescription,
|
||||
gContestEffect04hDescription,
|
||||
gContestEffect05hDescription,
|
||||
gContestEffect06hDescription,
|
||||
gContestEffect07hDescription,
|
||||
gContestEffect08hDescription,
|
||||
gContestEffect09hDescription,
|
||||
gContestEffect0AhDescription,
|
||||
gContestEffect0BhDescription,
|
||||
gContestEffect0ChDescription,
|
||||
gContestEffect0DhDescription,
|
||||
gContestEffect0EhDescription,
|
||||
gContestEffect0FhDescription,
|
||||
gContestEffect10hDescription,
|
||||
gContestEffect11hDescription,
|
||||
gContestEffect12hDescription,
|
||||
gContestEffect13hDescription,
|
||||
gContestEffect14hDescription,
|
||||
gContestEffect15hDescription,
|
||||
gContestEffect16hDescription,
|
||||
gContestEffect17hDescription,
|
||||
gContestEffect18hDescription,
|
||||
gContestEffect19hDescription,
|
||||
gContestEffect1AhDescription,
|
||||
gContestEffect1BhDescription,
|
||||
gContestEffect1ChDescription,
|
||||
gContestEffect1DhDescription,
|
||||
gContestEffect1EhDescription,
|
||||
gContestEffect1FhDescription,
|
||||
gContestEffect20hDescription,
|
||||
gContestEffect21hDescription,
|
||||
gContestEffect22hDescription,
|
||||
gContestEffect23hDescription,
|
||||
gContestEffect24hDescription,
|
||||
gContestEffect25hDescription,
|
||||
gContestEffect26hDescription,
|
||||
gContestEffect27hDescription,
|
||||
gContestEffect28hDescription,
|
||||
gContestEffect29hDescription,
|
||||
gContestEffect2AhDescription,
|
||||
gContestEffect2BhDescription,
|
||||
gContestEffect2ChDescription,
|
||||
gContestEffect2DhDescription,
|
||||
gContestEffect2EhDescription,
|
||||
gContestEffect2FhDescription
|
||||
};
|
||||
|
||||
// Unreferenced array of pointers to move names.
|
||||
// All of the moves except Conversion are combo starters, so this may have
|
||||
// been an early list of combo starters.
|
||||
const u8 *const gUnknown_8587D10[] =
|
||||
{
|
||||
gUnusedContestMoveName0,
|
||||
gUnusedContestMoveName0,
|
||||
gUnusedContestMoveName1,
|
||||
gUnusedContestMoveName2,
|
||||
gUnusedContestMoveName3,
|
||||
gUnusedContestMoveName4,
|
||||
gUnusedContestMoveName5,
|
||||
gUnusedContestMoveName6,
|
||||
gUnusedContestMoveName7,
|
||||
gUnusedContestMoveName8,
|
||||
gUnusedContestMoveName9,
|
||||
gUnusedContestMoveName10,
|
||||
gUnusedContestMoveName11,
|
||||
gUnusedContestMoveName12
|
||||
};
|
||||
|
||||
const u8 *const gContestMoveTypeTextPointers[] =
|
||||
{
|
||||
gContestMoveTypeCoolText,
|
||||
gContestMoveTypeBeautyText,
|
||||
gContestMoveTypeCuteText,
|
||||
gContestMoveTypeSmartText,
|
||||
gContestMoveTypeToughText
|
||||
};
|
||||
|
||||
const u8 *const gUnknown_08587D5C[] =
|
||||
{
|
||||
gText_0827D5C1,
|
||||
gText_0827D5DC,
|
||||
gText_0827D600,
|
||||
gText_0827D612,
|
||||
gText_0827D612,
|
||||
gText_0827D62D,
|
||||
gText_0827D654,
|
||||
gText_0827D67E,
|
||||
gText_0827D69C,
|
||||
gText_0827D6BA,
|
||||
gText_0827D6E5,
|
||||
gText_0827D706,
|
||||
gText_0827D71D
|
||||
};
|
||||
|
||||
const u8 *const gUnknown_08587D90[] =
|
||||
{
|
||||
gText_0827D743,
|
||||
gText_0827D764,
|
||||
gText_0827D785,
|
||||
gText_0827D7A5,
|
||||
gText_0827D7C8,
|
||||
gText_0827D7E8,
|
||||
gText_0827D831,
|
||||
gText_0827D855,
|
||||
gText_0827D830,
|
||||
gText_0827D872,
|
||||
gText_0827D88F,
|
||||
gText_0827D8B5,
|
||||
gText_0827D8E4,
|
||||
gText_0827D8FE,
|
||||
gText_0827D926,
|
||||
gText_0827D947,
|
||||
gText_0827D961,
|
||||
gText_0827D986,
|
||||
gText_0827D9B1,
|
||||
gText_0827D9D9,
|
||||
gText_0827DA03,
|
||||
gText_0827DA31,
|
||||
gText_0827DA5B,
|
||||
gText_0827DA85,
|
||||
gText_0827DAB2,
|
||||
gText_0827DADA,
|
||||
gText_0827DB03,
|
||||
gText_0827D830,
|
||||
gText_0827D830,
|
||||
gText_0827D830,
|
||||
gText_0827DB1F,
|
||||
gText_0827DB4E
|
||||
};
|
||||
|
||||
const u8 *const gUnknown_08587E10[] =
|
||||
{
|
||||
gText_827DB75,
|
||||
gText_827DBB0,
|
||||
gText_827DBE0,
|
||||
gText_827DC0F,
|
||||
gText_827DC45,
|
||||
gText_827DC7C,
|
||||
gText_827DCB4,
|
||||
gText_827DCE7,
|
||||
gText_827DD12,
|
||||
gText_827DD3D,
|
||||
gText_827DD6F,
|
||||
gText_827DD8E,
|
||||
gText_827DDC7,
|
||||
gText_827DDF2,
|
||||
gText_827DE14,
|
||||
gText_827DE44,
|
||||
gText_827DE73,
|
||||
gText_827DEA5,
|
||||
gText_827DED9,
|
||||
gText_827DF02,
|
||||
gText_827DF3A,
|
||||
gText_827DF63,
|
||||
gText_827DF8C,
|
||||
gText_827DFB8,
|
||||
gText_827DFE2,
|
||||
gText_827E00C,
|
||||
gText_827E02F,
|
||||
gText_827E05F,
|
||||
gText_827E08B,
|
||||
gText_827E0B5,
|
||||
gText_827E0DD,
|
||||
gText_827E107,
|
||||
gText_827E143,
|
||||
gText_827E17F,
|
||||
gText_827E1BB,
|
||||
gText_827E1F3,
|
||||
gText_827E220,
|
||||
gText_827E254,
|
||||
gText_827E289,
|
||||
gText_827E2C5,
|
||||
gText_0827E2FE,
|
||||
gText_0827E32E,
|
||||
gText_0827E35B,
|
||||
gText_0827E38D,
|
||||
gText_0827E3C1,
|
||||
gText_0827E3EB,
|
||||
gText_0827E416,
|
||||
gText_0827E448,
|
||||
gText_0827E473,
|
||||
gText_0827E4A6,
|
||||
gText_0827E4D5,
|
||||
gText_0827E504,
|
||||
gText_0827E531,
|
||||
gText_0827E55A,
|
||||
gText_0827E5B2,
|
||||
gText_0827E5D0,
|
||||
gText_0827E606,
|
||||
gText_0827E638,
|
||||
gText_0827E658,
|
||||
gText_0827E68B,
|
||||
gText_0827E6C4,
|
||||
gText_0827E7BA
|
||||
};
|
||||
|
||||
const u8 *const gUnknown_08587F08[] =
|
||||
{
|
||||
gText_0827E85F,
|
||||
gText_0827E868,
|
||||
gText_0827E86F,
|
||||
gText_0827E878,
|
||||
gText_0827E882
|
||||
};
|
||||
|
||||
const u8 *const gUnknown_08587F1C[] =
|
||||
{
|
||||
gText_0827E894,
|
||||
gText_0827E89E,
|
||||
gText_0827E8AA,
|
||||
gText_0827E8B4,
|
||||
gText_0827E8BF,
|
||||
gText_0827E8CA
|
||||
};
|
||||
+11
-2
@@ -391,10 +391,18 @@ const struct SpritePalette gUnknown_085A73E0 = {
|
||||
Unknown_085A7328, OVERWORLD_PLACE_DECOR_PLAYER_PAL_TAG
|
||||
};
|
||||
|
||||
const struct OamData Unknown_085A73E8 = {
|
||||
const struct OamData Unknown_085A73E8 =
|
||||
{
|
||||
.y = 0,
|
||||
.affineMode = ST_OAM_AFFINE_OFF,
|
||||
.objMode = ST_OAM_OBJ_NORMAL,
|
||||
.bpp = ST_OAM_4BPP,
|
||||
.shape = SPRITE_SHAPE(16x16),
|
||||
.x = 0,
|
||||
.size = SPRITE_SIZE(16x16),
|
||||
.priority = 1
|
||||
.tileNum = 0,
|
||||
.priority = 1,
|
||||
.paletteNum = 0,
|
||||
};
|
||||
|
||||
const union AnimCmd Unknown_085A73F0[] = {
|
||||
@@ -2740,3 +2748,4 @@ void sub_812A478(u8 taskId)
|
||||
StringExpandPlaceholders(gStringVar4, gText_DecorationThrownAway);
|
||||
DisplayItemMessageOnField(taskId, gStringVar4, sub_8127A5C);
|
||||
}
|
||||
|
||||
|
||||
+2
-2
@@ -3721,7 +3721,7 @@ static void sub_811D0BC(void)
|
||||
{
|
||||
FillBgTilemapBufferRect(0, 0, 0, 0, 32, 20, 17);
|
||||
LoadUserWindowBorderGfx(1, 1, 0xE0);
|
||||
sub_8098858(1, 1, 14);
|
||||
DrawTextBorderOuter(1, 1, 14);
|
||||
sub_811D104(0);
|
||||
PutWindowTilemap(1);
|
||||
CopyBgTilemapBufferToVram(0);
|
||||
@@ -4882,7 +4882,7 @@ bool8 ECWord_CheckIfOutsideOfValidRange(u16 easyChatWord)
|
||||
{
|
||||
case EC_GROUP_POKEMON:
|
||||
case EC_GROUP_POKEMON_2:
|
||||
numWordsInGroup = gUnknown_085F5490;
|
||||
numWordsInGroup = gNumSpeciesNames;
|
||||
break;
|
||||
case EC_GROUP_MOVE_1:
|
||||
case EC_GROUP_MOVE_2:
|
||||
|
||||
+51
-61
@@ -4,7 +4,7 @@
|
||||
#include "ereader_helpers.h"
|
||||
#include "link.h"
|
||||
#include "main.h"
|
||||
#include "rom_8011DC0.h"
|
||||
#include "union_room.h"
|
||||
#include "save.h"
|
||||
#include "sprite.h"
|
||||
#include "task.h"
|
||||
@@ -26,149 +26,139 @@ static void sub_81D414C(void);
|
||||
static void sub_81D3F1C(u32, u32*, u32*);
|
||||
static void sub_81D3F68(void);
|
||||
|
||||
extern struct Unknown030012C8 gUnknown_030012C8;
|
||||
extern u16 gUnknown_030012E0;
|
||||
extern u16 gUnknown_030012E2;
|
||||
extern u16 gUnknown_030012E4;
|
||||
extern u16 gUnknown_030012E6;
|
||||
extern u32 gUnknown_030012E8;
|
||||
extern u16 gUnknown_030012EC;
|
||||
extern u16 gUnknown_030012EE;
|
||||
extern u16 gUnknown_030012F0;
|
||||
extern u16 gUnknown_030012F2;
|
||||
extern u16 gUnknown_030012F4;
|
||||
IWRAM_DATA struct Unknown030012C8 gUnknown_030012C8;
|
||||
IWRAM_DATA u16 gUnknown_030012E0;
|
||||
IWRAM_DATA u16 gUnknown_030012E2;
|
||||
IWRAM_DATA u16 gUnknown_030012E4;
|
||||
IWRAM_DATA u16 gUnknown_030012E6;
|
||||
IWRAM_DATA u32 gUnknown_030012E8;
|
||||
IWRAM_DATA u16 gUnknown_030012EC;
|
||||
IWRAM_DATA u16 gUnknown_030012EE;
|
||||
IWRAM_DATA u16 gUnknown_030012F0;
|
||||
IWRAM_DATA u16 gUnknown_030012F2;
|
||||
IWRAM_DATA u16 gUnknown_030012F4;
|
||||
|
||||
extern const u8 gUnknown_08625B6C[];
|
||||
extern const u8 gUnknown_08625B6C[][0x148];
|
||||
|
||||
static u8 sub_81D38D4(void)
|
||||
{
|
||||
return (gSaveBlock1Ptr->trainerHill.unused + 1) % 256;
|
||||
}
|
||||
|
||||
static bool32 sub_81D38FC(struct Unk81D38FC *arg0)
|
||||
static bool32 Struct_Unk81D38FC_ValidateChecksum(struct Unk81D38FC *arg0)
|
||||
{
|
||||
int checksum = CalcByteArraySum(arg0->unk0, 0x270);
|
||||
int checksum = CalcByteArraySum((u8 *)arg0, 0x270);
|
||||
if (checksum != arg0->checksum)
|
||||
return FALSE;
|
||||
|
||||
return TRUE;
|
||||
}
|
||||
|
||||
bool8 sub_81D3920(u8 *buffer)
|
||||
bool8 EReader_IsReceivedDataValid(struct EReaderTrainerHillSet *buffer)
|
||||
{
|
||||
u32 i;
|
||||
u32 checksum;
|
||||
int var0 = buffer[0];
|
||||
int var0 = buffer->unk_0;
|
||||
if (var0 < 1 || var0 > 8)
|
||||
return FALSE;
|
||||
|
||||
for (i = 0; i < var0; i++)
|
||||
{
|
||||
struct Unk81D38FC *var1 = (struct Unk81D38FC *)(&buffer[i * (sizeof(struct Unk81D38FC)) + 8]);
|
||||
if (!sub_81D38FC(var1))
|
||||
if (!Struct_Unk81D38FC_ValidateChecksum(&buffer->unk_8[i]))
|
||||
return FALSE;
|
||||
}
|
||||
|
||||
checksum = CalcByteArraySum(buffer + 8, var0 * 0x274);
|
||||
if (checksum != ((int *)buffer)[1])
|
||||
checksum = CalcByteArraySum((u8 *)buffer->unk_8, var0 * sizeof(struct Unk81D38FC));
|
||||
if (checksum != buffer->checksum)
|
||||
return FALSE;
|
||||
|
||||
return TRUE;
|
||||
}
|
||||
|
||||
static bool32 sub_81D396C(u8 *buffer)
|
||||
static bool32 TrainerHill_VerifyChecksum(struct EReaderTrainerHillSet *buffer)
|
||||
{
|
||||
u32 checksum;
|
||||
int var0 = buffer[0];
|
||||
int var0 = buffer->unk_0;
|
||||
if (var0 < 1 || var0 > 8)
|
||||
return FALSE;
|
||||
|
||||
checksum = CalcByteArraySum(buffer + 8, 0xEE0);
|
||||
if (checksum != ((int *)buffer)[1])
|
||||
checksum = CalcByteArraySum((u8 *)buffer->unk_8, sizeof(struct EReaderTrainerHillSet) - offsetof(struct EReaderTrainerHillSet, unk_8));
|
||||
if (checksum != buffer->checksum)
|
||||
return FALSE;
|
||||
|
||||
return TRUE;
|
||||
}
|
||||
|
||||
static bool32 sub_81D3998(struct Unk81D38FC *arg0, u8 *buffer2)
|
||||
static bool32 TryWriteTrainerHill_r(struct EReaderTrainerHillSet *arg0, struct Unk81D3998 *buffer2)
|
||||
{
|
||||
int i;
|
||||
const u8 *ereaderVals;
|
||||
|
||||
memset(buffer2, 0, 0x1000);
|
||||
buffer2[0] = arg0->unk0[0];
|
||||
buffer2[1] = sub_81D38D4();
|
||||
buffer2[2] = (arg0->unk0[0] + 1) / 2;
|
||||
buffer2->unk_000 = arg0->unk_0;
|
||||
buffer2->unk_001 = sub_81D38D4();
|
||||
buffer2->unk_002 = (arg0->unk_0 + 1) / 2;
|
||||
|
||||
for (i = 0; i < arg0->unk0[0]; i++)
|
||||
for (i = 0; i < arg0->unk_0; i++)
|
||||
{
|
||||
if (!(i & 1))
|
||||
{
|
||||
u8 *var0 = &buffer2[(i / 2) * 0x3B8];
|
||||
u8 *var1 = arg0[i].unk0;
|
||||
var0[8] = var1[8];
|
||||
memcpy(&var0[0x29C], &var1[0x154], 0x124);
|
||||
var0 += 0xC;
|
||||
var1 += 0xC;
|
||||
memcpy(var0, var1, 0x148);
|
||||
buffer2->unk_008[i / 2].unk_000[0] = arg0->unk_8[i].unk0;
|
||||
memcpy(buffer2->unk_008[i / 2].unk_294, arg0->unk_8[i].unk14C, 0x124);
|
||||
memcpy(buffer2->unk_008[i / 2].unk_004, arg0->unk_8[i].unk4, 0x148);
|
||||
}
|
||||
else
|
||||
{
|
||||
u8 *var0 = &buffer2[(i / 2) * 0x3B8];
|
||||
u8 *var1 = arg0[i].unk0;
|
||||
var0[9] = var1[8];
|
||||
memcpy(&var0[0x154], &var1[0xC], 0x148);
|
||||
buffer2->unk_008[i / 2].unk_000[1] = arg0->unk_8[i].unk0;
|
||||
memcpy(buffer2->unk_008[i / 2].unk_14C, arg0->unk_8[i].unk4, 0x148);
|
||||
}
|
||||
}
|
||||
|
||||
if (i & 1)
|
||||
{
|
||||
u8 *var0 = &buffer2[(i / 2) * 0x3B8];
|
||||
var0 += 0x154;
|
||||
|
||||
ereaderVals = gUnknown_08625B6C;
|
||||
memcpy(var0, &ereaderVals[(i / 2) * 0x148], 0x148);
|
||||
u8 * dest = buffer2->unk_008[i / 2].unk_14C;
|
||||
const u8 (* src)[0x148] = gUnknown_08625B6C;
|
||||
memcpy(dest, src[i / 2], 0x148);
|
||||
}
|
||||
|
||||
((int *)buffer2)[1] = CalcByteArraySum(buffer2 + 8, 0xEE0);
|
||||
if (sub_8153634(SECTOR_ID_TRAINER_HILL, buffer2) != 1)
|
||||
buffer2->checksum = CalcByteArraySum((u8 *)buffer2->unk_008, sizeof(struct Unk81D3998) - offsetof(struct Unk81D3998, unk_008));
|
||||
if (TryWriteSpecialSaveSection(SECTOR_ID_TRAINER_HILL, (u8 *)buffer2) != 1)
|
||||
return FALSE;
|
||||
|
||||
return TRUE;
|
||||
}
|
||||
|
||||
bool32 sub_81D3AB0(struct Unk81D38FC *arg0)
|
||||
bool32 TryWriteTrainerHill(struct EReaderTrainerHillSet *arg0)
|
||||
{
|
||||
u8 *var0 = AllocZeroed(0x1000);
|
||||
bool32 result = sub_81D3998(arg0, var0);
|
||||
struct Unk81D3998 *var0 = AllocZeroed(0x1000);
|
||||
bool32 result = TryWriteTrainerHill_r(arg0, var0);
|
||||
Free(var0);
|
||||
return result;
|
||||
}
|
||||
|
||||
static bool32 sub_81D3AD8(u8 *arg0, u8 *arg1)
|
||||
static bool32 TryReadTrainerHill_r(struct EReaderTrainerHillSet *arg0, u8 *arg1)
|
||||
{
|
||||
if (TryCopySpecialSaveSection(SECTOR_ID_TRAINER_HILL, arg1) != 1)
|
||||
if (TryReadSpecialSaveSection(SECTOR_ID_TRAINER_HILL, arg1) != 1)
|
||||
return FALSE;
|
||||
|
||||
memcpy(arg0, arg1, 0xEE8);
|
||||
if (!sub_81D396C(arg0))
|
||||
memcpy(arg0, arg1, sizeof(struct EReaderTrainerHillSet));
|
||||
if (!TrainerHill_VerifyChecksum(arg0))
|
||||
return FALSE;
|
||||
|
||||
return TRUE;
|
||||
}
|
||||
|
||||
static bool32 sub_81D3B0C(u8 *arg0)
|
||||
static bool32 TryReadTrainerHill(struct EReaderTrainerHillSet *arg0)
|
||||
{
|
||||
u8 *var0 = AllocZeroed(0x1000);
|
||||
bool32 result = sub_81D3AD8(arg0, var0);
|
||||
bool32 result = TryReadTrainerHill_r(arg0, var0);
|
||||
Free(var0);
|
||||
return result;
|
||||
}
|
||||
|
||||
bool32 sub_81D3B34(void)
|
||||
bool32 ReadTrainerHillAndValidate(void)
|
||||
{
|
||||
u8 *var0 = AllocZeroed(0x1000);
|
||||
bool32 result = sub_81D3B0C(var0);
|
||||
struct EReaderTrainerHillSet *var0 = AllocZeroed(0x1000);
|
||||
bool32 result = TryReadTrainerHill(var0);
|
||||
Free(var0);
|
||||
return result;
|
||||
}
|
||||
|
||||
+19
-19
@@ -4,7 +4,7 @@
|
||||
#include "ereader_helpers.h"
|
||||
#include "link.h"
|
||||
#include "main.h"
|
||||
#include "rom_8011DC0.h"
|
||||
#include "mystery_gift.h"
|
||||
#include "save.h"
|
||||
#include "sound.h"
|
||||
#include "sprite.h"
|
||||
@@ -209,7 +209,7 @@ static u32 sub_81D4EE4(u8 *arg0, u16 *arg1)
|
||||
return 0;
|
||||
}
|
||||
|
||||
void sub_81D5014(void)
|
||||
void task_add_00_ereader(void)
|
||||
{
|
||||
int value;
|
||||
struct Unk81D5014 *data;
|
||||
@@ -251,7 +251,7 @@ static void sub_81D5084(u8 taskId)
|
||||
switch (data->unk8)
|
||||
{
|
||||
case 0:
|
||||
if (mevent_0814257C(&data->unk9, gUnknown_085EDFD6))
|
||||
if (MG_PrintTextOnWindow1AndWaitButton(&data->unk9, gUnknown_085EDFD6))
|
||||
data->unk8 = 1;
|
||||
break;
|
||||
case 1:
|
||||
@@ -275,9 +275,9 @@ static void sub_81D5084(u8 taskId)
|
||||
}
|
||||
break;
|
||||
case 4:
|
||||
if (mevent_0814257C(&data->unk9, gUnknown_085EDFF5))
|
||||
if (MG_PrintTextOnWindow1AndWaitButton(&data->unk9, gUnknown_085EDFF5))
|
||||
{
|
||||
sub_8018884(gUnknown_085EE014);
|
||||
AddTextPrinterToWindow1(gUnknown_085EE014);
|
||||
sub_81D505C(&data->unk0);
|
||||
data->unk8 = 5;
|
||||
}
|
||||
@@ -324,11 +324,11 @@ static void sub_81D5084(u8 taskId)
|
||||
}
|
||||
break;
|
||||
case 7:
|
||||
if (mevent_0814257C(&data->unk9, gUnknown_085EE05C))
|
||||
if (MG_PrintTextOnWindow1AndWaitButton(&data->unk9, gUnknown_085EE05C))
|
||||
data->unk8 = 4;
|
||||
break;
|
||||
case 8:
|
||||
sub_8018884(gUnknown_085EE097);
|
||||
AddTextPrinterToWindow1(gUnknown_085EE097);
|
||||
// XXX: This (u32*) cast is discarding the const qualifier from gUnknown_089A3470
|
||||
sub_81D4D50(&gUnknown_03006370, gMultiBootProgram_BerryGlitchFix_Start - gUnknown_089A3470, (u32*)gUnknown_089A3470);
|
||||
data->unk8 = 9;
|
||||
@@ -347,7 +347,7 @@ static void sub_81D5084(u8 taskId)
|
||||
else if (data->unkE == 1)
|
||||
{
|
||||
sub_81D505C(&data->unk0);
|
||||
sub_8018884(gUnknown_085EE120);
|
||||
AddTextPrinterToWindow1(gUnknown_085EE120);
|
||||
data->unk8 = 11;
|
||||
}
|
||||
else
|
||||
@@ -361,7 +361,7 @@ static void sub_81D5084(u8 taskId)
|
||||
break;
|
||||
case 12:
|
||||
sub_81D4E30();
|
||||
sub_8018884(gUnknown_085EE0DC);
|
||||
AddTextPrinterToWindow1(gUnknown_085EE0DC);
|
||||
data->unk8 = 13;
|
||||
break;
|
||||
case 13:
|
||||
@@ -370,7 +370,7 @@ static void sub_81D5084(u8 taskId)
|
||||
case 0:
|
||||
break;
|
||||
case 2:
|
||||
sub_8018884(gUnknown_085EE097);
|
||||
AddTextPrinterToWindow1(gUnknown_085EE097);
|
||||
data->unk8 = 14;
|
||||
break;
|
||||
case 1:
|
||||
@@ -402,7 +402,7 @@ static void sub_81D5084(u8 taskId)
|
||||
}
|
||||
break;
|
||||
case 15:
|
||||
data->unkE = sub_81D3920(gDecompressionBuffer);
|
||||
data->unkE = EReader_IsReceivedDataValid((struct EReaderTrainerHillSet *)gDecompressionBuffer);
|
||||
sub_800ABF4(data->unkE);
|
||||
data->unk8 = 16;
|
||||
break;
|
||||
@@ -416,9 +416,9 @@ static void sub_81D5084(u8 taskId)
|
||||
}
|
||||
break;
|
||||
case 17:
|
||||
if (sub_81D3AB0((struct Unk81D38FC *)&gDecompressionBuffer))
|
||||
if (TryWriteTrainerHill((struct EReaderTrainerHillSet *)&gDecompressionBuffer))
|
||||
{
|
||||
sub_8018884(gUnknown_085EE0FA);
|
||||
AddTextPrinterToWindow1(gUnknown_085EE0FA);
|
||||
sub_81D505C(&data->unk0);
|
||||
data->unk8 = 18;
|
||||
}
|
||||
@@ -430,7 +430,7 @@ static void sub_81D5084(u8 taskId)
|
||||
case 18:
|
||||
if (sub_81D5064(&data->unk0, 120))
|
||||
{
|
||||
sub_8018884(gUnknown_085EE107);
|
||||
AddTextPrinterToWindow1(gUnknown_085EE107);
|
||||
PlayFanfare(MUS_FANFA4);
|
||||
data->unk8 = 19;
|
||||
}
|
||||
@@ -440,25 +440,25 @@ static void sub_81D5084(u8 taskId)
|
||||
data->unk8 = 26;
|
||||
break;
|
||||
case 23:
|
||||
if (mevent_0814257C(&data->unk9,gUnknown_085EE06B))
|
||||
if (MG_PrintTextOnWindow1AndWaitButton(&data->unk9,gUnknown_085EE06B))
|
||||
data->unk8 = 26;
|
||||
break;
|
||||
case 20:
|
||||
if (mevent_0814257C(&data->unk9, gUnknown_085EE0A3))
|
||||
if (MG_PrintTextOnWindow1AndWaitButton(&data->unk9, gUnknown_085EE0A3))
|
||||
data->unk8 = 0;
|
||||
break;
|
||||
case 21:
|
||||
if (mevent_0814257C(&data->unk9, gUnknown_085EE0BF))
|
||||
if (MG_PrintTextOnWindow1AndWaitButton(&data->unk9, gUnknown_085EE0BF))
|
||||
data->unk8 = 0;
|
||||
break;
|
||||
case 22:
|
||||
if (mevent_0814257C(&data->unk9, gUnknown_085EE12D))
|
||||
if (MG_PrintTextOnWindow1AndWaitButton(&data->unk9, gUnknown_085EE12D))
|
||||
data->unk8 = 0;
|
||||
break;
|
||||
case 26:
|
||||
Free(data->unk10);
|
||||
DestroyTask(taskId);
|
||||
SetMainCallback2(sub_80186A4);
|
||||
SetMainCallback2(MainCB_FreeAllBuffersAndReturnToInitTitleScreen);
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
+23
-30
@@ -1949,7 +1949,7 @@ void EventObjectSetGraphicsId(struct EventObject *eventObject, u8 graphicsId)
|
||||
sprite->oam.paletteNum = paletteSlot;
|
||||
eventObject->inanimate = graphicsInfo->inanimate;
|
||||
eventObject->graphicsId = graphicsId;
|
||||
sub_8093038(eventObject->currentCoords.x, eventObject->currentCoords.y, &sprite->pos1.x, &sprite->pos1.y);
|
||||
SetSpritePosToMapCoords(eventObject->currentCoords.x, eventObject->currentCoords.y, &sprite->pos1.x, &sprite->pos1.y);
|
||||
sprite->centerToCornerVecX = -(graphicsInfo->width >> 1);
|
||||
sprite->centerToCornerVecY = -(graphicsInfo->height >> 1);
|
||||
sprite->pos1.x += 8;
|
||||
@@ -2253,7 +2253,7 @@ void sub_808EB08(struct EventObject *eventObject, s16 x, s16 y)
|
||||
sprite = &gSprites[eventObject->spriteId];
|
||||
graphicsInfo = GetEventObjectGraphicsInfo(eventObject->graphicsId);
|
||||
SetEventObjectCoords(eventObject, x, y);
|
||||
sub_8093038(eventObject->currentCoords.x, eventObject->currentCoords.y, &sprite->pos1.x, &sprite->pos1.y);
|
||||
SetSpritePosToMapCoords(eventObject->currentCoords.x, eventObject->currentCoords.y, &sprite->pos1.x, &sprite->pos1.y);
|
||||
sprite->centerToCornerVecX = -(graphicsInfo->width >> 1);
|
||||
sprite->centerToCornerVecY = -(graphicsInfo->height >> 1);
|
||||
sprite->pos1.x += 8;
|
||||
@@ -4414,8 +4414,8 @@ bool8 CopyablePlayerMovement_GoSpeed0(struct EventObject *eventObject, struct Sp
|
||||
direction = playerDirection;
|
||||
if (EventObjectIsFarawayIslandMew(eventObject))
|
||||
{
|
||||
direction = sub_81D427C();
|
||||
if (direction == 0)
|
||||
direction = GetMewMoveDirection();
|
||||
if (direction == DIR_NONE)
|
||||
{
|
||||
direction = playerDirection;
|
||||
direction = state_to_direction(gInitialMovementTypeFacingDirections[eventObject->movementType], eventObject->directionSequenceIndex, direction);
|
||||
@@ -5024,44 +5024,37 @@ static void MoveCoordsInDirection(u32 dir, s16 *x, s16 *y, s16 deltaX, s16 delta
|
||||
*y -= dy2;
|
||||
}
|
||||
|
||||
void sub_8092FF0(s16 x, s16 y, s16 *dest_x, s16 *dest_y)
|
||||
void sub_8092FF0(s16 x, s16 y, s16 *destX, s16 *destY)
|
||||
{
|
||||
*dest_x = (x - gSaveBlock1Ptr->pos.x) << 4;
|
||||
*dest_y = (y - gSaveBlock1Ptr->pos.y) << 4;
|
||||
*dest_x -= gTotalCameraPixelOffsetX;
|
||||
*dest_y -= gTotalCameraPixelOffsetY;
|
||||
*destX = (x - gSaveBlock1Ptr->pos.x) << 4;
|
||||
*destY = (y - gSaveBlock1Ptr->pos.y) << 4;
|
||||
*destX -= gTotalCameraPixelOffsetX;
|
||||
*destY -= gTotalCameraPixelOffsetY;
|
||||
}
|
||||
|
||||
void sub_8093038(s16 x, s16 y, s16 *dest_x, s16 *dest_y)
|
||||
void SetSpritePosToMapCoords(s16 mapX, s16 mapY, s16 *destX, s16 *destY)
|
||||
{
|
||||
s16 dx;
|
||||
s16 dy;
|
||||
|
||||
dx = -gTotalCameraPixelOffsetX - gFieldCamera.x;
|
||||
dy = -gTotalCameraPixelOffsetY - gFieldCamera.y;
|
||||
s16 dx = -gTotalCameraPixelOffsetX - gFieldCamera.x;
|
||||
s16 dy = -gTotalCameraPixelOffsetY - gFieldCamera.y;
|
||||
if (gFieldCamera.x > 0)
|
||||
{
|
||||
dx += 0x10;
|
||||
}
|
||||
dx += 1 << 4;
|
||||
|
||||
if (gFieldCamera.x < 0)
|
||||
{
|
||||
dx -= 0x10;
|
||||
}
|
||||
dx -= 1 << 4;
|
||||
|
||||
if (gFieldCamera.y > 0)
|
||||
{
|
||||
dy += 0x10;
|
||||
}
|
||||
dy += 1 << 4;
|
||||
|
||||
if (gFieldCamera.y < 0)
|
||||
{
|
||||
dy -= 0x10;
|
||||
}
|
||||
*dest_x = ((x - gSaveBlock1Ptr->pos.x) << 4) + dx;
|
||||
*dest_y = ((y - gSaveBlock1Ptr->pos.y) << 4) + dy;
|
||||
dy -= 1 << 4;
|
||||
|
||||
*destX = ((mapX - gSaveBlock1Ptr->pos.x) << 4) + dx;
|
||||
*destY = ((mapY - gSaveBlock1Ptr->pos.y) << 4) + dy;
|
||||
}
|
||||
|
||||
void sub_80930E0(s16 *x, s16 *y, s16 dx, s16 dy)
|
||||
{
|
||||
sub_8093038(*x, *y, x, y);
|
||||
SetSpritePosToMapCoords(*x, *y, x, y);
|
||||
*x += dx;
|
||||
*y += dy;
|
||||
}
|
||||
|
||||
@@ -1228,7 +1228,7 @@ static void Task_TradeEvolutionScene(u8 taskID)
|
||||
if (!gPaletteFade.active)
|
||||
{
|
||||
if (gWirelessCommType)
|
||||
sub_800E084();
|
||||
DestroyWirelessStatusIndicatorSprite();
|
||||
|
||||
Free(GetBgTilemapBuffer(3));
|
||||
Free(GetBgTilemapBuffer(1));
|
||||
|
||||
+66
-65
@@ -17,12 +17,13 @@ static u8 sub_81D4C9C(struct EventObject*, u8);
|
||||
static u8 sub_81D4C58(struct EventObject*, u8);
|
||||
static u8 sub_81D4CE0(struct EventObject*, u8);
|
||||
static u8 sub_81D4D24(u8);
|
||||
static bool8 sub_81D4834(s16, s16);
|
||||
static bool8 CanMewWalkToCoords(s16, s16);
|
||||
|
||||
extern u8 gUnknown_0203CF50;
|
||||
extern s16 gUnknown_030012F8;
|
||||
extern s16 gUnknown_030012FA;
|
||||
extern u8 gUnknown_030012FC[4];
|
||||
static EWRAM_DATA u8 sUnknown_0203CF50 = 0;
|
||||
|
||||
static s16 sPlayerToMewDeltaX;
|
||||
static s16 sPlayerToMewDeltaY;
|
||||
static u8 sMewDirectionCandidates[4];
|
||||
|
||||
extern const struct SpritePalette gFieldEffectObjectPaletteInfo1;
|
||||
extern const struct SpriteTemplate *const gFieldEffectObjectTemplatePointers[];
|
||||
@@ -35,23 +36,23 @@ static const s16 sFarawayIslandRockCoords[4][2] =
|
||||
{20, 20},
|
||||
};
|
||||
|
||||
static u8 sub_81D4258(void)
|
||||
static u8 GetMewEventObjectId(void)
|
||||
{
|
||||
u8 eventObjectId;
|
||||
TryGetEventObjectIdByLocalIdAndMap(1, gSaveBlock1Ptr->location.mapNum, gSaveBlock1Ptr->location.mapGroup, &eventObjectId);
|
||||
return eventObjectId;
|
||||
}
|
||||
|
||||
u32 sub_81D427C(void)
|
||||
u32 GetMewMoveDirection(void)
|
||||
{
|
||||
u8 i;
|
||||
int skip;
|
||||
struct EventObject *mew = &gEventObjects[sub_81D4258()];
|
||||
struct EventObject *mew = &gEventObjects[GetMewEventObjectId()];
|
||||
|
||||
gUnknown_030012F8 = gEventObjects[gPlayerAvatar.eventObjectId].previousCoords.x - mew->currentCoords.x;
|
||||
gUnknown_030012FA = gEventObjects[gPlayerAvatar.eventObjectId].previousCoords.y - mew->currentCoords.y;
|
||||
for (i = 0; i < ARRAY_COUNT(gUnknown_030012FC); i++)
|
||||
gUnknown_030012FC[i] = DIR_NONE;
|
||||
sPlayerToMewDeltaX = gEventObjects[gPlayerAvatar.eventObjectId].previousCoords.x - mew->currentCoords.x;
|
||||
sPlayerToMewDeltaY = gEventObjects[gPlayerAvatar.eventObjectId].previousCoords.y - mew->currentCoords.y;
|
||||
for (i = 0; i < ARRAY_COUNT(sMewDirectionCandidates); i++)
|
||||
sMewDirectionCandidates[i] = DIR_NONE;
|
||||
|
||||
if (gEventObjects[gPlayerAvatar.eventObjectId].previousCoords.x == gEventObjects[gPlayerAvatar.eventObjectId].currentCoords.x
|
||||
&& gEventObjects[gPlayerAvatar.eventObjectId].previousCoords.y == gEventObjects[gPlayerAvatar.eventObjectId].currentCoords.y)
|
||||
@@ -85,33 +86,33 @@ u32 sub_81D427C(void)
|
||||
|
||||
if (!skip)
|
||||
{
|
||||
if (gUnknown_030012F8 > 0)
|
||||
if (sPlayerToMewDeltaX > 0)
|
||||
{
|
||||
if (mew->currentCoords.x + 1 == gEventObjects[gPlayerAvatar.eventObjectId].previousCoords.x)
|
||||
{
|
||||
if (sub_81D4834(mew->currentCoords.x + 1, mew->currentCoords.y))
|
||||
if (CanMewWalkToCoords(mew->currentCoords.x + 1, mew->currentCoords.y))
|
||||
return DIR_EAST;
|
||||
}
|
||||
}
|
||||
else if (gUnknown_030012F8 < 0)
|
||||
else if (sPlayerToMewDeltaX < 0)
|
||||
{
|
||||
if (mew->currentCoords.x - 1 == gEventObjects[gPlayerAvatar.eventObjectId].previousCoords.x)
|
||||
{
|
||||
if (sub_81D4834(mew->currentCoords.x - 1, mew->currentCoords.y))
|
||||
if (CanMewWalkToCoords(mew->currentCoords.x - 1, mew->currentCoords.y))
|
||||
return DIR_WEST;
|
||||
}
|
||||
}
|
||||
|
||||
if (mew->currentCoords.x == gEventObjects[gPlayerAvatar.eventObjectId].previousCoords.x)
|
||||
{
|
||||
if (gUnknown_030012FA > 0)
|
||||
if (sPlayerToMewDeltaY > 0)
|
||||
{
|
||||
if (sub_81D4834(mew->currentCoords.x, mew->currentCoords.y - 1))
|
||||
if (CanMewWalkToCoords(mew->currentCoords.x, mew->currentCoords.y - 1))
|
||||
return DIR_NORTH;
|
||||
}
|
||||
else
|
||||
{
|
||||
if (sub_81D4834(mew->currentCoords.x, mew->currentCoords.y + 1))
|
||||
if (CanMewWalkToCoords(mew->currentCoords.x, mew->currentCoords.y + 1))
|
||||
return DIR_SOUTH;
|
||||
}
|
||||
}
|
||||
@@ -134,33 +135,33 @@ u32 sub_81D427C(void)
|
||||
|
||||
if (!skip)
|
||||
{
|
||||
if (gUnknown_030012FA > 0)
|
||||
if (sPlayerToMewDeltaY > 0)
|
||||
{
|
||||
if (mew->currentCoords.y + 1 == gEventObjects[gPlayerAvatar.eventObjectId].previousCoords.y)
|
||||
{
|
||||
if (sub_81D4834(mew->currentCoords.x, mew->currentCoords.y + 1))
|
||||
if (CanMewWalkToCoords(mew->currentCoords.x, mew->currentCoords.y + 1))
|
||||
return DIR_SOUTH;
|
||||
}
|
||||
}
|
||||
else if (gUnknown_030012FA < 0)
|
||||
else if (sPlayerToMewDeltaY < 0)
|
||||
{
|
||||
if (mew->currentCoords.y - 1 == gEventObjects[gPlayerAvatar.eventObjectId].previousCoords.y)
|
||||
{
|
||||
if (sub_81D4834(mew->currentCoords.x, mew->currentCoords.y - 1))
|
||||
if (CanMewWalkToCoords(mew->currentCoords.x, mew->currentCoords.y - 1))
|
||||
return DIR_NORTH;
|
||||
}
|
||||
}
|
||||
|
||||
if (mew->currentCoords.y == gEventObjects[gPlayerAvatar.eventObjectId].previousCoords.y)
|
||||
{
|
||||
if (gUnknown_030012F8 > 0)
|
||||
if (sPlayerToMewDeltaX > 0)
|
||||
{
|
||||
if (sub_81D4834(mew->currentCoords.x - 1, mew->currentCoords.y))
|
||||
if (CanMewWalkToCoords(mew->currentCoords.x - 1, mew->currentCoords.y))
|
||||
return DIR_WEST;
|
||||
}
|
||||
else
|
||||
{
|
||||
if (sub_81D4834(mew->currentCoords.x + 1, mew->currentCoords.y))
|
||||
if (CanMewWalkToCoords(mew->currentCoords.x + 1, mew->currentCoords.y))
|
||||
return DIR_EAST;
|
||||
}
|
||||
}
|
||||
@@ -208,52 +209,52 @@ u32 sub_81D427C(void)
|
||||
return DIR_WEST;
|
||||
}
|
||||
|
||||
if (gUnknown_030012FA == 0)
|
||||
if (sPlayerToMewDeltaY == 0)
|
||||
{
|
||||
if (gEventObjects[gPlayerAvatar.eventObjectId].currentCoords.y > mew->currentCoords.y)
|
||||
{
|
||||
if (sub_81D4834(mew->currentCoords.x, mew->currentCoords.y - 1))
|
||||
if (CanMewWalkToCoords(mew->currentCoords.x, mew->currentCoords.y - 1))
|
||||
return DIR_NORTH;
|
||||
}
|
||||
|
||||
if (gEventObjects[gPlayerAvatar.eventObjectId].currentCoords.y < mew->currentCoords.y)
|
||||
{
|
||||
if (sub_81D4834(mew->currentCoords.x, mew->currentCoords.y + 1))
|
||||
if (CanMewWalkToCoords(mew->currentCoords.x, mew->currentCoords.y + 1))
|
||||
return DIR_SOUTH;
|
||||
}
|
||||
|
||||
if (sub_81D4834(mew->currentCoords.x, mew->currentCoords.y - 1))
|
||||
if (CanMewWalkToCoords(mew->currentCoords.x, mew->currentCoords.y - 1))
|
||||
return DIR_NORTH;
|
||||
|
||||
if (sub_81D4834(mew->currentCoords.x, mew->currentCoords.y + 1))
|
||||
if (CanMewWalkToCoords(mew->currentCoords.x, mew->currentCoords.y + 1))
|
||||
return DIR_SOUTH;
|
||||
}
|
||||
|
||||
if (gUnknown_030012F8 == 0)
|
||||
if (sPlayerToMewDeltaX == 0)
|
||||
{
|
||||
if (gEventObjects[gPlayerAvatar.eventObjectId].currentCoords.x > mew->currentCoords.x)
|
||||
{
|
||||
if (sub_81D4834(mew->currentCoords.x - 1, mew->currentCoords.y))
|
||||
if (CanMewWalkToCoords(mew->currentCoords.x - 1, mew->currentCoords.y))
|
||||
return DIR_WEST;
|
||||
}
|
||||
|
||||
if (gEventObjects[gPlayerAvatar.eventObjectId].currentCoords.x < mew->currentCoords.x)
|
||||
{
|
||||
if (sub_81D4834(mew->currentCoords.x + 1, mew->currentCoords.y))
|
||||
if (CanMewWalkToCoords(mew->currentCoords.x + 1, mew->currentCoords.y))
|
||||
return DIR_EAST;
|
||||
}
|
||||
|
||||
if (sub_81D4834(mew->currentCoords.x + 1, mew->currentCoords.y))
|
||||
if (CanMewWalkToCoords(mew->currentCoords.x + 1, mew->currentCoords.y))
|
||||
return DIR_EAST;
|
||||
|
||||
if (sub_81D4834(mew->currentCoords.x - 1, mew->currentCoords.y))
|
||||
if (CanMewWalkToCoords(mew->currentCoords.x - 1, mew->currentCoords.y))
|
||||
return DIR_WEST;
|
||||
}
|
||||
|
||||
return sub_81D4890(DIR_NONE);
|
||||
}
|
||||
|
||||
static bool8 sub_81D4834(s16 x, s16 y)
|
||||
static bool8 CanMewWalkToCoords(s16 x, s16 y)
|
||||
{
|
||||
if (gEventObjects[gPlayerAvatar.eventObjectId].currentCoords.x == x
|
||||
&& gEventObjects[gPlayerAvatar.eventObjectId].currentCoords.y == y)
|
||||
@@ -268,39 +269,39 @@ static u8 sub_81D4890(u8 ignoredDir)
|
||||
{
|
||||
u8 i;
|
||||
u8 count = 0;
|
||||
struct EventObject *mew = &gEventObjects[sub_81D4258()];
|
||||
struct EventObject *mew = &gEventObjects[GetMewEventObjectId()];
|
||||
|
||||
for (i = 0; i < ARRAY_COUNT(gUnknown_030012FC); i++)
|
||||
gUnknown_030012FC[i] = DIR_NONE;
|
||||
for (i = 0; i < ARRAY_COUNT(sMewDirectionCandidates); i++)
|
||||
sMewDirectionCandidates[i] = DIR_NONE;
|
||||
|
||||
if (sub_81D4834(mew->currentCoords.x, mew->currentCoords.y - 1) == TRUE && ignoredDir != DIR_NORTH)
|
||||
if (CanMewWalkToCoords(mew->currentCoords.x, mew->currentCoords.y - 1) == TRUE && ignoredDir != DIR_NORTH)
|
||||
{
|
||||
gUnknown_030012FC[count] = DIR_NORTH;
|
||||
sMewDirectionCandidates[count] = DIR_NORTH;
|
||||
count++;
|
||||
}
|
||||
|
||||
if (sub_81D4834(mew->currentCoords.x + 1, mew->currentCoords.y) == TRUE && ignoredDir != DIR_EAST)
|
||||
if (CanMewWalkToCoords(mew->currentCoords.x + 1, mew->currentCoords.y) == TRUE && ignoredDir != DIR_EAST)
|
||||
{
|
||||
gUnknown_030012FC[count] = DIR_EAST;
|
||||
sMewDirectionCandidates[count] = DIR_EAST;
|
||||
count++;
|
||||
}
|
||||
|
||||
if (sub_81D4834(mew->currentCoords.x, mew->currentCoords.y + 1) == TRUE && ignoredDir != DIR_SOUTH)
|
||||
if (CanMewWalkToCoords(mew->currentCoords.x, mew->currentCoords.y + 1) == TRUE && ignoredDir != DIR_SOUTH)
|
||||
{
|
||||
gUnknown_030012FC[count] = DIR_SOUTH;
|
||||
sMewDirectionCandidates[count] = DIR_SOUTH;
|
||||
count++;
|
||||
}
|
||||
|
||||
if (sub_81D4834(mew->currentCoords.x - 1, mew->currentCoords.y) == TRUE && ignoredDir != DIR_WEST)
|
||||
if (CanMewWalkToCoords(mew->currentCoords.x - 1, mew->currentCoords.y) == TRUE && ignoredDir != DIR_WEST)
|
||||
{
|
||||
gUnknown_030012FC[count] = DIR_WEST;
|
||||
sMewDirectionCandidates[count] = DIR_WEST;
|
||||
count++;
|
||||
}
|
||||
|
||||
if (count > 1)
|
||||
return gUnknown_030012FC[VarGet(VAR_FARAWAY_ISLAND_STEP_COUNTER) % count];
|
||||
return sMewDirectionCandidates[VarGet(VAR_FARAWAY_ISLAND_STEP_COUNTER) % count];
|
||||
else
|
||||
return gUnknown_030012FC[0];
|
||||
return sMewDirectionCandidates[0];
|
||||
}
|
||||
|
||||
void UpdateFarawayIslandStepCounter(void)
|
||||
@@ -355,7 +356,7 @@ void sub_81D4A90(void)
|
||||
s16 x;
|
||||
s16 y;
|
||||
u8 spriteId;
|
||||
struct EventObject *mew = &gEventObjects[sub_81D4258()];
|
||||
struct EventObject *mew = &gEventObjects[GetMewEventObjectId()];
|
||||
|
||||
mew->invisible = 0;
|
||||
if (gSpecialVar_0x8004 == 1)
|
||||
@@ -378,10 +379,10 @@ void sub_81D4A90(void)
|
||||
x = mew->currentCoords.x;
|
||||
y = mew->currentCoords.y;
|
||||
sub_80930E0(&x, &y, 8, 8);
|
||||
gUnknown_0203CF50 = CreateSpriteAtEnd(gFieldEffectObjectTemplatePointers[15], x, y, gSprites[mew->spriteId].subpriority - 1);
|
||||
if (gUnknown_0203CF50 != MAX_SPRITES)
|
||||
sUnknown_0203CF50 = CreateSpriteAtEnd(gFieldEffectObjectTemplatePointers[15], x, y, gSprites[mew->spriteId].subpriority - 1);
|
||||
if (sUnknown_0203CF50 != MAX_SPRITES)
|
||||
{
|
||||
struct Sprite *sprite = &gSprites[gUnknown_0203CF50];
|
||||
struct Sprite *sprite = &gSprites[sUnknown_0203CF50];
|
||||
sprite->coordOffsetEnabled = 1;
|
||||
sprite->oam.priority = 2;
|
||||
sprite->callback = SpriteCallbackDummy;
|
||||
@@ -391,15 +392,15 @@ void sub_81D4A90(void)
|
||||
|
||||
void sub_81D4BEC(void)
|
||||
{
|
||||
if (gUnknown_0203CF50 != MAX_SPRITES)
|
||||
DestroySprite(&gSprites[gUnknown_0203CF50]);
|
||||
if (sUnknown_0203CF50 != MAX_SPRITES)
|
||||
DestroySprite(&gSprites[sUnknown_0203CF50]);
|
||||
}
|
||||
|
||||
static bool8 sub_81D4C14(struct EventObject *mew, u8 index)
|
||||
{
|
||||
if (gUnknown_030012FA > 0 && sub_81D4834(mew->currentCoords.x, mew->currentCoords.y - 1))
|
||||
if (sPlayerToMewDeltaY > 0 && CanMewWalkToCoords(mew->currentCoords.x, mew->currentCoords.y - 1))
|
||||
{
|
||||
gUnknown_030012FC[index] = DIR_NORTH;
|
||||
sMewDirectionCandidates[index] = DIR_NORTH;
|
||||
return TRUE;
|
||||
}
|
||||
|
||||
@@ -408,9 +409,9 @@ static bool8 sub_81D4C14(struct EventObject *mew, u8 index)
|
||||
|
||||
static u8 sub_81D4C58(struct EventObject *mew, u8 index)
|
||||
{
|
||||
if (gUnknown_030012F8 < 0 && sub_81D4834(mew->currentCoords.x + 1, mew->currentCoords.y))
|
||||
if (sPlayerToMewDeltaX < 0 && CanMewWalkToCoords(mew->currentCoords.x + 1, mew->currentCoords.y))
|
||||
{
|
||||
gUnknown_030012FC[index] = DIR_EAST;
|
||||
sMewDirectionCandidates[index] = DIR_EAST;
|
||||
return TRUE;
|
||||
}
|
||||
|
||||
@@ -419,9 +420,9 @@ static u8 sub_81D4C58(struct EventObject *mew, u8 index)
|
||||
|
||||
static u8 sub_81D4C9C(struct EventObject *mew, u8 index)
|
||||
{
|
||||
if (gUnknown_030012FA < 0 && sub_81D4834(mew->currentCoords.x, mew->currentCoords.y + 1))
|
||||
if (sPlayerToMewDeltaY < 0 && CanMewWalkToCoords(mew->currentCoords.x, mew->currentCoords.y + 1))
|
||||
{
|
||||
gUnknown_030012FC[index] = DIR_SOUTH;
|
||||
sMewDirectionCandidates[index] = DIR_SOUTH;
|
||||
return TRUE;
|
||||
}
|
||||
|
||||
@@ -430,9 +431,9 @@ static u8 sub_81D4C9C(struct EventObject *mew, u8 index)
|
||||
|
||||
static u8 sub_81D4CE0(struct EventObject *mew, u8 index)
|
||||
{
|
||||
if (gUnknown_030012F8 > 0 && sub_81D4834(mew->currentCoords.x - 1, mew->currentCoords.y))
|
||||
if (sPlayerToMewDeltaX > 0 && CanMewWalkToCoords(mew->currentCoords.x - 1, mew->currentCoords.y))
|
||||
{
|
||||
gUnknown_030012FC[index] = DIR_WEST;
|
||||
sMewDirectionCandidates[index] = DIR_WEST;
|
||||
return TRUE;
|
||||
}
|
||||
|
||||
@@ -441,5 +442,5 @@ static u8 sub_81D4CE0(struct EventObject *mew, u8 index)
|
||||
|
||||
static u8 sub_81D4D24(u8 mod)
|
||||
{
|
||||
return gUnknown_030012FC[VarGet(VAR_FARAWAY_ISLAND_STEP_COUNTER) % mod];
|
||||
return sMewDirectionCandidates[VarGet(VAR_FARAWAY_ISLAND_STEP_COUNTER) % mod];
|
||||
}
|
||||
|
||||
+37
-4
@@ -284,20 +284,44 @@ bool8 (*const gFieldEffectScriptFuncs[])(u8 **, u32 *) =
|
||||
|
||||
const struct OamData gNewGameBirchOamAttributes =
|
||||
{
|
||||
.y = 0,
|
||||
.affineMode = ST_OAM_AFFINE_OFF,
|
||||
.objMode = ST_OAM_OBJ_NORMAL,
|
||||
.bpp = ST_OAM_4BPP,
|
||||
.shape = SPRITE_SHAPE(64x64),
|
||||
.size = SPRITE_SIZE(64x64)
|
||||
.x = 0,
|
||||
.size = SPRITE_SIZE(64x64),
|
||||
.tileNum = 0,
|
||||
.priority = 0,
|
||||
.paletteNum = 0,
|
||||
};
|
||||
|
||||
const struct OamData gOamData_855C218 =
|
||||
{
|
||||
.y = 0,
|
||||
.affineMode = ST_OAM_AFFINE_OFF,
|
||||
.objMode = ST_OAM_OBJ_NORMAL,
|
||||
.bpp = ST_OAM_4BPP,
|
||||
.shape = SPRITE_SHAPE(8x8),
|
||||
.size = SPRITE_SIZE(8x8)
|
||||
.x = 0,
|
||||
.size = SPRITE_SIZE(8x8),
|
||||
.tileNum = 0,
|
||||
.priority = 0,
|
||||
.paletteNum = 0,
|
||||
};
|
||||
|
||||
const struct OamData gOamData_855C220 =
|
||||
{
|
||||
.y = 0,
|
||||
.affineMode = ST_OAM_AFFINE_OFF,
|
||||
.objMode = ST_OAM_OBJ_NORMAL,
|
||||
.bpp = ST_OAM_4BPP,
|
||||
.shape = SPRITE_SHAPE(16x16),
|
||||
.size = SPRITE_SIZE(16x16)
|
||||
.x = 0,
|
||||
.size = SPRITE_SIZE(16x16),
|
||||
.tileNum = 0,
|
||||
.priority = 0,
|
||||
.paletteNum = 0,
|
||||
};
|
||||
|
||||
const struct SpriteFrameImage gNewGameBirchPicTable[] =
|
||||
@@ -347,8 +371,16 @@ const struct SpritePalette gFieldEffectObjectPaletteInfo5 =
|
||||
|
||||
const struct OamData gOamData_855C26C =
|
||||
{
|
||||
.y = 0,
|
||||
.affineMode = ST_OAM_AFFINE_OFF,
|
||||
.objMode = ST_OAM_OBJ_NORMAL,
|
||||
.bpp = ST_OAM_4BPP,
|
||||
.shape = SPRITE_SHAPE(32x16),
|
||||
.size = SPRITE_SIZE(32x16)
|
||||
.x = 0,
|
||||
.size = SPRITE_SIZE(32x16),
|
||||
.tileNum = 0,
|
||||
.priority = 0,
|
||||
.paletteNum = 0,
|
||||
};
|
||||
|
||||
const struct SpriteFrameImage gSpriteImageTable_855C274[] =
|
||||
@@ -3759,3 +3791,4 @@ static void Fldeff_MoveDeoxysRock_Step(u8 taskId)
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -191,7 +191,7 @@ void ShowWarpArrowSprite(u8 spriteId, u8 direction, s16 x, s16 y)
|
||||
sprite = &gSprites[spriteId];
|
||||
if (sprite->invisible || sprite->data[0] != x || sprite->data[1] != y)
|
||||
{
|
||||
sub_8093038(x, y, &x2, &y2);
|
||||
SetSpritePosToMapCoords(x, y, &x2, &y2);
|
||||
sprite = &gSprites[spriteId];
|
||||
sprite->pos1.x = x2 + 8;
|
||||
sprite->pos1.y = y2 + 8;
|
||||
|
||||
+7
-6
@@ -91,7 +91,7 @@ static const struct WeatherCallbacks sWeatherFuncs[] =
|
||||
{
|
||||
{None_Init, None_Main, None_Init, None_Finish},
|
||||
{Clouds_InitVars, Clouds_Main, Clouds_InitAll, Clouds_Finish},
|
||||
{Weather2_InitVars, Weather2_Main, Weather2_InitAll, Weather2_Finish},
|
||||
{Sunny_InitVars, Sunny_Main, Sunny_InitAll, Sunny_Finish},
|
||||
{LightRain_InitVars, LightRain_Main, LightRain_InitAll, LightRain_Finish},
|
||||
{Snow_InitVars, Snow_Main, Snow_InitAll, Snow_Finish},
|
||||
{MedRain_InitVars, Rain_Main, MedRain_InitAll, Rain_Finish},
|
||||
@@ -167,15 +167,15 @@ void StartWeather(void)
|
||||
gWeatherPtr->altGammaSpritePalIndex = index;
|
||||
gWeatherPtr->weatherPicSpritePalIndex = AllocSpritePalette(0x1201);
|
||||
gWeatherPtr->rainSpriteCount = 0;
|
||||
gWeatherPtr->unknown_6D8 = 0;
|
||||
gWeatherPtr->curRainSpriteIndex = 0;
|
||||
gWeatherPtr->cloudSpritesCreated = 0;
|
||||
gWeatherPtr->snowflakeSpriteCount = 0;
|
||||
gWeatherPtr->ashSpritesCreated = 0;
|
||||
gWeatherPtr->fog1SpritesCreated = 0;
|
||||
gWeatherPtr->fog2SpritesCreated = 0;
|
||||
gWeatherPtr->sandstormSprites1Created = 0;
|
||||
gWeatherPtr->sandstormSprites2Created = 0;
|
||||
gWeatherPtr->unknown_72E = 0;
|
||||
gWeatherPtr->sandstormSpritesCreated = 0;
|
||||
gWeatherPtr->sandstormSwirlSpritesCreated = 0;
|
||||
gWeatherPtr->bubblesSpritesCreated = 0;
|
||||
gWeatherPtr->lightenedFogSpritePalsCount = 0;
|
||||
Weather_SetBlendCoeffs(16, 0);
|
||||
gWeatherPtr->currWeather = 0;
|
||||
@@ -234,7 +234,8 @@ static void Task_WeatherMain(u8 taskId)
|
||||
{
|
||||
if (gWeatherPtr->currWeather != gWeatherPtr->nextWeather)
|
||||
{
|
||||
if (!sWeatherFuncs[gWeatherPtr->currWeather].finish() && gWeatherPtr->palProcessingState != WEATHER_PAL_STATE_SCREEN_FADING_OUT)
|
||||
if (!sWeatherFuncs[gWeatherPtr->currWeather].finish()
|
||||
&& gWeatherPtr->palProcessingState != WEATHER_PAL_STATE_SCREEN_FADING_OUT)
|
||||
{
|
||||
// Finished cleaning up previous weather. Now transition to next weather.
|
||||
sWeatherFuncs[gWeatherPtr->nextWeather].initVars();
|
||||
|
||||
+1252
-1138
File diff suppressed because it is too large
Load Diff
+1
-1
@@ -23,7 +23,7 @@
|
||||
#include "constants/songs.h"
|
||||
#include "constants/vars.h"
|
||||
|
||||
extern struct MapPosition gPlayerFacingPosition;
|
||||
EWRAM_DATA struct MapPosition gPlayerFacingPosition = {0};
|
||||
|
||||
static void sub_80F9C90(u8);
|
||||
static void sub_80F9DFC(u8);
|
||||
|
||||
@@ -27,9 +27,6 @@ static void sub_813561C(u8 taskId);
|
||||
static void sub_81356C4(void);
|
||||
static void sub_8135714(void);
|
||||
|
||||
// extern RAM loc
|
||||
extern struct MapPosition gPlayerFacingPosition;
|
||||
|
||||
// text
|
||||
bool8 CheckObjectGraphicsInFrontOfPlayer(u8 graphicsId)
|
||||
{
|
||||
|
||||
+57
-49
@@ -87,7 +87,7 @@ const union AffineAnimCmd *const gUnknown_08596D54[] =
|
||||
gUnknown_08596D44,
|
||||
};
|
||||
|
||||
const struct SpriteTemplate gUnknown_08596D58 =
|
||||
const struct SpriteTemplate gShadowBallSpriteTemplate =
|
||||
{
|
||||
.tileTag = ANIM_TAG_SHADOW_BALL,
|
||||
.paletteTag = ANIM_TAG_SHADOW_BALL,
|
||||
@@ -261,20 +261,20 @@ static void sub_81116E8(struct Sprite *sprite)
|
||||
AnimTranslateLinear(sprite);
|
||||
sprite->pos2.x += Sin(sprite->data[5], 10);
|
||||
sprite->pos2.y += Cos(sprite->data[5], 15);
|
||||
|
||||
|
||||
r2 = sprite->data[5];
|
||||
sprite->data[5] = (sprite->data[5] + 5) & 0xFF;
|
||||
r0 = sprite->data[5];
|
||||
|
||||
|
||||
if (r2 == 0 || r2 > 196)
|
||||
{
|
||||
if (r0 > 0)
|
||||
PlaySE(SE_W109);
|
||||
}
|
||||
|
||||
|
||||
if (sprite->data[6] == 0)
|
||||
{
|
||||
sprite->invisible = TRUE;
|
||||
sprite->invisible = TRUE;
|
||||
sprite->callback = DestroyAnimSpriteAndDisableBlend;
|
||||
}
|
||||
else
|
||||
@@ -283,18 +283,18 @@ static void sub_81116E8(struct Sprite *sprite)
|
||||
|
||||
static void sub_8111764(struct Sprite *sprite)
|
||||
{
|
||||
|
||||
s16 r0;
|
||||
|
||||
s16 r0;
|
||||
if (sprite->data[6] > 0xFF)
|
||||
{
|
||||
if (++sprite->data[6] == 0x10d)
|
||||
sprite->data[6] = 0;
|
||||
return;
|
||||
}
|
||||
|
||||
|
||||
r0 = sprite->data[7];
|
||||
sprite->data[7]++;
|
||||
|
||||
|
||||
if ((r0 & 0xFF) == 0)
|
||||
{
|
||||
sprite->data[7] &= 0xff00;
|
||||
@@ -392,16 +392,16 @@ static void sub_811196C(u8 taskId)
|
||||
}
|
||||
}
|
||||
|
||||
// Spins a sprite towards the target, pausing in the middle.
|
||||
// Used in Shadow Ball.
|
||||
// Spins a sprite towards the target, pausing in the middle.
|
||||
// Used in Shadow Ball.
|
||||
// arg 0: duration step 1 (attacker -> center)
|
||||
// arg 1: duration step 2 (spin center)
|
||||
// arg 2: duration step 3 (center -> target)
|
||||
static void InitAnimShadowBall(struct Sprite *sprite)
|
||||
{
|
||||
u16 r5, r6;
|
||||
r5 = sprite->pos1.x;
|
||||
r6 = sprite->pos1.y;
|
||||
s16 oldPosX = sprite->pos1.x;
|
||||
s16 oldPosY = sprite->pos1.y;
|
||||
|
||||
sprite->pos1.x = GetBattlerSpriteCoord(gBattleAnimAttacker, 2);
|
||||
sprite->pos1.y = GetBattlerSpriteCoord(gBattleAnimAttacker, 3);
|
||||
sprite->data[0] = 0;
|
||||
@@ -410,8 +410,8 @@ static void InitAnimShadowBall(struct Sprite *sprite)
|
||||
sprite->data[3] = gBattleAnimArgs[2];
|
||||
sprite->data[4] = sprite->pos1.x << 4;
|
||||
sprite->data[5] = sprite->pos1.y << 4;
|
||||
sprite->data[6] = (((s16)r5 - sprite->pos1.x) << 4) / (gBattleAnimArgs[0] << 1);
|
||||
sprite->data[7] = (((s16)r6 - sprite->pos1.y) << 4) / (gBattleAnimArgs[0] << 1);
|
||||
sprite->data[6] = ((oldPosX - sprite->pos1.x) << 4) / (gBattleAnimArgs[0] << 1);
|
||||
sprite->data[7] = ((oldPosY - sprite->pos1.y) << 4) / (gBattleAnimArgs[0] << 1);
|
||||
sprite->callback = AnimShadowBallStep;
|
||||
}
|
||||
|
||||
@@ -465,50 +465,57 @@ static void sub_8111B9C(struct Sprite *sprite)
|
||||
sprite->callback = sub_8111BB4;
|
||||
}
|
||||
|
||||
static void sub_8111BB4(struct Sprite *sprite) {
|
||||
|
||||
s8 r5 = FALSE;
|
||||
static void sub_8111BB4(struct Sprite *sprite)
|
||||
{
|
||||
bool8 r5 = FALSE;
|
||||
bool8 r6 = FALSE;
|
||||
if(sprite->animEnded)
|
||||
|
||||
if (sprite->animEnded)
|
||||
{
|
||||
if(!(sprite->invisible))
|
||||
sprite->invisible=TRUE;
|
||||
switch(sprite->data[0])
|
||||
if (!sprite->invisible)
|
||||
sprite->invisible = TRUE;
|
||||
|
||||
switch (sprite->data[0])
|
||||
{
|
||||
case 0:
|
||||
if((sprite->data[1]) != 2)
|
||||
break;
|
||||
goto loc_08111C06;
|
||||
case 1:
|
||||
if((sprite->data[1]) == 4)
|
||||
r5 = TRUE;
|
||||
break;
|
||||
default:
|
||||
r6 = TRUE;
|
||||
default:
|
||||
r6 = TRUE;
|
||||
break;
|
||||
case 0:
|
||||
if (sprite->data[1] == 2)
|
||||
r5 = TRUE;
|
||||
break;
|
||||
case 1:
|
||||
if (sprite->data[1] == 4)
|
||||
r5 = TRUE;
|
||||
break;
|
||||
}
|
||||
if(r5)
|
||||
|
||||
if (r5)
|
||||
{
|
||||
loc_08111C06:
|
||||
sprite->invisible ^= 1;
|
||||
sprite->data[2]++;
|
||||
sprite->data[1] = 0;
|
||||
if(sprite->data[2] == 5)
|
||||
if (sprite->data[2] == 5)
|
||||
{
|
||||
sprite->data[2] = 0;
|
||||
sprite->data[0]++;
|
||||
}
|
||||
}
|
||||
else if(r6)
|
||||
else if (r6)
|
||||
{
|
||||
DestroyAnimSprite(sprite);
|
||||
}
|
||||
else
|
||||
{
|
||||
sprite->data[1]++;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
void sub_8111C50(u8 taskId)
|
||||
{
|
||||
struct Task *task;
|
||||
|
||||
|
||||
task = &gTasks[taskId];
|
||||
task->data[0] = CloneBattlerSpriteWithBlend(1);
|
||||
if (task->data[0] < 0)
|
||||
@@ -523,7 +530,7 @@ void sub_8111C50(u8 taskId)
|
||||
SetGpuReg(REG_OFFSET_BLDCNT, (BLDCNT_EFFECT_BLEND | BLDCNT_TGT2_ALL));
|
||||
SetGpuReg(REG_OFFSET_BLDALPHA, BLDALPHA_BLEND(task->data[2], task->data[3]));
|
||||
gSprites[task->data[0]].data[0] = 80;
|
||||
if (GetBattlerSide(gBattleAnimTarget) == 0)
|
||||
if (GetBattlerSide(gBattleAnimTarget) == B_SIDE_PLAYER)
|
||||
{
|
||||
gSprites[task->data[0]].data[1] = -144;
|
||||
gSprites[task->data[0]].data[2] = 112;
|
||||
@@ -573,6 +580,7 @@ static void sub_8111D78(u8 taskId)
|
||||
break;
|
||||
case 2:
|
||||
DestroyAnimVisualTask(taskId);
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -595,7 +603,7 @@ static void sub_8111E78(u8 taskId)
|
||||
switch (task->data[15])
|
||||
{
|
||||
case 0:
|
||||
task->data[14] = AllocSpritePalette(0x2771);
|
||||
task->data[14] = AllocSpritePalette(ANIM_TAG_BENT_SPOON);
|
||||
if (task->data[14] == 0xFF || task->data[14] == 0xF)
|
||||
{
|
||||
DestroyAnimVisualTask(taskId);
|
||||
@@ -605,7 +613,7 @@ static void sub_8111E78(u8 taskId)
|
||||
task->data[0] = CloneBattlerSpriteWithBlend(1);
|
||||
if (task->data[0] < 0)
|
||||
{
|
||||
FreeSpritePaletteByTag(0x2771);
|
||||
FreeSpritePaletteByTag(ANIM_TAG_BENT_SPOON);
|
||||
DestroyAnimVisualTask(taskId);
|
||||
}
|
||||
else
|
||||
@@ -698,14 +706,14 @@ static void sub_81120DC(u8 taskId)
|
||||
static void sub_8112170(u8 taskId)
|
||||
{
|
||||
struct Task *task = &gTasks[taskId];
|
||||
u8 position = GetBattlerSpriteBGPriorityRank(gBattleAnimTarget);
|
||||
u8 rank = GetBattlerSpriteBGPriorityRank(gBattleAnimTarget);
|
||||
|
||||
switch (task->data[15])
|
||||
{
|
||||
case 0:
|
||||
gScanlineEffect.state = 3;
|
||||
task->data[14] = GetAnimBattlerSpriteId(1);
|
||||
if (position == 1)
|
||||
if (rank == 1)
|
||||
ClearGpuRegBits(REG_OFFSET_DISPCNT, DISPCNT_BG1_ON);
|
||||
else
|
||||
ClearGpuRegBits(REG_OFFSET_DISPCNT, DISPCNT_BG2_ON);
|
||||
@@ -714,12 +722,12 @@ static void sub_8112170(u8 taskId)
|
||||
BlendPalette(task->data[4], 16, 0, RGB(13, 0, 15));
|
||||
break;
|
||||
case 2:
|
||||
gSprites[task->data[14]].invisible = 1;
|
||||
gSprites[task->data[14]].invisible = TRUE;
|
||||
obj_delete_but_dont_free_vram(&gSprites[task->data[0]]);
|
||||
FreeSpritePaletteByTag(0x2771);
|
||||
FreeSpritePaletteByTag(ANIM_TAG_BENT_SPOON);
|
||||
SetGpuReg(REG_OFFSET_BLDCNT, 0);
|
||||
SetGpuReg(REG_OFFSET_BLDALPHA, 0);
|
||||
if (position == 1)
|
||||
if (rank == 1)
|
||||
SetGpuRegBits(REG_OFFSET_DISPCNT, DISPCNT_BG1_ON);
|
||||
else
|
||||
SetGpuRegBits(REG_OFFSET_DISPCNT, DISPCNT_BG2_ON);
|
||||
@@ -886,7 +894,7 @@ static void sub_81125E0(u8 taskId)
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
if (task->data[10])
|
||||
task->data[10]--;
|
||||
else if (task->data[6])
|
||||
@@ -1081,7 +1089,7 @@ static void sub_8112ACC(struct Sprite *sprite)
|
||||
if (sprite->data[0] == 0)
|
||||
{
|
||||
SetGpuReg(REG_OFFSET_BLDCNT, (BLDCNT_EFFECT_BLEND | BLDCNT_TGT2_ALL));
|
||||
SetGpuReg(REG_OFFSET_BLDALPHA, BLDALPHA_BLEND(0x10, 0));
|
||||
SetGpuReg(REG_OFFSET_BLDALPHA, BLDALPHA_BLEND(16, 0));
|
||||
sprite->data[0]++;
|
||||
sprite->data[1] = 0;
|
||||
sprite->data[2] = 0;
|
||||
@@ -1120,7 +1128,7 @@ static void sub_8112B78(struct Sprite *sprite)
|
||||
sprite->pos2.x = Sin(sprite->data[0], 12);
|
||||
if (GetBattlerSide(gBattleAnimAttacker) != B_SIDE_PLAYER)
|
||||
sprite->pos2.x = -sprite->pos2.x;
|
||||
|
||||
|
||||
sprite->data[0] = (sprite->data[0] + 6) & 0xFF;
|
||||
sprite->data[1] += 0x100;
|
||||
sprite->pos2.y = -(sprite->data[1] >> 8);
|
||||
|
||||
@@ -62,7 +62,7 @@ int sub_81DB3D8(const struct MenuAction *str, const u8* arg1, int arg2)
|
||||
return convert_pixel_width_to_tile_width(var);
|
||||
}
|
||||
|
||||
int sub_81DB41C(const struct ListMenuTemplate *listMenu)
|
||||
int Intl_GetListMenuWidth(const struct ListMenuTemplate *listMenu)
|
||||
{
|
||||
int i, maxWidth, finalWidth;
|
||||
const struct ListMenuItem *items = listMenu->items;
|
||||
|
||||
+1
-1
@@ -122,7 +122,7 @@ u8 AddItemIconSprite(u16 tilesTag, u16 paletteTag, u16 itemId)
|
||||
}
|
||||
}
|
||||
|
||||
u8 AddCustomItemIconSprite(struct SpriteTemplate *customSpriteTemplate, u16 tilesTag, u16 paletteTag, u16 itemId)
|
||||
u8 AddCustomItemIconSprite(const struct SpriteTemplate *customSpriteTemplate, u16 tilesTag, u16 paletteTag, u16 itemId)
|
||||
{
|
||||
if (!AllocItemIconTemporaryBuffers())
|
||||
{
|
||||
|
||||
+4
-4
@@ -42,8 +42,8 @@
|
||||
#include "constants/vars.h"
|
||||
#include "event_obj_lock.h"
|
||||
|
||||
extern u8 Route102_EventScript_274482[];
|
||||
extern u8 Route102_EventScript_2744C0[];
|
||||
extern u8 BerryTree_EventScript_274482[];
|
||||
extern u8 BerryTree_EventScript_2744C0[];
|
||||
extern u8 BattleFrontier_OutsideEast_EventScript_242CFC[];
|
||||
|
||||
void SetUpItemUseCallback(u8 taskId);
|
||||
@@ -669,7 +669,7 @@ void sub_80FDD74(u8 taskId)
|
||||
{
|
||||
RemoveBagItem(gSpecialVar_ItemId, 1);
|
||||
ScriptContext2_Enable();
|
||||
ScriptContext1_SetupScript(Route102_EventScript_274482);
|
||||
ScriptContext1_SetupScript(BerryTree_EventScript_274482);
|
||||
DestroyTask(taskId);
|
||||
}
|
||||
|
||||
@@ -694,7 +694,7 @@ void ItemUseOutOfBattle_WailmerPail(u8 taskId)
|
||||
void sub_80FDE08(u8 taskId)
|
||||
{
|
||||
ScriptContext2_Enable();
|
||||
ScriptContext1_SetupScript(Route102_EventScript_2744C0);
|
||||
ScriptContext1_SetupScript(BerryTree_EventScript_2744C0);
|
||||
DestroyTask(taskId);
|
||||
}
|
||||
|
||||
|
||||
+35
-13
@@ -11,13 +11,13 @@
|
||||
#include "overworld.h"
|
||||
#include "random.h"
|
||||
#include "palette.h"
|
||||
#include "rom_8011DC0.h"
|
||||
#include "union_room.h"
|
||||
#include "string_util.h"
|
||||
#include "task.h"
|
||||
#include "text.h"
|
||||
#include "constants/species.h"
|
||||
#include "save.h"
|
||||
#include "rom_8011DC0.h"
|
||||
#include "mystery_gift.h"
|
||||
|
||||
extern u16 gHeldKeyCodeToSend;
|
||||
|
||||
@@ -154,9 +154,18 @@ const u8 sWireless_RSEtoASCIITable[] = {
|
||||
0x20, 0x2b, 0x5b, 0x5c, 0x5d, 0x5e, 0x5f, 0x20,
|
||||
0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x00
|
||||
};
|
||||
const struct OamData sWirelessStatusIndicatorOamData = {
|
||||
const struct OamData sWirelessStatusIndicatorOamData =
|
||||
{
|
||||
.y = 0,
|
||||
.affineMode = ST_OAM_AFFINE_OFF,
|
||||
.objMode = ST_OAM_OBJ_NORMAL,
|
||||
.bpp = ST_OAM_4BPP,
|
||||
.shape = SPRITE_SHAPE(16x16),
|
||||
.size = SPRITE_SIZE(16x16)
|
||||
.x = 0,
|
||||
.size = SPRITE_SIZE(16x16),
|
||||
.tileNum = 0,
|
||||
.priority = 0,
|
||||
.paletteNum = 0,
|
||||
};
|
||||
static const union AnimCmd sWirelessStatusIndicatorAnim0[] = {
|
||||
// 3 bars
|
||||
@@ -310,10 +319,22 @@ const char gUnknown_082ED7EC[] = "PokemonSioInfo";
|
||||
const char gUnknown_082ED7FC[] = "LINK LOSS DISCONNECT!";
|
||||
const char gUnknown_082ED814[] = "LINK LOSS RECOVERY NOW";
|
||||
|
||||
extern const char gUnknown_082ED82C[];
|
||||
extern const char gUnknown_082ED84B[];
|
||||
extern const char gUnknown_082ED85B[];
|
||||
extern const char gUnknown_082ED868[];
|
||||
ALIGNED(4) const char gUnknown_082ED82C[31] = {' ',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ',0x00};
|
||||
const char gUnknown_082ED84B[16] = {' ',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ',0x00};
|
||||
const char gUnknown_082ED85B[9] = {' ',' ',' ',' ',' ',' ',' ',' ',0x00};
|
||||
ALIGNED(4) const char gUnknown_082ED864[2] = {' ',0x00};
|
||||
const char gUnknown_082ED866[2] = {'*',0x00};
|
||||
const char gUnknown_082ED868[8] = "NOWSLOT";
|
||||
const char gUnknown_082ED870[12] = " ";
|
||||
const char gUnknown_082ED87C[12] = "CLOCK DRIFT";
|
||||
const char gUnknown_082ED888[12] = "BUSY SEND ";
|
||||
const char gUnknown_082ED894[12] = "CMD REJECT ";
|
||||
const char gUnknown_082ED8A0[12] = "CLOCK SLAVE";
|
||||
const char gUnknown_082ED8A8[3][8] = {
|
||||
"CHILD ",
|
||||
"PARENT",
|
||||
"SEARCH"
|
||||
};
|
||||
|
||||
// .text
|
||||
|
||||
@@ -2231,7 +2252,7 @@ void CreateWirelessStatusIndicatorSprite(u8 x, u8 y)
|
||||
}
|
||||
}
|
||||
|
||||
void sub_800E084(void)
|
||||
void DestroyWirelessStatusIndicatorSprite(void)
|
||||
{
|
||||
if (gSprites[gWirelessStatusIndicatorSpriteId].data[7] == 0x1234)
|
||||
{
|
||||
@@ -2344,7 +2365,7 @@ void sub_800E174(void)
|
||||
CpuCopy16(gMain.oamBuffer + 125, (struct OamData *)OAM + 125, sizeof(struct OamData));
|
||||
if (sub_8011A74() == 1)
|
||||
{
|
||||
sub_800E084();
|
||||
DestroyWirelessStatusIndicatorSprite();
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -3653,7 +3674,7 @@ void sub_8010168(void)
|
||||
gUnknown_03005000.unk_00 = sub_8010148;
|
||||
}
|
||||
|
||||
void sub_8010198(void)
|
||||
void LinkRfu_FatalError(void)
|
||||
{
|
||||
sub_800D630();
|
||||
gUnknown_03005000.unk_ce4 = 1;
|
||||
@@ -4197,7 +4218,7 @@ void sub_8010DB4(void)
|
||||
{
|
||||
if (gUnknown_03005000.unk_ee == 1 && gUnknown_03004140.unk_02 == 0)
|
||||
{
|
||||
if (gMain.callback2 == sub_8018438 || gUnknown_03004140.unk_3c->unk_04)
|
||||
if (gMain.callback2 == c2_mystery_gift_e_reader_run || gUnknown_03004140.unk_3c->unk_04)
|
||||
gWirelessCommType = 2;
|
||||
SetMainCallback2(CB2_LinkError);
|
||||
gMain.savedCallback = CB2_LinkError;
|
||||
@@ -4729,7 +4750,7 @@ bool32 sub_8011A80(void)
|
||||
return FALSE;
|
||||
}
|
||||
|
||||
u8 sub_8011A9C(void)
|
||||
bool32 sub_8011A9C(void)
|
||||
{
|
||||
return gUnknown_03005000.unk_ce8;
|
||||
}
|
||||
@@ -5170,3 +5191,4 @@ u32 GetRfuRecvQueueLength(void)
|
||||
{
|
||||
return gUnknown_03005000.unk_124.unk_8c2;
|
||||
}
|
||||
|
||||
|
||||
+2
-2
@@ -312,7 +312,7 @@ static void ListMenuDummyTask(u8 taskId)
|
||||
|
||||
}
|
||||
|
||||
s32 DoMysteryGiftListMenu(struct WindowTemplate *windowTemplate, struct ListMenuTemplate *listMenuTemplate, u8 arg2, u16 tileNum, u16 palNum)
|
||||
s32 DoMysteryGiftListMenu(const struct WindowTemplate *windowTemplate, const struct ListMenuTemplate *listMenuTemplate, u8 arg2, u16 tileNum, u16 palNum)
|
||||
{
|
||||
switch (sMysteryGiftLinkMenu.state)
|
||||
{
|
||||
@@ -324,7 +324,7 @@ s32 DoMysteryGiftListMenu(struct WindowTemplate *windowTemplate, struct ListMenu
|
||||
case 2:
|
||||
LoadUserWindowBorderGfx(sMysteryGiftLinkMenu.windowId, tileNum, palNum);
|
||||
case 1:
|
||||
sub_8098858(sMysteryGiftLinkMenu.windowId, tileNum, palNum / 16);
|
||||
DrawTextBorderOuter(sMysteryGiftLinkMenu.windowId, tileNum, palNum / 16);
|
||||
break;
|
||||
}
|
||||
gMultiuseListMenuTemplate = *listMenuTemplate;
|
||||
|
||||
+3
-2
@@ -23,7 +23,7 @@
|
||||
#include "palette.h"
|
||||
#include "pokeball.h"
|
||||
#include "pokedex.h"
|
||||
#include "pokemon_3.h"
|
||||
#include "pokemon.h"
|
||||
#include "random.h"
|
||||
#include "rtc.h"
|
||||
#include "save.h"
|
||||
@@ -38,6 +38,7 @@
|
||||
#include "text_window.h"
|
||||
#include "title_screen.h"
|
||||
#include "window.h"
|
||||
#include "mystery_gift.h"
|
||||
|
||||
/*
|
||||
* Main menu state machine
|
||||
@@ -1083,7 +1084,7 @@ static void Task_HandleMainMenuAPressed(u8 taskId)
|
||||
DestroyTask(taskId);
|
||||
break;
|
||||
case ACTION_EREADER:
|
||||
SetMainCallback2(sub_801867C);
|
||||
SetMainCallback2(c2_ereader);
|
||||
DestroyTask(taskId);
|
||||
break;
|
||||
case ACTION_INVALID:
|
||||
|
||||
@@ -914,7 +914,7 @@ struct Story
|
||||
};
|
||||
|
||||
static const struct Story sStorytellerStories[] = {
|
||||
{GAME_STAT_50, 1, MauvilleCity_PokemonCenter_1F_Text_28E930, MauvilleCity_PokemonCenter_1F_Text_28E947, MauvilleCity_PokemonCenter_1F_Text_28E956},
|
||||
{GAME_STAT_NUM_UNION_ROOM_BATTLES, 1, MauvilleCity_PokemonCenter_1F_Text_28E930, MauvilleCity_PokemonCenter_1F_Text_28E947, MauvilleCity_PokemonCenter_1F_Text_28E956},
|
||||
{GAME_STAT_STARTED_TRENDS, 1, MauvilleCity_PokemonCenter_1F_Text_28E9D7, MauvilleCity_PokemonCenter_1F_Text_28E9EF, MauvilleCity_PokemonCenter_1F_Text_28E9FE},
|
||||
{GAME_STAT_PLANTED_BERRIES, 1, MauvilleCity_PokemonCenter_1F_Text_28EA7D, MauvilleCity_PokemonCenter_1F_Text_28EA98, MauvilleCity_PokemonCenter_1F_Text_28EAA8},
|
||||
{GAME_STAT_TRADED_BIKES, 1, MauvilleCity_PokemonCenter_1F_Text_28EB19, MauvilleCity_PokemonCenter_1F_Text_28EB31, MauvilleCity_PokemonCenter_1F_Text_28EB3E},
|
||||
@@ -1193,7 +1193,7 @@ static void Task_StoryListMenu(u8 taskId) // Task_StoryListMenu
|
||||
gSpecialVar_Result = 1;
|
||||
sSelectedStory = selection;
|
||||
}
|
||||
sub_80E2A78(sStorytellerWindowId);
|
||||
ClearToTransparentAndRemoveWindow(sStorytellerWindowId);
|
||||
DestroyTask(taskId);
|
||||
EnableBothScriptContexts();
|
||||
break;
|
||||
|
||||
+33
-35
@@ -43,8 +43,8 @@ struct Menu
|
||||
u8 fontId;
|
||||
u8 optionWidth;
|
||||
u8 optionHeight;
|
||||
u8 horizontalCount;
|
||||
u8 verticalCount;
|
||||
u8 columns;
|
||||
u8 rows;
|
||||
bool8 APressMuted;
|
||||
};
|
||||
|
||||
@@ -432,7 +432,7 @@ void sub_819789C(void)
|
||||
LoadPalette(gUnknown_0860F074, STD_WINDOW_PALETTE_NUM * 0x10, 0x14);
|
||||
}
|
||||
|
||||
void sub_81978B0(u16 offset)
|
||||
void Menu_LoadStdPalAt(u16 offset)
|
||||
{
|
||||
LoadPalette(gUnknown_0860F074, offset, 0x14);
|
||||
}
|
||||
@@ -1283,8 +1283,8 @@ u8 sub_8198F58(u8 windowId, u8 fontId, u8 left, u8 top, u8 a4, u8 cursorHeight,
|
||||
sMenu.fontId = fontId;
|
||||
sMenu.optionWidth = a4;
|
||||
sMenu.optionHeight = cursorHeight;
|
||||
sMenu.horizontalCount = a6;
|
||||
sMenu.verticalCount = a7;
|
||||
sMenu.columns = a6;
|
||||
sMenu.rows = a7;
|
||||
|
||||
pos = a9;
|
||||
|
||||
@@ -1308,16 +1308,16 @@ void sub_8199060(u8 oldCursorPos, u8 newCursorPos)
|
||||
{
|
||||
u8 cursorWidth = GetMenuCursorDimensionByFont(sMenu.fontId, 0);
|
||||
u8 cursorHeight = GetMenuCursorDimensionByFont(sMenu.fontId, 1);
|
||||
u8 xPos = (oldCursorPos % sMenu.horizontalCount) * sMenu.optionWidth + sMenu.left;
|
||||
u8 yPos = (oldCursorPos / sMenu.horizontalCount) * sMenu.optionHeight + sMenu.top;
|
||||
u8 xPos = (oldCursorPos % sMenu.columns) * sMenu.optionWidth + sMenu.left;
|
||||
u8 yPos = (oldCursorPos / sMenu.columns) * sMenu.optionHeight + sMenu.top;
|
||||
FillWindowPixelRect(sMenu.windowId,
|
||||
PIXEL_FILL(1),
|
||||
xPos,
|
||||
yPos,
|
||||
cursorWidth,
|
||||
cursorHeight);
|
||||
xPos = (newCursorPos % sMenu.horizontalCount) * sMenu.optionWidth + sMenu.left;
|
||||
yPos = (newCursorPos / sMenu.horizontalCount) * sMenu.optionHeight + sMenu.top;
|
||||
xPos = (newCursorPos % sMenu.columns) * sMenu.optionWidth + sMenu.left;
|
||||
yPos = (newCursorPos / sMenu.columns) * sMenu.optionHeight + sMenu.top;
|
||||
AddTextPrinterParameterized(sMenu.windowId,
|
||||
sMenu.fontId,
|
||||
gText_SelectorArrow3,
|
||||
@@ -1333,13 +1333,13 @@ u8 sub_8199134(s8 deltaX, s8 deltaY)
|
||||
|
||||
if (deltaX != 0)
|
||||
{
|
||||
if ((sMenu.cursorPos % sMenu.horizontalCount) + deltaX < 0)
|
||||
if ((sMenu.cursorPos % sMenu.columns) + deltaX < 0)
|
||||
{
|
||||
sMenu.cursorPos += sMenu.horizontalCount - 1;
|
||||
sMenu.cursorPos += sMenu.columns - 1;
|
||||
}
|
||||
else if ((sMenu.cursorPos % sMenu.horizontalCount) + deltaX >= sMenu.horizontalCount)
|
||||
else if ((sMenu.cursorPos % sMenu.columns) + deltaX >= sMenu.columns)
|
||||
{
|
||||
sMenu.cursorPos = (sMenu.cursorPos / sMenu.horizontalCount) * sMenu.horizontalCount;
|
||||
sMenu.cursorPos = (sMenu.cursorPos / sMenu.columns) * sMenu.columns;
|
||||
}
|
||||
else
|
||||
{
|
||||
@@ -1349,17 +1349,17 @@ u8 sub_8199134(s8 deltaX, s8 deltaY)
|
||||
|
||||
if (deltaY != 0)
|
||||
{
|
||||
if ((sMenu.cursorPos / sMenu.horizontalCount) + deltaY < 0)
|
||||
if ((sMenu.cursorPos / sMenu.columns) + deltaY < 0)
|
||||
{
|
||||
sMenu.cursorPos += sMenu.horizontalCount * (sMenu.verticalCount - 1);
|
||||
sMenu.cursorPos += sMenu.columns * (sMenu.rows - 1);
|
||||
}
|
||||
else if ((sMenu.cursorPos / sMenu.horizontalCount) + deltaY >= sMenu.verticalCount)
|
||||
else if ((sMenu.cursorPos / sMenu.columns) + deltaY >= sMenu.rows)
|
||||
{
|
||||
sMenu.cursorPos -= sMenu.horizontalCount * (sMenu.verticalCount - 1);
|
||||
sMenu.cursorPos -= sMenu.columns * (sMenu.rows - 1);
|
||||
}
|
||||
else
|
||||
{
|
||||
sMenu.cursorPos += (sMenu.horizontalCount * deltaY);
|
||||
sMenu.cursorPos += (sMenu.columns * deltaY);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1381,8 +1381,8 @@ u8 sub_81991F8(s8 deltaX, s8 deltaY)
|
||||
|
||||
if (deltaX != 0)
|
||||
{
|
||||
if (((sMenu.cursorPos % sMenu.horizontalCount) + deltaX >= 0) &&
|
||||
((sMenu.cursorPos % sMenu.horizontalCount) + deltaX < sMenu.horizontalCount))
|
||||
if (((sMenu.cursorPos % sMenu.columns) + deltaX >= 0) &&
|
||||
((sMenu.cursorPos % sMenu.columns) + deltaX < sMenu.columns))
|
||||
{
|
||||
sMenu.cursorPos += deltaX;
|
||||
}
|
||||
@@ -1390,10 +1390,10 @@ u8 sub_81991F8(s8 deltaX, s8 deltaY)
|
||||
|
||||
if (deltaY != 0)
|
||||
{
|
||||
if (((sMenu.cursorPos / sMenu.horizontalCount) + deltaY >= 0) &&
|
||||
((sMenu.cursorPos / sMenu.horizontalCount) + deltaY < sMenu.verticalCount))
|
||||
if (((sMenu.cursorPos / sMenu.columns) + deltaY >= 0) &&
|
||||
((sMenu.cursorPos / sMenu.columns) + deltaY < sMenu.rows))
|
||||
{
|
||||
sMenu.cursorPos += (sMenu.horizontalCount * deltaY);
|
||||
sMenu.cursorPos += (sMenu.columns * deltaY);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1661,16 +1661,14 @@ void CreateYesNoMenu(const struct WindowTemplate *window, u16 baseTileNum, u8 pa
|
||||
InitMenuInUpperLeftCornerPlaySoundWhenAPressed(sYesNoWindowId, 2, initialCursorPos);
|
||||
}
|
||||
|
||||
void sub_81997AC(u8 windowId, u8 a4, u8 a6, u8 a7, const struct MenuAction *strs)
|
||||
void PrintMenuGridTable(u8 windowId, u8 optionWidth, u8 columns, u8 rows, const struct MenuAction *strs)
|
||||
{
|
||||
u32 i;
|
||||
u32 j;
|
||||
for (i = 0; i < a7; i++)
|
||||
u32 i, j;
|
||||
|
||||
for (i = 0; i < rows; i++)
|
||||
{
|
||||
for (j = 0; j < a6; j++)
|
||||
{
|
||||
AddTextPrinterParameterized(windowId, 1, strs[(i * a6) + j].text, (a4 * j) + 8, (i * 16) + 1, 0xFF, NULL);
|
||||
}
|
||||
for (j = 0; j < columns; j++)
|
||||
AddTextPrinterParameterized(windowId, 1, strs[(i * columns) + j].text, (optionWidth * j) + 8, (i * 16) + 1, 0xFF, NULL);
|
||||
}
|
||||
CopyWindowToVram(windowId, 2);
|
||||
}
|
||||
@@ -1706,20 +1704,20 @@ void sub_819983C(u8 windowId, u8 a4, u8 itemCount, u8 itemCount2, const struct M
|
||||
CopyWindowToVram(windowId, 2);
|
||||
}
|
||||
|
||||
u8 sub_8199944(u8 windowId, u8 optionWidth, u8 horizontalCount, u8 verticalCount, u8 initialCursorPos)
|
||||
u8 sub_8199944(u8 windowId, u8 optionWidth, u8 columns, u8 rows, u8 initialCursorPos)
|
||||
{
|
||||
s32 pos;
|
||||
|
||||
sMenu.left = 0;
|
||||
sMenu.top = 1;
|
||||
sMenu.minCursorPos = 0;
|
||||
sMenu.maxCursorPos = (horizontalCount * verticalCount) - 1;
|
||||
sMenu.maxCursorPos = (columns * rows) - 1;
|
||||
sMenu.windowId = windowId;
|
||||
sMenu.fontId = 1;
|
||||
sMenu.optionWidth = optionWidth;
|
||||
sMenu.optionHeight = 16;
|
||||
sMenu.horizontalCount = horizontalCount;
|
||||
sMenu.verticalCount = verticalCount;
|
||||
sMenu.columns = columns;
|
||||
sMenu.rows = rows;
|
||||
|
||||
pos = initialCursorPos;
|
||||
|
||||
|
||||
+1004
-1
File diff suppressed because it is too large
Load Diff
+68
-68
@@ -14,9 +14,9 @@
|
||||
static EWRAM_DATA bool32 gUnknown_02022C70 = FALSE;
|
||||
|
||||
static void sub_801B180(void);
|
||||
static void sub_801B14C(void);
|
||||
static bool32 sub_801B114(const struct MEventBuffer_3120_Sub *data);
|
||||
static bool32 sub_801B2CC(const struct MEventBuffer_32E0_Sub *data);
|
||||
static void s_DestroyWonderNews(void);
|
||||
static bool32 sub_801B114(const struct WonderNews *data);
|
||||
static bool32 sub_801B2CC(const struct WonderCard *data);
|
||||
static void sub_801B330(void);
|
||||
static void sub_801B368(void);
|
||||
static void sub_801B9F8(void);
|
||||
@@ -29,14 +29,14 @@ void sub_801AFD8(void)
|
||||
sub_811F8BC();
|
||||
}
|
||||
|
||||
struct MEventBuffer_3120_Sub *sub_801B00C(void)
|
||||
struct WonderNews *GetSavedWonderNews(void)
|
||||
{
|
||||
return &gSaveBlock1Ptr->unk_322C.buffer_000.data;
|
||||
return &gSaveBlock1Ptr->unk_322C.wonderNews.data;
|
||||
}
|
||||
|
||||
struct MEventBuffer_32E0_Sub *sav1_get_mevent_buffer_1(void)
|
||||
struct WonderCard *GetSavedWonderCard(void)
|
||||
{
|
||||
return &gSaveBlock1Ptr->unk_322C.buffer_1c0.data;
|
||||
return &gSaveBlock1Ptr->unk_322C.wonderCard.data;
|
||||
}
|
||||
|
||||
struct MEventBuffer_3430_Sub *sav1_get_mevent_buffer_2(void)
|
||||
@@ -54,33 +54,33 @@ u16 *sub_801B058(void)
|
||||
return gSaveBlock1Ptr->unk_322C.unk_338;
|
||||
}
|
||||
|
||||
void sub_801B06C(void)
|
||||
void DestroyWonderNews(void)
|
||||
{
|
||||
sub_801B14C();
|
||||
s_DestroyWonderNews();
|
||||
}
|
||||
|
||||
bool32 sub_801B078(const struct MEventBuffer_3120_Sub *src)
|
||||
bool32 sub_801B078(const struct WonderNews *src)
|
||||
{
|
||||
if (!sub_801B114(src))
|
||||
return FALSE;
|
||||
|
||||
sub_801B14C();
|
||||
gSaveBlock1Ptr->unk_322C.buffer_000.data = *src;
|
||||
gSaveBlock1Ptr->unk_322C.buffer_000.crc = CalcCRC16WithTable((void *)&gSaveBlock1Ptr->unk_322C.buffer_000.data, sizeof(struct MEventBuffer_3120_Sub));
|
||||
s_DestroyWonderNews();
|
||||
gSaveBlock1Ptr->unk_322C.wonderNews.data = *src;
|
||||
gSaveBlock1Ptr->unk_322C.wonderNews.crc = CalcCRC16WithTable((void *)&gSaveBlock1Ptr->unk_322C.wonderNews.data, sizeof(struct WonderNews));
|
||||
return TRUE;
|
||||
}
|
||||
|
||||
bool32 sub_801B0CC(void)
|
||||
bool32 ValidateReceivedWonderNews(void)
|
||||
{
|
||||
if (CalcCRC16WithTable((void *)&gSaveBlock1Ptr->unk_322C.buffer_000.data, sizeof(struct MEventBuffer_3120_Sub)) != gSaveBlock1Ptr->unk_322C.buffer_000.crc)
|
||||
if (CalcCRC16WithTable((void *)&gSaveBlock1Ptr->unk_322C.wonderNews.data, sizeof(struct WonderNews)) != gSaveBlock1Ptr->unk_322C.wonderNews.crc)
|
||||
return FALSE;
|
||||
if (!sub_801B114(&gSaveBlock1Ptr->unk_322C.buffer_000.data))
|
||||
if (!sub_801B114(&gSaveBlock1Ptr->unk_322C.wonderNews.data))
|
||||
return FALSE;
|
||||
|
||||
return TRUE;
|
||||
}
|
||||
|
||||
static bool32 sub_801B114(const struct MEventBuffer_3120_Sub *data)
|
||||
static bool32 sub_801B114(const struct WonderNews *data)
|
||||
{
|
||||
if (data->unk_00 == 0)
|
||||
return FALSE;
|
||||
@@ -88,19 +88,19 @@ static bool32 sub_801B114(const struct MEventBuffer_3120_Sub *data)
|
||||
return TRUE;
|
||||
}
|
||||
|
||||
bool32 sub_801B128(void)
|
||||
bool32 WonderNews_Test_Unk_02(void)
|
||||
{
|
||||
const struct MEventBuffer_3120_Sub *data = &gSaveBlock1Ptr->unk_322C.buffer_000.data;
|
||||
const struct WonderNews *data = &gSaveBlock1Ptr->unk_322C.wonderNews.data;
|
||||
if (data->unk_02 == 0)
|
||||
return FALSE;
|
||||
|
||||
return TRUE;
|
||||
}
|
||||
|
||||
static void sub_801B14C(void)
|
||||
static void s_DestroyWonderNews(void)
|
||||
{
|
||||
CpuFill32(0, sub_801B00C(), sizeof(gSaveBlock1Ptr->unk_322C.buffer_000.data));
|
||||
gSaveBlock1Ptr->unk_322C.buffer_000.crc = 0;
|
||||
CpuFill32(0, GetSavedWonderNews(), sizeof(gSaveBlock1Ptr->unk_322C.wonderNews.data));
|
||||
gSaveBlock1Ptr->unk_322C.wonderNews.crc = 0;
|
||||
}
|
||||
|
||||
static void sub_801B180(void)
|
||||
@@ -111,12 +111,12 @@ static void sub_801B180(void)
|
||||
|
||||
bool32 sub_801B1A4(const u8 *src)
|
||||
{
|
||||
const u8 *r5 = (const u8 *)&gSaveBlock1Ptr->unk_322C.buffer_000.data;
|
||||
const u8 *r5 = (const u8 *)&gSaveBlock1Ptr->unk_322C.wonderNews.data;
|
||||
u32 i;
|
||||
if (!sub_801B0CC())
|
||||
if (!ValidateReceivedWonderNews())
|
||||
return FALSE;
|
||||
|
||||
for (i = 0; i < sizeof(struct MEventBuffer_3120_Sub); i++)
|
||||
for (i = 0; i < sizeof(struct WonderNews); i++)
|
||||
{
|
||||
if (r5[i] != src[i])
|
||||
return FALSE;
|
||||
@@ -125,7 +125,7 @@ bool32 sub_801B1A4(const u8 *src)
|
||||
return TRUE;
|
||||
}
|
||||
|
||||
void sub_801B1E8(void)
|
||||
void DestroyWonderCard(void)
|
||||
{
|
||||
sub_801B330();
|
||||
sub_801B368();
|
||||
@@ -136,35 +136,35 @@ void sub_801B1E8(void)
|
||||
ClearEReaderTrainer(&gSaveBlock2Ptr->frontier.ereaderTrainer);
|
||||
}
|
||||
|
||||
bool32 sub_801B21C(const struct MEventBuffer_32E0_Sub *data)
|
||||
bool32 sub_801B21C(const struct WonderCard *data)
|
||||
{
|
||||
struct MEventBuffer_3430_Sub *r2;
|
||||
struct MEventBuffer_32E0_Sub *r1;
|
||||
struct WonderCard *r1;
|
||||
if (!sub_801B2CC(data))
|
||||
return FALSE;
|
||||
|
||||
sub_801B1E8();
|
||||
memcpy(&gSaveBlock1Ptr->unk_322C.buffer_1c0.data, data, sizeof(struct MEventBuffer_32E0_Sub));
|
||||
gSaveBlock1Ptr->unk_322C.buffer_1c0.crc = CalcCRC16WithTable((void *)&gSaveBlock1Ptr->unk_322C.buffer_1c0.data, sizeof(struct MEventBuffer_32E0_Sub));
|
||||
DestroyWonderCard();
|
||||
memcpy(&gSaveBlock1Ptr->unk_322C.wonderCard.data, data, sizeof(struct WonderCard));
|
||||
gSaveBlock1Ptr->unk_322C.wonderCard.crc = CalcCRC16WithTable((void *)&gSaveBlock1Ptr->unk_322C.wonderCard.data, sizeof(struct WonderCard));
|
||||
r2 = &gSaveBlock1Ptr->unk_322C.buffer_310.data;
|
||||
r1 = &gSaveBlock1Ptr->unk_322C.buffer_1c0.data;
|
||||
r1 = &gSaveBlock1Ptr->unk_322C.wonderCard.data;
|
||||
r2->unk_06 = r1->unk_02;
|
||||
return TRUE;
|
||||
}
|
||||
|
||||
bool32 sub_801B27C(void)
|
||||
bool32 ValidateReceivedWonderCard(void)
|
||||
{
|
||||
if (gSaveBlock1Ptr->unk_322C.buffer_1c0.crc != CalcCRC16WithTable((void *)&gSaveBlock1Ptr->unk_322C.buffer_1c0.data, sizeof(struct MEventBuffer_32E0_Sub)))
|
||||
if (gSaveBlock1Ptr->unk_322C.wonderCard.crc != CalcCRC16WithTable((void *)&gSaveBlock1Ptr->unk_322C.wonderCard.data, sizeof(struct WonderCard)))
|
||||
return FALSE;
|
||||
if (!sub_801B2CC(&gSaveBlock1Ptr->unk_322C.buffer_1c0.data))
|
||||
if (!sub_801B2CC(&gSaveBlock1Ptr->unk_322C.wonderCard.data))
|
||||
return FALSE;
|
||||
if (!sub_80991F8())
|
||||
if (!ValidateSavedRamScript())
|
||||
return FALSE;
|
||||
|
||||
return TRUE;
|
||||
}
|
||||
|
||||
static bool32 sub_801B2CC(const struct MEventBuffer_32E0_Sub *data)
|
||||
static bool32 sub_801B2CC(const struct WonderCard *data)
|
||||
{
|
||||
if (data->unk_00 == 0)
|
||||
return FALSE;
|
||||
@@ -180,9 +180,9 @@ static bool32 sub_801B2CC(const struct MEventBuffer_32E0_Sub *data)
|
||||
return TRUE;
|
||||
}
|
||||
|
||||
bool32 sub_801B308(void)
|
||||
bool32 WonderCard_Test_Unk_08_6(void)
|
||||
{
|
||||
const struct MEventBuffer_32E0_Sub *data = &gSaveBlock1Ptr->unk_322C.buffer_1c0.data;
|
||||
const struct WonderCard *data = &gSaveBlock1Ptr->unk_322C.wonderCard.data;
|
||||
if (data->unk_08_6 == 0)
|
||||
return FALSE;
|
||||
|
||||
@@ -191,8 +191,8 @@ bool32 sub_801B308(void)
|
||||
|
||||
static void sub_801B330(void)
|
||||
{
|
||||
CpuFill32(0, &gSaveBlock1Ptr->unk_322C.buffer_1c0.data, sizeof(struct MEventBuffer_32E0_Sub));
|
||||
gSaveBlock1Ptr->unk_322C.buffer_1c0.crc = 0;
|
||||
CpuFill32(0, &gSaveBlock1Ptr->unk_322C.wonderCard.data, sizeof(struct WonderCard));
|
||||
gSaveBlock1Ptr->unk_322C.wonderCard.crc = 0;
|
||||
}
|
||||
|
||||
static void sub_801B368(void)
|
||||
@@ -201,21 +201,21 @@ static void sub_801B368(void)
|
||||
gSaveBlock1Ptr->unk_322C.buffer_310.crc = 0;
|
||||
}
|
||||
|
||||
u16 sub_801B39C(void)
|
||||
u16 GetWonderCardFlagID(void)
|
||||
{
|
||||
if (sub_801B27C())
|
||||
return gSaveBlock1Ptr->unk_322C.buffer_1c0.data.unk_00;
|
||||
if (ValidateReceivedWonderCard())
|
||||
return gSaveBlock1Ptr->unk_322C.wonderCard.data.unk_00;
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
void sub_801B3C0(struct MEventBuffer_32E0_Sub *buffer)
|
||||
void WonderCard_ResetInternalReceivedFlag(struct WonderCard *buffer)
|
||||
{
|
||||
if (buffer->unk_08_6 == 1)
|
||||
buffer->unk_08_6 = 0;
|
||||
}
|
||||
|
||||
static bool32 sub_801B3D8(u16 a0)
|
||||
static bool32 IsWonderCardFlagIDInValidRange(u16 a0)
|
||||
{
|
||||
if (a0 >= 1000 && a0 < 1020)
|
||||
return TRUE;
|
||||
@@ -247,10 +247,10 @@ static const u16 sMysteryGiftFlags[] =
|
||||
FLAG_UNUSED_MYSTERY_GIFT_0x14D,
|
||||
};
|
||||
|
||||
bool32 sub_801B3F8(void)
|
||||
bool32 CheckReceivedGiftFromWonderCard(void)
|
||||
{
|
||||
u16 value = sub_801B39C();
|
||||
if (!sub_801B3D8(value))
|
||||
u16 value = GetWonderCardFlagID();
|
||||
if (!IsWonderCardFlagIDInValidRange(value))
|
||||
return FALSE;
|
||||
|
||||
if (FlagGet(sMysteryGiftFlags[value - 1000]) == TRUE)
|
||||
@@ -299,11 +299,11 @@ static bool32 sub_801B4A4(const u16 *data)
|
||||
|
||||
static int sub_801B4CC(void)
|
||||
{
|
||||
struct MEventBuffer_32E0_Sub *data;
|
||||
if (!sub_801B27C())
|
||||
struct WonderCard *data;
|
||||
if (!ValidateReceivedWonderCard())
|
||||
return 0;
|
||||
|
||||
data = &gSaveBlock1Ptr->unk_322C.buffer_1c0.data;
|
||||
data = &gSaveBlock1Ptr->unk_322C.wonderCard.data;
|
||||
if (data->unk_08_0 != 1)
|
||||
return 0;
|
||||
|
||||
@@ -312,7 +312,7 @@ static int sub_801B4CC(void)
|
||||
|
||||
bool32 sub_801B508(const u16 *data)
|
||||
{
|
||||
struct MEventBuffer_32E0_Sub *buffer = &gSaveBlock1Ptr->unk_322C.buffer_1c0.data;
|
||||
struct WonderCard *buffer = &gSaveBlock1Ptr->unk_322C.wonderCard.data;
|
||||
int size = buffer->unk_09;
|
||||
int i;
|
||||
if (!sub_801B4A4(data))
|
||||
@@ -353,11 +353,11 @@ void sub_801B580(struct MEventStruct_Unk1442CC *data, bool32 a1)
|
||||
data->unk_10 = 0x0200;
|
||||
}
|
||||
|
||||
if (sub_801B27C())
|
||||
if (ValidateReceivedWonderCard())
|
||||
{
|
||||
data->unk_14 = sav1_get_mevent_buffer_1()->unk_00;
|
||||
data->unk_14 = GetSavedWonderCard()->unk_00;
|
||||
data->unk_20 = *sav1_get_mevent_buffer_2();
|
||||
data->unk_44 = sav1_get_mevent_buffer_1()->unk_09;
|
||||
data->unk_44 = GetSavedWonderCard()->unk_09;
|
||||
}
|
||||
else
|
||||
{
|
||||
@@ -399,7 +399,7 @@ bool32 sub_801B6A0(const struct MEventStruct_Unk1442CC *data, bool32 a1)
|
||||
return TRUE;
|
||||
}
|
||||
|
||||
u32 sub_801B6EC(const u16 *a0, const struct MEventStruct_Unk1442CC *a1, void *unused)
|
||||
u32 sub_801B6EC(const u16 *a0, const struct MEventStruct_Unk1442CC *a1, const void *unused)
|
||||
{
|
||||
if (a1->unk_14 == 0)
|
||||
return 0;
|
||||
@@ -410,7 +410,7 @@ u32 sub_801B6EC(const u16 *a0, const struct MEventStruct_Unk1442CC *a1, void *un
|
||||
return 2;
|
||||
}
|
||||
|
||||
u32 sub_801B708(const u16 *a0, const struct MEventStruct_Unk1442CC *a1, void *unused)
|
||||
u32 sub_801B708(const u16 *a0, const struct MEventStruct_Unk1442CC *a1, const void *unused)
|
||||
{
|
||||
int r4 = a1->unk_44 - sub_801B438(&a1->unk_20, a1->unk_44);
|
||||
if (r4 == 0)
|
||||
@@ -422,7 +422,7 @@ u32 sub_801B708(const u16 *a0, const struct MEventStruct_Unk1442CC *a1, void *un
|
||||
return 2;
|
||||
}
|
||||
|
||||
bool32 sub_801B748(const struct MEventStruct_Unk1442CC *a0, const u16 *a1)
|
||||
bool32 MEventStruct_Unk1442CC_CompareField_unk_16(const struct MEventStruct_Unk1442CC *a0, const u16 *a1)
|
||||
{
|
||||
int i;
|
||||
for (i = 0; i < 4; i++)
|
||||
@@ -439,7 +439,7 @@ static int sub_801B770(const struct MEventStruct_Unk1442CC *a0)
|
||||
return sub_801B438(&a0->unk_20, a0->unk_44);
|
||||
}
|
||||
|
||||
u16 sub_801B784(const struct MEventStruct_Unk1442CC *a0, u32 command)
|
||||
u16 MEventStruct_Unk1442CC_GetValueNFrom_unk_20(const struct MEventStruct_Unk1442CC *a0, u32 command)
|
||||
{
|
||||
switch (command)
|
||||
{
|
||||
@@ -461,7 +461,7 @@ u16 sub_801B784(const struct MEventStruct_Unk1442CC *a0, u32 command)
|
||||
|
||||
static void sub_801B7D8(u32 command)
|
||||
{
|
||||
struct MEventBuffer_32E0_Sub *data = &gSaveBlock1Ptr->unk_322C.buffer_1c0.data;
|
||||
struct WonderCard *data = &gSaveBlock1Ptr->unk_322C.wonderCard.data;
|
||||
if (data->unk_08_0 == 2)
|
||||
{
|
||||
u16 *dest = NULL;
|
||||
@@ -495,7 +495,7 @@ u16 mevent_081445C0(u32 command)
|
||||
{
|
||||
case 0:
|
||||
{
|
||||
struct MEventBuffer_32E0_Sub *data = &gSaveBlock1Ptr->unk_322C.buffer_1c0.data;
|
||||
struct WonderCard *data = &gSaveBlock1Ptr->unk_322C.wonderCard.data;
|
||||
if (data->unk_08_0 == 2)
|
||||
{
|
||||
struct MEventBuffer_3430_Sub *buffer = &gSaveBlock1Ptr->unk_322C.buffer_310.data;
|
||||
@@ -505,7 +505,7 @@ u16 mevent_081445C0(u32 command)
|
||||
}
|
||||
case 1:
|
||||
{
|
||||
struct MEventBuffer_32E0_Sub *data = &gSaveBlock1Ptr->unk_322C.buffer_1c0.data;
|
||||
struct WonderCard *data = &gSaveBlock1Ptr->unk_322C.wonderCard.data;
|
||||
if (data->unk_08_0 == 2)
|
||||
{
|
||||
struct MEventBuffer_3430_Sub *buffer = &gSaveBlock1Ptr->unk_322C.buffer_310.data;
|
||||
@@ -515,7 +515,7 @@ u16 mevent_081445C0(u32 command)
|
||||
}
|
||||
case 2:
|
||||
{
|
||||
struct MEventBuffer_32E0_Sub *data = &gSaveBlock1Ptr->unk_322C.buffer_1c0.data;
|
||||
struct WonderCard *data = &gSaveBlock1Ptr->unk_322C.wonderCard.data;
|
||||
if (data->unk_08_0 == 2)
|
||||
{
|
||||
struct MEventBuffer_3430_Sub *buffer = &gSaveBlock1Ptr->unk_322C.buffer_310.data;
|
||||
@@ -525,14 +525,14 @@ u16 mevent_081445C0(u32 command)
|
||||
}
|
||||
case 3:
|
||||
{
|
||||
struct MEventBuffer_32E0_Sub *data = &gSaveBlock1Ptr->unk_322C.buffer_1c0.data;
|
||||
struct WonderCard *data = &gSaveBlock1Ptr->unk_322C.wonderCard.data;
|
||||
if (data->unk_08_0 == 1)
|
||||
return sub_801B4CC();
|
||||
break;
|
||||
}
|
||||
case 4:
|
||||
{
|
||||
struct MEventBuffer_32E0_Sub *data = &gSaveBlock1Ptr->unk_322C.buffer_1c0.data;
|
||||
struct WonderCard *data = &gSaveBlock1Ptr->unk_322C.wonderCard.data;
|
||||
if (data->unk_08_0 == 1)
|
||||
return data->unk_09;
|
||||
break;
|
||||
@@ -554,10 +554,10 @@ bool32 sub_801B94C(u16 a0)
|
||||
if (a0 == 0)
|
||||
return FALSE;
|
||||
|
||||
if (!sub_801B27C())
|
||||
if (!ValidateReceivedWonderCard())
|
||||
return FALSE;
|
||||
|
||||
if (gSaveBlock1Ptr->unk_322C.buffer_1c0.data.unk_00 != a0)
|
||||
if (gSaveBlock1Ptr->unk_322C.wonderCard.data.unk_00 != a0)
|
||||
return FALSE;
|
||||
|
||||
gUnknown_02022C70 = TRUE;
|
||||
|
||||
@@ -0,0 +1,826 @@
|
||||
#include "global.h"
|
||||
#include "constants/species.h"
|
||||
#include "bg.h"
|
||||
#include "gpu_regs.h"
|
||||
#include "palette.h"
|
||||
#include "decompress.h"
|
||||
#include "alloc.h"
|
||||
#include "menu.h"
|
||||
#include "pokemon_icon.h"
|
||||
#include "union_room.h"
|
||||
#include "list_menu.h"
|
||||
#include "text_window.h"
|
||||
#include "string_util.h"
|
||||
#include "link_rfu.h"
|
||||
#include "mevent.h"
|
||||
#include "mystery_gift.h"
|
||||
|
||||
struct UnkStruct_8467FB8
|
||||
{
|
||||
u8 textPal1:4;
|
||||
u8 textPal2:4;
|
||||
u8 textPal3:4;
|
||||
u8 textPal4:4;
|
||||
const u32 * tiles;
|
||||
const u32 * map;
|
||||
const u16 * pal;
|
||||
};
|
||||
|
||||
struct UnkStruct_203F3C8_02DC
|
||||
{
|
||||
u8 unk_00;
|
||||
u8 unk_01[41];
|
||||
u8 unk_42[4];
|
||||
};
|
||||
|
||||
struct UnkStruct_203F3C8
|
||||
{
|
||||
/*0000*/ struct WonderCard unk_0000;
|
||||
/*014c*/ struct MEventBuffer_3430_Sub unk_014C;
|
||||
/*0170*/ const struct UnkStruct_8467FB8 * unk_0170;
|
||||
/*0174*/ u8 unk_0174;
|
||||
/*0175*/ u8 unk_0175;
|
||||
/*0176*/ u16 unk_0176[3];
|
||||
/*017C*/ u8 unk_017C;
|
||||
/*017D*/ u8 unk_017D[7][2];
|
||||
/*018B*/ u8 unk_018B[41];
|
||||
/*01B4*/ u8 unk_01B4[41];
|
||||
/*01DD*/ u8 unk_01DD[7];
|
||||
/*01E4*/ u8 unk_01E4[4][41];
|
||||
/*0288*/ u8 unk_0288[41];
|
||||
/*02B1*/ u8 unk_02B1[41];
|
||||
/*02DC*/ struct UnkStruct_203F3C8_02DC unk_02DC[8];
|
||||
/*045C*/ u8 buffer_045C[0x1000];
|
||||
};
|
||||
|
||||
EWRAM_DATA struct UnkStruct_203F3C8 * sWonderCardData = NULL;
|
||||
|
||||
void sub_801BEF8(void);
|
||||
void sub_801C178(u8 whichWindow);
|
||||
void sub_801C4C0(void);
|
||||
void sub_801C61C(void);
|
||||
|
||||
extern const struct OamData gUnknown_08524934;
|
||||
|
||||
const u8 gUnknown_082F0E10[][3] = {
|
||||
{0, 2, 3},
|
||||
{0, 1, 2}
|
||||
};
|
||||
const u8 ALIGNED(4) gUnknown_082F0E18[3] = {7, 4, 7};
|
||||
const struct WindowTemplate gUnknown_082F0E1C[] = {
|
||||
{
|
||||
.bg = 1,
|
||||
.tilemapLeft = 1,
|
||||
.tilemapTop = 1,
|
||||
.width = 25,
|
||||
.height = 4,
|
||||
.paletteNum = 2,
|
||||
.baseBlock = 0x029c
|
||||
}, {
|
||||
.bg = 1,
|
||||
.tilemapLeft = 1,
|
||||
.tilemapTop = 6,
|
||||
.width = 28,
|
||||
.height = 8,
|
||||
.paletteNum = 2,
|
||||
.baseBlock = 0x01bc
|
||||
}, {
|
||||
.bg = 1,
|
||||
.tilemapLeft = 1,
|
||||
.tilemapTop = 14,
|
||||
.width = 28,
|
||||
.height = 5,
|
||||
.paletteNum = 2,
|
||||
.baseBlock = 0x0130
|
||||
}
|
||||
};
|
||||
|
||||
const u16 gWonderCardBgPal1[] = INCBIN_U16("graphics/wonder_transfers/wonder_card_1.gbapal");
|
||||
const u16 gWonderCardBgPal2[] = INCBIN_U16("graphics/wonder_transfers/wonder_card_2.gbapal");
|
||||
const u16 gWonderCardBgPal3[] = INCBIN_U16("graphics/wonder_transfers/wonder_card_3.gbapal");
|
||||
const u16 gWonderCardBgPal4[] = INCBIN_U16("graphics/wonder_transfers/wonder_card_4.gbapal");
|
||||
const u16 gWonderCardBgPal5[] = INCBIN_U16("graphics/wonder_transfers/wonder_card_5.gbapal");
|
||||
const u16 gWonderCardBgPal6[] = INCBIN_U16("graphics/wonder_transfers/wonder_card_6.gbapal");
|
||||
const u16 gWonderCardBgPal7[] = INCBIN_U16("graphics/wonder_transfers/wonder_card_7.gbapal");
|
||||
const u16 gWonderCardBgPal8[] = INCBIN_U16("graphics/wonder_transfers/wonder_card_8.gbapal");
|
||||
const u32 gWonderCardBgGfx1[] = INCBIN_U32("graphics/wonder_transfers/wonder_card_1.4bpp.lz");
|
||||
const u32 gWonderCardBgTilemap1[] = INCBIN_U32("graphics/wonder_transfers/wonder_card_1.bin.lz");
|
||||
const u32 gWonderCardBgGfx2[] = INCBIN_U32("graphics/wonder_transfers/wonder_card_2.4bpp.lz");
|
||||
const u32 gWonderCardBgTilemap2[] = INCBIN_U32("graphics/wonder_transfers/wonder_card_2.bin.lz");
|
||||
const u32 gWonderCardBgGfx3[] = INCBIN_U32("graphics/wonder_transfers/wonder_card_3.4bpp.lz");
|
||||
const u32 gWonderCardBgTilemap3[] = INCBIN_U32("graphics/wonder_transfers/wonder_card_3.bin.lz");
|
||||
const u32 gWonderCardBgGfx7[] = INCBIN_U32("graphics/wonder_transfers/wonder_card_7.4bpp.lz");
|
||||
const u32 gWonderCardBgTilemap7[] = INCBIN_U32("graphics/wonder_transfers/wonder_card_7.bin.lz");
|
||||
const u32 gWonderCardBgGfx8[] = INCBIN_U32("graphics/wonder_transfers/wonder_card_8.4bpp.lz");
|
||||
const u32 gWonderCardBgTilemap8[] = INCBIN_U32("graphics/wonder_transfers/wonder_card_8.bin.lz");
|
||||
const u16 gWonderCardShadowPal1[] = INCBIN_U16("graphics/wonder_transfers/wonder_card_shadow_1.gbapal");
|
||||
const u16 gWonderCardShadowPal2[] = INCBIN_U16("graphics/wonder_transfers/wonder_card_shadow_2.gbapal");
|
||||
const u16 gWonderCardShadowPal3[] = INCBIN_U16("graphics/wonder_transfers/wonder_card_shadow_3.gbapal");
|
||||
const u16 gWonderCardShadowPal4[] = INCBIN_U16("graphics/wonder_transfers/wonder_card_shadow_4.gbapal");
|
||||
const u16 gWonderCardShadowPal5[] = INCBIN_U16("graphics/wonder_transfers/wonder_card_shadow_5.gbapal");
|
||||
const u16 gWonderCardShadowPal6[] = INCBIN_U16("graphics/wonder_transfers/wonder_card_shadow_6.gbapal");
|
||||
const u16 gWonderCardShadowPal7[] = INCBIN_U16("graphics/wonder_transfers/wonder_card_shadow_7.gbapal");
|
||||
const u16 gWonderCardShadowPal8[] = INCBIN_U16("graphics/wonder_transfers/wonder_card_shadow_8.gbapal");
|
||||
const u32 gWonderCardShadowGfx[] = INCBIN_U32("graphics/wonder_transfers/wonder_card_shadow.4bpp.lz");
|
||||
|
||||
const struct CompressedSpriteSheet gUnknown_082F1D00 = {
|
||||
gWonderCardShadowGfx, 0x100, 0x8000
|
||||
};
|
||||
const struct SpritePalette gUnknown_082F1D08[] = {
|
||||
{gWonderCardShadowPal1, 0x8000},
|
||||
{gWonderCardShadowPal2, 0x8000},
|
||||
{gWonderCardShadowPal3, 0x8000},
|
||||
{gWonderCardShadowPal4, 0x8000},
|
||||
{gWonderCardShadowPal5, 0x8000},
|
||||
{gWonderCardShadowPal6, 0x8000},
|
||||
{gWonderCardShadowPal7, 0x8000},
|
||||
{gWonderCardShadowPal8, 0x8000}
|
||||
};
|
||||
const struct SpriteTemplate gUnknown_082F1D48 = {
|
||||
0x8000, 0x8000, &gUnknown_08524934, gDummySpriteAnimTable, NULL, gDummySpriteAffineAnimTable, SpriteCallbackDummy
|
||||
};
|
||||
const struct UnkStruct_8467FB8 gUnknown_082F1D60[8] = {
|
||||
{1, 0, 0, 0, gWonderCardBgGfx1, gWonderCardBgTilemap1, gWonderCardBgPal1},
|
||||
{1, 0, 0, 1, gWonderCardBgGfx2, gWonderCardBgTilemap2, gWonderCardBgPal2},
|
||||
{1, 0, 0, 2, gWonderCardBgGfx3, gWonderCardBgTilemap3, gWonderCardBgPal3},
|
||||
{1, 0, 0, 3, gWonderCardBgGfx3, gWonderCardBgTilemap3, gWonderCardBgPal4},
|
||||
{1, 0, 0, 4, gWonderCardBgGfx3, gWonderCardBgTilemap3, gWonderCardBgPal5},
|
||||
{1, 0, 0, 5, gWonderCardBgGfx3, gWonderCardBgTilemap3, gWonderCardBgPal6},
|
||||
{1, 0, 0, 6, gWonderCardBgGfx7, gWonderCardBgTilemap7, gWonderCardBgPal7},
|
||||
{1, 0, 0, 7, gWonderCardBgGfx8, gWonderCardBgTilemap8, gWonderCardBgPal8}
|
||||
};
|
||||
|
||||
bool32 InitWonderCardResources(struct WonderCard * r5, struct MEventBuffer_3430_Sub * r6)
|
||||
{
|
||||
if (r5 == NULL || r6 == NULL)
|
||||
return FALSE;
|
||||
sWonderCardData = AllocZeroed(sizeof(struct UnkStruct_203F3C8));
|
||||
if (sWonderCardData == NULL)
|
||||
return FALSE;
|
||||
sWonderCardData->unk_0000 = *r5;
|
||||
sWonderCardData->unk_014C = *r6;
|
||||
if (sWonderCardData->unk_0000.unk_08_2 >= ARRAY_COUNT(gUnknown_082F1D60))
|
||||
sWonderCardData->unk_0000.unk_08_2 = 0;
|
||||
if (sWonderCardData->unk_0000.unk_08_0 >= ARRAY_COUNT(gUnknown_082F0E18))
|
||||
sWonderCardData->unk_0000.unk_08_0 = 0;
|
||||
if (sWonderCardData->unk_0000.unk_09 > ARRAY_COUNT(sWonderCardData->unk_017D))
|
||||
sWonderCardData->unk_0000.unk_09 = 0;
|
||||
sWonderCardData->unk_0170 = &gUnknown_082F1D60[sWonderCardData->unk_0000.unk_08_2];
|
||||
return TRUE;
|
||||
}
|
||||
|
||||
void DestroyWonderCardResources(void)
|
||||
{
|
||||
if (sWonderCardData != NULL)
|
||||
{
|
||||
*sWonderCardData = (struct UnkStruct_203F3C8){};
|
||||
Free(sWonderCardData);
|
||||
sWonderCardData = NULL;
|
||||
}
|
||||
}
|
||||
|
||||
s32 FadeToWonderCardMenu(void)
|
||||
{
|
||||
if (sWonderCardData == NULL)
|
||||
return -1;
|
||||
switch(sWonderCardData->unk_0174)
|
||||
{
|
||||
case 0:
|
||||
BeginNormalPaletteFade(0xFFFFFFFF, 0, 0, 16, 0);
|
||||
break;
|
||||
case 1:
|
||||
if (UpdatePaletteFade())
|
||||
return 0;
|
||||
break;
|
||||
case 2:
|
||||
FillBgTilemapBufferRect_Palette0(0, 0x000, 0, 0, 30, 20);
|
||||
FillBgTilemapBufferRect_Palette0(1, 0x000, 0, 0, 30, 20);
|
||||
FillBgTilemapBufferRect_Palette0(2, 0x000, 0, 0, 30, 20);
|
||||
CopyBgTilemapBufferToVram(0);
|
||||
CopyBgTilemapBufferToVram(1);
|
||||
CopyBgTilemapBufferToVram(2);
|
||||
decompress_and_copy_tile_data_to_vram(2, sWonderCardData->unk_0170->tiles, 0, 0x008, 0);
|
||||
sWonderCardData->unk_0176[0] = AddWindow(&gUnknown_082F0E1C[0]);
|
||||
sWonderCardData->unk_0176[1] = AddWindow(&gUnknown_082F0E1C[1]);
|
||||
sWonderCardData->unk_0176[2] = AddWindow(&gUnknown_082F0E1C[2]);
|
||||
break;
|
||||
case 3:
|
||||
if (free_temp_tile_data_buffers_if_possible())
|
||||
return 0;
|
||||
LoadPalette(stdpal_get(1), 0x20, 0x20);
|
||||
gPaletteFade.bufferTransferDisabled = TRUE;
|
||||
LoadPalette(sWonderCardData->unk_0170->pal, 0x10, 0x20);
|
||||
LZ77UnCompWram(sWonderCardData->unk_0170->map, sWonderCardData->buffer_045C);
|
||||
CopyRectToBgTilemapBufferRect(2, sWonderCardData->buffer_045C, 0, 0, 30, 20, 0, 0, 30, 20, 1, 0x008, 0);
|
||||
CopyBgTilemapBufferToVram(2);
|
||||
break;
|
||||
case 4:
|
||||
sub_801BEF8();
|
||||
break;
|
||||
case 5:
|
||||
sub_801C178(0);
|
||||
sub_801C178(1);
|
||||
sub_801C178(2);
|
||||
CopyBgTilemapBufferToVram(1);
|
||||
break;
|
||||
case 6:
|
||||
LoadMonIconPalettes();
|
||||
break;
|
||||
case 7:
|
||||
ShowBg(1);
|
||||
ShowBg(2);
|
||||
gPaletteFade.bufferTransferDisabled = FALSE;
|
||||
sub_801C4C0();
|
||||
BeginNormalPaletteFade(0xFFFFFFFF, 0, 16, 0, 0);
|
||||
UpdatePaletteFade();
|
||||
break;
|
||||
default:
|
||||
if (UpdatePaletteFade())
|
||||
return 0;
|
||||
sWonderCardData->unk_0174 = 0;
|
||||
return 1;
|
||||
}
|
||||
++sWonderCardData->unk_0174;
|
||||
return 0;
|
||||
}
|
||||
|
||||
s32 FadeOutFromWonderCard(bool32 flag)
|
||||
{
|
||||
if (sWonderCardData == NULL)
|
||||
return -1;
|
||||
switch (sWonderCardData->unk_0174)
|
||||
{
|
||||
case 0:
|
||||
BeginNormalPaletteFade(0xFFFFFFFF, 0, 0, 16, 0);
|
||||
break;
|
||||
case 1:
|
||||
if (UpdatePaletteFade())
|
||||
return 0;
|
||||
break;
|
||||
case 2:
|
||||
FillBgTilemapBufferRect_Palette0(0, 0x000, 0, 0, 30, 20);
|
||||
FillBgTilemapBufferRect_Palette0(1, 0x000, 0, 0, 30, 20);
|
||||
FillBgTilemapBufferRect_Palette0(2, 0x000, 0, 0, 30, 20);
|
||||
CopyBgTilemapBufferToVram(0);
|
||||
CopyBgTilemapBufferToVram(1);
|
||||
CopyBgTilemapBufferToVram(2);
|
||||
break;
|
||||
case 3:
|
||||
HideBg(1);
|
||||
HideBg(2);
|
||||
RemoveWindow(sWonderCardData->unk_0176[2]);
|
||||
RemoveWindow(sWonderCardData->unk_0176[1]);
|
||||
RemoveWindow(sWonderCardData->unk_0176[0]);
|
||||
break;
|
||||
case 4:
|
||||
sub_801C61C();
|
||||
FreeMonIconPalettes();
|
||||
break;
|
||||
case 5:
|
||||
PrintMysteryGiftOrEReaderTopMenu(gGiftIsFromEReader, flag);
|
||||
CopyBgTilemapBufferToVram(0);
|
||||
BeginNormalPaletteFade(0xFFFFFFFF, 0, 16, 0, 0);
|
||||
break;
|
||||
default:
|
||||
if (UpdatePaletteFade())
|
||||
return 0;
|
||||
sWonderCardData->unk_0174 = 0;
|
||||
return 1;
|
||||
}
|
||||
++sWonderCardData->unk_0174;
|
||||
return 0;
|
||||
}
|
||||
|
||||
void sub_801BEF8(void)
|
||||
{
|
||||
u16 i = 0;
|
||||
u16 r6;
|
||||
u16 sp0[3] = {0, 0, 0};
|
||||
|
||||
memcpy(sWonderCardData->unk_018B, sWonderCardData->unk_0000.unk_0A, 40);
|
||||
sWonderCardData->unk_018B[40] = EOS;
|
||||
memcpy(sWonderCardData->unk_01B4, sWonderCardData->unk_0000.unk_32, 40);
|
||||
sWonderCardData->unk_01B4[40] = EOS;
|
||||
if (sWonderCardData->unk_0000.unk_04 > 999999)
|
||||
sWonderCardData->unk_0000.unk_04 = 999999;
|
||||
ConvertIntToDecimalStringN(sWonderCardData->unk_01DD, sWonderCardData->unk_0000.unk_04, STR_CONV_MODE_LEFT_ALIGN, 6);
|
||||
for (i = 0; i < 4; i++)
|
||||
{
|
||||
memcpy(sWonderCardData->unk_01E4[i], sWonderCardData->unk_0000.unk_5A[i], 40);
|
||||
sWonderCardData->unk_01E4[i][40] = EOS;
|
||||
}
|
||||
memcpy(sWonderCardData->unk_0288, sWonderCardData->unk_0000.unk_FA, 40);
|
||||
sWonderCardData->unk_0288[40] = EOS;
|
||||
switch (sWonderCardData->unk_0000.unk_08_0)
|
||||
{
|
||||
case 0:
|
||||
memcpy(sWonderCardData->unk_02B1, sWonderCardData->unk_0000.unk_122, 40);
|
||||
sWonderCardData->unk_02B1[40] = EOS;
|
||||
break;
|
||||
case 1:
|
||||
sWonderCardData->unk_02B1[00] = EOS;
|
||||
break;
|
||||
case 2:
|
||||
sWonderCardData->unk_02B1[00] = EOS;
|
||||
sp0[0] = sWonderCardData->unk_014C.unk_00 < 999 ? sWonderCardData->unk_014C.unk_00 : 999;
|
||||
sp0[1] = sWonderCardData->unk_014C.unk_02 < 999 ? sWonderCardData->unk_014C.unk_02 : 999;
|
||||
sp0[2] = sWonderCardData->unk_014C.unk_04 < 999 ? sWonderCardData->unk_014C.unk_04 : 999;
|
||||
for (i = 0; i < 8; i++)
|
||||
{
|
||||
memset(sWonderCardData->unk_02DC[i].unk_42, EOS, 4);
|
||||
memset(sWonderCardData->unk_02DC[i].unk_01, EOS, 41);
|
||||
}
|
||||
for (i = 0, r6 = 0; i < 40; i++)
|
||||
{
|
||||
if (sWonderCardData->unk_0000.unk_122[i] != 0xF7)
|
||||
{
|
||||
sWonderCardData->unk_02DC[sWonderCardData->unk_0175].unk_01[r6] = sWonderCardData->unk_0000.unk_122[i];
|
||||
r6++;
|
||||
}
|
||||
else
|
||||
{
|
||||
u8 r3 = sWonderCardData->unk_0000.unk_122[i + 1];
|
||||
if (r3 > 2)
|
||||
{
|
||||
i += 2;
|
||||
}
|
||||
else
|
||||
{
|
||||
ConvertIntToDecimalStringN(sWonderCardData->unk_02DC[sWonderCardData->unk_0175].unk_42, sp0[r3], STR_CONV_MODE_LEADING_ZEROS, 3);
|
||||
sWonderCardData->unk_02DC[sWonderCardData->unk_0175].unk_00 = sWonderCardData->unk_0000.unk_122[i + 2];
|
||||
sWonderCardData->unk_0175++;
|
||||
if (sWonderCardData->unk_0175 > 7)
|
||||
break;
|
||||
r6 = 0;
|
||||
i += 2;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
void sub_801C178(u8 whichWindow)
|
||||
{
|
||||
s8 sp0C = 0;
|
||||
s32 windowId = sWonderCardData->unk_0176[whichWindow];
|
||||
PutWindowTilemap(windowId);
|
||||
FillWindowPixelBuffer(windowId, 0);
|
||||
switch (whichWindow)
|
||||
{
|
||||
case 0:
|
||||
{
|
||||
s32 x;
|
||||
AddTextPrinterParameterized3(windowId, 3, 0, 1, gUnknown_082F0E10[sWonderCardData->unk_0170->textPal1], 0, sWonderCardData->unk_018B);
|
||||
x = 160 - GetStringWidth(3, sWonderCardData->unk_01B4, GetFontAttribute(3, 2));
|
||||
if (x < 0)
|
||||
x = 0;
|
||||
AddTextPrinterParameterized3(windowId, 3, x, 17, gUnknown_082F0E10[sWonderCardData->unk_0170->textPal1], 0, sWonderCardData->unk_01B4);
|
||||
if (sWonderCardData->unk_0000.unk_04 != 0)
|
||||
{
|
||||
AddTextPrinterParameterized3(windowId, 1, 166, 17, gUnknown_082F0E10[sWonderCardData->unk_0170->textPal1], 0, sWonderCardData->unk_01DD);
|
||||
}
|
||||
break;
|
||||
}
|
||||
case 1:
|
||||
for (; sp0C < 4; sp0C++)
|
||||
{
|
||||
AddTextPrinterParameterized3(windowId, 3, 0, 16 * sp0C + 2, gUnknown_082F0E10[sWonderCardData->unk_0170->textPal2], 0, sWonderCardData->unk_01E4[sp0C]);
|
||||
}
|
||||
break;
|
||||
case 2:
|
||||
AddTextPrinterParameterized3(windowId, 3, 0, gUnknown_082F0E18[sWonderCardData->unk_0000.unk_08_0], gUnknown_082F0E10[sWonderCardData->unk_0170->textPal3], 0, sWonderCardData->unk_0288);
|
||||
if (sWonderCardData->unk_0000.unk_08_0 != 2)
|
||||
{
|
||||
AddTextPrinterParameterized3(windowId, 3, 0, 16 + gUnknown_082F0E18[sWonderCardData->unk_0000.unk_08_0], gUnknown_082F0E10[sWonderCardData->unk_0170->textPal3], 0, sWonderCardData->unk_02B1);
|
||||
}
|
||||
else
|
||||
{
|
||||
s32 x = 0;
|
||||
s32 y = gUnknown_082F0E18[sWonderCardData->unk_0000.unk_08_0] + 16;
|
||||
s32 spacing = GetFontAttribute(3, 2);
|
||||
for (; sp0C < sWonderCardData->unk_0175; sp0C++)
|
||||
{
|
||||
AddTextPrinterParameterized3(windowId, 3, x, y, gUnknown_082F0E10[sWonderCardData->unk_0170->textPal3], 0, sWonderCardData->unk_02DC[sp0C].unk_01);
|
||||
if (sWonderCardData->unk_02DC[sp0C].unk_42[0] != EOS)
|
||||
{
|
||||
x += GetStringWidth(3, sWonderCardData->unk_02DC[sp0C].unk_01, spacing);
|
||||
AddTextPrinterParameterized3(windowId, 3, x, y, gUnknown_082F0E10[sWonderCardData->unk_0170->textPal3], 0, sWonderCardData->unk_02DC[sp0C].unk_42);
|
||||
x += GetStringWidth(3, sWonderCardData->unk_02DC[sp0C].unk_42, spacing) + sWonderCardData->unk_02DC[sp0C].unk_00;
|
||||
}
|
||||
}
|
||||
}
|
||||
break;
|
||||
}
|
||||
CopyWindowToVram(windowId, 3);
|
||||
}
|
||||
|
||||
void sub_801C4C0(void)
|
||||
{
|
||||
u8 r7 = 0;
|
||||
sWonderCardData->unk_017C = 0xFF;
|
||||
if (sWonderCardData->unk_014C.unk_06 != SPECIES_NONE)
|
||||
{
|
||||
sWonderCardData->unk_017C = sub_80D2D78(sub_80D2E84(sWonderCardData->unk_014C.unk_06), SpriteCallbackDummy, 0xDC, 0x14, 0, FALSE);
|
||||
gSprites[sWonderCardData->unk_017C].oam.priority = 2;
|
||||
}
|
||||
if (sWonderCardData->unk_0000.unk_09 != 0 && sWonderCardData->unk_0000.unk_08_0 == 1)
|
||||
{
|
||||
LoadCompressedSpriteSheetUsingHeap(&gUnknown_082F1D00);
|
||||
LoadSpritePalette(&gUnknown_082F1D08[sWonderCardData->unk_0170->textPal4]);
|
||||
for (; r7 < sWonderCardData->unk_0000.unk_09; r7++)
|
||||
{
|
||||
sWonderCardData->unk_017D[r7][0] = 0xFF;
|
||||
sWonderCardData->unk_017D[r7][1] = 0xFF;
|
||||
sWonderCardData->unk_017D[r7][0] = CreateSprite(&gUnknown_082F1D48, 0xd8 - 32 * r7, 0x90, 8);
|
||||
if (sWonderCardData->unk_014C.unk_08[0][r7] != 0)
|
||||
{
|
||||
sWonderCardData->unk_017D[r7][1] = sub_80D2D78(sub_80D2E84(sWonderCardData->unk_014C.unk_08[0][r7]), SpriteCallbackDummy, 0xd8 - 32 * r7, 0x88, 0, 0);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
void sub_801C61C(void)
|
||||
{
|
||||
u8 r6 = 0;
|
||||
if (sWonderCardData->unk_017C != 0xFF)
|
||||
sub_80D2EF8(&gSprites[sWonderCardData->unk_017C]);
|
||||
if (sWonderCardData->unk_0000.unk_09 != 0 && sWonderCardData->unk_0000.unk_08_0 == 1)
|
||||
{
|
||||
for (; r6 < sWonderCardData->unk_0000.unk_09; r6++)
|
||||
{
|
||||
if (sWonderCardData->unk_017D[r6][0] != 0xFF)
|
||||
{
|
||||
DestroySprite(&gSprites[sWonderCardData->unk_017D[r6][0]]);
|
||||
}
|
||||
if (sWonderCardData->unk_017D[r6][1] != 0xFF)
|
||||
{
|
||||
sub_80D2EF8(&gSprites[sWonderCardData->unk_017D[r6][1]]);
|
||||
}
|
||||
}
|
||||
FreeSpriteTilesByTag(0x8000);
|
||||
FreeSpritePaletteByTag(0x8000);
|
||||
}
|
||||
}
|
||||
|
||||
struct UnkStruct_203F3CC
|
||||
{
|
||||
/*0000*/ struct WonderNews unk_0000;
|
||||
/*01bc*/ const struct UnkStruct_8467FB8 * unk_01BC;
|
||||
/*01c0*/ u8 unk_01C0_0:1;
|
||||
u8 unk_01C0_1:7;
|
||||
/*01c1*/ u8 unk_01C1;
|
||||
/*01c2*/ u8 unk_01C2_0:1;
|
||||
u8 unk_01C2_1:7;
|
||||
/*01c3*/ u8 unk_01C3_0:1;
|
||||
u8 unk_01C3_1:7;
|
||||
/*01c4*/ u16 unk_01C4;
|
||||
/*01c6*/ u16 unk_01C6;
|
||||
/*01c8*/ u16 unk_01C8[2];
|
||||
/*01cc*/ u8 filler_01CC[2];
|
||||
/*01ce*/ u8 unk_01CE[41];
|
||||
/*01f7*/ u8 unk_01F7[10][41];
|
||||
/*0394*/ struct ScrollArrowsTemplate unk_0394;
|
||||
/*03a4*/ u8 buffer_03A4[0x1000];
|
||||
};
|
||||
|
||||
EWRAM_DATA struct UnkStruct_203F3CC * sWonderNewsData = NULL;
|
||||
|
||||
void sub_801CDCC(void);
|
||||
void sub_801CE7C(void);
|
||||
void sub_801CFA4(void);
|
||||
|
||||
const u8 gUnknown_082F1DE0[][3] = {
|
||||
{0, 2, 3},
|
||||
{0, 1, 2}
|
||||
};
|
||||
const struct WindowTemplate gUnknown_082F1DE8[] = {
|
||||
{
|
||||
.bg = 0,
|
||||
.tilemapLeft = 1,
|
||||
.tilemapTop = 0,
|
||||
.width = 28,
|
||||
.height = 3,
|
||||
.paletteNum = 2,
|
||||
.baseBlock = 0x2AC
|
||||
}, {
|
||||
.bg = 2,
|
||||
.tilemapLeft = 1,
|
||||
.tilemapTop = 3,
|
||||
.width = 28,
|
||||
.height = 20,
|
||||
.paletteNum = 2,
|
||||
.baseBlock = 0x07C
|
||||
}
|
||||
};
|
||||
const struct ScrollArrowsTemplate gUnknown_082F1DF8 = {
|
||||
0x02, 0xe8, 0x18, 0x03, 0xe8, 0x98,
|
||||
0x0000, 0x0002, 0x1000, 0x1000, 0x0
|
||||
};
|
||||
const u16 gWonderNewsPal1[] = INCBIN_U16("graphics/wonder_transfers/wonder_news_1.gbapal");
|
||||
const u16 gWonderNewsPal7[] = INCBIN_U16("graphics/wonder_transfers/wonder_news_7.gbapal");
|
||||
const u16 gWonderNewsPal8[] = INCBIN_U16("graphics/wonder_transfers/wonder_news_8.gbapal");
|
||||
const u32 gWonderNewsGfx1[] = INCBIN_U32("graphics/wonder_transfers/wonder_news_1.4bpp.lz");
|
||||
const u32 gWonderNewsTilemap1[] = INCBIN_U32("graphics/wonder_transfers/wonder_news_1.bin.lz");
|
||||
const u32 gWonderNewsGfx2[] = INCBIN_U32("graphics/wonder_transfers/wonder_news_2.4bpp.lz");
|
||||
const u32 gWonderNewsTilemap2[] = INCBIN_U32("graphics/wonder_transfers/wonder_news_2.bin.lz");
|
||||
const u32 gWonderNewsGfx3[] = INCBIN_U32("graphics/wonder_transfers/wonder_news_3.4bpp.lz");
|
||||
const u32 gWonderNewsTilemap3[] = INCBIN_U32("graphics/wonder_transfers/wonder_news_3.bin.lz");
|
||||
const u32 gWonderNewsGfx7[] = INCBIN_U32("graphics/wonder_transfers/wonder_news_7.4bpp.lz");
|
||||
const u32 gWonderNewsTilemap7[] = INCBIN_U32("graphics/wonder_transfers/wonder_news_7.bin.lz");
|
||||
const u32 gWonderNewsGfx8[] = INCBIN_U32("graphics/wonder_transfers/wonder_news_8.4bpp.lz");
|
||||
const u32 gWonderNewsTilemap8[] = INCBIN_U32("graphics/wonder_transfers/wonder_news_8.bin.lz");
|
||||
|
||||
const struct UnkStruct_8467FB8 gUnknown_082F24C8[] = {
|
||||
{1, 0, 0, 0, gWonderNewsGfx1, gWonderNewsTilemap1, gWonderNewsPal1},
|
||||
{1, 0, 0, 0, gWonderNewsGfx2, gWonderNewsTilemap2, gWonderCardBgPal2},
|
||||
{1, 0, 0, 0, gWonderNewsGfx3, gWonderNewsTilemap3, gWonderCardBgPal3},
|
||||
{1, 0, 0, 0, gWonderNewsGfx3, gWonderNewsTilemap3, gWonderCardBgPal4},
|
||||
{1, 0, 0, 0, gWonderNewsGfx3, gWonderNewsTilemap3, gWonderCardBgPal5},
|
||||
{1, 0, 0, 0, gWonderNewsGfx3, gWonderNewsTilemap3, gWonderCardBgPal6},
|
||||
{1, 0, 0, 0, gWonderNewsGfx7, gWonderNewsTilemap7, gWonderNewsPal7},
|
||||
{1, 0, 0, 0, gWonderNewsGfx8, gWonderNewsTilemap8, gWonderNewsPal8}
|
||||
};
|
||||
|
||||
bool32 InitWonderNewsResources(const struct WonderNews * a0)
|
||||
{
|
||||
if (a0 == NULL)
|
||||
return FALSE;
|
||||
sWonderNewsData = AllocZeroed(sizeof(struct UnkStruct_203F3CC));
|
||||
if (sWonderNewsData == NULL)
|
||||
return FALSE;
|
||||
sWonderNewsData->unk_0000 = *a0;
|
||||
if (sWonderNewsData->unk_0000.unk_03 >= ARRAY_COUNT(gUnknown_082F24C8))
|
||||
sWonderNewsData->unk_0000.unk_03 = 0;
|
||||
sWonderNewsData->unk_01BC = &gUnknown_082F24C8[sWonderNewsData->unk_0000.unk_03];
|
||||
sWonderNewsData->unk_01C1 = 0xFF;
|
||||
return TRUE;
|
||||
}
|
||||
|
||||
void DestroyWonderNewsResources(void)
|
||||
{
|
||||
if (sWonderNewsData != NULL)
|
||||
{
|
||||
*sWonderNewsData = (struct UnkStruct_203F3CC){};
|
||||
Free(sWonderNewsData);
|
||||
sWonderNewsData = NULL;
|
||||
}
|
||||
}
|
||||
|
||||
s32 FadeToWonderNewsMenu(void)
|
||||
{
|
||||
if (sWonderNewsData == NULL)
|
||||
return -1;
|
||||
|
||||
switch (sWonderNewsData->unk_01C0_1)
|
||||
{
|
||||
case 0:
|
||||
BeginNormalPaletteFade(0xFFFFFFFF, 0, 0, 16, 0);
|
||||
break;
|
||||
case 1:
|
||||
if (UpdatePaletteFade())
|
||||
return 0;
|
||||
ChangeBgY(0, 0, 0);
|
||||
ChangeBgY(1, 0, 0);
|
||||
ChangeBgY(2, 0, 0);
|
||||
ChangeBgY(3, 0, 0);
|
||||
SetGpuReg(REG_OFFSET_WIN0H, 0xF0);
|
||||
SetGpuReg(REG_OFFSET_WIN0V, 0x1A98);
|
||||
SetGpuReg(REG_OFFSET_WININ, 0x1F);
|
||||
SetGpuReg(REG_OFFSET_WINOUT, 0x1B);
|
||||
SetGpuRegBits(REG_OFFSET_DISPCNT, DISPCNT_WIN0_ON);
|
||||
break;
|
||||
case 2:
|
||||
FillBgTilemapBufferRect_Palette0(0, 0x000, 0, 0, 30, 20);
|
||||
FillBgTilemapBufferRect_Palette0(1, 0x000, 0, 0, 30, 20);
|
||||
FillBgTilemapBufferRect_Palette0(2, 0x000, 0, 0, 30, 20);
|
||||
FillBgTilemapBufferRect_Palette0(3, 0x000, 0, 0, 30, 20);
|
||||
CopyBgTilemapBufferToVram(0);
|
||||
CopyBgTilemapBufferToVram(1);
|
||||
CopyBgTilemapBufferToVram(2);
|
||||
CopyBgTilemapBufferToVram(3);
|
||||
decompress_and_copy_tile_data_to_vram(3, sWonderNewsData->unk_01BC->tiles, 0, 8, 0);
|
||||
sWonderNewsData->unk_01C8[0] = AddWindow(&gUnknown_082F1DE8[0]);
|
||||
sWonderNewsData->unk_01C8[1] = AddWindow(&gUnknown_082F1DE8[1]);
|
||||
break;
|
||||
case 3:
|
||||
if (free_temp_tile_data_buffers_if_possible())
|
||||
return 0;
|
||||
LoadPalette(stdpal_get(1), 0x20, 0x20);
|
||||
gPaletteFade.bufferTransferDisabled = TRUE;
|
||||
LoadPalette(sWonderNewsData->unk_01BC->pal, 0x10, 0x20);
|
||||
LZ77UnCompWram(sWonderNewsData->unk_01BC->map, sWonderNewsData->buffer_03A4);
|
||||
CopyRectToBgTilemapBufferRect(1, sWonderNewsData->buffer_03A4, 0, 0, 30, 3, 0, 0, 30, 3, 1, 8, 0);
|
||||
CopyRectToBgTilemapBufferRect(3, sWonderNewsData->buffer_03A4, 0, 3, 30, 23, 0, 3, 30, 23, 1, 8, 0);
|
||||
CopyBgTilemapBufferToVram(1);
|
||||
CopyBgTilemapBufferToVram(3);
|
||||
break;
|
||||
case 4:
|
||||
sub_801CDCC();
|
||||
break;
|
||||
case 5:
|
||||
sub_801CE7C();
|
||||
CopyBgTilemapBufferToVram(0);
|
||||
CopyBgTilemapBufferToVram(2);
|
||||
break;
|
||||
case 6:
|
||||
ShowBg(1);
|
||||
ShowBg(2);
|
||||
ShowBg(3);
|
||||
gPaletteFade.bufferTransferDisabled = FALSE;
|
||||
sWonderNewsData->unk_01C1 = AddScrollIndicatorArrowPair(&sWonderNewsData->unk_0394, &sWonderNewsData->unk_01C6);
|
||||
BeginNormalPaletteFade(0xFFFFFFFF, 0, 16, 0, 0);
|
||||
UpdatePaletteFade();
|
||||
break;
|
||||
default:
|
||||
if (UpdatePaletteFade())
|
||||
return 0;
|
||||
sWonderNewsData->unk_01C0_1 = 0;
|
||||
return 1;
|
||||
}
|
||||
|
||||
++sWonderNewsData->unk_01C0_1;
|
||||
return 0;
|
||||
}
|
||||
|
||||
s32 FadeOutFromWonderNews(bool32 flag)
|
||||
{
|
||||
if (sWonderNewsData == NULL)
|
||||
return -1;
|
||||
switch (sWonderNewsData->unk_01C0_1)
|
||||
{
|
||||
case 0:
|
||||
BeginNormalPaletteFade(0xFFFFFFFF, 0, 0, 16, 0);
|
||||
break;
|
||||
case 1:
|
||||
if (UpdatePaletteFade())
|
||||
return 0;
|
||||
ChangeBgY(2, 0, 0);
|
||||
SetGpuReg(REG_OFFSET_WIN0H, 0);
|
||||
SetGpuReg(REG_OFFSET_WIN0V, 0);
|
||||
SetGpuReg(REG_OFFSET_WININ, 0);
|
||||
SetGpuReg(REG_OFFSET_WINOUT, 0);
|
||||
ClearGpuRegBits(REG_OFFSET_DISPCNT, DISPCNT_WIN0_ON);
|
||||
break;
|
||||
case 2:
|
||||
FillBgTilemapBufferRect_Palette0(0, 0x000, 0, 0, 30, 20);
|
||||
FillBgTilemapBufferRect_Palette0(1, 0x000, 0, 0, 30, 20);
|
||||
FillBgTilemapBufferRect_Palette0(2, 0x000, 0, 0, 30, 24);
|
||||
FillBgTilemapBufferRect_Palette0(3, 0x000, 0, 0, 30, 24);
|
||||
CopyBgTilemapBufferToVram(0);
|
||||
CopyBgTilemapBufferToVram(1);
|
||||
CopyBgTilemapBufferToVram(2);
|
||||
CopyBgTilemapBufferToVram(3);
|
||||
break;
|
||||
case 3:
|
||||
HideBg(1);
|
||||
HideBg(2);
|
||||
RemoveWindow(sWonderNewsData->unk_01C8[1]);
|
||||
RemoveWindow(sWonderNewsData->unk_01C8[0]);
|
||||
break;
|
||||
case 4:
|
||||
ChangeBgY(2, 0, 0);
|
||||
ChangeBgY(3, 0, 0);
|
||||
if (sWonderNewsData->unk_01C1 != 0xFF)
|
||||
{
|
||||
RemoveScrollIndicatorArrowPair(sWonderNewsData->unk_01C1);
|
||||
sWonderNewsData->unk_01C1 = 0xFF;
|
||||
}
|
||||
break;
|
||||
case 5:
|
||||
PrintMysteryGiftOrEReaderTopMenu(gGiftIsFromEReader, flag);
|
||||
MG_DrawCheckerboardPattern(3);
|
||||
CopyBgTilemapBufferToVram(0);
|
||||
CopyBgTilemapBufferToVram(3);
|
||||
BeginNormalPaletteFade(0xFFFFFFFF, 0, 16, 0, 0);
|
||||
break;
|
||||
default:
|
||||
if (UpdatePaletteFade())
|
||||
return 0;
|
||||
sWonderNewsData->unk_01C0_1 = 0;
|
||||
return 1;
|
||||
}
|
||||
++sWonderNewsData->unk_01C0_1;
|
||||
return 0;
|
||||
}
|
||||
|
||||
void MENews_RemoveScrollIndicatorArrowPair(void)
|
||||
{
|
||||
if (!sWonderNewsData->unk_01C0_0 && sWonderNewsData->unk_01C1 != 0xFF)
|
||||
{
|
||||
RemoveScrollIndicatorArrowPair(sWonderNewsData->unk_01C1);
|
||||
sWonderNewsData->unk_01C1 = 0xFF;
|
||||
sWonderNewsData->unk_01C0_0 = TRUE;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
void MENews_AddScrollIndicatorArrowPair(void)
|
||||
{
|
||||
if (sWonderNewsData->unk_01C0_0)
|
||||
{
|
||||
sWonderNewsData->unk_01C1 = AddScrollIndicatorArrowPair(&sWonderNewsData->unk_0394, &sWonderNewsData->unk_01C6);
|
||||
sWonderNewsData->unk_01C0_0 = FALSE;
|
||||
}
|
||||
}
|
||||
|
||||
u32 MENews_GetInput(u16 input)
|
||||
{
|
||||
if (sWonderNewsData->unk_01C2_0)
|
||||
{
|
||||
sub_801CFA4();
|
||||
return 0xFF;
|
||||
}
|
||||
switch (input)
|
||||
{
|
||||
case A_BUTTON:
|
||||
return 0;
|
||||
case B_BUTTON:
|
||||
return 1;
|
||||
case DPAD_UP:
|
||||
if (sWonderNewsData->unk_01C6 == 0)
|
||||
return 0xFF;
|
||||
if (sWonderNewsData->unk_01C0_0)
|
||||
return 0xFF;
|
||||
sWonderNewsData->unk_01C3_0 = FALSE;
|
||||
break;
|
||||
case DPAD_DOWN:
|
||||
if (sWonderNewsData->unk_01C6 == sWonderNewsData->unk_01C4)
|
||||
return 0xFF;
|
||||
if (sWonderNewsData->unk_01C0_0)
|
||||
return 0xFF;
|
||||
sWonderNewsData->unk_01C3_0 = TRUE;
|
||||
break;
|
||||
default:
|
||||
return 0xFF;
|
||||
}
|
||||
sWonderNewsData->unk_01C2_0 = TRUE;
|
||||
sWonderNewsData->unk_01C2_1 = 2;
|
||||
sWonderNewsData->unk_01C3_1 = 0;
|
||||
if (sWonderNewsData->unk_01C3_0 == FALSE)
|
||||
return 2;
|
||||
else
|
||||
return 3;
|
||||
}
|
||||
|
||||
void sub_801CDCC(void)
|
||||
{
|
||||
u8 i = 0;
|
||||
memcpy(sWonderNewsData->unk_01CE, sWonderNewsData->unk_0000.unk_04, 40);
|
||||
sWonderNewsData->unk_01CE[40] = EOS;
|
||||
for (; i < 10; ++i)
|
||||
{
|
||||
memcpy(sWonderNewsData->unk_01F7[i], sWonderNewsData->unk_0000.unk_2C[i], 40);
|
||||
sWonderNewsData->unk_01F7[i][40] = EOS;
|
||||
if (i > 7 && sWonderNewsData->unk_01F7[i][0] != EOS)
|
||||
++sWonderNewsData->unk_01C4;
|
||||
}
|
||||
sWonderNewsData->unk_0394 = gUnknown_082F1DF8;
|
||||
sWonderNewsData->unk_0394.fullyDownThreshold = sWonderNewsData->unk_01C4;
|
||||
}
|
||||
|
||||
void sub_801CE7C(void)
|
||||
{
|
||||
u8 i = 0;
|
||||
s32 x;
|
||||
PutWindowTilemap(sWonderNewsData->unk_01C8[0]);
|
||||
PutWindowTilemap(sWonderNewsData->unk_01C8[1]);
|
||||
FillWindowPixelBuffer(sWonderNewsData->unk_01C8[0], 0);
|
||||
FillWindowPixelBuffer(sWonderNewsData->unk_01C8[1], 0);
|
||||
x = (0xe0 - GetStringWidth(3, sWonderNewsData->unk_01CE, GetFontAttribute(3, 2))) / 2;
|
||||
if (x < 0)
|
||||
x = 0;
|
||||
AddTextPrinterParameterized3(sWonderNewsData->unk_01C8[0], 3, x, 6, gUnknown_082F1DE0[sWonderNewsData->unk_01BC->textPal1], 0, sWonderNewsData->unk_01CE);
|
||||
for (; i < 10; ++i)
|
||||
{
|
||||
AddTextPrinterParameterized3(sWonderNewsData->unk_01C8[1], 3, 0, 16 * i + 2, gUnknown_082F1DE0[sWonderNewsData->unk_01BC->textPal2], 0, sWonderNewsData->unk_01F7[i]);
|
||||
}
|
||||
CopyWindowToVram(sWonderNewsData->unk_01C8[0], 3);
|
||||
CopyWindowToVram(sWonderNewsData->unk_01C8[1], 3);
|
||||
}
|
||||
|
||||
void sub_801CFA4(void)
|
||||
{
|
||||
u16 r4 = sWonderNewsData->unk_01C2_1;
|
||||
r4 <<= 8;
|
||||
if (sWonderNewsData->unk_01C3_0)
|
||||
{
|
||||
ChangeBgY(2, r4, 1);
|
||||
ChangeBgY(3, r4, 1);
|
||||
}
|
||||
else
|
||||
{
|
||||
ChangeBgY(2, r4, 2);
|
||||
ChangeBgY(3, r4, 2);
|
||||
}
|
||||
sWonderNewsData->unk_01C3_1 += sWonderNewsData->unk_01C2_1;
|
||||
if (sWonderNewsData->unk_01C3_1 > 15)
|
||||
{
|
||||
if (sWonderNewsData->unk_01C3_0)
|
||||
++sWonderNewsData->unk_01C6;
|
||||
else
|
||||
--sWonderNewsData->unk_01C6;
|
||||
sWonderNewsData->unk_01C2_0 = FALSE;
|
||||
sWonderNewsData->unk_01C3_1 = 0;
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,291 @@
|
||||
#include "global.h"
|
||||
#include "alloc.h"
|
||||
#include "decompress.h"
|
||||
#include "overworld.h"
|
||||
#include "script.h"
|
||||
#include "battle_tower.h"
|
||||
#include "mevent.h"
|
||||
#include "mystery_event_script.h"
|
||||
#include "mevent_client.h"
|
||||
|
||||
EWRAM_DATA struct mevent_client * s_mevent_client_ptr = NULL;
|
||||
|
||||
static void mevent_client_init(struct mevent_client *, u32, u32);
|
||||
static u32 mevent_client_exec(struct mevent_client *);
|
||||
static void mevent_client_free_resources(struct mevent_client *);
|
||||
|
||||
extern const struct mevent_client_cmd gUnknown_082F2598[];
|
||||
|
||||
void mevent_client_do_init(u32 arg)
|
||||
{
|
||||
s_mevent_client_ptr = AllocZeroed(sizeof(struct mevent_client));
|
||||
mevent_client_init(s_mevent_client_ptr, 1, 0);
|
||||
s_mevent_client_ptr->unk_4C = arg;
|
||||
}
|
||||
|
||||
u32 mevent_client_do_exec(u16 * a0)
|
||||
{
|
||||
u32 result;
|
||||
if (s_mevent_client_ptr == NULL)
|
||||
return 6;
|
||||
result = mevent_client_exec(s_mevent_client_ptr);
|
||||
if (result == 6)
|
||||
{
|
||||
*a0 = s_mevent_client_ptr->param;
|
||||
mevent_client_free_resources(s_mevent_client_ptr);
|
||||
Free(s_mevent_client_ptr);
|
||||
s_mevent_client_ptr = NULL;
|
||||
}
|
||||
return result;
|
||||
}
|
||||
|
||||
void mevent_client_inc_flag(void)
|
||||
{
|
||||
s_mevent_client_ptr->flag++;
|
||||
}
|
||||
|
||||
void * mevent_client_get_buffer(void)
|
||||
{
|
||||
return s_mevent_client_ptr->buffer;
|
||||
}
|
||||
|
||||
void mevent_client_set_param(u32 a0)
|
||||
{
|
||||
s_mevent_client_ptr->param = a0;
|
||||
}
|
||||
|
||||
static void mevent_client_init(struct mevent_client * svr, u32 sendPlayerNo, u32 recvPlayerNo)
|
||||
{
|
||||
svr->unk_00 = 0;
|
||||
svr->mainseqno = 0;
|
||||
svr->flag = 0;
|
||||
svr->sendBuffer = AllocZeroed(ME_SEND_BUF_SIZE);
|
||||
svr->recvBuffer = AllocZeroed(ME_SEND_BUF_SIZE);
|
||||
svr->cmdBuffer = AllocZeroed(ME_SEND_BUF_SIZE);
|
||||
svr->buffer = AllocZeroed(0x40);
|
||||
mevent_srv_sub_init(&svr->manager, sendPlayerNo, recvPlayerNo);
|
||||
}
|
||||
|
||||
static void mevent_client_free_resources(struct mevent_client * svr)
|
||||
{
|
||||
Free(svr->sendBuffer);
|
||||
Free(svr->recvBuffer);
|
||||
Free(svr->cmdBuffer);
|
||||
Free(svr->buffer);
|
||||
}
|
||||
|
||||
static void mevent_client_jmp_buffer(struct mevent_client * svr)
|
||||
{
|
||||
memcpy(svr->cmdBuffer, svr->recvBuffer, ME_SEND_BUF_SIZE);
|
||||
svr->cmdidx = 0;
|
||||
}
|
||||
|
||||
static void mevent_client_send_word(struct mevent_client * svr, u32 ident, u32 word)
|
||||
{
|
||||
CpuFill32(0, svr->sendBuffer, ME_SEND_BUF_SIZE);
|
||||
*(u32 *)svr->sendBuffer = word;
|
||||
mevent_srv_sub_init_send(&svr->manager, ident, svr->sendBuffer, sizeof(u32));
|
||||
}
|
||||
|
||||
static u32 mainseq_0(struct mevent_client * svr)
|
||||
{
|
||||
// init
|
||||
memcpy(svr->cmdBuffer, gUnknown_082F2598, ME_SEND_BUF_SIZE);
|
||||
svr->cmdidx = 0;
|
||||
svr->mainseqno = 4;
|
||||
svr->flag = 0;
|
||||
return 0;
|
||||
}
|
||||
|
||||
static u32 mainseq_1(struct mevent_client * svr)
|
||||
{
|
||||
// done
|
||||
return 6;
|
||||
}
|
||||
|
||||
|
||||
static u32 mainseq_2(struct mevent_client * svr)
|
||||
{
|
||||
// do recv
|
||||
if (mevent_srv_sub_recv(&svr->manager))
|
||||
{
|
||||
svr->mainseqno = 4;
|
||||
svr->flag = 0;
|
||||
}
|
||||
return 1;
|
||||
}
|
||||
|
||||
static u32 mainseq_3(struct mevent_client * svr)
|
||||
{
|
||||
// do send
|
||||
if (mevent_srv_sub_send(&svr->manager))
|
||||
{
|
||||
svr->mainseqno = 4;
|
||||
svr->flag = 0;
|
||||
}
|
||||
return 1;
|
||||
}
|
||||
|
||||
static u32 mainseq_4(struct mevent_client * svr)
|
||||
{
|
||||
// process command
|
||||
struct mevent_client_cmd * cmd = &svr->cmdBuffer[svr->cmdidx];
|
||||
++svr->cmdidx;
|
||||
switch (cmd->instr)
|
||||
{
|
||||
case 0:
|
||||
break;
|
||||
case 1:
|
||||
svr->param = cmd->parameter;
|
||||
svr->mainseqno = 1;
|
||||
svr->flag = 0;
|
||||
break;
|
||||
case 2:
|
||||
mevent_srv_sub_init_recv(&svr->manager, cmd->parameter, svr->recvBuffer);
|
||||
svr->mainseqno = 2;
|
||||
svr->flag = 0;
|
||||
break;
|
||||
case 3:
|
||||
svr->mainseqno = 3;
|
||||
svr->flag = 0;
|
||||
break;
|
||||
case 20:
|
||||
mevent_srv_sub_init_send(&svr->manager, 0x14, svr->sendBuffer, 0);
|
||||
svr->mainseqno = 3;
|
||||
svr->flag = 0;
|
||||
break;
|
||||
case 19:
|
||||
mevent_client_send_word(svr, 0x12, GetGameStat(cmd->parameter));
|
||||
svr->mainseqno = 3;
|
||||
svr->flag = 0;
|
||||
break;
|
||||
case 6:
|
||||
if (svr->param == 0)
|
||||
mevent_client_jmp_buffer(svr);
|
||||
break;
|
||||
case 7:
|
||||
if (svr->param == 1)
|
||||
mevent_client_jmp_buffer(svr);
|
||||
break;
|
||||
case 4:
|
||||
mevent_client_jmp_buffer(svr);
|
||||
break;
|
||||
case 5:
|
||||
memcpy(svr->buffer, svr->recvBuffer, 0x40);
|
||||
svr->mainseqno = 5;
|
||||
svr->flag = 0;
|
||||
return 2;
|
||||
case 11:
|
||||
memcpy(svr->buffer, svr->recvBuffer, 0x40);
|
||||
svr->mainseqno = 5;
|
||||
svr->flag = 0;
|
||||
return 3;
|
||||
case 12:
|
||||
memcpy(svr->buffer, svr->recvBuffer, 0x40);
|
||||
svr->mainseqno = 5;
|
||||
svr->flag = 0;
|
||||
return 5;
|
||||
case 13:
|
||||
svr->mainseqno = 5;
|
||||
svr->flag = 0;
|
||||
return 4;
|
||||
case 8:
|
||||
sub_801B580(svr->sendBuffer, svr->unk_4C);
|
||||
mevent_srv_sub_init_send(&svr->manager, 0x11, svr->sendBuffer, sizeof(struct MEventStruct_Unk1442CC));
|
||||
break;
|
||||
case 14:
|
||||
mevent_client_send_word(svr, 0x13, svr->param);
|
||||
break;
|
||||
case 10:
|
||||
sub_801B21C(svr->recvBuffer);
|
||||
break;
|
||||
case 9:
|
||||
if (!sub_801B1A4(svr->recvBuffer))
|
||||
{
|
||||
sub_801B078(svr->recvBuffer);
|
||||
mevent_client_send_word(svr, 0x13, 0);
|
||||
}
|
||||
else
|
||||
mevent_client_send_word(svr, 0x13, 1);
|
||||
break;
|
||||
case 15:
|
||||
svr->mainseqno = 6;
|
||||
svr->flag = 0;
|
||||
break;
|
||||
case 16:
|
||||
sub_801B508(svr->recvBuffer);
|
||||
break;
|
||||
case 17:
|
||||
InitRamScript_NoEventObject(svr->recvBuffer, 1000);
|
||||
break;
|
||||
case 18:
|
||||
memcpy(&gSaveBlock2Ptr->frontier.ereaderTrainer, svr->recvBuffer, 0xbc);
|
||||
ValidateEReaderTrainer();
|
||||
break;
|
||||
case 21:
|
||||
memcpy(gDecompressionBuffer, svr->recvBuffer, ME_SEND_BUF_SIZE);
|
||||
svr->mainseqno = 7;
|
||||
svr->flag = 0;
|
||||
break;
|
||||
}
|
||||
|
||||
return 1;
|
||||
}
|
||||
|
||||
static u32 mainseq_5(struct mevent_client * svr)
|
||||
{
|
||||
// wait flag
|
||||
if (svr->flag)
|
||||
{
|
||||
svr->mainseqno = 4;
|
||||
svr->flag = 0;
|
||||
}
|
||||
return 1;
|
||||
}
|
||||
|
||||
static u32 mainseq_6(struct mevent_client * svr)
|
||||
{
|
||||
// ???
|
||||
switch (svr->flag)
|
||||
{
|
||||
case 0:
|
||||
sub_8153870(svr->recvBuffer);
|
||||
++svr->flag;
|
||||
break;
|
||||
case 1:
|
||||
if (!sub_8153884(&svr->param))
|
||||
{
|
||||
svr->mainseqno = 4;
|
||||
svr->flag = 0;
|
||||
}
|
||||
break;
|
||||
}
|
||||
return 1;
|
||||
}
|
||||
|
||||
static u32 mainseq_7(struct mevent_client * svr)
|
||||
{
|
||||
// exec arbitrary code
|
||||
u32 (*func)(u32 *, struct SaveBlock2 *, struct SaveBlock1 *) = (void *)gDecompressionBuffer;
|
||||
if (func(&svr->param, gSaveBlock2Ptr, gSaveBlock1Ptr) == 1)
|
||||
{
|
||||
svr->mainseqno = 4;
|
||||
svr->flag = 0;
|
||||
}
|
||||
return 1;
|
||||
}
|
||||
|
||||
static u32 mevent_client_exec(struct mevent_client * svr)
|
||||
{
|
||||
u32 (*funcs[])(struct mevent_client *) = {
|
||||
mainseq_0,
|
||||
mainseq_1,
|
||||
mainseq_2,
|
||||
mainseq_3,
|
||||
mainseq_4,
|
||||
mainseq_5,
|
||||
mainseq_6,
|
||||
mainseq_7
|
||||
};
|
||||
return funcs[svr->mainseqno](svr);
|
||||
}
|
||||
@@ -0,0 +1,147 @@
|
||||
#include "global.h"
|
||||
#include "mevent.h"
|
||||
#include "random.h"
|
||||
#include "event_data.h"
|
||||
#include "mevent_news.h"
|
||||
|
||||
static u32 sub_801DCAC(struct MysteryEventStruct *);
|
||||
static void sub_801DD10(struct MysteryEventStruct *);
|
||||
static u32 sub_801DD44(struct MysteryEventStruct *);
|
||||
static void sub_801DCD8(struct MysteryEventStruct *);
|
||||
static void sub_801DCCC(struct MysteryEventStruct *);
|
||||
|
||||
void GenerateRandomNews(u32 a0)
|
||||
{
|
||||
struct MysteryEventStruct *r5 = sub_801B044();
|
||||
|
||||
r5->unk_0_0 = a0;
|
||||
switch (a0)
|
||||
{
|
||||
case 0:
|
||||
break;
|
||||
case 1:
|
||||
case 2:
|
||||
r5->unk_1 = (Random() % 15) + 16;
|
||||
break;
|
||||
case 3:
|
||||
r5->unk_1 = (Random() % 15) + 1;
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
void sub_801DBC0(void)
|
||||
{
|
||||
struct MysteryEventStruct *r5 = sub_801B044();
|
||||
|
||||
r5->unk_0_0 = 0;
|
||||
r5->unk_0_2 = 0;
|
||||
r5->unk_0_5 = 0;
|
||||
r5->unk_1 = 0;
|
||||
VarSet(VAR_0x402E, 0);
|
||||
}
|
||||
|
||||
void sub_801DBDC(void)
|
||||
{
|
||||
u16 *r4 = GetVarPointer(VAR_0x402E);
|
||||
struct MysteryEventStruct *r2 = sub_801B044();
|
||||
struct MysteryEventStruct r0 = *r2;
|
||||
|
||||
if ((u8)r0.unk_0_5 > 4 && ++(*r4) > 0x1f3)
|
||||
{
|
||||
r2->unk_0_5 = 0;
|
||||
*r4 = 0;
|
||||
}
|
||||
}
|
||||
|
||||
u16 sub_801DC20(void)
|
||||
{
|
||||
u16 *r6 = &gSpecialVar_Result;
|
||||
struct MysteryEventStruct *r4 = sub_801B044();
|
||||
u16 r5;
|
||||
|
||||
if (!IsMysteryEventEnabled() || !ValidateReceivedWonderNews())
|
||||
return 0;
|
||||
|
||||
r5 = sub_801DD44(r4);
|
||||
|
||||
switch (r5)
|
||||
{
|
||||
case 0:
|
||||
break;
|
||||
case 1:
|
||||
*r6 = sub_801DCAC(r4);
|
||||
break;
|
||||
case 2:
|
||||
*r6 = sub_801DCAC(r4);
|
||||
break;
|
||||
case 3:
|
||||
break;
|
||||
case 4:
|
||||
*r6 = sub_801DCAC(r4);
|
||||
sub_801DCD8(r4);
|
||||
break;
|
||||
case 5:
|
||||
*r6 = sub_801DCAC(r4);
|
||||
sub_801DCCC(r4);
|
||||
break;
|
||||
case 6:
|
||||
break;
|
||||
}
|
||||
|
||||
return r5;
|
||||
}
|
||||
|
||||
static u32 sub_801DCAC(struct MysteryEventStruct *a0)
|
||||
{
|
||||
u32 r4;
|
||||
|
||||
a0->unk_0_0 = 0;
|
||||
r4 = a0->unk_1 + 0x84;
|
||||
a0->unk_1 = 0;
|
||||
sub_801DD10(a0);
|
||||
return r4;
|
||||
}
|
||||
|
||||
static void sub_801DCCC(struct MysteryEventStruct *a0)
|
||||
{
|
||||
a0->unk_0_2 = 0;
|
||||
}
|
||||
|
||||
static void sub_801DCD8(struct MysteryEventStruct *a0)
|
||||
{
|
||||
a0->unk_0_2++;
|
||||
if ((u8)a0->unk_0_2 > 4)
|
||||
a0->unk_0_2 = 4;
|
||||
}
|
||||
|
||||
static void sub_801DD10(struct MysteryEventStruct *a0)
|
||||
{
|
||||
a0->unk_0_5++;
|
||||
if ((u8)a0->unk_0_5 > 5)
|
||||
a0->unk_0_5 = 5;
|
||||
}
|
||||
|
||||
static u32 sub_801DD44(struct MysteryEventStruct *a0)
|
||||
{
|
||||
struct MysteryEventStruct r0;
|
||||
if ((u8)a0->unk_0_5 == 5)
|
||||
return 6;
|
||||
|
||||
r0 = *a0;
|
||||
switch (r0.unk_0_0)
|
||||
{
|
||||
case 0:
|
||||
return 3;
|
||||
case 1:
|
||||
return 1;
|
||||
case 2:
|
||||
return 2;
|
||||
case 3:
|
||||
if ((u8)r0.unk_0_2 < 3)
|
||||
return 4;
|
||||
return 5;
|
||||
default:
|
||||
AGB_ASSERT(0);
|
||||
return 0;
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,191 @@
|
||||
#include "global.h"
|
||||
#include "mevent_client.h"
|
||||
#include "mevent_server.h"
|
||||
|
||||
const u8 gText_CanceledReadingCard[] = _("Canceled reading\nthe Card.");
|
||||
|
||||
|
||||
const struct mevent_client_cmd gUnknown_082F2598[] = {
|
||||
{.instr = 2, .parameter = 16},
|
||||
{.instr = 4, .parameter = 0}
|
||||
};
|
||||
|
||||
const struct mevent_client_cmd gUnknown_082F25A8[] = {
|
||||
{.instr = 8, .parameter = 0},
|
||||
{.instr = 3, .parameter = 0},
|
||||
{.instr = 2, .parameter = 16},
|
||||
{.instr = 4, .parameter = 0}
|
||||
};
|
||||
|
||||
const struct mevent_client_cmd gUnknown_082F25C8[] = {
|
||||
{.instr = 20, .parameter = 0},
|
||||
{.instr = 1, .parameter = 10}
|
||||
};
|
||||
|
||||
const struct mevent_client_cmd gUnknown_082F25D8[] = {
|
||||
{.instr = 20, .parameter = 0},
|
||||
{.instr = 1, .parameter = 11}
|
||||
};
|
||||
|
||||
const struct mevent_client_cmd gUnknown_082F25E8[] = {
|
||||
{.instr = 20, .parameter = 0},
|
||||
{.instr = 1, .parameter = 0}
|
||||
};
|
||||
|
||||
const struct mevent_client_cmd gUnknown_082F25F8[] = {
|
||||
{.instr = 2, .parameter = 22},
|
||||
{.instr = 10, .parameter = 0},
|
||||
{.instr = 2, .parameter = 25},
|
||||
{.instr = 17, .parameter = 0},
|
||||
{.instr = 20, .parameter = 0},
|
||||
{.instr = 1, .parameter = 2}
|
||||
};
|
||||
|
||||
const struct mevent_client_cmd gUnknown_082F2628[] = {
|
||||
{.instr = 2, .parameter = 23},
|
||||
{.instr = 9, .parameter = 0},
|
||||
{.instr = 3, .parameter = 0},
|
||||
{.instr = 2, .parameter = 16},
|
||||
{.instr = 4, .parameter = 0}
|
||||
};
|
||||
|
||||
const struct mevent_client_cmd gUnknown_082F2650[] = {
|
||||
{.instr = 20, .parameter = 0},
|
||||
{.instr = 1, .parameter = 7}
|
||||
};
|
||||
|
||||
const struct mevent_client_cmd gUnknown_082F2660[] = {
|
||||
{.instr = 20, .parameter = 0},
|
||||
{.instr = 1, .parameter = 3}
|
||||
};
|
||||
|
||||
const struct mevent_client_cmd gUnknown_082F2670[] = {
|
||||
{.instr = 13, .parameter = 0},
|
||||
{.instr = 14, .parameter = 0},
|
||||
{.instr = 3, .parameter = 0},
|
||||
{.instr = 2, .parameter = 16},
|
||||
{.instr = 4, .parameter = 0}
|
||||
};
|
||||
|
||||
const struct mevent_client_cmd gUnknown_082F2698[] = {
|
||||
{.instr = 20, .parameter = 0},
|
||||
{.instr = 1, .parameter = 9}
|
||||
};
|
||||
|
||||
const struct mevent_client_cmd gUnknown_082F26A8[] = {
|
||||
{.instr = 20, .parameter = 0},
|
||||
{.instr = 1, .parameter = 5}
|
||||
};
|
||||
|
||||
const struct mevent_client_cmd gUnknown_082F26B8[] = {
|
||||
{.instr = 2, .parameter = 21},
|
||||
{.instr = 12, .parameter = 0},
|
||||
{.instr = 20, .parameter = 0},
|
||||
{.instr = 1, .parameter = 14},
|
||||
{.instr = 2, .parameter = 21},
|
||||
{.instr = 12, .parameter = 0},
|
||||
{.instr = 20, .parameter = 0},
|
||||
{.instr = 1, .parameter = 13}
|
||||
};
|
||||
|
||||
const struct mevent_cmd gUnknown_082F26F8[] = {
|
||||
{.instr = 18, .flag = 0x10, .parameter = gUnknown_082F25C8},
|
||||
{.instr = 1, .flag = 0x00, .parameter = NULL},
|
||||
{.instr = 2, .flag = 0x14, .parameter = NULL},
|
||||
{.instr = 0, .flag = 0x0a, .parameter = NULL},
|
||||
{.instr = 18, .flag = 0x10, .parameter = gUnknown_082F25D8},
|
||||
{.instr = 1, .flag = 0x00, .parameter = NULL},
|
||||
{.instr = 2, .flag = 0x14, .parameter = NULL},
|
||||
{.instr = 0, .flag = 0x0b, .parameter = NULL},
|
||||
{.instr = 18, .flag = 0x10, .parameter = gUnknown_082F2698},
|
||||
{.instr = 1, .flag = 0x00, .parameter = NULL},
|
||||
{.instr = 2, .flag = 0x14, .parameter = NULL},
|
||||
{.instr = 0, .flag = 0x09, .parameter = NULL}
|
||||
};
|
||||
|
||||
const struct mevent_cmd gUnknown_082F2788[] = {
|
||||
{.instr = 18, .flag = 0x20, .parameter = gUnknown_082F26B8},
|
||||
{.instr = 1, .flag = 0x00, .parameter = NULL},
|
||||
{.instr = 20, .flag = 0x1b, .parameter = gText_CanceledReadingCard},
|
||||
{.instr = 1, .flag = 0x00, .parameter = NULL},
|
||||
{.instr = 2, .flag = 0x14, .parameter = NULL},
|
||||
{.instr = 0, .flag = 0x09, .parameter = NULL}
|
||||
};
|
||||
|
||||
const struct mevent_cmd gUnknown_082F27D0[] = {
|
||||
{.instr = 18, .flag = 0x10, .parameter = gUnknown_082F2650},
|
||||
{.instr = 1, .flag = 0x00, .parameter = NULL},
|
||||
{.instr = 2, .flag = 0x14, .parameter = NULL},
|
||||
{.instr = 0, .flag = 0x07, .parameter = NULL}
|
||||
};
|
||||
|
||||
const struct mevent_cmd gUnknown_082F2800[] = {
|
||||
{.instr = 18, .flag = 0x28, .parameter = gUnknown_082F2628},
|
||||
{.instr = 1, .flag = 0x00, .parameter = NULL},
|
||||
{.instr = 14, .flag = 0x00, .parameter = NULL},
|
||||
{.instr = 1, .flag = 0x00, .parameter = NULL},
|
||||
{.instr = 2, .flag = 0x13, .parameter = NULL},
|
||||
{.instr = 8, .flag = 0x00, .parameter = NULL},
|
||||
{.instr = 4, .flag = 0x01, .parameter = gUnknown_082F27D0},
|
||||
{.instr = 18, .flag = 0x10, .parameter = gUnknown_082F2660},
|
||||
{.instr = 1, .flag = 0x00, .parameter = NULL},
|
||||
{.instr = 2, .flag = 0x14, .parameter = NULL},
|
||||
{.instr = 0, .flag = 0x03, .parameter = NULL}
|
||||
};
|
||||
|
||||
const struct mevent_cmd gUnknown_082F2884[] = {
|
||||
{.instr = 18, .flag = 0x30, .parameter = gUnknown_082F25F8},
|
||||
{.instr = 1, .flag = 0x00, .parameter = NULL},
|
||||
{.instr = 13, .flag = 0x00, .parameter = NULL},
|
||||
{.instr = 1, .flag = 0x00, .parameter = NULL},
|
||||
{.instr = 15, .flag = 0x00, .parameter = NULL},
|
||||
{.instr = 1, .flag = 0x00, .parameter = NULL},
|
||||
{.instr = 2, .flag = 0x14, .parameter = NULL},
|
||||
{.instr = 0, .flag = 0x02, .parameter = NULL}
|
||||
};
|
||||
|
||||
const struct mevent_cmd gUnknown_082F28E4[] = {
|
||||
{.instr = 18, .flag = 0x28, .parameter = gUnknown_082F2670},
|
||||
{.instr = 1, .flag = 0x00, .parameter = NULL},
|
||||
{.instr = 2, .flag = 0x13, .parameter = NULL},
|
||||
{.instr = 8, .flag = 0x00, .parameter = NULL},
|
||||
{.instr = 4, .flag = 0x00, .parameter = gUnknown_082F2884},
|
||||
{.instr = 3, .flag = 0x00, .parameter = gUnknown_082F2788}
|
||||
};
|
||||
|
||||
const struct mevent_cmd gUnknown_082F292C[] = {
|
||||
{.instr = 18, .flag = 0x10, .parameter = gUnknown_082F26A8},
|
||||
{.instr = 1, .flag = 0x00, .parameter = NULL},
|
||||
{.instr = 2, .flag = 0x14, .parameter = NULL},
|
||||
{.instr = 0, .flag = 0x05, .parameter = NULL},
|
||||
{.instr = 18, .flag = 0x10, .parameter = gUnknown_082F25E8},
|
||||
{.instr = 1, .flag = 0x00, .parameter = NULL},
|
||||
{.instr = 2, .flag = 0x14, .parameter = NULL},
|
||||
{.instr = 0, .flag = 0x00, .parameter = NULL}
|
||||
};
|
||||
|
||||
const struct mevent_cmd s_mevent_wonder_news[] = {
|
||||
{.instr = 27, .flag = 0x00, .parameter = NULL},
|
||||
{.instr = 18, .flag = 0x20, .parameter = gUnknown_082F25A8},
|
||||
{.instr = 1, .flag = 0x00, .parameter = NULL},
|
||||
{.instr = 2, .flag = 0x11, .parameter = NULL},
|
||||
{.instr = 5, .flag = 0x00, .parameter = NULL},
|
||||
{.instr = 30, .flag = 0x00, .parameter = NULL},
|
||||
{.instr = 4, .flag = 0x00, .parameter = gUnknown_082F26F8},
|
||||
{.instr = 3, .flag = 0x00, .parameter = gUnknown_082F2800}
|
||||
};
|
||||
|
||||
const struct mevent_cmd s_mevent_wonder_card[] = {
|
||||
{.instr = 26, .flag = 0x00, .parameter = NULL},
|
||||
{.instr = 28, .flag = 0x00, .parameter = NULL},
|
||||
{.instr = 18, .flag = 0x20, .parameter = gUnknown_082F25A8},
|
||||
{.instr = 1, .flag = 0x00, .parameter = NULL},
|
||||
{.instr = 2, .flag = 0x11, .parameter = NULL},
|
||||
{.instr = 5, .flag = 0x00, .parameter = NULL},
|
||||
{.instr = 6, .flag = 0x00, .parameter = NULL},
|
||||
{.instr = 4, .flag = 0x00, .parameter = gUnknown_082F26F8},
|
||||
{.instr = 7, .flag = 0x00, .parameter = NULL},
|
||||
{.instr = 4, .flag = 0x02, .parameter = gUnknown_082F28E4},
|
||||
{.instr = 4, .flag = 0x00, .parameter = gUnknown_082F2884},
|
||||
{.instr = 3, .flag = 0x00, .parameter = gUnknown_082F292C}
|
||||
};
|
||||
@@ -0,0 +1,295 @@
|
||||
#include "global.h"
|
||||
#include "alloc.h"
|
||||
#include "script.h"
|
||||
#include "mevent.h"
|
||||
#include "mevent_server.h"
|
||||
#include "mevent_server_helpers.h"
|
||||
|
||||
EWRAM_DATA struct mevent_srv_common * s_mevent_srv_common_ptr = NULL;
|
||||
|
||||
static void mevent_srv_init_common(struct mevent_srv_common *, const void *, u32, u32);
|
||||
static void mevent_srv_free_resources(struct mevent_srv_common *);
|
||||
static u32 mevent_srv_exec_common(struct mevent_srv_common *);
|
||||
|
||||
extern const struct mevent_cmd s_mevent_wonder_news[];
|
||||
extern const struct mevent_cmd s_mevent_wonder_card[];
|
||||
|
||||
void mevent_srv_init_wnews(void)
|
||||
{
|
||||
s_mevent_srv_common_ptr = AllocZeroed(sizeof(struct mevent_srv_common));
|
||||
mevent_srv_init_common(s_mevent_srv_common_ptr, s_mevent_wonder_news, 0, 1);
|
||||
}
|
||||
|
||||
void mevent_srv_new_wcard(void)
|
||||
{
|
||||
s_mevent_srv_common_ptr = AllocZeroed(sizeof(struct mevent_srv_common));
|
||||
mevent_srv_init_common(s_mevent_srv_common_ptr, s_mevent_wonder_card, 0, 1);
|
||||
}
|
||||
|
||||
u32 mevent_srv_common_do_exec(u16 * a0)
|
||||
{
|
||||
u32 result;
|
||||
if (s_mevent_srv_common_ptr == NULL)
|
||||
return 3;
|
||||
result = mevent_srv_exec_common(s_mevent_srv_common_ptr);
|
||||
if (result == 3)
|
||||
{
|
||||
*a0 = s_mevent_srv_common_ptr->param;
|
||||
mevent_srv_free_resources(s_mevent_srv_common_ptr);
|
||||
Free(s_mevent_srv_common_ptr);
|
||||
s_mevent_srv_common_ptr = NULL;
|
||||
}
|
||||
return result;
|
||||
}
|
||||
|
||||
static void mevent_srv_init_common(struct mevent_srv_common * svr, const void * cmdBuffer, u32 sendPlayerNo, u32 recvPlayerNo)
|
||||
{
|
||||
svr->unk_00 = 0;
|
||||
svr->mainseqno = 0;
|
||||
svr->wonder_card = AllocZeroed(sizeof(struct WonderCard));
|
||||
svr->wonder_news = AllocZeroed(sizeof(struct WonderNews));
|
||||
svr->recvBuffer = AllocZeroed(ME_SEND_BUF_SIZE);
|
||||
svr->mevent_unk1442cc = AllocZeroed(sizeof(struct MEventStruct_Unk1442CC));
|
||||
svr->cmdBuffer = cmdBuffer;
|
||||
svr->cmdidx = 0;
|
||||
mevent_srv_sub_init(&svr->manager, sendPlayerNo, recvPlayerNo);
|
||||
}
|
||||
|
||||
static void mevent_srv_free_resources(struct mevent_srv_common * svr)
|
||||
{
|
||||
Free(svr->wonder_card);
|
||||
Free(svr->wonder_news);
|
||||
Free(svr->recvBuffer);
|
||||
Free(svr->mevent_unk1442cc);
|
||||
}
|
||||
|
||||
void mevent_srv_common_init_send(struct mevent_srv_common * svr, u32 ident, const void * src, u32 size)
|
||||
{
|
||||
AGB_ASSERT(size <= ME_SEND_BUF_SIZE);
|
||||
mevent_srv_sub_init_send(&svr->manager, ident, src, size);
|
||||
}
|
||||
|
||||
static const void * mevent_first_if_not_null_else_second(const void * a0, const void * a1)
|
||||
{
|
||||
if (a0 != NULL)
|
||||
return a0;
|
||||
else
|
||||
return a1;
|
||||
}
|
||||
|
||||
static u32 mevent_compare_pointers(const void * a0, const void * a1)
|
||||
{
|
||||
if (a1 < a0)
|
||||
return 0;
|
||||
else if (a1 == a0)
|
||||
return 1;
|
||||
else
|
||||
return 2;
|
||||
}
|
||||
|
||||
static u32 common_mainseq_0(struct mevent_srv_common * svr)
|
||||
{
|
||||
// start
|
||||
svr->mainseqno = 4;
|
||||
return 0;
|
||||
}
|
||||
|
||||
static u32 common_mainseq_1(struct mevent_srv_common * svr)
|
||||
{
|
||||
// done
|
||||
return 3;
|
||||
}
|
||||
|
||||
static u32 common_mainseq_2(struct mevent_srv_common * svr)
|
||||
{
|
||||
// do recv
|
||||
if (mevent_srv_sub_recv(&svr->manager))
|
||||
svr->mainseqno = 4;
|
||||
return 1;
|
||||
}
|
||||
|
||||
static u32 common_mainseq_3(struct mevent_srv_common * svr)
|
||||
{
|
||||
// do send
|
||||
if (mevent_srv_sub_send(&svr->manager))
|
||||
svr->mainseqno = 4;
|
||||
return 1;
|
||||
}
|
||||
|
||||
static u32 common_mainseq_4(struct mevent_srv_common * svr)
|
||||
{
|
||||
// process command
|
||||
const struct mevent_cmd * cmd = &svr->cmdBuffer[svr->cmdidx];
|
||||
const void * ptr;
|
||||
svr->cmdidx++;
|
||||
|
||||
switch (cmd->instr)
|
||||
{
|
||||
case 0:
|
||||
// end
|
||||
AGB_ASSERT(cmd->parameter == NULL);
|
||||
svr->mainseqno = 1;
|
||||
svr->param = cmd->flag;
|
||||
break;
|
||||
case 1:
|
||||
// wait_send
|
||||
svr->mainseqno = 3;
|
||||
break;
|
||||
case 2:
|
||||
// receive
|
||||
AGB_ASSERT(cmd->parameter == NULL);
|
||||
mevent_srv_sub_init_recv(&svr->manager, cmd->flag, svr->recvBuffer);
|
||||
svr->mainseqno = 2;
|
||||
break;
|
||||
case 3:
|
||||
// jump
|
||||
AGB_ASSERT(cmd->flag == FALSE);
|
||||
svr->cmdidx = 0;
|
||||
svr->cmdBuffer = cmd->parameter;
|
||||
break;
|
||||
case 5:
|
||||
// get_1442CC
|
||||
AGB_ASSERT(cmd->flag == FALSE);
|
||||
AGB_ASSERT(cmd->parameter == NULL);
|
||||
memcpy(svr->mevent_unk1442cc, svr->recvBuffer, sizeof(struct MEventStruct_Unk1442CC));
|
||||
break;
|
||||
case 6:
|
||||
// check_header__pass_false
|
||||
AGB_ASSERT(cmd->flag == FALSE);
|
||||
AGB_ASSERT(cmd->parameter == NULL);
|
||||
svr->param = sub_801B6A0(svr->mevent_unk1442cc, FALSE);
|
||||
break;
|
||||
case 30:
|
||||
// check_header__pass_true
|
||||
AGB_ASSERT(cmd->flag == FALSE);
|
||||
AGB_ASSERT(cmd->parameter == NULL);
|
||||
svr->param = sub_801B6A0(svr->mevent_unk1442cc, TRUE);
|
||||
break;
|
||||
case 4:
|
||||
// jump_if_eq
|
||||
if (svr->param == cmd->flag)
|
||||
{
|
||||
svr->cmdidx = 0;
|
||||
svr->cmdBuffer = cmd->parameter;
|
||||
}
|
||||
break;
|
||||
case 7:
|
||||
// check_crc
|
||||
AGB_ASSERT(cmd->flag == FALSE);
|
||||
ptr = mevent_first_if_not_null_else_second(cmd->parameter, svr->wonder_card);
|
||||
svr->param = sub_801B6EC(ptr, svr->mevent_unk1442cc, ptr);
|
||||
break;
|
||||
case 8:
|
||||
// read_word
|
||||
AGB_ASSERT(cmd->flag == FALSE);
|
||||
AGB_ASSERT(cmd->parameter == NULL);
|
||||
svr->param = *(u32 *)svr->recvBuffer;
|
||||
break;
|
||||
case 9:
|
||||
AGB_ASSERT(cmd->flag == FALSE);
|
||||
ptr = mevent_first_if_not_null_else_second(cmd->parameter, &svr->sendWord);
|
||||
svr->param = sub_801B708(ptr, svr->mevent_unk1442cc, ptr);
|
||||
break;
|
||||
case 10:
|
||||
AGB_ASSERT(cmd->parameter == NULL);
|
||||
svr->param = MEventStruct_Unk1442CC_GetValueNFrom_unk_20(svr->mevent_unk1442cc, cmd->flag);
|
||||
break;
|
||||
case 11:
|
||||
AGB_ASSERT(cmd->flag == FALSE);
|
||||
svr->param = MEventStruct_Unk1442CC_CompareField_unk_16(svr->mevent_unk1442cc, cmd->parameter);
|
||||
break;
|
||||
case 12:
|
||||
AGB_ASSERT(cmd->flag == FALSE);
|
||||
svr->param = mevent_compare_pointers(cmd->parameter, *(void **)svr->recvBuffer);
|
||||
break;
|
||||
case 14:
|
||||
AGB_ASSERT(cmd->flag == FALSE);
|
||||
mevent_srv_common_init_send(svr, 0x17, mevent_first_if_not_null_else_second(cmd->parameter, svr->wonder_news), sizeof(struct WonderNews));
|
||||
break;
|
||||
case 13:
|
||||
AGB_ASSERT(cmd->flag == FALSE);
|
||||
mevent_srv_common_init_send(svr, 0x16, mevent_first_if_not_null_else_second(cmd->parameter, svr->wonder_card), sizeof(struct WonderCard));
|
||||
break;
|
||||
case 16:
|
||||
AGB_ASSERT(cmd->flag == FALSE);
|
||||
mevent_srv_common_init_send(svr, 0x18, mevent_first_if_not_null_else_second(cmd->parameter, &svr->sendWord), 4);
|
||||
break;
|
||||
case 15:
|
||||
if (cmd->parameter == NULL)
|
||||
mevent_srv_common_init_send(svr, 0x19, svr->sendBuffer1, svr->sendBuffer1Size);
|
||||
else
|
||||
mevent_srv_common_init_send(svr, 0x19, cmd->parameter, cmd->flag);
|
||||
break;
|
||||
case 18:
|
||||
if (cmd->parameter == NULL)
|
||||
mevent_srv_common_init_send(svr, 0x10, svr->sendBuffer2, svr->sendBuffer2Size);
|
||||
else
|
||||
mevent_srv_common_init_send(svr, 0x10, cmd->parameter, cmd->flag);
|
||||
break;
|
||||
case 19:
|
||||
AGB_ASSERT(cmd->flag == FALSE);
|
||||
mevent_srv_common_init_send(svr, 0x1a, cmd->parameter, 188);
|
||||
break;
|
||||
case 20:
|
||||
mevent_srv_common_init_send(svr, 0x15, cmd->parameter, cmd->flag);
|
||||
break;
|
||||
case 17:
|
||||
mevent_srv_common_init_send(svr, 0x1c, cmd->parameter, cmd->flag);
|
||||
break;
|
||||
case 22:
|
||||
AGB_ASSERT(cmd->flag == FALSE);
|
||||
memcpy(svr->wonder_card, cmd->parameter, 332);
|
||||
break;
|
||||
case 23:
|
||||
AGB_ASSERT(cmd->flag == FALSE);
|
||||
memcpy(svr->wonder_news, cmd->parameter, 444);
|
||||
break;
|
||||
case 21:
|
||||
AGB_ASSERT(cmd->flag == FALSE);
|
||||
svr->sendWord = *(u32 *)cmd->parameter;
|
||||
break;
|
||||
case 24:
|
||||
svr->sendBuffer1 = cmd->parameter;
|
||||
svr->sendBuffer1Size = cmd->flag;
|
||||
break;
|
||||
case 25:
|
||||
svr->sendBuffer2 = cmd->parameter;
|
||||
svr->sendBuffer2Size = cmd->flag;
|
||||
break;
|
||||
case 26:
|
||||
AGB_ASSERT(cmd->flag == FALSE && cmd->parameter == NULL);
|
||||
memcpy(svr->wonder_card, GetSavedWonderCard(), 332);
|
||||
WonderCard_ResetInternalReceivedFlag(svr->wonder_card);
|
||||
break;
|
||||
case 27:
|
||||
AGB_ASSERT(cmd->flag == FALSE && cmd->parameter == NULL);
|
||||
memcpy(svr->wonder_news, GetSavedWonderNews(), 444);
|
||||
break;
|
||||
case 28:
|
||||
AGB_ASSERT(cmd->flag == FALSE && cmd->parameter == NULL);
|
||||
svr->sendBuffer1 = GetSavedRamScriptIfValid();
|
||||
break;
|
||||
case 29:
|
||||
mevent_srv_common_init_send(svr, 0x1b, cmd->parameter, cmd->flag);
|
||||
break;
|
||||
}
|
||||
|
||||
return 1;
|
||||
}
|
||||
|
||||
static u32 (*const func_tbl[])(struct mevent_srv_common *) = {
|
||||
common_mainseq_0,
|
||||
common_mainseq_1,
|
||||
common_mainseq_2,
|
||||
common_mainseq_3,
|
||||
common_mainseq_4
|
||||
};
|
||||
|
||||
static u32 mevent_srv_exec_common(struct mevent_srv_common * svr)
|
||||
{
|
||||
u32 response;
|
||||
AGB_ASSERT(svr->mainseqno < NELEMS(func_tbl));
|
||||
response = func_tbl[svr->mainseqno](svr);
|
||||
AGB_ASSERT(svr->mainseqno < NELEMS(func_tbl));
|
||||
return response;
|
||||
}
|
||||
@@ -0,0 +1,211 @@
|
||||
#include "global.h"
|
||||
#include "alloc.h"
|
||||
#include "decompress.h"
|
||||
#include "util.h"
|
||||
#include "link.h"
|
||||
#include "link_rfu.h"
|
||||
#include "overworld.h"
|
||||
#include "script.h"
|
||||
#include "battle_tower.h"
|
||||
#include "mystery_event_script.h"
|
||||
#include "mevent.h"
|
||||
#include "mevent_server_helpers.h"
|
||||
|
||||
static u32 mevent_receive_func(struct mevent_srv_sub *);
|
||||
static u32 mevent_send_func(struct mevent_srv_sub *);
|
||||
|
||||
u32 mevent_srv_sub_recv(struct mevent_srv_sub * svr)
|
||||
{
|
||||
return svr->recvFunc(svr);
|
||||
}
|
||||
|
||||
u32 mevent_srv_sub_send(struct mevent_srv_sub * svr)
|
||||
{
|
||||
return svr->sendFunc(svr);
|
||||
}
|
||||
|
||||
void mevent_srv_sub_init(struct mevent_srv_sub * svr, u32 sendPlayerNo, u32 recvPlayerNo)
|
||||
{
|
||||
svr->sendPlayerNo = sendPlayerNo;
|
||||
svr->recvPlayerNo = recvPlayerNo;
|
||||
svr->seqno = 0;
|
||||
svr->sendCRC = 0;
|
||||
svr->sendSize = 0;
|
||||
svr->sendCounter = 0;
|
||||
svr->recvCRC = 0;
|
||||
svr->recvSize = 0;
|
||||
svr->recvCounter = 0;
|
||||
svr->sendBfr = NULL;
|
||||
svr->recvBfr = NULL;
|
||||
svr->sendFunc = mevent_send_func;
|
||||
svr->recvFunc = mevent_receive_func;
|
||||
}
|
||||
|
||||
void mevent_srv_sub_init_send(struct mevent_srv_sub * svr, u32 ident, const void * src, u32 size)
|
||||
{
|
||||
svr->seqno = 0;
|
||||
svr->sendIdent = ident;
|
||||
svr->sendCounter = 0;
|
||||
svr->sendCRC = 0;
|
||||
if (size != 0)
|
||||
svr->sendSize = size;
|
||||
else
|
||||
svr->sendSize = ME_SEND_BUF_SIZE;
|
||||
svr->sendBfr = src;
|
||||
}
|
||||
|
||||
void mevent_srv_sub_init_recv(struct mevent_srv_sub * svr, u32 ident, void * dest)
|
||||
{
|
||||
svr->seqno = 0;
|
||||
svr->recvIdent = ident;
|
||||
svr->recvCounter = 0;
|
||||
svr->recvCRC = 0;
|
||||
svr->recvSize = 0;
|
||||
svr->recvBfr = dest;
|
||||
}
|
||||
|
||||
static void mevent_recv_block(u32 recv_idx, void * dest, size_t size)
|
||||
{
|
||||
memcpy(dest, gBlockRecvBuffer[recv_idx], size);
|
||||
}
|
||||
|
||||
static bool32 mevent_has_received(u32 recv_idx)
|
||||
{
|
||||
if ((GetBlockReceivedStatus() >> recv_idx) & 1)
|
||||
return TRUE;
|
||||
else
|
||||
return FALSE;
|
||||
}
|
||||
|
||||
static void mevent_reset_recv(u32 recv_idx)
|
||||
{
|
||||
ResetBlockReceivedFlag(recv_idx);
|
||||
}
|
||||
|
||||
static bool32 mevent_receive_func(struct mevent_srv_sub * svr)
|
||||
{
|
||||
struct send_recv_header header;
|
||||
|
||||
switch (svr->seqno)
|
||||
{
|
||||
case 0:
|
||||
if (mevent_has_received(svr->recvPlayerNo))
|
||||
{
|
||||
mevent_recv_block(svr->recvPlayerNo, &header, sizeof(header));
|
||||
svr->recvSize = header.size;
|
||||
svr->recvCRC = header.crc;
|
||||
if (svr->recvSize > ME_SEND_BUF_SIZE)
|
||||
{
|
||||
LinkRfu_FatalError();
|
||||
return FALSE;
|
||||
}
|
||||
else if (svr->recvIdent != header.ident)
|
||||
{
|
||||
LinkRfu_FatalError();
|
||||
return FALSE;
|
||||
}
|
||||
else
|
||||
{
|
||||
svr->recvCounter = 0;
|
||||
mevent_reset_recv(svr->recvPlayerNo);
|
||||
++svr->seqno;
|
||||
}
|
||||
}
|
||||
break;
|
||||
case 1:
|
||||
if (mevent_has_received(svr->recvPlayerNo))
|
||||
{
|
||||
size_t blocksiz = svr->recvCounter * 252;
|
||||
if (svr->recvSize - blocksiz <= 252)
|
||||
{
|
||||
mevent_recv_block(svr->recvPlayerNo, svr->recvBfr + blocksiz, svr->recvSize - blocksiz);
|
||||
++svr->recvCounter;
|
||||
++svr->seqno;
|
||||
}
|
||||
else
|
||||
{
|
||||
mevent_recv_block(svr->recvPlayerNo, svr->recvBfr + blocksiz, 252);
|
||||
++svr->recvCounter;
|
||||
}
|
||||
mevent_reset_recv(svr->recvPlayerNo);
|
||||
}
|
||||
break;
|
||||
case 2:
|
||||
if (CalcCRC16WithTable(svr->recvBfr, svr->recvSize) != svr->recvCRC)
|
||||
{
|
||||
LinkRfu_FatalError();
|
||||
return FALSE;
|
||||
}
|
||||
else
|
||||
{
|
||||
svr->seqno = 0;
|
||||
return TRUE;
|
||||
}
|
||||
break;
|
||||
|
||||
}
|
||||
|
||||
return FALSE;
|
||||
}
|
||||
|
||||
static bool32 mevent_send_func(struct mevent_srv_sub * svr)
|
||||
{
|
||||
struct send_recv_header header;
|
||||
|
||||
switch (svr->seqno)
|
||||
{
|
||||
case 0:
|
||||
if (IsLinkTaskFinished())
|
||||
{
|
||||
header.ident = svr->sendIdent;
|
||||
header.size = svr->sendSize;
|
||||
header.crc = CalcCRC16WithTable(svr->sendBfr, svr->sendSize);
|
||||
svr->sendCRC = header.crc;
|
||||
svr->sendCounter = 0;
|
||||
SendBlock(0, &header, sizeof(header));
|
||||
++svr->seqno;
|
||||
}
|
||||
break;
|
||||
case 1:
|
||||
if (IsLinkTaskFinished())
|
||||
{
|
||||
if (mevent_has_received(svr->sendPlayerNo))
|
||||
{
|
||||
size_t blocksiz;
|
||||
mevent_reset_recv(svr->sendPlayerNo);
|
||||
blocksiz = 252 * svr->sendCounter;
|
||||
if (svr->sendSize - blocksiz <= 252)
|
||||
{
|
||||
SendBlock(0, svr->sendBfr + blocksiz, svr->sendSize - blocksiz);
|
||||
++svr->sendCounter;
|
||||
++svr->seqno;
|
||||
}
|
||||
else
|
||||
{
|
||||
SendBlock(0, svr->sendBfr + blocksiz, 252);
|
||||
++svr->sendCounter;
|
||||
}
|
||||
}
|
||||
}
|
||||
break;
|
||||
case 2:
|
||||
if (IsLinkTaskFinished())
|
||||
{
|
||||
if (CalcCRC16WithTable(svr->sendBfr, svr->sendSize) != svr->sendCRC)
|
||||
LinkRfu_FatalError();
|
||||
else
|
||||
++svr->seqno;
|
||||
}
|
||||
break;
|
||||
case 3:
|
||||
if (mevent_has_received(svr->sendPlayerNo))
|
||||
{
|
||||
mevent_reset_recv(svr->sendPlayerNo);
|
||||
svr->seqno = 0;
|
||||
return TRUE;
|
||||
}
|
||||
break;
|
||||
}
|
||||
|
||||
return FALSE;
|
||||
}
|
||||
@@ -94,7 +94,7 @@ void CB2_InitMysteryEventMenu(void)
|
||||
|
||||
FillBgTilemapBufferRect_Palette0(0, 0, 0, 0, 0x1E, 0x14);
|
||||
LoadUserWindowBorderGfx(0, 1u, 0xD0u);
|
||||
sub_81978B0(0xE0);
|
||||
Menu_LoadStdPalAt(0xE0);
|
||||
SetGpuReg(REG_OFFSET_DISPCNT, DISPCNT_MODE_0 | DISPCNT_OBJ_1D_MAP | DISPCNT_BG0_ON);
|
||||
SetGpuReg(REG_OFFSET_BLDCNT, 0);
|
||||
CreateTask(Task_DestroySelf, 0);
|
||||
|
||||
+1703
File diff suppressed because it is too large
Load Diff
+16
-23
@@ -449,7 +449,7 @@ static u8 sub_80E3274(void)
|
||||
static bool8 MainState_BeginFadeIn(void)
|
||||
{
|
||||
sub_80E4CF8(3, gUnknown_08DD4544);
|
||||
gNamingScreenData->currentPage = 1;
|
||||
gNamingScreenData->currentPage = PAGE_UPPER;
|
||||
sub_80E4CF8(2, gUnknown_08DD46E0);
|
||||
sub_80E4CF8(1, gUnknown_08DD4620);
|
||||
sub_80E4DE4(gNamingScreenData->windows[1], 0);
|
||||
@@ -1856,7 +1856,7 @@ static const struct NamingScreenTemplate playerNamingScreenTemplate =
|
||||
.maxChars = 7,
|
||||
.iconFunction = 1,
|
||||
.addGenderIcon = 0,
|
||||
.initialPage = 1,
|
||||
.initialPage = PAGE_UPPER,
|
||||
.unused = 35,
|
||||
.title = gText_YourName,
|
||||
};
|
||||
@@ -1867,7 +1867,7 @@ static const struct NamingScreenTemplate pcBoxNamingTemplate =
|
||||
.maxChars = 8,
|
||||
.iconFunction = 2,
|
||||
.addGenderIcon = 0,
|
||||
.initialPage = 1,
|
||||
.initialPage = PAGE_UPPER,
|
||||
.unused = 19,
|
||||
.title = gText_BoxName,
|
||||
};
|
||||
@@ -1878,7 +1878,7 @@ static const struct NamingScreenTemplate monNamingScreenTemplate =
|
||||
.maxChars = 10,
|
||||
.iconFunction = 3,
|
||||
.addGenderIcon = 1,
|
||||
.initialPage = 1,
|
||||
.initialPage = PAGE_UPPER,
|
||||
.unused = 35,
|
||||
.title = gText_PkmnsNickname,
|
||||
};
|
||||
@@ -1889,7 +1889,7 @@ static const struct NamingScreenTemplate wandaWordsScreenTemplate =
|
||||
.maxChars = 15,
|
||||
.iconFunction = 4,
|
||||
.addGenderIcon = 0,
|
||||
.initialPage = 1,
|
||||
.initialPage = PAGE_UPPER,
|
||||
.unused = 11,
|
||||
.title = gText_TellHimTheWords,
|
||||
};
|
||||
@@ -1906,52 +1906,43 @@ static const struct NamingScreenTemplate *const sNamingScreenTemplates[] =
|
||||
const struct OamData gOamData_858BFEC =
|
||||
{
|
||||
.y = 0,
|
||||
.affineMode = 0,
|
||||
.objMode = 0,
|
||||
.mosaic = 0,
|
||||
.bpp = 0,
|
||||
.affineMode = ST_OAM_AFFINE_OFF,
|
||||
.objMode = ST_OAM_OBJ_NORMAL,
|
||||
.bpp = ST_OAM_4BPP,
|
||||
.shape = SPRITE_SHAPE(8x8),
|
||||
.x = 0,
|
||||
.matrixNum = 0,
|
||||
.size = SPRITE_SIZE(8x8),
|
||||
.tileNum = 0,
|
||||
.priority = 0,
|
||||
.paletteNum = 0,
|
||||
.affineParam = 0,
|
||||
};
|
||||
|
||||
const struct OamData gOamData_858BFF4 =
|
||||
{
|
||||
.y = 0,
|
||||
.affineMode = 0,
|
||||
.objMode = 0,
|
||||
.mosaic = 0,
|
||||
.bpp = 0,
|
||||
.affineMode = ST_OAM_AFFINE_OFF,
|
||||
.objMode = ST_OAM_OBJ_NORMAL,
|
||||
.bpp = ST_OAM_4BPP,
|
||||
.shape = SPRITE_SHAPE(16x16),
|
||||
.x = 0,
|
||||
.matrixNum = 0,
|
||||
.size = SPRITE_SIZE(16x16),
|
||||
.tileNum = 0,
|
||||
.priority = 0,
|
||||
.paletteNum = 0,
|
||||
.affineParam = 0,
|
||||
};
|
||||
|
||||
const struct OamData gOamData_858BFFC =
|
||||
{
|
||||
.y = 0,
|
||||
.affineMode = 0,
|
||||
.objMode = 0,
|
||||
.mosaic = 0,
|
||||
.bpp = 0,
|
||||
.affineMode = ST_OAM_AFFINE_OFF,
|
||||
.objMode = ST_OAM_OBJ_NORMAL,
|
||||
.bpp = ST_OAM_4BPP,
|
||||
.shape = SPRITE_SHAPE(32x16),
|
||||
.x = 0,
|
||||
.matrixNum = 0,
|
||||
.size = SPRITE_SIZE(32x16),
|
||||
.tileNum = 0,
|
||||
.priority = 0,
|
||||
.paletteNum = 0,
|
||||
.affineParam = 0,
|
||||
};
|
||||
|
||||
static const struct Subsprite gUnknown_0858C004[] =
|
||||
@@ -2203,3 +2194,5 @@ static const struct SpritePalette gUnknown_0858C230[] =
|
||||
{gNamingScreenMenu_Pal + 0x40, 0x0007},
|
||||
{NULL}
|
||||
};
|
||||
|
||||
|
||||
|
||||
+1
-2
@@ -43,9 +43,8 @@
|
||||
#include "field_specials.h"
|
||||
#include "berry_powder.h"
|
||||
#include "mevent.h"
|
||||
#include "union_room_chat.h"
|
||||
|
||||
|
||||
extern void copy_strings_to_sav1(void);
|
||||
extern void ResetPokeJumpResults(void);
|
||||
|
||||
extern const u8 EventScript_ResetAllMapFlags[];
|
||||
|
||||
+2
-2
@@ -2287,7 +2287,7 @@ static void SetKeyInterceptCallback(u16 (*func)(u32))
|
||||
static void CheckRfuKeepAliveTimer(void)
|
||||
{
|
||||
if (gWirelessCommType != 0 && ++sRfuKeepAliveTimer > 60)
|
||||
sub_8010198();
|
||||
LinkRfu_FatalError();
|
||||
}
|
||||
|
||||
static void ResetAllTradingStates(void)
|
||||
@@ -2960,7 +2960,7 @@ static void InitLinkPlayerEventObjectPos(struct EventObject *eventObj, s16 x, s1
|
||||
eventObj->currentCoords.y = y;
|
||||
eventObj->previousCoords.x = x;
|
||||
eventObj->previousCoords.y = y;
|
||||
sub_8093038(x, y, &eventObj->initialCoords.x, &eventObj->initialCoords.y);
|
||||
SetSpritePosToMapCoords(x, y, &eventObj->initialCoords.x, &eventObj->initialCoords.y);
|
||||
eventObj->initialCoords.x += 8;
|
||||
EventObjectUpdateZCoord(eventObj);
|
||||
}
|
||||
|
||||
+1
-1
@@ -49,7 +49,7 @@
|
||||
#include "pokemon_summary_screen.h"
|
||||
#include "region_map.h"
|
||||
#include "reshow_battle_screen.h"
|
||||
#include "rom_8011DC0.h"
|
||||
#include "union_room.h"
|
||||
#include "scanline_effect.h"
|
||||
#include "script.h"
|
||||
#include "sound.h"
|
||||
|
||||
+168
-58
@@ -23,6 +23,19 @@
|
||||
#include "constants/species.h"
|
||||
#include "constants/vars.h"
|
||||
|
||||
#define AREA_SCREEN_WIDTH 32
|
||||
#define AREA_SCREEN_HEIGHT 20
|
||||
|
||||
#define GLOW_TILE_FULL 0xFFFF
|
||||
#define GLOW_TILE_LEFT (1 << 0)
|
||||
#define GLOW_TILE_RIGHT (1 << 1)
|
||||
#define GLOW_TILE_TOP (1 << 2)
|
||||
#define GLOW_TILE_BOTTOM (1 << 3)
|
||||
#define GLOW_TILE_BOTTOM_RIGHT (1 << 4)
|
||||
#define GLOW_TILE_TOP_RIGHT (1 << 5)
|
||||
#define GLOW_TILE_BOTTOM_LEFT (1 << 6)
|
||||
#define GLOW_TILE_TOP_LEFT (1 << 7)
|
||||
|
||||
struct PokeDexAreaScreenMapIdentity
|
||||
{
|
||||
u8 mapGroup;
|
||||
@@ -107,24 +120,114 @@ static const u16 sLandmarkData[][2] =
|
||||
{MAPSEC_NONE}
|
||||
};
|
||||
|
||||
static const u8 sAreaGlowTilemapMapping[] =
|
||||
{
|
||||
0x00, 0x01, 0x02, 0x03, 0x04, 0x05, 0x06, 0x07, 0x08, 0x09, 0x0a, 0x0b, 0x0c, 0x0d, 0x0e, 0x0f,
|
||||
0x11, 0x20, 0x02, 0x03, 0x27, 0x2d, 0x06, 0x07, 0x08, 0x09, 0x0a, 0x0b, 0x0c, 0x0d, 0x0e, 0x0f,
|
||||
0x12, 0x21, 0x02, 0x03, 0x04, 0x05, 0x06, 0x07, 0x2a, 0x2e, 0x0a, 0x0b, 0x0c, 0x0d, 0x0e, 0x0f,
|
||||
0x13, 0x22, 0x02, 0x03, 0x27, 0x2d, 0x06, 0x07, 0x2a, 0x2e, 0x0a, 0x0b, 0x0c, 0x0d, 0x0e, 0x0f,
|
||||
0x14, 0x01, 0x23, 0x03, 0x26, 0x05, 0x2c, 0x07, 0x08, 0x09, 0x0a, 0x0b, 0x0c, 0x0d, 0x0e, 0x0f,
|
||||
0x15, 0x20, 0x23, 0x03, 0x28, 0x2d, 0x2c, 0x07, 0x08, 0x09, 0x0a, 0x0b, 0x0c, 0x0d, 0x0e, 0x0f,
|
||||
0x16, 0x21, 0x23, 0x03, 0x26, 0x05, 0x2c, 0x07, 0x2a, 0x2e, 0x0a, 0x0b, 0x0c, 0x0d, 0x0e, 0x0f,
|
||||
0x17, 0x22, 0x23, 0x03, 0x28, 0x2d, 0x2c, 0x07, 0x2a, 0x2e, 0x0a, 0x0b, 0x0c, 0x0d, 0x0e, 0x0f,
|
||||
0x18, 0x01, 0x24, 0x03, 0x04, 0x05, 0x06, 0x07, 0x29, 0x09, 0x2f, 0x0b, 0x0c, 0x0d, 0x0e, 0x0f,
|
||||
0x19, 0x20, 0x24, 0x03, 0x27, 0x2d, 0x06, 0x07, 0x29, 0x09, 0x2f, 0x0b, 0x0c, 0x0d, 0x0e, 0x0f,
|
||||
0x1a, 0x21, 0x24, 0x03, 0x04, 0x05, 0x06, 0x07, 0x2b, 0x2e, 0x2f, 0x0b, 0x0c, 0x0d, 0x0e, 0x0f,
|
||||
0x1b, 0x22, 0x24, 0x03, 0x27, 0x2d, 0x06, 0x07, 0x2b, 0x2e, 0x2f, 0x0b, 0x0c, 0x0d, 0x0e, 0x0f,
|
||||
0x1c, 0x01, 0x25, 0x03, 0x26, 0x05, 0x2c, 0x07, 0x29, 0x09, 0x2f, 0x0b, 0x0c, 0x0d, 0x0e, 0x0f,
|
||||
0x1d, 0x20, 0x25, 0x03, 0x28, 0x2d, 0x2c, 0x07, 0x29, 0x09, 0x2f, 0x0b, 0x0c, 0x0d, 0x0e, 0x0f,
|
||||
0x1e, 0x21, 0x25, 0x03, 0x26, 0x05, 0x2c, 0x07, 0x2b, 0x2e, 0x2f, 0x0b, 0x0c, 0x0d, 0x0e, 0x0f,
|
||||
0x1f, 0x22, 0x25, 0x03, 0x28, 0x2d, 0x2c, 0x07, 0x2b, 0x2e, 0x2f, 0x0b, 0x0c, 0x0d, 0x0e, 0x0f,
|
||||
// Only some parts of this array are acutally used, because corner flags that overlap
|
||||
// with edge flags are cancelled out before lookup. For example, GLOW_TILE_BOTTOM_RIGHT | GLOW_TILE_RIGHT
|
||||
// will never be read.
|
||||
//
|
||||
// The rest of the bytes seem to be old data from before the cancellation was implemented.
|
||||
// Most of them line up as you would expect ([BOTTOM_RIGHT | RIGHT] has the same value as [RIGHT]).
|
||||
//
|
||||
// Any unreachable entries are simply listed in order, without the fancy "[FLAGS] = 0xXX" notation.
|
||||
static const u8 sAreaGlowTilemapMapping[] = {
|
||||
[0] = 0x00,
|
||||
[GLOW_TILE_LEFT] = 0x01,
|
||||
[GLOW_TILE_RIGHT] = 0x02,
|
||||
[GLOW_TILE_RIGHT | GLOW_TILE_LEFT] = 0x03,
|
||||
[GLOW_TILE_TOP] = 0x04,
|
||||
[GLOW_TILE_TOP | GLOW_TILE_LEFT] = 0x05,
|
||||
[GLOW_TILE_TOP | GLOW_TILE_RIGHT] = 0x06,
|
||||
[GLOW_TILE_TOP | GLOW_TILE_RIGHT | GLOW_TILE_LEFT] = 0x07,
|
||||
[GLOW_TILE_BOTTOM] = 0x08,
|
||||
[GLOW_TILE_BOTTOM | GLOW_TILE_LEFT] = 0x09,
|
||||
[GLOW_TILE_BOTTOM | GLOW_TILE_RIGHT] = 0x0a,
|
||||
[GLOW_TILE_BOTTOM | GLOW_TILE_RIGHT | GLOW_TILE_LEFT] = 0x0b,
|
||||
[GLOW_TILE_BOTTOM | GLOW_TILE_TOP] = 0x0c,
|
||||
[GLOW_TILE_BOTTOM | GLOW_TILE_TOP | GLOW_TILE_LEFT] = 0x0d,
|
||||
[GLOW_TILE_BOTTOM | GLOW_TILE_TOP | GLOW_TILE_RIGHT] = 0x0e,
|
||||
[GLOW_TILE_BOTTOM | GLOW_TILE_TOP | GLOW_TILE_RIGHT | GLOW_TILE_LEFT] = 0x0f,
|
||||
[GLOW_TILE_BOTTOM_RIGHT] = 0x11,
|
||||
[GLOW_TILE_BOTTOM_RIGHT | GLOW_TILE_LEFT] = 0x20,
|
||||
0x02, 0x03,
|
||||
[GLOW_TILE_BOTTOM_RIGHT | GLOW_TILE_TOP] = 0x27,
|
||||
[GLOW_TILE_BOTTOM_RIGHT | GLOW_TILE_TOP | GLOW_TILE_LEFT] = 0x2d,
|
||||
0x06, 0x07, 0x08, 0x09, 0x0a,
|
||||
0x0b, 0x0c, 0x0d, 0x0e, 0x0f,
|
||||
[GLOW_TILE_TOP_RIGHT] = 0x12,
|
||||
[GLOW_TILE_TOP_RIGHT | GLOW_TILE_LEFT] = 0x21,
|
||||
0x02, 0x03, 0x04, 0x05, 0x06,
|
||||
0x07,
|
||||
[GLOW_TILE_TOP_RIGHT | GLOW_TILE_BOTTOM] = 0x2a,
|
||||
[GLOW_TILE_TOP_RIGHT | GLOW_TILE_BOTTOM | GLOW_TILE_LEFT] = 0x2e,
|
||||
0x0a, 0x0b, 0x0c, 0x0d, 0x0e,
|
||||
0x0f,
|
||||
[GLOW_TILE_TOP_RIGHT | GLOW_TILE_BOTTOM_RIGHT] = 0x13,
|
||||
[GLOW_TILE_TOP_RIGHT | GLOW_TILE_BOTTOM_RIGHT | GLOW_TILE_LEFT] = 0x22,
|
||||
0x02, 0x03, 0x27, 0x2d, 0x06,
|
||||
0x07, 0x2a, 0x2e, 0x0a, 0x0b,
|
||||
0x0c, 0x0d, 0x0e, 0x0f,
|
||||
[GLOW_TILE_BOTTOM_LEFT] = 0x14,
|
||||
0x01,
|
||||
[GLOW_TILE_BOTTOM_LEFT | GLOW_TILE_RIGHT] = 0x23,
|
||||
0x03,
|
||||
[GLOW_TILE_BOTTOM_LEFT | GLOW_TILE_TOP] = 0x26,
|
||||
0x05,
|
||||
[GLOW_TILE_BOTTOM_LEFT | GLOW_TILE_TOP | GLOW_TILE_RIGHT] = 0x2c,
|
||||
0x07, 0x08, 0x09, 0x0a, 0x0b,
|
||||
0x0c, 0x0d, 0x0e, 0x0f,
|
||||
[GLOW_TILE_BOTTOM_LEFT | GLOW_TILE_BOTTOM_RIGHT] = 0x15,
|
||||
0x20, 0x23, 0x03,
|
||||
[GLOW_TILE_BOTTOM_LEFT | GLOW_TILE_BOTTOM_RIGHT | GLOW_TILE_TOP] = 0x28,
|
||||
0x2d, 0x2c, 0x07, 0x08, 0x09,
|
||||
0x0a, 0x0b, 0x0c, 0x0d, 0x0e,
|
||||
0x0f,
|
||||
[GLOW_TILE_BOTTOM_LEFT | GLOW_TILE_TOP_RIGHT] = 0x16,
|
||||
0x21, 0x23, 0x03, 0x26, 0x05,
|
||||
0x2c, 0x07, 0x2a, 0x2e, 0x0a,
|
||||
0x0b, 0x0c, 0x0d, 0x0e, 0x0f,
|
||||
[GLOW_TILE_BOTTOM_LEFT | GLOW_TILE_TOP_RIGHT | GLOW_TILE_BOTTOM_RIGHT] = 0x17,
|
||||
0x22, 0x23, 0x03, 0x28, 0x2d,
|
||||
0x2c, 0x07, 0x2a, 0x2e, 0x0a,
|
||||
0x0b, 0x0c, 0x0d, 0x0e, 0x0f,
|
||||
[GLOW_TILE_TOP_LEFT] = 0x18,
|
||||
0x01,
|
||||
[GLOW_TILE_TOP_LEFT | GLOW_TILE_RIGHT] = 0x24,
|
||||
0x03, 0x04, 0x05, 0x06, 0x07,
|
||||
[GLOW_TILE_TOP_LEFT | GLOW_TILE_BOTTOM] = 0x29,
|
||||
0x09,
|
||||
[GLOW_TILE_TOP_LEFT | GLOW_TILE_BOTTOM | GLOW_TILE_RIGHT] = 0x2f,
|
||||
0x0b, 0x0c, 0x0d, 0x0e, 0x0f,
|
||||
[GLOW_TILE_TOP_LEFT | GLOW_TILE_BOTTOM_RIGHT] = 0x19,
|
||||
0x20, 0x24, 0x03, 0x27, 0x2d,
|
||||
0x06, 0x07, 0x29, 0x09, 0x2f,
|
||||
0x0b, 0x0c, 0x0d, 0x0e, 0x0f,
|
||||
[GLOW_TILE_TOP_LEFT | GLOW_TILE_TOP_RIGHT] = 0x1a,
|
||||
0x21, 0x24, 0x03, 0x04, 0x05,
|
||||
0x06, 0x07,
|
||||
[GLOW_TILE_TOP_LEFT | GLOW_TILE_TOP_RIGHT | GLOW_TILE_BOTTOM] = 0x2b,
|
||||
0x2e, 0x2f, 0x0b, 0x0c, 0x0d,
|
||||
0x0e, 0x0f,
|
||||
[GLOW_TILE_TOP_LEFT | GLOW_TILE_TOP_RIGHT | GLOW_TILE_BOTTOM_RIGHT] = 0x1b,
|
||||
0x22, 0x24, 0x03, 0x27, 0x2d,
|
||||
0x06, 0x07, 0x2b, 0x2e, 0x2f,
|
||||
0x0b, 0x0c, 0x0d, 0x0e, 0x0f,
|
||||
[GLOW_TILE_TOP_LEFT | GLOW_TILE_BOTTOM_LEFT] = 0x1c,
|
||||
0x01,
|
||||
[GLOW_TILE_TOP_LEFT | GLOW_TILE_BOTTOM_LEFT | GLOW_TILE_RIGHT] = 0x25,
|
||||
0x03, 0x26, 0x05, 0x2c, 0x07,
|
||||
0x29, 0x09, 0x2f, 0x0b, 0x0c,
|
||||
0x0d, 0x0e, 0x0f,
|
||||
[GLOW_TILE_TOP_LEFT | GLOW_TILE_BOTTOM_LEFT | GLOW_TILE_BOTTOM_RIGHT] = 0x1d,
|
||||
0x20, 0x25, 0x03, 0x28, 0x2d,
|
||||
0x2c, 0x07, 0x29, 0x09, 0x2f,
|
||||
0x0b, 0x0c, 0x0d, 0x0e, 0x0f,
|
||||
[GLOW_TILE_TOP_LEFT | GLOW_TILE_BOTTOM_LEFT | GLOW_TILE_TOP_RIGHT] = 0x1e,
|
||||
0x21, 0x25, 0x03, 0x26, 0x05,
|
||||
0x2c, 0x07, 0x2b, 0x2e, 0x2f,
|
||||
0x0b, 0x0c, 0x0d, 0x0e, 0x0f,
|
||||
[GLOW_TILE_TOP_LEFT | GLOW_TILE_BOTTOM_LEFT | GLOW_TILE_TOP_RIGHT | GLOW_TILE_BOTTOM_RIGHT] = 0x1f,
|
||||
0x22, 0x25, 0x03, 0x28, 0x2d,
|
||||
0x2c, 0x07, 0x2b, 0x2e, 0x2f,
|
||||
0x0b, 0x0c, 0x0d, 0x0e, 0x0f,
|
||||
};
|
||||
|
||||
static const struct UnkStruct_1C4D70 sUnknown_085B4018 =
|
||||
@@ -255,11 +358,11 @@ static void FindMapsWithMon(u16 species)
|
||||
{
|
||||
switch (sFeebasData[i][1])
|
||||
{
|
||||
case MAP_GROUP(PETALBURG_CITY):
|
||||
case MAP_GROUP_OVERWORLD_MONS:
|
||||
SetAreaHasMon(sFeebasData[i][1], sFeebasData[i][2]);
|
||||
break;
|
||||
case MAP_GROUP(METEOR_FALLS_1F_1R):
|
||||
case MAP_GROUP(SAFARI_ZONE_NORTHWEST):
|
||||
case MAP_GROUP_SPECIAL_MONS_1:
|
||||
case MAP_GROUP_SPECIAL_MONS_2:
|
||||
SetSpecialMapHasMon(sFeebasData[i][1], sFeebasData[i][2]);
|
||||
break;
|
||||
}
|
||||
@@ -268,15 +371,15 @@ static void FindMapsWithMon(u16 species)
|
||||
|
||||
for (i = 0; gWildMonHeaders[i].mapGroup != 0xFF; i++)
|
||||
{
|
||||
if (MapHasMon(gWildMonHeaders + i, species))
|
||||
if (MapHasMon(&gWildMonHeaders[i], species))
|
||||
{
|
||||
switch (gWildMonHeaders[i].mapGroup)
|
||||
{
|
||||
case MAP_GROUP(PETALBURG_CITY):
|
||||
case MAP_GROUP_OVERWORLD_MONS:
|
||||
SetAreaHasMon(gWildMonHeaders[i].mapGroup, gWildMonHeaders[i].mapNum);
|
||||
break;
|
||||
case MAP_GROUP(METEOR_FALLS_1F_1R):
|
||||
case MAP_GROUP(SAFARI_ZONE_NORTHWEST):
|
||||
case MAP_GROUP_SPECIAL_MONS_1:
|
||||
case MAP_GROUP_SPECIAL_MONS_2:
|
||||
SetSpecialMapHasMon(gWildMonHeaders[i].mapGroup, gWildMonHeaders[i].mapNum);
|
||||
break;
|
||||
}
|
||||
@@ -390,18 +493,18 @@ static void BuildAreaGlowTilemap(void)
|
||||
u16 i, y, x, j;
|
||||
u16 val;
|
||||
|
||||
for (i = 0; i < 0x280; i++)
|
||||
for (i = 0; i < ARRAY_COUNT(sPokedexAreaScreen->areaGlowTilemap); i++)
|
||||
sPokedexAreaScreen->areaGlowTilemap[i] = 0;
|
||||
|
||||
for (i = 0; i < sPokedexAreaScreen->numOverworldAreas; i++)
|
||||
{
|
||||
j = 0;
|
||||
for (y = 0; y < 20; y++)
|
||||
for (y = 0; y < AREA_SCREEN_HEIGHT; y++)
|
||||
{
|
||||
for (x = 0; x < 32; x++)
|
||||
for (x = 0; x < AREA_SCREEN_WIDTH; x++)
|
||||
{
|
||||
if (GetRegionMapSectionIdAt(x, y) == sPokedexAreaScreen->overworldAreasWithMons[i].regionMapSectionId)
|
||||
sPokedexAreaScreen->areaGlowTilemap[j] = 0xFFFF;
|
||||
sPokedexAreaScreen->areaGlowTilemap[j] = GLOW_TILE_FULL;
|
||||
|
||||
j++;
|
||||
}
|
||||
@@ -409,51 +512,58 @@ static void BuildAreaGlowTilemap(void)
|
||||
}
|
||||
|
||||
j = 0;
|
||||
for (y = 0; y < 20; y++)
|
||||
for (y = 0; y < AREA_SCREEN_HEIGHT; y++)
|
||||
{
|
||||
for (x = 0; x < 32; x++)
|
||||
for (x = 0; x < AREA_SCREEN_WIDTH; x++)
|
||||
{
|
||||
if (sPokedexAreaScreen->areaGlowTilemap[j] == 0xFFFF)
|
||||
if (sPokedexAreaScreen->areaGlowTilemap[j] == GLOW_TILE_FULL)
|
||||
{
|
||||
if (x != 0 && sPokedexAreaScreen->areaGlowTilemap[j - 1] != 0xFFFF)
|
||||
sPokedexAreaScreen->areaGlowTilemap[j - 1] |= 0x02;
|
||||
if (x != 31 && sPokedexAreaScreen->areaGlowTilemap[j + 1] != 0xFFFF)
|
||||
sPokedexAreaScreen->areaGlowTilemap[j + 1] |= 0x01;
|
||||
if (y != 0 && sPokedexAreaScreen->areaGlowTilemap[j - 32] != 0xFFFF)
|
||||
sPokedexAreaScreen->areaGlowTilemap[j - 32] |= 0x08;
|
||||
if (y != 19 && sPokedexAreaScreen->areaGlowTilemap[j + 32] != 0xFFFF)
|
||||
sPokedexAreaScreen->areaGlowTilemap[j + 32] |= 0x04;
|
||||
if (x != 0 && y != 0 && sPokedexAreaScreen->areaGlowTilemap[j - 33] != 0xFFFF)
|
||||
sPokedexAreaScreen->areaGlowTilemap[j - 33] |= 0x10;
|
||||
if (x != 31 && y != 0 && sPokedexAreaScreen->areaGlowTilemap[j - 31] != 0xFFFF)
|
||||
sPokedexAreaScreen->areaGlowTilemap[j - 31] |= 0x40;
|
||||
if (x != 0 && y != 19 && sPokedexAreaScreen->areaGlowTilemap[j + 31] != 0xFFFF)
|
||||
sPokedexAreaScreen->areaGlowTilemap[j + 31] |= 0x20;
|
||||
if (x != 31 && y != 19 && sPokedexAreaScreen->areaGlowTilemap[j + 33] != 0xFFFF)
|
||||
sPokedexAreaScreen->areaGlowTilemap[j + 33] |= 0x80;
|
||||
// The "tile != GLOW_TILE_FULL" check is pointless in all of these conditionals,
|
||||
// since there's no harm in OR'ing 0xFFFF with anything else.
|
||||
|
||||
// Edges
|
||||
if (x != 0 && sPokedexAreaScreen->areaGlowTilemap[j - 1] != GLOW_TILE_FULL)
|
||||
sPokedexAreaScreen->areaGlowTilemap[j - 1] |= GLOW_TILE_RIGHT;
|
||||
if (x != AREA_SCREEN_WIDTH - 1 && sPokedexAreaScreen->areaGlowTilemap[j + 1] != GLOW_TILE_FULL)
|
||||
sPokedexAreaScreen->areaGlowTilemap[j + 1] |= GLOW_TILE_LEFT;
|
||||
if (y != 0 && sPokedexAreaScreen->areaGlowTilemap[j - AREA_SCREEN_WIDTH] != GLOW_TILE_FULL)
|
||||
sPokedexAreaScreen->areaGlowTilemap[j - AREA_SCREEN_WIDTH] |= GLOW_TILE_BOTTOM;
|
||||
if (y != AREA_SCREEN_HEIGHT - 1 && sPokedexAreaScreen->areaGlowTilemap[j + AREA_SCREEN_WIDTH] != GLOW_TILE_FULL)
|
||||
sPokedexAreaScreen->areaGlowTilemap[j + AREA_SCREEN_WIDTH] |= GLOW_TILE_TOP;
|
||||
|
||||
// Diagonals
|
||||
if (x != 0 && y != 0 && sPokedexAreaScreen->areaGlowTilemap[j - AREA_SCREEN_WIDTH - 1] != GLOW_TILE_FULL)
|
||||
sPokedexAreaScreen->areaGlowTilemap[j - AREA_SCREEN_WIDTH - 1] |= GLOW_TILE_BOTTOM_RIGHT;
|
||||
if (x != AREA_SCREEN_WIDTH - 1 && y != 0 && sPokedexAreaScreen->areaGlowTilemap[j - AREA_SCREEN_WIDTH + 1] != GLOW_TILE_FULL)
|
||||
sPokedexAreaScreen->areaGlowTilemap[j - AREA_SCREEN_WIDTH + 1] |= GLOW_TILE_BOTTOM_LEFT;
|
||||
if (x != 0 && y != AREA_SCREEN_HEIGHT - 1 && sPokedexAreaScreen->areaGlowTilemap[j + AREA_SCREEN_WIDTH - 1] != GLOW_TILE_FULL)
|
||||
sPokedexAreaScreen->areaGlowTilemap[j + AREA_SCREEN_WIDTH - 1] |= GLOW_TILE_TOP_RIGHT;
|
||||
if (x != AREA_SCREEN_WIDTH - 1 && y != AREA_SCREEN_HEIGHT - 1 && sPokedexAreaScreen->areaGlowTilemap[j + AREA_SCREEN_WIDTH + 1] != GLOW_TILE_FULL)
|
||||
sPokedexAreaScreen->areaGlowTilemap[j + AREA_SCREEN_WIDTH + 1] |= GLOW_TILE_TOP_LEFT;
|
||||
}
|
||||
|
||||
j++;
|
||||
}
|
||||
}
|
||||
|
||||
for (i = 0; i < 0x280; i++)
|
||||
for (i = 0; i < ARRAY_COUNT(sPokedexAreaScreen->areaGlowTilemap); i++)
|
||||
{
|
||||
if (sPokedexAreaScreen->areaGlowTilemap[i] == 0xFFFF)
|
||||
if (sPokedexAreaScreen->areaGlowTilemap[i] == GLOW_TILE_FULL)
|
||||
{
|
||||
sPokedexAreaScreen->areaGlowTilemap[i] = 0x10;
|
||||
sPokedexAreaScreen->areaGlowTilemap[i] |= 0xA000;
|
||||
}
|
||||
else if (sPokedexAreaScreen->areaGlowTilemap[i])
|
||||
{
|
||||
if (sPokedexAreaScreen->areaGlowTilemap[i] & 0x02)
|
||||
sPokedexAreaScreen->areaGlowTilemap[i] &= 0xFFCF;
|
||||
if (sPokedexAreaScreen->areaGlowTilemap[i] & 0x01)
|
||||
sPokedexAreaScreen->areaGlowTilemap[i] &= 0xFF3F;
|
||||
if (sPokedexAreaScreen->areaGlowTilemap[i] & 0x08)
|
||||
sPokedexAreaScreen->areaGlowTilemap[i] &= 0xFFAF;
|
||||
if (sPokedexAreaScreen->areaGlowTilemap[i] & 0x04)
|
||||
sPokedexAreaScreen->areaGlowTilemap[i] &= 0xFF5F;
|
||||
// Get rid of overlapping flags
|
||||
if (sPokedexAreaScreen->areaGlowTilemap[i] & GLOW_TILE_RIGHT)
|
||||
sPokedexAreaScreen->areaGlowTilemap[i] &= ~(GLOW_TILE_BOTTOM_RIGHT | GLOW_TILE_TOP_RIGHT);
|
||||
if (sPokedexAreaScreen->areaGlowTilemap[i] & GLOW_TILE_LEFT)
|
||||
sPokedexAreaScreen->areaGlowTilemap[i] &= ~(GLOW_TILE_BOTTOM_LEFT | GLOW_TILE_TOP_LEFT);
|
||||
if (sPokedexAreaScreen->areaGlowTilemap[i] & GLOW_TILE_BOTTOM)
|
||||
sPokedexAreaScreen->areaGlowTilemap[i] &= ~(GLOW_TILE_BOTTOM_LEFT | GLOW_TILE_BOTTOM_RIGHT);
|
||||
if (sPokedexAreaScreen->areaGlowTilemap[i] & GLOW_TILE_TOP)
|
||||
sPokedexAreaScreen->areaGlowTilemap[i] &= ~(GLOW_TILE_TOP_LEFT | GLOW_TILE_TOP_RIGHT);
|
||||
|
||||
sPokedexAreaScreen->areaGlowTilemap[i] = sAreaGlowTilemapMapping[sPokedexAreaScreen->areaGlowTilemap[i]];
|
||||
sPokedexAreaScreen->areaGlowTilemap[i] |= 0xA000;
|
||||
|
||||
Executable → Regular
+7
-1
@@ -169,9 +169,14 @@ const struct OamData gOamData_85B8C60 =
|
||||
{
|
||||
.y = 160,
|
||||
.affineMode = ST_OAM_AFFINE_NORMAL,
|
||||
.objMode = ST_OAM_OBJ_NORMAL,
|
||||
.bpp = ST_OAM_4BPP,
|
||||
.shape = SPRITE_SHAPE(64x64),
|
||||
.x = 0,
|
||||
.size = SPRITE_SIZE(64x64),
|
||||
.priority = 1
|
||||
.tileNum = 0,
|
||||
.priority = 1,
|
||||
.paletteNum = 0,
|
||||
};
|
||||
|
||||
const struct SpriteTemplate gUnknown_085B8C68 =
|
||||
@@ -521,3 +526,4 @@ static void sub_8145B24(s8 a0)
|
||||
sCryVolumeMeter->unk1 = r2;
|
||||
sCryVolumeMeter->unk2 = 5;
|
||||
}
|
||||
|
||||
|
||||
+3
-358
@@ -2,6 +2,7 @@
|
||||
#include "alloc.h"
|
||||
#include "apprentice.h"
|
||||
#include "battle.h"
|
||||
#include "battle_anim.h"
|
||||
#include "battle_controllers.h"
|
||||
#include "battle_message.h"
|
||||
#include "battle_pike.h"
|
||||
@@ -1809,419 +1810,63 @@ static const u8 sMonFrontAnimIdsTable[] =
|
||||
[SPECIES_CHIMECHO - 1] = 0x1d,
|
||||
};
|
||||
|
||||
static const u8 sMonAnimationDelayTable[] =
|
||||
static const u8 sMonAnimationDelayTable[NUM_SPECIES - 1] =
|
||||
{
|
||||
[SPECIES_BULBASAUR - 1] = 0x00,
|
||||
[SPECIES_IVYSAUR - 1] = 0x00,
|
||||
[SPECIES_VENUSAUR - 1] = 0x00,
|
||||
[SPECIES_CHARMANDER - 1] = 0x00,
|
||||
[SPECIES_CHARMELEON - 1] = 0x00,
|
||||
[SPECIES_CHARIZARD - 1] = 0x00,
|
||||
[SPECIES_SQUIRTLE - 1] = 0x00,
|
||||
[SPECIES_WARTORTLE - 1] = 0x00,
|
||||
[SPECIES_BLASTOISE - 1] = 0x32,
|
||||
[SPECIES_CATERPIE - 1] = 0x00,
|
||||
[SPECIES_METAPOD - 1] = 0x00,
|
||||
[SPECIES_BUTTERFREE - 1] = 0x00,
|
||||
[SPECIES_WEEDLE - 1] = 0x0a,
|
||||
[SPECIES_KAKUNA - 1] = 0x14,
|
||||
[SPECIES_BEEDRILL - 1] = 0x23,
|
||||
[SPECIES_PIDGEY - 1] = 0x00,
|
||||
[SPECIES_PIDGEOTTO - 1] = 0x19,
|
||||
[SPECIES_PIDGEOT - 1] = 0x00,
|
||||
[SPECIES_RATTATA - 1] = 0x00,
|
||||
[SPECIES_RATICATE - 1] = 0x00,
|
||||
[SPECIES_SPEAROW - 1] = 0x00,
|
||||
[SPECIES_FEAROW - 1] = 0x02,
|
||||
[SPECIES_EKANS - 1] = 0x1e,
|
||||
[SPECIES_ARBOK - 1] = 0x00,
|
||||
[SPECIES_PIKACHU - 1] = 0x00,
|
||||
[SPECIES_RAICHU - 1] = 0x00,
|
||||
[SPECIES_SANDSHREW - 1] = 0x00,
|
||||
[SPECIES_SANDSLASH - 1] = 0x00,
|
||||
[SPECIES_NIDORAN_F - 1] = 0x1c,
|
||||
[SPECIES_NIDORINA - 1] = 0x00,
|
||||
[SPECIES_NIDOQUEEN - 1] = 0x00,
|
||||
[SPECIES_NIDORAN_M - 1] = 0x00,
|
||||
[SPECIES_NIDORINO - 1] = 0x00,
|
||||
[SPECIES_NIDOKING - 1] = 0x19,
|
||||
[SPECIES_CLEFAIRY - 1] = 0x00,
|
||||
[SPECIES_CLEFABLE - 1] = 0x00,
|
||||
[SPECIES_VULPIX - 1] = 0x00,
|
||||
[SPECIES_NINETALES - 1] = 0x00,
|
||||
[SPECIES_JIGGLYPUFF - 1] = 0x00,
|
||||
[SPECIES_WIGGLYTUFF - 1] = 0x00,
|
||||
[SPECIES_ZUBAT - 1] = 0x00,
|
||||
[SPECIES_GOLBAT - 1] = 0x00,
|
||||
[SPECIES_ODDISH - 1] = 0x00,
|
||||
[SPECIES_GLOOM - 1] = 0x00,
|
||||
[SPECIES_VILEPLUME - 1] = 0x00,
|
||||
[SPECIES_PARAS - 1] = 0x0a,
|
||||
[SPECIES_PARASECT - 1] = 0x2d,
|
||||
[SPECIES_VENONAT - 1] = 0x14,
|
||||
[SPECIES_VENOMOTH - 1] = 0x00,
|
||||
[SPECIES_DIGLETT - 1] = 0x19,
|
||||
[SPECIES_DUGTRIO - 1] = 0x23,
|
||||
[SPECIES_MEOWTH - 1] = 0x28,
|
||||
[SPECIES_PERSIAN - 1] = 0x14,
|
||||
[SPECIES_PSYDUCK - 1] = 0x00,
|
||||
[SPECIES_GOLDUCK - 1] = 0x00,
|
||||
[SPECIES_MANKEY - 1] = 0x14,
|
||||
[SPECIES_PRIMEAPE - 1] = 0x00,
|
||||
[SPECIES_GROWLITHE - 1] = 0x1e,
|
||||
[SPECIES_ARCANINE - 1] = 0x28,
|
||||
[SPECIES_POLIWAG - 1] = 0x00,
|
||||
[SPECIES_POLIWHIRL - 1] = 0x05,
|
||||
[SPECIES_POLIWRATH - 1] = 0x00,
|
||||
[SPECIES_ABRA - 1] = 0x00,
|
||||
[SPECIES_KADABRA - 1] = 0x00,
|
||||
[SPECIES_ALAKAZAM - 1] = 0x00,
|
||||
[SPECIES_MACHOP - 1] = 0x00,
|
||||
[SPECIES_MACHOKE - 1] = 0x00,
|
||||
[SPECIES_MACHAMP - 1] = 0x00,
|
||||
[SPECIES_BELLSPROUT - 1] = 0x00,
|
||||
[SPECIES_WEEPINBELL - 1] = 0x03,
|
||||
[SPECIES_VICTREEBEL - 1] = 0x00,
|
||||
[SPECIES_TENTACOOL - 1] = 0x00,
|
||||
[SPECIES_TENTACRUEL - 1] = 0x00,
|
||||
[SPECIES_GEODUDE - 1] = 0x00,
|
||||
[SPECIES_GRAVELER - 1] = 0x00,
|
||||
[SPECIES_GOLEM - 1] = 0x00,
|
||||
[SPECIES_PONYTA - 1] = 0x00,
|
||||
[SPECIES_RAPIDASH - 1] = 0x00,
|
||||
[SPECIES_SLOWPOKE - 1] = 0x00,
|
||||
[SPECIES_SLOWBRO - 1] = 0x00,
|
||||
[SPECIES_MAGNEMITE - 1] = 0x00,
|
||||
[SPECIES_MAGNETON - 1] = 0x00,
|
||||
[SPECIES_FARFETCHD - 1] = 0x00,
|
||||
[SPECIES_DODUO - 1] = 0x00,
|
||||
[SPECIES_DODRIO - 1] = 0x00,
|
||||
[SPECIES_SEEL - 1] = 0x00,
|
||||
[SPECIES_DEWGONG - 1] = 0x00,
|
||||
[SPECIES_GRIMER - 1] = 0x00,
|
||||
[SPECIES_MUK - 1] = 0x2d,
|
||||
[SPECIES_SHELLDER - 1] = 0x14,
|
||||
[SPECIES_CLOYSTER - 1] = 0x00,
|
||||
[SPECIES_GASTLY - 1] = 0x00,
|
||||
[SPECIES_HAUNTER - 1] = 0x17,
|
||||
[SPECIES_GENGAR - 1] = 0x00,
|
||||
[SPECIES_ONIX - 1] = 0x00,
|
||||
[SPECIES_DROWZEE - 1] = 0x30,
|
||||
[SPECIES_HYPNO - 1] = 0x28,
|
||||
[SPECIES_KRABBY - 1] = 0x00,
|
||||
[SPECIES_KINGLER - 1] = 0x00,
|
||||
[SPECIES_VOLTORB - 1] = 0x00,
|
||||
[SPECIES_ELECTRODE - 1] = 0x00,
|
||||
[SPECIES_EXEGGCUTE - 1] = 0x00,
|
||||
[SPECIES_EXEGGUTOR - 1] = 0x00,
|
||||
[SPECIES_CUBONE - 1] = 0x00,
|
||||
[SPECIES_MAROWAK - 1] = 0x00,
|
||||
[SPECIES_HITMONLEE - 1] = 0x00,
|
||||
[SPECIES_HITMONCHAN - 1] = 0x19,
|
||||
[SPECIES_LICKITUNG - 1] = 0x00,
|
||||
[SPECIES_KOFFING - 1] = 0x00,
|
||||
[SPECIES_WEEZING - 1] = 0x00,
|
||||
[SPECIES_RHYHORN - 1] = 0x00,
|
||||
[SPECIES_RHYDON - 1] = 0x00,
|
||||
[SPECIES_CHANSEY - 1] = 0x00,
|
||||
[SPECIES_TANGELA - 1] = 0x00,
|
||||
[SPECIES_KANGASKHAN - 1] = 0x00,
|
||||
[SPECIES_HORSEA - 1] = 0x00,
|
||||
[SPECIES_SEADRA - 1] = 0x00,
|
||||
[SPECIES_GOLDEEN - 1] = 0x00,
|
||||
[SPECIES_SEAKING - 1] = 0x00,
|
||||
[SPECIES_STARYU - 1] = 0x00,
|
||||
[SPECIES_STARMIE - 1] = 0x00,
|
||||
[SPECIES_MR_MIME - 1] = 0x00,
|
||||
[SPECIES_SCYTHER - 1] = 0x0a,
|
||||
[SPECIES_JYNX - 1] = 0x00,
|
||||
[SPECIES_ELECTABUZZ - 1] = 0x00,
|
||||
[SPECIES_MAGMAR - 1] = 0x00,
|
||||
[SPECIES_PINSIR - 1] = 0x00,
|
||||
[SPECIES_TAUROS - 1] = 0x0a,
|
||||
[SPECIES_MAGIKARP - 1] = 0x00,
|
||||
[SPECIES_GYARADOS - 1] = 0x00,
|
||||
[SPECIES_LAPRAS - 1] = 0x00,
|
||||
[SPECIES_DITTO - 1] = 0x00,
|
||||
[SPECIES_EEVEE - 1] = 0x00,
|
||||
[SPECIES_VAPOREON - 1] = 0x00,
|
||||
[SPECIES_JOLTEON - 1] = 0x00,
|
||||
[SPECIES_FLAREON - 1] = 0x00,
|
||||
[SPECIES_PORYGON - 1] = 0x00,
|
||||
[SPECIES_OMANYTE - 1] = 0x00,
|
||||
[SPECIES_OMASTAR - 1] = 0x00,
|
||||
[SPECIES_KABUTO - 1] = 0x00,
|
||||
[SPECIES_KABUTOPS - 1] = 0x00,
|
||||
[SPECIES_AERODACTYL - 1] = 0x00,
|
||||
[SPECIES_SNORLAX - 1] = 0x00,
|
||||
[SPECIES_ARTICUNO - 1] = 0x00,
|
||||
[SPECIES_ZAPDOS - 1] = 0x00,
|
||||
[SPECIES_MOLTRES - 1] = 0x00,
|
||||
[SPECIES_DRATINI - 1] = 0x00,
|
||||
[SPECIES_DRAGONAIR - 1] = 0x00,
|
||||
[SPECIES_DRAGONITE - 1] = 0x00,
|
||||
[SPECIES_MEWTWO - 1] = 0x00,
|
||||
[SPECIES_MEW - 1] = 0x00,
|
||||
[SPECIES_CHIKORITA - 1] = 0x00,
|
||||
[SPECIES_BAYLEEF - 1] = 0x00,
|
||||
[SPECIES_MEGANIUM - 1] = 0x00,
|
||||
[SPECIES_CYNDAQUIL - 1] = 0x00,
|
||||
[SPECIES_QUILAVA - 1] = 0x00,
|
||||
[SPECIES_TYPHLOSION - 1] = 0x14,
|
||||
[SPECIES_TOTODILE - 1] = 0x00,
|
||||
[SPECIES_CROCONAW - 1] = 0x00,
|
||||
[SPECIES_FERALIGATR - 1] = 0x05,
|
||||
[SPECIES_SENTRET - 1] = 0x00,
|
||||
[SPECIES_FURRET - 1] = 0x00,
|
||||
[SPECIES_HOOTHOOT - 1] = 0x00,
|
||||
[SPECIES_NOCTOWL - 1] = 0x00,
|
||||
[SPECIES_LEDYBA - 1] = 0x00,
|
||||
[SPECIES_LEDIAN - 1] = 0x00,
|
||||
[SPECIES_SPINARAK - 1] = 0x00,
|
||||
[SPECIES_ARIADOS - 1] = 0x00,
|
||||
[SPECIES_CROBAT - 1] = 0x00,
|
||||
[SPECIES_CHINCHOU - 1] = 0x00,
|
||||
[SPECIES_LANTURN - 1] = 0x00,
|
||||
[SPECIES_PICHU - 1] = 0x00,
|
||||
[SPECIES_CLEFFA - 1] = 0x00,
|
||||
[SPECIES_IGGLYBUFF - 1] = 0x00,
|
||||
[SPECIES_TOGEPI - 1] = 0x00,
|
||||
[SPECIES_TOGETIC - 1] = 0x00,
|
||||
[SPECIES_NATU - 1] = 0x1e,
|
||||
[SPECIES_XATU - 1] = 0x00,
|
||||
[SPECIES_MAREEP - 1] = 0x32,
|
||||
[SPECIES_FLAAFFY - 1] = 0x00,
|
||||
[SPECIES_AMPHAROS - 1] = 0x0a,
|
||||
[SPECIES_BELLOSSOM - 1] = 0x00,
|
||||
[SPECIES_MARILL - 1] = 0x00,
|
||||
[SPECIES_AZUMARILL - 1] = 0x00,
|
||||
[SPECIES_SUDOWOODO - 1] = 0x00,
|
||||
[SPECIES_POLITOED - 1] = 0x28,
|
||||
[SPECIES_HOPPIP - 1] = 0x00,
|
||||
[SPECIES_SKIPLOOM - 1] = 0x00,
|
||||
[SPECIES_JUMPLUFF - 1] = 0x00,
|
||||
[SPECIES_AIPOM - 1] = 0x00,
|
||||
[SPECIES_SUNKERN - 1] = 0x00,
|
||||
[SPECIES_SUNFLORA - 1] = 0x00,
|
||||
[SPECIES_YANMA - 1] = 0x00,
|
||||
[SPECIES_WOOPER - 1] = 0x00,
|
||||
[SPECIES_QUAGSIRE - 1] = 0x00,
|
||||
[SPECIES_ESPEON - 1] = 0x00,
|
||||
[SPECIES_UMBREON - 1] = 0x00,
|
||||
[SPECIES_MURKROW - 1] = 0x00,
|
||||
[SPECIES_SLOWKING - 1] = 0x00,
|
||||
[SPECIES_MISDREAVUS - 1] = 0x00,
|
||||
[SPECIES_UNOWN - 1] = 0x00,
|
||||
[SPECIES_WOBBUFFET - 1] = 0x00,
|
||||
[SPECIES_GIRAFARIG - 1] = 0x00,
|
||||
[SPECIES_PINECO - 1] = 0x00,
|
||||
[SPECIES_FORRETRESS - 1] = 0x00,
|
||||
[SPECIES_DUNSPARCE - 1] = 0x0a,
|
||||
[SPECIES_GLIGAR - 1] = 0x00,
|
||||
[SPECIES_STEELIX - 1] = 0x2d,
|
||||
[SPECIES_SNUBBULL - 1] = 0x00,
|
||||
[SPECIES_GRANBULL - 1] = 0x00,
|
||||
[SPECIES_QWILFISH - 1] = 0x27,
|
||||
[SPECIES_SCIZOR - 1] = 0x13,
|
||||
[SPECIES_SHUCKLE - 1] = 0x00,
|
||||
[SPECIES_HERACROSS - 1] = 0x00,
|
||||
[SPECIES_SNEASEL - 1] = 0x00,
|
||||
[SPECIES_TEDDIURSA - 1] = 0x00,
|
||||
[SPECIES_URSARING - 1] = 0x00,
|
||||
[SPECIES_SLUGMA - 1] = 0x00,
|
||||
[SPECIES_MAGCARGO - 1] = 0x00,
|
||||
[SPECIES_SWINUB - 1] = 0x00,
|
||||
[SPECIES_PILOSWINE - 1] = 0x00,
|
||||
[SPECIES_CORSOLA - 1] = 0x00,
|
||||
[SPECIES_REMORAID - 1] = 0x00,
|
||||
[SPECIES_OCTILLERY - 1] = 0x14,
|
||||
[SPECIES_DELIBIRD - 1] = 0x00,
|
||||
[SPECIES_MANTINE - 1] = 0x00,
|
||||
[SPECIES_SKARMORY - 1] = 0x00,
|
||||
[SPECIES_HOUNDOUR - 1] = 0x00,
|
||||
[SPECIES_HOUNDOOM - 1] = 0x00,
|
||||
[SPECIES_KINGDRA - 1] = 0x00,
|
||||
[SPECIES_PHANPY - 1] = 0x00,
|
||||
[SPECIES_DONPHAN - 1] = 0x00,
|
||||
[SPECIES_PORYGON2 - 1] = 0x00,
|
||||
[SPECIES_STANTLER - 1] = 0x00,
|
||||
[SPECIES_SMEARGLE - 1] = 0x00,
|
||||
[SPECIES_TYROGUE - 1] = 0x00,
|
||||
[SPECIES_HITMONTOP - 1] = 0x00,
|
||||
[SPECIES_SMOOCHUM - 1] = 0x28,
|
||||
[SPECIES_ELEKID - 1] = 0x00,
|
||||
[SPECIES_MAGBY - 1] = 0x00,
|
||||
[SPECIES_MILTANK - 1] = 0x00,
|
||||
[SPECIES_BLISSEY - 1] = 0x00,
|
||||
[SPECIES_RAIKOU - 1] = 0x00,
|
||||
[SPECIES_ENTEI - 1] = 0x00,
|
||||
[SPECIES_SUICUNE - 1] = 0x00,
|
||||
[SPECIES_LARVITAR - 1] = 0x00,
|
||||
[SPECIES_PUPITAR - 1] = 0x00,
|
||||
[SPECIES_TYRANITAR - 1] = 0x0a,
|
||||
[SPECIES_LUGIA - 1] = 0x14,
|
||||
[SPECIES_HO_OH - 1] = 0x00,
|
||||
[SPECIES_CELEBI - 1] = 0x00,
|
||||
[SPECIES_OLD_UNOWN_B - 1] = 0x00,
|
||||
[SPECIES_OLD_UNOWN_C - 1] = 0x00,
|
||||
[SPECIES_OLD_UNOWN_D - 1] = 0x00,
|
||||
[SPECIES_OLD_UNOWN_E - 1] = 0x00,
|
||||
[SPECIES_OLD_UNOWN_F - 1] = 0x00,
|
||||
[SPECIES_OLD_UNOWN_G - 1] = 0x00,
|
||||
[SPECIES_OLD_UNOWN_H - 1] = 0x00,
|
||||
[SPECIES_OLD_UNOWN_I - 1] = 0x00,
|
||||
[SPECIES_OLD_UNOWN_J - 1] = 0x00,
|
||||
[SPECIES_OLD_UNOWN_K - 1] = 0x00,
|
||||
[SPECIES_OLD_UNOWN_L - 1] = 0x00,
|
||||
[SPECIES_OLD_UNOWN_M - 1] = 0x00,
|
||||
[SPECIES_OLD_UNOWN_N - 1] = 0x00,
|
||||
[SPECIES_OLD_UNOWN_O - 1] = 0x00,
|
||||
[SPECIES_OLD_UNOWN_P - 1] = 0x00,
|
||||
[SPECIES_OLD_UNOWN_Q - 1] = 0x00,
|
||||
[SPECIES_OLD_UNOWN_R - 1] = 0x00,
|
||||
[SPECIES_OLD_UNOWN_S - 1] = 0x00,
|
||||
[SPECIES_OLD_UNOWN_T - 1] = 0x00,
|
||||
[SPECIES_OLD_UNOWN_U - 1] = 0x00,
|
||||
[SPECIES_OLD_UNOWN_V - 1] = 0x00,
|
||||
[SPECIES_OLD_UNOWN_W - 1] = 0x00,
|
||||
[SPECIES_OLD_UNOWN_X - 1] = 0x00,
|
||||
[SPECIES_OLD_UNOWN_Y - 1] = 0x00,
|
||||
[SPECIES_OLD_UNOWN_Z - 1] = 0x00,
|
||||
[SPECIES_TREECKO - 1] = 0x00,
|
||||
[SPECIES_GROVYLE - 1] = 0x00,
|
||||
[SPECIES_SCEPTILE - 1] = 0x00,
|
||||
[SPECIES_TORCHIC - 1] = 0x00,
|
||||
[SPECIES_COMBUSKEN - 1] = 0x00,
|
||||
[SPECIES_BLAZIKEN - 1] = 0x00,
|
||||
[SPECIES_MUDKIP - 1] = 0x00,
|
||||
[SPECIES_MARSHTOMP - 1] = 0x00,
|
||||
[SPECIES_SWAMPERT - 1] = 0x00,
|
||||
[SPECIES_POOCHYENA - 1] = 0x00,
|
||||
[SPECIES_MIGHTYENA - 1] = 0x00,
|
||||
[SPECIES_ZIGZAGOON - 1] = 0x00,
|
||||
[SPECIES_LINOONE - 1] = 0x00,
|
||||
[SPECIES_WURMPLE - 1] = 0x00,
|
||||
[SPECIES_SILCOON - 1] = 0x00,
|
||||
[SPECIES_BEAUTIFLY - 1] = 0x00,
|
||||
[SPECIES_CASCOON - 1] = 0x00,
|
||||
[SPECIES_DUSTOX - 1] = 0x00,
|
||||
[SPECIES_LOTAD - 1] = 0x00,
|
||||
[SPECIES_LOMBRE - 1] = 0x00,
|
||||
[SPECIES_LUDICOLO - 1] = 0x00,
|
||||
[SPECIES_SEEDOT - 1] = 0x00,
|
||||
[SPECIES_NUZLEAF - 1] = 0x00,
|
||||
[SPECIES_SHIFTRY - 1] = 0x00,
|
||||
[SPECIES_NINCADA - 1] = 0x00,
|
||||
[SPECIES_NINJASK - 1] = 0x00,
|
||||
[SPECIES_SHEDINJA - 1] = 0x00,
|
||||
[SPECIES_TAILLOW - 1] = 0x00,
|
||||
[SPECIES_SWELLOW - 1] = 0x00,
|
||||
[SPECIES_SHROOMISH - 1] = 0x00,
|
||||
[SPECIES_BRELOOM - 1] = 0x00,
|
||||
[SPECIES_SPINDA - 1] = 0x00,
|
||||
[SPECIES_WINGULL - 1] = 0x00,
|
||||
[SPECIES_PELIPPER - 1] = 0x00,
|
||||
[SPECIES_SURSKIT - 1] = 0x00,
|
||||
[SPECIES_MASQUERAIN - 1] = 0x00,
|
||||
[SPECIES_WAILMER - 1] = 0x00,
|
||||
[SPECIES_WAILORD - 1] = 0x0a,
|
||||
[SPECIES_SKITTY - 1] = 0x00,
|
||||
[SPECIES_DELCATTY - 1] = 0x00,
|
||||
[SPECIES_KECLEON - 1] = 0x1e,
|
||||
[SPECIES_BALTOY - 1] = 0x00,
|
||||
[SPECIES_CLAYDOL - 1] = 0x00,
|
||||
[SPECIES_NOSEPASS - 1] = 0x00,
|
||||
[SPECIES_TORKOAL - 1] = 0x00,
|
||||
[SPECIES_SABLEYE - 1] = 0x00,
|
||||
[SPECIES_BARBOACH - 1] = 0x00,
|
||||
[SPECIES_WHISCASH - 1] = 0x00,
|
||||
[SPECIES_LUVDISC - 1] = 0x00,
|
||||
[SPECIES_CORPHISH - 1] = 0x00,
|
||||
[SPECIES_CRAWDAUNT - 1] = 0x00,
|
||||
[SPECIES_FEEBAS - 1] = 0x00,
|
||||
[SPECIES_MILOTIC - 1] = 0x2d,
|
||||
[SPECIES_CARVANHA - 1] = 0x00,
|
||||
[SPECIES_SHARPEDO - 1] = 0x00,
|
||||
[SPECIES_TRAPINCH - 1] = 0x00,
|
||||
[SPECIES_VIBRAVA - 1] = 0x00,
|
||||
[SPECIES_FLYGON - 1] = 0x00,
|
||||
[SPECIES_MAKUHITA - 1] = 0x00,
|
||||
[SPECIES_HARIYAMA - 1] = 0x00,
|
||||
[SPECIES_ELECTRIKE - 1] = 0x00,
|
||||
[SPECIES_MANECTRIC - 1] = 0x00,
|
||||
[SPECIES_NUMEL - 1] = 0x00,
|
||||
[SPECIES_CAMERUPT - 1] = 0x00,
|
||||
[SPECIES_SPHEAL - 1] = 0x0f,
|
||||
[SPECIES_SEALEO - 1] = 0x00,
|
||||
[SPECIES_WALREIN - 1] = 0x00,
|
||||
[SPECIES_CACNEA - 1] = 0x00,
|
||||
[SPECIES_CACTURNE - 1] = 0x00,
|
||||
[SPECIES_SNORUNT - 1] = 0x14,
|
||||
[SPECIES_GLALIE - 1] = 0x00,
|
||||
[SPECIES_LUNATONE - 1] = 0x00,
|
||||
[SPECIES_SOLROCK - 1] = 0x00,
|
||||
[SPECIES_AZURILL - 1] = 0x00,
|
||||
[SPECIES_SPOINK - 1] = 0x00,
|
||||
[SPECIES_GRUMPIG - 1] = 0x0f,
|
||||
[SPECIES_PLUSLE - 1] = 0x00,
|
||||
[SPECIES_MINUN - 1] = 0x00,
|
||||
[SPECIES_MAWILE - 1] = 0x00,
|
||||
[SPECIES_MEDITITE - 1] = 0x00,
|
||||
[SPECIES_MEDICHAM - 1] = 0x00,
|
||||
[SPECIES_SWABLU - 1] = 0x00,
|
||||
[SPECIES_ALTARIA - 1] = 0x00,
|
||||
[SPECIES_WYNAUT - 1] = 0x0f,
|
||||
[SPECIES_DUSKULL - 1] = 0x00,
|
||||
[SPECIES_DUSCLOPS - 1] = 0x1e,
|
||||
[SPECIES_ROSELIA - 1] = 0x00,
|
||||
[SPECIES_SLAKOTH - 1] = 0x00,
|
||||
[SPECIES_VIGOROTH - 1] = 0x00,
|
||||
[SPECIES_SLAKING - 1] = 0x00,
|
||||
[SPECIES_GULPIN - 1] = 0x00,
|
||||
[SPECIES_SWALOT - 1] = 0x00,
|
||||
[SPECIES_TROPIUS - 1] = 0x00,
|
||||
[SPECIES_WHISMUR - 1] = 0x00,
|
||||
[SPECIES_LOUDRED - 1] = 0x00,
|
||||
[SPECIES_EXPLOUD - 1] = 0x00,
|
||||
[SPECIES_CLAMPERL - 1] = 0x00,
|
||||
[SPECIES_HUNTAIL - 1] = 0x00,
|
||||
[SPECIES_GOREBYSS - 1] = 0x00,
|
||||
[SPECIES_ABSOL - 1] = 0x2d,
|
||||
[SPECIES_SHUPPET - 1] = 0x00,
|
||||
[SPECIES_BANETTE - 1] = 0x00,
|
||||
[SPECIES_SEVIPER - 1] = 0x00,
|
||||
[SPECIES_ZANGOOSE - 1] = 0x00,
|
||||
[SPECIES_RELICANTH - 1] = 0x00,
|
||||
[SPECIES_ARON - 1] = 0x00,
|
||||
[SPECIES_LAIRON - 1] = 0x00,
|
||||
[SPECIES_AGGRON - 1] = 0x00,
|
||||
[SPECIES_CASTFORM - 1] = 0x00,
|
||||
[SPECIES_VOLBEAT - 1] = 0x00,
|
||||
[SPECIES_ILLUMISE - 1] = 0x00,
|
||||
[SPECIES_LILEEP - 1] = 0x00,
|
||||
[SPECIES_CRADILY - 1] = 0x00,
|
||||
[SPECIES_ANORITH - 1] = 0x00,
|
||||
[SPECIES_ARMALDO - 1] = 0x00,
|
||||
[SPECIES_RALTS - 1] = 0x00,
|
||||
[SPECIES_KIRLIA - 1] = 0x00,
|
||||
[SPECIES_GARDEVOIR - 1] = 0x00,
|
||||
[SPECIES_BAGON - 1] = 0x00,
|
||||
[SPECIES_SHELGON - 1] = 0x00,
|
||||
[SPECIES_SALAMENCE - 1] = 0x46,
|
||||
[SPECIES_BELDUM - 1] = 0x00,
|
||||
[SPECIES_METANG - 1] = 0x00,
|
||||
[SPECIES_METAGROSS - 1] = 0x00,
|
||||
[SPECIES_REGIROCK - 1] = 0x00,
|
||||
[SPECIES_REGICE - 1] = 0x00,
|
||||
[SPECIES_REGISTEEL - 1] = 0x00,
|
||||
[SPECIES_KYOGRE - 1] = 0x3c,
|
||||
[SPECIES_GROUDON - 1] = 0x00,
|
||||
[SPECIES_RAYQUAZA - 1] = 0x3c,
|
||||
[SPECIES_LATIAS - 1] = 0x00,
|
||||
[SPECIES_LATIOS - 1] = 0x00,
|
||||
[SPECIES_JIRACHI - 1] = 0x00,
|
||||
[SPECIES_DEOXYS - 1] = 0x00,
|
||||
[SPECIES_CHIMECHO - 1] = 0x00,
|
||||
};
|
||||
|
||||
const u8 gPPUpGetMask[] = {0x03, 0x0c, 0x30, 0xc0}; // Masks for getting PP Up count, also PP Max values
|
||||
@@ -5818,7 +5463,7 @@ u16 GetEvolutionTargetSpecies(struct Pokemon *mon, u8 type, u16 evolutionItem)
|
||||
if (gEvolutionTable[species][i].param == heldItem)
|
||||
{
|
||||
heldItem = 0;
|
||||
SetMonData(mon, MON_DATA_HELD_ITEM, (u8 *)&heldItem);
|
||||
SetMonData(mon, MON_DATA_HELD_ITEM, &heldItem);
|
||||
targetSpecies = gEvolutionTable[species][i].targetSpecies;
|
||||
}
|
||||
break;
|
||||
|
||||
+445
-448
@@ -25,446 +25,446 @@ static u8 CreateMonIconSprite(struct MonIconSpriteTemplate *, s16, s16, u8);
|
||||
|
||||
const u8 *const gMonIconTable[] =
|
||||
{
|
||||
gMonIcon_Bulbasaur,
|
||||
gMonIcon_Bulbasaur,
|
||||
gMonIcon_Ivysaur,
|
||||
gMonIcon_Venusaur,
|
||||
gMonIcon_Charmander,
|
||||
gMonIcon_Charmeleon,
|
||||
gMonIcon_Charizard,
|
||||
gMonIcon_Squirtle,
|
||||
gMonIcon_Wartortle,
|
||||
gMonIcon_Blastoise,
|
||||
gMonIcon_Caterpie,
|
||||
gMonIcon_Metapod,
|
||||
gMonIcon_Butterfree,
|
||||
gMonIcon_Weedle,
|
||||
gMonIcon_Kakuna,
|
||||
gMonIcon_Beedrill,
|
||||
gMonIcon_Pidgey,
|
||||
gMonIcon_Pidgeotto,
|
||||
gMonIcon_Pidgeot,
|
||||
gMonIcon_Rattata,
|
||||
gMonIcon_Raticate,
|
||||
gMonIcon_Spearow,
|
||||
gMonIcon_Fearow,
|
||||
gMonIcon_Ekans,
|
||||
gMonIcon_Arbok,
|
||||
gMonIcon_Pikachu,
|
||||
gMonIcon_Raichu,
|
||||
gMonIcon_Sandshrew,
|
||||
gMonIcon_Sandslash,
|
||||
gMonIcon_NidoranF,
|
||||
gMonIcon_Nidorina,
|
||||
gMonIcon_Nidoqueen,
|
||||
gMonIcon_NidoranM,
|
||||
gMonIcon_Nidorino,
|
||||
gMonIcon_Nidoking,
|
||||
gMonIcon_Clefairy,
|
||||
gMonIcon_Clefable,
|
||||
gMonIcon_Vulpix,
|
||||
gMonIcon_Ninetales,
|
||||
gMonIcon_Jigglypuff,
|
||||
gMonIcon_Wigglytuff,
|
||||
gMonIcon_Zubat,
|
||||
gMonIcon_Golbat,
|
||||
gMonIcon_Oddish,
|
||||
gMonIcon_Gloom,
|
||||
gMonIcon_Vileplume,
|
||||
gMonIcon_Paras,
|
||||
gMonIcon_Parasect,
|
||||
gMonIcon_Venonat,
|
||||
gMonIcon_Venomoth,
|
||||
gMonIcon_Diglett,
|
||||
gMonIcon_Dugtrio,
|
||||
gMonIcon_Meowth,
|
||||
gMonIcon_Persian,
|
||||
gMonIcon_Psyduck,
|
||||
gMonIcon_Golduck,
|
||||
gMonIcon_Mankey,
|
||||
gMonIcon_Primeape,
|
||||
gMonIcon_Growlithe,
|
||||
gMonIcon_Arcanine,
|
||||
gMonIcon_Poliwag,
|
||||
gMonIcon_Poliwhirl,
|
||||
gMonIcon_Poliwrath,
|
||||
gMonIcon_Abra,
|
||||
gMonIcon_Kadabra,
|
||||
gMonIcon_Alakazam,
|
||||
gMonIcon_Machop,
|
||||
gMonIcon_Machoke,
|
||||
gMonIcon_Machamp,
|
||||
gMonIcon_Bellsprout,
|
||||
gMonIcon_Weepinbell,
|
||||
gMonIcon_Victreebel,
|
||||
gMonIcon_Tentacool,
|
||||
gMonIcon_Tentacruel,
|
||||
gMonIcon_Geodude,
|
||||
gMonIcon_Graveler,
|
||||
gMonIcon_Golem,
|
||||
gMonIcon_Ponyta,
|
||||
gMonIcon_Rapidash,
|
||||
gMonIcon_Slowpoke,
|
||||
gMonIcon_Slowbro,
|
||||
gMonIcon_Magnemite,
|
||||
gMonIcon_Magneton,
|
||||
gMonIcon_Farfetchd,
|
||||
gMonIcon_Doduo,
|
||||
gMonIcon_Dodrio,
|
||||
gMonIcon_Seel,
|
||||
gMonIcon_Dewgong,
|
||||
gMonIcon_Grimer,
|
||||
gMonIcon_Muk,
|
||||
gMonIcon_Shellder,
|
||||
gMonIcon_Cloyster,
|
||||
gMonIcon_Gastly,
|
||||
gMonIcon_Haunter,
|
||||
gMonIcon_Gengar,
|
||||
gMonIcon_Onix,
|
||||
gMonIcon_Drowzee,
|
||||
gMonIcon_Hypno,
|
||||
gMonIcon_Krabby,
|
||||
gMonIcon_Kingler,
|
||||
gMonIcon_Voltorb,
|
||||
gMonIcon_Electrode,
|
||||
gMonIcon_Exeggcute,
|
||||
gMonIcon_Exeggutor,
|
||||
gMonIcon_Cubone,
|
||||
gMonIcon_Marowak,
|
||||
gMonIcon_Hitmonlee,
|
||||
gMonIcon_Hitmonchan,
|
||||
gMonIcon_Lickitung,
|
||||
gMonIcon_Koffing,
|
||||
gMonIcon_Weezing,
|
||||
gMonIcon_Rhyhorn,
|
||||
gMonIcon_Rhydon,
|
||||
gMonIcon_Chansey,
|
||||
gMonIcon_Tangela,
|
||||
gMonIcon_Kangaskhan,
|
||||
gMonIcon_Horsea,
|
||||
gMonIcon_Seadra,
|
||||
gMonIcon_Goldeen,
|
||||
gMonIcon_Seaking,
|
||||
gMonIcon_Staryu,
|
||||
gMonIcon_Starmie,
|
||||
gMonIcon_Mrmime,
|
||||
gMonIcon_Scyther,
|
||||
gMonIcon_Jynx,
|
||||
gMonIcon_Electabuzz,
|
||||
gMonIcon_Magmar,
|
||||
gMonIcon_Pinsir,
|
||||
gMonIcon_Tauros,
|
||||
gMonIcon_Magikarp,
|
||||
gMonIcon_Gyarados,
|
||||
gMonIcon_Lapras,
|
||||
gMonIcon_Ditto,
|
||||
gMonIcon_Eevee,
|
||||
gMonIcon_Vaporeon,
|
||||
gMonIcon_Jolteon,
|
||||
gMonIcon_Flareon,
|
||||
gMonIcon_Porygon,
|
||||
gMonIcon_Omanyte,
|
||||
gMonIcon_Omastar,
|
||||
gMonIcon_Kabuto,
|
||||
gMonIcon_Kabutops,
|
||||
gMonIcon_Aerodactyl,
|
||||
gMonIcon_Snorlax,
|
||||
gMonIcon_Articuno,
|
||||
gMonIcon_Zapdos,
|
||||
gMonIcon_Moltres,
|
||||
gMonIcon_Dratini,
|
||||
gMonIcon_Dragonair,
|
||||
gMonIcon_Dragonite,
|
||||
gMonIcon_Mewtwo,
|
||||
gMonIcon_Mew,
|
||||
gMonIcon_Chikorita,
|
||||
gMonIcon_Bayleef,
|
||||
gMonIcon_Meganium,
|
||||
gMonIcon_Cyndaquil,
|
||||
gMonIcon_Quilava,
|
||||
gMonIcon_Typhlosion,
|
||||
gMonIcon_Totodile,
|
||||
gMonIcon_Croconaw,
|
||||
gMonIcon_Feraligatr,
|
||||
gMonIcon_Sentret,
|
||||
gMonIcon_Furret,
|
||||
gMonIcon_Hoothoot,
|
||||
gMonIcon_Noctowl,
|
||||
gMonIcon_Ledyba,
|
||||
gMonIcon_Ledian,
|
||||
gMonIcon_Spinarak,
|
||||
gMonIcon_Ariados,
|
||||
gMonIcon_Crobat,
|
||||
gMonIcon_Chinchou,
|
||||
gMonIcon_Lanturn,
|
||||
gMonIcon_Pichu,
|
||||
gMonIcon_Cleffa,
|
||||
gMonIcon_Igglybuff,
|
||||
gMonIcon_Togepi,
|
||||
gMonIcon_Togetic,
|
||||
gMonIcon_Natu,
|
||||
gMonIcon_Xatu,
|
||||
gMonIcon_Mareep,
|
||||
gMonIcon_Flaaffy,
|
||||
gMonIcon_Ampharos,
|
||||
gMonIcon_Bellossom,
|
||||
gMonIcon_Marill,
|
||||
gMonIcon_Azumarill,
|
||||
gMonIcon_Sudowoodo,
|
||||
gMonIcon_Politoed,
|
||||
gMonIcon_Hoppip,
|
||||
gMonIcon_Skiploom,
|
||||
gMonIcon_Jumpluff,
|
||||
gMonIcon_Aipom,
|
||||
gMonIcon_Sunkern,
|
||||
gMonIcon_Sunflora,
|
||||
gMonIcon_Yanma,
|
||||
gMonIcon_Wooper,
|
||||
gMonIcon_Quagsire,
|
||||
gMonIcon_Espeon,
|
||||
gMonIcon_Umbreon,
|
||||
gMonIcon_Murkrow,
|
||||
gMonIcon_Slowking,
|
||||
gMonIcon_Misdreavus,
|
||||
gMonIcon_UnownA,
|
||||
gMonIcon_Wobbuffet,
|
||||
gMonIcon_Girafarig,
|
||||
gMonIcon_Pineco,
|
||||
gMonIcon_Forretress,
|
||||
gMonIcon_Dunsparce,
|
||||
gMonIcon_Gligar,
|
||||
gMonIcon_Steelix,
|
||||
gMonIcon_Snubbull,
|
||||
gMonIcon_Granbull,
|
||||
gMonIcon_Qwilfish,
|
||||
gMonIcon_Scizor,
|
||||
gMonIcon_Shuckle,
|
||||
gMonIcon_Heracross,
|
||||
gMonIcon_Sneasel,
|
||||
gMonIcon_Teddiursa,
|
||||
gMonIcon_Ursaring,
|
||||
gMonIcon_Slugma,
|
||||
gMonIcon_Magcargo,
|
||||
gMonIcon_Swinub,
|
||||
gMonIcon_Piloswine,
|
||||
gMonIcon_Corsola,
|
||||
gMonIcon_Remoraid,
|
||||
gMonIcon_Octillery,
|
||||
gMonIcon_Delibird,
|
||||
gMonIcon_Mantine,
|
||||
gMonIcon_Skarmory,
|
||||
gMonIcon_Houndour,
|
||||
gMonIcon_Houndoom,
|
||||
gMonIcon_Kingdra,
|
||||
gMonIcon_Phanpy,
|
||||
gMonIcon_Donphan,
|
||||
gMonIcon_Porygon2,
|
||||
gMonIcon_Stantler,
|
||||
gMonIcon_Smeargle,
|
||||
gMonIcon_Tyrogue,
|
||||
gMonIcon_Hitmontop,
|
||||
gMonIcon_Smoochum,
|
||||
gMonIcon_Elekid,
|
||||
gMonIcon_Magby,
|
||||
gMonIcon_Miltank,
|
||||
gMonIcon_Blissey,
|
||||
gMonIcon_Raikou,
|
||||
gMonIcon_Entei,
|
||||
gMonIcon_Suicune,
|
||||
gMonIcon_Larvitar,
|
||||
gMonIcon_Pupitar,
|
||||
gMonIcon_Tyranitar,
|
||||
gMonIcon_Lugia,
|
||||
gMonIcon_HoOh,
|
||||
gMonIcon_Celebi,
|
||||
gMonIcon_QuestionMark,
|
||||
gMonIcon_QuestionMark,
|
||||
gMonIcon_QuestionMark,
|
||||
gMonIcon_QuestionMark,
|
||||
gMonIcon_QuestionMark,
|
||||
gMonIcon_QuestionMark,
|
||||
gMonIcon_QuestionMark,
|
||||
gMonIcon_QuestionMark,
|
||||
gMonIcon_QuestionMark,
|
||||
gMonIcon_QuestionMark,
|
||||
gMonIcon_QuestionMark,
|
||||
gMonIcon_QuestionMark,
|
||||
gMonIcon_QuestionMark,
|
||||
gMonIcon_QuestionMark,
|
||||
gMonIcon_QuestionMark,
|
||||
gMonIcon_QuestionMark,
|
||||
gMonIcon_QuestionMark,
|
||||
gMonIcon_QuestionMark,
|
||||
gMonIcon_QuestionMark,
|
||||
gMonIcon_QuestionMark,
|
||||
gMonIcon_QuestionMark,
|
||||
gMonIcon_QuestionMark,
|
||||
gMonIcon_QuestionMark,
|
||||
gMonIcon_QuestionMark,
|
||||
gMonIcon_QuestionMark,
|
||||
gMonIcon_Treecko,
|
||||
gMonIcon_Grovyle,
|
||||
gMonIcon_Sceptile,
|
||||
gMonIcon_Torchic,
|
||||
gMonIcon_Combusken,
|
||||
gMonIcon_Blaziken,
|
||||
gMonIcon_Mudkip,
|
||||
gMonIcon_Marshtomp,
|
||||
gMonIcon_Swampert,
|
||||
gMonIcon_Poochyena,
|
||||
gMonIcon_Mightyena,
|
||||
gMonIcon_Zigzagoon,
|
||||
gMonIcon_Linoone,
|
||||
gMonIcon_Wurmple,
|
||||
gMonIcon_Silcoon,
|
||||
gMonIcon_Beautifly,
|
||||
gMonIcon_Cascoon,
|
||||
gMonIcon_Dustox,
|
||||
gMonIcon_Lotad,
|
||||
gMonIcon_Lombre,
|
||||
gMonIcon_Ludicolo,
|
||||
gMonIcon_Seedot,
|
||||
gMonIcon_Nuzleaf,
|
||||
gMonIcon_Shiftry,
|
||||
gMonIcon_Nincada,
|
||||
gMonIcon_Ninjask,
|
||||
gMonIcon_Shedinja,
|
||||
gMonIcon_Taillow,
|
||||
gMonIcon_Swellow,
|
||||
gMonIcon_Shroomish,
|
||||
gMonIcon_Breloom,
|
||||
gMonIcon_Spinda,
|
||||
gMonIcon_Wingull,
|
||||
gMonIcon_Pelipper,
|
||||
gMonIcon_Surskit,
|
||||
gMonIcon_Masquerain,
|
||||
gMonIcon_Wailmer,
|
||||
gMonIcon_Wailord,
|
||||
gMonIcon_Skitty,
|
||||
gMonIcon_Delcatty,
|
||||
gMonIcon_Kecleon,
|
||||
gMonIcon_Baltoy,
|
||||
gMonIcon_Claydol,
|
||||
gMonIcon_Nosepass,
|
||||
gMonIcon_Torkoal,
|
||||
gMonIcon_Sableye,
|
||||
gMonIcon_Barboach,
|
||||
gMonIcon_Whiscash,
|
||||
gMonIcon_Luvdisc,
|
||||
gMonIcon_Corphish,
|
||||
gMonIcon_Crawdaunt,
|
||||
gMonIcon_Feebas,
|
||||
gMonIcon_Milotic,
|
||||
gMonIcon_Carvanha,
|
||||
gMonIcon_Sharpedo,
|
||||
gMonIcon_Trapinch,
|
||||
gMonIcon_Vibrava,
|
||||
gMonIcon_Flygon,
|
||||
gMonIcon_Makuhita,
|
||||
gMonIcon_Hariyama,
|
||||
gMonIcon_Electrike,
|
||||
gMonIcon_Manectric,
|
||||
gMonIcon_Numel,
|
||||
gMonIcon_Camerupt,
|
||||
gMonIcon_Spheal,
|
||||
gMonIcon_Sealeo,
|
||||
gMonIcon_Walrein,
|
||||
gMonIcon_Cacnea,
|
||||
gMonIcon_Cacturne,
|
||||
gMonIcon_Snorunt,
|
||||
gMonIcon_Glalie,
|
||||
gMonIcon_Lunatone,
|
||||
gMonIcon_Solrock,
|
||||
gMonIcon_Azurill,
|
||||
gMonIcon_Spoink,
|
||||
gMonIcon_Grumpig,
|
||||
gMonIcon_Plusle,
|
||||
gMonIcon_Minun,
|
||||
gMonIcon_Mawile,
|
||||
gMonIcon_Meditite,
|
||||
gMonIcon_Medicham,
|
||||
gMonIcon_Swablu,
|
||||
gMonIcon_Altaria,
|
||||
gMonIcon_Wynaut,
|
||||
gMonIcon_Duskull,
|
||||
gMonIcon_Dusclops,
|
||||
gMonIcon_Roselia,
|
||||
gMonIcon_Slakoth,
|
||||
gMonIcon_Vigoroth,
|
||||
gMonIcon_Slaking,
|
||||
gMonIcon_Gulpin,
|
||||
gMonIcon_Swalot,
|
||||
gMonIcon_Tropius,
|
||||
gMonIcon_Whismur,
|
||||
gMonIcon_Loudred,
|
||||
gMonIcon_Exploud,
|
||||
gMonIcon_Clamperl,
|
||||
gMonIcon_Huntail,
|
||||
gMonIcon_Gorebyss,
|
||||
gMonIcon_Absol,
|
||||
gMonIcon_Shuppet,
|
||||
gMonIcon_Banette,
|
||||
gMonIcon_Seviper,
|
||||
gMonIcon_Zangoose,
|
||||
gMonIcon_Relicanth,
|
||||
gMonIcon_Aron,
|
||||
gMonIcon_Lairon,
|
||||
gMonIcon_Aggron,
|
||||
gMonIcon_Castform,
|
||||
gMonIcon_Volbeat,
|
||||
gMonIcon_Illumise,
|
||||
gMonIcon_Lileep,
|
||||
gMonIcon_Cradily,
|
||||
gMonIcon_Anorith,
|
||||
gMonIcon_Armaldo,
|
||||
gMonIcon_Ralts,
|
||||
gMonIcon_Kirlia,
|
||||
gMonIcon_Gardevoir,
|
||||
gMonIcon_Bagon,
|
||||
gMonIcon_Shelgon,
|
||||
gMonIcon_Salamence,
|
||||
gMonIcon_Beldum,
|
||||
gMonIcon_Metang,
|
||||
gMonIcon_Metagross,
|
||||
gMonIcon_Regirock,
|
||||
gMonIcon_Regice,
|
||||
gMonIcon_Registeel,
|
||||
gMonIcon_Kyogre,
|
||||
gMonIcon_Groudon,
|
||||
gMonIcon_Rayquaza,
|
||||
gMonIcon_Latias,
|
||||
gMonIcon_Latios,
|
||||
gMonIcon_Jirachi,
|
||||
gMonIcon_Deoxys,
|
||||
gMonIcon_Chimecho,
|
||||
gMonIcon_Egg,
|
||||
gMonIcon_UnownB,
|
||||
gMonIcon_UnownC,
|
||||
gMonIcon_UnownD,
|
||||
gMonIcon_UnownE,
|
||||
gMonIcon_UnownF,
|
||||
gMonIcon_UnownG,
|
||||
gMonIcon_UnownH,
|
||||
gMonIcon_UnownI,
|
||||
gMonIcon_UnownJ,
|
||||
gMonIcon_UnownK,
|
||||
gMonIcon_UnownL,
|
||||
gMonIcon_UnownM,
|
||||
gMonIcon_UnownN,
|
||||
gMonIcon_UnownO,
|
||||
gMonIcon_UnownP,
|
||||
gMonIcon_UnownQ,
|
||||
gMonIcon_UnownR,
|
||||
gMonIcon_UnownS,
|
||||
gMonIcon_UnownT,
|
||||
gMonIcon_UnownU,
|
||||
gMonIcon_UnownV,
|
||||
gMonIcon_UnownW,
|
||||
gMonIcon_UnownX,
|
||||
gMonIcon_UnownY,
|
||||
gMonIcon_UnownZ,
|
||||
gMonIcon_UnownExclamationMark,
|
||||
gMonIcon_UnownQuestionMark,
|
||||
[SPECIES_NONE] = gMonIcon_Bulbasaur,
|
||||
[SPECIES_BULBASAUR] = gMonIcon_Bulbasaur,
|
||||
[SPECIES_IVYSAUR] = gMonIcon_Ivysaur,
|
||||
[SPECIES_VENUSAUR] = gMonIcon_Venusaur,
|
||||
[SPECIES_CHARMANDER] = gMonIcon_Charmander,
|
||||
[SPECIES_CHARMELEON] = gMonIcon_Charmeleon,
|
||||
[SPECIES_CHARIZARD] = gMonIcon_Charizard,
|
||||
[SPECIES_SQUIRTLE] = gMonIcon_Squirtle,
|
||||
[SPECIES_WARTORTLE] = gMonIcon_Wartortle,
|
||||
[SPECIES_BLASTOISE] = gMonIcon_Blastoise,
|
||||
[SPECIES_CATERPIE] = gMonIcon_Caterpie,
|
||||
[SPECIES_METAPOD] = gMonIcon_Metapod,
|
||||
[SPECIES_BUTTERFREE] = gMonIcon_Butterfree,
|
||||
[SPECIES_WEEDLE] = gMonIcon_Weedle,
|
||||
[SPECIES_KAKUNA] = gMonIcon_Kakuna,
|
||||
[SPECIES_BEEDRILL] = gMonIcon_Beedrill,
|
||||
[SPECIES_PIDGEY] = gMonIcon_Pidgey,
|
||||
[SPECIES_PIDGEOTTO] = gMonIcon_Pidgeotto,
|
||||
[SPECIES_PIDGEOT] = gMonIcon_Pidgeot,
|
||||
[SPECIES_RATTATA] = gMonIcon_Rattata,
|
||||
[SPECIES_RATICATE] = gMonIcon_Raticate,
|
||||
[SPECIES_SPEAROW] = gMonIcon_Spearow,
|
||||
[SPECIES_FEAROW] = gMonIcon_Fearow,
|
||||
[SPECIES_EKANS] = gMonIcon_Ekans,
|
||||
[SPECIES_ARBOK] = gMonIcon_Arbok,
|
||||
[SPECIES_PIKACHU] = gMonIcon_Pikachu,
|
||||
[SPECIES_RAICHU] = gMonIcon_Raichu,
|
||||
[SPECIES_SANDSHREW] = gMonIcon_Sandshrew,
|
||||
[SPECIES_SANDSLASH] = gMonIcon_Sandslash,
|
||||
[SPECIES_NIDORAN_F] = gMonIcon_NidoranF,
|
||||
[SPECIES_NIDORINA] = gMonIcon_Nidorina,
|
||||
[SPECIES_NIDOQUEEN] = gMonIcon_Nidoqueen,
|
||||
[SPECIES_NIDORAN_M] = gMonIcon_NidoranM,
|
||||
[SPECIES_NIDORINO] = gMonIcon_Nidorino,
|
||||
[SPECIES_NIDOKING] = gMonIcon_Nidoking,
|
||||
[SPECIES_CLEFAIRY] = gMonIcon_Clefairy,
|
||||
[SPECIES_CLEFABLE] = gMonIcon_Clefable,
|
||||
[SPECIES_VULPIX] = gMonIcon_Vulpix,
|
||||
[SPECIES_NINETALES] = gMonIcon_Ninetales,
|
||||
[SPECIES_JIGGLYPUFF] = gMonIcon_Jigglypuff,
|
||||
[SPECIES_WIGGLYTUFF] = gMonIcon_Wigglytuff,
|
||||
[SPECIES_ZUBAT] = gMonIcon_Zubat,
|
||||
[SPECIES_GOLBAT] = gMonIcon_Golbat,
|
||||
[SPECIES_ODDISH] = gMonIcon_Oddish,
|
||||
[SPECIES_GLOOM] = gMonIcon_Gloom,
|
||||
[SPECIES_VILEPLUME] = gMonIcon_Vileplume,
|
||||
[SPECIES_PARAS] = gMonIcon_Paras,
|
||||
[SPECIES_PARASECT] = gMonIcon_Parasect,
|
||||
[SPECIES_VENONAT] = gMonIcon_Venonat,
|
||||
[SPECIES_VENOMOTH] = gMonIcon_Venomoth,
|
||||
[SPECIES_DIGLETT] = gMonIcon_Diglett,
|
||||
[SPECIES_DUGTRIO] = gMonIcon_Dugtrio,
|
||||
[SPECIES_MEOWTH] = gMonIcon_Meowth,
|
||||
[SPECIES_PERSIAN] = gMonIcon_Persian,
|
||||
[SPECIES_PSYDUCK] = gMonIcon_Psyduck,
|
||||
[SPECIES_GOLDUCK] = gMonIcon_Golduck,
|
||||
[SPECIES_MANKEY] = gMonIcon_Mankey,
|
||||
[SPECIES_PRIMEAPE] = gMonIcon_Primeape,
|
||||
[SPECIES_GROWLITHE] = gMonIcon_Growlithe,
|
||||
[SPECIES_ARCANINE] = gMonIcon_Arcanine,
|
||||
[SPECIES_POLIWAG] = gMonIcon_Poliwag,
|
||||
[SPECIES_POLIWHIRL] = gMonIcon_Poliwhirl,
|
||||
[SPECIES_POLIWRATH] = gMonIcon_Poliwrath,
|
||||
[SPECIES_ABRA] = gMonIcon_Abra,
|
||||
[SPECIES_KADABRA] = gMonIcon_Kadabra,
|
||||
[SPECIES_ALAKAZAM] = gMonIcon_Alakazam,
|
||||
[SPECIES_MACHOP] = gMonIcon_Machop,
|
||||
[SPECIES_MACHOKE] = gMonIcon_Machoke,
|
||||
[SPECIES_MACHAMP] = gMonIcon_Machamp,
|
||||
[SPECIES_BELLSPROUT] = gMonIcon_Bellsprout,
|
||||
[SPECIES_WEEPINBELL] = gMonIcon_Weepinbell,
|
||||
[SPECIES_VICTREEBEL] = gMonIcon_Victreebel,
|
||||
[SPECIES_TENTACOOL] = gMonIcon_Tentacool,
|
||||
[SPECIES_TENTACRUEL] = gMonIcon_Tentacruel,
|
||||
[SPECIES_GEODUDE] = gMonIcon_Geodude,
|
||||
[SPECIES_GRAVELER] = gMonIcon_Graveler,
|
||||
[SPECIES_GOLEM] = gMonIcon_Golem,
|
||||
[SPECIES_PONYTA] = gMonIcon_Ponyta,
|
||||
[SPECIES_RAPIDASH] = gMonIcon_Rapidash,
|
||||
[SPECIES_SLOWPOKE] = gMonIcon_Slowpoke,
|
||||
[SPECIES_SLOWBRO] = gMonIcon_Slowbro,
|
||||
[SPECIES_MAGNEMITE] = gMonIcon_Magnemite,
|
||||
[SPECIES_MAGNETON] = gMonIcon_Magneton,
|
||||
[SPECIES_FARFETCHD] = gMonIcon_Farfetchd,
|
||||
[SPECIES_DODUO] = gMonIcon_Doduo,
|
||||
[SPECIES_DODRIO] = gMonIcon_Dodrio,
|
||||
[SPECIES_SEEL] = gMonIcon_Seel,
|
||||
[SPECIES_DEWGONG] = gMonIcon_Dewgong,
|
||||
[SPECIES_GRIMER] = gMonIcon_Grimer,
|
||||
[SPECIES_MUK] = gMonIcon_Muk,
|
||||
[SPECIES_SHELLDER] = gMonIcon_Shellder,
|
||||
[SPECIES_CLOYSTER] = gMonIcon_Cloyster,
|
||||
[SPECIES_GASTLY] = gMonIcon_Gastly,
|
||||
[SPECIES_HAUNTER] = gMonIcon_Haunter,
|
||||
[SPECIES_GENGAR] = gMonIcon_Gengar,
|
||||
[SPECIES_ONIX] = gMonIcon_Onix,
|
||||
[SPECIES_DROWZEE] = gMonIcon_Drowzee,
|
||||
[SPECIES_HYPNO] = gMonIcon_Hypno,
|
||||
[SPECIES_KRABBY] = gMonIcon_Krabby,
|
||||
[SPECIES_KINGLER] = gMonIcon_Kingler,
|
||||
[SPECIES_VOLTORB] = gMonIcon_Voltorb,
|
||||
[SPECIES_ELECTRODE] = gMonIcon_Electrode,
|
||||
[SPECIES_EXEGGCUTE] = gMonIcon_Exeggcute,
|
||||
[SPECIES_EXEGGUTOR] = gMonIcon_Exeggutor,
|
||||
[SPECIES_CUBONE] = gMonIcon_Cubone,
|
||||
[SPECIES_MAROWAK] = gMonIcon_Marowak,
|
||||
[SPECIES_HITMONLEE] = gMonIcon_Hitmonlee,
|
||||
[SPECIES_HITMONCHAN] = gMonIcon_Hitmonchan,
|
||||
[SPECIES_LICKITUNG] = gMonIcon_Lickitung,
|
||||
[SPECIES_KOFFING] = gMonIcon_Koffing,
|
||||
[SPECIES_WEEZING] = gMonIcon_Weezing,
|
||||
[SPECIES_RHYHORN] = gMonIcon_Rhyhorn,
|
||||
[SPECIES_RHYDON] = gMonIcon_Rhydon,
|
||||
[SPECIES_CHANSEY] = gMonIcon_Chansey,
|
||||
[SPECIES_TANGELA] = gMonIcon_Tangela,
|
||||
[SPECIES_KANGASKHAN] = gMonIcon_Kangaskhan,
|
||||
[SPECIES_HORSEA] = gMonIcon_Horsea,
|
||||
[SPECIES_SEADRA] = gMonIcon_Seadra,
|
||||
[SPECIES_GOLDEEN] = gMonIcon_Goldeen,
|
||||
[SPECIES_SEAKING] = gMonIcon_Seaking,
|
||||
[SPECIES_STARYU] = gMonIcon_Staryu,
|
||||
[SPECIES_STARMIE] = gMonIcon_Starmie,
|
||||
[SPECIES_MR_MIME] = gMonIcon_Mrmime,
|
||||
[SPECIES_SCYTHER] = gMonIcon_Scyther,
|
||||
[SPECIES_JYNX] = gMonIcon_Jynx,
|
||||
[SPECIES_ELECTABUZZ] = gMonIcon_Electabuzz,
|
||||
[SPECIES_MAGMAR] = gMonIcon_Magmar,
|
||||
[SPECIES_PINSIR] = gMonIcon_Pinsir,
|
||||
[SPECIES_TAUROS] = gMonIcon_Tauros,
|
||||
[SPECIES_MAGIKARP] = gMonIcon_Magikarp,
|
||||
[SPECIES_GYARADOS] = gMonIcon_Gyarados,
|
||||
[SPECIES_LAPRAS] = gMonIcon_Lapras,
|
||||
[SPECIES_DITTO] = gMonIcon_Ditto,
|
||||
[SPECIES_EEVEE] = gMonIcon_Eevee,
|
||||
[SPECIES_VAPOREON] = gMonIcon_Vaporeon,
|
||||
[SPECIES_JOLTEON] = gMonIcon_Jolteon,
|
||||
[SPECIES_FLAREON] = gMonIcon_Flareon,
|
||||
[SPECIES_PORYGON] = gMonIcon_Porygon,
|
||||
[SPECIES_OMANYTE] = gMonIcon_Omanyte,
|
||||
[SPECIES_OMASTAR] = gMonIcon_Omastar,
|
||||
[SPECIES_KABUTO] = gMonIcon_Kabuto,
|
||||
[SPECIES_KABUTOPS] = gMonIcon_Kabutops,
|
||||
[SPECIES_AERODACTYL] = gMonIcon_Aerodactyl,
|
||||
[SPECIES_SNORLAX] = gMonIcon_Snorlax,
|
||||
[SPECIES_ARTICUNO] = gMonIcon_Articuno,
|
||||
[SPECIES_ZAPDOS] = gMonIcon_Zapdos,
|
||||
[SPECIES_MOLTRES] = gMonIcon_Moltres,
|
||||
[SPECIES_DRATINI] = gMonIcon_Dratini,
|
||||
[SPECIES_DRAGONAIR] = gMonIcon_Dragonair,
|
||||
[SPECIES_DRAGONITE] = gMonIcon_Dragonite,
|
||||
[SPECIES_MEWTWO] = gMonIcon_Mewtwo,
|
||||
[SPECIES_MEW] = gMonIcon_Mew,
|
||||
[SPECIES_CHIKORITA] = gMonIcon_Chikorita,
|
||||
[SPECIES_BAYLEEF] = gMonIcon_Bayleef,
|
||||
[SPECIES_MEGANIUM] = gMonIcon_Meganium,
|
||||
[SPECIES_CYNDAQUIL] = gMonIcon_Cyndaquil,
|
||||
[SPECIES_QUILAVA] = gMonIcon_Quilava,
|
||||
[SPECIES_TYPHLOSION] = gMonIcon_Typhlosion,
|
||||
[SPECIES_TOTODILE] = gMonIcon_Totodile,
|
||||
[SPECIES_CROCONAW] = gMonIcon_Croconaw,
|
||||
[SPECIES_FERALIGATR] = gMonIcon_Feraligatr,
|
||||
[SPECIES_SENTRET] = gMonIcon_Sentret,
|
||||
[SPECIES_FURRET] = gMonIcon_Furret,
|
||||
[SPECIES_HOOTHOOT] = gMonIcon_Hoothoot,
|
||||
[SPECIES_NOCTOWL] = gMonIcon_Noctowl,
|
||||
[SPECIES_LEDYBA] = gMonIcon_Ledyba,
|
||||
[SPECIES_LEDIAN] = gMonIcon_Ledian,
|
||||
[SPECIES_SPINARAK] = gMonIcon_Spinarak,
|
||||
[SPECIES_ARIADOS] = gMonIcon_Ariados,
|
||||
[SPECIES_CROBAT] = gMonIcon_Crobat,
|
||||
[SPECIES_CHINCHOU] = gMonIcon_Chinchou,
|
||||
[SPECIES_LANTURN] = gMonIcon_Lanturn,
|
||||
[SPECIES_PICHU] = gMonIcon_Pichu,
|
||||
[SPECIES_CLEFFA] = gMonIcon_Cleffa,
|
||||
[SPECIES_IGGLYBUFF] = gMonIcon_Igglybuff,
|
||||
[SPECIES_TOGEPI] = gMonIcon_Togepi,
|
||||
[SPECIES_TOGETIC] = gMonIcon_Togetic,
|
||||
[SPECIES_NATU] = gMonIcon_Natu,
|
||||
[SPECIES_XATU] = gMonIcon_Xatu,
|
||||
[SPECIES_MAREEP] = gMonIcon_Mareep,
|
||||
[SPECIES_FLAAFFY] = gMonIcon_Flaaffy,
|
||||
[SPECIES_AMPHAROS] = gMonIcon_Ampharos,
|
||||
[SPECIES_BELLOSSOM] = gMonIcon_Bellossom,
|
||||
[SPECIES_MARILL] = gMonIcon_Marill,
|
||||
[SPECIES_AZUMARILL] = gMonIcon_Azumarill,
|
||||
[SPECIES_SUDOWOODO] = gMonIcon_Sudowoodo,
|
||||
[SPECIES_POLITOED] = gMonIcon_Politoed,
|
||||
[SPECIES_HOPPIP] = gMonIcon_Hoppip,
|
||||
[SPECIES_SKIPLOOM] = gMonIcon_Skiploom,
|
||||
[SPECIES_JUMPLUFF] = gMonIcon_Jumpluff,
|
||||
[SPECIES_AIPOM] = gMonIcon_Aipom,
|
||||
[SPECIES_SUNKERN] = gMonIcon_Sunkern,
|
||||
[SPECIES_SUNFLORA] = gMonIcon_Sunflora,
|
||||
[SPECIES_YANMA] = gMonIcon_Yanma,
|
||||
[SPECIES_WOOPER] = gMonIcon_Wooper,
|
||||
[SPECIES_QUAGSIRE] = gMonIcon_Quagsire,
|
||||
[SPECIES_ESPEON] = gMonIcon_Espeon,
|
||||
[SPECIES_UMBREON] = gMonIcon_Umbreon,
|
||||
[SPECIES_MURKROW] = gMonIcon_Murkrow,
|
||||
[SPECIES_SLOWKING] = gMonIcon_Slowking,
|
||||
[SPECIES_MISDREAVUS] = gMonIcon_Misdreavus,
|
||||
[SPECIES_UNOWN] = gMonIcon_UnownA,
|
||||
[SPECIES_WOBBUFFET] = gMonIcon_Wobbuffet,
|
||||
[SPECIES_GIRAFARIG] = gMonIcon_Girafarig,
|
||||
[SPECIES_PINECO] = gMonIcon_Pineco,
|
||||
[SPECIES_FORRETRESS] = gMonIcon_Forretress,
|
||||
[SPECIES_DUNSPARCE] = gMonIcon_Dunsparce,
|
||||
[SPECIES_GLIGAR] = gMonIcon_Gligar,
|
||||
[SPECIES_STEELIX] = gMonIcon_Steelix,
|
||||
[SPECIES_SNUBBULL] = gMonIcon_Snubbull,
|
||||
[SPECIES_GRANBULL] = gMonIcon_Granbull,
|
||||
[SPECIES_QWILFISH] = gMonIcon_Qwilfish,
|
||||
[SPECIES_SCIZOR] = gMonIcon_Scizor,
|
||||
[SPECIES_SHUCKLE] = gMonIcon_Shuckle,
|
||||
[SPECIES_HERACROSS] = gMonIcon_Heracross,
|
||||
[SPECIES_SNEASEL] = gMonIcon_Sneasel,
|
||||
[SPECIES_TEDDIURSA] = gMonIcon_Teddiursa,
|
||||
[SPECIES_URSARING] = gMonIcon_Ursaring,
|
||||
[SPECIES_SLUGMA] = gMonIcon_Slugma,
|
||||
[SPECIES_MAGCARGO] = gMonIcon_Magcargo,
|
||||
[SPECIES_SWINUB] = gMonIcon_Swinub,
|
||||
[SPECIES_PILOSWINE] = gMonIcon_Piloswine,
|
||||
[SPECIES_CORSOLA] = gMonIcon_Corsola,
|
||||
[SPECIES_REMORAID] = gMonIcon_Remoraid,
|
||||
[SPECIES_OCTILLERY] = gMonIcon_Octillery,
|
||||
[SPECIES_DELIBIRD] = gMonIcon_Delibird,
|
||||
[SPECIES_MANTINE] = gMonIcon_Mantine,
|
||||
[SPECIES_SKARMORY] = gMonIcon_Skarmory,
|
||||
[SPECIES_HOUNDOUR] = gMonIcon_Houndour,
|
||||
[SPECIES_HOUNDOOM] = gMonIcon_Houndoom,
|
||||
[SPECIES_KINGDRA] = gMonIcon_Kingdra,
|
||||
[SPECIES_PHANPY] = gMonIcon_Phanpy,
|
||||
[SPECIES_DONPHAN] = gMonIcon_Donphan,
|
||||
[SPECIES_PORYGON2] = gMonIcon_Porygon2,
|
||||
[SPECIES_STANTLER] = gMonIcon_Stantler,
|
||||
[SPECIES_SMEARGLE] = gMonIcon_Smeargle,
|
||||
[SPECIES_TYROGUE] = gMonIcon_Tyrogue,
|
||||
[SPECIES_HITMONTOP] = gMonIcon_Hitmontop,
|
||||
[SPECIES_SMOOCHUM] = gMonIcon_Smoochum,
|
||||
[SPECIES_ELEKID] = gMonIcon_Elekid,
|
||||
[SPECIES_MAGBY] = gMonIcon_Magby,
|
||||
[SPECIES_MILTANK] = gMonIcon_Miltank,
|
||||
[SPECIES_BLISSEY] = gMonIcon_Blissey,
|
||||
[SPECIES_RAIKOU] = gMonIcon_Raikou,
|
||||
[SPECIES_ENTEI] = gMonIcon_Entei,
|
||||
[SPECIES_SUICUNE] = gMonIcon_Suicune,
|
||||
[SPECIES_LARVITAR] = gMonIcon_Larvitar,
|
||||
[SPECIES_PUPITAR] = gMonIcon_Pupitar,
|
||||
[SPECIES_TYRANITAR] = gMonIcon_Tyranitar,
|
||||
[SPECIES_LUGIA] = gMonIcon_Lugia,
|
||||
[SPECIES_HO_OH] = gMonIcon_HoOh,
|
||||
[SPECIES_CELEBI] = gMonIcon_Celebi,
|
||||
[SPECIES_OLD_UNOWN_B] = gMonIcon_QuestionMark,
|
||||
[SPECIES_OLD_UNOWN_C] = gMonIcon_QuestionMark,
|
||||
[SPECIES_OLD_UNOWN_D] = gMonIcon_QuestionMark,
|
||||
[SPECIES_OLD_UNOWN_E] = gMonIcon_QuestionMark,
|
||||
[SPECIES_OLD_UNOWN_F] = gMonIcon_QuestionMark,
|
||||
[SPECIES_OLD_UNOWN_G] = gMonIcon_QuestionMark,
|
||||
[SPECIES_OLD_UNOWN_H] = gMonIcon_QuestionMark,
|
||||
[SPECIES_OLD_UNOWN_I] = gMonIcon_QuestionMark,
|
||||
[SPECIES_OLD_UNOWN_J] = gMonIcon_QuestionMark,
|
||||
[SPECIES_OLD_UNOWN_K] = gMonIcon_QuestionMark,
|
||||
[SPECIES_OLD_UNOWN_L] = gMonIcon_QuestionMark,
|
||||
[SPECIES_OLD_UNOWN_M] = gMonIcon_QuestionMark,
|
||||
[SPECIES_OLD_UNOWN_N] = gMonIcon_QuestionMark,
|
||||
[SPECIES_OLD_UNOWN_O] = gMonIcon_QuestionMark,
|
||||
[SPECIES_OLD_UNOWN_P] = gMonIcon_QuestionMark,
|
||||
[SPECIES_OLD_UNOWN_Q] = gMonIcon_QuestionMark,
|
||||
[SPECIES_OLD_UNOWN_R] = gMonIcon_QuestionMark,
|
||||
[SPECIES_OLD_UNOWN_S] = gMonIcon_QuestionMark,
|
||||
[SPECIES_OLD_UNOWN_T] = gMonIcon_QuestionMark,
|
||||
[SPECIES_OLD_UNOWN_U] = gMonIcon_QuestionMark,
|
||||
[SPECIES_OLD_UNOWN_V] = gMonIcon_QuestionMark,
|
||||
[SPECIES_OLD_UNOWN_W] = gMonIcon_QuestionMark,
|
||||
[SPECIES_OLD_UNOWN_X] = gMonIcon_QuestionMark,
|
||||
[SPECIES_OLD_UNOWN_Y] = gMonIcon_QuestionMark,
|
||||
[SPECIES_OLD_UNOWN_Z] = gMonIcon_QuestionMark,
|
||||
[SPECIES_TREECKO] = gMonIcon_Treecko,
|
||||
[SPECIES_GROVYLE] = gMonIcon_Grovyle,
|
||||
[SPECIES_SCEPTILE] = gMonIcon_Sceptile,
|
||||
[SPECIES_TORCHIC] = gMonIcon_Torchic,
|
||||
[SPECIES_COMBUSKEN] = gMonIcon_Combusken,
|
||||
[SPECIES_BLAZIKEN] = gMonIcon_Blaziken,
|
||||
[SPECIES_MUDKIP] = gMonIcon_Mudkip,
|
||||
[SPECIES_MARSHTOMP] = gMonIcon_Marshtomp,
|
||||
[SPECIES_SWAMPERT] = gMonIcon_Swampert,
|
||||
[SPECIES_POOCHYENA] = gMonIcon_Poochyena,
|
||||
[SPECIES_MIGHTYENA] = gMonIcon_Mightyena,
|
||||
[SPECIES_ZIGZAGOON] = gMonIcon_Zigzagoon,
|
||||
[SPECIES_LINOONE] = gMonIcon_Linoone,
|
||||
[SPECIES_WURMPLE] = gMonIcon_Wurmple,
|
||||
[SPECIES_SILCOON] = gMonIcon_Silcoon,
|
||||
[SPECIES_BEAUTIFLY] = gMonIcon_Beautifly,
|
||||
[SPECIES_CASCOON] = gMonIcon_Cascoon,
|
||||
[SPECIES_DUSTOX] = gMonIcon_Dustox,
|
||||
[SPECIES_LOTAD] = gMonIcon_Lotad,
|
||||
[SPECIES_LOMBRE] = gMonIcon_Lombre,
|
||||
[SPECIES_LUDICOLO] = gMonIcon_Ludicolo,
|
||||
[SPECIES_SEEDOT] = gMonIcon_Seedot,
|
||||
[SPECIES_NUZLEAF] = gMonIcon_Nuzleaf,
|
||||
[SPECIES_SHIFTRY] = gMonIcon_Shiftry,
|
||||
[SPECIES_NINCADA] = gMonIcon_Nincada,
|
||||
[SPECIES_NINJASK] = gMonIcon_Ninjask,
|
||||
[SPECIES_SHEDINJA] = gMonIcon_Shedinja,
|
||||
[SPECIES_TAILLOW] = gMonIcon_Taillow,
|
||||
[SPECIES_SWELLOW] = gMonIcon_Swellow,
|
||||
[SPECIES_SHROOMISH] = gMonIcon_Shroomish,
|
||||
[SPECIES_BRELOOM] = gMonIcon_Breloom,
|
||||
[SPECIES_SPINDA] = gMonIcon_Spinda,
|
||||
[SPECIES_WINGULL] = gMonIcon_Wingull,
|
||||
[SPECIES_PELIPPER] = gMonIcon_Pelipper,
|
||||
[SPECIES_SURSKIT] = gMonIcon_Surskit,
|
||||
[SPECIES_MASQUERAIN] = gMonIcon_Masquerain,
|
||||
[SPECIES_WAILMER] = gMonIcon_Wailmer,
|
||||
[SPECIES_WAILORD] = gMonIcon_Wailord,
|
||||
[SPECIES_SKITTY] = gMonIcon_Skitty,
|
||||
[SPECIES_DELCATTY] = gMonIcon_Delcatty,
|
||||
[SPECIES_KECLEON] = gMonIcon_Kecleon,
|
||||
[SPECIES_BALTOY] = gMonIcon_Baltoy,
|
||||
[SPECIES_CLAYDOL] = gMonIcon_Claydol,
|
||||
[SPECIES_NOSEPASS] = gMonIcon_Nosepass,
|
||||
[SPECIES_TORKOAL] = gMonIcon_Torkoal,
|
||||
[SPECIES_SABLEYE] = gMonIcon_Sableye,
|
||||
[SPECIES_BARBOACH] = gMonIcon_Barboach,
|
||||
[SPECIES_WHISCASH] = gMonIcon_Whiscash,
|
||||
[SPECIES_LUVDISC] = gMonIcon_Luvdisc,
|
||||
[SPECIES_CORPHISH] = gMonIcon_Corphish,
|
||||
[SPECIES_CRAWDAUNT] = gMonIcon_Crawdaunt,
|
||||
[SPECIES_FEEBAS] = gMonIcon_Feebas,
|
||||
[SPECIES_MILOTIC] = gMonIcon_Milotic,
|
||||
[SPECIES_CARVANHA] = gMonIcon_Carvanha,
|
||||
[SPECIES_SHARPEDO] = gMonIcon_Sharpedo,
|
||||
[SPECIES_TRAPINCH] = gMonIcon_Trapinch,
|
||||
[SPECIES_VIBRAVA] = gMonIcon_Vibrava,
|
||||
[SPECIES_FLYGON] = gMonIcon_Flygon,
|
||||
[SPECIES_MAKUHITA] = gMonIcon_Makuhita,
|
||||
[SPECIES_HARIYAMA] = gMonIcon_Hariyama,
|
||||
[SPECIES_ELECTRIKE] = gMonIcon_Electrike,
|
||||
[SPECIES_MANECTRIC] = gMonIcon_Manectric,
|
||||
[SPECIES_NUMEL] = gMonIcon_Numel,
|
||||
[SPECIES_CAMERUPT] = gMonIcon_Camerupt,
|
||||
[SPECIES_SPHEAL] = gMonIcon_Spheal,
|
||||
[SPECIES_SEALEO] = gMonIcon_Sealeo,
|
||||
[SPECIES_WALREIN] = gMonIcon_Walrein,
|
||||
[SPECIES_CACNEA] = gMonIcon_Cacnea,
|
||||
[SPECIES_CACTURNE] = gMonIcon_Cacturne,
|
||||
[SPECIES_SNORUNT] = gMonIcon_Snorunt,
|
||||
[SPECIES_GLALIE] = gMonIcon_Glalie,
|
||||
[SPECIES_LUNATONE] = gMonIcon_Lunatone,
|
||||
[SPECIES_SOLROCK] = gMonIcon_Solrock,
|
||||
[SPECIES_AZURILL] = gMonIcon_Azurill,
|
||||
[SPECIES_SPOINK] = gMonIcon_Spoink,
|
||||
[SPECIES_GRUMPIG] = gMonIcon_Grumpig,
|
||||
[SPECIES_PLUSLE] = gMonIcon_Plusle,
|
||||
[SPECIES_MINUN] = gMonIcon_Minun,
|
||||
[SPECIES_MAWILE] = gMonIcon_Mawile,
|
||||
[SPECIES_MEDITITE] = gMonIcon_Meditite,
|
||||
[SPECIES_MEDICHAM] = gMonIcon_Medicham,
|
||||
[SPECIES_SWABLU] = gMonIcon_Swablu,
|
||||
[SPECIES_ALTARIA] = gMonIcon_Altaria,
|
||||
[SPECIES_WYNAUT] = gMonIcon_Wynaut,
|
||||
[SPECIES_DUSKULL] = gMonIcon_Duskull,
|
||||
[SPECIES_DUSCLOPS] = gMonIcon_Dusclops,
|
||||
[SPECIES_ROSELIA] = gMonIcon_Roselia,
|
||||
[SPECIES_SLAKOTH] = gMonIcon_Slakoth,
|
||||
[SPECIES_VIGOROTH] = gMonIcon_Vigoroth,
|
||||
[SPECIES_SLAKING] = gMonIcon_Slaking,
|
||||
[SPECIES_GULPIN] = gMonIcon_Gulpin,
|
||||
[SPECIES_SWALOT] = gMonIcon_Swalot,
|
||||
[SPECIES_TROPIUS] = gMonIcon_Tropius,
|
||||
[SPECIES_WHISMUR] = gMonIcon_Whismur,
|
||||
[SPECIES_LOUDRED] = gMonIcon_Loudred,
|
||||
[SPECIES_EXPLOUD] = gMonIcon_Exploud,
|
||||
[SPECIES_CLAMPERL] = gMonIcon_Clamperl,
|
||||
[SPECIES_HUNTAIL] = gMonIcon_Huntail,
|
||||
[SPECIES_GOREBYSS] = gMonIcon_Gorebyss,
|
||||
[SPECIES_ABSOL] = gMonIcon_Absol,
|
||||
[SPECIES_SHUPPET] = gMonIcon_Shuppet,
|
||||
[SPECIES_BANETTE] = gMonIcon_Banette,
|
||||
[SPECIES_SEVIPER] = gMonIcon_Seviper,
|
||||
[SPECIES_ZANGOOSE] = gMonIcon_Zangoose,
|
||||
[SPECIES_RELICANTH] = gMonIcon_Relicanth,
|
||||
[SPECIES_ARON] = gMonIcon_Aron,
|
||||
[SPECIES_LAIRON] = gMonIcon_Lairon,
|
||||
[SPECIES_AGGRON] = gMonIcon_Aggron,
|
||||
[SPECIES_CASTFORM] = gMonIcon_Castform,
|
||||
[SPECIES_VOLBEAT] = gMonIcon_Volbeat,
|
||||
[SPECIES_ILLUMISE] = gMonIcon_Illumise,
|
||||
[SPECIES_LILEEP] = gMonIcon_Lileep,
|
||||
[SPECIES_CRADILY] = gMonIcon_Cradily,
|
||||
[SPECIES_ANORITH] = gMonIcon_Anorith,
|
||||
[SPECIES_ARMALDO] = gMonIcon_Armaldo,
|
||||
[SPECIES_RALTS] = gMonIcon_Ralts,
|
||||
[SPECIES_KIRLIA] = gMonIcon_Kirlia,
|
||||
[SPECIES_GARDEVOIR] = gMonIcon_Gardevoir,
|
||||
[SPECIES_BAGON] = gMonIcon_Bagon,
|
||||
[SPECIES_SHELGON] = gMonIcon_Shelgon,
|
||||
[SPECIES_SALAMENCE] = gMonIcon_Salamence,
|
||||
[SPECIES_BELDUM] = gMonIcon_Beldum,
|
||||
[SPECIES_METANG] = gMonIcon_Metang,
|
||||
[SPECIES_METAGROSS] = gMonIcon_Metagross,
|
||||
[SPECIES_REGIROCK] = gMonIcon_Regirock,
|
||||
[SPECIES_REGICE] = gMonIcon_Regice,
|
||||
[SPECIES_REGISTEEL] = gMonIcon_Registeel,
|
||||
[SPECIES_KYOGRE] = gMonIcon_Kyogre,
|
||||
[SPECIES_GROUDON] = gMonIcon_Groudon,
|
||||
[SPECIES_RAYQUAZA] = gMonIcon_Rayquaza,
|
||||
[SPECIES_LATIAS] = gMonIcon_Latias,
|
||||
[SPECIES_LATIOS] = gMonIcon_Latios,
|
||||
[SPECIES_JIRACHI] = gMonIcon_Jirachi,
|
||||
[SPECIES_DEOXYS] = gMonIcon_Deoxys,
|
||||
[SPECIES_CHIMECHO] = gMonIcon_Chimecho,
|
||||
[SPECIES_EGG] = gMonIcon_Egg,
|
||||
[SPECIES_UNOWN_B] = gMonIcon_UnownB,
|
||||
[SPECIES_UNOWN_C] = gMonIcon_UnownC,
|
||||
[SPECIES_UNOWN_D] = gMonIcon_UnownD,
|
||||
[SPECIES_UNOWN_E] = gMonIcon_UnownE,
|
||||
[SPECIES_UNOWN_F] = gMonIcon_UnownF,
|
||||
[SPECIES_UNOWN_G] = gMonIcon_UnownG,
|
||||
[SPECIES_UNOWN_H] = gMonIcon_UnownH,
|
||||
[SPECIES_UNOWN_I] = gMonIcon_UnownI,
|
||||
[SPECIES_UNOWN_J] = gMonIcon_UnownJ,
|
||||
[SPECIES_UNOWN_K] = gMonIcon_UnownK,
|
||||
[SPECIES_UNOWN_L] = gMonIcon_UnownL,
|
||||
[SPECIES_UNOWN_M] = gMonIcon_UnownM,
|
||||
[SPECIES_UNOWN_N] = gMonIcon_UnownN,
|
||||
[SPECIES_UNOWN_O] = gMonIcon_UnownO,
|
||||
[SPECIES_UNOWN_P] = gMonIcon_UnownP,
|
||||
[SPECIES_UNOWN_Q] = gMonIcon_UnownQ,
|
||||
[SPECIES_UNOWN_R] = gMonIcon_UnownR,
|
||||
[SPECIES_UNOWN_S] = gMonIcon_UnownS,
|
||||
[SPECIES_UNOWN_T] = gMonIcon_UnownT,
|
||||
[SPECIES_UNOWN_U] = gMonIcon_UnownU,
|
||||
[SPECIES_UNOWN_V] = gMonIcon_UnownV,
|
||||
[SPECIES_UNOWN_W] = gMonIcon_UnownW,
|
||||
[SPECIES_UNOWN_X] = gMonIcon_UnownX,
|
||||
[SPECIES_UNOWN_Y] = gMonIcon_UnownY,
|
||||
[SPECIES_UNOWN_Z] = gMonIcon_UnownZ,
|
||||
[SPECIES_UNOWN_EMARK] = gMonIcon_UnownExclamationMark,
|
||||
[SPECIES_UNOWN_QMARK] = gMonIcon_UnownQuestionMark,
|
||||
};
|
||||
|
||||
const u8 gMonIconPaletteIndices[] =
|
||||
@@ -927,18 +927,15 @@ const struct SpritePalette gMonIconPaletteTable[] =
|
||||
const struct OamData sMonIconOamData =
|
||||
{
|
||||
.y = 0,
|
||||
.affineMode = 0,
|
||||
.objMode = 0,
|
||||
.mosaic = 0,
|
||||
.bpp = 0,
|
||||
.affineMode = ST_OAM_AFFINE_OFF,
|
||||
.objMode = ST_OAM_OBJ_NORMAL,
|
||||
.bpp = ST_OAM_4BPP,
|
||||
.shape = SPRITE_SHAPE(32x32),
|
||||
.x = 0,
|
||||
.matrixNum = 0,
|
||||
.size = SPRITE_SIZE(32x32),
|
||||
.tileNum = 0,
|
||||
.priority = 1,
|
||||
.paletteNum = 0,
|
||||
.affineParam = 0
|
||||
};
|
||||
|
||||
// fastest to slowest
|
||||
@@ -1141,7 +1138,7 @@ void sub_80D2EF8(struct Sprite *sprite)
|
||||
void LoadMonIconPalettes(void)
|
||||
{
|
||||
u8 i;
|
||||
for (i = 0; i < 6; i++)
|
||||
for (i = 0; i < ARRAY_COUNT(gMonIconPaletteTable); i++)
|
||||
LoadSpritePalette(&gMonIconPaletteTable[i]);
|
||||
}
|
||||
|
||||
@@ -1195,7 +1192,7 @@ void sub_80D3014(struct Sprite *sprite)
|
||||
const u8* GetMonIconTiles(u16 species, bool32 extra)
|
||||
{
|
||||
const u8* iconSprite = gMonIconTable[species];
|
||||
if(species == SPECIES_DEOXYS && extra == TRUE)
|
||||
if (species == SPECIES_DEOXYS && extra == TRUE)
|
||||
{
|
||||
iconSprite = (const u8*)(0x400 + (u32)iconSprite); //WTF?
|
||||
}
|
||||
|
||||
@@ -4419,7 +4419,7 @@ static void PrintStorageActionText(u8 id)
|
||||
DynamicPlaceholderTextUtil_ExpandPlaceholders(sPSSData->field_2190, gPCStorageActionTexts[id].text);
|
||||
FillWindowPixelBuffer(1, PIXEL_FILL(1));
|
||||
AddTextPrinterParameterized(1, 1, sPSSData->field_2190, 0, 1, TEXT_SPEED_FF, NULL);
|
||||
sub_8098858(1, 2, 14);
|
||||
DrawTextBorderOuter(1, 2, 14);
|
||||
PutWindowTilemap(1);
|
||||
CopyWindowToVram(1, 2);
|
||||
schedule_bg_copy_tilemap_to_vram(0);
|
||||
|
||||
+218
-42
@@ -73,22 +73,17 @@ struct MatchCallStruct4 {
|
||||
const match_call_text_data_t *textData;
|
||||
};
|
||||
|
||||
// Note: Type1 and Type5 have identical struct layouts.
|
||||
struct MatchCallStruct5 {
|
||||
u8 type;
|
||||
u8 v1;
|
||||
u16 flag;
|
||||
u16 v4;
|
||||
u16 rematchTableIdx;
|
||||
const u8 *desc;
|
||||
const u8 *name;
|
||||
const match_call_text_data_t *textData;
|
||||
};
|
||||
|
||||
#define MATCHCALLDEF(name, type_, ...) \
|
||||
static const struct MatchCallStruct##type_ name = { \
|
||||
.type = type_, \
|
||||
__VA_ARGS__ \
|
||||
};
|
||||
|
||||
typedef union {
|
||||
const struct MatchCallStructCommon *common;
|
||||
const struct MatchCallStruct0 *type0;
|
||||
@@ -328,7 +323,15 @@ static const match_call_text_data_t sMrStoneTextScripts[] = {
|
||||
{ NULL, 0xFFFF, 0xFFFF }
|
||||
};
|
||||
|
||||
MATCHCALLDEF(sMrStoneMatchCallHeader, 0, 10, 0xffff, gMrStoneMatchCallDesc, gMrStoneMatchCallName, sMrStoneTextScripts);
|
||||
static const struct MatchCallStruct0 sMrStoneMatchCallHeader =
|
||||
{
|
||||
.type = 0,
|
||||
.v1 = 10,
|
||||
.flag = 0xFFFF,
|
||||
.desc = gMrStoneMatchCallDesc,
|
||||
.name = gMrStoneMatchCallName,
|
||||
.textData = sMrStoneTextScripts
|
||||
};
|
||||
|
||||
static const match_call_text_data_t sNormanTextScripts[] = {
|
||||
{ gText_Norman_Pokenav_2B5719, FLAG_ENABLE_NORMAN_MATCH_CALL, 0xFFFF },
|
||||
@@ -343,9 +346,25 @@ static const match_call_text_data_t sNormanTextScripts[] = {
|
||||
{ NULL, 0xFFFF, 0xFFFF }
|
||||
};
|
||||
|
||||
MATCHCALLDEF(sNormanMatchCallHeader, 5, 7, FLAG_ENABLE_NORMAN_MATCH_CALL, 0x45, gNormanMatchCallDesc, gNormanMatchCallName, sNormanTextScripts);
|
||||
static const struct MatchCallStruct5 sNormanMatchCallHeader =
|
||||
{
|
||||
.type = 5,
|
||||
.v1 = 7,
|
||||
.flag = FLAG_ENABLE_NORMAN_MATCH_CALL,
|
||||
.rematchTableIdx = REMATCH_NORMAN,
|
||||
.desc = gNormanMatchCallDesc,
|
||||
.name = gNormanMatchCallName,
|
||||
.textData = sNormanTextScripts
|
||||
};
|
||||
|
||||
MATCHCALLDEF(sProfBirchMatchCallHeader, 3, 0, FLAG_ENABLE_PROF_BIRCH_MATCH_CALL, gProfBirchMatchCallDesc, gProfBirchMatchCallName)
|
||||
static const struct MatchCallStruct3 sProfBirchMatchCallHeader =
|
||||
{
|
||||
.type = 3,
|
||||
.v1 = 0,
|
||||
.flag = FLAG_ENABLE_PROF_BIRCH_MATCH_CALL,
|
||||
.desc = gProfBirchMatchCallDesc,
|
||||
.name = gProfBirchMatchCallName
|
||||
};
|
||||
|
||||
static const match_call_text_data_t sMomTextScripts[] = {
|
||||
{ gText_Mom_Pokenav_2B227B, 0xffff, 0xffff },
|
||||
@@ -354,7 +373,15 @@ static const match_call_text_data_t sMomTextScripts[] = {
|
||||
{ NULL, 0xffff, 0xffff }
|
||||
};
|
||||
|
||||
MATCHCALLDEF(sMomMatchCallHeader, 0, 0, FLAG_ENABLE_MOM_MATCH_CALL, gMomMatchCallDesc, gMomMatchCallName, sMomTextScripts);
|
||||
static const struct MatchCallStruct0 sMomMatchCallHeader =
|
||||
{
|
||||
.type = 0,
|
||||
.v1 = 0,
|
||||
.flag = FLAG_ENABLE_MOM_MATCH_CALL,
|
||||
.desc = gMomMatchCallDesc,
|
||||
.name = gMomMatchCallName,
|
||||
.textData = sMomTextScripts
|
||||
};
|
||||
|
||||
static const match_call_text_data_t sStevenTextScripts[] = {
|
||||
{ gText_Steven_Pokenav_2B5B95, 0xffff, 0xffff },
|
||||
@@ -367,7 +394,15 @@ static const match_call_text_data_t sStevenTextScripts[] = {
|
||||
{ NULL, 0xffff, 0xffff },
|
||||
};
|
||||
|
||||
MATCHCALLDEF(sStevenMatchCallHeader, 0, 0xd5, FLAG_REGISTERED_STEVEN_POKENAV, gStevenMatchCallDesc, gStevenMatchCallName, sStevenTextScripts);
|
||||
static const struct MatchCallStruct0 sStevenMatchCallHeader =
|
||||
{
|
||||
.type = 0,
|
||||
.v1 = 0xD5,
|
||||
.flag = FLAG_REGISTERED_STEVEN_POKENAV,
|
||||
.desc = gStevenMatchCallDesc,
|
||||
.name = gStevenMatchCallName,
|
||||
.textData = sStevenTextScripts
|
||||
};
|
||||
|
||||
static const match_call_text_data_t sMayTextScripts[] = {
|
||||
{ gText_May_Pokenav_2B3AB3, 0xFFFF, 0xFFFF },
|
||||
@@ -388,7 +423,15 @@ static const match_call_text_data_t sMayTextScripts[] = {
|
||||
{ NULL, 0xFFFF, 0xFFFF }
|
||||
};
|
||||
|
||||
MATCHCALLDEF(sMayMatchCallHeader, 4, MALE, FLAG_ENABLE_RIVAL_MATCH_CALL, gMayBrendanMatchCallDesc, gExpandedPlaceholder_May, sMayTextScripts);
|
||||
static const struct MatchCallStruct4 sMayMatchCallHeader =
|
||||
{
|
||||
.type = 4,
|
||||
.gender = MALE,
|
||||
.flag = FLAG_ENABLE_RIVAL_MATCH_CALL,
|
||||
.desc = gMayBrendanMatchCallDesc,
|
||||
.name = gExpandedPlaceholder_May,
|
||||
.textData = sMayTextScripts
|
||||
};
|
||||
|
||||
static const match_call_text_data_t sBrendanTextScripts[] = {
|
||||
{ gText_Brendan_Pokenav_2B43EF, 0xFFFF, 0xFFFF },
|
||||
@@ -409,7 +452,15 @@ static const match_call_text_data_t sBrendanTextScripts[] = {
|
||||
{ NULL, 0xFFFF, 0xFFFF }
|
||||
};
|
||||
|
||||
MATCHCALLDEF(sBrendanMatchCallHeader, 4, FEMALE, FLAG_ENABLE_RIVAL_MATCH_CALL, gMayBrendanMatchCallDesc, gExpandedPlaceholder_Brendan, sBrendanTextScripts);
|
||||
static const struct MatchCallStruct4 sBrendanMatchCallHeader =
|
||||
{
|
||||
.type = 4,
|
||||
.gender = FEMALE,
|
||||
.flag = FLAG_ENABLE_RIVAL_MATCH_CALL,
|
||||
.desc = gMayBrendanMatchCallDesc,
|
||||
.name = gExpandedPlaceholder_Brendan,
|
||||
.textData = sBrendanTextScripts
|
||||
};
|
||||
|
||||
static const match_call_text_data_t sWallyTextScripts[] = {
|
||||
{ gText_Wally_Pokenav_2B4DE2, 0xFFFF, 0xFFFF },
|
||||
@@ -429,7 +480,16 @@ const struct MatchCallSubstruct2 sWallyAdditionalData[] = {
|
||||
{ 0xFFFF, 0xD5 }
|
||||
};
|
||||
|
||||
MATCHCALLDEF(sWallyMatchCallHeader, 2, 0, FLAG_ENABLE_WALLY_MATCH_CALL, REMATCH_WALLY_3, gWallyMatchCallDesc, sWallyTextScripts, sWallyAdditionalData);
|
||||
static const struct MatchCallStruct2 sWallyMatchCallHeader =
|
||||
{
|
||||
.type = 2,
|
||||
.v1 = 0,
|
||||
.flag = FLAG_ENABLE_WALLY_MATCH_CALL,
|
||||
.rematchTableIdx = REMATCH_WALLY_3,
|
||||
.desc = gWallyMatchCallDesc,
|
||||
.textData = sWallyTextScripts,
|
||||
.v10 = sWallyAdditionalData
|
||||
};
|
||||
|
||||
static const match_call_text_data_t sScottTextScripts[] = {
|
||||
{ gText_Scott_Pokenav_2B5184, 0xFFFF, 0xFFFF },
|
||||
@@ -443,7 +503,15 @@ static const match_call_text_data_t sScottTextScripts[] = {
|
||||
};
|
||||
|
||||
|
||||
MATCHCALLDEF(sScottMatchCallHeader, 0, 0xD5, FLAG_ENABLE_SCOTT_MATCH_CALL, gScottMatchCallDesc, gScottMatchCallName, sScottTextScripts);
|
||||
static const struct MatchCallStruct0 sScottMatchCallHeader =
|
||||
{
|
||||
.type = 0,
|
||||
.v1 = 0xD5,
|
||||
.flag = FLAG_ENABLE_SCOTT_MATCH_CALL,
|
||||
.desc = gScottMatchCallDesc,
|
||||
.name = gScottMatchCallName,
|
||||
.textData = sScottTextScripts
|
||||
};
|
||||
|
||||
static const match_call_text_data_t sRoxanneTextScripts[] = {
|
||||
{ gText_Roxanne_Pokenav_2B2456, 0xFFFE, 0xFFFF },
|
||||
@@ -453,7 +521,16 @@ static const match_call_text_data_t sRoxanneTextScripts[] = {
|
||||
{ NULL, 0xFFFF, 0xFFFF }
|
||||
};
|
||||
|
||||
MATCHCALLDEF(sRoxanneMatchCallHeader, 5, 10, FLAG_ENABLE_ROXANNE_MATCH_CALL, 0x41, gRoxanneMatchCallDesc, NULL, sRoxanneTextScripts);
|
||||
static const struct MatchCallStruct5 sRoxanneMatchCallHeader =
|
||||
{
|
||||
.type = 5,
|
||||
.v1 = 10,
|
||||
.flag = FLAG_ENABLE_ROXANNE_MATCH_CALL,
|
||||
.rematchTableIdx = REMATCH_ROXANNE,
|
||||
.desc = gRoxanneMatchCallDesc,
|
||||
.name = NULL,
|
||||
.textData = sRoxanneTextScripts
|
||||
};
|
||||
|
||||
static const match_call_text_data_t sBrawlyTextScripts[] = {
|
||||
{ gText_Brawly_Pokenav_2B2659, 0xFFFE, 0xFFFF },
|
||||
@@ -463,7 +540,16 @@ static const match_call_text_data_t sBrawlyTextScripts[] = {
|
||||
{ NULL, 0xFFFF, 0xFFFF }
|
||||
};
|
||||
|
||||
MATCHCALLDEF(sBrawlyMatchCallHeader, 5, 2, FLAG_ENABLE_BRAWLY_MATCH_CALL, 0x42, gBrawlyMatchCallDesc, NULL, sBrawlyTextScripts);
|
||||
static const struct MatchCallStruct5 sBrawlyMatchCallHeader =
|
||||
{
|
||||
.type = 5,
|
||||
.v1 = 2,
|
||||
.flag = FLAG_ENABLE_BRAWLY_MATCH_CALL,
|
||||
.rematchTableIdx = REMATCH_BRAWLY,
|
||||
.desc = gBrawlyMatchCallDesc,
|
||||
.name = NULL,
|
||||
.textData = sBrawlyTextScripts
|
||||
};
|
||||
|
||||
static const match_call_text_data_t sWattsonTextScripts[] = {
|
||||
{ gText_Wattson_Pokenav_2B2912, 0xFFFE, 0xFFFF },
|
||||
@@ -473,7 +559,16 @@ static const match_call_text_data_t sWattsonTextScripts[] = {
|
||||
{ NULL, 0xFFFF, 0xFFFF }
|
||||
};
|
||||
|
||||
MATCHCALLDEF(sWattsonMatchCallHeader, 5, 9, FLAG_ENABLE_WATTSON_MATCH_CALL, 0x43, gWattsonMatchCallDesc, NULL, sWattsonTextScripts);
|
||||
static const struct MatchCallStruct5 sWattsonMatchCallHeader =
|
||||
{
|
||||
.type = 5,
|
||||
.v1 = 9,
|
||||
.flag = FLAG_ENABLE_WATTSON_MATCH_CALL,
|
||||
.rematchTableIdx = REMATCH_WATTSON,
|
||||
.desc = gWattsonMatchCallDesc,
|
||||
.name = NULL,
|
||||
.textData = sWattsonTextScripts
|
||||
};
|
||||
|
||||
static const match_call_text_data_t sFlanneryTextScripts[] = {
|
||||
{ gText_Flannery_Pokenav_2B2B4D, 0xFFFE, 0xFFFF },
|
||||
@@ -483,7 +578,16 @@ static const match_call_text_data_t sFlanneryTextScripts[] = {
|
||||
{ NULL, 0xFFFF, 0xFFFF }
|
||||
};
|
||||
|
||||
MATCHCALLDEF(sFlanneryMatchCallHeader, 5, 3, FLAG_ENABLE_FLANNERY_MATCH_CALL, 0x44, gFlanneryMatchCallDesc, NULL, sFlanneryTextScripts);
|
||||
static const struct MatchCallStruct5 sFlanneryMatchCallHeader =
|
||||
{
|
||||
.type = 5,
|
||||
.v1 = 3,
|
||||
.flag = FLAG_ENABLE_FLANNERY_MATCH_CALL,
|
||||
.rematchTableIdx = REMATCH_FLANNERY,
|
||||
.desc = gFlanneryMatchCallDesc,
|
||||
.name = NULL,
|
||||
.textData = sFlanneryTextScripts
|
||||
};
|
||||
|
||||
static const match_call_text_data_t sWinonaTextScripts[] = {
|
||||
{ gText_Winona_Pokenav_2B2DA4, 0xFFFE, 0xFFFF },
|
||||
@@ -493,7 +597,16 @@ static const match_call_text_data_t sWinonaTextScripts[] = {
|
||||
{ NULL, 0xFFFF, 0xFFFF }
|
||||
};
|
||||
|
||||
MATCHCALLDEF(sWinonaMatchCallHeader, 5, 11, FLAG_ENABLE_WINONA_MATCH_CALL, 0x46, gWinonaMatchCallDesc, NULL, sWinonaTextScripts);
|
||||
static const struct MatchCallStruct5 sWinonaMatchCallHeader =
|
||||
{
|
||||
.type = 5,
|
||||
.v1 = 11,
|
||||
.flag = FLAG_ENABLE_WINONA_MATCH_CALL,
|
||||
.rematchTableIdx = REMATCH_WINONA,
|
||||
.desc = gWinonaMatchCallDesc,
|
||||
.name = NULL,
|
||||
.textData = sWinonaTextScripts
|
||||
};
|
||||
|
||||
static const match_call_text_data_t sTateLizaTextScripts[] = {
|
||||
{ gText_TateLiza_Pokenav_2B2F97, 0xFFFE, 0xFFFF },
|
||||
@@ -503,7 +616,16 @@ static const match_call_text_data_t sTateLizaTextScripts[] = {
|
||||
{ NULL, 0xFFFF, 0xFFFF }
|
||||
};
|
||||
|
||||
MATCHCALLDEF(sTateLizaMatchCallHeader, 5, 13, FLAG_ENABLE_TATE_AND_LIZA_MATCH_CALL, 0x47, gTateLizaMatchCallDesc, NULL, sTateLizaTextScripts);
|
||||
static const struct MatchCallStruct5 sTateLizaMatchCallHeader =
|
||||
{
|
||||
.type = 5,
|
||||
.v1 = 13,
|
||||
.flag = FLAG_ENABLE_TATE_AND_LIZA_MATCH_CALL,
|
||||
.rematchTableIdx = REMATCH_TATE_AND_LIZA,
|
||||
.desc = gTateLizaMatchCallDesc,
|
||||
.name = NULL,
|
||||
.textData = sTateLizaTextScripts
|
||||
};
|
||||
|
||||
static const match_call_text_data_t sJuanTextScripts[] = {
|
||||
{ gText_Juan_Pokenav_2B3249, 0xFFFE, 0xFFFF },
|
||||
@@ -513,42 +635,96 @@ static const match_call_text_data_t sJuanTextScripts[] = {
|
||||
{ NULL, 0xFFFF, 0xFFFF }
|
||||
};
|
||||
|
||||
MATCHCALLDEF(sJuanMatchCallHeader, 5, 14, FLAG_ENABLE_JUAN_MATCH_CALL, 0x48, gJuanMatchCallDesc, NULL, sJuanTextScripts);
|
||||
static const struct MatchCallStruct5 sJuanMatchCallHeader =
|
||||
{
|
||||
.type = 5,
|
||||
.v1 = 14,
|
||||
.flag = FLAG_ENABLE_JUAN_MATCH_CALL,
|
||||
.rematchTableIdx = REMATCH_JUAN,
|
||||
.desc = gJuanMatchCallDesc,
|
||||
.name = NULL,
|
||||
.textData = sJuanTextScripts
|
||||
};
|
||||
|
||||
static const match_call_text_data_t sSidneyTextScripts[] = {
|
||||
{ gText_Sidney_Pokenav_2B34CC, 0xFFFF, 0xFFFF },
|
||||
{ NULL, 0xFFFF, 0xFFFF }
|
||||
};
|
||||
|
||||
MATCHCALLDEF(sSidneyMatchCallHeader, 5, 15, FLAG_REMATCH_JUAN, 0x49, gEliteFourMatchCallDesc, NULL, sSidneyTextScripts);
|
||||
static const struct MatchCallStruct5 sSidneyMatchCallHeader =
|
||||
{
|
||||
.type = 5,
|
||||
.v1 = 15,
|
||||
.flag = FLAG_REMATCH_SIDNEY,
|
||||
.rematchTableIdx = REMATCH_SIDNEY,
|
||||
.desc = gEliteFourMatchCallDesc,
|
||||
.name = NULL,
|
||||
.textData = sSidneyTextScripts
|
||||
};
|
||||
|
||||
static const match_call_text_data_t sPhoebeTextScripts[] = {
|
||||
{ gText_Phoebe_Pokenav_2B3561, 0xFFFF, 0xFFFF },
|
||||
{ NULL, 0xFFFF, 0xFFFF }
|
||||
};
|
||||
|
||||
MATCHCALLDEF(sPhoebeMatchCallHeader, 5, 15, FLAG_REMATCH_SIDNEY, 0x4A, gEliteFourMatchCallDesc, NULL, sPhoebeTextScripts);
|
||||
static const struct MatchCallStruct5 sPhoebeMatchCallHeader =
|
||||
{
|
||||
.type = 5,
|
||||
.v1 = 15,
|
||||
.flag = FLAG_REMATCH_PHOEBE,
|
||||
.rematchTableIdx = REMATCH_PHOEBE,
|
||||
.desc = gEliteFourMatchCallDesc,
|
||||
.name = NULL,
|
||||
.textData = sPhoebeTextScripts
|
||||
};
|
||||
|
||||
static const match_call_text_data_t sGlaciaTextScripts[] = {
|
||||
{ gText_Glacia_Pokenav_2B35E4, 0xFFFF, 0xFFFF },
|
||||
{ NULL, 0xFFFF, 0xFFFF }
|
||||
};
|
||||
|
||||
MATCHCALLDEF(sGlaciaMatchCallHeader, 5, 15, FLAG_REMATCH_PHOEBE, 0x4B, gEliteFourMatchCallDesc, NULL, sGlaciaTextScripts);
|
||||
static const struct MatchCallStruct5 sGlaciaMatchCallHeader =
|
||||
{
|
||||
.type = 5,
|
||||
.v1 = 15,
|
||||
.flag = FLAG_REMATCH_GLACIA,
|
||||
.rematchTableIdx = REMATCH_GLACIA,
|
||||
.desc = gEliteFourMatchCallDesc,
|
||||
.name = NULL,
|
||||
.textData = sGlaciaTextScripts
|
||||
};
|
||||
|
||||
static const match_call_text_data_t sDrakeTextScripts[] = {
|
||||
{ gText_Drake_Pokenav_2B368B, 0xFFFF, 0xFFFF },
|
||||
{ NULL, 0xFFFF, 0xFFFF }
|
||||
};
|
||||
|
||||
MATCHCALLDEF(sDrakeMatchCallHeader, 5, 15, FLAG_REMATCH_GLACIA, 0x4C, gEliteFourMatchCallDesc, NULL, sDrakeTextScripts);
|
||||
static const struct MatchCallStruct5 sDrakeMatchCallHeader =
|
||||
{
|
||||
.type = 5,
|
||||
.v1 = 15,
|
||||
.flag = FLAG_REMATCH_DRAKE,
|
||||
.rematchTableIdx = REMATCH_DRAKE,
|
||||
.desc = gEliteFourMatchCallDesc,
|
||||
.name = NULL,
|
||||
.textData = sDrakeTextScripts
|
||||
};
|
||||
|
||||
static const match_call_text_data_t sWallaceTextScripts[] = {
|
||||
{ gText_Wallace_Pokenav_2B3790, 0xFFFF, 0xFFFF },
|
||||
{ NULL, 0xFFFF, 0xFFFF }
|
||||
};
|
||||
|
||||
MATCHCALLDEF(sWallaceMatchCallHeader, 5, 15, FLAG_REMATCH_DRAKE, 0x4D, gChampionMatchCallDesc, NULL, sWallaceTextScripts);
|
||||
static const struct MatchCallStruct5 sWallaceMatchCallHeader =
|
||||
{
|
||||
.type = 5,
|
||||
.v1 = 15,
|
||||
.flag = FLAG_REMATCH_WALLACE,
|
||||
.rematchTableIdx = REMATCH_WALLACE,
|
||||
.desc = gChampionMatchCallDesc,
|
||||
.name = NULL,
|
||||
.textData = sWallaceTextScripts
|
||||
};
|
||||
|
||||
static const match_call_t sMatchCallHeaders[] = {
|
||||
{.type0 = &sMrStoneMatchCallHeader},
|
||||
@@ -680,7 +856,7 @@ bool32 MatchCallFlagGetByIndex(u32 idx)
|
||||
match_call_t matchCall;
|
||||
u32 i;
|
||||
|
||||
if (idx > 20)
|
||||
if (idx > ARRAY_COUNT(sMatchCallHeaders) - 1)
|
||||
return FALSE;
|
||||
matchCall = sMatchCallHeaders[idx];
|
||||
i = MatchCallGetFunctionIndex(matchCall);
|
||||
@@ -727,7 +903,7 @@ u8 sub_81D16DC(u32 idx)
|
||||
match_call_t matchCall;
|
||||
u32 i;
|
||||
|
||||
if (idx > 20)
|
||||
if (idx > ARRAY_COUNT(sMatchCallHeaders) - 1)
|
||||
return 0;
|
||||
matchCall = sMatchCallHeaders[idx];
|
||||
i = MatchCallGetFunctionIndex(matchCall);
|
||||
@@ -771,7 +947,7 @@ bool32 MatchCall_IsRematchable(u32 idx)
|
||||
match_call_t matchCall;
|
||||
u32 i;
|
||||
|
||||
if (idx > 20)
|
||||
if (idx > ARRAY_COUNT(sMatchCallHeaders) - 1)
|
||||
return 0;
|
||||
matchCall = sMatchCallHeaders[idx];
|
||||
i = MatchCallGetFunctionIndex(matchCall);
|
||||
@@ -810,13 +986,13 @@ bool32 sub_81D17E8(u32 idx)
|
||||
match_call_t matchCall;
|
||||
u32 i;
|
||||
|
||||
if (idx > 20)
|
||||
if (idx > ARRAY_COUNT(sMatchCallHeaders) - 1)
|
||||
return FALSE;
|
||||
matchCall = sMatchCallHeaders[idx];
|
||||
i = MatchCallGetFunctionIndex(matchCall);
|
||||
if (gUnknown_08625338[i](matchCall))
|
||||
return TRUE;
|
||||
for (i = 0; i < 4; i++)
|
||||
for (i = 0; i < ARRAY_COUNT(sMatchCallCheckPageOverrides); i++)
|
||||
{
|
||||
if (sMatchCallCheckPageOverrides[i].idx == idx)
|
||||
return TRUE;
|
||||
@@ -854,7 +1030,7 @@ u32 MatchCall_GetRematchTableIdx(u32 idx)
|
||||
match_call_t matchCall;
|
||||
u32 i;
|
||||
|
||||
if (idx > 20)
|
||||
if (idx > ARRAY_COUNT(sMatchCallHeaders) - 1)
|
||||
return REMATCH_TABLE_ENTRIES;
|
||||
matchCall = sMatchCallHeaders[idx];
|
||||
i = MatchCallGetFunctionIndex(matchCall);
|
||||
@@ -891,7 +1067,7 @@ void MatchCall_GetMessage(u32 idx, u8 *dest)
|
||||
match_call_t matchCall;
|
||||
u32 i;
|
||||
|
||||
if (idx > 20)
|
||||
if (idx > ARRAY_COUNT(sMatchCallHeaders) - 1)
|
||||
return;
|
||||
matchCall = sMatchCallHeaders[idx];
|
||||
i = MatchCallGetFunctionIndex(matchCall);
|
||||
@@ -906,9 +1082,9 @@ static void MatchCall_GetMessage_Type0(match_call_t matchCall, u8 *dest)
|
||||
static void MatchCall_GetMessage_Type1(match_call_t matchCall, u8 *dest)
|
||||
{
|
||||
if (matchCall.common->type != 5)
|
||||
sub_81D1920(matchCall.type5->textData, dest);
|
||||
sub_81D1920(matchCall.type1->textData, dest);
|
||||
else
|
||||
sub_81D199C(matchCall.type1->textData, matchCall.type1->rematchTableIdx, dest);
|
||||
sub_81D199C(matchCall.type5->textData, matchCall.type5->rematchTableIdx, dest);
|
||||
}
|
||||
|
||||
static void MatchCall_GetMessage_Type2(match_call_t matchCall, u8 *dest)
|
||||
@@ -1093,7 +1269,7 @@ void sub_81D1A78(u32 idx, const u8 **desc, const u8 **name)
|
||||
match_call_t matchCall;
|
||||
u32 i;
|
||||
|
||||
if (idx > 20)
|
||||
if (idx > ARRAY_COUNT(sMatchCallHeaders) - 1)
|
||||
return;
|
||||
matchCall = sMatchCallHeaders[idx];
|
||||
i = MatchCallGetFunctionIndex(matchCall);
|
||||
@@ -1146,11 +1322,11 @@ const u8 *sub_81D1B40(u32 idx, u32 offset)
|
||||
{
|
||||
u32 i;
|
||||
|
||||
for (i = 0; i < 4; i++)
|
||||
for (i = 0; i < ARRAY_COUNT(sMatchCallCheckPageOverrides); i++)
|
||||
{
|
||||
if (sMatchCallCheckPageOverrides[i].idx == idx)
|
||||
{
|
||||
for (; i + 1 < 4 && sMatchCallCheckPageOverrides[i + 1].idx == idx; i++)
|
||||
for (; i + 1 < ARRAY_COUNT(sMatchCallCheckPageOverrides) && sMatchCallCheckPageOverrides[i + 1].idx == idx; i++)
|
||||
{
|
||||
if (!FlagGet(sMatchCallCheckPageOverrides[i + 1].v4))
|
||||
break;
|
||||
@@ -1244,7 +1420,7 @@ s32 sub_81D1BD0(u32 idx)
|
||||
{
|
||||
u32 i;
|
||||
|
||||
for (i = 0; i < 4; i++)
|
||||
for (i = 0; i < ARRAY_COUNT(sMatchCallCheckPageOverrides); i++)
|
||||
{
|
||||
if (sMatchCallCheckPageOverrides[i].idx == idx)
|
||||
return sMatchCallCheckPageOverrides[i].v2;
|
||||
@@ -1256,7 +1432,7 @@ bool32 sub_81D1BF8(u32 idx)
|
||||
{
|
||||
s32 i;
|
||||
|
||||
for (i = 0; i < 21; i++)
|
||||
for (i = 0; i < (s32)ARRAY_COUNT(sMatchCallHeaders); i++)
|
||||
{
|
||||
u32 r0 = MatchCall_GetRematchTableIdx(i);
|
||||
if (r0 != REMATCH_TABLE_ENTRIES && r0 == idx)
|
||||
|
||||
@@ -1,5 +1,6 @@
|
||||
#include "global.h"
|
||||
#include "battle.h"
|
||||
#include "battle_anim.h"
|
||||
#include "recorded_battle.h"
|
||||
#include "main.h"
|
||||
#include "pokemon.h"
|
||||
@@ -321,7 +322,7 @@ static bool32 RecordedBattleToSave(struct RecordedBattleSave *battleSave, struct
|
||||
|
||||
saveSection->checksum = CalcByteArraySum((void*)(saveSection), sizeof(*saveSection) - 4);
|
||||
|
||||
if (sub_8153634(31, (void*)(saveSection)) != 1)
|
||||
if (TryWriteSpecialSaveSection(SECTOR_ID_RECORDED_BATTLE, (void*)(saveSection)) != 1)
|
||||
return FALSE;
|
||||
else
|
||||
return TRUE;
|
||||
@@ -490,7 +491,7 @@ bool32 MoveRecordedBattleToSaveData(void)
|
||||
|
||||
static bool32 TryCopyRecordedBattleSaveData(struct RecordedBattleSave *dst, struct SaveSection *saveBuffer)
|
||||
{
|
||||
if (TryCopySpecialSaveSection(SECTOR_ID_RECORDED_BATTLE, (void*)(saveBuffer)) != 1)
|
||||
if (TryReadSpecialSaveSection(SECTOR_ID_RECORDED_BATTLE, (void*)(saveBuffer)) != 1)
|
||||
return FALSE;
|
||||
|
||||
memcpy(dst, saveBuffer, sizeof(struct RecordedBattleSave));
|
||||
|
||||
+5
-5
@@ -849,7 +849,7 @@ u16 sub_815355C(void)
|
||||
return 0;
|
||||
}
|
||||
|
||||
u32 TryCopySpecialSaveSection(u8 sector, u8* dst)
|
||||
u32 TryReadSpecialSaveSection(u8 sector, u8* dst)
|
||||
{
|
||||
s32 i;
|
||||
s32 size;
|
||||
@@ -858,7 +858,7 @@ u32 TryCopySpecialSaveSection(u8 sector, u8* dst)
|
||||
if (sector != SECTOR_ID_TRAINER_HILL && sector != SECTOR_ID_RECORDED_BATTLE)
|
||||
return 0xFF;
|
||||
ReadFlash(sector, 0, (u8 *)&gSaveDataBuffer, sizeof(struct SaveSection));
|
||||
if (*(u32*)(&gSaveDataBuffer.data[0]) != 0xB39D)
|
||||
if (*(u32*)(&gSaveDataBuffer.data[0]) != SPECIAL_SECTION_SENTINEL)
|
||||
return 0xFF;
|
||||
// copies whole save section except u32 counter
|
||||
i = 0;
|
||||
@@ -869,18 +869,18 @@ u32 TryCopySpecialSaveSection(u8 sector, u8* dst)
|
||||
return 1;
|
||||
}
|
||||
|
||||
u32 sub_8153634(u8 sector, u8* src)
|
||||
u32 TryWriteSpecialSaveSection(u8 sector, u8* src)
|
||||
{
|
||||
s32 i;
|
||||
s32 size;
|
||||
u8* savData;
|
||||
void* savDataBuffer;
|
||||
|
||||
if (sector != 30 && sector != 31)
|
||||
if (sector != SECTOR_ID_TRAINER_HILL && sector != SECTOR_ID_RECORDED_BATTLE)
|
||||
return 0xFF;
|
||||
|
||||
savDataBuffer = &gSaveDataBuffer;
|
||||
*(u32*)(savDataBuffer) = 0xB39D;
|
||||
*(u32*)(savDataBuffer) = SPECIAL_SECTION_SENTINEL;
|
||||
|
||||
// copies whole save section except u32 counter
|
||||
i = 0;
|
||||
|
||||
+3
-3
@@ -281,7 +281,7 @@ bool8 ScrCmd_callstd_if(struct ScriptContext *ctx)
|
||||
return FALSE;
|
||||
}
|
||||
|
||||
bool8 ScrCmd_gotoram(struct ScriptContext *ctx)
|
||||
bool8 ScrCmd_returnram(struct ScriptContext *ctx)
|
||||
{
|
||||
ScriptJump(ctx, gUnknown_020375C0);
|
||||
return FALSE;
|
||||
@@ -2215,9 +2215,9 @@ bool8 ScrCmd_checkmonobedience(struct ScriptContext *ctx)
|
||||
return FALSE;
|
||||
}
|
||||
|
||||
bool8 ScrCmd_cmdCF(struct ScriptContext *ctx)
|
||||
bool8 ScrCmd_gotoram(struct ScriptContext *ctx)
|
||||
{
|
||||
const u8* v1 = sub_8099244();
|
||||
const u8* v1 = GetSavedRamScriptIfValid();
|
||||
|
||||
if (v1)
|
||||
{
|
||||
|
||||
+4
-4
@@ -386,7 +386,7 @@ const u8 *GetRamScript(u8 objectId, const u8 *script)
|
||||
}
|
||||
}
|
||||
|
||||
bool32 sub_80991F8(void)
|
||||
bool32 ValidateSavedRamScript(void)
|
||||
{
|
||||
struct RamScriptData *scriptData = &gSaveBlock1Ptr->ramScript.data;
|
||||
if (scriptData->magic != RAM_SCRIPT_MAGIC)
|
||||
@@ -402,10 +402,10 @@ bool32 sub_80991F8(void)
|
||||
return TRUE;
|
||||
}
|
||||
|
||||
u8 *sub_8099244(void)
|
||||
u8 *GetSavedRamScriptIfValid(void)
|
||||
{
|
||||
struct RamScriptData *scriptData = &gSaveBlock1Ptr->ramScript.data;
|
||||
if (!sub_801B27C())
|
||||
if (!ValidateReceivedWonderCard())
|
||||
return NULL;
|
||||
if (scriptData->magic != RAM_SCRIPT_MAGIC)
|
||||
return NULL;
|
||||
@@ -426,7 +426,7 @@ u8 *sub_8099244(void)
|
||||
}
|
||||
}
|
||||
|
||||
void sub_80992A0(u8 *script, u16 scriptSize)
|
||||
void InitRamScript_NoEventObject(u8 *script, u16 scriptSize)
|
||||
{
|
||||
if (scriptSize > sizeof(gSaveBlock1Ptr->ramScript.data.script))
|
||||
scriptSize = sizeof(gSaveBlock1Ptr->ramScript.data.script);
|
||||
|
||||
+51
-56
@@ -1183,7 +1183,7 @@ static void Task_HandleMultichoiceInput(u8 taskId)
|
||||
{
|
||||
gSpecialVar_Result = selection;
|
||||
}
|
||||
sub_80E2A78(tWindowId);
|
||||
ClearToTransparentAndRemoveWindow(tWindowId);
|
||||
DestroyTask(taskId);
|
||||
EnableBothScriptContexts();
|
||||
}
|
||||
@@ -1219,8 +1219,6 @@ bool8 IsScriptActive(void)
|
||||
|
||||
static void Task_HandleYesNoInput(u8 taskId)
|
||||
{
|
||||
u8 left, top;
|
||||
|
||||
if (gTasks[taskId].tRight < 5)
|
||||
{
|
||||
gTasks[taskId].tRight++;
|
||||
@@ -1229,9 +1227,9 @@ static void Task_HandleYesNoInput(u8 taskId)
|
||||
|
||||
switch (Menu_ProcessInputNoWrapClearOnChoose())
|
||||
{
|
||||
case -2:
|
||||
case MENU_NOTHING_CHOSEN:
|
||||
return;
|
||||
case -1:
|
||||
case MENU_B_PRESSED:
|
||||
case 1:
|
||||
PlaySE(SE_SELECT);
|
||||
gSpecialVar_Result = 0;
|
||||
@@ -1247,8 +1245,6 @@ static void Task_HandleYesNoInput(u8 taskId)
|
||||
|
||||
bool8 ScriptMenu_MultichoiceGrid(u8 left, u8 top, u8 multichoiceId, u8 ignoreBPress, u8 columnCount)
|
||||
{
|
||||
u8 bottom = 0;
|
||||
|
||||
if (FuncIsActiveTask(Task_HandleMultichoiceGridInput) == TRUE)
|
||||
{
|
||||
return FALSE;
|
||||
@@ -1256,10 +1252,8 @@ bool8 ScriptMenu_MultichoiceGrid(u8 left, u8 top, u8 multichoiceId, u8 ignoreBPr
|
||||
else
|
||||
{
|
||||
u8 taskId;
|
||||
u8 unk2;
|
||||
int width;
|
||||
int i;
|
||||
u8 newWidth;
|
||||
u8 rowCount, newWidth;
|
||||
int i, width;
|
||||
|
||||
gSpecialVar_Result = 0xFF;
|
||||
width = 0;
|
||||
@@ -1272,15 +1266,15 @@ bool8 ScriptMenu_MultichoiceGrid(u8 left, u8 top, u8 multichoiceId, u8 ignoreBPr
|
||||
newWidth = convert_pixel_width_to_tile_width(width);
|
||||
|
||||
left = sub_80E2D5C(left, columnCount * newWidth);
|
||||
unk2 = gMultichoiceLists[multichoiceId].count / columnCount;
|
||||
rowCount = gMultichoiceLists[multichoiceId].count / columnCount;
|
||||
|
||||
taskId = CreateTask(Task_HandleMultichoiceGridInput, 80);
|
||||
|
||||
gTasks[taskId].tIgnoreBPress = ignoreBPress;
|
||||
gTasks[taskId].tWindowId = CreateWindowFromRect(left, top, columnCount * newWidth, unk2 * 2);
|
||||
gTasks[taskId].tWindowId = CreateWindowFromRect(left, top, columnCount * newWidth, rowCount * 2);
|
||||
SetStandardWindowBorderStyle(gTasks[taskId].tWindowId, 0);
|
||||
sub_81997AC(gTasks[taskId].tWindowId, newWidth * 8, columnCount, unk2, gMultichoiceLists[multichoiceId].list);
|
||||
sub_8199944(gTasks[taskId].tWindowId, newWidth * 8, columnCount, unk2, 0);
|
||||
PrintMenuGridTable(gTasks[taskId].tWindowId, newWidth * 8, columnCount, rowCount, gMultichoiceLists[multichoiceId].list);
|
||||
sub_8199944(gTasks[taskId].tWindowId, newWidth * 8, columnCount, rowCount, 0);
|
||||
CopyWindowToVram(gTasks[taskId].tWindowId, 3);
|
||||
return TRUE;
|
||||
}
|
||||
@@ -1291,23 +1285,24 @@ static void Task_HandleMultichoiceGridInput(u8 taskId)
|
||||
s16 *data = gTasks[taskId].data;
|
||||
s8 selection = Menu_ProcessInputGridLayout();
|
||||
|
||||
if (selection != -2)
|
||||
switch (selection)
|
||||
{
|
||||
if (selection == -1)
|
||||
{
|
||||
if (tIgnoreBPress)
|
||||
return;
|
||||
PlaySE(SE_SELECT);
|
||||
gSpecialVar_Result = 0x7F;
|
||||
}
|
||||
else
|
||||
{
|
||||
gSpecialVar_Result = selection;
|
||||
}
|
||||
sub_80E2A78(tWindowId);
|
||||
DestroyTask(taskId);
|
||||
EnableBothScriptContexts();
|
||||
case MENU_NOTHING_CHOSEN:
|
||||
return;
|
||||
case MENU_B_PRESSED:
|
||||
if (tIgnoreBPress)
|
||||
return;
|
||||
PlaySE(SE_SELECT);
|
||||
gSpecialVar_Result = 0x7F;
|
||||
break;
|
||||
default:
|
||||
gSpecialVar_Result = selection;
|
||||
break;
|
||||
}
|
||||
|
||||
ClearToTransparentAndRemoveWindow(tWindowId);
|
||||
DestroyTask(taskId);
|
||||
EnableBothScriptContexts();
|
||||
}
|
||||
|
||||
#undef tWindowId
|
||||
@@ -1564,7 +1559,7 @@ static void Task_PokemonPicWindow(u8 taskId)
|
||||
task->tState++;
|
||||
break;
|
||||
case 3:
|
||||
sub_80E2A78(task->tWindowId);
|
||||
ClearToTransparentAndRemoveWindow(task->tWindowId);
|
||||
DestroyTask(taskId);
|
||||
break;
|
||||
}
|
||||
@@ -1628,7 +1623,7 @@ u8 CreateWindowFromRect(u8 x, u8 y, u8 width, u8 height)
|
||||
return windowId;
|
||||
}
|
||||
|
||||
void sub_80E2A78(u8 windowId)
|
||||
void ClearToTransparentAndRemoveWindow(u8 windowId)
|
||||
{
|
||||
ClearStdWindowAndFrameToTransparent(windowId, TRUE);
|
||||
RemoveWindow(windowId);
|
||||
@@ -1638,30 +1633,30 @@ static void sub_80E2A94(u8 multichoiceId)
|
||||
{
|
||||
switch (multichoiceId)
|
||||
{
|
||||
case 77:
|
||||
FillWindowPixelBuffer(0, PIXEL_FILL(1));
|
||||
AddTextPrinterParameterized2(0, 1, gUnknown_0858BBAC[Menu_GetCursorPos()], 0, NULL, 2, 1, 3);
|
||||
break;
|
||||
case 76:
|
||||
FillWindowPixelBuffer(0, PIXEL_FILL(1));
|
||||
AddTextPrinterParameterized2(0, 1, gUnknown_0858BB9C[Menu_GetCursorPos()], 0, NULL, 2, 1, 3);
|
||||
break;
|
||||
case 78:
|
||||
FillWindowPixelBuffer(0, PIXEL_FILL(1));
|
||||
AddTextPrinterParameterized2(0, 1, gUnknown_0858BBBC[Menu_GetCursorPos()], 0, NULL, 2, 1, 3);
|
||||
break;
|
||||
case 79:
|
||||
FillWindowPixelBuffer(0, PIXEL_FILL(1));
|
||||
AddTextPrinterParameterized2(0, 1, gUnknown_0858BBCC[Menu_GetCursorPos()], 0, NULL, 2, 1, 3);
|
||||
break;
|
||||
case 75:
|
||||
FillWindowPixelBuffer(0, PIXEL_FILL(1));
|
||||
AddTextPrinterParameterized2(0, 1, gUnknown_0858BBEC[Menu_GetCursorPos()], 0, NULL, 2, 1, 3);
|
||||
break;
|
||||
case 74:
|
||||
FillWindowPixelBuffer(0, PIXEL_FILL(1));
|
||||
AddTextPrinterParameterized2(0, 1, gUnknown_0858BBE0[Menu_GetCursorPos()], 0, NULL, 2, 1, 3);
|
||||
break;
|
||||
case 77:
|
||||
FillWindowPixelBuffer(0, PIXEL_FILL(1));
|
||||
AddTextPrinterParameterized2(0, 1, gUnknown_0858BBAC[Menu_GetCursorPos()], 0, NULL, 2, 1, 3);
|
||||
break;
|
||||
case 76:
|
||||
FillWindowPixelBuffer(0, PIXEL_FILL(1));
|
||||
AddTextPrinterParameterized2(0, 1, gUnknown_0858BB9C[Menu_GetCursorPos()], 0, NULL, 2, 1, 3);
|
||||
break;
|
||||
case 78:
|
||||
FillWindowPixelBuffer(0, PIXEL_FILL(1));
|
||||
AddTextPrinterParameterized2(0, 1, gUnknown_0858BBBC[Menu_GetCursorPos()], 0, NULL, 2, 1, 3);
|
||||
break;
|
||||
case 79:
|
||||
FillWindowPixelBuffer(0, PIXEL_FILL(1));
|
||||
AddTextPrinterParameterized2(0, 1, gUnknown_0858BBCC[Menu_GetCursorPos()], 0, NULL, 2, 1, 3);
|
||||
break;
|
||||
case 75:
|
||||
FillWindowPixelBuffer(0, PIXEL_FILL(1));
|
||||
AddTextPrinterParameterized2(0, 1, gUnknown_0858BBEC[Menu_GetCursorPos()], 0, NULL, 2, 1, 3);
|
||||
break;
|
||||
case 74:
|
||||
FillWindowPixelBuffer(0, PIXEL_FILL(1));
|
||||
AddTextPrinterParameterized2(0, 1, gUnknown_0858BBE0[Menu_GetCursorPos()], 0, NULL, 2, 1, 3);
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -395,7 +395,7 @@ static void sub_80F8EE8(u8 taskId)
|
||||
task->data[0]++;
|
||||
break;
|
||||
case 4:
|
||||
sub_80E2A78(gTasks[taskId].data[5]);
|
||||
ClearToTransparentAndRemoveWindow(gTasks[taskId].data[5]);
|
||||
DestroyTask(taskId);
|
||||
break;
|
||||
}
|
||||
@@ -488,7 +488,7 @@ void sub_80F910C(void)
|
||||
if (gIsLinkContest & 2)
|
||||
{
|
||||
if (gReceivedRemoteLinkPlayers)
|
||||
sub_800E084();
|
||||
DestroyWirelessStatusIndicatorSprite();
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
+3
-2
@@ -44,6 +44,7 @@
|
||||
#include "window.h"
|
||||
#include "constants/songs.h"
|
||||
#include "rom_8011DC0.h"
|
||||
#include "union_room.h"
|
||||
|
||||
// Menu actions
|
||||
enum
|
||||
@@ -1184,7 +1185,7 @@ static bool32 sub_80A03E4(u8 *par1)
|
||||
InitBgsFromTemplates(0, sUnknown_085105A8, ARRAY_COUNT(sUnknown_085105A8));
|
||||
InitWindows(sUnknown_085105AC);
|
||||
LoadUserWindowBorderGfx_(0, 8, 224);
|
||||
sub_81978B0(240);
|
||||
Menu_LoadStdPalAt(240);
|
||||
break;
|
||||
case 3:
|
||||
ShowBg(0);
|
||||
@@ -1233,7 +1234,7 @@ static void sub_80A0550(u8 taskId)
|
||||
2,
|
||||
1,
|
||||
3);
|
||||
sub_8098858(0, 8, 14);
|
||||
DrawTextBorderOuter(0, 8, 14);
|
||||
PutWindowTilemap(0);
|
||||
CopyWindowToVram(0, 3);
|
||||
BeginNormalPaletteFade(0xFFFFFFFF, 0, 16, 0, 0);
|
||||
|
||||
+2
-2
@@ -1601,7 +1601,7 @@ u16 RenderText(struct TextPrinter *textPrinter)
|
||||
textPrinter->printerTemplate.currentX = *textPrinter->printerTemplate.currentChar + textPrinter->printerTemplate.x;
|
||||
textPrinter->printerTemplate.currentChar++;
|
||||
return 2;
|
||||
case 19:
|
||||
case EXT_CTRL_CODE_CLEAR_TO:
|
||||
{
|
||||
widthHelper = *textPrinter->printerTemplate.currentChar;
|
||||
widthHelper += textPrinter->printerTemplate.x;
|
||||
@@ -1615,7 +1615,7 @@ u16 RenderText(struct TextPrinter *textPrinter)
|
||||
}
|
||||
}
|
||||
return 2;
|
||||
case 20:
|
||||
case EXT_CTRL_CODE_MIN_LETTER_SPACING:
|
||||
textPrinter->minLetterSpacing = *textPrinter->printerTemplate.currentChar++;
|
||||
return 2;
|
||||
case EXT_CTRL_CODE_JPN:
|
||||
|
||||
+2
-2
@@ -113,7 +113,7 @@ void LoadUserWindowBorderGfx(u8 windowId, u16 destOffset, u8 palOffset)
|
||||
LoadWindowGfx(windowId, gSaveBlock2Ptr->optionsWindowFrameType, destOffset, palOffset);
|
||||
}
|
||||
|
||||
void sub_8098858(u8 windowId, u16 tileNum, u8 palNum)
|
||||
void DrawTextBorderOuter(u8 windowId, u16 tileNum, u8 palNum)
|
||||
{
|
||||
u8 bgLayer = GetWindowAttribute(windowId, WINDOW_BG);
|
||||
u16 tilemapLeft = GetWindowAttribute(windowId, WINDOW_TILEMAP_LEFT);
|
||||
@@ -131,7 +131,7 @@ void sub_8098858(u8 windowId, u16 tileNum, u8 palNum)
|
||||
FillBgTilemapBufferRect(bgLayer, tileNum + 8, tilemapLeft + width, tilemapTop + height, 1, 1, palNum);
|
||||
}
|
||||
|
||||
void sub_80989E0(u8 windowId, u16 tileNum, u8 palNum)
|
||||
void DrawTextBorderInner(u8 windowId, u16 tileNum, u8 palNum)
|
||||
{
|
||||
u8 bgLayer = GetWindowAttribute(windowId, WINDOW_BG);
|
||||
u16 tilemapLeft = GetWindowAttribute(windowId, WINDOW_TILEMAP_LEFT);
|
||||
|
||||
+8
-5
@@ -19,6 +19,8 @@
|
||||
#include "load_save.h"
|
||||
#include "mail.h"
|
||||
#include "main.h"
|
||||
#include "mevent2.h"
|
||||
#include "mystery_gift.h"
|
||||
#include "overworld.h"
|
||||
#include "palette.h"
|
||||
#include "party_menu.h"
|
||||
@@ -39,6 +41,7 @@
|
||||
#include "text_window.h"
|
||||
#include "trainer_card.h"
|
||||
#include "trade.h"
|
||||
#include "union_room.h"
|
||||
#include "util.h"
|
||||
#include "window.h"
|
||||
#include "constants/easy_chat.h"
|
||||
@@ -2011,7 +2014,7 @@ static void sub_80781C8(void)
|
||||
FreeAllWindowBuffers();
|
||||
Free(gUnknown_0203229C);
|
||||
gMain.callback1 = NULL;
|
||||
sub_800E084();
|
||||
DestroyWirelessStatusIndicatorSprite();
|
||||
SetMainCallback2(sub_807AE50);
|
||||
}
|
||||
}
|
||||
@@ -2540,7 +2543,7 @@ static void sub_8078DBC(void)
|
||||
|
||||
if (gUnknown_0203229C->tradeMenuCursorPosition < 6)
|
||||
{
|
||||
sub_8098858(1, 1, 14);
|
||||
DrawTextBorderOuter(1, 1, 14);
|
||||
FillWindowPixelBuffer(1, PIXEL_FILL(1));
|
||||
PrintMenuTable(1, 2, gUnknown_0832DEAC);
|
||||
InitMenuInUpperLeftCornerPlaySoundWhenAPressed(1, 2, 0);
|
||||
@@ -2841,7 +2844,7 @@ static void sub_80794CC(void)
|
||||
Free(gUnknown_02032184);
|
||||
Free(gUnknown_0203229C);
|
||||
FreeAllWindowBuffers();
|
||||
sub_800E084();
|
||||
DestroyWirelessStatusIndicatorSprite();
|
||||
SetMainCallback2(CB2_ReturnToFieldFromMultiplayer);
|
||||
}
|
||||
}
|
||||
@@ -3338,7 +3341,7 @@ static void sub_807A19C(u8 a0)
|
||||
{
|
||||
FillWindowPixelBuffer(0, PIXEL_FILL(1));
|
||||
AddTextPrinterParameterized(0, 1, gUnknown_0832DEBC[a0], 0, 1, TEXT_SPEED_FF, NULL);
|
||||
sub_8098858(0, 20, 12);
|
||||
DrawTextBorderOuter(0, 20, 12);
|
||||
PutWindowTilemap(0);
|
||||
CopyWindowToVram(0, 3);
|
||||
}
|
||||
@@ -6120,7 +6123,7 @@ static void c2_080543C4(void)
|
||||
FreeMonSpritesGfx();
|
||||
FREE_AND_SET_NULL(gUnknown_020322A0);
|
||||
if (gWirelessCommType)
|
||||
sub_800E084();
|
||||
DestroyWirelessStatusIndicatorSprite();
|
||||
SetMainCallback2(gMain.savedCallback);
|
||||
}
|
||||
RunTasks();
|
||||
|
||||
+1
-1
@@ -428,7 +428,7 @@ void CopyTrainerHillTrainerText(u8 which, u16 trainerId)
|
||||
static void TrainerHillStartChallenge(void)
|
||||
{
|
||||
nullsub_2();
|
||||
if (!sub_81D3B34())
|
||||
if (!ReadTrainerHillAndValidate())
|
||||
gSaveBlock1Ptr->trainerHill.field_3D6E_0f = 1;
|
||||
else
|
||||
gSaveBlock1Ptr->trainerHill.field_3D6E_0f = 0;
|
||||
|
||||
+2210
-327
File diff suppressed because it is too large
Load Diff
@@ -0,0 +1,630 @@
|
||||
#include "global.h"
|
||||
#include "battle.h"
|
||||
#include "task.h"
|
||||
#include "text.h"
|
||||
#include "main.h"
|
||||
#include "bg.h"
|
||||
#include "palette.h"
|
||||
#include "gpu_regs.h"
|
||||
#include "alloc.h"
|
||||
#include "menu.h"
|
||||
#include "window.h"
|
||||
#include "text_window.h"
|
||||
#include "scanline_effect.h"
|
||||
#include "m4a.h"
|
||||
#include "dynamic_placeholder_text_util.h"
|
||||
#include "overworld.h"
|
||||
#include "strings.h"
|
||||
#include "string_util.h"
|
||||
#include "international_string_util.h"
|
||||
#include "sound.h"
|
||||
#include "constants/songs.h"
|
||||
#include "party_menu.h"
|
||||
#include "battle_setup.h"
|
||||
#include "link.h"
|
||||
#include "union_room.h"
|
||||
#include "union_room_battle.h"
|
||||
|
||||
struct UnkStruct_3000DAC
|
||||
{
|
||||
/*0x00*/ u32 unk00[4];
|
||||
/*0x10*/ u32 unk10[4];
|
||||
/*0x20*/ u32 unk20[16];
|
||||
/*0x60*/ u8 taskId;
|
||||
/*0x61*/ u8 unk61;
|
||||
/*0x62*/ u8 filler_62[10];
|
||||
};
|
||||
|
||||
struct UnkStruct_2022C6C
|
||||
{
|
||||
s16 a0;
|
||||
};
|
||||
|
||||
IWRAM_DATA struct UnkStruct_3000DAC * gUnknown_03000DAC;
|
||||
|
||||
EWRAM_DATA struct UnkStruct_2022C6C * gUnknown_02022C6C = NULL;
|
||||
|
||||
void sub_801A43C(void);
|
||||
void sub_801A6C0(u8 taskId);
|
||||
static void sub_801A8B0(u8 windowId, u8 fontId, const u8 * str, u8 x, u8 y, u8 mode);
|
||||
bool32 sub_801AA30(u32 * a0, u32 * a1, u32 * a2, u8 taskId);
|
||||
|
||||
const u16 gWirelessInfoScreenPal[] = INCBIN_U16("graphics/interface/wireless_info_screen.gbapal");
|
||||
const u32 gWirelessInfoScreenGfx[] = INCBIN_U32("graphics/interface/wireless_info_screen.4bpp.lz");
|
||||
const u32 gWirelessInfoScreenTilemap[] = INCBIN_U32("graphics/interface/wireless_info_screen.bin.lz");
|
||||
|
||||
const struct BgTemplate gUnknown_082F0D34[] = {
|
||||
{
|
||||
.bg = 0,
|
||||
.charBaseIndex = 2,
|
||||
.mapBaseIndex = 0x1F,
|
||||
.priority = 0
|
||||
}, {
|
||||
.bg = 1,
|
||||
.charBaseIndex = 0,
|
||||
.mapBaseIndex = 0x08,
|
||||
.priority = 1
|
||||
}
|
||||
};
|
||||
|
||||
const struct WindowTemplate gUnknown_082F0D3C[] = {
|
||||
{
|
||||
.bg = 0x00,
|
||||
.tilemapLeft = 0x03,
|
||||
.tilemapTop = 0x00,
|
||||
.width = 0x18,
|
||||
.height = 0x03,
|
||||
.paletteNum = 0x0f,
|
||||
.baseBlock = 0x0001
|
||||
}, {
|
||||
.bg = 0x00,
|
||||
.tilemapLeft = 0x03,
|
||||
.tilemapTop = 0x04,
|
||||
.width = 0x15,
|
||||
.height = 0x0f,
|
||||
.paletteNum = 0x0f,
|
||||
.baseBlock = 0x0049
|
||||
}, {
|
||||
.bg = 0x00,
|
||||
.tilemapLeft = 0x18,
|
||||
.tilemapTop = 0x04,
|
||||
.width = 0x03,
|
||||
.height = 0x0f,
|
||||
.paletteNum = 0x0f,
|
||||
.baseBlock = 0x0184
|
||||
},
|
||||
{ 0xFF }
|
||||
};
|
||||
|
||||
const u8 *const gUnknown_082F0D5C[] = {
|
||||
gText_WirelessCommStatus,
|
||||
gText_PeopleTrading,
|
||||
gText_PeopleBattling,
|
||||
gText_PeopleInUnionRoom,
|
||||
gText_PeopleCommunicating
|
||||
};
|
||||
|
||||
const u8 gUnknown_082F0D70[][3] = {
|
||||
{0x01, 0x01, 0x02},
|
||||
{0x02, 0x01, 0x02},
|
||||
{0x03, 0x01, 0x04},
|
||||
{0x04, 0x00, 0x02},
|
||||
{0x06, 0x03, 0x02},
|
||||
{0x07, 0x03, 0x02},
|
||||
{0x09, 0x03, 0x00},
|
||||
{0x0a, 0x03, 0x00},
|
||||
{0x0b, 0x03, 0x00},
|
||||
{0x0c, 0xff, 0x00},
|
||||
{0x0d, 0x00, 0x00},
|
||||
{0x10, 0x03, 0x00},
|
||||
{0x0f, 0x03, 0x00},
|
||||
{0x40, 0x02, 0x01},
|
||||
{0x41, 0x02, 0x02},
|
||||
{0x44, 0x02, 0x02},
|
||||
{0x45, 0x02, 0x00},
|
||||
{0x48, 0x02, 0x02},
|
||||
{0x54, 0x02, 0x01},
|
||||
{0x53, 0x02, 0x02},
|
||||
{0x51, 0x02, 0x01},
|
||||
{0x52, 0x02, 0x01},
|
||||
{0x15, 0x03, 0x02},
|
||||
{0x16, 0x03, 0x02},
|
||||
{0x17, 0x03, 0x00},
|
||||
{0x18, 0x03, 0x00},
|
||||
{0x19, 0x03, 0x00},
|
||||
{0x1a, 0x03, 0x00},
|
||||
{0x1b, 0x03, 0x00},
|
||||
{0x1c, 0x01, 0x02},
|
||||
{0x0e, 0x01, 0x02}
|
||||
};
|
||||
|
||||
const struct BgTemplate gUnknown_082F0DD0[] = {
|
||||
{
|
||||
.bg = 0,
|
||||
.charBaseIndex = 3,
|
||||
.mapBaseIndex = 31
|
||||
}
|
||||
};
|
||||
|
||||
const struct WindowTemplate gUnknown_082F0DD4[] = {
|
||||
{
|
||||
.bg = 0,
|
||||
.tilemapLeft = 3,
|
||||
.tilemapTop = 15,
|
||||
.width = 24,
|
||||
.height = 4,
|
||||
.paletteNum = 0xE,
|
||||
.baseBlock = 0x014
|
||||
},
|
||||
{ 0xFF }
|
||||
};
|
||||
|
||||
const u8 gUnknown_082F0DE4[] = { 1, 2, 3 };
|
||||
|
||||
void sub_801A3F4(void)
|
||||
{
|
||||
if (!IsDma3ManagerBusyWithBgCopy())
|
||||
{
|
||||
RunTasks();
|
||||
RunTextPrinters();
|
||||
AnimateSprites();
|
||||
BuildOamBuffer();
|
||||
UpdatePaletteFade();
|
||||
}
|
||||
}
|
||||
|
||||
void sub_801A418(void)
|
||||
{
|
||||
LoadOam();
|
||||
ProcessSpriteCopyRequests();
|
||||
TransferPlttBuffer();
|
||||
}
|
||||
|
||||
void sub_801A42C(void)
|
||||
{
|
||||
SetMainCallback2(sub_801A43C);
|
||||
}
|
||||
|
||||
void sub_801A43C(void)
|
||||
{
|
||||
SetGpuReg(REG_OFFSET_DISPCNT, 0x0000);
|
||||
gUnknown_03000DAC = AllocZeroed(sizeof(struct UnkStruct_3000DAC));
|
||||
SetVBlankCallback(NULL);
|
||||
ResetBgsAndClearDma3BusyFlags(0);
|
||||
InitBgsFromTemplates(0, gUnknown_082F0D34, ARRAY_COUNT(gUnknown_082F0D34));
|
||||
SetBgTilemapBuffer(1, Alloc(0x800));
|
||||
SetBgTilemapBuffer(0, Alloc(0x800));
|
||||
DecompressAndLoadBgGfxUsingHeap(1, gWirelessInfoScreenGfx, 0, 0, 0);
|
||||
CopyToBgTilemapBuffer(1, gWirelessInfoScreenTilemap, 0, 0);
|
||||
InitWindows(gUnknown_082F0D3C);
|
||||
DeactivateAllTextPrinters();
|
||||
ResetPaletteFade();
|
||||
ResetSpriteData();
|
||||
ResetTasks();
|
||||
ScanlineEffect_Stop();
|
||||
m4aSoundVSyncOn();
|
||||
SetVBlankCallback(sub_801A418);
|
||||
gUnknown_03000DAC->taskId = CreateTask(sub_801A6C0, 0);
|
||||
gUnknown_03000DAC->unk61 = sub_8013C40();
|
||||
gUnknown_03000DAC->unk10[3] = 1;
|
||||
ChangeBgX(0, 0, 0);
|
||||
ChangeBgY(0, 0, 0);
|
||||
ChangeBgX(1, 0, 0);
|
||||
ChangeBgY(1, 0, 0);
|
||||
LoadPalette(gWirelessInfoScreenPal, 0x00, 0x20);
|
||||
Menu_LoadStdPalAt(0xF0);
|
||||
DynamicPlaceholderTextUtil_Reset();
|
||||
FillBgTilemapBufferRect(0, 0, 0, 0, 32, 32, 0x0F);
|
||||
CopyBgTilemapBufferToVram(1);
|
||||
SetMainCallback2(sub_801A3F4);
|
||||
RunTasks();
|
||||
RunTextPrinters();
|
||||
AnimateSprites();
|
||||
BuildOamBuffer();
|
||||
UpdatePaletteFade();
|
||||
}
|
||||
|
||||
void sub_801A584(void)
|
||||
{
|
||||
s32 i;
|
||||
FreeAllWindowBuffers();
|
||||
for (i = 0; i < 2; i++)
|
||||
{
|
||||
Free(GetBgTilemapBuffer(i));
|
||||
}
|
||||
Free(gUnknown_03000DAC);
|
||||
SetMainCallback2(CB2_ReturnToFieldContinueScriptPlayMapMusic);
|
||||
}
|
||||
|
||||
void sub_801A5BC(s16 * a0, s16 * a1)
|
||||
{
|
||||
if (++(*a0) > 5)
|
||||
{
|
||||
if (++(*a1) == 14)
|
||||
{
|
||||
*a1 = 0;
|
||||
}
|
||||
*a0 = 0;
|
||||
}
|
||||
LoadPalette(gWirelessInfoScreenPal + 16 * (*a1 + 2), 0, 0x10);
|
||||
}
|
||||
|
||||
void sub_801A600(void)
|
||||
{
|
||||
s32 i;
|
||||
FillWindowPixelBuffer(0, 0);
|
||||
FillWindowPixelBuffer(1, 0);
|
||||
FillWindowPixelBuffer(2, 0);
|
||||
sub_801A8B0(0, 1, gUnknown_082F0D5C[0], GetStringCenterAlignXOffset(1, gUnknown_082F0D5C[0], 0xC0), 6, 3);
|
||||
for (i = 0; i < 3; i++)
|
||||
{
|
||||
sub_801A8B0(1, 1, gUnknown_082F0D5C[i + 1], 0, 30 * i + 8, 1);
|
||||
}
|
||||
sub_801A8B0(1, 1, gUnknown_082F0D5C[i + 1], 0, 30 * i + 8, 2);
|
||||
PutWindowTilemap(0);
|
||||
CopyWindowToVram(0, 2);
|
||||
PutWindowTilemap(1);
|
||||
CopyWindowToVram(1, 2);
|
||||
}
|
||||
|
||||
void sub_801A6C0(u8 taskId)
|
||||
{
|
||||
s32 i;
|
||||
switch (gTasks[taskId].data[0])
|
||||
{
|
||||
case 0:
|
||||
sub_801A600();
|
||||
gTasks[taskId].data[0]++;
|
||||
break;
|
||||
case 1:
|
||||
BeginNormalPaletteFade(0xFFFFFFFF, 0, 16, 0, 0);
|
||||
ShowBg(1);
|
||||
CopyBgTilemapBufferToVram(0);
|
||||
ShowBg(0);
|
||||
gTasks[taskId].data[0]++;
|
||||
break;
|
||||
case 2:
|
||||
if (!gPaletteFade.active)
|
||||
{
|
||||
gTasks[taskId].data[0]++;
|
||||
}
|
||||
break;
|
||||
case 3:
|
||||
if (sub_801AA30(gUnknown_03000DAC->unk00, gUnknown_03000DAC->unk10, gUnknown_03000DAC->unk20, gUnknown_03000DAC->unk61))
|
||||
{
|
||||
FillWindowPixelBuffer(2, 0);
|
||||
for (i = 0; i < 4; i++)
|
||||
{
|
||||
ConvertIntToDecimalStringN(gStringVar4, gUnknown_03000DAC->unk00[i], STR_CONV_MODE_RIGHT_ALIGN, 2);
|
||||
if (i != 3)
|
||||
{
|
||||
sub_801A8B0(2, 1, gStringVar4, 12, 30 * i + 8, 1);
|
||||
}
|
||||
else
|
||||
{
|
||||
sub_801A8B0(2, 1, gStringVar4, 12, 98, 2);
|
||||
}
|
||||
}
|
||||
PutWindowTilemap(2);
|
||||
CopyWindowToVram(2, 3);
|
||||
}
|
||||
if (({gMain.newKeys & A_BUTTON;}) || ({gMain.newKeys & B_BUTTON;}))
|
||||
{
|
||||
PlaySE(SE_SELECT);
|
||||
gTasks[gUnknown_03000DAC->unk61].data[15] = 0xFF;
|
||||
gTasks[taskId].data[0]++;
|
||||
}
|
||||
sub_801A5BC(&gTasks[taskId].data[7], &gTasks[taskId].data[8]);
|
||||
break;
|
||||
case 4:
|
||||
BeginNormalPaletteFade(0xFFFFFFFF, 0, 0, 16, 0);
|
||||
gTasks[taskId].data[0]++;
|
||||
break;
|
||||
case 5:
|
||||
if (!gPaletteFade.active)
|
||||
{
|
||||
SetMainCallback2(sub_801A584);
|
||||
DestroyTask(taskId);
|
||||
}
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
static void sub_801A8B0(u8 windowId, u8 fontId, const u8 * str, u8 x, u8 y, u8 mode)
|
||||
{
|
||||
u8 color[3];
|
||||
|
||||
switch (mode)
|
||||
{
|
||||
case 0:
|
||||
color[0] = 0;
|
||||
color[1] = 2;
|
||||
color[2] = 3;
|
||||
break;
|
||||
case 1:
|
||||
color[0] = 0;
|
||||
color[1] = 1;
|
||||
color[2] = 3;
|
||||
break;
|
||||
case 2:
|
||||
color[0] = 0;
|
||||
color[1] = 4;
|
||||
color[2] = 5;
|
||||
break;
|
||||
case 3:
|
||||
color[0] = 0;
|
||||
color[1] = 7;
|
||||
color[2] = 6;
|
||||
break;
|
||||
case 4:
|
||||
color[0] = 0;
|
||||
color[1] = 1;
|
||||
color[2] = 2;
|
||||
break;
|
||||
}
|
||||
|
||||
AddTextPrinterParameterized4(windowId, fontId, x, y, 0, 0, color, -1, str);
|
||||
}
|
||||
|
||||
u32 sub_801A960(struct UnkStruct_x20 * a0, u32 * a1)
|
||||
{
|
||||
s32 i, j, r2;
|
||||
u32 result = a0->unk.field_0.unk_0a_0;
|
||||
|
||||
for (i = 0; i < (unsigned)ARRAY_COUNT(gUnknown_082F0D70); i++)
|
||||
{
|
||||
if (result != gUnknown_082F0D70[i][0])
|
||||
{
|
||||
continue;
|
||||
}
|
||||
if (a0->field_1A_0 != 1)
|
||||
{
|
||||
continue;
|
||||
}
|
||||
if (gUnknown_082F0D70[i][2] == 0)
|
||||
{
|
||||
r2 = 0;
|
||||
for (j = 0; j < 4; j++)
|
||||
{
|
||||
if (a0->unk.field_0.unk_04[j] != 0)
|
||||
{
|
||||
r2++;
|
||||
}
|
||||
}
|
||||
r2++;
|
||||
a1[gUnknown_082F0D70[i][1]] += r2;
|
||||
}
|
||||
else
|
||||
{
|
||||
a1[gUnknown_082F0D70[i][1]] += gUnknown_082F0D70[i][2];
|
||||
}
|
||||
}
|
||||
return result;
|
||||
}
|
||||
|
||||
bool32 sub_801AA08(u32 * a0, u32 * a1)
|
||||
{
|
||||
s32 i;
|
||||
for (i = 0; i < 4; i++)
|
||||
{
|
||||
if (a0[i] != a1[i])
|
||||
{
|
||||
return TRUE;
|
||||
}
|
||||
}
|
||||
return FALSE;
|
||||
}
|
||||
|
||||
bool32 sub_801AA30(u32 * a0, u32 * a1, u32 * a2, u8 taskId)
|
||||
{
|
||||
bool32 r8 = FALSE;
|
||||
u32 sp0[4] = {0, 0, 0, 0};
|
||||
struct UnkStruct_x20 ** data = (void *)gTasks[taskId].data;
|
||||
s32 i;
|
||||
|
||||
for (i = 0; i < 16; i++)
|
||||
{
|
||||
u32 r1 = sub_801A960(&(*data)[i], sp0);
|
||||
if (r1 != a2[i])
|
||||
{
|
||||
a2[i] = r1;
|
||||
r8 = TRUE;
|
||||
}
|
||||
}
|
||||
if (sub_801AA08(sp0, a1) == 0)
|
||||
{
|
||||
if (r8 != TRUE)
|
||||
{
|
||||
return FALSE;
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
memcpy(a0, sp0, sizeof(sp0));
|
||||
memcpy(a1, sp0, sizeof(sp0));
|
||||
a0[3] = a0[0] + a0[1] + a0[2] + a0[3];
|
||||
}
|
||||
return TRUE;
|
||||
}
|
||||
|
||||
void sub_801AAD4(void)
|
||||
{
|
||||
s32 i;
|
||||
sub_8014210(10);
|
||||
for (i = 0; i < 2; i++)
|
||||
{
|
||||
gEnemyParty[i] = gPlayerParty[gSelectedOrderFromParty[i] - 1];
|
||||
}
|
||||
for (i = 0; i < 6; i++)
|
||||
{
|
||||
ZeroMonData(&gPlayerParty[i]);
|
||||
}
|
||||
for (i = 0; i < 2; i++)
|
||||
{
|
||||
gPlayerParty[i] = gEnemyParty[i];
|
||||
}
|
||||
IncrementGameStat(GAME_STAT_NUM_UNION_ROOM_BATTLES);
|
||||
CalculatePlayerPartyCount();
|
||||
gTrainerBattleOpponent_A = 0xC00;
|
||||
SetMainCallback2(CB2_InitBattle);
|
||||
}
|
||||
|
||||
void sub_801AB68(u8 windowId, const u8 * str, u8 x, u8 y, s32 speed)
|
||||
{
|
||||
s32 letterSpacing = 0;
|
||||
s32 lineSpacing = 1;
|
||||
FillWindowPixelBuffer(windowId, (gUnknown_082F0DE4[0] << 4) | gUnknown_082F0DE4[0]);
|
||||
AddTextPrinterParameterized4(windowId, 1, x, y, letterSpacing, lineSpacing, gUnknown_082F0DE4, speed, str);
|
||||
}
|
||||
|
||||
bool32 sub_801ABDC(s16 * state, const u8 * str, s32 speed)
|
||||
{
|
||||
switch (*state)
|
||||
{
|
||||
case 0:
|
||||
DrawTextBorderOuter(0, 0x001, 0xD);
|
||||
sub_801AB68(0, str, 0, 1, speed);
|
||||
PutWindowTilemap(0);
|
||||
CopyWindowToVram(0, 3);
|
||||
(*state)++;
|
||||
break;
|
||||
case 1:
|
||||
if (!IsTextPrinterActive(0))
|
||||
{
|
||||
*state = 0;
|
||||
return TRUE;
|
||||
}
|
||||
break;
|
||||
}
|
||||
return FALSE;
|
||||
}
|
||||
|
||||
void sub_801AC40(void)
|
||||
{
|
||||
LoadOam();
|
||||
ProcessSpriteCopyRequests();
|
||||
TransferPlttBuffer();
|
||||
}
|
||||
|
||||
void sub_801AC54(void)
|
||||
{
|
||||
switch (gMain.state)
|
||||
{
|
||||
case 0:
|
||||
SetGpuReg(REG_OFFSET_DISPCNT, 0x0000);
|
||||
gUnknown_02022C6C = AllocZeroed(4);
|
||||
ResetSpriteData();
|
||||
FreeAllSpritePalettes();
|
||||
ResetTasks();
|
||||
ResetBgsAndClearDma3BusyFlags(0);
|
||||
InitBgsFromTemplates(0, gUnknown_082F0DD0, 1);
|
||||
reset_temp_tile_data_buffers();
|
||||
if (!InitWindows(gUnknown_082F0DD4))
|
||||
{
|
||||
return;
|
||||
}
|
||||
DeactivateAllTextPrinters();
|
||||
ClearWindowTilemap(0);
|
||||
FillWindowPixelBuffer(0, 0x00);
|
||||
FillWindowPixelBuffer(0, 0x11);
|
||||
FillBgTilemapBufferRect(0, 0, 0, 0, 30, 20, 0xF);
|
||||
LoadUserWindowBorderGfx(0, 1, 0xD0);
|
||||
LoadUserWindowBorderGfx_(0, 1, 0xD0);
|
||||
sub_819789C();
|
||||
SetVBlankCallback(sub_801AC40);
|
||||
gMain.state++;
|
||||
break;
|
||||
case 1:
|
||||
if (sub_801ABDC(&gUnknown_02022C6C->a0, gText_CommStandbyAwaitingOtherPlayer, 0))
|
||||
{
|
||||
gMain.state++;
|
||||
}
|
||||
break;
|
||||
case 2:
|
||||
BeginNormalPaletteFade(0xFFFFFFFF, 0, 16, 0, 0);
|
||||
ShowBg(0);
|
||||
gMain.state++;
|
||||
break;
|
||||
case 3:
|
||||
if (!UpdatePaletteFade())
|
||||
{
|
||||
memset(gBlockSendBuffer, 0, 0x20);
|
||||
if (gSelectedOrderFromParty[0] == -gSelectedOrderFromParty[1])
|
||||
{
|
||||
gBlockSendBuffer[0] = 0x52;
|
||||
}
|
||||
else
|
||||
{
|
||||
gBlockSendBuffer[0] = 0x51;
|
||||
}
|
||||
SendBlock(0, gBlockSendBuffer, 0x20);
|
||||
gMain.state++;
|
||||
}
|
||||
break;
|
||||
case 4:
|
||||
if (GetBlockReceivedStatus() == 3)
|
||||
{
|
||||
if (gBlockRecvBuffer[0][0] == 0x51 && gBlockRecvBuffer[1][0] == 0x51)
|
||||
{
|
||||
BeginNormalPaletteFade(0xFFFFFFFF, 0, 0, 16, 0);
|
||||
gMain.state = 50;
|
||||
}
|
||||
else
|
||||
{
|
||||
sub_800AC34();
|
||||
if (gBlockRecvBuffer[GetMultiplayerId()][0] == 0x52)
|
||||
{
|
||||
gMain.state = 6;
|
||||
}
|
||||
else
|
||||
{
|
||||
gMain.state = 8;
|
||||
}
|
||||
}
|
||||
ResetBlockReceivedFlags();
|
||||
}
|
||||
break;
|
||||
case 50:
|
||||
if (!UpdatePaletteFade())
|
||||
{
|
||||
sub_800ADF8();
|
||||
gMain.state++;
|
||||
}
|
||||
break;
|
||||
case 51:
|
||||
if (IsLinkTaskFinished())
|
||||
{
|
||||
SetMainCallback2(sub_801AAD4);
|
||||
}
|
||||
break;
|
||||
case 6:
|
||||
if (gReceivedRemoteLinkPlayers == 0)
|
||||
{
|
||||
gMain.state++;
|
||||
}
|
||||
break;
|
||||
case 7:
|
||||
if (sub_801ABDC(&gUnknown_02022C6C->a0, gText_RefusedBattle, 1))
|
||||
{
|
||||
SetMainCallback2(CB2_ReturnToField);
|
||||
}
|
||||
break;
|
||||
case 8:
|
||||
if (gReceivedRemoteLinkPlayers == 0)
|
||||
{
|
||||
gMain.state++;
|
||||
}
|
||||
break;
|
||||
case 9:
|
||||
if (sub_801ABDC(&gUnknown_02022C6C->a0, gText_BattleWasRefused, 1))
|
||||
{
|
||||
SetMainCallback2(CB2_ReturnToField);
|
||||
}
|
||||
break;
|
||||
}
|
||||
RunTasks();
|
||||
RunTextPrinters();
|
||||
AnimateSprites();
|
||||
BuildOamBuffer();
|
||||
UpdatePaletteFade();
|
||||
}
|
||||
Executable
+2943
File diff suppressed because it is too large
Load Diff
@@ -0,0 +1,611 @@
|
||||
#include "global.h"
|
||||
#include "constants/flags.h"
|
||||
#include "constants/event_object_movement_constants.h"
|
||||
#include "event_data.h"
|
||||
#include "event_object_movement.h"
|
||||
#include "script.h"
|
||||
#include "field_player_avatar.h"
|
||||
#include "fieldmap.h"
|
||||
#include "union_room.h"
|
||||
#include "task.h"
|
||||
|
||||
EWRAM_DATA struct UnkStruct_8019BA8 * gUnknown_02022C64 = NULL;
|
||||
EWRAM_DATA u32 gUnknown_02022C68 = 0;
|
||||
|
||||
static u8 sub_8019DF4(void);
|
||||
static u32 sub_8019F8C(u32 playerIdx, u32 arg1);
|
||||
static void sub_801A3B0(s32 arg0, s32 arg1, u8 arg2);
|
||||
|
||||
ALIGNED(4) const u8 gUnknown_082F072C[][10] = {
|
||||
{0x21, 0x2c, 0x1f, 0x23, 0x25, 0x24, 0x41, 0x42},
|
||||
{0x22, 0x28, 0x20, 0x2f, 0x2f, 0x0e, 0x14, 0x2d}
|
||||
};
|
||||
|
||||
static const s16 gUnknown_082F0740[][2] = {
|
||||
{0x4, 0x6},
|
||||
{0xd, 0x8},
|
||||
{0xa, 0x6},
|
||||
{0x1, 0x8},
|
||||
{0xd, 0x4},
|
||||
{0x7, 0x4},
|
||||
{0x1, 0x4},
|
||||
{0x7, 0x8}
|
||||
};
|
||||
|
||||
static const s8 gUnknown_082F0760[][2] = {
|
||||
{ 0, 0},
|
||||
{ 1, 0},
|
||||
{ 0, -1},
|
||||
{-1, 0},
|
||||
{ 0, 1}
|
||||
};
|
||||
|
||||
static const u8 gUnknown_082F076A[] = {
|
||||
0x00, 0x02, 0x01, 0x04, 0x03
|
||||
};
|
||||
|
||||
static const u8 gUnknown_082F076F[] = {
|
||||
0x01, 0x03, 0x01, 0x04, 0x02
|
||||
};
|
||||
|
||||
static const u8 gUnknown_082F0774[] = {
|
||||
0x09, 0x08, 0x07, 0x02, 0x06, 0x05, 0x04, 0x03,
|
||||
0xbf, 0x02, 0xc0, 0x02, 0xc1, 0x02, 0xc2, 0x02,
|
||||
0xc3, 0x02, 0xc4, 0x02, 0xc5, 0x02, 0xc6, 0x02
|
||||
};
|
||||
|
||||
static const u8 gUnknown_082F078C[2] = {
|
||||
MOVEMENT_ACTION_FLY_UP,
|
||||
MOVEMENT_ACTION_STEP_END
|
||||
};
|
||||
|
||||
static const u8 gUnknown_082F078E[2] = {
|
||||
MOVEMENT_ACTION_FLY_DOWN,
|
||||
MOVEMENT_ACTION_STEP_END
|
||||
};
|
||||
|
||||
static bool32 is_walking_or_running(void)
|
||||
{
|
||||
if (gPlayerAvatar.tileTransitionState == 2 || gPlayerAvatar.tileTransitionState == 0)
|
||||
{
|
||||
return TRUE;
|
||||
}
|
||||
else
|
||||
{
|
||||
return FALSE;
|
||||
}
|
||||
}
|
||||
|
||||
static u8 sub_8019978(u32 a0, u32 a1)
|
||||
{
|
||||
return gUnknown_082F072C[a0][a1 % 8];
|
||||
}
|
||||
|
||||
static void sub_8019990(u32 a0, u32 a1, s32 * a2, s32 * a3)
|
||||
{
|
||||
*a2 = gUnknown_082F0740[a0][0] + gUnknown_082F0760[a1][0] + 7;
|
||||
*a3 = gUnknown_082F0740[a0][1] + gUnknown_082F0760[a1][1] + 7;
|
||||
}
|
||||
|
||||
static bool32 sub_80199E0(u32 a0, u32 a1, s32 a2, s32 a3)
|
||||
{
|
||||
if (gUnknown_082F0740[a0][0] + gUnknown_082F0760[a1][0] + 7 != a2)
|
||||
{
|
||||
return FALSE;
|
||||
}
|
||||
else if (gUnknown_082F0740[a0][1] + gUnknown_082F0760[a1][1] + 7 != a3)
|
||||
{
|
||||
return FALSE;
|
||||
}
|
||||
else
|
||||
{
|
||||
return TRUE;
|
||||
}
|
||||
}
|
||||
|
||||
static bool32 IsUnionRoomPlayerHidden(u32 player_idx)
|
||||
{
|
||||
return FlagGet(FLAG_HIDE_UNION_ROOM_PLAYER_1 + player_idx);
|
||||
}
|
||||
|
||||
static void HideUnionRoomPlayer(u32 player_idx)
|
||||
{
|
||||
FlagSet(FLAG_HIDE_UNION_ROOM_PLAYER_1 + player_idx);
|
||||
}
|
||||
|
||||
static void ShowUnionRoomPlayer(u32 player_idx)
|
||||
{
|
||||
FlagClear(FLAG_HIDE_UNION_ROOM_PLAYER_1 + player_idx);
|
||||
}
|
||||
|
||||
static void SetUnionRoomPlayerGfx(u32 playerIdx, u32 gfxId)
|
||||
{
|
||||
VarSet(VAR_OBJ_GFX_ID_0 + playerIdx, gfxId);
|
||||
}
|
||||
|
||||
static void CreateUnionRoomPlayerEventObject(u32 playerIdx)
|
||||
{
|
||||
show_sprite(gUnknown_082F0774[playerIdx], gSaveBlock1Ptr->location.mapNum, gSaveBlock1Ptr->location.mapGroup);
|
||||
}
|
||||
|
||||
static void RemoveUnionRoomPlayerEventObject(u32 playerIdx)
|
||||
{
|
||||
RemoveEventObjectByLocalIdAndMap(gUnknown_082F0774[playerIdx], gSaveBlock1Ptr->location.mapNum, gSaveBlock1Ptr->location.mapGroup);
|
||||
}
|
||||
|
||||
static bool32 SetUnionRoomPlayerEnterExitMovement(u32 playerIdx, const u8 * movement)
|
||||
{
|
||||
u8 objectId;
|
||||
struct EventObject * object;
|
||||
if (TryGetEventObjectIdByLocalIdAndMap(gUnknown_082F0774[playerIdx], gSaveBlock1Ptr->location.mapNum, gSaveBlock1Ptr->location.mapGroup, &objectId))
|
||||
{
|
||||
return FALSE;
|
||||
}
|
||||
object = &gEventObjects[objectId];
|
||||
if (EventObjectIsMovementOverridden(object))
|
||||
{
|
||||
return FALSE;
|
||||
}
|
||||
if (EventObjectSetHeldMovement(object, *movement))
|
||||
{
|
||||
return FALSE;
|
||||
}
|
||||
return TRUE;
|
||||
}
|
||||
|
||||
static bool32 sub_8019B3C(u32 playerIdx)
|
||||
{
|
||||
u8 objectId;
|
||||
struct EventObject * object;
|
||||
if (TryGetEventObjectIdByLocalIdAndMap(gUnknown_082F0774[playerIdx], gSaveBlock1Ptr->location.mapNum, gSaveBlock1Ptr->location.mapGroup, &objectId))
|
||||
{
|
||||
return TRUE;
|
||||
}
|
||||
object = &gEventObjects[objectId];
|
||||
if (!EventObjectClearHeldMovementIfFinished(object))
|
||||
{
|
||||
return FALSE;
|
||||
}
|
||||
if (!ScriptContext2_IsEnabled())
|
||||
{
|
||||
UnfreezeEventObject(object);
|
||||
}
|
||||
else
|
||||
{
|
||||
FreezeEventObject(object);
|
||||
}
|
||||
return TRUE;
|
||||
}
|
||||
|
||||
u8 sub_8019BA8(struct UnkStruct_8019BA8 * ptr)
|
||||
{
|
||||
s32 i;
|
||||
|
||||
gUnknown_02022C68 = 0;
|
||||
gUnknown_02022C64 = ptr;
|
||||
for (i = 0; i < 8; i++)
|
||||
{
|
||||
ptr[i].field_0 = 0;
|
||||
ptr[i].field_1 = 0;
|
||||
ptr[i].field_2 = 0;
|
||||
ptr[i].field_3 = 0;
|
||||
}
|
||||
return sub_8019DF4();
|
||||
}
|
||||
|
||||
static bool32 sub_8019BDC(s8 * a0, u32 playerIdx, struct UnkStruct_8019BA8 * ptr)
|
||||
{
|
||||
switch (*a0)
|
||||
{
|
||||
case 0:
|
||||
if (SetUnionRoomPlayerEnterExitMovement(playerIdx, gUnknown_082F078C) == TRUE)
|
||||
{
|
||||
HideUnionRoomPlayer(playerIdx);
|
||||
(*a0)++;
|
||||
}
|
||||
break;
|
||||
case 1:
|
||||
if (sub_8019B3C(playerIdx))
|
||||
{
|
||||
RemoveUnionRoomPlayerEventObject(playerIdx);
|
||||
HideUnionRoomPlayer(playerIdx);
|
||||
*a0 = 0;
|
||||
return TRUE;
|
||||
}
|
||||
break;
|
||||
}
|
||||
return FALSE;
|
||||
}
|
||||
|
||||
static bool32 sub_8019C38(s8 * a0, u32 playerIdx, struct UnkStruct_8019BA8 * ptr)
|
||||
{
|
||||
s16 x, y;
|
||||
|
||||
switch (*a0)
|
||||
{
|
||||
case 0:
|
||||
if (!is_walking_or_running())
|
||||
{
|
||||
break;
|
||||
}
|
||||
PlayerGetDestCoords(&x, &y);
|
||||
if (sub_80199E0(playerIdx, 0, x, y) == 1)
|
||||
{
|
||||
break;
|
||||
}
|
||||
player_get_pos_including_state_based_drift(&x, &y);
|
||||
if (sub_80199E0(playerIdx, 0, x, y) == 1)
|
||||
{
|
||||
break;
|
||||
}
|
||||
SetUnionRoomPlayerGfx(playerIdx, ptr->field_1);
|
||||
CreateUnionRoomPlayerEventObject(playerIdx);
|
||||
ShowUnionRoomPlayer(playerIdx);
|
||||
(*a0)++;
|
||||
// fallthrough
|
||||
case 3: // incorrect?
|
||||
if (SetUnionRoomPlayerEnterExitMovement(playerIdx, gUnknown_082F078E) == 1)
|
||||
{
|
||||
(*a0)++;
|
||||
}
|
||||
break;
|
||||
case 2:
|
||||
if (sub_8019B3C(playerIdx))
|
||||
{
|
||||
*a0 = 0;
|
||||
return TRUE;
|
||||
}
|
||||
break;
|
||||
}
|
||||
return FALSE;
|
||||
}
|
||||
|
||||
static bool32 sub_8019CF0(u32 playerIdx, u32 a1, u32 a2)
|
||||
{
|
||||
struct UnkStruct_8019BA8 * ptr = &gUnknown_02022C64[playerIdx];
|
||||
ptr->field_3 = 1;
|
||||
ptr->field_1 = sub_8019978(a1, a2);
|
||||
if (ptr->field_0 == 0)
|
||||
{
|
||||
return TRUE;
|
||||
}
|
||||
else
|
||||
{
|
||||
return FALSE;
|
||||
}
|
||||
}
|
||||
|
||||
static bool32 sub_8019D20(u32 playerIdx)
|
||||
{
|
||||
struct UnkStruct_8019BA8 * ptr = &gUnknown_02022C64[playerIdx];
|
||||
ptr->field_3 = 2;
|
||||
if (ptr->field_0 == 1)
|
||||
{
|
||||
return TRUE;
|
||||
}
|
||||
else
|
||||
{
|
||||
return FALSE;
|
||||
}
|
||||
}
|
||||
|
||||
static void sub_8019D44(u32 playerIdx, struct UnkStruct_8019BA8 * ptr)
|
||||
{
|
||||
switch (ptr->field_0)
|
||||
{
|
||||
case 0:
|
||||
if (ptr->field_3 == 1)
|
||||
{
|
||||
ptr->field_0 = 2;
|
||||
ptr->field_2 = 0;
|
||||
}
|
||||
else
|
||||
{
|
||||
break;
|
||||
}
|
||||
// fallthrough
|
||||
case 2:
|
||||
if (!sub_8019F8C(playerIdx, 0) && ptr->field_3 == 2)
|
||||
{
|
||||
ptr->field_0 = 0;
|
||||
ptr->field_2 = 0;
|
||||
RemoveUnionRoomPlayerEventObject(playerIdx);
|
||||
HideUnionRoomPlayer(playerIdx);
|
||||
}
|
||||
else if (sub_8019C38(&ptr->field_2, playerIdx, ptr) == 1)
|
||||
{
|
||||
ptr->field_0 = 1;
|
||||
}
|
||||
break;
|
||||
case 1:
|
||||
if (ptr->field_3 == 2)
|
||||
{
|
||||
ptr->field_0 = 3;
|
||||
ptr->field_2 = 0;
|
||||
}
|
||||
else
|
||||
{
|
||||
break;
|
||||
}
|
||||
// fallthrough
|
||||
case 3:
|
||||
if (sub_8019BDC(&ptr->field_2, playerIdx, ptr) == 1)
|
||||
{
|
||||
ptr->field_0 = 0;
|
||||
}
|
||||
break;
|
||||
}
|
||||
ptr->field_3 = 0;
|
||||
}
|
||||
|
||||
static void sub_8019DD0(u8 taskId)
|
||||
{
|
||||
s32 i;
|
||||
for (i = 0; i < 8; i++)
|
||||
{
|
||||
sub_8019D44(i, &gUnknown_02022C64[i]);
|
||||
}
|
||||
}
|
||||
|
||||
static u8 sub_8019DF4(void)
|
||||
{
|
||||
if (FuncIsActiveTask(sub_8019DD0) == 1)
|
||||
{
|
||||
return NUM_TASKS;
|
||||
}
|
||||
else
|
||||
{
|
||||
return CreateTask(sub_8019DD0, 5);
|
||||
}
|
||||
}
|
||||
|
||||
static void sub_8019E20(void)
|
||||
{
|
||||
u8 taskId = FindTaskIdByFunc(sub_8019DD0);
|
||||
if (taskId < NUM_TASKS)
|
||||
{
|
||||
DestroyTask(taskId);
|
||||
}
|
||||
}
|
||||
|
||||
void sub_8019E3C(void)
|
||||
{
|
||||
s32 i;
|
||||
for (i = 0; i < 8; i++)
|
||||
{
|
||||
if (!IsUnionRoomPlayerHidden(i))
|
||||
{
|
||||
RemoveUnionRoomPlayerEventObject(i);
|
||||
HideUnionRoomPlayer(i);
|
||||
}
|
||||
}
|
||||
gUnknown_02022C64 = NULL;
|
||||
sub_8019E20();
|
||||
}
|
||||
|
||||
void sub_8019E70(u8 * sp8, s32 r9)
|
||||
{
|
||||
s32 r7;
|
||||
|
||||
for (r7 = 0; r7 < 5; r7++)
|
||||
{
|
||||
s32 r5 = 5 * r9 + r7;
|
||||
sp8[r5] = sprite_new(0x41, r5 - 0x38, gUnknown_082F0740[r9][0] + gUnknown_082F0760[r7][0], gUnknown_082F0740[r9][1] + gUnknown_082F0760[r7][1], 3, 1);
|
||||
sub_8097C44(r5 - 0x38, TRUE);
|
||||
}
|
||||
}
|
||||
|
||||
void sub_8019F04(u8 * r5)
|
||||
{
|
||||
s32 i;
|
||||
for (i = 0; i < 40; i++)
|
||||
{
|
||||
DestroySprite(&gSprites[r5[i]]);
|
||||
}
|
||||
}
|
||||
|
||||
void sub_8019F2C(void)
|
||||
{
|
||||
s32 i, j, x, y;
|
||||
for (i = 0; i < 8; i++)
|
||||
{
|
||||
for (j = 0; j < 5; j++)
|
||||
{
|
||||
sub_8019990(i, j, &x, &y);
|
||||
sub_8088B94(x, y, 0);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
static u8 sub_8019F64(u32 r1, u32 unused, struct UnkLinkRfuStruct_02022B14 * r2)
|
||||
{
|
||||
if (r1 != 0)
|
||||
{
|
||||
return gUnknown_082F076F[r1];
|
||||
}
|
||||
else if (r2->unk_0a_0 == 0x45)
|
||||
{
|
||||
return 1;
|
||||
}
|
||||
else
|
||||
{
|
||||
return 4;
|
||||
}
|
||||
}
|
||||
|
||||
static u32 sub_8019F8C(u32 a0, u32 a1)
|
||||
{
|
||||
return sub_8097C8C(5 * a0 + a1 - 0x38);
|
||||
}
|
||||
|
||||
static void sub_8019FA4(u32 r5, u32 r6, u8 r8, struct UnkLinkRfuStruct_02022B14 * r9)
|
||||
{
|
||||
s32 x, y;
|
||||
s32 r7 = 5 * r5 + r6;
|
||||
if (sub_8019F8C(r5, r6) == 1)
|
||||
{
|
||||
sub_8097C44(r7 - 0x38, FALSE);
|
||||
sub_8097CC4(r7 - 0x38, 1);
|
||||
}
|
||||
sub_8097BB4(r7 - 0x38, r8);
|
||||
sub_801A3B0(r6, r5, sub_8019F64(r6, r5, r9));
|
||||
sub_8019990(r5, r6, &x, &y);
|
||||
sub_8088B94(x, y, 1);
|
||||
}
|
||||
|
||||
static void sub_801A02C(u32 a0, u32 a1)
|
||||
{
|
||||
s32 x, y;
|
||||
sub_8097CC4(5 * a0 + a1 - 0x38, 2);
|
||||
sub_8019990(a0, a1, &x, &y);
|
||||
sub_8088B94(x, y, 0);
|
||||
}
|
||||
|
||||
static void sub_801A064(u32 r7, struct UnkLinkRfuStruct_02022B14 * r8)
|
||||
{
|
||||
s16 x, y, x2, y2;
|
||||
s32 i;
|
||||
|
||||
PlayerGetDestCoords(&x, &y);
|
||||
player_get_pos_including_state_based_drift(&x2, &y2);
|
||||
if (sub_8097C8C(5 * r7 - 0x38) == 1)
|
||||
{
|
||||
if (sub_80199E0(r7, 0, x, y) == 1 || sub_80199E0(r7, 0, x2, y2) == 1)
|
||||
{
|
||||
return;
|
||||
}
|
||||
sub_8019FA4(r7, 0, sub_8019978(r8->playerGender, r8->unk_00.playerTrainerId[0]), r8);
|
||||
}
|
||||
for (i = 1; i < 5; i++)
|
||||
{
|
||||
if (r8->unk_04[i - 1] == 0)
|
||||
{
|
||||
sub_801A02C(r7, i);
|
||||
}
|
||||
else if (sub_80199E0(r7, i, x, y) == 0 && sub_80199E0(r7, i, x2, y2) == 0)
|
||||
{
|
||||
sub_8019FA4(r7, i, sub_8019978((r8->unk_04[i - 1] >> 3) & 1, r8->unk_04[i - 1] & 7), r8);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
static void sub_801A16C(u32 r5, struct UnkLinkRfuStruct_02022B14 * r4)
|
||||
{
|
||||
u32 i;
|
||||
switch (r4->unk_0a_0)
|
||||
{
|
||||
case 0x40:
|
||||
case 0x54:
|
||||
sub_8019CF0(r5, r4->playerGender, r4->unk_00.playerTrainerId[0]);
|
||||
for (i = 0; i < 5; i++)
|
||||
{
|
||||
sub_801A02C(r5, i);
|
||||
}
|
||||
break;
|
||||
case 0x41:
|
||||
case 0x44:
|
||||
case 0x45:
|
||||
case 0x48:
|
||||
case 0x51:
|
||||
case 0x52:
|
||||
case 0x53:
|
||||
sub_8019D20(r5);
|
||||
sub_801A064(r5, r4);
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
static void sub_801A214(u32 r5, struct UnkLinkRfuStruct_02022B14 * unused)
|
||||
{
|
||||
s32 i;
|
||||
sub_8019D20(r5);
|
||||
for (i = 0; i < 5; i++)
|
||||
{
|
||||
sub_801A02C(r5, i);
|
||||
}
|
||||
}
|
||||
|
||||
static void sub_801A234(struct UnkStruct_URoom *r0)
|
||||
{
|
||||
s32 i;
|
||||
struct UnkStruct_x20 * r4;
|
||||
gUnknown_02022C68 = 0;
|
||||
for (i = 0, r4 = r0->field_0->arr; i < 8; i++)
|
||||
{
|
||||
if (r4[i].field_1A_0 == 1)
|
||||
{
|
||||
sub_801A16C(i, &r4[i].unk.field_0);
|
||||
}
|
||||
else if (r4[i].field_1A_0 == 2)
|
||||
{
|
||||
sub_801A214(i, &r4[i].unk.field_0);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
void sub_801A274(struct UnkStruct_URoom *unused)
|
||||
{
|
||||
gUnknown_02022C68 = 300;
|
||||
}
|
||||
|
||||
void sub_801A284(struct UnkStruct_URoom *r2)
|
||||
{
|
||||
if (++gUnknown_02022C68 > 300)
|
||||
{
|
||||
sub_801A234(r2);
|
||||
}
|
||||
}
|
||||
|
||||
bool32 sub_801A2A8(struct UnkStruct_Main0 *arg0, s16 *arg1, s16 *arg2, u8 *arg3)
|
||||
{
|
||||
s16 x, y;
|
||||
s32 i, j;
|
||||
struct UnkStruct_x20 * r4;
|
||||
if (!is_walking_or_running())
|
||||
{
|
||||
return FALSE;
|
||||
}
|
||||
GetXYCoordsOneStepInFrontOfPlayer(&x, &y);
|
||||
for (i = 0, r4 = arg0->arr; i < 8; i++)
|
||||
{
|
||||
for (j = 0; j < 5; j++)
|
||||
{
|
||||
s32 r3 = 5 * i + j;
|
||||
if (x != gUnknown_082F0740[i][0] + gUnknown_082F0760[j][0] + 7)
|
||||
{
|
||||
continue;
|
||||
}
|
||||
if (y != gUnknown_082F0740[i][1] + gUnknown_082F0760[j][1] + 7)
|
||||
{
|
||||
continue;
|
||||
}
|
||||
if (sub_8097C8C(r3 - 0x38) != 0)
|
||||
{
|
||||
continue;
|
||||
}
|
||||
if (sub_8097D9C(r3 - 0x38) != 0)
|
||||
{
|
||||
continue;
|
||||
}
|
||||
if (r4[i].field_1A_0 != 1)
|
||||
{
|
||||
continue;
|
||||
}
|
||||
sub_801A3B0(j, i, gUnknown_082F076A[GetPlayerFacingDirection()]);
|
||||
*arg1 = j;
|
||||
*arg2 = i;
|
||||
return TRUE;
|
||||
}
|
||||
}
|
||||
return FALSE;
|
||||
}
|
||||
|
||||
static void sub_801A3B0(s32 arg0, s32 arg1, u8 arg2)
|
||||
{
|
||||
sub_8097B78(5 * arg1 - 0x38 + arg0, arg2);
|
||||
}
|
||||
|
||||
void sub_801A3D0(u32 arg0, u32 arg1, struct UnkStruct_Main0 *arg2)
|
||||
{
|
||||
return sub_801A3B0(arg0, arg1, sub_8019F64(arg0, arg1, &arg2->arr[arg1].unk.field_0));
|
||||
}
|
||||
+298
-766
File diff suppressed because it is too large
Load Diff
+2
-2
@@ -218,7 +218,7 @@ int CountTrailingZeroBits(u32 value)
|
||||
return 0;
|
||||
}
|
||||
|
||||
u16 CalcCRC16(u8 *data, s32 length)
|
||||
u16 CalcCRC16(const u8 *data, s32 length)
|
||||
{
|
||||
u16 i, j;
|
||||
u16 crc = 0x1121;
|
||||
@@ -237,7 +237,7 @@ u16 CalcCRC16(u8 *data, s32 length)
|
||||
return ~crc;
|
||||
}
|
||||
|
||||
u16 CalcCRC16WithTable(u8 *data, u32 length)
|
||||
u16 CalcCRC16WithTable(const u8 *data, u32 length)
|
||||
{
|
||||
u16 i;
|
||||
u16 crc = 0x1121;
|
||||
|
||||
Reference in New Issue
Block a user