Match some 16F740 funcs (#532)

* update enums and functions

* match a couple of funcs

* run coverage.py

* some initial cleanup

* missed something

* requested changes

* remove space

* more changes

* aligned enum

Co-authored-by: ThreeMustyFears <>
This commit is contained in:
ThreeMustyFears 2021-11-17 10:43:50 -04:00 committed by GitHub
parent 54242fd671
commit 7a95f21a17
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
7 changed files with 724 additions and 1469 deletions

View File

@ -503,6 +503,7 @@ enum SoundIDs {
SOUND_E1 = 0x000000E1,
SOUND_E2 = 0x000000E2,
SOUND_E3 = 0x000000E3,
SOUND_E7 = 0x000000E7,
SOUND_E9 = 0x000000E9,
SOUND_EA = 0x000000EA,
SOUND_FREEZE = 0x000000EB,
@ -618,6 +619,7 @@ enum SoundIDs {
SOUND_SPELL_CAST5 = 0x000020D8,
SOUND_UNKNOWN_20F6 = 0x000020F6,
SOUND_UNKNOWN_2106 = 0x00002106,
SOUND_UNKNOWN_2107 = 0x00002107,
};
enum Cams {
@ -1226,6 +1228,7 @@ enum Events {
EVENT_BURN_CONTACT = 0x0000002C,
EVENT_SHOCK_HIT = 0x0000002F,
EVENT_RECOVER_STATUS = 0x00000031,
EVENT_34 = 0x00000034,
EVENT_END_FIRST_STRIKE = 0x00000035,
EVENT_LUCKY = 0x00000037,
EVENT_BEGIN_FIRST_STRIKE = 0x00000038,
@ -1915,7 +1918,7 @@ enum EffectGfxDataFlags {
};
enum MoveIDs {
MOVE_NOTHING = 0x00000000,
MOVE_NONE = 0x00000000,
MOVE_UNUSED_01 = 0x00000001,
MOVE_UNUSED_02 = 0x00000002,
MOVE_HAMMER1 = 0x00000003,
@ -2160,8 +2163,33 @@ enum BattleStatusFlags1 {
};
enum BattleStatusFlags2 {
BS_FLAGS2_2 = 0x00000002,
BS_FLAGS2_4 = 0x00000004,
BS_FLAGS2_8 = 0x00000008,
BS_FLAGS2_10 = 0x00000010,
BS_FLAGS2_40 = 0x00000040,
BS_FLAGS2_NO_TARGET_AVAILABLE = 0x00001000,
BS_FLAGS2_1000000 = 0x01000000,
BS_FLAGS2_2000000 = 0x02000000,
};
enum BattleStates2 {
BATTLE_STATES2_UNK_0 = 0x00000000,
BATTLE_STATES2_UNK_1 = 0x00000001,
BATTLE_STATES2_UNK_2 = 0x00000002,
BATTLE_STATES2_UNK_3 = 0x00000003,
BATTLE_STATES2_UNK_4 = 0x00000004,
BATTLE_STATES2_UNK_5 = 0x00000005,
BATTLE_STATES2_UNK_6 = 0x00000006,
BATTLE_STATES2_UNK_7 = 0x00000007,
BATTLE_STATES2_PLAYER_DEFEATED = 0x0000000A,
BATTLE_STATES2_UNK_B = 0x0000000B,
BATTLE_STATES2_UNK_C = 0x0000000C,
BATTLE_STATES2_UNK_14 = 0x00000014,
BATTLE_STATES2_UNK_15 = 0x00000015,
BATTLE_STATES2_UNK_16 = 0x00000016,
BATTLE_STATES2_UNK_1E = 0x0000001E,
BATTLE_STATES2_UNK_46 = 0x00000046,
};
enum DebuffTypes {

View File

@ -408,6 +408,23 @@ void play_movement_dust_effects(s32 var0, f32 xPos, f32 yPos, f32 zPos, f32 angl
void func_80138D88(s32, s32, s32, s32, f32);
void btl_cam_set_target_pos(f32, f32, f32);
void deduct_current_move_fp(void);
void load_partner_actor(void);
void dispatch_event_partner(s32);
void dispatch_event_player(s32);
s32 btl_are_all_enemies_defeated(void);
s32 btl_check_player_defeated(void);
void btl_show_battle_message(s32, s32);
void btl_update_ko_status(void);
void reset_actor_turn_info(void);
void reset_all_actor_sounds(Actor*);
void decrement_status_menu_disabled(void);
void increment_status_menu_disabled(void);
void btl_delete_actor(Actor* actor);
void remove_status_debuff(s16);
s32 find_item(s32);
void enable_background_wave(void);
// State funcs

View File

@ -1,10 +1,14 @@
#include "common.h"
#include "script_api/battle.h"
#include "ld_addrs.h"
#include "effects.h"
#include "hud_element.h"
#include "battle/battle.h"
extern s16 D_802809F6;
extern s32 D_80280A30;
extern s32 D_8029F254;
extern s32 D_8029F248;
// Almost good but some reorderings at the beginning
#ifdef NON_EQUIVALENT
@ -66,9 +70,9 @@ void btl_set_state(s32 battleState) {
s32 flags = gBattleStatus.flags2;
gBattleState = battleState;
D_800DC4E0 = 1;
gBattleState2 = 0;
gBattleState2 = BATTLE_STATES2_UNK_0;
flags &= 0x40;
flags &= BS_FLAGS2_40;
if (flags) {
switch (battleState) {
case 14:
@ -115,16 +119,16 @@ void btl_state_update_switch_to_player(void) {
Actor* partner = gBattleStatus.partnerActor;
s32 i;
if (gBattleState2 == 0) {
gBattleStatus.flags1 &= ~0x80000;
if (gBattleState2 == BATTLE_STATES2_UNK_0) {
gBattleStatus.flags1 &= ~BS_FLAGS1_80000;
reset_actor_turn_info();
gBattleStatus.selectedMoveID = 0;
gBattleStatus.selectedMoveID = MOVE_NONE;
gBattleStatus.unk_86 = 0x7F;
gBattleStatus.blockResult = 0x7F;
gBattleStatus.flags1 |= 8;
player->flags |= 0x8000000;
gBattleStatus.flags1 |= BS_FLAGS1_8;
player->flags |= ACTOR_FLAG_8000000;
if (partner != NULL) {
partner->flags |= 0xC000000;
partner->flags |= (ACTOR_FLAG_8000000 | ACTOR_FLAG_4000000);
}
for (i = 0; i < ARRAY_COUNT(gBattleStatus.enemyActors); i++) {
@ -152,15 +156,15 @@ void btl_state_update_switch_to_partner(void) {
Actor* partner = gBattleStatus.partnerActor;
s32 i;
if (gBattleState2 == 0) {
if (gBattleState2 == BATTLE_STATES2_UNK_0) {
reset_actor_turn_info();
gBattleStatus.flags1 |= 0x80000;
gBattleStatus.selectedMoveID = 0;
gBattleStatus.flags1 |= BS_FLAGS1_80000;
gBattleStatus.selectedMoveID = MOVE_NONE;
gBattleStatus.unk_86 = 0x7F;
gBattleStatus.blockResult = 0x7F;
gBattleStatus.flags1 |= 8;
player->flags |= 0xC000000;
partner->flags |= 0x8000000;
gBattleStatus.flags1 |= BS_FLAGS1_8;
player->flags |= (ACTOR_FLAG_8000000 | ACTOR_FLAG_4000000);
partner->flags |= ACTOR_FLAG_8000000;
for (i = 0; i < ARRAY_COUNT(gBattleStatus.enemyActors); i++) {
Actor* enemy = gBattleStatus.enemyActors[i];
@ -198,11 +202,11 @@ void btl_state_update_prepare_menu(void) {
dma_copy(_415D90_ROM_START, _415D90_ROM_END, _415D90_VRAM);
if (battleStatus->flags1 & 0x80000) {
if (battleStatus->flags1 & BS_FLAGS1_80000) {
btl_set_state(14);
} else if (gBattleState2 == 70) {
} else if (gBattleState2 == BATTLE_STATES2_UNK_46) {
btl_set_state(13);
gBattleState2 = 70;
gBattleState2 = BATTLE_STATES2_UNK_46;
} else {
btl_set_state(13);
}
@ -224,7 +228,205 @@ void btl_state_update_1C(void) {
void btl_state_draw_1C(void) {
}
INCLUDE_ASM(s32, "16F740", btl_state_update_victory);
void btl_state_update_victory(void) {
BattleStatus* battleStatus = &gBattleStatus;
EncounterStatus* currentEncounter = &gCurrentEncounter;
PlayerData* playerData = &gPlayerData;
Actor* player = battleStatus->playerActor;
Actor* partner = battleStatus->partnerActor;
Evt* script;
switch (gBattleState2) {
case BATTLE_STATES2_UNK_0:
player->flags &= ~(ACTOR_FLAG_8000000 | ACTOR_FLAG_4000000);
if (partner != NULL) {
partner->flags &= ~(ACTOR_FLAG_8000000 | ACTOR_FLAG_4000000);
}
battleStatus->unk_8C = 0;
if (battleStatus->outtaSightActive == 0) {
gBattleState2 = BATTLE_STATES2_UNK_5;
} else {
if (battleStatus->outtaSightActive > 0) {
D_8029F254 = 1;
}
battleStatus->battlePhase = PHASE_ENEMY_BEGIN;
script = start_script(partner->onTurnChanceScriptSource, 0xA, 0);
partner->onTurnChangeScript = script;
partner->onTurnChangeID = script->id;
script->owner1.enemyID = 0x100;
gBattleState2 = BATTLE_STATES2_UNK_1;
}
break;
case BATTLE_STATES2_UNK_1:
if (!does_script_exist(partner->onTurnChangeID)) {
battleStatus->outtaSightActive = 0;
gBattleState2 = BATTLE_STATES2_UNK_5;
}
break;
}
switch (gBattleState2) {
case BATTLE_STATES2_UNK_5:
player->flags &= ~(ACTOR_FLAG_8000000 | ACTOR_FLAG_4000000);
if (partner != NULL) {
partner->flags &= ~(ACTOR_FLAG_8000000 | ACTOR_FLAG_4000000);
}
gBattleState2 = BATTLE_STATES2_UNK_B;
gBattleStatus.flags2 &= ~BS_FLAGS2_2;
gBattleStatus.flags2 &= ~BS_FLAGS2_4;
gBattleStatus.flags2 &= ~BS_FLAGS2_8;
gBattleStatus.flags2 &= ~BS_FLAGS2_10;
gBattleStatus.flags1 &= ~BS_FLAGS1_8;
if (player->koStatus == 0xD) {
dispatch_event_player(EVENT_34);
gBattleState2 = BATTLE_STATES2_PLAYER_DEFEATED;
}
player->debuff = 0;
player->staticStatus = 0;
player->stoneStatus = 0;
player->transStatus = 0;
player->koStatus = 0;
player->koDuration = 0;
player->ptrDefuffIcon->ptrPropertyList[15] = 0;
if (partner != NULL) {
if (partner->koStatus == 0xD) {
dispatch_event_partner(EVENT_34);
gBattleState2 = BATTLE_STATES2_PLAYER_DEFEATED;
}
partner->debuff = 0;
partner->staticStatus = 0;
partner->stoneStatus = 0;
partner->transStatus = 0;
partner->koStatus = 0;
partner->koDuration = 0;
partner->ptrDefuffIcon->ptrPropertyList[15] = 0;
}
break;
case BATTLE_STATES2_PLAYER_DEFEATED:
if (player->onHitScript == NULL || !does_script_exist(player->onHitID)) {
player->onHitScript = NULL;
if (partner != NULL) {
if (partner->onHitScript == NULL || !does_script_exist(partner->onHitID)) {
partner->onHitScript = NULL;
} else {
break;
}
}
gBattleState2 = BATTLE_STATES2_UNK_B;
}
break;
}
if (gBattleState2 == BATTLE_STATES2_UNK_B) {
if (partner == NULL || !(gBattleStatus.flags1 & BS_FLAGS1_100000)) {
gBattleState2 = BATTLE_STATES2_UNK_2;
} else {
partner->state.currentPos.x = partner->currentPos.x;
partner->state.currentPos.z = partner->currentPos.z;
partner->state.goalPos.x = player->currentPos.x;
partner->state.goalPos.z = player->currentPos.z;
partner->state.moveTime = 4;
partner->state.angle = 0.0f;
gBattleState2 = BATTLE_STATES2_UNK_C;
}
}
if (gBattleState2 == BATTLE_STATES2_UNK_C) {
if (partner->state.moveTime != 0) {
partner->currentPos.x += (partner->state.goalPos.x - partner->currentPos.x)
/ partner->state.moveTime;
partner->currentPos.z += (partner->state.goalPos.z - partner->currentPos.z)
/ partner->state.moveTime;
player->currentPos.x += (partner->state.currentPos.x - player->currentPos.x)
/ partner->state.moveTime;
player->currentPos.z += (partner->state.currentPos.z - player->currentPos.z)
/ partner->state.moveTime;
}
partner->currentPos.z += sin_rad((partner->state.angle * TAU) / 360.0f) * 16.0f;
partner->yaw = clamp_angle(-partner->state.angle);
player->currentPos.z -= sin_rad((partner->state.angle * TAU) / 360.0f) * 16.0f;
player->yaw = clamp_angle(-partner->state.angle);
partner->state.angle += 90.0f;
if (partner->state.moveTime != 0) {
partner->state.moveTime--;
} else {
partner->currentPos.x = partner->state.goalPos.x;
partner->currentPos.z = partner->state.goalPos.z;
player->currentPos.x = partner->state.currentPos.x;
player->currentPos.z = partner->state.currentPos.z;
partner->homePos.x = partner->currentPos.x;
partner->homePos.z = partner->currentPos.z;
player->homePos.x = player->currentPos.x;
player->homePos.z = player->currentPos.z;
gBattleState2 = BATTLE_STATES2_UNK_2;
gBattleStatus.flags1 &= ~BS_FLAGS1_100000;
}
}
if (gBattleState2 == BATTLE_STATES2_UNK_2) {
func_8024E40C(2);
if (battleStatus->unk_8A == 3) {
if ((s8) battleStatus->totalStarPoints == 0) {
battleStatus->unk_8A = 0;
playerData->merleeTurnCount = 0;
playerData->merleeCastsLeft++;
} else {
battleStatus->battlePhase = PHASE_MERLEE_EXP_BONUS;
script = start_script(PlayerScriptDispatcher, 0xA, 0);
player->takeTurnScript = script;
player->takeTurnID = script->id;
script->owner1.enemyID = 0;
}
}
gBattleState2 = BATTLE_STATES2_UNK_3;
D_8029F248 = 0;
gBattleStatus.flags1 &= ~BS_FLAGS1_2;
}
if (gBattleState2 == BATTLE_STATES2_UNK_3) {
if (D_8029F248 != 0) {
D_8029F248--;
} else if (player->takeTurnScript == NULL || !does_script_exist(player->takeTurnID)) {
player->takeTurnScript = NULL;
if (battleStatus->unk_8A != 3) {
gBattleState2 = BATTLE_STATES2_UNK_4;
} else {
battleStatus->incrementStarPointDelay = 0x14;
battleStatus->unk_8A = 0;
gBattleState2 = BATTLE_STATES2_UNK_4;
battleStatus->pendingStarPoints = battleStatus->totalStarPoints
+ battleStatus->pendingStarPoints + battleStatus->pendingStarPoints;
}
}
}
if (gBattleState2 == BATTLE_STATES2_UNK_4 && (s8) battleStatus->pendingStarPoints <= 0) {
if (gBattleStatus.flags1 & BS_FLAGS1_1000000) {
gBattleStatus.flags1 &= ~BS_FLAGS1_40000;
}
if ((u16) playerData->unk_2A4[0] < 0x270F) {
playerData->unk_2A4[0]++;
}
if (gBattleStatus.flags1 & BS_FLAGS1_40000) {
currentEncounter->battleOutcome = OUTCOME_ENEMY_FLED;
} else {
currentEncounter->battleOutcome = OUTCOME_PLAYER_WON;
}
if (gBattleStatus.flags1 & BS_FLAGS1_20000) {
if (!(gBattleStatus.flags2 & BS_FLAGS2_2000000)) {
bgm_set_song(0, -1, 0, 0x5DC, 8);
}
btl_set_state(0x20);
} else {
btl_set_state(0x21);
}
}
}
void btl_state_draw_victory(void) {
}
@ -243,15 +445,15 @@ void btl_state_update_defend(void) {
Evt* script;
switch (gBattleState2) {
case 0:
case BATTLE_STATES2_UNK_0:
gBattleStatus.unk_8C = 0;
gBattleStatus.battlePhase = 6;
gBattleStatus.battlePhase = PHASE_USE_DEFEND;
player->takeTurnScript = script = start_script(PlayerScriptDispatcher, 10, 0);
player->takeTurnID = script->id;
gBattleState2 = 1;
gBattleState2 = BATTLE_STATES2_UNK_1;
script->owner1.enemyID = 0;
break;
case 1:
case BATTLE_STATES2_UNK_1:
if (!does_script_exist(player->takeTurnID) && gBattleStatus.unk_8C == 0) {
btl_set_state(0x16);
}
@ -267,7 +469,81 @@ INCLUDE_ASM(s32, "16F740", btl_state_update_run_away);
void btl_state_draw_run_away(void) {
}
INCLUDE_ASM(s32, "16F740", btl_state_update_defeat);
void btl_state_update_defeat(void) {
BattleStatus* battleStatus = &gBattleStatus;
EncounterStatus* currentEncounter = &gCurrentEncounter;
Actor* player = battleStatus->playerActor;
Actor* partner = battleStatus->partnerActor;
Evt* script;
switch (gBattleState2) {
case BATTLE_STATES2_UNK_0:
battleStatus->flags1 &= ~BS_FLAGS1_8;
battleStatus->unk_8C = 0;
battleStatus->flags2 &= ~BS_FLAGS2_2;
battleStatus->flags2 &= ~BS_FLAGS2_4;
battleStatus->flags2 &= ~BS_FLAGS2_8;
battleStatus->flags2 &= ~BS_FLAGS2_10;
if (player->debuff != 0) {
if (player->debuff == 7) {
sfx_play_sound(SOUND_E7);
player->unk_228->flags |= EFFECT_INSTANCE_FLAGS_10;
player->unk_228 = NULL;
}
player->debuff = 0;
player->debuffDuration = 0;
remove_status_debuff(player->hudElementDataIndex);
player->koStatus = 0;
player->koDuration = 0;
player->ptrDefuffIcon->ptrPropertyList[15] = 0;
}
func_8024E40C(0x19);
btl_cam_target_actor(0);
battleStatus->battlePhase = PHASE_RUN_AWAY_RESET;
script = start_script(PlayerScriptDispatcher, 0xA, 0);
player->takeTurnScript = script;
player->takeTurnID = script->id;
script->owner1.enemyID = 0;
if (partner != NULL) {
script = start_script(partner->takeTurnScriptSource, 0xA, 0);
partner->takeTurnScript = script;
partner->takeTurnID = script->id;
script->owner1.enemyID = 0x100;
}
gBattleState2 = BATTLE_STATES2_UNK_1;
break;
case BATTLE_STATES2_UNK_1:
if (!does_script_exist(player->takeTurnID) && battleStatus->unk_8C == 0) {
if (find_item(ITEM_LIFE_SHROOM) >= 0) {
battleStatus->battlePhase = PHASE_USE_LIFE_SHROOM;
script = start_script(PlayerScriptDispatcher, 0xA, 0);
player->takeTurnScript = script;
player->takeTurnID = script->id;
script->owner1.enemyID = 0;
gBattleState2 = BATTLE_STATES2_UNK_2;
} else {
gBattleState2 = BATTLE_STATES2_PLAYER_DEFEATED;
}
}
break;
case BATTLE_STATES2_UNK_2:
if (!does_script_exist(player->takeTurnID) && battleStatus->unk_8C == 0) {
gBattleState2 = BATTLE_STATES2_PLAYER_DEFEATED;
}
break;
}
if (gBattleState2 == BATTLE_STATES2_PLAYER_DEFEATED) {
currentEncounter->battleOutcome = OUTCOME_PLAYER_LOST;
if (!(gBattleStatus.flags2 & BS_FLAGS2_2000000)) {
bgm_set_song(0, -1, 0, 0x5DC, 8);
}
btl_set_state(0x20);
}
}
void btl_state_draw_defeat(void) {
}
@ -282,7 +558,132 @@ ApiStatus DisablePartnerBlur(Evt* script, s32 isInitialCall) {
return ApiStatus_DONE2;
}
INCLUDE_ASM(s32, "16F740", btl_state_update_change_partner);
void btl_state_update_change_partner(void) {
BattleStatus* battleStatus = &gBattleStatus;
Actor* player = battleStatus->playerActor;
Actor* partner = battleStatus->partnerActor;
ActorState* state = &player->state;
PlayerData* playerData = &gPlayerData;
Actor* enemyActor;
Evt* script;
s32 i;
switch (gBattleState2) {
case BATTLE_STATES2_UNK_0:
player->flags &= ~ACTOR_FLAG_8000000;
partner->flags &= ~ACTOR_FLAG_8000000;
battleStatus->unk_8C = 0;
gBattleStatus.flags2 |= BS_FLAGS2_10;
func_8024E40C(0x13);
btl_cam_set_target_pos(-89.0, 40.0, -99.0);
btl_cam_set_zoom(0x174);
btl_cam_set_zoffset(0);
gBattleStatus.flags1 &= ~BS_FLAGS1_2;
for (i = 0; i < ARRAY_COUNT(battleStatus->enemyActors); i++) {
enemyActor = battleStatus->enemyActors[i];
if (enemyActor != NULL) {
enemyActor->flags &= ~ACTOR_FLAG_80000;
enemyActor->flags &= ~ACTOR_FLAG_8000000;
}
}
battleStatus->unk_5C = -1;
D_8029F248 = 0xA;
gBattleState2 = BATTLE_STATES2_UNK_2;
case BATTLE_STATES2_UNK_2:
if (D_8029F248 != 0) {
D_8029F248--;
break;
}
deduct_current_move_fp();
script = start_script(BtlPutPartnerAway, 0xA, 0);
battleStatus->controlScript = script;
battleStatus->controlScriptID = script->id;
script->owner1.enemyID = 0x100;
state->unk_18.x = partner->currentPos.x;
state->unk_18.y = 0.0f;
state->unk_18.z = partner->currentPos.z;
gBattleState2 = BATTLE_STATES2_UNK_3;
break;
case BATTLE_STATES2_UNK_3:
if (!does_script_exist(battleStatus->controlScriptID)) {
btl_delete_actor(partner);
playerData->currentPartner = battleStatus->unk_1AA[2];
load_partner_actor();
partner = battleStatus->partnerActor;
partner->scale.x = 0.1f;
partner->scale.y = 0.1f;
partner->scale.z = 0.1f;
partner->state.goalPos.x = state->unk_18.x;
partner->state.goalPos.y = partner->currentPos.y;
partner->state.goalPos.z = state->unk_18.z;
partner->currentPos.x = player->currentPos.x;
partner->currentPos.y = player->currentPos.y + 25.0f;
partner->currentPos.z = player->currentPos.z;
gBattleState2 = BATTLE_STATES2_UNK_4;
}
break;
case BATTLE_STATES2_UNK_4:
partner = battleStatus->partnerActor;
if (partner != NULL) {
if (!does_script_exist(partner->takeTurnID)) {
partner->takeTurnScript = NULL;
} else {
break;
}
}
script = start_script(BtlBringPartnerOut, 0xA, 0);
battleStatus->controlScript = script;
battleStatus->controlScriptID = script->id;
script->owner1.enemyID = 0x100;
gBattleState2 = BATTLE_STATES2_UNK_5;
break;
case BATTLE_STATES2_UNK_5:
if (!does_script_exist(battleStatus->controlScriptID)) {
partner = battleStatus->partnerActor;
if (partner != NULL) {
if (partner->onTurnChanceScriptSource != NULL) {
battleStatus->battlePhase = PHASE_PLAYER_BEGIN;
script = start_script(partner->onTurnChanceScriptSource, 0xA, 0);
partner->onTurnChangeScript = script;
partner->onTurnChangeID = script->id;
script->owner1.enemyID = 0x100;
}
}
gBattleState2 = BATTLE_STATES2_UNK_6;
}
break;
case BATTLE_STATES2_UNK_6:
partner = battleStatus->partnerActor;
if (partner == NULL || partner->onTurnChanceScriptSource == NULL
|| !does_script_exist(partner->onTurnChangeID)) {
func_8024E40C(2);
gBattleState2 = BATTLE_STATES2_UNK_7;
}
break;
case BATTLE_STATES2_UNK_7:
if (battleStatus->unk_8C == 0) {
gBattleStatus.flags2 &= ~BS_FLAGS2_10;
if (!(gBattleStatus.flags1 & BS_FLAGS1_80000)) {
if (player_team_is_ability_active(player, ABILITY_QUICK_CHANGE) != FALSE) {
btl_set_state(0xC);
} else {
btl_set_state(0x16);
}
} else {
if (player_team_is_ability_active(player, ABILITY_QUICK_CHANGE) == FALSE) {
btl_set_state(0x17);
} else {
btl_set_state(0xC);
}
}
}
break;
}
}
void btl_state_draw_change_partner(void) {
}
@ -297,7 +698,255 @@ INCLUDE_ASM(s32, "16F740", btl_state_update_end_player_turn);
void filemenu_main_update_code(void) {
}
INCLUDE_ASM(s32, "16F740", btl_state_update_partner_move);
void btl_state_update_partner_move(void) {
BattleStatus* battleStatus = &gBattleStatus;
PlayerData* playerData = &gPlayerData;
Actor* enemyActor;
Actor* player = battleStatus->playerActor;
Actor* partner = battleStatus->partnerActor;
Evt* script;
s8 switchCondition;
s32 phi_s3;
s32 phi_s0;
s32 i;
switch (gBattleState2) {
case BATTLE_STATES2_UNK_0:
if (partner == NULL) {
btl_set_state(9);
} else {
battleStatus->unk_8C = 0;
battleStatus->unk_86 = 0x7F;
battleStatus->blockResult = 0x7F;
battleStatus->unk_19A = 0;
gBattleStatus.flags1 &= ~BS_FLAGS1_1000;
gBattleStatus.flags1 &= ~BS_FLAGS1_2;
reset_actor_turn_info();
partner->status = 0;
partner->flags &= ~ACTOR_FLAG_8000000;
player->flags &= ~ACTOR_FLAG_8000000;
deduct_current_move_fp();
btl_cam_target_actor(0x100);
gBattleStatus.flags2 |= BS_FLAGS2_10;
gBattleStatus.flags1 &= ~BS_FLAGS1_200000;
for (i = 0; i < ARRAY_COUNT(battleStatus->enemyActors); i++) {
enemyActor = battleStatus->enemyActors[i];
if (enemyActor != NULL) {
enemyActor->status = 0;
}
}
func_8024E40C(2);
gBattleState2 = BATTLE_STATES2_UNK_2;
}
break;
case BATTLE_STATES2_UNK_2:
for (i = 0; i < ARRAY_COUNT(battleStatus->enemyActors); i++) {
enemyActor = battleStatus->enemyActors[i];
if (enemyActor != NULL) {
enemyActor->flags &= ~ACTOR_FLAG_80000;
enemyActor->flags &= ~ACTOR_FLAG_8000000;
}
}
increment_status_menu_disabled();
gBattleStatus.flags1 |= BS_FLAGS1_100;
reset_actor_turn_info();
reset_all_actor_sounds(partner);
battleStatus->battlePhase = PHASE_EXECUTE_ACTION;
script = start_script(partner->takeTurnScriptSource, 0xA, 0);
partner->takeTurnScript = script;
partner->takeTurnID = script->id;
script->owner1.enemyID = 0x100;
gBattleState2 = BATTLE_STATES2_UNK_3;
break;
case BATTLE_STATES2_UNK_3:
if (!(gBattleStatus.flags1 & BS_FLAGS1_200000)) {
if (partner->takeTurnScript == NULL || !does_script_exist(partner->takeTurnID)) {
partner->takeTurnScript = NULL;
} else {
break;
}
}
gBattleStatus.flags1 &= ~BS_FLAGS1_100;
if ((partner->onHitScript == NULL || !does_script_exist(partner->onHitID))
&& ((partner->onHitScript = NULL, player->onHitScript == NULL)
|| !does_script_exist(player->onHitID))) {
player->onHitScript = NULL;
for (phi_s3 = FALSE, i = 0; i < ARRAY_COUNT(battleStatus->enemyActors); i++) {
enemyActor = battleStatus->enemyActors[i];
if (enemyActor != NULL && enemyActor->takeTurnScript != NULL) {
if (does_script_exist(enemyActor->takeTurnID)) {
phi_s3 = TRUE;
} else {
enemyActor->takeTurnScript = NULL;
}
}
}
if (phi_s3 == FALSE) {
for (i = 0; i < ARRAY_COUNT(battleStatus->enemyActors); i++) {
enemyActor = battleStatus->enemyActors[i];
if (enemyActor != NULL && enemyActor->onHitScript != NULL) {
if (does_script_exist(enemyActor->onHitID)) {
phi_s3 = TRUE;
} else {
enemyActor->onHitScript = NULL;
}
}
}
if (phi_s3 == FALSE) {
for (i = 0; i < ARRAY_COUNT(battleStatus->enemyActors); i++) {
enemyActor = battleStatus->enemyActors[i];
if (enemyActor != NULL) {
enemyActor->flags &= ~ACTOR_FLAG_80000;
}
}
if (battleStatus->unk_8C == 0) {
if (gGameStatusPtr->demoFlags & 1) {
btl_set_state(0x23);
break;
}
decrement_status_menu_disabled();
if (playerData->currentPartner == 1 && battleStatus->moveCategory == 5
&& battleStatus->selectedMoveID != MOVE_CHARGE) {
partner->isGlowing = 0;
gBattleStatus.flags1 &= ~BS_FLAGS1_40000000;
}
if (btl_check_player_defeated() == FALSE) {
for (i = 0; i < ARRAY_COUNT(battleStatus->enemyActors); i++) {
enemyActor = battleStatus->enemyActors[i];
if (enemyActor != NULL) {
if (!(enemyActor->flags & ACTOR_FLAG_NO_DMG_APPLY)) {
enemyActor->flags |= (ACTOR_FLAG_8000000 | ACTOR_FLAG_4000000);
}
}
}
btl_update_ko_status();
if ((s8) partner->status == 0xD && btl_are_all_enemies_defeated() == FALSE) {
func_8024E40C(0x36);
btl_show_battle_message(0x23, 0x3C);
partner->status = 0;
partner->unk_21D[0] = 0;
gBattleState2 = BATTLE_STATES2_UNK_B;
partner->flags |= ACTOR_FLAG_8000000;
} else {
gBattleState2 = BATTLE_STATES2_UNK_14;
}
} else {
return;
}
}
}
}
}
break;
case BATTLE_STATES2_UNK_B:
if (btl_is_popup_displayed() == FALSE) {
func_8024E40C(2);
btl_cam_move(0xF);
D_8029F248 = 0xA;
gBattleState2 = BATTLE_STATES2_UNK_C;
}
break;
case BATTLE_STATES2_UNK_C:
if (D_8029F248 != 0) {
D_8029F248--;
} else {
gBattleState2 = BATTLE_STATES2_UNK_14;
}
break;
}
switch (gBattleState2) {
case BATTLE_STATES2_UNK_14:
for (phi_s3 = FALSE, i = 0; i < ARRAY_COUNT(battleStatus->enemyActors); i++) {
enemyActor = battleStatus->enemyActors[i];
if (enemyActor != NULL) {
if ((s8)enemyActor->status != 0) {
phi_s3 = TRUE;
break;
}
}
}
if (phi_s3 == FALSE) {
gBattleState2 = BATTLE_STATES2_UNK_1E;
} else {
func_8024E40C(3);
switchCondition = enemyActor->status - 4;
switch (switchCondition) {
case 0:
phi_s0 = 0x12;
break;
case 2:
phi_s0 = 0x13;
break;
case 3:
phi_s0 = 0x14;
break;
case 5:
phi_s0 = 0x15;
break;
case 6:
phi_s0 = 0x16;
break;
case 1:
phi_s0 = 0x17;
break;
case 7:
phi_s0 = 0x18;
break;
case 4:
phi_s0 = 0x19;
break;
default:
phi_s0 = 0;
gBattleState2 = BATTLE_STATES2_UNK_14;
break;
}
sfx_play_sound(SOUND_UNKNOWN_2107);
btl_show_battle_message(phi_s0, 0x3C);
for (i = 0; i < ARRAY_COUNT(battleStatus->enemyActors); i++) {
enemyActor = battleStatus->enemyActors[i];
if (enemyActor != NULL) {
enemyActor->status = 0;
}
}
gBattleState2 = BATTLE_STATES2_UNK_15;
}
break;
case BATTLE_STATES2_UNK_15:
if (btl_is_popup_displayed() == FALSE) {
func_8024E40C(2);
btl_cam_move(0xF);
D_8029F248 = 0xA;
gBattleState2 = BATTLE_STATES2_UNK_16;
}
break;
case BATTLE_STATES2_UNK_16:
if (D_8029F248 != 0) {
D_8029F248--;
} else {
gBattleState2 = BATTLE_STATES2_UNK_1E;
}
break;
}
if (gBattleState2 == BATTLE_STATES2_UNK_1E && (partner->takeTurnScript == NULL ||
!does_script_exist(partner->takeTurnID))) {
partner->takeTurnScript = NULL;
btl_set_state(0x17);
}
}
void btl_state_draw_partner_move(void) {
}
@ -305,11 +954,11 @@ void btl_state_draw_partner_move(void) {
void btl_state_update_end_partner_turn(void) {
BattleStatus* battleStatus = &gBattleStatus;
if (gBattleState2 == 0) {
battleStatus->flags2 |= 0x4;
if (gBattleState2 == BATTLE_STATES2_UNK_0) {
battleStatus->flags2 |= BS_FLAGS2_4;
if (!btl_check_enemies_defeated()) {
battleStatus->flags1 &= ~0x80000;
battleStatus->flags2 &= ~0x10;
battleStatus->flags1 &= ~BS_FLAGS1_80000;
battleStatus->flags2 &= ~BS_FLAGS2_10;
if (battleStatus->unk_94 < 0) {
battleStatus->unk_94 = 0;

View File

@ -1,272 +0,0 @@
.set noat # allow manual use of $at
.set noreorder # don't insert nops after branches
.section .rodata
dlabel jtbl_8029CAD0
.word .L8024574C_17402C, .L80245AAC_17438C, .L80245828_174108, .L8024589C_17417C, .L80245938_174218, .L80245994_174274, .L80245A00_1742E0, .L80245A44_174324
.section .text
glabel btl_state_update_change_partner
/* 173FD8 802456F8 27BDFFD8 */ addiu $sp, $sp, -0x28
/* 173FDC 802456FC AFB20018 */ sw $s2, 0x18($sp)
/* 173FE0 80245700 3C12800E */ lui $s2, %hi(gBattleStatus)
/* 173FE4 80245704 2652C070 */ addiu $s2, $s2, %lo(gBattleStatus)
/* 173FE8 80245708 AFBF0020 */ sw $ra, 0x20($sp)
/* 173FEC 8024570C AFB3001C */ sw $s3, 0x1c($sp)
/* 173FF0 80245710 AFB10014 */ sw $s1, 0x14($sp)
/* 173FF4 80245714 AFB00010 */ sw $s0, 0x10($sp)
/* 173FF8 80245718 8E5000D8 */ lw $s0, 0xd8($s2)
/* 173FFC 8024571C 8E5100DC */ lw $s1, 0xdc($s2)
/* 174000 80245720 3C03800E */ lui $v1, %hi(gBattleState2)
/* 174004 80245724 8C63C4DC */ lw $v1, %lo(gBattleState2)($v1)
/* 174008 80245728 2C620008 */ sltiu $v0, $v1, 8
/* 17400C 8024572C 104000DF */ beqz $v0, .L80245AAC_17438C
/* 174010 80245730 2613000C */ addiu $s3, $s0, 0xc
/* 174014 80245734 00031080 */ sll $v0, $v1, 2
/* 174018 80245738 3C01802A */ lui $at, %hi(jtbl_8029CAD0)
/* 17401C 8024573C 00220821 */ addu $at, $at, $v0
/* 174020 80245740 8C22CAD0 */ lw $v0, %lo(jtbl_8029CAD0)($at)
/* 174024 80245744 00400008 */ jr $v0
/* 174028 80245748 00000000 */ nop
.L8024574C_17402C:
/* 17402C 8024574C 3C03F7FF */ lui $v1, 0xf7ff
/* 174030 80245750 8E020000 */ lw $v0, ($s0)
/* 174034 80245754 3463FFFF */ ori $v1, $v1, 0xffff
/* 174038 80245758 00431024 */ and $v0, $v0, $v1
/* 17403C 8024575C AE020000 */ sw $v0, ($s0)
/* 174040 80245760 8E220000 */ lw $v0, ($s1)
/* 174044 80245764 3C10800E */ lui $s0, %hi(gBattleStatus)
/* 174048 80245768 2610C070 */ addiu $s0, $s0, %lo(gBattleStatus)
/* 17404C 8024576C 00431024 */ and $v0, $v0, $v1
/* 174050 80245770 AE220000 */ sw $v0, ($s1)
/* 174054 80245774 8E020004 */ lw $v0, 4($s0)
/* 174058 80245778 24040013 */ addiu $a0, $zero, 0x13
/* 17405C 8024577C A240008C */ sb $zero, 0x8c($s2)
/* 174060 80245780 34420010 */ ori $v0, $v0, 0x10
/* 174064 80245784 0C093903 */ jal func_8024E40C
/* 174068 80245788 AE020004 */ sw $v0, 4($s0)
/* 17406C 8024578C 3C06C2C6 */ lui $a2, 0xc2c6
/* 174070 80245790 3C01C2B2 */ lui $at, 0xc2b2
/* 174074 80245794 44816000 */ mtc1 $at, $f12
/* 174078 80245798 3C014220 */ lui $at, 0x4220
/* 17407C 8024579C 44817000 */ mtc1 $at, $f14
/* 174080 802457A0 0C093948 */ jal btl_cam_set_target_pos
/* 174084 802457A4 00000000 */ nop
/* 174088 802457A8 0C093965 */ jal btl_cam_set_zoom
/* 17408C 802457AC 24040174 */ addiu $a0, $zero, 0x174
/* 174090 802457B0 0C093978 */ jal btl_cam_set_zoffset
/* 174094 802457B4 0000202D */ daddu $a0, $zero, $zero
/* 174098 802457B8 0000282D */ daddu $a1, $zero, $zero
/* 17409C 802457BC 3C07FFF7 */ lui $a3, 0xfff7
/* 1740A0 802457C0 34E7FFFF */ ori $a3, $a3, 0xffff
/* 1740A4 802457C4 3C06F7FF */ lui $a2, 0xf7ff
/* 1740A8 802457C8 34C6FFFF */ ori $a2, $a2, 0xffff
/* 1740AC 802457CC 0240202D */ daddu $a0, $s2, $zero
/* 1740B0 802457D0 8E020000 */ lw $v0, ($s0)
/* 1740B4 802457D4 2403FFFD */ addiu $v1, $zero, -3
/* 1740B8 802457D8 00431024 */ and $v0, $v0, $v1
/* 1740BC 802457DC AE020000 */ sw $v0, ($s0)
.L802457E0:
/* 1740C0 802457E0 8C8300E0 */ lw $v1, 0xe0($a0)
/* 1740C4 802457E4 10600005 */ beqz $v1, .L802457FC
/* 1740C8 802457E8 24A50001 */ addiu $a1, $a1, 1
/* 1740CC 802457EC 8C620000 */ lw $v0, ($v1)
/* 1740D0 802457F0 00471024 */ and $v0, $v0, $a3
/* 1740D4 802457F4 00461024 */ and $v0, $v0, $a2
/* 1740D8 802457F8 AC620000 */ sw $v0, ($v1)
.L802457FC:
/* 1740DC 802457FC 28A20018 */ slti $v0, $a1, 0x18
/* 1740E0 80245800 1440FFF7 */ bnez $v0, .L802457E0
/* 1740E4 80245804 24840004 */ addiu $a0, $a0, 4
/* 1740E8 80245808 2402FFFF */ addiu $v0, $zero, -1
/* 1740EC 8024580C A242005C */ sb $v0, 0x5c($s2)
/* 1740F0 80245810 2402000A */ addiu $v0, $zero, 0xa
/* 1740F4 80245814 3C01802A */ lui $at, %hi(D_8029F248)
/* 1740F8 80245818 AC22F248 */ sw $v0, %lo(D_8029F248)($at)
/* 1740FC 8024581C 24020002 */ addiu $v0, $zero, 2
/* 174100 80245820 3C01800E */ lui $at, %hi(gBattleState2)
/* 174104 80245824 AC22C4DC */ sw $v0, %lo(gBattleState2)($at)
.L80245828_174108:
/* 174108 80245828 3C03802A */ lui $v1, %hi(D_8029F248)
/* 17410C 8024582C 2463F248 */ addiu $v1, $v1, %lo(D_8029F248)
/* 174110 80245830 8C620000 */ lw $v0, ($v1)
/* 174114 80245834 10400003 */ beqz $v0, .L80245844
/* 174118 80245838 2442FFFF */ addiu $v0, $v0, -1
/* 17411C 8024583C 080916AB */ j .L80245AAC_17438C
/* 174120 80245840 AC620000 */ sw $v0, ($v1)
.L80245844:
/* 174124 80245844 0C098EF2 */ jal deduct_current_move_fp
/* 174128 80245848 00000000 */ nop
/* 17412C 8024584C 3C048028 */ lui $a0, %hi(BtlPutPartnerAway)
/* 174130 80245850 24840A34 */ addiu $a0, $a0, %lo(BtlPutPartnerAway)
/* 174134 80245854 2405000A */ addiu $a1, $zero, 0xa
/* 174138 80245858 0C0B0CF8 */ jal start_script
/* 17413C 8024585C 0000302D */ daddu $a2, $zero, $zero
/* 174140 80245860 0040202D */ daddu $a0, $v0, $zero
/* 174144 80245864 AE4400BC */ sw $a0, 0xbc($s2)
/* 174148 80245868 8C820144 */ lw $v0, 0x144($a0)
/* 17414C 8024586C AE4200C0 */ sw $v0, 0xc0($s2)
/* 174150 80245870 24020100 */ addiu $v0, $zero, 0x100
/* 174154 80245874 AC820148 */ sw $v0, 0x148($a0)
/* 174158 80245878 C6200144 */ lwc1 $f0, 0x144($s1)
/* 17415C 8024587C AE60001C */ sw $zero, 0x1c($s3)
/* 174160 80245880 E6600018 */ swc1 $f0, 0x18($s3)
/* 174164 80245884 C620014C */ lwc1 $f0, 0x14c($s1)
/* 174168 80245888 24020003 */ addiu $v0, $zero, 3
/* 17416C 8024588C 3C01800E */ lui $at, %hi(gBattleState2)
/* 174170 80245890 AC22C4DC */ sw $v0, %lo(gBattleState2)($at)
/* 174174 80245894 080916AB */ j .L80245AAC_17438C
/* 174178 80245898 E6600020 */ swc1 $f0, 0x20($s3)
.L8024589C_17417C:
/* 17417C 8024589C 8E4400C0 */ lw $a0, 0xc0($s2)
/* 174180 802458A0 0C0B1059 */ jal does_script_exist
/* 174184 802458A4 00000000 */ nop
/* 174188 802458A8 14400080 */ bnez $v0, .L80245AAC_17438C
/* 17418C 802458AC 00000000 */ nop
/* 174190 802458B0 0C0902EF */ jal btl_delete_actor
/* 174194 802458B4 0220202D */ daddu $a0, $s1, $zero
/* 174198 802458B8 924301AC */ lbu $v1, 0x1ac($s2)
/* 17419C 802458BC 3C028011 */ lui $v0, %hi(gPlayerData)
/* 1741A0 802458C0 2442F290 */ addiu $v0, $v0, %lo(gPlayerData)
/* 1741A4 802458C4 0C0992DD */ jal load_partner_actor
/* 1741A8 802458C8 A0430012 */ sb $v1, 0x12($v0)
/* 1741AC 802458CC 8E5100DC */ lw $s1, 0xdc($s2)
/* 1741B0 802458D0 3C013DCC */ lui $at, 0x3dcc
/* 1741B4 802458D4 3421CCCD */ ori $at, $at, 0xcccd
/* 1741B8 802458D8 44810000 */ mtc1 $at, $f0
/* 1741BC 802458DC 00000000 */ nop
/* 1741C0 802458E0 E6200170 */ swc1 $f0, 0x170($s1)
/* 1741C4 802458E4 E6200174 */ swc1 $f0, 0x174($s1)
/* 1741C8 802458E8 E6200178 */ swc1 $f0, 0x178($s1)
/* 1741CC 802458EC C6600018 */ lwc1 $f0, 0x18($s3)
/* 1741D0 802458F0 C6220148 */ lwc1 $f2, 0x148($s1)
/* 1741D4 802458F4 E6200018 */ swc1 $f0, 0x18($s1)
/* 1741D8 802458F8 E622001C */ swc1 $f2, 0x1c($s1)
/* 1741DC 802458FC C6600020 */ lwc1 $f0, 0x20($s3)
/* 1741E0 80245900 3C0141C8 */ lui $at, 0x41c8
/* 1741E4 80245904 44811000 */ mtc1 $at, $f2
/* 1741E8 80245908 E6200020 */ swc1 $f0, 0x20($s1)
/* 1741EC 8024590C C6000144 */ lwc1 $f0, 0x144($s0)
/* 1741F0 80245910 E6200144 */ swc1 $f0, 0x144($s1)
/* 1741F4 80245914 C6000148 */ lwc1 $f0, 0x148($s0)
/* 1741F8 80245918 46020000 */ add.s $f0, $f0, $f2
/* 1741FC 8024591C E6200148 */ swc1 $f0, 0x148($s1)
/* 174200 80245920 C600014C */ lwc1 $f0, 0x14c($s0)
/* 174204 80245924 24020004 */ addiu $v0, $zero, 4
/* 174208 80245928 3C01800E */ lui $at, %hi(gBattleState2)
/* 17420C 8024592C AC22C4DC */ sw $v0, %lo(gBattleState2)($at)
/* 174210 80245930 080916AB */ j .L80245AAC_17438C
/* 174214 80245934 E620014C */ swc1 $f0, 0x14c($s1)
.L80245938_174218:
/* 174218 80245938 8E5100DC */ lw $s1, 0xdc($s2)
/* 17421C 8024593C 12200006 */ beqz $s1, .L80245958
/* 174220 80245940 00000000 */ nop
/* 174224 80245944 0C0B1059 */ jal does_script_exist
/* 174228 80245948 8E2401E4 */ lw $a0, 0x1e4($s1)
/* 17422C 8024594C 14400057 */ bnez $v0, .L80245AAC_17438C
/* 174230 80245950 00000000 */ nop
/* 174234 80245954 AE2001D4 */ sw $zero, 0x1d4($s1)
.L80245958:
/* 174238 80245958 3C048028 */ lui $a0, %hi(BtlBringPartnerOut)
/* 17423C 8024595C 24840B6C */ addiu $a0, $a0, %lo(BtlBringPartnerOut)
/* 174240 80245960 2405000A */ addiu $a1, $zero, 0xa
/* 174244 80245964 0C0B0CF8 */ jal start_script
/* 174248 80245968 0000302D */ daddu $a2, $zero, $zero
/* 17424C 8024596C 0040202D */ daddu $a0, $v0, $zero
/* 174250 80245970 AE4400BC */ sw $a0, 0xbc($s2)
/* 174254 80245974 8C820144 */ lw $v0, 0x144($a0)
/* 174258 80245978 24030005 */ addiu $v1, $zero, 5
/* 17425C 8024597C 3C01800E */ lui $at, %hi(gBattleState2)
/* 174260 80245980 AC23C4DC */ sw $v1, %lo(gBattleState2)($at)
/* 174264 80245984 AE4200C0 */ sw $v0, 0xc0($s2)
/* 174268 80245988 24020100 */ addiu $v0, $zero, 0x100
/* 17426C 8024598C 080916AB */ j .L80245AAC_17438C
/* 174270 80245990 AC820148 */ sw $v0, 0x148($a0)
.L80245994_174274:
/* 174274 80245994 8E4400C0 */ lw $a0, 0xc0($s2)
/* 174278 80245998 0C0B1059 */ jal does_script_exist
/* 17427C 8024599C 00000000 */ nop
/* 174280 802459A0 14400042 */ bnez $v0, .L80245AAC_17438C
/* 174284 802459A4 00000000 */ nop
/* 174288 802459A8 8E5100DC */ lw $s1, 0xdc($s2)
/* 17428C 802459AC 12200010 */ beqz $s1, .L802459F0
/* 174290 802459B0 24020006 */ addiu $v0, $zero, 6
/* 174294 802459B4 8E2201CC */ lw $v0, 0x1cc($s1)
/* 174298 802459B8 1040000C */ beqz $v0, .L802459EC
/* 17429C 802459BC 2405000A */ addiu $a1, $zero, 0xa
/* 1742A0 802459C0 00A0102D */ daddu $v0, $a1, $zero
/* 1742A4 802459C4 A24201A7 */ sb $v0, 0x1a7($s2)
/* 1742A8 802459C8 8E2401CC */ lw $a0, 0x1cc($s1)
/* 1742AC 802459CC 0C0B0CF8 */ jal start_script
/* 1742B0 802459D0 0000302D */ daddu $a2, $zero, $zero
/* 1742B4 802459D4 0040202D */ daddu $a0, $v0, $zero
/* 1742B8 802459D8 AE2401DC */ sw $a0, 0x1dc($s1)
/* 1742BC 802459DC 8C820144 */ lw $v0, 0x144($a0)
/* 1742C0 802459E0 AE2201EC */ sw $v0, 0x1ec($s1)
/* 1742C4 802459E4 24020100 */ addiu $v0, $zero, 0x100
/* 1742C8 802459E8 AC820148 */ sw $v0, 0x148($a0)
.L802459EC:
/* 1742CC 802459EC 24020006 */ addiu $v0, $zero, 6
.L802459F0:
/* 1742D0 802459F0 3C01800E */ lui $at, %hi(gBattleState2)
/* 1742D4 802459F4 AC22C4DC */ sw $v0, %lo(gBattleState2)($at)
/* 1742D8 802459F8 080916AB */ j .L80245AAC_17438C
/* 1742DC 802459FC 00000000 */ nop
.L80245A00_1742E0:
/* 1742E0 80245A00 8E5100DC */ lw $s1, 0xdc($s2)
/* 1742E4 80245A04 12200008 */ beqz $s1, .L80245A28
/* 1742E8 80245A08 00000000 */ nop
/* 1742EC 80245A0C 8E2201CC */ lw $v0, 0x1cc($s1)
/* 1742F0 80245A10 10400005 */ beqz $v0, .L80245A28
/* 1742F4 80245A14 00000000 */ nop
/* 1742F8 80245A18 0C0B1059 */ jal does_script_exist
/* 1742FC 80245A1C 8E2401EC */ lw $a0, 0x1ec($s1)
/* 174300 80245A20 14400022 */ bnez $v0, .L80245AAC_17438C
/* 174304 80245A24 00000000 */ nop
.L80245A28:
/* 174308 80245A28 0C093903 */ jal func_8024E40C
/* 17430C 80245A2C 24040002 */ addiu $a0, $zero, 2
/* 174310 80245A30 24020007 */ addiu $v0, $zero, 7
/* 174314 80245A34 3C01800E */ lui $at, %hi(gBattleState2)
/* 174318 80245A38 AC22C4DC */ sw $v0, %lo(gBattleState2)($at)
/* 17431C 80245A3C 080916AB */ j .L80245AAC_17438C
/* 174320 80245A40 00000000 */ nop
.L80245A44_174324:
/* 174324 80245A44 8242008C */ lb $v0, 0x8c($s2)
/* 174328 80245A48 14400018 */ bnez $v0, .L80245AAC_17438C
/* 17432C 80245A4C 2403FFEF */ addiu $v1, $zero, -0x11
/* 174330 80245A50 3C04800E */ lui $a0, %hi(gBattleStatus)
/* 174334 80245A54 2484C070 */ addiu $a0, $a0, %lo(gBattleStatus)
/* 174338 80245A58 8C820004 */ lw $v0, 4($a0)
/* 17433C 80245A5C 00431024 */ and $v0, $v0, $v1
/* 174340 80245A60 AC820004 */ sw $v0, 4($a0)
/* 174344 80245A64 8C820000 */ lw $v0, ($a0)
/* 174348 80245A68 3C030008 */ lui $v1, 8
/* 17434C 80245A6C 00431024 */ and $v0, $v0, $v1
/* 174350 80245A70 14400007 */ bnez $v0, .L80245A90
/* 174354 80245A74 0200202D */ daddu $a0, $s0, $zero
/* 174358 80245A78 0C099CAB */ jal player_team_is_ability_active
/* 17435C 80245A7C 2405001A */ addiu $a1, $zero, 0x1a
/* 174360 80245A80 14400008 */ bnez $v0, .L80245AA4
/* 174364 80245A84 2404000C */ addiu $a0, $zero, 0xc
/* 174368 80245A88 080916A9 */ j .L80245AA4
/* 17436C 80245A8C 24040016 */ addiu $a0, $zero, 0x16
.L80245A90:
/* 174370 80245A90 0C099CAB */ jal player_team_is_ability_active
/* 174374 80245A94 2405001A */ addiu $a1, $zero, 0x1a
/* 174378 80245A98 10400002 */ beqz $v0, .L80245AA4
/* 17437C 80245A9C 24040017 */ addiu $a0, $zero, 0x17
/* 174380 80245AA0 2404000C */ addiu $a0, $zero, 0xc
.L80245AA4:
/* 174384 80245AA4 0C090464 */ jal btl_set_state
/* 174388 80245AA8 00000000 */ nop
.L80245AAC_17438C:
/* 17438C 80245AAC 8FBF0020 */ lw $ra, 0x20($sp)
/* 174390 80245AB0 8FB3001C */ lw $s3, 0x1c($sp)
/* 174394 80245AB4 8FB20018 */ lw $s2, 0x18($sp)
/* 174398 80245AB8 8FB10014 */ lw $s1, 0x14($sp)
/* 17439C 80245ABC 8FB00010 */ lw $s0, 0x10($sp)
/* 1743A0 80245AC0 03E00008 */ jr $ra
/* 1743A4 80245AC4 27BD0028 */ addiu $sp, $sp, 0x28

View File

@ -1,171 +0,0 @@
.set noat # allow manual use of $at
.set noreorder # don't insert nops after branches
glabel btl_state_update_defeat
/* 173D20 80245440 27BDFFD0 */ addiu $sp, $sp, -0x30
/* 173D24 80245444 AFB1001C */ sw $s1, 0x1c($sp)
/* 173D28 80245448 3C11800E */ lui $s1, %hi(gBattleStatus)
/* 173D2C 8024544C 2631C070 */ addiu $s1, $s1, %lo(gBattleStatus)
/* 173D30 80245450 AFB30024 */ sw $s3, 0x24($sp)
/* 173D34 80245454 3C13800E */ lui $s3, %hi(gBattleState2)
/* 173D38 80245458 2673C4DC */ addiu $s3, $s3, %lo(gBattleState2)
/* 173D3C 8024545C 24020001 */ addiu $v0, $zero, 1
/* 173D40 80245460 AFBF0028 */ sw $ra, 0x28($sp)
/* 173D44 80245464 AFB20020 */ sw $s2, 0x20($sp)
/* 173D48 80245468 AFB00018 */ sw $s0, 0x18($sp)
/* 173D4C 8024546C 8E3000D8 */ lw $s0, 0xd8($s1)
/* 173D50 80245470 8E630000 */ lw $v1, ($s3)
/* 173D54 80245474 8E3200DC */ lw $s2, 0xdc($s1)
/* 173D58 80245478 1062004D */ beq $v1, $v0, .L802455B0
/* 173D5C 8024547C 28620002 */ slti $v0, $v1, 2
/* 173D60 80245480 10400005 */ beqz $v0, .L80245498
/* 173D64 80245484 24020002 */ addiu $v0, $zero, 2
/* 173D68 80245488 10600007 */ beqz $v1, .L802454A8
/* 173D6C 8024548C 2404FFF7 */ addiu $a0, $zero, -9
/* 173D70 80245490 0809158F */ j .L8024563C
/* 173D74 80245494 00000000 */ nop
.L80245498:
/* 173D78 80245498 1062005E */ beq $v1, $v0, .L80245614
/* 173D7C 8024549C 00000000 */ nop
/* 173D80 802454A0 0809158F */ j .L8024563C
/* 173D84 802454A4 00000000 */ nop
.L802454A8:
/* 173D88 802454A8 8E220000 */ lw $v0, ($s1)
/* 173D8C 802454AC 00441024 */ and $v0, $v0, $a0
/* 173D90 802454B0 AE220000 */ sw $v0, ($s1)
/* 173D94 802454B4 8E220004 */ lw $v0, 4($s1)
/* 173D98 802454B8 2403FFFD */ addiu $v1, $zero, -3
/* 173D9C 802454BC A220008C */ sb $zero, 0x8c($s1)
/* 173DA0 802454C0 00431024 */ and $v0, $v0, $v1
/* 173DA4 802454C4 2403FFFB */ addiu $v1, $zero, -5
/* 173DA8 802454C8 00431024 */ and $v0, $v0, $v1
/* 173DAC 802454CC 00441024 */ and $v0, $v0, $a0
/* 173DB0 802454D0 2403FFEF */ addiu $v1, $zero, -0x11
/* 173DB4 802454D4 00431024 */ and $v0, $v0, $v1
/* 173DB8 802454D8 AE220004 */ sw $v0, 4($s1)
/* 173DBC 802454DC 82030210 */ lb $v1, 0x210($s0)
/* 173DC0 802454E0 10600013 */ beqz $v1, .L80245530
/* 173DC4 802454E4 24020007 */ addiu $v0, $zero, 7
/* 173DC8 802454E8 14620008 */ bne $v1, $v0, .L8024550C
/* 173DCC 802454EC 00000000 */ nop
/* 173DD0 802454F0 0C05272D */ jal sfx_play_sound
/* 173DD4 802454F4 240400E7 */ addiu $a0, $zero, 0xe7
/* 173DD8 802454F8 8E030228 */ lw $v1, 0x228($s0)
/* 173DDC 802454FC 8C620000 */ lw $v0, ($v1)
/* 173DE0 80245500 34420010 */ ori $v0, $v0, 0x10
/* 173DE4 80245504 AC620000 */ sw $v0, ($v1)
/* 173DE8 80245508 AE000228 */ sw $zero, 0x228($s0)
.L8024550C:
/* 173DEC 8024550C 86040436 */ lh $a0, 0x436($s0)
/* 173DF0 80245510 A2000210 */ sb $zero, 0x210($s0)
/* 173DF4 80245514 0C011E26 */ jal remove_status_debuff
/* 173DF8 80245518 A2000211 */ sb $zero, 0x211($s0)
/* 173DFC 8024551C 8E020440 */ lw $v0, 0x440($s0)
/* 173E00 80245520 A2000216 */ sb $zero, 0x216($s0)
/* 173E04 80245524 A2000217 */ sb $zero, 0x217($s0)
/* 173E08 80245528 8C42000C */ lw $v0, 0xc($v0)
/* 173E0C 8024552C AC40003C */ sw $zero, 0x3c($v0)
.L80245530:
/* 173E10 80245530 0C093903 */ jal func_8024E40C
/* 173E14 80245534 24040019 */ addiu $a0, $zero, 0x19
/* 173E18 80245538 0C09390F */ jal btl_cam_target_actor
/* 173E1C 8024553C 0000202D */ daddu $a0, $zero, $zero
/* 173E20 80245540 3C048028 */ lui $a0, %hi(PlayerScriptDispatcher)
/* 173E24 80245544 24844EBC */ addiu $a0, $a0, %lo(PlayerScriptDispatcher)
/* 173E28 80245548 2405000A */ addiu $a1, $zero, 0xa
/* 173E2C 8024554C 0000302D */ daddu $a2, $zero, $zero
/* 173E30 80245550 24020004 */ addiu $v0, $zero, 4
/* 173E34 80245554 0C0B0CF8 */ jal start_script
/* 173E38 80245558 A22201A7 */ sb $v0, 0x1a7($s1)
/* 173E3C 8024555C 0040202D */ daddu $a0, $v0, $zero
/* 173E40 80245560 AE0401D4 */ sw $a0, 0x1d4($s0)
/* 173E44 80245564 8C820144 */ lw $v0, 0x144($a0)
/* 173E48 80245568 AE0201E4 */ sw $v0, 0x1e4($s0)
/* 173E4C 8024556C 1240000B */ beqz $s2, .L8024559C
/* 173E50 80245570 AC800148 */ sw $zero, 0x148($a0)
/* 173E54 80245574 2405000A */ addiu $a1, $zero, 0xa
/* 173E58 80245578 8E4401C4 */ lw $a0, 0x1c4($s2)
/* 173E5C 8024557C 0C0B0CF8 */ jal start_script
/* 173E60 80245580 0000302D */ daddu $a2, $zero, $zero
/* 173E64 80245584 0040202D */ daddu $a0, $v0, $zero
/* 173E68 80245588 AE4401D4 */ sw $a0, 0x1d4($s2)
/* 173E6C 8024558C 8C820144 */ lw $v0, 0x144($a0)
/* 173E70 80245590 AE4201E4 */ sw $v0, 0x1e4($s2)
/* 173E74 80245594 24020100 */ addiu $v0, $zero, 0x100
/* 173E78 80245598 AC820148 */ sw $v0, 0x148($a0)
.L8024559C:
/* 173E7C 8024559C 24020001 */ addiu $v0, $zero, 1
/* 173E80 802455A0 3C01800E */ lui $at, %hi(gBattleState2)
/* 173E84 802455A4 AC22C4DC */ sw $v0, %lo(gBattleState2)($at)
/* 173E88 802455A8 0809158F */ j .L8024563C
/* 173E8C 802455AC 00000000 */ nop
.L802455B0:
/* 173E90 802455B0 0C0B1059 */ jal does_script_exist
/* 173E94 802455B4 8E0401E4 */ lw $a0, 0x1e4($s0)
/* 173E98 802455B8 14400020 */ bnez $v0, .L8024563C
/* 173E9C 802455BC 00000000 */ nop
/* 173EA0 802455C0 8222008C */ lb $v0, 0x8c($s1)
/* 173EA4 802455C4 1440001D */ bnez $v0, .L8024563C
/* 173EA8 802455C8 00000000 */ nop
/* 173EAC 802455CC 0C039D91 */ jal find_item
/* 173EB0 802455D0 24040095 */ addiu $a0, $zero, 0x95
/* 173EB4 802455D4 04400017 */ bltz $v0, .L80245634
/* 173EB8 802455D8 2405000A */ addiu $a1, $zero, 0xa
/* 173EBC 802455DC 3C048028 */ lui $a0, %hi(PlayerScriptDispatcher)
/* 173EC0 802455E0 24844EBC */ addiu $a0, $a0, %lo(PlayerScriptDispatcher)
/* 173EC4 802455E4 0000302D */ daddu $a2, $zero, $zero
/* 173EC8 802455E8 24020008 */ addiu $v0, $zero, 8
/* 173ECC 802455EC 0C0B0CF8 */ jal start_script
/* 173ED0 802455F0 A22201A7 */ sb $v0, 0x1a7($s1)
/* 173ED4 802455F4 0040202D */ daddu $a0, $v0, $zero
/* 173ED8 802455F8 AE0401D4 */ sw $a0, 0x1d4($s0)
/* 173EDC 802455FC 8C830144 */ lw $v1, 0x144($a0)
/* 173EE0 80245600 24020002 */ addiu $v0, $zero, 2
/* 173EE4 80245604 AE620000 */ sw $v0, ($s3)
/* 173EE8 80245608 AE0301E4 */ sw $v1, 0x1e4($s0)
/* 173EEC 8024560C 0809158F */ j .L8024563C
/* 173EF0 80245610 AC800148 */ sw $zero, 0x148($a0)
.L80245614:
/* 173EF4 80245614 8E0401E4 */ lw $a0, 0x1e4($s0)
/* 173EF8 80245618 0C0B1059 */ jal does_script_exist
/* 173EFC 8024561C 00000000 */ nop
/* 173F00 80245620 14400006 */ bnez $v0, .L8024563C
/* 173F04 80245624 00000000 */ nop
/* 173F08 80245628 8222008C */ lb $v0, 0x8c($s1)
/* 173F0C 8024562C 14400003 */ bnez $v0, .L8024563C
/* 173F10 80245630 00000000 */ nop
.L80245634:
/* 173F14 80245634 2402000A */ addiu $v0, $zero, 0xa
/* 173F18 80245638 AE620000 */ sw $v0, ($s3)
.L8024563C:
/* 173F1C 8024563C 3C03800E */ lui $v1, %hi(gBattleState2)
/* 173F20 80245640 8C63C4DC */ lw $v1, %lo(gBattleState2)($v1)
/* 173F24 80245644 2402000A */ addiu $v0, $zero, 0xa
/* 173F28 80245648 14620012 */ bne $v1, $v0, .L80245694
/* 173F2C 8024564C 24030001 */ addiu $v1, $zero, 1
/* 173F30 80245650 3C02800B */ lui $v0, %hi(gCurrentEncounter)
/* 173F34 80245654 24420F10 */ addiu $v0, $v0, %lo(gCurrentEncounter)
/* 173F38 80245658 A0430009 */ sb $v1, 9($v0)
/* 173F3C 8024565C 3C02800E */ lui $v0, %hi(gBattleStatus+0x4)
/* 173F40 80245660 8C42C074 */ lw $v0, %lo(gBattleStatus+0x4)($v0)
/* 173F44 80245664 3C030200 */ lui $v1, 0x200
/* 173F48 80245668 00431024 */ and $v0, $v0, $v1
/* 173F4C 8024566C 14400007 */ bnez $v0, .L8024568C
/* 173F50 80245670 24020008 */ addiu $v0, $zero, 8
/* 173F54 80245674 AFA20010 */ sw $v0, 0x10($sp)
/* 173F58 80245678 0000202D */ daddu $a0, $zero, $zero
/* 173F5C 8024567C 2405FFFF */ addiu $a1, $zero, -1
/* 173F60 80245680 0080302D */ daddu $a2, $a0, $zero
/* 173F64 80245684 0C052A46 */ jal bgm_set_song
/* 173F68 80245688 240705DC */ addiu $a3, $zero, 0x5dc
.L8024568C:
/* 173F6C 8024568C 0C090464 */ jal btl_set_state
/* 173F70 80245690 24040020 */ addiu $a0, $zero, 0x20
.L80245694:
/* 173F74 80245694 8FBF0028 */ lw $ra, 0x28($sp)
/* 173F78 80245698 8FB30024 */ lw $s3, 0x24($sp)
/* 173F7C 8024569C 8FB20020 */ lw $s2, 0x20($sp)
/* 173F80 802456A0 8FB1001C */ lw $s1, 0x1c($sp)
/* 173F84 802456A4 8FB00018 */ lw $s0, 0x18($sp)
/* 173F88 802456A8 03E00008 */ jr $ra
/* 173F8C 802456AC 27BD0030 */ addiu $sp, $sp, 0x30

View File

@ -1,507 +0,0 @@
.set noat # allow manual use of $at
.set noreorder # don't insert nops after branches
.section .rodata
dlabel jtbl_8029CB30
.word .L80246B8C_17546C, .L80246FFC_1758DC, .L80246C5C_17553C, .L80246CFC_1755DC, .L80246FFC_1758DC, .L80246FFC_1758DC, .L80246FFC_1758DC, .L80246FFC_1758DC, .L80246FFC_1758DC, .L80246FFC_1758DC, .L80246FFC_1758DC, .L80246FA0_175880, .L80246FD4_1758B4, 0
dlabel jtbl_8029CB68
.word .L802470BC_17599C, .L802470E4_1759C4, .L802470C4_1759A4, .L802470CC_1759AC, .L802470F4_1759D4, .L802470D4_1759B4, .L802470DC_1759BC, .L802470EC_1759CC
.section .text
glabel btl_state_update_partner_move
/* 175414 80246B34 3C03800E */ lui $v1, %hi(gBattleState2)
/* 175418 80246B38 8C63C4DC */ lw $v1, %lo(gBattleState2)($v1)
/* 17541C 80246B3C 27BDFFD0 */ addiu $sp, $sp, -0x30
/* 175420 80246B40 AFB50024 */ sw $s5, 0x24($sp)
/* 175424 80246B44 3C15800E */ lui $s5, %hi(gBattleStatus)
/* 175428 80246B48 26B5C070 */ addiu $s5, $s5, %lo(gBattleStatus)
/* 17542C 80246B4C AFBF0028 */ sw $ra, 0x28($sp)
/* 175430 80246B50 AFB40020 */ sw $s4, 0x20($sp)
/* 175434 80246B54 AFB3001C */ sw $s3, 0x1c($sp)
/* 175438 80246B58 AFB20018 */ sw $s2, 0x18($sp)
/* 17543C 80246B5C AFB10014 */ sw $s1, 0x14($sp)
/* 175440 80246B60 AFB00010 */ sw $s0, 0x10($sp)
/* 175444 80246B64 8EB200D8 */ lw $s2, 0xd8($s5)
/* 175448 80246B68 8EB400DC */ lw $s4, 0xdc($s5)
/* 17544C 80246B6C 2C62000D */ sltiu $v0, $v1, 0xd
/* 175450 80246B70 10400122 */ beqz $v0, .L80246FFC_1758DC
/* 175454 80246B74 00031080 */ sll $v0, $v1, 2
/* 175458 80246B78 3C01802A */ lui $at, %hi(jtbl_8029CB30)
/* 17545C 80246B7C 00220821 */ addu $at, $at, $v0
/* 175460 80246B80 8C22CB30 */ lw $v0, %lo(jtbl_8029CB30)($at)
/* 175464 80246B84 00400008 */ jr $v0
/* 175468 80246B88 00000000 */ nop
.L80246B8C_17546C:
/* 17546C 80246B8C 16800005 */ bnez $s4, .L80246BA4
/* 175470 80246B90 2402007F */ addiu $v0, $zero, 0x7f
/* 175474 80246B94 0C090464 */ jal btl_set_state
/* 175478 80246B98 24040009 */ addiu $a0, $zero, 9
/* 17547C 80246B9C 08091BFF */ j .L80246FFC_1758DC
/* 175480 80246BA0 00000000 */ nop
.L80246BA4:
/* 175484 80246BA4 3C10800E */ lui $s0, %hi(gBattleStatus)
/* 175488 80246BA8 2610C070 */ addiu $s0, $s0, %lo(gBattleStatus)
/* 17548C 80246BAC A2A0008C */ sb $zero, 0x8c($s5)
/* 175490 80246BB0 A2A20086 */ sb $v0, 0x86($s5)
/* 175494 80246BB4 A2A20087 */ sb $v0, 0x87($s5)
/* 175498 80246BB8 A2A0019A */ sb $zero, 0x19a($s5)
/* 17549C 80246BBC 8E020000 */ lw $v0, ($s0)
/* 1754A0 80246BC0 2403EFFF */ addiu $v1, $zero, -0x1001
/* 1754A4 80246BC4 00431024 */ and $v0, $v0, $v1
/* 1754A8 80246BC8 2403FFFD */ addiu $v1, $zero, -3
/* 1754AC 80246BCC 00431024 */ and $v0, $v0, $v1
/* 1754B0 80246BD0 0C098F18 */ jal reset_actor_turn_info
/* 1754B4 80246BD4 AE020000 */ sw $v0, ($s0)
/* 1754B8 80246BD8 3C03F7FF */ lui $v1, 0xf7ff
/* 1754BC 80246BDC 8E820000 */ lw $v0, ($s4)
/* 1754C0 80246BE0 3463FFFF */ ori $v1, $v1, 0xffff
/* 1754C4 80246BE4 A280021C */ sb $zero, 0x21c($s4)
/* 1754C8 80246BE8 00431024 */ and $v0, $v0, $v1
/* 1754CC 80246BEC AE820000 */ sw $v0, ($s4)
/* 1754D0 80246BF0 8E420000 */ lw $v0, ($s2)
/* 1754D4 80246BF4 0000882D */ daddu $s1, $zero, $zero
/* 1754D8 80246BF8 00431024 */ and $v0, $v0, $v1
/* 1754DC 80246BFC 0C098EF2 */ jal deduct_current_move_fp
/* 1754E0 80246C00 AE420000 */ sw $v0, ($s2)
/* 1754E4 80246C04 0C09390F */ jal btl_cam_target_actor
/* 1754E8 80246C08 24040100 */ addiu $a0, $zero, 0x100
/* 1754EC 80246C0C 3C04FFDF */ lui $a0, 0xffdf
/* 1754F0 80246C10 3484FFFF */ ori $a0, $a0, 0xffff
/* 1754F4 80246C14 02A0282D */ daddu $a1, $s5, $zero
/* 1754F8 80246C18 8E020004 */ lw $v0, 4($s0)
/* 1754FC 80246C1C 8E030000 */ lw $v1, ($s0)
/* 175500 80246C20 34420010 */ ori $v0, $v0, 0x10
/* 175504 80246C24 00641824 */ and $v1, $v1, $a0
/* 175508 80246C28 AE020004 */ sw $v0, 4($s0)
/* 17550C 80246C2C AE030000 */ sw $v1, ($s0)
.L80246C30:
/* 175510 80246C30 8CB000E0 */ lw $s0, 0xe0($a1)
/* 175514 80246C34 56000001 */ bnel $s0, $zero, .L80246C3C
/* 175518 80246C38 A200021C */ sb $zero, 0x21c($s0)
.L80246C3C:
/* 17551C 80246C3C 26310001 */ addiu $s1, $s1, 1
/* 175520 80246C40 2A220018 */ slti $v0, $s1, 0x18
/* 175524 80246C44 1440FFFA */ bnez $v0, .L80246C30
/* 175528 80246C48 24A50004 */ addiu $a1, $a1, 4
/* 17552C 80246C4C 0C093903 */ jal func_8024E40C
/* 175530 80246C50 24040002 */ addiu $a0, $zero, 2
/* 175534 80246C54 08091BFD */ j .L80246FF4
/* 175538 80246C58 24020002 */ addiu $v0, $zero, 2
.L80246C5C_17553C:
/* 17553C 80246C5C 0000882D */ daddu $s1, $zero, $zero
/* 175540 80246C60 3C05FFF7 */ lui $a1, 0xfff7
/* 175544 80246C64 34A5FFFF */ ori $a1, $a1, 0xffff
/* 175548 80246C68 3C04F7FF */ lui $a0, 0xf7ff
/* 17554C 80246C6C 3484FFFF */ ori $a0, $a0, 0xffff
/* 175550 80246C70 02A0182D */ daddu $v1, $s5, $zero
.L80246C74:
/* 175554 80246C74 8C7000E0 */ lw $s0, 0xe0($v1)
/* 175558 80246C78 12000005 */ beqz $s0, .L80246C90
/* 17555C 80246C7C 26310001 */ addiu $s1, $s1, 1
/* 175560 80246C80 8E020000 */ lw $v0, ($s0)
/* 175564 80246C84 00451024 */ and $v0, $v0, $a1
/* 175568 80246C88 00441024 */ and $v0, $v0, $a0
/* 17556C 80246C8C AE020000 */ sw $v0, ($s0)
.L80246C90:
/* 175570 80246C90 2A220018 */ slti $v0, $s1, 0x18
/* 175574 80246C94 1440FFF7 */ bnez $v0, .L80246C74
/* 175578 80246C98 24630004 */ addiu $v1, $v1, 4
/* 17557C 80246C9C 0C03A6D5 */ jal increment_status_menu_disabled
/* 175580 80246CA0 00000000 */ nop
/* 175584 80246CA4 3C03800E */ lui $v1, %hi(gBattleStatus)
/* 175588 80246CA8 2463C070 */ addiu $v1, $v1, %lo(gBattleStatus)
/* 17558C 80246CAC 8C620000 */ lw $v0, ($v1)
/* 175590 80246CB0 34420100 */ ori $v0, $v0, 0x100
/* 175594 80246CB4 0C098F18 */ jal reset_actor_turn_info
/* 175598 80246CB8 AC620000 */ sw $v0, ($v1)
/* 17559C 80246CBC 0C099EA7 */ jal reset_all_actor_sounds
/* 1755A0 80246CC0 0280202D */ daddu $a0, $s4, $zero
/* 1755A4 80246CC4 2405000A */ addiu $a1, $zero, 0xa
/* 1755A8 80246CC8 A2A001A7 */ sb $zero, 0x1a7($s5)
/* 1755AC 80246CCC 8E8401C4 */ lw $a0, 0x1c4($s4)
/* 1755B0 80246CD0 0C0B0CF8 */ jal start_script
/* 1755B4 80246CD4 0000302D */ daddu $a2, $zero, $zero
/* 1755B8 80246CD8 AE8201D4 */ sw $v0, 0x1d4($s4)
/* 1755BC 80246CDC 8C440144 */ lw $a0, 0x144($v0)
/* 1755C0 80246CE0 24030003 */ addiu $v1, $zero, 3
/* 1755C4 80246CE4 3C01800E */ lui $at, %hi(gBattleState2)
/* 1755C8 80246CE8 AC23C4DC */ sw $v1, %lo(gBattleState2)($at)
/* 1755CC 80246CEC 24030100 */ addiu $v1, $zero, 0x100
/* 1755D0 80246CF0 AE8401E4 */ sw $a0, 0x1e4($s4)
/* 1755D4 80246CF4 08091BFF */ j .L80246FFC_1758DC
/* 1755D8 80246CF8 AC430148 */ sw $v1, 0x148($v0)
.L80246CFC_1755DC:
/* 1755DC 80246CFC 3C02800E */ lui $v0, %hi(gBattleStatus)
/* 1755E0 80246D00 8C42C070 */ lw $v0, %lo(gBattleStatus)($v0)
/* 1755E4 80246D04 3C030020 */ lui $v1, 0x20
/* 1755E8 80246D08 00431024 */ and $v0, $v0, $v1
/* 1755EC 80246D0C 1440000A */ bnez $v0, .L80246D38
/* 1755F0 80246D10 00000000 */ nop
/* 1755F4 80246D14 8E8201D4 */ lw $v0, 0x1d4($s4)
/* 1755F8 80246D18 50400007 */ beql $v0, $zero, .L80246D38
/* 1755FC 80246D1C AE8001D4 */ sw $zero, 0x1d4($s4)
/* 175600 80246D20 8E8401E4 */ lw $a0, 0x1e4($s4)
/* 175604 80246D24 0C0B1059 */ jal does_script_exist
/* 175608 80246D28 00000000 */ nop
/* 17560C 80246D2C 144000B3 */ bnez $v0, .L80246FFC_1758DC
/* 175610 80246D30 00000000 */ nop
/* 175614 80246D34 AE8001D4 */ sw $zero, 0x1d4($s4)
.L80246D38:
/* 175618 80246D38 3C04800E */ lui $a0, %hi(gBattleStatus)
/* 17561C 80246D3C 2484C070 */ addiu $a0, $a0, %lo(gBattleStatus)
/* 175620 80246D40 8C820000 */ lw $v0, ($a0)
/* 175624 80246D44 2403FEFF */ addiu $v1, $zero, -0x101
/* 175628 80246D48 00431024 */ and $v0, $v0, $v1
/* 17562C 80246D4C AC820000 */ sw $v0, ($a0)
/* 175630 80246D50 8E8201D8 */ lw $v0, 0x1d8($s4)
/* 175634 80246D54 50400007 */ beql $v0, $zero, .L80246D74
/* 175638 80246D58 AE8001D8 */ sw $zero, 0x1d8($s4)
/* 17563C 80246D5C 8E8401E8 */ lw $a0, 0x1e8($s4)
/* 175640 80246D60 0C0B1059 */ jal does_script_exist
/* 175644 80246D64 00000000 */ nop
/* 175648 80246D68 144000A4 */ bnez $v0, .L80246FFC_1758DC
/* 17564C 80246D6C 00000000 */ nop
/* 175650 80246D70 AE8001D8 */ sw $zero, 0x1d8($s4)
.L80246D74:
/* 175654 80246D74 8E4201D8 */ lw $v0, 0x1d8($s2)
/* 175658 80246D78 50400007 */ beql $v0, $zero, .L80246D98
/* 17565C 80246D7C AE4001D8 */ sw $zero, 0x1d8($s2)
/* 175660 80246D80 8E4401E8 */ lw $a0, 0x1e8($s2)
/* 175664 80246D84 0C0B1059 */ jal does_script_exist
/* 175668 80246D88 00000000 */ nop
/* 17566C 80246D8C 1440009B */ bnez $v0, .L80246FFC_1758DC
/* 175670 80246D90 00000000 */ nop
/* 175674 80246D94 AE4001D8 */ sw $zero, 0x1d8($s2)
.L80246D98:
/* 175678 80246D98 0000982D */ daddu $s3, $zero, $zero
/* 17567C 80246D9C 0260882D */ daddu $s1, $s3, $zero
/* 175680 80246DA0 02A0902D */ daddu $s2, $s5, $zero
.L80246DA4:
/* 175684 80246DA4 8E5000E0 */ lw $s0, 0xe0($s2)
/* 175688 80246DA8 5200000B */ beql $s0, $zero, .L80246DD8
/* 17568C 80246DAC 26310001 */ addiu $s1, $s1, 1
/* 175690 80246DB0 8E0201D4 */ lw $v0, 0x1d4($s0)
/* 175694 80246DB4 50400008 */ beql $v0, $zero, .L80246DD8
/* 175698 80246DB8 26310001 */ addiu $s1, $s1, 1
/* 17569C 80246DBC 8E0401E4 */ lw $a0, 0x1e4($s0)
/* 1756A0 80246DC0 0C0B1059 */ jal does_script_exist
/* 1756A4 80246DC4 00000000 */ nop
/* 1756A8 80246DC8 50400002 */ beql $v0, $zero, .L80246DD4
/* 1756AC 80246DCC AE0001D4 */ sw $zero, 0x1d4($s0)
/* 1756B0 80246DD0 24130001 */ addiu $s3, $zero, 1
.L80246DD4:
/* 1756B4 80246DD4 26310001 */ addiu $s1, $s1, 1
.L80246DD8:
/* 1756B8 80246DD8 2A220018 */ slti $v0, $s1, 0x18
/* 1756BC 80246DDC 1440FFF1 */ bnez $v0, .L80246DA4
/* 1756C0 80246DE0 26520004 */ addiu $s2, $s2, 4
/* 1756C4 80246DE4 16600085 */ bnez $s3, .L80246FFC_1758DC
/* 1756C8 80246DE8 0000882D */ daddu $s1, $zero, $zero
/* 1756CC 80246DEC 02A0902D */ daddu $s2, $s5, $zero
.L80246DF0:
/* 1756D0 80246DF0 8E5000E0 */ lw $s0, 0xe0($s2)
/* 1756D4 80246DF4 5200000B */ beql $s0, $zero, .L80246E24
/* 1756D8 80246DF8 26310001 */ addiu $s1, $s1, 1
/* 1756DC 80246DFC 8E0201D8 */ lw $v0, 0x1d8($s0)
/* 1756E0 80246E00 50400008 */ beql $v0, $zero, .L80246E24
/* 1756E4 80246E04 26310001 */ addiu $s1, $s1, 1
/* 1756E8 80246E08 8E0401E8 */ lw $a0, 0x1e8($s0)
/* 1756EC 80246E0C 0C0B1059 */ jal does_script_exist
/* 1756F0 80246E10 00000000 */ nop
/* 1756F4 80246E14 50400002 */ beql $v0, $zero, .L80246E20
/* 1756F8 80246E18 AE0001D8 */ sw $zero, 0x1d8($s0)
/* 1756FC 80246E1C 24130001 */ addiu $s3, $zero, 1
.L80246E20:
/* 175700 80246E20 26310001 */ addiu $s1, $s1, 1
.L80246E24:
/* 175704 80246E24 2A220018 */ slti $v0, $s1, 0x18
/* 175708 80246E28 1440FFF1 */ bnez $v0, .L80246DF0
/* 17570C 80246E2C 26520004 */ addiu $s2, $s2, 4
/* 175710 80246E30 16600072 */ bnez $s3, .L80246FFC_1758DC
/* 175714 80246E34 0000882D */ daddu $s1, $zero, $zero
/* 175718 80246E38 3C04FFF7 */ lui $a0, 0xfff7
/* 17571C 80246E3C 3484FFFF */ ori $a0, $a0, 0xffff
/* 175720 80246E40 02A0182D */ daddu $v1, $s5, $zero
.L80246E44:
/* 175724 80246E44 8C7000E0 */ lw $s0, 0xe0($v1)
/* 175728 80246E48 12000004 */ beqz $s0, .L80246E5C
/* 17572C 80246E4C 26310001 */ addiu $s1, $s1, 1
/* 175730 80246E50 8E020000 */ lw $v0, ($s0)
/* 175734 80246E54 00441024 */ and $v0, $v0, $a0
/* 175738 80246E58 AE020000 */ sw $v0, ($s0)
.L80246E5C:
/* 17573C 80246E5C 2A220018 */ slti $v0, $s1, 0x18
/* 175740 80246E60 1440FFF8 */ bnez $v0, .L80246E44
/* 175744 80246E64 24630004 */ addiu $v1, $v1, 4
/* 175748 80246E68 82A2008C */ lb $v0, 0x8c($s5)
/* 17574C 80246E6C 14400063 */ bnez $v0, .L80246FFC_1758DC
/* 175750 80246E70 00000000 */ nop
/* 175754 80246E74 3C028007 */ lui $v0, %hi(gGameStatusPtr)
/* 175758 80246E78 8C42419C */ lw $v0, %lo(gGameStatusPtr)($v0)
/* 17575C 80246E7C 904200AA */ lbu $v0, 0xaa($v0)
/* 175760 80246E80 30420001 */ andi $v0, $v0, 1
/* 175764 80246E84 10400005 */ beqz $v0, .L80246E9C
/* 175768 80246E88 00000000 */ nop
/* 17576C 80246E8C 0C090464 */ jal btl_set_state
/* 175770 80246E90 24040023 */ addiu $a0, $zero, 0x23
/* 175774 80246E94 08091BFF */ j .L80246FFC_1758DC
/* 175778 80246E98 00000000 */ nop
.L80246E9C:
/* 17577C 80246E9C 0C03A6CC */ jal decrement_status_menu_disabled
/* 175780 80246EA0 00000000 */ nop
/* 175784 80246EA4 3C028011 */ lui $v0, %hi(gPlayerData)
/* 175788 80246EA8 2442F290 */ addiu $v0, $v0, %lo(gPlayerData)
/* 17578C 80246EAC 80430012 */ lb $v1, 0x12($v0)
/* 175790 80246EB0 24020001 */ addiu $v0, $zero, 1
/* 175794 80246EB4 1462000E */ bne $v1, $v0, .L80246EF0
/* 175798 80246EB8 24020005 */ addiu $v0, $zero, 5
/* 17579C 80246EBC 82A30178 */ lb $v1, 0x178($s5)
/* 1757A0 80246EC0 1462000B */ bne $v1, $v0, .L80246EF0
/* 1757A4 80246EC4 24020087 */ addiu $v0, $zero, 0x87
/* 1757A8 80246EC8 86A3017C */ lh $v1, 0x17c($s5)
/* 1757AC 80246ECC 10620008 */ beq $v1, $v0, .L80246EF0
/* 1757B0 80246ED0 3C04BFFF */ lui $a0, 0xbfff
/* 1757B4 80246ED4 3C03800E */ lui $v1, %hi(gBattleStatus)
/* 1757B8 80246ED8 2463C070 */ addiu $v1, $v1, %lo(gBattleStatus)
/* 1757BC 80246EDC A2800220 */ sb $zero, 0x220($s4)
/* 1757C0 80246EE0 8C620000 */ lw $v0, ($v1)
/* 1757C4 80246EE4 3484FFFF */ ori $a0, $a0, 0xffff
/* 1757C8 80246EE8 00441024 */ and $v0, $v0, $a0
/* 1757CC 80246EEC AC620000 */ sw $v0, ($v1)
.L80246EF0:
/* 1757D0 80246EF0 0C098D19 */ jal btl_check_player_defeated
/* 1757D4 80246EF4 00000000 */ nop
/* 1757D8 80246EF8 144000BD */ bnez $v0, .L802471F0
/* 1757DC 80246EFC 0000882D */ daddu $s1, $zero, $zero
/* 1757E0 80246F00 3C060040 */ lui $a2, 0x40
/* 1757E4 80246F04 3C050C00 */ lui $a1, 0xc00
/* 1757E8 80246F08 02A0202D */ daddu $a0, $s5, $zero
.L80246F0C:
/* 1757EC 80246F0C 8C9000E0 */ lw $s0, 0xe0($a0)
/* 1757F0 80246F10 12000007 */ beqz $s0, .L80246F30
/* 1757F4 80246F14 26310001 */ addiu $s1, $s1, 1
/* 1757F8 80246F18 8E030000 */ lw $v1, ($s0)
/* 1757FC 80246F1C 00661024 */ and $v0, $v1, $a2
/* 175800 80246F20 14400003 */ bnez $v0, .L80246F30
/* 175804 80246F24 00000000 */ nop
/* 175808 80246F28 00651025 */ or $v0, $v1, $a1
/* 17580C 80246F2C AE020000 */ sw $v0, ($s0)
.L80246F30:
/* 175810 80246F30 2A220018 */ slti $v0, $s1, 0x18
/* 175814 80246F34 1440FFF5 */ bnez $v0, .L80246F0C
/* 175818 80246F38 24840004 */ addiu $a0, $a0, 4
/* 17581C 80246F3C 0C099DDF */ jal btl_update_ko_status
/* 175820 80246F40 00000000 */ nop
/* 175824 80246F44 8283021C */ lb $v1, 0x21c($s4)
/* 175828 80246F48 2402000D */ addiu $v0, $zero, 0xd
/* 17582C 80246F4C 14620029 */ bne $v1, $v0, .L80246FF4
/* 175830 80246F50 24020014 */ addiu $v0, $zero, 0x14
/* 175834 80246F54 0C098CFA */ jal btl_are_all_enemies_defeated
/* 175838 80246F58 00000000 */ nop
/* 17583C 80246F5C 14400025 */ bnez $v0, .L80246FF4
/* 175840 80246F60 24020014 */ addiu $v0, $zero, 0x14
/* 175844 80246F64 0C093903 */ jal func_8024E40C
/* 175848 80246F68 24040036 */ addiu $a0, $zero, 0x36
/* 17584C 80246F6C 24040023 */ addiu $a0, $zero, 0x23
/* 175850 80246F70 0C093E58 */ jal btl_show_battle_message
/* 175854 80246F74 2405003C */ addiu $a1, $zero, 0x3c
/* 175858 80246F78 2402000B */ addiu $v0, $zero, 0xb
/* 17585C 80246F7C A280021C */ sb $zero, 0x21c($s4)
/* 175860 80246F80 A280021D */ sb $zero, 0x21d($s4)
/* 175864 80246F84 3C01800E */ lui $at, %hi(gBattleState2)
/* 175868 80246F88 AC22C4DC */ sw $v0, %lo(gBattleState2)($at)
/* 17586C 80246F8C 8E820000 */ lw $v0, ($s4)
/* 175870 80246F90 3C030800 */ lui $v1, 0x800
/* 175874 80246F94 00431025 */ or $v0, $v0, $v1
/* 175878 80246F98 08091BFF */ j .L80246FFC_1758DC
/* 17587C 80246F9C AE820000 */ sw $v0, ($s4)
.L80246FA0_175880:
/* 175880 80246FA0 0C093EAD */ jal btl_is_popup_displayed
/* 175884 80246FA4 00000000 */ nop
/* 175888 80246FA8 14400014 */ bnez $v0, .L80246FFC_1758DC
/* 17588C 80246FAC 00000000 */ nop
/* 175890 80246FB0 0C093903 */ jal func_8024E40C
/* 175894 80246FB4 24040002 */ addiu $a0, $zero, 2
/* 175898 80246FB8 0C093936 */ jal btl_cam_move
/* 17589C 80246FBC 2404000F */ addiu $a0, $zero, 0xf
/* 1758A0 80246FC0 2402000A */ addiu $v0, $zero, 0xa
/* 1758A4 80246FC4 3C01802A */ lui $at, %hi(D_8029F248)
/* 1758A8 80246FC8 AC22F248 */ sw $v0, %lo(D_8029F248)($at)
/* 1758AC 80246FCC 08091BFD */ j .L80246FF4
/* 1758B0 80246FD0 2402000C */ addiu $v0, $zero, 0xc
.L80246FD4_1758B4:
/* 1758B4 80246FD4 3C03802A */ lui $v1, %hi(D_8029F248)
/* 1758B8 80246FD8 2463F248 */ addiu $v1, $v1, %lo(D_8029F248)
/* 1758BC 80246FDC 8C620000 */ lw $v0, ($v1)
/* 1758C0 80246FE0 10400003 */ beqz $v0, .L80246FF0
/* 1758C4 80246FE4 2442FFFF */ addiu $v0, $v0, -1
/* 1758C8 80246FE8 08091BFF */ j .L80246FFC_1758DC
/* 1758CC 80246FEC AC620000 */ sw $v0, ($v1)
.L80246FF0:
/* 1758D0 80246FF0 24020014 */ addiu $v0, $zero, 0x14
.L80246FF4:
/* 1758D4 80246FF4 3C01800E */ lui $at, %hi(gBattleState2)
/* 1758D8 80246FF8 AC22C4DC */ sw $v0, %lo(gBattleState2)($at)
.L80246FFC_1758DC:
/* 1758DC 80246FFC 3C10800E */ lui $s0, %hi(gBattleState2)
/* 1758E0 80247000 2610C4DC */ addiu $s0, $s0, %lo(gBattleState2)
/* 1758E4 80247004 8E030000 */ lw $v1, ($s0)
/* 1758E8 80247008 24020015 */ addiu $v0, $zero, 0x15
/* 1758EC 8024700C 10620052 */ beq $v1, $v0, .L80247158
/* 1758F0 80247010 28620016 */ slti $v0, $v1, 0x16
/* 1758F4 80247014 10400005 */ beqz $v0, .L8024702C
/* 1758F8 80247018 24020014 */ addiu $v0, $zero, 0x14
/* 1758FC 8024701C 10620008 */ beq $v1, $v0, .L80247040
/* 175900 80247020 0000982D */ daddu $s3, $zero, $zero
/* 175904 80247024 08091C6C */ j .L802471B0
/* 175908 80247028 00000000 */ nop
.L8024702C:
/* 17590C 8024702C 24020016 */ addiu $v0, $zero, 0x16
/* 175910 80247030 10620056 */ beq $v1, $v0, .L8024718C
/* 175914 80247034 00000000 */ nop
/* 175918 80247038 08091C6C */ j .L802471B0
/* 17591C 8024703C 00000000 */ nop
.L80247040:
/* 175920 80247040 0260882D */ daddu $s1, $s3, $zero
/* 175924 80247044 02A0182D */ daddu $v1, $s5, $zero
.L80247048:
/* 175928 80247048 8C7000E0 */ lw $s0, 0xe0($v1)
/* 17592C 8024704C 12000004 */ beqz $s0, .L80247060
/* 175930 80247050 26310001 */ addiu $s1, $s1, 1
/* 175934 80247054 8202021C */ lb $v0, 0x21c($s0)
/* 175938 80247058 54400004 */ bnel $v0, $zero, .L8024706C
/* 17593C 8024705C 24130001 */ addiu $s3, $zero, 1
.L80247060:
/* 175940 80247060 2A220018 */ slti $v0, $s1, 0x18
/* 175944 80247064 1440FFF8 */ bnez $v0, .L80247048
/* 175948 80247068 24630004 */ addiu $v1, $v1, 4
.L8024706C:
/* 17594C 8024706C 16600005 */ bnez $s3, .L80247084
/* 175950 80247070 2402001E */ addiu $v0, $zero, 0x1e
/* 175954 80247074 3C01800E */ lui $at, %hi(gBattleState2)
/* 175958 80247078 AC22C4DC */ sw $v0, %lo(gBattleState2)($at)
/* 17595C 8024707C 08091C6C */ j .L802471B0
/* 175960 80247080 00000000 */ nop
.L80247084:
/* 175964 80247084 0C093903 */ jal func_8024E40C
/* 175968 80247088 24040003 */ addiu $a0, $zero, 3
/* 17596C 8024708C 9202021C */ lbu $v0, 0x21c($s0)
/* 175970 80247090 2442FFFC */ addiu $v0, $v0, -4
/* 175974 80247094 00021600 */ sll $v0, $v0, 0x18
/* 175978 80247098 00021E03 */ sra $v1, $v0, 0x18
/* 17597C 8024709C 2C620008 */ sltiu $v0, $v1, 8
/* 175980 802470A0 10400016 */ beqz $v0, .L802470FC
/* 175984 802470A4 00031080 */ sll $v0, $v1, 2
/* 175988 802470A8 3C01802A */ lui $at, %hi(jtbl_8029CB68)
/* 17598C 802470AC 00220821 */ addu $at, $at, $v0
/* 175990 802470B0 8C22CB68 */ lw $v0, %lo(jtbl_8029CB68)($at)
/* 175994 802470B4 00400008 */ jr $v0
/* 175998 802470B8 00000000 */ nop
.L802470BC_17599C:
/* 17599C 802470BC 08091C43 */ j .L8024710C
/* 1759A0 802470C0 24100012 */ addiu $s0, $zero, 0x12
.L802470C4_1759A4:
/* 1759A4 802470C4 08091C43 */ j .L8024710C
/* 1759A8 802470C8 24100013 */ addiu $s0, $zero, 0x13
.L802470CC_1759AC:
/* 1759AC 802470CC 08091C43 */ j .L8024710C
/* 1759B0 802470D0 24100014 */ addiu $s0, $zero, 0x14
.L802470D4_1759B4:
/* 1759B4 802470D4 08091C43 */ j .L8024710C
/* 1759B8 802470D8 24100015 */ addiu $s0, $zero, 0x15
.L802470DC_1759BC:
/* 1759BC 802470DC 08091C43 */ j .L8024710C
/* 1759C0 802470E0 24100016 */ addiu $s0, $zero, 0x16
.L802470E4_1759C4:
/* 1759C4 802470E4 08091C43 */ j .L8024710C
/* 1759C8 802470E8 24100017 */ addiu $s0, $zero, 0x17
.L802470EC_1759CC:
/* 1759CC 802470EC 08091C43 */ j .L8024710C
/* 1759D0 802470F0 24100018 */ addiu $s0, $zero, 0x18
.L802470F4_1759D4:
/* 1759D4 802470F4 08091C43 */ j .L8024710C
/* 1759D8 802470F8 24100019 */ addiu $s0, $zero, 0x19
.L802470FC:
/* 1759DC 802470FC 0000802D */ daddu $s0, $zero, $zero
/* 1759E0 80247100 24020014 */ addiu $v0, $zero, 0x14
/* 1759E4 80247104 3C01800E */ lui $at, %hi(gBattleState2)
/* 1759E8 80247108 AC22C4DC */ sw $v0, %lo(gBattleState2)($at)
.L8024710C:
/* 1759EC 8024710C 0C05272D */ jal sfx_play_sound
/* 1759F0 80247110 24042107 */ addiu $a0, $zero, 0x2107
/* 1759F4 80247114 0200202D */ daddu $a0, $s0, $zero
/* 1759F8 80247118 0C093E58 */ jal btl_show_battle_message
/* 1759FC 8024711C 2405003C */ addiu $a1, $zero, 0x3c
/* 175A00 80247120 0000882D */ daddu $s1, $zero, $zero
/* 175A04 80247124 02A0182D */ daddu $v1, $s5, $zero
.L80247128:
/* 175A08 80247128 8C7000E0 */ lw $s0, 0xe0($v1)
/* 175A0C 8024712C 56000001 */ bnel $s0, $zero, .L80247134
/* 175A10 80247130 A200021C */ sb $zero, 0x21c($s0)
.L80247134:
/* 175A14 80247134 26310001 */ addiu $s1, $s1, 1
/* 175A18 80247138 2A220018 */ slti $v0, $s1, 0x18
/* 175A1C 8024713C 1440FFFA */ bnez $v0, .L80247128
/* 175A20 80247140 24630004 */ addiu $v1, $v1, 4
/* 175A24 80247144 24020015 */ addiu $v0, $zero, 0x15
/* 175A28 80247148 3C01800E */ lui $at, %hi(gBattleState2)
/* 175A2C 8024714C AC22C4DC */ sw $v0, %lo(gBattleState2)($at)
/* 175A30 80247150 08091C6C */ j .L802471B0
/* 175A34 80247154 00000000 */ nop
.L80247158:
/* 175A38 80247158 0C093EAD */ jal btl_is_popup_displayed
/* 175A3C 8024715C 00000000 */ nop
/* 175A40 80247160 14400013 */ bnez $v0, .L802471B0
/* 175A44 80247164 00000000 */ nop
/* 175A48 80247168 0C093903 */ jal func_8024E40C
/* 175A4C 8024716C 24040002 */ addiu $a0, $zero, 2
/* 175A50 80247170 0C093936 */ jal btl_cam_move
/* 175A54 80247174 2404000F */ addiu $a0, $zero, 0xf
/* 175A58 80247178 2402000A */ addiu $v0, $zero, 0xa
/* 175A5C 8024717C 3C01802A */ lui $at, %hi(D_8029F248)
/* 175A60 80247180 AC22F248 */ sw $v0, %lo(D_8029F248)($at)
/* 175A64 80247184 08091C6B */ j .L802471AC
/* 175A68 80247188 24020016 */ addiu $v0, $zero, 0x16
.L8024718C:
/* 175A6C 8024718C 3C03802A */ lui $v1, %hi(D_8029F248)
/* 175A70 80247190 2463F248 */ addiu $v1, $v1, %lo(D_8029F248)
/* 175A74 80247194 8C620000 */ lw $v0, ($v1)
/* 175A78 80247198 10400003 */ beqz $v0, .L802471A8
/* 175A7C 8024719C 2442FFFF */ addiu $v0, $v0, -1
/* 175A80 802471A0 08091C6C */ j .L802471B0
/* 175A84 802471A4 AC620000 */ sw $v0, ($v1)
.L802471A8:
/* 175A88 802471A8 2402001E */ addiu $v0, $zero, 0x1e
.L802471AC:
/* 175A8C 802471AC AE020000 */ sw $v0, ($s0)
.L802471B0:
/* 175A90 802471B0 3C03800E */ lui $v1, %hi(gBattleState2)
/* 175A94 802471B4 8C63C4DC */ lw $v1, %lo(gBattleState2)($v1)
/* 175A98 802471B8 2402001E */ addiu $v0, $zero, 0x1e
/* 175A9C 802471BC 1462000C */ bne $v1, $v0, .L802471F0
/* 175AA0 802471C0 00000000 */ nop
/* 175AA4 802471C4 8E8201D4 */ lw $v0, 0x1d4($s4)
/* 175AA8 802471C8 50400007 */ beql $v0, $zero, .L802471E8
/* 175AAC 802471CC AE8001D4 */ sw $zero, 0x1d4($s4)
/* 175AB0 802471D0 8E8401E4 */ lw $a0, 0x1e4($s4)
/* 175AB4 802471D4 0C0B1059 */ jal does_script_exist
/* 175AB8 802471D8 00000000 */ nop
/* 175ABC 802471DC 14400004 */ bnez $v0, .L802471F0
/* 175AC0 802471E0 00000000 */ nop
/* 175AC4 802471E4 AE8001D4 */ sw $zero, 0x1d4($s4)
.L802471E8:
/* 175AC8 802471E8 0C090464 */ jal btl_set_state
/* 175ACC 802471EC 24040017 */ addiu $a0, $zero, 0x17
.L802471F0:
/* 175AD0 802471F0 8FBF0028 */ lw $ra, 0x28($sp)
/* 175AD4 802471F4 8FB50024 */ lw $s5, 0x24($sp)
/* 175AD8 802471F8 8FB40020 */ lw $s4, 0x20($sp)
/* 175ADC 802471FC 8FB3001C */ lw $s3, 0x1c($sp)
/* 175AE0 80247200 8FB20018 */ lw $s2, 0x18($sp)
/* 175AE4 80247204 8FB10014 */ lw $s1, 0x14($sp)
/* 175AE8 80247208 8FB00010 */ lw $s0, 0x10($sp)
/* 175AEC 8024720C 03E00008 */ jr $ra
/* 175AF0 80247210 27BD0030 */ addiu $sp, $sp, 0x30

View File

@ -1,489 +0,0 @@
.set noat # allow manual use of $at
.set noreorder # don't insert nops after branches
glabel btl_state_update_victory
/* 1728E8 80244008 27BDFFB0 */ addiu $sp, $sp, -0x50
/* 1728EC 8024400C AFB30024 */ sw $s3, 0x24($sp)
/* 1728F0 80244010 3C13800E */ lui $s3, %hi(gBattleStatus)
/* 1728F4 80244014 2673C070 */ addiu $s3, $s3, %lo(gBattleStatus)
/* 1728F8 80244018 AFB60030 */ sw $s6, 0x30($sp)
/* 1728FC 8024401C 3C16800B */ lui $s6, %hi(gCurrentEncounter)
/* 172900 80244020 26D60F10 */ addiu $s6, $s6, %lo(gCurrentEncounter)
/* 172904 80244024 AFB5002C */ sw $s5, 0x2c($sp)
/* 172908 80244028 3C158011 */ lui $s5, %hi(gPlayerData)
/* 17290C 8024402C 26B5F290 */ addiu $s5, $s5, %lo(gPlayerData)
/* 172910 80244030 AFB20020 */ sw $s2, 0x20($sp)
/* 172914 80244034 3C12800E */ lui $s2, %hi(gBattleState2)
/* 172918 80244038 2652C4DC */ addiu $s2, $s2, %lo(gBattleState2)
/* 17291C 8024403C AFBF0034 */ sw $ra, 0x34($sp)
/* 172920 80244040 AFB40028 */ sw $s4, 0x28($sp)
/* 172924 80244044 AFB1001C */ sw $s1, 0x1c($sp)
/* 172928 80244048 AFB00018 */ sw $s0, 0x18($sp)
/* 17292C 8024404C F7B80048 */ sdc1 $f24, 0x48($sp)
/* 172930 80244050 F7B60040 */ sdc1 $f22, 0x40($sp)
/* 172934 80244054 F7B40038 */ sdc1 $f20, 0x38($sp)
/* 172938 80244058 8E7100D8 */ lw $s1, 0xd8($s3)
/* 17293C 8024405C 8E430000 */ lw $v1, ($s2)
/* 172940 80244060 8E7000DC */ lw $s0, 0xdc($s3)
/* 172944 80244064 10600005 */ beqz $v1, .L8024407C
/* 172948 80244068 24020001 */ addiu $v0, $zero, 1
/* 17294C 8024406C 10620024 */ beq $v1, $v0, .L80244100
/* 172950 80244070 24020005 */ addiu $v0, $zero, 5
/* 172954 80244074 0809104B */ j .L8024412C
/* 172958 80244078 00000000 */ nop
.L8024407C:
/* 17295C 8024407C 3C03F3FF */ lui $v1, 0xf3ff
/* 172960 80244080 8E220000 */ lw $v0, ($s1)
/* 172964 80244084 3463FFFF */ ori $v1, $v1, 0xffff
/* 172968 80244088 00431024 */ and $v0, $v0, $v1
/* 17296C 8024408C 12000004 */ beqz $s0, .L802440A0
/* 172970 80244090 AE220000 */ sw $v0, ($s1)
/* 172974 80244094 8E020000 */ lw $v0, ($s0)
/* 172978 80244098 00431024 */ and $v0, $v0, $v1
/* 17297C 8024409C AE020000 */ sw $v0, ($s0)
.L802440A0:
/* 172980 802440A0 8262009A */ lb $v0, 0x9a($s3)
/* 172984 802440A4 14400003 */ bnez $v0, .L802440B4
/* 172988 802440A8 A260008C */ sb $zero, 0x8c($s3)
/* 17298C 802440AC 08091046 */ j .L80244118
/* 172990 802440B0 24020005 */ addiu $v0, $zero, 5
.L802440B4:
/* 172994 802440B4 18400003 */ blez $v0, .L802440C4
/* 172998 802440B8 24020001 */ addiu $v0, $zero, 1
/* 17299C 802440BC 3C01802A */ lui $at, %hi(D_8029F254)
/* 1729A0 802440C0 AC22F254 */ sw $v0, %lo(D_8029F254)($at)
.L802440C4:
/* 1729A4 802440C4 2405000A */ addiu $a1, $zero, 0xa
/* 1729A8 802440C8 2402000C */ addiu $v0, $zero, 0xc
/* 1729AC 802440CC A26201A7 */ sb $v0, 0x1a7($s3)
/* 1729B0 802440D0 8E0401CC */ lw $a0, 0x1cc($s0)
/* 1729B4 802440D4 0C0B0CF8 */ jal start_script
/* 1729B8 802440D8 0000302D */ daddu $a2, $zero, $zero
/* 1729BC 802440DC 0040202D */ daddu $a0, $v0, $zero
/* 1729C0 802440E0 AE0401DC */ sw $a0, 0x1dc($s0)
/* 1729C4 802440E4 8C830144 */ lw $v1, 0x144($a0)
/* 1729C8 802440E8 24020001 */ addiu $v0, $zero, 1
/* 1729CC 802440EC AE420000 */ sw $v0, ($s2)
/* 1729D0 802440F0 24020100 */ addiu $v0, $zero, 0x100
/* 1729D4 802440F4 AE0301EC */ sw $v1, 0x1ec($s0)
/* 1729D8 802440F8 08091047 */ j .L8024411C
/* 1729DC 802440FC AC820148 */ sw $v0, 0x148($a0)
.L80244100:
/* 1729E0 80244100 8E0401EC */ lw $a0, 0x1ec($s0)
/* 1729E4 80244104 0C0B1059 */ jal does_script_exist
/* 1729E8 80244108 00000000 */ nop
/* 1729EC 8024410C 14400003 */ bnez $v0, .L8024411C
/* 1729F0 80244110 24020005 */ addiu $v0, $zero, 5
/* 1729F4 80244114 A260009A */ sb $zero, 0x9a($s3)
.L80244118:
/* 1729F8 80244118 AE420000 */ sw $v0, ($s2)
.L8024411C:
/* 1729FC 8024411C 3C12800E */ lui $s2, %hi(gBattleState2)
/* 172A00 80244120 2652C4DC */ addiu $s2, $s2, %lo(gBattleState2)
/* 172A04 80244124 8E430000 */ lw $v1, ($s2)
/* 172A08 80244128 24020005 */ addiu $v0, $zero, 5
.L8024412C:
/* 172A0C 8024412C 10620005 */ beq $v1, $v0, .L80244144
/* 172A10 80244130 2402000A */ addiu $v0, $zero, 0xa
/* 172A14 80244134 10620040 */ beq $v1, $v0, .L80244238
/* 172A18 80244138 00000000 */ nop
/* 172A1C 8024413C 080910A3 */ j .L8024428C
/* 172A20 80244140 00000000 */ nop
.L80244144:
/* 172A24 80244144 3C03F3FF */ lui $v1, 0xf3ff
/* 172A28 80244148 8E220000 */ lw $v0, ($s1)
/* 172A2C 8024414C 3463FFFF */ ori $v1, $v1, 0xffff
/* 172A30 80244150 00431024 */ and $v0, $v0, $v1
/* 172A34 80244154 12000004 */ beqz $s0, .L80244168
/* 172A38 80244158 AE220000 */ sw $v0, ($s1)
/* 172A3C 8024415C 8E020000 */ lw $v0, ($s0)
/* 172A40 80244160 00431024 */ and $v0, $v0, $v1
/* 172A44 80244164 AE020000 */ sw $v0, ($s0)
.L80244168:
/* 172A48 80244168 2402000B */ addiu $v0, $zero, 0xb
/* 172A4C 8024416C 3C05800E */ lui $a1, %hi(gBattleStatus)
/* 172A50 80244170 24A5C070 */ addiu $a1, $a1, %lo(gBattleStatus)
/* 172A54 80244174 2403FFFD */ addiu $v1, $zero, -3
/* 172A58 80244178 2406FFF7 */ addiu $a2, $zero, -9
/* 172A5C 8024417C AE420000 */ sw $v0, ($s2)
/* 172A60 80244180 8CA20004 */ lw $v0, 4($a1)
/* 172A64 80244184 2404FFEF */ addiu $a0, $zero, -0x11
/* 172A68 80244188 00431024 */ and $v0, $v0, $v1
/* 172A6C 8024418C 2403FFFB */ addiu $v1, $zero, -5
/* 172A70 80244190 00431024 */ and $v0, $v0, $v1
/* 172A74 80244194 00461024 */ and $v0, $v0, $a2
/* 172A78 80244198 8CA30000 */ lw $v1, ($a1)
/* 172A7C 8024419C 00441024 */ and $v0, $v0, $a0
/* 172A80 802441A0 ACA20004 */ sw $v0, 4($a1)
/* 172A84 802441A4 00661824 */ and $v1, $v1, $a2
/* 172A88 802441A8 ACA30000 */ sw $v1, ($a1)
/* 172A8C 802441AC 82220216 */ lb $v0, 0x216($s1)
/* 172A90 802441B0 2414000D */ addiu $s4, $zero, 0xd
/* 172A94 802441B4 14540005 */ bne $v0, $s4, .L802441CC
/* 172A98 802441B8 00000000 */ nop
/* 172A9C 802441BC 0C09C596 */ jal dispatch_event_player
/* 172AA0 802441C0 24040034 */ addiu $a0, $zero, 0x34
/* 172AA4 802441C4 2402000A */ addiu $v0, $zero, 0xa
/* 172AA8 802441C8 AE420000 */ sw $v0, ($s2)
.L802441CC:
/* 172AAC 802441CC 8E220440 */ lw $v0, 0x440($s1)
/* 172AB0 802441D0 A2200210 */ sb $zero, 0x210($s1)
/* 172AB4 802441D4 A2200212 */ sb $zero, 0x212($s1)
/* 172AB8 802441D8 A2200214 */ sb $zero, 0x214($s1)
/* 172ABC 802441DC A2200218 */ sb $zero, 0x218($s1)
/* 172AC0 802441E0 A2200216 */ sb $zero, 0x216($s1)
/* 172AC4 802441E4 A2200217 */ sb $zero, 0x217($s1)
/* 172AC8 802441E8 8C42000C */ lw $v0, 0xc($v0)
/* 172ACC 802441EC 12000027 */ beqz $s0, .L8024428C
/* 172AD0 802441F0 AC40003C */ sw $zero, 0x3c($v0)
/* 172AD4 802441F4 82020216 */ lb $v0, 0x216($s0)
/* 172AD8 802441F8 14540005 */ bne $v0, $s4, .L80244210
/* 172ADC 802441FC 00000000 */ nop
/* 172AE0 80244200 0C09F7A0 */ jal dispatch_event_partner
/* 172AE4 80244204 24040034 */ addiu $a0, $zero, 0x34
/* 172AE8 80244208 2402000A */ addiu $v0, $zero, 0xa
/* 172AEC 8024420C AE420000 */ sw $v0, ($s2)
.L80244210:
/* 172AF0 80244210 8E020440 */ lw $v0, 0x440($s0)
/* 172AF4 80244214 A2000210 */ sb $zero, 0x210($s0)
/* 172AF8 80244218 A2000212 */ sb $zero, 0x212($s0)
/* 172AFC 8024421C A2000214 */ sb $zero, 0x214($s0)
/* 172B00 80244220 A2000218 */ sb $zero, 0x218($s0)
/* 172B04 80244224 A2000216 */ sb $zero, 0x216($s0)
/* 172B08 80244228 A2000217 */ sb $zero, 0x217($s0)
/* 172B0C 8024422C 8C42000C */ lw $v0, 0xc($v0)
/* 172B10 80244230 080910A3 */ j .L8024428C
/* 172B14 80244234 AC40003C */ sw $zero, 0x3c($v0)
.L80244238:
/* 172B18 80244238 8E2201D8 */ lw $v0, 0x1d8($s1)
/* 172B1C 8024423C 10400005 */ beqz $v0, .L80244254
/* 172B20 80244240 00000000 */ nop
/* 172B24 80244244 0C0B1059 */ jal does_script_exist
/* 172B28 80244248 8E2401E8 */ lw $a0, 0x1e8($s1)
/* 172B2C 8024424C 1440000F */ bnez $v0, .L8024428C
/* 172B30 80244250 00000000 */ nop
.L80244254:
/* 172B34 80244254 1200000A */ beqz $s0, .L80244280
/* 172B38 80244258 AE2001D8 */ sw $zero, 0x1d8($s1)
/* 172B3C 8024425C 8E0201D8 */ lw $v0, 0x1d8($s0)
/* 172B40 80244260 50400007 */ beql $v0, $zero, .L80244280
/* 172B44 80244264 AE0001D8 */ sw $zero, 0x1d8($s0)
/* 172B48 80244268 8E0401E8 */ lw $a0, 0x1e8($s0)
/* 172B4C 8024426C 0C0B1059 */ jal does_script_exist
/* 172B50 80244270 00000000 */ nop
/* 172B54 80244274 14400005 */ bnez $v0, .L8024428C
/* 172B58 80244278 00000000 */ nop
/* 172B5C 8024427C AE0001D8 */ sw $zero, 0x1d8($s0)
.L80244280:
/* 172B60 80244280 2402000B */ addiu $v0, $zero, 0xb
/* 172B64 80244284 3C01800E */ lui $at, %hi(gBattleState2)
/* 172B68 80244288 AC22C4DC */ sw $v0, %lo(gBattleState2)($at)
.L8024428C:
/* 172B6C 8024428C 3C04800E */ lui $a0, %hi(gBattleState2)
/* 172B70 80244290 2484C4DC */ addiu $a0, $a0, %lo(gBattleState2)
/* 172B74 80244294 8C830000 */ lw $v1, ($a0)
/* 172B78 80244298 2402000B */ addiu $v0, $zero, 0xb
/* 172B7C 8024429C 14620017 */ bne $v1, $v0, .L802442FC
/* 172B80 802442A0 00000000 */ nop
/* 172B84 802442A4 12000006 */ beqz $s0, .L802442C0
/* 172B88 802442A8 3C030010 */ lui $v1, 0x10
/* 172B8C 802442AC 3C02800E */ lui $v0, %hi(gBattleStatus)
/* 172B90 802442B0 8C42C070 */ lw $v0, %lo(gBattleStatus)($v0)
/* 172B94 802442B4 00431024 */ and $v0, $v0, $v1
/* 172B98 802442B8 14400004 */ bnez $v0, .L802442CC
/* 172B9C 802442BC 2402000C */ addiu $v0, $zero, 0xc
.L802442C0:
/* 172BA0 802442C0 24020002 */ addiu $v0, $zero, 2
/* 172BA4 802442C4 080910BF */ j .L802442FC
/* 172BA8 802442C8 AC820000 */ sw $v0, ($a0)
.L802442CC:
/* 172BAC 802442CC C6000144 */ lwc1 $f0, 0x144($s0)
/* 172BB0 802442D0 C602014C */ lwc1 $f2, 0x14c($s0)
/* 172BB4 802442D4 E600000C */ swc1 $f0, 0xc($s0)
/* 172BB8 802442D8 E6020014 */ swc1 $f2, 0x14($s0)
/* 172BBC 802442DC C6200144 */ lwc1 $f0, 0x144($s1)
/* 172BC0 802442E0 AC820000 */ sw $v0, ($a0)
/* 172BC4 802442E4 E6000018 */ swc1 $f0, 0x18($s0)
/* 172BC8 802442E8 C620014C */ lwc1 $f0, 0x14c($s1)
/* 172BCC 802442EC 24020004 */ addiu $v0, $zero, 4
/* 172BD0 802442F0 A6020070 */ sh $v0, 0x70($s0)
/* 172BD4 802442F4 AE000054 */ sw $zero, 0x54($s0)
/* 172BD8 802442F8 E6000020 */ swc1 $f0, 0x20($s0)
.L802442FC:
/* 172BDC 802442FC 3C12800E */ lui $s2, %hi(gBattleState2)
/* 172BE0 80244300 2652C4DC */ addiu $s2, $s2, %lo(gBattleState2)
/* 172BE4 80244304 8E430000 */ lw $v1, ($s2)
/* 172BE8 80244308 2402000C */ addiu $v0, $zero, 0xc
/* 172BEC 8024430C 1462006D */ bne $v1, $v0, .L802444C4
/* 172BF0 80244310 00000000 */ nop
/* 172BF4 80244314 86020070 */ lh $v0, 0x70($s0)
/* 172BF8 80244318 10400022 */ beqz $v0, .L802443A4
/* 172BFC 8024431C 00000000 */ nop
/* 172C00 80244320 C6000018 */ lwc1 $f0, 0x18($s0)
/* 172C04 80244324 C6080144 */ lwc1 $f8, 0x144($s0)
/* 172C08 80244328 C6020020 */ lwc1 $f2, 0x20($s0)
/* 172C0C 8024432C 46080001 */ sub.s $f0, $f0, $f8
/* 172C10 80244330 C604014C */ lwc1 $f4, 0x14c($s0)
/* 172C14 80244334 46041081 */ sub.s $f2, $f2, $f4
/* 172C18 80244338 44823000 */ mtc1 $v0, $f6
/* 172C1C 8024433C 00000000 */ nop
/* 172C20 80244340 468031A0 */ cvt.s.w $f6, $f6
/* 172C24 80244344 46060003 */ div.s $f0, $f0, $f6
/* 172C28 80244348 46004200 */ add.s $f8, $f8, $f0
/* 172C2C 8024434C 46003006 */ mov.s $f0, $f6
/* 172C30 80244350 46061083 */ div.s $f2, $f2, $f6
/* 172C34 80244354 C600000C */ lwc1 $f0, 0xc($s0)
/* 172C38 80244358 46022100 */ add.s $f4, $f4, $f2
/* 172C3C 8024435C E6080144 */ swc1 $f8, 0x144($s0)
/* 172C40 80244360 E604014C */ swc1 $f4, 0x14c($s0)
/* 172C44 80244364 C6240144 */ lwc1 $f4, 0x144($s1)
/* 172C48 80244368 46040001 */ sub.s $f0, $f0, $f4
/* 172C4C 8024436C 46003086 */ mov.s $f2, $f6
/* 172C50 80244370 46060003 */ div.s $f0, $f0, $f6
/* 172C54 80244374 46002100 */ add.s $f4, $f4, $f0
/* 172C58 80244378 E6240144 */ swc1 $f4, 0x144($s1)
/* 172C5C 8024437C C6000014 */ lwc1 $f0, 0x14($s0)
/* 172C60 80244380 C624014C */ lwc1 $f4, 0x14c($s1)
/* 172C64 80244384 86020070 */ lh $v0, 0x70($s0)
/* 172C68 80244388 46040001 */ sub.s $f0, $f0, $f4
/* 172C6C 8024438C 44821000 */ mtc1 $v0, $f2
/* 172C70 80244390 00000000 */ nop
/* 172C74 80244394 468010A0 */ cvt.s.w $f2, $f2
/* 172C78 80244398 46020003 */ div.s $f0, $f0, $f2
/* 172C7C 8024439C 46002100 */ add.s $f4, $f4, $f0
/* 172C80 802443A0 E624014C */ swc1 $f4, 0x14c($s1)
.L802443A4:
/* 172C84 802443A4 C60C0054 */ lwc1 $f12, 0x54($s0)
/* 172C88 802443A8 3C0140C9 */ lui $at, 0x40c9
/* 172C8C 802443AC 34210FD0 */ ori $at, $at, 0xfd0
/* 172C90 802443B0 4481B000 */ mtc1 $at, $f22
/* 172C94 802443B4 00000000 */ nop
/* 172C98 802443B8 46166302 */ mul.s $f12, $f12, $f22
/* 172C9C 802443BC 00000000 */ nop
/* 172CA0 802443C0 3C0143B4 */ lui $at, 0x43b4
/* 172CA4 802443C4 4481C000 */ mtc1 $at, $f24
/* 172CA8 802443C8 3C014180 */ lui $at, 0x4180
/* 172CAC 802443CC 4481A000 */ mtc1 $at, $f20
/* 172CB0 802443D0 0C00A85B */ jal sin_rad
/* 172CB4 802443D4 46186303 */ div.s $f12, $f12, $f24
/* 172CB8 802443D8 46140002 */ mul.s $f0, $f0, $f20
/* 172CBC 802443DC 00000000 */ nop
/* 172CC0 802443E0 C602014C */ lwc1 $f2, 0x14c($s0)
/* 172CC4 802443E4 46001080 */ add.s $f2, $f2, $f0
/* 172CC8 802443E8 C60C0054 */ lwc1 $f12, 0x54($s0)
/* 172CCC 802443EC 46006307 */ neg.s $f12, $f12
/* 172CD0 802443F0 0C00A6C9 */ jal clamp_angle
/* 172CD4 802443F4 E602014C */ swc1 $f2, 0x14c($s0)
/* 172CD8 802443F8 C60C0054 */ lwc1 $f12, 0x54($s0)
/* 172CDC 802443FC 46166302 */ mul.s $f12, $f12, $f22
/* 172CE0 80244400 00000000 */ nop
/* 172CE4 80244404 E600018C */ swc1 $f0, 0x18c($s0)
/* 172CE8 80244408 0C00A85B */ jal sin_rad
/* 172CEC 8024440C 46186303 */ div.s $f12, $f12, $f24
/* 172CF0 80244410 46140002 */ mul.s $f0, $f0, $f20
/* 172CF4 80244414 00000000 */ nop
/* 172CF8 80244418 C622014C */ lwc1 $f2, 0x14c($s1)
/* 172CFC 8024441C 46001081 */ sub.s $f2, $f2, $f0
/* 172D00 80244420 E622014C */ swc1 $f2, 0x14c($s1)
/* 172D04 80244424 C60C0054 */ lwc1 $f12, 0x54($s0)
/* 172D08 80244428 0C00A6C9 */ jal clamp_angle
/* 172D0C 8024442C 46006307 */ neg.s $f12, $f12
/* 172D10 80244430 E620018C */ swc1 $f0, 0x18c($s1)
/* 172D14 80244434 C6000054 */ lwc1 $f0, 0x54($s0)
/* 172D18 80244438 3C0142B4 */ lui $at, 0x42b4
/* 172D1C 8024443C 44811000 */ mtc1 $at, $f2
/* 172D20 80244440 86020070 */ lh $v0, 0x70($s0)
/* 172D24 80244444 46020000 */ add.s $f0, $f0, $f2
/* 172D28 80244448 96030070 */ lhu $v1, 0x70($s0)
/* 172D2C 8024444C 10400004 */ beqz $v0, .L80244460
/* 172D30 80244450 E6000054 */ swc1 $f0, 0x54($s0)
/* 172D34 80244454 2462FFFF */ addiu $v0, $v1, -1
/* 172D38 80244458 08091131 */ j .L802444C4
/* 172D3C 8024445C A6020070 */ sh $v0, 0x70($s0)
.L80244460:
/* 172D40 80244460 C6000018 */ lwc1 $f0, 0x18($s0)
/* 172D44 80244464 C6020020 */ lwc1 $f2, 0x20($s0)
/* 172D48 80244468 C604000C */ lwc1 $f4, 0xc($s0)
/* 172D4C 8024446C E6000144 */ swc1 $f0, 0x144($s0)
/* 172D50 80244470 E602014C */ swc1 $f2, 0x14c($s0)
/* 172D54 80244474 E6240144 */ swc1 $f4, 0x144($s1)
/* 172D58 80244478 C6000014 */ lwc1 $f0, 0x14($s0)
/* 172D5C 8024447C 3C05FFEF */ lui $a1, 0xffef
/* 172D60 80244480 E620014C */ swc1 $f0, 0x14c($s1)
/* 172D64 80244484 C6000144 */ lwc1 $f0, 0x144($s0)
/* 172D68 80244488 C602014C */ lwc1 $f2, 0x14c($s0)
/* 172D6C 8024448C 34A5FFFF */ ori $a1, $a1, 0xffff
/* 172D70 80244490 E6000138 */ swc1 $f0, 0x138($s0)
/* 172D74 80244494 E6020140 */ swc1 $f2, 0x140($s0)
/* 172D78 80244498 C6200144 */ lwc1 $f0, 0x144($s1)
/* 172D7C 8024449C C622014C */ lwc1 $f2, 0x14c($s1)
/* 172D80 802444A0 3C04800E */ lui $a0, %hi(gBattleStatus)
/* 172D84 802444A4 2484C070 */ addiu $a0, $a0, %lo(gBattleStatus)
/* 172D88 802444A8 E6200138 */ swc1 $f0, 0x138($s1)
/* 172D8C 802444AC E6220140 */ swc1 $f2, 0x140($s1)
/* 172D90 802444B0 8C820000 */ lw $v0, ($a0)
/* 172D94 802444B4 24030002 */ addiu $v1, $zero, 2
/* 172D98 802444B8 AE430000 */ sw $v1, ($s2)
/* 172D9C 802444BC 00451024 */ and $v0, $v0, $a1
/* 172DA0 802444C0 AC820000 */ sw $v0, ($a0)
.L802444C4:
/* 172DA4 802444C4 3C03800E */ lui $v1, %hi(gBattleState2)
/* 172DA8 802444C8 8C63C4DC */ lw $v1, %lo(gBattleState2)($v1)
/* 172DAC 802444CC 24020002 */ addiu $v0, $zero, 2
/* 172DB0 802444D0 14620026 */ bne $v1, $v0, .L8024456C
/* 172DB4 802444D4 00000000 */ nop
/* 172DB8 802444D8 0C093903 */ jal func_8024E40C
/* 172DBC 802444DC 0040202D */ daddu $a0, $v0, $zero
/* 172DC0 802444E0 8263008A */ lb $v1, 0x8a($s3)
/* 172DC4 802444E4 24020003 */ addiu $v0, $zero, 3
/* 172DC8 802444E8 14620016 */ bne $v1, $v0, .L80244544
/* 172DCC 802444EC 00000000 */ nop
/* 172DD0 802444F0 82620078 */ lb $v0, 0x78($s3)
/* 172DD4 802444F4 14400007 */ bnez $v0, .L80244514
/* 172DD8 802444F8 2405000A */ addiu $a1, $zero, 0xa
/* 172DDC 802444FC 92A2028A */ lbu $v0, 0x28a($s5)
/* 172DE0 80244500 A260008A */ sb $zero, 0x8a($s3)
/* 172DE4 80244504 A6A0028C */ sh $zero, 0x28c($s5)
/* 172DE8 80244508 24420001 */ addiu $v0, $v0, 1
/* 172DEC 8024450C 08091150 */ j .L80244540
/* 172DF0 80244510 A2A2028A */ sb $v0, 0x28a($s5)
.L80244514:
/* 172DF4 80244514 3C048028 */ lui $a0, %hi(PlayerScriptDispatcher)
/* 172DF8 80244518 24844EBC */ addiu $a0, $a0, %lo(PlayerScriptDispatcher)
/* 172DFC 8024451C 0000302D */ daddu $a2, $zero, $zero
/* 172E00 80244520 24020016 */ addiu $v0, $zero, 0x16
/* 172E04 80244524 0C0B0CF8 */ jal start_script
/* 172E08 80244528 A26201A7 */ sb $v0, 0x1a7($s3)
/* 172E0C 8024452C 0040202D */ daddu $a0, $v0, $zero
/* 172E10 80244530 AE2401D4 */ sw $a0, 0x1d4($s1)
/* 172E14 80244534 8C820144 */ lw $v0, 0x144($a0)
/* 172E18 80244538 AE2201E4 */ sw $v0, 0x1e4($s1)
/* 172E1C 8024453C AC800148 */ sw $zero, 0x148($a0)
.L80244540:
/* 172E20 80244540 24020003 */ addiu $v0, $zero, 3
.L80244544:
/* 172E24 80244544 3C04800E */ lui $a0, %hi(gBattleStatus)
/* 172E28 80244548 2484C070 */ addiu $a0, $a0, %lo(gBattleStatus)
/* 172E2C 8024454C 3C01800E */ lui $at, %hi(gBattleState2)
/* 172E30 80244550 AC22C4DC */ sw $v0, %lo(gBattleState2)($at)
/* 172E34 80244554 8C820000 */ lw $v0, ($a0)
/* 172E38 80244558 2403FFFD */ addiu $v1, $zero, -3
/* 172E3C 8024455C 3C01802A */ lui $at, %hi(D_8029F248)
/* 172E40 80244560 AC20F248 */ sw $zero, %lo(D_8029F248)($at)
/* 172E44 80244564 00431024 */ and $v0, $v0, $v1
/* 172E48 80244568 AC820000 */ sw $v0, ($a0)
.L8024456C:
/* 172E4C 8024456C 3C12800E */ lui $s2, %hi(gBattleState2)
/* 172E50 80244570 2652C4DC */ addiu $s2, $s2, %lo(gBattleState2)
/* 172E54 80244574 8E500000 */ lw $s0, ($s2)
/* 172E58 80244578 24020003 */ addiu $v0, $zero, 3
/* 172E5C 8024457C 16020020 */ bne $s0, $v0, .L80244600
/* 172E60 80244580 00000000 */ nop
/* 172E64 80244584 3C03802A */ lui $v1, %hi(D_8029F248)
/* 172E68 80244588 2463F248 */ addiu $v1, $v1, %lo(D_8029F248)
/* 172E6C 8024458C 8C620000 */ lw $v0, ($v1)
/* 172E70 80244590 10400003 */ beqz $v0, .L802445A0
/* 172E74 80244594 2442FFFF */ addiu $v0, $v0, -1
/* 172E78 80244598 08091180 */ j .L80244600
/* 172E7C 8024459C AC620000 */ sw $v0, ($v1)
.L802445A0:
/* 172E80 802445A0 8E2201D4 */ lw $v0, 0x1d4($s1)
/* 172E84 802445A4 50400007 */ beql $v0, $zero, .L802445C4
/* 172E88 802445A8 AE2001D4 */ sw $zero, 0x1d4($s1)
/* 172E8C 802445AC 8E2401E4 */ lw $a0, 0x1e4($s1)
/* 172E90 802445B0 0C0B1059 */ jal does_script_exist
/* 172E94 802445B4 00000000 */ nop
/* 172E98 802445B8 14400011 */ bnez $v0, .L80244600
/* 172E9C 802445BC 00000000 */ nop
/* 172EA0 802445C0 AE2001D4 */ sw $zero, 0x1d4($s1)
.L802445C4:
/* 172EA4 802445C4 8262008A */ lb $v0, 0x8a($s3)
/* 172EA8 802445C8 10500003 */ beq $v0, $s0, .L802445D8
/* 172EAC 802445CC 24020004 */ addiu $v0, $zero, 4
/* 172EB0 802445D0 08091180 */ j .L80244600
/* 172EB4 802445D4 AE420000 */ sw $v0, ($s2)
.L802445D8:
/* 172EB8 802445D8 92640078 */ lbu $a0, 0x78($s3)
/* 172EBC 802445DC 24020014 */ addiu $v0, $zero, 0x14
/* 172EC0 802445E0 A262007A */ sb $v0, 0x7a($s3)
/* 172EC4 802445E4 92620079 */ lbu $v0, 0x79($s3)
/* 172EC8 802445E8 24030004 */ addiu $v1, $zero, 4
/* 172ECC 802445EC A260008A */ sb $zero, 0x8a($s3)
/* 172ED0 802445F0 AE430000 */ sw $v1, ($s2)
/* 172ED4 802445F4 00822021 */ addu $a0, $a0, $v0
/* 172ED8 802445F8 00441021 */ addu $v0, $v0, $a0
/* 172EDC 802445FC A2620079 */ sb $v0, 0x79($s3)
.L80244600:
/* 172EE0 80244600 3C03800E */ lui $v1, %hi(gBattleState2)
/* 172EE4 80244604 8C63C4DC */ lw $v1, %lo(gBattleState2)($v1)
/* 172EE8 80244608 24020004 */ addiu $v0, $zero, 4
/* 172EEC 8024460C 14620031 */ bne $v1, $v0, .L802446D4
/* 172EF0 80244610 00000000 */ nop
/* 172EF4 80244614 82620079 */ lb $v0, 0x79($s3)
/* 172EF8 80244618 1C40002E */ bgtz $v0, .L802446D4
/* 172EFC 8024461C 3C020100 */ lui $v0, 0x100
/* 172F00 80244620 3C04800E */ lui $a0, %hi(gBattleStatus)
/* 172F04 80244624 2484C070 */ addiu $a0, $a0, %lo(gBattleStatus)
/* 172F08 80244628 8C830000 */ lw $v1, ($a0)
/* 172F0C 8024462C 00621024 */ and $v0, $v1, $v0
/* 172F10 80244630 10400004 */ beqz $v0, .L80244644
/* 172F14 80244634 3C02FFFB */ lui $v0, 0xfffb
/* 172F18 80244638 3442FFFF */ ori $v0, $v0, 0xffff
/* 172F1C 8024463C 00621024 */ and $v0, $v1, $v0
/* 172F20 80244640 AC820000 */ sw $v0, ($a0)
.L80244644:
/* 172F24 80244644 96A302A4 */ lhu $v1, 0x2a4($s5)
/* 172F28 80244648 2C62270F */ sltiu $v0, $v1, 0x270f
/* 172F2C 8024464C 10400002 */ beqz $v0, .L80244658
/* 172F30 80244650 24620001 */ addiu $v0, $v1, 1
/* 172F34 80244654 A6A202A4 */ sh $v0, 0x2a4($s5)
.L80244658:
/* 172F38 80244658 8C820000 */ lw $v0, ($a0)
/* 172F3C 8024465C 3C030004 */ lui $v1, 4
/* 172F40 80244660 00431024 */ and $v0, $v0, $v1
/* 172F44 80244664 10400003 */ beqz $v0, .L80244674
/* 172F48 80244668 24020003 */ addiu $v0, $zero, 3
/* 172F4C 8024466C 0809119E */ j .L80244678
/* 172F50 80244670 A2C20009 */ sb $v0, 9($s6)
.L80244674:
/* 172F54 80244674 A2C00009 */ sb $zero, 9($s6)
.L80244678:
/* 172F58 80244678 3C04800E */ lui $a0, %hi(gBattleStatus)
/* 172F5C 8024467C 2484C070 */ addiu $a0, $a0, %lo(gBattleStatus)
/* 172F60 80244680 8C820000 */ lw $v0, ($a0)
/* 172F64 80244684 3C030002 */ lui $v1, 2
/* 172F68 80244688 00431024 */ and $v0, $v0, $v1
/* 172F6C 8024468C 1040000E */ beqz $v0, .L802446C8
/* 172F70 80244690 3C030200 */ lui $v1, 0x200
/* 172F74 80244694 8C820004 */ lw $v0, 4($a0)
/* 172F78 80244698 00431024 */ and $v0, $v0, $v1
/* 172F7C 8024469C 5440000B */ bnel $v0, $zero, .L802446CC
/* 172F80 802446A0 24040020 */ addiu $a0, $zero, 0x20
/* 172F84 802446A4 24020008 */ addiu $v0, $zero, 8
/* 172F88 802446A8 AFA20010 */ sw $v0, 0x10($sp)
/* 172F8C 802446AC 0000202D */ daddu $a0, $zero, $zero
/* 172F90 802446B0 2405FFFF */ addiu $a1, $zero, -1
/* 172F94 802446B4 0080302D */ daddu $a2, $a0, $zero
/* 172F98 802446B8 0C052A46 */ jal bgm_set_song
/* 172F9C 802446BC 240705DC */ addiu $a3, $zero, 0x5dc
/* 172FA0 802446C0 080911B3 */ j .L802446CC
/* 172FA4 802446C4 24040020 */ addiu $a0, $zero, 0x20
.L802446C8:
/* 172FA8 802446C8 24040021 */ addiu $a0, $zero, 0x21
.L802446CC:
/* 172FAC 802446CC 0C090464 */ jal btl_set_state
/* 172FB0 802446D0 00000000 */ nop
.L802446D4:
/* 172FB4 802446D4 8FBF0034 */ lw $ra, 0x34($sp)
/* 172FB8 802446D8 8FB60030 */ lw $s6, 0x30($sp)
/* 172FBC 802446DC 8FB5002C */ lw $s5, 0x2c($sp)
/* 172FC0 802446E0 8FB40028 */ lw $s4, 0x28($sp)
/* 172FC4 802446E4 8FB30024 */ lw $s3, 0x24($sp)
/* 172FC8 802446E8 8FB20020 */ lw $s2, 0x20($sp)
/* 172FCC 802446EC 8FB1001C */ lw $s1, 0x1c($sp)
/* 172FD0 802446F0 8FB00018 */ lw $s0, 0x18($sp)
/* 172FD4 802446F4 D7B80048 */ ldc1 $f24, 0x48($sp)
/* 172FD8 802446F8 D7B60040 */ ldc1 $f22, 0x40($sp)
/* 172FDC 802446FC D7B40038 */ ldc1 $f20, 0x38($sp)
/* 172FE0 80244700 03E00008 */ jr $ra
/* 172FE4 80244704 27BD0050 */ addiu $sp, $sp, 0x50