sub_8063C88

This commit is contained in:
DizzyEggg 2025-03-02 17:46:34 +01:00
parent 341fc1cc94
commit 631c9c3485
4 changed files with 141 additions and 385 deletions

View File

@ -7,389 +7,6 @@
thumb_func_start ShowStatusDescriptionMenu
ShowStatusDescriptionMenu:
push {r4-r6,lr}
sub sp, 0x4
adds r5, r0, 0
adds r6, r1, 0
ldr r4, _08063A5C
adds r0, r4, 0
bl sub_80140B4
ldr r0, _08063A60
str r0, [r4, 0x14]
adds r0, r4, 0
movs r1, 0x1
bl DungeonShowWindows
movs r0, 0
bl sub_80073B8
ldr r0, _08063A64
ldr r1, [r5]
bl strcpy
ldr r2, _08063A68
movs r4, 0
str r4, [sp]
movs r0, 0x10
movs r1, 0
movs r3, 0
bl PrintFormattedStringOnWindow
ldr r2, [r5, 0x4]
str r4, [sp]
movs r0, 0x4
movs r1, 0x10
movs r3, 0
bl PrintFormattedStringOnWindow
movs r0, 0
bl sub_80073E0
ldr r0, _08063A6C
strh r4, [r0, 0x1E]
strh r4, [r0, 0x20]
strh r4, [r0, 0xC]
strh r4, [r0, 0xE]
strh r4, [r0, 0x14]
strh r4, [r0, 0x4]
movs r1, 0x10
strh r1, [r0, 0x6]
str r4, [r0]
strh r4, [r0, 0x18]
strh r4, [r0, 0x1A]
strh r4, [r0, 0x1C]
adds r0, r6, 0
bl sub_801317C
add sp, 0x4
pop {r4-r6}
pop {r0}
bx r0
.align 2, 0
_08063A5C: .4byte gUnknown_202F278
_08063A60: .4byte gUnknown_8106CC8
_08063A64: .4byte gFormatBuffer_Monsters
_08063A68: .4byte gUnknown_8106CCC
_08063A6C: .4byte gDungeonMenu
thumb_func_end ShowStatusDescriptionMenu
thumb_func_start sub_8063A70
sub_8063A70:
push {r4-r7,lr}
mov r7, r10
mov r6, r9
mov r5, r8
push {r5-r7}
lsls r1, 24
lsrs r1, 24
mov r10, r1
ldr r1, _08063B1C
ldr r2, [r1]
ldrb r1, [r0, 0x4]
lsls r1, 2
ldr r3, _08063B20
adds r2, r3
adds r2, r1
ldr r6, [r2]
ldr r5, [r6, 0x70]
ldrb r0, [r0, 0xC]
lsls r0, 3
movs r2, 0x8C
lsls r2, 1
adds r0, r2
adds r4, r5, r0
ldrb r1, [r4]
movs r0, 0x8
ands r0, r1
lsls r0, 24
lsrs r0, 24
negs r0, r0
lsrs r0, 31
mov r8, r0
ldr r0, _08063B24
mov r9, r0
movs r1, 0x1
mov r12, r1
adds r2, r5, r2
movs r7, 0xF7
movs r3, 0x3
_08063ABC:
ldrb r1, [r2]
mov r0, r12
ands r0, r1
cmp r0, 0
beq _08063ACC
adds r0, r7, 0
ands r0, r1
strb r0, [r2]
_08063ACC:
adds r2, 0x8
subs r3, 0x1
cmp r3, 0
bge _08063ABC
mov r0, r9
adds r1, r4, 0
movs r2, 0
bl BufferMoveName
mov r3, r8
cmp r3, 0
bne _08063AEC
ldrb r1, [r4]
movs r0, 0x8
orrs r0, r1
strb r0, [r4]
_08063AEC:
movs r1, 0x8C
lsls r1, 1
adds r0, r5, r1
bl unk_FixLinkedMovesSetEnabled4
ldrb r1, [r4, 0x1]
movs r0, 0x2
orrs r0, r1
strb r0, [r4, 0x1]
ldr r0, _08063B28
bl PlaySoundEffect
mov r3, r10
cmp r3, 0
beq _08063B42
mov r0, r8
cmp r0, 0
bne _08063B30
ldr r0, _08063B2C
ldr r1, [r0]
adds r0, r6, 0
bl LogMessageByIdWithPopupCheckUser
b _08063B3A
.align 2, 0
_08063B1C: .4byte gDungeon
_08063B20: .4byte 0x0001357c
_08063B24: .4byte gFormatBuffer_Items
_08063B28: .4byte 0x00000133
_08063B2C: .4byte gUnknown_80F8B40
_08063B30:
ldr r0, _08063B50
ldr r1, [r0]
adds r0, r6, 0
bl LogMessageByIdWithPopupCheckUser
_08063B3A:
movs r0, 0x78
movs r1, 0x1F
bl sub_803E708
_08063B42:
pop {r3-r5}
mov r8, r3
mov r9, r4
mov r10, r5
pop {r4-r7}
pop {r0}
bx r0
.align 2, 0
_08063B50: .4byte gUnknown_80F8B64
thumb_func_end sub_8063A70
thumb_func_start sub_8063B54
sub_8063B54:
push {r4-r6,lr}
ldr r1, _08063BA4
ldr r2, [r1]
ldrb r1, [r0, 0x4]
lsls r1, 2
ldr r3, _08063BA8
adds r2, r3
adds r2, r1
ldr r1, [r2]
ldr r5, [r1, 0x70]
ldrb r4, [r0, 0xC]
lsls r4, 3
movs r6, 0x8C
lsls r6, 1
adds r4, r6
adds r4, r5, r4
ldr r0, _08063BAC
adds r1, r4, 0
movs r2, 0
bl BufferMoveName
ldrb r0, [r4]
movs r1, 0x4
eors r0, r1
strb r0, [r4]
adds r5, r6
adds r0, r5, 0
bl unk_FixLinkedMovesSetEnabled4
ldrb r1, [r4, 0x1]
movs r0, 0x2
orrs r0, r1
strb r0, [r4, 0x1]
ldr r0, _08063BB0
bl PlaySoundEffect
pop {r4-r6}
pop {r0}
bx r0
.align 2, 0
_08063BA4: .4byte gDungeon
_08063BA8: .4byte 0x0001357c
_08063BAC: .4byte gFormatBuffer_Items
_08063BB0: .4byte 0x00000133
thumb_func_end sub_8063B54
thumb_func_start sub_8063BB4
sub_8063BB4:
push {r4-r7,lr}
ldr r1, _08063C70
ldr r2, [r1]
ldrb r1, [r0, 0x4]
lsls r1, 2
ldr r3, _08063C74
adds r2, r3
adds r2, r1
ldr r1, [r2]
ldr r6, [r1, 0x70]
ldrb r5, [r0, 0xC]
ldr r0, _08063C78
lsls r4, r5, 3
movs r7, 0x8C
lsls r7, 1
adds r1, r4, r7
adds r1, r6, r1
movs r2, 0
bl BufferMoveName
adds r4, r6, r4
ldr r0, _08063C7C
adds r2, r4, r0
ldrb r1, [r2]
movs r0, 0x2
orrs r0, r1
strb r0, [r2]
movs r3, 0
adds r5, 0x1
cmp r5, 0x3
bgt _08063C2C
lsls r2, r5, 3
adds r0, r2, r6
adds r1, r7, 0
adds r0, r1
ldrb r1, [r0]
movs r0, 0x1
ands r0, r1
cmp r0, 0
beq _08063C2C
adds r0, r2, r7
adds r2, r0, r6
movs r4, 0x2
_08063C0A:
ldrb r1, [r2]
adds r0, r4, 0
ands r0, r1
cmp r0, 0
beq _08063C2C
adds r3, 0x1
cmp r3, 0x3
bgt _08063C2C
adds r2, 0x8
adds r5, 0x1
cmp r5, 0x3
bgt _08063C2C
ldrb r1, [r2]
movs r0, 0x1
ands r0, r1
cmp r0, 0
bne _08063C0A
_08063C2C:
lsls r0, r5, 3
adds r0, r6
movs r4, 0x8C
lsls r4, 1
adds r0, r4
ldrb r1, [r0]
movs r0, 0x1
ands r0, r1
cmp r0, 0
bne _08063C42
movs r5, 0x4
_08063C42:
cmp r5, 0x3
bgt _08063C5C
lsls r1, r5, 3
adds r1, r4
adds r1, r6, r1
ldrb r2, [r1]
movs r0, 0x2
orrs r0, r2
strb r0, [r1]
ldr r0, _08063C80
movs r2, 0
bl BufferMoveName
_08063C5C:
adds r0, r6, r4
bl unk_FixLinkedMovesSetEnabled4
ldr r0, _08063C84
bl PlaySoundEffect
pop {r4-r7}
pop {r0}
bx r0
.align 2, 0
_08063C70: .4byte gDungeon
_08063C74: .4byte 0x0001357c
_08063C78: .4byte gFormatBuffer_Items
_08063C7C: .4byte 0x00000119
_08063C80: .4byte gFormatBuffer_Items + 0x50
_08063C84: .4byte 0x00000133
thumb_func_end sub_8063BB4
thumb_func_start sub_8063C88
sub_8063C88:
push {r4-r7,lr}
adds r4, r0, 0
movs r7, 0
adds r5, r1, 0
lsls r0, r5, 3
adds r0, r4, r0
movs r1, 0x8D
lsls r1, 1
adds r0, r1
ldrh r0, [r0]
bl DoesMoveCharge
lsls r0, 24
cmp r0, 0
beq _08063CAE
_08063CA6:
movs r0, 0
b _08063CEA
_08063CAA:
movs r7, 0x1
b _08063CE8
_08063CAE:
adds r5, 0x1
movs r6, 0
lsls r0, r5, 3
movs r1, 0x8C
lsls r1, 1
adds r0, r1
adds r4, r0, r4
_08063CBC:
ldrh r0, [r4, 0x2]
bl DoesMoveCharge
lsls r0, 24
cmp r0, 0
bne _08063CA6
ldrb r1, [r4]
movs r0, 0x1
ands r0, r1
cmp r0, 0
beq _08063CE8
movs r0, 0x2
ands r0, r1
cmp r0, 0
beq _08063CAA
adds r4, 0x8
adds r5, 0x1
cmp r5, 0x3
bgt _08063CE8
adds r6, 0x1
cmp r6, 0x3
ble _08063CBC
_08063CE8:
adds r0, r7, 0
_08063CEA:
pop {r4-r7}
pop {r1}
bx r1
thumb_func_end sub_8063C88
thumb_func_start sub_8063CF0
sub_8063CF0:

