From 32de1484d3dd851a958b396e194b4a0e75480c40 Mon Sep 17 00:00:00 2001 From: "Nalfein (Kenny)" Date: Wed, 21 Jul 2021 02:46:15 -0400 Subject: [PATCH] Decomp btl_check_enemies_defeated function (#327) * Decompile btl_check_enemies_defeated function * Run coverage.py * Address style for pull request --- src/190B20.c | 8 +++++++- .../190B20/btl_check_enemies_defeated.s | 17 ----------------- 2 files changed, 7 insertions(+), 18 deletions(-) delete mode 100644 ver/us/asm/nonmatchings/190B20/btl_check_enemies_defeated.s diff --git a/src/190B20.c b/src/190B20.c index f4fb77c939..ed20854034 100644 --- a/src/190B20.c +++ b/src/190B20.c @@ -1074,7 +1074,13 @@ INCLUDE_ASM(s32, "190B20", func_80263300); INCLUDE_ASM(s32, "190B20", btl_are_all_enemies_defeated); -INCLUDE_ASM(s32, "190B20", btl_check_enemies_defeated); +s32 btl_check_enemies_defeated(void) { + if (btl_are_all_enemies_defeated()) { + btl_set_state(0x1A); + return TRUE; + } + return FALSE; +} s32 btl_check_player_defeated(void) { if (gPlayerData.curHP > 0) { diff --git a/ver/us/asm/nonmatchings/190B20/btl_check_enemies_defeated.s b/ver/us/asm/nonmatchings/190B20/btl_check_enemies_defeated.s deleted file mode 100644 index 0463516724..0000000000 --- a/ver/us/asm/nonmatchings/190B20/btl_check_enemies_defeated.s +++ /dev/null @@ -1,17 +0,0 @@ -.set noat # allow manual use of $at -.set noreorder # don't insert nops after branches - -glabel btl_check_enemies_defeated -/* 191D14 80263434 27BDFFE8 */ addiu $sp, $sp, -0x18 -/* 191D18 80263438 AFBF0010 */ sw $ra, 0x10($sp) -/* 191D1C 8026343C 0C098CFA */ jal btl_are_all_enemies_defeated -/* 191D20 80263440 00000000 */ nop -/* 191D24 80263444 10400004 */ beqz $v0, .L80263458 -/* 191D28 80263448 0000102D */ daddu $v0, $zero, $zero -/* 191D2C 8026344C 0C090464 */ jal btl_set_state -/* 191D30 80263450 2404001A */ addiu $a0, $zero, 0x1a -/* 191D34 80263454 24020001 */ addiu $v0, $zero, 1 -.L80263458: -/* 191D38 80263458 8FBF0010 */ lw $ra, 0x10($sp) -/* 191D3C 8026345C 03E00008 */ jr $ra -/* 191D40 80263460 27BD0018 */ addiu $sp, $sp, 0x18