summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorProjectRevoTPP <projectrevotpp@hotmail.com>2017-11-03 02:43:41 -0400
committerProjectRevoTPP <projectrevotpp@hotmail.com>2017-11-03 02:43:41 -0400
commit2f99edc6fd21d0af1bb05fae55302a46c744ffa6 (patch)
tree029550da939f992a73e3ff5e9f0d7c5baa1850f2 /src
parent1966f65696215a09066f6da70920703d6f3fd870 (diff)
NotInBattle
Diffstat (limited to 'src')
-rw-r--r--src/battle/battle_7.c10
-rw-r--r--src/battle/battle_anim.c71
-rw-r--r--src/battle/battle_anim_807B69C.c2
-rw-r--r--src/battle/battle_anim_80A7E7C.c4
-rw-r--r--src/battle/battle_controller_linkopponent.c4
-rw-r--r--src/battle/battle_controller_linkpartner.c4
-rw-r--r--src/battle/battle_controller_opponent.c4
-rw-r--r--src/battle/battle_controller_player.c4
-rw-r--r--src/battle/battle_controller_wally.c4
-rw-r--r--src/rom_8077ABC.c54
10 files changed, 80 insertions, 81 deletions
diff --git a/src/battle/battle_7.c b/src/battle/battle_7.c
index ad96510cf..1d68386aa 100644
--- a/src/battle/battle_7.c
+++ b/src/battle/battle_7.c
@@ -637,7 +637,7 @@ void sub_8031FC4(u8 a, u8 b, bool8 c)
const void *src;
void *dst;
- if (IsContest())
+ if (NotInBattle())
{
r10 = 0;
species = ewram19348.unk2;
@@ -702,7 +702,7 @@ void sub_8031FC4(u8 a, u8 b, bool8 c)
}
BlendPalette(paletteOffset, 16, 6, 0x7FFF);
CpuCopy32(gPlttBufferFaded + paletteOffset, gPlttBufferUnfaded + paletteOffset, 32);
- if (!IsContest())
+ if (!NotInBattle())
{
ewram17800[a].transformedSpecies = species;
gBattleMonForms[a] = gBattleMonForms[b];
@@ -722,11 +722,11 @@ void BattleLoadSubstituteSprite(u8 a, u8 b)
if (b == 0)
{
- if (IsContest())
+ if (NotInBattle())
r4 = 0;
else
r4 = GetBankIdentity(a);
- if (IsContest())
+ if (NotInBattle())
LZDecompressVram(gSubstituteDollTilemap, gUnknown_081FAF4C[r4]);
else if (GetBankSide(a) != 0)
LZDecompressVram(gSubstituteDollGfx, gUnknown_081FAF4C[r4]);
@@ -742,7 +742,7 @@ void BattleLoadSubstituteSprite(u8 a, u8 b)
}
else
{
- if (!IsContest())
+ if (!NotInBattle())
{
if (GetBankSide(a) != 0)
BattleLoadOpponentMonSprite(&gEnemyParty[gBattlePartyID[a]], a);
diff --git a/src/battle/battle_anim.c b/src/battle/battle_anim.c
index 111d72813..5790cffe4 100644
--- a/src/battle/battle_anim.c
+++ b/src/battle/battle_anim.c
@@ -217,7 +217,7 @@ void DoMoveAnim(const u8 *const moveAnims[], u16 move, u8 c)
{
s32 i;
- if (IsContest() == 0)
+ if (NotInBattle() == 0)
{
sub_8079E24();
sub_8043EB4(0);
@@ -654,7 +654,7 @@ static void ScriptCmd_end(void)
if (continuousAnim == FALSE) // may have been used for debug?
{
m4aMPlayVolumeControl(&gMPlay_BGM, 0xFFFF, 256);
- if (IsContest() == 0)
+ if (NotInBattle() == 0)
{
sub_8079E24();
sub_8043EB4(1);
@@ -693,7 +693,7 @@ static void ScriptCmd_monbg(void)
{
r0 = GetBankIdentity(r5);
r0 += 0xFF;
- if (r0 <= 1 || IsContest() != 0)
+ if (r0 <= 1 || NotInBattle() != 0)
r7 = 0;
else
r7 = 1;
@@ -723,7 +723,7 @@ static void ScriptCmd_monbg(void)
{
r0 = GetBankIdentity(r5);
r0 += 0xFF;
- if (r0 <= 1 || IsContest() != 0)
+ if (r0 <= 1 || NotInBattle() != 0)
r7 = 0;
else
r7 = 1;
@@ -753,7 +753,7 @@ static void ScriptCmd_monbg(void)
#ifdef NONMATCHING
bool8 IsAnimBankSpriteVisible(u8 a)
{
- if (IsContest())
+ if (NotInBattle())
{
if (a == gBattleAnimBankAttacker)
return TRUE;
@@ -762,7 +762,7 @@ bool8 IsAnimBankSpriteVisible(u8 a)
}
if (!AnimBankSpriteExists(a))
return FALSE;
- if (IsContest())
+ if (NotInBattle())
return TRUE; // this line wont ever be reached.
if (!(EWRAM_17800[a].unk0 & 1))
return TRUE;
@@ -779,7 +779,7 @@ bool8 IsAnimBankSpriteVisible(u8 a)
lsls r0, 24\n\
lsrs r4, r0, 24\n\
adds r5, r4, 0\n\
- bl IsContest\n\
+ bl NotInBattle\n\
lsls r0, 24\n\
cmp r0, 0\n\
beq _08075FDC\n\
@@ -796,7 +796,7 @@ _08075FDC:\n\
lsls r0, 24\n\
cmp r0, 0\n\
beq _0807602C\n\
- bl IsContest\n\
+ bl NotInBattle\n\
lsls r0, 24\n\
cmp r0, 0\n\
bne _0807601C\n\
@@ -877,7 +877,7 @@ void sub_8076034(u8 a, u8 b)
spriteId = gObjectBankIDs[a];
gUnknown_030042C0 = -(gSprites[spriteId].pos1.x + gSprites[spriteId].pos2.x) + 32;
- if (IsContest() != 0 && sub_80AEB1C(EWRAM_19348) != 0)
+ if (NotInBattle() != 0 && sub_80AEB1C(EWRAM_19348) != 0)
gUnknown_030042C0--;
gUnknown_030041B4 = -(gSprites[spriteId].pos1.y + gSprites[spriteId].pos2.y) + 32;
gSprites[gObjectBankIDs[a]].invisible = TRUE;
@@ -889,12 +889,12 @@ void sub_8076034(u8 a, u8 b)
addr3 = (u16 *)PLTT + s.unk8 * 16;
DmaCopy32(3, gPlttBufferUnfaded + 0x100 + a * 16, addr3, 32);
- if (IsContest() != 0)
+ if (NotInBattle() != 0)
r2 = 0;
else
r2 = GetBankIdentity(a);
sub_80E4EF8(0, 0, r2, s.unk8, (u32)s.unk0, (((s32)s.unk4 - VRAM) / 2048), REG_BG1CNT_BITFIELD.charBaseBlock);
- if (IsContest() != 0)
+ if (NotInBattle() != 0)
sub_8076380();
}
else
@@ -996,7 +996,7 @@ void sub_8076464(u8 a)
struct UnknownStruct2 s;
sub_8078914(&s);
- if (a == 0 || IsContest() != 0)
+ if (a == 0 || NotInBattle() != 0)
{
u16 *addr2;
@@ -1121,7 +1121,7 @@ static void sub_807672C(u8 taskId)
{
var = GetBankIdentity(gTasks[taskId].data[2]);
var += 0xFF;
- if (var <= 1 || IsContest() != 0)
+ if (var <= 1 || NotInBattle() != 0)
r4 = 0;
else
r4 = 1;
@@ -1162,7 +1162,7 @@ static void ScriptCmd_monbg_22(void)
{
r0 = GetBankIdentity(r4);
r0 += 0xFF;
- if (r0 <= 1 || IsContest() != 0)
+ if (r0 <= 1 || NotInBattle() != 0)
r1 = 0;
else
r1 = 1;
@@ -1174,7 +1174,7 @@ static void ScriptCmd_monbg_22(void)
{
r0 = GetBankIdentity(r4);
r0 += 0xFF;
- if (r0 <= 1 || IsContest() != 0)
+ if (r0 <= 1 || NotInBattle() != 0)
r1 = 0;
else
r1 = 1;
@@ -1224,7 +1224,7 @@ static void sub_80769A4(u8 taskId)
r4 = gTasks[taskId].data[2];
r0 = GetBankIdentity(r4);
r0 += 0xFF;
- if (r0 <= 1 || IsContest() != 0)
+ if (r0 <= 1 || NotInBattle() != 0)
r5 = 0;
else
r5 = 1;
@@ -1334,8 +1334,7 @@ static void ScriptCmd_jump(void)
gBattleAnimScriptPtr = (u8 *)addr;
}
-// Uses of this function that rely on a TRUE return are expecting inBattle to not be ticked as defined in contest behavior. As a result, if misused, this function cannot reliably discern between field and contest status and could result in undefined behavior.
-bool8 IsContest(void)
+bool8 NotInBattle(void)
{
if (!gMain.inBattle)
return TRUE;
@@ -1369,7 +1368,7 @@ static void ScriptCmd_fadetobg_25(void)
r6 = gBattleAnimScriptPtr[2];
gBattleAnimScriptPtr += 3;
taskId = CreateTask(task_p5_load_battle_screen_elements, 5);
- if (IsContest() != 0)
+ if (NotInBattle() != 0)
gTasks[taskId].data[0] = r6;
else if (GetBankSide(gBattleAnimBankTarget) == 0)
gTasks[taskId].data[0] = r7;
@@ -1416,15 +1415,15 @@ static void task_p5_load_battle_screen_elements(u8 taskId)
static void sub_8076DB8(u16 a)
{
- if (IsContest())
+ if (NotInBattle())
{
void *tilemap = gBattleAnimBackgroundTable[a].tilemap;
void *dmaSrc;
void *dmaDest;
- LZDecompressWram(tilemap, IsContest() ? EWRAM_14800 : EWRAM_18000);
- sub_80763FC(sub_80789BC(), IsContest() ? EWRAM_14800 : EWRAM_18000, 0x100, 0);
- dmaSrc = IsContest() ? EWRAM_14800 : EWRAM_18000;
+ LZDecompressWram(tilemap, NotInBattle() ? EWRAM_14800 : EWRAM_18000);
+ sub_80763FC(sub_80789BC(), NotInBattle() ? EWRAM_14800 : EWRAM_18000, 0x100, 0);
+ dmaSrc = NotInBattle() ? EWRAM_14800 : EWRAM_18000;
dmaDest = (void *)(VRAM + 0xD000);
DmaCopy32(3, dmaSrc, dmaDest, 0x800);
LZDecompressVram(gBattleAnimBackgroundTable[a].image, (void *)(VRAM + 0x2000));
@@ -1440,7 +1439,7 @@ static void sub_8076DB8(u16 a)
static void dp01t_11_3_message_for_player_only(void)
{
- if (IsContest())
+ if (NotInBattle())
sub_80AB2AC();
else
sub_800D7B8();
@@ -1493,14 +1492,14 @@ static void ScriptCmd_changebg(void)
/*
s8 sub_8076F98(s8 a)
{
- if (!IsContest() && (EWRAM_17810[gBattleAnimBankAttacker].unk0 & 0x10))
+ if (!NotInBattle() && (EWRAM_17810[gBattleAnimBankAttacker].unk0 & 0x10))
{
a = GetBankSide(gBattleAnimBankAttacker) ? 0xC0 : 0x3F;
}
//_08076FDC
else
{
- if (IsContest())
+ if (NotInBattle())
{
if (gBattleAnimBankAttacker == gBattleAnimBankTarget && gBattleAnimBankAttacker == 2
&& a == 0x3F)
@@ -1536,7 +1535,7 @@ s8 sub_8076F98(s8 a)
push {r4,lr}\n\
lsls r0, 24\n\
lsrs r4, r0, 24\n\
- bl IsContest\n\
+ bl NotInBattle\n\
lsls r0, 24\n\
cmp r0, 0\n\
bne _08076FDC\n\
@@ -1564,7 +1563,7 @@ s8 sub_8076F98(s8 a)
_08076FD4: .4byte gBattleAnimBankAttacker\n\
_08076FD8: .4byte 0x02017810\n\
_08076FDC:\n\
- bl IsContest\n\
+ bl NotInBattle\n\
lsls r0, 24\n\
cmp r0, 0\n\
beq _08077004\n\
@@ -1661,7 +1660,7 @@ _08077088:\n\
s8 sub_8077094(s8 a)
{
- if (!IsContest() && (EWRAM_17810[gBattleAnimBankAttacker].unk0 & 0x10))
+ if (!NotInBattle() && (EWRAM_17810[gBattleAnimBankAttacker].unk0 & 0x10))
{
if (GetBankSide(gBattleAnimBankAttacker) != 0)
a = 0x3F;
@@ -1670,7 +1669,7 @@ s8 sub_8077094(s8 a)
}
else
{
- if (GetBankSide(gBattleAnimBankAttacker) != 0 || IsContest() != 0)
+ if (GetBankSide(gBattleAnimBankAttacker) != 0 || NotInBattle() != 0)
a = -a;
}
return a;
@@ -2108,7 +2107,7 @@ static void ScriptCmd_jumpunkcond(void)
u8 *addr;
gBattleAnimScriptPtr++;
- if (IsContest())
+ if (NotInBattle())
{
addr = (u8 *)SCRIPT_READ_32(gBattleAnimScriptPtr);
gBattleAnimScriptPtr = addr;
@@ -2132,7 +2131,7 @@ static void ScriptCmd_monbgprio_28(void)
else
r0 = gBattleAnimBankAttacker;
r4 = GetBankIdentity(r0);
- if (!IsContest() && (r4 == 0 || r4 == 3))
+ if (!NotInBattle() && (r4 == 0 || r4 == 3))
{
REG_BG1CNT_BITFIELD.priority = 1;
REG_BG2CNT_BITFIELD.priority = 2;
@@ -2142,7 +2141,7 @@ static void ScriptCmd_monbgprio_28(void)
static void ScriptCmd_monbgprio_29(void)
{
gBattleAnimScriptPtr++;
- if (!IsContest())
+ if (!NotInBattle())
{
REG_BG1CNT_BITFIELD.priority = 1;
REG_BG2CNT_BITFIELD.priority = 2;
@@ -2164,7 +2163,7 @@ static void ScriptCmd_monbgprio_2A(void)
else
r0 = gBattleAnimBankAttacker;
r4 = GetBankIdentity(r0);
- if (!IsContest() && (r4 == 0 || r4 == 3))
+ if (!NotInBattle() && (r4 == 0 || r4 == 3))
{
REG_BG1CNT_BITFIELD.priority = 1;
REG_BG2CNT_BITFIELD.priority = 2;
@@ -2208,7 +2207,7 @@ static void ScriptCmd_doublebattle_2D(void)
r7 = SCRIPT_READ_8(gBattleAnimScriptPtr + 1);
gBattleAnimScriptPtr += 2;
- if (!IsContest() && IsDoubleBattle()
+ if (!NotInBattle() && IsDoubleBattle()
&& GetBankSide(gBattleAnimBankAttacker) == GetBankSide(gBattleAnimBankTarget))
{
if (r7 == 0)
@@ -2242,7 +2241,7 @@ static void ScriptCmd_doublebattle_2E(void)
r7 = SCRIPT_READ_8(gBattleAnimScriptPtr + 1);
gBattleAnimScriptPtr += 2;
- if (!IsContest() && IsDoubleBattle()
+ if (!NotInBattle() && IsDoubleBattle()
&& GetBankSide(gBattleAnimBankAttacker) == GetBankSide(gBattleAnimBankTarget))
{
if (r7 == 0)
diff --git a/src/battle/battle_anim_807B69C.c b/src/battle/battle_anim_807B69C.c
index bf3eb7ef1..9acc7bd46 100644
--- a/src/battle/battle_anim_807B69C.c
+++ b/src/battle/battle_anim_807B69C.c
@@ -183,7 +183,7 @@ void sub_807B920(u8 taskId)
s16 y = sub_8077ABC(gBattleAnimBankTarget, 3) - 36;
u8 spriteId;
- if (IsContest())
+ if (NotInBattle())
x -= 6;
REG_BLDCNT = 0x3F40;
REG_BLDALPHA = 0x1000;
diff --git a/src/battle/battle_anim_80A7E7C.c b/src/battle/battle_anim_80A7E7C.c
index e0c79dc8e..19ac7143e 100644
--- a/src/battle/battle_anim_80A7E7C.c
+++ b/src/battle/battle_anim_80A7E7C.c
@@ -769,7 +769,7 @@ void sub_80A8E04(u8 taskId)
TASK.data[4] = gBattleAnimArgs[1];
TASK.data[5] = spriteId;
TASK.data[6] = gBattleAnimArgs[3];
- if (IsContest())
+ if (NotInBattle())
{
TASK.data[7] = 1;
}
@@ -786,7 +786,7 @@ void sub_80A8E04(u8 taskId)
}
if (TASK.data[7])
{
- if (!IsContest())
+ if (!NotInBattle())
{
TASK.data[3] *= -1;
TASK.data[4] *= -1;
diff --git a/src/battle/battle_controller_linkopponent.c b/src/battle/battle_controller_linkopponent.c
index 7b7c7ed82..70cd636bd 100644
--- a/src/battle/battle_controller_linkopponent.c
+++ b/src/battle/battle_controller_linkopponent.c
@@ -638,7 +638,7 @@ u32 dp01_getattr_by_ch1_for_player_pokemon__(u8 a, u8 *buffer)
StringCopy10(battlePokemon.nickname, nickname);
GetMonData(&gEnemyParty[a], MON_DATA_OT_NAME, battlePokemon.otName);
- BAD_MEMSET_REVERSE(&battlePokemon, buffer, sizeof(battlePokemon), size, src)
+ BAD_MEMCPY(&battlePokemon, buffer, sizeof(battlePokemon), size, src)
break;
case 1:
data16 = GetMonData(&gEnemyParty[a], MON_DATA_SPECIES);
@@ -659,7 +659,7 @@ u32 dp01_getattr_by_ch1_for_player_pokemon__(u8 a, u8 *buffer)
moveData.pp[size] = GetMonData(&gEnemyParty[a], MON_DATA_PP1 + size);
}
moveData.ppBonuses = GetMonData(&gEnemyParty[a], MON_DATA_PP_BONUSES);
- BAD_MEMSET_REVERSE(&moveData, buffer, sizeof(moveData), size, src)
+ BAD_MEMCPY(&moveData, buffer, sizeof(moveData), size, src)
break;
case 4:
case 5:
diff --git a/src/battle/battle_controller_linkpartner.c b/src/battle/battle_controller_linkpartner.c
index 7f3cf9d37..718afa6bd 100644
--- a/src/battle/battle_controller_linkpartner.c
+++ b/src/battle/battle_controller_linkpartner.c
@@ -593,7 +593,7 @@ u32 dp01_getattr_by_ch1_for_player_pokemon(u8 a, u8 *buffer)
GetMonData(&gPlayerParty[a], MON_DATA_NICKNAME, nickname);
StringCopy10(battlePokemon.nickname, nickname);
GetMonData(&gPlayerParty[a], MON_DATA_OT_NAME, battlePokemon.otName);
- BAD_MEMSET_REVERSE(&battlePokemon, buffer, sizeof(battlePokemon), size, src)
+ BAD_MEMCPY(&battlePokemon, buffer, sizeof(battlePokemon), size, src)
break;
case 1:
data16 = GetMonData(&gPlayerParty[a], MON_DATA_SPECIES);
@@ -614,7 +614,7 @@ u32 dp01_getattr_by_ch1_for_player_pokemon(u8 a, u8 *buffer)
moveData.pp[size] = GetMonData(&gPlayerParty[a], MON_DATA_PP1 + size);
}
moveData.ppBonuses = GetMonData(&gPlayerParty[a], MON_DATA_PP_BONUSES);
- BAD_MEMSET_REVERSE(&moveData, buffer, sizeof(moveData), size, src)
+ BAD_MEMCPY(&moveData, buffer, sizeof(moveData), size, src)
break;
case 4:
case 5:
diff --git a/src/battle/battle_controller_opponent.c b/src/battle/battle_controller_opponent.c
index d9f24e6c2..c36f5fd82 100644
--- a/src/battle/battle_controller_opponent.c
+++ b/src/battle/battle_controller_opponent.c
@@ -601,7 +601,7 @@ u32 sub_8033598(u8 a, u8 *buffer)
GetMonData(&gEnemyParty[a], MON_DATA_NICKNAME, nickname);
StringCopy10(battlePokemon.nickname, nickname);
GetMonData(&gEnemyParty[a], MON_DATA_OT_NAME, battlePokemon.otName);
- BAD_MEMSET_REVERSE(&battlePokemon, buffer, sizeof(battlePokemon), size, src)
+ BAD_MEMCPY(&battlePokemon, buffer, sizeof(battlePokemon), size, src)
break;
case 1:
data16 = GetMonData(&gEnemyParty[a], MON_DATA_SPECIES);
@@ -622,7 +622,7 @@ u32 sub_8033598(u8 a, u8 *buffer)
moveData.pp[size] = GetMonData(&gEnemyParty[a], MON_DATA_PP1 + size);
}
moveData.ppBonuses = GetMonData(&gEnemyParty[a], MON_DATA_PP_BONUSES);
- BAD_MEMSET_REVERSE(&moveData, buffer, sizeof(moveData), size, src)
+ BAD_MEMCPY(&moveData, buffer, sizeof(moveData), size, src)
break;
case 4:
case 5:
diff --git a/src/battle/battle_controller_player.c b/src/battle/battle_controller_player.c
index 62da661f0..70eeed5f7 100644
--- a/src/battle/battle_controller_player.c
+++ b/src/battle/battle_controller_player.c
@@ -1773,7 +1773,7 @@ u32 dp01_getattr_by_ch1_for_player_pokemon_(u8 a, u8 *buffer)
GetMonData(&gPlayerParty[a], MON_DATA_NICKNAME, nickname);
StringCopy10(battlePokemon.nickname, nickname);
GetMonData(&gPlayerParty[a], MON_DATA_OT_NAME, battlePokemon.otName);
- BAD_MEMSET_REVERSE(&battlePokemon, buffer, sizeof(battlePokemon), size, src)
+ BAD_MEMCPY(&battlePokemon, buffer, sizeof(battlePokemon), size, src)
break;
case 1:
data16 = GetMonData(&gPlayerParty[a], MON_DATA_SPECIES);
@@ -1794,7 +1794,7 @@ u32 dp01_getattr_by_ch1_for_player_pokemon_(u8 a, u8 *buffer)
moveData.pp[size] = GetMonData(&gPlayerParty[a], MON_DATA_PP1 + size);
}
moveData.ppBonuses = GetMonData(&gPlayerParty[a], MON_DATA_PP_BONUSES);
- BAD_MEMSET_REVERSE(&moveData, buffer, sizeof(moveData), size, src)
+ BAD_MEMCPY(&moveData, buffer, sizeof(moveData), size, src)
break;
case 4:
case 5:
diff --git a/src/battle/battle_controller_wally.c b/src/battle/battle_controller_wally.c
index d2baa293b..eefdc5e50 100644
--- a/src/battle/battle_controller_wally.c
+++ b/src/battle/battle_controller_wally.c
@@ -569,7 +569,7 @@ u32 sub_8137A84(u8 a, u8 *buffer)
GetMonData(&gPlayerParty[a], MON_DATA_NICKNAME, nickname);
StringCopy10(battlePokemon.nickname, nickname);
GetMonData(&gPlayerParty[a], MON_DATA_OT_NAME, battlePokemon.otName);
- BAD_MEMSET_REVERSE(&battlePokemon, buffer, sizeof(battlePokemon), size, src)
+ BAD_MEMCPY(&battlePokemon, buffer, sizeof(battlePokemon), size, src)
break;
case 1:
data16 = GetMonData(&gPlayerParty[a], MON_DATA_SPECIES);
@@ -590,7 +590,7 @@ u32 sub_8137A84(u8 a, u8 *buffer)
moveData.pp[size] = GetMonData(&gPlayerParty[a], MON_DATA_PP1 + size);
}
moveData.ppBonuses = GetMonData(&gPlayerParty[a], MON_DATA_PP_BONUSES);
- BAD_MEMSET_REVERSE(&moveData, buffer, sizeof(moveData), size, src)
+ BAD_MEMCPY(&moveData, buffer, sizeof(moveData), size, src)
break;
case 4:
case 5:
diff --git a/src/rom_8077ABC.c b/src/rom_8077ABC.c
index ef9eb36a8..285c992ca 100644
--- a/src/rom_8077ABC.c
+++ b/src/rom_8077ABC.c
@@ -187,7 +187,7 @@ u8 sub_8077ABC(u8 slot, u8 a2) {
u16 species;
struct TransformStatus *transform;
- if (IsContest()) {
+ if (NotInBattle()) {
if (a2 == 3 && slot == 3) {
a2 = 1;
}
@@ -203,7 +203,7 @@ u8 sub_8077ABC(u8 slot, u8 a2) {
case 3:
case 4:
default:
- if (IsContest()) {
+ if (NotInBattle()) {
if (unk_2019348.field_4 & 1) {
species = unk_2019348.field_2;
} else {
@@ -243,9 +243,9 @@ u8 sub_8077BFC(u8 slot, u16 species) {
u8 ret;
u16 var;
- if (!GetBankSide(slot) || IsContest()) {
+ if (!GetBankSide(slot) || NotInBattle()) {
if (species == SPECIES_UNOWN) {
- if (IsContest()) {
+ if (NotInBattle()) {
if (unk_2019348.field_4 & 1) {
personality = unk_2019348.field_10;
} else {
@@ -302,7 +302,7 @@ u8 sub_8077BFC(u8 slot, u16 species) {
u8 sub_8077DD8(u8 slot, u16 species) {
u8 ret = 0;
if (GetBankSide(slot) == 1) {
- if (!IsContest()) {
+ if (!NotInBattle()) {
if (species == SPECIES_CASTFORM) {
ret = gCastformElevations[gBattleMonForms[slot]];
} else if (species > NUM_SPECIES) {
@@ -318,7 +318,7 @@ u8 sub_8077DD8(u8 slot, u16 species) {
u8 sub_8077E44(u8 slot, u16 species, u8 a3) {
u16 offset;
u8 y;
- if (GetBankSide(slot) == 0 || IsContest()) {
+ if (GetBankSide(slot) == 0 || NotInBattle()) {
offset = sub_8077BFC(slot, species);
} else {
offset = sub_8077BFC(slot, species);
@@ -338,7 +338,7 @@ u8 sub_8077EE4(u8 slot, u8 a2) {
u16 species;
struct TransformStatus *transform;
if (a2 == 3 || a2 == 4) {
- if (IsContest()) {
+ if (NotInBattle()) {
if (unk_2019348.field_4 & 1) {
species = unk_2019348.field_2;
} else {
@@ -381,7 +381,7 @@ u8 sub_8077FC0(u8 slot) {
u8 r6;
struct TransformStatus *transform;
r6 = sub_8077ABC(slot, 1);
- if (!IsContest()) {
+ if (!NotInBattle()) {
if (GetBankSide(slot)) {
transform = &gTransformStatuses[slot];
if (!transform->species) {
@@ -752,7 +752,7 @@ u8 GetBankByPlayerAI(u8 slot) {
}
bool8 AnimBankSpriteExists(u8 slot) {
- if (IsContest()) {
+ if (NotInBattle()) {
if (gBattleAnimBankAttacker == slot) {
return TRUE;
}
@@ -782,7 +782,7 @@ bool8 IsDoubleBattle() {
}
void sub_8078914(struct Struct_sub_8078914 *unk) {
- if (IsContest()) {
+ if (NotInBattle()) {
unk->field_0 = (u8 *)0x6008000;
unk->field_4 = (u8 *)0x600f000;
unk->field_8 = 0xe;
@@ -794,7 +794,7 @@ void sub_8078914(struct Struct_sub_8078914 *unk) {
}
void sub_8078954(struct Struct_sub_8078914 *unk) {
- if (IsContest()) {
+ if (NotInBattle()) {
unk->field_0 = (u8 *)0x6008000;
unk->field_4 = (u8 *)0x600f000;
unk->field_8 = 0xe;
@@ -810,7 +810,7 @@ void sub_8078954(struct Struct_sub_8078914 *unk) {
}
u8 sub_80789BC() {
- if (IsContest()) {
+ if (NotInBattle()) {
return 1;
}
return 2;
@@ -820,7 +820,7 @@ void sub_80789D4(bool8 a1) {
if (!a1) {
BG3CNT.size = 0;
BG3CNT.overflow = 1;
- } else if (IsContest()) {
+ } else if (NotInBattle()) {
BG3CNT.size = 0;
BG3CNT.overflow = 1;
} else {
@@ -1025,7 +1025,7 @@ void obj_id_set_rotscale(u8 sprite, s16 xScale, s16 yScale, u16 rotation) {
}
bool8 sub_8078E38() {
- if (IsContest()) {
+ if (NotInBattle()) {
if (gSprites[GetAnimBankSpriteId(0)].data2 == 0xc9 /* XXX SPECIES_UNOWN? */) {
return FALSE;
}
@@ -1037,12 +1037,12 @@ bool8 sub_8078E38() {
void sub_8078E70(u8 sprite, u8 a2) {
struct Struct_2017810 *unk;
u8 r7 = gSprites[sprite].data0;
- if (IsContest() || IsAnimBankSpriteVisible(r7)) {
+ if (NotInBattle() || IsAnimBankSpriteVisible(r7)) {
gSprites[sprite].invisible = FALSE;
}
gSprites[sprite].oam.objMode = a2;
gSprites[sprite].affineAnimPaused = TRUE;
- if (!IsContest() && !gSprites[sprite].oam.affineMode) {
+ if (!NotInBattle() && !gSprites[sprite].oam.affineMode) {
unk = &unk_2017810[r7];
gSprites[sprite].oam.matrixNum = unk->field_6;
}
@@ -1135,7 +1135,7 @@ u32 sub_80791A8(u8 a1, u8 a2, u8 a3, u8 a4, u8 a5, u8 a6, u8 a7) {
u32 var = 0;
u32 shift;
if (a1) {
- if (!IsContest()) {
+ if (!NotInBattle()) {
var = 0xe;
} else {
var = 1 << sub_80789BC();
@@ -1162,14 +1162,14 @@ u32 sub_80791A8(u8 a1, u8 a2, u8 a3, u8 a4, u8 a5, u8 a6, u8 a7) {
}
}
if (a6) {
- if (!IsContest()) {
+ if (!NotInBattle()) {
var |= 0x100;
} else {
var |= 0x4000;
}
}
if (a7) {
- if (!IsContest()) {
+ if (!NotInBattle()) {
var |= 0x200;
}
}
@@ -1179,7 +1179,7 @@ u32 sub_80791A8(u8 a1, u8 a2, u8 a3, u8 a4, u8 a5, u8 a6, u8 a7) {
u32 sub_80792C0(u8 a1, u8 a2, u8 a3, u8 a4) {
u32 var = 0;
u32 shift;
- if (IsContest()) {
+ if (NotInBattle()) {
if (a1) {
var |= 1 << 18;
return var;
@@ -1540,7 +1540,7 @@ u16 sub_8079B10(u8 sprite) {
u16 i;
for (i = 0; i < (sizeof(gBattleMonSprites) / sizeof(u8)); i++) {
if (gBattleMonSprites[i] == sprite) {
- if (IsContest()) {
+ if (NotInBattle()) {
species = unk_2019348.field_0;
return gMonBackPicCoords[species].y_offset;
} else {
@@ -1653,7 +1653,7 @@ void sub_8079E24() {
u8 sub_8079E90(u8 slot) {
u8 status;
u8 ret;
- if (IsContest()) {
+ if (NotInBattle()) {
if (slot == 2) {
return 30;
} else {
@@ -1676,7 +1676,7 @@ u8 sub_8079E90(u8 slot) {
u8 sub_8079ED4(u8 slot) {
u8 status = GetBankIdentity(slot);
- if (IsContest()) {
+ if (NotInBattle()) {
return 2;
}
if (status == 0 || status == 3) {
@@ -1688,7 +1688,7 @@ u8 sub_8079ED4(u8 slot) {
u8 GetBankIdentity_permutated(u8 slot) {
u8 status;
- if (!IsContest()) {
+ if (!NotInBattle()) {
status = GetBankIdentity(slot);
if (status == 0 || status == 3) {
return 2;
@@ -1744,7 +1744,7 @@ u8 sub_8079F44(u16 species, u8 isBackpic, u8 a3, s16 a4, s16 a5, u8 a6, u32 a7,
} else {
sprite = CreateSprite(&gSpriteTemplate_837F5B0[a3], a4, a5 + gMonBackPicCoords[species].y_offset, a6);
}
- if (IsContest()) {
+ if (NotInBattle()) {
gSprites[sprite].affineAnims = &gSpriteAffineAnimTable_81E7C18;
StartSpriteAffineAnim(&gSprites[sprite], 0);
}
@@ -1763,7 +1763,7 @@ int sub_807A100(u8 slot, u8 a2) {
int ret;
const struct MonCoords *coords;
struct TransformStatus *transform;
- if (IsContest()) {
+ if (NotInBattle()) {
if (unk_2019348.field_4 & 1) {
species = unk_2019348.field_2;
personality = unk_2019348.field_10;
@@ -1870,7 +1870,7 @@ void sub_807A3FC(u8 slot, u8 a2, s16 *a3, s16 *a4) {
}
v3 = sub_8077ABC(slot, v1);
v4 = sub_8077ABC(slot, v2);
- if (IsDoubleBattle() && !IsContest()) {
+ if (IsDoubleBattle() && !NotInBattle()) {
v5 = sub_8077ABC(slot ^ 2, v1);
v6 = sub_8077ABC(slot ^ 2, v2);
} else {