View File

@ -2,7 +2,10 @@
#define GUARD_DUNGEON_MENU_MOVES_H
#include "structs/dungeon_entity.h"
#include "structs/menu.h"
#include "structs/subStruct_203B240.h"
void ShowMovesFromTeamMenu(ActionContainer *a0);
void ShowStatusDescriptionMenu(struct subStruct_203B240 *status, MenuInputStructSub *menuSub);
#endif

View File

@ -47,7 +47,6 @@ extern void ChangeDungeonCameraPos(DungeonPos *pos, s32 a1, u8 a2, u8 a3);
extern void SetLeaderActionToNothing(u8 a0);
extern void sub_80637E8(ActionContainer *a0);
extern void sub_8063B54(ActionContainer *a0);
extern void sub_8063BB4(ActionContainer *a0);
extern void sub_806752C(ActionContainer *a0);
extern void ShowDungeonSummaryOrIQMenu(ActionContainer *a0, bool8 a1);
extern void sub_8063A70(ActionContainer *a0, bool8 a1);
@ -703,4 +702,141 @@ void sub_8063834(Move *moves, s32 a1, s32 a2)
sub_803EAF0(0, 0);
}
extern WindowTemplates gUnknown_202F278;
extern const WindowHeader gUnknown_8106CC8;
extern const u8 gUnknown_8106CCC[];
void ShowStatusDescriptionMenu(struct subStruct_203B240 *status, MenuInputStructSub *menuSub)
{
sub_80140B4(&gUnknown_202F278);
gUnknown_202F278.id[0].header = &gUnknown_8106CC8;
DungeonShowWindows(&gUnknown_202F278, TRUE);
sub_80073B8(0);
strcpy(gFormatBuffer_Monsters[0], status->pokeName);
PrintFormattedStringOnWindow(16, 0, gUnknown_8106CCC, 0, '\0');
PrintFormattedStringOnWindow(4, 16, status->unk4, 0, '\0');
sub_80073E0(0);
gDungeonMenu.unk1E = 0;
gDungeonMenu.unk20 = 0;
gDungeonMenu.unkC = 0;
gDungeonMenu.unkE = 0;
gDungeonMenu.unk14.x = 0;
gDungeonMenu.unk4 = 0;
gDungeonMenu.firstEntryY = 16;
gDungeonMenu.unk0 = 0;
gDungeonMenu.menuIndex = 0;
gDungeonMenu.unk1A = 0;
gDungeonMenu.unk1C = 0;
sub_801317C(menuSub);
}
extern const u8 *const gUnknown_80F8B40;
extern const u8 *const gUnknown_80F8B64;
void sub_8063A70(ActionContainer *a0, bool8 flagToSet)
{
s32 i;
Entity *entity = gDungeon->teamPokemon[a0->actionParameters[0].actionUseIndex];
EntityInfo *entInfo = GetEntInfo(entity);
Move *move = &entInfo->moves.moves[a0->actionParameters[1].actionUseIndex];
bool8 wasSet = MoveFlagSet(move) != 0;
for (i = 0; i < MAX_MON_MOVES; i++) {
if (MoveFlagExists(&entInfo->moves.moves[i])) {
entInfo->moves.moves[i].moveFlags &= ~(MOVE_FLAG_SET);
}
}
BufferMoveName(gFormatBuffer_Items[0], move, NULL);
if (!wasSet) {
move->moveFlags |= MOVE_FLAG_SET;
}
unk_FixLinkedMovesSetEnabled4(entInfo->moves.moves);
move->moveFlags2 |= 2;
PlaySoundEffect(0x133);
if (flagToSet) {
if (!wasSet) {
LogMessageByIdWithPopupCheckUser(entity, gUnknown_80F8B40);
}
else {
LogMessageByIdWithPopupCheckUser(entity, gUnknown_80F8B64);
}
sub_803E708(0x78, 0x1F);
}
}
void sub_8063B54(ActionContainer *a0)
{
Entity *entity = gDungeon->teamPokemon[a0->actionParameters[0].actionUseIndex];
EntityInfo *entInfo = GetEntInfo(entity);
Move *move = &entInfo->moves.moves[a0->actionParameters[1].actionUseIndex];
BufferMoveName(gFormatBuffer_Items[0], move, NULL);
move->moveFlags ^= MOVE_FLAG_ENABLED_FOR_AI;
unk_FixLinkedMovesSetEnabled4(entInfo->moves.moves);
move->moveFlags2 |= 2;
PlaySoundEffect(0x133);
}
void sub_8063BB4(ActionContainer *a0)
{
s32 linkedCount;
Entity *entity = gDungeon->teamPokemon[a0->actionParameters[0].actionUseIndex];
EntityInfo *entInfo = GetEntInfo(entity);
s32 id = a0->actionParameters[1].actionUseIndex;
BufferMoveName(gFormatBuffer_Items[0], &entInfo->moves.moves[id], NULL);
entInfo->moves.moves[id].moveFlags2 |= 2;
linkedCount = 0;
for (id++; id < MAX_MON_MOVES; id++) {
if (!MoveFlagExists(&entInfo->moves.moves[id]))
break;
if (!MoveFlagLinkChain(&entInfo->moves.moves[id]))
break;
if (++linkedCount >= MAX_MON_MOVES)
break;
}
if (!MoveFlagExists(&entInfo->moves.moves[id]))
id = MAX_MON_MOVES;
if (id < MAX_MON_MOVES) {
Move *move = &entInfo->moves.moves[id];
move->moveFlags |= MOVE_FLAG_SUBSEQUENT_IN_LINK_CHAIN;
BufferMoveName(gFormatBuffer_Items[1], move, NULL);
}
unk_FixLinkedMovesSetEnabled4(entInfo->moves.moves);
PlaySoundEffect(0x133);
}
bool8 sub_8063C88(EntityInfo *entInfo, s32 a1)
{
s32 i;
bool8 ret = FALSE;
s32 moveId = a1;
if (DoesMoveCharge(entInfo->moves.moves[moveId].id))
return FALSE;
moveId++;
for (i = 0; i < MAX_MON_MOVES; i++) {
Move *move = &entInfo->moves.moves[moveId];
if (DoesMoveCharge(move->id))
return FALSE;
if (!MoveFlagExists(move))
break;
if (!MoveFlagLinkChain(move)) {
ret = TRUE;
break;
}
if (++moveId >= MAX_MON_MOVES)
break;
}
return ret;
}
//

View File

@ -1,6 +1,7 @@
#include "global.h"
#include "globaldata.h"
#include "dungeon_menu_team.h"
#include "dungeon_menu_moves.h"
#include "dungeon_submenu.h"
#include "structs/str_dungeon.h"
#include "number_util.h"
@ -126,7 +127,6 @@ extern char* sub_808E4FC(s32 a1);
extern char* sub_808E51C(s32 a1);
extern void sub_8045C18(u8 *buffer, Item *item);
extern bool32 sub_8069D18(DungeonPos *a0, Entity *a1);
extern void ShowStatusDescriptionMenu(struct subStruct_203B240 *strings, MenuInputStructSub *menuSub);
extern u8 gUnknown_202EE00;
extern Entity *gLeaderPointer;