give up for now

This commit is contained in:
DizzyEggg 2018-02-26 11:45:47 +01:00
parent 4a45b4de4e
commit 8ff9cb0ede
3 changed files with 342 additions and 443 deletions

View File

@ -6,429 +6,6 @@
.text .text
thumb_func_start sub_817E32C
sub_817E32C: @ 817E32C
push {r4,r5,lr}
lsls r0, 24
lsrs r5, r0, 24
ldr r0, =gBattleTypeFlags
ldr r0, [r0]
movs r1, 0x2
ands r0, r1
cmp r0, 0
beq _0817E3EE
ldr r0, =gBattleStruct
ldr r0, [r0]
movs r1, 0x81
lsls r1, 2
adds r4, r0, r1
ldr r0, =gBattlerAttacker
ldrb r0, [r0]
bl GetBattlerSide
lsls r0, 24
lsrs r2, r0, 24
cmp r5, 0x12
beq _0817E36C
cmp r5, 0x13
beq _0817E3AA
b _0817E3EE
.pool
_0817E36C:
lsls r0, r2, 1
adds r0, r2
lsls r0, 2
adds r4, r0
ldr r0, [r4, 0x50]
lsls r0, 14
lsrs r0, 29
cmp r0, 0
beq _0817E3EE
subs r0, 0x1
lsls r0, 2
adds r1, r4, 0
adds r1, 0x55
ldrb r3, [r1]
lsls r3, 28
lsrs r3, 30
adds r3, r0
lsls r3, 24
lsrs r3, 24
movs r0, 0x2
movs r1, 0
bl sub_817E684
adds r2, r4, 0
adds r2, 0x57
ldrb r1, [r2]
movs r0, 0x1F
negs r0, r0
ands r0, r1
movs r1, 0x10
b _0817E3EA
_0817E3AA:
lsls r0, r2, 1
adds r0, r2
lsls r0, 2
adds r4, r0
adds r0, r4, 0
adds r0, 0x52
ldrb r0, [r0]
lsls r0, 27
lsrs r0, 29
cmp r0, 0
beq _0817E3EE
subs r0, 0x1
lsls r0, 2
adds r1, r4, 0
adds r1, 0x55
ldrb r3, [r1]
lsls r3, 26
lsrs r3, 30
adds r3, r0
lsls r3, 24
lsrs r3, 24
movs r0, 0x2
movs r1, 0x1
bl sub_817E684
adds r2, r4, 0
adds r2, 0x57
ldrb r1, [r2]
movs r0, 0x1F
negs r0, r0
ands r0, r1
movs r1, 0x12
_0817E3EA:
orrs r0, r1
strb r0, [r2]
_0817E3EE:
pop {r4,r5}
pop {r0}
bx r0
thumb_func_end sub_817E32C
thumb_func_start sub_817E3F4
sub_817E3F4: @ 817E3F4
push {r4-r7,lr}
mov r7, r10
mov r6, r9
mov r5, r8
push {r5-r7}
sub sp, 0x20
movs r0, 0
str r0, [sp]
movs r1, 0
str r1, [sp, 0x4]
movs r2, 0
str r2, [sp, 0x8]
ldr r3, =0x00007fff
str r3, [sp, 0xC]
movs r4, 0
str r4, [sp, 0x10]
movs r7, 0
str r7, [sp, 0x14]
mov r8, r0
ldr r0, =gBattleStruct
ldr r1, [r0]
adds r0, r1, 0
adds r0, 0xB3
ldrb r0, [r0]
cmp r0, 0
beq _0817E42A
b _0817E670
_0817E42A:
movs r2, 0xD2
lsls r2, 1
adds r2, r1
mov r10, r2
movs r6, 0
_0817E434:
movs r0, 0x64
adds r4, r6, 0
muls r4, r0
ldr r0, =gPlayerParty
adds r0, r4, r0
movs r1, 0xB
movs r2, 0
bl GetMonData
cmp r0, 0
beq _0817E454
mov r0, r8
adds r0, 0x1
lsls r0, 24
lsrs r0, 24
mov r8, r0
_0817E454:
ldr r5, =gEnemyParty
adds r0, r4, r5
movs r1, 0xB
movs r2, 0
bl GetMonData
cmp r0, 0
beq _0817E46A
adds r0, r7, 0x1
lsls r0, 24
lsrs r7, r0, 24
_0817E46A:
adds r6, 0x1
cmp r6, 0x5
ble _0817E434
ldr r0, =gBattleTypeFlags
ldr r0, [r0]
movs r1, 0x2
ands r0, r1
cmp r0, 0
bne _0817E47E
b _0817E670
_0817E47E:
cmp r8, r7
beq _0817E484
b _0817E670
_0817E484:
movs r6, 0
lsls r3, r6, 1
str r3, [sp, 0x18]
movs r4, 0x64
mov r8, r4
_0817E48E:
mov r1, r8
muls r1, r6
ldr r0, =gPlayerParty
adds r4, r1, r0
adds r0, r4, 0
movs r1, 0xB
movs r2, 0
bl GetMonData
lsls r0, 16
lsrs r7, r0, 16
adds r0, r6, 0x1
mov r9, r0
cmp r7, 0
beq _0817E4EE
adds r0, r4, 0
movs r1, 0x2D
movs r2, 0
bl GetMonData
cmp r0, 0
bne _0817E4EE
movs r4, 0
lsls r0, r6, 3
mov r2, r10
adds r1, r0, r2
movs r3, 0x3
_0817E4C4:
lsls r0, r4, 16
asrs r0, 16
ldrh r4, [r1]
adds r0, r4
lsls r0, 16
lsrs r4, r0, 16
adds r1, 0x2
subs r3, 0x1
cmp r3, 0
bge _0817E4C4
ldr r1, [sp, 0x8]
lsls r0, r1, 16
lsls r1, r4, 16
cmp r0, r1
bge _0817E4EE
lsls r0, r6, 24
lsrs r0, 24
str r0, [sp, 0x10]
lsrs r1, 16
str r1, [sp, 0x8]
str r7, [sp]
_0817E4EE:
mov r0, r8
muls r0, r6
ldr r2, =gEnemyParty
adds r4, r0, r2
adds r0, r4, 0
movs r1, 0xB
movs r2, 0
bl GetMonData
lsls r0, 16
lsrs r7, r0, 16
ldr r3, [sp, 0x8]
lsls r3, 16
str r3, [sp, 0x1C]
cmp r7, 0
beq _0817E5A0
adds r0, r4, 0
movs r1, 0x2D
movs r2, 0
bl GetMonData
cmp r0, 0
bne _0817E5A0
movs r4, 0
ldr r0, [sp, 0xC]
lsls r2, r0, 16
movs r3, 0x1
lsls r1, r3, 1
adds r1, 0x1
lsls r1, 4
lsls r0, r6, 3
adds r0, r1
mov r3, r10
adds r1, r0, r3
movs r3, 0x3
_0817E534:
lsls r0, r4, 16
asrs r0, 16
ldrh r4, [r1]
adds r0, r4
lsls r0, 16
lsrs r4, r0, 16
adds r1, 0x2
subs r3, 0x1
cmp r3, 0
bge _0817E534
asrs r1, r2, 16
lsls r5, r4, 16
asrs r0, r5, 16
cmp r1, r0
bne _0817E590
mov r0, r8
muls r0, r6
ldr r1, =gEnemyParty
adds r0, r1
movs r1, 0x19
movs r2, 0
bl GetMonData
adds r4, r0, 0
ldr r2, [sp, 0x14]
mov r0, r8
muls r0, r2
ldr r3, =gEnemyParty
adds r0, r3
movs r1, 0x19
movs r2, 0
bl GetMonData
cmp r4, r0
bls _0817E5A0
b _0817E594
.pool
_0817E590:
cmp r1, r0
ble _0817E5A0
_0817E594:
lsls r0, r6, 24
lsrs r0, 24
str r0, [sp, 0x14]
lsrs r5, 16
str r5, [sp, 0xC]
str r7, [sp, 0x4]
_0817E5A0:
mov r6, r9
cmp r6, 0x5
bgt _0817E5A8
b _0817E48E
_0817E5A8:
movs r4, 0
movs r6, 0
movs r3, 0
ldr r5, =gPlayerParty
ldr r7, [sp, 0x10]
lsls r0, r7, 3
mov r1, r10
adds r2, r0, r1
_0817E5B8:
lsls r0, r4, 16
asrs r0, 16
movs r7, 0
ldrsh r1, [r2, r7]
cmp r0, r1
bge _0817E5C8
ldrh r4, [r2]
adds r6, r3, 0
_0817E5C8:
adds r2, 0x2
adds r3, 0x1
cmp r3, 0x3
ble _0817E5B8
movs r0, 0x64
ldr r1, [sp, 0x10]
muls r0, r1
adds r0, r5
adds r1, r6, 0
adds r1, 0xD
movs r2, 0
bl GetMonData
lsls r0, 16
lsrs r4, r0, 16
ldr r2, [sp, 0x1C]
cmp r2, 0
beq _0817E670
cmp r4, 0
beq _0817E670
ldr r0, =gBattleTypeFlags
ldr r0, [r0]
movs r1, 0x40
ands r0, r1
cmp r0, 0
beq _0817E65C
ldr r3, [sp, 0x10]
cmp r3, 0x2
bhi _0817E620
ldr r0, =gBattleScripting
adds r0, 0x25
ldrb r0, [r0]
bl sub_806D82C
lsls r0, 16
cmp r0, 0
beq _0817E630
b _0817E670
.pool
_0817E620:
ldr r0, =gBattleScripting
adds r0, 0x25
ldrb r0, [r0]
bl sub_806D82C
lsls r0, 16
cmp r0, 0
beq _0817E670
_0817E630:
movs r3, 0
ldr r7, [sp, 0x14]
cmp r7, 0x2
bls _0817E63A
movs r3, 0x1
_0817E63A:
lsls r0, r3, 24
lsrs r0, 24
ldr r1, =gBattleScripting
adds r1, 0x25
ldrb r1, [r1]
bl sub_806EF84
lsls r0, 24
lsrs r0, 24
adds r1, r4, 0
ldr r2, [sp]
ldr r3, [sp, 0x4]
bl PutBattleUpdateOnTheAir
b _0817E670
.pool
_0817E65C:
ldr r0, =gBattleScripting
adds r0, 0x25
ldrb r1, [r0]
movs r0, 0x1
eors r0, r1
adds r1, r4, 0
ldr r2, [sp]
ldr r3, [sp, 0x4]
bl PutBattleUpdateOnTheAir
_0817E670:
add sp, 0x20
pop {r3-r5}
mov r8, r3
mov r9, r4
mov r10, r5
pop {r4-r7}
pop {r0}
bx r0
.pool
thumb_func_end sub_817E3F4
thumb_func_start sub_817E684 thumb_func_start sub_817E684
sub_817E684: @ 817E684 sub_817E684: @ 817E684
push {r4-r7,lr} push {r4-r7,lr}

