Decomped IsSleeping()

-Function provided by SethBarberee.
This commit is contained in:
AnonymousRandomPerson 2022-01-20 18:12:17 -05:00
parent 74d89a6fe4
commit c5cd6e137f
4 changed files with 14 additions and 22 deletions

View File

@ -5,27 +5,6 @@
.text
thumb_func_start IsSleeping
IsSleeping:
push {lr}
ldr r0, [r0, 0x70]
adds r0, 0xA8
ldrb r0, [r0]
cmp r0, 0x1
beq _08070B40
cmp r0, 0x5
beq _08070B40
cmp r0, 0x3
beq _08070B40
movs r0, 0
b _08070B42
_08070B40:
movs r0, 0x1
_08070B42:
pop {r1}
bx r1
thumb_func_end IsSleeping
thumb_func_start HasQuarterHPOrLess
HasQuarterHPOrLess:
push {lr}

View File

@ -5,5 +5,7 @@
// 0x70A58
bool8 HasNegativeStatus(struct DungeonEntity *pokemon);
// 0x70B28
bool8 IsSleeping(struct DungeonEntity *pokemon);
#endif

View File

@ -210,7 +210,7 @@ SECTIONS {
src/status_checks.o(.text);
asm/code_80701A4.o(.text);
src/status_checks_1.o(.text);
asm/code_8070B28.o(.text);
asm/code_8070B48.o(.text);
src/dungeon_capabilities.o(.text);
asm/code_8070BC0.o(.text);
src/dungeon_capabilities_1.o(.text);

View File

@ -42,3 +42,14 @@ bool8 HasNegativeStatus(struct DungeonEntity *pokemon)
}
return FALSE;
}
bool8 IsSleeping(struct DungeonEntity *pokemon)
{
if (pokemon->entityData->sleepStatus != SLEEP_STATUS_SLEEP &&
pokemon->entityData->sleepStatus != SLEEP_STATUS_NAPPING &&
pokemon->entityData->sleepStatus != SLEEP_STATUS_NIGHTMARE)
{
return FALSE;
}
return TRUE;
}