diff --git a/decompiler/IR2/Form.cpp b/decompiler/IR2/Form.cpp index 15ed09a215..047f39e331 100644 --- a/decompiler/IR2/Form.cpp +++ b/decompiler/IR2/Form.cpp @@ -1877,6 +1877,8 @@ std::string fixed_operator_to_string(FixedOperatorKind kind) { return "vector-length"; case FixedOperatorKind::VECTOR_PLUS_FLOAT_TIMES: return "vector+float*!"; + case FixedOperatorKind::FOCUS_TEST: + return "focus-test?"; default: ASSERT(false); return ""; diff --git a/decompiler/IR2/FormExpressionAnalysis.cpp b/decompiler/IR2/FormExpressionAnalysis.cpp index f25e7de8f1..267bdf4550 100644 --- a/decompiler/IR2/FormExpressionAnalysis.cpp +++ b/decompiler/IR2/FormExpressionAnalysis.cpp @@ -4574,6 +4574,63 @@ FormElement* try_make_nonzero_logtest(Form* in, FormPool& pool) { return nullptr; } +FormElement* try_make_focus_test_macro(Form* in, FormPool& pool) { + /* +(defmacro focus-test? (pfoc &rest status) +`(logtest? (-> (the process-focusable ,pfoc) focus-status) (focus-status ,@status))) + +pfoc first: +(logtest? (-> self focus-status) (focus-status dead hit grabbed)) + +enum first: +(logtest? (focus-status mech) (-> a1-2 focus-status)) + */ + auto logtest_focus_matcher_pfoc = Matcher::op( + GenericOpMatcher::fixed(FixedOperatorKind::LOGTEST), + {Matcher::deref(Matcher::any(0), false, {DerefTokenMatcher::string("focus-status")}), + Matcher::op_with_rest(GenericOpMatcher::func(Matcher::constant_token("focus-status")), {})}); + auto logtest_focus_matcher_enum = Matcher::op( + GenericOpMatcher::fixed(FixedOperatorKind::LOGTEST), + { + Matcher::op_with_rest(GenericOpMatcher::func(Matcher::constant_token("focus-status")), + {}), + Matcher::deref(Matcher::any(0), false, {DerefTokenMatcher::string("focus-status")}), + }); + auto mr_logtest_pfoc = match(logtest_focus_matcher_pfoc, in); + auto mr_logtest_enum = match(logtest_focus_matcher_enum, in); + if (mr_logtest_pfoc.matched) { + auto logtest_elt = dynamic_cast(in->at(0)); + if (logtest_elt != nullptr) { + auto focus_form = logtest_elt->elts().at(1); + std::vector macro; + macro.push_back(mr_logtest_pfoc.maps.forms.at(0)); + auto* focus = dynamic_cast(focus_form->at(0)); + if (focus) { + macro.insert(macro.end(), focus->elts().begin(), focus->elts().end()); + } + + return pool.alloc_element( + GenericOperator::make_fixed(FixedOperatorKind::FOCUS_TEST), macro); + } + } + if (mr_logtest_enum.matched) { + auto logtest_elt = dynamic_cast(in->at(0)); + if (logtest_elt != nullptr) { + auto focus_form = logtest_elt->elts().at(0); + std::vector macro; + macro.push_back(mr_logtest_enum.maps.forms.at(0)); + auto* focus = dynamic_cast(focus_form->at(0)); + if (focus) { + macro.insert(macro.end(), focus->elts().begin(), focus->elts().end()); + } + + return pool.alloc_element( + GenericOperator::make_fixed(FixedOperatorKind::FOCUS_TEST), macro); + } + } + return nullptr; +} + FormElement* try_make_logtest_cpad_macro(Form* in, FormPool& pool) { /* (defmacro cpad-pressed (pad-idx) @@ -4682,10 +4739,17 @@ FormElement* ConditionElement::make_zero_check_generic(const Env& env, 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); + return pool.alloc_element( + GenericOperator::make_compare(IR2_Condition::Kind::FALSE), logtest_form); } - auto not_form = pool.alloc_element( + auto focus_test_macro = try_make_focus_test_macro(logtest_form, pool); + if (focus_test_macro) { + logtest_form = pool.alloc_single_form(nullptr, focus_test_macro); + return pool.alloc_element( + GenericOperator::make_compare(IR2_Condition::Kind::FALSE), logtest_form); + } + return 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); @@ -4726,6 +4790,10 @@ FormElement* ConditionElement::make_nonzero_check_generic(const Env& env, if (as_cpad_macro) { return as_cpad_macro; } + auto focus_test_macro = try_make_focus_test_macro(logtest_form, pool); + if (focus_test_macro) { + return focus_test_macro; + } return as_logtest; } @@ -5895,8 +5963,33 @@ void ConditionalMoveFalseElement::push_to_stack(const Env& env, FormPool& pool, auto as_cpad_macro = try_make_logtest_cpad_macro(logtest_form, pool); if (as_cpad_macro) { val = pool.alloc_single_form(nullptr, as_cpad_macro); - } else { - val = pool.alloc_single_form(nullptr, as_logtest); + } + if (!val) { + auto focus_test_macro = try_make_focus_test_macro(logtest_form, pool); + if (focus_test_macro) { + val = pool.alloc_single_form(nullptr, focus_test_macro); + } else { + val = pool.alloc_single_form(nullptr, as_logtest); + } + } + } + } else { + auto as_logtest = try_make_nonzero_logtest(popped.at(1), pool); + if (as_logtest) { + auto logtest_form = pool.alloc_single_form(nullptr, as_logtest); + auto not_form = pool.form( + GenericOperator::make_compare(IR2_Condition::Kind::FALSE), logtest_form); + auto as_cpad_macro = try_make_logtest_cpad_macro(not_form, pool); + if (as_cpad_macro) { + val = pool.alloc_single_form(nullptr, as_cpad_macro); + } + if (!val) { + auto focus_test_macro = try_make_focus_test_macro(not_form, pool); + if (focus_test_macro) { + val = pool.alloc_single_form(nullptr, focus_test_macro); + } else { + val = not_form; + } } } } diff --git a/decompiler/IR2/IR2_common.h b/decompiler/IR2/IR2_common.h index 5cff90092a..590c8e98ec 100644 --- a/decompiler/IR2/IR2_common.h +++ b/decompiler/IR2/IR2_common.h @@ -174,6 +174,7 @@ enum class FixedOperatorKind { SEND_EVENT, CPAD_PRESSED_P, CPAD_HOLD_P, + FOCUS_TEST, INVALID }; diff --git a/decompiler/analysis/variable_naming.cpp b/decompiler/analysis/variable_naming.cpp index efaac277c2..505cdcff21 100644 --- a/decompiler/analysis/variable_naming.cpp +++ b/decompiler/analysis/variable_naming.cpp @@ -736,6 +736,7 @@ void SSA::make_vars(const Function& function, const DecompilerTypeSystem& dts) { event_handler_hack = function.guessed_name.is_event_handler() || function.guessed_name.to_string() == "target-generic-event-handler" || function.guessed_name.to_string() == "target-standard-event-handler" || + function.guessed_name.to_string() == "target-board-handler" || function.guessed_name.to_string() == "(method 74 pegasus)" || function.guessed_name.to_string() == "(method 74 crimson-guard-level)" || function.guessed_name.to_string() == "widow-handler" || diff --git a/goal_src/jak1/engine/camera/cam-layout.gc b/goal_src/jak1/engine/camera/cam-layout.gc index 234bd1712f..91511606bb 100644 --- a/goal_src/jak1/engine/camera/cam-layout.gc +++ b/goal_src/jak1/engine/camera/cam-layout.gc @@ -186,17 +186,6 @@ ) ) -;; WARN: Stack slot offset 164 signed mismatch -;; WARN: Stack slot offset 164 signed mismatch -;; WARN: Stack slot offset 164 signed mismatch -;; WARN: Stack slot offset 164 signed mismatch -;; WARN: Stack slot offset 164 signed mismatch -;; WARN: Stack slot offset 164 signed mismatch -;; WARN: Stack slot offset 164 signed mismatch -;; WARN: Stack slot offset 164 signed mismatch -;; WARN: Stack slot offset 164 signed mismatch -;; WARN: Stack slot offset 164 signed mismatch -;; WARN: Stack slot offset 164 signed mismatch (defbehavior cam-layout-entity-volume-info-create cam-layout ((arg0 entity-camera) (arg1 symbol)) (local-vars (sv-16 res-tag) @@ -354,10 +343,7 @@ (set! (-> *volume-normal* data *volume-normal-current* quad) (-> s0-0 quad)) (set! (-> *volume-normal* data (+ *volume-normal-current* 1) quad) (-> s3-0 s1-0 quad)) (set! *volume-normal-current* (+ *volume-normal-current* 2)) - (let ((v1-132 (+ (-> s2-0 normal-count) 2))) - (set! (-> s2-0 normal-count) v1-132) - v1-132 - ) + (set! (-> s2-0 normal-count) (+ (-> s2-0 normal-count) 2)) ) ) ) @@ -381,7 +367,7 @@ (cond ((and (= gp-0 (-> self cur-volume)) (= *camera-layout-blink* 'volume) - (zero? (logand (-> *display* real-actual-frame-counter) 8)) + (not (logtest? (-> *display* real-actual-frame-counter) 8)) ) ) (else @@ -480,13 +466,7 @@ (format *stdcon* "~S ~f~%" (-> arg1 disp) (vector-length gp-0)) (vector+! gp-0 gp-0 (-> arg1 origin)) (camera-line (-> arg1 origin) gp-0 (-> arg1 color)) - (camera-cross - (new 'static 'vector :y 1024.0) - (new 'static 'vector :z 1024.0) - gp-0 - (-> arg1 color) - (meters 1.0) - ) + (camera-cross (new 'static 'vector :y 1024.0) (new 'static 'vector :z 1024.0) gp-0 (-> arg1 color) (meters 1)) ) ) @@ -506,13 +486,7 @@ (format *stdcon* "~S ~f~%" (-> arg1 disp) (vector-length gp-0)) (vector+! gp-0 gp-0 (-> arg1 origin)) (camera-line (-> arg1 origin) gp-0 (-> arg1 color)) - (camera-cross - (new 'static 'vector :y 1024.0) - (new 'static 'vector :z 1024.0) - gp-0 - (-> arg1 color) - (meters 1.0) - ) + (camera-cross (new 'static 'vector :y 1024.0) (new 'static 'vector :z 1024.0) gp-0 (-> arg1 color) (meters 1)) ) ) @@ -546,7 +520,7 @@ (new 'static 'vector :z 1024.0) s5-1 (new 'static 'vector4w :x #x80 :w #x80) - (meters 1.0) + (meters 1) ) ) ) @@ -559,7 +533,7 @@ (new 'static 'vector :z 1024.0) s5-2 (new 'static 'vector4w :y #x80 :w #x80) - (meters 1.0) + (meters 1) ) ) ) @@ -572,7 +546,7 @@ (new 'static 'vector :z 1024.0) s5-3 (new 'static 'vector4w :x #x80 :z #x80 :w #x80) - (meters 1.0) + (meters 1) ) ) ) @@ -623,7 +597,7 @@ (new 'static 'vector :z 1024.0) s5-4 (new 'static 'vector4w :x #xff :y #xff :w #x80) - (meters 1.0) + (meters 1) ) ) ) @@ -666,7 +640,7 @@ (new 'static 'vector :z 1024.0) s5-5 (new 'static 'vector4w :z #xff :w #x80) - (meters 1.0) + (meters 1) ) (curve-get-pos! s5-5 (cam-slave-get-float arg0 'intro-exitValue (the-as float 0.0)) s3-2) (vector+! s5-5 s5-5 s4-2) @@ -675,7 +649,7 @@ (new 'static 'vector :z 1024.0) s5-5 (new 'static 'vector4w :z #xff :w #x80) - (meters 1.0) + (meters 1) ) ) ) @@ -703,7 +677,7 @@ (new 'static 'vector :z 1024.0) s5-6 (new 'static 'vector4w :x #xff :y #xff :w #x80) - (meters 1.0) + (meters 1) ) ) ) @@ -727,7 +701,7 @@ (new 'static 'vector :z 1024.0) s5-7 (new 'static 'vector4w :y #xff :z #xff :w #x80) - (meters 1.0) + (meters 1) ) ) ) @@ -2415,7 +2389,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 @@ -2426,7 +2400,7 @@ ) s5-0 ) - ) + ) (format arg0 ": off(maya)") ) (else @@ -3342,14 +3316,14 @@ ((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))) + (not (logtest? (-> *cpad-list* cpads 0 button0-rel 0) (-> arg0 button))) ) #f ) - ((and (zero? (logand (-> arg0 options) 13)) - (zero? (logand (-> *cpad-list* cpads 0 button0-abs 0) (-> arg0 button))) + ((and (not (logtest? (-> arg0 options) 13)) + (not (logtest? (-> *cpad-list* cpads 0 button0-abs 0) (-> arg0 button))) ) #f ) @@ -3595,6 +3569,3 @@ (cam-layout-start) (none) ) - - - diff --git a/goal_src/jak1/engine/camera/cam-master.gc b/goal_src/jak1/engine/camera/cam-master.gc index 0375e5bdab..db9ba5b0d3 100644 --- a/goal_src/jak1/engine/camera/cam-master.gc +++ b/goal_src/jak1/engine/camera/cam-master.gc @@ -46,10 +46,7 @@ (set! (-> self tpos-old-adj quad) (-> self tpos-old quad)) (set! (-> self tpos-curr-adj quad) (-> self tpos-old quad)) (set! (-> self tpos-tgt quad) (-> self tpos-old quad)) - (let ((f0-0 0.0)) - (set! (-> self upspeed) f0-0) - f0-0 - ) + (set! (-> self upspeed) 0.0) ) (defbehavior reset-target-tracking camera-master () @@ -67,7 +64,7 @@ (set! (-> self target-height) (-> *CAMERA_MASTER-bank* target-height)) (set! (-> self on-ground) (not (and (logtest? (-> *target* control unknown-surface00 flags) (surface-flags jump)) - (zero? (logand (-> *target* control status) (cshape-moving-flags onsurf))) + (not (logtest? (-> *target* control status) (cshape-moving-flags onsurf))) ) ) ) @@ -90,7 +87,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))) @@ -101,7 +98,7 @@ ) (cond ((and (logtest? (-> *target* water flags) (water-flags wt12)) - (zero? (logand (-> *target* water flags) (water-flags wt04))) + (not (logtest? (-> *target* water flags) (water-flags wt04))) ) (set! (-> self under-water) 2) ) @@ -126,10 +123,7 @@ (set! (-> self tpos-curr quad) (-> self tpos-old quad)) (set! (-> self tpos-old-adj quad) (-> self tpos-old quad)) (set! (-> self tpos-curr-adj quad) (-> self tpos-old quad)) - (let ((f0-0 0.0)) - (set! (-> self upspeed) f0-0) - f0-0 - ) + (set! (-> self upspeed) 0.0) ) (defbehavior reset-drawable-tracking camera-master () @@ -315,7 +309,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))) @@ -326,7 +320,7 @@ ) (cond ((and (logtest? (-> *target* water flags) (water-flags wt12)) - (zero? (logand (-> *target* water flags) (water-flags wt04))) + (not (logtest? (-> *target* water flags) (water-flags wt04))) ) (set! (-> self under-water) 2) ) @@ -398,7 +392,7 @@ ) (set! (-> self on-ground) (not (and (logtest? (-> *target* control unknown-surface00 flags) (surface-flags jump)) - (zero? (logand (-> *target* control status) (cshape-moving-flags onsurf))) + (not (logtest? (-> *target* control status) (cshape-moving-flags onsurf))) ) ) ) @@ -406,7 +400,7 @@ 0.0 (cond ((and (and (logtest? (-> *target* control unknown-surface00 flags) (surface-flags jump)) - (zero? (logand (-> *target* control status) (cshape-moving-flags onsurf))) + (not (logtest? (-> *target* control status) (cshape-moving-flags onsurf))) ) (!= (-> *target* control unknown-surface00 name) 'launch-jump) ) @@ -477,7 +471,7 @@ ) ) ) - (if (zero? (logand (-> self slave-options) 16)) + (if (not (logtest? (-> self slave-options) 16)) (reset-follow) ) (let ((v1-196 (-> *target* water flags))) @@ -612,10 +606,9 @@ (if (logtest? #x10000 (cam-slave-get-flags (-> self cam-entity) 'flags)) (send-event *camera* 'set-slave-option #x10000) ) - (let ((f0-12 (cam-slave-get-float arg0 'tiltAdjust (-> *CAMERA-bank* default-tilt-adjust)))) - (set! (-> *camera-combiner* tracking tilt-adjust target) f0-12) - f0-12 - ) + (set! (-> *camera-combiner* tracking tilt-adjust target) + (cam-slave-get-float arg0 'tiltAdjust (-> *CAMERA-bank* default-tilt-adjust)) + ) ) (defun setup-slave-for-hopefull ((arg0 camera-slave)) @@ -778,7 +771,7 @@ ) ((and (logtest? (-> self master-options) 4) (not (-> self on-ground)) - (or (not (-> self cam-entity)) (zero? (logand #x20000 (cam-slave-get-flags (-> self cam-entity) 'flags)))) + (or (not (-> self cam-entity)) (not (logtest? #x20000 (cam-slave-get-flags (-> self cam-entity) 'flags)))) ) #f ) @@ -1728,7 +1721,3 @@ 0 (none) ) - - - - diff --git a/goal_src/jak1/engine/camera/cam-states-dbg.gc b/goal_src/jak1/engine/camera/cam-states-dbg.gc index 2d343cee56..ae81279cc8 100644 --- a/goal_src/jak1/engine/camera/cam-states-dbg.gc +++ b/goal_src/jak1/engine/camera/cam-states-dbg.gc @@ -20,13 +20,13 @@ (define *CAM_POINT_WATCH-bank* (new 'static 'cam-point-watch-bank :speed 1600.0 :rot-speed (degrees 0.6))) (defstate cam-point-watch (camera-slave) - :event (behavior ((arg0 process) (arg1 int) (arg2 symbol) (arg3 event-message-block)) - (case arg2 + :event (behavior ((proc process) (arg1 int) (event-type symbol) (event event-message-block)) + (case event-type (('teleport) #f ) (else - (cam-standard-event-handler arg0 arg1 arg2 arg3) + (cam-standard-event-handler proc arg1 event-type event) ) ) ) @@ -297,9 +297,9 @@ ) (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))) - (zero? (logand (-> *cpad-list* cpads 1 button0-abs 0) (pad-buttons r2))) + (not (cpad-hold? 1 x)) + (not (cpad-hold? 1 r1)) + (not (logtest? (-> *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)) (+! f30-14 (analog-input (the-as int (-> *cpad-list* cpads 1 lefty)) 128.0 48.0 110.0 -1.0)) @@ -390,13 +390,13 @@ ) (defstate cam-free-floating (camera-slave) - :event (behavior ((arg0 process) (arg1 int) (arg2 symbol) (arg3 event-message-block)) - (case arg2 + :event (behavior ((proc process) (arg1 int) (event-type symbol) (event event-message-block)) + (case event-type (('teleport) #f ) (else - (cam-standard-event-handler arg0 arg1 arg2 arg3) + (cam-standard-event-handler proc arg1 event-type event) ) ) ) @@ -469,13 +469,13 @@ (set! (-> *camera-orbit-info* orbit-off y) 4096.0) (defstate cam-orbit (camera-slave) - :event (behavior ((arg0 process) (arg1 int) (arg2 symbol) (arg3 event-message-block)) - (case arg2 + :event (behavior ((proc process) (arg1 int) (event-type symbol) (event event-message-block)) + (case event-type (('teleport) #f ) (else - (cam-standard-event-handler arg0 arg1 arg2 arg3) + (cam-standard-event-handler proc arg1 event-type event) ) ) ) @@ -589,7 +589,3 @@ (none) ) ) - - - - diff --git a/goal_src/jak1/engine/camera/cam-states.gc b/goal_src/jak1/engine/camera/cam-states.gc index ecd37b8763..429f9e4c91 100644 --- a/goal_src/jak1/engine/camera/cam-states.gc +++ b/goal_src/jak1/engine/camera/cam-states.gc @@ -10,13 +10,13 @@ ;; DECOMP BEGINS (defstate cam-fixed (camera-slave) - :event (behavior ((arg0 process) (arg1 int) (arg2 symbol) (arg3 event-message-block)) - (case arg2 + :event (behavior ((proc process) (arg1 int) (event-type symbol) (event event-message-block)) + (case event-type (('teleport) #f ) (else - (cam-standard-event-handler arg0 arg1 arg2 arg3) + (cam-standard-event-handler proc arg1 event-type event) ) ) ) @@ -48,13 +48,13 @@ ) (defstate cam-fixed-read-entity (camera-slave) - :event (behavior ((arg0 process) (arg1 int) (arg2 symbol) (arg3 event-message-block)) - (case arg2 + :event (behavior ((proc process) (arg1 int) (event-type symbol) (event event-message-block)) + (case event-type (('teleport) #f ) (else - (cam-standard-event-handler arg0 arg1 arg2 arg3) + (cam-standard-event-handler proc arg1 event-type event) ) ) ) @@ -91,13 +91,13 @@ ) (defstate cam-pov (camera-slave) - :event (behavior ((arg0 process) (arg1 int) (arg2 symbol) (arg3 event-message-block)) - (case arg2 + :event (behavior ((proc process) (arg1 int) (event-type symbol) (event event-message-block)) + (case event-type (('teleport) #f ) (else - (cam-standard-event-handler arg0 arg1 arg2 arg3) + (cam-standard-event-handler proc arg1 event-type event) ) ) ) @@ -150,13 +150,13 @@ ) (defstate cam-pov180 (camera-slave) - :event (behavior ((arg0 process) (arg1 int) (arg2 symbol) (arg3 event-message-block)) - (case arg2 + :event (behavior ((proc process) (arg1 int) (event-type symbol) (event event-message-block)) + (case event-type (('teleport) #f ) (else - (cam-standard-event-handler arg0 arg1 arg2 arg3) + (cam-standard-event-handler proc arg1 event-type event) ) ) ) @@ -263,7 +263,7 @@ (none) ) :trans (behavior () - (if (or (not (handle->process (-> *camera* pov-handle))) (zero? (logand (-> *camera* master-options) 2))) + (if (or (not (handle->process (-> *camera* pov-handle))) (not (logtest? (-> *camera* master-options) 2))) (cam-slave-go cam-free-floating) ) (none) @@ -290,10 +290,10 @@ ) (defstate cam-standoff (camera-slave) - :event (behavior ((arg0 process) (arg1 int) (arg2 symbol) (arg3 event-message-block)) - (case arg2 + :event (behavior ((proc process) (arg1 int) (event-type symbol) (event event-message-block)) + (case event-type (('set-standoff-dist) - (vector-normalize! (-> self pivot-pt) (the-as float (-> arg3 param 0))) + (vector-normalize! (-> self pivot-pt) (the-as float (-> event param 0))) (cam-standoff-calc-trans) ) (('set-standoff-height) @@ -302,12 +302,12 @@ (-> self pivot-pt) (-> self pivot-pt) (-> *camera* local-down) - (the-as float (-> arg3 param 0)) + (the-as float (-> event param 0)) ) (cam-standoff-calc-trans) ) (else - (cam-standard-event-handler arg0 arg1 arg2 arg3) + (cam-standard-event-handler proc arg1 event-type event) ) ) ) @@ -330,7 +330,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) @@ -412,13 +412,13 @@ ;; main first-person camera ;; note: modified for high fps (defstate cam-eye (camera-slave) - :event (behavior ((arg0 process) (arg1 int) (arg2 symbol) (arg3 event-message-block)) - (case arg2 + :event (behavior ((proc process) (arg1 int) (event-type symbol) (event event-message-block)) + (case event-type (('teleport) #f ) (else - (cam-standard-event-handler arg0 arg1 arg2 arg3) + (cam-standard-event-handler proc arg1 event-type event) ) ) ) @@ -444,7 +444,7 @@ (none) ) :trans (behavior () - (if (zero? (logand (-> *camera* master-options) 2)) + (if (not (logtest? (-> *camera* master-options) 2)) (go cam-free-floating) ) (none) @@ -506,7 +506,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)) @@ -523,7 +523,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)) @@ -582,13 +582,13 @@ ;; first person camera for rat game (defstate cam-billy (camera-slave) - :event (behavior ((arg0 process) (arg1 int) (arg2 symbol) (arg3 event-message-block)) - (case arg2 + :event (behavior ((proc process) (arg1 int) (event-type symbol) (event event-message-block)) + (case event-type (('teleport) #f ) (else - (cam-standard-event-handler arg0 arg1 arg2 arg3) + (cam-standard-event-handler proc arg1 event-type event) ) ) ) @@ -610,7 +610,7 @@ (none) ) :trans (behavior () - (if (zero? (logand (-> *camera* master-options) 2)) + (if (not (logtest? (-> *camera* master-options) 2)) (go cam-free-floating) ) (none) @@ -779,7 +779,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) @@ -799,13 +799,13 @@ ) (defstate cam-decel (camera-slave) - :event (behavior ((arg0 process) (arg1 int) (arg2 symbol) (arg3 event-message-block)) - (case arg2 + :event (behavior ((proc process) (arg1 int) (event-type symbol) (event event-message-block)) + (case event-type (('teleport) #f ) (else - (cam-standard-event-handler arg0 arg1 arg2 arg3) + (cam-standard-event-handler proc arg1 event-type event) ) ) ) @@ -851,13 +851,13 @@ ) (defstate cam-endlessfall (camera-slave) - :event (behavior ((arg0 process) (arg1 int) (arg2 symbol) (arg3 event-message-block)) - (case arg2 + :event (behavior ((proc process) (arg1 int) (event-type symbol) (event event-message-block)) + (case event-type (('teleport) #f ) (else - (cam-standard-event-handler arg0 arg1 arg2 arg3) + (cam-standard-event-handler proc arg1 event-type event) ) ) ) @@ -1019,7 +1019,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)) ) @@ -1085,8 +1085,8 @@ ) (defstate cam-circular (camera-slave) - :event (behavior ((arg0 process) (arg1 int) (arg2 symbol) (arg3 event-message-block)) - (case arg2 + :event (behavior ((proc process) (arg1 int) (event-type symbol) (event event-message-block)) + (case event-type (('teleport) #f ) @@ -1095,7 +1095,7 @@ (cam-circular-position #f) ) (else - (cam-standard-event-handler arg0 arg1 arg2 arg3) + (cam-standard-event-handler proc arg1 event-type event) ) ) ) @@ -1171,7 +1171,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) @@ -1197,7 +1197,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) @@ -1450,8 +1450,6 @@ ) -;; WARN: Stack slot offset 128 signed mismatch -;; WARN: Stack slot offset 128 signed mismatch (defun los-cw-ccw ((arg0 (inline-array collide-cache-tri)) (arg1 vector) (arg2 vector) @@ -1769,9 +1767,9 @@ ) ) -;; WARN: Unsupported inline assembly instruction kind - [mula.s f2, f5] -;; WARN: Unsupported inline assembly instruction kind - [madda.s f3, f6] -;; WARN: Unsupported inline assembly instruction kind - [madd.s f2, f4, f7] +;; ERROR: Unsupported inline assembly instruction kind - [mula.s f2, f5] +;; ERROR: Unsupported inline assembly instruction kind - [madda.s f3, f6] +;; ERROR: Unsupported inline assembly instruction kind - [madd.s f2, f4, f7] (defbehavior cam-los-collide camera-slave ((arg0 vector) (arg1 vector) (arg2 clip-travel-vector-to-mesh-return-info) (arg3 pat-surface)) (local-vars (s1-3 int) (s2-2 int) (f2-1 float) (sv-224 vector) (sv-240 vector)) (dist-info-init (the-as collide-los-dist-info (-> arg2 intersection))) @@ -2101,7 +2099,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) ) @@ -2725,8 +2723,8 @@ ) (defstate cam-string (camera-slave) - :event (behavior ((arg0 process) (arg1 int) (arg2 symbol) (arg3 event-message-block)) - (case arg2 + :event (behavior ((proc process) (arg1 int) (event-type symbol) (event event-message-block)) + (case event-type (('teleport) (let ((gp-0 (new-stack-vector0))) (cam-string-find-position-rel! gp-0) @@ -2734,8 +2732,8 @@ ) ) (('joystick) - (set! (-> self phony-joystick-x) (the-as float (-> arg3 param 0))) - (set! (-> self phony-joystick-y) (the-as float (-> arg3 param 1))) + (set! (-> self phony-joystick-x) (the-as float (-> event param 0))) + (set! (-> self phony-joystick-y) (the-as float (-> event param 1))) (let ((v0-1 (the-as object #t))) (set! (-> self have-phony-joystick) (the-as symbol v0-1)) v0-1 @@ -2743,16 +2741,13 @@ ) (('set-dist) (cond - ((-> arg3 param 0) + ((-> event param 0) (set! (-> self string-val-locked) #t) - (set! (-> self string-min-val quad) (-> (the-as vector (-> arg3 param 0)) quad)) - (set! (-> self string-max-val quad) (-> (the-as vector (-> arg3 param 1)) quad)) + (set! (-> self string-min-val quad) (-> (the-as vector (-> event param 0)) quad)) + (set! (-> self string-max-val quad) (-> (the-as vector (-> event param 1)) quad)) (set! (-> self string-max-val x) (fmax (-> self string-max-val x) (-> self string-min-val x))) (set! (-> self string-max-val y) (fmax (-> self string-max-val y) (-> self string-min-val y))) - (let ((f0-7 (fmax (-> self string-max-val z) (-> self string-min-val z)))) - (set! (-> self string-max-val z) f0-7) - f0-7 - ) + (set! (-> self string-max-val z) (fmax (-> self string-max-val z) (-> self string-min-val z))) ) (else (set! (-> self string-val-locked) #f) @@ -2764,7 +2759,7 @@ (-> self los-state) ) (else - (cam-standard-event-handler arg0 arg1 arg2 arg3) + (cam-standard-event-handler proc arg1 event-type event) ) ) ) @@ -2918,7 +2913,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) @@ -3079,7 +3074,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?)) @@ -3313,7 +3308,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) @@ -3330,7 +3325,3 @@ ) (define *camera-base-mode* cam-string) - - - - diff --git a/goal_src/jak1/engine/collide/collide-touch.gc b/goal_src/jak1/engine/collide/collide-touch.gc index 371fe58ee2..a9748a7ddc 100644 --- a/goal_src/jak1/engine/collide/collide-touch.gc +++ b/goal_src/jak1/engine/collide/collide-touch.gc @@ -548,7 +548,7 @@ (let ((v1-1 (-> obj head))) (while v1-1 (let ((a0-1 (-> v1-1 prim1 cprim))) - (if (and (logtest? arg1 (-> a0-1 prim-core action)) (zero? (logand arg2 (-> a0-1 prim-core action)))) + (if (and (logtest? arg1 (-> a0-1 prim-core action)) (not (logtest? arg2 (-> a0-1 prim-core action)))) (return v1-1) ) ) @@ -560,7 +560,7 @@ (let ((v1-4 (-> obj head))) (while v1-4 (let ((a0-5 (-> v1-4 prim2 cprim))) - (if (and (logtest? arg1 (-> a0-5 prim-core action)) (zero? (logand arg2 (-> a0-5 prim-core action)))) + (if (and (logtest? arg1 (-> a0-5 prim-core action)) (not (logtest? arg2 (-> a0-5 prim-core action)))) (return v1-4) ) ) diff --git a/goal_src/jak1/engine/debug/anim-tester.gc b/goal_src/jak1/engine/debug/anim-tester.gc index 9436af880e..1110858666 100644 --- a/goal_src/jak1/engine/debug/anim-tester.gc +++ b/goal_src/jak1/engine/debug/anim-tester.gc @@ -633,7 +633,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)))) @@ -644,7 +644,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) @@ -729,10 +729,7 @@ (set! (-> self anim-last) (-> arg0 first-frame)) ) (set! (-> self anim-gspeed) (fabs (-> self anim-gspeed))) - (let ((f0-13 (fabs (-> self anim-speed)))) - (set! (-> self anim-speed) f0-13) - f0-13 - ) + (set! (-> self anim-speed) (fabs (-> self anim-speed))) ) (defbehavior anim-tester-reset anim-tester () @@ -923,11 +920,10 @@ s3-0 (-> arg1 xpos) (-> arg1 ypos) - (the-as font-color (if (= (-> arg1 the-index) (-> arg1 current-index)) - 15 - 12 - ) - ) + (if (= (-> arg1 the-index) (-> arg1 current-index)) + (font-color yellow-green) + (font-color dim-white) + ) (font-flags shadow kerning) ) ) @@ -1051,11 +1047,10 @@ s3-0 (-> arg1 xpos) (-> arg1 ypos) - (the-as font-color (if (= (-> arg1 the-index) (-> arg1 current-index)) - 15 - 12 - ) - ) + (if (= (-> arg1 the-index) (-> arg1 current-index)) + (font-color yellow-green) + (font-color dim-white) + ) (font-flags shadow kerning) ) ) @@ -1076,7 +1071,7 @@ ) ) ((= arg0 1) - (return (zero? (logand (-> s5-0 flags) 1))) + (return (not (logtest? (-> s5-0 flags) 1))) ) ((= arg0 4) (cond @@ -1094,7 +1089,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) ) @@ -1118,7 +1113,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) ) @@ -1227,11 +1222,10 @@ s3-0 (-> arg1 xpos) (-> arg1 ypos) - (the-as font-color (if (= (-> arg1 the-index) (-> arg1 current-index)) - 15 - 12 - ) - ) + (if (= (-> arg1 the-index) (-> arg1 current-index)) + (font-color yellow-green) + (font-color dim-white) + ) (font-flags shadow kerning) ) ) @@ -1500,11 +1494,10 @@ (-> arg1 xpos) (-> arg1 ypos) (the-as float 0.0) - (the-as font-color (if (= (-> arg1 the-index) (-> arg1 current-index)) - 15 - 12 - ) - ) + (if (= (-> arg1 the-index) (-> arg1 current-index)) + (font-color yellow-green) + (font-color dim-white) + ) (font-flags shadow kerning) ) ) @@ -1594,7 +1587,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)) @@ -1728,7 +1721,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) @@ -1756,7 +1749,7 @@ (v1-143 s3-2) ) "is this node the end of the list. #t = end" - (when (and (not (not (-> v1-143 next))) (zero? (logand (-> s3-2 flags) 1))) + (when (and (not (not (-> v1-143 next))) (not (logtest? (-> s3-2 flags) 1))) (glst-remove (-> (the-as anim-test-sequence s4-0) item-list) (the-as anim-test-seq-item gp-0)) (glst-insert-after (-> (the-as anim-test-sequence s4-0) item-list) s3-2 (the-as anim-test-seq-item gp-0)) (+! (-> arg1 current-index) 1) @@ -1771,7 +1764,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)) @@ -1912,14 +1905,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)) @@ -2215,7 +2208,7 @@ (set! v0-0 ((the-as (function glst-list int anim-test-seq-item) glst-get-node-by-index) (-> arg0 item-list) s4-0) ) - (when (or (= v0-0 s5-0) (zero? (logand (-> v0-0 flags) 5))) + (when (or (= v0-0 s5-0) (not (logtest? (-> v0-0 flags) 5))) (set! (-> arg0 playing-item) s4-0) (return v0-0) ) @@ -2233,7 +2226,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)) @@ -2499,7 +2492,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 " ") @@ -2804,6 +2797,3 @@ ) (none) ) - - - diff --git a/goal_src/jak1/engine/debug/default-menu.gc b/goal_src/jak1/engine/debug/default-menu.gc index 01b6358e89..c3545f6066 100644 --- a/goal_src/jak1/engine/debug/default-menu.gc +++ b/goal_src/jak1/engine/debug/default-menu.gc @@ -565,7 +565,7 @@ (if (= arg1 (debug-menu-msg press)) (logxor! (-> v1-0 flags) 1) ) - (zero? (logand (-> v1-0 flags) 1)) + (not (logtest? (-> v1-0 flags) 1)) ) (else #f @@ -3424,17 +3424,10 @@ "sfx-volume" #f ,(lambda ((arg0 int) (arg1 debug-menu-msg) (arg2 float)) - (cond - ((= arg1 (debug-menu-msg press)) - (let ((f0-0 arg2)) - (set! (-> *setting-control* default sfx-volume) f0-0) - f0-0 - ) - ) - (else + (if (= arg1 (debug-menu-msg press)) + (set! (-> *setting-control* default sfx-volume) arg2) (-> *setting-control* default sfx-volume) ) - ) ) 2 1 @@ -3447,17 +3440,10 @@ "music-volume" #f ,(lambda ((arg0 int) (arg1 debug-menu-msg) (arg2 float)) - (cond - ((= arg1 (debug-menu-msg press)) - (let ((f0-0 arg2)) - (set! (-> *setting-control* default music-volume) f0-0) - f0-0 - ) - ) - (else + (if (= arg1 (debug-menu-msg press)) + (set! (-> *setting-control* default music-volume) arg2) (-> *setting-control* default music-volume) ) - ) ) 2 1 @@ -3470,17 +3456,10 @@ "dialog-volume" #f ,(lambda ((arg0 int) (arg1 debug-menu-msg) (arg2 float)) - (cond - ((= arg1 (debug-menu-msg press)) - (let ((f0-0 arg2)) - (set! (-> *setting-control* default dialog-volume) f0-0) - f0-0 - ) - ) - (else + (if (= arg1 (debug-menu-msg press)) + (set! (-> *setting-control* default dialog-volume) arg2) (-> *setting-control* default dialog-volume) ) - ) ) 2 1 @@ -3945,4 +3924,3 @@ (debug-menus-handler *debug-menu-context*) (debug-menus-handler *popup-menu-context*) ) - diff --git a/goal_src/jak1/engine/entity/entity.gc b/goal_src/jak1/engine/entity/entity.gc index acbb55ba5d..2c5744e81e 100644 --- a/goal_src/jak1/engine/entity/entity.gc +++ b/goal_src/jak1/engine/entity/entity.gc @@ -917,11 +917,10 @@ ) ) ((or (= arg0 'full) (-> s0-0 extra process)) - (add-debug-x #t (bucket-id debug-no-zbuf) s1-0 (the-as rgba (if (-> s0-0 extra process) - (the-as uint #x8080ff80) - (the-as uint #x800000ff) - ) - ) + (add-debug-x #t (bucket-id debug-no-zbuf) s1-0 (if (-> s0-0 extra process) + (new 'static 'rgba :r #x80 :g #xff :b #x80 :a #x80) + (new 'static 'rgba :r #xff :a #x80) + ) ) (set! sv-192 add-debug-text-3d) (set! sv-208 #t) @@ -1018,22 +1017,20 @@ (s4-2 (-> (the-as process-drawable s5-2) root trans)) ) (when s3-2 - (add-debug-x #t (bucket-id debug-no-zbuf) s4-2 (the-as rgba (if (-> s3-2 extra process) - (the-as uint #x8080ff80) - (the-as uint #x800000ff) - ) - ) + (add-debug-x #t (bucket-id debug-no-zbuf) s4-2 (if (-> s3-2 extra process) + (new 'static 'rgba :r #x80 :g #xff :b #x80 :a #x80) + (new 'static 'rgba :r #xff :a #x80) + ) ) (add-debug-text-3d #t (bucket-id debug-no-zbuf) (res-lump-struct s3-2 'name string) s4-2 - (the-as font-color (if (logtest? (-> s3-2 extra perm status) (entity-perm-status bit-0 bit-1)) - 1 - 1 - ) - ) + (if (logtest? (-> s3-2 extra perm status) (entity-perm-status bit-0 bit-1)) + (font-color white) + (font-color white) + ) (new 'static 'vector2h :y 8) ) (add-debug-text-3d @@ -1089,11 +1086,10 @@ (bucket-id debug-no-zbuf) (the-as vector (&+ v0-35 0)) (the-as vector (&+ v0-35 16)) - (the-as rgba (if (is-object-visible? (-> s5-3 extra level) a1-31) - (the-as uint #x80808000) - (the-as uint #x80800080) - ) - ) + (if (is-object-visible? (-> s5-3 extra level) a1-31) + (new 'static 'rgba :g #x80 :b #x80 :a #x80) + (new 'static 'rgba :r #x80 :b #x80 :a #x80) + ) ) ) ) @@ -1152,11 +1148,10 @@ (bucket-id debug) (the-as vector (-> s3-4 data s2-4)) (the-as vector (+ (the-as uint (-> s3-4 data 0 max)) (* s2-4 32))) - (the-as rgba (if (zero? (-> s4-4 index)) - (the-as uint #x80808000) - (the-as uint #x808080ff) - ) - ) + (if (zero? (-> s4-4 index)) + (new 'static 'rgba :g #x80 :b #x80 :a #x80) + (new 'static 'rgba :r #xff :g #x80 :b #x80 :a #x80) + ) ) ) ) @@ -1531,7 +1526,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 ) @@ -1617,7 +1612,7 @@ ) (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)) ) @@ -1628,7 +1623,7 @@ ) (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)) ) ) @@ -1688,7 +1683,7 @@ ) ) (else - (if (and (-> v1-44 process) (zero? (logand (-> v1-44 perm status) (entity-perm-status bit-3)))) + (if (and (-> v1-44 process) (not (logtest? (-> v1-44 perm status) (entity-perm-status bit-3)))) (kill! (-> v1-44 entity)) ) ) @@ -1711,7 +1706,7 @@ ) ) (else - (when (and (-> s0-0 process) (zero? (logand (-> s0-0 perm status) (entity-perm-status bit-3)))) + (when (and (-> s0-0 process) (not (logtest? (-> s0-0 perm status) (entity-perm-status bit-3)))) (kill! (-> s0-0 entity)) (set! sv-24 (+ sv-24 1)) ) @@ -1741,7 +1736,7 @@ ) ) (else - (if (and (-> v1-84 process) (zero? (logand (-> v1-84 perm status) (entity-perm-status bit-3)))) + (if (and (-> v1-84 process) (not (logtest? (-> v1-84 perm status) (entity-perm-status bit-3)))) (kill! (-> v1-84 entity)) ) ) @@ -1758,7 +1753,7 @@ (let ((s1-1 (-> s4-5 data s2-3))) (cond ((and (< (vector-vector-distance (-> s1-1 trans) sv-16) (-> *ACTOR-bank* birth-dist)) - (zero? (logand (-> s1-1 perm status) (entity-perm-status bit-9 bit-10))) + (not (logtest? (-> s1-1 perm status) (entity-perm-status bit-9 bit-10))) ) (when (not (or (-> s1-1 process) (logtest? (-> s1-1 perm status) (entity-perm-status bit-0 dead)))) (birth! (-> s1-1 entity)) @@ -1769,7 +1764,7 @@ ) ) (else - (if (and (-> s1-1 process) (zero? (logand (-> s1-1 perm status) (entity-perm-status bit-3)))) + (if (and (-> s1-1 process) (not (logtest? (-> s1-1 perm status) (entity-perm-status bit-3)))) (kill! (-> s1-1 entity)) ) ) @@ -1810,7 +1805,7 @@ ) ) (else - (when (and (-> sv-32 process) (zero? (logand (-> sv-32 perm status) (entity-perm-status bit-3)))) + (when (and (-> sv-32 process) (not (logtest? (-> sv-32 perm status) (entity-perm-status bit-3)))) (kill! (-> sv-32 entity)) (set! sv-24 (+ sv-24 1)) ) diff --git a/goal_src/jak1/engine/game/powerups.gc b/goal_src/jak1/engine/game/powerups.gc index dd985f9b6d..16845f4cf6 100644 --- a/goal_src/jak1/engine/game/powerups.gc +++ b/goal_src/jak1/engine/game/powerups.gc @@ -168,8 +168,8 @@ (defpartgroup group-blue-hit-ground-effect :id 70 - :duration 5 - :linger-duration 450 + :duration (seconds 0.017) + :linger-duration (seconds 1.5) :bounds (static-bspherem 0 0 0 2) :parts ((sp-item 261) (sp-item 262) (sp-item 263 :flags (is-3d)) (sp-item 264) (sp-item 265 :flags (is-3d))) ) @@ -609,8 +609,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 @@ -670,7 +670,7 @@ (let ((v1-150 (rand-vu-int-range 3 (+ (-> self node-list length) -1)))) (cond ((and (logtest? (-> self control unknown-surface00 flags) (surface-flags jump)) - (zero? (logand (-> self control status) (cshape-moving-flags onsurf))) + (not (logtest? (-> self control status) (cshape-moving-flags onsurf))) ) (set! (-> *part-id-table* 259 init-specs 4 initial-valuef) 0.0) (set! (-> *part-id-table* 259 init-specs 4 random-rangef) 65536.0) @@ -731,7 +731,3 @@ 0 (none) ) - - - - diff --git a/goal_src/jak1/engine/gfx/shadow/shadow.gc b/goal_src/jak1/engine/gfx/shadow/shadow.gc index f0ae0abeaa..d80ab0efc7 100644 --- a/goal_src/jak1/engine/gfx/shadow/shadow.gc +++ b/goal_src/jak1/engine/gfx/shadow/shadow.gc @@ -158,7 +158,7 @@ (!= (-> self control unknown-surface00 mode) 'swim) (!= (-> self control unknown-surface00 mode) 'dive) (!= (-> self next-state name) 'target-flop) - (zero? (logand (-> self draw status) (draw-status hidden no-anim skip-bones))) + (not (logtest? (-> self draw status) (draw-status hidden no-anim skip-bones))) ) (set! (-> self control shadow-pos quad) (-> self control trans quad)) (find-ground-and-draw-shadow @@ -197,7 +197,3 @@ (sp-flt spt-conerot-radius (meters 0.2)) ) ) - - - - diff --git a/goal_src/jak1/engine/nav/navigate.gc b/goal_src/jak1/engine/nav/navigate.gc index e8c34bc228..dc283f2898 100644 --- a/goal_src/jak1/engine/nav/navigate.gc +++ b/goal_src/jak1/engine/nav/navigate.gc @@ -234,11 +234,11 @@ (vector+! arg1 arg1 (-> obj origin)) ) -(define *edge-vert0-table* (the-as (array int8) (new 'static 'boxed-array :type int8 1 2 0))) +(define *edge-vert0-table* (new 'static 'boxed-array :type int8 1 2 0)) -(define *edge-vert1-table* (the-as (array int8) (new 'static 'boxed-array :type int8 2 0 1))) +(define *edge-vert1-table* (new 'static 'boxed-array :type int8 2 0 1)) -(define *edge-mask-table* (the-as (array int8) (new 'static 'boxed-array :type int8 1 2 4))) +(define *edge-mask-table* (new 'static 'boxed-array :type int8 1 2 4)) (defun inc-mod3 ((arg0 int)) (local-vars (v0-1 int) (v1-1 int)) @@ -381,7 +381,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))) @@ -758,7 +758,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!) @@ -871,7 +871,7 @@ ) ) (cond - ((and (-> arg0 next-poly) (zero? (logand (-> arg0 next-poly pat) 1))) + ((and (-> arg0 next-poly) (not (logtest? (-> arg0 next-poly pat) 1))) (set! (-> arg0 current-poly) (-> arg0 next-poly)) ) (else @@ -998,7 +998,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) @@ -1038,14 +1038,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) ) ) @@ -1180,7 +1180,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)) @@ -1456,10 +1456,7 @@ (when (< arg3 f0-2) (let ((f0-3 (/ arg3 f0-2))) (set! (-> arg0 x) (* (-> arg0 x) f0-3)) - (let ((f0-4 (* (-> arg0 z) f0-3))) - (set! (-> arg0 z) f0-4) - f0-4 - ) + (set! (-> arg0 z) (* (-> arg0 z) f0-3)) ) ) ) @@ -1627,8 +1624,8 @@ (-> s5-0 bounds w) (new 'static 'rgba :r #xff :g #xff :a #x20) ) - (add-debug-vector #t (bucket-id debug-no-zbuf) (-> s5-0 origin) *x-vector* (meters 1.0) *color-red*) - (add-debug-vector #t (bucket-id debug-no-zbuf) (-> s5-0 origin) *z-vector* (meters 1.0) *color-blue*) + (add-debug-vector #t (bucket-id debug-no-zbuf) (-> s5-0 origin) *x-vector* (meters 1) *color-red*) + (add-debug-vector #t (bucket-id debug-no-zbuf) (-> s5-0 origin) *z-vector* (meters 1) *color-blue*) (when (logtest? (-> obj flags) (nav-control-flags navcf2)) (dotimes (s3-0 (-> s5-0 vertex-count)) (add-debug-x @@ -1687,27 +1684,26 @@ (when (logtest? (-> obj flags) (nav-control-flags navcf3)) (dotimes (s3-2 (-> s5-0 poly-count)) (let ((s2-1 (-> s5-0 poly s3-2))) - (debug-draw-poly s5-0 s2-1 (the-as rgba (cond - ((logtest? (-> s2-1 pat) 1) - #x40808000 - ) - ((logtest? (-> s2-1 pat) 2) - #x4080ff00 - ) - ((logtest? (-> s2-1 pat) 4) - (the-as int (the-as uint #x8040ff00)) - ) - ((logtest? (-> s2-1 pat) 8) - (the-as int (the-as uint #xff408000)) - ) - ((logtest? (-> s2-1 pat) 16) - (the-as int (the-as uint #xff408000)) - ) - (else - (the-as int (the-as uint #x80ff8000)) - ) - ) - ) + (debug-draw-poly s5-0 s2-1 (cond + ((logtest? (-> s2-1 pat) 1) + (new 'static 'rgba :g #x80 :b #x80 :a #x40) + ) + ((logtest? (-> s2-1 pat) 2) + (new 'static 'rgba :g #xff :b #x80 :a #x40) + ) + ((logtest? (-> s2-1 pat) 4) + (new 'static 'rgba :g #xff :b #x40 :a #x80) + ) + ((logtest? (-> s2-1 pat) 8) + (new 'static 'rgba :g #x80 :b #x40 :a #xff) + ) + ((logtest? (-> s2-1 pat) 16) + (new 'static 'rgba :g #x80 :b #x40 :a #xff) + ) + (else + (new 'static 'rgba :g #x80 :b #xff :a #x80) + ) + ) ) (when (logtest? (-> obj flags) (nav-control-flags navcf4)) (let ((s1-1 add-debug-text-3d) @@ -2059,7 +2055,7 @@ ) (while (!= v1-71 (-> s4-0 alive-list-end)) (let ((s0-3 (the-as collide-shape (-> (the-as connection v1-71) param3)))) - (when (not (or (= s0-3 (-> obj shape)) (zero? (logand arg0 (-> s0-3 root-prim prim-core collide-as))))) + (when (not (or (= s0-3 (-> obj shape)) (not (logtest? arg0 (-> s0-3 root-prim prim-core collide-as))))) (let ((s1-3 obj)) (set! sv-112 s3-0) (when (logtest? (-> s0-3 nav-flags) (nav-flags navf0)) @@ -2224,7 +2220,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))) ) @@ -2509,7 +2505,7 @@ ) (when (or (not (dummy-16 obj arg0)) (logtest? (nav-control-flags navcf17) (-> obj flags)) - (zero? (logand (-> obj flags) (nav-control-flags navcf10))) + (not (logtest? (-> obj flags) (nav-control-flags navcf10))) ) (set! (-> obj flags) (logior (nav-control-flags navcf21) (-> obj flags))) (vector-! (-> obj travel) arg2 (-> arg1 trans)) @@ -2711,7 +2707,7 @@ v1-0 (-> obj current-poly) (-> obj travel) - (zero? (logand (-> obj flags) (nav-control-flags navcf12))) + (not (logtest? (-> obj flags) (nav-control-flags navcf12))) arg0 arg1 ) @@ -2918,7 +2914,7 @@ sv-84 sv-88 (-> obj travel) - (zero? (logand (-> obj flags) (nav-control-flags navcf12))) + (not (logtest? (-> obj flags) (nav-control-flags navcf12))) 204.8 s5-1 ) @@ -2962,73 +2958,7 @@ (logclear! (-> obj flags) (nav-control-flags navcf9 navcf17 navcf18 navcf19)) (TODO-RENAME-27 obj) (if (logtest? (-> obj flags) (nav-control-flags navcf8)) - (TODO-RENAME-28 obj (collide-kind - background - cak-1 - cak-2 - cak-3 - target - water - powerup - crate - enemy - wall-object - projectile - ground-object - target-attack - mother-spider - cak-14 - blue-eco-suck - unknown-16 - unknown-17 - unknown-18 - unknown-19 - unknown-20 - unknown-21 - unknown-22 - unknown-23 - unknown-24 - unknown-25 - unknown-26 - unknown-27 - unknown-28 - unknown-29 - unknown-30 - unknown-31 - unknown-32 - unknown-33 - unknown-34 - unknown-35 - unknown-36 - unknown-37 - unknown-38 - unknown-39 - unknown-40 - unknown-41 - unknown-42 - unknown-43 - unknown-44 - unknown-45 - unknown-46 - unknown-47 - unknown-48 - unknown-49 - unknown-50 - unknown-51 - unknown-52 - unknown-53 - unknown-54 - unknown-55 - unknown-56 - unknown-57 - unknown-58 - unknown-59 - unknown-60 - unknown-61 - unknown-62 - unknown-63 - ) - ) + (TODO-RENAME-28 obj (the-as collide-kind -1)) ) (dummy-13 obj arg0 (-> obj old-travel)) (-> obj mesh) @@ -3069,7 +2999,3 @@ 0 (none) ) - - - - diff --git a/goal_src/jak1/engine/target/logic-target.gc b/goal_src/jak1/engine/target/logic-target.gc index ae7059172c..20a7e7f11c 100644 --- a/goal_src/jak1/engine/target/logic-target.gc +++ b/goal_src/jak1/engine/target/logic-target.gc @@ -109,7 +109,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) @@ -128,7 +128,7 @@ (bucket-id debug-no-zbuf) (-> s2-0 intersect) (-> s2-0 surface-normal) - (meters 1.0) + (meters 1) (the-as rgba (+ s1-1 (shl s4-0 24))) ) (add-debug-vector @@ -136,7 +136,7 @@ (bucket-id debug-no-zbuf) (-> s2-0 intersect) (-> s2-0 local-normal) - (meters 1.0) + (meters 1) (the-as rgba (+ s1-1 (shl s4-0 24))) ) ) @@ -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 ) @@ -751,7 +751,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))) @@ -763,7 +763,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)) @@ -782,7 +782,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)) @@ -901,8 +901,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)) @@ -910,7 +910,7 @@ (logtest? (-> self control unknown-surface01 flags) (surface-flags no-rotate-toward-transv)) (!= (-> self control unknown-float41) 0.0) ) - (zero? (logand (-> self control unknown-surface01 flags) (surface-flags always-rotate-toward-transv))) + (not (logtest? (-> self control unknown-surface01 flags) (surface-flags always-rotate-toward-transv))) ) (-> self control unknown-vector20) (-> self control transv) @@ -941,7 +941,7 @@ (bucket-id debug-no-zbuf) (-> self control trans) gp-0 - (meters 2.0) + (meters 2) (new 'static 'rgba :r #xff :g #xff :b #xff :a #x80) ) (add-debug-vector @@ -949,7 +949,7 @@ (bucket-id debug-no-zbuf) (-> self control trans) s5-0 - (meters 2.0) + (meters 2) (new 'static 'rgba :r #xff :a #x80) ) ) @@ -958,7 +958,7 @@ (bucket-id debug-no-zbuf) (-> self control trans) (-> self control unknown-matrix01 vector 2) - (meters 2.0) + (meters 2) (new 'static 'rgba :r #xff :b #xff :a #x80) ) (rotate-toward-orientation! @@ -1001,7 +1001,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)) @@ -1029,12 +1029,12 @@ ) (when (and (cpad-pressed? (-> self control unknown-cpad-info00 number) triangle) (zero? (-> self control unknown-int40)) - (zero? (logand (-> *kernel-context* prevent-from-run) (process-mask movie))) + (not (logtest? (-> *kernel-context* prevent-from-run) (process-mask movie))) ) (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)) @@ -1048,7 +1048,7 @@ (when (and (= *cheat-mode* 'debug) (cpad-hold? (-> self control unknown-cpad-info00 number) r2) (not *pause-lock*) - (zero? (logand (-> self state-flags) (state-flags grabbed first-person-mode))) + (not (logtest? (-> self state-flags) (state-flags grabbed first-person-mode))) ) (if (!= (-> self next-state name) 'target-falling) (send-event self 'change-mode 'falling) @@ -1095,7 +1095,7 @@ (let ((f0-17 (vector-dot (-> self control dynam gravity-normal) (-> self control transv)))) (if (and (or (logtest? (-> self control unknown-surface01 flags) (surface-flags allow-edge-grab)) (and (= (-> self next-state name) 'target-walk) - (zero? (logand (-> self control status) (cshape-moving-flags onsurf))) + (not (logtest? (-> self control status) (cshape-moving-flags onsurf))) ) ) (< f0-17 0.0) @@ -1108,7 +1108,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 ) ) @@ -1157,7 +1157,7 @@ ) (let ((f0-2 (if (and (logtest? (-> self control status) (cshape-moving-flags twall)) - (zero? (logand (-> self control status) (cshape-moving-flags onsurf))) + (not (logtest? (-> self control status) (cshape-moving-flags onsurf))) ) 0.0 (-> self control unknown-float81) @@ -1198,7 +1198,7 @@ (bucket-id debug-no-zbuf) (-> self control trans) (-> self control ground-poly-normal) - (meters 2.0) + (meters 2) (new 'static 'rgba :b #xff :a #x80) ) (add-debug-vector @@ -1206,7 +1206,7 @@ (bucket-id debug-no-zbuf) (-> self control trans) (-> self control local-normal) - (meters 2.0) + (meters 2) (new 'static 'rgba :b #xff :a #x80) ) (add-debug-vector @@ -1222,7 +1222,7 @@ (bucket-id debug-no-zbuf) (-> self control trans) (-> self control dynam gravity-normal) - (meters 3.0) + (meters 3) (new 'static 'rgba :r #xff :b #xff :a #x80) ) ) @@ -1346,7 +1346,7 @@ (bucket-id debug-no-zbuf) (-> (the-as swingpole s4-0) root trans) (the-as vector (&-> s4-0 stack 16)) - (meters 3.0) + (meters 3) (new 'static 'rgba :r #xff :b #xff :a #x80) ) (add-debug-sphere @@ -1403,7 +1403,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))) @@ -1421,7 +1421,7 @@ (the-as cspace (-> self node-list data)) ) (if (not (and (logtest? (-> self water flags) (water-flags wt12)) - (zero? (logand (-> self water flags) (water-flags wt04))) + (not (logtest? (-> self water flags) (water-flags wt04))) ) ) (set! (-> self control unknown-float30) (- (-> self water base-height) (-> self water swim-height))) @@ -2081,9 +2081,3 @@ ) *target* ) - -0 - - - - diff --git a/goal_src/jak1/engine/target/target-death.gc b/goal_src/jak1/engine/target/target-death.gc index 5f99ad79d1..05b0fedd2f 100644 --- a/goal_src/jak1/engine/target/target-death.gc +++ b/goal_src/jak1/engine/target/target-death.gc @@ -46,7 +46,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?)) ) @@ -114,7 +114,7 @@ (let ((v1-52 (lookup-level-info (-> arg0 level)))) (if (and v1-52 (= (-> *setting-control* current music) (-> v1-52 music-bank)) - (zero? (logand (-> arg0 flags) (continue-flags sage-intro title))) + (not (logtest? (-> arg0 flags) (continue-flags sage-intro title))) ) (remove-setting! 'music-volume) ) @@ -184,7 +184,7 @@ ;; vis info check added for PC, don't bother waiting for vis if the level doesn't have it. (when (and s5-2 (-> s5-2 vis-info 0)) (while (and (= (-> s5-2 all-visible?) 'loading) (-> *level* vis?)) - (suspend) + (suspend) ) ) ) @@ -614,7 +614,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?)) @@ -626,9 +626,9 @@ (>= (- (-> *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))) - (zero? (logand (-> self control unknown-surface01 flags) (surface-flags prevent-attacks-during-launch-jump surf08)) - ) + (not (logtest? (-> self state-flags) (state-flags prevent-attack))) + (not (logtest? (-> self control unknown-surface01 flags) (surface-flags prevent-attacks-during-launch-jump surf08)) + ) ) ) (go @@ -782,7 +782,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)) @@ -859,7 +859,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)) @@ -976,20 +976,18 @@ ) (define *death-spool-array* - (the-as (array spool-anim) - (new 'static 'boxed-array :type spool-anim - (new 'static 'spool-anim :name "death-0181" :index 3 :parts 1 :command-list '()) - (new 'static 'spool-anim :name "death-0182" :index 4 :parts 1 :command-list '()) - (new 'static 'spool-anim :name "death-0184" :index 5 :parts 1 :command-list '()) - (new 'static 'spool-anim :name "death-0186" :index 6 :parts 1 :command-list '()) - (new 'static 'spool-anim :name "death-0187" :index 7 :parts 1 :command-list '()) - (new 'static 'spool-anim :name "death-0191" :index 8 :parts 1 :command-list '()) - (new 'static 'spool-anim :name "death-0193" :index 9 :parts 2 :command-list '()) - (new 'static 'spool-anim :name "death-0195" :index 10 :parts 1 :command-list '()) - (new 'static 'spool-anim :name "death-0197" :index 11 :parts 2 :command-list '()) - (new 'static 'spool-anim :name "death-0199" :index 12 :parts 2 :command-list '()) - (new 'static 'spool-anim :name "death-0202" :index 13 :parts 1 :command-list '()) - ) + (new 'static 'boxed-array :type spool-anim + (new 'static 'spool-anim :name "death-0181" :index 3 :parts 1 :command-list '()) + (new 'static 'spool-anim :name "death-0182" :index 4 :parts 1 :command-list '()) + (new 'static 'spool-anim :name "death-0184" :index 5 :parts 1 :command-list '()) + (new 'static 'spool-anim :name "death-0186" :index 6 :parts 1 :command-list '()) + (new 'static 'spool-anim :name "death-0187" :index 7 :parts 1 :command-list '()) + (new 'static 'spool-anim :name "death-0191" :index 8 :parts 1 :command-list '()) + (new 'static 'spool-anim :name "death-0193" :index 9 :parts 2 :command-list '()) + (new 'static 'spool-anim :name "death-0195" :index 10 :parts 1 :command-list '()) + (new 'static 'spool-anim :name "death-0197" :index 11 :parts 2 :command-list '()) + (new 'static 'spool-anim :name "death-0199" :index 12 :parts 2 :command-list '()) + (new 'static 'spool-anim :name "death-0202" :index 13 :parts 1 :command-list '()) ) ) @@ -1000,7 +998,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))) ) @@ -1020,7 +1018,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)) ) @@ -1033,22 +1031,22 @@ ) (defstate target-death (target) - :event (behavior ((arg0 process) (arg1 int) (arg2 symbol) (arg3 event-message-block)) - (let ((v1-0 arg2)) + :event (behavior ((proc process) (arg1 int) (event-type symbol) (event event-message-block)) + (let ((v1-0 event-type)) (the-as object (cond ((= v1-0 'end-mode) (set! (-> self control unknown-uint20) (the-as uint #t)) ) ((= v1-0 'change-mode) - (case (-> arg3 param 0) + (case (-> event param 0) (('grab) #t ) ) ) ((= v1-0 'notify) - (when (type-type? (-> arg0 type) pov-camera) - (case (-> arg3 param 0) + (when (type-type? (-> proc type) pov-camera) + (case (-> event param 0) (('die 'abort-request) (set! (-> self control unknown-uint20) (the-as uint #t)) (set-blackout-frames (seconds 0.2)) @@ -1063,7 +1061,7 @@ #f ) (else - (target-generic-event-handler arg0 arg1 arg2 arg3) + (target-generic-event-handler proc arg1 event-type event) ) ) ) @@ -1350,7 +1348,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) ) @@ -1409,7 +1407,3 @@ ) :post target-no-stick-post ) - - - - diff --git a/goal_src/jak1/engine/target/target-handler.gc b/goal_src/jak1/engine/target/target-handler.gc index a7e87270a8..a7458be7a0 100644 --- a/goal_src/jak1/engine/target/target-handler.gc +++ b/goal_src/jak1/engine/target/target-handler.gc @@ -317,7 +317,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 ) @@ -381,7 +381,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)) ) @@ -727,7 +727,7 @@ ) (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 @@ -765,7 +765,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)) ) @@ -786,7 +786,7 @@ ) (('loading) (if (not (or (and (logtest? (-> self control unknown-surface00 flags) (surface-flags jump)) - (zero? (logand (-> self control status) (cshape-moving-flags onsurf))) + (not (logtest? (-> self control status) (cshape-moving-flags onsurf))) ) (or (logtest? (-> self water flags) (water-flags wt09)) (logtest? (-> self state-flags) (state-flags dangerous sf02 being-attacked grabbed first-person-mode dying)) @@ -823,7 +823,7 @@ ) (('tube) (if (and (logtest? (-> self control status) (cshape-moving-flags onsurf)) - (zero? (logand (-> self water flags) (water-flags wt09))) + (not (logtest? (-> self water flags) (water-flags wt09))) ) (go target-tube-start (process->handle (the-as process (-> arg3 param 1)))) ) @@ -855,7 +855,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)))) ) ) @@ -973,7 +973,7 @@ (-> self control unknown-dword50) (-> self control unknown-dword51) ) - (zero? (logand (-> self state-flags) (state-flags being-attacked dying))) + (not (logtest? (-> self state-flags) (state-flags being-attacked dying))) ) (set! (-> self control unknown-vector52 quad) (-> self control trans quad)) (target-timed-invulnerable (seconds 0.1) self) @@ -1075,7 +1075,3 @@ target-standard-event-handler 0 (none) ) - - - - diff --git a/goal_src/jak1/engine/target/target-util.gc b/goal_src/jak1/engine/target/target-util.gc index fe58f3cbef..2d663cf7f3 100644 --- a/goal_src/jak1/engine/target/target-util.gc +++ b/goal_src/jak1/engine/target/target-util.gc @@ -491,10 +491,7 @@ (set! (-> self control root-prim local-sphere w) (* (-> self control root-prim local-sphere w) f30-0)) (set! (-> s4-0 local-sphere w) (* (-> s4-0 local-sphere w) f30-0)) (set! (-> s5-0 local-sphere w) (* (-> s5-0 local-sphere w) f30-0)) - (let ((f0-37 (* (-> gp-0 local-sphere w) f30-0))) - (set! (-> gp-0 local-sphere w) f0-37) - f0-37 - ) + (set! (-> gp-0 local-sphere w) (* (-> gp-0 local-sphere w) f30-0)) ) ) ) @@ -674,7 +671,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) ) ) @@ -691,7 +688,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) ) ) @@ -729,8 +726,8 @@ (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))) - (zero? (logand (-> self water flags) (water-flags wt09))) + (not (logtest? (-> self control status) (cshape-moving-flags t-act))) + (not (logtest? (-> self water flags) (water-flags wt09))) ) ) @@ -741,8 +738,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)) @@ -764,7 +761,7 @@ ) (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))) @@ -789,7 +786,7 @@ ) (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)) @@ -803,18 +800,18 @@ (and (< 0.7 (-> self control touch-angle)) (and (< (-> self control surface-angle) 0.3) (logtest? (-> self control status) (cshape-moving-flags twall)) - (or arg0 (zero? (logand (-> self control status) (cshape-moving-flags t-act)))) + (or arg0 (not (logtest? (-> self control status) (cshape-moving-flags t-act)))) ) ) ) (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) - (zero? (logand (-> self state-flags) (state-flags prevent-duck))) + (not (logtest? (-> self state-flags) (state-flags prevent-duck))) ) ) ) @@ -822,9 +819,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) ) ) @@ -858,12 +855,9 @@ (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) ) @@ -1033,7 +1027,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)) @@ -1064,15 +1058,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)) @@ -1209,7 +1203,3 @@ ) ) ) - - - - diff --git a/goal_src/jak1/engine/target/target.gc b/goal_src/jak1/engine/target/target.gc index 30da01e3b7..8f98cae10f 100644 --- a/goal_src/jak1/engine/target/target.gc +++ b/goal_src/jak1/engine/target/target.gc @@ -108,9 +108,9 @@ ) (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))) + (not (logtest? (-> self state-flags) (state-flags prevent-jump))) ) (go target-jump (-> *TARGET-bank* jump-height-min) (-> *TARGET-bank* jump-height-max) (the-as surface #f)) ) @@ -1004,7 +1004,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) @@ -1226,8 +1226,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))) @@ -1312,8 +1311,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) @@ -1466,8 +1464,8 @@ (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))) - (zero? (logand (-> self state-flags) (state-flags prevent-jump))) + (not (logtest? (-> self water flags) (water-flags wt09))) + (not (logtest? (-> self state-flags) (state-flags prevent-jump))) ) ) (go target-double-jump (-> *TARGET-bank* double-jump-height-min) (-> *TARGET-bank* double-jump-height-max)) @@ -1478,9 +1476,9 @@ (>= (- (-> *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))) - (zero? (logand (-> self control unknown-surface01 flags) (surface-flags prevent-attacks-during-launch-jump surf08)) - ) + (not (logtest? (-> self state-flags) (state-flags prevent-attack))) + (not (logtest? (-> self control unknown-surface01 flags) (surface-flags prevent-attacks-during-launch-jump surf08)) + ) ) ) (go @@ -1599,9 +1597,9 @@ (>= (- (-> *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))) - (zero? (logand (-> self control unknown-surface01 flags) (surface-flags prevent-attacks-during-launch-jump surf08)) - ) + (not (logtest? (-> self state-flags) (state-flags prevent-attack))) + (not (logtest? (-> self control unknown-surface01 flags) (surface-flags prevent-attacks-during-launch-jump surf08)) + ) ) ) (go @@ -1699,9 +1697,9 @@ (>= (- (-> *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))) - (zero? (logand (-> self control unknown-surface01 flags) (surface-flags prevent-attacks-during-launch-jump surf08)) - ) + (not (logtest? (-> self state-flags) (state-flags prevent-attack))) + (not (logtest? (-> self control unknown-surface01 flags) (surface-flags prevent-attacks-during-launch-jump surf08)) + ) ) ) (go @@ -1930,7 +1928,7 @@ ) ) (if (and (< (-> *TARGET-bank* fall-far) f0-1) - (zero? (logand (-> self control status) (cshape-moving-flags on-water))) + (not (logtest? (-> self control status) (cshape-moving-flags on-water))) ) (go target-hit-ground-hard f0-1) ) @@ -2066,19 +2064,19 @@ ) (defstate target-running-attack (target) - :event (behavior ((arg0 process) (arg1 int) (arg2 symbol) (arg3 event-message-block)) - (case arg2 + :event (behavior ((proc process) (arg1 int) (event-type symbol) (event event-message-block)) + (case event-type (('touched) (cond (((method-of-type touching-shapes-entry prims-touching?) - (the-as touching-shapes-entry (-> arg3 param 0)) + (the-as touching-shapes-entry (-> event param 0)) (-> self control) (the-as uint 224) ) (let ((gp-1 (target-send-attack - arg0 + proc (the-as uint (-> self control unknown-symbol30)) - (the-as touching-shapes-entry (-> arg3 param 0)) + (the-as touching-shapes-entry (-> event param 0)) (-> self control unknown-dword50) (-> self control unknown-dword51) ) @@ -2086,8 +2084,8 @@ ) (when gp-1 (set! (-> self control unknown-uint20) (the-as uint (-> *display* base-frame-counter))) - (let ((v1-9 (if (and (nonzero? arg0) (type-type? (-> arg0 type) process-drawable)) - arg0 + (let ((v1-9 (if (and (nonzero? proc) (type-type? (-> proc type) process-drawable)) + proc ) ) ) @@ -2117,12 +2115,12 @@ ) ) (else - (target-dangerous-event-handler arg0 arg1 arg2 arg3) + (target-dangerous-event-handler proc arg1 event-type event) ) ) ) (else - (target-dangerous-event-handler arg0 arg1 arg2 arg3) + (target-dangerous-event-handler proc arg1 event-type event) ) ) ) @@ -2161,7 +2159,7 @@ (when (!= (-> self state-time) (-> *display* base-frame-counter)) (if (and (or (smack-surface? #t) (and (>= (-> self control unknown-float63) 0.7) - (zero? (logand (-> self control status) (cshape-moving-flags t-act))) + (not (logtest? (-> self control status) (cshape-moving-flags t-act))) ) ) (begin @@ -2202,13 +2200,13 @@ (if (and (cpad-pressed? (-> self control unknown-cpad-info00 number) x) (and (< 4096.0 (-> self control unknown-float01)) (or (>= (- (-> *display* base-frame-counter) (-> self state-time)) (seconds 0.1)) - (zero? (logand (-> *cpad-list* cpads (-> self control unknown-cpad-info00 number) button0-abs 0) + (not (logtest? (-> *cpad-list* cpads (-> self control unknown-cpad-info00 number) button0-abs 0) (pad-buttons square) ) - ) + ) ) - (zero? (logand (-> self state-flags) (state-flags prevent-jump prevent-attack))) - (zero? (logand (-> self control unknown-surface01 flags) (surface-flags prevent-attacks-during-launch-jump))) + (not (logtest? (-> self state-flags) (state-flags prevent-jump prevent-attack))) + (not (logtest? (-> self control unknown-surface01 flags) (surface-flags prevent-attacks-during-launch-jump))) ) ) (go @@ -2261,7 +2259,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))) @@ -2288,10 +2286,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)) @@ -2326,7 +2321,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))) @@ -2348,15 +2343,15 @@ ) (defstate target-attack-air (target) - :event (behavior ((arg0 process) (arg1 int) (arg2 symbol) (arg3 event-message-block)) - (let ((v0-0 (target-bonk-event-handler arg0 arg1 arg2 arg3))) + :event (behavior ((proc process) (arg1 int) (event-type symbol) (event event-message-block)) + (let ((v0-0 (target-bonk-event-handler proc arg1 event-type event))) (cond (v0-0 (empty) v0-0 ) (else - (target-dangerous-event-handler arg0 arg1 arg2 arg3) + (target-dangerous-event-handler proc arg1 event-type event) ) ) ) @@ -2596,9 +2591,9 @@ (>= (- (-> *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))) - (zero? (logand (-> self control unknown-surface01 flags) (surface-flags prevent-attacks-during-launch-jump surf08)) - ) + (not (logtest? (-> self state-flags) (state-flags prevent-attack))) + (not (logtest? (-> self control unknown-surface01 flags) (surface-flags prevent-attacks-during-launch-jump surf08)) + ) ) ) (set-quaternion! (-> self control) (-> self control dir-targ)) @@ -2668,14 +2663,14 @@ ) (defstate target-flop (target) - :event (behavior ((arg0 process) (arg1 int) (arg2 symbol) (arg3 event-message-block)) - (let ((v0-0 (target-bonk-event-handler arg0 arg1 arg2 arg3))) + :event (behavior ((proc process) (arg1 int) (event-type symbol) (event event-message-block)) + (let ((v0-0 (target-bonk-event-handler proc arg1 event-type event))) (cond (v0-0 (empty) v0-0 ) - ((let ((v1-0 arg2)) + ((let ((v1-0 event-type)) (= v1-0 'swim) ) (cond @@ -2697,7 +2692,7 @@ ) ) (else - (target-dangerous-event-handler arg0 arg1 arg2 arg3) + (target-dangerous-event-handler proc arg1 event-type event) ) ) ) @@ -2916,13 +2911,13 @@ ) (defstate target-flop-hit-ground (target) - :event (behavior ((arg0 process) (arg1 int) (arg2 symbol) (arg3 event-message-block)) - (case arg2 + :event (behavior ((proc process) (arg1 int) (event-type symbol) (event event-message-block)) + (case event-type (('swim) #f ) (else - (target-standard-event-handler arg0 arg1 arg2 arg3) + (target-standard-event-handler proc arg1 event-type event) ) ) ) @@ -2989,11 +2984,11 @@ ) (defstate target-wheel (target) - :event (behavior ((arg0 process) (arg1 int) (arg2 symbol) (arg3 event-message-block)) - (if (= arg2 'touched) - (send-event arg0 'roll) + :event (behavior ((proc process) (arg1 int) (event-type symbol) (event event-message-block)) + (if (= event-type 'touched) + (send-event proc 'roll) ) - (target-standard-event-handler arg0 arg1 arg2 arg3) + (target-standard-event-handler proc arg1 event-type event) ) :enter (behavior () (set! (-> self state-time) (-> *display* base-frame-counter)) @@ -3178,7 +3173,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)) @@ -3241,7 +3236,3 @@ ) :post target-post ) - - - - diff --git a/goal_src/jak1/engine/target/target2.gc b/goal_src/jak1/engine/target/target2.gc index ac7f82f004..7f10cd2d3c 100644 --- a/goal_src/jak1/engine/target/target2.gc +++ b/goal_src/jak1/engine/target/target2.gc @@ -12,14 +12,14 @@ ;; DECOMP BEGINS (defstate target-load-wait (target) - :event (behavior ((arg0 process) (arg1 int) (arg2 symbol) (arg3 event-message-block)) - (case arg2 + :event (behavior ((proc process) (arg1 int) (event-type symbol) (event event-message-block)) + (case event-type (('loading) (set! (-> self state-time) (-> *display* base-frame-counter)) #f ) (else - (target-standard-event-handler arg0 arg1 arg2 arg3) + (target-standard-event-handler proc arg1 event-type event) ) ) ) @@ -63,13 +63,13 @@ ) (defstate target-stance-ambient (target) - :event (behavior ((arg0 process) (arg1 int) (arg2 symbol) (arg3 event-message-block)) - (case arg2 + :event (behavior ((proc process) (arg1 int) (event-type symbol) (event event-message-block)) + (case event-type (('movie) (go target-stance) ) (else - (target-standard-event-handler arg0 arg1 arg2 arg3) + (target-standard-event-handler proc arg1 event-type event) ) ) ) @@ -277,8 +277,8 @@ ) (defstate hud-waiting (first-person-hud) - :event (behavior ((arg0 process) (arg1 int) (arg2 symbol) (arg3 event-message-block)) - (case arg2 + :event (behavior ((proc process) (arg1 int) (event-type symbol) (event event-message-block)) + (case event-type (('go-away) (go hud-going-out) ) @@ -451,21 +451,21 @@ ) (defstate target-look-around (target) - :event (behavior ((arg0 process) (arg1 int) (arg2 symbol) (arg3 event-message-block)) + :event (behavior ((proc process) (arg1 int) (event-type symbol) (event event-message-block)) (cond - ((and (= arg2 'query) (= (-> arg3 param 0) 'mode)) + ((and (= event-type 'query) (= (-> event param 0) 'mode)) (-> self state name) ) - ((let ((v1-4 arg2)) + ((let ((v1-4 event-type)) (= v1-4 'end-mode) ) (go target-stance-look-around) ) ((-> self control unknown-symbol30) - (target-dangerous-event-handler arg0 arg1 arg2 arg3) + (target-dangerous-event-handler proc arg1 event-type event) ) (else - (target-standard-event-handler arg0 arg1 arg2 arg3) + (target-standard-event-handler proc arg1 event-type event) ) ) ) @@ -611,18 +611,18 @@ ) (defstate target-billy-game (target) - :event (behavior ((arg0 process) (arg1 int) (arg2 symbol) (arg3 event-message-block)) + :event (behavior ((proc process) (arg1 int) (event-type symbol) (event event-message-block)) (cond - ((and (= arg2 'query) (= (-> arg3 param 0) 'mode)) + ((and (= event-type 'query) (= (-> event param 0) 'mode)) (-> self state name) ) - ((let ((v1-4 arg2)) + ((let ((v1-4 event-type)) (= v1-4 'end-mode) ) (go target-stance) ) (else - (target-standard-event-handler arg0 arg1 arg2 arg3) + (target-standard-event-handler proc arg1 event-type event) ) ) ) @@ -743,38 +743,38 @@ ) (defstate target-grab (target) - :event (behavior ((arg0 process) (arg1 int) (arg2 symbol) (arg3 event-message-block)) + :event (behavior ((proc process) (arg1 int) (event-type symbol) (event event-message-block)) (cond - ((and (= arg2 'query) (= (-> arg3 param 0) 'mode)) + ((and (= event-type 'query) (= (-> event param 0) 'mode)) (-> self state name) ) (else - (case arg2 + (case event-type (('end-mode) (go target-stance) ) (('play-anim) - (let ((v0-0 (the-as object (-> arg3 param 0)))) + (let ((v0-0 (the-as object (-> event param 0)))) (set! (-> self control unknown-uint20) (the-as uint v0-0)) v0-0 ) ) (('clone-anim) - (go target-clone-anim (process->handle (the-as process (-> arg3 param 0)))) + (go target-clone-anim (process->handle (the-as process (-> event param 0)))) ) (('change-mode) - (case (-> arg3 param 0) + (case (-> event param 0) (('final-door) (go target-final-door - (the-as basic (process->handle (the-as process (-> arg3 param 1)))) - (process->handle (the-as process (-> arg3 param 2))) + (the-as basic (process->handle (the-as process (-> event param 1)))) + (process->handle (the-as process (-> event param 2))) ) ) ) ) (else - (target-generic-event-handler arg0 arg1 arg2 arg3) + (target-generic-event-handler proc arg1 event-type event) ) ) ) @@ -795,7 +795,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) @@ -912,10 +912,10 @@ ) (defstate target-pole-cycle (target) - :event (behavior ((arg0 process) (arg1 int) (arg2 symbol) (arg3 event-message-block)) - (if (and (= arg2 'query) (= (-> arg3 param 0) 'mode)) + :event (behavior ((proc process) (arg1 int) (event-type symbol) (event event-message-block)) + (if (and (= event-type 'query) (= (-> event param 0) 'mode)) (-> self state name) - (target-standard-event-handler arg0 arg1 arg2 arg3) + (target-standard-event-handler proc arg1 event-type event) ) ) :enter (behavior ((arg0 handle)) @@ -944,7 +944,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)) @@ -1128,13 +1128,13 @@ ) (defstate target-edge-grab (target) - :event (behavior ((arg0 process) (arg1 int) (arg2 symbol) (arg3 event-message-block)) - (case arg2 + :event (behavior ((proc process) (arg1 int) (event-type symbol) (event event-message-block)) + (case event-type (('end-mode) (go target-falling 'target-edge-grab) ) (else - (target-standard-event-handler arg0 arg1 arg2 arg3) + (target-standard-event-handler proc arg1 event-type event) ) ) ) @@ -1164,7 +1164,7 @@ ) (pad-buttons x) ) - (zero? (logand (-> self state-flags) (state-flags prevent-jump))) + (not (logtest? (-> self state-flags) (state-flags prevent-jump))) ) (cond ((or (< -0.2 (local-pad-angle)) @@ -1247,13 +1247,13 @@ ) (defstate target-edge-grab-jump (target) - :event (behavior ((arg0 process) (arg1 int) (arg2 symbol) (arg3 event-message-block)) - (case arg2 + :event (behavior ((proc process) (arg1 int) (event-type symbol) (event event-message-block)) + (case event-type (('end-mode) (go target-falling 'target-edge-grab) ) (else - (target-standard-event-handler arg0 arg1 arg2 arg3) + (target-standard-event-handler proc arg1 event-type event) ) ) ) @@ -1268,7 +1268,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) ) @@ -1297,7 +1297,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) ) @@ -1603,8 +1603,8 @@ ) (pad-buttons x) ) - (zero? (logand (-> self water flags) (water-flags wt09))) - (zero? (logand (-> self state-flags) (state-flags prevent-jump))) + (not (logtest? (-> self water flags) (water-flags wt09))) + (not (logtest? (-> self state-flags) (state-flags prevent-jump))) ) (go target-jump (-> *TARGET-bank* jump-height-min) (-> *TARGET-bank* jump-height-max) (the-as surface #f)) ) @@ -1665,7 +1665,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)) @@ -1710,7 +1710,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)) @@ -1953,10 +1953,7 @@ (seek! (-> self control unknown-float131) (the-as float -6144.0) (* 4096.0 (-> *display* seconds-per-frame))) (seek! (-> self control unknown-float131) (the-as float 0.0) (* 2048.0 (-> *display* seconds-per-frame))) ) - (let ((f0-20 (-> self control unknown-float131))) - (set! (-> self control unknown-vector11 y) f0-20) - f0-20 - ) + (set! (-> self control unknown-vector11 y) (-> self control unknown-float131)) ) (defstate target-swim-stance (target) @@ -1985,11 +1982,11 @@ :trans (behavior () ((-> self state-hook)) (if (and (logtest? (-> self control status) (cshape-moving-flags onsurf)) - (zero? (logand (-> self control status) (cshape-moving-flags on-water))) + (not (logtest? (-> self control status) (cshape-moving-flags on-water))) ) (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)) @@ -2100,11 +2097,11 @@ :trans (behavior () ((-> self state-hook)) (if (and (logtest? (-> self control status) (cshape-moving-flags onsurf)) - (zero? (logand (-> self control status) (cshape-moving-flags on-water))) + (not (logtest? (-> self control status) (cshape-moving-flags on-water))) ) (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)) @@ -2161,7 +2158,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)) ) @@ -2179,7 +2176,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)) ) @@ -2194,11 +2191,11 @@ ) (defstate target-swim-down (target) - :event (behavior ((arg0 process) (arg1 int) (arg2 symbol) (arg3 event-message-block)) - (case arg2 + :event (behavior ((proc process) (arg1 int) (event-type symbol) (event event-message-block)) + (case event-type (('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)) + (let ((v1-2 (the-as attack-info (-> event param 1)))) + (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) @@ -2209,7 +2206,7 @@ ) ) ) - (target-standard-event-handler arg0 arg1 arg2 arg3) + (target-standard-event-handler proc arg1 event-type event) ) :enter (behavior () (set! (-> self state-time) (-> *display* base-frame-counter)) @@ -2312,10 +2309,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) @@ -2371,8 +2365,8 @@ :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))) - (zero? (logand (-> self water flags) (water-flags wt13 wt14))) + (not (logtest? (-> self state-flags) (state-flags prevent-jump))) + (not (logtest? (-> self water flags) (water-flags wt13 wt14))) ) (go target-swim-jump-jump @@ -2405,7 +2399,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) @@ -2415,7 +2409,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) ) @@ -2438,7 +2432,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) @@ -2502,7 +2496,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) @@ -2554,7 +2548,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) ) ) @@ -2589,10 +2583,10 @@ ) (defstate target-launch (target) - :event (behavior ((arg0 process) (arg1 int) (arg2 symbol) (arg3 event-message-block)) - (if (and (= arg2 'query) (= (-> arg3 param 0) 'mode)) + :event (behavior ((proc process) (arg1 int) (event-type symbol) (event event-message-block)) + (if (and (= event-type 'query) (= (-> event param 0) 'mode)) 'target-launch - (target-standard-event-handler arg0 arg1 arg2 arg3) + (target-standard-event-handler proc arg1 event-type event) ) ) :code (behavior ((arg0 float) (arg1 symbol) (arg2 vector) (arg3 int)) @@ -2685,8 +2679,8 @@ ) (defstate target-periscope (target) - :event (behavior ((arg0 process) (arg1 int) (arg2 symbol) (arg3 event-message-block)) - (case arg2 + :event (behavior ((proc process) (arg1 int) (event-type symbol) (event event-message-block)) + (case event-type (('change-mode) #f ) @@ -2697,7 +2691,7 @@ ) ) (else - (target-generic-event-handler arg0 arg1 arg2 arg3) + (target-generic-event-handler proc arg1 event-type event) ) ) ) @@ -2784,11 +2778,11 @@ ) (defstate target-clone-anim (target) - :event (behavior ((arg0 process) (arg1 int) (arg2 symbol) (arg3 event-message-block)) - (if (and (= arg2 'trans) (= (-> arg3 param 0) 'restore)) + :event (behavior ((proc process) (arg1 int) (event-type symbol) (event event-message-block)) + (if (and (= event-type 'trans) (= (-> event param 0) 'restore)) (set! (-> self control unknown-uint20) (the-as uint #f)) ) - ((-> target-grab event) arg0 arg1 arg2 arg3) + ((-> target-grab event) proc arg1 event-type event) ) :enter (behavior ((arg0 handle)) (set! (-> self control unknown-handle10) arg0) @@ -2810,7 +2804,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)) @@ -2853,7 +2847,3 @@ ) :post target-no-ja-move-post ) - - - - diff --git a/goal_src/jak1/levels/beach/beach-obs.gc b/goal_src/jak1/levels/beach/beach-obs.gc index 7ba32605b6..6525a0d3f0 100644 --- a/goal_src/jak1/levels/beach/beach-obs.gc +++ b/goal_src/jak1/levels/beach/beach-obs.gc @@ -216,19 +216,19 @@ ) (defstate grottopole-idle (grottopole) - :event (behavior ((arg0 process) (arg1 int) (arg2 symbol) (arg3 event-message-block)) - (when (= (-> arg0 type) target) - (case arg2 + :event (behavior ((proc process) (arg1 int) (event-type symbol) (event event-message-block)) + (when (= (-> proc type) target) + (case event-type (('attack) - (let ((v1-2 (-> arg3 param 2))) + (let ((v1-2 (-> event param 2))) (when (!= v1-2 (-> self incomming-attack-id)) (set! (-> self incomming-attack-id) v1-2) - (case (-> arg3 param 1) + (case (-> event param 1) (('uppercut) (when (and (< (-> *target* control trans y) (+ -40960.0 (-> self root-override trans y))) (< (-> self position) (-> self max-position)) ((method-of-type touching-shapes-entry prims-touching?) - (the-as touching-shapes-entry (-> arg3 param 0)) + (the-as touching-shapes-entry (-> event param 0)) (the-as collide-shape-moving (-> self root-override)) (the-as uint 2) ) @@ -243,7 +243,7 @@ (when (and (< (+ -40960.0 (-> self root-override trans y)) (-> *target* control trans y)) (> (-> self position) 0) ((method-of-type touching-shapes-entry prims-touching?) - (the-as touching-shapes-entry (-> arg3 param 0)) + (the-as touching-shapes-entry (-> event param 0)) (the-as collide-shape-moving (-> self root-override)) (the-as uint 1) ) @@ -413,7 +413,7 @@ (defpartgroup group-beach-harvester-rock-explosion :id 156 - :duration 600 + :duration (seconds 2) :flags (use-local-clock) :bounds (static-bspherem 0 0 0 8) :parts ((sp-item 543 :period 1500 :length 5) @@ -545,8 +545,8 @@ ) (defstate ecoventrock-idle (ecoventrock) - :event (behavior ((arg0 process) (arg1 int) (arg2 symbol) (arg3 event-message-block)) - (case arg2 + :event (behavior ((proc process) (arg1 int) (event-type symbol) (event event-message-block)) + (case event-type (('attack) (sound-play "cannon-shot") (increment-success-for-hint (game-text-id sidekick-hint-ecorocks)) @@ -998,7 +998,7 @@ ) ) -;; WARN: Expression building failed: Function (method 20 flutflutegg) has a return type of none, but the expression builder found a return statement. +;; WARN: Function (method 20 flutflutegg) has a return type of none, but the expression builder found a return statement. (defmethod dummy-20 flutflutegg ((obj flutflutegg) (arg0 float) (arg1 float) (arg2 float)) (if (< (- (-> *display* base-frame-counter) (the-as time-frame (-> obj last-impulse-time))) (seconds 0.5)) (return 0) @@ -1015,12 +1015,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) ) @@ -1030,15 +1030,15 @@ ) (defstate flutflutegg-idle (flutflutegg) - :event (behavior ((arg0 process) (arg1 int) (arg2 symbol) (arg3 event-message-block)) - (when (and (= arg2 'attack) - (or (= (-> arg3 param 1) 'punch) (= (-> arg3 param 1) 'spin) (= (-> arg3 param 1) 'spin-air)) - (!= (-> self incomming-attack-id) (-> arg3 param 2)) + :event (behavior ((proc process) (arg1 int) (event-type symbol) (event event-message-block)) + (when (and (= event-type 'attack) + (or (= (-> event param 1) 'punch) (= (-> event param 1) 'spin) (= (-> event param 1) 'spin-air)) + (!= (-> self incomming-attack-id) (-> event param 2)) ) - (set! (-> self incomming-attack-id) (-> arg3 param 2)) + (set! (-> self incomming-attack-id) (-> event param 2)) (flutflutegg-hit-sounds) (let ((s5-1 - (vector-! (new-stack-vector0) (-> (the-as process-drawable arg0) root trans) (-> self root-override trans)) + (vector-! (new-stack-vector0) (-> (the-as process-drawable proc) root trans) (-> self root-override trans)) ) ) (set! (-> s5-1 y) 0.0) @@ -1070,22 +1070,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) ) @@ -1123,18 +1123,18 @@ ) (defstate flutflutegg-physics (flutflutegg) - :event (behavior ((arg0 process) (arg1 int) (arg2 symbol) (arg3 event-message-block)) + :event (behavior ((proc process) (arg1 int) (event-type symbol) (event event-message-block)) (the-as object (when (and (>= (- (-> *display* base-frame-counter) (-> self state-time)) (seconds 0.5)) - (= arg2 'attack) - (or (= (-> arg3 param 1) 'punch) (= (-> arg3 param 1) 'spin) (= (-> arg3 param 1) 'spin-air)) - (!= (-> self incomming-attack-id) (-> arg3 param 2)) + (= event-type 'attack) + (or (= (-> event param 1) 'punch) (= (-> event param 1) 'spin) (= (-> event param 1) 'spin-air)) + (!= (-> self incomming-attack-id) (-> event param 2)) ) - (set! (-> self incomming-attack-id) (-> arg3 param 2)) + (set! (-> self incomming-attack-id) (-> event param 2)) (flutflutegg-hit-sounds) (let ((s5-1 - (vector-! (new-stack-vector0) (-> (the-as process-drawable arg0) root trans) (-> self root-override trans)) + (vector-! (new-stack-vector0) (-> (the-as process-drawable proc) root trans) (-> self root-override trans)) ) ) (set! (-> s5-1 y) 0.0) @@ -1264,7 +1264,7 @@ ) (ja :group! (-> self draw art-group data 5) :num! max) (while (and (not (task-closed? (game-task beach-flutflut) (task-status need-reward-speech))) - (zero? (logand (-> self ambients-played) 1024)) + (not (logtest? (-> self ambients-played) 1024)) ) (if (play-ambient (-> self ambient) "BIR-AM11" #f (the-as vector #f)) (logior! (-> self ambients-played) 1024) @@ -1377,8 +1377,8 @@ ) (defstate harvester-idle (harvester) - :event (behavior ((arg0 process) (arg1 int) (arg2 symbol) (arg3 event-message-block)) - (case arg2 + :event (behavior ((proc process) (arg1 int) (event-type symbol) (event event-message-block)) + (case event-type (('update) (if (and (-> self alt-actor) (logtest? (-> self alt-actor extra perm status) (entity-perm-status complete))) (go harvester-inflate #f) @@ -1534,7 +1534,3 @@ (none) ) ) - - - - diff --git a/goal_src/jak1/levels/finalboss/robotboss.gc b/goal_src/jak1/levels/finalboss/robotboss.gc index 04e80110a6..e013b7a2fb 100644 --- a/goal_src/jak1/levels/finalboss/robotboss.gc +++ b/goal_src/jak1/levels/finalboss/robotboss.gc @@ -47,7 +47,7 @@ (robotboss-cut-cam-exit) ) ((or (and (logtest? (-> *target* control unknown-surface00 flags) (surface-flags jump)) - (zero? (logand (-> *target* control status) (cshape-moving-flags onsurf))) + (not (logtest? (-> *target* control status) (cshape-moving-flags onsurf))) ) (-> self skip-cut) ) @@ -359,10 +359,7 @@ (local-vars (v0-0 object)) (case arg2 (('flash) - (let ((f0-1 (* 0.0078125 (the-as float (-> arg3 param 0))))) - (set! (-> self palette-val) f0-1) - f0-1 - ) + (set! (-> self palette-val) (* 0.0078125 (the-as float (-> arg3 param 0)))) ) (('bomb-done) (set! (-> self des-cam-entity) #f) @@ -433,8 +430,8 @@ ) (defstate robotboss-yellow-dark-bomb-wait (robotboss) - :event (behavior ((arg0 process) (arg1 int) (arg2 symbol) (arg3 event-message-block)) - (let ((v1-0 arg2)) + :event (behavior ((proc process) (arg1 int) (event-type symbol) (event event-message-block)) + (let ((v1-0 event-type)) (the-as object (cond ((= v1-0 'white-eco-picked-up) (close-specific-task! (game-task finalboss-movies) (task-status unknown)) @@ -458,7 +455,7 @@ (deactivate self) ) (else - (robotboss-bomb-handler arg0 arg1 arg2 arg3) + (robotboss-bomb-handler proc arg1 event-type event) ) ) ) @@ -912,8 +909,8 @@ ) (defstate robotboss-yellow-wait (robotboss) - :event (behavior ((arg0 process) (arg1 int) (arg2 symbol) (arg3 event-message-block)) - (case arg2 + :event (behavior ((proc process) (arg1 int) (event-type symbol) (event event-message-block)) + (case event-type (('hit-jak) (let ((f0-2 (rand-float-gen))) (cond @@ -941,7 +938,7 @@ ) ) (else - (robotboss-handler arg0 arg1 arg2 arg3) + (robotboss-handler proc arg1 event-type event) ) ) ) @@ -1487,8 +1484,8 @@ ) (defstate robotboss-red-wait (robotboss) - :event (behavior ((arg0 process) (arg1 int) (arg2 symbol) (arg3 event-message-block)) - (case arg2 + :event (behavior ((proc process) (arg1 int) (event-type symbol) (event event-message-block)) + (case event-type (('hit-jak) (let ((f0-2 (rand-float-gen))) (cond @@ -1516,7 +1513,7 @@ ) ) (else - (robotboss-handler arg0 arg1 arg2 arg3) + (robotboss-handler proc arg1 event-type event) ) ) ) @@ -1939,8 +1936,8 @@ ) (defstate robotboss-green-wait (robotboss) - :event (behavior ((arg0 process) (arg1 int) (arg2 symbol) (arg3 event-message-block)) - (case arg2 + :event (behavior ((proc process) (arg1 int) (event-type symbol) (event event-message-block)) + (case event-type (('trigger) (ja-channel-push! 1 (seconds 0.2)) (ja :group! robotboss-green-roar-ja) @@ -1998,7 +1995,7 @@ ) ) (else - (robotboss-handler arg0 arg1 arg2 arg3) + (robotboss-handler proc arg1 event-type event) ) ) ) @@ -2352,10 +2349,10 @@ (when (and arg1 (nonzero? (-> self looping-sound 0))) (update! (-> self looping-sound 0)) (when (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) ) - ) + ) ) (let ((t2-0 (new 'stack-no-clear 'collide-tri-result)) (a2-0 (new 'stack-no-clear 'vector)) @@ -2391,10 +2388,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))))) @@ -2970,7 +2967,3 @@ (go robotboss-blue-wait) (none) ) - - - - diff --git a/goal_src/jak1/levels/flut_common/target-flut.gc b/goal_src/jak1/levels/flut_common/target-flut.gc index d86608b7fd..b2c714094f 100644 --- a/goal_src/jak1/levels/flut_common/target-flut.gc +++ b/goal_src/jak1/levels/flut_common/target-flut.gc @@ -297,7 +297,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)) ) @@ -475,10 +475,7 @@ (let ((a0-15 (-> v1-0 draw color-emissive quad))) (set! (-> self draw color-emissive quad) a0-15) ) - (let ((f0-0 (-> v1-0 draw secondary-interp))) - (set! (-> self draw secondary-interp) f0-0) - f0-0 - ) + (set! (-> self draw secondary-interp) (-> v1-0 draw secondary-interp)) ) ) ) @@ -533,7 +530,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))) @@ -628,7 +625,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))) @@ -756,10 +753,10 @@ ) (defstate target-flut-jump (target) - :event (behavior ((arg0 process) (arg1 int) (arg2 symbol) (arg3 event-message-block)) - (when (and (= arg2 'touched) + :event (behavior ((proc process) (arg1 int) (event-type symbol) (event event-message-block)) + (when (and (= event-type 'touched) ((method-of-type touching-shapes-entry prims-touching?) - (the-as touching-shapes-entry (-> arg3 param 0)) + (the-as touching-shapes-entry (-> event param 0)) (-> self control) (the-as uint 6) ) @@ -770,22 +767,22 @@ ) ) ) - (send-event arg0 'bonk (-> arg3 param 0) (-> self control ground-impact-vel)) + (send-event proc 'bonk (-> event param 0) (-> self control ground-impact-vel)) (when (target-send-attack - arg0 + proc (the-as uint 'flut-bonk) - (the-as touching-shapes-entry (-> arg3 param 0)) + (the-as touching-shapes-entry (-> event param 0)) (-> self control unknown-dword50) (-> self control unknown-dword51) ) ) ) - (case arg2 + (case event-type (('jump) - (go target-flut-jump (the-as float (-> arg3 param 0)) (the-as float (-> arg3 param 0))) + (go target-flut-jump (the-as float (-> event param 0)) (the-as float (-> event param 0))) ) (else - (target-flut-standard-event-handler arg0 arg1 arg2 arg3) + (target-flut-standard-event-handler proc arg1 event-type event) ) ) ) @@ -820,8 +817,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)) ) ) @@ -833,9 +830,9 @@ (>= (- (-> *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))) - (zero? (logand (-> self control unknown-surface01 flags) (surface-flags prevent-attacks-during-launch-jump surf08)) - ) + (not (logtest? (-> self state-flags) (state-flags prevent-attack))) + (not (logtest? (-> self control unknown-surface01 flags) (surface-flags prevent-attacks-during-launch-jump surf08)) + ) ) ) (go target-flut-air-attack (-> *FLUT-bank* air-attack-speed)) @@ -947,9 +944,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)) ) @@ -1065,7 +1062,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))) @@ -1151,19 +1148,19 @@ ) (defstate target-flut-running-attack (target) - :event (behavior ((arg0 process) (arg1 int) (arg2 symbol) (arg3 event-message-block)) - (case arg2 + :event (behavior ((proc process) (arg1 int) (event-type symbol) (event event-message-block)) + (case event-type (('touched) (cond (((method-of-type touching-shapes-entry prims-touching?) - (the-as touching-shapes-entry (-> arg3 param 0)) + (the-as touching-shapes-entry (-> event param 0)) (-> self control) (the-as uint 224) ) (let ((gp-1 (target-send-attack - arg0 + proc (the-as uint (-> self control unknown-symbol30)) - (the-as touching-shapes-entry (-> arg3 param 0)) + (the-as touching-shapes-entry (-> event param 0)) (-> self control unknown-dword50) (-> self control unknown-dword51) ) @@ -1171,8 +1168,8 @@ ) (when gp-1 (set! (-> self control unknown-uint20) (the-as uint (-> *display* base-frame-counter))) - (let ((v1-9 (if (and (nonzero? arg0) (type-type? (-> arg0 type) process-drawable)) - arg0 + (let ((v1-9 (if (and (nonzero? proc) (type-type? (-> proc type) process-drawable)) + proc ) ) ) @@ -1203,12 +1200,12 @@ ) ) (else - (target-flut-dangerous-event-handler arg0 arg1 arg2 arg3) + (target-flut-dangerous-event-handler proc arg1 event-type event) ) ) ) (else - (target-flut-dangerous-event-handler arg0 arg1 arg2 arg3) + (target-flut-dangerous-event-handler proc arg1 event-type event) ) ) ) @@ -1264,7 +1261,7 @@ (when (!= (-> self state-time) (-> *display* base-frame-counter)) (if (and (or (smack-surface? #t) (and (>= (-> self control unknown-float63) 0.7) - (zero? (logand (-> self control status) (cshape-moving-flags t-act))) + (not (logtest? (-> self control status) (cshape-moving-flags t-act))) ) ) (begin @@ -1295,7 +1292,7 @@ ) (!= (-> self control unknown-uint31) 1) ) - (target-shoved (meters 2.0) (-> *TARGET-bank* smack-surface-height) (the-as process #f) target-flut-hit) + (target-shoved (meters 2) (-> *TARGET-bank* smack-surface-height) (the-as process #f) target-flut-hit) ) (if (and (logtest? (-> self water flags) (water-flags wt09)) (zero? (mod (- (-> *display* base-frame-counter) (-> self state-time)) 21)) @@ -1330,7 +1327,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))) @@ -1383,7 +1380,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))) @@ -1419,10 +1416,10 @@ ) (defstate target-flut-air-attack (target) - :event (behavior ((arg0 process) (arg1 int) (arg2 symbol) (arg3 event-message-block)) - (if (and (= arg2 'touched) + :event (behavior ((proc process) (arg1 int) (event-type symbol) (event event-message-block)) + (if (and (= event-type 'touched) ((method-of-type touching-shapes-entry prims-touching?) - (the-as touching-shapes-entry (-> arg3 param 0)) + (the-as touching-shapes-entry (-> event param 0)) (-> self control) (the-as uint 6) ) @@ -1433,14 +1430,14 @@ ) ) ) - (send-event arg0 'bonk (-> arg3 param 0) (-> self control ground-impact-vel)) + (send-event proc 'bonk (-> event param 0) (-> self control ground-impact-vel)) ) - (case arg2 + (case event-type (('jump) - (go target-flut-jump (the-as float (-> arg3 param 0)) (the-as float (-> arg3 param 0))) + (go target-flut-jump (the-as float (-> event param 0)) (the-as float (-> event param 0))) ) (else - (target-flut-dangerous-event-handler arg0 arg1 arg2 arg3) + (target-flut-dangerous-event-handler proc arg1 event-type event) ) ) ) @@ -1659,7 +1656,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)) @@ -1857,7 +1854,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)) ) @@ -1976,7 +1973,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) @@ -2112,21 +2109,21 @@ ) (defstate target-flut-grab (target) - :event (behavior ((arg0 process) (arg1 int) (arg2 symbol) (arg3 event-message-block)) + :event (behavior ((proc process) (arg1 int) (event-type symbol) (event event-message-block)) (cond - ((and (= arg2 'query) (= (-> arg3 param 0) 'mode)) + ((and (= event-type 'query) (= (-> event param 0) 'mode)) (-> self state name) ) (else - (case arg2 + (case event-type (('end-mode) (go target-flut-stance) ) (('clone-anim) - (go target-flut-clone-anim (process->handle (the-as process (-> arg3 param 0)))) + (go target-flut-clone-anim (process->handle (the-as process (-> event param 0)))) ) (else - (target-generic-event-handler arg0 arg1 arg2 arg3) + (target-generic-event-handler proc arg1 event-type event) ) ) ) @@ -2153,11 +2150,11 @@ ) (defstate target-flut-clone-anim (target) - :event (behavior ((arg0 process) (arg1 int) (arg2 symbol) (arg3 event-message-block)) - (if (and (= arg2 'trans) (= (-> arg3 param 0) 'restore)) + :event (behavior ((proc process) (arg1 int) (event-type symbol) (event event-message-block)) + (if (and (= event-type 'trans) (= (-> event param 0) 'restore)) (set! (-> self control unknown-uint20) (the-as uint #f)) ) - ((-> target-flut-grab event) arg0 arg1 arg2 arg3) + ((-> target-flut-grab event) proc arg1 event-type event) ) :enter (-> target-clone-anim enter) :exit (behavior () @@ -2178,7 +2175,3 @@ (none) ) ) - - - - diff --git a/goal_src/jak1/levels/jungle/jungle-mirrors.gc b/goal_src/jak1/levels/jungle/jungle-mirrors.gc index 9cbb1627a6..e1bde460dd 100644 --- a/goal_src/jak1/levels/jungle/jungle-mirrors.gc +++ b/goal_src/jak1/levels/jungle/jungle-mirrors.gc @@ -638,7 +638,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) @@ -1047,7 +1047,7 @@ (lambda ((arg0 entity-actor) (arg1 (pointer symbol))) (the-as object - (when (and (= (-> arg0 etype) periscope) (zero? (logand (-> arg0 extra perm status) (entity-perm-status complete)))) + (when (and (= (-> arg0 etype) periscope) (not (logtest? (-> arg0 extra perm status) (entity-perm-status complete)))) (set! (-> arg1 0) #f) #t ) @@ -1160,8 +1160,8 @@ ) (defstate periscope-idle (periscope) - :event (behavior ((arg0 process) (arg1 int) (arg2 symbol) (arg3 event-message-block)) - (case arg2 + :event (behavior ((proc process) (arg1 int) (event-type symbol) (event event-message-block)) + (case event-type (('activate) (logclear! (-> self mask) (process-mask actor-pause)) (go periscope-activate) @@ -1261,16 +1261,16 @@ ) (defstate periscope-wait-for-player (periscope) - :event (behavior ((arg0 process) (arg1 int) (arg2 symbol) (arg3 event-message-block)) - (case arg2 + :event (behavior ((proc process) (arg1 int) (event-type symbol) (event event-message-block)) + (case event-type (('touch) (when (and *target* (not (and (logtest? (-> *target* control unknown-surface00 flags) (surface-flags jump)) - (zero? (logand (-> *target* control status) (cshape-moving-flags onsurf))) + (not (logtest? (-> *target* control status) (cshape-moving-flags onsurf))) ) ) ) (when ((method-of-type touching-shapes-entry prims-touching?) - (the-as touching-shapes-entry (-> arg3 param 0)) + (the-as touching-shapes-entry (-> event param 0)) (the-as collide-shape-moving (-> self root-override)) (the-as uint 1) ) @@ -1742,7 +1742,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))) @@ -1802,8 +1802,8 @@ ) (defstate reflector-mirror-idle (reflector-mirror) - :event (behavior ((arg0 process) (arg1 int) (arg2 symbol) (arg3 event-message-block)) - (case arg2 + :event (behavior ((proc process) (arg1 int) (event-type symbol) (event event-message-block)) + (case event-type (('attack) (sound-play "mirror-smash") (go reflector-mirror-broken #f) @@ -1984,7 +1984,3 @@ 0 (none) ) - - - - diff --git a/goal_src/jak1/levels/jungle/junglesnake.gc b/goal_src/jak1/levels/jungle/junglesnake.gc index 69c6d15345..63b3723484 100644 --- a/goal_src/jak1/levels/jungle/junglesnake.gc +++ b/goal_src/jak1/levels/jungle/junglesnake.gc @@ -117,10 +117,10 @@ ) (cond ((and (-> self is-lethal?) - (zero? (logand (-> *target* state-flags) + (not (logtest? (-> *target* state-flags) (state-flags being-attacked invulnerable timed-invulnerable invuln-powerup do-not-notice dying) ) - ) + ) ) (when (send-event arg0 'attack (-> arg3 param 0) (new 'static 'attack-info)) (let ((v0-1 (the-as object #t))) @@ -404,10 +404,10 @@ junglesnake-default-event-handler :trans (behavior () (if (and (and *target* (>= 24576.0 (vector-vector-distance (-> self root-override trans) (-> *target* control trans)))) (>= (- (-> *display* base-frame-counter) (-> self state-time)) (-> self refractory-delay)) - (zero? (logand (-> *target* state-flags) + (not (logtest? (-> *target* state-flags) (state-flags being-attacked invulnerable timed-invulnerable invuln-powerup do-not-notice dying) ) - ) + ) ) (go junglesnake-attack) ) @@ -796,7 +796,3 @@ junglesnake-default-event-handler (go junglesnake-sleeping) (none) ) - - - - diff --git a/goal_src/jak1/levels/jungleb/plant-boss.gc b/goal_src/jak1/levels/jungleb/plant-boss.gc index 3108cba7e3..cd1ef83a9a 100644 --- a/goal_src/jak1/levels/jungleb/plant-boss.gc +++ b/goal_src/jak1/levels/jungleb/plant-boss.gc @@ -236,13 +236,13 @@ ) (defstate plant-boss-arm-idle (plant-boss-arm) - :event (behavior ((arg0 process) (arg1 int) (arg2 symbol) (arg3 event-message-block)) - (case arg2 + :event (behavior ((proc process) (arg1 int) (event-type symbol) (event event-message-block)) + (case event-type (('hide 'die) - (go plant-boss-arm-die (the-as symbol (-> arg3 param 0))) + (go plant-boss-arm-die (the-as symbol (-> event param 0))) ) (('hit) - (go plant-boss-arm-hit (the-as basic (-> arg3 param 0))) + (go plant-boss-arm-hit (the-as basic (-> event param 0))) ) ) ) @@ -351,16 +351,16 @@ ) (defstate plant-boss-back-arms-idle (plant-boss-arm) - :event (behavior ((arg0 process) (arg1 int) (arg2 symbol) (arg3 event-message-block)) - (if (or (= arg2 'touch) (= arg2 'attack)) - (send-event arg0 'attack (-> arg3 param 0) (new 'static 'attack-info)) + :event (behavior ((proc process) (arg1 int) (event-type symbol) (event event-message-block)) + (if (or (= event-type 'touch) (= event-type 'attack)) + (send-event proc 'attack (-> event param 0) (new 'static 'attack-info)) ) (cond - ((= arg2 'hit) - (go plant-boss-back-arms-hit (the-as symbol (-> arg3 param 0))) + ((= event-type 'hit) + (go plant-boss-back-arms-hit (the-as symbol (-> event param 0))) ) - ((= arg2 'die) - (go plant-boss-back-arms-die (the-as symbol (-> arg3 param 0))) + ((= event-type 'die) + (go plant-boss-back-arms-die (the-as symbol (-> event param 0))) ) ) ) @@ -443,13 +443,13 @@ ) (defstate plant-boss-vine-idle (plant-boss-arm) - :event (behavior ((arg0 process) (arg1 int) (arg2 symbol) (arg3 event-message-block)) - (case arg2 + :event (behavior ((proc process) (arg1 int) (event-type symbol) (event event-message-block)) + (case event-type (('hide 'die) - (go plant-boss-vine-die (the-as symbol (-> arg3 param 0))) + (go plant-boss-vine-die (the-as symbol (-> event param 0))) ) (('hit) - (go plant-boss-vine-hit (the-as basic (-> arg3 param 0))) + (go plant-boss-vine-hit (the-as basic (-> event param 0))) ) ) ) @@ -515,10 +515,10 @@ ) (defstate plant-boss-root-idle (plant-boss-arm) - :event (behavior ((arg0 process) (arg1 int) (arg2 symbol) (arg3 event-message-block)) - (case arg2 + :event (behavior ((proc process) (arg1 int) (event-type symbol) (event event-message-block)) + (case event-type (('hide 'die) - (go plant-boss-root-die (the-as symbol (-> arg3 param 0))) + (go plant-boss-root-die (the-as symbol (-> event param 0))) ) ) ) @@ -666,13 +666,13 @@ ) (defstate plant-boss-leaf-idle (plant-boss-leaf) - :event (behavior ((arg0 process) (arg1 int) (arg2 symbol) (arg3 event-message-block)) - (case arg2 + :event (behavior ((proc process) (arg1 int) (event-type symbol) (event event-message-block)) + (case event-type (('trigger) - (go plant-boss-leaf-open (the-as symbol (-> arg3 param 0))) + (go plant-boss-leaf-open (the-as symbol (-> event param 0))) ) (('die) - (go plant-boss-leaf-die (the-as basic (-> arg3 param 0))) + (go plant-boss-leaf-die (the-as basic (-> event param 0))) ) ) ) @@ -705,13 +705,13 @@ ) (defstate plant-boss-leaf-open (plant-boss-leaf) - :event (behavior ((arg0 process) (arg1 int) (arg2 symbol) (arg3 event-message-block)) - (case arg2 + :event (behavior ((proc process) (arg1 int) (event-type symbol) (event event-message-block)) + (case event-type (('kill) (go plant-boss-leaf-close) ) (('die) - (go plant-boss-leaf-die (the-as basic (-> arg3 param 0))) + (go plant-boss-leaf-die (the-as basic (-> event param 0))) ) ) ) @@ -762,11 +762,11 @@ ) (defstate plant-boss-leaf-open-idle (plant-boss-leaf) - :event (behavior ((arg0 process) (arg1 int) (arg2 symbol) (arg3 event-message-block)) - (case arg2 + :event (behavior ((proc process) (arg1 int) (event-type symbol) (event event-message-block)) + (case event-type (('kill) (set! (-> self state-object) #t) - (let ((v0-0 (the-as object (+ (-> *display* base-frame-counter) (the-as time-frame (-> arg3 param 0)))))) + (let ((v0-0 (the-as object (+ (-> *display* base-frame-counter) (the-as time-frame (-> event param 0)))))) (set! (-> self state-time-frame) (the-as time-frame v0-0)) v0-0 ) @@ -777,7 +777,7 @@ ) ) (('die) - (go plant-boss-leaf-die (the-as basic (-> arg3 param 0))) + (go plant-boss-leaf-die (the-as basic (-> event param 0))) ) ) ) @@ -810,17 +810,17 @@ ) (defstate plant-boss-leaf-bounce (plant-boss-leaf) - :event (behavior ((arg0 process) (arg1 int) (arg2 symbol) (arg3 event-message-block)) - (case arg2 + :event (behavior ((proc process) (arg1 int) (event-type symbol) (event event-message-block)) + (case event-type (('kill) (set! (-> self state-object) #t) - (let ((v0-0 (the-as object (+ (-> *display* base-frame-counter) (the-as time-frame (-> arg3 param 0)))))) + (let ((v0-0 (the-as object (+ (-> *display* base-frame-counter) (the-as time-frame (-> event param 0)))))) (set! (-> self state-time-frame) (the-as time-frame v0-0)) v0-0 ) ) (('die) - (go plant-boss-leaf-die (the-as basic (-> arg3 param 0))) + (go plant-boss-leaf-die (the-as basic (-> event param 0))) ) ) ) @@ -852,10 +852,10 @@ ) (defstate plant-boss-leaf-close (plant-boss-leaf) - :event (behavior ((arg0 process) (arg1 int) (arg2 symbol) (arg3 event-message-block)) - (case arg2 + :event (behavior ((proc process) (arg1 int) (event-type symbol) (event event-message-block)) + (case event-type (('die) - (go plant-boss-leaf-die (the-as basic (-> arg3 param 0))) + (go plant-boss-leaf-die (the-as basic (-> event param 0))) ) ) ) @@ -1092,10 +1092,10 @@ ) ) *target* - (zero? (logand (-> *target* state-flags) + (not (logtest? (-> *target* state-flags) (state-flags being-attacked invulnerable timed-invulnerable invuln-powerup do-not-notice dying) ) - ) + ) ) (go plant-boss-attack 1) ) @@ -1236,25 +1236,25 @@ ) (defstate plant-boss-vulnerable (plant-boss) - :event (behavior ((arg0 process) (arg1 int) (arg2 symbol) (arg3 event-message-block)) - (case arg2 + :event (behavior ((proc process) (arg1 int) (event-type symbol) (event event-message-block)) + (case event-type (('attack) (when ((method-of-type touching-shapes-entry prims-touching?) - (the-as touching-shapes-entry (-> arg3 param 0)) + (the-as touching-shapes-entry (-> event param 0)) (the-as collide-shape-moving (-> self root-override)) (the-as uint 1) ) (send-event - arg0 + proc 'shove - (-> arg3 param 0) + (-> event param 0) (static-attack-info ((shove-up (meters 2)) (shove-back (meters 6)))) ) - (go plant-boss-hit (the-as symbol (-> arg3 param 1))) + (go plant-boss-hit (the-as symbol (-> event param 1))) ) ) (else - (plant-boss-generic-event-handler arg0 arg1 arg2 arg3) + (plant-boss-generic-event-handler proc arg1 event-type event) ) ) ) @@ -1335,17 +1335,17 @@ ) (defstate plant-boss-attack (plant-boss) - :event (behavior ((arg0 process) (arg1 int) (arg2 symbol) (arg3 event-message-block)) - (case arg2 + :event (behavior ((proc process) (arg1 int) (event-type symbol) (event event-message-block)) + (case event-type (('touch 'attack) (when (and ((method-of-type touching-shapes-entry prims-touching?) - (the-as touching-shapes-entry (-> arg3 param 0)) + (the-as touching-shapes-entry (-> event param 0)) (the-as collide-shape-moving (-> self root-override)) (the-as uint 1) ) - (not (ja-group? plant-boss-main-vulnerable2idle-ja)) + (not (ja-group? (-> self draw art-group data 13))) ) - (when (send-event arg0 'attack-or-shove (-> arg3 param 0) (static-attack-info ((mode 'plant-boss)))) + (when (send-event proc 'attack-or-shove (-> event param 0) (static-attack-info ((mode 'plant-boss)))) (let ((v0-1 (the-as object #t))) (set! (-> self ate) (the-as symbol v0-1)) v0-1 @@ -1354,7 +1354,7 @@ ) ) (else - (plant-boss-default-event-handler arg0 arg1 arg2 arg3) + (plant-boss-default-event-handler proc arg1 event-type event) ) ) ) @@ -1683,20 +1683,20 @@ ) (defstate plant-boss-dead-idle (plant-boss) - :event (behavior ((arg0 process) (arg1 int) (arg2 symbol) (arg3 event-message-block)) - (case arg2 + :event (behavior ((proc process) (arg1 int) (event-type symbol) (event event-message-block)) + (case event-type (('bonk) (go plant-boss-dead-bounce (lerp-scale (the-as float 0.1) (the-as float 1.0) - (the-as float (-> arg3 param 1)) + (the-as float (-> event param 1)) (the-as float 40960.0) (the-as float 81920.0) ) ) ) (else - (plant-boss-generic-event-handler arg0 arg1 arg2 arg3) + (plant-boss-generic-event-handler proc arg1 event-type event) ) ) ) @@ -1947,7 +1947,3 @@ (go plant-boss-far-idle) (none) ) - - - - diff --git a/goal_src/jak1/levels/maincave/maincave-obs.gc b/goal_src/jak1/levels/maincave/maincave-obs.gc index 370ec70188..33f4db3903 100644 --- a/goal_src/jak1/levels/maincave/maincave-obs.gc +++ b/goal_src/jak1/levels/maincave/maincave-obs.gc @@ -134,22 +134,22 @@ ) (defstate cavecrusher-idle (cavecrusher) - :event (behavior ((arg0 process) (arg1 int) (arg2 symbol) (arg3 event-message-block)) - (let ((v1-0 arg2)) - (the-as object (when (or (= v1-0 'touch) (= v1-0 'attack)) - (when (= (-> arg0 type) target) - (if ((method-of-type touching-shapes-entry prims-touching-action?) - (the-as touching-shapes-entry (-> arg3 param 0)) - (-> *target* control) - (collide-action solid) - (collide-action) - ) - (target-attack-up *target* 'attack-or-shove 'deadlyup) + :event (behavior ((proc process) (arg1 int) (event-type symbol) (event event-message-block)) + (the-as object (case event-type + (('touch 'attack) + (when (= (-> proc type) target) + (if ((method-of-type touching-shapes-entry prims-touching-action?) + (the-as touching-shapes-entry (-> event param 0)) + (-> *target* control) + (collide-action solid) + (collide-action) ) - ) - ) - ) - ) + (target-attack-up *target* 'attack-or-shove 'deadlyup) + ) + ) + ) + ) + ) ) :code (behavior () (loop @@ -223,12 +223,12 @@ (defstate idle (cavetrapdoor) :virtual #t - :event (behavior ((arg0 process) (arg1 int) (arg2 symbol) (arg3 event-message-block)) - (case arg2 + :event (behavior ((proc process) (arg1 int) (event-type symbol) (event event-message-block)) + (case event-type (('touch) - (when (= (-> arg0 type) target) + (when (= (-> proc type) target) (when (>= (- (-> (target-pos 0) y) (-> self root-override trans y)) 409.6) - (send-event arg0 'no-look-around (seconds 1.5)) + (send-event proc 'no-look-around (seconds 1.5)) (go-virtual trigger) ) ) @@ -277,10 +277,10 @@ (< 28672.0 (vector-vector-distance (-> self root-override trans) (-> *target* control trans))) ) (and (not (and (logtest? (-> *target* control unknown-surface00 flags) (surface-flags jump)) - (zero? (logand (-> *target* control status) (cshape-moving-flags onsurf))) + (not (logtest? (-> *target* control status) (cshape-moving-flags onsurf))) ) ) - (zero? (logand (-> *target* control root-prim prim-core action) (collide-action ca-7))) + (not (logtest? (-> *target* control root-prim prim-core action) (collide-action ca-7))) ) ) (ja-no-eval :group! (-> self draw art-group data 7) :num! (seek!) :frame-num 0.0) @@ -294,7 +294,7 @@ (until (ja-done? 0) (when (and (and *target* (>= 28672.0 (vector-vector-distance (-> self root-override trans) (-> *target* control trans)))) (or (and (logtest? (-> *target* control unknown-surface00 flags) (surface-flags jump)) - (zero? (logand (-> *target* control status) (cshape-moving-flags onsurf))) + (not (logtest? (-> *target* control status) (cshape-moving-flags onsurf))) ) (logtest? (-> *target* control root-prim prim-core action) (collide-action ca-7)) ) @@ -434,12 +434,12 @@ ) (defstate caveflamepots-active (caveflamepots) - :event (behavior ((arg0 process) (arg1 int) (arg2 symbol) (arg3 event-message-block)) - (case arg2 + :event (behavior ((proc process) (arg1 int) (event-type symbol) (event event-message-block)) + (case event-type (('touch 'attack) - (when (= (-> arg0 type) target) + (when (= (-> proc type) target) (when ((method-of-type touching-shapes-entry prims-touching-action?) - (the-as touching-shapes-entry (-> arg3 param 0)) + (the-as touching-shapes-entry (-> event param 0)) (-> *target* control) (collide-action solid) (collide-action) @@ -451,15 +451,15 @@ (< 0.75 (-> *target* control poly-normal y)) ) (send-event - arg0 + proc 'attack-or-shove - (-> arg3 param 0) + (-> event param 0) (static-attack-info ((mode 'burn) (vector (-> s4-0 vector)) (shove-up (-> s4-0 shove-up)))) ) (send-event - arg0 + proc 'attack-or-shove - (-> arg3 param 0) + (-> event param 0) (static-attack-info ((mode 'burn) (shove-up (meters 0)) (shove-back (meters 2)) @@ -931,21 +931,18 @@ ) (vector<-cspace! s5-0 (-> obj node-list data 3)) (vector-! gp-0 s5-0 (-> obj root-override trans)) - (let ((f0-0 17408.0)) - (set! (-> gp-0 w) f0-0) - f0-0 - ) + (set! (-> gp-0 w) 17408.0) ) ) (defstate caveelevator-cycle-active (caveelevator) - :event (behavior ((arg0 process) (arg1 int) (arg2 symbol) (arg3 event-message-block)) - (let ((v1-0 arg2)) - (the-as object (if (= v1-0 'bonk) - (activate! (-> self smush) -1.0 60 150 1.0 1.0) - ) - ) - ) + :event (behavior ((proc process) (arg1 int) (event-type symbol) (event event-message-block)) + (the-as object (case event-type + (('bonk) + (activate! (-> self smush) -1.0 60 150 1.0 1.0) + ) + ) + ) ) :enter (behavior () (logclear! (-> self mask) (process-mask actor-pause)) @@ -981,14 +978,14 @@ ) (defstate caveelevator-one-way-idle-start (caveelevator) - :event (behavior ((arg0 process) (arg1 int) (arg2 symbol) (arg3 event-message-block)) - (case arg2 + :event (behavior ((proc process) (arg1 int) (event-type symbol) (event event-message-block)) + (case event-type (('bonk) (activate! (-> self smush) -1.0 60 150 1.0 1.0) (go caveelevator-one-way-travel-to-end) ) (('attack 'touch) - (if (and (= (-> arg0 type) target) + (if (and (= (-> proc type) target) (>= 8192.0 (vector-vector-xz-distance (target-pos 0) (-> self root-override trans))) ) (go caveelevator-one-way-travel-to-end) @@ -1020,13 +1017,13 @@ ) (defstate caveelevator-one-way-travel-to-end (caveelevator) - :event (behavior ((arg0 process) (arg1 int) (arg2 symbol) (arg3 event-message-block)) - (let ((v1-0 arg2)) - (the-as object (if (= v1-0 'bonk) - (activate! (-> self smush) -1.0 60 150 1.0 1.0) - ) - ) - ) + :event (behavior ((proc process) (arg1 int) (event-type symbol) (event event-message-block)) + (the-as object (case event-type + (('bonk) + (activate! (-> self smush) -1.0 60 150 1.0 1.0) + ) + ) + ) ) :enter (behavior () (logclear! (-> self mask) (process-mask actor-pause)) @@ -1059,13 +1056,13 @@ ) (defstate caveelevator-one-way-idle-end (caveelevator) - :event (behavior ((arg0 process) (arg1 int) (arg2 symbol) (arg3 event-message-block)) - (let ((v1-0 arg2)) - (the-as object (if (= v1-0 'bonk) - (activate! (-> self smush) -1.0 60 150 1.0 1.0) - ) - ) - ) + :event (behavior ((proc process) (arg1 int) (event-type symbol) (event event-message-block)) + (the-as object (case event-type + (('bonk) + (activate! (-> self smush) -1.0 60 150 1.0 1.0) + ) + ) + ) ) :enter (behavior () (set! (-> self state-time) (-> *display* base-frame-counter)) @@ -1101,13 +1098,13 @@ ) (defstate caveelevator-one-way-travel-to-start (caveelevator) - :event (behavior ((arg0 process) (arg1 int) (arg2 symbol) (arg3 event-message-block)) - (let ((v1-0 arg2)) - (the-as object (if (= v1-0 'bonk) - (activate! (-> self smush) -1.0 60 150 1.0 1.0) - ) - ) - ) + :event (behavior ((proc process) (arg1 int) (event-type symbol) (event event-message-block)) + (the-as object (case event-type + (('bonk) + (activate! (-> self smush) -1.0 60 150 1.0 1.0) + ) + ) + ) ) :enter (behavior () (logclear! (-> self mask) (process-mask actor-pause)) @@ -1275,7 +1272,3 @@ ) (none) ) - - - - diff --git a/goal_src/jak1/levels/maincave/mother-spider-proj.gc b/goal_src/jak1/levels/maincave/mother-spider-proj.gc index 5c98189ae4..1369eb20a3 100644 --- a/goal_src/jak1/levels/maincave/mother-spider-proj.gc +++ b/goal_src/jak1/levels/maincave/mother-spider-proj.gc @@ -20,7 +20,7 @@ (defpartgroup group-mother-spider-proj-fly :id 326 - :duration 300 + :duration (seconds 1) :bounds (static-bspherem 0 0 0 3) :parts ((sp-item 718 :flags (launch-asap) :binding 716) (sp-item 716 :flags (start-dead) :binding 717) @@ -144,7 +144,7 @@ (defpartgroup group-mother-spider-proj-hit :id 327 - :duration 5 + :duration (seconds 0.017) :flags (use-local-clock) :bounds (static-bspherem 0 0 0 8) :parts ((sp-item 722) (sp-item 723) (sp-item 724)) @@ -219,7 +219,7 @@ (defpartgroup group-mother-spider-proj-die :id 328 - :duration 5 + :duration (seconds 0.017) :flags (use-local-clock) :bounds (static-bspherem 0 0 0 8) :parts ((sp-item 722)) @@ -339,10 +339,10 @@ (defmethod dummy-28 mother-spider-proj ((obj mother-spider-proj)) (when (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) ) - ) + ) ) (let ((gp-0 (-> obj target))) (set! (-> gp-0 quad) (-> (target-pos 0) quad)) @@ -410,7 +410,3 @@ (none) ) ) - - - - diff --git a/goal_src/jak1/levels/maincave/mother-spider.gc b/goal_src/jak1/levels/maincave/mother-spider.gc index 8a9e7731e4..707f52484c 100644 --- a/goal_src/jak1/levels/maincave/mother-spider.gc +++ b/goal_src/jak1/levels/maincave/mother-spider.gc @@ -361,7 +361,7 @@ (defmethod is-player-stuck? mother-spider ((obj mother-spider)) (when (and *target* (not (and (logtest? (-> *target* control unknown-surface00 flags) (surface-flags jump)) - (zero? (logand (-> *target* control status) (cshape-moving-flags onsurf))) + (not (logtest? (-> *target* control status) (cshape-moving-flags onsurf))) ) ) ) @@ -427,10 +427,8 @@ 0 (let* ((f3-0 (vector-vector-distance (-> s5-0 intersect) (-> obj root-override trans))) (f0-14 (* 0.000030517578 (fmin 32768.0 (fmax 0.0 (+ -57344.0 f3-0))))) - (f0-15 (lerp 409600.0 40960.0 f0-14)) ) - (set! (-> obj draw shadow-ctrl settings shadow-dir w) f0-15) - f0-15 + (set! (-> obj draw shadow-ctrl settings shadow-dir w) (lerp 409600.0 40960.0 f0-14)) ) ) (else @@ -1047,7 +1045,7 @@ ) ) (if (or (not *target*) (and (logtest? (-> *target* control unknown-surface00 flags) (surface-flags jump)) - (zero? (logand (-> *target* control status) (cshape-moving-flags onsurf))) + (not (logtest? (-> *target* control status) (cshape-moving-flags onsurf))) ) ) (set! (-> self last-player-in-air-time) (-> *display* base-frame-counter)) @@ -1236,20 +1234,20 @@ (go mother-spider-traveling (the-as uint 0)) ) (if (and (>= (- (-> *display* base-frame-counter) (-> self started-birthing-time)) (seconds 6)) - (zero? (logand (-> *target* state-flags) + (not (logtest? (-> *target* state-flags) (state-flags being-attacked invulnerable timed-invulnerable invuln-powerup do-not-notice dying) ) - ) + ) ) (go mother-spider-traveling (the-as uint 1)) ) (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)) ) ) @@ -1334,73 +1332,7 @@ (defmethod TODO-RENAME-20 mother-spider ((obj mother-spider) (arg0 vector) (arg1 vector)) (set! (-> obj nav nav-cull-radius) 40960.0) (set-current-poly! (-> obj nav) (dummy-16 (-> obj nav) (-> obj root-override trans))) - (TODO-RENAME-28 (-> obj nav) (collide-kind - background - cak-1 - cak-2 - cak-3 - target - water - powerup - crate - enemy - wall-object - projectile - ground-object - target-attack - mother-spider - cak-14 - blue-eco-suck - unknown-16 - unknown-17 - unknown-18 - unknown-19 - unknown-20 - unknown-21 - unknown-22 - unknown-23 - unknown-24 - unknown-25 - unknown-26 - unknown-27 - unknown-28 - unknown-29 - unknown-30 - unknown-31 - unknown-32 - unknown-33 - unknown-34 - unknown-35 - unknown-36 - unknown-37 - unknown-38 - unknown-39 - unknown-40 - unknown-41 - unknown-42 - unknown-43 - unknown-44 - unknown-45 - unknown-46 - unknown-47 - unknown-48 - unknown-49 - unknown-50 - unknown-51 - unknown-52 - unknown-53 - unknown-54 - unknown-55 - unknown-56 - unknown-57 - unknown-58 - unknown-59 - unknown-60 - unknown-61 - unknown-62 - unknown-63 - ) - ) + (TODO-RENAME-28 (-> obj nav) (the-as collide-kind -1)) (dotimes (s3-1 4) (let ((f28-0 (+ 32768.0 (-> obj orient-rot y))) (f30-0 (rand-vu-float-range 16384.0 40960.0)) @@ -1680,15 +1612,12 @@ (vector-normalize! (-> arg0 vector 1) 1.0) (set! (-> arg0 vector 0 w) 0.0) (set! (-> arg0 vector 1 w) 0.0) - (let ((f0-8 0.0)) - (set! (-> arg0 vector 2 w) f0-8) - f0-8 - ) + (set! (-> arg0 vector 2 w) 0.0) ) ) (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))) @@ -1934,7 +1863,3 @@ ) (none) ) - - - - diff --git a/goal_src/jak1/levels/misty/babak-with-cannon.gc b/goal_src/jak1/levels/misty/babak-with-cannon.gc index 2f57dd0946..be921fa9fb 100644 --- a/goal_src/jak1/levels/misty/babak-with-cannon.gc +++ b/goal_src/jak1/levels/misty/babak-with-cannon.gc @@ -413,14 +413,10 @@ nav-enemy-default-event-handler (set! (-> obj cannon-ent) (entity-actor-lookup (-> obj entity) 'alt-actor 0)) (logclear! (-> obj mask) (process-mask actor-pause)) (if (or (not (and (-> obj entity) (logtest? (-> obj entity extra perm status) (entity-perm-status complete)))) - (zero? (logand (-> obj enemy-info options) (fact-options has-power-cell))) + (not (logtest? (-> obj enemy-info options) (fact-options has-power-cell))) ) (go (method-of-object obj nav-enemy-idle)) ) (go (method-of-object obj nav-enemy-fuel-cell)) (none) ) - - - - diff --git a/goal_src/jak1/levels/ogre/flying-lurker.gc b/goal_src/jak1/levels/ogre/flying-lurker.gc index 9e5f3da1fa..91234fc3cf 100644 --- a/goal_src/jak1/levels/ogre/flying-lurker.gc +++ b/goal_src/jak1/levels/ogre/flying-lurker.gc @@ -164,16 +164,16 @@ ) (defstate plunger-lurker-flee (plunger-lurker) - :event (behavior ((arg0 process) (arg1 int) (arg2 symbol) (arg3 event-message-block)) - (let ((v1-0 arg2)) - (the-as object (when (= v1-0 'attack) - (let ((v0-0 #t)) - (set! (-> self got-hit) v0-0) - v0-0 - ) - ) - ) - ) + :event (behavior ((proc process) (arg1 int) (event-type symbol) (event event-message-block)) + (the-as object (case event-type + (('attack) + (let ((v0-0 #t)) + (set! (-> self got-hit) v0-0) + v0-0 + ) + ) + ) + ) ) :trans (behavior () (when (-> self got-hit) @@ -222,8 +222,8 @@ ) (defstate plunger-lurker-idle (plunger-lurker) - :event (behavior ((arg0 process) (arg1 int) (arg2 symbol) (arg3 event-message-block)) - (case arg2 + :event (behavior ((proc process) (arg1 int) (event-type symbol) (event event-message-block)) + (case event-type (('plunge) (logclear! (-> self mask) (process-mask actor-pause)) (go plunger-lurker-plunge) @@ -590,106 +590,104 @@ ) (defstate flying-lurker-fly (flying-lurker) - :event (behavior ((arg0 process) (arg1 int) (arg2 symbol) (arg3 event-message-block)) - (let ((v1-0 arg2)) - (the-as object (cond - ((= v1-0 'clone-and-kill-links) - (let ((a1-1 (new 'stack-no-clear 'event-message-block))) - (set! (-> a1-1 from) self) - (set! (-> a1-1 num-params) 0) - (set! (-> a1-1 message) 'sleep) - (let ((t9-0 send-event-function) - (v1-3 (-> self link next)) - ) - (t9-0 - (if v1-3 - (-> v1-3 extra process) - ) - a1-1 + :event (behavior ((proc process) (arg1 int) (event-type symbol) (event event-message-block)) + (the-as object (case event-type + (('clone-and-kill-links) + (let ((a1-1 (new 'stack-no-clear 'event-message-block))) + (set! (-> a1-1 from) self) + (set! (-> a1-1 num-params) 0) + (set! (-> a1-1 message) 'sleep) + (let ((t9-0 send-event-function) + (v1-3 (-> self link next)) ) + (t9-0 + (if v1-3 + (-> v1-3 extra process) + ) + a1-1 ) ) - (go flying-lurker-clone (the-as handle (-> arg3 param 0)) "") ) - ((= v1-0 'die) - (let ((v1-7 (new 'stack-no-clear 'event-message-block))) - (set! (-> v1-7 from) arg0) - (set! (-> v1-7 num-params) arg1) - (set! (-> v1-7 message) arg2) - (set! (-> v1-7 param 0) (-> arg3 param 0)) - (set! (-> v1-7 param 1) (-> arg3 param 1)) - (set! (-> v1-7 param 2) (-> arg3 param 2)) - (set! (-> v1-7 param 3) (-> arg3 param 3)) - (set! (-> v1-7 param 4) (-> arg3 param 4)) - (set! (-> v1-7 param 5) (-> arg3 param 5)) - (set! (-> v1-7 param 6) (-> arg3 param 6)) - (let ((t9-2 send-event-function) - (a1-3 (-> self link next)) - ) - (t9-2 - (if a1-3 - (-> a1-3 extra process) - ) - v1-7 + (go flying-lurker-clone (the-as handle (-> event param 0)) "") + ) + (('die) + (let ((v1-7 (new 'stack-no-clear 'event-message-block))) + (set! (-> v1-7 from) proc) + (set! (-> v1-7 num-params) arg1) + (set! (-> v1-7 message) event-type) + (set! (-> v1-7 param 0) (-> event param 0)) + (set! (-> v1-7 param 1) (-> event param 1)) + (set! (-> v1-7 param 2) (-> event param 2)) + (set! (-> v1-7 param 3) (-> event param 3)) + (set! (-> v1-7 param 4) (-> event param 4)) + (set! (-> v1-7 param 5) (-> event param 5)) + (set! (-> v1-7 param 6) (-> event param 6)) + (let ((t9-2 send-event-function) + (a1-3 (-> self link next)) ) + (t9-2 + (if a1-3 + (-> a1-3 extra process) + ) + v1-7 ) ) - (cleanup-for-death self) - (deactivate self) ) - ((= v1-0 'sleep) - (let ((v1-12 (new 'stack-no-clear 'event-message-block))) - (set! (-> v1-12 from) arg0) - (set! (-> v1-12 num-params) arg1) - (set! (-> v1-12 message) arg2) - (set! (-> v1-12 param 0) (-> arg3 param 0)) - (set! (-> v1-12 param 1) (-> arg3 param 1)) - (set! (-> v1-12 param 2) (-> arg3 param 2)) - (set! (-> v1-12 param 3) (-> arg3 param 3)) - (set! (-> v1-12 param 4) (-> arg3 param 4)) - (set! (-> v1-12 param 5) (-> arg3 param 5)) - (set! (-> v1-12 param 6) (-> arg3 param 6)) - (let ((t9-5 send-event-function) - (a1-5 (-> self link next)) - ) - (t9-5 - (if a1-5 - (-> a1-5 extra process) - ) - v1-12 + (cleanup-for-death self) + (deactivate self) + ) + (('sleep) + (let ((v1-12 (new 'stack-no-clear 'event-message-block))) + (set! (-> v1-12 from) proc) + (set! (-> v1-12 num-params) arg1) + (set! (-> v1-12 message) event-type) + (set! (-> v1-12 param 0) (-> event param 0)) + (set! (-> v1-12 param 1) (-> event param 1)) + (set! (-> v1-12 param 2) (-> event param 2)) + (set! (-> v1-12 param 3) (-> event param 3)) + (set! (-> v1-12 param 4) (-> event param 4)) + (set! (-> v1-12 param 5) (-> event param 5)) + (set! (-> v1-12 param 6) (-> event param 6)) + (let ((t9-5 send-event-function) + (a1-5 (-> self link next)) ) + (t9-5 + (if a1-5 + (-> a1-5 extra process) + ) + v1-12 ) ) - (go flying-lurker-sleep) ) - ((= v1-0 'reset) - (let ((v1-15 (new 'stack-no-clear 'event-message-block))) - (set! (-> v1-15 from) arg0) - (set! (-> v1-15 num-params) arg1) - (set! (-> v1-15 message) arg2) - (set! (-> v1-15 param 0) (-> arg3 param 0)) - (set! (-> v1-15 param 1) (-> arg3 param 1)) - (set! (-> v1-15 param 2) (-> arg3 param 2)) - (set! (-> v1-15 param 3) (-> arg3 param 3)) - (set! (-> v1-15 param 4) (-> arg3 param 4)) - (set! (-> v1-15 param 5) (-> arg3 param 5)) - (set! (-> v1-15 param 6) (-> arg3 param 6)) - (let ((t9-7 send-event-function) - (a1-7 (-> self link next)) - ) - (t9-7 - (if a1-7 - (-> a1-7 extra process) - ) - v1-15 + (go flying-lurker-sleep) + ) + (('reset) + (let ((v1-15 (new 'stack-no-clear 'event-message-block))) + (set! (-> v1-15 from) proc) + (set! (-> v1-15 num-params) arg1) + (set! (-> v1-15 message) event-type) + (set! (-> v1-15 param 0) (-> event param 0)) + (set! (-> v1-15 param 1) (-> event param 1)) + (set! (-> v1-15 param 2) (-> event param 2)) + (set! (-> v1-15 param 3) (-> event param 3)) + (set! (-> v1-15 param 4) (-> event param 4)) + (set! (-> v1-15 param 5) (-> event param 5)) + (set! (-> v1-15 param 6) (-> event param 6)) + (let ((t9-7 send-event-function) + (a1-7 (-> self link next)) ) + (t9-7 + (if a1-7 + (-> a1-7 extra process) + ) + v1-15 ) ) - (deactivate self) ) - ) - ) - ) + (deactivate self) + ) + ) + ) ) :enter (behavior () (process-entity-status! self (entity-perm-status bit-3) #t) @@ -699,7 +697,7 @@ :trans (behavior () (dummy-20 self) (when (not (movie?)) - (flying-lurker-calc-speed (meters 15.0) (meters 30.0) (meters 0.11666667) (meters 0.083333336)) + (flying-lurker-calc-speed (meters 15) (meters 30) (meters 0.11666667) (meters 0.083333336)) (flying-lurker-move) (flying-lurker-rotate) (when (and (-> self alt-actor) @@ -738,7 +736,7 @@ (suspend) (when (>= (- (-> *display* base-frame-counter) (-> self last-look-time)) (-> self time-to-next-look)) (ja-channel-push! 1 (seconds 0.2)) - (ja-no-eval :group! flying-lurker-look-ja :num! (seek!) :frame-num 0.0) + (ja-no-eval :group! (-> self draw art-group data 6) :num! (seek!) :frame-num 0.0) (until (ja-done? 0) (suspend) (ja :num! (seek!)) @@ -850,7 +848,7 @@ (close-specific-task! (game-task plunger-lurker-hit) (task-status unknown)) (while (and *target* (logtest? (-> *target* control unknown-surface00 flags) (surface-flags jump)) - (zero? (logand (-> *target* control status) (cshape-moving-flags onsurf))) + (not (logtest? (-> *target* control status) (cshape-moving-flags onsurf))) ) (suspend) ) @@ -930,13 +928,7 @@ (suspend) ) ) - (level-hint-spawn - (game-text-id ogre-race-hint) - "asstvb24" - (the-as entity #f) - *entity-pool* - (game-task none) - ) + (level-hint-spawn (game-text-id ogre-race-hint) "asstvb24" (the-as entity #f) *entity-pool* (game-task none)) (none) ) :to self @@ -989,21 +981,21 @@ ) (defstate flying-lurker-clone (flying-lurker) - :event (behavior ((arg0 process) (arg1 int) (arg2 symbol) (arg3 event-message-block)) - (let ((v1-0 arg2)) + :event (behavior ((proc process) (arg1 int) (event-type symbol) (event event-message-block)) + (let ((v1-0 event-type)) (the-as object (cond ((= v1-0 'die) (let ((v1-1 (new 'stack-no-clear 'event-message-block))) - (set! (-> v1-1 from) arg0) + (set! (-> v1-1 from) proc) (set! (-> v1-1 num-params) arg1) - (set! (-> v1-1 message) arg2) - (set! (-> v1-1 param 0) (-> arg3 param 0)) - (set! (-> v1-1 param 1) (-> arg3 param 1)) - (set! (-> v1-1 param 2) (-> arg3 param 2)) - (set! (-> v1-1 param 3) (-> arg3 param 3)) - (set! (-> v1-1 param 4) (-> arg3 param 4)) - (set! (-> v1-1 param 5) (-> arg3 param 5)) - (set! (-> v1-1 param 6) (-> arg3 param 6)) + (set! (-> v1-1 message) event-type) + (set! (-> v1-1 param 0) (-> event param 0)) + (set! (-> v1-1 param 1) (-> event param 1)) + (set! (-> v1-1 param 2) (-> event param 2)) + (set! (-> v1-1 param 3) (-> event param 3)) + (set! (-> v1-1 param 4) (-> event param 4)) + (set! (-> v1-1 param 5) (-> event param 5)) + (set! (-> v1-1 param 6) (-> event param 6)) (let ((t9-0 send-event-function) (a1-1 (-> self link next)) ) @@ -1020,16 +1012,16 @@ ) ((= v1-0 'sleep) (let ((v1-6 (new 'stack-no-clear 'event-message-block))) - (set! (-> v1-6 from) arg0) + (set! (-> v1-6 from) proc) (set! (-> v1-6 num-params) arg1) - (set! (-> v1-6 message) arg2) - (set! (-> v1-6 param 0) (-> arg3 param 0)) - (set! (-> v1-6 param 1) (-> arg3 param 1)) - (set! (-> v1-6 param 2) (-> arg3 param 2)) - (set! (-> v1-6 param 3) (-> arg3 param 3)) - (set! (-> v1-6 param 4) (-> arg3 param 4)) - (set! (-> v1-6 param 5) (-> arg3 param 5)) - (set! (-> v1-6 param 6) (-> arg3 param 6)) + (set! (-> v1-6 message) event-type) + (set! (-> v1-6 param 0) (-> event param 0)) + (set! (-> v1-6 param 1) (-> event param 1)) + (set! (-> v1-6 param 2) (-> event param 2)) + (set! (-> v1-6 param 3) (-> event param 3)) + (set! (-> v1-6 param 4) (-> event param 4)) + (set! (-> v1-6 param 5) (-> event param 5)) + (set! (-> v1-6 param 6) (-> event param 6)) (let ((t9-3 send-event-function) (a1-3 (-> self link next)) ) @@ -1045,16 +1037,16 @@ ) ((= v1-0 'reset) (let ((v1-9 (new 'stack-no-clear 'event-message-block))) - (set! (-> v1-9 from) arg0) + (set! (-> v1-9 from) proc) (set! (-> v1-9 num-params) arg1) - (set! (-> v1-9 message) arg2) - (set! (-> v1-9 param 0) (-> arg3 param 0)) - (set! (-> v1-9 param 1) (-> arg3 param 1)) - (set! (-> v1-9 param 2) (-> arg3 param 2)) - (set! (-> v1-9 param 3) (-> arg3 param 3)) - (set! (-> v1-9 param 4) (-> arg3 param 4)) - (set! (-> v1-9 param 5) (-> arg3 param 5)) - (set! (-> v1-9 param 6) (-> arg3 param 6)) + (set! (-> v1-9 message) event-type) + (set! (-> v1-9 param 0) (-> event param 0)) + (set! (-> v1-9 param 1) (-> event param 1)) + (set! (-> v1-9 param 2) (-> event param 2)) + (set! (-> v1-9 param 3) (-> event param 3)) + (set! (-> v1-9 param 4) (-> event param 4)) + (set! (-> v1-9 param 5) (-> event param 5)) + (set! (-> v1-9 param 6) (-> event param 6)) (let ((t9-5 send-event-function) (a1-5 (-> self link next)) ) @@ -1069,7 +1061,7 @@ (deactivate self) ) (else - (flying-lurker-handler arg0 arg1 arg2 arg3) + (flying-lurker-handler proc arg1 event-type event) ) ) ) @@ -1086,23 +1078,23 @@ ) (defstate flying-lurker-idle (flying-lurker) - :event (behavior ((arg0 process) (arg1 int) (arg2 symbol) (arg3 event-message-block)) - (case arg2 + :event (behavior ((proc process) (arg1 int) (event-type symbol) (event event-message-block)) + (case event-type (('saw-player) (set! (-> self take-off) #t) (when (-> self link prev) (entity-birth-no-kill (-> self link prev)) (let ((a1-1 (new 'stack-no-clear 'event-message-block))) - (set! (-> a1-1 from) arg0) + (set! (-> a1-1 from) proc) (set! (-> a1-1 num-params) arg1) - (set! (-> a1-1 message) arg2) - (set! (-> a1-1 param 0) (-> arg3 param 0)) - (set! (-> a1-1 param 1) (-> arg3 param 1)) - (set! (-> a1-1 param 2) (-> arg3 param 2)) - (set! (-> a1-1 param 3) (-> arg3 param 3)) - (set! (-> a1-1 param 4) (-> arg3 param 4)) - (set! (-> a1-1 param 5) (-> arg3 param 5)) - (set! (-> a1-1 param 6) (-> arg3 param 6)) + (set! (-> a1-1 message) event-type) + (set! (-> a1-1 param 0) (-> event param 0)) + (set! (-> a1-1 param 1) (-> event param 1)) + (set! (-> a1-1 param 2) (-> event param 2)) + (set! (-> a1-1 param 3) (-> event param 3)) + (set! (-> a1-1 param 4) (-> event param 4)) + (set! (-> a1-1 param 5) (-> event param 5)) + (set! (-> a1-1 param 6) (-> event param 6)) (let ((t9-1 send-event-function) (v1-13 (-> self link prev)) ) @@ -1123,8 +1115,8 @@ (set! (-> a1-2 from) self) (set! (-> a1-2 num-params) 2) (set! (-> a1-2 message) 'clone) - (set! (-> a1-2 param 0) (-> arg3 param 0)) - (set! (-> a1-2 param 1) (+ (-> arg3 param 1) -1)) + (set! (-> a1-2 param 0) (-> event param 0)) + (set! (-> a1-2 param 1) (+ (-> event param 1) -1)) (let ((t9-3 send-event-function) (v1-25 (-> self link next)) ) @@ -1137,17 +1129,17 @@ ) ) ) - (case (-> arg3 param 1) + (case (-> event param 1) ((2) - (go flying-lurker-clone (the-as handle (-> arg3 param 0)) "flying-lurker-b-") + (go flying-lurker-clone (the-as handle (-> event param 0)) "flying-lurker-b-") ) ((1) - (go flying-lurker-clone (the-as handle (-> arg3 param 0)) "flying-lurker-c-") + (go flying-lurker-clone (the-as handle (-> event param 0)) "flying-lurker-c-") ) ) ) (else - (flying-lurker-handler arg0 arg1 arg2 arg3) + (flying-lurker-handler proc arg1 event-type event) ) ) ) @@ -1265,7 +1257,3 @@ ) (none) ) - - - - diff --git a/goal_src/jak1/levels/racer_common/collide-reaction-racer.gc b/goal_src/jak1/levels/racer_common/collide-reaction-racer.gc index e2c30686d8..6928e81e34 100644 --- a/goal_src/jak1/levels/racer_common/collide-reaction-racer.gc +++ b/goal_src/jak1/levels/racer_common/collide-reaction-racer.gc @@ -61,7 +61,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) @@ -124,7 +124,7 @@ ) (and (< 0.0 (vector-dot (-> arg0 ground-poly-normal) arg2)) (< (- (-> *display* base-frame-counter) (-> arg0 unknown-dword10)) (seconds 0.3)) - (zero? (logand sv-104 32)) + (not (logtest? sv-104 32)) ) ) ) @@ -156,7 +156,7 @@ (else (set! sv-96 (logior sv-96 1)) (set! (-> arg0 cur-pat mode) 0) - (if (and (= (-> arg1 best-from-prim prim-id) 6) (zero? (logand sv-104 7))) + (if (and (= (-> arg1 best-from-prim prim-id) 6) (not (logtest? sv-104 7))) (set! (-> arg0 local-normal quad) (-> sv-84 quad)) ) (vector-reflect-flat! arg2 (-> sv-88 0) sv-84) @@ -165,7 +165,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)) @@ -193,7 +193,3 @@ (set! (-> arg0 unknown-halfword00) (logand (+ (-> arg0 unknown-halfword00) 1) 127)) (the-as cshape-moving-flags sv-96) ) - - - - diff --git a/goal_src/jak1/levels/racer_common/racer-part.gc b/goal_src/jak1/levels/racer_common/racer-part.gc index 18e690cfee..5b107b993b 100644 --- a/goal_src/jak1/levels/racer_common/racer-part.gc +++ b/goal_src/jak1/levels/racer_common/racer-part.gc @@ -976,8 +976,8 @@ (defpartgroup group-racer-explode :id 116 - :duration 300 - :linger-duration 3000 + :duration (seconds 1) + :linger-duration (seconds 10) :flags (use-local-clock) :bounds (static-bspherem 0 0 0 8) :parts ((sp-item 2279 :period 600 :length 5) @@ -1122,7 +1122,3 @@ (sp-cpuinfo-flags bit0 bit2 bit3 bit14) ) ) - - - - diff --git a/goal_src/jak1/levels/racer_common/racer-states.gc b/goal_src/jak1/levels/racer_common/racer-states.gc index ae6421f672..10b1763299 100644 --- a/goal_src/jak1/levels/racer_common/racer-states.gc +++ b/goal_src/jak1/levels/racer_common/racer-states.gc @@ -10,83 +10,77 @@ ;; DECOMP BEGINS (defstate target-racing-start (target) - :event (behavior ((arg0 process) (arg1 int) (arg2 symbol) (arg3 event-message-block)) + :event (behavior ((proc process) (arg1 int) (event-type symbol) (event event-message-block)) (cond - ((and (= arg2 'query) (= (-> arg3 param 0) 'mode)) + ((and (= event-type 'query) (= (-> event param 0) 'mode)) 'racer ) - ((and (= arg2 'get-pickup) (= (-> arg3 param 0) 3)) + ((and (= event-type 'get-pickup) (= (-> event param 0) 3)) (if (>= (- (-> *display* base-frame-counter) (-> self racer boost-time)) (seconds 1)) - (send-event self 'boost (fmax 1.0 (fmin 2.0 (the-as float (-> arg3 param 1))))) + (send-event self 'boost (fmax 1.0 (fmin 2.0 (the-as float (-> event param 1))))) ) ) (else - (case arg2 + (case event-type (('end-mode) - (go target-racing-get-off (process->handle arg0)) + (go target-racing-get-off (process->handle proc)) ) (('touched) - (send-event arg0 'attack (-> arg3 param 0) 'racer 0 0) - (when (and (type-type? (-> arg0 type) babak) (< 40960.0 (-> self control unknown-float01))) + (send-event proc 'attack (-> event param 0) 'racer 0 0) + (when (and (type-type? (-> proc type) babak) (< 40960.0 (-> self control unknown-float01))) (let ((f0-5 (lerp-scale 16384.0 32768.0 (-> self control unknown-float01) 40960.0 (-> self racer transv-max)))) (go target-racing-jump f0-5 f0-5 #f) ) ) ) (('attack 'attack-or-shove 'attack-invinc) - (let ((v1-27 (the-as attack-info (-> arg3 param 1)))) + (let ((v1-27 (the-as attack-info (-> event param 1)))) (if (not (and (logtest? (-> v1-27 mask) (attack-mask mode)) (or (= (-> v1-27 mode) 'burn) (= (-> v1-27 mode) 'burnup))) ) (target-attacked - arg2 - (the-as attack-info (-> arg3 param 1)) - arg0 - (the-as touching-shapes-entry (-> arg3 param 0)) + event-type + (the-as attack-info (-> event param 1)) + proc + (the-as touching-shapes-entry (-> event param 0)) (the-as (state symbol attack-info target) target-racing-hit) ) ) ) ) (('heat) - (let ((f0-7 (fmax 0.0 (fmin (+ (-> self racer heat) (the-as float (-> arg3 param 0))) (-> *RACER-bank* heat-max)))) + (set! (-> self racer heat) + (fmax 0.0 (fmin (+ (-> self racer heat) (the-as float (-> event param 0))) (-> *RACER-bank* heat-max))) ) - (set! (-> self racer heat) f0-7) - f0-7 - ) ) (('boost) (sound-play "get-blue-eco") (set! (-> self racer boost-sound-id) (sound-play "zoom-boost")) (set! (-> self racer boost-time) (-> *display* base-frame-counter)) - (let ((f0-12 (seek - (-> self racer boost-level) - (-> *RACER-bank* boost-level-max) - (* (-> *RACER-bank* boost-level-inc) (the-as float (-> arg3 param 0))) - ) - ) + (set! (-> self racer boost-level) (seek + (-> self racer boost-level) + (-> *RACER-bank* boost-level-max) + (* (-> *RACER-bank* boost-level-inc) (the-as float (-> event param 0))) + ) ) - (set! (-> self racer boost-level) f0-12) - f0-12 - ) ) (('smack) (go target-racing-smack (-> self control unknown-float01) #t) ) (('jump) - (go target-racing-jump (the-as float (-> arg3 param 0)) (the-as float (-> arg3 param 1)) #f) + (go target-racing-jump (the-as float (-> event param 0)) (the-as float (-> event param 1)) #f) ) (('change-mode) - (case (-> arg3 param 0) + (case (-> event param 0) (('grab) (go target-racing-grab) ) ) ) (('clone-anim) - (go target-racing-clone-anim (process->handle (the-as process (-> arg3 param 0)))) + (go target-racing-clone-anim (process->handle (the-as process (-> event param 0)))) ) (else - (target-generic-event-handler arg0 arg1 arg2 arg3) + (target-generic-event-handler proc arg1 event-type event) ) ) ) @@ -264,10 +258,7 @@ (let ((a0-11 (-> (the-as target v1-0) draw color-emissive quad))) (set! (-> self draw color-emissive quad) a0-11) ) - (let ((f0-0 (-> (the-as target v1-0) draw secondary-interp))) - (set! (-> self draw secondary-interp) f0-0) - f0-0 - ) + (set! (-> self draw secondary-interp) (-> (the-as target v1-0) draw secondary-interp)) ) ) ) @@ -367,7 +358,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) ) @@ -558,8 +549,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 ) @@ -1073,7 +1063,7 @@ (until v1-154 (suspend) (set! v1-154 (and (>= (- (-> *display* base-frame-counter) (-> self state-time)) (seconds 1)) - (zero? (logand (-> *kernel-context* prevent-from-run) (process-mask movie))) + (not (logtest? (-> *kernel-context* prevent-from-run) (process-mask movie))) ) ) ) @@ -1423,21 +1413,21 @@ ) (defstate target-racing-grab (target) - :event (behavior ((arg0 process) (arg1 int) (arg2 symbol) (arg3 event-message-block)) + :event (behavior ((proc process) (arg1 int) (event-type symbol) (event event-message-block)) (cond - ((and (= arg2 'query) (= (-> arg3 param 0) 'mode)) + ((and (= event-type 'query) (= (-> event param 0) 'mode)) (-> self state name) ) (else - (case arg2 + (case event-type (('end-mode) (go target-racing) ) (('clone-anim) - (go target-racing-clone-anim (process->handle (the-as process (-> arg3 param 0)))) + (go target-racing-clone-anim (process->handle (the-as process (-> event param 0)))) ) (else - (target-generic-event-handler arg0 arg1 arg2 arg3) + (target-generic-event-handler proc arg1 event-type event) ) ) ) @@ -1476,11 +1466,11 @@ ) (defstate target-racing-clone-anim (target) - :event (behavior ((arg0 process) (arg1 int) (arg2 symbol) (arg3 event-message-block)) - (if (and (= arg2 'trans) (= (-> arg3 param 0) 'restore)) + :event (behavior ((proc process) (arg1 int) (event-type symbol) (event event-message-block)) + (if (and (= event-type 'trans) (= (-> event param 0) 'restore)) (set! (-> self control unknown-uint20) (the-as uint #f)) ) - ((-> target-racing-grab event) arg0 arg1 arg2 arg3) + ((-> target-racing-grab event) proc arg1 event-type event) ) :enter (-> target-clone-anim enter) :exit (behavior () @@ -1510,7 +1500,3 @@ (none) ) ) - - - - diff --git a/goal_src/jak1/levels/racer_common/racer.gc b/goal_src/jak1/levels/racer_common/racer.gc index 3ccc713c3d..1d8ba3071c 100644 --- a/goal_src/jak1/levels/racer_common/racer.gc +++ b/goal_src/jak1/levels/racer_common/racer.gc @@ -83,34 +83,32 @@ (defstate wait-for-start (racer) :virtual #t - :event (behavior ((arg0 process) (arg1 int) (arg2 symbol) (arg3 event-message-block)) + :event (behavior ((proc process) (arg1 int) (event-type symbol) (event event-message-block)) (local-vars (v0-1 structure)) - (let ((v1-0 arg2)) - (the-as - object - (cond - ((= v1-0 'trans) - (vector+! (the-as vector (-> arg3 param 0)) (-> self root-override trans) (-> self extra-trans)) - ) - ((= v1-0 'notify) - (set! v0-1 #t) - (set! (-> self auto-get-off) (the-as symbol v0-1)) - v0-1 - ) - ((= v1-0 'shadow) - (cond - ((-> arg3 param 0) - (set! v0-1 (-> self shadow-backup)) - (set! (-> self draw shadow) (the-as shadow-geo v0-1)) - v0-1 - ) - (else - (set! (-> self draw shadow) #f) - #f - ) + (the-as + object + (case event-type + (('trans) + (vector+! (the-as vector (-> event param 0)) (-> self root-override trans) (-> self extra-trans)) + ) + (('notify) + (set! v0-1 #t) + (set! (-> self auto-get-off) (the-as symbol v0-1)) + v0-1 + ) + (('shadow) + (cond + ((-> event param 0) + (set! v0-1 (-> self shadow-backup)) + (set! (-> self draw shadow) (the-as shadow-geo v0-1)) + v0-1 + ) + (else + (set! (-> self draw shadow) #f) + #f ) ) - ) + ) ) ) ) @@ -188,7 +186,7 @@ ) ) ((4) - (if (and *target* (zero? (logand (-> *target* control root-prim prim-core action) (collide-action ca-9)))) + (if (and *target* (not (logtest? (-> *target* control root-prim prim-core action) (collide-action ca-9)))) (goto cfg-77) ) ) @@ -269,8 +267,8 @@ (defstate pickup (racer) :virtual #t - :event (behavior ((arg0 process) (arg1 int) (arg2 symbol) (arg3 event-message-block)) - (case arg2 + :event (behavior ((proc process) (arg1 int) (event-type symbol) (event event-message-block)) + (case event-type (('draw) (ja-channel-set! 1) (ja :group! (-> self draw art-group data 3)) @@ -279,14 +277,14 @@ (transform-post) ) (('trans) - (vector+! (the-as vector (-> arg3 param 0)) (-> self root-override trans) (-> self extra-trans)) + (vector+! (the-as vector (-> event param 0)) (-> self root-override trans) (-> self extra-trans)) ) (('touch 'attack) #f ) (('shadow) (cond - ((-> arg3 param 0) + ((-> event param 0) (let ((v0-1 (the-as object (-> self shadow-backup)))) (set! (-> self draw shadow) (the-as shadow-geo v0-1)) v0-1 @@ -315,13 +313,7 @@ (case (-> (level-get-target-inside *level*) name) (('misty) (close-specific-task! (game-task misty-bike) (task-status need-reminder-a)) - (level-hint-spawn - (game-text-id misty-bike-hint) - "sksp0062" - (the-as entity #f) - *entity-pool* - (game-task none) - ) + (level-hint-spawn (game-text-id misty-bike-hint) "sksp0062" (the-as entity #f) *entity-pool* (game-task none)) ) ) ) @@ -347,19 +339,21 @@ (defstate wait-for-return (racer) :virtual #t - :event (behavior ((arg0 process) (arg1 int) (arg2 symbol) (arg3 event-message-block)) - (if (and (or (= arg2 'touch) (= arg2 'attack)) (and (!= (-> self condition) 4) (send-event *target* 'end-mode))) + :event (behavior ((proc process) (arg1 int) (event-type symbol) (event event-message-block)) + (if (and (or (= event-type 'touch) (= event-type 'attack)) + (and (!= (-> self condition) 4) (send-event *target* 'end-mode)) + ) (go-virtual pickup (the-as (state collectable) (method-of-object self idle))) ) (the-as object (cond - ((= arg2 'trans) - (vector+! (the-as vector (-> arg3 param 0)) (-> self root-override trans) (-> self extra-trans)) + ((= event-type 'trans) + (vector+! (the-as vector (-> event param 0)) (-> self root-override trans) (-> self extra-trans)) ) - ((= arg2 'shadow) + ((= event-type 'shadow) (cond - ((-> arg3 param 0) + ((-> event param 0) (let ((v0-3 (the-as structure (-> self shadow-backup)))) (set! (-> self draw shadow) (the-as shadow-geo v0-3)) v0-3 @@ -455,7 +449,3 @@ (go (method-of-object obj wait-for-start)) (none) ) - - - - diff --git a/goal_src/jak1/levels/racer_common/target-racer.gc b/goal_src/jak1/levels/racer_common/target-racer.gc index ec6378f927..2c2cbb206e 100644 --- a/goal_src/jak1/levels/racer_common/target-racer.gc +++ b/goal_src/jak1/levels/racer_common/target-racer.gc @@ -128,14 +128,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) ) ) @@ -531,7 +529,7 @@ ) (let ((f0-2 (if (or (and (logtest? (-> self control status) (cshape-moving-flags twall)) - (zero? (logand (-> self control status) (cshape-moving-flags onsurf))) + (not (logtest? (-> self control status) (cshape-moving-flags onsurf))) ) (logtest? (-> self state-flags) (state-flags dying)) ) @@ -773,7 +771,7 @@ ) (cpad-pressed? (-> self control unknown-cpad-info00 number) circle square) (>= (- (-> *display* base-frame-counter) (-> self control unknown-dword82)) (seconds 0.25)) - (zero? (logand (-> self state-flags) (state-flags being-attacked dying))) + (not (logtest? (-> self state-flags) (state-flags being-attacked dying))) ) (let ((gp-6 (vector-z-quaternion! (new 'stack-no-clear 'vector) (-> self control quat))) (s5-4 (vector<-cspace! (new 'stack-no-clear 'vector) (-> self manipy 0 node-list data 4))) @@ -855,8 +853,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) ) @@ -1455,7 +1452,3 @@ 0 (none) ) - - - - diff --git a/goal_src/jak1/levels/snow/snow-bunny.gc b/goal_src/jak1/levels/snow/snow-bunny.gc index 91562d1a21..9e14b19841 100644 --- a/goal_src/jak1/levels/snow/snow-bunny.gc +++ b/goal_src/jak1/levels/snow/snow-bunny.gc @@ -238,7 +238,7 @@ ) (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) @@ -285,7 +285,7 @@ ) (defmethod dummy-57 snow-bunny ((obj snow-bunny)) - (if (or (not *target*) (zero? (logand (-> *target* state-flags) (state-flags dangerous)))) + (if (or (not *target*) (not (logtest? (-> *target* state-flags) (state-flags dangerous)))) (return #f) ) (let ((f0-0 (vector-vector-xz-distance (target-pos 0) (-> obj collide-info trans)))) @@ -855,73 +855,7 @@ (set! (-> s5-0 found-best) #f) (let ((s4-0 (-> obj nav))) (TODO-RENAME-27 s4-0) - (TODO-RENAME-28 s4-0 (collide-kind - background - cak-1 - cak-2 - cak-3 - target - water - powerup - crate - enemy - wall-object - projectile - ground-object - target-attack - mother-spider - cak-14 - blue-eco-suck - unknown-16 - unknown-17 - unknown-18 - unknown-19 - unknown-20 - unknown-21 - unknown-22 - unknown-23 - unknown-24 - unknown-25 - unknown-26 - unknown-27 - unknown-28 - unknown-29 - unknown-30 - unknown-31 - unknown-32 - unknown-33 - unknown-34 - unknown-35 - unknown-36 - unknown-37 - unknown-38 - unknown-39 - unknown-40 - unknown-41 - unknown-42 - unknown-43 - unknown-44 - unknown-45 - unknown-46 - unknown-47 - unknown-48 - unknown-49 - unknown-50 - unknown-51 - unknown-52 - unknown-53 - unknown-54 - unknown-55 - unknown-56 - unknown-57 - unknown-58 - unknown-59 - unknown-60 - unknown-61 - unknown-62 - unknown-63 - ) - ) + (TODO-RENAME-28 s4-0 (the-as collide-kind -1)) ) (let ((s4-1 (target-pos 0))) (vector-! (-> s5-0 away-vec) (-> obj collide-info trans) s4-1) @@ -1177,7 +1111,3 @@ ) :post (the-as (function none :behavior snow-bunny) nav-enemy-simple-post) ) - - - - diff --git a/goal_src/jak1/levels/snow/snow-flutflut-obs.gc b/goal_src/jak1/levels/snow/snow-flutflut-obs.gc index 3c15dbe4f7..30049b65db 100644 --- a/goal_src/jak1/levels/snow/snow-flutflut-obs.gc +++ b/goal_src/jak1/levels/snow/snow-flutflut-obs.gc @@ -229,11 +229,11 @@ ) (defstate snow-button-up-idle (snow-button) - :event (behavior ((arg0 process) (arg1 int) (arg2 symbol) (arg3 event-message-block)) + :event (behavior ((proc process) (arg1 int) (event-type symbol) (event event-message-block)) (local-vars (v0-2 object)) - (case arg2 + (case event-type (('touch 'attack 'bonk) - (when (and (= (-> arg0 type) target) + (when (and (= (-> proc type) target) (logtest? (-> *target* control root-prim prim-core action) (collide-action ca-14)) (>= 10649.6 (vector-vector-xz-distance (-> self root-override trans) (target-pos 0))) ) @@ -260,9 +260,9 @@ ) (defstate snow-button-activate (snow-button) - :event (behavior ((arg0 process) (arg1 int) (arg2 symbol) (arg3 event-message-block)) + :event (behavior ((proc process) (arg1 int) (event-type symbol) (event event-message-block)) (local-vars (v0-0 object)) - (case arg2 + (case event-type (('untrigger) (go snow-button-deactivate) ) @@ -327,9 +327,9 @@ ) (defstate snow-button-deactivate (snow-button) - :event (behavior ((arg0 process) (arg1 int) (arg2 symbol) (arg3 event-message-block)) + :event (behavior ((proc process) (arg1 int) (event-type symbol) (event event-message-block)) (local-vars (v0-0 symbol)) - (case arg2 + (case event-type (('query) (return (the-as object #f)) v0-0 @@ -446,7 +446,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 @@ -491,8 +491,8 @@ (defstate plat-startup (flutflut-plat) :virtual #t - :event (behavior ((arg0 process) (arg1 int) (arg2 symbol) (arg3 event-message-block)) - (case arg2 + :event (behavior ((proc process) (arg1 int) (event-type symbol) (event event-message-block)) + (case event-type (('trigger) (when (or (!= (-> self plat-type) 1) (not (and (-> self entity) (logtest? (-> self entity extra perm status) (entity-perm-status complete)))) @@ -538,8 +538,8 @@ ) (defstate flutflut-plat-hidden-idle (flutflut-plat) - :event (behavior ((arg0 process) (arg1 int) (arg2 symbol) (arg3 event-message-block)) - (case arg2 + :event (behavior ((proc process) (arg1 int) (event-type symbol) (event event-message-block)) + (case event-type (('trigger) (logclear! (-> self mask) (process-mask actor-pause)) (go flutflut-plat-appear) @@ -565,13 +565,13 @@ ) (defstate flutflut-plat-appear (flutflut-plat) - :event (behavior ((arg0 process) (arg1 int) (arg2 symbol) (arg3 event-message-block)) - (let ((v1-0 arg2)) - (the-as object (if (or (= v1-0 'bonk) (= v1-0 'bounce)) - (dummy-22 self) - ) - ) - ) + :event (behavior ((proc process) (arg1 int) (event-type symbol) (event event-message-block)) + (the-as object (case event-type + (('bonk 'bounce) + (dummy-22 self) + ) + ) + ) ) :enter (behavior () (set! (-> self state-time) (-> *display* base-frame-counter)) @@ -641,18 +641,16 @@ (defstate plat-idle (flutflut-plat) :virtual #t - :event (behavior ((arg0 process) (arg1 int) (arg2 symbol) (arg3 event-message-block)) - (let ((v1-0 arg2)) - (the-as object (cond - ((or (= v1-0 'bonk) (= v1-0 'bounce)) - (dummy-22 self) - ) - ((= v1-0 'untrigger) - (go flutflut-plat-hide) - ) - ) - ) - ) + :event (behavior ((proc process) (arg1 int) (event-type symbol) (event event-message-block)) + (the-as object (case event-type + (('bonk 'bounce) + (dummy-22 self) + ) + (('untrigger) + (go flutflut-plat-hide) + ) + ) + ) ) :enter (behavior () (let ((t9-0 (-> (method-of-type plat plat-idle) enter))) @@ -687,18 +685,16 @@ (defstate plat-path-active (flutflut-plat) :virtual #t - :event (behavior ((arg0 process) (arg1 int) (arg2 symbol) (arg3 event-message-block)) - (let ((v1-0 arg2)) - (the-as object (cond - ((or (= v1-0 'bonk) (= v1-0 'bounce)) - (dummy-22 self) - ) - ((= v1-0 'untrigger) - (go flutflut-plat-hide) - ) - ) - ) - ) + :event (behavior ((proc process) (arg1 int) (event-type symbol) (event event-message-block)) + (the-as object (case event-type + (('bonk 'bounce) + (dummy-22 self) + ) + (('untrigger) + (go flutflut-plat-hide) + ) + ) + ) ) :enter (behavior ((arg0 plat)) (let ((t9-0 (-> (method-of-type plat plat-path-active) enter))) @@ -725,13 +721,13 @@ ) (defstate flutflut-plat-hide (flutflut-plat) - :event (behavior ((arg0 process) (arg1 int) (arg2 symbol) (arg3 event-message-block)) - (let ((v1-0 arg2)) - (the-as object (if (= v1-0 'bonk) - (dummy-22 self) - ) - ) - ) + :event (behavior ((proc process) (arg1 int) (event-type symbol) (event event-message-block)) + (the-as object (case event-type + (('bonk) + (dummy-22 self) + ) + ) + ) ) :enter (behavior () (set! (-> self state-time) (-> *display* base-frame-counter)) @@ -783,25 +779,23 @@ ) (defstate elevator-idle-at-cave (flutflut-plat) - :event (behavior ((arg0 process) (arg1 int) (arg2 symbol) (arg3 event-message-block)) - (let ((v1-0 arg2)) - (the-as - object - (cond - ((= v1-0 'bonk) - (dummy-22 self) - ) - ((= v1-0 'bounce) - (if (not (and (-> self entity) (logtest? (-> self entity extra perm status) (entity-perm-status complete)))) - (dummy-22 self) - ) - ) - ((= v1-0 'ridden) - (if (or (not *target*) (zero? (logand (-> *target* control root-prim prim-core action) (collide-action ca-14)))) - (go elevator-travel-to-fort) - ) - ) - ) + :event (behavior ((proc process) (arg1 int) (event-type symbol) (event event-message-block)) + (the-as + object + (case event-type + (('bonk) + (dummy-22 self) + ) + (('bounce) + (if (not (and (-> self entity) (logtest? (-> self entity extra perm status) (entity-perm-status complete)))) + (dummy-22 self) + ) + ) + (('ridden) + (if (or (not *target*) (not (logtest? (-> *target* control root-prim prim-core action) (collide-action ca-14)))) + (go elevator-travel-to-fort) + ) + ) ) ) ) @@ -820,13 +814,13 @@ ) (defstate elevator-travel-to-fort (flutflut-plat) - :event (behavior ((arg0 process) (arg1 int) (arg2 symbol) (arg3 event-message-block)) - (let ((v1-0 arg2)) - (the-as object (if (or (= v1-0 'bonk) (= v1-0 'bounce)) - (dummy-22 self) - ) - ) - ) + :event (behavior ((proc process) (arg1 int) (event-type symbol) (event event-message-block)) + (the-as object (case event-type + (('bonk 'bounce) + (dummy-22 self) + ) + ) + ) ) :trans (behavior () (when (= (-> self path-pos) 1.0) @@ -845,13 +839,13 @@ ) (defstate elevator-idle-at-fort (flutflut-plat) - :event (behavior ((arg0 process) (arg1 int) (arg2 symbol) (arg3 event-message-block)) - (let ((v1-0 arg2)) - (the-as object (if (or (= v1-0 'bonk) (= v1-0 'bounce)) - (dummy-22 self) - ) - ) - ) + :event (behavior ((proc process) (arg1 int) (event-type symbol) (event event-message-block)) + (the-as object (case event-type + (('bonk 'bounce) + (dummy-22 self) + ) + ) + ) ) :enter (behavior () (set! (-> self path-pos) 1.0) @@ -862,7 +856,7 @@ (when *target* (if (and (>= 798720.0 (-> (target-pos 0) y)) (not (and (logtest? (-> *target* control unknown-surface00 flags) (surface-flags jump)) - (zero? (logand (-> *target* control status) (cshape-moving-flags onsurf))) + (not (logtest? (-> *target* control status) (cshape-moving-flags onsurf))) ) ) ) @@ -878,13 +872,13 @@ ) (defstate elevator-travel-to-cave (flutflut-plat) - :event (behavior ((arg0 process) (arg1 int) (arg2 symbol) (arg3 event-message-block)) - (let ((v1-0 arg2)) - (the-as object (if (or (= v1-0 'bonk) (= v1-0 'bounce)) - (dummy-22 self) - ) - ) - ) + :event (behavior ((proc process) (arg1 int) (event-type symbol) (event event-message-block)) + (the-as object (case event-type + (('bonk 'bounce) + (dummy-22 self) + ) + ) + ) ) :trans (behavior () (when (= (-> self path-pos) 0.0) @@ -1070,7 +1064,3 @@ 0 (none) ) - - - - diff --git a/goal_src/jak1/levels/snow/snow-obs.gc b/goal_src/jak1/levels/snow/snow-obs.gc index 1a15d78857..f02a9924e3 100644 --- a/goal_src/jak1/levels/snow/snow-obs.gc +++ b/goal_src/jak1/levels/snow/snow-obs.gc @@ -152,7 +152,7 @@ (defpartgroup group-snow-yellow-eco-room-activate :id 511 - :duration 900 + :duration (seconds 3) :bounds (static-bspherem 0 -6 0 8) :parts ((sp-item 1994) (sp-item 1994) (sp-item 1995 :flags (bit1) :period 1200 :length 15)) ) @@ -289,19 +289,19 @@ ) (defstate snow-eggtop-idle-up (snow-eggtop) - :event (behavior ((arg0 process) (arg1 int) (arg2 symbol) (arg3 event-message-block)) - (let ((v1-0 arg2)) - (the-as object (when (= v1-0 'notify) - (case (-> arg3 param 0) - (('pickup) - (if (type-type? (-> arg0 type) fuel-cell) - (save-reminder (get-task-control (-> self entity extra perm task)) 1 4) - ) - ) + :event (behavior ((proc process) (arg1 int) (event-type symbol) (event event-message-block)) + (the-as object (case event-type + (('notify) + (case (-> event param 0) + (('pickup) + (if (type-type? (-> proc type) fuel-cell) + (save-reminder (get-task-control (-> self entity extra perm task)) 1 4) + ) ) - ) - ) - ) + ) + ) + ) + ) ) :trans (behavior () (if (and (not (-> self child)) (task-complete? *game-info* (-> self entity extra perm task))) @@ -324,18 +324,18 @@ ) (defstate snow-eggtop-activate (snow-eggtop) - :event (behavior ((arg0 process) (arg1 int) (arg2 symbol) (arg3 event-message-block)) - (case arg2 + :event (behavior ((proc process) (arg1 int) (event-type symbol) (event event-message-block)) + (case event-type (('notify) - (when (= (-> arg0 type) snowcam) + (when (= (-> proc type) snowcam) (cond - ((= (-> arg3 param 0) 'die) + ((= (-> event param 0) 'die) (if *target* (set! (-> *target* control trans y) (+ 1024.0 (-> *target* control trans y))) ) (go snow-eggtop-idle-down) ) - ((= (-> arg3 param 0) 'cut) + ((= (-> event param 0) 'cut) (stop! (-> self sound)) (set! (-> self play-sound?) #f) #f @@ -523,14 +523,14 @@ ) (defstate snowpusher-idle (snowpusher) - :event (behavior ((arg0 process) (arg1 int) (arg2 symbol) (arg3 event-message-block)) - (let ((v1-0 arg2)) - (the-as object (when (= v1-0 'touch) - (send-event arg0 'no-look-around (seconds 1.5)) - #f - ) - ) - ) + :event (behavior ((proc process) (arg1 int) (event-type symbol) (event event-message-block)) + (the-as object (case event-type + (('touch) + (send-event proc 'no-look-around (seconds 1.5)) + #f + ) + ) + ) ) :code (behavior () (let ((gp-0 #f)) @@ -645,14 +645,14 @@ ) (defstate snow-spatula-idle (snow-spatula) - :event (behavior ((arg0 process) (arg1 int) (arg2 symbol) (arg3 event-message-block)) - (let ((v1-0 arg2)) - (the-as object (when (= v1-0 'bonk) - (dummy-22 self) - (sound-play "snow-spat-short" :vol 75 :pitch 0.75) - ) - ) - ) + :event (behavior ((proc process) (arg1 int) (event-type symbol) (event event-message-block)) + (the-as object (case event-type + (('bonk) + (dummy-22 self) + (sound-play "snow-spat-short" :vol 75 :pitch 0.75) + ) + ) + ) ) :trans (the-as (function none :behavior snow-spatula) plat-trans) :code (behavior () @@ -917,8 +917,8 @@ ) (defstate snow-fort-gate-idle-closed (snow-fort-gate) - :event (behavior ((arg0 process) (arg1 int) (arg2 symbol) (arg3 event-message-block)) - (case arg2 + :event (behavior ((proc process) (arg1 int) (event-type symbol) (event event-message-block)) + (case event-type (('notice) (go snow-fort-gate-activate) ) @@ -926,13 +926,7 @@ ) :trans (behavior () (when (and *target* (>= 61440.0 (vector-vector-distance (-> self root-override trans) (-> *target* control trans)))) - (level-hint-spawn - (game-text-id snow-fort-hint) - "sksp0345" - (the-as entity #f) - *entity-pool* - (game-task none) - ) + (level-hint-spawn (game-text-id snow-fort-hint) "sksp0345" (the-as entity #f) *entity-pool* (game-task none)) (close-specific-task! (game-task snow-fort) (task-status need-hint)) ) (none) @@ -1196,8 +1190,8 @@ ) (defstate snow-gears-idle (snow-gears) - :event (behavior ((arg0 process) (arg1 int) (arg2 symbol) (arg3 event-message-block)) - (case arg2 + :event (behavior ((proc process) (arg1 int) (event-type symbol) (event event-message-block)) + (case event-type (('notice) (logclear! (-> self mask) (process-mask actor-pause)) (process-entity-status! self (entity-perm-status bit-3) #t) @@ -1372,7 +1366,7 @@ (local-vars (v1-1 symbol)) (until v1-1 (suspend) - (set! v1-1 (or (not *target*) (zero? (logand (-> *target* state-flags) (state-flags grabbed))))) + (set! v1-1 (or (not *target*) (not (logtest? (-> *target* state-flags) (state-flags grabbed))))) ) (sound-play "prec-button1" :pitch -1) (let ((gp-1 (get-process *default-dead-pool* snowcam #x4000))) @@ -1532,8 +1526,8 @@ ) (defstate snow-log-wait-for-master (snow-log) - :event (behavior ((arg0 process) (arg1 int) (arg2 symbol) (arg3 event-message-block)) - (case arg2 + :event (behavior ((proc process) (arg1 int) (event-type symbol) (event event-message-block)) + (case event-type (('trigger) (go snow-log-activate) ) @@ -1575,8 +1569,8 @@ ) (defstate snow-log-hidden (snow-log) - :event (behavior ((arg0 process) (arg1 int) (arg2 symbol) (arg3 event-message-block)) - (case arg2 + :event (behavior ((proc process) (arg1 int) (event-type symbol) (event event-message-block)) + (case event-type (('trigger) (logclear! (-> self mask) (process-mask actor-pause)) (process-entity-status! self (entity-perm-status bit-3) #t) @@ -1860,7 +1854,3 @@ ) (none) ) - - - - diff --git a/goal_src/jak1/levels/snow/snow-ram-boss.gc b/goal_src/jak1/levels/snow/snow-ram-boss.gc index be73841bc5..60800f3a4b 100644 --- a/goal_src/jak1/levels/snow/snow-ram-boss.gc +++ b/goal_src/jak1/levels/snow/snow-ram-boss.gc @@ -255,7 +255,7 @@ (defpartgroup group-ram-boss-proj-fly :id 522 - :duration 300 + :duration (seconds 1) :bounds (static-bspherem 0 0 0 3) :parts ((sp-item 1910 :flags (launch-asap) :binding 1908) (sp-item 1908 :flags (start-dead) :binding 1909) @@ -379,7 +379,7 @@ (defpartgroup group-ram-boss-proj-hit :id 523 - :duration 5 + :duration (seconds 0.017) :flags (use-local-clock) :bounds (static-bspherem 0 0 0 8) :parts ((sp-item 1914) (sp-item 1915) (sp-item 1916)) @@ -452,7 +452,7 @@ (defpartgroup group-ram-boss-proj-die :id 524 - :duration 5 + :duration (seconds 0.017) :flags (use-local-clock) :bounds (static-bspherem 0 0 0 8) :parts ((sp-item 1914)) @@ -605,10 +605,10 @@ (defmethod dummy-28 ram-boss-proj ((obj ram-boss-proj)) (when (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) ) - ) + ) ) (let ((gp-0 (-> obj target))) (set! (-> gp-0 quad) (-> (target-pos 0) quad)) @@ -631,8 +631,8 @@ ) (defstate ram-boss-proj-growing (ram-boss-proj) - :event (behavior ((arg0 process) (arg1 int) (arg2 symbol) (arg3 event-message-block)) - (case arg2 + :event (behavior ((proc process) (arg1 int) (event-type symbol) (event event-message-block)) + (case event-type (('launch) (let ((v1-1 (-> self parent-override))) (set! (-> v1-1 0 proj-stoked) #f) @@ -781,8 +781,8 @@ (defpartgroup group-ram-boss-foot-puff :id 574 - :duration 5 - :linger-duration 450 + :duration (seconds 0.017) + :linger-duration (seconds 1.5) :bounds (static-bspherem 0 0 0 2) :parts ((sp-item 2367) (sp-item 2368) (sp-item 2369)) ) @@ -874,7 +874,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 @@ -909,7 +909,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 @@ -1256,13 +1256,13 @@ ) (defstate ram-boss-idle (ram-boss) - :event (behavior ((arg0 process) (arg1 int) (arg2 symbol) (arg3 event-message-block)) - (case arg2 + :event (behavior ((proc process) (arg1 int) (event-type symbol) (event event-message-block)) + (case event-type (('jump) - (go ram-boss-jump-down arg0) + (go ram-boss-jump-down proc) ) (('touch 'attack) - (nav-enemy-send-attack arg0 (the-as touching-shapes-entry (-> arg3 param 0)) 'generic) + (nav-enemy-send-attack proc (the-as touching-shapes-entry (-> event param 0)) 'generic) ) ) ) @@ -1302,10 +1302,10 @@ ) (defstate ram-boss-jump-down (ram-boss) - :event (behavior ((arg0 process) (arg1 int) (arg2 symbol) (arg3 event-message-block)) - (case arg2 + :event (behavior ((proc process) (arg1 int) (event-type symbol) (event event-message-block)) + (case event-type (('touch 'attack) - (nav-enemy-send-attack arg0 (the-as touching-shapes-entry (-> arg3 param 0)) 'generic) + (nav-enemy-send-attack proc (the-as touching-shapes-entry (-> event param 0)) 'generic) ) ) ) @@ -1613,10 +1613,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)) @@ -1905,7 +1905,3 @@ (none) ) ) - - - - diff --git a/goal_src/jak1/levels/sunken/helix-water.gc b/goal_src/jak1/levels/sunken/helix-water.gc index 2759d4e1fa..e5c033e432 100644 --- a/goal_src/jak1/levels/sunken/helix-water.gc +++ b/goal_src/jak1/levels/sunken/helix-water.gc @@ -98,8 +98,8 @@ (defstate water-vol-idle (helix-dark-eco) :virtual #t - :event (behavior ((arg0 process) (arg1 int) (arg2 symbol) (arg3 event-message-block)) - (case arg2 + :event (behavior ((proc process) (arg1 int) (event-type symbol) (event event-message-block)) + (case event-type (('trigger) (let ((a0-1 (-> self sound))) (set! (-> a0-1 spec pitch-mod) 2057) @@ -107,7 +107,7 @@ ) ) (else - ((-> (method-of-type water-anim water-vol-idle) event) arg0 arg1 arg2 arg3) + ((-> (method-of-type water-anim water-vol-idle) event) proc arg1 event-type event) ) ) ) @@ -144,8 +144,8 @@ ) (defstate helix-slide-door-idle-open (helix-slide-door) - :event (behavior ((arg0 process) (arg1 int) (arg2 symbol) (arg3 event-message-block)) - (case arg2 + :event (behavior ((proc process) (arg1 int) (event-type symbol) (event event-message-block)) + (case event-type (('trigger) (go helix-slide-door-close) ) @@ -246,8 +246,8 @@ ) (defstate helix-button-idle-up (helix-button) - :event (behavior ((arg0 process) (arg1 int) (arg2 symbol) (arg3 event-message-block)) - (case arg2 + :event (behavior ((proc process) (arg1 int) (event-type symbol) (event event-message-block)) + (case event-type (('touch) (when *target* (when (logtest? (-> *target* control status) (cshape-moving-flags onsurf)) @@ -285,7 +285,7 @@ (send-event a0-1 'pickup) (until v1-7 (suspend) - (set! v1-7 (or (not *target*) (zero? (logand (-> *target* state-flags) (state-flags grabbed))))) + (set! v1-7 (or (not *target*) (not (logtest? (-> *target* state-flags) (state-flags grabbed))))) ) ) ) @@ -611,18 +611,16 @@ ) (defstate helix-water-idle (helix-water) - :event (behavior ((arg0 process) (arg1 int) (arg2 symbol) (arg3 event-message-block)) - (let ((v1-0 arg2)) - (the-as object (cond - ((= v1-0 'trigger) - (go helix-water-activated) - ) - ((= v1-0 'music) - (set-setting! 'music 'danger 0.0 0) - ) - ) - ) - ) + :event (behavior ((proc process) (arg1 int) (event-type symbol) (event event-message-block)) + (the-as object (case event-type + (('trigger) + (go helix-water-activated) + ) + (('music) + (set-setting! 'music 'danger 0.0 0) + ) + ) + ) ) :code (behavior () (set! (-> self root trans y) (-> self start-y)) @@ -640,10 +638,10 @@ ) (defstate helix-water-activated (helix-water) - :event (behavior ((arg0 process) (arg1 int) (arg2 symbol) (arg3 event-message-block)) - (case arg2 + :event (behavior ((proc process) (arg1 int) (event-type symbol) (event event-message-block)) + (case event-type (('notify) - (when (= (-> arg0 type) launcherdoor) + (when (= (-> proc type) launcherdoor) (remove-setting! 'music) (go helix-water-idle) ) @@ -654,7 +652,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)) @@ -710,7 +708,7 @@ (set! (-> obj end-y) (+ 851968.0 (-> obj start-y))) (set-vector! (-> obj root scale) 1.0 0.8 1.0 1.0) (let ((s4-0 (entity-actor-count arg0 'alt-actor))) - (set! (-> obj alt-actors) (the-as (array entity-actor) (new 'process 'boxed-array entity-actor s4-0))) + (set! (-> obj alt-actors) (new 'process 'boxed-array entity-actor s4-0)) (dotimes (s3-0 s4-0) (set! (-> obj alt-actors s3-0) (entity-actor-lookup arg0 'alt-actor s3-0)) ) @@ -721,7 +719,3 @@ (go helix-water-idle) (none) ) - - - - diff --git a/goal_src/jak1/levels/sunken/sunken-pipegame.gc b/goal_src/jak1/levels/sunken/sunken-pipegame.gc index 07852b24bf..6e9b24a7ff 100644 --- a/goal_src/jak1/levels/sunken/sunken-pipegame.gc +++ b/goal_src/jak1/levels/sunken/sunken-pipegame.gc @@ -514,11 +514,11 @@ ) (defstate sunken-pipegame-idle (sunken-pipegame) - :event (behavior ((arg0 process) (arg1 int) (arg2 symbol) (arg3 event-message-block)) - (case arg2 + :event (behavior ((proc process) (arg1 int) (event-type symbol) (event event-message-block)) + (case event-type (('trigger) - (when (= (-> arg0 type) sunken-pipegame-button) - (set! (-> self challenge) (-> (the-as sunken-pipegame-button arg0) button-id)) + (when (= (-> proc type) sunken-pipegame-button) + (set! (-> self challenge) (-> (the-as sunken-pipegame-button proc) button-id)) (go sunken-pipegame-begin-play) ) ) @@ -533,10 +533,10 @@ ) (defstate sunken-pipegame-begin-play (sunken-pipegame) - :event (behavior ((arg0 process) (arg1 int) (arg2 symbol) (arg3 event-message-block)) - (case arg2 + :event (behavior ((proc process) (arg1 int) (event-type symbol) (event event-message-block)) + (case event-type (('notify) - (case (-> arg0 type) + (case (-> proc type) ((fuel-cell buzzer) (go sunken-pipegame-beat-challenge) ) @@ -549,7 +549,7 @@ (set! (-> self abort-audio-if-beaten?) #f) (dotimes (gp-0 3) (let ((v1-4 (-> self button gp-0))) - (if (and (!= gp-0 (-> self challenge)) (zero? (logand (ash 1 gp-0) (-> self challenges-mask)))) + (if (and (!= gp-0 (-> self challenge)) (not (logtest? (ash 1 gp-0) (-> self challenges-mask)))) (send-event (ppointer->process v1-4) 'trigger) ) ) @@ -679,7 +679,7 @@ ) (until v1-112 (suspend) - (set! v1-112 (or (not *target*) (zero? (logand (-> *target* state-flags) (state-flags grabbed))))) + (set! v1-112 (or (not *target*) (not (logtest? (-> *target* state-flags) (state-flags grabbed))))) ) (set! (-> self state-time) (-> *display* base-frame-counter)) (sleep (-> self ticker) (-> self prize (-> self challenge) puzzle-delay)) @@ -830,7 +830,7 @@ (set! (-> self abort-audio-if-beaten?) #f) (until v1-3 (suspend) - (set! v1-3 (or (not *target*) (zero? (logand (-> *target* state-flags) (state-flags grabbed))))) + (set! v1-3 (or (not *target*) (not (logtest? (-> *target* state-flags) (state-flags grabbed))))) ) (if (not (handle->process (-> self prize (-> self challenge) actor-handle))) (logior! (-> self challenges-mask) (ash 1 (-> self challenge))) @@ -838,7 +838,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) ) ) @@ -1045,7 +1045,3 @@ (go sunken-pipegame-start-up) (none) ) - - - - diff --git a/goal_src/jak1/levels/sunken/target-tube.gc b/goal_src/jak1/levels/sunken/target-tube.gc index 6ab6d88a54..86f4fb35cd 100644 --- a/goal_src/jak1/levels/sunken/target-tube.gc +++ b/goal_src/jak1/levels/sunken/target-tube.gc @@ -425,13 +425,13 @@ ) (defstate target-tube-start (target) - :event (behavior ((arg0 process) (arg1 int) (arg2 symbol) (arg3 event-message-block)) + :event (behavior ((proc process) (arg1 int) (event-type symbol) (event event-message-block)) (cond - ((and (= arg2 'query) (= (-> arg3 param 0) 'mode)) + ((and (= event-type 'query) (= (-> event param 0) 'mode)) 'tube ) (else - (case arg2 + (case event-type (('end-mode) (go target-jump @@ -441,20 +441,20 @@ ) ) (('touched) - (send-event arg0 'attack (-> arg3 param 0) 'tube 0 0) + (send-event proc 'attack (-> event param 0) 'tube 0 0) #f ) (('attack 'attack-or-shove 'attack-invinc) (target-attacked 'attack-or-shove - (the-as attack-info (-> arg3 param 1)) - arg0 - (the-as touching-shapes-entry (-> arg3 param 0)) + (the-as attack-info (-> event param 1)) + proc + (the-as touching-shapes-entry (-> event param 0)) target-tube-hit ) ) (else - (target-generic-event-handler arg0 arg1 arg2 arg3) + (target-generic-event-handler proc arg1 event-type event) ) ) ) @@ -725,7 +725,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) @@ -753,7 +753,7 @@ ) (when (and (logtest? (-> arg1 mask) (attack-mask mode)) (= (-> arg1 mode) 'darkeco) - (zero? (logand (-> arg1 mask) (attack-mask shove-up))) + (not (logtest? (-> arg1 mask) (attack-mask shove-up))) ) (set! (-> arg1 shove-up) 12288.0) (logior! (-> arg1 mask) (attack-mask shove-up)) @@ -838,7 +838,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)) ) @@ -952,13 +952,13 @@ (defstate slide-control-ride (slide-control) :virtual #t - :event (behavior ((arg0 process) (arg1 int) (arg2 symbol) (arg3 event-message-block)) - (case arg2 + :event (behavior ((proc process) (arg1 int) (event-type symbol) (event event-message-block)) + (case event-type (('end-mode) (go-virtual slide-control-watch) ) (('update) - (let* ((s4-0 arg0) + (let* ((s4-0 proc) (gp-0 (if (and (nonzero? s4-0) (type-type? (-> s4-0 type) process-drawable)) s4-0 ) @@ -967,10 +967,10 @@ (if gp-0 (find-target-point (-> (the-as process-drawable gp-0) root trans)) ) - (set! (-> (the-as vector (-> arg3 param 0)) quad) (-> self trans quad)) - (set! (-> (the-as vector (-> arg3 param 1)) quad) (-> self rot quad)) - (set! (-> (the-as vector (-> arg3 param 2)) quad) (-> self side quad)) - (eval-path-curve-div! (-> self path) (the-as vector (-> arg3 param 3)) (+ 0.2 (-> self pos)) 'interp) + (set! (-> (the-as vector (-> event param 0)) quad) (-> self trans quad)) + (set! (-> (the-as vector (-> event param 1)) quad) (-> self rot quad)) + (set! (-> (the-as vector (-> event param 2)) quad) (-> self side quad)) + (eval-path-curve-div! (-> self path) (the-as vector (-> event param 3)) (+ 0.2 (-> self pos)) 'interp) (if (>= (-> self pos) (+ -0.2 (the float (+ (-> self path curve num-cverts) -1)))) (send-event gp-0 'end-mode) ) @@ -1017,7 +1017,3 @@ (go (method-of-object obj slide-control-watch)) (none) ) - - - - diff --git a/goal_src/jak1/levels/swamp/billy.gc b/goal_src/jak1/levels/swamp/billy.gc index 27af39cc8d..e949fb790a 100644 --- a/goal_src/jak1/levels/swamp/billy.gc +++ b/goal_src/jak1/levels/swamp/billy.gc @@ -90,8 +90,8 @@ ) (defstate billy-snack-idle (billy-snack) - :event (behavior ((arg0 process) (arg1 int) (arg2 symbol) (arg3 event-message-block)) - (case arg2 + :event (behavior ((proc process) (arg1 int) (event-type symbol) (event event-message-block)) + (case event-type (('eat) (go billy-snack-eat) ) @@ -474,23 +474,23 @@ ) (defstate billy-done (billy) - :event (behavior ((arg0 process) (arg1 int) (arg2 symbol) (arg3 event-message-block)) - (let ((v1-0 arg2)) - (the-as object (when (= v1-0 'billy-rat-needs-destination) - (let* ((gp-0 arg0) - (v1-2 (if (and (nonzero? gp-0) (type-type? (-> gp-0 type) billy-rat)) - gp-0 - ) - ) - ) - (when v1-2 - (set! (-> (the-as billy-rat v1-2) dest-type) (the-as uint 1)) - (get-random-point (-> self path-waypts) (-> (the-as billy-rat v1-2) destination)) - ) - ) - ) - ) - ) + :event (behavior ((proc process) (arg1 int) (event-type symbol) (event event-message-block)) + (the-as object (case event-type + (('billy-rat-needs-destination) + (let* ((gp-0 proc) + (v1-2 (if (and (nonzero? gp-0) (type-type? (-> gp-0 type) billy-rat)) + gp-0 + ) + ) + ) + (when v1-2 + (set! (-> (the-as billy-rat v1-2) dest-type) (the-as uint 1)) + (get-random-point (-> self path-waypts) (-> (the-as billy-rat v1-2) destination)) + ) + ) + ) + ) + ) ) :enter (behavior () (init! @@ -761,8 +761,8 @@ ) (defstate billy-playing (billy) - :event (behavior ((arg0 process) (arg1 int) (arg2 symbol) (arg3 event-message-block)) - (case arg2 + :event (behavior ((proc process) (arg1 int) (event-type symbol) (event event-message-block)) + (case event-type (('billy-rat-die) (+! (-> self num-rats) -1) (let* ((f0-2 (rand-float-gen)) @@ -794,7 +794,7 @@ ) ) (('billy-rat-needs-destination) - (let* ((s5-0 arg0) + (let* ((s5-0 proc) (gp-0 (if (and (nonzero? s5-0) (type-type? (-> s5-0 type) billy-rat)) (the-as billy-rat s5-0) ) @@ -869,10 +869,7 @@ (+! (-> (the-as billy-snack s5-1) num-rats) 1) (set! (-> gp-0 dest-type) (the-as uint 2)) (set! (-> gp-0 destination quad) (-> (the-as billy-snack s5-1) root trans quad)) - (let ((f0-8 (+ 6799.36 (-> gp-0 destination x)))) - (set! (-> gp-0 destination x) f0-8) - f0-8 - ) + (set! (-> gp-0 destination x) (+ 6799.36 (-> gp-0 destination x))) ) ) ) @@ -1095,7 +1092,7 @@ (defmethod target-above-threshold? billy ((obj billy)) (the-as symbol - (and *target* (zero? (logand (-> *target* control root-prim prim-core action) (collide-action ca-14)))) + (and *target* (not (logtest? (-> *target* control root-prim prim-core action) (collide-action ca-14)))) ) ) @@ -1117,7 +1114,3 @@ (dummy-42 obj) (none) ) - - - - diff --git a/goal_src/jak1/levels/training/training-obs.gc b/goal_src/jak1/levels/training/training-obs.gc index 5e82b98a53..dc37a4ce27 100644 --- a/goal_src/jak1/levels/training/training-obs.gc +++ b/goal_src/jak1/levels/training/training-obs.gc @@ -87,14 +87,14 @@ (-> *setting-control* current play-hints) (and (< 0.0 (-> *setting-control* current dialog-volume)) (let ((a0-3 (entity-actor-lookup (-> self entity) 'alt-actor 0))) - (or (not a0-3) (zero? (logand (-> a0-3 extra perm status) (entity-perm-status dead)))) + (or (not a0-3) (not (logtest? (-> a0-3 extra perm status) (entity-perm-status dead)))) ) ) ) (when (!= (-> self index) 6) (while (and *target* (logtest? (-> *target* control unknown-surface00 flags) (surface-flags jump)) - (zero? (logand (-> *target* control status) (cshape-moving-flags onsurf))) + (not (logtest? (-> *target* control status) (cshape-moving-flags onsurf))) ) (suspend) ) @@ -140,13 +140,7 @@ (let ((v1-61 (-> self index))) (cond ((zero? v1-61) - (level-hint-spawn - (game-text-id training-money) - "asstvb41" - (the-as entity #f) - *entity-pool* - (game-task none) - ) + (level-hint-spawn (game-text-id training-money) "asstvb41" (the-as entity #f) *entity-pool* (game-task none)) (process-spawn pov-camera (-> self entity extra trans) *training-cam-sg* "orbcam" 0 #f '() :to self) ) ((= v1-61 1) @@ -420,7 +414,7 @@ (defpartgroup group-scarecrow-explode :id 143 - :duration 15 + :duration (seconds 0.05) :bounds (static-bspherem 0 0 0 1) :parts ((sp-item 2912) (sp-item 2913) (sp-item 2914) (sp-item 2915) (sp-item 2916)) ) @@ -568,14 +562,14 @@ (defpartgroup group-scarecrow-joint-explode :id 144 - :duration 15 + :duration (seconds 0.05) :bounds (static-bspherem 0 0 0 1) :parts ((sp-item 2912)) ) (defpartgroup group-scarecrow-hit :id 145 - :duration 15 + :duration (seconds 0.05) :bounds (static-bspherem 0 0 0 1) :parts ((sp-item 2913)) ) @@ -624,98 +618,96 @@ (defstate idle (scarecrow-a) :virtual #t - :event (behavior ((arg0 process) (arg1 int) (arg2 symbol) (arg3 event-message-block)) - (let ((v1-0 arg2)) - (the-as - object - (cond - ((= v1-0 'attack) - (let* ((s3-0 (-> arg3 param 2)) - (s4-0 (get-task-control (game-task training-gimmie))) - (v1-2 (get-reminder s4-0 0)) - ) - (when (!= s3-0 (-> self incomming-attack-id)) - (set! (-> self incomming-attack-id) s3-0) - (cond - ((= (-> self type) scarecrow-b) - ) - ((and (= (-> arg3 param 1) 'spin) (zero? v1-2)) - (save-reminder s4-0 1 0) - 1 - ) - ((and (= (-> arg3 param 1) 'punch) (= v1-2 1)) - (save-reminder s4-0 2 0) - 2 - ) - ((zero? v1-2) - ) - ((= v1-2 1) - ) - ) - (let* ((s4-1 arg0) - (v1-14 (if (and (nonzero? s4-1) (type-type? (-> s4-1 type) process-drawable)) - s4-1 - ) - ) - (f30-0 - (cond - (v1-14 - (let ((s4-2 (-> self root-override)) - (s2-0 (-> (the-as process-drawable v1-14) root trans)) - ) - (deg-diff (y-angle s4-2) (vector-y-angle (vector-! (new 'stack-no-clear 'vector) s2-0 (-> s4-2 trans)))) - ) - ) - (else - 0.0 + :event (behavior ((proc process) (arg1 int) (event-type symbol) (event event-message-block)) + (the-as + object + (case event-type + (('attack) + (let* ((s3-0 (-> event param 2)) + (s4-0 (get-task-control (game-task training-gimmie))) + (v1-2 (get-reminder s4-0 0)) + ) + (when (!= s3-0 (-> self incomming-attack-id)) + (set! (-> self incomming-attack-id) s3-0) + (cond + ((= (-> self type) scarecrow-b) + ) + ((and (= (-> event param 1) 'spin) (zero? v1-2)) + (save-reminder s4-0 1 0) + 1 + ) + ((and (= (-> event param 1) 'punch) (= v1-2 1)) + (save-reminder s4-0 2 0) + 2 + ) + ((zero? v1-2) + ) + ((= v1-2 1) + ) + ) + (let* ((s4-1 proc) + (v1-14 (if (and (nonzero? s4-1) (type-type? (-> s4-1 type) process-drawable)) + s4-1 + ) + ) + (f30-0 + (cond + (v1-14 + (let ((s4-2 (-> self root-override)) + (s2-0 (-> (the-as process-drawable v1-14) root trans)) + ) + (deg-diff (y-angle s4-2) (vector-y-angle (vector-! (new 'stack-no-clear 'vector) s2-0 (-> s4-2 trans)))) ) ) + (else + 0.0 + ) ) - (a0-24 ((method-of-type touching-shapes-entry prims-touching?) - (the-as touching-shapes-entry (-> arg3 param 0)) - (the-as collide-shape-moving (-> self root-override)) - (the-as uint -1) - ) - ) ) - (go-virtual - hit - f30-0 - (if a0-24 - (get-middle-of-bsphere-overlap a0-24 (-> self intersection)) - (target-pos 0) - ) - (the-as - symbol - (and ((method-of-type touching-shapes-entry prims-touching?) - (the-as touching-shapes-entry (-> arg3 param 0)) - (the-as collide-shape-moving (-> self root-override)) - (the-as uint 2) + (a0-24 ((method-of-type touching-shapes-entry prims-touching?) + (the-as touching-shapes-entry (-> event param 0)) + (the-as collide-shape-moving (-> self root-override)) + (the-as uint -1) + ) ) - (or (= (-> self type) scarecrow-a) - (and (= (-> arg0 type) target) - (logtest? (-> (the-as target arg0) control unknown-surface00 flags) (surface-flags jump)) - (zero? (logand (-> (the-as target arg0) control status) (cshape-moving-flags onsurf))) - ) - ) - ) + ) + (go-virtual + hit + f30-0 + (if a0-24 + (get-middle-of-bsphere-overlap a0-24 (-> self intersection)) + (target-pos 0) ) + (the-as + symbol + (and ((method-of-type touching-shapes-entry prims-touching?) + (the-as touching-shapes-entry (-> event param 0)) + (the-as collide-shape-moving (-> self root-override)) + (the-as uint 2) + ) + (or (= (-> self type) scarecrow-a) + (and (= (-> proc type) target) + (logtest? (-> (the-as target proc) control unknown-surface00 flags) (surface-flags jump)) + (not (logtest? (-> (the-as target proc) control status) (cshape-moving-flags onsurf))) + ) + ) + ) ) ) ) ) ) - ((= v1-0 'touch) - (send-shove-back - (-> self root-override) - arg0 - (the-as touching-shapes-entry (-> arg3 param 0)) - 0.7 - 6144.0 - 16384.0 - ) + ) + (('touch) + (send-shove-back + (-> self root-override) + proc + (the-as touching-shapes-entry (-> event param 0)) + 0.7 + 6144.0 + 16384.0 ) - ) + ) ) ) ) @@ -998,7 +990,3 @@ (go (method-of-object obj idle)) (none) ) - - - - diff --git a/goal_src/jak1/levels/village3/village3-obs.gc b/goal_src/jak1/levels/village3/village3-obs.gc index 7ca81bd297..cc995bbbdc 100644 --- a/goal_src/jak1/levels/village3/village3-obs.gc +++ b/goal_src/jak1/levels/village3/village3-obs.gc @@ -219,7 +219,7 @@ ) (when (and (< (vector-vector-xz-distance s5-1 (-> *target* control trans)) 18432.0) (and (not (and (logtest? (-> *target* control unknown-surface00 flags) (surface-flags jump)) - (zero? (logand (-> *target* control status) (cshape-moving-flags onsurf))) + (not (logtest? (-> *target* control status) (cshape-moving-flags onsurf))) ) ) (and (< (+ -40960.0 (-> s5-1 y)) (-> *target* control trans y)) @@ -419,10 +419,10 @@ (defstate idle (pistons) :virtual #t - :event (behavior ((arg0 process) (arg1 int) (arg2 symbol) (arg3 event-message-block)) - (case arg2 + :event (behavior ((proc process) (arg1 int) (event-type symbol) (event event-message-block)) + (case event-type (('update) - (go-virtual active (process->handle arg0) #f) + (go-virtual active (process->handle proc) #f) ) ) ) @@ -494,17 +494,17 @@ (defstate idle (gondolacables) :virtual #t - :event (behavior ((arg0 process) (arg1 int) (arg2 symbol) (arg3 event-message-block)) - (let ((v1-0 arg2)) - (the-as object (when (= v1-0 'update) - (process-entity-status! self (entity-perm-status complete) #t) - (let ((v0-0 1)) - (set! (-> self draw mgeo effect 0 effect-bits) (the-as uint v0-0)) - v0-0 - ) - ) - ) - ) + :event (behavior ((proc process) (arg1 int) (event-type symbol) (event event-message-block)) + (the-as object (case event-type + (('update) + (process-entity-status! self (entity-perm-status complete) #t) + (let ((v0-0 1)) + (set! (-> self draw mgeo effect 0 effect-bits) (the-as uint v0-0)) + v0-0 + ) + ) + ) + ) ) :code (behavior () (loop @@ -535,7 +535,3 @@ (go (method-of-object obj idle)) (none) ) - - - - diff --git a/goal_src/jak1/levels/village_common/villagep-obs.gc b/goal_src/jak1/levels/village_common/villagep-obs.gc index c96bfee88d..e269dcca24 100644 --- a/goal_src/jak1/levels/village_common/villagep-obs.gc +++ b/goal_src/jak1/levels/village_common/villagep-obs.gc @@ -95,8 +95,8 @@ (defstate idle (warp-gate) :virtual #t - :event (behavior ((arg0 process) (arg1 int) (arg2 symbol) (arg3 event-message-block)) - (case arg2 + :event (behavior ((proc process) (arg1 int) (event-type symbol) (event event-message-block)) + (case event-type (('hide) (go-virtual hidden) ) @@ -110,8 +110,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)))) @@ -635,8 +635,8 @@ (defstate basebutton-up-idle (warp-gate-switch) :virtual #t - :event (behavior ((arg0 process) (arg1 int) (arg2 symbol) (arg3 event-message-block)) - (case arg2 + :event (behavior ((proc process) (arg1 int) (event-type symbol) (event event-message-block)) + (case event-type (('touch 'attack) (when (pressable? self) (TODO-RENAME-29 self (-> self event-going-down) (-> self notify-actor)) @@ -644,10 +644,10 @@ ) ) (('hide) - (send-event (handle->process (-> self warp)) arg2) + (send-event (handle->process (-> self warp)) event-type) ) (else - ((-> (method-of-type basebutton basebutton-up-idle) event) arg0 arg1 arg2 arg3) + ((-> (method-of-type basebutton basebutton-up-idle) event) proc arg1 event-type event) ) ) ) @@ -754,13 +754,13 @@ (defstate basebutton-down-idle (warp-gate-switch) :virtual #t - :event (behavior ((arg0 process) (arg1 int) (arg2 symbol) (arg3 event-message-block)) - (case arg2 + :event (behavior ((proc process) (arg1 int) (event-type symbol) (event event-message-block)) + (case event-type (('hide) - (send-event (handle->process (-> self warp)) arg2) + (send-event (handle->process (-> self warp)) event-type) ) (else - ((-> (method-of-type basebutton basebutton-down-idle) event) arg0 arg1 arg2 arg3) + ((-> (method-of-type basebutton basebutton-down-idle) event) proc arg1 event-type event) ) ) ) @@ -953,7 +953,7 @@ ) (while (and *target* (logtest? (-> *target* control unknown-surface00 flags) (surface-flags jump)) - (zero? (logand (-> *target* control status) (cshape-moving-flags onsurf))) + (not (logtest? (-> *target* control status) (cshape-moving-flags onsurf))) ) (suspend) ) @@ -1149,7 +1149,3 @@ (go (method-of-object obj idle)) (none) ) - - - - diff --git a/goal_src/jak2/characters/ashelin/ash-states.gc b/goal_src/jak2/characters/ashelin/ash-states.gc index b0a9c436ed..3f2ce458d3 100644 --- a/goal_src/jak2/characters/ashelin/ash-states.gc +++ b/goal_src/jak2/characters/ashelin/ash-states.gc @@ -28,7 +28,7 @@ ) :trans (behavior () (bot-method-223 self #f) - (when (not (logtest? (-> self focus-status) (focus-status grabbed))) + (when (not (focus-test? self grabbed)) (cond ((bot-method-214 self) (go-hostile self) @@ -368,7 +368,7 @@ (none) ) :trans (behavior () - (if (logtest? (-> self focus-status) (focus-status grabbed)) + (if (focus-test? self grabbed) (go-virtual waiting-idle) ) (bot-method-223 self #f) diff --git a/goal_src/jak2/characters/ashelin/ash.gc b/goal_src/jak2/characters/ashelin/ash.gc index d633b498f1..c6c26ff828 100644 --- a/goal_src/jak2/characters/ashelin/ash.gc +++ b/goal_src/jak2/characters/ashelin/ash.gc @@ -1148,7 +1148,7 @@ (let ((f0-4 (ja-aframe-num 0))) (cond ((>= f0-4 22.0) - (when (logtest? (-> obj focus-status) (focus-status dangerous)) + (when (focus-test? obj dangerous) (if (logtest? (-> obj enemy-flags) (enemy-flag check-water)) (logior! (-> obj focus-status) (focus-status dangerous)) (logclear! (-> obj focus-status) (focus-status dangerous)) @@ -1156,7 +1156,7 @@ ) ) ((>= f0-4 16.0) - (when (not (logtest? (-> obj focus-status) (focus-status dangerous))) + (when (not (focus-test? obj dangerous)) (logior! (-> obj focus-status) (focus-status dangerous)) (let* ((v1-42 *game-info*) (a0-34 (+ (-> v1-42 attack-id) 1)) @@ -1179,7 +1179,7 @@ (let ((f0-5 (ja-aframe-num 0))) (cond ((>= f0-5 32.0) - (when (logtest? (-> obj focus-status) (focus-status dangerous)) + (when (focus-test? obj dangerous) (if (logtest? (-> obj enemy-flags) (enemy-flag check-water)) (logior! (-> obj focus-status) (focus-status dangerous)) (logclear! (-> obj focus-status) (focus-status dangerous)) @@ -1187,7 +1187,7 @@ ) ) ((>= f0-5 25.0) - (when (not (logtest? (-> obj focus-status) (focus-status dangerous))) + (when (not (focus-test? obj dangerous)) (logior! (-> obj focus-status) (focus-status dangerous)) (let* ((v1-62 *game-info*) (a0-47 (+ (-> v1-62 attack-id) 1)) diff --git a/goal_src/jak2/characters/sig/sig-states.gc b/goal_src/jak2/characters/sig/sig-states.gc index 03470e9e88..4676a44289 100644 --- a/goal_src/jak2/characters/sig/sig-states.gc +++ b/goal_src/jak2/characters/sig/sig-states.gc @@ -42,7 +42,7 @@ (none) ) :trans (behavior () - (if (and (not (logtest? (-> self focus-status) (focus-status grabbed))) + (if (and (not (focus-test? self grabbed)) (not (outside-spot-radius? self (the-as bot-spot #f) (the-as vector #f) #f)) ) (go-virtual traveling) @@ -89,7 +89,7 @@ ) :trans (behavior () (bot-method-223 self #f) - (when (not (logtest? (-> self focus-status) (focus-status grabbed))) + (when (not (focus-test? self grabbed)) (cond ((bot-method-214 self) (go-hostile self) @@ -192,7 +192,7 @@ ) :trans (behavior () (bot-method-223 self #f) - (when (not (logtest? (-> self focus-status) (focus-status grabbed))) + (when (not (focus-test? self grabbed)) (cond ((bot-method-214 self) (go-hostile self) @@ -323,7 +323,7 @@ ) :trans (behavior () (bot-method-223 self #f) - (when (not (logtest? (-> self focus-status) (focus-status grabbed))) + (when (not (focus-test? self grabbed)) (cond ((bot-method-214 self) (go-hostile self) @@ -521,7 +521,7 @@ ) :trans (behavior () (bot-method-223 self #f) - (when (not (logtest? (-> self focus-status) (focus-status grabbed))) + (when (not (focus-test? self grabbed)) (cond ((bot-method-214 self) (go-hostile self) @@ -674,7 +674,7 @@ ) :trans (behavior () (bot-method-223 self #f) - (when (not (logtest? (-> self focus-status) (focus-status grabbed))) + (when (not (focus-test? self grabbed)) (if (bot-method-214 self) (go-hostile self) ) @@ -857,7 +857,7 @@ ) :trans (behavior () (bot-method-223 self #f) - (when (not (logtest? (-> self focus-status) (focus-status grabbed))) + (when (not (focus-test? self grabbed)) (cond ((bot-method-214 self) (go-hostile self) @@ -1244,7 +1244,7 @@ :frame-num 0.0 ) (until (ja-done? 0) - (when (and (logtest? (-> self focus-status) (focus-status dangerous)) (< f30-0 (ja-aframe-num 0))) + (when (and (focus-test? self dangerous) (< f30-0 (ja-aframe-num 0))) (if (logtest? (-> self enemy-flags) (enemy-flag check-water)) (logior! (-> self focus-status) (focus-status dangerous)) (logclear! (-> self focus-status) (focus-status dangerous)) @@ -1728,13 +1728,13 @@ (if (not (logtest? s5-0 1)) (logclear! (-> self bot-flags) (bot-flags bf24)) ) - (if (and (logtest? s5-0 1) (zero? (logand (bot-flags bf24) (-> self bot-flags)))) + (if (and (logtest? s5-0 1) (not (logtest? (bot-flags bf24) (-> self bot-flags)))) (go-virtual sig-path-jump) ) (if (logtest? s5-0 2) (go-virtual sig-path-shoot-jump) ) - (if (and (>= (- (-> self clock frame-counter) (-> self state-time)) (seconds 0.05)) (zero? (logand s5-0 4))) + (if (and (>= (- (-> self clock frame-counter) (-> self state-time)) (seconds 0.05)) (not (logtest? s5-0 4))) (go-virtual sig-path-jump-land) ) ) @@ -1799,7 +1799,7 @@ (if (not (logtest? s5-0 1)) (logclear! (-> self bot-flags) (bot-flags bf24)) ) - (if (and (logtest? s5-0 1) (zero? (logand (bot-flags bf24) (-> self bot-flags)))) + (if (and (logtest? s5-0 1) (not (logtest? (bot-flags bf24) (-> self bot-flags)))) (go-virtual sig-path-jump) ) (if (logtest? s5-0 2) @@ -1870,13 +1870,13 @@ (if (not (logtest? s5-0 2)) (logclear! (-> self bot-flags) (bot-flags bf24)) ) - (if (and (logtest? s5-0 2) (zero? (logand (bot-flags bf24) (-> self bot-flags)))) + (if (and (logtest? s5-0 2) (not (logtest? (bot-flags bf24) (-> self bot-flags)))) (go-virtual sig-path-shoot-jump) ) (if (and (logtest? s5-0 1) (logtest? (bot-flags bf25) (-> self bot-flags))) (go-virtual sig-path-jump) ) - (if (and (>= (- (-> self clock frame-counter) (-> self state-time)) (seconds 0.05)) (zero? (logand s5-0 4))) + (if (and (>= (- (-> self clock frame-counter) (-> self state-time)) (seconds 0.05)) (not (logtest? s5-0 4))) (go-virtual sig-path-shoot-jump-land) ) ) @@ -1946,7 +1946,7 @@ (if (not (logtest? s5-0 2)) (logclear! (-> self bot-flags) (bot-flags bf24)) ) - (if (and (logtest? s5-0 2) (zero? (logand (bot-flags bf24) (-> self bot-flags)))) + (if (and (logtest? s5-0 2) (not (logtest? (bot-flags bf24) (-> self bot-flags)))) (go-virtual sig-path-shoot-jump) ) (if (logtest? s5-0 1) diff --git a/goal_src/jak2/characters/sig/sig-task.gc b/goal_src/jak2/characters/sig/sig-task.gc index 75bb4a839f..eae6216837 100644 --- a/goal_src/jak2/characters/sig/sig-task.gc +++ b/goal_src/jak2/characters/sig/sig-task.gc @@ -47,7 +47,7 @@ (cond ((and a1-10 (attacked-by-player? arg0 (the-as process-focusable a1-10)) - (zero? (logand (-> arg0 focus-status) (focus-status grabbed))) + (not (logtest? (-> arg0 focus-status) (focus-status grabbed))) ) (get-task-by-type (-> arg0 ai-ctrl) sigt-fight-focus arg0) (ai-task-control-method-10 (-> arg0 ai-ctrl) arg0) @@ -66,7 +66,7 @@ (let ((a1-1 (handle->process (-> arg0 focus handle)))) (if (and a1-1 (attacked-by-player? arg0 (the-as process-focusable a1-1)) - (zero? (logand (-> arg0 focus-status) (focus-status grabbed))) + (not (logtest? (-> arg0 focus-status) (focus-status grabbed))) ) (logior! (-> arg0 bot-flags) (bot-flags bf00)) (ai-task-control-method-14 (-> arg0 ai-ctrl) obj arg0) @@ -90,7 +90,7 @@ (let ((a1-4 (handle->process (-> arg0 focus handle)))) (when (and a1-4 (attacked-by-player? arg0 (the-as process-focusable a1-4)) - (zero? (logand (-> arg0 focus-status) (focus-status grabbed))) + (not (logtest? (-> arg0 focus-status) (focus-status grabbed))) ) (get-task-by-type (-> arg0 ai-ctrl) sigt-fight-focus arg0) (ai-task-control-method-10 (-> arg0 ai-ctrl) arg0) @@ -237,7 +237,7 @@ (let ((a1-6 (handle->process (-> arg0 focus handle)))) (when (and a1-6 (attacked-by-player? arg0 (the-as process-focusable a1-6)) - (zero? (logand (-> arg0 focus-status) (focus-status grabbed))) + (not (logtest? (-> arg0 focus-status) (focus-status grabbed))) ) (get-task-by-type (-> arg0 ai-ctrl) sigt-fight-focus arg0) (ai-task-control-method-10 (-> arg0 ai-ctrl) arg0) @@ -407,7 +407,7 @@ (let ((a1-14 (handle->process (-> (the-as sig arg0) focus handle)))) (when (and a1-14 (attacked-by-player? (the-as sig arg0) (the-as process-focusable a1-14)) - (zero? (logand (-> (the-as sig arg0) focus-status) (focus-status grabbed))) + (not (logtest? (-> (the-as sig arg0) focus-status) (focus-status grabbed))) ) (get-task-by-type (-> (the-as sig arg0) ai-ctrl) sigt-fight-focus (the-as sig arg0)) (ai-task-control-method-10 (-> (the-as sig arg0) ai-ctrl) (the-as sig arg0)) diff --git a/goal_src/jak2/characters/sig/sig.gc b/goal_src/jak2/characters/sig/sig.gc index 3af3fd6aae..59eb67ab05 100644 --- a/goal_src/jak2/characters/sig/sig.gc +++ b/goal_src/jak2/characters/sig/sig.gc @@ -362,26 +362,25 @@ "Handles various events for the enemy @TODO - unsure if there is a pattern for the events and this should have a more specific name" (let ((v1-0 arg2)) - (the-as object (cond - ((= v1-0 'untrigger) - (sig-plasma-method-11 (-> obj plasma) #t) - ) - ((= v1-0 'sig-path) - (when (and (not (logtest? (-> obj focus-status) (focus-status dead))) - (nonzero? (-> obj hit-points)) - (zero? (-> obj fated-time)) - ) - (let ((a1-2 (-> arg3 param 0))) - (sig-method-249 obj (the-as sig-path a1-2)) - ) - (go (method-of-object obj sig-path-run)) - ) - ) - (else - ((method-of-type bot general-event-handler) obj arg0 arg1 arg2 arg3) - ) - ) - ) + (the-as + object + (cond + ((= v1-0 'untrigger) + (sig-plasma-method-11 (-> obj plasma) #t) + ) + ((= v1-0 'sig-path) + (when (and (not (focus-test? obj dead)) (nonzero? (-> obj hit-points)) (zero? (-> obj fated-time))) + (let ((a1-2 (-> arg3 param 0))) + (sig-method-249 obj (the-as sig-path a1-2)) + ) + (go (method-of-object obj sig-path-run)) + ) + ) + (else + ((method-of-type bot general-event-handler) obj arg0 arg1 arg2 arg3) + ) + ) + ) ) ) @@ -706,7 +705,7 @@ (and (or (and (logtest? (-> obj bot-flags) (bot-flags attacked)) (= (-> obj focus-info fproc type) target)) (and (>= 40960.0 (-> obj focus-info bullseye-xz-dist)) (= (-> obj focus-info los) 1)) ) - (zero? (logand (bot-flags bf19) (-> obj bot-flags))) + (not (logtest? (bot-flags bf19) (-> obj bot-flags))) ) ) @@ -1146,7 +1145,7 @@ ((and (-> obj next-state) (= (-> obj next-state name) 'failed)) (set-vector! arg0 0.0 4096.0 28672.0 1.0) ) - ((logtest? (-> obj focus-status) (focus-status under-water)) + ((focus-test? obj under-water) (set-vector! arg0 0.0 12288.0 28672.0 1.0) ) (else @@ -1156,7 +1155,7 @@ (vector<-cspace+vector! arg0 (-> obj node-list data 2) arg0) (the-as meters - (if (logtest? (-> obj focus-status) (focus-status under-water)) + (if (focus-test? obj under-water) (set! (-> arg0 y) (+ (get-water-height obj) (-> *setting-control* cam-current target-height))) ) ) diff --git a/goal_src/jak2/engine/ai/enemy.gc b/goal_src/jak2/engine/ai/enemy.gc index 08b0c94b4d..577a2f251c 100644 --- a/goal_src/jak2/engine/ai/enemy.gc +++ b/goal_src/jak2/engine/ai/enemy.gc @@ -212,7 +212,7 @@ (when (logtest? (water-flags touch-water) s3-0) (set! (-> obj enemy-flags) (logior (enemy-flag directed-ready) (-> obj enemy-flags))) (set! (-> obj water-surface-height) (-> s5-0 trans y)) - (when (not (logtest? (-> obj focus-status) (focus-status touch-water under-water))) + (when (not (focus-test? obj touch-water under-water)) (let ((s2-0 (new 'stack-no-clear 'vector))) (set! (-> s2-0 quad) (-> obj root-override2 trans quad)) (set! (-> s2-0 y) (+ 409.6 (-> s5-0 trans y))) @@ -266,7 +266,7 @@ (let* ((v1-32 (-> s4-0 root-prim prim-core)) (f0-5 (+ (-> v1-32 world-sphere y) (-> v1-32 world-sphere w))) ) - (if (logtest? (-> obj focus-status) (focus-status under-water)) + (if (focus-test? obj under-water) (set! f0-5 (+ -819.2 f0-5)) ) (if (< f0-5 (-> s5-0 trans y)) @@ -354,10 +354,10 @@ (with-pp (when (or (>= (- (-> pp clock frame-counter) (-> obj hit-focus-time)) (seconds 2)) (and (handle->process (-> obj focus handle)) - (zero? (logand (-> (the-as process-focusable (handle->process (-> obj focus handle))) focus-status) + (not (logtest? (-> (the-as process-focusable (handle->process (-> obj focus handle))) focus-status) (focus-status disable dead ignore grabbed) ) - ) + ) ) ) (let ((v0-0 (logclear (-> obj enemy-flags) (enemy-flag look-at-focus)))) @@ -403,7 +403,7 @@ (let ((v0-0 (handle->process (-> obj focus handle)))) (if (and v0-0 (not (and v0-0 - (zero? (logand (-> (the-as process-focusable v0-0) focus-status) (focus-status disable dead ignore grabbed))) + (not (logtest? (-> (the-as process-focusable v0-0) focus-status) (focus-status disable dead ignore grabbed))) ) ) ) @@ -441,7 +441,7 @@ (defmethod enemy-method-108 enemy ((obj enemy) (arg0 enemy) (arg1 event-message-block)) (let ((s4-0 (the-as touching-shapes-entry (-> arg1 param 0)))) (when (and s4-0 - (and (logtest? (-> obj incoming penetrate-using) 4096) (zero? (logand (-> obj incoming penetrate-using) 32))) + (and (logtest? (-> obj incoming penetrate-using) 4096) (not (logtest? (-> obj incoming penetrate-using) 32))) (begin (let ((s3-0 (-> s4-0 head))) (while s3-0 @@ -674,7 +674,7 @@ (when (enemy-method-53 obj (the-as process-focusable s5-0)) (let ((v1-10 (handle->process (-> obj focus handle)))) (when (or (= s5-0 v1-10) (and (not (logtest? (enemy-flag actor-pause-backup) (-> obj enemy-flags))) - (or (not v1-10) (zero? (logand (-> obj focus flags) (enemy-flag lock-focus)))) + (or (not v1-10) (not (logtest? (-> obj focus flags) (enemy-flag lock-focus)))) ) ) (enemy-method-63 obj (the-as process-focusable s5-0) (the-as enemy-aware #f)) @@ -1169,7 +1169,7 @@ (set! (-> obj mask) (logior (process-mask collectable) (-> obj mask))) (if (and (-> obj enemy-info move-to-ground) (not (logtest? (enemy-flag vulnerable-backup) (-> obj enemy-flags))) - (zero? (logand (enemy-option ambush) (-> obj fact-info-override enemy-options))) + (not (logtest? (enemy-option ambush) (-> obj fact-info-override enemy-options))) ) (enemy-method-127 obj 40960.0 40960.0 #t (the-as collide-spec (-> obj gnd-collide))) ) @@ -1337,10 +1337,10 @@ This commonly includes things such as: (when a1-0 (let ((v1-4 (-> obj enemy-flags))) (cond - ((and a1-0 (zero? (logand (-> (the-as process-focusable a1-0) focus-status) (focus-status disable dead)))) + ((and a1-0 (not (logtest? (-> (the-as process-focusable a1-0) focus-status) (focus-status disable dead)))) (when (and (logtest? (enemy-flag trackable) v1-4) (not (logtest? (enemy-flag actor-pause-backup) v1-4)) - (zero? (logand (-> gp-0 flags) (enemy-flag lock-focus))) + (not (logtest? (-> gp-0 flags) (enemy-flag lock-focus))) ) (enemy-method-97 obj) (return #f) @@ -1396,7 +1396,7 @@ This commonly includes things such as: ) ) ) - (if (and a1-1 (and a1-1 (zero? (logand (-> a1-1 focus-status) (focus-status disable dead)))) (!= obj a1-1)) + (if (and a1-1 (and a1-1 (not (logtest? (-> a1-1 focus-status) (focus-status disable dead)))) (!= obj a1-1)) (update-target-awareness! obj a1-1 gp-0) ) ) @@ -1423,7 +1423,7 @@ This commonly includes things such as: ) ) ) - (if (and a1-3 (and a1-3 (zero? (logand (-> a1-3 focus-status) (focus-status disable dead)))) (!= obj a1-3)) + (if (and a1-3 (and a1-3 (not (logtest? (-> a1-3 focus-status) (focus-status disable dead)))) (!= obj a1-3)) (update-target-awareness! obj a1-3 gp-0) ) ) @@ -1449,7 +1449,7 @@ This commonly includes things such as: ) ) ) - (if (and a1-5 (and a1-5 (zero? (logand (-> a1-5 focus-status) (focus-status disable dead)))) (!= obj a1-5)) + (if (and a1-5 (and a1-5 (not (logtest? (-> a1-5 focus-status) (focus-status disable dead)))) (!= obj a1-5)) (update-target-awareness! obj a1-5 gp-0) ) ) @@ -1495,7 +1495,7 @@ This commonly includes things such as: (if (< 1 (the-as int (-> obj focus aware))) (set! f0-1 (+ (the-as meters f0-1) (-> obj enemy-info notice-distance-delta))) ) - (when (or (< f30-0 f0-1) (zero? (logand (-> obj enemy-flags) (enemy-flag enable-on-notice)))) + (when (or (< f30-0 f0-1) (not (logtest? (-> obj enemy-flags) (enemy-flag enable-on-notice)))) (set! s2-0 (in-aggro-range? obj arg0 (the-as vector #f))) (if s2-0 (set! s3-1 #t) @@ -1716,7 +1716,7 @@ This commonly includes things such as: (when (!= (-> (the-as attack-info s2-0) id) (-> obj incoming attack-id)) (cond ((and (logtest? (-> obj enemy-flags) (enemy-flag enable-on-active)) - (zero? (logand (-> obj focus-status) (focus-status grabbed))) + (not (logtest? (-> obj focus-status) (focus-status grabbed))) ) (let* ((s1-0 obj) (s0-0 (method-of-object s1-0 enemy-method-106)) @@ -1824,7 +1824,7 @@ This commonly includes things such as: ((= arg2 'cue-chase) (when (and (> (-> obj hit-points) 0) (zero? (-> obj fated-time)) - (zero? (logand (-> obj focus-status) (focus-status grabbed))) + (not (logtest? (-> obj focus-status) (focus-status grabbed))) ) (let ((v1-162 (logtest? (enemy-flag alert) (-> obj enemy-flags)))) (logclear! (-> obj enemy-flags) (enemy-flag enable-on-notice alert victory called-dying)) @@ -1854,7 +1854,7 @@ This commonly includes things such as: ((= arg2 'cue-wake) (when (and (> (-> obj hit-points) 0) (zero? (-> obj fated-time)) - (zero? (logand (-> obj focus-status) (focus-status grabbed))) + (not (logtest? (-> obj focus-status) (focus-status grabbed))) ) (logclear! (-> obj enemy-flags) (enemy-flag alert victory called-dying)) (if (logtest? (enemy-option ambush) (-> obj fact-info-override enemy-options)) @@ -1867,7 +1867,7 @@ This commonly includes things such as: ((= arg2 'jump) (when (and (> (-> obj hit-points) 0) (zero? (-> obj fated-time)) - (zero? (logand (-> obj focus-status) (focus-status grabbed))) + (not (logtest? (-> obj focus-status) (focus-status grabbed))) ) (logclear! (-> obj mask) (process-mask actor-pause)) (set! (-> obj jump-why) (-> arg3 param 0)) @@ -1934,7 +1934,7 @@ This commonly includes things such as: (not (and (-> obj next-state) (= (-> obj next-state name) 'victory))) (> (-> obj hit-points) 0) (zero? (-> obj fated-time)) - (zero? (logand (-> obj focus-status) (focus-status grabbed))) + (not (logtest? (-> obj focus-status) (focus-status grabbed))) ) (go (method-of-object obj victory)) ) @@ -2061,8 +2061,8 @@ This commonly includes things such as: ) (when (and s4-0 s3-0) (cond - ((and (logtest? (-> obj focus-status) (focus-status dangerous)) - (and s3-0 (zero? (logand (-> s3-0 focus-status) (focus-status disable dead ignore grabbed)))) + ((and (focus-test? obj dangerous) + (and s3-0 (not (logtest? (-> s3-0 focus-status) (focus-status disable dead ignore grabbed)))) ((method-of-type touching-shapes-entry prims-touching-action?) (the-as touching-shapes-entry s4-0) (-> obj root-override2) @@ -2090,7 +2090,7 @@ This commonly includes things such as: (collide-action no-standon) (collide-action) ) - (zero? (logand (-> obj root-override2 penetrated-by) (-> s3-0 root-override penetrate-using))) + (not (logtest? (-> obj root-override2 penetrated-by) (-> s3-0 root-override penetrate-using))) ) (if (send-shoves (-> obj root-override2) arg0 (the-as touching-shapes-entry s4-0) 0.7 6144.0 16384.0) (send-event obj 'bouncing-off arg0) @@ -2152,7 +2152,7 @@ This commonly includes things such as: (set! (-> self enemy-flags) (logior (enemy-flag directed) (-> self enemy-flags))) (let ((gp-0 (-> self root-override2))) (cond - ((logtest? (-> self focus-status) (focus-status under-water)) + ((focus-test? self under-water) (enemy-method-47 self (-> gp-0 transv)) ) (else @@ -2189,7 +2189,7 @@ This commonly includes things such as: (defbehavior enemy-die-falling-post enemy () (set! (-> self enemy-flags) (logior (enemy-flag directed) (-> self enemy-flags))) (let ((gp-0 (-> self root-override2))) - (if (logtest? (-> self focus-status) (focus-status under-water)) + (if (focus-test? self under-water) (enemy-method-47 self (-> gp-0 transv)) (vector-v++! (-> gp-0 transv) (compute-acc-due-to-gravity gp-0 (new-stack-vector0) 0.0)) ) @@ -3047,7 +3047,7 @@ This commonly includes things such as: ) (when (not (logtest? (enemy-flag directed) (-> obj enemy-flags))) (let ((s5-0 (-> obj root-override2))) - (if (logtest? (-> obj focus-status) (focus-status under-water)) + (if (focus-test? obj under-water) (enemy-method-47 obj (-> s5-0 transv)) (+! (-> s5-0 transv y) (* (-> obj enemy-info movement-gravity) (-> pp clock seconds-per-frame))) ) @@ -3067,7 +3067,7 @@ This commonly includes things such as: ) ) (logclear! (-> obj enemy-flags) (enemy-flag directed)) - (if (and (enemy-method-102 obj) (zero? (logand (-> obj focus-status) (focus-status dead)))) + (if (and (enemy-method-102 obj) (not (logtest? (-> obj focus-status) (focus-status dead)))) (kill-prefer-falling obj) ) (let ((s5-1 (-> obj root-override2)) diff --git a/goal_src/jak2/engine/ambient/ambient.gc b/goal_src/jak2/engine/ambient/ambient.gc index 0eff666c22..5db047f6f8 100644 --- a/goal_src/jak2/engine/ambient/ambient.gc +++ b/goal_src/jak2/engine/ambient/ambient.gc @@ -454,7 +454,7 @@ ) :code (behavior () (local-vars (v1-43 symbol)) - (let ((gp-1 (zero? (logand (-> self message flags) 2)))) + (let ((gp-1 (not (logtest? (-> self message flags) 2)))) (while (or (and (nonzero? (-> self voice-id)) (let ((v1-34 (get-status *gui-control* (-> self voice-id)))) (or (= v1-34 (gui-status ready)) (= v1-34 (gui-status active))) diff --git a/goal_src/jak2/engine/camera/cam-layout.gc b/goal_src/jak2/engine/camera/cam-layout.gc index 151c6d872d..e09b67e595 100644 --- a/goal_src/jak2/engine/camera/cam-layout.gc +++ b/goal_src/jak2/engine/camera/cam-layout.gc @@ -163,8 +163,7 @@ ) -;; WARN: Failed store: (s.w! (+ v1-6 8) 0) at op 22 -;; WARN: Failed store: (s.w! (+ v1-6 12) 0) at op 23 +;; ERROR: Failed store: (s.w! (+ v1-6 8) 0) at op 22 (defun cam-layout-print ((arg0 int) (arg1 int) (arg2 string)) (with-dma-buffer-add-bucket ((s5-0 (-> *display* frames (-> *display* on-screen) debug-buf)) (bucket-id debug2) @@ -366,7 +365,7 @@ (cond ((and (= gp-0 (-> self cur-volume)) (= *camera-layout-blink* 'volume) - (zero? (logand (-> *display* real-frame-clock integral-frame-counter) 8)) + (not (logtest? (-> *display* real-frame-clock integral-frame-counter) 8)) ) ) (else @@ -3095,12 +3094,12 @@ ) ((and (not (logtest? (-> arg0 options) 28)) (logtest? (-> arg0 options) 1) - (zero? (logand (-> *cpad-list* cpads 0 button0-rel 0) (-> arg0 button))) + (not (logtest? (-> *cpad-list* cpads 0 button0-rel 0) (-> arg0 button))) ) #f ) ((and (not (logtest? (-> arg0 options) 29)) - (zero? (logand (-> *cpad-list* cpads 0 button0-abs 0) (-> arg0 button))) + (not (logtest? (-> *cpad-list* cpads 0 button0-abs 0) (-> arg0 button))) ) #f ) diff --git a/goal_src/jak2/engine/camera/cam-master.gc b/goal_src/jak2/engine/camera/cam-master.gc index 36a3d9c5ec..e3a1611fd2 100644 --- a/goal_src/jak2/engine/camera/cam-master.gc +++ b/goal_src/jak2/engine/camera/cam-master.gc @@ -53,7 +53,7 @@ (vector-reset! (-> self pitch-off)) (set! (-> self upspeed) 0.0) (set! (-> self on-ground) - (zero? (logand (-> (the-as process-focusable gp-0) focus-status) (focus-status in-air))) + (not (logtest? (-> (the-as process-focusable gp-0) focus-status) (focus-status in-air))) ) (set! (-> self on-pole) #f) (set! (-> self ease-t) 1.0) @@ -77,7 +77,7 @@ ) ) (cond - ((logtest? (-> (the-as process-focusable gp-0) focus-status) (focus-status under-water)) + ((focus-test? (the-as process-focusable gp-0) under-water) (set! (-> self under-water) 2) ) (else @@ -135,7 +135,7 @@ ) ) (cond - ((logtest? (-> (the-as target gp-0) focus-status) (focus-status under-water)) + ((focus-test? (the-as target gp-0) under-water) (set! (-> self under-water) 2) ) ((> (-> self under-water) 0) @@ -174,7 +174,7 @@ (set! (-> self tpos-curr quad) (-> (get-trans (the-as target gp-0) 4) quad)) ) ) - (when (logtest? (-> (the-as target gp-0) focus-status) (focus-status edge-grab)) + (when (focus-test? (the-as target gp-0) edge-grab) (if *display-cam-los-debug* (format *stdcon* "ride edge~%") ) @@ -185,7 +185,7 @@ (-> self local-down) (-> self settings target-height) ) - (vector-float*! (-> s5-6 move-dist) (the-as vector (&-> self stack 256)) 4915.2) + (vector-float*! (-> s5-6 move-dist) (-> self tgt-rot-mat vector 2) 4915.2) (vector-! (-> s5-6 start-pos) (-> s5-6 start-pos) (-> s5-6 move-dist)) (let ((s4-4 s5-6)) (set! (-> s4-4 radius) 4300.8) @@ -202,12 +202,12 @@ ) ) ) - (set! (-> self on-ground) (zero? (logand (-> (the-as target gp-0) focus-status) (focus-status in-air)))) + (set! (-> self on-ground) (not (logtest? (-> (the-as target gp-0) focus-status) (focus-status in-air)))) (let ((s5-7 (new-stack-vector0))) 0.0 (cond - ((and (logtest? (-> (the-as target gp-0) focus-status) (focus-status in-air)) - (zero? (logand (focus-status halfpipe super) (-> (the-as target gp-0) focus-status))) + ((and (focus-test? (the-as target gp-0) in-air) + (not (logtest? (focus-status halfpipe super) (-> (the-as target gp-0) focus-status))) ) (if *display-cam-los-debug* (format *stdcon* "air tracking~%") @@ -251,8 +251,8 @@ (vector-! s5-7 (-> self tpos-curr) (-> self tpos-old)) (let ((f0-34 (vector-dot s5-7 (-> self local-down)))) (cond - ((and (logtest? (-> (the-as target gp-0) focus-status) (focus-status touch-water)) - (zero? (logand (focus-status mech) (-> (the-as target gp-0) focus-status))) + ((and (focus-test? (the-as target gp-0) touch-water) + (not (logtest? (focus-status mech) (-> (the-as target gp-0) focus-status))) ) (set! (-> self upspeed) 0.0) ) @@ -288,8 +288,8 @@ (if (not (logtest? (-> self settings slave-options) (cam-slave-options JUMP_PITCHES))) (reset-follow) ) - (when (and (logtest? (-> (the-as target gp-0) focus-status) (focus-status on-water under-water)) - (zero? (logand (focus-status mech) (-> (the-as target gp-0) focus-status))) + (when (and (focus-test? (the-as target gp-0) on-water under-water) + (not (logtest? (focus-status mech) (-> (the-as target gp-0) focus-status))) ) (let ((f0-41 (- (get-water-height (the-as target gp-0)) (-> self settings target-height)))) (if (< (-> self tpos-curr-adj y) f0-41) diff --git a/goal_src/jak2/engine/camera/cam-states.gc b/goal_src/jak2/engine/camera/cam-states.gc index 8d065f837c..cabb5ec9fa 100644 --- a/goal_src/jak2/engine/camera/cam-states.gc +++ b/goal_src/jak2/engine/camera/cam-states.gc @@ -301,7 +301,7 @@ ) :trans (behavior () (if (or (not (handle->process (-> *camera* settings pov-handle))) - (zero? (logand (-> *camera* master-options) (cam-master-options-u32 HAVE_TARGET))) + (not (logtest? (-> *camera* master-options) (cam-master-options-u32 HAVE_TARGET))) ) (cam-slave-go cam-free-floating) ) @@ -509,7 +509,7 @@ :exit (behavior () (if (and *target* (logtest? (-> *camera* master-options) (cam-master-options-u32 HAVE_TARGET)) - (logtest? (-> *target* focus-status) (focus-status in-head)) + (focus-test? *target* in-head) ) (send-event *target* 'end-mode) ) @@ -2602,7 +2602,7 @@ (vector-flatten! s5-3 (-> self butt-vector) (-> *camera* local-down)) ) (else - (vector-flatten! s5-3 (the-as vector (&-> *camera* stack 256)) (-> *camera* local-down)) + (vector-flatten! s5-3 (-> *camera* tgt-rot-mat vector 2) (-> *camera* local-down)) ) ) ) @@ -2622,7 +2622,7 @@ ) (when (logtest? (-> *camera* settings slave-options) (cam-slave-options BIKE_MODE)) (vector-normalize-copy! gp-3 (-> self view-flat) 1.0) - (vector-flatten! s5-3 (the-as vector (&-> *camera* stack 256)) (-> *camera* local-down)) + (vector-flatten! s5-3 (-> *camera* tgt-rot-mat vector 2) (-> *camera* local-down)) (vector-normalize! s5-3 -1.0) (let ((f0-97 (acos (vector-dot s5-3 gp-3)))) (when (and (< (-> self max-angle-offset) f0-97) (< f0-97 32585.955)) @@ -3451,7 +3451,7 @@ ((logtest? (-> self options) (cam-slave-options-u32 BUTT_CAM)) (set-vector! s5-0 0.0 0.0 1.0 1.0) (vector-normalize-copy! s5-0 (-> self view-flat) 1.0) - (set! (-> s3-0 quad) (-> (the-as vector (&-> *camera* stack 256)) quad)) + (set! (-> s3-0 quad) (-> (the-as vector (-> *camera* tgt-rot-mat vector 2)) quad)) (vector-flatten! s3-0 s3-0 (-> *camera* local-down)) (vector-negate! s3-0 s3-0) (set! (-> s4-0 quad) (-> s5-0 quad)) @@ -3500,7 +3500,7 @@ ) (defbehavior cam-calc-bike-follow! camera-slave ((arg0 cam-rotation-tracker) (arg1 vector) (arg2 symbol)) - (vector-float*! (-> arg0 follow-off) (the-as vector (&-> *camera* stack 320)) 155648.0) + (vector-float*! (-> arg0 follow-off) (-> *camera* tgt-face-mat vector 2) 155648.0) (vector+! (-> arg0 follow-pt) (-> *camera* tpos-curr-adj) (-> arg0 follow-off)) (vector--float*! (-> arg0 follow-pt) @@ -3517,7 +3517,7 @@ (s5-0 (new-stack-vector0)) ) (vector-normalize-copy! gp-0 (-> self view-flat) 1.0) - (vector-flatten! s5-0 (the-as vector (&-> *camera* stack 256)) (-> *camera* local-down)) + (vector-flatten! s5-0 (-> *camera* tgt-rot-mat vector 2) (-> *camera* local-down)) (vector-normalize! s5-0 -1.0) (matrix-from-two-vectors-partial-linear! s4-0 gp-0 s5-0 0.2) ) diff --git a/goal_src/jak2/engine/camera/cam-update.gc b/goal_src/jak2/engine/camera/cam-update.gc index da56d7ef99..3b348c98d6 100644 --- a/goal_src/jak2/engine/camera/cam-update.gc +++ b/goal_src/jak2/engine/camera/cam-update.gc @@ -170,7 +170,7 @@ (when (= (-> s5-2 status) 'active) (cond ((or *artist-fix-visible* *stats-bsp*) - (set! (-> s5-2 render?) (zero? (logand *fix-visible-level-mask* (ash 1 (-> s5-2 index))))) + (set! (-> s5-2 render?) (not (logtest? *fix-visible-level-mask* (ash 1 (-> s5-2 index))))) (format *stdcon* "~0kleaf-index ~8S ~C = ~d node ~d ~S ~S~%" @@ -195,7 +195,7 @@ (set! (-> s5-2 render?) #t) ) ) - (when (and *artist-fix-visible* (zero? (logand *fix-visible-level-mask* (ash 1 (-> s5-2 index))))) + (when (and *artist-fix-visible* (not (logtest? *fix-visible-level-mask* (ash 1 (-> s5-2 index))))) (let ((s4-1 (-> s5-2 bsp current-leaf-idx)) (s3-0 (-> s5-2 bsp vis-spheres)) ) diff --git a/goal_src/jak2/engine/collide/collide-cache.gc b/goal_src/jak2/engine/collide/collide-cache.gc index 3d2dd46ed0..cdd699297a 100644 --- a/goal_src/jak2/engine/collide/collide-cache.gc +++ b/goal_src/jak2/engine/collide/collide-cache.gc @@ -87,7 +87,7 @@ (logtest? (-> arg0 flags) (water-flags can-ground)) (logtest? (-> arg0 flags) (water-flags swim-ground under-water)) (logtest? (water-flags over-water) (-> arg0 flags)) - (zero? (logand (water-flags jump-out) (-> arg0 flags))) + (not (logtest? (water-flags jump-out) (-> arg0 flags))) ) ) (return #f) @@ -484,8 +484,6 @@ ) ) -;; definition for method 19 of type collide-cache -;; WARN: Return type mismatch int vs none. (defmethod fill-from-fg-boxes collide-cache ((obj collide-cache)) (let ((s5-0 (-> obj collide-with))) (set! *actor-list-length* 0) @@ -571,27 +569,19 @@ 0 (none) ) -;; definition for method 10 of type collide-shape-prim + ;; WARN: Return type mismatch object vs none. (defmethod add-fg-prim-using-box collide-shape-prim ((obj collide-shape-prim) (arg0 collide-cache)) (format 0 "ERROR: Illegal collide-shape-prim type passed to collide-shape-prim::add-fg-prim-using-box!~%") (none) ) -;; definition for method 10 of type collide-shape-prim-mesh -;; ERROR: function was not converted to expressions. Cannot decompile. (defmethod-mips2c "(method 10 collide-shape-prim-mesh)" 10 collide-shape-prim-mesh) -;; definition for method 10 of type collide-shape-prim-sphere -;; ERROR: function was not converted to expressions. Cannot decompile. (defmethod-mips2c "(method 10 collide-shape-prim-sphere)" 10 collide-shape-prim-sphere) -;; definition for method 10 of type collide-shape-prim-group -;; ERROR: function was not converted to expressions. Cannot decompile. (defmethod-mips2c "(method 10 collide-shape-prim-group)" 10 collide-shape-prim-group) -;; definition for method 20 of type collide-cache -;; WARN: Return type mismatch int vs none. (defmethod fill-from-fg-line-sphere collide-cache ((obj collide-cache) (arg0 collide-query)) (local-vars (v1-9 float)) (rlet ((acc :class vf) @@ -719,7 +709,6 @@ ) ) -;; definition for method 11 of type collide-shape-prim ;; WARN: Return type mismatch object vs none. (defmethod add-fg-prim-using-line-sphere collide-shape-prim ((obj collide-shape-prim) (arg0 collide-cache) (arg1 object)) (format @@ -729,26 +718,17 @@ (none) ) -;; definition for method 11 of type collide-shape-prim-mesh -;; ERROR: function was not converted to expressions. Cannot decompile. (defmethod-mips2c "(method 11 collide-shape-prim-mesh)" 11 collide-shape-prim-mesh) -;; definition for method 11 of type collide-shape-prim-sphere -;; ERROR: function was not converted to expressions. Cannot decompile. (defmethod-mips2c "(method 11 collide-shape-prim-sphere)" 11 collide-shape-prim-sphere) -;; definition for method 11 of type collide-shape-prim-group -;; ERROR: function was not converted to expressions. Cannot decompile. (defmethod-mips2c "(method 11 collide-shape-prim-group)" 11 collide-shape-prim-group) - -;; definition for method 10 of type collide-cache (defmethod fill-and-probe-using-line-sphere collide-cache ((obj collide-cache) (arg0 collide-query)) (fill-using-line-sphere obj arg0) (probe-using-line-sphere obj arg0) ) -;; definition of type collide-puls-work (deftype collide-puls-work (structure) ((ignore-pat pat-surface :offset-assert 0) (bsphere sphere :inline :offset-assert 16) @@ -759,7 +739,7 @@ :flag-assert #x900000030 ) -;; definition for method 16 of type collide-cache + (defmethod probe-using-line-sphere collide-cache ((obj collide-cache) (arg0 collide-query)) (rlet ((vf0 :class vf) (vf2 :class vf) @@ -830,7 +810,6 @@ ) ) -;; definition of type lsmi-work (deftype lsmi-work (structure) ((best-u float :offset-assert 0) (orig-best-u float :offset-assert 4) @@ -842,23 +821,16 @@ :flag-assert #x90000022c ) -;; definition for method 9 of type collide-cache-prim -;; ERROR: function was not converted to expressions. Cannot decompile. + (defmethod-mips2c "(method 9 collide-cache-prim)" 9 collide-cache-prim) - -;; definition for method 10 of type collide-cache-prim -;; ERROR: function was not converted to expressions. Cannot decompile. (defmethod-mips2c "(method 10 collide-cache-prim)" 10 collide-cache-prim) - -;; definition for method 11 of type collide-cache (defmethod fill-and-probe-using-spheres collide-cache ((obj collide-cache) (arg0 collide-query)) (fill-using-spheres obj arg0) (probe-using-spheres obj arg0) ) -;; definition for method 14 of type collide-cache (defmethod fill-using-spheres collide-cache ((obj collide-cache) (arg0 collide-query)) (new 'stack-no-clear 'bounding-box) (set-from-spheres! @@ -870,16 +842,10 @@ (none) ) -;; definition for method 17 of type collide-cache -;; ERROR: function was not converted to expressions. Cannot decompile. (defmethod-mips2c "(method 17 collide-cache)" 17 collide-cache) -;; definition for method 9 of type collide-puss-work -;; ERROR: function was not converted to expressions. Cannot decompile. (defmethod-mips2c "(method 9 collide-puss-work)" 9 collide-puss-work) -;; definition for method 10 of type collide-puss-work -;; ERROR: function was not converted to expressions. Cannot decompile. (defmethod-mips2c "(method 10 collide-puss-work)" 10 collide-puss-work) diff --git a/goal_src/jak2/engine/collide/collide-debug.gc b/goal_src/jak2/engine/collide/collide-debug.gc index acdbbc5f15..41e85967a7 100644 --- a/goal_src/jak2/engine/collide/collide-debug.gc +++ b/goal_src/jak2/engine/collide/collide-debug.gc @@ -7,10 +7,9 @@ ;; DECOMP BEGINS +;; this file is debug only (declare-file (debug)) -;; definition for method 9 of type collide-cache -;; WARN: Return type mismatch int vs none. (defmethod debug-draw collide-cache ((obj collide-cache)) (let ((gp-0 (the-as object (-> obj tris)))) (countdown (s4-0 (-> obj num-tris)) @@ -58,7 +57,6 @@ (none) ) -;; definition of type col-rend-filter (deftype col-rend-filter (structure) ((show-pat-set pat-surface :offset-assert 0) (show-pat-clear pat-surface :offset-assert 4) @@ -69,22 +67,7 @@ :flag-assert #x90000000c ) -;; definition for method 3 of type col-rend-filter -(defmethod inspect col-rend-filter ((obj col-rend-filter)) - (when (not obj) - (set! obj obj) - (goto cfg-4) - ) - (format #t "[~8x] ~A~%" obj 'col-rend-filter) - (format #t "~1Tshow-pat-set: ~D~%" (-> obj show-pat-set)) - (format #t "~1Tshow-pat-clear: ~D~%" (-> obj show-pat-clear)) - (format #t "~1Tevent-mask: ~D~%" (-> obj event-mask)) - (label cfg-4) - obj - ) -;; definition for function col-rend-draw -;; INFO: Used lq/sq ;; WARN: Return type mismatch symbol vs none. (defun col-rend-draw ((arg0 col-rend) (arg1 col-rend-filter)) (let ((s4-0 (new 'stack-no-clear 'matrix))) @@ -98,7 +81,7 @@ (let ((v1-9 (-> s3-1 pat))) (cond ((and (or (zero? (-> arg1 show-pat-set)) (logtest? v1-9 (-> arg1 show-pat-set))) - (or (zero? (-> arg1 show-pat-clear)) (zero? (logand v1-9 (-> arg1 show-pat-clear)))) + (or (zero? (-> arg1 show-pat-clear)) (not (logtest? v1-9 (-> arg1 show-pat-clear)))) (or (zero? (-> arg1 event-mask)) (logtest? (-> arg1 event-mask) (ash 1 (-> v1-9 event)))) ) (let ((t1-0 (copy-and-set-field (-> *pat-mode-info* (-> v1-9 mode) color) a 64))) @@ -167,7 +150,7 @@ (when (= (-> (the-as collide-cache-prim s5-1) prim-core prim-type) (prim-type sphere)) (let ((v1-37 (-> (the-as collide-shape-prim-sphere (-> (the-as collide-cache-prim s5-1) prim)) pat))) (when (and (or (zero? (-> arg1 show-pat-set)) (logtest? v1-37 (-> arg1 show-pat-set))) - (or (zero? (-> arg1 show-pat-clear)) (zero? (logand v1-37 (-> arg1 show-pat-clear)))) + (or (zero? (-> arg1 show-pat-clear)) (not (logtest? v1-37 (-> arg1 show-pat-clear)))) (or (zero? (-> arg1 event-mask)) (logtest? (-> arg1 event-mask) (ash 1 (-> v1-37 event)))) ) (let ((t0-5 (copy-and-set-field (-> *pat-mode-info* (-> v1-37 mode) color) a 64))) @@ -188,8 +171,6 @@ (none) ) -;; definition for method 9 of type col-rend -;; INFO: Used lq/sq (defmethod col-rend-method-9 col-rend ((obj col-rend)) (with-pp (let ((s5-0 (new 'stack-no-clear 'collide-query))) @@ -312,6 +293,3 @@ (none) ) ) - - - diff --git a/goal_src/jak2/engine/collide/collide-shape.gc b/goal_src/jak2/engine/collide/collide-shape.gc index 5cf9dfb13a..a5c8830fdc 100644 --- a/goal_src/jak2/engine/collide/collide-shape.gc +++ b/goal_src/jak2/engine/collide/collide-shape.gc @@ -875,7 +875,7 @@ it returns a triangle and normal direction to push in. ) ) ) - (if (and a0-14 (zero? (logand (focus-status rail) (-> (the-as process-focusable a0-14) focus-status)))) + (if (and a0-14 (not (logtest? (focus-status rail) (-> (the-as process-focusable a0-14) focus-status)))) (set! (-> obj surf) *rail-surface*) ) ) @@ -921,7 +921,7 @@ it returns a triangle and normal direction to push in. (target-attack-up (the-as target (-> obj process)) 'attack-or-shove 'shockup) ) (((pat-event burnup)) - (when (not (logtest? (focus-status pilot) (-> (the-as process-focusable (-> obj process)) focus-status))) + (when (not (focus-test? (the-as process-focusable (-> obj process)) pilot)) (set! s5-0 (logior s5-0 #x4000)) (target-attack-up (the-as target (-> obj process)) 'attack-or-shove 'burnup) ) @@ -1112,7 +1112,7 @@ it returns a triangle and normal direction to push in. (set! (-> a1-1 quad) (-> arg3 quad)) ;; check for impact: (when (and (not (logtest? (-> arg0 prev-status) (collide-status on-surface))) - (zero? (logand (-> arg0 status) (collide-status touch-wall))) + (not (logtest? (-> arg0 status) (collide-status touch-wall))) ) ;; do "impact friction" (let ((f0-1 (- 1.0 (-> arg0 surf impact-fric)))) @@ -3174,10 +3174,9 @@ it returns a triangle and normal direction to push in. (.sub.vf vf6 vf4 vf5 :mask #b111) (.svf (&-> sv-176 quad) vf6) (vector-normalize! sv-176 1.0) - (when (and (< arg2 (-> sv-176 y)) - (and (not (logtest? (focus-status dead hit board mech) (-> (the-as process-focusable gp-0) focus-status))) - (< (-> (the-as process-focusable gp-0) root-override transv y) 4.096) - ) + (when (and (< arg2 (-> sv-176 y)) (and (not (focus-test? (the-as process-focusable gp-0) dead hit board mech)) + (< (-> (the-as process-focusable gp-0) root-override transv y) 4.096) + ) ) (let ((s2-1 (new 'stack-no-clear 'vector))) (set! (-> s2-1 quad) (-> (the-as process-focusable gp-0) root-override transv quad)) @@ -3251,7 +3250,3 @@ it returns a triangle and normal direction to push in. ) (the-as vector 0) ) - - - - diff --git a/goal_src/jak2/engine/collide/collide-touch.gc b/goal_src/jak2/engine/collide/collide-touch.gc index bb49b2f643..3ce04ee7ce 100644 --- a/goal_src/jak2/engine/collide/collide-touch.gc +++ b/goal_src/jak2/engine/collide/collide-touch.gc @@ -93,6 +93,7 @@ (none) ) +;; WARN: Return type mismatch object vs touching-shapes-entry. (defmethod get-shapes-entry touching-list ((obj touching-list) (shape1 collide-shape) (shape2 collide-shape)) (let ((entry (the-as touching-shapes-entry (-> obj touching-shapes)))) (let ((v1-0 (the-as touching-shapes-entry #f))) @@ -147,6 +148,8 @@ :flag-assert #x900000008 ) + +;; WARN: Function (method 9 touching-list) has a return type of none, but the expression builder found a return statement. (defmethod add-touching-prims touching-list ((obj touching-list) (arg0 collide-shape-prim) (arg1 collide-shape-prim) @@ -394,13 +397,14 @@ (the-as touching-prims-entry #f) ) +;; WARN: Return type mismatch touching-prims-entry vs basic. (defmethod prims-touching-action? touching-shapes-entry ((obj touching-shapes-entry) (arg0 collide-shape) (arg1 collide-action) (arg2 collide-action)) (cond ((= (-> obj cshape1) arg0) (let ((v1-1 (-> obj head))) (while v1-1 (let ((a0-1 (-> v1-1 prim1 cprim))) - (if (and (logtest? arg1 (-> a0-1 prim-core action)) (zero? (logand arg2 (-> a0-1 prim-core action)))) + (if (and (logtest? arg1 (-> a0-1 prim-core action)) (not (logtest? arg2 (-> a0-1 prim-core action)))) (return (the-as basic v1-1)) ) ) @@ -412,7 +416,7 @@ (let ((v1-4 (-> obj head))) (while v1-4 (let ((a0-5 (-> v1-4 prim2 cprim))) - (if (and (logtest? arg1 (-> a0-5 prim-core action)) (zero? (logand arg2 (-> a0-5 prim-core action)))) + (if (and (logtest? arg1 (-> a0-5 prim-core action)) (not (logtest? arg2 (-> a0-5 prim-core action)))) (return (the-as basic v1-4)) ) ) @@ -504,7 +508,3 @@ ) arg0 ) - - - - diff --git a/goal_src/jak2/engine/collide/find-nearest.gc b/goal_src/jak2/engine/collide/find-nearest.gc index 182075a310..dcfcec646b 100644 --- a/goal_src/jak2/engine/collide/find-nearest.gc +++ b/goal_src/jak2/engine/collide/find-nearest.gc @@ -53,7 +53,7 @@ (lambda ((arg0 process-drawable)) (with-pp (when (and (logtest? (process-mask crate enemy collectable guard) (-> arg0 mask)) - (zero? (logand (process-mask no-track) (-> arg0 mask))) + (not (logtest? (process-mask no-track) (-> arg0 mask))) ) (let* ((gp-0 *search-info*) (s4-0 arg0) @@ -85,7 +85,7 @@ (if (and (type? s2-0 process-focusable) s2-0 s2-0 - (zero? (logand (-> (the-as process-focusable s2-0) focus-status) (focus-status disable dead))) + (not (logtest? (-> (the-as process-focusable s2-0) focus-status) (focus-status disable dead))) ) (set! s4-2 (get-trans (the-as process-focusable s2-0) 3)) ) @@ -259,9 +259,9 @@ ) ) ) - (when (and (and s3-0 (zero? (logand (-> (the-as process-focusable s3-0) focus-status) (focus-status disable dead)))) + (when (and (and s3-0 (not (logtest? (-> (the-as process-focusable s3-0) focus-status) (focus-status disable dead)))) (and (logtest? (process-mask crate enemy collectable guard) (-> s3-0 mask)) - (zero? (logand (process-mask no-track) (-> s3-0 mask))) + (not (logtest? (process-mask no-track) (-> s3-0 mask))) ) ) (let* ((s2-1 (get-trans (the-as process-focusable s3-0) 3)) @@ -395,8 +395,3 @@ ) ) ) - - - - - diff --git a/goal_src/jak2/engine/common_objs/base-plat.gc b/goal_src/jak2/engine/common_objs/base-plat.gc index 4067f8f336..7fc3ebdd2e 100644 --- a/goal_src/jak2/engine/common_objs/base-plat.gc +++ b/goal_src/jak2/engine/common_objs/base-plat.gc @@ -226,7 +226,7 @@ eco-door-event-handler (when (and *target* (and (>= (-> self open-distance) (vector-vector-distance (-> self root-override trans) (-> *target* control trans)) ) - (zero? (logand (focus-status teleporting) (-> *target* focus-status))) + (not (logtest? (focus-status teleporting) (-> *target* focus-status))) ) ) (lock-according-to-task! self) @@ -296,7 +296,7 @@ eco-door-event-handler (or (not *target*) (or (< (-> self close-distance) (vector-vector-distance (-> self root-override trans) (-> *target* control trans)) ) - (logtest? (focus-status teleporting) (-> *target* focus-status)) + (focus-test? *target* teleporting) ) ) ) diff --git a/goal_src/jak2/engine/common_objs/collectables.gc b/goal_src/jak2/engine/common_objs/collectables.gc index 10ca55ef4e..6c35fb1f2d 100644 --- a/goal_src/jak2/engine/common_objs/collectables.gc +++ b/goal_src/jak2/engine/common_objs/collectables.gc @@ -647,7 +647,7 @@ ) ) ((and arg2 (and (< (+ 4096.0 (-> *FACT-bank* suck-bounce-dist)) f0-0) - (zero? (logand (-> self flags) (collectable-flag suck-in))) + (not (logtest? (-> self flags) (collectable-flag suck-in))) ) ) (go-virtual wait) @@ -884,7 +884,7 @@ (if (and (logtest? (-> self fact options) (actor-option suck-in)) (not (and (-> self next-state) (= (-> self next-state name) 'pickup))) *target* - (zero? (logand (-> *target* focus-status) (focus-status dead))) + (not (logtest? (-> *target* focus-status) (focus-status dead))) ) (go-virtual suck (process->handle *target*)) ) @@ -919,7 +919,7 @@ ) (else (if (and (logtest? (-> self fact options) (actor-option suck-in)) - (zero? (logand (-> self flags) (collectable-flag no-eco-blue))) + (not (logtest? (-> self flags) (collectable-flag no-eco-blue))) ) (go-virtual notice-blue (process->handle *target*)) ) @@ -1025,7 +1025,7 @@ ) (or (or (not *target*) (or (< 204800.0 (vector-vector-distance (-> self root-override2 trans) (-> *target* control trans))) - (logtest? (focus-status teleporting) (-> *target* focus-status)) + (focus-test? *target* teleporting) ) ) (logtest? (-> self flags) (collectable-flag no-distance-check-fadeout)) @@ -1119,7 +1119,7 @@ (set! (-> a1-0 message) 'query) (set! (-> a1-0 param 0) (the-as uint 'powerup)) (set! (-> a1-0 param 1) (the-as uint 3)) - (if (and (not (send-event-function *target* a1-0)) (zero? (logand (-> self flags) (collectable-flag suck-in)))) + (if (and (not (send-event-function *target* a1-0)) (not (logtest? (-> self flags) (collectable-flag suck-in)))) (go-virtual wait) ) ) @@ -1412,10 +1412,10 @@ This commonly includes things such as: :trans (behavior () (if (and (and *target* (and (>= 32768.0 (vector-vector-distance (-> self root-override2 trans) (-> *target* control trans))) - (zero? (logand (focus-status teleporting) (-> *target* focus-status))) + (not (logtest? (focus-status teleporting) (-> *target* focus-status))) ) ) - (and (not (logtest? (-> *target* focus-status) (focus-status dead hit))) + (and (not (focus-test? *target* dead hit)) (case (-> self fact pickup-type) (((pickup-type eco-pill-dark)) (< (-> *game-info* eco-pill-dark) (-> *FACT-bank* eco-pill-dark-max-default)) diff --git a/goal_src/jak2/engine/common_objs/crates.gc b/goal_src/jak2/engine/common_objs/crates.gc index 2544898609..f5048af7e4 100644 --- a/goal_src/jak2/engine/common_objs/crates.gc +++ b/goal_src/jak2/engine/common_objs/crates.gc @@ -459,7 +459,7 @@ (defbehavior crate-standard-event-handler crate ((arg0 process) (arg1 int) (arg2 symbol) (arg3 event-message-block)) (case arg2 (('track) - (zero? (logand (actor-option no-track) (-> self fact options))) + (not (logtest? (actor-option no-track) (-> self fact options))) ) (('attack) (let* ((v1-3 (the-as attack-info (-> arg3 param 1))) @@ -472,7 +472,7 @@ (('flop 'uppercut 'explode 'eco-yellow 'racer 'board 'tube 'flut-bonk 'flut-attack 'darkjak 'mech-punch) (if (and (logtest? (-> self fact options) (actor-option racer-only)) (= (-> arg0 type) target) - (zero? (logand (focus-status pilot) (-> (the-as target arg0) focus-status))) + (not (logtest? (focus-status pilot) (-> (the-as target arg0) focus-status))) ) (return #f) ) @@ -642,7 +642,7 @@ ) (and *target* (and (>= 40960.0 (vector-vector-distance (-> self root-override2 trans) (-> *target* control trans))) - (zero? (logand (focus-status teleporting) (-> *target* focus-status))) + (not (logtest? (focus-status teleporting) (-> *target* focus-status))) ) ) ) @@ -918,10 +918,7 @@ (stop! (-> self sound)) ) (let ((v1-10 (handle->process (-> self target)))) - (if (and (and v1-10 - (= (-> v1-10 type) target) - (logtest? (focus-status flut tube board pilot) (-> (the-as process-focusable v1-10) focus-status)) - ) + (if (and (and v1-10 (= (-> v1-10 type) target) (focus-test? (the-as process-focusable v1-10) flut tube board pilot)) (and (!= (-> self fact pickup-type) 10) (not arg0)) ) (logior! (-> self fact options) (actor-option suck-in)) diff --git a/goal_src/jak2/engine/common_objs/elevator.gc b/goal_src/jak2/engine/common_objs/elevator.gc index 34248f60fd..606723228e 100644 --- a/goal_src/jak2/engine/common_objs/elevator.gc +++ b/goal_src/jak2/engine/common_objs/elevator.gc @@ -492,10 +492,10 @@ do so. (local-vars (zero float)) (let ((target *target*)) (when (and target - (zero? (logand (focus-status dead inactive in-air grabbed edge-grab pole pilot-riding pilot teleporting) + (not (logtest? (focus-status dead inactive in-air grabbed edge-grab pole pilot-riding pilot teleporting) (-> target focus-status) ) - ) + ) ) (set! zero (the-as float 0.0)) (when (and (find-closest-point-in-path! obj (get-trans target 0) (& zero) #t #t) (!= (-> obj move-pos 1) zero)) @@ -572,7 +572,7 @@ do so. (set! (-> self ride-timer) (-> self clock frame-counter)) (-> self params) (if (and (logtest? (-> self params flags) (elevator-flags elevator-flags-0)) - (zero? (logand (-> self params flags) (elevator-flags elevator-flags-3))) + (not (logtest? (-> self params flags) (elevator-flags elevator-flags-3))) ) (move-to-next-point! self) ) @@ -732,7 +732,7 @@ do so. :trans (behavior () (if (and (< (- (-> self ride-timer) (-> self sticky-player-last-ride-time)) (seconds 2)) (begin *target* *target*) - (logtest? (-> *target* focus-status) (focus-status in-air)) + (focus-test? *target* in-air) ) (set! (-> self ride-timer) (-> self clock frame-counter)) ) diff --git a/goal_src/jak2/engine/common_objs/generic-obs.gc b/goal_src/jak2/engine/common_objs/generic-obs.gc index 0d7c430474..38a1a99c66 100644 --- a/goal_src/jak2/engine/common_objs/generic-obs.gc +++ b/goal_src/jak2/engine/common_objs/generic-obs.gc @@ -228,7 +228,7 @@ ) ) ) - (and a0-7 (logtest? (-> (the-as process-focusable a0-7) focus-status) (focus-status pole))) + (and a0-7 (focus-test? (the-as process-focusable a0-7) pole)) ) (move-along-path self) (suspend) @@ -1653,7 +1653,7 @@ This commonly includes things such as: ) ) ) - (the-as symbol (if (and a0-2 (logtest? (-> a0-2 focus-status) (focus-status grabbed))) + (the-as symbol (if (and a0-2 (focus-test? a0-2 grabbed)) (send-event a0-2 'end-mode) #t ) @@ -2372,7 +2372,7 @@ This commonly includes things such as: (when (and *target* (and (>= (-> self active-distance) (vector-vector-distance (-> self root-override trans) (-> *target* control trans)) ) - (zero? (logand (focus-status teleporting) (-> *target* focus-status))) + (not (logtest? (focus-status teleporting) (-> *target* focus-status))) ) ) (cond @@ -2389,7 +2389,7 @@ This commonly includes things such as: ) (if (and (and *target* (and (>= 32768.0 (vector-vector-distance (-> self root-override trans) (-> *target* control trans))) - (zero? (logand (focus-status teleporting) (-> *target* focus-status))) + (not (logtest? (focus-status teleporting) (-> *target* focus-status))) ) ) (not (send-event *target* 'query 'powerup (pickup-type eco-blue))) @@ -2436,7 +2436,7 @@ This commonly includes things such as: (if (or (or (not *target*) (or (< (-> self active-distance) (vector-vector-distance (-> self root-override trans) (-> *target* control trans)) ) - (logtest? (focus-status teleporting) (-> *target* focus-status)) + (focus-test? *target* teleporting) ) ) (not (send-event *target* 'query 'powerup (pickup-type eco-blue))) @@ -2448,7 +2448,7 @@ This commonly includes things such as: (if (and (and *target* (and (>= (+ 2867.2 (-> self root-override root-prim prim-core world-sphere w)) (vector-vector-distance (-> self root-override trans) (-> *target* control trans)) ) - (zero? (logand (focus-status teleporting) (-> *target* focus-status))) + (not (logtest? (focus-status teleporting) (-> *target* focus-status))) ) ) (< (- (-> self clock frame-counter) (-> self state-time)) (seconds 0.5)) diff --git a/goal_src/jak2/engine/common_objs/plat.gc b/goal_src/jak2/engine/common_objs/plat.gc index 7bf7e4f7b5..73d348a2ae 100644 --- a/goal_src/jak2/engine/common_objs/plat.gc +++ b/goal_src/jak2/engine/common_objs/plat.gc @@ -256,7 +256,7 @@ This commonly includes things such as: ) ) (cond - ((and proc-focus (logtest? (-> proc-focus focus-status) (focus-status edge-grab))) + ((and proc-focus (focus-test? proc-focus edge-grab)) (set! (-> self safe-time) (+ (-> self clock frame-counter) (seconds 0.2))) (return (the-as object #f)) ) diff --git a/goal_src/jak2/engine/common_objs/powerups.gc b/goal_src/jak2/engine/common_objs/powerups.gc index 5d4c57df0d..bf7bd42052 100644 --- a/goal_src/jak2/engine/common_objs/powerups.gc +++ b/goal_src/jak2/engine/common_objs/powerups.gc @@ -7,8 +7,6 @@ ;; DECOMP BEGINS -;; definition for function cloud-track -;; INFO: Used lq/sq ;; WARN: Return type mismatch symbol vs none. ;; WARN: new jak 2 until loop case, check carefully (defbehavior cloud-track process ((arg0 process-tree) @@ -70,7 +68,6 @@ (none) ) -;; failed to figure out what this is: (defpart 539 :init-specs ((sp-tex spt-texture (new 'static 'texture-id :index #x29 :page #xc)) (sp-rnd-flt spt-num 1.0 1.0 1.0) @@ -89,7 +86,6 @@ ) ) -;; failed to figure out what this is: (defpart 540 :init-specs ((sp-tex spt-texture (new 'static 'texture-id :page #xc)) (sp-rnd-flt spt-num 1.0 1.0 1.0) @@ -108,7 +104,6 @@ ) ) -;; failed to figure out what this is: (defpart 541 :init-specs ((sp-tex spt-texture (new 'static 'texture-id :index #x9b :page #xb)) (sp-rnd-flt spt-num 1.0 3.0 1.0) @@ -128,7 +123,6 @@ ) ) -;; failed to figure out what this is: (defpart 543 :init-specs ((sp-tex spt-texture (new 'static 'texture-id :index #x9b :page #xb)) (sp-rnd-flt spt-num 0.0 3.0 1.0) @@ -148,7 +142,6 @@ ) ) -;; failed to figure out what this is: (defpart 542 :init-specs ((sp-flt spt-r 64.0) (sp-flt spt-g 64.0) @@ -158,7 +151,6 @@ ) ) -;; failed to figure out what this is: (defpart 544 :init-specs ((sp-tex spt-texture (new 'static 'texture-id :index #x29 :page #xc)) (sp-flt spt-num 1.0) @@ -177,7 +169,6 @@ ) ) -;; failed to figure out what this is: (defpartgroup group-blue-hit-ground-effect :id 123 :duration (seconds 0.017) @@ -186,7 +177,6 @@ :parts ((sp-item 545) (sp-item 546) (sp-item 547 :flags (is-3d)) (sp-item 548) (sp-item 549 :flags (is-3d))) ) -;; failed to figure out what this is: (defpart 548 :init-specs ((sp-tex spt-texture (new 'static 'texture-id :index #x29 :page #xc)) (sp-flt spt-num 32.0) @@ -210,7 +200,6 @@ ) ) -;; failed to figure out what this is: (defpart 550 :init-specs ((sp-flt spt-r 0.0) (sp-rnd-flt spt-g 32.0 32.0 1.0) @@ -221,7 +210,6 @@ ) ) -;; failed to figure out what this is: (defpart 549 :init-specs ((sp-tex spt-texture (new 'static 'texture-id :index #x2c :page #xc)) (sp-flt spt-num 1.0) @@ -241,12 +229,10 @@ ) ) -;; failed to figure out what this is: (defpart 551 :init-specs ((sp-flt spt-fade-a -2.1333334)) ) -;; failed to figure out what this is: (defpart 547 :init-specs ((sp-tex spt-texture (new 'static 'texture-id :index #x26 :page #xc)) (sp-flt spt-num 1.0) @@ -267,12 +253,10 @@ ) ) -;; failed to figure out what this is: (defpart 552 :init-specs ((sp-flt spt-fade-a -1.4222223)) ) -;; failed to figure out what this is: (defpart 545 :init-specs ((sp-tex spt-texture (new 'static 'texture-id :page #xc)) (sp-flt spt-num 32.0) @@ -297,7 +281,6 @@ ) ) -;; failed to figure out what this is: (defpart 546 :init-specs ((sp-tex spt-texture (new 'static 'texture-id :page #xc)) (sp-flt spt-num 12.0) @@ -322,7 +305,6 @@ ) ) -;; failed to figure out what this is: (defpart 553 :init-specs ((sp-tex spt-texture (new 'static 'texture-id :index #x29 :page #xc)) (sp-rnd-flt spt-num 1.0 1.0 1.0) @@ -341,7 +323,6 @@ ) ) -;; failed to figure out what this is: (defpart 554 :init-specs ((sp-tex spt-texture (new 'static 'texture-id :page #xc)) (sp-rnd-flt spt-num 1.0 1.0 1.0) @@ -360,7 +341,6 @@ ) ) -;; failed to figure out what this is: (defpart 555 :init-specs ((sp-tex spt-texture (new 'static 'texture-id :index #xc9 :page #xc)) (sp-rnd-flt spt-num 0.5 2.0 1.0) @@ -388,12 +368,10 @@ ) ) -;; failed to figure out what this is: (defpart 556 :init-specs ((sp-flt spt-fade-r 0.0)) ) -;; failed to figure out what this is: (defpart 557 :init-specs ((sp-tex spt-texture (new 'static 'texture-id :index #x29 :page #xc)) (sp-rnd-flt spt-num 1.0 1.0 1.0) @@ -412,7 +390,6 @@ ) ) -;; failed to figure out what this is: (defpart 558 :init-specs ((sp-tex spt-texture (new 'static 'texture-id :page #xc)) (sp-rnd-flt spt-num 1.0 1.0 1.0) @@ -431,7 +408,6 @@ ) ) -;; failed to figure out what this is: (defpart 559 :init-specs ((sp-tex spt-texture (new 'static 'texture-id :index #xc9 :page #xc)) (sp-rnd-flt spt-num 0.5 2.0 1.0) @@ -459,12 +435,10 @@ ) ) -;; failed to figure out what this is: (defpart 560 :init-specs ((sp-flt spt-fade-r 0.0)) ) -;; failed to figure out what this is: (defpart 561 :init-specs ((sp-tex spt-texture (new 'static 'texture-id :index #x29 :page #xc)) (sp-rnd-flt spt-num 1.0 1.0 1.0) @@ -483,7 +457,6 @@ ) ) -;; failed to figure out what this is: (defpart 562 :init-specs ((sp-tex spt-texture (new 'static 'texture-id :page #xc)) (sp-rnd-flt spt-num 1.0 1.0 1.0) @@ -502,7 +475,6 @@ ) ) -;; failed to figure out what this is: (defpart 563 :init-specs ((sp-tex spt-texture (new 'static 'texture-id :index #xc9 :page #xc)) (sp-rnd-flt spt-num 0.5 2.0 1.0) @@ -530,14 +502,10 @@ ) ) -;; failed to figure out what this is: (defpart 564 :init-specs ((sp-flt spt-fade-g 0.0)) ) -;; definition for function eco-blue-glow -;; INFO: Used lq/sq -;; WARN: Return type mismatch int vs none. (defun eco-blue-glow ((arg0 vector)) (let ((t9-0 sp-launch-particles-var) (a0-1 *sp-particle-system-2d*) @@ -561,9 +529,6 @@ (none) ) -;; definition for function target-eco-process -;; INFO: Used lq/sq -;; WARN: Return type mismatch int vs none. (defbehavior target-eco-process target () (when (and (!= (-> (the-as fact-info-target (-> self fact-override)) eco-level) 0.0) (>= (- (-> *display* game-clock frame-counter) @@ -582,7 +547,7 @@ (set! (-> self game eco-pill-dark) (-> *FACT-bank* eco-pill-dark-max-default)) ) (when (and (< 0.0 (-> (the-as fact-info-target (-> self fact-override)) eco-level)) - (not (logtest? (-> self focus-status) (focus-status in-head))) + (not (focus-test? self in-head)) (not (logtest? (-> self draw status) (draw-control-status no-draw no-draw-temp))) (not (movie?)) (rand-vu-percent? (lerp-scale @@ -679,7 +644,7 @@ (let ((v1-99 (rand-vu-int-range 3 (+ (-> self node-list length) -1)))) (cond ((and (logtest? (-> self control mod-surface flags) (surface-flag air)) - (zero? (logand (-> self control status) (collide-status on-surface))) + (not (logtest? (-> self control status) (collide-status on-surface))) ) (set! (-> *part-id-table* 543 init-specs 4 initial-valuef) 0.0) (set! (-> *part-id-table* 543 init-specs 4 random-rangef) 65536.0) @@ -782,9 +747,6 @@ (none) ) -;; definition for function target-color-effect-process -;; INFO: Used lq/sq -;; WARN: Return type mismatch int vs none. (defbehavior target-color-effect-process target () (when (and (-> self color-effect) (>= (- (-> self clock frame-counter) (-> self color-effect-start-time)) (the-as time-frame (-> self color-effect-duration)) @@ -889,12 +851,9 @@ (none) ) -;; definition for function target-powerup-process -;; INFO: Used lq/sq -;; WARN: Return type mismatch int vs none. (defbehavior target-powerup-process target () (let ((f30-0 (-> self control collision-spheres 0 prim-core world-sphere w))) - (if (logtest? (focus-status board) (-> self focus-status)) + (if (focus-test? self board) (set! (-> self control collision-spheres 0 prim-core world-sphere w) (+ 4096.0 (-> self control collision-spheres 0 prim-core world-sphere w)) ) @@ -903,7 +862,7 @@ (set! (-> self control collision-spheres 0 prim-core world-sphere w) f30-0) ) (if (and (logtest? (-> self water flags) (water-flags under-water)) - (zero? (logand (-> self water flags) (water-flags swim-ground))) + (not (logtest? (-> self water flags) (water-flags swim-ground))) ) (set! (-> self control unknown-time-frame26) (-> self clock frame-counter)) (set! (-> self control unknown-time-frame27) (-> self clock frame-counter)) @@ -1105,7 +1064,7 @@ (('sewer 'forest) (let ((f30-2 (-> self board camera-interp))) (cond - ((logtest? (focus-status board) (-> self focus-status)) + ((focus-test? self board) (seek! (-> self board camera-interp) 1.0 (* 0.1 (-> self clock seconds-per-frame))) ) ((< (-> self control ctrl-xz-vel) 2048.0) @@ -1135,7 +1094,7 @@ ) ) (logclear! (-> self focus-status) (focus-status super)) - (if (or (logtest? (-> self focus-status) (focus-status dead hit)) + (if (or (focus-test? self dead hit) (logtest? (state-flags sf2 tinvul1 sf5 tinvul2) (-> self state-flags)) (-> *setting-control* user-current ignore-target) ) @@ -1144,9 +1103,9 @@ ) (cond ((or (and (logtest? (-> self control mod-surface flags) (surface-flag air)) - (zero? (logand (-> self control status) (collide-status on-surface))) + (not (logtest? (-> self control status) (collide-status on-surface))) ) - (and (logtest? (focus-status board) (-> self focus-status)) + (and (focus-test? self board) (< (- (-> self clock frame-counter) (-> self board unknown-time-frame00)) (seconds 0.1)) ) ) @@ -1174,7 +1133,7 @@ (logclear! (-> self focus-status) (focus-status on-water)) ) (if (and (logtest? (-> self water flags) (water-flags under-water)) - (zero? (logand (-> self water flags) (water-flags swim-ground))) + (not (logtest? (-> self water flags) (water-flags swim-ground))) ) (logior! (-> self focus-status) (focus-status under-water)) (logclear! (-> self focus-status) (focus-status under-water)) @@ -1191,8 +1150,6 @@ (none) ) -;; definition for function target-powerup-effect -;; WARN: Return type mismatch int vs none. (defbehavior target-powerup-effect target ((arg0 symbol)) (case arg0 (('eco-blue) @@ -1205,8 +1162,6 @@ (none) ) -;; definition for function process-contact-action -;; WARN: Return type mismatch int vs none. (defbehavior process-contact-action target ((arg0 process)) (when (logtest? (-> *game-info* features) (game-feature unk-game-feature-01)) (if arg0 @@ -1217,7 +1172,3 @@ 0 (none) ) - - - - diff --git a/goal_src/jak2/engine/common_objs/rigid-body-plat.gc b/goal_src/jak2/engine/common_objs/rigid-body-plat.gc index 1ff4fd92ec..cae9118e7e 100644 --- a/goal_src/jak2/engine/common_objs/rigid-body-plat.gc +++ b/goal_src/jak2/engine/common_objs/rigid-body-plat.gc @@ -263,7 +263,7 @@ ) (when (and v1-11 (logtest? (-> v1-11 mask) (process-mask target)) - (zero? (logand (-> v1-11 focus-status) (focus-status on-water under-water))) + (not (logtest? (-> v1-11 focus-status) (focus-status on-water under-water))) ) (when (not (logtest? (-> obj flags) (rigid-body-object-flag player-impulse-force))) (logior! (-> obj flags) (rigid-body-object-flag player-contact-force)) diff --git a/goal_src/jak2/engine/common_objs/voicebox.gc b/goal_src/jak2/engine/common_objs/voicebox.gc index 28986f2579..255a71a67e 100644 --- a/goal_src/jak2/engine/common_objs/voicebox.gc +++ b/goal_src/jak2/engine/common_objs/voicebox.gc @@ -260,7 +260,7 @@ ) ) ) - (if (and a0-1 (logtest? (focus-status pilot) (-> a0-1 focus-status))) + (if (and a0-1 (focus-test? a0-1 pilot)) (send-event (ppointer->process (-> self parent-override)) 'set-dist @@ -472,9 +472,7 @@ ) ) ) - (when (and s4-0 - (begin (send-event s5-2 'change-mode 'board #f) (logtest? (focus-status board) (-> s5-2 focus-status))) - ) + (when (and s4-0 (begin (send-event s5-2 'change-mode 'board #f) (focus-test? s5-2 board))) (change-parent self (ppointer->process s4-0)) (try-update-focus (-> self focus) s5-2) (#when PC_PORT diff --git a/goal_src/jak2/engine/common_objs/water-anim.gc b/goal_src/jak2/engine/common_objs/water-anim.gc index 504e9e0cf2..71092ff787 100644 --- a/goal_src/jak2/engine/common_objs/water-anim.gc +++ b/goal_src/jak2/engine/common_objs/water-anim.gc @@ -353,7 +353,7 @@ (send-event (the-as process-tree gp-0) 'heat (* 10.0 (-> self clock seconds-per-frame))) ) (('drown-death 'lava 'dark-eco-pool) - (if (and (not (logtest? (focus-status board) (-> (the-as process-focusable gp-0) focus-status))) + (if (and (not (focus-test? (the-as process-focusable gp-0) board)) (let ((a1-10 (new 'stack-no-clear 'event-message-block))) (set! (-> a1-10 from) (process->ppointer self)) (set! (-> a1-10 num-params) 2) @@ -371,7 +371,7 @@ ) ) (else - (if (and (not (logtest? (focus-status board) (-> (the-as process-focusable gp-0) focus-status))) + (if (and (not (focus-test? (the-as process-focusable gp-0) board)) (let ((a1-13 (new 'stack-no-clear 'event-message-block))) (set! (-> a1-13 from) (process->ppointer self)) (set! (-> a1-13 num-params) 2) diff --git a/goal_src/jak2/engine/common_objs/water.gc b/goal_src/jak2/engine/common_objs/water.gc index 52f823ab59..e20d0383ed 100644 --- a/goal_src/jak2/engine/common_objs/water.gc +++ b/goal_src/jak2/engine/common_objs/water.gc @@ -787,7 +787,7 @@ (set! (-> obj drip-speed) 15.0) ) (if (and (not (logtest? (water-flags touch-water) (-> obj flags))) - (zero? (logand (-> obj process focus-status) (focus-status touch-water))) + (not (logtest? (-> obj process focus-status) (focus-status touch-water))) ) (enter-water obj) ) @@ -976,7 +976,7 @@ ) (if (and (logtest? (-> obj flags) (water-flags swim-ground)) (and v1-237 - (zero? (logand (-> (the-as collide-shape-moving (-> obj process control)) status) (collide-status on-water))) + (not (logtest? (-> (the-as collide-shape-moving (-> obj process control)) status) (collide-status on-water))) ) ) (set! (-> obj bob amp) (* 0.8 (-> obj bob amp))) @@ -1015,7 +1015,7 @@ (cond ((and (logtest? (-> obj flags) (water-flags swim-ground)) (logtest? (-> (the-as collide-shape-moving (-> obj process control)) status) (collide-status touch-surface)) - (zero? (logand (water-flags jump-out) (-> obj flags))) + (not (logtest? (water-flags jump-out) (-> obj flags))) ) (let ((v1-260 (new 'stack-no-clear 'vector))) (set! (-> v1-260 quad) (-> obj bottom 0 quad)) @@ -1023,7 +1023,7 @@ (let ((s3-3 (the-as collide-shape-moving (-> obj process control)))) (when (and (not (logtest? (-> s3-3 status) (collide-status touch-background))) (logtest? (water-flags swimming) (-> obj flags)) - (zero? (logand (focus-status board pilot) (-> obj process focus-status))) + (not (logtest? (focus-status board pilot) (-> obj process focus-status))) ) (let ((a1-42 (vector-! (new 'stack-no-clear 'vector) v1-260 (-> (the-as control-info s3-3) trans)))) (vector-float*! a1-42 a1-42 (-> pp clock frames-per-second)) @@ -1036,7 +1036,7 @@ ) ) ) - ((and (< (-> obj bottom 0 y) f30-1) (zero? (logand (water-flags jump-out) (-> obj flags)))) + ((and (< (-> obj bottom 0 y) f30-1) (not (logtest? (water-flags jump-out) (-> obj flags)))) (logior! (-> obj flags) (water-flags under-water)) ) ) @@ -1054,7 +1054,7 @@ (send-event (-> obj process) 'wade) (set! (-> obj flags) (logior (water-flags wading) (-> obj flags))) ) - ((and (< (-> obj bottom 0 y) f30-1) (zero? (logand (water-flags jump-out) (-> obj flags)))) + ((and (< (-> obj bottom 0 y) f30-1) (not (logtest? (water-flags jump-out) (-> obj flags)))) (logior! (-> obj flags) (water-flags under-water)) ) ) @@ -1085,7 +1085,7 @@ (when (and (logtest? (-> (the-as collide-shape-moving (-> obj process control)) status) (collide-status on-surface on-water) ) - (zero? (logand (focus-status board pilot) (-> obj process focus-status))) + (not (logtest? (focus-status board pilot) (-> obj process focus-status))) ) (when (< (-> obj process control trans y) (+ -1228.8 (-> obj base-height))) (send-event (-> obj process) 'no-look-around (seconds 1.5)) @@ -1569,7 +1569,7 @@ ) ) ) - (when (and a0-39 (zero? (logand (focus-status mech) (-> (the-as process-focusable a0-39) focus-status)))) + (when (and a0-39 (not (logtest? (focus-status mech) (-> (the-as process-focusable a0-39) focus-status)))) (set! (-> arg0 flags) (water-flags)) 0 ) @@ -1653,7 +1653,7 @@ (water-info<-region s3-0 (-> (scratchpad-object region-prim-area) region-prim-list items s2-1) obj arg1) (when (and (logtest? (-> s3-0 flags) (water-flags active)) (logtest? (water-flags touch-water) (-> s3-0 flags)) - (zero? (logand (-> s3-0 extra-flags) 1)) + (not (logtest? (-> s3-0 extra-flags) 1)) ) (mem-copy! (the-as pointer arg0) (the-as pointer s3-0) 60) (set! arg0 arg0) diff --git a/goal_src/jak2/engine/debug/default-menu.gc b/goal_src/jak2/engine/debug/default-menu.gc index f291343523..9411c1cc5b 100644 --- a/goal_src/jak2/engine/debug/default-menu.gc +++ b/goal_src/jak2/engine/debug/default-menu.gc @@ -1111,7 +1111,7 @@ (if (= arg1 (debug-menu-msg press)) (logxor! (-> v1-0 flags) (prototype-flags disable)) ) - (zero? (logand (-> v1-0 flags) (prototype-flags disable))) + (not (logtest? (-> v1-0 flags) (prototype-flags disable))) ) (else #f diff --git a/goal_src/jak2/engine/draw/drawable.gc b/goal_src/jak2/engine/draw/drawable.gc index 9182db88fd..9f18c9bee0 100644 --- a/goal_src/jak2/engine/draw/drawable.gc +++ b/goal_src/jak2/engine/draw/drawable.gc @@ -164,7 +164,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))) ) ) @@ -1026,7 +1026,7 @@ (when (and (nonzero? (-> dc shadow-ctrl)) (-> dc shadow-ctrl) (not (logtest? (-> dc shadow-ctrl settings flags) (shadow-flags disable-draw))) - (zero? (logand (-> dc shadow-ctrl settings flags) (shadow-flags shdf07))) + (not (logtest? (-> dc shadow-ctrl settings flags) (shadow-flags shdf07))) ) (let ((target-shadow-dir (new 'stack-no-clear 'vector)) (current-shadow-dir (-> dc shadow-ctrl settings shadow-dir)) @@ -1603,25 +1603,7 @@ (t1-2 (the-as object (-> t0-1 base))) ) (set! (-> (the-as gs-gif-tag t1-2) tag) (new 'static 'gif-tag64 :nloop #x1 :eop #x1 :nreg #x9)) - (set! (-> (the-as gs-gif-tag t1-2) regs) (new 'static 'gif-tag-regs - :regs0 (gif-reg-id a+d) - :regs1 (gif-reg-id a+d) - :regs2 (gif-reg-id a+d) - :regs3 (gif-reg-id a+d) - :regs4 (gif-reg-id a+d) - :regs5 (gif-reg-id a+d) - :regs6 (gif-reg-id a+d) - :regs7 (gif-reg-id a+d) - :regs8 (gif-reg-id a+d) - :regs9 (gif-reg-id a+d) - :regs10 (gif-reg-id a+d) - :regs11 (gif-reg-id a+d) - :regs12 (gif-reg-id a+d) - :regs13 (gif-reg-id a+d) - :regs14 (gif-reg-id a+d) - :regs15 (gif-reg-id a+d) - ) - ) + (set! (-> (the-as gs-gif-tag t1-2) regs) GIF_REGS_ALL_AD) (set! (-> t0-1 base) (&+ (the-as pointer t1-2) 16)) ) (let* ((t0-2 a0-8) @@ -1680,25 +1662,7 @@ (t1-2 (the-as object (-> t0-2 base))) ) (set! (-> (the-as gs-gif-tag t1-2) tag) (new 'static 'gif-tag64 :nloop #x1 :eop #x1 :nreg #x9)) - (set! (-> (the-as gs-gif-tag t1-2) regs) (new 'static 'gif-tag-regs - :regs0 (gif-reg-id a+d) - :regs1 (gif-reg-id a+d) - :regs2 (gif-reg-id a+d) - :regs3 (gif-reg-id a+d) - :regs4 (gif-reg-id a+d) - :regs5 (gif-reg-id a+d) - :regs6 (gif-reg-id a+d) - :regs7 (gif-reg-id a+d) - :regs8 (gif-reg-id a+d) - :regs9 (gif-reg-id a+d) - :regs10 (gif-reg-id a+d) - :regs11 (gif-reg-id a+d) - :regs12 (gif-reg-id a+d) - :regs13 (gif-reg-id a+d) - :regs14 (gif-reg-id a+d) - :regs15 (gif-reg-id a+d) - ) - ) + (set! (-> (the-as gs-gif-tag t1-2) regs) GIF_REGS_ALL_AD) (set! (-> t0-2 base) (&+ (the-as pointer t1-2) 16)) ) (let* ((t0-3 a3-2) @@ -2224,4 +2188,3 @@ (display-sync arg0) (none) ) - diff --git a/goal_src/jak2/engine/entity/actor-link-h.gc b/goal_src/jak2/engine/entity/actor-link-h.gc index a2c1c4e4f2..92fd711044 100644 --- a/goal_src/jak2/engine/entity/actor-link-h.gc +++ b/goal_src/jak2/engine/entity/actor-link-h.gc @@ -360,7 +360,7 @@ ) (dotimes (s3-0 s4-0) (let ((a0-3 (entity-actor-lookup (-> arg0 entity) 'alt-actor s3-0))) - (if (or (not a0-3) (zero? (logand (-> a0-3 extra perm status) (entity-perm-status subtask-complete)))) + (if (or (not a0-3) (not (logtest? (-> a0-3 extra perm status) (entity-perm-status subtask-complete)))) (+! gp-0 1) ) ) diff --git a/goal_src/jak2/engine/entity/entity.gc b/goal_src/jak2/engine/entity/entity.gc index 57cde65881..eb1ced078b 100644 --- a/goal_src/jak2/engine/entity/entity.gc +++ b/goal_src/jak2/engine/entity/entity.gc @@ -737,7 +737,7 @@ ) (defun update-actor-vis-box ((arg0 process-drawable) (arg1 vector) (arg2 vector)) - (when (and arg0 (nonzero? (-> arg0 draw)) (zero? (logand (-> arg0 draw status) (draw-control-status no-draw)))) + (when (and arg0 (nonzero? (-> arg0 draw)) (not (logtest? (-> arg0 draw status) (draw-control-status no-draw)))) (let ((v1-5 (-> arg0 draw origin)) (f0-0 (-> arg0 draw bounds w)) ) @@ -2144,7 +2144,7 @@ (dotimes (s2-0 s3-1) (let ((v1-54 (-> s4-2 data s2-0))) (cond - ((and (logtest? (-> v1-54 kill-mask) (task-mask special)) (zero? (logand (-> v1-54 kill-mask) sv-32))) + ((and (logtest? (-> v1-54 kill-mask) (task-mask special)) (not (logtest? (-> v1-54 kill-mask) sv-32))) (when (not (or (-> v1-54 process) (logtest? (-> v1-54 perm status) (entity-perm-status bit-0 dead)))) (birth! (-> v1-54 entity)) (set! sv-24 (+ sv-24 1)) @@ -2156,7 +2156,7 @@ (else (if (and (-> v1-54 process) (not (logtest? (-> v1-54 perm status) (entity-perm-status no-kill))) - (zero? (logand (-> v1-54 process mask) (process-mask no-kill))) + (not (logtest? (-> v1-54 process mask) (process-mask no-kill))) ) (kill! (-> v1-54 entity)) ) @@ -2185,7 +2185,7 @@ (else (if (and (-> v1-67 process) (not (logtest? (-> v1-67 perm status) (entity-perm-status no-kill))) - (zero? (logand (-> v1-67 process mask) (process-mask no-kill))) + (not (logtest? (-> v1-67 process mask) (process-mask no-kill))) ) (kill! (-> v1-67 entity)) ) @@ -2204,7 +2204,7 @@ (cond ((and (< (vector-vector-distance (-> s1-0 trans) sv-16) (-> *ACTOR-bank* birth-dist)) (not (logtest? (-> s1-0 perm status) (entity-perm-status bit-9 bit-10))) - (zero? (logand (-> s1-0 kill-mask) sv-32)) + (not (logtest? (-> s1-0 kill-mask) sv-32)) ) (when (not (or (-> s1-0 process) (logtest? (-> s1-0 perm status) (entity-perm-status bit-0 dead)))) (birth! (-> s1-0 entity)) @@ -2217,7 +2217,7 @@ (else (if (and (-> s1-0 process) (not (logtest? (-> s1-0 perm status) (entity-perm-status no-kill))) - (zero? (logand (-> s1-0 process mask) (process-mask no-kill))) + (not (logtest? (-> s1-0 process mask) (process-mask no-kill))) ) (kill! (-> s1-0 entity)) ) @@ -2263,7 +2263,7 @@ (else (when (and (-> sv-48 process) (not (logtest? (-> sv-48 perm status) (entity-perm-status no-kill))) - (zero? (logand (-> sv-48 process mask) (process-mask no-kill))) + (not (logtest? (-> sv-48 process mask) (process-mask no-kill))) ) (kill! (-> sv-48 entity)) (set! sv-24 (+ sv-24 1)) diff --git a/goal_src/jak2/engine/game/effect-control.gc b/goal_src/jak2/engine/game/effect-control.gc index ccdf0a872e..9ce41f8c65 100644 --- a/goal_src/jak2/engine/game/effect-control.gc +++ b/goal_src/jak2/engine/game/effect-control.gc @@ -103,10 +103,10 @@ ) (when v1-33 (cond - ((logtest? (-> v1-33 focus-status) (focus-status in-air)) + ((focus-test? v1-33 in-air) (set! (-> arg0 reg 0) (the-as uint 126)) ) - ((logtest? (-> v1-33 focus-status) (focus-status touch-water)) + ((focus-test? v1-33 touch-water) (set! (-> arg0 reg 0) (the-as uint 127)) ) (else @@ -1146,11 +1146,11 @@ (defbehavior target-land-effect target () (cond - ((logtest? (-> self focus-status) (focus-status flut)) + ((focus-test? self flut) (do-effect (-> self skel effect) 'effect-land-poof -1.0 -1) (do-effect (-> self skel effect) 'effect-flut-land -1.0 -1) ) - ((logtest? (focus-status pilot) (-> self focus-status)) + ((focus-test? self pilot) (sound-play-by-name (sound-name-with-material "zoom-land" (-> self control ground-pat) "") (new-sound-id) diff --git a/goal_src/jak2/engine/game/main.gc b/goal_src/jak2/engine/game/main.gc index f66aa1361a..d90d92ddb9 100644 --- a/goal_src/jak2/engine/game/main.gc +++ b/goal_src/jak2/engine/game/main.gc @@ -241,7 +241,7 @@ 'pause ) ;; not debugging, not pressing start, should pause if possible - ((and (not *debug-segment*) (zero? (logand (-> *cpad-list* cpads 0 button0-abs 0) (pad-buttons start)))) + ((and (not *debug-segment*) (not (logtest? (-> *cpad-list* cpads 0 button0-abs 0) (pad-buttons start)))) (if (pause-allowed?) 'pause *master-mode* ;; and if we can't, reject @@ -1224,7 +1224,7 @@ (cond ((and (= *kernel-boot-message* 'demo) (not *master-exit*)) (let ((v1-109 (level-get-target-inside *level*))) - (when (and v1-109 (!= (-> v1-109 name) 'demo) (zero? (logand (-> v1-109 info level-flags) 1))) + (when (and v1-109 (!= (-> v1-109 name) 'demo) (not (logtest? (-> v1-109 info level-flags) 1))) (persist-with-delay *setting-control* 'sfx-volume (seconds 0.5) 'sfx-volume 'abs 0.0 0) (persist-with-delay *setting-control* 'music-volume (seconds 0.5) 'music-volume 'abs 0.0 0) (persist-with-delay *setting-control* 'dialog-volume (seconds 0.5) 'dialog-volume 'abs 0.0 0) diff --git a/goal_src/jak2/engine/game/settings.gc b/goal_src/jak2/engine/game/settings.gc index 64255f924e..0ec6e3e61c 100644 --- a/goal_src/jak2/engine/game/settings.gc +++ b/goal_src/jak2/engine/game/settings.gc @@ -1269,7 +1269,7 @@ (let ((s4-1 (-> obj cam-target))) (set! (-> s5-1 entity-or-mode-changed) #f) (if (and (not (name= (-> s5-1 entity-name) (-> s4-1 entity-name))) - (or (not *target*) (zero? (logand (-> *target* focus-status) (-> s4-1 entity-mask)))) + (or (not *target*) (not (logtest? (-> *target* focus-status) (-> s4-1 entity-mask)))) ) (set! (-> s4-1 entity-or-mode-changed) #t) ) diff --git a/goal_src/jak2/engine/game/task/task-control.gc b/goal_src/jak2/engine/game/task/task-control.gc index f9bdd17c9d..9b6e5503b1 100644 --- a/goal_src/jak2/engine/game/task/task-control.gc +++ b/goal_src/jak2/engine/game/task/task-control.gc @@ -189,7 +189,6 @@ 0 ) - (defmethod level-method-22 level ((obj level) (arg0 symbol)) (if (= arg0 'none) (return 0) @@ -533,14 +532,14 @@ ) ) ) - (if (or (and *target* (logtest? (-> *target* focus-status) (focus-status dead)) mgr-status) (= mgr-status 'busy)) + (if (or (and *target* (focus-test? *target* dead) mgr-status) (= mgr-status 'busy)) (return (the-as int #f)) ) ) (when restart? (let ((gp-1 0)) (let ((cur-lev (level-get-target-inside *level*))) - (when (and cur-lev (zero? (logand (-> cur-lev info level-flags) 1))) + (when (and cur-lev (not (logtest? (-> cur-lev info level-flags) 1))) (let ((game-nodes (-> *game-info* sub-task-list))) (dotimes (i (-> game-nodes length)) (when (nonzero? i) @@ -619,7 +618,7 @@ (when (nonzero? i) (let ((node (-> game-nodes i))) (when (string= arg0 (-> node name)) - (let ((gp-2 (zero? (logand (-> node flags) (game-task-node-flag closed))))) + (let ((gp-2 (not (logtest? (-> node flags) (game-task-node-flag closed))))) (close! node 'event) (return gp-2) ) @@ -659,7 +658,7 @@ (begin (dotimes (a3-3 4) (when (and (nonzero? (-> node parent-node a3-3)) - (zero? (logand (-> game-nodes (-> node parent-node a3-3) flags) (game-task-node-flag closed))) + (not (logtest? (-> game-nodes (-> node parent-node a3-3) flags) (game-task-node-flag closed))) ) (set! a3-4 #f) (goto cfg-14) @@ -820,7 +819,7 @@ (begin (dotimes (ii 4) (when (and (nonzero? (-> node parent-node ii)) - (zero? (logand (-> game-nodes (-> node parent-node ii) flags) (game-task-node-flag closed))) + (not (logtest? (-> game-nodes (-> node parent-node ii) flags) (game-task-node-flag closed))) ) (set! v1-19 #t) (goto cfg-17) @@ -858,7 +857,7 @@ (begin (dotimes (pi 4) (let ((t0-0 (-> node-info parent-node pi))) - (when (and (nonzero? t0-0) (zero? (logand (-> game-nodes t0-0 flags) (game-task-node-flag closed)))) + (when (and (nonzero? t0-0) (not (logtest? (-> game-nodes t0-0 flags) (game-task-node-flag closed)))) (set! a1-1 #f) (goto cfg-12) ) @@ -975,7 +974,7 @@ ) (('life) (if (and (not (task-complete? *game-info* (-> node task))) - (zero? (logand (-> node flags) (game-task-node-flag save-on-life))) + (not (logtest? (-> node flags) (game-task-node-flag save-on-life))) ) (logclear! (-> node flags) (game-task-node-flag closed)) ) @@ -1497,7 +1496,7 @@ (none) ) :code (behavior () - (when (and *target* (logtest? (-> *target* focus-status) (focus-status dead))) + (when (and *target* (focus-test? *target* dead)) (if (and (logtest? (-> self flags) (fail-mission-flags famflags-3)) (zero? (-> self message))) (deactivate self) ) @@ -1508,7 +1507,7 @@ (case (-> self message) (((fail-mission-message fammsg-0)) (while (begin - (if (and *target* (logtest? (-> *target* focus-status) (focus-status grabbed))) + (if (and *target* (focus-test? *target* grabbed)) (process-release? *target*) ) (let ((a1-0 (new 'stack-no-clear 'event-message-block))) @@ -1526,10 +1525,7 @@ (set! (-> v1-24 mode) 'bot) (set! (-> a1-0 param 1) (the-as uint v1-24)) ) - (not (or (send-event-function *target* a1-0) - (and *target* (logtest? (-> *target* focus-status) (focus-status dead))) - ) - ) + (not (or (send-event-function *target* a1-0) (and *target* (focus-test? *target* dead)))) ) ) (suspend) @@ -1713,7 +1709,7 @@ (else (task-node-reset 'life) (update-task-masks 'life) - (if (and *target* (logtest? (-> *target* focus-status) (focus-status dead grabbed))) + (if (and *target* (focus-test? *target* dead grabbed)) (send-event *target* 'end-mode) ) ) @@ -1759,7 +1755,7 @@ (the-as process #f) ) (when (not (logtest? (-> arg0 flags) (fail-mission-flags famflags-4))) - (if (not (and *target* (logtest? (-> *target* focus-status) (focus-status dead)) (zero? (-> self message)))) + (if (not (and *target* (focus-test? *target* dead) (zero? (-> self message)))) (set! (-> self stinger) (the-as uint (add-process *gui-control* *target* (gui-channel background) (gui-action play) "lose1" -99.0 0)) ) @@ -1831,7 +1827,7 @@ (add-setting! 'task arg0 0 0) (add-setting! 'task-manager (process->ppointer self) 0 0) (set! (-> self intro-time) (-> self clock frame-counter)) - (set! (-> self fail-on-death?) (zero? (logand (-> arg0 flags) (game-task-node-flag no-fail-on-death)))) + (set! (-> self fail-on-death?) (not (logtest? (-> arg0 flags) (game-task-node-flag no-fail-on-death)))) (when arg1 (let* ((v1-15 (level-get *level* arg1)) (a1-6 (if (and (nonzero? (-> v1-15 entity)) (> (-> v1-15 entity length) 0)) @@ -2056,7 +2052,7 @@ (or (zero? (-> obj info intro-delay)) (>= (- (-> pp clock frame-counter) (-> obj intro-time)) (the-as time-frame (-> obj info intro-delay))) ) - (and *target* (zero? (logand (focus-status dead teleporting) (-> *target* focus-status)))) + (and *target* (not (logtest? (focus-status dead teleporting) (-> *target* focus-status)))) ) ) ) diff --git a/goal_src/jak2/engine/gfx/math-camera.gc b/goal_src/jak2/engine/gfx/math-camera.gc index 687ba88c22..71ccd39aa4 100644 --- a/goal_src/jak2/engine/gfx/math-camera.gc +++ b/goal_src/jak2/engine/gfx/math-camera.gc @@ -451,7 +451,7 @@ renderers that want a single matrix. (.add.vf vf28 vf28 vf30) (.max.x.vf vf28 vf28 vf0 :mask #b1000) (.svf (&-> arg0 quad) vf28) - (zero? (logand clip 63)) + (not (logtest? clip 63)) ) ) ) @@ -525,7 +525,7 @@ renderers that want a single matrix. ;; store result! (.svf (&-> arg0 quad) vf28) ;; return result of clipping. - (zero? (logand clip 63)) + (not (logtest? clip 63)) ) ) ) diff --git a/goal_src/jak2/engine/gfx/mood/mood-funcs2.gc b/goal_src/jak2/engine/gfx/mood/mood-funcs2.gc index c1681c37d5..c97cfe681f 100644 --- a/goal_src/jak2/engine/gfx/mood/mood-funcs2.gc +++ b/goal_src/jak2/engine/gfx/mood/mood-funcs2.gc @@ -15,7 +15,6 @@ ) -;; WARN: Return type mismatch int vs none. (defbehavior update-mood-default-interior time-of-day-proc ((arg0 mood-context)) (update-mood-interior arg0) (cond @@ -50,7 +49,6 @@ ) -;; WARN: Return type mismatch int vs none. (defun update-vinroom-lights ((arg0 mood-context)) (let ((v1-0 (-> arg0 light-group))) (set-vector! (-> arg0 current-env-color) 48.0 60.0 96.0 255.0) @@ -77,7 +75,6 @@ (none) ) -;; WARN: Return type mismatch int vs none. (defbehavior update-mood-vinroom time-of-day-proc ((arg0 mood-context)) (update-mood-interior arg0) (update-vinroom-lights arg0) @@ -136,7 +133,6 @@ ) -;; WARN: Return type mismatch int vs none. (defun update-hideout-lights ((arg0 mood-context)) (let ((a2-0 (-> arg0 light-group)) (a1-0 (-> arg0 light-group 1)) @@ -177,7 +173,6 @@ (none) ) -;; WARN: Return type mismatch int vs none. (defbehavior update-mood-hideout time-of-day-proc ((arg0 mood-context)) (update-mood-interior arg0) (update-hideout-lights arg0) @@ -217,7 +212,6 @@ (none) ) -;; WARN: Return type mismatch int vs none. (defbehavior update-mood-copy-hideout time-of-day-proc ((arg0 mood-context)) (let ((v1-1 (level-get *level* 'hideout))) (if (and v1-1 (= (-> v1-1 status) 'active)) @@ -419,7 +413,6 @@ (none) ) -;; WARN: Return type mismatch int vs none. (defun update-hiphog-lights ((arg0 mood-context)) (let ((t1-0 (-> arg0 light-group)) (t0-0 (-> arg0 light-group 1)) @@ -541,7 +534,6 @@ (none) ) -;; WARN: Return type mismatch int vs none. (defbehavior update-mood-hiphog time-of-day-proc ((arg0 mood-context) (arg1 float)) (update-mood-interior arg0) (update-hiphog-lights arg0) @@ -705,7 +697,7 @@ (set! (-> s5-0 clock-sun) (the-as uint (the int (rand-vu-float-range 64.0 192.0)))) (set! (-> s5-0 clock-moon) (the-as uint (the int (rand-vu-float-range 64.0 192.0)))) ) - (if (and (-> s5-0 door) (zero? (logand (-> s5-0 door extra perm status) (entity-perm-status subtask-complete)))) + (if (and (-> s5-0 door) (not (logtest? (-> s5-0 door extra perm status) (entity-perm-status subtask-complete)))) (set! (-> arg0 times 0 quad) (-> *level* default-level mood-context times 0 quad)) ) ) @@ -728,7 +720,6 @@ (none) ) -;; WARN: Return type mismatch int vs none. (defbehavior update-mood-copy-hiphog time-of-day-proc ((arg0 mood-context)) (let ((v1-1 (level-get *level* 'hiphog))) (if (and v1-1 (= (-> v1-1 status) 'active)) @@ -753,7 +744,6 @@ ) -;; WARN: Return type mismatch int vs none. (defun update-sewer-lights ((arg0 mood-context)) (let ((v1-0 (-> arg0 light-group))) (set-vector! (-> v1-0 0 dir0 color) 0.822 0.694 0.613 1.0) @@ -834,7 +824,6 @@ (none) ) -;; WARN: Return type mismatch int vs none. (defbehavior update-mood-sewer time-of-day-proc ((arg0 mood-context)) (update-mood-interior arg0) (update-sewer-lights arg0) @@ -917,7 +906,6 @@ (none) ) -;; WARN: Return type mismatch int vs none. (defbehavior update-mood-copy-sewerb time-of-day-proc ((arg0 mood-context)) (let ((v1-1 (level-get *level* 'sewerb))) (if (and v1-1 (= (-> v1-1 status) 'active)) @@ -928,7 +916,6 @@ (none) ) -;; WARN: Return type mismatch int vs none. (defbehavior update-mood-copy-sewescb time-of-day-proc ((arg0 mood-context)) (let ((v1-1 (level-get *level* 'sewescb))) (if (and v1-1 (= (-> v1-1 status) 'active)) @@ -956,11 +943,8 @@ (defun set-sewer-turret-flash! () (let ((v1-1 (level-get *level* 'sewerb))) (when v1-1 - (let ((v1-2 (the-as sewer-states (-> v1-1 mood-context state))) - (f0-0 1.0) - ) - (set! (-> v1-2 turret-value) f0-0) - f0-0 + (let ((v1-2 (the-as sewer-states (-> v1-1 mood-context state)))) + (set! (-> v1-2 turret-value) 1.0) ) ) ) @@ -969,11 +953,8 @@ (defun set-sewesc-explosion! () (let ((v1-1 (level-get *level* 'sewescb))) (when v1-1 - (let ((v1-2 (the-as sewer-states (-> v1-1 mood-context state))) - (f0-0 1.9921875) - ) - (set! (-> v1-2 explosion) f0-0) - f0-0 + (let ((v1-2 (the-as sewer-states (-> v1-1 mood-context state)))) + (set! (-> v1-2 explosion) 1.9921875) ) ) ) @@ -993,7 +974,6 @@ ) -;; WARN: Return type mismatch int vs none. (defun update-onintent-lights ((arg0 mood-context)) (let ((v1-0 (-> arg0 light-group))) (set-vector! (-> v1-0 0 dir0 color) 0.822 0.694 0.613 1.0) @@ -1003,7 +983,6 @@ (none) ) -;; WARN: Return type mismatch int vs none. (defbehavior update-mood-onintent time-of-day-proc ((arg0 mood-context)) (update-mood-interior arg0) (update-onintent-lights arg0) @@ -1054,7 +1033,6 @@ #f ) -;; WARN: Return type mismatch int vs none. (defbehavior update-mood-oracle time-of-day-proc ((arg0 mood-context)) (copy-mood-exterior-ambi arg0 #f) (update-mood-interior arg0) @@ -1124,7 +1102,6 @@ ) -;; WARN: Return type mismatch int vs none. (defun update-tomba-lights ((arg0 mood-context)) (let ((v1-0 (-> arg0 current-fog))) (set! (-> v1-0 fog-color x) 0.0) @@ -1167,7 +1144,6 @@ (none) ) -;; WARN: Return type mismatch int vs none. (defbehavior update-mood-tomba time-of-day-proc ((arg0 mood-context)) (update-mood-interior arg0) (update-tomba-lights arg0) @@ -1203,7 +1179,6 @@ ) -;; WARN: Return type mismatch int vs none. (defun update-tombb-lights ((arg0 mood-context)) (update-tomba-lights arg0) (let ((v1-0 (-> arg0 light-group 1))) @@ -1238,7 +1213,6 @@ (none) ) -;; WARN: Return type mismatch int vs none. (defbehavior update-mood-tombb time-of-day-proc ((arg0 mood-context)) (update-mood-interior arg0) (update-tombb-lights arg0) @@ -1272,15 +1246,11 @@ (defun init-mood-tombc ((arg0 mood-context)) - (let ((v1-0 (the-as tombc-states (-> arg0 state))) - (f0-0 1.0) - ) - (set! (-> v1-0 electricity scale) f0-0) - f0-0 + (let ((v1-0 (the-as tombc-states (-> arg0 state)))) + (set! (-> v1-0 electricity scale) 1.0) ) ) -;; WARN: Return type mismatch int vs none. (defbehavior update-mood-tombc time-of-day-proc ((arg0 mood-context)) (update-mood-interior arg0) (update-tomba-lights arg0) @@ -1304,11 +1274,8 @@ (defun set-tombc-electricity-scale! ((arg0 float)) (let ((v1-1 (level-get *level* 'tombc))) (when v1-1 - (let ((v1-2 (the-as tombc-states (-> v1-1 mood-context state))) - (f0-0 arg0) - ) - (set! (-> v1-2 electricity scale) f0-0) - f0-0 + (let ((v1-2 (the-as tombc-states (-> v1-1 mood-context state)))) + (set! (-> v1-2 electricity scale) arg0) ) ) ) @@ -1327,7 +1294,6 @@ ) -;; WARN: Return type mismatch int vs none. (defun update-tombd-lights ((arg0 mood-context)) (let ((v1-0 (-> arg0 current-fog))) (set! (-> v1-0 fog-color x) 0.0) @@ -1363,7 +1329,6 @@ (none) ) -;; WARN: Return type mismatch int vs none. (defbehavior update-mood-tombd time-of-day-proc ((arg0 mood-context)) (update-mood-interior arg0) (update-tombd-lights arg0) @@ -1400,7 +1365,6 @@ ) -;; WARN: Return type mismatch int vs none. (defbehavior update-mood-tombe time-of-day-proc ((arg0 mood-context)) (update-mood-interior arg0) (update-tomba-lights arg0) @@ -1435,7 +1399,6 @@ ) -;; WARN: Return type mismatch int vs none. (defun update-tombboss-lights ((arg0 mood-context)) (let ((v1-0 (-> arg0 light-group))) (let ((a1-0 (-> v1-0 0))) @@ -1541,7 +1504,6 @@ (none) ) -;; WARN: Return type mismatch int vs none. (defbehavior update-mood-tombboss time-of-day-proc ((arg0 mood-context)) (update-mood-interior arg0) (update-tombboss-lights arg0) @@ -1574,11 +1536,8 @@ (defun set-tombboss-gem-light! ((arg0 float)) (let ((v1-1 (level-get *level* 'tombboss))) (when v1-1 - (let ((v1-2 (the-as tombboss-states (-> v1-1 mood-context state))) - (f0-0 arg0) - ) - (set! (-> v1-2 gem-light) f0-0) - f0-0 + (let ((v1-2 (the-as tombboss-states (-> v1-1 mood-context state)))) + (set! (-> v1-2 gem-light) arg0) ) ) ) @@ -1593,7 +1552,6 @@ ) -;; WARN: Return type mismatch int vs none. (defun update-fortress-lights ((arg0 mood-context)) (let ((a3-0 (-> arg0 light-group)) (a2-0 (-> arg0 light-group 1)) @@ -1638,7 +1596,6 @@ (none) ) -;; WARN: Return type mismatch int vs none. (defbehavior update-mood-fortress time-of-day-proc ((arg0 mood-context)) (update-mood-interior arg0) (update-fortress-lights arg0) @@ -1668,15 +1625,11 @@ (defun init-mood-fordumpa ((arg0 mood-context)) - (let ((v1-0 (the-as fordumpa-states (-> arg0 state))) - (f0-0 0.0) - ) - (set! (-> v1-0 electricity scale) f0-0) - f0-0 + (let ((v1-0 (the-as fordumpa-states (-> arg0 state)))) + (set! (-> v1-0 electricity scale) 0.0) ) ) -;; WARN: Return type mismatch int vs none. (defbehavior update-mood-fordumpa time-of-day-proc ((arg0 mood-context)) (update-mood-interior arg0) (update-fortress-lights arg0) @@ -1709,11 +1662,8 @@ (defun set-fordumpa-turret-flash! ((arg0 int)) (let ((v1-1 (level-get *level* 'fordumpa))) (when v1-1 - (let ((v1-2 (the-as fordumpa-states (-> v1-1 mood-context state))) - (f0-0 1.0) - ) - (set! (-> v1-2 turret-value arg0) f0-0) - f0-0 + (let ((v1-2 (the-as fordumpa-states (-> v1-1 mood-context state)))) + (set! (-> v1-2 turret-value arg0) 1.0) ) ) ) @@ -1722,11 +1672,8 @@ (defun set-fordumpa-electricity-scale! ((arg0 float)) (let ((v1-1 (level-get *level* 'fordumpa))) (when v1-1 - (let ((v1-2 (the-as fordumpa-states (-> v1-1 mood-context state))) - (f0-0 arg0) - ) - (set! (-> v1-2 electricity scale) f0-0) - f0-0 + (let ((v1-2 (the-as fordumpa-states (-> v1-1 mood-context state)))) + (set! (-> v1-2 electricity scale) arg0) ) ) ) @@ -1749,7 +1696,6 @@ #f ) -;; WARN: Return type mismatch int vs none. (defbehavior update-mood-fordumpc time-of-day-proc ((arg0 mood-context)) (update-mood-interior arg0) (update-fortress-lights arg0) @@ -1799,14 +1745,10 @@ (defun init-mood-forresca ((arg0 mood-context)) (let ((v1-0 (the-as forresca-states (-> arg0 state)))) (set! (-> v1-0 electricity 0 scale) 1.0) - (let ((f0-1 1.0)) - (set! (-> v1-0 electricity 1 scale) f0-1) - f0-1 - ) + (set! (-> v1-0 electricity 1 scale) 1.0) ) ) -;; WARN: Return type mismatch int vs none. (defbehavior update-mood-forresca time-of-day-proc ((arg0 mood-context)) (update-mood-interior arg0) (update-fortress-lights arg0) @@ -1829,11 +1771,8 @@ (defun set-forresca-electricity-scale! ((arg0 float) (arg1 int)) (let ((v1-1 (level-get *level* 'forresca))) (when v1-1 - (let ((v1-2 (the-as object (-> v1-1 mood-context state))) - (f0-0 arg0) - ) - (set! (-> (the-as forresca-states v1-2) electricity arg1 scale) f0-0) - f0-0 + (let ((v1-2 (the-as object (-> v1-1 mood-context state)))) + (set! (-> (the-as forresca-states v1-2) electricity arg1 scale) arg0) ) ) ) @@ -1852,14 +1791,10 @@ (defun init-mood-forrescb ((arg0 mood-context)) (let ((v1-0 (the-as forrescb-states (-> arg0 state)))) (set! (-> v1-0 electricity 0 scale) 1.0) - (let ((f0-1 1.0)) - (set! (-> v1-0 electricity 1 scale) f0-1) - f0-1 - ) + (set! (-> v1-0 electricity 1 scale) 1.0) ) ) -;; WARN: Return type mismatch int vs none. (defbehavior update-mood-forrescb time-of-day-proc ((arg0 mood-context)) (update-mood-interior arg0) (update-fortress-lights arg0) @@ -1892,11 +1827,8 @@ (defun set-forrescb-turret-flash! ((arg0 int)) (let ((v1-1 (level-get *level* 'forrescb))) (when v1-1 - (let ((v1-2 (-> v1-1 mood-context state)) - (f0-0 1.0) - ) - (set! (-> (the-as forrescb-states (+ (* arg0 4) (the-as int v1-2))) turret 0) f0-0) - f0-0 + (let ((v1-2 (-> v1-1 mood-context state))) + (set! (-> (the-as forrescb-states (+ (* arg0 4) (the-as int v1-2))) turret 0) 1.0) ) ) ) @@ -1905,11 +1837,8 @@ (defun set-forrescb-electricity-scale! ((arg0 float) (arg1 int)) (let ((v1-1 (level-get *level* 'forrescb))) (when v1-1 - (let ((v1-2 (the-as object (-> v1-1 mood-context state))) - (f0-0 arg0) - ) - (set! (-> (the-as forrescb-states v1-2) electricity arg1 scale) f0-0) - f0-0 + (let ((v1-2 (the-as object (-> v1-1 mood-context state)))) + (set! (-> (the-as forrescb-states v1-2) electricity arg1 scale) arg0) ) ) ) @@ -1927,7 +1856,6 @@ ) -;; WARN: Return type mismatch int vs none. (defun update-prison-lights ((arg0 mood-context)) (let ((v1-0 (-> arg0 light-group))) (set-vector! (-> v1-0 0 dir0 color) 0.0 0.0 0.0 1.0) @@ -1941,14 +1869,10 @@ (defun init-mood-prison ((arg0 mood-context)) (let ((v1-0 (the-as prison-states (-> arg0 state)))) (set! (-> v1-0 torture-flag) #f) - (let ((f0-0 0.0)) - (set! (-> v1-0 torture) f0-0) - f0-0 - ) + (set! (-> v1-0 torture) 0.0) ) ) -;; WARN: Return type mismatch int vs none. (defbehavior update-mood-prison time-of-day-proc ((arg0 mood-context)) (update-mood-interior arg0) (update-prison-lights arg0) @@ -1986,7 +1910,6 @@ (none) ) -;; WARN: Return type mismatch int vs none. (defbehavior update-mood-copy-prison time-of-day-proc ((arg0 mood-context)) (let ((v1-1 (level-get *level* 'prison))) (if (and v1-1 (= (-> v1-1 status) 'active)) @@ -2135,15 +2058,11 @@ (set! (-> gp-1 dir0 extra x) 0.5) (set! (-> gp-1 dir1 extra x) 0.0) (set! (-> gp-1 dir2 extra x) 0.0) - (let ((f0-90 0.5)) - (set! (-> gp-1 ambi extra x) f0-90) - f0-90 - ) + (set! (-> gp-1 ambi extra x) 0.5) ) ) ) -;; WARN: Return type mismatch int vs none. (defbehavior update-mood-under time-of-day-proc ((arg0 mood-context)) (update-mood-interior arg0) (update-under-lights arg0) @@ -2180,7 +2099,6 @@ (none) ) -;; WARN: Return type mismatch int vs none. (defbehavior update-mood-copy-underb time-of-day-proc ((arg0 mood-context)) (let ((v1-1 (level-get *level* 'underb))) (if (and v1-1 (= (-> v1-1 status) 'active)) @@ -2201,11 +2119,8 @@ ) (let ((v1-4 (level-get *level* 'underb))) (when v1-4 - (let ((v1-5 (the-as object (-> v1-4 mood-context state))) - (f0-1 arg0) - ) - (set! (-> (the-as under-states v1-5) laser) f0-1) - f0-1 + (let ((v1-5 (the-as object (-> v1-4 mood-context state)))) + (set! (-> (the-as under-states v1-5) laser) arg0) ) ) ) @@ -2221,11 +2136,8 @@ ) (let ((v1-4 (level-get *level* 'underb))) (when v1-4 - (let ((v1-5 (the-as object (-> v1-4 mood-context state))) - (f0-1 arg0) - ) - (set! (-> (the-as under-states v1-5) fog-interp) f0-1) - f0-1 + (let ((v1-5 (the-as object (-> v1-4 mood-context state)))) + (set! (-> (the-as under-states v1-5) fog-interp) arg0) ) ) ) @@ -2240,7 +2152,6 @@ ) -;; WARN: Return type mismatch int vs none. (defun update-gungame-lights ((arg0 mood-context)) (let ((v1-0 (-> arg0 light-group))) (let ((a0-1 (-> v1-0 0))) @@ -2256,7 +2167,6 @@ (none) ) -;; WARN: Return type mismatch int vs none. (defbehavior update-mood-gungame time-of-day-proc ((arg0 mood-context)) (update-mood-interior arg0) (update-gungame-lights arg0) @@ -2286,15 +2196,11 @@ (defun init-mood-dig1 ((arg0 mood-context)) - (let ((v1-0 (the-as object (-> arg0 state))) - (f0-0 0.0) - ) - (set! (-> (the-as dig1-states v1-0) explosion) f0-0) - f0-0 + (let ((v1-0 (the-as object (-> arg0 state)))) + (set! (-> (the-as dig1-states v1-0) explosion) 0.0) ) ) -;; WARN: Return type mismatch int vs none. (defun update-dig1-lights ((arg0 mood-context)) (let ((v1-0 (-> arg0 current-fog))) (set-vector! (-> v1-0 fog-color) 205.0 90.0 90.0 128.0) @@ -2439,7 +2345,6 @@ ;; ERROR: Stack slot load at 32 mismatch: defined as size 4, got size 16 ;; ERROR: Stack slot load at 16 mismatch: defined as size 4, got size 16 ;; ERROR: Stack slot load at 32 mismatch: defined as size 4, got size 16 -;; WARN: Return type mismatch int vs none. (defbehavior update-mood-dig1 time-of-day-proc ((arg0 mood-context)) (local-vars (sv-16 float) (sv-32 float)) (update-mood-interior arg0) @@ -2505,11 +2410,8 @@ (defun set-dig1-explosion! ((arg0 float)) (let ((v1-1 (level-get *level* 'dig1))) (when v1-1 - (let ((v1-2 (the-as object (-> v1-1 mood-context state))) - (f0-0 1.9921875) - ) - (set! (-> (the-as dig1-states v1-2) explosion) f0-0) - f0-0 + (let ((v1-2 (the-as object (-> v1-1 mood-context state)))) + (set! (-> (the-as dig1-states v1-2) explosion) 1.9921875) ) ) ) @@ -2533,14 +2435,12 @@ ) -;; WARN: Return type mismatch int vs none. (defun update-vortex-lights ((arg0 mood-context)) (set-vector! (-> arg0 current-env-color) 96.0 48.0 196.0 255.0) 0 (none) ) -;; WARN: Return type mismatch int vs none. (defbehavior update-mood-vortex time-of-day-proc ((arg0 mood-context)) (update-mood-interior arg0) (update-vortex-lights arg0) @@ -2648,11 +2548,8 @@ ) (let ((v1-4 (level-get *level* 'lintcstb))) (when v1-4 - (let ((v1-5 (the-as object (-> v1-4 mood-context state))) - (f0-1 1.0) - ) - (set! (-> (the-as vortex-states v1-5) flash) f0-1) - f0-1 + (let ((v1-5 (the-as object (-> v1-4 mood-context state)))) + (set! (-> (the-as vortex-states v1-5) flash) 1.0) ) ) ) @@ -2671,10 +2568,7 @@ (when v1-4 (let ((v1-5 (the-as vortex-states (-> v1-4 mood-context state)))) (set! (-> v1-5 white) arg0) - (let ((f0-1 0.0)) - (set! (-> v1-5 white-count) f0-1) - f0-1 - ) + (set! (-> v1-5 white-count) 0.0) ) ) ) @@ -2713,7 +2607,6 @@ (none) ) -;; WARN: Return type mismatch int vs none. (defbehavior update-mood-nestb time-of-day-proc ((arg0 mood-context) (arg1 object) (arg2 int)) (copy-mood-exterior-ambi arg0 #f) (update-mood-interior arg0) @@ -2741,11 +2634,8 @@ (defun set-nestb-purple! ((arg0 float)) (let ((v1-1 (level-get *level* 'nestb))) (when v1-1 - (let ((v1-2 (the-as object (-> v1-1 mood-context state))) - (f0-0 arg0) - ) - (set! (-> (the-as nestb-states v1-2) purple) f0-0) - f0-0 + (let ((v1-2 (the-as object (-> v1-1 mood-context state)))) + (set! (-> (the-as nestb-states v1-2) purple) arg0) ) ) ) @@ -2771,7 +2661,6 @@ ) -;; WARN: Return type mismatch int vs none. (defun init-mood-consiteb ((arg0 mood-context)) (let ((v1-0 (the-as consiteb-states (-> arg0 state)))) (set! (-> v1-0 flicker) 1.0) @@ -2781,7 +2670,6 @@ (none) ) -;; WARN: Return type mismatch int vs none. (defbehavior update-mood-consiteb time-of-day-proc ((arg0 mood-context) (arg1 object) (arg2 int)) (copy-mood-exterior-ambi arg0 #f) (update-mood-interior arg0) @@ -2847,7 +2735,6 @@ ) -;; WARN: Return type mismatch int vs none. (defun update-castle-lights ((arg0 mood-context)) (let ((a2-0 (-> arg0 light-group)) (a1-0 (-> arg0 light-group 1)) @@ -2930,15 +2817,11 @@ ) (defun init-mood-castle ((arg0 mood-context)) - (let ((v1-0 (the-as object (-> arg0 state))) - (f0-0 1.0) - ) - (set! (-> (the-as castle-states v1-0) electricity scale) f0-0) - f0-0 + (let ((v1-0 (the-as object (-> arg0 state)))) + (set! (-> (the-as castle-states v1-0) electricity scale) 1.0) ) ) -;; WARN: Return type mismatch int vs none. (defbehavior update-mood-castle time-of-day-proc ((arg0 mood-context)) (update-mood-interior arg0) (cond @@ -2974,11 +2857,8 @@ (defun set-castle-electricity-scale! ((arg0 float)) (let ((v1-1 (level-get *level* 'castle))) (when v1-1 - (let ((v1-2 (the-as object (-> v1-1 mood-context state))) - (f0-0 arg0) - ) - (set! (-> (the-as castle-states v1-2) electricity scale) f0-0) - f0-0 + (let ((v1-2 (the-as object (-> v1-1 mood-context state)))) + (set! (-> (the-as castle-states v1-2) electricity scale) arg0) ) ) ) @@ -2997,7 +2877,6 @@ #f ) -;; WARN: Return type mismatch int vs none. (defun update-garage-lights ((arg0 mood-context)) (let ((a1-0 (-> *level* default-level mood-context)) (a0-1 (-> arg0 current-fog)) @@ -3021,7 +2900,6 @@ (none) ) -;; WARN: Return type mismatch int vs none. (defbehavior update-mood-garage time-of-day-proc ((arg0 mood-context) (arg1 object) (arg2 int)) (copy-mood-exterior-ambi arg0 #f) (update-mood-interior arg0) @@ -3038,7 +2916,6 @@ (none) ) -;; WARN: Return type mismatch int vs none. (defbehavior update-mood-copy-garage time-of-day-proc ((arg0 mood-context)) (let ((v1-1 (level-get *level* 'garage))) (if (and v1-1 (= (-> v1-1 status) 'active)) @@ -3057,7 +2934,6 @@ ) -;; WARN: Return type mismatch int vs none. (defbehavior update-mood-palshaft time-of-day-proc ((arg0 mood-context)) (copy-mood-exterior-ambi arg0 #f) (update-mood-interior arg0) @@ -3068,7 +2944,3 @@ 0 (none) ) - - - - diff --git a/goal_src/jak2/engine/gfx/sprite/particles/sparticle-launcher.gc b/goal_src/jak2/engine/gfx/sprite/particles/sparticle-launcher.gc index cf4403a6e5..cca06fbfbc 100644 --- a/goal_src/jak2/engine/gfx/sprite/particles/sparticle-launcher.gc +++ b/goal_src/jak2/engine/gfx/sprite/particles/sparticle-launcher.gc @@ -155,7 +155,6 @@ (none) ) - (deftype particle-adgif-cache (basic) ((used int32 :offset-assert 4) (last uint16 :offset-assert 8) @@ -274,7 +273,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)) @@ -358,7 +357,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) ) ) @@ -527,8 +526,8 @@ (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))) - (zero? (logand (-> arg2 flags) (sp-cpuinfo-flag glow))) + (not (logtest? (-> arg2 flags) (sp-cpuinfo-flag distort))) + (not (logtest? (-> arg2 flags) (sp-cpuinfo-flag glow))) ) (let ((f20-0 (-> arg3 r-g-b-a x)) (f22-0 (-> arg3 r-g-b-a y)) diff --git a/goal_src/jak2/engine/level/level.gc b/goal_src/jak2/engine/level/level.gc index 27f7a5969a..289d628fb9 100644 --- a/goal_src/jak2/engine/level/level.gc +++ b/goal_src/jak2/engine/level/level.gc @@ -2775,7 +2775,7 @@ into 7 sections, which might explain the weird sizes in the center. ) (string= (-> *game-info* current-continue name) (-> (the-as continue-point s1-0) name)) ) - (zero? (logand (-> (the-as continue-point s1-0) flags) (continue-flags cf2 cf3))) + (not (logtest? (-> (the-as continue-point s1-0) flags) (continue-flags cf2 cf3))) ) (set! s3-0 (the-as continue-point s1-0)) (if (string= (-> *game-info* current-continue name) (-> (the-as continue-point s1-0) name)) @@ -2788,7 +2788,7 @@ into 7 sections, which might explain the weird sizes in the center. ) (label cfg-59) (if (and (the-as continue-point s3-0) - (zero? (logand (-> (the-as continue-point s3-0) flags) (continue-flags cf2 cf3))) + (not (logtest? (-> (the-as continue-point s3-0) flags) (continue-flags cf2 cf3))) ) (set-continue! *game-info* (the-as basic s3-0) #f) ) diff --git a/goal_src/jak2/engine/load/loader.gc b/goal_src/jak2/engine/load/loader.gc index 6a43d1666b..244085d905 100644 --- a/goal_src/jak2/engine/load/loader.gc +++ b/goal_src/jak2/engine/load/loader.gc @@ -1519,7 +1519,7 @@ ) ((= v1-0 (gui-channel query)) (and (not (or (logtest? (-> *art-control* frame-mask) 28) (!= *master-mode* 'game))) - (and *target* (zero? (logand (-> *target* focus-status) (focus-status dead hit)))) + (and *target* (not (logtest? (-> *target* focus-status) (focus-status dead hit)))) ) ) (else diff --git a/goal_src/jak2/engine/nav/nav-control.gc b/goal_src/jak2/engine/nav/nav-control.gc index 3d5f11060f..aa3a3617ac 100644 --- a/goal_src/jak2/engine/nav/nav-control.gc +++ b/goal_src/jak2/engine/nav/nav-control.gc @@ -1310,7 +1310,7 @@ Note that this doesn't actually return the nav-control, but instead adds this pr (set! (-> v1-20 next-poly) (-> a1-9 poly-array sv-188)) ) (cond - ((and (-> v1-20 next-poly) (zero? (logand (-> v1-20 next-poly pat) (-> v1-20 ignore)))) + ((and (-> v1-20 next-poly) (not (logtest? (-> v1-20 next-poly pat) (-> v1-20 ignore)))) (set! (-> v1-20 current-poly) (-> v1-20 next-poly)) ) (else @@ -1610,7 +1610,7 @@ Note that this doesn't actually return the nav-control, but instead adds this pr (set! (-> v1-19 next-poly) (-> t3-8 poly-array sv-180)) ) (cond - ((and (-> v1-19 next-poly) (zero? (logand (-> v1-19 next-poly pat) (-> v1-19 ignore)))) + ((and (-> v1-19 next-poly) (not (logtest? (-> v1-19 next-poly pat) (-> v1-19 ignore)))) (set! (-> v1-19 current-poly) (-> v1-19 next-poly)) ) (else @@ -1864,7 +1864,6 @@ Note that this doesn't actually return the nav-control, but instead adds this pr ) (defmethod nav-state-method-10 nav-state ((obj nav-state)) - "Virtual/Stub" 0 (none) ) @@ -2119,7 +2118,6 @@ Note that this doesn't actually return the nav-control, but instead adds this pr (defmethod-mips2c "(method 39 nav-state)" 39 nav-state) (defmethod nav-state-method-50 nav-state ((obj nav-state)) - "Virtual/Stub" 0 (none) ) @@ -2497,7 +2495,7 @@ Note that this doesn't actually return the nav-control, but instead adds this pr (set! (-> a3-5 next-poly) (-> t0-6 poly-array sv-148)) ) (cond - ((and (-> a3-5 next-poly) (zero? (logand (-> a3-5 next-poly pat) (-> a3-5 ignore)))) + ((and (-> a3-5 next-poly) (not (logtest? (-> a3-5 next-poly pat) (-> a3-5 ignore)))) (set! (-> a3-5 current-poly) (-> a3-5 next-poly)) ) (else @@ -2667,7 +2665,7 @@ Note that this doesn't actually return the nav-control, but instead adds this pr (set! (-> a1-6 next-poly) (-> a2-6 poly-array sv-244)) ) (cond - ((and (-> a1-6 next-poly) (zero? (logand (-> a1-6 next-poly pat) (-> a1-6 ignore)))) + ((and (-> a1-6 next-poly) (not (logtest? (-> a1-6 next-poly pat) (-> a1-6 ignore)))) (set! (-> a1-6 current-poly) (-> a1-6 next-poly)) ) (else @@ -3283,7 +3281,7 @@ Note that this doesn't actually return the nav-control, but instead adds this pr (set! (-> a2-5 next-poly) (-> a3-6 poly-array sv-244)) ) (cond - ((and (-> a2-5 next-poly) (zero? (logand (-> a2-5 next-poly pat) (-> a2-5 ignore)))) + ((and (-> a2-5 next-poly) (not (logtest? (-> a2-5 next-poly pat) (-> a2-5 ignore)))) (set! (-> a2-5 current-poly) (-> a2-5 next-poly)) ) (else diff --git a/goal_src/jak2/engine/nav/nav-enemy.gc b/goal_src/jak2/engine/nav/nav-enemy.gc index ea82d97ea4..78d4cd1717 100644 --- a/goal_src/jak2/engine/nav/nav-enemy.gc +++ b/goal_src/jak2/engine/nav/nav-enemy.gc @@ -161,7 +161,7 @@ ) (when (not (logtest? (enemy-flag directed) (-> obj enemy-flags))) (let ((s5-0 (-> obj root-override2))) - (if (logtest? (-> obj focus-status) (focus-status under-water)) + (if (focus-test? obj under-water) (enemy-method-47 obj (-> s5-0 transv)) (+! (-> s5-0 transv y) (* (-> obj enemy-info-override movement-gravity) (-> pp clock seconds-per-frame))) ) @@ -181,7 +181,7 @@ ) ) (logclear! (-> obj enemy-flags) (enemy-flag directed)) - (if (and (enemy-method-102 obj) (zero? (logand (-> obj focus-status) (focus-status dead)))) + (if (and (enemy-method-102 obj) (not (logtest? (-> obj focus-status) (focus-status dead)))) (kill-prefer-falling obj) ) (the-as @@ -579,7 +579,7 @@ ) (cond ((-> obj enemy-info-override move-to-ground) - (if (logtest? (-> obj focus-status) (focus-status under-water)) + (if (focus-test? obj under-water) (enemy-method-47 obj (-> obj root-override2 transv)) (+! (-> obj root-override2 transv y) (* (-> obj enemy-info-override movement-gravity) (-> pp clock seconds-per-frame)) @@ -1232,9 +1232,9 @@ (set! (-> obj root-override2 penetrated-by) (get-penetrate-info obj)) (set! (-> s4-0 event-self) 'touched) ) - (set! (-> obj penetrated-flinch) (the-as penetrate (-> arg0 penetrate-flinch))) - (set! (-> obj penetrated-knocked) (the-as penetrate (-> arg0 penetrate-knocked))) - (set! (-> obj reaction-time) (get-rand-int-range obj 30 240)) + (set! (-> obj penetrated-flinch) (-> arg0 penetrate-flinch)) + (set! (-> obj penetrated-knocked) (-> arg0 penetrate-knocked)) + (set! (-> obj reaction-time) (the-as time-frame (get-rand-int-range obj 30 240))) (let* ((v1-113 (-> obj enemy-flags)) (a0-47 (-> obj fact-info-override enemy-options)) (v1-114 (logior (enemy-flag @@ -1261,7 +1261,7 @@ (do-navigation-to-destination (-> obj nav state) (-> obj root-override2 trans)) (if (and (-> obj enemy-info-override move-to-ground) (not (logtest? (enemy-flag vulnerable-backup) (-> obj enemy-flags))) - (zero? (logand (enemy-option ambush) (-> obj fact-info-override enemy-options))) + (not (logtest? (enemy-option ambush) (-> obj fact-info-override enemy-options))) ) (enemy-method-127 obj 40960.0 40960.0 #t (the-as collide-spec (-> obj gnd-collide))) ) @@ -2255,7 +2255,7 @@ This commonly includes things such as: (nav-enemy-method-165 self) (logclear! (-> self mask) (process-mask actor-pause)) (set! (-> self move-dest quad) (-> self root-override2 trans quad)) - (set! (-> self state-timeout) (get-rand-int-range self 2100 3300)) + (set! (-> self state-timeout) (the-as time-frame (get-rand-int-range self 2100 3300))) (set! (-> self starting-time) (-> self clock frame-counter)) (if (zero? (get-rand-int self 2)) (set! (-> self enemy-flags) (the-as enemy-flag (logior (enemy-flag enemy-flag40) (-> self enemy-flags)))) diff --git a/goal_src/jak2/engine/nav/nav-mesh-h.gc b/goal_src/jak2/engine/nav/nav-mesh-h.gc index f90fd1515b..603188a952 100644 --- a/goal_src/jak2/engine/nav/nav-mesh-h.gc +++ b/goal_src/jak2/engine/nav/nav-mesh-h.gc @@ -544,7 +544,7 @@ and declared out of order (cannot use forward declared structures in inline arra (set! (-> ray next-poly) (-> obj poly-array sv-68)) ) (cond - ((and (-> ray next-poly) (zero? (logand (-> ray next-poly pat) (-> ray ignore)))) + ((and (-> ray next-poly) (not (logtest? (-> ray next-poly pat) (-> ray ignore)))) (set! (-> ray current-poly) (-> ray next-poly)) ) (else diff --git a/goal_src/jak2/engine/nav/nav-mesh.gc b/goal_src/jak2/engine/nav/nav-mesh.gc index 696ccd5d10..eba03850e0 100644 --- a/goal_src/jak2/engine/nav/nav-mesh.gc +++ b/goal_src/jak2/engine/nav/nav-mesh.gc @@ -1623,7 +1623,7 @@ (set! v1-6 (and a0-3 (begin (b! (>= f0-0 (- (-> v1-5 vertex2 w) f1-0)) cfg-9 :delay (set! v1-6 #t)) #f))) ) (label cfg-9) - (when (and v1-6 (zero? (logand (-> sv-16 pat) (-> arg0 ignore)))) + (when (and v1-6 (not (logtest? (-> sv-16 pat) (-> arg0 ignore)))) (if (point-in-poly? obj sv-16 (-> arg0 point)) (return sv-16) ) @@ -1941,7 +1941,7 @@ ) (b! (not (and (and (>= (+ (-> v1-6 vertex3 w) f1-0) f0-0) (>= f0-0 (- (-> v1-6 vertex2 w) f1-0))) - (zero? (logand (-> sv-24 pat) (-> arg0 ignore))) + (not (logtest? (-> sv-24 pat) (-> arg0 ignore))) ) ) cfg-16 @@ -1989,7 +1989,7 @@ (f1-2 (-> arg0 y-threshold)) ) (when (and (and (>= (+ (-> v1-22 vertex3 w) f1-2) f0-3) (>= f0-3 (- (-> v1-22 vertex2 w) f1-2))) - (zero? (logand (-> sv-48 pat) (-> arg0 ignore))) + (not (logtest? (-> sv-48 pat) (-> arg0 ignore))) ) (set! sv-40 (+ sv-40 1)) (set! sv-52 (point-poly-distance-min (-> obj work) (the-as nav-poly (-> arg0 point)) sv-28 sv-48)) diff --git a/goal_src/jak2/engine/physics/rigid-body.gc b/goal_src/jak2/engine/physics/rigid-body.gc index 74a7bdc4b8..098be253cb 100644 --- a/goal_src/jak2/engine/physics/rigid-body.gc +++ b/goal_src/jak2/engine/physics/rigid-body.gc @@ -1222,7 +1222,7 @@ This commonly includes things such as: (local-vars (v1-2 symbol)) (b! (not (logtest? (process-mask target crate enemy) (-> arg0 mask))) cfg-5 :likely-delay (set! v1-2 #t)) (b! (not (logtest? (-> arg0 mask) (process-mask target))) cfg-5 :likely-delay (set! v1-2 #f)) - (set! v1-2 (logtest? (focus-status dangerous pilot) (-> arg0 focus-status))) + (set! v1-2 (focus-test? arg0 dangerous pilot)) (label cfg-5) (b! v1-2 cfg-17 :delay (nop!)) (let ((s5-0 (new 'stack-no-clear 'rigid-body-impact)) @@ -1362,7 +1362,7 @@ This commonly includes things such as: ) ) ) - (zero? (logand (-> obj focus-status) (focus-status dead inactive))) + (not (logtest? (-> obj focus-status) (focus-status dead inactive))) ) (('ridden) (let ((v1-45 (the-as object (-> arg3 param 0)))) @@ -1375,7 +1375,7 @@ This commonly includes things such as: ) (when (and a0-34 (logtest? (-> a0-34 mask) (process-mask target)) - (zero? (logand (-> a0-34 focus-status) (focus-status on-water under-water))) + (not (logtest? (-> a0-34 focus-status) (focus-status on-water under-water))) ) (when (not (logtest? (-> obj flags) (rigid-body-object-flag player-impulse-force))) (logior! (-> obj flags) (rigid-body-object-flag player-touching player-standing-on player-contact-force)) @@ -1431,7 +1431,7 @@ This commonly includes things such as: (if (and *target* (and (>= (-> self info extra idle-distance) (vector-vector-distance (-> self root-override-2 trans) (-> *target* control trans)) ) - (zero? (logand (focus-status teleporting) (-> *target* focus-status))) + (not (logtest? (focus-status teleporting) (-> *target* focus-status))) ) ) (go-virtual active) @@ -1453,7 +1453,7 @@ This commonly includes things such as: (or (< (+ 4096.0 (-> self info extra idle-distance)) (vector-vector-distance (-> self root-override-2 trans) (-> *target* control trans)) ) - (logtest? (focus-status teleporting) (-> *target* focus-status)) + (focus-test? *target* teleporting) ) ) (go-virtual idle) diff --git a/goal_src/jak2/engine/process-drawable/focus.gc b/goal_src/jak2/engine/process-drawable/focus.gc index 4a5b1c3757..3adadad7d8 100644 --- a/goal_src/jak2/engine/process-drawable/focus.gc +++ b/goal_src/jak2/engine/process-drawable/focus.gc @@ -23,6 +23,7 @@ ) ) + (defmethod reset-to-collide-spec focus ((obj focus) (arg0 collide-spec)) (set! (-> obj collide-with) arg0) (set! (-> obj handle) (the-as handle #f)) @@ -31,14 +32,14 @@ ) (defmethod collide-check? focus ((obj focus) (arg0 process-focusable)) - (when (and arg0 (zero? (logand (-> arg0 focus-status) (focus-status disable dead)))) - (let* ((s5-0 (-> arg0 root)) + (when (and arg0 (not (logtest? (-> arg0 focus-status) (focus-status disable dead)))) + (let* ((s5-0 (-> arg0 root-override)) (v1-2 (if (type? s5-0 collide-shape) s5-0 ) ) ) - (and v1-2 (logtest? (-> obj collide-with) (-> (the-as collide-shape v1-2) root-prim prim-core collide-as))) + (and v1-2 (logtest? (-> obj collide-with) (-> v1-2 root-prim prim-core collide-as))) ) ) ) @@ -55,7 +56,3 @@ 0 (none) ) - - - - diff --git a/goal_src/jak2/engine/process-drawable/process-drawable.gc b/goal_src/jak2/engine/process-drawable/process-drawable.gc index 8cf35b3aca..f44ee66a78 100644 --- a/goal_src/jak2/engine/process-drawable/process-drawable.gc +++ b/goal_src/jak2/engine/process-drawable/process-drawable.gc @@ -780,8 +780,8 @@ (let ((s4-0 v0-3)) (let ((s3-1 (-> s3-0 art-group))) (cond - ((>= (the-as int (-> arg0 janim)) 0) - (when (or (>= (the-as int (-> arg0 janim)) (-> s3-1 length)) + ((>= (-> arg0 janim) 0) + (when (or (>= (-> arg0 janim) (-> s3-1 length)) (begin (set! v1-14 (-> s3-1 data (-> arg0 janim))) (not v1-14)) (!= (-> v1-14 type) art-joint-anim) ) @@ -1798,7 +1798,7 @@ ) (defbehavior process-drawable-delay-player process-drawable ((arg0 time-frame)) - (while (and *target* (logtest? (-> *target* focus-status) (focus-status in-air))) + (while (and *target* (focus-test? *target* in-air)) (suspend) ) (set! (-> self state-time) (-> self clock frame-counter)) diff --git a/goal_src/jak2/engine/process-drawable/process-focusable.gc b/goal_src/jak2/engine/process-drawable/process-focusable.gc index b5c44ec01c..3ee617d0df 100644 --- a/goal_src/jak2/engine/process-drawable/process-focusable.gc +++ b/goal_src/jak2/engine/process-drawable/process-focusable.gc @@ -111,3 +111,6 @@ (defmethod get-notice-time process-focusable ((obj process-focusable)) (the-as time-frame 0) ) + +(defmacro focus-test? (pfoc &rest status) + `(logtest? (-> (the process-focusable ,pfoc) focus-status) (focus-status ,@status))) \ No newline at end of file diff --git a/goal_src/jak2/engine/process-drawable/process-taskable.gc b/goal_src/jak2/engine/process-drawable/process-taskable.gc index c2fbdb6be1..ff60ed4638 100644 --- a/goal_src/jak2/engine/process-drawable/process-taskable.gc +++ b/goal_src/jak2/engine/process-drawable/process-taskable.gc @@ -207,7 +207,7 @@ Seen take in - `true-func` which takes no args TODO - seems fishy (new 'static 'sound-id) ) ) - (and (zero? (logand (focus-status dead in-air in-head pole flut tube pilot mech dark) (-> *target* focus-status))) + (and (not (logtest? (focus-status dead in-air in-head pole flut tube pilot mech dark) (-> *target* focus-status))) (and (or (and (< (-> (target-pos 0) y) (+ (-> self root-override root-prim prim-core world-sphere y) (-> self talk-height))) (let ((s5-0 (get-trans self 2)) (f30-0 (if (= (-> gp-0 distance) 0.0) diff --git a/goal_src/jak2/engine/scene/scene.gc b/goal_src/jak2/engine/scene/scene.gc index 4a409a3c6b..2ddbcb9f01 100644 --- a/goal_src/jak2/engine/scene/scene.gc +++ b/goal_src/jak2/engine/scene/scene.gc @@ -931,7 +931,7 @@ (set-setting! 'bg-a-force 'abs #x3f800000 0) (apply-settings *setting-control*) ) - (if (or (not *target*) (or (logtest? (-> *target* focus-status) (focus-status grabbed)) + (if (or (not *target*) (or (focus-test? *target* grabbed) (begin (dotimes (v1-17 6) (when (= (-> *load-state* want v1-17 name) (-> *target* current-level name)) @@ -949,7 +949,7 @@ (set! arg0 #f) ) (while (and arg0 - (or (logtest? (-> *target* focus-status) (focus-status in-air)) + (or (focus-test? *target* in-air) (and (-> *target* next-state) (= (-> *target* next-state name) 'target-flop-hit-ground)) ) (-> self scene) @@ -959,7 +959,7 @@ ) (suspend) (let ((s5-0 (-> self clock frame-counter))) - (when (and *target* (zero? (logand (-> *target* focus-status) (focus-status grabbed)))) + (when (and *target* (not (logtest? (-> *target* focus-status) (focus-status grabbed)))) (label cfg-44) (when (not (process-grab? *target* #f)) (suspend) @@ -1044,7 +1044,7 @@ ) ) ) - (if (and *target* (logtest? (focus-status in-head flut board pilot mech dark) (-> *target* focus-status))) + (if (and *target* (focus-test? *target* in-head flut board pilot mech dark)) (send-event *target* 'change-mode 'normal) ) (when (< (-> self scene-index) (-> self scene-list length)) @@ -1296,7 +1296,7 @@ ) ) ) - (if (and (-> self wait) *target* (logtest? (-> *target* focus-status) (focus-status grabbed))) + (if (and (-> self wait) *target* (focus-test? *target* grabbed)) (go-virtual release) ) (none) diff --git a/goal_src/jak2/engine/sound/speech.gc b/goal_src/jak2/engine/sound/speech.gc index cedb492dd6..573de5faa5 100644 --- a/goal_src/jak2/engine/sound/speech.gc +++ b/goal_src/jak2/engine/sound/speech.gc @@ -279,10 +279,10 @@ (let ((v1-3 *target*)) (when v1-3 (cond - ((logtest? (focus-status dark) (-> v1-3 focus-status)) + ((focus-test? v1-3 dark) (speech-control-method-12 obj arg0 (speech-type speech-type-3)) ) - ((logtest? (focus-status pilot) (-> v1-3 focus-status)) + ((focus-test? v1-3 pilot) (speech-control-method-12 obj arg0 (speech-type speech-type-0 speech-type-1 speech-type-2)) ) (else diff --git a/goal_src/jak2/engine/target/board/board-h.gc b/goal_src/jak2/engine/target/board/board-h.gc index b591f7baf0..89e83f5051 100644 --- a/goal_src/jak2/engine/target/board/board-h.gc +++ b/goal_src/jak2/engine/target/board/board-h.gc @@ -262,7 +262,7 @@ (and (logtest? (-> self game features) (game-feature board)) (or (and (cpad-pressed? (-> self control cpad number) r2) (or (!= *cheat-mode* 'debug) - (zero? (logand (-> *cpad-list* cpads (-> self control cpad number) button0-abs 0) (pad-buttons l2))) + (not (logtest? (-> *cpad-list* cpads (-> self control cpad number) button0-abs 0) (pad-buttons l2))) ) (not *pause-lock*) (>= (- (-> self clock frame-counter) (-> self control time-of-last-debug-heal)) (seconds 0.1)) @@ -270,15 +270,14 @@ ) (-> self board latch?) ) - (not (logtest? (focus-status dead hit grabbed in-head edge-grab pole board pilot mech dark) (-> self focus-status)) - ) + (not (focus-test? self dead hit grabbed in-head edge-grab pole board pilot mech dark)) (or (zero? (-> self board)) (>= (- (-> self clock frame-counter) (-> self board board-time)) (seconds 0.5))) (not (logtest? (state-flags prevent-board) (-> self state-flags))) (< (-> self board board-time) (-> self control list-time-on-ground)) (not (logtest? (surface-flag no-board) (-> self control current-surface flags))) (or (not (logtest? (-> self control current-surface flags) (surface-flag duck))) (can-exit-duck? self)) (not (and (logtest? (-> self water flags) (water-flags under-water)) - (zero? (logand (-> self water flags) (water-flags swim-ground))) + (not (logtest? (-> self water flags) (water-flags swim-ground))) ) ) (not *artist-fix-visible*) @@ -289,7 +288,7 @@ ) (let ((v1-51 (new 'stack-no-clear 'vector))) (set! (-> v1-51 quad) (-> self control trans quad)) - (if (logtest? (-> self focus-status) (focus-status on-water)) + (if (focus-test? self on-water) (set! (-> v1-51 y) (-> self water height)) ) (set! (-> s5-0 0 quad) (-> v1-51 quad)) diff --git a/goal_src/jak2/engine/target/board/board-states.gc b/goal_src/jak2/engine/target/board/board-states.gc index d11aff906b..604606dd15 100644 --- a/goal_src/jak2/engine/target/board/board-states.gc +++ b/goal_src/jak2/engine/target/board/board-states.gc @@ -205,7 +205,7 @@ target-board-flip (-> *TARGET_BOARD-bank* jump-height-min) (-> *TARGET_BOARD-bank* jump-height-max) - (if (logtest? (focus-status halfpipe) (-> self focus-status)) + (if (focus-test? self halfpipe) 'halfpipe ) ) @@ -253,7 +253,7 @@ target-board-hold (-> *TARGET_BOARD-bank* tricky-jump-height-min) (-> *TARGET_BOARD-bank* tricky-jump-height-max) - (if (logtest? (focus-status halfpipe) (-> self focus-status)) + (if (focus-test? self halfpipe) 'halfpipe ) ) @@ -276,7 +276,7 @@ target-board-trickx (-> *TARGET_BOARD-bank* trickx-jump-height-min) (-> *TARGET_BOARD-bank* trickx-jump-height-max) - (if (logtest? (focus-status halfpipe) (-> self focus-status)) + (if (focus-test? self halfpipe) 'halfpipe ) ) @@ -288,7 +288,7 @@ ) (defbehavior target-board-halfpipe-trans target () - (when (and (logtest? (focus-status halfpipe) (-> self focus-status)) *camera*) + (when (and (focus-test? self halfpipe) *camera*) (let ((gp-0 (new 'stack-no-clear 'vector))) (let ((s5-0 (camera-master-method-15 *camera* (new 'stack-no-clear 'vector)))) (vector-flatten! gp-0 (-> self control edge-grab-across-edge-dir) (-> *camera* local-down)) @@ -1373,7 +1373,7 @@ :exit (-> target-board-halfpipe exit) :trans (behavior () (target-board-jump-trans) - (if (logtest? (focus-status halfpipe) (-> self focus-status)) + (if (focus-test? self halfpipe) (target-board-halfpipe-trans) ) (when (and (= *cheat-mode* 'debug) (and (cpad-hold? (-> self control cpad number) r2) (not *pause-lock*))) @@ -1420,7 +1420,7 @@ ) ) (cond - ((logtest? (focus-status halfpipe) (-> self focus-status)) + ((focus-test? self halfpipe) (ja :group! (-> self draw art-group data 152) :num! (identity (ja-aframe 0.0 0))) (loop (suspend) @@ -2057,7 +2057,7 @@ (go target-board-jump (-> *TARGET_BOARD-bank* jump-height-min) (-> *TARGET_BOARD-bank* jump-height-max) #f) ) (if (and (cpad-hold? (-> self control cpad number) l1) - (zero? (logand (-> self state-flags) (state-flags prevent-duck))) + (not (logtest? (-> self state-flags) (state-flags prevent-duck))) ) (go target-board-duck-stance) ) @@ -3103,7 +3103,7 @@ (logclear! (-> self focus-status) (focus-status dead hit)) (logclear! (-> self state-flags) (state-flags disable-attacks)) ) - (let ((gp-1 (logtest? (-> self focus-status) (focus-status hit)))) + (let ((gp-1 (focus-test? self hit))) (target-exit) (if gp-1 (logior! (-> self focus-status) (focus-status hit)) diff --git a/goal_src/jak2/engine/target/board/board-util.gc b/goal_src/jak2/engine/target/board/board-util.gc index 14a2965ac5..d29600cefc 100644 --- a/goal_src/jak2/engine/target/board/board-util.gc +++ b/goal_src/jak2/engine/target/board/board-util.gc @@ -69,14 +69,13 @@ :virtual #t :trans (behavior () (let ((v1-0 (-> self parent))) - (if (not (logtest? (-> (the-as target (if v1-0 - (the-as target (-> v1-0 0 self)) - ) - ) - focus-status - ) - (focus-status in-head) + (if (not (focus-test? + (the-as target (if v1-0 + (the-as target (-> v1-0 0 self)) + ) ) + in-head + ) ) (go-virtual idle #f) ) @@ -104,14 +103,13 @@ ) :trans (behavior () (let ((v1-0 (-> self parent))) - (if (logtest? (-> (the-as target (if v1-0 - (the-as target (-> v1-0 0 self)) - ) - ) - focus-status - ) - (focus-status in-head) + (if (focus-test? + (the-as target (if v1-0 + (the-as target (-> v1-0 0 self)) + ) ) + in-head + ) (go-virtual hidden) ) ) @@ -160,14 +158,13 @@ ) (let ((v1-2 (-> self parent))) (cond - ((logtest? (-> (the-as target (if v1-2 - (the-as target (-> v1-2 0 self)) - ) - ) - focus-status - ) - (focus-status in-head) + ((focus-test? + (the-as target (if v1-2 + (the-as target (-> v1-2 0 self)) + ) ) + in-head + ) (go-virtual hidden) ) ((let ((v1-9 #x40000) diff --git a/goal_src/jak2/engine/target/board/target-board.gc b/goal_src/jak2/engine/target/board/target-board.gc index 80305d4d69..40ce9c7ffa 100644 --- a/goal_src/jak2/engine/target/board/target-board.gc +++ b/goal_src/jak2/engine/target/board/target-board.gc @@ -627,6 +627,7 @@ ) ) +;; WARN: Return type mismatch none vs object. (defbehavior target-board-handler target ((arg0 process) (arg1 int) (arg2 symbol) (arg3 event-message-block)) (local-vars (v0-0 object) (a0-10 uint)) (the-as @@ -644,7 +645,7 @@ ((= v1-3 'change-mode) (let ((v1-7 (-> arg3 param 0))) (b! (!= v1-7 'grab) cfg-19 :delay (set! a0-10 (the-as uint #f))) - (b! (logtest? (-> self focus-status) (focus-status dead)) cfg-18 :delay (set! v0-0 #f)) + (b! (focus-test? self dead) cfg-18 :delay (set! v0-0 #f)) (set! v0-0 (if (not (-> arg3 param 1)) #t (go target-board-grab (the-as symbol a0-10)) @@ -738,7 +739,7 @@ (-> self control penetrate-using) ) (process-spawn part-tracker :init part-tracker-init (-> *part-group-id-table* 117) 0 #f #f self 25 :to self) - (target-timed-invulnerable (seconds 0.5) self 2) + (the-as object (target-timed-invulnerable (seconds 0.5) self 2)) ) ) (else @@ -755,7 +756,7 @@ ) (set! v0-0 (send-event-function arg0 a1-15)) ) - (when (the-as object v0-0) + (when v0-0 (let* ((v1-63 (-> self game)) (a0-68 (+ (-> v1-63 attack-id) 1)) ) @@ -777,7 +778,7 @@ ) ) ((= v1-3 'shove) - (when (not (logtest? (-> self focus-status) (focus-status hit))) + (when (not (focus-test? self hit)) (mem-copy! (the-as pointer (-> self attack-info-rec)) (the-as pointer (-> arg3 param 1)) 160) (when (not (logtest? (-> self attack-info-rec mask) (attack-info-mask attacker))) (set! (-> self attack-info-rec attacker) (process->handle arg0)) @@ -1022,7 +1023,7 @@ (< 0.7 (-> self control touch-angle)) (< 73728.0 (-> self control ctrl-xz-vel)) (and (< (vector-dot (-> self control wall-contact-normal) (-> self control dynam gravity-normal)) 0.3) - (zero? (logand (-> self control status) (collide-status touch-actor))) + (not (logtest? (-> self control status) (collide-status touch-actor))) ) ) (set! (-> self board smack-surface-time) (-> self clock frame-counter)) @@ -1202,12 +1203,12 @@ (defbehavior target-board-exit-check target () (if (and (or (and (cpad-pressed? (-> self control cpad number) r2) (or (!= *cheat-mode* 'debug) - (zero? (logand (-> *cpad-list* cpads (-> self control cpad number) button0-abs 0) (pad-buttons l2))) + (not (logtest? (-> *cpad-list* cpads (-> self control cpad number) button0-abs 0) (pad-buttons l2))) ) (not *pause-lock*) ) (logtest? (state-flags prevent-board) (-> self state-flags)) - (zero? (logand (-> *game-info* features) (game-feature board))) + (not (logtest? (-> *game-info* features) (game-feature board))) ) (and (>= (- (-> self clock frame-counter) (-> self board board-get-on-time)) (seconds 1)) (< (-> self board board-get-on-time) @@ -1225,7 +1226,7 @@ (defbehavior target-board-effect target () (let ((gp-0 0)) (cond - ((logtest? (focus-status rail) (-> self focus-status)) + ((focus-test? self rail) (set! gp-0 10) ) ((= (-> self control mod-surface name) 'spin) @@ -1235,7 +1236,7 @@ (set! gp-0 4) ) ((and (logtest? (-> self control mod-surface flags) (surface-flag air)) - (zero? (logand (-> self control status) (collide-status on-surface))) + (not (logtest? (-> self control status) (collide-status on-surface))) ) (set! gp-0 1) ) @@ -1487,7 +1488,7 @@ (defbehavior target-board-collision target () (let ((gp-0 (new 'stack-no-clear 'vector))) (set! (-> gp-0 quad) (-> self control transv quad)) - (when (logtest? (focus-status halfpipe) (-> self focus-status)) + (when (focus-test? self halfpipe) (when (-> self control unknown-spool-anim00) *edge-grab-info* (let ((v1-9 (new-stack-vector0)) @@ -1575,7 +1576,7 @@ (when (and (logtest? (-> self control status) (collide-status touch-wall)) (and (< 16384.0 f30-0) (not (and (-> self next-state) (= (-> self next-state name) 'target-board-smack))) - (not (logtest? (focus-status halfpipe) (-> self focus-status))) + (not (focus-test? self halfpipe)) (!= (-> self control ground-pat mode) 3) (>= (- (-> self clock frame-counter) (-> self board halfpipe-time)) (seconds 0.1)) ) @@ -1614,10 +1615,10 @@ (vector-normalize-copy! (new 'stack-no-clear 'vector) (-> self control transv) 1.0) (vector-y-quaternion! (new 'stack-no-clear 'vector) (-> self control dir-targ)) ) - (when (and (< (vector-dot s4-3 s5-3) -0.77) (zero? (logand (-> self focus-status) (focus-status dead hit)))) + (when (and (< (vector-dot s4-3 s5-3) -0.77) (not (logtest? (-> self focus-status) (focus-status dead hit)))) (cond ((not (and (logtest? (-> self control mod-surface flags) (surface-flag air)) - (zero? (logand (-> self control status) (collide-status on-surface))) + (not (logtest? (-> self control status) (collide-status on-surface))) ) ) (if (< 32768.0 f30-0) @@ -1692,7 +1693,7 @@ (defbehavior target-board-pre-move target () (cond ((and (and (logtest? (-> self control mod-surface flags) (surface-flag air)) - (zero? (logand (-> self control status) (collide-status on-surface))) + (not (logtest? (-> self control status) (collide-status on-surface))) ) (begin (set! (-> self board in-air-time) (-> self clock frame-counter)) @@ -1724,11 +1725,11 @@ (or (= v1-53 'target-board-hold) (= v1-53 'target-board-trickx)) ) ) - (zero? (logand (focus-status halfpipe) (-> self focus-status))) + (not (logtest? (focus-status halfpipe) (-> self focus-status))) ) (and (= (-> self control gspot-pat-surfce mode) (pat-mode halfpipe)) (and (< (fabs (vector-dot (-> self control gspot-normal) (-> self control dynam gravity-normal))) 0.7) - (zero? (logand (focus-status halfpipe) (-> self focus-status))) + (not (logtest? (focus-status halfpipe) (-> self focus-status))) ) ) ) @@ -1819,7 +1820,7 @@ (if (< (-> self control force-turn-to-strength) 0.0) (set! (-> self control force-turn-to-strength) (- 1.0 (-> self control cpad stick0-speed))) ) - (when (and (-> self board unknown-symbol00) (zero? (logand (focus-status halfpipe) (-> self focus-status)))) + (when (and (-> self board unknown-symbol00) (not (logtest? (focus-status halfpipe) (-> self focus-status)))) (let ((f30-0 (vector-dot (-> self control dynam gravity-normal) @@ -2083,7 +2084,7 @@ (seek! (-> self board cushion-offset) 0.0 (* 20480.0 (-> self clock seconds-per-frame))) ) ((and (logtest? (-> self control mod-surface flags) (surface-flag air)) - (zero? (logand (-> self control status) (collide-status on-surface))) + (not (logtest? (-> self control status) (collide-status on-surface))) ) (seek! (-> self board cushion-offset) @@ -2091,7 +2092,7 @@ (* 20480.0 (-> self clock seconds-per-frame)) ) ) - ((logtest? (-> self focus-status) (focus-status on-water)) + ((focus-test? self on-water) (seek! (-> self board cushion-offset) (+ 2048.0 (-> *TARGET_BOARD-bank* cushion)) @@ -2562,7 +2563,7 @@ (move-by-vector! (-> self control) a1-83) ) ) - (send-event self 'end-mode (zero? (logand s4-3 75))) + (send-event self 'end-mode (not (logtest? s4-3 75))) ) ) (vector-rotate-y! @@ -2760,7 +2761,7 @@ ) 0 ) - (when (logtest? (focus-status rail) (-> self focus-status)) + (when (focus-test? self rail) (let ((s3-2 (new 'stack-no-clear 'vector))) (let ((f28-1 (fmax @@ -2786,7 +2787,7 @@ ) (set! (-> self control status) (logior (collide-status probe-hit) (-> self control status))) ) - (if (and (-> self board ride-lock-on) (zero? (logand (collide-status probe-hit) (-> self control status)))) + (if (and (-> self board ride-lock-on) (not (logtest? (collide-status probe-hit) (-> self control status)))) (move-to-point! (-> self control) s3-2) ) ) diff --git a/goal_src/jak2/engine/target/collide-reaction-target.gc b/goal_src/jak2/engine/target/collide-reaction-target.gc index 83196a5b26..16c79c24ee 100644 --- a/goal_src/jak2/engine/target/collide-reaction-target.gc +++ b/goal_src/jak2/engine/target/collide-reaction-target.gc @@ -180,7 +180,7 @@ (< 0.3 (fabs (-> arg0 surface-angle))) ) ) - (zero? (logand sv-32 (cshape-reaction-flags csrf07))) + (not (logtest? sv-32 (cshape-reaction-flags csrf07))) ) (set! sv-32 (logior sv-32 (cshape-reaction-flags csrf06))) (set! sv-40 (logior sv-40 (collide-status touch-edge))) @@ -348,7 +348,7 @@ (set! (-> arg0 wall-contact-normal quad) (-> sv-84 quad)) (set! (-> arg0 wall-contact-pat) (-> arg1 best-other-tri pat)) (cond - ((and (logtest? (focus-status mech) (-> (the-as process-focusable (-> arg0 process)) focus-status)) + ((and (focus-test? (the-as process-focusable (-> arg0 process)) mech) (logtest? sv-104 (cshape-reaction-flags csrf15)) (logtest? sv-104 (cshape-reaction-flags csrf05)) (< 0.0 (vector-dot sv-84 (-> arg0 dynam gravity-normal))) @@ -381,7 +381,7 @@ 0.0 ) (and (< 0.0 (vector-dot (-> arg0 ground-poly-normal) arg2)) - (zero? (logand sv-104 (cshape-reaction-flags csrf05))) + (not (logtest? sv-104 (cshape-reaction-flags csrf05))) ) ) (set! sv-104 (logior sv-104 (cshape-reaction-flags csrf08))) @@ -402,8 +402,8 @@ (if (= (-> arg1 best-my-prim prim-id) 6) (set! (-> arg0 local-normal quad) (-> sv-84 quad)) ) - (if (and (logtest? (focus-status board) (-> (the-as process-focusable (-> arg0 process)) focus-status)) - (not (logtest? (focus-status halfpipe) (-> (the-as process-focusable (-> arg0 process)) focus-status))) + (if (and (focus-test? (the-as process-focusable (-> arg0 process)) board) + (not (focus-test? (the-as process-focusable (-> arg0 process)) halfpipe)) (!= (-> arg0 cur-pat mode) 3) (!= (-> arg0 ground-pat mode) 3) ) diff --git a/goal_src/jak2/engine/target/gun/gun-dark-shot.gc b/goal_src/jak2/engine/target/gun/gun-dark-shot.gc index 18aa299621..d9e0985473 100644 --- a/goal_src/jak2/engine/target/gun/gun-dark-shot.gc +++ b/goal_src/jak2/engine/target/gun/gun-dark-shot.gc @@ -156,9 +156,7 @@ (the-as uint (add-process *gui-control* obj (gui-channel background) (gui-action queue) "pmkrxplo" -99.0 0)) ) (set-falloff! *gui-control* (the-as sound-id (-> obj explode-sound)) #t 50 150 11) - (set! (-> obj start-pilot?) - (the-as basic (and *target* (logtest? (focus-status pilot) (-> *target* focus-status)))) - ) + (set! (-> obj start-pilot?) (the-as basic (and *target* (focus-test? *target* pilot)))) ((method-of-type projectile init-proj-settings!) obj) 0 (none) @@ -168,7 +166,7 @@ "Spawns associated particles with the projectile if applicable" (cond ((and (and (-> obj next-state) (= (-> obj next-state name) 'startup)) - (and *target* (logtest? (-> *target* focus-status) (focus-status in-head))) + (and *target* (focus-test? *target* in-head)) ) (kill-and-free-particles (-> obj part)) ) @@ -214,12 +212,10 @@ (until #f (cond ((or (and *target* - (logtest? (focus-status dead grabbed under-water pole flut board mech dark carry indax teleporting) - (-> *target* focus-status) - ) + (focus-test? *target* dead grabbed under-water pole flut board mech dark carry indax teleporting) ) - (and *target* (zero? (logand (focus-status in-head gun) (-> *target* focus-status)))) - (and *target* (not (-> self start-pilot?)) (logtest? (focus-status pilot) (-> *target* focus-status))) + (and *target* (not (logtest? (focus-status in-head gun) (-> *target* focus-status)))) + (and *target* (not (-> self start-pilot?)) (focus-test? *target* pilot)) ) (go-virtual dissipate) ) @@ -292,7 +288,7 @@ ) ) ) - (when (and *target* (logtest? (-> *target* focus-status) (focus-status in-head))) + (when (and *target* (focus-test? *target* in-head)) (set! (-> self core-position quad) (-> (camera-pos) quad)) (set! (-> self core-velocity quad) (-> (camera-matrix) vector 2 quad)) ) @@ -701,8 +697,8 @@ ((and (nonzero? (-> sv-256 root-prim prim-core collide-as)) s0-0 (logtest? (process-mask crate enemy collectable guard) (-> s0-0 mask)) - (not (logtest? (-> (the-as process-focusable s0-0) focus-status) (focus-status disable dead ignore))) - (zero? (logand (process-mask no-track) (-> s0-0 mask))) + (not (focus-test? (the-as process-focusable s0-0) disable dead ignore)) + (not (logtest? (process-mask no-track) (-> s0-0 mask))) ) (set! sv-288 (get-trans (the-as process-focusable s0-0) 3)) (let ((f28-0 (- (vector-vector-distance (-> self root-override trans) sv-288) (-> sv-288 w)))) @@ -798,14 +794,14 @@ (set! (-> self clock) (-> s5-0 0 clock)) (while (and (nonzero? (-> (the-as process-drawable (-> s5-0 0)) skel)) (let ((v1-30 s5-0)) - (and (or (logtest? (-> (the-as process-focusable (if v1-30 - (the-as process-focusable (-> v1-30 0 self)) - ) - ) - focus-status - ) - (focus-status dead hit) + (and (or (focus-test? + (the-as process-focusable (if v1-30 + (the-as process-focusable (-> v1-30 0 self)) + ) ) + dead + hit + ) (let ((v1-35 s5-0)) (or (and (-> (the-as process (if v1-35 (the-as process (-> v1-35 0 self)) @@ -830,8 +826,8 @@ ) ) (< (- (-> self clock frame-counter) s3-0) (seconds 5)) - (zero? (logand (-> (the-as process-drawable (-> s5-0 0)) draw status) (draw-control-status no-draw no-draw-temp)) - ) + (not (logtest? (-> (the-as process-drawable (-> s5-0 0)) draw status) (draw-control-status no-draw no-draw-temp)) + ) ) ) ) diff --git a/goal_src/jak2/engine/target/gun/gun-h.gc b/goal_src/jak2/engine/target/gun/gun-h.gc index ea1ad60a02..f8699787d7 100644 --- a/goal_src/jak2/engine/target/gun/gun-h.gc +++ b/goal_src/jak2/engine/target/gun/gun-h.gc @@ -134,19 +134,19 @@ (local-vars (v1-36 symbol)) (and (logtest? (-> arg0 game features) (game-feature gun)) (>= (- (-> self clock frame-counter) (-> arg0 gun gun-time)) (seconds 0.1)) - (not (logtest? (focus-status dead hit board mech dark teleporting) (-> arg0 focus-status))) + (not (focus-test? arg0 dead hit board mech dark teleporting)) (not (logtest? (surface-flag gun-inactive gun-hide gun-off) (-> arg0 control current-surface flags))) (not (logtest? (state-flags prevent-gun) (-> arg0 state-flags))) (logtest? (logand (-> *setting-control* user-current features) (game-feature gun-yellow gun-red gun-blue gun-dark)) (-> arg0 game features) ) (or (not (logtest? (-> arg0 control current-surface flags) (surface-flag duck))) (can-exit-duck? arg0)) - (or (not (logtest? (focus-status pilot) (-> arg0 focus-status))) (-> arg0 pilot gun?)) + (or (not (focus-test? arg0 pilot)) (-> arg0 pilot gun?)) (or arg1 (nonzero? (-> arg0 gun using-gun-type)) (begin (set! v1-36 (and (cpad-hold? (-> arg0 control cpad number) r1) - (not (logtest? (-> arg0 focus-status) (focus-status grabbed))) + (not (focus-test? arg0 grabbed)) (begin (set! v1-36 #t) (set! (-> arg0 gun latch?) v1-36) v1-36) ) ) diff --git a/goal_src/jak2/engine/target/gun/gun-util.gc b/goal_src/jak2/engine/target/gun/gun-util.gc index fabed53bb6..20450756ac 100644 --- a/goal_src/jak2/engine/target/gun/gun-util.gc +++ b/goal_src/jak2/engine/target/gun/gun-util.gc @@ -415,14 +415,13 @@ :virtual #t :trans (behavior () (let ((v1-0 (-> self parent))) - (if (not (logtest? (-> (the-as target (if v1-0 - (the-as target (-> v1-0 0 self)) - ) - ) - focus-status - ) - (focus-status in-head) + (if (not (focus-test? + (the-as target (if v1-0 + (the-as target (-> v1-0 0 self)) + ) ) + in-head + ) ) (go-virtual idle) ) @@ -445,7 +444,7 @@ (set! (-> self gun-type) (the-as pickup-type (-> (the-as target (-> self parent 0)) game gun-type))) (let ((a0-0 (ppointer->process (-> self parent)))) (cond - ((logtest? (-> (the-as target a0-0) focus-status) (focus-status in-head)) + ((focus-test? (the-as target a0-0) in-head) (go-virtual hidden) ) ((nonzero? (-> (the-as target (-> self parent 0)) gun gun-type)) @@ -503,14 +502,13 @@ (a0-1 (-> self parent)) ) (cond - ((logtest? (-> (the-as target (if a0-1 - (the-as target (-> a0-1 0 self)) - ) - ) - focus-status - ) - (focus-status in-head) + ((focus-test? + (the-as target (if a0-1 + (the-as target (-> a0-1 0 self)) + ) ) + in-head + ) (go-virtual hidden) ) ((and (= (-> (the-as target (-> self parent 0)) gun gun-type) (pickup-type none)) @@ -897,7 +895,7 @@ ) (ja-channel-set! 0) (ja-post) - (while (logtest? (-> (the-as target (-> self parent 0)) focus-status) (focus-status dead)) + (while (focus-test? (the-as target (-> self parent 0)) dead) (suspend) ) (go-virtual idle) diff --git a/goal_src/jak2/engine/target/logic-target.gc b/goal_src/jak2/engine/target/logic-target.gc index f91e403095..ee0c89133c 100644 --- a/goal_src/jak2/engine/target/logic-target.gc +++ b/goal_src/jak2/engine/target/logic-target.gc @@ -44,7 +44,7 @@ ) (set! (-> self control current-surface transv-max) (+ 20480.0 (-> self control current-surface transv-max))) ) - (when (and (and (logtest? (focus-status dark) (-> self focus-status)) (nonzero? (-> self darkjak))) + (when (and (and (focus-test? self dark) (nonzero? (-> self darkjak))) (or (= (-> self control mod-surface name) 'run) (= (-> self control mod-surface name) 'jump) (= (-> self control mod-surface name) 'attack) @@ -1150,7 +1150,7 @@ (logtest? (-> self control current-surface flags) (surface-flag turn-to-pad)) (!= (-> self control force-turn-to-strength) 0.0) ) - (zero? (logand (-> self control current-surface flags) (surface-flag turn-to-vel))) + (not (logtest? (-> self control current-surface flags) (surface-flag turn-to-vel))) ) (-> self control to-target-pt-xz) ) @@ -1174,7 +1174,7 @@ ((and (or (>= 0.0 (-> self control turn-to-magnitude)) (< (-> self clock frame-counter) (-> self control turn-lockout-end-time)) ) - (zero? (logand (-> self control current-surface flags) (surface-flag turn-when-centered))) + (not (logtest? (-> self control current-surface flags) (surface-flag turn-when-centered))) ) 0.0 ) @@ -1378,9 +1378,9 @@ (dotimes (s5-0 2) (let ((a1-4 (not (or (logtest? (state-flags lleg-no-ik rleg-no-ik) (-> self state-flags)) (and (logtest? (-> self control mod-surface flags) (surface-flag air)) - (zero? (logand (-> self control status) (collide-status on-surface))) + (not (logtest? (-> self control status) (collide-status on-surface))) ) - (logtest? (focus-status edge-grab pole flut pilot mech) (-> self focus-status)) + (focus-test? self edge-grab pole flut pilot mech) ) ) ) @@ -1629,7 +1629,7 @@ ) (if (and (= (-> self cam-user-mode) 'normal) (logtest? (-> self control mod-surface flags) (surface-flag look-around)) - (not (logtest? (focus-status edge-grab pole flut tube board pilot dark) (-> self focus-status))) + (not (focus-test? self edge-grab pole flut tube board pilot dark)) (-> *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)) (< 4096.0 (-> self control ctrl-xz-vel))) @@ -1638,11 +1638,11 @@ (send-event self 'change-mode 'look-around) ) ) - (if (!= (zero? (logand (-> self game features) (game-feature sidekick))) (not (-> self sidekick))) + (if (!= (not (logtest? (-> self game features) (game-feature sidekick))) (not (-> self sidekick))) (target-sidekick-setup (logtest? (-> self game features) (game-feature sidekick))) ) - (if (and (!= (zero? (logand (-> self game features) (game-feature board))) (not (-> self board board))) - (zero? (logand (focus-status board) (-> self focus-status))) + (if (and (!= (not (logtest? (-> self game features) (game-feature board))) (not (-> self board board))) + (not (logtest? (focus-status board) (-> self focus-status))) ) (target-board-setup (logtest? (-> self game features) (game-feature board))) ) @@ -1679,7 +1679,7 @@ (cpad-hold? (-> self control cpad number) r2) (cpad-hold? (-> self control cpad number) l2) (not *pause-lock*) - (not (logtest? (focus-status grabbed in-head pilot) (-> self focus-status))) + (not (focus-test? self grabbed in-head pilot)) (not (and (-> self next-state) (let ((v1-167 (-> self next-state name))) (or (= v1-167 'target-darkjak-get-on) (= v1-167 'target-float)) ) @@ -1689,7 +1689,7 @@ (send-event *camera* 'reset-follow) (set! (-> self control time-of-last-debug-float) (-> self clock frame-counter)) (cond - ((logtest? (focus-status mech indax) (-> self focus-status)) + ((focus-test? self mech indax) (if (not (and (-> self next-state) (let ((v1-179 (-> self next-state name))) (or (= v1-179 'target-falling) (= v1-179 'target-board-falling) @@ -1755,12 +1755,12 @@ (or (= v1-211 'target-walk) (= v1-211 'target-gun-walk)) ) ) - (zero? (logand (-> self control status) (collide-status on-surface))) + (not (logtest? (-> self control status) (collide-status on-surface))) ) ) (and (< f0-17 0.0) (and (or (not (and (= *cheat-mode* 'debug) (cpad-hold? (-> self control cpad number) r2))) *pause-lock*) - (not (logtest? (focus-status flut pilot mech indax) (-> self focus-status))) + (not (focus-test? self flut pilot mech indax)) (not (logtest? (-> self state-flags) (state-flags prevent-jump))) #t ) @@ -1772,7 +1772,7 @@ ) (let ((v1-229 (-> self current-level))) (when (and (or (>= (- (-> self clock frame-counter) (-> self control last-time-on-surface)) (seconds 2)) - (logtest? (focus-status pilot) (-> self focus-status)) + (focus-test? self pilot) ) (and v1-229 (< (-> self control trans y) (-> v1-229 info buttom-height)) @@ -1856,10 +1856,7 @@ (let ((f0-9 (+ (-> self hair 0 twist z) (* (-> self hair 0 twist-speed-x) (-> self clock seconds-per-frame))))) (set! (-> self hair 0 twist z) (- f0-9 (* (the float (the int (/ f0-9 1.0))) 1.0))) ) - (if (and (logtest? (focus-status pilot) (-> self focus-status)) - (nonzero? (-> self pilot)) - (= (-> self pilot stance) 1) - ) + (if (and (focus-test? self pilot) (nonzero? (-> self pilot)) (= (-> self pilot stance) 1)) (seek! (-> self hair 0 twist-max w) (lerp-scale 0.0 9102.223 (vector-length (-> self control transv)) 0.0 122880.0) @@ -1907,13 +1904,13 @@ (defbehavior bend-gravity target () (if (and (logtest? (-> self control root-prim prim-core action) (collide-action no-normal-reset)) - (zero? (logand (-> self control status) (collide-status on-surface))) + (not (logtest? (-> self control status) (collide-status on-surface))) ) (return #f) ) (let ((f0-1 (if (and (logtest? (-> self control status) (collide-status touch-wall)) - (zero? (logand (-> self control status) (collide-status on-surface))) + (not (logtest? (-> self control status) (collide-status on-surface))) ) 0.0 (-> self control bend-target) @@ -2325,20 +2322,20 @@ ) (set! (-> self control camera-pos quad) (-> s5-0 quad)) ) - ((logtest? (focus-status board pilot mech indax) (-> self focus-status)) + ((focus-test? self board pilot mech indax) (set! (-> self control camera-pos quad) (-> self control trans quad)) ) ((or (logtest? (-> self control status) (collide-status on-water)) (let ((v1-23 (-> self water flags))) (and (logtest? (water-flags touch-water) v1-23) (logtest? (water-flags under-water swimming) v1-23) - (zero? (logand (focus-status mech) (-> self focus-status))) + (not (logtest? (focus-status mech) (-> self focus-status))) ) ) ) (vector<-cspace! s5-0 (the-as cspace (-> self node-list data))) (if (not (and (logtest? (-> self water flags) (water-flags under-water)) - (zero? (logand (-> self water flags) (water-flags swim-ground))) + (not (logtest? (-> self water flags) (water-flags swim-ground))) ) ) (set! (-> s5-0 y) (- (-> self water surface-height) (-> self water swim-height))) @@ -2349,7 +2346,7 @@ (set! (-> self control camera-pos quad) (-> s5-0 quad)) ) ((not (and (logtest? (-> self water flags) (water-flags under-water)) - (zero? (logand (-> self water flags) (water-flags swim-ground))) + (not (logtest? (-> self water flags) (water-flags swim-ground))) ) ) (vector-lerp! @@ -2384,7 +2381,7 @@ (vector<-cspace! (-> self control camera-pos) (the-as cspace (-> self node-list data))) (set! (-> self control camera-pos y) (-> self water base-height)) ) - ((logtest? (focus-status tube) (-> self focus-status)) + ((focus-test? self tube) (set! (-> self control camera-pos quad) (-> self control gspot-pos quad)) ) ((logtest? (-> self draw status) (draw-control-status no-draw no-draw-temp)) @@ -2408,7 +2405,7 @@ ((>= f0-1 (-> self excitement)) (seek! (-> self excitement) f0-1 (* 6.0 (-> self clock seconds-per-frame))) ) - ((logtest? (-> self focus-status) (focus-status dead ignore hit)) + ((focus-test? self dead ignore hit) ) (else (seek! (-> self excitement) f0-1 (* 0.25 (-> self clock seconds-per-frame))) @@ -2431,7 +2428,7 @@ (set! (-> v1-29 blend) 0.0) ) (cond - ((logtest? (focus-status tube pilot indax) (-> self focus-status)) + ((focus-test? self tube pilot indax) ) ((logtest? (water-flags wading) (-> self water flags)) (let ((f30-0 (- (- (-> self control trans y) (- (-> self water height) (-> self water wade-height)))))) @@ -2475,17 +2472,17 @@ (vector-! (-> self control ctrl-to-hands-offset) (-> self control midpoint-of-hands) (-> self control trans)) (update-from-cspace (-> self control impact-ctrl)) (cond - ((logtest? (-> self focus-status) (focus-status edge-grab)) + ((focus-test? self edge-grab) (target-compute-edge) ) - ((logtest? (-> self focus-status) (focus-status pole)) + ((focus-test? self pole) (target-compute-pole) ) ) (target-calc-camera-pos) (set! (-> self control tongue-counter) 0) (cond - ((logtest? (focus-status indax) (-> self focus-status)) + ((focus-test? self indax) ) (else (target-gun-joint-points) @@ -2502,7 +2499,7 @@ (!= (-> self control mod-surface mode) 'swim) (!= (-> self control mod-surface mode) 'dive) (not (and (-> self next-state) (= (-> self next-state name) 'target-flop))) - (zero? (logand (-> self draw status) (draw-control-status no-draw no-draw-temp no-draw-bounds))) + (not (logtest? (-> self draw status) (draw-control-status no-draw no-draw-temp no-draw-bounds))) ) (set! (-> self control gspot-pos quad) (-> self control trans quad)) (set! (-> self control gspot-normal quad) (-> self control ground-poly-normal quad)) diff --git a/goal_src/jak2/engine/target/mech_suit/carry-h.gc b/goal_src/jak2/engine/target/mech_suit/carry-h.gc index 8d58be9e62..2bc56c6262 100644 --- a/goal_src/jak2/engine/target/mech_suit/carry-h.gc +++ b/goal_src/jak2/engine/target/mech_suit/carry-h.gc @@ -125,7 +125,7 @@ Returns `-1.0` if it exceeds the maximum allowed" ((or (< (-> obj max-distance) f26-0) (< (-> arg0 max-distance) f26-0) (< (-> obj max-angle) f30-0) - (or (< (-> arg0 max-angle) f28-1) (zero? (logand (-> obj mode) (-> arg0 mode)))) + (or (< (-> arg0 max-angle) f28-1) (not (logtest? (-> obj mode) (-> arg0 mode)))) ) (if (< (-> obj max-distance) f26-0) (format diff --git a/goal_src/jak2/engine/target/mech_suit/grunt-mech.gc b/goal_src/jak2/engine/target/mech_suit/grunt-mech.gc index adedb8b3ee..b04c14312f 100644 --- a/goal_src/jak2/engine/target/mech_suit/grunt-mech.gc +++ b/goal_src/jak2/engine/target/mech_suit/grunt-mech.gc @@ -111,7 +111,7 @@ (set! (-> obj last-update-time) s5-0) (let ((v1-8 *target*)) (cond - ((and v1-8 (logtest? (focus-status mech) (-> v1-8 focus-status))) + ((and v1-8 (focus-test? v1-8 mech)) (let ((s4-0 (-> v1-8 manipy 0 node-list data 3))) (dotimes (s3-0 6) (let ((s2-0 (-> obj holds s3-0))) @@ -148,10 +148,7 @@ (with-pp (grunt-mech-info-method-10 obj) (let ((v1-2 *target*)) - (when (and v1-2 - (logtest? (focus-status mech) (-> v1-2 focus-status)) - (zero? (logand (-> v1-2 focus-status) (focus-status dead ignore))) - ) + (when (and v1-2 (focus-test? v1-2 mech) (not (logtest? (-> v1-2 focus-status) (focus-status dead ignore)))) (let ((v1-8 (-> obj holds arg0))) (when (and (!= (-> v1-8 grunt-handle) #f) (= (handle->process (-> v1-8 grunt-handle)) arg1)) (set! (-> v1-8 timeout) (the-as uint (+ (-> pp clock frame-counter) (seconds 0.5)))) @@ -299,7 +296,7 @@ (let ((gp-0 (get-enemy-target obj))) (when gp-0 (cond - ((logtest? (focus-status mech) (-> gp-0 focus-status)) + ((focus-test? gp-0 mech) (let ((v1-4 (get-trans gp-0 0)) (a1-2 (new 'stack-no-clear 'vector)) ) @@ -481,7 +478,7 @@ (defmethod grunt-mech-method-192 grunt-mech ((obj grunt-mech)) (do-navigation-to-destination (-> obj nav state) (-> obj root-override2 trans)) (let ((a1-1 *target*)) - (if (or (not a1-1) (zero? (logand (focus-status mech) (-> a1-1 focus-status)))) + (if (or (not a1-1) (not (logtest? (focus-status mech) (-> a1-1 focus-status)))) (return #t) ) ) @@ -835,7 +832,7 @@ (let ((v1-33 (get-enemy-target self))) (when v1-33 (cond - ((logtest? (focus-status mech) (-> v1-33 focus-status)) + ((focus-test? v1-33 mech) (when (>= (-> self clock frame-counter) (-> self state-timeout)) (nav-enemy-method-161 self) (go-hostile self) diff --git a/goal_src/jak2/engine/target/mech_suit/mech-states.gc b/goal_src/jak2/engine/target/mech_suit/mech-states.gc index 408c5bb7dc..3aa0ac1728 100644 --- a/goal_src/jak2/engine/target/mech_suit/mech-states.gc +++ b/goal_src/jak2/engine/target/mech_suit/mech-states.gc @@ -468,7 +468,7 @@ (defstate target-mech-punch (target) :event (behavior ((proc process) (arg1 int) (event-type symbol) (event event-message-block)) (cond - ((logtest? (-> self focus-status) (focus-status dangerous)) + ((focus-test? self dangerous) (case event-type (('touched) (if ((method-of-type touching-shapes-entry prims-touching?) @@ -507,7 +507,7 @@ ) ) (if (and s4-1 - (and (or (and s5-2 (logtest? (-> (the-as process-focusable s5-2) focus-status) (focus-status dead))) + (and (or (and s5-2 (focus-test? (the-as process-focusable s5-2) dead)) (let ((a1-6 (new 'stack-no-clear 'event-message-block))) (set! (-> a1-6 from) (process->ppointer self)) (set! (-> a1-6 num-params) 2) @@ -529,7 +529,7 @@ ) ) s5-2 - (logtest? (-> (the-as process-focusable s5-2) focus-status) (focus-status dead)) + (focus-test? (the-as process-focusable s5-2) dead) ) ) (set! (-> self mech forward-vel) 0.0) @@ -607,7 +607,7 @@ (target-mech-punch-pick (the-as symbol gp-0)) (until (ja-done? 0) (compute-alignment! (-> self align)) - (when (and (not (logtest? (-> self focus-status) (focus-status dangerous))) + (when (and (not (focus-test? self dangerous)) (let ((v1-10 (ja-group))) (and v1-10 (or (= v1-10 (-> self draw art-group data 333)) (= v1-10 (-> self draw art-group data 334)) diff --git a/goal_src/jak2/engine/target/mech_suit/mech.gc b/goal_src/jak2/engine/target/mech_suit/mech.gc index 308ceee9fc..6e28a47f83 100644 --- a/goal_src/jak2/engine/target/mech_suit/mech.gc +++ b/goal_src/jak2/engine/target/mech_suit/mech.gc @@ -165,10 +165,10 @@ ) (when (and (and *target* (and (>= f30-0 (vector-vector-distance (-> self root-override trans) (-> *target* control trans))) - (zero? (logand (focus-status teleporting) (-> *target* focus-status))) + (not (logtest? (focus-status teleporting) (-> *target* focus-status))) ) ) - (not (logtest? (focus-status in-head pole board mech dark) (-> *target* focus-status))) + (not (focus-test? *target* in-head pole board mech dark)) (can-display-query? self (the-as string #f) -99.0) (-> *setting-control* user-current pilot) ) @@ -269,7 +269,7 @@ (while (zero? (ja-group-size)) (if (or (not *target*) (or (< 24576.0 (vector-vector-distance (-> self root-override trans) (-> *target* control trans))) - (logtest? (focus-status teleporting) (-> *target* focus-status)) + (focus-test? *target* teleporting) ) ) (go arg0) @@ -277,7 +277,7 @@ (mech-method-24 self) (suspend) ) - (while (and *target* (logtest? (focus-status mech) (-> *target* focus-status))) + (while (and *target* (focus-test? *target* mech)) (mech-method-24 self) (suspend) ) @@ -439,10 +439,10 @@ This commonly includes things such as: ) :trans (behavior () (if (and (and *target* (and (>= 98304.0 (vector-vector-distance (-> self root trans) (-> *target* control trans))) - (zero? (logand (focus-status teleporting) (-> *target* focus-status))) + (not (logtest? (focus-status teleporting) (-> *target* focus-status))) ) ) - (logtest? (focus-status mech) (-> *target* focus-status)) + (focus-test? *target* mech) ) (go-virtual active) ) @@ -471,10 +471,10 @@ This commonly includes things such as: ) :trans (behavior () (if (and (or (or (not *target*) (or (< 106496.0 (vector-vector-distance (-> self root trans) (-> *target* control trans))) - (logtest? (focus-status teleporting) (-> *target* focus-status)) + (focus-test? *target* teleporting) ) ) - (zero? (logand (focus-status mech) (-> *target* focus-status))) + (not (logtest? (focus-status mech) (-> *target* focus-status))) ) (>= (- (-> self clock frame-counter) (-> self state-time)) (seconds 10)) ) diff --git a/goal_src/jak2/engine/target/mech_suit/target-mech.gc b/goal_src/jak2/engine/target/mech_suit/target-mech.gc index 067f2198cb..42b3848c03 100644 --- a/goal_src/jak2/engine/target/mech_suit/target-mech.gc +++ b/goal_src/jak2/engine/target/mech_suit/target-mech.gc @@ -540,7 +540,7 @@ (let ((v1-7 (-> arg3 param 0))) (cond ((= v1-7 'grab) - (when (not (logtest? (-> self focus-status) (focus-status dead))) + (when (not (focus-test? self dead)) (if (not (-> arg3 param 1)) #t (go target-mech-grab) @@ -746,7 +746,7 @@ ) ) (('shove) - (when (not (logtest? (-> self focus-status) (focus-status dead hit))) + (when (not (focus-test? self dead hit)) (mem-copy! (the-as pointer (-> self attack-info-rec)) (the-as pointer (-> arg3 param 1)) 160) (when (not (logtest? (-> self attack-info-rec mask) (attack-info-mask attacker))) (set! (-> self attack-info-rec attacker) (process->handle arg0)) @@ -828,12 +828,12 @@ ) 'bounce ) - (zero? (logand (-> self focus-status) (focus-status dead hit))) + (not (logtest? (-> self focus-status) (focus-status dead hit))) ) (set! (-> self control last-trans-any-surf quad) (-> self control trans quad)) (target-timed-invulnerable (seconds 0.1) self 1) (cond - ((logtest? (focus-status carry) (-> self focus-status)) + ((focus-test? self carry) enter-state (let ((a0-19 (-> *TARGET-bank* mech-carry-jump-height-min)) (a1-8 (-> *TARGET-bank* mech-carry-jump-height-max)) @@ -1690,7 +1690,7 @@ ) (cond ((and (logtest? (-> self control mod-surface flags) (surface-flag air)) - (zero? (logand (-> self control status) (collide-status on-surface))) + (not (logtest? (-> self control status) (collide-status on-surface))) ) (add-thrust) ) diff --git a/goal_src/jak2/engine/target/target-anim.gc b/goal_src/jak2/engine/target/target-anim.gc index 8926083d19..ee6d44cd76 100644 --- a/goal_src/jak2/engine/target/target-anim.gc +++ b/goal_src/jak2/engine/target/target-anim.gc @@ -22,7 +22,7 @@ (else (let ((v1-9 (ja-group))) (if (or (and v1-9 (= v1-9 (-> self draw art-group data 394))) - (and (logtest? (focus-status dark) (-> self focus-status)) (nonzero? (-> self darkjak))) + (and (focus-test? self dark) (nonzero? (-> self darkjak))) ) (-> self draw art-group data 395) (-> self draw art-group data 24) @@ -369,7 +369,7 @@ ) ) (cond - ((and (logtest? (focus-status dark) (-> self focus-status)) (nonzero? (-> self darkjak))) + ((and (focus-test? self dark) (nonzero? (-> self darkjak))) (set! gp-0 30) ) (else @@ -402,9 +402,7 @@ ) ) (cond - ((and (rand-vu-percent? 0.3) - (not (and (logtest? (focus-status dark) (-> self focus-status)) (nonzero? (-> self darkjak)))) - ) + ((and (rand-vu-percent? 0.3) (not (and (focus-test? self dark) (nonzero? (-> self darkjak))))) (ja-channel-push! 1 (seconds 0.1)) (ja-no-eval :group! (-> self draw art-group data 6) :num! (seek! (the float (+ (-> (the-as art-joint-anim (-> self draw art-group data 6)) frames num-frames) -1))) @@ -446,7 +444,7 @@ (suspend) (ja :num! (seek! (ja-aframe 82.0 0))) ) - (when (not (and (logtest? (focus-status dark) (-> self focus-status)) (nonzero? (-> self darkjak)))) + (when (not (and (focus-test? self dark) (nonzero? (-> self darkjak)))) (ja-no-eval :group! (-> self draw art-group data 3) :num! (seek! (ja-aframe 142.0 0)) :frame-num (ja-aframe 82.0 0) @@ -485,7 +483,7 @@ ) ) (set! (-> self state-flags) (logior (state-flags lleg-still rleg-still) (-> self state-flags))) - (if (and (logtest? (focus-status dark) (-> self focus-status)) (nonzero? (-> self darkjak))) + (if (and (focus-test? self dark) (nonzero? (-> self darkjak))) (ja :group! (-> self draw art-group data 396)) (ja :group! (-> self draw art-group data 5)) ) @@ -650,7 +648,7 @@ (ja-no-eval :group! (-> self draw art-group data 27) :num! (loop!) :frame-num 0.0) (let ((s5-1 (-> self clock frame-counter))) (while (or (= arg0 -1) (and (< (- (-> self clock frame-counter) s5-1) arg0) - (zero? (logand (-> self control status) (collide-status on-surface))) + (not (logtest? (-> self control status) (collide-status on-surface))) ) ) (suspend) @@ -676,7 +674,7 @@ ((and (logtest? (-> self control status) (collide-status on-surface)) (let ((v1-15 (ja-group))) (and (not (and v1-15 (= v1-15 (-> self draw art-group data 24)))) - (zero? (logand (-> self control status) (collide-status on-water))) + (not (logtest? (-> self control status) (collide-status on-water))) ) ) ) @@ -948,7 +946,7 @@ ((and v1-84 (= v1-84 (-> self draw art-group data 71))) (ja-channel-push! 7 (seconds 0.15)) ) - ((and (logtest? (focus-status dark) (-> self focus-status)) (nonzero? (-> self darkjak))) + ((and (focus-test? self dark) (nonzero? (-> self darkjak))) (set! f24-0 55.0) (ja-channel-push! 7 (seconds 0.1)) ) @@ -965,7 +963,7 @@ (ja :group! (-> self draw art-group data 12)) (let ((f24-1 (ja-aframe f24-0 0))) (cond - ((and (logtest? (focus-status dark) (-> self focus-status)) (nonzero? (-> self darkjak))) + ((and (focus-test? self dark) (nonzero? (-> self darkjak))) (let ((s4-0 (-> self skel root-channel 0))) (let ((f0-3 0.0)) (set! (-> s4-0 frame-interp 1) f0-3) @@ -1066,7 +1064,7 @@ (set! (-> s4-6 frame-num) f24-1) ) (cond - ((and (logtest? (focus-status dark) (-> self focus-status)) (nonzero? (-> self darkjak))) + ((and (focus-test? self dark) (nonzero? (-> self darkjak))) (let ((s4-7 (-> self skel root-channel 3))) (let ((f0-17 0.0)) (set! (-> s4-7 frame-interp 1) f0-17) @@ -1134,7 +1132,7 @@ (* 2.0 (-> self clock seconds-per-frame)) ) ) - (if (and (logtest? (focus-status dark) (-> self focus-status)) (nonzero? (-> self darkjak))) + (if (and (focus-test? self dark) (nonzero? (-> self darkjak))) (set! f26-0 (seek f26-0 (lerp-scale f26-0 (* 0.7 f26-0) sv-16 1820.4445 3640.889) @@ -1395,9 +1393,7 @@ ) (let ((v1-26 (ja-group))) (and (and v1-26 (= v1-26 (-> self draw art-group data 23))) - (or (>= (ja-aframe-num 0) 38.0) - (and (logtest? (focus-status dark) (-> self focus-status)) (nonzero? (-> self darkjak))) - ) + (or (>= (ja-aframe-num 0) 38.0) (and (focus-test? self dark) (nonzero? (-> self darkjak)))) ) ) ) @@ -1625,7 +1621,7 @@ ) ) ) - ((and (logtest? (focus-status dark) (-> self focus-status)) (nonzero? (-> self darkjak))) + ((and (focus-test? self dark) (nonzero? (-> self darkjak))) (ja-no-eval :group! (-> self draw art-group data 395) :num! (seek! (the float (+ (-> (the-as art-joint-anim (-> self draw art-group data 395)) frames num-frames) -1))) :frame-num (ja-aframe 42.0 0) diff --git a/goal_src/jak2/engine/target/target-darkjak.gc b/goal_src/jak2/engine/target/target-darkjak.gc index 4d45f7650c..03b49817e8 100644 --- a/goal_src/jak2/engine/target/target-darkjak.gc +++ b/goal_src/jak2/engine/target/target-darkjak.gc @@ -35,43 +35,38 @@ (not *pause-lock*) (-> *setting-control* user-current darkjak) (logtest? (-> self game features) (game-feature darkjak)) - (not (logtest? (focus-status - dead - hit - grabbed - in-head - under-water - edge-grab - pole - flut - tube - board - pilot - mech - carry - indax - teleporting - ) - (-> self focus-status) - ) + (not (focus-test? + self + dead + hit + grabbed + in-head + under-water + edge-grab + pole + flut + tube + board + pilot + mech + carry + indax + teleporting + ) ) (not (and (logtest? (-> self water flags) (water-flags under-water)) - (zero? (logand (-> self water flags) (water-flags swim-ground))) + (not (logtest? (-> self water flags) (water-flags swim-ground))) ) ) - (or (and (not (and (logtest? (focus-status dark) (-> self focus-status)) (nonzero? (-> self darkjak)))) + (or (and (not (and (focus-test? self dark) (nonzero? (-> self darkjak)))) (and (>= (- (-> self clock frame-counter) (-> (the-as fact-info-target (-> self fact-override)) darkjak-start-time)) (seconds 0.05) ) (>= (-> self game eco-pill-dark) (-> *FACT-bank* eco-pill-dark-max-default)) ) ) - (and (and (logtest? (focus-status dark) (-> self focus-status)) (nonzero? (-> self darkjak))) - (not (and (logtest? (focus-status dark) (-> self focus-status)) - (nonzero? (-> self darkjak)) - (logtest? (-> self darkjak stage) 32) - ) - ) + (and (and (focus-test? self dark) (nonzero? (-> self darkjak))) + (not (and (focus-test? self dark) (nonzero? (-> self darkjak)) (logtest? (-> self darkjak stage) 32))) (logtest? (game-feature darkjak-giant) (-> self game features)) ) ) @@ -85,7 +80,7 @@ ) (defbehavior target-darkjak-end-mode target () - (when (and (logtest? (focus-status dark) (-> self focus-status)) (nonzero? (-> self darkjak))) + (when (and (focus-test? self dark) (nonzero? (-> self darkjak))) (logclear! (-> self focus-status) (focus-status dark)) (send-event self 'reset-collide) (logclear! (-> self state-flags) (state-flags sf4)) @@ -106,7 +101,7 @@ (defbehavior target-darkjak-process target () (local-vars (t2-0 none) (gp-0 vector)) (cond - ((and (logtest? (focus-status dark) (-> self focus-status)) (nonzero? (-> self darkjak))) + ((and (focus-test? self dark) (nonzero? (-> self darkjak))) (let ((a1-0 'eco-red)) (target-danger-set! (-> self control danger-mode) a1-0) ) @@ -124,9 +119,9 @@ ) (not (-> *setting-control* user-current darkjak)) ) - (not (logtest? (-> self focus-status) (focus-status dead dangerous hit grabbed))) + (not (focus-test? self dead dangerous hit grabbed)) (not (and (-> self next-state) (= (-> self next-state name) 'target-darkjak-get-off))) - (zero? (logand (-> self darkjak stage) 1)) + (not (logtest? (-> self darkjak stage) 1)) ) (go target-darkjak-get-off) ) @@ -152,10 +147,7 @@ ) (let ((f26-1 (* 1.1 f26-0))) (cond - ((and (logtest? (focus-status dark) (-> self focus-status)) - (nonzero? (-> self darkjak)) - (logtest? (-> self darkjak stage) 32) - ) + ((and (focus-test? self dark) (nonzero? (-> self darkjak)) (logtest? (-> self darkjak stage) 32)) (set! gp-0 (new 'stack-no-clear 'vector)) (set! (-> gp-0 x) (/ f28-0 (* f28-0 f26-1 (lerp-scale 1.0 1.3 f30-0 0.0 1.0)))) (set! (-> gp-0 y) (/ f28-0 (* f28-0 (lerp-scale 1.0 1.4 f30-0 0.0 1.0)))) @@ -220,7 +212,7 @@ ) ) (when (and (>= f30-0 0.5) - (not (logtest? (-> self focus-status) (focus-status in-head))) + (not (focus-test? self in-head)) (not (logtest? (-> self draw status) (draw-control-status no-draw no-draw-temp))) (not (movie?)) ) @@ -307,7 +299,7 @@ ) :code (behavior ((arg0 int)) (send-event (handle->process (-> self notify)) 'notify 'attack 15) - (if (and (logtest? (focus-status dark) (-> self focus-status)) (nonzero? (-> self darkjak))) + (if (and (focus-test? self dark) (nonzero? (-> self darkjak))) (go target-darkjak-giant) ) (set! (-> self darkjak stage) (the-as uint (logior arg0 2))) @@ -374,7 +366,7 @@ (when (and (or (not (cpad-hold? (-> self control cpad number) l2)) (and (= *cheat-mode* 'debug) (cpad-hold? (-> self control cpad number) r2)) ) - (and (< (ja-aframe-num 0) 5.0) (zero? (logand arg0 1))) + (and (< (ja-aframe-num 0) 5.0) (not (logtest? arg0 1))) ) (let ((v1-131 (the-as sound-rpc-set-param (get-sound-buffer-entry)))) (set! (-> v1-131 command) (sound-command set-param)) @@ -396,10 +388,7 @@ (send-event *traffic-manager* 'increase-alert-level - (if (and (logtest? (focus-status dark) (-> self focus-status)) - (nonzero? (-> self darkjak)) - (logtest? (-> self darkjak stage) 16) - ) + (if (and (focus-test? self dark) (nonzero? (-> self darkjak)) (logtest? (-> self darkjak stage) 16)) 3 2 ) @@ -419,7 +408,7 @@ (('change-mode) (case (-> event param 0) (('grab) - (when (not (logtest? (-> self focus-status) (focus-status dead))) + (when (not (focus-test? self dead)) (if (not (-> event param 1)) #t (go target-grab 'stance) @@ -469,7 +458,7 @@ (cond ((and (logtest? (water-flags touch-water) v1-1) (logtest? (water-flags under-water swimming) v1-1) - (zero? (logand (focus-status mech) (-> self focus-status))) + (not (logtest? (focus-status mech) (-> self focus-status))) ) (go target-swim-stance) ) @@ -520,11 +509,7 @@ (until (ja-done? 0) (set! (-> self darkjak-interp) (lerp-scale 1.0 0.0 (ja-aframe-num 0) 90.0 115.0)) (if (and (!= (-> *cpad-list* cpads (-> self control cpad number) stick0-speed) 0.0) - (or (not (and (logtest? (focus-status dark) (-> self focus-status)) - (nonzero? (-> self darkjak)) - (logtest? (-> self darkjak stage) 32) - ) - ) + (or (not (and (focus-test? self dark) (nonzero? (-> self darkjak)) (logtest? (-> self darkjak stage) 32))) (= (-> self darkjak-interp) 0.0) ) ) @@ -541,11 +526,7 @@ (while (not (ja-done? 0)) (set! (-> self darkjak-interp) (lerp-scale 1.0 0.0 (ja-aframe-num 0) 90.0 115.0)) (if (and (!= (-> *cpad-list* cpads (-> self control cpad number) stick0-speed) 0.0) - (or (not (and (logtest? (focus-status dark) (-> self focus-status)) - (nonzero? (-> self darkjak)) - (logtest? (-> self darkjak stage) 32) - ) - ) + (or (not (and (focus-test? self dark) (nonzero? (-> self darkjak)) (logtest? (-> self darkjak stage) 32))) (= (-> self darkjak-interp) 0.0) ) ) @@ -565,11 +546,7 @@ (set! (-> self darkjak-interp) (lerp-scale 1.0 0.0 (ja-aframe-num 0) 10.0 60.0)) (if (and (>= (ja-aframe-num 0) 24.0) (!= (-> *cpad-list* cpads (-> self control cpad number) stick0-speed) 0.0) - (or (not (and (logtest? (focus-status dark) (-> self focus-status)) - (nonzero? (-> self darkjak)) - (logtest? (-> self darkjak stage) 32) - ) - ) + (or (not (and (focus-test? self dark) (nonzero? (-> self darkjak)) (logtest? (-> self darkjak stage) 32))) (= (-> self darkjak-interp) 0.0) ) ) @@ -586,11 +563,7 @@ (set! (-> self darkjak-interp) (lerp-scale 1.0 0.0 (ja-aframe-num 0) 10.0 60.0)) (if (and (>= (ja-aframe-num 0) 24.0) (!= (-> *cpad-list* cpads (-> self control cpad number) stick0-speed) 0.0) - (or (not (and (logtest? (focus-status dark) (-> self focus-status)) - (nonzero? (-> self darkjak)) - (logtest? (-> self darkjak stage) 32) - ) - ) + (or (not (and (focus-test? self dark) (nonzero? (-> self darkjak)) (logtest? (-> self darkjak stage) 32))) (= (-> self darkjak-interp) 0.0) ) ) @@ -689,10 +662,7 @@ (if (and (cpad-pressed? (-> self control cpad number) square) (not (logtest? (-> self state-flags) (state-flags prevent-jump prevent-attack))) (not (logtest? (-> self control current-surface flags) (surface-flag no-attack))) - (and (logtest? (focus-status dark) (-> self focus-status)) - (nonzero? (-> self darkjak)) - (logtest? (-> self darkjak stage) 2) - ) + (and (focus-test? self dark) (nonzero? (-> self darkjak)) (logtest? (-> self darkjak stage) 2)) (< sv-32 2) ) (set! sv-40 (the-as int (-> self clock frame-counter))) @@ -1278,10 +1248,7 @@ ) ) ) - (if (and (logtest? (focus-status dark) (-> self focus-status)) - (nonzero? (-> self darkjak)) - (logtest? (-> self darkjak stage) 32) - ) + (if (and (focus-test? self dark) (nonzero? (-> self darkjak)) (logtest? (-> self darkjak stage) 32)) (set! (-> sv-80 y) (* 0.5 (+ (-> self control trans y) (-> self control root-prim prim-core world-sphere y)))) (set! (-> sv-80 y) (-> self control root-prim prim-core world-sphere y)) ) @@ -1364,9 +1331,7 @@ (suspend) (ja-eval) ) - (when (and (logtest? (focus-status dark) (-> self focus-status)) - (and (nonzero? (-> self darkjak)) (logtest? (-> self darkjak stage) 32)) - ) + (when (and (focus-test? self dark) (and (nonzero? (-> self darkjak)) (logtest? (-> self darkjak stage) 32))) (let ((gp-10 (process-spawn manipy :init manipy-init @@ -1518,13 +1483,11 @@ (set! (-> v1-19 id) (the-as uint arg3)) (set! (-> v1-19 mode) 'ice) (set! (-> v1-19 damage) 15.0) - (set! (-> v1-19 penetrate-using) (if (and (logtest? (focus-status dark) (-> self focus-status)) - (nonzero? (-> self darkjak)) - (logtest? (-> self darkjak stage) 32) - ) - (penetrate touch dark-skin dark-bomb dark-giant) - (penetrate touch dark-skin dark-bomb) - ) + (set! (-> v1-19 penetrate-using) + (if (and (focus-test? self dark) (nonzero? (-> self darkjak)) (logtest? (-> self darkjak stage) 32)) + (penetrate touch dark-skin dark-bomb dark-giant) + (penetrate touch dark-skin dark-bomb) + ) ) (set! (-> a1-6 param 1) (the-as uint v1-19)) ) @@ -1786,9 +1749,7 @@ ) ) (set! (-> sv-56 r) - (if (and (logtest? (focus-status dark) (-> self focus-status)) - (and (nonzero? (-> self darkjak)) (logtest? (-> self darkjak stage) 32)) - ) + (if (and (focus-test? self dark) (and (nonzero? (-> self darkjak)) (logtest? (-> self darkjak stage) 32))) 614400.0 327680.0 ) diff --git a/goal_src/jak2/engine/target/target-death.gc b/goal_src/jak2/engine/target/target-death.gc index be491c847d..f6505a224b 100644 --- a/goal_src/jak2/engine/target/target-death.gc +++ b/goal_src/jak2/engine/target/target-death.gc @@ -564,7 +564,7 @@ ((begin (target-timed-invulnerable (-> arg0 invinc-time) self 1) (cpad-set-buzz! (-> *cpad-list* cpads 0) 0 255 (seconds 0.5)) - (logtest? (focus-status indax) (-> self focus-status)) + (focus-test? self indax) ) (let* ((v1-14 (rand-vu-int-count 4)) (t0-1 (cond @@ -665,7 +665,7 @@ ) (case (-> arg4 angle) (('jump 'up 'up-forward) - (when (and (not (logtest? (focus-status flut pilot mech indax) (-> self focus-status))) + (when (and (not (focus-test? self flut pilot mech indax)) (not (and (= (-> self game mode) 'play) (>= 0.0 (-> self fact-override health)))) ) (if (and (cpad-pressed? (-> self control cpad number) circle) (can-feet? #f)) @@ -993,7 +993,7 @@ (vector-xz-normalize! (-> sv-32 vector) (- (fabs (-> sv-32 shove-back)))) (set! (-> sv-32 vector y) (-> sv-32 shove-up)) ) - (when (and (logtest? (focus-status dark) (-> self focus-status)) (nonzero? (-> self darkjak))) + (when (and (focus-test? self dark) (nonzero? (-> self darkjak))) (set! (-> sv-32 damage) (fmax 1.0 (ceil (* 0.5 (-> sv-32 damage))))) (if (< (- (-> self fact-override health) (-> sv-32 damage)) 1.0) (set! (-> sv-32 damage) (+ -1.0 (-> self fact-override health))) @@ -1256,9 +1256,7 @@ (set! (-> self control mod-surface) *smack-mods*) (target-hit-setup-anim sv-32) (target-hit-move sv-32 (target-hit-orient sv-32 sv-36) target-falling-anim-trans 1.0) - (if (and (and (logtest? (focus-status dark) (-> self focus-status)) (nonzero? (-> self darkjak))) - (>= 1.0 (-> self fact-override health)) - ) + (if (and (and (focus-test? self dark) (nonzero? (-> self darkjak))) (>= 1.0 (-> self fact-override health))) (go target-darkjak-get-off) ) (if (and (= (-> self game mode) 'play) (>= 0.0 (-> self fact-override health))) @@ -1453,7 +1451,7 @@ ((= (the-as object arg1) 'wait) (set! (-> self trans-hook) #f) (set! (-> self control unknown-word04) (the-as uint #f)) - (when (not (logtest? (focus-status pilot) (-> self focus-status))) + (when (not (focus-test? self pilot)) (set! (-> self post-hook) target-no-ja-move-post) (ja-post) ) @@ -1580,7 +1578,7 @@ (let ((v1-21 (-> self water flags))) (if (or (and (logtest? (water-flags touch-water) v1-21) (logtest? (water-flags under-water swimming) v1-21) - (zero? (logand (focus-status mech) (-> self focus-status))) + (not (logtest? (focus-status mech) (-> self focus-status))) ) (= (-> self control cur-pat material) (pat-material waterbottom)) ) @@ -1761,7 +1759,7 @@ (b! (or (and (logtest? (water-flags touch-water) v1-159) (logtest? (water-flags under-water swimming) v1-159) - (zero? (logand (focus-status mech) (-> self focus-status))) + (not (logtest? (focus-status mech) (-> self focus-status))) ) (= (-> self control cur-pat material) (pat-material waterbottom)) ) diff --git a/goal_src/jak2/engine/target/target-gun.gc b/goal_src/jak2/engine/target/target-gun.gc index d8bbf4c8af..b41fb8a31d 100644 --- a/goal_src/jak2/engine/target/target-gun.gc +++ b/goal_src/jak2/engine/target/target-gun.gc @@ -118,7 +118,7 @@ (('change-mode) (case (-> arg3 param 0) (('grab) - (when (not (logtest? (-> self focus-status) (focus-status dead))) + (when (not (focus-test? self dead)) (if (not (-> arg3 param 1)) #t (go target-grab 'stance) @@ -244,7 +244,7 @@ ) ) (cond - ((logtest? (-> self focus-status) (focus-status pilot-riding)) + ((focus-test? self pilot-riding) (case (-> self gun gun-type) (((pickup-type eco-yellow)) (push-anim-to-targ @@ -381,11 +381,11 @@ (set! (-> self gun active?) #f) (cond ((and (not (logtest? (surface-flag gun-fast-exit) (-> self control current-surface flags))) - (zero? (logand (-> self focus-status) (focus-status dead))) + (not (logtest? (-> self focus-status) (focus-status dead))) ) (sound-play "gun-putaway") (cond - ((logtest? (-> self focus-status) (focus-status pilot-riding)) + ((focus-test? self pilot-riding) (case (-> self gun gun-type) (((pickup-type eco-yellow)) (push-anim-to-targ @@ -716,7 +716,7 @@ (quat<-gun! (the-as quaternion (-> self gun top-anim-twist-targ)) (the-as quaternion arg0)) (set! (-> self skel top-anim frame-post-blend) 0.1333333) (cond - ((logtest? (-> self focus-status) (focus-status pilot-riding)) + ((focus-test? self pilot-riding) (let ((v1-164 arg0)) (cond ((and (= s5-0 (pickup-type eco-red)) (= v1-164 4)) @@ -1078,8 +1078,8 @@ (defun target-gun-marking-menu ((arg0 target)) (when (and (not (paused?)) - (not (and (logtest? (focus-status dark) (-> arg0 focus-status)) (nonzero? (-> arg0 darkjak)))) - (zero? (logand (-> arg0 focus-status) (focus-status grabbed))) + (not (and (focus-test? arg0 dark) (nonzero? (-> arg0 darkjak)))) + (not (logtest? (-> arg0 focus-status) (focus-status grabbed))) ) (let ((s5-0 (the-as int (-> arg0 gun using-gun-type)))) (cond @@ -1100,9 +1100,7 @@ (and (logtest? (the-as game-feature (ash 1 (+ s5-0 5))) (logand (-> arg0 game features) (-> *setting-control* user-current features)) ) - (or (not (logtest? (focus-status pilot) (-> arg0 focus-status))) - (and (nonzero? (-> arg0 pilot)) (-> arg0 pilot gun?)) - ) + (or (not (focus-test? arg0 pilot)) (and (nonzero? (-> arg0 pilot)) (-> arg0 pilot gun?))) (begin (set! (-> arg0 gun using-gun-type) (the-as pickup-type s5-0)) (and s5-0 @@ -1142,17 +1140,15 @@ (let ((s5-0 (new 'stack-no-clear 'vector))) (let ((s4-0 (-> self gun track-dir))) (set! (-> s4-0 quad) - (-> (the-as - vector - (if (and (or (= (-> *cpad-list* cpads (-> self control cpad number) stick0-speed) 0.0) - (logtest? (surface-flag gun-strafe) (-> self control current-surface flags)) - ) - (not (and (logtest? (focus-status dark) (-> self focus-status)) (nonzero? (-> self darkjak)))) - ) - (-> self gun fire-dir) - (-> self control to-target-pt-xz) - ) - ) + (-> (the-as vector (if (and (or (= (-> *cpad-list* cpads (-> self control cpad number) stick0-speed) 0.0) + (logtest? (surface-flag gun-strafe) (-> self control current-surface flags)) + ) + (not (and (focus-test? self dark) (nonzero? (-> self darkjak)))) + ) + (-> self gun fire-dir) + (-> self control to-target-pt-xz) + ) + ) quad ) ) @@ -1184,7 +1180,7 @@ (let ((gp-0 (the-as basic #f))) (when (and (or (< (- (-> self clock frame-counter) (-> self control time-of-last-nonzero-input)) (seconds 0.2)) (and (logtest? (-> self control mod-surface flags) (surface-flag air)) - (zero? (logand (-> self control status) (collide-status on-surface))) + (not (logtest? (-> self control status) (collide-status on-surface))) ) (or (logtest? (surface-flag gun-direct) (-> self control current-surface flags)) (= (-> self gun gun-type) (pickup-type eco-dark)) @@ -1210,7 +1206,7 @@ ) ) ((or (and (logtest? (-> self control mod-surface flags) (surface-flag air)) - (zero? (logand (-> self control status) (collide-status on-surface))) + (not (logtest? (-> self control status) (collide-status on-surface))) ) (logtest? (surface-flag gun-direct) (-> self control current-surface flags)) ) @@ -1277,9 +1273,7 @@ (let ((s5-1 (handle->process (-> self gun track-target 0 handle)))) (cond ((or (not s5-1) - (or (and (logtest? (-> (the-as process-focusable s5-1) focus-status) (focus-status dead)) - (zero? (-> self gun track-target-hold-time)) - ) + (or (and (focus-test? (the-as process-focusable s5-1) dead) (zero? (-> self gun track-target-hold-time))) (and (not (and (nonzero? (-> self gun track-target-hold-time)) (< (-> self clock frame-counter) (-> self gun track-target-hold-time)) ) @@ -1298,7 +1292,7 @@ ) ) (and (or (and (logtest? (-> self control mod-surface flags) (surface-flag air)) - (zero? (logand (-> self control status) (collide-status on-surface))) + (not (logtest? (-> self control status) (collide-status on-surface))) ) (logtest? (surface-flag gun-direct) (-> self control current-surface flags)) ) @@ -1404,7 +1398,7 @@ (defbehavior target-top-anim-base-mode target ((arg0 int)) (cond - ((logtest? (-> self focus-status) (focus-status pilot-riding)) + ((focus-test? self pilot-riding) (case (-> self gun gun-type) (((pickup-type eco-yellow)) (push-anim-to-targ @@ -1526,7 +1520,7 @@ ) (defbehavior target-gun-joint-pre0 target () - (if (!= (zero? (logand (-> self game features) (game-feature gun))) (not (-> self gun gun))) + (if (!= (not (logtest? (-> self game features) (game-feature gun))) (not (-> self gun gun))) (target-gun-setup (logtest? (-> self game features) (game-feature gun))) ) (if (and (>= (- (-> self clock frame-counter) (-> self gun combo-window-start)) (seconds 0.7)) @@ -1537,7 +1531,7 @@ (cond ((and (cpad-pressed? (-> self control cpad number) r1) (< (- (-> self clock frame-counter) (-> self gun combo-window-start)) (seconds 0.7)) - (not (logtest? (focus-status mech dark) (-> self focus-status))) + (not (focus-test? self mech dark)) (not (logtest? (surface-flag gun-off) (-> self control current-surface flags))) (not (logtest? (state-flags prevent-gun) (-> self state-flags))) (zero? (-> self gun track-target-hold-time)) @@ -1639,12 +1633,12 @@ (cond ((or (and (not (logtest? (-> self control status) (collide-status on-surface))) (or (and (logtest? (-> self control mod-surface flags) (surface-flag air)) - (zero? (logand (-> self control status) (collide-status on-surface))) + (not (logtest? (-> self control status) (collide-status on-surface))) ) (< 2048.0 (target-height-above-ground)) ) ) - (logtest? (-> self focus-status) (focus-status edge-grab)) + (focus-test? self edge-grab) (-> *setting-control* user-current doorway) ) (if (!= (-> self control duck-gun-tube-transision) 0.0) @@ -1688,7 +1682,7 @@ ) (target-gun-find-track) (cond - ((and (= (-> self gun gun-type) (pickup-type eco-blue)) (zero? (logand (-> self gun track?) 1))) + ((and (= (-> self gun gun-type) (pickup-type eco-blue)) (not (logtest? (-> self gun track?) 1))) (let ((f0-8 (vector-vector-distance (-> self gun fire-point) (-> self gun laser-hit-point)))) (cond ((< f0-8 122880.0) @@ -1735,7 +1729,7 @@ ) (and (logtest? (-> self gun track?) 1) (logtest? (-> self gun track?) 4)) (or (logtest? (surface-flag gun-strafe) (-> self control current-surface flags)) - (logtest? (-> self focus-status) (focus-status pilot-riding)) + (focus-test? self pilot-riding) ) ) (seek! (-> self upper-body twist z) 0.0 (* 65536.0 (-> self clock seconds-per-frame))) @@ -1744,7 +1738,7 @@ (seek! (-> self upper-body twist z) 0.0 (* 16384.0 (-> self clock seconds-per-frame))) ) ((and (< 0.0 (-> self control turn-to-magnitude)) - (zero? (logand (-> self control current-surface flags) (surface-flag duck))) + (not (logtest? (-> self control current-surface flags) (surface-flag duck))) ) (let* ((f0-28 (deg-diff (y-angle (-> self control)) (vector-y-angle (-> self control to-target-pt-xz)))) (f0-30 (fmax -5461.3335 (fmin 5461.3335 f0-28))) @@ -1822,7 +1816,7 @@ (set! (-> self gun upper-body twist-speed-x) 0.6) ) ((and (or (and (logtest? (-> self control mod-surface flags) (surface-flag air)) - (zero? (logand (-> self control status) (collide-status on-surface))) + (not (logtest? (-> self control status) (collide-status on-surface))) ) (logtest? (surface-flag gun-direct) (-> self control current-surface flags)) ) @@ -1899,7 +1893,7 @@ (local-vars (gp-0 art-element)) (target-gun-joint-pre0) (cond - ((logtest? (-> self focus-status) (focus-status pilot-riding)) + ((focus-test? self pilot-riding) (let ((v1-3 (-> self gun gun-type))) (set! (-> self skel top-anim base-anim) (cond ((= v1-3 (pickup-type eco-yellow)) @@ -2092,16 +2086,16 @@ (matrix-lerp! gp-0 a1-0 a2-0 (-> self gun gun-daxter)) (matrix->transformq (-> self gun gun-pos) gp-0) (set! (-> self gun gun-pos scale quad) (-> self control scale quad)) - (when (and (using-gun? self) (and (logtest? (-> self focus-status) (focus-status edge-grab)) - (let ((v1-18 (ja-group))) - (and v1-18 (or (= v1-18 (-> self draw art-group data 27)) - (= v1-18 (-> self draw art-group data 35)) - (= v1-18 (-> self draw art-group data 33)) - (= v1-18 (-> self draw art-group data 34)) - ) - ) - ) - ) + (when (and (using-gun? self) + (and (focus-test? self edge-grab) (let ((v1-18 (ja-group))) + (and v1-18 (or (= v1-18 (-> self draw art-group data 27)) + (= v1-18 (-> self draw art-group data 35)) + (= v1-18 (-> self draw art-group data 33)) + (= v1-18 (-> self draw art-group data 34)) + ) + ) + ) + ) ) (let ((s4-0 (new 'static 'vector :y 491.52 :w 1.0)) (a1-5 (new 'static 'vector :x -16384.0 :z -16384.0 :w 1.0)) @@ -2126,7 +2120,7 @@ (defbehavior target-gun-joint-points target () (when (-> self gun gun) (set! (-> self gun gun-daxter) - (if (and (logtest? (-> self focus-status) (focus-status pilot-riding)) + (if (and (focus-test? self pilot-riding) (nonzero? (-> self skel float-channels)) (= (-> (get-channel (-> self skel top-anim) (the-as int (+ (-> self skel float-channels) -1))) frame-interp 1) 1.0 @@ -2236,8 +2230,8 @@ (set! (-> self gun active-time) (-> self clock frame-counter)) ) (set! (-> self gun laser-active?) - (zero? (logand (surface-flag gun-inactive gun-hide gun-off laser-hide) (-> self control current-surface flags)) - ) + (not (logtest? (surface-flag gun-inactive gun-hide gun-off laser-hide) (-> self control current-surface flags)) + ) ) (when (and (not (and (not (logtest? (surface-flag gun-inactive gun-hide gun-off) (-> self control current-surface flags))) (>= (- (-> self clock frame-counter) (-> self gun gun-get-on-time)) (seconds 0.1)) @@ -2295,7 +2289,7 @@ ) (and (not (cpad-hold? (-> self control cpad number) r1)) (not (logtest? (surface-flag gun-inactive) (-> self control current-surface flags))) - (zero? (logand (-> self focus-status) (focus-status grabbed))) + (not (logtest? (-> self focus-status) (focus-status grabbed))) ) ) (-> self gun put-away?) @@ -2304,7 +2298,7 @@ (logand (-> self game features) (-> *setting-control* user-current features)) ) ) - (logtest? (focus-status dead dark) (-> self focus-status)) + (focus-test? self dead dark) (-> self board latch?) ) ) @@ -2324,7 +2318,7 @@ ) ) ) - (target-gun-end-mode (zero? (logand (surface-flag gun-hide) (-> self control current-surface flags)))) + (target-gun-end-mode (not (logtest? (surface-flag gun-hide) (-> self control current-surface flags)))) ) ) (else @@ -2352,7 +2346,7 @@ (case (-> gp-0 gun-type) (((pickup-type eco-blue)) (cond - ((logtest? (-> self focus-status) (focus-status pilot-riding)) + ((focus-test? self pilot-riding) (let ((v1-15 (get-channel (-> self skel top-anim) 0))) (when (not (or (= (-> self skel top-anim frame-group) (-> self draw art-group data 206)) (and v1-15 (= (-> v1-15 frame-group) (-> self draw art-group data 206))) @@ -2419,7 +2413,7 @@ ) (((pickup-type eco-yellow)) (cond - ((logtest? (-> self focus-status) (focus-status pilot-riding)) + ((focus-test? self pilot-riding) (push-anim-to-targ (-> self skel top-anim) (the-as art-joint-anim (-> self draw art-group data 223)) @@ -2467,7 +2461,7 @@ ) ) (cond - ((logtest? (-> self focus-status) (focus-status pilot-riding)) + ((focus-test? self pilot-riding) (push-anim-to-targ (-> self skel top-anim) (the-as art-joint-anim (-> self draw art-group data 222)) @@ -2554,7 +2548,7 @@ (target-gun-fire-red) ) (((pickup-type eco-dark)) - (if (logtest? (-> self focus-status) (focus-status pilot-riding)) + (if (focus-test? self pilot-riding) (push-anim-to-targ (-> self skel top-anim) (the-as art-joint-anim (-> self draw art-group data 224)) @@ -2608,7 +2602,7 @@ (when (using-gun? self) (let ((gp-0 (-> self gun))) (cond - ((and (logtest? (-> self focus-status) (focus-status pilot-riding)) (nonzero? (-> self skel float-channels))) + ((and (focus-test? self pilot-riding) (nonzero? (-> self skel float-channels))) (set! (-> self skel top-anim interp-select 0) (the-as uint #x800000)) (set! (-> self skel top-anim interp-select 1) (the-as uint 0)) 0 @@ -2619,8 +2613,7 @@ 0 ) ) - (if (not (or (logtest? (-> self focus-status) (focus-status in-head)) (= (-> self gun gun-type) (pickup-type eco-red))) - ) + (if (not (or (focus-test? self in-head) (= (-> self gun gun-type) (pickup-type eco-red)))) (gun-info-method-9 gp-0) ) (if (and (logtest? (surface-flag spin) (-> self control current-surface flags)) @@ -2732,7 +2725,7 @@ (set! (-> self gun top-anim-blue-cycle) f0-24) (push-anim-to-targ (-> self skel top-anim) - (the-as art-joint-anim (if (logtest? (-> self focus-status) (focus-status pilot-riding)) + (the-as art-joint-anim (if (focus-test? self pilot-riding) (-> self draw art-group data 206) (-> self draw art-group data 257) ) diff --git a/goal_src/jak2/engine/target/target-handler.gc b/goal_src/jak2/engine/target/target-handler.gc index 610d72db28..ae33e91266 100644 --- a/goal_src/jak2/engine/target/target-handler.gc +++ b/goal_src/jak2/engine/target/target-handler.gc @@ -60,9 +60,7 @@ ) (s2-0 arg0) ) - (when (or (and (not (logtest? (-> self focus-status) (focus-status hit))) - (zero? (logand (state-flags disable-attacks) (-> self state-flags))) - ) + (when (or (and (not (focus-test? self hit)) (not (logtest? (state-flags disable-attacks) (-> self state-flags)))) (= s4-0 'endlessfall) ) (case s4-0 @@ -77,13 +75,12 @@ (logtest? (-> self game secrets) (game-secrets invulnerable)) (and (logtest? (-> self state-flags) (state-flags sf4)) (not (attack-mode-is-invinc s4-0))) (< 0.0 (-> (the-as fact-info-target (-> self fact-override)) shield-level)) - (and (= s4-0 'darkeco) (and (and (= (-> (the-as fact-info-target (-> self fact-override)) eco-type) 2) - (>= (-> (the-as fact-info-target (-> self fact-override)) eco-level) 1.0) - ) - (or (logtest? (-> self state-flags) (state-flags sf15)) - (logtest? (-> self focus-status) (focus-status dangerous)) - ) - ) + (and (= s4-0 'darkeco) + (and (and (= (-> (the-as fact-info-target (-> self fact-override)) eco-type) 2) + (>= (-> (the-as fact-info-target (-> self fact-override)) eco-level) 1.0) + ) + (or (logtest? (-> self state-flags) (state-flags sf15)) (focus-test? self dangerous)) + ) ) ) (case arg0 @@ -107,7 +104,7 @@ ) (mem-copy! (the-as pointer (-> self attack-info-rec)) (the-as pointer arg1) 160) (compute-intersect-info (-> self attack-info-rec) arg1 self arg2 arg3) - (when (not (logtest? (focus-status mech) (-> self focus-status))) + (when (not (focus-test? self mech)) (if (and (not (target-log-attack (-> self attack-info-rec) (if (logtest? (attack-info-mask test) (-> arg1 mask)) 'test 'log @@ -195,7 +192,7 @@ (logior! (-> self focus-status) (focus-status ignore hit)) (when (and (= (-> self game mode) 'play) (and (or (and (>= 0.0 (- (-> (the-as fact-info-target (-> self fact-override)) health) (-> self attack-info-rec damage))) - (not (and (logtest? (focus-status dark) (-> self focus-status)) (nonzero? (-> self darkjak)))) + (not (and (focus-test? self dark) (nonzero? (-> self darkjak)))) ) (attack-mode-is-invinc s4-0) ) @@ -257,7 +254,7 @@ s3-0 ) ) - (s3-1 (and s4-0 (logtest? (-> (the-as process-focusable s4-0) focus-status) (focus-status dead hit)))) + (s3-1 (and s4-0 (focus-test? (the-as process-focusable s4-0) dead hit))) ) (let ((a1-2 (new 'stack-no-clear 'event-message-block))) (set! (-> a1-2 from) (process->ppointer self)) @@ -286,7 +283,7 @@ ) ) ) (when (the-as object arg0) - (when (and s4-0 (not s3-1) (-> self control danger-mode) (zero? (logand (-> s4-0 mask) (process-mask dark-effect)))) + (when (and s4-0 (not s3-1) (-> self control danger-mode) (not (logtest? (-> s4-0 mask) (process-mask dark-effect)))) (logior! (-> s4-0 mask) (process-mask dark-effect)) (process-spawn-function process @@ -300,14 +297,14 @@ ) (set! (-> self clock) (-> gp-0 0 clock)) (while (let ((v1-48 gp-0)) - (and (or (logtest? (-> (the-as process-focusable (if v1-48 - (the-as process-focusable (-> v1-48 0 self)) - ) - ) - focus-status - ) - (focus-status dead hit) + (and (or (focus-test? + (the-as process-focusable (if v1-48 + (the-as process-focusable (-> v1-48 0 self)) + ) ) + dead + hit + ) (let ((v1-53 gp-0)) (and (-> (the-as process-focusable (if v1-53 (the-as process-focusable (-> v1-53 0 self)) @@ -330,8 +327,8 @@ ) ) (< (- (-> self clock frame-counter) s3-0) (seconds 15)) - (zero? (logand (-> (the-as process-focusable (-> gp-0 0)) draw status) (draw-control-status no-draw no-draw-temp)) - ) + (not (logtest? (-> (the-as process-focusable (-> gp-0 0)) draw status) (draw-control-status no-draw no-draw-temp)) + ) ) ) (let ((s2-0 sp-launch-particles-var) @@ -670,7 +667,7 @@ object (case arg2 (('get-pickup) - (when (not (logtest? (-> self focus-status) (focus-status dead))) + (when (not (focus-test? self dead)) (let ((s4-0 (-> arg3 param 0)) (f28-0 (the-as float (-> arg3 param 1))) ) @@ -702,7 +699,7 @@ ) ) (('level-deactivate) - (when (and (logtest? (focus-status pilot) (-> self focus-status)) + (when (and (focus-test? self pilot) (or (= (-> arg3 param 0) 'ctywide) (and (= (-> arg3 param 0) 'lracelit) (-> self pilot as-daxter?))) ) (ja-channel-set! 0) @@ -714,7 +711,7 @@ ) ) (update (-> self skel top-anim)) - (when (not (logtest? (-> self focus-status) (focus-status grabbed))) + (when (not (focus-test? self grabbed)) (set! (-> self event-hook) #f) (go target-jump (-> *TARGET-bank* jump-height-min) (-> *TARGET-bank* jump-height-max) (the-as surface #f)) ) @@ -749,7 +746,7 @@ (= s3-0 (-> *game-info* play-list (-> s2-0 task) play-node)) (or (logtest? (-> s2-0 flags) (game-task-node-flag closed)) (open? s2-0)) (not (task-complete? (-> self game) (-> s2-0 task))) - (zero? (logand (game-task-node-flag utility-node) (-> s2-0 flags))) + (not (logtest? (game-task-node-flag utility-node) (-> s2-0 flags))) ) (when (zero? (-> self game task-close-times (-> s2-0 task))) (format #t "--------------> set task start time for ~A~%" (-> s2-0 name)) @@ -849,10 +846,7 @@ ) ) (('effect-control) - (when (and (logtest? (focus-status dark) (-> self focus-status)) - (nonzero? (-> self darkjak)) - (logtest? (-> self darkjak stage) 32) - ) + (when (and (focus-test? self dark) (nonzero? (-> self darkjak)) (logtest? (-> self darkjak stage) 32)) (case (-> arg3 param 0) (('effect-walk-step-left 'effect-walk-step-right 'effect-run-step-left 'effect-run-step-right) (activate! *camera-smush-control* 409.6 15 75 1.0 0.98 (-> *display* camera-clock)) @@ -967,11 +961,8 @@ ) v0-0 ) - ((and (and (logtest? (focus-status dark) (-> self focus-status)) (nonzero? (-> self darkjak))) - (or (and (logtest? (focus-status dark) (-> self focus-status)) - (nonzero? (-> self darkjak)) - (logtest? (-> self darkjak stage) 16) - ) + ((and (and (focus-test? self dark) (nonzero? (-> self darkjak))) + (or (and (focus-test? self dark) (nonzero? (-> self darkjak)) (logtest? (-> self darkjak stage) 16)) (logtest? (process-mask crate) (-> arg0 mask)) ) ) @@ -1028,13 +1019,13 @@ ) ) (('change-state) - (go - (the-as (state object object object object target) (-> arg3 param 0)) - (-> arg3 param 1) - (-> arg3 param 2) - (-> arg3 param 3) - (-> arg3 param 4) - ) + (go + (the-as (state object object object object target) (-> arg3 param 0)) + (-> arg3 param 1) + (-> arg3 param 2) + (-> arg3 param 3) + (-> arg3 param 4) + ) ) (('tobot) (set! v0-0 (-> arg3 param 0)) @@ -1135,15 +1126,13 @@ (b! (!= v1-0 'loading) cfg-44 :delay (nop!)) (set! v0-0 (if (not (or (and (logtest? (-> self control mod-surface flags) (surface-flag air)) - (zero? (logand (-> self control status) (collide-status on-surface))) + (not (logtest? (-> self control status) (collide-status on-surface))) ) (or (logtest? (water-flags touch-water) (-> self water flags)) (logtest? (-> self control status) (collide-status on-water)) ) (or (logtest? (-> self state-flags) (state-flags sf1)) - (logtest? (focus-status dead dangerous hit grabbed in-head edge-grab pole flut tube board pilot mech) - (-> self focus-status) - ) + (focus-test? self dead dangerous hit grabbed in-head edge-grab pole flut tube board pilot mech) (>= (the-as time-frame (-> self no-load-wait)) (-> self clock frame-counter)) ) ) @@ -1162,7 +1151,7 @@ (set! v0-0 (cond ((= v1-45 'grab) - (when (not (logtest? (-> self focus-status) (focus-status dead))) + (when (not (focus-test? self dead)) (if (not (-> arg3 param 1)) #t (go target-grab 'stance) @@ -1272,7 +1261,7 @@ ) ((= v1-45 'darkjak) (cond - ((not (and (logtest? (focus-status dark) (-> self focus-status)) (nonzero? (-> self darkjak)))) + ((not (and (focus-test? self dark) (nonzero? (-> self darkjak)))) (go target-darkjak-get-on (the-as int (-> arg3 param 2))) ) ((logtest? (-> arg3 param 2) 128) @@ -1287,8 +1276,8 @@ (go target-hide) ) ((= v1-45 'normal) - (if (and (and (logtest? (focus-status dark) (-> self focus-status)) (nonzero? (-> self darkjak))) - (and (not (logtest? (-> self focus-status) (focus-status dead dangerous hit grabbed))) + (if (and (and (focus-test? self dark) (nonzero? (-> self darkjak))) + (and (not (focus-test? self dead dangerous hit grabbed)) (not (and (-> self next-state) (= (-> self next-state name) 'target-darkjak-get-off))) ) ) @@ -1306,8 +1295,8 @@ ((and (using-gun? self) (target-gun-end-mode #f)) (go target-stance) ) - ((and (and (logtest? (focus-status dark) (-> self focus-status)) (nonzero? (-> self darkjak))) - (and (not (logtest? (-> self focus-status) (focus-status dead dangerous hit grabbed))) + ((and (and (focus-test? self dark) (nonzero? (-> self darkjak))) + (and (not (focus-test? self dead dangerous hit grabbed)) (not (and (-> self next-state) (= (-> self next-state name) 'target-darkjak-get-off))) ) ) @@ -1323,9 +1312,7 @@ (label cfg-214) (b! (!= v1-0 'darkjak) cfg-225 :delay (nop!)) (set! v0-0 - (when (and (and (logtest? (focus-status dark) (-> self focus-status)) (nonzero? (-> self darkjak))) - (zero? (-> self darkjak want-stage)) - ) + (when (and (and (focus-test? self dark) (nonzero? (-> self darkjak))) (zero? (-> self darkjak want-stage))) (let ((v1-164 (-> arg3 param 0))) (when (logtest? v1-164 4) (set! (-> self darkjak want-stage) v1-164) @@ -1345,20 +1332,20 @@ (b! #t cfg-291 :delay (nop!)) (label cfg-234) (b! (!= v1-0 'edge-grab) cfg-238 :delay (nop!)) - (b! (logtest? (-> self focus-status) (focus-status dead hit grabbed)) cfg-237 :delay (set! v0-0 #f)) + (b! (focus-test? self dead hit grabbed) cfg-237 :delay (set! v0-0 #f)) (set! v0-0 (go target-edge-grab)) (label cfg-237) (b! #t cfg-291 :delay (nop!)) (label cfg-238) (b! (!= v1-0 'pilot-edge-grab) cfg-242 :delay (nop!)) - (b! (logtest? (-> self focus-status) (focus-status dead hit grabbed)) cfg-241 :delay (set! v0-0 #f)) + (b! (focus-test? self dead hit grabbed) cfg-241 :delay (set! v0-0 #f)) (set! v0-0 (go target-pilot-edge-grab (the-as pilot-edge-grab-info (-> arg3 param 0)))) (label cfg-241) (b! #t cfg-291 :delay (nop!)) (label cfg-242) (b! (!= v1-0 'pole-grab) cfg-256 :delay (nop!)) (set! v0-0 - (if (and (not (logtest? (-> self focus-status) (focus-status dead hit grabbed pole))) + (if (and (not (focus-test? self dead hit grabbed pole)) ((method-of-type touching-shapes-entry prims-touching?) (the-as touching-shapes-entry (-> arg3 param 0)) (-> self control) @@ -1376,7 +1363,7 @@ (if (not (or (= (-> self control mod-surface mode) 'swim) (= (-> self control mod-surface mode) 'dive) (and (-> self next-state) (= (-> self next-state name) 'target-hit)) - (logtest? (-> self focus-status) (focus-status dead hit grabbed)) + (focus-test? self dead hit grabbed) ) ) (go target-swim-stance) @@ -1392,7 +1379,7 @@ (or (= v1-206 'target-stance) (= v1-206 'target-walk) (= v1-206 'target-stance-look-around)) ) ) - (zero? (logand (-> self focus-status) (focus-status dead hit grabbed))) + (not (logtest? (-> self focus-status) (focus-status dead hit grabbed))) ) (go target-wade-stance) ) @@ -1400,11 +1387,7 @@ (b! #t cfg-291 :delay (nop!)) (label cfg-286) (b! (!= v1-0 'slide) cfg-290 :delay (nop!)) - (b! - (logtest? (-> self focus-status) (focus-status dead hit grabbed on-water under-water)) - cfg-289 - :delay (set! v0-0 #f) - ) + (b! (focus-test? self dead hit grabbed on-water under-water) cfg-289 :delay (set! v0-0 #f)) (set! v0-0 (go target-slide-down-to-ground)) (label cfg-289) (b! #t cfg-291 :delay (nop!)) @@ -1527,7 +1510,7 @@ (the-as int (-> self control attack-count)) (-> self control penetrate-using) ) - (zero? (logand (-> self focus-status) (focus-status dead hit))) + (not (logtest? (-> self focus-status) (focus-status dead hit))) ) (set! (-> self control last-trans-any-surf quad) (-> self control trans quad)) (target-timed-invulnerable (seconds 0.1) self 1) diff --git a/goal_src/jak2/engine/target/target-swim.gc b/goal_src/jak2/engine/target/target-swim.gc index 3767329f65..154888c88c 100644 --- a/goal_src/jak2/engine/target/target-swim.gc +++ b/goal_src/jak2/engine/target/target-swim.gc @@ -421,7 +421,7 @@ :trans (behavior () ((-> self state-hook)) (if (and (logtest? (-> self control status) (collide-status on-surface)) - (zero? (logand (-> self control status) (collide-status on-water))) + (not (logtest? (-> self control status) (collide-status on-water))) ) (set-zero! (-> self water bob)) ) @@ -543,7 +543,7 @@ :trans (behavior () ((-> self state-hook)) (if (and (logtest? (-> self control status) (collide-status on-surface)) - (zero? (logand (-> self control status) (collide-status on-water))) + (not (logtest? (-> self control status) (collide-status on-water))) ) (set-zero! (-> self water bob)) ) @@ -888,7 +888,7 @@ :trans (behavior () (if (and (cpad-pressed? (-> self control cpad number) x) (not (logtest? (-> self state-flags) (state-flags prevent-jump))) - (zero? (logand (water-flags head-under-water bouncing) (-> self water flags))) + (not (logtest? (water-flags head-under-water bouncing) (-> self water flags))) ) (go target-swim-jump-jump @@ -953,7 +953,7 @@ 0.1 ) (when (and (not gp-0) - (or (>= (ja-aframe-num 0) 240.0) (zero? (logand (water-flags head-under-water) (-> self water flags)))) + (or (>= (ja-aframe-num 0) 240.0) (not (logtest? (water-flags head-under-water) (-> self water flags)))) ) (set! gp-0 #t) (sound-play "swim-surface") diff --git a/goal_src/jak2/engine/target/target-tube.gc b/goal_src/jak2/engine/target/target-tube.gc index 4ab6f1b270..41b28861b3 100644 --- a/goal_src/jak2/engine/target/target-tube.gc +++ b/goal_src/jak2/engine/target/target-tube.gc @@ -499,7 +499,7 @@ (('change-mode) (case (-> event param 0) (('grab) - (when (not (logtest? (-> self focus-status) (focus-status dead))) + (when (not (focus-test? self dead)) (if (-> event param 1) (logior! (-> self focus-status) (focus-status grabbed)) ) @@ -510,7 +510,7 @@ ) (('end-mode) (cond - ((logtest? (-> self focus-status) (focus-status grabbed)) + ((focus-test? self grabbed) (logclear! (-> self focus-status) (focus-status grabbed)) #t ) @@ -851,7 +851,7 @@ ) (when (and (logtest? (-> arg1 mask) (attack-info-mask mode)) (= (-> arg1 mode) 'darkeco) - (zero? (logand (-> arg1 mask) (attack-info-mask shove-up))) + (not (logtest? (-> arg1 mask) (attack-info-mask shove-up))) ) (set! (-> arg1 shove-up) 12288.0) (logior! (-> arg1 mask) (attack-info-mask shove-up)) @@ -1043,7 +1043,7 @@ :trans (behavior () (if (and (and *target* (and (>= 81920.0 (vector-vector-distance (-> self root trans) (-> *target* control trans))) - (zero? (logand (focus-status teleporting) (-> *target* focus-status))) + (not (logtest? (focus-status teleporting) (-> *target* focus-status))) ) ) (< 0.0 @@ -1052,7 +1052,7 @@ (-> self rot) ) ) - (and (not (logtest? (-> *target* focus-status) (focus-status in-air))) + (and (not (focus-test? *target* in-air)) (< (-> *target* control trans y) (+ 12288.0 (-> self root trans y))) (send-event *target* 'change-mode 'tube self) ) diff --git a/goal_src/jak2/engine/target/target-turret.gc b/goal_src/jak2/engine/target/target-turret.gc index 001f8a618f..215830b71e 100644 --- a/goal_src/jak2/engine/target/target-turret.gc +++ b/goal_src/jak2/engine/target/target-turret.gc @@ -958,12 +958,12 @@ (until #f (when (and (and *target* (and (>= f30-0 (vector-vector-distance (-> self root-override trans) (-> *target* control trans))) - (zero? (logand (focus-status teleporting) (-> *target* focus-status))) + (not (logtest? (focus-status teleporting) (-> *target* focus-status))) ) ) (and (not (task-node-closed? (game-task-node drill-ship-resolution))) (can-display-query? self (the-as string #f) -99.0) - (not (logtest? (focus-status in-head board mech dark) (-> *target* focus-status))) + (not (focus-test? *target* in-head board mech dark)) (let ((f28-0 24576.0) (s4-0 (-> self root-override)) (s5-0 (target-pos 0)) @@ -1694,7 +1694,7 @@ (when (and s2-1 (logtest? (process-mask enemy) (-> s2-1 mask)) (logtest? (process-mask collectable) (-> s2-1 mask)) - (not (logtest? (-> (the-as process-focusable s2-1) focus-status) (focus-status disable dead ignore inactive))) + (not (focus-test? (the-as process-focusable s2-1) disable dead ignore inactive)) (!= s2-1 obj) (!= s2-1 *target*) (base-turret-method-46 obj s2-1) @@ -2220,7 +2220,7 @@ This commonly includes things such as: (('change-mode) (case (-> event param 0) (('grab) - (when (not (logtest? (-> self focus-status) (focus-status dead))) + (when (not (focus-test? self dead)) (if (-> event param 1) (set! (-> self turret grabbed?) #t) ) diff --git a/goal_src/jak2/engine/target/target-util.gc b/goal_src/jak2/engine/target/target-util.gc index 166e15b915..1de2c24985 100644 --- a/goal_src/jak2/engine/target/target-util.gc +++ b/goal_src/jak2/engine/target/target-util.gc @@ -302,9 +302,7 @@ ) ) ) - (if (and (logtest? (focus-status dark) (-> self focus-status)) - (and (nonzero? (-> self darkjak)) (logtest? (-> self darkjak stage) 32)) - ) + (if (and (focus-test? self dark) (and (nonzero? (-> self darkjak)) (logtest? (-> self darkjak stage) 32))) (set! f30-0 1.0) ) (set! (-> self control penetrate-using) (penetrate touch)) @@ -456,17 +454,14 @@ (-> *TARGET-bank* punch-offset) (-> *TARGET-bank* punch-radius) ) - (when (not (logtest? (focus-status indax) (-> self focus-status))) + (when (not (focus-test? self indax)) (set! (-> s5-0 prim-core collide-as) (-> self control default-collide-as-fgnd)) (set! (-> s5-0 prim-core collide-with) (-> self control default-collide-with-fgnd)) (sphere<-vector+r! (the-as sphere (-> s5-0 local-sphere)) *null-vector* (-> *TARGET-bank* punch-radius)) (set! (-> s5-0 transform-index) 21) ) (set! (-> self control penetrate-using) (penetrate touch punch)) - (if (and (logtest? (focus-status dark) (-> self focus-status)) - (nonzero? (-> self darkjak)) - (logtest? (-> self darkjak stage) 2) - ) + (if (and (focus-test? self dark) (nonzero? (-> self darkjak)) (logtest? (-> self darkjak stage) 2)) (set! (-> self control penetrate-using) (logior (penetrate dark-punch) (-> self control penetrate-using))) ) ) @@ -610,12 +605,9 @@ (set! (-> gp-0 local-sphere w) (* (-> gp-0 local-sphere w) f30-0)) ) ) - (when (and (logtest? (focus-status dark) (-> self focus-status)) (nonzero? (-> self darkjak))) + (when (and (focus-test? self dark) (nonzero? (-> self darkjak))) (set! (-> self control penetrate-using) (logior (penetrate dark-skin) (-> self control penetrate-using))) - (when (and (logtest? (focus-status dark) (-> self focus-status)) - (nonzero? (-> self darkjak)) - (logtest? (-> self darkjak stage) 32) - ) + (when (and (focus-test? self dark) (nonzero? (-> self darkjak)) (logtest? (-> self darkjak stage) 32)) (set! (-> self control penetrate-using) (logior (penetrate dark-giant) (-> self control penetrate-using))) (let ((f0-46 (lerp-scale 1.0 (-> self darkjak-giant-interp) (-> self darkjak-interp) 0.0 1.0))) (set! (-> self control root-prim local-sphere w) (* (-> self control root-prim local-sphere w) f0-46)) @@ -653,7 +645,7 @@ (let ((gp-0 (-> self control))) (if (and (= arg0 'normal) (enabled-gun? self) - (zero? (logand (-> self control current-surface flags) (surface-flag duck))) + (not (logtest? (-> self control current-surface flags) (surface-flag duck))) ) (set! arg0 'gun) ) @@ -970,9 +962,7 @@ ) ) ) - (when (and (logtest? (focus-status dark) (-> self focus-status)) - (and (nonzero? (-> self darkjak)) (logtest? (-> self darkjak stage) 32)) - ) + (when (and (focus-test? self dark) (and (nonzero? (-> self darkjak)) (logtest? (-> self darkjak stage) 32))) (let ((f0-183 (lerp-scale 1.0 (-> self darkjak-giant-interp) (-> self darkjak-interp) 0.0 1.0))) (set! (-> gp-0 collision-spheres 0 local-sphere w) (* 0.5 (+ 1.0 f0-183) (-> gp-0 collision-spheres 0 local-sphere w)) @@ -1012,11 +1002,8 @@ ) (defmethod get-inv-mass target ((obj target)) - (if (or (and (logtest? (focus-status dark) (-> obj focus-status)) - (nonzero? (-> obj darkjak)) - (logtest? (-> obj darkjak stage) 32) - ) - (logtest? (focus-status mech) (-> obj focus-status)) + (if (or (and (focus-test? obj dark) (nonzero? (-> obj darkjak)) (logtest? (-> obj darkjak stage) 32)) + (focus-test? obj mech) ) 0.1 1.0 @@ -1103,10 +1090,10 @@ (logtest? (-> self control status) (collide-status on-water)) ) ) - (zero? (logand (focus-status dead hit grabbed in-head edge-grab pole flut tube board mech dark indax teleporting) + (not (logtest? (focus-status dead hit grabbed in-head edge-grab pole flut tube board mech dark indax teleporting) (-> self focus-status) ) - ) + ) ) ) (not (paused?)) @@ -1117,7 +1104,7 @@ (not (-> *setting-control* user-current spooling)) (not (-> *setting-control* user-current movie)) (not (-> *setting-control* user-current hint)) - (not (logtest? (-> self focus-status) (focus-status dead hit grabbed))) + (not (focus-test? self dead hit grabbed)) (logtest? (-> self game features) (game-feature sidekick)) (case *kernel-boot-message* (('kiosk) @@ -1236,7 +1223,7 @@ (and (< 0.7 (-> self control touch-angle)) (and (< (-> self control surface-angle) 0.3) (logtest? (-> self control status) (collide-status touch-wall)) - (or arg0 (zero? (logand (-> self control status) (collide-status touch-actor)))) + (or arg0 (not (logtest? (-> self control status) (collide-status touch-actor)))) ) ) ) @@ -1248,7 +1235,7 @@ ) (< (-> self control local-slope-z) 0.7) (not (logtest? (-> self state-flags) (state-flags prevent-attack prevent-duck))) - (not (and (logtest? (focus-status dark) (-> self focus-status)) (nonzero? (-> self darkjak)))) + (not (and (focus-test? self dark) (nonzero? (-> self darkjak)))) (>= (- (-> self clock frame-counter) (the-as int (-> *TARGET-bank* roll-timeout))) (-> self control last-roll-end-time) ) @@ -1884,7 +1871,7 @@ (cond ((and (logtest? (water-flags touch-water) a1-2) (logtest? (water-flags under-water swimming) a1-2) - (zero? (logand (focus-status mech) (-> obj focus-status))) + (not (logtest? (focus-status mech) (-> obj focus-status))) ) (set! v0-0 (new 'static 'vector :w 1.0)) (set! (-> v0-0 quad) (-> obj control trans quad)) @@ -1917,7 +1904,7 @@ ((= arg0 6) (let ((f0-4 (vector-dot (-> v1-0 dynam gravity-normal) (-> v1-0 transv)))) (cond - ((and (< 0.0 f0-4) (logtest? (-> obj focus-status) (focus-status in-air))) + ((and (< 0.0 f0-4) (focus-test? obj in-air)) (let* ((v0-1 (new 'static 'vector)) (f0-5 (+ (* 0.0016666667 (-> v1-0 dynam gravity-length)) f0-4)) (f0-8 (/ (* 0.5 f0-5 f0-5) (-> v1-0 dynam gravity-length))) @@ -1949,14 +1936,14 @@ (cond ((zero? arg0) (let ((f0-1 (vector-dot (-> v1-0 dynam gravity-normal) (-> v1-0 transv)))) - (if (and (< 0.0 f0-1) (logtest? (-> obj focus-status) (focus-status in-air))) + (if (and (< 0.0 f0-1) (focus-test? obj in-air)) (time-to-apex f0-1 (- (-> v1-0 dynam gravity-length))) 0 ) ) ) ((= arg0 1) - (if (logtest? (-> obj focus-status) (focus-status in-air)) + (if (focus-test? obj in-air) (the-as int (target-time-to-ground)) 0 ) diff --git a/goal_src/jak2/engine/target/target.gc b/goal_src/jak2/engine/target/target.gc index a2934f9ec5..8e38fb559c 100644 --- a/goal_src/jak2/engine/target/target.gc +++ b/goal_src/jak2/engine/target/target.gc @@ -569,10 +569,7 @@ ) (defbehavior init-var-jump target ((arg0 float) (arg1 float) (arg2 symbol) (arg3 symbol) (arg4 vector) (arg5 float)) - (when (and (logtest? (focus-status dark) (-> self focus-status)) - (nonzero? (-> self darkjak)) - (logtest? (-> self darkjak stage) 32) - ) + (when (and (focus-test? self dark) (nonzero? (-> self darkjak)) (logtest? (-> self darkjak stage) 32)) (set! arg0 (* arg0 (-> self darkjak-giant-interp))) (set! arg1 (* arg1 (-> self darkjak-giant-interp))) ) @@ -697,22 +694,17 @@ ) ) 0 - (when (and arg1 (ja-group) (and (-> (ja-group) extra) - (not (and (logtest? (focus-status dark) (-> self focus-status)) - (nonzero? (-> self darkjak)) - (logtest? (-> self darkjak stage) 32) - ) - ) - #t - ) + (when (and arg1 + (ja-group) + (and (-> (ja-group) extra) + (not (and (focus-test? self dark) (nonzero? (-> self darkjak)) (logtest? (-> self darkjak stage) 32))) + #t + ) ) (let ((v1-62 (res-lump-struct (-> (ja-group) extra) 'collide-offset vector :time (ja-aframe-num 0)))) (cond (v1-62 - (if (and (logtest? (focus-status dark) (-> self focus-status)) - (nonzero? (-> self darkjak)) - (logtest? (-> self darkjak stage) 32) - ) + (if (and (focus-test? self dark) (nonzero? (-> self darkjak)) (logtest? (-> self darkjak stage) 32)) (set! (-> v1-62 y) (* 0.5 (-> v1-62 y))) ) (set! v0-1 (-> self control anim-collide-offset-local)) @@ -762,13 +754,10 @@ (surface-clamp-speed arg0 arg1 arg2 arg3) (when (= arg3 1) (cond - ((and (logtest? (focus-status dark) (-> self focus-status)) - (nonzero? (-> self darkjak)) - (logtest? (-> self darkjak stage) 32) - ) + ((and (focus-test? self dark) (nonzero? (-> self darkjak)) (logtest? (-> self darkjak stage) 32)) (set! (-> arg0 target-speed) 81920.0) ) - ((and (logtest? (focus-status dark) (-> self focus-status)) (nonzero? (-> self darkjak))) + ((and (focus-test? self dark) (nonzero? (-> self darkjak))) (set! (-> arg0 target-speed) 40960.0) ) (else @@ -854,7 +843,7 @@ (can-hands? #t) (can-exit-duck? self) (not (logtest? (-> self control current-surface flags) (surface-flag no-jump))) - (zero? (logand (-> self state-flags) (state-flags prevent-jump))) + (not (logtest? (-> self state-flags) (state-flags prevent-jump))) ) (go target-attack-uppercut @@ -919,7 +908,7 @@ ) (ja-channel-push! 1 (seconds 0.1)) ) - ((and (logtest? (focus-status dark) (-> self focus-status)) (nonzero? (-> self darkjak))) + ((and (focus-test? self dark) (nonzero? (-> self darkjak))) (ja-channel-push! 1 (seconds 0.1)) ) (else @@ -1010,7 +999,7 @@ (can-hands? #t) (can-exit-duck? self) (not (logtest? (-> self control current-surface flags) (surface-flag no-jump))) - (zero? (logand (-> self state-flags) (state-flags prevent-jump))) + (not (logtest? (-> self state-flags) (state-flags prevent-jump))) ) (go target-attack-uppercut @@ -1154,7 +1143,7 @@ ) (and (< -61440.0 (vector-dot (-> self control dynam gravity-normal) (-> self control transv))) (not (logtest? (water-flags touch-water) (-> self water flags))) - (zero? (logand (state-flags prevent-jump prevent-double-jump) (-> self state-flags))) + (not (logtest? (state-flags prevent-jump prevent-double-jump) (-> self state-flags))) ) ) (go target-double-jump (-> *TARGET-bank* double-jump-height-min) (-> *TARGET-bank* double-jump-height-max)) @@ -1246,7 +1235,7 @@ ) ) ) - ((and (logtest? (focus-status dark) (-> self focus-status)) (nonzero? (-> self darkjak))) + ((and (focus-test? self dark) (nonzero? (-> self darkjak))) (ja-channel-push! 1 (seconds 0.05)) (ja :group! (-> self draw art-group data 394) :num! min) (suspend) @@ -1479,7 +1468,7 @@ ) ) (cond - ((and (logtest? (focus-status dark) (-> self focus-status)) (nonzero? (-> self darkjak))) + ((and (focus-test? self dark) (nonzero? (-> self darkjak))) (ja-channel-push! 1 (seconds 0.05)) (ja-no-eval :group! (-> self draw art-group data 394) :num! (seek! (the float (+ (-> (the-as art-joint-anim (-> self draw art-group data 394)) frames num-frames) -1))) @@ -1868,7 +1857,7 @@ :enter (behavior ((arg0 symbol)) (set! (-> self control turn-go-the-long-way) 0.0) (cond - ((or (= arg0 'stuck) (logtest? (focus-status indax) (-> self focus-status))) + ((or (= arg0 'stuck) (focus-test? self indax)) ) (else (let ((f0-2 @@ -1878,7 +1867,7 @@ ) ) ) - (if (and (< (-> *TARGET-bank* fall-far) f0-2) (zero? (logand (-> self control status) (collide-status on-water)))) + (if (and (< (-> *TARGET-bank* fall-far) f0-2) (not (logtest? (-> self control status) (collide-status on-water)))) (go target-hit-ground-hard f0-2) ) ) @@ -1906,16 +1895,13 @@ 600 1500 ) - (if (and (logtest? (focus-status dark) (-> self focus-status)) - (nonzero? (-> self darkjak)) - (logtest? (-> self darkjak stage) 32) - ) + (if (and (focus-test? self dark) (nonzero? (-> self darkjak)) (logtest? (-> self darkjak stage) 32)) (activate! *camera-smush-control* 1638.4 15 75 1.0 0.9 (-> *display* camera-clock)) ) (when (and (using-gun? self) (let ((v1-44 (-> self water flags))) (not (and (logtest? (water-flags touch-water) v1-44) (logtest? (water-flags under-water swimming) v1-44) - (zero? (logand (focus-status mech) (-> self focus-status))) + (not (logtest? (focus-status mech) (-> self focus-status))) ) ) ) @@ -2164,7 +2150,7 @@ :code (behavior () (let ((gp-0 (-> self draw art-group data 40))) (cond - ((and (logtest? (focus-status dark) (-> self focus-status)) (nonzero? (-> self darkjak))) + ((and (focus-test? self dark) (nonzero? (-> self darkjak))) (set! gp-0 (-> self draw art-group data 399)) (quaternion-rotate-y! (-> self control quat-for-control) (-> self control quat-for-control) -1365.3334) ) @@ -2254,7 +2240,7 @@ (ja :num! (seek! max (-> self control current-surface align-speed))) ) (cond - ((and (logtest? (focus-status dark) (-> self focus-status)) (nonzero? (-> self darkjak))) + ((and (focus-test? self dark) (nonzero? (-> self darkjak))) (quaternion-rotate-y! (-> self control quat-for-control) (-> self control quat-for-control) -12743.111) ) ((using-gun? self) @@ -2420,7 +2406,7 @@ ) ) :enter (behavior () - (if (and (and (logtest? (focus-status dark) (-> self focus-status)) (nonzero? (-> self darkjak))) + (if (and (and (focus-test? self dark) (nonzero? (-> self darkjak))) (and (-> self next-state) (= (-> self next-state name) 'target-running-attack)) ) (go target-darkjak-running-attack) @@ -2471,7 +2457,7 @@ (when (!= (-> self state-time) (-> self clock frame-counter)) (when (and (or (smack-surface? #t) (and (>= (-> self control surface-slope-z) 0.7) - (zero? (logand (-> self control status) (collide-status touch-actor))) + (not (logtest? (-> self control status) (collide-status touch-actor))) ) ) (begin @@ -2504,14 +2490,14 @@ (if (and (cpad-pressed? (-> self control cpad number) x) (< 4096.0 (-> self control ctrl-xz-vel)) (or (>= (- (-> self clock frame-counter) (-> self state-time)) (seconds 0.1)) - (zero? (logand (-> *cpad-list* cpads (-> self control cpad number) button0-abs 0) (pad-buttons square))) + (not (logtest? (-> *cpad-list* cpads (-> self control cpad number) button0-abs 0) (pad-buttons square))) ) (not (logtest? (-> self state-flags) (state-flags prevent-jump prevent-attack))) (not (logtest? (-> self control current-surface flags) (surface-flag no-attack))) (let ((v1-48 (ja-group))) (and (not (and v1-48 (= v1-48 (-> self draw art-group data 406)))) (and (not (logtest? (-> self control current-surface flags) (surface-flag no-jump))) - (zero? (logand (-> self state-flags) (state-flags prevent-jump))) + (not (logtest? (-> self state-flags) (state-flags prevent-jump))) ) ) ) @@ -3141,10 +3127,7 @@ ) ) ) - ((and (logtest? (focus-status dark) (-> self focus-status)) - (nonzero? (-> self darkjak)) - (logtest? (-> self darkjak stage) 8) - ) + ((and (focus-test? self dark) (nonzero? (-> self darkjak)) (logtest? (-> self darkjak stage) 8)) (set! (-> self control unknown-sound-id00) (add-process *gui-control* self (gui-channel jak) (gui-action queue) "darkbom1" -99.0 0) ) @@ -3398,10 +3381,7 @@ ) (go target-yellow-jump-blast) ) - ((and (logtest? (focus-status dark) (-> self focus-status)) - (nonzero? (-> self darkjak)) - (logtest? (-> self darkjak stage) 4) - ) + ((and (focus-test? self dark) (nonzero? (-> self darkjak)) (logtest? (-> self darkjak stage) 4)) (go target-darkjak-bomb0) ) ) @@ -3474,10 +3454,7 @@ (when (or (and (= (-> (the-as fact-info-target (-> self fact-override)) eco-type) 2) (>= (-> (the-as fact-info-target (-> self fact-override)) eco-level) 1.0) ) - (and (logtest? (focus-status dark) (-> self focus-status)) - (nonzero? (-> self darkjak)) - (logtest? (-> self darkjak stage) 2) - ) + (and (focus-test? self dark) (nonzero? (-> self darkjak)) (logtest? (-> self darkjak stage) 2)) ) (cpad-set-buzz! (-> *cpad-list* cpads 0) 1 255 (seconds 0.5)) (if (and (= (-> (the-as fact-info-target (-> self fact-override)) eco-type) 2) diff --git a/goal_src/jak2/engine/target/target2.gc b/goal_src/jak2/engine/target/target2.gc index 2e42887b65..db0146a92a 100644 --- a/goal_src/jak2/engine/target/target2.gc +++ b/goal_src/jak2/engine/target/target2.gc @@ -234,7 +234,7 @@ (let ((v1-4 event-type)) (cond ((= v1-4 'end-mode) - (if (not (logtest? (-> self focus-status) (focus-status dead))) + (if (not (focus-test? self dead)) (go target-stance-look-around) ) ) @@ -319,68 +319,66 @@ (defstate target-grab (target) :event (behavior ((proc process) (arg1 int) (event-type symbol) (event event-message-block)) - (the-as - object - (cond - ((and (= event-type 'query) (= (-> event param 0) 'mode)) - (-> self state name) - ) - (else - (case event-type - (('end-mode) - (go target-stance) - ) - (('play-anim) - (go target-grab (the-as symbol (-> event param 0))) - ) - (('clone-anim) - (go target-clone-anim (process->handle (the-as process (-> event param 0)))) - ) - (('change-mode) - (case (-> event param 0) - (('normal) - (cond - ((and (logtest? (focus-status dark) (-> self focus-status)) (nonzero? (-> self darkjak))) - (the-as object (target-darkjak-end-mode)) - ) - ((using-gun? self) - (target-gun-end-mode #t) - ) - ) - ) - (('gun) - (cond - ((using-gun? self) - (send-event self 'gun-type (-> event param 2)) - ) - ((want-to-gun? self #t) - (if (logtest? (-> self game features) (game-feature gun)) - (the-as object (target-gun-init (the-as int (-> event param 2)))) + (the-as object (cond + ((and (= event-type 'query) (= (-> event param 0) 'mode)) + (-> self state name) + ) + (else + (case event-type + (('end-mode) + (go target-stance) + ) + (('play-anim) + (go target-grab (the-as symbol (-> event param 0))) + ) + (('clone-anim) + (go target-clone-anim (process->handle (the-as process (-> event param 0)))) + ) + (('change-mode) + (case (-> event param 0) + (('normal) + (cond + ((and (focus-test? self dark) (nonzero? (-> self darkjak))) + (the-as object (target-darkjak-end-mode)) + ) + ((using-gun? self) + (target-gun-end-mode #t) + ) + ) + ) + (('gun) + (cond + ((using-gun? self) + (send-event self 'gun-type (-> event param 2)) + ) + ((want-to-gun? self #t) + (if (logtest? (-> self game features) (game-feature gun)) + (the-as object (target-gun-init (the-as int (-> event param 2)))) + ) + ) + ) + ) + (('demo) + (go target-demo #f) + ) + (('title) + (go target-title #f) + ) + ) + ) + (('anim) + (let ((v0-0 (the-as object (-> event param 0)))) + (set! (-> self control unknown-word04) (the-as uint v0-0)) + v0-0 + ) + ) + (else + (target-generic-event-handler proc arg1 event-type event) + ) + ) ) - ) - ) - ) - (('demo) - (go target-demo #f) - ) - (('title) - (go target-title #f) - ) - ) - ) - (('anim) - (let ((v0-0 (the-as object (-> event param 0)))) - (set! (-> self control unknown-word04) (the-as uint v0-0)) - v0-0 - ) - ) - (else - (target-generic-event-handler proc arg1 event-type event) - ) + ) ) - ) - ) - ) ) :enter (behavior ((arg0 symbol)) (set! (-> self control mod-surface) *grab-mods*) @@ -821,7 +819,7 @@ ) ) (set! (-> self control unknown-handle000) (the-as handle #f)) - (when (logtest? (-> self focus-status) (focus-status edge-grab)) + (when (focus-test? self edge-grab) (logclear! (-> self focus-status) (focus-status edge-grab)) (logclear! (-> self control root-prim prim-core action) (collide-action dont-push-away)) (send-event *camera* 'damp-up) @@ -841,7 +839,7 @@ ) (pad-buttons x) ) - (zero? (logand (-> self state-flags) (state-flags prevent-jump))) + (not (logtest? (-> self state-flags) (state-flags prevent-jump))) ) (cond ((or (< -0.2 (local-pad-angle)) (= (-> *cpad-list* cpads (-> self control cpad number) stick0-speed) 0.0)) diff --git a/goal_src/jak2/engine/ui/minimap.gc b/goal_src/jak2/engine/ui/minimap.gc index 4eb5123dcd..ca3836af98 100644 --- a/goal_src/jak2/engine/ui/minimap.gc +++ b/goal_src/jak2/engine/ui/minimap.gc @@ -1150,7 +1150,7 @@ (seek! (-> s3-0 alpha) 0.0 (-> pp clock seconds-per-frame)) ) ((and (logtest? (-> s3-0 flags) (minimap-flag task-graph)) - (zero? (logand (-> *setting-control* user-current minimap) 32)) + (not (logtest? (-> *setting-control* user-current minimap) 32)) ) (logior! (-> s3-0 flags) (minimap-flag fade-in)) (seek! (-> s3-0 alpha) 0.0 (-> pp clock seconds-per-frame)) @@ -1336,7 +1336,7 @@ ) ) (cond - ((and *target* (logtest? (focus-status board pilot) (-> *target* focus-status))) + ((and *target* (focus-test? *target* board pilot)) (let ((f0-14 0.5) (f1-2 0.000008138021) (f2-0 122880.0) @@ -1992,7 +1992,7 @@ (&+! (-> s5-0 base) 176) (let ((f0-57 1.0)) (when *target* - (if (logtest? (focus-status pilot) (-> *target* focus-status)) + (if (focus-test? *target* pilot) (set! f0-57 0.0) ) ) diff --git a/goal_src/jak2/engine/ui/progress/progress-draw.gc b/goal_src/jak2/engine/ui/progress/progress-draw.gc index 5428e1d714..bd6fa492e3 100644 --- a/goal_src/jak2/engine/ui/progress/progress-draw.gc +++ b/goal_src/jak2/engine/ui/progress/progress-draw.gc @@ -4542,7 +4542,7 @@ (set! (-> arg1 selected-option) #f) (logclear! (-> *game-info* secrets) (-> arg0 flag)) ) - ((and (= (-> arg0 can-toggle) #t) (zero? (logand (-> *game-info* secrets) (-> arg0 flag)))) + ((and (= (-> arg0 can-toggle) #t) (not (logtest? (-> *game-info* secrets) (-> arg0 flag)))) (logior! (-> *game-info* secrets) (-> arg0 flag)) (set! (-> arg1 selected-option) #f) ) @@ -4585,7 +4585,7 @@ (the-as pointer (cond - ((and (not s4-0) (zero? (logand (-> *game-info* purchase-secrets) (-> arg0 flag)))) + ((and (not s4-0) (not (logtest? (-> *game-info* purchase-secrets) (-> arg0 flag)))) (+! (-> arg2 origin x) (the float (if (= (get-aspect-ratio) 'aspect4x3) 50 45 @@ -4609,7 +4609,7 @@ (s5-2 *temp-string* arg2 #f 44 (bucket-id progress)) ) ) - ((and (not s4-0) (= (-> arg0 can-toggle) #t) (zero? (logand (-> *game-info* secrets) (-> arg0 flag)))) + ((and (not s4-0) (= (-> arg0 can-toggle) #t) (not (logtest? (-> *game-info* secrets) (-> arg0 flag)))) (+! (-> arg2 origin x) (the float (if (= (get-aspect-ratio) 'aspect4x3) 50 45 diff --git a/goal_src/jak2/engine/ui/progress/progress.gc b/goal_src/jak2/engine/ui/progress/progress.gc index d2779a0c8e..b9e58f1e8c 100644 --- a/goal_src/jak2/engine/ui/progress/progress.gc +++ b/goal_src/jak2/engine/ui/progress/progress.gc @@ -1293,8 +1293,7 @@ 0 ) -;; WARN: Failed store: (s.w! (+ v1-8 8) 0) at op 19 -;; WARN: Failed store: (s.w! (+ v1-8 12) 0) at op 20 +;; ERROR: Failed store: (s.w! (+ v1-8 8) 0) at op 19 (defun end-scan ((arg0 hud-box) (arg1 float)) (with-dma-buffer-add-bucket ((s5-0 (-> *display* frames (-> *display* on-screen) global-buf)) (bucket-id progress) @@ -2428,12 +2427,12 @@ 'select-save (cond ((and (= (-> *progress-state* starting-state) 'main) - (zero? (logand (-> *game-info* purchase-secrets) (game-secrets hero-mode))) + (not (logtest? (-> *game-info* purchase-secrets) (game-secrets hero-mode))) ) (set! a1-9 'select-save) ) ((and (= (-> *progress-state* starting-state) 'title) - (zero? (logand (-> *game-info* purchase-secrets) (game-secrets hero-mode))) + (not (logtest? (-> *game-info* purchase-secrets) (game-secrets hero-mode))) ) (set! a1-9 'select-save-title) ) diff --git a/goal_src/jak2/levels/atoll/sig0-course.gc b/goal_src/jak2/levels/atoll/sig0-course.gc index e6071c9ff6..497559e80a 100644 --- a/goal_src/jak2/levels/atoll/sig0-course.gc +++ b/goal_src/jak2/levels/atoll/sig0-course.gc @@ -67,7 +67,7 @@ (defmethod sig-atoll-method-259 sig-atoll ((obj sig-atoll)) (let ((v1-0 *target*)) (the-as symbol (and v1-0 - (not (logtest? (-> v1-0 focus-status) (focus-status edge-grab))) + (not (focus-test? v1-0 edge-grab)) (>= (- (-> v1-0 control trans y) (-> obj sig-course spots 11 center y)) -819.2) ) ) @@ -894,7 +894,7 @@ (when (or (not (logtest? (-> arg0 waypoint-bits) 8)) (>= (- (-> pp clock frame-counter) (-> arg0 waypoint-time0)) (seconds 8)) ) - (if (and (demo?) (zero? (logand (-> arg0 waypoint-bits) 8))) + (if (and (demo?) (not (logtest? (-> arg0 waypoint-bits) 8))) (logior! (-> arg0 waypoint-bits) 16) ) (logior! (-> arg0 waypoint-bits) 8) @@ -1076,7 +1076,7 @@ a1-2 ) (not (channel-active? arg1 (the-as uint 0))) - (not (logtest? (-> s5-0 focus-status) (focus-status edge-grab))) + (not (focus-test? s5-0 edge-grab)) (>= (- (-> s5-0 control trans y) (-> arg1 root-override2 trans y)) -4096.0) ) ) diff --git a/goal_src/jak2/levels/city/common/citizen-enemy.gc b/goal_src/jak2/levels/city/common/citizen-enemy.gc index 7990a0c6fb..515b368c10 100644 --- a/goal_src/jak2/levels/city/common/citizen-enemy.gc +++ b/goal_src/jak2/levels/city/common/citizen-enemy.gc @@ -34,7 +34,7 @@ (set! (-> a1-0 tlist) *touching-list*) (find-overlapping-shapes (-> obj root-override2) a1-0) ) - (when (and (not (logtest? (-> obj focus-status) (focus-status disable dead ignore inactive))) + (when (and (not (focus-test? obj disable dead ignore inactive)) (< (-> obj next-update-target) (-> pp clock frame-counter)) (not (logtest? (enemy-flag actor-pause-backup) (-> obj enemy-flags))) (-> obj next-state) @@ -70,10 +70,10 @@ ) ) (cond - ((and (logtest? (-> obj focus-status) (focus-status dangerous)) + ((and (focus-test? obj dangerous) (logtest? (process-mask guard civilian) (-> arg0 mask)) (and v1-6 - (zero? (logand (-> (the-as process-focusable v1-6) focus-status) (focus-status disable dead ignore grabbed))) + (not (logtest? (-> (the-as process-focusable v1-6) focus-status) (focus-status disable dead ignore grabbed))) ) ((method-of-type touching-shapes-entry prims-touching-action?) (the-as touching-shapes-entry s3-0) @@ -188,13 +188,13 @@ ) (when (and s1-1 (!= obj s1-1) - (not (logtest? (-> (the-as process-focusable s1-1) focus-status) (focus-status inactive))) - (not (logtest? (-> (the-as process-focusable s1-1) focus-status) (focus-status disable))) + (not (focus-test? (the-as process-focusable s1-1) inactive)) + (not (focus-test? (the-as process-focusable s1-1) disable)) (not (logtest? (process-mask enemy) (-> s1-1 mask))) (not (logtest? (process-mask crate) (-> s1-1 mask))) (not (logtest? (process-mask vehicle) (-> s1-1 mask))) s1-1 - (zero? (logand (-> (the-as process-focusable s1-1) focus-status) (focus-status disable dead ignore grabbed))) + (not (logtest? (-> (the-as process-focusable s1-1) focus-status) (focus-status disable dead ignore grabbed))) ) (let ((f0-1 (vector-vector-xz-distance (-> obj root-override2 trans) (-> s1-1 root trans)))) (when (or (not s4-0) (< f0-1 f30-0)) diff --git a/goal_src/jak2/levels/city/common/citizen.gc b/goal_src/jak2/levels/city/common/citizen.gc index 969ada1c17..3f2643a874 100644 --- a/goal_src/jak2/levels/city/common/citizen.gc +++ b/goal_src/jak2/levels/city/common/citizen.gc @@ -354,7 +354,7 @@ (set! (-> obj root-override2 transv x) 0.0) (set! (-> obj root-override2 transv z) 0.0) (when (-> obj enemy-info-override move-to-ground) - (if (logtest? (-> obj focus-status) (focus-status under-water)) + (if (focus-test? obj under-water) (enemy-method-47 obj (-> obj root-override2 transv)) (+! (-> obj root-override2 transv y) (* (-> obj enemy-info-override movement-gravity) (-> pp clock seconds-per-frame)) @@ -454,7 +454,7 @@ ) (when (logtest? (enemy-flag trackable-backup directed-ready) (-> obj enemy-flags)) (enemy-method-54 obj) - (when (and (logtest? (-> obj focus-status) (focus-status touch-water)) + (when (and (focus-test? obj touch-water) (< (-> obj root-override2 trans y) (+ -11468.8 (-> obj water-surface-height))) ) (set! (-> obj root-override2 trans y) (+ -11468.8 (-> obj water-surface-height))) @@ -1319,7 +1319,7 @@ This commonly includes things such as: (if (= (-> self water-anim) -1) (go-inactive self) ) - (when (logtest? (-> self focus-status) (focus-status touch-water)) + (when (focus-test? self touch-water) (let ((a1-3 (new 'stack-no-clear 'vector))) (set! (-> a1-3 quad) (-> self root-override2 trans quad)) (set! (-> a1-3 y) (+ 40.96 (-> self water-surface-height))) @@ -1336,7 +1336,7 @@ This commonly includes things such as: :code (behavior () (ja-channel-push! 1 (seconds 0.2)) (cond - ((logtest? (-> self focus-status) (focus-status touch-water)) + ((focus-test? self touch-water) (until #f (ja-no-eval :group! (-> self draw art-group data (-> self water-anim)) :num! (seek! diff --git a/goal_src/jak2/levels/city/common/civilian.gc b/goal_src/jak2/levels/city/common/civilian.gc index 040bab6aef..29a134b64f 100644 --- a/goal_src/jak2/levels/city/common/civilian.gc +++ b/goal_src/jak2/levels/city/common/civilian.gc @@ -1460,7 +1460,7 @@ (set! (-> self enemy-flags) (logior (enemy-flag directed) (-> self enemy-flags))) (let ((gp-0 (-> self root-override2))) (cond - ((logtest? (-> self focus-status) (focus-status under-water)) + ((focus-test? self under-water) (enemy-method-47 self (-> gp-0 transv)) ) (else diff --git a/goal_src/jak2/levels/city/common/ctywide-obs.gc b/goal_src/jak2/levels/city/common/ctywide-obs.gc index efa159899e..4d482d0bb8 100644 --- a/goal_src/jak2/levels/city/common/ctywide-obs.gc +++ b/goal_src/jak2/levels/city/common/ctywide-obs.gc @@ -373,7 +373,7 @@ ) (+! (-> self touch-count) 1) (if (and (logtest? (-> proc mask) (process-mask target)) - (zero? (logand (process-mask projectile) (-> proc mask))) + (not (logtest? (process-mask projectile) (-> proc mask))) ) (the-as int (security-wall-method-23 self)) ) @@ -1503,7 +1503,7 @@ This commonly includes things such as: (go-virtual hostile) ) (else - (if (and (logtest? (focus-status pilot) (-> (the-as process-focusable gp-2) focus-status)) + (if (and (focus-test? (the-as process-focusable gp-2) pilot) (>= (the-as uint (get-alert-level *traffic-engine*)) (the-as uint 1)) ) (go-virtual hostile) @@ -1972,7 +1972,7 @@ This commonly includes things such as: (set! (-> s4-1 x) (deg- (-> s2-0 x) (-> s0-1 x))) (set! (-> s4-1 y) (deg- (-> s2-0 y) (-> s0-1 y))) (cond - ((logtest? (focus-status pilot) (-> (the-as process-focusable s5-0) focus-status)) + ((focus-test? (the-as process-focusable s5-0) pilot) (set! (-> obj angle-turret) (deg-seek (-> obj angle-turret) (-> s4-1 y) (* 36408.89 (-> pp clock seconds-per-frame))) ) @@ -2075,7 +2075,7 @@ This commonly includes things such as: ((and (>= (-> self id) 0) (task-node-open? (game-task-node city-power-resolution))) ) (else - (if (and (not (logtest? (focus-status pilot) (-> (the-as process-focusable gp-0) focus-status))) + (if (and (not (focus-test? (the-as process-focusable gp-0) pilot)) *traffic-engine* (zero? (get-alert-level *traffic-engine*)) ) @@ -2348,7 +2348,7 @@ This commonly includes things such as: (cond (s5-0 (cond - ((or (logtest? (-> (the-as vehicle s5-0) focus-status) (focus-status dead inactive)) + ((or (focus-test? (the-as vehicle s5-0) dead inactive) (not (logtest? (-> (the-as vehicle s5-0) flags) (rigid-body-object-flag waiting-for-player))) (let ((f0-0 (-> obj test-sphere r))) (< (* f0-0 f0-0) @@ -2872,12 +2872,12 @@ This commonly includes things such as: ) (when (and s1-1 (!= obj s1-1) - (not (logtest? (-> s1-1 focus-status) (focus-status inactive))) - (not (logtest? (-> s1-1 focus-status) (focus-status disable))) - (not (logtest? (-> s1-1 focus-status) (focus-status dead))) + (not (focus-test? s1-1 inactive)) + (not (focus-test? s1-1 disable)) + (not (focus-test? s1-1 dead)) (not (logtest? (process-mask guard) (-> s1-1 mask))) (not (logtest? (process-mask crate) (-> s1-1 mask))) - (zero? (logand (process-mask vehicle) (-> s1-1 mask))) + (not (logtest? (process-mask vehicle) (-> s1-1 mask))) ) (let ((f0-0 (vector-vector-xz-distance (-> obj root-override trans) (-> s1-1 root-override trans)))) (when (or (not s5-0) (< f0-0 f30-0)) @@ -3870,7 +3870,7 @@ This commonly includes things such as: (f0-2 (vector-dot (vector-z-quaternion! (new 'stack-no-clear 'vector) (-> obj root-override quat)) gp-1)) ) (and *target* - (not (logtest? (focus-status pilot) (-> *target* focus-status))) + (not (focus-test? *target* pilot)) (< (fabs f30-0) 10240.0) (< 0.0 f0-2) (< (fabs f0-2) 20480.0) diff --git a/goal_src/jak2/levels/city/common/ctywide-tasks.gc b/goal_src/jak2/levels/city/common/ctywide-tasks.gc index 8b98c06a6e..0720562456 100644 --- a/goal_src/jak2/levels/city/common/ctywide-tasks.gc +++ b/goal_src/jak2/levels/city/common/ctywide-tasks.gc @@ -194,7 +194,7 @@ (suspend) ) ) - (while (or (not *target*) (logtest? (focus-status dead teleporting) (-> *target* focus-status))) + (while (or (not *target*) (focus-test? *target* dead teleporting)) (suspend) ) (set! (-> self sound-id 0) @@ -215,9 +215,7 @@ (function object) (lambda :behavior task-manager () - (when (and (= (-> self sub-state) 1) - (not (and *target* (logtest? (focus-status pilot) (-> *target* focus-status)))) - ) + (when (and (= (-> self sub-state) 1) (not (and *target* (focus-test? *target* pilot)))) (set! (-> self sound-id 0) (the-as sound-id (talker-spawn-func (-> *talker-speech* 46) *entity-pool* (target-pos 0) (the-as region #f))) ) @@ -239,11 +237,11 @@ (local-vars (v1-1 object)) (until v1-1 (suspend) - (set! v1-1 (and *target* (logtest? (focus-status pilot) (-> *target* focus-status)))) + (set! v1-1 (and *target* (focus-test? *target* pilot))) ) (set! (-> self slave 0) (-> *target* pilot vehicle)) (set! (-> self sub-state) (the-as uint 1)) - (while (or (not *target*) (logtest? (focus-status dead teleporting) (-> *target* focus-status))) + (while (or (not *target*) (focus-test? *target* dead teleporting)) (suspend) ) (set! (-> self sound-id 0) @@ -255,7 +253,7 @@ (suspend) ) ) - (while (or (not *target*) (logtest? (focus-status dead teleporting) (-> *target* focus-status))) + (while (or (not *target*) (focus-test? *target* dead teleporting)) (suspend) ) (set! (-> self sound-id 0) @@ -267,19 +265,19 @@ (suspend) ) ) - (while (or (not *target*) (logtest? (focus-status dead teleporting) (-> *target* focus-status))) + (while (or (not *target*) (focus-test? *target* dead teleporting)) (suspend) ) (set! (-> self sound-id 0) (the-as sound-id (talker-spawn-func (-> *talker-speech* 36) *entity-pool* (target-pos 0) (the-as region #f))) ) (while (let ((v1-34 (handle->process (-> self slave 0)))) - (zero? (logand (rigid-body-object-flag flight-level-transition) (-> (the-as vehicle v1-34) flags))) + (not (logtest? (rigid-body-object-flag flight-level-transition) (-> (the-as vehicle v1-34) flags))) ) (suspend) ) (wait-for-speech-end (-> self sound-id 0)) - (while (or (not *target*) (logtest? (focus-status dead teleporting) (-> *target* focus-status))) + (while (or (not *target*) (focus-test? *target* dead teleporting)) (suspend) ) (set! (-> self sound-id 0) @@ -333,7 +331,7 @@ (cond ((zero? (-> self sub-state)) (cond - ((and *target* (logtest? (focus-status pilot) (-> *target* focus-status))) + ((and *target* (focus-test? *target* pilot)) (let ((v1-8 (handle->process (-> *target* pilot vehicle)))) (if (logtest? (rigid-body-object-flag flight-level-transition) (-> (the-as vehicle v1-8) flags)) (go-virtual complete) @@ -346,7 +344,7 @@ ) ) ((= (-> self sub-state) 1) - (if (not (and *target* (logtest? (focus-status pilot) (-> *target* focus-status)))) + (if (not (and *target* (focus-test? *target* pilot))) (go-virtual fail) ) ) @@ -381,7 +379,7 @@ (the-as sound-id (talker-spawn-func (-> *talker-speech* 36) *entity-pool* (target-pos 0) (the-as region #f))) ) (while (let ((v1-15 (handle->process (-> *target* pilot vehicle)))) - (zero? (logand (rigid-body-object-flag flight-level-transition) (-> (the-as vehicle v1-15) flags))) + (not (logtest? (rigid-body-object-flag flight-level-transition) (-> (the-as vehicle v1-15) flags))) ) (suspend) ) @@ -487,7 +485,7 @@ () (local-vars (v1-7 symbol)) (send-event *traffic-manager* 'set-target-level #x3f800000) - (until (or v1-7 (and *target* (logtest? (focus-status pilot) (-> *target* focus-status)))) + (until (or v1-7 (and *target* (focus-test? *target* pilot))) (suspend) (let ((f0-0 122880.0)) (set! v1-7 (< (* f0-0 f0-0) (vector-vector-distance-squared (-> self begin-pos) (target-pos 0)))) diff --git a/goal_src/jak2/levels/city/common/guard.gc b/goal_src/jak2/levels/city/common/guard.gc index da6d810148..83b5535426 100644 --- a/goal_src/jak2/levels/city/common/guard.gc +++ b/goal_src/jak2/levels/city/common/guard.gc @@ -621,13 +621,13 @@ ) ((= v1-0 'end-pursuit) (when *debug-segment* - (when (logtest? (-> obj focus-status) (focus-status inactive)) + (when (focus-test? obj inactive) (format 0 "guard::event end-pursuit recieved by inactive process ~d~%" (-> obj pid)) (break!) 0 ) ) - (when (not (logtest? (-> obj focus-status) (focus-status dead))) + (when (not (focus-test? obj dead)) (when (logtest? (-> obj flags) (citizen-flag hostile)) (logclear! (-> obj flags) (citizen-flag persistent in-pursuit hostile)) (citizen-method-195 obj (vector-z-quaternion! (new 'stack-no-clear 'vector) (-> obj root-override2 quat))) @@ -637,17 +637,17 @@ ) ((= v1-0 'alert-begin) (when *debug-segment* - (when (logtest? (-> obj focus-status) (focus-status inactive)) + (when (focus-test? obj inactive) (format 0 "guard::event alert-begin recieved by inactive process ~d~%" (-> obj pid)) (break!) 0 ) ) - (when (not (logtest? (-> obj focus-status) (focus-status dead))) + (when (not (focus-test? obj dead)) (when (not (logtest? (-> obj flags) (citizen-flag hostile))) (let ((a1-27 (the-as object (-> arg3 param 0)))) (when (and (the-as uint a1-27) - (zero? (logand (-> (the-as process-focusable a1-27) focus-status) (focus-status disable dead inactive))) + (not (logtest? (-> (the-as process-focusable a1-27) focus-status) (focus-status disable dead inactive))) ) (set! (-> obj traffic-target-status handle) (process->handle (the-as process-focusable a1-27))) (try-update-focus (-> obj focus) (the-as process-focusable a1-27) obj) @@ -663,13 +663,13 @@ ) ((= v1-0 'alert-end) (when *debug-segment* - (when (logtest? (-> obj focus-status) (focus-status inactive)) + (when (focus-test? obj inactive) (format 0 "guard::event alert-end recieved by inactive process ~d~%" (-> obj pid)) (break!) 0 ) ) - (when (not (logtest? (-> obj focus-status) (focus-status dead))) + (when (not (focus-test? obj dead)) (when (logtest? (-> obj flags) (citizen-flag hostile)) (logclear! (-> obj flags) (citizen-flag persistent in-pursuit hostile)) (speech-control-method-12 *speech-control* obj (speech-type speech-type-0 speech-type-2)) @@ -693,7 +693,7 @@ ) (when (= a0-84 'attack) (when (logtest? (-> (the-as process-focusable v1-130) mask) (process-mask target)) - (when (logtest? (-> (the-as process-focusable v1-130) focus-status) (focus-status dead)) + (when (focus-test? (the-as process-focusable v1-130) dead) (format #t "guard killed player~%") (the-as object (speech-control-method-12 *speech-control* obj (speech-type speech-type-1 speech-type-3))) ) @@ -1587,7 +1587,7 @@ (let ((s4-1 (handle->process (-> obj focus handle)))) (cond ((and s4-1 - (zero? (logand (-> (the-as process-focusable s4-1) focus-status) (focus-status disable dead inactive))) + (not (logtest? (-> (the-as process-focusable s4-1) focus-status) (focus-status disable dead inactive))) ) (when (logtest? (-> s5-1 flags) (traffic-target-flag updated)) (logclear! (-> obj flags) (citizen-flag target-in-sight)) @@ -1881,7 +1881,7 @@ (crimson-guard-method-220 self) (when (and (not (logtest? (-> self draw status) (draw-control-status on-screen))) (= (-> self controller traffic sync-mask-16) (ash 1 (logand (-> self traffic-id) 15))) - (zero? (logand (-> self flags) (citizen-flag sticky-weapon))) + (not (logtest? (-> self flags) (citizen-flag sticky-weapon))) ) (let ((a1-4 (get-traffic-guard-change-to-type (-> self controller traffic) (the-as int (-> self guard-type))))) (if (!= a1-4 (-> self guard-type)) @@ -1896,9 +1896,7 @@ ) ) ) - (if (or (logtest? (-> gp-0 focus-status) (focus-status inactive)) - (logtest? (-> gp-0 focus-status) (focus-status disable)) - ) + (if (or (focus-test? gp-0 inactive) (focus-test? gp-0 disable)) (set! gp-0 (the-as process-focusable #f)) ) (cond @@ -1912,18 +1910,18 @@ (speech-control-method-12 *speech-control* self (speech-type speech-type-1)) ) (when (and (logtest? (-> self nav state flags) (nav-state-flag at-target)) - (zero? (logand (-> s5-0 flags) (traffic-target-flag visible-recently))) + (not (logtest? (-> s5-0 flags) (traffic-target-flag visible-recently))) ) (logclear! (-> self flags) (citizen-flag persistent)) (citizen-method-195 self (vector-z-quaternion! (new 'stack-no-clear 'vector) (-> self root-override2 quat))) (go-virtual search) ) (when (or (logtest? (-> s5-0 flags) (traffic-target-flag visible-recently)) - (zero? (logand (-> gp-0 mask) (process-mask target))) + (not (logtest? (-> gp-0 mask) (process-mask target))) ) (speech-control-method-15 *speech-control* self) (cond - ((logtest? (focus-status arrestable) (-> gp-0 focus-status)) + ((focus-test? gp-0 arrestable) (if (and (< (-> self target-self-xz-dist) 28672.0) (< (fabs (-> self target-y-angle)) 7281.778) (>= 8192.0 (fabs (- (-> (get-trans gp-0 1) y) (-> self root-override2 trans y)))) @@ -1934,7 +1932,7 @@ (else (if (and (< (-> self target-self-xz-dist) 16384.0) (and (< (fabs (-> self target-y-angle)) 7281.778) - (and gp-0 (zero? (logand (-> gp-0 focus-status) (focus-status disable dead ignore grabbed)))) + (and gp-0 (not (logtest? (-> gp-0 focus-status) (focus-status disable dead ignore grabbed)))) (logtest? (-> self flags) (citizen-flag target-in-sight)) ) ) @@ -2173,7 +2171,7 @@ (let ((gp-0 (handle->process (-> self focus handle)))) (when gp-0 (when (not (and gp-0 - (zero? (logand (-> (the-as process-focusable gp-0) focus-status) (focus-status disable dead ignore grabbed))) + (not (logtest? (-> (the-as process-focusable gp-0) focus-status) (focus-status disable dead ignore grabbed))) ) ) (set! (-> self miss-amount) (lerp-scale 0.0 16384.0 (-> self target-self-dist) 40960.0 122880.0)) @@ -2182,7 +2180,7 @@ (if (and (< (-> self target-self-xz-dist) 16384.0) (and (< (fabs (-> self target-y-angle)) 7281.778) gp-0 - (zero? (logand (-> (the-as process-focusable gp-0) focus-status) (focus-status disable dead ignore grabbed))) + (not (logtest? (-> (the-as process-focusable gp-0) focus-status) (focus-status disable dead ignore grabbed))) ) ) (go-virtual close-attack) @@ -2247,9 +2245,7 @@ (let ((v1-58 (handle->process (-> self focus handle)))) (when v1-58 (if (or (< (-> self target-vel) 40.96) - (and (logtest? (focus-status pilot) (-> (the-as process-focusable v1-58) focus-status)) - (< (-> self target-pos y) 49152.0) - ) + (and (focus-test? (the-as process-focusable v1-58) pilot) (< (-> self target-pos y) 49152.0)) ) (set! (-> self miss-amount) (- (-> self miss-amount) (* 12288.0 f0-8))) (set! (-> self miss-amount) (- (-> self miss-amount) (* 4096.0 f0-8))) @@ -3224,13 +3220,13 @@ :trans (behavior () (crimson-guard-method-220 self) (if (and (>= (- (-> self clock frame-counter) (-> self state-time)) (seconds 1)) - (or (< 32768.0 (-> self target-self-xz-dist)) (zero? (logand (-> self flags) (citizen-flag target-in-sight)))) + (or (< 32768.0 (-> self target-self-xz-dist)) (not (logtest? (-> self flags) (citizen-flag target-in-sight)))) ) (go-hostile self) ) (let ((v1-14 (handle->process (-> self focus handle)))) - (if (or (logtest? (-> (the-as process-focusable v1-14) focus-status) (focus-status inactive)) - (logtest? (-> (the-as process-focusable v1-14) focus-status) (focus-status disable)) + (if (or (focus-test? (the-as process-focusable v1-14) inactive) + (focus-test? (the-as process-focusable v1-14) disable) ) (set! v1-14 (the-as process #f)) ) @@ -3312,10 +3308,10 @@ (or (< (-> self clock frame-counter) (-> self next-shot)) (< (-> self target-self-xz-dist) 16384.0) (not (and (handle->process (-> self focus handle)) - (zero? (logand (-> (the-as process-focusable (handle->process (-> self focus handle))) focus-status) + (not (logtest? (-> (the-as process-focusable (handle->process (-> self focus handle))) focus-status) (focus-status disable dead ignore grabbed) ) - ) + ) ) ) (>= (fabs (-> self target-y-angle)) 7281.778) @@ -3331,10 +3327,10 @@ ) (cond ((and (handle->process (-> self focus handle)) - (zero? (logand (-> (the-as process-focusable (handle->process (-> self focus handle))) focus-status) + (not (logtest? (-> (the-as process-focusable (handle->process (-> self focus handle))) focus-status) (focus-status disable dead ignore grabbed) ) - ) + ) ) (cond ((< (-> self target-self-xz-dist) 16384.0) diff --git a/goal_src/jak2/levels/city/common/metalhead-flitter.gc b/goal_src/jak2/levels/city/common/metalhead-flitter.gc index 294d5bd426..e35c8684e4 100644 --- a/goal_src/jak2/levels/city/common/metalhead-flitter.gc +++ b/goal_src/jak2/levels/city/common/metalhead-flitter.gc @@ -532,7 +532,7 @@ ) (defmethod enemy-method-99 metalhead-flitter ((obj metalhead-flitter) (arg0 process-focusable)) - (logtest? (focus-status mech) (-> arg0 focus-status)) + (focus-test? arg0 mech) ) (defmethod metalhead-flitter-method-205 metalhead-flitter ((obj metalhead-flitter)) @@ -841,7 +841,7 @@ ((and gp-0 (< (- (-> self clock frame-counter) (-> self state-time)) (seconds 1.5)) gp-0 - (zero? (logand (-> (the-as process-focusable gp-0) focus-status) (focus-status disable dead ignore grabbed))) + (not (logtest? (-> (the-as process-focusable gp-0) focus-status) (focus-status disable dead ignore grabbed))) ) (let ((s5-1 (-> self nav state)) (v1-10 (get-trans (the-as process-focusable gp-0) 0)) diff --git a/goal_src/jak2/levels/city/common/metalhead-grunt.gc b/goal_src/jak2/levels/city/common/metalhead-grunt.gc index ee3d84ecf1..1efa2178c4 100644 --- a/goal_src/jak2/levels/city/common/metalhead-grunt.gc +++ b/goal_src/jak2/levels/city/common/metalhead-grunt.gc @@ -691,7 +691,7 @@ (gp-0 (-> self clock frame-counter)) ) (when (and (>= gp-0 (-> self next-warn-time)) - (zero? (logand (-> self draw status) (draw-control-status on-screen))) + (not (logtest? (-> self draw status) (draw-control-status on-screen))) ) (when (and a0-1 (let ((f0-0 65536.0)) @@ -1219,7 +1219,7 @@ (>= 163840.0 (vector-vector-distance (-> self root-override2 trans) gp-0)) ) (or (not (logtest? (-> self fact-info-override enemy-options) (enemy-option user8))) - (and (not (logtest? (-> (the-as process-focusable s5-0) focus-status) (focus-status in-air))) + (and (not (focus-test? (the-as process-focusable s5-0) in-air)) (>= 4096.0 (fabs (- (-> gp-0 y) (-> self root-override2 trans y)))) ) ) diff --git a/goal_src/jak2/levels/city/common/nav-graph.gc b/goal_src/jak2/levels/city/common/nav-graph.gc index fe24691b16..39d33f64c5 100644 --- a/goal_src/jak2/levels/city/common/nav-graph.gc +++ b/goal_src/jak2/levels/city/common/nav-graph.gc @@ -1238,7 +1238,7 @@ and patched at runtime after loading." (set! v1-4 (= arg1 (-> s0-0 level_name))) (label cfg-4) (b! (not v1-4) cfg-7 :likely-delay (set! v1-6 v1-4)) - (set! v1-6 (zero? (logand (-> s0-0 mysql-save-flag) (mysql-save-flag delete)))) + (set! v1-6 (not (logtest? (-> s0-0 mysql-save-flag) (mysql-save-flag delete)))) (label cfg-7) (b! (not v1-6) cfg-27 :delay (nop!)) (set! sv-16 (temp-edge-size s0-0)) diff --git a/goal_src/jak2/levels/city/common/pilot-states.gc b/goal_src/jak2/levels/city/common/pilot-states.gc index 5e7d03bd9a..fca457fe57 100644 --- a/goal_src/jak2/levels/city/common/pilot-states.gc +++ b/goal_src/jak2/levels/city/common/pilot-states.gc @@ -240,7 +240,7 @@ ) (defbehavior target-pilot-signal-ready target () - (when (not (logtest? (-> self focus-status) (focus-status pilot-riding))) + (when (not (focus-test? self pilot-riding)) (logior! (-> self focus-status) (focus-status pilot-riding)) (send-event (handle->process (-> self pilot vehicle)) 'pilot-on (-> self pilot seat-index)) ) @@ -522,7 +522,7 @@ (case event-type (('end-mode) (cond - ((logtest? (-> self focus-status) (focus-status pilot-riding)) + ((focus-test? self pilot-riding) (go target-pilot-get-off) ) (else @@ -549,7 +549,7 @@ (ja-channel-set! 0) (go target-falling #f) ) - ((logtest? (-> (the-as vehicle gp-0) focus-status) (focus-status dead)) + ((focus-test? (the-as vehicle gp-0) dead) (go target-pilot-get-off) ) (else diff --git a/goal_src/jak2/levels/city/common/target-pilot.gc b/goal_src/jak2/levels/city/common/target-pilot.gc index 064d3d7421..7960e5d478 100644 --- a/goal_src/jak2/levels/city/common/target-pilot.gc +++ b/goal_src/jak2/levels/city/common/target-pilot.gc @@ -54,7 +54,7 @@ (('change-mode) (case (-> arg3 param 0) (('grab) - (when (not (logtest? (-> self focus-status) (focus-status dead))) + (when (not (focus-test? self dead)) (if (not (-> arg3 param 1)) #t (go target-pilot-grab) @@ -356,7 +356,7 @@ (quaternion-copy! (-> self control quat-for-control) (-> self control quat)) (quaternion-copy! (-> self control dir-targ) (-> self control quat)) (let ((s4-0 (-> self alt-cam-pos))) - (when (not (logtest? (-> self focus-status) (focus-status dead))) + (when (not (focus-test? self dead)) (let ((s3-0 (new 'stack-no-clear 'collide-query-with-5vec))) (set! (-> s3-0 vec 2 x) 0.0) (set! (-> s3-0 vec 2 y) 20480.0) diff --git a/goal_src/jak2/levels/city/common/traffic-engine.gc b/goal_src/jak2/levels/city/common/traffic-engine.gc index fa08f0ee6e..b201f76bd5 100644 --- a/goal_src/jak2/levels/city/common/traffic-engine.gc +++ b/goal_src/jak2/levels/city/common/traffic-engine.gc @@ -320,7 +320,7 @@ The param object is updated with the ID of the box and can be later used with up (let ((a1-1 (-> s4-0 object-type-info-array (-> obj active-object-type-list s3-0))) (a0-2 (handle->process (-> obj active-object-list s3-0))) ) - (if (not (logtest? (-> (the-as process-focusable a0-2) focus-status) (focus-status inactive))) + (if (not (focus-test? (the-as process-focusable a0-2) inactive)) (arg0 (the-as process-focusable a0-2) a1-1) ) ) @@ -339,7 +339,7 @@ The param object is updated with the ID of the box and can be later used with up (let ((a1-1 (-> s3-0 object-type-info-array a0-1)) (a0-3 (handle->process (-> obj active-object-list s2-0))) ) - (if (not (logtest? (-> (the-as process-focusable a0-3) focus-status) (focus-status inactive))) + (if (not (focus-test? (the-as process-focusable a0-3) inactive)) (arg1 (the-as process-focusable a0-3) a1-1) ) ) @@ -454,7 +454,7 @@ Process is recycled and moved to reserved, if it deactivates." (v1-5 (the-as object #t)) ) (when s1-0 - (when (not (logtest? (-> (the-as process-focusable s1-0) focus-status) (focus-status inactive))) + (when (not (focus-test? (the-as process-focusable s1-0) inactive)) (if arg1 (set! gp-0 'traffic-off-force) ) @@ -587,7 +587,7 @@ Process is recycled and moved to reserved, if it deactivates." (logtest? (-> v1-2 flags) (traffic-type-flags trtflags-2)) (logtest? (-> v1-2 flags) (traffic-type-flags trtflags-3)) (or (not (logtest? (-> v1-2 flags) (traffic-type-flags trtflags-0))) - (zero? (logand (-> obj traffic alert-state flags) (traffic-alert-flag alert-ending))) + (not (logtest? (-> obj traffic alert-state flags) (traffic-alert-flag alert-ending))) ) ) (let ((s4-0 (new 'stack-no-clear 'mystery-traffic-object-spawn-params))) @@ -1591,7 +1591,7 @@ Process is recycled and moved to reserved, if it deactivates." (let ((a2-0 *target*)) (when a2-0 (cond - ((logtest? (focus-status pilot) (-> a2-0 focus-status)) + ((focus-test? a2-0 pilot) (when (nonzero? (-> a2-0 pilot)) (let ((a2-1 (handle->process (-> a2-0 pilot vehicle)))) (when a2-1 @@ -1614,7 +1614,7 @@ Process is recycled and moved to reserved, if it deactivates." (cond (s3-0 (cond - ((logtest? (-> (the-as vehicle s3-0) focus-status) (focus-status inactive)) + ((focus-test? (the-as vehicle s3-0) inactive) (deactivate-object (-> obj citizen-tracker-array) (the-as int s4-0) #f) ) ((begin @@ -1644,7 +1644,7 @@ Process is recycled and moved to reserved, if it deactivates." (cond (s3-1 (cond - ((logtest? (-> (the-as process-focusable s3-1) focus-status) (focus-status inactive)) + ((focus-test? (the-as process-focusable s3-1) inactive) (deactivate-object (-> obj vehicle-tracker-array) (the-as int s4-1) #f) ) ((begin @@ -1682,7 +1682,7 @@ Process is recycled and moved to reserved, if it deactivates." (let ((f30-0 10000000000000000000000000000000000000.0)) (dotimes (s1-0 (the-as int (-> s4-2 active-cell-count))) (let ((s0-0 (-> s4-2 active-cell-list s1-0))) - (when (and (logtest? (-> s0-0 flags) (ash 1 s3-3)) (zero? (logand (-> s0-0 flags) (vis-cell-flag suppress)))) + (when (and (logtest? (-> s0-0 flags) (ash 1 s3-3)) (not (logtest? (-> s0-0 flags) (vis-cell-flag suppress)))) (set! sv-48 0) (while (< sv-48 (-> s0-0 incoming-segment-count)) (set! sv-64 (-> s0-0 segment-array sv-48)) @@ -2052,7 +2052,7 @@ Process is recycled and moved to reserved, if it deactivates." ) ) ) - (when (and s2-0 (not (logtest? (-> s2-0 focus-status) (focus-status disable dead inactive))) (!= arg0 s2-0)) + (when (and s2-0 (not (focus-test? s2-0 disable dead inactive)) (!= arg0 s2-0)) (let ((f0-0 (vector-vector-xz-distance (-> arg0 root trans) (-> s2-0 root-override trans)))) (when (or (not gp-0) (< f0-0 f30-0)) (set! gp-0 s2-0) @@ -2084,7 +2084,7 @@ Process is recycled and moved to reserved, if it deactivates." ) ) ) - (when (and s2-1 (not (logtest? (-> s2-1 focus-status) (focus-status disable dead inactive))) (!= arg0 s2-1)) + (when (and s2-1 (not (focus-test? s2-1 disable dead inactive)) (!= arg0 s2-1)) (let ((f0-1 (vector-vector-xz-distance (-> arg0 root trans) (-> s2-1 root-override trans)))) (when (or (not gp-0) (< f0-1 f30-0)) (set! gp-0 s2-1) @@ -2115,7 +2115,7 @@ Process is recycled and moved to reserved, if it deactivates." ) ) ) - (when (and s2-2 (not (logtest? (-> s2-2 focus-status) (focus-status disable dead inactive))) (!= arg0 s2-2)) + (when (and s2-2 (not (focus-test? s2-2 disable dead inactive)) (!= arg0 s2-2)) (let ((f0-2 (vector-vector-xz-distance (-> arg0 root trans) (-> s2-2 root-override trans)))) (when (or (not gp-0) (< f0-2 f30-0)) (set! gp-0 s2-2) @@ -2198,7 +2198,7 @@ Process is recycled and moved to reserved, if it deactivates." (((traffic-type crimson-guard-1)) (let ((guard (handle->process (-> obj vehicle-tracker-array active-object-list guard-count)))) (when (and guard - (not (logtest? (-> (the-as process-focusable guard) focus-status) (focus-status dead inactive))) + (not (focus-test? (the-as process-focusable guard) dead inactive)) (= (-> (the-as crimson-guard guard) traffic-target-status handle) (-> target-status handle)) ) (set! (-> guards guard-idx) (the-as crimson-guard guard)) @@ -2614,7 +2614,7 @@ Process is recycled and moved to reserved, if it deactivates." (((traffic-type guard-bike) (traffic-type hellcat)) (let ((a3-6 (handle->process (-> obj citizen-tracker-array active-object-list a2-0)))) (when (and a3-6 - (not (logtest? (-> (the-as vehicle a3-6) focus-status) (focus-status dead inactive))) + (not (focus-test? (the-as vehicle a3-6) dead inactive)) (logtest? (rigid-body-object-flag alert) (-> (the-as vehicle a3-6) flags)) ) (let ((t0-13 (-> (the-as vehicle a3-6) info-override guard-type))) @@ -2657,7 +2657,7 @@ Process is recycled and moved to reserved, if it deactivates." (case (-> obj vehicle-tracker-array active-object-type-list s1-0) (((traffic-type crimson-guard-1)) (let ((s0-0 (handle->process (-> obj vehicle-tracker-array active-object-list s1-0)))) - (when (and s0-0 (zero? (logand (-> (the-as crimson-guard s0-0) focus-status) (focus-status dead inactive)))) + (when (and s0-0 (not (logtest? (-> (the-as crimson-guard s0-0) focus-status) (focus-status dead inactive)))) (when (and (logtest? (-> (the-as crimson-guard s0-0) flags) (citizen-flag in-pursuit)) (logtest? (-> (the-as crimson-guard s0-0) flags) (citizen-flag target-in-sight)) ) @@ -2670,7 +2670,7 @@ Process is recycled and moved to reserved, if it deactivates." (set! s5-0 (the-as crimson-guard s0-0)) ) (if (and (< 327680.0 f0-3) - (zero? (logand (-> obj alert-state flags) (traffic-alert-flag disable-pursuit-control))) + (not (logtest? (-> obj alert-state flags) (traffic-alert-flag disable-pursuit-control))) ) (send-event (the-as crimson-guard s0-0) 'end-pursuit) ) @@ -2749,7 +2749,7 @@ Process is recycled and moved to reserved, if it deactivates." (fmax 0.0 (fmin 1.0 (* (-> a1-3 inaccuracy) (-> obj alert-state guard-inaccuracy-factor)))) ) (when *target* - (when (logtest? (focus-status pilot) (-> *target* focus-status)) + (when (focus-test? *target* pilot) (set! (-> a1-3 acquire-delay) (the-as uint (the int (* 0.75 (the float (-> a1-3 acquire-delay)))))) (set! (-> a1-3 shot-delay) (the-as uint (the int (* 0.6 (the float (-> a1-3 shot-delay)))))) (set! (-> a1-3 burst-delay) (the-as uint (the int (* 0.8 (the float (-> a1-3 burst-delay)))))) @@ -2941,7 +2941,7 @@ Process is recycled and moved to reserved, if it deactivates." (set! (-> a1-6 parking-spot-prob) (the-as uint - (if (and (zero? (-> a1-6 tracker-index)) (zero? (logand (-> a1-6 flags) (traffic-type-flags trtflags-0)))) + (if (and (zero? (-> a1-6 tracker-index)) (not (logtest? (-> a1-6 flags) (traffic-type-flags trtflags-0)))) v1-13 0 ) @@ -3012,7 +3012,7 @@ Process is recycled and moved to reserved, if it deactivates." (let ((v1-3 (handle->process (-> obj citizen-tracker-array active-object-list s4-0)))) (when v1-3 (cond - ((logtest? (-> (the-as process-focusable v1-3) focus-status) (focus-status inactive)) + ((focus-test? (the-as process-focusable v1-3) inactive) (deactivate-object (-> obj citizen-tracker-array) (the-as int s4-0) #f) ) ((begin (set! v1-6 (-> (the-as vehicle v1-3) controller branch)) (and v1-6 (nonzero? v1-6))) diff --git a/goal_src/jak2/levels/city/common/vehicle-guard.gc b/goal_src/jak2/levels/city/common/vehicle-guard.gc index 60998a06e8..982254343c 100644 --- a/goal_src/jak2/levels/city/common/vehicle-guard.gc +++ b/goal_src/jak2/levels/city/common/vehicle-guard.gc @@ -343,7 +343,7 @@ (dotimes (s3-1 2) (+! (-> obj aim-rot-vel s3-1) (* 5.0 - (- (* 8.0 (if (or (zero? s3-1) (zero? (logand (-> obj flags) (turret-flag no-rot-y-clamp)))) + (- (* 8.0 (if (or (zero? s3-1) (not (logtest? (-> obj flags) (turret-flag no-rot-y-clamp)))) (- (-> gp-0 vec-4 data s3-1) (-> obj aim-rot s3-1)) (deg- (-> gp-0 vec-4 data s3-1) (-> obj aim-rot s3-1)) ) @@ -355,7 +355,7 @@ ) (set! (-> obj aim-rot-vel s3-1) (* (-> obj aim-rot-vel s3-1) (fmax 0.0 (- 1.0 (* 0.1 (-> gp-0 vec-12 x)))))) (+! (-> obj aim-rot s3-1) (* (-> obj aim-rot-vel s3-1) (-> gp-0 vec-12 x))) - (when (or (zero? s3-1) (zero? (logand (-> obj flags) (turret-flag no-rot-y-clamp)))) + (when (or (zero? s3-1) (not (logtest? (-> obj flags) (turret-flag no-rot-y-clamp)))) (let ((f0-31 (-> obj info rot-min s3-1))) (when (< (-> obj aim-rot s3-1) f0-31) (set! (-> obj aim-rot s3-1) f0-31) @@ -656,7 +656,7 @@ (vector-float*! (-> arg0 to-target-dir) (-> arg0 to-target) f1-2) ) (let ((f0-3 204800.0)) - (if (logtest? (focus-status pilot) (-> (the-as process-focusable s5-0) focus-status)) + (if (focus-test? (the-as process-focusable s5-0) pilot) (set! f0-3 (+ 102400.0 f0-3)) ) (set! (-> arg0 attack-range) f0-3) @@ -892,10 +892,10 @@ ) ) (('track) - (zero? (logand (-> obj flags) (rigid-body-object-flag player-driving))) + (not (logtest? (-> obj flags) (rigid-body-object-flag player-driving))) ) (('alert-begin) - (when (and (not (logtest? (-> obj focus-status) (focus-status dead))) + (when (and (not (focus-test? obj dead)) (not (logtest? (rigid-body-object-flag alert) (-> obj flags))) (logtest? (rigid-body-object-flag ai-driving) (-> obj flags)) (>= (the-as uint (get-alert-level (-> obj controller traffic))) (the-as uint 2)) @@ -908,7 +908,7 @@ ) ) (('alert-end) - (when (not (logtest? (-> obj focus-status) (focus-status dead))) + (when (not (focus-test? obj dead)) (when (logtest? (rigid-body-object-flag alert) (-> obj flags)) (set! (-> obj flags) (the-as rigid-body-object-flag (logclear (-> obj flags) (rigid-body-object-flag persistent alert in-pursuit))) diff --git a/goal_src/jak2/levels/city/common/vehicle-states.gc b/goal_src/jak2/levels/city/common/vehicle-states.gc index 51572f6b61..4485ccde6f 100644 --- a/goal_src/jak2/levels/city/common/vehicle-states.gc +++ b/goal_src/jak2/levels/city/common/vehicle-states.gc @@ -213,7 +213,7 @@ (when (and (cpad-pressed? 0 triangle) (not (logtest? (-> self info-override flags) 256)) (-> *setting-control* user-current pilot-exit) - (not (logtest? (-> *target* focus-status) (focus-status dead hit grabbed))) + (not (focus-test? *target* dead hit grabbed)) (!= (-> self crash-level) 3) ) (if (send-event *target* 'end-mode) diff --git a/goal_src/jak2/levels/city/common/vehicle-util.gc b/goal_src/jak2/levels/city/common/vehicle-util.gc index 90b6b35dc9..8cb0be5dad 100644 --- a/goal_src/jak2/levels/city/common/vehicle-util.gc +++ b/goal_src/jak2/levels/city/common/vehicle-util.gc @@ -220,11 +220,8 @@ This commonly includes things such as: (< -81920.0 (-> s5-0 floats 2)) (< (-> s5-0 floats 2) 20480.0) *target* - (not (logtest? (focus-status dead grabbed in-head under-water pole flut tube pilot dark) - (-> *target* focus-status) - ) - ) - (or (not (logtest? (-> *target* focus-status) (focus-status edge-grab))) + (not (focus-test? *target* dead grabbed in-head under-water pole flut tube pilot dark)) + (or (not (focus-test? *target* edge-grab)) (logtest? (-> obj flags) (rigid-body-object-flag player-edge-grabbing)) ) (-> *setting-control* user-current pilot) @@ -296,13 +293,13 @@ This commonly includes things such as: ) (when s2-0 (when (and (or (< -14336.0 (-> s5-0 floats 2)) (logtest? (-> obj flags) (rigid-body-object-flag player-edge-grabbing))) - (zero? (logand (rigid-body-object-flag no-hijack) (-> obj flags))) + (not (logtest? (rigid-body-object-flag no-hijack) (-> obj flags))) ) (set! s4-1 #t) (set! (-> s5-0 floats 3) (* (-> obj hit-points) (/ 40960.0 (sqrtf (-> s5-0 floats 1))))) ) (when (and (not s4-1) - (and (< (-> s5-0 floats 2) -8192.0) (zero? (logand (-> *target* focus-status) (focus-status edge-grab)))) + (and (< (-> s5-0 floats 2) -8192.0) (not (logtest? (-> *target* focus-status) (focus-status edge-grab)))) ) (matrix-4x4-inverse! (-> s5-0 matrices 2) (-> s5-0 matrices 1)) (vector-matrix*! (the-as vector (-> s5-0 matrices)) (-> s5-0 matrices 0 vector 1) (-> s5-0 matrices 2)) @@ -390,7 +387,7 @@ This commonly includes things such as: ) (cond ((and (logtest? (-> obj flags) (rigid-body-object-flag player-driving)) *target* (!= (-> obj crash-level) 3)) - (when (logtest? (-> *target* focus-status) (focus-status pilot-riding)) + (when (focus-test? *target* pilot-riding) (vehicle-controller-method-11 (-> obj controller)) (vehicle-method-138 obj) ) @@ -872,7 +869,7 @@ This commonly includes things such as: (defmethod vehicle-method-143 vehicle ((obj vehicle)) (let ((v1-2 (or (logtest? (-> obj flags) (rigid-body-object-flag dead waiting-for-player)) (and (logtest? (rigid-body-object-flag player-driving ai-driving) (-> obj flags)) - (zero? (logand (-> obj flags) (rigid-body-object-flag on-flight-level))) + (not (logtest? (-> obj flags) (rigid-body-object-flag on-flight-level))) ) ) ) @@ -1144,9 +1141,7 @@ This commonly includes things such as: ) (defmethod rigid-body-object-method-42 vehicle ((obj vehicle)) - (if (and (not (logtest? (-> obj focus-status) (focus-status inactive))) - (not (and (-> obj next-state) (= (-> obj next-state name) 'explode))) - ) + (if (and (not (focus-test? obj inactive)) (not (and (-> obj next-state) (= (-> obj next-state name) 'explode)))) ((method-of-type rigid-body-object rigid-body-object-method-42) obj) ) 0 @@ -1163,7 +1158,7 @@ This commonly includes things such as: ) (defmethod vehicle-method-114 vehicle ((obj vehicle)) - (if (logtest? (-> obj focus-status) (focus-status inactive)) + (if (focus-test? obj inactive) (vehicle-method-128 obj) ) (go (method-of-object obj active)) @@ -1404,7 +1399,7 @@ This commonly includes things such as: (defmethod vehicle-method-119 vehicle ((obj vehicle)) (dotimes (s5-0 (-> obj info-override seat-count)) (let ((s4-0 (handle->process (-> obj rider-array s5-0)))) - (when (and s4-0 (logtest? (-> (the-as vehicle-rider s4-0) focus-status) (focus-status pilot-riding))) + (when (and s4-0 (focus-test? (the-as vehicle-rider s4-0) pilot-riding)) (compute-seat-position obj (-> (the-as vehicle-rider s4-0) root-override trans) s5-0) (set! (-> (the-as vehicle-rider s4-0) root-override transv quad) (-> obj root-override-2 transv quad)) (let ((f0-1 (the float (-> obj info-override seat-array s5-0 angle)))) diff --git a/goal_src/jak2/levels/city/common/vehicle.gc b/goal_src/jak2/levels/city/common/vehicle.gc index 8df9a3c1f2..93303bb982 100644 --- a/goal_src/jak2/levels/city/common/vehicle.gc +++ b/goal_src/jak2/levels/city/common/vehicle.gc @@ -362,7 +362,7 @@ (defmethod vehicle-method-94 vehicle ((obj vehicle)) (cond ((or (logtest? (rigid-body-object-flag player-grabbed) (-> obj flags)) - (and *target* (logtest? (-> *target* focus-status) (focus-status dead grabbed))) + (and *target* (focus-test? *target* dead grabbed)) ) (let ((v1-7 (new 'stack-no-clear 'vector))) (set! (-> v1-7 x) 0.0) @@ -378,7 +378,7 @@ ) ) ((and (zero? (-> obj crash-level)) - (zero? (logand (rigid-body-object-flag ai-driving measure-control-parameters) (-> obj flags))) + (not (logtest? (rigid-body-object-flag ai-driving measure-control-parameters) (-> obj flags))) ) (when (and (cpad-pressed? 0 r2) (not *pause-lock*)) (if (zero? (-> obj flight-level-index)) @@ -412,7 +412,7 @@ (zero? (-> obj root-override-2 num-riders)) (or (not *target*) (or (< 32768.0 (vector-vector-distance (-> obj root-override-2 trans) (-> *target* control trans))) - (logtest? (focus-status teleporting) (-> *target* focus-status)) + (focus-test? *target* teleporting) ) ) ) @@ -839,7 +839,7 @@ (set! (-> v1-4 ignore-pat) (new 'static 'pat-surface :noentity #x1 :nopilot #x1)) (set! (-> v1-4 action-mask) (collide-action solid)) ) - (if (logtest? (-> obj focus-status) (focus-status dead)) + (if (focus-test? obj dead) (set! (-> s5-0 ignore-pat) (new 'static 'pat-surface :noentity #x1 :nopilot #x1 :probe #x1)) ) (if (logtest? (-> obj flags) (rigid-body-object-flag player-touching)) @@ -925,7 +925,7 @@ (let ((s5-0 (-> obj root-override-2))) (update-transforms s5-0) (when (and (logtest? (-> obj flags) (rigid-body-object-flag player-touching)) - (zero? (logand (-> obj flags) (rigid-body-object-flag player-driving))) + (not (logtest? (-> obj flags) (rigid-body-object-flag player-driving))) ) (pull-riders! s5-0) (cond @@ -962,7 +962,7 @@ ) ) (if (and (logtest? (-> obj flags) (rigid-body-object-flag dead)) - (zero? (logand (-> obj focus-status) (focus-status dead))) + (not (logtest? (-> obj focus-status) (focus-status dead))) ) (go (method-of-object obj crash)) ) @@ -1098,7 +1098,7 @@ cfg-3 :likely-delay (set! v1-4 #f) ) - (set! v1-4 (zero? (logand (-> obj flags) (rigid-body-object-flag persistent)))) + (set! v1-4 (not (logtest? (-> obj flags) (rigid-body-object-flag persistent)))) (label cfg-3) (b! (not v1-4) cfg-20 :delay (empty-form)) (let ((f0-3 (fmin (-> obj player-dist2) (-> obj camera-dist2)))) @@ -1655,7 +1655,7 @@ :likely-delay (set! v1-2 #t) ) (b! (not (logtest? (-> arg0 mask) (process-mask target))) cfg-5 :likely-delay (set! v1-2 #f)) - (set! v1-2 (logtest? (focus-status dangerous pilot) (-> arg0 focus-status))) + (set! v1-2 (focus-test? arg0 dangerous pilot)) (label cfg-5) (b! v1-2 cfg-32 :delay (nop!)) (let ((s5-0 (new 'stack-no-clear 'rigid-body-impact))) @@ -1830,7 +1830,7 @@ (when (and (!= (-> s3-1 id) (-> obj incoming-attack-id)) (not (logtest? (-> obj flags) (rigid-body-object-flag dead))) (or (not (logtest? (-> obj flags) (rigid-body-object-flag player-driving))) - (zero? (logand (penetrate jak-yellow-shot jak-red-shot jak-blue-shot jak-dark-shot) s2-1)) + (not (logtest? (penetrate jak-yellow-shot jak-red-shot jak-blue-shot jak-dark-shot) s2-1)) ) ) (set! (-> obj incoming-attack-id) (-> s3-1 id)) diff --git a/goal_src/jak2/levels/city/kid_escort/crocesc-states.gc b/goal_src/jak2/levels/city/kid_escort/crocesc-states.gc index beedc5a8bd..55158e8349 100644 --- a/goal_src/jak2/levels/city/kid_escort/crocesc-states.gc +++ b/goal_src/jak2/levels/city/kid_escort/crocesc-states.gc @@ -35,7 +35,7 @@ (if (and (-> self focus-info fproc) (>= (fabs (-> self focus-info ry-diff)) 9102.223)) (go-waiting-turn self) ) - (when (not (logtest? (-> self focus-status) (focus-status grabbed))) + (when (not (focus-test? self grabbed)) (cond ((logtest? (-> self bot-flags) (bot-flags bf15)) (go-virtual move-to-vehicle) @@ -192,9 +192,9 @@ ) :trans (behavior () (bot-method-223 self #f) - (when (not (logtest? (-> self focus-status) (focus-status grabbed))) + (when (not (focus-test? self grabbed)) (if (and (not (outside-spot-radius? self (the-as bot-spot #f) (the-as vector #f) #f)) - (zero? (logand (-> self bot-flags) (bot-flags bf15))) + (not (logtest? (-> self bot-flags) (bot-flags bf15))) ) (go-virtual traveling) ) @@ -611,7 +611,7 @@ :trans (behavior () (check-vehicle-exit self) 0.0 - (when (logtest? (-> self focus-status) (focus-status pilot-riding)) + (when (focus-test? self pilot-riding) (let ((s5-0 (handle->process (-> self vehicle-handle))) (gp-0 (new 'stack-no-clear 'vector)) ) @@ -699,7 +699,7 @@ ) :trans (behavior () (check-vehicle-exit self) - (when (logtest? (-> self focus-status) (focus-status pilot-riding)) + (when (focus-test? self pilot-riding) (let ((gp-0 (handle->process (-> self vehicle-handle)))) (quaternion-copy! (-> self root-override2 quat) (-> (the-as vehicle gp-0) root-override-2 quat)) (vector-matrix*! diff --git a/goal_src/jak2/levels/city/kid_escort/crocesc4-course.gc b/goal_src/jak2/levels/city/kid_escort/crocesc4-course.gc index d1c0bc6620..ee5aabb1b2 100644 --- a/goal_src/jak2/levels/city/kid_escort/crocesc4-course.gc +++ b/goal_src/jak2/levels/city/kid_escort/crocesc4-course.gc @@ -703,7 +703,7 @@ (set! (-> (the-as crocesct-wait-spot v1-1) check-done) (the-as (function crocesct-wait-spot crocadog-escort symbol) - (lambda ((arg0 object) (arg1 crocadog-escort)) (when (logtest? (focus-status pilot) (-> arg1 focus-status)) + (lambda ((arg0 object) (arg1 crocadog-escort)) (when (focus-test? arg1 pilot) (ai-task-control-method-12 (-> arg1 ai-ctrl) arg1) (go-to-waypoint! arg1 18 #f) (ai-task-control-method-10 (-> arg1 ai-ctrl) arg1) @@ -733,9 +733,7 @@ (the-as (function crocesct-wait-spot crocadog-escort symbol) (lambda ((arg0 object) (arg1 crocadog-escort)) - (when (and (not (logtest? (focus-status pilot) (-> arg1 focus-status))) - (zero? (logand (bot-flags bf17) (-> arg1 bot-flags))) - ) + (when (and (not (focus-test? arg1 pilot)) (not (logtest? (bot-flags bf17) (-> arg1 bot-flags)))) (ai-task-control-method-12 (-> arg1 ai-ctrl) arg1) (go-to-waypoint! arg1 19 #f) (ai-task-control-method-10 (-> arg1 ai-ctrl) arg1) diff --git a/goal_src/jak2/levels/city/kid_escort/hal4-course.gc b/goal_src/jak2/levels/city/kid_escort/hal4-course.gc index 27daf60178..dc3e9c77d5 100644 --- a/goal_src/jak2/levels/city/kid_escort/hal4-course.gc +++ b/goal_src/jak2/levels/city/kid_escort/hal4-course.gc @@ -126,7 +126,7 @@ ((>= (- (-> pp clock frame-counter) (-> obj arrestor-time)) (seconds 4)) (set! (-> obj arrestor-handle) (the-as handle #f)) ) - ((logtest? (-> (the-as process-focusable v1-3) focus-status) (focus-status hit)) + ((focus-test? (the-as process-focusable v1-3) hit) (when (and (>= (- (-> pp clock frame-counter) (-> obj played-defend-time)) (seconds 6)) (not (channel-active? obj (the-as uint 0))) ) @@ -169,7 +169,7 @@ (defmethod hal-escort-method-227 hal-escort ((obj hal-escort)) (with-pp (let ((s5-0 *target*)) - (when (logtest? (focus-status pilot-riding pilot) (-> s5-0 focus-status)) + (when (focus-test? s5-0 pilot-riding pilot) (let* ((a0-2 (-> obj actor-group 0 data 1 actor)) (v1-5 (when a0-2 (let ((s4-0 (-> a0-2 extra process))) @@ -180,7 +180,7 @@ ) ) ) - (when (logtest? (focus-status pilot-riding pilot) (-> (the-as process-focusable v1-5) focus-status)) + (when (focus-test? (the-as process-focusable v1-5) pilot-riding pilot) (let* ((v1-12 (-> obj actor-group 0 data 2 actor)) (a0-5 (when v1-12 (let ((s4-1 (-> v1-12 extra process))) @@ -191,7 +191,7 @@ ) ) ) - (when (not (logtest? (focus-status pilot-riding pilot) (-> (the-as process-focusable a0-5) focus-status))) + (when (not (focus-test? (the-as process-focusable a0-5) pilot-riding pilot)) (let ((f0-0 245760.0)) (and (< (* f0-0 f0-0) (vector-vector-xz-distance-squared (get-trans (the-as process-focusable a0-5) 0) (get-trans s5-0 0)) @@ -366,8 +366,8 @@ ((not (-> *setting-control* user-current pilot-exit)) (when (and s5-0 v1-8 - (not (logtest? (-> (the-as process-focusable s5-0) focus-status) (focus-status pilot-riding))) - (not (logtest? (-> (the-as process-focusable v1-8) focus-status) (focus-status pilot-riding))) + (not (focus-test? (the-as process-focusable s5-0) pilot-riding)) + (not (focus-test? (the-as process-focusable v1-8) pilot-riding)) (>= (- (-> pp clock frame-counter) (-> obj locked-player-time)) (seconds 10)) ) (remove-setting! 'pilot-exit) @@ -375,11 +375,11 @@ (apply-settings *setting-control*) ) ) - ((logtest? (-> target focus-status) (focus-status pilot-riding)) + ((focus-test? target pilot-riding) (when (and (nonzero? (-> target pilot)) (and (= (handle->process (-> target pilot vehicle)) (handle->process (-> obj vehicle-handle))) - (or (and s5-0 (logtest? (focus-status pilot) (-> (the-as process-focusable s5-0) focus-status))) - (and v1-8 (logtest? (focus-status pilot) (-> (the-as process-focusable v1-8) focus-status))) + (or (and s5-0 (focus-test? (the-as process-focusable s5-0) pilot)) + (and v1-8 (focus-test? (the-as process-focusable v1-8) pilot)) ) ) ) @@ -1263,14 +1263,14 @@ ) ) ) - (if (logtest? (focus-status pilot) (-> (the-as process-focusable s5-0) focus-status)) + (if (focus-test? (the-as process-focusable s5-0) pilot) (send-event s5-0 'request 'exit-vehicle s3-1 1) ) - (if (logtest? (focus-status pilot) (-> (the-as process-focusable s5-0) focus-status)) + (if (focus-test? (the-as process-focusable s5-0) pilot) (send-event s4-1 'request 'exit-vehicle s3-1 1) ) (if (and (not (speech-playing? arg1 7)) - (not (logtest? (-> (the-as process-focusable s4-1) focus-status) (focus-status pilot-riding))) + (not (focus-test? (the-as process-focusable s4-1) pilot-riding)) (not (logtest? (bot-flags bf17) (-> (the-as bot s4-1) bot-flags))) s3-1 (not (channel-active? arg1 (the-as uint 0))) @@ -1278,10 +1278,10 @@ (play-speech arg1 7) ) ) - (when (and (not (logtest? (focus-status pilot) (-> (the-as process-focusable s4-1) focus-status))) + (when (and (not (focus-test? (the-as process-focusable s4-1) pilot)) (not (logtest? (bot-flags bf17) (-> (the-as bot s4-1) bot-flags))) - (not (logtest? (focus-status pilot) (-> (the-as process-focusable s5-0) focus-status))) - (zero? (logand (bot-flags bf17) (-> (the-as bot s5-0) bot-flags))) + (not (focus-test? (the-as process-focusable s5-0) pilot)) + (not (logtest? (bot-flags bf17) (-> (the-as bot s5-0) bot-flags))) ) (send-event *target* 'end-mode) (ai-task-control-method-12 (-> arg1 ai-ctrl) arg1) @@ -1571,7 +1571,7 @@ ((and s5-0 (>= (-> s3-0 center w) (vector-vector-xz-distance s4-0 (-> s3-0 center))) (and (>= (- (-> s4-0 y) (-> s3-0 center y)) -10240.0) - (zero? (logand (-> s5-0 focus-status) (focus-status edge-grab))) + (not (logtest? (-> s5-0 focus-status) (focus-status edge-grab))) ) ) (when (not (logtest? (-> arg1 bot-task-bits) 1)) diff --git a/goal_src/jak2/levels/city/kid_escort/kidesc-states.gc b/goal_src/jak2/levels/city/kid_escort/kidesc-states.gc index a36b03f742..3cd2a4cdff 100644 --- a/goal_src/jak2/levels/city/kid_escort/kidesc-states.gc +++ b/goal_src/jak2/levels/city/kid_escort/kidesc-states.gc @@ -45,7 +45,7 @@ ) ) (label cfg-15) - (when (not (logtest? (-> self focus-status) (focus-status grabbed))) + (when (not (focus-test? self grabbed)) (cond ((logtest? (-> self bot-flags) (bot-flags bf15)) (go-virtual move-to-vehicle) @@ -109,14 +109,14 @@ ) :trans (behavior () (bot-method-223 self #f) - (when (not (logtest? (-> self focus-status) (focus-status grabbed))) + (when (not (focus-test? self grabbed)) (if (and (not (outside-spot-radius? self (the-as bot-spot #f) (the-as vector #f) #f)) (let ((gp-0 (handle->process (-> self arrestor-handle)))) (and (not (if (type? gp-0 process-focusable) gp-0 ) ) - (zero? (logand (-> self bot-flags) (bot-flags bf15))) + (not (logtest? (-> self bot-flags) (bot-flags bf15))) ) ) ) @@ -891,7 +891,7 @@ (if (and (-> self focus-info fproc) (>= (fabs (-> self focus-info ry-diff)) 9102.223)) (go-waiting-turn self) ) - (when (not (logtest? (-> self focus-status) (focus-status grabbed))) + (when (not (focus-test? self grabbed)) (let ((gp-0 (handle->process (-> self arrestor-handle)))) (if (not (if (type? gp-0 process-focusable) gp-0 diff --git a/goal_src/jak2/levels/city/kid_escort/kidesc4-course.gc b/goal_src/jak2/levels/city/kid_escort/kidesc4-course.gc index 20b997e9ac..8accc5f6ba 100644 --- a/goal_src/jak2/levels/city/kid_escort/kidesc4-course.gc +++ b/goal_src/jak2/levels/city/kid_escort/kidesc4-course.gc @@ -185,7 +185,7 @@ (set! (-> (the-as kidesct-wait-spot v1-1) check-done) (the-as (function kidesct-wait-spot kid-escort symbol) - (lambda ((arg0 object) (arg1 kid-escort)) (when (logtest? (focus-status pilot) (-> arg1 focus-status)) + (lambda ((arg0 object) (arg1 kid-escort)) (when (focus-test? arg1 pilot) (ai-task-control-method-12 (-> arg1 ai-ctrl) arg1) (go-to-waypoint! arg1 18 #f) (ai-task-control-method-10 (-> arg1 ai-ctrl) arg1) @@ -215,9 +215,7 @@ (the-as (function kidesct-wait-spot kid-escort symbol) (lambda ((arg0 object) (arg1 kid-escort)) - (when (and (not (logtest? (focus-status pilot) (-> arg1 focus-status))) - (zero? (logand (bot-flags bf17) (-> arg1 bot-flags))) - ) + (when (and (not (focus-test? arg1 pilot)) (not (logtest? (bot-flags bf17) (-> arg1 bot-flags)))) (ai-task-control-method-12 (-> arg1 ai-ctrl) arg1) (go-to-waypoint! arg1 19 #f) (ai-task-control-method-10 (-> arg1 ai-ctrl) arg1) diff --git a/goal_src/jak2/levels/city/market/west/brutter_kiosk/meet-brutter.gc b/goal_src/jak2/levels/city/market/west/brutter_kiosk/meet-brutter.gc index fe10891103..9179a30fef 100644 --- a/goal_src/jak2/levels/city/market/west/brutter_kiosk/meet-brutter.gc +++ b/goal_src/jak2/levels/city/market/west/brutter_kiosk/meet-brutter.gc @@ -2443,9 +2443,7 @@ (+! gp-0 1) (set! (-> self data-int32 a0-1) 3) ) - (if (and (logtest? (focus-status pilot) (-> (the-as city-lurker a1-3) focus-status)) - (!= (-> self data-int32 a0-1) -1) - ) + (if (and (focus-test? (the-as city-lurker a1-3) pilot) (!= (-> self data-int32 a0-1) -1)) (+! v1-2 1) ) ) @@ -2490,12 +2488,12 @@ ) (dotimes (gp-1 (-> self max-count)) (let ((s5-1 (handle->process (-> self slave (+ gp-1 (-> self max-count)))))) - (when (and s5-1 (zero? (logand (-> (the-as city-lurker s5-1) focus-status) (focus-status dead)))) + (when (and s5-1 (not (logtest? (-> (the-as city-lurker s5-1) focus-status) (focus-status dead)))) (cond ((or (not (-> (the-as paddywagon s5-1) current-level)) (= (level-status *level* (-> (the-as paddywagon s5-1) current-level)) 'active) ) - (when (logtest? (-> (the-as paddywagon s5-1) focus-status) (focus-status inactive)) + (when (focus-test? (the-as paddywagon s5-1) inactive) (let ((s4-0 (new 'stack 'traffic-object-spawn-params))) (set! (-> s4-0 object-type) (traffic-type tt17)) (set! (-> s4-0 behavior) (the-as uint 2)) @@ -2529,7 +2527,7 @@ ) ) (else - (if (not (logtest? (-> (the-as paddywagon s5-1) focus-status) (focus-status inactive))) + (if (not (focus-test? (the-as paddywagon s5-1) inactive)) (send-event (the-as paddywagon s5-1) 'traffic-off-force) ) ) @@ -2548,7 +2546,7 @@ (cond ((= (-> self data-int32 s5-2) -1) (when s4-2 - (when (logtest? (-> (the-as city-lurker s4-2) focus-status) (focus-status inactive)) + (when (focus-test? (the-as city-lurker s4-2) inactive) (let ((s3-1 (new 'stack 'traffic-object-spawn-params))) (set! (-> s3-1 object-type) (traffic-type tt5)) (set! (-> s3-1 behavior) (the-as uint 6)) @@ -2585,13 +2583,11 @@ ) ) (let ((a0-73 *target*)) - (when (and a0-73 (logtest? (focus-status pilot) (-> a0-73 focus-status))) + (when (and a0-73 (focus-test? a0-73 pilot)) (let ((s3-3 (handle->process (-> a0-73 pilot vehicle)))) (when s3-3 (cond - ((and (logtest? (focus-status pilot) (-> (the-as city-lurker s4-2) focus-status)) - (handle->process (-> (the-as city-lurker s4-2) vehicle)) - ) + ((and (focus-test? (the-as city-lurker s4-2) pilot) (handle->process (-> (the-as city-lurker s4-2) vehicle))) (+! (-> self data-int32 s5-2) 1) ) (else @@ -2631,14 +2627,14 @@ ) ((= (-> self data-int32 s5-2) 1) (when (the-as city-lurker s4-2) - (if (or (not *target*) (zero? (logand (focus-status pilot) (-> *target* focus-status)))) + (if (or (not *target*) (not (logtest? (focus-status pilot) (-> *target* focus-status)))) (send-event (the-as city-lurker s4-2) 'exit-vehicle (-> (the-as city-lurker s4-2) root-override2 trans)) ) (let ((s3-4 (-> self data-vector 3)) (s2-1 (handle->process (-> *target* pilot vehicle))) ) (cond - ((logtest? (focus-status pilot) (-> (the-as city-lurker s4-2) focus-status)) + ((focus-test? (the-as city-lurker s4-2) pilot) (when (and s2-1 (let ((f0-4 (vector-vector-distance-squared s3-4 (-> (the-as vehicle s2-1) root-override-2 trans))) (f1-6 114688.0) @@ -3006,9 +3002,7 @@ (+! gp-0 1) (set! (-> self data-int32 a1-0) 3) ) - (when (and (logtest? (focus-status pilot) (-> (the-as city-lurker a2-3) focus-status)) - (!= (-> self data-int32 a1-0) -1) - ) + (when (and (focus-test? (the-as city-lurker a2-3) pilot) (!= (-> self data-int32 a1-0) -1)) (set! v1-2 a1-0) (+! a0-1 1) ) @@ -3067,12 +3061,12 @@ ) (dotimes (gp-1 (-> self max-count)) (let ((s5-2 (handle->process (-> self slave (+ gp-1 (-> self max-count)))))) - (when (and s5-2 (zero? (logand (-> (the-as paddywagon s5-2) focus-status) (focus-status dead)))) + (when (and s5-2 (not (logtest? (-> (the-as paddywagon s5-2) focus-status) (focus-status dead)))) (cond ((or (not (-> (the-as paddywagon s5-2) current-level)) (= (level-status *level* (-> (the-as paddywagon s5-2) current-level)) 'active) ) - (when (logtest? (-> (the-as paddywagon s5-2) focus-status) (focus-status inactive)) + (when (focus-test? (the-as paddywagon s5-2) inactive) (let ((s4-0 (new 'stack 'traffic-object-spawn-params))) (set! (-> s4-0 object-type) (traffic-type tt17)) (set! (-> s4-0 behavior) (the-as uint 2)) @@ -3106,7 +3100,7 @@ ) ) (else - (if (not (logtest? (-> (the-as paddywagon s5-2) focus-status) (focus-status inactive))) + (if (not (focus-test? (the-as paddywagon s5-2) inactive)) (send-event (the-as paddywagon s5-2) 'traffic-off-force) ) ) @@ -3125,7 +3119,7 @@ (cond ((= (-> self data-int32 s5-3) -1) (when s4-2 - (when (logtest? (-> (the-as city-lurker s4-2) focus-status) (focus-status inactive)) + (when (focus-test? (the-as city-lurker s4-2) inactive) (let ((s3-1 (new 'stack 'traffic-object-spawn-params))) (set! (-> s3-1 object-type) (traffic-type tt5)) (set! (-> s3-1 behavior) (the-as uint 6)) @@ -3162,13 +3156,11 @@ ) ) (let ((a0-95 *target*)) - (when (and a0-95 (logtest? (focus-status pilot) (-> a0-95 focus-status))) + (when (and a0-95 (focus-test? a0-95 pilot)) (let ((s3-3 (handle->process (-> a0-95 pilot vehicle)))) (when s3-3 (cond - ((and (logtest? (focus-status pilot) (-> (the-as city-lurker s4-2) focus-status)) - (handle->process (-> (the-as city-lurker s4-2) vehicle)) - ) + ((and (focus-test? (the-as city-lurker s4-2) pilot) (handle->process (-> (the-as city-lurker s4-2) vehicle))) (+! (-> self data-int32 s5-3) 1) ) (else @@ -3228,14 +3220,14 @@ ) ) ) - (if (or (not *target*) (zero? (logand (focus-status pilot) (-> *target* focus-status)))) + (if (or (not *target*) (not (logtest? (focus-status pilot) (-> *target* focus-status)))) (send-event (the-as city-lurker s4-2) 'exit-vehicle (-> (the-as city-lurker s4-2) root-override2 trans)) ) (let ((s3-5 (-> (the-as city-lurker s4-2) end-pos)) (s2-2 (handle->process (-> *target* pilot vehicle))) ) (cond - ((logtest? (focus-status pilot) (-> (the-as city-lurker s4-2) focus-status)) + ((focus-test? (the-as city-lurker s4-2) pilot) (when (and s2-2 (let ((f0-5 (vector-vector-distance-squared s3-5 (-> (the-as vehicle s2-2) root-override-2 trans))) (f1-6 114688.0) diff --git a/goal_src/jak2/levels/city/misc/collection_task/collection-task.gc b/goal_src/jak2/levels/city/misc/collection_task/collection-task.gc index f4fe866d64..e3a8b7dfdd 100644 --- a/goal_src/jak2/levels/city/misc/collection_task/collection-task.gc +++ b/goal_src/jak2/levels/city/misc/collection_task/collection-task.gc @@ -109,7 +109,7 @@ (when target (set! (-> vec quad) (-> target control trans quad)) (set! (-> vec w) 4096.0) - (when (logtest? (focus-status pilot) (-> target focus-status)) + (when (focus-test? target pilot) (let ((vehicle (handle->process (-> target pilot vehicle)))) (set! (-> vec quad) (-> (the-as vehicle vehicle) root-override-2 root-prim prim-core world-sphere quad)) ) @@ -343,7 +343,7 @@ (lambda :behavior task-manager () (local-vars (moved-beyond-start? symbol)) - (until (or moved-beyond-start? (and *target* (logtest? (focus-status pilot) (-> *target* focus-status)))) + (until (or moved-beyond-start? (and *target* (focus-test? *target* pilot))) (suspend) (let ((min-start-distance 122880.0)) (set! moved-beyond-start? diff --git a/goal_src/jak2/levels/city/misc/delivery/delivery-task.gc b/goal_src/jak2/levels/city/misc/delivery/delivery-task.gc index bb30aa1482..6e891fae2e 100644 --- a/goal_src/jak2/levels/city/misc/delivery/delivery-task.gc +++ b/goal_src/jak2/levels/city/misc/delivery/delivery-task.gc @@ -60,7 +60,7 @@ (let ((gp-0 (handle->process (-> self attach-object)))) (cond (gp-0 - (when (logtest? (-> (the-as process-focusable gp-0) focus-status) (focus-status dead)) + (when (focus-test? (the-as process-focusable gp-0) dead) (seek! (-> self scale) 0.0 (* 0.5 (-> self clock seconds-per-frame))) (if (= (-> self scale) 0.0) (go-virtual die) @@ -359,7 +359,7 @@ This commonly includes things such as: (init-vf0-vector) (let ((gp-0 (handle->process (-> self slave 0)))) (cond - ((and gp-0 (zero? (logand (-> (the-as process-focusable gp-0) focus-status) (focus-status dead)))) + ((and gp-0 (not (logtest? (-> (the-as process-focusable gp-0) focus-status) (focus-status dead)))) (cond ((zero? (-> self data-int8 0)) (when (= (level-status *level* 'ctyindb) 'active) @@ -392,7 +392,7 @@ This commonly includes things such as: (f1-0 12288.0) ) (cond - ((and (< f0-0 (* f1-0 f1-0)) *target* (logtest? (focus-status pilot) (-> *target* focus-status))) + ((and (< f0-0 (* f1-0 f1-0)) *target* (focus-test? *target* pilot)) (when (nonzero? (-> self sub-state)) (send-event (handle->process (-> self arrow)) 'set-position (-> self end-pos)) (send-event (handle->process (-> self arrow)) 'modify-flags 1 0) @@ -529,7 +529,7 @@ This commonly includes things such as: () (send-event *traffic-manager* 'decrease-alert-level 0) (send-event *traffic-manager* 'set-alert-duration 9000) - (if (and *target* (logtest? (focus-status pilot) (-> *target* focus-status))) + (if (and *target* (focus-test? *target* pilot)) (send-event *target* 'change-mode 'normal) ) (set-setting! 'pilot #f 0 0) diff --git a/goal_src/jak2/levels/city/onin_tent/onin-game.gc b/goal_src/jak2/levels/city/onin_tent/onin-game.gc index 5ee05f616e..ec1bdb600e 100644 --- a/goal_src/jak2/levels/city/onin_tent/onin-game.gc +++ b/goal_src/jak2/levels/city/onin_tent/onin-game.gc @@ -2495,7 +2495,7 @@ (send-event (handle->process (-> self hud-miss)) 'hide-and-die) (send-event (handle->process (-> self hud-goal)) 'hide-and-die) (remove-setting! 'entity-name) - (if (and *target* (logtest? (-> *target* focus-status) (focus-status grabbed))) + (if (and *target* (focus-test? *target* grabbed)) (process-release? *target*) ) (remove-setting! 'airlock) diff --git a/goal_src/jak2/levels/city/oracle/oracle-training.gc b/goal_src/jak2/levels/city/oracle/oracle-training.gc index 514b216231..5855e3402b 100644 --- a/goal_src/jak2/levels/city/oracle/oracle-training.gc +++ b/goal_src/jak2/levels/city/oracle/oracle-training.gc @@ -80,7 +80,7 @@ (function object) (lambda :behavior task-manager () - (if (and *target* (zero? (logand (focus-status dark) (-> *target* focus-status)))) + (if (and *target* (not (logtest? (focus-status dark) (-> *target* focus-status)))) (send-event *target* 'change-mode 'darkjak #f 65) ) (when (= (get-status *gui-control* (-> self sound-id 0)) (gui-status active)) @@ -190,7 +190,7 @@ (function object) (lambda :behavior task-manager () - (if (and *target* (zero? (logand (focus-status dark) (-> *target* focus-status)))) + (if (and *target* (not (logtest? (focus-status dark) (-> *target* focus-status)))) (send-event *target* 'change-mode 'darkjak #f 65) ) (when (= (get-status *gui-control* (-> self sound-id 0)) (gui-status active)) @@ -280,7 +280,7 @@ (function object) (lambda :behavior task-manager () - (if (and *target* (zero? (logand (focus-status dark) (-> *target* focus-status)))) + (if (and *target* (not (logtest? (focus-status dark) (-> *target* focus-status)))) (send-event *target* 'change-mode 'darkjak #f 65) ) (when (= (get-status *gui-control* (-> self sound-id 0)) (gui-status active)) @@ -391,7 +391,7 @@ (function object) (lambda :behavior task-manager () - (if (and *target* (zero? (logand (focus-status dark) (-> *target* focus-status)))) + (if (and *target* (not (logtest? (focus-status dark) (-> *target* focus-status)))) (send-event *target* 'change-mode 'darkjak #f 65) ) (when (= (get-status *gui-control* (-> self sound-id 0)) (gui-status active)) diff --git a/goal_src/jak2/levels/city/port/race/errol-chal.gc b/goal_src/jak2/levels/city/port/race/errol-chal.gc index c4c71d086a..304d9f7ff4 100644 --- a/goal_src/jak2/levels/city/port/race/errol-chal.gc +++ b/goal_src/jak2/levels/city/port/race/errol-chal.gc @@ -542,7 +542,7 @@ (if (or (< (* f0-0 f0-0) (-> obj player-dist2)) (let ((f0-3 102400.0)) (and (< (* f0-3 f0-3) (-> obj player-dist2)) - (zero? (logand (-> obj draw status) (draw-control-status on-screen))) + (not (logtest? (-> obj draw status) (draw-control-status on-screen))) ) ) ) @@ -822,7 +822,7 @@ (>= (- (-> self clock frame-counter) (-> self touch-time)) (seconds 3)) (or (not *target*) (or (< 204800.0 (vector-vector-distance (-> self root-override trans) (-> *target* control trans))) - (logtest? (focus-status teleporting) (-> *target* focus-status)) + (focus-test? *target* teleporting) ) ) (not (-> self persistent)) diff --git a/goal_src/jak2/levels/city/side_missions/ctywide-bbush.gc b/goal_src/jak2/levels/city/side_missions/ctywide-bbush.gc index 4d8872bacf..f4df499237 100644 --- a/goal_src/jak2/levels/city/side_missions/ctywide-bbush.gc +++ b/goal_src/jak2/levels/city/side_missions/ctywide-bbush.gc @@ -418,7 +418,7 @@ (when v1-17 (set! (-> gp-1 quad) (-> v1-17 control trans quad)) (set! (-> gp-1 w) 4096.0) - (when (logtest? (focus-status pilot) (-> v1-17 focus-status)) + (when (focus-test? v1-17 pilot) (let ((a1-8 (handle->process (-> v1-17 pilot vehicle)))) (set! (-> gp-1 quad) (-> (the-as process-focusable a1-8) root-override root-prim prim-core world-sphere quad)) ) @@ -2869,7 +2869,7 @@ This commonly includes things such as: 5 (the-as (function object) (lambda :behavior task-manager () - (if (and *target* (logtest? (-> *target* focus-status) (focus-status grabbed))) + (if (and *target* (focus-test? *target* grabbed)) (process-release? *target*) ) (none) diff --git a/goal_src/jak2/levels/city/slums/kor/kid-states.gc b/goal_src/jak2/levels/city/slums/kor/kid-states.gc index 896c92e00b..2b248216e5 100644 --- a/goal_src/jak2/levels/city/slums/kor/kid-states.gc +++ b/goal_src/jak2/levels/city/slums/kor/kid-states.gc @@ -47,7 +47,7 @@ ) ) (label cfg-15) - (when (not (logtest? (-> self focus-status) (focus-status grabbed))) + (when (not (focus-test? self grabbed)) (if (not (outside-spot-radius? self (the-as bot-spot #f) (the-as vector #f) #f)) (go-virtual traveling) ) @@ -106,7 +106,7 @@ ) :trans (behavior () (bot-method-223 self #f) - (when (not (logtest? (-> self focus-status) (focus-status grabbed))) + (when (not (focus-test? self grabbed)) (if (and (not (outside-spot-radius? self (the-as bot-spot #f) (the-as vector #f) #f)) (let ((gp-0 (handle->process (-> self arrestor-handle)))) (not (if (type? gp-0 process-focusable) @@ -236,7 +236,7 @@ :exit (-> (method-of-type kid waiting-idle) exit) :trans (behavior () (bot-method-223 self #f) - (when (not (logtest? (-> self focus-status) (focus-status grabbed))) + (when (not (focus-test? self grabbed)) (if (not (outside-spot-radius? self (the-as bot-spot #f) (the-as vector #f) #f)) (go-virtual traveling) ) @@ -285,7 +285,7 @@ ) ) (label cfg-15) - (when (not (logtest? (-> self focus-status) (focus-status grabbed))) + (when (not (focus-test? self grabbed)) (if (not (outside-spot-radius? self (the-as bot-spot #f) (the-as vector #f) #f)) (go-virtual traveling) ) @@ -564,7 +564,7 @@ (if (and (-> self focus-info fproc) (>= (fabs (-> self focus-info ry-diff)) 9102.223)) (kid-method-233 self) ) - (when (not (logtest? (-> self focus-status) (focus-status grabbed))) + (when (not (focus-test? self grabbed)) (let ((gp-0 (handle->process (-> self arrestor-handle)))) (if (not (if (type? gp-0 process-focusable) gp-0 diff --git a/goal_src/jak2/levels/city/slums/kor/kid.gc b/goal_src/jak2/levels/city/slums/kor/kid.gc index 2dc823bcc2..fee1986001 100644 --- a/goal_src/jak2/levels/city/slums/kor/kid.gc +++ b/goal_src/jak2/levels/city/slums/kor/kid.gc @@ -269,7 +269,7 @@ ) (when s4-1 (when (or (>= (- (-> pp clock frame-counter) (-> obj arrest-attempt-time)) (seconds 0.5)) - (logtest? (-> (the-as process-focusable s4-1) focus-status) (focus-status dead hit)) + (focus-test? (the-as process-focusable s4-1) dead hit) ) (set! s4-1 (the-as process #f)) (set! (-> obj arrestor-handle) (the-as handle #f)) @@ -360,7 +360,7 @@ ) ) ) - (zero? (logand (bot-flags bf20) (-> obj bot-flags))) + (not (logtest? (bot-flags bf20) (-> obj bot-flags))) ) ) ) @@ -612,7 +612,7 @@ ((and (-> obj next-state) (= (-> obj next-state name) 'arrested)) (set-vector! arg0 49152.0 12288.0 49152.0 1.0) (vector<-cspace+vector! arg0 (-> obj node-list data 2) arg0) - (if (logtest? (-> obj focus-status) (focus-status under-water)) + (if (focus-test? obj under-water) (set! (-> arg0 y) (+ (get-water-height obj) (-> *setting-control* cam-current target-height))) ) ) diff --git a/goal_src/jak2/levels/city/slums/kor/kor-states.gc b/goal_src/jak2/levels/city/slums/kor/kor-states.gc index 7927334fff..b010c06b54 100644 --- a/goal_src/jak2/levels/city/slums/kor/kor-states.gc +++ b/goal_src/jak2/levels/city/slums/kor/kor-states.gc @@ -45,7 +45,7 @@ ) ) (label cfg-15) - (when (not (logtest? (-> self focus-status) (focus-status grabbed))) + (when (not (focus-test? self grabbed)) (if (not (outside-spot-radius? self (the-as bot-spot #f) (the-as vector #f) #f)) (go-virtual traveling) ) @@ -105,7 +105,7 @@ ) :trans (behavior () (bot-method-223 self #f) - (when (not (logtest? (-> self focus-status) (focus-status grabbed))) + (when (not (focus-test? self grabbed)) (if (and (not (outside-spot-radius? self (the-as bot-spot #f) (the-as vector #f) #f)) (let ((gp-0 (handle->process (-> self arrestor-handle)))) (not (if (type? gp-0 process-focusable) @@ -245,7 +245,7 @@ :exit (-> (method-of-type kor waiting-idle) exit) :trans (behavior () (bot-method-223 self #f) - (when (not (logtest? (-> self focus-status) (focus-status grabbed))) + (when (not (focus-test? self grabbed)) (if (not (outside-spot-radius? self (the-as bot-spot #f) (the-as vector #f) #f)) (go-virtual traveling) ) @@ -294,7 +294,7 @@ ) ) (label cfg-15) - (when (not (logtest? (-> self focus-status) (focus-status grabbed))) + (when (not (focus-test? self grabbed)) (if (not (outside-spot-radius? self (the-as bot-spot #f) (the-as vector #f) #f)) (go-virtual traveling) ) @@ -573,7 +573,7 @@ (if (and (-> self focus-info fproc) (>= (fabs (-> self focus-info ry-diff)) 9102.223)) (kor-method-233 self) ) - (when (not (logtest? (-> self focus-status) (focus-status grabbed))) + (when (not (focus-test? self grabbed)) (let ((gp-0 (handle->process (-> self arrestor-handle)))) (if (not (if (type? gp-0 process-focusable) gp-0 diff --git a/goal_src/jak2/levels/city/slums/kor/kor.gc b/goal_src/jak2/levels/city/slums/kor/kor.gc index be29d3f62b..ce94f71df3 100644 --- a/goal_src/jak2/levels/city/slums/kor/kor.gc +++ b/goal_src/jak2/levels/city/slums/kor/kor.gc @@ -273,7 +273,7 @@ ) (when s4-1 (when (or (>= (- (-> pp clock frame-counter) (-> obj arrest-attempt-time)) (seconds 0.5)) - (logtest? (-> (the-as process-focusable s4-1) focus-status) (focus-status dead hit)) + (focus-test? (the-as process-focusable s4-1) dead hit) ) (set! s4-1 (the-as process #f)) (set! (-> obj arrestor-handle) (the-as handle #f)) @@ -364,7 +364,7 @@ ) ) ) - (zero? (logand (bot-flags bf20) (-> obj bot-flags))) + (not (logtest? (bot-flags bf20) (-> obj bot-flags))) ) ) ) @@ -613,7 +613,7 @@ ((and (-> obj next-state) (= (-> obj next-state name) 'arrested)) (set-vector! arg0 49152.0 12288.0 49152.0 1.0) (vector<-cspace+vector! arg0 (-> obj node-list data 2) arg0) - (if (logtest? (-> obj focus-status) (focus-status under-water)) + (if (focus-test? obj under-water) (set! (-> arg0 y) (+ (get-water-height obj) (-> *setting-control* cam-current target-height))) ) ) diff --git a/goal_src/jak2/levels/common/ai/bot.gc b/goal_src/jak2/levels/common/ai/bot.gc index 13b651fa8b..33a76dc674 100644 --- a/goal_src/jak2/levels/common/ai/bot.gc +++ b/goal_src/jak2/levels/common/ai/bot.gc @@ -153,7 +153,7 @@ ) ) ) - ((and (logtest? #x10000 v1-0) (zero? (logand #x20000 v1-0))) + ((and (logtest? #x10000 v1-0) (not (logtest? #x20000 v1-0))) (set! gp-0 #t) ) ) @@ -361,7 +361,7 @@ (set! v0-0 (-> obj hit-points)) ) (else - (if (and (logtest? (-> obj bot-flags) (bot-flags bf04)) (zero? (logand (-> obj bot-flags) (bot-flags attacked)))) + (if (and (logtest? (-> obj bot-flags) (bot-flags bf04)) (not (logtest? (-> obj bot-flags) (bot-flags attacked)))) (set! v0-0 0) ) ) @@ -411,7 +411,7 @@ "Were we attacked by the player?" (the-as symbol - (and (and fproc (zero? (logand (-> fproc focus-status) (focus-status disable dead ignore grabbed)))) + (and (and fproc (not (logtest? (-> fproc focus-status) (focus-status disable dead ignore grabbed)))) (or (logtest? (process-mask enemy) (-> fproc mask)) (and (logtest? (-> fproc mask) (process-mask target)) (logtest? (-> obj bot-flags) (bot-flags attacked))) ) @@ -679,7 +679,7 @@ ) (if (and enemy enemy - (zero? (logand (-> (the-as process-focusable enemy) focus-status) (focus-status disable dead))) + (not (logtest? (-> (the-as process-focusable enemy) focus-status) (focus-status disable dead))) ) (set-next-focus! obj (the-as enemy enemy) focus) ) @@ -709,10 +709,7 @@ ) (defmethod alive? bot ((obj bot)) - (and (not (logtest? (-> obj focus-status) (focus-status dead grabbed))) - (nonzero? (-> obj hit-points)) - (zero? (-> obj fated-time)) - ) + (and (not (focus-test? obj dead grabbed)) (nonzero? (-> obj hit-points)) (zero? (-> obj fated-time))) ) ;; WARN: Return type mismatch none vs object. @@ -801,7 +798,7 @@ ((>= (the-as int a0-19) 0) (let ((v1-29 (the-as object (-> arg3 param 1)))) (cond - ((logtest? (focus-status pilot) (-> obj focus-status)) + ((focus-test? obj pilot) (if (= (-> obj vehicle-seat-index) a0-19) (= (the-as uint v1-29) (handle->process (-> obj vehicle-handle))) ) @@ -816,7 +813,7 @@ ) ) (else - (when (not (logtest? (focus-status pilot) (-> obj focus-status))) + (when (not (focus-test? obj pilot)) (set! (-> obj vehicle-seat-index) -1) (set! (-> obj vehicle-handle) (the-as handle #f)) (logclear! (-> obj bot-flags) (bot-flags bf15)) @@ -827,7 +824,7 @@ ) ) (('exit-vehicle) - (when (logtest? (focus-status pilot) (-> obj focus-status)) + (when (focus-test? obj pilot) (let ((v1-43 (-> arg3 param 1)) (s5-1 (-> arg3 param 2)) ) @@ -908,7 +905,7 @@ ) ) ((= v1-0 'end-mode) - (when (logtest? (-> obj focus-status) (focus-status grabbed)) + (when (focus-test? obj grabbed) (logclear! (-> obj focus-status) (focus-status grabbed)) #t ) @@ -949,7 +946,7 @@ (defmethod enemy-method-104 bot ((obj bot) (arg0 process) (arg1 uint) (arg2 uint)) (cond - ((and (= (-> arg0 type) target) (zero? (logand (-> obj bot-flags) (bot-flags attacked)))) + ((and (= (-> arg0 type) target) (not (logtest? (-> obj bot-flags) (bot-flags attacked)))) (let ((a1-1 (new 'stack-no-clear 'event-message-block))) (set! (-> a1-1 from) (process->ppointer self)) (set! (-> a1-1 num-params) 2) @@ -1016,10 +1013,10 @@ ) ) (cond - ((and (logtest? (-> obj focus-status) (focus-status dangerous)) + ((and (focus-test? obj dangerous) (logtest? (process-mask enemy) (-> arg0 mask)) (and v1-6 - (zero? (logand (-> (the-as process-focusable v1-6) focus-status) (focus-status disable dead ignore grabbed))) + (not (logtest? (-> (the-as process-focusable v1-6) focus-status) (focus-status disable dead ignore grabbed))) ) ((method-of-type touching-shapes-entry prims-touching-action?) (the-as touching-shapes-entry s3-0) @@ -1099,7 +1096,7 @@ If the player is too far, play a warning speech." ((> too-far-check 0) (set! (-> obj delay-too-far-check) (+ too-far-check -1)) ) - ((and (zero? too-far-check) *target* (zero? (logand (-> obj focus-status) (focus-status grabbed)))) + ((and (zero? too-far-check) *target* (not (logtest? (-> obj focus-status) (focus-status grabbed)))) (let ((check-too-far-func (the-as object (-> obj waypoint check-too-far)))) (if (not (the-as symbol check-too-far-func)) (set! check-too-far-func (-> obj course default-check-too-far)) @@ -1205,7 +1202,7 @@ If the player is too far, play a warning speech." ) ) ) - (if (and (bot-check-too-far obj) (zero? (logand (-> obj bot-flags) (bot-flags bf09)))) + (if (and (bot-check-too-far obj) (not (logtest? (-> obj bot-flags) (bot-flags bf09)))) (go (method-of-object obj failed)) ) (if (not (logtest? (-> obj bot-flags) (bot-flags bf09))) @@ -1361,7 +1358,7 @@ If the player is too far, play a warning speech." (countdown (s4-0 (-> v1-0 course speech-count)) (let ((s3-0 (-> s5-0 s4-0))) (if (string= (-> s3-0 name) (-> arg0 name)) - (return (zero? (logand (-> s3-0 flags) (speech-flags sf01)))) + (return (not (logtest? (-> s3-0 flags) (speech-flags sf01)))) ) ) ) @@ -1537,7 +1534,7 @@ If the player is too far, play a warning speech." (and fproc (= (-> obj focus aware) (enemy-aware enemy-aware-3)) (attacked-by-player? obj (the-as process-focusable fproc)) - (zero? (logand (-> obj focus-status) (focus-status grabbed))) + (not (logtest? (-> obj focus-status) (focus-status grabbed))) ) ) ) @@ -1866,7 +1863,7 @@ If the player is too far, play a warning speech." (vector<-cspace+vector! arg0 (-> obj node-list data 2) arg0) (the-as meters - (if (logtest? (-> obj focus-status) (focus-status under-water)) + (if (focus-test? obj under-water) (set! (-> arg0 y) (+ (get-water-height obj) (-> *setting-control* cam-current target-height))) ) ) @@ -1913,7 +1910,7 @@ If the player is too far, play a warning speech." ) ) ) - (if (logtest? (-> obj focus-status) (focus-status ignore)) + (if (focus-test? obj ignore) (set! v1-0 (cond ((>= (- (-> pp clock frame-counter) a1-0) (the-as time-frame (-> obj hit-invuln-ignore-me-delay))) @@ -1926,7 +1923,7 @@ If the player is too far, play a warning speech." ) ) ) - (if (logtest? (-> obj focus-status) (focus-status disable)) + (if (focus-test? obj disable) (set! v1-0 (cond ((>= (- (-> pp clock frame-counter) a1-0) (the-as time-frame (-> obj hit-invuln-focus-disable-delay))) diff --git a/goal_src/jak2/levels/common/airlock.gc b/goal_src/jak2/levels/common/airlock.gc index 30f05f97d4..c063871513 100644 --- a/goal_src/jak2/levels/common/airlock.gc +++ b/goal_src/jak2/levels/common/airlock.gc @@ -188,9 +188,7 @@ (set! (-> obj were-behind?) #t) ) (and (< (-> obj latch-closed-time) (-> self clock frame-counter)) - (or (not (and *target* (logtest? (focus-status pilot teleporting) (-> *target* focus-status)))) - (< f30-0 -409.6) - ) + (or (not (and *target* (focus-test? *target* pilot teleporting))) (< f30-0 -409.6)) (or (and (< f30-0 (-> obj open-distance)) (or (not (-> obj were-behind?)) (< f30-0 20480.0)) (and (or (< 409.6 f30-0) @@ -207,7 +205,7 @@ ) s5-0 (let ((f0-8 (check-crossing-distance obj (camera-pos) #f))) - (and (or (not *target*) (zero? (logand (-> *target* focus-status) (focus-status in-head)))) + (and (or (not *target*) (not (logtest? (-> *target* focus-status) (focus-status in-head)))) (or (< (* f30-0 f0-8) 0.0) (and (< (fabs f0-8) 4096.0) (< (vector-vector-xz-distance (camera-pos) (-> obj root-override trans)) (-> obj door-radius)) diff --git a/goal_src/jak2/levels/common/battle.gc b/goal_src/jak2/levels/common/battle.gc index 6b2bc82e5a..bc714eb9d4 100644 --- a/goal_src/jak2/levels/common/battle.gc +++ b/goal_src/jak2/levels/common/battle.gc @@ -1184,7 +1184,7 @@ ) (defmethod battle-method-51 battle ((obj battle) (arg0 battle-spawner) (arg1 symbol)) - (when (and (logtest? (-> obj flags) 2) (zero? (logand (-> obj flags) 4))) + (when (and (logtest? (-> obj flags) 2) (not (logtest? (-> obj flags) 4))) (let ((v1-5 (-> arg0 noticed-attack-time))) (cond ((zero? v1-5) @@ -1364,7 +1364,7 @@ (if (and (logtest? v1-1 2) (not (and *target* (and (>= (-> self info notice-distance) (vector-vector-distance (-> self root trans) (-> *target* control trans))) - (zero? (logand (focus-status teleporting) (-> *target* focus-status))) + (not (logtest? (focus-status teleporting) (-> *target* focus-status))) ) ) ) @@ -1562,7 +1562,7 @@ ;; WARN: Return type mismatch uint vs none. (defmethod battle-method-47 battle ((obj battle)) (let ((a3-0 (-> obj info play-battle-music))) - (when (and a3-0 (zero? (logand (-> obj flags) 16))) + (when (and a3-0 (not (logtest? (-> obj flags) 16))) (case a3-0 (('sound-mode) (set-setting! 'sound-mode #f 0 1) diff --git a/goal_src/jak2/levels/common/elec-gate.gc b/goal_src/jak2/levels/common/elec-gate.gc index 0a6038de9e..03de865dbd 100644 --- a/goal_src/jak2/levels/common/elec-gate.gc +++ b/goal_src/jak2/levels/common/elec-gate.gc @@ -391,7 +391,7 @@ (set! (-> attack vector quad) (-> s4-0 dir quad)) (set! (-> attack shove-back) 24576.0) (set! (-> attack shove-up) 12288.0) - (set! (-> attack control) (if (logtest? (focus-status board) (-> proc-focus focus-status)) + (set! (-> attack control) (if (focus-test? proc-focus board) 1.0 0.0 ) diff --git a/goal_src/jak2/levels/common/enemy/amphibian/amphibian.gc b/goal_src/jak2/levels/common/enemy/amphibian/amphibian.gc index 7814fb079f..cb912dcc52 100644 --- a/goal_src/jak2/levels/common/enemy/amphibian/amphibian.gc +++ b/goal_src/jak2/levels/common/enemy/amphibian/amphibian.gc @@ -155,7 +155,35 @@ :default-hit-points 4 :gnd-collide-with (collide-spec backgnd) :overlaps-others-collide-with-filter (collide-spec jak bot player-list) - :penetrate-knocked #x11fffdffa + :penetrate-knocked (penetrate + generic-attack + flop + punch + spin + roll + uppercut + bonk + tube + vehicle + flut-attack + board + mech-punch + mech-bonk + dark-skin + dark-punch + dark-bomb + dark-giant + shield + explode + jak-yellow-shot + jak-red-shot + jak-blue-shot + jak-dark-shot + enemy-yellow-shot + enemy-dark-shot + eco-yellow + knocked + ) :movement-gravity (meters -100) :friction 0.8 :attack-shove-back (meters 3.5) @@ -535,18 +563,18 @@ (logior! (-> obj focus-status) (focus-status touch-water under-water)) ) (else - (when (logtest? (-> obj focus-status) (focus-status touch-water)) + (when (focus-test? obj touch-water) (let ((s3-0 (new 'stack-no-clear 'water-info))) (water-info-init! (-> obj root-override2) s3-0 (collide-action solid semi-solid)) (let ((v1-12 #f)) (cond ((not (logtest? (water-flags touch-water) (-> s3-0 flags))) - (if (logtest? (-> obj focus-status) (focus-status under-water)) + (if (focus-test? obj under-water) (set! v1-12 #t) ) (logclear! (-> obj focus-status) (focus-status touch-water under-water)) ) - ((logtest? (-> obj focus-status) (focus-status under-water)) + ((focus-test? obj under-water) (let* ((a0-18 (-> obj root-override2 root-prim prim-core)) (f0-1 (+ (-> a0-18 world-sphere y) (-> a0-18 world-sphere w))) ) diff --git a/goal_src/jak2/levels/common/enemy/baby_spider/tomb-baby-spider.gc b/goal_src/jak2/levels/common/enemy/baby_spider/tomb-baby-spider.gc index eaf4078e5d..79bbef8447 100644 --- a/goal_src/jak2/levels/common/enemy/baby_spider/tomb-baby-spider.gc +++ b/goal_src/jak2/levels/common/enemy/baby_spider/tomb-baby-spider.gc @@ -63,7 +63,35 @@ :default-hit-points 1 :gnd-collide-with (collide-spec backgnd) :overlaps-others-collide-with-filter (collide-spec jak bot player-list) - :penetrate-knocked #x11fffdffa + :penetrate-knocked (penetrate + generic-attack + flop + punch + spin + roll + uppercut + bonk + tube + vehicle + flut-attack + board + mech-punch + mech-bonk + dark-skin + dark-punch + dark-bomb + dark-giant + shield + explode + jak-yellow-shot + jak-red-shot + jak-blue-shot + jak-dark-shot + enemy-yellow-shot + enemy-dark-shot + eco-yellow + knocked + ) :movement-gravity (meters -100) :friction 0.8 :attack-shove-back (meters 6) @@ -643,7 +671,7 @@ ) (f0-0 1.0) ) - (if (and (= s2-0 v1-0) (logtest? (focus-status indax) (-> v1-0 focus-status))) + (if (and (= s2-0 v1-0) (focus-test? v1-0 indax)) (set! f0-0 0.6) ) (let ((a1-5 (new 'stack-no-clear 'event-message-block))) diff --git a/goal_src/jak2/levels/common/enemy/bombots/bombbot.gc b/goal_src/jak2/levels/common/enemy/bombots/bombbot.gc index 22c3dfb3e4..19399a4378 100644 --- a/goal_src/jak2/levels/common/enemy/bombots/bombbot.gc +++ b/goal_src/jak2/levels/common/enemy/bombots/bombbot.gc @@ -1419,14 +1419,14 @@ ) (when (and s1-1 (!= obj s1-1) - (not (logtest? (-> obj focus-status) (focus-status inactive))) - (not (logtest? (-> obj focus-status) (focus-status disable))) - (not (logtest? (-> obj focus-status) (focus-status dead))) + (not (focus-test? obj inactive)) + (not (focus-test? obj disable)) + (not (focus-test? obj dead)) (not (logtest? (process-mask guard) (-> s1-1 mask))) (not (logtest? (process-mask crate) (-> s1-1 mask))) (logtest? (process-mask vehicle) (-> s1-1 mask)) s1-1 - (zero? (logand (-> (the-as process-focusable s1-1) focus-status) (focus-status disable dead ignore grabbed))) + (not (logtest? (-> (the-as process-focusable s1-1) focus-status) (focus-status disable dead ignore grabbed))) ) (let ((f0-0 (vector-vector-xz-distance (-> obj root-override2 trans) (-> s1-1 root trans)))) (when (or (not gp-0) (< f0-0 f30-0)) @@ -1796,7 +1796,7 @@ ) (when (and s2-0 s2-0 - (zero? (logand (-> (the-as process-focusable s2-0) focus-status) (focus-status disable dead ignore grabbed))) + (not (logtest? (-> (the-as process-focusable s2-0) focus-status) (focus-status disable dead ignore grabbed))) ) (let ((s2-1 (new 'stack-no-clear 'projectile-init-by-other-params))) (set! (-> s2-1 ent) (-> obj entity)) @@ -3202,7 +3202,7 @@ (lambda :behavior task-manager () (when (and *target* - (not (logtest? (-> *target* focus-status) (focus-status dead))) + (not (focus-test? *target* dead)) (zero? (-> self data-int32 1)) (nonzero? (-> self data-int32 0)) ) diff --git a/goal_src/jak2/levels/common/enemy/fodder/fodder.gc b/goal_src/jak2/levels/common/enemy/fodder/fodder.gc index 0771604c28..674c11ffd9 100644 --- a/goal_src/jak2/levels/common/enemy/fodder/fodder.gc +++ b/goal_src/jak2/levels/common/enemy/fodder/fodder.gc @@ -107,7 +107,35 @@ :default-hit-points 1 :gnd-collide-with (collide-spec backgnd) :overlaps-others-collide-with-filter (collide-spec jak bot player-list) - :penetrate-knocked #x11fffdffa + :penetrate-knocked (penetrate + generic-attack + flop + punch + spin + roll + uppercut + bonk + tube + vehicle + flut-attack + board + mech-punch + mech-bonk + dark-skin + dark-punch + dark-bomb + dark-giant + shield + explode + jak-yellow-shot + jak-red-shot + jak-blue-shot + jak-dark-shot + enemy-yellow-shot + enemy-dark-shot + eco-yellow + knocked + ) :movement-gravity (meters -100) :friction 0.8 :attack-shove-back (meters 3) @@ -1139,5 +1167,5 @@ ) (defmethod enemy-method-99 fodder ((obj fodder) (arg0 process-focusable)) - (logtest? (focus-status mech) (-> arg0 focus-status)) + (focus-test? arg0 mech) ) diff --git a/goal_src/jak2/levels/common/enemy/guards/crimson-guard-level.gc b/goal_src/jak2/levels/common/enemy/guards/crimson-guard-level.gc index e4605d2562..06cb38efa7 100644 --- a/goal_src/jak2/levels/common/enemy/guards/crimson-guard-level.gc +++ b/goal_src/jak2/levels/common/enemy/guards/crimson-guard-level.gc @@ -1161,7 +1161,7 @@ ) (when (= a0-21 'attack) (when (logtest? (-> (the-as process-focusable v1-16) mask) (process-mask target)) - (if (logtest? (-> (the-as process-focusable v1-16) focus-status) (focus-status dead)) + (if (focus-test? (the-as process-focusable v1-16) dead) (speech-control-method-12 *speech-control* obj (speech-type speech-type-1 speech-type-3)) ) ) @@ -2146,7 +2146,7 @@ (let ((v1-4 (handle->process (-> self focus handle)))) (when v1-4 (when (not (and v1-4 - (zero? (logand (-> (the-as process-focusable v1-4) focus-status) (focus-status disable dead ignore grabbed))) + (not (logtest? (-> (the-as process-focusable v1-4) focus-status) (focus-status disable dead ignore grabbed))) ) ) (if (logtest? (-> self flags) 4) @@ -3032,10 +3032,10 @@ (cond ((and (crimson-guard-level-method-193 self) (handle->process (-> self focus handle)) - (zero? (logand (-> (the-as process-focusable (handle->process (-> self focus handle))) focus-status) + (not (logtest? (-> (the-as process-focusable (handle->process (-> self focus handle))) focus-status) (focus-status disable dead ignore grabbed) ) - ) + ) ) (cond ((< (-> self target-self-xz-dist) 16384.0) diff --git a/goal_src/jak2/levels/common/enemy/hopper.gc b/goal_src/jak2/levels/common/enemy/hopper.gc index ee16c10787..db793e9a1b 100644 --- a/goal_src/jak2/levels/common/enemy/hopper.gc +++ b/goal_src/jak2/levels/common/enemy/hopper.gc @@ -363,18 +363,18 @@ (logior! (-> obj focus-status) (focus-status touch-water under-water)) ) (else - (when (logtest? (-> obj focus-status) (focus-status touch-water)) + (when (focus-test? obj touch-water) (let ((s3-0 (new 'stack-no-clear 'water-info))) (water-info-init! (-> obj root-override2) s3-0 (collide-action solid semi-solid)) (let ((v1-9 #f)) (cond ((not (logtest? (water-flags touch-water) (-> s3-0 flags))) - (if (logtest? (-> obj focus-status) (focus-status under-water)) + (if (focus-test? obj under-water) (set! v1-9 #t) ) (logclear! (-> obj focus-status) (focus-status touch-water under-water)) ) - ((logtest? (-> obj focus-status) (focus-status under-water)) + ((focus-test? obj under-water) (let ((f0-1 (+ 11264.0 (-> obj root-override2 trans y)))) (if (< (-> s3-0 trans y) f0-1) (set! v1-9 #t) diff --git a/goal_src/jak2/levels/common/enemy/hover/crimson-guard-hover.gc b/goal_src/jak2/levels/common/enemy/hover/crimson-guard-hover.gc index fd516ec586..ada332d281 100644 --- a/goal_src/jak2/levels/common/enemy/hover/crimson-guard-hover.gc +++ b/goal_src/jak2/levels/common/enemy/hover/crimson-guard-hover.gc @@ -1247,7 +1247,7 @@ ) (when (= (the-as symbol a0-27) 'attack) (when (logtest? (-> (the-as process-focusable v1-31) mask) (process-mask target)) - (if (and (logtest? (-> (the-as process-focusable v1-31) focus-status) (focus-status dead)) + (if (and (focus-test? (the-as process-focusable v1-31) dead) (let ((f0-1 (vector-vector-distance-squared (-> obj root-override2 trans) (-> obj focus-pos))) (f1-3 122880.0) ) diff --git a/goal_src/jak2/levels/common/enemy/hover/wasp.gc b/goal_src/jak2/levels/common/enemy/hover/wasp.gc index 96c0abfd6e..35e09028a9 100644 --- a/goal_src/jak2/levels/common/enemy/hover/wasp.gc +++ b/goal_src/jak2/levels/common/enemy/hover/wasp.gc @@ -1147,7 +1147,7 @@ (s3-2 (vector-normalize-copy! (new 'stack-no-clear 'vector) s3-1 1.0)) ) (if (and (and s5-0 - (zero? (logand (-> (the-as process-focusable s5-0) focus-status) (focus-status disable dead ignore grabbed))) + (not (logtest? (-> (the-as process-focusable s5-0) focus-status) (focus-status disable dead ignore grabbed))) ) (< 0.0 (vector-dot s2-1 s3-2)) (< (vector-vector-distance s4-1 (-> obj focus-pos)) 225280.0) diff --git a/goal_src/jak2/levels/common/enemy/metalhead_bearer/centurion.gc b/goal_src/jak2/levels/common/enemy/metalhead_bearer/centurion.gc index ab70bf80c1..70a19f0170 100644 --- a/goal_src/jak2/levels/common/enemy/metalhead_bearer/centurion.gc +++ b/goal_src/jak2/levels/common/enemy/metalhead_bearer/centurion.gc @@ -500,7 +500,7 @@ (if (and (not (and (-> obj next-state) (= (-> obj next-state name) 'victory))) (and (> (-> obj hit-points) 0) (zero? (-> obj fated-time)) - (zero? (logand (-> obj focus-status) (focus-status grabbed))) + (not (logtest? (-> obj focus-status) (focus-status grabbed))) ) ) (go (method-of-object obj victory)) diff --git a/goal_src/jak2/levels/common/enemy/metalhead_slinger/grenadier.gc b/goal_src/jak2/levels/common/enemy/metalhead_slinger/grenadier.gc index 2fed77f83d..31aae56959 100644 --- a/goal_src/jak2/levels/common/enemy/metalhead_slinger/grenadier.gc +++ b/goal_src/jak2/levels/common/enemy/metalhead_slinger/grenadier.gc @@ -570,10 +570,10 @@ (>= 8192.0 (vector-vector-xz-distance (-> self root-override2 trans) (-> self bank final-pos))) ) (if (and (handle->process (-> self focus handle)) - (zero? (logand (-> (the-as process-focusable (handle->process (-> self focus handle))) focus-status) + (not (logtest? (-> (the-as process-focusable (handle->process (-> self focus handle))) focus-status) (focus-status disable dead ignore grabbed) ) - ) + ) ) (go-virtual attack) (go-stare self) @@ -1109,10 +1109,10 @@ (cond ((= (-> self focus aware) (enemy-aware enemy-aware-3)) (if (and (handle->process (-> self focus handle)) - (zero? (logand (-> (the-as process-focusable (handle->process (-> self focus handle))) focus-status) + (not (logtest? (-> (the-as process-focusable (handle->process (-> self focus handle))) focus-status) (focus-status disable dead ignore grabbed) ) - ) + ) ) (go-virtual attack) ) @@ -1130,10 +1130,10 @@ (if (and (and (-> obj next-state) (= (-> obj next-state name) 'knocked)) (and (logtest? (-> obj status-flags) 1) (handle->process (-> obj focus handle)) - (zero? (logand (-> (the-as process-focusable (handle->process (-> obj focus handle))) focus-status) + (not (logtest? (-> (the-as process-focusable (handle->process (-> obj focus handle))) focus-status) (focus-status disable dead ignore grabbed) ) - ) + ) ) ) (go (method-of-object obj attack)) diff --git a/goal_src/jak2/levels/common/entities/gun-buoy.gc b/goal_src/jak2/levels/common/entities/gun-buoy.gc index fd96899d58..fcb90b1023 100644 --- a/goal_src/jak2/levels/common/entities/gun-buoy.gc +++ b/goal_src/jak2/levels/common/entities/gun-buoy.gc @@ -446,7 +446,7 @@ (s3-0 (let ((s4-0 (new 'stack-no-clear 'vector))) (set! (-> s4-0 quad) (-> (get-trans s3-0 1) quad)) - (let ((gp-2 (logtest? (focus-status board) (-> s3-0 focus-status))) + (let ((gp-2 (focus-test? s3-0 board)) (s5-0 (-> self offset-from-player)) ) (set! (-> s4-0 y) (fmax (-> s4-0 y) (-> s3-0 water height))) @@ -597,7 +597,7 @@ ) ) ) - (if (and a0-6 (logtest? (focus-status board) (-> (the-as process-focusable a0-6) focus-status))) + (if (and a0-6 (focus-test? (the-as process-focusable a0-6) board)) (set! f30-0 (* 2.0 f30-0)) ) ) @@ -705,7 +705,7 @@ ) ) (cond - ((logtest? (focus-status board) (-> (the-as process-focusable v1-6) focus-status)) + ((focus-test? (the-as process-focusable v1-6) board) (set! (-> self warning-interval) (seconds 0.5)) ) (else @@ -834,7 +834,7 @@ ) ) ) - (if (and gp-0 (logtest? (-> (the-as process-focusable gp-0) focus-status) (focus-status dead))) + (if (and gp-0 (focus-test? (the-as process-focusable gp-0) dead)) (go-virtual victory) ) (if (not (and gp-0 (-> *setting-control* user-current gun-buoy))) @@ -1040,7 +1040,7 @@ ) (let ((v1-12 arg0)) (and v1-12 - (or (logtest? (-> v1-12 focus-status) (focus-status on-water under-water)) + (or (focus-test? v1-12 on-water under-water) (= (-> (the-as collide-shape-moving (-> v1-12 root-override)) ground-pat material) (pat-material waterbottom)) ) ) @@ -1064,7 +1064,7 @@ v1-19 ) (and (and v1-19 - (or (logtest? (-> v1-19 focus-status) (focus-status on-water under-water)) + (or (focus-test? v1-19 on-water under-water) (= (-> (the-as collide-shape-moving (-> v1-19 root-override)) ground-pat material) (pat-material waterbottom)) ) ) diff --git a/goal_src/jak2/levels/common/flitter.gc b/goal_src/jak2/levels/common/flitter.gc index c2e9fc25a4..0e39c1cd9c 100644 --- a/goal_src/jak2/levels/common/flitter.gc +++ b/goal_src/jak2/levels/common/flitter.gc @@ -863,7 +863,7 @@ ) (defmethod enemy-method-99 flitter ((obj flitter) (arg0 process-focusable)) - (logtest? (focus-status mech) (-> arg0 focus-status)) + (focus-test? arg0 mech) ) (defmethod flitter-method-180 flitter ((obj flitter)) @@ -1250,7 +1250,7 @@ ((and gp-0 (< (- (-> self clock frame-counter) (-> self state-time)) (seconds 1.5)) gp-0 - (zero? (logand (-> gp-0 focus-status) (focus-status disable dead ignore grabbed))) + (not (logtest? (-> gp-0 focus-status) (focus-status disable dead ignore grabbed))) ) (let ((s5-1 (-> self nav state)) (v1-10 (get-trans gp-0 0)) diff --git a/goal_src/jak2/levels/common/grunt.gc b/goal_src/jak2/levels/common/grunt.gc index ab9ef42dac..dc3af85521 100644 --- a/goal_src/jak2/levels/common/grunt.gc +++ b/goal_src/jak2/levels/common/grunt.gc @@ -784,7 +784,7 @@ (gp-0 (-> self clock frame-counter)) ) (when (and (>= gp-0 (-> self next-warn-time)) - (zero? (logand (-> self draw status) (draw-control-status on-screen))) + (not (logtest? (-> self draw status) (draw-control-status on-screen))) ) (when (and a0-1 (let ((f0-0 65536.0)) @@ -1452,7 +1452,7 @@ (>= 163840.0 (vector-vector-distance (-> self root-override2 trans) gp-0)) ) (or (not (logtest? (-> self fact-info-override enemy-options) (enemy-option user8))) - (and (not (logtest? (-> (the-as process-focusable s5-0) focus-status) (focus-status in-air))) + (and (not (focus-test? (the-as process-focusable s5-0) in-air)) (>= 4096.0 (fabs (- (-> gp-0 y) (-> self root-override2 trans y)))) ) ) diff --git a/goal_src/jak2/levels/common/races/race-manager.gc b/goal_src/jak2/levels/common/races/race-manager.gc index 8ac8908069..42e599559f 100644 --- a/goal_src/jak2/levels/common/races/race-manager.gc +++ b/goal_src/jak2/levels/common/races/race-manager.gc @@ -232,7 +232,7 @@ (let ((v1-2 (handle->process (-> obj racer)))) (cond (v1-2 - (if (logtest? (-> (the-as process-focusable v1-2) focus-status) (focus-status dead inactive)) + (if (focus-test? (the-as process-focusable v1-2) dead inactive) (logior! (-> obj flags) 4) ) (set! (-> s5-0 vector 0 quad) (-> (the-as process-focusable v1-2) root-override trans quad)) @@ -598,7 +598,7 @@ ) ) ) - (when (and v1-3 (zero? (logand (-> obj info flags) 1))) + (when (and v1-3 (not (logtest? (-> obj info flags) 1))) (race-state-method-15 obj) (set! v1-3 (handle->process (-> obj race-signal))) ) @@ -1378,18 +1378,14 @@ ) ) ) - (while (not (and *target* (or (not (logtest? (focus-status teleporting) (-> *target* focus-status))) - (logtest? (focus-status pilot) (-> *target* focus-status)) - ) - ) - ) + (while (not (and *target* (or (not (focus-test? *target* teleporting)) (focus-test? *target* pilot)))) (suspend) ) (race-manager-method-23 self) (initialize-state self) (suspend) (let ((gp-1 (-> self race-state info))) - (when (and (-> gp-1 countdown-scene) (zero? (logand (-> self race-state flags) 2))) + (when (and (-> gp-1 countdown-scene) (not (logtest? (-> self race-state flags) 2))) (dotimes (s5-2 (-> gp-1 racer-count)) (let ((v1-42 (-> self race-state racer-array s5-2))) (if (and (logtest? (-> gp-1 racer-array s5-2 flags) 1) (!= s5-2 (-> self race-state i-player))) @@ -1475,7 +1471,7 @@ ) ) ) - (if (or (logtest? (-> gp-0 flags) 4) (not *target*) (logtest? (-> *target* focus-status) (focus-status dead))) + (if (or (logtest? (-> gp-0 flags) 4) (not *target*) (focus-test? *target* dead)) (go-virtual fail) ) (when (logtest? (-> gp-0 flags) 2) diff --git a/goal_src/jak2/levels/common/races/vehicle-racer.gc b/goal_src/jak2/levels/common/races/vehicle-racer.gc index 5e22cf30bd..36f129cd5e 100644 --- a/goal_src/jak2/levels/common/races/vehicle-racer.gc +++ b/goal_src/jak2/levels/common/races/vehicle-racer.gc @@ -332,7 +332,7 @@ ) (defmethod vehicle-method-138 vehicle-racer ((obj vehicle-racer)) - (if (logtest? (-> obj focus-status) (focus-status grabbed)) + (if (focus-test? obj grabbed) (go (method-of-object obj waiting-for-start)) (go (method-of-object obj player-control)) ) @@ -836,7 +836,7 @@ (or (< (* f0-0 f0-0) (-> obj player-dist2)) (let ((f0-3 102400.0)) (and (< (* f0-3 f0-3) (-> obj player-dist2)) - (zero? (logand (-> obj draw status) (draw-control-status on-screen))) + (not (logtest? (-> obj draw status) (draw-control-status on-screen))) ) ) ) @@ -896,7 +896,7 @@ (set! (-> obj shortcut-speed-factor) 0.0) (vehicle-racer-method-154 obj) (if (and (logtest? (-> obj flags) (rigid-body-object-flag player-driving)) - (zero? (logand (-> obj rbody state flags) (rigid-body-flag enable-physics))) + (not (logtest? (-> obj rbody state flags) (rigid-body-flag enable-physics))) ) (rigid-body-object-method-38 obj) ) diff --git a/goal_src/jak2/levels/common/scene-actor.gc b/goal_src/jak2/levels/common/scene-actor.gc index 824a3f5b3d..3c049dde1f 100644 --- a/goal_src/jak2/levels/common/scene-actor.gc +++ b/goal_src/jak2/levels/common/scene-actor.gc @@ -795,14 +795,13 @@ This commonly includes things such as: ) ) (if (and (= (-> v1-1 action) (game-task-action play)) - (or (and *target* (logtest? (-> *target* focus-status) (focus-status grabbed))) - (let ((v1-10 (-> *game-info* sub-task-list 151))) - (handle->process (if (-> v1-10 info) - (-> v1-10 info manager) - (the-as handle #f) - ) - ) - ) + (or (and *target* (focus-test? *target* grabbed)) (let ((v1-10 (-> *game-info* sub-task-list 151))) + (handle->process (if (-> v1-10 info) + (-> v1-10 info manager) + (the-as handle #f) + ) + ) + ) ) ) (-> obj draw art-group data 6) diff --git a/goal_src/jak2/levels/common/warp-gate.gc b/goal_src/jak2/levels/common/warp-gate.gc index db5fa2f573..3ace5a67f0 100644 --- a/goal_src/jak2/levels/common/warp-gate.gc +++ b/goal_src/jak2/levels/common/warp-gate.gc @@ -534,12 +534,11 @@ (handle-notice self) (when (and (and *target* (and (>= (-> self distance) (vector-vector-distance (-> self root-override trans) (-> *target* control trans))) - (zero? (logand (focus-status teleporting) (-> *target* focus-status))) + (not (logtest? (focus-status teleporting) (-> *target* focus-status))) ) ) (and (-> self continue) - (not (logtest? (focus-status in-head edge-grab pole flut tube board pilot mech indax) (-> *target* focus-status)) - ) + (not (focus-test? *target* in-head edge-grab pole flut tube board pilot mech indax)) (-> *setting-control* user-current airlock) (not (-> *setting-control* user-current hint)) ) @@ -696,7 +695,7 @@ ) (while (and *target* (and (>= 81920.0 (vector-vector-distance (-> self root-override trans) (-> *target* control trans))) - (zero? (logand (focus-status teleporting) (-> *target* focus-status))) + (not (logtest? (focus-status teleporting) (-> *target* focus-status))) ) ) (suspend) diff --git a/goal_src/jak2/levels/dig/dig-digger.gc b/goal_src/jak2/levels/dig/dig-digger.gc index 8066966c5e..5778672bb4 100644 --- a/goal_src/jak2/levels/dig/dig-digger.gc +++ b/goal_src/jak2/levels/dig/dig-digger.gc @@ -1240,14 +1240,14 @@ This commonly includes things such as: (>= (- (-> pp clock frame-counter) (-> obj speech-time)) (seconds 20)) *target* (and (>= 409600.0 (vector-vector-distance (-> obj root trans) (-> *target* control trans))) - (zero? (logand (focus-status teleporting) (-> *target* focus-status))) + (not (logtest? (focus-status teleporting) (-> *target* focus-status))) ) ) (let ((v1-37 (logand (-> obj speech-count) 1))) (cond ((zero? v1-37) (talker-spawn-func (-> *talker-speech* 191) *entity-pool* (target-pos 0) (the-as region #f)) - (if (and *target* (zero? (logand (focus-status board) (-> *target* focus-status)))) + (if (and *target* (not (logtest? (focus-status board) (-> *target* focus-status)))) (talker-spawn-func (-> *talker-speech* 115) *entity-pool* (target-pos 0) (the-as region #f)) ) ) diff --git a/goal_src/jak2/levels/dig/dig-obs.gc b/goal_src/jak2/levels/dig/dig-obs.gc index b750a8d063..6ee5fcda83 100644 --- a/goal_src/jak2/levels/dig/dig-obs.gc +++ b/goal_src/jak2/levels/dig/dig-obs.gc @@ -560,9 +560,7 @@ ) (until v1-12 (suspend) - (set! v1-12 - (and *target* (not (logtest? (-> *target* focus-status) (focus-status in-air))) (process-grab? *target* #f)) - ) + (set! v1-12 (and *target* (not (focus-test? *target* in-air)) (process-grab? *target* #f))) ) (while (!= (get-status *gui-control* s5-0) (gui-status ready)) (suspend) diff --git a/goal_src/jak2/levels/drill_platform/drill-obs.gc b/goal_src/jak2/levels/drill_platform/drill-obs.gc index e81d010da6..165098c096 100644 --- a/goal_src/jak2/levels/drill_platform/drill-obs.gc +++ b/goal_src/jak2/levels/drill_platform/drill-obs.gc @@ -559,7 +559,7 @@ For example for an elevator pre-compute the distance between the first and last (when (logtest? (-> self elevator-status) (elevator-status waiting-to-descend)) (let ((v1-9 *target*)) (when v1-9 - (if (not (logtest? (focus-status mech) (-> v1-9 focus-status))) + (if (not (focus-test? v1-9 mech)) (set-setting! 'pilot #f 0 0) ) (set-setting! 'pilot-exit #f 0 0) @@ -586,10 +586,7 @@ For example for an elevator pre-compute the distance between the first and last ) ) ) - (when (and a0-2 - (logtest? (focus-status mech) (-> a0-2 focus-status)) - (zero? (logand (-> a0-2 focus-status) (focus-status dead ignore))) - ) + (when (and a0-2 (focus-test? a0-2 mech) (not (logtest? (-> a0-2 focus-status) (focus-status dead ignore)))) (let* ((v1-5 (get-trans a0-2 0)) (s5-2 (vector-! (new 'stack-no-clear 'vector) v1-5 (-> obj root-override trans))) ) @@ -608,10 +605,10 @@ do so. (local-vars (sv-16 float)) (let ((a0-1 *target*)) (when (and a0-1 - (zero? (logand (focus-status dead inactive in-air grabbed edge-grab pole pilot-riding pilot teleporting) + (not (logtest? (focus-status dead inactive in-air grabbed edge-grab pole pilot-riding pilot teleporting) (-> a0-1 focus-status) ) - ) + ) ) (set! sv-16 (the-as float 0.0)) (when (and (find-closest-point-in-path! obj (get-trans a0-1 0) (& sv-16) #t #t) @@ -691,7 +688,7 @@ For example for an elevator pre-compute the distance between the first and last ) ) (when gp-0 - (when (or (logtest? (focus-status mech) (-> (the-as process-focusable gp-0) focus-status)) + (when (or (focus-test? (the-as process-focusable gp-0) mech) (>= (- (-> self clock frame-counter) (-> self no-collision-timer)) (the-as time-frame (-> *TARGET-bank* hit-invulnerable-timeout)) ) @@ -728,11 +725,10 @@ For example for an elevator pre-compute the distance between the first and last (set! (-> v1-32 vector quad) (-> s4-2 quad)) (set! (-> v1-32 shove-back) 409.6) (set! (-> v1-32 shove-up) 12288.0) - (set! (-> v1-32 control) - (if (logtest? (focus-status board) (-> (the-as process-focusable gp-0) focus-status)) - 1.0 - 0.0 - ) + (set! (-> v1-32 control) (if (focus-test? (the-as process-focusable gp-0) board) + 1.0 + 0.0 + ) ) (set! (-> a1-10 param 1) (the-as uint v1-32)) ) @@ -1079,7 +1075,7 @@ This commonly includes things such as: (defmethod set-switch-color drill-switch ((obj drill-switch) (arg0 symbol)) "Set the switch color based on its state." (with-pp - (when (or arg0 (zero? (logand (-> pp clock frame-counter) 64))) + (when (or arg0 (not (logtest? (-> pp clock frame-counter) 64))) (let ((s4-0 (new 'stack-no-clear 'vector))) (vector<-cspace+vector! s4-0 (-> obj node-list data 4) (new 'static 'vector :y 6963.2 :w 1.0)) (spawn diff --git a/goal_src/jak2/levels/drill_platform/drill-obs2.gc b/goal_src/jak2/levels/drill_platform/drill-obs2.gc index 561a071214..73e39df48f 100644 --- a/goal_src/jak2/levels/drill_platform/drill-obs2.gc +++ b/goal_src/jak2/levels/drill_platform/drill-obs2.gc @@ -801,7 +801,7 @@ This commonly includes things such as: (lambda ((arg0 process)) (and (-> arg0 entity) (type? arg0 drill-metalhead-eggs) - (zero? (logand (-> arg0 entity extra perm status) (entity-perm-status subtask-complete))) + (not (logtest? (-> arg0 entity extra perm status) (entity-perm-status subtask-complete))) ) ) ) diff --git a/goal_src/jak2/levels/drill_platform/ginsu.gc b/goal_src/jak2/levels/drill_platform/ginsu.gc index 142eb99c11..1af6017944 100644 --- a/goal_src/jak2/levels/drill_platform/ginsu.gc +++ b/goal_src/jak2/levels/drill_platform/ginsu.gc @@ -107,10 +107,10 @@ ) ) -(defskelgroup skel-ginsu ginsu 0 5 - ((1 (meters 20)) (2 (meters 40)) (3 (meters 999999))) +(defskelgroup skel-ginsu ginsu ginsu-lod0-jg ginsu-idle-ja + ((ginsu-lod0-mg (meters 20)) (ginsu-lod1-mg (meters 40)) (ginsu-lod2-mg (meters 999999))) :bounds (static-spherem 0 0 0 2.5) - :shadow 4 + :shadow ginsu-shadow-mg :origin-joint-index 8 ) @@ -205,7 +205,35 @@ :default-hit-points 1 :gnd-collide-with (collide-spec backgnd) :overlaps-others-collide-with-filter (collide-spec jak bot enemy hit-by-others-list player-list) - :penetrate-knocked #x11fffdffa + :penetrate-knocked (penetrate + generic-attack + flop + punch + spin + roll + uppercut + bonk + tube + vehicle + flut-attack + board + mech-punch + mech-bonk + dark-skin + dark-punch + dark-bomb + dark-giant + shield + explode + jak-yellow-shot + jak-red-shot + jak-blue-shot + jak-dark-shot + enemy-yellow-shot + enemy-dark-shot + eco-yellow + knocked + ) :movement-gravity (meters -100) :friction 0.8 :attack-shove-back (meters 3) @@ -520,7 +548,7 @@ ) (('touch 'bonk 'attack) (cond - ((or (!= arg0 *target*) (logtest? (focus-status dark) (-> *target* focus-status))) + ((or (!= arg0 *target*) (focus-test? *target* dark)) ((method-of-type nav-enemy general-event-handler) obj arg0 arg1 arg2 arg3) ) (else @@ -669,7 +697,7 @@ 0 (set! (-> self state-time) (-> self clock frame-counter)) (ja-channel-push! 1 (seconds 0.2)) - (ja :group! (-> self draw art-group data 5) :num! min) + (ja :group! ginsu-idle-ja :num! min) (none) ) :exit (behavior () @@ -682,10 +710,10 @@ ) :trans (behavior () (if (not (and (handle->process (-> self focus handle)) - (zero? (logand (-> (the-as process-focusable (handle->process (-> self focus handle))) focus-status) + (not (logtest? (-> (the-as process-focusable (handle->process (-> self focus handle))) focus-status) (focus-status disable dead ignore grabbed) ) - ) + ) ) ) (go-virtual circling) @@ -742,7 +770,7 @@ ) 0 (set! (-> self state-time) (-> self clock frame-counter)) - (ja :group! (-> self draw art-group data 15) :num! min) + (ja :group! ginsu-attack-ja :num! min) (none) ) :exit (behavior () @@ -757,10 +785,10 @@ :trans (behavior () (enemy-method-49 self) (if (not (and (handle->process (-> self focus handle)) - (zero? (logand (-> (the-as process-focusable (handle->process (-> self focus handle))) focus-status) + (not (logtest? (-> (the-as process-focusable (handle->process (-> self focus handle))) focus-status) (focus-status disable dead ignore grabbed) ) - ) + ) ) ) (go-virtual circling) @@ -808,7 +836,7 @@ (when (-> self ambush-started) (when (zero? (-> self skel active-channels)) (ja-channel-push! 1 0) - (ja :group! (-> self draw art-group data 5) :num! min) + (ja :group! ginsu-idle-ja :num! min) ) (vector-seek! (-> self root-override2 scale) (new 'static 'vector :x 1.0 :y 1.0 :z 1.0) 0.02) (+! (-> self path-pos) (/ 2048.0 (total-distance (-> self ambush-path)))) diff --git a/goal_src/jak2/levels/forest/pegasus.gc b/goal_src/jak2/levels/forest/pegasus.gc index 7cc3247f19..b8316b9590 100644 --- a/goal_src/jak2/levels/forest/pegasus.gc +++ b/goal_src/jak2/levels/forest/pegasus.gc @@ -207,48 +207,42 @@ For pegasus, it will call [[enemy::57]] only if the [[pegasus]] has been targett ) ) -;; WARN: Return type mismatch none vs object. (defmethod general-event-handler pegasus ((obj pegasus) (proc process) (arg2 int) (event-type symbol) (event event-message-block)) "Handles various events for the enemy @TODO - unsure if there is a pattern for the events and this should have a more specific name" (with-pp - (let ((v1-0 event-type)) - (the-as - object - (cond - ((= v1-0 'track) - #f - ) - ((or (= v1-0 'hit) (= v1-0 'hit-knocked)) - (cond - ((zero? (-> obj hit-points)) - (logclear! (-> obj mask) (process-mask actor-pause)) - (logclear! (-> obj focus-status) (focus-status dangerous)) - (logclear! (-> obj enemy-flags) (enemy-flag enable-on-notice)) - (logior! (-> obj enemy-flags) (enemy-flag chase-startup)) - (logior! (-> obj focus-status) (focus-status hit)) - (if (zero? (-> obj hit-points)) - (logior! (-> obj focus-status) (focus-status dead)) - ) - (logclear! (-> obj enemy-flags) (enemy-flag actor-pause-backup)) - (enemy-method-62 obj) - (set! (-> obj enemy-flags) (logior (enemy-flag actor-pause-backup) (-> obj enemy-flags))) - (process-contact-action proc) - (send-event proc 'get-attack-count 1) - (the-as object (kill-prefer-falling obj)) + (case event-type + (('track) + #f + ) + (('hit 'hit-knocked) + (cond + ((zero? (-> obj hit-points)) + (logclear! (-> obj mask) (process-mask actor-pause)) + (logclear! (-> obj focus-status) (focus-status dangerous)) + (logclear! (-> obj enemy-flags) (enemy-flag enable-on-notice)) + (logior! (-> obj enemy-flags) (enemy-flag chase-startup)) + (logior! (-> obj focus-status) (focus-status hit)) + (if (zero? (-> obj hit-points)) + (logior! (-> obj focus-status) (focus-status dead)) ) - (else - (let ((v0-0 (the-as object (-> pp clock frame-counter)))) - (set! (-> obj targetted-timer) (the-as time-frame v0-0)) - v0-0 - ) - ) + (logclear! (-> obj enemy-flags) (enemy-flag actor-pause-backup)) + (enemy-method-62 obj) + (set! (-> obj enemy-flags) (logior (enemy-flag actor-pause-backup) (-> obj enemy-flags))) + (process-contact-action proc) + (send-event proc 'get-attack-count 1) + (kill-prefer-falling obj) + ) + (else + (let ((v0-0 (the-as object (-> pp clock frame-counter)))) + (set! (-> obj targetted-timer) (the-as time-frame v0-0)) + v0-0 ) ) - (else - ((method-of-type enemy general-event-handler) obj proc arg2 event-type event) - ) - ) + ) + ) + (else + ((method-of-type enemy general-event-handler) obj proc arg2 event-type event) ) ) ) @@ -1048,7 +1042,7 @@ The faster it's moving the fast it flaps it's wings, etc (cond ((and *target* (and (>= 102400.0 (vector-vector-xz-distance (-> self root-override2 trans) (-> *target* control trans))) - (zero? (logand (focus-status teleporting) (-> *target* focus-status))) + (not (logtest? (focus-status teleporting) (-> *target* focus-status))) ) ) (set! (-> self state-time) @@ -1110,7 +1104,7 @@ The faster it's moving the fast it flaps it's wings, etc ) (when (and *target* (and (>= 102400.0 (vector-vector-xz-distance (-> self root-override2 trans) (-> *target* control trans))) - (zero? (logand (focus-status teleporting) (-> *target* focus-status))) + (not (logtest? (focus-status teleporting) (-> *target* focus-status))) ) ) (set! (-> self near-timer) (- (the-as time-frame (-> self near-timer)) diff --git a/goal_src/jak2/levels/forest/predator.gc b/goal_src/jak2/levels/forest/predator.gc index 609e9c8fee..bb385c4907 100644 --- a/goal_src/jak2/levels/forest/predator.gc +++ b/goal_src/jak2/levels/forest/predator.gc @@ -1167,7 +1167,7 @@ ) (if (and (>= (- (-> self clock frame-counter) (-> self state-time)) (seconds 0.5)) (check-los? (-> self los) 0) - (zero? (logand (-> self draw status) (draw-control-status on-screen))) + (not (logtest? (-> self draw status) (draw-control-status on-screen))) ) (go-virtual fire) ) @@ -1371,7 +1371,7 @@ (s1-0 (-> *predator-graph* node s2-0)) ) (when (and (not (point-in-line-region? (target-pos 0) (-> s5-0 position) (-> s1-0 position) 61440.0)) - (zero? (logand (-> s1-0 flags) (predator-node-flag taken))) + (not (logtest? (-> s1-0 flags) (predator-node-flag taken))) ) (logior! (-> s1-0 flags) (predator-node-flag taken)) (logclear! (-> s5-0 flags) (predator-node-flag taken)) diff --git a/goal_src/jak2/levels/fortress/ammo_dump/fort-robotank-turret.gc b/goal_src/jak2/levels/fortress/ammo_dump/fort-robotank-turret.gc index 8fb321639f..c2f740c564 100644 --- a/goal_src/jak2/levels/fortress/ammo_dump/fort-robotank-turret.gc +++ b/goal_src/jak2/levels/fortress/ammo_dump/fort-robotank-turret.gc @@ -963,7 +963,7 @@ ) ) ) - (when (and (logtest? (-> self flags) 1) (zero? (logand (-> self flags) 8))) + (when (and (logtest? (-> self flags) 1) (not (logtest? (-> self flags) 8))) (let* ((a1-32 (-> self node-list data (-> self gun-joint-l 0))) (s4-1 (-> self node-list data (-> self gun-joint-r 0))) (gp-4 diff --git a/goal_src/jak2/levels/fortress/ammo_dump/fort-robotank.gc b/goal_src/jak2/levels/fortress/ammo_dump/fort-robotank.gc index 7704137eff..58901c048e 100644 --- a/goal_src/jak2/levels/fortress/ammo_dump/fort-robotank.gc +++ b/goal_src/jak2/levels/fortress/ammo_dump/fort-robotank.gc @@ -532,7 +532,7 @@ ) ) (set! (-> v1-40 shove-up) 24576.0) - (set! (-> v1-40 control) (if (logtest? (focus-status board) (-> s5-0 focus-status)) + (set! (-> v1-40 control) (if (focus-test? s5-0 board) 1.0 0.0 ) diff --git a/goal_src/jak2/levels/gungame/gungame-obs.gc b/goal_src/jak2/levels/gungame/gungame-obs.gc index 3790ef5287..3f5e5b5057 100644 --- a/goal_src/jak2/levels/gungame/gungame-obs.gc +++ b/goal_src/jak2/levels/gungame/gungame-obs.gc @@ -309,7 +309,7 @@ This commonly includes things such as: ;; (suspend) ;; ) (when *target* - (while (logtest? (focus-status gun) (-> *target* focus-status)) + (while (focus-test? *target* gun) (render-text self (game-text-id gungame-tutorial-put-red-away)) (suspend) ) diff --git a/goal_src/jak2/levels/landing_pad/castle-obs.gc b/goal_src/jak2/levels/landing_pad/castle-obs.gc index 21b1e817d0..ac664905ce 100644 --- a/goal_src/jak2/levels/landing_pad/castle-obs.gc +++ b/goal_src/jak2/levels/landing_pad/castle-obs.gc @@ -89,7 +89,7 @@ This commonly includes things such as: (defbehavior sound-update cas-conveyor () (when (and *target* (and (>= 327680.0 (vector-vector-distance (-> self collide-bounds) (-> *target* control trans))) - (zero? (logand (focus-status teleporting) (-> *target* focus-status))) + (not (logtest? (focus-status teleporting) (-> *target* focus-status))) ) ) (let ((f0-2 (* 0.000032552085 (+ -30720.0 (fabs (-> self speed)))))) @@ -623,7 +623,7 @@ This commonly includes things such as: ) ) (let ((gp-2 *target*)) - (when (and gp-2 (zero? (logand (-> gp-2 focus-status) (focus-status disable dead ignore inactive)))) + (when (and gp-2 (not (logtest? (-> gp-2 focus-status) (focus-status disable dead ignore inactive)))) (let ((s4-3 (get-trans gp-2 0))) (when (< (vector-vector-distance s4-3 (-> self root-override trans)) 24576.0) (let ((s5-3 (new 'stack-no-clear 'event-message-block))) @@ -643,7 +643,7 @@ This commonly includes things such as: ) (set! (-> s3-3 shove-back) 24576.0) (set! (-> s3-3 shove-up) 12288.0) - (set! (-> s3-3 control) (if (logtest? (focus-status board) (-> gp-2 focus-status)) + (set! (-> s3-3 control) (if (focus-test? gp-2 board) 1.0 0.0 ) @@ -2264,7 +2264,7 @@ This commonly includes things such as: (when (>= (- (-> self clock frame-counter) (-> self state-time)) (seconds 0.6)) (let ((a0-1 *target*)) (if (and a0-1 - (not (logtest? (-> a0-1 focus-status) (focus-status disable dead))) + (not (focus-test? a0-1 disable dead)) (< (vector-vector-distance (get-trans a0-1 0) (-> self root trans)) (-> self notice-dist)) ) (go-virtual spawning) @@ -2300,7 +2300,7 @@ This commonly includes things such as: :trans (behavior () (when (>= (- (-> self clock frame-counter) (-> self state-time)) (seconds 0.6)) (let ((a0-1 *target*)) - (if (and a0-1 (zero? (logand (-> a0-1 focus-status) (focus-status disable dead)))) + (if (and a0-1 (not (logtest? (-> a0-1 focus-status) (focus-status disable dead)))) (set! (-> self player-dist) (vector-vector-distance (get-trans a0-1 0) (-> self root trans))) ) ) diff --git a/goal_src/jak2/levels/landing_pad/roboguard-level.gc b/goal_src/jak2/levels/landing_pad/roboguard-level.gc index dd7c34fc61..0e4e7725f8 100644 --- a/goal_src/jak2/levels/landing_pad/roboguard-level.gc +++ b/goal_src/jak2/levels/landing_pad/roboguard-level.gc @@ -642,7 +642,7 @@ (let ((gp-2 (handle->process (-> self focus handle)))) (when (and gp-2 (and gp-2 - (zero? (logand (-> (the-as process-focusable gp-2) focus-status) (focus-status disable dead ignore grabbed))) + (not (logtest? (-> (the-as process-focusable gp-2) focus-status) (focus-status disable dead ignore grabbed))) ) (< 2 (the-as int (-> self focus aware))) ) @@ -1018,7 +1018,7 @@ (cond ((!= (-> (the-as attack-info v1-3) id) (-> obj incoming-attack-id)) (set! (-> obj incoming-attack-id) (-> (the-as attack-info v1-3) id)) - (when (and a0-2 (zero? (logand (process-mask enemy) (-> a0-2 mask)))) + (when (and a0-2 (not (logtest? (process-mask enemy) (-> a0-2 mask)))) (let ((s5-0 (find-offending-process-focusable a0-2 (the-as attack-info v1-3)))) (when s5-0 (new 'stack-no-clear 'vector) @@ -1100,7 +1100,7 @@ (the-as symbol (cond - ((or (= (-> arg0 type) target) (zero? (logand (-> obj flags) 4))) + ((or (= (-> arg0 type) target) (not (logtest? (-> obj flags) 4))) ((method-of-type nav-enemy enemy-method-76) obj arg0 arg1) ) (else diff --git a/goal_src/jak2/levels/mars_tomb/left/chase/target-indax.gc b/goal_src/jak2/levels/mars_tomb/left/chase/target-indax.gc index 16e018cdf5..abcc28c1e7 100644 --- a/goal_src/jak2/levels/mars_tomb/left/chase/target-indax.gc +++ b/goal_src/jak2/levels/mars_tomb/left/chase/target-indax.gc @@ -86,7 +86,7 @@ (let ((v1-5 (-> arg3 param 0))) (cond ((= v1-5 'grab) - (when (not (logtest? (-> self focus-status) (focus-status dead))) + (when (not (focus-test? self dead)) (if (not (-> arg3 param 1)) #t (go target-grab 'stance) @@ -103,7 +103,7 @@ ) ) (('trip) - (if (not (or (logtest? (-> self focus-status) (focus-status dead hit grabbed)) + (if (not (or (focus-test? self dead hit grabbed) (and (-> self next-state) (= (-> self next-state name) 'target-indax-trip)) ) ) @@ -315,7 +315,7 @@ (set! (-> self draw art-group) (-> self indax art-group-backup)) (logclear! (-> self draw status) (draw-control-status no-draw-bounds2)) (send-event (ppointer->process (-> self sidekick)) 'matrix #f) - (if (not (logtest? (-> self focus-status) (focus-status dead))) + (if (not (focus-test? self dead)) (set! (-> self fact-override health) (-> self fact-override health-max)) ) (target-exit) @@ -851,7 +851,7 @@ (< (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))) (not (logtest? (water-flags touch-water) (-> self water flags))) - (zero? (logand (state-flags prevent-jump prevent-double-jump) (-> self state-flags))) + (not (logtest? (state-flags prevent-jump prevent-double-jump) (-> self state-flags))) ) ) (go diff --git a/goal_src/jak2/levels/mars_tomb/tomb-water.gc b/goal_src/jak2/levels/mars_tomb/tomb-water.gc index 16830b8814..66839bc582 100644 --- a/goal_src/jak2/levels/mars_tomb/tomb-water.gc +++ b/goal_src/jak2/levels/mars_tomb/tomb-water.gc @@ -590,7 +590,7 @@ This commonly includes things such as: ) ) (when (>= (- (-> self clock frame-counter) (-> self state-time)) (seconds 4)) - (if (and *target* (logtest? (-> *target* focus-status) (focus-status grabbed))) + (if (and *target* (focus-test? *target* grabbed)) (process-release? *target*) ) (if (and *target* @@ -1120,7 +1120,7 @@ This commonly includes things such as: (when (!= (-> self basetrans y) (-> self base-height)) (seek! (-> self basetrans y) (-> self base-height) (* (-> self move-rate) (-> self clock seconds-per-frame))) (when (and (< (- (-> self base-height) (-> self basetrans y)) 21504.0) - (zero? (logand (-> self flags) (simon-block-flags sbf5))) + (not (logtest? (-> self flags) (simon-block-flags sbf5))) ) (sound-play "simon-up") (logior! (-> self flags) (simon-block-flags sbf5)) @@ -1261,7 +1261,7 @@ This commonly includes things such as: (set! (-> a2-4 vector quad) (-> v1-10 quad)) (set! (-> a2-4 shove-back) 0.0) (set! (-> a2-4 shove-up) 12288.0) - (set! (-> a2-4 control) (if (logtest? (focus-status board) (-> a0-10 focus-status)) + (set! (-> a2-4 control) (if (focus-test? a0-10 board) 1.0 0.0 ) diff --git a/goal_src/jak2/levels/nest/mammoth.gc b/goal_src/jak2/levels/nest/mammoth.gc index d498ea9761..fc873f652b 100644 --- a/goal_src/jak2/levels/nest/mammoth.gc +++ b/goal_src/jak2/levels/nest/mammoth.gc @@ -1500,7 +1500,7 @@ ) (set! (-> s3-1 shove-back) 24576.0) (set! (-> s3-1 shove-up) 12288.0) - (set! (-> s3-1 control) (if (logtest? (focus-status board) (-> s5-2 focus-status)) + (set! (-> s3-1 control) (if (focus-test? s5-2 board) 1.0 0.0 ) diff --git a/goal_src/jak2/levels/nest/mantis.gc b/goal_src/jak2/levels/nest/mantis.gc index 511a1e6fac..003a1b67a1 100644 --- a/goal_src/jak2/levels/nest/mantis.gc +++ b/goal_src/jak2/levels/nest/mantis.gc @@ -739,7 +739,7 @@ ) ) (when (and (and gp-0 - (zero? (logand (-> (the-as process-focusable gp-0) focus-status) (focus-status disable dead ignore grabbed))) + (not (logtest? (-> (the-as process-focusable gp-0) focus-status) (focus-status disable dead ignore grabbed))) ) (and (>= (- (-> self clock frame-counter) (-> self attack-timer)) (seconds 5)) (enemy-method-95 self s4-0 8192.0) diff --git a/goal_src/jak2/levels/palace/boss/squid-setup.gc b/goal_src/jak2/levels/palace/boss/squid-setup.gc index e12c411d91..77bb628f72 100644 --- a/goal_src/jak2/levels/palace/boss/squid-setup.gc +++ b/goal_src/jak2/levels/palace/boss/squid-setup.gc @@ -1454,7 +1454,7 @@ ) ((and (logtest? (attack-info-mask penetrate-using) (-> (the-as attack-info s4-0) mask)) (logtest? (penetrate dark-bomb) (-> (the-as attack-info s4-0) penetrate-using)) - (or (not *target*) (zero? (logand (-> *target* focus-status) (focus-status dead)))) + (or (not *target*) (not (logtest? (-> *target* focus-status) (focus-status dead)))) ) (set! (-> self hit-points) 0) (squid-check-hit-points) diff --git a/goal_src/jak2/levels/palace/boss/squid-states.gc b/goal_src/jak2/levels/palace/boss/squid-states.gc index ffccf494bd..48b957b94e 100644 --- a/goal_src/jak2/levels/palace/boss/squid-states.gc +++ b/goal_src/jak2/levels/palace/boss/squid-states.gc @@ -720,7 +720,7 @@ ) :trans (behavior () (if (and (zero? (-> self hit-points)) - (or (not *target*) (zero? (logand (-> *target* focus-status) (focus-status dead)))) + (or (not *target*) (not (logtest? (-> *target* focus-status) (focus-status dead)))) ) (go-virtual pre-flee) ) @@ -917,7 +917,7 @@ ) :trans (behavior () (if (and (zero? (-> self hit-points)) - (or (not *target*) (zero? (logand (-> *target* focus-status) (focus-status dead)))) + (or (not *target*) (not (logtest? (-> *target* focus-status) (focus-status dead)))) ) (go-virtual pre-flee) ) @@ -967,7 +967,7 @@ ) :trans (behavior () (if (and (zero? (-> self hit-points)) - (or (not *target*) (zero? (logand (-> *target* focus-status) (focus-status dead)))) + (or (not *target*) (not (logtest? (-> *target* focus-status) (focus-status dead)))) ) (go-virtual pre-flee) ) @@ -1119,7 +1119,7 @@ ) :trans (behavior () (if (and (zero? (-> self hit-points)) - (or (not *target*) (zero? (logand (-> *target* focus-status) (focus-status dead)))) + (or (not *target*) (not (logtest? (-> *target* focus-status) (focus-status dead)))) ) (go-virtual pre-flee) ) @@ -1247,7 +1247,7 @@ ) :trans (behavior () (if (and (zero? (-> self hit-points)) - (or (not *target*) (zero? (logand (-> *target* focus-status) (focus-status dead)))) + (or (not *target*) (not (logtest? (-> *target* focus-status) (focus-status dead)))) ) (go-virtual pre-flee) ) @@ -1455,7 +1455,7 @@ ) :trans (behavior () (if (and (zero? (-> self hit-points)) - (or (not *target*) (zero? (logand (-> *target* focus-status) (focus-status dead)))) + (or (not *target*) (not (logtest? (-> *target* focus-status) (focus-status dead)))) ) (go-virtual pre-flee) ) @@ -1621,7 +1621,7 @@ (squid-talker 'general) (cond ((and (zero? (-> self hit-points)) - (or (not *target*) (zero? (logand (-> *target* focus-status) (focus-status dead)))) + (or (not *target*) (not (logtest? (-> *target* focus-status) (focus-status dead)))) ) (go-virtual pre-flee) ) diff --git a/goal_src/jak2/levels/palace/cable/palcab-obs.gc b/goal_src/jak2/levels/palace/cable/palcab-obs.gc index c4e6aee3ce..4837bf81b9 100644 --- a/goal_src/jak2/levels/palace/cable/palcab-obs.gc +++ b/goal_src/jak2/levels/palace/cable/palcab-obs.gc @@ -93,11 +93,10 @@ (set! (-> v1-14 vector quad) (-> s4-1 quad)) (set! (-> v1-14 shove-back) 12288.0) (set! (-> v1-14 shove-up) 36864.0) - (set! (-> v1-14 control) - (if (logtest? (focus-status board) (-> (the-as process-focusable gp-0) focus-status)) - 1.0 - 0.0 - ) + (set! (-> v1-14 control) (if (focus-test? (the-as process-focusable gp-0) board) + 1.0 + 0.0 + ) ) (set! (-> a1-7 param 1) (the-as uint v1-14)) ) diff --git a/goal_src/jak2/levels/ruins/mechtest-obs.gc b/goal_src/jak2/levels/ruins/mechtest-obs.gc index 15b67c2ef3..b8c5346a0f 100644 --- a/goal_src/jak2/levels/ruins/mechtest-obs.gc +++ b/goal_src/jak2/levels/ruins/mechtest-obs.gc @@ -328,7 +328,7 @@ (>= (- (-> self clock frame-counter) (-> self state-time)) (seconds 5)) ) (and (-> self next-entity) - (zero? (logand (-> self next-entity extra perm status) (entity-perm-status subtask-complete))) + (not (logtest? (-> self next-entity extra perm status) (entity-perm-status subtask-complete))) ) ) ) diff --git a/goal_src/jak2/levels/ruins/rapid-gunner.gc b/goal_src/jak2/levels/ruins/rapid-gunner.gc index 7dc9031056..69f37f0ef2 100644 --- a/goal_src/jak2/levels/ruins/rapid-gunner.gc +++ b/goal_src/jak2/levels/ruins/rapid-gunner.gc @@ -466,7 +466,7 @@ (let ((t9-0 (method-of-type nav-enemy in-aggro-range?))) (and (t9-0 obj arg0 arg1) (or (not (logtest? (-> obj fact-info-override enemy-options) (enemy-option user8))) - (and (not (logtest? (-> arg0 focus-status) (focus-status in-air))) + (and (not (focus-test? arg0 in-air)) (>= 4096.0 (fabs (- (-> (get-trans arg0 0) y) (-> obj root-override2 trans y)))) ) ) @@ -743,7 +743,7 @@ ((and (< f0-3 20480.0) (and (< (fabs (- (-> s5-0 y) (-> self root-override2 trans y))) 6144.0) gp-0 - (zero? (logand (-> (the-as process-focusable gp-0) focus-status) (focus-status disable dead ignore grabbed))) + (not (logtest? (-> (the-as process-focusable gp-0) focus-status) (focus-status disable dead ignore grabbed))) ) ) (go-virtual spin-attack) @@ -1200,7 +1200,7 @@ (if (and (< f30-0 20480.0) (and (< (fabs (- (-> s5-0 y) (-> self root-override2 trans y))) 6144.0) gp-0 - (zero? (logand (-> (the-as process-focusable gp-0) focus-status) (focus-status disable dead ignore grabbed))) + (not (logtest? (-> (the-as process-focusable gp-0) focus-status) (focus-status disable dead ignore grabbed))) ) ) (go-virtual spin-attack) diff --git a/goal_src/jak2/levels/ruins/ruins-obs.gc b/goal_src/jak2/levels/ruins/ruins-obs.gc index ec072fdb46..18c96c9ace 100644 --- a/goal_src/jak2/levels/ruins/ruins-obs.gc +++ b/goal_src/jak2/levels/ruins/ruins-obs.gc @@ -825,7 +825,7 @@ This commonly includes things such as: :delay (nop!) ) (send-event (handle->process (-> self arrow)) 'leave) - (until (not (or (not *target*) (zero? (logand (focus-status mech) (-> *target* focus-status))))) + (until (not (or (not *target*) (not (logtest? (focus-status mech) (-> *target* focus-status))))) (b! #t cfg-47 :delay (nop!)) (label cfg-38) (when (and (>= (- (-> self clock frame-counter) (-> self time-limit)) (seconds 10)) @@ -837,7 +837,7 @@ This commonly includes things such as: ) (suspend) (label cfg-47) - (b! (or (not *target*) (zero? (logand (focus-status mech) (-> *target* focus-status)))) cfg-38 :delay (nop!)) + (b! (or (not *target*) (not (logtest? (focus-status mech) (-> *target* focus-status)))) cfg-38 :delay (nop!)) (talker-spawn-func (-> *talker-speech* 457) *entity-pool* (target-pos 0) (the-as region #f)) (set! (-> self time-limit) (-> self clock frame-counter)) (b! #t cfg-66 :delay (nop!)) @@ -861,7 +861,7 @@ This commonly includes things such as: (b! (or (not *target*) (not gp-0) - (zero? (logand (-> gp-0 extra perm status) (entity-perm-status subtask-complete))) + (not (logtest? (-> gp-0 extra perm status) (entity-perm-status subtask-complete))) ) cfg-52 :delay (nop!) @@ -904,12 +904,12 @@ This commonly includes things such as: (suspend) (label cfg-14) (b! (not *target*) cfg-17 :likely-delay (set! v1-14 #t)) - (set! v1-14 (zero? (logand (focus-status mech) (-> *target* focus-status)))) + (set! v1-14 (not (logtest? (focus-status mech) (-> *target* focus-status)))) (label cfg-17) (b! v1-14 cfg-2 :delay (nop!)) (until #f (b! (not *target*) cfg-22 :likely-delay (set! v1-18 #t)) - (set! v1-18 (zero? (logand (focus-status mech) (-> *target* focus-status)))) + (set! v1-18 (not (logtest? (focus-status mech) (-> *target* focus-status)))) (label cfg-22) (b! v1-18 cfg-1 :delay (nop!)) (when (>= (- (-> self clock frame-counter) (-> self time-limit)) (seconds 10)) @@ -933,7 +933,7 @@ This commonly includes things such as: (set! v1-32 #f) (label cfg-35) (b! (not v1-32) cfg-38 :likely-delay (set! v1-25 v1-32)) - (set! v1-25 (zero? (logand (focus-status carry) (-> *target* focus-status)))) + (set! v1-25 (not (logtest? (focus-status carry) (-> *target* focus-status)))) (label cfg-38) (when v1-25 (talker-spawn-func (-> *talker-speech* 458) *entity-pool* (target-pos 0) (the-as region #f)) @@ -963,11 +963,11 @@ This commonly includes things such as: (suspend) (label cfg-2) (b! - (or (not s4-0) (zero? (logand (-> s4-0 extra perm status) (entity-perm-status subtask-complete)))) + (or (not s4-0) (not (logtest? (-> s4-0 extra perm status) (entity-perm-status subtask-complete)))) cfg-1 :delay (nop!) ) - (until (not (or (not *target*) (zero? (logand (focus-status mech) (-> *target* focus-status))))) + (until (not (or (not *target*) (not (logtest? (focus-status mech) (-> *target* focus-status))))) (b! #t cfg-20 :delay (nop!)) (label cfg-8) (set! v1-6 @@ -995,16 +995,12 @@ This commonly includes things such as: (label cfg-19) (suspend) (label cfg-20) - (b! (or (not *target*) (zero? (logand (focus-status mech) (-> *target* focus-status)))) cfg-8 :delay (nop!)) + (b! (or (not *target*) (not (logtest? (focus-status mech) (-> *target* focus-status)))) cfg-8 :delay (nop!)) (b! #t cfg-53 :delay (nop!)) (label cfg-25) ) (when (>= (- (-> self clock frame-counter) (-> self time-limit)) (seconds 10)) - (b! - (not (and *target* (logtest? (focus-status carry) (-> *target* focus-status)))) - cfg-43 - :delay (empty-form) - ) + (b! (not (and *target* (focus-test? *target* carry))) cfg-43 :delay (empty-form)) (when (< (vector-vector-xz-distance (target-pos 0) (new 'static 'vector :x 3881326.5 :y 148090.88 :z -2125870.8 :w 1.0) @@ -1055,7 +1051,7 @@ This commonly includes things such as: (label cfg-53) (b! (not *target*) cfg-58 :likely-delay (set! v1-58 #t)) (set! v1-58 - (or (not s5-0) (zero? (logand (-> s5-0 extra perm status) (entity-perm-status subtask-complete)))) + (or (not s5-0) (not (logtest? (-> s5-0 extra perm status) (entity-perm-status subtask-complete)))) ) ) (label cfg-58) diff --git a/goal_src/jak2/levels/ruins/ruins-scenes.gc b/goal_src/jak2/levels/ruins/ruins-scenes.gc index 16f6975516..a06a03f052 100644 --- a/goal_src/jak2/levels/ruins/ruins-scenes.gc +++ b/goal_src/jak2/levels/ruins/ruins-scenes.gc @@ -1413,7 +1413,7 @@ Touching it flips the `play?` field which will trigger the cutscene" ) ) (('touch 'attack) - (when (and (not (-> self play?)) *target* (zero? (logand (focus-status dark) (-> *target* focus-status)))) + (when (and (not (-> self play?)) *target* (not (logtest? (focus-status dark) (-> *target* focus-status)))) (set! (-> self play?) #t) (process-spawn scene-player :init scene-player-init "ruins-tower-victory" #t #f) ) @@ -1429,7 +1429,7 @@ Touching it flips the `play?` field which will trigger the cutscene" ) (if (and (and *target* (and (>= 122880.0 (vector-vector-distance (-> self root trans) (-> *target* control trans))) - (zero? (logand (focus-status teleporting) (-> *target* focus-status))) + (not (logtest? (focus-status teleporting) (-> *target* focus-status))) ) ) (< (fabs (- (-> self root trans y) (-> *target* control trans y))) 40960.0) diff --git a/goal_src/jak2/levels/sewer/hal2-course.gc b/goal_src/jak2/levels/sewer/hal2-course.gc index 93151f6a02..13bd09923c 100644 --- a/goal_src/jak2/levels/sewer/hal2-course.gc +++ b/goal_src/jak2/levels/sewer/hal2-course.gc @@ -195,7 +195,7 @@ ) ) ) - (if (and a3-2 (zero? (logand (-> (the-as process-focusable a3-2) focus-status) (focus-status dead)))) + (if (and a3-2 (not (logtest? (-> (the-as process-focusable a3-2) focus-status) (focus-status dead)))) (return #f) ) ) @@ -1853,7 +1853,7 @@ ) (else (let ((a0-11 *target*)) - (if (and a0-11 (logtest? (-> a0-11 focus-status) (focus-status hit))) + (if (and a0-11 (focus-test? a0-11 hit)) (logior! (-> arg1 waypoint-bits) 1) ) ) @@ -2288,7 +2288,7 @@ ) ) ) - (when (and s5-0 s4-0 (zero? (logand (bot-flags bf22 bf23) (-> arg1 bot-flags)))) + (when (and s5-0 s4-0 (not (logtest? (bot-flags bf22 bf23) (-> arg1 bot-flags)))) (ai-task-control-method-12 (-> arg1 ai-ctrl) arg1) (go-to-waypoint! arg1 29 #f) (ai-task-control-method-10 (-> arg1 ai-ctrl) arg1) @@ -2646,7 +2646,7 @@ (when (and (not (speech-playing? arg1 47)) (not (channel-active? arg1 (the-as uint 0))) s4-0 - (logtest? (-> (the-as process-focusable s4-0) focus-status) (focus-status touch-water)) + (focus-test? (the-as process-focusable s4-0) touch-water) ) (play-speech arg1 47) (play-speech arg1 48) @@ -2988,10 +2988,7 @@ (set! (-> arg1 waypoint-time0) (-> pp clock frame-counter)) (when (not (channel-active? arg1 (the-as uint 0))) (let ((v1-22 *target*)) - (when (and v1-22 - (logtest? (-> v1-22 focus-status) (focus-status in-air)) - (zero? (logand (-> v1-22 focus-status) (focus-status hit))) - ) + (when (and v1-22 (focus-test? v1-22 in-air) (not (logtest? (-> v1-22 focus-status) (focus-status hit)))) (cond ((not (speech-playing? arg1 58)) (play-speech arg1 58) @@ -3219,10 +3216,7 @@ (set! (-> arg1 waypoint-time0) (-> pp clock frame-counter)) (when (not (channel-active? arg1 (the-as uint 0))) (let ((v1-22 *target*)) - (when (and v1-22 - (logtest? (-> v1-22 focus-status) (focus-status in-air)) - (zero? (logand (-> v1-22 focus-status) (focus-status hit))) - ) + (when (and v1-22 (focus-test? v1-22 in-air) (not (logtest? (-> v1-22 focus-status) (focus-status hit)))) (cond ((not (speech-playing? arg1 64)) (play-speech arg1 64) diff --git a/goal_src/jak2/levels/sewer/hosehead.gc b/goal_src/jak2/levels/sewer/hosehead.gc index adf006ec72..3aadc57e36 100644 --- a/goal_src/jak2/levels/sewer/hosehead.gc +++ b/goal_src/jak2/levels/sewer/hosehead.gc @@ -1980,7 +1980,7 @@ (go-virtual attack) ) (cond - ((logtest? (-> self focus-status) (focus-status touch-water under-water)) + ((focus-test? self touch-water under-water) (set! (-> self next-lazer-time) 0) 0 ) diff --git a/goal_src/jak2/levels/sewer/sewer-obs2.gc b/goal_src/jak2/levels/sewer/sewer-obs2.gc index 2b11938875..7ff2a8d094 100644 --- a/goal_src/jak2/levels/sewer/sewer-obs2.gc +++ b/goal_src/jak2/levels/sewer/sewer-obs2.gc @@ -311,10 +311,7 @@ For example for an elevator pre-compute the distance between the first and last ) ) (set-height! *ocean-map-sewer* (+ (-> self water-height) f28-0)) - (if (and *target* - (logtest? (focus-status board) (-> *target* focus-status)) - (logtest? (-> *target* focus-status) (focus-status touch-water)) - ) + (if (and *target* (focus-test? *target* board) (focus-test? *target* touch-water)) (+! (-> *target* control trans y) (- f28-0 f30-0)) ) ) @@ -840,7 +837,7 @@ This commonly includes things such as: (set! (-> attack-info vector quad) (-> a0-4 quad)) (set! (-> attack-info shove-back) 20480.0) (set! (-> attack-info shove-up) 12288.0) - (set! (-> attack-info control) (if (logtest? (focus-status board) (-> focus-proc focus-status)) + (set! (-> attack-info control) (if (focus-test? focus-proc board) 1.0 0.0 ) diff --git a/goal_src/jak2/levels/stadium/jetboard/skatea-obs.gc b/goal_src/jak2/levels/stadium/jetboard/skatea-obs.gc index 490b212058..cb82330dc0 100644 --- a/goal_src/jak2/levels/stadium/jetboard/skatea-obs.gc +++ b/goal_src/jak2/levels/stadium/jetboard/skatea-obs.gc @@ -318,7 +318,7 @@ (set! (-> self last-sound-id) (add-process *gui-control* self (gui-channel sig) (gui-action play) "kei001" -99.0 0) ) - (while (or (not *target*) (zero? (logand (focus-status board) (-> *target* focus-status)))) + (while (or (not *target*) (not (logtest? (focus-status board) (-> *target* focus-status)))) (if (= (get-status *gui-control* (-> self last-sound-id)) (gui-status unknown)) (send-event (handle->process (-> self voicebox)) 'speak-effect #f) ) diff --git a/goal_src/jak2/levels/stadium/stadium-obs.gc b/goal_src/jak2/levels/stadium/stadium-obs.gc index f3989edcc5..576ec63974 100644 --- a/goal_src/jak2/levels/stadium/stadium-obs.gc +++ b/goal_src/jak2/levels/stadium/stadium-obs.gc @@ -405,10 +405,10 @@ This commonly includes things such as: (collide-action no-standon) (collide-action) ) - (zero? (logand (-> self root-override-2 penetrated-by) + (not (logtest? (-> self root-override-2 penetrated-by) (-> (the-as collide-shape (-> (the-as process-drawable s4-1) root)) penetrate-using) ) - ) + ) ) (send-shoves (-> self root-override-2) arg0 (the-as touching-shapes-entry gp-1) 0.7 6144.0 16384.0) ) diff --git a/goal_src/jak2/levels/strip/strip-obs.gc b/goal_src/jak2/levels/strip/strip-obs.gc index 9779f4e1b7..5a644cff95 100644 --- a/goal_src/jak2/levels/strip/strip-obs.gc +++ b/goal_src/jak2/levels/strip/strip-obs.gc @@ -92,7 +92,7 @@ (set! (-> v1-13 vector quad) (-> s4-1 quad)) (set! (-> v1-13 shove-back) (-> self shove-vec z)) (set! (-> v1-13 shove-up) (-> self shove-vec y)) - (set! (-> v1-13 control) (if (logtest? (focus-status board) (-> gp-0 focus-status)) + (set! (-> v1-13 control) (if (focus-test? gp-0 board) 1.0 0.0 ) @@ -1148,8 +1148,7 @@ This commonly includes things such as: ) (defmethod draw-laser-sight grenade ((obj grenade)) - "TODO - confirm If applicable, draw the laser sight particles -:virtual" + "TODO - confirm If applicable, draw the laser sight particles" (let ((gp-0 (get-process *default-dead-pool* part-tracker #x4000))) (when gp-0 (let ((t9-1 (method-of-type part-tracker activate))) @@ -1416,8 +1415,7 @@ This commonly includes things such as: ) (defmethod init-proj-settings! grenade ((obj grenade)) - "Init relevant settings for the [[projectile]] such as gravity, speed, timeout, etc -:virtual" + "Init relevant settings for the [[projectile]] such as gravity, speed, timeout, etc" (with-pp (initialize-skeleton obj @@ -1518,7 +1516,7 @@ This commonly includes things such as: (set! (-> self hud-timer) (ppointer->handle (process-spawn hud-timer :init hud-init-by-other :to *target*))) (set! (-> self hud-counter) (ppointer->handle (process-spawn hud-plasmite :init hud-init-by-other :to self))) (while (or (< (- (-> self clock frame-counter) (-> self start-time)) (-> self total-time)) - (and *target* (logtest? (-> *target* focus-status) (focus-status in-air))) + (and *target* (focus-test? *target* in-air)) ) (let ((v1-18 (the-as int (- (-> self total-time) (- (-> self clock frame-counter) (-> self start-time)))))) (if (< (the-as time-frame v1-18) 0) diff --git a/goal_src/jak2/levels/temple/mountain-obs.gc b/goal_src/jak2/levels/temple/mountain-obs.gc index 962762713c..dde28bf80c 100644 --- a/goal_src/jak2/levels/temple/mountain-obs.gc +++ b/goal_src/jak2/levels/temple/mountain-obs.gc @@ -514,7 +514,7 @@ (v1-17 (/ (- *dice-offset-x* v1-15) -4)) (a1-31 (/ (- *dice-offset-z* a0-48) -4)) ) - (when (and (< f28-0 f30-0) (zero? (logand (-> *dice-world-array* a1-31) (ash 1 (- 15 v1-17))))) + (when (and (< f28-0 f30-0) (not (logtest? (-> *dice-world-array* a1-31) (ash 1 (- 15 v1-17))))) (set! f30-0 f28-0) (set! s2-0 s1-1) ) @@ -1103,7 +1103,7 @@ (set! sv-544 (/ (- *dice-offset-x* v1-12) -4)) (let ((s0-0 (/ (- *dice-offset-z* a0-14) -4))) (when (and (= (-> gp-0 face-status s2-0) -1) (= (-> gp-0 active) 1)) - (when (and (= (-> gp-0 active) 1) (zero? (logand (-> *dice-blocked-array* s0-0) (ash 1 (- 15 sv-544))))) + (when (and (= (-> gp-0 active) 1) (not (logtest? (-> *dice-blocked-array* s0-0) (ash 1 (- 15 sv-544))))) (when (> *dice-back-way-num* 0) (set! (-> *dice-last-safe-position* quad) (-> *dice-back-way* (+ *dice-back-way-num* -1) quad)) (set! (-> *dice-last-safe-position* y) (+ 8192.0 (-> *dice-last-safe-position* y))) diff --git a/goal_src/jak2/levels/temple/rhino.gc b/goal_src/jak2/levels/temple/rhino.gc index 011b5b77fc..3636d27569 100644 --- a/goal_src/jak2/levels/temple/rhino.gc +++ b/goal_src/jak2/levels/temple/rhino.gc @@ -184,7 +184,69 @@ :default-hit-points 35 :gnd-collide-with (collide-spec backgnd) :overlaps-others-collide-with-filter (collide-spec jak bot player-list) - :penetrate-flinch #xfffffffff5dfffff + :penetrate-flinch (penetrate + touch + generic-attack + lunge + flop + punch + spin + roll + uppercut + bonk + tube + vehicle + flut-attack + board + mech + mech-punch + mech-bonk + dark-skin + dark-punch + dark-bomb + dark-giant + shield + jak-yellow-shot + jak-red-shot + jak-blue-shot + enemy-yellow-shot + eco-yellow + eco-red + eco-blue + eco-green + knocked + penetrate-33 + penetrate-34 + penetrate-35 + penetrate-36 + penetrate-37 + penetrate-38 + penetrate-39 + penetrate-40 + penetrate-41 + penetrate-42 + penetrate-43 + penetrate-44 + penetrate-45 + penetrate-46 + penetrate-47 + penetrate-48 + penetrate-49 + penetrate-50 + penetrate-51 + penetrate-52 + penetrate-53 + penetrate-54 + penetrate-55 + penetrate-56 + penetrate-57 + penetrate-58 + penetrate-59 + penetrate-60 + penetrate-61 + penetrate-62 + penetrate-63 + ) :movement-gravity (meters -100) :friction 0.8 :attack-shove-back (meters 4) @@ -307,7 +369,9 @@ ;; WARN: Return type mismatch none vs object. ;; WARN: rewrite_to_get_var got a none typed variable. Is there unreachable code? [OP: 10] +;; WARN: rewrite_to_get_var got a none typed variable. Is there unreachable code? [OP: 25] ;; WARN: rewrite_to_get_var got a none typed variable. Is there unreachable code? [OP: 30] +;; WARN: rewrite_to_get_var got a none typed variable. Is there unreachable code? [OP: 45] ;; WARN: rewrite_to_get_var got a none typed variable. Is there unreachable code? [OP: 151] ;; WARN: rewrite_to_get_var got a none typed variable. Is there unreachable code? [OP: 216] ;; WARN: rewrite_to_get_var got a none typed variable. Is there unreachable code? [OP: 272] @@ -552,7 +616,7 @@ (when (and (>= (the-as int (-> self focus aware)) (the-as int (-> self charge-aware))) *target* (and (>= 122880.0 (vector-vector-distance (-> self root-override2 trans) (-> *target* control trans))) - (zero? (logand (focus-status teleporting) (-> *target* focus-status))) + (not (logtest? (focus-status teleporting) (-> *target* focus-status))) ) ) (process-entity-status! self (entity-perm-status subtask-complete) #t) @@ -727,13 +791,12 @@ ) (when (and s5-0 v1-0) (cond - ((and (logtest? (-> obj focus-status) (focus-status dangerous)) - ((method-of-type touching-shapes-entry prims-touching-action?) - (the-as touching-shapes-entry s5-0) - (-> obj root-override2) - (collide-action deadly) - (collide-action) - ) + ((and (focus-test? obj dangerous) ((method-of-type touching-shapes-entry prims-touching-action?) + (the-as touching-shapes-entry s5-0) + (-> obj root-override2) + (collide-action deadly) + (collide-action) + ) ) (let ((a3-2 (if ((method-of-type touching-shapes-entry prims-touching-action?) (the-as touching-shapes-entry s5-0) @@ -912,7 +975,7 @@ (vector-vector-xz-distance (get-trans (the-as process-focusable gp-0) 0) (-> self root-override2 trans)) ) (and gp-0 - (zero? (logand (-> (the-as process-focusable gp-0) focus-status) (focus-status disable dead ignore grabbed))) + (not (logtest? (-> (the-as process-focusable gp-0) focus-status) (focus-status disable dead ignore grabbed))) ) ) (goto cfg-25) diff --git a/goal_src/jak2/levels/title/title-obs.gc b/goal_src/jak2/levels/title/title-obs.gc index 2b546dc667..485198e4a7 100644 --- a/goal_src/jak2/levels/title/title-obs.gc +++ b/goal_src/jak2/levels/title/title-obs.gc @@ -521,7 +521,7 @@ ) ((or (logtest? (pad-buttons confirm) (-> *cpad-list* cpads 0 button0-rel 0)) (and (cpad-pressed? 0 start) - (or (not *debug-segment*) (zero? (logand (-> *cpad-list* cpads 0 button0-abs 0) (pad-buttons l3)))) + (or (not *debug-segment*) (not (logtest? (-> *cpad-list* cpads 0 button0-abs 0) (pad-buttons l3)))) ) ) (sound-play "dmenu-pick") diff --git a/goal_src/jak2/levels/undefined/hal.gc b/goal_src/jak2/levels/undefined/hal.gc index 2ac011401e..61057b5474 100644 --- a/goal_src/jak2/levels/undefined/hal.gc +++ b/goal_src/jak2/levels/undefined/hal.gc @@ -471,7 +471,7 @@ ) ) (('end-mode) - (when (logtest? (-> obj focus-status) (focus-status grabbed)) + (when (focus-test? obj grabbed) (logclear! (-> obj focus-status) (focus-status grabbed)) #t ) diff --git a/goal_src/jak2/levels/undefined/ruf-states.gc b/goal_src/jak2/levels/undefined/ruf-states.gc index c1a91926f6..bab177f1fb 100644 --- a/goal_src/jak2/levels/undefined/ruf-states.gc +++ b/goal_src/jak2/levels/undefined/ruf-states.gc @@ -28,7 +28,7 @@ ) :trans (behavior () (bot-method-223 self #f) - (when (not (logtest? (-> self focus-status) (focus-status grabbed))) + (when (not (focus-test? self grabbed)) (cond ((bot-method-214 self) (go-hostile self) @@ -74,7 +74,7 @@ ) :trans (behavior () (bot-method-223 self #f) - (when (not (logtest? (-> self focus-status) (focus-status grabbed))) + (when (not (focus-test? self grabbed)) (cond ((bot-method-214 self) (go-hostile self) @@ -120,7 +120,7 @@ ) :trans (behavior () (bot-method-223 self #f) - (when (not (logtest? (-> self focus-status) (focus-status grabbed))) + (when (not (focus-test? self grabbed)) (cond ((bot-method-214 self) (go-hostile self) @@ -163,7 +163,7 @@ ) :trans (behavior () (bot-method-223 self #f) - (when (not (logtest? (-> self focus-status) (focus-status grabbed))) + (when (not (focus-test? self grabbed)) (cond ((bot-method-214 self) (go-hostile self) @@ -575,7 +575,7 @@ ((not (outside-spot-radius? self (the-as bot-spot #f) (the-as vector #f) #f)) (go-virtual traveling) ) - ((and (not (ruffian-method-243 self)) (zero? (logand (bot-flags bf21) (-> self bot-flags)))) + ((and (not (ruffian-method-243 self)) (not (logtest? (bot-flags bf21) (-> self bot-flags)))) (react-to-focus self) ) ) diff --git a/goal_src/jak2/levels/undefined/ruf-task.gc b/goal_src/jak2/levels/undefined/ruf-task.gc index 8f737f2374..0bd4eaaf76 100644 --- a/goal_src/jak2/levels/undefined/ruf-task.gc +++ b/goal_src/jak2/levels/undefined/ruf-task.gc @@ -47,7 +47,7 @@ (when (and a1-10 (= (-> arg0 focus aware) (enemy-aware enemy-aware-3)) (attacked-by-player? arg0 (the-as process-focusable a1-10)) - (zero? (logand (-> arg0 focus-status) (focus-status grabbed))) + (not (logtest? (-> arg0 focus-status) (focus-status grabbed))) ) (get-task-by-type (-> arg0 ai-ctrl) ruft-fight-focus arg0) (ai-task-control-method-10 (-> arg0 ai-ctrl) arg0) @@ -62,7 +62,7 @@ (if (and a1-1 (= (-> arg0 focus aware) (enemy-aware enemy-aware-3)) (attacked-by-player? arg0 (the-as process-focusable a1-1)) - (zero? (logand (-> arg0 focus-status) (focus-status grabbed))) + (not (logtest? (-> arg0 focus-status) (focus-status grabbed))) ) (logior! (-> arg0 bot-flags) (bot-flags bf00)) (ai-task-control-method-14 (-> arg0 ai-ctrl) obj arg0) @@ -208,7 +208,7 @@ (set! (-> arg0 poi-handle) (ppointer->handle (-> arg0 my-simple-focus))) (if (and (outside-spot-radius? arg0 (the-as bot-spot #f) (the-as vector #f) #f) (and (enemy-method-95 arg0 (the-as vector (-> arg0 course spots (-> obj face-spot-indexes s4-0))) 10012.445) - (zero? (logand (bot-flags bf21) (-> arg0 bot-flags))) + (not (logtest? (bot-flags bf21) (-> arg0 bot-flags))) ) ) (set! (-> arg0 bot-flags) (logior (bot-flags bf20) (-> arg0 bot-flags))) @@ -234,7 +234,7 @@ (when (and a1-17 (= (-> arg0 focus aware) (enemy-aware enemy-aware-3)) (attacked-by-player? arg0 (the-as process-focusable a1-17)) - (zero? (logand (-> arg0 focus-status) (focus-status grabbed))) + (not (logtest? (-> arg0 focus-status) (focus-status grabbed))) ) (get-task-by-type (-> arg0 ai-ctrl) ruft-fight-focus arg0) (ai-task-control-method-10 (-> arg0 ai-ctrl) arg0) diff --git a/goal_src/jak2/levels/underport/centipede.gc b/goal_src/jak2/levels/underport/centipede.gc index 7084b5f29c..c9a0ffe2cf 100644 --- a/goal_src/jak2/levels/underport/centipede.gc +++ b/goal_src/jak2/levels/underport/centipede.gc @@ -551,7 +551,7 @@ (defmethod get-enemy-target centipede ((obj centipede)) "@returns the [[process-focusable]] that the enemy is currently focusing on, or [[#f]] otherwise" (let ((v0-0 (handle->process (-> obj focus handle)))) - (if (and v0-0 (logtest? (-> (the-as process-focusable v0-0) focus-status) (focus-status disable dead grabbed))) + (if (and v0-0 (focus-test? (the-as process-focusable v0-0) disable dead grabbed)) (set! v0-0 (the-as process #f)) ) (the-as process-focusable v0-0) @@ -567,7 +567,7 @@ (dist 28672.0) ) (and (>= (* dist dist) (vector-vector-xz-distance-squared (-> obj root-override2 trans) targ-pos)) - (or (>= y-off -12288.0) (or (>= 24576.0 y-off) (logtest? (-> targ focus-status) (focus-status edge-grab)))) + (or (>= y-off -12288.0) (or (>= 24576.0 y-off) (focus-test? targ edge-grab))) ) ) ) @@ -947,7 +947,7 @@ :trans (behavior () (when (>= (- (-> self clock frame-counter) (-> self state-time)) (seconds 0.5)) (let ((v1-6 (handle->process (-> self focus handle)))) - (if (or (not v1-6) (logtest? (-> (the-as process-focusable v1-6) focus-status) (focus-status dead))) + (if (or (not v1-6) (focus-test? (the-as process-focusable v1-6) dead)) (go-virtual stop-chase) ) ) diff --git a/goal_src/jak2/levels/underport/jellyfish.gc b/goal_src/jak2/levels/underport/jellyfish.gc index e68ab357da..7a123e80c3 100644 --- a/goal_src/jak2/levels/underport/jellyfish.gc +++ b/goal_src/jak2/levels/underport/jellyfish.gc @@ -625,10 +625,7 @@ (set! *jellyfish-mech-reserved* #t) (set! (-> self attach-lerp) 0.0) (let ((gp-0 *target*)) - (if (and gp-0 - (logtest? (focus-status mech) (-> gp-0 focus-status)) - (zero? (logand (-> gp-0 focus-status) (focus-status dead ignore))) - ) + (if (and gp-0 (focus-test? gp-0 mech) (not (logtest? (-> gp-0 focus-status) (focus-status dead ignore)))) (set! (-> self grab-front) (< (vector-dot (vector-z-quaternion! (new 'stack-no-clear 'vector) (-> self root-override2 quat)) @@ -736,10 +733,7 @@ :frame-num 0.0 ) (until (ja-done? 0) - (when (and gp-3 - (logtest? (focus-status mech) (-> gp-3 focus-status)) - (zero? (logand (-> gp-3 focus-status) (focus-status dead ignore))) - ) + (when (and gp-3 (focus-test? gp-3 mech) (not (logtest? (-> gp-3 focus-status) (focus-status dead ignore)))) (let ((a1-13 (new 'stack-no-clear 'event-message-block))) (set! (-> a1-13 from) (process->ppointer self)) (set! (-> a1-13 num-params) 2) @@ -929,14 +923,14 @@ arg0 (handle->process (-> obj focus handle)) ) - (logtest? (focus-status mech) (-> (the-as process-focusable (if arg0 - arg0 - (handle->process (-> obj focus handle)) - ) - ) - focus-status - ) + (focus-test? + (the-as process-focusable (if arg0 + arg0 + (handle->process (-> obj focus handle)) + ) ) + mech + ) (begin (let ((v1-13 #t)) (set! arg0 (cond @@ -975,14 +969,14 @@ arg0 (handle->process (-> obj focus handle)) ) - (logtest? (focus-status mech) (-> (the-as process-focusable (if arg0 - arg0 - (handle->process (-> obj focus handle)) - ) - ) - focus-status - ) + (focus-test? + (the-as process-focusable (if arg0 + arg0 + (handle->process (-> obj focus handle)) + ) ) + mech + ) (begin (let ((v1-11 #t)) (set! arg0 (cond @@ -1146,8 +1140,8 @@ ) (let ((a0-10 (handle->process (-> obj focus handle)))) (when (and a0-10 - (logtest? (focus-status mech) (-> (the-as process-focusable a0-10) focus-status)) - (zero? (logand (-> (the-as process-focusable a0-10) focus-status) (focus-status dead ignore))) + (focus-test? (the-as process-focusable a0-10) mech) + (not (logtest? (-> (the-as process-focusable a0-10) focus-status) (focus-status dead ignore))) ) (set! (-> obj focus-pos quad) (-> (get-trans (the-as process-focusable a0-10) 0) quad)) (set! (-> obj path-player-u) (get-furthest-point-on-path (-> obj path) (-> obj focus-pos))) diff --git a/goal_src/jak2/levels/underport/sig5-course.gc b/goal_src/jak2/levels/underport/sig5-course.gc index 0e309e4ed8..7470731dbc 100644 --- a/goal_src/jak2/levels/underport/sig5-course.gc +++ b/goal_src/jak2/levels/underport/sig5-course.gc @@ -71,8 +71,8 @@ "Were we attacked by the player?" (the-as symbol - (and (and arg0 (zero? (logand (-> arg0 focus-status) (focus-status disable dead ignore grabbed)))) - (or (and (logtest? (process-mask enemy) (-> arg0 mask)) (zero? (logand (bot-flags bf26) (-> obj bot-flags)))) + (and (and arg0 (not (logtest? (-> arg0 focus-status) (focus-status disable dead ignore grabbed)))) + (or (and (logtest? (process-mask enemy) (-> arg0 mask)) (not (logtest? (bot-flags bf26) (-> obj bot-flags)))) (and (logtest? (-> arg0 mask) (process-mask target)) (logtest? (-> obj bot-flags) (bot-flags attacked))) ) ) @@ -377,7 +377,7 @@ (none) ) :trans (behavior () - (if (logtest? (-> self focus-status) (focus-status grabbed)) + (if (focus-test? self grabbed) (go-virtual waiting-close) ) (let ((a0-1 (handle->process (-> self focus handle)))) @@ -553,7 +553,7 @@ (with-pp (if (not (and (logtest? (-> arg1 bot-task-bits) 1) *target* - (zero? (logand (-> *target* focus-status) (focus-status dead in-air edge-grab))) + (not (logtest? (-> *target* focus-status) (focus-status dead in-air edge-grab))) ) ) (set! (-> arg1 waypoint-time0) (-> pp clock frame-counter)) @@ -1584,7 +1584,7 @@ (when (send-event arg1 'jump 5 (-> arg1 sig5-course spots 28)) (let ((s5-1 (-> arg1 actor-group 0 data 6 actor))) (when (and (not (channel-active? arg1 (the-as uint 0))) - (or (not s5-1) (zero? (logand (-> s5-1 extra perm status) (entity-perm-status subtask-complete)))) + (or (not s5-1) (not (logtest? (-> s5-1 extra perm status) (entity-perm-status subtask-complete)))) ) (let ((s5-2 18)) (case (get-rand-int arg1 3) @@ -1646,7 +1646,7 @@ ) (when (and (not (logtest? (-> arg1 waypoint-bits) 2)) (>= (- (-> pp clock frame-counter) (-> arg1 waypoint-time0)) (seconds 0.5)) - (zero? (logand (-> arg1 focus-status) (focus-status in-air))) + (not (logtest? (-> arg1 focus-status) (focus-status in-air))) ) (logior! (-> arg1 waypoint-bits) 2) (logior! (-> arg1 enemy-flags) (enemy-flag enable-on-active checking-water)) @@ -1748,7 +1748,7 @@ (with-pp (when (and (not (logtest? (-> arg1 waypoint-bits) 1)) (>= (- (-> pp clock frame-counter) (-> arg1 waypoint-time0)) (seconds 0.5)) - (zero? (logand (-> arg1 focus-status) (focus-status in-air))) + (not (logtest? (-> arg1 focus-status) (focus-status in-air))) ) (logior! (-> arg1 waypoint-bits) 1) (logior! (-> arg1 enemy-flags) (enemy-flag enable-on-active checking-water)) diff --git a/goal_src/jak2/levels/underport/underb-master.gc b/goal_src/jak2/levels/underport/underb-master.gc index ad65317372..f8ebe79e95 100644 --- a/goal_src/jak2/levels/underport/underb-master.gc +++ b/goal_src/jak2/levels/underport/underb-master.gc @@ -203,7 +203,7 @@ (cond ((-> *setting-control* user-current pilot-exit) (let ((a1-2 *target*)) - (when (and a1-2 (logtest? (focus-status mech) (-> a1-2 focus-status))) + (when (and a1-2 (focus-test? a1-2 mech)) (set-setting! 'pilot-exit #f 0 0) (apply-settings *setting-control*) #t @@ -377,7 +377,7 @@ ) ) ) - (if (or (not gp-0) (zero? (logand (-> gp-0 water flags) (water-flags under-water)))) + (if (or (not gp-0) (not (logtest? (-> gp-0 water flags) (water-flags under-water)))) (set! (-> self air-charge-up?) #t) (set! (-> self underwater-time) (-> self clock frame-counter)) ) @@ -430,7 +430,7 @@ ) ) (set! (-> *game-info* air-supply) (fmin 1.0 (-> self air-supply))) - (if (or (and *target* (zero? (logand (focus-status mech) (-> *target* focus-status)))) + (if (or (and *target* (not (logtest? (focus-status mech) (-> *target* focus-status)))) (and (>= (-> self air-supply) 1.0) (>= (- (-> self clock frame-counter) (-> self underwater-time)) (seconds 3)) ) @@ -722,7 +722,7 @@ ) (let ((a1-6 *target*)) (cond - ((and a1-6 (logtest? (focus-status mech) (-> a1-6 focus-status))) + ((and a1-6 (focus-test? a1-6 mech)) (set! (-> self mode) (the-as uint 3)) (let ((a1-8 (new 'stack-no-clear 'event-message-block))) (set! (-> a1-8 from) (process->ppointer self)) @@ -785,7 +785,7 @@ ((-> event param 0) (when (or (zero? v1-1) (= v1-1 5)) (let ((a0-4 *target*)) - (and a0-4 (zero? (logand (focus-status mech) (-> a0-4 focus-status)))) + (and a0-4 (not (logtest? (focus-status mech) (-> a0-4 focus-status)))) ) ) ) @@ -806,7 +806,7 @@ ) (when (and v1-1 a0-1) (if (and (-> a0-1 0 data 0 actor) - (logtest? (focus-status mech) (-> v1-1 focus-status)) + (focus-test? v1-1 mech) (send-event (ppointer->process *underb-master*) 'request 'mech #t) ) (set! (-> self mode) (the-as uint 1)) @@ -849,7 +849,7 @@ ) ((= v1-0 5) (let ((a1-4 *target*)) - (when (or (not a1-4) (zero? (logand (focus-status mech) (-> a1-4 focus-status)))) + (when (or (not a1-4) (not (logtest? (focus-status mech) (-> a1-4 focus-status)))) (set! (-> self mode) (the-as uint 0)) 0 ) @@ -895,7 +895,7 @@ ) :trans (behavior () (when (and (zero? (-> self state-time)) - ;; TODO this always returns false? + ;; TODO remove when gui-control works ;; (= (get-status *gui-control* (the-as sound-id (-> self spooled-sound-id))) (gui-status ready)) ) (set! (-> self state-time) (-> self clock frame-counter)) @@ -924,7 +924,7 @@ ) ) (when gp-0 - (let ((f0-0 (-> (the-as process-drawable gp-0) root trans y))) + (let ((f0-0 (-> (the-as water-anim gp-0) root trans y))) (when (!= f0-0 (-> self up-y)) (let ((f0-4 (seek f0-0 (-> self up-y) (* 12288.0 (-> self clock seconds-per-frame))))) (send-event gp-0 'move-to-y f0-4) @@ -951,7 +951,7 @@ ) ) (when gp-0 - (if (< (- (-> (camera-pos) y) (-> (the-as process-drawable gp-0) root trans y)) 22528.0) + (if (< (- (-> (camera-pos) y) (-> (the-as water-anim gp-0) root trans y)) 22528.0) (goto cfg-11) ) ) @@ -973,7 +973,7 @@ ) ) (when v1-19 - (when (= (-> (the-as process-drawable v1-19) root trans y) (-> self up-y)) + (when (= (-> (the-as water-anim v1-19) root trans y) (-> self up-y)) (persist-with-delay *setting-control* 'interp-time (seconds 0.05) 'interp-time 'abs 0.0 0) (remove-setting! 'entity-name) (send-event (ppointer->process *underb-master*) 'request 'under-warp #t) @@ -1026,7 +1026,7 @@ ) ) (when gp-0 - (let ((f0-0 (-> (the-as process-drawable gp-0) root trans y))) + (let ((f0-0 (-> (the-as water-anim gp-0) root trans y))) (when (!= f0-0 (-> self down-y)) (let ((f0-4 (seek f0-0 (-> self down-y) (* 12288.0 (-> self clock seconds-per-frame))))) (send-event gp-0 'move-to-y f0-4) @@ -1059,7 +1059,7 @@ ) ) (when v1-15 - (if (< (-> (the-as process-drawable v1-15) root trans y) (+ 10240.0 (-> (target-pos 0) y))) + (if (< (-> (the-as water-anim v1-15) root trans y) (+ 10240.0 (-> (target-pos 0) y))) (goto cfg-17) ) ) @@ -1077,7 +1077,7 @@ ) ) (when v1-26 - (when (= (-> (the-as process-drawable v1-26) root trans y) (-> self down-y)) + (when (= (-> (the-as water-anim v1-26) root trans y) (-> self down-y)) (set! (-> self mode) (the-as uint 5)) (send-event (ppointer->process *underb-master*) 'request 'mech #f) (set! (-> self which-reminder?) #f) 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 aa42dd20fb..102e0a74fd 100644 --- a/test/decompiler/reference/jak1/engine/camera/cam-layout_REF.gc +++ b/test/decompiler/reference/jak1/engine/camera/cam-layout_REF.gc @@ -480,7 +480,7 @@ (cond ((and (= gp-0 (-> self cur-volume)) (= *camera-layout-blink* 'volume) - (zero? (logand (-> *display* real-actual-frame-counter) 8)) + (not (logtest? (-> *display* real-actual-frame-counter) 8)) ) ) (else @@ -3560,12 +3560,12 @@ ) ((and (not (logtest? (-> arg0 options) 12)) (logtest? (-> arg0 options) 1) - (zero? (logand (-> *cpad-list* cpads 0 button0-rel 0) (-> arg0 button))) + (not (logtest? (-> *cpad-list* cpads 0 button0-rel 0) (-> arg0 button))) ) #f ) ((and (not (logtest? (-> arg0 options) 13)) - (zero? (logand (-> *cpad-list* cpads 0 button0-abs 0) (-> arg0 button))) + (not (logtest? (-> *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 837fdca534..b44a24b8e3 100644 --- a/test/decompiler/reference/jak1/engine/camera/cam-master_REF.gc +++ b/test/decompiler/reference/jak1/engine/camera/cam-master_REF.gc @@ -73,7 +73,7 @@ (set! (-> self target-height) (-> *CAMERA_MASTER-bank* target-height)) (set! (-> self on-ground) (not (and (logtest? (-> *target* control unknown-surface00 flags) (surface-flags jump)) - (zero? (logand (-> *target* control status) (cshape-moving-flags onsurf))) + (not (logtest? (-> *target* control status) (cshape-moving-flags onsurf))) ) ) ) @@ -107,7 +107,7 @@ ) (cond ((and (logtest? (-> *target* water flags) (water-flags wt12)) - (zero? (logand (-> *target* water flags) (water-flags wt04))) + (not (logtest? (-> *target* water flags) (water-flags wt04))) ) (set! (-> self under-water) 2) ) @@ -337,7 +337,7 @@ ) (cond ((and (logtest? (-> *target* water flags) (water-flags wt12)) - (zero? (logand (-> *target* water flags) (water-flags wt04))) + (not (logtest? (-> *target* water flags) (water-flags wt04))) ) (set! (-> self under-water) 2) ) @@ -409,7 +409,7 @@ ) (set! (-> self on-ground) (not (and (logtest? (-> *target* control unknown-surface00 flags) (surface-flags jump)) - (zero? (logand (-> *target* control status) (cshape-moving-flags onsurf))) + (not (logtest? (-> *target* control status) (cshape-moving-flags onsurf))) ) ) ) @@ -417,7 +417,7 @@ 0.0 (cond ((and (and (logtest? (-> *target* control unknown-surface00 flags) (surface-flags jump)) - (zero? (logand (-> *target* control status) (cshape-moving-flags onsurf))) + (not (logtest? (-> *target* control status) (cshape-moving-flags onsurf))) ) (!= (-> *target* control unknown-surface00 name) 'launch-jump) ) @@ -797,7 +797,7 @@ ) ((and (logtest? (-> self master-options) 4) (not (-> self on-ground)) - (or (not (-> self cam-entity)) (zero? (logand #x20000 (cam-slave-get-flags (-> self cam-entity) 'flags)))) + (or (not (-> self cam-entity)) (not (logtest? #x20000 (cam-slave-get-flags (-> self cam-entity) 'flags)))) ) #f ) 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 4e3093732e..d09115e92f 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 @@ -313,7 +313,7 @@ (when (and (!= arg3 1) (not (cpad-hold? 1 x)) (not (cpad-hold? 1 r1)) - (zero? (logand (-> *cpad-list* cpads 1 button0-abs 0) (pad-buttons r2))) + (not (logtest? (-> *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)) (+! f30-14 (analog-input (the-as int (-> *cpad-list* cpads 1 lefty)) 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 cea2b4852d..721375aa53 100644 --- a/test/decompiler/reference/jak1/engine/camera/cam-states_REF.gc +++ b/test/decompiler/reference/jak1/engine/camera/cam-states_REF.gc @@ -260,7 +260,7 @@ (none) ) :trans (behavior () - (if (or (not (handle->process (-> *camera* pov-handle))) (zero? (logand (-> *camera* master-options) 2))) + (if (or (not (handle->process (-> *camera* pov-handle))) (not (logtest? (-> *camera* master-options) 2))) (cam-slave-go cam-free-floating) ) (none) diff --git a/test/decompiler/reference/jak1/engine/camera/math-camera_REF.gc b/test/decompiler/reference/jak1/engine/camera/math-camera_REF.gc index 717fb9d79a..9283f66da9 100644 --- a/test/decompiler/reference/jak1/engine/camera/math-camera_REF.gc +++ b/test/decompiler/reference/jak1/engine/camera/math-camera_REF.gc @@ -349,7 +349,7 @@ (.add.vf vf28 vf28 vf30) (.max.x.vf vf28 vf28 vf0 :mask #b1000) (.svf (&-> arg0 quad) vf28) - (zero? (logand v1-7 63)) + (not (logtest? v1-7 63)) ) ) @@ -396,7 +396,7 @@ (.max.x.vf vf28 vf28 vf0 :mask #b1000) (vftoi4.xyzw vf28 vf28) (.svf (&-> arg0 quad) vf28) - (zero? (logand v1-7 63)) + (not (logtest? v1-7 63)) ) ) @@ -442,7 +442,7 @@ (.add.vf vf28 vf28 vf30) (.max.x.vf vf28 vf28 vf0 :mask #b1000) (.svf (&-> arg0 quad) vf28) - (zero? (logand v1-7 63)) + (not (logtest? v1-7 63)) (.mov v0-0 vf23) v0-0 ) 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 448188631d..92b6e1f836 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 @@ -26,7 +26,7 @@ ;; WARN: Stack slot offset 36 signed mismatch ;; WARN: Stack slot offset 36 signed mismatch ;; WARN: Stack slot offset 48 signed mismatch -;; WARN: Failed store: (s.q! v1-20 a0-7) at op 72 +;; ERROR: Failed store: (s.q! v1-20 a0-7) at op 72 (defun poly-find-nearest-edge ((arg0 vector) (arg1 (inline-array vector)) (arg2 vector) (arg3 vector)) (local-vars (sv-32 vector) (sv-36 float) (sv-40 int) (sv-48 float) (sv-80 vector)) (set! sv-32 (new 'stack-no-clear 'vector)) @@ -219,7 +219,7 @@ (< 0.3 (fabs (-> arg0 surface-angle))) ) ) - (zero? (logand sv-32 128)) + (not (logtest? sv-32 128)) ) (set! sv-32 (logior sv-32 64)) (set! sv-40 (logior sv-40 128)) @@ -383,7 +383,7 @@ ) (and (< 0.0 (vector-dot (-> arg0 ground-poly-normal) arg2)) (< (- (-> *display* base-frame-counter) (-> arg0 unknown-dword10)) (seconds 0.3)) - (zero? (logand sv-104 32)) + (not (logtest? sv-104 32)) ) ) ) diff --git a/test/decompiler/reference/jak1/engine/collide/collide-touch_REF.gc b/test/decompiler/reference/jak1/engine/collide/collide-touch_REF.gc index 3ef4510728..7ffd9eb4d2 100644 --- a/test/decompiler/reference/jak1/engine/collide/collide-touch_REF.gc +++ b/test/decompiler/reference/jak1/engine/collide/collide-touch_REF.gc @@ -407,7 +407,7 @@ (let ((v1-1 (-> obj head))) (while v1-1 (let ((a0-1 (-> v1-1 prim1 cprim))) - (if (and (logtest? arg1 (-> a0-1 prim-core action)) (zero? (logand arg2 (-> a0-1 prim-core action)))) + (if (and (logtest? arg1 (-> a0-1 prim-core action)) (not (logtest? arg2 (-> a0-1 prim-core action)))) (return v1-1) ) ) @@ -419,7 +419,7 @@ (let ((v1-4 (-> obj head))) (while v1-4 (let ((a0-5 (-> v1-4 prim2 cprim))) - (if (and (logtest? arg1 (-> a0-5 prim-core action)) (zero? (logand arg2 (-> a0-5 prim-core action)))) + (if (and (logtest? arg1 (-> a0-5 prim-core action)) (not (logtest? arg2 (-> a0-5 prim-core action)))) (return v1-4) ) ) 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 20fa25c567..0f7aa79c47 100644 --- a/test/decompiler/reference/jak1/engine/debug/anim-tester_REF.gc +++ b/test/decompiler/reference/jak1/engine/debug/anim-tester_REF.gc @@ -1310,7 +1310,7 @@ ) ) ((= arg0 1) - (return (zero? (logand (-> s5-0 flags) 1))) + (return (not (logtest? (-> s5-0 flags) 1))) ) ((= arg0 4) (cond @@ -2000,7 +2000,7 @@ (v1-143 s3-2) ) "is this node the end of the list. #t = end" - (when (and (not (not (-> v1-143 next))) (zero? (logand (-> s3-2 flags) 1))) + (when (and (not (not (-> v1-143 next))) (not (logtest? (-> s3-2 flags) 1))) (glst-remove (-> (the-as anim-test-sequence s4-0) item-list) (the-as anim-test-seq-item gp-0)) (glst-insert-after (-> (the-as anim-test-sequence s4-0) item-list) s3-2 (the-as anim-test-seq-item gp-0)) (+! (-> arg1 current-index) 1) @@ -2462,7 +2462,7 @@ (set! v0-0 ((the-as (function glst-list int anim-test-seq-item) glst-get-node-by-index) (-> arg0 item-list) s4-0) ) - (when (or (= v0-0 s5-0) (zero? (logand (-> v0-0 flags) 5))) + (when (or (= v0-0 s5-0) (not (logtest? (-> v0-0 flags) 5))) (set! (-> arg0 playing-item) s4-0) (return v0-0) ) diff --git a/test/decompiler/reference/jak1/engine/debug/default-menu_REF.gc b/test/decompiler/reference/jak1/engine/debug/default-menu_REF.gc index c008ffd9ea..857d8754ff 100644 --- a/test/decompiler/reference/jak1/engine/debug/default-menu_REF.gc +++ b/test/decompiler/reference/jak1/engine/debug/default-menu_REF.gc @@ -592,7 +592,7 @@ (if (= arg1 (debug-menu-msg press)) (logxor! (-> v1-0 flags) 1) ) - (zero? (logand (-> v1-0 flags) 1)) + (not (logtest? (-> v1-0 flags) 1)) ) (else #f diff --git a/test/decompiler/reference/jak1/engine/draw/drawable_REF.gc b/test/decompiler/reference/jak1/engine/draw/drawable_REF.gc index 8d3781d1c0..9e503cba31 100644 --- a/test/decompiler/reference/jak1/engine/draw/drawable_REF.gc +++ b/test/decompiler/reference/jak1/engine/draw/drawable_REF.gc @@ -1,5 +1,11 @@ +;;-*-Lisp-*- (in-package goal) +;; definition for function sphere-cull +;; ERROR: Bad vector register dependency: vf16 +;; ERROR: Bad vector register dependency: vf17 +;; ERROR: Bad vector register dependency: vf18 +;; ERROR: Bad vector register dependency: vf19 (defun sphere-cull ((arg0 vector)) (local-vars (v1-0 uint128) (v1-1 uint128) (v1-2 uint128)) (rlet ((acc :class vf) @@ -25,6 +31,11 @@ ) ) +;; definition for function guard-band-cull +;; ERROR: Bad vector register dependency: vf20 +;; ERROR: Bad vector register dependency: vf21 +;; ERROR: Bad vector register dependency: vf22 +;; ERROR: Bad vector register dependency: vf23 (defun guard-band-cull ((arg0 vector)) (local-vars (v1-0 uint128) (v1-1 uint128) (v1-2 uint128)) (rlet ((acc :class vf) @@ -50,6 +61,7 @@ ) ) +;; definition for function sphere-in-view-frustum? (defun sphere-in-view-frustum? ((arg0 sphere)) (local-vars (v1-1 uint128) (v1-2 uint128) (v1-3 uint128)) (rlet ((acc :class vf) @@ -81,6 +93,7 @@ ) ) +;; definition for function line-in-view-frustum? (defun line-in-view-frustum? ((arg0 vector) (arg1 vector)) (local-vars (v1-1 uint128) (v1-2 uint128) (v1-3 uint128) (a0-1 uint128) (a0-2 uint128) (a0-3 uint128)) (rlet ((acc :class vf) @@ -119,6 +132,10 @@ ) ) +;; definition for function vis-cull +;; ERROR: Type Propagation failed: Failed type prop at op 3 ((set! v1 (l.b (+ v1 #x38b0)))): Could not get type of load: (set! v1 (l.b (+ v1 #x38b0))). +;; ERROR: Type analysis failed +;; ERROR: Unsupported inline assembly instruction kind - [addiu a0, a0, 56] (defun vis-cull ((a0-0 int)) (local-vars (v0-0 none) (v1-0 int) (v1-1 int) (v1-2 none) (v1-3 none) (a0-1 none) (a0-2 none) (a1-0 int)) (set! v1-0 #x70000000) @@ -132,6 +149,8 @@ (ret-value v0-0) ) +;; definition for function error-sphere +;; INFO: Return type mismatch int vs none. (defun error-sphere ((arg0 drawable-error) (arg1 string)) (when *artist-error-spheres* (when (vis-cull (-> arg0 id)) @@ -158,60 +177,82 @@ (none) ) +;; definition for method 9 of type drawable (defmethod login drawable ((obj drawable)) obj ) +;; definition for method 10 of type drawable +;; INFO: Return type mismatch int vs none. (defmethod draw drawable ((obj drawable) (arg0 drawable) (arg1 display-frame)) 0 (none) ) +;; definition for method 11 of type drawable +;; INFO: Return type mismatch int vs none. (defmethod collide-with-box drawable ((obj drawable) (arg0 int) (arg1 collide-list)) 0 (none) ) +;; definition for method 12 of type drawable +;; INFO: Return type mismatch int vs none. (defmethod collide-y-probe drawable ((obj drawable) (arg0 int) (arg1 collide-list)) 0 (none) ) +;; definition for method 13 of type drawable +;; INFO: Return type mismatch int vs none. (defmethod collide-ray drawable ((obj drawable) (arg0 int) (arg1 collide-list)) 0 (none) ) +;; definition for method 17 of type drawable +;; INFO: Return type mismatch int vs none. (defmethod collect-ambients drawable ((obj drawable) (arg0 sphere) (arg1 int) (arg2 ambient-list)) 0 (none) ) +;; definition for method 14 of type drawable +;; INFO: Return type mismatch int vs none. (defmethod collect-stats drawable ((obj drawable)) 0 (none) ) +;; definition for method 15 of type drawable +;; INFO: Return type mismatch int vs none. (defmethod debug-draw drawable ((obj drawable) (arg0 drawable) (arg1 display-frame)) 0 (none) ) +;; definition for method 10 of type drawable-error +;; INFO: Return type mismatch drawable-error vs none. (defmethod draw drawable-error ((obj drawable-error) (arg0 drawable-error) (arg1 display-frame)) (error-sphere arg0 (-> arg0 name)) (none) ) +;; definition for method 16 of type drawable (defmethod unpack-vis drawable ((obj drawable) (arg0 (pointer int8)) (arg1 (pointer int8))) arg1 ) +;; definition for symbol *edit-instance*, type string (define *edit-instance* (the-as string #f)) +;; this part is debug only (when *debug-segment* +;; definition for symbol *instance-mem-usage*, type memory-usage-block (define *instance-mem-usage* (new 'debug 'memory-usage-block)) ) +;; definition (debug) for function find-instance-by-name (defun-debug find-instance-by-name ((arg0 string)) (dotimes (s5-0 (-> *level* length)) (let ((v1-3 (-> *level* level s5-0))) @@ -248,6 +289,7 @@ (the-as prototype-bucket #f) ) +;; definition (debug) for function find-instance-by-index (defun-debug find-instance-by-index ((arg0 type) (arg1 int) (arg2 bsp-header)) (dotimes (v1-0 (-> *level* length)) (let ((a3-3 (-> *level* level v1-0))) @@ -284,6 +326,7 @@ (the-as prototype-bucket #f) ) +;; definition (debug) for function prototype-bucket-type (defun-debug prototype-bucket-type ((arg0 prototype-bucket)) (case (-> arg0 geometry 1 type) ((prototype-shrubbery shrubbery) @@ -295,6 +338,7 @@ ) ) +;; definition (debug) for function prototype-bucket-recalc-fields (defun-debug prototype-bucket-recalc-fields ((arg0 prototype-bucket)) (case (prototype-bucket-type arg0) ((instance-shrubbery) @@ -311,6 +355,10 @@ arg0 ) +;; definition (debug) for function draw-instance-info +;; INFO: Used lq/sq +;; INFO: Return type mismatch object vs none. +;; ERROR: Failed load: (set! a2-12 (l.hu (+ a2-11 68))) at op 283 (defun-debug draw-instance-info ((arg0 string)) (local-vars (sv-16 uint) @@ -499,6 +547,9 @@ (none) ) +;; definition for function dma-add-process-drawable +;; INFO: Return type mismatch int vs none. +;; WARN: Function dma-add-process-drawable has a return type of none, but the expression builder found a return statement. (defun dma-add-process-drawable ((arg0 process-drawable) (arg1 draw-control) (arg2 symbol) (arg3 dma-buffer)) (local-vars (v1-37 float) (sv-16 process-drawable)) (rlet ((acc :class vf) @@ -773,22 +824,33 @@ ) ) +;; definition for symbol *hud-lights*, type vu-lights (define *hud-lights* (new 'global 'vu-lights)) +;; failed to figure out what this is: (set-vector! (-> *hud-lights* direction 0) 1.0 0.0 0.0 1.0) +;; failed to figure out what this is: (set-vector! (-> *hud-lights* direction 1) 0.0 1.0 0.0 1.0) +;; failed to figure out what this is: (set-vector! (-> *hud-lights* direction 2) 0.0 0.0 1.0 1.0) +;; failed to figure out what this is: (set-vector! (-> *hud-lights* color 0) 0.0 0.0 0.0 1.0) +;; failed to figure out what this is: (set-vector! (-> *hud-lights* color 1) 0.0 0.0 0.0 1.0) +;; failed to figure out what this is: (set-vector! (-> *hud-lights* color 2) 0.5 0.5 0.5 1.0) +;; failed to figure out what this is: (set-vector! (-> *hud-lights* ambient) 0.5 0.5 0.5 1.0) +;; definition for function dma-add-process-drawable-hud +;; INFO: Used lq/sq +;; 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 (not (logtest? (-> arg1 status) (draw-status hidden no-anim no-skeleton-update))) @@ -811,11 +873,17 @@ (none) ) +;; definition for function add-process-drawable +;; INFO: Return type mismatch symbol vs none. (defun add-process-drawable ((arg0 process-drawable) (arg1 draw-control) (arg2 symbol) (arg3 dma-buffer)) ((-> arg1 dma-add-func) arg0 arg1 arg2 arg3) (none) ) +;; definition for function foreground-engine-execute +;; INFO: Return type mismatch int vs none. +;; ERROR: Unsupported inline assembly instruction kind - [cache dxwbin v1, 0] +;; ERROR: Unsupported inline assembly instruction kind - [cache dxwbin v1, 1] (defun foreground-engine-execute ((arg0 engine) (arg1 display-frame) (arg2 int) (arg3 int)) (let ((s4-0 (-> *display* frames (-> *display* on-screen) frame global-buf base))) (if *debug-segment* @@ -888,6 +956,7 @@ (none) ) +;; definition (debug) for function main-debug-hook (defun-debug main-debug-hook () (when (not (or (= *master-mode* 'menu) (= *master-mode* 'progress))) (execute-connections *debug-engine* #f) @@ -896,12 +965,18 @@ (none) ) +;; definition for symbol *debug-hook*, type (function none) (define *debug-hook* main-debug-hook) +;; definition for symbol *add-sphere*, type symbol (define *add-sphere* #f) +;; definition for symbol *generic-effect-mode*, type int (define *generic-effect-mode* 0) +;; definition for function real-main-draw-hook +;; INFO: Return type mismatch int vs none. +;; ERROR: Failed store: (s.d! (+ (the-as (pointer gs-reg) a0-47) 8) a1-28) at op 332 (defun real-main-draw-hook () (local-vars (a0-74 int) (a0-76 int)) (when *slow-frame-rate* @@ -1246,13 +1321,17 @@ (none) ) +;; definition for function main-draw-hook (defun main-draw-hook () (real-main-draw-hook) (none) ) +;; definition for symbol *draw-hook*, type (function none) (define *draw-hook* main-draw-hook) +;; definition for function debug-init-buffer +;; INFO: Return type mismatch symbol vs none. (defun debug-init-buffer ((arg0 bucket-id) (arg1 gs-zbuf) (arg2 gs-test)) (let* ((t0-0 (-> *display* frames (-> *display* on-screen) frame global-buf)) (v1-3 (-> t0-0 base)) @@ -1299,8 +1378,11 @@ (none) ) +;; definition for symbol *screen-shot*, type symbol (define *screen-shot* #f) +;; definition for function display-frame-start +;; INFO: Return type mismatch display vs none. (defun display-frame-start ((disp display) (new-frame-idx int) (odd-even int)) (set! (-> (the-as vif-bank #x10003c00) err me0) 1) (let ((time-ratio @@ -1391,6 +1473,7 @@ (none) ) +;; definition for function display-frame-finish (defun display-frame-finish ((disp display)) (let* ((this-frame (-> disp frames (-> disp on-screen) frame)) (this-calc-buf (-> this-frame calc-buf)) @@ -1466,11 +1549,12 @@ disp ) +;; definition for function determine-pause-mode (defun determine-pause-mode () (when (and *debug-pause* (= *master-mode* 'pause)) (logclear! (-> *cpad-list* cpads 0 button0-abs 0) (pad-buttons start r2)) (logclear! (-> *cpad-list* cpads 0 button0-rel 0) (pad-buttons start r2)) - (while (and (= *master-mode* 'pause) (zero? (logand (-> *cpad-list* cpads 0 button0-rel 0) (pad-buttons start r2)))) + (while (and (= *master-mode* 'pause) (not (logtest? (-> *cpad-list* cpads 0 button0-rel 0) (pad-buttons start r2)))) (sync-path 0 0) (service-cpads) ) @@ -1495,8 +1579,10 @@ 0 ) +;; definition for symbol *surrogate-dma-buffer*, type dma-buffer (define *surrogate-dma-buffer* (the-as dma-buffer #f)) +;; definition for function display-sync (defun display-sync ((disp display)) (sync-path 0 0) (set! (-> disp frames (-> disp on-screen) frame run-time) @@ -1547,12 +1633,16 @@ (none) ) +;; definition for function swap-display (defun swap-display ((arg0 display)) (display-frame-finish arg0) (display-sync arg0) (none) ) +;; definition (debug) for function marks-cam-restore +;; INFO: Used lq/sq +;; INFO: Return type mismatch symbol vs none. (defun-debug marks-cam-restore () (let ((a0-0 (new-stack-vector0)) (a1-0 (new-stack-matrix0)) @@ -1592,6 +1682,9 @@ (none) ) +;; definition (debug) for function eddie-cam-restore +;; INFO: Used lq/sq +;; INFO: Return type mismatch vector vs none. (defun-debug eddie-cam-restore () (let ((a0-0 (new-stack-vector0)) (a1-0 (new-stack-matrix0)) @@ -1621,6 +1714,9 @@ (none) ) +;; definition (debug) for function gregs-jungle-cam-restore +;; INFO: Used lq/sq +;; INFO: Return type mismatch string vs none. (defun-debug gregs-jungle-cam-restore () (let ((a0-0 (new-stack-vector0)) (a1-0 (new-stack-matrix0)) @@ -1659,6 +1755,9 @@ (none) ) +;; definition (debug) for function gregs-village1-cam-restore +;; INFO: Used lq/sq +;; INFO: Return type mismatch string vs none. (defun-debug gregs-village1-cam-restore () (let ((a0-0 (new-stack-vector0)) (a1-0 (new-stack-matrix0)) @@ -1697,6 +1796,9 @@ (none) ) +;; definition (debug) for function gregs-texture-cam-restore +;; INFO: Used lq/sq +;; INFO: Return type mismatch string vs none. (defun-debug gregs-texture-cam-restore () (let ((a0-0 (new-stack-vector0)) (a1-0 (new-stack-matrix0)) @@ -1735,6 +1837,9 @@ (none) ) +;; definition (debug) for function gregs-texture2-cam-restore +;; INFO: Used lq/sq +;; INFO: Return type mismatch string vs none. (defun-debug gregs-texture2-cam-restore () (let ((a0-0 (new-stack-vector0)) (a1-0 (new-stack-matrix0)) @@ -1773,6 +1878,9 @@ (none) ) +;; definition (debug) for function cave-cam-restore +;; INFO: Used lq/sq +;; INFO: Return type mismatch vector vs none. (defun-debug cave-cam-restore () (let ((a0-0 (new-stack-vector0)) (a1-0 (new-stack-matrix0)) @@ -1802,6 +1910,9 @@ (none) ) +;; definition (debug) for function paals-cam-restore +;; INFO: Used lq/sq +;; INFO: Return type mismatch vector vs none. (defun-debug paals-cam-restore () (let ((a0-0 (new-stack-vector0)) (a1-0 (new-stack-matrix0)) 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 8aedfbe179..e677806b25 100644 --- a/test/decompiler/reference/jak1/engine/draw/process-drawable_REF.gc +++ b/test/decompiler/reference/jak1/engine/draw/process-drawable_REF.gc @@ -1085,7 +1085,7 @@ (defbehavior process-drawable-delay-player process-drawable ((arg0 time-frame)) (while (and *target* (logtest? (-> *target* control unknown-surface00 flags) (surface-flags jump)) - (zero? (logand (-> *target* control status) (cshape-moving-flags onsurf))) + (not (logtest? (-> *target* control status) (cshape-moving-flags onsurf))) ) (suspend) ) diff --git a/test/decompiler/reference/jak1/engine/entity/actor-link-h_REF.gc b/test/decompiler/reference/jak1/engine/entity/actor-link-h_REF.gc index c6e4aa504f..a2502e036b 100644 --- a/test/decompiler/reference/jak1/engine/entity/actor-link-h_REF.gc +++ b/test/decompiler/reference/jak1/engine/entity/actor-link-h_REF.gc @@ -372,7 +372,7 @@ (dotimes (alt-actor-idx alt-actor-count) (let ((a0-3 (entity-actor-lookup (-> arg0 entity) 'alt-actor alt-actor-idx))) (if (or (not a0-3) - (zero? (logand (-> (the-as entity-links (-> a0-3 extra)) perm status) (entity-perm-status complete))) + (not (logtest? (-> (the-as entity-links (-> a0-3 extra)) perm status) (entity-perm-status complete))) ) (+! incomplete-count 1) ) diff --git a/test/decompiler/reference/jak1/engine/entity/entity_REF.gc b/test/decompiler/reference/jak1/engine/entity/entity_REF.gc index 6e36dae8d2..6bf2a47bd9 100644 --- a/test/decompiler/reference/jak1/engine/entity/entity_REF.gc +++ b/test/decompiler/reference/jak1/engine/entity/entity_REF.gc @@ -373,7 +373,6 @@ ) ;; definition for method 2 of type process -;; INFO: this function exists in multiple non-identical object files (defmethod print process ((obj process)) (format #t "#<~A ~S ~A :state ~S :flags " (-> obj type) (-> obj name) (-> obj status) (if (-> obj state) (-> obj state name) @@ -1660,7 +1659,7 @@ ) ) (else - (if (and (-> v1-44 process) (zero? (logand (-> v1-44 perm status) (entity-perm-status bit-3)))) + (if (and (-> v1-44 process) (not (logtest? (-> v1-44 perm status) (entity-perm-status bit-3)))) (kill! (-> v1-44 entity)) ) ) @@ -1683,7 +1682,7 @@ ) ) (else - (when (and (-> s0-0 process) (zero? (logand (-> s0-0 perm status) (entity-perm-status bit-3)))) + (when (and (-> s0-0 process) (not (logtest? (-> s0-0 perm status) (entity-perm-status bit-3)))) (kill! (-> s0-0 entity)) (set! sv-24 (+ sv-24 1)) ) @@ -1713,7 +1712,7 @@ ) ) (else - (if (and (-> v1-84 process) (zero? (logand (-> v1-84 perm status) (entity-perm-status bit-3)))) + (if (and (-> v1-84 process) (not (logtest? (-> v1-84 perm status) (entity-perm-status bit-3)))) (kill! (-> v1-84 entity)) ) ) @@ -1730,7 +1729,7 @@ (let ((s1-1 (-> s4-5 data s2-3))) (cond ((and (< (vector-vector-distance (-> s1-1 trans) sv-16) (-> *ACTOR-bank* birth-dist)) - (zero? (logand (-> s1-1 perm status) (entity-perm-status bit-9 bit-10))) + (not (logtest? (-> s1-1 perm status) (entity-perm-status bit-9 bit-10))) ) (when (not (or (-> s1-1 process) (logtest? (-> s1-1 perm status) (entity-perm-status bit-0 dead)))) (birth! (-> s1-1 entity)) @@ -1741,7 +1740,7 @@ ) ) (else - (if (and (-> s1-1 process) (zero? (logand (-> s1-1 perm status) (entity-perm-status bit-3)))) + (if (and (-> s1-1 process) (not (logtest? (-> s1-1 perm status) (entity-perm-status bit-3)))) (kill! (-> s1-1 entity)) ) ) @@ -1760,7 +1759,7 @@ (set! sv-32 (-> s3-5 data s1-2)) (cond ((and (is-object-visible? s4-2 (-> sv-32 vis-id)) - (zero? (logand (-> sv-32 perm status) (entity-perm-status bit-9 bit-10))) + (not (logtest? (-> sv-32 perm status) (entity-perm-status bit-9 bit-10))) ) (when (not (or (-> sv-32 process) (logtest? (-> sv-32 perm status) (entity-perm-status bit-0 dead)) s0-1)) (birth! (-> sv-32 entity)) @@ -1779,7 +1778,7 @@ ) ) (else - (when (and (-> sv-32 process) (zero? (logand (-> sv-32 perm status) (entity-perm-status bit-3)))) + (when (and (-> sv-32 process) (not (logtest? (-> sv-32 perm status) (entity-perm-status bit-3)))) (kill! (-> sv-32 entity)) (set! sv-24 (+ sv-24 1)) ) diff --git a/test/decompiler/reference/jak1/engine/game/collectables_REF.gc b/test/decompiler/reference/jak1/engine/game/collectables_REF.gc index c660cd04a0..f66bbb488f 100644 --- a/test/decompiler/reference/jak1/engine/game/collectables_REF.gc +++ b/test/decompiler/reference/jak1/engine/game/collectables_REF.gc @@ -410,7 +410,7 @@ ) ) ((and arg2 (and (< (+ 4096.0 (-> *FACT-bank* suck-bounce-dist)) f0-0) - (zero? (logand (-> self flags) (collectable-flags suck))) + (not (logtest? (-> self flags) (collectable-flags suck))) ) ) (go-virtual wait) @@ -599,7 +599,7 @@ ) (set! (-> self base quad) (-> self root-override trans quad)) (if (and (logtest? (-> self fact options) (fact-options can-collect)) - (zero? (logand (-> self flags) (collectable-flags ignore-blue))) + (not (logtest? (-> self flags) (collectable-flags ignore-blue))) ) (go-virtual notice-blue (process->handle *target*)) ) @@ -699,7 +699,7 @@ (set! (-> a1-0 message) 'query) (set! (-> a1-0 param 0) (the-as uint 'powerup)) (set! (-> a1-0 param 1) (the-as uint 3)) - (if (and (not (send-event-function *target* a1-0)) (zero? (logand (-> self flags) (collectable-flags suck)))) + (if (and (not (send-event-function *target* a1-0)) (not (logtest? (-> self flags) (collectable-flags suck)))) (go-virtual wait) ) ) @@ -1577,7 +1577,7 @@ (not *progress-process*) (!= (-> self next-state name) 'pickup) *target* - (zero? (logand (-> *target* state-flags) (state-flags grabbed dying))) + (not (logtest? (-> *target* state-flags) (state-flags grabbed dying))) ) ) ) @@ -1635,7 +1635,7 @@ (loop (let ((f30-0 (vector-vector-distance (-> self base) (target-pos 0)))) (set! f28-0 - (if (and (< f30-0 (-> *FACT-bank* suck-suck-dist)) (zero? (logand (-> self flags) (collectable-flags anim)))) + (if (and (< f30-0 (-> *FACT-bank* suck-suck-dist)) (not (logtest? (-> self flags) (collectable-flags anim)))) (seek f28-0 (the-as float 16384.0) (* 3072.0 (-> *display* seconds-per-frame))) (seek f28-0 (the-as float 0.0) (* 3072.0 (-> *display* seconds-per-frame))) ) @@ -2183,7 +2183,7 @@ (fact-options skip-jump-anim) ) ) - (zero? (logand (-> self fact options) (fact-options skip-jump-anim))) + (not (logtest? (-> self fact options) (fact-options skip-jump-anim))) ) (set! (-> self jump-pos quad) (-> (the-as vector gp-1) quad)) (set! (-> self jump-pos y) (+ 4096.0 (-> self jump-pos y))) @@ -3045,7 +3045,7 @@ (when (-> obj blocker) (logior! (-> obj fact options) (fact-options vent-blocked)) (set! (-> obj block-func) - (lambda ((arg0 vent)) (zero? (logand (-> arg0 blocker extra perm status) (entity-perm-status complete)))) + (lambda ((arg0 vent)) (not (logtest? (-> arg0 blocker extra perm status) (entity-perm-status complete)))) ) ) (set! (-> obj show-particles) #t) diff --git a/test/decompiler/reference/jak1/engine/game/crates_REF.gc b/test/decompiler/reference/jak1/engine/game/crates_REF.gc index 2290c6a611..e537ac9413 100644 --- a/test/decompiler/reference/jak1/engine/game/crates_REF.gc +++ b/test/decompiler/reference/jak1/engine/game/crates_REF.gc @@ -539,7 +539,7 @@ (('flop 'uppercut 'explode 'darkeco 'eco-yellow 'bonk 'racer 'tube 'flut-bonk 'flut-attack) (if (and (logtest? (-> self fact options) (fact-options require-zoomer)) *target* - (zero? (logand (-> *target* control root-prim prim-core action) (collide-action ca-9))) + (not (logtest? (-> *target* control root-prim prim-core action) (collide-action ca-9))) ) (return #f) ) diff --git a/test/decompiler/reference/jak1/engine/game/main_REF.gc b/test/decompiler/reference/jak1/engine/game/main_REF.gc index f54547f7f0..89dc312d34 100644 --- a/test/decompiler/reference/jak1/engine/game/main_REF.gc +++ b/test/decompiler/reference/jak1/engine/game/main_REF.gc @@ -1,10 +1,15 @@ +;;-*-Lisp-*- (in-package goal) +;; definition for function set-letterbox-frames +;; INFO: Return type mismatch time-frame vs none. (defun set-letterbox-frames ((arg0 time-frame)) (set! (-> *game-info* letterbox-time) (+ (-> *display* base-frame-counter) arg0)) (none) ) +;; definition for function letterbox +;; INFO: Return type mismatch pointer vs none. (defun letterbox () (let* ((dma-buf (-> *display* frames (-> *display* on-screen) frame global-buf)) (gp-0 (-> dma-buf base)) @@ -29,6 +34,8 @@ (none) ) +;; definition for function set-blackout-frames +;; INFO: Return type mismatch time-frame vs none. (defun set-blackout-frames ((arg0 time-frame)) (if (zero? arg0) (set! (-> *game-info* blackout-time) (-> *display* base-frame-counter)) @@ -39,6 +46,8 @@ (none) ) +;; definition for function blackout +;; INFO: Return type mismatch pointer vs none. (defun blackout () (let* ((dma-buf (-> *display* frames (-> *display* on-screen) frame global-buf)) (sprite-dma-data (-> dma-buf base)) @@ -62,6 +71,8 @@ (none) ) +;; definition for function paused? +;; INFO: Return type mismatch object vs symbol. (defun paused? () (the-as symbol @@ -71,10 +82,13 @@ ) ) +;; definition for function movie? (defun movie? () (logtest? (-> *kernel-context* prevent-from-run) (process-mask movie)) ) +;; definition for function set-master-mode +;; INFO: Return type mismatch int vs none. (defun set-master-mode ((new-mode symbol)) (set! *master-mode* new-mode) (if *debug-segment* @@ -116,8 +130,10 @@ (none) ) +;; definition for symbol *last-master-mode*, type symbol (define *last-master-mode* 'game) +;; definition for function toggle-pause (defun toggle-pause () (case *master-mode* (('game) @@ -139,7 +155,7 @@ ((and (or (cpad-hold? 0 select) (cpad-hold? 0 r2)) *debug-segment*) 'pause ) - ((and (not *debug-segment*) (zero? (logand (-> *cpad-list* cpads 0 button0-abs 0) (pad-buttons start)))) + ((and (not *debug-segment*) (not (logtest? (-> *cpad-list* cpads 0 button0-abs 0) (pad-buttons start)))) *master-mode* ) ((not (progress-allowed?)) @@ -228,10 +244,13 @@ 0 ) +;; definition for symbol *screen-filter*, type screen-filter (define *screen-filter* (new 'static 'screen-filter :draw? #f :color (new 'static 'rgba :g #x20 :b #x40 :a #x50)) ) +;; definition for method 9 of type screen-filter +;; INFO: Return type mismatch pointer vs none. (defmethod draw screen-filter ((obj screen-filter)) (let* ((buf (-> *display* frames (-> *display* on-screen) frame global-buf)) (gp-0 (-> buf base)) @@ -255,12 +274,16 @@ (none) ) +;; definition for symbol *cheat-temp*, type (pointer int32) (define *cheat-temp* (the-as (pointer int32) (malloc 'global 16))) +;; definition for symbol *master-exit*, type symbol (define *master-exit* #f) +;; definition for symbol *progress-cheat*, type symbol (define *progress-cheat* #f) +;; definition for function main-cheats (defun main-cheats () (when (and (cpad-hold? 0 l3) (or *cheat-mode* (= *kernel-boot-message* 'play))) (when (nonzero? (-> *cpad-list* cpads 0 button0-rel 0)) @@ -910,6 +933,8 @@ 0 ) +;; definition for function display-loop +;; ERROR: Failed store: (s.w! (+ v1-28 16) 0) at op 124 (defbehavior display-loop process () (local-vars (a0-54 int) (a0-56 int) (a0-73 int) (a0-75 int)) (stack-size-set! (-> self main-thread) 512) @@ -1307,6 +1332,7 @@ 0 ) +;; definition for function on (defun on ((arg0 symbol)) (when (not *dproc*) (when (not arg0) @@ -1351,6 +1377,7 @@ ) ) +;; definition for function off (defun off () (stop 'debug) (dotimes (gp-0 (-> *level* length)) diff --git a/test/decompiler/reference/jak1/engine/game/powerups_REF.gc b/test/decompiler/reference/jak1/engine/game/powerups_REF.gc index b489fa5e17..9e9b792bdc 100644 --- a/test/decompiler/reference/jak1/engine/game/powerups_REF.gc +++ b/test/decompiler/reference/jak1/engine/game/powerups_REF.gc @@ -753,7 +753,7 @@ (let ((v1-150 (rand-vu-int-range 3 (+ (-> self node-list length) -1)))) (cond ((and (logtest? (-> self control unknown-surface00 flags) (surface-flags jump)) - (zero? (logand (-> self control status) (cshape-moving-flags onsurf))) + (not (logtest? (-> self control status) (cshape-moving-flags onsurf))) ) (set! (-> *part-id-table* 259 init-specs 4 initial-valuef) 0.0) (set! (-> *part-id-table* 259 init-specs 4 random-rangef) 65536.0) 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 5f5606b16b..bdac48ed68 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 @@ -948,7 +948,7 @@ ((begin (dummy-46 self) (and (not (and (logtest? (-> *target* control unknown-surface00 flags) (surface-flags jump)) - (zero? (logand (-> *target* control status) (cshape-moving-flags onsurf))) + (not (logtest? (-> *target* control status) (cshape-moving-flags onsurf))) ) ) (< (-> (target-pos 0) y) (+ 8192.0 (-> self root-override root-prim prim-core world-sphere y))) diff --git a/test/decompiler/reference/jak1/engine/gfx/shadow/shadow_REF.gc b/test/decompiler/reference/jak1/engine/gfx/shadow/shadow_REF.gc index bdf6d37792..c28a85b780 100644 --- a/test/decompiler/reference/jak1/engine/gfx/shadow/shadow_REF.gc +++ b/test/decompiler/reference/jak1/engine/gfx/shadow/shadow_REF.gc @@ -167,7 +167,7 @@ (!= (-> self control unknown-surface00 mode) 'swim) (!= (-> self control unknown-surface00 mode) 'dive) (!= (-> self next-state name) 'target-flop) - (zero? (logand (-> self draw status) (draw-status hidden no-anim skip-bones))) + (not (logtest? (-> self draw status) (draw-status hidden no-anim skip-bones))) ) (set! (-> self control shadow-pos quad) (-> self control trans quad)) (find-ground-and-draw-shadow 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 a1a38ef4fa..ca6c42729d 100644 --- a/test/decompiler/reference/jak1/engine/gfx/water/water_REF.gc +++ b/test/decompiler/reference/jak1/engine/gfx/water/water_REF.gc @@ -704,10 +704,10 @@ (set! (-> obj bob-offset) (update! (-> obj bob))) (cond ((and (logtest? (-> obj flags) (water-flags wt08)) - (zero? (logand (-> (the-as collide-shape-moving (-> obj process root)) root-prim prim-core action) + (not (logtest? (-> (the-as collide-shape-moving (-> obj process root)) root-prim prim-core action) (collide-action ca-9) ) - ) + ) ) (set! (-> obj real-ocean-offset) (- (ocean-get-height (the-as vector (-> obj bottom))) (-> obj base-height))) (if (not (logtest? (-> obj flags) (water-flags wt09))) @@ -870,8 +870,8 @@ ) (if (and (logtest? (-> obj flags) (water-flags wt04)) (and s4-3 - (zero? (logand (-> (the-as collide-shape-moving (-> obj process root)) status) (cshape-moving-flags on-water)) - ) + (not (logtest? (-> (the-as collide-shape-moving (-> obj process root)) status) (cshape-moving-flags on-water)) + ) ) ) (set! (-> obj bob amp) (* 0.8 (-> obj bob amp))) @@ -903,7 +903,7 @@ (cond ((and (logtest? (-> obj flags) (water-flags wt04)) (logtest? (-> (the-as collide-shape-moving (-> obj process root)) status) (cshape-moving-flags tsurf)) - (zero? (logand (water-flags wt16) (-> obj flags))) + (not (logtest? (water-flags wt16) (-> obj flags))) ) (let ((v1-200 (new 'stack-no-clear 'vector))) (set! (-> v1-200 quad) (-> obj bottom 0 quad)) @@ -911,7 +911,7 @@ (let ((s4-4 (-> obj process root))) (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))) + (not (logtest? (-> (the-as collide-shape-moving s4-4) root-prim prim-core action) (collide-action ca-9))) ) (let ((a1-27 (vector-! (new 'stack-no-clear 'vector) v1-200 (-> s4-4 trans)))) (vector-float*! a1-27 a1-27 (-> *display* frames-per-second)) @@ -922,7 +922,7 @@ ) ) ) - ((and (< (-> obj bottom 0 y) f30-3) (zero? (logand (water-flags wt16) (-> obj flags)))) + ((and (< (-> obj bottom 0 y) f30-3) (not (logtest? (water-flags wt16) (-> obj flags)))) (logior! (-> obj flags) (water-flags wt12)) ) ) @@ -967,10 +967,10 @@ (when (and (logtest? (-> (the-as collide-shape-moving (-> obj process root)) status) (cshape-moving-flags onsurf on-water) ) - (zero? (logand (-> (the-as collide-shape-moving (-> obj process root)) root-prim prim-core action) + (not (logtest? (-> (the-as collide-shape-moving (-> obj process root)) root-prim prim-core action) (collide-action ca-9) ) - ) + ) ) (when (< (-> obj process root trans y) -409.6) (send-event (-> obj process) 'no-look-around (seconds 1.5)) diff --git a/test/decompiler/reference/jak1/engine/nav/navigate_REF.gc b/test/decompiler/reference/jak1/engine/nav/navigate_REF.gc index ccabc29003..e4c7f83525 100644 --- a/test/decompiler/reference/jak1/engine/nav/navigate_REF.gc +++ b/test/decompiler/reference/jak1/engine/nav/navigate_REF.gc @@ -803,9 +803,7 @@ ) ;; definition for method 29 of type nav-mesh -;; WARN: Failed load: (set! vf3 (l.vf a0-4)) at op 42 -;; WARN: Failed load: (set! vf4 (l.vf a1-3)) at op 45 -;; WARN: Failed load: (set! vf5 (l.vf v1-9)) at op 46 +;; ERROR: Failed load: (set! vf3 (l.vf a0-4)) at op 42 (defmethod is-in-mesh? nav-mesh ((obj nav-mesh) (arg0 vector) (arg1 float) (arg2 meters)) (local-vars (v1-10 float)) (rlet ((vf1 :class vf) @@ -940,7 +938,7 @@ ) ) (cond - ((and (-> arg0 next-poly) (zero? (logand (-> arg0 next-poly pat) 1))) + ((and (-> arg0 next-poly) (not (logtest? (-> arg0 next-poly pat) 1))) (set! (-> arg0 current-poly) (-> arg0 next-poly)) ) (else @@ -2185,7 +2183,7 @@ ) (while (!= v1-71 (-> s4-0 alive-list-end)) (let ((s0-3 (the-as collide-shape (-> (the-as connection v1-71) param3)))) - (when (not (or (= s0-3 (-> obj shape)) (zero? (logand arg0 (-> s0-3 root-prim prim-core collide-as))))) + (when (not (or (= s0-3 (-> obj shape)) (not (logtest? arg0 (-> s0-3 root-prim prim-core collide-as))))) (let ((s1-3 obj)) (set! sv-112 s3-0) (when (logtest? (-> s0-3 nav-flags) (nav-flags navf0)) @@ -2706,7 +2704,7 @@ ) (when (or (not (dummy-16 obj arg0)) (logtest? (nav-control-flags navcf17) (-> obj flags)) - (zero? (logand (-> obj flags) (nav-control-flags navcf10))) + (not (logtest? (-> obj flags) (nav-control-flags navcf10))) ) (set! (-> obj flags) (logior (nav-control-flags navcf21) (-> obj flags))) (vector-! (-> obj travel) arg2 (-> arg1 trans)) @@ -2923,7 +2921,7 @@ v1-0 (-> obj current-poly) (-> obj travel) - (zero? (logand (-> obj flags) (nav-control-flags navcf12))) + (not (logtest? (-> obj flags) (nav-control-flags navcf12))) arg0 arg1 ) @@ -3134,7 +3132,7 @@ sv-84 sv-88 (-> obj travel) - (zero? (logand (-> obj flags) (nav-control-flags navcf12))) + (not (logtest? (-> obj flags) (nav-control-flags navcf12))) 204.8 s5-1 ) 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 83dd8e1600..138f59449c 100644 --- a/test/decompiler/reference/jak1/engine/sparticle/sparticle-launcher_REF.gc +++ b/test/decompiler/reference/jak1/engine/sparticle/sparticle-launcher_REF.gc @@ -37,7 +37,6 @@ ) ;; definition for method 3 of type sparticle-launcher -;; INFO: this function exists in multiple non-identical object files ;; INFO: Return type mismatch int vs sparticle-launcher. (defmethod inspect sparticle-launcher ((obj sparticle-launcher)) (format #t "~X: sparticle-launcher~%" obj) @@ -729,7 +728,7 @@ (set! (-> arg2 next-launcher) (the-as basic 0)) (cond ((and (logtest? (-> arg2 flags) (sp-cpuinfo-flag bit12)) - (zero? (logand (-> arg2 flags) (sp-cpuinfo-flag aux-list))) + (not (logtest? (-> arg2 flags) (sp-cpuinfo-flag aux-list))) ) (let ((f20-0 (-> arg3 r-g-b-a x)) (f22-0 (-> arg3 r-g-b-a y)) 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 5108e2d203..780252d9eb 100644 --- a/test/decompiler/reference/jak1/engine/target/logic-target_REF.gc +++ b/test/decompiler/reference/jak1/engine/target/logic-target_REF.gc @@ -935,7 +935,7 @@ (logtest? (-> self control unknown-surface01 flags) (surface-flags no-rotate-toward-transv)) (!= (-> self control unknown-float41) 0.0) ) - (zero? (logand (-> self control unknown-surface01 flags) (surface-flags always-rotate-toward-transv))) + (not (logtest? (-> self control unknown-surface01 flags) (surface-flags always-rotate-toward-transv))) ) (-> self control unknown-vector20) (-> self control transv) @@ -1059,7 +1059,7 @@ ) (when (and (cpad-pressed? (-> self control unknown-cpad-info00 number) triangle) (zero? (-> self control unknown-int40)) - (zero? (logand (-> *kernel-context* prevent-from-run) (process-mask movie))) + (not (logtest? (-> *kernel-context* prevent-from-run) (process-mask movie))) ) (if (and (= (-> self cam-user-mode) 'normal) (logtest? (-> self control unknown-surface00 flags) (surface-flags allow-look-around)) @@ -1078,7 +1078,7 @@ (when (and (= *cheat-mode* 'debug) (cpad-hold? (-> self control unknown-cpad-info00 number) r2) (not *pause-lock*) - (zero? (logand (-> self state-flags) (state-flags grabbed first-person-mode))) + (not (logtest? (-> self state-flags) (state-flags grabbed first-person-mode))) ) (if (!= (-> self next-state name) 'target-falling) (send-event self 'change-mode 'falling) @@ -1125,7 +1125,7 @@ (let ((f0-17 (vector-dot (-> self control dynam gravity-normal) (-> self control transv)))) (if (and (or (logtest? (-> self control unknown-surface01 flags) (surface-flags allow-edge-grab)) (and (= (-> self next-state name) 'target-walk) - (zero? (logand (-> self control status) (cshape-moving-flags onsurf))) + (not (logtest? (-> self control status) (cshape-moving-flags onsurf))) ) ) (< f0-17 0.0) @@ -1190,7 +1190,7 @@ ) (let ((f0-2 (if (and (logtest? (-> self control status) (cshape-moving-flags twall)) - (zero? (logand (-> self control status) (cshape-moving-flags onsurf))) + (not (logtest? (-> self control status) (cshape-moving-flags onsurf))) ) 0.0 (-> self control unknown-float81) @@ -1464,7 +1464,7 @@ (the-as cspace (-> self node-list data)) ) (if (not (and (logtest? (-> self water flags) (water-flags wt12)) - (zero? (logand (-> self water flags) (water-flags wt04))) + (not (logtest? (-> self water flags) (water-flags wt04))) ) ) (set! (-> self control unknown-float30) (- (-> self water base-height) (-> self water swim-height))) 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 909b01d0c5..78bd00149a 100644 --- a/test/decompiler/reference/jak1/engine/target/target-death_REF.gc +++ b/test/decompiler/reference/jak1/engine/target/target-death_REF.gc @@ -113,7 +113,7 @@ (let ((v1-52 (lookup-level-info (-> arg0 level)))) (if (and v1-52 (= (-> *setting-control* current music) (-> v1-52 music-bank)) - (zero? (logand (-> arg0 flags) (continue-flags sage-intro title))) + (not (logtest? (-> arg0 flags) (continue-flags sage-intro title))) ) (remove-setting! 'music-volume) ) @@ -628,8 +628,8 @@ (the-as time-frame (-> *TARGET-bank* stuck-timeout)) ) (not (logtest? (-> self state-flags) (state-flags prevent-attack))) - (zero? (logand (-> self control unknown-surface01 flags) (surface-flags prevent-attacks-during-launch-jump surf08)) - ) + (not (logtest? (-> self control unknown-surface01 flags) (surface-flags prevent-attacks-during-launch-jump surf08)) + ) ) ) (go 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 26fa2dcd80..e6148d32db 100644 --- a/test/decompiler/reference/jak1/engine/target/target-handler_REF.gc +++ b/test/decompiler/reference/jak1/engine/target/target-handler_REF.gc @@ -790,7 +790,7 @@ ) (('loading) (if (not (or (and (logtest? (-> self control unknown-surface00 flags) (surface-flags jump)) - (zero? (logand (-> self control status) (cshape-moving-flags onsurf))) + (not (logtest? (-> self control status) (cshape-moving-flags onsurf))) ) (or (logtest? (-> self water flags) (water-flags wt09)) (logtest? (-> self state-flags) (state-flags dangerous sf02 being-attacked grabbed first-person-mode dying)) @@ -827,7 +827,7 @@ ) (('tube) (if (and (logtest? (-> self control status) (cshape-moving-flags onsurf)) - (zero? (logand (-> self water flags) (water-flags wt09))) + (not (logtest? (-> self water flags) (water-flags wt09))) ) (go target-tube-start (process->handle (the-as process (-> arg3 param 1)))) ) @@ -980,7 +980,7 @@ (-> self control unknown-dword50) (-> self control unknown-dword51) ) - (zero? (logand (-> self state-flags) (state-flags being-attacked dying))) + (not (logtest? (-> self state-flags) (state-flags being-attacked dying))) ) (set! (-> self control unknown-vector52 quad) (-> self control trans quad)) (target-timed-invulnerable (seconds 0.1) self) 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 fcbb251456..78510d0620 100644 --- a/test/decompiler/reference/jak1/engine/target/target-util_REF.gc +++ b/test/decompiler/reference/jak1/engine/target/target-util_REF.gc @@ -821,7 +821,7 @@ (not (-> *setting-control* current movie)) (not (-> *setting-control* current hint)) (not (logtest? (-> self control status) (cshape-moving-flags t-act))) - (zero? (logand (-> self water flags) (water-flags wt09))) + (not (logtest? (-> self water flags) (water-flags wt09))) ) ) @@ -902,7 +902,7 @@ (and (< 0.7 (-> self control touch-angle)) (and (< (-> self control surface-angle) 0.3) (logtest? (-> self control status) (cshape-moving-flags twall)) - (or arg0 (zero? (logand (-> self control status) (cshape-moving-flags t-act)))) + (or arg0 (not (logtest? (-> self control status) (cshape-moving-flags t-act)))) ) ) ) @@ -914,7 +914,7 @@ (>= 0.7 (-> self control touch-angle)) ) (and (< (-> self control unknown-float61) 0.7) - (zero? (logand (-> self state-flags) (state-flags prevent-duck))) + (not (logtest? (-> self state-flags) (state-flags prevent-duck))) ) ) ) diff --git a/test/decompiler/reference/jak1/engine/target/target2_REF.gc b/test/decompiler/reference/jak1/engine/target/target2_REF.gc index bae30af231..e0b4ca6c9c 100644 --- a/test/decompiler/reference/jak1/engine/target/target2_REF.gc +++ b/test/decompiler/reference/jak1/engine/target/target2_REF.gc @@ -1200,7 +1200,7 @@ ) (pad-buttons x) ) - (zero? (logand (-> self state-flags) (state-flags prevent-jump))) + (not (logtest? (-> self state-flags) (state-flags prevent-jump))) ) (cond ((or (< -0.2 (local-pad-angle)) @@ -1646,7 +1646,7 @@ (pad-buttons x) ) (not (logtest? (-> self water flags) (water-flags wt09))) - (zero? (logand (-> self state-flags) (state-flags prevent-jump))) + (not (logtest? (-> self state-flags) (state-flags prevent-jump))) ) (go target-jump (-> *TARGET-bank* jump-height-min) (-> *TARGET-bank* jump-height-max) (the-as surface #f)) ) @@ -2028,7 +2028,7 @@ :trans (behavior () ((-> self state-hook)) (if (and (logtest? (-> self control status) (cshape-moving-flags onsurf)) - (zero? (logand (-> self control status) (cshape-moving-flags on-water))) + (not (logtest? (-> self control status) (cshape-moving-flags on-water))) ) (set-zero! (-> self water bob)) ) @@ -2144,7 +2144,7 @@ :trans (behavior () ((-> self state-hook)) (if (and (logtest? (-> self control status) (cshape-moving-flags onsurf)) - (zero? (logand (-> self control status) (cshape-moving-flags on-water))) + (not (logtest? (-> self control status) (cshape-moving-flags on-water))) ) (set-zero! (-> self water bob)) ) @@ -2415,7 +2415,7 @@ :trans (behavior () (if (and (cpad-pressed? (-> self control unknown-cpad-info00 number) x) (not (logtest? (-> self state-flags) (state-flags prevent-jump))) - (zero? (logand (-> self water flags) (water-flags wt13 wt14))) + (not (logtest? (-> self water flags) (water-flags wt13 wt14))) ) (go target-swim-jump-jump diff --git a/test/decompiler/reference/jak1/engine/target/target_REF.gc b/test/decompiler/reference/jak1/engine/target/target_REF.gc index 5c1b8d2236..3c09a87071 100644 --- a/test/decompiler/reference/jak1/engine/target/target_REF.gc +++ b/test/decompiler/reference/jak1/engine/target/target_REF.gc @@ -94,7 +94,7 @@ ) (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))) + (not (logtest? (-> self state-flags) (state-flags prevent-jump))) ) (go target-jump (-> *TARGET-bank* jump-height-min) (-> *TARGET-bank* jump-height-max) (the-as surface #f)) ) @@ -1458,7 +1458,7 @@ (< (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))) (not (logtest? (-> self water flags) (water-flags wt09))) - (zero? (logand (-> self state-flags) (state-flags prevent-jump))) + (not (logtest? (-> self state-flags) (state-flags prevent-jump))) ) ) (go target-double-jump (-> *TARGET-bank* double-jump-height-min) (-> *TARGET-bank* double-jump-height-max)) @@ -1470,8 +1470,8 @@ (the-as time-frame (-> *TARGET-bank* stuck-timeout)) ) (not (logtest? (-> self state-flags) (state-flags prevent-attack))) - (zero? (logand (-> self control unknown-surface01 flags) (surface-flags prevent-attacks-during-launch-jump surf08)) - ) + (not (logtest? (-> self control unknown-surface01 flags) (surface-flags prevent-attacks-during-launch-jump surf08)) + ) ) ) (go @@ -1593,8 +1593,8 @@ (the-as time-frame (-> *TARGET-bank* stuck-timeout)) ) (not (logtest? (-> self state-flags) (state-flags prevent-attack))) - (zero? (logand (-> self control unknown-surface01 flags) (surface-flags prevent-attacks-during-launch-jump surf08)) - ) + (not (logtest? (-> self control unknown-surface01 flags) (surface-flags prevent-attacks-during-launch-jump surf08)) + ) ) ) (go @@ -1694,8 +1694,8 @@ (the-as time-frame (-> *TARGET-bank* stuck-timeout)) ) (not (logtest? (-> self state-flags) (state-flags prevent-attack))) - (zero? (logand (-> self control unknown-surface01 flags) (surface-flags prevent-attacks-during-launch-jump surf08)) - ) + (not (logtest? (-> self control unknown-surface01 flags) (surface-flags prevent-attacks-during-launch-jump surf08)) + ) ) ) (go @@ -1884,7 +1884,7 @@ ) ) (if (and (< (-> *TARGET-bank* fall-far) f0-1) - (zero? (logand (-> self control status) (cshape-moving-flags on-water))) + (not (logtest? (-> self control status) (cshape-moving-flags on-water))) ) (go target-hit-ground-hard f0-1) ) @@ -2117,7 +2117,7 @@ (when (!= (-> self state-time) (-> *display* base-frame-counter)) (if (and (or (smack-surface? #t) (and (>= (-> self control unknown-float63) 0.7) - (zero? (logand (-> self control status) (cshape-moving-flags t-act))) + (not (logtest? (-> self control status) (cshape-moving-flags t-act))) ) ) (begin @@ -2158,13 +2158,13 @@ (if (and (cpad-pressed? (-> self control unknown-cpad-info00 number) x) (and (< 4096.0 (-> self control unknown-float01)) (or (>= (- (-> *display* base-frame-counter) (-> self state-time)) (seconds 0.1)) - (zero? (logand (-> *cpad-list* cpads (-> self control unknown-cpad-info00 number) button0-abs 0) + (not (logtest? (-> *cpad-list* cpads (-> self control unknown-cpad-info00 number) button0-abs 0) (pad-buttons square) ) - ) + ) ) (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))) + (not (logtest? (-> self control unknown-surface01 flags) (surface-flags prevent-attacks-during-launch-jump))) ) ) (go @@ -2549,8 +2549,8 @@ (the-as time-frame (-> *TARGET-bank* stuck-timeout)) ) (not (logtest? (-> self state-flags) (state-flags prevent-attack))) - (zero? (logand (-> self control unknown-surface01 flags) (surface-flags prevent-attacks-during-launch-jump surf08)) - ) + (not (logtest? (-> self control unknown-surface01 flags) (surface-flags prevent-attacks-during-launch-jump surf08)) + ) ) ) (set-quaternion! (-> self control) (-> self control dir-targ)) 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 431e86c3fb..e0c3f04e0f 100644 --- a/test/decompiler/reference/jak1/engine/ui/hud-classes_REF.gc +++ b/test/decompiler/reference/jak1/engine/ui/hud-classes_REF.gc @@ -1811,7 +1811,7 @@ ) ) ) - (if (and (< 0.0 arg1) (and (< arg1 0.2) (zero? (logand (-> *display* integral-frame-counter) 4)))) + (if (and (< 0.0 arg1) (and (< arg1 0.2) (not (logtest? (-> *display* integral-frame-counter) 4)))) (set! arg3 (* arg3 2)) ) (set! (-> arg5 pos y) (the float arg2)) 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 5207545e12..1c5a28b130 100644 --- a/test/decompiler/reference/jak1/levels/beach/beach-obs_REF.gc +++ b/test/decompiler/reference/jak1/levels/beach/beach-obs_REF.gc @@ -1381,7 +1381,7 @@ ) (ja :group! (-> self draw art-group data 5) :num! max) (while (and (not (task-closed? (game-task beach-flutflut) (task-status need-reward-speech))) - (zero? (logand (-> self ambients-played) 1024)) + (not (logtest? (-> self ambients-played) 1024)) ) (if (play-ambient (-> self ambient) "BIR-AM11" #f (the-as vector #f)) (logior! (-> self ambients-played) 1024) diff --git a/test/decompiler/reference/jak1/levels/common/basebutton_REF.gc b/test/decompiler/reference/jak1/levels/common/basebutton_REF.gc index 992b408edc..6f84af53ce 100644 --- a/test/decompiler/reference/jak1/levels/common/basebutton_REF.gc +++ b/test/decompiler/reference/jak1/levels/common/basebutton_REF.gc @@ -543,7 +543,7 @@ ) (case (-> self level) (('citadel 'lavatube) - (while (and *target* (zero? (logand (-> *target* draw status) (draw-status hidden)))) + (while (and *target* (not (logtest? (-> *target* draw status) (draw-status hidden)))) (suspend) ) ) 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 6ec8c8d278..12143c5b84 100644 --- a/test/decompiler/reference/jak1/levels/common/nav-enemy_REF.gc +++ b/test/decompiler/reference/jak1/levels/common/nav-enemy_REF.gc @@ -36,7 +36,6 @@ ) ;; definition for method 9 of type trajectory -;; INFO: this function exists in multiple non-identical object files (defmethod eval-position! trajectory ((obj trajectory) (time float) (result vector)) (vector+float*! result (-> obj initial-position) (-> obj initial-velocity) time) (+! (-> result y) (* 0.5 time time (-> obj gravity))) @@ -540,10 +539,10 @@ nav-enemy-default-event-handler (the-as symbol (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) ) - ) + ) ) ) ) diff --git a/test/decompiler/reference/jak1/levels/common/plat-button_REF.gc b/test/decompiler/reference/jak1/levels/common/plat-button_REF.gc index 9825fe4110..c4d0a2e1f7 100644 --- a/test/decompiler/reference/jak1/levels/common/plat-button_REF.gc +++ b/test/decompiler/reference/jak1/levels/common/plat-button_REF.gc @@ -217,7 +217,7 @@ (when (or (not *target*) (and (>= (- (-> *display* base-frame-counter) (-> self state-time)) (seconds 4)) (not (and (logtest? (-> *target* control unknown-surface00 flags) (surface-flags jump)) - (zero? (logand (-> *target* control status) (cshape-moving-flags onsurf))) + (not (logtest? (-> *target* control status) (cshape-moving-flags onsurf))) ) ) ) @@ -292,7 +292,7 @@ (when (or (not *target*) (and (>= (- (-> *display* base-frame-counter) (-> self state-time)) (seconds 4)) (not (and (logtest? (-> *target* control unknown-surface00 flags) (surface-flags jump)) - (zero? (logand (-> *target* control status) (cshape-moving-flags onsurf))) + (not (logtest? (-> *target* control status) (cshape-moving-flags onsurf))) ) ) ) diff --git a/test/decompiler/reference/jak1/levels/finalboss/robotboss_REF.gc b/test/decompiler/reference/jak1/levels/finalboss/robotboss_REF.gc index 49b6f19096..64fc1a7e37 100644 --- a/test/decompiler/reference/jak1/levels/finalboss/robotboss_REF.gc +++ b/test/decompiler/reference/jak1/levels/finalboss/robotboss_REF.gc @@ -49,7 +49,7 @@ (robotboss-cut-cam-exit) ) ((or (and (logtest? (-> *target* control unknown-surface00 flags) (surface-flags jump)) - (zero? (logand (-> *target* control status) (cshape-moving-flags onsurf))) + (not (logtest? (-> *target* control status) (cshape-moving-flags onsurf))) ) (-> self skip-cut) ) @@ -2398,10 +2398,10 @@ (when (and arg1 (nonzero? (-> self looping-sound 0))) (update! (-> self looping-sound 0)) (when (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) ) - ) + ) ) (let ((t2-0 (new 'stack-no-clear 'collide-tri-result)) (a2-0 (new 'stack-no-clear 'vector)) 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 e5a1272c94..53ad81aff2 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 @@ -870,8 +870,8 @@ (the-as time-frame (-> *TARGET-bank* stuck-timeout)) ) (not (logtest? (-> self state-flags) (state-flags prevent-attack))) - (zero? (logand (-> self control unknown-surface01 flags) (surface-flags prevent-attacks-during-launch-jump surf08)) - ) + (not (logtest? (-> self control unknown-surface01 flags) (surface-flags prevent-attacks-during-launch-jump surf08)) + ) ) ) (go target-flut-air-attack (-> *FLUT-bank* air-attack-speed)) @@ -1304,7 +1304,7 @@ (when (!= (-> self state-time) (-> *display* base-frame-counter)) (if (and (or (smack-surface? #t) (and (>= (-> self control unknown-float63) 0.7) - (zero? (logand (-> self control status) (cshape-moving-flags t-act))) + (not (logtest? (-> self control status) (cshape-moving-flags t-act))) ) ) (begin 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 059dfbb672..1d7552e866 100644 --- a/test/decompiler/reference/jak1/levels/jungle/jungle-mirrors_REF.gc +++ b/test/decompiler/reference/jak1/levels/jungle/jungle-mirrors_REF.gc @@ -1168,7 +1168,7 @@ (lambda ((arg0 entity-actor) (arg1 (pointer symbol))) (the-as object - (when (and (= (-> arg0 etype) periscope) (zero? (logand (-> arg0 extra perm status) (entity-perm-status complete)))) + (when (and (= (-> arg0 etype) periscope) (not (logtest? (-> arg0 extra perm status) (entity-perm-status complete)))) (set! (-> arg1 0) #f) #t ) @@ -1396,7 +1396,7 @@ (case event-type (('touch) (when (and *target* (not (and (logtest? (-> *target* control unknown-surface00 flags) (surface-flags jump)) - (zero? (logand (-> *target* control status) (cshape-moving-flags onsurf))) + (not (logtest? (-> *target* control status) (cshape-moving-flags onsurf))) ) ) ) diff --git a/test/decompiler/reference/jak1/levels/jungle/junglesnake_REF.gc b/test/decompiler/reference/jak1/levels/jungle/junglesnake_REF.gc index e864383af7..a65759c31b 100644 --- a/test/decompiler/reference/jak1/levels/jungle/junglesnake_REF.gc +++ b/test/decompiler/reference/jak1/levels/jungle/junglesnake_REF.gc @@ -152,10 +152,10 @@ ) (cond ((and (-> self is-lethal?) - (zero? (logand (-> *target* state-flags) + (not (logtest? (-> *target* state-flags) (state-flags being-attacked invulnerable timed-invulnerable invuln-powerup do-not-notice dying) ) - ) + ) ) (when (send-event arg0 'attack (-> arg3 param 0) (new 'static 'attack-info)) (let ((v0-1 (the-as object #t))) @@ -447,10 +447,10 @@ junglesnake-default-event-handler :trans (behavior () (if (and (and *target* (>= 24576.0 (vector-vector-distance (-> self root-override trans) (-> *target* control trans)))) (>= (- (-> *display* base-frame-counter) (-> self state-time)) (-> self refractory-delay)) - (zero? (logand (-> *target* state-flags) + (not (logtest? (-> *target* state-flags) (state-flags being-attacked invulnerable timed-invulnerable invuln-powerup do-not-notice dying) ) - ) + ) ) (go junglesnake-attack) ) diff --git a/test/decompiler/reference/jak1/levels/jungleb/plant-boss_REF.gc b/test/decompiler/reference/jak1/levels/jungleb/plant-boss_REF.gc index d48e5a5f99..328cab1dcc 100644 --- a/test/decompiler/reference/jak1/levels/jungleb/plant-boss_REF.gc +++ b/test/decompiler/reference/jak1/levels/jungleb/plant-boss_REF.gc @@ -1179,10 +1179,10 @@ ) ) *target* - (zero? (logand (-> *target* state-flags) + (not (logtest? (-> *target* state-flags) (state-flags being-attacked invulnerable timed-invulnerable invuln-powerup do-not-notice dying) ) - ) + ) ) (go plant-boss-attack 1) ) diff --git a/test/decompiler/reference/jak1/levels/maincave/maincave-obs_REF.gc b/test/decompiler/reference/jak1/levels/maincave/maincave-obs_REF.gc index eb1a780b31..2a8330136d 100644 --- a/test/decompiler/reference/jak1/levels/maincave/maincave-obs_REF.gc +++ b/test/decompiler/reference/jak1/levels/maincave/maincave-obs_REF.gc @@ -318,10 +318,10 @@ (< 28672.0 (vector-vector-distance (-> self root-override trans) (-> *target* control trans))) ) (and (not (and (logtest? (-> *target* control unknown-surface00 flags) (surface-flags jump)) - (zero? (logand (-> *target* control status) (cshape-moving-flags onsurf))) + (not (logtest? (-> *target* control status) (cshape-moving-flags onsurf))) ) ) - (zero? (logand (-> *target* control root-prim prim-core action) (collide-action ca-7))) + (not (logtest? (-> *target* control root-prim prim-core action) (collide-action ca-7))) ) ) (ja-no-eval :group! (-> self draw art-group data 7) :num! (seek!) :frame-num 0.0) @@ -335,7 +335,7 @@ (until (ja-done? 0) (when (and (and *target* (>= 28672.0 (vector-vector-distance (-> self root-override trans) (-> *target* control trans)))) (or (and (logtest? (-> *target* control unknown-surface00 flags) (surface-flags jump)) - (zero? (logand (-> *target* control status) (cshape-moving-flags onsurf))) + (not (logtest? (-> *target* control status) (cshape-moving-flags onsurf))) ) (logtest? (-> *target* control root-prim prim-core action) (collide-action ca-7)) ) diff --git a/test/decompiler/reference/jak1/levels/maincave/mother-spider-proj_REF.gc b/test/decompiler/reference/jak1/levels/maincave/mother-spider-proj_REF.gc index 3dcc5dc1b4..3b52b13fa2 100644 --- a/test/decompiler/reference/jak1/levels/maincave/mother-spider-proj_REF.gc +++ b/test/decompiler/reference/jak1/levels/maincave/mother-spider-proj_REF.gc @@ -363,10 +363,10 @@ ;; INFO: Return type mismatch vector vs none. (defmethod dummy-28 mother-spider-proj ((obj mother-spider-proj)) (when (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) ) - ) + ) ) (let ((gp-0 (-> obj target))) (set! (-> gp-0 quad) (-> (target-pos 0) quad)) 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 23d6174ad7..298f5ec09e 100644 --- a/test/decompiler/reference/jak1/levels/maincave/mother-spider_REF.gc +++ b/test/decompiler/reference/jak1/levels/maincave/mother-spider_REF.gc @@ -369,7 +369,7 @@ ;; definition for method 31 of type mother-spider (defmethod is-player-stuck? mother-spider ((obj mother-spider)) (when (and *target* (not (and (logtest? (-> *target* control unknown-surface00 flags) (surface-flags jump)) - (zero? (logand (-> *target* control status) (cshape-moving-flags onsurf))) + (not (logtest? (-> *target* control status) (cshape-moving-flags onsurf))) ) ) ) @@ -1071,7 +1071,7 @@ ) ) (if (or (not *target*) (and (logtest? (-> *target* control unknown-surface00 flags) (surface-flags jump)) - (zero? (logand (-> *target* control status) (cshape-moving-flags onsurf))) + (not (logtest? (-> *target* control status) (cshape-moving-flags onsurf))) ) ) (set! (-> self last-player-in-air-time) (-> *display* base-frame-counter)) @@ -1263,10 +1263,10 @@ (go mother-spider-traveling (the-as uint 0)) ) (if (and (>= (- (-> *display* base-frame-counter) (-> self started-birthing-time)) (seconds 6)) - (zero? (logand (-> *target* state-flags) + (not (logtest? (-> *target* state-flags) (state-flags being-attacked invulnerable timed-invulnerable invuln-powerup do-not-notice dying) ) - ) + ) ) (go mother-spider-traveling (the-as uint 1)) ) diff --git a/test/decompiler/reference/jak1/levels/misty/babak-with-cannon_REF.gc b/test/decompiler/reference/jak1/levels/misty/babak-with-cannon_REF.gc index d093003c2d..8f58ecef89 100644 --- a/test/decompiler/reference/jak1/levels/misty/babak-with-cannon_REF.gc +++ b/test/decompiler/reference/jak1/levels/misty/babak-with-cannon_REF.gc @@ -433,7 +433,7 @@ nav-enemy-default-event-handler (set! (-> obj cannon-ent) (entity-actor-lookup (-> obj entity) 'alt-actor 0)) (logclear! (-> obj mask) (process-mask actor-pause)) (if (or (not (and (-> obj entity) (logtest? (-> obj entity extra perm status) (entity-perm-status complete)))) - (zero? (logand (-> obj enemy-info options) (fact-options has-power-cell))) + (not (logtest? (-> obj enemy-info options) (fact-options has-power-cell))) ) (go (method-of-object obj nav-enemy-idle)) ) diff --git a/test/decompiler/reference/jak1/levels/ogre/flying-lurker_REF.gc b/test/decompiler/reference/jak1/levels/ogre/flying-lurker_REF.gc index 5d0c3a5a26..a45f9c72f0 100644 --- a/test/decompiler/reference/jak1/levels/ogre/flying-lurker_REF.gc +++ b/test/decompiler/reference/jak1/levels/ogre/flying-lurker_REF.gc @@ -902,7 +902,7 @@ (close-specific-task! (game-task plunger-lurker-hit) (task-status unknown)) (while (and *target* (logtest? (-> *target* control unknown-surface00 flags) (surface-flags jump)) - (zero? (logand (-> *target* control status) (cshape-moving-flags onsurf))) + (not (logtest? (-> *target* control status) (cshape-moving-flags onsurf))) ) (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 5ee32fb224..624520be52 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 @@ -121,7 +121,7 @@ ) (and (< 0.0 (vector-dot (-> arg0 ground-poly-normal) arg2)) (< (- (-> *display* base-frame-counter) (-> arg0 unknown-dword10)) (seconds 0.3)) - (zero? (logand sv-104 32)) + (not (logtest? sv-104 32)) ) ) ) @@ -153,7 +153,7 @@ (else (set! sv-96 (logior sv-96 1)) (set! (-> arg0 cur-pat mode) 0) - (if (and (= (-> arg1 best-from-prim prim-id) 6) (zero? (logand sv-104 7))) + (if (and (= (-> arg1 best-from-prim prim-id) 6) (not (logtest? sv-104 7))) (set! (-> arg0 local-normal quad) (-> sv-84 quad)) ) (vector-reflect-flat! arg2 (-> sv-88 0) sv-84) 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 31e55fa18a..8d6b4a7952 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 @@ -125,7 +125,7 @@ (let ((f0-1 (/ (-> *target* racer heat) (-> *RACER-bank* heat-max)))) (set! (-> arg2 vector 1 z) (* 182.04445 (+ -45.0 (* 215.0 f0-1)))) (cond - ((and (< 0.8 f0-1) (zero? (logand (-> *display* integral-frame-counter) 8))) + ((and (< 0.8 f0-1) (not (logtest? (-> *display* integral-frame-counter) 8))) (set! (-> arg2 vector 2 x) 128.0) (set! (-> arg2 vector 2 y) 0.0) (set! (-> arg2 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 c5cf4bf0f5..cc41ebec7a 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 @@ -1073,7 +1073,7 @@ (until v1-154 (suspend) (set! v1-154 (and (>= (- (-> *display* base-frame-counter) (-> self state-time)) (seconds 1)) - (zero? (logand (-> *kernel-context* prevent-from-run) (process-mask movie))) + (not (logtest? (-> *kernel-context* prevent-from-run) (process-mask movie))) ) ) ) diff --git a/test/decompiler/reference/jak1/levels/racer_common/racer_REF.gc b/test/decompiler/reference/jak1/levels/racer_common/racer_REF.gc index 143309c6ab..587c53b9a1 100644 --- a/test/decompiler/reference/jak1/levels/racer_common/racer_REF.gc +++ b/test/decompiler/reference/jak1/levels/racer_common/racer_REF.gc @@ -202,7 +202,7 @@ ) ) ((4) - (if (and *target* (zero? (logand (-> *target* control root-prim prim-core action) (collide-action ca-9)))) + (if (and *target* (not (logtest? (-> *target* control root-prim prim-core action) (collide-action ca-9)))) (goto cfg-77) ) ) 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 afc3378214..9059e574fe 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 @@ -546,7 +546,7 @@ ) (let ((f0-2 (if (or (and (logtest? (-> self control status) (cshape-moving-flags twall)) - (zero? (logand (-> self control status) (cshape-moving-flags onsurf))) + (not (logtest? (-> self control status) (cshape-moving-flags onsurf))) ) (logtest? (-> self state-flags) (state-flags dying)) ) @@ -830,7 +830,7 @@ ) (cpad-pressed? (-> self control unknown-cpad-info00 number) circle square) (>= (- (-> *display* base-frame-counter) (-> self control unknown-dword82)) (seconds 0.25)) - (zero? (logand (-> self state-flags) (state-flags being-attacked dying))) + (not (logtest? (-> self state-flags) (state-flags being-attacked dying))) ) (let ((gp-6 (vector-z-quaternion! (new 'stack-no-clear 'vector) (-> self control quat))) (s5-4 (vector<-cspace! (new 'stack-no-clear 'vector) (-> self manipy 0 node-list data 4))) 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 c8f66f673c..8befb67acd 100644 --- a/test/decompiler/reference/jak1/levels/snow/snow-bunny_REF.gc +++ b/test/decompiler/reference/jak1/levels/snow/snow-bunny_REF.gc @@ -328,7 +328,7 @@ ;; definition for method 57 of type snow-bunny (defmethod dummy-57 snow-bunny ((obj snow-bunny)) - (if (or (not *target*) (zero? (logand (-> *target* state-flags) (state-flags dangerous)))) + (if (or (not *target*) (not (logtest? (-> *target* state-flags) (state-flags dangerous)))) (return #f) ) (let ((f0-0 (vector-vector-xz-distance (target-pos 0) (-> obj collide-info trans)))) 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 fd6de95ac7..8a0e248644 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 @@ -839,7 +839,7 @@ ) ) (('ridden) - (if (or (not *target*) (zero? (logand (-> *target* control root-prim prim-core action) (collide-action ca-14)))) + (if (or (not *target*) (not (logtest? (-> *target* control root-prim prim-core action) (collide-action ca-14)))) (go elevator-travel-to-fort) ) ) @@ -904,7 +904,7 @@ (when *target* (if (and (>= 798720.0 (-> (target-pos 0) y)) (not (and (logtest? (-> *target* control unknown-surface00 flags) (surface-flags jump)) - (zero? (logand (-> *target* control status) (cshape-moving-flags onsurf))) + (not (logtest? (-> *target* control status) (cshape-moving-flags onsurf))) ) ) ) diff --git a/test/decompiler/reference/jak1/levels/snow/snow-obs_REF.gc b/test/decompiler/reference/jak1/levels/snow/snow-obs_REF.gc index 50a07632eb..d2ddfe4858 100644 --- a/test/decompiler/reference/jak1/levels/snow/snow-obs_REF.gc +++ b/test/decompiler/reference/jak1/levels/snow/snow-obs_REF.gc @@ -1503,7 +1503,7 @@ (local-vars (v1-1 symbol)) (until v1-1 (suspend) - (set! v1-1 (or (not *target*) (zero? (logand (-> *target* state-flags) (state-flags grabbed))))) + (set! v1-1 (or (not *target*) (not (logtest? (-> *target* state-flags) (state-flags grabbed))))) ) (sound-play "prec-button1" :pitch -1) (let ((gp-1 (get-process *default-dead-pool* snowcam #x4000))) 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 cc337c5f48..0747424ca4 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 @@ -666,10 +666,10 @@ ;; INFO: Return type mismatch vector vs none. (defmethod dummy-28 ram-boss-proj ((obj ram-boss-proj)) (when (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) ) - ) + ) ) (let ((gp-0 (-> obj target))) (set! (-> gp-0 quad) (-> (target-pos 0) quad)) 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 1c61af32d3..daa9571a80 100644 --- a/test/decompiler/reference/jak1/levels/sunken/helix-water_REF.gc +++ b/test/decompiler/reference/jak1/levels/sunken/helix-water_REF.gc @@ -326,7 +326,7 @@ (send-event a0-1 'pickup) (until v1-7 (suspend) - (set! v1-7 (or (not *target*) (zero? (logand (-> *target* state-flags) (state-flags grabbed))))) + (set! v1-7 (or (not *target*) (not (logtest? (-> *target* state-flags) (state-flags grabbed))))) ) ) ) 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 1227c7fe92..02cdd67303 100644 --- a/test/decompiler/reference/jak1/levels/sunken/sunken-pipegame_REF.gc +++ b/test/decompiler/reference/jak1/levels/sunken/sunken-pipegame_REF.gc @@ -617,7 +617,7 @@ (set! (-> self abort-audio-if-beaten?) #f) (dotimes (gp-0 3) (let ((v1-4 (-> self button gp-0))) - (if (and (!= gp-0 (-> self challenge)) (zero? (logand (ash 1 gp-0) (-> self challenges-mask)))) + (if (and (!= gp-0 (-> self challenge)) (not (logtest? (ash 1 gp-0) (-> self challenges-mask)))) (send-event (ppointer->process v1-4) 'trigger) ) ) @@ -747,7 +747,7 @@ ) (until v1-112 (suspend) - (set! v1-112 (or (not *target*) (zero? (logand (-> *target* state-flags) (state-flags grabbed))))) + (set! v1-112 (or (not *target*) (not (logtest? (-> *target* state-flags) (state-flags grabbed))))) ) (set! (-> self state-time) (-> *display* base-frame-counter)) (sleep (-> self ticker) (-> self prize (-> self challenge) puzzle-delay)) @@ -900,7 +900,7 @@ (set! (-> self abort-audio-if-beaten?) #f) (until v1-3 (suspend) - (set! v1-3 (or (not *target*) (zero? (logand (-> *target* state-flags) (state-flags grabbed))))) + (set! v1-3 (or (not *target*) (not (logtest? (-> *target* state-flags) (state-flags grabbed))))) ) (if (not (handle->process (-> self prize (-> self challenge) actor-handle))) (logior! (-> self challenges-mask) (ash 1 (-> self challenge))) 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 fd05cb864e..67ae11328b 100644 --- a/test/decompiler/reference/jak1/levels/sunken/target-tube_REF.gc +++ b/test/decompiler/reference/jak1/levels/sunken/target-tube_REF.gc @@ -789,7 +789,7 @@ ) (when (and (logtest? (-> arg1 mask) (attack-mask mode)) (= (-> arg1 mode) 'darkeco) - (zero? (logand (-> arg1 mask) (attack-mask shove-up))) + (not (logtest? (-> arg1 mask) (attack-mask shove-up))) ) (set! (-> arg1 shove-up) 12288.0) (logior! (-> arg1 mask) (attack-mask shove-up)) diff --git a/test/decompiler/reference/jak1/levels/swamp/billy_REF.gc b/test/decompiler/reference/jak1/levels/swamp/billy_REF.gc index f7c72c19dc..67951647a9 100644 --- a/test/decompiler/reference/jak1/levels/swamp/billy_REF.gc +++ b/test/decompiler/reference/jak1/levels/swamp/billy_REF.gc @@ -1166,7 +1166,7 @@ (defmethod target-above-threshold? billy ((obj billy)) (the-as symbol - (and *target* (zero? (logand (-> *target* control root-prim prim-core action) (collide-action ca-14)))) + (and *target* (not (logtest? (-> *target* control root-prim prim-core action) (collide-action ca-14)))) ) ) diff --git a/test/decompiler/reference/jak1/levels/training/training-obs_REF.gc b/test/decompiler/reference/jak1/levels/training/training-obs_REF.gc index f1468107e0..a00919fa3d 100644 --- a/test/decompiler/reference/jak1/levels/training/training-obs_REF.gc +++ b/test/decompiler/reference/jak1/levels/training/training-obs_REF.gc @@ -108,14 +108,14 @@ (-> *setting-control* current play-hints) (and (< 0.0 (-> *setting-control* current dialog-volume)) (let ((a0-3 (entity-actor-lookup (-> self entity) 'alt-actor 0))) - (or (not a0-3) (zero? (logand (-> a0-3 extra perm status) (entity-perm-status dead)))) + (or (not a0-3) (not (logtest? (-> a0-3 extra perm status) (entity-perm-status dead)))) ) ) ) (when (!= (-> self index) 6) (while (and *target* (logtest? (-> *target* control unknown-surface00 flags) (surface-flags jump)) - (zero? (logand (-> *target* control status) (cshape-moving-flags onsurf))) + (not (logtest? (-> *target* control status) (cshape-moving-flags onsurf))) ) (suspend) ) @@ -780,7 +780,7 @@ (or (= (-> self type) scarecrow-a) (and (= (-> proc type) target) (logtest? (-> (the-as target proc) control unknown-surface00 flags) (surface-flags jump)) - (zero? (logand (-> (the-as target proc) control status) (cshape-moving-flags onsurf))) + (not (logtest? (-> (the-as target proc) control status) (cshape-moving-flags onsurf))) ) ) ) diff --git a/test/decompiler/reference/jak1/levels/village3/village3-obs_REF.gc b/test/decompiler/reference/jak1/levels/village3/village3-obs_REF.gc index cf8baee690..f38feacc36 100644 --- a/test/decompiler/reference/jak1/levels/village3/village3-obs_REF.gc +++ b/test/decompiler/reference/jak1/levels/village3/village3-obs_REF.gc @@ -232,7 +232,7 @@ ) (when (and (< (vector-vector-xz-distance s5-1 (-> *target* control trans)) 18432.0) (and (not (and (logtest? (-> *target* control unknown-surface00 flags) (surface-flags jump)) - (zero? (logand (-> *target* control status) (cshape-moving-flags onsurf))) + (not (logtest? (-> *target* control status) (cshape-moving-flags onsurf))) ) ) (and (< (+ -40960.0 (-> s5-1 y)) (-> *target* control trans y)) 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 17cfa0cabf..45f62cce0b 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 @@ -1016,7 +1016,7 @@ ) (while (and *target* (logtest? (-> *target* control unknown-surface00 flags) (surface-flags jump)) - (zero? (logand (-> *target* control status) (cshape-moving-flags onsurf))) + (not (logtest? (-> *target* control status) (cshape-moving-flags onsurf))) ) (suspend) ) diff --git a/test/decompiler/reference/jak2/characters/ashelin/ash-states_REF.gc b/test/decompiler/reference/jak2/characters/ashelin/ash-states_REF.gc index f692d26fee..9d00f0dd94 100644 --- a/test/decompiler/reference/jak2/characters/ashelin/ash-states_REF.gc +++ b/test/decompiler/reference/jak2/characters/ashelin/ash-states_REF.gc @@ -23,7 +23,7 @@ ) :trans (behavior () (bot-method-223 self #f) - (when (not (logtest? (-> self focus-status) (focus-status grabbed))) + (when (not (focus-test? self grabbed)) (cond ((bot-method-214 self) (go-hostile self) @@ -366,7 +366,7 @@ (none) ) :trans (behavior () - (if (logtest? (-> self focus-status) (focus-status grabbed)) + (if (focus-test? self grabbed) (go-virtual waiting-idle) ) (bot-method-223 self #f) diff --git a/test/decompiler/reference/jak2/characters/ashelin/ash_REF.gc b/test/decompiler/reference/jak2/characters/ashelin/ash_REF.gc index c7f6fc6b4b..86c8913747 100644 --- a/test/decompiler/reference/jak2/characters/ashelin/ash_REF.gc +++ b/test/decompiler/reference/jak2/characters/ashelin/ash_REF.gc @@ -1206,7 +1206,7 @@ (let ((f0-4 (ja-aframe-num 0))) (cond ((>= f0-4 22.0) - (when (logtest? (-> obj focus-status) (focus-status dangerous)) + (when (focus-test? obj dangerous) (if (logtest? (-> obj enemy-flags) (enemy-flag check-water)) (logior! (-> obj focus-status) (focus-status dangerous)) (logclear! (-> obj focus-status) (focus-status dangerous)) @@ -1214,7 +1214,7 @@ ) ) ((>= f0-4 16.0) - (when (not (logtest? (-> obj focus-status) (focus-status dangerous))) + (when (not (focus-test? obj dangerous)) (logior! (-> obj focus-status) (focus-status dangerous)) (let* ((v1-42 *game-info*) (a0-34 (+ (-> v1-42 attack-id) 1)) @@ -1237,7 +1237,7 @@ (let ((f0-5 (ja-aframe-num 0))) (cond ((>= f0-5 32.0) - (when (logtest? (-> obj focus-status) (focus-status dangerous)) + (when (focus-test? obj dangerous) (if (logtest? (-> obj enemy-flags) (enemy-flag check-water)) (logior! (-> obj focus-status) (focus-status dangerous)) (logclear! (-> obj focus-status) (focus-status dangerous)) @@ -1245,7 +1245,7 @@ ) ) ((>= f0-5 25.0) - (when (not (logtest? (-> obj focus-status) (focus-status dangerous))) + (when (not (focus-test? obj dangerous)) (logior! (-> obj focus-status) (focus-status dangerous)) (let* ((v1-62 *game-info*) (a0-47 (+ (-> v1-62 attack-id) 1)) diff --git a/test/decompiler/reference/jak2/characters/sig/sig-states_REF.gc b/test/decompiler/reference/jak2/characters/sig/sig-states_REF.gc index 8d2acd0902..7b3e069d39 100644 --- a/test/decompiler/reference/jak2/characters/sig/sig-states_REF.gc +++ b/test/decompiler/reference/jak2/characters/sig/sig-states_REF.gc @@ -37,7 +37,7 @@ (none) ) :trans (behavior () - (if (and (not (logtest? (-> self focus-status) (focus-status grabbed))) + (if (and (not (focus-test? self grabbed)) (not (outside-spot-radius? self (the-as bot-spot #f) (the-as vector #f) #f)) ) (go-virtual traveling) @@ -85,7 +85,7 @@ ) :trans (behavior () (bot-method-223 self #f) - (when (not (logtest? (-> self focus-status) (focus-status grabbed))) + (when (not (focus-test? self grabbed)) (cond ((bot-method-214 self) (go-hostile self) @@ -189,7 +189,7 @@ ) :trans (behavior () (bot-method-223 self #f) - (when (not (logtest? (-> self focus-status) (focus-status grabbed))) + (when (not (focus-test? self grabbed)) (cond ((bot-method-214 self) (go-hostile self) @@ -321,7 +321,7 @@ ) :trans (behavior () (bot-method-223 self #f) - (when (not (logtest? (-> self focus-status) (focus-status grabbed))) + (when (not (focus-test? self grabbed)) (cond ((bot-method-214 self) (go-hostile self) @@ -520,7 +520,7 @@ ) :trans (behavior () (bot-method-223 self #f) - (when (not (logtest? (-> self focus-status) (focus-status grabbed))) + (when (not (focus-test? self grabbed)) (cond ((bot-method-214 self) (go-hostile self) @@ -675,7 +675,7 @@ ) :trans (behavior () (bot-method-223 self #f) - (when (not (logtest? (-> self focus-status) (focus-status grabbed))) + (when (not (focus-test? self grabbed)) (if (bot-method-214 self) (go-hostile self) ) @@ -859,7 +859,7 @@ ) :trans (behavior () (bot-method-223 self #f) - (when (not (logtest? (-> self focus-status) (focus-status grabbed))) + (when (not (focus-test? self grabbed)) (cond ((bot-method-214 self) (go-hostile self) @@ -1250,7 +1250,7 @@ :frame-num 0.0 ) (until (ja-done? 0) - (when (and (logtest? (-> self focus-status) (focus-status dangerous)) (< f30-0 (ja-aframe-num 0))) + (when (and (focus-test? self dangerous) (< f30-0 (ja-aframe-num 0))) (if (logtest? (-> self enemy-flags) (enemy-flag check-water)) (logior! (-> self focus-status) (focus-status dangerous)) (logclear! (-> self focus-status) (focus-status dangerous)) @@ -1743,13 +1743,13 @@ (if (not (logtest? s5-0 1)) (logclear! (-> self bot-flags) (bot-flags bf24)) ) - (if (and (logtest? s5-0 1) (zero? (logand (bot-flags bf24) (-> self bot-flags)))) + (if (and (logtest? s5-0 1) (not (logtest? (bot-flags bf24) (-> self bot-flags)))) (go-virtual sig-path-jump) ) (if (logtest? s5-0 2) (go-virtual sig-path-shoot-jump) ) - (if (and (>= (- (-> self clock frame-counter) (-> self state-time)) (seconds 0.05)) (zero? (logand s5-0 4))) + (if (and (>= (- (-> self clock frame-counter) (-> self state-time)) (seconds 0.05)) (not (logtest? s5-0 4))) (go-virtual sig-path-jump-land) ) ) @@ -1815,7 +1815,7 @@ (if (not (logtest? s5-0 1)) (logclear! (-> self bot-flags) (bot-flags bf24)) ) - (if (and (logtest? s5-0 1) (zero? (logand (bot-flags bf24) (-> self bot-flags)))) + (if (and (logtest? s5-0 1) (not (logtest? (bot-flags bf24) (-> self bot-flags)))) (go-virtual sig-path-jump) ) (if (logtest? s5-0 2) @@ -1887,13 +1887,13 @@ (if (not (logtest? s5-0 2)) (logclear! (-> self bot-flags) (bot-flags bf24)) ) - (if (and (logtest? s5-0 2) (zero? (logand (bot-flags bf24) (-> self bot-flags)))) + (if (and (logtest? s5-0 2) (not (logtest? (bot-flags bf24) (-> self bot-flags)))) (go-virtual sig-path-shoot-jump) ) (if (and (logtest? s5-0 1) (logtest? (bot-flags bf25) (-> self bot-flags))) (go-virtual sig-path-jump) ) - (if (and (>= (- (-> self clock frame-counter) (-> self state-time)) (seconds 0.05)) (zero? (logand s5-0 4))) + (if (and (>= (- (-> self clock frame-counter) (-> self state-time)) (seconds 0.05)) (not (logtest? s5-0 4))) (go-virtual sig-path-shoot-jump-land) ) ) @@ -1964,7 +1964,7 @@ (if (not (logtest? s5-0 2)) (logclear! (-> self bot-flags) (bot-flags bf24)) ) - (if (and (logtest? s5-0 2) (zero? (logand (bot-flags bf24) (-> self bot-flags)))) + (if (and (logtest? s5-0 2) (not (logtest? (bot-flags bf24) (-> self bot-flags)))) (go-virtual sig-path-shoot-jump) ) (if (logtest? s5-0 1) diff --git a/test/decompiler/reference/jak2/characters/sig/sig-task_REF.gc b/test/decompiler/reference/jak2/characters/sig/sig-task_REF.gc index 75c2fcc95b..2f6599a7dc 100644 --- a/test/decompiler/reference/jak2/characters/sig/sig-task_REF.gc +++ b/test/decompiler/reference/jak2/characters/sig/sig-task_REF.gc @@ -44,7 +44,7 @@ (cond ((and a1-10 (attacked-by-player? arg0 (the-as process-focusable a1-10)) - (zero? (logand (-> arg0 focus-status) (focus-status grabbed))) + (not (logtest? (-> arg0 focus-status) (focus-status grabbed))) ) (get-task-by-type (-> arg0 ai-ctrl) sigt-fight-focus arg0) (ai-task-control-method-10 (-> arg0 ai-ctrl) arg0) @@ -64,7 +64,7 @@ (let ((a1-1 (handle->process (-> arg0 focus handle)))) (if (and a1-1 (attacked-by-player? arg0 (the-as process-focusable a1-1)) - (zero? (logand (-> arg0 focus-status) (focus-status grabbed))) + (not (logtest? (-> arg0 focus-status) (focus-status grabbed))) ) (logior! (-> arg0 bot-flags) (bot-flags bf00)) (ai-task-control-method-14 (-> arg0 ai-ctrl) obj arg0) @@ -90,7 +90,7 @@ (let ((a1-4 (handle->process (-> arg0 focus handle)))) (when (and a1-4 (attacked-by-player? arg0 (the-as process-focusable a1-4)) - (zero? (logand (-> arg0 focus-status) (focus-status grabbed))) + (not (logtest? (-> arg0 focus-status) (focus-status grabbed))) ) (get-task-by-type (-> arg0 ai-ctrl) sigt-fight-focus arg0) (ai-task-control-method-10 (-> arg0 ai-ctrl) arg0) @@ -245,7 +245,7 @@ (let ((a1-6 (handle->process (-> arg0 focus handle)))) (when (and a1-6 (attacked-by-player? arg0 (the-as process-focusable a1-6)) - (zero? (logand (-> arg0 focus-status) (focus-status grabbed))) + (not (logtest? (-> arg0 focus-status) (focus-status grabbed))) ) (get-task-by-type (-> arg0 ai-ctrl) sigt-fight-focus arg0) (ai-task-control-method-10 (-> arg0 ai-ctrl) arg0) @@ -424,7 +424,7 @@ (let ((a1-14 (handle->process (-> (the-as sig arg0) focus handle)))) (when (and a1-14 (attacked-by-player? (the-as sig arg0) (the-as process-focusable a1-14)) - (zero? (logand (-> (the-as sig arg0) focus-status) (focus-status grabbed))) + (not (logtest? (-> (the-as sig arg0) focus-status) (focus-status grabbed))) ) (get-task-by-type (-> (the-as sig arg0) ai-ctrl) sigt-fight-focus (the-as sig arg0)) (ai-task-control-method-10 (-> (the-as sig arg0) ai-ctrl) (the-as sig arg0)) diff --git a/test/decompiler/reference/jak2/characters/sig/sig_REF.gc b/test/decompiler/reference/jak2/characters/sig/sig_REF.gc index 974446e9b2..d8ab950a7f 100644 --- a/test/decompiler/reference/jak2/characters/sig/sig_REF.gc +++ b/test/decompiler/reference/jak2/characters/sig/sig_REF.gc @@ -388,26 +388,25 @@ "Handles various events for the enemy @TODO - unsure if there is a pattern for the events and this should have a more specific name" (let ((v1-0 arg2)) - (the-as object (cond - ((= v1-0 'untrigger) - (sig-plasma-method-11 (-> obj plasma) #t) - ) - ((= v1-0 'sig-path) - (when (and (not (logtest? (-> obj focus-status) (focus-status dead))) - (nonzero? (-> obj hit-points)) - (zero? (-> obj fated-time)) - ) - (let ((a1-2 (-> arg3 param 0))) - (sig-method-249 obj (the-as sig-path a1-2)) - ) - (go (method-of-object obj sig-path-run)) - ) - ) - (else - ((method-of-type bot general-event-handler) obj arg0 arg1 arg2 arg3) - ) - ) - ) + (the-as + object + (cond + ((= v1-0 'untrigger) + (sig-plasma-method-11 (-> obj plasma) #t) + ) + ((= v1-0 'sig-path) + (when (and (not (focus-test? obj dead)) (nonzero? (-> obj hit-points)) (zero? (-> obj fated-time))) + (let ((a1-2 (-> arg3 param 0))) + (sig-method-249 obj (the-as sig-path a1-2)) + ) + (go (method-of-object obj sig-path-run)) + ) + ) + (else + ((method-of-type bot general-event-handler) obj arg0 arg1 arg2 arg3) + ) + ) + ) ) ) @@ -747,7 +746,7 @@ (and (or (and (logtest? (-> obj bot-flags) (bot-flags attacked)) (= (-> obj focus-info fproc type) target)) (and (>= 40960.0 (-> obj focus-info bullseye-xz-dist)) (= (-> obj focus-info los) 1)) ) - (zero? (logand (bot-flags bf19) (-> obj bot-flags))) + (not (logtest? (bot-flags bf19) (-> obj bot-flags))) ) ) @@ -1203,7 +1202,7 @@ ((and (-> obj next-state) (= (-> obj next-state name) 'failed)) (set-vector! arg0 0.0 4096.0 28672.0 1.0) ) - ((logtest? (-> obj focus-status) (focus-status under-water)) + ((focus-test? obj under-water) (set-vector! arg0 0.0 12288.0 28672.0 1.0) ) (else @@ -1213,7 +1212,7 @@ (vector<-cspace+vector! arg0 (-> obj node-list data 2) arg0) (the-as meters - (if (logtest? (-> obj focus-status) (focus-status under-water)) + (if (focus-test? obj under-water) (set! (-> arg0 y) (+ (get-water-height obj) (-> *setting-control* cam-current target-height))) ) ) diff --git a/test/decompiler/reference/jak2/decompiler-macros.gc b/test/decompiler/reference/jak2/decompiler-macros.gc index 7d327be241..9ab71edd84 100644 --- a/test/decompiler/reference/jak2/decompiler-macros.gc +++ b/test/decompiler/reference/jak2/decompiler-macros.gc @@ -1300,3 +1300,5 @@ (defmacro script-eval (script &key (key (process->ppointer PP)) &key (proc PP) &key (vector (the-as vector #f))) `(eval! (new 'stack 'script-context ,key ,proc ,vector) ,script)) +(defmacro focus-test? (pfoc &rest status) + `(logtest? (-> (the process-focusable ,pfoc) focus-status) (focus-status ,@status))) \ No newline at end of file diff --git a/test/decompiler/reference/jak2/engine/ai/enemy_REF.gc b/test/decompiler/reference/jak2/engine/ai/enemy_REF.gc index 4e24ceaffe..9bb7e4eaec 100644 --- a/test/decompiler/reference/jak2/engine/ai/enemy_REF.gc +++ b/test/decompiler/reference/jak2/engine/ai/enemy_REF.gc @@ -226,7 +226,7 @@ (when (logtest? (water-flags touch-water) s3-0) (set! (-> obj enemy-flags) (logior (enemy-flag directed-ready) (-> obj enemy-flags))) (set! (-> obj water-surface-height) (-> s5-0 trans y)) - (when (not (logtest? (-> obj focus-status) (focus-status touch-water under-water))) + (when (not (focus-test? obj touch-water under-water)) (let ((s2-0 (new 'stack-no-clear 'vector))) (set! (-> s2-0 quad) (-> obj root-override2 trans quad)) (set! (-> s2-0 y) (+ 409.6 (-> s5-0 trans y))) @@ -280,7 +280,7 @@ (let* ((v1-32 (-> s4-0 root-prim prim-core)) (f0-5 (+ (-> v1-32 world-sphere y) (-> v1-32 world-sphere w))) ) - (if (logtest? (-> obj focus-status) (focus-status under-water)) + (if (focus-test? obj under-water) (set! f0-5 (+ -819.2 f0-5)) ) (if (< f0-5 (-> s5-0 trans y)) @@ -371,10 +371,10 @@ (with-pp (when (or (>= (- (-> pp clock frame-counter) (-> obj hit-focus-time)) (seconds 2)) (and (handle->process (-> obj focus handle)) - (zero? (logand (-> (the-as process-focusable (handle->process (-> obj focus handle))) focus-status) + (not (logtest? (-> (the-as process-focusable (handle->process (-> obj focus handle))) focus-status) (focus-status disable dead ignore grabbed) ) - ) + ) ) ) (let ((v0-0 (logclear (-> obj enemy-flags) (enemy-flag look-at-focus)))) @@ -422,7 +422,7 @@ (let ((v0-0 (handle->process (-> obj focus handle)))) (if (and v0-0 (not (and v0-0 - (zero? (logand (-> (the-as process-focusable v0-0) focus-status) (focus-status disable dead ignore grabbed))) + (not (logtest? (-> (the-as process-focusable v0-0) focus-status) (focus-status disable dead ignore grabbed))) ) ) ) @@ -464,7 +464,7 @@ (defmethod enemy-method-108 enemy ((obj enemy) (arg0 enemy) (arg1 event-message-block)) (let ((s4-0 (the-as touching-shapes-entry (-> arg1 param 0)))) (when (and s4-0 - (and (logtest? (-> obj incoming penetrate-using) 4096) (zero? (logand (-> obj incoming penetrate-using) 32))) + (and (logtest? (-> obj incoming penetrate-using) 4096) (not (logtest? (-> obj incoming penetrate-using) 32))) (begin (let ((s3-0 (-> s4-0 head))) (while s3-0 @@ -716,7 +716,7 @@ (when (enemy-method-53 obj (the-as process-focusable s5-0)) (let ((v1-10 (handle->process (-> obj focus handle)))) (when (or (= s5-0 v1-10) (and (not (logtest? (enemy-flag actor-pause-backup) (-> obj enemy-flags))) - (or (not v1-10) (zero? (logand (-> obj focus flags) (enemy-flag lock-focus)))) + (or (not v1-10) (not (logtest? (-> obj focus flags) (enemy-flag lock-focus)))) ) ) (enemy-method-63 obj (the-as process-focusable s5-0) (the-as enemy-aware #f)) @@ -1241,7 +1241,7 @@ (set! (-> obj mask) (logior (process-mask collectable) (-> obj mask))) (if (and (-> obj enemy-info move-to-ground) (not (logtest? (enemy-flag vulnerable-backup) (-> obj enemy-flags))) - (zero? (logand (enemy-option ambush) (-> obj fact-info-override enemy-options))) + (not (logtest? (enemy-option ambush) (-> obj fact-info-override enemy-options))) ) (enemy-method-127 obj 40960.0 40960.0 #t (the-as collide-spec (-> obj gnd-collide))) ) @@ -1417,10 +1417,10 @@ This commonly includes things such as: (when a1-0 (let ((v1-4 (-> obj enemy-flags))) (cond - ((and a1-0 (zero? (logand (-> (the-as process-focusable a1-0) focus-status) (focus-status disable dead)))) + ((and a1-0 (not (logtest? (-> (the-as process-focusable a1-0) focus-status) (focus-status disable dead)))) (when (and (logtest? (enemy-flag trackable) v1-4) (not (logtest? (enemy-flag actor-pause-backup) v1-4)) - (zero? (logand (-> gp-0 flags) (enemy-flag lock-focus))) + (not (logtest? (-> gp-0 flags) (enemy-flag lock-focus))) ) (enemy-method-97 obj) (return #f) @@ -1477,7 +1477,7 @@ This commonly includes things such as: ) ) ) - (if (and a1-1 (and a1-1 (zero? (logand (-> a1-1 focus-status) (focus-status disable dead)))) (!= obj a1-1)) + (if (and a1-1 (and a1-1 (not (logtest? (-> a1-1 focus-status) (focus-status disable dead)))) (!= obj a1-1)) (update-target-awareness! obj a1-1 gp-0) ) ) @@ -1504,7 +1504,7 @@ This commonly includes things such as: ) ) ) - (if (and a1-3 (and a1-3 (zero? (logand (-> a1-3 focus-status) (focus-status disable dead)))) (!= obj a1-3)) + (if (and a1-3 (and a1-3 (not (logtest? (-> a1-3 focus-status) (focus-status disable dead)))) (!= obj a1-3)) (update-target-awareness! obj a1-3 gp-0) ) ) @@ -1530,7 +1530,7 @@ This commonly includes things such as: ) ) ) - (if (and a1-5 (and a1-5 (zero? (logand (-> a1-5 focus-status) (focus-status disable dead)))) (!= obj a1-5)) + (if (and a1-5 (and a1-5 (not (logtest? (-> a1-5 focus-status) (focus-status disable dead)))) (!= obj a1-5)) (update-target-awareness! obj a1-5 gp-0) ) ) @@ -1577,7 +1577,7 @@ This commonly includes things such as: (if (< 1 (the-as int (-> obj focus aware))) (set! f0-1 (+ (the-as meters f0-1) (-> obj enemy-info notice-distance-delta))) ) - (when (or (< f30-0 f0-1) (zero? (logand (-> obj enemy-flags) (enemy-flag enable-on-notice)))) + (when (or (< f30-0 f0-1) (not (logtest? (-> obj enemy-flags) (enemy-flag enable-on-notice)))) (set! s2-0 (in-aggro-range? obj arg0 (the-as vector #f))) (if s2-0 (set! s3-1 #t) @@ -1802,7 +1802,7 @@ This commonly includes things such as: (when (!= (-> (the-as attack-info s2-0) id) (-> obj incoming attack-id)) (cond ((and (logtest? (-> obj enemy-flags) (enemy-flag enable-on-active)) - (zero? (logand (-> obj focus-status) (focus-status grabbed))) + (not (logtest? (-> obj focus-status) (focus-status grabbed))) ) (let* ((s1-0 obj) (s0-0 (method-of-object s1-0 enemy-method-106)) @@ -1910,7 +1910,7 @@ This commonly includes things such as: ((= arg2 'cue-chase) (when (and (> (-> obj hit-points) 0) (zero? (-> obj fated-time)) - (zero? (logand (-> obj focus-status) (focus-status grabbed))) + (not (logtest? (-> obj focus-status) (focus-status grabbed))) ) (let ((v1-162 (logtest? (enemy-flag alert) (-> obj enemy-flags)))) (logclear! (-> obj enemy-flags) (enemy-flag enable-on-notice alert victory called-dying)) @@ -1940,7 +1940,7 @@ This commonly includes things such as: ((= arg2 'cue-wake) (when (and (> (-> obj hit-points) 0) (zero? (-> obj fated-time)) - (zero? (logand (-> obj focus-status) (focus-status grabbed))) + (not (logtest? (-> obj focus-status) (focus-status grabbed))) ) (logclear! (-> obj enemy-flags) (enemy-flag alert victory called-dying)) (if (logtest? (enemy-option ambush) (-> obj fact-info-override enemy-options)) @@ -1953,7 +1953,7 @@ This commonly includes things such as: ((= arg2 'jump) (when (and (> (-> obj hit-points) 0) (zero? (-> obj fated-time)) - (zero? (logand (-> obj focus-status) (focus-status grabbed))) + (not (logtest? (-> obj focus-status) (focus-status grabbed))) ) (logclear! (-> obj mask) (process-mask actor-pause)) (set! (-> obj jump-why) (-> arg3 param 0)) @@ -2020,7 +2020,7 @@ This commonly includes things such as: (not (and (-> obj next-state) (= (-> obj next-state name) 'victory))) (> (-> obj hit-points) 0) (zero? (-> obj fated-time)) - (zero? (logand (-> obj focus-status) (focus-status grabbed))) + (not (logtest? (-> obj focus-status) (focus-status grabbed))) ) (go (method-of-object obj victory)) ) @@ -2152,8 +2152,8 @@ This commonly includes things such as: ) (when (and s4-0 s3-0) (cond - ((and (logtest? (-> obj focus-status) (focus-status dangerous)) - (and s3-0 (zero? (logand (-> s3-0 focus-status) (focus-status disable dead ignore grabbed)))) + ((and (focus-test? obj dangerous) + (and s3-0 (not (logtest? (-> s3-0 focus-status) (focus-status disable dead ignore grabbed)))) ((method-of-type touching-shapes-entry prims-touching-action?) (the-as touching-shapes-entry s4-0) (-> obj root-override2) @@ -2181,7 +2181,7 @@ This commonly includes things such as: (collide-action no-standon) (collide-action) ) - (zero? (logand (-> obj root-override2 penetrated-by) (-> s3-0 root-override penetrate-using))) + (not (logtest? (-> obj root-override2 penetrated-by) (-> s3-0 root-override penetrate-using))) ) (if (send-shoves (-> obj root-override2) arg0 (the-as touching-shapes-entry s4-0) 0.7 6144.0 16384.0) (send-event obj 'bouncing-off arg0) @@ -2249,7 +2249,7 @@ This commonly includes things such as: (set! (-> self enemy-flags) (logior (enemy-flag directed) (-> self enemy-flags))) (let ((gp-0 (-> self root-override2))) (cond - ((logtest? (-> self focus-status) (focus-status under-water)) + ((focus-test? self under-water) (enemy-method-47 self (-> gp-0 transv)) ) (else @@ -2290,7 +2290,7 @@ This commonly includes things such as: (defbehavior enemy-die-falling-post enemy () (set! (-> self enemy-flags) (logior (enemy-flag directed) (-> self enemy-flags))) (let ((gp-0 (-> self root-override2))) - (if (logtest? (-> self focus-status) (focus-status under-water)) + (if (focus-test? self under-water) (enemy-method-47 self (-> gp-0 transv)) (vector-v++! (-> gp-0 transv) (compute-acc-due-to-gravity gp-0 (new-stack-vector0) 0.0)) ) @@ -3180,7 +3180,7 @@ This commonly includes things such as: ) (when (not (logtest? (enemy-flag directed) (-> obj enemy-flags))) (let ((s5-0 (-> obj root-override2))) - (if (logtest? (-> obj focus-status) (focus-status under-water)) + (if (focus-test? obj under-water) (enemy-method-47 obj (-> s5-0 transv)) (+! (-> s5-0 transv y) (* (-> obj enemy-info movement-gravity) (-> pp clock seconds-per-frame))) ) @@ -3200,7 +3200,7 @@ This commonly includes things such as: ) ) (logclear! (-> obj enemy-flags) (enemy-flag directed)) - (if (and (enemy-method-102 obj) (zero? (logand (-> obj focus-status) (focus-status dead)))) + (if (and (enemy-method-102 obj) (not (logtest? (-> obj focus-status) (focus-status dead)))) (kill-prefer-falling obj) ) (let ((s5-1 (-> obj root-override2)) diff --git a/test/decompiler/reference/jak2/engine/ambient/ambient_REF.gc b/test/decompiler/reference/jak2/engine/ambient/ambient_REF.gc index 75bf456b3f..7e3eed73b9 100644 --- a/test/decompiler/reference/jak2/engine/ambient/ambient_REF.gc +++ b/test/decompiler/reference/jak2/engine/ambient/ambient_REF.gc @@ -471,7 +471,7 @@ ) :code (behavior () (local-vars (v1-43 symbol)) - (let ((gp-1 (zero? (logand (-> self message flags) 2)))) + (let ((gp-1 (not (logtest? (-> self message flags) 2)))) (while (or (and (nonzero? (-> self voice-id)) (let ((v1-34 (get-status *gui-control* (-> self voice-id)))) (or (= v1-34 (gui-status ready)) (= v1-34 (gui-status active))) 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 acd573afac..734e57b3bb 100644 --- a/test/decompiler/reference/jak2/engine/camera/cam-layout_REF.gc +++ b/test/decompiler/reference/jak2/engine/camera/cam-layout_REF.gc @@ -537,7 +537,7 @@ (cond ((and (= gp-0 (-> self cur-volume)) (= *camera-layout-blink* 'volume) - (zero? (logand (-> *display* real-frame-clock integral-frame-counter) 8)) + (not (logtest? (-> *display* real-frame-clock integral-frame-counter) 8)) ) ) (else @@ -3379,12 +3379,12 @@ ) ((and (not (logtest? (-> arg0 options) 28)) (logtest? (-> arg0 options) 1) - (zero? (logand (-> *cpad-list* cpads 0 button0-rel 0) (-> arg0 button))) + (not (logtest? (-> *cpad-list* cpads 0 button0-rel 0) (-> arg0 button))) ) #f ) ((and (not (logtest? (-> arg0 options) 29)) - (zero? (logand (-> *cpad-list* cpads 0 button0-abs 0) (-> arg0 button))) + (not (logtest? (-> *cpad-list* cpads 0 button0-abs 0) (-> arg0 button))) ) #f ) diff --git a/test/decompiler/reference/jak2/engine/camera/cam-master_REF.gc b/test/decompiler/reference/jak2/engine/camera/cam-master_REF.gc index 1d4b86b5cd..63cdb26415 100644 --- a/test/decompiler/reference/jak2/engine/camera/cam-master_REF.gc +++ b/test/decompiler/reference/jak2/engine/camera/cam-master_REF.gc @@ -51,7 +51,7 @@ (vector-reset! (-> self pitch-off)) (set! (-> self upspeed) 0.0) (set! (-> self on-ground) - (zero? (logand (-> (the-as process-focusable gp-0) focus-status) (focus-status in-air))) + (not (logtest? (-> (the-as process-focusable gp-0) focus-status) (focus-status in-air))) ) (set! (-> self on-pole) #f) (set! (-> self ease-t) 1.0) @@ -75,7 +75,7 @@ ) ) (cond - ((logtest? (-> (the-as process-focusable gp-0) focus-status) (focus-status under-water)) + ((focus-test? (the-as process-focusable gp-0) under-water) (set! (-> self under-water) 2) ) (else @@ -135,7 +135,7 @@ ) ) (cond - ((logtest? (-> (the-as target gp-0) focus-status) (focus-status under-water)) + ((focus-test? (the-as target gp-0) under-water) (set! (-> self under-water) 2) ) ((> (-> self under-water) 0) @@ -174,7 +174,7 @@ (set! (-> self tpos-curr quad) (-> (get-trans (the-as target gp-0) 4) quad)) ) ) - (when (logtest? (-> (the-as target gp-0) focus-status) (focus-status edge-grab)) + (when (focus-test? (the-as target gp-0) edge-grab) (if *display-cam-los-debug* (format *stdcon* "ride edge~%") ) @@ -202,12 +202,12 @@ ) ) ) - (set! (-> self on-ground) (zero? (logand (-> (the-as target gp-0) focus-status) (focus-status in-air)))) + (set! (-> self on-ground) (not (logtest? (-> (the-as target gp-0) focus-status) (focus-status in-air)))) (let ((s5-7 (new-stack-vector0))) 0.0 (cond - ((and (logtest? (-> (the-as target gp-0) focus-status) (focus-status in-air)) - (zero? (logand (focus-status halfpipe super) (-> (the-as target gp-0) focus-status))) + ((and (focus-test? (the-as target gp-0) in-air) + (not (logtest? (focus-status halfpipe super) (-> (the-as target gp-0) focus-status))) ) (if *display-cam-los-debug* (format *stdcon* "air tracking~%") @@ -251,8 +251,8 @@ (vector-! s5-7 (-> self tpos-curr) (-> self tpos-old)) (let ((f0-34 (vector-dot s5-7 (-> self local-down)))) (cond - ((and (logtest? (-> (the-as target gp-0) focus-status) (focus-status touch-water)) - (zero? (logand (focus-status mech) (-> (the-as target gp-0) focus-status))) + ((and (focus-test? (the-as target gp-0) touch-water) + (not (logtest? (focus-status mech) (-> (the-as target gp-0) focus-status))) ) (set! (-> self upspeed) 0.0) ) @@ -288,8 +288,8 @@ (if (not (logtest? (-> self settings slave-options) (cam-slave-options JUMP_PITCHES))) (reset-follow) ) - (when (and (logtest? (-> (the-as target gp-0) focus-status) (focus-status on-water under-water)) - (zero? (logand (focus-status mech) (-> (the-as target gp-0) focus-status))) + (when (and (focus-test? (the-as target gp-0) on-water under-water) + (not (logtest? (focus-status mech) (-> (the-as target gp-0) focus-status))) ) (let ((f0-41 (- (get-water-height (the-as target gp-0)) (-> self settings target-height)))) (if (< (-> self tpos-curr-adj y) f0-41) 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 75f5480ca3..c3d76a13d4 100644 --- a/test/decompiler/reference/jak2/engine/camera/cam-states_REF.gc +++ b/test/decompiler/reference/jak2/engine/camera/cam-states_REF.gc @@ -299,7 +299,7 @@ ) :trans (behavior () (if (or (not (handle->process (-> *camera* settings pov-handle))) - (zero? (logand (-> *camera* master-options) (cam-master-options-u32 HAVE_TARGET))) + (not (logtest? (-> *camera* master-options) (cam-master-options-u32 HAVE_TARGET))) ) (cam-slave-go cam-free-floating) ) @@ -527,7 +527,7 @@ :exit (behavior () (if (and *target* (logtest? (-> *camera* master-options) (cam-master-options-u32 HAVE_TARGET)) - (logtest? (-> *target* focus-status) (focus-status in-head)) + (focus-test? *target* in-head) ) (send-event *target* 'end-mode) ) diff --git a/test/decompiler/reference/jak2/engine/camera/cam-update_REF.gc b/test/decompiler/reference/jak2/engine/camera/cam-update_REF.gc index 04437c97f3..3df9ba08d5 100644 --- a/test/decompiler/reference/jak2/engine/camera/cam-update_REF.gc +++ b/test/decompiler/reference/jak2/engine/camera/cam-update_REF.gc @@ -171,7 +171,7 @@ (when (= (-> s5-2 status) 'active) (cond ((or *artist-fix-visible* *stats-bsp*) - (set! (-> s5-2 render?) (zero? (logand *fix-visible-level-mask* (ash 1 (-> s5-2 index))))) + (set! (-> s5-2 render?) (not (logtest? *fix-visible-level-mask* (ash 1 (-> s5-2 index))))) (format *stdcon* "~0kleaf-index ~8S ~C = ~d node ~d ~S ~S~%" @@ -196,7 +196,7 @@ (set! (-> s5-2 render?) #t) ) ) - (when (and *artist-fix-visible* (zero? (logand *fix-visible-level-mask* (ash 1 (-> s5-2 index))))) + (when (and *artist-fix-visible* (not (logtest? *fix-visible-level-mask* (ash 1 (-> s5-2 index))))) (let ((s4-1 (-> s5-2 bsp current-leaf-idx)) (s3-0 (-> s5-2 bsp vis-spheres)) ) diff --git a/test/decompiler/reference/jak2/engine/collide/collide-cache_REF.gc b/test/decompiler/reference/jak2/engine/collide/collide-cache_REF.gc index 5772f39e8a..09c2d67c86 100644 --- a/test/decompiler/reference/jak2/engine/collide/collide-cache_REF.gc +++ b/test/decompiler/reference/jak2/engine/collide/collide-cache_REF.gc @@ -90,7 +90,7 @@ (logtest? (-> arg0 flags) (water-flags can-ground)) (logtest? (-> arg0 flags) (water-flags swim-ground under-water)) (logtest? (water-flags over-water) (-> arg0 flags)) - (zero? (logand (water-flags jump-out) (-> arg0 flags))) + (not (logtest? (water-flags jump-out) (-> arg0 flags))) ) ) (return #f) @@ -1019,7 +1019,3 @@ (set! v0-4 #f) (ret-value v0-4) ) - - - - diff --git a/test/decompiler/reference/jak2/engine/collide/collide-debug_REF.gc b/test/decompiler/reference/jak2/engine/collide/collide-debug_REF.gc index 8691835478..1762d65033 100644 --- a/test/decompiler/reference/jak2/engine/collide/collide-debug_REF.gc +++ b/test/decompiler/reference/jak2/engine/collide/collide-debug_REF.gc @@ -93,7 +93,7 @@ (let ((v1-9 (-> s3-1 pat))) (cond ((and (or (zero? (-> arg1 show-pat-set)) (logtest? v1-9 (-> arg1 show-pat-set))) - (or (zero? (-> arg1 show-pat-clear)) (zero? (logand v1-9 (-> arg1 show-pat-clear)))) + (or (zero? (-> arg1 show-pat-clear)) (not (logtest? v1-9 (-> arg1 show-pat-clear)))) (or (zero? (-> arg1 event-mask)) (logtest? (-> arg1 event-mask) (ash 1 (-> v1-9 event)))) ) (let ((t1-0 (copy-and-set-field (-> *pat-mode-info* (-> v1-9 mode) color) a 64))) @@ -162,7 +162,7 @@ (when (= (-> (the-as collide-cache-prim s5-1) prim-core prim-type) (prim-type sphere)) (let ((v1-37 (-> (the-as collide-shape-prim-sphere (-> (the-as collide-cache-prim s5-1) prim)) pat))) (when (and (or (zero? (-> arg1 show-pat-set)) (logtest? v1-37 (-> arg1 show-pat-set))) - (or (zero? (-> arg1 show-pat-clear)) (zero? (logand v1-37 (-> arg1 show-pat-clear)))) + (or (zero? (-> arg1 show-pat-clear)) (not (logtest? v1-37 (-> arg1 show-pat-clear)))) (or (zero? (-> arg1 event-mask)) (logtest? (-> arg1 event-mask) (ash 1 (-> v1-37 event)))) ) (let ((t0-5 (copy-and-set-field (-> *pat-mode-info* (-> v1-37 mode) color) a 64))) diff --git a/test/decompiler/reference/jak2/engine/collide/collide-shape_REF.gc b/test/decompiler/reference/jak2/engine/collide/collide-shape_REF.gc index 6741ee7966..9598b3549e 100644 --- a/test/decompiler/reference/jak2/engine/collide/collide-shape_REF.gc +++ b/test/decompiler/reference/jak2/engine/collide/collide-shape_REF.gc @@ -828,7 +828,7 @@ ) ) ) - (if (and a0-14 (zero? (logand (focus-status rail) (-> (the-as process-focusable a0-14) focus-status)))) + (if (and a0-14 (not (logtest? (focus-status rail) (-> (the-as process-focusable a0-14) focus-status)))) (set! (-> obj surf) *rail-surface*) ) ) @@ -874,7 +874,7 @@ (target-attack-up (the-as target (-> obj process)) 'attack-or-shove 'shockup) ) (((pat-event burnup)) - (when (not (logtest? (focus-status pilot) (-> (the-as process-focusable (-> obj process)) focus-status))) + (when (not (focus-test? (the-as process-focusable (-> obj process)) pilot)) (set! s5-0 (logior s5-0 #x4000)) (target-attack-up (the-as target (-> obj process)) 'attack-or-shove 'burnup) ) @@ -1036,7 +1036,7 @@ (let ((a1-1 (new 'stack-no-clear 'vector))) (set! (-> a1-1 quad) (-> arg3 quad)) (when (and (not (logtest? (-> arg0 prev-status) (collide-status on-surface))) - (zero? (logand (-> arg0 status) (collide-status touch-wall))) + (not (logtest? (-> arg0 status) (collide-status touch-wall))) ) (let ((f0-1 (- 1.0 (-> arg0 surf impact-fric)))) (when (< f0-1 1.0) @@ -3054,10 +3054,9 @@ (.sub.vf vf6 vf4 vf5 :mask #b111) (.svf (&-> sv-176 quad) vf6) (vector-normalize! sv-176 1.0) - (when (and (< arg2 (-> sv-176 y)) - (and (not (logtest? (focus-status dead hit board mech) (-> (the-as process-focusable gp-0) focus-status))) - (< (-> (the-as process-focusable gp-0) root-override transv y) 4.096) - ) + (when (and (< arg2 (-> sv-176 y)) (and (not (focus-test? (the-as process-focusable gp-0) dead hit board mech)) + (< (-> (the-as process-focusable gp-0) root-override transv y) 4.096) + ) ) (let ((s2-1 (new 'stack-no-clear 'vector))) (set! (-> s2-1 quad) (-> (the-as process-focusable gp-0) root-override transv quad)) diff --git a/test/decompiler/reference/jak2/engine/collide/collide-touch_REF.gc b/test/decompiler/reference/jak2/engine/collide/collide-touch_REF.gc index c966acddb5..b08b89d2b7 100644 --- a/test/decompiler/reference/jak2/engine/collide/collide-touch_REF.gc +++ b/test/decompiler/reference/jak2/engine/collide/collide-touch_REF.gc @@ -427,7 +427,7 @@ (let ((v1-1 (-> obj head))) (while v1-1 (let ((a0-1 (-> v1-1 prim1 cprim))) - (if (and (logtest? arg1 (-> a0-1 prim-core action)) (zero? (logand arg2 (-> a0-1 prim-core action)))) + (if (and (logtest? arg1 (-> a0-1 prim-core action)) (not (logtest? arg2 (-> a0-1 prim-core action)))) (return (the-as basic v1-1)) ) ) @@ -439,7 +439,7 @@ (let ((v1-4 (-> obj head))) (while v1-4 (let ((a0-5 (-> v1-4 prim2 cprim))) - (if (and (logtest? arg1 (-> a0-5 prim-core action)) (zero? (logand arg2 (-> a0-5 prim-core action)))) + (if (and (logtest? arg1 (-> a0-5 prim-core action)) (not (logtest? arg2 (-> a0-5 prim-core action)))) (return (the-as basic v1-4)) ) ) @@ -537,7 +537,3 @@ ) arg0 ) - - - - diff --git a/test/decompiler/reference/jak2/engine/collide/find-nearest_REF.gc b/test/decompiler/reference/jak2/engine/collide/find-nearest_REF.gc index d7152fd4f7..5727a15160 100644 --- a/test/decompiler/reference/jak2/engine/collide/find-nearest_REF.gc +++ b/test/decompiler/reference/jak2/engine/collide/find-nearest_REF.gc @@ -208,7 +208,7 @@ (lambda ((arg0 process-drawable)) (with-pp (when (and (logtest? (process-mask crate enemy collectable guard) (-> arg0 mask)) - (zero? (logand (process-mask no-track) (-> arg0 mask))) + (not (logtest? (process-mask no-track) (-> arg0 mask))) ) (let* ((gp-0 *search-info*) (s4-0 arg0) @@ -240,7 +240,7 @@ (if (and (type? s2-0 process-focusable) s2-0 s2-0 - (zero? (logand (-> (the-as process-focusable s2-0) focus-status) (focus-status disable dead))) + (not (logtest? (-> (the-as process-focusable s2-0) focus-status) (focus-status disable dead))) ) (set! s4-2 (get-trans (the-as process-focusable s2-0) 3)) ) @@ -416,9 +416,9 @@ ) ) ) - (when (and (and s3-0 (zero? (logand (-> (the-as process-focusable s3-0) focus-status) (focus-status disable dead)))) + (when (and (and s3-0 (not (logtest? (-> (the-as process-focusable s3-0) focus-status) (focus-status disable dead)))) (and (logtest? (process-mask crate enemy collectable guard) (-> s3-0 mask)) - (zero? (logand (process-mask no-track) (-> s3-0 mask))) + (not (logtest? (process-mask no-track) (-> s3-0 mask))) ) ) (let* ((s2-1 (get-trans (the-as process-focusable s3-0) 3)) diff --git a/test/decompiler/reference/jak2/engine/common_objs/base-plat_REF.gc b/test/decompiler/reference/jak2/engine/common_objs/base-plat_REF.gc index 0f2e6cc1da..b54f8ff127 100644 --- a/test/decompiler/reference/jak2/engine/common_objs/base-plat_REF.gc +++ b/test/decompiler/reference/jak2/engine/common_objs/base-plat_REF.gc @@ -271,7 +271,7 @@ eco-door-event-handler (when (and *target* (and (>= (-> self open-distance) (vector-vector-distance (-> self root-override trans) (-> *target* control trans)) ) - (zero? (logand (focus-status teleporting) (-> *target* focus-status))) + (not (logtest? (focus-status teleporting) (-> *target* focus-status))) ) ) (lock-according-to-task! self) @@ -343,7 +343,7 @@ eco-door-event-handler (or (not *target*) (or (< (-> self close-distance) (vector-vector-distance (-> self root-override trans) (-> *target* control trans)) ) - (logtest? (focus-status teleporting) (-> *target* focus-status)) + (focus-test? *target* teleporting) ) ) ) diff --git a/test/decompiler/reference/jak2/engine/common_objs/collectables_REF.gc b/test/decompiler/reference/jak2/engine/common_objs/collectables_REF.gc index 87ad14d9cd..751660a164 100644 --- a/test/decompiler/reference/jak2/engine/common_objs/collectables_REF.gc +++ b/test/decompiler/reference/jak2/engine/common_objs/collectables_REF.gc @@ -709,7 +709,7 @@ ) ) ((and arg2 (and (< (+ 4096.0 (-> *FACT-bank* suck-bounce-dist)) f0-0) - (zero? (logand (-> self flags) (collectable-flag suck-in))) + (not (logtest? (-> self flags) (collectable-flag suck-in))) ) ) (go-virtual wait) @@ -951,7 +951,7 @@ (if (and (logtest? (-> self fact options) (actor-option suck-in)) (not (and (-> self next-state) (= (-> self next-state name) 'pickup))) *target* - (zero? (logand (-> *target* focus-status) (focus-status dead))) + (not (logtest? (-> *target* focus-status) (focus-status dead))) ) (go-virtual suck (process->handle *target*)) ) @@ -986,7 +986,7 @@ ) (else (if (and (logtest? (-> self fact options) (actor-option suck-in)) - (zero? (logand (-> self flags) (collectable-flag no-eco-blue))) + (not (logtest? (-> self flags) (collectable-flag no-eco-blue))) ) (go-virtual notice-blue (process->handle *target*)) ) @@ -1094,7 +1094,7 @@ ) (or (or (not *target*) (or (< 204800.0 (vector-vector-distance (-> self root-override2 trans) (-> *target* control trans))) - (logtest? (focus-status teleporting) (-> *target* focus-status)) + (focus-test? *target* teleporting) ) ) (logtest? (-> self flags) (collectable-flag no-distance-check-fadeout)) @@ -1190,7 +1190,7 @@ (set! (-> a1-0 message) 'query) (set! (-> a1-0 param 0) (the-as uint 'powerup)) (set! (-> a1-0 param 1) (the-as uint 3)) - (if (and (not (send-event-function *target* a1-0)) (zero? (logand (-> self flags) (collectable-flag suck-in)))) + (if (and (not (send-event-function *target* a1-0)) (not (logtest? (-> self flags) (collectable-flag suck-in)))) (go-virtual wait) ) ) @@ -1587,10 +1587,10 @@ This commonly includes things such as: :trans (behavior () (if (and (and *target* (and (>= 32768.0 (vector-vector-distance (-> self root-override2 trans) (-> *target* control trans))) - (zero? (logand (focus-status teleporting) (-> *target* focus-status))) + (not (logtest? (focus-status teleporting) (-> *target* focus-status))) ) ) - (and (not (logtest? (-> *target* focus-status) (focus-status dead hit))) + (and (not (focus-test? *target* dead hit)) (case (-> self fact pickup-type) (((pickup-type eco-pill-dark)) (< (-> *game-info* eco-pill-dark) (-> *FACT-bank* eco-pill-dark-max-default)) diff --git a/test/decompiler/reference/jak2/engine/common_objs/crates_REF.gc b/test/decompiler/reference/jak2/engine/common_objs/crates_REF.gc index e362c484cd..62086afde7 100644 --- a/test/decompiler/reference/jak2/engine/common_objs/crates_REF.gc +++ b/test/decompiler/reference/jak2/engine/common_objs/crates_REF.gc @@ -512,7 +512,7 @@ (defbehavior crate-standard-event-handler crate ((arg0 process) (arg1 int) (arg2 symbol) (arg3 event-message-block)) (case arg2 (('track) - (zero? (logand (actor-option no-track) (-> self fact options))) + (not (logtest? (actor-option no-track) (-> self fact options))) ) (('attack) (let* ((v1-3 (the-as attack-info (-> arg3 param 1))) @@ -525,7 +525,7 @@ (('flop 'uppercut 'explode 'eco-yellow 'racer 'board 'tube 'flut-bonk 'flut-attack 'darkjak 'mech-punch) (if (and (logtest? (-> self fact options) (actor-option racer-only)) (= (-> arg0 type) target) - (zero? (logand (focus-status pilot) (-> (the-as target arg0) focus-status))) + (not (logtest? (focus-status pilot) (-> (the-as target arg0) focus-status))) ) (return #f) ) @@ -696,7 +696,7 @@ ) (and *target* (and (>= 40960.0 (vector-vector-distance (-> self root-override2 trans) (-> *target* control trans))) - (zero? (logand (focus-status teleporting) (-> *target* focus-status))) + (not (logtest? (focus-status teleporting) (-> *target* focus-status))) ) ) ) @@ -978,10 +978,7 @@ (stop! (-> self sound)) ) (let ((v1-10 (handle->process (-> self target)))) - (if (and (and v1-10 - (= (-> v1-10 type) target) - (logtest? (focus-status flut tube board pilot) (-> (the-as process-focusable v1-10) focus-status)) - ) + (if (and (and v1-10 (= (-> v1-10 type) target) (focus-test? (the-as process-focusable v1-10) flut tube board pilot)) (and (!= (-> self fact pickup-type) 10) (not arg0)) ) (logior! (-> self fact options) (actor-option suck-in)) diff --git a/test/decompiler/reference/jak2/engine/common_objs/elevator_REF.gc b/test/decompiler/reference/jak2/engine/common_objs/elevator_REF.gc index 3f9d096331..14ef964466 100644 --- a/test/decompiler/reference/jak2/engine/common_objs/elevator_REF.gc +++ b/test/decompiler/reference/jak2/engine/common_objs/elevator_REF.gc @@ -531,10 +531,10 @@ do so. (local-vars (zero float)) (let ((target *target*)) (when (and target - (zero? (logand (focus-status dead inactive in-air grabbed edge-grab pole pilot-riding pilot teleporting) + (not (logtest? (focus-status dead inactive in-air grabbed edge-grab pole pilot-riding pilot teleporting) (-> target focus-status) ) - ) + ) ) (set! zero (the-as float 0.0)) (when (and (find-closest-point-in-path! obj (get-trans target 0) (& zero) #t #t) (!= (-> obj move-pos 1) zero)) @@ -614,7 +614,7 @@ do so. (set! (-> self ride-timer) (-> self clock frame-counter)) (-> self params) (if (and (logtest? (-> self params flags) (elevator-flags elevator-flags-0)) - (zero? (logand (-> self params flags) (elevator-flags elevator-flags-3))) + (not (logtest? (-> self params flags) (elevator-flags elevator-flags-3))) ) (move-to-next-point! self) ) @@ -776,7 +776,7 @@ do so. :trans (behavior () (if (and (< (- (-> self ride-timer) (-> self sticky-player-last-ride-time)) (seconds 2)) (begin *target* *target*) - (logtest? (-> *target* focus-status) (focus-status in-air)) + (focus-test? *target* in-air) ) (set! (-> self ride-timer) (-> self clock frame-counter)) ) diff --git a/test/decompiler/reference/jak2/engine/common_objs/generic-obs_REF.gc b/test/decompiler/reference/jak2/engine/common_objs/generic-obs_REF.gc index b3c040125b..669afc9ebb 100644 --- a/test/decompiler/reference/jak2/engine/common_objs/generic-obs_REF.gc +++ b/test/decompiler/reference/jak2/engine/common_objs/generic-obs_REF.gc @@ -226,7 +226,7 @@ ) ) ) - (and a0-7 (logtest? (-> (the-as process-focusable a0-7) focus-status) (focus-status pole))) + (and a0-7 (focus-test? (the-as process-focusable a0-7) pole)) ) (move-along-path self) (suspend) @@ -1944,7 +1944,7 @@ This commonly includes things such as: ) ) ) - (the-as symbol (if (and a0-2 (logtest? (-> a0-2 focus-status) (focus-status grabbed))) + (the-as symbol (if (and a0-2 (focus-test? a0-2 grabbed)) (send-event a0-2 'end-mode) #t ) @@ -2729,7 +2729,7 @@ This commonly includes things such as: (when (and *target* (and (>= (-> self active-distance) (vector-vector-distance (-> self root-override trans) (-> *target* control trans)) ) - (zero? (logand (focus-status teleporting) (-> *target* focus-status))) + (not (logtest? (focus-status teleporting) (-> *target* focus-status))) ) ) (cond @@ -2746,7 +2746,7 @@ This commonly includes things such as: ) (if (and (and *target* (and (>= 32768.0 (vector-vector-distance (-> self root-override trans) (-> *target* control trans))) - (zero? (logand (focus-status teleporting) (-> *target* focus-status))) + (not (logtest? (focus-status teleporting) (-> *target* focus-status))) ) ) (not (send-event *target* 'query 'powerup (pickup-type eco-blue))) @@ -2794,7 +2794,7 @@ This commonly includes things such as: (if (or (or (not *target*) (or (< (-> self active-distance) (vector-vector-distance (-> self root-override trans) (-> *target* control trans)) ) - (logtest? (focus-status teleporting) (-> *target* focus-status)) + (focus-test? *target* teleporting) ) ) (not (send-event *target* 'query 'powerup (pickup-type eco-blue))) @@ -2806,7 +2806,7 @@ This commonly includes things such as: (if (and (and *target* (and (>= (+ 2867.2 (-> self root-override root-prim prim-core world-sphere w)) (vector-vector-distance (-> self root-override trans) (-> *target* control trans)) ) - (zero? (logand (focus-status teleporting) (-> *target* focus-status))) + (not (logtest? (focus-status teleporting) (-> *target* focus-status))) ) ) (< (- (-> self clock frame-counter) (-> self state-time)) (seconds 0.5)) diff --git a/test/decompiler/reference/jak2/engine/common_objs/plat_REF.gc b/test/decompiler/reference/jak2/engine/common_objs/plat_REF.gc index 4c0551f540..5927d49861 100644 --- a/test/decompiler/reference/jak2/engine/common_objs/plat_REF.gc +++ b/test/decompiler/reference/jak2/engine/common_objs/plat_REF.gc @@ -298,7 +298,7 @@ This commonly includes things such as: ) ) (cond - ((and proc-focus (logtest? (-> proc-focus focus-status) (focus-status edge-grab))) + ((and proc-focus (focus-test? proc-focus edge-grab)) (set! (-> self safe-time) (+ (-> self clock frame-counter) (seconds 0.2))) (return (the-as object #f)) ) diff --git a/test/decompiler/reference/jak2/engine/common_objs/powerups_REF.gc b/test/decompiler/reference/jak2/engine/common_objs/powerups_REF.gc index 7a14a28619..5fd83a2b93 100644 --- a/test/decompiler/reference/jak2/engine/common_objs/powerups_REF.gc +++ b/test/decompiler/reference/jak2/engine/common_objs/powerups_REF.gc @@ -576,7 +576,7 @@ (set! (-> self game eco-pill-dark) (-> *FACT-bank* eco-pill-dark-max-default)) ) (when (and (< 0.0 (-> (the-as fact-info-target (-> self fact-override)) eco-level)) - (not (logtest? (-> self focus-status) (focus-status in-head))) + (not (focus-test? self in-head)) (not (logtest? (-> self draw status) (draw-control-status no-draw no-draw-temp))) (not (movie?)) (rand-vu-percent? (lerp-scale @@ -673,7 +673,7 @@ (let ((v1-99 (rand-vu-int-range 3 (+ (-> self node-list length) -1)))) (cond ((and (logtest? (-> self control mod-surface flags) (surface-flag air)) - (zero? (logand (-> self control status) (collide-status on-surface))) + (not (logtest? (-> self control status) (collide-status on-surface))) ) (set! (-> *part-id-table* 543 init-specs 4 initial-valuef) 0.0) (set! (-> *part-id-table* 543 init-specs 4 random-rangef) 65536.0) @@ -888,7 +888,7 @@ ;; WARN: Return type mismatch int vs none. (defbehavior target-powerup-process target () (let ((f30-0 (-> self control collision-spheres 0 prim-core world-sphere w))) - (if (logtest? (focus-status board) (-> self focus-status)) + (if (focus-test? self board) (set! (-> self control collision-spheres 0 prim-core world-sphere w) (+ 4096.0 (-> self control collision-spheres 0 prim-core world-sphere w)) ) @@ -897,7 +897,7 @@ (set! (-> self control collision-spheres 0 prim-core world-sphere w) f30-0) ) (if (and (logtest? (-> self water flags) (water-flags under-water)) - (zero? (logand (-> self water flags) (water-flags swim-ground))) + (not (logtest? (-> self water flags) (water-flags swim-ground))) ) (set! (-> self control unknown-time-frame26) (-> self clock frame-counter)) (set! (-> self control unknown-time-frame27) (-> self clock frame-counter)) @@ -1099,7 +1099,7 @@ (('sewer 'forest) (let ((f30-2 (-> self board camera-interp))) (cond - ((logtest? (focus-status board) (-> self focus-status)) + ((focus-test? self board) (seek! (-> self board camera-interp) 1.0 (* 0.1 (-> self clock seconds-per-frame))) ) ((< (-> self control ctrl-xz-vel) 2048.0) @@ -1129,7 +1129,7 @@ ) ) (logclear! (-> self focus-status) (focus-status super)) - (if (or (logtest? (-> self focus-status) (focus-status dead hit)) + (if (or (focus-test? self dead hit) (logtest? (state-flags sf2 tinvul1 sf5 tinvul2) (-> self state-flags)) (-> *setting-control* user-current ignore-target) ) @@ -1138,9 +1138,9 @@ ) (cond ((or (and (logtest? (-> self control mod-surface flags) (surface-flag air)) - (zero? (logand (-> self control status) (collide-status on-surface))) + (not (logtest? (-> self control status) (collide-status on-surface))) ) - (and (logtest? (focus-status board) (-> self focus-status)) + (and (focus-test? self board) (< (- (-> self clock frame-counter) (-> self board unknown-time-frame00)) (seconds 0.1)) ) ) @@ -1168,7 +1168,7 @@ (logclear! (-> self focus-status) (focus-status on-water)) ) (if (and (logtest? (-> self water flags) (water-flags under-water)) - (zero? (logand (-> self water flags) (water-flags swim-ground))) + (not (logtest? (-> self water flags) (water-flags swim-ground))) ) (logior! (-> self focus-status) (focus-status under-water)) (logclear! (-> self focus-status) (focus-status under-water)) @@ -1211,7 +1211,3 @@ 0 (none) ) - - - - diff --git a/test/decompiler/reference/jak2/engine/common_objs/rigid-body-plat_REF.gc b/test/decompiler/reference/jak2/engine/common_objs/rigid-body-plat_REF.gc index effcb58cdd..794f3f0865 100644 --- a/test/decompiler/reference/jak2/engine/common_objs/rigid-body-plat_REF.gc +++ b/test/decompiler/reference/jak2/engine/common_objs/rigid-body-plat_REF.gc @@ -368,7 +368,7 @@ ) (when (and v1-11 (logtest? (-> v1-11 mask) (process-mask target)) - (zero? (logand (-> v1-11 focus-status) (focus-status on-water under-water))) + (not (logtest? (-> v1-11 focus-status) (focus-status on-water under-water))) ) (when (not (logtest? (-> obj flags) (rigid-body-object-flag player-impulse-force))) (logior! (-> obj flags) (rigid-body-object-flag player-contact-force)) diff --git a/test/decompiler/reference/jak2/engine/common_objs/voicebox_REF.gc b/test/decompiler/reference/jak2/engine/common_objs/voicebox_REF.gc index 195333745b..8858120f7a 100644 --- a/test/decompiler/reference/jak2/engine/common_objs/voicebox_REF.gc +++ b/test/decompiler/reference/jak2/engine/common_objs/voicebox_REF.gc @@ -299,7 +299,7 @@ ) ) ) - (if (and a0-1 (logtest? (focus-status pilot) (-> a0-1 focus-status))) + (if (and a0-1 (focus-test? a0-1 pilot)) (send-event (ppointer->process (-> self parent-override)) 'set-dist @@ -552,9 +552,7 @@ ) ) ) - (when (and s4-0 - (begin (send-event s5-2 'change-mode 'board #f) (logtest? (focus-status board) (-> s5-2 focus-status))) - ) + (when (and s4-0 (begin (send-event s5-2 'change-mode 'board #f) (focus-test? s5-2 board))) (change-parent self (ppointer->process s4-0)) (try-update-focus (-> self focus) s5-2) (go-virtual enter) diff --git a/test/decompiler/reference/jak2/engine/common_objs/water-anim_REF.gc b/test/decompiler/reference/jak2/engine/common_objs/water-anim_REF.gc index 41d2e4f115..24fa77fefd 100644 --- a/test/decompiler/reference/jak2/engine/common_objs/water-anim_REF.gc +++ b/test/decompiler/reference/jak2/engine/common_objs/water-anim_REF.gc @@ -422,7 +422,7 @@ (send-event (the-as process-tree gp-0) 'heat (* 10.0 (-> self clock seconds-per-frame))) ) (('drown-death 'lava 'dark-eco-pool) - (if (and (not (logtest? (focus-status board) (-> (the-as process-focusable gp-0) focus-status))) + (if (and (not (focus-test? (the-as process-focusable gp-0) board)) (let ((a1-10 (new 'stack-no-clear 'event-message-block))) (set! (-> a1-10 from) (process->ppointer self)) (set! (-> a1-10 num-params) 2) @@ -440,7 +440,7 @@ ) ) (else - (if (and (not (logtest? (focus-status board) (-> (the-as process-focusable gp-0) focus-status))) + (if (and (not (focus-test? (the-as process-focusable gp-0) board)) (let ((a1-13 (new 'stack-no-clear 'event-message-block))) (set! (-> a1-13 from) (process->ppointer self)) (set! (-> a1-13 num-params) 2) diff --git a/test/decompiler/reference/jak2/engine/common_objs/water_REF.gc b/test/decompiler/reference/jak2/engine/common_objs/water_REF.gc index 3f27fce646..3e8e6a46ee 100644 --- a/test/decompiler/reference/jak2/engine/common_objs/water_REF.gc +++ b/test/decompiler/reference/jak2/engine/common_objs/water_REF.gc @@ -832,7 +832,7 @@ (set! (-> obj drip-speed) 15.0) ) (if (and (not (logtest? (water-flags touch-water) (-> obj flags))) - (zero? (logand (-> obj process focus-status) (focus-status touch-water))) + (not (logtest? (-> obj process focus-status) (focus-status touch-water))) ) (enter-water obj) ) @@ -1021,7 +1021,7 @@ ) (if (and (logtest? (-> obj flags) (water-flags swim-ground)) (and v1-237 - (zero? (logand (-> (the-as collide-shape-moving (-> obj process control)) status) (collide-status on-water))) + (not (logtest? (-> (the-as collide-shape-moving (-> obj process control)) status) (collide-status on-water))) ) ) (set! (-> obj bob amp) (* 0.8 (-> obj bob amp))) @@ -1060,7 +1060,7 @@ (cond ((and (logtest? (-> obj flags) (water-flags swim-ground)) (logtest? (-> (the-as collide-shape-moving (-> obj process control)) status) (collide-status touch-surface)) - (zero? (logand (water-flags jump-out) (-> obj flags))) + (not (logtest? (water-flags jump-out) (-> obj flags))) ) (let ((v1-260 (new 'stack-no-clear 'vector))) (set! (-> v1-260 quad) (-> obj bottom 0 quad)) @@ -1068,7 +1068,7 @@ (let ((s3-3 (the-as collide-shape-moving (-> obj process control)))) (when (and (not (logtest? (-> s3-3 status) (collide-status touch-background))) (logtest? (water-flags swimming) (-> obj flags)) - (zero? (logand (focus-status board pilot) (-> obj process focus-status))) + (not (logtest? (focus-status board pilot) (-> obj process focus-status))) ) (let ((a1-42 (vector-! (new 'stack-no-clear 'vector) v1-260 (-> (the-as control-info s3-3) trans)))) (vector-float*! a1-42 a1-42 (-> pp clock frames-per-second)) @@ -1081,7 +1081,7 @@ ) ) ) - ((and (< (-> obj bottom 0 y) f30-1) (zero? (logand (water-flags jump-out) (-> obj flags)))) + ((and (< (-> obj bottom 0 y) f30-1) (not (logtest? (water-flags jump-out) (-> obj flags)))) (logior! (-> obj flags) (water-flags under-water)) ) ) @@ -1099,7 +1099,7 @@ (send-event (-> obj process) 'wade) (set! (-> obj flags) (logior (water-flags wading) (-> obj flags))) ) - ((and (< (-> obj bottom 0 y) f30-1) (zero? (logand (water-flags jump-out) (-> obj flags)))) + ((and (< (-> obj bottom 0 y) f30-1) (not (logtest? (water-flags jump-out) (-> obj flags)))) (logior! (-> obj flags) (water-flags under-water)) ) ) @@ -1130,7 +1130,7 @@ (when (and (logtest? (-> (the-as collide-shape-moving (-> obj process control)) status) (collide-status on-surface on-water) ) - (zero? (logand (focus-status board pilot) (-> obj process focus-status))) + (not (logtest? (focus-status board pilot) (-> obj process focus-status))) ) (when (< (-> obj process control trans y) (+ -1228.8 (-> obj base-height))) (send-event (-> obj process) 'no-look-around (seconds 1.5)) @@ -1632,7 +1632,7 @@ ) ) ) - (when (and a0-39 (zero? (logand (focus-status mech) (-> (the-as process-focusable a0-39) focus-status)))) + (when (and a0-39 (not (logtest? (focus-status mech) (-> (the-as process-focusable a0-39) focus-status)))) (set! (-> arg0 flags) (water-flags)) 0 ) @@ -1718,7 +1718,7 @@ (water-info<-region s3-0 (-> (the-as region-prim-area #x70000000) region-prim-list items s2-1) obj arg1) (when (and (logtest? (-> s3-0 flags) (water-flags active)) (logtest? (water-flags touch-water) (-> s3-0 flags)) - (zero? (logand (-> s3-0 extra-flags) 1)) + (not (logtest? (-> s3-0 extra-flags) 1)) ) (mem-copy! (the-as pointer arg0) (the-as pointer s3-0) 60) (set! arg0 arg0) diff --git a/test/decompiler/reference/jak2/engine/debug/default-menu_REF.gc b/test/decompiler/reference/jak2/engine/debug/default-menu_REF.gc index 7487d96f7c..65461db754 100644 --- a/test/decompiler/reference/jak2/engine/debug/default-menu_REF.gc +++ b/test/decompiler/reference/jak2/engine/debug/default-menu_REF.gc @@ -1162,7 +1162,7 @@ (if (= arg1 (debug-menu-msg press)) (logxor! (-> v1-0 flags) (prototype-flags disable)) ) - (zero? (logand (-> v1-0 flags) (prototype-flags disable))) + (not (logtest? (-> v1-0 flags) (prototype-flags disable))) ) (else #f diff --git a/test/decompiler/reference/jak2/engine/draw/drawable_REF.gc b/test/decompiler/reference/jak2/engine/draw/drawable_REF.gc index 31fa8ff1fc..9026da9aab 100644 --- a/test/decompiler/reference/jak2/engine/draw/drawable_REF.gc +++ b/test/decompiler/reference/jak2/engine/draw/drawable_REF.gc @@ -973,7 +973,7 @@ (when (and (nonzero? (-> dc shadow-ctrl)) (-> dc shadow-ctrl) (not (logtest? (-> dc shadow-ctrl settings flags) (shadow-flags disable-draw))) - (zero? (logand (-> dc shadow-ctrl settings flags) (shadow-flags shdf07))) + (not (logtest? (-> dc shadow-ctrl settings flags) (shadow-flags shdf07))) ) (let ((target-shadow-dir (new 'stack-no-clear 'vector)) (current-shadow-dir (-> dc shadow-ctrl settings shadow-dir)) diff --git a/test/decompiler/reference/jak2/engine/entity/actor-link-h_REF.gc b/test/decompiler/reference/jak2/engine/entity/actor-link-h_REF.gc index 1912bf5338..fdc0a1b9b9 100644 --- a/test/decompiler/reference/jak2/engine/entity/actor-link-h_REF.gc +++ b/test/decompiler/reference/jak2/engine/entity/actor-link-h_REF.gc @@ -392,7 +392,7 @@ ) (dotimes (s3-0 s4-0) (let ((a0-3 (entity-actor-lookup (-> arg0 entity) 'alt-actor s3-0))) - (if (or (not a0-3) (zero? (logand (-> a0-3 extra perm status) (entity-perm-status subtask-complete)))) + (if (or (not a0-3) (not (logtest? (-> a0-3 extra perm status) (entity-perm-status subtask-complete)))) (+! gp-0 1) ) ) diff --git a/test/decompiler/reference/jak2/engine/entity/entity_REF.gc b/test/decompiler/reference/jak2/engine/entity/entity_REF.gc index 2b788817f8..ffad1409ee 100644 --- a/test/decompiler/reference/jak2/engine/entity/entity_REF.gc +++ b/test/decompiler/reference/jak2/engine/entity/entity_REF.gc @@ -71,7 +71,6 @@ ) ;; definition for method 3 of type actor-group -;; INFO: this function exists in multiple non-identical object files (defmethod inspect actor-group ((obj actor-group)) (format #t "[~8x] ~A~%" obj (-> obj type)) (format #t "~Tlength: ~D~%" (-> obj length)) @@ -531,7 +530,6 @@ ) ;; definition for method 2 of type process -;; INFO: this function exists in multiple non-identical object files (defmethod print process ((obj process)) (cond ((and (-> obj top-thread) (!= (-> obj status) 'dead)) @@ -865,7 +863,7 @@ ;; definition for function update-actor-vis-box ;; WARN: Return type mismatch int vs none. (defun update-actor-vis-box ((arg0 process-drawable) (arg1 vector) (arg2 vector)) - (when (and arg0 (nonzero? (-> arg0 draw)) (zero? (logand (-> arg0 draw status) (draw-control-status no-draw)))) + (when (and arg0 (nonzero? (-> arg0 draw)) (not (logtest? (-> arg0 draw status) (draw-control-status no-draw)))) (let ((v1-5 (-> arg0 draw origin)) (f0-0 (-> arg0 draw bounds w)) ) @@ -2376,7 +2374,7 @@ (dotimes (s2-0 s3-1) (let ((v1-54 (-> s4-2 data s2-0))) (cond - ((and (logtest? (-> v1-54 kill-mask) (task-mask special)) (zero? (logand (-> v1-54 kill-mask) sv-32))) + ((and (logtest? (-> v1-54 kill-mask) (task-mask special)) (not (logtest? (-> v1-54 kill-mask) sv-32))) (when (not (or (-> v1-54 process) (logtest? (-> v1-54 perm status) (entity-perm-status bit-0 dead)))) (birth! (-> v1-54 entity)) (set! sv-24 (+ sv-24 1)) @@ -2388,7 +2386,7 @@ (else (if (and (-> v1-54 process) (not (logtest? (-> v1-54 perm status) (entity-perm-status no-kill))) - (zero? (logand (-> v1-54 process mask) (process-mask no-kill))) + (not (logtest? (-> v1-54 process mask) (process-mask no-kill))) ) (kill! (-> v1-54 entity)) ) @@ -2417,7 +2415,7 @@ (else (if (and (-> v1-67 process) (not (logtest? (-> v1-67 perm status) (entity-perm-status no-kill))) - (zero? (logand (-> v1-67 process mask) (process-mask no-kill))) + (not (logtest? (-> v1-67 process mask) (process-mask no-kill))) ) (kill! (-> v1-67 entity)) ) @@ -2436,7 +2434,7 @@ (cond ((and (< (vector-vector-distance (-> s1-0 trans) sv-16) (-> *ACTOR-bank* birth-dist)) (not (logtest? (-> s1-0 perm status) (entity-perm-status bit-9 bit-10))) - (zero? (logand (-> s1-0 kill-mask) sv-32)) + (not (logtest? (-> s1-0 kill-mask) sv-32)) ) (when (not (or (-> s1-0 process) (logtest? (-> s1-0 perm status) (entity-perm-status bit-0 dead)))) (birth! (-> s1-0 entity)) @@ -2449,7 +2447,7 @@ (else (if (and (-> s1-0 process) (not (logtest? (-> s1-0 perm status) (entity-perm-status no-kill))) - (zero? (logand (-> s1-0 process mask) (process-mask no-kill))) + (not (logtest? (-> s1-0 process mask) (process-mask no-kill))) ) (kill! (-> s1-0 entity)) ) @@ -2494,7 +2492,7 @@ (else (when (and (-> sv-48 process) (not (logtest? (-> sv-48 perm status) (entity-perm-status no-kill))) - (zero? (logand (-> sv-48 process mask) (process-mask no-kill))) + (not (logtest? (-> sv-48 process mask) (process-mask no-kill))) ) (kill! (-> sv-48 entity)) (set! sv-24 (+ sv-24 1)) diff --git a/test/decompiler/reference/jak2/engine/game/effect-control_REF.gc b/test/decompiler/reference/jak2/engine/game/effect-control_REF.gc index 14e995c139..a2cf8ae65d 100644 --- a/test/decompiler/reference/jak2/engine/game/effect-control_REF.gc +++ b/test/decompiler/reference/jak2/engine/game/effect-control_REF.gc @@ -105,10 +105,10 @@ ) (when v1-33 (cond - ((logtest? (-> v1-33 focus-status) (focus-status in-air)) + ((focus-test? v1-33 in-air) (set! (-> arg0 reg 0) (the-as uint 126)) ) - ((logtest? (-> v1-33 focus-status) (focus-status touch-water)) + ((focus-test? v1-33 touch-water) (set! (-> arg0 reg 0) (the-as uint 127)) ) (else @@ -1158,11 +1158,11 @@ ;; WARN: Return type mismatch int vs none. (defbehavior target-land-effect target () (cond - ((logtest? (-> self focus-status) (focus-status flut)) + ((focus-test? self flut) (do-effect (-> self skel effect) 'effect-land-poof -1.0 -1) (do-effect (-> self skel effect) 'effect-flut-land -1.0 -1) ) - ((logtest? (focus-status pilot) (-> self focus-status)) + ((focus-test? self pilot) (sound-play-by-name (sound-name-with-material "zoom-land" (-> self control ground-pat) "") (new-sound-id) diff --git a/test/decompiler/reference/jak2/engine/game/main_REF.gc b/test/decompiler/reference/jak2/engine/game/main_REF.gc index 0afbf81d52..c9b71c4936 100644 --- a/test/decompiler/reference/jak2/engine/game/main_REF.gc +++ b/test/decompiler/reference/jak2/engine/game/main_REF.gc @@ -173,7 +173,7 @@ ((and (or (cpad-hold? 0 select) (cpad-hold? 0 r2)) *debug-segment*) 'pause ) - ((and (not *debug-segment*) (zero? (logand (-> *cpad-list* cpads 0 button0-abs 0) (pad-buttons start)))) + ((and (not *debug-segment*) (not (logtest? (-> *cpad-list* cpads 0 button0-abs 0) (pad-buttons start)))) (if (pause-allowed?) 'pause *master-mode* @@ -1172,7 +1172,7 @@ (cond ((and (= *kernel-boot-message* 'demo) (not *master-exit*)) (let ((v1-109 (level-get-target-inside *level*))) - (when (and v1-109 (!= (-> v1-109 name) 'demo) (zero? (logand (-> v1-109 info level-flags) 1))) + (when (and v1-109 (!= (-> v1-109 name) 'demo) (not (logtest? (-> v1-109 info level-flags) 1))) (persist-with-delay *setting-control* 'sfx-volume (seconds 0.5) 'sfx-volume 'abs 0.0 0) (persist-with-delay *setting-control* 'music-volume (seconds 0.5) 'music-volume 'abs 0.0 0) (persist-with-delay *setting-control* 'dialog-volume (seconds 0.5) 'dialog-volume 'abs 0.0 0) diff --git a/test/decompiler/reference/jak2/engine/game/settings_REF.gc b/test/decompiler/reference/jak2/engine/game/settings_REF.gc index 9c032f0a43..ce758e0b76 100644 --- a/test/decompiler/reference/jak2/engine/game/settings_REF.gc +++ b/test/decompiler/reference/jak2/engine/game/settings_REF.gc @@ -1283,7 +1283,7 @@ (let ((s4-1 (-> obj cam-target))) (set! (-> s5-1 entity-or-mode-changed) #f) (if (and (not (name= (-> s5-1 entity-name) (-> s4-1 entity-name))) - (or (not *target*) (zero? (logand (-> *target* focus-status) (-> s4-1 entity-mask)))) + (or (not *target*) (not (logtest? (-> *target* focus-status) (-> s4-1 entity-mask)))) ) (set! (-> s4-1 entity-or-mode-changed) #t) ) 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 1238d4a96d..123cabab3c 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 @@ -539,14 +539,14 @@ ) ) ) - (if (or (and *target* (logtest? (-> *target* focus-status) (focus-status dead)) mgr-status) (= mgr-status 'busy)) + (if (or (and *target* (focus-test? *target* dead) mgr-status) (= mgr-status 'busy)) (return (the-as int #f)) ) ) (when restart? (let ((gp-1 0)) (let ((cur-lev (level-get-target-inside *level*))) - (when (and cur-lev (zero? (logand (-> cur-lev info level-flags) 1))) + (when (and cur-lev (not (logtest? (-> cur-lev info level-flags) 1))) (let ((game-nodes (-> *game-info* sub-task-list))) (dotimes (i (-> game-nodes length)) (when (nonzero? i) @@ -628,7 +628,7 @@ (when (nonzero? i) (let ((node (-> game-nodes i))) (when (string= arg0 (-> node name)) - (let ((gp-2 (zero? (logand (-> node flags) (game-task-node-flag closed))))) + (let ((gp-2 (not (logtest? (-> node flags) (game-task-node-flag closed))))) (close! node 'event) (return gp-2) ) @@ -670,7 +670,7 @@ (begin (dotimes (a3-3 4) (when (and (nonzero? (-> node parent-node a3-3)) - (zero? (logand (-> game-nodes (-> node parent-node a3-3) flags) (game-task-node-flag closed))) + (not (logtest? (-> game-nodes (-> node parent-node a3-3) flags) (game-task-node-flag closed))) ) (set! a3-4 #f) (goto cfg-14) @@ -836,7 +836,7 @@ (begin (dotimes (ii 4) (when (and (nonzero? (-> node parent-node ii)) - (zero? (logand (-> game-nodes (-> node parent-node ii) flags) (game-task-node-flag closed))) + (not (logtest? (-> game-nodes (-> node parent-node ii) flags) (game-task-node-flag closed))) ) (set! v1-19 #t) (goto cfg-17) @@ -876,7 +876,7 @@ (begin (dotimes (pi 4) (let ((t0-0 (-> node-info parent-node pi))) - (when (and (nonzero? t0-0) (zero? (logand (-> game-nodes t0-0 flags) (game-task-node-flag closed)))) + (when (and (nonzero? t0-0) (not (logtest? (-> game-nodes t0-0 flags) (game-task-node-flag closed)))) (set! a1-1 #f) (goto cfg-12) ) @@ -996,7 +996,7 @@ ) (('life) (if (and (not (task-complete? *game-info* (-> node task))) - (zero? (logand (-> node flags) (game-task-node-flag save-on-life))) + (not (logtest? (-> node flags) (game-task-node-flag save-on-life))) ) (logclear! (-> node flags) (game-task-node-flag closed)) ) @@ -1549,7 +1549,7 @@ (none) ) :code (behavior () - (when (and *target* (logtest? (-> *target* focus-status) (focus-status dead))) + (when (and *target* (focus-test? *target* dead)) (if (and (logtest? (-> self flags) (fail-mission-flags famflags-3)) (zero? (-> self message))) (deactivate self) ) @@ -1560,7 +1560,7 @@ (case (-> self message) (((fail-mission-message fammsg-0)) (while (begin - (if (and *target* (logtest? (-> *target* focus-status) (focus-status grabbed))) + (if (and *target* (focus-test? *target* grabbed)) (process-release? *target*) ) (let ((a1-0 (new 'stack-no-clear 'event-message-block))) @@ -1578,10 +1578,7 @@ (set! (-> v1-24 mode) 'bot) (set! (-> a1-0 param 1) (the-as uint v1-24)) ) - (not (or (send-event-function *target* a1-0) - (and *target* (logtest? (-> *target* focus-status) (focus-status dead))) - ) - ) + (not (or (send-event-function *target* a1-0) (and *target* (focus-test? *target* dead)))) ) ) (suspend) @@ -1767,7 +1764,7 @@ (else (task-node-reset 'life) (update-task-masks 'life) - (if (and *target* (logtest? (-> *target* focus-status) (focus-status dead grabbed))) + (if (and *target* (focus-test? *target* dead grabbed)) (send-event *target* 'end-mode) ) ) @@ -1814,7 +1811,7 @@ (the-as process #f) ) (when (not (logtest? (-> arg0 flags) (fail-mission-flags famflags-4))) - (if (not (and *target* (logtest? (-> *target* focus-status) (focus-status dead)) (zero? (-> self message)))) + (if (not (and *target* (focus-test? *target* dead) (zero? (-> self message)))) (set! (-> self stinger) (the-as uint (add-process *gui-control* *target* (gui-channel background) (gui-action play) "lose1" -99.0 0)) ) @@ -1893,7 +1890,7 @@ (add-setting! 'task arg0 0 0) (add-setting! 'task-manager (process->ppointer self) 0 0) (set! (-> self intro-time) (-> self clock frame-counter)) - (set! (-> self fail-on-death?) (zero? (logand (-> arg0 flags) (game-task-node-flag no-fail-on-death)))) + (set! (-> self fail-on-death?) (not (logtest? (-> arg0 flags) (game-task-node-flag no-fail-on-death)))) (when arg1 (let* ((v1-15 (level-get *level* arg1)) (a1-6 (if (and (nonzero? (-> v1-15 entity)) (> (-> v1-15 entity length) 0)) @@ -2124,7 +2121,7 @@ (or (zero? (-> obj info intro-delay)) (>= (- (-> pp clock frame-counter) (-> obj intro-time)) (the-as time-frame (-> obj info intro-delay))) ) - (and *target* (zero? (logand (focus-status dead teleporting) (-> *target* focus-status)))) + (and *target* (not (logtest? (focus-status dead teleporting) (-> *target* focus-status)))) ) ) ) diff --git a/test/decompiler/reference/jak2/engine/gfx/math-camera_REF.gc b/test/decompiler/reference/jak2/engine/gfx/math-camera_REF.gc index f6ffedd01e..ee2e1e0401 100644 --- a/test/decompiler/reference/jak2/engine/gfx/math-camera_REF.gc +++ b/test/decompiler/reference/jak2/engine/gfx/math-camera_REF.gc @@ -41,10 +41,7 @@ ;; WARN: Stack slot offset 16 signed mismatch ;; WARN: Stack slot offset 16 signed mismatch ;; WARN: Stack slot offset 16 signed mismatch -;; WARN: Failed store: (s.w! a0-43 v1-54) at op 457 -;; WARN: Failed store: (s.w! (+ a0-43 4) a1-9) at op 461 -;; WARN: Failed store: (s.w! (+ a0-43 8) a1-10) at op 463 -;; WARN: Failed store: (s.w! (+ a0-43 12) a1-11) at op 465 +;; ERROR: Failed store: (s.w! a0-43 v1-54) at op 457 (defun update-math-camera ((arg0 math-camera) (arg1 symbol) (arg2 symbol) (arg3 float)) (local-vars (sv-16 float)) (set! (-> arg0 x-ratio) (tan (* 0.5 arg3))) @@ -377,7 +374,7 @@ (.add.vf vf28 vf28 vf30) (.max.x.vf vf28 vf28 vf0 :mask #b1000) (.svf (&-> arg0 quad) vf28) - (zero? (logand v1-2 63)) + (not (logtest? v1-2 63)) ) ) @@ -426,7 +423,7 @@ (.max.x.vf vf28 vf28 vf0 :mask #b1000) (vftoi4.xyzw vf28 vf28) (.svf (&-> arg0 quad) vf28) - (zero? (logand v1-2 63)) + (not (logtest? v1-2 63)) ) ) @@ -474,7 +471,7 @@ (.add.vf vf28 vf28 vf30) (.max.x.vf vf28 vf28 vf0 :mask #b1000) (.svf (&-> arg0 quad) vf28) - (zero? (logand v1-2 63)) + (not (logtest? v1-2 63)) (.mov v0-0 vf23) v0-0 ) diff --git a/test/decompiler/reference/jak2/engine/gfx/mood/mood-funcs2_REF.gc b/test/decompiler/reference/jak2/engine/gfx/mood/mood-funcs2_REF.gc index a3e4d698f3..36ac60becc 100644 --- a/test/decompiler/reference/jak2/engine/gfx/mood/mood-funcs2_REF.gc +++ b/test/decompiler/reference/jak2/engine/gfx/mood/mood-funcs2_REF.gc @@ -802,7 +802,7 @@ (set! (-> s5-0 clock-sun) (the-as uint (the int (rand-vu-float-range 64.0 192.0)))) (set! (-> s5-0 clock-moon) (the-as uint (the int (rand-vu-float-range 64.0 192.0)))) ) - (if (and (-> s5-0 door) (zero? (logand (-> s5-0 door extra perm status) (entity-perm-status subtask-complete)))) + (if (and (-> s5-0 door) (not (logtest? (-> s5-0 door extra perm status) (entity-perm-status subtask-complete)))) (set! (-> arg0 times 0 quad) (-> *level* default-level mood-context times 0 quad)) ) ) 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 5fbd4db2a6..2f3a6c9122 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 @@ -868,7 +868,7 @@ (cond ((and (logtest? (-> arg2 flags) (sp-cpuinfo-flag sp-cpuinfo-flag-12)) (not (logtest? (-> arg2 flags) (sp-cpuinfo-flag distort))) - (zero? (logand (-> arg2 flags) (sp-cpuinfo-flag glow))) + (not (logtest? (-> arg2 flags) (sp-cpuinfo-flag glow))) ) (let ((f20-0 (-> arg3 r-g-b-a x)) (f22-0 (-> arg3 r-g-b-a y)) @@ -1574,7 +1574,7 @@ (when (and (or (zero? (-> s0-1 param3)) (< (vector-vector-distance s5-1 (the-as vector (&-> s0-1 param0))) (the-as float (gpr->fpr (-> s0-1 param3)))) ) - (zero? (logand s4-1 (the-as int (-> s0-1 prev1)))) + (not (logtest? s4-1 (the-as int (-> s0-1 prev1)))) ) (let ((a1-14 (-> s0-1 next1)) (t9-5 sp-launch-particles-var) diff --git a/test/decompiler/reference/jak2/engine/level/level_REF.gc b/test/decompiler/reference/jak2/engine/level/level_REF.gc index abc6c983e9..4e23a2f267 100644 --- a/test/decompiler/reference/jak2/engine/level/level_REF.gc +++ b/test/decompiler/reference/jak2/engine/level/level_REF.gc @@ -2273,7 +2273,7 @@ ) (string= (-> *game-info* current-continue name) (-> (the-as continue-point s1-0) name)) ) - (zero? (logand (-> (the-as continue-point s1-0) flags) (continue-flags cf2 cf3))) + (not (logtest? (-> (the-as continue-point s1-0) flags) (continue-flags cf2 cf3))) ) (set! s3-0 (the-as continue-point s1-0)) (if (string= (-> *game-info* current-continue name) (-> (the-as continue-point s1-0) name)) @@ -2286,7 +2286,7 @@ ) (label cfg-59) (if (and (the-as continue-point s3-0) - (zero? (logand (-> (the-as continue-point s3-0) flags) (continue-flags cf2 cf3))) + (not (logtest? (-> (the-as continue-point s3-0) flags) (continue-flags cf2 cf3))) ) (set-continue! *game-info* (the-as basic s3-0) #f) ) diff --git a/test/decompiler/reference/jak2/engine/load/loader_REF.gc b/test/decompiler/reference/jak2/engine/load/loader_REF.gc index 5d3fa2023c..a74f6cc247 100644 --- a/test/decompiler/reference/jak2/engine/load/loader_REF.gc +++ b/test/decompiler/reference/jak2/engine/load/loader_REF.gc @@ -1563,7 +1563,7 @@ ) ((= v1-0 (gui-channel query)) (and (not (or (logtest? (-> *art-control* frame-mask) 28) (!= *master-mode* 'game))) - (and *target* (zero? (logand (-> *target* focus-status) (focus-status dead hit)))) + (and *target* (not (logtest? (-> *target* focus-status) (focus-status dead hit)))) ) ) (else diff --git a/test/decompiler/reference/jak2/engine/nav/nav-control_REF.gc b/test/decompiler/reference/jak2/engine/nav/nav-control_REF.gc index b9847b25bb..3733a5200d 100644 --- a/test/decompiler/reference/jak2/engine/nav/nav-control_REF.gc +++ b/test/decompiler/reference/jak2/engine/nav/nav-control_REF.gc @@ -1499,7 +1499,7 @@ Note that this doesn't actually return the nav-control, but instead adds this pr (set! (-> v1-20 next-poly) (-> a1-9 poly-array sv-188)) ) (cond - ((and (-> v1-20 next-poly) (zero? (logand (-> v1-20 next-poly pat) (-> v1-20 ignore)))) + ((and (-> v1-20 next-poly) (not (logtest? (-> v1-20 next-poly pat) (-> v1-20 ignore)))) (set! (-> v1-20 current-poly) (-> v1-20 next-poly)) ) (else @@ -1961,7 +1961,7 @@ Note that this doesn't actually return the nav-control, but instead adds this pr (set! (-> v1-19 next-poly) (-> t3-8 poly-array sv-180)) ) (cond - ((and (-> v1-19 next-poly) (zero? (logand (-> v1-19 next-poly pat) (-> v1-19 ignore)))) + ((and (-> v1-19 next-poly) (not (logtest? (-> v1-19 next-poly pat) (-> v1-19 ignore)))) (set! (-> v1-19 current-poly) (-> v1-19 next-poly)) ) (else @@ -2977,7 +2977,7 @@ Note that this doesn't actually return the nav-control, but instead adds this pr (set! (-> a3-5 next-poly) (-> t0-6 poly-array sv-148)) ) (cond - ((and (-> a3-5 next-poly) (zero? (logand (-> a3-5 next-poly pat) (-> a3-5 ignore)))) + ((and (-> a3-5 next-poly) (not (logtest? (-> a3-5 next-poly pat) (-> a3-5 ignore)))) (set! (-> a3-5 current-poly) (-> a3-5 next-poly)) ) (else @@ -3222,7 +3222,7 @@ Note that this doesn't actually return the nav-control, but instead adds this pr (set! (-> a1-6 next-poly) (-> a2-6 poly-array sv-244)) ) (cond - ((and (-> a1-6 next-poly) (zero? (logand (-> a1-6 next-poly pat) (-> a1-6 ignore)))) + ((and (-> a1-6 next-poly) (not (logtest? (-> a1-6 next-poly pat) (-> a1-6 ignore)))) (set! (-> a1-6 current-poly) (-> a1-6 next-poly)) ) (else @@ -3972,7 +3972,7 @@ Note that this doesn't actually return the nav-control, but instead adds this pr (set! (-> a2-5 next-poly) (-> a3-6 poly-array sv-244)) ) (cond - ((and (-> a2-5 next-poly) (zero? (logand (-> a2-5 next-poly pat) (-> a2-5 ignore)))) + ((and (-> a2-5 next-poly) (not (logtest? (-> a2-5 next-poly pat) (-> a2-5 ignore)))) (set! (-> a2-5 current-poly) (-> a2-5 next-poly)) ) (else diff --git a/test/decompiler/reference/jak2/engine/nav/nav-enemy_REF.gc b/test/decompiler/reference/jak2/engine/nav/nav-enemy_REF.gc index 01411012cf..894ecae48c 100644 --- a/test/decompiler/reference/jak2/engine/nav/nav-enemy_REF.gc +++ b/test/decompiler/reference/jak2/engine/nav/nav-enemy_REF.gc @@ -167,7 +167,7 @@ ) (when (not (logtest? (enemy-flag directed) (-> obj enemy-flags))) (let ((s5-0 (-> obj root-override2))) - (if (logtest? (-> obj focus-status) (focus-status under-water)) + (if (focus-test? obj under-water) (enemy-method-47 obj (-> s5-0 transv)) (+! (-> s5-0 transv y) (* (-> obj enemy-info-override movement-gravity) (-> pp clock seconds-per-frame))) ) @@ -187,7 +187,7 @@ ) ) (logclear! (-> obj enemy-flags) (enemy-flag directed)) - (if (and (enemy-method-102 obj) (zero? (logand (-> obj focus-status) (focus-status dead)))) + (if (and (enemy-method-102 obj) (not (logtest? (-> obj focus-status) (focus-status dead)))) (kill-prefer-falling obj) ) (the-as @@ -621,7 +621,7 @@ ) (cond ((-> obj enemy-info-override move-to-ground) - (if (logtest? (-> obj focus-status) (focus-status under-water)) + (if (focus-test? obj under-water) (enemy-method-47 obj (-> obj root-override2 transv)) (+! (-> obj root-override2 transv y) (* (-> obj enemy-info-override movement-gravity) (-> pp clock seconds-per-frame)) @@ -1339,7 +1339,7 @@ (do-navigation-to-destination (-> obj nav state) (-> obj root-override2 trans)) (if (and (-> obj enemy-info-override move-to-ground) (not (logtest? (enemy-flag vulnerable-backup) (-> obj enemy-flags))) - (zero? (logand (enemy-option ambush) (-> obj fact-info-override enemy-options))) + (not (logtest? (enemy-option ambush) (-> obj fact-info-override enemy-options))) ) (enemy-method-127 obj 40960.0 40960.0 #t (the-as collide-spec (-> obj gnd-collide))) ) diff --git a/test/decompiler/reference/jak2/engine/nav/nav-mesh-h_REF.gc b/test/decompiler/reference/jak2/engine/nav/nav-mesh-h_REF.gc index b2a9f25640..72bd52167e 100644 --- a/test/decompiler/reference/jak2/engine/nav/nav-mesh-h_REF.gc +++ b/test/decompiler/reference/jak2/engine/nav/nav-mesh-h_REF.gc @@ -845,7 +845,7 @@ and declared out of order (cannot use forward declared structures in inline arra (set! (-> ray next-poly) (-> obj poly-array sv-68)) ) (cond - ((and (-> ray next-poly) (zero? (logand (-> ray next-poly pat) (-> ray ignore)))) + ((and (-> ray next-poly) (not (logtest? (-> ray next-poly pat) (-> ray ignore)))) (set! (-> ray current-poly) (-> ray next-poly)) ) (else diff --git a/test/decompiler/reference/jak2/engine/nav/nav-mesh_REF.gc b/test/decompiler/reference/jak2/engine/nav/nav-mesh_REF.gc index 337774972e..1433a62dc0 100644 --- a/test/decompiler/reference/jak2/engine/nav/nav-mesh_REF.gc +++ b/test/decompiler/reference/jak2/engine/nav/nav-mesh_REF.gc @@ -1718,7 +1718,7 @@ (set! v1-6 (and a0-3 (begin (b! (>= f0-0 (- (-> v1-5 vertex2 w) f1-0)) cfg-9 :delay (set! v1-6 #t)) #f))) ) (label cfg-9) - (when (and v1-6 (zero? (logand (-> sv-16 pat) (-> arg0 ignore)))) + (when (and v1-6 (not (logtest? (-> sv-16 pat) (-> arg0 ignore)))) (if (point-in-poly? obj sv-16 (-> arg0 point)) (return sv-16) ) @@ -2071,7 +2071,7 @@ ) (b! (not (and (and (>= (+ (-> v1-6 vertex3 w) f1-0) f0-0) (>= f0-0 (- (-> v1-6 vertex2 w) f1-0))) - (zero? (logand (-> sv-24 pat) (-> arg0 ignore))) + (not (logtest? (-> sv-24 pat) (-> arg0 ignore))) ) ) cfg-16 @@ -2118,7 +2118,7 @@ (f1-2 (-> arg0 y-threshold)) ) (when (and (and (>= (+ (-> v1-22 vertex3 w) f1-2) f0-3) (>= f0-3 (- (-> v1-22 vertex2 w) f1-2))) - (zero? (logand (-> sv-48 pat) (-> arg0 ignore))) + (not (logtest? (-> sv-48 pat) (-> arg0 ignore))) ) (set! sv-40 (+ sv-40 1)) (set! sv-52 (point-poly-distance-min (-> obj work) (the-as nav-poly (-> arg0 point)) sv-28 sv-48)) @@ -2835,6 +2835,3 @@ (none) ) - - - diff --git a/test/decompiler/reference/jak2/engine/physics/rigid-body_REF.gc b/test/decompiler/reference/jak2/engine/physics/rigid-body_REF.gc index 5f9b3fab5b..61d1c6aff6 100644 --- a/test/decompiler/reference/jak2/engine/physics/rigid-body_REF.gc +++ b/test/decompiler/reference/jak2/engine/physics/rigid-body_REF.gc @@ -882,6 +882,7 @@ ) ;; definition for method 10 of type rigid-body-control +;; INFO: this function exists in multiple non-identical object files ;; WARN: Return type mismatch int vs object. (defmethod rigid-body-control-method-10 rigid-body-control ((obj rigid-body-control) (arg0 rigid-body-object) (arg1 float) (arg2 float)) (let* ((s4-1 (max 1 (min 4 (+ (the int (* 0.9999 (/ arg1 arg2))) 1)))) @@ -1325,7 +1326,7 @@ This commonly includes things such as: (local-vars (v1-2 symbol)) (b! (not (logtest? (process-mask target crate enemy) (-> arg0 mask))) cfg-5 :likely-delay (set! v1-2 #t)) (b! (not (logtest? (-> arg0 mask) (process-mask target))) cfg-5 :likely-delay (set! v1-2 #f)) - (set! v1-2 (logtest? (focus-status dangerous pilot) (-> arg0 focus-status))) + (set! v1-2 (focus-test? arg0 dangerous pilot)) (label cfg-5) (b! v1-2 cfg-17 :delay (nop!)) (let ((s5-0 (new 'stack-no-clear 'rigid-body-impact)) @@ -1467,7 +1468,7 @@ This commonly includes things such as: ) ) ) - (zero? (logand (-> obj focus-status) (focus-status dead inactive))) + (not (logtest? (-> obj focus-status) (focus-status dead inactive))) ) (('ridden) (let ((v1-45 (the-as object (-> arg3 param 0)))) @@ -1480,7 +1481,7 @@ This commonly includes things such as: ) (when (and a0-34 (logtest? (-> a0-34 mask) (process-mask target)) - (zero? (logand (-> a0-34 focus-status) (focus-status on-water under-water))) + (not (logtest? (-> a0-34 focus-status) (focus-status on-water under-water))) ) (when (not (logtest? (-> obj flags) (rigid-body-object-flag player-impulse-force))) (logior! (-> obj flags) (rigid-body-object-flag player-touching player-standing-on player-contact-force)) @@ -1538,7 +1539,7 @@ This commonly includes things such as: (if (and *target* (and (>= (-> self info extra idle-distance) (vector-vector-distance (-> self root-override-2 trans) (-> *target* control trans)) ) - (zero? (logand (focus-status teleporting) (-> *target* focus-status))) + (not (logtest? (focus-status teleporting) (-> *target* focus-status))) ) ) (go-virtual active) @@ -1561,7 +1562,7 @@ This commonly includes things such as: (or (< (+ 4096.0 (-> self info extra idle-distance)) (vector-vector-distance (-> self root-override-2 trans) (-> *target* control trans)) ) - (logtest? (focus-status teleporting) (-> *target* focus-status)) + (focus-test? *target* teleporting) ) ) (go-virtual idle) diff --git a/test/decompiler/reference/jak2/engine/process-drawable/focus_REF.gc b/test/decompiler/reference/jak2/engine/process-drawable/focus_REF.gc index 1955c2170c..3a7580a9cc 100644 --- a/test/decompiler/reference/jak2/engine/process-drawable/focus_REF.gc +++ b/test/decompiler/reference/jak2/engine/process-drawable/focus_REF.gc @@ -41,7 +41,7 @@ ;; definition for method 10 of type focus (defmethod collide-check? focus ((obj focus) (arg0 process-focusable)) - (when (and arg0 (zero? (logand (-> arg0 focus-status) (focus-status disable dead)))) + (when (and arg0 (not (logtest? (-> arg0 focus-status) (focus-status disable dead)))) (let* ((s5-0 (-> arg0 root-override)) (v1-2 (if (type? s5-0 collide-shape) s5-0 diff --git a/test/decompiler/reference/jak2/engine/process-drawable/process-drawable_REF.gc b/test/decompiler/reference/jak2/engine/process-drawable/process-drawable_REF.gc index 329eedafc2..fcd5f10520 100644 --- a/test/decompiler/reference/jak2/engine/process-drawable/process-drawable_REF.gc +++ b/test/decompiler/reference/jak2/engine/process-drawable/process-drawable_REF.gc @@ -1814,7 +1814,7 @@ ;; definition for function process-drawable-delay-player (defbehavior process-drawable-delay-player process-drawable ((arg0 time-frame)) - (while (and *target* (logtest? (-> *target* focus-status) (focus-status in-air))) + (while (and *target* (focus-test? *target* in-air)) (suspend) ) (set! (-> self state-time) (-> self clock frame-counter)) diff --git a/test/decompiler/reference/jak2/engine/process-drawable/process-taskable_REF.gc b/test/decompiler/reference/jak2/engine/process-drawable/process-taskable_REF.gc index 867000b31b..0acd900fa2 100644 --- a/test/decompiler/reference/jak2/engine/process-drawable/process-taskable_REF.gc +++ b/test/decompiler/reference/jak2/engine/process-drawable/process-taskable_REF.gc @@ -169,7 +169,7 @@ Seen take in - `true-func` which takes no args TODO - seems fishy (new 'static 'sound-id) ) ) - (and (zero? (logand (focus-status dead in-air in-head pole flut tube pilot mech dark) (-> *target* focus-status))) + (and (not (logtest? (focus-status dead in-air in-head pole flut tube pilot mech dark) (-> *target* focus-status))) (and (or (and (< (-> (target-pos 0) y) (+ (-> self root-override root-prim prim-core world-sphere y) (-> self talk-height))) (let ((s5-0 (get-trans self 2)) (f30-0 (if (= (-> gp-0 distance) 0.0) diff --git a/test/decompiler/reference/jak2/engine/scene/scene_REF.gc b/test/decompiler/reference/jak2/engine/scene/scene_REF.gc index 9818ab9e05..7fbf164416 100644 --- a/test/decompiler/reference/jak2/engine/scene/scene_REF.gc +++ b/test/decompiler/reference/jak2/engine/scene/scene_REF.gc @@ -1096,7 +1096,7 @@ (set-setting! 'bg-a-force 'abs #x3f800000 0) (apply-settings *setting-control*) ) - (if (or (not *target*) (or (logtest? (-> *target* focus-status) (focus-status grabbed)) + (if (or (not *target*) (or (focus-test? *target* grabbed) (begin (dotimes (v1-17 6) (when (= (-> *load-state* want v1-17 name) (-> *target* current-level name)) @@ -1114,7 +1114,7 @@ (set! arg0 #f) ) (while (and arg0 - (or (logtest? (-> *target* focus-status) (focus-status in-air)) + (or (focus-test? *target* in-air) (and (-> *target* next-state) (= (-> *target* next-state name) 'target-flop-hit-ground)) ) (-> self scene) @@ -1124,7 +1124,7 @@ ) (suspend) (let ((s5-0 (-> self clock frame-counter))) - (when (and *target* (zero? (logand (-> *target* focus-status) (focus-status grabbed)))) + (when (and *target* (not (logtest? (-> *target* focus-status) (focus-status grabbed)))) (label cfg-44) (when (not (process-grab? *target* #f)) (suspend) @@ -1208,7 +1208,7 @@ ) ) ) - (if (and *target* (logtest? (focus-status in-head flut board pilot mech dark) (-> *target* focus-status))) + (if (and *target* (focus-test? *target* in-head flut board pilot mech dark)) (send-event *target* 'change-mode 'normal) ) (when (< (-> self scene-index) (-> self scene-list length)) @@ -1462,7 +1462,7 @@ ) ) ) - (if (and (-> self wait) *target* (logtest? (-> *target* focus-status) (focus-status grabbed))) + (if (and (-> self wait) *target* (focus-test? *target* grabbed)) (go-virtual release) ) (none) diff --git a/test/decompiler/reference/jak2/engine/sound/speech_REF.gc b/test/decompiler/reference/jak2/engine/sound/speech_REF.gc index cef20256e1..5651b92e23 100644 --- a/test/decompiler/reference/jak2/engine/sound/speech_REF.gc +++ b/test/decompiler/reference/jak2/engine/sound/speech_REF.gc @@ -296,10 +296,10 @@ (let ((v1-3 *target*)) (when v1-3 (cond - ((logtest? (focus-status dark) (-> v1-3 focus-status)) + ((focus-test? v1-3 dark) (speech-control-method-12 obj arg0 (speech-type speech-type-3)) ) - ((logtest? (focus-status pilot) (-> v1-3 focus-status)) + ((focus-test? v1-3 pilot) (speech-control-method-12 obj arg0 (speech-type speech-type-0 speech-type-1 speech-type-2)) ) (else 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 4d728e41f8..22306b55b0 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 @@ -408,7 +408,7 @@ (and (logtest? (-> self game features) (game-feature board)) (or (and (cpad-pressed? (-> self control cpad number) r2) (or (!= *cheat-mode* 'debug) - (zero? (logand (-> *cpad-list* cpads (-> self control cpad number) button0-abs 0) (pad-buttons l2))) + (not (logtest? (-> *cpad-list* cpads (-> self control cpad number) button0-abs 0) (pad-buttons l2))) ) (not *pause-lock*) (>= (- (-> self clock frame-counter) (-> self control time-of-last-debug-heal)) (seconds 0.1)) @@ -416,15 +416,14 @@ ) (-> self board latch?) ) - (not (logtest? (focus-status dead hit grabbed in-head edge-grab pole board pilot mech dark) (-> self focus-status)) - ) + (not (focus-test? self dead hit grabbed in-head edge-grab pole board pilot mech dark)) (or (zero? (-> self board)) (>= (- (-> self clock frame-counter) (-> self board board-time)) (seconds 0.5))) (not (logtest? (state-flags prevent-board) (-> self state-flags))) (< (-> self board board-time) (-> self control list-time-on-ground)) (not (logtest? (surface-flag no-board) (-> self control current-surface flags))) (or (not (logtest? (-> self control current-surface flags) (surface-flag duck))) (can-exit-duck? self)) (not (and (logtest? (-> self water flags) (water-flags under-water)) - (zero? (logand (-> self water flags) (water-flags swim-ground))) + (not (logtest? (-> self water flags) (water-flags swim-ground))) ) ) (not *artist-fix-visible*) @@ -435,7 +434,7 @@ ) (let ((v1-51 (new 'stack-no-clear 'vector))) (set! (-> v1-51 quad) (-> self control trans quad)) - (if (logtest? (-> self focus-status) (focus-status on-water)) + (if (focus-test? self on-water) (set! (-> v1-51 y) (-> self water height)) ) (set! (-> s5-0 0 quad) (-> v1-51 quad)) 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 1f3de35cff..2d601e5fd8 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 @@ -181,7 +181,7 @@ target-board-flip (-> *TARGET_BOARD-bank* jump-height-min) (-> *TARGET_BOARD-bank* jump-height-max) - (if (logtest? (focus-status halfpipe) (-> self focus-status)) + (if (focus-test? self halfpipe) 'halfpipe ) ) @@ -229,7 +229,7 @@ target-board-hold (-> *TARGET_BOARD-bank* tricky-jump-height-min) (-> *TARGET_BOARD-bank* tricky-jump-height-max) - (if (logtest? (focus-status halfpipe) (-> self focus-status)) + (if (focus-test? self halfpipe) 'halfpipe ) ) @@ -252,7 +252,7 @@ target-board-trickx (-> *TARGET_BOARD-bank* trickx-jump-height-min) (-> *TARGET_BOARD-bank* trickx-jump-height-max) - (if (logtest? (focus-status halfpipe) (-> self focus-status)) + (if (focus-test? self halfpipe) 'halfpipe ) ) @@ -266,7 +266,7 @@ ;; definition for function target-board-halfpipe-trans ;; WARN: Return type mismatch int vs none. (defbehavior target-board-halfpipe-trans target () - (when (and (logtest? (focus-status halfpipe) (-> self focus-status)) *camera*) + (when (and (focus-test? self halfpipe) *camera*) (let ((gp-0 (new 'stack-no-clear 'vector))) (let ((s5-0 (camera-master-method-15 *camera* (new 'stack-no-clear 'vector)))) (vector-flatten! gp-0 (-> self control edge-grab-across-edge-dir) (-> *camera* local-down)) @@ -1364,7 +1364,7 @@ :exit (-> target-board-halfpipe exit) :trans (behavior () (target-board-jump-trans) - (if (logtest? (focus-status halfpipe) (-> self focus-status)) + (if (focus-test? self halfpipe) (target-board-halfpipe-trans) ) (when (and (= *cheat-mode* 'debug) (and (cpad-hold? (-> self control cpad number) r2) (not *pause-lock*))) @@ -1411,7 +1411,7 @@ ) ) (cond - ((logtest? (focus-status halfpipe) (-> self focus-status)) + ((focus-test? self halfpipe) (ja :group! (-> self draw art-group data 152) :num! (identity (ja-aframe 0.0 0))) (loop (suspend) @@ -2054,7 +2054,7 @@ (go target-board-jump (-> *TARGET_BOARD-bank* jump-height-min) (-> *TARGET_BOARD-bank* jump-height-max) #f) ) (if (and (cpad-hold? (-> self control cpad number) l1) - (zero? (logand (-> self state-flags) (state-flags prevent-duck))) + (not (logtest? (-> self state-flags) (state-flags prevent-duck))) ) (go target-board-duck-stance) ) @@ -3109,7 +3109,7 @@ (logclear! (-> self focus-status) (focus-status dead hit)) (logclear! (-> self state-flags) (state-flags disable-attacks)) ) - (let ((gp-1 (logtest? (-> self focus-status) (focus-status hit)))) + (let ((gp-1 (focus-test? self hit))) (target-exit) (if gp-1 (logior! (-> self focus-status) (focus-status hit)) 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 7e03830494..39c5e05c75 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,14 +62,13 @@ :virtual #t :trans (behavior () (let ((v1-0 (-> self parent))) - (if (not (logtest? (-> (the-as target (if v1-0 - (the-as target (-> v1-0 0 self)) - ) - ) - focus-status - ) - (focus-status in-head) + (if (not (focus-test? + (the-as target (if v1-0 + (the-as target (-> v1-0 0 self)) + ) ) + in-head + ) ) (go-virtual idle #f) ) @@ -98,14 +97,13 @@ ) :trans (behavior () (let ((v1-0 (-> self parent))) - (if (logtest? (-> (the-as target (if v1-0 - (the-as target (-> v1-0 0 self)) - ) - ) - focus-status - ) - (focus-status in-head) + (if (focus-test? + (the-as target (if v1-0 + (the-as target (-> v1-0 0 self)) + ) ) + in-head + ) (go-virtual hidden) ) ) @@ -155,14 +153,13 @@ ) (let ((v1-2 (-> self parent))) (cond - ((logtest? (-> (the-as target (if v1-2 - (the-as target (-> v1-2 0 self)) - ) - ) - focus-status - ) - (focus-status in-head) + ((focus-test? + (the-as target (if v1-2 + (the-as target (-> v1-2 0 self)) + ) ) + in-head + ) (go-virtual hidden) ) ((let ((v1-9 #x40000) 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 523cb94284..95c358e670 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 @@ -461,22 +461,8 @@ ;; definition for function target-board-handler ;; WARN: Return type mismatch none vs object. -;; WARN: rewrite_to_get_var got a none typed variable. Is there unreachable code? [OP: 41] -;; WARN: rewrite_to_get_var got a none typed variable. Is there unreachable code? [OP: 46] -;; WARN: rewrite_to_get_var got a none typed variable. Is there unreachable code? [OP: 65] -;; WARN: rewrite_to_get_var got a none typed variable. Is there unreachable code? [OP: 73] -;; WARN: rewrite_to_get_var got a none typed variable. Is there unreachable code? [OP: 92] -;; WARN: rewrite_to_get_var got a none typed variable. Is there unreachable code? [OP: 99] -;; WARN: rewrite_to_get_var got a none typed variable. Is there unreachable code? [OP: 203] -;; WARN: rewrite_to_get_var got a none typed variable. Is there unreachable code? [OP: 353] -;; WARN: rewrite_to_get_var got a none typed variable. Is there unreachable code? [OP: 358] -;; WARN: rewrite_to_get_var got a none typed variable. Is there unreachable code? [OP: 318] -;; WARN: rewrite_to_get_var got a none typed variable. Is there unreachable code? [OP: 134] -;; WARN: rewrite_to_get_var got a none typed variable. Is there unreachable code? [OP: 116] -;; WARN: rewrite_to_get_var got a none typed variable. Is there unreachable code? [OP: 29] -;; WARN: rewrite_to_get_var got a none typed variable. Is there unreachable code? [OP: 10] (defbehavior target-board-handler target ((arg0 process) (arg1 int) (arg2 symbol) (arg3 event-message-block)) - (local-vars (v0-0 none) (a0-10 uint)) + (local-vars (v0-0 object) (a0-10 uint)) (the-as object (cond @@ -492,7 +478,7 @@ ((= v1-3 'change-mode) (let ((v1-7 (-> arg3 param 0))) (b! (!= v1-7 'grab) cfg-19 :delay (set! a0-10 (the-as uint #f))) - (b! (logtest? (-> self focus-status) (focus-status dead)) cfg-18 :delay (set! v0-0 (the-as none #f))) + (b! (focus-test? self dead) cfg-18 :delay (set! v0-0 #f)) (set! v0-0 (if (not (-> arg3 param 1)) #t (go target-board-grab (the-as symbol a0-10)) @@ -586,7 +572,7 @@ (-> self control penetrate-using) ) (process-spawn part-tracker :init part-tracker-init (-> *part-group-id-table* 117) 0 #f #f self 25 :to self) - (target-timed-invulnerable (seconds 0.5) self 2) + (the-as object (target-timed-invulnerable (seconds 0.5) self 2)) ) ) (else @@ -601,9 +587,9 @@ (set! (-> v1-61 penetrate-using) (-> self control penetrate-using)) (set! (-> a1-15 param 1) (the-as uint v1-61)) ) - (set! v0-0 (the-as none (send-event-function arg0 a1-15))) + (set! v0-0 (send-event-function arg0 a1-15)) ) - (when (the-as object v0-0) + (when v0-0 (let* ((v1-63 (-> self game)) (a0-68 (+ (-> v1-63 attack-id) 1)) ) @@ -625,7 +611,7 @@ ) ) ((= v1-3 'shove) - (when (not (logtest? (-> self focus-status) (focus-status hit))) + (when (not (focus-test? self hit)) (mem-copy! (the-as pointer (-> self attack-info-rec)) (the-as pointer (-> arg3 param 1)) 160) (when (not (logtest? (-> self attack-info-rec mask) (attack-info-mask attacker))) (set! (-> self attack-info-rec attacker) (process->handle arg0)) @@ -880,7 +866,7 @@ (< 0.7 (-> self control touch-angle)) (< 73728.0 (-> self control ctrl-xz-vel)) (and (< (vector-dot (-> self control wall-contact-normal) (-> self control dynam gravity-normal)) 0.3) - (zero? (logand (-> self control status) (collide-status touch-actor))) + (not (logtest? (-> self control status) (collide-status touch-actor))) ) ) (set! (-> self board smack-surface-time) (-> self clock frame-counter)) @@ -1067,12 +1053,12 @@ (defbehavior target-board-exit-check target () (if (and (or (and (cpad-pressed? (-> self control cpad number) r2) (or (!= *cheat-mode* 'debug) - (zero? (logand (-> *cpad-list* cpads (-> self control cpad number) button0-abs 0) (pad-buttons l2))) + (not (logtest? (-> *cpad-list* cpads (-> self control cpad number) button0-abs 0) (pad-buttons l2))) ) (not *pause-lock*) ) (logtest? (state-flags prevent-board) (-> self state-flags)) - (zero? (logand (-> *game-info* features) (game-feature board))) + (not (logtest? (-> *game-info* features) (game-feature board))) ) (and (>= (- (-> self clock frame-counter) (-> self board board-get-on-time)) (seconds 1)) (< (-> self board board-get-on-time) @@ -1092,7 +1078,7 @@ (defbehavior target-board-effect target () (let ((gp-0 0)) (cond - ((logtest? (focus-status rail) (-> self focus-status)) + ((focus-test? self rail) (set! gp-0 10) ) ((= (-> self control mod-surface name) 'spin) @@ -1102,7 +1088,7 @@ (set! gp-0 4) ) ((and (logtest? (-> self control mod-surface flags) (surface-flag air)) - (zero? (logand (-> self control status) (collide-status on-surface))) + (not (logtest? (-> self control status) (collide-status on-surface))) ) (set! gp-0 1) ) @@ -1360,7 +1346,7 @@ (defbehavior target-board-collision target () (let ((gp-0 (new 'stack-no-clear 'vector))) (set! (-> gp-0 quad) (-> self control transv quad)) - (when (logtest? (focus-status halfpipe) (-> self focus-status)) + (when (focus-test? self halfpipe) (when (-> self control unknown-spool-anim00) *edge-grab-info* (let ((v1-9 (new-stack-vector0)) @@ -1448,7 +1434,7 @@ (when (and (logtest? (-> self control status) (collide-status touch-wall)) (and (< 16384.0 f30-0) (not (and (-> self next-state) (= (-> self next-state name) 'target-board-smack))) - (not (logtest? (focus-status halfpipe) (-> self focus-status))) + (not (focus-test? self halfpipe)) (!= (-> self control ground-pat mode) 3) (>= (- (-> self clock frame-counter) (-> self board halfpipe-time)) (seconds 0.1)) ) @@ -1487,10 +1473,10 @@ (vector-normalize-copy! (new 'stack-no-clear 'vector) (-> self control transv) 1.0) (vector-y-quaternion! (new 'stack-no-clear 'vector) (-> self control dir-targ)) ) - (when (and (< (vector-dot s4-3 s5-3) -0.77) (zero? (logand (-> self focus-status) (focus-status dead hit)))) + (when (and (< (vector-dot s4-3 s5-3) -0.77) (not (logtest? (-> self focus-status) (focus-status dead hit)))) (cond ((not (and (logtest? (-> self control mod-surface flags) (surface-flag air)) - (zero? (logand (-> self control status) (collide-status on-surface))) + (not (logtest? (-> self control status) (collide-status on-surface))) ) ) (if (< 32768.0 f30-0) @@ -1571,7 +1557,7 @@ (defbehavior target-board-pre-move target () (cond ((and (and (logtest? (-> self control mod-surface flags) (surface-flag air)) - (zero? (logand (-> self control status) (collide-status on-surface))) + (not (logtest? (-> self control status) (collide-status on-surface))) ) (begin (set! (-> self board in-air-time) (-> self clock frame-counter)) @@ -1603,11 +1589,11 @@ (or (= v1-53 'target-board-hold) (= v1-53 'target-board-trickx)) ) ) - (zero? (logand (focus-status halfpipe) (-> self focus-status))) + (not (logtest? (focus-status halfpipe) (-> self focus-status))) ) (and (= (-> self control gspot-pat-surfce mode) (pat-mode halfpipe)) (and (< (fabs (vector-dot (-> self control gspot-normal) (-> self control dynam gravity-normal))) 0.7) - (zero? (logand (focus-status halfpipe) (-> self focus-status))) + (not (logtest? (focus-status halfpipe) (-> self focus-status))) ) ) ) @@ -1698,7 +1684,7 @@ (if (< (-> self control force-turn-to-strength) 0.0) (set! (-> self control force-turn-to-strength) (- 1.0 (-> self control cpad stick0-speed))) ) - (when (and (-> self board unknown-symbol00) (zero? (logand (focus-status halfpipe) (-> self focus-status)))) + (when (and (-> self board unknown-symbol00) (not (logtest? (focus-status halfpipe) (-> self focus-status)))) (let ((f30-0 (vector-dot (-> self control dynam gravity-normal) @@ -1965,7 +1951,7 @@ (seek! (-> self board cushion-offset) 0.0 (* 20480.0 (-> self clock seconds-per-frame))) ) ((and (logtest? (-> self control mod-surface flags) (surface-flag air)) - (zero? (logand (-> self control status) (collide-status on-surface))) + (not (logtest? (-> self control status) (collide-status on-surface))) ) (seek! (-> self board cushion-offset) @@ -1973,7 +1959,7 @@ (* 20480.0 (-> self clock seconds-per-frame)) ) ) - ((logtest? (-> self focus-status) (focus-status on-water)) + ((focus-test? self on-water) (seek! (-> self board cushion-offset) (+ 2048.0 (-> *TARGET_BOARD-bank* cushion)) @@ -2448,7 +2434,7 @@ (move-by-vector! (-> self control) a1-83) ) ) - (send-event self 'end-mode (zero? (logand s4-3 75))) + (send-event self 'end-mode (not (logtest? s4-3 75))) ) ) (vector-rotate-y! @@ -2651,7 +2637,7 @@ ) 0 ) - (when (logtest? (focus-status rail) (-> self focus-status)) + (when (focus-test? self rail) (let ((s3-2 (new 'stack-no-clear 'vector))) (let ((f28-1 (fmax @@ -2677,7 +2663,7 @@ ) (set! (-> self control status) (logior (collide-status probe-hit) (-> self control status))) ) - (if (and (-> self board ride-lock-on) (zero? (logand (collide-status probe-hit) (-> self control status)))) + (if (and (-> self board ride-lock-on) (not (logtest? (collide-status probe-hit) (-> self control status)))) (move-to-point! (-> self control) s3-2) ) ) @@ -3043,3 +3029,7 @@ (none) ) ) + + + + diff --git a/test/decompiler/reference/jak2/engine/target/collide-reaction-target_REF.gc b/test/decompiler/reference/jak2/engine/target/collide-reaction-target_REF.gc index eab7d5b4d4..f78d0bc506 100644 --- a/test/decompiler/reference/jak2/engine/target/collide-reaction-target_REF.gc +++ b/test/decompiler/reference/jak2/engine/target/collide-reaction-target_REF.gc @@ -191,7 +191,7 @@ (< 0.3 (fabs (-> arg0 surface-angle))) ) ) - (zero? (logand sv-32 (cshape-reaction-flags csrf07))) + (not (logtest? sv-32 (cshape-reaction-flags csrf07))) ) (set! sv-32 (logior sv-32 (cshape-reaction-flags csrf06))) (set! sv-40 (logior sv-40 (collide-status touch-edge))) @@ -361,7 +361,7 @@ (set! (-> arg0 wall-contact-normal quad) (-> sv-84 quad)) (set! (-> arg0 wall-contact-pat) (-> arg1 best-other-tri pat)) (cond - ((and (logtest? (focus-status mech) (-> (the-as process-focusable (-> arg0 process)) focus-status)) + ((and (focus-test? (the-as process-focusable (-> arg0 process)) mech) (logtest? sv-104 (cshape-reaction-flags csrf15)) (logtest? sv-104 (cshape-reaction-flags csrf05)) (< 0.0 (vector-dot sv-84 (-> arg0 dynam gravity-normal))) @@ -394,7 +394,7 @@ 0.0 ) (and (< 0.0 (vector-dot (-> arg0 ground-poly-normal) arg2)) - (zero? (logand sv-104 (cshape-reaction-flags csrf05))) + (not (logtest? sv-104 (cshape-reaction-flags csrf05))) ) ) (set! sv-104 (logior sv-104 (cshape-reaction-flags csrf08))) @@ -415,8 +415,8 @@ (if (= (-> arg1 best-my-prim prim-id) 6) (set! (-> arg0 local-normal quad) (-> sv-84 quad)) ) - (if (and (logtest? (focus-status board) (-> (the-as process-focusable (-> arg0 process)) focus-status)) - (not (logtest? (focus-status halfpipe) (-> (the-as process-focusable (-> arg0 process)) focus-status))) + (if (and (focus-test? (the-as process-focusable (-> arg0 process)) board) + (not (focus-test? (the-as process-focusable (-> arg0 process)) halfpipe)) (!= (-> arg0 cur-pat mode) 3) (!= (-> arg0 ground-pat mode) 3) ) diff --git a/test/decompiler/reference/jak2/engine/target/gun/gun-dark-shot_REF.gc b/test/decompiler/reference/jak2/engine/target/gun/gun-dark-shot_REF.gc index 85baa001c8..bb059f026d 100644 --- a/test/decompiler/reference/jak2/engine/target/gun/gun-dark-shot_REF.gc +++ b/test/decompiler/reference/jak2/engine/target/gun/gun-dark-shot_REF.gc @@ -179,9 +179,7 @@ (the-as uint (add-process *gui-control* obj (gui-channel background) (gui-action queue) "pmkrxplo" -99.0 0)) ) (set-falloff! *gui-control* (the-as sound-id (-> obj explode-sound)) #t 50 150 11) - (set! (-> obj start-pilot?) - (the-as basic (and *target* (logtest? (focus-status pilot) (-> *target* focus-status)))) - ) + (set! (-> obj start-pilot?) (the-as basic (and *target* (focus-test? *target* pilot)))) ((method-of-type projectile init-proj-settings!) obj) 0 (none) @@ -192,7 +190,7 @@ "Spawns associated particles with the projectile if applicable" (cond ((and (and (-> obj next-state) (= (-> obj next-state name) 'startup)) - (and *target* (logtest? (-> *target* focus-status) (focus-status in-head))) + (and *target* (focus-test? *target* in-head)) ) (kill-and-free-particles (-> obj part)) ) @@ -241,12 +239,10 @@ (until #f (cond ((or (and *target* - (logtest? (focus-status dead grabbed under-water pole flut board mech dark carry indax teleporting) - (-> *target* focus-status) - ) + (focus-test? *target* dead grabbed under-water pole flut board mech dark carry indax teleporting) ) - (and *target* (zero? (logand (focus-status in-head gun) (-> *target* focus-status)))) - (and *target* (not (-> self start-pilot?)) (logtest? (focus-status pilot) (-> *target* focus-status))) + (and *target* (not (logtest? (focus-status in-head gun) (-> *target* focus-status)))) + (and *target* (not (-> self start-pilot?)) (focus-test? *target* pilot)) ) (go-virtual dissipate) ) @@ -320,7 +316,7 @@ ) ) ) - (when (and *target* (logtest? (-> *target* focus-status) (focus-status in-head))) + (when (and *target* (focus-test? *target* in-head)) (set! (-> self core-position quad) (-> (camera-pos) quad)) (set! (-> self core-velocity quad) (-> (camera-matrix) vector 2 quad)) ) 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 5ae69486f0..a379858bd6 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 gun)) (>= (- (-> self clock frame-counter) (-> arg0 gun gun-time)) (seconds 0.1)) - (not (logtest? (focus-status dead hit board mech dark teleporting) (-> arg0 focus-status))) + (not (focus-test? arg0 dead hit board mech dark teleporting)) (not (logtest? (surface-flag gun-inactive gun-hide gun-off) (-> arg0 control current-surface flags))) (not (logtest? (state-flags prevent-gun) (-> arg0 state-flags))) (logtest? (logand (-> *setting-control* user-current features) (game-feature gun-yellow gun-red gun-blue gun-dark)) (-> arg0 game features) ) (or (not (logtest? (-> arg0 control current-surface flags) (surface-flag duck))) (can-exit-duck? arg0)) - (or (not (logtest? (focus-status pilot) (-> arg0 focus-status))) (-> arg0 pilot gun?)) + (or (not (focus-test? arg0 pilot)) (-> arg0 pilot gun?)) (or arg1 (nonzero? (-> arg0 gun using-gun-type)) (begin (set! v1-36 (and (cpad-hold? (-> arg0 control cpad number) r1) - (not (logtest? (-> arg0 focus-status) (focus-status grabbed))) + (not (focus-test? arg0 grabbed)) (begin (set! v1-36 #t) (set! (-> arg0 gun latch?) v1-36) v1-36) ) ) diff --git a/test/decompiler/reference/jak2/engine/target/gun/gun-util_REF.gc b/test/decompiler/reference/jak2/engine/target/gun/gun-util_REF.gc index fb02254d51..0329fdbb54 100644 --- a/test/decompiler/reference/jak2/engine/target/gun/gun-util_REF.gc +++ b/test/decompiler/reference/jak2/engine/target/gun/gun-util_REF.gc @@ -509,14 +509,13 @@ :virtual #t :trans (behavior () (let ((v1-0 (-> self parent))) - (if (not (logtest? (-> (the-as target (if v1-0 - (the-as target (-> v1-0 0 self)) - ) - ) - focus-status - ) - (focus-status in-head) + (if (not (focus-test? + (the-as target (if v1-0 + (the-as target (-> v1-0 0 self)) + ) ) + in-head + ) ) (go-virtual idle) ) @@ -540,7 +539,7 @@ (set! (-> self gun-type) (the-as pickup-type (-> (the-as target (-> self parent 0)) game gun-type))) (let ((a0-0 (ppointer->process (-> self parent)))) (cond - ((logtest? (-> (the-as target a0-0) focus-status) (focus-status in-head)) + ((focus-test? (the-as target a0-0) in-head) (go-virtual hidden) ) ((nonzero? (-> (the-as target (-> self parent 0)) gun gun-type)) @@ -599,14 +598,13 @@ (a0-1 (-> self parent)) ) (cond - ((logtest? (-> (the-as target (if a0-1 - (the-as target (-> a0-1 0 self)) - ) - ) - focus-status - ) - (focus-status in-head) + ((focus-test? + (the-as target (if a0-1 + (the-as target (-> a0-1 0 self)) + ) ) + in-head + ) (go-virtual hidden) ) ((and (= (-> (the-as target (-> self parent 0)) gun gun-type) (pickup-type none)) @@ -994,7 +992,7 @@ ) (ja-channel-set! 0) (ja-post) - (while (logtest? (-> (the-as target (-> self parent 0)) focus-status) (focus-status dead)) + (while (focus-test? (the-as target (-> self parent 0)) dead) (suspend) ) (go-virtual idle) 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 582a0d1dee..c34d089f98 100644 --- a/test/decompiler/reference/jak2/engine/target/logic-target_REF.gc +++ b/test/decompiler/reference/jak2/engine/target/logic-target_REF.gc @@ -19,7 +19,7 @@ ) (set! (-> self control current-surface transv-max) (+ 20480.0 (-> self control current-surface transv-max))) ) - (when (and (and (logtest? (focus-status dark) (-> self focus-status)) (nonzero? (-> self darkjak))) + (when (and (and (focus-test? self dark) (nonzero? (-> self darkjak))) (or (= (-> self control mod-surface name) 'run) (= (-> self control mod-surface name) 'jump) (= (-> self control mod-surface name) 'attack) @@ -1164,7 +1164,7 @@ (logtest? (-> self control current-surface flags) (surface-flag turn-to-pad)) (!= (-> self control force-turn-to-strength) 0.0) ) - (zero? (logand (-> self control current-surface flags) (surface-flag turn-to-vel))) + (not (logtest? (-> self control current-surface flags) (surface-flag turn-to-vel))) ) (-> self control to-target-pt-xz) ) @@ -1188,7 +1188,7 @@ ((and (or (>= 0.0 (-> self control turn-to-magnitude)) (< (-> self clock frame-counter) (-> self control turn-lockout-end-time)) ) - (zero? (logand (-> self control current-surface flags) (surface-flag turn-when-centered))) + (not (logtest? (-> self control current-surface flags) (surface-flag turn-when-centered))) ) 0.0 ) @@ -1397,9 +1397,9 @@ (dotimes (s5-0 2) (let ((a1-4 (not (or (logtest? (state-flags lleg-no-ik rleg-no-ik) (-> self state-flags)) (and (logtest? (-> self control mod-surface flags) (surface-flag air)) - (zero? (logand (-> self control status) (collide-status on-surface))) + (not (logtest? (-> self control status) (collide-status on-surface))) ) - (logtest? (focus-status edge-grab pole flut pilot mech) (-> self focus-status)) + (focus-test? self edge-grab pole flut pilot mech) ) ) ) @@ -1656,7 +1656,7 @@ ) (if (and (= (-> self cam-user-mode) 'normal) (logtest? (-> self control mod-surface flags) (surface-flag look-around)) - (not (logtest? (focus-status edge-grab pole flut tube board pilot dark) (-> self focus-status))) + (not (focus-test? self edge-grab pole flut tube board pilot dark)) (-> *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)) (< 4096.0 (-> self control ctrl-xz-vel))) @@ -1665,11 +1665,11 @@ (send-event self 'change-mode 'look-around) ) ) - (if (!= (zero? (logand (-> self game features) (game-feature sidekick))) (not (-> self sidekick))) + (if (!= (not (logtest? (-> self game features) (game-feature sidekick))) (not (-> self sidekick))) (target-sidekick-setup (logtest? (-> self game features) (game-feature sidekick))) ) - (if (and (!= (zero? (logand (-> self game features) (game-feature board))) (not (-> self board board))) - (zero? (logand (focus-status board) (-> self focus-status))) + (if (and (!= (not (logtest? (-> self game features) (game-feature board))) (not (-> self board board))) + (not (logtest? (focus-status board) (-> self focus-status))) ) (target-board-setup (logtest? (-> self game features) (game-feature board))) ) @@ -1706,7 +1706,7 @@ (cpad-hold? (-> self control cpad number) r2) (cpad-hold? (-> self control cpad number) l2) (not *pause-lock*) - (not (logtest? (focus-status grabbed in-head pilot) (-> self focus-status))) + (not (focus-test? self grabbed in-head pilot)) (not (and (-> self next-state) (let ((v1-167 (-> self next-state name))) (or (= v1-167 'target-darkjak-get-on) (= v1-167 'target-float)) ) @@ -1716,7 +1716,7 @@ (send-event *camera* 'reset-follow) (set! (-> self control time-of-last-debug-float) (-> self clock frame-counter)) (cond - ((logtest? (focus-status mech indax) (-> self focus-status)) + ((focus-test? self mech indax) (if (not (and (-> self next-state) (let ((v1-179 (-> self next-state name))) (or (= v1-179 'target-falling) (= v1-179 'target-board-falling) @@ -1782,12 +1782,12 @@ (or (= v1-211 'target-walk) (= v1-211 'target-gun-walk)) ) ) - (zero? (logand (-> self control status) (collide-status on-surface))) + (not (logtest? (-> self control status) (collide-status on-surface))) ) ) (and (< f0-17 0.0) (and (or (not (and (= *cheat-mode* 'debug) (cpad-hold? (-> self control cpad number) r2))) *pause-lock*) - (not (logtest? (focus-status flut pilot mech indax) (-> self focus-status))) + (not (focus-test? self flut pilot mech indax)) (not (logtest? (-> self state-flags) (state-flags prevent-jump))) #t ) @@ -1799,7 +1799,7 @@ ) (let ((v1-229 (-> self current-level))) (when (and (or (>= (- (-> self clock frame-counter) (-> self control last-time-on-surface)) (seconds 2)) - (logtest? (focus-status pilot) (-> self focus-status)) + (focus-test? self pilot) ) (and v1-229 (< (-> self control trans y) (-> v1-229 info buttom-height)) @@ -1885,10 +1885,7 @@ (let ((f0-9 (+ (-> self hair 0 twist z) (* (-> self hair 0 twist-speed-x) (-> self clock seconds-per-frame))))) (set! (-> self hair 0 twist z) (- f0-9 (* (the float (the int (/ f0-9 1.0))) 1.0))) ) - (if (and (logtest? (focus-status pilot) (-> self focus-status)) - (nonzero? (-> self pilot)) - (= (-> self pilot stance) 1) - ) + (if (and (focus-test? self pilot) (nonzero? (-> self pilot)) (= (-> self pilot stance) 1)) (seek! (-> self hair 0 twist-max w) (lerp-scale 0.0 9102.223 (vector-length (-> self control transv)) 0.0 122880.0) @@ -1938,13 +1935,13 @@ ;; INFO: Used lq/sq (defbehavior bend-gravity target () (if (and (logtest? (-> self control root-prim prim-core action) (collide-action no-normal-reset)) - (zero? (logand (-> self control status) (collide-status on-surface))) + (not (logtest? (-> self control status) (collide-status on-surface))) ) (return #f) ) (let ((f0-1 (if (and (logtest? (-> self control status) (collide-status touch-wall)) - (zero? (logand (-> self control status) (collide-status on-surface))) + (not (logtest? (-> self control status) (collide-status on-surface))) ) 0.0 (-> self control bend-target) @@ -2365,20 +2362,20 @@ ) (set! (-> self control camera-pos quad) (-> s5-0 quad)) ) - ((logtest? (focus-status board pilot mech indax) (-> self focus-status)) + ((focus-test? self board pilot mech indax) (set! (-> self control camera-pos quad) (-> self control trans quad)) ) ((or (logtest? (-> self control status) (collide-status on-water)) (let ((v1-23 (-> self water flags))) (and (logtest? (water-flags touch-water) v1-23) (logtest? (water-flags under-water swimming) v1-23) - (zero? (logand (focus-status mech) (-> self focus-status))) + (not (logtest? (focus-status mech) (-> self focus-status))) ) ) ) (vector<-cspace! s5-0 (the-as cspace (-> self node-list data))) (if (not (and (logtest? (-> self water flags) (water-flags under-water)) - (zero? (logand (-> self water flags) (water-flags swim-ground))) + (not (logtest? (-> self water flags) (water-flags swim-ground))) ) ) (set! (-> s5-0 y) (- (-> self water surface-height) (-> self water swim-height))) @@ -2389,7 +2386,7 @@ (set! (-> self control camera-pos quad) (-> s5-0 quad)) ) ((not (and (logtest? (-> self water flags) (water-flags under-water)) - (zero? (logand (-> self water flags) (water-flags swim-ground))) + (not (logtest? (-> self water flags) (water-flags swim-ground))) ) ) (vector-lerp! @@ -2424,7 +2421,7 @@ (vector<-cspace! (-> self control camera-pos) (the-as cspace (-> self node-list data))) (set! (-> self control camera-pos y) (-> self water base-height)) ) - ((logtest? (focus-status tube) (-> self focus-status)) + ((focus-test? self tube) (set! (-> self control camera-pos quad) (-> self control gspot-pos quad)) ) ((logtest? (-> self draw status) (draw-control-status no-draw no-draw-temp)) @@ -2451,7 +2448,7 @@ ((>= f0-1 (-> self excitement)) (seek! (-> self excitement) f0-1 (* 6.0 (-> self clock seconds-per-frame))) ) - ((logtest? (-> self focus-status) (focus-status dead ignore hit)) + ((focus-test? self dead ignore hit) ) (else (seek! (-> self excitement) f0-1 (* 0.25 (-> self clock seconds-per-frame))) @@ -2474,7 +2471,7 @@ (set! (-> v1-29 blend) 0.0) ) (cond - ((logtest? (focus-status tube pilot indax) (-> self focus-status)) + ((focus-test? self tube pilot indax) ) ((logtest? (water-flags wading) (-> self water flags)) (let ((f30-0 (- (- (-> self control trans y) (- (-> self water height) (-> self water wade-height)))))) @@ -2518,17 +2515,17 @@ (vector-! (-> self control ctrl-to-hands-offset) (-> self control midpoint-of-hands) (-> self control trans)) (update-from-cspace (-> self control impact-ctrl)) (cond - ((logtest? (-> self focus-status) (focus-status edge-grab)) + ((focus-test? self edge-grab) (target-compute-edge) ) - ((logtest? (-> self focus-status) (focus-status pole)) + ((focus-test? self pole) (target-compute-pole) ) ) (target-calc-camera-pos) (set! (-> self control tongue-counter) 0) (cond - ((logtest? (focus-status indax) (-> self focus-status)) + ((focus-test? self indax) ) (else (target-gun-joint-points) @@ -2548,7 +2545,7 @@ (!= (-> self control mod-surface mode) 'swim) (!= (-> self control mod-surface mode) 'dive) (not (and (-> self next-state) (= (-> self next-state name) 'target-flop))) - (zero? (logand (-> self draw status) (draw-control-status no-draw no-draw-temp no-draw-bounds))) + (not (logtest? (-> self draw status) (draw-control-status no-draw no-draw-temp no-draw-bounds))) ) (set! (-> self control gspot-pos quad) (-> self control trans quad)) (set! (-> self control gspot-normal quad) (-> self control ground-poly-normal quad)) diff --git a/test/decompiler/reference/jak2/engine/target/mech_suit/carry-h_REF.gc b/test/decompiler/reference/jak2/engine/target/mech_suit/carry-h_REF.gc index 030b2d204b..99b7c32ff4 100644 --- a/test/decompiler/reference/jak2/engine/target/mech_suit/carry-h_REF.gc +++ b/test/decompiler/reference/jak2/engine/target/mech_suit/carry-h_REF.gc @@ -153,7 +153,7 @@ Returns `-1.0` if it exceeds the maximum allowed" ((or (< (-> obj max-distance) f26-0) (< (-> arg0 max-distance) f26-0) (< (-> obj max-angle) f30-0) - (or (< (-> arg0 max-angle) f28-1) (zero? (logand (-> obj mode) (-> arg0 mode)))) + (or (< (-> arg0 max-angle) f28-1) (not (logtest? (-> obj mode) (-> arg0 mode)))) ) (if (< (-> obj max-distance) f26-0) (format diff --git a/test/decompiler/reference/jak2/engine/target/mech_suit/grunt-mech_REF.gc b/test/decompiler/reference/jak2/engine/target/mech_suit/grunt-mech_REF.gc index 89bc861aa0..ae9b5d8eaf 100644 --- a/test/decompiler/reference/jak2/engine/target/mech_suit/grunt-mech_REF.gc +++ b/test/decompiler/reference/jak2/engine/target/mech_suit/grunt-mech_REF.gc @@ -142,7 +142,7 @@ (set! (-> obj last-update-time) s5-0) (let ((v1-8 *target*)) (cond - ((and v1-8 (logtest? (focus-status mech) (-> v1-8 focus-status))) + ((and v1-8 (focus-test? v1-8 mech)) (let ((s4-0 (-> v1-8 manipy 0 node-list data 3))) (dotimes (s3-0 6) (let ((s2-0 (-> obj holds s3-0))) @@ -180,10 +180,7 @@ (with-pp (grunt-mech-info-method-10 obj) (let ((v1-2 *target*)) - (when (and v1-2 - (logtest? (focus-status mech) (-> v1-2 focus-status)) - (zero? (logand (-> v1-2 focus-status) (focus-status dead ignore))) - ) + (when (and v1-2 (focus-test? v1-2 mech) (not (logtest? (-> v1-2 focus-status) (focus-status dead ignore)))) (let ((v1-8 (-> obj holds arg0))) (when (and (!= (-> v1-8 grunt-handle) #f) (= (handle->process (-> v1-8 grunt-handle)) arg1)) (set! (-> v1-8 timeout) (the-as uint (+ (-> pp clock frame-counter) (seconds 0.5)))) @@ -351,7 +348,7 @@ (let ((gp-0 (get-enemy-target obj))) (when gp-0 (cond - ((logtest? (focus-status mech) (-> gp-0 focus-status)) + ((focus-test? gp-0 mech) (let ((v1-4 (get-trans gp-0 0)) (a1-2 (new 'stack-no-clear 'vector)) ) @@ -539,7 +536,7 @@ (defmethod grunt-mech-method-192 grunt-mech ((obj grunt-mech)) (do-navigation-to-destination (-> obj nav state) (-> obj root-override2 trans)) (let ((a1-1 *target*)) - (if (or (not a1-1) (zero? (logand (focus-status mech) (-> a1-1 focus-status)))) + (if (or (not a1-1) (not (logtest? (focus-status mech) (-> a1-1 focus-status)))) (return #t) ) ) @@ -898,7 +895,7 @@ (let ((v1-33 (get-enemy-target self))) (when v1-33 (cond - ((logtest? (focus-status mech) (-> v1-33 focus-status)) + ((focus-test? v1-33 mech) (when (>= (-> self clock frame-counter) (-> self state-timeout)) (nav-enemy-method-161 self) (go-hostile self) diff --git a/test/decompiler/reference/jak2/engine/target/mech_suit/mech-states_REF.gc b/test/decompiler/reference/jak2/engine/target/mech_suit/mech-states_REF.gc index d64663578e..400076d807 100644 --- a/test/decompiler/reference/jak2/engine/target/mech_suit/mech-states_REF.gc +++ b/test/decompiler/reference/jak2/engine/target/mech_suit/mech-states_REF.gc @@ -469,7 +469,7 @@ (defstate target-mech-punch (target) :event (behavior ((proc process) (arg1 int) (event-type symbol) (event event-message-block)) (cond - ((logtest? (-> self focus-status) (focus-status dangerous)) + ((focus-test? self dangerous) (case event-type (('touched) (if ((method-of-type touching-shapes-entry prims-touching?) @@ -508,7 +508,7 @@ ) ) (if (and s4-1 - (and (or (and s5-2 (logtest? (-> (the-as process-focusable s5-2) focus-status) (focus-status dead))) + (and (or (and s5-2 (focus-test? (the-as process-focusable s5-2) dead)) (let ((a1-6 (new 'stack-no-clear 'event-message-block))) (set! (-> a1-6 from) (process->ppointer self)) (set! (-> a1-6 num-params) 2) @@ -530,7 +530,7 @@ ) ) s5-2 - (logtest? (-> (the-as process-focusable s5-2) focus-status) (focus-status dead)) + (focus-test? (the-as process-focusable s5-2) dead) ) ) (set! (-> self mech forward-vel) 0.0) @@ -608,7 +608,7 @@ (target-mech-punch-pick (the-as symbol gp-0)) (until (ja-done? 0) (compute-alignment! (-> self align)) - (when (and (not (logtest? (-> self focus-status) (focus-status dangerous))) + (when (and (not (focus-test? self dangerous)) (let ((v1-10 (ja-group))) (and v1-10 (or (= v1-10 (-> self draw art-group data 333)) (= v1-10 (-> self draw art-group data 334)) diff --git a/test/decompiler/reference/jak2/engine/target/mech_suit/mech_REF.gc b/test/decompiler/reference/jak2/engine/target/mech_suit/mech_REF.gc index e7a2478e3e..72306e02a7 100644 --- a/test/decompiler/reference/jak2/engine/target/mech_suit/mech_REF.gc +++ b/test/decompiler/reference/jak2/engine/target/mech_suit/mech_REF.gc @@ -181,10 +181,10 @@ ) (when (and (and *target* (and (>= f30-0 (vector-vector-distance (-> self root-override trans) (-> *target* control trans))) - (zero? (logand (focus-status teleporting) (-> *target* focus-status))) + (not (logtest? (focus-status teleporting) (-> *target* focus-status))) ) ) - (not (logtest? (focus-status in-head pole board mech dark) (-> *target* focus-status))) + (not (focus-test? *target* in-head pole board mech dark)) (can-display-query? self (the-as string #f) -99.0) (-> *setting-control* user-current pilot) ) @@ -278,7 +278,7 @@ (while (zero? (ja-group-size)) (if (or (not *target*) (or (< 24576.0 (vector-vector-distance (-> self root-override trans) (-> *target* control trans))) - (logtest? (focus-status teleporting) (-> *target* focus-status)) + (focus-test? *target* teleporting) ) ) (go arg0) @@ -286,7 +286,7 @@ (mech-method-24 self) (suspend) ) - (while (and *target* (logtest? (focus-status mech) (-> *target* focus-status))) + (while (and *target* (focus-test? *target* mech)) (mech-method-24 self) (suspend) ) @@ -467,10 +467,10 @@ This commonly includes things such as: ) :trans (behavior () (if (and (and *target* (and (>= 98304.0 (vector-vector-distance (-> self root trans) (-> *target* control trans))) - (zero? (logand (focus-status teleporting) (-> *target* focus-status))) + (not (logtest? (focus-status teleporting) (-> *target* focus-status))) ) ) - (logtest? (focus-status mech) (-> *target* focus-status)) + (focus-test? *target* mech) ) (go-virtual active) ) @@ -500,10 +500,10 @@ This commonly includes things such as: ) :trans (behavior () (if (and (or (or (not *target*) (or (< 106496.0 (vector-vector-distance (-> self root trans) (-> *target* control trans))) - (logtest? (focus-status teleporting) (-> *target* focus-status)) + (focus-test? *target* teleporting) ) ) - (zero? (logand (focus-status mech) (-> *target* focus-status))) + (not (logtest? (focus-status mech) (-> *target* focus-status))) ) (>= (- (-> self clock frame-counter) (-> self state-time)) (seconds 10)) ) diff --git a/test/decompiler/reference/jak2/engine/target/mech_suit/target-mech_REF.gc b/test/decompiler/reference/jak2/engine/target/mech_suit/target-mech_REF.gc index f66d28e8af..8257b61e58 100644 --- a/test/decompiler/reference/jak2/engine/target/mech_suit/target-mech_REF.gc +++ b/test/decompiler/reference/jak2/engine/target/mech_suit/target-mech_REF.gc @@ -533,7 +533,7 @@ (let ((v1-7 (-> arg3 param 0))) (cond ((= v1-7 'grab) - (when (not (logtest? (-> self focus-status) (focus-status dead))) + (when (not (focus-test? self dead)) (if (not (-> arg3 param 1)) #t (go target-mech-grab) @@ -739,7 +739,7 @@ ) ) (('shove) - (when (not (logtest? (-> self focus-status) (focus-status dead hit))) + (when (not (focus-test? self dead hit)) (mem-copy! (the-as pointer (-> self attack-info-rec)) (the-as pointer (-> arg3 param 1)) 160) (when (not (logtest? (-> self attack-info-rec mask) (attack-info-mask attacker))) (set! (-> self attack-info-rec attacker) (process->handle arg0)) @@ -823,12 +823,12 @@ ) 'bounce ) - (zero? (logand (-> self focus-status) (focus-status dead hit))) + (not (logtest? (-> self focus-status) (focus-status dead hit))) ) (set! (-> self control last-trans-any-surf quad) (-> self control trans quad)) (target-timed-invulnerable (seconds 0.1) self 1) (cond - ((logtest? (focus-status carry) (-> self focus-status)) + ((focus-test? self carry) enter-state (let ((a0-19 (-> *TARGET-bank* mech-carry-jump-height-min)) (a1-8 (-> *TARGET-bank* mech-carry-jump-height-max)) @@ -1704,7 +1704,7 @@ ) (cond ((and (logtest? (-> self control mod-surface flags) (surface-flag air)) - (zero? (logand (-> self control status) (collide-status on-surface))) + (not (logtest? (-> self control status) (collide-status on-surface))) ) (add-thrust) ) diff --git a/test/decompiler/reference/jak2/engine/target/target-anim_REF.gc b/test/decompiler/reference/jak2/engine/target/target-anim_REF.gc index b7457e6cfc..a7736e9592 100644 --- a/test/decompiler/reference/jak2/engine/target/target-anim_REF.gc +++ b/test/decompiler/reference/jak2/engine/target/target-anim_REF.gc @@ -17,7 +17,7 @@ (else (let ((v1-9 (ja-group))) (if (or (and v1-9 (= v1-9 (-> self draw art-group data 394))) - (and (logtest? (focus-status dark) (-> self focus-status)) (nonzero? (-> self darkjak))) + (and (focus-test? self dark) (nonzero? (-> self darkjak))) ) (-> self draw art-group data 395) (-> self draw art-group data 24) @@ -365,7 +365,7 @@ ) ) (cond - ((and (logtest? (focus-status dark) (-> self focus-status)) (nonzero? (-> self darkjak))) + ((and (focus-test? self dark) (nonzero? (-> self darkjak))) (set! gp-0 30) ) (else @@ -398,9 +398,7 @@ ) ) (cond - ((and (rand-vu-percent? 0.3) - (not (and (logtest? (focus-status dark) (-> self focus-status)) (nonzero? (-> self darkjak)))) - ) + ((and (rand-vu-percent? 0.3) (not (and (focus-test? self dark) (nonzero? (-> self darkjak))))) (ja-channel-push! 1 (seconds 0.1)) (ja-no-eval :group! (-> self draw art-group data 6) :num! (seek! (the float (+ (-> (the-as art-joint-anim (-> self draw art-group data 6)) frames num-frames) -1))) @@ -442,7 +440,7 @@ (suspend) (ja :num! (seek! (ja-aframe 82.0 0))) ) - (when (not (and (logtest? (focus-status dark) (-> self focus-status)) (nonzero? (-> self darkjak)))) + (when (not (and (focus-test? self dark) (nonzero? (-> self darkjak)))) (ja-no-eval :group! (-> self draw art-group data 3) :num! (seek! (ja-aframe 142.0 0)) :frame-num (ja-aframe 82.0 0) @@ -481,7 +479,7 @@ ) ) (set! (-> self state-flags) (logior (state-flags lleg-still rleg-still) (-> self state-flags))) - (if (and (logtest? (focus-status dark) (-> self focus-status)) (nonzero? (-> self darkjak))) + (if (and (focus-test? self dark) (nonzero? (-> self darkjak))) (ja :group! (-> self draw art-group data 396)) (ja :group! (-> self draw art-group data 5)) ) @@ -650,7 +648,7 @@ (ja-no-eval :group! (-> self draw art-group data 27) :num! (loop!) :frame-num 0.0) (let ((s5-1 (-> self clock frame-counter))) (while (or (= arg0 -1) (and (< (- (-> self clock frame-counter) s5-1) arg0) - (zero? (logand (-> self control status) (collide-status on-surface))) + (not (logtest? (-> self control status) (collide-status on-surface))) ) ) (suspend) @@ -678,7 +676,7 @@ ((and (logtest? (-> self control status) (collide-status on-surface)) (let ((v1-15 (ja-group))) (and (not (and v1-15 (= v1-15 (-> self draw art-group data 24)))) - (zero? (logand (-> self control status) (collide-status on-water))) + (not (logtest? (-> self control status) (collide-status on-water))) ) ) ) @@ -960,7 +958,7 @@ ((and v1-84 (= v1-84 (-> self draw art-group data 71))) (ja-channel-push! 7 (seconds 0.15)) ) - ((and (logtest? (focus-status dark) (-> self focus-status)) (nonzero? (-> self darkjak))) + ((and (focus-test? self dark) (nonzero? (-> self darkjak))) (set! f24-0 55.0) (ja-channel-push! 7 (seconds 0.1)) ) @@ -977,7 +975,7 @@ (ja :group! (-> self draw art-group data 12)) (let ((f24-1 (ja-aframe f24-0 0))) (cond - ((and (logtest? (focus-status dark) (-> self focus-status)) (nonzero? (-> self darkjak))) + ((and (focus-test? self dark) (nonzero? (-> self darkjak))) (let ((s4-0 (-> self skel root-channel 0))) (let ((f0-3 0.0)) (set! (-> s4-0 frame-interp 1) f0-3) @@ -1078,7 +1076,7 @@ (set! (-> s4-6 frame-num) f24-1) ) (cond - ((and (logtest? (focus-status dark) (-> self focus-status)) (nonzero? (-> self darkjak))) + ((and (focus-test? self dark) (nonzero? (-> self darkjak))) (let ((s4-7 (-> self skel root-channel 3))) (let ((f0-17 0.0)) (set! (-> s4-7 frame-interp 1) f0-17) @@ -1146,7 +1144,7 @@ (* 2.0 (-> self clock seconds-per-frame)) ) ) - (if (and (logtest? (focus-status dark) (-> self focus-status)) (nonzero? (-> self darkjak))) + (if (and (focus-test? self dark) (nonzero? (-> self darkjak))) (set! f26-0 (seek f26-0 (lerp-scale f26-0 (* 0.7 f26-0) sv-16 1820.4445 3640.889) @@ -1411,9 +1409,7 @@ ) (let ((v1-26 (ja-group))) (and (and v1-26 (= v1-26 (-> self draw art-group data 23))) - (or (>= (ja-aframe-num 0) 38.0) - (and (logtest? (focus-status dark) (-> self focus-status)) (nonzero? (-> self darkjak))) - ) + (or (>= (ja-aframe-num 0) 38.0) (and (focus-test? self dark) (nonzero? (-> self darkjak)))) ) ) ) @@ -1641,7 +1637,7 @@ ) ) ) - ((and (logtest? (focus-status dark) (-> self focus-status)) (nonzero? (-> self darkjak))) + ((and (focus-test? self dark) (nonzero? (-> self darkjak))) (ja-no-eval :group! (-> self draw art-group data 395) :num! (seek! (the float (+ (-> (the-as art-joint-anim (-> self draw art-group data 395)) frames num-frames) -1))) :frame-num (ja-aframe 42.0 0) diff --git a/test/decompiler/reference/jak2/engine/target/target-darkjak_REF.gc b/test/decompiler/reference/jak2/engine/target/target-darkjak_REF.gc index 96740afee0..56c8072922 100644 --- a/test/decompiler/reference/jak2/engine/target/target-darkjak_REF.gc +++ b/test/decompiler/reference/jak2/engine/target/target-darkjak_REF.gc @@ -27,43 +27,38 @@ (not *pause-lock*) (-> *setting-control* user-current darkjak) (logtest? (-> self game features) (game-feature darkjak)) - (not (logtest? (focus-status - dead - hit - grabbed - in-head - under-water - edge-grab - pole - flut - tube - board - pilot - mech - carry - indax - teleporting - ) - (-> self focus-status) - ) + (not (focus-test? + self + dead + hit + grabbed + in-head + under-water + edge-grab + pole + flut + tube + board + pilot + mech + carry + indax + teleporting + ) ) (not (and (logtest? (-> self water flags) (water-flags under-water)) - (zero? (logand (-> self water flags) (water-flags swim-ground))) + (not (logtest? (-> self water flags) (water-flags swim-ground))) ) ) - (or (and (not (and (logtest? (focus-status dark) (-> self focus-status)) (nonzero? (-> self darkjak)))) + (or (and (not (and (focus-test? self dark) (nonzero? (-> self darkjak)))) (and (>= (- (-> self clock frame-counter) (-> (the-as fact-info-target (-> self fact-override)) darkjak-start-time)) (seconds 0.05) ) (>= (-> self game eco-pill-dark) (-> *FACT-bank* eco-pill-dark-max-default)) ) ) - (and (and (logtest? (focus-status dark) (-> self focus-status)) (nonzero? (-> self darkjak))) - (not (and (logtest? (focus-status dark) (-> self focus-status)) - (nonzero? (-> self darkjak)) - (logtest? (-> self darkjak stage) 32) - ) - ) + (and (and (focus-test? self dark) (nonzero? (-> self darkjak))) + (not (and (focus-test? self dark) (nonzero? (-> self darkjak)) (logtest? (-> self darkjak stage) 32))) (logtest? (game-feature darkjak-giant) (-> self game features)) ) ) @@ -80,7 +75,7 @@ ;; definition for function target-darkjak-end-mode ;; WARN: Return type mismatch int vs none. (defbehavior target-darkjak-end-mode target () - (when (and (logtest? (focus-status dark) (-> self focus-status)) (nonzero? (-> self darkjak))) + (when (and (focus-test? self dark) (nonzero? (-> self darkjak))) (logclear! (-> self focus-status) (focus-status dark)) (send-event self 'reset-collide) (logclear! (-> self state-flags) (state-flags sf4)) @@ -104,7 +99,7 @@ (defbehavior target-darkjak-process target () (local-vars (t2-0 none) (gp-0 vector)) (cond - ((and (logtest? (focus-status dark) (-> self focus-status)) (nonzero? (-> self darkjak))) + ((and (focus-test? self dark) (nonzero? (-> self darkjak))) (let ((a1-0 'eco-red)) (target-danger-set! (-> self control danger-mode) a1-0) ) @@ -122,9 +117,9 @@ ) (not (-> *setting-control* user-current darkjak)) ) - (not (logtest? (-> self focus-status) (focus-status dead dangerous hit grabbed))) + (not (focus-test? self dead dangerous hit grabbed)) (not (and (-> self next-state) (= (-> self next-state name) 'target-darkjak-get-off))) - (zero? (logand (-> self darkjak stage) 1)) + (not (logtest? (-> self darkjak stage) 1)) ) (go target-darkjak-get-off) ) @@ -150,10 +145,7 @@ ) (let ((f26-1 (* 1.1 f26-0))) (cond - ((and (logtest? (focus-status dark) (-> self focus-status)) - (nonzero? (-> self darkjak)) - (logtest? (-> self darkjak stage) 32) - ) + ((and (focus-test? self dark) (nonzero? (-> self darkjak)) (logtest? (-> self darkjak stage) 32)) (set! gp-0 (new 'stack-no-clear 'vector)) (set! (-> gp-0 x) (/ f28-0 (* f28-0 f26-1 (lerp-scale 1.0 1.3 f30-0 0.0 1.0)))) (set! (-> gp-0 y) (/ f28-0 (* f28-0 (lerp-scale 1.0 1.4 f30-0 0.0 1.0)))) @@ -218,7 +210,7 @@ ) ) (when (and (>= f30-0 0.5) - (not (logtest? (-> self focus-status) (focus-status in-head))) + (not (focus-test? self in-head)) (not (logtest? (-> self draw status) (draw-control-status no-draw no-draw-temp))) (not (movie?)) ) @@ -306,7 +298,7 @@ ) :code (behavior ((arg0 int)) (send-event (handle->process (-> self notify)) 'notify 'attack 15) - (if (and (logtest? (focus-status dark) (-> self focus-status)) (nonzero? (-> self darkjak))) + (if (and (focus-test? self dark) (nonzero? (-> self darkjak))) (go target-darkjak-giant) ) (set! (-> self darkjak stage) (the-as uint (logior arg0 2))) @@ -373,7 +365,7 @@ (when (and (or (not (cpad-hold? (-> self control cpad number) l2)) (and (= *cheat-mode* 'debug) (cpad-hold? (-> self control cpad number) r2)) ) - (and (< (ja-aframe-num 0) 5.0) (zero? (logand arg0 1))) + (and (< (ja-aframe-num 0) 5.0) (not (logtest? arg0 1))) ) (let ((v1-131 (the-as sound-rpc-set-param (get-sound-buffer-entry)))) (set! (-> v1-131 command) (sound-command set-param)) @@ -395,10 +387,7 @@ (send-event *traffic-manager* 'increase-alert-level - (if (and (logtest? (focus-status dark) (-> self focus-status)) - (nonzero? (-> self darkjak)) - (logtest? (-> self darkjak stage) 16) - ) + (if (and (focus-test? self dark) (nonzero? (-> self darkjak)) (logtest? (-> self darkjak stage) 16)) 3 2 ) @@ -419,7 +408,7 @@ (('change-mode) (case (-> event param 0) (('grab) - (when (not (logtest? (-> self focus-status) (focus-status dead))) + (when (not (focus-test? self dead)) (if (not (-> event param 1)) #t (go target-grab 'stance) @@ -469,7 +458,7 @@ (cond ((and (logtest? (water-flags touch-water) v1-1) (logtest? (water-flags under-water swimming) v1-1) - (zero? (logand (focus-status mech) (-> self focus-status))) + (not (logtest? (focus-status mech) (-> self focus-status))) ) (go target-swim-stance) ) @@ -520,11 +509,7 @@ (until (ja-done? 0) (set! (-> self darkjak-interp) (lerp-scale 1.0 0.0 (ja-aframe-num 0) 90.0 115.0)) (if (and (!= (-> *cpad-list* cpads (-> self control cpad number) stick0-speed) 0.0) - (or (not (and (logtest? (focus-status dark) (-> self focus-status)) - (nonzero? (-> self darkjak)) - (logtest? (-> self darkjak stage) 32) - ) - ) + (or (not (and (focus-test? self dark) (nonzero? (-> self darkjak)) (logtest? (-> self darkjak stage) 32))) (= (-> self darkjak-interp) 0.0) ) ) @@ -541,11 +526,7 @@ (while (not (ja-done? 0)) (set! (-> self darkjak-interp) (lerp-scale 1.0 0.0 (ja-aframe-num 0) 90.0 115.0)) (if (and (!= (-> *cpad-list* cpads (-> self control cpad number) stick0-speed) 0.0) - (or (not (and (logtest? (focus-status dark) (-> self focus-status)) - (nonzero? (-> self darkjak)) - (logtest? (-> self darkjak stage) 32) - ) - ) + (or (not (and (focus-test? self dark) (nonzero? (-> self darkjak)) (logtest? (-> self darkjak stage) 32))) (= (-> self darkjak-interp) 0.0) ) ) @@ -565,11 +546,7 @@ (set! (-> self darkjak-interp) (lerp-scale 1.0 0.0 (ja-aframe-num 0) 10.0 60.0)) (if (and (>= (ja-aframe-num 0) 24.0) (!= (-> *cpad-list* cpads (-> self control cpad number) stick0-speed) 0.0) - (or (not (and (logtest? (focus-status dark) (-> self focus-status)) - (nonzero? (-> self darkjak)) - (logtest? (-> self darkjak stage) 32) - ) - ) + (or (not (and (focus-test? self dark) (nonzero? (-> self darkjak)) (logtest? (-> self darkjak stage) 32))) (= (-> self darkjak-interp) 0.0) ) ) @@ -586,11 +563,7 @@ (set! (-> self darkjak-interp) (lerp-scale 1.0 0.0 (ja-aframe-num 0) 10.0 60.0)) (if (and (>= (ja-aframe-num 0) 24.0) (!= (-> *cpad-list* cpads (-> self control cpad number) stick0-speed) 0.0) - (or (not (and (logtest? (focus-status dark) (-> self focus-status)) - (nonzero? (-> self darkjak)) - (logtest? (-> self darkjak stage) 32) - ) - ) + (or (not (and (focus-test? self dark) (nonzero? (-> self darkjak)) (logtest? (-> self darkjak stage) 32))) (= (-> self darkjak-interp) 0.0) ) ) @@ -690,10 +663,7 @@ (if (and (cpad-pressed? (-> self control cpad number) square) (not (logtest? (-> self state-flags) (state-flags prevent-jump prevent-attack))) (not (logtest? (-> self control current-surface flags) (surface-flag no-attack))) - (and (logtest? (focus-status dark) (-> self focus-status)) - (nonzero? (-> self darkjak)) - (logtest? (-> self darkjak stage) 2) - ) + (and (focus-test? self dark) (nonzero? (-> self darkjak)) (logtest? (-> self darkjak stage) 2)) (< sv-32 2) ) (set! sv-40 (the-as int (-> self clock frame-counter))) @@ -1284,10 +1254,7 @@ ) ) ) - (if (and (logtest? (focus-status dark) (-> self focus-status)) - (nonzero? (-> self darkjak)) - (logtest? (-> self darkjak stage) 32) - ) + (if (and (focus-test? self dark) (nonzero? (-> self darkjak)) (logtest? (-> self darkjak stage) 32)) (set! (-> sv-80 y) (* 0.5 (+ (-> self control trans y) (-> self control root-prim prim-core world-sphere y)))) (set! (-> sv-80 y) (-> self control root-prim prim-core world-sphere y)) ) @@ -1370,9 +1337,7 @@ (suspend) (ja-eval) ) - (when (and (logtest? (focus-status dark) (-> self focus-status)) - (and (nonzero? (-> self darkjak)) (logtest? (-> self darkjak stage) 32)) - ) + (when (and (focus-test? self dark) (and (nonzero? (-> self darkjak)) (logtest? (-> self darkjak stage) 32))) (let ((gp-10 (process-spawn manipy :init manipy-init @@ -1527,13 +1492,11 @@ (set! (-> v1-19 id) (the-as uint arg3)) (set! (-> v1-19 mode) 'ice) (set! (-> v1-19 damage) 15.0) - (set! (-> v1-19 penetrate-using) (if (and (logtest? (focus-status dark) (-> self focus-status)) - (nonzero? (-> self darkjak)) - (logtest? (-> self darkjak stage) 32) - ) - (penetrate touch dark-skin dark-bomb dark-giant) - (penetrate touch dark-skin dark-bomb) - ) + (set! (-> v1-19 penetrate-using) + (if (and (focus-test? self dark) (nonzero? (-> self darkjak)) (logtest? (-> self darkjak stage) 32)) + (penetrate touch dark-skin dark-bomb dark-giant) + (penetrate touch dark-skin dark-bomb) + ) ) (set! (-> a1-6 param 1) (the-as uint v1-19)) ) @@ -1796,9 +1759,7 @@ ) ) (set! (-> sv-56 r) - (if (and (logtest? (focus-status dark) (-> self focus-status)) - (and (nonzero? (-> self darkjak)) (logtest? (-> self darkjak stage) 32)) - ) + (if (and (focus-test? self dark) (and (nonzero? (-> self darkjak)) (logtest? (-> self darkjak stage) 32))) 614400.0 327680.0 ) diff --git a/test/decompiler/reference/jak2/engine/target/target-death_REF.gc b/test/decompiler/reference/jak2/engine/target/target-death_REF.gc index 2ccd4b56a0..d79e059d83 100644 --- a/test/decompiler/reference/jak2/engine/target/target-death_REF.gc +++ b/test/decompiler/reference/jak2/engine/target/target-death_REF.gc @@ -564,7 +564,7 @@ ((begin (target-timed-invulnerable (-> arg0 invinc-time) self 1) (cpad-set-buzz! (-> *cpad-list* cpads 0) 0 255 (seconds 0.5)) - (logtest? (focus-status indax) (-> self focus-status)) + (focus-test? self indax) ) (let* ((v1-14 (rand-vu-int-count 4)) (t0-1 (cond @@ -667,7 +667,7 @@ ) (case (-> arg4 angle) (('jump 'up 'up-forward) - (when (and (not (logtest? (focus-status flut pilot mech indax) (-> self focus-status))) + (when (and (not (focus-test? self flut pilot mech indax)) (not (and (= (-> self game mode) 'play) (>= 0.0 (-> self fact-override health)))) ) (if (and (cpad-pressed? (-> self control cpad number) circle) (can-feet? #f)) @@ -1001,7 +1001,7 @@ (vector-xz-normalize! (-> sv-32 vector) (- (fabs (-> sv-32 shove-back)))) (set! (-> sv-32 vector y) (-> sv-32 shove-up)) ) - (when (and (logtest? (focus-status dark) (-> self focus-status)) (nonzero? (-> self darkjak))) + (when (and (focus-test? self dark) (nonzero? (-> self darkjak))) (set! (-> sv-32 damage) (fmax 1.0 (ceil (* 0.5 (-> sv-32 damage))))) (if (< (- (-> self fact-override health) (-> sv-32 damage)) 1.0) (set! (-> sv-32 damage) (+ -1.0 (-> self fact-override health))) @@ -1264,9 +1264,7 @@ (set! (-> self control mod-surface) *smack-mods*) (target-hit-setup-anim sv-32) (target-hit-move sv-32 (target-hit-orient sv-32 sv-36) target-falling-anim-trans 1.0) - (if (and (and (logtest? (focus-status dark) (-> self focus-status)) (nonzero? (-> self darkjak))) - (>= 1.0 (-> self fact-override health)) - ) + (if (and (and (focus-test? self dark) (nonzero? (-> self darkjak))) (>= 1.0 (-> self fact-override health))) (go target-darkjak-get-off) ) (if (and (= (-> self game mode) 'play) (>= 0.0 (-> self fact-override health))) @@ -1488,7 +1486,7 @@ ((= (the-as object arg1) 'wait) (set! (-> self trans-hook) #f) (set! (-> self control unknown-word04) (the-as uint #f)) - (when (not (logtest? (focus-status pilot) (-> self focus-status))) + (when (not (focus-test? self pilot)) (set! (-> self post-hook) target-no-ja-move-post) (ja-post) ) @@ -1616,7 +1614,7 @@ (let ((v1-21 (-> self water flags))) (if (or (and (logtest? (water-flags touch-water) v1-21) (logtest? (water-flags under-water swimming) v1-21) - (zero? (logand (focus-status mech) (-> self focus-status))) + (not (logtest? (focus-status mech) (-> self focus-status))) ) (= (-> self control cur-pat material) (pat-material waterbottom)) ) @@ -1797,7 +1795,7 @@ (b! (or (and (logtest? (water-flags touch-water) v1-159) (logtest? (water-flags under-water swimming) v1-159) - (zero? (logand (focus-status mech) (-> self focus-status))) + (not (logtest? (focus-status mech) (-> self focus-status))) ) (= (-> self control cur-pat material) (pat-material waterbottom)) ) diff --git a/test/decompiler/reference/jak2/engine/target/target-gun_REF.gc b/test/decompiler/reference/jak2/engine/target/target-gun_REF.gc index c938206961..8d36b9b540 100644 --- a/test/decompiler/reference/jak2/engine/target/target-gun_REF.gc +++ b/test/decompiler/reference/jak2/engine/target/target-gun_REF.gc @@ -115,7 +115,7 @@ (('change-mode) (case (-> arg3 param 0) (('grab) - (when (not (logtest? (-> self focus-status) (focus-status dead))) + (when (not (focus-test? self dead)) (if (not (-> arg3 param 1)) #t (go target-grab 'stance) @@ -245,7 +245,7 @@ ) ) (cond - ((logtest? (-> self focus-status) (focus-status pilot-riding)) + ((focus-test? self pilot-riding) (case (-> self gun gun-type) (((pickup-type eco-yellow)) (push-anim-to-targ @@ -384,11 +384,11 @@ (set! (-> self gun active?) #f) (cond ((and (not (logtest? (surface-flag gun-fast-exit) (-> self control current-surface flags))) - (zero? (logand (-> self focus-status) (focus-status dead))) + (not (logtest? (-> self focus-status) (focus-status dead))) ) (sound-play "gun-putaway") (cond - ((logtest? (-> self focus-status) (focus-status pilot-riding)) + ((focus-test? self pilot-riding) (case (-> self gun gun-type) (((pickup-type eco-yellow)) (push-anim-to-targ @@ -723,7 +723,7 @@ (quat<-gun! (the-as quaternion (-> self gun top-anim-twist-targ)) (the-as quaternion arg0)) (set! (-> self skel top-anim frame-post-blend) 0.1333333) (cond - ((logtest? (-> self focus-status) (focus-status pilot-riding)) + ((focus-test? self pilot-riding) (let ((v1-164 arg0)) (cond ((and (= s5-0 (pickup-type eco-red)) (= v1-164 4)) @@ -1087,8 +1087,8 @@ ;; WARN: Return type mismatch int vs none. (defun target-gun-marking-menu ((arg0 target)) (when (and (not (paused?)) - (not (and (logtest? (focus-status dark) (-> arg0 focus-status)) (nonzero? (-> arg0 darkjak)))) - (zero? (logand (-> arg0 focus-status) (focus-status grabbed))) + (not (and (focus-test? arg0 dark) (nonzero? (-> arg0 darkjak)))) + (not (logtest? (-> arg0 focus-status) (focus-status grabbed))) ) (let ((s5-0 (the-as int (-> arg0 gun using-gun-type)))) (cond @@ -1109,9 +1109,7 @@ (and (logtest? (the-as game-feature (ash 1 (+ s5-0 5))) (logand (-> arg0 game features) (-> *setting-control* user-current features)) ) - (or (not (logtest? (focus-status pilot) (-> arg0 focus-status))) - (and (nonzero? (-> arg0 pilot)) (-> arg0 pilot gun?)) - ) + (or (not (focus-test? arg0 pilot)) (and (nonzero? (-> arg0 pilot)) (-> arg0 pilot gun?))) (begin (set! (-> arg0 gun using-gun-type) (the-as pickup-type s5-0)) (and s5-0 @@ -1154,17 +1152,15 @@ (let ((s5-0 (new 'stack-no-clear 'vector))) (let ((s4-0 (-> self gun track-dir))) (set! (-> s4-0 quad) - (-> (the-as - vector - (if (and (or (= (-> *cpad-list* cpads (-> self control cpad number) stick0-speed) 0.0) - (logtest? (surface-flag gun-strafe) (-> self control current-surface flags)) - ) - (not (and (logtest? (focus-status dark) (-> self focus-status)) (nonzero? (-> self darkjak)))) - ) - (-> self gun fire-dir) - (-> self control to-target-pt-xz) - ) - ) + (-> (the-as vector (if (and (or (= (-> *cpad-list* cpads (-> self control cpad number) stick0-speed) 0.0) + (logtest? (surface-flag gun-strafe) (-> self control current-surface flags)) + ) + (not (and (focus-test? self dark) (nonzero? (-> self darkjak)))) + ) + (-> self gun fire-dir) + (-> self control to-target-pt-xz) + ) + ) quad ) ) @@ -1199,7 +1195,7 @@ (let ((gp-0 (the-as basic #f))) (when (and (or (< (- (-> self clock frame-counter) (-> self control time-of-last-nonzero-input)) (seconds 0.2)) (and (logtest? (-> self control mod-surface flags) (surface-flag air)) - (zero? (logand (-> self control status) (collide-status on-surface))) + (not (logtest? (-> self control status) (collide-status on-surface))) ) (or (logtest? (surface-flag gun-direct) (-> self control current-surface flags)) (= (-> self gun gun-type) (pickup-type eco-dark)) @@ -1225,7 +1221,7 @@ ) ) ((or (and (logtest? (-> self control mod-surface flags) (surface-flag air)) - (zero? (logand (-> self control status) (collide-status on-surface))) + (not (logtest? (-> self control status) (collide-status on-surface))) ) (logtest? (surface-flag gun-direct) (-> self control current-surface flags)) ) @@ -1292,9 +1288,7 @@ (let ((s5-1 (handle->process (-> self gun track-target 0 handle)))) (cond ((or (not s5-1) - (or (and (logtest? (-> (the-as process-focusable s5-1) focus-status) (focus-status dead)) - (zero? (-> self gun track-target-hold-time)) - ) + (or (and (focus-test? (the-as process-focusable s5-1) dead) (zero? (-> self gun track-target-hold-time))) (and (not (and (nonzero? (-> self gun track-target-hold-time)) (< (-> self clock frame-counter) (-> self gun track-target-hold-time)) ) @@ -1313,7 +1307,7 @@ ) ) (and (or (and (logtest? (-> self control mod-surface flags) (surface-flag air)) - (zero? (logand (-> self control status) (collide-status on-surface))) + (not (logtest? (-> self control status) (collide-status on-surface))) ) (logtest? (surface-flag gun-direct) (-> self control current-surface flags)) ) @@ -1421,7 +1415,7 @@ ;; WARN: Return type mismatch int vs none. (defbehavior target-top-anim-base-mode target ((arg0 int)) (cond - ((logtest? (-> self focus-status) (focus-status pilot-riding)) + ((focus-test? self pilot-riding) (case (-> self gun gun-type) (((pickup-type eco-yellow)) (push-anim-to-targ @@ -1548,7 +1542,7 @@ ;; INFO: Used lq/sq ;; WARN: Return type mismatch int vs none. (defbehavior target-gun-joint-pre0 target () - (if (!= (zero? (logand (-> self game features) (game-feature gun))) (not (-> self gun gun))) + (if (!= (not (logtest? (-> self game features) (game-feature gun))) (not (-> self gun gun))) (target-gun-setup (logtest? (-> self game features) (game-feature gun))) ) (if (and (>= (- (-> self clock frame-counter) (-> self gun combo-window-start)) (seconds 0.7)) @@ -1559,7 +1553,7 @@ (cond ((and (cpad-pressed? (-> self control cpad number) r1) (< (- (-> self clock frame-counter) (-> self gun combo-window-start)) (seconds 0.7)) - (not (logtest? (focus-status mech dark) (-> self focus-status))) + (not (focus-test? self mech dark)) (not (logtest? (surface-flag gun-off) (-> self control current-surface flags))) (not (logtest? (state-flags prevent-gun) (-> self state-flags))) (zero? (-> self gun track-target-hold-time)) @@ -1661,12 +1655,12 @@ (cond ((or (and (not (logtest? (-> self control status) (collide-status on-surface))) (or (and (logtest? (-> self control mod-surface flags) (surface-flag air)) - (zero? (logand (-> self control status) (collide-status on-surface))) + (not (logtest? (-> self control status) (collide-status on-surface))) ) (< 2048.0 (target-height-above-ground)) ) ) - (logtest? (-> self focus-status) (focus-status edge-grab)) + (focus-test? self edge-grab) (-> *setting-control* user-current doorway) ) (if (!= (-> self control duck-gun-tube-transision) 0.0) @@ -1710,7 +1704,7 @@ ) (target-gun-find-track) (cond - ((and (= (-> self gun gun-type) (pickup-type eco-blue)) (zero? (logand (-> self gun track?) 1))) + ((and (= (-> self gun gun-type) (pickup-type eco-blue)) (not (logtest? (-> self gun track?) 1))) (let ((f0-8 (vector-vector-distance (-> self gun fire-point) (-> self gun laser-hit-point)))) (cond ((< f0-8 122880.0) @@ -1757,7 +1751,7 @@ ) (and (logtest? (-> self gun track?) 1) (logtest? (-> self gun track?) 4)) (or (logtest? (surface-flag gun-strafe) (-> self control current-surface flags)) - (logtest? (-> self focus-status) (focus-status pilot-riding)) + (focus-test? self pilot-riding) ) ) (seek! (-> self upper-body twist z) 0.0 (* 65536.0 (-> self clock seconds-per-frame))) @@ -1766,7 +1760,7 @@ (seek! (-> self upper-body twist z) 0.0 (* 16384.0 (-> self clock seconds-per-frame))) ) ((and (< 0.0 (-> self control turn-to-magnitude)) - (zero? (logand (-> self control current-surface flags) (surface-flag duck))) + (not (logtest? (-> self control current-surface flags) (surface-flag duck))) ) (let* ((f0-28 (deg-diff (y-angle (-> self control)) (vector-y-angle (-> self control to-target-pt-xz)))) (f0-30 (fmax -5461.3335 (fmin 5461.3335 f0-28))) @@ -1844,7 +1838,7 @@ (set! (-> self gun upper-body twist-speed-x) 0.6) ) ((and (or (and (logtest? (-> self control mod-surface flags) (surface-flag air)) - (zero? (logand (-> self control status) (collide-status on-surface))) + (not (logtest? (-> self control status) (collide-status on-surface))) ) (logtest? (surface-flag gun-direct) (-> self control current-surface flags)) ) @@ -1923,7 +1917,7 @@ (local-vars (gp-0 art-element)) (target-gun-joint-pre0) (cond - ((logtest? (-> self focus-status) (focus-status pilot-riding)) + ((focus-test? self pilot-riding) (let ((v1-3 (-> self gun gun-type))) (set! (-> self skel top-anim base-anim) (cond ((= v1-3 (pickup-type eco-yellow)) @@ -2118,16 +2112,16 @@ (matrix-lerp! gp-0 a1-0 a2-0 (-> self gun gun-daxter)) (matrix->transformq (-> self gun gun-pos) gp-0) (set! (-> self gun gun-pos scale quad) (-> self control scale quad)) - (when (and (using-gun? self) (and (logtest? (-> self focus-status) (focus-status edge-grab)) - (let ((v1-18 (ja-group))) - (and v1-18 (or (= v1-18 (-> self draw art-group data 27)) - (= v1-18 (-> self draw art-group data 35)) - (= v1-18 (-> self draw art-group data 33)) - (= v1-18 (-> self draw art-group data 34)) - ) - ) - ) - ) + (when (and (using-gun? self) + (and (focus-test? self edge-grab) (let ((v1-18 (ja-group))) + (and v1-18 (or (= v1-18 (-> self draw art-group data 27)) + (= v1-18 (-> self draw art-group data 35)) + (= v1-18 (-> self draw art-group data 33)) + (= v1-18 (-> self draw art-group data 34)) + ) + ) + ) + ) ) (let ((s4-0 (new 'static 'vector :y 491.52 :w 1.0)) (a1-5 (new 'static 'vector :x -16384.0 :z -16384.0 :w 1.0)) @@ -2154,7 +2148,7 @@ (defbehavior target-gun-joint-points target () (when (-> self gun gun) (set! (-> self gun gun-daxter) - (if (and (logtest? (-> self focus-status) (focus-status pilot-riding)) + (if (and (focus-test? self pilot-riding) (nonzero? (-> self skel float-channels)) (= (-> (get-channel (-> self skel top-anim) (the-as int (+ (-> self skel float-channels) -1))) frame-interp 1) 1.0 @@ -2264,8 +2258,8 @@ (set! (-> self gun active-time) (-> self clock frame-counter)) ) (set! (-> self gun laser-active?) - (zero? (logand (surface-flag gun-inactive gun-hide gun-off laser-hide) (-> self control current-surface flags)) - ) + (not (logtest? (surface-flag gun-inactive gun-hide gun-off laser-hide) (-> self control current-surface flags)) + ) ) (when (and (not (and (not (logtest? (surface-flag gun-inactive gun-hide gun-off) (-> self control current-surface flags))) (>= (- (-> self clock frame-counter) (-> self gun gun-get-on-time)) (seconds 0.1)) @@ -2323,7 +2317,7 @@ ) (and (not (cpad-hold? (-> self control cpad number) r1)) (not (logtest? (surface-flag gun-inactive) (-> self control current-surface flags))) - (zero? (logand (-> self focus-status) (focus-status grabbed))) + (not (logtest? (-> self focus-status) (focus-status grabbed))) ) ) (-> self gun put-away?) @@ -2332,7 +2326,7 @@ (logand (-> self game features) (-> *setting-control* user-current features)) ) ) - (logtest? (focus-status dead dark) (-> self focus-status)) + (focus-test? self dead dark) (-> self board latch?) ) ) @@ -2352,7 +2346,7 @@ ) ) ) - (target-gun-end-mode (zero? (logand (surface-flag gun-hide) (-> self control current-surface flags)))) + (target-gun-end-mode (not (logtest? (surface-flag gun-hide) (-> self control current-surface flags)))) ) ) (else @@ -2381,7 +2375,7 @@ (case (-> gp-0 gun-type) (((pickup-type eco-blue)) (cond - ((logtest? (-> self focus-status) (focus-status pilot-riding)) + ((focus-test? self pilot-riding) (let ((v1-15 (get-channel (-> self skel top-anim) 0))) (when (not (or (= (-> self skel top-anim frame-group) (-> self draw art-group data 206)) (and v1-15 (= (-> v1-15 frame-group) (-> self draw art-group data 206))) @@ -2448,7 +2442,7 @@ ) (((pickup-type eco-yellow)) (cond - ((logtest? (-> self focus-status) (focus-status pilot-riding)) + ((focus-test? self pilot-riding) (push-anim-to-targ (-> self skel top-anim) (the-as art-joint-anim (-> self draw art-group data 223)) @@ -2496,7 +2490,7 @@ ) ) (cond - ((logtest? (-> self focus-status) (focus-status pilot-riding)) + ((focus-test? self pilot-riding) (push-anim-to-targ (-> self skel top-anim) (the-as art-joint-anim (-> self draw art-group data 222)) @@ -2583,7 +2577,7 @@ (target-gun-fire-red) ) (((pickup-type eco-dark)) - (if (logtest? (-> self focus-status) (focus-status pilot-riding)) + (if (focus-test? self pilot-riding) (push-anim-to-targ (-> self skel top-anim) (the-as art-joint-anim (-> self draw art-group data 224)) @@ -2639,7 +2633,7 @@ (when (using-gun? self) (let ((gp-0 (-> self gun))) (cond - ((and (logtest? (-> self focus-status) (focus-status pilot-riding)) (nonzero? (-> self skel float-channels))) + ((and (focus-test? self pilot-riding) (nonzero? (-> self skel float-channels))) (set! (-> self skel top-anim interp-select 0) (the-as uint #x800000)) (set! (-> self skel top-anim interp-select 1) (the-as uint 0)) 0 @@ -2650,8 +2644,7 @@ 0 ) ) - (if (not (or (logtest? (-> self focus-status) (focus-status in-head)) (= (-> self gun gun-type) (pickup-type eco-red))) - ) + (if (not (or (focus-test? self in-head) (= (-> self gun gun-type) (pickup-type eco-red)))) (gun-info-method-9 gp-0) ) (if (and (logtest? (surface-flag spin) (-> self control current-surface flags)) @@ -2763,7 +2756,7 @@ (set! (-> self gun top-anim-blue-cycle) f0-24) (push-anim-to-targ (-> self skel top-anim) - (the-as art-joint-anim (if (logtest? (-> self focus-status) (focus-status pilot-riding)) + (the-as art-joint-anim (if (focus-test? self pilot-riding) (-> self draw art-group data 206) (-> self draw art-group data 257) ) diff --git a/test/decompiler/reference/jak2/engine/target/target-handler_REF.gc b/test/decompiler/reference/jak2/engine/target/target-handler_REF.gc index 482922437d..87122a776a 100644 --- a/test/decompiler/reference/jak2/engine/target/target-handler_REF.gc +++ b/test/decompiler/reference/jak2/engine/target/target-handler_REF.gc @@ -54,9 +54,7 @@ ) (s2-0 arg0) ) - (when (or (and (not (logtest? (-> self focus-status) (focus-status hit))) - (zero? (logand (state-flags disable-attacks) (-> self state-flags))) - ) + (when (or (and (not (focus-test? self hit)) (not (logtest? (state-flags disable-attacks) (-> self state-flags)))) (= s4-0 'endlessfall) ) (case s4-0 @@ -71,13 +69,12 @@ (logtest? (-> self game secrets) (game-secrets invulnerable)) (and (logtest? (-> self state-flags) (state-flags sf4)) (not (attack-mode-is-invinc s4-0))) (< 0.0 (-> (the-as fact-info-target (-> self fact-override)) shield-level)) - (and (= s4-0 'darkeco) (and (and (= (-> (the-as fact-info-target (-> self fact-override)) eco-type) 2) - (>= (-> (the-as fact-info-target (-> self fact-override)) eco-level) 1.0) - ) - (or (logtest? (-> self state-flags) (state-flags sf15)) - (logtest? (-> self focus-status) (focus-status dangerous)) - ) - ) + (and (= s4-0 'darkeco) + (and (and (= (-> (the-as fact-info-target (-> self fact-override)) eco-type) 2) + (>= (-> (the-as fact-info-target (-> self fact-override)) eco-level) 1.0) + ) + (or (logtest? (-> self state-flags) (state-flags sf15)) (focus-test? self dangerous)) + ) ) ) (case arg0 @@ -101,7 +98,7 @@ ) (mem-copy! (the-as pointer (-> self attack-info-rec)) (the-as pointer arg1) 160) (compute-intersect-info (-> self attack-info-rec) arg1 self arg2 arg3) - (when (not (logtest? (focus-status mech) (-> self focus-status))) + (when (not (focus-test? self mech)) (if (and (not (target-log-attack (-> self attack-info-rec) (if (logtest? (attack-info-mask test) (-> arg1 mask)) 'test 'log @@ -189,7 +186,7 @@ (logior! (-> self focus-status) (focus-status ignore hit)) (when (and (= (-> self game mode) 'play) (and (or (and (>= 0.0 (- (-> (the-as fact-info-target (-> self fact-override)) health) (-> self attack-info-rec damage))) - (not (and (logtest? (focus-status dark) (-> self focus-status)) (nonzero? (-> self darkjak)))) + (not (and (focus-test? self dark) (nonzero? (-> self darkjak)))) ) (attack-mode-is-invinc s4-0) ) @@ -263,7 +260,7 @@ s3-0 ) ) - (s3-1 (and s4-0 (logtest? (-> (the-as process-focusable s4-0) focus-status) (focus-status dead hit)))) + (s3-1 (and s4-0 (focus-test? (the-as process-focusable s4-0) dead hit))) ) (let ((a1-2 (new 'stack-no-clear 'event-message-block))) (set! (-> a1-2 from) (process->ppointer self)) @@ -283,15 +280,11 @@ (set! (-> self control send-attack-dest) (process->handle arg0)) (set! (-> self control send-attack-time) (-> self clock frame-counter)) (send-event self 'hit arg1 arg0 arg2) - (set! arg0 (and (and (logtest? (focus-status dark) (-> self focus-status)) - (nonzero? (-> self darkjak)) - (logtest? (-> self darkjak stage) 2) - ) - arg0 - ) + (set! arg0 + (and (and (focus-test? self dark) (nonzero? (-> self darkjak)) (logtest? (-> self darkjak stage) 2)) arg0) ) (when (the-as object arg0) - (when (and s4-0 (not s3-1) (-> self control danger-mode) (zero? (logand (-> s4-0 mask) (process-mask dark-effect)))) + (when (and s4-0 (not s3-1) (-> self control danger-mode) (not (logtest? (-> s4-0 mask) (process-mask dark-effect)))) (logior! (-> s4-0 mask) (process-mask dark-effect)) (process-spawn-function process @@ -304,14 +297,14 @@ ) (set! (-> self clock) (-> gp-0 0 clock)) (while (let ((v1-48 gp-0)) - (and (or (logtest? (-> (the-as process-focusable (if v1-48 - (the-as process-focusable (-> v1-48 0 self)) - ) - ) - focus-status - ) - (focus-status dead hit) + (and (or (focus-test? + (the-as process-focusable (if v1-48 + (the-as process-focusable (-> v1-48 0 self)) + ) ) + dead + hit + ) (let ((v1-53 gp-0)) (and (-> (the-as process-focusable (if v1-53 (the-as process-focusable (-> v1-53 0 self)) @@ -334,8 +327,8 @@ ) ) (< (- (-> self clock frame-counter) s3-0) (seconds 15)) - (zero? (logand (-> (the-as process-focusable (-> gp-0 0)) draw status) (draw-control-status no-draw no-draw-temp)) - ) + (not (logtest? (-> (the-as process-focusable (-> gp-0 0)) draw status) (draw-control-status no-draw no-draw-temp)) + ) ) ) (let ((s2-0 sp-launch-particles-var) @@ -676,7 +669,7 @@ object (case arg2 (('get-pickup) - (when (not (logtest? (-> self focus-status) (focus-status dead))) + (when (not (focus-test? self dead)) (let ((s4-0 (-> arg3 param 0)) (f28-0 (the-as float (-> arg3 param 1))) ) @@ -708,7 +701,7 @@ ) ) (('level-deactivate) - (when (and (logtest? (focus-status pilot) (-> self focus-status)) + (when (and (focus-test? self pilot) (or (= (-> arg3 param 0) 'ctywide) (and (= (-> arg3 param 0) 'lracelit) (-> self pilot as-daxter?))) ) (ja-channel-set! 0) @@ -720,7 +713,7 @@ ) ) (update (-> self skel top-anim)) - (when (not (logtest? (-> self focus-status) (focus-status grabbed))) + (when (not (focus-test? self grabbed)) (set! (-> self event-hook) #f) (go target-jump (-> *TARGET-bank* jump-height-min) (-> *TARGET-bank* jump-height-max) (the-as surface #f)) ) @@ -755,7 +748,7 @@ (= s3-0 (-> *game-info* play-list (-> s2-0 task) play-node)) (or (logtest? (-> s2-0 flags) (game-task-node-flag closed)) (open? s2-0)) (not (task-complete? (-> self game) (-> s2-0 task))) - (zero? (logand (game-task-node-flag utility-node) (-> s2-0 flags))) + (not (logtest? (game-task-node-flag utility-node) (-> s2-0 flags))) ) (when (zero? (-> self game task-close-times (-> s2-0 task))) (format #t "--------------> set task start time for ~A~%" (-> s2-0 name)) @@ -855,10 +848,7 @@ ) ) (('effect-control) - (when (and (logtest? (focus-status dark) (-> self focus-status)) - (nonzero? (-> self darkjak)) - (logtest? (-> self darkjak stage) 32) - ) + (when (and (focus-test? self dark) (nonzero? (-> self darkjak)) (logtest? (-> self darkjak stage) 32)) (case (-> arg3 param 0) (('effect-walk-step-left 'effect-walk-step-right 'effect-run-step-left 'effect-run-step-right) (activate! *camera-smush-control* 409.6 15 75 1.0 0.98 (-> *display* camera-clock)) @@ -973,11 +963,8 @@ ) v0-0 ) - ((and (and (logtest? (focus-status dark) (-> self focus-status)) (nonzero? (-> self darkjak))) - (or (and (logtest? (focus-status dark) (-> self focus-status)) - (nonzero? (-> self darkjak)) - (logtest? (-> self darkjak stage) 16) - ) + ((and (and (focus-test? self dark) (nonzero? (-> self darkjak))) + (or (and (focus-test? self dark) (nonzero? (-> self darkjak)) (logtest? (-> self darkjak stage) 16)) (logtest? (process-mask crate) (-> arg0 mask)) ) ) @@ -1143,15 +1130,13 @@ (b! (!= v1-0 'loading) cfg-44 :delay (nop!)) (set! v0-0 (if (not (or (and (logtest? (-> self control mod-surface flags) (surface-flag air)) - (zero? (logand (-> self control status) (collide-status on-surface))) + (not (logtest? (-> self control status) (collide-status on-surface))) ) (or (logtest? (water-flags touch-water) (-> self water flags)) (logtest? (-> self control status) (collide-status on-water)) ) (or (logtest? (-> self state-flags) (state-flags sf1)) - (logtest? (focus-status dead dangerous hit grabbed in-head edge-grab pole flut tube board pilot mech) - (-> self focus-status) - ) + (focus-test? self dead dangerous hit grabbed in-head edge-grab pole flut tube board pilot mech) (>= (the-as time-frame (-> self no-load-wait)) (-> self clock frame-counter)) ) ) @@ -1170,7 +1155,7 @@ (set! v0-0 (cond ((= v1-45 'grab) - (when (not (logtest? (-> self focus-status) (focus-status dead))) + (when (not (focus-test? self dead)) (if (not (-> arg3 param 1)) #t (go target-grab 'stance) @@ -1280,7 +1265,7 @@ ) ((= v1-45 'darkjak) (cond - ((not (and (logtest? (focus-status dark) (-> self focus-status)) (nonzero? (-> self darkjak)))) + ((not (and (focus-test? self dark) (nonzero? (-> self darkjak)))) (go target-darkjak-get-on (the-as int (-> arg3 param 2))) ) ((logtest? (-> arg3 param 2) 128) @@ -1295,8 +1280,8 @@ (go target-hide) ) ((= v1-45 'normal) - (if (and (and (logtest? (focus-status dark) (-> self focus-status)) (nonzero? (-> self darkjak))) - (and (not (logtest? (-> self focus-status) (focus-status dead dangerous hit grabbed))) + (if (and (and (focus-test? self dark) (nonzero? (-> self darkjak))) + (and (not (focus-test? self dead dangerous hit grabbed)) (not (and (-> self next-state) (= (-> self next-state name) 'target-darkjak-get-off))) ) ) @@ -1314,8 +1299,8 @@ ((and (using-gun? self) (target-gun-end-mode #f)) (go target-stance) ) - ((and (and (logtest? (focus-status dark) (-> self focus-status)) (nonzero? (-> self darkjak))) - (and (not (logtest? (-> self focus-status) (focus-status dead dangerous hit grabbed))) + ((and (and (focus-test? self dark) (nonzero? (-> self darkjak))) + (and (not (focus-test? self dead dangerous hit grabbed)) (not (and (-> self next-state) (= (-> self next-state name) 'target-darkjak-get-off))) ) ) @@ -1331,9 +1316,7 @@ (label cfg-214) (b! (!= v1-0 'darkjak) cfg-225 :delay (nop!)) (set! v0-0 - (when (and (and (logtest? (focus-status dark) (-> self focus-status)) (nonzero? (-> self darkjak))) - (zero? (-> self darkjak want-stage)) - ) + (when (and (and (focus-test? self dark) (nonzero? (-> self darkjak))) (zero? (-> self darkjak want-stage))) (let ((v1-164 (-> arg3 param 0))) (when (logtest? v1-164 4) (set! (-> self darkjak want-stage) v1-164) @@ -1353,20 +1336,20 @@ (b! #t cfg-291 :delay (nop!)) (label cfg-234) (b! (!= v1-0 'edge-grab) cfg-238 :delay (nop!)) - (b! (logtest? (-> self focus-status) (focus-status dead hit grabbed)) cfg-237 :delay (set! v0-0 #f)) + (b! (focus-test? self dead hit grabbed) cfg-237 :delay (set! v0-0 #f)) (set! v0-0 (go target-edge-grab)) (label cfg-237) (b! #t cfg-291 :delay (nop!)) (label cfg-238) (b! (!= v1-0 'pilot-edge-grab) cfg-242 :delay (nop!)) - (b! (logtest? (-> self focus-status) (focus-status dead hit grabbed)) cfg-241 :delay (set! v0-0 #f)) + (b! (focus-test? self dead hit grabbed) cfg-241 :delay (set! v0-0 #f)) (set! v0-0 (go target-pilot-edge-grab (the-as pilot-edge-grab-info (-> arg3 param 0)))) (label cfg-241) (b! #t cfg-291 :delay (nop!)) (label cfg-242) (b! (!= v1-0 'pole-grab) cfg-256 :delay (nop!)) (set! v0-0 - (if (and (not (logtest? (-> self focus-status) (focus-status dead hit grabbed pole))) + (if (and (not (focus-test? self dead hit grabbed pole)) ((method-of-type touching-shapes-entry prims-touching?) (the-as touching-shapes-entry (-> arg3 param 0)) (-> self control) @@ -1384,7 +1367,7 @@ (if (not (or (= (-> self control mod-surface mode) 'swim) (= (-> self control mod-surface mode) 'dive) (and (-> self next-state) (= (-> self next-state name) 'target-hit)) - (logtest? (-> self focus-status) (focus-status dead hit grabbed)) + (focus-test? self dead hit grabbed) ) ) (go target-swim-stance) @@ -1400,7 +1383,7 @@ (or (= v1-206 'target-stance) (= v1-206 'target-walk) (= v1-206 'target-stance-look-around)) ) ) - (zero? (logand (-> self focus-status) (focus-status dead hit grabbed))) + (not (logtest? (-> self focus-status) (focus-status dead hit grabbed))) ) (go target-wade-stance) ) @@ -1408,11 +1391,7 @@ (b! #t cfg-291 :delay (nop!)) (label cfg-286) (b! (!= v1-0 'slide) cfg-290 :delay (nop!)) - (b! - (logtest? (-> self focus-status) (focus-status dead hit grabbed on-water under-water)) - cfg-289 - :delay (set! v0-0 #f) - ) + (b! (focus-test? self dead hit grabbed on-water under-water) cfg-289 :delay (set! v0-0 #f)) (set! v0-0 (go target-slide-down-to-ground)) (label cfg-289) (b! #t cfg-291 :delay (nop!)) @@ -1538,7 +1517,7 @@ (the-as int (-> self control attack-count)) (-> self control penetrate-using) ) - (zero? (logand (-> self focus-status) (focus-status dead hit))) + (not (logtest? (-> self focus-status) (focus-status dead hit))) ) (set! (-> self control last-trans-any-surf quad) (-> self control trans quad)) (target-timed-invulnerable (seconds 0.1) self 1) diff --git a/test/decompiler/reference/jak2/engine/target/target-swim_REF.gc b/test/decompiler/reference/jak2/engine/target/target-swim_REF.gc index dd3c2c81d2..9cd99e6f35 100644 --- a/test/decompiler/reference/jak2/engine/target/target-swim_REF.gc +++ b/test/decompiler/reference/jak2/engine/target/target-swim_REF.gc @@ -419,7 +419,7 @@ :trans (behavior () ((-> self state-hook)) (if (and (logtest? (-> self control status) (collide-status on-surface)) - (zero? (logand (-> self control status) (collide-status on-water))) + (not (logtest? (-> self control status) (collide-status on-water))) ) (set-zero! (-> self water bob)) ) @@ -542,7 +542,7 @@ :trans (behavior () ((-> self state-hook)) (if (and (logtest? (-> self control status) (collide-status on-surface)) - (zero? (logand (-> self control status) (collide-status on-water))) + (not (logtest? (-> self control status) (collide-status on-water))) ) (set-zero! (-> self water bob)) ) @@ -889,7 +889,7 @@ :trans (behavior () (if (and (cpad-pressed? (-> self control cpad number) x) (not (logtest? (-> self state-flags) (state-flags prevent-jump))) - (zero? (logand (water-flags head-under-water bouncing) (-> self water flags))) + (not (logtest? (water-flags head-under-water bouncing) (-> self water flags))) ) (go target-swim-jump-jump @@ -954,7 +954,7 @@ 0.1 ) (when (and (not gp-0) - (or (>= (ja-aframe-num 0) 240.0) (zero? (logand (water-flags head-under-water) (-> self water flags)))) + (or (>= (ja-aframe-num 0) 240.0) (not (logtest? (water-flags head-under-water) (-> self water flags)))) ) (set! gp-0 #t) (sound-play "swim-surface") diff --git a/test/decompiler/reference/jak2/engine/target/target-tube_REF.gc b/test/decompiler/reference/jak2/engine/target/target-tube_REF.gc index d25b155c3b..a420ce9bae 100644 --- a/test/decompiler/reference/jak2/engine/target/target-tube_REF.gc +++ b/test/decompiler/reference/jak2/engine/target/target-tube_REF.gc @@ -538,7 +538,7 @@ (('change-mode) (case (-> event param 0) (('grab) - (when (not (logtest? (-> self focus-status) (focus-status dead))) + (when (not (focus-test? self dead)) (if (-> event param 1) (logior! (-> self focus-status) (focus-status grabbed)) ) @@ -549,7 +549,7 @@ ) (('end-mode) (cond - ((logtest? (-> self focus-status) (focus-status grabbed)) + ((focus-test? self grabbed) (logclear! (-> self focus-status) (focus-status grabbed)) #t ) @@ -895,7 +895,7 @@ ) (when (and (logtest? (-> arg1 mask) (attack-info-mask mode)) (= (-> arg1 mode) 'darkeco) - (zero? (logand (-> arg1 mask) (attack-info-mask shove-up))) + (not (logtest? (-> arg1 mask) (attack-info-mask shove-up))) ) (set! (-> arg1 shove-up) 12288.0) (logior! (-> arg1 mask) (attack-info-mask shove-up)) @@ -1110,7 +1110,7 @@ :trans (behavior () (if (and (and *target* (and (>= 81920.0 (vector-vector-distance (-> self root trans) (-> *target* control trans))) - (zero? (logand (focus-status teleporting) (-> *target* focus-status))) + (not (logtest? (focus-status teleporting) (-> *target* focus-status))) ) ) (< 0.0 @@ -1119,7 +1119,7 @@ (-> self rot) ) ) - (and (not (logtest? (-> *target* focus-status) (focus-status in-air))) + (and (not (focus-test? *target* in-air)) (< (-> *target* control trans y) (+ 12288.0 (-> self root trans y))) (send-event *target* 'change-mode 'tube self) ) diff --git a/test/decompiler/reference/jak2/engine/target/target-turret_REF.gc b/test/decompiler/reference/jak2/engine/target/target-turret_REF.gc index 035c556b41..ca1aa90f45 100644 --- a/test/decompiler/reference/jak2/engine/target/target-turret_REF.gc +++ b/test/decompiler/reference/jak2/engine/target/target-turret_REF.gc @@ -1145,12 +1145,12 @@ (until #f (when (and (and *target* (and (>= f30-0 (vector-vector-distance (-> self root-override trans) (-> *target* control trans))) - (zero? (logand (focus-status teleporting) (-> *target* focus-status))) + (not (logtest? (focus-status teleporting) (-> *target* focus-status))) ) ) (and (not (task-node-closed? (game-task-node drill-ship-resolution))) (can-display-query? self (the-as string #f) -99.0) - (not (logtest? (focus-status in-head board mech dark) (-> *target* focus-status))) + (not (focus-test? *target* in-head board mech dark)) (let ((f28-0 24576.0) (s4-0 (-> self root-override)) (s5-0 (target-pos 0)) @@ -1891,7 +1891,7 @@ (when (and s2-1 (logtest? (process-mask enemy) (-> s2-1 mask)) (logtest? (process-mask collectable) (-> s2-1 mask)) - (not (logtest? (-> (the-as process-focusable s2-1) focus-status) (focus-status disable dead ignore inactive))) + (not (focus-test? (the-as process-focusable s2-1) disable dead ignore inactive)) (!= s2-1 obj) (!= s2-1 *target*) (base-turret-method-46 obj s2-1) @@ -2442,7 +2442,7 @@ This commonly includes things such as: (('change-mode) (case (-> event param 0) (('grab) - (when (not (logtest? (-> self focus-status) (focus-status dead))) + (when (not (focus-test? self dead)) (if (-> event param 1) (set! (-> self turret grabbed?) #t) ) diff --git a/test/decompiler/reference/jak2/engine/target/target-util_REF.gc b/test/decompiler/reference/jak2/engine/target/target-util_REF.gc index 5356caa293..8afd333a01 100644 --- a/test/decompiler/reference/jak2/engine/target/target-util_REF.gc +++ b/test/decompiler/reference/jak2/engine/target/target-util_REF.gc @@ -422,9 +422,7 @@ ) ) ) - (if (and (logtest? (focus-status dark) (-> self focus-status)) - (and (nonzero? (-> self darkjak)) (logtest? (-> self darkjak stage) 32)) - ) + (if (and (focus-test? self dark) (and (nonzero? (-> self darkjak)) (logtest? (-> self darkjak stage) 32))) (set! f30-0 1.0) ) (set! (-> self control penetrate-using) (penetrate touch)) @@ -576,17 +574,14 @@ (-> *TARGET-bank* punch-offset) (-> *TARGET-bank* punch-radius) ) - (when (not (logtest? (focus-status indax) (-> self focus-status))) + (when (not (focus-test? self indax)) (set! (-> s5-0 prim-core collide-as) (-> self control default-collide-as-fgnd)) (set! (-> s5-0 prim-core collide-with) (-> self control default-collide-with-fgnd)) (sphere<-vector+r! (the-as sphere (-> s5-0 local-sphere)) *null-vector* (-> *TARGET-bank* punch-radius)) (set! (-> s5-0 transform-index) 21) ) (set! (-> self control penetrate-using) (penetrate touch punch)) - (if (and (logtest? (focus-status dark) (-> self focus-status)) - (nonzero? (-> self darkjak)) - (logtest? (-> self darkjak stage) 2) - ) + (if (and (focus-test? self dark) (nonzero? (-> self darkjak)) (logtest? (-> self darkjak stage) 2)) (set! (-> self control penetrate-using) (logior (penetrate dark-punch) (-> self control penetrate-using))) ) ) @@ -730,12 +725,9 @@ (set! (-> gp-0 local-sphere w) (* (-> gp-0 local-sphere w) f30-0)) ) ) - (when (and (logtest? (focus-status dark) (-> self focus-status)) (nonzero? (-> self darkjak))) + (when (and (focus-test? self dark) (nonzero? (-> self darkjak))) (set! (-> self control penetrate-using) (logior (penetrate dark-skin) (-> self control penetrate-using))) - (when (and (logtest? (focus-status dark) (-> self focus-status)) - (nonzero? (-> self darkjak)) - (logtest? (-> self darkjak stage) 32) - ) + (when (and (focus-test? self dark) (nonzero? (-> self darkjak)) (logtest? (-> self darkjak stage) 32)) (set! (-> self control penetrate-using) (logior (penetrate dark-giant) (-> self control penetrate-using))) (let ((f0-46 (lerp-scale 1.0 (-> self darkjak-giant-interp) (-> self darkjak-interp) 0.0 1.0))) (set! (-> self control root-prim local-sphere w) (* (-> self control root-prim local-sphere w) f0-46)) @@ -774,7 +766,7 @@ (let ((gp-0 (-> self control))) (if (and (= arg0 'normal) (enabled-gun? self) - (zero? (logand (-> self control current-surface flags) (surface-flag duck))) + (not (logtest? (-> self control current-surface flags) (surface-flag duck))) ) (set! arg0 'gun) ) @@ -1091,9 +1083,7 @@ ) ) ) - (when (and (logtest? (focus-status dark) (-> self focus-status)) - (and (nonzero? (-> self darkjak)) (logtest? (-> self darkjak stage) 32)) - ) + (when (and (focus-test? self dark) (and (nonzero? (-> self darkjak)) (logtest? (-> self darkjak stage) 32))) (let ((f0-183 (lerp-scale 1.0 (-> self darkjak-giant-interp) (-> self darkjak-interp) 0.0 1.0))) (set! (-> gp-0 collision-spheres 0 local-sphere w) (* 0.5 (+ 1.0 f0-183) (-> gp-0 collision-spheres 0 local-sphere w)) @@ -1137,11 +1127,8 @@ ;; definition for method 26 of type target (defmethod get-inv-mass target ((obj target)) - (if (or (and (logtest? (focus-status dark) (-> obj focus-status)) - (nonzero? (-> obj darkjak)) - (logtest? (-> obj darkjak stage) 32) - ) - (logtest? (focus-status mech) (-> obj focus-status)) + (if (or (and (focus-test? obj dark) (nonzero? (-> obj darkjak)) (logtest? (-> obj darkjak stage) 32)) + (focus-test? obj mech) ) 0.1 1.0 @@ -1232,10 +1219,10 @@ (logtest? (-> self control status) (collide-status on-water)) ) ) - (zero? (logand (focus-status dead hit grabbed in-head edge-grab pole flut tube board mech dark indax teleporting) + (not (logtest? (focus-status dead hit grabbed in-head edge-grab pole flut tube board mech dark indax teleporting) (-> self focus-status) ) - ) + ) ) ) (not (paused?)) @@ -1246,7 +1233,7 @@ (not (-> *setting-control* user-current spooling)) (not (-> *setting-control* user-current movie)) (not (-> *setting-control* user-current hint)) - (not (logtest? (-> self focus-status) (focus-status dead hit grabbed))) + (not (focus-test? self dead hit grabbed)) (logtest? (-> self game features) (game-feature sidekick)) (case *kernel-boot-message* (('kiosk) @@ -1374,7 +1361,7 @@ (and (< 0.7 (-> self control touch-angle)) (and (< (-> self control surface-angle) 0.3) (logtest? (-> self control status) (collide-status touch-wall)) - (or arg0 (zero? (logand (-> self control status) (collide-status touch-actor)))) + (or arg0 (not (logtest? (-> self control status) (collide-status touch-actor)))) ) ) ) @@ -1387,7 +1374,7 @@ ) (< (-> self control local-slope-z) 0.7) (not (logtest? (-> self state-flags) (state-flags prevent-attack prevent-duck))) - (not (and (logtest? (focus-status dark) (-> self focus-status)) (nonzero? (-> self darkjak)))) + (not (and (focus-test? self dark) (nonzero? (-> self darkjak)))) (>= (- (-> self clock frame-counter) (the-as int (-> *TARGET-bank* roll-timeout))) (-> self control last-roll-end-time) ) @@ -2060,7 +2047,7 @@ (cond ((and (logtest? (water-flags touch-water) a1-2) (logtest? (water-flags under-water swimming) a1-2) - (zero? (logand (focus-status mech) (-> obj focus-status))) + (not (logtest? (focus-status mech) (-> obj focus-status))) ) (set! v0-0 (new 'static 'vector :w 1.0)) (set! (-> v0-0 quad) (-> obj control trans quad)) @@ -2093,7 +2080,7 @@ ((= arg0 6) (let ((f0-4 (vector-dot (-> v1-0 dynam gravity-normal) (-> v1-0 transv)))) (cond - ((and (< 0.0 f0-4) (logtest? (-> obj focus-status) (focus-status in-air))) + ((and (< 0.0 f0-4) (focus-test? obj in-air)) (let* ((v0-1 (new 'static 'vector)) (f0-5 (+ (* 0.0016666667 (-> v1-0 dynam gravity-length)) f0-4)) (f0-8 (/ (* 0.5 f0-5 f0-5) (-> v1-0 dynam gravity-length))) @@ -2126,14 +2113,14 @@ (cond ((zero? arg0) (let ((f0-1 (vector-dot (-> v1-0 dynam gravity-normal) (-> v1-0 transv)))) - (if (and (< 0.0 f0-1) (logtest? (-> obj focus-status) (focus-status in-air))) + (if (and (< 0.0 f0-1) (focus-test? obj in-air)) (time-to-apex f0-1 (- (-> v1-0 dynam gravity-length))) 0 ) ) ) ((= arg0 1) - (if (logtest? (-> obj focus-status) (focus-status in-air)) + (if (focus-test? obj in-air) (the-as int (target-time-to-ground)) 0 ) diff --git a/test/decompiler/reference/jak2/engine/target/target2_REF.gc b/test/decompiler/reference/jak2/engine/target/target2_REF.gc index 0b46d706d9..60fe182ef1 100644 --- a/test/decompiler/reference/jak2/engine/target/target2_REF.gc +++ b/test/decompiler/reference/jak2/engine/target/target2_REF.gc @@ -231,7 +231,7 @@ (let ((v1-4 event-type)) (cond ((= v1-4 'end-mode) - (if (not (logtest? (-> self focus-status) (focus-status dead))) + (if (not (focus-test? self dead)) (go target-stance-look-around) ) ) @@ -317,68 +317,66 @@ ;; failed to figure out what this is: (defstate target-grab (target) :event (behavior ((proc process) (arg1 int) (event-type symbol) (event event-message-block)) - (the-as - object - (cond - ((and (= event-type 'query) (= (-> event param 0) 'mode)) - (-> self state name) - ) - (else - (case event-type - (('end-mode) - (go target-stance) - ) - (('play-anim) - (go target-grab (the-as symbol (-> event param 0))) - ) - (('clone-anim) - (go target-clone-anim (process->handle (the-as process (-> event param 0)))) - ) - (('change-mode) - (case (-> event param 0) - (('normal) - (cond - ((and (logtest? (focus-status dark) (-> self focus-status)) (nonzero? (-> self darkjak))) - (the-as object (target-darkjak-end-mode)) - ) - ((using-gun? self) - (target-gun-end-mode #t) - ) - ) - ) - (('gun) - (cond - ((using-gun? self) - (send-event self 'gun-type (-> event param 2)) - ) - ((want-to-gun? self #t) - (if (logtest? (-> self game features) (game-feature gun)) - (the-as object (target-gun-init (the-as int (-> event param 2)))) + (the-as object (cond + ((and (= event-type 'query) (= (-> event param 0) 'mode)) + (-> self state name) + ) + (else + (case event-type + (('end-mode) + (go target-stance) + ) + (('play-anim) + (go target-grab (the-as symbol (-> event param 0))) + ) + (('clone-anim) + (go target-clone-anim (process->handle (the-as process (-> event param 0)))) + ) + (('change-mode) + (case (-> event param 0) + (('normal) + (cond + ((and (focus-test? self dark) (nonzero? (-> self darkjak))) + (the-as object (target-darkjak-end-mode)) + ) + ((using-gun? self) + (target-gun-end-mode #t) + ) + ) + ) + (('gun) + (cond + ((using-gun? self) + (send-event self 'gun-type (-> event param 2)) + ) + ((want-to-gun? self #t) + (if (logtest? (-> self game features) (game-feature gun)) + (the-as object (target-gun-init (the-as int (-> event param 2)))) + ) + ) + ) + ) + (('demo) + (go target-demo #f) + ) + (('title) + (go target-title #f) + ) + ) + ) + (('anim) + (let ((v0-0 (the-as object (-> event param 0)))) + (set! (-> self control unknown-word04) (the-as uint v0-0)) + v0-0 + ) + ) + (else + (target-generic-event-handler proc arg1 event-type event) + ) + ) ) - ) - ) - ) - (('demo) - (go target-demo #f) - ) - (('title) - (go target-title #f) - ) - ) - ) - (('anim) - (let ((v0-0 (the-as object (-> event param 0)))) - (set! (-> self control unknown-word04) (the-as uint v0-0)) - v0-0 - ) - ) - (else - (target-generic-event-handler proc arg1 event-type event) - ) + ) ) - ) - ) - ) ) :enter (behavior ((arg0 symbol)) (set! (-> self control mod-surface) *grab-mods*) @@ -825,7 +823,7 @@ ) ) (set! (-> self control unknown-handle000) (the-as handle #f)) - (when (logtest? (-> self focus-status) (focus-status edge-grab)) + (when (focus-test? self edge-grab) (logclear! (-> self focus-status) (focus-status edge-grab)) (logclear! (-> self control root-prim prim-core action) (collide-action dont-push-away)) (send-event *camera* 'damp-up) @@ -845,7 +843,7 @@ ) (pad-buttons x) ) - (zero? (logand (-> self state-flags) (state-flags prevent-jump))) + (not (logtest? (-> self state-flags) (state-flags prevent-jump))) ) (cond ((or (< -0.2 (local-pad-angle)) (= (-> *cpad-list* cpads (-> self control cpad number) stick0-speed) 0.0)) diff --git a/test/decompiler/reference/jak2/engine/target/target_REF.gc b/test/decompiler/reference/jak2/engine/target/target_REF.gc index c175500dcd..2b3cf43b8b 100644 --- a/test/decompiler/reference/jak2/engine/target/target_REF.gc +++ b/test/decompiler/reference/jak2/engine/target/target_REF.gc @@ -575,10 +575,7 @@ ;; definition for function init-var-jump ;; INFO: Used lq/sq (defbehavior init-var-jump target ((arg0 float) (arg1 float) (arg2 symbol) (arg3 symbol) (arg4 vector) (arg5 float)) - (when (and (logtest? (focus-status dark) (-> self focus-status)) - (nonzero? (-> self darkjak)) - (logtest? (-> self darkjak stage) 32) - ) + (when (and (focus-test? self dark) (nonzero? (-> self darkjak)) (logtest? (-> self darkjak stage) 32)) (set! arg0 (* arg0 (-> self darkjak-giant-interp))) (set! arg1 (* arg1 (-> self darkjak-giant-interp))) ) @@ -705,22 +702,17 @@ ) ) 0 - (when (and arg1 (ja-group) (and (-> (ja-group) extra) - (not (and (logtest? (focus-status dark) (-> self focus-status)) - (nonzero? (-> self darkjak)) - (logtest? (-> self darkjak stage) 32) - ) - ) - #t - ) + (when (and arg1 + (ja-group) + (and (-> (ja-group) extra) + (not (and (focus-test? self dark) (nonzero? (-> self darkjak)) (logtest? (-> self darkjak stage) 32))) + #t + ) ) (let ((v1-62 (res-lump-struct (-> (ja-group) extra) 'collide-offset vector :time (ja-aframe-num 0)))) (cond (v1-62 - (if (and (logtest? (focus-status dark) (-> self focus-status)) - (nonzero? (-> self darkjak)) - (logtest? (-> self darkjak stage) 32) - ) + (if (and (focus-test? self dark) (nonzero? (-> self darkjak)) (logtest? (-> self darkjak stage) 32)) (set! (-> v1-62 y) (* 0.5 (-> v1-62 y))) ) (set! v0-1 (-> self control anim-collide-offset-local)) @@ -771,13 +763,10 @@ (surface-clamp-speed arg0 arg1 arg2 arg3) (when (= arg3 1) (cond - ((and (logtest? (focus-status dark) (-> self focus-status)) - (nonzero? (-> self darkjak)) - (logtest? (-> self darkjak stage) 32) - ) + ((and (focus-test? self dark) (nonzero? (-> self darkjak)) (logtest? (-> self darkjak stage) 32)) (set! (-> arg0 target-speed) 81920.0) ) - ((and (logtest? (focus-status dark) (-> self focus-status)) (nonzero? (-> self darkjak))) + ((and (focus-test? self dark) (nonzero? (-> self darkjak))) (set! (-> arg0 target-speed) 40960.0) ) (else @@ -864,7 +853,7 @@ (can-hands? #t) (can-exit-duck? self) (not (logtest? (-> self control current-surface flags) (surface-flag no-jump))) - (zero? (logand (-> self state-flags) (state-flags prevent-jump))) + (not (logtest? (-> self state-flags) (state-flags prevent-jump))) ) (go target-attack-uppercut @@ -929,7 +918,7 @@ ) (ja-channel-push! 1 (seconds 0.1)) ) - ((and (logtest? (focus-status dark) (-> self focus-status)) (nonzero? (-> self darkjak))) + ((and (focus-test? self dark) (nonzero? (-> self darkjak))) (ja-channel-push! 1 (seconds 0.1)) ) (else @@ -1021,7 +1010,7 @@ (can-hands? #t) (can-exit-duck? self) (not (logtest? (-> self control current-surface flags) (surface-flag no-jump))) - (zero? (logand (-> self state-flags) (state-flags prevent-jump))) + (not (logtest? (-> self state-flags) (state-flags prevent-jump))) ) (go target-attack-uppercut @@ -1168,7 +1157,7 @@ ) (and (< -61440.0 (vector-dot (-> self control dynam gravity-normal) (-> self control transv))) (not (logtest? (water-flags touch-water) (-> self water flags))) - (zero? (logand (state-flags prevent-jump prevent-double-jump) (-> self state-flags))) + (not (logtest? (state-flags prevent-jump prevent-double-jump) (-> self state-flags))) ) ) (go target-double-jump (-> *TARGET-bank* double-jump-height-min) (-> *TARGET-bank* double-jump-height-max)) @@ -1260,7 +1249,7 @@ ) ) ) - ((and (logtest? (focus-status dark) (-> self focus-status)) (nonzero? (-> self darkjak))) + ((and (focus-test? self dark) (nonzero? (-> self darkjak))) (ja-channel-push! 1 (seconds 0.05)) (ja :group! (-> self draw art-group data 394) :num! min) (suspend) @@ -1495,7 +1484,7 @@ ) ) (cond - ((and (logtest? (focus-status dark) (-> self focus-status)) (nonzero? (-> self darkjak))) + ((and (focus-test? self dark) (nonzero? (-> self darkjak))) (ja-channel-push! 1 (seconds 0.05)) (ja-no-eval :group! (-> self draw art-group data 394) :num! (seek! (the float (+ (-> (the-as art-joint-anim (-> self draw art-group data 394)) frames num-frames) -1))) @@ -1889,7 +1878,7 @@ :enter (behavior ((arg0 symbol)) (set! (-> self control turn-go-the-long-way) 0.0) (cond - ((or (= arg0 'stuck) (logtest? (focus-status indax) (-> self focus-status))) + ((or (= arg0 'stuck) (focus-test? self indax)) ) (else (let ((f0-2 @@ -1899,7 +1888,7 @@ ) ) ) - (if (and (< (-> *TARGET-bank* fall-far) f0-2) (zero? (logand (-> self control status) (collide-status on-water)))) + (if (and (< (-> *TARGET-bank* fall-far) f0-2) (not (logtest? (-> self control status) (collide-status on-water)))) (go target-hit-ground-hard f0-2) ) ) @@ -1927,16 +1916,13 @@ 600 1500 ) - (if (and (logtest? (focus-status dark) (-> self focus-status)) - (nonzero? (-> self darkjak)) - (logtest? (-> self darkjak stage) 32) - ) + (if (and (focus-test? self dark) (nonzero? (-> self darkjak)) (logtest? (-> self darkjak stage) 32)) (activate! *camera-smush-control* 1638.4 15 75 1.0 0.9 (-> *display* camera-clock)) ) (when (and (using-gun? self) (let ((v1-44 (-> self water flags))) (not (and (logtest? (water-flags touch-water) v1-44) (logtest? (water-flags under-water swimming) v1-44) - (zero? (logand (focus-status mech) (-> self focus-status))) + (not (logtest? (focus-status mech) (-> self focus-status))) ) ) ) @@ -2188,7 +2174,7 @@ :code (behavior () (let ((gp-0 (-> self draw art-group data 40))) (cond - ((and (logtest? (focus-status dark) (-> self focus-status)) (nonzero? (-> self darkjak))) + ((and (focus-test? self dark) (nonzero? (-> self darkjak))) (set! gp-0 (-> self draw art-group data 399)) (quaternion-rotate-y! (-> self control quat-for-control) (-> self control quat-for-control) -1365.3334) ) @@ -2278,7 +2264,7 @@ (ja :num! (seek! max (-> self control current-surface align-speed))) ) (cond - ((and (logtest? (focus-status dark) (-> self focus-status)) (nonzero? (-> self darkjak))) + ((and (focus-test? self dark) (nonzero? (-> self darkjak))) (quaternion-rotate-y! (-> self control quat-for-control) (-> self control quat-for-control) -12743.111) ) ((using-gun? self) @@ -2446,7 +2432,7 @@ ) ) :enter (behavior () - (if (and (and (logtest? (focus-status dark) (-> self focus-status)) (nonzero? (-> self darkjak))) + (if (and (and (focus-test? self dark) (nonzero? (-> self darkjak))) (and (-> self next-state) (= (-> self next-state name) 'target-running-attack)) ) (go target-darkjak-running-attack) @@ -2497,7 +2483,7 @@ (when (!= (-> self state-time) (-> self clock frame-counter)) (when (and (or (smack-surface? #t) (and (>= (-> self control surface-slope-z) 0.7) - (zero? (logand (-> self control status) (collide-status touch-actor))) + (not (logtest? (-> self control status) (collide-status touch-actor))) ) ) (begin @@ -2530,14 +2516,14 @@ (if (and (cpad-pressed? (-> self control cpad number) x) (< 4096.0 (-> self control ctrl-xz-vel)) (or (>= (- (-> self clock frame-counter) (-> self state-time)) (seconds 0.1)) - (zero? (logand (-> *cpad-list* cpads (-> self control cpad number) button0-abs 0) (pad-buttons square))) + (not (logtest? (-> *cpad-list* cpads (-> self control cpad number) button0-abs 0) (pad-buttons square))) ) (not (logtest? (-> self state-flags) (state-flags prevent-jump prevent-attack))) (not (logtest? (-> self control current-surface flags) (surface-flag no-attack))) (let ((v1-48 (ja-group))) (and (not (and v1-48 (= v1-48 (-> self draw art-group data 406)))) (and (not (logtest? (-> self control current-surface flags) (surface-flag no-jump))) - (zero? (logand (-> self state-flags) (state-flags prevent-jump))) + (not (logtest? (-> self state-flags) (state-flags prevent-jump))) ) ) ) @@ -3172,10 +3158,7 @@ ) ) ) - ((and (logtest? (focus-status dark) (-> self focus-status)) - (nonzero? (-> self darkjak)) - (logtest? (-> self darkjak stage) 8) - ) + ((and (focus-test? self dark) (nonzero? (-> self darkjak)) (logtest? (-> self darkjak stage) 8)) (set! (-> self control unknown-sound-id00) (add-process *gui-control* self (gui-channel jak) (gui-action queue) "darkbom1" -99.0 0) ) @@ -3431,10 +3414,7 @@ ) (go target-yellow-jump-blast) ) - ((and (logtest? (focus-status dark) (-> self focus-status)) - (nonzero? (-> self darkjak)) - (logtest? (-> self darkjak stage) 4) - ) + ((and (focus-test? self dark) (nonzero? (-> self darkjak)) (logtest? (-> self darkjak stage) 4)) (go target-darkjak-bomb0) ) ) @@ -3507,10 +3487,7 @@ (when (or (and (= (-> (the-as fact-info-target (-> self fact-override)) eco-type) 2) (>= (-> (the-as fact-info-target (-> self fact-override)) eco-level) 1.0) ) - (and (logtest? (focus-status dark) (-> self focus-status)) - (nonzero? (-> self darkjak)) - (logtest? (-> self darkjak stage) 2) - ) + (and (focus-test? self dark) (nonzero? (-> self darkjak)) (logtest? (-> self darkjak stage) 2)) ) (cpad-set-buzz! (-> *cpad-list* cpads 0) 1 255 (seconds 0.5)) (if (and (= (-> (the-as fact-info-target (-> self fact-override)) eco-type) 2) diff --git a/test/decompiler/reference/jak2/engine/ui/minimap_REF.gc b/test/decompiler/reference/jak2/engine/ui/minimap_REF.gc index bd9ec18727..92793264a3 100644 --- a/test/decompiler/reference/jak2/engine/ui/minimap_REF.gc +++ b/test/decompiler/reference/jak2/engine/ui/minimap_REF.gc @@ -1199,7 +1199,7 @@ (seek! (-> s3-0 alpha) 0.0 (-> pp clock seconds-per-frame)) ) ((and (logtest? (-> s3-0 flags) (minimap-flag task-graph)) - (zero? (logand (-> *setting-control* user-current minimap) 32)) + (not (logtest? (-> *setting-control* user-current minimap) 32)) ) (logior! (-> s3-0 flags) (minimap-flag fade-in)) (seek! (-> s3-0 alpha) 0.0 (-> pp clock seconds-per-frame)) @@ -1392,7 +1392,7 @@ ) ) (cond - ((and *target* (logtest? (focus-status board pilot) (-> *target* focus-status))) + ((and *target* (focus-test? *target* board pilot)) (let ((f0-14 0.5) (f1-2 0.000008138021) (f2-0 122880.0) @@ -2065,7 +2065,7 @@ (&+! (-> s5-0 base) 176) (let ((f0-57 1.0)) (when *target* - (if (logtest? (focus-status pilot) (-> *target* focus-status)) + (if (focus-test? *target* pilot) (set! f0-57 0.0) ) ) @@ -2890,7 +2890,3 @@ 0 (none) ) - - - - diff --git a/test/decompiler/reference/jak2/engine/ui/progress/progress-draw_REF.gc b/test/decompiler/reference/jak2/engine/ui/progress/progress-draw_REF.gc index ae15929f20..521bfa7baf 100644 --- a/test/decompiler/reference/jak2/engine/ui/progress/progress-draw_REF.gc +++ b/test/decompiler/reference/jak2/engine/ui/progress/progress-draw_REF.gc @@ -4821,7 +4821,7 @@ (set! (-> arg1 selected-option) #f) (logclear! (-> *game-info* secrets) (-> arg0 flag)) ) - ((and (= (-> arg0 can-toggle) #t) (zero? (logand (-> *game-info* secrets) (-> arg0 flag)))) + ((and (= (-> arg0 can-toggle) #t) (not (logtest? (-> *game-info* secrets) (-> arg0 flag)))) (logior! (-> *game-info* secrets) (-> arg0 flag)) (set! (-> arg1 selected-option) #f) ) @@ -4864,7 +4864,7 @@ (the-as pointer (cond - ((and (not s4-0) (zero? (logand (-> *game-info* purchase-secrets) (-> arg0 flag)))) + ((and (not s4-0) (not (logtest? (-> *game-info* purchase-secrets) (-> arg0 flag)))) (+! (-> arg2 origin x) (the float (if (= (get-aspect-ratio) 'aspect4x3) 50 45 @@ -4888,7 +4888,7 @@ (s5-2 *temp-string* arg2 #f 44 (bucket-id progress)) ) ) - ((and (not s4-0) (= (-> arg0 can-toggle) #t) (zero? (logand (-> *game-info* secrets) (-> arg0 flag)))) + ((and (not s4-0) (= (-> arg0 can-toggle) #t) (not (logtest? (-> *game-info* secrets) (-> arg0 flag)))) (+! (-> arg2 origin x) (the float (if (= (get-aspect-ratio) 'aspect4x3) 50 45 diff --git a/test/decompiler/reference/jak2/engine/ui/progress/progress_REF.gc b/test/decompiler/reference/jak2/engine/ui/progress/progress_REF.gc index e5c0266df9..2515f588fa 100644 --- a/test/decompiler/reference/jak2/engine/ui/progress/progress_REF.gc +++ b/test/decompiler/reference/jak2/engine/ui/progress/progress_REF.gc @@ -2556,12 +2556,12 @@ 'select-save (cond ((and (= (-> *progress-state* starting-state) 'main) - (zero? (logand (-> *game-info* purchase-secrets) (game-secrets hero-mode))) + (not (logtest? (-> *game-info* purchase-secrets) (game-secrets hero-mode))) ) (set! a1-9 'select-save) ) ((and (= (-> *progress-state* starting-state) 'title) - (zero? (logand (-> *game-info* purchase-secrets) (game-secrets hero-mode))) + (not (logtest? (-> *game-info* purchase-secrets) (game-secrets hero-mode))) ) (set! a1-9 'select-save-title) ) diff --git a/test/decompiler/reference/jak2/levels/atoll/sig0-course_REF.gc b/test/decompiler/reference/jak2/levels/atoll/sig0-course_REF.gc index ca2ffb7921..0520d495a2 100644 --- a/test/decompiler/reference/jak2/levels/atoll/sig0-course_REF.gc +++ b/test/decompiler/reference/jak2/levels/atoll/sig0-course_REF.gc @@ -102,7 +102,7 @@ (defmethod sig-atoll-method-259 sig-atoll ((obj sig-atoll)) (let ((v1-0 *target*)) (the-as symbol (and v1-0 - (not (logtest? (-> v1-0 focus-status) (focus-status edge-grab))) + (not (focus-test? v1-0 edge-grab)) (>= (- (-> v1-0 control trans y) (-> obj sig-course spots 11 center y)) -819.2) ) ) @@ -936,7 +936,7 @@ (when (or (not (logtest? (-> arg0 waypoint-bits) 8)) (>= (- (-> pp clock frame-counter) (-> arg0 waypoint-time0)) (seconds 8)) ) - (if (and (demo?) (zero? (logand (-> arg0 waypoint-bits) 8))) + (if (and (demo?) (not (logtest? (-> arg0 waypoint-bits) 8))) (logior! (-> arg0 waypoint-bits) 16) ) (logior! (-> arg0 waypoint-bits) 8) @@ -1118,7 +1118,7 @@ a1-2 ) (not (channel-active? arg1 (the-as uint 0))) - (not (logtest? (-> s5-0 focus-status) (focus-status edge-grab))) + (not (focus-test? s5-0 edge-grab)) (>= (- (-> s5-0 control trans y) (-> arg1 root-override2 trans y)) -4096.0) ) ) diff --git a/test/decompiler/reference/jak2/levels/city/common/citizen-enemy_REF.gc b/test/decompiler/reference/jak2/levels/city/common/citizen-enemy_REF.gc index cc22f76fd2..6cbe3502d9 100644 --- a/test/decompiler/reference/jak2/levels/city/common/citizen-enemy_REF.gc +++ b/test/decompiler/reference/jak2/levels/city/common/citizen-enemy_REF.gc @@ -44,7 +44,7 @@ (set! (-> a1-0 tlist) *touching-list*) (find-overlapping-shapes (-> obj root-override2) a1-0) ) - (when (and (not (logtest? (-> obj focus-status) (focus-status disable dead ignore inactive))) + (when (and (not (focus-test? obj disable dead ignore inactive)) (< (-> obj next-update-target) (-> pp clock frame-counter)) (not (logtest? (enemy-flag actor-pause-backup) (-> obj enemy-flags))) (-> obj next-state) @@ -81,10 +81,10 @@ ) ) (cond - ((and (logtest? (-> obj focus-status) (focus-status dangerous)) + ((and (focus-test? obj dangerous) (logtest? (process-mask guard civilian) (-> arg0 mask)) (and v1-6 - (zero? (logand (-> (the-as process-focusable v1-6) focus-status) (focus-status disable dead ignore grabbed))) + (not (logtest? (-> (the-as process-focusable v1-6) focus-status) (focus-status disable dead ignore grabbed))) ) ((method-of-type touching-shapes-entry prims-touching-action?) (the-as touching-shapes-entry s3-0) @@ -206,13 +206,13 @@ ) (when (and s1-1 (!= obj s1-1) - (not (logtest? (-> (the-as process-focusable s1-1) focus-status) (focus-status inactive))) - (not (logtest? (-> (the-as process-focusable s1-1) focus-status) (focus-status disable))) + (not (focus-test? (the-as process-focusable s1-1) inactive)) + (not (focus-test? (the-as process-focusable s1-1) disable)) (not (logtest? (process-mask enemy) (-> s1-1 mask))) (not (logtest? (process-mask crate) (-> s1-1 mask))) (not (logtest? (process-mask vehicle) (-> s1-1 mask))) s1-1 - (zero? (logand (-> (the-as process-focusable s1-1) focus-status) (focus-status disable dead ignore grabbed))) + (not (logtest? (-> (the-as process-focusable s1-1) focus-status) (focus-status disable dead ignore grabbed))) ) (let ((f0-1 (vector-vector-xz-distance (-> obj root-override2 trans) (-> s1-1 root trans)))) (when (or (not s4-0) (< f0-1 f30-0)) @@ -351,7 +351,3 @@ (go (method-of-object obj active)) (none) ) - - - - diff --git a/test/decompiler/reference/jak2/levels/city/common/citizen_REF.gc b/test/decompiler/reference/jak2/levels/city/common/citizen_REF.gc index 7646647a4b..8a7a327edf 100644 --- a/test/decompiler/reference/jak2/levels/city/common/citizen_REF.gc +++ b/test/decompiler/reference/jak2/levels/city/common/citizen_REF.gc @@ -380,7 +380,7 @@ (set! (-> obj root-override2 transv x) 0.0) (set! (-> obj root-override2 transv z) 0.0) (when (-> obj enemy-info-override move-to-ground) - (if (logtest? (-> obj focus-status) (focus-status under-water)) + (if (focus-test? obj under-water) (enemy-method-47 obj (-> obj root-override2 transv)) (+! (-> obj root-override2 transv y) (* (-> obj enemy-info-override movement-gravity) (-> pp clock seconds-per-frame)) @@ -483,7 +483,7 @@ ) (when (logtest? (enemy-flag trackable-backup directed-ready) (-> obj enemy-flags)) (enemy-method-54 obj) - (when (and (logtest? (-> obj focus-status) (focus-status touch-water)) + (when (and (focus-test? obj touch-water) (< (-> obj root-override2 trans y) (+ -11468.8 (-> obj water-surface-height))) ) (set! (-> obj root-override2 trans y) (+ -11468.8 (-> obj water-surface-height))) @@ -1407,7 +1407,7 @@ This commonly includes things such as: (if (= (-> self water-anim) -1) (go-inactive self) ) - (when (logtest? (-> self focus-status) (focus-status touch-water)) + (when (focus-test? self touch-water) (let ((a1-3 (new 'stack-no-clear 'vector))) (set! (-> a1-3 quad) (-> self root-override2 trans quad)) (set! (-> a1-3 y) (+ 40.96 (-> self water-surface-height))) @@ -1424,7 +1424,7 @@ This commonly includes things such as: :code (behavior () (ja-channel-push! 1 (seconds 0.2)) (cond - ((logtest? (-> self focus-status) (focus-status touch-water)) + ((focus-test? self touch-water) (until #f (ja-no-eval :group! (-> self draw art-group data (-> self water-anim)) :num! (seek! diff --git a/test/decompiler/reference/jak2/levels/city/common/civilian_REF.gc b/test/decompiler/reference/jak2/levels/city/common/civilian_REF.gc index 1709c999fb..e4641b74fa 100644 --- a/test/decompiler/reference/jak2/levels/city/common/civilian_REF.gc +++ b/test/decompiler/reference/jak2/levels/city/common/civilian_REF.gc @@ -1572,7 +1572,7 @@ (set! (-> self enemy-flags) (logior (enemy-flag directed) (-> self enemy-flags))) (let ((gp-0 (-> self root-override2))) (cond - ((logtest? (-> self focus-status) (focus-status under-water)) + ((focus-test? self under-water) (enemy-method-47 self (-> gp-0 transv)) ) (else diff --git a/test/decompiler/reference/jak2/levels/city/common/ctywide-obs_REF.gc b/test/decompiler/reference/jak2/levels/city/common/ctywide-obs_REF.gc index 4c30ed8d9b..7c219f0d0a 100644 --- a/test/decompiler/reference/jak2/levels/city/common/ctywide-obs_REF.gc +++ b/test/decompiler/reference/jak2/levels/city/common/ctywide-obs_REF.gc @@ -397,7 +397,7 @@ ) (+! (-> self touch-count) 1) (if (and (logtest? (-> proc mask) (process-mask target)) - (zero? (logand (process-mask projectile) (-> proc mask))) + (not (logtest? (process-mask projectile) (-> proc mask))) ) (the-as int (security-wall-method-23 self)) ) @@ -1607,7 +1607,7 @@ This commonly includes things such as: (go-virtual hostile) ) (else - (if (and (logtest? (focus-status pilot) (-> (the-as process-focusable gp-2) focus-status)) + (if (and (focus-test? (the-as process-focusable gp-2) pilot) (>= (the-as uint (get-alert-level *traffic-engine*)) (the-as uint 1)) ) (go-virtual hostile) @@ -2083,7 +2083,7 @@ This commonly includes things such as: (set! (-> s4-1 x) (deg- (-> s2-0 x) (-> s0-1 x))) (set! (-> s4-1 y) (deg- (-> s2-0 y) (-> s0-1 y))) (cond - ((logtest? (focus-status pilot) (-> (the-as process-focusable s5-0) focus-status)) + ((focus-test? (the-as process-focusable s5-0) pilot) (set! (-> obj angle-turret) (deg-seek (-> obj angle-turret) (-> s4-1 y) (* 36408.89 (-> pp clock seconds-per-frame))) ) @@ -2187,7 +2187,7 @@ This commonly includes things such as: ((and (>= (-> self id) 0) (task-node-open? (game-task-node city-power-resolution))) ) (else - (if (and (not (logtest? (focus-status pilot) (-> (the-as process-focusable gp-0) focus-status))) + (if (and (not (focus-test? (the-as process-focusable gp-0) pilot)) *traffic-engine* (zero? (get-alert-level *traffic-engine*)) ) @@ -2488,7 +2488,7 @@ This commonly includes things such as: (cond (s5-0 (cond - ((or (logtest? (-> (the-as vehicle s5-0) focus-status) (focus-status dead inactive)) + ((or (focus-test? (the-as vehicle s5-0) dead inactive) (not (logtest? (-> (the-as vehicle s5-0) flags) (rigid-body-object-flag waiting-for-player))) (let ((f0-0 (-> obj test-sphere r))) (< (* f0-0 f0-0) @@ -3049,12 +3049,12 @@ This commonly includes things such as: ) (when (and s1-1 (!= obj s1-1) - (not (logtest? (-> s1-1 focus-status) (focus-status inactive))) - (not (logtest? (-> s1-1 focus-status) (focus-status disable))) - (not (logtest? (-> s1-1 focus-status) (focus-status dead))) + (not (focus-test? s1-1 inactive)) + (not (focus-test? s1-1 disable)) + (not (focus-test? s1-1 dead)) (not (logtest? (process-mask guard) (-> s1-1 mask))) (not (logtest? (process-mask crate) (-> s1-1 mask))) - (zero? (logand (process-mask vehicle) (-> s1-1 mask))) + (not (logtest? (process-mask vehicle) (-> s1-1 mask))) ) (let ((f0-0 (vector-vector-xz-distance (-> obj root-override trans) (-> s1-1 root-override trans)))) (when (or (not s5-0) (< f0-0 f30-0)) @@ -4084,7 +4084,7 @@ This commonly includes things such as: (f0-2 (vector-dot (vector-z-quaternion! (new 'stack-no-clear 'vector) (-> obj root-override quat)) gp-1)) ) (and *target* - (not (logtest? (focus-status pilot) (-> *target* focus-status))) + (not (focus-test? *target* pilot)) (< (fabs f30-0) 10240.0) (< 0.0 f0-2) (< (fabs f0-2) 20480.0) diff --git a/test/decompiler/reference/jak2/levels/city/common/ctywide-tasks_REF.gc b/test/decompiler/reference/jak2/levels/city/common/ctywide-tasks_REF.gc index 5b994c0a7d..025c634499 100644 --- a/test/decompiler/reference/jak2/levels/city/common/ctywide-tasks_REF.gc +++ b/test/decompiler/reference/jak2/levels/city/common/ctywide-tasks_REF.gc @@ -198,7 +198,7 @@ (suspend) ) ) - (while (or (not *target*) (logtest? (focus-status dead teleporting) (-> *target* focus-status))) + (while (or (not *target*) (focus-test? *target* dead teleporting)) (suspend) ) (set! (-> self sound-id 0) @@ -220,9 +220,7 @@ (function object) (lambda :behavior task-manager () - (when (and (= (-> self sub-state) 1) - (not (and *target* (logtest? (focus-status pilot) (-> *target* focus-status)))) - ) + (when (and (= (-> self sub-state) 1) (not (and *target* (focus-test? *target* pilot)))) (set! (-> self sound-id 0) (the-as sound-id (talker-spawn-func (-> *talker-speech* 46) *entity-pool* (target-pos 0) (the-as region #f))) ) @@ -245,11 +243,11 @@ (local-vars (v1-1 object)) (until v1-1 (suspend) - (set! v1-1 (and *target* (logtest? (focus-status pilot) (-> *target* focus-status)))) + (set! v1-1 (and *target* (focus-test? *target* pilot))) ) (set! (-> self slave 0) (-> *target* pilot vehicle)) (set! (-> self sub-state) (the-as uint 1)) - (while (or (not *target*) (logtest? (focus-status dead teleporting) (-> *target* focus-status))) + (while (or (not *target*) (focus-test? *target* dead teleporting)) (suspend) ) (set! (-> self sound-id 0) @@ -261,7 +259,7 @@ (suspend) ) ) - (while (or (not *target*) (logtest? (focus-status dead teleporting) (-> *target* focus-status))) + (while (or (not *target*) (focus-test? *target* dead teleporting)) (suspend) ) (set! (-> self sound-id 0) @@ -273,19 +271,19 @@ (suspend) ) ) - (while (or (not *target*) (logtest? (focus-status dead teleporting) (-> *target* focus-status))) + (while (or (not *target*) (focus-test? *target* dead teleporting)) (suspend) ) (set! (-> self sound-id 0) (the-as sound-id (talker-spawn-func (-> *talker-speech* 36) *entity-pool* (target-pos 0) (the-as region #f))) ) (while (let ((v1-34 (handle->process (-> self slave 0)))) - (zero? (logand (rigid-body-object-flag flight-level-transition) (-> (the-as vehicle v1-34) flags))) + (not (logtest? (rigid-body-object-flag flight-level-transition) (-> (the-as vehicle v1-34) flags))) ) (suspend) ) (wait-for-speech-end (-> self sound-id 0)) - (while (or (not *target*) (logtest? (focus-status dead teleporting) (-> *target* focus-status))) + (while (or (not *target*) (focus-test? *target* dead teleporting)) (suspend) ) (set! (-> self sound-id 0) @@ -342,7 +340,7 @@ (cond ((zero? (-> self sub-state)) (cond - ((and *target* (logtest? (focus-status pilot) (-> *target* focus-status))) + ((and *target* (focus-test? *target* pilot)) (let ((v1-8 (handle->process (-> *target* pilot vehicle)))) (if (logtest? (rigid-body-object-flag flight-level-transition) (-> (the-as vehicle v1-8) flags)) (go-virtual complete) @@ -355,7 +353,7 @@ ) ) ((= (-> self sub-state) 1) - (if (not (and *target* (logtest? (focus-status pilot) (-> *target* focus-status)))) + (if (not (and *target* (focus-test? *target* pilot))) (go-virtual fail) ) ) @@ -391,7 +389,7 @@ (the-as sound-id (talker-spawn-func (-> *talker-speech* 36) *entity-pool* (target-pos 0) (the-as region #f))) ) (while (let ((v1-15 (handle->process (-> *target* pilot vehicle)))) - (zero? (logand (rigid-body-object-flag flight-level-transition) (-> (the-as vehicle v1-15) flags))) + (not (logtest? (rigid-body-object-flag flight-level-transition) (-> (the-as vehicle v1-15) flags))) ) (suspend) ) @@ -501,7 +499,7 @@ () (local-vars (v1-7 symbol)) (send-event *traffic-manager* 'set-target-level #x3f800000) - (until (or v1-7 (and *target* (logtest? (focus-status pilot) (-> *target* focus-status)))) + (until (or v1-7 (and *target* (focus-test? *target* pilot))) (suspend) (let ((f0-0 122880.0)) (set! v1-7 (< (* f0-0 f0-0) (vector-vector-distance-squared (-> self begin-pos) (target-pos 0)))) @@ -906,7 +904,3 @@ ) ) ) - - - - diff --git a/test/decompiler/reference/jak2/levels/city/common/guard_REF.gc b/test/decompiler/reference/jak2/levels/city/common/guard_REF.gc index 849f8cd79d..6903a9c0ee 100644 --- a/test/decompiler/reference/jak2/levels/city/common/guard_REF.gc +++ b/test/decompiler/reference/jak2/levels/city/common/guard_REF.gc @@ -731,13 +731,13 @@ ) ((= v1-0 'end-pursuit) (when *debug-segment* - (when (logtest? (-> obj focus-status) (focus-status inactive)) + (when (focus-test? obj inactive) (format 0 "guard::event end-pursuit recieved by inactive process ~d~%" (-> obj pid)) (break!) 0 ) ) - (when (not (logtest? (-> obj focus-status) (focus-status dead))) + (when (not (focus-test? obj dead)) (when (logtest? (-> obj flags) (citizen-flag hostile)) (logclear! (-> obj flags) (citizen-flag persistent in-pursuit hostile)) (citizen-method-195 obj (vector-z-quaternion! (new 'stack-no-clear 'vector) (-> obj root-override2 quat))) @@ -747,17 +747,17 @@ ) ((= v1-0 'alert-begin) (when *debug-segment* - (when (logtest? (-> obj focus-status) (focus-status inactive)) + (when (focus-test? obj inactive) (format 0 "guard::event alert-begin recieved by inactive process ~d~%" (-> obj pid)) (break!) 0 ) ) - (when (not (logtest? (-> obj focus-status) (focus-status dead))) + (when (not (focus-test? obj dead)) (when (not (logtest? (-> obj flags) (citizen-flag hostile))) (let ((a1-27 (the-as object (-> arg3 param 0)))) (when (and (the-as uint a1-27) - (zero? (logand (-> (the-as process-focusable a1-27) focus-status) (focus-status disable dead inactive))) + (not (logtest? (-> (the-as process-focusable a1-27) focus-status) (focus-status disable dead inactive))) ) (set! (-> obj traffic-target-status handle) (process->handle (the-as process-focusable a1-27))) (try-update-focus (-> obj focus) (the-as process-focusable a1-27) obj) @@ -773,13 +773,13 @@ ) ((= v1-0 'alert-end) (when *debug-segment* - (when (logtest? (-> obj focus-status) (focus-status inactive)) + (when (focus-test? obj inactive) (format 0 "guard::event alert-end recieved by inactive process ~d~%" (-> obj pid)) (break!) 0 ) ) - (when (not (logtest? (-> obj focus-status) (focus-status dead))) + (when (not (focus-test? obj dead)) (when (logtest? (-> obj flags) (citizen-flag hostile)) (logclear! (-> obj flags) (citizen-flag persistent in-pursuit hostile)) (speech-control-method-12 *speech-control* obj (speech-type speech-type-0 speech-type-2)) @@ -803,7 +803,7 @@ ) (when (= a0-84 'attack) (when (logtest? (-> (the-as process-focusable v1-130) mask) (process-mask target)) - (when (logtest? (-> (the-as process-focusable v1-130) focus-status) (focus-status dead)) + (when (focus-test? (the-as process-focusable v1-130) dead) (format #t "guard killed player~%") (the-as object (speech-control-method-12 *speech-control* obj (speech-type speech-type-1 speech-type-3))) ) @@ -1720,7 +1720,7 @@ (let ((s4-1 (handle->process (-> obj focus handle)))) (cond ((and s4-1 - (zero? (logand (-> (the-as process-focusable s4-1) focus-status) (focus-status disable dead inactive))) + (not (logtest? (-> (the-as process-focusable s4-1) focus-status) (focus-status disable dead inactive))) ) (when (logtest? (-> s5-1 flags) (traffic-target-flag updated)) (logclear! (-> obj flags) (citizen-flag target-in-sight)) @@ -2023,7 +2023,7 @@ (crimson-guard-method-220 self) (when (and (not (logtest? (-> self draw status) (draw-control-status on-screen))) (= (-> self controller traffic sync-mask-16) (ash 1 (logand (-> self traffic-id) 15))) - (zero? (logand (-> self flags) (citizen-flag sticky-weapon))) + (not (logtest? (-> self flags) (citizen-flag sticky-weapon))) ) (let ((a1-4 (get-traffic-guard-change-to-type (-> self controller traffic) (the-as int (-> self guard-type))))) (if (!= a1-4 (-> self guard-type)) @@ -2038,9 +2038,7 @@ ) ) ) - (if (or (logtest? (-> gp-0 focus-status) (focus-status inactive)) - (logtest? (-> gp-0 focus-status) (focus-status disable)) - ) + (if (or (focus-test? gp-0 inactive) (focus-test? gp-0 disable)) (set! gp-0 (the-as process-focusable #f)) ) (cond @@ -2054,18 +2052,18 @@ (speech-control-method-12 *speech-control* self (speech-type speech-type-1)) ) (when (and (logtest? (-> self nav state flags) (nav-state-flag at-target)) - (zero? (logand (-> s5-0 flags) (traffic-target-flag visible-recently))) + (not (logtest? (-> s5-0 flags) (traffic-target-flag visible-recently))) ) (logclear! (-> self flags) (citizen-flag persistent)) (citizen-method-195 self (vector-z-quaternion! (new 'stack-no-clear 'vector) (-> self root-override2 quat))) (go-virtual search) ) (when (or (logtest? (-> s5-0 flags) (traffic-target-flag visible-recently)) - (zero? (logand (-> gp-0 mask) (process-mask target))) + (not (logtest? (-> gp-0 mask) (process-mask target))) ) (speech-control-method-15 *speech-control* self) (cond - ((logtest? (focus-status arrestable) (-> gp-0 focus-status)) + ((focus-test? gp-0 arrestable) (if (and (< (-> self target-self-xz-dist) 28672.0) (< (fabs (-> self target-y-angle)) 7281.778) (>= 8192.0 (fabs (- (-> (get-trans gp-0 1) y) (-> self root-override2 trans y)))) @@ -2076,7 +2074,7 @@ (else (if (and (< (-> self target-self-xz-dist) 16384.0) (and (< (fabs (-> self target-y-angle)) 7281.778) - (and gp-0 (zero? (logand (-> gp-0 focus-status) (focus-status disable dead ignore grabbed)))) + (and gp-0 (not (logtest? (-> gp-0 focus-status) (focus-status disable dead ignore grabbed)))) (logtest? (-> self flags) (citizen-flag target-in-sight)) ) ) @@ -2317,7 +2315,7 @@ (let ((gp-0 (handle->process (-> self focus handle)))) (when gp-0 (when (not (and gp-0 - (zero? (logand (-> (the-as process-focusable gp-0) focus-status) (focus-status disable dead ignore grabbed))) + (not (logtest? (-> (the-as process-focusable gp-0) focus-status) (focus-status disable dead ignore grabbed))) ) ) (set! (-> self miss-amount) (lerp-scale 0.0 16384.0 (-> self target-self-dist) 40960.0 122880.0)) @@ -2326,7 +2324,7 @@ (if (and (< (-> self target-self-xz-dist) 16384.0) (and (< (fabs (-> self target-y-angle)) 7281.778) gp-0 - (zero? (logand (-> (the-as process-focusable gp-0) focus-status) (focus-status disable dead ignore grabbed))) + (not (logtest? (-> (the-as process-focusable gp-0) focus-status) (focus-status disable dead ignore grabbed))) ) ) (go-virtual close-attack) @@ -2391,9 +2389,7 @@ (let ((v1-58 (handle->process (-> self focus handle)))) (when v1-58 (if (or (< (-> self target-vel) 40.96) - (and (logtest? (focus-status pilot) (-> (the-as process-focusable v1-58) focus-status)) - (< (-> self target-pos y) 49152.0) - ) + (and (focus-test? (the-as process-focusable v1-58) pilot) (< (-> self target-pos y) 49152.0)) ) (set! (-> self miss-amount) (- (-> self miss-amount) (* 12288.0 f0-8))) (set! (-> self miss-amount) (- (-> self miss-amount) (* 4096.0 f0-8))) @@ -3378,13 +3374,13 @@ :trans (behavior () (crimson-guard-method-220 self) (if (and (>= (- (-> self clock frame-counter) (-> self state-time)) (seconds 1)) - (or (< 32768.0 (-> self target-self-xz-dist)) (zero? (logand (-> self flags) (citizen-flag target-in-sight)))) + (or (< 32768.0 (-> self target-self-xz-dist)) (not (logtest? (-> self flags) (citizen-flag target-in-sight)))) ) (go-hostile self) ) (let ((v1-14 (handle->process (-> self focus handle)))) - (if (or (logtest? (-> (the-as process-focusable v1-14) focus-status) (focus-status inactive)) - (logtest? (-> (the-as process-focusable v1-14) focus-status) (focus-status disable)) + (if (or (focus-test? (the-as process-focusable v1-14) inactive) + (focus-test? (the-as process-focusable v1-14) disable) ) (set! v1-14 (the-as process #f)) ) @@ -3466,10 +3462,10 @@ (or (< (-> self clock frame-counter) (-> self next-shot)) (< (-> self target-self-xz-dist) 16384.0) (not (and (handle->process (-> self focus handle)) - (zero? (logand (-> (the-as process-focusable (handle->process (-> self focus handle))) focus-status) + (not (logtest? (-> (the-as process-focusable (handle->process (-> self focus handle))) focus-status) (focus-status disable dead ignore grabbed) ) - ) + ) ) ) (>= (fabs (-> self target-y-angle)) 7281.778) @@ -3485,10 +3481,10 @@ ) (cond ((and (handle->process (-> self focus handle)) - (zero? (logand (-> (the-as process-focusable (handle->process (-> self focus handle))) focus-status) + (not (logtest? (-> (the-as process-focusable (handle->process (-> self focus handle))) focus-status) (focus-status disable dead ignore grabbed) ) - ) + ) ) (cond ((< (-> self target-self-xz-dist) 16384.0) diff --git a/test/decompiler/reference/jak2/levels/city/common/metalhead-flitter_REF.gc b/test/decompiler/reference/jak2/levels/city/common/metalhead-flitter_REF.gc index cc5c517935..0f7c79b0a7 100644 --- a/test/decompiler/reference/jak2/levels/city/common/metalhead-flitter_REF.gc +++ b/test/decompiler/reference/jak2/levels/city/common/metalhead-flitter_REF.gc @@ -558,7 +558,7 @@ ;; definition for method 99 of type metalhead-flitter (defmethod enemy-method-99 metalhead-flitter ((obj metalhead-flitter) (arg0 process-focusable)) - (logtest? (focus-status mech) (-> arg0 focus-status)) + (focus-test? arg0 mech) ) ;; definition for method 205 of type metalhead-flitter @@ -879,7 +879,7 @@ ((and gp-0 (< (- (-> self clock frame-counter) (-> self state-time)) (seconds 1.5)) gp-0 - (zero? (logand (-> (the-as process-focusable gp-0) focus-status) (focus-status disable dead ignore grabbed))) + (not (logtest? (-> (the-as process-focusable gp-0) focus-status) (focus-status disable dead ignore grabbed))) ) (let ((s5-1 (-> self nav state)) (v1-10 (get-trans (the-as process-focusable gp-0) 0)) diff --git a/test/decompiler/reference/jak2/levels/city/common/metalhead-grunt_REF.gc b/test/decompiler/reference/jak2/levels/city/common/metalhead-grunt_REF.gc index 1fb206d013..6de1e46002 100644 --- a/test/decompiler/reference/jak2/levels/city/common/metalhead-grunt_REF.gc +++ b/test/decompiler/reference/jak2/levels/city/common/metalhead-grunt_REF.gc @@ -725,7 +725,7 @@ (gp-0 (-> self clock frame-counter)) ) (when (and (>= gp-0 (-> self next-warn-time)) - (zero? (logand (-> self draw status) (draw-control-status on-screen))) + (not (logtest? (-> self draw status) (draw-control-status on-screen))) ) (when (and a0-1 (let ((f0-0 65536.0)) @@ -1259,7 +1259,7 @@ (>= 163840.0 (vector-vector-distance (-> self root-override2 trans) gp-0)) ) (or (not (logtest? (-> self fact-info-override enemy-options) (enemy-option user8))) - (and (not (logtest? (-> (the-as process-focusable s5-0) focus-status) (focus-status in-air))) + (and (not (focus-test? (the-as process-focusable s5-0) in-air)) (>= 4096.0 (fabs (- (-> gp-0 y) (-> self root-override2 trans y)))) ) ) diff --git a/test/decompiler/reference/jak2/levels/city/common/nav-graph_REF.gc b/test/decompiler/reference/jak2/levels/city/common/nav-graph_REF.gc index bd4ac35fd6..a0c7edb643 100644 --- a/test/decompiler/reference/jak2/levels/city/common/nav-graph_REF.gc +++ b/test/decompiler/reference/jak2/levels/city/common/nav-graph_REF.gc @@ -1340,7 +1340,7 @@ and patched at runtime after loading." (set! v1-4 (= arg1 (-> s0-0 level_name))) (label cfg-4) (b! (not v1-4) cfg-7 :likely-delay (set! v1-6 v1-4)) - (set! v1-6 (zero? (logand (-> s0-0 mysql-save-flag) (mysql-save-flag delete)))) + (set! v1-6 (not (logtest? (-> s0-0 mysql-save-flag) (mysql-save-flag delete)))) (label cfg-7) (b! (not v1-6) cfg-27 :delay (nop!)) (set! sv-16 (temp-edge-size s0-0)) @@ -1469,7 +1469,3 @@ and patched at runtime after loading." ) (none) ) - - - - diff --git a/test/decompiler/reference/jak2/levels/city/common/pilot-states_REF.gc b/test/decompiler/reference/jak2/levels/city/common/pilot-states_REF.gc index 25f39b0cc6..49d6f58c5b 100644 --- a/test/decompiler/reference/jak2/levels/city/common/pilot-states_REF.gc +++ b/test/decompiler/reference/jak2/levels/city/common/pilot-states_REF.gc @@ -239,7 +239,7 @@ ;; definition for function target-pilot-signal-ready (defbehavior target-pilot-signal-ready target () - (when (not (logtest? (-> self focus-status) (focus-status pilot-riding))) + (when (not (focus-test? self pilot-riding)) (logior! (-> self focus-status) (focus-status pilot-riding)) (send-event (handle->process (-> self pilot vehicle)) 'pilot-on (-> self pilot seat-index)) ) @@ -525,7 +525,7 @@ (case event-type (('end-mode) (cond - ((logtest? (-> self focus-status) (focus-status pilot-riding)) + ((focus-test? self pilot-riding) (go target-pilot-get-off) ) (else diff --git a/test/decompiler/reference/jak2/levels/city/common/target-pilot_REF.gc b/test/decompiler/reference/jak2/levels/city/common/target-pilot_REF.gc index 66df9c6ede..9ec8ee2b7d 100644 --- a/test/decompiler/reference/jak2/levels/city/common/target-pilot_REF.gc +++ b/test/decompiler/reference/jak2/levels/city/common/target-pilot_REF.gc @@ -43,7 +43,7 @@ (('change-mode) (case (-> arg3 param 0) (('grab) - (when (not (logtest? (-> self focus-status) (focus-status dead))) + (when (not (focus-test? self dead)) (if (not (-> arg3 param 1)) #t (go target-pilot-grab) @@ -355,7 +355,7 @@ (quaternion-copy! (-> self control quat-for-control) (-> self control quat)) (quaternion-copy! (-> self control dir-targ) (-> self control quat)) (let ((s4-0 (-> self alt-cam-pos))) - (when (not (logtest? (-> self focus-status) (focus-status dead))) + (when (not (focus-test? self dead)) (let ((s3-0 (new 'stack-no-clear 'collide-query-with-5vec))) (set! (-> s3-0 vec 2 x) 0.0) (set! (-> s3-0 vec 2 y) 20480.0) @@ -481,7 +481,3 @@ 0 (none) ) - - - - diff --git a/test/decompiler/reference/jak2/levels/city/common/traffic-engine_REF.gc b/test/decompiler/reference/jak2/levels/city/common/traffic-engine_REF.gc index f2c1e1c655..ac5b26b5ac 100644 --- a/test/decompiler/reference/jak2/levels/city/common/traffic-engine_REF.gc +++ b/test/decompiler/reference/jak2/levels/city/common/traffic-engine_REF.gc @@ -351,7 +351,7 @@ The param object is updated with the ID of the box and can be later used with up (let ((a1-1 (-> s4-0 object-type-info-array (-> obj active-object-type-list s3-0))) (a0-2 (handle->process (-> obj active-object-list s3-0))) ) - (if (not (logtest? (-> (the-as process-focusable a0-2) focus-status) (focus-status inactive))) + (if (not (focus-test? (the-as process-focusable a0-2) inactive)) (arg0 (the-as process-focusable a0-2) a1-1) ) ) @@ -372,7 +372,7 @@ The param object is updated with the ID of the box and can be later used with up (let ((a1-1 (-> s3-0 object-type-info-array a0-1)) (a0-3 (handle->process (-> obj active-object-list s2-0))) ) - (if (not (logtest? (-> (the-as process-focusable a0-3) focus-status) (focus-status inactive))) + (if (not (focus-test? (the-as process-focusable a0-3) inactive)) (arg1 (the-as process-focusable a0-3) a1-1) ) ) @@ -496,7 +496,7 @@ Process is recycled and moved to reserved, if it deactivates." (v1-5 (the-as object #t)) ) (when s1-0 - (when (not (logtest? (-> (the-as process-focusable s1-0) focus-status) (focus-status inactive))) + (when (not (focus-test? (the-as process-focusable s1-0) inactive)) (if arg1 (set! gp-0 'traffic-off-force) ) @@ -639,7 +639,7 @@ Process is recycled and moved to reserved, if it deactivates." (logtest? (-> v1-2 flags) (traffic-type-flags trtflags-2)) (logtest? (-> v1-2 flags) (traffic-type-flags trtflags-3)) (or (not (logtest? (-> v1-2 flags) (traffic-type-flags trtflags-0))) - (zero? (logand (-> obj traffic alert-state flags) (traffic-alert-flag alert-ending))) + (not (logtest? (-> obj traffic alert-state flags) (traffic-alert-flag alert-ending))) ) ) (let ((s4-0 (new 'stack-no-clear 'mystery-traffic-object-spawn-params))) @@ -1694,7 +1694,7 @@ Process is recycled and moved to reserved, if it deactivates." (let ((a2-0 *target*)) (when a2-0 (cond - ((logtest? (focus-status pilot) (-> a2-0 focus-status)) + ((focus-test? a2-0 pilot) (when (nonzero? (-> a2-0 pilot)) (let ((a2-1 (handle->process (-> a2-0 pilot vehicle)))) (when a2-1 @@ -1717,7 +1717,7 @@ Process is recycled and moved to reserved, if it deactivates." (cond (s3-0 (cond - ((logtest? (-> (the-as vehicle s3-0) focus-status) (focus-status inactive)) + ((focus-test? (the-as vehicle s3-0) inactive) (deactivate-object (-> obj citizen-tracker-array) (the-as int s4-0) #f) ) ((begin @@ -1747,7 +1747,7 @@ Process is recycled and moved to reserved, if it deactivates." (cond (s3-1 (cond - ((logtest? (-> (the-as process-focusable s3-1) focus-status) (focus-status inactive)) + ((focus-test? (the-as process-focusable s3-1) inactive) (deactivate-object (-> obj vehicle-tracker-array) (the-as int s4-1) #f) ) ((begin @@ -1785,7 +1785,7 @@ Process is recycled and moved to reserved, if it deactivates." (let ((f30-0 10000000000000000000000000000000000000.0)) (dotimes (s1-0 (the-as int (-> s4-2 active-cell-count))) (let ((s0-0 (-> s4-2 active-cell-list s1-0))) - (when (and (logtest? (-> s0-0 flags) (ash 1 s3-3)) (zero? (logand (-> s0-0 flags) (vis-cell-flag suppress)))) + (when (and (logtest? (-> s0-0 flags) (ash 1 s3-3)) (not (logtest? (-> s0-0 flags) (vis-cell-flag suppress)))) (set! sv-48 0) (while (< sv-48 (-> s0-0 incoming-segment-count)) (set! sv-64 (-> s0-0 segment-array sv-48)) @@ -2194,7 +2194,7 @@ Process is recycled and moved to reserved, if it deactivates." ) ) ) - (when (and s2-0 (not (logtest? (-> s2-0 focus-status) (focus-status disable dead inactive))) (!= arg0 s2-0)) + (when (and s2-0 (not (focus-test? s2-0 disable dead inactive)) (!= arg0 s2-0)) (let ((f0-0 (vector-vector-xz-distance (-> arg0 root trans) (-> s2-0 root-override trans)))) (when (or (not gp-0) (< f0-0 f30-0)) (set! gp-0 s2-0) @@ -2226,7 +2226,7 @@ Process is recycled and moved to reserved, if it deactivates." ) ) ) - (when (and s2-1 (not (logtest? (-> s2-1 focus-status) (focus-status disable dead inactive))) (!= arg0 s2-1)) + (when (and s2-1 (not (focus-test? s2-1 disable dead inactive)) (!= arg0 s2-1)) (let ((f0-1 (vector-vector-xz-distance (-> arg0 root trans) (-> s2-1 root-override trans)))) (when (or (not gp-0) (< f0-1 f30-0)) (set! gp-0 s2-1) @@ -2257,7 +2257,7 @@ Process is recycled and moved to reserved, if it deactivates." ) ) ) - (when (and s2-2 (not (logtest? (-> s2-2 focus-status) (focus-status disable dead inactive))) (!= arg0 s2-2)) + (when (and s2-2 (not (focus-test? s2-2 disable dead inactive)) (!= arg0 s2-2)) (let ((f0-2 (vector-vector-xz-distance (-> arg0 root trans) (-> s2-2 root-override trans)))) (when (or (not gp-0) (< f0-2 f30-0)) (set! gp-0 s2-2) @@ -2349,7 +2349,7 @@ Process is recycled and moved to reserved, if it deactivates." (((traffic-type crimson-guard-1)) (let ((guard (handle->process (-> obj vehicle-tracker-array active-object-list guard-count)))) (when (and guard - (not (logtest? (-> (the-as process-focusable guard) focus-status) (focus-status dead inactive))) + (not (focus-test? (the-as process-focusable guard) dead inactive)) (= (-> (the-as crimson-guard guard) traffic-target-status handle) (-> target-status handle)) ) (set! (-> guards guard-idx) (the-as crimson-guard guard)) @@ -2780,7 +2780,7 @@ Process is recycled and moved to reserved, if it deactivates." (((traffic-type guard-bike) (traffic-type hellcat)) (let ((a3-6 (handle->process (-> obj citizen-tracker-array active-object-list a2-0)))) (when (and a3-6 - (not (logtest? (-> (the-as vehicle a3-6) focus-status) (focus-status dead inactive))) + (not (focus-test? (the-as vehicle a3-6) dead inactive)) (logtest? (rigid-body-object-flag alert) (-> (the-as vehicle a3-6) flags)) ) (let ((t0-13 (-> (the-as vehicle a3-6) info-override guard-type))) @@ -2823,7 +2823,7 @@ Process is recycled and moved to reserved, if it deactivates." (case (-> obj vehicle-tracker-array active-object-type-list s1-0) (((traffic-type crimson-guard-1)) (let ((s0-0 (handle->process (-> obj vehicle-tracker-array active-object-list s1-0)))) - (when (and s0-0 (zero? (logand (-> (the-as crimson-guard s0-0) focus-status) (focus-status dead inactive)))) + (when (and s0-0 (not (logtest? (-> (the-as crimson-guard s0-0) focus-status) (focus-status dead inactive)))) (when (and (logtest? (-> (the-as crimson-guard s0-0) flags) (citizen-flag in-pursuit)) (logtest? (-> (the-as crimson-guard s0-0) flags) (citizen-flag target-in-sight)) ) @@ -2836,7 +2836,7 @@ Process is recycled and moved to reserved, if it deactivates." (set! s5-0 (the-as crimson-guard s0-0)) ) (if (and (< 327680.0 f0-3) - (zero? (logand (-> obj alert-state flags) (traffic-alert-flag disable-pursuit-control))) + (not (logtest? (-> obj alert-state flags) (traffic-alert-flag disable-pursuit-control))) ) (send-event (the-as crimson-guard s0-0) 'end-pursuit) ) @@ -2918,7 +2918,7 @@ Process is recycled and moved to reserved, if it deactivates." (fmax 0.0 (fmin 1.0 (* (-> a1-3 inaccuracy) (-> obj alert-state guard-inaccuracy-factor)))) ) (when *target* - (when (logtest? (focus-status pilot) (-> *target* focus-status)) + (when (focus-test? *target* pilot) (set! (-> a1-3 acquire-delay) (the-as uint (the int (* 0.75 (the float (-> a1-3 acquire-delay)))))) (set! (-> a1-3 shot-delay) (the-as uint (the int (* 0.6 (the float (-> a1-3 shot-delay)))))) (set! (-> a1-3 burst-delay) (the-as uint (the int (* 0.8 (the float (-> a1-3 burst-delay)))))) @@ -3114,7 +3114,7 @@ Process is recycled and moved to reserved, if it deactivates." (set! (-> a1-6 parking-spot-prob) (the-as uint - (if (and (zero? (-> a1-6 tracker-index)) (zero? (logand (-> a1-6 flags) (traffic-type-flags trtflags-0)))) + (if (and (zero? (-> a1-6 tracker-index)) (not (logtest? (-> a1-6 flags) (traffic-type-flags trtflags-0)))) v1-13 0 ) @@ -3191,7 +3191,7 @@ Process is recycled and moved to reserved, if it deactivates." (let ((v1-3 (handle->process (-> obj citizen-tracker-array active-object-list s4-0)))) (when v1-3 (cond - ((logtest? (-> (the-as process-focusable v1-3) focus-status) (focus-status inactive)) + ((focus-test? (the-as process-focusable v1-3) inactive) (deactivate-object (-> obj citizen-tracker-array) (the-as int s4-0) #f) ) ((begin (set! v1-6 (-> (the-as vehicle v1-3) controller branch)) (and v1-6 (nonzero? v1-6))) diff --git a/test/decompiler/reference/jak2/levels/city/common/vehicle-guard_REF.gc b/test/decompiler/reference/jak2/levels/city/common/vehicle-guard_REF.gc index 6246ed0ba5..9330dee172 100644 --- a/test/decompiler/reference/jak2/levels/city/common/vehicle-guard_REF.gc +++ b/test/decompiler/reference/jak2/levels/city/common/vehicle-guard_REF.gc @@ -408,7 +408,7 @@ (dotimes (s3-1 2) (+! (-> obj aim-rot-vel s3-1) (* 5.0 - (- (* 8.0 (if (or (zero? s3-1) (zero? (logand (-> obj flags) (turret-flag no-rot-y-clamp)))) + (- (* 8.0 (if (or (zero? s3-1) (not (logtest? (-> obj flags) (turret-flag no-rot-y-clamp)))) (- (-> gp-0 vec-4 data s3-1) (-> obj aim-rot s3-1)) (deg- (-> gp-0 vec-4 data s3-1) (-> obj aim-rot s3-1)) ) @@ -420,7 +420,7 @@ ) (set! (-> obj aim-rot-vel s3-1) (* (-> obj aim-rot-vel s3-1) (fmax 0.0 (- 1.0 (* 0.1 (-> gp-0 vec-12 x)))))) (+! (-> obj aim-rot s3-1) (* (-> obj aim-rot-vel s3-1) (-> gp-0 vec-12 x))) - (when (or (zero? s3-1) (zero? (logand (-> obj flags) (turret-flag no-rot-y-clamp)))) + (when (or (zero? s3-1) (not (logtest? (-> obj flags) (turret-flag no-rot-y-clamp)))) (let ((f0-31 (-> obj info rot-min s3-1))) (when (< (-> obj aim-rot s3-1) f0-31) (set! (-> obj aim-rot s3-1) f0-31) @@ -799,7 +799,7 @@ (vector-float*! (-> arg0 to-target-dir) (-> arg0 to-target) f1-2) ) (let ((f0-3 204800.0)) - (if (logtest? (focus-status pilot) (-> (the-as process-focusable s5-0) focus-status)) + (if (focus-test? (the-as process-focusable s5-0) pilot) (set! f0-3 (+ 102400.0 f0-3)) ) (set! (-> arg0 attack-range) f0-3) @@ -1047,10 +1047,10 @@ ) ) (('track) - (zero? (logand (-> obj flags) (rigid-body-object-flag player-driving))) + (not (logtest? (-> obj flags) (rigid-body-object-flag player-driving))) ) (('alert-begin) - (when (and (not (logtest? (-> obj focus-status) (focus-status dead))) + (when (and (not (focus-test? obj dead)) (not (logtest? (rigid-body-object-flag alert) (-> obj flags))) (logtest? (rigid-body-object-flag ai-driving) (-> obj flags)) (>= (the-as uint (get-alert-level (-> obj controller traffic))) (the-as uint 2)) @@ -1063,7 +1063,7 @@ ) ) (('alert-end) - (when (not (logtest? (-> obj focus-status) (focus-status dead))) + (when (not (focus-test? obj dead)) (when (logtest? (rigid-body-object-flag alert) (-> obj flags)) (set! (-> obj flags) (the-as rigid-body-object-flag (logclear (-> obj flags) (rigid-body-object-flag persistent alert in-pursuit))) diff --git a/test/decompiler/reference/jak2/levels/city/common/vehicle-states_REF.gc b/test/decompiler/reference/jak2/levels/city/common/vehicle-states_REF.gc index 9ac0c869f3..ad01d6bac8 100644 --- a/test/decompiler/reference/jak2/levels/city/common/vehicle-states_REF.gc +++ b/test/decompiler/reference/jak2/levels/city/common/vehicle-states_REF.gc @@ -213,7 +213,7 @@ (when (and (cpad-pressed? 0 triangle) (not (logtest? (-> self info-override flags) 256)) (-> *setting-control* user-current pilot-exit) - (not (logtest? (-> *target* focus-status) (focus-status dead hit grabbed))) + (not (focus-test? *target* dead hit grabbed)) (!= (-> self crash-level) 3) ) (if (send-event *target* 'end-mode) diff --git a/test/decompiler/reference/jak2/levels/city/common/vehicle-util_REF.gc b/test/decompiler/reference/jak2/levels/city/common/vehicle-util_REF.gc index 2712fb2cbb..a1c9909980 100644 --- a/test/decompiler/reference/jak2/levels/city/common/vehicle-util_REF.gc +++ b/test/decompiler/reference/jak2/levels/city/common/vehicle-util_REF.gc @@ -271,11 +271,8 @@ This commonly includes things such as: (< -81920.0 (-> s5-0 floats 2)) (< (-> s5-0 floats 2) 20480.0) *target* - (not (logtest? (focus-status dead grabbed in-head under-water pole flut tube pilot dark) - (-> *target* focus-status) - ) - ) - (or (not (logtest? (-> *target* focus-status) (focus-status edge-grab))) + (not (focus-test? *target* dead grabbed in-head under-water pole flut tube pilot dark)) + (or (not (focus-test? *target* edge-grab)) (logtest? (-> obj flags) (rigid-body-object-flag player-edge-grabbing)) ) (-> *setting-control* user-current pilot) @@ -347,13 +344,13 @@ This commonly includes things such as: ) (when s2-0 (when (and (or (< -14336.0 (-> s5-0 floats 2)) (logtest? (-> obj flags) (rigid-body-object-flag player-edge-grabbing))) - (zero? (logand (rigid-body-object-flag no-hijack) (-> obj flags))) + (not (logtest? (rigid-body-object-flag no-hijack) (-> obj flags))) ) (set! s4-1 #t) (set! (-> s5-0 floats 3) (* (-> obj hit-points) (/ 40960.0 (sqrtf (-> s5-0 floats 1))))) ) (when (and (not s4-1) - (and (< (-> s5-0 floats 2) -8192.0) (zero? (logand (-> *target* focus-status) (focus-status edge-grab)))) + (and (< (-> s5-0 floats 2) -8192.0) (not (logtest? (-> *target* focus-status) (focus-status edge-grab)))) ) (matrix-4x4-inverse! (-> s5-0 matrices 2) (-> s5-0 matrices 1)) (vector-matrix*! (the-as vector (-> s5-0 matrices)) (-> s5-0 matrices 0 vector 1) (-> s5-0 matrices 2)) @@ -433,7 +430,7 @@ This commonly includes things such as: ) (cond ((and (logtest? (-> obj flags) (rigid-body-object-flag player-driving)) *target* (!= (-> obj crash-level) 3)) - (when (logtest? (-> *target* focus-status) (focus-status pilot-riding)) + (when (focus-test? *target* pilot-riding) (vehicle-controller-method-11 (-> obj controller)) (vehicle-method-138 obj) ) @@ -981,7 +978,7 @@ This commonly includes things such as: (defmethod vehicle-method-143 vehicle ((obj vehicle)) (let ((v1-2 (or (logtest? (-> obj flags) (rigid-body-object-flag dead waiting-for-player)) (and (logtest? (rigid-body-object-flag player-driving ai-driving) (-> obj flags)) - (zero? (logand (-> obj flags) (rigid-body-object-flag on-flight-level))) + (not (logtest? (-> obj flags) (rigid-body-object-flag on-flight-level))) ) ) ) @@ -1293,9 +1290,7 @@ This commonly includes things such as: ;; definition for method 42 of type vehicle ;; WARN: Return type mismatch int vs none. (defmethod rigid-body-object-method-42 vehicle ((obj vehicle)) - (if (and (not (logtest? (-> obj focus-status) (focus-status inactive))) - (not (and (-> obj next-state) (= (-> obj next-state name) 'explode))) - ) + (if (and (not (focus-test? obj inactive)) (not (and (-> obj next-state) (= (-> obj next-state name) 'explode)))) ((method-of-type rigid-body-object rigid-body-object-method-42) obj) ) 0 @@ -1316,7 +1311,7 @@ This commonly includes things such as: ;; definition for method 114 of type vehicle ;; WARN: Return type mismatch int vs none. (defmethod vehicle-method-114 vehicle ((obj vehicle)) - (if (logtest? (-> obj focus-status) (focus-status inactive)) + (if (focus-test? obj inactive) (vehicle-method-128 obj) ) (go (method-of-object obj active)) @@ -1583,7 +1578,7 @@ This commonly includes things such as: (defmethod vehicle-method-119 vehicle ((obj vehicle)) (dotimes (s5-0 (-> obj info-override seat-count)) (let ((s4-0 (handle->process (-> obj rider-array s5-0)))) - (when (and s4-0 (logtest? (-> (the-as vehicle-rider s4-0) focus-status) (focus-status pilot-riding))) + (when (and s4-0 (focus-test? (the-as vehicle-rider s4-0) pilot-riding)) (compute-seat-position obj (-> (the-as vehicle-rider s4-0) root-override trans) s5-0) (set! (-> (the-as vehicle-rider s4-0) root-override transv quad) (-> obj root-override-2 transv quad)) (let ((f0-1 (the float (-> obj info-override seat-array s5-0 angle)))) diff --git a/test/decompiler/reference/jak2/levels/city/common/vehicle_REF.gc b/test/decompiler/reference/jak2/levels/city/common/vehicle_REF.gc index dd84f32107..63f4b78428 100644 --- a/test/decompiler/reference/jak2/levels/city/common/vehicle_REF.gc +++ b/test/decompiler/reference/jak2/levels/city/common/vehicle_REF.gc @@ -385,7 +385,7 @@ (defmethod vehicle-method-94 vehicle ((obj vehicle)) (cond ((or (logtest? (rigid-body-object-flag player-grabbed) (-> obj flags)) - (and *target* (logtest? (-> *target* focus-status) (focus-status dead grabbed))) + (and *target* (focus-test? *target* dead grabbed)) ) (let ((v1-7 (new 'stack-no-clear 'vector))) (set! (-> v1-7 x) 0.0) @@ -401,7 +401,7 @@ ) ) ((and (zero? (-> obj crash-level)) - (zero? (logand (rigid-body-object-flag ai-driving measure-control-parameters) (-> obj flags))) + (not (logtest? (rigid-body-object-flag ai-driving measure-control-parameters) (-> obj flags))) ) (when (and (cpad-pressed? 0 r2) (not *pause-lock*)) (if (zero? (-> obj flight-level-index)) @@ -437,7 +437,7 @@ (zero? (-> obj root-override-2 num-riders)) (or (not *target*) (or (< 32768.0 (vector-vector-distance (-> obj root-override-2 trans) (-> *target* control trans))) - (logtest? (focus-status teleporting) (-> *target* focus-status)) + (focus-test? *target* teleporting) ) ) ) @@ -873,7 +873,7 @@ (set! (-> v1-4 ignore-pat) (new 'static 'pat-surface :noentity #x1 :nopilot #x1)) (set! (-> v1-4 action-mask) (collide-action solid)) ) - (if (logtest? (-> obj focus-status) (focus-status dead)) + (if (focus-test? obj dead) (set! (-> s5-0 ignore-pat) (new 'static 'pat-surface :noentity #x1 :nopilot #x1 :probe #x1)) ) (if (logtest? (-> obj flags) (rigid-body-object-flag player-touching)) @@ -962,7 +962,7 @@ (let ((s5-0 (-> obj root-override-2))) (update-transforms s5-0) (when (and (logtest? (-> obj flags) (rigid-body-object-flag player-touching)) - (zero? (logand (-> obj flags) (rigid-body-object-flag player-driving))) + (not (logtest? (-> obj flags) (rigid-body-object-flag player-driving))) ) (pull-riders! s5-0) (cond @@ -999,7 +999,7 @@ ) ) (if (and (logtest? (-> obj flags) (rigid-body-object-flag dead)) - (zero? (logand (-> obj focus-status) (focus-status dead))) + (not (logtest? (-> obj focus-status) (focus-status dead))) ) (go (method-of-object obj crash)) ) @@ -1141,7 +1141,7 @@ cfg-3 :likely-delay (set! v1-4 #f) ) - (set! v1-4 (zero? (logand (-> obj flags) (rigid-body-object-flag persistent)))) + (set! v1-4 (not (logtest? (-> obj flags) (rigid-body-object-flag persistent)))) (label cfg-3) (b! (not v1-4) cfg-20 :delay (empty-form)) (let ((f0-3 (fmin (-> obj player-dist2) (-> obj camera-dist2)))) @@ -1709,7 +1709,7 @@ :likely-delay (set! v1-2 #t) ) (b! (not (logtest? (-> arg0 mask) (process-mask target))) cfg-5 :likely-delay (set! v1-2 #f)) - (set! v1-2 (logtest? (focus-status dangerous pilot) (-> arg0 focus-status))) + (set! v1-2 (focus-test? arg0 dangerous pilot)) (label cfg-5) (b! v1-2 cfg-32 :delay (nop!)) (let ((s5-0 (new 'stack-no-clear 'rigid-body-impact))) @@ -1886,7 +1886,7 @@ (when (and (!= (-> s3-1 id) (-> obj incoming-attack-id)) (not (logtest? (-> obj flags) (rigid-body-object-flag dead))) (or (not (logtest? (-> obj flags) (rigid-body-object-flag player-driving))) - (zero? (logand (penetrate jak-yellow-shot jak-red-shot jak-blue-shot jak-dark-shot) s2-1)) + (not (logtest? (penetrate jak-yellow-shot jak-red-shot jak-blue-shot jak-dark-shot) s2-1)) ) ) (set! (-> obj incoming-attack-id) (-> s3-1 id)) diff --git a/test/decompiler/reference/jak2/levels/city/kid_escort/crocesc-states_REF.gc b/test/decompiler/reference/jak2/levels/city/kid_escort/crocesc-states_REF.gc index 4aaaed8c09..182ebb5a56 100644 --- a/test/decompiler/reference/jak2/levels/city/kid_escort/crocesc-states_REF.gc +++ b/test/decompiler/reference/jak2/levels/city/kid_escort/crocesc-states_REF.gc @@ -30,7 +30,7 @@ (if (and (-> self focus-info fproc) (>= (fabs (-> self focus-info ry-diff)) 9102.223)) (go-waiting-turn self) ) - (when (not (logtest? (-> self focus-status) (focus-status grabbed))) + (when (not (focus-test? self grabbed)) (cond ((logtest? (-> self bot-flags) (bot-flags bf15)) (go-virtual move-to-vehicle) @@ -188,9 +188,9 @@ ) :trans (behavior () (bot-method-223 self #f) - (when (not (logtest? (-> self focus-status) (focus-status grabbed))) + (when (not (focus-test? self grabbed)) (if (and (not (outside-spot-radius? self (the-as bot-spot #f) (the-as vector #f) #f)) - (zero? (logand (-> self bot-flags) (bot-flags bf15))) + (not (logtest? (-> self bot-flags) (bot-flags bf15))) ) (go-virtual traveling) ) @@ -611,7 +611,7 @@ :trans (behavior () (check-vehicle-exit self) 0.0 - (when (logtest? (-> self focus-status) (focus-status pilot-riding)) + (when (focus-test? self pilot-riding) (let ((s5-0 (handle->process (-> self vehicle-handle))) (gp-0 (new 'stack-no-clear 'vector)) ) @@ -700,7 +700,7 @@ ) :trans (behavior () (check-vehicle-exit self) - (when (logtest? (-> self focus-status) (focus-status pilot-riding)) + (when (focus-test? self pilot-riding) (let ((gp-0 (handle->process (-> self vehicle-handle)))) (quaternion-copy! (-> self root-override2 quat) (-> (the-as vehicle gp-0) root-override-2 quat)) (vector-matrix*! diff --git a/test/decompiler/reference/jak2/levels/city/kid_escort/crocesc4-course_REF.gc b/test/decompiler/reference/jak2/levels/city/kid_escort/crocesc4-course_REF.gc index 2927208fd4..35b889b641 100644 --- a/test/decompiler/reference/jak2/levels/city/kid_escort/crocesc4-course_REF.gc +++ b/test/decompiler/reference/jak2/levels/city/kid_escort/crocesc4-course_REF.gc @@ -698,7 +698,7 @@ (set! (-> (the-as crocesct-wait-spot v1-1) check-done) (the-as (function crocesct-wait-spot crocadog-escort symbol) - (lambda ((arg0 object) (arg1 crocadog-escort)) (when (logtest? (focus-status pilot) (-> arg1 focus-status)) + (lambda ((arg0 object) (arg1 crocadog-escort)) (when (focus-test? arg1 pilot) (ai-task-control-method-12 (-> arg1 ai-ctrl) arg1) (go-to-waypoint! arg1 18 #f) (ai-task-control-method-10 (-> arg1 ai-ctrl) arg1) @@ -728,9 +728,7 @@ (the-as (function crocesct-wait-spot crocadog-escort symbol) (lambda ((arg0 object) (arg1 crocadog-escort)) - (when (and (not (logtest? (focus-status pilot) (-> arg1 focus-status))) - (zero? (logand (bot-flags bf17) (-> arg1 bot-flags))) - ) + (when (and (not (focus-test? arg1 pilot)) (not (logtest? (bot-flags bf17) (-> arg1 bot-flags)))) (ai-task-control-method-12 (-> arg1 ai-ctrl) arg1) (go-to-waypoint! arg1 19 #f) (ai-task-control-method-10 (-> arg1 ai-ctrl) arg1) diff --git a/test/decompiler/reference/jak2/levels/city/kid_escort/hal4-course_REF.gc b/test/decompiler/reference/jak2/levels/city/kid_escort/hal4-course_REF.gc index 46631aa8be..20000bb5b8 100644 --- a/test/decompiler/reference/jak2/levels/city/kid_escort/hal4-course_REF.gc +++ b/test/decompiler/reference/jak2/levels/city/kid_escort/hal4-course_REF.gc @@ -174,7 +174,7 @@ ((>= (- (-> pp clock frame-counter) (-> obj arrestor-time)) (seconds 4)) (set! (-> obj arrestor-handle) (the-as handle #f)) ) - ((logtest? (-> (the-as process-focusable v1-3) focus-status) (focus-status hit)) + ((focus-test? (the-as process-focusable v1-3) hit) (when (and (>= (- (-> pp clock frame-counter) (-> obj played-defend-time)) (seconds 6)) (not (channel-active? obj (the-as uint 0))) ) @@ -219,7 +219,7 @@ (defmethod hal-escort-method-227 hal-escort ((obj hal-escort)) (with-pp (let ((s5-0 *target*)) - (when (logtest? (focus-status pilot-riding pilot) (-> s5-0 focus-status)) + (when (focus-test? s5-0 pilot-riding pilot) (let* ((a0-2 (-> obj actor-group 0 data 1 actor)) (v1-5 (when a0-2 (let ((s4-0 (-> a0-2 extra process))) @@ -230,7 +230,7 @@ ) ) ) - (when (logtest? (focus-status pilot-riding pilot) (-> (the-as process-focusable v1-5) focus-status)) + (when (focus-test? (the-as process-focusable v1-5) pilot-riding pilot) (let* ((v1-12 (-> obj actor-group 0 data 2 actor)) (a0-5 (when v1-12 (let ((s4-1 (-> v1-12 extra process))) @@ -241,7 +241,7 @@ ) ) ) - (when (not (logtest? (focus-status pilot-riding pilot) (-> (the-as process-focusable a0-5) focus-status))) + (when (not (focus-test? (the-as process-focusable a0-5) pilot-riding pilot)) (let ((f0-0 245760.0)) (and (< (* f0-0 f0-0) (vector-vector-xz-distance-squared (get-trans (the-as process-focusable a0-5) 0) (get-trans s5-0 0)) @@ -422,8 +422,8 @@ ((not (-> *setting-control* user-current pilot-exit)) (when (and s5-0 v1-8 - (not (logtest? (-> (the-as process-focusable s5-0) focus-status) (focus-status pilot-riding))) - (not (logtest? (-> (the-as process-focusable v1-8) focus-status) (focus-status pilot-riding))) + (not (focus-test? (the-as process-focusable s5-0) pilot-riding)) + (not (focus-test? (the-as process-focusable v1-8) pilot-riding)) (>= (- (-> pp clock frame-counter) (-> obj locked-player-time)) (seconds 10)) ) (remove-setting! 'pilot-exit) @@ -431,11 +431,11 @@ (apply-settings *setting-control*) ) ) - ((logtest? (-> target focus-status) (focus-status pilot-riding)) + ((focus-test? target pilot-riding) (when (and (nonzero? (-> target pilot)) (and (= (handle->process (-> target pilot vehicle)) (handle->process (-> obj vehicle-handle))) - (or (and s5-0 (logtest? (focus-status pilot) (-> (the-as process-focusable s5-0) focus-status))) - (and v1-8 (logtest? (focus-status pilot) (-> (the-as process-focusable v1-8) focus-status))) + (or (and s5-0 (focus-test? (the-as process-focusable s5-0) pilot)) + (and v1-8 (focus-test? (the-as process-focusable v1-8) pilot)) ) ) ) @@ -1329,14 +1329,14 @@ ) ) ) - (if (logtest? (focus-status pilot) (-> (the-as process-focusable s5-0) focus-status)) + (if (focus-test? (the-as process-focusable s5-0) pilot) (send-event s5-0 'request 'exit-vehicle s3-1 1) ) - (if (logtest? (focus-status pilot) (-> (the-as process-focusable s5-0) focus-status)) + (if (focus-test? (the-as process-focusable s5-0) pilot) (send-event s4-1 'request 'exit-vehicle s3-1 1) ) (if (and (not (speech-playing? arg1 7)) - (not (logtest? (-> (the-as process-focusable s4-1) focus-status) (focus-status pilot-riding))) + (not (focus-test? (the-as process-focusable s4-1) pilot-riding)) (not (logtest? (bot-flags bf17) (-> (the-as bot s4-1) bot-flags))) s3-1 (not (channel-active? arg1 (the-as uint 0))) @@ -1344,10 +1344,10 @@ (play-speech arg1 7) ) ) - (when (and (not (logtest? (focus-status pilot) (-> (the-as process-focusable s4-1) focus-status))) + (when (and (not (focus-test? (the-as process-focusable s4-1) pilot)) (not (logtest? (bot-flags bf17) (-> (the-as bot s4-1) bot-flags))) - (not (logtest? (focus-status pilot) (-> (the-as process-focusable s5-0) focus-status))) - (zero? (logand (bot-flags bf17) (-> (the-as bot s5-0) bot-flags))) + (not (focus-test? (the-as process-focusable s5-0) pilot)) + (not (logtest? (bot-flags bf17) (-> (the-as bot s5-0) bot-flags))) ) (send-event *target* 'end-mode) (ai-task-control-method-12 (-> arg1 ai-ctrl) arg1) @@ -1637,7 +1637,7 @@ ((and s5-0 (>= (-> s3-0 center w) (vector-vector-xz-distance s4-0 (-> s3-0 center))) (and (>= (- (-> s4-0 y) (-> s3-0 center y)) -10240.0) - (zero? (logand (-> s5-0 focus-status) (focus-status edge-grab))) + (not (logtest? (-> s5-0 focus-status) (focus-status edge-grab))) ) ) (when (not (logtest? (-> arg1 bot-task-bits) 1)) @@ -2089,7 +2089,3 @@ ;; failed to figure out what this is: (set! (-> *bot-course-table* course 10) *hal4-course*) - - - - diff --git a/test/decompiler/reference/jak2/levels/city/kid_escort/kidesc-states_REF.gc b/test/decompiler/reference/jak2/levels/city/kid_escort/kidesc-states_REF.gc index e0ae95d9c6..a7555c4242 100644 --- a/test/decompiler/reference/jak2/levels/city/kid_escort/kidesc-states_REF.gc +++ b/test/decompiler/reference/jak2/levels/city/kid_escort/kidesc-states_REF.gc @@ -40,7 +40,7 @@ ) ) (label cfg-15) - (when (not (logtest? (-> self focus-status) (focus-status grabbed))) + (when (not (focus-test? self grabbed)) (cond ((logtest? (-> self bot-flags) (bot-flags bf15)) (go-virtual move-to-vehicle) @@ -105,14 +105,14 @@ ) :trans (behavior () (bot-method-223 self #f) - (when (not (logtest? (-> self focus-status) (focus-status grabbed))) + (when (not (focus-test? self grabbed)) (if (and (not (outside-spot-radius? self (the-as bot-spot #f) (the-as vector #f) #f)) (let ((gp-0 (handle->process (-> self arrestor-handle)))) (and (not (if (type? gp-0 process-focusable) gp-0 ) ) - (zero? (logand (-> self bot-flags) (bot-flags bf15))) + (not (logtest? (-> self bot-flags) (bot-flags bf15))) ) ) ) @@ -897,7 +897,7 @@ (if (and (-> self focus-info fproc) (>= (fabs (-> self focus-info ry-diff)) 9102.223)) (go-waiting-turn self) ) - (when (not (logtest? (-> self focus-status) (focus-status grabbed))) + (when (not (focus-test? self grabbed)) (let ((gp-0 (handle->process (-> self arrestor-handle)))) (if (not (if (type? gp-0 process-focusable) gp-0 diff --git a/test/decompiler/reference/jak2/levels/city/kid_escort/kidesc4-course_REF.gc b/test/decompiler/reference/jak2/levels/city/kid_escort/kidesc4-course_REF.gc index e841096c0a..31b7fdddad 100644 --- a/test/decompiler/reference/jak2/levels/city/kid_escort/kidesc4-course_REF.gc +++ b/test/decompiler/reference/jak2/levels/city/kid_escort/kidesc4-course_REF.gc @@ -181,7 +181,7 @@ (set! (-> (the-as kidesct-wait-spot v1-1) check-done) (the-as (function kidesct-wait-spot kid-escort symbol) - (lambda ((arg0 object) (arg1 kid-escort)) (when (logtest? (focus-status pilot) (-> arg1 focus-status)) + (lambda ((arg0 object) (arg1 kid-escort)) (when (focus-test? arg1 pilot) (ai-task-control-method-12 (-> arg1 ai-ctrl) arg1) (go-to-waypoint! arg1 18 #f) (ai-task-control-method-10 (-> arg1 ai-ctrl) arg1) @@ -211,9 +211,7 @@ (the-as (function kidesct-wait-spot kid-escort symbol) (lambda ((arg0 object) (arg1 kid-escort)) - (when (and (not (logtest? (focus-status pilot) (-> arg1 focus-status))) - (zero? (logand (bot-flags bf17) (-> arg1 bot-flags))) - ) + (when (and (not (focus-test? arg1 pilot)) (not (logtest? (bot-flags bf17) (-> arg1 bot-flags)))) (ai-task-control-method-12 (-> arg1 ai-ctrl) arg1) (go-to-waypoint! arg1 19 #f) (ai-task-control-method-10 (-> arg1 ai-ctrl) arg1) diff --git a/test/decompiler/reference/jak2/levels/city/market/west/brutter_kiosk/meet-brutter_REF.gc b/test/decompiler/reference/jak2/levels/city/market/west/brutter_kiosk/meet-brutter_REF.gc index ca7d99d040..f43b29ea4e 100644 --- a/test/decompiler/reference/jak2/levels/city/market/west/brutter_kiosk/meet-brutter_REF.gc +++ b/test/decompiler/reference/jak2/levels/city/market/west/brutter_kiosk/meet-brutter_REF.gc @@ -2572,9 +2572,7 @@ (+! gp-0 1) (set! (-> self data-int32 a0-1) 3) ) - (if (and (logtest? (focus-status pilot) (-> (the-as city-lurker a1-3) focus-status)) - (!= (-> self data-int32 a0-1) -1) - ) + (if (and (focus-test? (the-as city-lurker a1-3) pilot) (!= (-> self data-int32 a0-1) -1)) (+! v1-2 1) ) ) @@ -2619,12 +2617,12 @@ ) (dotimes (gp-1 (-> self max-count)) (let ((s5-1 (handle->process (-> self slave (+ gp-1 (-> self max-count)))))) - (when (and s5-1 (zero? (logand (-> (the-as city-lurker s5-1) focus-status) (focus-status dead)))) + (when (and s5-1 (not (logtest? (-> (the-as city-lurker s5-1) focus-status) (focus-status dead)))) (cond ((or (not (-> (the-as paddywagon s5-1) current-level)) (= (level-status *level* (-> (the-as paddywagon s5-1) current-level)) 'active) ) - (when (logtest? (-> (the-as paddywagon s5-1) focus-status) (focus-status inactive)) + (when (focus-test? (the-as paddywagon s5-1) inactive) (let ((s4-0 (new 'stack 'traffic-object-spawn-params))) (set! (-> s4-0 object-type) (traffic-type tt17)) (set! (-> s4-0 behavior) (the-as uint 2)) @@ -2658,7 +2656,7 @@ ) ) (else - (if (not (logtest? (-> (the-as paddywagon s5-1) focus-status) (focus-status inactive))) + (if (not (focus-test? (the-as paddywagon s5-1) inactive)) (send-event (the-as paddywagon s5-1) 'traffic-off-force) ) ) @@ -2677,7 +2675,7 @@ (cond ((= (-> self data-int32 s5-2) -1) (when s4-2 - (when (logtest? (-> (the-as city-lurker s4-2) focus-status) (focus-status inactive)) + (when (focus-test? (the-as city-lurker s4-2) inactive) (let ((s3-1 (new 'stack 'traffic-object-spawn-params))) (set! (-> s3-1 object-type) (traffic-type tt5)) (set! (-> s3-1 behavior) (the-as uint 6)) @@ -2714,13 +2712,11 @@ ) ) (let ((a0-73 *target*)) - (when (and a0-73 (logtest? (focus-status pilot) (-> a0-73 focus-status))) + (when (and a0-73 (focus-test? a0-73 pilot)) (let ((s3-3 (handle->process (-> a0-73 pilot vehicle)))) (when s3-3 (cond - ((and (logtest? (focus-status pilot) (-> (the-as city-lurker s4-2) focus-status)) - (handle->process (-> (the-as city-lurker s4-2) vehicle)) - ) + ((and (focus-test? (the-as city-lurker s4-2) pilot) (handle->process (-> (the-as city-lurker s4-2) vehicle))) (+! (-> self data-int32 s5-2) 1) ) (else @@ -2760,14 +2756,14 @@ ) ((= (-> self data-int32 s5-2) 1) (when (the-as city-lurker s4-2) - (if (or (not *target*) (zero? (logand (focus-status pilot) (-> *target* focus-status)))) + (if (or (not *target*) (not (logtest? (focus-status pilot) (-> *target* focus-status)))) (send-event (the-as city-lurker s4-2) 'exit-vehicle (-> (the-as city-lurker s4-2) root-override2 trans)) ) (let ((s3-4 (-> self data-vector 3)) (s2-1 (handle->process (-> *target* pilot vehicle))) ) (cond - ((logtest? (focus-status pilot) (-> (the-as city-lurker s4-2) focus-status)) + ((focus-test? (the-as city-lurker s4-2) pilot) (when (and s2-1 (let ((f0-4 (vector-vector-distance-squared s3-4 (-> (the-as vehicle s2-1) root-override-2 trans))) (f1-6 114688.0) @@ -3161,9 +3157,7 @@ (+! gp-0 1) (set! (-> self data-int32 a1-0) 3) ) - (when (and (logtest? (focus-status pilot) (-> (the-as city-lurker a2-3) focus-status)) - (!= (-> self data-int32 a1-0) -1) - ) + (when (and (focus-test? (the-as city-lurker a2-3) pilot) (!= (-> self data-int32 a1-0) -1)) (set! v1-2 a1-0) (+! a0-1 1) ) @@ -3222,12 +3216,12 @@ ) (dotimes (gp-1 (-> self max-count)) (let ((s5-2 (handle->process (-> self slave (+ gp-1 (-> self max-count)))))) - (when (and s5-2 (zero? (logand (-> (the-as paddywagon s5-2) focus-status) (focus-status dead)))) + (when (and s5-2 (not (logtest? (-> (the-as paddywagon s5-2) focus-status) (focus-status dead)))) (cond ((or (not (-> (the-as paddywagon s5-2) current-level)) (= (level-status *level* (-> (the-as paddywagon s5-2) current-level)) 'active) ) - (when (logtest? (-> (the-as paddywagon s5-2) focus-status) (focus-status inactive)) + (when (focus-test? (the-as paddywagon s5-2) inactive) (let ((s4-0 (new 'stack 'traffic-object-spawn-params))) (set! (-> s4-0 object-type) (traffic-type tt17)) (set! (-> s4-0 behavior) (the-as uint 2)) @@ -3261,7 +3255,7 @@ ) ) (else - (if (not (logtest? (-> (the-as paddywagon s5-2) focus-status) (focus-status inactive))) + (if (not (focus-test? (the-as paddywagon s5-2) inactive)) (send-event (the-as paddywagon s5-2) 'traffic-off-force) ) ) @@ -3280,7 +3274,7 @@ (cond ((= (-> self data-int32 s5-3) -1) (when s4-2 - (when (logtest? (-> (the-as city-lurker s4-2) focus-status) (focus-status inactive)) + (when (focus-test? (the-as city-lurker s4-2) inactive) (let ((s3-1 (new 'stack 'traffic-object-spawn-params))) (set! (-> s3-1 object-type) (traffic-type tt5)) (set! (-> s3-1 behavior) (the-as uint 6)) @@ -3317,13 +3311,11 @@ ) ) (let ((a0-95 *target*)) - (when (and a0-95 (logtest? (focus-status pilot) (-> a0-95 focus-status))) + (when (and a0-95 (focus-test? a0-95 pilot)) (let ((s3-3 (handle->process (-> a0-95 pilot vehicle)))) (when s3-3 (cond - ((and (logtest? (focus-status pilot) (-> (the-as city-lurker s4-2) focus-status)) - (handle->process (-> (the-as city-lurker s4-2) vehicle)) - ) + ((and (focus-test? (the-as city-lurker s4-2) pilot) (handle->process (-> (the-as city-lurker s4-2) vehicle))) (+! (-> self data-int32 s5-3) 1) ) (else @@ -3383,14 +3375,14 @@ ) ) ) - (if (or (not *target*) (zero? (logand (focus-status pilot) (-> *target* focus-status)))) + (if (or (not *target*) (not (logtest? (focus-status pilot) (-> *target* focus-status)))) (send-event (the-as city-lurker s4-2) 'exit-vehicle (-> (the-as city-lurker s4-2) root-override2 trans)) ) (let ((s3-5 (-> (the-as city-lurker s4-2) end-pos)) (s2-2 (handle->process (-> *target* pilot vehicle))) ) (cond - ((logtest? (focus-status pilot) (-> (the-as city-lurker s4-2) focus-status)) + ((focus-test? (the-as city-lurker s4-2) pilot) (when (and s2-2 (let ((f0-5 (vector-vector-distance-squared s3-5 (-> (the-as vehicle s2-2) root-override-2 trans))) (f1-6 114688.0) @@ -3502,7 +3494,3 @@ ) ) ) - - - - diff --git a/test/decompiler/reference/jak2/levels/city/misc/collection_task/collection-task_REF.gc b/test/decompiler/reference/jak2/levels/city/misc/collection_task/collection-task_REF.gc index 533ba2194d..4a6fde48c4 100644 --- a/test/decompiler/reference/jak2/levels/city/misc/collection_task/collection-task_REF.gc +++ b/test/decompiler/reference/jak2/levels/city/misc/collection_task/collection-task_REF.gc @@ -126,7 +126,7 @@ (when target (set! (-> vec quad) (-> target control trans quad)) (set! (-> vec w) 4096.0) - (when (logtest? (focus-status pilot) (-> target focus-status)) + (when (focus-test? target pilot) (let ((vehicle (handle->process (-> target pilot vehicle)))) (set! (-> vec quad) (-> (the-as vehicle vehicle) root-override-2 root-prim prim-core world-sphere quad)) ) @@ -368,7 +368,7 @@ (lambda :behavior task-manager () (local-vars (moved-beyond-start? symbol)) - (until (or moved-beyond-start? (and *target* (logtest? (focus-status pilot) (-> *target* focus-status)))) + (until (or moved-beyond-start? (and *target* (focus-test? *target* pilot))) (suspend) (let ((min-start-distance 122880.0)) (set! moved-beyond-start? diff --git a/test/decompiler/reference/jak2/levels/city/misc/delivery/delivery-task_REF.gc b/test/decompiler/reference/jak2/levels/city/misc/delivery/delivery-task_REF.gc index 6ad5606bd4..3060f79e2a 100644 --- a/test/decompiler/reference/jak2/levels/city/misc/delivery/delivery-task_REF.gc +++ b/test/decompiler/reference/jak2/levels/city/misc/delivery/delivery-task_REF.gc @@ -75,7 +75,7 @@ (let ((gp-0 (handle->process (-> self attach-object)))) (cond (gp-0 - (when (logtest? (-> (the-as process-focusable gp-0) focus-status) (focus-status dead)) + (when (focus-test? (the-as process-focusable gp-0) dead) (seek! (-> self scale) 0.0 (* 0.5 (-> self clock seconds-per-frame))) (if (= (-> self scale) 0.0) (go-virtual die) @@ -384,7 +384,7 @@ This commonly includes things such as: (init-vf0-vector) (let ((gp-0 (handle->process (-> self slave 0)))) (cond - ((and gp-0 (zero? (logand (-> (the-as process-focusable gp-0) focus-status) (focus-status dead)))) + ((and gp-0 (not (logtest? (-> (the-as process-focusable gp-0) focus-status) (focus-status dead)))) (cond ((zero? (-> self data-int8 0)) (when (= (level-status *level* 'ctyindb) 'active) @@ -417,7 +417,7 @@ This commonly includes things such as: (f1-0 12288.0) ) (cond - ((and (< f0-0 (* f1-0 f1-0)) *target* (logtest? (focus-status pilot) (-> *target* focus-status))) + ((and (< f0-0 (* f1-0 f1-0)) *target* (focus-test? *target* pilot)) (when (nonzero? (-> self sub-state)) (send-event (handle->process (-> self arrow)) 'set-position (-> self end-pos)) (send-event (handle->process (-> self arrow)) 'modify-flags 1 0) @@ -556,7 +556,7 @@ This commonly includes things such as: () (send-event *traffic-manager* 'decrease-alert-level 0) (send-event *traffic-manager* 'set-alert-duration 9000) - (if (and *target* (logtest? (focus-status pilot) (-> *target* focus-status))) + (if (and *target* (focus-test? *target* pilot)) (send-event *target* 'change-mode 'normal) ) (set-setting! 'pilot #f 0 0) @@ -568,7 +568,3 @@ This commonly includes things such as: ) ) ) - - - - diff --git a/test/decompiler/reference/jak2/levels/city/onin_tent/onin-game_REF.gc b/test/decompiler/reference/jak2/levels/city/onin_tent/onin-game_REF.gc index 524905bd17..2b6bd8bab8 100644 --- a/test/decompiler/reference/jak2/levels/city/onin_tent/onin-game_REF.gc +++ b/test/decompiler/reference/jak2/levels/city/onin_tent/onin-game_REF.gc @@ -2660,7 +2660,7 @@ (send-event (handle->process (-> self hud-miss)) 'hide-and-die) (send-event (handle->process (-> self hud-goal)) 'hide-and-die) (remove-setting! 'entity-name) - (if (and *target* (logtest? (-> *target* focus-status) (focus-status grabbed))) + (if (and *target* (focus-test? *target* grabbed)) (process-release? *target*) ) (remove-setting! 'airlock) diff --git a/test/decompiler/reference/jak2/levels/city/oracle/oracle-training_REF.gc b/test/decompiler/reference/jak2/levels/city/oracle/oracle-training_REF.gc index 42972b025e..475fe67106 100644 --- a/test/decompiler/reference/jak2/levels/city/oracle/oracle-training_REF.gc +++ b/test/decompiler/reference/jak2/levels/city/oracle/oracle-training_REF.gc @@ -78,7 +78,7 @@ (function object) (lambda :behavior task-manager () - (if (and *target* (zero? (logand (focus-status dark) (-> *target* focus-status)))) + (if (and *target* (not (logtest? (focus-status dark) (-> *target* focus-status)))) (send-event *target* 'change-mode 'darkjak #f 65) ) (when (= (get-status *gui-control* (-> self sound-id 0)) (gui-status active)) @@ -184,7 +184,7 @@ (function object) (lambda :behavior task-manager () - (if (and *target* (zero? (logand (focus-status dark) (-> *target* focus-status)))) + (if (and *target* (not (logtest? (focus-status dark) (-> *target* focus-status)))) (send-event *target* 'change-mode 'darkjak #f 65) ) (when (= (get-status *gui-control* (-> self sound-id 0)) (gui-status active)) @@ -269,7 +269,7 @@ (function object) (lambda :behavior task-manager () - (if (and *target* (zero? (logand (focus-status dark) (-> *target* focus-status)))) + (if (and *target* (not (logtest? (focus-status dark) (-> *target* focus-status)))) (send-event *target* 'change-mode 'darkjak #f 65) ) (when (= (get-status *gui-control* (-> self sound-id 0)) (gui-status active)) @@ -376,7 +376,7 @@ (function object) (lambda :behavior task-manager () - (if (and *target* (zero? (logand (focus-status dark) (-> *target* focus-status)))) + (if (and *target* (not (logtest? (focus-status dark) (-> *target* focus-status)))) (send-event *target* 'change-mode 'darkjak #f 65) ) (when (= (get-status *gui-control* (-> self sound-id 0)) (gui-status active)) diff --git a/test/decompiler/reference/jak2/levels/city/port/race/errol-chal_REF.gc b/test/decompiler/reference/jak2/levels/city/port/race/errol-chal_REF.gc index 8d8610a60e..79dd25d2a2 100644 --- a/test/decompiler/reference/jak2/levels/city/port/race/errol-chal_REF.gc +++ b/test/decompiler/reference/jak2/levels/city/port/race/errol-chal_REF.gc @@ -580,7 +580,7 @@ (if (or (< (* f0-0 f0-0) (-> obj player-dist2)) (let ((f0-3 102400.0)) (and (< (* f0-3 f0-3) (-> obj player-dist2)) - (zero? (logand (-> obj draw status) (draw-control-status on-screen))) + (not (logtest? (-> obj draw status) (draw-control-status on-screen))) ) ) ) @@ -919,7 +919,7 @@ (>= (- (-> self clock frame-counter) (-> self touch-time)) (seconds 3)) (or (not *target*) (or (< 204800.0 (vector-vector-distance (-> self root-override trans) (-> *target* control trans))) - (logtest? (focus-status teleporting) (-> *target* focus-status)) + (focus-test? *target* teleporting) ) ) (not (-> self persistent)) diff --git a/test/decompiler/reference/jak2/levels/city/side_missions/ctywide-bbush_REF.gc b/test/decompiler/reference/jak2/levels/city/side_missions/ctywide-bbush_REF.gc index d3f2514ea3..d140ac3d60 100644 --- a/test/decompiler/reference/jak2/levels/city/side_missions/ctywide-bbush_REF.gc +++ b/test/decompiler/reference/jak2/levels/city/side_missions/ctywide-bbush_REF.gc @@ -446,7 +446,7 @@ (when v1-17 (set! (-> gp-1 quad) (-> v1-17 control trans quad)) (set! (-> gp-1 w) 4096.0) - (when (logtest? (focus-status pilot) (-> v1-17 focus-status)) + (when (focus-test? v1-17 pilot) (let ((a1-8 (handle->process (-> v1-17 pilot vehicle)))) (set! (-> gp-1 quad) (-> (the-as process-focusable a1-8) root-override root-prim prim-core world-sphere quad)) ) @@ -3029,7 +3029,7 @@ This commonly includes things such as: 5 (the-as (function object) (lambda :behavior task-manager () - (if (and *target* (logtest? (-> *target* focus-status) (focus-status grabbed))) + (if (and *target* (focus-test? *target* grabbed)) (process-release? *target*) ) (none) diff --git a/test/decompiler/reference/jak2/levels/city/slums/kor/kid-states_REF.gc b/test/decompiler/reference/jak2/levels/city/slums/kor/kid-states_REF.gc index 338e8dbdcf..70f9b7265b 100644 --- a/test/decompiler/reference/jak2/levels/city/slums/kor/kid-states_REF.gc +++ b/test/decompiler/reference/jak2/levels/city/slums/kor/kid-states_REF.gc @@ -40,7 +40,7 @@ ) ) (label cfg-15) - (when (not (logtest? (-> self focus-status) (focus-status grabbed))) + (when (not (focus-test? self grabbed)) (if (not (outside-spot-radius? self (the-as bot-spot #f) (the-as vector #f) #f)) (go-virtual traveling) ) @@ -100,7 +100,7 @@ ) :trans (behavior () (bot-method-223 self #f) - (when (not (logtest? (-> self focus-status) (focus-status grabbed))) + (when (not (focus-test? self grabbed)) (if (and (not (outside-spot-radius? self (the-as bot-spot #f) (the-as vector #f) #f)) (let ((gp-0 (handle->process (-> self arrestor-handle)))) (not (if (type? gp-0 process-focusable) @@ -231,7 +231,7 @@ :exit (-> (method-of-type kid waiting-idle) exit) :trans (behavior () (bot-method-223 self #f) - (when (not (logtest? (-> self focus-status) (focus-status grabbed))) + (when (not (focus-test? self grabbed)) (if (not (outside-spot-radius? self (the-as bot-spot #f) (the-as vector #f) #f)) (go-virtual traveling) ) @@ -281,7 +281,7 @@ ) ) (label cfg-15) - (when (not (logtest? (-> self focus-status) (focus-status grabbed))) + (when (not (focus-test? self grabbed)) (if (not (outside-spot-radius? self (the-as bot-spot #f) (the-as vector #f) #f)) (go-virtual traveling) ) @@ -566,7 +566,7 @@ (if (and (-> self focus-info fproc) (>= (fabs (-> self focus-info ry-diff)) 9102.223)) (kid-method-233 self) ) - (when (not (logtest? (-> self focus-status) (focus-status grabbed))) + (when (not (focus-test? self grabbed)) (let ((gp-0 (handle->process (-> self arrestor-handle)))) (if (not (if (type? gp-0 process-focusable) gp-0 diff --git a/test/decompiler/reference/jak2/levels/city/slums/kor/kid_REF.gc b/test/decompiler/reference/jak2/levels/city/slums/kor/kid_REF.gc index 1050df3069..7fd00f2c0f 100644 --- a/test/decompiler/reference/jak2/levels/city/slums/kor/kid_REF.gc +++ b/test/decompiler/reference/jak2/levels/city/slums/kor/kid_REF.gc @@ -267,7 +267,7 @@ ) (when s4-1 (when (or (>= (- (-> pp clock frame-counter) (-> obj arrest-attempt-time)) (seconds 0.5)) - (logtest? (-> (the-as process-focusable s4-1) focus-status) (focus-status dead hit)) + (focus-test? (the-as process-focusable s4-1) dead hit) ) (set! s4-1 (the-as process #f)) (set! (-> obj arrestor-handle) (the-as handle #f)) @@ -359,7 +359,7 @@ ) ) ) - (zero? (logand (bot-flags bf20) (-> obj bot-flags))) + (not (logtest? (bot-flags bf20) (-> obj bot-flags))) ) ) ) @@ -628,7 +628,7 @@ ((and (-> obj next-state) (= (-> obj next-state name) 'arrested)) (set-vector! arg0 49152.0 12288.0 49152.0 1.0) (vector<-cspace+vector! arg0 (-> obj node-list data 2) arg0) - (if (logtest? (-> obj focus-status) (focus-status under-water)) + (if (focus-test? obj under-water) (set! (-> arg0 y) (+ (get-water-height obj) (-> *setting-control* cam-current target-height))) ) ) diff --git a/test/decompiler/reference/jak2/levels/city/slums/kor/kor-states_REF.gc b/test/decompiler/reference/jak2/levels/city/slums/kor/kor-states_REF.gc index 648fc27588..8022a0bc0f 100644 --- a/test/decompiler/reference/jak2/levels/city/slums/kor/kor-states_REF.gc +++ b/test/decompiler/reference/jak2/levels/city/slums/kor/kor-states_REF.gc @@ -40,7 +40,7 @@ ) ) (label cfg-15) - (when (not (logtest? (-> self focus-status) (focus-status grabbed))) + (when (not (focus-test? self grabbed)) (if (not (outside-spot-radius? self (the-as bot-spot #f) (the-as vector #f) #f)) (go-virtual traveling) ) @@ -101,7 +101,7 @@ ) :trans (behavior () (bot-method-223 self #f) - (when (not (logtest? (-> self focus-status) (focus-status grabbed))) + (when (not (focus-test? self grabbed)) (if (and (not (outside-spot-radius? self (the-as bot-spot #f) (the-as vector #f) #f)) (let ((gp-0 (handle->process (-> self arrestor-handle)))) (not (if (type? gp-0 process-focusable) @@ -242,7 +242,7 @@ :exit (-> (method-of-type kor waiting-idle) exit) :trans (behavior () (bot-method-223 self #f) - (when (not (logtest? (-> self focus-status) (focus-status grabbed))) + (when (not (focus-test? self grabbed)) (if (not (outside-spot-radius? self (the-as bot-spot #f) (the-as vector #f) #f)) (go-virtual traveling) ) @@ -292,7 +292,7 @@ ) ) (label cfg-15) - (when (not (logtest? (-> self focus-status) (focus-status grabbed))) + (when (not (focus-test? self grabbed)) (if (not (outside-spot-radius? self (the-as bot-spot #f) (the-as vector #f) #f)) (go-virtual traveling) ) @@ -577,7 +577,7 @@ (if (and (-> self focus-info fproc) (>= (fabs (-> self focus-info ry-diff)) 9102.223)) (kor-method-233 self) ) - (when (not (logtest? (-> self focus-status) (focus-status grabbed))) + (when (not (focus-test? self grabbed)) (let ((gp-0 (handle->process (-> self arrestor-handle)))) (if (not (if (type? gp-0 process-focusable) gp-0 diff --git a/test/decompiler/reference/jak2/levels/city/slums/kor/kor_REF.gc b/test/decompiler/reference/jak2/levels/city/slums/kor/kor_REF.gc index e37a8799f9..cdad783426 100644 --- a/test/decompiler/reference/jak2/levels/city/slums/kor/kor_REF.gc +++ b/test/decompiler/reference/jak2/levels/city/slums/kor/kor_REF.gc @@ -283,7 +283,7 @@ ) (when s4-1 (when (or (>= (- (-> pp clock frame-counter) (-> obj arrest-attempt-time)) (seconds 0.5)) - (logtest? (-> (the-as process-focusable s4-1) focus-status) (focus-status dead hit)) + (focus-test? (the-as process-focusable s4-1) dead hit) ) (set! s4-1 (the-as process #f)) (set! (-> obj arrestor-handle) (the-as handle #f)) @@ -375,7 +375,7 @@ ) ) ) - (zero? (logand (bot-flags bf20) (-> obj bot-flags))) + (not (logtest? (bot-flags bf20) (-> obj bot-flags))) ) ) ) @@ -641,7 +641,7 @@ ((and (-> obj next-state) (= (-> obj next-state name) 'arrested)) (set-vector! arg0 49152.0 12288.0 49152.0 1.0) (vector<-cspace+vector! arg0 (-> obj node-list data 2) arg0) - (if (logtest? (-> obj focus-status) (focus-status under-water)) + (if (focus-test? obj under-water) (set! (-> arg0 y) (+ (get-water-height obj) (-> *setting-control* cam-current target-height))) ) ) diff --git a/test/decompiler/reference/jak2/levels/common/ai/bot_REF.gc b/test/decompiler/reference/jak2/levels/common/ai/bot_REF.gc index b9403b34cd..466ab678e6 100644 --- a/test/decompiler/reference/jak2/levels/common/ai/bot_REF.gc +++ b/test/decompiler/reference/jak2/levels/common/ai/bot_REF.gc @@ -157,7 +157,7 @@ ) ) ) - ((and (logtest? #x10000 v1-0) (zero? (logand #x20000 v1-0))) + ((and (logtest? #x10000 v1-0) (not (logtest? #x20000 v1-0))) (set! gp-0 #t) ) ) @@ -370,7 +370,7 @@ (set! v0-0 (-> obj hit-points)) ) (else - (if (and (logtest? (-> obj bot-flags) (bot-flags bf04)) (zero? (logand (-> obj bot-flags) (bot-flags attacked)))) + (if (and (logtest? (-> obj bot-flags) (bot-flags bf04)) (not (logtest? (-> obj bot-flags) (bot-flags attacked)))) (set! v0-0 0) ) ) @@ -423,7 +423,7 @@ "Were we attacked by the player?" (the-as symbol - (and (and fproc (zero? (logand (-> fproc focus-status) (focus-status disable dead ignore grabbed)))) + (and (and fproc (not (logtest? (-> fproc focus-status) (focus-status disable dead ignore grabbed)))) (or (logtest? (process-mask enemy) (-> fproc mask)) (and (logtest? (-> fproc mask) (process-mask target)) (logtest? (-> obj bot-flags) (bot-flags attacked))) ) @@ -697,7 +697,7 @@ ) (if (and enemy enemy - (zero? (logand (-> (the-as process-focusable enemy) focus-status) (focus-status disable dead))) + (not (logtest? (-> (the-as process-focusable enemy) focus-status) (focus-status disable dead))) ) (set-next-focus! obj (the-as enemy enemy) focus) ) @@ -729,10 +729,7 @@ ;; definition for method 183 of type bot (defmethod alive? bot ((obj bot)) - (and (not (logtest? (-> obj focus-status) (focus-status dead grabbed))) - (nonzero? (-> obj hit-points)) - (zero? (-> obj fated-time)) - ) + (and (not (focus-test? obj dead grabbed)) (nonzero? (-> obj hit-points)) (zero? (-> obj fated-time))) ) ;; definition for method 74 of type bot @@ -823,7 +820,7 @@ ((>= (the-as int a0-19) 0) (let ((v1-29 (the-as object (-> arg3 param 1)))) (cond - ((logtest? (focus-status pilot) (-> obj focus-status)) + ((focus-test? obj pilot) (if (= (-> obj vehicle-seat-index) a0-19) (= (the-as uint v1-29) (handle->process (-> obj vehicle-handle))) ) @@ -838,7 +835,7 @@ ) ) (else - (when (not (logtest? (focus-status pilot) (-> obj focus-status))) + (when (not (focus-test? obj pilot)) (set! (-> obj vehicle-seat-index) -1) (set! (-> obj vehicle-handle) (the-as handle #f)) (logclear! (-> obj bot-flags) (bot-flags bf15)) @@ -849,7 +846,7 @@ ) ) (('exit-vehicle) - (when (logtest? (focus-status pilot) (-> obj focus-status)) + (when (focus-test? obj pilot) (let ((v1-43 (-> arg3 param 1)) (s5-1 (-> arg3 param 2)) ) @@ -930,7 +927,7 @@ ) ) ((= v1-0 'end-mode) - (when (logtest? (-> obj focus-status) (focus-status grabbed)) + (when (focus-test? obj grabbed) (logclear! (-> obj focus-status) (focus-status grabbed)) #t ) @@ -972,7 +969,7 @@ ;; definition for method 104 of type bot (defmethod enemy-method-104 bot ((obj bot) (arg0 process) (arg1 uint) (arg2 uint)) (cond - ((and (= (-> arg0 type) target) (zero? (logand (-> obj bot-flags) (bot-flags attacked)))) + ((and (= (-> arg0 type) target) (not (logtest? (-> obj bot-flags) (bot-flags attacked)))) (let ((a1-1 (new 'stack-no-clear 'event-message-block))) (set! (-> a1-1 from) (process->ppointer self)) (set! (-> a1-1 num-params) 2) @@ -1040,10 +1037,10 @@ ) ) (cond - ((and (logtest? (-> obj focus-status) (focus-status dangerous)) + ((and (focus-test? obj dangerous) (logtest? (process-mask enemy) (-> arg0 mask)) (and v1-6 - (zero? (logand (-> (the-as process-focusable v1-6) focus-status) (focus-status disable dead ignore grabbed))) + (not (logtest? (-> (the-as process-focusable v1-6) focus-status) (focus-status disable dead ignore grabbed))) ) ((method-of-type touching-shapes-entry prims-touching-action?) (the-as touching-shapes-entry s3-0) @@ -1128,7 +1125,7 @@ If the player is too far, play a warning speech." ((> too-far-check 0) (set! (-> obj delay-too-far-check) (+ too-far-check -1)) ) - ((and (zero? too-far-check) *target* (zero? (logand (-> obj focus-status) (focus-status grabbed)))) + ((and (zero? too-far-check) *target* (not (logtest? (-> obj focus-status) (focus-status grabbed)))) (let ((check-too-far-func (the-as object (-> obj waypoint check-too-far)))) (if (not (the-as symbol check-too-far-func)) (set! check-too-far-func (-> obj course default-check-too-far)) @@ -1236,7 +1233,7 @@ If the player is too far, play a warning speech." ) ) ) - (if (and (bot-check-too-far obj) (zero? (logand (-> obj bot-flags) (bot-flags bf09)))) + (if (and (bot-check-too-far obj) (not (logtest? (-> obj bot-flags) (bot-flags bf09)))) (go (method-of-object obj failed)) ) (if (not (logtest? (-> obj bot-flags) (bot-flags bf09))) @@ -1400,7 +1397,7 @@ If the player is too far, play a warning speech." (countdown (s4-0 (-> v1-0 course speech-count)) (let ((s3-0 (-> s5-0 s4-0))) (if (string= (-> s3-0 name) (-> arg0 name)) - (return (zero? (logand (-> s3-0 flags) (speech-flags sf01)))) + (return (not (logtest? (-> s3-0 flags) (speech-flags sf01)))) ) ) ) @@ -1585,7 +1582,7 @@ If the player is too far, play a warning speech." (and fproc (= (-> obj focus aware) (enemy-aware enemy-aware-3)) (attacked-by-player? obj (the-as process-focusable fproc)) - (zero? (logand (-> obj focus-status) (focus-status grabbed))) + (not (logtest? (-> obj focus-status) (focus-status grabbed))) ) ) ) @@ -1932,7 +1929,7 @@ If the player is too far, play a warning speech." (vector<-cspace+vector! arg0 (-> obj node-list data 2) arg0) (the-as meters - (if (logtest? (-> obj focus-status) (focus-status under-water)) + (if (focus-test? obj under-water) (set! (-> arg0 y) (+ (get-water-height obj) (-> *setting-control* cam-current target-height))) ) ) @@ -1981,7 +1978,7 @@ If the player is too far, play a warning speech." ) ) ) - (if (logtest? (-> obj focus-status) (focus-status ignore)) + (if (focus-test? obj ignore) (set! v1-0 (cond ((>= (- (-> pp clock frame-counter) a1-0) (the-as time-frame (-> obj hit-invuln-ignore-me-delay))) @@ -1994,7 +1991,7 @@ If the player is too far, play a warning speech." ) ) ) - (if (logtest? (-> obj focus-status) (focus-status disable)) + (if (focus-test? obj disable) (set! v1-0 (cond ((>= (- (-> pp clock frame-counter) a1-0) (the-as time-frame (-> obj hit-invuln-focus-disable-delay))) diff --git a/test/decompiler/reference/jak2/levels/common/airlock_REF.gc b/test/decompiler/reference/jak2/levels/common/airlock_REF.gc index 46d09cae00..15474f5f7f 100644 --- a/test/decompiler/reference/jak2/levels/common/airlock_REF.gc +++ b/test/decompiler/reference/jak2/levels/common/airlock_REF.gc @@ -235,9 +235,7 @@ (set! (-> obj were-behind?) #t) ) (and (< (-> obj latch-closed-time) (-> self clock frame-counter)) - (or (not (and *target* (logtest? (focus-status pilot teleporting) (-> *target* focus-status)))) - (< f30-0 -409.6) - ) + (or (not (and *target* (focus-test? *target* pilot teleporting))) (< f30-0 -409.6)) (or (and (< f30-0 (-> obj open-distance)) (or (not (-> obj were-behind?)) (< f30-0 20480.0)) (and (or (< 409.6 f30-0) @@ -254,7 +252,7 @@ ) s5-0 (let ((f0-8 (check-crossing-distance obj (camera-pos) #f))) - (and (or (not *target*) (zero? (logand (-> *target* focus-status) (focus-status in-head)))) + (and (or (not *target*) (not (logtest? (-> *target* focus-status) (focus-status in-head)))) (or (< (* f30-0 f0-8) 0.0) (and (< (fabs f0-8) 4096.0) (< (vector-vector-xz-distance (camera-pos) (-> obj root-override trans)) (-> obj door-radius)) diff --git a/test/decompiler/reference/jak2/levels/common/battle_REF.gc b/test/decompiler/reference/jak2/levels/common/battle_REF.gc index cc3e2db29c..f52ccd6a02 100644 --- a/test/decompiler/reference/jak2/levels/common/battle_REF.gc +++ b/test/decompiler/reference/jak2/levels/common/battle_REF.gc @@ -1343,7 +1343,7 @@ ;; definition for method 51 of type battle (defmethod battle-method-51 battle ((obj battle) (arg0 battle-spawner) (arg1 symbol)) - (when (and (logtest? (-> obj flags) 2) (zero? (logand (-> obj flags) 4))) + (when (and (logtest? (-> obj flags) 2) (not (logtest? (-> obj flags) 4))) (let ((v1-5 (-> arg0 noticed-attack-time))) (cond ((zero? v1-5) @@ -1535,7 +1535,7 @@ (if (and (logtest? v1-1 2) (not (and *target* (and (>= (-> self info notice-distance) (vector-vector-distance (-> self root trans) (-> *target* control trans))) - (zero? (logand (focus-status teleporting) (-> *target* focus-status))) + (not (logtest? (focus-status teleporting) (-> *target* focus-status))) ) ) ) @@ -1739,7 +1739,7 @@ ;; WARN: Return type mismatch uint vs none. (defmethod battle-method-47 battle ((obj battle)) (let ((a3-0 (-> obj info play-battle-music))) - (when (and a3-0 (zero? (logand (-> obj flags) 16))) + (when (and a3-0 (not (logtest? (-> obj flags) 16))) (case a3-0 (('sound-mode) (set-setting! 'sound-mode #f 0 1) diff --git a/test/decompiler/reference/jak2/levels/common/elec-gate_REF.gc b/test/decompiler/reference/jak2/levels/common/elec-gate_REF.gc index d3d082a504..0fb8b90ccc 100644 --- a/test/decompiler/reference/jak2/levels/common/elec-gate_REF.gc +++ b/test/decompiler/reference/jak2/levels/common/elec-gate_REF.gc @@ -463,7 +463,7 @@ (set! (-> attack vector quad) (-> s4-0 dir quad)) (set! (-> attack shove-back) 24576.0) (set! (-> attack shove-up) 12288.0) - (set! (-> attack control) (if (logtest? (focus-status board) (-> proc-focus focus-status)) + (set! (-> attack control) (if (focus-test? proc-focus board) 1.0 0.0 ) diff --git a/test/decompiler/reference/jak2/levels/common/enemy/amphibian/amphibian_REF.gc b/test/decompiler/reference/jak2/levels/common/enemy/amphibian/amphibian_REF.gc index 7eb47ce197..0ef9ced1ee 100644 --- a/test/decompiler/reference/jak2/levels/common/enemy/amphibian/amphibian_REF.gc +++ b/test/decompiler/reference/jak2/levels/common/enemy/amphibian/amphibian_REF.gc @@ -671,18 +671,18 @@ (logior! (-> obj focus-status) (focus-status touch-water under-water)) ) (else - (when (logtest? (-> obj focus-status) (focus-status touch-water)) + (when (focus-test? obj touch-water) (let ((s3-0 (new 'stack-no-clear 'water-info))) (water-info-init! (-> obj root-override2) s3-0 (collide-action solid semi-solid)) (let ((v1-12 #f)) (cond ((not (logtest? (water-flags touch-water) (-> s3-0 flags))) - (if (logtest? (-> obj focus-status) (focus-status under-water)) + (if (focus-test? obj under-water) (set! v1-12 #t) ) (logclear! (-> obj focus-status) (focus-status touch-water under-water)) ) - ((logtest? (-> obj focus-status) (focus-status under-water)) + ((focus-test? obj under-water) (let* ((a0-18 (-> obj root-override2 root-prim prim-core)) (f0-1 (+ (-> a0-18 world-sphere y) (-> a0-18 world-sphere w))) ) diff --git a/test/decompiler/reference/jak2/levels/common/enemy/baby_spider/tomb-baby-spider_REF.gc b/test/decompiler/reference/jak2/levels/common/enemy/baby_spider/tomb-baby-spider_REF.gc index 09aed50020..636eefb6c9 100644 --- a/test/decompiler/reference/jak2/levels/common/enemy/baby_spider/tomb-baby-spider_REF.gc +++ b/test/decompiler/reference/jak2/levels/common/enemy/baby_spider/tomb-baby-spider_REF.gc @@ -690,7 +690,7 @@ ) (f0-0 1.0) ) - (if (and (= s2-0 v1-0) (logtest? (focus-status indax) (-> v1-0 focus-status))) + (if (and (= s2-0 v1-0) (focus-test? v1-0 indax)) (set! f0-0 0.6) ) (let ((a1-5 (new 'stack-no-clear 'event-message-block))) diff --git a/test/decompiler/reference/jak2/levels/common/enemy/bombots/bombbot_REF.gc b/test/decompiler/reference/jak2/levels/common/enemy/bombots/bombbot_REF.gc index 190855320c..e9420ea5ae 100644 --- a/test/decompiler/reference/jak2/levels/common/enemy/bombots/bombbot_REF.gc +++ b/test/decompiler/reference/jak2/levels/common/enemy/bombots/bombbot_REF.gc @@ -1552,14 +1552,14 @@ ) (when (and s1-1 (!= obj s1-1) - (not (logtest? (-> obj focus-status) (focus-status inactive))) - (not (logtest? (-> obj focus-status) (focus-status disable))) - (not (logtest? (-> obj focus-status) (focus-status dead))) + (not (focus-test? obj inactive)) + (not (focus-test? obj disable)) + (not (focus-test? obj dead)) (not (logtest? (process-mask guard) (-> s1-1 mask))) (not (logtest? (process-mask crate) (-> s1-1 mask))) (logtest? (process-mask vehicle) (-> s1-1 mask)) s1-1 - (zero? (logand (-> (the-as process-focusable s1-1) focus-status) (focus-status disable dead ignore grabbed))) + (not (logtest? (-> (the-as process-focusable s1-1) focus-status) (focus-status disable dead ignore grabbed))) ) (let ((f0-0 (vector-vector-xz-distance (-> obj root-override2 trans) (-> s1-1 root trans)))) (when (or (not gp-0) (< f0-0 f30-0)) @@ -1934,7 +1934,7 @@ ) (when (and s2-0 s2-0 - (zero? (logand (-> (the-as process-focusable s2-0) focus-status) (focus-status disable dead ignore grabbed))) + (not (logtest? (-> (the-as process-focusable s2-0) focus-status) (focus-status disable dead ignore grabbed))) ) (let ((s2-1 (new 'stack-no-clear 'projectile-init-by-other-params))) (set! (-> s2-1 ent) (-> obj entity)) @@ -3404,7 +3404,7 @@ (lambda :behavior task-manager () (when (and *target* - (not (logtest? (-> *target* focus-status) (focus-status dead))) + (not (focus-test? *target* dead)) (zero? (-> self data-int32 1)) (nonzero? (-> self data-int32 0)) ) diff --git a/test/decompiler/reference/jak2/levels/common/enemy/fodder/fodder_REF.gc b/test/decompiler/reference/jak2/levels/common/enemy/fodder/fodder_REF.gc index d0906a915c..2083a33c90 100644 --- a/test/decompiler/reference/jak2/levels/common/enemy/fodder/fodder_REF.gc +++ b/test/decompiler/reference/jak2/levels/common/enemy/fodder/fodder_REF.gc @@ -1239,5 +1239,5 @@ ;; definition for method 99 of type fodder (defmethod enemy-method-99 fodder ((obj fodder) (arg0 process-focusable)) - (logtest? (focus-status mech) (-> arg0 focus-status)) + (focus-test? arg0 mech) ) diff --git a/test/decompiler/reference/jak2/levels/common/enemy/guards/crimson-guard-level_REF.gc b/test/decompiler/reference/jak2/levels/common/enemy/guards/crimson-guard-level_REF.gc index 1574f4ae97..2e389e4043 100644 --- a/test/decompiler/reference/jak2/levels/common/enemy/guards/crimson-guard-level_REF.gc +++ b/test/decompiler/reference/jak2/levels/common/enemy/guards/crimson-guard-level_REF.gc @@ -1269,7 +1269,7 @@ ) (when (= a0-21 'attack) (when (logtest? (-> (the-as process-focusable v1-16) mask) (process-mask target)) - (if (logtest? (-> (the-as process-focusable v1-16) focus-status) (focus-status dead)) + (if (focus-test? (the-as process-focusable v1-16) dead) (speech-control-method-12 *speech-control* obj (speech-type speech-type-1 speech-type-3)) ) ) @@ -2276,7 +2276,7 @@ (let ((v1-4 (handle->process (-> self focus handle)))) (when v1-4 (when (not (and v1-4 - (zero? (logand (-> (the-as process-focusable v1-4) focus-status) (focus-status disable dead ignore grabbed))) + (not (logtest? (-> (the-as process-focusable v1-4) focus-status) (focus-status disable dead ignore grabbed))) ) ) (if (logtest? (-> self flags) 4) @@ -3172,10 +3172,10 @@ (cond ((and (crimson-guard-level-method-193 self) (handle->process (-> self focus handle)) - (zero? (logand (-> (the-as process-focusable (handle->process (-> self focus handle))) focus-status) + (not (logtest? (-> (the-as process-focusable (handle->process (-> self focus handle))) focus-status) (focus-status disable dead ignore grabbed) ) - ) + ) ) (cond ((< (-> self target-self-xz-dist) 16384.0) diff --git a/test/decompiler/reference/jak2/levels/common/enemy/hopper_REF.gc b/test/decompiler/reference/jak2/levels/common/enemy/hopper_REF.gc index 8f010019bc..c2a0478a15 100644 --- a/test/decompiler/reference/jak2/levels/common/enemy/hopper_REF.gc +++ b/test/decompiler/reference/jak2/levels/common/enemy/hopper_REF.gc @@ -426,18 +426,18 @@ (logior! (-> obj focus-status) (focus-status touch-water under-water)) ) (else - (when (logtest? (-> obj focus-status) (focus-status touch-water)) + (when (focus-test? obj touch-water) (let ((s3-0 (new 'stack-no-clear 'water-info))) (water-info-init! (-> obj root-override2) s3-0 (collide-action solid semi-solid)) (let ((v1-9 #f)) (cond ((not (logtest? (water-flags touch-water) (-> s3-0 flags))) - (if (logtest? (-> obj focus-status) (focus-status under-water)) + (if (focus-test? obj under-water) (set! v1-9 #t) ) (logclear! (-> obj focus-status) (focus-status touch-water under-water)) ) - ((logtest? (-> obj focus-status) (focus-status under-water)) + ((focus-test? obj under-water) (let ((f0-1 (+ 11264.0 (-> obj root-override2 trans y)))) (if (< (-> s3-0 trans y) f0-1) (set! v1-9 #t) diff --git a/test/decompiler/reference/jak2/levels/common/enemy/hover/crimson-guard-hover_REF.gc b/test/decompiler/reference/jak2/levels/common/enemy/hover/crimson-guard-hover_REF.gc index ff246d32b8..c03a3db7ba 100644 --- a/test/decompiler/reference/jak2/levels/common/enemy/hover/crimson-guard-hover_REF.gc +++ b/test/decompiler/reference/jak2/levels/common/enemy/hover/crimson-guard-hover_REF.gc @@ -1334,7 +1334,7 @@ ) (when (= (the-as symbol a0-27) 'attack) (when (logtest? (-> (the-as process-focusable v1-31) mask) (process-mask target)) - (if (and (logtest? (-> (the-as process-focusable v1-31) focus-status) (focus-status dead)) + (if (and (focus-test? (the-as process-focusable v1-31) dead) (let ((f0-1 (vector-vector-distance-squared (-> obj root-override2 trans) (-> obj focus-pos))) (f1-3 122880.0) ) @@ -2044,7 +2044,3 @@ 0 (none) ) - - - - diff --git a/test/decompiler/reference/jak2/levels/common/enemy/hover/wasp_REF.gc b/test/decompiler/reference/jak2/levels/common/enemy/hover/wasp_REF.gc index e47482a7bd..11025bc346 100644 --- a/test/decompiler/reference/jak2/levels/common/enemy/hover/wasp_REF.gc +++ b/test/decompiler/reference/jak2/levels/common/enemy/hover/wasp_REF.gc @@ -1206,7 +1206,7 @@ (s3-2 (vector-normalize-copy! (new 'stack-no-clear 'vector) s3-1 1.0)) ) (if (and (and s5-0 - (zero? (logand (-> (the-as process-focusable s5-0) focus-status) (focus-status disable dead ignore grabbed))) + (not (logtest? (-> (the-as process-focusable s5-0) focus-status) (focus-status disable dead ignore grabbed))) ) (< 0.0 (vector-dot s2-1 s3-2)) (< (vector-vector-distance s4-1 (-> obj focus-pos)) 225280.0) @@ -1699,7 +1699,3 @@ 0 (none) ) - - - - diff --git a/test/decompiler/reference/jak2/levels/common/enemy/metalhead_bearer/centurion_REF.gc b/test/decompiler/reference/jak2/levels/common/enemy/metalhead_bearer/centurion_REF.gc index 569cf6c3c6..90274374a6 100644 --- a/test/decompiler/reference/jak2/levels/common/enemy/metalhead_bearer/centurion_REF.gc +++ b/test/decompiler/reference/jak2/levels/common/enemy/metalhead_bearer/centurion_REF.gc @@ -585,7 +585,7 @@ (if (and (not (and (-> obj next-state) (= (-> obj next-state name) 'victory))) (and (> (-> obj hit-points) 0) (zero? (-> obj fated-time)) - (zero? (logand (-> obj focus-status) (focus-status grabbed))) + (not (logtest? (-> obj focus-status) (focus-status grabbed))) ) ) (go (method-of-object obj victory)) diff --git a/test/decompiler/reference/jak2/levels/common/enemy/metalhead_slinger/grenadier_REF.gc b/test/decompiler/reference/jak2/levels/common/enemy/metalhead_slinger/grenadier_REF.gc index 5ab2ec28c0..aa5d46a9dd 100644 --- a/test/decompiler/reference/jak2/levels/common/enemy/metalhead_slinger/grenadier_REF.gc +++ b/test/decompiler/reference/jak2/levels/common/enemy/metalhead_slinger/grenadier_REF.gc @@ -615,10 +615,10 @@ (>= 8192.0 (vector-vector-xz-distance (-> self root-override2 trans) (-> self bank final-pos))) ) (if (and (handle->process (-> self focus handle)) - (zero? (logand (-> (the-as process-focusable (handle->process (-> self focus handle))) focus-status) + (not (logtest? (-> (the-as process-focusable (handle->process (-> self focus handle))) focus-status) (focus-status disable dead ignore grabbed) ) - ) + ) ) (go-virtual attack) (go-stare self) @@ -1160,10 +1160,10 @@ (cond ((= (-> self focus aware) (enemy-aware enemy-aware-3)) (if (and (handle->process (-> self focus handle)) - (zero? (logand (-> (the-as process-focusable (handle->process (-> self focus handle))) focus-status) + (not (logtest? (-> (the-as process-focusable (handle->process (-> self focus handle))) focus-status) (focus-status disable dead ignore grabbed) ) - ) + ) ) (go-virtual attack) ) @@ -1182,10 +1182,10 @@ (if (and (and (-> obj next-state) (= (-> obj next-state name) 'knocked)) (and (logtest? (-> obj status-flags) 1) (handle->process (-> obj focus handle)) - (zero? (logand (-> (the-as process-focusable (handle->process (-> obj focus handle))) focus-status) + (not (logtest? (-> (the-as process-focusable (handle->process (-> obj focus handle))) focus-status) (focus-status disable dead ignore grabbed) ) - ) + ) ) ) (go (method-of-object obj attack)) diff --git a/test/decompiler/reference/jak2/levels/common/entities/gun-buoy_REF.gc b/test/decompiler/reference/jak2/levels/common/entities/gun-buoy_REF.gc index acfd13534e..6aed9b6269 100644 --- a/test/decompiler/reference/jak2/levels/common/entities/gun-buoy_REF.gc +++ b/test/decompiler/reference/jak2/levels/common/entities/gun-buoy_REF.gc @@ -507,7 +507,7 @@ (s3-0 (let ((s4-0 (new 'stack-no-clear 'vector))) (set! (-> s4-0 quad) (-> (get-trans s3-0 1) quad)) - (let ((gp-2 (logtest? (focus-status board) (-> s3-0 focus-status))) + (let ((gp-2 (focus-test? s3-0 board)) (s5-0 (-> self offset-from-player)) ) (set! (-> s4-0 y) (fmax (-> s4-0 y) (-> s3-0 water height))) @@ -660,7 +660,7 @@ ) ) ) - (if (and a0-6 (logtest? (focus-status board) (-> (the-as process-focusable a0-6) focus-status))) + (if (and a0-6 (focus-test? (the-as process-focusable a0-6) board)) (set! f30-0 (* 2.0 f30-0)) ) ) @@ -770,7 +770,7 @@ ) ) (cond - ((logtest? (focus-status board) (-> (the-as process-focusable v1-6) focus-status)) + ((focus-test? (the-as process-focusable v1-6) board) (set! (-> self warning-interval) (seconds 0.5)) ) (else @@ -901,7 +901,7 @@ ) ) ) - (if (and gp-0 (logtest? (-> (the-as process-focusable gp-0) focus-status) (focus-status dead))) + (if (and gp-0 (focus-test? (the-as process-focusable gp-0) dead)) (go-virtual victory) ) (if (not (and gp-0 (-> *setting-control* user-current gun-buoy))) @@ -1116,7 +1116,7 @@ ) (let ((v1-12 arg0)) (and v1-12 - (or (logtest? (-> v1-12 focus-status) (focus-status on-water under-water)) + (or (focus-test? v1-12 on-water under-water) (= (-> (the-as collide-shape-moving (-> v1-12 root-override)) ground-pat material) (pat-material waterbottom)) ) ) @@ -1140,7 +1140,7 @@ v1-19 ) (and (and v1-19 - (or (logtest? (-> v1-19 focus-status) (focus-status on-water under-water)) + (or (focus-test? v1-19 on-water under-water) (= (-> (the-as collide-shape-moving (-> v1-19 root-override)) ground-pat material) (pat-material waterbottom)) ) ) @@ -1392,7 +1392,3 @@ (set! (-> obj warning-id) (the-as sound-id -1)) (none) ) - - - - diff --git a/test/decompiler/reference/jak2/levels/common/flitter_REF.gc b/test/decompiler/reference/jak2/levels/common/flitter_REF.gc index 435976f765..e5aebfbdfa 100644 --- a/test/decompiler/reference/jak2/levels/common/flitter_REF.gc +++ b/test/decompiler/reference/jak2/levels/common/flitter_REF.gc @@ -905,7 +905,7 @@ ;; definition for method 99 of type flitter (defmethod enemy-method-99 flitter ((obj flitter) (arg0 process-focusable)) - (logtest? (focus-status mech) (-> arg0 focus-status)) + (focus-test? arg0 mech) ) ;; definition for method 180 of type flitter @@ -1305,7 +1305,7 @@ ((and gp-0 (< (- (-> self clock frame-counter) (-> self state-time)) (seconds 1.5)) gp-0 - (zero? (logand (-> gp-0 focus-status) (focus-status disable dead ignore grabbed))) + (not (logtest? (-> gp-0 focus-status) (focus-status disable dead ignore grabbed))) ) (let ((s5-1 (-> self nav state)) (v1-10 (get-trans gp-0 0)) diff --git a/test/decompiler/reference/jak2/levels/common/grunt_REF.gc b/test/decompiler/reference/jak2/levels/common/grunt_REF.gc index e37fd0f6ff..f995088232 100644 --- a/test/decompiler/reference/jak2/levels/common/grunt_REF.gc +++ b/test/decompiler/reference/jak2/levels/common/grunt_REF.gc @@ -855,7 +855,7 @@ (gp-0 (-> self clock frame-counter)) ) (when (and (>= gp-0 (-> self next-warn-time)) - (zero? (logand (-> self draw status) (draw-control-status on-screen))) + (not (logtest? (-> self draw status) (draw-control-status on-screen))) ) (when (and a0-1 (let ((f0-0 65536.0)) @@ -1531,7 +1531,7 @@ (>= 163840.0 (vector-vector-distance (-> self root-override2 trans) gp-0)) ) (or (not (logtest? (-> self fact-info-override enemy-options) (enemy-option user8))) - (and (not (logtest? (-> (the-as process-focusable s5-0) focus-status) (focus-status in-air))) + (and (not (focus-test? (the-as process-focusable s5-0) in-air)) (>= 4096.0 (fabs (- (-> gp-0 y) (-> self root-override2 trans y)))) ) ) diff --git a/test/decompiler/reference/jak2/levels/common/races/race-manager_REF.gc b/test/decompiler/reference/jak2/levels/common/races/race-manager_REF.gc index c8fb1c96d5..715c27c7d6 100644 --- a/test/decompiler/reference/jak2/levels/common/races/race-manager_REF.gc +++ b/test/decompiler/reference/jak2/levels/common/races/race-manager_REF.gc @@ -227,7 +227,7 @@ (let ((v1-2 (handle->process (-> obj racer)))) (cond (v1-2 - (if (logtest? (-> (the-as process-focusable v1-2) focus-status) (focus-status dead inactive)) + (if (focus-test? (the-as process-focusable v1-2) dead inactive) (logior! (-> obj flags) 4) ) (set! (-> s5-0 vector 0 quad) (-> (the-as process-focusable v1-2) root-override trans quad)) @@ -613,7 +613,7 @@ ) ) ) - (when (and v1-3 (zero? (logand (-> obj info flags) 1))) + (when (and v1-3 (not (logtest? (-> obj info flags) 1))) (race-state-method-15 obj) (set! v1-3 (handle->process (-> obj race-signal))) ) @@ -1421,18 +1421,14 @@ ) ) ) - (while (not (and *target* (or (not (logtest? (focus-status teleporting) (-> *target* focus-status))) - (logtest? (focus-status pilot) (-> *target* focus-status)) - ) - ) - ) + (while (not (and *target* (or (not (focus-test? *target* teleporting)) (focus-test? *target* pilot)))) (suspend) ) (race-manager-method-23 self) (initialize-state self) (suspend) (let ((gp-1 (-> self race-state info))) - (when (and (-> gp-1 countdown-scene) (zero? (logand (-> self race-state flags) 2))) + (when (and (-> gp-1 countdown-scene) (not (logtest? (-> self race-state flags) 2))) (dotimes (s5-2 (-> gp-1 racer-count)) (let ((v1-42 (-> self race-state racer-array s5-2))) (if (and (logtest? (-> gp-1 racer-array s5-2 flags) 1) (!= s5-2 (-> self race-state i-player))) @@ -1519,7 +1515,7 @@ ) ) ) - (if (or (logtest? (-> gp-0 flags) 4) (not *target*) (logtest? (-> *target* focus-status) (focus-status dead))) + (if (or (logtest? (-> gp-0 flags) 4) (not *target*) (focus-test? *target* dead)) (go-virtual fail) ) (when (logtest? (-> gp-0 flags) 2) @@ -1805,7 +1801,3 @@ (set! *race-vehicle-entity* #f) (none) ) - - - - diff --git a/test/decompiler/reference/jak2/levels/common/races/vehicle-racer_REF.gc b/test/decompiler/reference/jak2/levels/common/races/vehicle-racer_REF.gc index 9dca832d8c..120c2e684b 100644 --- a/test/decompiler/reference/jak2/levels/common/races/vehicle-racer_REF.gc +++ b/test/decompiler/reference/jak2/levels/common/races/vehicle-racer_REF.gc @@ -390,7 +390,7 @@ ;; definition for method 138 of type vehicle-racer ;; WARN: Return type mismatch int vs none. (defmethod vehicle-method-138 vehicle-racer ((obj vehicle-racer)) - (if (logtest? (-> obj focus-status) (focus-status grabbed)) + (if (focus-test? obj grabbed) (go (method-of-object obj waiting-for-start)) (go (method-of-object obj player-control)) ) @@ -906,7 +906,7 @@ (or (< (* f0-0 f0-0) (-> obj player-dist2)) (let ((f0-3 102400.0)) (and (< (* f0-3 f0-3) (-> obj player-dist2)) - (zero? (logand (-> obj draw status) (draw-control-status on-screen))) + (not (logtest? (-> obj draw status) (draw-control-status on-screen))) ) ) ) @@ -972,7 +972,7 @@ (set! (-> obj shortcut-speed-factor) 0.0) (vehicle-racer-method-154 obj) (if (and (logtest? (-> obj flags) (rigid-body-object-flag player-driving)) - (zero? (logand (-> obj rbody state flags) (rigid-body-flag enable-physics))) + (not (logtest? (-> obj rbody state flags) (rigid-body-flag enable-physics))) ) (rigid-body-object-method-38 obj) ) @@ -1167,7 +1167,3 @@ (none) ) ) - - - - diff --git a/test/decompiler/reference/jak2/levels/common/scene-actor_REF.gc b/test/decompiler/reference/jak2/levels/common/scene-actor_REF.gc index dbc01c3bb1..b5bafd6175 100644 --- a/test/decompiler/reference/jak2/levels/common/scene-actor_REF.gc +++ b/test/decompiler/reference/jak2/levels/common/scene-actor_REF.gc @@ -1001,14 +1001,13 @@ This commonly includes things such as: ) ) (if (and (= (-> v1-1 action) (game-task-action play)) - (or (and *target* (logtest? (-> *target* focus-status) (focus-status grabbed))) - (let ((v1-10 (-> *game-info* sub-task-list 151))) - (handle->process (if (-> v1-10 info) - (-> v1-10 info manager) - (the-as handle #f) - ) - ) - ) + (or (and *target* (focus-test? *target* grabbed)) (let ((v1-10 (-> *game-info* sub-task-list 151))) + (handle->process (if (-> v1-10 info) + (-> v1-10 info manager) + (the-as handle #f) + ) + ) + ) ) ) (-> obj draw art-group data 6) diff --git a/test/decompiler/reference/jak2/levels/common/warp-gate_REF.gc b/test/decompiler/reference/jak2/levels/common/warp-gate_REF.gc index ff6310703f..0f52b32ea2 100644 --- a/test/decompiler/reference/jak2/levels/common/warp-gate_REF.gc +++ b/test/decompiler/reference/jak2/levels/common/warp-gate_REF.gc @@ -581,12 +581,11 @@ (handle-notice self) (when (and (and *target* (and (>= (-> self distance) (vector-vector-distance (-> self root-override trans) (-> *target* control trans))) - (zero? (logand (focus-status teleporting) (-> *target* focus-status))) + (not (logtest? (focus-status teleporting) (-> *target* focus-status))) ) ) (and (-> self continue) - (not (logtest? (focus-status in-head edge-grab pole flut tube board pilot mech indax) (-> *target* focus-status)) - ) + (not (focus-test? *target* in-head edge-grab pole flut tube board pilot mech indax)) (-> *setting-control* user-current airlock) (not (-> *setting-control* user-current hint)) ) @@ -744,7 +743,7 @@ ) (while (and *target* (and (>= 81920.0 (vector-vector-distance (-> self root-override trans) (-> *target* control trans))) - (zero? (logand (focus-status teleporting) (-> *target* focus-status))) + (not (logtest? (focus-status teleporting) (-> *target* focus-status))) ) ) (suspend) diff --git a/test/decompiler/reference/jak2/levels/dig/dig-digger_REF.gc b/test/decompiler/reference/jak2/levels/dig/dig-digger_REF.gc index d87a8b2222..1ed6b80660 100644 --- a/test/decompiler/reference/jak2/levels/dig/dig-digger_REF.gc +++ b/test/decompiler/reference/jak2/levels/dig/dig-digger_REF.gc @@ -1412,14 +1412,14 @@ This commonly includes things such as: (>= (- (-> pp clock frame-counter) (-> obj speech-time)) (seconds 20)) *target* (and (>= 409600.0 (vector-vector-distance (-> obj root trans) (-> *target* control trans))) - (zero? (logand (focus-status teleporting) (-> *target* focus-status))) + (not (logtest? (focus-status teleporting) (-> *target* focus-status))) ) ) (let ((v1-37 (logand (-> obj speech-count) 1))) (cond ((zero? v1-37) (talker-spawn-func (-> *talker-speech* 191) *entity-pool* (target-pos 0) (the-as region #f)) - (if (and *target* (zero? (logand (focus-status board) (-> *target* focus-status)))) + (if (and *target* (not (logtest? (focus-status board) (-> *target* focus-status)))) (talker-spawn-func (-> *talker-speech* 115) *entity-pool* (target-pos 0) (the-as region #f)) ) ) diff --git a/test/decompiler/reference/jak2/levels/dig/dig-obs_REF.gc b/test/decompiler/reference/jak2/levels/dig/dig-obs_REF.gc index 837b88bbc3..f7057e9f97 100644 --- a/test/decompiler/reference/jak2/levels/dig/dig-obs_REF.gc +++ b/test/decompiler/reference/jak2/levels/dig/dig-obs_REF.gc @@ -637,9 +637,7 @@ ) (until v1-12 (suspend) - (set! v1-12 - (and *target* (not (logtest? (-> *target* focus-status) (focus-status in-air))) (process-grab? *target* #f)) - ) + (set! v1-12 (and *target* (not (focus-test? *target* in-air)) (process-grab? *target* #f))) ) (while (!= (get-status *gui-control* s5-0) (gui-status ready)) (suspend) diff --git a/test/decompiler/reference/jak2/levels/drill_platform/drill-obs2_REF.gc b/test/decompiler/reference/jak2/levels/drill_platform/drill-obs2_REF.gc index f90471bc6d..3c069d90a7 100644 --- a/test/decompiler/reference/jak2/levels/drill_platform/drill-obs2_REF.gc +++ b/test/decompiler/reference/jak2/levels/drill_platform/drill-obs2_REF.gc @@ -911,7 +911,7 @@ This commonly includes things such as: (lambda ((arg0 process)) (and (-> arg0 entity) (type? arg0 drill-metalhead-eggs) - (zero? (logand (-> arg0 entity extra perm status) (entity-perm-status subtask-complete))) + (not (logtest? (-> arg0 entity extra perm status) (entity-perm-status subtask-complete))) ) ) ) diff --git a/test/decompiler/reference/jak2/levels/drill_platform/drill-obs_REF.gc b/test/decompiler/reference/jak2/levels/drill_platform/drill-obs_REF.gc index 52b9b11d5a..a9d5051a4b 100644 --- a/test/decompiler/reference/jak2/levels/drill_platform/drill-obs_REF.gc +++ b/test/decompiler/reference/jak2/levels/drill_platform/drill-obs_REF.gc @@ -650,7 +650,7 @@ For example for an elevator pre-compute the distance between the first and last (when (logtest? (-> self elevator-status) (elevator-status waiting-to-descend)) (let ((v1-9 *target*)) (when v1-9 - (if (not (logtest? (focus-status mech) (-> v1-9 focus-status))) + (if (not (focus-test? v1-9 mech)) (set-setting! 'pilot #f 0 0) ) (set-setting! 'pilot-exit #f 0 0) @@ -678,10 +678,7 @@ For example for an elevator pre-compute the distance between the first and last ) ) ) - (when (and a0-2 - (logtest? (focus-status mech) (-> a0-2 focus-status)) - (zero? (logand (-> a0-2 focus-status) (focus-status dead ignore))) - ) + (when (and a0-2 (focus-test? a0-2 mech) (not (logtest? (-> a0-2 focus-status) (focus-status dead ignore)))) (let* ((v1-5 (get-trans a0-2 0)) (s5-2 (vector-! (new 'stack-no-clear 'vector) v1-5 (-> obj root-override trans))) ) @@ -710,10 +707,10 @@ do so. (local-vars (sv-16 float)) (let ((a0-1 *target*)) (when (and a0-1 - (zero? (logand (focus-status dead inactive in-air grabbed edge-grab pole pilot-riding pilot teleporting) + (not (logtest? (focus-status dead inactive in-air grabbed edge-grab pole pilot-riding pilot teleporting) (-> a0-1 focus-status) ) - ) + ) ) (set! sv-16 (the-as float 0.0)) (when (and (find-closest-point-in-path! obj (get-trans a0-1 0) (& sv-16) #t #t) @@ -823,7 +820,7 @@ For example for an elevator pre-compute the distance between the first and last ) ) (when gp-0 - (when (or (logtest? (focus-status mech) (-> (the-as process-focusable gp-0) focus-status)) + (when (or (focus-test? (the-as process-focusable gp-0) mech) (>= (- (-> self clock frame-counter) (-> self no-collision-timer)) (the-as time-frame (-> *TARGET-bank* hit-invulnerable-timeout)) ) @@ -860,11 +857,10 @@ For example for an elevator pre-compute the distance between the first and last (set! (-> v1-32 vector quad) (-> s4-2 quad)) (set! (-> v1-32 shove-back) 409.6) (set! (-> v1-32 shove-up) 12288.0) - (set! (-> v1-32 control) - (if (logtest? (focus-status board) (-> (the-as process-focusable gp-0) focus-status)) - 1.0 - 0.0 - ) + (set! (-> v1-32 control) (if (focus-test? (the-as process-focusable gp-0) board) + 1.0 + 0.0 + ) ) (set! (-> a1-10 param 1) (the-as uint v1-32)) ) @@ -1255,7 +1251,7 @@ This commonly includes things such as: (defmethod set-switch-color drill-switch ((obj drill-switch) (arg0 symbol)) "Set the switch color based on its state." (with-pp - (when (or arg0 (zero? (logand (-> pp clock frame-counter) 64))) + (when (or arg0 (not (logtest? (-> pp clock frame-counter) 64))) (let ((s4-0 (new 'stack-no-clear 'vector))) (vector<-cspace+vector! s4-0 (-> obj node-list data 4) (new 'static 'vector :y 6963.2 :w 1.0)) (spawn diff --git a/test/decompiler/reference/jak2/levels/drill_platform/ginsu_REF.gc b/test/decompiler/reference/jak2/levels/drill_platform/ginsu_REF.gc index d1bf82b6d5..b983811481 100644 --- a/test/decompiler/reference/jak2/levels/drill_platform/ginsu_REF.gc +++ b/test/decompiler/reference/jak2/levels/drill_platform/ginsu_REF.gc @@ -616,7 +616,7 @@ ) (('touch 'bonk 'attack) (cond - ((or (!= arg0 *target*) (logtest? (focus-status dark) (-> *target* focus-status))) + ((or (!= arg0 *target*) (focus-test? *target* dark)) ((method-of-type nav-enemy general-event-handler) obj arg0 arg1 arg2 arg3) ) (else @@ -781,10 +781,10 @@ ) :trans (behavior () (if (not (and (handle->process (-> self focus handle)) - (zero? (logand (-> (the-as process-focusable (handle->process (-> self focus handle))) focus-status) + (not (logtest? (-> (the-as process-focusable (handle->process (-> self focus handle))) focus-status) (focus-status disable dead ignore grabbed) ) - ) + ) ) ) (go-virtual circling) @@ -857,10 +857,10 @@ :trans (behavior () (enemy-method-49 self) (if (not (and (handle->process (-> self focus handle)) - (zero? (logand (-> (the-as process-focusable (handle->process (-> self focus handle))) focus-status) + (not (logtest? (-> (the-as process-focusable (handle->process (-> self focus handle))) focus-status) (focus-status disable dead ignore grabbed) ) - ) + ) ) ) (go-virtual circling) diff --git a/test/decompiler/reference/jak2/levels/forest/pegasus_REF.gc b/test/decompiler/reference/jak2/levels/forest/pegasus_REF.gc index 1d9f3f34d4..2d1f1a3812 100644 --- a/test/decompiler/reference/jak2/levels/forest/pegasus_REF.gc +++ b/test/decompiler/reference/jak2/levels/forest/pegasus_REF.gc @@ -1114,7 +1114,7 @@ The faster it's moving the fast it flaps it's wings, etc (cond ((and *target* (and (>= 102400.0 (vector-vector-xz-distance (-> self root-override2 trans) (-> *target* control trans))) - (zero? (logand (focus-status teleporting) (-> *target* focus-status))) + (not (logtest? (focus-status teleporting) (-> *target* focus-status))) ) ) (set! (-> self state-time) @@ -1177,7 +1177,7 @@ The faster it's moving the fast it flaps it's wings, etc ) (when (and *target* (and (>= 102400.0 (vector-vector-xz-distance (-> self root-override2 trans) (-> *target* control trans))) - (zero? (logand (focus-status teleporting) (-> *target* focus-status))) + (not (logtest? (focus-status teleporting) (-> *target* focus-status))) ) ) (set! (-> self near-timer) (- (the-as time-frame (-> self near-timer)) diff --git a/test/decompiler/reference/jak2/levels/forest/predator_REF.gc b/test/decompiler/reference/jak2/levels/forest/predator_REF.gc index a64ac3d716..badb085a80 100644 --- a/test/decompiler/reference/jak2/levels/forest/predator_REF.gc +++ b/test/decompiler/reference/jak2/levels/forest/predator_REF.gc @@ -1240,7 +1240,7 @@ ) (if (and (>= (- (-> self clock frame-counter) (-> self state-time)) (seconds 0.5)) (check-los? (-> self los) 0) - (zero? (logand (-> self draw status) (draw-control-status on-screen))) + (not (logtest? (-> self draw status) (draw-control-status on-screen))) ) (go-virtual fire) ) @@ -1449,7 +1449,7 @@ (s1-0 (-> *predator-graph* node s2-0)) ) (when (and (not (point-in-line-region? (target-pos 0) (-> s5-0 position) (-> s1-0 position) 61440.0)) - (zero? (logand (-> s1-0 flags) (predator-node-flag taken))) + (not (logtest? (-> s1-0 flags) (predator-node-flag taken))) ) (logior! (-> s1-0 flags) (predator-node-flag taken)) (logclear! (-> s5-0 flags) (predator-node-flag taken)) diff --git a/test/decompiler/reference/jak2/levels/fortress/ammo_dump/fort-robotank-turret_REF.gc b/test/decompiler/reference/jak2/levels/fortress/ammo_dump/fort-robotank-turret_REF.gc index 86569334f1..f96e3db48f 100644 --- a/test/decompiler/reference/jak2/levels/fortress/ammo_dump/fort-robotank-turret_REF.gc +++ b/test/decompiler/reference/jak2/levels/fortress/ammo_dump/fort-robotank-turret_REF.gc @@ -1246,7 +1246,7 @@ ) ) ) - (when (and (logtest? (-> self flags) 1) (zero? (logand (-> self flags) 8))) + (when (and (logtest? (-> self flags) 1) (not (logtest? (-> self flags) 8))) (let* ((a1-32 (-> self node-list data (-> self gun-joint-l 0))) (s4-1 (-> self node-list data (-> self gun-joint-r 0))) (gp-4 diff --git a/test/decompiler/reference/jak2/levels/fortress/ammo_dump/fort-robotank_REF.gc b/test/decompiler/reference/jak2/levels/fortress/ammo_dump/fort-robotank_REF.gc index 476095a793..3bdaf09cbe 100644 --- a/test/decompiler/reference/jak2/levels/fortress/ammo_dump/fort-robotank_REF.gc +++ b/test/decompiler/reference/jak2/levels/fortress/ammo_dump/fort-robotank_REF.gc @@ -668,7 +668,7 @@ ) ) (set! (-> v1-40 shove-up) 24576.0) - (set! (-> v1-40 control) (if (logtest? (focus-status board) (-> s5-0 focus-status)) + (set! (-> v1-40 control) (if (focus-test? s5-0 board) 1.0 0.0 ) diff --git a/test/decompiler/reference/jak2/levels/gungame/gungame-obs_REF.gc b/test/decompiler/reference/jak2/levels/gungame/gungame-obs_REF.gc index b9041ea2b1..e9275eb9db 100644 --- a/test/decompiler/reference/jak2/levels/gungame/gungame-obs_REF.gc +++ b/test/decompiler/reference/jak2/levels/gungame/gungame-obs_REF.gc @@ -364,7 +364,7 @@ This commonly includes things such as: (suspend) ) (when *target* - (while (logtest? (focus-status gun) (-> *target* focus-status)) + (while (focus-test? *target* gun) (render-text self (game-text-id gungame-tutorial-put-red-away)) (suspend) ) @@ -378,7 +378,7 @@ This commonly includes things such as: (while (nonzero? (get-status *gui-control* (-> self last-sound-id))) (suspend) ) - (while (or (not *target*) (zero? (logand (focus-status gun) (-> *target* focus-status)))) + (while (or (not *target*) (not (logtest? (focus-status gun) (-> *target* focus-status)))) (render-text self (game-text-id gungame-tutorial-take-red-out)) (suspend) ) diff --git a/test/decompiler/reference/jak2/levels/landing_pad/castle-obs_REF.gc b/test/decompiler/reference/jak2/levels/landing_pad/castle-obs_REF.gc index a02ba2b3b5..c274800628 100644 --- a/test/decompiler/reference/jak2/levels/landing_pad/castle-obs_REF.gc +++ b/test/decompiler/reference/jak2/levels/landing_pad/castle-obs_REF.gc @@ -110,7 +110,7 @@ This commonly includes things such as: (defbehavior sound-update cas-conveyor () (when (and *target* (and (>= 327680.0 (vector-vector-distance (-> self collide-bounds) (-> *target* control trans))) - (zero? (logand (focus-status teleporting) (-> *target* focus-status))) + (not (logtest? (focus-status teleporting) (-> *target* focus-status))) ) ) (let ((f0-2 (* 0.000032552085 (+ -30720.0 (fabs (-> self speed)))))) @@ -697,7 +697,7 @@ This commonly includes things such as: ) ) (let ((gp-2 *target*)) - (when (and gp-2 (zero? (logand (-> gp-2 focus-status) (focus-status disable dead ignore inactive)))) + (when (and gp-2 (not (logtest? (-> gp-2 focus-status) (focus-status disable dead ignore inactive)))) (let ((s4-3 (get-trans gp-2 0))) (when (< (vector-vector-distance s4-3 (-> self root-override trans)) 24576.0) (let ((s5-3 (new 'stack-no-clear 'event-message-block))) @@ -717,7 +717,7 @@ This commonly includes things such as: ) (set! (-> s3-3 shove-back) 24576.0) (set! (-> s3-3 shove-up) 12288.0) - (set! (-> s3-3 control) (if (logtest? (focus-status board) (-> gp-2 focus-status)) + (set! (-> s3-3 control) (if (focus-test? gp-2 board) 1.0 0.0 ) @@ -2562,7 +2562,7 @@ This commonly includes things such as: (when (>= (- (-> self clock frame-counter) (-> self state-time)) (seconds 0.6)) (let ((a0-1 *target*)) (if (and a0-1 - (not (logtest? (-> a0-1 focus-status) (focus-status disable dead))) + (not (focus-test? a0-1 disable dead)) (< (vector-vector-distance (get-trans a0-1 0) (-> self root trans)) (-> self notice-dist)) ) (go-virtual spawning) @@ -2599,7 +2599,7 @@ This commonly includes things such as: :trans (behavior () (when (>= (- (-> self clock frame-counter) (-> self state-time)) (seconds 0.6)) (let ((a0-1 *target*)) - (if (and a0-1 (zero? (logand (-> a0-1 focus-status) (focus-status disable dead)))) + (if (and a0-1 (not (logtest? (-> a0-1 focus-status) (focus-status disable dead)))) (set! (-> self player-dist) (vector-vector-distance (get-trans a0-1 0) (-> self root trans))) ) ) diff --git a/test/decompiler/reference/jak2/levels/landing_pad/roboguard-level_REF.gc b/test/decompiler/reference/jak2/levels/landing_pad/roboguard-level_REF.gc index be69cbae48..85b3bd2bb4 100644 --- a/test/decompiler/reference/jak2/levels/landing_pad/roboguard-level_REF.gc +++ b/test/decompiler/reference/jak2/levels/landing_pad/roboguard-level_REF.gc @@ -674,7 +674,7 @@ (let ((gp-2 (handle->process (-> self focus handle)))) (when (and gp-2 (and gp-2 - (zero? (logand (-> (the-as process-focusable gp-2) focus-status) (focus-status disable dead ignore grabbed))) + (not (logtest? (-> (the-as process-focusable gp-2) focus-status) (focus-status disable dead ignore grabbed))) ) (< 2 (the-as int (-> self focus aware))) ) @@ -1061,7 +1061,7 @@ (cond ((!= (-> (the-as attack-info v1-3) id) (-> obj incoming-attack-id)) (set! (-> obj incoming-attack-id) (-> (the-as attack-info v1-3) id)) - (when (and a0-2 (zero? (logand (process-mask enemy) (-> a0-2 mask)))) + (when (and a0-2 (not (logtest? (process-mask enemy) (-> a0-2 mask)))) (let ((s5-0 (find-offending-process-focusable a0-2 (the-as attack-info v1-3)))) (when s5-0 (new 'stack-no-clear 'vector) @@ -1145,7 +1145,7 @@ (the-as symbol (cond - ((or (= (-> arg0 type) target) (zero? (logand (-> obj flags) 4))) + ((or (= (-> arg0 type) target) (not (logtest? (-> obj flags) 4))) ((method-of-type nav-enemy enemy-method-76) obj arg0 arg1) ) (else diff --git a/test/decompiler/reference/jak2/levels/mars_tomb/left/chase/target-indax_REF.gc b/test/decompiler/reference/jak2/levels/mars_tomb/left/chase/target-indax_REF.gc index 623562215b..4d9644129e 100644 --- a/test/decompiler/reference/jak2/levels/mars_tomb/left/chase/target-indax_REF.gc +++ b/test/decompiler/reference/jak2/levels/mars_tomb/left/chase/target-indax_REF.gc @@ -74,7 +74,7 @@ (let ((v1-5 (-> arg3 param 0))) (cond ((= v1-5 'grab) - (when (not (logtest? (-> self focus-status) (focus-status dead))) + (when (not (focus-test? self dead)) (if (not (-> arg3 param 1)) #t (go target-grab 'stance) @@ -91,7 +91,7 @@ ) ) (('trip) - (if (not (or (logtest? (-> self focus-status) (focus-status dead hit grabbed)) + (if (not (or (focus-test? self dead hit grabbed) (and (-> self next-state) (= (-> self next-state name) 'target-indax-trip)) ) ) @@ -308,7 +308,7 @@ (set! (-> self draw art-group) (-> self indax art-group-backup)) (logclear! (-> self draw status) (draw-control-status no-draw-bounds2)) (send-event (ppointer->process (-> self sidekick)) 'matrix #f) - (if (not (logtest? (-> self focus-status) (focus-status dead))) + (if (not (focus-test? self dead)) (set! (-> self fact-override health) (-> self fact-override health-max)) ) (target-exit) @@ -852,7 +852,7 @@ (< (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))) (not (logtest? (water-flags touch-water) (-> self water flags))) - (zero? (logand (state-flags prevent-jump prevent-double-jump) (-> self state-flags))) + (not (logtest? (state-flags prevent-jump prevent-double-jump) (-> self state-flags))) ) ) (go @@ -1577,7 +1577,3 @@ ) :post target-no-stick-post ) - - - - diff --git a/test/decompiler/reference/jak2/levels/mars_tomb/tomb-water_REF.gc b/test/decompiler/reference/jak2/levels/mars_tomb/tomb-water_REF.gc index 0fa305d038..1745614e50 100644 --- a/test/decompiler/reference/jak2/levels/mars_tomb/tomb-water_REF.gc +++ b/test/decompiler/reference/jak2/levels/mars_tomb/tomb-water_REF.gc @@ -643,7 +643,7 @@ This commonly includes things such as: ) ) (when (>= (- (-> self clock frame-counter) (-> self state-time)) (seconds 4)) - (if (and *target* (logtest? (-> *target* focus-status) (focus-status grabbed))) + (if (and *target* (focus-test? *target* grabbed)) (process-release? *target*) ) (if (and *target* @@ -1238,7 +1238,7 @@ This commonly includes things such as: (when (!= (-> self basetrans y) (-> self base-height)) (seek! (-> self basetrans y) (-> self base-height) (* (-> self move-rate) (-> self clock seconds-per-frame))) (when (and (< (- (-> self base-height) (-> self basetrans y)) 21504.0) - (zero? (logand (-> self flags) (simon-block-flags sbf5))) + (not (logtest? (-> self flags) (simon-block-flags sbf5))) ) (sound-play "simon-up") (logior! (-> self flags) (simon-block-flags sbf5)) @@ -1383,7 +1383,7 @@ This commonly includes things such as: (set! (-> a2-4 vector quad) (-> v1-10 quad)) (set! (-> a2-4 shove-back) 0.0) (set! (-> a2-4 shove-up) 12288.0) - (set! (-> a2-4 control) (if (logtest? (focus-status board) (-> a0-10 focus-status)) + (set! (-> a2-4 control) (if (focus-test? a0-10 board) 1.0 0.0 ) diff --git a/test/decompiler/reference/jak2/levels/nest/mammoth_REF.gc b/test/decompiler/reference/jak2/levels/nest/mammoth_REF.gc index b20c959048..6940e13dbd 100644 --- a/test/decompiler/reference/jak2/levels/nest/mammoth_REF.gc +++ b/test/decompiler/reference/jak2/levels/nest/mammoth_REF.gc @@ -1596,7 +1596,7 @@ ) (set! (-> s3-1 shove-back) 24576.0) (set! (-> s3-1 shove-up) 12288.0) - (set! (-> s3-1 control) (if (logtest? (focus-status board) (-> s5-2 focus-status)) + (set! (-> s3-1 control) (if (focus-test? s5-2 board) 1.0 0.0 ) diff --git a/test/decompiler/reference/jak2/levels/nest/mantis_REF.gc b/test/decompiler/reference/jak2/levels/nest/mantis_REF.gc index 96ed5945ee..14a0abc257 100644 --- a/test/decompiler/reference/jak2/levels/nest/mantis_REF.gc +++ b/test/decompiler/reference/jak2/levels/nest/mantis_REF.gc @@ -787,7 +787,7 @@ ) ) (when (and (and gp-0 - (zero? (logand (-> (the-as process-focusable gp-0) focus-status) (focus-status disable dead ignore grabbed))) + (not (logtest? (-> (the-as process-focusable gp-0) focus-status) (focus-status disable dead ignore grabbed))) ) (and (>= (- (-> self clock frame-counter) (-> self attack-timer)) (seconds 5)) (enemy-method-95 self s4-0 8192.0) diff --git a/test/decompiler/reference/jak2/levels/palace/boss/squid-setup_REF.gc b/test/decompiler/reference/jak2/levels/palace/boss/squid-setup_REF.gc index 0f666bf431..5f315f5592 100644 --- a/test/decompiler/reference/jak2/levels/palace/boss/squid-setup_REF.gc +++ b/test/decompiler/reference/jak2/levels/palace/boss/squid-setup_REF.gc @@ -1702,7 +1702,7 @@ ) ((and (logtest? (attack-info-mask penetrate-using) (-> (the-as attack-info s4-0) mask)) (logtest? (penetrate dark-bomb) (-> (the-as attack-info s4-0) penetrate-using)) - (or (not *target*) (zero? (logand (-> *target* focus-status) (focus-status dead)))) + (or (not *target*) (not (logtest? (-> *target* focus-status) (focus-status dead)))) ) (set! (-> self hit-points) 0) (squid-check-hit-points) diff --git a/test/decompiler/reference/jak2/levels/palace/boss/squid-states_REF.gc b/test/decompiler/reference/jak2/levels/palace/boss/squid-states_REF.gc index 1938fb2c72..4cbc7d9f4e 100644 --- a/test/decompiler/reference/jak2/levels/palace/boss/squid-states_REF.gc +++ b/test/decompiler/reference/jak2/levels/palace/boss/squid-states_REF.gc @@ -726,7 +726,7 @@ ) :trans (behavior () (if (and (zero? (-> self hit-points)) - (or (not *target*) (zero? (logand (-> *target* focus-status) (focus-status dead)))) + (or (not *target*) (not (logtest? (-> *target* focus-status) (focus-status dead)))) ) (go-virtual pre-flee) ) @@ -925,7 +925,7 @@ ) :trans (behavior () (if (and (zero? (-> self hit-points)) - (or (not *target*) (zero? (logand (-> *target* focus-status) (focus-status dead)))) + (or (not *target*) (not (logtest? (-> *target* focus-status) (focus-status dead)))) ) (go-virtual pre-flee) ) @@ -976,7 +976,7 @@ ) :trans (behavior () (if (and (zero? (-> self hit-points)) - (or (not *target*) (zero? (logand (-> *target* focus-status) (focus-status dead)))) + (or (not *target*) (not (logtest? (-> *target* focus-status) (focus-status dead)))) ) (go-virtual pre-flee) ) @@ -1130,7 +1130,7 @@ ) :trans (behavior () (if (and (zero? (-> self hit-points)) - (or (not *target*) (zero? (logand (-> *target* focus-status) (focus-status dead)))) + (or (not *target*) (not (logtest? (-> *target* focus-status) (focus-status dead)))) ) (go-virtual pre-flee) ) @@ -1261,7 +1261,7 @@ ) :trans (behavior () (if (and (zero? (-> self hit-points)) - (or (not *target*) (zero? (logand (-> *target* focus-status) (focus-status dead)))) + (or (not *target*) (not (logtest? (-> *target* focus-status) (focus-status dead)))) ) (go-virtual pre-flee) ) @@ -1470,7 +1470,7 @@ ) :trans (behavior () (if (and (zero? (-> self hit-points)) - (or (not *target*) (zero? (logand (-> *target* focus-status) (focus-status dead)))) + (or (not *target*) (not (logtest? (-> *target* focus-status) (focus-status dead)))) ) (go-virtual pre-flee) ) @@ -1637,7 +1637,7 @@ (squid-talker 'general) (cond ((and (zero? (-> self hit-points)) - (or (not *target*) (zero? (logand (-> *target* focus-status) (focus-status dead)))) + (or (not *target*) (not (logtest? (-> *target* focus-status) (focus-status dead)))) ) (go-virtual pre-flee) ) @@ -1767,7 +1767,3 @@ ) :code (the-as (function none :behavior squid) sleep-code) ) - - - - diff --git a/test/decompiler/reference/jak2/levels/palace/cable/palcab-obs_REF.gc b/test/decompiler/reference/jak2/levels/palace/cable/palcab-obs_REF.gc index c83e2c9efa..b016a94dac 100644 --- a/test/decompiler/reference/jak2/levels/palace/cable/palcab-obs_REF.gc +++ b/test/decompiler/reference/jak2/levels/palace/cable/palcab-obs_REF.gc @@ -136,11 +136,10 @@ (set! (-> v1-14 vector quad) (-> s4-1 quad)) (set! (-> v1-14 shove-back) 12288.0) (set! (-> v1-14 shove-up) 36864.0) - (set! (-> v1-14 control) - (if (logtest? (focus-status board) (-> (the-as process-focusable gp-0) focus-status)) - 1.0 - 0.0 - ) + (set! (-> v1-14 control) (if (focus-test? (the-as process-focusable gp-0) board) + 1.0 + 0.0 + ) ) (set! (-> a1-7 param 1) (the-as uint v1-14)) ) @@ -1367,7 +1366,3 @@ This commonly includes things such as: ) (none) ) - - - - diff --git a/test/decompiler/reference/jak2/levels/ruins/mechtest-obs_REF.gc b/test/decompiler/reference/jak2/levels/ruins/mechtest-obs_REF.gc index f7b98dcb59..c082deebfc 100644 --- a/test/decompiler/reference/jak2/levels/ruins/mechtest-obs_REF.gc +++ b/test/decompiler/reference/jak2/levels/ruins/mechtest-obs_REF.gc @@ -347,7 +347,7 @@ (>= (- (-> self clock frame-counter) (-> self state-time)) (seconds 5)) ) (and (-> self next-entity) - (zero? (logand (-> self next-entity extra perm status) (entity-perm-status subtask-complete))) + (not (logtest? (-> self next-entity extra perm status) (entity-perm-status subtask-complete))) ) ) ) diff --git a/test/decompiler/reference/jak2/levels/ruins/rapid-gunner_REF.gc b/test/decompiler/reference/jak2/levels/ruins/rapid-gunner_REF.gc index 1cb2372c2a..b833fac856 100644 --- a/test/decompiler/reference/jak2/levels/ruins/rapid-gunner_REF.gc +++ b/test/decompiler/reference/jak2/levels/ruins/rapid-gunner_REF.gc @@ -500,7 +500,7 @@ (let ((t9-0 (method-of-type nav-enemy in-aggro-range?))) (and (t9-0 obj arg0 arg1) (or (not (logtest? (-> obj fact-info-override enemy-options) (enemy-option user8))) - (and (not (logtest? (-> arg0 focus-status) (focus-status in-air))) + (and (not (focus-test? arg0 in-air)) (>= 4096.0 (fabs (- (-> (get-trans arg0 0) y) (-> obj root-override2 trans y)))) ) ) @@ -792,7 +792,7 @@ ((and (< f0-3 20480.0) (and (< (fabs (- (-> s5-0 y) (-> self root-override2 trans y))) 6144.0) gp-0 - (zero? (logand (-> (the-as process-focusable gp-0) focus-status) (focus-status disable dead ignore grabbed))) + (not (logtest? (-> (the-as process-focusable gp-0) focus-status) (focus-status disable dead ignore grabbed))) ) ) (go-virtual spin-attack) @@ -1255,7 +1255,7 @@ (if (and (< f30-0 20480.0) (and (< (fabs (- (-> s5-0 y) (-> self root-override2 trans y))) 6144.0) gp-0 - (zero? (logand (-> (the-as process-focusable gp-0) focus-status) (focus-status disable dead ignore grabbed))) + (not (logtest? (-> (the-as process-focusable gp-0) focus-status) (focus-status disable dead ignore grabbed))) ) ) (go-virtual spin-attack) diff --git a/test/decompiler/reference/jak2/levels/ruins/ruins-obs_REF.gc b/test/decompiler/reference/jak2/levels/ruins/ruins-obs_REF.gc index 2ecf5d2f86..6a1686ac4a 100644 --- a/test/decompiler/reference/jak2/levels/ruins/ruins-obs_REF.gc +++ b/test/decompiler/reference/jak2/levels/ruins/ruins-obs_REF.gc @@ -824,7 +824,7 @@ This commonly includes things such as: :delay (nop!) ) (send-event (handle->process (-> self arrow)) 'leave) - (until (not (or (not *target*) (zero? (logand (focus-status mech) (-> *target* focus-status))))) + (until (not (or (not *target*) (not (logtest? (focus-status mech) (-> *target* focus-status))))) (b! #t cfg-47 :delay (nop!)) (label cfg-38) (when (and (>= (- (-> self clock frame-counter) (-> self time-limit)) (seconds 10)) @@ -836,7 +836,7 @@ This commonly includes things such as: ) (suspend) (label cfg-47) - (b! (or (not *target*) (zero? (logand (focus-status mech) (-> *target* focus-status)))) cfg-38 :delay (nop!)) + (b! (or (not *target*) (not (logtest? (focus-status mech) (-> *target* focus-status)))) cfg-38 :delay (nop!)) (talker-spawn-func (-> *talker-speech* 457) *entity-pool* (target-pos 0) (the-as region #f)) (set! (-> self time-limit) (-> self clock frame-counter)) (b! #t cfg-66 :delay (nop!)) @@ -860,7 +860,7 @@ This commonly includes things such as: (b! (or (not *target*) (not gp-0) - (zero? (logand (-> gp-0 extra perm status) (entity-perm-status subtask-complete))) + (not (logtest? (-> gp-0 extra perm status) (entity-perm-status subtask-complete))) ) cfg-52 :delay (nop!) @@ -904,12 +904,12 @@ This commonly includes things such as: (suspend) (label cfg-14) (b! (not *target*) cfg-17 :likely-delay (set! v1-14 #t)) - (set! v1-14 (zero? (logand (focus-status mech) (-> *target* focus-status)))) + (set! v1-14 (not (logtest? (focus-status mech) (-> *target* focus-status)))) (label cfg-17) (b! v1-14 cfg-2 :delay (nop!)) (until #f (b! (not *target*) cfg-22 :likely-delay (set! v1-18 #t)) - (set! v1-18 (zero? (logand (focus-status mech) (-> *target* focus-status)))) + (set! v1-18 (not (logtest? (focus-status mech) (-> *target* focus-status)))) (label cfg-22) (b! v1-18 cfg-1 :delay (nop!)) (when (>= (- (-> self clock frame-counter) (-> self time-limit)) (seconds 10)) @@ -933,7 +933,7 @@ This commonly includes things such as: (set! v1-32 #f) (label cfg-35) (b! (not v1-32) cfg-38 :likely-delay (set! v1-25 v1-32)) - (set! v1-25 (zero? (logand (focus-status carry) (-> *target* focus-status)))) + (set! v1-25 (not (logtest? (focus-status carry) (-> *target* focus-status)))) (label cfg-38) (when v1-25 (talker-spawn-func (-> *talker-speech* 458) *entity-pool* (target-pos 0) (the-as region #f)) @@ -964,11 +964,11 @@ This commonly includes things such as: (suspend) (label cfg-2) (b! - (or (not s4-0) (zero? (logand (-> s4-0 extra perm status) (entity-perm-status subtask-complete)))) + (or (not s4-0) (not (logtest? (-> s4-0 extra perm status) (entity-perm-status subtask-complete)))) cfg-1 :delay (nop!) ) - (until (not (or (not *target*) (zero? (logand (focus-status mech) (-> *target* focus-status))))) + (until (not (or (not *target*) (not (logtest? (focus-status mech) (-> *target* focus-status))))) (b! #t cfg-20 :delay (nop!)) (label cfg-8) (set! v1-6 @@ -996,16 +996,12 @@ This commonly includes things such as: (label cfg-19) (suspend) (label cfg-20) - (b! (or (not *target*) (zero? (logand (focus-status mech) (-> *target* focus-status)))) cfg-8 :delay (nop!)) + (b! (or (not *target*) (not (logtest? (focus-status mech) (-> *target* focus-status)))) cfg-8 :delay (nop!)) (b! #t cfg-53 :delay (nop!)) (label cfg-25) ) (when (>= (- (-> self clock frame-counter) (-> self time-limit)) (seconds 10)) - (b! - (not (and *target* (logtest? (focus-status carry) (-> *target* focus-status)))) - cfg-43 - :delay (empty-form) - ) + (b! (not (and *target* (focus-test? *target* carry))) cfg-43 :delay (empty-form)) (when (< (vector-vector-xz-distance (target-pos 0) (new 'static 'vector :x 3881326.5 :y 148090.88 :z -2125870.8 :w 1.0) @@ -1056,7 +1052,7 @@ This commonly includes things such as: (label cfg-53) (b! (not *target*) cfg-58 :likely-delay (set! v1-58 #t)) (set! v1-58 - (or (not s5-0) (zero? (logand (-> s5-0 extra perm status) (entity-perm-status subtask-complete)))) + (or (not s5-0) (not (logtest? (-> s5-0 extra perm status) (entity-perm-status subtask-complete)))) ) ) (label cfg-58) diff --git a/test/decompiler/reference/jak2/levels/ruins/ruins-scenes_REF.gc b/test/decompiler/reference/jak2/levels/ruins/ruins-scenes_REF.gc index 14d7886af3..db8f84322b 100644 --- a/test/decompiler/reference/jak2/levels/ruins/ruins-scenes_REF.gc +++ b/test/decompiler/reference/jak2/levels/ruins/ruins-scenes_REF.gc @@ -1462,7 +1462,7 @@ Touching it flips the `play?` field which will trigger the cutscene" ) ) (('touch 'attack) - (when (and (not (-> self play?)) *target* (zero? (logand (focus-status dark) (-> *target* focus-status)))) + (when (and (not (-> self play?)) *target* (not (logtest? (focus-status dark) (-> *target* focus-status)))) (set! (-> self play?) #t) (process-spawn scene-player :init scene-player-init "ruins-tower-victory" #t #f) ) @@ -1478,7 +1478,7 @@ Touching it flips the `play?` field which will trigger the cutscene" ) (if (and (and *target* (and (>= 122880.0 (vector-vector-distance (-> self root trans) (-> *target* control trans))) - (zero? (logand (focus-status teleporting) (-> *target* focus-status))) + (not (logtest? (focus-status teleporting) (-> *target* focus-status))) ) ) (< (fabs (- (-> self root trans y) (-> *target* control trans y))) 40960.0) diff --git a/test/decompiler/reference/jak2/levels/sewer/hal2-course_REF.gc b/test/decompiler/reference/jak2/levels/sewer/hal2-course_REF.gc index 353f140d94..8f3a8e6031 100644 --- a/test/decompiler/reference/jak2/levels/sewer/hal2-course_REF.gc +++ b/test/decompiler/reference/jak2/levels/sewer/hal2-course_REF.gc @@ -242,7 +242,7 @@ ) ) ) - (if (and a3-2 (zero? (logand (-> (the-as process-focusable a3-2) focus-status) (focus-status dead)))) + (if (and a3-2 (not (logtest? (-> (the-as process-focusable a3-2) focus-status) (focus-status dead)))) (return #f) ) ) @@ -1905,7 +1905,7 @@ ) (else (let ((a0-11 *target*)) - (if (and a0-11 (logtest? (-> a0-11 focus-status) (focus-status hit))) + (if (and a0-11 (focus-test? a0-11 hit)) (logior! (-> arg1 waypoint-bits) 1) ) ) @@ -2340,7 +2340,7 @@ ) ) ) - (when (and s5-0 s4-0 (zero? (logand (bot-flags bf22 bf23) (-> arg1 bot-flags)))) + (when (and s5-0 s4-0 (not (logtest? (bot-flags bf22 bf23) (-> arg1 bot-flags)))) (ai-task-control-method-12 (-> arg1 ai-ctrl) arg1) (go-to-waypoint! arg1 29 #f) (ai-task-control-method-10 (-> arg1 ai-ctrl) arg1) @@ -2698,7 +2698,7 @@ (when (and (not (speech-playing? arg1 47)) (not (channel-active? arg1 (the-as uint 0))) s4-0 - (logtest? (-> (the-as process-focusable s4-0) focus-status) (focus-status touch-water)) + (focus-test? (the-as process-focusable s4-0) touch-water) ) (play-speech arg1 47) (play-speech arg1 48) @@ -3040,10 +3040,7 @@ (set! (-> arg1 waypoint-time0) (-> pp clock frame-counter)) (when (not (channel-active? arg1 (the-as uint 0))) (let ((v1-22 *target*)) - (when (and v1-22 - (logtest? (-> v1-22 focus-status) (focus-status in-air)) - (zero? (logand (-> v1-22 focus-status) (focus-status hit))) - ) + (when (and v1-22 (focus-test? v1-22 in-air) (not (logtest? (-> v1-22 focus-status) (focus-status hit)))) (cond ((not (speech-playing? arg1 58)) (play-speech arg1 58) @@ -3271,10 +3268,7 @@ (set! (-> arg1 waypoint-time0) (-> pp clock frame-counter)) (when (not (channel-active? arg1 (the-as uint 0))) (let ((v1-22 *target*)) - (when (and v1-22 - (logtest? (-> v1-22 focus-status) (focus-status in-air)) - (zero? (logand (-> v1-22 focus-status) (focus-status hit))) - ) + (when (and v1-22 (focus-test? v1-22 in-air) (not (logtest? (-> v1-22 focus-status) (focus-status hit)))) (cond ((not (speech-playing? arg1 64)) (play-speech arg1 64) @@ -4249,7 +4243,3 @@ ;; failed to figure out what this is: (set! (-> *bot-course-table* course 5) *hal2-course*) - - - - diff --git a/test/decompiler/reference/jak2/levels/sewer/hosehead_REF.gc b/test/decompiler/reference/jak2/levels/sewer/hosehead_REF.gc index 58bc54c370..ee738df735 100644 --- a/test/decompiler/reference/jak2/levels/sewer/hosehead_REF.gc +++ b/test/decompiler/reference/jak2/levels/sewer/hosehead_REF.gc @@ -436,7 +436,6 @@ ) ;; definition for method 3 of type ik-setup -;; INFO: this function exists in multiple non-identical object files (defmethod inspect ik-setup ((obj ik-setup)) (when (not obj) (set! obj obj) @@ -2108,7 +2107,7 @@ (go-virtual attack) ) (cond - ((logtest? (-> self focus-status) (focus-status touch-water under-water)) + ((focus-test? self touch-water under-water) (set! (-> self next-lazer-time) 0) 0 ) diff --git a/test/decompiler/reference/jak2/levels/sewer/sewer-obs2_REF.gc b/test/decompiler/reference/jak2/levels/sewer/sewer-obs2_REF.gc index 014898b2ce..f1d793f6d9 100644 --- a/test/decompiler/reference/jak2/levels/sewer/sewer-obs2_REF.gc +++ b/test/decompiler/reference/jak2/levels/sewer/sewer-obs2_REF.gc @@ -358,10 +358,7 @@ For example for an elevator pre-compute the distance between the first and last ) ) (set-height! *ocean-map-sewer* (+ (-> self water-height) f28-0)) - (if (and *target* - (logtest? (focus-status board) (-> *target* focus-status)) - (logtest? (-> *target* focus-status) (focus-status touch-water)) - ) + (if (and *target* (focus-test? *target* board) (focus-test? *target* touch-water)) (+! (-> *target* control trans y) (- f28-0 f30-0)) ) ) @@ -978,7 +975,7 @@ This commonly includes things such as: (set! (-> attack-info vector quad) (-> a0-4 quad)) (set! (-> attack-info shove-back) 20480.0) (set! (-> attack-info shove-up) 12288.0) - (set! (-> attack-info control) (if (logtest? (focus-status board) (-> focus-proc focus-status)) + (set! (-> attack-info control) (if (focus-test? focus-proc board) 1.0 0.0 ) diff --git a/test/decompiler/reference/jak2/levels/stadium/jetboard/skatea-obs_REF.gc b/test/decompiler/reference/jak2/levels/stadium/jetboard/skatea-obs_REF.gc index 9dce4f8a11..62b1e03cd4 100644 --- a/test/decompiler/reference/jak2/levels/stadium/jetboard/skatea-obs_REF.gc +++ b/test/decompiler/reference/jak2/levels/stadium/jetboard/skatea-obs_REF.gc @@ -354,7 +354,7 @@ (set! (-> self last-sound-id) (add-process *gui-control* self (gui-channel sig) (gui-action play) "kei001" -99.0 0) ) - (while (or (not *target*) (zero? (logand (focus-status board) (-> *target* focus-status)))) + (while (or (not *target*) (not (logtest? (focus-status board) (-> *target* focus-status)))) (if (= (get-status *gui-control* (-> self last-sound-id)) (gui-status unknown)) (send-event (handle->process (-> self voicebox)) 'speak-effect #f) ) diff --git a/test/decompiler/reference/jak2/levels/stadium/stadium-obs_REF.gc b/test/decompiler/reference/jak2/levels/stadium/stadium-obs_REF.gc index e400380bc6..47b2b25222 100644 --- a/test/decompiler/reference/jak2/levels/stadium/stadium-obs_REF.gc +++ b/test/decompiler/reference/jak2/levels/stadium/stadium-obs_REF.gc @@ -490,10 +490,10 @@ This commonly includes things such as: (collide-action no-standon) (collide-action) ) - (zero? (logand (-> self root-override-2 penetrated-by) + (not (logtest? (-> self root-override-2 penetrated-by) (-> (the-as collide-shape (-> (the-as process-drawable s4-1) root)) penetrate-using) ) - ) + ) ) (send-shoves (-> self root-override-2) arg0 (the-as touching-shapes-entry gp-1) 0.7 6144.0 16384.0) ) @@ -3710,7 +3710,3 @@ This commonly includes things such as: 0 (none) ) - - - - diff --git a/test/decompiler/reference/jak2/levels/strip/strip-obs_REF.gc b/test/decompiler/reference/jak2/levels/strip/strip-obs_REF.gc index f62b17bcf7..4359d441a1 100644 --- a/test/decompiler/reference/jak2/levels/strip/strip-obs_REF.gc +++ b/test/decompiler/reference/jak2/levels/strip/strip-obs_REF.gc @@ -111,7 +111,7 @@ (set! (-> v1-13 vector quad) (-> s4-1 quad)) (set! (-> v1-13 shove-back) (-> self shove-vec z)) (set! (-> v1-13 shove-up) (-> self shove-vec y)) - (set! (-> v1-13 control) (if (logtest? (focus-status board) (-> gp-0 focus-status)) + (set! (-> v1-13 control) (if (focus-test? gp-0 board) 1.0 0.0 ) @@ -1679,7 +1679,7 @@ This commonly includes things such as: (set! (-> self hud-timer) (ppointer->handle (process-spawn hud-timer :init hud-init-by-other :to *target*))) (set! (-> self hud-counter) (ppointer->handle (process-spawn hud-plasmite :init hud-init-by-other :to self))) (while (or (< (- (-> self clock frame-counter) (-> self start-time)) (-> self total-time)) - (and *target* (logtest? (-> *target* focus-status) (focus-status in-air))) + (and *target* (focus-test? *target* in-air)) ) (let ((v1-18 (the-as int (- (-> self total-time) (- (-> self clock frame-counter) (-> self start-time)))))) (if (< (the-as time-frame v1-18) 0) diff --git a/test/decompiler/reference/jak2/levels/temple/mountain-obs_REF.gc b/test/decompiler/reference/jak2/levels/temple/mountain-obs_REF.gc index 76a25f18a9..947e792251 100644 --- a/test/decompiler/reference/jak2/levels/temple/mountain-obs_REF.gc +++ b/test/decompiler/reference/jak2/levels/temple/mountain-obs_REF.gc @@ -578,7 +578,7 @@ (v1-17 (/ (- *dice-offset-x* v1-15) -4)) (a1-31 (/ (- *dice-offset-z* a0-48) -4)) ) - (when (and (< f28-0 f30-0) (zero? (logand (-> *dice-world-array* a1-31) (ash 1 (- 15 v1-17))))) + (when (and (< f28-0 f30-0) (not (logtest? (-> *dice-world-array* a1-31) (ash 1 (- 15 v1-17))))) (set! f30-0 f28-0) (set! s2-0 s1-1) ) @@ -1190,7 +1190,7 @@ (set! sv-544 (/ (- *dice-offset-x* v1-12) -4)) (let ((s0-0 (/ (- *dice-offset-z* a0-14) -4))) (when (and (= (-> gp-0 face-status s2-0) -1) (= (-> gp-0 active) 1)) - (when (and (= (-> gp-0 active) 1) (zero? (logand (-> *dice-blocked-array* s0-0) (ash 1 (- 15 sv-544))))) + (when (and (= (-> gp-0 active) 1) (not (logtest? (-> *dice-blocked-array* s0-0) (ash 1 (- 15 sv-544))))) (when (> *dice-back-way-num* 0) (set! (-> *dice-last-safe-position* quad) (-> *dice-back-way* (+ *dice-back-way-num* -1) quad)) (set! (-> *dice-last-safe-position* y) (+ 8192.0 (-> *dice-last-safe-position* y))) diff --git a/test/decompiler/reference/jak2/levels/temple/rhino_REF.gc b/test/decompiler/reference/jak2/levels/temple/rhino_REF.gc index fac4c51cb6..f691a18146 100644 --- a/test/decompiler/reference/jak2/levels/temple/rhino_REF.gc +++ b/test/decompiler/reference/jak2/levels/temple/rhino_REF.gc @@ -630,7 +630,9 @@ ;; INFO: Used lq/sq ;; WARN: Return type mismatch none vs object. ;; WARN: rewrite_to_get_var got a none typed variable. Is there unreachable code? [OP: 10] +;; WARN: rewrite_to_get_var got a none typed variable. Is there unreachable code? [OP: 25] ;; WARN: rewrite_to_get_var got a none typed variable. Is there unreachable code? [OP: 30] +;; WARN: rewrite_to_get_var got a none typed variable. Is there unreachable code? [OP: 45] ;; WARN: rewrite_to_get_var got a none typed variable. Is there unreachable code? [OP: 151] ;; WARN: rewrite_to_get_var got a none typed variable. Is there unreachable code? [OP: 216] ;; WARN: rewrite_to_get_var got a none typed variable. Is there unreachable code? [OP: 272] @@ -876,7 +878,7 @@ (when (and (>= (the-as int (-> self focus aware)) (the-as int (-> self charge-aware))) *target* (and (>= 122880.0 (vector-vector-distance (-> self root-override2 trans) (-> *target* control trans))) - (zero? (logand (focus-status teleporting) (-> *target* focus-status))) + (not (logtest? (focus-status teleporting) (-> *target* focus-status))) ) ) (process-entity-status! self (entity-perm-status subtask-complete) #t) @@ -1055,13 +1057,12 @@ ) (when (and s5-0 v1-0) (cond - ((and (logtest? (-> obj focus-status) (focus-status dangerous)) - ((method-of-type touching-shapes-entry prims-touching-action?) - (the-as touching-shapes-entry s5-0) - (-> obj root-override2) - (collide-action deadly) - (collide-action) - ) + ((and (focus-test? obj dangerous) ((method-of-type touching-shapes-entry prims-touching-action?) + (the-as touching-shapes-entry s5-0) + (-> obj root-override2) + (collide-action deadly) + (collide-action) + ) ) (let ((a3-2 (if ((method-of-type touching-shapes-entry prims-touching-action?) (the-as touching-shapes-entry s5-0) @@ -1245,7 +1246,7 @@ (vector-vector-xz-distance (get-trans (the-as process-focusable gp-0) 0) (-> self root-override2 trans)) ) (and gp-0 - (zero? (logand (-> (the-as process-focusable gp-0) focus-status) (focus-status disable dead ignore grabbed))) + (not (logtest? (-> (the-as process-focusable gp-0) focus-status) (focus-status disable dead ignore grabbed))) ) ) (goto cfg-25) diff --git a/test/decompiler/reference/jak2/levels/title/title-obs_REF.gc b/test/decompiler/reference/jak2/levels/title/title-obs_REF.gc index e72be3042e..8f601b9ce9 100644 --- a/test/decompiler/reference/jak2/levels/title/title-obs_REF.gc +++ b/test/decompiler/reference/jak2/levels/title/title-obs_REF.gc @@ -552,7 +552,7 @@ ) ((or (logtest? (pad-buttons confirm) (-> *cpad-list* cpads 0 button0-rel 0)) (and (cpad-pressed? 0 start) - (or (not *debug-segment*) (zero? (logand (-> *cpad-list* cpads 0 button0-abs 0) (pad-buttons l3)))) + (or (not *debug-segment*) (not (logtest? (-> *cpad-list* cpads 0 button0-abs 0) (pad-buttons l3)))) ) ) (sound-play "dmenu-pick") diff --git a/test/decompiler/reference/jak2/levels/undefined/hal_REF.gc b/test/decompiler/reference/jak2/levels/undefined/hal_REF.gc index 3d4e23537c..53a94da6bf 100644 --- a/test/decompiler/reference/jak2/levels/undefined/hal_REF.gc +++ b/test/decompiler/reference/jak2/levels/undefined/hal_REF.gc @@ -484,7 +484,7 @@ ) ) (('end-mode) - (when (logtest? (-> obj focus-status) (focus-status grabbed)) + (when (focus-test? obj grabbed) (logclear! (-> obj focus-status) (focus-status grabbed)) #t ) @@ -558,7 +558,3 @@ :code (the-as (function none :behavior hal) sleep-code) :post hal-post ) - - - - diff --git a/test/decompiler/reference/jak2/levels/undefined/ruf-states_REF.gc b/test/decompiler/reference/jak2/levels/undefined/ruf-states_REF.gc index f85649c20b..844617d173 100644 --- a/test/decompiler/reference/jak2/levels/undefined/ruf-states_REF.gc +++ b/test/decompiler/reference/jak2/levels/undefined/ruf-states_REF.gc @@ -23,7 +23,7 @@ ) :trans (behavior () (bot-method-223 self #f) - (when (not (logtest? (-> self focus-status) (focus-status grabbed))) + (when (not (focus-test? self grabbed)) (cond ((bot-method-214 self) (go-hostile self) @@ -70,7 +70,7 @@ ) :trans (behavior () (bot-method-223 self #f) - (when (not (logtest? (-> self focus-status) (focus-status grabbed))) + (when (not (focus-test? self grabbed)) (cond ((bot-method-214 self) (go-hostile self) @@ -117,7 +117,7 @@ ) :trans (behavior () (bot-method-223 self #f) - (when (not (logtest? (-> self focus-status) (focus-status grabbed))) + (when (not (focus-test? self grabbed)) (cond ((bot-method-214 self) (go-hostile self) @@ -161,7 +161,7 @@ ) :trans (behavior () (bot-method-223 self #f) - (when (not (logtest? (-> self focus-status) (focus-status grabbed))) + (when (not (focus-test? self grabbed)) (cond ((bot-method-214 self) (go-hostile self) @@ -586,7 +586,7 @@ ((not (outside-spot-radius? self (the-as bot-spot #f) (the-as vector #f) #f)) (go-virtual traveling) ) - ((and (not (ruffian-method-243 self)) (zero? (logand (bot-flags bf21) (-> self bot-flags)))) + ((and (not (ruffian-method-243 self)) (not (logtest? (bot-flags bf21) (-> self bot-flags)))) (react-to-focus self) ) ) @@ -595,7 +595,3 @@ :code (the-as (function none :behavior ruffian) nothing) :post (the-as (function none :behavior ruffian) nav-enemy-simple-post) ) - - - - diff --git a/test/decompiler/reference/jak2/levels/undefined/ruf-task_REF.gc b/test/decompiler/reference/jak2/levels/undefined/ruf-task_REF.gc index bc980645df..0967de6543 100644 --- a/test/decompiler/reference/jak2/levels/undefined/ruf-task_REF.gc +++ b/test/decompiler/reference/jak2/levels/undefined/ruf-task_REF.gc @@ -44,7 +44,7 @@ (when (and a1-10 (= (-> arg0 focus aware) (enemy-aware enemy-aware-3)) (attacked-by-player? arg0 (the-as process-focusable a1-10)) - (zero? (logand (-> arg0 focus-status) (focus-status grabbed))) + (not (logtest? (-> arg0 focus-status) (focus-status grabbed))) ) (get-task-by-type (-> arg0 ai-ctrl) ruft-fight-focus arg0) (ai-task-control-method-10 (-> arg0 ai-ctrl) arg0) @@ -60,7 +60,7 @@ (if (and a1-1 (= (-> arg0 focus aware) (enemy-aware enemy-aware-3)) (attacked-by-player? arg0 (the-as process-focusable a1-1)) - (zero? (logand (-> arg0 focus-status) (focus-status grabbed))) + (not (logtest? (-> arg0 focus-status) (focus-status grabbed))) ) (logior! (-> arg0 bot-flags) (bot-flags bf00)) (ai-task-control-method-14 (-> arg0 ai-ctrl) obj arg0) @@ -216,7 +216,7 @@ (set! (-> arg0 poi-handle) (ppointer->handle (-> arg0 my-simple-focus))) (if (and (outside-spot-radius? arg0 (the-as bot-spot #f) (the-as vector #f) #f) (and (enemy-method-95 arg0 (the-as vector (-> arg0 course spots (-> obj face-spot-indexes s4-0))) 10012.445) - (zero? (logand (bot-flags bf21) (-> arg0 bot-flags))) + (not (logtest? (bot-flags bf21) (-> arg0 bot-flags))) ) ) (set! (-> arg0 bot-flags) (logior (bot-flags bf20) (-> arg0 bot-flags))) @@ -242,7 +242,7 @@ (when (and a1-17 (= (-> arg0 focus aware) (enemy-aware enemy-aware-3)) (attacked-by-player? arg0 (the-as process-focusable a1-17)) - (zero? (logand (-> arg0 focus-status) (focus-status grabbed))) + (not (logtest? (-> arg0 focus-status) (focus-status grabbed))) ) (get-task-by-type (-> arg0 ai-ctrl) ruft-fight-focus arg0) (ai-task-control-method-10 (-> arg0 ai-ctrl) arg0) @@ -257,7 +257,3 @@ (clear-poi-and-focus! arg0) (none) ) - - - - diff --git a/test/decompiler/reference/jak2/levels/underport/centipede_REF.gc b/test/decompiler/reference/jak2/levels/underport/centipede_REF.gc index 0466659665..fb5b8fab1d 100644 --- a/test/decompiler/reference/jak2/levels/underport/centipede_REF.gc +++ b/test/decompiler/reference/jak2/levels/underport/centipede_REF.gc @@ -608,7 +608,7 @@ (defmethod get-enemy-target centipede ((obj centipede)) "@returns the [[process-focusable]] that the enemy is currently focusing on, or [[#f]] otherwise" (let ((v0-0 (handle->process (-> obj focus handle)))) - (if (and v0-0 (logtest? (-> (the-as process-focusable v0-0) focus-status) (focus-status disable dead grabbed))) + (if (and v0-0 (focus-test? (the-as process-focusable v0-0) disable dead grabbed)) (set! v0-0 (the-as process #f)) ) (the-as process-focusable v0-0) @@ -625,7 +625,7 @@ (dist 28672.0) ) (and (>= (* dist dist) (vector-vector-xz-distance-squared (-> obj root-override2 trans) targ-pos)) - (or (>= y-off -12288.0) (or (>= 24576.0 y-off) (logtest? (-> targ focus-status) (focus-status edge-grab)))) + (or (>= y-off -12288.0) (or (>= 24576.0 y-off) (focus-test? targ edge-grab))) ) ) ) @@ -1017,7 +1017,7 @@ :trans (behavior () (when (>= (- (-> self clock frame-counter) (-> self state-time)) (seconds 0.5)) (let ((v1-6 (handle->process (-> self focus handle)))) - (if (or (not v1-6) (logtest? (-> (the-as process-focusable v1-6) focus-status) (focus-status dead))) + (if (or (not v1-6) (focus-test? (the-as process-focusable v1-6) dead)) (go-virtual stop-chase) ) ) @@ -1477,7 +1477,3 @@ 0 (none) ) - - - - diff --git a/test/decompiler/reference/jak2/levels/underport/jellyfish_REF.gc b/test/decompiler/reference/jak2/levels/underport/jellyfish_REF.gc index f67d238b78..b89d9313b4 100644 --- a/test/decompiler/reference/jak2/levels/underport/jellyfish_REF.gc +++ b/test/decompiler/reference/jak2/levels/underport/jellyfish_REF.gc @@ -736,10 +736,7 @@ (set! *jellyfish-mech-reserved* #t) (set! (-> self attach-lerp) 0.0) (let ((gp-0 *target*)) - (if (and gp-0 - (logtest? (focus-status mech) (-> gp-0 focus-status)) - (zero? (logand (-> gp-0 focus-status) (focus-status dead ignore))) - ) + (if (and gp-0 (focus-test? gp-0 mech) (not (logtest? (-> gp-0 focus-status) (focus-status dead ignore)))) (set! (-> self grab-front) (< (vector-dot (vector-z-quaternion! (new 'stack-no-clear 'vector) (-> self root-override2 quat)) @@ -847,10 +844,7 @@ :frame-num 0.0 ) (until (ja-done? 0) - (when (and gp-3 - (logtest? (focus-status mech) (-> gp-3 focus-status)) - (zero? (logand (-> gp-3 focus-status) (focus-status dead ignore))) - ) + (when (and gp-3 (focus-test? gp-3 mech) (not (logtest? (-> gp-3 focus-status) (focus-status dead ignore)))) (let ((a1-13 (new 'stack-no-clear 'event-message-block))) (set! (-> a1-13 from) (process->ppointer self)) (set! (-> a1-13 num-params) 2) @@ -1045,14 +1039,14 @@ arg0 (handle->process (-> obj focus handle)) ) - (logtest? (focus-status mech) (-> (the-as process-focusable (if arg0 - arg0 - (handle->process (-> obj focus handle)) - ) - ) - focus-status - ) + (focus-test? + (the-as process-focusable (if arg0 + arg0 + (handle->process (-> obj focus handle)) + ) ) + mech + ) (begin (let ((v1-13 #t)) (set! arg0 (cond @@ -1092,14 +1086,14 @@ arg0 (handle->process (-> obj focus handle)) ) - (logtest? (focus-status mech) (-> (the-as process-focusable (if arg0 - arg0 - (handle->process (-> obj focus handle)) - ) - ) - focus-status - ) + (focus-test? + (the-as process-focusable (if arg0 + arg0 + (handle->process (-> obj focus handle)) + ) ) + mech + ) (begin (let ((v1-11 #t)) (set! arg0 (cond @@ -1268,8 +1262,8 @@ ) (let ((a0-10 (handle->process (-> obj focus handle)))) (when (and a0-10 - (logtest? (focus-status mech) (-> (the-as process-focusable a0-10) focus-status)) - (zero? (logand (-> (the-as process-focusable a0-10) focus-status) (focus-status dead ignore))) + (focus-test? (the-as process-focusable a0-10) mech) + (not (logtest? (-> (the-as process-focusable a0-10) focus-status) (focus-status dead ignore))) ) (set! (-> obj focus-pos quad) (-> (get-trans (the-as process-focusable a0-10) 0) quad)) (set! (-> obj path-player-u) (get-furthest-point-on-path (-> obj path) (-> obj focus-pos))) @@ -1565,7 +1559,3 @@ (none) ) ) - - - - diff --git a/test/decompiler/reference/jak2/levels/underport/sig5-course_REF.gc b/test/decompiler/reference/jak2/levels/underport/sig5-course_REF.gc index 7280d0d525..a0312603c9 100644 --- a/test/decompiler/reference/jak2/levels/underport/sig5-course_REF.gc +++ b/test/decompiler/reference/jak2/levels/underport/sig5-course_REF.gc @@ -110,8 +110,8 @@ "Were we attacked by the player?" (the-as symbol - (and (and arg0 (zero? (logand (-> arg0 focus-status) (focus-status disable dead ignore grabbed)))) - (or (and (logtest? (process-mask enemy) (-> arg0 mask)) (zero? (logand (bot-flags bf26) (-> obj bot-flags)))) + (and (and arg0 (not (logtest? (-> arg0 focus-status) (focus-status disable dead ignore grabbed)))) + (or (and (logtest? (process-mask enemy) (-> arg0 mask)) (not (logtest? (bot-flags bf26) (-> obj bot-flags)))) (and (logtest? (-> arg0 mask) (process-mask target)) (logtest? (-> obj bot-flags) (bot-flags attacked))) ) ) @@ -426,7 +426,7 @@ (none) ) :trans (behavior () - (if (logtest? (-> self focus-status) (focus-status grabbed)) + (if (focus-test? self grabbed) (go-virtual waiting-close) ) (let ((a0-1 (handle->process (-> self focus handle)))) @@ -607,7 +607,7 @@ (with-pp (if (not (and (logtest? (-> arg1 bot-task-bits) 1) *target* - (zero? (logand (-> *target* focus-status) (focus-status dead in-air edge-grab))) + (not (logtest? (-> *target* focus-status) (focus-status dead in-air edge-grab))) ) ) (set! (-> arg1 waypoint-time0) (-> pp clock frame-counter)) @@ -1638,7 +1638,7 @@ (when (send-event arg1 'jump 5 (-> arg1 sig5-course spots 28)) (let ((s5-1 (-> arg1 actor-group 0 data 6 actor))) (when (and (not (channel-active? arg1 (the-as uint 0))) - (or (not s5-1) (zero? (logand (-> s5-1 extra perm status) (entity-perm-status subtask-complete)))) + (or (not s5-1) (not (logtest? (-> s5-1 extra perm status) (entity-perm-status subtask-complete)))) ) (let ((s5-2 18)) (case (get-rand-int arg1 3) @@ -1700,7 +1700,7 @@ ) (when (and (not (logtest? (-> arg1 waypoint-bits) 2)) (>= (- (-> pp clock frame-counter) (-> arg1 waypoint-time0)) (seconds 0.5)) - (zero? (logand (-> arg1 focus-status) (focus-status in-air))) + (not (logtest? (-> arg1 focus-status) (focus-status in-air))) ) (logior! (-> arg1 waypoint-bits) 2) (logior! (-> arg1 enemy-flags) (enemy-flag enable-on-active checking-water)) @@ -1802,7 +1802,7 @@ (with-pp (when (and (not (logtest? (-> arg1 waypoint-bits) 1)) (>= (- (-> pp clock frame-counter) (-> arg1 waypoint-time0)) (seconds 0.5)) - (zero? (logand (-> arg1 focus-status) (focus-status in-air))) + (not (logtest? (-> arg1 focus-status) (focus-status in-air))) ) (logior! (-> arg1 waypoint-bits) 1) (logior! (-> arg1 enemy-flags) (enemy-flag enable-on-active checking-water)) diff --git a/test/decompiler/reference/jak2/levels/underport/underb-master_REF.gc b/test/decompiler/reference/jak2/levels/underport/underb-master_REF.gc index 5ccccc2586..d2f17264a3 100644 --- a/test/decompiler/reference/jak2/levels/underport/underb-master_REF.gc +++ b/test/decompiler/reference/jak2/levels/underport/underb-master_REF.gc @@ -247,7 +247,7 @@ (cond ((-> *setting-control* user-current pilot-exit) (let ((a1-2 *target*)) - (when (and a1-2 (logtest? (focus-status mech) (-> a1-2 focus-status))) + (when (and a1-2 (focus-test? a1-2 mech)) (set-setting! 'pilot-exit #f 0 0) (apply-settings *setting-control*) #t @@ -424,7 +424,7 @@ ) ) ) - (if (or (not gp-0) (zero? (logand (-> gp-0 water flags) (water-flags under-water)))) + (if (or (not gp-0) (not (logtest? (-> gp-0 water flags) (water-flags under-water)))) (set! (-> self air-charge-up?) #t) (set! (-> self underwater-time) (-> self clock frame-counter)) ) @@ -477,7 +477,7 @@ ) ) (set! (-> *game-info* air-supply) (fmin 1.0 (-> self air-supply))) - (if (or (and *target* (zero? (logand (focus-status mech) (-> *target* focus-status)))) + (if (or (and *target* (not (logtest? (focus-status mech) (-> *target* focus-status)))) (and (>= (-> self air-supply) 1.0) (>= (- (-> self clock frame-counter) (-> self underwater-time)) (seconds 3)) ) @@ -810,7 +810,7 @@ ) (let ((a1-6 *target*)) (cond - ((and a1-6 (logtest? (focus-status mech) (-> a1-6 focus-status))) + ((and a1-6 (focus-test? a1-6 mech)) (set! (-> self mode) (the-as uint 3)) (let ((a1-8 (new 'stack-no-clear 'event-message-block))) (set! (-> a1-8 from) (process->ppointer self)) @@ -874,7 +874,7 @@ ((-> event param 0) (when (or (zero? v1-1) (= v1-1 5)) (let ((a0-4 *target*)) - (and a0-4 (zero? (logand (focus-status mech) (-> a0-4 focus-status)))) + (and a0-4 (not (logtest? (focus-status mech) (-> a0-4 focus-status)))) ) ) ) @@ -895,7 +895,7 @@ ) (when (and v1-1 a0-1) (if (and (-> a0-1 0 data 0 actor) - (logtest? (focus-status mech) (-> v1-1 focus-status)) + (focus-test? v1-1 mech) (send-event (ppointer->process *underb-master*) 'request 'mech #t) ) (set! (-> self mode) (the-as uint 1)) @@ -938,7 +938,7 @@ ) ((= v1-0 5) (let ((a1-4 *target*)) - (when (or (not a1-4) (zero? (logand (focus-status mech) (-> a1-4 focus-status)))) + (when (or (not a1-4) (not (logtest? (focus-status mech) (-> a1-4 focus-status)))) (set! (-> self mode) (the-as uint 0)) 0 ) @@ -1273,7 +1273,3 @@ This commonly includes things such as: 0 (none) ) - - - -