View File

@ -472,7 +472,7 @@ struct BattleStruct
u8 wishPerishSongBattlerId; u8 wishPerishSongBattlerId;
bool8 overworldWeatherDone; bool8 overworldWeatherDone;
u8 atkCancellerTracker; u8 atkCancellerTracker;
s16 field_1A4[2][6][4]; s16 field_1A4[2][PARTY_SIZE * 4];
u8 field_204[104]; u8 field_204[104];
u8 field_26C[40]; u8 field_26C[40];
u8 AI_monToSwitchIntoId[MAX_BATTLERS_COUNT]; u8 AI_monToSwitchIntoId[MAX_BATTLERS_COUNT];

View File

@ -618,21 +618,24 @@ void sub_817E32C(u8 animationId)
} }
} }
#ifdef NONMATCHING
// for loop has an unused stack variable
void sub_817E3F4(void) void sub_817E3F4(void)
{ {
u16 playerBestSpecies = 0, opponentBestSpecies = 0; u16 playerBestSpecies = 0, opponentBestSpecies = 0;
s16 playerBestSum = 0, opponentBestSum = SHRT_MAX; s16 playerBestSum = 0, opponentBestSum = SHRT_MAX;
u8 playerBestMonId = 0, opponentBestMonId = 0; u8 playerBestMonId = 0, opponentBestMonId = 0;
s16 (*array)[2][6][4] = NULL; s16 *array = NULL;
u8 countPlayer = 0, countOpponent = 0; u8 countPlayer = 0, countOpponent = 0;
s16 sum = 0; s16 sum = 0;
u16 species = 0;
u16 moveId = 0; u16 moveId = 0;
s32 i, j; s32 i, j;
if (gBattleStruct->field_B3) if (gBattleStruct->field_B3)
return; return;
array = &gBattleStruct->field_1A4; array = (void*) &gBattleStruct->field_1A4[0];
for (i = 0; i < PARTY_SIZE; i++) for (i = 0; i < PARTY_SIZE; i++)
{ {
if (GetMonData(&gPlayerParty[i], MON_DATA_SPECIES, NULL) != SPECIES_NONE) if (GetMonData(&gPlayerParty[i], MON_DATA_SPECIES, NULL) != SPECIES_NONE)
@ -646,11 +649,11 @@ void sub_817E3F4(void)
for (i = 0; i < PARTY_SIZE; i++) for (i = 0; i < PARTY_SIZE; i++)
{ {
u16 species = GetMonData(&gPlayerParty[i], MON_DATA_SPECIES, NULL); species = GetMonData(&gPlayerParty[i], MON_DATA_SPECIES, NULL);
if (species != SPECIES_NONE && !GetMonData(&gPlayerParty[i], MON_DATA_IS_EGG, NULL)) if (species != SPECIES_NONE && !GetMonData(&gPlayerParty[i], MON_DATA_IS_EGG, NULL))
{ {
for (sum = 0, j = 0; j < 4; j++) for (sum = 0, j = 0; j < 4; j++)
sum += (*array)[0][i][j]; sum += array[i * 4 + j];
if (playerBestSum < sum) if (playerBestSum < sum)
{ {
@ -663,9 +666,8 @@ void sub_817E3F4(void)
species = GetMonData(&gEnemyParty[i], MON_DATA_SPECIES, NULL); species = GetMonData(&gEnemyParty[i], MON_DATA_SPECIES, NULL);
if (species != SPECIES_NONE && !GetMonData(&gEnemyParty[i], MON_DATA_IS_EGG, NULL)) if (species != SPECIES_NONE && !GetMonData(&gEnemyParty[i], MON_DATA_IS_EGG, NULL))
{ {
s32 sideId = B_SIDE_OPPONENT;
for (sum = 0, j = 0; j < 4; j++) for (sum = 0, j = 0; j < 4; j++)
sum += (*array)[sideId][i][j]; sum += array[i * 4 + j];
if (opponentBestSum == sum) if (opponentBestSum == sum)
{ {
@ -687,9 +689,9 @@ void sub_817E3F4(void)
for (sum = 0, i = 0, j = 0; j < 4; j++) for (sum = 0, i = 0, j = 0; j < 4; j++)
{ {
if (sum < (*array)[0][playerBestMonId][j]) if (sum < array[playerBestMonId * 4 + j])
{ {
sum = (*array)[0][playerBestMonId][j]; sum = array[playerBestMonId * 4 + j];
i = j; i = j;
} }
} }
@ -700,22 +702,342 @@ void sub_817E3F4(void)
if (gBattleTypeFlags & BATTLE_TYPE_MULTI) if (gBattleTypeFlags & BATTLE_TYPE_MULTI)
{ {
if (playerBestMonId < 3) if ((playerBestMonId < 3 && !sub_806D82C(gBattleScripting.multiplayerId))
|| (playerBestMonId >= 3 && sub_806D82C(gBattleScripting.multiplayerId)))
{ {
if (sub_806D82C(gBattleScripting.multiplayerId)) j = (opponentBestMonId < 3) ? 0 : 1;
return; PutBattleUpdateOnTheAir(sub_806EF84(j, gBattleScripting.multiplayerId), moveId, playerBestSpecies, opponentBestSpecies);
} }
else
{
if (!sub_806D82C(gBattleScripting.multiplayerId))
return;
}
j = (opponentBestMonId < 3) ? 0 : 1;
PutBattleUpdateOnTheAir(sub_806EF84(j, gBattleScripting.multiplayerId), moveId, playerBestSpecies, opponentBestSpecies);
} }
else else
{ {
PutBattleUpdateOnTheAir(gBattleScripting.multiplayerId ^ 1, moveId, playerBestSpecies, opponentBestSpecies); PutBattleUpdateOnTheAir(gBattleScripting.multiplayerId ^ 1, moveId, playerBestSpecies, opponentBestSpecies);
} }
} }
#else
ASM_DIRECT
void sub_817E3F4(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\
_0817E42A:\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\
_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\
_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\
_0817E47E:\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\
_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\
_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\
_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\
_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\
_0817E590:\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\
_0817E5A0:\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\
_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\
_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 sub_806D82C\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 sub_806D82C\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\
_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\
_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\
_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");
}
#endif