Decomped HasDisabledMove()

This commit is contained in:
AnonymousRandomPerson 2022-02-28 21:04:40 -05:00
parent 91c0a142cc
commit 07285e7e82
4 changed files with 20 additions and 42 deletions

View File

@ -5,46 +5,6 @@
.text
thumb_func_start HasDisabledMove
HasDisabledMove:
push {r4-r6,lr}
adds r4, r0, 0
movs r3, 0
movs r6, 0x1
movs r5, 0x20
adds r2, r4, 0
_0805D81C:
ldrb r1, [r2]
adds r0, r6, 0
ands r0, r1
cmp r0, 0
beq _0805D82E
adds r0, r5, 0
ands r0, r1
cmp r0, 0
bne _0805D848
_0805D82E:
adds r2, 0x8
adds r3, 0x1
cmp r3, 0x3
ble _0805D81C
adds r0, r4, 0
adds r0, 0x20
ldrb r1, [r0]
movs r0, 0x20
ands r0, r1
cmp r0, 0
bne _0805D848
movs r0, 0
b _0805D84A
_0805D848:
movs r0, 0x1
_0805D84A:
pop {r4-r6}
pop {r1}
bx r1
thumb_func_end HasDisabledMove
thumb_func_start LastMoveOutOfPP
LastMoveOutOfPP:
push {r4,r5,lr}

View File

@ -8,5 +8,7 @@
bool8 CanUseOnSelfWithStatusChecker(struct DungeonEntity *pokemon, struct PokemonMove *move);
// 0x5CEB8
bool8 CanUseOnTargetWithStatusChecker(struct DungeonEntity *user, struct DungeonEntity *target, struct PokemonMove *move);
// 0x5D810
bool8 HasDisabledMove(struct PokemonMove *moves);
#endif

View File

@ -211,7 +211,7 @@ SECTIONS {
src/code_8057824.o(.text);
asm/code_8057824.o(.text);
src/status_checker.o(.text);
asm/code_805D810.o(.text);
asm/code_805D850.o(.text);
src/status_checker_1.o(.text);
asm/code_805D8C8.o(.text);
src/targeting.o(.text);

View File

@ -99,7 +99,6 @@ const u8 gDungeonCamouflageTypes[76] = {
TYPE_ROCK
};
extern bool8 HasDisabledMove(struct PokemonMove *moves);
extern bool8 LastMoveOutOfPP(struct PokemonMove *moves);
bool8 CanUseOnSelfWithStatusChecker(struct DungeonEntity *pokemon, struct PokemonMove *move)
@ -903,3 +902,20 @@ bool8 CanUseOnTargetWithStatusChecker(struct DungeonEntity *user, struct Dungeon
}
return TRUE;
}
bool8 HasDisabledMove(struct PokemonMove *moves)
{
s32 i;
for (i = 0; i < MAX_MON_MOVES; i++)
{
if (moves[i].moveFlags & MOVE_FLAG_EXISTS && moves[i].moveFlags & MOVE_FLAG_DISABLED)
{
return TRUE;
}
}
if (moves[STRUGGLE_MOVE_INDEX].moveFlags & MOVE_FLAG_DISABLED)
{
return TRUE;
}
return FALSE;
}