decomp 2 item funcs

This commit is contained in:
Seth Barberee
2026-03-28 10:18:53 -07:00
parent bd163bbca0
commit 28b84b85d9
4 changed files with 18 additions and 28 deletions

View File

@@ -3,34 +3,6 @@
.text
; https://decomp.me/scratch/juWhM
arm_func_start IsItemInTimeDarkness
IsItemInTimeDarkness: ; 0x0200EB30
ldr r1, _0200EB54 ; =ITEM_DATA_TABLE_PTRS
#ifdef EUROPE
ldr r1, [r1]
#else
ldr r1, [r1, #4]
#endif
add r0, r1, r0, lsl #4
ldrb r0, [r0, #0xe]
tst r0, #2
movne r0, #1
moveq r0, #0
and r0, r0, #0xff
bx lr
.align 2, 0
_0200EB54: .word ITEM_DATA_TABLE_PTRS
arm_func_end IsItemInTimeDarkness
arm_func_start IsItemValidVeneer
IsItemValidVeneer: ; 0x0200EB58
ldr ip, _0200EB60 ; =IsItemValid
bx ip
.align 2, 0
_0200EB60: .word IsItemValid
arm_func_end IsItemValidVeneer
arm_func_start sub_0200EB64
sub_0200EB64: ; 0x0200EB64
ldr r1, _0200EB88 ; =ITEM_DATA_TABLE_PTRS

View File

@@ -1452,6 +1452,7 @@ enum item_target_flag {
enum item_data_flag {
ITEM_DATA_FLAG_VALID = 1 << 0,
ITEM_DATA_IN_TIME_DARKNESS = 1 << 1,
ITEM_DATA_FLAG_THROWABLE_AT_ENEMY = 1 << 5,
ITEM_DATA_FLAG_THROWABLE_AT_ALLY = 1 << 6,
ITEM_DATA_FLAG_CONSUMABLE = 1 << 7,

View File

@@ -40,4 +40,8 @@ s16 GetItemMoveId(s16 item_id);
// return: bool
bool8 TestItemAiFlag(s16 item_id, s32 flag);
bool8 IsItemInTimeDarkness(s16 item_id);
bool8 IsItemValidVeneer(s16 item_id);
#endif //PMDSKY_ITEM_UTIL_1_H

View File

@@ -217,3 +217,16 @@ bool8 TestItemAiFlag(s16 item_id, s32 flag)
return TRUE;
return FALSE;
}
bool8 IsItemInTimeDarkness(s16 item_id)
{
if ((ITEM_DATA_TABLE_PTRS.data[item_id].flags & ITEM_DATA_IN_TIME_DARKNESS)) {
return TRUE;
}
else return FALSE;
}
bool8 IsItemValidVeneer(s16 item_id)
{
return IsItemValid(item_id);
}