Remove uses of INVALID_ defines, clean up some arrays with constants, and spaces -> tabs

This commit is contained in:
nullableVoidPtr 2018-12-05 22:31:01 +08:00
parent 405f1bb529
commit f9ff7316d5
140 changed files with 27697 additions and 23904 deletions

View File

@ -25,14 +25,6 @@
#define INCBIN_S32 {0}
#endif // IDE support
// Invalid / Out of Bound Placeholder values
#define INVALID_U8 0xFF
#define INVALID_U16 0xFFFF
#define INVALID_U32 0xFFFFFFFF
#define INVALID_S8 -1
#define INVALID_S16 -1
#define INVALID_S32 -1
#define ARRAY_COUNT(array) (size_t)(sizeof(array) / sizeof((array)[0]))
#define SWAP(a, b, temp) \

View File

@ -1079,7 +1079,7 @@ void ResetApprenticeStruct(struct Apprentice *apprentice)
u8 i;
for (i = 0; i < 6; i++)
apprentice->easyChatWords[i] |= INVALID_U16;
apprentice->easyChatWords[i] |= 0xFFFF;
apprentice->playerName[0] = EOS;
apprentice->id = 16;
@ -1093,7 +1093,7 @@ void ResetAllApprenticeData(void)
for (i = 0; i < 4; i++)
{
for (j = 0; j < 6; j++)
gSaveBlock2Ptr->apprentices[i].easyChatWords[j] |= INVALID_U16;
gSaveBlock2Ptr->apprentices[i].easyChatWords[j] |= 0xFFFF;
gSaveBlock2Ptr->apprentices[i].id = 16;
gSaveBlock2Ptr->apprentices[i].playerName[0] = EOS;
gSaveBlock2Ptr->apprentices[i].lvlMode = 0;
@ -1290,7 +1290,7 @@ static u16 sub_819FF98(u8 arg0)
else
level = 60;
for (j = 0; learnset[j] != INVALID_U16; j++)
for (j = 0; learnset[j] != 0xFFFF; j++)
{
if ((learnset[j] & 0xFE00) > (level << 9))
break;
@ -1393,7 +1393,7 @@ static void GetLatestLearnedMoves(u16 species, u16 *moves)
level = 60;
learnset = gLevelUpLearnsets[species];
for (i = 0; learnset[i] != INVALID_U16; i++)
for (i = 0; learnset[i] != 0xFFFF; i++)
{
if ((learnset[i] & 0xFE00) > (level << 9))
break;
@ -2047,172 +2047,172 @@ NAKED
static void sub_81A1224(void)
{
asm_unified("\n\
push {r4-r7,lr}\n\
mov r7, r9\n\
mov r6, r8\n\
push {r6,r7}\n\
ldr r1, =gSaveBlock2Ptr\n\
ldr r3, [r1]\n\
adds r0, r3, 0\n\
adds r0, 0xB1\n\
ldrb r0, [r0]\n\
lsls r0, 26\n\
lsrs r0, 28\n\
adds r7, r1, 0\n\
cmp r0, 0x2\n\
bhi _081A1242\n\
b _081A1362\n\
push {r4-r7,lr}\n\
mov r7, r9\n\
mov r6, r8\n\
push {r6,r7}\n\
ldr r1, =gSaveBlock2Ptr\n\
ldr r3, [r1]\n\
adds r0, r3, 0\n\
adds r0, 0xB1\n\
ldrb r0, [r0]\n\
lsls r0, 26\n\
lsrs r0, 28\n\
adds r7, r1, 0\n\
cmp r0, 0x2\n\
bhi _081A1242\n\
b _081A1362\n\
_081A1242:\n\
movs r5, 0\n\
movs r2, 0\n\
adds r0, r3, 0\n\
adds r0, 0xB8\n\
ldrb r0, [r0]\n\
lsls r0, 30\n\
ldr r1, =gSpecialVar_0x8005\n\
mov r12, r1\n\
ldr r1, =gSpecialVar_Result\n\
mov r8, r1\n\
cmp r0, 0\n\
beq _081A127C\n\
adds r3, r7, 0\n\
movs r5, 0\n\
movs r2, 0\n\
adds r0, r3, 0\n\
adds r0, 0xB8\n\
ldrb r0, [r0]\n\
lsls r0, 30\n\
ldr r1, =gSpecialVar_0x8005\n\
mov r12, r1\n\
ldr r1, =gSpecialVar_Result\n\
mov r8, r1\n\
cmp r0, 0\n\
beq _081A127C\n\
adds r3, r7, 0\n\
_081A125C:\n\
adds r0, r5, 0x1\n\
lsls r0, 24\n\
lsrs r5, r0, 24\n\
adds r0, r2, 0x1\n\
lsls r0, 24\n\
lsrs r2, r0, 24\n\
cmp r2, 0x8\n\
bhi _081A127C\n\
ldr r0, [r3]\n\
lsls r1, r2, 2\n\
adds r0, r1\n\
adds r0, 0xB8\n\
ldrb r0, [r0]\n\
lsls r0, 30\n\
cmp r0, 0\n\
bne _081A125C\n\
adds r0, r5, 0x1\n\
lsls r0, 24\n\
lsrs r5, r0, 24\n\
adds r0, r2, 0x1\n\
lsls r0, 24\n\
lsrs r2, r0, 24\n\
cmp r2, 0x8\n\
bhi _081A127C\n\
ldr r0, [r3]\n\
lsls r1, r2, 2\n\
adds r0, r1\n\
adds r0, 0xB8\n\
ldrb r0, [r0]\n\
lsls r0, 30\n\
cmp r0, 0\n\
bne _081A125C\n\
_081A127C:\n\
movs r4, 0\n\
cmp r4, r5\n\
bcs _081A1322\n\
ldr r0, [r7]\n\
adds r0, 0xB1\n\
ldrb r0, [r0]\n\
lsls r0, 26\n\
lsrs r0, 28\n\
subs r0, 0x3\n\
cmp r4, r0\n\
bge _081A1322\n\
adds r6, r7, 0\n\
mov r9, r4\n\
movs r4, 0\n\
cmp r4, r5\n\
bcs _081A1322\n\
ldr r0, [r7]\n\
adds r0, 0xB1\n\
ldrb r0, [r0]\n\
lsls r0, 26\n\
lsrs r0, 28\n\
subs r0, 0x3\n\
cmp r4, r0\n\
bge _081A1322\n\
adds r6, r7, 0\n\
mov r9, r4\n\
_081A1296:\n\
ldr r3, [r6]\n\
lsls r0, r4, 2\n\
adds r2, r3, r0\n\
adds r0, r2, 0\n\
adds r0, 0xB8\n\
ldrb r1, [r0]\n\
lsls r0, r1, 30\n\
lsrs r0, 30\n\
cmp r0, 0x1\n\
bne _081A1308\n\
lsrs r0, r1, 6\n\
cmp r0, 0\n\
beq _081A1308\n\
adds r0, r2, 0\n\
adds r0, 0xBA\n\
ldrh r0, [r0]\n\
mov r2, r12\n\
ldrh r2, [r2]\n\
cmp r0, r2\n\
bne _081A1308\n\
adds r0, r3, 0\n\
adds r0, 0xB1\n\
ldrb r0, [r0]\n\
lsls r0, 26\n\
lsrs r0, 28\n\
subs r0, 0x3\n\
lsls r0, 2\n\
adds r0, r3, r0\n\
adds r0, 0xB8\n\
ldrb r2, [r0]\n\
movs r1, 0x3F\n\
ands r1, r2\n\
strb r1, [r0]\n\
ldr r1, [r6]\n\
adds r0, r1, 0\n\
adds r0, 0xB1\n\
ldrb r0, [r0]\n\
lsls r0, 26\n\
lsrs r0, 28\n\
subs r0, 0x3\n\
lsls r0, 2\n\
adds r1, r0\n\
mov r2, r12\n\
ldrh r0, [r2]\n\
adds r1, 0xBA\n\
strh r0, [r1]\n\
mov r1, r9\n\
mov r0, r8\n\
strh r1, [r0]\n\
b _081A1362\n\
.pool\n\
ldr r3, [r6]\n\
lsls r0, r4, 2\n\
adds r2, r3, r0\n\
adds r0, r2, 0\n\
adds r0, 0xB8\n\
ldrb r1, [r0]\n\
lsls r0, r1, 30\n\
lsrs r0, 30\n\
cmp r0, 0x1\n\
bne _081A1308\n\
lsrs r0, r1, 6\n\
cmp r0, 0\n\
beq _081A1308\n\
adds r0, r2, 0\n\
adds r0, 0xBA\n\
ldrh r0, [r0]\n\
mov r2, r12\n\
ldrh r2, [r2]\n\
cmp r0, r2\n\
bne _081A1308\n\
adds r0, r3, 0\n\
adds r0, 0xB1\n\
ldrb r0, [r0]\n\
lsls r0, 26\n\
lsrs r0, 28\n\
subs r0, 0x3\n\
lsls r0, 2\n\
adds r0, r3, r0\n\
adds r0, 0xB8\n\
ldrb r2, [r0]\n\
movs r1, 0x3F\n\
ands r1, r2\n\
strb r1, [r0]\n\
ldr r1, [r6]\n\
adds r0, r1, 0\n\
adds r0, 0xB1\n\
ldrb r0, [r0]\n\
lsls r0, 26\n\
lsrs r0, 28\n\
subs r0, 0x3\n\
lsls r0, 2\n\
adds r1, r0\n\
mov r2, r12\n\
ldrh r0, [r2]\n\
adds r1, 0xBA\n\
strh r0, [r1]\n\
mov r1, r9\n\
mov r0, r8\n\
strh r1, [r0]\n\
b _081A1362\n\
.pool\n\
_081A1308:\n\
adds r0, r4, 0x1\n\
lsls r0, 24\n\
lsrs r4, r0, 24\n\
cmp r4, r5\n\
bcs _081A1322\n\
ldr r0, [r6]\n\
adds r0, 0xB1\n\
ldrb r0, [r0]\n\
lsls r0, 26\n\
lsrs r0, 28\n\
subs r0, 0x3\n\
cmp r4, r0\n\
blt _081A1296\n\
adds r0, r4, 0x1\n\
lsls r0, 24\n\
lsrs r4, r0, 24\n\
cmp r4, r5\n\
bcs _081A1322\n\
ldr r0, [r6]\n\
adds r0, 0xB1\n\
ldrb r0, [r0]\n\
lsls r0, 26\n\
lsrs r0, 28\n\
subs r0, 0x3\n\
cmp r4, r0\n\
blt _081A1296\n\
_081A1322:\n\
ldr r2, [r7]\n\
adds r0, r2, 0\n\
adds r0, 0xB1\n\
ldrb r0, [r0]\n\
lsls r0, 26\n\
lsrs r0, 28\n\
subs r0, 0x3\n\
lsls r0, 2\n\
adds r2, r0\n\
adds r2, 0xB8\n\
ldrb r1, [r2]\n\
movs r0, 0x3F\n\
ands r0, r1\n\
movs r1, 0x40\n\
orrs r0, r1\n\
strb r0, [r2]\n\
ldr r1, [r7]\n\
adds r0, r1, 0\n\
adds r0, 0xB1\n\
ldrb r0, [r0]\n\
lsls r0, 26\n\
lsrs r0, 28\n\
subs r0, 0x3\n\
lsls r0, 2\n\
adds r1, r0\n\
mov r2, r12\n\
ldrh r0, [r2]\n\
adds r1, 0xBA\n\
strh r0, [r1]\n\
movs r0, 0x1\n\
mov r1, r8\n\
strh r0, [r1]\n\
ldr r2, [r7]\n\
adds r0, r2, 0\n\
adds r0, 0xB1\n\
ldrb r0, [r0]\n\
lsls r0, 26\n\
lsrs r0, 28\n\
subs r0, 0x3\n\
lsls r0, 2\n\
adds r2, r0\n\
adds r2, 0xB8\n\
ldrb r1, [r2]\n\
movs r0, 0x3F\n\
ands r0, r1\n\
movs r1, 0x40\n\
orrs r0, r1\n\
strb r0, [r2]\n\
ldr r1, [r7]\n\
adds r0, r1, 0\n\
adds r0, 0xB1\n\
ldrb r0, [r0]\n\
lsls r0, 26\n\
lsrs r0, 28\n\
subs r0, 0x3\n\
lsls r0, 2\n\
adds r1, r0\n\
mov r2, r12\n\
ldrh r0, [r2]\n\
adds r1, 0xBA\n\
strh r0, [r1]\n\
movs r0, 0x1\n\
mov r1, r8\n\
strh r0, [r1]\n\
_081A1362:\n\
pop {r3,r4}\n\
mov r8, r3\n\
mov r9, r4\n\
pop {r4-r7}\n\
pop {r0}\n\
bx r0\n\
pop {r3,r4}\n\
mov r8, r3\n\
mov r9, r4\n\
pop {r4-r7}\n\
pop {r0}\n\
bx r0\n\
");
}
#endif // NONMATCHING
@ -2236,7 +2236,7 @@ static void sub_81A1370(void)
}
r10 = 0xFFFF;
r9 = INVALID_S32;
r9 = -1;
for (i = 1; i < 4; i++)
{
if (GetTrainerId(gSaveBlock2Ptr->apprentices[i].playerId) == GetTrainerId(gSaveBlock2Ptr->playerTrainerId)

View File

@ -54,7 +54,7 @@ void GetWordPhonemes(struct BardSong *song, u16 word)
for (i = 0; i < 6; i ++)
{
sound = &song->sound[i];
if (sound->var00 != INVALID_U8)
if (sound->var00 != 0xFF)
{
song->phonemes[i].length = sound->var01 + gBardSoundLengthTable[sound->var00];
song->phonemes[i].pitch = CalcWordPitch(word + 30, i);

View File

@ -276,7 +276,7 @@ static const u16 sDiscouragedPowerfulMoveEffects[] =
EFFECT_SUPERPOWER,
EFFECT_ERUPTION,
EFFECT_OVERHEAT,
INVALID_U16
0xFFFF
};
// code
@ -463,8 +463,8 @@ static u8 ChooseMoveOrAction_Doubles(void)
{
if (i == sBattler_AI || gBattleMons[i].hp == 0)
{
actionOrMoveIndex[i] = INVALID_U8;
bestMovePointsForTarget[i] = INVALID_S16 ;
actionOrMoveIndex[i] = 0xFF;
bestMovePointsForTarget[i] = -1 ;
}
else
{
@ -530,7 +530,7 @@ static u8 ChooseMoveOrAction_Doubles(void)
// Don't use a move against ally if it has less than 100 points.
if (i == (sBattler_AI ^ BIT_FLANK) && bestMovePointsForTarget[i] < 100)
{
bestMovePointsForTarget[i] = INVALID_S16;
bestMovePointsForTarget[i] = -1;
mostViableMovesScores[0] = mostViableMovesScores[0]; // Needed to match.
}
}
@ -1003,7 +1003,7 @@ static void BattleAICmd_if_in_bytes(void)
{
const u8 *ptr = T1_READ_PTR(gAIScriptPtr + 1);
while (*ptr != INVALID_U8)
while (*ptr != 0xFF)
{
if (AI_THINKING_STRUCT->funcResult == *ptr)
{
@ -1019,7 +1019,7 @@ static void BattleAICmd_if_not_in_bytes(void)
{
const u8 *ptr = T1_READ_PTR(gAIScriptPtr + 1);
while (*ptr != INVALID_U8)
while (*ptr != 0xFF)
{
if (AI_THINKING_STRUCT->funcResult == *ptr)
{
@ -1035,7 +1035,7 @@ static void BattleAICmd_if_in_hwords(void)
{
const u16 *ptr = (const u16 *)T1_READ_PTR(gAIScriptPtr + 1);
while (*ptr != INVALID_U16)
while (*ptr != 0xFFFF)
{
if (AI_THINKING_STRUCT->funcResult == *ptr)
{
@ -1051,7 +1051,7 @@ static void BattleAICmd_if_not_in_hwords(void)
{
const u16 *ptr = (const u16 *)T1_READ_PTR(gAIScriptPtr + 1);
while (*ptr != INVALID_U16)
while (*ptr != 0xFFFF)
{
if (AI_THINKING_STRUCT->funcResult == *ptr)
{
@ -1167,14 +1167,14 @@ static void BattleAICmd_get_how_powerful_move_is(void)
s32 i, checkedMove;
s32 moveDmgs[4];
for (i = 0; sDiscouragedPowerfulMoveEffects[i] != INVALID_U16; i++)
for (i = 0; sDiscouragedPowerfulMoveEffects[i] != 0xFFFF; i++)
{
if (gBattleMoves[AI_THINKING_STRUCT->moveConsidered].effect == sDiscouragedPowerfulMoveEffects[i])
break;
}
if (gBattleMoves[AI_THINKING_STRUCT->moveConsidered].power > 1
&& sDiscouragedPowerfulMoveEffects[i] == INVALID_U16)
&& sDiscouragedPowerfulMoveEffects[i] == 0xFFFF)
{
gDynamicBasePower = 0;
*(&gBattleStruct->dynamicMoveType) = 0;
@ -1184,14 +1184,14 @@ static void BattleAICmd_get_how_powerful_move_is(void)
for (checkedMove = 0; checkedMove < 4; checkedMove++)
{
for (i = 0; sDiscouragedPowerfulMoveEffects[i] != INVALID_U16; i++)
for (i = 0; sDiscouragedPowerfulMoveEffects[i] != 0xFFFF; i++)
{
if (gBattleMoves[gBattleMons[sBattler_AI].moves[checkedMove]].effect == sDiscouragedPowerfulMoveEffects[i])
break;
}
if (gBattleMons[sBattler_AI].moves[checkedMove] != MOVE_NONE
&& sDiscouragedPowerfulMoveEffects[i] == INVALID_U16
&& sDiscouragedPowerfulMoveEffects[i] == 0xFFFF
&& gBattleMoves[gBattleMons[sBattler_AI].moves[checkedMove]].power > 1)
{
gCurrentMove = gBattleMons[sBattler_AI].moves[checkedMove];

View File

@ -126,7 +126,7 @@ static bool8 FindMonThatAbsorbsOpponentsMove(void)
return FALSE;
if (gLastLandedMoves[gActiveBattler] == 0)
return FALSE;
if (gLastLandedMoves[gActiveBattler] == INVALID_U16)
if (gLastLandedMoves[gActiveBattler] == 0xFFFF)
return FALSE;
if (gBattleMoves[gLastLandedMoves[gActiveBattler]].power == 0)
return FALSE;
@ -221,7 +221,7 @@ static bool8 ShouldSwitchIfNaturalCure(void)
if (gBattleMons[gActiveBattler].hp < gBattleMons[gActiveBattler].maxHP / 2)
return FALSE;
if ((gLastLandedMoves[gActiveBattler] == 0 || gLastLandedMoves[gActiveBattler] == INVALID_U16) && Random() & 1)
if ((gLastLandedMoves[gActiveBattler] == 0 || gLastLandedMoves[gActiveBattler] == 0xFFFF) && Random() & 1)
{
*(gBattleStruct->AI_monToSwitchIntoId + gActiveBattler) = PARTY_SIZE;
BtlController_EmitTwoReturnValues(1, B_ACTION_SWITCH, 0);
@ -331,9 +331,9 @@ static bool8 FindMonWithFlagsAndSuperEffective(u8 flags, u8 moduloPercent)
if (gLastLandedMoves[gActiveBattler] == 0)
return FALSE;
if (gLastLandedMoves[gActiveBattler] == INVALID_U16)
if (gLastLandedMoves[gActiveBattler] == 0xFFFF)
return FALSE;
if (gLastHitBy[gActiveBattler] == INVALID_U8)
if (gLastHitBy[gActiveBattler] == 0xFF)
return FALSE;
if (gBattleMoves[gLastLandedMoves[gActiveBattler]].power == 0)
return FALSE;

View File

@ -1386,54 +1386,54 @@ const struct BattleAnimBackground gBattleAnimBackgroundTable[] =
static void (* const sScriptCmdTable[])(void) =
{
ScriptCmd_loadspritegfx,
ScriptCmd_unloadspritegfx,
ScriptCmd_createsprite,
ScriptCmd_createvisualtask,
ScriptCmd_delay,
ScriptCmd_waitforvisualfinish,
ScriptCmd_hang1,
ScriptCmd_hang2,
ScriptCmd_end,
ScriptCmd_playse,
ScriptCmd_monbg,
ScriptCmd_clearmonbg,
ScriptCmd_setalpha,
ScriptCmd_blendoff,
ScriptCmd_call,
ScriptCmd_return,
ScriptCmd_setarg,
ScriptCmd_choosetwoturnanim,
ScriptCmd_jumpifmoveturn,
ScriptCmd_goto,
ScriptCmd_fadetobg,
ScriptCmd_restorebg,
ScriptCmd_waitbgfadeout,
ScriptCmd_waitbgfadein,
ScriptCmd_changebg,
ScriptCmd_playsewithpan,
ScriptCmd_setpan,
ScriptCmd_panse_1B,
ScriptCmd_loopsewithpan,
ScriptCmd_waitplaysewithpan,
ScriptCmd_setbldcnt,
ScriptCmd_createsoundtask,
ScriptCmd_waitsound,
ScriptCmd_jumpargeq,
ScriptCmd_monbg_22,
ScriptCmd_clearmonbg_23,
ScriptCmd_jumpifcontest,
ScriptCmd_fadetobgfromset,
ScriptCmd_panse_26,
ScriptCmd_panse_27,
ScriptCmd_monbgprio_28,
ScriptCmd_monbgprio_29,
ScriptCmd_monbgprio_2A,
ScriptCmd_invisible,
ScriptCmd_visible,
ScriptCmd_doublebattle_2D,
ScriptCmd_doublebattle_2E,
ScriptCmd_stopsound
ScriptCmd_loadspritegfx,
ScriptCmd_unloadspritegfx,
ScriptCmd_createsprite,
ScriptCmd_createvisualtask,
ScriptCmd_delay,
ScriptCmd_waitforvisualfinish,
ScriptCmd_hang1,
ScriptCmd_hang2,
ScriptCmd_end,
ScriptCmd_playse,
ScriptCmd_monbg,
ScriptCmd_clearmonbg,
ScriptCmd_setalpha,
ScriptCmd_blendoff,
ScriptCmd_call,
ScriptCmd_return,
ScriptCmd_setarg,
ScriptCmd_choosetwoturnanim,
ScriptCmd_jumpifmoveturn,
ScriptCmd_goto,
ScriptCmd_fadetobg,
ScriptCmd_restorebg,
ScriptCmd_waitbgfadeout,
ScriptCmd_waitbgfadein,
ScriptCmd_changebg,
ScriptCmd_playsewithpan,
ScriptCmd_setpan,
ScriptCmd_panse_1B,
ScriptCmd_loopsewithpan,
ScriptCmd_waitplaysewithpan,
ScriptCmd_setbldcnt,
ScriptCmd_createsoundtask,
ScriptCmd_waitsound,
ScriptCmd_jumpargeq,
ScriptCmd_monbg_22,
ScriptCmd_clearmonbg_23,
ScriptCmd_jumpifcontest,
ScriptCmd_fadetobgfromset,
ScriptCmd_panse_26,
ScriptCmd_panse_27,
ScriptCmd_monbgprio_28,
ScriptCmd_monbgprio_29,
ScriptCmd_monbgprio_2A,
ScriptCmd_invisible,
ScriptCmd_visible,
ScriptCmd_doublebattle_2D,
ScriptCmd_doublebattle_2E,
ScriptCmd_stopsound
};
// code
@ -1452,14 +1452,14 @@ void ClearBattleAnimationVars(void)
// Clear index array.
for (i = 0; i < ANIM_SPRITE_INDEX_COUNT; i++)
sAnimSpriteIndexArray[i] |= INVALID_U16;
sAnimSpriteIndexArray[i] |= 0xFFFF;
// Clear anim args.
for (i = 0; i < ANIM_ARGS_COUNT; i++)
gBattleAnimArgs[i] = 0;
sMonAnimTaskIdArray[0] = INVALID_U8;
sMonAnimTaskIdArray[1] = INVALID_U8;
sMonAnimTaskIdArray[0] = 0xFF;
sMonAnimTaskIdArray[1] = 0xFF;
gAnimMoveTurn = 0;
sAnimBackgroundFadeState = 0;
sAnimMoveIndex = 0;
@ -1505,19 +1505,19 @@ void LaunchBattleAnimation(const u8 *const animsTable[], u16 tableId, bool8 isMo
for (i = 0; i < ANIM_ARGS_COUNT; i++)
gBattleAnimArgs[i] = 0;
sMonAnimTaskIdArray[0] = INVALID_U8;
sMonAnimTaskIdArray[1] = INVALID_U8;
sMonAnimTaskIdArray[0] = 0xFF;
sMonAnimTaskIdArray[1] = 0xFF;
sBattleAnimScriptPtr = animsTable[tableId];
gAnimScriptActive = TRUE;
gAnimFramesToWait = 0;
gAnimScriptCallback = RunAnimScriptCommand;
for (i = 0; i < ANIM_SPRITE_INDEX_COUNT; i++)
sAnimSpriteIndexArray[i] |= INVALID_U16;
sAnimSpriteIndexArray[i] |= 0xFFFF;
if (isMoveAnim)
{
for (i = 0; gMovesWithQuietBGM[i] != INVALID_U16; i++)
for (i = 0; gMovesWithQuietBGM[i] != 0xFFFF; i++)
{
if (tableId == gMovesWithQuietBGM[i])
{
@ -1558,7 +1558,7 @@ static void AddSpriteIndex(u16 index)
for (i = 0; i < ANIM_SPRITE_INDEX_COUNT; i++)
{
if (sAnimSpriteIndexArray[i] == INVALID_U16)
if (sAnimSpriteIndexArray[i] == 0xFFFF)
{
sAnimSpriteIndexArray[i] = index;
return;
@ -1574,7 +1574,7 @@ static void ClearSpriteIndex(u16 index)
{
if (sAnimSpriteIndexArray[i] == index)
{
sAnimSpriteIndexArray[i] |= INVALID_U16;
sAnimSpriteIndexArray[i] |= 0xFFFF;
return;
}
}
@ -1712,7 +1712,7 @@ static void ScriptCmd_delay(void)
sBattleAnimScriptPtr++;
gAnimFramesToWait = sBattleAnimScriptPtr[0];
if (gAnimFramesToWait == 0)
gAnimFramesToWait = INVALID_S8;
gAnimFramesToWait = -1;
sBattleAnimScriptPtr++;
gAnimScriptCallback = WaitAnimFrameCount;
}
@ -1746,7 +1746,7 @@ static void ScriptCmd_end(void)
// Keep waiting as long as there are animations to be done.
if (gAnimVisualTaskCount != 0 || gAnimSoundTaskCount != 0
|| sMonAnimTaskIdArray[0] != INVALID_U8 || sMonAnimTaskIdArray[1] != INVALID_U8)
|| sMonAnimTaskIdArray[0] != 0xFF || sMonAnimTaskIdArray[1] != 0xFF)
{
sSoundAnimFramesToWait = 0;
gAnimFramesToWait = 1;
@ -1773,11 +1773,11 @@ static void ScriptCmd_end(void)
for (i = 0; i < ANIM_SPRITE_INDEX_COUNT; i++)
{
if (sAnimSpriteIndexArray[i] != INVALID_U16)
if (sAnimSpriteIndexArray[i] != 0xFFFF)
{
FreeSpriteTilesByTag(gBattleAnimPicTable[sAnimSpriteIndexArray[i]].tag);
FreeSpritePaletteByTag(gBattleAnimPicTable[sAnimSpriteIndexArray[i]].tag);
sAnimSpriteIndexArray[i] |= INVALID_U16; // set terminator.
sAnimSpriteIndexArray[i] |= 0xFFFF; // set terminator.
}
}
@ -2122,9 +2122,9 @@ static void ScriptCmd_clearmonbg(void)
else
battlerId = gBattleAnimTarget;
if (sMonAnimTaskIdArray[0] != INVALID_U8)
if (sMonAnimTaskIdArray[0] != 0xFF)
gSprites[gBattlerSpriteIds[battlerId]].invisible = FALSE;
if (animBattlerId > 1 && sMonAnimTaskIdArray[1] != INVALID_U8)
if (animBattlerId > 1 && sMonAnimTaskIdArray[1] != 0xFF)
gSprites[gBattlerSpriteIds[battlerId ^ BIT_FLANK]].invisible = FALSE;
else
animBattlerId = 0;
@ -2148,17 +2148,17 @@ static void sub_80A4980(u8 taskId)
else
to_BG2 = TRUE;
if (sMonAnimTaskIdArray[0] != INVALID_U8)
if (sMonAnimTaskIdArray[0] != 0xFF)
{
sub_80A477C(to_BG2);
DestroyTask(sMonAnimTaskIdArray[0]);
sMonAnimTaskIdArray[0] = INVALID_U8;
sMonAnimTaskIdArray[0] = 0xFF;
}
if (gTasks[taskId].data[0] > 1)
{
sub_80A477C(to_BG2 ^ 1);
DestroyTask(sMonAnimTaskIdArray[1]);
sMonAnimTaskIdArray[1] = INVALID_U8;
sMonAnimTaskIdArray[1] = 0xFF;
}
DestroyTask(taskId);
}
@ -2421,7 +2421,7 @@ static void Task_FadeToBg(u8 taskId)
{
s16 bgId = gTasks[taskId].tBackgroundId;
if (bgId == INVALID_S16)
if (bgId == -1)
LoadDefaultBg();
else
LoadMoveBg(bgId);
@ -2477,7 +2477,7 @@ static void ScriptCmd_restorebg(void)
sBattleAnimScriptPtr++;
taskId = CreateTask(Task_FadeToBg, 5);
gTasks[taskId].tBackgroundId = INVALID_S16;
gTasks[taskId].tBackgroundId = -1;
sAnimBackgroundFadeState = 1;
}
@ -3001,7 +3001,7 @@ static void ScriptCmd_invisible(void)
u8 spriteId;
spriteId = GetAnimBattlerSpriteId(sBattleAnimScriptPtr[1]);
if (spriteId != INVALID_U8)
if (spriteId != 0xFF)
gSprites[spriteId].invisible = TRUE;
sBattleAnimScriptPtr += 2;
@ -3012,7 +3012,7 @@ static void ScriptCmd_visible(void)
u8 spriteId;
spriteId = GetAnimBattlerSpriteId(sBattleAnimScriptPtr[1]);
if (spriteId != INVALID_U8)
if (spriteId != 0xFF)
gSprites[spriteId].invisible = FALSE;
sBattleAnimScriptPtr += 2;
@ -3039,7 +3039,7 @@ static void ScriptCmd_doublebattle_2D(void)
r4 = sub_80A8364(gBattleAnimTarget);
spriteId = GetAnimBattlerSpriteId(ANIM_TARGET);
}
if (spriteId != INVALID_U8)
if (spriteId != 0xFF)
{
gSprites[spriteId].invisible = FALSE;
if (r4 == 2)
@ -3075,7 +3075,7 @@ static void ScriptCmd_doublebattle_2E(void)
spriteId = GetAnimBattlerSpriteId(ANIM_TARGET);
}
if (spriteId != INVALID_U8 && r4 == 2)
if (spriteId != 0xFF && r4 == 2)
gSprites[spriteId].oam.priority = 2;
}
}

View File

@ -1590,7 +1590,7 @@ s16 duplicate_obj_of_side_rel2move_in_transparent_mode(u8 whichBattler)
}
}
}
return INVALID_S16;
return -1;
}
void obj_delete_but_dont_free_vram(struct Sprite *sprite)

View File

@ -183,7 +183,7 @@ void sub_80A9EF4(u8 taskId)
SetGpuReg(REG_OFFSET_BLDCNT, BLDCNT_EFFECT_BLEND | BLDCNT_TGT2_ALL);
SetGpuReg(REG_OFFSET_BLDALPHA, BLDALPHA_BLEND(0, 16));
spriteId = CreateSprite(&gUnknown_0853EF48, x, y, 4);
if (GetSpriteTileStartByTag(ANIM_TAG_ICE_CUBE) == INVALID_U16)
if (GetSpriteTileStartByTag(ANIM_TAG_ICE_CUBE) == 0xFFFF)
gSprites[spriteId].invisible = TRUE;
SetSubspriteTables(&gSprites[spriteId], gUnknown_0853EF40);
gTasks[taskId].data[15] = spriteId;
@ -315,10 +315,10 @@ void AnimTask_StatsChange(u8 taskId)
CASE(MINUS2, STAT_ACC): goesDown = TRUE; animStatId = 2; sharply = TRUE; break;
CASE(MINUS2, STAT_EVASION): goesDown = TRUE; animStatId = 4; sharply = TRUE; break;
case STAT_ANIM_MULTIPLE_PLUS1: goesDown = FALSE; animStatId = INVALID_U8; sharply = FALSE; break;
case STAT_ANIM_MULTIPLE_PLUS2: goesDown = FALSE; animStatId = INVALID_U8; sharply = TRUE; break;
case STAT_ANIM_MULTIPLE_MINUS1: goesDown = TRUE; animStatId = INVALID_U8; sharply = FALSE; break;
case STAT_ANIM_MULTIPLE_MINUS2: goesDown = TRUE; animStatId = INVALID_U8; sharply = TRUE; break;
case STAT_ANIM_MULTIPLE_PLUS1: goesDown = FALSE; animStatId = 0xFF; sharply = FALSE; break;
case STAT_ANIM_MULTIPLE_PLUS2: goesDown = FALSE; animStatId = 0xFF; sharply = TRUE; break;
case STAT_ANIM_MULTIPLE_MINUS1: goesDown = TRUE; animStatId = 0xFF; sharply = FALSE; break;
case STAT_ANIM_MULTIPLE_MINUS2: goesDown = TRUE; animStatId = 0xFF; sharply = TRUE; break;
default:
DestroyAnimVisualTask(taskId);

View File

@ -214,7 +214,7 @@ void sub_8158E9C(u8 taskId)
if (species != SPECIES_NONE)
{
if (gBattleAnimArgs[1] == INVALID_U8)
if (gBattleAnimArgs[1] == 0xFF)
PlayCry3(species, pan, 9);
else
PlayCry3(species, pan, 7);
@ -238,7 +238,7 @@ static void sub_8158FF4(u8 taskId)
}
else
{
if (gTasks[taskId].data[0] == INVALID_U8)
if (gTasks[taskId].data[0] == 0xFF)
{
if (!IsCryPlaying())
{
@ -389,50 +389,50 @@ void sub_8159308(u8 taskId)
NAKED
void sub_8159308(u8 taskId)
{
asm_unified(" push {r4,r5,lr}\n\
lsls r0, 24\n\
lsrs r0, 24\n\
adds r5, r0, 0\n\
ldr r1, =gTasks\n\
lsls r0, r5, 2\n\
adds r0, r5\n\
lsls r0, 3\n\
adds r4, r0, r1\n\
ldrh r2, [r4, 0xE]\n\
ldrh r0, [r4, 0x1C]\n\
adds r1, r0, 0x1\n\
strh r1, [r4, 0x1C]\n\
lsls r0, 16\n\
asrs r0, 16\n\
movs r3, 0x12\n\
ldrsh r1, [r4, r3]\n\
cmp r0, r1\n\
bne _08159342\n\
movs r0, 0\n\
strh r0, [r4, 0x1C]\n\
ldrh r1, [r4, 0x1E]\n\
adds r0, r2, r1\n\
strh r0, [r4, 0x1E]\n\
movs r2, 0x1E\n\
ldrsh r0, [r4, r2]\n\
bl KeepPanInRange\n\
strh r0, [r4, 0x1E]\n\
asm_unified(" push {r4,r5,lr}\n\
lsls r0, 24\n\
lsrs r0, 24\n\
adds r5, r0, 0\n\
ldr r1, =gTasks\n\
lsls r0, r5, 2\n\
adds r0, r5\n\
lsls r0, 3\n\
adds r4, r0, r1\n\
ldrh r2, [r4, 0xE]\n\
ldrh r0, [r4, 0x1C]\n\
adds r1, r0, 0x1\n\
strh r1, [r4, 0x1C]\n\
lsls r0, 16\n\
asrs r0, 16\n\
movs r3, 0x12\n\
ldrsh r1, [r4, r3]\n\
cmp r0, r1\n\
bne _08159342\n\
movs r0, 0\n\
strh r0, [r4, 0x1C]\n\
ldrh r1, [r4, 0x1E]\n\
adds r0, r2, r1\n\
strh r0, [r4, 0x1E]\n\
movs r2, 0x1E\n\
ldrsh r0, [r4, r2]\n\
bl KeepPanInRange\n\
strh r0, [r4, 0x1E]\n\
_08159342:\n\
ldr r1, =gUnknown_02038440\n\
ldrh r0, [r4, 0x1E]\n\
strb r0, [r1]\n\
movs r3, 0x1E\n\
ldrsh r1, [r4, r3]\n\
movs r2, 0xC\n\
ldrsh r0, [r4, r2]\n\
cmp r1, r0\n\
bne _0815935A\n\
adds r0, r5, 0\n\
bl DestroyAnimVisualTask\n\
ldr r1, =gUnknown_02038440\n\
ldrh r0, [r4, 0x1E]\n\
strb r0, [r1]\n\
movs r3, 0x1E\n\
ldrsh r1, [r4, r3]\n\
movs r2, 0xC\n\
ldrsh r0, [r4, r2]\n\
cmp r1, r0\n\
bne _0815935A\n\
adds r0, r5, 0\n\
bl DestroyAnimVisualTask\n\
_0815935A:\n\
pop {r4,r5}\n\
pop {r0}\n\
bx r0\n\
.pool");
pop {r4,r5}\n\
pop {r0}\n\
bx r0\n\
.pool");
}
#endif

View File

@ -82,7 +82,7 @@ void sub_8116664(u8 taskId)
animBattlers[1] = gBattleAnimTarget;
break;
case 5:
animBattlers[0] = INVALID_U8;
animBattlers[0] = 0xFF;
break;
case 6:
selectedPalettes = 0;

View File

@ -449,7 +449,7 @@ static const union AnimCmd *const sSpriteAnimTable_8611F4C[] =
static const struct SpriteTemplate sSpriteTemplate_JudgmentIcon =
{
.tileTag = 0x3E8,
.paletteTag = INVALID_U16,
.paletteTag = 0xFFFF,
.oam = &sOamData_8611F24,
.anims = sSpriteAnimTable_8611F4C,
.images = NULL,

View File

@ -212,7 +212,7 @@ static void sub_8064470(void)
static void sub_80644D8(void)
{
if (--gBattleSpritesDataPtr->healthBoxesData[gActiveBattler].field_9 == INVALID_U8)
if (--gBattleSpritesDataPtr->healthBoxesData[gActiveBattler].field_9 == 0xFF)
{
gBattleSpritesDataPtr->healthBoxesData[gActiveBattler].field_9 = 0;
LinkOpponentBufferExecCompleted();
@ -395,7 +395,7 @@ static void CompleteOnHealthbarDone(void)
SetHealthboxSpriteVisible(gHealthboxSpriteIds[gActiveBattler]);
if (hpValue != INVALID_S16)
if (hpValue != -1)
{
UpdateHpTextInHealthbox(gHealthboxSpriteIds[gActiveBattler], hpValue, HP_CURRENT);
}

View File

@ -203,7 +203,7 @@ static void sub_814AF54(void)
static void sub_814AFBC(void)
{
if (--gBattleSpritesDataPtr->healthBoxesData[gActiveBattler].field_9 == INVALID_U8)
if (--gBattleSpritesDataPtr->healthBoxesData[gActiveBattler].field_9 == 0xFF)
{
gBattleSpritesDataPtr->healthBoxesData[gActiveBattler].field_9 = 0;
LinkPartnerBufferExecCompleted();
@ -279,7 +279,7 @@ static void CompleteOnHealthbarDone(void)
SetHealthboxSpriteVisible(gHealthboxSpriteIds[gActiveBattler]);
if (hpValue != INVALID_S16)
if (hpValue != -1)
{
UpdateHpTextInHealthbox(gHealthboxSpriteIds[gActiveBattler], hpValue, HP_CURRENT);
}

View File

@ -220,7 +220,7 @@ static void sub_805F240(void)
static void sub_805F2A8(void)
{
if (--gBattleSpritesDataPtr->healthBoxesData[gActiveBattler].field_9 == INVALID_U8)
if (--gBattleSpritesDataPtr->healthBoxesData[gActiveBattler].field_9 == 0xFF)
{
gBattleSpritesDataPtr->healthBoxesData[gActiveBattler].field_9 = 0;
OpponentBufferExecCompleted();
@ -389,7 +389,7 @@ static void CompleteOnHealthbarDone(void)
{
s16 hpValue = MoveBattleBar(gActiveBattler, gHealthboxSpriteIds[gActiveBattler], HEALTH_BAR, 0);
SetHealthboxSpriteVisible(gHealthboxSpriteIds[gActiveBattler]);
if (hpValue != INVALID_S16)
if (hpValue != -1)
{
UpdateHpTextInHealthbox(gHealthboxSpriteIds[gActiveBattler], hpValue, HP_CURRENT);
}

View File

@ -635,7 +635,7 @@ u32 sub_8057FBC(void) // unused
PlaySE(SE_SELECT);
gBattle_BG0_X = 0;
gBattle_BG0_Y = 0x140;
var = INVALID_U8;
var = 0xFF;
}
if (gMain.newKeys & DPAD_LEFT && gMoveSelectionCursor[gActiveBattler] & 1)
{
@ -936,7 +936,7 @@ static void sub_80588B4(void)
static void sub_8058924(void)
{
if (--gBattleSpritesDataPtr->healthBoxesData[gActiveBattler].field_9 == INVALID_U8)
if (--gBattleSpritesDataPtr->healthBoxesData[gActiveBattler].field_9 == 0xFF)
{
gBattleSpritesDataPtr->healthBoxesData[gActiveBattler].field_9 = 0;
PlayerBufferExecCompleted();
@ -1119,7 +1119,7 @@ static void CompleteOnHealthbarDone(void)
SetHealthboxSpriteVisible(gHealthboxSpriteIds[gActiveBattler]);
if (hpValue != INVALID_S16)
if (hpValue != -1)
{
UpdateHpTextInHealthbox(gHealthboxSpriteIds[gActiveBattler], hpValue, HP_CURRENT);
}
@ -1221,7 +1221,7 @@ static void sub_8059400(u8 taskId)
newExpPoints = MoveBattleBar(battlerId, gHealthboxSpriteIds[battlerId], EXP_BAR, 0);
SetHealthboxSpriteVisible(gHealthboxSpriteIds[battlerId]);
if (newExpPoints == INVALID_S16) // The bar has been filled with given exp points.
if (newExpPoints == -1) // The bar has been filled with given exp points.
{
u8 level;
s32 currExp;

View File

@ -218,7 +218,7 @@ static void sub_81BAE98(void)
static void sub_81BAF00(void)
{
if (--gBattleSpritesDataPtr->healthBoxesData[gActiveBattler].field_9 == INVALID_U8)
if (--gBattleSpritesDataPtr->healthBoxesData[gActiveBattler].field_9 == 0xFF)
{
gBattleSpritesDataPtr->healthBoxesData[gActiveBattler].field_9 = 0;
PlayerPartnerBufferExecCompleted();
@ -294,7 +294,7 @@ static void CompleteOnHealthbarDone(void)
SetHealthboxSpriteVisible(gHealthboxSpriteIds[gActiveBattler]);
if (hpValue != INVALID_S16)
if (hpValue != -1)
{
UpdateHpTextInHealthbox(gHealthboxSpriteIds[gActiveBattler], hpValue, HP_CURRENT);
}
@ -397,7 +397,7 @@ static void sub_81BB4E4(u8 taskId)
r4 = MoveBattleBar(battlerId, gHealthboxSpriteIds[battlerId], EXP_BAR, 0);
SetHealthboxSpriteVisible(gHealthboxSpriteIds[battlerId]);
if (r4 == INVALID_S16)
if (r4 == -1)
{
u8 level;
s32 currExp;

View File

@ -213,7 +213,7 @@ static void sub_81865C8(void)
static void sub_8186630(void)
{
if (--gBattleSpritesDataPtr->healthBoxesData[gActiveBattler].field_9 == INVALID_U8)
if (--gBattleSpritesDataPtr->healthBoxesData[gActiveBattler].field_9 == 0xFF)
{
gBattleSpritesDataPtr->healthBoxesData[gActiveBattler].field_9 = 0;
RecordedOpponentBufferExecCompleted();
@ -377,7 +377,7 @@ static void CompleteOnHealthbarDone(void)
SetHealthboxSpriteVisible(gHealthboxSpriteIds[gActiveBattler]);
if (hpValue != INVALID_S16)
if (hpValue != -1)
{
UpdateHpTextInHealthbox(gHealthboxSpriteIds[gActiveBattler], hpValue, HP_CURRENT);
}

View File

@ -202,7 +202,7 @@ static void sub_81899F0(void)
static void sub_8189A58(void)
{
if (--gBattleSpritesDataPtr->healthBoxesData[gActiveBattler].field_9 == INVALID_U8)
if (--gBattleSpritesDataPtr->healthBoxesData[gActiveBattler].field_9 == 0xFF)
{
gBattleSpritesDataPtr->healthBoxesData[gActiveBattler].field_9 = 0;
RecordedPlayerBufferExecCompleted();
@ -360,7 +360,7 @@ static void CompleteOnHealthbarDone(void)
SetHealthboxSpriteVisible(gHealthboxSpriteIds[gActiveBattler]);
if (hpValue != INVALID_S16)
if (hpValue != -1)
{
UpdateHpTextInHealthbox(gHealthboxSpriteIds[gActiveBattler], hpValue, HP_CURRENT);
}

View File

@ -348,7 +348,7 @@ static void CompleteOnHealthbarDone(void)
SetHealthboxSpriteVisible(gHealthboxSpriteIds[gActiveBattler]);
if (hpValue != INVALID_S16)
if (hpValue != -1)
{
UpdateHpTextInHealthbox(gHealthboxSpriteIds[gActiveBattler], hpValue, HP_CURRENT);
}

View File

@ -51,7 +51,7 @@ void SetUpBattleVarsAndBirchZigzagoon(void)
for (i = 0; i < MAX_BATTLERS_COUNT; i++)
{
gBattlerControllerFuncs[i] = nullsub_21;
gBattlerPositions[i] = INVALID_U8;
gBattlerPositions[i] = 0xFF;
gActionSelectionCursor[i] = 0;
gMoveSelectionCursor[i] = 0;
}

File diff suppressed because it is too large Load Diff

View File

@ -202,9 +202,9 @@ static void sub_81A5E94(void)
gUnknown_03001288 = FALSE;
for (i = 0; i < 6; i++)
gSaveBlock2Ptr->frontier.field_E70[i].monId |= INVALID_U16;
gSaveBlock2Ptr->frontier.field_E70[i].monId |= 0xFFFF;
for (i = 0; i < 3; i++)
gUnknown_03006298[i] |= INVALID_U16;
gUnknown_03006298[i] |= 0xFFFF;
saved_warp2_set(0, gSaveBlock1Ptr->location.mapGroup, gSaveBlock1Ptr->location.mapNum, -1);
gTrainerBattleOpponent_A = 0;

View File

@ -122,7 +122,7 @@ void FreeBattleSpritesData(void)
u16 ChooseMoveAndTargetInBattlePalace(void)
{
s32 i, var1, var2;
s32 chosenMoveId = INVALID_S32;
s32 chosenMoveId = -1;
struct ChooseMoveStruct *moveInfo = (struct ChooseMoveStruct*)(&gBattleBufferA[gActiveBattler][4]);
u8 unusableMovesBits = CheckMoveLimitations(gActiveBattler, 0, 0xFF);
s32 percent = Random() % 100;

View File

@ -543,11 +543,11 @@ enum
static const u16 sStatusIconColors[] =
{
RGB(24, 12, 24), // PAL_STATUS_PSN
RGB(23, 23, 3), // PAL_STATUS_PAR
RGB(20, 20, 17), // PAL_STATUS_SLP
RGB(17, 22, 28), // PAL_STATUS_FRZ
RGB(28, 14, 10) // PAL_STATUS_BRN
[PAL_STATUS_PSN] = RGB(24, 12, 24),
[PAL_STATUS_PAR] = RGB(23, 23, 3),
[PAL_STATUS_SLP] = RGB(20, 20, 17),
[PAL_STATUS_FRZ] = RGB(17, 22, 28),
[PAL_STATUS_BRN] = RGB(28, 14, 10),
};
static const struct WindowTemplate sHealthboxWindowTemplate = {0, 0, 0, 8, 2, 0, 0}; // width = 8, height = 2
@ -589,17 +589,17 @@ static void sub_8072308(s16 arg0, u16 *arg1, u8 arg2)
for (; i > -1; i--)
{
array[i] = INVALID_U8;
array[i] = 0xFF;
}
if (arrayPtr[3] == INVALID_U8)
if (arrayPtr[3] == 0xFF)
arrayPtr[3] = 0;
if (arg2 == 0)
{
for (i = 0, j = 0; i < 4; i++)
{
if (array[j] == INVALID_U8)
if (array[j] == 0xFF)
{
arg1[j] &= 0xFC00;
arg1[j] |= 0x1E;
@ -622,7 +622,7 @@ static void sub_8072308(s16 arg0, u16 *arg1, u8 arg2)
{
for (i = 0; i < 4; i++)
{
if (array[i] == INVALID_U8)
if (array[i] == 0xFF)
{
arg1[i] &= 0xFC00;
arg1[i] |= 0x1E;
@ -647,225 +647,225 @@ NAKED
static void sub_8072308(s16 arg0, u16 *arg1, u8 arg2)
{
asm(".syntax unified\n\
push {r4-r7,lr}\n\
mov r7, r10\n\
mov r6, r9\n\
mov r5, r8\n\
push {r5-r7}\n\
sub sp, 0x4\n\
adds r7, r1, 0\n\
lsls r0, 16\n\
lsrs r5, r0, 16\n\
lsls r2, 24\n\
lsrs r2, 24\n\
mov r10, r2\n\
movs r3, 0\n\
movs r2, 0\n\
push {r4-r7,lr}\n\
mov r7, r10\n\
mov r6, r9\n\
mov r5, r8\n\
push {r5-r7}\n\
sub sp, 0x4\n\
adds r7, r1, 0\n\
lsls r0, 16\n\
lsrs r5, r0, 16\n\
lsls r2, 24\n\
lsrs r2, 24\n\
mov r10, r2\n\
movs r3, 0\n\
movs r2, 0\n\
_08072324:\n\
lsls r0, r3, 24\n\
asrs r0, 24\n\
mov r3, sp\n\
adds r1, r3, r0\n\
strb r2, [r1]\n\
adds r0, 0x1\n\
lsls r0, 24\n\
lsrs r3, r0, 24\n\
asrs r0, 24\n\
cmp r0, 0x3\n\
ble _08072324\n\
movs r3, 0x3\n\
movs r0, 0x1\n\
negs r0, r0\n\
mov r9, r0\n\
mov r8, sp\n\
lsls r0, r3, 24\n\
asrs r0, 24\n\
mov r3, sp\n\
adds r1, r3, r0\n\
strb r2, [r1]\n\
adds r0, 0x1\n\
lsls r0, 24\n\
lsrs r3, r0, 24\n\
asrs r0, 24\n\
cmp r0, 0x3\n\
ble _08072324\n\
movs r3, 0x3\n\
movs r0, 0x1\n\
negs r0, r0\n\
mov r9, r0\n\
mov r8, sp\n\
_08072344:\n\
lsls r0, r5, 16\n\
asrs r6, r0, 16\n\
cmp r6, 0\n\
ble _08072372\n\
lsls r4, r3, 24\n\
asrs r4, 24\n\
mov r1, sp\n\
adds r5, r1, r4\n\
adds r0, r6, 0\n\
movs r1, 0xA\n\
bl __modsi3\n\
strb r0, [r5]\n\
adds r0, r6, 0\n\
movs r1, 0xA\n\
bl __divsi3\n\
lsls r0, 16\n\
lsrs r5, r0, 16\n\
subs r4, 0x1\n\
lsls r4, 24\n\
lsrs r3, r4, 24\n\
b _08072344\n\
lsls r0, r5, 16\n\
asrs r6, r0, 16\n\
cmp r6, 0\n\
ble _08072372\n\
lsls r4, r3, 24\n\
asrs r4, 24\n\
mov r1, sp\n\
adds r5, r1, r4\n\
adds r0, r6, 0\n\
movs r1, 0xA\n\
bl __modsi3\n\
strb r0, [r5]\n\
adds r0, r6, 0\n\
movs r1, 0xA\n\
bl __divsi3\n\
lsls r0, 16\n\
lsrs r5, r0, 16\n\
subs r4, 0x1\n\
lsls r4, 24\n\
lsrs r3, r4, 24\n\
b _08072344\n\
_08072372:\n\
lsls r1, r3, 24\n\
asrs r0, r1, 24\n\
cmp r0, r9\n\
ble _08072396\n\
movs r4, 0xFF\n\
movs r3, 0x1\n\
negs r3, r3\n\
lsls r1, r3, 24\n\
asrs r0, r1, 24\n\
cmp r0, r9\n\
ble _08072396\n\
movs r4, 0xFF\n\
movs r3, 0x1\n\
negs r3, r3\n\
_08072380:\n\
asrs r2, r1, 24\n\
mov r5, sp\n\
adds r1, r5, r2\n\
ldrb r0, [r1]\n\
orrs r0, r4\n\
strb r0, [r1]\n\
subs r2, 0x1\n\
lsls r1, r2, 24\n\
asrs r0, r1, 24\n\
cmp r0, r3\n\
bgt _08072380\n\
asrs r2, r1, 24\n\
mov r5, sp\n\
adds r1, r5, r2\n\
ldrb r0, [r1]\n\
orrs r0, r4\n\
strb r0, [r1]\n\
subs r2, 0x1\n\
lsls r1, r2, 24\n\
asrs r0, r1, 24\n\
cmp r0, r3\n\
bgt _08072380\n\
_08072396:\n\
mov r1, r8\n\
ldrb r0, [r1, 0x3]\n\
cmp r0, 0xFF\n\
bne _080723A2\n\
movs r0, 0\n\
strb r0, [r1, 0x3]\n\
mov r1, r8\n\
ldrb r0, [r1, 0x3]\n\
cmp r0, 0xFF\n\
bne _080723A2\n\
movs r0, 0\n\
strb r0, [r1, 0x3]\n\
_080723A2:\n\
mov r2, r10\n\
cmp r2, 0\n\
bne _08072432\n\
movs r3, 0\n\
movs r1, 0\n\
movs r6, 0xFC\n\
lsls r6, 8\n\
movs r5, 0x1E\n\
mov r12, r5\n\
mov r2, r10\n\
cmp r2, 0\n\
bne _08072432\n\
movs r3, 0\n\
movs r1, 0\n\
movs r6, 0xFC\n\
lsls r6, 8\n\
movs r5, 0x1E\n\
mov r12, r5\n\
_080723B4:\n\
lsls r1, 24\n\
asrs r2, r1, 24\n\
mov r0, sp\n\
adds r5, r0, r2\n\
ldrb r0, [r5]\n\
mov r8, r1\n\
cmp r0, 0xFF\n\
bne _080723EA\n\
lsls r1, r2, 1\n\
adds r1, r7\n\
ldrh r2, [r1]\n\
adds r0, r6, 0\n\
ands r0, r2\n\
mov r2, r12\n\
orrs r0, r2\n\
strh r0, [r1]\n\
lsls r3, 24\n\
asrs r1, r3, 23\n\
adds r1, r7\n\
adds r1, 0x40\n\
ldrh r2, [r1]\n\
adds r0, r6, 0\n\
ands r0, r2\n\
mov r5, r12\n\
orrs r0, r5\n\
strh r0, [r1]\n\
b _0807241A\n\
lsls r1, 24\n\
asrs r2, r1, 24\n\
mov r0, sp\n\
adds r5, r0, r2\n\
ldrb r0, [r5]\n\
mov r8, r1\n\
cmp r0, 0xFF\n\
bne _080723EA\n\
lsls r1, r2, 1\n\
adds r1, r7\n\
ldrh r2, [r1]\n\
adds r0, r6, 0\n\
ands r0, r2\n\
mov r2, r12\n\
orrs r0, r2\n\
strh r0, [r1]\n\
lsls r3, 24\n\
asrs r1, r3, 23\n\
adds r1, r7\n\
adds r1, 0x40\n\
ldrh r2, [r1]\n\
adds r0, r6, 0\n\
ands r0, r2\n\
mov r5, r12\n\
orrs r0, r5\n\
strh r0, [r1]\n\
b _0807241A\n\
_080723EA:\n\
lsls r2, 1\n\
adds r2, r7\n\
ldrh r0, [r2]\n\
adds r1, r6, 0\n\
ands r1, r0\n\
ldrb r0, [r5]\n\
adds r0, 0x14\n\
orrs r1, r0\n\
strh r1, [r2]\n\
lsls r4, r3, 24\n\
asrs r3, r4, 24\n\
lsls r2, r3, 1\n\
adds r2, r7\n\
adds r2, 0x40\n\
ldrh r0, [r2]\n\
adds r1, r6, 0\n\
ands r1, r0\n\
mov r5, sp\n\
adds r0, r5, r3\n\
ldrb r0, [r0]\n\
adds r0, 0x34\n\
orrs r1, r0\n\
strh r1, [r2]\n\
adds r3, r4, 0\n\
lsls r2, 1\n\
adds r2, r7\n\
ldrh r0, [r2]\n\
adds r1, r6, 0\n\
ands r1, r0\n\
ldrb r0, [r5]\n\
adds r0, 0x14\n\
orrs r1, r0\n\
strh r1, [r2]\n\
lsls r4, r3, 24\n\
asrs r3, r4, 24\n\
lsls r2, r3, 1\n\
adds r2, r7\n\
adds r2, 0x40\n\
ldrh r0, [r2]\n\
adds r1, r6, 0\n\
ands r1, r0\n\
mov r5, sp\n\
adds r0, r5, r3\n\
ldrb r0, [r0]\n\
adds r0, 0x34\n\
orrs r1, r0\n\
strh r1, [r2]\n\
adds r3, r4, 0\n\
_0807241A:\n\
movs r0, 0x80\n\
lsls r0, 17\n\
add r0, r8\n\
lsrs r1, r0, 24\n\
movs r2, 0x80\n\
lsls r2, 17\n\
adds r0, r3, r2\n\
lsrs r3, r0, 24\n\
asrs r0, 24\n\
cmp r0, 0x3\n\
ble _080723B4\n\
b _08072496\n\
movs r0, 0x80\n\
lsls r0, 17\n\
add r0, r8\n\
lsrs r1, r0, 24\n\
movs r2, 0x80\n\
lsls r2, 17\n\
adds r0, r3, r2\n\
lsrs r3, r0, 24\n\
asrs r0, 24\n\
cmp r0, 0x3\n\
ble _080723B4\n\
b _08072496\n\
_08072432:\n\
movs r3, 0\n\
movs r4, 0xFC\n\
lsls r4, 8\n\
movs r6, 0x1E\n\
movs r3, 0\n\
movs r4, 0xFC\n\
lsls r4, 8\n\
movs r6, 0x1E\n\
_0807243A:\n\
lsls r1, r3, 24\n\
asrs r2, r1, 24\n\
mov r3, sp\n\
adds r5, r3, r2\n\
ldrb r0, [r5]\n\
adds r3, r1, 0\n\
cmp r0, 0xFF\n\
bne _08072466\n\
lsls r1, r2, 1\n\
adds r1, r7\n\
ldrh r2, [r1]\n\
adds r0, r4, 0\n\
ands r0, r2\n\
orrs r0, r6\n\
strh r0, [r1]\n\
adds r1, 0x40\n\
ldrh r2, [r1]\n\
adds r0, r4, 0\n\
ands r0, r2\n\
orrs r0, r6\n\
strh r0, [r1]\n\
b _08072488\n\
lsls r1, r3, 24\n\
asrs r2, r1, 24\n\
mov r3, sp\n\
adds r5, r3, r2\n\
ldrb r0, [r5]\n\
adds r3, r1, 0\n\
cmp r0, 0xFF\n\
bne _08072466\n\
lsls r1, r2, 1\n\
adds r1, r7\n\
ldrh r2, [r1]\n\
adds r0, r4, 0\n\
ands r0, r2\n\
orrs r0, r6\n\
strh r0, [r1]\n\
adds r1, 0x40\n\
ldrh r2, [r1]\n\
adds r0, r4, 0\n\
ands r0, r2\n\
orrs r0, r6\n\
strh r0, [r1]\n\
b _08072488\n\
_08072466:\n\
lsls r2, 1\n\
adds r2, r7\n\
ldrh r0, [r2]\n\
adds r1, r4, 0\n\
ands r1, r0\n\
ldrb r0, [r5]\n\
adds r0, 0x14\n\
orrs r1, r0\n\
strh r1, [r2]\n\
adds r2, 0x40\n\
ldrh r0, [r2]\n\
adds r1, r4, 0\n\
ands r1, r0\n\
ldrb r0, [r5]\n\
adds r0, 0x34\n\
orrs r1, r0\n\
strh r1, [r2]\n\
lsls r2, 1\n\
adds r2, r7\n\
ldrh r0, [r2]\n\
adds r1, r4, 0\n\
ands r1, r0\n\
ldrb r0, [r5]\n\
adds r0, 0x14\n\
orrs r1, r0\n\
strh r1, [r2]\n\
adds r2, 0x40\n\
ldrh r0, [r2]\n\
adds r1, r4, 0\n\
ands r1, r0\n\
ldrb r0, [r5]\n\
adds r0, 0x34\n\
orrs r1, r0\n\
strh r1, [r2]\n\
_08072488:\n\
movs r5, 0x80\n\
lsls r5, 17\n\
adds r0, r3, r5\n\
lsrs r3, r0, 24\n\
asrs r0, 24\n\
cmp r0, 0x3\n\
ble _0807243A\n\
movs r5, 0x80\n\
lsls r5, 17\n\
adds r0, r3, r5\n\
lsrs r3, r0, 24\n\
asrs r0, 24\n\
cmp r0, 0x3\n\
ble _0807243A\n\
_08072496:\n\
add sp, 0x4\n\
pop {r3-r5}\n\
mov r8, r3\n\
mov r9, r4\n\
mov r10, r5\n\
pop {r4-r7}\n\
pop {r0}\n\
bx r0\n\
add sp, 0x4\n\
pop {r3-r5}\n\
mov r8, r3\n\
mov r9, r4\n\
mov r10, r5\n\
pop {r4-r7}\n\
pop {r0}\n\
bx r0\n\
.syntax divided");
}
@ -1580,7 +1580,7 @@ u8 CreatePartyStatusSummarySprites(u8 battlerId, struct HpAndStatus *partyInfo,
{
for (i = 0; i < PARTY_SIZE; i++)
{
if (partyInfo[i].hp == INVALID_U16) // empty slot or an egg
if (partyInfo[i].hp == 0xFFFF) // empty slot or an egg
{
gSprites[ballIconSpritesIds[i]].oam.tileNum += 1;
gSprites[ballIconSpritesIds[i]].data[7] = 1;
@ -1599,7 +1599,7 @@ u8 CreatePartyStatusSummarySprites(u8 battlerId, struct HpAndStatus *partyInfo,
{
for (i = 0, var = 5, j = 0; j < PARTY_SIZE; j++)
{
if (partyInfo[j].hp == INVALID_U16) // empty slot or an egg
if (partyInfo[j].hp == 0xFFFF) // empty slot or an egg
{
gSprites[ballIconSpritesIds[var]].oam.tileNum += 1;
gSprites[ballIconSpritesIds[var]].data[7] = 1;
@ -1628,7 +1628,7 @@ u8 CreatePartyStatusSummarySprites(u8 battlerId, struct HpAndStatus *partyInfo,
{
for (var = 5, i = 0; i < PARTY_SIZE; i++)
{
if (partyInfo[i].hp == INVALID_U16) // empty slot or an egg
if (partyInfo[i].hp == 0xFFFF) // empty slot or an egg
{
gSprites[ballIconSpritesIds[var]].oam.tileNum += 1;
gSprites[ballIconSpritesIds[var]].data[7] = 1;
@ -1648,7 +1648,7 @@ u8 CreatePartyStatusSummarySprites(u8 battlerId, struct HpAndStatus *partyInfo,
{
for (var = 0, i = 0, j = 0; j < PARTY_SIZE; j++)
{
if (partyInfo[j].hp == INVALID_U16) // empty slot or an egg
if (partyInfo[j].hp == 0xFFFF) // empty slot or an egg
{
gSprites[ballIconSpritesIds[i]].oam.tileNum += 1;
gSprites[ballIconSpritesIds[i]].data[7] = 1;
@ -1765,7 +1765,7 @@ static void sub_8073E64(u8 taskId)
s32 i;
u8 battlerId = gTasks[taskId].tBattler;
if (--gTasks[taskId].tData15 == INVALID_S16)
if (--gTasks[taskId].tData15 == -1)
{
u8 summaryBarSpriteId = gTasks[taskId].tSummaryBarSpriteId;
@ -1808,7 +1808,7 @@ static void sub_8073F98(u8 taskId)
{
SetGpuReg(REG_OFFSET_BLDALPHA, (gTasks[taskId].tData15) | ((16 - gTasks[taskId].tData15) << 8));
}
else if (gTasks[taskId].tData15 == INVALID_S16)
else if (gTasks[taskId].tData15 == -1)
{
u8 summaryBarSpriteId = gTasks[taskId].tSummaryBarSpriteId;
@ -2289,7 +2289,7 @@ s32 MoveBattleBar(u8 battlerId, u8 healthboxSpriteId, u8 whichBar, u8 unused)
if (whichBar == EXP_BAR || (whichBar == HEALTH_BAR && !gBattleSpritesDataPtr->battlerData[battlerId].hpNumbersNoBars))
MoveBattleBarGraphically(battlerId, whichBar);
if (currentBarValue == INVALID_S32)
if (currentBarValue == -1)
gBattleSpritesDataPtr->battleBars[battlerId].currValue = 0;
return currentBarValue;
@ -2376,12 +2376,12 @@ static s32 CalcNewBarValue(s32 maxValue, s32 oldValue, s32 receivedValue, s32 *c
if (maxValue < scale)
{
if (newValue == Q_24_8_TO_INT(*currValue) && (*currValue & 0xFF) == 0)
return INVALID_S32;
return -1;
}
else
{
if (newValue == *currValue) // we're done, the bar's value has been updated
return INVALID_S32;
return -1;
}
if (maxValue < scale) // handle cases of max var having less pixels than the whole bar
@ -2403,7 +2403,7 @@ static s32 CalcNewBarValue(s32 maxValue, s32 oldValue, s32 receivedValue, s32 *c
*currValue -= toAdd;
ret = Q_24_8_TO_INT(*currValue);
// try round up
if ((*currValue & INVALID_U8) > 0)
if ((*currValue & 0xFF) > 0)
ret++;
if (ret <= newValue)
{

View File

@ -500,7 +500,7 @@ const struct TrainerMoney gTrainerMoneyTable[] =
{TRAINER_CLASS_HIKER, 10},
{TRAINER_CLASS_YOUNG_COUPLE, 8},
{TRAINER_CLASS_WINSTRATE, 10},
{INVALID_U8, 5},
{0xFF, 5},
};
#include "data/text/abilities.h"
@ -2251,7 +2251,7 @@ static void sub_8038F34(void)
ShowBg(0);
ShowBg(1);
ShowBg(2);
gBattleCommunication[1] = INVALID_U8;
gBattleCommunication[1] = 0xFF;
gBattleCommunication[MULTIUSE_STATE]++;
break;
case 1:
@ -2993,7 +2993,7 @@ static void BattleStartClearSetData(void)
gLastLandedMoves[i] = 0;
gLastHitByType[i] = 0;
gLastResultingMoves[i] = 0;
gLastHitBy[i] = INVALID_U8;
gLastHitBy[i] = 0xFF;
gLockedMoves[i] = 0;
gLastPrintedMoves[i] = 0;
gBattleResources->flags->flags[i] = 0;
@ -3161,7 +3161,7 @@ void SwitchInClearSetData(void)
gLastHitByType[gActiveBattler] = 0;
gLastResultingMoves[gActiveBattler] = 0;
gLastPrintedMoves[gActiveBattler] = 0;
gLastHitBy[gActiveBattler] = INVALID_U8;
gLastHitBy[gActiveBattler] = 0xFF;
*(gBattleStruct->lastTakenMove + gActiveBattler * 2 + 0) = 0;
*(gBattleStruct->lastTakenMove + gActiveBattler * 2 + 1) = 0;
@ -3192,7 +3192,7 @@ void SwitchInClearSetData(void)
gBattleResources->flags->flags[gActiveBattler] = 0;
gCurrentMove = 0;
gBattleStruct->field_DA = INVALID_U8;
gBattleStruct->field_DA = 0xFF;
ClearBattlerMoveHistory(gActiveBattler);
ClearBattlerAbilityHistory(gActiveBattler);
@ -3253,7 +3253,7 @@ void FaintClearSetData(void)
gLastHitByType[gActiveBattler] = 0;
gLastResultingMoves[gActiveBattler] = 0;
gLastPrintedMoves[gActiveBattler] = 0;
gLastHitBy[gActiveBattler] = INVALID_U8;
gLastHitBy[gActiveBattler] = 0xFF;
*(u8*)((u8*)(&gBattleStruct->choicedMove[gActiveBattler]) + 0) = 0;
*(u8*)((u8*)(&gBattleStruct->choicedMove[gActiveBattler]) + 1) = 0;
@ -3440,7 +3440,7 @@ static void BattleIntroDrawPartySummaryScreens(void)
if (GetMonData(&gEnemyParty[i], MON_DATA_SPECIES2) == SPECIES_NONE
|| GetMonData(&gEnemyParty[i], MON_DATA_SPECIES2) == SPECIES_EGG)
{
hpStatus[i].hp = INVALID_U16;
hpStatus[i].hp = 0xFFFF;
hpStatus[i].status = 0;
}
else
@ -3458,7 +3458,7 @@ static void BattleIntroDrawPartySummaryScreens(void)
if (GetMonData(&gPlayerParty[i], MON_DATA_SPECIES2) == SPECIES_NONE
|| GetMonData(&gPlayerParty[i], MON_DATA_SPECIES2) == SPECIES_EGG)
{
hpStatus[i].hp = INVALID_U16;
hpStatus[i].hp = 0xFFFF;
hpStatus[i].status = 0;
}
else
@ -3484,7 +3484,7 @@ static void BattleIntroDrawPartySummaryScreens(void)
if (GetMonData(&gPlayerParty[i], MON_DATA_SPECIES2) == SPECIES_NONE
|| GetMonData(&gPlayerParty[i], MON_DATA_SPECIES2) == SPECIES_EGG)
{
hpStatus[i].hp = INVALID_U16;
hpStatus[i].hp = 0xFFFF;
hpStatus[i].status = 0;
}
else
@ -3610,85 +3610,85 @@ NAKED
static void BattleIntroOpponent1SendsOutMonAnimation(void)
{
asm(".syntax unified\n\
push {r4-r6,lr}\n\
ldr r0, =gBattleTypeFlags\n\
ldr r2, [r0]\n\
movs r0, 0x80\n\
lsls r0, 17\n\
ands r0, r2\n\
cmp r0, 0\n\
beq _0803B298\n\
movs r0, 0x80\n\
lsls r0, 18\n\
ands r0, r2\n\
cmp r0, 0\n\
beq _0803B298\n\
movs r1, 0x80\n\
lsls r1, 24\n\
ands r1, r2\n\
negs r0, r1\n\
orrs r0, r1\n\
lsrs r5, r0, 31\n\
b _0803B29A\n\
.pool\n\
push {r4-r6,lr}\n\
ldr r0, =gBattleTypeFlags\n\
ldr r2, [r0]\n\
movs r0, 0x80\n\
lsls r0, 17\n\
ands r0, r2\n\
cmp r0, 0\n\
beq _0803B298\n\
movs r0, 0x80\n\
lsls r0, 18\n\
ands r0, r2\n\
cmp r0, 0\n\
beq _0803B298\n\
movs r1, 0x80\n\
lsls r1, 24\n\
ands r1, r2\n\
negs r0, r1\n\
orrs r0, r1\n\
lsrs r5, r0, 31\n\
b _0803B29A\n\
.pool\n\
_0803B288:\n\
ldr r1, =gBattleMainFunc\n\
ldr r0, =BattleIntroOpponent2SendsOutMonAnimation\n\
b _0803B2F0\n\
.pool\n\
ldr r1, =gBattleMainFunc\n\
ldr r0, =BattleIntroOpponent2SendsOutMonAnimation\n\
b _0803B2F0\n\
.pool\n\
_0803B298:\n\
movs r5, 0x1\n\
movs r5, 0x1\n\
_0803B29A:\n\
ldr r0, =gBattleControllerExecFlags\n\
ldr r2, [r0]\n\
cmp r2, 0\n\
bne _0803B2F2\n\
ldr r0, =gActiveBattler\n\
strb r2, [r0]\n\
ldr r1, =gBattlersCount\n\
adds r4, r0, 0\n\
ldrb r1, [r1]\n\
cmp r2, r1\n\
bcs _0803B2EC\n\
adds r6, r4, 0\n\
ldr r0, =gBattleControllerExecFlags\n\
ldr r2, [r0]\n\
cmp r2, 0\n\
bne _0803B2F2\n\
ldr r0, =gActiveBattler\n\
strb r2, [r0]\n\
ldr r1, =gBattlersCount\n\
adds r4, r0, 0\n\
ldrb r1, [r1]\n\
cmp r2, r1\n\
bcs _0803B2EC\n\
adds r6, r4, 0\n\
_0803B2B2:\n\
ldrb r0, [r4]\n\
bl GetBattlerPosition\n\
lsls r0, 24\n\
lsrs r0, 24\n\
cmp r0, r5\n\
bne _0803B2D8\n\
movs r0, 0\n\
bl BtlController_EmitIntroTrainerBallThrow\n\
ldrb r0, [r4]\n\
bl MarkBattlerForControllerExec\n\
ldr r0, =gBattleTypeFlags\n\
ldr r0, [r0]\n\
ldr r1, =0x00008040\n\
ands r0, r1\n\
cmp r0, 0\n\
bne _0803B288\n\
ldrb r0, [r4]\n\
bl GetBattlerPosition\n\
lsls r0, 24\n\
lsrs r0, 24\n\
cmp r0, r5\n\
bne _0803B2D8\n\
movs r0, 0\n\
bl BtlController_EmitIntroTrainerBallThrow\n\
ldrb r0, [r4]\n\
bl MarkBattlerForControllerExec\n\
ldr r0, =gBattleTypeFlags\n\
ldr r0, [r0]\n\
ldr r1, =0x00008040\n\
ands r0, r1\n\
cmp r0, 0\n\
bne _0803B288\n\
_0803B2D8:\n\
ldrb r0, [r6]\n\
adds r0, 0x1\n\
strb r0, [r6]\n\
ldr r1, =gBattlersCount\n\
lsls r0, 24\n\
lsrs r0, 24\n\
ldr r4, =gActiveBattler\n\
ldrb r1, [r1]\n\
cmp r0, r1\n\
bcc _0803B2B2\n\
ldrb r0, [r6]\n\
adds r0, 0x1\n\
strb r0, [r6]\n\
ldr r1, =gBattlersCount\n\
lsls r0, 24\n\
lsrs r0, 24\n\
ldr r4, =gActiveBattler\n\
ldrb r1, [r1]\n\
cmp r0, r1\n\
bcc _0803B2B2\n\
_0803B2EC:\n\
ldr r1, =gBattleMainFunc\n\
ldr r0, =BattleIntroRecordMonsToDex\n\
ldr r1, =gBattleMainFunc\n\
ldr r0, =BattleIntroRecordMonsToDex\n\
_0803B2F0:\n\
str r0, [r1]\n\
str r0, [r1]\n\
_0803B2F2:\n\
pop {r4-r6}\n\
pop {r0}\n\
bx r0\n\
.pool\n\
pop {r4-r6}\n\
pop {r0}\n\
bx r0\n\
.pool\n\
.syntax divided");
}
#endif // NONMATCHING
@ -3991,7 +3991,7 @@ void BattleTurnPassed(void)
return;
}
if (gBattleResults.battleTurnCounter < INVALID_U8)
if (gBattleResults.battleTurnCounter < 0xFF)
{
gBattleResults.battleTurnCounter++;
gBattleStruct->field_DA++;
@ -4375,7 +4375,7 @@ static void HandleTurnActionSelectionState(void)
return;
default:
sub_818603C(2);
if ((gBattleBufferB[gActiveBattler][2] | (gBattleBufferB[gActiveBattler][3] << 8)) == INVALID_U16)
if ((gBattleBufferB[gActiveBattler][2] | (gBattleBufferB[gActiveBattler][3] << 8)) == 0xFFFF)
{
gBattleCommunication[gActiveBattler] = STATE_BEFORE_ACTION_CHOSEN;
RecordedBattle_ClearBattlerAction(gActiveBattler, 1);
@ -4591,10 +4591,10 @@ static void sub_803CDF8(void)
void SwapTurnOrder(u8 id1, u8 id2)
{
u32 temp;
u32 temp;
SWAP(gActionsByTurnOrder[id1], gActionsByTurnOrder[id2], temp);
SWAP(gBattlerByTurnOrder[id1], gBattlerByTurnOrder[id2], temp);
SWAP(gActionsByTurnOrder[id1], gActionsByTurnOrder[id2], temp);
SWAP(gBattlerByTurnOrder[id1], gBattlerByTurnOrder[id2], temp);
}
u8 GetWhoStrikesFirst(u8 battler1, u8 battler2, bool8 ignoreChosenMoves)
@ -5740,7 +5740,7 @@ static void HandleAction_ThrowPokeblock(void)
gBattleCommunication[MULTISTRING_CHOOSER] = gBattleBufferB[gBattlerAttacker][1] - 1;
gLastUsedItem = gBattleBufferB[gBattlerAttacker][2];
if (gBattleResults.pokeblockThrows < INVALID_U8)
if (gBattleResults.pokeblockThrows < 0xFF)
gBattleResults.pokeblockThrows++;
if (gBattleStruct->safariPkblThrowCounter < 3)
gBattleStruct->safariPkblThrowCounter++;

File diff suppressed because it is too large Load Diff

View File

@ -1228,7 +1228,7 @@ static void sub_81A7E60(s16 a0, s16 a1, s16 a2, s16 a3, s16 a4)
static bool8 sub_81A7EC4(void)
{
if (FindTaskIdByFunc(sub_81A7D54) == INVALID_U8)
if (FindTaskIdByFunc(sub_81A7D54) == 0xFF)
return TRUE;
else
return FALSE;
@ -1448,7 +1448,7 @@ static void sub_81A84B4(void)
u8 i;
for (i = 0; i < 14; i++)
gSaveBlock2Ptr->frontier.field_CB4[i] |= INVALID_U16;
gSaveBlock2Ptr->frontier.field_CB4[i] |= 0xFFFF;
}
static void sub_81A84EC(void)

View File

@ -1541,7 +1541,7 @@ void sub_81AA1D8(void)
u8 var0, var1;
for (i = 0; i < 8; i++)
gSaveBlock2Ptr->frontier.field_CB4[i] |= INVALID_U16;
gSaveBlock2Ptr->frontier.field_CB4[i] |= 0xFFFF;
id = sub_81AA9E4();
sub_81AA33C(&var0, &var1);

View File

@ -388,11 +388,11 @@ void sub_81C4F98(u8 a0, void (*callback)(void))
gPyramidBagCursorData.callback = callback;
gPyramidBagResources->callback2 = NULL;
gPyramidBagResources->unk814 = INVALID_U8;
gPyramidBagResources->scrollIndicatorsTaskId = INVALID_U8;
gPyramidBagResources->unk814 = 0xFF;
gPyramidBagResources->scrollIndicatorsTaskId = 0xFF;
memset(gPyramidBagResources->itemsSpriteIds, INVALID_U8, sizeof(gPyramidBagResources->itemsSpriteIds));
memset(gPyramidBagResources->windowIds, INVALID_U8, sizeof(gPyramidBagResources->windowIds));
memset(gPyramidBagResources->itemsSpriteIds, 0xFF, sizeof(gPyramidBagResources->itemsSpriteIds));
memset(gPyramidBagResources->windowIds, 0xFF, sizeof(gPyramidBagResources->windowIds));
SetMainCallback2(sub_81C504C);
}
@ -604,7 +604,7 @@ static void PyramidBagMoveCursorFunc(s32 itemIndex, bool8 onInit, struct ListMen
PlaySE(SE_SELECT);
sub_81C6F20();
}
if (gPyramidBagResources->unk814 == INVALID_U8)
if (gPyramidBagResources->unk814 == 0xFF)
{
sub_81C6FF8(gPyramidBagResources->unk815 ^ 1);
if (itemIndex != LIST_B_PRESSED)
@ -622,7 +622,7 @@ static void PrintItemQuantity(u8 windowId, s32 itemIndex, u8 y)
if (itemIndex == LIST_B_PRESSED)
return;
if (gPyramidBagResources->unk814 != INVALID_U8)
if (gPyramidBagResources->unk814 != 0xFF)
{
if (gPyramidBagResources->unk814 == (u8)(itemIndex))
sub_81C5AB8(y, 1);
@ -657,16 +657,16 @@ static void PrintItemDescription(s32 listMenuId)
static void AddScrollArrow(void)
{
if (gPyramidBagResources->scrollIndicatorsTaskId == INVALID_U8)
if (gPyramidBagResources->scrollIndicatorsTaskId == 0xFF)
gPyramidBagResources->scrollIndicatorsTaskId = AddScrollIndicatorArrowPairParameterized(2, 172, 12, 148, gPyramidBagResources->listMenuCount - gPyramidBagResources->listMenuMaxShown, 0xB5E, 0xB5E, &gPyramidBagCursorData.scrollPosition);
}
static void RemoveScrollArrow(void)
{
if (gPyramidBagResources->scrollIndicatorsTaskId != INVALID_U8)
if (gPyramidBagResources->scrollIndicatorsTaskId != 0xFF)
{
RemoveScrollIndicatorArrowPair(gPyramidBagResources->scrollIndicatorsTaskId);
gPyramidBagResources->scrollIndicatorsTaskId = INVALID_U8;
gPyramidBagResources->scrollIndicatorsTaskId = 0xFF;
}
}
@ -803,7 +803,7 @@ static void sub_81C5A98(u8 listMenuTaskId, u8 arg1)
static void sub_81C5AB8(u8 y, u8 arg1)
{
if (arg1 == INVALID_U8)
if (arg1 == 0xFF)
FillWindowPixelRect(0, 0, 0, y, GetMenuCursorDimensionByFont(1, 0), GetMenuCursorDimensionByFont(1, 1));
else
PrintOnWindow_Font1(0, gText_SelectorArrow2, 0, y, 0, 0, 0, arg1);
@ -1323,7 +1323,7 @@ static void PerformItemSwap(u8 taskId)
else
{
MovePyramidBagItemSlotInList(data[1], var);
gPyramidBagResources->unk814 = INVALID_U8;
gPyramidBagResources->unk814 = 0xFF;
sub_81C7028(TRUE);
DestroyListMenuTask(data[0], scrollOffset, selectedRow);
if (data[1] < var)
@ -1340,7 +1340,7 @@ static void sub_81C6A14(u8 taskId)
u16 *scrollOffset = &gPyramidBagCursorData.scrollPosition;
u16 *selectedRow = &gPyramidBagCursorData.cursorPosition;
gPyramidBagResources->unk814 = INVALID_U8;
gPyramidBagResources->unk814 = 0xFF;
sub_81C7028(TRUE);
DestroyListMenuTask(data[0], scrollOffset, selectedRow);
if (data[1] < *scrollOffset + *selectedRow)
@ -1427,7 +1427,7 @@ static u8 sub_81C6D08(u8 windowArrayId)
static u8 sub_81C6D24(u8 windowArrayId)
{
u8 *windowId = &gPyramidBagResources->windowIds[windowArrayId];
if (*windowId == INVALID_U8)
if (*windowId == 0xFF)
{
*windowId = AddWindow(&gUnknown_0861F350[windowArrayId]);
SetWindowBorderStyle(*windowId, FALSE, 1, 0xE);
@ -1439,13 +1439,13 @@ static u8 sub_81C6D24(u8 windowArrayId)
static void sub_81C6D6C(u8 windowArrayId)
{
u8 *windowId = &gPyramidBagResources->windowIds[windowArrayId];
if (*windowId != INVALID_U8)
if (*windowId != 0xFF)
{
sub_8198070(*windowId, FALSE);
ClearWindowTilemap(*windowId);
RemoveWindow(*windowId);
schedule_bg_copy_tilemap_to_vram(1);
*windowId = INVALID_U8;
*windowId = 0xFF;
}
}
@ -1473,13 +1473,13 @@ static void sub_81C6E1C(void)
static void sub_81C6E38(u8 itemSpriteArrayId)
{
u8 *spriteId = &gPyramidBagResources->itemsSpriteIds[itemSpriteArrayId];
if (*spriteId != INVALID_U8)
if (*spriteId != 0xFF)
{
FreeSpriteTilesByTag(ITEM_IMAGE_TAG + itemSpriteArrayId);
FreeSpritePaletteByTag(ITEM_IMAGE_TAG + itemSpriteArrayId);
FreeSpriteOamMatrix(&gSprites[*spriteId]);
DestroySprite(&gSprites[*spriteId]);
*spriteId = INVALID_U8;
*spriteId = 0xFF;
}
}
@ -1524,7 +1524,7 @@ static void ShowItemImage(u16 itemId, u8 itemSpriteArrayId)
{
u8 itemSpriteId;
u8 *spriteId = &gPyramidBagResources->itemsSpriteIds[itemSpriteArrayId + 1];
if (*spriteId == INVALID_U8)
if (*spriteId == 0xFF)
{
FreeSpriteTilesByTag(ITEM_IMAGE_TAG + 1 + itemSpriteArrayId);
FreeSpritePaletteByTag(ITEM_IMAGE_TAG + 1 + itemSpriteArrayId);

View File

@ -677,45 +677,45 @@ static const u32 sStatusFlagsForMoveEffects[] =
static const u8* const sMoveEffectBS_Ptrs[] =
{
BattleScript_MoveEffectSleep, // 0
BattleScript_MoveEffectSleep, // MOVE_EFFECT_SLEEP
BattleScript_MoveEffectPoison, // MOVE_EFFECT_POISON
BattleScript_MoveEffectBurn, // MOVE_EFFECT_BURN
BattleScript_MoveEffectFreeze, // MOVE_EFFECT_FREEZE
BattleScript_MoveEffectParalysis, // MOVE_EFFECT_PARALYSIS
BattleScript_MoveEffectToxic, // MOVE_EFFECT_TOXIC
BattleScript_MoveEffectConfusion, // MOVE_EFFECT_CONFUSION
BattleScript_MoveEffectSleep, // MOVE_EFFECT_FLINCH
BattleScript_MoveEffectSleep, // MOVE_EFFECT_TRI_ATTACK
BattleScript_MoveEffectUproar, // MOVE_EFFECT_UPROAR
BattleScript_MoveEffectPayDay, // MOVE_EFFECT_PAYDAY
BattleScript_MoveEffectSleep, // MOVE_EFFECT_CHARGING
BattleScript_MoveEffectWrap, // MOVE_EFFECT_WRAP
BattleScript_MoveEffectRecoil, // MOVE_EFFECT_RECOIL_25
BattleScript_MoveEffectSleep, // MOVE_EFFECT_ATK_PLUS_1
BattleScript_MoveEffectSleep, // MOVE_EFFECT_DEF_PLUS_1
BattleScript_MoveEffectSleep, // MOVE_EFFECT_SPD_PLUS_1
BattleScript_MoveEffectSleep, // MOVE_EFFECT_SP_ATK_PLUS_1
BattleScript_MoveEffectSleep, // MOVE_EFFECT_SP_DEF_PLUS_1
BattleScript_MoveEffectSleep, // MOVE_EFFECT_ACC_PLUS_1
BattleScript_MoveEffectSleep, // MOVE_EFFECT_EVS_PLUS_1
BattleScript_MoveEffectSleep, // MOVE_EFFECT_ATK_MINUS_1
BattleScript_MoveEffectSleep, // MOVE_EFFECT_DEF_MINUS_1
BattleScript_MoveEffectSleep, // MOVE_EFFECT_SPD_MINUS_1
BattleScript_MoveEffectSleep, // MOVE_EFFECT_SP_ATK_MINUS_1
BattleScript_MoveEffectSleep, // MOVE_EFFECT_SP_DEF_MINUS_1
BattleScript_MoveEffectSleep, // MOVE_EFFECT_ACC_MINUS_1
BattleScript_MoveEffectSleep, // MOVE_EFFECT_EVS_MINUS_1
BattleScript_MoveEffectSleep, // MOVE_EFFECT_RECHARGE
BattleScript_MoveEffectSleep, // MOVE_EFFECT_RAGE
BattleScript_MoveEffectSleep, // MOVE_EFFECT_STEAL_ITEM
BattleScript_MoveEffectSleep, // MOVE_EFFECT_PREVENT_ESCAPE
BattleScript_MoveEffectSleep, // MOVE_EFFECT_NIGHTMARE
BattleScript_MoveEffectSleep, // MOVE_EFFECT_ALL_STATS_UP
BattleScript_MoveEffectSleep, // MOVE_EFFECT_RAPIDSPIN
BattleScript_MoveEffectSleep, // MOVE_EFFECT_REMOVE_PARALYSIS
BattleScript_MoveEffectSleep, // MOVE_EFFECT_ATK_DEF_DOWN
BattleScript_MoveEffectRecoil, // MOVE_EFFECT_RECOIL_33
BattleScript_MoveEffectSleep, // 0
BattleScript_MoveEffectSleep, // MOVE_EFFECT_SLEEP
BattleScript_MoveEffectPoison, // MOVE_EFFECT_POISON
BattleScript_MoveEffectBurn, // MOVE_EFFECT_BURN
BattleScript_MoveEffectFreeze, // MOVE_EFFECT_FREEZE
BattleScript_MoveEffectParalysis, // MOVE_EFFECT_PARALYSIS
BattleScript_MoveEffectToxic, // MOVE_EFFECT_TOXIC
BattleScript_MoveEffectConfusion, // MOVE_EFFECT_CONFUSION
BattleScript_MoveEffectSleep, // MOVE_EFFECT_FLINCH
BattleScript_MoveEffectSleep, // MOVE_EFFECT_TRI_ATTACK
BattleScript_MoveEffectUproar, // MOVE_EFFECT_UPROAR
BattleScript_MoveEffectPayDay, // MOVE_EFFECT_PAYDAY
BattleScript_MoveEffectSleep, // MOVE_EFFECT_CHARGING
BattleScript_MoveEffectWrap, // MOVE_EFFECT_WRAP
BattleScript_MoveEffectRecoil, // MOVE_EFFECT_RECOIL_25
BattleScript_MoveEffectSleep, // MOVE_EFFECT_ATK_PLUS_1
BattleScript_MoveEffectSleep, // MOVE_EFFECT_DEF_PLUS_1
BattleScript_MoveEffectSleep, // MOVE_EFFECT_SPD_PLUS_1
BattleScript_MoveEffectSleep, // MOVE_EFFECT_SP_ATK_PLUS_1
BattleScript_MoveEffectSleep, // MOVE_EFFECT_SP_DEF_PLUS_1
BattleScript_MoveEffectSleep, // MOVE_EFFECT_ACC_PLUS_1
BattleScript_MoveEffectSleep, // MOVE_EFFECT_EVS_PLUS_1
BattleScript_MoveEffectSleep, // MOVE_EFFECT_ATK_MINUS_1
BattleScript_MoveEffectSleep, // MOVE_EFFECT_DEF_MINUS_1
BattleScript_MoveEffectSleep, // MOVE_EFFECT_SPD_MINUS_1
BattleScript_MoveEffectSleep, // MOVE_EFFECT_SP_ATK_MINUS_1
BattleScript_MoveEffectSleep, // MOVE_EFFECT_SP_DEF_MINUS_1
BattleScript_MoveEffectSleep, // MOVE_EFFECT_ACC_MINUS_1
BattleScript_MoveEffectSleep, // MOVE_EFFECT_EVS_MINUS_1
BattleScript_MoveEffectSleep, // MOVE_EFFECT_RECHARGE
BattleScript_MoveEffectSleep, // MOVE_EFFECT_RAGE
BattleScript_MoveEffectSleep, // MOVE_EFFECT_STEAL_ITEM
BattleScript_MoveEffectSleep, // MOVE_EFFECT_PREVENT_ESCAPE
BattleScript_MoveEffectSleep, // MOVE_EFFECT_NIGHTMARE
BattleScript_MoveEffectSleep, // MOVE_EFFECT_ALL_STATS_UP
BattleScript_MoveEffectSleep, // MOVE_EFFECT_RAPIDSPIN
BattleScript_MoveEffectSleep, // MOVE_EFFECT_REMOVE_PARALYSIS
BattleScript_MoveEffectSleep, // MOVE_EFFECT_ATK_DEF_DOWN
BattleScript_MoveEffectRecoil, // MOVE_EFFECT_RECOIL_33
};
static const struct WindowTemplate sUnusedWinTemplate = {0, 1, 3, 7, 0xF, 0x1F, 0x3F};
@ -763,8 +763,8 @@ static const struct SpriteTemplate sSpriteTemplate_MonIconOnLvlUpBox =
static const u16 sProtectSuccessRates[] = {USHRT_MAX, USHRT_MAX / 2, USHRT_MAX / 4, USHRT_MAX / 8};
#define MIMIC_FORBIDDEN_END 0xFFFE
#define METRONOME_FORBIDDEN_END INVALID_U16
#define ASSIST_FORBIDDEN_END INVALID_U16
#define METRONOME_FORBIDDEN_END 0xFFFF
#define ASSIST_FORBIDDEN_END 0xFFFF
static const u16 sMovesForbiddenToCopy[] =
{
@ -822,44 +822,44 @@ static const u16 sWeightToDamageTable[] =
500, 60,
1000, 80,
2000, 100,
INVALID_U16, INVALID_U16
0xFFFF, 0xFFFF
};
static const u16 sPickupItems[] =
{
ITEM_POTION,
ITEM_ANTIDOTE,
ITEM_SUPER_POTION,
ITEM_GREAT_BALL,
ITEM_REPEL,
ITEM_ESCAPE_ROPE,
ITEM_X_ATTACK,
ITEM_FULL_HEAL,
ITEM_ULTRA_BALL,
ITEM_HYPER_POTION,
ITEM_RARE_CANDY,
ITEM_PROTEIN,
ITEM_REVIVE,
ITEM_HP_UP,
ITEM_FULL_RESTORE,
ITEM_MAX_REVIVE,
ITEM_PP_UP,
ITEM_MAX_ELIXIR,
ITEM_ANTIDOTE,
ITEM_SUPER_POTION,
ITEM_GREAT_BALL,
ITEM_REPEL,
ITEM_ESCAPE_ROPE,
ITEM_X_ATTACK,
ITEM_FULL_HEAL,
ITEM_ULTRA_BALL,
ITEM_HYPER_POTION,
ITEM_RARE_CANDY,
ITEM_PROTEIN,
ITEM_REVIVE,
ITEM_HP_UP,
ITEM_FULL_RESTORE,
ITEM_MAX_REVIVE,
ITEM_PP_UP,
ITEM_MAX_ELIXIR,
};
static const u16 sRarePickupItems[] =
{
ITEM_HYPER_POTION,
ITEM_NUGGET,
ITEM_KINGS_ROCK,
ITEM_FULL_RESTORE,
ITEM_ETHER,
ITEM_WHITE_HERB,
ITEM_TM44_REST,
ITEM_ELIXIR,
ITEM_TM01_FOCUS_PUNCH,
ITEM_LEFTOVERS,
ITEM_TM26_EARTHQUAKE,
ITEM_NUGGET,
ITEM_KINGS_ROCK,
ITEM_FULL_RESTORE,
ITEM_ETHER,
ITEM_WHITE_HERB,
ITEM_TM44_REST,
ITEM_ELIXIR,
ITEM_TM01_FOCUS_PUNCH,
ITEM_LEFTOVERS,
ITEM_TM26_EARTHQUAKE,
};
static const u8 sPickupProbabilities[] =
@ -917,10 +917,10 @@ const ALIGNED(4) u8 gUnknown_0831C494[][4] =
static const u8 sUnknown_0831C4F8[] =
{
0x03, 0x00, 0x01, 0x00, 0x00, 0x01, 0x03, 0x00,
0x01, 0x02, 0x02, 0x00, 0x03, 0x01, 0x03, 0x01,
0x02, 0x03, 0x03, 0x02, 0x01, 0x00, 0x02, 0x02,
0x03, 0x00, 0x00, 0x00
0x03, 0x00, 0x01, 0x00, 0x00, 0x01, 0x03, 0x00,
0x01, 0x02, 0x02, 0x00, 0x03, 0x01, 0x03, 0x01,
0x02, 0x03, 0x03, 0x02, 0x01, 0x00, 0x02, 0x02,
0x03, 0x00, 0x00, 0x00
};
static void atk00_attackcanceler(void)
@ -1976,7 +1976,7 @@ static void atk0C_datahpupdate(void)
{
gActiveBattler = GetBattlerForBattleScript(gBattlescriptCurrInstr[1]);
if (gSpecialStatuses[gActiveBattler].dmg == 0)
gSpecialStatuses[gActiveBattler].dmg = INVALID_U16;
gSpecialStatuses[gActiveBattler].dmg = 0xFFFF;
}
gBattlescriptCurrInstr += 2;
}
@ -2579,7 +2579,7 @@ void SetMoveEffect(bool8 primary, u8 certain)
u16 PayDay = gPaydayMoney;
gPaydayMoney += (gBattleMons[gBattlerAttacker].level * 5);
if (PayDay > gPaydayMoney)
gPaydayMoney = INVALID_U16;
gPaydayMoney = 0xFFFF;
}
BattleScriptPush(gBattlescriptCurrInstr + 1);
gBattlescriptCurrInstr = sMoveEffectBS_Ptrs[gBattleCommunication[MOVE_EFFECT_BYTE]];
@ -3403,8 +3403,8 @@ static void atk23_getexp(void)
PREPARE_MON_NICK_WITH_PREFIX_BUFFER(gBattleTextBuff1, gBattleStruct->expGetterBattlerId, gBattleStruct->expGetterMonId)
// buffer 'gained' or 'gained a boosted'
PREPARE_STRING_BUFFER(gBattleTextBuff2, i)
// buffer 'gained' or 'gained a boosted'
PREPARE_STRING_BUFFER(gBattleTextBuff2, i)
PREPARE_WORD_NUMBER_BUFFER(gBattleTextBuff3, 5, gBattleMoveDamage)
@ -4490,24 +4490,24 @@ 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,
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)
@ -4520,7 +4520,7 @@ static void atk49_moveend(void)
u8 arg1, arg2;
u16 originallyUsedMove;
if (gChosenMove == INVALID_U16)
if (gChosenMove == 0xFFFF)
originallyUsedMove = 0;
else
originallyUsedMove = gChosenMove;
@ -4593,7 +4593,7 @@ static void atk49_moveend(void)
break;
case ATK49_CHOICE_MOVE: // update choice band move
if (!(gHitMarker & HITMARKER_OBEYS) || holdEffectAtk != HOLD_EFFECT_CHOICE_BAND
|| gChosenMove == MOVE_STRUGGLE || (*choicedMoveAtk != 0 && *choicedMoveAtk != INVALID_U16))
|| gChosenMove == MOVE_STRUGGLE || (*choicedMoveAtk != 0 && *choicedMoveAtk != 0xFFFF))
goto LOOP;
if (gChosenMove == MOVE_BATON_PASS && !(gMoveResultFlags & MOVE_RESULT_FAILED))
{
@ -4708,8 +4708,8 @@ static void atk49_moveend(void)
}
else
{
gLastMoves[gBattlerAttacker] = INVALID_U16;
gLastResultingMoves[gBattlerAttacker] = INVALID_U16;
gLastMoves[gBattlerAttacker] = 0xFFFF;
gLastResultingMoves[gBattlerAttacker] = 0xFFFF;
}
if (!(gHitMarker & HITMARKER_FAINTED(gBattlerTarget)))
@ -4717,7 +4717,7 @@ static void atk49_moveend(void)
if (gHitMarker & HITMARKER_OBEYS && !(gMoveResultFlags & MOVE_RESULT_NO_EFFECT))
{
if (gChosenMove == INVALID_U16)
if (gChosenMove == 0xFFFF)
{
gLastLandedMoves[gBattlerTarget] = gChosenMove;
}
@ -4729,7 +4729,7 @@ static void atk49_moveend(void)
}
else
{
gLastLandedMoves[gBattlerTarget] = INVALID_U16;
gLastLandedMoves[gBattlerTarget] = 0xFFFF;
}
}
gBattleScripting.atk49_state++;
@ -5560,7 +5560,7 @@ static void atk52_switchineffects(void)
gDisableStructs[gActiveBattler].truantUnknownBit = 0;
if (!AbilityBattleEffects(ABILITYEFFECT_ON_SWITCHIN, gActiveBattler, 0, 0, 0)
&& !ItemBattleEffects(ITEMEFFECT_ON_SWITCH_IN, gActiveBattler, FALSE))
&& !ItemBattleEffects(ITEMEFFECT_ON_SWITCH_IN, gActiveBattler, FALSE))
{
gSideStatuses[GetBattlerSide(gActiveBattler)] &= ~(SIDE_STATUS_SPIKES_DAMAGED);
@ -5662,7 +5662,7 @@ static void atk59_handlelearnnewmove(void)
{
gBattlescriptCurrInstr = jumpPtr2;
}
else if (ret == INVALID_U16)
else if (ret == 0xFFFF)
{
gBattlescriptCurrInstr += 10;
}
@ -6015,7 +6015,7 @@ static void atk61_drawpartystatussummary(void)
if (GetMonData(&party[i], MON_DATA_SPECIES2) == SPECIES_NONE
|| GetMonData(&party[i], MON_DATA_SPECIES2) == SPECIES_EGG)
{
hpStatuses[i].hp = INVALID_U16;
hpStatuses[i].hp = 0xFFFF;
hpStatuses[i].status = 0;
}
else
@ -6930,7 +6930,7 @@ static void atk7C_trymirrormove(void)
move = *(i * 2 + gBattlerAttacker * 8 + (u8*)(gBattleStruct->lastTakenMoveFrom) + 0)
| (*(i * 2 + gBattlerAttacker * 8 + (u8*)(gBattleStruct->lastTakenMoveFrom) + 1) << 8);
if (move != 0 && move != INVALID_U16)
if (move != 0 && move != 0xFFFF)
{
movesArray[validMovesCount] = move;
validMovesCount++;
@ -6941,7 +6941,7 @@ static void atk7C_trymirrormove(void)
move = *(gBattleStruct->lastTakenMove + gBattlerAttacker * 2 + 0)
| (*(gBattleStruct->lastTakenMove + gBattlerAttacker * 2 + 1) << 8);
if (move != 0 && move != INVALID_U16)
if (move != 0 && move != 0xFFFF)
{
gHitMarker &= ~(HITMARKER_ATTACKSTRING_PRINTED);
gCurrentMove = move;
@ -7094,7 +7094,7 @@ bool8 UproarWakeUpCheck(u8 battlerId)
gBattleScripting.battler = i;
if (gBattlerTarget == INVALID_U8)
if (gBattlerTarget == 0xFF)
gBattlerTarget = i;
else if (gBattlerTarget == i)
gBattleCommunication[MULTISTRING_CHOOSER] = 0;
@ -8008,7 +8008,7 @@ static void atk9A_setfocusenergy(void)
static void atk9B_transformdataexecution(void)
{
gChosenMove = INVALID_U16;
gChosenMove = 0xFFFF;
gBattlescriptCurrInstr++;
if (gBattleMons[gBattlerTarget].status2 & STATUS2_TRANSFORMED
|| gStatuses3[gBattlerTarget] & STATUS3_SEMI_INVULNERABLE)
@ -8088,12 +8088,12 @@ static bool8 IsMoveUncopyableByMimic(u16 move)
static void atk9D_mimicattackcopy(void)
{
gChosenMove = INVALID_U16;
gChosenMove = 0xFFFF;
if (IsMoveUncopyableByMimic(gLastMoves[gBattlerTarget])
|| gBattleMons[gBattlerAttacker].status2 & STATUS2_TRANSFORMED
|| gLastMoves[gBattlerTarget] == 0
|| gLastMoves[gBattlerTarget] == INVALID_U16)
|| gLastMoves[gBattlerTarget] == 0xFFFF)
{
gBattlescriptCurrInstr = T1_READ_PTR(gBattlescriptCurrInstr + 1);
}
@ -8296,7 +8296,7 @@ static void atkA5_painsplitdmgcalc(void)
storeLoc[3] = (painSplitHp & 0xFF000000) >> 24;
gBattleMoveDamage = gBattleMons[gBattlerAttacker].hp - hpDiff;
gSpecialStatuses[gBattlerTarget].dmg = INVALID_U16;
gSpecialStatuses[gBattlerTarget].dmg = 0xFFFF;
gBattlescriptCurrInstr += 5;
}
@ -8309,7 +8309,7 @@ static void atkA5_painsplitdmgcalc(void)
static void atkA6_settypetorandomresistance(void) // conversion 2
{
if (gLastLandedMoves[gBattlerAttacker] == 0
|| gLastLandedMoves[gBattlerAttacker] == INVALID_U16)
|| gLastLandedMoves[gBattlerAttacker] == 0xFFFF)
{
gBattlescriptCurrInstr = T1_READ_PTR(gBattlescriptCurrInstr + 1);
}
@ -8376,12 +8376,12 @@ static void atkA7_setalwayshitflag(void)
static void atkA8_copymovepermanently(void) // sketch
{
gChosenMove = INVALID_U16;
gChosenMove = 0xFFFF;
if (!(gBattleMons[gBattlerAttacker].status2 & STATUS2_TRANSFORMED)
&& gLastPrintedMoves[gBattlerTarget] != MOVE_STRUGGLE
&& gLastPrintedMoves[gBattlerTarget] != 0
&& gLastPrintedMoves[gBattlerTarget] != INVALID_U16
&& gLastPrintedMoves[gBattlerTarget] != 0xFFFF
&& gLastPrintedMoves[gBattlerTarget] != MOVE_SKETCH)
{
s32 i;
@ -8550,7 +8550,7 @@ static void atkAC_remaininghptopower(void)
static void atkAD_tryspiteppreduce(void)
{
if (gLastMoves[gBattlerTarget] != 0
&& gLastMoves[gBattlerTarget] != INVALID_U16)
&& gLastMoves[gBattlerTarget] != 0xFFFF)
{
s32 i;
@ -9671,13 +9671,13 @@ static void atkDC_trysetgrudge(void)
static void atkDD_weightdamagecalculation(void)
{
s32 i;
for (i = 0; sWeightToDamageTable[i] != INVALID_U16; i += 2)
for (i = 0; sWeightToDamageTable[i] != 0xFFFF; i += 2)
{
if (sWeightToDamageTable[i] > GetPokedexHeightWeight(SpeciesToNationalPokedexNum(gBattleMons[gBattlerTarget].species), 1))
break;
}
if (sWeightToDamageTable[i] != INVALID_U16)
if (sWeightToDamageTable[i] != 0xFFFF)
gDynamicBasePower = sWeightToDamageTable[i + 1];
else
gDynamicBasePower = 120;

View File

@ -1530,7 +1530,7 @@ static s32 FirstBattleTrainerIdToRematchTableId(const struct RematchTrainer *tab
return i;
}
return INVALID_S32;
return -1;
}
static s32 TrainerIdToRematchTableId(const struct RematchTrainer *table, u16 trainerId)
@ -1548,7 +1548,7 @@ static s32 TrainerIdToRematchTableId(const struct RematchTrainer *table, u16 tra
}
}
return INVALID_S32;
return -1;
}
static bool32 sub_80B1D94(s32 rematchTableId)
@ -1640,7 +1640,7 @@ static bool8 IsFirstTrainerIdReadyForRematch(const struct RematchTrainer *table,
{
s32 tableId = FirstBattleTrainerIdToRematchTableId(table, firstBattleTrainerId);
if (tableId == INVALID_S32)
if (tableId == -1)
return FALSE;
if (tableId >= 100)
return FALSE;
@ -1654,7 +1654,7 @@ static bool8 IsTrainerReadyForRematch_(const struct RematchTrainer *table, u16 t
{
s32 tableId = TrainerIdToRematchTableId(table, trainerId);
if (tableId == INVALID_S32)
if (tableId == -1)
return FALSE;
if (tableId >= 100)
return FALSE;
@ -1670,7 +1670,7 @@ static u16 GetRematchTrainerIdFromTable(const struct RematchTrainer *table, u16
s32 i;
s32 tableId = FirstBattleTrainerIdToRematchTableId(table, firstBattleTrainerId);
if (tableId == INVALID_S32)
if (tableId == -1)
return FALSE;
trainerEntry = &table[tableId];
@ -1691,7 +1691,7 @@ static u16 GetLastBeatenRematchTrainerIdFromTable(const struct RematchTrainer *t
s32 i;
s32 tableId = FirstBattleTrainerIdToRematchTableId(table, firstBattleTrainerId);
if (tableId == INVALID_S32)
if (tableId == -1)
return FALSE;
trainerEntry = &table[tableId];
@ -1710,7 +1710,7 @@ static void ClearTrainerWantRematchState(const struct RematchTrainer *table, u16
{
s32 tableId = TrainerIdToRematchTableId(table, firstBattleTrainerId);
if (tableId != INVALID_S32)
if (tableId != -1)
gSaveBlock1Ptr->trainerRematches[tableId] = 0;
}
@ -1724,7 +1724,7 @@ static u32 GetTrainerMatchCallFlag(u32 trainerId)
return FLAG_MATCH_CALL_REGISTERED + i;
}
return INVALID_U16;
return 0xFFFF;
}
static void RegisterTrainerInMatchCall(void)
@ -1732,7 +1732,7 @@ static void RegisterTrainerInMatchCall(void)
if (FlagGet(FLAG_HAS_MATCH_CALL))
{
u32 matchCallFlagId = GetTrainerMatchCallFlag(gTrainerBattleOpponent_A);
if (matchCallFlagId != INVALID_U16)
if (matchCallFlagId != 0xFFFF)
FlagSet(matchCallFlagId);
}
}
@ -1741,7 +1741,7 @@ static bool8 WasSecondRematchWon(const struct RematchTrainer *table, u16 firstBa
{
s32 tableId = FirstBattleTrainerIdToRematchTableId(table, firstBattleTrainerId);
if (tableId == INVALID_S32)
if (tableId == -1)
return FALSE;
if (!HasTrainerBeenFought(table[tableId].trainerIds[1]))
return FALSE;

View File

@ -364,7 +364,7 @@ static void sub_81BA040(void)
} while (i != gSaveBlock2Ptr->frontier.curChallengeBattleNum);
gTrainerBattleOpponent_A = trainerId;
while (gFacilityTrainers[gTrainerBattleOpponent_A].monSets[setsCount] != INVALID_U16)
while (gFacilityTrainers[gTrainerBattleOpponent_A].monSets[setsCount] != 0xFFFF)
setsCount++;
if (setsCount > 8)
break;

View File

@ -973,7 +973,7 @@ static void FillTrainerParty(u16 trainerId, u8 firstMonId, u8 monCount)
// Attempt to fill the trainer's party with random Pokemon until 3 have been
// successfully chosen. The trainer's party may not have duplicate pokemon species
// or duplicate held items.
for (bfMonCount = 0; monSets[bfMonCount] != INVALID_U16; bfMonCount++)
for (bfMonCount = 0; monSets[bfMonCount] != 0xFFFF; bfMonCount++)
;
i = 0;
otID = Random32();
@ -1081,11 +1081,11 @@ u16 RandomizeFacilityTrainerMonSet(u16 trainerId)
u8 bfMonCount = 0;
u32 monSetId = monSets[bfMonCount];
while (monSetId != INVALID_U16)
while (monSetId != 0xFFFF)
{
bfMonCount++;
monSetId = monSets[bfMonCount];
if (monSetId == INVALID_U16)
if (monSetId == 0xFFFF)
break;
}
@ -2641,11 +2641,11 @@ static void FillTentTrainerParty_(u16 trainerId, u8 firstMonId, u8 monCount)
bfMonCount = 0;
monSetId = monSets[bfMonCount];
while (monSetId != INVALID_U16)
while (monSetId != 0xFFFF)
{
bfMonCount++;
monSetId = monSets[bfMonCount];
if (monSetId == INVALID_U16)
if (monSetId == 0xFFFF)
break;
}

View File

@ -612,32 +612,32 @@ static const s16 gUnknown_085C8CF2[] = {4, 517, -1};
static const s16 *const gUnknown_085C8CF8[] =
{
gUnknown_085C8C90,
gUnknown_085C8CA4,
gUnknown_085C8C98,
gUnknown_085C8C9E,
gUnknown_085C8CEA,
gUnknown_085C8CE4,
gUnknown_085C8CF2,
gUnknown_085C8CDE
gUnknown_085C8C90,
gUnknown_085C8CA4,
gUnknown_085C8C98,
gUnknown_085C8C9E,
gUnknown_085C8CEA,
gUnknown_085C8CE4,
gUnknown_085C8CF2,
gUnknown_085C8CDE
};
static const s16 *const gUnknown_085C8D18[] =
{
gUnknown_085C8CBC,
gUnknown_085C8CB0,
gUnknown_085C8CB6,
gUnknown_085C8CAA,
gUnknown_085C8CCA,
gUnknown_085C8CD8,
gUnknown_085C8CC4,
gUnknown_085C8CD2
gUnknown_085C8CBC,
gUnknown_085C8CB0,
gUnknown_085C8CB6,
gUnknown_085C8CAA,
gUnknown_085C8CCA,
gUnknown_085C8CD8,
gUnknown_085C8CC4,
gUnknown_085C8CD2
};
static const s16 *const *const gUnknown_085C8D38[] =
{
gUnknown_085C8CF8,
gUnknown_085C8D18
gUnknown_085C8CF8,
gUnknown_085C8D18
};
static const TransitionStateFunc sPhase2_Groudon_Funcs[] =
@ -749,7 +749,7 @@ static const union AffineAnimCmd *const sSpriteAffineAnimTable_85C8E60[] =
static const struct SpriteTemplate gUnknown_085C8E68 =
{
.tileTag = INVALID_U16,
.tileTag = 0xFFFF,
.paletteTag = 4105,
.oam = &gEventObjectBaseOam_32x32,
.anims = sSpriteAnimTable_85C8E3C,
@ -798,7 +798,7 @@ static const union AnimCmd *const sSpriteAnimTable_85C8EA0[] =
static const struct SpriteTemplate sSpriteTemplate_85C8EA4 =
{
.tileTag = INVALID_U16,
.tileTag = 0xFFFF,
.paletteTag = 4106,
.oam = &gOamData_85C8E80,
.anims = sSpriteAnimTable_85C8EA0,
@ -809,7 +809,7 @@ static const struct SpriteTemplate sSpriteTemplate_85C8EA4 =
static const struct SpriteTemplate sSpriteTemplate_85C8EBC =
{
.tileTag = INVALID_U16,
.tileTag = 0xFFFF,
.paletteTag = 4106,
.oam = &gOamData_85C8E80,
.anims = sSpriteAnimTable_85C8EA0,
@ -998,7 +998,7 @@ static bool8 Transition_Phase1(struct Task *task)
static bool8 Transition_WaitForPhase1(struct Task *task)
{
if (FindTaskIdByFunc(sPhase1_Tasks[task->tTransitionId]) == INVALID_U8)
if (FindTaskIdByFunc(sPhase1_Tasks[task->tTransitionId]) == 0xFF)
{
task->tState++;
return TRUE;
@ -1019,7 +1019,7 @@ static bool8 Transition_Phase2(struct Task *task)
static bool8 Transition_WaitForPhase2(struct Task *task)
{
task->tTransitionDone = FALSE;
if (FindTaskIdByFunc(sPhase2_Tasks[task->tTransitionId]) == INVALID_U8)
if (FindTaskIdByFunc(sPhase2_Tasks[task->tTransitionId]) == 0xFF)
task->tTransitionDone = TRUE;
return FALSE;
}
@ -3605,7 +3605,7 @@ static void CreatePhase1Task(s16 a0, s16 a1, s16 a2, s16 a3, s16 a4)
static bool8 IsPhase1Done(void)
{
if (FindTaskIdByFunc(TransitionPhase1_Task_RunFuncs) == INVALID_U8)
if (FindTaskIdByFunc(TransitionPhase1_Task_RunFuncs) == 0xFF)
return TRUE;
else
return FALSE;

View File

@ -26,9 +26,9 @@ static const u16 sVariableDmgMoves[] =
MOVE_WATER_SPOUT, MOVE_DREAM_EATER, MOVE_WEATHER_BALL,
MOVE_SNORE, MOVE_PAIN_SPLIT, MOVE_GUILLOTINE,
MOVE_FRUSTRATION, MOVE_RETURN, MOVE_ENDEAVOR,
MOVE_PRESENT, MOVE_REVENGE, INVALID_U16,
MOVE_PRESENT, MOVE_REVENGE, 0xFFFF,
// those are handled by the function itself
MOVE_MAGNITUDE, MOVE_PSYWAVE, INVALID_U16
MOVE_MAGNITUDE, MOVE_PSYWAVE, 0xFFFF
};
static const u16 sUnknown_0860A4E0[] =
@ -199,7 +199,7 @@ static const u16 sUnknown_0860A8A4[] =
STRINGID_PKMNAFFLICTEDBYCURSE, STRINGID_PKMNSAPPEDBYLEECHSEED, STRINGID_PKMNLOCKEDINNIGHTMARE,
STRINGID_PKMNHURTBY, STRINGID_PKMNHURTBYBURN, STRINGID_PKMNHURTBYPOISON,
STRINGID_PKMNHURTBYSPIKES, STRINGID_ATTACKERFAINTED, STRINGID_TARGETFAINTED,
STRINGID_PKMNHITWITHRECOIL, STRINGID_PKMNCRASHED, INVALID_U16
STRINGID_PKMNHITWITHRECOIL, STRINGID_PKMNCRASHED, 0xFFFF
};
// code
@ -625,9 +625,9 @@ static bool8 sub_817E0B8(u16 stringId)
if (sUnknown_0860A8A4[i] == stringId)
break;
i++;
} while (sUnknown_0860A8A4[i] != INVALID_U16);
} while (sUnknown_0860A8A4[i] != 0xFFFF);
if (sUnknown_0860A8A4[i] == INVALID_U16)
if (sUnknown_0860A8A4[i] == 0xFFFF)
return TRUE;
else
return FALSE;
@ -815,324 +815,324 @@ void TryPutLinkBattleTvShowOnAir(void)
{
asm_unified(
"push {r4-r7,lr}\n\
mov r7, r10\n\
mov r6, r9\n\
mov r5, r8\n\
push {r5-r7}\n\
sub sp, 0x20\n\
movs r0, 0\n\
str r0, [sp]\n\
movs r1, 0\n\
str r1, [sp, 0x4]\n\
movs r2, 0\n\
str r2, [sp, 0x8]\n\
ldr r3, =0x00007fff\n\
str r3, [sp, 0xC]\n\
movs r4, 0\n\
str r4, [sp, 0x10]\n\
movs r7, 0\n\
str r7, [sp, 0x14]\n\
mov r8, r0\n\
ldr r0, =gBattleStruct\n\
ldr r1, [r0]\n\
adds r0, r1, 0\n\
adds r0, 0xB3\n\
ldrb r0, [r0]\n\
cmp r0, 0\n\
beq _0817E42A\n\
b _0817E670\n\
mov r7, r10\n\
mov r6, r9\n\
mov r5, r8\n\
push {r5-r7}\n\
sub sp, 0x20\n\
movs r0, 0\n\
str r0, [sp]\n\
movs r1, 0\n\
str r1, [sp, 0x4]\n\
movs r2, 0\n\
str r2, [sp, 0x8]\n\
ldr r3, =0x00007fff\n\
str r3, [sp, 0xC]\n\
movs r4, 0\n\
str r4, [sp, 0x10]\n\
movs r7, 0\n\
str r7, [sp, 0x14]\n\
mov r8, r0\n\
ldr r0, =gBattleStruct\n\
ldr r1, [r0]\n\
adds r0, r1, 0\n\
adds r0, 0xB3\n\
ldrb r0, [r0]\n\
cmp r0, 0\n\
beq _0817E42A\n\
b _0817E670\n\
_0817E42A:\n\
movs r2, 0xD2\n\
lsls r2, 1\n\
adds r2, r1\n\
mov r10, r2\n\
movs r6, 0\n\
movs r2, 0xD2\n\
lsls r2, 1\n\
adds r2, r1\n\
mov r10, r2\n\
movs r6, 0\n\
_0817E434:\n\
movs r0, 0x64\n\
adds r4, r6, 0\n\
muls r4, r0\n\
ldr r0, =gPlayerParty\n\
adds r0, r4, r0\n\
movs r1, 0xB\n\
movs r2, 0\n\
bl GetMonData\n\
cmp r0, 0\n\
beq _0817E454\n\
mov r0, r8\n\
adds r0, 0x1\n\
lsls r0, 24\n\
lsrs r0, 24\n\
mov r8, r0\n\
movs r0, 0x64\n\
adds r4, r6, 0\n\
muls r4, r0\n\
ldr r0, =gPlayerParty\n\
adds r0, r4, r0\n\
movs r1, 0xB\n\
movs r2, 0\n\
bl GetMonData\n\
cmp r0, 0\n\
beq _0817E454\n\
mov r0, r8\n\
adds r0, 0x1\n\
lsls r0, 24\n\
lsrs r0, 24\n\
mov r8, r0\n\
_0817E454:\n\
ldr r5, =gEnemyParty\n\
adds r0, r4, r5\n\
movs r1, 0xB\n\
movs r2, 0\n\
bl GetMonData\n\
cmp r0, 0\n\
beq _0817E46A\n\
adds r0, r7, 0x1\n\
lsls r0, 24\n\
lsrs r7, r0, 24\n\
ldr r5, =gEnemyParty\n\
adds r0, r4, r5\n\
movs r1, 0xB\n\
movs r2, 0\n\
bl GetMonData\n\
cmp r0, 0\n\
beq _0817E46A\n\
adds r0, r7, 0x1\n\
lsls r0, 24\n\
lsrs r7, r0, 24\n\
_0817E46A:\n\
adds r6, 0x1\n\
cmp r6, 0x5\n\
ble _0817E434\n\
ldr r0, =gBattleTypeFlags\n\
ldr r0, [r0]\n\
movs r1, 0x2\n\
ands r0, r1\n\
cmp r0, 0\n\
bne _0817E47E\n\
b _0817E670\n\
adds r6, 0x1\n\
cmp r6, 0x5\n\
ble _0817E434\n\
ldr r0, =gBattleTypeFlags\n\
ldr r0, [r0]\n\
movs r1, 0x2\n\
ands r0, r1\n\
cmp r0, 0\n\
bne _0817E47E\n\
b _0817E670\n\
_0817E47E:\n\
cmp r8, r7\n\
beq _0817E484\n\
b _0817E670\n\
cmp r8, r7\n\
beq _0817E484\n\
b _0817E670\n\
_0817E484:\n\
movs r6, 0\n\
lsls r3, r6, 1\n\
str r3, [sp, 0x18]\n\
movs r4, 0x64\n\
mov r8, r4\n\
movs r6, 0\n\
lsls r3, r6, 1\n\
str r3, [sp, 0x18]\n\
movs r4, 0x64\n\
mov r8, r4\n\
_0817E48E:\n\
mov r1, r8\n\
muls r1, r6\n\
ldr r0, =gPlayerParty\n\
adds r4, r1, r0\n\
adds r0, r4, 0\n\
movs r1, 0xB\n\
movs r2, 0\n\
bl GetMonData\n\
lsls r0, 16\n\
lsrs r7, r0, 16\n\
adds r0, r6, 0x1\n\
mov r9, r0\n\
cmp r7, 0\n\
beq _0817E4EE\n\
adds r0, r4, 0\n\
movs r1, 0x2D\n\
movs r2, 0\n\
bl GetMonData\n\
cmp r0, 0\n\
bne _0817E4EE\n\
movs r4, 0\n\
lsls r0, r6, 3\n\
mov r2, r10\n\
adds r1, r0, r2\n\
movs r3, 0x3\n\
mov r1, r8\n\
muls r1, r6\n\
ldr r0, =gPlayerParty\n\
adds r4, r1, r0\n\
adds r0, r4, 0\n\
movs r1, 0xB\n\
movs r2, 0\n\
bl GetMonData\n\
lsls r0, 16\n\
lsrs r7, r0, 16\n\
adds r0, r6, 0x1\n\
mov r9, r0\n\
cmp r7, 0\n\
beq _0817E4EE\n\
adds r0, r4, 0\n\
movs r1, 0x2D\n\
movs r2, 0\n\
bl GetMonData\n\
cmp r0, 0\n\
bne _0817E4EE\n\
movs r4, 0\n\
lsls r0, r6, 3\n\
mov r2, r10\n\
adds r1, r0, r2\n\
movs r3, 0x3\n\
_0817E4C4:\n\
lsls r0, r4, 16\n\
asrs r0, 16\n\
ldrh r4, [r1]\n\
adds r0, r4\n\
lsls r0, 16\n\
lsrs r4, r0, 16\n\
adds r1, 0x2\n\
subs r3, 0x1\n\
cmp r3, 0\n\
bge _0817E4C4\n\
ldr r1, [sp, 0x8]\n\
lsls r0, r1, 16\n\
lsls r1, r4, 16\n\
cmp r0, r1\n\
bge _0817E4EE\n\
lsls r0, r6, 24\n\
lsrs r0, 24\n\
str r0, [sp, 0x10]\n\
lsrs r1, 16\n\
str r1, [sp, 0x8]\n\
str r7, [sp]\n\
lsls r0, r4, 16\n\
asrs r0, 16\n\
ldrh r4, [r1]\n\
adds r0, r4\n\
lsls r0, 16\n\
lsrs r4, r0, 16\n\
adds r1, 0x2\n\
subs r3, 0x1\n\
cmp r3, 0\n\
bge _0817E4C4\n\
ldr r1, [sp, 0x8]\n\
lsls r0, r1, 16\n\
lsls r1, r4, 16\n\
cmp r0, r1\n\
bge _0817E4EE\n\
lsls r0, r6, 24\n\
lsrs r0, 24\n\
str r0, [sp, 0x10]\n\
lsrs r1, 16\n\
str r1, [sp, 0x8]\n\
str r7, [sp]\n\
_0817E4EE:\n\
mov r0, r8\n\
muls r0, r6\n\
ldr r2, =gEnemyParty\n\
adds r4, r0, r2\n\
adds r0, r4, 0\n\
movs r1, 0xB\n\
movs r2, 0\n\
bl GetMonData\n\
lsls r0, 16\n\
lsrs r7, r0, 16\n\
ldr r3, [sp, 0x8]\n\
lsls r3, 16\n\
str r3, [sp, 0x1C]\n\
cmp r7, 0\n\
beq _0817E5A0\n\
adds r0, r4, 0\n\
movs r1, 0x2D\n\
movs r2, 0\n\
bl GetMonData\n\
cmp r0, 0\n\
bne _0817E5A0\n\
movs r4, 0\n\
ldr r0, [sp, 0xC]\n\
lsls r2, r0, 16\n\
movs r3, 0x1\n\
lsls r1, r3, 1\n\
adds r1, 0x1\n\
lsls r1, 4\n\
lsls r0, r6, 3\n\
adds r0, r1\n\
mov r3, r10\n\
adds r1, r0, r3\n\
movs r3, 0x3\n\
mov r0, r8\n\
muls r0, r6\n\
ldr r2, =gEnemyParty\n\
adds r4, r0, r2\n\
adds r0, r4, 0\n\
movs r1, 0xB\n\
movs r2, 0\n\
bl GetMonData\n\
lsls r0, 16\n\
lsrs r7, r0, 16\n\
ldr r3, [sp, 0x8]\n\
lsls r3, 16\n\
str r3, [sp, 0x1C]\n\
cmp r7, 0\n\
beq _0817E5A0\n\
adds r0, r4, 0\n\
movs r1, 0x2D\n\
movs r2, 0\n\
bl GetMonData\n\
cmp r0, 0\n\
bne _0817E5A0\n\
movs r4, 0\n\
ldr r0, [sp, 0xC]\n\
lsls r2, r0, 16\n\
movs r3, 0x1\n\
lsls r1, r3, 1\n\
adds r1, 0x1\n\
lsls r1, 4\n\
lsls r0, r6, 3\n\
adds r0, r1\n\
mov r3, r10\n\
adds r1, r0, r3\n\
movs r3, 0x3\n\
_0817E534:\n\
lsls r0, r4, 16\n\
asrs r0, 16\n\
ldrh r4, [r1]\n\
adds r0, r4\n\
lsls r0, 16\n\
lsrs r4, r0, 16\n\
adds r1, 0x2\n\
subs r3, 0x1\n\
cmp r3, 0\n\
bge _0817E534\n\
asrs r1, r2, 16\n\
lsls r5, r4, 16\n\
asrs r0, r5, 16\n\
cmp r1, r0\n\
bne _0817E590\n\
mov r0, r8\n\
muls r0, r6\n\
ldr r1, =gEnemyParty\n\
adds r0, r1\n\
movs r1, 0x19\n\
movs r2, 0\n\
bl GetMonData\n\
adds r4, r0, 0\n\
ldr r2, [sp, 0x14]\n\
mov r0, r8\n\
muls r0, r2\n\
ldr r3, =gEnemyParty\n\
adds r0, r3\n\
movs r1, 0x19\n\
movs r2, 0\n\
bl GetMonData\n\
cmp r4, r0\n\
bls _0817E5A0\n\
b _0817E594\n\
.pool\n\
lsls r0, r4, 16\n\
asrs r0, 16\n\
ldrh r4, [r1]\n\
adds r0, r4\n\
lsls r0, 16\n\
lsrs r4, r0, 16\n\
adds r1, 0x2\n\
subs r3, 0x1\n\
cmp r3, 0\n\
bge _0817E534\n\
asrs r1, r2, 16\n\
lsls r5, r4, 16\n\
asrs r0, r5, 16\n\
cmp r1, r0\n\
bne _0817E590\n\
mov r0, r8\n\
muls r0, r6\n\
ldr r1, =gEnemyParty\n\
adds r0, r1\n\
movs r1, 0x19\n\
movs r2, 0\n\
bl GetMonData\n\
adds r4, r0, 0\n\
ldr r2, [sp, 0x14]\n\
mov r0, r8\n\
muls r0, r2\n\
ldr r3, =gEnemyParty\n\
adds r0, r3\n\
movs r1, 0x19\n\
movs r2, 0\n\
bl GetMonData\n\
cmp r4, r0\n\
bls _0817E5A0\n\
b _0817E594\n\
.pool\n\
_0817E590:\n\
cmp r1, r0\n\
ble _0817E5A0\n\
cmp r1, r0\n\
ble _0817E5A0\n\
_0817E594:\n\
lsls r0, r6, 24\n\
lsrs r0, 24\n\
str r0, [sp, 0x14]\n\
lsrs r5, 16\n\
str r5, [sp, 0xC]\n\
str r7, [sp, 0x4]\n\
lsls r0, r6, 24\n\
lsrs r0, 24\n\
str r0, [sp, 0x14]\n\
lsrs r5, 16\n\
str r5, [sp, 0xC]\n\
str r7, [sp, 0x4]\n\
_0817E5A0:\n\
mov r6, r9\n\
cmp r6, 0x5\n\
bgt _0817E5A8\n\
b _0817E48E\n\
mov r6, r9\n\
cmp r6, 0x5\n\
bgt _0817E5A8\n\
b _0817E48E\n\
_0817E5A8:\n\
movs r4, 0\n\
movs r6, 0\n\
movs r3, 0\n\
ldr r5, =gPlayerParty\n\
ldr r7, [sp, 0x10]\n\
lsls r0, r7, 3\n\
mov r1, r10\n\
adds r2, r0, r1\n\
movs r4, 0\n\
movs r6, 0\n\
movs r3, 0\n\
ldr r5, =gPlayerParty\n\
ldr r7, [sp, 0x10]\n\
lsls r0, r7, 3\n\
mov r1, r10\n\
adds r2, r0, r1\n\
_0817E5B8:\n\
lsls r0, r4, 16\n\
asrs r0, 16\n\
movs r7, 0\n\
ldrsh r1, [r2, r7]\n\
cmp r0, r1\n\
bge _0817E5C8\n\
ldrh r4, [r2]\n\
adds r6, r3, 0\n\
lsls r0, r4, 16\n\
asrs r0, 16\n\
movs r7, 0\n\
ldrsh r1, [r2, r7]\n\
cmp r0, r1\n\
bge _0817E5C8\n\
ldrh r4, [r2]\n\
adds r6, r3, 0\n\
_0817E5C8:\n\
adds r2, 0x2\n\
adds r3, 0x1\n\
cmp r3, 0x3\n\
ble _0817E5B8\n\
movs r0, 0x64\n\
ldr r1, [sp, 0x10]\n\
muls r0, r1\n\
adds r0, r5\n\
adds r1, r6, 0\n\
adds r1, 0xD\n\
movs r2, 0\n\
bl GetMonData\n\
lsls r0, 16\n\
lsrs r4, r0, 16\n\
ldr r2, [sp, 0x1C]\n\
cmp r2, 0\n\
beq _0817E670\n\
cmp r4, 0\n\
beq _0817E670\n\
ldr r0, =gBattleTypeFlags\n\
ldr r0, [r0]\n\
movs r1, 0x40\n\
ands r0, r1\n\
cmp r0, 0\n\
beq _0817E65C\n\
ldr r3, [sp, 0x10]\n\
cmp r3, 0x2\n\
bhi _0817E620\n\
ldr r0, =gBattleScripting\n\
adds r0, 0x25\n\
ldrb r0, [r0]\n\
bl GetLinkTrainerFlankId\n\
lsls r0, 16\n\
cmp r0, 0\n\
beq _0817E630\n\
b _0817E670\n\
.pool\n\
adds r2, 0x2\n\
adds r3, 0x1\n\
cmp r3, 0x3\n\
ble _0817E5B8\n\
movs r0, 0x64\n\
ldr r1, [sp, 0x10]\n\
muls r0, r1\n\
adds r0, r5\n\
adds r1, r6, 0\n\
adds r1, 0xD\n\
movs r2, 0\n\
bl GetMonData\n\
lsls r0, 16\n\
lsrs r4, r0, 16\n\
ldr r2, [sp, 0x1C]\n\
cmp r2, 0\n\
beq _0817E670\n\
cmp r4, 0\n\
beq _0817E670\n\
ldr r0, =gBattleTypeFlags\n\
ldr r0, [r0]\n\
movs r1, 0x40\n\
ands r0, r1\n\
cmp r0, 0\n\
beq _0817E65C\n\
ldr r3, [sp, 0x10]\n\
cmp r3, 0x2\n\
bhi _0817E620\n\
ldr r0, =gBattleScripting\n\
adds r0, 0x25\n\
ldrb r0, [r0]\n\
bl GetLinkTrainerFlankId\n\
lsls r0, 16\n\
cmp r0, 0\n\
beq _0817E630\n\
b _0817E670\n\
.pool\n\
_0817E620:\n\
ldr r0, =gBattleScripting\n\
adds r0, 0x25\n\
ldrb r0, [r0]\n\
bl GetLinkTrainerFlankId\n\
lsls r0, 16\n\
cmp r0, 0\n\
beq _0817E670\n\
ldr r0, =gBattleScripting\n\
adds r0, 0x25\n\
ldrb r0, [r0]\n\
bl GetLinkTrainerFlankId\n\
lsls r0, 16\n\
cmp r0, 0\n\
beq _0817E670\n\
_0817E630:\n\
movs r3, 0\n\
ldr r7, [sp, 0x14]\n\
cmp r7, 0x2\n\
bls _0817E63A\n\
movs r3, 0x1\n\
movs r3, 0\n\
ldr r7, [sp, 0x14]\n\
cmp r7, 0x2\n\
bls _0817E63A\n\
movs r3, 0x1\n\
_0817E63A:\n\
lsls r0, r3, 24\n\
lsrs r0, 24\n\
ldr r1, =gBattleScripting\n\
adds r1, 0x25\n\
ldrb r1, [r1]\n\
bl sub_806EF84\n\
lsls r0, 24\n\
lsrs r0, 24\n\
adds r1, r4, 0\n\
ldr r2, [sp]\n\
ldr r3, [sp, 0x4]\n\
bl PutBattleUpdateOnTheAir\n\
b _0817E670\n\
.pool\n\
lsls r0, r3, 24\n\
lsrs r0, 24\n\
ldr r1, =gBattleScripting\n\
adds r1, 0x25\n\
ldrb r1, [r1]\n\
bl sub_806EF84\n\
lsls r0, 24\n\
lsrs r0, 24\n\
adds r1, r4, 0\n\
ldr r2, [sp]\n\
ldr r3, [sp, 0x4]\n\
bl PutBattleUpdateOnTheAir\n\
b _0817E670\n\
.pool\n\
_0817E65C:\n\
ldr r0, =gBattleScripting\n\
adds r0, 0x25\n\
ldrb r1, [r0]\n\
movs r0, 0x1\n\
eors r0, r1\n\
adds r1, r4, 0\n\
ldr r2, [sp]\n\
ldr r3, [sp, 0x4]\n\
bl PutBattleUpdateOnTheAir\n\
ldr r0, =gBattleScripting\n\
adds r0, 0x25\n\
ldrb r1, [r0]\n\
movs r0, 0x1\n\
eors r0, r1\n\
adds r1, r4, 0\n\
ldr r2, [sp]\n\
ldr r3, [sp, 0x4]\n\
bl PutBattleUpdateOnTheAir\n\
_0817E670:\n\
add sp, 0x20\n\
pop {r3-r5}\n\
mov r8, r3\n\
mov r9, r4\n\
mov r10, r5\n\
pop {r4-r7}\n\
pop {r0}\n\
bx r0\n\
.pool");
add sp, 0x20\n\
pop {r3-r5}\n\
mov r8, r3\n\
mov r9, r4\n\
mov r10, r5\n\
pop {r4-r7}\n\
pop {r0}\n\
bx r0\n\
.pool");
}
#endif
@ -1164,7 +1164,7 @@ static void AddMovePoints(u8 caseId, u16 arg1, u8 arg2, u8 arg3)
break;
}
i += 2;
} while (ptr[i] != INVALID_U16);
} while (ptr[i] != 0xFFFF);
break;
case 19:
tvPtr->side[arg2 ^ 1].faintCause = 0;
@ -1415,9 +1415,9 @@ static void TrySetBattleSeminarShow(void)
if (currMoveSaved == sVariableDmgMoves[i])
break;
i++;
} while (sVariableDmgMoves[i] != INVALID_U16);
} while (sVariableDmgMoves[i] != 0xFFFF);
if (sVariableDmgMoves[i] != INVALID_U16)
if (sVariableDmgMoves[i] != 0xFFFF)
return;
dmgByMove[gMoveSelectionCursor[gBattlerAttacker]] = gBattleMoveDamage;
@ -1490,9 +1490,9 @@ static bool8 ShouldCalculateDamage(u16 moveId, s32 *dmg, u16 *powerOverride)
if (moveId == sVariableDmgMoves[i])
break;
i++;
} while (sVariableDmgMoves[i] != INVALID_U16);
} while (sVariableDmgMoves[i] != 0xFFFF);
if (sVariableDmgMoves[i] != INVALID_U16)
if (sVariableDmgMoves[i] != 0xFFFF)
{
*dmg = 0;
return FALSE;

View File

@ -29,7 +29,7 @@ extern u8 weather_get_current(void);
static const u16 sSoundMovesTable[] =
{
MOVE_GROWL, MOVE_ROAR, MOVE_SING, MOVE_SUPERSONIC, MOVE_SCREECH, MOVE_SNORE,
MOVE_UPROAR, MOVE_METAL_SOUND, MOVE_GRASS_WHISTLE, MOVE_HYPER_VOICE, INVALID_U16
MOVE_UPROAR, MOVE_METAL_SOUND, MOVE_GRASS_WHISTLE, MOVE_HYPER_VOICE, 0xFFFF
};
u8 GetBattlerForBattleScript(u8 caseId)
@ -382,7 +382,7 @@ u8 TrySetCantSelectMoveBattleScript(void)
gPotentialItemEffectBattler = gActiveBattler;
if (holdEffect == HOLD_EFFECT_CHOICE_BAND && *choicedMove != 0 && *choicedMove != INVALID_U16 && *choicedMove != move)
if (holdEffect == HOLD_EFFECT_CHOICE_BAND && *choicedMove != 0 && *choicedMove != 0xFFFF && *choicedMove != move)
{
gCurrentMove = *choicedMove;
gLastUsedItem = gBattleMons[gActiveBattler].item;
@ -442,7 +442,7 @@ u8 CheckMoveLimitations(u8 battlerId, u8 unusableMoves, u8 check)
unusableMoves |= gBitTable[i];
if (gDisableStructs[battlerId].encoreTimer && gDisableStructs[battlerId].encoredMove != gBattleMons[battlerId].moves[i])
unusableMoves |= gBitTable[i];
if (holdEffect == HOLD_EFFECT_CHOICE_BAND && *choicedMove != 0 && *choicedMove != INVALID_U16 && *choicedMove != gBattleMons[battlerId].moves[i])
if (holdEffect == HOLD_EFFECT_CHOICE_BAND && *choicedMove != 0 && *choicedMove != 0xFFFF && *choicedMove != gBattleMons[battlerId].moves[i])
unusableMoves |= gBitTable[i];
}
return unusableMoves;
@ -451,7 +451,7 @@ u8 CheckMoveLimitations(u8 battlerId, u8 unusableMoves, u8 check)
bool8 AreAllMovesUnusable(void)
{
u8 unusable;
unusable = CheckMoveLimitations(gActiveBattler, 0, INVALID_U8);
unusable = CheckMoveLimitations(gActiveBattler, 0, 0xFF);
if (unusable == 0xF) // All moves are unusable.
{
@ -1137,7 +1137,7 @@ bool8 HandleWishPerishSongOnTurnEnd(void)
gBattlerTarget = gActiveBattler;
gBattlerAttacker = gWishFutureKnock.futureSightAttacker[gActiveBattler];
gBattleMoveDamage = gWishFutureKnock.futureSightDmg[gActiveBattler];
gSpecialStatuses[gBattlerTarget].dmg = INVALID_U16;
gSpecialStatuses[gBattlerTarget].dmg = 0xFFFF;
BattleScriptExecute(BattleScript_MonTookFutureAttack);
if (gWishFutureKnock.futureSightCounter[gActiveBattler] == 0
@ -1996,12 +1996,12 @@ u8 AbilityBattleEffects(u8 caseID, u8 battler, u8 ability, u8 special, u16 moveA
case ABILITYEFFECT_MOVES_BLOCK: // 2
if (gLastUsedAbility == ABILITY_SOUNDPROOF)
{
for (i = 0; sSoundMovesTable[i] != INVALID_U16; i++)
for (i = 0; sSoundMovesTable[i] != 0xFFFF; i++)
{
if (sSoundMovesTable[i] == move)
break;
}
if (sSoundMovesTable[i] != INVALID_U16)
if (sSoundMovesTable[i] != 0xFFFF)
{
if (gBattleMons[gBattlerAttacker].status2 & STATUS2_MULTIPLETURNS)
gHitMarker |= HITMARKER_NO_PPDEDUCT;
@ -2527,7 +2527,7 @@ u8 AbilityBattleEffects(u8 caseID, u8 battler, u8 ability, u8 special, u16 moveA
break;
}
if (effect && caseID < ABILITYEFFECT_CHECK_OTHER_SIDE && gLastUsedAbility != INVALID_U8)
if (effect && caseID < ABILITYEFFECT_CHECK_OTHER_SIDE && gLastUsedAbility != 0xFF)
RecordAbilityBattle(battler, gLastUsedAbility);
}
@ -3213,7 +3213,7 @@ u8 ItemBattleEffects(u8 caseID, u8 battlerId, bool8 moveTurn)
case HOLD_EFFECT_SHELL_BELL:
if (!(gMoveResultFlags & MOVE_RESULT_NO_EFFECT)
&& gSpecialStatuses[gBattlerTarget].dmg != 0
&& gSpecialStatuses[gBattlerTarget].dmg != INVALID_U16
&& gSpecialStatuses[gBattlerTarget].dmg != 0xFFFF
&& gBattlerAttacker != gBattlerTarget
&& gBattleMons[gBattlerAttacker].hp != gBattleMons[gBattlerAttacker].maxHP
&& gBattleMons[gBattlerAttacker].hp != 0)
@ -3394,7 +3394,7 @@ u8 IsMonDisobedient(void)
calc = (gBattleMons[gBattlerAttacker].level + obedienceLevel) * rnd >> 8;
if (calc < obedienceLevel)
{
calc = CheckMoveLimitations(gBattlerAttacker, gBitTable[gCurrMovePos], INVALID_U8);
calc = CheckMoveLimitations(gBattlerAttacker, gBitTable[gCurrMovePos], 0xFF);
if (calc == 0xF) // all moves cannot be used
{
gBattleCommunication[MULTISTRING_CHOOSER] = Random() & 3;

View File

@ -1455,7 +1455,7 @@ static void sub_808074C(void)
for (i = 0; i < BLENDER_MAX_PLAYERS; i++)
{
sBerryBlenderData->field_96[i] = INVALID_U8;
sBerryBlenderData->field_96[i] = 0xFF;
sBerryBlenderData->field_8E[i] = sUnknown_083399D0[sBerryBlenderData->playersNo - 2][i];
}
for (j = 0; j < BLENDER_MAX_PLAYERS; j++)
@ -1479,7 +1479,7 @@ static void Blender_PrintPlayerNames(void)
for (i = 0; i < BLENDER_MAX_PLAYERS; i++)
{
if (sBerryBlenderData->field_8E[i] != INVALID_U8)
if (sBerryBlenderData->field_8E[i] != 0xFF)
{
sBerryBlenderData->syncArrowSpriteIds[sBerryBlenderData->field_8E[i]] = sBerryBlenderData->syncArrowSprite2Ids[i];
StartSpriteAnim(&gSprites[sBerryBlenderData->syncArrowSpriteIds[sBerryBlenderData->field_8E[i]]], i);

View File

@ -87,37 +87,37 @@ void SetBgControlAttributes(u8 bg, u8 charBaseIndex, u8 mapBaseIndex, u8 screenS
{
if (IsInvalidBg(bg) == FALSE)
{
if (charBaseIndex != INVALID_U8)
if (charBaseIndex != 0xFF)
{
sGpuBgConfigs.configs[bg].charBaseIndex = charBaseIndex & 0x3;
}
if (mapBaseIndex != INVALID_U8)
if (mapBaseIndex != 0xFF)
{
sGpuBgConfigs.configs[bg].mapBaseIndex = mapBaseIndex & 0x1F;
}
if (screenSize != INVALID_U8)
if (screenSize != 0xFF)
{
sGpuBgConfigs.configs[bg].screenSize = screenSize & 0x3;
}
if (paletteMode != INVALID_U8)
if (paletteMode != 0xFF)
{
sGpuBgConfigs.configs[bg].paletteMode = paletteMode;
}
if (priority != INVALID_U8)
if (priority != 0xFF)
{
sGpuBgConfigs.configs[bg].priority = priority & 0x3;
}
if (mosaic != INVALID_U8)
if (mosaic != 0xFF)
{
sGpuBgConfigs.configs[bg].mosaic = mosaic & 0x1;
}
if (wraparound != INVALID_U8)
if (wraparound != 0xFF)
{
sGpuBgConfigs.configs[bg].wraparound = wraparound;
}
@ -154,7 +154,7 @@ u16 GetBgControlAttribute(u8 bg, u8 attributeId)
}
}
return INVALID_U8;
return 0xFF;
}
u8 LoadBgVram(u8 bg, const void *src, u16 size, u16 destOffset, u8 mode)
@ -379,7 +379,7 @@ u16 LoadBgTiles(u8 bg, const void* src, u16 size, u16 destOffset)
cursor = LoadBgVram(bg, src, size, tileOffset, DISPCNT_MODE_1);
if (cursor == INVALID_U8)
if (cursor == 0xFF)
{
return -1;
}
@ -400,7 +400,7 @@ u16 LoadBgTilemap(u8 bg, const void *src, u16 size, u16 destOffset)
cursor = LoadBgVram(bg, src, size, destOffset * 2, DISPCNT_MODE_2);
if (cursor == INVALID_U8)
if (cursor == 0xFF)
{
return -1;
}
@ -480,25 +480,25 @@ void SetBgAttribute(u8 bg, u8 attributeId, u8 value)
switch (attributeId)
{
case 1:
SetBgControlAttributes(bg, value, INVALID_U8, INVALID_U8, INVALID_U8, INVALID_U8, INVALID_U8, INVALID_U8);
SetBgControlAttributes(bg, value, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF);
break;
case 2:
SetBgControlAttributes(bg, INVALID_U8, value, INVALID_U8, INVALID_U8, INVALID_U8, INVALID_U8, INVALID_U8);
SetBgControlAttributes(bg, 0xFF, value, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF);
break;
case 3:
SetBgControlAttributes(bg, INVALID_U8, INVALID_U8, value, INVALID_U8, INVALID_U8, INVALID_U8, INVALID_U8);
SetBgControlAttributes(bg, 0xFF, 0xFF, value, 0xFF, 0xFF, 0xFF, 0xFF);
break;
case 4:
SetBgControlAttributes(bg, INVALID_U8, INVALID_U8, INVALID_U8, value, INVALID_U8, INVALID_U8, INVALID_U8);
SetBgControlAttributes(bg, 0xFF, 0xFF, 0xFF, value, 0xFF, 0xFF, 0xFF);
break;
case 7:
SetBgControlAttributes(bg, INVALID_U8, INVALID_U8, INVALID_U8, INVALID_U8, value, INVALID_U8, INVALID_U8);
SetBgControlAttributes(bg, 0xFF, 0xFF, 0xFF, 0xFF, value, 0xFF, 0xFF);
break;
case 5:
SetBgControlAttributes(bg, INVALID_U8, INVALID_U8, INVALID_U8, INVALID_U8, INVALID_U8, value, INVALID_U8);
SetBgControlAttributes(bg, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, value, 0xFF);
break;
case 6:
SetBgControlAttributes(bg, INVALID_U8, INVALID_U8, INVALID_U8, INVALID_U8, INVALID_U8, INVALID_U8, value);
SetBgControlAttributes(bg, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, value);
break;
}
}
@ -1284,7 +1284,7 @@ u32 GetBgType(u8 bg)
break;
}
return INVALID_U16;
return 0xFFFF;
}
bool32 IsInvalidBg32(u8 bg)

View File

@ -3,7 +3,7 @@
void BlitBitmapRect4BitWithoutColorKey(struct Bitmap *src, struct Bitmap *dst, u16 srcX, u16 srcY, u16 dstX, u16 dstY, u16 width, u16 height)
{
BlitBitmapRect4Bit(src, dst, srcX, srcY, dstX, dstY, width, height, INVALID_U8);
BlitBitmapRect4Bit(src, dst, srcX, srcY, dstX, dstY, width, height, 0xFF);
}
void BlitBitmapRect4Bit(struct Bitmap *src, struct Bitmap *dst, u16 srcX, u16 srcY, u16 dstX, u16 dstY, u16 width, u16 height, u8 colorKey)
@ -33,7 +33,7 @@ void BlitBitmapRect4Bit(struct Bitmap *src, struct Bitmap *dst, u16 srcX, u16 sr
multiplierSrcY = (src->width + (src->width & 7)) >> 3;
multiplierDstY = (dst->width + (dst->width & 7)) >> 3;
if (colorKey == INVALID_U8)
if (colorKey == 0xFF)
{
for (loopSrcY = srcY, loopDstY = dstY; loopSrcY < yEnd; loopSrcY++, loopDstY++)
{
@ -132,7 +132,7 @@ void BlitBitmapRect4BitTo8Bit(struct Bitmap *src, struct Bitmap *dst, u16 srcX,
multiplierSrcY = (src->width + (src->width & 7)) >> 3;
multiplierDstY = (dst->width + (dst->width & 7)) >> 3;
if (colorKey == INVALID_U8)
if (colorKey == 0xFF)
{
for (loopSrcY = srcY, loopDstY = dstY; loopSrcY < yEnd; loopSrcY++, loopDstY++)
{

View File

@ -465,7 +465,7 @@ bool8 ShouldDoBrailleRegicePuzzle(void)
}
varValue = VarGet(0x403B);
if (varValue != INVALID_U16 || VarGet(0x403C) != varValue || VarGet(0x403D) != 0xF)
if (varValue != 0xFFFF || VarGet(0x403C) != varValue || VarGet(0x403D) != 0xF)
return FALSE;
if (gSaveBlock1Ptr->pos.x == 8 && gSaveBlock1Ptr->pos.y == 21)

View File

@ -70,7 +70,7 @@ static void sub_80B3220(u8 taskId);
static void sub_80B236C(u8 arg0, u8 arg1)
{
if (FindTaskIdByFunc(sub_80B2634) == INVALID_U8)
if (FindTaskIdByFunc(sub_80B2634) == 0xFF)
{
u8 taskId1;
@ -604,7 +604,7 @@ void sub_80B2EA8(void)
{
u32 taskId = FindTaskIdByFunc(sub_80B2EE4);
if (taskId == INVALID_U8)
if (taskId == 0xFF)
{
taskId = CreateTask(sub_80B2EE4, 80);
gTasks[taskId].data[0] = 0;
@ -702,7 +702,7 @@ void sub_80B3028(void)
u8 sub_80B3050(void)
{
if (FuncIsActiveTask(sub_80B3144) != FALSE)
return INVALID_U8;
return 0xFF;
switch (gSpecialVar_0x8004)
{

View File

@ -324,7 +324,7 @@ void sub_80D787C(void)
*gContestResources->field_0 = (struct Contest){};
for (i = 0; i < 4; i++)
{
gContestResources->field_0->unk19206[i] = INVALID_U8;
gContestResources->field_0->unk19206[i] = 0xFF;
}
for (i = 0; i < 4; i++)
{
@ -344,7 +344,7 @@ void sub_80D787C(void)
sub_80DCE58(0);
for (i = 0; i < 4; i++)
{
gContestResources->field_4[i].nextTurnOrder = INVALID_U8;
gContestResources->field_4[i].nextTurnOrder = 0xFF;
gContestResources->field_0->unk19218[i] = gUnknown_02039F26[i];
}
sub_80DD590();
@ -2097,7 +2097,7 @@ void sub_80DAB8C(u8 contestType, u8 rank)
opponents[opponentsCount++] = i;
}
}
opponents[opponentsCount] = INVALID_U8;
opponents[opponentsCount] = 0xFF;
// Choose three random opponents from the list
for (i = 0; i < 3; i++)
@ -2106,7 +2106,7 @@ void sub_80DAB8C(u8 contestType, u8 rank)
s32 j;
gContestMons[i] = gContestOpponents[opponents[rnd]];
for (j = rnd; opponents[j] != INVALID_U8; j++)
for (j = rnd; opponents[j] != 0xFF; j++)
opponents[j] = opponents[j + 1];
opponentsCount--;
}
@ -2151,7 +2151,7 @@ void sub_80DACBC(u8 contestType, u8 rank, bool32 isPostgame)
else if (contestType == CONTEST_CATEGORY_TOUGH && gContestOpponents[i].aiPool_Tough)
opponents[opponentsCount++] = i;
}
opponents[opponentsCount] = INVALID_U8;
opponents[opponentsCount] = 0xFF;
for (i = 0; i < 4 - gUnknown_02039F30; i++)
{
u16 rnd = sub_80F903C() % opponentsCount;
@ -2160,7 +2160,7 @@ void sub_80DACBC(u8 contestType, u8 rank, bool32 isPostgame)
gContestMons[gUnknown_02039F30 + i] = gContestOpponents[opponents[rnd]];
sub_80DF9D4(gContestMons[gUnknown_02039F30 + i].trainerName);
sub_80DF9E0(gContestMons[gUnknown_02039F30 + i].nickname, GAME_LANGUAGE);
for (j = rnd; opponents[j] != INVALID_U8; j++)
for (j = rnd; opponents[j] != 0xFF; j++)
opponents[j] = opponents[j + 1];
opponentsCount--;
}
@ -2591,7 +2591,7 @@ void prints_contest_move_description(u16 a)
ContestBG_FillBoxWithIncrementingTile(0, categoryTile, 0x0b, 0x1f, 0x05, 0x01, 0x11, 0x01);
ContestBG_FillBoxWithIncrementingTile(0, categoryTile + 0x10, 0x0b, 0x20, 0x05, 0x01, 0x11, 0x01);
if (gContestEffects[gContestMoves[a].effect].appeal == INVALID_U8)
if (gContestEffects[gContestMoves[a].effect].appeal == 0xFF)
numHearts = 0;
else
numHearts = gContestEffects[gContestMoves[a].effect].appeal / 10;
@ -2600,7 +2600,7 @@ void prints_contest_move_description(u16 a)
ContestBG_FillBoxWithTile(0, 0x5035, 0x15, 0x1f, 0x08, 0x01, 0x11);
ContestBG_FillBoxWithTile(0, 0x5012, 0x15, 0x1f, numHearts, 0x01, 0x11);
if (gContestEffects[gContestMoves[a].effect].jam == INVALID_U8)
if (gContestEffects[gContestMoves[a].effect].jam == 0xFF)
numHearts = 0;
else
numHearts = gContestEffects[gContestMoves[a].effect].jam / 10;

View File

@ -144,7 +144,7 @@ static void ContestEffect_StartleFrontMon(void)
break;
}
shared192D0.jamQueue[0] = i;
shared192D0.jamQueue[1] = INVALID_U8;
shared192D0.jamQueue[1] = 0xFF;
idx = WasAtLeastOneOpponentJammed();
}
if (idx == 0)
@ -168,7 +168,7 @@ static void ContestEffect_StartlePrevMons(void)
shared192D0.jamQueue[j++] = i;
}
shared192D0.jamQueue[j] = INVALID_U8;
shared192D0.jamQueue[j] = 0xFF;
idx = WasAtLeastOneOpponentJammed();
}
if (idx == 0)
@ -211,7 +211,7 @@ static void ContestEffect_StartlePrevMons2(void)
u8 rval, jam;
shared192D0.jamQueue[0] = i;
shared192D0.jamQueue[1] = INVALID_U8;
shared192D0.jamQueue[1] = 0xFF;
rval = Random() % 10;
if (rval == 0)
@ -288,7 +288,7 @@ static void ContestEffect_StartleMonWithJudgesAttention(void)
else
shared192D0.jam = 10;
shared192D0.jamQueue[0] = i;
shared192D0.jamQueue[1] = INVALID_U8;
shared192D0.jamQueue[1] = 0xFF;
if (WasAtLeastOneOpponentJammed())
numStartled++;
}
@ -393,7 +393,7 @@ static void ContestEffect_MakeFollowingMonsNervous(void)
s16 oddsMod[4];
s16 odds[4];
memset(contestantIds, INVALID_U8, ARRAY_COUNT(contestantIds));
memset(contestantIds, 0xFF, ARRAY_COUNT(contestantIds));
for (i = 0, numAfter = 0; i < 4; i++)
{
if (shared192D0.turnOrder[shared192D0.contestant] < shared192D0.turnOrder[i] &&
@ -431,7 +431,7 @@ static void ContestEffect_MakeFollowingMonsNervous(void)
}
if (odds[0] != 0)
{
for (i = 0; contestantIds[i] != INVALID_U8; i++)
for (i = 0; contestantIds[i] != 0xFF; i++)
{
if (Random() % 100 < odds[i] + oddsMod[contestantIds[i]])
{
@ -504,7 +504,7 @@ static void ContestEffect_BadlyStartlesMonsInGoodCondition(void)
else
shared192D0.jam = 10;
shared192D0.jamQueue[0] = i;
shared192D0.jamQueue[1] = INVALID_U8;
shared192D0.jamQueue[1] = 0xFF;
if (WasAtLeastOneOpponentJammed())
numHit++;
}
@ -755,7 +755,7 @@ static void ContestEffect_NextAppealEarlier(void)
for (i = 0; i < 4; i++)
turnOrder[i] = sContestantStatus[i].nextTurnOrder;
turnOrder[shared192D0.contestant] = INVALID_U8;
turnOrder[shared192D0.contestant] = 0xFF;
for (i = 0; i < 4; i++)
{
@ -797,7 +797,7 @@ static void ContestEffect_NextAppealLater(void)
for (i = 0; i < 4; i++)
turnOrder[i] = sContestantStatus[i].nextTurnOrder;
turnOrder[shared192D0.contestant] = INVALID_U8;
turnOrder[shared192D0.contestant] = 0xFF;
for (i = 3; i > -1; i--)
{
@ -855,12 +855,12 @@ static void ContestEffect_ScrambleNextTurnOrder(void)
for (j = 0; j < 4; j++)
{
if (unselectedContestants[j] != INVALID_U8)
if (unselectedContestants[j] != 0xFF)
{
if (rval == 0)
{
turnOrder[j] = i;
unselectedContestants[j] = INVALID_U8;
unselectedContestants[j] = 0xFF;
break;
}
else
@ -906,7 +906,7 @@ static void ContestEffect_BadlyStartleMonsWithGoodAppeals(void)
else
shared192D0.jam = 10;
shared192D0.jamQueue[0] = i;
shared192D0.jamQueue[1] = INVALID_U8;
shared192D0.jamQueue[1] = 0xFF;
if (WasAtLeastOneOpponentJammed())
numJammed++;
}
@ -974,7 +974,7 @@ static void JamByMoveCategory(u8 category)
else
shared192D0.jam = 10;
shared192D0.jamQueue[0] = i;
shared192D0.jamQueue[1] = INVALID_U8;
shared192D0.jamQueue[1] = 0xFF;
if (WasAtLeastOneOpponentJammed())
numJammed++;
}
@ -1013,7 +1013,7 @@ static bool8 WasAtLeastOneOpponentJammed(void)
s16 jamBuffer[4] = {0};
int i;
for (i = 0; shared192D0.jamQueue[i] != INVALID_U8; i++)
for (i = 0; shared192D0.jamQueue[i] != 0xFF; i++)
{
u8 contestant = shared192D0.jamQueue[i];
if (CanUnnerveContestant(contestant))

File diff suppressed because it is too large Load Diff

View File

@ -247,253 +247,253 @@ const struct EventObjectGraphicsInfo gEventObjectGraphicsInfo_UnusedMauvilleOldM
const struct EventObjectGraphicsInfo *const gEventObjectGraphicsInfoPointers[] = {
&gEventObjectGraphicsInfo_BrendanNormal,
&gEventObjectGraphicsInfo_BrendanMachBike,
&gEventObjectGraphicsInfo_BrendanSurfing,
&gEventObjectGraphicsInfo_BrendanFieldMove,
&gEventObjectGraphicsInfo_QuintyPlump,
&gEventObjectGraphicsInfo_NinjaBoy,
&gEventObjectGraphicsInfo_Twin,
&gEventObjectGraphicsInfo_Boy1,
&gEventObjectGraphicsInfo_Girl1,
&gEventObjectGraphicsInfo_Boy2,
&gEventObjectGraphicsInfo_Girl2,
&gEventObjectGraphicsInfo_LittleBoy,
&gEventObjectGraphicsInfo_LittleGirl,
&gEventObjectGraphicsInfo_Boy3,
&gEventObjectGraphicsInfo_Girl3,
&gEventObjectGraphicsInfo_RichBoy,
&gEventObjectGraphicsInfo_Woman1,
&gEventObjectGraphicsInfo_FatMan,
&gEventObjectGraphicsInfo_PokefanF,
&gEventObjectGraphicsInfo_Man1,
&gEventObjectGraphicsInfo_Woman2,
&gEventObjectGraphicsInfo_ExpertM,
&gEventObjectGraphicsInfo_ExpertF,
&gEventObjectGraphicsInfo_Man2,
&gEventObjectGraphicsInfo_Woman3,
&gEventObjectGraphicsInfo_PokefanM,
&gEventObjectGraphicsInfo_Woman4,
&gEventObjectGraphicsInfo_Cook,
&gEventObjectGraphicsInfo_LinkReceptionist,
&gEventObjectGraphicsInfo_OldMan,
&gEventObjectGraphicsInfo_OldWoman,
&gEventObjectGraphicsInfo_Camper,
&gEventObjectGraphicsInfo_Picnicker,
&gEventObjectGraphicsInfo_Man3,
&gEventObjectGraphicsInfo_Woman5,
&gEventObjectGraphicsInfo_Youngster,
&gEventObjectGraphicsInfo_BugCatcher,
&gEventObjectGraphicsInfo_PsychicM,
&gEventObjectGraphicsInfo_SchoolKidM,
&gEventObjectGraphicsInfo_Maniac,
&gEventObjectGraphicsInfo_HexManiac,
&gEventObjectGraphicsInfo_Rayquaza1,
&gEventObjectGraphicsInfo_SwimmerM,
&gEventObjectGraphicsInfo_SwimmerF,
&gEventObjectGraphicsInfo_BlackBelt,
&gEventObjectGraphicsInfo_Beauty,
&gEventObjectGraphicsInfo_Scientist1,
&gEventObjectGraphicsInfo_Lass,
&gEventObjectGraphicsInfo_Gentleman,
&gEventObjectGraphicsInfo_Sailor,
&gEventObjectGraphicsInfo_Fisherman,
&gEventObjectGraphicsInfo_RunningTriathleteM,
&gEventObjectGraphicsInfo_RunningTriathleteF,
&gEventObjectGraphicsInfo_TuberF,
&gEventObjectGraphicsInfo_TuberM,
&gEventObjectGraphicsInfo_Hiker,
&gEventObjectGraphicsInfo_CyclingTriathleteM,
&gEventObjectGraphicsInfo_CyclingTriathleteF,
&gEventObjectGraphicsInfo_Nurse,
&gEventObjectGraphicsInfo_ItemBall,
&gEventObjectGraphicsInfo_BerryTree,
&gEventObjectGraphicsInfo_BerryTreeEarlyStages,
&gEventObjectGraphicsInfo_BerryTreeLateStages,
&gEventObjectGraphicsInfo_BrendanAcroBike,
&gEventObjectGraphicsInfo_ProfBirch,
&gEventObjectGraphicsInfo_Man4,
&gEventObjectGraphicsInfo_Man5,
&gEventObjectGraphicsInfo_ReporterM,
&gEventObjectGraphicsInfo_ReporterF,
&gEventObjectGraphicsInfo_Bard,
&gEventObjectGraphicsInfo_Anabel,
&gEventObjectGraphicsInfo_Tucker,
&gEventObjectGraphicsInfo_Greta,
&gEventObjectGraphicsInfo_Spenser,
&gEventObjectGraphicsInfo_Noland,
&gEventObjectGraphicsInfo_Lucy,
&gEventObjectGraphicsInfo_UnusedNatuDoll,
&gEventObjectGraphicsInfo_UnusedMagnemiteDoll,
&gEventObjectGraphicsInfo_UnusedSquirtleDoll,
&gEventObjectGraphicsInfo_UnusedWooperDoll,
&gEventObjectGraphicsInfo_UnusedPikachuDoll,
&gEventObjectGraphicsInfo_UnusedPorygon2Doll,
&gEventObjectGraphicsInfo_CuttableTree,
&gEventObjectGraphicsInfo_MartEmployee,
&gEventObjectGraphicsInfo_RooftopSaleWoman,
&gEventObjectGraphicsInfo_Teala,
&gEventObjectGraphicsInfo_BreakableRock,
&gEventObjectGraphicsInfo_PushableBoulder,
&gEventObjectGraphicsInfo_MrBrineysBoat,
&gEventObjectGraphicsInfo_MayNormal,
&gEventObjectGraphicsInfo_MayMachBike,
&gEventObjectGraphicsInfo_MayAcroBike,
&gEventObjectGraphicsInfo_MaySurfing,
&gEventObjectGraphicsInfo_MayFieldMove,
&gEventObjectGraphicsInfo_Truck,
&gEventObjectGraphicsInfo_VigorothCarryingBox,
&gEventObjectGraphicsInfo_VigorothFacingAway,
&gEventObjectGraphicsInfo_BirchsBag,
&gEventObjectGraphicsInfo_EnemyZigzagoon,
&gEventObjectGraphicsInfo_Artist,
&gEventObjectGraphicsInfo_RivalBrendanNormal,
&gEventObjectGraphicsInfo_RivalBrendanMachBike,
&gEventObjectGraphicsInfo_RivalBrendanAcroBike,
&gEventObjectGraphicsInfo_RivalBrendanSurfing,
&gEventObjectGraphicsInfo_RivalBrendanFieldMove,
&gEventObjectGraphicsInfo_RivalMayNormal,
&gEventObjectGraphicsInfo_RivalMayMachBike,
&gEventObjectGraphicsInfo_RivalMayAcroBike,
&gEventObjectGraphicsInfo_RivalMaySurfing,
&gEventObjectGraphicsInfo_RivalMayFieldMove,
&gEventObjectGraphicsInfo_Cameraman,
&gEventObjectGraphicsInfo_BrendanUnderwater,
&gEventObjectGraphicsInfo_MayUnderwater,
&gEventObjectGraphicsInfo_MovingBox,
&gEventObjectGraphicsInfo_CableCar,
&gEventObjectGraphicsInfo_Scientist2,
&gEventObjectGraphicsInfo_DevonEmployee,
&gEventObjectGraphicsInfo_AquaMemberM,
&gEventObjectGraphicsInfo_AquaMemberF,
&gEventObjectGraphicsInfo_MagmaMemberM,
&gEventObjectGraphicsInfo_MagmaMemberF,
&gEventObjectGraphicsInfo_Sidney,
&gEventObjectGraphicsInfo_Phoebe,
&gEventObjectGraphicsInfo_Glacia,
&gEventObjectGraphicsInfo_Drake,
&gEventObjectGraphicsInfo_Roxanne,
&gEventObjectGraphicsInfo_Brawly,
&gEventObjectGraphicsInfo_Wattson,
&gEventObjectGraphicsInfo_Flannery,
&gEventObjectGraphicsInfo_Norman,
&gEventObjectGraphicsInfo_Winona,
&gEventObjectGraphicsInfo_Liza,
&gEventObjectGraphicsInfo_Tate,
&gEventObjectGraphicsInfo_Wallace,
&gEventObjectGraphicsInfo_Steven,
&gEventObjectGraphicsInfo_Wally,
&gEventObjectGraphicsInfo_RubySapphireLittleBoy,
&gEventObjectGraphicsInfo_BrendanFishing,
&gEventObjectGraphicsInfo_MayFishing,
&gEventObjectGraphicsInfo_HotSpringsOldWoman,
&gEventObjectGraphicsInfo_SSTidal,
&gEventObjectGraphicsInfo_SubmarineShadow,
&gEventObjectGraphicsInfo_PichuDoll,
&gEventObjectGraphicsInfo_PikachuDoll,
&gEventObjectGraphicsInfo_MarillDoll,
&gEventObjectGraphicsInfo_TogepiDoll,
&gEventObjectGraphicsInfo_CyndaquilDoll,
&gEventObjectGraphicsInfo_ChikoritaDoll,
&gEventObjectGraphicsInfo_TotodileDoll,
&gEventObjectGraphicsInfo_JigglypuffDoll,
&gEventObjectGraphicsInfo_MeowthDoll,
&gEventObjectGraphicsInfo_ClefairyDoll,
&gEventObjectGraphicsInfo_DittoDoll,
&gEventObjectGraphicsInfo_SmoochumDoll,
&gEventObjectGraphicsInfo_TreeckoDoll,
&gEventObjectGraphicsInfo_TorchicDoll,
&gEventObjectGraphicsInfo_MudkipDoll,
&gEventObjectGraphicsInfo_DuskullDoll,
&gEventObjectGraphicsInfo_WynautDoll,
&gEventObjectGraphicsInfo_BaltoyDoll,
&gEventObjectGraphicsInfo_KecleonDoll,
&gEventObjectGraphicsInfo_AzurillDoll,
&gEventObjectGraphicsInfo_SkittyDoll,
&gEventObjectGraphicsInfo_SwabluDoll,
&gEventObjectGraphicsInfo_GulpinDoll,
&gEventObjectGraphicsInfo_LotadDoll,
&gEventObjectGraphicsInfo_SeedotDoll,
&gEventObjectGraphicsInfo_PikaCushion,
&gEventObjectGraphicsInfo_RoundCushion,
&gEventObjectGraphicsInfo_KissCushion,
&gEventObjectGraphicsInfo_ZigzagCushion,
&gEventObjectGraphicsInfo_SpinCushion,
&gEventObjectGraphicsInfo_DiamondCushion,
&gEventObjectGraphicsInfo_BallCushion,
&gEventObjectGraphicsInfo_GrassCushion,
&gEventObjectGraphicsInfo_FireCushion,
&gEventObjectGraphicsInfo_WaterCushion,
&gEventObjectGraphicsInfo_BigSnorlaxDoll,
&gEventObjectGraphicsInfo_BigRhydonDoll,
&gEventObjectGraphicsInfo_BigLaprasDoll,
&gEventObjectGraphicsInfo_BigVenusaurDoll,
&gEventObjectGraphicsInfo_BigCharizardDoll,
&gEventObjectGraphicsInfo_BigBlastoiseDoll,
&gEventObjectGraphicsInfo_BigWailmerDoll,
&gEventObjectGraphicsInfo_BigRegirockDoll,
&gEventObjectGraphicsInfo_BigRegiceDoll,
&gEventObjectGraphicsInfo_BigRegisteelDoll,
&gEventObjectGraphicsInfo_Latias,
&gEventObjectGraphicsInfo_Latios,
&gEventObjectGraphicsInfo_GameboyKid,
&gEventObjectGraphicsInfo_ContestJudge,
&gEventObjectGraphicsInfo_BrendanWatering,
&gEventObjectGraphicsInfo_MayWatering,
&gEventObjectGraphicsInfo_BrendanDecorating,
&gEventObjectGraphicsInfo_MayDecorating,
&gEventObjectGraphicsInfo_Archie,
&gEventObjectGraphicsInfo_Maxie,
&gEventObjectGraphicsInfo_Kyogre1,
&gEventObjectGraphicsInfo_Groudon1,
&gEventObjectGraphicsInfo_Fossil,
&gEventObjectGraphicsInfo_Regirock,
&gEventObjectGraphicsInfo_Regice,
&gEventObjectGraphicsInfo_Registeel,
&gEventObjectGraphicsInfo_Skitty,
&gEventObjectGraphicsInfo_Kecleon1,
&gEventObjectGraphicsInfo_Kyogre2,
&gEventObjectGraphicsInfo_Groudon2,
&gEventObjectGraphicsInfo_Rayquaza2,
&gEventObjectGraphicsInfo_Zigzagoon,
&gEventObjectGraphicsInfo_Pikachu,
&gEventObjectGraphicsInfo_Azumarill,
&gEventObjectGraphicsInfo_Wingull,
&gEventObjectGraphicsInfo_Kecleon2,
&gEventObjectGraphicsInfo_TuberMSwimming,
&gEventObjectGraphicsInfo_Azurill,
&gEventObjectGraphicsInfo_Mom,
&gEventObjectGraphicsInfo_LinkBrendan,
&gEventObjectGraphicsInfo_LinkMay,
&gEventObjectGraphicsInfo_Juan,
&gEventObjectGraphicsInfo_Scott,
&gEventObjectGraphicsInfo_Poochyena,
&gEventObjectGraphicsInfo_Kyogre3,
&gEventObjectGraphicsInfo_Groudon3,
&gEventObjectGraphicsInfo_MysteryEventDeliveryman,
&gEventObjectGraphicsInfo_Statue,
&gEventObjectGraphicsInfo_Kirlia,
&gEventObjectGraphicsInfo_Dusclops,
&gEventObjectGraphicsInfo_UnionRoomAttendant,
&gEventObjectGraphicsInfo_Sudowoodo,
&gEventObjectGraphicsInfo_Mew,
&gEventObjectGraphicsInfo_Red,
&gEventObjectGraphicsInfo_Leaf,
&gEventObjectGraphicsInfo_Deoxys,
&gEventObjectGraphicsInfo_BirthIslandStone,
&gEventObjectGraphicsInfo_Brandon,
&gEventObjectGraphicsInfo_RubySapphireBrendan,
&gEventObjectGraphicsInfo_RubySapphireMay,
&gEventObjectGraphicsInfo_Lugia,
&gEventObjectGraphicsInfo_HoOh,
&gEventObjectGraphicsInfo_BrendanNormal,
&gEventObjectGraphicsInfo_BrendanMachBike,
&gEventObjectGraphicsInfo_BrendanSurfing,
&gEventObjectGraphicsInfo_BrendanFieldMove,
&gEventObjectGraphicsInfo_QuintyPlump,
&gEventObjectGraphicsInfo_NinjaBoy,
&gEventObjectGraphicsInfo_Twin,
&gEventObjectGraphicsInfo_Boy1,
&gEventObjectGraphicsInfo_Girl1,
&gEventObjectGraphicsInfo_Boy2,
&gEventObjectGraphicsInfo_Girl2,
&gEventObjectGraphicsInfo_LittleBoy,
&gEventObjectGraphicsInfo_LittleGirl,
&gEventObjectGraphicsInfo_Boy3,
&gEventObjectGraphicsInfo_Girl3,
&gEventObjectGraphicsInfo_RichBoy,
&gEventObjectGraphicsInfo_Woman1,
&gEventObjectGraphicsInfo_FatMan,
&gEventObjectGraphicsInfo_PokefanF,
&gEventObjectGraphicsInfo_Man1,
&gEventObjectGraphicsInfo_Woman2,
&gEventObjectGraphicsInfo_ExpertM,
&gEventObjectGraphicsInfo_ExpertF,
&gEventObjectGraphicsInfo_Man2,
&gEventObjectGraphicsInfo_Woman3,
&gEventObjectGraphicsInfo_PokefanM,
&gEventObjectGraphicsInfo_Woman4,
&gEventObjectGraphicsInfo_Cook,
&gEventObjectGraphicsInfo_LinkReceptionist,
&gEventObjectGraphicsInfo_OldMan,
&gEventObjectGraphicsInfo_OldWoman,
&gEventObjectGraphicsInfo_Camper,
&gEventObjectGraphicsInfo_Picnicker,
&gEventObjectGraphicsInfo_Man3,
&gEventObjectGraphicsInfo_Woman5,
&gEventObjectGraphicsInfo_Youngster,
&gEventObjectGraphicsInfo_BugCatcher,
&gEventObjectGraphicsInfo_PsychicM,
&gEventObjectGraphicsInfo_SchoolKidM,
&gEventObjectGraphicsInfo_Maniac,
&gEventObjectGraphicsInfo_HexManiac,
&gEventObjectGraphicsInfo_Rayquaza1,
&gEventObjectGraphicsInfo_SwimmerM,
&gEventObjectGraphicsInfo_SwimmerF,
&gEventObjectGraphicsInfo_BlackBelt,
&gEventObjectGraphicsInfo_Beauty,
&gEventObjectGraphicsInfo_Scientist1,
&gEventObjectGraphicsInfo_Lass,
&gEventObjectGraphicsInfo_Gentleman,
&gEventObjectGraphicsInfo_Sailor,
&gEventObjectGraphicsInfo_Fisherman,
&gEventObjectGraphicsInfo_RunningTriathleteM,
&gEventObjectGraphicsInfo_RunningTriathleteF,
&gEventObjectGraphicsInfo_TuberF,
&gEventObjectGraphicsInfo_TuberM,
&gEventObjectGraphicsInfo_Hiker,
&gEventObjectGraphicsInfo_CyclingTriathleteM,
&gEventObjectGraphicsInfo_CyclingTriathleteF,
&gEventObjectGraphicsInfo_Nurse,
&gEventObjectGraphicsInfo_ItemBall,
&gEventObjectGraphicsInfo_BerryTree,
&gEventObjectGraphicsInfo_BerryTreeEarlyStages,
&gEventObjectGraphicsInfo_BerryTreeLateStages,
&gEventObjectGraphicsInfo_BrendanAcroBike,
&gEventObjectGraphicsInfo_ProfBirch,
&gEventObjectGraphicsInfo_Man4,
&gEventObjectGraphicsInfo_Man5,
&gEventObjectGraphicsInfo_ReporterM,
&gEventObjectGraphicsInfo_ReporterF,
&gEventObjectGraphicsInfo_Bard,
&gEventObjectGraphicsInfo_Anabel,
&gEventObjectGraphicsInfo_Tucker,
&gEventObjectGraphicsInfo_Greta,
&gEventObjectGraphicsInfo_Spenser,
&gEventObjectGraphicsInfo_Noland,
&gEventObjectGraphicsInfo_Lucy,
&gEventObjectGraphicsInfo_UnusedNatuDoll,
&gEventObjectGraphicsInfo_UnusedMagnemiteDoll,
&gEventObjectGraphicsInfo_UnusedSquirtleDoll,
&gEventObjectGraphicsInfo_UnusedWooperDoll,
&gEventObjectGraphicsInfo_UnusedPikachuDoll,
&gEventObjectGraphicsInfo_UnusedPorygon2Doll,
&gEventObjectGraphicsInfo_CuttableTree,
&gEventObjectGraphicsInfo_MartEmployee,
&gEventObjectGraphicsInfo_RooftopSaleWoman,
&gEventObjectGraphicsInfo_Teala,
&gEventObjectGraphicsInfo_BreakableRock,
&gEventObjectGraphicsInfo_PushableBoulder,
&gEventObjectGraphicsInfo_MrBrineysBoat,
&gEventObjectGraphicsInfo_MayNormal,
&gEventObjectGraphicsInfo_MayMachBike,
&gEventObjectGraphicsInfo_MayAcroBike,
&gEventObjectGraphicsInfo_MaySurfing,
&gEventObjectGraphicsInfo_MayFieldMove,
&gEventObjectGraphicsInfo_Truck,
&gEventObjectGraphicsInfo_VigorothCarryingBox,
&gEventObjectGraphicsInfo_VigorothFacingAway,
&gEventObjectGraphicsInfo_BirchsBag,
&gEventObjectGraphicsInfo_EnemyZigzagoon,
&gEventObjectGraphicsInfo_Artist,
&gEventObjectGraphicsInfo_RivalBrendanNormal,
&gEventObjectGraphicsInfo_RivalBrendanMachBike,
&gEventObjectGraphicsInfo_RivalBrendanAcroBike,
&gEventObjectGraphicsInfo_RivalBrendanSurfing,
&gEventObjectGraphicsInfo_RivalBrendanFieldMove,
&gEventObjectGraphicsInfo_RivalMayNormal,
&gEventObjectGraphicsInfo_RivalMayMachBike,
&gEventObjectGraphicsInfo_RivalMayAcroBike,
&gEventObjectGraphicsInfo_RivalMaySurfing,
&gEventObjectGraphicsInfo_RivalMayFieldMove,
&gEventObjectGraphicsInfo_Cameraman,
&gEventObjectGraphicsInfo_BrendanUnderwater,
&gEventObjectGraphicsInfo_MayUnderwater,
&gEventObjectGraphicsInfo_MovingBox,
&gEventObjectGraphicsInfo_CableCar,
&gEventObjectGraphicsInfo_Scientist2,
&gEventObjectGraphicsInfo_DevonEmployee,
&gEventObjectGraphicsInfo_AquaMemberM,
&gEventObjectGraphicsInfo_AquaMemberF,
&gEventObjectGraphicsInfo_MagmaMemberM,
&gEventObjectGraphicsInfo_MagmaMemberF,
&gEventObjectGraphicsInfo_Sidney,
&gEventObjectGraphicsInfo_Phoebe,
&gEventObjectGraphicsInfo_Glacia,
&gEventObjectGraphicsInfo_Drake,
&gEventObjectGraphicsInfo_Roxanne,
&gEventObjectGraphicsInfo_Brawly,
&gEventObjectGraphicsInfo_Wattson,
&gEventObjectGraphicsInfo_Flannery,
&gEventObjectGraphicsInfo_Norman,
&gEventObjectGraphicsInfo_Winona,
&gEventObjectGraphicsInfo_Liza,
&gEventObjectGraphicsInfo_Tate,
&gEventObjectGraphicsInfo_Wallace,
&gEventObjectGraphicsInfo_Steven,
&gEventObjectGraphicsInfo_Wally,
&gEventObjectGraphicsInfo_RubySapphireLittleBoy,
&gEventObjectGraphicsInfo_BrendanFishing,
&gEventObjectGraphicsInfo_MayFishing,
&gEventObjectGraphicsInfo_HotSpringsOldWoman,
&gEventObjectGraphicsInfo_SSTidal,
&gEventObjectGraphicsInfo_SubmarineShadow,
&gEventObjectGraphicsInfo_PichuDoll,
&gEventObjectGraphicsInfo_PikachuDoll,
&gEventObjectGraphicsInfo_MarillDoll,
&gEventObjectGraphicsInfo_TogepiDoll,
&gEventObjectGraphicsInfo_CyndaquilDoll,
&gEventObjectGraphicsInfo_ChikoritaDoll,
&gEventObjectGraphicsInfo_TotodileDoll,
&gEventObjectGraphicsInfo_JigglypuffDoll,
&gEventObjectGraphicsInfo_MeowthDoll,
&gEventObjectGraphicsInfo_ClefairyDoll,
&gEventObjectGraphicsInfo_DittoDoll,
&gEventObjectGraphicsInfo_SmoochumDoll,
&gEventObjectGraphicsInfo_TreeckoDoll,
&gEventObjectGraphicsInfo_TorchicDoll,
&gEventObjectGraphicsInfo_MudkipDoll,
&gEventObjectGraphicsInfo_DuskullDoll,
&gEventObjectGraphicsInfo_WynautDoll,
&gEventObjectGraphicsInfo_BaltoyDoll,
&gEventObjectGraphicsInfo_KecleonDoll,
&gEventObjectGraphicsInfo_AzurillDoll,
&gEventObjectGraphicsInfo_SkittyDoll,
&gEventObjectGraphicsInfo_SwabluDoll,
&gEventObjectGraphicsInfo_GulpinDoll,
&gEventObjectGraphicsInfo_LotadDoll,
&gEventObjectGraphicsInfo_SeedotDoll,
&gEventObjectGraphicsInfo_PikaCushion,
&gEventObjectGraphicsInfo_RoundCushion,
&gEventObjectGraphicsInfo_KissCushion,
&gEventObjectGraphicsInfo_ZigzagCushion,
&gEventObjectGraphicsInfo_SpinCushion,
&gEventObjectGraphicsInfo_DiamondCushion,
&gEventObjectGraphicsInfo_BallCushion,
&gEventObjectGraphicsInfo_GrassCushion,
&gEventObjectGraphicsInfo_FireCushion,
&gEventObjectGraphicsInfo_WaterCushion,
&gEventObjectGraphicsInfo_BigSnorlaxDoll,
&gEventObjectGraphicsInfo_BigRhydonDoll,
&gEventObjectGraphicsInfo_BigLaprasDoll,
&gEventObjectGraphicsInfo_BigVenusaurDoll,
&gEventObjectGraphicsInfo_BigCharizardDoll,
&gEventObjectGraphicsInfo_BigBlastoiseDoll,
&gEventObjectGraphicsInfo_BigWailmerDoll,
&gEventObjectGraphicsInfo_BigRegirockDoll,
&gEventObjectGraphicsInfo_BigRegiceDoll,
&gEventObjectGraphicsInfo_BigRegisteelDoll,
&gEventObjectGraphicsInfo_Latias,
&gEventObjectGraphicsInfo_Latios,
&gEventObjectGraphicsInfo_GameboyKid,
&gEventObjectGraphicsInfo_ContestJudge,
&gEventObjectGraphicsInfo_BrendanWatering,
&gEventObjectGraphicsInfo_MayWatering,
&gEventObjectGraphicsInfo_BrendanDecorating,
&gEventObjectGraphicsInfo_MayDecorating,
&gEventObjectGraphicsInfo_Archie,
&gEventObjectGraphicsInfo_Maxie,
&gEventObjectGraphicsInfo_Kyogre1,
&gEventObjectGraphicsInfo_Groudon1,
&gEventObjectGraphicsInfo_Fossil,
&gEventObjectGraphicsInfo_Regirock,
&gEventObjectGraphicsInfo_Regice,
&gEventObjectGraphicsInfo_Registeel,
&gEventObjectGraphicsInfo_Skitty,
&gEventObjectGraphicsInfo_Kecleon1,
&gEventObjectGraphicsInfo_Kyogre2,
&gEventObjectGraphicsInfo_Groudon2,
&gEventObjectGraphicsInfo_Rayquaza2,
&gEventObjectGraphicsInfo_Zigzagoon,
&gEventObjectGraphicsInfo_Pikachu,
&gEventObjectGraphicsInfo_Azumarill,
&gEventObjectGraphicsInfo_Wingull,
&gEventObjectGraphicsInfo_Kecleon2,
&gEventObjectGraphicsInfo_TuberMSwimming,
&gEventObjectGraphicsInfo_Azurill,
&gEventObjectGraphicsInfo_Mom,
&gEventObjectGraphicsInfo_LinkBrendan,
&gEventObjectGraphicsInfo_LinkMay,
&gEventObjectGraphicsInfo_Juan,
&gEventObjectGraphicsInfo_Scott,
&gEventObjectGraphicsInfo_Poochyena,
&gEventObjectGraphicsInfo_Kyogre3,
&gEventObjectGraphicsInfo_Groudon3,
&gEventObjectGraphicsInfo_MysteryEventDeliveryman,
&gEventObjectGraphicsInfo_Statue,
&gEventObjectGraphicsInfo_Kirlia,
&gEventObjectGraphicsInfo_Dusclops,
&gEventObjectGraphicsInfo_UnionRoomAttendant,
&gEventObjectGraphicsInfo_Sudowoodo,
&gEventObjectGraphicsInfo_Mew,
&gEventObjectGraphicsInfo_Red,
&gEventObjectGraphicsInfo_Leaf,
&gEventObjectGraphicsInfo_Deoxys,
&gEventObjectGraphicsInfo_BirthIslandStone,
&gEventObjectGraphicsInfo_Brandon,
&gEventObjectGraphicsInfo_RubySapphireBrendan,
&gEventObjectGraphicsInfo_RubySapphireMay,
&gEventObjectGraphicsInfo_Lugia,
&gEventObjectGraphicsInfo_HoOh,
};
const struct EventObjectGraphicsInfo *const gMauvilleOldManGraphicsInfoPointers[] = {
&gEventObjectGraphicsInfo_Bard,
&gEventObjectGraphicsInfo_Hipster,
&gEventObjectGraphicsInfo_Trader,
&gEventObjectGraphicsInfo_Storyteller,
&gEventObjectGraphicsInfo_Giddy,
&gEventObjectGraphicsInfo_UnusedMauvilleOldMan1,
&gEventObjectGraphicsInfo_UnusedMauvilleOldMan2,
&gEventObjectGraphicsInfo_Bard,
&gEventObjectGraphicsInfo_Hipster,
&gEventObjectGraphicsInfo_Trader,
&gEventObjectGraphicsInfo_Storyteller,
&gEventObjectGraphicsInfo_Giddy,
&gEventObjectGraphicsInfo_UnusedMauvilleOldMan1,
&gEventObjectGraphicsInfo_UnusedMauvilleOldMan2,
};

File diff suppressed because it is too large Load Diff

View File

@ -134,7 +134,7 @@ const u32 gItemIconPalette_GreenShard[] = INCBIN_U32("graphics/items/icon_palett
const u32 gItemIcon_HPUp[] = INCBIN_U32("graphics/items/icons/hp_up.4bpp.lz");
const u32 gItemIconPalette_HPUp[] = INCBIN_U32("graphics/items/icon_palettes/hp_up.gbapal.lz");
const u32 gItemIcon_Vitamin[] = INCBIN_U32("graphics/items/icons/vitamin.4bpp.lz");
const u32 gItemIcon_Vitamin[] = INCBIN_U32("graphics/items/icons/vitamin.4bpp.lz");
const u32 gItemIconPalette_Protein[] = INCBIN_U32("graphics/items/icon_palettes/protein.gbapal.lz");
const u32 gItemIconPalette_Iron[] = INCBIN_U32("graphics/items/icon_palettes/iron.gbapal.lz");
const u32 gItemIconPalette_Carbos[] = INCBIN_U32("graphics/items/icon_palettes/carbos.gbapal.lz");

File diff suppressed because it is too large Load Diff

View File

@ -1,417 +1,419 @@
#include "constants/species.h"
// This determines how much higher above the usual position the enemy Pokémon
// is during battle. Species that float or fly have nonzero values.
const u8 gEnemyMonElevation[] =
{
0, // 0
0, // SPECIES_BULBASAUR
0, // SPECIES_IVYSAUR
0, // SPECIES_VENUSAUR
0, // SPECIES_CHARMANDER
0, // SPECIES_CHARMELEON
0, // SPECIES_CHARIZARD
0, // SPECIES_SQUIRTLE
0, // SPECIES_WARTORTLE
0, // SPECIES_BLASTOISE
0, // SPECIES_CATERPIE
0, // SPECIES_METAPOD
8, // SPECIES_BUTTERFREE
0, // SPECIES_WEEDLE
0, // SPECIES_KAKUNA
8, // SPECIES_BEEDRILL
16, // SPECIES_PIDGEY
0, // SPECIES_PIDGEOTTO
4, // SPECIES_PIDGEOT
0, // SPECIES_RATTATA
0, // SPECIES_RATICATE
0, // SPECIES_SPEAROW
6, // SPECIES_FEAROW
0, // SPECIES_EKANS
0, // SPECIES_ARBOK
0, // SPECIES_PIKACHU
0, // SPECIES_RAICHU
0, // SPECIES_SANDSHREW
0, // SPECIES_SANDSLASH
0, // SPECIES_NIDORAN_F
0, // SPECIES_NIDORINA
0, // SPECIES_NIDOQUEEN
0, // SPECIES_NIDORAN_M
0, // SPECIES_NIDORINO
0, // SPECIES_NIDOKING
0, // SPECIES_CLEFAIRY
0, // SPECIES_CLEFABLE
0, // SPECIES_VULPIX
0, // SPECIES_NINETALES
0, // SPECIES_JIGGLYPUFF
0, // SPECIES_WIGGLYTUFF
8, // SPECIES_ZUBAT
8, // SPECIES_GOLBAT
0, // SPECIES_ODDISH
0, // SPECIES_GLOOM
0, // SPECIES_VILEPLUME
0, // SPECIES_PARAS
0, // SPECIES_PARASECT
0, // SPECIES_VENONAT
8, // SPECIES_VENOMOTH
0, // SPECIES_DIGLETT
0, // SPECIES_DUGTRIO
0, // SPECIES_MEOWTH
0, // SPECIES_PERSIAN
0, // SPECIES_PSYDUCK
0, // SPECIES_GOLDUCK
0, // SPECIES_MANKEY
0, // SPECIES_PRIMEAPE
0, // SPECIES_GROWLITHE
0, // SPECIES_ARCANINE
0, // SPECIES_POLIWAG
0, // SPECIES_POLIWHIRL
0, // SPECIES_POLIWRATH
0, // SPECIES_ABRA
0, // SPECIES_KADABRA
0, // SPECIES_ALAKAZAM
0, // SPECIES_MACHOP
0, // SPECIES_MACHOKE
0, // SPECIES_MACHAMP
0, // SPECIES_BELLSPROUT
0, // SPECIES_WEEPINBELL
0, // SPECIES_VICTREEBEL
0, // SPECIES_TENTACOOL
0, // SPECIES_TENTACRUEL
16, // SPECIES_GEODUDE
0, // SPECIES_GRAVELER
0, // SPECIES_GOLEM
0, // SPECIES_PONYTA
0, // SPECIES_RAPIDASH
0, // SPECIES_SLOWPOKE
0, // SPECIES_SLOWBRO
16, // SPECIES_MAGNEMITE
8, // SPECIES_MAGNETON
0, // SPECIES_FARFETCHD
0, // SPECIES_DODUO
0, // SPECIES_DODRIO
0, // SPECIES_SEEL
0, // SPECIES_DEWGONG
0, // SPECIES_GRIMER
0, // SPECIES_MUK
0, // SPECIES_SHELLDER
0, // SPECIES_CLOYSTER
4, // SPECIES_GASTLY
4, // SPECIES_HAUNTER
0, // SPECIES_GENGAR
0, // SPECIES_ONIX
0, // SPECIES_DROWZEE
0, // SPECIES_HYPNO
0, // SPECIES_KRABBY
0, // SPECIES_KINGLER
10, // SPECIES_VOLTORB
12, // SPECIES_ELECTRODE
0, // SPECIES_EXEGGCUTE
0, // SPECIES_EXEGGUTOR
0, // SPECIES_CUBONE
0, // SPECIES_MAROWAK
0, // SPECIES_HITMONLEE
0, // SPECIES_HITMONCHAN
0, // SPECIES_LICKITUNG
8, // SPECIES_KOFFING
6, // SPECIES_WEEZING
0, // SPECIES_RHYHORN
0, // SPECIES_RHYDON
0, // SPECIES_CHANSEY
0, // SPECIES_TANGELA
0, // SPECIES_KANGASKHAN
0, // SPECIES_HORSEA
0, // SPECIES_SEADRA
0, // SPECIES_GOLDEEN
0, // SPECIES_SEAKING
0, // SPECIES_STARYU
0, // SPECIES_STARMIE
0, // SPECIES_MR_MIME
0, // SPECIES_SCYTHER
0, // SPECIES_JYNX
0, // SPECIES_ELECTABUZZ
0, // SPECIES_MAGMAR
0, // SPECIES_PINSIR
0, // SPECIES_TAUROS
0, // SPECIES_MAGIKARP
0, // SPECIES_GYARADOS
0, // SPECIES_LAPRAS
0, // SPECIES_DITTO
0, // SPECIES_EEVEE
0, // SPECIES_VAPOREON
0, // SPECIES_JOLTEON
0, // SPECIES_FLAREON
0, // SPECIES_PORYGON
0, // SPECIES_OMANYTE
0, // SPECIES_OMASTAR
0, // SPECIES_KABUTO
0, // SPECIES_KABUTOPS
7, // SPECIES_AERODACTYL
0, // SPECIES_SNORLAX
6, // SPECIES_ARTICUNO
8, // SPECIES_ZAPDOS
5, // SPECIES_MOLTRES
0, // SPECIES_DRATINI
0, // SPECIES_DRAGONAIR
6, // SPECIES_DRAGONITE
0, // SPECIES_MEWTWO
8, // SPECIES_MEW
0, // SPECIES_CHIKORITA
0, // SPECIES_BAYLEEF
0, // SPECIES_MEGANIUM
0, // SPECIES_CYNDAQUIL
0, // SPECIES_QUILAVA
0, // SPECIES_TYPHLOSION
0, // SPECIES_TOTODILE
0, // SPECIES_CROCONAW
0, // SPECIES_FERALIGATR
0, // SPECIES_SENTRET
0, // SPECIES_FURRET
0, // SPECIES_HOOTHOOT
0, // SPECIES_NOCTOWL
0, // SPECIES_LEDYBA
8, // SPECIES_LEDIAN
0, // SPECIES_SPINARAK
0, // SPECIES_ARIADOS
6, // SPECIES_CROBAT
0, // SPECIES_CHINCHOU
0, // SPECIES_LANTURN
0, // SPECIES_PICHU
0, // SPECIES_CLEFFA
0, // SPECIES_IGGLYBUFF
0, // SPECIES_TOGEPI
0, // SPECIES_TOGETIC
0, // SPECIES_NATU
0, // SPECIES_XATU
0, // SPECIES_MAREEP
0, // SPECIES_FLAAFFY
0, // SPECIES_AMPHAROS
0, // SPECIES_BELLOSSOM
0, // SPECIES_MARILL
0, // SPECIES_AZUMARILL
0, // SPECIES_SUDOWOODO
0, // SPECIES_POLITOED
11, // SPECIES_HOPPIP
12, // SPECIES_SKIPLOOM
9, // SPECIES_JUMPLUFF
0, // SPECIES_AIPOM
0, // SPECIES_SUNKERN
0, // SPECIES_SUNFLORA
8, // SPECIES_YANMA
0, // SPECIES_WOOPER
0, // SPECIES_QUAGSIRE
0, // SPECIES_ESPEON
0, // SPECIES_UMBREON
0, // SPECIES_MURKROW
0, // SPECIES_SLOWKING
8, // SPECIES_MISDREAVUS
8, // SPECIES_UNOWN
0, // SPECIES_WOBBUFFET
0, // SPECIES_GIRAFARIG
0, // SPECIES_PINECO
0, // SPECIES_FORRETRESS
0, // SPECIES_DUNSPARCE
6, // SPECIES_GLIGAR
0, // SPECIES_STEELIX
0, // SPECIES_SNUBBULL
0, // SPECIES_GRANBULL
0, // SPECIES_QWILFISH
0, // SPECIES_SCIZOR
0, // SPECIES_SHUCKLE
0, // SPECIES_HERACROSS
0, // SPECIES_SNEASEL
0, // SPECIES_TEDDIURSA
0, // SPECIES_URSARING
0, // SPECIES_SLUGMA
0, // SPECIES_MAGCARGO
0, // SPECIES_SWINUB
0, // SPECIES_PILOSWINE
0, // SPECIES_CORSOLA
0, // SPECIES_REMORAID
0, // SPECIES_OCTILLERY
0, // SPECIES_DELIBIRD
0, // SPECIES_MANTINE
0, // SPECIES_SKARMORY
0, // SPECIES_HOUNDOUR
0, // SPECIES_HOUNDOOM
0, // SPECIES_KINGDRA
0, // SPECIES_PHANPY
0, // SPECIES_DONPHAN
0, // SPECIES_PORYGON2
0, // SPECIES_STANTLER
0, // SPECIES_SMEARGLE
0, // SPECIES_TYROGUE
0, // SPECIES_HITMONTOP
0, // SPECIES_SMOOCHUM
0, // SPECIES_ELEKID
0, // SPECIES_MAGBY
0, // SPECIES_MILTANK
0, // SPECIES_BLISSEY
0, // SPECIES_RAIKOU
0, // SPECIES_ENTEI
0, // SPECIES_SUICUNE
0, // SPECIES_LARVITAR
0, // SPECIES_PUPITAR
0, // SPECIES_TYRANITAR
6, // SPECIES_LUGIA
6, // SPECIES_HO_OH
15, // SPECIES_CELEBI
0, // 252
0, // 253
0, // 254
0, // 255
0, // 256
0, // 257
0, // 258
0, // 259
0, // 260
0, // 261
0, // 262
0, // 263
0, // 264
0, // 265
0, // 266
0, // 267
0, // 268
0, // 269
0, // 270
0, // 271
0, // 272
0, // 273
0, // 274
0, // 275
0, // 276
0, // SPECIES_TREECKO
0, // SPECIES_GROVYLE
0, // SPECIES_SCEPTILE
0, // SPECIES_TORCHIC
0, // SPECIES_COMBUSKEN
0, // SPECIES_BLAZIKEN
0, // SPECIES_MUDKIP
0, // SPECIES_MARSHTOMP
0, // SPECIES_SWAMPERT
0, // SPECIES_POOCHYENA
0, // SPECIES_MIGHTYENA
0, // SPECIES_ZIGZAGOON
0, // SPECIES_LINOONE
0, // SPECIES_WURMPLE
0, // SPECIES_SILCOON
8, // SPECIES_BEAUTIFLY
0, // SPECIES_CASCOON
10, // SPECIES_DUSTOX
0, // SPECIES_LOTAD
0, // SPECIES_LOMBRE
0, // SPECIES_LUDICOLO
0, // SPECIES_SEEDOT
0, // SPECIES_NUZLEAF
0, // SPECIES_SHIFTRY
0, // SPECIES_NINCADA
10, // SPECIES_NINJASK
8, // SPECIES_SHEDINJA
0, // SPECIES_TAILLOW
0, // SPECIES_SWELLOW
0, // SPECIES_SHROOMISH
0, // SPECIES_BRELOOM
0, // SPECIES_SPINDA
16, // SPECIES_WINGULL
8, // SPECIES_PELIPPER
0, // SPECIES_SURSKIT
10, // SPECIES_MASQUERAIN
0, // SPECIES_WAILMER
0, // SPECIES_WAILORD
0, // SPECIES_SKITTY
0, // SPECIES_DELCATTY
0, // SPECIES_KECLEON
4, // SPECIES_BALTOY
10, // SPECIES_CLAYDOL
0, // SPECIES_NOSEPASS
0, // SPECIES_TORKOAL
0, // SPECIES_SABLEYE
0, // SPECIES_BARBOACH
0, // SPECIES_WHISCASH
0, // SPECIES_LUVDISC
0, // SPECIES_CORPHISH
0, // SPECIES_CRAWDAUNT
0, // SPECIES_FEEBAS
0, // SPECIES_MILOTIC
0, // SPECIES_CARVANHA
0, // SPECIES_SHARPEDO
0, // SPECIES_TRAPINCH
0, // SPECIES_VIBRAVA
7, // SPECIES_FLYGON
0, // SPECIES_MAKUHITA
0, // SPECIES_HARIYAMA
0, // SPECIES_ELECTRIKE
0, // SPECIES_MANECTRIC
0, // SPECIES_NUMEL
0, // SPECIES_CAMERUPT
0, // SPECIES_SPHEAL
0, // SPECIES_SEALEO
0, // SPECIES_WALREIN
0, // SPECIES_CACNEA
0, // SPECIES_CACTURNE
0, // SPECIES_SNORUNT
12, // SPECIES_GLALIE
13, // SPECIES_LUNATONE
4, // SPECIES_SOLROCK
0, // SPECIES_AZURILL
0, // SPECIES_SPOINK
0, // SPECIES_GRUMPIG
0, // SPECIES_PLUSLE
0, // SPECIES_MINUN
0, // SPECIES_MAWILE
0, // SPECIES_MEDITITE
0, // SPECIES_MEDICHAM
12, // SPECIES_SWABLU
8, // SPECIES_ALTARIA
0, // SPECIES_WYNAUT
9, // SPECIES_DUSKULL
0, // SPECIES_DUSCLOPS
0, // SPECIES_ROSELIA
0, // SPECIES_SLAKOTH
0, // SPECIES_VIGOROTH
0, // SPECIES_SLAKING
0, // SPECIES_GULPIN
0, // SPECIES_SWALOT
0, // SPECIES_TROPIUS
0, // SPECIES_WHISMUR
0, // SPECIES_LOUDRED
0, // SPECIES_EXPLOUD
0, // SPECIES_CLAMPERL
0, // SPECIES_HUNTAIL
0, // SPECIES_GOREBYSS
0, // SPECIES_ABSOL
12, // SPECIES_SHUPPET
8, // SPECIES_BANETTE
0, // SPECIES_SEVIPER
0, // SPECIES_ZANGOOSE
0, // SPECIES_RELICANTH
0, // SPECIES_ARON
0, // SPECIES_LAIRON
0, // SPECIES_AGGRON
16, // SPECIES_CASTFORM
0, // SPECIES_VOLBEAT
0, // SPECIES_ILLUMISE
0, // SPECIES_LILEEP
0, // SPECIES_CRADILY
0, // SPECIES_ANORITH
0, // SPECIES_ARMALDO
0, // SPECIES_RALTS
0, // SPECIES_KIRLIA
0, // SPECIES_GARDEVOIR
0, // SPECIES_BAGON
0, // SPECIES_SHELGON
0, // SPECIES_SALAMENCE
8, // SPECIES_BELDUM
0, // SPECIES_METANG
0, // SPECIES_METAGROSS
0, // SPECIES_REGIROCK
0, // SPECIES_REGICE
0, // SPECIES_REGISTEEL
0, // SPECIES_KYOGRE
0, // SPECIES_GROUDON
6, // SPECIES_RAYQUAZA
6, // SPECIES_LATIAS
6, // SPECIES_LATIOS
12, // SPECIES_JIRACHI
8, // SPECIES_DEOXYS
12, // SPECIES_CHIMECHO
[SPECIES_NONE] = 0,
[SPECIES_BULBASAUR] = 0,
[SPECIES_IVYSAUR] = 0,
[SPECIES_VENUSAUR] = 0,
[SPECIES_CHARMANDER] = 0,
[SPECIES_CHARMELEON] = 0,
[SPECIES_CHARIZARD] = 0,
[SPECIES_SQUIRTLE] = 0,
[SPECIES_WARTORTLE] = 0,
[SPECIES_BLASTOISE] = 0,
[SPECIES_CATERPIE] = 0,
[SPECIES_METAPOD] = 0,
[SPECIES_BUTTERFREE] = 8,
[SPECIES_WEEDLE] = 0,
[SPECIES_KAKUNA] = 0,
[SPECIES_BEEDRILL] = 8,
[SPECIES_PIDGEY] = 16,
[SPECIES_PIDGEOTTO] = 0,
[SPECIES_PIDGEOT] = 4,
[SPECIES_RATTATA] = 0,
[SPECIES_RATICATE] = 0,
[SPECIES_SPEAROW] = 0,
[SPECIES_FEAROW] = 6,
[SPECIES_EKANS] = 0,
[SPECIES_ARBOK] = 0,
[SPECIES_PIKACHU] = 0,
[SPECIES_RAICHU] = 0,
[SPECIES_SANDSHREW] = 0,
[SPECIES_SANDSLASH] = 0,
[SPECIES_NIDORAN_F] = 0,
[SPECIES_NIDORINA] = 0,
[SPECIES_NIDOQUEEN] = 0,
[SPECIES_NIDORAN_M] = 0,
[SPECIES_NIDORINO] = 0,
[SPECIES_NIDOKING] = 0,
[SPECIES_CLEFAIRY] = 0,
[SPECIES_CLEFABLE] = 0,
[SPECIES_VULPIX] = 0,
[SPECIES_NINETALES] = 0,
[SPECIES_JIGGLYPUFF] = 0,
[SPECIES_WIGGLYTUFF] = 0,
[SPECIES_ZUBAT] = 8,
[SPECIES_GOLBAT] = 8,
[SPECIES_ODDISH] = 0,
[SPECIES_GLOOM] = 0,
[SPECIES_VILEPLUME] = 0,
[SPECIES_PARAS] = 0,
[SPECIES_PARASECT] = 0,
[SPECIES_VENONAT] = 0,
[SPECIES_VENOMOTH] = 8,
[SPECIES_DIGLETT] = 0,
[SPECIES_DUGTRIO] = 0,
[SPECIES_MEOWTH] = 0,
[SPECIES_PERSIAN] = 0,
[SPECIES_PSYDUCK] = 0,
[SPECIES_GOLDUCK] = 0,
[SPECIES_MANKEY] = 0,
[SPECIES_PRIMEAPE] = 0,
[SPECIES_GROWLITHE] = 0,
[SPECIES_ARCANINE] = 0,
[SPECIES_POLIWAG] = 0,
[SPECIES_POLIWHIRL] = 0,
[SPECIES_POLIWRATH] = 0,
[SPECIES_ABRA] = 0,
[SPECIES_KADABRA] = 0,
[SPECIES_ALAKAZAM] = 0,
[SPECIES_MACHOP] = 0,
[SPECIES_MACHOKE] = 0,
[SPECIES_MACHAMP] = 0,
[SPECIES_BELLSPROUT] = 0,
[SPECIES_WEEPINBELL] = 0,
[SPECIES_VICTREEBEL] = 0,
[SPECIES_TENTACOOL] = 0,
[SPECIES_TENTACRUEL] = 0,
[SPECIES_GEODUDE] = 16,
[SPECIES_GRAVELER] = 0,
[SPECIES_GOLEM] = 0,
[SPECIES_PONYTA] = 0,
[SPECIES_RAPIDASH] = 0,
[SPECIES_SLOWPOKE] = 0,
[SPECIES_SLOWBRO] = 0,
[SPECIES_MAGNEMITE] = 16,
[SPECIES_MAGNETON] = 8,
[SPECIES_FARFETCHD] = 0,
[SPECIES_DODUO] = 0,
[SPECIES_DODRIO] = 0,
[SPECIES_SEEL] = 0,
[SPECIES_DEWGONG] = 0,
[SPECIES_GRIMER] = 0,
[SPECIES_MUK] = 0,
[SPECIES_SHELLDER] = 0,
[SPECIES_CLOYSTER] = 0,
[SPECIES_GASTLY] = 4,
[SPECIES_HAUNTER] = 4,
[SPECIES_GENGAR] = 0,
[SPECIES_ONIX] = 0,
[SPECIES_DROWZEE] = 0,
[SPECIES_HYPNO] = 0,
[SPECIES_KRABBY] = 0,
[SPECIES_KINGLER] = 0,
[SPECIES_VOLTORB] = 10,
[SPECIES_ELECTRODE] = 12,
[SPECIES_EXEGGCUTE] = 0,
[SPECIES_EXEGGUTOR] = 0,
[SPECIES_CUBONE] = 0,
[SPECIES_MAROWAK] = 0,
[SPECIES_HITMONLEE] = 0,
[SPECIES_HITMONCHAN] = 0,
[SPECIES_LICKITUNG] = 0,
[SPECIES_KOFFING] = 8,
[SPECIES_WEEZING] = 6,
[SPECIES_RHYHORN] = 0,
[SPECIES_RHYDON] = 0,
[SPECIES_CHANSEY] = 0,
[SPECIES_TANGELA] = 0,
[SPECIES_KANGASKHAN] = 0,
[SPECIES_HORSEA] = 0,
[SPECIES_SEADRA] = 0,
[SPECIES_GOLDEEN] = 0,
[SPECIES_SEAKING] = 0,
[SPECIES_STARYU] = 0,
[SPECIES_STARMIE] = 0,
[SPECIES_MR_MIME] = 0,
[SPECIES_SCYTHER] = 0,
[SPECIES_JYNX] = 0,
[SPECIES_ELECTABUZZ] = 0,
[SPECIES_MAGMAR] = 0,
[SPECIES_PINSIR] = 0,
[SPECIES_TAUROS] = 0,
[SPECIES_MAGIKARP] = 0,
[SPECIES_GYARADOS] = 0,
[SPECIES_LAPRAS] = 0,
[SPECIES_DITTO] = 0,
[SPECIES_EEVEE] = 0,
[SPECIES_VAPOREON] = 0,
[SPECIES_JOLTEON] = 0,
[SPECIES_FLAREON] = 0,
[SPECIES_PORYGON] = 0,
[SPECIES_OMANYTE] = 0,
[SPECIES_OMASTAR] = 0,
[SPECIES_KABUTO] = 0,
[SPECIES_KABUTOPS] = 0,
[SPECIES_AERODACTYL] = 7,
[SPECIES_SNORLAX] = 0,
[SPECIES_ARTICUNO] = 6,
[SPECIES_ZAPDOS] = 8,
[SPECIES_MOLTRES] = 5,
[SPECIES_DRATINI] = 0,
[SPECIES_DRAGONAIR] = 0,
[SPECIES_DRAGONITE] = 6,
[SPECIES_MEWTWO] = 0,
[SPECIES_MEW] = 8,
[SPECIES_CHIKORITA] = 0,
[SPECIES_BAYLEEF] = 0,
[SPECIES_MEGANIUM] = 0,
[SPECIES_CYNDAQUIL] = 0,
[SPECIES_QUILAVA] = 0,
[SPECIES_TYPHLOSION] = 0,
[SPECIES_TOTODILE] = 0,
[SPECIES_CROCONAW] = 0,
[SPECIES_FERALIGATR] = 0,
[SPECIES_SENTRET] = 0,
[SPECIES_FURRET] = 0,
[SPECIES_HOOTHOOT] = 0,
[SPECIES_NOCTOWL] = 0,
[SPECIES_LEDYBA] = 0,
[SPECIES_LEDIAN] = 8,
[SPECIES_SPINARAK] = 0,
[SPECIES_ARIADOS] = 0,
[SPECIES_CROBAT] = 6,
[SPECIES_CHINCHOU] = 0,
[SPECIES_LANTURN] = 0,
[SPECIES_PICHU] = 0,
[SPECIES_CLEFFA] = 0,
[SPECIES_IGGLYBUFF] = 0,
[SPECIES_TOGEPI] = 0,
[SPECIES_TOGETIC] = 0,
[SPECIES_NATU] = 0,
[SPECIES_XATU] = 0,
[SPECIES_MAREEP] = 0,
[SPECIES_FLAAFFY] = 0,
[SPECIES_AMPHAROS] = 0,
[SPECIES_BELLOSSOM] = 0,
[SPECIES_MARILL] = 0,
[SPECIES_AZUMARILL] = 0,
[SPECIES_SUDOWOODO] = 0,
[SPECIES_POLITOED] = 0,
[SPECIES_HOPPIP] = 11,
[SPECIES_SKIPLOOM] = 12,
[SPECIES_JUMPLUFF] = 9,
[SPECIES_AIPOM] = 0,
[SPECIES_SUNKERN] = 0,
[SPECIES_SUNFLORA] = 0,
[SPECIES_YANMA] = 8,
[SPECIES_WOOPER] = 0,
[SPECIES_QUAGSIRE] = 0,
[SPECIES_ESPEON] = 0,
[SPECIES_UMBREON] = 0,
[SPECIES_MURKROW] = 0,
[SPECIES_SLOWKING] = 0,
[SPECIES_MISDREAVUS] = 8,
[SPECIES_UNOWN] = 8,
[SPECIES_WOBBUFFET] = 0,
[SPECIES_GIRAFARIG] = 0,
[SPECIES_PINECO] = 0,
[SPECIES_FORRETRESS] = 0,
[SPECIES_DUNSPARCE] = 0,
[SPECIES_GLIGAR] = 6,
[SPECIES_STEELIX] = 0,
[SPECIES_SNUBBULL] = 0,
[SPECIES_GRANBULL] = 0,
[SPECIES_QWILFISH] = 0,
[SPECIES_SCIZOR] = 0,
[SPECIES_SHUCKLE] = 0,
[SPECIES_HERACROSS] = 0,
[SPECIES_SNEASEL] = 0,
[SPECIES_TEDDIURSA] = 0,
[SPECIES_URSARING] = 0,
[SPECIES_SLUGMA] = 0,
[SPECIES_MAGCARGO] = 0,
[SPECIES_SWINUB] = 0,
[SPECIES_PILOSWINE] = 0,
[SPECIES_CORSOLA] = 0,
[SPECIES_REMORAID] = 0,
[SPECIES_OCTILLERY] = 0,
[SPECIES_DELIBIRD] = 0,
[SPECIES_MANTINE] = 0,
[SPECIES_SKARMORY] = 0,
[SPECIES_HOUNDOUR] = 0,
[SPECIES_HOUNDOOM] = 0,
[SPECIES_KINGDRA] = 0,
[SPECIES_PHANPY] = 0,
[SPECIES_DONPHAN] = 0,
[SPECIES_PORYGON2] = 0,
[SPECIES_STANTLER] = 0,
[SPECIES_SMEARGLE] = 0,
[SPECIES_TYROGUE] = 0,
[SPECIES_HITMONTOP] = 0,
[SPECIES_SMOOCHUM] = 0,
[SPECIES_ELEKID] = 0,
[SPECIES_MAGBY] = 0,
[SPECIES_MILTANK] = 0,
[SPECIES_BLISSEY] = 0,
[SPECIES_RAIKOU] = 0,
[SPECIES_ENTEI] = 0,
[SPECIES_SUICUNE] = 0,
[SPECIES_LARVITAR] = 0,
[SPECIES_PUPITAR] = 0,
[SPECIES_TYRANITAR] = 0,
[SPECIES_LUGIA] = 6,
[SPECIES_HO_OH] = 6,
[SPECIES_CELEBI] = 15,
[252] = 0,
[253] = 0,
[254] = 0,
[255] = 0,
[256] = 0,
[257] = 0,
[258] = 0,
[259] = 0,
[260] = 0,
[261] = 0,
[262] = 0,
[263] = 0,
[264] = 0,
[265] = 0,
[266] = 0,
[267] = 0,
[268] = 0,
[269] = 0,
[270] = 0,
[271] = 0,
[272] = 0,
[273] = 0,
[274] = 0,
[275] = 0,
[276] = 0,
[SPECIES_TREECKO] = 0,
[SPECIES_GROVYLE] = 0,
[SPECIES_SCEPTILE] = 0,
[SPECIES_TORCHIC] = 0,
[SPECIES_COMBUSKEN] = 0,
[SPECIES_BLAZIKEN] = 0,
[SPECIES_MUDKIP] = 0,
[SPECIES_MARSHTOMP] = 0,
[SPECIES_SWAMPERT] = 0,
[SPECIES_POOCHYENA] = 0,
[SPECIES_MIGHTYENA] = 0,
[SPECIES_ZIGZAGOON] = 0,
[SPECIES_LINOONE] = 0,
[SPECIES_WURMPLE] = 0,
[SPECIES_SILCOON] = 0,
[SPECIES_BEAUTIFLY] = 8,
[SPECIES_CASCOON] = 0,
[SPECIES_DUSTOX] = 10,
[SPECIES_LOTAD] = 0,
[SPECIES_LOMBRE] = 0,
[SPECIES_LUDICOLO] = 0,
[SPECIES_SEEDOT] = 0,
[SPECIES_NUZLEAF] = 0,
[SPECIES_SHIFTRY] = 0,
[SPECIES_NINCADA] = 0,
[SPECIES_NINJASK] = 10,
[SPECIES_SHEDINJA] = 8,
[SPECIES_TAILLOW] = 0,
[SPECIES_SWELLOW] = 0,
[SPECIES_SHROOMISH] = 0,
[SPECIES_BRELOOM] = 0,
[SPECIES_SPINDA] = 0,
[SPECIES_WINGULL] = 16,
[SPECIES_PELIPPER] = 8,
[SPECIES_SURSKIT] = 0,
[SPECIES_MASQUERAIN] = 10,
[SPECIES_WAILMER] = 0,
[SPECIES_WAILORD] = 0,
[SPECIES_SKITTY] = 0,
[SPECIES_DELCATTY] = 0,
[SPECIES_KECLEON] = 0,
[SPECIES_BALTOY] = 4,
[SPECIES_CLAYDOL] = 10,
[SPECIES_NOSEPASS] = 0,
[SPECIES_TORKOAL] = 0,
[SPECIES_SABLEYE] = 0,
[SPECIES_BARBOACH] = 0,
[SPECIES_WHISCASH] = 0,
[SPECIES_LUVDISC] = 0,
[SPECIES_CORPHISH] = 0,
[SPECIES_CRAWDAUNT] = 0,
[SPECIES_FEEBAS] = 0,
[SPECIES_MILOTIC] = 0,
[SPECIES_CARVANHA] = 0,
[SPECIES_SHARPEDO] = 0,
[SPECIES_TRAPINCH] = 0,
[SPECIES_VIBRAVA] = 0,
[SPECIES_FLYGON] = 7,
[SPECIES_MAKUHITA] = 0,
[SPECIES_HARIYAMA] = 0,
[SPECIES_ELECTRIKE] = 0,
[SPECIES_MANECTRIC] = 0,
[SPECIES_NUMEL] = 0,
[SPECIES_CAMERUPT] = 0,
[SPECIES_SPHEAL] = 0,
[SPECIES_SEALEO] = 0,
[SPECIES_WALREIN] = 0,
[SPECIES_CACNEA] = 0,
[SPECIES_CACTURNE] = 0,
[SPECIES_SNORUNT] = 0,
[SPECIES_GLALIE] = 12,
[SPECIES_LUNATONE] = 13,
[SPECIES_SOLROCK] = 4,
[SPECIES_AZURILL] = 0,
[SPECIES_SPOINK] = 0,
[SPECIES_GRUMPIG] = 0,
[SPECIES_PLUSLE] = 0,
[SPECIES_MINUN] = 0,
[SPECIES_MAWILE] = 0,
[SPECIES_MEDITITE] = 0,
[SPECIES_MEDICHAM] = 0,
[SPECIES_SWABLU] = 12,
[SPECIES_ALTARIA] = 8,
[SPECIES_WYNAUT] = 0,
[SPECIES_DUSKULL] = 9,
[SPECIES_DUSCLOPS] = 0,
[SPECIES_ROSELIA] = 0,
[SPECIES_SLAKOTH] = 0,
[SPECIES_VIGOROTH] = 0,
[SPECIES_SLAKING] = 0,
[SPECIES_GULPIN] = 0,
[SPECIES_SWALOT] = 0,
[SPECIES_TROPIUS] = 0,
[SPECIES_WHISMUR] = 0,
[SPECIES_LOUDRED] = 0,
[SPECIES_EXPLOUD] = 0,
[SPECIES_CLAMPERL] = 0,
[SPECIES_HUNTAIL] = 0,
[SPECIES_GOREBYSS] = 0,
[SPECIES_ABSOL] = 0,
[SPECIES_SHUPPET] = 12,
[SPECIES_BANETTE] = 8,
[SPECIES_SEVIPER] = 0,
[SPECIES_ZANGOOSE] = 0,
[SPECIES_RELICANTH] = 0,
[SPECIES_ARON] = 0,
[SPECIES_LAIRON] = 0,
[SPECIES_AGGRON] = 0,
[SPECIES_CASTFORM] = 16,
[SPECIES_VOLBEAT] = 0,
[SPECIES_ILLUMISE] = 0,
[SPECIES_LILEEP] = 0,
[SPECIES_CRADILY] = 0,
[SPECIES_ANORITH] = 0,
[SPECIES_ARMALDO] = 0,
[SPECIES_RALTS] = 0,
[SPECIES_KIRLIA] = 0,
[SPECIES_GARDEVOIR] = 0,
[SPECIES_BAGON] = 0,
[SPECIES_SHELGON] = 0,
[SPECIES_SALAMENCE] = 0,
[SPECIES_BELDUM] = 8,
[SPECIES_METANG] = 0,
[SPECIES_METAGROSS] = 0,
[SPECIES_REGIROCK] = 0,
[SPECIES_REGICE] = 0,
[SPECIES_REGISTEEL] = 0,
[SPECIES_KYOGRE] = 0,
[SPECIES_GROUDON] = 0,
[SPECIES_RAYQUAZA] = 6,
[SPECIES_LATIAS] = 6,
[SPECIES_LATIOS] = 6,
[SPECIES_JIRACHI] = 12,
[SPECIES_DEOXYS] = 8,
[SPECIES_CHIMECHO] = 12,
};

File diff suppressed because it is too large Load Diff

View File

@ -7,7 +7,7 @@ const u8 gPokeBallItemDescription[] = _("A tool used for\ncatching wild\nPOKéMO
const u8 gSafariBallItemDescription[] = _("A special BALL that\nis used only in the\nSAFARI ZONE.");
const u8 gNetBallItemDescription[] = _("A BALL that works\nwell on WATER- and\nBUG-type POKéMON.");
const u8 gDiveBallItemDescription[] = _("A BALL that works\nbetter on POKéMON\non the ocean floor.");
const u8 gNestBallItemDescription[] = _("A BALL that works\nbetter on weaker\nPOKéMON.");
const u8 gNestBallItemDescription[] = _("A BALL that works\nbetter on weaker\nPOKéMON.");
const u8 gRepeatBallItemDescription[] = _("A BALL that works\nbetter on POKéMON\ncaught before.");
const u8 gTimerBallItemDescription[] = _("A BALL that gains\npower in battles\ntaking many turns.");
const u8 gLuxuryBallItemDescription[] = _("A cozy BALL that\nmakes POKéMON\nmore friendly.");

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

View File

@ -251,7 +251,7 @@ static void ApplyDaycareExperience(struct Pokemon *mon)
while ((learnedMove = MonTryLearningNewMove(mon, firstMove)) != 0)
{
firstMove = FALSE;
if (learnedMove == INVALID_U16)
if (learnedMove == 0xFFFF)
{
// Mon already knows 4 moves.
DeleteFirstMoveAndGiveMoveToMon(mon, gMoveToLearn);
@ -535,7 +535,7 @@ static void RemoveIVIndexFromList(u8 *ivs, u8 selectedIv)
s32 i, j;
u8 temp[NUM_STATS];
ivs[selectedIv] = INVALID_U8;
ivs[selectedIv] = 0xFF;
for (i = 0; i < NUM_STATS; i++)
{
temp[i] = ivs[i];
@ -544,7 +544,7 @@ static void RemoveIVIndexFromList(u8 *ivs, u8 selectedIv)
j = 0;
for (i = 0; i < NUM_STATS; i++)
{
if (temp[i] != INVALID_U8)
if (temp[i] != 0xFF)
ivs[j++] = temp[i];
}
}
@ -684,7 +684,7 @@ static void BuildEggMoveset(struct Pokemon *egg, struct BoxPokemon *father, stru
{
if (sHatchedEggFatherMoves[i] == sHatchedEggEggMoves[j])
{
if (GiveMoveToMon(egg, sHatchedEggFatherMoves[i]) == INVALID_U16)
if (GiveMoveToMon(egg, sHatchedEggFatherMoves[i]) == 0xFFFF)
DeleteFirstMoveAndGiveMoveToMon(egg, sHatchedEggFatherMoves[i]);
break;
}
@ -703,7 +703,7 @@ static void BuildEggMoveset(struct Pokemon *egg, struct BoxPokemon *father, stru
{
if (sHatchedEggFatherMoves[i] == ItemIdToBattleMoveId(ITEM_TM01_FOCUS_PUNCH + j) && CanMonLearnTMHM(egg, j))
{
if (GiveMoveToMon(egg, sHatchedEggFatherMoves[i]) == INVALID_U16)
if (GiveMoveToMon(egg, sHatchedEggFatherMoves[i]) == 0xFFFF)
DeleteFirstMoveAndGiveMoveToMon(egg, sHatchedEggFatherMoves[i]);
}
}
@ -728,7 +728,7 @@ static void BuildEggMoveset(struct Pokemon *egg, struct BoxPokemon *father, stru
{
if (sHatchedEggLevelUpMoves[j] != MOVE_NONE && sHatchedEggFinalMoves[i] == sHatchedEggLevelUpMoves[j])
{
if (GiveMoveToMon(egg, sHatchedEggFinalMoves[i]) == INVALID_U16)
if (GiveMoveToMon(egg, sHatchedEggFinalMoves[i]) == 0xFFFF)
DeleteFirstMoveAndGiveMoveToMon(egg, sHatchedEggFinalMoves[i]);
break;
}
@ -773,7 +773,7 @@ static void GiveVoltTackleIfLightBall(struct Pokemon *mon, struct DayCare *dayca
if (motherItem == ITEM_LIGHT_BALL || fatherItem == ITEM_LIGHT_BALL)
{
if (GiveMoveToMon(mon, MOVE_VOLT_TACKLE) == INVALID_U16)
if (GiveMoveToMon(mon, MOVE_VOLT_TACKLE) == 0xFFFF)
DeleteFirstMoveAndGiveMoveToMon(mon, MOVE_VOLT_TACKLE);
}
}
@ -909,7 +909,7 @@ static bool8 _DoEggActions_CheckHatch(struct DayCare *daycare)
}
// try to trigger poke sex
if (daycare->offspringPersonality == 0 && validEggs == 2 && (daycare->mons[1].steps & 0xFF) == INVALID_U8)
if (daycare->offspringPersonality == 0 && validEggs == 2 && (daycare->mons[1].steps & 0xFF) == 0xFF)
{
u8 loveScore = GetDaycareCompatibilityScore(daycare);
if (loveScore > (Random() * 100u) / USHRT_MAX)

View File

@ -122,346 +122,346 @@ void sub_803471C()
{
asm(".syntax unified\n\
push {r4-r7,lr}\n\
mov r7, r10\n\
mov r6, r9\n\
mov r5, r8\n\
push {r5-r7}\n\
sub sp, 0x24\n\
mov r9, r0\n\
str r1, [sp]\n\
str r2, [sp, 0x4]\n\
adds r5, r3, 0\n\
movs r0, 0x1\n\
mov r1, r9\n\
ands r0, r1\n\
cmp r0, 0\n\
bne _0803473C\n\
b _080348D4\n\
mov r7, r10\n\
mov r6, r9\n\
mov r5, r8\n\
push {r5-r7}\n\
sub sp, 0x24\n\
mov r9, r0\n\
str r1, [sp]\n\
str r2, [sp, 0x4]\n\
adds r5, r3, 0\n\
movs r0, 0x1\n\
mov r1, r9\n\
ands r0, r1\n\
cmp r0, 0\n\
bne _0803473C\n\
b _080348D4\n\
_0803473C:\n\
asrs r0, r1, 1\n\
adds r0, 0x4\n\
lsls r0, 24\n\
lsrs r0, 24\n\
str r0, [sp, 0x8]\n\
movs r0, 0\n\
ldr r2, [sp]\n\
cmp r0, r2\n\
blt _08034750\n\
b _08034964\n\
asrs r0, r1, 1\n\
adds r0, 0x4\n\
lsls r0, 24\n\
lsrs r0, 24\n\
str r0, [sp, 0x8]\n\
movs r0, 0\n\
ldr r2, [sp]\n\
cmp r0, r2\n\
blt _08034750\n\
b _08034964\n\
_08034750:\n\
movs r4, 0x8\n\
subs r1, r4, r1\n\
str r1, [sp, 0x10]\n\
movs r4, 0x8\n\
subs r1, r4, r1\n\
str r1, [sp, 0x10]\n\
_08034756:\n\
movs r7, 0\n\
adds r0, 0x1\n\
str r0, [sp, 0x14]\n\
ldr r0, [sp, 0x10]\n\
cmp r7, r0\n\
bge _080347D2\n\
ldr r1, [sp, 0x8]\n\
lsls r1, 8\n\
str r1, [sp, 0x18]\n\
movs r2, 0\n\
mov r10, r2\n\
mov r0, r9\n\
movs r4, 0x8\n\
subs r0, r4, r0\n\
str r0, [sp, 0xC]\n\
movs r7, 0\n\
adds r0, 0x1\n\
str r0, [sp, 0x14]\n\
ldr r0, [sp, 0x10]\n\
cmp r7, r0\n\
bge _080347D2\n\
ldr r1, [sp, 0x8]\n\
lsls r1, 8\n\
str r1, [sp, 0x18]\n\
movs r2, 0\n\
mov r10, r2\n\
mov r0, r9\n\
movs r4, 0x8\n\
subs r0, r4, r0\n\
str r0, [sp, 0xC]\n\
_08034774:\n\
movs r3, 0\n\
asrs r0, r7, 1\n\
adds r1, r7, 0\n\
movs r2, 0x1\n\
ands r1, r2\n\
str r1, [sp, 0x20]\n\
lsls r0, 8\n\
mov r8, r0\n\
mov r12, r5\n\
movs r3, 0\n\
asrs r0, r7, 1\n\
adds r1, r7, 0\n\
movs r2, 0x1\n\
ands r1, r2\n\
str r1, [sp, 0x20]\n\
lsls r0, 8\n\
mov r8, r0\n\
mov r12, r5\n\
_08034786:\n\
lsls r1, r3, 5\n\
ldr r4, [sp, 0x18]\n\
adds r0, r5, r4\n\
adds r0, r1\n\
mov r1, r8\n\
adds r2, r0, r1\n\
mov r1, r12\n\
add r1, r8\n\
movs r6, 0xF\n\
lsls r1, r3, 5\n\
ldr r4, [sp, 0x18]\n\
adds r0, r5, r4\n\
adds r0, r1\n\
mov r1, r8\n\
adds r2, r0, r1\n\
mov r1, r12\n\
add r1, r8\n\
movs r6, 0xF\n\
_08034798:\n\
ldr r4, [sp, 0x20]\n\
cmp r4, 0\n\
bne _080347A8\n\
strb r4, [r1]\n\
add r4, sp, 0x20\n\
ldrb r4, [r4]\n\
strb r4, [r2, 0x10]\n\
b _080347B6\n\
ldr r4, [sp, 0x20]\n\
cmp r4, 0\n\
bne _080347A8\n\
strb r4, [r1]\n\
add r4, sp, 0x20\n\
ldrb r4, [r4]\n\
strb r4, [r2, 0x10]\n\
b _080347B6\n\
_080347A8:\n\
mov r0, r10\n\
strb r0, [r1, 0x10]\n\
movs r4, 0x80\n\
lsls r4, 1\n\
adds r4, r2, r4\n\
str r4, [sp, 0x1C]\n\
strb r0, [r4]\n\
mov r0, r10\n\
strb r0, [r1, 0x10]\n\
movs r4, 0x80\n\
lsls r4, 1\n\
adds r4, r2, r4\n\
str r4, [sp, 0x1C]\n\
strb r0, [r4]\n\
_080347B6:\n\
adds r2, 0x1\n\
adds r1, 0x1\n\
subs r6, 0x1\n\
cmp r6, 0\n\
bge _08034798\n\
movs r0, 0x20\n\
add r12, r0\n\
adds r3, 0x1\n\
cmp r3, 0x7\n\
ble _08034786\n\
adds r7, 0x1\n\
ldr r1, [sp, 0xC]\n\
cmp r7, r1\n\
blt _08034774\n\
adds r2, 0x1\n\
adds r1, 0x1\n\
subs r6, 0x1\n\
cmp r6, 0\n\
bge _08034798\n\
movs r0, 0x20\n\
add r12, r0\n\
adds r3, 0x1\n\
cmp r3, 0x7\n\
ble _08034786\n\
adds r7, 0x1\n\
ldr r1, [sp, 0xC]\n\
cmp r7, r1\n\
blt _08034774\n\
_080347D2:\n\
movs r7, 0\n\
movs r2, 0\n\
movs r7, 0\n\
movs r2, 0\n\
_080347D6:\n\
movs r6, 0\n\
adds r4, r7, 0x1\n\
mov r8, r4\n\
lsls r4, r7, 5\n\
movs r6, 0\n\
adds r4, r7, 0x1\n\
mov r8, r4\n\
lsls r4, r7, 5\n\
_080347DE:\n\
adds r0, r6, 0x1\n\
mov r10, r0\n\
lsls r1, r6, 8\n\
adds r0, r1, 0\n\
adds r0, 0xC0\n\
adds r0, r5, r0\n\
adds r0, r4\n\
adds r1, r5, r1\n\
adds r1, r4\n\
movs r3, 0x1F\n\
adds r0, r6, 0x1\n\
mov r10, r0\n\
lsls r1, r6, 8\n\
adds r0, r1, 0\n\
adds r0, 0xC0\n\
adds r0, r5, r0\n\
adds r0, r4\n\
adds r1, r5, r1\n\
adds r1, r4\n\
movs r3, 0x1F\n\
_080347F2:\n\
strb r2, [r1]\n\
strb r2, [r0]\n\
adds r0, 0x1\n\
adds r1, 0x1\n\
subs r3, 0x1\n\
cmp r3, 0\n\
bge _080347F2\n\
mov r6, r10\n\
cmp r6, 0x7\n\
ble _080347DE\n\
mov r7, r8\n\
cmp r7, 0x1\n\
ble _080347D6\n\
mov r1, r9\n\
cmp r1, 0x5\n\
bne _08034818\n\
movs r2, 0x90\n\
lsls r2, 1\n\
adds r5, r2\n\
strb r2, [r1]\n\
strb r2, [r0]\n\
adds r0, 0x1\n\
adds r1, 0x1\n\
subs r3, 0x1\n\
cmp r3, 0\n\
bge _080347F2\n\
mov r6, r10\n\
cmp r6, 0x7\n\
ble _080347DE\n\
mov r7, r8\n\
cmp r7, 0x1\n\
ble _080347D6\n\
mov r1, r9\n\
cmp r1, 0x5\n\
bne _08034818\n\
movs r2, 0x90\n\
lsls r2, 1\n\
adds r5, r2\n\
_08034818:\n\
movs r7, 0\n\
cmp r7, r9\n\
bge _080348AE\n\
movs r7, 0\n\
cmp r7, r9\n\
bge _080348AE\n\
_0803481E:\n\
movs r3, 0\n\
adds r7, 0x1\n\
mov r8, r7\n\
cmp r3, r9\n\
bge _0803488E\n\
movs r3, 0\n\
adds r7, 0x1\n\
mov r8, r7\n\
cmp r3, r9\n\
bge _0803488E\n\
_08034828:\n\
adds r3, 0x1\n\
mov r10, r3\n\
ldr r4, [sp, 0x4]\n\
adds r4, 0x20\n\
adds r7, r5, 0\n\
adds r7, 0x20\n\
movs r0, 0x12\n\
adds r0, r5\n\
mov r12, r0\n\
ldr r2, [sp, 0x4]\n\
adds r3, r5, 0\n\
movs r6, 0x3\n\
adds r3, 0x1\n\
mov r10, r3\n\
ldr r4, [sp, 0x4]\n\
adds r4, 0x20\n\
adds r7, r5, 0\n\
adds r7, 0x20\n\
movs r0, 0x12\n\
adds r0, r5\n\
mov r12, r0\n\
ldr r2, [sp, 0x4]\n\
adds r3, r5, 0\n\
movs r6, 0x3\n\
_08034840:\n\
ldrb r0, [r2]\n\
mov r1, r12\n\
strb r0, [r1]\n\
ldrb r0, [r2, 0x1]\n\
strb r0, [r1, 0x1]\n\
ldrb r0, [r2, 0x2]\n\
strb r0, [r1, 0x1E]\n\
ldrb r0, [r2, 0x3]\n\
strb r0, [r1, 0x1F]\n\
movs r0, 0x81\n\
lsls r0, 1\n\
adds r1, r3, r0\n\
ldrb r0, [r2, 0x10]\n\
strb r0, [r1]\n\
ldr r0, =0x00000103\n\
adds r1, r3, r0\n\
ldrb r0, [r2, 0x11]\n\
strb r0, [r1]\n\
movs r0, 0x90\n\
lsls r0, 1\n\
adds r1, r3, r0\n\
ldrb r0, [r2, 0x12]\n\
strb r0, [r1]\n\
ldr r0, =0x00000121\n\
adds r1, r3, r0\n\
ldrb r0, [r2, 0x13]\n\
strb r0, [r1]\n\
movs r1, 0x4\n\
add r12, r1\n\
adds r2, 0x4\n\
adds r3, 0x4\n\
subs r6, 0x1\n\
cmp r6, 0\n\
bge _08034840\n\
str r4, [sp, 0x4]\n\
adds r5, r7, 0\n\
mov r3, r10\n\
cmp r3, r9\n\
blt _08034828\n\
ldrb r0, [r2]\n\
mov r1, r12\n\
strb r0, [r1]\n\
ldrb r0, [r2, 0x1]\n\
strb r0, [r1, 0x1]\n\
ldrb r0, [r2, 0x2]\n\
strb r0, [r1, 0x1E]\n\
ldrb r0, [r2, 0x3]\n\
strb r0, [r1, 0x1F]\n\
movs r0, 0x81\n\
lsls r0, 1\n\
adds r1, r3, r0\n\
ldrb r0, [r2, 0x10]\n\
strb r0, [r1]\n\
ldr r0, =0x00000103\n\
adds r1, r3, r0\n\
ldrb r0, [r2, 0x11]\n\
strb r0, [r1]\n\
movs r0, 0x90\n\
lsls r0, 1\n\
adds r1, r3, r0\n\
ldrb r0, [r2, 0x12]\n\
strb r0, [r1]\n\
ldr r0, =0x00000121\n\
adds r1, r3, r0\n\
ldrb r0, [r2, 0x13]\n\
strb r0, [r1]\n\
movs r1, 0x4\n\
add r12, r1\n\
adds r2, 0x4\n\
adds r3, 0x4\n\
subs r6, 0x1\n\
cmp r6, 0\n\
bge _08034840\n\
str r4, [sp, 0x4]\n\
adds r5, r7, 0\n\
mov r3, r10\n\
cmp r3, r9\n\
blt _08034828\n\
_0803488E:\n\
mov r2, r9\n\
cmp r2, 0x7\n\
bne _080348A0\n\
adds r5, 0x20\n\
b _080348A8\n\
.pool\n\
mov r2, r9\n\
cmp r2, 0x7\n\
bne _080348A0\n\
adds r5, 0x20\n\
b _080348A8\n\
.pool\n\
_080348A0:\n\
mov r4, r9\n\
cmp r4, 0x5\n\
bne _080348A8\n\
adds r5, 0x60\n\
mov r4, r9\n\
cmp r4, 0x5\n\
bne _080348A8\n\
adds r5, 0x60\n\
_080348A8:\n\
mov r7, r8\n\
cmp r7, r9\n\
blt _0803481E\n\
mov r7, r8\n\
cmp r7, r9\n\
blt _0803481E\n\
_080348AE:\n\
mov r0, r9\n\
cmp r0, 0x7\n\
bne _080348BC\n\
movs r1, 0x80\n\
lsls r1, 1\n\
adds r5, r1\n\
b _080348C8\n\
mov r0, r9\n\
cmp r0, 0x7\n\
bne _080348BC\n\
movs r1, 0x80\n\
lsls r1, 1\n\
adds r5, r1\n\
b _080348C8\n\
_080348BC:\n\
mov r2, r9\n\
cmp r2, 0x5\n\
bne _080348C8\n\
movs r4, 0xF0\n\
lsls r4, 1\n\
adds r5, r4\n\
mov r2, r9\n\
cmp r2, 0x5\n\
bne _080348C8\n\
movs r4, 0xF0\n\
lsls r4, 1\n\
adds r5, r4\n\
_080348C8:\n\
ldr r0, [sp, 0x14]\n\
ldr r1, [sp]\n\
cmp r0, r1\n\
bge _080348D2\n\
b _08034756\n\
ldr r0, [sp, 0x14]\n\
ldr r1, [sp]\n\
cmp r0, r1\n\
bge _080348D2\n\
b _08034756\n\
_080348D2:\n\
b _08034964\n\
b _08034964\n\
_080348D4:\n\
movs r6, 0\n\
ldr r2, [sp]\n\
cmp r6, r2\n\
bge _08034964\n\
movs r6, 0\n\
ldr r2, [sp]\n\
cmp r6, r2\n\
bge _08034964\n\
_080348DC:\n\
adds r6, 0x1\n\
mov r10, r6\n\
mov r4, r9\n\
cmp r4, 0x6\n\
bne _080348F4\n\
movs r0, 0\n\
movs r3, 0xFF\n\
adds r6, 0x1\n\
mov r10, r6\n\
mov r4, r9\n\
cmp r4, 0x6\n\
bne _080348F4\n\
movs r0, 0\n\
movs r3, 0xFF\n\
_080348EA:\n\
strb r0, [r5]\n\
adds r5, 0x1\n\
subs r3, 0x1\n\
cmp r3, 0\n\
bge _080348EA\n\
strb r0, [r5]\n\
adds r5, 0x1\n\
subs r3, 0x1\n\
cmp r3, 0\n\
bge _080348EA\n\
_080348F4:\n\
movs r7, 0\n\
cmp r7, r9\n\
bge _08034948\n\
movs r7, 0\n\
cmp r7, r9\n\
bge _08034948\n\
_080348FA:\n\
adds r7, 0x1\n\
mov r8, r7\n\
mov r1, r9\n\
lsls r0, r1, 5\n\
cmp r1, 0x6\n\
bne _08034914\n\
movs r1, 0\n\
movs r3, 0x1F\n\
adds r7, 0x1\n\
mov r8, r7\n\
mov r1, r9\n\
lsls r0, r1, 5\n\
cmp r1, 0x6\n\
bne _08034914\n\
movs r1, 0\n\
movs r3, 0x1F\n\
_0803490A:\n\
strb r1, [r5]\n\
adds r5, 0x1\n\
subs r3, 0x1\n\
cmp r3, 0\n\
bge _0803490A\n\
strb r1, [r5]\n\
adds r5, 0x1\n\
subs r3, 0x1\n\
cmp r3, 0\n\
bge _0803490A\n\
_08034914:\n\
adds r1, r0, 0\n\
cmp r1, 0\n\
ble _0803492E\n\
adds r3, r1, 0\n\
adds r1, r0, 0\n\
cmp r1, 0\n\
ble _0803492E\n\
adds r3, r1, 0\n\
_0803491C:\n\
ldr r2, [sp, 0x4]\n\
ldrb r0, [r2]\n\
strb r0, [r5]\n\
adds r2, 0x1\n\
str r2, [sp, 0x4]\n\
adds r5, 0x1\n\
subs r3, 0x1\n\
cmp r3, 0\n\
bne _0803491C\n\
ldr r2, [sp, 0x4]\n\
ldrb r0, [r2]\n\
strb r0, [r5]\n\
adds r2, 0x1\n\
str r2, [sp, 0x4]\n\
adds r5, 0x1\n\
subs r3, 0x1\n\
cmp r3, 0\n\
bne _0803491C\n\
_0803492E:\n\
mov r4, r9\n\
cmp r4, 0x6\n\
bne _08034942\n\
movs r0, 0\n\
movs r3, 0x1F\n\
mov r4, r9\n\
cmp r4, 0x6\n\
bne _08034942\n\
movs r0, 0\n\
movs r3, 0x1F\n\
_08034938:\n\
strb r0, [r5]\n\
adds r5, 0x1\n\
subs r3, 0x1\n\
cmp r3, 0\n\
bge _08034938\n\
strb r0, [r5]\n\
adds r5, 0x1\n\
subs r3, 0x1\n\
cmp r3, 0\n\
bge _08034938\n\
_08034942:\n\
mov r7, r8\n\
cmp r7, r9\n\
blt _080348FA\n\
mov r7, r8\n\
cmp r7, r9\n\
blt _080348FA\n\
_08034948:\n\
mov r0, r9\n\
cmp r0, 0x6\n\
bne _0803495C\n\
movs r0, 0\n\
movs r3, 0xFF\n\
mov r0, r9\n\
cmp r0, 0x6\n\
bne _0803495C\n\
movs r0, 0\n\
movs r3, 0xFF\n\
_08034952:\n\
strb r0, [r5]\n\
adds r5, 0x1\n\
subs r3, 0x1\n\
cmp r3, 0\n\
bge _08034952\n\
strb r0, [r5]\n\
adds r5, 0x1\n\
subs r3, 0x1\n\
cmp r3, 0\n\
bge _08034952\n\
_0803495C:\n\
mov r6, r10\n\
ldr r1, [sp]\n\
cmp r6, r1\n\
blt _080348DC\n\
mov r6, r10\n\
ldr r1, [sp]\n\
cmp r6, r1\n\
blt _080348DC\n\
_08034964:\n\
add sp, 0x24\n\
pop {r3-r5}\n\
mov r8, r3\n\
mov r9, r4\n\
mov r10, r5\n\
pop {r4-r7}\n\
pop {r0}\n\
bx r0\n\
add sp, 0x24\n\
pop {r3-r5}\n\
mov r8, r3\n\
mov r9, r4\n\
mov r10, r5\n\
pop {r4-r7}\n\
pop {r0}\n\
bx r0\n\
.syntax divided");
}
u32 GetDecompressedDataSize(const u32 *ptr)
{
const u8 *ptr8 = (const u8 *)ptr;
const u8 *ptr8 = (const u8 *)ptr;
return (ptr8[3] << 16) | (ptr8[2] << 8) | (ptr8[1]);
}

View File

@ -312,7 +312,7 @@ const struct SpriteFrameImage sDecorSelectorSpriteFrameImages = {
};
const struct SpriteTemplate sDecorSelectorSpriteTemplate = {
INVALID_U16,
0xFFFF,
OVERWORLD_PLACE_DECOR_SELECTOR_PAL_TAG,
&sDecorSelectorOam,
sDecorSelectorAnims,
@ -409,7 +409,7 @@ const struct SpriteFrameImage Unknown_085A73FC = {
};
const struct SpriteTemplate gUnknown_085A7404 = {
INVALID_U16,
0xFFFF,
OVERWORLD_PLACE_DECOR_PLAYER_PAL_TAG,
&Unknown_085A73E8,
Unknown_085A73F8,
@ -881,7 +881,7 @@ void sub_81274A0(u8 a0, s32 a1, u8 a2)
void sub_8127500(void)
{
if (sDecorPCBuffer->unk_522 == INVALID_U8)
if (sDecorPCBuffer->unk_522 == 0xFF)
{
sDecorPCBuffer->unk_522 = AddScrollIndicatorArrowPairParameterized(SCROLL_ARROW_UP, 0x3c, 0x0c, 0x94, sDecorPCBuffer->unk_520 - sDecorPCBuffer->unk_521, 0x6e, 0x6e, &sSecretBasePCSelectDecorPageNo);
}
@ -889,10 +889,10 @@ void sub_8127500(void)
void sub_8127554(void)
{
if (sDecorPCBuffer->unk_522 != INVALID_U8)
if (sDecorPCBuffer->unk_522 != 0xFF)
{
RemoveScrollIndicatorArrowPair(sDecorPCBuffer->unk_522);
sDecorPCBuffer->unk_522 = INVALID_U8;
sDecorPCBuffer->unk_522 = 0xFF;
}
}
@ -910,7 +910,7 @@ void sub_812759C(u8 taskId)
sub_81269D4(3);
sub_8127718(sCurDecorationCategory);
sDecorPCBuffer = calloc(1, sizeof(struct DecorPCBuffer));
sDecorPCBuffer->unk_522 = INVALID_U8;
sDecorPCBuffer->unk_522 = 0xFF;
sub_8127284();
sub_81272C8();
sub_81272F8();
@ -1188,7 +1188,7 @@ void sub_8127B90(u16 mapX, u16 mapY, u8 decWidth, u8 decHeight, u16 decor)
v0 = 0;
}
v1 = sub_8127B54(gDecorations[decor].id, i * decWidth + j);
if (v1 != INVALID_U16)
if (v1 != 0xFFFF)
{
MapGridSetMetatileEntryAt(decLeft, decBottom, (gDecorations[decor].tiles[i * decWidth + j] + (0x200 | v0)) | flags | v1);
}

File diff suppressed because it is too large Load Diff

View File

@ -748,7 +748,7 @@ static void Task_EvolutionScene(u8 taskID)
GetMonData(mon, MON_DATA_NICKNAME, text);
StringCopy10(gBattleTextBuff1, text);
if (var == INVALID_U16) // no place to learn it
if (var == 0xFFFF) // no place to learn it
gTasks[taskID].tState = 22;
else if (var == 0xFFFE) // it already knows that move
break;
@ -1105,7 +1105,7 @@ static void Task_TradeEvolutionScene(u8 taskID)
GetMonData(mon, MON_DATA_NICKNAME, text);
StringCopy10(gBattleTextBuff1, text);
if (var == INVALID_U16)
if (var == 0xFFFF)
gTasks[taskID].tState = 20;
else if (var == 0xFFFE)
break;

View File

@ -266,7 +266,7 @@ const u8 *GetInteractedLinkPlayerScript(struct MapPosition *position, u8 metatil
else
eventObjectId = GetEventObjectIdByXYZ(position->x + gDirectionToVectors[direction].x, position->y + gDirectionToVectors[direction].y, position->height);
if (eventObjectId == 16 || gEventObjects[eventObjectId].localId == INVALID_U8)
if (eventObjectId == 16 || gEventObjects[eventObjectId].localId == 0xFF)
return NULL;
for (i = 0; i < 4; i++)
@ -287,14 +287,14 @@ static const u8 *GetInteractedEventObjectScript(struct MapPosition *position, u8
const u8 *script;
eventObjectId = GetEventObjectIdByXYZ(position->x, position->y, position->height);
if (eventObjectId == 16 || gEventObjects[eventObjectId].localId == INVALID_U8)
if (eventObjectId == 16 || gEventObjects[eventObjectId].localId == 0xFF)
{
if (MetatileBehavior_IsCounter(metatileBehavior) != TRUE)
return NULL;
// Look for an event object on the other side of the counter.
eventObjectId = GetEventObjectIdByXYZ(position->x + gDirectionToVectors[direction].x, position->y + gDirectionToVectors[direction].y, position->height);
if (eventObjectId == 16 || gEventObjects[eventObjectId].localId == INVALID_U8)
if (eventObjectId == 16 || gEventObjects[eventObjectId].localId == 0xFF)
return NULL;
}

View File

@ -695,7 +695,7 @@ static void DrawClosedDoorTiles(const struct DoorGraphics *gfx, u32 x, u32 y)
static void DrawDoor(const struct DoorGraphics *gfx, const struct DoorAnimFrame *frame, u32 x, u32 y)
{
if (frame->offset == INVALID_U16)
if (frame->offset == 0xFFFF)
{
DrawClosedDoorTiles(gfx, x, y);
if (sub_808A964())

View File

@ -305,7 +305,7 @@ const union AnimCmd *const gNewGameBirchImageAnimTable[] = {
};
const struct SpriteTemplate gNewGameBirchObjectTemplate = {
.tileTag = INVALID_U16,
.tileTag = 0xFFFF,
.paletteTag = 4102,
.oam = &gNewGameBirchOamAttributes,
.anims = gNewGameBirchImageAnimTable,
@ -383,7 +383,7 @@ const union AnimCmd *const gSpriteAnimTable_855C300[] = {
};
const struct SpriteTemplate gSpriteTemplate_855C304 = {
.tileTag = INVALID_U16,
.tileTag = 0xFFFF,
.paletteTag = 4103,
.oam = &gOamData_855C218,
.anims = gSpriteAnimTable_855C2F8,
@ -393,7 +393,7 @@ const struct SpriteTemplate gSpriteTemplate_855C304 = {
};
const struct SpriteTemplate gSpriteTemplate_855C31C = {
.tileTag = INVALID_U16,
.tileTag = 0xFFFF,
.paletteTag = 4100,
.oam = &gOamData_855C220,
.anims = gSpriteAnimTable_855C2F8,
@ -403,7 +403,7 @@ const struct SpriteTemplate gSpriteTemplate_855C31C = {
};
const struct SpriteTemplate gSpriteTemplate_855C334 = {
.tileTag = INVALID_U16,
.tileTag = 0xFFFF,
.paletteTag = 4112,
.oam = &gOamData_855C220,
.anims = gSpriteAnimTable_855C300,
@ -413,7 +413,7 @@ const struct SpriteTemplate gSpriteTemplate_855C334 = {
};
const struct SpriteTemplate gSpriteTemplate_855C34C = {
.tileTag = INVALID_U16,
.tileTag = 0xFFFF,
.paletteTag = 4112,
.oam = &gOamData_855C26C,
.anims = gSpriteAnimTable_855C300,
@ -618,7 +618,7 @@ u32 FieldEffectScript_ReadWord(u8 **script)
void FieldEffectScript_LoadTiles(u8 **script)
{
struct SpriteSheet *sheet = (struct SpriteSheet *)FieldEffectScript_ReadWord(script);
if (GetSpriteTileStartByTag(sheet->tag) == INVALID_U16)
if (GetSpriteTileStartByTag(sheet->tag) == 0xFFFF)
LoadSpriteSheet(sheet);
(*script) += 4;
}
@ -665,7 +665,7 @@ void FieldEffectFreeTilesIfUnused(u16 tileStart)
u8 i;
u16 tag = GetSpriteTileTagByTileStart(tileStart);
if (tag != INVALID_U16)
if (tag != 0xFFFF)
{
for (i = 0; i < MAX_SPRITES; i++)
if (gSprites[i].inUse && gSprites[i].usingSheet && tileStart == gSprites[i].sheetTileStart)
@ -679,7 +679,7 @@ void FieldEffectFreePaletteIfUnused(u8 paletteNum)
u8 i;
u16 tag = GetSpritePaletteTagByPaletteNum(paletteNum);
if (tag != INVALID_U16)
if (tag != 0xFFFF)
{
for (i = 0; i < MAX_SPRITES; i++)
if (gSprites[i].inUse && gSprites[i].oam.paletteNum == paletteNum)
@ -761,7 +761,7 @@ u8 CreateMonSprite_PicBox(u16 species, s16 x, s16 y, u8 subpriority)
{
s32 spriteId = CreateMonPicSprite_HandleDeoxys(species, 0, 0x8000, 1, x, y, 0, gMonPaletteTable[species].tag);
PreservePaletteInWeather(IndexOfSpritePaletteTag(gMonPaletteTable[species].tag) + 0x10);
if (spriteId == INVALID_U16)
if (spriteId == 0xFFFF)
return MAX_SPRITES;
else
return spriteId;
@ -772,7 +772,7 @@ u8 CreateMonSprite_FieldMove(u16 species, u32 d, u32 g, s16 x, s16 y, u8 subprio
const struct CompressedSpritePalette *spritePalette = GetMonSpritePalStructFromOtIdPersonality(species, d, g);
u16 spriteId = CreateMonPicSprite_HandleDeoxys(species, d, g, 1, x, y, 0, spritePalette->tag);
PreservePaletteInWeather(IndexOfSpritePaletteTag(spritePalette->tag) + 0x10);
if (spriteId == INVALID_U16)
if (spriteId == 0xFFFF)
return MAX_SPRITES;
else
return spriteId;
@ -3591,7 +3591,7 @@ const union AnimCmd *const gSpriteAnimTable_855C5DC[] = {
};
const struct SpriteTemplate gUnknown_0855C5EC = {
.tileTag = INVALID_U16,
.tileTag = 0xFFFF,
.paletteTag = 4378,
.oam = &gOamData_855C218,
.anims = gSpriteAnimTable_855C5DC,

View File

@ -1007,15 +1007,15 @@ void UpdateSurfBlobFieldEffect(struct Sprite *sprite)
static void SynchroniseSurfAnim(struct EventObject *eventObject, struct Sprite *sprite)
{
u8 surfBlobDirectionAnims[] = {
0, // DIR_NONE
0, // DIR_SOUTH
1, // DIR_NORTH
2, // DIR_WEST
3, // DIR_EAST
0,
0,
1,
1,
[DIR_NONE] = 0,
[DIR_SOUTH] = 0,
[DIR_NORTH] = 1,
[DIR_WEST] = 2,
[DIR_EAST] = 3,
[DIR_SOUTHWEST] = 0,
[DIR_SOUTHEAST] = 0,
[DIR_NORTHWEST] = 1,
[DIR_NORTHEAST] = 1,
};
if (sub_8155640(sprite) == 0)

View File

@ -53,7 +53,7 @@ void task_add_textbox(void)
void task_del_textbox(void)
{
u8 taskId = FindTaskIdByFunc(sub_8098154);
if (taskId != INVALID_U8)
if (taskId != 0xFF)
DestroyTask(taskId);
}

View File

@ -1389,7 +1389,7 @@ void InitPlayerAvatar(s16 x, s16 y, u8 direction, u8 gender)
u8 eventObjectId;
struct EventObject *eventObject;
playerEventObjTemplate.localId = INVALID_U8;
playerEventObjTemplate.localId = 0xFF;
playerEventObjTemplate.graphicsId = GetPlayerAvatarGraphicsIdByStateIdAndGender(PLAYER_AVATAR_STATE_NORMAL, gender);
playerEventObjTemplate.x = x - 7;
playerEventObjTemplate.y = y - 7;

View File

@ -1691,22 +1691,22 @@ const struct WindowTemplate gUnknown_085B2BAC = {
};
const u8 *const gElevatorFloorsTable[] = {
gText_B4F,
gText_B3F,
gText_B2F,
gText_B1F,
gText_1F,
gText_2F,
gText_3F,
gText_4F,
gText_5F,
gText_6F,
gText_7F,
gText_8F,
gText_9F,
gText_10F,
gText_11F,
gText_Rooftop
gText_B4F,
gText_B3F,
gText_B2F,
gText_B1F,
gText_1F,
gText_2F,
gText_3F,
gText_4F,
gText_5F,
gText_6F,
gText_7F,
gText_8F,
gText_9F,
gText_10F,
gText_11F,
gText_Rooftop
};
const u16 gUnknown_085B2BF4[][3] =
@ -1957,12 +1957,12 @@ void sub_8139D98(void)
bool32 warp0_in_pokecenter(void)
{
static const u16 gUnknown_085B2C2A[] = { 0x0202, 0x0301, 0x0405, 0x0504, 0x0604, 0x0700, 0x0804, 0x090b, 0x0a05, 0x0b05, 0x0c02, 0x0d06, 0x0e03, 0x0f02, 0x100c, 0x100a, 0x1a35, 0x193c, INVALID_U16 };
static const u16 gUnknown_085B2C2A[] = { 0x0202, 0x0301, 0x0405, 0x0504, 0x0604, 0x0700, 0x0804, 0x090b, 0x0a05, 0x0b05, 0x0c02, 0x0d06, 0x0e03, 0x0f02, 0x100c, 0x100a, 0x1a35, 0x193c, 0xFFFF };
int i;
u16 map = (gLastUsedWarp.mapGroup << 8) + gLastUsedWarp.mapNum;
for (i = 0; gUnknown_085B2C2A[i] != INVALID_U16; i++)
for (i = 0; gUnknown_085B2C2A[i] != 0xFFFF; i++)
{
if (gUnknown_085B2C2A[i] == map)
return TRUE;
@ -2946,10 +2946,10 @@ void sub_813AA44(void)
static void sub_813AA60(u16 a0, u16 a1)
{
static const u16 gUnknown_085B312C[] = { 0x004b, 0x0067, 0x0057, 0x004f, 0x0054, 0x0055, 0x0056, 0x0050, 0x0051, 0x0052, INVALID_U16 };
static const u16 gUnknown_085B3142[] = { 0x0071, 0x006f, 0x0072, 0x0073, 0x0074, INVALID_U16 };
static const u16 gUnknown_085B314E[] = { 0x0040, 0x0043, 0x0041, 0x0046, 0x0042, 0x003f, INVALID_U16 };
static const u16 gUnknown_085B315C[] = { 0x00c8, 0x00b4, 0x00b7, 0x00b9, 0x00b3, 0x00ba, 0x00bb, 0x00c4, 0x00c6, INVALID_U16 };
static const u16 gUnknown_085B312C[] = { 0x004b, 0x0067, 0x0057, 0x004f, 0x0054, 0x0055, 0x0056, 0x0050, 0x0051, 0x0052, 0xFFFF };
static const u16 gUnknown_085B3142[] = { 0x0071, 0x006f, 0x0072, 0x0073, 0x0074, 0xFFFF };
static const u16 gUnknown_085B314E[] = { 0x0040, 0x0043, 0x0041, 0x0046, 0x0042, 0x003f, 0xFFFF };
static const u16 gUnknown_085B315C[] = { 0x00c8, 0x00b4, 0x00b7, 0x00b9, 0x00b3, 0x00ba, 0x00bb, 0x00c4, 0x00c6, 0xFFFF };
static const u8 *const gUnknown_085B3170[] = {
BattleFrontier_BattlePointExchangeServiceCorner_Text_2601AA,
@ -3004,7 +3004,7 @@ static void sub_813AA60(u16 a0, u16 a1)
{
case 3:
AddTextPrinterParameterized2(0, 1, gUnknown_085B3170[a1], 0, NULL, 2, 1, 3);
if (gUnknown_085B312C[a1] == INVALID_U16)
if (gUnknown_085B312C[a1] == 0xFFFF)
{
sub_813ABD4(gUnknown_085B312C[a1]);
}
@ -3017,7 +3017,7 @@ static void sub_813AA60(u16 a0, u16 a1)
break;
case 4:
AddTextPrinterParameterized2(0, 1, gUnknown_085B319C[a1], 0, NULL, 2, 1, 3);
if (gUnknown_085B3142[a1] == INVALID_U16)
if (gUnknown_085B3142[a1] == 0xFFFF)
{
sub_813ABD4(gUnknown_085B3142[a1]);
}
@ -3841,13 +3841,13 @@ bool32 sub_813B9C0(void)
MAP_TRADE_CENTER,
MAP_RECORD_CORNER,
MAP_DOUBLE_BATTLE_COLOSSEUM,
INVALID_U16
0xFFFF
};
int i;
u16 map = (gSaveBlock1Ptr->location.mapGroup << 8) + gSaveBlock1Ptr->location.mapNum;
for (i = 0; gUnknown_085B3444[i] != INVALID_U16; i++)
for (i = 0; gUnknown_085B3444[i] != 0xFFFF; i++)
{
if (gUnknown_085B3444[i] == map)
{

View File

@ -496,7 +496,7 @@ u16 GetBehaviorByMetatileId(u16 metatile)
}
else
{
return INVALID_U8;
return 0xFF;
}
}
@ -922,7 +922,7 @@ void sub_8088B94(int x, int y, int a2)
bool8 sub_8088BF0(u16* a0, u16 a1, u8 a2)
{
if (a2 == INVALID_U8)
if (a2 == 0xFF)
return FALSE;
if (a2 == 0)

View File

@ -164,7 +164,7 @@ const struct SpritePalette gFieldEffectObjectPaletteInfo6 = {gFieldEffectObjectP
static const struct SpriteTemplate sSpriteTemplate_CutGrass =
{
.tileTag = INVALID_U16,
.tileTag = 0xFFFF,
.paletteTag = 0x1000,
.oam = &sOamData_CutGrass,
.anims = sSpriteAnimTable_CutGrass,

View File

@ -236,7 +236,7 @@ static void sub_81BE968(void)
u8 taskId;
taskId = FindTaskIdByFunc(sub_81BE9C0);
if(taskId != INVALID_U8)
if(taskId != 0xFF)
gTasks[taskId].data[0]++;
}

View File

@ -302,7 +302,7 @@ static void sub_81BED50(u8 taskId)
case 4:
UnsetBgTilemapBuffer(0);
anotherTaskId = FindTaskIdByFunc(sub_81BEBB4);
if (anotherTaskId != INVALID_U8)
if (anotherTaskId != 0xFF)
DestroyTask(anotherTaskId);
sUnknown_0203CF14[1] = sUnknown_0203CF14[0] = 0;
sub_81BEB90();
@ -458,104 +458,104 @@ static void sub_81BF2B8(u8* a, u16 b, u8 c, u8 d, u8 e)
{
asm_unified("\n\
push {r4-r7,lr}\n\
mov r7, r10\n\
mov r6, r9\n\
mov r5, r8\n\
push {r5-r7}\n\
sub sp, 0x8\n\
str r0, [sp]\n\
mov r10, r1\n\
adds r6, r2, 0\n\
mov r8, r3\n\
ldr r0, [sp, 0x28]\n\
mov r9, r0\n\
lsls r1, 16\n\
lsrs r1, 16\n\
mov r10, r1\n\
lsls r6, 24\n\
lsrs r6, 24\n\
mov r0, r8\n\
lsls r0, 24\n\
mov r8, r0\n\
lsrs r7, r0, 24\n\
mov r1, r9\n\
lsls r1, 24\n\
lsrs r1, 24\n\
mov r9, r1\n\
mov r0, r10\n\
adds r1, r7, 0\n\
bl __divsi3\n\
adds r5, r0, 0\n\
lsls r5, 24\n\
lsrs r4, r5, 24\n\
ldr r3, =gUnknown_030012A8\n\
strh r4, [r3]\n\
mov r0, r10\n\
adds r1, r7, 0\n\
str r3, [sp, 0x4]\n\
bl __modsi3\n\
lsls r0, 24\n\
lsrs r2, r0, 24\n\
ldr r3, [sp, 0x4]\n\
strh r2, [r3, 0x2]\n\
movs r1, 0x7\n\
ands r4, r1\n\
ands r2, r1\n\
strh r4, [r3, 0x4]\n\
strh r2, [r3, 0x6]\n\
lsrs r0, 27\n\
lsrs r5, 27\n\
strh r0, [r3, 0x8]\n\
strh r5, [r3, 0xA]\n\
mov r1, r8\n\
lsrs r1, 27\n\
lsls r1, 6\n\
mov r8, r1\n\
mov r1, r8\n\
muls r1, r5\n\
lsls r0, 6\n\
adds r1, r0\n\
lsls r1, 16\n\
lsrs r1, 16\n\
strh r1, [r3, 0xC]\n\
lsls r4, 3\n\
adds r4, r2\n\
adds r1, r4\n\
lsls r4, r1, 16\n\
lsrs r4, 17\n\
strh r1, [r3, 0xE]\n\
movs r1, 0x1\n\
mov r0, r10\n\
ands r1, r0\n\
movs r2, 0x1\n\
eors r1, r2\n\
lsls r0, r1, 2\n\
lsls r6, r0\n\
eors r1, r2\n\
lsls r1, 2\n\
movs r0, 0xF\n\
lsls r0, r1\n\
orrs r6, r0\n\
lsls r6, 24\n\
lsrs r6, 24\n\
mov r1, r9\n\
lsls r1, 5\n\
mov r9, r1\n\
add r9, r4\n\
ldr r1, [sp]\n\
add r1, r9\n\
ldrb r0, [r1]\n\
ands r6, r0\n\
strb r6, [r1]\n\
add sp, 0x8\n\
pop {r3-r5}\n\
mov r8, r3\n\
mov r9, r4\n\
mov r10, r5\n\
pop {r4-r7}\n\
pop {r0}\n\
bx r0\n\
.pool\n\
mov r7, r10\n\
mov r6, r9\n\
mov r5, r8\n\
push {r5-r7}\n\
sub sp, 0x8\n\
str r0, [sp]\n\
mov r10, r1\n\
adds r6, r2, 0\n\
mov r8, r3\n\
ldr r0, [sp, 0x28]\n\
mov r9, r0\n\
lsls r1, 16\n\
lsrs r1, 16\n\
mov r10, r1\n\
lsls r6, 24\n\
lsrs r6, 24\n\
mov r0, r8\n\
lsls r0, 24\n\
mov r8, r0\n\
lsrs r7, r0, 24\n\
mov r1, r9\n\
lsls r1, 24\n\
lsrs r1, 24\n\
mov r9, r1\n\
mov r0, r10\n\
adds r1, r7, 0\n\
bl __divsi3\n\
adds r5, r0, 0\n\
lsls r5, 24\n\
lsrs r4, r5, 24\n\
ldr r3, =gUnknown_030012A8\n\
strh r4, [r3]\n\
mov r0, r10\n\
adds r1, r7, 0\n\
str r3, [sp, 0x4]\n\
bl __modsi3\n\
lsls r0, 24\n\
lsrs r2, r0, 24\n\
ldr r3, [sp, 0x4]\n\
strh r2, [r3, 0x2]\n\
movs r1, 0x7\n\
ands r4, r1\n\
ands r2, r1\n\
strh r4, [r3, 0x4]\n\
strh r2, [r3, 0x6]\n\
lsrs r0, 27\n\
lsrs r5, 27\n\
strh r0, [r3, 0x8]\n\
strh r5, [r3, 0xA]\n\
mov r1, r8\n\
lsrs r1, 27\n\
lsls r1, 6\n\
mov r8, r1\n\
mov r1, r8\n\
muls r1, r5\n\
lsls r0, 6\n\
adds r1, r0\n\
lsls r1, 16\n\
lsrs r1, 16\n\
strh r1, [r3, 0xC]\n\
lsls r4, 3\n\
adds r4, r2\n\
adds r1, r4\n\
lsls r4, r1, 16\n\
lsrs r4, 17\n\
strh r1, [r3, 0xE]\n\
movs r1, 0x1\n\
mov r0, r10\n\
ands r1, r0\n\
movs r2, 0x1\n\
eors r1, r2\n\
lsls r0, r1, 2\n\
lsls r6, r0\n\
eors r1, r2\n\
lsls r1, 2\n\
movs r0, 0xF\n\
lsls r0, r1\n\
orrs r6, r0\n\
lsls r6, 24\n\
lsrs r6, 24\n\
mov r1, r9\n\
lsls r1, 5\n\
mov r9, r1\n\
add r9, r4\n\
ldr r1, [sp]\n\
add r1, r9\n\
ldrb r0, [r1]\n\
ands r6, r0\n\
strb r6, [r1]\n\
add sp, 0x8\n\
pop {r3-r5}\n\
mov r8, r3\n\
mov r9, r4\n\
mov r10, r5\n\
pop {r4-r7}\n\
pop {r0}\n\
bx r0\n\
.pool\n\
");
}
#endif // NONMATCHING

View File

@ -681,7 +681,7 @@ static const u8 sFacilityToBrainEventObjGfx[][2] =
const u16 gFrontierBannedSpecies[] =
{
SPECIES_MEW, SPECIES_MEWTWO, SPECIES_HO_OH, SPECIES_LUGIA, SPECIES_CELEBI,
SPECIES_KYOGRE, SPECIES_GROUDON, SPECIES_RAYQUAZA, SPECIES_JIRACHI, SPECIES_DEOXYS, INVALID_U16
SPECIES_KYOGRE, SPECIES_GROUDON, SPECIES_RAYQUAZA, SPECIES_JIRACHI, SPECIES_DEOXYS, 0xFFFF
};
static const u8 *const gUnknown_08611CB0[][2] =
@ -1829,7 +1829,7 @@ void sub_81A3ACC(void)
s32 i;
for (i = 0; i < 20; i++)
gSaveBlock2Ptr->frontier.field_CB4[i] |= INVALID_U16;
gSaveBlock2Ptr->frontier.field_CB4[i] |= 0xFFFF;
}
static void sub_81A3B00(void)
@ -1974,10 +1974,10 @@ static void AppendIfValid(u16 species, u16 heldItem, u16 hp, u8 lvlMode, u8 monL
if (species == SPECIES_EGG || species == SPECIES_NONE)
return;
for (i = 0; gFrontierBannedSpecies[i] != INVALID_U16 && gFrontierBannedSpecies[i] != species; i++)
for (i = 0; gFrontierBannedSpecies[i] != 0xFFFF && gFrontierBannedSpecies[i] != species; i++)
;
if (gFrontierBannedSpecies[i] != INVALID_U16)
if (gFrontierBannedSpecies[i] != 0xFFFF)
return;
if (lvlMode == FRONTIER_LVL_50 && monLevel > 50)
return;
@ -2060,7 +2060,7 @@ static void sub_81A3FD4(void)
s32 i;
s32 caughtBannedMons = 0;
s32 species = gFrontierBannedSpecies[0];
for (i = 0; species != INVALID_U16; i++, species = gFrontierBannedSpecies[i])
for (i = 0; species != 0xFFFF; i++, species = gFrontierBannedSpecies[i])
{
if (GetSetPokedexFlag(SpeciesToNationalPokedexNum(species), FLAG_GET_CAUGHT))
caughtBannedMons++;
@ -2068,7 +2068,7 @@ static void sub_81A3FD4(void)
gStringVar1[0] = EOS;
gSpecialVar_0x8004 = 1;
count = 0;
for (i = 0; gFrontierBannedSpecies[i] != INVALID_U16; i++)
for (i = 0; gFrontierBannedSpecies[i] != 0xFFFF; i++)
count = sub_81A3DD0(gFrontierBannedSpecies[i], count, caughtBannedMons);
if (count == 0)

View File

@ -20,166 +20,166 @@ static void UpdateRegDispstatIntrBits(u16 regIE);
void InitGpuRegManager(void)
{
s32 i;
s32 i;
for (i = 0; i < GPU_REG_BUF_SIZE; i++)
for (i = 0; i < GPU_REG_BUF_SIZE; i++)
{
sGpuRegBuffer[i] = 0;
sGpuRegWaitingList[i] = EMPTY_SLOT;
}
sGpuRegBuffer[i] = 0;
sGpuRegWaitingList[i] = EMPTY_SLOT;
}
sGpuRegBufferLocked = FALSE;
sShouldSyncRegIE = FALSE;
sRegIE = 0;
sGpuRegBufferLocked = FALSE;
sShouldSyncRegIE = FALSE;
sRegIE = 0;
}
static void CopyBufferedValueToGpuReg(u8 regOffset)
{
if (regOffset == REG_OFFSET_DISPSTAT)
if (regOffset == REG_OFFSET_DISPSTAT)
{
REG_DISPSTAT &= ~(DISPSTAT_HBLANK_INTR | DISPSTAT_VBLANK_INTR);
REG_DISPSTAT |= GPU_REG_BUF(REG_OFFSET_DISPSTAT);
}
else
REG_DISPSTAT &= ~(DISPSTAT_HBLANK_INTR | DISPSTAT_VBLANK_INTR);
REG_DISPSTAT |= GPU_REG_BUF(REG_OFFSET_DISPSTAT);
}
else
{
GPU_REG(regOffset) = GPU_REG_BUF(regOffset);
}
GPU_REG(regOffset) = GPU_REG_BUF(regOffset);
}
}
void CopyBufferedValuesToGpuRegs(void)
{
if (!sGpuRegBufferLocked)
if (!sGpuRegBufferLocked)
{
s32 i;
s32 i;
for (i = 0; i < GPU_REG_BUF_SIZE; i++)
for (i = 0; i < GPU_REG_BUF_SIZE; i++)
{
u8 regOffset = sGpuRegWaitingList[i];
if (regOffset == EMPTY_SLOT)
return;
CopyBufferedValueToGpuReg(regOffset);
sGpuRegWaitingList[i] = EMPTY_SLOT;
}
}
u8 regOffset = sGpuRegWaitingList[i];
if (regOffset == EMPTY_SLOT)
return;
CopyBufferedValueToGpuReg(regOffset);
sGpuRegWaitingList[i] = EMPTY_SLOT;
}
}
}
void SetGpuReg(u8 regOffset, u16 value)
{
if (regOffset < GPU_REG_BUF_SIZE)
{
u16 vcount;
if (regOffset < GPU_REG_BUF_SIZE)
{
u16 vcount;
GPU_REG_BUF(regOffset) = value;
vcount = REG_VCOUNT & 0xFF;
GPU_REG_BUF(regOffset) = value;
vcount = REG_VCOUNT & 0xFF;
if ((vcount >= 161 && vcount <= 225)
|| (REG_DISPCNT & DISPCNT_FORCED_BLANK)) {
CopyBufferedValueToGpuReg(regOffset);
} else {
s32 i;
if ((vcount >= 161 && vcount <= 225)
|| (REG_DISPCNT & DISPCNT_FORCED_BLANK)) {
CopyBufferedValueToGpuReg(regOffset);
} else {
s32 i;
sGpuRegBufferLocked = TRUE;
sGpuRegBufferLocked = TRUE;
for (i = 0; i < GPU_REG_BUF_SIZE && sGpuRegWaitingList[i] != EMPTY_SLOT; i++) {
if (sGpuRegWaitingList[i] == regOffset) {
sGpuRegBufferLocked = FALSE;
return;
}
}
for (i = 0; i < GPU_REG_BUF_SIZE && sGpuRegWaitingList[i] != EMPTY_SLOT; i++) {
if (sGpuRegWaitingList[i] == regOffset) {
sGpuRegBufferLocked = FALSE;
return;
}
}
sGpuRegWaitingList[i] = regOffset;
sGpuRegBufferLocked = FALSE;
}
}
sGpuRegWaitingList[i] = regOffset;
sGpuRegBufferLocked = FALSE;
}
}
}
void SetGpuReg_ForcedBlank(u8 regOffset, u16 value)
{
if (regOffset < GPU_REG_BUF_SIZE)
{
GPU_REG_BUF(regOffset) = value;
if (regOffset < GPU_REG_BUF_SIZE)
{
GPU_REG_BUF(regOffset) = value;
if (REG_DISPCNT & DISPCNT_FORCED_BLANK) {
CopyBufferedValueToGpuReg(regOffset);
} else {
s32 i;
if (REG_DISPCNT & DISPCNT_FORCED_BLANK) {
CopyBufferedValueToGpuReg(regOffset);
} else {
s32 i;
sGpuRegBufferLocked = TRUE;
sGpuRegBufferLocked = TRUE;
for (i = 0; i < GPU_REG_BUF_SIZE && sGpuRegWaitingList[i] != EMPTY_SLOT; i++) {
if (sGpuRegWaitingList[i] == regOffset) {
sGpuRegBufferLocked = FALSE;
return;
}
}
for (i = 0; i < GPU_REG_BUF_SIZE && sGpuRegWaitingList[i] != EMPTY_SLOT; i++) {
if (sGpuRegWaitingList[i] == regOffset) {
sGpuRegBufferLocked = FALSE;
return;
}
}
sGpuRegWaitingList[i] = regOffset;
sGpuRegBufferLocked = FALSE;
}
}
sGpuRegWaitingList[i] = regOffset;
sGpuRegBufferLocked = FALSE;
}
}
}
u16 GetGpuReg(u8 regOffset)
{
if (regOffset == REG_OFFSET_DISPSTAT)
return REG_DISPSTAT;
if (regOffset == REG_OFFSET_DISPSTAT)
return REG_DISPSTAT;
if (regOffset == REG_OFFSET_VCOUNT)
return REG_VCOUNT;
if (regOffset == REG_OFFSET_VCOUNT)
return REG_VCOUNT;
return GPU_REG_BUF(regOffset);
return GPU_REG_BUF(regOffset);
}
void SetGpuRegBits(u8 regOffset, u16 mask)
{
u16 regValue = GPU_REG_BUF(regOffset);
SetGpuReg(regOffset, regValue | mask);
u16 regValue = GPU_REG_BUF(regOffset);
SetGpuReg(regOffset, regValue | mask);
}
void ClearGpuRegBits(u8 regOffset, u16 mask)
{
u16 regValue = GPU_REG_BUF(regOffset);
SetGpuReg(regOffset, regValue & ~mask);
u16 regValue = GPU_REG_BUF(regOffset);
SetGpuReg(regOffset, regValue & ~mask);
}
static void SyncRegIE(void)
{
if (sShouldSyncRegIE) {
u16 temp = REG_IME;
REG_IME = 0;
REG_IE = sRegIE;
REG_IME = temp;
sShouldSyncRegIE = FALSE;
}
if (sShouldSyncRegIE) {
u16 temp = REG_IME;
REG_IME = 0;
REG_IE = sRegIE;
REG_IME = temp;
sShouldSyncRegIE = FALSE;
}
}
void EnableInterrupts(u16 mask)
{
sRegIE |= mask;
sShouldSyncRegIE = TRUE;
SyncRegIE();
UpdateRegDispstatIntrBits(sRegIE);
sRegIE |= mask;
sShouldSyncRegIE = TRUE;
SyncRegIE();
UpdateRegDispstatIntrBits(sRegIE);
}
void DisableInterrupts(u16 mask)
{
sRegIE &= ~mask;
sShouldSyncRegIE = TRUE;
SyncRegIE();
UpdateRegDispstatIntrBits(sRegIE);
sRegIE &= ~mask;
sShouldSyncRegIE = TRUE;
SyncRegIE();
UpdateRegDispstatIntrBits(sRegIE);
}
static void UpdateRegDispstatIntrBits(u16 regIE)
{
u16 oldValue = GetGpuReg(REG_OFFSET_DISPSTAT) & (DISPSTAT_HBLANK_INTR | DISPSTAT_VBLANK_INTR);
u16 newValue = 0;
u16 oldValue = GetGpuReg(REG_OFFSET_DISPSTAT) & (DISPSTAT_HBLANK_INTR | DISPSTAT_VBLANK_INTR);
u16 newValue = 0;
if (regIE & INTR_FLAG_VBLANK)
newValue |= DISPSTAT_VBLANK_INTR;
if (regIE & INTR_FLAG_VBLANK)
newValue |= DISPSTAT_VBLANK_INTR;
if (regIE & INTR_FLAG_HBLANK)
newValue |= DISPSTAT_HBLANK_INTR;
if (regIE & INTR_FLAG_HBLANK)
newValue |= DISPSTAT_HBLANK_INTR;
if (oldValue != newValue)
SetGpuReg(REG_OFFSET_DISPSTAT, newValue);
if (oldValue != newValue)
SetGpuReg(REG_OFFSET_DISPSTAT, newValue);
}

View File

@ -588,7 +588,7 @@ void sub_81152DC(u8 taskId)
break;
default:
task->data[9] = GetAnimBattlerSpriteId(gBattleAnimArgs[0]);
if (task->data[9] == INVALID_U8)
if (task->data[9] == 0xFF)
{
DestroyAnimVisualTask(taskId);
}

View File

@ -467,11 +467,11 @@ static void Task_Hof_InitMonData(u8 taskId)
sUnknown_0203BCD4 = 0;
gTasks[taskId].tDisplayedMonId = 0;
gTasks[taskId].tPlayerSpriteID = INVALID_U8;
gTasks[taskId].tPlayerSpriteID = 0xFF;
for (i = 0; i < PARTY_SIZE; i++)
{
gTasks[taskId].tMonSpriteId(i) = INVALID_U8;
gTasks[taskId].tMonSpriteId(i) = 0xFF;
}
if (gTasks[taskId].tDontSaveData)
@ -522,7 +522,7 @@ static void Task_Hof_InitTeamSaveData(u8 taskId)
static void Task_Hof_TrySaveData(u8 taskId)
{
gGameContinueCallback = CB2_DoHallOfFameScreenDontSaveData;
if (TrySavingData(SAVE_HALL_OF_FAME) == INVALID_U8 && gDamagedSaveSectors != 0)
if (TrySavingData(SAVE_HALL_OF_FAME) == 0xFF && gDamagedSaveSectors != 0)
{
UnsetBgTilemapBuffer(1);
UnsetBgTilemapBuffer(3);
@ -645,7 +645,7 @@ static void Task_Hof_PaletteFadeAndPrintWelcomeText(u8 taskId)
BeginNormalPaletteFade(0xFFFF0000, 0, 0, 0, RGB_BLACK);
for (i = 0; i < PARTY_SIZE; i++)
{
if (gTasks[taskId].tMonSpriteId(i) != INVALID_U8)
if (gTasks[taskId].tMonSpriteId(i) != 0xFF)
gSprites[gTasks[taskId].tMonSpriteId(i)].oam.priority = 0;
}
@ -668,7 +668,7 @@ static void sub_8173DC0(u8 taskId)
u16 i;
for (i = 0; i < PARTY_SIZE; i++)
{
if (gTasks[taskId].tMonSpriteId(i) != INVALID_U8)
if (gTasks[taskId].tMonSpriteId(i) != 0xFF)
gSprites[gTasks[taskId].tMonSpriteId(i)].oam.priority = 1;
}
BeginNormalPaletteFade(sUnknown_0203BCD4, 0, 12, 12, RGB(16, 29, 24));
@ -752,7 +752,7 @@ static void Task_Hof_HandleExit(u8 taskId)
for (i = 0; i < PARTY_SIZE; i++)
{
u8 spriteId = gTasks[taskId].tMonSpriteId(i);
if (spriteId != INVALID_U8)
if (spriteId != 0xFF)
{
FreeOamMatrix(gSprites[spriteId].oam.matrixNum);
FreeAndDestroyMonPicSprite(spriteId);
@ -847,7 +847,7 @@ void CB2_DoHallOfFamePC(void)
for (i = 0; i < PARTY_SIZE; i++)
{
gTasks[taskId].tMonSpriteId(i) = INVALID_U8;
gTasks[taskId].tMonSpriteId(i) = 0xFF;
}
sHofMonPtr = AllocZeroed(0x2000);
@ -937,7 +937,7 @@ static void Task_HofPC_DrawSpritesPrintText(u8 taskId)
}
else
{
gTasks[taskId].tMonSpriteId(i) = INVALID_U8;
gTasks[taskId].tMonSpriteId(i) = 0xFF;
}
}
@ -967,7 +967,7 @@ static void Task_HofPC_PrintMonInfo(u8 taskId)
for (i = 0; i < PARTY_SIZE; i++)
{
u16 spriteId = gTasks[taskId].tMonSpriteId(i);
if (spriteId != INVALID_U8)
if (spriteId != 0xFF)
gSprites[spriteId].oam.priority = 1;
}
@ -999,10 +999,10 @@ static void Task_HofPC_HandleInput(u8 taskId)
for (i = 0; i < 6; i++)
{
u8 spriteId = gTasks[taskId].tMonSpriteId(i);
if (spriteId != INVALID_U8)
if (spriteId != 0xFF)
{
FreeAndDestroyMonPicSprite(spriteId);
gTasks[taskId].tMonSpriteId(i) = INVALID_U8;
gTasks[taskId].tMonSpriteId(i) = 0xFF;
}
}
if (gTasks[taskId].tCurrPageNo != 0)
@ -1060,10 +1060,10 @@ static void Task_HofPC_HandleExit(u8 taskId)
for (i = 0; i < PARTY_SIZE; i++)
{
u16 spriteId = gTasks[taskId].tMonSpriteId(i);
if (spriteId != INVALID_U8)
if (spriteId != 0xFF)
{
FreeAndDestroyMonPicSprite(spriteId);
gTasks[taskId].tMonSpriteId(i) = INVALID_U8;
gTasks[taskId].tMonSpriteId(i) = 0xFF;
}
}
@ -1130,7 +1130,7 @@ static void HallOfFame_PrintMonInfo(struct HallofFameMon* currMon, u8 unused1, u
{
stringPtr = StringCopy(text, gText_Number);
dexNumber = SpeciesToPokedexNum(currMon->species);
if (dexNumber != INVALID_U16)
if (dexNumber != 0xFFFF)
{
stringPtr[0] = (dexNumber / 100) + CHAR_0;
stringPtr++;
@ -1417,7 +1417,7 @@ void sub_8175280(void)
gSpecialVar_0x8004 = 180;
taskId = CreateTask(sub_8175364, 0);
if (taskId != INVALID_U8)
if (taskId != 0xFF)
{
gTasks[taskId].data[1] = gSpecialVar_0x8004;
gSpecialVar_0x8005 = taskId;
@ -1428,7 +1428,7 @@ static void sub_81752C0(void)
{
u8 taskId;
if ((taskId = FindTaskIdByFunc(sub_8175364)) != INVALID_U8)
if ((taskId = FindTaskIdByFunc(sub_8175364)) != 0xFF)
DestroyTask(taskId);
sub_8152254();
@ -1473,7 +1473,7 @@ static void sub_8175364(u8 taskId)
{
DestroyTask(taskId);
gSpecialVar_0x8004 = var;
gSpecialVar_0x8005 = INVALID_U16;
gSpecialVar_0x8005 = 0xFFFF;
}
LoadCompressedObjectPic(sHallOfFame_ConfettiSpriteSheet);
LoadCompressedObjectPalette(sHallOfFame_ConfettiSpritePalette);
@ -1483,7 +1483,7 @@ static void sub_8175364(u8 taskId)
if (data[1] != 0 && data[1] % 3 == 0)
{
var = sub_81524C4(&sOamData_85E53FC, 0x3E9, 0x3E9, Random() % 240, -(Random() % 8), Random() % 0x11, var);
if (var != INVALID_U8)
if (var != 0xFF)
{
sub_8152438(var, sub_81752F4);
if ((Random() & 3) == 0)
@ -1496,12 +1496,12 @@ static void sub_8175364(u8 taskId)
if (data[1] != 0)
data[1]--;
else if (data[15] == 0)
data[0] = INVALID_U8;
data[0] = 0xFF;
break;
case INVALID_U8:
case 0xFF:
sub_81752C0();
gSpecialVar_0x8004 = var;
gSpecialVar_0x8005 = INVALID_U16;
gSpecialVar_0x8005 = 0xFFFF;
break;
}
}

View File

@ -62,10 +62,10 @@ static const u32 gIntro3MiscTiles[] = INCBIN_U32("graphics/intro/intro3_misc.4bp
static const u16 gIntro1FlygonPalette[] = INCBIN_U16("graphics/intro/intro1_flygon.gbapal");
static const u32 gIntro1EonTiles_Unused[] = INCBIN_U32("graphics/intro/intro1_eon.4bpp.lz");
static const u8 sUnknownBytes[] = {
0x02, 0x03, 0x04, 0x05, 0x01, 0x01, 0x01, 0x06, 0x07, 0x08, 0x09, 0x0A, 0x0B, 0x0C, 0x02, 0x0D,
0x02, 0x03, 0x04, 0x05, 0x01, 0x01, 0x01, 0x06, 0x07, 0x08, 0x09, 0x0A, 0x0B, 0x0C, 0x02, 0x0D,
0x0E, 0x0F, 0x10, 0x11, 0x12, 0x13, 0x14, 0x15, 0x16, 0x17, 0x18, 0x19, 0x02, 0x0D, 0x0E, 0x0F,
0x10, 0x11, 0x12, 0x1A, 0x1B, 0x1C, 0x1D, 0x1E, 0x1F, 0x20, 0x21, 0x02, 0x0D, 0x0E, 0x0F, 0x10,
0x11, 0x12, 0x22, 0x23, 0x24, 0x25, 0x26, 0x27, 0x28, 0x29, 0x2A, 0x00
0x11, 0x12, 0x22, 0x23, 0x24, 0x25, 0x26, 0x27, 0x28, 0x29, 0x2A, 0x00
};
static const struct CompressedSpriteSheet gUnknown_085E4A74[] =
{

View File

@ -58,7 +58,7 @@ static void sub_817B7C4(struct Sprite *sprite);
static void nullsub_66(struct Sprite *sprite);
static const struct SpriteTemplate gUnknown_085F504C = {
2000, INVALID_U16, &gDummyOamData, gDummySpriteAnimTable, NULL, gDummySpriteAffineAnimTable, sub_817B62C
2000, 0xFFFF, &gDummyOamData, gDummySpriteAnimTable, NULL, gDummySpriteAffineAnimTable, sub_817B62C
};
static const struct CompressedSpriteSheet gUnknown_085F5064[] = {

View File

@ -244,152 +244,152 @@ NAKED
bool8 CheckBagHasSpace(u16 itemId, u16 count)
{
asm_unified("push {r4-r7,lr}\n\
mov r7, r10\n\
mov r6, r9\n\
mov r5, r8\n\
push {r5-r7}\n\
sub sp, 0x4\n\
lsls r0, 16\n\
lsrs r0, 16\n\
mov r8, r0\n\
lsls r1, 16\n\
lsrs r5, r1, 16\n\
bl ItemId_GetPocket\n\
lsls r0, 24\n\
cmp r0, 0\n\
beq _080D6906\n\
bl InBattlePyramid\n\
lsls r0, 24\n\
cmp r0, 0\n\
bne _080D6838\n\
ldr r0, =0x00004004\n\
bl FlagGet\n\
lsls r0, 24\n\
lsrs r0, 24\n\
cmp r0, 0x1\n\
bne _080D684C\n\
mov r7, r10\n\
mov r6, r9\n\
mov r5, r8\n\
push {r5-r7}\n\
sub sp, 0x4\n\
lsls r0, 16\n\
lsrs r0, 16\n\
mov r8, r0\n\
lsls r1, 16\n\
lsrs r5, r1, 16\n\
bl ItemId_GetPocket\n\
lsls r0, 24\n\
cmp r0, 0\n\
beq _080D6906\n\
bl InBattlePyramid\n\
lsls r0, 24\n\
cmp r0, 0\n\
bne _080D6838\n\
ldr r0, =0x00004004\n\
bl FlagGet\n\
lsls r0, 24\n\
lsrs r0, 24\n\
cmp r0, 0x1\n\
bne _080D684C\n\
_080D6838:\n\
mov r0, r8\n\
adds r1, r5, 0\n\
bl CheckPyramidBagHasSpace\n\
lsls r0, 24\n\
lsrs r0, 24\n\
b _080D6916\n\
.pool\n\
mov r0, r8\n\
adds r1, r5, 0\n\
bl CheckPyramidBagHasSpace\n\
lsls r0, 24\n\
lsrs r0, 24\n\
b _080D6916\n\
.pool\n\
_080D684C:\n\
mov r0, r8\n\
bl ItemId_GetPocket\n\
subs r0, 0x1\n\
lsls r0, 24\n\
lsrs r2, r0, 24\n\
ldr r7, =0x000003e7\n\
cmp r2, 0x3\n\
beq _080D6860\n\
movs r7, 0x63\n\
mov r0, r8\n\
bl ItemId_GetPocket\n\
subs r0, 0x1\n\
lsls r0, 24\n\
lsrs r2, r0, 24\n\
ldr r7, =0x000003e7\n\
cmp r2, 0x3\n\
beq _080D6860\n\
movs r7, 0x63\n\
_080D6860:\n\
movs r6, 0\n\
ldr r1, =gBagPockets\n\
lsls r4, r2, 3\n\
adds r0, r4, r1\n\
mov r9, r4\n\
ldrb r0, [r0, 0x4]\n\
cmp r6, r0\n\
bcs _080D68BC\n\
subs r0, r2, 0x2\n\
lsls r0, 24\n\
lsrs r0, 24\n\
mov r10, r0\n\
movs r6, 0\n\
ldr r1, =gBagPockets\n\
lsls r4, r2, 3\n\
adds r0, r4, r1\n\
mov r9, r4\n\
ldrb r0, [r0, 0x4]\n\
cmp r6, r0\n\
bcs _080D68BC\n\
subs r0, r2, 0x2\n\
lsls r0, 24\n\
lsrs r0, 24\n\
mov r10, r0\n\
_080D6878:\n\
adds r0, r4, r1\n\
ldr r1, [r0]\n\
lsls r0, r6, 2\n\
adds r1, r0, r1\n\
ldrh r0, [r1]\n\
cmp r0, r8\n\
bne _080D68AC\n\
adds r0, r1, 0x2\n\
str r2, [sp]\n\
bl GetBagItemQuantity\n\
lsls r0, 16\n\
lsrs r1, r0, 16\n\
adds r0, r1, r5\n\
ldr r2, [sp]\n\
cmp r0, r7\n\
ble _080D6914\n\
mov r0, r10\n\
cmp r0, 0x1\n\
bls _080D6906\n\
subs r0, r7, r1\n\
subs r0, r5, r0\n\
lsls r0, 16\n\
lsrs r5, r0, 16\n\
cmp r5, 0\n\
beq _080D6914\n\
adds r0, r4, r1\n\
ldr r1, [r0]\n\
lsls r0, r6, 2\n\
adds r1, r0, r1\n\
ldrh r0, [r1]\n\
cmp r0, r8\n\
bne _080D68AC\n\
adds r0, r1, 0x2\n\
str r2, [sp]\n\
bl GetBagItemQuantity\n\
lsls r0, 16\n\
lsrs r1, r0, 16\n\
adds r0, r1, r5\n\
ldr r2, [sp]\n\
cmp r0, r7\n\
ble _080D6914\n\
mov r0, r10\n\
cmp r0, 0x1\n\
bls _080D6906\n\
subs r0, r7, r1\n\
subs r0, r5, r0\n\
lsls r0, 16\n\
lsrs r5, r0, 16\n\
cmp r5, 0\n\
beq _080D6914\n\
_080D68AC:\n\
adds r0, r6, 0x1\n\
lsls r0, 24\n\
lsrs r6, r0, 24\n\
ldr r1, =gBagPockets\n\
adds r0, r4, r1\n\
ldrb r0, [r0, 0x4]\n\
cmp r6, r0\n\
bcc _080D6878\n\
adds r0, r6, 0x1\n\
lsls r0, 24\n\
lsrs r6, r0, 24\n\
ldr r1, =gBagPockets\n\
adds r0, r4, r1\n\
ldrb r0, [r0, 0x4]\n\
cmp r6, r0\n\
bcc _080D6878\n\
_080D68BC:\n\
cmp r5, 0\n\
beq _080D6914\n\
movs r6, 0\n\
ldr r3, =gBagPockets\n\
mov r1, r9\n\
adds r0, r1, r3\n\
ldrb r0, [r0, 0x4]\n\
cmp r6, r0\n\
bcs _080D6902\n\
adds r4, r3, 0\n\
subs r0, r2, 0x2\n\
lsls r0, 24\n\
lsrs r2, r0, 24\n\
cmp r5, 0\n\
beq _080D6914\n\
movs r6, 0\n\
ldr r3, =gBagPockets\n\
mov r1, r9\n\
adds r0, r1, r3\n\
ldrb r0, [r0, 0x4]\n\
cmp r6, r0\n\
bcs _080D6902\n\
adds r4, r3, 0\n\
subs r0, r2, 0x2\n\
lsls r0, 24\n\
lsrs r2, r0, 24\n\
_080D68D6:\n\
adds r0, r1, r4\n\
ldr r1, [r0]\n\
lsls r0, r6, 2\n\
adds r0, r1\n\
ldrh r0, [r0]\n\
cmp r0, 0\n\
bne _080D68F2\n\
cmp r5, r7\n\
bls _080D6914\n\
cmp r2, 0x1\n\
bls _080D6906\n\
subs r0, r5, r7\n\
lsls r0, 16\n\
lsrs r5, r0, 16\n\
adds r0, r1, r4\n\
ldr r1, [r0]\n\
lsls r0, r6, 2\n\
adds r0, r1\n\
ldrh r0, [r0]\n\
cmp r0, 0\n\
bne _080D68F2\n\
cmp r5, r7\n\
bls _080D6914\n\
cmp r2, 0x1\n\
bls _080D6906\n\
subs r0, r5, r7\n\
lsls r0, 16\n\
lsrs r5, r0, 16\n\
_080D68F2:\n\
adds r0, r6, 0x1\n\
lsls r0, 24\n\
lsrs r6, r0, 24\n\
mov r1, r9\n\
adds r0, r1, r3\n\
ldrb r0, [r0, 0x4]\n\
cmp r6, r0\n\
bcc _080D68D6\n\
adds r0, r6, 0x1\n\
lsls r0, 24\n\
lsrs r6, r0, 24\n\
mov r1, r9\n\
adds r0, r1, r3\n\
ldrb r0, [r0, 0x4]\n\
cmp r6, r0\n\
bcc _080D68D6\n\
_080D6902:\n\
cmp r5, 0\n\
beq _080D6914\n\
cmp r5, 0\n\
beq _080D6914\n\
_080D6906:\n\
movs r0, 0\n\
b _080D6916\n\
.pool\n\
movs r0, 0\n\
b _080D6916\n\
.pool\n\
_080D6914:\n\
movs r0, 0x1\n\
movs r0, 0x1\n\
_080D6916:\n\
add sp, 0x4\n\
pop {r3-r5}\n\
mov r8, r3\n\
mov r9, r4\n\
mov r10, r5\n\
pop {r4-r7}\n\
pop {r1}\n\
bx r1");
add sp, 0x4\n\
pop {r3-r5}\n\
mov r8, r3\n\
mov r9, r4\n\
mov r10, r5\n\
pop {r4-r7}\n\
pop {r1}\n\
bx r1");
}
#endif // NONMATCHING

View File

@ -161,7 +161,7 @@ u8 AddCustomItemIconSprite(struct SpriteTemplate *customSpriteTemplate, u16 tile
const void *GetItemIconPicOrPalette(u16 itemId, u8 which)
{
if (itemId == INVALID_U16)
if (itemId == 0xFFFF)
itemId = ITEM_FIELD_ARROW;
else if (itemId >= ITEMS_COUNT)
itemId = 0;

View File

@ -532,11 +532,11 @@ void GoToBagMenu(u8 bagMenuType, u8 pocketId, void ( *postExitMenuMainCallback2)
if (temp <= 1)
gUnknown_0203CE54->unk81B = 1;
gUnknown_0203CE54->unk0 = 0;
gUnknown_0203CE54->unk81A = INVALID_U8;
gUnknown_0203CE54->unk81A = 0xFF;
gUnknown_0203CE54->unk81E = -1;
gUnknown_0203CE54->unk81F = -1;
memset(gUnknown_0203CE54->unk804, INVALID_U8, sizeof(gUnknown_0203CE54->unk804));
memset(gUnknown_0203CE54->unk810, INVALID_U8, 10);
memset(gUnknown_0203CE54->unk804, 0xFF, sizeof(gUnknown_0203CE54->unk804));
memset(gUnknown_0203CE54->unk810, 0xFF, 10);
SetMainCallback2(CB2_Bag);
}
}
@ -819,7 +819,7 @@ void bag_menu_change_item_callback(s32 a, bool8 b, struct ListMenu *unused)
PlaySE(SE_SELECT);
ShakeBagVisual();
}
if (gUnknown_0203CE54->unk81A == INVALID_U8)
if (gUnknown_0203CE54->unk81A == 0xFF)
{
RemoveBagItemIconSprite(1 ^ gUnknown_0203CE54->unk81B_1);
if (a != -2)
@ -840,7 +840,7 @@ void sub_81AB520(u8 rboxId, int item_index_in_pocket, u8 a)
int offset;
if (item_index_in_pocket != -2)
{
if (gUnknown_0203CE54->unk81A != INVALID_U8)
if (gUnknown_0203CE54->unk81A != 0xFF)
{
if (gUnknown_0203CE54->unk81A == (u8)item_index_in_pocket)
bag_menu_print_cursor(a, 2);
@ -897,7 +897,7 @@ void bag_menu_print_cursor_(u8 a, u8 b)
void bag_menu_print_cursor(u8 a, u8 b)
{
if (b == INVALID_U8)
if (b == 0xFF)
FillWindowPixelRect(0, 0, 0, a, GetMenuCursorDimensionByFont(1, 0), GetMenuCursorDimensionByFont(1, 1));
else
bag_menu_print(0, 1, gText_SelectorArrow2, 0, a, 0, 0, 0, b);
@ -906,32 +906,32 @@ void bag_menu_print_cursor(u8 a, u8 b)
void bag_menu_add_pocket_scroll_arrow_indicators_maybe(void)
{
if (gUnknown_0203CE54->unk81E == INVALID_U8)
if (gUnknown_0203CE54->unk81E == 0xFF)
gUnknown_0203CE54->unk81E = AddScrollIndicatorArrowPairParameterized(SCROLL_ARROW_UP, 0xAC, 12, 0x94, gUnknown_0203CE54->unk829[gUnknown_0203CE58.pocket] - gUnknown_0203CE54->unk82E[gUnknown_0203CE58.pocket], 0x6E, 0x6E, &gUnknown_0203CE58.scrollPosition[gUnknown_0203CE58.pocket]);
}
void sub_81AB824(void)
{
if (gUnknown_0203CE54->unk81E != INVALID_U8)
if (gUnknown_0203CE54->unk81E != 0xFF)
{
RemoveScrollIndicatorArrowPair(gUnknown_0203CE54->unk81E);
gUnknown_0203CE54->unk81E = INVALID_U8;
gUnknown_0203CE54->unk81E = 0xFF;
}
sub_81AB89C();
}
void bag_menu_add_list_scroll_arrow_indicators_maybe(void)
{
if (gUnknown_0203CE54->unk81B != 1 && gUnknown_0203CE54->unk81F == INVALID_U8)
if (gUnknown_0203CE54->unk81B != 1 && gUnknown_0203CE54->unk81F == 0xFF)
gUnknown_0203CE54->unk81F = AddScrollIndicatorArrowPair(&gUnknown_08614094, &gUnknown_0203CE58.unk6);
}
void sub_81AB89C(void)
{
if (gUnknown_0203CE54->unk81F != INVALID_U8)
if (gUnknown_0203CE54->unk81F != 0xFF)
{
RemoveScrollIndicatorArrowPair(gUnknown_0203CE54->unk81F);
gUnknown_0203CE54->unk81F = INVALID_U8;
gUnknown_0203CE54->unk81F = 0xFF;
}
}
@ -2303,7 +2303,7 @@ u8 sub_81AE124(u8 a)
u8 bag_menu_add_window(u8 a)
{
u8 *ptr = &gUnknown_0203CE54->unk810[a];
if (*ptr == INVALID_U8)
if (*ptr == 0xFF)
{
*ptr = AddWindow(&gUnknown_086141AC[a]);
SetWindowBorderStyle(*ptr, 0, 1, 14);
@ -2315,20 +2315,20 @@ u8 bag_menu_add_window(u8 a)
void bag_menu_remove_window(u8 a)
{
u8 *ptr = &gUnknown_0203CE54->unk810[a];
if (*ptr != INVALID_U8)
if (*ptr != 0xFF)
{
sub_8198070(*ptr, 0);
ClearWindowTilemap(*ptr);
RemoveWindow(*ptr);
schedule_bg_copy_tilemap_to_vram(1);
*ptr = INVALID_U8;
*ptr = 0xFF;
}
}
u8 AddItemMessageWindow(u8 a)
{
u8 *ptr = &gUnknown_0203CE54->unk810[a];
if (*ptr == INVALID_U8)
if (*ptr == 0xFF)
*ptr = AddWindow(&gUnknown_086141AC[a]);
return *ptr;
}
@ -2336,13 +2336,13 @@ u8 AddItemMessageWindow(u8 a)
void bag_menu_RemoveBagItem_message_window(u8 a)
{
u8 *ptr = &gUnknown_0203CE54->unk810[a];
if (*ptr != INVALID_U8)
if (*ptr != 0xFF)
{
sub_8197DF8(*ptr, 0);
ClearWindowTilemap(*ptr);
RemoveWindow(*ptr);
schedule_bg_copy_tilemap_to_vram(1);
*ptr = INVALID_U8;
*ptr = 0xFF;
}
}

View File

@ -301,7 +301,7 @@ static const union AffineAnimCmd *const sSpriteAffineAnimTable_857FC74[] =
static const struct SpriteTemplate gUnknown_0857FC7C =
{
.tileTag = INVALID_U16,
.tileTag = 0xFFFF,
.paletteTag = 0x7544,
.oam = &sOamData_857FBD0,
.anims = sSpriteAnimTable_857FBE0,
@ -410,13 +410,13 @@ static const struct SpriteTemplate gUnknown_0857FE10 =
void RemoveBagSprite(u8 id)
{
u8 *spriteId = &gUnknown_0203CE54->unk804[id];
if (*spriteId != INVALID_U8)
if (*spriteId != 0xFF)
{
FreeSpriteTilesByTag(id + 100);
FreeSpritePaletteByTag(id + 100);
FreeSpriteOamMatrix(&gSprites[*spriteId]);
DestroySprite(&gSprites[*spriteId]);
*spriteId = INVALID_U8;
*spriteId = 0xFF;
}
}
@ -516,7 +516,7 @@ static void SpriteCB_SwitchPocketRotatingBallContinue(struct Sprite *sprite)
void AddBagItemIconSprite(u16 itemId, u8 id)
{
u8 *spriteId = &gUnknown_0203CE54->unk804[id + 2];
if (*spriteId == INVALID_U8)
if (*spriteId == 0xFF)
{
u8 iconSpriteId;

View File

@ -338,8 +338,8 @@ static const struct Landmark *const Landmarks_MtChimney_2[] =
static const struct LandmarkList gLandmarkLists[] =
{
{MAPSEC_ROUTE_103, 2, Landmarks_Route103_2},
{MAPSEC_ROUTE_104, 0, Landmarks_Route104_0},
{MAPSEC_ROUTE_103, 2, Landmarks_Route103_2},
{MAPSEC_ROUTE_104, 0, Landmarks_Route104_0},
{MAPSEC_ROUTE_104, 1, Landmarks_Route104_1},
{MAPSEC_ROUTE_105, 0, Landmarks_Route105_0},
{MAPSEC_ROUTE_106, 1, Landmarks_Route106_1},

View File

@ -381,7 +381,7 @@ static void LearnMoveMain(void)
if (selection == 0)
{
if (GiveMoveToMon(&gPlayerParty[sLearnMoveStruct->partyMon], GetCurrentItemId()) != INVALID_U16)
if (GiveMoveToMon(&gPlayerParty[sLearnMoveStruct->partyMon], GetCurrentItemId()) != 0xFFFF)
{
sub_816084C(gText_PkmnLearnedMove4);
gSpecialVar_0x8004 = 1;
@ -727,12 +727,12 @@ static void CreateHearts(void)
static void AddScrollArrows(void)
{
if (sLearnMoveStruct->scrollArrowTaskId2 == INVALID_U8)
if (sLearnMoveStruct->scrollArrowTaskId2 == 0xFF)
{
sLearnMoveStruct->scrollArrowTaskId2 = AddScrollIndicatorArrowPair(&gUnknown_085CEBC0, &sLearnMoveStruct->scrollOffset);
}
if (sLearnMoveStruct->scrollArrowTaskId1 == INVALID_U8)
if (sLearnMoveStruct->scrollArrowTaskId1 == 0xFF)
{
gTempScrollArrowTemplate = gUnknown_085CEBD0;
gTempScrollArrowTemplate.fullyDownThreshold = sLearnMoveStruct->numMenuChoices - sLearnMoveStruct->numToShowAtOnce;
@ -742,16 +742,16 @@ static void AddScrollArrows(void)
static void RemoveScrollArrows(void)
{
if (sLearnMoveStruct->scrollArrowTaskId2 != INVALID_U8)
if (sLearnMoveStruct->scrollArrowTaskId2 != 0xFF)
{
RemoveScrollIndicatorArrowPair(sLearnMoveStruct->scrollArrowTaskId2);
sLearnMoveStruct->scrollArrowTaskId2 = INVALID_U8;
sLearnMoveStruct->scrollArrowTaskId2 = 0xFF;
}
if (sLearnMoveStruct->scrollArrowTaskId1 != INVALID_U8)
if (sLearnMoveStruct->scrollArrowTaskId1 != 0xFF)
{
RemoveScrollIndicatorArrowPair(sLearnMoveStruct->scrollArrowTaskId1);
sLearnMoveStruct->scrollArrowTaskId1 = INVALID_U8;
sLearnMoveStruct->scrollArrowTaskId1 = 0xFF;
}
}
@ -792,7 +792,7 @@ void ShowHideHearts(s32 item)
{
numHearts = (u8)(gContestEffects[gContestMoves[item].effect].appeal / 10);
if (numHearts == INVALID_U8)
if (numHearts == 0xFF)
{
numHearts = 0;
}
@ -812,7 +812,7 @@ void ShowHideHearts(s32 item)
numHearts = (u8)(gContestEffects[gContestMoves[item].effect].jam / 10);
if (numHearts == INVALID_U8)
if (numHearts == 0xFF)
{
numHearts = 0;
}

View File

@ -64,7 +64,7 @@
v12 = (u16*)((u32)&sub_82E53F4 & ~1);
v13 = (u16*)gUnknown_03007898->unk_8;
for (i = 47; i != INVALID_U16; i--)
for (i = 47; i != 0xFFFF; i--)
{
*v13 = *v12;
++v12;

View File

@ -116,7 +116,7 @@ u16 STWI_read_status(u8 index)
case 3:
return gRfuState->activeCommand;
default:
return INVALID_U16;
return 0xFFFF;
}
}

View File

@ -2250,7 +2250,7 @@ static bool8 DoHandshake(void)
u16 minRecv;
playerCount = 0;
minRecv = INVALID_U16;
minRecv = 0xFFFF;
if (gLink.handshakeAsMaster == TRUE)
{
REG_SIOMLT_SEND = MASTER_HANDSHAKE;
@ -2274,7 +2274,7 @@ static bool8 DoHandshake(void)
}
else
{
if (gLink.tempRecvBuffer[i] != INVALID_U16)
if (gLink.tempRecvBuffer[i] != 0xFFFF)
{
playerCount = 0;
}

View File

@ -276,7 +276,7 @@ const struct {
{ gBlockSendBuffer, 40 }
};
const u16 gUnknown_082ED6E0[] = {
0x0002, 0x7f7d, 0x0000, INVALID_U16
0x0002, 0x7f7d, 0x0000, 0xFFFF
};
const char sUnref_082ED6E8[][15] = {
@ -436,7 +436,7 @@ u8 sub_800C054(u8 r5, u16 r7, u16 r8, const u16 *r6)
}
for (i = 0, buffer = r6; i < 16; i++)
{
if (*buffer++ == INVALID_U16)
if (*buffer++ == 0xFFFF)
{
break;
}
@ -754,7 +754,7 @@ void sub_800C54C(u32 a0)
switch (gUnknown_03004140.unk_04)
{
case 23:
r2 = sub_800BEC0() == 0x8001 ? 0x44 : INVALID_U8;
r2 = sub_800BEC0() == 0x8001 ? 0x44 : 0xFF;
gUnknown_03004140.unk_04 = gUnknown_03004140.unk_05 = 0;
sub_800D30C(r2, 0);
break;
@ -1168,7 +1168,7 @@ static void sub_800C7B4(u16 r8, u16 r6)
gUnknown_03004140.unk_00 &= ~gUnknown_03004140.unk_14;
if (gUnknown_03004140.unk_07)
{
if (gUnknown_03007890->unk_00 == INVALID_U8)
if (gUnknown_03007890->unk_00 == 0xFF)
{
if (gUnknown_03004140.unk_07 == 8)
{
@ -1183,7 +1183,7 @@ static void sub_800C7B4(u16 r8, u16 r6)
}
}
}
if (gUnknown_03007890->unk_00 == INVALID_U8)
if (gUnknown_03007890->unk_00 == 0xFF)
{
if (gUnknown_03004140.unk_04 == 0)
{
@ -1198,7 +1198,7 @@ static void sub_800C7B4(u16 r8, u16 r6)
break;
case 38:
sub_800D20C();
if (gUnknown_03007890->unk_00 != INVALID_U8)
if (gUnknown_03007890->unk_00 != 0xFF)
{
sub_800D30C(0x50, 0x00);
}
@ -1241,7 +1241,7 @@ static void sub_800C7B4(u16 r8, u16 r6)
sub_800D610();
}
}
if (r8 == INVALID_U8)
if (r8 == 0xFF)
{
sub_800D30C(0xf2, 0x00);
sub_800D610();
@ -1322,7 +1322,7 @@ static void sub_800CF34(void)
if (gUnknown_03007880[i]->unk_61 == 1)
{
r5 = 0x02;
for (ptr = gUnknown_03004140.unk_20; *ptr != INVALID_U16; ptr++)
for (ptr = gUnknown_03004140.unk_20; *ptr != 0xFFFF; ptr++)
{
if (gUnknown_03007890->unk_14[i].unk_04 == *ptr)
{
@ -1469,7 +1469,7 @@ static u8 sub_800D294(void)
for (i = 0; i < gUnknown_03007890->unk_08; i++)
{
for (ptr = gUnknown_03004140.unk_20; *ptr != INVALID_U16; ptr++)
for (ptr = gUnknown_03004140.unk_20; *ptr != 0xFFFF; ptr++)
{
if (gUnknown_03007890->unk_14[i].unk_04 == *ptr)
{
@ -2242,12 +2242,12 @@ void sub_800E084(void)
void sub_800E0E8(void)
{
if (GetSpriteTileStartByTag(sWirelessStatusIndicatorSpriteSheet.tag) == INVALID_U16)
if (GetSpriteTileStartByTag(sWirelessStatusIndicatorSpriteSheet.tag) == 0xFFFF)
{
LoadCompressedObjectPic(&sWirelessStatusIndicatorSpriteSheet);
}
LoadSpritePalette(&sWirelessStatusIndicatorSpritePalette);
gWirelessStatusIndicatorSpriteId = INVALID_U8;
gWirelessStatusIndicatorSpriteId = 0xFF;
}
u8 sub_800E124(void)
@ -2277,7 +2277,7 @@ void sub_800E15C(struct Sprite *sprite, s32 signalStrengthAnimNum)
void sub_800E174(void)
{
if (gWirelessStatusIndicatorSpriteId != INVALID_U8 && gSprites[gWirelessStatusIndicatorSpriteId].data[7] == 0x1234)
if (gWirelessStatusIndicatorSpriteId != 0xFF && gSprites[gWirelessStatusIndicatorSpriteId].data[7] == 0x1234)
{
struct Sprite *sprite = &gSprites[gWirelessStatusIndicatorSpriteId];
u8 signalStrength = 255;
@ -2461,7 +2461,7 @@ void sub_800E604(void)
u8 unk_ee_bak = gUnknown_03005000.unk_ee;
CpuFill16(0, &gUnknown_03005000, sizeof gUnknown_03005000);
gUnknown_03005000.unk_ee = unk_ee_bak;
gUnknown_03005000.unk_0c = INVALID_U8;
gUnknown_03005000.unk_0c = 0xFF;
if (gUnknown_03005000.unk_ee != 4)
{
gUnknown_03005000.unk_ee = 0;
@ -3077,7 +3077,7 @@ bool32 sub_800F1E0(void)
{
if (gUnknown_03005000.unk_14[i][1])
{
if (gUnknown_03005000.unk_cee[i] != INVALID_U8 && (gUnknown_03005000.unk_14[i][0] >> 5) != ((gUnknown_03005000.unk_cee[i] + 1) & 7))
if (gUnknown_03005000.unk_cee[i] != 0xFF && (gUnknown_03005000.unk_14[i][0] >> 5) != ((gUnknown_03005000.unk_cee[i] + 1) & 7))
{
if (++gUnknown_03005000.unk_cea[i] > 4)
sub_8011170(0x8100);
@ -3778,7 +3778,7 @@ bool32 sub_8010454(u32 a0)
s32 i;
for (i = 0; gUnknown_082ED6E0[i] != a0; i++)
{
if (gUnknown_082ED6E0[i] == INVALID_U16)
if (gUnknown_082ED6E0[i] == 0xFFFF)
return FALSE;
}
return TRUE;
@ -3881,7 +3881,7 @@ bool32 sub_80105EC(void)
bool32 sub_801064C(u16 a0, const u8 *a1)
{
u8 r1 = sub_8011CE4(a1, a0);
if (r1 == INVALID_U8)
if (r1 == 0xFF)
return TRUE;
if (gUnknown_03005000.unk_cd1[r1] == 9)
return TRUE;
@ -3906,7 +3906,7 @@ void sub_80106D4(void)
u32 sub_8010714(u16 a0, const u8 *a1)
{
u8 r0 = sub_8011CE4(a1, a0);
if (r0 == INVALID_U8)
if (r0 == 0xFF)
return 2;
if (gUnknown_03007880[r0]->unk_0 == 0)
return 1;

View File

@ -392,7 +392,7 @@ u8 ListMenuInitInRect(struct ListMenuTemplate *listMenuTemplate, struct ListMenu
s32 i;
u8 taskId = ListMenuInitInternal(listMenuTemplate, scrollOffset, selectedRow);
for (i = 0; rect[i].palNum != INVALID_U8; i++)
for (i = 0; rect[i].palNum != 0xFF; i++)
{
PutWindowRectTilemapOverridePalette(listMenuTemplate->windowId,
rect[i].x,
@ -465,7 +465,7 @@ s32 ListMenuHandleInputGetItemId(u8 listTaskId)
}
}
#define TASK_NONE INVALID_U8
#define TASK_NONE 0xFF
void DestroyListMenuTask(u8 listTaskId, u16 *scrollOffset, u16 *selectedRow)
{
@ -953,52 +953,52 @@ void ListMenuSetUnkIndicatorsStructField(u8 taskId, u8 field, s32 value)
case 0:
case 1:
data->field_4 = (void*)(value);
break;
break;
case 2:
data->field_C = value;
break;
break;
case 3:
data->field_E = value;
break;
break;
case 4:
data->field_10 = value;
break;
break;
case 5:
data->field_11 = value;
break;
break;
case 6:
data->field_12 = value;
break;
break;
case 7:
data->field_13 = value;
break;
break;
case 8:
data->field_14_0 = value;
break;
break;
case 9:
data->field_14_1 = value;
break;
break;
case 10:
data->field_15_0 = value;
break;
break;
case 11:
data->field_15_1 = value;
break;
break;
case 12:
data->field_16_0 = value;
break;
break;
case 13:
data->field_16_1 = value;
break;
break;
case 14:
data->field_16_2 = value;
break;
break;
case 15:
data->field_17_0 = value;
break;
break;
case 16:
data->field_17_1 = value;
break;
break;
}
}
@ -1143,7 +1143,7 @@ static void Task_ScrollIndicatorArrowPair(u8 taskId)
struct ScrollIndicatorPair *data = (void*) gTasks[taskId].data;
u16 currItem = (*data->scrollOffset);
if (currItem == data->fullyUpThreshold && currItem != INVALID_U16)
if (currItem == data->fullyUpThreshold && currItem != 0xFFFF)
gSprites[data->topSpriteId].invisible = TRUE;
else
gSprites[data->topSpriteId].invisible = FALSE;

View File

@ -20,7 +20,7 @@ void ClearMailStruct(struct MailStruct *mail)
s32 i;
for (i = 0; i < MAIL_WORDS_COUNT; i++)
mail->words[i] = INVALID_U16;
mail->words[i] = 0xFFFF;
for (i = 0; i < PLAYER_NAME_LENGTH + 1; i++)
mail->playerName[i] = EOS;
@ -35,7 +35,7 @@ void ClearMailStruct(struct MailStruct *mail)
bool8 MonHasMail(struct Pokemon *mon)
{
u16 heldItem = GetMonData(mon, MON_DATA_HELD_ITEM);
if (ItemIsMail(heldItem) && GetMonData(mon, MON_DATA_MAIL) != INVALID_U8)
if (ItemIsMail(heldItem) && GetMonData(mon, MON_DATA_MAIL) != 0xFF)
return TRUE;
else
return FALSE;
@ -56,7 +56,7 @@ u8 GiveMailToMon(struct Pokemon *mon, u16 itemId)
if (gSaveBlock1Ptr->mail[id].itemId == 0)
{
for (i = 0; i < MAIL_WORDS_COUNT; i++)
gSaveBlock1Ptr->mail[id].words[i] = INVALID_U16;
gSaveBlock1Ptr->mail[id].words[i] = 0xFFFF;
for (i = 0; i < PLAYER_NAME_LENGTH + 1 - 1; i++)
gSaveBlock1Ptr->mail[id].playerName[i] = gSaveBlock2Ptr->playerName[i];
@ -76,7 +76,7 @@ u8 GiveMailToMon(struct Pokemon *mon, u16 itemId)
}
}
return INVALID_U8;
return 0xFF;
}
u16 SpeciesToMailSpecies(u16 species, u32 personality)
@ -113,8 +113,8 @@ u8 GiveMailToMon2(struct Pokemon *mon, struct MailStruct *mail)
u16 itemId = mail->itemId;
u8 mailId = GiveMailToMon(mon, itemId);
if (mailId == INVALID_U8)
return INVALID_U8;
if (mailId == 0xFF)
return 0xFF;
gSaveBlock1Ptr->mail[mailId] = *mail;
@ -142,7 +142,7 @@ void TakeMailFromMon(struct Pokemon *mon)
{
mailId = GetMonData(mon, MON_DATA_MAIL);
gSaveBlock1Ptr->mail[mailId].itemId = ITEM_NONE;
mailId = INVALID_U8;
mailId = 0xFF;
heldItem[0] = ITEM_NONE;
heldItem[1] = ITEM_NONE << 8;
SetMonData(mon, MON_DATA_MAIL, &mailId);
@ -163,7 +163,7 @@ u8 TakeMailFromMon2(struct Pokemon *mon)
newHeldItem[0] = ITEM_NONE;
newHeldItem[1] = ITEM_NONE << 8;
newMailId = INVALID_U8;
newMailId = 0xFF;
for (i = PARTY_SIZE; i < MAIL_COUNT; i++)
{
@ -177,7 +177,7 @@ u8 TakeMailFromMon2(struct Pokemon *mon)
}
}
return INVALID_U8;
return 0xFF;
}
bool8 ItemIsMail(u16 itemId)

View File

@ -335,25 +335,25 @@ static const struct MenuAction sMenuActions_Gender[] = {
static const u8 *const gMalePresetNames[] = {
gText_DefaultNameStu,
gText_DefaultNameMilton,
gText_DefaultNameTom,
gText_DefaultNameKenny,
gText_DefaultNameReid,
gText_DefaultNameJude,
gText_DefaultNameJaxson,
gText_DefaultNameEaston,
gText_DefaultNameWalker,
gText_DefaultNameTeru,
gText_DefaultNameJohnny,
gText_DefaultNameBrett,
gText_DefaultNameSeth,
gText_DefaultNameTerry,
gText_DefaultNameCasey,
gText_DefaultNameDarren,
gText_DefaultNameLandon,
gText_DefaultNameCollin,
gText_DefaultNameStanley,
gText_DefaultNameQuincy
gText_DefaultNameMilton,
gText_DefaultNameTom,
gText_DefaultNameKenny,
gText_DefaultNameReid,
gText_DefaultNameJude,
gText_DefaultNameJaxson,
gText_DefaultNameEaston,
gText_DefaultNameWalker,
gText_DefaultNameTeru,
gText_DefaultNameJohnny,
gText_DefaultNameBrett,
gText_DefaultNameSeth,
gText_DefaultNameTerry,
gText_DefaultNameCasey,
gText_DefaultNameDarren,
gText_DefaultNameLandon,
gText_DefaultNameCollin,
gText_DefaultNameStanley,
gText_DefaultNameQuincy
};
static const u8 *const gFemalePresetNames[] = {

View File

@ -250,7 +250,7 @@ void ScrSpecial_HipsterTeachWord(void)
{
u16 var = sub_811F01C();
if (var == INVALID_U16)
if (var == 0xFFFF)
{
gSpecialVar_Result = FALSE;
}
@ -283,7 +283,7 @@ void ScrSpecial_GenerateGiddyLine(void)
if (giddy->taleCounter == 0)
InitGiddyTaleList();
if (giddy->randomWords[giddy->taleCounter] != INVALID_U16) // is not the last element of the array?
if (giddy->randomWords[giddy->taleCounter] != 0xFFFF) // is not the last element of the array?
{
u8 *stringPtr;
u32 adjective = Random();
@ -348,7 +348,7 @@ static void InitGiddyTaleList(void)
r1 = Random() % 10;
if (r1 < 3 && r7 < 8)
{
giddy->randomWords[i] = INVALID_U16;
giddy->randomWords[i] = 0xFFFF;
r7++;
}
else

View File

@ -140,8 +140,8 @@ extern void task_free_buf_after_copying_tile_data_to_vram(u8 taskId);
void sub_81971D0(void)
{
InitWindows(gUnknown_0860F098);
gStartMenuWindowId = INVALID_U8;
gUnknown_0203CD8D = INVALID_U8;
gStartMenuWindowId = 0xFF;
gUnknown_0203CD8D = 0xFF;
}
void sub_81971F4(void)
@ -486,7 +486,7 @@ u8 GetPlayerTextSpeedDelay(void)
u8 sub_81979C4(u8 a1)
{
if (gStartMenuWindowId == INVALID_U8)
if (gStartMenuWindowId == 0xFF)
gStartMenuWindowId = sub_8198AA4(0, 0x16, 1, 7, (a1 * 2) + 2, 0xF, 0x139);
return gStartMenuWindowId;
}
@ -498,10 +498,10 @@ u8 GetStartMenuWindowId(void)
void RemoveStartMenuWindow(void)
{
if (gStartMenuWindowId != INVALID_U8)
if (gStartMenuWindowId != 0xFF)
{
RemoveWindow(gStartMenuWindowId);
gStartMenuWindowId = INVALID_U8;
gStartMenuWindowId = 0xFF;
}
}
@ -517,7 +517,7 @@ u16 sub_8197A38(void)
u8 AddMapNamePopUpWindow(void)
{
if (gUnknown_0203CD8D == INVALID_U8)
if (gUnknown_0203CD8D == 0xFF)
gUnknown_0203CD8D = sub_8198AA4(0, 1, 1, 10, 3, 14, 0x107);
return gUnknown_0203CD8D;
}
@ -529,10 +529,10 @@ u8 GetMapNamePopUpWindowId(void)
void RemoveMapNamePopUpWindow(void)
{
if (gUnknown_0203CD8D != INVALID_U8)
if (gUnknown_0203CD8D != 0xFF)
{
RemoveWindow(gUnknown_0203CD8D);
gUnknown_0203CD8D = INVALID_U8;
gUnknown_0203CD8D = 0xFF;
}
}
@ -808,7 +808,7 @@ void sub_8198180(const u8 *string, u8 a2, bool8 copyToVram)
{
u16 width = 0;
if (gUnknown_0203CDA0 != INVALID_U8)
if (gUnknown_0203CDA0 != 0xFF)
{
PutWindowTilemap(gUnknown_0203CDA0);
FillWindowPixelBuffer(gUnknown_0203CDA0, 0xFF);
@ -830,7 +830,7 @@ void sub_8198204(const u8 *string, const u8 *string2, u8 a3, u8 a4, bool8 copyTo
u8 color[3];
u16 width = 0;
if (gUnknown_0203CDA0 != INVALID_U8)
if (gUnknown_0203CDA0 != 0xFF)
{
if (a3 != 0)
{
@ -865,13 +865,13 @@ void sub_8198204(const u8 *string, const u8 *string2, u8 a3, u8 a4, bool8 copyTo
void sub_81982D8(void)
{
if (gUnknown_0203CDA0 != INVALID_U8)
if (gUnknown_0203CDA0 != 0xFF)
CopyWindowToVram(gUnknown_0203CDA0, 3);
}
void sub_81982F0(void)
{
if (gUnknown_0203CDA0 != INVALID_U8)
if (gUnknown_0203CDA0 != 0xFF)
{
FillWindowPixelBuffer(gUnknown_0203CDA0, 0xFF);
CopyWindowToVram(gUnknown_0203CDA0, 3);
@ -880,13 +880,13 @@ void sub_81982F0(void)
void sub_8198314(void)
{
if (gUnknown_0203CDA0 != INVALID_U8)
if (gUnknown_0203CDA0 != 0xFF)
{
FillWindowPixelBuffer(gUnknown_0203CDA0, 0);
ClearWindowTilemap(gUnknown_0203CDA0);
CopyWindowToVram(gUnknown_0203CDA0, 3);
RemoveWindow(gUnknown_0203CDA0);
gUnknown_0203CDA0 = INVALID_U8;
gUnknown_0203CDA0 = 0xFF;
}
}
@ -2096,253 +2096,253 @@ void sub_819A080(struct UnkStruct_819A080 *a0, struct UnkStruct_819A080 *a1, u16
NAKED
void sub_819A080(struct UnkStruct_819A080 *a0, struct UnkStruct_819A080 *a1, u16 a2, u16 a3, u16 a4, u16 a5, u16 a6, u16 a7)
{
asm("push {r4-r7,lr}\n\
mov r7, r10\n\
mov r6, r9\n\
mov r5, r8\n\
push {r5-r7}\n\
sub sp, #0x28\n\
str r0, [sp]\n\
str r1, [sp, #0x4]\n\
ldr r0, [sp, #0x48]\n\
ldr r4, [sp, #0x4C]\n\
ldr r1, [sp, #0x50]\n\
ldr r5, [sp, #0x54]\n\
lsl r2, #16\n\
lsr r2, #16\n\
str r2, [sp, #0x8]\n\
lsl r3, #16\n\
lsr r3, #16\n\
lsl r0, #16\n\
lsr r0, #16\n\
str r0, [sp, #0xC]\n\
lsl r4, #16\n\
lsr r4, #16\n\
lsl r1, #16\n\
lsr r1, #16\n\
lsl r5, #16\n\
lsr r5, #16\n\
ldr r2, [sp, #0x4]\n\
ldrh r0, [r2, #0x4]\n\
ldr r2, [sp, #0xC]\n\
sub r0, r2\n\
ldr r2, [sp, #0x8]\n\
add r2, r1, r2\n\
str r2, [sp, #0x10]\n\
cmp r0, r1\n\
bge _0819A0CC\n\
ldr r1, [sp, #0x8]\n\
add r0, r1\n\
str r0, [sp, #0x10]\n\
asm("push {r4-r7,lr}\n\
mov r7, r10\n\
mov r6, r9\n\
mov r5, r8\n\
push {r5-r7}\n\
sub sp, #0x28\n\
str r0, [sp]\n\
str r1, [sp, #0x4]\n\
ldr r0, [sp, #0x48]\n\
ldr r4, [sp, #0x4C]\n\
ldr r1, [sp, #0x50]\n\
ldr r5, [sp, #0x54]\n\
lsl r2, #16\n\
lsr r2, #16\n\
str r2, [sp, #0x8]\n\
lsl r3, #16\n\
lsr r3, #16\n\
lsl r0, #16\n\
lsr r0, #16\n\
str r0, [sp, #0xC]\n\
lsl r4, #16\n\
lsr r4, #16\n\
lsl r1, #16\n\
lsr r1, #16\n\
lsl r5, #16\n\
lsr r5, #16\n\
ldr r2, [sp, #0x4]\n\
ldrh r0, [r2, #0x4]\n\
ldr r2, [sp, #0xC]\n\
sub r0, r2\n\
ldr r2, [sp, #0x8]\n\
add r2, r1, r2\n\
str r2, [sp, #0x10]\n\
cmp r0, r1\n\
bge _0819A0CC\n\
ldr r1, [sp, #0x8]\n\
add r0, r1\n\
str r0, [sp, #0x10]\n\
_0819A0CC:\n\
ldr r2, [sp, #0x4]\n\
ldrh r1, [r2, #0x6]\n\
sub r0, r1, r4\n\
cmp r0, r5\n\
bge _0819A0DE\n\
add r0, r3, r1\n\
sub r0, r4\n\
str r0, [sp, #0x14]\n\
b _0819A0E2\n\
ldr r2, [sp, #0x4]\n\
ldrh r1, [r2, #0x6]\n\
sub r0, r1, r4\n\
cmp r0, r5\n\
bge _0819A0DE\n\
add r0, r3, r1\n\
sub r0, r4\n\
str r0, [sp, #0x14]\n\
b _0819A0E2\n\
_0819A0DE:\n\
add r5, r3, r5\n\
str r5, [sp, #0x14]\n\
add r5, r3, r5\n\
str r5, [sp, #0x14]\n\
_0819A0E2:\n\
ldr r0, [sp]\n\
ldrh r1, [r0, #0x4]\n\
mov r2, #0x7\n\
add r0, r1, #0\n\
and r0, r2\n\
add r1, r0\n\
asr r1, #3\n\
str r1, [sp, #0x18]\n\
ldr r0, [sp, #0x4]\n\
ldrh r1, [r0, #0x4]\n\
add r0, r1, #0\n\
and r0, r2\n\
add r1, r0\n\
asr r1, #3\n\
str r1, [sp, #0x1C]\n\
mov r12, r3\n\
mov r8, r4\n\
ldr r1, [sp, #0x14]\n\
cmp r12, r1\n\
blt _0819A10C\n\
b _0819A24A\n\
ldr r0, [sp]\n\
ldrh r1, [r0, #0x4]\n\
mov r2, #0x7\n\
add r0, r1, #0\n\
and r0, r2\n\
add r1, r0\n\
asr r1, #3\n\
str r1, [sp, #0x18]\n\
ldr r0, [sp, #0x4]\n\
ldrh r1, [r0, #0x4]\n\
add r0, r1, #0\n\
and r0, r2\n\
add r1, r0\n\
asr r1, #3\n\
str r1, [sp, #0x1C]\n\
mov r12, r3\n\
mov r8, r4\n\
ldr r1, [sp, #0x14]\n\
cmp r12, r1\n\
blt _0819A10C\n\
b _0819A24A\n\
_0819A10C:\n\
ldr r5, [sp, #0x8]\n\
ldr r6, [sp, #0xC]\n\
mov r2, r12\n\
add r2, #0x1\n\
str r2, [sp, #0x20]\n\
mov r0, r8\n\
add r0, #0x1\n\
str r0, [sp, #0x24]\n\
ldr r1, [sp, #0x10]\n\
cmp r5, r1\n\
blt _0819A124\n\
b _0819A23A\n\
ldr r5, [sp, #0x8]\n\
ldr r6, [sp, #0xC]\n\
mov r2, r12\n\
add r2, #0x1\n\
str r2, [sp, #0x20]\n\
mov r0, r8\n\
add r0, #0x1\n\
str r0, [sp, #0x24]\n\
ldr r1, [sp, #0x10]\n\
cmp r5, r1\n\
blt _0819A124\n\
b _0819A23A\n\
_0819A124:\n\
mov r7, #0x1\n\
mov r2, #0xF0\n\
mov r10, r2\n\
mov r0, #0xF\n\
mov r9, r0\n\
mov r7, #0x1\n\
mov r2, #0xF0\n\
mov r10, r2\n\
mov r0, #0xF\n\
mov r9, r0\n\
_0819A12E:\n\
asr r0, r5, #1\n\
mov r1, #0x3\n\
and r0, r1\n\
ldr r2, [sp]\n\
ldr r1, [r2]\n\
add r1, r0\n\
asr r0, r5, #3\n\
lsl r0, #5\n\
add r1, r0\n\
mov r2, r12\n\
asr r0, r2, #3\n\
ldr r2, [sp, #0x18]\n\
mul r0, r2\n\
lsl r0, #5\n\
add r1, r0\n\
mov r2, r12\n\
lsl r0, r2, #29\n\
lsr r0, #27\n\
add r3, r1, r0\n\
asr r0, r6, #1\n\
mov r1, #0x3\n\
and r0, r1\n\
ldr r2, [sp, #0x4]\n\
ldr r1, [r2]\n\
add r1, r0\n\
asr r0, r6, #3\n\
lsl r0, #5\n\
add r1, r0\n\
mov r2, r8\n\
asr r0, r2, #3\n\
ldr r2, [sp, #0x1C]\n\
mul r0, r2\n\
lsl r0, #5\n\
add r1, r0\n\
mov r2, r8\n\
lsl r0, r2, #29\n\
lsr r0, #27\n\
add r4, r1, r0\n\
add r0, r4, #0\n\
and r0, r7\n\
cmp r0, #0\n\
beq _0819A1DA\n\
sub r4, #0x1\n\
add r0, r6, #0\n\
and r0, r7\n\
cmp r0, #0\n\
beq _0819A1B2\n\
ldrh r0, [r4]\n\
ldr r2, =0x00000fff\n\
and r2, r0\n\
add r0, r5, #0\n\
and r0, r7\n\
cmp r0, #0\n\
beq _0819A1A8\n\
ldrb r1, [r3]\n\
mov r0, r10\n\
and r0, r1\n\
lsl r0, #8\n\
b _0819A22A\n\
.pool\n\
asr r0, r5, #1\n\
mov r1, #0x3\n\
and r0, r1\n\
ldr r2, [sp]\n\
ldr r1, [r2]\n\
add r1, r0\n\
asr r0, r5, #3\n\
lsl r0, #5\n\
add r1, r0\n\
mov r2, r12\n\
asr r0, r2, #3\n\
ldr r2, [sp, #0x18]\n\
mul r0, r2\n\
lsl r0, #5\n\
add r1, r0\n\
mov r2, r12\n\
lsl r0, r2, #29\n\
lsr r0, #27\n\
add r3, r1, r0\n\
asr r0, r6, #1\n\
mov r1, #0x3\n\
and r0, r1\n\
ldr r2, [sp, #0x4]\n\
ldr r1, [r2]\n\
add r1, r0\n\
asr r0, r6, #3\n\
lsl r0, #5\n\
add r1, r0\n\
mov r2, r8\n\
asr r0, r2, #3\n\
ldr r2, [sp, #0x1C]\n\
mul r0, r2\n\
lsl r0, #5\n\
add r1, r0\n\
mov r2, r8\n\
lsl r0, r2, #29\n\
lsr r0, #27\n\
add r4, r1, r0\n\
add r0, r4, #0\n\
and r0, r7\n\
cmp r0, #0\n\
beq _0819A1DA\n\
sub r4, #0x1\n\
add r0, r6, #0\n\
and r0, r7\n\
cmp r0, #0\n\
beq _0819A1B2\n\
ldrh r0, [r4]\n\
ldr r2, =0x00000fff\n\
and r2, r0\n\
add r0, r5, #0\n\
and r0, r7\n\
cmp r0, #0\n\
beq _0819A1A8\n\
ldrb r1, [r3]\n\
mov r0, r10\n\
and r0, r1\n\
lsl r0, #8\n\
b _0819A22A\n\
.pool\n\
_0819A1A8:\n\
ldrb r1, [r3]\n\
mov r0, r9\n\
and r0, r1\n\
lsl r0, #12\n\
b _0819A22A\n\
ldrb r1, [r3]\n\
mov r0, r9\n\
and r0, r1\n\
lsl r0, #12\n\
b _0819A22A\n\
_0819A1B2:\n\
ldrh r0, [r4]\n\
ldr r2, =0x0000f0ff\n\
and r2, r0\n\
add r0, r5, #0\n\
and r0, r7\n\
cmp r0, #0\n\
beq _0819A1D0\n\
ldrb r1, [r3]\n\
mov r0, r10\n\
and r0, r1\n\
lsl r0, #4\n\
b _0819A22A\n\
.pool\n\
ldrh r0, [r4]\n\
ldr r2, =0x0000f0ff\n\
and r2, r0\n\
add r0, r5, #0\n\
and r0, r7\n\
cmp r0, #0\n\
beq _0819A1D0\n\
ldrb r1, [r3]\n\
mov r0, r10\n\
and r0, r1\n\
lsl r0, #4\n\
b _0819A22A\n\
.pool\n\
_0819A1D0:\n\
ldrb r1, [r3]\n\
mov r0, r9\n\
and r0, r1\n\
lsl r0, #8\n\
b _0819A22A\n\
ldrb r1, [r3]\n\
mov r0, r9\n\
and r0, r1\n\
lsl r0, #8\n\
b _0819A22A\n\
_0819A1DA:\n\
add r0, r6, #0\n\
and r0, r7\n\
cmp r0, #0\n\
beq _0819A206\n\
ldrh r0, [r4]\n\
ldr r2, =0x0000ff0f\n\
and r2, r0\n\
add r0, r5, #0\n\
and r0, r7\n\
cmp r0, #0\n\
beq _0819A1FC\n\
ldrb r1, [r3]\n\
mov r0, r10\n\
b _0819A228\n\
.pool\n\
add r0, r6, #0\n\
and r0, r7\n\
cmp r0, #0\n\
beq _0819A206\n\
ldrh r0, [r4]\n\
ldr r2, =0x0000ff0f\n\
and r2, r0\n\
add r0, r5, #0\n\
and r0, r7\n\
cmp r0, #0\n\
beq _0819A1FC\n\
ldrb r1, [r3]\n\
mov r0, r10\n\
b _0819A228\n\
.pool\n\
_0819A1FC:\n\
ldrb r1, [r3]\n\
mov r0, r9\n\
and r0, r1\n\
lsl r0, #4\n\
b _0819A22A\n\
ldrb r1, [r3]\n\
mov r0, r9\n\
and r0, r1\n\
lsl r0, #4\n\
b _0819A22A\n\
_0819A206:\n\
ldrh r0, [r4]\n\
ldr r2, =0x0000fff0\n\
and r2, r0\n\
add r0, r5, #0\n\
and r0, r7\n\
cmp r0, #0\n\
beq _0819A224\n\
ldrb r1, [r3]\n\
mov r0, r10\n\
and r0, r1\n\
lsr r0, #4\n\
b _0819A22A\n\
.pool\n\
ldrh r0, [r4]\n\
ldr r2, =0x0000fff0\n\
and r2, r0\n\
add r0, r5, #0\n\
and r0, r7\n\
cmp r0, #0\n\
beq _0819A224\n\
ldrb r1, [r3]\n\
mov r0, r10\n\
and r0, r1\n\
lsr r0, #4\n\
b _0819A22A\n\
.pool\n\
_0819A224:\n\
ldrb r1, [r3]\n\
mov r0, r9\n\
ldrb r1, [r3]\n\
mov r0, r9\n\
_0819A228:\n\
and r0, r1\n\
and r0, r1\n\
_0819A22A:\n\
orr r2, r0\n\
strh r2, [r4]\n\
add r5, #0x1\n\
add r6, #0x1\n\
ldr r0, [sp, #0x10]\n\
cmp r5, r0\n\
bge _0819A23A\n\
b _0819A12E\n\
orr r2, r0\n\
strh r2, [r4]\n\
add r5, #0x1\n\
add r6, #0x1\n\
ldr r0, [sp, #0x10]\n\
cmp r5, r0\n\
bge _0819A23A\n\
b _0819A12E\n\
_0819A23A:\n\
ldr r1, [sp, #0x20]\n\
mov r12, r1\n\
ldr r2, [sp, #0x24]\n\
mov r8, r2\n\
ldr r0, [sp, #0x14]\n\
cmp r12, r0\n\
bge _0819A24A\n\
b _0819A10C\n\
ldr r1, [sp, #0x20]\n\
mov r12, r1\n\
ldr r2, [sp, #0x24]\n\
mov r8, r2\n\
ldr r0, [sp, #0x14]\n\
cmp r12, r0\n\
bge _0819A24A\n\
b _0819A10C\n\
_0819A24A:\n\
add sp, #0x28\n\
pop {r3-r5}\n\
mov r8, r3\n\
mov r9, r4\n\
mov r10, r5\n\
pop {r4-r7}\n\
pop {r0}\n\
bx r0\n");
add sp, #0x28\n\
pop {r3-r5}\n\
mov r8, r3\n\
mov r9, r4\n\
mov r10, r5\n\
pop {r4-r7}\n\
pop {r0}\n\
bx r0\n");
}
#endif

View File

@ -10,246 +10,246 @@
// wonder what the third flag is supposed to do
static const u8 sTileBitAttributes[] =
{
TILE_ATTRIBUTES(TRUE, FALSE, FALSE), // MB_NORMAL
TILE_ATTRIBUTES(FALSE, FALSE, FALSE), // MB_SECRET_BASE_WALL
TILE_ATTRIBUTES(TRUE, FALSE, TRUE), // MB_TALL_GRASS
TILE_ATTRIBUTES(TRUE, FALSE, TRUE), // MB_LONG_GRASS
TILE_ATTRIBUTES(FALSE, FALSE, FALSE), // MB_UNUSED_04
TILE_ATTRIBUTES(FALSE, FALSE, TRUE), // MB_UNUSED_05
TILE_ATTRIBUTES(TRUE, FALSE, TRUE), // MB_DEEP_SAND
TILE_ATTRIBUTES(TRUE, FALSE, FALSE), // MB_SHORT_GRASS
TILE_ATTRIBUTES(TRUE, FALSE, TRUE), // MB_UNUSED_CAVE
TILE_ATTRIBUTES(TRUE, FALSE, FALSE), // MB_LONG_GRASS_SOUTH_EDGE
TILE_ATTRIBUTES(TRUE, FALSE, FALSE), // MB_NO_RUNNING
TILE_ATTRIBUTES(TRUE, FALSE, TRUE), // MB_INDOOR_ENCOUNTER
TILE_ATTRIBUTES(TRUE, FALSE, FALSE), // MB_MOUNTAIN_TOP
TILE_ATTRIBUTES(TRUE, FALSE, FALSE), // MB_BATTLE_PYRAMID_WARP
TILE_ATTRIBUTES(TRUE, FALSE, FALSE), // MB_MOSSDEEP_GYM_WARP
TILE_ATTRIBUTES(TRUE, FALSE, FALSE), // MB_MT_PYRE_HOLE
TILE_ATTRIBUTES(TRUE, TRUE, TRUE), // MB_POND_WATER
TILE_ATTRIBUTES(TRUE, TRUE, TRUE), // MB_SEMI_DEEP_WATER
TILE_ATTRIBUTES(TRUE, TRUE, TRUE), // MB_DEEP_WATER
TILE_ATTRIBUTES(TRUE, TRUE, FALSE), // MB_WATERFALL
TILE_ATTRIBUTES(TRUE, TRUE, FALSE), // MB_SOOTOPOLIS_DEEP_WATER
TILE_ATTRIBUTES(TRUE, TRUE, TRUE), // MB_OCEAN_WATER
TILE_ATTRIBUTES(TRUE, FALSE, FALSE), // MB_PUDDLE
TILE_ATTRIBUTES(TRUE, FALSE, FALSE), // MB_SHALLOW_WATER
TILE_ATTRIBUTES(FALSE, FALSE, FALSE), // MB_UNUSED_SOOTOPOLIS_DEEP_WATER
TILE_ATTRIBUTES(TRUE, TRUE, FALSE), // MB_NO_SURFACING
TILE_ATTRIBUTES(FALSE, FALSE, FALSE), // MB_UNUSED_SOOTOPOLIS_DEEP_WATER_2
TILE_ATTRIBUTES(TRUE, FALSE, FALSE), // MB_STAIRS_OUTSIDE_ABANDONED_SHIP
TILE_ATTRIBUTES(TRUE, FALSE, FALSE), // MB_SHOAL_CAVE_ENTRANCE
TILE_ATTRIBUTES(FALSE, FALSE, FALSE), // MB_UNUSED_1D
TILE_ATTRIBUTES(FALSE, FALSE, FALSE), // MB_UNUSED_1E
TILE_ATTRIBUTES(FALSE, FALSE, FALSE), // MB_UNUSED_1F
TILE_ATTRIBUTES(TRUE, FALSE, FALSE), // MB_ICE
TILE_ATTRIBUTES(TRUE, FALSE, FALSE), // MB_SAND
TILE_ATTRIBUTES(TRUE, TRUE, TRUE), // MB_SEAWEED
TILE_ATTRIBUTES(TRUE, FALSE, FALSE), // MB_UNUSED_23
TILE_ATTRIBUTES(TRUE, FALSE, TRUE), // MB_ASHGRASS
TILE_ATTRIBUTES(TRUE, FALSE, TRUE), // MB_FOOTPRINTS
TILE_ATTRIBUTES(TRUE, FALSE, FALSE), // MB_THIN_ICE
TILE_ATTRIBUTES(TRUE, FALSE, FALSE), // MB_CRACKED_ICE
TILE_ATTRIBUTES(TRUE, FALSE, FALSE), // MB_HOT_SPRINGS
TILE_ATTRIBUTES(TRUE, FALSE, FALSE), // MB_LAVARIDGE_GYM_B1F_WARP
TILE_ATTRIBUTES(TRUE, TRUE, TRUE), // MB_SEAWEED_NO_SURFACING
TILE_ATTRIBUTES(TRUE, FALSE, FALSE), // MB_REFLECTION_UNDER_BRIDGE
TILE_ATTRIBUTES(FALSE, FALSE, FALSE), // MB_UNUSED_2C
TILE_ATTRIBUTES(FALSE, FALSE, FALSE), // MB_UNUSED_2D
TILE_ATTRIBUTES(FALSE, FALSE, FALSE), // MB_UNUSED_2E
TILE_ATTRIBUTES(FALSE, FALSE, FALSE), // MB_UNUSED_2F
TILE_ATTRIBUTES(TRUE, FALSE, FALSE), // MB_IMPASSABLE_EAST
TILE_ATTRIBUTES(TRUE, FALSE, FALSE), // MB_IMPASSABLE_WEST
TILE_ATTRIBUTES(TRUE, FALSE, FALSE), // MB_IMPASSABLE_NORTH
TILE_ATTRIBUTES(TRUE, FALSE, FALSE), // MB_IMPASSABLE_SOUTH
TILE_ATTRIBUTES(TRUE, FALSE, FALSE), // MB_IMPASSABLE_NORTHEAST
TILE_ATTRIBUTES(TRUE, FALSE, FALSE), // MB_IMPASSABLE_NORTHWEST
TILE_ATTRIBUTES(TRUE, FALSE, FALSE), // MB_IMPASSABLE_SOUTHEAST
TILE_ATTRIBUTES(TRUE, FALSE, FALSE), // MB_IMPASSABLE_SOUTHWEST
TILE_ATTRIBUTES(FALSE, FALSE, FALSE), // MB_JUMP_EAST
TILE_ATTRIBUTES(FALSE, FALSE, FALSE), // MB_JUMP_WEST
TILE_ATTRIBUTES(FALSE, FALSE, FALSE), // MB_JUMP_NORTH
TILE_ATTRIBUTES(FALSE, FALSE, FALSE), // MB_JUMP_SOUTH
TILE_ATTRIBUTES(TRUE, FALSE, FALSE), // MB_JUMP_NORTHEAST
TILE_ATTRIBUTES(TRUE, FALSE, FALSE), // MB_JUMP_NORTHWEST
TILE_ATTRIBUTES(TRUE, FALSE, FALSE), // MB_JUMP_SOUTHEAST
TILE_ATTRIBUTES(TRUE, FALSE, FALSE), // MB_JUMP_SOUTHWEST
TILE_ATTRIBUTES(TRUE, FALSE, FALSE), // MB_WALK_EAST
TILE_ATTRIBUTES(TRUE, FALSE, FALSE), // MB_WALK_WEST
TILE_ATTRIBUTES(TRUE, FALSE, FALSE), // MB_WALK_NORTH
TILE_ATTRIBUTES(TRUE, FALSE, FALSE), // MB_WALK_SOUTH
TILE_ATTRIBUTES(TRUE, FALSE, FALSE), // MB_SLIDE_EAST
TILE_ATTRIBUTES(TRUE, FALSE, FALSE), // MB_SLIDE_WEST
TILE_ATTRIBUTES(TRUE, FALSE, FALSE), // MB_SLIDE_NORTH
TILE_ATTRIBUTES(TRUE, FALSE, FALSE), // MB_SLIDE_SOUTH
TILE_ATTRIBUTES(TRUE, FALSE, FALSE), // MB_TRICK_HOUSE_PUZZLE_8_FLOOR
TILE_ATTRIBUTES(TRUE, FALSE, FALSE), // MB_UNUSED_49
TILE_ATTRIBUTES(TRUE, FALSE, FALSE), // MB_UNUSED_4A
TILE_ATTRIBUTES(FALSE, FALSE, FALSE), // MB_UNUSED_4B
TILE_ATTRIBUTES(FALSE, FALSE, FALSE), // MB_UNUSED_4C
TILE_ATTRIBUTES(FALSE, FALSE, FALSE), // MB_UNUSED_4D
TILE_ATTRIBUTES(FALSE, FALSE, FALSE), // MB_UNUSED_4E
TILE_ATTRIBUTES(FALSE, FALSE, FALSE), // MB_UNUSED_4F
TILE_ATTRIBUTES(TRUE, TRUE, FALSE), // MB_EASTWARD_CURRENT
TILE_ATTRIBUTES(TRUE, TRUE, FALSE), // MB_WESTWARD_CURRENT
TILE_ATTRIBUTES(TRUE, TRUE, FALSE), // MB_NORTHWARD_CURRENT
TILE_ATTRIBUTES(TRUE, TRUE, FALSE), // MB_SOUTHWARD_CURRENT
TILE_ATTRIBUTES(FALSE, FALSE, FALSE), // MB_UNUSED_54
TILE_ATTRIBUTES(FALSE, FALSE, FALSE), // MB_UNUSED_55
TILE_ATTRIBUTES(FALSE, FALSE, FALSE), // MB_UNUSED_56
TILE_ATTRIBUTES(FALSE, FALSE, FALSE), // MB_UNUSED_57
TILE_ATTRIBUTES(FALSE, FALSE, FALSE), // MB_UNUSED_58
TILE_ATTRIBUTES(FALSE, FALSE, FALSE), // MB_UNUSED_59
TILE_ATTRIBUTES(FALSE, FALSE, FALSE), // MB_UNUSED_5A
TILE_ATTRIBUTES(FALSE, FALSE, FALSE), // MB_UNUSED_5B
TILE_ATTRIBUTES(FALSE, FALSE, FALSE), // MB_UNUSED_5C
TILE_ATTRIBUTES(FALSE, FALSE, FALSE), // MB_UNUSED_5D
TILE_ATTRIBUTES(FALSE, FALSE, FALSE), // MB_UNUSED_5E
TILE_ATTRIBUTES(FALSE, FALSE, FALSE), // MB_UNUSED_5F
TILE_ATTRIBUTES(TRUE, FALSE, FALSE), // MB_NON_ANIMATED_DOOR
TILE_ATTRIBUTES(TRUE, FALSE, FALSE), // MB_LADDER
TILE_ATTRIBUTES(TRUE, FALSE, FALSE), // MB_EAST_ARROW_WARP
TILE_ATTRIBUTES(TRUE, FALSE, FALSE), // MB_WEST_ARROW_WARP
TILE_ATTRIBUTES(TRUE, FALSE, FALSE), // MB_NORTH_ARROW_WARP
TILE_ATTRIBUTES(TRUE, FALSE, FALSE), // MB_SOUTH_ARROW_WARP
TILE_ATTRIBUTES(TRUE, FALSE, FALSE), // MB_CRACKED_FLOOR_HOLE
TILE_ATTRIBUTES(TRUE, FALSE, FALSE), // MB_AQUA_HIDEOUT_WARP
TILE_ATTRIBUTES(TRUE, FALSE, FALSE), // MB_LAVARIDGE_GYM_1F_WARP
TILE_ATTRIBUTES(TRUE, FALSE, FALSE), // MB_ANIMATED_DOOR
TILE_ATTRIBUTES(TRUE, FALSE, FALSE), // MB_UP_ESCALATOR
TILE_ATTRIBUTES(TRUE, FALSE, FALSE), // MB_DOWN_ESCALATOR
TILE_ATTRIBUTES(TRUE, TRUE, FALSE), // MB_WATER_DOOR
TILE_ATTRIBUTES(TRUE, TRUE, FALSE), // MB_WATER_SOUTH_ARROW_WARP
TILE_ATTRIBUTES(TRUE, FALSE, FALSE), // MB_DEEP_SOUTH_WARP
TILE_ATTRIBUTES(TRUE, TRUE, FALSE), // MB_UNUSED_6F
TILE_ATTRIBUTES(FALSE, FALSE, FALSE), // MB_WARP_OR_BRIDGE
TILE_ATTRIBUTES(TRUE, FALSE, FALSE), // MB_UNUSED_71
TILE_ATTRIBUTES(TRUE, FALSE, FALSE), // MB_ROUTE120_NORTH_BRIDGE_1
TILE_ATTRIBUTES(TRUE, FALSE, FALSE), // MB_ROUTE120_NORTH_BRIDGE_2
TILE_ATTRIBUTES(TRUE, FALSE, FALSE), // MB_PACIFIDLOG_VERTICAL_LOG_1
TILE_ATTRIBUTES(TRUE, FALSE, FALSE), // MB_PACIFIDLOG_VERTICAL_LOG_2
TILE_ATTRIBUTES(TRUE, FALSE, FALSE), // MB_PACIFIDLOG_HORIZONTAL_LOG_1
TILE_ATTRIBUTES(TRUE, FALSE, FALSE), // MB_PACIFIDLOG_HORIZONTAL_LOG_2
TILE_ATTRIBUTES(TRUE, FALSE, FALSE), // MB_FORTREE_BRIDGE
TILE_ATTRIBUTES(FALSE, FALSE, FALSE), // MB_UNUSED_79
TILE_ATTRIBUTES(TRUE, FALSE, FALSE), // MB_ROUTE120_SOUTH_BRIDGE_1
TILE_ATTRIBUTES(TRUE, FALSE, FALSE), // MB_ROUTE120_SOUTH_BRIDGE_2
TILE_ATTRIBUTES(TRUE, FALSE, FALSE), // MB_ROUTE120_NORTH_BRIDGE_3
TILE_ATTRIBUTES(TRUE, FALSE, FALSE), // MB_ROUTE120_NORTH_BRIDGE_4
TILE_ATTRIBUTES(TRUE, FALSE, FALSE), // MB_UNUSED_7E
TILE_ATTRIBUTES(TRUE, FALSE, FALSE), // MB_ROUTE110_BRIDGE
TILE_ATTRIBUTES(FALSE, FALSE, FALSE), // MB_COUNTER
TILE_ATTRIBUTES(FALSE, FALSE, FALSE), // MB_UNUSED_81
TILE_ATTRIBUTES(FALSE, FALSE, FALSE), // MB_UNUSED_82
TILE_ATTRIBUTES(FALSE, FALSE, FALSE), // MB_PC
TILE_ATTRIBUTES(FALSE, FALSE, FALSE), // MB_CABLE_BOX_RESULTS_1
TILE_ATTRIBUTES(FALSE, FALSE, FALSE), // MB_REGION_MAP
TILE_ATTRIBUTES(FALSE, FALSE, FALSE), // MB_TELEVISION
TILE_ATTRIBUTES(FALSE, FALSE, FALSE), // MB_POKEBLOCK_FEEDER
TILE_ATTRIBUTES(FALSE, FALSE, FALSE), // MB_UNUSED_88
TILE_ATTRIBUTES(FALSE, FALSE, FALSE), // MB_SLOT_MACHINE
TILE_ATTRIBUTES(FALSE, FALSE, FALSE), // MB_ROULETTE
TILE_ATTRIBUTES(FALSE, FALSE, FALSE), // MB_CLOSED_SOOTOPOLIS_DOOR
TILE_ATTRIBUTES(FALSE, FALSE, FALSE), // MB_TRICK_HOUSE_PUZZLE_DOOR
TILE_ATTRIBUTES(FALSE, FALSE, FALSE), // MB_PETALBURG_GYM_DOOR
TILE_ATTRIBUTES(FALSE, FALSE, FALSE), // MB_RUNNING_SHOES_INSTRUCTION
TILE_ATTRIBUTES(FALSE, FALSE, FALSE), // MB_QUESTIONNAIRE
TILE_ATTRIBUTES(FALSE, FALSE, FALSE), // MB_SECRET_BASE_SPOT_RED_CAVE
TILE_ATTRIBUTES(FALSE, FALSE, FALSE), // MB_SECRET_BASE_SPOT_RED_CAVE_OPEN
TILE_ATTRIBUTES(FALSE, FALSE, FALSE), // MB_SECRET_BASE_SPOT_BROWN_CAVE
TILE_ATTRIBUTES(FALSE, FALSE, FALSE), // MB_SECRET_BASE_SPOT_BROWN_CAVE_OPEN
TILE_ATTRIBUTES(FALSE, FALSE, FALSE), // MB_SECRET_BASE_SPOT_YELLOW_CAVE
TILE_ATTRIBUTES(FALSE, FALSE, FALSE), // MB_SECRET_BASE_SPOT_YELLOW_CAVE_OPEN
TILE_ATTRIBUTES(FALSE, FALSE, FALSE), // MB_SECRET_BASE_SPOT_TREE_LEFT
TILE_ATTRIBUTES(FALSE, FALSE, FALSE), // MB_SECRET_BASE_SPOT_TREE_LEFT_OPEN
TILE_ATTRIBUTES(FALSE, FALSE, FALSE), // MB_SECRET_BASE_SPOT_SHRUB
TILE_ATTRIBUTES(FALSE, FALSE, FALSE), // MB_SECRET_BASE_SPOT_SHRUB_OPEN
TILE_ATTRIBUTES(FALSE, FALSE, FALSE), // MB_SECRET_BASE_SPOT_BLUE_CAVE
TILE_ATTRIBUTES(FALSE, FALSE, FALSE), // MB_SECRET_BASE_SPOT_BLUE_CAVE_OPEN
TILE_ATTRIBUTES(FALSE, FALSE, FALSE), // MB_SECRET_BASE_SPOT_TREE_RIGHT
TILE_ATTRIBUTES(FALSE, FALSE, FALSE), // MB_SECRET_BASE_SPOT_TREE_RIGHT_OPEN
TILE_ATTRIBUTES(FALSE, FALSE, FALSE), // MB_UNUSED_9E
TILE_ATTRIBUTES(FALSE, FALSE, FALSE), // MB_UNUSED_9F
TILE_ATTRIBUTES(FALSE, FALSE, FALSE), // MB_BERRY_TREE_SOIL
TILE_ATTRIBUTES(FALSE, FALSE, FALSE), // MB_UNUSED_A1
TILE_ATTRIBUTES(FALSE, FALSE, FALSE), // MB_UNUSED_A2
TILE_ATTRIBUTES(FALSE, FALSE, FALSE), // MB_UNUSED_A3
TILE_ATTRIBUTES(FALSE, FALSE, FALSE), // MB_UNUSED_A4
TILE_ATTRIBUTES(FALSE, FALSE, FALSE), // MB_UNUSED_A5
TILE_ATTRIBUTES(FALSE, FALSE, FALSE), // MB_UNUSED_A6
TILE_ATTRIBUTES(FALSE, FALSE, FALSE), // MB_UNUSED_A7
TILE_ATTRIBUTES(FALSE, FALSE, FALSE), // MB_UNUSED_A8
TILE_ATTRIBUTES(FALSE, FALSE, FALSE), // MB_UNUSED_A9
TILE_ATTRIBUTES(FALSE, FALSE, FALSE), // MB_UNUSED_AA
TILE_ATTRIBUTES(FALSE, FALSE, FALSE), // MB_UNUSED_AB
TILE_ATTRIBUTES(FALSE, FALSE, FALSE), // MB_UNUSED_AC
TILE_ATTRIBUTES(FALSE, FALSE, FALSE), // MB_UNUSED_AD
TILE_ATTRIBUTES(FALSE, FALSE, FALSE), // MB_UNUSED_AE
TILE_ATTRIBUTES(FALSE, FALSE, FALSE), // MB_UNUSED_AF
TILE_ATTRIBUTES(FALSE, FALSE, FALSE), // MB_SECRET_BASE_PC
TILE_ATTRIBUTES(FALSE, FALSE, FALSE), // MB_SECRET_BASE_REGISTER_PC
TILE_ATTRIBUTES(TRUE, FALSE, FALSE), // MB_SECRET_BASE_UNUSED
TILE_ATTRIBUTES(TRUE, FALSE, FALSE), // MB_BLOCK_DECORATION
TILE_ATTRIBUTES(FALSE, FALSE, FALSE), // MB_SECRET_BASE_DECORATION
TILE_ATTRIBUTES(TRUE, FALSE, FALSE), // MB_SECRET_BASE_LARGE_MAT_EDGE
TILE_ATTRIBUTES(FALSE, FALSE, FALSE), // MB_UNUSED_B6
TILE_ATTRIBUTES(FALSE, FALSE, FALSE), // MB_SECRET_BASE_NORTH_WALL
TILE_ATTRIBUTES(TRUE, FALSE, FALSE), // MB_SECRET_BASE_BALLOON
TILE_ATTRIBUTES(TRUE, FALSE, FALSE), // MB_SECRET_BASE_IMPASSABLE
TILE_ATTRIBUTES(TRUE, FALSE, FALSE), // MB_SECRET_BASE_GLITTER_MAT
TILE_ATTRIBUTES(TRUE, FALSE, FALSE), // MB_SECRET_BASE_JUMP_MAT
TILE_ATTRIBUTES(TRUE, FALSE, FALSE), // MB_SECRET_BASE_SPIN_MAT
TILE_ATTRIBUTES(TRUE, FALSE, FALSE), // MB_SECRET_BASE_SOUND_MAT
TILE_ATTRIBUTES(TRUE, FALSE, FALSE), // MB_SECRET_BASE_BREAKABLE_DOOR
TILE_ATTRIBUTES(FALSE, FALSE, FALSE), // MB_SECRET_BASE_SAND_ORNAMENT
TILE_ATTRIBUTES(TRUE, FALSE, FALSE), // MB_IMPASSABLE_SOUTH_AND_NORTH
TILE_ATTRIBUTES(TRUE, FALSE, FALSE), // MB_IMPASSABLE_WEST_AND_EAST
TILE_ATTRIBUTES(TRUE, FALSE, FALSE), // MB_SECRET_BASE_HOLE
TILE_ATTRIBUTES(TRUE, FALSE, FALSE), // MB_LARGE_MAT_CENTER
TILE_ATTRIBUTES(TRUE, FALSE, FALSE), // MB_SECRET_BASE_TV_SHIELD
TILE_ATTRIBUTES(TRUE, FALSE, FALSE), // MB_PLAYER_ROOM_PC_ON
TILE_ATTRIBUTES(FALSE, FALSE, FALSE), // MB_C6
TILE_ATTRIBUTES(FALSE, FALSE, FALSE), // MB_SECRET_BASE_POSTER
TILE_ATTRIBUTES(FALSE, FALSE, FALSE), // MB_UNUSED_C8
TILE_ATTRIBUTES(FALSE, FALSE, FALSE), // MB_UNUSED_C9
TILE_ATTRIBUTES(FALSE, FALSE, FALSE), // MB_UNUSED_CA
TILE_ATTRIBUTES(FALSE, FALSE, FALSE), // MB_UNUSED_CB
TILE_ATTRIBUTES(FALSE, FALSE, FALSE), // MB_UNUSED_CC
TILE_ATTRIBUTES(FALSE, FALSE, FALSE), // MB_UNUSED_CD
TILE_ATTRIBUTES(FALSE, FALSE, FALSE), // MB_UNUSED_CE
TILE_ATTRIBUTES(FALSE, FALSE, FALSE), // MB_UNUSED_CF
TILE_ATTRIBUTES(TRUE, FALSE, FALSE), // MB_MUDDY_SLOPE
TILE_ATTRIBUTES(TRUE, FALSE, FALSE), // MB_BUMPY_SLOPE
TILE_ATTRIBUTES(TRUE, FALSE, FALSE), // MB_CRACKED_FLOOR
TILE_ATTRIBUTES(TRUE, FALSE, FALSE), // MB_ISOLATED_VERTICAL_RAIL
TILE_ATTRIBUTES(TRUE, FALSE, FALSE), // MB_ISOLATED_HORIZONTAL_RAIL
TILE_ATTRIBUTES(TRUE, FALSE, FALSE), // MB_VERTICAL_RAIL
TILE_ATTRIBUTES(TRUE, FALSE, FALSE), // MB_HORIZONTAL_RAIL
TILE_ATTRIBUTES(FALSE, FALSE, FALSE), // MB_UNUSED_D7
TILE_ATTRIBUTES(FALSE, FALSE, FALSE), // MB_UNUSED_D8
TILE_ATTRIBUTES(FALSE, FALSE, FALSE), // MB_UNUSED_D9
TILE_ATTRIBUTES(FALSE, FALSE, FALSE), // MB_UNUSED_DA
TILE_ATTRIBUTES(FALSE, FALSE, FALSE), // MB_UNUSED_DB
TILE_ATTRIBUTES(FALSE, FALSE, FALSE), // MB_UNUSED_DC
TILE_ATTRIBUTES(FALSE, FALSE, FALSE), // MB_UNUSED_DD
TILE_ATTRIBUTES(FALSE, FALSE, FALSE), // MB_UNUSED_DE
TILE_ATTRIBUTES(FALSE, FALSE, FALSE), // MB_UNUSED_DF
TILE_ATTRIBUTES(FALSE, FALSE, FALSE), // MB_PICTURE_BOOK_SHELF
TILE_ATTRIBUTES(FALSE, FALSE, FALSE), // MB_BOOKSHELF
TILE_ATTRIBUTES(FALSE, FALSE, FALSE), // MB_POKEMON_CENTER_BOOKSHELF
TILE_ATTRIBUTES(FALSE, FALSE, FALSE), // MB_VASE
TILE_ATTRIBUTES(FALSE, FALSE, FALSE), // MB_TRASH_CAN
TILE_ATTRIBUTES(FALSE, FALSE, FALSE), // MB_SHOP_SHELF
TILE_ATTRIBUTES(FALSE, FALSE, FALSE), // MB_BLUEPRINT
TILE_ATTRIBUTES(FALSE, FALSE, FALSE), // MB_CABLE_BOX_RESULTS_2
TILE_ATTRIBUTES(FALSE, FALSE, FALSE), // MB_WIRELESS_BOX_RESULTS
TILE_ATTRIBUTES(FALSE, FALSE, FALSE), // MB_TRAINER_HILL_TIMER
TILE_ATTRIBUTES(FALSE, FALSE, FALSE), // MB_UNKNOWN_CLOSED_DOOR
TILE_ATTRIBUTES(FALSE, FALSE, FALSE), // MB_UNUSED_EB
TILE_ATTRIBUTES(FALSE, FALSE, FALSE), // MB_UNUSED_EC
TILE_ATTRIBUTES(FALSE, FALSE, FALSE), // MB_UNUSED_ED
TILE_ATTRIBUTES(FALSE, FALSE, FALSE), // MB_UNUSED_EE
TILE_ATTRIBUTES(FALSE, FALSE, FALSE), // MB_UNUSED_EF
[MB_NORMAL] = TILE_ATTRIBUTES(TRUE, FALSE, FALSE),
[MB_SECRET_BASE_WALL] = TILE_ATTRIBUTES(FALSE, FALSE, FALSE),
[MB_TALL_GRASS] = TILE_ATTRIBUTES(TRUE, FALSE, TRUE),
[MB_LONG_GRASS] = TILE_ATTRIBUTES(TRUE, FALSE, TRUE),
[MB_UNUSED_04] = TILE_ATTRIBUTES(FALSE, FALSE, FALSE),
[MB_UNUSED_05] = TILE_ATTRIBUTES(FALSE, FALSE, TRUE),
[MB_DEEP_SAND] = TILE_ATTRIBUTES(TRUE, FALSE, TRUE),
[MB_SHORT_GRASS] = TILE_ATTRIBUTES(TRUE, FALSE, FALSE),
[MB_UNUSED_CAVE] = TILE_ATTRIBUTES(TRUE, FALSE, TRUE),
[MB_LONG_GRASS_SOUTH_EDGE] = TILE_ATTRIBUTES(TRUE, FALSE, FALSE),
[MB_NO_RUNNING] = TILE_ATTRIBUTES(TRUE, FALSE, FALSE),
[MB_INDOOR_ENCOUNTER] = TILE_ATTRIBUTES(TRUE, FALSE, TRUE),
[MB_MOUNTAIN_TOP] = TILE_ATTRIBUTES(TRUE, FALSE, FALSE),
[MB_BATTLE_PYRAMID_WARP] = TILE_ATTRIBUTES(TRUE, FALSE, FALSE),
[MB_MOSSDEEP_GYM_WARP] = TILE_ATTRIBUTES(TRUE, FALSE, FALSE),
[MB_MT_PYRE_HOLE] = TILE_ATTRIBUTES(TRUE, FALSE, FALSE),
[MB_POND_WATER] = TILE_ATTRIBUTES(TRUE, TRUE, TRUE),
[MB_SEMI_DEEP_WATER] = TILE_ATTRIBUTES(TRUE, TRUE, TRUE),
[MB_DEEP_WATER] = TILE_ATTRIBUTES(TRUE, TRUE, TRUE),
[MB_WATERFALL] = TILE_ATTRIBUTES(TRUE, TRUE, FALSE),
[MB_SOOTOPOLIS_DEEP_WATER] = TILE_ATTRIBUTES(TRUE, TRUE, FALSE),
[MB_OCEAN_WATER] = TILE_ATTRIBUTES(TRUE, TRUE, TRUE),
[MB_PUDDLE] = TILE_ATTRIBUTES(TRUE, FALSE, FALSE),
[MB_SHALLOW_WATER] = TILE_ATTRIBUTES(TRUE, FALSE, FALSE),
[MB_UNUSED_SOOTOPOLIS_DEEP_WATER] = TILE_ATTRIBUTES(FALSE, FALSE, FALSE),
[MB_NO_SURFACING] = TILE_ATTRIBUTES(TRUE, TRUE, FALSE),
[MB_UNUSED_SOOTOPOLIS_DEEP_WATER_2] = TILE_ATTRIBUTES(FALSE, FALSE, FALSE),
[MB_STAIRS_OUTSIDE_ABANDONED_SHIP] = TILE_ATTRIBUTES(TRUE, FALSE, FALSE),
[MB_SHOAL_CAVE_ENTRANCE] = TILE_ATTRIBUTES(TRUE, FALSE, FALSE),
[MB_UNUSED_1D] = TILE_ATTRIBUTES(FALSE, FALSE, FALSE),
[MB_UNUSED_1E] = TILE_ATTRIBUTES(FALSE, FALSE, FALSE),
[MB_UNUSED_1F] = TILE_ATTRIBUTES(FALSE, FALSE, FALSE),
[MB_ICE] = TILE_ATTRIBUTES(TRUE, FALSE, FALSE),
[MB_SAND] = TILE_ATTRIBUTES(TRUE, FALSE, FALSE),
[MB_SEAWEED] = TILE_ATTRIBUTES(TRUE, TRUE, TRUE),
[MB_UNUSED_23] = TILE_ATTRIBUTES(TRUE, FALSE, FALSE),
[MB_ASHGRASS] = TILE_ATTRIBUTES(TRUE, FALSE, TRUE),
[MB_FOOTPRINTS] = TILE_ATTRIBUTES(TRUE, FALSE, TRUE),
[MB_THIN_ICE] = TILE_ATTRIBUTES(TRUE, FALSE, FALSE),
[MB_CRACKED_ICE] = TILE_ATTRIBUTES(TRUE, FALSE, FALSE),
[MB_HOT_SPRINGS] = TILE_ATTRIBUTES(TRUE, FALSE, FALSE),
[MB_LAVARIDGE_GYM_B1F_WARP] = TILE_ATTRIBUTES(TRUE, FALSE, FALSE),
[MB_SEAWEED_NO_SURFACING] = TILE_ATTRIBUTES(TRUE, TRUE, TRUE),
[MB_REFLECTION_UNDER_BRIDGE] = TILE_ATTRIBUTES(TRUE, FALSE, FALSE),
[MB_UNUSED_2C] = TILE_ATTRIBUTES(FALSE, FALSE, FALSE),
[MB_UNUSED_2D] = TILE_ATTRIBUTES(FALSE, FALSE, FALSE),
[MB_UNUSED_2E] = TILE_ATTRIBUTES(FALSE, FALSE, FALSE),
[MB_UNUSED_2F] = TILE_ATTRIBUTES(FALSE, FALSE, FALSE),
[MB_IMPASSABLE_EAST] = TILE_ATTRIBUTES(TRUE, FALSE, FALSE),
[MB_IMPASSABLE_WEST] = TILE_ATTRIBUTES(TRUE, FALSE, FALSE),
[MB_IMPASSABLE_NORTH] = TILE_ATTRIBUTES(TRUE, FALSE, FALSE),
[MB_IMPASSABLE_SOUTH] = TILE_ATTRIBUTES(TRUE, FALSE, FALSE),
[MB_IMPASSABLE_NORTHEAST] = TILE_ATTRIBUTES(TRUE, FALSE, FALSE),
[MB_IMPASSABLE_NORTHWEST] = TILE_ATTRIBUTES(TRUE, FALSE, FALSE),
[MB_IMPASSABLE_SOUTHEAST] = TILE_ATTRIBUTES(TRUE, FALSE, FALSE),
[MB_IMPASSABLE_SOUTHWEST] = TILE_ATTRIBUTES(TRUE, FALSE, FALSE),
[MB_JUMP_EAST] = TILE_ATTRIBUTES(FALSE, FALSE, FALSE),
[MB_JUMP_WEST] = TILE_ATTRIBUTES(FALSE, FALSE, FALSE),
[MB_JUMP_NORTH] = TILE_ATTRIBUTES(FALSE, FALSE, FALSE),
[MB_JUMP_SOUTH] = TILE_ATTRIBUTES(FALSE, FALSE, FALSE),
[MB_JUMP_NORTHEAST] = TILE_ATTRIBUTES(TRUE, FALSE, FALSE),
[MB_JUMP_NORTHWEST] = TILE_ATTRIBUTES(TRUE, FALSE, FALSE),
[MB_JUMP_SOUTHEAST] = TILE_ATTRIBUTES(TRUE, FALSE, FALSE),
[MB_JUMP_SOUTHWEST] = TILE_ATTRIBUTES(TRUE, FALSE, FALSE),
[MB_WALK_EAST] = TILE_ATTRIBUTES(TRUE, FALSE, FALSE),
[MB_WALK_WEST] = TILE_ATTRIBUTES(TRUE, FALSE, FALSE),
[MB_WALK_NORTH] = TILE_ATTRIBUTES(TRUE, FALSE, FALSE),
[MB_WALK_SOUTH] = TILE_ATTRIBUTES(TRUE, FALSE, FALSE),
[MB_SLIDE_EAST] = TILE_ATTRIBUTES(TRUE, FALSE, FALSE),
[MB_SLIDE_WEST] = TILE_ATTRIBUTES(TRUE, FALSE, FALSE),
[MB_SLIDE_NORTH] = TILE_ATTRIBUTES(TRUE, FALSE, FALSE),
[MB_SLIDE_SOUTH] = TILE_ATTRIBUTES(TRUE, FALSE, FALSE),
[MB_TRICK_HOUSE_PUZZLE_8_FLOOR] = TILE_ATTRIBUTES(TRUE, FALSE, FALSE),
[MB_UNUSED_49] = TILE_ATTRIBUTES(TRUE, FALSE, FALSE),
[MB_UNUSED_4A] = TILE_ATTRIBUTES(TRUE, FALSE, FALSE),
[MB_UNUSED_4B] = TILE_ATTRIBUTES(FALSE, FALSE, FALSE),
[MB_UNUSED_4C] = TILE_ATTRIBUTES(FALSE, FALSE, FALSE),
[MB_UNUSED_4D] = TILE_ATTRIBUTES(FALSE, FALSE, FALSE),
[MB_UNUSED_4E] = TILE_ATTRIBUTES(FALSE, FALSE, FALSE),
[MB_UNUSED_4F] = TILE_ATTRIBUTES(FALSE, FALSE, FALSE),
[MB_EASTWARD_CURRENT] = TILE_ATTRIBUTES(TRUE, TRUE, FALSE),
[MB_WESTWARD_CURRENT] = TILE_ATTRIBUTES(TRUE, TRUE, FALSE),
[MB_NORTHWARD_CURRENT] = TILE_ATTRIBUTES(TRUE, TRUE, FALSE),
[MB_SOUTHWARD_CURRENT] = TILE_ATTRIBUTES(TRUE, TRUE, FALSE),
[MB_UNUSED_54] = TILE_ATTRIBUTES(FALSE, FALSE, FALSE),
[MB_UNUSED_55] = TILE_ATTRIBUTES(FALSE, FALSE, FALSE),
[MB_UNUSED_56] = TILE_ATTRIBUTES(FALSE, FALSE, FALSE),
[MB_UNUSED_57] = TILE_ATTRIBUTES(FALSE, FALSE, FALSE),
[MB_UNUSED_58] = TILE_ATTRIBUTES(FALSE, FALSE, FALSE),
[MB_UNUSED_59] = TILE_ATTRIBUTES(FALSE, FALSE, FALSE),
[MB_UNUSED_5A] = TILE_ATTRIBUTES(FALSE, FALSE, FALSE),
[MB_UNUSED_5B] = TILE_ATTRIBUTES(FALSE, FALSE, FALSE),
[MB_UNUSED_5C] = TILE_ATTRIBUTES(FALSE, FALSE, FALSE),
[MB_UNUSED_5D] = TILE_ATTRIBUTES(FALSE, FALSE, FALSE),
[MB_UNUSED_5E] = TILE_ATTRIBUTES(FALSE, FALSE, FALSE),
[MB_UNUSED_5F] = TILE_ATTRIBUTES(FALSE, FALSE, FALSE),
[MB_NON_ANIMATED_DOOR] = TILE_ATTRIBUTES(TRUE, FALSE, FALSE),
[MB_LADDER] = TILE_ATTRIBUTES(TRUE, FALSE, FALSE),
[MB_EAST_ARROW_WARP] = TILE_ATTRIBUTES(TRUE, FALSE, FALSE),
[MB_WEST_ARROW_WARP] = TILE_ATTRIBUTES(TRUE, FALSE, FALSE),
[MB_NORTH_ARROW_WARP] = TILE_ATTRIBUTES(TRUE, FALSE, FALSE),
[MB_SOUTH_ARROW_WARP] = TILE_ATTRIBUTES(TRUE, FALSE, FALSE),
[MB_CRACKED_FLOOR_HOLE] = TILE_ATTRIBUTES(TRUE, FALSE, FALSE),
[MB_AQUA_HIDEOUT_WARP] = TILE_ATTRIBUTES(TRUE, FALSE, FALSE),
[MB_LAVARIDGE_GYM_1F_WARP] = TILE_ATTRIBUTES(TRUE, FALSE, FALSE),
[MB_ANIMATED_DOOR] = TILE_ATTRIBUTES(TRUE, FALSE, FALSE),
[MB_UP_ESCALATOR] = TILE_ATTRIBUTES(TRUE, FALSE, FALSE),
[MB_DOWN_ESCALATOR] = TILE_ATTRIBUTES(TRUE, FALSE, FALSE),
[MB_WATER_DOOR] = TILE_ATTRIBUTES(TRUE, TRUE, FALSE),
[MB_WATER_SOUTH_ARROW_WARP] = TILE_ATTRIBUTES(TRUE, TRUE, FALSE),
[MB_DEEP_SOUTH_WARP] = TILE_ATTRIBUTES(TRUE, FALSE, FALSE),
[MB_UNUSED_6F] = TILE_ATTRIBUTES(TRUE, TRUE, FALSE),
[MB_WARP_OR_BRIDGE] = TILE_ATTRIBUTES(FALSE, FALSE, FALSE),
[MB_UNUSED_71] = TILE_ATTRIBUTES(TRUE, FALSE, FALSE),
[MB_ROUTE120_NORTH_BRIDGE_1] = TILE_ATTRIBUTES(TRUE, FALSE, FALSE),
[MB_ROUTE120_NORTH_BRIDGE_2] = TILE_ATTRIBUTES(TRUE, FALSE, FALSE),
[MB_PACIFIDLOG_VERTICAL_LOG_1] = TILE_ATTRIBUTES(TRUE, FALSE, FALSE),
[MB_PACIFIDLOG_VERTICAL_LOG_2] = TILE_ATTRIBUTES(TRUE, FALSE, FALSE),
[MB_PACIFIDLOG_HORIZONTAL_LOG_1] = TILE_ATTRIBUTES(TRUE, FALSE, FALSE),
[MB_PACIFIDLOG_HORIZONTAL_LOG_2] = TILE_ATTRIBUTES(TRUE, FALSE, FALSE),
[MB_FORTREE_BRIDGE] = TILE_ATTRIBUTES(TRUE, FALSE, FALSE),
[MB_UNUSED_79] = TILE_ATTRIBUTES(FALSE, FALSE, FALSE),
[MB_ROUTE120_SOUTH_BRIDGE_1] = TILE_ATTRIBUTES(TRUE, FALSE, FALSE),
[MB_ROUTE120_SOUTH_BRIDGE_2] = TILE_ATTRIBUTES(TRUE, FALSE, FALSE),
[MB_ROUTE120_NORTH_BRIDGE_3] = TILE_ATTRIBUTES(TRUE, FALSE, FALSE),
[MB_ROUTE120_NORTH_BRIDGE_4] = TILE_ATTRIBUTES(TRUE, FALSE, FALSE),
[MB_UNUSED_7E] = TILE_ATTRIBUTES(TRUE, FALSE, FALSE),
[MB_ROUTE110_BRIDGE] = TILE_ATTRIBUTES(TRUE, FALSE, FALSE),
[MB_COUNTER] = TILE_ATTRIBUTES(FALSE, FALSE, FALSE),
[MB_UNUSED_81] = TILE_ATTRIBUTES(FALSE, FALSE, FALSE),
[MB_UNUSED_82] = TILE_ATTRIBUTES(FALSE, FALSE, FALSE),
[MB_PC] = TILE_ATTRIBUTES(FALSE, FALSE, FALSE),
[MB_CABLE_BOX_RESULTS_1] = TILE_ATTRIBUTES(FALSE, FALSE, FALSE),
[MB_REGION_MAP] = TILE_ATTRIBUTES(FALSE, FALSE, FALSE),
[MB_TELEVISION] = TILE_ATTRIBUTES(FALSE, FALSE, FALSE),
[MB_POKEBLOCK_FEEDER] = TILE_ATTRIBUTES(FALSE, FALSE, FALSE),
[MB_UNUSED_88] = TILE_ATTRIBUTES(FALSE, FALSE, FALSE),
[MB_SLOT_MACHINE] = TILE_ATTRIBUTES(FALSE, FALSE, FALSE),
[MB_ROULETTE] = TILE_ATTRIBUTES(FALSE, FALSE, FALSE),
[MB_CLOSED_SOOTOPOLIS_DOOR] = TILE_ATTRIBUTES(FALSE, FALSE, FALSE),
[MB_TRICK_HOUSE_PUZZLE_DOOR] = TILE_ATTRIBUTES(FALSE, FALSE, FALSE),
[MB_PETALBURG_GYM_DOOR] = TILE_ATTRIBUTES(FALSE, FALSE, FALSE),
[MB_RUNNING_SHOES_INSTRUCTION] = TILE_ATTRIBUTES(FALSE, FALSE, FALSE),
[MB_QUESTIONNAIRE] = TILE_ATTRIBUTES(FALSE, FALSE, FALSE),
[MB_SECRET_BASE_SPOT_RED_CAVE] = TILE_ATTRIBUTES(FALSE, FALSE, FALSE),
[MB_SECRET_BASE_SPOT_RED_CAVE_OPEN] = TILE_ATTRIBUTES(FALSE, FALSE, FALSE),
[MB_SECRET_BASE_SPOT_BROWN_CAVE] = TILE_ATTRIBUTES(FALSE, FALSE, FALSE),
[MB_SECRET_BASE_SPOT_BROWN_CAVE_OPEN] = TILE_ATTRIBUTES(FALSE, FALSE, FALSE),
[MB_SECRET_BASE_SPOT_YELLOW_CAVE] = TILE_ATTRIBUTES(FALSE, FALSE, FALSE),
[MB_SECRET_BASE_SPOT_YELLOW_CAVE_OPEN] = TILE_ATTRIBUTES(FALSE, FALSE, FALSE),
[MB_SECRET_BASE_SPOT_TREE_LEFT] = TILE_ATTRIBUTES(FALSE, FALSE, FALSE),
[MB_SECRET_BASE_SPOT_TREE_LEFT_OPEN] = TILE_ATTRIBUTES(FALSE, FALSE, FALSE),
[MB_SECRET_BASE_SPOT_SHRUB] = TILE_ATTRIBUTES(FALSE, FALSE, FALSE),
[MB_SECRET_BASE_SPOT_SHRUB_OPEN] = TILE_ATTRIBUTES(FALSE, FALSE, FALSE),
[MB_SECRET_BASE_SPOT_BLUE_CAVE] = TILE_ATTRIBUTES(FALSE, FALSE, FALSE),
[MB_SECRET_BASE_SPOT_BLUE_CAVE_OPEN] = TILE_ATTRIBUTES(FALSE, FALSE, FALSE),
[MB_SECRET_BASE_SPOT_TREE_RIGHT] = TILE_ATTRIBUTES(FALSE, FALSE, FALSE),
[MB_SECRET_BASE_SPOT_TREE_RIGHT_OPEN] = TILE_ATTRIBUTES(FALSE, FALSE, FALSE),
[MB_UNUSED_9E] = TILE_ATTRIBUTES(FALSE, FALSE, FALSE),
[MB_UNUSED_9F] = TILE_ATTRIBUTES(FALSE, FALSE, FALSE),
[MB_BERRY_TREE_SOIL] = TILE_ATTRIBUTES(FALSE, FALSE, FALSE),
[MB_UNUSED_A1] = TILE_ATTRIBUTES(FALSE, FALSE, FALSE),
[MB_UNUSED_A2] = TILE_ATTRIBUTES(FALSE, FALSE, FALSE),
[MB_UNUSED_A3] = TILE_ATTRIBUTES(FALSE, FALSE, FALSE),
[MB_UNUSED_A4] = TILE_ATTRIBUTES(FALSE, FALSE, FALSE),
[MB_UNUSED_A5] = TILE_ATTRIBUTES(FALSE, FALSE, FALSE),
[MB_UNUSED_A6] = TILE_ATTRIBUTES(FALSE, FALSE, FALSE),
[MB_UNUSED_A7] = TILE_ATTRIBUTES(FALSE, FALSE, FALSE),
[MB_UNUSED_A8] = TILE_ATTRIBUTES(FALSE, FALSE, FALSE),
[MB_UNUSED_A9] = TILE_ATTRIBUTES(FALSE, FALSE, FALSE),
[MB_UNUSED_AA] = TILE_ATTRIBUTES(FALSE, FALSE, FALSE),
[MB_UNUSED_AB] = TILE_ATTRIBUTES(FALSE, FALSE, FALSE),
[MB_UNUSED_AC] = TILE_ATTRIBUTES(FALSE, FALSE, FALSE),
[MB_UNUSED_AD] = TILE_ATTRIBUTES(FALSE, FALSE, FALSE),
[MB_UNUSED_AE] = TILE_ATTRIBUTES(FALSE, FALSE, FALSE),
[MB_UNUSED_AF] = TILE_ATTRIBUTES(FALSE, FALSE, FALSE),
[MB_SECRET_BASE_PC] = TILE_ATTRIBUTES(FALSE, FALSE, FALSE),
[MB_SECRET_BASE_REGISTER_PC] = TILE_ATTRIBUTES(FALSE, FALSE, FALSE),
[MB_SECRET_BASE_UNUSED] = TILE_ATTRIBUTES(TRUE, FALSE, FALSE),
[MB_BLOCK_DECORATION] = TILE_ATTRIBUTES(TRUE, FALSE, FALSE),
[MB_SECRET_BASE_DECORATION] = TILE_ATTRIBUTES(FALSE, FALSE, FALSE),
[MB_SECRET_BASE_LARGE_MAT_EDGE] = TILE_ATTRIBUTES(TRUE, FALSE, FALSE),
[MB_UNUSED_B6] = TILE_ATTRIBUTES(FALSE, FALSE, FALSE),
[MB_SECRET_BASE_NORTH_WALL] = TILE_ATTRIBUTES(FALSE, FALSE, FALSE),
[MB_SECRET_BASE_BALLOON] = TILE_ATTRIBUTES(TRUE, FALSE, FALSE),
[MB_SECRET_BASE_IMPASSABLE] = TILE_ATTRIBUTES(TRUE, FALSE, FALSE),
[MB_SECRET_BASE_GLITTER_MAT] = TILE_ATTRIBUTES(TRUE, FALSE, FALSE),
[MB_SECRET_BASE_JUMP_MAT] = TILE_ATTRIBUTES(TRUE, FALSE, FALSE),
[MB_SECRET_BASE_SPIN_MAT] = TILE_ATTRIBUTES(TRUE, FALSE, FALSE),
[MB_SECRET_BASE_SOUND_MAT] = TILE_ATTRIBUTES(TRUE, FALSE, FALSE),
[MB_SECRET_BASE_BREAKABLE_DOOR] = TILE_ATTRIBUTES(TRUE, FALSE, FALSE),
[MB_SECRET_BASE_SAND_ORNAMENT] = TILE_ATTRIBUTES(FALSE, FALSE, FALSE),
[MB_IMPASSABLE_SOUTH_AND_NORTH] = TILE_ATTRIBUTES(TRUE, FALSE, FALSE),
[MB_IMPASSABLE_WEST_AND_EAST] = TILE_ATTRIBUTES(TRUE, FALSE, FALSE),
[MB_SECRET_BASE_HOLE] = TILE_ATTRIBUTES(TRUE, FALSE, FALSE),
[MB_LARGE_MAT_CENTER] = TILE_ATTRIBUTES(TRUE, FALSE, FALSE),
[MB_SECRET_BASE_TV_SHIELD] = TILE_ATTRIBUTES(TRUE, FALSE, FALSE),
[MB_PLAYER_ROOM_PC_ON] = TILE_ATTRIBUTES(TRUE, FALSE, FALSE),
[MB_C6] = TILE_ATTRIBUTES(FALSE, FALSE, FALSE),
[MB_SECRET_BASE_POSTER] = TILE_ATTRIBUTES(FALSE, FALSE, FALSE),
[MB_UNUSED_C8] = TILE_ATTRIBUTES(FALSE, FALSE, FALSE),
[MB_UNUSED_C9] = TILE_ATTRIBUTES(FALSE, FALSE, FALSE),
[MB_UNUSED_CA] = TILE_ATTRIBUTES(FALSE, FALSE, FALSE),
[MB_UNUSED_CB] = TILE_ATTRIBUTES(FALSE, FALSE, FALSE),
[MB_UNUSED_CC] = TILE_ATTRIBUTES(FALSE, FALSE, FALSE),
[MB_UNUSED_CD] = TILE_ATTRIBUTES(FALSE, FALSE, FALSE),
[MB_UNUSED_CE] = TILE_ATTRIBUTES(FALSE, FALSE, FALSE),
[MB_UNUSED_CF] = TILE_ATTRIBUTES(FALSE, FALSE, FALSE),
[MB_MUDDY_SLOPE] = TILE_ATTRIBUTES(TRUE, FALSE, FALSE),
[MB_BUMPY_SLOPE] = TILE_ATTRIBUTES(TRUE, FALSE, FALSE),
[MB_CRACKED_FLOOR] = TILE_ATTRIBUTES(TRUE, FALSE, FALSE),
[MB_ISOLATED_VERTICAL_RAIL] = TILE_ATTRIBUTES(TRUE, FALSE, FALSE),
[MB_ISOLATED_HORIZONTAL_RAIL] = TILE_ATTRIBUTES(TRUE, FALSE, FALSE),
[MB_VERTICAL_RAIL] = TILE_ATTRIBUTES(TRUE, FALSE, FALSE),
[MB_HORIZONTAL_RAIL] = TILE_ATTRIBUTES(TRUE, FALSE, FALSE),
[MB_UNUSED_D7] = TILE_ATTRIBUTES(FALSE, FALSE, FALSE),
[MB_UNUSED_D8] = TILE_ATTRIBUTES(FALSE, FALSE, FALSE),
[MB_UNUSED_D9] = TILE_ATTRIBUTES(FALSE, FALSE, FALSE),
[MB_UNUSED_DA] = TILE_ATTRIBUTES(FALSE, FALSE, FALSE),
[MB_UNUSED_DB] = TILE_ATTRIBUTES(FALSE, FALSE, FALSE),
[MB_UNUSED_DC] = TILE_ATTRIBUTES(FALSE, FALSE, FALSE),
[MB_UNUSED_DD] = TILE_ATTRIBUTES(FALSE, FALSE, FALSE),
[MB_UNUSED_DE] = TILE_ATTRIBUTES(FALSE, FALSE, FALSE),
[MB_UNUSED_DF] = TILE_ATTRIBUTES(FALSE, FALSE, FALSE),
[MB_PICTURE_BOOK_SHELF] = TILE_ATTRIBUTES(FALSE, FALSE, FALSE),
[MB_BOOKSHELF] = TILE_ATTRIBUTES(FALSE, FALSE, FALSE),
[MB_POKEMON_CENTER_BOOKSHELF] = TILE_ATTRIBUTES(FALSE, FALSE, FALSE),
[MB_VASE] = TILE_ATTRIBUTES(FALSE, FALSE, FALSE),
[MB_TRASH_CAN] = TILE_ATTRIBUTES(FALSE, FALSE, FALSE),
[MB_SHOP_SHELF] = TILE_ATTRIBUTES(FALSE, FALSE, FALSE),
[MB_BLUEPRINT] = TILE_ATTRIBUTES(FALSE, FALSE, FALSE),
[MB_CABLE_BOX_RESULTS_2] = TILE_ATTRIBUTES(FALSE, FALSE, FALSE),
[MB_WIRELESS_BOX_RESULTS] = TILE_ATTRIBUTES(FALSE, FALSE, FALSE),
[MB_TRAINER_HILL_TIMER] = TILE_ATTRIBUTES(FALSE, FALSE, FALSE),
[MB_UNKNOWN_CLOSED_DOOR] = TILE_ATTRIBUTES(FALSE, FALSE, FALSE),
[MB_UNUSED_EB] = TILE_ATTRIBUTES(FALSE, FALSE, FALSE),
[MB_UNUSED_EC] = TILE_ATTRIBUTES(FALSE, FALSE, FALSE),
[MB_UNUSED_ED] = TILE_ATTRIBUTES(FALSE, FALSE, FALSE),
[MB_UNUSED_EE] = TILE_ATTRIBUTES(FALSE, FALSE, FALSE),
[MB_UNUSED_EF] = TILE_ATTRIBUTES(FALSE, FALSE, FALSE),
};
bool8 MetatileBehavior_IsATile(u8 metatileBehavior)

View File

@ -2141,7 +2141,7 @@ static const struct SpriteTemplate sSpriteTemplate_Underscore =
static const struct SpriteTemplate gUnknown_0858C180 =
{
.tileTag = INVALID_U16,
.tileTag = 0xFFFF,
.paletteTag = 0x0000,
.oam = &gOamData_858BFEC,
.anims = gSpriteAnimTable_858C0BC,

View File

@ -205,14 +205,14 @@ void NewGameInitData(void)
ScriptContext2_RunNewScript(EventScript_2715DE);
ResetMiniGamesResults();
copy_strings_to_sav1();
SetLilycoveLady();
ResetAllApprenticeData();
ClearRankingHallRecords();
sub_8195E10();
sub_801AFD8();
sub_800E5AC();
sub_81D54BC();
ResetContestLinkResults();
SetLilycoveLady();
ResetAllApprenticeData();
ClearRankingHallRecords();
sub_8195E10();
sub_801AFD8();
sub_800E5AC();
sub_81D54BC();
ResetContestLinkResults();
}
static void ResetMiniGamesResults(void)

View File

@ -296,15 +296,51 @@ static const u8 sUnusedData[] =
const struct UCoords32 gDirectionToVectors[] =
{
{ 0, 0}, // DIR_NONE
{ 0, 1}, // DIR_SOUTH
{ 0, -1}, // DIR_NORTH
{-1, 0}, // DIR_WEST
{ 1, 0}, // DIR_EAST
{-1, 1}, // DIR_SOUTHWEST
{ 1, 1}, // DIR_SOUTHEAST
{-1, -1}, // DIR_NORTHWEST
{ 1, -1}, // DIR_NORTHEAST
[DIR_NONE] =
{
.x = 0,
.y = 0,
},
[DIR_SOUTH] =
{
.x = 0,
.y = 1,
},
[DIR_NORTH] =
{
.x = 0,
.y = -1,
},
[DIR_WEST] =
{
.x = -1,
.y = 0,
},
[DIR_EAST] =
{
.x = 1,
.y = 0,
},
[DIR_SOUTHWEST] =
{
.x = -1,
.y = 1,
},
[DIR_SOUTHEAST] =
{
.x = 1,
.y = 1,
},
[DIR_NORTHWEST] =
{
.x = -1,
.y = -1,
},
[DIR_NORTHEAST] =
{
.x = 1,
.y = -1,
},
};
static const struct BgTemplate gUnknown_08339DAC[] =
@ -1110,7 +1146,7 @@ static bool16 IsInflitratedSpaceCenter(struct WarpData *warp)
u16 GetLocationMusic(struct WarpData *warp)
{
if (NoMusicInSotopolisWithLegendaries(warp) == TRUE)
return INVALID_U16;
return 0xFFFF;
else if (ShouldLegendaryMusicPlayAtLocation(warp) == TRUE)
return MUS_OOAME;
else if (IsInflitratedSpaceCenter(warp) == TRUE)
@ -1171,7 +1207,7 @@ void Overworld_PlaySpecialMapMusic(void)
{
u16 music = GetCurrLocationDefaultMusic();
if (music != MUS_OOAME && music != INVALID_U16)
if (music != MUS_OOAME && music != 0xFFFF)
{
if (gSaveBlock1Ptr->savedMusic)
music = gSaveBlock1Ptr->savedMusic;
@ -1201,7 +1237,7 @@ static void sub_8085810(void)
{
u16 newMusic = GetWarpDestinationMusic();
u16 currentMusic = GetCurrentMapMusic();
if (newMusic != MUS_OOAME && newMusic != INVALID_U16)
if (newMusic != MUS_OOAME && newMusic != 0xFFFF)
{
if (currentMusic == MUS_DEEPDEEP || currentMusic == MUS_NAMINORI)
return;

View File

@ -63,7 +63,7 @@ static EWRAM_DATA u32 sPlttBufferTransferPending = 0;
EWRAM_DATA u8 gPaletteDecompressionBuffer[PLTT_DECOMP_BUFFER_SIZE] = {0};
static const struct PaletteStructTemplate gDummyPaletteStructTemplate = {
.uid = INVALID_U16,
.uid = 0xFFFF,
.pst_field_B_5 = 1
};

View File

@ -435,7 +435,7 @@ void OpenPokeblockCase(u8 caseId, void (*callback)(void))
sPokeblockMenu = Alloc(sizeof(*sPokeblockMenu));
sPokeblockMenu->caseId = caseId;
sPokeblockMenu->callbackOnUse = NULL;
sPokeblockMenu->unkTaskId = INVALID_U8;
sPokeblockMenu->unkTaskId = 0xFF;
sPokeblockMenu->isSwapping = FALSE;
sSavedPokeblockData.callback = callback;
@ -901,7 +901,7 @@ static void sub_8136344(void)
static void sub_81363BC(void)
{
if (sPokeblockMenu->unkTaskId == INVALID_U8)
if (sPokeblockMenu->unkTaskId == 0xFF)
{
sPokeblockMenu->unkTaskId = AddScrollIndicatorArrowPairParameterized(SCROLL_ARROW_UP, 0xB0, 8, 0x98, sPokeblockMenu->itemsNo - sPokeblockMenu->maxShowed,
0x456, 0x456, &sSavedPokeblockData.lastItemPage);
@ -910,10 +910,10 @@ static void sub_81363BC(void)
static void sub_8136418(void)
{
if (sPokeblockMenu->unkTaskId != INVALID_U8)
if (sPokeblockMenu->unkTaskId != 0xFF)
{
RemoveScrollIndicatorArrowPair(sPokeblockMenu->unkTaskId);
sPokeblockMenu->unkTaskId = INVALID_U8;
sPokeblockMenu->unkTaskId = 0xFF;
}
}
@ -1016,7 +1016,7 @@ static void Task_HandlePokeblockMenuInput(u8 taskId)
break;
case LIST_B_PRESSED:
PlaySE(SE_SELECT);
gSpecialVar_Result = INVALID_U16;
gSpecialVar_Result = 0xFFFF;
gSpecialVar_ItemId = 0;
FadePaletteAndSetTaskToClosePokeblockCase(taskId);
break;

View File

@ -88,31 +88,31 @@ EWRAM_DATA static struct CompressedSpritePalette sPokeblockSpritePal = {0};
// const rom data
static const u8 sNatureToMonPokeblockAnim[][2] =
{
{ 0, 0 }, // HARDY
{ 3, 0 }, // LONELY
{ 4, 1 }, // BRAVE
{ 5, 0 }, // ADAMANT
{ 10, 0 }, // NAUGHTY
{ 13, 0 }, // BOLD
{ 15, 0 }, // DOCILE
{ 16, 2 }, // RELAXED
{ 18, 0 }, // IMPISH
{ 19, 0 }, // LAX
{ 20, 0 }, // TIMID
{ 25, 0 }, // HASTY
{ 27, 3 }, // SERIOUS
{ 28, 0 }, // JOLLY
{ 29, 0 }, // NAIVE
{ 33, 4 }, // MODEST
{ 36, 0 }, // MILD
{ 37, 0 }, // QUIET
{ 39, 0 }, // BASHFUL
{ 42, 0 }, // RASH
{ 45, 0 }, // CALM
{ 46, 5 }, // GENTLE
{ 47, 6 }, // SASSY
{ 48, 0 }, // CAREFUL
{ 53, 0 }, // QUIRKY
[NATURE_HARDY] = { 0, 0 },
[NATURE_LONELY] = { 3, 0 },
[NATURE_BRAVE] = { 4, 1 },
[NATURE_ADAMANT] = { 5, 0 },
[NATURE_NAUGHTY] = { 10, 0 },
[NATURE_BOLD] = { 13, 0 },
[NATURE_DOCILE] = { 15, 0 },
[NATURE_RELAXED] = { 16, 2 },
[NATURE_IMPISH] = { 18, 0 },
[NATURE_LAX] = { 19, 0 },
[NATURE_TIMID] = { 20, 0 },
[NATURE_HASTY] = { 25, 0 },
[NATURE_SERIOUS] = { 27, 3 },
[NATURE_JOLLY] = { 28, 0 },
[NATURE_NAIVE] = { 29, 0 },
[NATURE_MODEST] = { 33, 4 },
[NATURE_MILD] = { 36, 0 },
[NATURE_QUIET] = { 37, 0 },
[NATURE_BASHFUL] = { 39, 0 },
[NATURE_RASH] = { 42, 0 },
[NATURE_CALM] = { 45, 0 },
[NATURE_GENTLE] = { 46, 5 },
[NATURE_SASSY] = { 47, 6 },
[NATURE_CAREFUL] = { 48, 0 },
[NATURE_QUIRKY] = { 53, 0 },
};
static const s16 sMonPokeblockAnims[][10] =

View File

@ -1271,7 +1271,7 @@ static void ResetPokedexView(struct PokedexView *pokedexView)
pokedexView->seenCount = 0;
pokedexView->ownCount = 0;
for (i = 0; i <= 3; i++)
pokedexView->unk61E[i] |= INVALID_U16;
pokedexView->unk61E[i] |= 0xFFFF;
pokedexView->unk628 = 0;
pokedexView->unk62A = 0;
pokedexView->unk62C = 0;
@ -2459,7 +2459,7 @@ u32 sub_80BDACC(u16 num, s16 x, s16 y)
return spriteId;
}
}
return INVALID_U16;
return 0xFFFF;
}
static void CreateInterfaceSprites(u8 a)
@ -2717,8 +2717,8 @@ void sub_80BE4E0(struct Sprite *sprite)
sprite->pos2.y = gSineTable[(u8)sprite->data[5]] * 76 / 256;
var = 0x10000 / gSineTable[sprite->data[5] + 0x40];
if (var > INVALID_U16)
var = INVALID_U16;
if (var > 0xFFFF)
var = 0xFFFF;
SetOamMatrix(sprite->data[1] + 1, 0x100, 0, 0, var);
sprite->oam.matrixNum = data1 + 1;
@ -3558,61 +3558,61 @@ void sub_80BFD0C(u8 a, u16 unused)
{
asm(".syntax unified\n\
push {r4-r7,lr}\n\
mov r7, r8\n\
push {r7}\n\
lsls r0, 24\n\
lsrs r0, 24\n\
mov r8, r0\n\
movs r0, 0x1\n\
bl GetBgTilemapBuffer\n\
adds r7, r0, 0\n\
movs r1, 0\n\
mov r7, r8\n\
push {r7}\n\
lsls r0, 24\n\
lsrs r0, 24\n\
mov r8, r0\n\
movs r0, 0x1\n\
bl GetBgTilemapBuffer\n\
adds r7, r0, 0\n\
movs r1, 0\n\
_080BFD22:\n\
lsls r0, r1, 3\n\
subs r0, r1\n\
adds r0, 0x1\n\
lsls r0, 24\n\
lsrs r5, r0, 24\n\
movs r3, 0x80\n\
lsls r3, 7\n\
cmp r1, r8\n\
bne _080BFD38\n\
movs r3, 0x80\n\
lsls r3, 6\n\
lsls r0, r1, 3\n\
subs r0, r1\n\
adds r0, 0x1\n\
lsls r0, 24\n\
lsrs r5, r0, 24\n\
movs r3, 0x80\n\
lsls r3, 7\n\
cmp r1, r8\n\
bne _080BFD38\n\
movs r3, 0x80\n\
lsls r3, 6\n\
_080BFD38:\n\
movs r2, 0\n\
adds r6, r1, 0x1\n\
ldr r4, =0x00000fff\n\
movs r2, 0\n\
adds r6, r1, 0x1\n\
ldr r4, =0x00000fff\n\
_080BFD3E:\n\
adds r1, r5, r2\n\
lsls r1, 1\n\
adds r1, r7\n\
ldrh r0, [r1]\n\
ands r0, r4\n\
orrs r0, r3\n\
strh r0, [r1]\n\
adds r1, 0x40\n\
ldrh r0, [r1]\n\
ands r0, r4\n\
orrs r0, r3\n\
strh r0, [r1]\n\
adds r0, r2, 0x1\n\
lsls r0, 24\n\
lsrs r2, r0, 24\n\
cmp r2, 0x6\n\
bls _080BFD3E\n\
lsls r0, r6, 24\n\
lsrs r1, r0, 24\n\
cmp r1, 0x3\n\
bls _080BFD22\n\
movs r0, 0x1\n\
bl CopyBgTilemapBufferToVram\n\
pop {r3}\n\
mov r8, r3\n\
pop {r4-r7}\n\
pop {r0}\n\
bx r0\n\
.pool\n\
adds r1, r5, r2\n\
lsls r1, 1\n\
adds r1, r7\n\
ldrh r0, [r1]\n\
ands r0, r4\n\
orrs r0, r3\n\
strh r0, [r1]\n\
adds r1, 0x40\n\
ldrh r0, [r1]\n\
ands r0, r4\n\
orrs r0, r3\n\
strh r0, [r1]\n\
adds r0, r2, 0x1\n\
lsls r0, 24\n\
lsrs r2, r0, 24\n\
cmp r2, 0x6\n\
bls _080BFD3E\n\
lsls r0, r6, 24\n\
lsrs r1, r0, 24\n\
cmp r1, 0x3\n\
bls _080BFD22\n\
movs r0, 0x1\n\
bl CopyBgTilemapBufferToVram\n\
pop {r3}\n\
mov r8, r3\n\
pop {r4-r7}\n\
pop {r0}\n\
bx r0\n\
.pool\n\
.syntax divided\n");
}
#endif
@ -3648,66 +3648,66 @@ void sub_80BFD7C(u8 a, u16 b)
{
asm(".syntax unified\n\
push {r4-r7,lr}\n\
mov r7, r8\n\
push {r7}\n\
lsls r0, 24\n\
lsrs r0, 24\n\
mov r8, r0\n\
movs r0, 0x1\n\
bl GetBgTilemapBuffer\n\
adds r7, r0, 0\n\
movs r1, 0\n\
mov r7, r8\n\
push {r7}\n\
lsls r0, 24\n\
lsrs r0, 24\n\
mov r8, r0\n\
movs r0, 0x1\n\
bl GetBgTilemapBuffer\n\
adds r7, r0, 0\n\
movs r1, 0\n\
_080BFD92:\n\
lsls r0, r1, 3\n\
subs r0, r1\n\
adds r0, 0x1\n\
lsls r0, 24\n\
lsrs r6, r0, 24\n\
cmp r1, r8\n\
beq _080BFDA4\n\
cmp r1, 0x3\n\
bne _080BFDAA\n\
lsls r0, r1, 3\n\
subs r0, r1\n\
adds r0, 0x1\n\
lsls r0, 24\n\
lsrs r6, r0, 24\n\
cmp r1, r8\n\
beq _080BFDA4\n\
cmp r1, 0x3\n\
bne _080BFDAA\n\
_080BFDA4:\n\
movs r3, 0x80\n\
lsls r3, 6\n\
b _080BFDAE\n\
movs r3, 0x80\n\
lsls r3, 6\n\
b _080BFDAE\n\
_080BFDAA:\n\
movs r3, 0x80\n\
lsls r3, 7\n\
movs r3, 0x80\n\
lsls r3, 7\n\
_080BFDAE:\n\
movs r2, 0\n\
adds r5, r1, 0x1\n\
ldr r4, =0x00000fff\n\
movs r2, 0\n\
adds r5, r1, 0x1\n\
ldr r4, =0x00000fff\n\
_080BFDB4:\n\
adds r1, r6, r2\n\
lsls r1, 1\n\
adds r1, r7\n\
ldrh r0, [r1]\n\
ands r0, r4\n\
orrs r0, r3\n\
strh r0, [r1]\n\
adds r1, 0x40\n\
ldrh r0, [r1]\n\
ands r0, r4\n\
orrs r0, r3\n\
strh r0, [r1]\n\
adds r0, r2, 0x1\n\
lsls r0, 24\n\
lsrs r2, r0, 24\n\
cmp r2, 0x6\n\
bls _080BFDB4\n\
lsls r0, r5, 24\n\
lsrs r1, r0, 24\n\
cmp r1, 0x3\n\
bls _080BFD92\n\
movs r0, 0x1\n\
bl CopyBgTilemapBufferToVram\n\
pop {r3}\n\
mov r8, r3\n\
pop {r4-r7}\n\
pop {r0}\n\
bx r0\n\
.pool\n\
adds r1, r6, r2\n\
lsls r1, 1\n\
adds r1, r7\n\
ldrh r0, [r1]\n\
ands r0, r4\n\
orrs r0, r3\n\
strh r0, [r1]\n\
adds r1, 0x40\n\
ldrh r0, [r1]\n\
ands r0, r4\n\
orrs r0, r3\n\
strh r0, [r1]\n\
adds r0, r2, 0x1\n\
lsls r0, 24\n\
lsrs r2, r0, 24\n\
cmp r2, 0x6\n\
bls _080BFDB4\n\
lsls r0, r5, 24\n\
lsrs r1, r0, 24\n\
cmp r1, 0x3\n\
bls _080BFD92\n\
movs r0, 0x1\n\
bl CopyBgTilemapBufferToVram\n\
pop {r3}\n\
mov r8, r3\n\
pop {r4-r7}\n\
pop {r0}\n\
bx r0\n\
.pool\n\
.syntax divided\n");
}
#endif
@ -4012,216 +4012,216 @@ void sub_80C0460(u16 weight, u8 left, u8 top)
{
asm(".syntax unified\n\
push {r4-r7,lr}\n\
mov r7, r10\n\
mov r6, r9\n\
mov r5, r8\n\
push {r5-r7}\n\
sub sp, 0x14\n\
lsls r0, 16\n\
lsrs r0, 16\n\
lsls r1, 24\n\
lsrs r1, 24\n\
mov r10, r1\n\
lsls r2, 24\n\
lsrs r2, 24\n\
str r2, [sp, 0x10]\n\
ldr r5, =0x000186a0\n\
muls r0, r5\n\
ldr r1, =0x000011b8\n\
bl __divsi3\n\
adds r7, r0, 0\n\
movs r1, 0xA\n\
bl __umodsi3\n\
cmp r0, 0x4\n\
bls _080C0494\n\
adds r7, 0xA\n\
mov r7, r10\n\
mov r6, r9\n\
mov r5, r8\n\
push {r5-r7}\n\
sub sp, 0x14\n\
lsls r0, 16\n\
lsrs r0, 16\n\
lsls r1, 24\n\
lsrs r1, 24\n\
mov r10, r1\n\
lsls r2, 24\n\
lsrs r2, 24\n\
str r2, [sp, 0x10]\n\
ldr r5, =0x000186a0\n\
muls r0, r5\n\
ldr r1, =0x000011b8\n\
bl __divsi3\n\
adds r7, r0, 0\n\
movs r1, 0xA\n\
bl __umodsi3\n\
cmp r0, 0x4\n\
bls _080C0494\n\
adds r7, 0xA\n\
_080C0494:\n\
movs r0, 0\n\
mov r8, r0\n\
mov r4, sp\n\
adds r0, r7, 0\n\
adds r1, r5, 0\n\
bl __udivsi3\n\
adds r0, 0xA1\n\
strb r0, [r4]\n\
lsls r0, 24\n\
lsrs r0, 24\n\
cmp r0, 0xA1\n\
bne _080C04C0\n\
movs r6, 0x1\n\
mov r1, sp\n\
movs r0, 0x77\n\
strb r0, [r1]\n\
b _080C04C6\n\
.pool\n\
movs r0, 0\n\
mov r8, r0\n\
mov r4, sp\n\
adds r0, r7, 0\n\
adds r1, r5, 0\n\
bl __udivsi3\n\
adds r0, 0xA1\n\
strb r0, [r4]\n\
lsls r0, 24\n\
lsrs r0, 24\n\
cmp r0, 0xA1\n\
bne _080C04C0\n\
movs r6, 0x1\n\
mov r1, sp\n\
movs r0, 0x77\n\
strb r0, [r1]\n\
b _080C04C6\n\
.pool\n\
_080C04C0:\n\
movs r1, 0x1\n\
mov r8, r1\n\
movs r6, 0x1\n\
movs r1, 0x1\n\
mov r8, r1\n\
movs r6, 0x1\n\
_080C04C6:\n\
ldr r1, =0x000186a0\n\
adds r0, r7, 0\n\
bl __umodsi3\n\
adds r7, r0, 0\n\
mov r4, sp\n\
adds r4, 0x1\n\
ldr r1, =0x00002710\n\
bl __udivsi3\n\
adds r0, 0xA1\n\
strb r0, [r4]\n\
lsls r0, 24\n\
lsrs r0, 24\n\
cmp r0, 0xA1\n\
bne _080C0504\n\
mov r2, r8\n\
cmp r2, 0\n\
bne _080C0504\n\
adds r1, r6, 0\n\
adds r0, r1, 0x1\n\
lsls r0, 24\n\
lsrs r6, r0, 24\n\
add r1, sp\n\
movs r0, 0x77\n\
strb r0, [r1]\n\
b _080C050E\n\
.pool\n\
ldr r1, =0x000186a0\n\
adds r0, r7, 0\n\
bl __umodsi3\n\
adds r7, r0, 0\n\
mov r4, sp\n\
adds r4, 0x1\n\
ldr r1, =0x00002710\n\
bl __udivsi3\n\
adds r0, 0xA1\n\
strb r0, [r4]\n\
lsls r0, 24\n\
lsrs r0, 24\n\
cmp r0, 0xA1\n\
bne _080C0504\n\
mov r2, r8\n\
cmp r2, 0\n\
bne _080C0504\n\
adds r1, r6, 0\n\
adds r0, r1, 0x1\n\
lsls r0, 24\n\
lsrs r6, r0, 24\n\
add r1, sp\n\
movs r0, 0x77\n\
strb r0, [r1]\n\
b _080C050E\n\
.pool\n\
_080C0504:\n\
movs r3, 0x1\n\
mov r8, r3\n\
adds r0, r6, 0x1\n\
lsls r0, 24\n\
lsrs r6, r0, 24\n\
movs r3, 0x1\n\
mov r8, r3\n\
adds r0, r6, 0x1\n\
lsls r0, 24\n\
lsrs r6, r0, 24\n\
_080C050E:\n\
ldr r1, =0x00002710\n\
adds r0, r7, 0\n\
bl __umodsi3\n\
adds r7, r0, 0\n\
mov r0, sp\n\
adds r4, r0, r6\n\
movs r1, 0xFA\n\
lsls r1, 2\n\
adds r0, r7, 0\n\
bl __udivsi3\n\
adds r0, 0xA1\n\
strb r0, [r4]\n\
lsls r0, 24\n\
lsrs r0, 24\n\
cmp r0, 0xA1\n\
bne _080C054C\n\
mov r1, r8\n\
cmp r1, 0\n\
bne _080C054C\n\
adds r1, r6, 0\n\
adds r0, r1, 0x1\n\
lsls r0, 24\n\
lsrs r6, r0, 24\n\
add r1, sp\n\
movs r0, 0x77\n\
strb r0, [r1]\n\
b _080C0552\n\
.pool\n\
ldr r1, =0x00002710\n\
adds r0, r7, 0\n\
bl __umodsi3\n\
adds r7, r0, 0\n\
mov r0, sp\n\
adds r4, r0, r6\n\
movs r1, 0xFA\n\
lsls r1, 2\n\
adds r0, r7, 0\n\
bl __udivsi3\n\
adds r0, 0xA1\n\
strb r0, [r4]\n\
lsls r0, 24\n\
lsrs r0, 24\n\
cmp r0, 0xA1\n\
bne _080C054C\n\
mov r1, r8\n\
cmp r1, 0\n\
bne _080C054C\n\
adds r1, r6, 0\n\
adds r0, r1, 0x1\n\
lsls r0, 24\n\
lsrs r6, r0, 24\n\
add r1, sp\n\
movs r0, 0x77\n\
strb r0, [r1]\n\
b _080C0552\n\
.pool\n\
_080C054C:\n\
adds r0, r6, 0x1\n\
lsls r0, 24\n\
lsrs r6, r0, 24\n\
adds r0, r6, 0x1\n\
lsls r0, 24\n\
lsrs r6, r0, 24\n\
_080C0552:\n\
movs r1, 0xFA\n\
lsls r1, 2\n\
adds r0, r7, 0\n\
bl __umodsi3\n\
adds r7, r0, 0\n\
adds r1, r6, 0\n\
adds r0, r1, 0x1\n\
lsls r0, 24\n\
lsrs r6, r0, 24\n\
adds r5, r6, 0\n\
mov r2, sp\n\
adds r4, r2, r1\n\
adds r0, r7, 0\n\
movs r1, 0x64\n\
bl __udivsi3\n\
adds r0, 0xA1\n\
movs r3, 0\n\
mov r9, r3\n\
strb r0, [r4]\n\
adds r0, r7, 0\n\
movs r1, 0x64\n\
bl __umodsi3\n\
adds r7, r0, 0\n\
adds r0, r5, 0x1\n\
lsls r0, 24\n\
lsrs r6, r0, 24\n\
adds r1, r6, 0\n\
mov r2, sp\n\
adds r0, r2, r5\n\
movs r3, 0xAD\n\
mov r8, r3\n\
mov r2, r8\n\
strb r2, [r0]\n\
adds r0, r1, 0x1\n\
lsls r0, 24\n\
lsrs r6, r0, 24\n\
adds r5, r6, 0\n\
mov r3, sp\n\
adds r4, r3, r1\n\
adds r0, r7, 0\n\
movs r1, 0xA\n\
bl __udivsi3\n\
adds r0, 0xA1\n\
strb r0, [r4]\n\
adds r0, r5, 0x1\n\
lsls r0, 24\n\
lsrs r6, r0, 24\n\
adds r1, r6, 0\n\
mov r2, sp\n\
adds r0, r2, r5\n\
mov r3, r9\n\
strb r3, [r0]\n\
adds r0, r1, 0x1\n\
lsls r0, 24\n\
lsrs r6, r0, 24\n\
adds r2, r6, 0\n\
add r1, sp\n\
movs r0, 0xE0\n\
strb r0, [r1]\n\
adds r0, r2, 0x1\n\
lsls r0, 24\n\
lsrs r6, r0, 24\n\
adds r3, r6, 0\n\
mov r0, sp\n\
adds r1, r0, r2\n\
movs r0, 0xD6\n\
strb r0, [r1]\n\
adds r0, r3, 0x1\n\
lsls r0, 24\n\
lsrs r6, r0, 24\n\
adds r2, r6, 0\n\
mov r0, sp\n\
adds r1, r0, r3\n\
movs r0, 0xE7\n\
strb r0, [r1]\n\
adds r0, r2, 0x1\n\
lsls r0, 24\n\
lsrs r0, 24\n\
mov r3, sp\n\
adds r1, r3, r2\n\
mov r2, r8\n\
strb r2, [r1]\n\
adds r1, r3, r0\n\
movs r0, 0xFF\n\
strb r0, [r1]\n\
mov r0, sp\n\
mov r1, r10\n\
ldr r2, [sp, 0x10]\n\
bl sub_80BE8DC\n\
add sp, 0x14\n\
pop {r3-r5}\n\
mov r8, r3\n\
mov r9, r4\n\
mov r10, r5\n\
pop {r4-r7}\n\
pop {r0}\n\
bx r0\n\
movs r1, 0xFA\n\
lsls r1, 2\n\
adds r0, r7, 0\n\
bl __umodsi3\n\
adds r7, r0, 0\n\
adds r1, r6, 0\n\
adds r0, r1, 0x1\n\
lsls r0, 24\n\
lsrs r6, r0, 24\n\
adds r5, r6, 0\n\
mov r2, sp\n\
adds r4, r2, r1\n\
adds r0, r7, 0\n\
movs r1, 0x64\n\
bl __udivsi3\n\
adds r0, 0xA1\n\
movs r3, 0\n\
mov r9, r3\n\
strb r0, [r4]\n\
adds r0, r7, 0\n\
movs r1, 0x64\n\
bl __umodsi3\n\
adds r7, r0, 0\n\
adds r0, r5, 0x1\n\
lsls r0, 24\n\
lsrs r6, r0, 24\n\
adds r1, r6, 0\n\
mov r2, sp\n\
adds r0, r2, r5\n\
movs r3, 0xAD\n\
mov r8, r3\n\
mov r2, r8\n\
strb r2, [r0]\n\
adds r0, r1, 0x1\n\
lsls r0, 24\n\
lsrs r6, r0, 24\n\
adds r5, r6, 0\n\
mov r3, sp\n\
adds r4, r3, r1\n\
adds r0, r7, 0\n\
movs r1, 0xA\n\
bl __udivsi3\n\
adds r0, 0xA1\n\
strb r0, [r4]\n\
adds r0, r5, 0x1\n\
lsls r0, 24\n\
lsrs r6, r0, 24\n\
adds r1, r6, 0\n\
mov r2, sp\n\
adds r0, r2, r5\n\
mov r3, r9\n\
strb r3, [r0]\n\
adds r0, r1, 0x1\n\
lsls r0, 24\n\
lsrs r6, r0, 24\n\
adds r2, r6, 0\n\
add r1, sp\n\
movs r0, 0xE0\n\
strb r0, [r1]\n\
adds r0, r2, 0x1\n\
lsls r0, 24\n\
lsrs r6, r0, 24\n\
adds r3, r6, 0\n\
mov r0, sp\n\
adds r1, r0, r2\n\
movs r0, 0xD6\n\
strb r0, [r1]\n\
adds r0, r3, 0x1\n\
lsls r0, 24\n\
lsrs r6, r0, 24\n\
adds r2, r6, 0\n\
mov r0, sp\n\
adds r1, r0, r3\n\
movs r0, 0xE7\n\
strb r0, [r1]\n\
adds r0, r2, 0x1\n\
lsls r0, 24\n\
lsrs r0, 24\n\
mov r3, sp\n\
adds r1, r3, r2\n\
mov r2, r8\n\
strb r2, [r1]\n\
adds r1, r3, r0\n\
movs r0, 0xFF\n\
strb r0, [r1]\n\
mov r0, sp\n\
mov r1, r10\n\
ldr r2, [sp, 0x10]\n\
bl sub_80BE8DC\n\
add sp, 0x14\n\
pop {r3-r5}\n\
mov r8, r3\n\
mov r9, r4\n\
mov r10, r5\n\
pop {r4-r7}\n\
pop {r0}\n\
bx r0\n\
.syntax divided\n");
}
#endif
@ -4627,12 +4627,12 @@ u32 sub_80C0E68(u16 a)
u16 sub_80C0E9C(u16 num, s16 x, s16 y, u16 paletteSlot)
{
num = NationalPokedexNumToSpecies(num);
return CreateMonPicSprite_HandleDeoxys(num, 8, sub_80C0E68(num), TRUE, x, y, paletteSlot, INVALID_U16);
return CreateMonPicSprite_HandleDeoxys(num, 8, sub_80C0E68(num), TRUE, x, y, paletteSlot, 0xFFFF);
}
u16 sub_80C0EF8(u16 species, s16 x, s16 y, s8 paletteSlot)
{
return CreateTrainerPicSprite(species, TRUE, x, y, paletteSlot, INVALID_U16);
return CreateTrainerPicSprite(species, TRUE, x, y, paletteSlot, 0xFFFF);
}
int sub_80C0F30(u8 dexMode, u8 sortMode, u8 abcGroup, u8 bodyColor, u8 type1, u8 type2)
@ -4655,7 +4655,7 @@ int sub_80C0F30(u8 dexMode, u8 sortMode, u8 abcGroup, u8 bodyColor, u8 type1, u8
sPokedexView->pokemonListCount = resultsCount;
// Search by name
if (abcGroup != INVALID_U8)
if (abcGroup != 0xFF)
{
for (i = 0, resultsCount = 0; i < sPokedexView->pokemonListCount; i++)
{
@ -4674,7 +4674,7 @@ int sub_80C0F30(u8 dexMode, u8 sortMode, u8 abcGroup, u8 bodyColor, u8 type1, u8
}
// Search by body color
if (bodyColor != INVALID_U8)
if (bodyColor != 0xFF)
{
for (i = 0, resultsCount = 0; i < sPokedexView->pokemonListCount; i++)
{
@ -4690,15 +4690,15 @@ int sub_80C0F30(u8 dexMode, u8 sortMode, u8 abcGroup, u8 bodyColor, u8 type1, u8
}
// Search by type
if (type1 != INVALID_U8 || type2 != INVALID_U8)
if (type1 != 0xFF || type2 != 0xFF)
{
if (type1 == INVALID_U8)
if (type1 == 0xFF)
{
type1 = type2;
type2 = INVALID_U8;
type2 = 0xFF;
}
if (type2 == INVALID_U8)
if (type2 == 0xFF)
{
for (i = 0, resultsCount = 0; i < sPokedexView->pokemonListCount; i++)
{
@ -4744,7 +4744,6 @@ int sub_80C0F30(u8 dexMode, u8 sortMode, u8 abcGroup, u8 bodyColor, u8 type1, u8
sPokedexView->pokedexList[i].dexNum = 0xFFFF;
sPokedexView->pokedexList[i].seen = FALSE;
sPokedexView->pokedexList[i].owned = FALSE;
}
}
@ -4987,7 +4986,7 @@ void sub_80C170C(u8 taskId)
return;
}
if ((gMain.newKeys & DPAD_LEFT) && r6[gTasks[taskId].data[1]][0] != INVALID_U8)
if ((gMain.newKeys & DPAD_LEFT) && r6[gTasks[taskId].data[1]][0] != 0xFF)
{
PlaySE(SE_SELECT);
gTasks[taskId].data[1] = r6[gTasks[taskId].data[1]][0];
@ -4995,7 +4994,7 @@ void sub_80C170C(u8 taskId)
CopyWindowToVram(0, 2);
CopyBgTilemapBufferToVram(3);
}
if ((gMain.newKeys & DPAD_RIGHT) && r6[gTasks[taskId].data[1]][1] != INVALID_U8)
if ((gMain.newKeys & DPAD_RIGHT) && r6[gTasks[taskId].data[1]][1] != 0xFF)
{
PlaySE(SE_SELECT);
gTasks[taskId].data[1] = r6[gTasks[taskId].data[1]][1];
@ -5003,7 +5002,7 @@ void sub_80C170C(u8 taskId)
CopyWindowToVram(0, 2);
CopyBgTilemapBufferToVram(3);
}
if ((gMain.newKeys & DPAD_UP) && r6[gTasks[taskId].data[1]][2] != INVALID_U8)
if ((gMain.newKeys & DPAD_UP) && r6[gTasks[taskId].data[1]][2] != 0xFF)
{
PlaySE(SE_SELECT);
gTasks[taskId].data[1] = r6[gTasks[taskId].data[1]][2];
@ -5011,7 +5010,7 @@ void sub_80C170C(u8 taskId)
CopyWindowToVram(0, 2);
CopyBgTilemapBufferToVram(3);
}
if ((gMain.newKeys & DPAD_DOWN) && r6[gTasks[taskId].data[1]][3] != INVALID_U8)
if ((gMain.newKeys & DPAD_DOWN) && r6[gTasks[taskId].data[1]][3] != 0xFF)
{
PlaySE(SE_SELECT);
gTasks[taskId].data[1] = r6[gTasks[taskId].data[1]][3];
@ -5215,54 +5214,54 @@ void sub_80C1D98(u8 a, u8 b, u8 c, u8 d)
{
asm(".syntax unified\n\
push {r4-r7,lr}\n\
mov r7, r8\n\
push {r7}\n\
adds r4, r3, 0\n\
lsls r0, 24\n\
lsrs r6, r0, 24\n\
lsls r1, 24\n\
lsrs r1, 24\n\
mov r8, r1\n\
lsls r2, 24\n\
lsrs r5, r2, 24\n\
lsls r4, 24\n\
lsrs r4, 24\n\
movs r0, 0x3\n\
bl GetBgTilemapBuffer\n\
adds r2, r0, 0\n\
movs r3, 0\n\
cmp r3, r4\n\
bcs _080C1DEC\n\
lsls r0, r5, 6\n\
adds r7, r0, r2\n\
ldr r5, =0x00000fff\n\
lsls r2, r6, 12\n\
mov r7, r8\n\
push {r7}\n\
adds r4, r3, 0\n\
lsls r0, 24\n\
lsrs r6, r0, 24\n\
lsls r1, 24\n\
lsrs r1, 24\n\
mov r8, r1\n\
lsls r2, 24\n\
lsrs r5, r2, 24\n\
lsls r4, 24\n\
lsrs r4, 24\n\
movs r0, 0x3\n\
bl GetBgTilemapBuffer\n\
adds r2, r0, 0\n\
movs r3, 0\n\
cmp r3, r4\n\
bcs _080C1DEC\n\
lsls r0, r5, 6\n\
adds r7, r0, r2\n\
ldr r5, =0x00000fff\n\
lsls r2, r6, 12\n\
_080C1DC8:\n\
mov r0, r8\n\
adds r1, r0, r3\n\
lsls r1, 1\n\
adds r1, r7\n\
ldrh r0, [r1]\n\
ands r0, r5\n\
orrs r0, r2\n\
strh r0, [r1]\n\
adds r1, 0x40\n\
ldrh r0, [r1]\n\
ands r0, r5\n\
orrs r0, r2\n\
strh r0, [r1]\n\
adds r0, r3, 0x1\n\
lsls r0, 16\n\
lsrs r3, r0, 16\n\
cmp r3, r4\n\
bcc _080C1DC8\n\
mov r0, r8\n\
adds r1, r0, r3\n\
lsls r1, 1\n\
adds r1, r7\n\
ldrh r0, [r1]\n\
ands r0, r5\n\
orrs r0, r2\n\
strh r0, [r1]\n\
adds r1, 0x40\n\
ldrh r0, [r1]\n\
ands r0, r5\n\
orrs r0, r2\n\
strh r0, [r1]\n\
adds r0, r3, 0x1\n\
lsls r0, 16\n\
lsrs r3, r0, 16\n\
cmp r3, r4\n\
bcc _080C1DC8\n\
_080C1DEC:\n\
pop {r3}\n\
mov r8, r3\n\
pop {r4-r7}\n\
pop {r0}\n\
bx r0\n\
.pool\n\
pop {r3}\n\
mov r8, r3\n\
pop {r4-r7}\n\
pop {r0}\n\
bx r0\n\
.pool\n\
.syntax divided\n");
}
#endif
@ -5475,12 +5474,12 @@ u8 sub_80C2318(u8 taskId, u8 b)
return gUnknown_0856EFAE[r2];
case 0:
if (r2 == 0)
return INVALID_U8;
return 0xFF;
else
return r2;
case 1:
if (r2 == 0)
return INVALID_U8;
return 0xFF;
else
return r2 - 1;
case 2:

View File

@ -4,7 +4,7 @@
#include "gpu_regs.h"
#include "graphics.h"
#include "main.h"
#include "malloc.h"
#include "alloc.h"
#include "menu.h"
#include "overworld.h"
#include "palette.h"

View File

@ -2300,7 +2300,7 @@ static const u8 sHoldEffectToType[][2] =
const struct SpriteTemplate gUnknown_08329D98[MAX_BATTLERS_COUNT] =
{
{ // B_POSITION_PLAYER_LEFT
.tileTag = INVALID_U16,
.tileTag = 0xFFFF,
.paletteTag = 0,
.oam = &gUnknown_0831ACB0,
.anims = NULL,
@ -2309,7 +2309,7 @@ const struct SpriteTemplate gUnknown_08329D98[MAX_BATTLERS_COUNT] =
.callback = sub_8039BB4,
},
{ // B_POSITION_OPPONENT_LEFT
.tileTag = INVALID_U16,
.tileTag = 0xFFFF,
.paletteTag = 0,
.oam = &gUnknown_0831ACA8,
.anims = NULL,
@ -2318,7 +2318,7 @@ const struct SpriteTemplate gUnknown_08329D98[MAX_BATTLERS_COUNT] =
.callback = oac_poke_opponent,
},
{ // B_POSITION_PLAYER_RIGHT
.tileTag = INVALID_U16,
.tileTag = 0xFFFF,
.paletteTag = 0,
.oam = &gUnknown_0831ACB0,
.anims = NULL,
@ -2327,7 +2327,7 @@ const struct SpriteTemplate gUnknown_08329D98[MAX_BATTLERS_COUNT] =
.callback = sub_8039BB4,
},
{ // B_POSITION_OPPONENT_RIGHT
.tileTag = INVALID_U16,
.tileTag = 0xFFFF,
.paletteTag = 0,
.oam = &gUnknown_0831ACA8,
.anims = NULL,
@ -2340,7 +2340,7 @@ const struct SpriteTemplate gUnknown_08329D98[MAX_BATTLERS_COUNT] =
static const struct SpriteTemplate gUnknown_08329DF8[] =
{
{
.tileTag = INVALID_U16,
.tileTag = 0xFFFF,
.paletteTag = 0,
.oam = &gUnknown_0831ACB0,
.anims = NULL,
@ -2349,7 +2349,7 @@ static const struct SpriteTemplate gUnknown_08329DF8[] =
.callback = sub_8039BB4,
},
{
.tileTag = INVALID_U16,
.tileTag = 0xFFFF,
.paletteTag = 0,
.oam = &gUnknown_0831ACB0,
.anims = NULL,
@ -2358,7 +2358,7 @@ static const struct SpriteTemplate gUnknown_08329DF8[] =
.callback = sub_8039BB4,
},
{
.tileTag = INVALID_U16,
.tileTag = 0xFFFF,
.paletteTag = 0,
.oam = &gUnknown_0831ACB0,
.anims = NULL,
@ -2367,7 +2367,7 @@ static const struct SpriteTemplate gUnknown_08329DF8[] =
.callback = sub_8039BB4,
},
{
.tileTag = INVALID_U16,
.tileTag = 0xFFFF,
.paletteTag = 0,
.oam = &gUnknown_0831ACB0,
.anims = NULL,
@ -2376,7 +2376,7 @@ static const struct SpriteTemplate gUnknown_08329DF8[] =
.callback = sub_8039BB4,
},
{
.tileTag = INVALID_U16,
.tileTag = 0xFFFF,
.paletteTag = 0,
.oam = &gUnknown_0831ACB0,
.anims = NULL,
@ -2385,7 +2385,7 @@ static const struct SpriteTemplate gUnknown_08329DF8[] =
.callback = sub_8039BB4,
},
{
.tileTag = INVALID_U16,
.tileTag = 0xFFFF,
.paletteTag = 0,
.oam = &gUnknown_0831ACB0,
.anims = NULL,
@ -2394,7 +2394,7 @@ static const struct SpriteTemplate gUnknown_08329DF8[] =
.callback = sub_8039BB4,
},
{
.tileTag = INVALID_U16,
.tileTag = 0xFFFF,
.paletteTag = 0,
.oam = &gUnknown_0831ACB0,
.anims = NULL,
@ -2403,7 +2403,7 @@ static const struct SpriteTemplate gUnknown_08329DF8[] =
.callback = sub_8039BB4,
},
{
.tileTag = INVALID_U16,
.tileTag = 0xFFFF,
.paletteTag = 0,
.oam = &gUnknown_0831ACB0,
.anims = NULL,
@ -2450,20 +2450,20 @@ static const s8 gUnknown_08329ECE[][3] =
static const u16 sHMMoves[] =
{
MOVE_CUT, MOVE_FLY, MOVE_SURF, MOVE_STRENGTH, MOVE_FLASH,
MOVE_ROCK_SMASH, MOVE_WATERFALL, MOVE_DIVE, INVALID_U16
MOVE_ROCK_SMASH, MOVE_WATERFALL, MOVE_DIVE, 0xFFFF
};
static const struct SpeciesItem sAlteringCaveWildMonHeldItems[] =
{
{SPECIES_NONE, ITEM_NONE},
{SPECIES_MAREEP, ITEM_GANLON_BERRY},
{SPECIES_PINECO, ITEM_APICOT_BERRY},
{SPECIES_HOUNDOUR, ITEM_BIG_MUSHROOM},
{SPECIES_TEDDIURSA, ITEM_PETAYA_BERRY},
{SPECIES_AIPOM, ITEM_BERRY_JUICE},
{SPECIES_SHUCKLE, ITEM_BERRY_JUICE},
{SPECIES_STANTLER, ITEM_PETAYA_BERRY},
{SPECIES_SMEARGLE, ITEM_SALAC_BERRY},
{SPECIES_PINECO, ITEM_APICOT_BERRY},
{SPECIES_HOUNDOUR, ITEM_BIG_MUSHROOM},
{SPECIES_TEDDIURSA, ITEM_PETAYA_BERRY},
{SPECIES_AIPOM, ITEM_BERRY_JUICE},
{SPECIES_SHUCKLE, ITEM_BERRY_JUICE},
{SPECIES_STANTLER, ITEM_PETAYA_BERRY},
{SPECIES_SMEARGLE, ITEM_SALAC_BERRY},
};
static const struct OamData sOamData_8329F20 =
@ -2485,8 +2485,8 @@ static const struct OamData sOamData_8329F20 =
static const struct SpriteTemplate gUnknown_08329F28 =
{
.tileTag = INVALID_U16,
.paletteTag = INVALID_U16,
.tileTag = 0xFFFF,
.paletteTag = 0xFFFF,
.oam = &sOamData_8329F20,
.anims = gDummySpriteAnimTable,
.images = NULL,
@ -3286,7 +3286,7 @@ u16 GiveMoveToBoxMon(struct BoxPokemon *boxMon, u16 move)
if (existingMove == move)
return -2;
}
return INVALID_U16;
return 0xFFFF;
}
u16 GiveMoveToBattleMon(struct BattlePokemon *mon, u16 move)
@ -3303,7 +3303,7 @@ u16 GiveMoveToBattleMon(struct BattlePokemon *mon, u16 move)
}
}
return INVALID_U16;
return 0xFFFF;
}
void SetMonMoveSlot(struct Pokemon *mon, u16 move, u8 slot)
@ -3341,7 +3341,7 @@ void GiveBoxMonInitialMoveset(struct BoxPokemon *boxMon)
move = (gLevelUpLearnsets[species][i] & 0x1FF);
if (GiveMoveToBoxMon(boxMon, move) == INVALID_U16)
if (GiveMoveToBoxMon(boxMon, move) == 0xFFFF)
DeleteFirstMoveAndGiveMoveToBoxMon(boxMon, move);
}
}
@ -6495,7 +6495,7 @@ u8 GetMoveRelearnerMoves(struct Pokemon *mon, u16 *moves)
{
u16 moveLevel;
if (gLevelUpLearnsets[species][i] == INVALID_U16)
if (gLevelUpLearnsets[species][i] == 0xFFFF)
break;
moveLevel = gLevelUpLearnsets[species][i] & 0xFE00;
@ -6524,7 +6524,7 @@ u8 GetLevelUpMovesBySpecies(u16 species, u16 *moves)
u8 numMoves = 0;
int i;
for (i = 0; i < 20 && gLevelUpLearnsets[species][i] != INVALID_U16; i++)
for (i = 0; i < 20 && gLevelUpLearnsets[species][i] != 0xFFFF; i++)
moves[numMoves++] = gLevelUpLearnsets[species][i] & 0x1FF;
return numMoves;
@ -6549,7 +6549,7 @@ u8 GetNumberOfRelearnableMoves(struct Pokemon *mon)
{
u16 moveLevel;
if (gLevelUpLearnsets[species][i] == INVALID_U16)
if (gLevelUpLearnsets[species][i] == 0xFFFF)
break;
moveLevel = gLevelUpLearnsets[species][i] & 0xFE00;
@ -6584,7 +6584,7 @@ u16 SpeciesToPokedexNum(u16 species)
species = SpeciesToHoennPokedexNum(species);
if (species <= 202)
return species;
return INVALID_U16;
return 0xFFFF;
}
}
@ -6747,7 +6747,7 @@ const struct CompressedSpritePalette *GetMonSpritePalStructFromOtIdPersonality(u
bool32 IsHMMove2(u16 move)
{
int i = 0;
while (sHMMoves[i] != INVALID_U16)
while (sHMMoves[i] != 0xFFFF)
{
if (sHMMoves[i++] == move)
return TRUE;

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