diff options
| author | MegaMech <MegaMech@users.noreply.github.com> | 2024-04-20 21:56:02 -0600 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2024-04-20 21:56:02 -0600 |
| commit | cda6a508fdca35d582aeefd2f966bf5b45919f81 (patch) | |
| tree | d79b3003a8a94ec499153f13eb3ae2995da244ae /src/update_objects.c | |
| parent | d08be66c38ce2f23c2b8fb0529063cfb08959d5f (diff) | |
Match func_8007C4A4 & func_80095AE0 (#618)
* Match funcs
* Add ub fix
Diffstat (limited to 'src/update_objects.c')
| -rw-r--r-- | src/update_objects.c | 31 |
1 files changed, 9 insertions, 22 deletions
diff --git a/src/update_objects.c b/src/update_objects.c index 439fdb03f..d4572e5a0 100644 --- a/src/update_objects.c +++ b/src/update_objects.c @@ -4186,32 +4186,19 @@ UNUSED void func_8007C49C(void) { } -#ifdef NON_MATCHING -// https://decomp.me/scratch/IH8Vx -// No idea what the source of the diff is void func_8007C4A4(s32 objectIndex) { - s32 temp_t8; - s32 var_t1; + u16 var_t9; - temp_t8 = gObjectList[objectIndex].direction_angle[1] * 0x24; - var_t1 = temp_t8 >> 0x10; - if (temp_t8 < 0) { - var_t1 = temp_t8 + 0xFFFF; - var_t1 >>= 0x10; - } - var_t1 &= 0xFFFF; - if (var_t1 < 0x13) { - set_object_flag_status_false(objectIndex, 0x80); - gObjectList[objectIndex].itemDisplay = var_t1; - } - else { - set_object_flag_status_true(objectIndex, 0x80); - gObjectList[objectIndex].itemDisplay = 0x24 - var_t1; + var_t9 = gObjectList[objectIndex].unk_0BE[1] * 0x24 / 0x10000; + + if (var_t9 < 0x13) { + set_object_flag_unk_054_false(objectIndex, 0x80); + gObjectList[objectIndex].itemDisplay = var_t9; + } else { + set_object_flag_unk_054_true(objectIndex, 0x80); + gObjectList[objectIndex].itemDisplay = 0x24 - var_t9; } } -#else -GLOBAL_ASM("asm/non_matchings/update_objects/func_8007C4A4.s") -#endif void func_8007C550(s32 objectIndex) { gObjectList[objectIndex].direction_angle[1] = func_800417B4(gObjectList[objectIndex].direction_angle[1], atan2s(gObjectList[objectIndex].velocity[0], gObjectList[objectIndex].velocity[2])); |
