diff --git a/asm/bird.s b/asm/bird.s index 765e06da..a0db6e49 100644 --- a/asm/bird.s +++ b/asm/bird.s @@ -225,7 +225,7 @@ _0809D3A8: movs r2, #0 ldrsh r1, [r0, r2] adds r0, r5, #0 - bl sub_08003FC4 + bl GravityUpdate adds r0, r5, #0 bl UpdateAnimationSingleFrame ldr r4, [r5, #0x54] @@ -298,7 +298,7 @@ _0809D448: bl CopyPosition _0809D454: adds r0, r5, #0 - bl sub_080040A8 + bl CheckOnScreen cmp r0, #0 bne _0809D488 ldrb r0, [r5, #0xc] @@ -528,11 +528,11 @@ _0809D62E: movs r0, #0 ldrsh r1, [r7, r0] adds r0, r5, #0 - bl sub_08003FC4 + bl GravityUpdate adds r0, r5, #0 bl UpdateAnimationSingleFrame adds r0, r5, #0 - bl sub_080040A8 + bl CheckOnScreen cmp r0, #0 bne _0809D652 bl DeleteThisEntity diff --git a/asm/chuchuBoss.s b/asm/chuchuBoss.s index 332527a1..d3f20d5a 100644 --- a/asm/chuchuBoss.s +++ b/asm/chuchuBoss.s @@ -1028,7 +1028,7 @@ sub_0802647C: @ 0x0802647C adds r4, r0, #0 movs r1, #0x80 lsls r1, r1, #7 - bl sub_08003FC4 + bl GravityUpdate cmp r0, #0 bne _080264A6 movs r0, #0x10 @@ -1551,7 +1551,7 @@ sub_0802686C: @ 0x0802686C adds r4, r0, #0 movs r1, #0x80 lsls r1, r1, #7 - bl sub_08003FC4 + bl GravityUpdate adds r5, r0, #0 cmp r5, #0 beq _08026888 diff --git a/asm/code_080011C4.s b/asm/code_080011C4.s index a08f6287..45532f9d 100644 --- a/asm/code_080011C4.s +++ b/asm/code_080011C4.s @@ -109,7 +109,7 @@ sub_08001242: @ 0x08001242 pop {r0} _08001282: ldr r1, _08001364 @ =0x00001800 - bl sub_08003FC4 + bl GravityUpdate pop {pc} .align 2, 0 _0800128C: @@ -126,6 +126,8 @@ sub_08001290: @ 0x08001290 _0800129C: bx lr + @ r0: Entity* + @ r1: Function* array non_word_aligned_thumb_func_start EnemyFunctionHandler EnemyFunctionHandler: @ 0x0800129E mov r3, lr diff --git a/asm/code_08003FC4.s b/asm/code_08003FC4.s index 4e033a93..9b66ce10 100644 --- a/asm/code_08003FC4.s +++ b/asm/code_08003FC4.s @@ -5,8 +5,12 @@ .text - thumb_func_start sub_08003FC4 -sub_08003FC4: @ 0x08003FC4 + thumb_func_start GravityUpdate +GravityUpdate: @ 0x08003FC4 + @ r0 = Entity* + @ r1 = Gravity strength + @ returns z pos + adds r3, r0, #0 ldr r0, [r3, #0x34] ldr r2, [r3, #0x20] @@ -141,8 +145,8 @@ sub_080040A2: @ 0x080040A2 lsrs r1, r1, #2 bhs _080040D0 - thumb_func_start sub_080040A8 -sub_080040A8: @ 0x080040A8 + thumb_func_start CheckOnScreen +CheckOnScreen: @ 0x080040A8 ldr r1, _08004368 @ =gRoomControls movs r2, #0x2e ldrsh r2, [r0, r2] diff --git a/asm/code_080043E8.s b/asm/code_080043E8.s index 8cbadc90..4a962130 100644 --- a/asm/code_080043E8.s +++ b/asm/code_080043E8.s @@ -102,7 +102,7 @@ _0800449A: thumb_func_start sub_0800449C sub_0800449C: @ 0x0800449C push {r1, lr} - bl sub_080040A8 + bl CheckOnScreen cmp r0, #0 pop {r0} beq _080044AC diff --git a/asm/code_080732D0.s b/asm/code_080732D0.s index 36957a76..ad91468f 100644 --- a/asm/code_080732D0.s +++ b/asm/code_080732D0.s @@ -272,7 +272,7 @@ sub_080734D4: @ 0x080734D4 push {r4, lr} adds r4, r0, #0 ldr r1, _080734FC @ =0xFFFFF000 - bl sub_08003FC4 + bl GravityUpdate ldr r0, [r4, #0x20] cmp r0, #0 bgt _080734EE @@ -307,7 +307,7 @@ sub_08073504: @ 0x08073504 lsls r1, r1, #4 _08073516: adds r0, r4, #0 - bl sub_08003FC4 + bl GravityUpdate ldr r0, [r4, #0x20] cmp r0, #0 bge _08073576 @@ -737,7 +737,7 @@ _0807382A: movs r1, #0x80 lsls r1, r1, #2 adds r0, r4, #0 - bl sub_08003FC4 + bl GravityUpdate b _0807387A .align 2, 0 _08073854: .4byte gScreenTransition @@ -818,7 +818,7 @@ _080738EC: _080738F0: ldr r1, _08073900 @ =0xFFFFE800 adds r0, r4, #0 - bl sub_08003FC4 + bl GravityUpdate adds r0, r4, #0 bl UpdateAnimationSingleFrame pop {r4, pc} @@ -1029,7 +1029,7 @@ _08073A48: _08073A7E: adds r0, r4, #0 adds r1, r2, #0 - bl sub_08003FC4 + bl GravityUpdate cmp r0, #0 bne _08073A90 adds r0, r4, #0 @@ -1206,7 +1206,7 @@ _08073BD0: movs r1, #0x80 lsls r1, r1, #7 adds r0, r4, #0 - bl sub_08003FC4 + bl GravityUpdate movs r0, #0x36 ldrsh r1, [r4, r0] movs r0, #8 @@ -1500,7 +1500,7 @@ _08073E10: movs r1, #0x80 lsls r1, r1, #6 adds r0, r4, #0 - bl sub_08003FC4 + bl GravityUpdate adds r1, r0, #0 cmp r1, #0 bne _08073E32 @@ -1737,7 +1737,7 @@ _08073FF8: movs r1, #0x80 lsls r1, r1, #6 adds r0, r4, #0 - bl sub_08003FC4 + bl GravityUpdate ldr r0, [r4, #0x20] cmp r0, #0 bne _08074016 @@ -1796,7 +1796,7 @@ sub_08074060: @ 0x08074060 adds r4, r0, #0 movs r1, #0x80 lsls r1, r1, #6 - bl sub_08003FC4 + bl GravityUpdate cmp r0, #0 bne _080740D0 ldr r0, _080740C4 @ =gPlayerHitbox @@ -1966,7 +1966,7 @@ _080741B0: movs r1, #0x80 lsls r1, r1, #6 adds r0, r4, #0 - bl sub_08003FC4 + bl GravityUpdate cmp r0, #0 bne _080741C2 bl sub_0807921C @@ -3517,7 +3517,7 @@ _08074D20: movs r1, #0x80 lsls r1, r1, #6 adds r0, r5, #0 - bl sub_08003FC4 + bl GravityUpdate adds r0, r5, #0 bl UpdateAnimationSingleFrame pop {r4, r5, r6, pc} @@ -4009,7 +4009,7 @@ sub_0807508C: @ 0x0807508C movs r1, #0x80 lsls r1, r1, #6 adds r0, r4, #0 - bl sub_08003FC4 + bl GravityUpdate cmp r0, #0 beq _080750AA adds r0, r4, #0 diff --git a/asm/code_08078778.s b/asm/code_08078778.s index 36074a2e..973db1ec 100644 --- a/asm/code_08078778.s +++ b/asm/code_08078778.s @@ -5581,13 +5581,13 @@ sub_0807B21C: @ 0x0807B21C movs r1, #0x80 lsls r1, r1, #3 adds r0, r4, #0 - bl sub_08003FC4 + bl GravityUpdate b _0807B240 _0807B236: movs r1, #0x80 lsls r1, r1, #4 adds r0, r4, #0 - bl sub_08003FC4 + bl GravityUpdate _0807B240: ldr r1, [r4, #0x20] ldr r0, _0807B260 @ =0xFFFF8000 @@ -5659,7 +5659,7 @@ sub_0807B2B8: @ 0x0807B2B8 push {r4, lr} adds r4, r0, #0 ldr r1, _0807B2F0 @ =0xFFFFE000 - bl sub_08003FC4 + bl GravityUpdate adds r0, r4, #0 bl UpdateAnimationSingleFrame ldrb r0, [r4, #0xe] diff --git a/asm/crenalBeanSprout.s b/asm/crenalBeanSprout.s index 10d49ea1..1085ea32 100644 --- a/asm/crenalBeanSprout.s +++ b/asm/crenalBeanSprout.s @@ -648,7 +648,7 @@ _0809681C: movs r1, #0x80 lsls r1, r1, #7 adds r0, r4, #0 - bl sub_08003FC4 + bl GravityUpdate cmp r0, #0 bne _08096830 adds r0, r4, #0 diff --git a/asm/crow.s b/asm/crow.s index d736150b..58f659f5 100644 --- a/asm/crow.s +++ b/asm/crow.s @@ -280,7 +280,7 @@ sub_080329E8: @ 0x080329E8 sub_080329F0: @ 0x080329F0 push {r4, lr} adds r4, r0, #0 - bl sub_080040A8 + bl CheckOnScreen cmp r0, #0 bne _08032A3A movs r0, #4 @@ -326,7 +326,7 @@ _08032A46: sub_08032A48: @ 0x08032A48 push {r4, r5, lr} adds r4, r0, #0 - bl sub_080040A8 + bl CheckOnScreen adds r5, r0, #0 cmp r5, #0 bne _08032AAE diff --git a/asm/cuccoAggr.s b/asm/cuccoAggr.s index c8046759..612b0979 100644 --- a/asm/cuccoAggr.s +++ b/asm/cuccoAggr.s @@ -312,7 +312,7 @@ sub_08038EE0: @ 0x08038EE0 movs r1, #0xe0 lsls r1, r1, #5 adds r0, r4, #0 - bl sub_08003FC4 + bl GravityUpdate cmp r0, #0 bne _08038F1C ldrb r0, [r4, #0xe] diff --git a/asm/eyegore.s b/asm/eyegore.s index a49491c7..14833af2 100644 --- a/asm/eyegore.s +++ b/asm/eyegore.s @@ -161,7 +161,7 @@ sub_08030B34: @ 0x08030B34 movs r1, #0xe0 lsls r1, r1, #5 adds r0, r4, #0 - bl sub_08003FC4 + bl GravityUpdate b _08030B70 _08030B52: adds r0, r4, #0 @@ -425,7 +425,7 @@ _08030D44: movs r1, #0xe0 lsls r1, r1, #5 adds r0, r4, #0 - bl sub_08003FC4 + bl GravityUpdate cmp r0, #0 bne _08030D66 adds r0, r4, #0 @@ -506,7 +506,7 @@ _08030DDE: movs r1, #0xe0 lsls r1, r1, #5 adds r0, r4, #0 - bl sub_08003FC4 + bl GravityUpdate cmp r0, #0 bne _08030E1C adds r0, r4, #0 diff --git a/asm/ezloCap.s b/asm/ezloCap.s index cb68080e..99afe54f 100644 --- a/asm/ezloCap.s +++ b/asm/ezloCap.s @@ -551,7 +551,7 @@ _08082D0C: movs r1, #0x80 lsls r1, r1, #6 adds r0, r5, #0 - bl sub_08003FC4 + bl GravityUpdate adds r0, r5, #0 bl UpdateAnimationSingleFrame _08082D1C: @@ -709,7 +709,7 @@ sub_08082E14: @ 0x08082E14 movs r1, #0xc0 lsls r1, r1, #5 adds r0, r4, #0 - bl sub_08003FC4 + bl GravityUpdate ldrb r0, [r4, #0xd] cmp r0, #0 beq _08082E38 diff --git a/asm/flyingPot.s b/asm/flyingPot.s index 75e3a8b5..1dfba1a3 100644 --- a/asm/flyingPot.s +++ b/asm/flyingPot.s @@ -501,7 +501,7 @@ _080373F2: movs r1, #0x80 lsls r1, r1, #6 adds r0, r4, #0 - bl sub_08003FC4 + bl GravityUpdate cmp r0, #0 bne _08037406 adds r0, r4, #0 diff --git a/asm/flyingSkull.s b/asm/flyingSkull.s index d0ae76c4..c3aee745 100644 --- a/asm/flyingSkull.s +++ b/asm/flyingSkull.s @@ -694,7 +694,7 @@ _0803A0CA: movs r1, #0x80 lsls r1, r1, #6 adds r0, r4, #0 - bl sub_08003FC4 + bl GravityUpdate cmp r0, #0 bne _0803A0DE adds r0, r4, #0 diff --git a/asm/gleerok.s b/asm/gleerok.s index 6cf5f3a5..32779e12 100644 --- a/asm/gleerok.s +++ b/asm/gleerok.s @@ -1294,7 +1294,7 @@ _0802D95E: movs r1, #0xc0 lsls r1, r1, #5 adds r0, r4, #0 - bl sub_08003FC4 + bl GravityUpdate adds r2, r0, #0 cmp r2, #0 beq _0802D970 @@ -1526,7 +1526,7 @@ _0802DB20: movs r1, #0xc0 lsls r1, r1, #5 adds r0, r4, #0 - bl sub_08003FC4 + bl GravityUpdate ldr r0, [r4, #0x20] cmp r0, #0 bgt _0802DB7E diff --git a/asm/itemForSale.s b/asm/itemForSale.s index 8b5a7c02..156e200d 100644 --- a/asm/itemForSale.s +++ b/asm/itemForSale.s @@ -19,7 +19,7 @@ ItemForSale: @ 0x08081814 adds r0, r4, #0 bl _call_via_r1 adds r0, r4, #0 - bl sub_080040A8 + bl CheckOnScreen cmp r0, #0 beq _08081838 adds r0, r4, #0 diff --git a/asm/ladderUp.s b/asm/ladderUp.s index 785c3f3b..1eaecf27 100644 --- a/asm/ladderUp.s +++ b/asm/ladderUp.s @@ -83,7 +83,7 @@ _0808D4D8: movs r1, #0x80 lsls r1, r1, #5 adds r0, r7, #0 - bl sub_08003FC4 + bl GravityUpdate cmp r0, #0 beq _0808D4E8 b _0808D642 @@ -340,7 +340,7 @@ _0808DBE8: movs r1, #0x80 lsls r1, r1, #5 adds r0, r7, #0 - bl sub_08003FC4 + bl GravityUpdate cmp r0, #0 beq _0808DBF8 b _0808DD72 diff --git a/asm/lavaPlatform.s b/asm/lavaPlatform.s index a973a799..e4199773 100644 --- a/asm/lavaPlatform.s +++ b/asm/lavaPlatform.s @@ -87,7 +87,7 @@ sub_080922E4: @ 0x080922E4 adds r4, r0, #0 movs r1, #0x90 lsls r1, r1, #6 - bl sub_08003FC4 + bl GravityUpdate adds r2, r0, #0 cmp r2, #0 bne _08092322 diff --git a/asm/lilypadLarge.s b/asm/lilypadLarge.s index 4d2e643d..a9158fe8 100644 --- a/asm/lilypadLarge.s +++ b/asm/lilypadLarge.s @@ -850,7 +850,7 @@ sub_08085B40: @ 0x08085B40 movs r1, #0x80 lsls r1, r1, #6 adds r0, r5, #0 - bl sub_08003FC4 + bl GravityUpdate cmp r0, #0 beq _08085BE8 ldr r1, [r5, #0x78] @@ -930,7 +930,7 @@ _08085BE8: movs r1, #0x80 lsls r1, r1, #6 adds r0, r4, #0 - bl sub_08003FC4 + bl GravityUpdate cmp r0, #0 bne _08085C58 adds r0, r4, #0 diff --git a/asm/macroPlayer.s b/asm/macroPlayer.s index 26025e39..d5df62c2 100644 --- a/asm/macroPlayer.s +++ b/asm/macroPlayer.s @@ -262,7 +262,7 @@ sub_0808CCBC: @ 0x0808CCBC movs r1, #0x80 lsls r1, r1, #5 adds r0, r4, #0 - bl sub_08003FC4 + bl GravityUpdate cmp r0, #0 bne _0808CCFA ldrb r0, [r4, #0xc] @@ -300,7 +300,7 @@ sub_0808CD00: @ 0x0808CD00 movs r1, #0x80 lsls r1, r1, #6 adds r0, r4, #0 - bl sub_08003FC4 + bl GravityUpdate cmp r0, #0 beq _0808CD24 adds r0, r4, #0 @@ -335,7 +335,7 @@ sub_0808CD44: @ 0x0808CD44 movs r1, #0x80 lsls r1, r1, #6 adds r0, r4, #0 - bl sub_08003FC4 + bl GravityUpdate cmp r0, #0 beq _0808CD68 adds r0, r4, #0 @@ -368,7 +368,7 @@ sub_0808CD88: @ 0x0808CD88 movs r1, #0xc0 lsls r1, r1, #5 adds r0, r4, #0 - bl sub_08003FC4 + bl GravityUpdate cmp r0, #0 beq _0808CDB8 adds r0, r4, #0 diff --git a/asm/minecart.s b/asm/minecart.s index 9192a4e1..3ed01b8f 100644 --- a/asm/minecart.s +++ b/asm/minecart.s @@ -233,7 +233,7 @@ _08091DA0: movs r1, #0x80 lsls r1, r1, #6 adds r0, r4, #0 - bl sub_08003FC4 + bl GravityUpdate cmp r0, #0 bne _08091DD8 ldrb r1, [r4, #0xb] diff --git a/asm/non_matching/castorWildsStatue/sub_080676E0.inc b/asm/non_matching/castorWildsStatue/sub_080676E0.inc index dbf35d08..862de60f 100644 --- a/asm/non_matching/castorWildsStatue/sub_080676E0.inc +++ b/asm/non_matching/castorWildsStatue/sub_080676E0.inc @@ -49,7 +49,7 @@ _08067734: movs r1, #0xc0 lsls r1, r1, #5 adds r0, r3, #0 - bl sub_08003FC4 + bl GravityUpdate cmp r0, #0 beq _08067748 _08067742: diff --git a/asm/non_matching/cucco/sub_0806E564.inc b/asm/non_matching/cucco/sub_0806E564.inc index 81b21c45..69dbcecf 100644 --- a/asm/non_matching/cucco/sub_0806E564.inc +++ b/asm/non_matching/cucco/sub_0806E564.inc @@ -36,7 +36,7 @@ _0806E5AA: movs r1, #0xa0 lsls r1, r1, #6 adds r0, r4, #0 - bl sub_08003FC4 + bl GravityUpdate cmp r0, #0 bne _0806E5D4 ldrb r0, [r4, #0xe] diff --git a/asm/non_matching/cuccoChick/sub_0806E7B0.inc b/asm/non_matching/cuccoChick/sub_0806E7B0.inc index 25c8580e..5044ade9 100644 --- a/asm/non_matching/cuccoChick/sub_0806E7B0.inc +++ b/asm/non_matching/cuccoChick/sub_0806E7B0.inc @@ -35,7 +35,7 @@ _0806E7F2: movs r1, #0xc0 lsls r1, r1, #6 adds r0, r4, #0 - bl sub_08003FC4 + bl GravityUpdate cmp r0, #0 bne _0806E81C ldrb r0, [r4, #0xe] diff --git a/asm/non_matching/mountainMinish/sub_08067EF0.inc b/asm/non_matching/mountainMinish/sub_08067EF0.inc index 6dc123ef..5efe7adb 100644 --- a/asm/non_matching/mountainMinish/sub_08067EF0.inc +++ b/asm/non_matching/mountainMinish/sub_08067EF0.inc @@ -161,7 +161,7 @@ _0806802C: ands r0, r2 strb r0, [r6] adds r0, r5, #0 - bl sub_080040A8 + bl CheckOnScreen cmp r0, #0 bne _08068068 ldr r4, _08068064 @ =gUnk_0811137A diff --git a/asm/non_matching/player/sub_08070DC4.inc b/asm/non_matching/player/sub_08070DC4.inc index c7142c97..5f9b8e7e 100644 --- a/asm/non_matching/player/sub_08070DC4.inc +++ b/asm/non_matching/player/sub_08070DC4.inc @@ -12,7 +12,7 @@ movs r1, #0x80 lsls r1, r1, #6 adds r0, r4, #0 - bl sub_08003FC4 + bl GravityUpdate cmp r0, #0 bne _08070E76 ldr r6, _08070E18 @ =gPlayerState diff --git a/asm/non_matching/player/sub_08072D54.inc b/asm/non_matching/player/sub_08072D54.inc index 6ade7257..74485d74 100644 --- a/asm/non_matching/player/sub_08072D54.inc +++ b/asm/non_matching/player/sub_08072D54.inc @@ -151,7 +151,7 @@ _08072E80: movs r1, #0x80 lsls r1, r1, #6 adds r0, r4, #0 - bl sub_08003FC4 + bl GravityUpdate cmp r0, #0 bne _08072F10 ldrb r1, [r4, #0x10] diff --git a/asm/non_matching/playerItem13/sub_080AD040.inc b/asm/non_matching/playerItem13/sub_080AD040.inc index 33fff72b..01a96f6c 100644 --- a/asm/non_matching/playerItem13/sub_080AD040.inc +++ b/asm/non_matching/playerItem13/sub_080AD040.inc @@ -71,7 +71,7 @@ _080AD0C8: movs r1, #0x80 lsls r1, r1, #6 adds r0, r4, #0 - bl sub_08003FC4 + bl GravityUpdate cmp r0, #0 beq _080AD0D8 b _080AD202 diff --git a/asm/non_matching/postman/sub_0806076C.inc b/asm/non_matching/postman/sub_0806076C.inc index 086d9be1..d82f1b9f 100644 --- a/asm/non_matching/postman/sub_0806076C.inc +++ b/asm/non_matching/postman/sub_0806076C.inc @@ -148,7 +148,7 @@ _08060864: strh r0, [r7, #0x32] adds r0, r7, #0 str r2, [sp] - bl sub_080040A8 + bl CheckOnScreen cmp r0, #0 beq _080608B8 ldr r0, [sp, #4] diff --git a/asm/object1F.s b/asm/object1F.s index 315749f8..9f65249f 100644 --- a/asm/object1F.s +++ b/asm/object1F.s @@ -139,7 +139,7 @@ _08087788: movs r1, #0xa0 lsls r1, r1, #6 adds r0, r4, #0 - bl sub_08003FC4 + bl GravityUpdate _08087798: cmp r0, #0 bne _080877A0 diff --git a/asm/object30.s b/asm/object30.s index 084b0cfc..8ad2185f 100644 --- a/asm/object30.s +++ b/asm/object30.s @@ -127,7 +127,7 @@ _0808A924: _0808A926: ldr r1, [r4, #0x70] adds r0, r4, #0 - bl sub_08003FC4 + bl GravityUpdate b _0808A962 _0808A930: ldr r2, _0808A964 @ =gUnk_08121194 diff --git a/asm/object4B.s b/asm/object4B.s index 80b99e0e..b66012b4 100644 --- a/asm/object4B.s +++ b/asm/object4B.s @@ -141,7 +141,7 @@ sub_0808F858: @ 0x0808F858 movs r1, #0x80 lsls r1, r1, #6 adds r0, r4, #0 - bl sub_08003FC4 + bl GravityUpdate cmp r0, #0 bne _0808F88A adds r0, r4, #0 diff --git a/asm/object53.s b/asm/object53.s index 9be70782..cb6da18f 100644 --- a/asm/object53.s +++ b/asm/object53.s @@ -95,7 +95,7 @@ _080911AA: movs r1, #0x80 lsls r1, r1, #6 adds r0, r4, #0 - bl sub_08003FC4 + bl GravityUpdate cmp r0, #0 bne _080911E8 ldrb r1, [r4, #0xb] diff --git a/asm/object67.s b/asm/object67.s index aa5a10de..fe69518b 100644 --- a/asm/object67.s +++ b/asm/object67.s @@ -341,7 +341,7 @@ _080943A8: movs r1, #0x80 lsls r1, r1, #7 adds r0, r4, #0 - bl sub_08003FC4 + bl GravityUpdate cmp r0, #0 bne _08094420 ldrb r0, [r4, #0xb] diff --git a/asm/object97.s b/asm/object97.s index 380c921b..cc0b3c10 100644 --- a/asm/object97.s +++ b/asm/object97.s @@ -197,7 +197,7 @@ sub_0809DB14: @ 0x0809DB14 adds r4, r0, #0 bl sub_0809E1F0 adds r0, r4, #0 - bl sub_080040A8 + bl CheckOnScreen adds r5, r0, #0 cmp r5, #0 bne _0809DB36 @@ -586,7 +586,7 @@ sub_0809DDE4: @ 0x0809DDE4 adds r0, r4, #0 bl sub_0809E210 adds r0, r4, #0 - bl sub_080040A8 + bl CheckOnScreen adds r5, r0, #0 cmp r5, #0 bne _0809DE2A @@ -814,7 +814,7 @@ _0809DFD6: sub_0809DFE0: @ 0x0809DFE0 push {r4, lr} adds r4, r0, #0 - bl sub_080040A8 + bl CheckOnScreen cmp r0, #0 bne _0809E028 ldr r1, [r4, #0x54] diff --git a/asm/objectB3.s b/asm/objectB3.s index bb58c920..4111e371 100644 --- a/asm/objectB3.s +++ b/asm/objectB3.s @@ -92,7 +92,7 @@ sub_080A0AC4: @ 0x080A0AC4 sub_080A0AD0: @ 0x080A0AD0 push {lr} movs r1, #0x80 - bl sub_08003FC4 + bl GravityUpdate pop {pc} .align 2, 0 @@ -131,7 +131,7 @@ sub_080A0AF0: @ 0x080A0AF0 _080A0B1C: adds r0, r4, #0 movs r1, #0x80 - bl sub_08003FC4 + bl GravityUpdate pop {r4, pc} .align 2, 0 diff --git a/asm/objectOnSpinyBeetle.s b/asm/objectOnSpinyBeetle.s index 76679025..bcf85560 100644 --- a/asm/objectOnSpinyBeetle.s +++ b/asm/objectOnSpinyBeetle.s @@ -517,7 +517,7 @@ _080988FA: movs r1, #0x80 lsls r1, r1, #6 adds r0, r4, #0 - bl sub_08003FC4 + bl GravityUpdate cmp r0, #0 bne _0809890E adds r0, r4, #0 diff --git a/asm/stalfos.s b/asm/stalfos.s index fa469360..8dfd95a9 100644 --- a/asm/stalfos.s +++ b/asm/stalfos.s @@ -353,7 +353,7 @@ sub_08039530: @ 0x08039530 adds r4, r0, #0 movs r1, #0xc0 lsls r1, r1, #5 - bl sub_08003FC4 + bl GravityUpdate cmp r0, #0 bne _08039568 adds r0, r4, #0 @@ -442,7 +442,7 @@ sub_080395D8: @ 0x080395D8 movs r1, #0xc0 lsls r1, r1, #5 adds r0, r4, #0 - bl sub_08003FC4 + bl GravityUpdate cmp r0, #0 bne _08039602 adds r0, r4, #0 @@ -464,7 +464,7 @@ sub_08039604: @ 0x08039604 movs r1, #0xc0 lsls r1, r1, #5 adds r0, r4, #0 - bl sub_08003FC4 + bl GravityUpdate ldr r0, [r4, #0x20] cmp r0, #0 bge _08039624 @@ -563,7 +563,7 @@ sub_080396BC: @ 0x080396BC adds r4, r0, #0 movs r1, #0xc0 lsls r1, r1, #5 - bl sub_08003FC4 + bl GravityUpdate cmp r0, #0 bne _080396E2 adds r1, r4, #0 diff --git a/asm/takkuri.s b/asm/takkuri.s index 57dbaf0e..c8b490ae 100644 --- a/asm/takkuri.s +++ b/asm/takkuri.s @@ -226,7 +226,7 @@ sub_0803BD08: @ 0x0803BD08 cmp r0, #0 beq _0803BD2C adds r0, r4, #0 - bl sub_080040A8 + bl CheckOnScreen cmp r0, #0 bne _0803BD80 strb r0, [r4, #0xf] @@ -290,7 +290,7 @@ sub_0803BD88: @ 0x0803BD88 sub_0803BD90: @ 0x0803BD90 push {r4, lr} adds r4, r0, #0 - bl sub_080040A8 + bl CheckOnScreen cmp r0, #0 bne _0803BDC8 movs r0, #4 @@ -415,7 +415,7 @@ _0803BE78: .4byte gRoomControls sub_0803BE7C: @ 0x0803BE7C push {r4, r5, lr} adds r4, r0, #0 - bl sub_080040A8 + bl CheckOnScreen adds r5, r0, #0 cmp r5, #0 bne _0803BEE6 diff --git a/asm/wizzrobeFire.s b/asm/wizzrobeFire.s index ffe3a72f..7433c82d 100644 --- a/asm/wizzrobeFire.s +++ b/asm/wizzrobeFire.s @@ -242,7 +242,7 @@ _0802FCDE: cmp r0, #0 beq _0802FDCA adds r0, r4, #0 - bl sub_080040A8 + bl CheckOnScreen cmp r0, #0 beq _0802FDCA adds r0, r4, #0 diff --git a/asm/wizzrobeIce.s b/asm/wizzrobeIce.s index ae171a3f..4ac417bd 100644 --- a/asm/wizzrobeIce.s +++ b/asm/wizzrobeIce.s @@ -269,7 +269,7 @@ _0802FFB6: cmp r0, #0 beq _080300A2 adds r0, r4, #0 - bl sub_080040A8 + bl CheckOnScreen cmp r0, #0 beq _080300A2 adds r0, r4, #0 diff --git a/asm/wizzrobeWind.s b/asm/wizzrobeWind.s index ed1ca987..2fef5564 100644 --- a/asm/wizzrobeWind.s +++ b/asm/wizzrobeWind.s @@ -294,7 +294,7 @@ _0802F6B6: cmp r0, #0 beq _0802F7A2 adds r0, r4, #0 - bl sub_080040A8 + bl CheckOnScreen cmp r0, #0 beq _0802F7A2 adds r0, r4, #0 diff --git a/include/asm.h b/include/asm.h index cd151320..99ad082a 100644 --- a/include/asm.h +++ b/include/asm.h @@ -12,7 +12,7 @@ extern void sub_08001242(struct Entity_*); extern void sub_08001290(struct Entity_*, u32); extern void sub_08001324(struct Entity_*); extern u32 sub_08002632(struct Entity_*); -extern u32 sub_08003FC4(struct Entity_*, u32); +extern u32 GravityUpdate(struct Entity_*, u32); extern u32 sub_080043E8(struct Entity_*); extern void sub_08004484(struct Entity_*, struct Entity_*); extern u32 sub_080045D4(s16, s16, u32, u32); diff --git a/include/entity.h b/include/entity.h index 43c3b721..8a895838 100644 --- a/include/entity.h +++ b/include/entity.h @@ -61,7 +61,7 @@ typedef struct Entity_ { /*0x16*/ u8 field_0x16; /*0x17*/ u8 field_0x17; /*0x18*/ struct { - /* */ u32 draw : 2; // 1-2 + /* */ u32 draw : 2; // 0 = no draw, 1 = draw clip, 3 = force draw /* */ u32 ss2 : 1; // 4 /* */ u32 ss3 : 1; // 8 /* */ u32 shadow : 2; //0x10-0x20 diff --git a/include/functions.h b/include/functions.h index 7c875323..23e0a7cc 100644 --- a/include/functions.h +++ b/include/functions.h @@ -161,7 +161,7 @@ extern void sub_0802F45C(Entity*); extern u32 sub_0800419C(Entity*, Entity*, u32, u32); extern void sub_08004542(Entity*); extern void sub_08077B20(); -extern bool32 sub_080040A8(Entity*); +extern bool32 CheckOnScreen(Entity*); extern u32 sub_08017850(Entity*); extern void sub_080809D4(void); extern void sub_08080CB4(Entity*); diff --git a/src/enemy/acroBandits.c b/src/enemy/acroBandits.c index e43a8f39..865791d5 100644 --- a/src/enemy/acroBandits.c +++ b/src/enemy/acroBandits.c @@ -108,7 +108,7 @@ void sub_080318DC(Entity* this) { void sub_08031A60(Entity* this) { if (this->iframes > 0) - sub_08003FC4(this, 0x1800); + GravityUpdate(this, 0x1800); sub_08001324(this); } @@ -351,7 +351,7 @@ void sub_08031EE8(Entity* this) { } void sub_08031F54(Entity* this) { - sub_08003FC4(this, gUnk_080CE5F0[this->type2]); + GravityUpdate(this, gUnk_080CE5F0[this->type2]); if (this->type2 * -0xe <= this->z.HALF.HI) { this->action = 3; this->actionDelay = 20; @@ -426,7 +426,7 @@ void sub_08032008(Entity* this) { } void sub_08032148(Entity* this) { - if (sub_08003FC4(this, 0x2000)) + if (GravityUpdate(this, 0x2000)) return; sub_08032290(this); @@ -481,7 +481,7 @@ void sub_08032204(Entity* this) { } void sub_08032248(Entity* this) { - if (sub_08003FC4(this, 0x1800) == 0) { + if (GravityUpdate(this, 0x1800) == 0) { if (this->frame & 0x80) { ((Entity*)this->field_0x7c.WORD)->actionDelay--; diff --git a/src/enemy/beetle.c b/src/enemy/beetle.c index 205e149e..b6988f6c 100644 --- a/src/enemy/beetle.c +++ b/src/enemy/beetle.c @@ -133,7 +133,7 @@ void sub_08021984(Entity* this) { EnqueueSFX(0x12d); } - if (sub_08003FC4(this, 0x1800) == 0) { + if (GravityUpdate(this, 0x1800) == 0) { this->action = 2; this->actionDelay = 16; this->field_0xf = 1; @@ -200,7 +200,7 @@ void sub_08021AD8(Entity* this) { EnqueueSFX(0x7c); } sub_080AEFE0(this); - if (!sub_08003FC4(this, 0x1800)) + if (!GravityUpdate(this, 0x1800)) this->frameDuration = 1; } @@ -259,7 +259,7 @@ void sub_08021C58(Entity* this) { GetNextFrame(this); if (this->frame & 1) { sub_080AEFE0(this); - if (sub_08003FC4(this, 0x1800) == 0) + if (GravityUpdate(this, 0x1800) == 0) this->frameDuration = 1; } diff --git a/src/enemy/chuchu.c b/src/enemy/chuchu.c index f14b400c..eb77023e 100644 --- a/src/enemy/chuchu.c +++ b/src/enemy/chuchu.c @@ -134,7 +134,7 @@ void sub_0801EFD8(Entity* this) { sub_0801FB68(this); InitializeAnimation(this, 8); } - sub_08003FC4(this, 0x1800); + GravityUpdate(this, 0x1800); GetNextFrame(this); } } @@ -146,7 +146,7 @@ void sub_0801F02C(Entity* this) { } void sub_0801F048(Entity* this) { - sub_08003FC4(this, 0x1800); + GravityUpdate(this, 0x1800); GetNextFrame(this); if (this->type == 0) { sub_0804A7D4(this); @@ -218,7 +218,7 @@ void sub_0801F1B0(Entity* this) { EnqueueSFX(299); } sub_080AEFE0(this); - if (sub_08003FC4(this, 0x4000) == 0) + if (GravityUpdate(this, 0x4000) == 0) GetNextFrame(this); } else { GetNextFrame(this); @@ -278,7 +278,7 @@ void sub_0801F2CC(Entity* this) { } void sub_0801F2F8(Entity* this) { - sub_08003FC4(this, 0x1800); + GravityUpdate(this, 0x1800); GetNextFrame(this); if (this->frame & 0x80) { sub_0801F340(this); @@ -409,7 +409,7 @@ void sub_0801F584(Entity* this) { EnqueueSFX(299); } sub_080AEFE0(this); - if (sub_08003FC4(this, 0x4000) == 0) + if (GravityUpdate(this, 0x4000) == 0) GetNextFrame(this); } else { @@ -471,7 +471,7 @@ void sub_0801F6CC(Entity* this) { } void sub_0801F6F8(Entity* this) { - sub_08003FC4(this, 0x1800); + GravityUpdate(this, 0x1800); GetNextFrame(this); if (this->frame & 0x80) { this->action = 4; @@ -586,7 +586,7 @@ void sub_0801F940(Entity* this) { EnqueueSFX(299); } sub_080AEFE0(this); - if (sub_08003FC4(this, 0x4000) == 0) + if (GravityUpdate(this, 0x4000) == 0) GetNextFrame(this); } else { GetNextFrame(this); @@ -646,7 +646,7 @@ void sub_0801FA78(Entity* this) { } void sub_0801FAAC(Entity* this) { - sub_08003FC4(this, 0x1800); + GravityUpdate(this, 0x1800); GetNextFrame(this); if (this->frame & 0x80) { sub_0801FB14(this); diff --git a/src/enemy/cuccoChickAggr.c b/src/enemy/cuccoChickAggr.c index abb416f2..46b7c58b 100644 --- a/src/enemy/cuccoChickAggr.c +++ b/src/enemy/cuccoChickAggr.c @@ -52,7 +52,7 @@ void sub_08022988(Entity* this) { } ProcessMovement(this); - if (sub_08003FC4(this, 0x2000) == 0) { + if (GravityUpdate(this, 0x2000) == 0) { if (--this->actionDelay == 0) { sub_08022A88(this); } else { @@ -64,7 +64,7 @@ void sub_08022988(Entity* this) { } void sub_080229F8(Entity* this) { - if (sub_08003FC4(this, 0x2800) == 0) { + if (GravityUpdate(this, 0x2800) == 0) { if (--this->actionDelay == 0) { this->action = 4; this->actionDelay = 6; @@ -88,7 +88,7 @@ void sub_08022A40(Entity* this) { } ProcessMovement(this); - if (sub_08003FC4(this, 0x2000) == 0) { + if (GravityUpdate(this, 0x2000) == 0) { if (--this->actionDelay == 0) { sub_08022A88(this); } else { diff --git a/src/enemy/fireballGuy.c b/src/enemy/fireballGuy.c index afcc4ac7..ebeaaf1f 100644 --- a/src/enemy/fireballGuy.c +++ b/src/enemy/fireballGuy.c @@ -49,7 +49,7 @@ void sub_080453E8(Entity* this) { void sub_08045430(Entity* this) { sub_080AEFE0(this); GetNextFrame(this); - if (sub_08003FC4(this, 0x1800) == 0) + if (GravityUpdate(this, 0x1800) == 0) sub_08045524(this); } diff --git a/src/enemy/helmasaur.c b/src/enemy/helmasaur.c index 594c8800..494b577b 100644 --- a/src/enemy/helmasaur.c +++ b/src/enemy/helmasaur.c @@ -227,7 +227,7 @@ void sub_0802BEEC(Entity* this) { this->direction = this->animationState << 3; InitializeAnimation(this, this->animationState + 4); } - } else if (!sub_08003FC4(this, 0x1c00)) { + } else if (!GravityUpdate(this, 0x1c00)) { this->action = 8; this->actionDelay = 30; this->speed = 0x120; diff --git a/src/enemy/lakitu.c b/src/enemy/lakitu.c index 85d80ee3..9179a7a5 100644 --- a/src/enemy/lakitu.c +++ b/src/enemy/lakitu.c @@ -224,7 +224,7 @@ void Lakitu_LightningDelay(Entity* this) { } void Lakitu_Cloudless(Entity* this) { - if (sub_08003FC4(this, 0x1800) == 0 && this->animIndex <= 19) { + if (GravityUpdate(this, 0x1800) == 0 && this->animIndex <= 19) { InitAnimationForceUpdate(this, this->animationState + 20); this->spritePriority.b1 = 0; diff --git a/src/enemy/mazaalBracelet.c b/src/enemy/mazaalBracelet.c index d0db11ed..2adfed33 100644 --- a/src/enemy/mazaalBracelet.c +++ b/src/enemy/mazaalBracelet.c @@ -927,7 +927,7 @@ void sub_0803B100(Entity* this) { void sub_0803B144(Entity* this) { UpdateAnimationSingleFrame(this->child); - if (sub_08003FC4(this, 0x2000) == 0) { + if (GravityUpdate(this, 0x2000) == 0) { this->action = 0x2a; InitializeAnimation(this, 0x16); sub_0803B8E8(this, 0x14); diff --git a/src/enemy/mazaalHead.c b/src/enemy/mazaalHead.c index a96e4f84..553d5053 100644 --- a/src/enemy/mazaalHead.c +++ b/src/enemy/mazaalHead.c @@ -315,7 +315,7 @@ void sub_080342C8(Entity* this) { this->spriteOffsetX = gUnk_080CECEC[this->actionDelay >> 1 & 7]; } else { this->spriteOffsetX = 0; - if (sub_08003FC4(this, 0x2000) == 0) { + if (GravityUpdate(this, 0x2000) == 0) { this->action = 0xc; this->field_0x7c.HALF.HI = 0x708; this->field_0x7c.BYTES.byte1 = 0; diff --git a/src/enemy/miniFireballGuy.c b/src/enemy/miniFireballGuy.c index cca05ed4..0cde6285 100644 --- a/src/enemy/miniFireballGuy.c +++ b/src/enemy/miniFireballGuy.c @@ -43,7 +43,7 @@ void sub_08045618(Entity* this) { void sub_08045654(Entity* this) { sub_080AEFE0(this); GetNextFrame(this); - if (sub_08003FC4(this, 0x1800) == 0) { + if (GravityUpdate(this, 0x1800) == 0) { sub_08045678(this); } } diff --git a/src/enemy/peahat.c b/src/enemy/peahat.c index 5d8ba2d5..804ccba6 100644 --- a/src/enemy/peahat.c +++ b/src/enemy/peahat.c @@ -238,7 +238,7 @@ void Peahat_Stunned(Entity* this) { GetNextFrame(this); break; case PeahatAnimation_SlicedPropeller: - sub_08003FC4(this, 0x1c00); + GravityUpdate(this, 0x1c00); if (this->z.HALF.HI == 0) { this->action = 7; this->actionDelay = 150; @@ -316,7 +316,7 @@ void Peahat_Takeoff(Entity* this) { } else if (this->frame & 1) { sub_0800442E(this); } else { - sub_08003FC4(this, 0x1c00); + GravityUpdate(this, 0x1c00); ProcessMovement(this); } } diff --git a/src/enemy/puffstool.c b/src/enemy/puffstool.c index 6240bcd2..2641033f 100644 --- a/src/enemy/puffstool.c +++ b/src/enemy/puffstool.c @@ -104,7 +104,7 @@ void sub_0802511C(Entity* this) { } void sub_0802514C(Entity* this) { - sub_08003FC4(this, 0x2000); + GravityUpdate(this, 0x2000); if (sub_0806F520(this)) { gUnk_080CBFEC[this->subAction](this); } else { @@ -209,7 +209,7 @@ void sub_0802538C(Entity* this) { if (this->frame == 0) { GetNextFrame(this); } else { - sub_08003FC4(this, 0x2000); + GravityUpdate(this, 0x2000); if (this->zVelocity < 0x2000) { this->action = 4; InitializeAnimation(this, 2); @@ -220,7 +220,7 @@ void sub_0802538C(Entity* this) { void sub_080253D4(Entity* this) { GetNextFrame(this); - if (!sub_08003FC4(this, 0x2000)) { + if (!GravityUpdate(this, 0x2000)) { if (this->field_0xf == 0) { this->action = 5; InitializeAnimation(this, 3); @@ -256,7 +256,7 @@ void sub_0802544C(Entity* this) { } void sub_0802547C(Entity* this) { - sub_08003FC4(this, 0x2000); + GravityUpdate(this, 0x2000); GetNextFrame(this); if ((this->actionDelay & 7) == 0) { sub_08025BD4(this); @@ -268,7 +268,7 @@ void sub_0802547C(Entity* this) { } void sub_080254B4(Entity* this) { - sub_08003FC4(this, 0x2000); + GravityUpdate(this, 0x2000); if (this->frame & 0x80) { if (this->z.HALF.HI == 0) { if (this->cutsceneBeh.HWORD == 0) { diff --git a/src/enemy/rollobite.c b/src/enemy/rollobite.c index 5fb77dab..0a7dc34c 100644 --- a/src/enemy/rollobite.c +++ b/src/enemy/rollobite.c @@ -206,7 +206,7 @@ void Rollobite_Unroll(Entity* this) { } void Rollobite_LinedUp(Entity* this) { - if (sub_08003FC4(this, 0x1c00) == 0) { + if (GravityUpdate(this, 0x1c00) == 0) { this->action = 7; this->spritePriority.b0 = 7; } diff --git a/src/enemy/rope.c b/src/enemy/rope.c index d001888d..e555d60b 100644 --- a/src/enemy/rope.c +++ b/src/enemy/rope.c @@ -83,7 +83,7 @@ void sub_08031480(Entity* this) { SoundReq(SFX_12D); } } else { - if (sub_08003FC4(this, 0x1800) == 0) { + if (GravityUpdate(this, 0x1800) == 0) { this->action = 2; this->field_0xf = 0xf; this->spriteSettings.draw = 1; diff --git a/src/enemy/sluggula.c b/src/enemy/sluggula.c index 5d307fc4..57a6b416 100644 --- a/src/enemy/sluggula.c +++ b/src/enemy/sluggula.c @@ -117,7 +117,7 @@ void sub_08023CE0(Entity* this) { EnqueueSFX(0x12d); InitializeAnimation(this, 4); } - } else if (!sub_08003FC4(this, 0x1800)) { + } else if (!GravityUpdate(this, 0x1800)) { this->action = 3; this->spriteSettings.draw = 1; EnqueueSFX(0x84); diff --git a/src/enemy/spikedBeetle.c b/src/enemy/spikedBeetle.c index 903908c4..ec281989 100644 --- a/src/enemy/spikedBeetle.c +++ b/src/enemy/spikedBeetle.c @@ -173,7 +173,7 @@ void sub_0802B8E0(Entity* this) { } void sub_0802B948(Entity* this) { - if (!sub_08003FC4(this, 0x1800)) { + if (!GravityUpdate(this, 0x1800)) { this->action = 1; this->actionDelay = 1; } diff --git a/src/enemy/spinyChuchu.c b/src/enemy/spinyChuchu.c index 69664d39..7d5ea60b 100644 --- a/src/enemy/spinyChuchu.c +++ b/src/enemy/spinyChuchu.c @@ -86,7 +86,7 @@ void sub_080225A0(Entity* this) { } void sub_080225BC(Entity* this) { - sub_08003FC4(this, 0x1800); + GravityUpdate(this, 0x1800); if (this->frame & 1) { sub_0804A7D4(this); } else { @@ -125,7 +125,7 @@ void sub_08022654(Entity* this) { InitializeAnimation(this, 0); /* fallthrough */ case 1: - if (sub_08003FC4(this, 0x1800)) + if (GravityUpdate(this, 0x1800)) return; this->subAction = 2; @@ -204,7 +204,7 @@ void sub_080227AC(Entity* this) { } void sub_0802281C(Entity* this) { - sub_08003FC4(this, 0x1800); + GravityUpdate(this, 0x1800); GetNextFrame(this); if (this->frame & 0x80) { this->action = 2; @@ -218,7 +218,7 @@ void sub_08022854(Entity* this) { GetNextFrame(this); if (this->frame & 1) { sub_080AEFE0(this); - if (sub_08003FC4(this, 0x1800) == 0) { + if (GravityUpdate(this, 0x1800) == 0) { this->action = 7; this->hitType = 0x5c; InitializeAnimation(this, 5); diff --git a/src/enemy/tektite.c b/src/enemy/tektite.c index ac123367..07709ae9 100644 --- a/src/enemy/tektite.c +++ b/src/enemy/tektite.c @@ -56,7 +56,7 @@ void nullsub_16(Entity* this) { void sub_0802F1F0(Entity* this) { sub_08001242(this); if (this->z.HALF.HI != 0) { - sub_08003FC4(this, this->field_0x80.HWORD); + GravityUpdate(this, this->field_0x80.HWORD); } } diff --git a/src/enemy/tektiteGolden.c b/src/enemy/tektiteGolden.c index ba3b5d58..2fc3bfb0 100644 --- a/src/enemy/tektiteGolden.c +++ b/src/enemy/tektiteGolden.c @@ -55,7 +55,7 @@ void sub_08037F58(Entity* this) { void sub_08037F84(Entity* this) { sub_08001242(this); if (this->z.HALF.HI != 0) { - sub_08003FC4(this, 0x3000); + GravityUpdate(this, 0x3000); } } diff --git a/src/enemy/vaatiArm.c b/src/enemy/vaatiArm.c index 8a5dd737..7882441e 100644 --- a/src/enemy/vaatiArm.c +++ b/src/enemy/vaatiArm.c @@ -972,7 +972,7 @@ void sub_08043520(Entity* this) { Entity* entity; entity = ((VaatiArm_HeapStruct*)this->myHeap)->entities[4]; - sub_08003FC4(entity, 0x1a00); + GravityUpdate(entity, 0x1a00); if ((entity->zVelocity < 0) && (-6 < entity->z.HALF.HI)) { entity->z.HALF.HI = -6; this->subAction = 3; diff --git a/src/enemy/vaatiTransfigured.c b/src/enemy/vaatiTransfigured.c index 232d95a5..c9198d08 100644 --- a/src/enemy/vaatiTransfigured.c +++ b/src/enemy/vaatiTransfigured.c @@ -313,7 +313,7 @@ void VaatiTransfiguredType0Action3(Entity* this) { } break; } - if (sub_08003FC4(this, 0x2800) == 0) { + if (GravityUpdate(this, 0x2800) == 0) { this->field_0x80.HALF.LO = 5; this->actionDelay = 0x10; COLLISION_ON(this); @@ -379,7 +379,7 @@ void VaatiTransfiguredType0Action4(Entity* this) { } break; case 1: - if (sub_08003FC4(this, 0x2800) != 0) + if (GravityUpdate(this, 0x2800) != 0) break; this->field_0x80.HALF.LO += 1; switch (this->cutsceneBeh.HALF.LO) { diff --git a/src/enemy/vaatiWrath.c b/src/enemy/vaatiWrath.c index 25fb3dba..d216ba7f 100644 --- a/src/enemy/vaatiWrath.c +++ b/src/enemy/vaatiWrath.c @@ -470,7 +470,7 @@ void VaatiWrathType0ActionB(Entity* this) { UpdateAnimationSingleFrame(this); GetNextFrame(((VaatiWrathHeapStruct*)this->myHeap)->type1); GetNextFrame(((VaatiWrathHeapStruct*)this->myHeap)->type2); - if (sub_08003FC4(this, 0x2000) == 0) { + if (GravityUpdate(this, 0x2000) == 0) { this->subAction = 1; this->actionDelay = 0xf0; this->health = 8; diff --git a/src/enemy/waterDrop.c b/src/enemy/waterDrop.c index 32390db3..fc63d632 100644 --- a/src/enemy/waterDrop.c +++ b/src/enemy/waterDrop.c @@ -34,7 +34,7 @@ void sub_0802A250(Entity* this) { } void sub_0802A2B4(Entity* this) { - if (!sub_08003FC4(this, 0x2800)) { + if (!GravityUpdate(this, 0x2800)) { this->action = 2; this->spritePriority.b0 = 7; EnqueueSFX(0x84); diff --git a/src/npc/cuccoChick.c b/src/npc/cuccoChick.c index 11aab009..10a51b9f 100644 --- a/src/npc/cuccoChick.c +++ b/src/npc/cuccoChick.c @@ -74,7 +74,7 @@ void CuccoChick_Fusion(Entity* this) { this->spriteSettings.draw = 1; this->frameIndex = 1; } else { - if (sub_08003FC4(this, 0x3000) == 0) { + if (GravityUpdate(this, 0x3000) == 0) { this->zVelocity = 0x10000; } } diff --git a/src/npc/melari.c b/src/npc/melari.c index 757bc43e..f2d408b2 100644 --- a/src/npc/melari.c +++ b/src/npc/melari.c @@ -79,7 +79,7 @@ void sub_08068780(Entity* this) { if (this->frame & 0x40) { this->frame &= 0xbf; - if (sub_080040A8(this) == 0) { + if (CheckOnScreen(this) == 0) { SoundReq(gUnk_0811153E[(s32)Random() % 3]); } else { EnqueueSFX(gUnk_08111538[(s32)Random() % 3]); diff --git a/src/npc/npc5.c b/src/npc/npc5.c index a86189ef..97d3c819 100644 --- a/src/npc/npc5.c +++ b/src/npc/npc5.c @@ -265,7 +265,7 @@ void sub_08060DFC(Entity* this) { sub_0806F69C(this); sub_08060E94(this); - uVar1 = sub_08003FC4(this, 0x2000); + uVar1 = GravityUpdate(this, 0x2000); if (uVar1 == 0) { this->action = 7; this->collisionLayer = 1; diff --git a/src/npc/postman.c b/src/npc/postman.c index 3014e4b8..9e643e8e 100644 --- a/src/npc/postman.c +++ b/src/npc/postman.c @@ -96,7 +96,7 @@ void sub_080604DC(Entity* this) { int iVar2; Entity* ent; - if (this->spriteSettings.draw == 1 && sub_080040A8(this)) { + if (this->spriteSettings.draw == 1 && CheckOnScreen(this)) { if ((this->frame & 1) != 0) { this->frame &= 0xfe; ent = CreateFx(this, 17, 0x40); @@ -163,7 +163,7 @@ void sub_08060528(Entity* this) { this->field_0x6a.HWORD -= 1; } } - sub_08003FC4(this, 0x1800); + GravityUpdate(this, 0x1800); if (((this->field_0x6c.HALF.HI != 0) && (this->zVelocity == 0)) && this->z.WORD == 0) { this->field_0x6c.HALF.HI = 0; sub_080606C0(this); diff --git a/src/npc/townMinish.c b/src/npc/townMinish.c index dc8e0531..3d89d6f4 100644 --- a/src/npc/townMinish.c +++ b/src/npc/townMinish.c @@ -174,7 +174,7 @@ void sub_0806AEA8(Entity* this) { int old = this->field_0x82.HWORD; this->field_0x82.HWORD &= ~0x20; if (old & 0x20) { - sub_08003FC4(this, 0x4000); + GravityUpdate(this, 0x4000); } HandleEntity0x82Actions(this); this->field_0x82.HWORD = old; @@ -226,7 +226,7 @@ void sub_0806AF70(Entity* this, ScriptExecutionContext* context) { } void sub_0806AF78(Entity* this, ScriptExecutionContext* context) { - sub_08003FC4(this, 0x1800); + GravityUpdate(this, 0x1800); if (0 <= this->z.WORD && this->zVelocity < 1) { this->z.WORD = 0; sub_0806AF70(this, context); diff --git a/src/npc/zelda.c b/src/npc/zelda.c index 781c2c80..4cb5a1ae 100644 --- a/src/npc/zelda.c +++ b/src/npc/zelda.c @@ -137,7 +137,7 @@ void sub_08066E80(Entity* this, ScriptExecutionContext* context) { break; case 2: sub_0806F62C(this, 0x100, 0x80); - sub_08003FC4(this, 0x2000); + GravityUpdate(this, 0x2000); if (!(this->frame & 1)) { UpdateAnimationSingleFrame(this); } @@ -148,7 +148,7 @@ void sub_08066E80(Entity* this, ScriptExecutionContext* context) { case 3: sub_0806F62C(this, 0x100, 0x80); UpdateAnimationSingleFrame(this); - if (sub_08003FC4(this, 0x2000) == 0) { + if (GravityUpdate(this, 0x2000) == 0) { context->unk_18++; InitAnimationForceUpdate(this, 0x1E); } diff --git a/src/object/bird.c b/src/object/bird.c index b7774df4..9a131075 100644 --- a/src/object/bird.c +++ b/src/object/bird.c @@ -44,12 +44,12 @@ void sub_0809CF54(Entity* this) { void sub_0809CFEC(Entity* this) { sub_0806F69C(this); - sub_08003FC4(this, *(s16*)&this->field_0x68.HWORD); + GravityUpdate(this, *(s16*)&this->field_0x68.HWORD); if (this->actionDelay != 0) { if (--this->actionDelay == 0) { this->field_0xf = 0; } - } else if (sub_080040A8(this) == 0) { + } else if (CheckOnScreen(this) == 0) { DeleteThisEntity(); } UpdateAnimationSingleFrame(this); diff --git a/src/object/itemOnGround.c b/src/object/itemOnGround.c index 2c025c77..78d8c881 100644 --- a/src/object/itemOnGround.c +++ b/src/object/itemOnGround.c @@ -216,7 +216,7 @@ void sub_080811EC(Entity* this) { sub_0806F69C(this); } - sub_08003FC4(this, 0x2800); + GravityUpdate(this, 0x2800); if (this->zVelocity <= 0) { this->action = 2; COLLISION_ON(this); @@ -302,7 +302,7 @@ void sub_0808136C(Entity* this) { this->y.WORD = other->y.WORD; this->spriteOrientation.flipY = other->spriteOrientation.flipY; this->spriteRendering.b3 = other->spriteRendering.b3; - sub_08003FC4(this, 0x2800); + GravityUpdate(this, 0x2800); } else { sub_08081404(this, 1); } @@ -410,14 +410,14 @@ void sub_0808153C(Entity* this) { return; if (this->field_0x68.HALF.LO == 0) { - if (!sub_08003FC4(this, 0x1000) && !sub_0800442E(this)) { + if (!GravityUpdate(this, 0x1000) && !sub_0800442E(this)) { this->field_0x68.HALF.LO = 1; this->zVelocity = 0x1E000; sub_0808148C(this->type); UpdateSpriteForCollisionLayer(this); } } else { - if (!sub_08003FC4(this, 0x2800)) { + if (!GravityUpdate(this, 0x2800)) { this->field_0x68.HALF.LO = 2; sub_0808148C(this->type); } diff --git a/src/object/jarPortal.c b/src/object/jarPortal.c index d84c12b6..8adb45e7 100644 --- a/src/object/jarPortal.c +++ b/src/object/jarPortal.c @@ -57,7 +57,7 @@ void sub_0808BF14(Entity* this) { } void sub_0808BF58(Entity* this) { - sub_08003FC4(this, 0x2000); + GravityUpdate(this, 0x2000); switch (this->subAction) { case 0: if (this->zVelocity <= 98303) { @@ -125,7 +125,7 @@ void sub_0808C01C(Entity* this, u32 r1) { } void sub_0808C0AC(Entity* this) { - sub_08003FC4(this, 0x2000); + GravityUpdate(this, 0x2000); switch (this->subAction) { case 0: if (this->zVelocity <= 98303) { diff --git a/src/object/object49.c b/src/object/object49.c index 125c6440..4b4be720 100644 --- a/src/object/object49.c +++ b/src/object/object49.c @@ -53,7 +53,7 @@ void sub_0808F0D0(Entity* this) { void sub_0808F14C(Entity* this) { sub_0808F2B0(this); - if (sub_08003FC4(this, 0x2000) == 0) { + if (GravityUpdate(this, 0x2000) == 0) { this->action++; SoundReq(SFX_WATER_SPLASH); } diff --git a/src/object/object6A.c b/src/object/object6A.c index baeccd92..d0063f60 100644 --- a/src/object/object6A.c +++ b/src/object/object6A.c @@ -104,7 +104,7 @@ Object6ATypeAction sub_08096290; extern void sub_08080CB4(Entity*); extern u32 sub_080002B8(Entity*); -extern u32 sub_080040A8(Entity*); +extern u32 CheckOnScreen(Entity*); extern void sub_08078850(Entity*, u32, u32, u8*); void sub_08095754(Object6AEntity*); @@ -355,7 +355,7 @@ void sub_08094E30(Object6AEntity* this) { case 3: super->z.WORD -= super->zVelocity; super->zVelocity -= 0x2000; - if (!sub_080040A8(super)) { + if (!CheckOnScreen(super)) { DeleteThisEntity(); } break; @@ -695,7 +695,7 @@ void sub_080954DC(Object6AEntity* this) { break; } this->off += 4; - if (super->subAction != 0 && !sub_080040A8(super)) + if (super->subAction != 0 && !CheckOnScreen(super)) DeleteThisEntity(); if (super->direction & 0x80) super->spriteSettings.flipX = 0; @@ -1090,9 +1090,9 @@ void sub_08095DBC(Object6AEntity* this) { super->zVelocity = 0x40000; super->speed = 0xC000; } - sub_08003FC4(super, super->speed); + GravityUpdate(super, super->speed); GetNextFrame(super); - if (!sub_080040A8(super)) + if (!CheckOnScreen(super)) DeleteThisEntity(); } } @@ -1241,7 +1241,7 @@ void sub_08096168(Object6AEntity* this) { } GetNextFrame(super); sub_0806F62C(super, super->speed, super->direction); - if (!sub_080040A8(super)) + if (!CheckOnScreen(super)) DeleteThisEntity(); } @@ -1301,7 +1301,7 @@ void sub_0809629C(Object6AEntity* this, u32 type) { } ExecuteScriptForEntity(super, 0); HandleEntity0x82Actions(super); - sub_08003FC4(super, 0x1000); + GravityUpdate(super, 0x1000); tmp = super->type; super->type = type; sub_08080CB4(super); diff --git a/src/object/pot.c b/src/object/pot.c index dd645021..d7a7ae96 100644 --- a/src/object/pot.c +++ b/src/object/pot.c @@ -256,7 +256,7 @@ void sub_08082824(Entity* this) { this->spriteSettings.flipY = 1; } - if (sub_08003FC4(this, 0x2000) == 0) { + if (GravityUpdate(this, 0x2000) == 0) { sub_08082850(this, NULL); } } diff --git a/src/player.c b/src/player.c index 455f018c..ead93d25 100644 --- a/src/player.c +++ b/src/player.c @@ -401,7 +401,7 @@ static NONMATCH("asm/non_matching/player/sub_08070DC4.inc", void PlayerBounceUpd sub_08079E08(); UpdateFloorType(); - if (sub_08078EFC() || sub_08003FC4(this, 0x2000)) + if (sub_08078EFC() || GravityUpdate(this, 0x2000)) return; gPlayerState.jumpStatus = 0; @@ -615,7 +615,7 @@ static void sub_08071130(Entity* this) { sub_0806F69C(this); - if (sub_08003FC4(this, 0x2000)) + if (GravityUpdate(this, 0x2000)) return; gPlayerState.jumpStatus = 0; @@ -880,7 +880,7 @@ static ASM_FUNC("asm/non_matching/player/PortalShrinkUpdate.inc", void PortalShr static void PortalEnterUpdate(Entity* this) { if (this->actionDelay == 0) { - if (sub_08003FC4(this, 0x2000)) + if (GravityUpdate(this, 0x2000)) return; this->spriteSettings.draw = FALSE; @@ -976,7 +976,7 @@ static void PlayerTalkEzloInit(Entity* this) { return; } - if (!sub_08003FC4(this, 0x2000)) + if (!GravityUpdate(this, 0x2000)) gPlayerState.jumpStatus = 0; } @@ -1142,7 +1142,7 @@ static void PlayerMinishDieInit(Entity* this) { if (gPlayerState.flags & (0x10 | 0x100)) return; - if (sub_08003FC4(this, 0x2000)) { + if (GravityUpdate(this, 0x2000)) { if (gPlayerState.flags & PL_NO_CAP) gPlayerState.animation = 0x420; else @@ -1287,7 +1287,7 @@ static void sub_08071E04(Entity* this) { static void sub_08071E74(Entity* this) { u32 temp; - sub_08003FC4(this, 0x2000); + GravityUpdate(this, 0x2000); sub_08079E08(); temp = this->actionDelay--; if (temp == 0) @@ -1353,7 +1353,7 @@ static void PlayerFrozenInit(Entity* this) { } static void PlayerFrozenUpdate(Entity* this) { - if (sub_08003FC4(this, 0x2000) == 0) { + if (GravityUpdate(this, 0x2000) == 0) { UpdateSpriteForCollisionLayer(this); gPlayerState.jumpStatus = 0; if (gPlayerState.field_0x14 == 0) { @@ -1457,7 +1457,7 @@ static void sub_08072168(Entity* this) { UpdateAnimationSingleFrame(this); i = (u16)sub_0806F854(this, 0, -12) ? 0x4000 : 0x2000; - sub_08003FC4(this, i); + GravityUpdate(this, i); if (gPlayerState.field_0x3a) { sub_0806F69C(this); } else { @@ -1553,7 +1553,7 @@ static void sub_08072354(Entity* this) { sub_0806F854(this, 0, -12); UpdateAnimationSingleFrame(this); sub_08079744(this); - if (sub_08003FC4(this, 0x2000)) + if (GravityUpdate(this, 0x2000)) return; this->spritePriority.b1 = 0; @@ -1929,7 +1929,7 @@ static void sub_08072B5C(Entity* this) { static void sub_08072C48(Entity* this) { UpdateAnimationSingleFrame(this); sub_0806F69C(this); - if (sub_08003FC4(this, 0x2000)) + if (GravityUpdate(this, 0x2000)) return; sub_08008790(this, 7); @@ -2054,7 +2054,7 @@ static NONMATCH("asm/non_matching/player/sub_08072D54.inc", void sub_08072D54(En } this->actionDelay = bVar1; - if (!sub_08003FC4(this, 0x2000)) { + if (!GravityUpdate(this, 0x2000)) { COLLISION_ON(this); if (this->collisionLayer == 1) { sub_0800455E(this); diff --git a/src/playerItem/playerItem12.c b/src/playerItem/playerItem12.c index 3f750765..855fcef8 100644 --- a/src/playerItem/playerItem12.c +++ b/src/playerItem/playerItem12.c @@ -25,7 +25,7 @@ void sub_0807037C(Entity* this) { void sub_08070398(Entity* this) { GetNextFrame(this); sub_0806F69C(this); - if (sub_08003FC4(this, 0x2000) == 0) { + if (GravityUpdate(this, 0x2000) == 0) { DeleteThisEntity(); } } diff --git a/src/playerItem/playerItemBow.c b/src/playerItem/playerItemBow.c index f9739d9b..c1295acd 100644 --- a/src/playerItem/playerItemBow.c +++ b/src/playerItem/playerItemBow.c @@ -28,7 +28,7 @@ void sub_08019410(Entity* this) { void sub_08019444(Entity* this) { GetNextFrame(this); sub_0806F69C(this); - if (sub_08003FC4(this, 0x2000) == 0) { + if (GravityUpdate(this, 0x2000) == 0) { DeleteThisEntity(); } } diff --git a/src/projectile/arrowProjectile.c b/src/projectile/arrowProjectile.c index 03994e21..845a839b 100644 --- a/src/projectile/arrowProjectile.c +++ b/src/projectile/arrowProjectile.c @@ -90,7 +90,7 @@ void ArrowProjectile_Action3(Entity* this) { } void ArrowProjectile_Action4(Entity* this) { - if (sub_08003FC4(this, 0x2800) == 0) { + if (GravityUpdate(this, 0x2800) == 0) { CreateDust(this); DeleteThisEntity(); } else { diff --git a/src/projectile/boneProjectile.c b/src/projectile/boneProjectile.c index 1bececa0..d778558d 100644 --- a/src/projectile/boneProjectile.c +++ b/src/projectile/boneProjectile.c @@ -55,7 +55,7 @@ void BoneProjectile_Action1(Entity* this) { void BoneProjectile_Action2(Entity* this) { GetNextFrame(this); sub_080AF090(this); - if (sub_08003FC4(this, 0x1800) == 0) { + if (GravityUpdate(this, 0x1800) == 0) { this->action = 3; COLLISION_OFF(this); this->speed = 0xe0; @@ -75,7 +75,7 @@ void BoneProjectile_Action3(Entity* this) { void BoneProjectile_Action4(Entity* this) { GetNextFrame(this); sub_0806F69C(this); - if (sub_08003FC4(this, 0x1800) == 0) { + if (GravityUpdate(this, 0x1800) == 0) { DeleteEntity(this); } } diff --git a/src/projectile/gleerokProjectile.c b/src/projectile/gleerokProjectile.c index f4d71406..6a25ec3e 100644 --- a/src/projectile/gleerokProjectile.c +++ b/src/projectile/gleerokProjectile.c @@ -89,7 +89,7 @@ void GleerokProjectile_Init(Entity* this) { void GleerokProjectile_Action1(Entity* this) { if (this->type == 3) { - if (sub_08003FC4(this, 0x1800) == 0) { + if (GravityUpdate(this, 0x1800) == 0) { sub_08008790(this, 7); CreateFx(this, FX_ROCK, 0); DeleteThisEntity(); @@ -101,7 +101,7 @@ void GleerokProjectile_Action1(Entity* this) { this->field_0xf = 0x1e; sub_08004596(this, GetFacingDirection(this, &gPlayerEntity)); } - if (sub_08003FC4(this, 0) == 0) { + if (GravityUpdate(this, 0) == 0) { this->action = 2; sub_080A90D8(this); if (this->type == 2) { diff --git a/src/projectile/mandiblesProjectile.c b/src/projectile/mandiblesProjectile.c index 79fcb38b..43551110 100644 --- a/src/projectile/mandiblesProjectile.c +++ b/src/projectile/mandiblesProjectile.c @@ -198,7 +198,7 @@ void MandiblesProjectile_Action4(Entity* this) { } } } else { - if (sub_080040A8(this) == 0) { + if (CheckOnScreen(this) == 0) { DeleteThisEntity(); } } diff --git a/src/projectile/octorokBossProjectile.c b/src/projectile/octorokBossProjectile.c index 70315175..d04903b5 100644 --- a/src/projectile/octorokBossProjectile.c +++ b/src/projectile/octorokBossProjectile.c @@ -154,7 +154,7 @@ void OctorokBossProjectile_Action1(Entity* this) { OctorokBossProjectile_Action2(this); } GetNextFrame(this); - if (sub_08003FC4(this, 0x1800) != 0) { + if (GravityUpdate(this, 0x1800) != 0) { sub_080AE58C(this, this->direction >> 3, 0); if (this->collisions == 0) { sub_0806F62C(this, (s32)this->speed, (u32)this->direction); @@ -189,7 +189,7 @@ void OctorokBossProjectile_Action1(Entity* this) { DeleteThisEntity(); break; case 3: - if (sub_08003FC4(this, 0x1800) != 0) { + if (GravityUpdate(this, 0x1800) != 0) { return; } CreateFx(this, FX_ROCK, 0); diff --git a/src/projectile/rockProjectile.c b/src/projectile/rockProjectile.c index 02fea8ba..5ad1b0ef 100644 --- a/src/projectile/rockProjectile.c +++ b/src/projectile/rockProjectile.c @@ -56,7 +56,7 @@ void RockProjectile_Action1(Entity* this) { void RockProjectile_Action2(Entity* this) { sub_0806F69C(this); GetNextFrame(this); - if (sub_08003FC4(this, 0x1800) == 0) { + if (GravityUpdate(this, 0x1800) == 0) { DeleteEntity(this); } } diff --git a/src/projectile/stalfosProjectile.c b/src/projectile/stalfosProjectile.c index 0f3bfec5..92868e26 100644 --- a/src/projectile/stalfosProjectile.c +++ b/src/projectile/stalfosProjectile.c @@ -120,7 +120,7 @@ void StalfosProjectile_Action3(Entity* this) { if (this->zVelocity < 0) { this->spriteSettings.flipY = 1; } - if (sub_08003FC4(this, 0x2000) == 0) { + if (GravityUpdate(this, 0x2000) == 0) { sub_080A9BA8(this); } } diff --git a/src/projectile/v1FireProjectile.c b/src/projectile/v1FireProjectile.c index 4384766d..6c7efb5e 100644 --- a/src/projectile/v1FireProjectile.c +++ b/src/projectile/v1FireProjectile.c @@ -76,7 +76,7 @@ void V1FireProjectile_Init(Entity* this) { void V1FireProjectile_Action1(Entity* this) { GetNextFrame(this); sub_0806F69C(this); - if (sub_08003FC4(this, 0) == 0) { + if (GravityUpdate(this, 0) == 0) { this->action = 2; this->actionDelay = 0xf; InitializeAnimation(this, 0x54); diff --git a/src/projectile/v2Projectile.c b/src/projectile/v2Projectile.c index e0213f6f..b3574211 100644 --- a/src/projectile/v2Projectile.c +++ b/src/projectile/v2Projectile.c @@ -96,7 +96,7 @@ void sub_080ABD70(Entity* this) { ASM_FUNC("asm/non_matching/v2Projectile/sub_080ABE04.inc", void sub_080ABE04(Entity* this)) void sub_080ABE88(Entity* this) { - if (sub_08003FC4(this, 0x1800) == 0) { + if (GravityUpdate(this, 0x1800) == 0) { CreateFx(this, FX_ROCK, 0); DeleteThisEntity(); } @@ -118,7 +118,7 @@ void sub_080ABEA8(Entity* this) { } void sub_080ABF04(Entity* this) { - if (sub_080040A8(this) == 0) { + if (CheckOnScreen(this) == 0) { DeleteThisEntity(); } sub_0806F69C(this); diff --git a/src/script.c b/src/script.c index a05c3629..2a28188e 100644 --- a/src/script.c +++ b/src/script.c @@ -391,7 +391,7 @@ void HandleEntity0x82Actions(Entity* entity) { } break; case 1 << 5: - sub_08003FC4(entity, 0x2000); + GravityUpdate(entity, 0x2000); break; } } @@ -1440,9 +1440,9 @@ void ScriptCommand_0807EF3C(Entity* entity, ScriptExecutionContext* context) { context->unk_18 = 1; entity->zVelocity = ((s16)context->scriptInstructionPointer[1]) << 8; context->x.HALF.LO = context->scriptInstructionPointer[2] << 8; - sub_08003FC4(entity, (u16)context->x.HALF.LO); + GravityUpdate(entity, (u16)context->x.HALF.LO); } else { - if (!sub_08003FC4(entity, (u16)context->x.HALF.LO)) + if (!GravityUpdate(entity, (u16)context->x.HALF.LO)) return; } gActiveScriptInfo.commandSize = 0; @@ -1952,14 +1952,14 @@ void sub_0807F854(Entity* entity, ScriptExecutionContext* context) { } void sub_0807F8BC(Entity* entity, ScriptExecutionContext* context) { - if (sub_080040A8(entity)) + if (CheckOnScreen(entity)) context->condition = 1; else context->condition = 0; } void sub_0807F8D0(Entity* entity, ScriptExecutionContext* context) { - sub_08003FC4(entity, context->intVariable); + GravityUpdate(entity, context->intVariable); gActiveScriptInfo.flags |= 1; } @@ -2129,7 +2129,7 @@ void sub_0807FBCC(Entity* entity, ScriptExecutionContext* context) { void sub_0807FBD4(Entity* entity, ScriptExecutionContext* context) { sub_0806F62C(entity, entity->speed, entity->direction); - if (sub_080040A8(entity)) + if (CheckOnScreen(entity)) gActiveScriptInfo.commandSize = 0; }