diff options
author | Marcus Huderle <huderlem@gmail.com> | 2017-09-17 21:33:56 -0700 |
---|---|---|
committer | Marcus Huderle <huderlem@gmail.com> | 2017-09-17 21:36:37 -0700 |
commit | ee45710b2b62b099f1d1919678ca1f21839b1251 (patch) | |
tree | c4a72652075cff6a2e29f11ec05e110a9944bfcb | |
parent | f2b5416c20ba48a09f590dd727e533177254b5c8 (diff) |
Decompile RedrawPokemonInfoInMenu
-rw-r--r-- | asm/party_menu.s | 76 | ||||
-rw-r--r-- | include/party_menu.h | 2 | ||||
-rw-r--r-- | src/party_menu.c | 32 |
3 files changed, 32 insertions, 78 deletions
diff --git a/asm/party_menu.s b/asm/party_menu.s index 8f575f495..e2c7d694a 100644 --- a/asm/party_menu.s +++ b/asm/party_menu.s @@ -7448,82 +7448,6 @@ PartyMenuGetPopupMenuFunc: @ 806E81C .section .text_8070968 - thumb_func_start sub_8070A20 -sub_8070A20: @ 8070A20 - push {r4-r7,lr} - adds r6, r1, 0 - lsls r0, 24 - lsrs r7, r0, 24 - adds r0, r6, 0 - bl GetMonStatusAndPokerus - lsls r0, 24 - lsrs r0, 24 - cmp r0, 0 - beq _08070A3A - cmp r0, 0x6 - bne _08070A42 -_08070A3A: - adds r0, r6, 0 - adds r1, r7, 0 - bl PartyMenuUpdateLevelOrStatus -_08070A42: - bl IsDoubleBattle - adds r5, r0, 0 - lsls r5, 24 - lsrs r5, 24 - adds r0, r6, 0 - movs r1, 0x39 - bl GetMonData - adds r4, r0, 0 - lsls r4, 16 - lsrs r4, 16 - adds r0, r6, 0 - movs r1, 0x3A - bl GetMonData - adds r3, r0, 0 - lsls r3, 16 - lsrs r3, 16 - adds r0, r7, 0 - adds r1, r5, 0 - adds r2, r4, 0 - bl PartyMenuDoPrintHP - adds r0, r7, 0 - adds r1, r6, 0 - bl PartyMenuTryDrawHPBar - ldr r4, _08070ABC @ =0x0201c000 - ldrb r0, [r4, 0x4] - adds r1, r7, 0 - bl GetMonIconSpriteId_maybe - lsls r0, 24 - lsrs r0, 24 - adds r1, r6, 0 - bl SetMonIconAnim - bl IsDoubleBattle - adds r1, r0, 0 - lsls r1, 24 - lsrs r1, 24 - lsls r0, r1, 1 - adds r0, r1 - lsls r0, 2 - lsls r1, r7, 1 - adds r0, r1 - ldr r1, _08070AC0 @ =gUnknown_083769A8 - adds r0, r1 - movs r1, 0x7 - bl task_pc_turn_off - ldr r0, _08070AC4 @ =0xfffff261 - adds r4, r0 - movs r0, 0x2 - strb r0, [r4] - pop {r4-r7} - pop {r0} - bx r0 - .align 2, 0 -_08070ABC: .4byte 0x0201c000 -_08070AC0: .4byte gUnknown_083769A8 -_08070AC4: .4byte 0xfffff261 - thumb_func_end sub_8070A20 - thumb_func_start Task_RareCandy3 Task_RareCandy3: @ 8070AC8 push {r4-r7,lr} diff --git a/include/party_menu.h b/include/party_menu.h index a78e6c979..b485d982f 100644 --- a/include/party_menu.h +++ b/include/party_menu.h @@ -122,7 +122,6 @@ void sub_806E6F0(); void sub_806E750(u8, const struct PartyPopupMenu *, const struct PartyMenuItem *, int); void sub_806E7D0(u8, const struct PartyPopupMenu *); TaskFunc PartyMenuGetPopupMenuFunc(u8, const struct PartyPopupMenu *, const struct PartyMenuItem *, u8); -void sub_8070A20(); void Task_RareCandy3(u8); void sub_8070C54(); void DoEvolutionStoneItemEffect(u8, u16, TaskFunc); @@ -168,6 +167,7 @@ void Task_RareCandy1(u8); void Task_RareCandy2(u8); void PrintStatGrowthsInLevelUpWindow(u8 taskId); void PrintNewStatsInLevelUpWindow(u8 taskId); +void RedrawPokemonInfoInMenu(u8, struct Pokemon *); void sub_806CA60(u8 taskId); void sub_806CD5C(u8 taskId); void DoTakeMail(u8 taskId, TaskFunc func); diff --git a/src/party_menu.c b/src/party_menu.c index d0fe19fc9..c57753085 100644 --- a/src/party_menu.c +++ b/src/party_menu.c @@ -81,6 +81,7 @@ extern const u8 *const gUnknown_08376D04[NUM_STATS]; extern const struct UnknownStruct5 gUnknown_08376BB4[][6]; static void sub_806E884(u8 taskId); +void PartyMenuTryDrawHPBar(u8, struct Pokemon *); /* void sub_806AEDC(void) @@ -1301,7 +1302,7 @@ void DoRareCandyItemEffect(u8 taskId, u16 b, TaskFunc c) gUnknown_0202E8F4 = 1; PlayFanfareByFanfareNum(0); - sub_8070A20(ewram1C000.unk5, ewram1C000.pokemon); + RedrawPokemonInfoInMenu(ewram1C000.unk5, ewram1C000.pokemon); RemoveBagItem(b, 1); GetMonNickname(ewram1C000.pokemon, gStringVar1); level = GetMonData(ewram1C000.pokemon, MON_DATA_LEVEL); @@ -1519,3 +1520,32 @@ void PrintNewStatsInLevelUpWindow(u8 taskId) MenuPrint_PixelCoords(gStringVar1, (x + 6) * 8 + 6, y * 8, 0); } } + +void RedrawPokemonInfoInMenu(u8 a, struct Pokemon *pokemon) +{ + u8 statusAndPkrs; + bool8 isDoubleBattle; + u16 currentHP; + u16 maxHP; + u8 icon; + + statusAndPkrs = GetMonStatusAndPokerus(pokemon); + if (statusAndPkrs == 0 || statusAndPkrs == 6) + { + PartyMenuUpdateLevelOrStatus(pokemon, a); + } + + isDoubleBattle = IsDoubleBattle(); + + currentHP = GetMonData(pokemon, MON_DATA_HP); + maxHP = GetMonData(pokemon, MON_DATA_MAX_HP); + + PartyMenuDoPrintHP(a, isDoubleBattle, currentHP, maxHP); + PartyMenuTryDrawHPBar(a, pokemon); + + icon = GetMonIconSpriteId_maybe(ewram1C000.unk4, a); + SetMonIconAnim(icon, pokemon); + + task_pc_turn_off(&gUnknown_083769A8[IsDoubleBattle() * 12 + a * 2], 7); + ewram1B000.unk261 = 2; +} |