diff --git a/decompiler/IR2/FormExpressionAnalysis.cpp b/decompiler/IR2/FormExpressionAnalysis.cpp index f437ca6240..d57b651fb9 100644 --- a/decompiler/IR2/FormExpressionAnalysis.cpp +++ b/decompiler/IR2/FormExpressionAnalysis.cpp @@ -4431,66 +4431,6 @@ FormElement* try_make_nonzero_logtest(Form* in, FormPool& pool) { } return nullptr; } -} // namespace - -FormElement* ConditionElement::make_zero_check_generic(const Env& env, - FormPool& pool, - const std::vector& source_forms, - const std::vector& source_types) { - // (zero? (+ thing small-integer)) -> (= thing (- small-integer)) - ASSERT(source_forms.size() == 1); - - auto enum_type_info = env.dts->ts.try_enum_lookup(source_types.at(0)); - if (enum_type_info && !enum_type_info->is_bitfield()) { - // (zero? (+ (the-as uint arg0) (the-as uint -2))) check enum value - auto mr = match( - Matcher::op(GenericOpMatcher::fixed(FixedOperatorKind::ADDITION), - {make_int_uint_cast_matcher(Matcher::any(0)), - Matcher::match_or({Matcher::any_integer(1), - make_int_uint_cast_matcher(Matcher::any_integer(1))})}), - source_forms.at(0)); - if (mr.matched) { - s64 value = mr.maps.ints.at(1); - value = -value; - auto enum_constant = cast_to_int_enum(enum_type_info, pool, env, value); - return pool.alloc_element( - GenericOperator::make_fixed(FixedOperatorKind::EQ), - std::vector{mr.maps.forms.at(0), enum_constant}); - } - } - - { - auto mr = match(Matcher::op(GenericOpMatcher::fixed(FixedOperatorKind::ADDITION), - {Matcher::any(0), Matcher::any_integer(1)}), - source_forms.at(0)); - if (mr.matched) { - s64 value = -mr.maps.ints.at(1); - auto value_form = pool.form(SimpleAtom::make_int_constant(value)); - return pool.alloc_element( - GenericOperator::make_fixed(FixedOperatorKind::EQ), - std::vector{mr.maps.forms.at(0), value_form}); - } - } - - auto nice_constant = try_make_constant_from_int_for_compare(0, source_types.at(0), pool, env); - if (nice_constant) { - return pool.alloc_element( - GenericOperator::make_fixed(FixedOperatorKind::EQ), - std::vector{source_forms.at(0), nice_constant}); - } - - /* - auto as_logtest = try_make_nonzero_logtest(source_forms.at(0), pool); - if (as_logtest) { - auto logtest_form = pool.alloc_single_form(nullptr, as_logtest); - auto not_form = pool.alloc_element( - GenericOperator::make_compare(IR2_Condition::Kind::FALSE), logtest_form); - return not_form; - } - */ - - return pool.alloc_element(GenericOperator::make_compare(m_kind), source_forms); -} FormElement* try_make_logtest_cpad_macro(Form* in, FormPool& pool) { /* @@ -4546,6 +4486,68 @@ FormElement* try_make_logtest_cpad_macro(Form* in, FormPool& pool) { } return nullptr; } +} // namespace + +FormElement* ConditionElement::make_zero_check_generic(const Env& env, + FormPool& pool, + const std::vector& source_forms, + const std::vector& source_types) { + // (zero? (+ thing small-integer)) -> (= thing (- small-integer)) + ASSERT(source_forms.size() == 1); + + auto enum_type_info = env.dts->ts.try_enum_lookup(source_types.at(0)); + if (enum_type_info && !enum_type_info->is_bitfield()) { + // (zero? (+ (the-as uint arg0) (the-as uint -2))) check enum value + auto mr = match( + Matcher::op(GenericOpMatcher::fixed(FixedOperatorKind::ADDITION), + {make_int_uint_cast_matcher(Matcher::any(0)), + Matcher::match_or({Matcher::any_integer(1), + make_int_uint_cast_matcher(Matcher::any_integer(1))})}), + source_forms.at(0)); + if (mr.matched) { + s64 value = mr.maps.ints.at(1); + value = -value; + auto enum_constant = cast_to_int_enum(enum_type_info, pool, env, value); + return pool.alloc_element( + GenericOperator::make_fixed(FixedOperatorKind::EQ), + std::vector{mr.maps.forms.at(0), enum_constant}); + } + } + + { + auto mr = match(Matcher::op(GenericOpMatcher::fixed(FixedOperatorKind::ADDITION), + {Matcher::any(0), Matcher::any_integer(1)}), + source_forms.at(0)); + if (mr.matched) { + s64 value = -mr.maps.ints.at(1); + auto value_form = pool.form(SimpleAtom::make_int_constant(value)); + return pool.alloc_element( + GenericOperator::make_fixed(FixedOperatorKind::EQ), + std::vector{mr.maps.forms.at(0), value_form}); + } + } + + auto nice_constant = try_make_constant_from_int_for_compare(0, source_types.at(0), pool, env); + if (nice_constant) { + return pool.alloc_element( + GenericOperator::make_fixed(FixedOperatorKind::EQ), + std::vector{source_forms.at(0), nice_constant}); + } + + auto as_logtest = try_make_nonzero_logtest(source_forms.at(0), pool); + if (as_logtest) { + auto logtest_form = pool.alloc_single_form(nullptr, as_logtest); + auto as_cpad_macro = try_make_logtest_cpad_macro(logtest_form, pool); + if (as_cpad_macro) { + logtest_form = pool.alloc_single_form(nullptr, as_cpad_macro); + } + auto not_form = pool.alloc_element( + GenericOperator::make_compare(IR2_Condition::Kind::FALSE), logtest_form); + return not_form; + } + + return pool.alloc_element(GenericOperator::make_compare(m_kind), source_forms); +} FormElement* ConditionElement::make_nonzero_check_generic(const Env& env, FormPool& pool, @@ -5744,7 +5746,7 @@ void ConditionalMoveFalseElement::push_to_stack(const Env& env, FormPool& pool, Form* val = nullptr; - if (!val && on_zero) { + if (on_zero) { auto as_logtest = try_make_nonzero_logtest(popped.at(1), pool); if (as_logtest) { auto logtest_form = pool.alloc_single_form(nullptr, as_logtest); diff --git a/test/decompiler/reference/jak1/engine/ambient/ambient_REF.gc b/test/decompiler/reference/jak1/engine/ambient/ambient_REF.gc index 5decd98708..2198370975 100644 --- a/test/decompiler/reference/jak1/engine/ambient/ambient_REF.gc +++ b/test/decompiler/reference/jak1/engine/ambient/ambient_REF.gc @@ -231,7 +231,7 @@ ) (and *target* (!= (-> *target* next-state name) 'target-look-around) - (zero? (logand (-> *target* state-flags) (state-flags being-attacked dying))) + (not (logtest? (-> *target* state-flags) (state-flags being-attacked dying))) (= *master-mode* 'game) ) ) diff --git a/test/decompiler/reference/jak1/engine/anim/aligner_REF.gc b/test/decompiler/reference/jak1/engine/anim/aligner_REF.gc index 529c8b5465..6e776246d6 100644 --- a/test/decompiler/reference/jak1/engine/anim/aligner_REF.gc +++ b/test/decompiler/reference/jak1/engine/anim/aligner_REF.gc @@ -129,7 +129,7 @@ ;; definition for method 10 of type align-control (defmethod align! align-control ((obj align-control) (arg0 align-opts) (arg1 float) (arg2 float) (arg3 float)) - (when (zero? (logand (-> obj flags) (align-flags disabled))) + (when (not (logtest? (-> obj flags) (align-flags disabled))) (let* ((a0-1 (-> obj process)) (t9-0 (method-of-object a0-1 apply-alignment)) (v1-4 (-> obj delta)) @@ -161,7 +161,7 @@ ;; definition for method 11 of type align-control (defmethod align-vel-and-quat-only! align-control ((obj align-control) (arg0 align-opts) (arg1 vector) (arg2 int) (arg3 float) (arg4 float)) - (when (zero? (logand (-> obj flags) (align-flags disabled))) + (when (not (logtest? (-> obj flags) (align-flags disabled))) (let ((s5-0 (-> obj delta))) (let ((s3-0 (-> obj process root transv))) (if (logtest? arg0 (align-opts adjust-y-vel)) diff --git a/test/decompiler/reference/jak1/engine/anim/joint_REF.gc b/test/decompiler/reference/jak1/engine/anim/joint_REF.gc index 1999e4451b..814afae408 100644 --- a/test/decompiler/reference/jak1/engine/anim/joint_REF.gc +++ b/test/decompiler/reference/jak1/engine/anim/joint_REF.gc @@ -976,7 +976,7 @@ (v0-0 (the-as object (-> arg0 data arg2 data))) ) (cond - ((zero? (logand (-> arg0 fixed hdr matrix-bits) 1)) + ((not (logtest? (-> arg0 fixed hdr matrix-bits) 1)) (set! v1-1 (cond ((zero? arg1) (return (the-as matrix v1-1)) @@ -995,7 +995,7 @@ (set! v0-0 (-> (the-as (inline-array vector) v0-0) 4)) ) ) - (if (zero? (logand (-> arg0 fixed hdr matrix-bits) 2)) + (if (not (logtest? (-> arg0 fixed hdr matrix-bits) 2)) (return (the-as matrix v1-1)) ) (the-as matrix v0-0) diff --git a/test/decompiler/reference/jak1/engine/camera/cam-combiner_REF.gc b/test/decompiler/reference/jak1/engine/camera/cam-combiner_REF.gc index 4322eb95a6..4e5940d44d 100644 --- a/test/decompiler/reference/jak1/engine/camera/cam-combiner_REF.gc +++ b/test/decompiler/reference/jak1/engine/camera/cam-combiner_REF.gc @@ -163,7 +163,7 @@ :code (behavior () (local-vars (sv-160 cam-rotation-tracker)) (loop - (when (and (zero? (logand (-> *camera* master-options) 2)) (!= (-> self tracking-status) 0)) + (when (and (not (logtest? (-> *camera* master-options) 2)) (!= (-> self tracking-status) 0)) (set! (-> self tracking-status) (the-as uint 0)) 0 ) diff --git a/test/decompiler/reference/jak1/engine/camera/cam-layout_REF.gc b/test/decompiler/reference/jak1/engine/camera/cam-layout_REF.gc index f29a75da33..08a6442c14 100644 --- a/test/decompiler/reference/jak1/engine/camera/cam-layout_REF.gc +++ b/test/decompiler/reference/jak1/engine/camera/cam-layout_REF.gc @@ -2609,7 +2609,7 @@ ) (format arg0 ": on") ) - ((zero? (logand ((method-of-type res-lump get-property-value) + ((not (logtest? ((method-of-type res-lump get-property-value) (-> self cam-entity) (the-as symbol arg2) 'exact @@ -2620,7 +2620,7 @@ ) s5-0 ) - ) + ) (format arg0 ": off(maya)") ) (else @@ -3558,13 +3558,13 @@ ((and (logtest? (-> arg0 options) 8) (logtest? (-> *cpad-list* cpads 0 button0-abs 0) (-> arg0 button))) #f ) - ((and (zero? (logand (-> arg0 options) 12)) + ((and (not (logtest? (-> arg0 options) 12)) (logtest? (-> arg0 options) 1) (zero? (logand (-> *cpad-list* cpads 0 button0-rel 0) (-> arg0 button))) ) #f ) - ((and (zero? (logand (-> arg0 options) 13)) + ((and (not (logtest? (-> arg0 options) 13)) (zero? (logand (-> *cpad-list* cpads 0 button0-abs 0) (-> arg0 button))) ) #f diff --git a/test/decompiler/reference/jak1/engine/camera/cam-master_REF.gc b/test/decompiler/reference/jak1/engine/camera/cam-master_REF.gc index ef03a8c91d..837fdca534 100644 --- a/test/decompiler/reference/jak1/engine/camera/cam-master_REF.gc +++ b/test/decompiler/reference/jak1/engine/camera/cam-master_REF.gc @@ -96,7 +96,7 @@ (else (set! (-> self attack-start) (-> *display* base-frame-counter)) (set! (-> self being-attacked) #t) - (when (and (zero? (logand (-> self master-options) 64)) + (when (and (not (logtest? (-> self master-options) 64)) (or (!= (-> last-try-to-look-at-data horz) 0.0) (!= (-> last-try-to-look-at-data vert) 0.0)) ) (set! (-> self string-max target y) (fmax (-> self string-max target y) (-> last-try-to-look-at-data vert))) @@ -326,7 +326,7 @@ (set! (-> self attack-start) (-> *display* base-frame-counter)) ) (set! (-> self being-attacked) #t) - (when (and (zero? (logand (-> self master-options) 64)) + (when (and (not (logtest? (-> self master-options) 64)) (or (!= (-> last-try-to-look-at-data horz) 0.0) (!= (-> last-try-to-look-at-data vert) 0.0)) ) (set! (-> self string-max target y) (fmax (-> self string-max target y) (-> last-try-to-look-at-data vert))) @@ -488,7 +488,7 @@ ) ) ) - (if (zero? (logand (-> self slave-options) 16)) + (if (not (logtest? (-> self slave-options) 16)) (reset-follow) ) (let ((v1-196 (-> *target* water flags))) diff --git a/test/decompiler/reference/jak1/engine/camera/cam-states-dbg_REF.gc b/test/decompiler/reference/jak1/engine/camera/cam-states-dbg_REF.gc index a90c4e5b41..df3b2cd1b2 100644 --- a/test/decompiler/reference/jak1/engine/camera/cam-states-dbg_REF.gc +++ b/test/decompiler/reference/jak1/engine/camera/cam-states-dbg_REF.gc @@ -311,8 +311,8 @@ ) (when *display-load-boundaries* (when (and (!= arg3 1) - (zero? (logand (-> *cpad-list* cpads 1 button0-abs 0) (pad-buttons x))) - (zero? (logand (-> *cpad-list* cpads 1 button0-abs 0) (pad-buttons r1))) + (not (cpad-hold? 1 x)) + (not (cpad-hold? 1 r1)) (zero? (logand (-> *cpad-list* cpads 1 button0-abs 0) (pad-buttons r2))) ) (+! f28-14 (analog-input (the-as int (-> *cpad-list* cpads 1 leftx)) 128.0 48.0 110.0 -1.0)) diff --git a/test/decompiler/reference/jak1/engine/camera/cam-states_REF.gc b/test/decompiler/reference/jak1/engine/camera/cam-states_REF.gc index cd8aed9473..b25e2358e5 100644 --- a/test/decompiler/reference/jak1/engine/camera/cam-states_REF.gc +++ b/test/decompiler/reference/jak1/engine/camera/cam-states_REF.gc @@ -329,7 +329,7 @@ (none) ) :trans (behavior () - (if (zero? (logand (-> *camera* master-options) 2)) + (if (not (logtest? (-> *camera* master-options) 2)) (cam-slave-go cam-free-floating) ) (none) @@ -454,7 +454,7 @@ (none) ) :trans (behavior () - (if (zero? (logand (-> *camera* master-options) 2)) + (if (not (logtest? (-> *camera* master-options) 2)) (go cam-free-floating) ) (none) @@ -516,7 +516,7 @@ ) (matrix-axis-angle! s5-0 (-> *camera* local-down) (-> s4-0 y)) (matrix*! (the-as matrix (-> self tracking)) (the-as matrix (-> self tracking)) s5-0) - (when (zero? (logand (-> self options) 8)) + (when (not (logtest? (-> self options) 8)) (if (< (vector-dot (-> self tracking inv-mat vector 1) (-> *camera* local-down)) 0.0) (forward-down->inv-matrix (the-as matrix (-> self tracking)) @@ -533,7 +533,7 @@ (matrix-axis-angle! s5-0 (the-as vector (-> self tracking)) (- (-> s4-0 x))) (matrix*! (the-as matrix (-> self tracking)) (the-as matrix (-> self tracking)) s5-0) ) - (when (zero? (logand (-> self options) 8)) + (when (not (logtest? (-> self options) 8)) (let ((f30-1 (vector-dot (-> *camera* local-down) (-> self tracking inv-mat vector 2)))) (set! (-> (new 'stack-no-clear 'vector) quad) (the-as uint128 0)) (when (< (sin (-> *CAM_EYE-bank* max-degrees)) (fabs f30-1)) @@ -629,7 +629,7 @@ (none) ) :trans (behavior () - (if (zero? (logand (-> *camera* master-options) 2)) + (if (not (logtest? (-> *camera* master-options) 2)) (go cam-free-floating) ) (none) @@ -799,7 +799,7 @@ (none) ) :trans (behavior () - (if (zero? (logand (-> *camera* master-options) 2)) + (if (not (logtest? (-> *camera* master-options) 2)) (cam-slave-go cam-free-floating) ) (none) @@ -1043,7 +1043,7 @@ (vector-! gp-0 (-> self pivot-pt) (-> self circular-follow)) ) (vector-! s5-0 (-> self trans) (-> self pivot-pt)) - (when (zero? (logand (-> self options) 4)) + (when (not (logtest? (-> self options) 4)) (vector-flatten! gp-0 gp-0 (-> *camera* local-down)) (vector-flatten! s5-0 s5-0 (-> *camera* local-down)) ) @@ -1194,7 +1194,7 @@ (none) ) :trans (behavior () - (if (zero? (logand (-> *camera* master-options) 2)) + (if (not (logtest? (-> *camera* master-options) 2)) (cam-slave-go cam-free-floating) ) (none) @@ -1221,7 +1221,7 @@ (none) ) :trans (behavior () - (if (zero? (logand (-> *camera* master-options) 2)) + (if (not (logtest? (-> *camera* master-options) 2)) (cam-slave-go cam-free-floating) ) (none) @@ -2190,7 +2190,7 @@ (cam-los-setup-lateral arg2 s4-1 arg1) ) (cond - ((zero? (logand (-> self options) 1024)) + ((not (logtest? (-> self options) 1024)) ) ((= (-> self string-vel-dir) 5) ) @@ -3014,7 +3014,7 @@ (none) ) :trans (behavior () - (if (zero? (logand (-> *camera* master-options) 2)) + (if (not (logtest? (-> *camera* master-options) 2)) (cam-slave-go cam-free-floating) ) (none) @@ -3188,7 +3188,7 @@ (none) ) :trans (behavior () - (if (zero? (logand (-> *camera* master-options) 2)) + (if (not (logtest? (-> *camera* master-options) 2)) (cam-slave-go cam-free-floating) ) (when (not (paused?)) @@ -3437,7 +3437,7 @@ (none) ) :trans (behavior () - (if (zero? (logand (-> *camera* master-options) 2)) + (if (not (logtest? (-> *camera* master-options) 2)) (cam-slave-go cam-free-floating) ) (none) diff --git a/test/decompiler/reference/jak1/engine/camera/camera_REF.gc b/test/decompiler/reference/jak1/engine/camera/camera_REF.gc index 203836803b..9065cc5b66 100644 --- a/test/decompiler/reference/jak1/engine/camera/camera_REF.gc +++ b/test/decompiler/reference/jak1/engine/camera/camera_REF.gc @@ -924,7 +924,7 @@ ) (set! (-> obj free-point) -134250495) (dotimes (v1-21 32) - (when (zero? (logand s5-0 1)) + (when (not (logtest? s5-0 1)) (set! (-> obj point v1-21 next) (-> obj free-point)) (set! (-> obj free-point) v1-21) ) diff --git a/test/decompiler/reference/jak1/engine/collide/collide-reaction-target_REF.gc b/test/decompiler/reference/jak1/engine/collide/collide-reaction-target_REF.gc index e8f444e362..fe69ebec43 100644 --- a/test/decompiler/reference/jak1/engine/collide/collide-reaction-target_REF.gc +++ b/test/decompiler/reference/jak1/engine/collide/collide-reaction-target_REF.gc @@ -162,7 +162,7 @@ (set! (-> arg0 unknown-vector-coverage-1 quad) (-> sv-164 normal quad)) 0 ) - (when (and (zero? (logand sv-32 512)) + (when (and (not (logtest? sv-32 512)) (and (or (< (* 1.25 (-> arg1 best-from-prim local-sphere w)) (-> arg0 unknown-float-coverage-0)) (= (shr (shl (the-as int (-> arg0 unknown-float-coverage-1)) 58) 61) 1) ) @@ -187,7 +187,7 @@ ) ) ) - (if (or (zero? (logand sv-32 32)) (< 0.5 f0-21)) + (if (or (not (logtest? sv-32 32)) (< 0.5 f0-21)) (set! sv-48 (the-as symbol #f)) ) (when (and (or (and (< f0-21 0.95) (>= f30-0 0.0)) @@ -311,7 +311,7 @@ (& sv-160) ) ) - (when (zero? (logand (-> arg0 prev-status) (cshape-moving-flags onsurf))) + (when (not (logtest? (-> arg0 prev-status) (cshape-moving-flags onsurf))) (set! (-> arg0 ground-impact-vel) (- (vector-dot (-> arg0 transv) (-> arg0 dynam gravity-normal)))) (set! sv-96 (logior sv-96 2048)) (when (not sv-160) diff --git a/test/decompiler/reference/jak1/engine/debug/anim-tester_REF.gc b/test/decompiler/reference/jak1/engine/debug/anim-tester_REF.gc index 0b6a24d1a0..b15c6da81e 100644 --- a/test/decompiler/reference/jak1/engine/debug/anim-tester_REF.gc +++ b/test/decompiler/reference/jak1/engine/debug/anim-tester_REF.gc @@ -867,7 +867,7 @@ (let ((v1-1 (the-as anim-test-sequence s5-0))) "return the next node in the list" (let ((s4-0 (-> v1-1 next))) - (when (zero? (logand (-> (the-as anim-test-sequence s5-0) flags) 2)) + (when (not (logtest? (-> (the-as anim-test-sequence s5-0) flags) 2)) (let ((v1-5 (-> (the-as anim-test-sequence s5-0) item-list))) "return the start of the list" (let ((s3-0 (the-as anim-test-seq-item (-> v1-5 head)))) @@ -878,7 +878,7 @@ (let ((v1-6 s3-0)) "return the next node in the list" (let ((s2-0 (the-as anim-test-seq-item (-> v1-6 next)))) - (if (and (zero? (logand (-> s3-0 flags) 1)) (not (anim-test-obj-item-valid? arg0 s3-0))) + (if (and (not (logtest? (-> s3-0 flags) 1)) (not (anim-test-obj-item-valid? arg0 s3-0))) (glst-remove (-> (the-as anim-test-sequence s5-0) item-list) s3-0) ) (set! s3-0 s2-0) @@ -1328,7 +1328,7 @@ (goto cfg-25) ) ) - (when (zero? (logand (-> (the-as anim-test-obj v1-17) flags) 1)) + (when (not (logtest? (-> (the-as anim-test-obj v1-17) flags) 1)) (set! (-> arg1 highlight-index) (glst-get-node-index (-> arg1 list) (the-as anim-test-obj v1-17))) (goto cfg-25) ) @@ -1352,7 +1352,7 @@ (goto cfg-39) ) ) - (when (zero? (logand (-> (the-as anim-test-obj v1-23) flags) 1)) + (when (not (logtest? (-> (the-as anim-test-obj v1-23) flags) 1)) (set! (-> arg1 highlight-index) (glst-get-node-index (-> arg1 list) (the-as anim-test-obj v1-23))) (goto cfg-39) ) @@ -1838,7 +1838,7 @@ (let* ((s2-2 (-> *display* frames (-> *display* on-screen) frame debug-buf)) (s4-1 (the-as anim-test-sequence (-> s2-2 base))) ) - (when (zero? (logand (-> (the-as anim-test-seq-item gp-0) flags) 1)) + (when (not (logtest? (-> (the-as anim-test-seq-item gp-0) flags) 1)) (let ((v1-57 s3-0) (a1-13 (+ (-> arg1 xpos) (* (-> *ANIM_TESTER-bank* EDIT_STATS_X) (-> *DISP_LIST-bank* CHAR_WIDTH)))) (a0-29 (-> arg1 ypos)) @@ -1972,7 +1972,7 @@ ) ((= v1-88 9) (cond - ((zero? (logand (-> *cpad-list* cpads 0 button0-abs 0) (pad-buttons x))) + ((not (cpad-hold? 0 x)) (logclear! (-> *anim-tester* 0 flags) (anim-tester-flags fanimt3)) ) ((cpad-pressed? 0 up) @@ -2015,7 +2015,7 @@ ) ((or (= v1-88 1) (= v1-88 2) (= v1-88 3) (= v1-88 4)) (cond - ((zero? (logand (-> *cpad-list* cpads 0 button0-abs 0) (pad-buttons x))) + ((not (cpad-hold? 0 x)) (logclear! (-> *anim-tester* 0 flags) (anim-tester-flags fanimt3)) ) ((begin (set! (-> arg1 current-index) (-> arg1 the-index)) (<= (-> *anim-tester* 0 inc-timer) 0)) @@ -2156,14 +2156,14 @@ (anim-test-edit-seq-insert-item (the-as anim-test-seq-item gp-0) (the-as anim-test-sequence s4-0)) ) ((= v1-322 11) - (when (zero? (logand (-> (the-as anim-test-seq-item gp-0) flags) 1)) + (when (not (logtest? (-> (the-as anim-test-seq-item gp-0) flags) 1)) (anim-test-seq-mark-as-edited (the-as anim-test-sequence s4-0)) (glst-remove (-> (the-as anim-test-sequence s4-0) item-list) (the-as anim-test-seq-item gp-0)) ) (send-event (ppointer->process *anim-tester*) 'change-anim) ) (else - (when (zero? (logand (-> (the-as anim-test-seq-item gp-0) flags) 4)) + (when (not (logtest? (-> (the-as anim-test-seq-item gp-0) flags) 4)) (case (-> *anim-tester* 0 item-field) ((5) (anim-test-seq-mark-as-edited (the-as anim-test-sequence s4-0)) @@ -2481,7 +2481,7 @@ (none) ) :trans (behavior () - (if (and (zero? (logand (-> self flags) (anim-tester-flags fanimt1))) (= *master-mode* 'menu)) + (if (and (not (logtest? (-> self flags) (anim-tester-flags fanimt1))) (= *master-mode* 'menu)) (anim-tester-interface) ) (logclear! (-> self flags) (anim-tester-flags fanimt1)) @@ -2756,7 +2756,7 @@ "is this node the end of the list. #t = end" (not (not (-> v1-21 next))) ) - (when (zero? (logand (-> s4-2 flags) 5)) + (when (not (logtest? (-> s4-2 flags) 5)) (format gp-2 " Item \"~S\" ~d ~d " (-> s4-2 privname) (-> s4-2 speed) (-> s4-2 blend)) (anim-tester-num-print gp-2 (-> s4-2 first-frame)) (format gp-2 " ") diff --git a/test/decompiler/reference/jak1/engine/debug/menu_REF.gc b/test/decompiler/reference/jak1/engine/debug/menu_REF.gc index edc9ed4064..912e0346ed 100644 --- a/test/decompiler/reference/jak1/engine/debug/menu_REF.gc +++ b/test/decompiler/reference/jak1/engine/debug/menu_REF.gc @@ -1372,7 +1372,7 @@ ;; definition for function debug-menu-item-var-joypad-handler (defun debug-menu-item-var-joypad-handler ((arg0 debug-menu-item-var)) (cond - ((zero? (logand (-> *cpad-list* cpads 0 button0-abs 0) (pad-buttons x))) + ((not (cpad-hold? 0 x)) (let ((a0-1 (-> arg0 parent context))) (debug-menu-context-release-joypad a0-1) ) diff --git a/test/decompiler/reference/jak1/engine/draw/drawable-tree_REF.gc b/test/decompiler/reference/jak1/engine/draw/drawable-tree_REF.gc index 048e742a11..e41efe0608 100644 --- a/test/decompiler/reference/jak1/engine/draw/drawable-tree_REF.gc +++ b/test/decompiler/reference/jak1/engine/draw/drawable-tree_REF.gc @@ -72,7 +72,7 @@ (set! t1-6 (&-> t1-6 1)) (let ((t4-0 128)) (label cfg-7) - (b! (zero? (logand t3-0 t4-0)) cfg-9 :delay (set! t5-1 (-> arg1 0))) + (b! (not (logtest? t3-0 t4-0)) cfg-9 :delay (set! t5-1 (-> arg1 0))) (set! arg1 (&-> arg1 1)) (set! (-> t2-3 0) t5-1) (label cfg-9) diff --git a/test/decompiler/reference/jak1/engine/draw/drawable_REF.gc b/test/decompiler/reference/jak1/engine/draw/drawable_REF.gc index 9997437733..f36c4f6cc1 100644 --- a/test/decompiler/reference/jak1/engine/draw/drawable_REF.gc +++ b/test/decompiler/reference/jak1/engine/draw/drawable_REF.gc @@ -128,7 +128,7 @@ (.mov a0-1 vf10) (.pcgtw a0-2 0 a0-1) (.ppach a0-3 (the-as uint128 0) a0-2) - (zero? (logand (the-as int v1-3) (the-as int a0-3))) + (not (logtest? (the-as int v1-3) (the-as int a0-3))) ) ) @@ -577,7 +577,7 @@ (init-vf0-vector) (set! sv-16 arg0) (logclear! (-> arg1 status) (draw-status was-drawn)) - (when (zero? (logand (-> arg1 status) (draw-status hidden no-anim no-skeleton-update))) + (when (not (logtest? (-> arg1 status) (draw-status hidden no-anim no-skeleton-update))) (let ((s4-0 (-> (the-as terrain-context #x70000000) work foreground joint-work temp-mtx vector 2)) (vu-lgt (the-as vu-lights (-> (the-as terrain-context #x70000000) work foreground joint-work temp-mtx vector 3)) @@ -772,7 +772,7 @@ (let ((v1-64 (-> arg1 sink-group level)) (a0-26 (+ (-> arg1 sink-group merc-sink foreground-texture-page) 6)) ) - (when (zero? (logand (-> arg1 status) (draw-status do-not-check-distance))) + (when (not (logtest? (-> arg1 status) (draw-status do-not-check-distance))) (if (< cam-dist (-> v1-64 closest-object a0-26)) (set! (-> v1-64 closest-object a0-26) cam-dist) ) @@ -852,7 +852,7 @@ ;; INFO: Return type mismatch int vs none. (defun dma-add-process-drawable-hud ((arg0 process-drawable) (arg1 draw-control) (arg2 symbol) (arg3 dma-buffer)) (logclear! (-> arg1 status) (draw-status was-drawn)) - (when (zero? (logand (-> arg1 status) (draw-status hidden no-anim no-skeleton-update))) + (when (not (logtest? (-> arg1 status) (draw-status hidden no-anim no-skeleton-update))) (let ((v1-6 (the-as vu-lights (+ 64 #x70000000))) (a0-3 *hud-lights*) ) @@ -1077,7 +1077,7 @@ ) ) ) - (when (zero? (logand *vu1-enable-user* (vu1-renderer-mask sky))) + (when (not (logtest? *vu1-enable-user* (vu1-renderer-mask sky))) (let* ((s5-2 (-> *display* frames (-> *display* on-screen) frame global-buf)) (gp-6 (-> s5-2 base)) ) diff --git a/test/decompiler/reference/jak1/engine/draw/process-drawable_REF.gc b/test/decompiler/reference/jak1/engine/draw/process-drawable_REF.gc index 31a3a275b3..82dcaa9d70 100644 --- a/test/decompiler/reference/jak1/engine/draw/process-drawable_REF.gc +++ b/test/decompiler/reference/jak1/engine/draw/process-drawable_REF.gc @@ -498,7 +498,7 @@ (let ((s0-0 (-> s4-0 data v1-28)) (v1-32 (res-lump-value (-> obj entity) 'options uint128)) ) - (if (and (zero? (logand #x20000 v1-32)) (= (-> s0-0 type) shadow-geo)) + (if (and (not (logtest? #x20000 v1-32)) (= (-> s0-0 type) shadow-geo)) (set! (-> s3-0 shadow) (the-as shadow-geo s0-0)) ) ) @@ -620,7 +620,7 @@ (* (-> grav-rt-body x) (-> *display* seconds-per-frame)) ) ) - (if (zero? (logand arg0 (align-opts adjust-xz-vel keep-other-velocities))) + (if (not (logtest? arg0 (align-opts adjust-xz-vel keep-other-velocities))) (set! (-> vel-rt-body z) 0.0) ) ) @@ -637,7 +637,7 @@ (* (-> grav-rt-body z) (-> *display* seconds-per-frame)) ) ) - (if (zero? (logand arg0 (align-opts adjust-x-vel keep-other-velocities))) + (if (not (logtest? arg0 (align-opts adjust-x-vel keep-other-velocities))) (set! (-> vel-rt-body x) 0.0) ) ) diff --git a/test/decompiler/reference/jak1/engine/entity/entity_REF.gc b/test/decompiler/reference/jak1/engine/entity/entity_REF.gc index 84101b40dc..efc56ee33d 100644 --- a/test/decompiler/reference/jak1/engine/entity/entity_REF.gc +++ b/test/decompiler/reference/jak1/engine/entity/entity_REF.gc @@ -327,7 +327,7 @@ ) (let ((s5-1 format) (s4-0 "~C~C~C") - (a2-0 (if (and arg0 (zero? (logand (-> *kernel-context* prevent-from-run) (-> arg0 mask))) (run-logic? arg0)) + (a2-0 (if (and arg0 (not (logtest? (-> *kernel-context* prevent-from-run) (-> arg0 mask))) (run-logic? arg0)) 114 32 ) @@ -1498,7 +1498,7 @@ ) ) ) - (when (zero? (logand (-> obj status) (entity-perm-status user-set-from-cstage))) + (when (not (logtest? (-> obj status) (entity-perm-status user-set-from-cstage))) (set! (-> obj user-uint64) (the-as uint 0)) 0 ) @@ -1589,7 +1589,7 @@ ;; definition for method 12 of type process-drawable (defmethod run-logic? process-drawable ((obj process-drawable)) - (or (zero? (logand (-> obj mask) (process-mask actor-pause))) + (or (not (logtest? (-> obj mask) (process-mask actor-pause))) (or (>= (+ (-> *ACTOR-bank* pause-dist) (-> obj root pause-adjust-distance)) (vector-vector-distance (-> obj root trans) (math-camera-pos)) ) @@ -1601,7 +1601,7 @@ ;; definition for method 9 of type entity-links (defmethod birth? entity-links ((obj entity-links) (arg0 vector)) - (and (zero? (logand (-> obj perm status) (entity-perm-status bit-0 dead))) + (and (not (logtest? (-> obj perm status) (entity-perm-status bit-0 dead))) (< (vector-vector-distance (-> obj trans) arg0) (-> *ACTOR-bank* birth-dist)) ) ) diff --git a/test/decompiler/reference/jak1/engine/game/collectables-part_REF.gc b/test/decompiler/reference/jak1/engine/game/collectables-part_REF.gc index c898fe25ad..ad86fdc381 100644 --- a/test/decompiler/reference/jak1/engine/game/collectables-part_REF.gc +++ b/test/decompiler/reference/jak1/engine/game/collectables-part_REF.gc @@ -4,8 +4,8 @@ ;; definition for function eco-fadeout ;; INFO: Return type mismatch int vs none. (defun eco-fadeout ((arg0 sparticle-system) (arg1 sparticle-cpuinfo)) - (if (zero? (logand (-> (the-as process-drawable (-> arg1 key proc)) state-flags) (state-flags fade-out-particles)) - ) + (if (not (logtest? (-> (the-as process-drawable (-> arg1 key proc)) state-flags) (state-flags fade-out-particles)) + ) (set! (-> arg1 next-time) (the-as uint (* (-> *sp-frame-time* x) 2))) ) 0 @@ -21,7 +21,7 @@ (set! (-> arg2 y) (-> a0-3 world-sphere y)) (set! (-> arg2 z) (-> a0-3 world-sphere z)) ) - (if (zero? (logand (-> v1-1 state-flags) (state-flags fade-out-particles))) + (if (not (logtest? (-> v1-1 state-flags) (state-flags fade-out-particles))) (set! (-> arg1 next-time) (the-as uint (* (-> *sp-frame-time* x) 2))) ) ) diff --git a/test/decompiler/reference/jak1/engine/game/collectables_REF.gc b/test/decompiler/reference/jak1/engine/game/collectables_REF.gc index e9487c12cd..0761f30b58 100644 --- a/test/decompiler/reference/jak1/engine/game/collectables_REF.gc +++ b/test/decompiler/reference/jak1/engine/game/collectables_REF.gc @@ -503,7 +503,7 @@ object (cond ((= arg2 'eco-blue) - (when (and (zero? (logand (-> self flags) (collectable-flags fading ignore-blue))) + (when (and (not (logtest? (-> self flags) (collectable-flags fading ignore-blue))) (!= (-> self next-state name) 'pickup) (begin (check-blue-suck (the-as process-drawable arg0)) #t) (logtest? (-> self flags) (collectable-flags can-collect)) @@ -1213,7 +1213,7 @@ ;; definition for method 12 of type money (defmethod run-logic? money ((obj money)) - (or (zero? (logand (-> obj mask) (process-mask actor-pause))) + (or (not (logtest? (-> obj mask) (process-mask actor-pause))) (or (and (nonzero? (-> obj draw)) (logtest? (-> obj draw status) (draw-status was-drawn)) (>= (+ (-> *ACTOR-bank* pause-dist) (-> obj root-override pause-adjust-distance)) @@ -2183,10 +2183,10 @@ (go-virtual jump) ) ((and gp-1 - (zero? (logand (res-lump-value (-> self entity) 'options fact-options :time (the-as float -1000000000.0)) + (not (logtest? (res-lump-value (-> self entity) 'options fact-options :time (the-as float -1000000000.0)) (fact-options skip-jump-anim) ) - ) + ) (zero? (logand (-> self fact options) (fact-options skip-jump-anim))) ) (set! (-> self jump-pos quad) (-> (the-as vector gp-1) quad)) diff --git a/test/decompiler/reference/jak1/engine/game/game-info_REF.gc b/test/decompiler/reference/jak1/engine/game/game-info_REF.gc index d348793b99..b2dc7906a7 100644 --- a/test/decompiler/reference/jak1/engine/game/game-info_REF.gc +++ b/test/decompiler/reference/jak1/engine/game/game-info_REF.gc @@ -350,7 +350,7 @@ (buzz-bits (get-reminder ctrl 0)) ) (when (and (>= buzz-index 0) (< buzz-index (the int (-> *FACT-bank* buzzer-max-default)))) - (if (zero? (logand buzz-bits (ash 1 buzz-index))) + (if (not (logtest? buzz-bits (ash 1 buzz-index))) (set! (-> obj buzzer-total) (+ 1.0 (-> obj buzzer-total))) ) (let ((t9-10 (method-of-object ctrl save-reminder))) diff --git a/test/decompiler/reference/jak1/engine/game/generic-obs_REF.gc b/test/decompiler/reference/jak1/engine/game/generic-obs_REF.gc index 2100b0defb..64717b1de5 100644 --- a/test/decompiler/reference/jak1/engine/game/generic-obs_REF.gc +++ b/test/decompiler/reference/jak1/engine/game/generic-obs_REF.gc @@ -903,7 +903,7 @@ (send-event gp-0 'query 'done) ) ((type-type? (-> gp-0 type) process-drawable) - (when (zero? (logand (-> (the-as process-drawable gp-0) skel status) (janim-status done))) + (when (not (logtest? (-> (the-as process-drawable gp-0) skel status) (janim-status done))) (let ((s5-0 pp)) (set! pp gp-0) (let ((v0-1 (the-as object (ja-done? 0)))) @@ -1323,7 +1323,7 @@ ) ) ) - (when (zero? (logand (-> self draw status) (draw-status hidden))) + (when (not (logtest? (-> self draw status) (draw-status hidden))) (let ((v1-36 (-> self draw)) (a0-18 (new 'stack-no-clear 'vector)) ) @@ -1859,7 +1859,7 @@ (none) ) :trans (behavior () - (if (zero? (logand (-> *camera* master-options) 2)) + (if (not (logtest? (-> *camera* master-options) 2)) (cam-slave-go cam-free-floating) ) (none) @@ -1925,7 +1925,7 @@ (none) ) :trans (behavior () - (if (zero? (logand (-> *camera* master-options) 2)) + (if (not (logtest? (-> *camera* master-options) 2)) (cam-slave-go cam-free-floating) ) (cam-launcher-long-joystick) diff --git a/test/decompiler/reference/jak1/engine/game/powerups_REF.gc b/test/decompiler/reference/jak1/engine/game/powerups_REF.gc index 1ac340569c..3c2a0fb7a3 100644 --- a/test/decompiler/reference/jak1/engine/game/powerups_REF.gc +++ b/test/decompiler/reference/jak1/engine/game/powerups_REF.gc @@ -664,8 +664,8 @@ (stop! (-> self sound)) ) (when (and (< 0.0 (-> self fact-info-target eco-level)) - (zero? (logand (-> self state-flags) (state-flags first-person-mode))) - (zero? (logand (-> self draw status) (draw-status hidden no-anim))) + (not (logtest? (-> self state-flags) (state-flags first-person-mode))) + (not (logtest? (-> self draw status) (draw-status hidden no-anim))) (not (movie?)) (rand-vu-percent? (lerp-scale diff --git a/test/decompiler/reference/jak1/engine/game/projectiles_REF.gc b/test/decompiler/reference/jak1/engine/game/projectiles_REF.gc index 4d8b355b79..deb9370b18 100644 --- a/test/decompiler/reference/jak1/engine/game/projectiles_REF.gc +++ b/test/decompiler/reference/jak1/engine/game/projectiles_REF.gc @@ -159,7 +159,7 @@ (set! sv-80 (logior sv-80 16)) ) (set! sv-224 (< (fabs (-> arg0 surface-angle)) (-> *pat-mode-info* (-> arg0 cur-pat mode) wall-angle))) - (if (zero? (logand (-> arg0 prev-status) (cshape-moving-flags onsurf))) + (if (not (logtest? (-> arg0 prev-status) (cshape-moving-flags onsurf))) (set! (-> arg0 ground-impact-vel) (- (vector-dot (-> arg0 transv) (-> arg0 dynam gravity-normal)))) ) (set! sv-80 (logior sv-80 4)) @@ -982,7 +982,7 @@ ) (sound-play "yellow-fire") (set! (-> obj sound-id) (sound-play "yellow-buzz")) - (if (zero? (logand (-> obj options) 416)) + (if (not (logtest? (-> obj options) 416)) (process-spawn part-tracker :init part-tracker-init (-> *part-group-id-table* 103) -1 #f #f #f s5-0 :to obj) ) (set! (-> *part-id-table* 350 init-specs 2 initial-valuef) f30-0) @@ -1002,7 +1002,7 @@ (logior! (-> obj root-override root-prim collide-with) (collide-kind water)) ) (('ogre) - (when (zero? (logand (-> obj options) 128)) + (when (not (logtest? (-> obj options) 128)) (set! (-> obj water) (new 'process 'water-control obj 0 0.0 8192.0 2048.0)) (set! (-> obj water flags) (water-flags wt01 wt04 wt07)) (set! (-> obj water height) 129024.0) diff --git a/test/decompiler/reference/jak1/engine/game/settings_REF.gc b/test/decompiler/reference/jak1/engine/game/settings_REF.gc index ef48fb637a..e38d57ddd3 100644 --- a/test/decompiler/reference/jak1/engine/game/settings_REF.gc +++ b/test/decompiler/reference/jak1/engine/game/settings_REF.gc @@ -34,7 +34,7 @@ ) ) (('sfx-volume) - (when (or (zero? (logand (-> *kernel-context* prevent-from-run) (process-mask progress))) + (when (or (not (logtest? (-> *kernel-context* prevent-from-run) (process-mask progress))) (= (get-process conn) (ppointer->process *progress-process*)) ) (case (the-as symbol (-> conn param1)) diff --git a/test/decompiler/reference/jak1/engine/game/task/process-taskable_REF.gc b/test/decompiler/reference/jak1/engine/game/task/process-taskable_REF.gc index d21a0dff12..5838ba29e6 100644 --- a/test/decompiler/reference/jak1/engine/game/task/process-taskable_REF.gc +++ b/test/decompiler/reference/jak1/engine/game/task/process-taskable_REF.gc @@ -1205,7 +1205,7 @@ ) ) ) - ((zero? (logand (-> arg3 param 0) 7)) + ((not (logtest? (-> arg3 param 0) 7)) (set! v0-0 (-> arg3 param 0)) (set! (-> self cam-joint-index) (the-as int v0-0)) v0-0 diff --git a/test/decompiler/reference/jak1/engine/game/voicebox_REF.gc b/test/decompiler/reference/jak1/engine/game/voicebox_REF.gc index 16c0298056..3d7c50b61d 100644 --- a/test/decompiler/reference/jak1/engine/game/voicebox_REF.gc +++ b/test/decompiler/reference/jak1/engine/game/voicebox_REF.gc @@ -240,7 +240,7 @@ :event (-> cam-string event) :enter (-> cam-string enter) :trans (behavior () - (if (zero? (logand (-> *camera* master-options) 2)) + (if (not (logtest? (-> *camera* master-options) 2)) (deactivate self) ) (none) diff --git a/test/decompiler/reference/jak1/engine/gfx/generic/generic-merc_REF.gc b/test/decompiler/reference/jak1/engine/gfx/generic/generic-merc_REF.gc index 04ded3ef5b..8da1aefdff 100644 --- a/test/decompiler/reference/jak1/engine/gfx/generic/generic-merc_REF.gc +++ b/test/decompiler/reference/jak1/engine/gfx/generic/generic-merc_REF.gc @@ -152,7 +152,7 @@ (let ((v1-36 (the-as object #x1000d000)) (a0-19 (the-as object #x7000006c)) ) - (b! (zero? (logand (-> (the-as terrain-context v1-36) bsp lev-index) 256)) cfg-9 :delay (nop!)) + (b! (not (logtest? (-> (the-as terrain-context v1-36) bsp lev-index) 256)) cfg-9 :delay (nop!)) (let ((a1-6 (-> (the-as generic-envmap-saves a0-19) index-mask x))) (nop!) (let ((a2-1 (-> (the-as (pointer int32) v1-36) 0))) diff --git a/test/decompiler/reference/jak1/engine/gfx/hw/display_REF.gc b/test/decompiler/reference/jak1/engine/gfx/hw/display_REF.gc index 443f503617..59f337a9c3 100644 --- a/test/decompiler/reference/jak1/engine/gfx/hw/display_REF.gc +++ b/test/decompiler/reference/jak1/engine/gfx/hw/display_REF.gc @@ -56,7 +56,7 @@ (set! (-> env frame1) (new 'static 'gs-frame :fbw (/ width 64) :psm (logand psm 15) :fbp fbp)) (set! (-> env dtheaddr) (gs-reg64 dthe)) (cond - ((zero? (logand psm 2)) + ((not (logtest? psm 2)) (set! (-> env dthe) (new 'static 'gs-dthe)) 0 ) diff --git a/test/decompiler/reference/jak1/engine/gfx/merc/merc_REF.gc b/test/decompiler/reference/jak1/engine/gfx/merc/merc_REF.gc index 131634956e..b5bf86bfbb 100644 --- a/test/decompiler/reference/jak1/engine/gfx/merc/merc_REF.gc +++ b/test/decompiler/reference/jak1/engine/gfx/merc/merc_REF.gc @@ -236,7 +236,7 @@ ) ) (cond - ((zero? (logand -65536 (the-as int (-> obj header eye-ctrl)))) + ((not (logtest? -65536 (the-as int (-> obj header eye-ctrl)))) (set! (-> obj header eye-ctrl) (the-as merc-eye-ctrl 0)) 0 ) diff --git a/test/decompiler/reference/jak1/engine/gfx/ripple_REF.gc b/test/decompiler/reference/jak1/engine/gfx/ripple_REF.gc index 6a6d50fa22..cc1bfa4575 100644 --- a/test/decompiler/reference/jak1/engine/gfx/ripple_REF.gc +++ b/test/decompiler/reference/jak1/engine/gfx/ripple_REF.gc @@ -170,7 +170,7 @@ (v1-1 (-> arg0 draw)) (a1-5 (-> v1-1 lod-set lod (-> v1-1 cur-lod) geo effect)) ) - (if (or (zero? (logand (-> a1-5 0 effect-bits) 4)) (not (-> v1-1 ripple))) + (if (or (not (logtest? (-> a1-5 0 effect-bits) 4)) (not (-> v1-1 ripple))) (return f30-0) ) (let* ((a1-6 (-> a1-5 0 extra-info)) diff --git a/test/decompiler/reference/jak1/engine/gfx/water/water_REF.gc b/test/decompiler/reference/jak1/engine/gfx/water/water_REF.gc index 82997dadaa..c8fdb93e82 100644 --- a/test/decompiler/reference/jak1/engine/gfx/water/water_REF.gc +++ b/test/decompiler/reference/jak1/engine/gfx/water/water_REF.gc @@ -686,7 +686,7 @@ (with-pp (let ((s5-0 (-> obj flags))) (cond - ((zero? (logand (-> obj flags) (water-flags wt01))) + ((not (logtest? (-> obj flags) (water-flags wt01))) (logclear! (-> obj flags) (water-flags wt09 wt10 wt11 wt12 wt13 wt14 wt16)) ) ((and (logtest? (water-flags wt21) (-> obj flags)) @@ -710,7 +710,7 @@ ) ) (set! (-> obj real-ocean-offset) (- (ocean-get-height (the-as vector (-> obj bottom))) (-> obj base-height))) - (if (zero? (logand (-> obj flags) (water-flags wt09))) + (if (not (logtest? (-> obj flags) (water-flags wt09))) (set! (-> obj ocean-offset) (-> obj real-ocean-offset)) (set! (-> obj ocean-offset) (lerp (-> obj ocean-offset) (-> obj real-ocean-offset) 0.2)) ) @@ -720,7 +720,7 @@ (f30-0 (ripple-find-height (the-as process-drawable a0-26) 0 (the-as vector (-> obj bottom)))) ) (set! (-> obj real-ocean-offset) (- f30-0 (-> obj base-height))) - (if (zero? (logand (-> obj flags) (water-flags wt09))) + (if (not (logtest? (-> obj flags) (water-flags wt09))) (set! (-> obj ocean-offset) (-> obj real-ocean-offset)) (set! (-> obj ocean-offset) (lerp (-> obj ocean-offset) (-> obj real-ocean-offset) 0.2)) ) @@ -753,7 +753,7 @@ (set! (-> obj drip-wetness) 1.0) (set! (-> obj drip-height) (fmax (- (-> obj surface-height) (-> obj bottom 0 y)) (-> obj drip-height))) (set! (-> obj drip-speed) 15.0) - (if (zero? (logand (-> obj flags) (water-flags wt09))) + (if (not (logtest? (-> obj flags) (water-flags wt09))) (TODO-RENAME-15 obj) ) (cond @@ -882,7 +882,7 @@ (>= f30-3 (-> obj bottom 0 y)) (and (logtest? s5-0 (water-flags wt11)) (logtest? (-> (the-as collide-shape-moving (-> obj process root)) status) (cshape-moving-flags tsurf)) - (zero? (logand (-> (the-as collide-shape-moving (-> obj process root)) status) (cshape-moving-flags onsurf))) + (not (logtest? (-> (the-as collide-shape-moving (-> obj process root)) status) (cshape-moving-flags onsurf))) (>= (+ 204.8 f30-3) (-> obj bottom 0 y)) ) ) @@ -897,7 +897,7 @@ (set! (-> obj swim-time) (-> *display* base-frame-counter)) (send-event (-> obj process) 'swim) (logior! (-> obj flags) (water-flags wt11)) - (if (zero? (logand s5-0 (water-flags wt11))) + (if (not (logtest? s5-0 (water-flags wt11))) (set! (-> obj enter-swim-time) (-> *display* base-frame-counter)) ) (cond @@ -909,7 +909,7 @@ (set! (-> v1-200 quad) (-> obj bottom 0 quad)) (set! (-> v1-200 y) (- (-> obj height) (-> obj swim-height))) (let ((s4-4 (-> obj process root))) - (when (and (zero? (logand (-> (the-as collide-shape-moving s4-4) status) (cshape-moving-flags csmf12))) + (when (and (not (logtest? (-> (the-as collide-shape-moving s4-4) status) (cshape-moving-flags csmf12))) (logtest? (-> obj flags) (water-flags wt11)) (zero? (logand (-> (the-as collide-shape-moving s4-4) root-prim prim-core action) (collide-action ca-9))) ) @@ -952,7 +952,7 @@ (set! (-> a1-30 quad) (-> obj bottom 0 quad)) (let ((s5-1 (-> obj process root))) (set! (-> a1-30 y) f30-3) - (when (zero? (logand (-> (the-as collide-shape-moving s5-1) root-prim prim-core action) (collide-action ca-9))) + (when (not (logtest? (-> (the-as collide-shape-moving s5-1) root-prim prim-core action) (collide-action ca-9))) (let ((f30-4 (-> (the-as collide-shape-moving s5-1) ground-impact-vel))) (move-to-ground-point! (the-as collide-shape-moving s5-1) a1-30 (-> s5-1 transv) *up-vector*) (logior! (-> (the-as collide-shape-moving s5-1) status) (cshape-moving-flags on-water)) @@ -974,10 +974,10 @@ ) (when (< (-> obj process root trans y) -409.6) (send-event (-> obj process) 'no-look-around (seconds 1.5)) - (when (zero? (logand (-> (the-as collide-shape-moving (-> obj process root)) root-prim prim-core action) + (when (not (logtest? (-> (the-as collide-shape-moving (-> obj process root)) root-prim prim-core action) (collide-action ca-14) ) - ) + ) (cond ((= (-> obj process type) target) (send-event @@ -1020,8 +1020,8 @@ ) ) ) - (when (not (or (zero? (logand (-> obj flags) (water-flags wt06))) - (zero? (logand (water-flags wt23) (-> obj flags))) + (when (not (or (not (logtest? (-> obj flags) (water-flags wt06))) + (not (logtest? (water-flags wt23) (-> obj flags))) (= (-> obj drip-wetness) 0.0) ) ) diff --git a/test/decompiler/reference/jak1/engine/level/load-boundary_REF.gc b/test/decompiler/reference/jak1/engine/level/load-boundary_REF.gc index f04cff9fbf..1986f5f6bb 100644 --- a/test/decompiler/reference/jak1/engine/level/load-boundary_REF.gc +++ b/test/decompiler/reference/jak1/engine/level/load-boundary_REF.gc @@ -477,7 +477,7 @@ (set! (-> s2-0 quad) (-> s5-0 data (-> gp-0 vertex) quad)) (set! (-> s2-0 y) (-> s5-0 top-plane)) (add-debug-sphere #t (bucket-id debug-no-zbuf) s2-0 8192.0 (new 'static 'rgba :a #x80)) - (when (zero? (logand (-> s5-0 flags) (load-boundary-flags closed))) + (when (not (logtest? (-> s5-0 flags) (load-boundary-flags closed))) (set! (-> s2-0 y) (-> s5-0 bot-plane)) (add-debug-sphere #t (bucket-id debug-no-zbuf) s2-0 8192.0 (new 'static 'rgba :a #x80)) ) @@ -1099,7 +1099,7 @@ ;; INFO: Used lq/sq ;; INFO: Return type mismatch int vs object. (defun triangulate-boundary ((arg0 load-boundary)) - (when (zero? (logand (-> arg0 flags) (load-boundary-flags closed))) + (when (not (logtest? (-> arg0 flags) (load-boundary-flags closed))) (set! (-> arg0 tri-cnt) 1) (return (the-as object 0)) ) diff --git a/test/decompiler/reference/jak1/engine/load/decomp_REF.gc b/test/decompiler/reference/jak1/engine/load/decomp_REF.gc index 6bb668109f..5ad632b717 100644 --- a/test/decompiler/reference/jak1/engine/load/decomp_REF.gc +++ b/test/decompiler/reference/jak1/engine/load/decomp_REF.gc @@ -118,7 +118,7 @@ (+ 16 #x70000000) (+ 2064 #x70000000) (when (= curr-vis-str desired-vis-str) - (b! (zero? (logand #x40000000 (-> vis-info flags))) cfg-6 :delay (empty-form)) + (b! (not (logtest? #x40000000 (-> vis-info flags))) cfg-6 :delay (empty-form)) (if (check-busy *ramdisk-rpc*) (return #f) ) diff --git a/test/decompiler/reference/jak1/engine/load/loader_REF.gc b/test/decompiler/reference/jak1/engine/load/loader_REF.gc index bf7af0250b..1b4d76a0a8 100644 --- a/test/decompiler/reference/jak1/engine/load/loader_REF.gc +++ b/test/decompiler/reference/jak1/engine/load/loader_REF.gc @@ -960,7 +960,7 @@ (str-play-stop (-> arg0 name)) (set! (-> *art-control* active-stream) #f) (logclear! (-> self skel status) (janim-status drawn done)) - (if (zero? (logand (-> self skel status) (janim-status inited))) + (if (not (logtest? (-> self skel status) (janim-status inited))) (logclear! (-> self skel status) (janim-status inited)) ) (remove-setting! 'spooling) diff --git a/test/decompiler/reference/jak1/engine/nav/navigate_REF.gc b/test/decompiler/reference/jak1/engine/nav/navigate_REF.gc index db0e487e75..939f604749 100644 --- a/test/decompiler/reference/jak1/engine/nav/navigate_REF.gc +++ b/test/decompiler/reference/jak1/engine/nav/navigate_REF.gc @@ -438,7 +438,7 @@ (vf9 :class vf) ) (let ((t0-0 (-> arg0 poly arg1))) - (when (zero? (logand (-> t0-0 pat) 1)) + (when (not (logtest? (-> t0-0 pat) 1)) (let ((v1-5 (-> arg0 vertex (-> t0-0 vertex 0))) (a1-5 (-> arg0 vertex (-> t0-0 vertex 1))) (a0-2 (-> arg0 vertex (-> t0-0 vertex 2))) @@ -821,7 +821,7 @@ (countdown (s1-0 (-> obj poly-count)) (set! *debug-traverse* (+ *debug-traverse* 1)) (let ((a0-3 (-> obj poly s1-0))) - (when (zero? (logand (-> a0-3 pat) 1)) + (when (not (logtest? (-> a0-3 pat) 1)) (nop!) (let ((v1-8 (the-as object (-> obj vertex)))) (nop!) @@ -1080,7 +1080,7 @@ (set! sv-48 (-> (the-as nav-poly (+ sv-32 (the-as int s1-1))) adj-poly 0)) (when (and (!= sv-48 255) (!= 1 (-> (the-as (pointer uint8) (&+ arg3 sv-48))))) (set! (-> arg3 sv-48) 1) - (when (zero? (logand (-> obj poly sv-48 pat) 1)) + (when (not (logtest? (-> obj poly sv-48 pat) 1)) (let ((v0-3 (= (nav-mesh-lookup-route obj arg0 (the-as int sv-48)) 3))) (when (not v0-3) (tri-centroid-local obj s1-1 s0-0) @@ -1122,14 +1122,14 @@ (set! *nav-update-route-table-route-count* 0) (countdown (s3-0 (-> obj poly-count)) (let ((s2-0 (-> obj poly s3-0))) - (when (zero? (logand (-> s2-0 pat) 1)) + (when (not (logtest? (-> s2-0 pat) 1)) (tri-centroid-local obj s2-0 s5-0) (mem-set32! s4-0 64 0) (set! (-> s4-0 s3-0) 1) (dotimes (s1-0 3) (let ((a3-0 (-> s2-0 adj-poly s1-0))) (when (!= a3-0 255) - (if (zero? (logand (-> obj poly a3-0 pat) 1)) + (if (not (logtest? (-> obj poly a3-0 pat) 1)) (dummy-18 obj s3-0 s5-0 (the-as int a3-0) s4-0 0) ) ) @@ -1267,7 +1267,7 @@ (let ((f30-0 10000000000000000000000000000000000000.0)) (countdown (s1-0 (-> obj poly-count)) (let ((s0-0 (-> obj poly s1-0))) - (when (zero? (logand (-> s0-0 pat) 1)) + (when (not (logtest? (-> s0-0 pat) 1)) (set! (-> s2-0 0 quad) (-> obj vertex (-> s0-0 vertex 0) quad)) (set! (-> s2-0 1 quad) (-> obj vertex (-> s0-0 vertex 1) quad)) (set! (-> s2-0 2 quad) (-> obj vertex (-> s0-0 vertex 2) quad)) @@ -2402,7 +2402,7 @@ (let ((s1-0 (new 'stack-no-clear 'vector))) (vector-float*! s1-0 arg1 arg2) (dotimes (s0-0 arg3) - (when (zero? (logand arg5 (ash 1 s0-0))) + (when (not (logtest? arg5 (ash 1 s0-0))) (let* ((v1-7 (-> arg4 s0-0)) (f0-2 (ray-circle-intersect arg0 s1-0 v1-7 (-> v1-7 w))) ) diff --git a/test/decompiler/reference/jak1/engine/nav/path_REF.gc b/test/decompiler/reference/jak1/engine/nav/path_REF.gc index 8a144995ec..7403c97ffe 100644 --- a/test/decompiler/reference/jak1/engine/nav/path_REF.gc +++ b/test/decompiler/reference/jak1/engine/nav/path_REF.gc @@ -171,7 +171,7 @@ ;; definition for method 12 of type path-control (defmethod TODO-RENAME-12 path-control ((obj path-control) (arg0 vector) (arg1 float)) - (when (zero? (logand (-> obj flags) (path-control-flag not-found))) + (when (not (logtest? (-> obj flags) (path-control-flag not-found))) (let ((v1-3 (-> obj curve num-cverts)) (f0-3 (the float (the int arg1))) ) @@ -199,7 +199,7 @@ ;; definition for method 14 of type curve-control (defmethod TODO-RENAME-14 curve-control ((obj curve-control) (arg0 vector) (arg1 float)) - (when (zero? (logand (-> obj flags) (path-control-flag not-found))) + (when (not (logtest? (-> obj flags) (path-control-flag not-found))) (let ((s4-0 (new 'stack-no-clear 'vector))) (curve-evaluate! arg0 diff --git a/test/decompiler/reference/jak1/engine/ps2/pad_REF.gc b/test/decompiler/reference/jak1/engine/ps2/pad_REF.gc index cd1638ab7f..e03f6c970d 100644 --- a/test/decompiler/reference/jak1/engine/ps2/pad_REF.gc +++ b/test/decompiler/reference/jak1/engine/ps2/pad_REF.gc @@ -224,7 +224,7 @@ (let ((pad (-> *cpad-list* cpads pad-idx))) (cpad-get-data pad) (cond - ((zero? (logand (-> pad valid) 128)) + ((not (logtest? (-> pad valid) 128)) (dotimes (buzz-idx 2) (cond ((and (-> pad buzz) (< (get-current-time) (-> pad buzz-time buzz-idx)) (= *master-mode* 'game)) diff --git a/test/decompiler/reference/jak1/engine/sparticle/sparticle-launcher_REF.gc b/test/decompiler/reference/jak1/engine/sparticle/sparticle-launcher_REF.gc index db88499a28..79532bc3b3 100644 --- a/test/decompiler/reference/jak1/engine/sparticle/sparticle-launcher_REF.gc +++ b/test/decompiler/reference/jak1/engine/sparticle/sparticle-launcher_REF.gc @@ -494,7 +494,7 @@ (matrix-rotate-y! s3-1 (-> s5-0 rotate-y)) (vector3s-rotate*! (the-as vector3s (-> arg0 launchrot)) (the-as vector3s (-> arg0 launchrot)) s3-1) (vector3s-rotate*! (the-as vector3s (-> arg1 vel-sxvel)) (the-as vector3s (-> arg1 vel-sxvel)) s3-1) - (if (zero? (logand (sp-cpuinfo-flag use-global-acc) (-> arg1 flags))) + (if (not (logtest? (sp-cpuinfo-flag use-global-acc) (-> arg1 flags))) (vector3s-rotate*! (the-as vector3s (-> arg1 acc)) (the-as vector3s (-> arg1 acc)) s3-1) ) ) @@ -576,7 +576,7 @@ ) (vector3s-rotate*! (the-as vector3s (-> arg0 launchrot)) (the-as vector3s (-> arg0 launchrot)) s5-0) (vector3s-rotate*! (the-as vector3s (-> arg1 vel-sxvel)) (the-as vector3s (-> arg1 vel-sxvel)) s5-0) - (if (zero? (logand (sp-cpuinfo-flag use-global-acc) (-> arg1 flags))) + (if (not (logtest? (sp-cpuinfo-flag use-global-acc) (-> arg1 flags))) (vector3s-rotate*! (the-as vector3s (-> arg1 acc)) (the-as vector3s (-> arg1 acc)) s5-0) ) ) @@ -1077,8 +1077,8 @@ (let ((a0-26 sparticle-launcher)) (b! (!= (-> a1-4 type) a0-26) cfg-78 :delay (nop!)) ) - (b! (zero? (logand (-> v1-29 flags) (sp-group-item-flag launch-asap))) cfg-36 :delay (nop!)) - (when (zero? (logand (-> a3-0 flags) (sp-launch-state-flags particles-active))) + (b! (not (logtest? (-> v1-29 flags) (sp-group-item-flag launch-asap))) cfg-36 :delay (nop!)) + (when (not (logtest? (-> a3-0 flags) (sp-launch-state-flags particles-active))) (set! (-> a3-0 spawn-time) (the-as uint s4-0)) (logior! (-> a3-0 flags) (sp-launch-state-flags particles-active)) (if (< 0.0 f0-2) @@ -1125,7 +1125,7 @@ (* 0.2 (the float a0-56) f0-2) ) (else - (when (zero? (logand (-> v1-29 flags) (sp-group-item-flag bit1))) + (when (not (logtest? (-> v1-29 flags) (sp-group-item-flag bit1))) 0 (goto cfg-77) ) diff --git a/test/decompiler/reference/jak1/engine/target/logic-target_REF.gc b/test/decompiler/reference/jak1/engine/target/logic-target_REF.gc index a704bf25c8..5108e2d203 100644 --- a/test/decompiler/reference/jak1/engine/target/logic-target_REF.gc +++ b/test/decompiler/reference/jak1/engine/target/logic-target_REF.gc @@ -107,7 +107,7 @@ (meters 0.000024414063) (the-as rgba (+ #x408040 (shl s4-0 24))) ) - (when (zero? (logand (-> s2-0 status) (cshape-moving-flags csmf08))) + (when (not (logtest? (-> s2-0 status) (cshape-moving-flags csmf08))) (add-debug-line (logtest? s5-0 1) (bucket-id debug-no-zbuf) @@ -176,11 +176,11 @@ (format #t "~C~C~C~C~C~C" - (if (zero? (logand s3-0 (cshape-reaction-flags csrf00))) + (if (not (logtest? s3-0 (cshape-reaction-flags csrf00))) 103 87 ) - (if (zero? (logand s3-0 (cshape-reaction-flags csrf01))) + (if (not (logtest? s3-0 (cshape-reaction-flags csrf01))) 103 87 ) @@ -188,7 +188,7 @@ ((logtest? s3-0 (cshape-reaction-flags csrf11)) 71 ) - ((zero? (logand s3-0 (cshape-reaction-flags csrf02))) + ((not (logtest? s3-0 (cshape-reaction-flags csrf02))) 103 ) (else @@ -206,11 +206,11 @@ 99 ) ) - (if (zero? (logand s3-0 (cshape-reaction-flags csrf04))) + (if (not (logtest? s3-0 (cshape-reaction-flags csrf04))) 110 66 ) - (if (zero? (logand s3-0 (cshape-reaction-flags csrf05))) + (if (not (logtest? s3-0 (cshape-reaction-flags csrf05))) 103 65 ) @@ -769,7 +769,7 @@ ) (vector-matrix*! s2-3 s3-3 (-> self control unknown-matrix01)) (let ((f28-2 (vector-vector-xz-distance s3-3 s4-0))) - (when (and (zero? (logand (-> self control status) (cshape-moving-flags tsurf))) + (when (and (not (logtest? (-> self control status) (cshape-moving-flags tsurf))) (< (vector-xz-length gp-0) (vector-xz-length s3-3)) ) (let ((f0-50 (lerp-scale 163840.0 0.0 f28-2 0.0 20480.0))) @@ -781,7 +781,7 @@ ) ) ) - (if (and (zero? (logand (-> self control status) (cshape-moving-flags twall))) + (if (and (not (logtest? (-> self control status) (cshape-moving-flags twall))) (logtest? (-> self control old-status) (cshape-moving-flags twall)) (logtest? (-> self control unknown-surface00 flags) (surface-flags jump)) (< 0.0 (-> gp-0 y)) @@ -800,7 +800,7 @@ (if (< (- (-> *display* base-frame-counter) (-> self control unknown-dword70)) (seconds 0.2)) (set! f30-4 (+ 204800.0 f30-4)) ) - (if (and (zero? (logand (-> self control status) (cshape-moving-flags twall))) + (if (and (not (logtest? (-> self control status) (cshape-moving-flags twall))) (and (logtest? (-> self control old-status) (cshape-moving-flags twall)) (logtest? (-> self control unknown-surface00 flags) (surface-flags jump)) (< 0.0 (-> gp-0 y)) @@ -926,8 +926,8 @@ (defbehavior do-rotations2 target () (let ((gp-0 (vector-z-quaternion! (new-stack-vector0) (-> self control dir-targ))) (s5-0 - (if (and (or (zero? (logand (logior (-> self control status) (-> self control old-status)) (cshape-moving-flags onsurf tsurf)) - ) + (if (and (or (not (logtest? (logior (-> self control status) (-> self control old-status)) (cshape-moving-flags onsurf tsurf)) + ) (< (- (-> *display* base-frame-counter) (-> self control unknown-dword20)) (seconds 0.5)) (!= (-> self next-state name) 'target-walk) (< (- (-> *display* base-frame-counter) (-> self state-time)) (seconds 0.5)) @@ -1031,7 +1031,7 @@ (set! (-> self control unknown-dword11) (-> *display* base-frame-counter)) (set! (-> self control unknown-vector52 quad) (-> self control trans quad)) (if (and (>= (-> self control coverage) 1.0) - (zero? (logand (-> self control status) (cshape-moving-flags t-act on-water))) + (not (logtest? (-> self control status) (cshape-moving-flags t-act on-water))) (logtest? (-> self control status) (cshape-moving-flags onground)) ) (set! (-> self control last-known-safe-ground quad) (-> self control trans quad)) @@ -1063,8 +1063,8 @@ ) (if (and (= (-> self cam-user-mode) 'normal) (logtest? (-> self control unknown-surface00 flags) (surface-flags allow-look-around)) - (zero? (logand (-> self control root-prim prim-core action) (collide-action ca-7 ca-8 ca-9 ca-12 ca-13 ca-14)) - ) + (not (logtest? (-> self control root-prim prim-core action) (collide-action ca-7 ca-8 ca-9 ca-12 ca-13 ca-14)) + ) (-> *setting-control* current allow-look-around) (>= (- (-> *display* base-frame-counter) (-> self no-look-around-wait)) (seconds 0.05)) (not (and (= (-> self control ground-pat material) (pat-material ice)) @@ -1138,7 +1138,7 @@ ) 9420.8 ) - (zero? (logand (-> self control root-prim prim-core action) (collide-action ca-9 ca-14))) + (not (logtest? (-> self control root-prim prim-core action) (collide-action ca-9 ca-14))) #t ) ) @@ -1446,7 +1446,7 @@ (let ((gp-0 (new 'stack-no-clear 'vector))) (cond ((and (= (-> self next-state name) 'target-clone-anim) - (zero? (logand (-> self draw status) (draw-status hidden))) + (not (logtest? (-> self draw status) (draw-status hidden))) (begin (vector<-cspace! gp-0 (-> self node-list data 3)) (set! (-> gp-0 y) (+ -5896.192 (-> gp-0 y))) diff --git a/test/decompiler/reference/jak1/engine/target/target-death_REF.gc b/test/decompiler/reference/jak1/engine/target/target-death_REF.gc index 38f4281de2..909b01d0c5 100644 --- a/test/decompiler/reference/jak1/engine/target/target-death_REF.gc +++ b/test/decompiler/reference/jak1/engine/target/target-death_REF.gc @@ -45,7 +45,7 @@ (set! (-> *load-boundary-target* 1 quad) (-> (target-pos 0) quad)) (set! (-> *load-boundary-target* 2 quad) (-> *load-boundary-target* 0 quad)) (set! (-> *load-boundary-target* 3 quad) (-> *load-boundary-target* 1 quad)) - (when (zero? (logand (-> *game-info* current-continue flags) (continue-flags intro sage-intro title))) + (when (not (logtest? (-> *game-info* current-continue flags) (continue-flags intro sage-intro title))) (set! (-> *level* border?) (-> *level* play?)) (set! (-> *setting-control* default border-mode) (-> *level* play?)) ) @@ -615,7 +615,7 @@ (defbehavior target-hit-push target ((arg0 vector) (arg1 matrix) (arg2 float) (arg3 float) (arg4 attack-info)) (case (-> arg4 angle) (('jump 'up 'up-forward) - (when (and (zero? (logand (-> self control root-prim prim-core action) (collide-action ca-9 ca-14))) + (when (and (not (logtest? (-> self control root-prim prim-core action) (collide-action ca-9 ca-14))) (not (and (= (-> self game mode) 'play) (>= 0.0 (-> self fact-info-target health)))) ) (if (and (cpad-pressed? (-> self control unknown-cpad-info00 number) circle) (can-feet?)) @@ -627,7 +627,7 @@ (>= (- (-> *display* base-frame-counter) (-> self control unknown-dword36)) (the-as time-frame (-> *TARGET-bank* stuck-timeout)) ) - (zero? (logand (-> self state-flags) (state-flags prevent-attack))) + (not (logtest? (-> self state-flags) (state-flags prevent-attack))) (zero? (logand (-> self control unknown-surface01 flags) (surface-flags prevent-attacks-during-launch-jump surf08)) ) ) @@ -789,7 +789,7 @@ (ja :num! (seek!)) (set! v1-40 (or (ja-done? 0) (and arg1 (logtest? (-> self control status) (cshape-moving-flags onsurf))))) ) - (while (and (or (zero? (logand (-> self control status) (cshape-moving-flags onsurf))) s2-1) (!= s2-1 'stuck)) + (while (and (or (not (logtest? (-> self control status) (cshape-moving-flags onsurf))) s2-1) (!= s2-1 'stuck)) (arg2) (+! f30-1 (* (-> arg0 shove-back) f28-1 (-> *display* seconds-per-frame))) (set! s2-1 (target-hit-push s3-1 s1-1 f30-1 (* (-> arg0 shove-back) f28-1) arg0)) @@ -867,7 +867,7 @@ ) ) (combine! gp-0 arg1) - (when (zero? (logand (-> gp-0 mask) (attack-mask vector))) + (when (not (logtest? (-> gp-0 mask) (attack-mask vector))) (vector-z-quaternion! (-> gp-0 vector) (-> self control unknown-quaternion00)) (vector-xz-normalize! (-> gp-0 vector) (- (fabs (-> gp-0 shove-back)))) (set! (-> gp-0 vector y) (-> gp-0 shove-up)) @@ -1000,7 +1000,7 @@ (defun death-movie-remap ((arg0 int) (arg1 int)) (let ((v1-0 (/ arg0 arg1))) (mod - (if (zero? (logand v1-0 1)) + (if (not (logtest? v1-0 1)) (logxor v1-0 arg0) (logand #xfffffff (- (logxor v1-0 arg0))) ) @@ -1022,7 +1022,7 @@ (send-event *camera* 'joystick 0.0 -1.0) (compute-alignment! (-> self align)) (let ((s5-0 (new 'stack-no-clear 'vector))) - (when (zero? (logand (-> self align flags) (align-flags disabled))) + (when (not (logtest? (-> self align flags) (align-flags disabled))) (vector-matrix*! s5-0 (the-as vector (-> self align delta)) (-> self control unknown-matrix01)) (vector-float*! (-> self control transv) s5-0 (-> *display* frames-per-second)) ) @@ -1305,7 +1305,7 @@ (set-setting! 'allow-progress #f 0.0 0) (target-death-anim gp-18) (when (and (< (rand-vu-int-count (-> *game-info* death-movie-tick)) (* (-> *death-spool-array* length) 2)) - (zero? (logand (-> self water flags) (water-flags wt09))) + (not (logtest? (-> self water flags) (water-flags wt09))) (!= (-> self control ground-pat material) 9) (!= (-> self control ground-pat material) 10) ) diff --git a/test/decompiler/reference/jak1/engine/target/target-handler_REF.gc b/test/decompiler/reference/jak1/engine/target/target-handler_REF.gc index 5c4725727a..e72e387462 100644 --- a/test/decompiler/reference/jak1/engine/target/target-handler_REF.gc +++ b/test/decompiler/reference/jak1/engine/target/target-handler_REF.gc @@ -35,7 +35,7 @@ object (cond ((= v1-0 'get-pickup) - (when (zero? (logand (-> self state-flags) (state-flags dying))) + (when (not (logtest? (-> self state-flags) (state-flags dying))) (let ((s4-0 (-> arg3 param 0)) (f28-0 (the-as float (-> arg3 param 1))) ) @@ -310,7 +310,7 @@ (set! (-> s5-0 shove-back) arg0) (set! (-> s5-0 shove-up) arg1) (set! (-> s5-0 angle) - (if (zero? (logand (logior (-> self control status) (-> self control old-status)) (cshape-moving-flags onsurf))) + (if (not (logtest? (logior (-> self control status) (-> self control old-status)) (cshape-moving-flags onsurf))) 'air 'shove ) @@ -340,7 +340,7 @@ (arg3 touching-shapes-entry) (arg4 (state symbol attack-info target)) ) - (when (zero? (logand (-> self state-flags) (state-flags being-attacked))) + (when (not (logtest? (-> self state-flags) (state-flags being-attacked))) (cond ((or (logtest? (-> self state-flags) (state-flags invulnerable timed-invulnerable invuln-powerup)) (and (logtest? (-> arg1 mask) (attack-mask mode)) @@ -382,7 +382,7 @@ ) (set! (-> self attack-info-rec prev-state) (-> self state)) (logior! (-> self attack-info-rec mask) (attack-mask atki13)) - (when (zero? (logand (-> self attack-info-rec mask) (attack-mask attacker))) + (when (not (logtest? (-> self attack-info-rec mask) (attack-mask attacker))) (set! (-> self attack-info-rec attacker) (process->handle arg2)) (logior! (-> self attack-info-rec mask) (attack-mask attacker)) ) @@ -732,7 +732,7 @@ ;; definition for function target-apply-tongue (defbehavior target-apply-tongue target ((arg0 vector)) - (when (zero? (logand (-> self state-flags) (state-flags being-attacked))) + (when (not (logtest? (-> self state-flags) (state-flags being-attacked))) (logior! (-> self state-flags) (state-flags prevent-attack prevent-duck remove-prevents)) (let ((gp-1 (vector-! (new 'stack-no-clear 'vector) arg0 (-> self control trans)))) (set! (-> self control unknown-float41) (lerp-scale @@ -771,7 +771,7 @@ (('shove) (when (!= (-> self next-state name) 'target-hit) (mem-copy! (the-as pointer (-> self attack-info-rec)) (the-as pointer (-> arg3 param 1)) 104) - (when (zero? (logand (-> self attack-info-rec mask) (attack-mask attacker))) + (when (not (logtest? (-> self attack-info-rec mask) (attack-mask attacker))) (set! (-> self attack-info-rec attacker) (process->handle arg0)) (logior! (-> self attack-info-rec mask) (attack-mask attacker)) ) @@ -861,7 +861,7 @@ (go target-edge-grab) ) (('pole-grab) - (if (zero? (logand (-> self control root-prim prim-core action) (collide-action ca-8))) + (if (not (logtest? (-> self control root-prim prim-core action) (collide-action ca-8))) (go target-pole-cycle (process->handle (the-as process (-> arg3 param 0)))) ) ) diff --git a/test/decompiler/reference/jak1/engine/target/target-util_REF.gc b/test/decompiler/reference/jak1/engine/target/target-util_REF.gc index db1e9aeec8..fcbb251456 100644 --- a/test/decompiler/reference/jak1/engine/target/target-util_REF.gc +++ b/test/decompiler/reference/jak1/engine/target/target-util_REF.gc @@ -763,7 +763,7 @@ (* (-> s1-0 x) (-> *display* seconds-per-frame)) ) ) - (if (zero? (logand arg0 (align-opts adjust-xz-vel keep-other-velocities))) + (if (not (logtest? arg0 (align-opts adjust-xz-vel keep-other-velocities))) (set! (-> a1-3 z) 0.0) ) ) @@ -780,7 +780,7 @@ (* (-> s1-0 z) (-> *display* seconds-per-frame)) ) ) - (if (zero? (logand arg0 (align-opts adjust-x-vel keep-other-velocities))) + (if (not (logtest? arg0 (align-opts adjust-x-vel keep-other-velocities))) (set! (-> a1-3 x) 0.0) ) ) @@ -820,7 +820,7 @@ (not (-> *setting-control* current spooling)) (not (-> *setting-control* current movie)) (not (-> *setting-control* current hint)) - (zero? (logand (-> self control status) (cshape-moving-flags t-act))) + (not (logtest? (-> self control status) (cshape-moving-flags t-act))) (zero? (logand (-> self water flags) (water-flags wt09))) ) ) @@ -833,8 +833,8 @@ (< 0.866 (-> self control surface-angle)) ) ) - (and (zero? (logand (-> self control unknown-surface01 flags) (surface-flags prevent-jump))) - (zero? (logand (-> self state-flags) (state-flags prevent-jump))) + (and (not (logtest? (-> self control unknown-surface01 flags) (surface-flags prevent-jump))) + (not (logtest? (-> self state-flags) (state-flags prevent-jump))) (case arg0 (('target-wheel-flip) (>= 0.5 (-> self control unknown-float61)) @@ -860,7 +860,7 @@ ;; definition for function fall-test ;; INFO: Return type mismatch object vs none. (defbehavior fall-test target () - (when (and (zero? (logand (-> self control status) (cshape-moving-flags onsurf))) + (when (and (not (logtest? (-> self control status) (cshape-moving-flags onsurf))) (>= (- (-> *display* base-frame-counter) (-> self control unknown-dword11)) (-> *TARGET-bank* ground-timeout)) (>= 0.0 (vector-dot (-> self control dynam gravity-normal) (-> self control transv))) (let ((v1-15 (ja-group))) @@ -887,7 +887,7 @@ ;; definition for function slide-down-test ;; INFO: Return type mismatch object vs none. (defbehavior slide-down-test target () - (if (and (zero? (logand (-> self control status) (cshape-moving-flags onsurf csmf07))) + (if (and (not (logtest? (-> self control status) (cshape-moving-flags onsurf csmf07))) (>= (- (-> *display* base-frame-counter) (-> self control unknown-dword11)) (-> *TARGET-bank* ground-timeout)) (logtest? (-> self control status) (cshape-moving-flags tsurf)) (< 0.5 (-> self control surface-angle)) @@ -910,7 +910,7 @@ ;; definition for function can-wheel? (defbehavior can-wheel? target () (and (logtest? (-> self control status) (cshape-moving-flags onsurf)) - (or (zero? (logand (-> self control status) (cshape-moving-flags twall))) + (or (not (logtest? (-> self control status) (cshape-moving-flags twall))) (>= 0.7 (-> self control touch-angle)) ) (and (< (-> self control unknown-float61) 0.7) @@ -923,9 +923,9 @@ (defbehavior can-duck? target () (and (logtest? (-> self control status) (cshape-moving-flags onsurf)) (>= (-> self control unknown-float60) 0.7) - (zero? (logand (-> self water flags) (water-flags wt11 wt12))) - (zero? (logand (-> self state-flags) (state-flags prevent-duck))) - (or (zero? (logand (-> self water flags) (water-flags wt10))) + (not (logtest? (-> self water flags) (water-flags wt11 wt12))) + (not (logtest? (-> self state-flags) (state-flags prevent-duck))) + (or (not (logtest? (-> self water flags) (water-flags wt10))) (< (- (- (-> self control trans y) (- (-> self water base-height) (-> self water wade-height)))) 2457.6) ) ) @@ -962,12 +962,9 @@ ;; definition for function can-hands? (defbehavior can-hands? target ((arg0 symbol)) (cond - ((or (zero? (logand (-> *cpad-list* cpads (-> self control unknown-cpad-info00 number) button0-rel 0) - (pad-buttons square) - ) - ) + ((or (not (cpad-pressed? (-> self control unknown-cpad-info00 number) square)) (or (and (logtest? (-> self state-flags) (state-flags prevent-attack)) - (or (zero? (logand (-> self state-flags) (state-flags remove-prevents))) + (or (not (logtest? (-> self state-flags) (state-flags remove-prevents))) (not (and (= (-> self fact-info-target eco-type) (pickup-type eco-yellow)) (>= (-> self fact-info-target eco-level) 1.0) ) @@ -1156,7 +1153,7 @@ (set! (-> obj intersection quad) (-> arg0 intersection quad)) ) (cond - ((zero? (logand s4-0 (attack-mask vector))) + ((not (logtest? s4-0 (attack-mask vector))) (let* ((s3-0 pp) (s2-0 (handle->process (-> obj attacker))) (v1-39 (if (and (nonzero? s2-0) (type-type? (-> s2-0 type) process-drawable)) @@ -1187,15 +1184,15 @@ ) ) (set! (-> obj vector quad) (-> arg0 vector quad)) - (if (zero? (logand s4-0 (attack-mask shove-back))) + (if (not (logtest? s4-0 (attack-mask shove-back))) (set! (-> obj shove-back) (vector-xz-length (-> obj vector))) ) - (if (zero? (logand s4-0 (attack-mask shove-up))) + (if (not (logtest? s4-0 (attack-mask shove-up))) (set! (-> obj shove-up) (-> obj vector y)) ) ) ) - (if (zero? (logand (-> obj mask) (attack-mask dist))) + (if (not (logtest? (-> obj mask) (attack-mask dist))) (set! (-> obj dist) (fabs (-> obj shove-back))) ) (if (logtest? s4-0 (attack-mask trans)) diff --git a/test/decompiler/reference/jak1/engine/target/target2_REF.gc b/test/decompiler/reference/jak1/engine/target/target2_REF.gc index 4a1f031f64..cd18969c1d 100644 --- a/test/decompiler/reference/jak1/engine/target/target2_REF.gc +++ b/test/decompiler/reference/jak1/engine/target/target2_REF.gc @@ -825,7 +825,7 @@ :code (behavior () (set-forward-vel (the-as float 0.0)) (let ((gp-0 0)) - (while (zero? (logand (-> self control status) (cshape-moving-flags onsurf))) + (while (not (logtest? (-> self control status) (cshape-moving-flags onsurf))) (target-falling-anim-trans) (+! gp-0 (- (-> *display* base-frame-counter) (-> *display* old-base-frame-counter))) (suspend) @@ -975,7 +975,7 @@ ) (pad-buttons x) ) - (zero? (logand (-> self state-flags) (state-flags prevent-jump))) + (not (logtest? (-> self state-flags) (state-flags prevent-jump))) (>= (- (-> *display* base-frame-counter) (-> self state-time)) (seconds 0.1)) ) (set! (-> self control transv quad) (the-as uint128 0)) @@ -1305,7 +1305,7 @@ (until (ja-done? 0) (target-compute-edge-rider) (compute-alignment! (-> self align)) - (when (zero? (logand (-> self align flags) (align-flags disabled))) + (when (not (logtest? (-> self align flags) (align-flags disabled))) (vector-matrix*! s4-0 (the-as vector (-> self align delta)) (-> self control unknown-matrix01)) (move-by-vector! (-> self control) s4-0) ) @@ -1335,7 +1335,7 @@ (ja-no-eval :group! eichar-edge-grab-off-ja :num! (seek! (ja-aframe (the-as float 191.0) 0)) :frame-num 0.0) (until (ja-done? 0) (compute-alignment! (-> self align)) - (when (zero? (logand (-> self align flags) (align-flags disabled))) + (when (not (logtest? (-> self align flags) (align-flags disabled))) (vector-matrix*! gp-0 (the-as vector (-> self align delta)) (-> self control unknown-matrix01)) (move-by-vector! (-> self control) gp-0) ) @@ -1645,7 +1645,7 @@ ) (pad-buttons x) ) - (zero? (logand (-> self water flags) (water-flags wt09))) + (not (logtest? (-> self water flags) (water-flags wt09))) (zero? (logand (-> self state-flags) (state-flags prevent-jump))) ) (go target-jump (-> *TARGET-bank* jump-height-min) (-> *TARGET-bank* jump-height-max) (the-as surface #f)) @@ -1708,7 +1708,7 @@ ) :trans (behavior () ((-> self state-hook)) - (when (and (zero? (logand (-> self water flags) (water-flags wt10))) + (when (and (not (logtest? (-> self water flags) (water-flags wt10))) (>= (- (-> *display* base-frame-counter) (-> self water wade-time)) (seconds 0.05)) ) (if (logtest? (-> self water flags) (water-flags wt11)) @@ -1754,7 +1754,7 @@ :exit (-> target-wade-stance exit) :trans (behavior () ((-> self state-hook)) - (when (and (zero? (logand (-> self water flags) (water-flags wt10))) + (when (and (not (logtest? (-> self water flags) (water-flags wt10))) (>= (- (-> *display* base-frame-counter) (-> self water wade-time)) (seconds 0.1)) ) (if (logtest? (-> self water flags) (water-flags wt11)) @@ -2032,7 +2032,7 @@ ) (set-zero! (-> self water bob)) ) - (when (and (zero? (logand (-> self water flags) (water-flags wt11))) + (when (and (not (logtest? (-> self water flags) (water-flags wt11))) (>= (- (-> *display* base-frame-counter) (-> self state-time)) (seconds 0.1)) ) (if (logtest? (-> self water flags) (water-flags wt10)) @@ -2148,7 +2148,7 @@ ) (set-zero! (-> self water bob)) ) - (when (and (zero? (logand (-> self water flags) (water-flags wt11))) + (when (and (not (logtest? (-> self water flags) (water-flags wt11))) (>= (- (-> *display* base-frame-counter) (-> self water swim-time)) (seconds 0.1)) ) (if (logtest? (-> self water flags) (water-flags wt10)) @@ -2205,7 +2205,7 @@ (ja-no-eval :group! eichar-swim-walk-ja :num! (seek!) :frame-num (ja-aframe (the-as float 19.0) 0)) (until (ja-done? 0) (compute-alignment! (-> self align)) - (if (zero? (logand (-> self align flags) (align-flags disabled))) + (if (not (logtest? (-> self align flags) (align-flags disabled))) (set! (-> self control unknown-surface00 target-speed) (* (-> self align delta trans z) (-> self control unknown-surface01 alignv) (-> *display* frames-per-second)) ) @@ -2223,7 +2223,7 @@ (ja-no-eval :group! eichar-swim-walk-ja :num! (seek!) :frame-num 0.0) (until (ja-done? 0) (compute-alignment! (-> self align)) - (if (zero? (logand (-> self align flags) (align-flags disabled))) + (if (not (logtest? (-> self align flags) (align-flags disabled))) (set! (-> self control unknown-surface00 target-speed) (* (-> self align delta trans z) (-> self control unknown-surface01 alignv) (-> *display* frames-per-second)) ) @@ -2243,7 +2243,7 @@ (case arg2 (('attack 'attack-invinc) (let ((v1-2 (the-as attack-info (-> arg3 param 1)))) - (when (or (zero? (logand (-> v1-2 mask) (attack-mask mode))) (= (-> v1-2 mode) 'generic) (= (-> v1-2 mode) 'drown)) + (when (or (not (logtest? (-> v1-2 mask) (attack-mask mode))) (= (-> v1-2 mode) 'generic) (= (-> v1-2 mode) 'drown)) (set! (-> v1-2 mode) 'damage) (if (and (= (-> self game mode) 'play) (>= 1.0 (-> self fact-info-target health))) (set! (-> v1-2 mode) 'drown-death) @@ -2357,10 +2357,7 @@ ) ) (loop - (if (and (or (zero? (logand (-> *cpad-list* cpads (-> self control unknown-cpad-info00 number) button0-abs 0) - (pad-buttons square) - ) - ) + (if (and (or (not (cpad-hold? (-> self control unknown-cpad-info00 number) square)) (-> self control unknown-spoolanim00) ) (>= (- (-> *display* base-frame-counter) (-> self state-time)) gp-0) @@ -2417,7 +2414,7 @@ :exit (-> target-swim-down exit) :trans (behavior () (if (and (cpad-pressed? (-> self control unknown-cpad-info00 number) x) - (zero? (logand (-> self state-flags) (state-flags prevent-jump))) + (not (logtest? (-> self state-flags) (state-flags prevent-jump))) (zero? (logand (-> self water flags) (water-flags wt13 wt14))) ) (go @@ -2451,7 +2448,7 @@ (the-as float 0.0) (the-as float 0.1) ) - (if (and (zero? (logand (-> self water flags) (water-flags wt12))) + (if (and (not (logtest? (-> self water flags) (water-flags wt12))) (or (>= (ja-aframe-num 0) 222.0) (and (!= (-> *cpad-list* cpads (-> self control unknown-cpad-info00 number) stick0-speed) 0.0) (>= (ja-aframe-num 0) 200.0) @@ -2461,7 +2458,7 @@ (goto cfg-37) ) (compute-alignment! (-> self align)) - (when (zero? (logand (-> self water flags) (water-flags wt12))) + (when (not (logtest? (-> self water flags) (water-flags wt12))) (logior! (-> self water flags) (water-flags wt04)) (set! gp-0 #f) ) @@ -2484,7 +2481,7 @@ (the-as float 0.0) (the-as float 0.1) ) - (if (zero? (logand (-> self water flags) (water-flags wt12))) + (if (not (logtest? (-> self water flags) (water-flags wt12))) (goto cfg-37) ) (if (cpad-pressed? (-> self control unknown-cpad-info00 number) x) @@ -2550,7 +2547,7 @@ (ja :group! eichar-swim-jump-ja :num! min) (until (and (ja-done? 0) (= (-> self skel root-channel 0) (-> self skel channel))) (compute-alignment! (-> self align)) - (if (zero? (logand (-> self align flags) (align-flags disabled))) + (if (not (logtest? (-> self align flags) (align-flags disabled))) (+! (-> self water align-offset) (* 0.6 (-> self align delta trans y))) ) (suspend) @@ -2603,7 +2600,7 @@ (the-as handle #f) ) ) - (if (zero? (logand (-> *cpad-list* cpads 0 button0-abs 0) (pad-buttons l3))) + (if (not (cpad-hold? 0 l3)) (target-timed-invulnerable (-> *TARGET-bank* hit-invulnerable-timeout) self) ) ) @@ -2863,7 +2860,7 @@ (cond ((not (-> self control unknown-spoolanim00)) ) - ((zero? (logand (-> self draw status) (draw-status hidden))) + ((not (logtest? (-> self draw status) (draw-status hidden))) (move-to-point! (-> self control) (the-as vector a1-2)) (matrix->quaternion (-> self control unknown-quaternion00) (-> gp-0 bone transform)) (quaternion-copy! (-> self control quat) (-> self control unknown-quaternion00)) diff --git a/test/decompiler/reference/jak1/engine/target/target_REF.gc b/test/decompiler/reference/jak1/engine/target/target_REF.gc index 208adf9889..2bd8fc9cac 100644 --- a/test/decompiler/reference/jak1/engine/target/target_REF.gc +++ b/test/decompiler/reference/jak1/engine/target/target_REF.gc @@ -92,7 +92,7 @@ ) (pad-buttons x) ) - (zero? (logand (-> self water flags) (water-flags wt09))) + (not (logtest? (-> self water flags) (water-flags wt09))) (< (- (-> *display* base-frame-counter) (-> self state-time)) (seconds 3)) (zero? (logand (-> self state-flags) (state-flags prevent-jump))) ) @@ -989,7 +989,7 @@ (if (can-hands? #t) (go target-running-attack) ) - (if (and (zero? (logand (-> self control status) (cshape-moving-flags onsurf))) + (if (and (not (logtest? (-> self control status) (cshape-moving-flags onsurf))) (>= (- (-> *display* base-frame-counter) (-> self control unknown-dword11)) (seconds 0.08)) ) (go target-falling #f) @@ -1217,8 +1217,7 @@ ) :trans (behavior () ((-> self state-hook)) - (if (and (or (zero? (logand (-> *cpad-list* cpads (-> self control unknown-cpad-info00 number) button0-abs 0) (pad-buttons l1 r1)) - ) + (if (and (or (not (cpad-hold? (-> self control unknown-cpad-info00 number) l1 r1)) (logtest? (-> self state-flags) (state-flags prevent-duck)) ) (let ((v1-13 (ja-group))) @@ -1304,8 +1303,7 @@ :exit (-> target-duck-stance exit) :trans (behavior () ((-> self state-hook)) - (if (and (or (zero? (logand (-> *cpad-list* cpads (-> self control unknown-cpad-info00 number) button0-abs 0) (pad-buttons l1 r1)) - ) + (if (and (or (not (cpad-hold? (-> self control unknown-cpad-info00 number) l1 r1)) (logtest? (-> self state-flags) (state-flags prevent-duck)) (and (logtest? (-> self water flags) (water-flags wt10)) (>= (- (- (-> self control trans y) (- (-> self water base-height) (-> self water wade-height)))) 2457.6) @@ -1459,7 +1457,7 @@ (if (and (cpad-pressed? (-> self control unknown-cpad-info00 number) x) (< (vector-dot (-> self control dynam gravity-normal) (-> self control transv)) 12288.0) (and (< -61440.0 (vector-dot (-> self control dynam gravity-normal) (-> self control transv))) - (zero? (logand (-> self water flags) (water-flags wt09))) + (not (logtest? (-> self water flags) (water-flags wt09))) (zero? (logand (-> self state-flags) (state-flags prevent-jump))) ) ) @@ -1471,7 +1469,7 @@ (>= (- (-> *display* base-frame-counter) (-> self control unknown-dword36)) (the-as time-frame (-> *TARGET-bank* stuck-timeout)) ) - (zero? (logand (-> self state-flags) (state-flags prevent-attack))) + (not (logtest? (-> self state-flags) (state-flags prevent-attack))) (zero? (logand (-> self control unknown-surface01 flags) (surface-flags prevent-attacks-during-launch-jump surf08)) ) ) @@ -1594,7 +1592,7 @@ (>= (- (-> *display* base-frame-counter) (-> self control unknown-dword36)) (the-as time-frame (-> *TARGET-bank* stuck-timeout)) ) - (zero? (logand (-> self state-flags) (state-flags prevent-attack))) + (not (logtest? (-> self state-flags) (state-flags prevent-attack))) (zero? (logand (-> self control unknown-surface01 flags) (surface-flags prevent-attacks-during-launch-jump surf08)) ) ) @@ -1695,7 +1693,7 @@ (>= (- (-> *display* base-frame-counter) (-> self control unknown-dword36)) (the-as time-frame (-> *TARGET-bank* stuck-timeout)) ) - (zero? (logand (-> self state-flags) (state-flags prevent-attack))) + (not (logtest? (-> self state-flags) (state-flags prevent-attack))) (zero? (logand (-> self control unknown-surface01 flags) (surface-flags prevent-attacks-during-launch-jump surf08)) ) ) @@ -2165,7 +2163,7 @@ ) ) ) - (zero? (logand (-> self state-flags) (state-flags prevent-jump prevent-attack))) + (not (logtest? (-> self state-flags) (state-flags prevent-jump prevent-attack))) (zero? (logand (-> self control unknown-surface01 flags) (surface-flags prevent-attacks-during-launch-jump))) ) ) @@ -2219,7 +2217,7 @@ (when (not (ja-min? 0)) (cond ((and (>= (ja-aframe-num 0) 20.0) - (and (and (zero? (logand (-> self control status) (cshape-moving-flags onsurf))) + (and (and (not (logtest? (-> self control status) (cshape-moving-flags onsurf))) (>= (- (-> *display* base-frame-counter) (-> self control unknown-dword11)) (-> *TARGET-bank* ground-timeout)) (>= 0.0 (vector-dot (-> self control dynam gravity-normal) (-> self control transv))) (let ((v1-39 (ja-group))) @@ -2246,10 +2244,7 @@ ) (set-forward-vel (the-as float 0.0)) ) - ((and (zero? (logand (-> *cpad-list* cpads (-> self control unknown-cpad-info00 number) button0-abs 0) - (pad-buttons square) - ) - ) + ((and (not (cpad-hold? (-> self control unknown-cpad-info00 number) square)) (>= (- (-> *display* base-frame-counter) (-> self state-time)) (seconds 0.05)) ) (if (= (-> self control ground-pat material) (pat-material ice)) @@ -2284,7 +2279,7 @@ (+! gp-2 1) ) ) - (if (and (zero? (logand (-> self control status) (cshape-moving-flags onsurf))) + (if (and (not (logtest? (-> self control status) (cshape-moving-flags onsurf))) (>= (- (-> *display* base-frame-counter) (-> self control unknown-dword11)) (-> *TARGET-bank* ground-timeout)) (>= 0.0 (vector-dot (-> self control dynam gravity-normal) (-> self control transv))) (let ((v1-121 (ja-group))) @@ -2553,7 +2548,7 @@ (>= (- (-> *display* base-frame-counter) (-> self control unknown-dword36)) (the-as time-frame (-> *TARGET-bank* stuck-timeout)) ) - (zero? (logand (-> self state-flags) (state-flags prevent-attack))) + (not (logtest? (-> self state-flags) (state-flags prevent-attack))) (zero? (logand (-> self control unknown-surface01 flags) (surface-flags prevent-attacks-during-launch-jump surf08)) ) ) @@ -2711,7 +2706,7 @@ (when (and (or (< (target-move-dist (seconds 0.1)) 1638.4) (and (logtest? (-> self control status) (cshape-moving-flags twall)) (< 0.7 (-> self control poly-angle))) ) - (zero? (logand (-> self control status) (cshape-moving-flags t-act))) + (not (logtest? (-> self control status) (cshape-moving-flags t-act))) (>= (-> self control unknown-uint20) (the-as uint 2)) ) (set! (-> self control unknown-dword36) (-> *display* base-frame-counter)) @@ -3133,7 +3128,7 @@ ) ) (set! (-> self state-time) (-> *display* base-frame-counter)) - (while (zero? (logand (-> self control status) (cshape-moving-flags onsurf))) + (while (not (logtest? (-> self control status) (cshape-moving-flags onsurf))) (when (>= (- (-> *display* base-frame-counter) (-> self state-time)) (seconds 0.01)) (when (not (ja-group? eichar-jump-loop-ja)) (ja-channel-push! 1 (seconds 0.1)) diff --git a/test/decompiler/reference/jak1/engine/ui/hud-classes_REF.gc b/test/decompiler/reference/jak1/engine/ui/hud-classes_REF.gc index 6defa147d9..431e86c3fb 100644 --- a/test/decompiler/reference/jak1/engine/ui/hud-classes_REF.gc +++ b/test/decompiler/reference/jak1/engine/ui/hud-classes_REF.gc @@ -330,7 +330,7 @@ (let ((f0-3 128.0)) (when (and *target* (= (-> *target* fact-info-target health) 1.0)) (let ((v1-16 (logand (-> *display* integral-frame-counter) 7))) - (set! f0-3 (if (zero? (logand (-> *display* integral-frame-counter) 8)) + (set! f0-3 (if (not (logtest? (-> *display* integral-frame-counter) 8)) (+ 128.0 (* 18.142857 (the float v1-16))) (- 255.0 (* 18.142857 (the float v1-16))) ) diff --git a/test/decompiler/reference/jak1/kernel/gcommon_REF.gc b/test/decompiler/reference/jak1/kernel/gcommon_REF.gc index 2f89c791bc..8d805ab99e 100644 --- a/test/decompiler/reference/jak1/kernel/gcommon_REF.gc +++ b/test/decompiler/reference/jak1/kernel/gcommon_REF.gc @@ -870,7 +870,7 @@ ;; definition for function print-tree-bitmask (defun print-tree-bitmask ((bits int) (count int)) (dotimes (i count) - (if (zero? (logand bits 1)) + (if (not (logtest? bits 1)) (format #t " ") (format #t "| ") ) @@ -993,7 +993,7 @@ ) ((= expected-type binteger) (cond - ((zero? (logand (the-as int obj) 7)) + ((not (logtest? (the-as int obj) 7)) #t ) (else diff --git a/test/decompiler/reference/jak1/kernel/gkernel_REF.gc b/test/decompiler/reference/jak1/kernel/gkernel_REF.gc index 7e8aae732c..369c446da8 100644 --- a/test/decompiler/reference/jak1/kernel/gkernel_REF.gc +++ b/test/decompiler/reference/jak1/kernel/gkernel_REF.gc @@ -959,7 +959,7 @@ ;; definition for function execute-process-tree (defun execute-process-tree ((arg0 process-tree) (arg1 (function object object)) (arg2 kernel-context)) (let ((s3-0 (or (logtest? (-> arg0 mask) (process-mask process-tree)) - (not (and (zero? (logand (-> arg2 prevent-from-run) (-> arg0 mask))) (run-logic? arg0))) + (not (and (not (logtest? (-> arg2 prevent-from-run) (-> arg0 mask))) (run-logic? arg0))) (arg1 arg0) ) ) @@ -984,7 +984,7 @@ ;; definition for function search-process-tree (defun search-process-tree ((arg0 process-tree) (arg1 (function process-tree object))) - (when (zero? (logand (-> arg0 mask) (process-mask process-tree))) + (when (not (logtest? (-> arg0 mask) (process-mask process-tree))) (if (arg1 arg0) (return arg0) ) diff --git a/test/decompiler/reference/jak1/levels/beach/beach-obs_REF.gc b/test/decompiler/reference/jak1/levels/beach/beach-obs_REF.gc index bc1ca9a167..16c09e5575 100644 --- a/test/decompiler/reference/jak1/levels/beach/beach-obs_REF.gc +++ b/test/decompiler/reference/jak1/levels/beach/beach-obs_REF.gc @@ -1129,12 +1129,12 @@ (cond ((not (task-closed? (game-task beach-flutflut) (task-status need-introduction))) ) - ((zero? (logand (-> self ambients-played) 8)) + ((not (logtest? (-> self ambients-played) 8)) (if (play-ambient (-> self ambient) "BIR-AM04" #f (the-as vector #f)) (logior! (-> self ambients-played) 8) ) ) - ((zero? (logand (-> self ambients-played) 512)) + ((not (logtest? (-> self ambients-played) 512)) (if (play-ambient (-> self ambient) "BIR-AM10" #f (the-as vector #f)) (logior! (-> self ambients-played) 512) ) @@ -1185,22 +1185,22 @@ (set! (-> self ambients-played) 0) 0 ) - ((and (zero? (logand (-> self ambients-played) 1)) (< (vector-length gp-0) 327680.0) (< -61440.0 (-> gp-0 y))) + ((and (not (logtest? (-> self ambients-played) 1)) (< (vector-length gp-0) 327680.0) (< -61440.0 (-> gp-0 y))) (if (play-ambient (-> self ambient) "BIR-AM01" #f (the-as vector #f)) (logior! (-> self ambients-played) 1) ) ) - ((and (zero? (logand (-> self ambients-played) 2)) (< (vector-length gp-0) 163840.0) (< -40960.0 (-> gp-0 y))) + ((and (not (logtest? (-> self ambients-played) 2)) (< (vector-length gp-0) 163840.0) (< -40960.0 (-> gp-0 y))) (if (play-ambient (-> self ambient) "BIR-AM02" #f (the-as vector #f)) (logior! (-> self ambients-played) 2) ) ) - ((and (zero? (logand (-> self ambients-played) 16)) (< (vector-length gp-0) 81920.0) (< -24576.0 (-> gp-0 y))) + ((and (not (logtest? (-> self ambients-played) 16)) (< (vector-length gp-0) 81920.0) (< -24576.0 (-> gp-0 y))) (if (play-ambient (-> self ambient) "BIR-AM05" #f (the-as vector #f)) (logior! (-> self ambients-played) 16) ) ) - ((and (zero? (logand (-> self ambients-played) 4)) (< (vector-length gp-0) 40960.0) (< -24576.0 (-> gp-0 y))) + ((and (not (logtest? (-> self ambients-played) 4)) (< (vector-length gp-0) 40960.0) (< -24576.0 (-> gp-0 y))) (if (play-ambient (-> self ambient) "BIR-AM03" #f (the-as vector #f)) (logior! (-> self ambients-played) 4) ) diff --git a/test/decompiler/reference/jak1/levels/beach/lurkercrab_REF.gc b/test/decompiler/reference/jak1/levels/beach/lurkercrab_REF.gc index ab1dbf3795..bdfb1eecab 100644 --- a/test/decompiler/reference/jak1/levels/beach/lurkercrab_REF.gc +++ b/test/decompiler/reference/jak1/levels/beach/lurkercrab_REF.gc @@ -102,7 +102,7 @@ 6144.0 16384.0 ) - (the-as object (if (zero? (logand (-> obj nav-enemy-flags) (nav-enemy-flags navenmf8))) + (the-as object (if (not (logtest? (-> obj nav-enemy-flags) (nav-enemy-flags navenmf8))) (do-push-aways! (-> obj collide-info)) ) ) diff --git a/test/decompiler/reference/jak1/levels/beach/seagull_REF.gc b/test/decompiler/reference/jak1/levels/beach/seagull_REF.gc index 0a4e318250..cd7354677b 100644 --- a/test/decompiler/reference/jak1/levels/beach/seagull_REF.gc +++ b/test/decompiler/reference/jak1/levels/beach/seagull_REF.gc @@ -276,7 +276,7 @@ (vector-! s5-0 (-> obj flock 0 target) (-> obj root-override trans)) (when (< (vector-dot s5-0 s5-0) 6710886400.0) (let ((v1-5 (ash 1 (-> obj index)))) - (when (zero? (logand v1-5 (-> obj flock 0 bird-at-waterfall))) + (when (not (logtest? v1-5 (-> obj flock 0 bird-at-waterfall))) (logior! (-> obj flock 0 bird-at-waterfall) v1-5) (+! (-> obj flock 0 birds-at-waterfall) 1) ) @@ -703,7 +703,7 @@ (vector-! s4-0 (-> s5-0 flock 0 target) (-> s5-0 root-override trans)) (when (< (vector-dot s4-0 s4-0) 6710886400.0) (let ((v1-24 (ash 1 (-> s5-0 index)))) - (when (zero? (logand v1-24 (-> s5-0 flock 0 bird-at-waterfall))) + (when (not (logtest? v1-24 (-> s5-0 flock 0 bird-at-waterfall))) (logior! (-> s5-0 flock 0 bird-at-waterfall) v1-24) (+! (-> s5-0 flock 0 birds-at-waterfall) 1) ) @@ -896,7 +896,7 @@ (vector-! s5-0 (-> gp-0 flock 0 target) (-> gp-0 root-override trans)) (when (< (vector-dot s5-0 s5-0) 6710886400.0) (let ((v1-26 (ash 1 (-> gp-0 index)))) - (when (zero? (logand v1-26 (-> gp-0 flock 0 bird-at-waterfall))) + (when (not (logtest? v1-26 (-> gp-0 flock 0 bird-at-waterfall))) (logior! (-> gp-0 flock 0 bird-at-waterfall) v1-26) (+! (-> gp-0 flock 0 birds-at-waterfall) 1) ) @@ -1394,7 +1394,7 @@ ) ) ) - (while (zero? (logand (-> gp-0 extra perm status) (entity-perm-status complete))) + (while (not (logtest? (-> gp-0 extra perm status) (entity-perm-status complete))) (suspend) ) ) diff --git a/test/decompiler/reference/jak1/levels/common/battlecontroller_REF.gc b/test/decompiler/reference/jak1/levels/common/battlecontroller_REF.gc index 5efdf12dd3..25d9fd2064 100644 --- a/test/decompiler/reference/jak1/levels/common/battlecontroller_REF.gc +++ b/test/decompiler/reference/jak1/levels/common/battlecontroller_REF.gc @@ -213,7 +213,7 @@ battlecontroller-default-event-handler (eval-path-curve-div! (-> s5-0 path) s3-0 (the float (-> s5-0 state)) 'interp) (send-event s4-0 'cue-jump-to-point s3-0) ) - (if (zero? (logand (-> (the-as nav-enemy s4-0) nav-enemy-flags) (nav-enemy-flags navenmf11))) + (if (not (logtest? (-> (the-as nav-enemy s4-0) nav-enemy-flags) (nav-enemy-flags navenmf11))) (+! (-> s5-0 state) 1) ) ) diff --git a/test/decompiler/reference/jak1/levels/common/nav-enemy_REF.gc b/test/decompiler/reference/jak1/levels/common/nav-enemy_REF.gc index 95afa99b01..6ec8c8d278 100644 --- a/test/decompiler/reference/jak1/levels/common/nav-enemy_REF.gc +++ b/test/decompiler/reference/jak1/levels/common/nav-enemy_REF.gc @@ -81,10 +81,10 @@ (defmethod common-post nav-enemy ((obj nav-enemy)) (when (and (logtest? (-> obj nav-enemy-flags) (nav-enemy-flags navenmf8)) (or (not *target*) - (and (zero? (logand (-> *target* state-flags) + (and (not (logtest? (-> *target* state-flags) (state-flags being-attacked invulnerable timed-invulnerable invuln-powerup do-not-notice dying) ) - ) + ) (>= (- (-> *display* base-frame-counter) (-> obj touch-time)) (seconds 0.05)) ) ) @@ -551,11 +551,11 @@ nav-enemy-default-event-handler ;; definition for method 46 of type nav-enemy (defmethod TODO-RENAME-46 nav-enemy ((obj nav-enemy) (arg0 float)) (and *target* - (zero? (logand (-> *target* state-flags) + (not (logtest? (-> *target* state-flags) (state-flags being-attacked invulnerable timed-invulnerable invuln-powerup do-not-notice dying) ) - ) - (and (or (zero? (logand (-> obj nav-enemy-flags) (nav-enemy-flags navenmf12))) + ) + (and (or (not (logtest? (-> obj nav-enemy-flags) (nav-enemy-flags navenmf12))) (< (vector-vector-distance (target-pos 0) (-> obj collide-info trans)) arg0) ) (nav-enemy-test-point-near-nav-mesh? (-> *target* control shadow-pos)) @@ -741,7 +741,7 @@ nav-enemy-default-event-handler (when (not s4-1) (compute-alignment! (-> self align)) (align! (-> self align) (align-opts adjust-y-vel ignore-y-if-zero) 1.0 arg1 1.0) - (when (zero? (logand (-> self align flags) (align-flags disabled))) + (when (not (logtest? (-> self align flags) (align-flags disabled))) (let ((f0-6 (* (- (-> self align delta trans z)) (-> *display* frames-per-second)))) (set! (-> self collide-info transv x) (* (-> self hit-from-dir x) f0-6)) (set! (-> self collide-info transv z) (* (-> self hit-from-dir z) f0-6)) @@ -802,7 +802,7 @@ nav-enemy-default-event-handler ;; definition for method 12 of type nav-enemy (defmethod run-logic? nav-enemy ((obj nav-enemy)) - (or (zero? (logand (-> obj mask) (process-mask actor-pause))) + (or (not (logtest? (-> obj mask) (process-mask actor-pause))) (or (and (nonzero? (-> obj draw)) (and (>= (+ (-> *ACTOR-bank* pause-dist) (-> obj collide-info pause-adjust-distance)) (vector-vector-distance (-> obj collide-info trans) (camera-pos)) diff --git a/test/decompiler/reference/jak1/levels/common/ropebridge_REF.gc b/test/decompiler/reference/jak1/levels/common/ropebridge_REF.gc index ba18c99a5a..393185cd7c 100644 --- a/test/decompiler/reference/jak1/levels/common/ropebridge_REF.gc +++ b/test/decompiler/reference/jak1/levels/common/ropebridge_REF.gc @@ -1051,7 +1051,7 @@ ;; definition for method 12 of type ropebridge (defmethod run-logic? ropebridge ((obj ropebridge)) - (or (zero? (logand (-> obj mask) (process-mask actor-pause))) + (or (not (logtest? (-> obj mask) (process-mask actor-pause))) (< (- (-> *display* base-frame-counter) (-> obj agitated-time-stamp)) (seconds 5)) (or (>= (-> obj sleep-dist) (vector-vector-distance (-> obj root-override trans) (math-camera-pos))) (and (nonzero? (-> obj skel)) (!= (-> obj skel root-channel 0) (-> obj skel channel))) diff --git a/test/decompiler/reference/jak1/levels/common/sharkey_REF.gc b/test/decompiler/reference/jak1/levels/common/sharkey_REF.gc index 9f1134f4ea..ba6a2ed6ef 100644 --- a/test/decompiler/reference/jak1/levels/common/sharkey_REF.gc +++ b/test/decompiler/reference/jak1/levels/common/sharkey_REF.gc @@ -99,7 +99,7 @@ nav-enemy-default-event-handler ;; definition for method 12 of type sharkey (defmethod run-logic? sharkey ((obj sharkey)) - (or (zero? (logand (-> obj mask) (process-mask actor-pause))) + (or (not (logtest? (-> obj mask) (process-mask actor-pause))) (or (>= (+ (-> *ACTOR-bank* pause-dist) (-> obj collide-info pause-adjust-distance)) (vector-vector-distance (-> obj collide-info trans) (math-camera-pos)) ) @@ -280,7 +280,7 @@ nav-enemy-default-event-handler ) ) ((sharkey-notice-player?) - (when (zero? (logand (-> self nav-enemy-flags) (nav-enemy-flags navenmf0))) + (when (not (logtest? (-> self nav-enemy-flags) (nav-enemy-flags navenmf0))) (logior! (-> self nav-enemy-flags) (nav-enemy-flags navenmf0)) (set! (-> self notice-time) (-> *display* base-frame-counter)) ) diff --git a/test/decompiler/reference/jak1/levels/finalboss/final-door_REF.gc b/test/decompiler/reference/jak1/levels/finalboss/final-door_REF.gc index 562abd3213..b309b1f601 100644 --- a/test/decompiler/reference/jak1/levels/finalboss/final-door_REF.gc +++ b/test/decompiler/reference/jak1/levels/finalboss/final-door_REF.gc @@ -222,7 +222,7 @@ (ja-post) (loop (if (and (and *target* (>= 61440.0 (vector-vector-distance (-> self root trans) (-> *target* control trans)))) - (and (zero? (logand (-> *target* state-flags) (state-flags grabbed))) + (and (not (logtest? (-> *target* state-flags) (state-flags grabbed))) (and (>= (-> *game-info* fuel) 100.0) (not (and (-> self entity) (logtest? (-> self entity extra perm status) (entity-perm-status complete)))) (= (get-task-status (game-task finalboss-movies)) (task-status need-reward-speech)) diff --git a/test/decompiler/reference/jak1/levels/finalboss/light-eco_REF.gc b/test/decompiler/reference/jak1/levels/finalboss/light-eco_REF.gc index 8df4f96807..6fa9346023 100644 --- a/test/decompiler/reference/jak1/levels/finalboss/light-eco_REF.gc +++ b/test/decompiler/reference/jak1/levels/finalboss/light-eco_REF.gc @@ -684,7 +684,7 @@ (defmethod spawn-child-eco light-eco-mother ((obj light-eco-mother)) (countdown (s3-0 4) (let ((gp-0 (rand-vu-int-count 32))) - (when (zero? (logand (-> obj angle-mask) (ash 1 gp-0))) + (when (not (logtest? (-> obj angle-mask) (ash 1 gp-0))) (let ((f28-0 (* 2048.0 (the float gp-0))) (f30-0 (rand-vu-float-range 61440.0 88514.56)) (s4-0 (new 'stack-no-clear 'vector)) diff --git a/test/decompiler/reference/jak1/levels/finalboss/robotboss-misc_REF.gc b/test/decompiler/reference/jak1/levels/finalboss/robotboss-misc_REF.gc index 1ebf1fda17..a6466ca346 100644 --- a/test/decompiler/reference/jak1/levels/finalboss/robotboss-misc_REF.gc +++ b/test/decompiler/reference/jak1/levels/finalboss/robotboss-misc_REF.gc @@ -45,7 +45,7 @@ (none) ) :trans (behavior () - (when (zero? (logand (-> *camera* master-options) 2)) + (when (not (logtest? (-> *camera* master-options) 2)) (set! *camera-base-mode* cam-string) (cam-slave-go cam-free-floating) ) diff --git a/test/decompiler/reference/jak1/levels/finalboss/robotboss_REF.gc b/test/decompiler/reference/jak1/levels/finalboss/robotboss_REF.gc index 9f15b7f230..5995100516 100644 --- a/test/decompiler/reference/jak1/levels/finalboss/robotboss_REF.gc +++ b/test/decompiler/reference/jak1/levels/finalboss/robotboss_REF.gc @@ -2439,10 +2439,10 @@ (when (and arg1 (nonzero? (-> self looping-sound 1))) (update! (-> self looping-sound 1)) (if (and *target* - (zero? (logand (-> *target* state-flags) + (not (logtest? (-> *target* state-flags) (state-flags being-attacked invulnerable timed-invulnerable invuln-powerup do-not-notice dying) ) - ) + ) (>= 8192.0 (vector-vector-distance gp-0 (target-pos 0))) ) (send-event *target* 'attack #f (static-attack-info ((shove-up (meters 2.5)) (shove-back (meters 7.5))))) diff --git a/test/decompiler/reference/jak1/levels/flut_common/target-flut_REF.gc b/test/decompiler/reference/jak1/levels/flut_common/target-flut_REF.gc index 5514b74e3d..edb91b49e9 100644 --- a/test/decompiler/reference/jak1/levels/flut_common/target-flut_REF.gc +++ b/test/decompiler/reference/jak1/levels/flut_common/target-flut_REF.gc @@ -331,7 +331,7 @@ (('shove) (when (!= (-> self next-state name) 'target-hit) (mem-copy! (the-as pointer (-> self attack-info-rec)) (the-as pointer (-> arg3 param 1)) 104) - (when (zero? (logand (-> self attack-info-rec mask) (attack-mask attacker))) + (when (not (logtest? (-> self attack-info-rec mask) (attack-mask attacker))) (set! (-> self attack-info-rec attacker) (process->handle arg0)) (logior! (-> self attack-info-rec mask) (attack-mask attacker)) ) @@ -567,7 +567,7 @@ (if (can-hands? #t) (go target-flut-running-attack) ) - (if (and (zero? (logand (-> self control status) (cshape-moving-flags onsurf))) + (if (and (not (logtest? (-> self control status) (cshape-moving-flags onsurf))) (and (>= (- (-> *display* base-frame-counter) (-> self control unknown-dword11)) (-> *FLUT-bank* ground-timeout)) (>= 0.0 (vector-dot (-> self control dynam gravity-normal) (-> self control transv))) (let ((v1-37 (ja-group))) @@ -663,7 +663,7 @@ (if (can-hands? #t) (go target-flut-running-attack) ) - (if (and (zero? (logand (-> self control status) (cshape-moving-flags onsurf))) + (if (and (not (logtest? (-> self control status) (cshape-moving-flags onsurf))) (and (>= (- (-> *display* base-frame-counter) (-> self control unknown-dword11)) (-> *FLUT-bank* ground-timeout)) (>= 0.0 (vector-dot (-> self control dynam gravity-normal) (-> self control transv))) (let ((v1-37 (ja-group))) @@ -856,8 +856,8 @@ ) (if (and (cpad-pressed? (-> self control unknown-cpad-info00 number) x) (< (vector-dot (-> self control dynam gravity-normal) (-> self control transv)) 40960.0) - (and (zero? (logand (-> self water flags) (water-flags wt09))) - (zero? (logand (-> self state-flags) (state-flags prevent-jump))) + (and (not (logtest? (-> self water flags) (water-flags wt09))) + (not (logtest? (-> self state-flags) (state-flags prevent-jump))) (< 4096.0 (target-height-above-ground)) ) ) @@ -869,7 +869,7 @@ (>= (- (-> *display* base-frame-counter) (-> self control unknown-dword36)) (the-as time-frame (-> *TARGET-bank* stuck-timeout)) ) - (zero? (logand (-> self state-flags) (state-flags prevent-attack))) + (not (logtest? (-> self state-flags) (state-flags prevent-attack))) (zero? (logand (-> self control unknown-surface01 flags) (surface-flags prevent-attacks-during-launch-jump surf08)) ) ) @@ -984,9 +984,9 @@ ) (pad-buttons square) ) - (and (zero? (logand (-> self state-flags) (state-flags prevent-attack))) - (zero? (logand (-> self control unknown-surface01 flags) (surface-flags prevent-attacks-during-launch-jump surf08)) - ) + (and (not (logtest? (-> self state-flags) (state-flags prevent-attack))) + (not (logtest? (-> self control unknown-surface01 flags) (surface-flags prevent-attacks-during-launch-jump surf08)) + ) (>= (- (-> *display* base-frame-counter) (-> self control unknown-dword36)) (the-as time-frame (-> *TARGET-bank* stuck-timeout)) ) @@ -1103,7 +1103,7 @@ (if (move-legs?) (go target-flut-walk) ) - (if (and (zero? (logand (-> self control status) (cshape-moving-flags onsurf))) + (if (and (not (logtest? (-> self control status) (cshape-moving-flags onsurf))) (and (>= (- (-> *display* base-frame-counter) (-> self control unknown-dword11)) (-> *FLUT-bank* ground-timeout)) (>= 0.0 (vector-dot (-> self control dynam gravity-normal) (-> self control transv))) (let ((v1-34 (ja-group))) @@ -1370,7 +1370,7 @@ (when (not (ja-min? 0)) (cond ((and (>= (ja-aframe-num 0) 20.0) - (and (and (zero? (logand (-> self control status) (cshape-moving-flags onsurf))) + (and (and (not (logtest? (-> self control status) (cshape-moving-flags onsurf))) (>= (- (-> *display* base-frame-counter) (-> self control unknown-dword11)) (-> *FLUT-bank* ground-timeout)) (>= 0.0 (vector-dot (-> self control dynam gravity-normal) (-> self control transv))) (let ((v1-39 (ja-group))) @@ -1423,7 +1423,7 @@ (set! f30-0 (* f30-0 (the-as float (fmin 1.0 (the-as float (-> self control unknown-float140)))))) ) ) - (if (and (zero? (logand (-> self control status) (cshape-moving-flags onsurf))) + (if (and (not (logtest? (-> self control status) (cshape-moving-flags onsurf))) (>= (- (-> *display* base-frame-counter) (-> self control unknown-dword11)) (-> *FLUT-bank* ground-timeout)) (>= 0.0 (vector-dot (-> self control dynam gravity-normal) (-> self control transv))) (let ((v1-105 (ja-group))) @@ -1702,7 +1702,7 @@ ) ) (combine! gp-0 arg1) - (when (zero? (logand (-> gp-0 mask) (attack-mask vector))) + (when (not (logtest? (-> gp-0 mask) (attack-mask vector))) (vector-z-quaternion! (-> gp-0 vector) (-> self control unknown-quaternion00)) (vector-xz-normalize! (-> gp-0 vector) (- (fabs (-> gp-0 shove-back)))) (set! (-> gp-0 vector y) (-> gp-0 shove-up)) @@ -1901,7 +1901,7 @@ (until (ja-done? 0) (compute-alignment! (-> self align)) (let ((gp-5 (new 'stack-no-clear 'vector))) - (when (zero? (logand (-> self align flags) (align-flags disabled))) + (when (not (logtest? (-> self align flags) (align-flags disabled))) (vector-matrix*! gp-5 (the-as vector (-> self align delta)) (-> self control unknown-matrix01)) (vector-float*! (-> self control transv) gp-5 (-> *display* frames-per-second)) ) @@ -2022,7 +2022,7 @@ :code (behavior ((arg0 handle)) (set-forward-vel (the-as float 0.0)) (let ((s5-0 0)) - (while (zero? (logand (-> self control status) (cshape-moving-flags onsurf))) + (while (not (logtest? (-> self control status) (cshape-moving-flags onsurf))) (target-flut-falling-anim-trans) (+! s5-0 (- (-> *display* base-frame-counter) (-> *display* old-base-frame-counter))) (suspend) diff --git a/test/decompiler/reference/jak1/levels/jungle/darkvine_REF.gc b/test/decompiler/reference/jak1/levels/jungle/darkvine_REF.gc index 1cbd96aad5..a27326e29a 100644 --- a/test/decompiler/reference/jak1/levels/jungle/darkvine_REF.gc +++ b/test/decompiler/reference/jak1/levels/jungle/darkvine_REF.gc @@ -42,7 +42,7 @@ ;; definition for method 12 of type darkvine (defmethod run-logic? darkvine ((obj darkvine)) - (or (zero? (logand (-> obj mask) (process-mask actor-pause))) + (or (not (logtest? (-> obj mask) (process-mask actor-pause))) (or (and (nonzero? (-> obj draw)) (logtest? (-> obj draw status) (draw-status was-drawn)) (>= (+ (-> *ACTOR-bank* pause-dist) (-> obj root-override pause-adjust-distance)) diff --git a/test/decompiler/reference/jak1/levels/jungle/hopper_REF.gc b/test/decompiler/reference/jak1/levels/jungle/hopper_REF.gc index e2d6ce90b1..46cc027915 100644 --- a/test/decompiler/reference/jak1/levels/jungle/hopper_REF.gc +++ b/test/decompiler/reference/jak1/levels/jungle/hopper_REF.gc @@ -160,7 +160,7 @@ nav-enemy-default-event-handler nav-enemy-jump-event-handler ) :trans (behavior () - (if (zero? (logand (-> self nav-enemy-flags) (nav-enemy-flags enable-rotate))) + (if (not (logtest? (-> self nav-enemy-flags) (nav-enemy-flags enable-rotate))) ((-> (method-of-type nav-enemy nav-enemy-patrol) trans)) ) (none) @@ -233,7 +233,7 @@ nav-enemy-default-event-handler nav-enemy-jump-event-handler ) :trans (behavior () - (if (zero? (logand (-> self nav-enemy-flags) (nav-enemy-flags enable-rotate))) + (if (not (logtest? (-> self nav-enemy-flags) (nav-enemy-flags enable-rotate))) ((-> (method-of-type nav-enemy nav-enemy-chase) trans)) ) (none) diff --git a/test/decompiler/reference/jak1/levels/jungle/jungle-mirrors_REF.gc b/test/decompiler/reference/jak1/levels/jungle/jungle-mirrors_REF.gc index 800aa84ffa..8d7403aa58 100644 --- a/test/decompiler/reference/jak1/levels/jungle/jungle-mirrors_REF.gc +++ b/test/decompiler/reference/jak1/levels/jungle/jungle-mirrors_REF.gc @@ -727,7 +727,7 @@ (none) ) :trans (behavior () - (if (zero? (logand (-> *camera* master-options) 2)) + (if (not (logtest? (-> *camera* master-options) 2)) (cam-slave-go cam-free-floating) ) (none) @@ -1882,7 +1882,7 @@ (defstate reflector-origin-idle (reflector-origin) :code (behavior () (reflector-origin-update (-> self blocker)) - (while (zero? (logand (-> self blocker extra perm status) (entity-perm-status complete))) + (while (not (logtest? (-> self blocker extra perm status) (entity-perm-status complete))) (suspend) ) (let ((a1-0 (new 'stack-no-clear 'event-message-block))) diff --git a/test/decompiler/reference/jak1/levels/lavatube/lavatube-obs_REF.gc b/test/decompiler/reference/jak1/levels/lavatube/lavatube-obs_REF.gc index f1d8b3e1ca..f1ee8d7401 100644 --- a/test/decompiler/reference/jak1/levels/lavatube/lavatube-obs_REF.gc +++ b/test/decompiler/reference/jak1/levels/lavatube/lavatube-obs_REF.gc @@ -1389,7 +1389,7 @@ ) ) :trans (behavior () - (when (zero? (logand (-> self path flags) (path-control-flag not-found))) + (when (not (logtest? (-> self path flags) (path-control-flag not-found))) (let ((f0-4 (* 0.5 (+ 1.0 (sin (* (-> self move-per-tick) (the float (-> *display* base-frame-counter)))))))) (eval-path-curve! (-> self path) (-> self root-override trans) f0-4 'interp) ) @@ -1430,7 +1430,7 @@ (set! (-> obj root-override pause-adjust-distance) 122880.0) (set! (-> obj path) (new 'process 'path-control obj 'path 0.0)) (logior! (-> obj path flags) (path-control-flag display draw-line draw-point draw-text)) - (when (zero? (logand (-> obj path flags) (path-control-flag not-found))) + (when (not (logtest? (-> obj path flags) (path-control-flag not-found))) (let ((f30-0 (res-lump-float (-> obj entity) 'speed :default 12288.0))) (set! (-> obj move-per-tick) (* 32768.0 (/ 1.0 (* 300.0 (path-distance (-> obj path)))) f30-0)) ) diff --git a/test/decompiler/reference/jak1/levels/maincave/driller-lurker_REF.gc b/test/decompiler/reference/jak1/levels/maincave/driller-lurker_REF.gc index 61910078ea..b8688f9eb2 100644 --- a/test/decompiler/reference/jak1/levels/maincave/driller-lurker_REF.gc +++ b/test/decompiler/reference/jak1/levels/maincave/driller-lurker_REF.gc @@ -538,10 +538,10 @@ ) (when (and (-> obj hit-player?) (or (not *target*) - (and (zero? (logand (-> *target* state-flags) + (and (not (logtest? (-> *target* state-flags) (state-flags being-attacked invulnerable timed-invulnerable invuln-powerup do-not-notice dying) ) - ) + ) (>= (- (-> *display* base-frame-counter) (-> obj hit-player-time)) (seconds 0.05)) ) ) diff --git a/test/decompiler/reference/jak1/levels/maincave/gnawer_REF.gc b/test/decompiler/reference/jak1/levels/maincave/gnawer_REF.gc index a01b533541..9f8582be94 100644 --- a/test/decompiler/reference/jak1/levels/maincave/gnawer_REF.gc +++ b/test/decompiler/reference/jak1/levels/maincave/gnawer_REF.gc @@ -816,7 +816,7 @@ ) (until (= a0-2 v1-1) (let ((a1-2 (ash 1 a0-2))) - (if (zero? (logand a1-2 arg1)) + (if (not (logtest? a1-2 arg1)) (return (the-as symbol a1-2)) ) ) diff --git a/test/decompiler/reference/jak1/levels/maincave/mother-spider_REF.gc b/test/decompiler/reference/jak1/levels/maincave/mother-spider_REF.gc index ef171eabf6..23d6174ad7 100644 --- a/test/decompiler/reference/jak1/levels/maincave/mother-spider_REF.gc +++ b/test/decompiler/reference/jak1/levels/maincave/mother-spider_REF.gc @@ -1273,10 +1273,10 @@ (if (and (>= (- (-> *display* base-frame-counter) (-> self state-time)) (seconds 0.25)) (> (-> self birthing-counter) 0) (and (>= 49152.0 (- (-> self max-dist-from-anchor) (-> self dist-from-anchor))) - (zero? (logand (-> *target* state-flags) + (not (logtest? (-> *target* state-flags) (state-flags being-attacked invulnerable timed-invulnerable invuln-powerup do-not-notice dying) ) - ) + ) (TODO-RENAME-21 (-> self nav) (-> self root-override trans)) ) ) @@ -1658,7 +1658,7 @@ ;; definition for method 12 of type mother-spider (defmethod run-logic? mother-spider ((obj mother-spider)) - (or (zero? (logand (-> obj mask) (process-mask actor-pause))) + (or (not (logtest? (-> obj mask) (process-mask actor-pause))) (or (< (vector-vector-xz-distance (-> obj root-override trans) (math-camera-pos)) (-> obj deactivate-xz-dist)) (and (nonzero? (-> obj skel)) (!= (-> obj skel root-channel 0) (-> obj skel channel))) (and (nonzero? (-> obj draw)) (logtest? (-> obj draw status) (draw-status no-skeleton-update))) diff --git a/test/decompiler/reference/jak1/levels/misty/bonelurker_REF.gc b/test/decompiler/reference/jak1/levels/misty/bonelurker_REF.gc index 78e512b2cc..c7ec434d23 100644 --- a/test/decompiler/reference/jak1/levels/misty/bonelurker_REF.gc +++ b/test/decompiler/reference/jak1/levels/misty/bonelurker_REF.gc @@ -225,7 +225,7 @@ nav-enemy-default-event-handler ) :trans (behavior () ((-> (method-of-type nav-enemy nav-enemy-chase) trans)) - (if (and (zero? (logand (-> self nav-enemy-flags) (nav-enemy-flags navenmf6))) + (if (and (not (logtest? (-> self nav-enemy-flags) (nav-enemy-flags navenmf6))) (>= (- (-> *display* base-frame-counter) (-> self bump-player-time)) (seconds 0.5)) ) (logior! (-> self nav-enemy-flags) (nav-enemy-flags navenmf6)) diff --git a/test/decompiler/reference/jak1/levels/misty/mistycannon_REF.gc b/test/decompiler/reference/jak1/levels/misty/mistycannon_REF.gc index 62f6056c73..f299d517ab 100644 --- a/test/decompiler/reference/jak1/levels/misty/mistycannon_REF.gc +++ b/test/decompiler/reference/jak1/levels/misty/mistycannon_REF.gc @@ -756,7 +756,7 @@ ) (restore-collide-with-as (-> self root-override)) (set-vector! (-> self root-override scale) 0.6 0.6 0.6 1.0) - (while (zero? (logand (-> self root-override status) (cshape-moving-flags onsurf))) + (while (not (logtest? (-> self root-override status) (cshape-moving-flags onsurf))) (if (and (zero? (-> self sfx)) (< (if *target* (vector-vector-distance (-> self root-override trans) (-> *target* control trans)) @@ -1688,7 +1688,7 @@ (none) ) :trans (behavior () - (if (zero? (logand (-> *camera* master-options) 2)) + (if (not (logtest? (-> *camera* master-options) 2)) (cam-slave-go cam-free-floating) ) (none) @@ -1771,9 +1771,7 @@ ) (sound-play "cannon-charge" :id (-> self sound-id) :pitch (* 0.008 (the float gp-0))) ) - (when (or (= gp-0 300) - (and (zero? (logand (-> *cpad-list* cpads 0 button0-abs 0) (pad-buttons x))) (nonzero? gp-0)) - ) + (when (or (= gp-0 300) (and (not (cpad-hold? 0 x)) (nonzero? gp-0))) (let ((gp-1 (+ 50 (the int (* 0.16666667 (the float gp-0)))))) (level-hint-spawn (game-text-id sidekick-mistycannon) @@ -1801,7 +1799,7 @@ ) ) ) - (if (zero? (logand (-> *cpad-list* cpads 0 button0-abs 0) (pad-buttons x))) + (if (not (cpad-hold? 0 x)) (set! s5-0 0) ) (suspend) diff --git a/test/decompiler/reference/jak1/levels/racer_common/collide-reaction-racer_REF.gc b/test/decompiler/reference/jak1/levels/racer_common/collide-reaction-racer_REF.gc index 7e6a9bea72..5ee32fb224 100644 --- a/test/decompiler/reference/jak1/levels/racer_common/collide-reaction-racer_REF.gc +++ b/test/decompiler/reference/jak1/levels/racer_common/collide-reaction-racer_REF.gc @@ -58,7 +58,7 @@ (if s3-1 (set! sv-104 (logior sv-104 2)) ) - (when (zero? (logand (-> arg0 prev-status) (cshape-moving-flags onsurf))) + (when (not (logtest? (-> arg0 prev-status) (cshape-moving-flags onsurf))) (set! (-> arg0 ground-impact-vel) (- (vector-dot (-> arg0 transv) (-> arg0 dynam gravity-normal)))) (set! sv-96 (logior sv-96 2048)) (when (not s3-1) @@ -162,7 +162,7 @@ ) (set! sv-96 (logior sv-96 2)) (set! (-> arg0 ground-touch-point w) 0.0) - (when (zero? (logand sv-104 15)) + (when (not (logtest? sv-104 15)) (set! sv-96 (logior sv-96 2)) (set! (-> arg0 ground-poly-normal quad) (-> arg0 poly-normal quad)) (set! (-> arg0 unknown-vector53 quad) (-> sv-84 quad)) diff --git a/test/decompiler/reference/jak1/levels/racer_common/racer-part_REF.gc b/test/decompiler/reference/jak1/levels/racer_common/racer-part_REF.gc index d397e38775..1eab334a4f 100644 --- a/test/decompiler/reference/jak1/levels/racer_common/racer-part_REF.gc +++ b/test/decompiler/reference/jak1/levels/racer_common/racer-part_REF.gc @@ -154,7 +154,7 @@ (set! (-> arg0 vector 2 y) (- 128.0 (* 640.0 (+ -0.6 arg1)))) (set! (-> arg0 vector 2 z) 0.0) ) - ((zero? (logand (-> *display* integral-frame-counter) 8)) + ((not (logtest? (-> *display* integral-frame-counter) 8)) (set! (-> arg0 vector 2 x) 128.0) (set! (-> arg0 vector 2 y) 0.0) (set! (-> arg0 vector 2 z) 0.0) diff --git a/test/decompiler/reference/jak1/levels/racer_common/racer-states_REF.gc b/test/decompiler/reference/jak1/levels/racer_common/racer-states_REF.gc index 6dcccf3852..d61c6b763d 100644 --- a/test/decompiler/reference/jak1/levels/racer_common/racer-states_REF.gc +++ b/test/decompiler/reference/jak1/levels/racer_common/racer-states_REF.gc @@ -355,7 +355,7 @@ ) ) ) - (if (and (zero? (logand (-> self control status) (cshape-moving-flags onsurf))) + (if (and (not (logtest? (-> self control status) (cshape-moving-flags onsurf))) (or (>= (- (-> *display* base-frame-counter) (-> self control unknown-dword11)) (* (-> *TARGET-bank* ground-timeout) 2) ) @@ -554,8 +554,7 @@ ((cpad-pressed? (-> self control unknown-cpad-info00 number) l1 r1) (set! (-> self racer slide-down-time 0) (-> *display* base-frame-counter)) ) - ((zero? (logand (-> *cpad-list* cpads (-> self control unknown-cpad-info00 number) button0-abs 0) (pad-buttons l1 r1)) - ) + ((not (cpad-hold? (-> self control unknown-cpad-info00 number) l1 r1)) (set! (-> self racer slide-down-time 0) 0) 0 ) diff --git a/test/decompiler/reference/jak1/levels/racer_common/target-racer_REF.gc b/test/decompiler/reference/jak1/levels/racer_common/target-racer_REF.gc index 6c8d0438fb..afc3378214 100644 --- a/test/decompiler/reference/jak1/levels/racer_common/target-racer_REF.gc +++ b/test/decompiler/reference/jak1/levels/racer_common/target-racer_REF.gc @@ -129,14 +129,12 @@ (let ((v1-1 (-> self racer slide-mode))) (cond ((zero? v1-1) - (if (zero? (logand (-> *cpad-list* cpads (-> self control unknown-cpad-info00 number) button0-abs 0) (pad-buttons l1 r1)) - ) + (if (not (cpad-hold? (-> self control unknown-cpad-info00 number) l1 r1)) (set! (-> self racer slide-mode) -1) ) ) ((= v1-1 1) - (if (zero? (logand (-> *cpad-list* cpads (-> self control unknown-cpad-info00 number) button0-abs 0) (pad-buttons l1 r1)) - ) + (if (not (cpad-hold? (-> self control unknown-cpad-info00 number) l1 r1)) (set! (-> self racer slide-mode) -1) ) ) @@ -914,8 +912,7 @@ (set! (-> self racer boost-curve) 0.0) ) ) - (when (or (zero? (logand (-> *cpad-list* cpads (-> self control unknown-cpad-info00 number) button0-abs 0) (pad-buttons x)) - ) + (when (or (not (cpad-hold? (-> self control unknown-cpad-info00 number) x)) (< (-> self control unknown-float01) 4096.0) (= (-> self racer boost-level) 0.0) ) diff --git a/test/decompiler/reference/jak1/levels/rolling/rolling-lightning-mole_REF.gc b/test/decompiler/reference/jak1/levels/rolling/rolling-lightning-mole_REF.gc index fac8b8c1b5..d0fa139359 100644 --- a/test/decompiler/reference/jak1/levels/rolling/rolling-lightning-mole_REF.gc +++ b/test/decompiler/reference/jak1/levels/rolling/rolling-lightning-mole_REF.gc @@ -17,7 +17,7 @@ (cond ((= v1-4 255) ) - ((zero? (logand (-> arg0 poly v1-4 pat) 1)) + ((not (logtest? (-> arg0 poly v1-4 pat) 1)) (format 0 "ERROR: find-adjacent-bounds-one given a non-boundary edge to start~%") (return #f) ) diff --git a/test/decompiler/reference/jak1/levels/snow/snow-bunny_REF.gc b/test/decompiler/reference/jak1/levels/snow/snow-bunny_REF.gc index cd0edc0660..c8f66f673c 100644 --- a/test/decompiler/reference/jak1/levels/snow/snow-bunny_REF.gc +++ b/test/decompiler/reference/jak1/levels/snow/snow-bunny_REF.gc @@ -274,7 +274,7 @@ ;; definition for method 58 of type snow-bunny ;; INFO: Return type mismatch time-frame vs none. (defmethod dummy-58 snow-bunny ((obj snow-bunny)) - (if (zero? (logand (-> *target* state-flags) (state-flags dangerous))) + (if (not (logtest? (-> *target* state-flags) (state-flags dangerous))) (set! (-> obj last-nondangerous-time) (-> *display* base-frame-counter)) ) (none) diff --git a/test/decompiler/reference/jak1/levels/snow/snow-flutflut-obs_REF.gc b/test/decompiler/reference/jak1/levels/snow/snow-flutflut-obs_REF.gc index d0efedc703..62e35214fd 100644 --- a/test/decompiler/reference/jak1/levels/snow/snow-flutflut-obs_REF.gc +++ b/test/decompiler/reference/jak1/levels/snow/snow-flutflut-obs_REF.gc @@ -484,7 +484,7 @@ ) ) (set! (-> obj has-path?) - (and (zero? (logand (-> obj path flags) (path-control-flag not-found))) (> (-> obj sync period) 0)) + (and (not (logtest? (-> obj path flags) (path-control-flag not-found))) (> (-> obj sync period) 0)) ) (when (nonzero? (-> obj plat-type)) (cond diff --git a/test/decompiler/reference/jak1/levels/snow/snow-ram-boss_REF.gc b/test/decompiler/reference/jak1/levels/snow/snow-ram-boss_REF.gc index be917bc34d..3e5c82ae32 100644 --- a/test/decompiler/reference/jak1/levels/snow/snow-ram-boss_REF.gc +++ b/test/decompiler/reference/jak1/levels/snow/snow-ram-boss_REF.gc @@ -946,7 +946,7 @@ v0-4 ) ((begin - (if (zero? (logand (-> self nav-enemy-flags) (nav-enemy-flags navenmf8))) + (if (not (logtest? (-> self nav-enemy-flags) (nav-enemy-flags navenmf8))) (do-push-aways! (-> self collide-info)) ) (level-hint-spawn @@ -981,7 +981,7 @@ ) ) (('touch) - (if (zero? (logand (-> self nav-enemy-flags) (nav-enemy-flags navenmf8))) + (if (not (logtest? (-> self nav-enemy-flags) (nav-enemy-flags navenmf8))) (do-push-aways! (-> self collide-info)) ) (cond @@ -1720,10 +1720,10 @@ ) ) (when (and (= (-> self proj-status) 2) - (zero? (logand (-> *target* state-flags) + (not (logtest? (-> *target* state-flags) (state-flags being-attacked invulnerable timed-invulnerable invuln-powerup do-not-notice dying) ) - ) + ) (>= (- (-> *display* base-frame-counter) (-> self state-time)) (seconds 0.2)) ) (let ((gp-2 (new 'stack-no-clear 'vector)) diff --git a/test/decompiler/reference/jak1/levels/sunken/bully_REF.gc b/test/decompiler/reference/jak1/levels/sunken/bully_REF.gc index d10ba997a5..5482637b64 100644 --- a/test/decompiler/reference/jak1/levels/sunken/bully_REF.gc +++ b/test/decompiler/reference/jak1/levels/sunken/bully_REF.gc @@ -413,10 +413,10 @@ (defbehavior bully-post bully () (when (and (-> self hit-player?) (or (not *target*) - (and (zero? (logand (-> *target* state-flags) + (and (not (logtest? (-> *target* state-flags) (state-flags being-attacked invulnerable timed-invulnerable invuln-powerup do-not-notice dying) ) - ) + ) (>= (- (-> *display* base-frame-counter) (-> self hit-player-time)) (seconds 0.05)) ) ) diff --git a/test/decompiler/reference/jak1/levels/sunken/helix-water_REF.gc b/test/decompiler/reference/jak1/levels/sunken/helix-water_REF.gc index 792d9e6b23..a3ecf8176c 100644 --- a/test/decompiler/reference/jak1/levels/sunken/helix-water_REF.gc +++ b/test/decompiler/reference/jak1/levels/sunken/helix-water_REF.gc @@ -703,7 +703,7 @@ (seek! (-> self root scale y) 0.8 (* 0.667 (-> *display* seconds-per-frame))) (when *target* (let ((f0-4 (-> (target-pos 0) y))) - (when (zero? (logand (-> *target* state-flags) (state-flags grabbed))) + (when (not (logtest? (-> *target* state-flags) (state-flags grabbed))) (let* ((f0-5 (- f0-4 (-> self root trans y))) (f0-6 (+ -40960.0 f0-5)) (f0-7 (* 0.000024414063 f0-6)) diff --git a/test/decompiler/reference/jak1/levels/sunken/orbit-plat_REF.gc b/test/decompiler/reference/jak1/levels/sunken/orbit-plat_REF.gc index c5d0b42f9f..72b43cddca 100644 --- a/test/decompiler/reference/jak1/levels/sunken/orbit-plat_REF.gc +++ b/test/decompiler/reference/jak1/levels/sunken/orbit-plat_REF.gc @@ -776,7 +776,7 @@ (set! (-> self plat-status) (the-as uint 3)) (logclear! (-> self nav flags) (nav-control-flags navcf19)) (ja-no-eval :num! (seek! 0.0)) - (while (zero? (logand (nav-control-flags navcf19) (-> self nav flags))) + (while (not (logtest? (nav-control-flags navcf19) (-> self nav flags))) (dummy-27 self) (when (nonzero? (-> self root-override riders num-riders)) (let ((a1-1 (new 'stack-no-clear 'event-message-block))) diff --git a/test/decompiler/reference/jak1/levels/sunken/puffer_REF.gc b/test/decompiler/reference/jak1/levels/sunken/puffer_REF.gc index e3286fdd8c..15fe858845 100644 --- a/test/decompiler/reference/jak1/levels/sunken/puffer_REF.gc +++ b/test/decompiler/reference/jak1/levels/sunken/puffer_REF.gc @@ -163,10 +163,10 @@ (defbehavior puffer-post puffer () (when (and (-> self hit-player?) (or (not *target*) - (and (zero? (logand (-> *target* state-flags) + (and (not (logtest? (-> *target* state-flags) (state-flags being-attacked invulnerable timed-invulnerable invuln-powerup do-not-notice dying) ) - ) + ) (>= (- (-> *display* base-frame-counter) (-> self hit-player-time)) (seconds 0.05)) ) ) @@ -268,10 +268,10 @@ (defmethod dummy-25 puffer ((obj puffer) (arg0 float)) (when *target* (let ((gp-0 (target-pos 0))) - (when (and (zero? (logand (-> *target* state-flags) + (when (and (not (logtest? (-> *target* state-flags) (state-flags being-attacked invulnerable timed-invulnerable invuln-powerup do-not-notice dying) ) - ) + ) (dummy-24 obj gp-0) (>= (-> gp-0 y) (+ -14336.0 (-> obj attack-bottom-y))) (>= (+ 2048.0 (-> obj top-y)) (-> gp-0 y)) diff --git a/test/decompiler/reference/jak1/levels/sunken/qbert-plat_REF.gc b/test/decompiler/reference/jak1/levels/sunken/qbert-plat_REF.gc index e506b32e41..e08e605f14 100644 --- a/test/decompiler/reference/jak1/levels/sunken/qbert-plat_REF.gc +++ b/test/decompiler/reference/jak1/levels/sunken/qbert-plat_REF.gc @@ -444,7 +444,7 @@ (let ((s5-1 (= (-> self plat-states-needed-to-open-door) (-> self plat-states)))) (let ((v1-3 (ash 1 v1-2))) (logxor! (-> self plat-states) (the-as uint v1-3)) - (if (zero? (logand v1-3 (-> self plat-states))) + (if (not (logtest? v1-3 (-> self plat-states))) (level-hint-spawn (game-text-id sunken-qbert-plat-hint) "sksp0130" diff --git a/test/decompiler/reference/jak1/levels/sunken/sunken-pipegame_REF.gc b/test/decompiler/reference/jak1/levels/sunken/sunken-pipegame_REF.gc index 4179b07830..1e57939859 100644 --- a/test/decompiler/reference/jak1/levels/sunken/sunken-pipegame_REF.gc +++ b/test/decompiler/reference/jak1/levels/sunken/sunken-pipegame_REF.gc @@ -908,7 +908,7 @@ (set! (-> self challenge) -1) (dotimes (gp-0 3) (let ((v1-18 (-> self button gp-0))) - (if (zero? (logand (ash 1 gp-0) (-> self challenges-mask))) + (if (not (logtest? (ash 1 gp-0) (-> self challenges-mask))) (send-event (ppointer->process v1-18) 'untrigger) ) ) diff --git a/test/decompiler/reference/jak1/levels/sunken/target-tube_REF.gc b/test/decompiler/reference/jak1/levels/sunken/target-tube_REF.gc index 90dc968438..0190853497 100644 --- a/test/decompiler/reference/jak1/levels/sunken/target-tube_REF.gc +++ b/test/decompiler/reference/jak1/levels/sunken/target-tube_REF.gc @@ -761,7 +761,7 @@ (set! (-> self state-time) (-> *display* base-frame-counter)) (logior! (-> self state-flags) (state-flags being-attacked)) (set! (-> self game hit-time) (-> *display* base-frame-counter)) - (when (zero? (logand (-> arg1 mask) (attack-mask vector))) + (when (not (logtest? (-> arg1 mask) (attack-mask vector))) (vector-! (-> arg1 vector) (vector+float*! (new 'stack-no-clear 'vector) (-> self tube foretube) (-> self tube downtube) 20480.0) @@ -875,7 +875,7 @@ (until (ja-done? 0) (compute-alignment! (-> self align)) (let ((gp-2 (new 'stack-no-clear 'vector))) - (when (zero? (logand (-> self align flags) (align-flags disabled))) + (when (not (logtest? (-> self align flags) (align-flags disabled))) (vector-matrix*! gp-2 (the-as vector (-> self align delta)) (-> self control unknown-matrix01)) (vector-float*! (-> self control transv) gp-2 (-> *display* frames-per-second)) ) diff --git a/test/decompiler/reference/jak1/levels/village1/village-obs_REF.gc b/test/decompiler/reference/jak1/levels/village1/village-obs_REF.gc index 060860a9fe..bf09ae2ef4 100644 --- a/test/decompiler/reference/jak1/levels/village1/village-obs_REF.gc +++ b/test/decompiler/reference/jak1/levels/village1/village-obs_REF.gc @@ -463,7 +463,7 @@ ;; definition for method 12 of type windspinner (defmethod run-logic? windspinner ((obj windspinner)) - (or (zero? (logand (-> obj mask) (process-mask actor-pause))) + (or (not (logtest? (-> obj mask) (process-mask actor-pause))) (or (and (nonzero? (-> obj draw)) (logtest? (-> obj draw status) (draw-status was-drawn)) (>= (+ (-> *ACTOR-bank* pause-dist) (-> obj root pause-adjust-distance)) diff --git a/test/decompiler/reference/jak1/levels/village_common/villagep-obs_REF.gc b/test/decompiler/reference/jak1/levels/village_common/villagep-obs_REF.gc index e0a26af3a5..04cba7533a 100644 --- a/test/decompiler/reference/jak1/levels/village_common/villagep-obs_REF.gc +++ b/test/decompiler/reference/jak1/levels/village_common/villagep-obs_REF.gc @@ -137,8 +137,8 @@ (and (>= (-> self level-slot) 0) (not (movie?)) (not (level-hint-displayed?)) - (zero? (logand (-> *target* control root-prim prim-core action) (collide-action ca-7 ca-8 ca-9 ca-12 ca-13 ca-14)) - ) + (not (logtest? (-> *target* control root-prim prim-core action) (collide-action ca-7 ca-8 ca-9 ca-12 ca-13 ca-14)) + ) (let* ((v1-16 (-> self root)) (a1-2 (-> *target* control trans)) (f0-1 (vector-y-angle (vector-! (new 'stack-no-clear 'vector) a1-2 (-> v1-16 trans)))) diff --git a/test/decompiler/reference/jak2/engine/anim/aligner_REF.gc b/test/decompiler/reference/jak2/engine/anim/aligner_REF.gc index 3b9a358d06..8e193a9831 100644 --- a/test/decompiler/reference/jak2/engine/anim/aligner_REF.gc +++ b/test/decompiler/reference/jak2/engine/anim/aligner_REF.gc @@ -144,7 +144,7 @@ @returns the `root` of the [[process-drawable]] after the method returns @see [[process-drawable::16]]" - (when (zero? (logand (-> obj flags) (align-flags disabled))) + (when (not (logtest? (-> obj flags) (align-flags disabled))) (let* ((process (-> obj process)) (method-call (method-of-object process apply-alignment)) (transform (-> obj delta)) @@ -184,7 +184,7 @@ ;; definition for method 11 of type align-control (defmethod align-vel-and-quat-only! align-control ((obj align-control) (arg0 align-opts) (arg1 vector) (arg2 int) (arg3 float) (arg4 float)) - (when (zero? (logand (-> obj flags) (align-flags disabled))) + (when (not (logtest? (-> obj flags) (align-flags disabled))) (let ((s5-0 (-> obj delta))) (let ((a0-1 (-> obj process root transv))) (if (logtest? arg0 (align-opts adjust-y-vel)) @@ -214,7 +214,3 @@ ) (-> obj process root) ) - - - - diff --git a/test/decompiler/reference/jak2/engine/anim/joint-mod_REF.gc b/test/decompiler/reference/jak2/engine/anim/joint-mod_REF.gc index 93a82bdcd6..b7072b2ccd 100644 --- a/test/decompiler/reference/jak2/engine/anim/joint-mod_REF.gc +++ b/test/decompiler/reference/jak2/engine/anim/joint-mod_REF.gc @@ -1260,10 +1260,10 @@ ) ) ) - (if (zero? (logand (-> s5-0 track-mode) (track-mode no-trans))) + (if (not (logtest? (-> s5-0 track-mode) (track-mode no-trans))) (vector+! (-> arg1 trans) (-> arg1 trans) (-> s5-0 trans)) ) - (when (zero? (logand (-> s5-0 track-mode) (track-mode no-rotate))) + (when (not (logtest? (-> s5-0 track-mode) (track-mode no-rotate))) (let* ((v1-9 (-> s3-0 (-> s5-0 ear))) (a1-4 (quaternion-axis-angle! (new 'stack-no-clear 'quaternion) @@ -1302,7 +1302,7 @@ ) ) ) - (when (zero? (logand (-> s5-0 track-mode) (track-mode no-scale))) + (when (not (logtest? (-> s5-0 track-mode) (track-mode no-scale))) (let ((a1-9 (-> arg1 scale))) (let ((v1-22 (-> arg1 scale)) (a0-11 (-> s5-0 scale)) @@ -1361,13 +1361,13 @@ ;; WARN: Return type mismatch int vs none. (defbehavior joint-mod-joint-set-handler process ((arg0 cspace) (arg1 transformq)) (let ((s4-0 (the-as joint-mod (-> arg0 param1)))) - (if (zero? (logand (-> s4-0 track-mode) (track-mode no-trans))) + (if (not (logtest? (-> s4-0 track-mode) (track-mode no-trans))) (set! (-> arg1 trans quad) (-> s4-0 trans quad)) ) - (if (zero? (logand (-> s4-0 track-mode) (track-mode no-rotate))) + (if (not (logtest? (-> s4-0 track-mode) (track-mode no-rotate))) (quaternion-copy! (-> arg1 quat) (-> s4-0 quat)) ) - (if (zero? (logand (-> s4-0 track-mode) (track-mode no-scale))) + (if (not (logtest? (-> s4-0 track-mode) (track-mode no-scale))) (set! (-> arg1 scale quad) (-> s4-0 scale quad)) ) ) @@ -1472,13 +1472,13 @@ ) (init-vf0-vector) (let ((s5-0 (the-as joint-mod (-> arg0 param1)))) - (if (zero? (logand (-> s5-0 track-mode) (track-mode no-trans))) + (if (not (logtest? (-> s5-0 track-mode) (track-mode no-trans))) (vector+! (-> arg1 trans) (-> arg1 trans) (-> s5-0 trans)) ) - (if (zero? (logand (-> s5-0 track-mode) (track-mode no-rotate))) + (if (not (logtest? (-> s5-0 track-mode) (track-mode no-rotate))) (quaternion-normalize! (quaternion*! (-> arg1 quat) (-> arg1 quat) (-> s5-0 quat))) ) - (when (zero? (logand (-> s5-0 track-mode) (track-mode no-scale))) + (when (not (logtest? (-> s5-0 track-mode) (track-mode no-scale))) (let ((a1-4 (-> arg1 scale))) (let ((v1-11 (-> arg1 scale)) (a0-4 (-> s5-0 scale)) diff --git a/test/decompiler/reference/jak2/engine/anim/joint_REF.gc b/test/decompiler/reference/jak2/engine/anim/joint_REF.gc index 29dd4d2ae8..d4e22d4c5c 100644 --- a/test/decompiler/reference/jak2/engine/anim/joint_REF.gc +++ b/test/decompiler/reference/jak2/engine/anim/joint_REF.gc @@ -992,7 +992,7 @@ (v0-0 (the-as object (-> arg0 data arg2 data))) ) (cond - ((zero? (logand (-> arg0 fixed hdr matrix-bits) 1)) + ((not (logtest? (-> arg0 fixed hdr matrix-bits) 1)) (set! v1-1 (cond ((zero? arg1) (return (the-as matrix v1-1)) @@ -1011,7 +1011,7 @@ (set! v0-0 (-> (the-as (inline-array vector) v0-0) 4)) ) ) - (if (zero? (logand (-> arg0 fixed hdr matrix-bits) 2)) + (if (not (logtest? (-> arg0 fixed hdr matrix-bits) 2)) (return (the-as matrix v1-1)) ) (the-as matrix v0-0) diff --git a/test/decompiler/reference/jak2/engine/camera/cam-combiner_REF.gc b/test/decompiler/reference/jak2/engine/camera/cam-combiner_REF.gc index ff254f12aa..d0b736cede 100644 --- a/test/decompiler/reference/jak2/engine/camera/cam-combiner_REF.gc +++ b/test/decompiler/reference/jak2/engine/camera/cam-combiner_REF.gc @@ -285,7 +285,7 @@ ) 0 ) - (when (and (zero? (logand (-> *camera* master-options) 1)) (!= (-> self tracking-status) 0)) + (when (and (not (logtest? (-> *camera* master-options) 1)) (!= (-> self tracking-status) 0)) (set! (-> self tracking-status) (the-as uint 0)) 0 ) diff --git a/test/decompiler/reference/jak2/engine/camera/cam-layout_REF.gc b/test/decompiler/reference/jak2/engine/camera/cam-layout_REF.gc index c1c25ef899..5afac5b654 100644 --- a/test/decompiler/reference/jak2/engine/camera/cam-layout_REF.gc +++ b/test/decompiler/reference/jak2/engine/camera/cam-layout_REF.gc @@ -2468,7 +2468,7 @@ ) (format arg0 ": on") ) - ((zero? (logand ((method-of-type res-lump get-property-value) + ((not (logtest? ((method-of-type res-lump get-property-value) (-> self cam-entity) (the-as symbol arg2) 'exact @@ -2479,7 +2479,7 @@ ) s5-0 ) - ) + ) (format arg0 ": off(maya)") ) (else @@ -3380,13 +3380,13 @@ ((and (logtest? (-> arg0 options) 8) (logtest? (-> *cpad-list* cpads 0 button0-abs 0) (-> arg0 button))) #f ) - ((and (zero? (logand (-> arg0 options) 28)) + ((and (not (logtest? (-> arg0 options) 28)) (logtest? (-> arg0 options) 1) (zero? (logand (-> *cpad-list* cpads 0 button0-rel 0) (-> arg0 button))) ) #f ) - ((and (zero? (logand (-> arg0 options) 29)) + ((and (not (logtest? (-> arg0 options) 29)) (zero? (logand (-> *cpad-list* cpads 0 button0-abs 0) (-> arg0 button))) ) #f diff --git a/test/decompiler/reference/jak2/engine/camera/cam-states-dbg_REF.gc b/test/decompiler/reference/jak2/engine/camera/cam-states-dbg_REF.gc index ddda1bb7fe..a362b505b9 100644 --- a/test/decompiler/reference/jak2/engine/camera/cam-states-dbg_REF.gc +++ b/test/decompiler/reference/jak2/engine/camera/cam-states-dbg_REF.gc @@ -51,7 +51,7 @@ (let ((s5-0 (new-stack-vector0)) (gp-0 (new-stack-vector0)) ) - (when (zero? (logand (-> *camera* settings master-options) (cam-master-options IGNORE_ANALOG))) + (when (not (logtest? (-> *camera* settings master-options) (cam-master-options IGNORE_ANALOG))) (let ((f28-0 (analog-input (the-as int (-> *cpad-list* cpads 0 leftx)) 128.0 48.0 110.0 -1.0)) (f30-0 (analog-input (the-as int (-> *cpad-list* cpads 0 lefty)) 128.0 48.0 110.0 -1.0)) (f26-0 (analog-input (the-as int (-> *cpad-list* cpads 0 rightx)) 128.0 48.0 110.0 -1.0)) @@ -369,7 +369,7 @@ ) ) ) - (when (zero? (logand (-> *camera* settings master-options) (cam-master-options IGNORE_ANALOG))) + (when (not (logtest? (-> *camera* settings master-options) (cam-master-options IGNORE_ANALOG))) (let ((f28-14 (analog-input (the-as int (-> *cpad-list* cpads arg3 leftx)) 128.0 48.0 110.0 -1.0)) (f30-14 (analog-input (the-as int (-> *cpad-list* cpads arg3 lefty)) 128.0 48.0 110.0 -1.0)) (f26-0 (analog-input (the-as int (-> *cpad-list* cpads arg3 rightx)) 128.0 48.0 110.0 -1.0)) diff --git a/test/decompiler/reference/jak2/engine/camera/cam-states_REF.gc b/test/decompiler/reference/jak2/engine/camera/cam-states_REF.gc index 6b7a53b9d6..315c013deb 100644 --- a/test/decompiler/reference/jak2/engine/camera/cam-states_REF.gc +++ b/test/decompiler/reference/jak2/engine/camera/cam-states_REF.gc @@ -400,7 +400,7 @@ (none) ) :trans (behavior () - (if (zero? (logand (-> *camera* master-options) 1)) + (if (not (logtest? (-> *camera* master-options) 1)) (cam-slave-go cam-free-floating) ) (none) @@ -532,7 +532,7 @@ (none) ) :trans (behavior () - (if (zero? (logand (-> *camera* master-options) 1)) + (if (not (logtest? (-> *camera* master-options) 1)) (go cam-free-floating) ) (none) @@ -544,7 +544,7 @@ (let ((s4-0 (vector-reset! (new-stack-vector0))) (s5-0 (new-stack-matrix0)) ) - (when (zero? (logand (-> *camera* settings master-options) (cam-master-options IGNORE_ANALOG))) + (when (not (logtest? (-> *camera* settings master-options) (cam-master-options IGNORE_ANALOG))) (let ((f30-0 (analog-input (the-as int (+ (-> *cpad-list* cpads 0 rightx) -256 (-> *cpad-list* cpads 0 leftx))) 0.0 @@ -594,7 +594,7 @@ ) (matrix-axis-angle! s5-0 (-> *camera* local-down) (-> s4-0 y)) (matrix*! (the-as matrix (-> self tracking)) (the-as matrix (-> self tracking)) s5-0) - (when (zero? (logand (-> self options) 8)) + (when (not (logtest? (-> self options) 8)) (if (< (vector-dot (the-as vector (&-> self stack 96)) (-> *camera* local-down)) 0.0) (forward-down->inv-matrix (the-as matrix (-> self tracking)) @@ -611,7 +611,7 @@ (matrix-axis-angle! s5-0 (the-as vector (-> self tracking)) (- (-> s4-0 x))) (matrix*! (the-as matrix (-> self tracking)) (the-as matrix (-> self tracking)) s5-0) ) - (when (zero? (logand (-> self options) 8)) + (when (not (logtest? (-> self options) 8)) (let ((f30-1 (vector-dot (-> *camera* local-down) (the-as vector (&-> self stack 112))))) (set! (-> (new 'stack-no-clear 'vector) quad) (the-as uint128 0)) (when (< (sin (-> *CAM_EYE-bank* max-degrees)) (fabs f30-1)) @@ -739,7 +739,7 @@ (none) ) :trans (behavior () - (if (zero? (logand (-> *camera* master-options) 1)) + (if (not (logtest? (-> *camera* master-options) 1)) (cam-slave-go cam-free-floating) ) (none) @@ -879,7 +879,7 @@ (f28-0 (acos f0-1)) (s4-0 (new 'stack-no-clear 'matrix)) ) - (when (zero? (logand (-> *camera* settings master-options) (cam-master-options IGNORE_ANALOG))) + (when (not (logtest? (-> *camera* settings master-options) (cam-master-options IGNORE_ANALOG))) (let ((f24-0 (analog-input (the-as int (-> *cpad-list* cpads 0 rightx)) 128.0 @@ -1157,7 +1157,7 @@ ;; failed to figure out what this is: (defstate cam-circular (camera-slave) :trans (behavior () - (if (zero? (logand (-> *camera* master-options) 1)) + (if (not (logtest? (-> *camera* master-options) 1)) (cam-slave-go cam-free-floating) ) (none) @@ -1188,7 +1188,7 @@ (none) ) :trans (behavior () - (if (zero? (logand (-> *camera* master-options) 1)) + (if (not (logtest? (-> *camera* master-options) 1)) (cam-slave-go cam-free-floating) ) (none) @@ -2199,7 +2199,7 @@ (cam-los-setup-lateral arg2 s4-1 arg1) ) (cond - ((zero? (logand (-> self options) 1024)) + ((not (logtest? (-> self options) 1024)) ) ((= (-> self string-vel-dir) 5) ) @@ -5160,7 +5160,7 @@ (none) ) :trans (behavior () - (if (zero? (logand (-> *camera* master-options) 1)) + (if (not (logtest? (-> *camera* master-options) 1)) (cam-slave-go cam-free-floating) ) (none) @@ -5246,11 +5246,11 @@ (none) ) :trans (behavior () - (if (zero? (logand (-> *camera* master-options) 1)) + (if (not (logtest? (-> *camera* master-options) 1)) (cam-slave-go cam-free-floating) ) (when (not (paused?)) - (when (zero? (logand (-> *camera* settings master-options) (cam-master-options IGNORE_ANALOG))) + (when (not (logtest? (-> *camera* settings master-options) (cam-master-options IGNORE_ANALOG))) (let ((f0-0 (analog-input (the-as int (-> *cpad-list* cpads 0 righty)) 128.0 32.0 110.0 0.05))) (cond ((< (* 0.05 (- 1.0 (-> self view-off-param))) f0-0) @@ -5271,7 +5271,7 @@ (set! (-> self view-off z) (lerp (-> *CAM_STICK-bank* min-z) (-> *CAM_STICK-bank* max-z) (-> self view-off-param)) ) - (when (zero? (logand (-> *camera* settings master-options) (cam-master-options IGNORE_ANALOG))) + (when (not (logtest? (-> *camera* settings master-options) (cam-master-options IGNORE_ANALOG))) (let ((f0-16 (analog-input (the-as int (-> *cpad-list* cpads 0 rightx)) 128.0 @@ -5396,7 +5396,7 @@ (none) ) :trans (behavior () - (if (zero? (logand (-> *camera* master-options) 1)) + (if (not (logtest? (-> *camera* master-options) 1)) (cam-slave-go cam-free-floating) ) (none) diff --git a/test/decompiler/reference/jak2/engine/camera/camera_REF.gc b/test/decompiler/reference/jak2/engine/camera/camera_REF.gc index 8f339d38d0..048c0f188a 100644 --- a/test/decompiler/reference/jak2/engine/camera/camera_REF.gc +++ b/test/decompiler/reference/jak2/engine/camera/camera_REF.gc @@ -939,7 +939,7 @@ ) (set! (-> obj free-point) -134250495) (dotimes (v1-21 32) - (when (zero? (logand s5-0 1)) + (when (not (logtest? s5-0 1)) (set! (-> obj point v1-21 next) (-> obj free-point)) (set! (-> obj free-point) v1-21) ) diff --git a/test/decompiler/reference/jak2/engine/debug/editable-player_REF.gc b/test/decompiler/reference/jak2/engine/debug/editable-player_REF.gc index 22c47677ef..9c22228633 100644 --- a/test/decompiler/reference/jak2/engine/debug/editable-player_REF.gc +++ b/test/decompiler/reference/jak2/engine/debug/editable-player_REF.gc @@ -2663,7 +2663,7 @@ (dotimes (gp-1 (-> *level* length)) (let ((v1-14 (-> *level* level gp-1))) (when (= (-> v1-14 status) 'active) - (if (zero? (logand *fix-visible-level-mask* (ash 1 (-> v1-14 index)))) + (if (not (logtest? *fix-visible-level-mask* (ash 1 (-> v1-14 index)))) (insert-sample-camera (-> v1-14 name)) ) ) diff --git a/test/decompiler/reference/jak2/engine/debug/editable_REF.gc b/test/decompiler/reference/jak2/engine/debug/editable_REF.gc index 39a6859d12..11ddc7b59e 100644 --- a/test/decompiler/reference/jak2/engine/debug/editable_REF.gc +++ b/test/decompiler/reference/jak2/engine/debug/editable_REF.gc @@ -1423,7 +1423,7 @@ (the-as rgba (-> (new 'static 'array uint64 1 #x800000ff) 0)) (the-as rgba (-> (new 'static 'array uint64 1 #x8000ffff) 0)) ) - (if (zero? (logand (-> obj flags) (editable-flag orient))) + (if (not (logtest? (-> obj flags) (editable-flag orient))) (the-as rgba (-> (new 'static 'array uint64 1 #x800000ff) 0)) (the-as rgba (-> (new 'static 'array uint64 1 #x8000ffff) 0)) ) @@ -1785,7 +1785,7 @@ (the-as rgba (-> (new 'static 'array uint64 1 #x800000ff) 0)) (the-as rgba (-> (new 'static 'array uint64 1 #x8000ffff) 0)) ) - (if (zero? (logand (-> obj flags) (editable-flag orient))) + (if (not (logtest? (-> obj flags) (editable-flag orient))) (the-as rgba (-> (new 'static 'array uint64 1 #x800000ff) 0)) (the-as rgba (-> (new 'static 'array uint64 1 #x8000ffff) 0)) ) diff --git a/test/decompiler/reference/jak2/engine/debug/menu_REF.gc b/test/decompiler/reference/jak2/engine/debug/menu_REF.gc index 68b5c94dcf..674af1d75f 100644 --- a/test/decompiler/reference/jak2/engine/debug/menu_REF.gc +++ b/test/decompiler/reference/jak2/engine/debug/menu_REF.gc @@ -1450,7 +1450,7 @@ ;; definition for function debug-menu-item-var-joypad-handler (defun debug-menu-item-var-joypad-handler ((arg0 debug-menu-item-var) (arg1 debug-menu-msg)) (cond - ((zero? (logand (-> *cpad-list* cpads arg1 button0-abs 0) (pad-buttons x))) + ((not (cpad-hold? arg1 x)) (let ((a0-2 (-> arg0 parent context))) (debug-menu-context-release-joypad a0-2) ) diff --git a/test/decompiler/reference/jak2/engine/debug/nav/mysql-nav-graph_REF.gc b/test/decompiler/reference/jak2/engine/debug/nav/mysql-nav-graph_REF.gc index ef0b0cbbed..88fd7e70b2 100644 --- a/test/decompiler/reference/jak2/engine/debug/nav/mysql-nav-graph_REF.gc +++ b/test/decompiler/reference/jak2/engine/debug/nav/mysql-nav-graph_REF.gc @@ -1194,9 +1194,9 @@ ) (countdown (v1-7 (-> obj edge-array length)) (let ((a1-17 (the-as mysql-nav-edge (+ (+ (* 80 v1-7) 12) (the-as int (-> obj edge-array)))))) - (when (zero? (logand (-> a1-17 mysql-save-flag) (mysql-save-flag delete))) + (when (not (logtest? (-> a1-17 mysql-save-flag) (mysql-save-flag delete))) (let ((a2-8 (-> obj node-array data (-> a1-17 runtime-node-id-1)))) - (when (zero? (logand (-> a2-8 mysql-save-flag) (mysql-save-flag delete))) + (when (not (logtest? (-> a2-8 mysql-save-flag) (mysql-save-flag delete))) (cond ((-> a2-8 temp-edge-list) (set! (-> a1-17 temp-next-edge) (the-as mysql-nav-edge (-> a2-8 temp-edge-list))) @@ -1235,13 +1235,13 @@ ) (dotimes (s5-0 (-> obj node-array length)) (let ((s4-0 (-> obj node-array data s5-0))) - (when (zero? (logand (-> s4-0 mysql-save-flag) (mysql-save-flag delete))) + (when (not (logtest? (-> s4-0 mysql-save-flag) (mysql-save-flag delete))) (let ((v1-10 (lookup-level-info2 obj s4-0 #t))) (set! (-> s4-0 level-node-index) (-> v1-10 node-count)) (+! (-> v1-10 node-count) 1) (let ((a0-10 (the-as mysql-nav-edge (-> s4-0 temp-edge-list)))) (while a0-10 - (when (zero? (logand (-> a0-10 mysql-save-flag) (mysql-save-flag delete))) + (when (not (logtest? (-> a0-10 mysql-save-flag) (mysql-save-flag delete))) (if (!= (-> v1-10 level) (-> obj node-array data (-> a0-10 runtime-node-id-2) level_name)) (+! (-> v1-10 to-link-count) 1) ) diff --git a/test/decompiler/reference/jak2/engine/draw/drawable-tree_REF.gc b/test/decompiler/reference/jak2/engine/draw/drawable-tree_REF.gc index 2ae38a813c..741d1f8a73 100644 --- a/test/decompiler/reference/jak2/engine/draw/drawable-tree_REF.gc +++ b/test/decompiler/reference/jak2/engine/draw/drawable-tree_REF.gc @@ -70,7 +70,7 @@ (set! t1-6 (&-> t1-6 1)) (let ((t4-0 128)) (label cfg-7) - (b! (zero? (logand t3-0 t4-0)) cfg-9 :delay (set! t5-1 (the-as uint (-> arg1 0)))) + (b! (not (logtest? t3-0 t4-0)) cfg-9 :delay (set! t5-1 (the-as uint (-> arg1 0)))) (set! arg1 (&-> arg1 1)) (set! (-> (the-as (pointer int8) t2-3) 0) (the-as int t5-1)) (label cfg-9) diff --git a/test/decompiler/reference/jak2/engine/entity/entity_REF.gc b/test/decompiler/reference/jak2/engine/entity/entity_REF.gc index dc688dbcba..30caf091c7 100644 --- a/test/decompiler/reference/jak2/engine/entity/entity_REF.gc +++ b/test/decompiler/reference/jak2/engine/entity/entity_REF.gc @@ -465,7 +465,7 @@ ) (let ((s5-1 format) (s4-0 "~C~C~C") - (a2-0 (if (and arg0 (zero? (logand (-> *kernel-context* prevent-from-run) (-> arg0 mask))) (run-logic? arg0)) + (a2-0 (if (and arg0 (not (logtest? (-> *kernel-context* prevent-from-run) (-> arg0 mask))) (run-logic? arg0)) 114 32 ) @@ -2170,7 +2170,7 @@ ) ) ) - (when (zero? (logand (-> obj status) (entity-perm-status bit-5))) + (when (not (logtest? (-> obj status) (entity-perm-status bit-5))) (set! (-> obj user-uint64) (the-as uint 0)) 0 ) @@ -2231,7 +2231,7 @@ ) ) (let ((s5-1 (lambda ((arg0 process)) - (if (zero? (logand (-> arg0 mask) (process-mask no-kill))) + (if (not (logtest? (-> arg0 mask) (process-mask no-kill))) (deactivate arg0) ) (none) @@ -2286,7 +2286,7 @@ ;; definition for method 12 of type process-drawable (defmethod run-logic? process-drawable ((obj process-drawable)) - (or (zero? (logand (-> obj mask) (process-mask actor-pause))) + (or (not (logtest? (-> obj mask) (process-mask actor-pause))) (or (>= (+ (-> *ACTOR-bank* pause-dist) (-> obj root pause-adjust-distance)) (vector-vector-distance (-> obj root trans) (math-camera-pos)) ) @@ -2298,7 +2298,7 @@ ;; definition for method 9 of type entity-links (defmethod birth? entity-links ((obj entity-links) (arg0 vector)) - (and (zero? (logand (-> obj perm status) (entity-perm-status bit-0 dead))) + (and (not (logtest? (-> obj perm status) (entity-perm-status bit-0 dead))) (< (vector-vector-distance (-> obj trans) arg0) (-> *ACTOR-bank* birth-dist)) ) ) @@ -2386,7 +2386,7 @@ ) (else (if (and (-> v1-54 process) - (zero? (logand (-> v1-54 perm status) (entity-perm-status no-kill))) + (not (logtest? (-> v1-54 perm status) (entity-perm-status no-kill))) (zero? (logand (-> v1-54 process mask) (process-mask no-kill))) ) (kill! (-> v1-54 entity)) @@ -2404,7 +2404,7 @@ (dotimes (s2-1 s3-2) (let ((v1-67 (-> s4-3 data s2-1))) (cond - ((zero? (logand (-> v1-67 kill-mask) sv-32)) + ((not (logtest? (-> v1-67 kill-mask) sv-32)) (when (not (or (-> v1-67 process) (logtest? (-> v1-67 perm status) (entity-perm-status bit-0 dead)))) (birth! (-> v1-67 entity)) (set! sv-24 (+ sv-24 1)) @@ -2415,7 +2415,7 @@ ) (else (if (and (-> v1-67 process) - (zero? (logand (-> v1-67 perm status) (entity-perm-status no-kill))) + (not (logtest? (-> v1-67 perm status) (entity-perm-status no-kill))) (zero? (logand (-> v1-67 process mask) (process-mask no-kill))) ) (kill! (-> v1-67 entity)) @@ -2434,7 +2434,7 @@ (let ((s1-0 (-> s4-4 data s2-2))) (cond ((and (< (vector-vector-distance (-> s1-0 trans) sv-16) (-> *ACTOR-bank* birth-dist)) - (zero? (logand (-> s1-0 perm status) (entity-perm-status bit-9 bit-10))) + (not (logtest? (-> s1-0 perm status) (entity-perm-status bit-9 bit-10))) (zero? (logand (-> s1-0 kill-mask) sv-32)) ) (when (not (or (-> s1-0 process) (logtest? (-> s1-0 perm status) (entity-perm-status bit-0 dead)))) @@ -2447,7 +2447,7 @@ ) (else (if (and (-> s1-0 process) - (zero? (logand (-> s1-0 perm status) (entity-perm-status no-kill))) + (not (logtest? (-> s1-0 perm status) (entity-perm-status no-kill))) (zero? (logand (-> s1-0 process mask) (process-mask no-kill))) ) (kill! (-> s1-0 entity)) @@ -2468,8 +2468,8 @@ (set! sv-48 (-> s3-4 data s1-1)) (cond ((and (is-object-visible? s4-1 (-> sv-48 vis-id)) - (zero? (logand (-> sv-48 perm status) (entity-perm-status bit-9 bit-10))) - (zero? (logand (-> sv-48 kill-mask) sv-32)) + (not (logtest? (-> sv-48 perm status) (entity-perm-status bit-9 bit-10))) + (not (logtest? (-> sv-48 kill-mask) sv-32)) (or (-> s4-1 vis-info 0) (< (vector-vector-distance (-> sv-48 trans) sv-16) (-> sv-48 vis-dist))) ) (when (not (or (-> sv-48 process) (logtest? (-> sv-48 perm status) (entity-perm-status bit-0 dead)) s0-0)) @@ -2492,7 +2492,7 @@ ) (else (when (and (-> sv-48 process) - (zero? (logand (-> sv-48 perm status) (entity-perm-status no-kill))) + (not (logtest? (-> sv-48 perm status) (entity-perm-status no-kill))) (zero? (logand (-> sv-48 process mask) (process-mask no-kill))) ) (kill! (-> sv-48 entity)) diff --git a/test/decompiler/reference/jak2/engine/game/game-info_REF.gc b/test/decompiler/reference/jak2/engine/game/game-info_REF.gc index 40000f2689..de255ddb53 100644 --- a/test/decompiler/reference/jak2/engine/game/game-info_REF.gc +++ b/test/decompiler/reference/jak2/engine/game/game-info_REF.gc @@ -1276,7 +1276,7 @@ (let ((conts (-> (the-as level-load-info (-> (the-as symbol (car levels)) value)) continues))) (while (not (null? conts)) (let ((cont (the-as continue-point (car conts)))) - (if (zero? (logand (-> cont flags) (continue-flags cf2))) + (if (not (logtest? (-> cont flags) (continue-flags cf2))) (format #t "~S~%" (-> cont name)) ) ) diff --git a/test/decompiler/reference/jak2/engine/game/settings_REF.gc b/test/decompiler/reference/jak2/engine/game/settings_REF.gc index 19a034924f..97d49e373a 100644 --- a/test/decompiler/reference/jak2/engine/game/settings_REF.gc +++ b/test/decompiler/reference/jak2/engine/game/settings_REF.gc @@ -28,7 +28,7 @@ (let ((s1-0 (-> (the-as connection s3-1) param0))) (case s1-0 (('sfx-volume) - (if (or (zero? (logand (-> *kernel-context* prevent-from-run) (process-mask progress))) + (if (or (not (logtest? (-> *kernel-context* prevent-from-run) (process-mask progress))) (= ((method-of-type connection get-process) (the-as connection s3-1)) (ppointer->process *progress-process*)) ) (user-setting-data-method-10 @@ -497,7 +497,7 @@ (let ((s1-0 (-> (the-as connection s3-1) param0))) (case s1-0 (('sfx-volume) - (if (or (zero? (logand (-> *kernel-context* prevent-from-run) (process-mask progress))) + (if (or (not (logtest? (-> *kernel-context* prevent-from-run) (process-mask progress))) (= ((method-of-type connection get-process) (the-as connection s3-1)) (ppointer->process *progress-process*)) ) (cam-setting-data-method-10 diff --git a/test/decompiler/reference/jak2/engine/game/task/task-control_REF.gc b/test/decompiler/reference/jak2/engine/game/task/task-control_REF.gc index abbbaa169d..b61e6b4f10 100644 --- a/test/decompiler/reference/jak2/engine/game/task/task-control_REF.gc +++ b/test/decompiler/reference/jak2/engine/game/task/task-control_REF.gc @@ -561,7 +561,7 @@ (let ((node (-> game-nodes i))) (if (and (= (-> node level) (-> cur-lev info taskname)) (!= (-> node level) 'city) - (zero? (logand (game-task-node-flag no-restart) (-> node flags))) + (not (logtest? (game-task-node-flag no-restart) (-> node flags))) (open? node) ) (set! gp-1 (the-as int (-> node task))) @@ -674,7 +674,7 @@ (dotimes (i (-> game-nodes length)) (when (nonzero? i) (let ((node (-> game-nodes i))) - (when (and (zero? (logand (-> node flags) (game-task-node-flag closed))) + (when (and (not (logtest? (-> node flags) (game-task-node-flag closed))) (begin (dotimes (a3-3 4) (when (and (nonzero? (-> node parent-node a3-3)) @@ -723,7 +723,7 @@ ;; definition for method 9 of type game-task-node-info (defmethod close! game-task-node-info ((obj game-task-node-info) (arg0 symbol)) - (when (zero? (logand (-> obj flags) (game-task-node-flag closed))) + (when (not (logtest? (-> obj flags) (game-task-node-flag closed))) (let ((task-node-close-func (lambda ((arg0 game-task-node-info)) (with-pp @@ -882,7 +882,7 @@ (let ((game-nodes (-> *game-info* sub-task-list)) (node-info obj) ) - (and (zero? (logand (-> node-info flags) (game-task-node-flag closed))) + (and (not (logtest? (-> node-info flags) (game-task-node-flag closed))) (begin (dotimes (pi 4) (let ((t0-0 (-> node-info parent-node pi))) @@ -1015,7 +1015,7 @@ ) (('try) (if (and (not (task-complete? *game-info* (-> node task))) - (or (zero? (logand (-> node flags) (game-task-node-flag save-on-life save-on-try))) + (or (not (logtest? (-> node flags) (game-task-node-flag save-on-life save-on-try))) (logtest? (-> node flags) (game-task-node-flag reset-on-try)) ) ) @@ -1467,7 +1467,7 @@ ;; definition for method 16 of type fail-mission (defmethod print-text fail-mission ((obj fail-mission)) - (when (and (zero? (logand (-> obj flags) (fail-mission-flags famflags-6))) + (when (and (not (logtest? (-> obj flags) (fail-mission-flags famflags-6))) (= (gui-control-method-17 *gui-control* (the-as sound-id (-> obj message-id))) (gui-action playing)) ) (let ((gp-0 (new @@ -1612,8 +1612,8 @@ ) (logior! (-> self flags) (fail-mission-flags famflags-1)) (set! (-> self grabbed-time) (-> self clock frame-counter)) - (when (zero? (logand (-> self flags) (fail-mission-flags famflags-3))) - (when (zero? (logand (-> self flags) (fail-mission-flags famflags-5))) + (when (not (logtest? (-> self flags) (fail-mission-flags famflags-3))) + (when (not (logtest? (-> self flags) (fail-mission-flags famflags-5))) (while (< (- (-> self clock frame-counter) (-> self grabbed-time)) (seconds 1.5)) (let ((f30-0 (lerp-scale 0.0 1.0 (the float (- (-> self clock frame-counter) (-> self grabbed-time))) 0.0 450.0))) (set-filter-color! @@ -1832,7 +1832,7 @@ (the-as (function gui-connection symbol) #f) (the-as process #f) ) - (when (zero? (logand (-> arg0 flags) (fail-mission-flags famflags-4))) + (when (not (logtest? (-> arg0 flags) (fail-mission-flags famflags-4))) (if (not (and *target* (logtest? (-> *target* focus-status) (focus-status dead)) (zero? (-> self message)))) (set! (-> self stinger) (the-as @@ -1847,7 +1847,7 @@ (set-setting! 'speech-control #f 0 0) (set! (-> self clock) (-> *display* base-clock)) (apply-settings *setting-control*) - (if (or (zero? (logand (-> self flags) (fail-mission-flags famflags-2))) + (if (or (not (logtest? (-> self flags) (fail-mission-flags famflags-2))) (nonzero? (-> self fail-message)) (= (-> self message) (fail-mission-message fammsg-1)) ) @@ -2133,7 +2133,7 @@ (with-pp (the-as symbol - (and (or (zero? (logand (-> obj node-info flags) (game-task-node-flag city-wait))) + (and (or (not (logtest? (-> obj node-info flags) (game-task-node-flag city-wait))) (let ((a0-2 (level-get-target-inside *level*))) (cond ((not (and a0-2 (logtest? (-> a0-2 info level-flags) 1))) @@ -2161,7 +2161,7 @@ :event task-manager-event-handler :trans (behavior () (if (or (and (nonzero? (-> self info final-node)) (task-node-closed? (-> self info final-node))) - (and (zero? (logand (-> self node-info flags) (game-task-node-flag closed))) + (and (not (logtest? (-> self node-info flags) (game-task-node-flag closed))) (not (open? (-> self node-info))) ) ) diff --git a/test/decompiler/reference/jak2/engine/geometry/path_REF.gc b/test/decompiler/reference/jak2/engine/geometry/path_REF.gc index 14f1f7ba66..55787d96ee 100644 --- a/test/decompiler/reference/jak2/engine/geometry/path_REF.gc +++ b/test/decompiler/reference/jak2/engine/geometry/path_REF.gc @@ -160,7 +160,7 @@ @param search-type The only recognized value is `exact` @returns the point closest to some arbitrary percentage along the path @see [[path-control::10]]" - (if (zero? (logand (-> obj flags) (path-control-flag not-found))) + (if (not (logtest? (-> obj flags) (path-control-flag not-found))) (curve-evaluate! arg0 arg1 @@ -186,7 +186,7 @@ @param idx Either the vertex index or also partially the interpolant in a LERP @param search-type The only recognized value is `exact` @returns Either a distinct vertex along the path, or some fractional point between two vertices" - (if (zero? (logand (-> obj flags) (path-control-flag not-found))) + (if (not (logtest? (-> obj flags) (path-control-flag not-found))) (curve-evaluate! arg0 (/ arg1 (the float (+ (-> obj curve num-cverts) -1))) @@ -285,7 +285,7 @@ @param idx The vertex index @param mag The magnitude to scale the resulting displacement vector by @returns The displacement [[vector]] between two points in the path, the last 2, or the [[*null-vector*]]" - (when (zero? (logand (-> obj flags) (path-control-flag not-found))) + (when (not (logtest? (-> obj flags) (path-control-flag not-found))) (let ((s4-0 (new 'stack-no-clear 'vector))) (curve-evaluate! arg0 diff --git a/test/decompiler/reference/jak2/engine/gfx/sprite/particles/sparticle-launcher_REF.gc b/test/decompiler/reference/jak2/engine/gfx/sprite/particles/sparticle-launcher_REF.gc index 88d8921646..d905c4d299 100644 --- a/test/decompiler/reference/jak2/engine/gfx/sprite/particles/sparticle-launcher_REF.gc +++ b/test/decompiler/reference/jak2/engine/gfx/sprite/particles/sparticle-launcher_REF.gc @@ -508,7 +508,7 @@ (matrix*! s5-0 s5-0 arg3) (vector3s-rotate*! (the-as vector3s (-> arg0 launchrot)) (the-as vector3s (-> arg0 launchrot)) s5-0) (vector3s-rotate*! (the-as vector3s (-> arg1 vel-sxvel)) (the-as vector3s (-> arg1 vel-sxvel)) s5-0) - (if (zero? (logand (sp-cpuinfo-flag use-global-acc) (-> arg1 flags))) + (if (not (logtest? (sp-cpuinfo-flag use-global-acc) (-> arg1 flags))) (vector3s-rotate*! (the-as vector3s (-> arg1 acc)) (the-as vector3s (-> arg1 acc)) s5-0) ) (if (logtest? (sp-cpuinfo-flag set-conerot) (-> arg1 flags)) @@ -596,7 +596,7 @@ ) (vector3s-rotate*! (the-as vector3s (-> arg0 launchrot)) (the-as vector3s (-> arg0 launchrot)) s5-0) (vector3s-rotate*! (the-as vector3s (-> arg1 vel-sxvel)) (the-as vector3s (-> arg1 vel-sxvel)) s5-0) - (if (zero? (logand (sp-cpuinfo-flag use-global-acc) (-> arg1 flags))) + (if (not (logtest? (sp-cpuinfo-flag use-global-acc) (-> arg1 flags))) (vector3s-rotate*! (the-as vector3s (-> arg1 acc)) (the-as vector3s (-> arg1 acc)) s5-0) ) ) @@ -803,7 +803,7 @@ (set! (-> arg2 next-launcher) (the-as basic 0)) (cond ((and (logtest? (-> arg2 flags) (sp-cpuinfo-flag sp-cpuinfo-flag-12)) - (zero? (logand (-> arg2 flags) (sp-cpuinfo-flag distort))) + (not (logtest? (-> arg2 flags) (sp-cpuinfo-flag distort))) (zero? (logand (-> arg2 flags) (sp-cpuinfo-flag glow))) ) (let ((f20-0 (-> arg3 r-g-b-a x)) diff --git a/test/decompiler/reference/jak2/engine/gfx/sprite/particles/sparticle_REF.gc b/test/decompiler/reference/jak2/engine/gfx/sprite/particles/sparticle_REF.gc index 4649b0413c..b7bba1e875 100644 --- a/test/decompiler/reference/jak2/engine/gfx/sprite/particles/sparticle_REF.gc +++ b/test/decompiler/reference/jak2/engine/gfx/sprite/particles/sparticle_REF.gc @@ -503,7 +503,7 @@ ;; definition for function sparticle-kill-it-level0 ;; WARN: Return type mismatch int vs none. (defun sparticle-kill-it-level0 ((arg0 sparticle-system) (arg1 sparticle-cpuinfo)) - (if (zero? (logand (-> arg1 flags) (sp-cpuinfo-flag sp-cpuinfo-flag-9 level0 level1))) + (if (not (logtest? (-> arg1 flags) (sp-cpuinfo-flag sp-cpuinfo-flag-9 level0 level1))) (sparticle-kill-it arg0 arg1) ) 0 diff --git a/test/decompiler/reference/jak2/engine/load/loader_REF.gc b/test/decompiler/reference/jak2/engine/load/loader_REF.gc index e2da50d148..f35ee993ec 100644 --- a/test/decompiler/reference/jak2/engine/load/loader_REF.gc +++ b/test/decompiler/reference/jak2/engine/load/loader_REF.gc @@ -1177,7 +1177,7 @@ (restore-load-state-and-cleanup *load-state*) (set! (-> *art-control* active-stream) #f) (logclear! (-> self skel status) (joint-control-status spooling spooling-not-last-block)) - (if (zero? (logand (-> self skel status) (joint-control-status sync-math))) + (if (not (logtest? (-> self skel status) (joint-control-status sync-math))) (logclear! (-> self skel status) (joint-control-status sync-math)) ) (cond diff --git a/test/decompiler/reference/jak2/engine/math/math_REF.gc b/test/decompiler/reference/jak2/engine/math/math_REF.gc index 733ff11455..774930df70 100644 --- a/test/decompiler/reference/jak2/engine/math/math_REF.gc +++ b/test/decompiler/reference/jak2/engine/math/math_REF.gc @@ -531,7 +531,7 @@ (let ((v1-0 1)) (while (nonzero? arg0) (+! arg0 -1) - (if (zero? (logand arg1 v1-0)) + (if (not (logtest? arg1 v1-0)) (+! s4-0 1) ) (set! v1-0 (* v1-0 2)) diff --git a/test/decompiler/reference/jak2/engine/ps2/pad_REF.gc b/test/decompiler/reference/jak2/engine/ps2/pad_REF.gc index a135141414..86a531f447 100644 --- a/test/decompiler/reference/jak2/engine/ps2/pad_REF.gc +++ b/test/decompiler/reference/jak2/engine/ps2/pad_REF.gc @@ -300,7 +300,7 @@ (cpad-get-data pad) (adjust-to-screen-flip pad) (cond - ((zero? (logand (-> pad valid) 128)) + ((not (logtest? (-> pad valid) 128)) (dotimes (buzz-i 2) (cond ((and (-> pad buzz) (< (get-current-time) (-> pad buzz-time buzz-i)) (= *master-mode* 'game)) diff --git a/test/decompiler/reference/jak2/engine/ps2/timer_REF.gc b/test/decompiler/reference/jak2/engine/ps2/timer_REF.gc index 8246088f7c..ef2666cfe4 100644 --- a/test/decompiler/reference/jak2/engine/ps2/timer_REF.gc +++ b/test/decompiler/reference/jak2/engine/ps2/timer_REF.gc @@ -189,7 +189,7 @@ ;; definition for method 11 of type clock (defmethod tick! clock ((obj clock)) - (if (zero? (logand (-> obj mask) (-> *kernel-context* prevent-from-run))) + (if (not (logtest? (-> obj mask) (-> *kernel-context* prevent-from-run))) (advance-by! obj (* (-> *display* time-factor) (-> *display* dog-ratio) (-> obj clock-ratio))) (set! (-> obj sparticle-data x) 0.0) ) diff --git a/test/decompiler/reference/jak2/engine/target/board/board-h_REF.gc b/test/decompiler/reference/jak2/engine/target/board/board-h_REF.gc index df213e44dc..d0a6cbb632 100644 --- a/test/decompiler/reference/jak2/engine/target/board/board-h_REF.gc +++ b/test/decompiler/reference/jak2/engine/target/board/board-h_REF.gc @@ -417,13 +417,13 @@ ) (-> self board latch?) ) - (zero? (logand (focus-status dead hit grabbed in-head edge-grab pole board pilot mech dark) (-> self focus-status)) - ) + (not (logtest? (focus-status dead hit grabbed in-head edge-grab pole board pilot mech dark) (-> self focus-status)) + ) (or (zero? (-> self board)) (>= (- (-> self clock frame-counter) (-> self board board-time)) (seconds 0.5))) - (zero? (logand (state-flags sf17) (-> self state-flags))) + (not (logtest? (state-flags sf17) (-> self state-flags))) (< (-> self board board-time) (-> self control unknown-time-frame05)) - (zero? (logand (surface-flag no-board) (-> self control unknown-surface01 flags))) - (or (zero? (logand (-> self control unknown-surface01 flags) (surface-flag duck))) + (not (logtest? (surface-flag no-board) (-> self control unknown-surface01 flags))) + (or (not (logtest? (-> self control unknown-surface01 flags) (surface-flag duck))) (begin self (can-exit-duck?)) ) (not (and (logtest? (-> self water flags) (water-flags under-water)) diff --git a/test/decompiler/reference/jak2/engine/target/board/board-states_REF.gc b/test/decompiler/reference/jak2/engine/target/board/board-states_REF.gc index f8160360f4..78b4ee44b3 100644 --- a/test/decompiler/reference/jak2/engine/target/board/board-states_REF.gc +++ b/test/decompiler/reference/jak2/engine/target/board/board-states_REF.gc @@ -375,7 +375,7 @@ (t9-8 (the-as vector a0-4) (the-as float a1-0)) ) ) - (when (zero? (logand (-> self control old-status) (cshape-moving-flags on-surface))) + (when (not (logtest? (-> self control old-status) (cshape-moving-flags on-surface))) (let ((gp-0 (new 'stack-no-clear 'vector))) (set! (-> gp-0 quad) (-> self control trans quad)) (set! (-> gp-0 y) (+ 2048.0 (-> gp-0 y))) @@ -521,8 +521,8 @@ (if (and (cpad-pressed? (-> self control unknown-cpad-info00 number) x) (< (vector-dot (-> self control dynam gravity-normal) (-> self control transv)) 12288.0) (< -61440.0 (vector-dot (-> self control dynam gravity-normal) (-> self control transv))) - (and (zero? (logand (water-flags touch-water) (-> self water flags))) - (zero? (logand (-> self state-flags) (state-flags sf7))) + (and (not (logtest? (water-flags touch-water) (-> self water flags))) + (not (logtest? (-> self state-flags) (state-flags sf7))) (not (and (-> self next-state) (= (-> self next-state name) 'target-board-wall-kick))) ) ) @@ -618,7 +618,7 @@ ) :trans (behavior () (if (and (cpad-hold? (-> self control unknown-cpad-info00 number) l1) - (zero? (logand (-> self state-flags) (state-flags sf9))) + (not (logtest? (-> self state-flags) (state-flags sf9))) (< (- (-> self clock frame-counter) (-> self control unknown-time-frame06)) (the-as time-frame (-> *TARGET-bank* ground-timeout)) ) @@ -817,8 +817,7 @@ (none) ) :trans (behavior () - (if (and (or (zero? (logand (-> *cpad-list* cpads (-> self control unknown-cpad-info00 number) button0-abs 0) (pad-buttons l1)) - ) + (if (and (or (not (cpad-hold? (-> self control unknown-cpad-info00 number) l1)) (logtest? (-> self state-flags) (state-flags sf9)) (>= (- (-> self clock frame-counter) (-> self control unknown-time-frame06)) (the-as time-frame (-> *TARGET-bank* ground-timeout)) @@ -1675,8 +1674,7 @@ (let ((f0-9 (analog-input (the int (* 128.0 (-> s5-0 z))) 0.0 96.0 110.0 1.0)) (s4-0 0) ) - (while (not (and (or (zero? (logand (-> *cpad-list* cpads (-> self control unknown-cpad-info00 number) button0-abs 0) (pad-buttons r1)) - ) + (while (not (and (or (not (cpad-hold? (-> self control unknown-cpad-info00 number) r1)) (or (= f0-9 0.0) (jump-hit-ground-stuck?) (< (target-time-to-ground) (seconds 0.5))) ) (nonzero? s4-0) @@ -1842,8 +1840,7 @@ (set! (-> v1-0 z) (* -0.0078125 (+ -128.0 (the float (-> self control unknown-cpad-info00 lefty))))) (set! (-> v1-0 w) 1.0) (let ((f30-0 (analog-input (the int (* 128.0 (-> v1-0 z))) 0.0 96.0 110.0 1.0))) - (while (not (or (zero? (logand (-> *cpad-list* cpads (-> self control unknown-cpad-info00 number) button0-abs 0) (pad-buttons l1)) - ) + (while (not (or (not (cpad-hold? (-> self control unknown-cpad-info00 number) l1)) (jump-hit-ground-stuck?) (< (target-time-to-ground) (seconds 0.3)) ) @@ -2009,8 +2006,7 @@ (let ((f0-9 (analog-input (the int (* 128.0 (-> s5-0 z))) 0.0 96.0 110.0 1.0)) (s4-0 0) ) - (while (not (and (or (zero? (logand (-> *cpad-list* cpads (-> self control unknown-cpad-info00 number) button0-abs 0) (pad-buttons r1)) - ) + (while (not (and (or (not (cpad-hold? (-> self control unknown-cpad-info00 number) r1)) (or (= f0-9 0.0) (jump-hit-ground-stuck?) (< (target-time-to-ground) (seconds 0.5))) ) (nonzero? s4-0) @@ -3236,7 +3232,7 @@ ) self ((method-of-type attack-info attack-info-method-11)) - (when (zero? (logand (-> gp-0 mask) (attack-info-mask vector))) + (when (not (logtest? (-> gp-0 mask) (attack-info-mask vector))) (vector-z-quaternion! (-> gp-0 vector) (-> self control unknown-quaternion00)) (vector-xz-normalize! (-> gp-0 vector) (- (fabs (-> gp-0 shove-back)))) (set! (-> gp-0 vector y) (-> gp-0 shove-up)) diff --git a/test/decompiler/reference/jak2/engine/target/board/board-util_REF.gc b/test/decompiler/reference/jak2/engine/target/board/board-util_REF.gc index 9df181ff7d..8b1b026f32 100644 --- a/test/decompiler/reference/jak2/engine/target/board/board-util_REF.gc +++ b/test/decompiler/reference/jak2/engine/target/board/board-util_REF.gc @@ -62,7 +62,7 @@ :virtual #t :trans (behavior () (let ((v1-0 (-> self parent))) - (if (zero? (logand (-> (the-as target (if v1-0 + (if (not (logtest? (-> (the-as target (if v1-0 (the-as target (-> v1-0 0 self)) ) ) @@ -70,7 +70,7 @@ ) (focus-status in-head) ) - ) + ) (go-virtual idle #f) ) ) @@ -168,14 +168,14 @@ ((let ((v1-9 #x40000) (a0-3 (-> self parent)) ) - (zero? (logand (the-as focus-status v1-9) (-> (the-as target (if a0-3 + (not (logtest? (the-as focus-status v1-9) (-> (the-as target (if a0-3 (the-as target (-> a0-3 0 self)) ) ) focus-status ) ) - ) + ) ) (go-virtual idle #f) ) diff --git a/test/decompiler/reference/jak2/engine/target/board/target-board_REF.gc b/test/decompiler/reference/jak2/engine/target/board/target-board_REF.gc index efa988bcce..e010d318d5 100644 --- a/test/decompiler/reference/jak2/engine/target/board/target-board_REF.gc +++ b/test/decompiler/reference/jak2/engine/target/board/target-board_REF.gc @@ -923,7 +923,7 @@ ) (set! gp-0 1) ) - ((zero? (logand (-> self control status) (cshape-moving-flags on-surface))) + ((not (logtest? (-> self control status) (cshape-moving-flags on-surface))) (set! gp-0 2) ) ) @@ -1271,7 +1271,7 @@ (when (and (logtest? (-> self control status) (cshape-moving-flags t-wall)) (and (< 16384.0 f30-0) (not (and (-> self next-state) (= (-> self next-state name) 'target-board-smack))) - (zero? (logand (focus-status halfpipe) (-> self focus-status))) + (not (logtest? (focus-status halfpipe) (-> self focus-status))) (!= (-> self control ground-pat mode) 3) (>= (- (-> self clock frame-counter) (-> self board halfpipe-time)) (seconds 0.1)) ) @@ -1473,10 +1473,7 @@ (logior! (-> self control root-prim prim-core action) (collide-action check-edge)) (logclear! (-> self control root-prim prim-core action) (collide-action check-edge)) ) - (if (zero? (logand (-> *cpad-list* cpads (-> self control unknown-cpad-info00 number) button0-abs 0) - (pad-buttons circle square) - ) - ) + (if (not (cpad-hold? (-> self control unknown-cpad-info00 number) circle square)) (set! (-> self board ride-lock) #f) ) (cond @@ -1584,7 +1581,7 @@ (set! (-> self board unknown-time-frame00) (-> self clock frame-counter)) ) ) - (when (and (zero? (logand (-> self control status) (cshape-moving-flags on-surface))) + (when (and (not (logtest? (-> self control status) (cshape-moving-flags on-surface))) (< 0.0 f28-0) (or (and (or (< (target-height-above-ground) 4096.0) (< (- (-> self clock frame-counter) (-> self board unknown-time-frame00)) (seconds 0.1)) @@ -1668,14 +1665,14 @@ ) (if (and (= (-> self control unknown-float12) 0.0) (>= (-> self clock frame-counter) (-> self control unknown-time-frame00)) - (zero? (logand (-> self control unknown-surface01 flags) (surface-flag turn-to-vel))) + (not (logtest? (-> self control unknown-surface01 flags) (surface-flag turn-to-vel))) (>= (- (-> self clock frame-counter) (-> self board unknown-time-frame00)) (seconds 0.1)) ) (rot->dir-targ! (-> self control)) ) (when (and (< (- (-> self clock frame-counter) (-> self control unknown-time-frame06)) (seconds 0.1)) (>= (-> self clock frame-counter) (-> self control unknown-time-frame00)) - (zero? (logand (-> self control unknown-surface01 flags) (surface-flag turn-to-vel))) + (not (logtest? (-> self control unknown-surface01 flags) (surface-flag turn-to-vel))) (>= (- (-> self clock frame-counter) (-> self board unknown-time-frame00)) (seconds 0.1)) ) (let* ((s3-0 @@ -2268,7 +2265,7 @@ (set! (-> self control transv quad) (-> s5-0 quad)) ) ) - (when (zero? (logand s4-3 64)) + (when (not (logtest? s4-3 64)) (vector-float*! (new 'stack-no-clear 'vector) (-> self control dynam gravity-normal) 819.2) ((method-of-object (-> self control) collide-shape-method-28)) ) diff --git a/test/decompiler/reference/jak2/engine/target/gun/gun-h_REF.gc b/test/decompiler/reference/jak2/engine/target/gun/gun-h_REF.gc index f01f5efe6b..857e3b571a 100644 --- a/test/decompiler/reference/jak2/engine/target/gun/gun-h_REF.gc +++ b/test/decompiler/reference/jak2/engine/target/gun/gun-h_REF.gc @@ -466,19 +466,19 @@ (local-vars (v1-36 symbol)) (and (logtest? (-> arg0 game features) (game-feature unk-game-feature-06)) (>= (- (-> self clock frame-counter) (-> arg0 gun gun-time)) (seconds 0.1)) - (zero? (logand (focus-status dead hit board mech dark teleporting) (-> arg0 focus-status))) - (zero? (logand (surface-flag gun-inactive gun-hide gun-off) (-> arg0 control unknown-surface01 flags))) - (zero? (logand (state-flags sf18) (-> arg0 state-flags))) + (not (logtest? (focus-status dead hit board mech dark teleporting) (-> arg0 focus-status))) + (not (logtest? (surface-flag gun-inactive gun-hide gun-off) (-> arg0 control unknown-surface01 flags))) + (not (logtest? (state-flags sf18) (-> arg0 state-flags))) (logtest? (logand (-> *setting-control* user-current features) (game-feature gun-yellow gun-red gun-blue gun-dark)) (-> arg0 game features) ) - (or (zero? (logand (-> arg0 control unknown-surface01 flags) (surface-flag duck))) (can-exit-duck?)) - (or (zero? (logand (focus-status pilot) (-> arg0 focus-status))) (-> arg0 pilot gun?)) + (or (not (logtest? (-> arg0 control unknown-surface01 flags) (surface-flag duck))) (can-exit-duck?)) + (or (not (logtest? (focus-status pilot) (-> arg0 focus-status))) (-> arg0 pilot gun?)) (or arg1 (nonzero? (-> arg0 gun using-gun-type)) (begin (set! v1-36 (and (cpad-hold? (-> arg0 control unknown-cpad-info00 number) r1) - (zero? (logand (-> arg0 focus-status) (focus-status grabbed))) + (not (logtest? (-> arg0 focus-status) (focus-status grabbed))) (begin (set! v1-36 #t) (set! (-> arg0 gun latch?) v1-36) v1-36) ) ) diff --git a/test/decompiler/reference/jak2/engine/target/logic-target_REF.gc b/test/decompiler/reference/jak2/engine/target/logic-target_REF.gc index e3a204c12f..86b690c49c 100644 --- a/test/decompiler/reference/jak2/engine/target/logic-target_REF.gc +++ b/test/decompiler/reference/jak2/engine/target/logic-target_REF.gc @@ -667,7 +667,7 @@ (< 0.7 (-> self control unknown-float27)) (and (< (-> self control unknown-float05) 8192.0) (logtest? (-> self control status) (cshape-moving-flags t-wall)) - (zero? (logand (-> self control status) (cshape-moving-flags t-act))) + (not (logtest? (-> self control status) (cshape-moving-flags t-act))) (or (= (-> self control unknown-pat-surface00 event) (pat-event hide)) (let ((a0-2 (level-get-target-inside *level*))) (and a0-2 (logtest? (-> a0-2 info level-flags) 1)) @@ -990,7 +990,7 @@ ) (vector-matrix*! s2-0 s3-1 (-> self control unknown-matrix01)) (let ((f28-0 (vector-vector-xz-distance s3-1 s4-0))) - (when (and (zero? (logand (-> self control status) (cshape-moving-flags t-surface))) + (when (and (not (logtest? (-> self control status) (cshape-moving-flags t-surface))) (let ((v1-51 gp-0)) (< (sqrtf (+ (* (-> v1-51 x) (-> v1-51 x)) (* (-> v1-51 z) (-> v1-51 z)))) (sqrtf (+ (* (-> s3-1 x) (-> s3-1 x)) (* (-> s3-1 z) (-> s3-1 z)))) @@ -1006,7 +1006,7 @@ ) ) ) - (if (and (zero? (logand (-> self control status) (cshape-moving-flags t-wall))) + (if (and (not (logtest? (-> self control status) (cshape-moving-flags t-wall))) (logtest? (-> self control old-status) (cshape-moving-flags t-wall)) (logtest? (-> self control unknown-surface00 flags) (surface-flag air)) (< 0.0 (-> gp-0 y)) @@ -1025,7 +1025,7 @@ (if (< (- (-> self clock frame-counter) (-> self control unknown-time-frame09)) (seconds 0.2)) (set! f30-0 (+ 204800.0 f30-0)) ) - (if (and (zero? (logand (-> self control status) (cshape-moving-flags t-wall))) + (if (and (not (logtest? (-> self control status) (cshape-moving-flags t-wall))) (and (logtest? (-> self control old-status) (cshape-moving-flags t-wall)) (logtest? (-> self control unknown-surface00 flags) (surface-flag air)) (< 0.0 (-> gp-0 y)) @@ -1175,10 +1175,10 @@ ((logtest? (surface-flag turn-to-alt) (-> self control unknown-surface01 flags)) (-> self control unknown-vector03) ) - ((and (or (zero? (logand (logior (-> self control status) (-> self control old-status)) + ((and (or (not (logtest? (logior (-> self control status) (-> self control old-status)) (cshape-moving-flags on-surface t-surface) ) - ) + ) (< (- (-> self clock frame-counter) (-> self control unknown-time-frame07)) (seconds 0.5)) (not (and (-> self next-state) (let ((v1-15 (-> self next-state name))) (or (= v1-15 'target-walk) (= v1-15 'target-gun-walk)) @@ -1641,7 +1641,7 @@ (set! (-> self control unknown-time-frame06) (-> self clock frame-counter)) (set! (-> self control unknown-vector21 quad) (-> self control trans quad)) (if (and (>= (-> self control coverage) 1.0) - (zero? (logand (-> self control status) (cshape-moving-flags t-act on-water))) + (not (logtest? (-> self control status) (cshape-moving-flags t-act on-water))) (logtest? (-> self control status) (cshape-moving-flags on-ground)) ) (set! (-> self control unknown-vector23 quad) (-> self control trans quad)) @@ -1669,12 +1669,12 @@ ) (when (and (cpad-pressed? (-> self control unknown-cpad-info00 number) r3) (zero? (-> self control unknown-word07)) - (zero? (logand (-> *kernel-context* prevent-from-run) (process-mask movie))) + (not (logtest? (-> *kernel-context* prevent-from-run) (process-mask movie))) (not *pause-lock*) ) (if (and (= (-> self cam-user-mode) 'normal) (logtest? (-> self control unknown-surface00 flags) (surface-flag look-around)) - (zero? (logand (focus-status edge-grab pole flut tube board pilot dark) (-> self focus-status))) + (not (logtest? (focus-status edge-grab pole flut tube board pilot dark) (-> self focus-status))) (-> *setting-control* user-current allow-look-around) (>= (- (-> self clock frame-counter) (the-as int (-> self no-look-around-wait))) (seconds 0.05)) (not (and (= (-> self control ground-pat material) (pat-material ice)) @@ -1735,7 +1735,7 @@ (cpad-hold? (-> self control unknown-cpad-info00 number) r2) (cpad-hold? (-> self control unknown-cpad-info00 number) l2) (not *pause-lock*) - (zero? (logand (focus-status grabbed in-head pilot) (-> self focus-status))) + (not (logtest? (focus-status grabbed in-head pilot) (-> self focus-status))) (not (and (-> self next-state) (let ((v1-167 (-> self next-state name))) (or (= v1-167 'target-darkjak-get-on) (= v1-167 'target-float)) ) @@ -1819,8 +1819,8 @@ (and (or (not (and (= *cheat-mode* 'debug) (cpad-hold? (-> self control unknown-cpad-info00 number) r2))) *pause-lock* ) - (zero? (logand (focus-status flut pilot mech indax) (-> self focus-status))) - (zero? (logand (-> self state-flags) (state-flags sf7))) + (not (logtest? (focus-status flut pilot mech indax) (-> self focus-status))) + (not (logtest? (-> self state-flags) (state-flags sf7))) #t ) ) @@ -2406,7 +2406,7 @@ ) (cond ((and (and (-> self next-state) (= (-> self next-state name) 'target-clone-anim)) - (and (zero? (logand (-> self draw status) (draw-control-status no-draw))) + (and (not (logtest? (-> self draw status) (draw-control-status no-draw))) (begin (vector<-cspace! s5-0 (-> self node-list data 3)) (set! (-> s5-0 y) (+ -5896.192 (-> s5-0 y))) diff --git a/test/decompiler/reference/jak2/engine/target/target_REF.gc b/test/decompiler/reference/jak2/engine/target/target_REF.gc index 181b3683b5..7dc08720e7 100644 --- a/test/decompiler/reference/jak2/engine/target/target_REF.gc +++ b/test/decompiler/reference/jak2/engine/target/target_REF.gc @@ -290,7 +290,7 @@ (if (and (cpad-pressed? (-> self control unknown-cpad-info00 number) square) (can-hands? #t)) (go target-running-attack) ) - (if (and (zero? (logand (-> self control status) (cshape-moving-flags on-surface))) + (if (and (not (logtest? (-> self control status) (cshape-moving-flags on-surface))) (>= (- (-> self clock frame-counter) (-> self control unknown-time-frame06)) (seconds 0.08)) ) (go target-falling #f) @@ -817,8 +817,7 @@ ) :trans (behavior () ((-> self state-hook)) - (if (and (or (zero? (logand (-> *cpad-list* cpads (-> self control unknown-cpad-info00 number) button0-abs 0) (pad-buttons l1)) - ) + (if (and (or (not (cpad-hold? (-> self control unknown-cpad-info00 number) l1)) (logtest? (-> self state-flags) (state-flags sf9)) ) (let ((v1-13 (ja-group))) @@ -858,7 +857,7 @@ (if (and (cpad-pressed? (-> self control unknown-cpad-info00 number) square) (can-hands? #t) (begin self (can-exit-duck?)) - (zero? (logand (-> self control unknown-surface01 flags) (surface-flag no-jump))) + (not (logtest? (-> self control unknown-surface01 flags) (surface-flag no-jump))) (zero? (logand (-> self state-flags) (state-flags sf7))) ) (go @@ -976,8 +975,7 @@ :trans (behavior () (local-vars (v1-22 joint-control-channel)) ((-> self state-hook)) - (when (and (or (zero? (logand (-> *cpad-list* cpads (-> self control unknown-cpad-info00 number) button0-abs 0) (pad-buttons l1)) - ) + (when (and (or (not (cpad-hold? (-> self control unknown-cpad-info00 number) l1)) (logtest? (-> self state-flags) (state-flags sf9)) (and (logtest? (water-flags wading) (-> self water flags)) (>= (- (- (-> self control trans y) (- (-> self water base-height) (-> self water wade-height)))) 2457.6) @@ -1016,7 +1014,7 @@ (if (and (cpad-pressed? (-> self control unknown-cpad-info00 number) square) (can-hands? #t) (begin self (can-exit-duck?)) - (zero? (logand (-> self control unknown-surface01 flags) (surface-flag no-jump))) + (not (logtest? (-> self control unknown-surface01 flags) (surface-flag no-jump))) (zero? (logand (-> self state-flags) (state-flags sf7))) ) (go @@ -1163,7 +1161,7 @@ (* 12288.0 (-> self darkjak-giant-interp) (-> self darkjak-giant-interp)) ) (and (< -61440.0 (vector-dot (-> self control dynam gravity-normal) (-> self control transv))) - (zero? (logand (water-flags touch-water) (-> self water flags))) + (not (logtest? (water-flags touch-water) (-> self water flags))) (zero? (logand (state-flags sf7 sf23) (-> self state-flags))) ) ) @@ -1177,8 +1175,8 @@ (and (>= (- (-> self clock frame-counter) (-> self control unknown-time-frame14)) (the-as time-frame (-> *TARGET-bank* stuck-timeout)) ) - (zero? (logand (-> self state-flags) (state-flags sf8))) - (zero? (logand (-> self control unknown-surface01 flags) (surface-flag no-attack no-hands))) + (not (logtest? (-> self state-flags) (state-flags sf8))) + (not (logtest? (-> self control unknown-surface01 flags) (surface-flag no-attack no-hands))) (not (and (not (using-gun? self)) (!= (-> self skel top-anim interp) 0.0))) ) ) @@ -1433,8 +1431,8 @@ (and (>= (- (-> self clock frame-counter) (-> self control unknown-time-frame14)) (the-as time-frame (-> *TARGET-bank* stuck-timeout)) ) - (zero? (logand (-> self state-flags) (state-flags sf8))) - (zero? (logand (-> self control unknown-surface01 flags) (surface-flag no-attack no-hands))) + (not (logtest? (-> self state-flags) (state-flags sf8))) + (not (logtest? (-> self control unknown-surface01 flags) (surface-flag no-attack no-hands))) (not (and (not (using-gun? self)) (!= (-> self skel top-anim interp) 0.0))) ) ) @@ -1593,8 +1591,8 @@ (and (>= (- (-> self clock frame-counter) (-> self control unknown-time-frame14)) (the-as time-frame (-> *TARGET-bank* stuck-timeout)) ) - (zero? (logand (-> self state-flags) (state-flags sf8))) - (zero? (logand (-> self control unknown-surface01 flags) (surface-flag no-attack no-hands))) + (not (logtest? (-> self state-flags) (state-flags sf8))) + (not (logtest? (-> self control unknown-surface01 flags) (surface-flag no-attack no-hands))) (not (and (not (using-gun? self)) (!= (-> self skel top-anim interp) 0.0))) ) ) @@ -2575,11 +2573,11 @@ ) ) ) - (zero? (logand (-> self state-flags) (state-flags sf7 sf8))) - (zero? (logand (-> self control unknown-surface01 flags) (surface-flag no-attack))) + (not (logtest? (-> self state-flags) (state-flags sf7 sf8))) + (not (logtest? (-> self control unknown-surface01 flags) (surface-flag no-attack))) (let ((v1-48 (ja-group))) (and (not (and v1-48 (= v1-48 (-> self draw art-group data 406)))) - (and (zero? (logand (-> self control unknown-surface01 flags) (surface-flag no-jump))) + (and (not (logtest? (-> self control unknown-surface01 flags) (surface-flag no-jump))) (zero? (logand (-> self state-flags) (state-flags sf7))) ) ) @@ -2691,7 +2689,7 @@ (when (not (ja-min? 0)) (cond ((and (>= (ja-aframe-num 0) 20.0) - (and (and (zero? (logand (-> self control status) (cshape-moving-flags on-surface))) + (and (and (not (logtest? (-> self control status) (cshape-moving-flags on-surface))) (>= (- (-> self clock frame-counter) (-> self control unknown-time-frame06)) (the-as time-frame (-> *TARGET-bank* ground-timeout)) ) @@ -2712,10 +2710,7 @@ ) (set-forward-vel 0.0) ) - ((and (zero? (logand (-> *cpad-list* cpads (-> self control unknown-cpad-info00 number) button0-abs 0) - (pad-buttons square) - ) - ) + ((and (not (cpad-hold? (-> self control unknown-cpad-info00 number) square)) (>= (- (-> self clock frame-counter) (-> self control unknown-combo-tracker00 move-start-time)) (seconds 0.05) ) @@ -2847,7 +2842,7 @@ (+! gp-2 1) ) ) - (if (and (zero? (logand (-> self control status) (cshape-moving-flags on-surface))) + (if (and (not (logtest? (-> self control status) (cshape-moving-flags on-surface))) (>= (- (-> self clock frame-counter) (-> self control unknown-time-frame06)) (the-as time-frame (-> *TARGET-bank* ground-timeout)) ) @@ -3340,8 +3335,8 @@ (and (>= (- (-> self clock frame-counter) (-> self control unknown-time-frame14)) (the-as time-frame (-> *TARGET-bank* stuck-timeout)) ) - (zero? (logand (-> self state-flags) (state-flags sf8))) - (zero? (logand (-> self control unknown-surface01 flags) (surface-flag no-attack no-hands))) + (not (logtest? (-> self state-flags) (state-flags sf8))) + (not (logtest? (-> self control unknown-surface01 flags) (surface-flag no-attack no-hands))) (not (and (not (using-gun? self)) (!= (-> self skel top-anim interp) 0.0))) ) ) @@ -3564,7 +3559,7 @@ (when (and (or (< (target-move-dist (seconds 0.1)) 1638.4) (and (logtest? (-> self control status) (cshape-moving-flags t-wall)) (< 0.7 (-> self control poly-angle))) ) - (zero? (logand (-> self control status) (cshape-moving-flags t-act))) + (not (logtest? (-> self control status) (cshape-moving-flags t-act))) (>= (the-as uint (-> self control unknown-word04)) (the-as uint 2)) ) (set! (-> self control unknown-time-frame14) (-> self clock frame-counter)) @@ -4160,7 +4155,7 @@ ) ) (set! (-> self state-time) (-> self clock frame-counter)) - (while (zero? (logand (-> self control status) (cshape-moving-flags on-surface))) + (while (not (logtest? (-> self control status) (cshape-moving-flags on-surface))) (when (>= (- (-> self clock frame-counter) (-> self state-time)) (seconds 0.01)) (let ((v1-50 (ja-group))) (when (not (and v1-50 (= v1-50 (-> self draw art-group data 27)))) diff --git a/test/decompiler/reference/jak2/kernel/gcommon_REF.gc b/test/decompiler/reference/jak2/kernel/gcommon_REF.gc index 65bacf3b23..ed511ec7e9 100644 --- a/test/decompiler/reference/jak2/kernel/gcommon_REF.gc +++ b/test/decompiler/reference/jak2/kernel/gcommon_REF.gc @@ -945,7 +945,7 @@ ;; definition for function print-tree-bitmask (defun print-tree-bitmask ((arg0 int) (arg1 int)) (dotimes (s4-0 arg1) - (if (zero? (logand arg0 1)) + (if (not (logtest? arg0 1)) (format #t " ") (format #t "| ") ) @@ -1050,7 +1050,7 @@ ) ((= arg1 binteger) (cond - ((zero? (logand (the-as int arg0) 7)) + ((not (logtest? (the-as int arg0) 7)) #t ) (else @@ -1063,7 +1063,7 @@ ) ((or (= arg1 symbol) (= arg1 boolean)) (cond - ((zero? (logand (the-as int arg0) 1)) + ((not (logtest? (the-as int arg0) 1)) (if arg2 (format arg4 "ERROR: object #x~X ~S is not a valid object of type '~A' (misaligned)~%" arg0 arg2 arg1) ) diff --git a/test/decompiler/reference/jak2/kernel/gkernel_REF.gc b/test/decompiler/reference/jak2/kernel/gkernel_REF.gc index 0c5b420b6f..95859aafdc 100644 --- a/test/decompiler/reference/jak2/kernel/gkernel_REF.gc +++ b/test/decompiler/reference/jak2/kernel/gkernel_REF.gc @@ -1054,7 +1054,7 @@ (defun execute-process-tree ((arg0 process-tree) (arg1 (function object object)) (arg2 kernel-context)) (logclear! (-> arg0 mask) (process-mask kernel-run)) (let ((s3-0 (or (logtest? (-> arg0 mask) (process-mask process-tree)) - (not (and (zero? (logand (-> arg2 prevent-from-run) (-> arg0 mask))) (run-logic? arg0))) + (not (and (not (logtest? (-> arg2 prevent-from-run) (-> arg0 mask))) (run-logic? arg0))) (begin (logior! (-> arg0 mask) (process-mask kernel-run)) (arg1 arg0)) ) ) @@ -1079,7 +1079,7 @@ ;; definition for function search-process-tree (defun search-process-tree ((arg0 process-tree) (arg1 (function process-tree object))) - (when (zero? (logand (-> arg0 mask) (process-mask process-tree))) + (when (not (logtest? (-> arg0 mask) (process-mask process-tree))) (if (arg1 arg0) (return arg0) ) diff --git a/test/decompiler/test_FormExpressionBuild.cpp b/test/decompiler/test_FormExpressionBuild.cpp index f7f849622e..c7cd45feae 100644 --- a/test/decompiler/test_FormExpressionBuild.cpp +++ b/test/decompiler/test_FormExpressionBuild.cpp @@ -2152,7 +2152,7 @@ TEST_F(FormRegressionTestJak1, ExprPrintTreeBitmask) { "(begin\n" " (dotimes\n" " (s4-0 arg1)\n" - " (if (zero? (logand arg0 1)) (format #t \" \") (format #t \"| \"))\n" + " (if (not (logtest? arg0 1)) (format #t \" \") (format #t \"| \"))\n" " (set! arg0 (shr arg0 1))\n" " )\n" " #f\n" diff --git a/test/decompiler/test_FormExpressionBuildLong.cpp b/test/decompiler/test_FormExpressionBuildLong.cpp index 3e1f41644b..b181e74657 100644 --- a/test/decompiler/test_FormExpressionBuildLong.cpp +++ b/test/decompiler/test_FormExpressionBuildLong.cpp @@ -1886,7 +1886,7 @@ TEST_F(FormRegressionTestJak1, ExprValid) { " )\n" " ((= arg1 binteger)\n" " (cond\n" - " ((zero? (logand (the-as int arg0) 7))\n" + " ((not (logtest? (the-as int arg0) 7))\n" " #t\n" " )\n" " (else\n"