From 04269ffa8628dc60bedab9265199b741be77286f Mon Sep 17 00:00:00 2001 From: ManDude <7569514+ManDude@users.noreply.github.com> Date: Tue, 22 Aug 2023 16:39:52 +0100 Subject: [PATCH] [jak2] fill in a lot of flags for decomp + mouse macros (#2927) Also changed the default type of enums to `int64` (same as `int`). --- common/type_system/defenum.cpp | 4 +- decompiler/IR2/Form.cpp | 4 + decompiler/IR2/FormExpressionAnalysis.cpp | 141 ++++++--- decompiler/IR2/IR2_common.h | 2 + decompiler/analysis/insert_lets.cpp | 6 + decompiler/config/jak2/all-types.gc | 267 ++++++++++++++++-- .../config/jak2/ntsc_v1/type_casts.jsonc | 1 - goal_src/jak1/engine/game/fact-h.gc | 1 + .../jak2/engine/camera/cam-interface-h.gc | 2 +- goal_src/jak2/engine/camera/cam-interface.gc | 2 +- goal_src/jak2/engine/camera/cam-states-dbg.gc | 6 +- goal_src/jak2/engine/common_objs/water.gc | 2 +- goal_src/jak2/engine/debug/debug.gc | 51 ++-- goal_src/jak2/engine/debug/default-menu.gc | 61 ++-- goal_src/jak2/engine/debug/editable-player.gc | 21 +- .../jak2/engine/debug/nav/nav-graph-editor.gc | 111 ++++---- goal_src/jak2/engine/game/main.gc | 13 - goal_src/jak2/engine/gfx/mood/weather-part.gc | 40 ++- goal_src/jak2/engine/gfx/ocean/ocean-mid.gc | 14 +- goal_src/jak2/engine/gfx/ocean/ocean-near.gc | 14 +- goal_src/jak2/engine/ps2/pad.gc | 62 +++- goal_src/jak2/engine/target/darkjak-h.gc | 4 +- goal_src/jak2/engine/target/gun/gun-h.gc | 12 +- goal_src/jak2/engine/target/gun/gun-states.gc | 4 +- goal_src/jak2/engine/target/logic-target.gc | 49 ++-- goal_src/jak2/engine/target/target-darkjak.gc | 94 ++++-- goal_src/jak2/engine/target/target-gun.gc | 32 ++- goal_src/jak2/engine/target/target-h.gc | 85 +----- goal_src/jak2/engine/target/target-handler.gc | 24 +- goal_src/jak2/engine/target/target-util.gc | 23 +- goal_src/jak2/engine/target/target.gc | 152 +++++----- goal_src/jak2/engine/target/target2.gc | 4 +- goal_src/jak2/engine/ui/minimap.gc | 7 +- goal_src/jak2/levels/atoll/sig0-course.gc | 166 +++++------ .../levels/city/kiddogescort/hal4-course.gc | 42 +-- .../levels/city/market/ashelin/ash4-course.gc | 59 ++-- .../levels/city/oracle/oracle-training.gc | 24 +- .../jak2/levels/city/slums/kor/hal3-course.gc | 73 ++--- goal_src/jak2/levels/common/ai/bot-h.gc | 30 +- goal_src/jak2/levels/common/ai/bot.gc | 2 +- .../common/enemy/amphibian/amphibian.gc | 29 +- .../jak2/levels/common/enemy/grenadier.gc | 34 ++- .../common/enemy/hover/hover-nav-control-h.gc | 15 +- .../common/enemy/hover/hover-nav-control.gc | 22 +- goal_src/jak2/levels/common/enemy/spyder.gc | 62 ++-- .../jak2/levels/common/entities/gun-buoy.gc | 79 +++--- goal_src/jak2/levels/forest/wren.gc | 45 +-- .../fortress/dump/fort-robotank-turret.gc | 146 ++++++---- .../levels/fortress/dump/fort-robotank.gc | 54 ++-- goal_src/jak2/levels/mountain/mountain-obs.gc | 41 +-- .../jak2/levels/nest/boss/nestb-scenes.gc | 2 +- goal_src/jak2/levels/ruins/rapid-gunner.gc | 62 ++-- goal_src/jak2/levels/sewer/hal2-course.gc | 46 +-- goal_src/jak2/levels/tomb/tomb-obs.gc | 35 ++- goal_src/jak2/levels/tomb/tomb-water.gc | 25 +- goal_src/jak2/levels/under/sig5-course.gc | 52 ++-- .../jak2/levels/under/under-shoot-block.gc | 64 +++-- .../reference/jak2/decompiler-macros.gc | 16 ++ .../jak2/engine/camera/cam-interface_REF.gc | 2 +- .../jak2/engine/camera/cam-states-dbg_REF.gc | 10 +- .../jak2/engine/common_objs/water_REF.gc | 2 +- .../reference/jak2/engine/debug/debug_REF.gc | 11 +- .../jak2/engine/debug/default-menu_REF.gc | 61 ++-- .../jak2/engine/debug/editable-player_REF.gc | 22 +- .../engine/debug/nav/nav-graph-editor_REF.gc | 113 ++++---- .../jak2/engine/gfx/mood/weather-part_REF.gc | 44 +-- .../jak2/engine/gfx/ocean/ocean-mid_REF.gc | 18 +- .../jak2/engine/gfx/ocean/ocean-near_REF.gc | 19 +- .../reference/jak2/engine/ps2/pad_REF.gc | 48 ++-- .../jak2/engine/target/darkjak-h_REF.gc | 4 +- .../jak2/engine/target/gun/gun-h_REF.gc | 2 +- .../jak2/engine/target/gun/gun-states_REF.gc | 4 +- .../jak2/engine/target/logic-target_REF.gc | 53 ++-- .../jak2/engine/target/target-darkjak_REF.gc | 94 ++++-- .../jak2/engine/target/target-gun_REF.gc | 32 ++- .../jak2/engine/target/target-h_REF.gc | 2 +- .../jak2/engine/target/target-handler_REF.gc | 24 +- .../jak2/engine/target/target-util_REF.gc | 23 +- .../jak2/engine/target/target2_REF.gc | 4 +- .../jak2/engine/target/target_REF.gc | 152 +++++----- .../reference/jak2/engine/ui/minimap_REF.gc | 12 +- .../jak2/levels/atoll/sig0-course_REF.gc | 166 +++++------ .../city/kiddogescort/hal4-course_REF.gc | 42 +-- .../city/market/ashelin/ash4-course_REF.gc | 59 ++-- .../levels/city/oracle/oracle-training_REF.gc | 24 +- .../jak2/levels/common/ai/bot-h_REF.gc | 4 +- .../jak2/levels/common/ai/bot_REF.gc | 2 +- .../common/enemy/amphibian/amphibian_REF.gc | 16 +- .../jak2/levels/common/enemy/grenadier_REF.gc | 22 +- .../enemy/hover/hover-nav-control-h_REF.gc | 2 +- .../enemy/hover/hover-nav-control_REF.gc | 22 +- .../jak2/levels/common/enemy/spyder_REF.gc | 55 ++-- .../levels/common/entities/gun-buoy_REF.gc | 66 ++--- .../reference/jak2/levels/forest/wren_REF.gc | 32 +-- .../fortress/dump/fort-robotank-turret_REF.gc | 125 ++++---- .../levels/fortress/dump/fort-robotank_REF.gc | 32 +-- .../jak2/levels/mountain/mountain-obs_REF.gc | 32 +-- .../jak2/levels/nest/boss/nestb-scenes_REF.gc | 2 +- .../jak2/levels/ruins/rapid-gunner_REF.gc | 52 ++-- .../jak2/levels/sewer/hal2-course_REF.gc | 46 +-- .../jak2/levels/tomb/tomb-obs_REF.gc | 28 +- .../jak2/levels/tomb/tomb-water_REF.gc | 16 +- .../jak2/levels/under/sig5-course_REF.gc | 52 ++-- .../levels/under/under-shoot-block_REF.gc | 57 ++-- 104 files changed, 2472 insertions(+), 1778 deletions(-) diff --git a/common/type_system/defenum.cpp b/common/type_system/defenum.cpp index 893317ed62..a18206452a 100644 --- a/common/type_system/defenum.cpp +++ b/common/type_system/defenum.cpp @@ -48,8 +48,8 @@ std::string symbol_string(const goos::Object& obj) { EnumType* parse_defenum(const goos::Object& defenum, TypeSystem* ts, DefinitionMetadata* symbol_metadata) { - // default enum type will be int32. - TypeSpec base_type = ts->make_typespec("int32"); + // default enum type will be int64 + TypeSpec base_type = ts->make_typespec("int64"); bool is_bitfield = false; std::unordered_map entries; diff --git a/decompiler/IR2/Form.cpp b/decompiler/IR2/Form.cpp index 51ede30fb0..1c8cf90b99 100644 --- a/decompiler/IR2/Form.cpp +++ b/decompiler/IR2/Form.cpp @@ -1873,6 +1873,10 @@ std::string fixed_operator_to_string(FixedOperatorKind kind) { return "cpad-pressed?"; case FixedOperatorKind::CPAD_HOLD_P: return "cpad-hold?"; + case FixedOperatorKind::MOUSE_PRESSED_P: + return "mouse-pressed?"; + case FixedOperatorKind::MOUSE_HOLD_P: + return "mouse-hold?"; case FixedOperatorKind::VECTOR_LENGTH: return "vector-length"; case FixedOperatorKind::VECTOR_PLUS_FLOAT_TIMES: diff --git a/decompiler/IR2/FormExpressionAnalysis.cpp b/decompiler/IR2/FormExpressionAnalysis.cpp index 7ef5891c7d..1a45ae9d60 100644 --- a/decompiler/IR2/FormExpressionAnalysis.cpp +++ b/decompiler/IR2/FormExpressionAnalysis.cpp @@ -4732,6 +4732,72 @@ enum first: return nullptr; } +FormElement* try_make_logtest_mouse_macro(Form* in, FormPool& pool) { + /* +(defmacro mouse-pressed () + `(-> *mouse* button0-rel 0) + ) + +(defmacro mouse-hold () + `(-> *mouse* button0-abs 0) + ) + +(defmacro mouse-pressed? (&rest buttons) + `(logtest? (mouse-pressed) (mouse-buttons ,@buttons)) + ) + +(defmacro mouse-hold? (&rest buttons) + `(logtest? (mouse-hold) (mouse-buttons ,@buttons)) + ) + */ + auto static const mouse_matcher = Matcher::op( + GenericOpMatcher::fixed(FixedOperatorKind::LOGTEST), + {Matcher::deref(Matcher::symbol("*mouse*"), false, + {DerefTokenMatcher::any_string(2), DerefTokenMatcher::integer(0)}), + Matcher::op_with_rest(GenericOpMatcher::func(Matcher::constant_token("mouse-buttons")), + {})}); + auto static const mouse_matcher_inv = Matcher::op( + GenericOpMatcher::fixed(FixedOperatorKind::LOGTEST), + {Matcher::op_with_rest(GenericOpMatcher::func(Matcher::constant_token("mouse-buttons")), {}), + Matcher::deref(Matcher::symbol("*mouse*"), false, + {DerefTokenMatcher::any_string(2), DerefTokenMatcher::integer(0)})}); + + bool inv_match = false; + auto mr = match(mouse_matcher, in); + if (!mr.matched) { + mr = match(mouse_matcher_inv, in); + inv_match = true; + } + if (mr.matched) { + enum { ABS, REL, NIL } t = NIL; + if (mr.maps.strings.at(2) == "button0-abs") { + t = ABS; + } else if (mr.maps.strings.at(2) == "button0-rel") { + t = REL; + } + + printf("t is %d\n", t); + if (t != NIL) { + auto logtest_elt = dynamic_cast(in->at(0)); + if (logtest_elt) { + auto buttons_form = logtest_elt->elts().at(inv_match ? 0 : 1); + std::vector v; + GenericElement* butts = + dynamic_cast(buttons_form->at(0)); // the form with the buttons itself + if (butts) { + v = butts->elts(); + } + + return pool.alloc_element( + GenericOperator::make_fixed(t == ABS ? FixedOperatorKind::MOUSE_HOLD_P + : FixedOperatorKind::MOUSE_PRESSED_P), + v); + } + } + } + return nullptr; +} + FormElement* try_make_logtest_cpad_macro(Form* in, FormPool& pool) { /* (defmacro cpad-pressed (pad-idx) @@ -4798,6 +4864,22 @@ FormElement* try_make_logtest_cpad_macro(Form* in, FormPool& pool) { } return nullptr; } + +FormElement* convert_logtest_to_fancy_macro(FormPool& pool, Form* logtest_form) { + auto as_cpad_macro = try_make_logtest_cpad_macro(logtest_form, pool); + if (as_cpad_macro) { + return as_cpad_macro; + } + auto as_mouse_macro = try_make_logtest_mouse_macro(logtest_form, pool); + if (as_mouse_macro) { + return as_mouse_macro; + } + auto focus_test_macro = try_make_focus_test_macro(logtest_form, pool); + if (focus_test_macro) { + return focus_test_macro; + } + return nullptr; +} } // namespace FormElement* ConditionElement::make_zero_check_generic(const Env& env, @@ -4849,17 +4931,11 @@ FormElement* ConditionElement::make_zero_check_generic(const Env& env, auto as_logtest = try_make_nonzero_logtest(source_forms.at(0), pool); if (as_logtest) { auto logtest_form = pool.alloc_single_form(nullptr, as_logtest); - auto as_cpad_macro = try_make_logtest_cpad_macro(logtest_form, pool); - if (as_cpad_macro) { - logtest_form = pool.alloc_single_form(nullptr, as_cpad_macro); + auto fancy_form = convert_logtest_to_fancy_macro(pool, logtest_form); + if (fancy_form) { return pool.alloc_element( - GenericOperator::make_compare(IR2_Condition::Kind::FALSE), logtest_form); - } - 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); + GenericOperator::make_compare(IR2_Condition::Kind::FALSE), + pool.alloc_single_form(nullptr, fancy_form)); } return pool.alloc_element( GenericOperator::make_compare(IR2_Condition::Kind::FALSE), logtest_form); @@ -4899,15 +4975,12 @@ FormElement* ConditionElement::make_nonzero_check_generic(const Env& env, auto as_logtest = try_make_nonzero_logtest(source_forms.at(0), pool); if (as_logtest) { auto logtest_form = pool.alloc_single_form(nullptr, as_logtest); - auto as_cpad_macro = try_make_logtest_cpad_macro(logtest_form, pool); - if (as_cpad_macro) { - return as_cpad_macro; + auto fancy_form = convert_logtest_to_fancy_macro(pool, logtest_form); + if (fancy_form) { + return fancy_form; + } else { + return as_logtest; } - auto focus_test_macro = try_make_focus_test_macro(logtest_form, pool); - if (focus_test_macro) { - return focus_test_macro; - } - return as_logtest; } return pool.alloc_element(GenericOperator::make_compare(m_kind), source_forms); @@ -6080,17 +6153,11 @@ void ConditionalMoveFalseElement::push_to_stack(const Env& env, FormPool& pool, 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 as_cpad_macro = try_make_logtest_cpad_macro(logtest_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(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); - } + auto fancy_form = convert_logtest_to_fancy_macro(pool, logtest_form); + if (fancy_form) { + val = pool.alloc_single_form(nullptr, fancy_form); + } else { + val = logtest_form; } } } else { @@ -6099,17 +6166,11 @@ void ConditionalMoveFalseElement::push_to_stack(const Env& env, FormPool& pool, 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; - } + auto fancy_form = convert_logtest_to_fancy_macro(pool, not_form); + if (fancy_form) { + val = pool.alloc_single_form(nullptr, fancy_form); + } else { + val = not_form; } } } diff --git a/decompiler/IR2/IR2_common.h b/decompiler/IR2/IR2_common.h index 590c8e98ec..4033141121 100644 --- a/decompiler/IR2/IR2_common.h +++ b/decompiler/IR2/IR2_common.h @@ -174,6 +174,8 @@ enum class FixedOperatorKind { SEND_EVENT, CPAD_PRESSED_P, CPAD_HOLD_P, + MOUSE_PRESSED_P, + MOUSE_HOLD_P, FOCUS_TEST, INVALID }; diff --git a/decompiler/analysis/insert_lets.cpp b/decompiler/analysis/insert_lets.cpp index 98420d5958..88d9995153 100644 --- a/decompiler/analysis/insert_lets.cpp +++ b/decompiler/analysis/insert_lets.cpp @@ -528,6 +528,12 @@ FormElement* rewrite_as_send_event(LetElement* in, if (enum_ts) { param_val = cast_to_bitfield_enum(enum_ts, pool, env, val); } + } else if (param_idx == 2 && param_values.at(0)->to_string(env) == "'darkjak" && + msg_str == "'change-mode") { + auto enum_ts = env.dts->ts.try_enum_lookup("darkjak-stage"); + if (enum_ts) { + param_val = cast_to_bitfield_enum(enum_ts, pool, env, val); + } } } // if we didn't cast diff --git a/decompiler/config/jak2/all-types.gc b/decompiler/config/jak2/all-types.gc index a4f87595e0..8618576647 100644 --- a/decompiler/config/jak2/all-types.gc +++ b/decompiler/config/jak2/all-types.gc @@ -3467,6 +3467,14 @@ (confirm 24) ) +(defenum mouse-buttons + :bitfield #t + :type uint32 + (left) + (right) + (middle) + ) + (deftype scf-time (structure) ((stat uint8 :offset-assert 0) (second uint8 :offset-assert 1) @@ -3556,9 +3564,9 @@ (deltay int8 :offset-assert 23) (wheel uint8 :offset-assert 24) (change-time time-frame :offset-assert 32) - (button0-abs uint32 3 :offset-assert 40) - (button0-shadow-abs uint32 1 :offset-assert 52) - (button0-rel uint32 3 :offset-assert 56) + (button0-abs mouse-buttons 3 :offset-assert 40) + (button0-shadow-abs mouse-buttons 1 :offset-assert 52) + (button0-rel mouse-buttons 3 :offset-assert 56) (pos vector 2 :inline :offset-assert 80) (posx float :offset 80) (posy float :offset 84) @@ -18567,6 +18575,19 @@ ;; target-h ;; ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; +(defenum darkjak-stage + :bitfield #t + :type uint32 + (force-on) + (active) + (bomb0) + (bomb1) + (invinc) + (giant) + (no-anim) + (disable-force-on) + ) + (declare-type shadow-geo basic) (declare-type sidekick basic) (declare-type racer-info basic) @@ -18695,7 +18716,7 @@ target-darkjak-bomb0 (target-darkjak-bomb1 float float) target-darkjak-get-off - (target-darkjak-get-on int) + (target-darkjak-get-on darkjak-stage) target-darkjak-giant target-darkjak-running-attack (target-death symbol) @@ -24399,7 +24420,7 @@ (define-extern history-draw-and-update (function pos-history symbol vector symbol)) (define-extern dma-timeout-cam (function vector)) (define-extern display-file-info (function int)) -(define-extern add-debug-cursor (function symbol bucket-id int int int none)) +(define-extern add-debug-cursor (function symbol bucket-id int int mouse-buttons int)) (define-extern *boundary-polygon* (inline-array sky-vertex)) (define-extern init-boundary-regs (function none)) (define-extern add-boundary-shader (function texture-id dma-buffer none)) @@ -27673,7 +27694,7 @@ (define-extern position-in-front-of-screen! (function vector float vector vector)) (define-extern matrix-local->world "Returns [[*math-camera*]]'s `inv-camera-rot-smooth` if `smooth?` is true, else return `inv-camera-rot`" - (function symbol matrix)) + (function symbol symbol matrix)) (define-extern matrix-world->local "Returns [[*math-camera*]]'s `camera-rot`" (function symbol object matrix)) @@ -28675,6 +28696,16 @@ ) ) +(defenum gun-track-flags + :bitfield #t + :type uint16 + (gutflags-0) + (gutflags-1) + (gutflags-2) + (gutflags-3) + (gutflags-4) + ) + (deftype gun-info (basic) ((process (pointer target) :offset-assert 4) (gun (pointer gun) :offset-assert 8) @@ -28719,7 +28750,7 @@ (laser-point vector :inline :offset-assert 304) (laser-dir vector 2 :inline :offset-assert 320) ;; guess (laser-hit-point vector :inline :offset-assert 352) - (track? uint16 :offset-assert 368) + (track? gun-track-flags :offset-assert 368) (track-tilt degrees :offset-assert 372) (track-turn degrees :offset-assert 376) (track-find-range meters :offset-assert 380) @@ -29006,8 +29037,8 @@ (start-time time-frame :offset-assert 16) (attack-time time-frame :offset-assert 24) (attack-count uint64 :offset-assert 32) - (stage uint32 :offset-assert 40) - (want-stage uint32 :offset-assert 44) + (stage darkjak-stage :offset-assert 40) + (want-stage darkjak-stage :offset-assert 44) (clock-pos float :offset-assert 48) (clock-vel float :offset-assert 52) (clock-on symbol :offset-assert 56) @@ -35342,6 +35373,18 @@ ) ) +(defenum spyder-flags + :bitfield #t + (spflags-0) + (spflags-1) + (spflags-2) + (spflags-3) + (spflags-4) + (spflags-5) + (spflags-6) + (spflags-7) + ) + (deftype spyder (nav-enemy) ((los los-control :inline :offset-assert 608) (joint joint-mod :offset-assert 756) @@ -35349,7 +35392,7 @@ ;; (focus-pos vector :inline :offset 348) (face-pos vector :inline :offset 800) (my-up-vector vector :inline :offset-assert 816) - (status-flags uint64 :offset-assert 832) + (status-flags spyder-flags :offset-assert 832) (change-dir-timer time-frame :offset-assert 840) (fire-info vector 2 :inline :offset-assert 848) (joint-ik joint-mod-ik 4 :offset 880) @@ -35881,10 +35924,23 @@ :flag-assert #x900000010 ) +(defenum hover-nav-flags + :bitfield #t + :type uint16 + (honflags-0) + (honflags-1) + (honflags-2) + (honflags-3) + (honflags-4) + (honflags-5) + (honflags-6) + (honflags-7) + ) + (deftype hover-nav-control (basic) ((root collide-shape-moving :offset-assert 4) (nav nav-network :offset-assert 8) - (flags uint16 :offset-assert 12) + (flags hover-nav-flags :offset-assert 12) (params hover-nav-params :offset-assert 16) (path-timer time-frame :offset-assert 24) (transvv vector :inline :offset-assert 32) @@ -36551,6 +36607,20 @@ ;; wren ;; ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; +(defenum wren-flags + :bitfield #t + :type uint16 + (wrflags-0) + (wrflags-1) + (wrflags-2) + (wrflags-3) + (wrflags-4) + (wrflags-5) + (wrflags-6) + (wrflags-7) + ) + + (deftype wren (process-drawable) ((move-dest vector :inline :offset-assert 208) (fly-curve curve-control 2 :offset-assert 224) @@ -36565,7 +36635,7 @@ (bob-level-seek float :offset-assert 264) (bank-angle float :offset-assert 268) (peck-timer uint64 :offset-assert 272) - (flags uint16 :offset-assert 280) + (flags wren-flags :offset-assert 280) ) :method-count-assert 28 :size-assert #x11a @@ -37311,6 +37381,18 @@ :flag-assert #x900000040 ) +(defenum grenadier-flags + :bitfield #t + (grflags-0) + (grflags-1) + (grflags-2) + (grflags-3) + (grflags-4) + (grflags-5) + (grflags-6) + (grflags-7) + ) + (deftype grenadier (nav-enemy) ((shot-trajectory trajectory :inline :offset-assert 608) (hostile-path path-control :offset-assert 648) @@ -37319,7 +37401,7 @@ (heading symbol :offset-assert 724) (move-pos vector :inline :offset-assert 736) (move-angle float :offset-assert 752) - (status-flags uint64 :offset-assert 760) + (status-flags grenadier-flags :offset-assert 760) (suppress-knockaside-timer time-frame :offset-assert 768) ) :method-count-assert 184 @@ -38710,10 +38792,19 @@ (idle () _type_ :state 20)) ) +(defenum mtn-plat-flags + :bitfield #t + :type uint16 + (mtpflags-0) + (mtpflags-1) + (mtpflags-2) + (mtpflags-3) + ) + (deftype mtn-plat-return (base-plat) ( (ride-timer time-frame :offset-assert 272) - (flags uint16 :offset-assert 280) + (flags mtn-plat-flags :offset-assert 280) (path-pos float :offset-assert 284) (dest-pos float :offset-assert 288) (path-speed float :offset-assert 292) @@ -39346,6 +39437,32 @@ ) ;; ---bot-h:bot-flags +(defenum bot-task-bits + :type uint32 + :bitfield #t + (botbits-0) + (botbits-1) + (botbits-2) + (botbits-3) + (botbits-4) + (botbits-5) + (botbits-6) + (botbits-7) + ) + +(defenum waypoint-bits + :bitfield #t + :type uint32 + (wabits-0) + (wabits-1) + (wabits-2) + (wabits-3) + (wabits-4) + (wabits-5) + (wabits-6) + (wabits-7) + ) + (deftype bot (nav-enemy) ((bot-flags bot-flags :offset-assert 604) (min-speed float :offset-assert 608) @@ -39361,9 +39478,9 @@ (ai-ctrl ai-task-control :offset-assert 648) (course bot-course :offset-assert 652) (waypoint bot-waypoint :offset-assert 656) - (waypoint-bits uint32 :offset-assert 660) + (waypoint-bits waypoint-bits :offset-assert 660) (waypoint-int32a int32 :offset-assert 664) - (bot-task-bits uint32 :offset-assert 668) + (bot-task-bits bot-task-bits :offset-assert 668) (hit-invuln-ignore-me-delay uint32 :offset-assert 672) (hit-invuln-focus-disable-delay uint32 :offset-assert 676) (warn-to-fail-timeout uint32 :offset-assert 680) @@ -40050,9 +40167,22 @@ :flag-assert #x900000054 ) +(defenum amphibian-flags + :bitfield #t + :type uint8 + (amflags-0) + (amflags-1) + (amflags-2) + (amflags-3) + (amflags-4) + (amflags-5) + (amflags-6) + (amflags-7) + ) + (deftype amphibian (nav-enemy) ((tongue-scale float :offset-assert 604) - (flags uint8 :offset-assert 608) + (flags amphibian-flags :offset-assert 608) (knocked-anim-index int8 :offset-assert 609) (jump-anim-index int8 :offset-assert 610) (tongue-mode uint64 :offset-assert 616) @@ -40802,6 +40932,19 @@ ) ) +(defenum gun-buoy-flags + :bitfield #t + :type uint16 + (gubflags-0) + (gubflags-1) + (gubflags-2) + (gubflags-3) + (gubflags-4) + (gubflags-5) + (gubflags-6) + (gubflags-7) + ) + (deftype gun-buoy (nav-enemy) ((gun-elev-jmod joint-mod :offset-assert 604) (start-pos vector :inline :offset-assert 608) @@ -40821,7 +40964,7 @@ (stare-down-timer time-frame :offset-assert 736) (warning-id sound-id :offset-assert 744) (voice-id sound-id :offset-assert 748) - (flags uint16 :offset-assert 752) + (flags gun-buoy-flags :offset-assert 752) ) :method-count-assert 184 :size-assert #x2f2 @@ -42067,6 +42210,27 @@ ;; fort-robotank-turret ;; ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; +(defenum robotank-turret-flags + :bitfield #t + :type uint16 + (rotflags-0) + (rotflags-1) + (rotflags-2) + (rotflags-3) + (rotflags-4) + (rotflags-5) + (rotflags-6) + (rotflags-7) + (rotflags-8) + (rotflags-9) + (rotflags-10) + (rotflags-11) + (rotflags-12) + (rotflags-13) + (rotflags-14) + (rotflags-15) + ) + (deftype fort-robotank-turret (process-focusable) ( (los los-control :inline :offset-assert 208) @@ -42093,7 +42257,7 @@ (gun-joint-r int32 2 :offset-assert 572) ;; elt size: 4 (gun-spread float :offset-assert 580) (gun-index int32 :offset-assert 584) - (flags uint16 :offset-assert 588) + (flags robotank-turret-flags :offset-assert 588) (turn-sound-id sound-id :offset-assert 592) ) :method-count-assert 35 @@ -42237,6 +42401,28 @@ :flag-assert #x900000090 ) + +(defenum robotank-flags + :bitfield #t + :type uint16 + (roflags-0) + (roflags-1) + (roflags-2) + (roflags-3) + (roflags-4) + (roflags-5) + (roflags-6) + (roflags-7) + (roflags-8) + (roflags-9) + (roflags-10) + (roflags-11) + (roflags-12) + (roflags-13) + (roflags-14) + (roflags-15) + ) + (deftype fort-robotank (process-drawable) ( (root collide-shape-moving :override) @@ -42246,7 +42432,7 @@ (tread fort-robotank-tread-info 2 :inline :offset-assert 224 :score 100) ;; elt size: 144 (path-info fort-robotank-path-info-array :offset-assert 512) (segment-table (inline-array fort-robotank-segment) :offset-assert 516) - (flags uint16 :offset-assert 520) + (flags robotank-flags :offset-assert 520) (pov-cam-offset vector 2 :inline :offset-assert 528) ;; elt size: 16 (turret handle :offset-assert 560) (no-collision-timer time-frame :offset-assert 568) @@ -46148,10 +46334,17 @@ ) ) +(defenum tomb-plat-flags + :bitfield #t + :type uint16 + (topflags-0) + (topflags-1) + ) + (deftype tomb-plat-return (base-plat) ((intro-path path-control :offset-assert 272) (ride-timer time-frame :offset-assert 280) - (flags uint16 :offset-assert 288) + (flags tomb-plat-flags :offset-assert 288) (path-pos float :offset-assert 292) (dest-pos float :offset-assert 296) (path-speed float :offset-assert 300) @@ -46340,6 +46533,15 @@ ) ) +(defenum tomb-vibe-flags + :bitfield #t + :type uint16 + (tovflags-0) + (tovflags-1) + (tovflags-2) + (tovflags-3) + ) + (deftype tomb-vibe (process-drawable) ((spawn-pos vector :inline :offset-assert 208) (pat-tbl (pointer int32) :offset-assert 224) ;; pattern-table @@ -46350,7 +46552,7 @@ (pat-duration time-frame :offset-assert 248) (actor-group (pointer actor-group) :offset-assert 256) (actor-group-count int32 :offset-assert 260) - (flags uint16 :offset-assert 264) + (flags tomb-vibe-flags :offset-assert 264) (on-activate basic :offset-assert 268) ) :method-count-assert 24 @@ -47761,6 +47963,13 @@ :flag-assert #x900000080 ) +(defenum under-block-flags + :bitfield #t + (unbflags-0) + (unbflags-1) + (unbflags-2) + ) + (deftype under-block (process-focusable) ((puzzle under-block-puzzle :offset-assert 204) (my-parent (pointer process) :offset-assert 208) @@ -47776,7 +47985,7 @@ (pulse-op int8 :offset-assert 224) (pulse-pc int8 :offset-assert 225) (pulse-ctr int8 :offset-assert 226) - (flags uint64 :offset-assert 232) + (flags under-block-flags :offset-assert 232) (activated-time time-frame :offset-assert 240) (rot-axis vector :inline :offset-assert 256) (away-from-focal-pt vector :inline :offset-assert 272) @@ -52916,6 +53125,16 @@ ;; rapid-gunner ;; ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; +(defenum rapid-gunner-flags + :bitfield #t + (ragflags-0) + (ragflags-1) + (ragflags-2) + (ragflags-3) + (ragflags-4) + (ragflags-5) + ) + (deftype rapid-gunner (nav-enemy) ((los los-control :inline :offset-assert 608) (joint joint-mod :offset-assert 756) @@ -52931,7 +53150,7 @@ (spin-up-angle float :offset-assert 840) (spin-up-timer time-frame :offset-assert 848) (shoot-anim-index int32 :offset-assert 856) - (status-flags uint64 :offset-assert 864) + (status-flags rapid-gunner-flags :offset-assert 864) (start-pos vector :inline :offset-assert 880) (dest-pos vector :inline :offset-assert 896) (hop-dir vector :inline :offset-assert 912) diff --git a/decompiler/config/jak2/ntsc_v1/type_casts.jsonc b/decompiler/config/jak2/ntsc_v1/type_casts.jsonc index da5cd58e86..631c963dc9 100644 --- a/decompiler/config/jak2/ntsc_v1/type_casts.jsonc +++ b/decompiler/config/jak2/ntsc_v1/type_casts.jsonc @@ -7159,7 +7159,6 @@ [18, "a1", "process"] ], "hal-simple-check-too-far": [[25, "v1", "process-drawable"]], - "(method 228 hal-help-kid)": [[22, "a0", "traffic-manager"]], "(anon-function 4 hal3-course)": [ [25, "v1", "hal3-course"], [138, "v1", "halt-wait-spot"] diff --git a/goal_src/jak1/engine/game/fact-h.gc b/goal_src/jak1/engine/game/fact-h.gc index 3656a68483..a9511bc914 100644 --- a/goal_src/jak1/engine/game/fact-h.gc +++ b/goal_src/jak1/engine/game/fact-h.gc @@ -49,6 +49,7 @@ ) (defenum pickup-type + :type int32 (none) (eco-yellow) (eco-red) diff --git a/goal_src/jak2/engine/camera/cam-interface-h.gc b/goal_src/jak2/engine/camera/cam-interface-h.gc index 7d9d61cef2..9617cb7473 100644 --- a/goal_src/jak2/engine/camera/cam-interface-h.gc +++ b/goal_src/jak2/engine/camera/cam-interface-h.gc @@ -14,7 +14,7 @@ "Returns [[*math-camera*]]'s `inv-camera-rot`" (function matrix)) -(define-extern matrix-local->world (function symbol matrix)) +(define-extern matrix-local->world (function symbol symbol matrix)) ;; DECOMP BEGINS diff --git a/goal_src/jak2/engine/camera/cam-interface.gc b/goal_src/jak2/engine/camera/cam-interface.gc index f08b0a8abb..47598dcf34 100644 --- a/goal_src/jak2/engine/camera/cam-interface.gc +++ b/goal_src/jak2/engine/camera/cam-interface.gc @@ -24,7 +24,7 @@ arg0 ) -(defun matrix-local->world ((smooth? symbol)) +(defun matrix-local->world ((smooth? symbol) (arg1 symbol)) "Returns [[*math-camera*]]'s `inv-camera-rot-smooth` if `smooth?` is true, else return `inv-camera-rot`" (if smooth? (-> *math-camera* inv-camera-rot-smooth) diff --git a/goal_src/jak2/engine/camera/cam-states-dbg.gc b/goal_src/jak2/engine/camera/cam-states-dbg.gc index 70d75991e8..f8fde412ad 100644 --- a/goal_src/jak2/engine/camera/cam-states-dbg.gc +++ b/goal_src/jak2/engine/camera/cam-states-dbg.gc @@ -104,7 +104,7 @@ (let ((v1-0 (new 'stack-no-clear 'vector))) (vector-! v1-0 (the-as vector (-> *mouse* pos)) (-> *mouse* pos 1)) (cond - ((logtest? (-> *mouse* button0-abs 0) 1) + ((mouse-hold? left) (let ((a0-7 (new 'stack-no-clear 'vector))) 0.0 (vector-! a0-7 (-> *math-camera* trans) (-> *setting-control* cam-current mouse-tumble-point)) @@ -137,11 +137,11 @@ ) ) ) - ((logtest? (-> *mouse* button0-abs 0) 2) + ((mouse-hold? right) (+! (-> arg1 x) (* (-> v1-0 x) (-> *CAM_FREE-bank* speed))) (set! (-> arg1 z) (+ (-> arg1 z) (* (-> v1-0 y) (-> *CAM_FREE-bank* speed)))) ) - ((logtest? (-> *mouse* button0-abs 0) 4) + ((mouse-hold? middle) (+! (-> arg1 x) (* (-> v1-0 x) (-> *CAM_FREE-bank* speed))) (set! (-> arg1 y) (+ (-> arg1 y) (* (-> v1-0 y) (-> *CAM_FREE-bank* speed)))) ) diff --git a/goal_src/jak2/engine/common_objs/water.gc b/goal_src/jak2/engine/common_objs/water.gc index 74d660afed..5947a26359 100644 --- a/goal_src/jak2/engine/common_objs/water.gc +++ b/goal_src/jak2/engine/common_objs/water.gc @@ -1115,7 +1115,7 @@ ) ((and (logtest? (focus-status dark) (-> obj process focus-status)) (nonzero? (-> obj process darkjak)) - (logtest? (-> obj process darkjak stage) 32) + (logtest? (-> obj process darkjak stage) (darkjak-stage giant)) ) (set! (-> obj swim-height) 16384.0) ) diff --git a/goal_src/jak2/engine/debug/debug.gc b/goal_src/jak2/engine/debug/debug.gc index 64deec7deb..3998499002 100644 --- a/goal_src/jak2/engine/debug/debug.gc +++ b/goal_src/jak2/engine/debug/debug.gc @@ -1581,39 +1581,38 @@ Most functions take a boolean as their first argument. If the boolean is set to 0 ) -(defun-debug add-debug-cursor ((enable symbol) (bucket bucket-id) (x int) (y int) (arg4 int)) +(defun-debug add-debug-cursor ((enable symbol) (bucket bucket-id) (x int) (y int) (arg4 mouse-buttons)) (when enable - (with-dma-buffer-add-bucket ((buf (-> *display* frames (-> *display* on-screen) global-buf)) - bucket - ) - (set! (-> (new 'stack-no-clear 'vector) quad) (the-as uint128 0)) - (let ((v1-7 arg4)) - (draw-string-xy - "X" - buf - (+ x -5) - (+ y -4) - (cond - ((= v1-7 1) - (font-color red) - ) - ((= v1-7 2) - (font-color yellow) - ) - ((= v1-7 4) - (font-color green) - ) - (else - (font-color default) - ) + (with-dma-buffer-add-bucket ((buf (-> *display* frames (-> *display* on-screen) global-buf)) + bucket + ) + (set! (-> (new 'stack-no-clear 'vector) quad) (the-as uint128 0)) + (let ((v1-7 arg4)) + (draw-string-xy + "X" + buf + (+ x -5) + (+ y -4) + (cond + ((= v1-7 (mouse-buttons left)) + (font-color red) + ) + ((= v1-7 (mouse-buttons right)) + (font-color yellow) + ) + ((= v1-7 (mouse-buttons middle)) + (font-color green) + ) + (else + (font-color default) ) - (font-flags shadow) ) + (font-flags shadow) ) ) ) + ) 0 - (none) ) diff --git a/goal_src/jak2/engine/debug/default-menu.gc b/goal_src/jak2/engine/debug/default-menu.gc index 3c14dab7a3..2856eb7a8a 100644 --- a/goal_src/jak2/engine/debug/default-menu.gc +++ b/goal_src/jak2/engine/debug/default-menu.gc @@ -3906,7 +3906,7 @@ ) (logior! (-> *game-info* features) (game-feature darkjak)) (logior! (-> *game-info* debug-features) (game-feature darkjak)) - (send-event *target* 'change-mode 'darkjak #f 3) + (send-event *target* 'change-mode 'darkjak #f (darkjak-stage force-on active)) ) ) (function "indax" #f ,(lambda () @@ -3972,7 +3972,7 @@ ) (logior! (-> *game-info* features) (game-feature darkjak)) (logior! (-> *game-info* debug-features) (game-feature darkjak)) - (send-event *target* 'change-mode 'darkjak #f 3) + (send-event *target* 'change-mode 'darkjak #f (darkjak-stage force-on active)) ) ) (function "rapid" #f ,(lambda ((arg0 object) (arg1 debug-menu-msg)) @@ -3981,37 +3981,46 @@ ) (logior! (-> *game-info* features) (game-feature darkjak)) (logior! (-> *game-info* debug-features) (game-feature darkjak)) - (send-event *target* 'change-mode 'darkjak #f 2) + (send-event *target* 'change-mode 'darkjak #f (darkjak-stage active)) ) ) (function "bomb0" #f ,(lambda ((arg0 object) (arg1 debug-menu-msg)) (if (not *target*) (start 'debug (get-current-continue-forced *game-info*)) ) - (send-event *target* 'change-mode 'darkjak #f 7) - ) - ) - (function "bomb1" #f ,(lambda ((arg0 object) (arg1 debug-menu-msg)) - (if (not *target*) - (start 'debug (get-current-continue-forced *game-info*)) - ) - (send-event *target* 'change-mode 'darkjak #f 15) - ) - ) - (function "invinc" #f ,(lambda ((arg0 object) (arg1 debug-menu-msg)) - (if (not *target*) - (start 'debug (get-current-continue-forced *game-info*)) - ) - (send-event *target* 'change-mode 'darkjak #f 31) - ) - ) - (function "giant" #f ,(lambda ((arg0 object) (arg1 debug-menu-msg)) - (if (not *target*) - (start 'debug (get-current-continue-forced *game-info*)) - ) - (send-event *target* 'change-mode 'darkjak #f 63) + (send-event *target* 'change-mode 'darkjak #f (darkjak-stage force-on active bomb0)) ) ) + (function + "bomb1" + #f + ,(lambda ((arg0 object) (arg1 debug-menu-msg)) + (if (not *target*) + (start 'debug (get-current-continue-forced *game-info*)) + ) + (send-event *target* 'change-mode 'darkjak #f (darkjak-stage force-on active bomb0 bomb1)) + ) + ) + (function + "invinc" + #f + ,(lambda ((arg0 object) (arg1 debug-menu-msg)) + (if (not *target*) + (start 'debug (get-current-continue-forced *game-info*)) + ) + (send-event *target* 'change-mode 'darkjak #f (darkjak-stage force-on active bomb0 bomb1 invinc)) + ) + ) + (function + "giant" + #f + ,(lambda ((arg0 object) (arg1 debug-menu-msg)) + (if (not *target*) + (start 'debug (get-current-continue-forced *game-info*)) + ) + (send-event *target* 'change-mode 'darkjak #f (darkjak-stage force-on active bomb0 bomb1 invinc giant)) + ) + ) ) (menu "Gun" @@ -6012,7 +6021,7 @@ ) (logior! (-> *game-info* features) (game-feature darkjak)) (logior! (-> *game-info* debug-features) (game-feature darkjak)) - (send-event *target* 'change-mode 'darkjak #f 3) + (send-event *target* 'change-mode 'darkjak #f (darkjak-stage force-on active)) ) ) (function "indax" #f ,(lambda () diff --git a/goal_src/jak2/engine/debug/editable-player.gc b/goal_src/jak2/engine/debug/editable-player.gc index cf38a21b62..7456792cbe 100644 --- a/goal_src/jak2/engine/debug/editable-player.gc +++ b/goal_src/jak2/engine/debug/editable-player.gc @@ -1447,24 +1447,25 @@ ) (when #t (format *stdcon* "~0K") - (format *stdcon* "~%~%~16S~16S~16S~%" "Left button" "Middle button" "Right button") + (format *stdcon* "~%~%") ;; added + (format *stdcon* "~16S~16S~16S~%" "Left button" "Middle button" "Right button") (format *stdcon* "~16S~16S~16S~%" (editable-command->string - (if (and (nonzero? (-> obj command 1)) (or (zero? (-> obj command 0)) (logtest? (-> *mouse* button0-abs 0) 1))) + (if (and (nonzero? (-> obj command 1)) (or (zero? (-> obj command 0)) (mouse-hold? left))) (the-as editable-command (-> obj command 1)) (the-as editable-command (-> obj command 0)) ) ) (editable-command->string - (if (and (nonzero? (-> obj command 5)) (or (zero? (-> obj command 4)) (logtest? (-> *mouse* button0-abs 0) 4))) + (if (and (nonzero? (-> obj command 5)) (or (zero? (-> obj command 4)) (mouse-hold? middle))) (the-as editable-command (-> obj command 5)) (the-as editable-command (-> obj command 4)) ) ) (editable-command->string - (if (and (nonzero? (-> obj command 3)) (or (zero? (-> obj command 2)) (logtest? (-> *mouse* button0-abs 0) 2))) + (if (and (nonzero? (-> obj command 3)) (or (zero? (-> obj command 2)) (mouse-hold? right))) (the-as editable-command (-> obj command 3)) (the-as editable-command (-> obj command 2)) ) @@ -2017,19 +2018,19 @@ ) ) ) - (if (logtest? (-> *mouse* button0-rel 0) 1) + (if (mouse-pressed? left) (editable-array-method-9 gp-0 (the-as editable-command (-> self command 0)) (the-as editable-array *mouse*)) ) - (if (logtest? (-> *mouse* button0-abs 0) 1) + (if (mouse-hold? left) (editable-array-method-9 gp-0 (the-as editable-command (-> self command 1)) (the-as editable-array *mouse*)) ) - (if (logtest? (-> *mouse* button0-rel 0) 2) + (if (mouse-pressed? right) (editable-array-method-9 gp-0 (the-as editable-command (-> self command 2)) (the-as editable-array *mouse*)) ) - (if (logtest? (-> *mouse* button0-abs 0) 2) + (if (mouse-hold? right) (editable-array-method-9 gp-0 (the-as editable-command (-> self command 3)) (the-as editable-array *mouse*)) ) - (when (logtest? (-> *mouse* button0-rel 0) 4) + (when (mouse-pressed? middle) (let ((a2-11 (-> self command 4))) (case a2-11 ((36) @@ -2044,7 +2045,7 @@ ) ) ) - (if (logtest? (-> *mouse* button0-abs 0) 4) + (if (mouse-hold? middle) (editable-array-method-9 gp-0 (the-as editable-command (-> self command 5)) (the-as editable-array *mouse*)) ) ) diff --git a/goal_src/jak2/engine/debug/nav/nav-graph-editor.gc b/goal_src/jak2/engine/debug/nav/nav-graph-editor.gc index bfe6557907..24d0eaedb4 100644 --- a/goal_src/jak2/engine/debug/nav/nav-graph-editor.gc +++ b/goal_src/jak2/engine/debug/nav/nav-graph-editor.gc @@ -1432,7 +1432,7 @@ (nav-graph-editor-method-34 obj) (nav-graph-editor-method-32 obj (-> obj selected-node-edge?) (-> obj selected-index)) (cond - ((not (logtest? (-> *mouse* button0-abs 0) 1)) + ((not (mouse-hold? left)) (let ((a0-4 (nav-graph-editor-method-49 obj))) (vector-! (-> a0-4 move-vec) @@ -1481,12 +1481,12 @@ (defstate adjust-plane (nav-graph-editor) :virtual #t :trans (behavior () - (if (logtest? (-> *mouse* button0-abs 0) 1) + (if (logtest? (-> *mouse* button0-abs 0) (mouse-buttons left)) (go-virtual move-plane) ) - (when (and (logtest? (-> *mouse* button0-abs 0) 4) (>= (-> self selected-index) 0)) - (logand! (-> *mouse* button0-abs 0) -5) - (logand! (-> *mouse* button0-rel 0) -5) + (when (and (logtest? (-> *mouse* button0-abs 0) (mouse-buttons middle)) (>= (-> self selected-index) 0)) + (logclear! (-> *mouse* button0-abs 0) (mouse-buttons middle)) + (logclear! (-> *mouse* button0-rel 0) (mouse-buttons middle)) (set! (-> self plane-height) (-> self nav-graph node-array data (-> self selected-index) position y)) ) (nav-graph-editor-method-41 self) @@ -1512,7 +1512,7 @@ (none) ) :trans (behavior () - (if (not (logtest? (-> *mouse* button0-abs 0) 1)) + (if (not (mouse-hold? left)) (go-virtual adjust-plane) ) (none) @@ -1557,12 +1557,14 @@ ) ) (cond - ((and (logtest? (-> *mouse* button0-rel 0) 1) - (begin (logand! (-> *mouse* button0-abs 0) -2) (let ((v1-20 (logand -2 (-> *mouse* button0-rel 0)))) - (set! (-> *mouse* button0-rel 0) v1-20) - (and v1-20 (!= (-> obj selected-index) (-> obj edge-src))) - ) - ) + ((and (logtest? (-> *mouse* button0-rel 0) (mouse-buttons left)) + (begin + (logclear! (-> *mouse* button0-abs 0) (mouse-buttons left)) + (let ((v1-20 (logclear (-> *mouse* button0-rel 0) (mouse-buttons left)))) + (set! (-> *mouse* button0-rel 0) v1-20) + (and v1-20 (!= (-> obj selected-index) (-> obj edge-src))) + ) + ) ) (cond ((>= (-> obj selected-index) 0) @@ -1581,12 +1583,12 @@ (nav-graph-editor-method-47 obj) (set! (-> obj edge-src) (-> obj edge-dst)) ) - ((logtest? (-> *mouse* button0-rel 0) 2) + ((logtest? (-> *mouse* button0-rel 0) (mouse-buttons right)) (if (= (-> obj edge-dst) -2) (nav-graph-editor-method-58 obj) ) - (logand! (-> *mouse* button0-abs 0) -3) - (logand! (-> *mouse* button0-rel 0) -3) + (logclear! (-> *mouse* button0-abs 0) (mouse-buttons right)) + (logclear! (-> *mouse* button0-rel 0) (mouse-buttons right)) (go (method-of-object obj create)) ) ) @@ -1629,12 +1631,12 @@ (nav-graph-editor-method-43 obj) (nav-graph-editor-method-32 obj (-> obj selected-node-edge?) (-> obj selected-index)) (cond - ((logtest? (-> *mouse* button0-rel 0) 1) - (logand! (-> *mouse* button0-abs 0) -2) - (logand! (-> *mouse* button0-rel 0) -2) + ((logtest? (-> *mouse* button0-rel 0) (mouse-buttons left)) + (logclear! (-> *mouse* button0-abs 0) (mouse-buttons left)) + (logclear! (-> *mouse* button0-rel 0) (mouse-buttons left)) (go (method-of-object obj create-edge)) ) - ((and (logtest? (-> *mouse* button0-rel 0) 2) + ((and (logtest? (-> *mouse* button0-rel 0) (mouse-buttons right)) (>= (-> obj selected-index) 0) (not (-> obj selected-node-edge?)) ) @@ -1683,19 +1685,19 @@ (nav-graph-editor-method-42 self) (nav-graph-editor-method-32 self (-> self selected-node-edge?) (-> self selected-index)) (cond - ((and (logtest? (-> *mouse* button0-abs 0) 1) (>= (-> self selected-index) 0)) - (logand! (-> *mouse* button0-abs 0) -2) - (logand! (-> *mouse* button0-rel 0) -2) + ((and (logtest? (-> *mouse* button0-abs 0) (mouse-buttons left)) (>= (-> self selected-index) 0)) + (logclear! (-> *mouse* button0-abs 0) (mouse-buttons left)) + (logclear! (-> *mouse* button0-rel 0) (mouse-buttons left)) (nav-graph-editor-method-53 self (-> self edge-visibility) (-> self selected-index)) ) - ((and (logtest? (-> *mouse* button0-abs 0) 4) (>= (-> self selected-index) 0)) - (logand! (-> *mouse* button0-abs 0) -5) - (logand! (-> *mouse* button0-rel 0) -5) + ((and (logtest? (-> *mouse* button0-abs 0) (mouse-buttons middle)) (>= (-> self selected-index) 0)) + (logclear! (-> *mouse* button0-abs 0) (mouse-buttons middle)) + (logclear! (-> *mouse* button0-rel 0) (mouse-buttons middle)) (nav-graph-editor-method-57 self (-> self edge-visibility) (-> self selected-index)) ) - ((logtest? (-> *mouse* button0-abs 0) 2) - (logand! (-> *mouse* button0-abs 0) -3) - (logand! (-> *mouse* button0-rel 0) -3) + ((logtest? (-> *mouse* button0-abs 0) (mouse-buttons right)) + (logclear! (-> *mouse* button0-abs 0) (mouse-buttons right)) + (logclear! (-> *mouse* button0-rel 0) (mouse-buttons right)) (go-virtual adjust-minimap) ) ) @@ -1714,7 +1716,7 @@ (nav-graph-editor-method-28 self) (nav-graph-editor-method-34 self) (cond - ((not (logtest? (-> *mouse* button0-abs 0) 1)) + ((not (mouse-hold? left)) (go-virtual adjust-it) ) (else @@ -1740,7 +1742,7 @@ (nav-graph-editor-method-28 self) (nav-graph-editor-method-34 self) (cond - ((not (logtest? (-> *mouse* button0-abs 0) 2)) + ((not (mouse-hold? right)) (go-virtual adjust-it) ) (else @@ -1769,7 +1771,7 @@ (nav-graph-editor-method-28 self) (nav-graph-editor-method-34 self) (cond - ((not (logtest? (-> *mouse* button0-abs 0) 2)) + ((not (mouse-hold? right)) (go-virtual adjust-it) ) (else @@ -1799,7 +1801,7 @@ (nav-graph-editor-method-34 self) (nav-graph-editor-method-32 self (-> self selected-node-edge?) (-> self selected-index)) (cond - ((not (logtest? (-> *mouse* button0-abs 0) 4)) + ((not (mouse-hold? middle)) (go-virtual adjust-it) ) (else @@ -1834,18 +1836,18 @@ ) ) (cond - ((and (logtest? (-> *mouse* button0-abs 0) 1) (>= (-> obj selected-index) 0)) + ((and (logtest? (-> *mouse* button0-abs 0) (mouse-buttons left)) (>= (-> obj selected-index) 0)) (if (-> obj selected-node-edge?) (go (method-of-object obj adjust-node-angle)) ) ) - ((and (logtest? (-> *mouse* button0-abs 0) 2) (>= (-> obj selected-index) 0)) + ((and (logtest? (-> *mouse* button0-abs 0) (mouse-buttons right)) (>= (-> obj selected-index) 0)) (if (-> obj selected-node-edge?) (go (method-of-object obj adjust-node-radius)) (go (method-of-object obj adjust-edge-width)) ) ) - ((and (logtest? (-> *mouse* button0-abs 0) 4) + ((and (logtest? (-> *mouse* button0-abs 0) (mouse-buttons middle)) (>= (-> obj selected-index) 0) (not (-> obj selected-node-edge?)) ) @@ -1894,14 +1896,14 @@ (nav-graph-editor-method-30 obj (-> obj selected-index)) ) (cond - ((and (logtest? (-> *mouse* button0-abs 0) 1) (>= (-> obj selected-index) 0)) - (logand! (-> *mouse* button0-abs 0) -2) - (logand! (-> *mouse* button0-rel 0) -2) + ((and (logtest? (-> *mouse* button0-abs 0) (mouse-buttons left)) (>= (-> obj selected-index) 0)) + (logclear! (-> *mouse* button0-abs 0) (mouse-buttons left)) + (logclear! (-> *mouse* button0-rel 0) (mouse-buttons left)) (go (method-of-object obj adjust-edge-visibility)) ) - ((logtest? (-> *mouse* button0-abs 0) 2) - (logand! (-> *mouse* button0-abs 0) -3) - (logand! (-> *mouse* button0-rel 0) -3) + ((logtest? (-> *mouse* button0-abs 0) (mouse-buttons right)) + (logclear! (-> *mouse* button0-abs 0) (mouse-buttons right)) + (logclear! (-> *mouse* button0-rel 0) (mouse-buttons right)) (go (method-of-object obj draw-closest-minimap)) ) (else @@ -1972,9 +1974,9 @@ ) ) (cond - ((logtest? (-> *mouse* button0-abs 0) 2) - (logand! (-> *mouse* button0-abs 0) -3) - (logand! (-> *mouse* button0-rel 0) -3) + ((logtest? (-> *mouse* button0-abs 0) (mouse-buttons right)) + (logclear! (-> *mouse* button0-abs 0) (mouse-buttons right)) + (logclear! (-> *mouse* button0-rel 0) (mouse-buttons right)) (go-virtual adjust-minimap) ) (else @@ -1993,19 +1995,22 @@ (nav-graph-editor-method-43 obj) (nav-graph-editor-method-32 obj (-> obj selected-node-edge?) (-> obj selected-index)) (cond - ((and (logtest? (-> *mouse* button0-abs 0) 1) (>= (-> obj selected-index) 0) (-> obj selected-node-edge?)) - (logand! (-> *mouse* button0-abs 0) -2) - (logand! (-> *mouse* button0-rel 0) -2) + ((and (logtest? (-> *mouse* button0-abs 0) (mouse-buttons left)) + (>= (-> obj selected-index) 0) + (-> obj selected-node-edge?) + ) + (logclear! (-> *mouse* button0-abs 0) (mouse-buttons left)) + (logclear! (-> *mouse* button0-rel 0) (mouse-buttons left)) (go (method-of-object obj move-node)) ) - ((logtest? (-> *mouse* button0-abs 0) 2) - (logand! (-> *mouse* button0-abs 0) -3) - (logand! (-> *mouse* button0-rel 0) -3) + ((logtest? (-> *mouse* button0-abs 0) (mouse-buttons right)) + (logclear! (-> *mouse* button0-abs 0) (mouse-buttons right)) + (logclear! (-> *mouse* button0-rel 0) (mouse-buttons right)) (go (method-of-object obj create-edge)) ) - ((and (logtest? (-> *mouse* button0-abs 0) 4) (>= (-> obj selected-index) 0)) - (logand! (-> *mouse* button0-abs 0) -5) - (logand! (-> *mouse* button0-rel 0) -5) + ((and (logtest? (-> *mouse* button0-abs 0) (mouse-buttons middle)) (>= (-> obj selected-index) 0)) + (logclear! (-> *mouse* button0-abs 0) (mouse-buttons middle)) + (logclear! (-> *mouse* button0-rel 0) (mouse-buttons middle)) (if (-> obj selected-node-edge?) (nav-graph-editor-method-55 obj (-> obj selected-index)) (nav-graph-editor-method-56 obj (-> obj selected-index)) diff --git a/goal_src/jak2/engine/game/main.gc b/goal_src/jak2/engine/game/main.gc index f548255f14..73ea915480 100644 --- a/goal_src/jak2/engine/game/main.gc +++ b/goal_src/jak2/engine/game/main.gc @@ -376,19 +376,6 @@ (none) ) -(#when PC_PORT - -;; redefined from C kernel -(define *scf-territory-debug* GAME_TERRITORY_SCEA) -(defun scf-get-territory () - "redefined from C kernel for convenience" - (if *debug-segment* - *scf-territory-debug* - *scf-territory-debug*) - ) -) - - (define *cheat-temp* (the-as (pointer int32) (malloc 'global 20))) (define *master-exit* #f) (define *progress-cheat* #f) diff --git a/goal_src/jak2/engine/gfx/mood/weather-part.gc b/goal_src/jak2/engine/gfx/mood/weather-part.gc index 80552e970c..c176688664 100644 --- a/goal_src/jak2/engine/gfx/mood/weather-part.gc +++ b/goal_src/jak2/engine/gfx/mood/weather-part.gc @@ -699,29 +699,25 @@ (set! (-> v1-0 z) (-> arg2 z)) (set! (-> v1-0 w) 1.0) (let ((gp-1 (vector+float*! (new 'stack-no-clear 'vector) arg1 v1-0 0.0))) - (let ((t9-0 matrix-local->world) - (a0-3 #f) - ) - (let* ((s4-0 (t9-0 a0-3)) - (f28-0 (lerp-scale 122.88 245.76 (fabs (-> s4-0 vector 2 y)) 0.0 0.7)) - (f30-0 (lerp-scale 2048.0 245.76 (fabs (-> s4-0 vector 2 y)) 0.0 0.7)) - ) - (let ((f26-0 (lerp-scale 0.0 0.1 (-> s4-0 vector 2 y) 0.3 0.7)) - (f0-11 (lerp-scale 1.0 0.1 (-> s4-0 vector 2 y) 0.3 0.7)) - ) - (if (< 0.0 f26-0) - (send-event *camera* 'part-water-drip f26-0 f0-11) - ) - ) - (set! (-> *part-id-table* 60 init-specs 5 initial-valuef) f28-0) - (set! (-> *part-id-table* 60 init-specs 5 random-rangef) f28-0) - (set! (-> *part-id-table* 61 init-specs 5 initial-valuef) f28-0) - (set! (-> *part-id-table* 61 init-specs 5 random-rangef) f28-0) - (set! (-> *part-id-table* 60 init-specs 6 initial-valuef) f30-0) - (set! (-> *part-id-table* 60 init-specs 6 random-rangef) f30-0) - (set! (-> *part-id-table* 61 init-specs 6 initial-valuef) f30-0) - (set! (-> *part-id-table* 61 init-specs 6 random-rangef) f30-0) + (let* ((s4-0 (matrix-local->world #f #f)) + (f28-0 (lerp-scale 122.88 245.76 (fabs (-> s4-0 vector 2 y)) 0.0 0.7)) + (f30-0 (lerp-scale 2048.0 245.76 (fabs (-> s4-0 vector 2 y)) 0.0 0.7)) + ) + (let ((f26-0 (lerp-scale 0.0 0.1 (-> s4-0 vector 2 y) 0.3 0.7)) + (f0-11 (lerp-scale 1.0 0.1 (-> s4-0 vector 2 y) 0.3 0.7)) + ) + (if (< 0.0 f26-0) + (send-event *camera* 'part-water-drip f26-0 f0-11) + ) ) + (set! (-> *part-id-table* 60 init-specs 5 initial-valuef) f28-0) + (set! (-> *part-id-table* 60 init-specs 5 random-rangef) f28-0) + (set! (-> *part-id-table* 61 init-specs 5 initial-valuef) f28-0) + (set! (-> *part-id-table* 61 init-specs 5 random-rangef) f28-0) + (set! (-> *part-id-table* 60 init-specs 6 initial-valuef) f30-0) + (set! (-> *part-id-table* 60 init-specs 6 random-rangef) f30-0) + (set! (-> *part-id-table* 61 init-specs 6 initial-valuef) f30-0) + (set! (-> *part-id-table* 61 init-specs 6 random-rangef) f30-0) ) (set! (-> *part-id-table* 60 init-specs 2 initial-valuef) arg0) (set! (-> *part-id-table* 61 init-specs 2 initial-valuef) (* 4.0 arg0)) diff --git a/goal_src/jak2/engine/gfx/ocean/ocean-mid.gc b/goal_src/jak2/engine/gfx/ocean/ocean-mid.gc index cb4ed60408..4704e37a05 100644 --- a/goal_src/jak2/engine/gfx/ocean/ocean-mid.gc +++ b/goal_src/jak2/engine/gfx/ocean/ocean-mid.gc @@ -17,15 +17,11 @@ (set-vector! (-> arg0 fog) (-> v1-0 pfog0) (-> v1-0 fog-min) (-> v1-0 fog-max) 3072.0) ) (set-vector! (-> arg0 constants) -0.25 -0.5 0.0 393216.0) - (let ((t9-0 matrix-local->world) - (a0-8 #f) - ) - (let* ((s4-0 (-> (t9-0 a0-8) vector 2)) - (f0-12 (- 1.5 (* 0.000015258789 (atan (-> s4-0 x) (-> s4-0 z))))) - (f1-1 (+ 0.5 (* -0.5 (-> s4-0 y)))) - ) - (set-vector! (-> arg0 constants2) f0-12 f1-1 1.0 0.0) - ) + (let* ((s4-0 (-> (matrix-local->world #f #f) vector 2)) + (f0-12 (- 1.5 (* 0.000015258789 (atan (-> s4-0 x) (-> s4-0 z))))) + (f1-1 (+ 0.5 (* -0.5 (-> s4-0 y)))) + ) + (set-vector! (-> arg0 constants2) f0-12 f1-1 1.0 0.0) ) (case *subdivide-ocean-draw-mode* (((subdivide-setting textured)) diff --git a/goal_src/jak2/engine/gfx/ocean/ocean-near.gc b/goal_src/jak2/engine/gfx/ocean/ocean-near.gc index 01f072b0e9..9beccc5bcd 100644 --- a/goal_src/jak2/engine/gfx/ocean/ocean-near.gc +++ b/goal_src/jak2/engine/gfx/ocean/ocean-near.gc @@ -43,15 +43,11 @@ (set-vector! (-> arg0 fog) (-> v1-0 pfog0) (-> v1-0 fog-min) (-> v1-0 fog-max) 3072.0) ) (set-vector! (-> arg0 constants) -0.25 -0.5 0.0 0.000010172526) - (let ((t9-0 matrix-local->world) - (a0-8 #f) - ) - (let* ((s4-0 (-> (t9-0 a0-8) vector 2)) - (f0-12 (- 1.5 (* 0.000015258789 (atan (-> s4-0 x) (-> s4-0 z))))) - (f1-1 (+ 0.5 (* -0.5 (-> s4-0 y)))) - ) - (set-vector! (-> arg0 constants2) f0-12 f1-1 1.0 128.0) - ) + (let* ((s4-0 (-> (matrix-local->world #f #f) vector 2)) + (f0-12 (- 1.5 (* 0.000015258789 (atan (-> s4-0 x) (-> s4-0 z))))) + (f1-1 (+ 0.5 (* -0.5 (-> s4-0 y)))) + ) + (set-vector! (-> arg0 constants2) f0-12 f1-1 1.0 128.0) ) (set-vector! (-> arg0 constants3) 12288.0 0.125 2.0 0.03125) (set-vector! (-> arg0 constants4) 2.0 255.0 3.0 0.0078125) diff --git a/goal_src/jak2/engine/ps2/pad.gc b/goal_src/jak2/engine/ps2/pad.gc index 92d6ec9a0a..2b8ad86b89 100644 --- a/goal_src/jak2/engine/ps2/pad.gc +++ b/goal_src/jak2/engine/ps2/pad.gc @@ -15,7 +15,6 @@ The cpad-set-buzz! function can be used for vibration. (define-extern get-current-time (function time-frame)) (define-extern get-integral-current-time (function uint)) (define-extern get-current-language (function language-enum)) -(define-extern add-debug-cursor (function symbol bucket-id int int int none)) (defenum pad-buttons @@ -57,6 +56,30 @@ The cpad-set-buzz! function can be used for vibration. (namco-gun 6) ) + +(defenum mouse-buttons + :bitfield #t + :type uint32 + (left) + (right) + (middle) + ) + +(define-extern add-debug-cursor (function symbol bucket-id int int mouse-buttons int)) + + +(#when PC_PORT + +;; redefined from C kernel +(define *scf-territory-debug* GAME_TERRITORY_SCEA) +(defun scf-get-territory () + "redefined from C kernel for convenience" + (if *debug-segment* + *scf-territory-debug* + *scf-territory-debug*) + ) +) + ;; decomp begins (deftype scf-time (structure) @@ -553,9 +576,9 @@ The cpad-set-buzz! function can be used for vibration. (deltay int8 :offset-assert 23) (wheel uint8 :offset-assert 24) (change-time time-frame :offset-assert 32) - (button0-abs uint32 3 :offset-assert 40) - (button0-shadow-abs uint32 1 :offset-assert 52) - (button0-rel uint32 3 :offset-assert 56) + (button0-abs mouse-buttons 3 :offset-assert 40) + (button0-shadow-abs mouse-buttons 1 :offset-assert 52) + (button0-rel mouse-buttons 3 :offset-assert 56) (pos vector 2 :inline :offset-assert 80) (posx float :offset 80) (posy float :offset 84) @@ -599,7 +622,7 @@ The cpad-set-buzz! function can be used for vibration. (set! (-> gp-0 button0-abs 1) (-> gp-0 button0-shadow-abs 0)) (set! (-> gp-0 button0-rel 2) (-> gp-0 button0-rel 1)) (set! (-> gp-0 button0-rel 1) (-> gp-0 button0-rel 0)) - (set! (-> gp-0 button0-rel 0) (the-as uint 0)) + (set! (-> gp-0 button0-rel 0) (mouse-buttons)) (set! (-> gp-0 speedx) 0.0) (set! (-> gp-0 speedy) 0.0) (cond @@ -616,8 +639,8 @@ The cpad-set-buzz! function can be used for vibration. (set! (-> gp-0 posx) (fmax -256.0 (fmin 256.0 (+ (-> gp-0 posx) (-> gp-0 speedx))))) (set! (-> gp-0 posy) (fmax -208.0 (fmin 208.0 (+ (-> gp-0 posy) (-> gp-0 speedy))))) (let ((v1-22 (-> gp-0 button0))) - (set! (-> gp-0 button0-shadow-abs 0) v1-22) - (set! (-> gp-0 button0-abs 0) v1-22) + (set! (-> gp-0 button0-shadow-abs 0) (the-as mouse-buttons v1-22)) + (set! (-> gp-0 button0-abs 0) (the-as mouse-buttons v1-22)) ) (set! (-> gp-0 button0-rel 0) (logclear (-> gp-0 button0-abs 0) (-> gp-0 button0-abs 1))) ) @@ -628,13 +651,36 @@ The cpad-set-buzz! function can be used for vibration. (bucket-id debug-no-zbuf2) (+ (the int (-> gp-0 posx)) 256) (+ (the int (-> gp-0 posy)) 208) - (the-as int (-> gp-0 button0-abs 0)) + (-> gp-0 button0-abs 0) ) ) ) (none) ) +(defmacro mouse-pressed () + `(-> *mouse* button0-rel 0) + ) + +(defmacro mouse-hold () + `(-> *mouse* button0-abs 0) + ) + +(defmacro mouse-pressed? (&rest buttons) + `(logtest? (mouse-pressed) (mouse-buttons ,@buttons)) + ) + +(defmacro mouse-hold? (&rest buttons) + `(logtest? (mouse-hold) (mouse-buttons ,@buttons)) + ) + +(defmacro mouse-clear! (&rest buttons) + `(begin + (logclear! (mouse-pressed) (mouse-buttons ,@buttons)) + (logclear! (mouse-hold) (mouse-buttons ,@buttons)) + ) + ) + (defmacro check-cheat-code (cheat-var pad-idx buttons &rest body) "execute body when a cheat code made up of sequential inputs has been inputted" diff --git a/goal_src/jak2/engine/target/darkjak-h.gc b/goal_src/jak2/engine/target/darkjak-h.gc index 463a025369..c0374a6626 100644 --- a/goal_src/jak2/engine/target/darkjak-h.gc +++ b/goal_src/jak2/engine/target/darkjak-h.gc @@ -13,8 +13,8 @@ (start-time time-frame :offset-assert 16) (attack-time time-frame :offset-assert 24) (attack-count uint64 :offset-assert 32) - (stage uint32 :offset-assert 40) - (want-stage uint32 :offset-assert 44) + (stage darkjak-stage :offset-assert 40) + (want-stage darkjak-stage :offset-assert 44) (clock-pos float :offset-assert 48) (clock-vel float :offset-assert 52) (clock-on symbol :offset-assert 56) diff --git a/goal_src/jak2/engine/target/gun/gun-h.gc b/goal_src/jak2/engine/target/gun/gun-h.gc index 5adb451a36..b683fc052c 100644 --- a/goal_src/jak2/engine/target/gun/gun-h.gc +++ b/goal_src/jak2/engine/target/gun/gun-h.gc @@ -13,6 +13,16 @@ (declare-type gun-yellow-shot projectile) (declare-type gun-red-shot process-drawable) +(defenum gun-track-flags + :bitfield #t + :type uint16 + (gutflags-0) + (gutflags-1) + (gutflags-2) + (gutflags-3) + (gutflags-4) + ) + ;; DECOMP BEGINS (deftype gun (process-drawable) @@ -81,7 +91,7 @@ (laser-point vector :inline :offset-assert 304) (laser-dir vector 2 :inline :offset-assert 320) (laser-hit-point vector :inline :offset-assert 352) - (track? uint16 :offset-assert 368) + (track? gun-track-flags :offset-assert 368) (track-tilt degrees :offset-assert 372) (track-turn degrees :offset-assert 376) (track-find-range meters :offset-assert 380) diff --git a/goal_src/jak2/engine/target/gun/gun-states.gc b/goal_src/jak2/engine/target/gun/gun-states.gc index 8047699e3c..146db052aa 100644 --- a/goal_src/jak2/engine/target/gun/gun-states.gc +++ b/goal_src/jak2/engine/target/gun/gun-states.gc @@ -73,7 +73,7 @@ (go target-gun-walk) ) (if (want-to-darkjak?) - (go target-darkjak-get-on 2) + (go target-darkjak-get-on (darkjak-stage active)) ) (when (and (cpad-hold? (-> self control cpad number) l1) (can-duck?)) (logclear! (-> self state-flags) (state-flags lleg-still rleg-still)) @@ -373,7 +373,7 @@ (go target-gun-stance) ) (if (want-to-darkjak?) - (go target-darkjak-get-on 2) + (go target-darkjak-get-on (darkjak-stage active)) ) (if (and (logtest? (logior (logior (-> *cpad-list* cpads (-> self control cpad number) button0-rel 0) (-> *cpad-list* cpads (-> self control cpad number) button0-rel 1) diff --git a/goal_src/jak2/engine/target/logic-target.gc b/goal_src/jak2/engine/target/logic-target.gc index cdc9de7b43..f1fa00355b 100644 --- a/goal_src/jak2/engine/target/logic-target.gc +++ b/goal_src/jak2/engine/target/logic-target.gc @@ -541,21 +541,17 @@ (set! (-> self control pad-xz-dir quad) (-> arg0 quad)) (set! (-> self control pad-magnitude) (-> self control cpad stick0-speed)) (when (< (-> self control update-cam-R-w-start-time) (current-time)) - (let ((s5-0 (-> self control cam-R-w)) - (t9-2 matrix-local->world) - (a0-13 #t) - ) - (let* ((a2-0 (t9-2 a0-13)) - (v1-24 (-> a2-0 quad 0)) - (a0-14 (-> a2-0 quad 1)) - (a1-1 (-> a2-0 quad 2)) - (a2-1 (-> a2-0 trans quad)) - ) - (set! (-> s5-0 quad 0) v1-24) - (set! (-> s5-0 quad 1) a0-14) - (set! (-> s5-0 quad 2) a1-1) - (set! (-> s5-0 trans quad) a2-1) - ) + (let* ((s5-0 (-> self control cam-R-w)) + (a2-0 (matrix-local->world #t #f)) + (v1-24 (-> a2-0 quad 0)) + (a0-14 (-> a2-0 quad 1)) + (a1-1 (-> a2-0 quad 2)) + (a2-1 (-> a2-0 trans quad)) + ) + (set! (-> s5-0 quad 0) v1-24) + (set! (-> s5-0 quad 1) a0-14) + (set! (-> s5-0 quad 2) a1-1) + (set! (-> s5-0 trans quad) a2-1) ) ) (vector-matrix*! arg0 arg0 (-> self control cam-R-w)) @@ -586,20 +582,17 @@ ;; WARN: Return type mismatch vector vs none. (defun vector<-pad-in-matrix! ((arg0 vector) (arg1 cpad-info) (arg2 matrix)) (let ((gp-0 (new 'stack-no-clear 'vector)) - (t9-0 matrix-local->world) - (a0-1 #t) - ) - (let ((s5-0 (t9-0 a0-1))) - (set! (-> gp-0 x) (* -0.0078125 (+ -128.0 (the float (-> arg1 leftx))))) - (set! (-> gp-0 y) 0.0) - (set! (-> gp-0 z) (* -0.0078125 (+ -128.0 (the float (-> arg1 lefty))))) - (set! (-> gp-0 w) 0.0) - (let ((f30-0 (vector-length gp-0))) - (vector-matrix*! gp-0 gp-0 s5-0) - (warp-vector-into-surface! arg0 gp-0 (-> arg2 vector 1) s5-0) - (vector-matrix*! arg0 arg0 arg2) - (vector-normalize! arg0 f30-0) + (s5-0 (matrix-local->world #t #f)) ) + (set! (-> gp-0 x) (* -0.0078125 (+ -128.0 (the float (-> arg1 leftx))))) + (set! (-> gp-0 y) 0.0) + (set! (-> gp-0 z) (* -0.0078125 (+ -128.0 (the float (-> arg1 lefty))))) + (set! (-> gp-0 w) 0.0) + (let ((f30-0 (vector-length gp-0))) + (vector-matrix*! gp-0 gp-0 s5-0) + (warp-vector-into-surface! arg0 gp-0 (-> arg2 vector 1) s5-0) + (vector-matrix*! arg0 arg0 arg2) + (vector-normalize! arg0 f30-0) ) ) (none) diff --git a/goal_src/jak2/engine/target/target-darkjak.gc b/goal_src/jak2/engine/target/target-darkjak.gc index 4257765dd8..a2eb831f8d 100644 --- a/goal_src/jak2/engine/target/target-darkjak.gc +++ b/goal_src/jak2/engine/target/target-darkjak.gc @@ -61,7 +61,11 @@ ) ) (and (and (focus-test? self dark) (nonzero? (-> self darkjak))) - (not (and (focus-test? self dark) (nonzero? (-> self darkjak)) (logtest? (-> self darkjak stage) 32))) + (not (and (focus-test? self dark) + (nonzero? (-> self darkjak)) + (logtest? (-> self darkjak stage) (darkjak-stage giant)) + ) + ) (logtest? (game-feature darkjak-giant) (-> self game features)) ) ) @@ -115,7 +119,7 @@ ) (not (focus-test? self dead dangerous hit grabbed)) (not (and (-> self next-state) (= (-> self next-state name) 'target-darkjak-get-off))) - (not (logtest? (-> self darkjak stage) 1)) + (not (logtest? (-> self darkjak stage) (darkjak-stage force-on))) ) (go target-darkjak-get-off) ) @@ -141,7 +145,10 @@ ) (let ((f26-1 (* 1.1 f26-0))) (cond - ((and (focus-test? self dark) (nonzero? (-> self darkjak)) (logtest? (-> self darkjak stage) 32)) + ((and (focus-test? self dark) + (nonzero? (-> self darkjak)) + (logtest? (-> self darkjak stage) (darkjak-stage giant)) + ) (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)))) @@ -256,7 +263,7 @@ (case event-type (('darkjak) (when (zero? (-> self darkjak want-stage)) - (set! (-> self darkjak want-stage) (-> event param 0)) + (set! (-> self darkjak want-stage) (the-as darkjak-stage (-> event param 0))) #t ) ) @@ -283,20 +290,20 @@ ) (none) ) - :code (behavior ((arg0 int)) + :code (behavior ((arg0 darkjak-stage)) (send-event (handle->process (-> self notify)) 'notify 'attack 15) (if (and (focus-test? self dark) (nonzero? (-> self darkjak))) (go target-darkjak-giant) ) - (set! (-> self darkjak stage) (the-as uint (logior arg0 2))) + (set! (-> self darkjak stage) (logior arg0 (darkjak-stage active))) (if (logtest? (game-feature darkjak-bomb0) (-> self game features)) - (logior! (-> self darkjak stage) 4) + (logior! (-> self darkjak stage) (darkjak-stage bomb0)) ) (if (logtest? (game-feature darkjak-bomb1) (-> self game features)) - (logior! (-> self darkjak stage) 8) + (logior! (-> self darkjak stage) (darkjak-stage bomb1)) ) (if (logtest? (game-feature darkjak-invinc) (-> self game features)) - (logior! (-> self darkjak stage) 16) + (logior! (-> self darkjak stage) (darkjak-stage invinc)) ) (set! (-> self darkjak want-stage) (-> self darkjak stage)) (set! (-> self neck flex-blend) 0.0) @@ -308,11 +315,11 @@ (logior! (-> self focus-status) (focus-status dark)) (set! (-> (the-as fact-info-target (-> self fact)) darkjak-start-time) (current-time)) (set! (-> (the-as fact-info-target (-> self fact)) darkjak-effect-time) (seconds 20)) - (if (logtest? (-> self darkjak stage) 16) + (if (logtest? (-> self darkjak stage) (darkjak-stage invinc)) (logior! (-> self state-flags) (state-flags sf4)) (logclear! (-> self state-flags) (state-flags sf4)) ) - (if (logtest? arg0 64) + (if (logtest? arg0 (darkjak-stage no-anim)) (go target-stance) ) (set-setting! 'bg-r 'abs 0.1 0) @@ -352,7 +359,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) (not (logtest? arg0 1))) + (and (< (ja-aframe-num 0) 5.0) (not (logtest? arg0 (darkjak-stage force-on)))) ) (let ((v1-131 (the-as sound-rpc-set-param (get-sound-buffer-entry)))) (set! (-> v1-131 command) (sound-command set-param)) @@ -374,7 +381,10 @@ (send-event *traffic-manager* 'increase-alert-level - (if (and (focus-test? self dark) (nonzero? (-> self darkjak)) (logtest? (-> self darkjak stage) 16)) + (if (and (focus-test? self dark) + (nonzero? (-> self darkjak)) + (logtest? (-> self darkjak stage) (darkjak-stage invinc)) + ) 3 2 ) @@ -495,7 +505,11 @@ (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 (focus-test? self dark) (nonzero? (-> self darkjak)) (logtest? (-> self darkjak stage) 32))) + (or (not (and (focus-test? self dark) + (nonzero? (-> self darkjak)) + (logtest? (-> self darkjak stage) (darkjak-stage giant)) + ) + ) (= (-> self darkjak-interp) 0.0) ) ) @@ -512,7 +526,11 @@ (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 (focus-test? self dark) (nonzero? (-> self darkjak)) (logtest? (-> self darkjak stage) 32))) + (or (not (and (focus-test? self dark) + (nonzero? (-> self darkjak)) + (logtest? (-> self darkjak stage) (darkjak-stage giant)) + ) + ) (= (-> self darkjak-interp) 0.0) ) ) @@ -532,7 +550,11 @@ (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 (focus-test? self dark) (nonzero? (-> self darkjak)) (logtest? (-> self darkjak stage) 32))) + (or (not (and (focus-test? self dark) + (nonzero? (-> self darkjak)) + (logtest? (-> self darkjak stage) (darkjak-stage giant)) + ) + ) (= (-> self darkjak-interp) 0.0) ) ) @@ -549,7 +571,11 @@ (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 (focus-test? self dark) (nonzero? (-> self darkjak)) (logtest? (-> self darkjak stage) 32))) + (or (not (and (focus-test? self dark) + (nonzero? (-> self darkjak)) + (logtest? (-> self darkjak stage) (darkjak-stage giant)) + ) + ) (= (-> self darkjak-interp) 0.0) ) ) @@ -648,7 +674,10 @@ (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 (focus-test? self dark) (nonzero? (-> self darkjak)) (logtest? (-> self darkjak stage) 2)) + (and (focus-test? self dark) + (nonzero? (-> self darkjak)) + (logtest? (-> self darkjak stage) (darkjak-stage active)) + ) (< sv-32 2) ) (set! sv-40 (the-as int (current-time))) @@ -1230,7 +1259,10 @@ ) ) ) - (if (and (focus-test? self dark) (nonzero? (-> self darkjak)) (logtest? (-> self darkjak stage) 32)) + (if (and (focus-test? self dark) + (nonzero? (-> self darkjak)) + (logtest? (-> self darkjak stage) (darkjak-stage giant)) + ) (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)) ) @@ -1313,7 +1345,9 @@ (suspend) (ja-eval) ) - (when (and (focus-test? self dark) (and (nonzero? (-> self darkjak)) (logtest? (-> self darkjak stage) 32))) + (when (and (focus-test? self dark) + (and (nonzero? (-> self darkjak)) (logtest? (-> self darkjak stage) (darkjak-stage giant))) + ) (let ((gp-10 (process-spawn manipy :init manipy-init @@ -1465,11 +1499,13 @@ (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 (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! (-> v1-19 penetrate-using) (if (and (focus-test? self dark) + (nonzero? (-> self darkjak)) + (logtest? (-> self darkjak stage) (darkjak-stage giant)) + ) + (penetrate touch dark-skin dark-bomb dark-giant) + (penetrate touch dark-skin dark-bomb) + ) ) (set! (-> a1-6 param 1) (the-as uint v1-19)) ) @@ -1731,7 +1767,9 @@ ) ) (set! (-> sv-56 r) - (if (and (focus-test? self dark) (and (nonzero? (-> self darkjak)) (logtest? (-> self darkjak stage) 32))) + (if (and (focus-test? self dark) + (and (nonzero? (-> self darkjak)) (logtest? (-> self darkjak stage) (darkjak-stage giant))) + ) 614400.0 327680.0 ) @@ -1869,7 +1907,7 @@ (set! (-> self darkjak-interp) 1.0) (set! (-> self darkjak-giant-interp) (the-as float (-> self control unknown-word04))) (when (= (the-as float (-> self control unknown-word04)) 1.0) - (logand! (-> self darkjak stage) -33) + (logclear! (-> self darkjak stage) (darkjak-stage giant)) (set! (-> self darkjak want-stage) (-> self darkjak stage)) ) (none) @@ -1880,7 +1918,7 @@ (logior! (-> self state-flags) (state-flags sf4)) (set! (-> self neck flex-blend) 0.0) (set! (-> self control mod-surface) *darkjak-trans-mods*) - (logior! (-> self darkjak stage) 32) + (logior! (-> self darkjak stage) (darkjak-stage giant)) (set! (-> self darkjak want-stage) (-> self darkjak stage)) (sound-play "djak-transform") (let ((gp-1 (new 'stack-no-clear 'collide-query))) diff --git a/goal_src/jak2/engine/target/target-gun.gc b/goal_src/jak2/engine/target/target-gun.gc index 6673ad1c8c..0cf46ba884 100644 --- a/goal_src/jak2/engine/target/target-gun.gc +++ b/goal_src/jak2/engine/target/target-gun.gc @@ -48,7 +48,7 @@ (f30-0 (lerp-scale 0.0 1.0 (fabs f0-0) 1820.4445 6371.5557)) ) (cond - ((and (logtest? (-> self gun track?) 1) + ((and (logtest? (-> self gun track?) (gun-track-flags gutflags-0)) (!= (-> *cpad-list* cpads (-> self control cpad number) stick0-speed) 0.0) (>= (-> self gun track-turnv-range) (vector-vector-distance (-> self control trans) (-> self gun track-trans)) @@ -213,7 +213,7 @@ (set! (-> self gun put-away?) #f) (set! (-> self gun active?) #f) (set! (-> self gun surpress-time) 0) - (set! (-> self gun track?) (the-as uint 6)) + (set! (-> self gun track?) (gun-track-flags gutflags-1 gutflags-2)) (set! (-> self gun track-turn) 0.0) (set! (-> self gun track-tilt) 0.0) (set! (-> self gun track-target-hold-time) 0) @@ -1172,8 +1172,8 @@ (defbehavior target-gun-find-track target () (if (logtest? (-> self gun upper-body track-mode) (track-mode lock-on)) - (logior! (-> self gun track?) 8) - (logand! (-> self gun track?) -9) + (logior! (-> self gun track?) (gun-track-flags gutflags-3)) + (logclear! (-> self gun track?) (gun-track-flags gutflags-3)) ) (let ((gp-0 (the-as basic #f))) (when (and (or (< (- (current-time) (-> self control time-of-last-nonzero-input)) (seconds 0.2)) @@ -1252,7 +1252,7 @@ (cond (gp-0 (set! (-> self gun track-target-hold-time) 0) - (set! (-> self gun track?) (the-as uint 7)) + (set! (-> self gun track?) (gun-track-flags gutflags-0 gutflags-1 gutflags-2)) (set! (-> self gun track-trans quad) (-> (get-trans (the-as process-focusable gp-0) 3) quad)) (when ((method-of-type focus try-update-focus) (the-as focus (-> self gun track-target)) @@ -1306,7 +1306,7 @@ (= (send-event (the-as process-focusable s5-1) 'track #t) 'abort) ) ) - (set! (-> self gun track?) (the-as uint 6)) + (set! (-> self gun track?) (gun-track-flags gutflags-1 gutflags-2)) (set! (-> self gun track-target-hold-time) 0) ((method-of-type focus clear-focused) (the-as focus (-> self gun track-target))) ) @@ -1320,7 +1320,7 @@ ((and (not (send-event-function (the-as process-focusable s5-1) a1-21)) (zero? (-> self gun track-target-hold-time)) ) - (logand! (-> self gun track?) -5) + (logclear! (-> self gun track?) (gun-track-flags gutflags-2)) (set! (-> self gun track-trans quad) (-> (get-trans (the-as process-focusable s5-1) 3) quad)) ) (else @@ -1376,7 +1376,7 @@ ) ) ) - (when (logtest? (-> self gun track?) 1) + (when (logtest? (-> self gun track?) (gun-track-flags gutflags-0)) (if *gun-marks* (add-debug-sphere #t @@ -1560,7 +1560,7 @@ ) (try-update-focus (-> self gun track-target 1) (the-as process-focusable gp-0)) (set! (-> self gun track-trans quad) (-> (get-trans (the-as process-focusable gp-0) 3) quad)) - (set! (-> self gun track?) (the-as uint 7)) + (set! (-> self gun track?) (gun-track-flags gutflags-0 gutflags-1 gutflags-2)) (if (zero? (-> self gun fire-pending)) (+! (-> self gun fire-pending) 1) ) @@ -1676,7 +1676,9 @@ ) (target-gun-find-track) (cond - ((and (= (-> self gun gun-type) (pickup-type eco-blue)) (not (logtest? (-> self gun track?) 1))) + ((and (= (-> self gun gun-type) (pickup-type eco-blue)) + (not (logtest? (-> self gun track?) (gun-track-flags gutflags-0))) + ) (let ((f0-8 (vector-vector-distance (-> self gun fire-point) (-> self gun laser-hit-point)))) (cond ((< f0-8 122880.0) @@ -1717,7 +1719,9 @@ (cond ((or (and (nonzero? (-> self gun track-target-hold-time)) (< (current-time) (-> self gun track-target-hold-time))) (and (nonzero? (-> self gun turn-fast-hold-time)) (< (current-time) (-> self gun turn-fast-hold-time))) - (and (logtest? (-> self gun track?) 1) (logtest? (-> self gun track?) 4)) + (and (logtest? (-> self gun track?) (gun-track-flags gutflags-0)) + (logtest? (-> self gun track?) (gun-track-flags gutflags-2)) + ) (or (logtest? (surface-flag gun-strafe) (-> self control current-surface flags)) (focus-test? self pilot-riding) ) @@ -1742,7 +1746,7 @@ (set! (-> self upper-body flex-blend) 0.0) (seek! (-> self upper-body flex-blend) 1.0 (* 8.0 (-> self clock seconds-per-frame))) ) - (when (logtest? (-> self gun track?) 1) + (when (logtest? (-> self gun track?) (gun-track-flags gutflags-0)) (set! (-> self gun top-anim-look-at quad) (-> self gun track-trans quad)) (let ((gp-6 (new 'stack-no-clear 'vector))) (set! (-> gp-6 quad) (-> self gun top-anim-look-at quad)) @@ -1776,7 +1780,7 @@ ) ) (cond - ((and (logtest? (-> self gun track?) 1) + ((and (logtest? (-> self gun track?) (gun-track-flags gutflags-0)) (logtest? (process-mask enemy guard) (-> (handle->process (-> self gun track-target 0 handle)) mask)) ) (if (and (< (- (current-time) (-> self gun track-press-start-time)) (seconds 0.5)) @@ -1796,7 +1800,7 @@ ((or (and (nonzero? (-> self gun track-target-hold-time)) (< (current-time) (-> self gun track-target-hold-time))) (and (nonzero? (-> self gun turn-fast-hold-time)) (< (current-time) (-> self gun turn-fast-hold-time))) ) - (set! (-> self gun track?) (the-as uint 7)) + (set! (-> self gun track?) (gun-track-flags gutflags-0 gutflags-1 gutflags-2)) (set! (-> self gun upper-body twist-max y) 21845.334) (set! (-> self gun upper-body twist-speed-y) 0.2) (set! (-> self gun upper-body twist-speed-x) 0.6) diff --git a/goal_src/jak2/engine/target/target-h.gc b/goal_src/jak2/engine/target/target-h.gc index 28fef70b62..87d2adc894 100644 --- a/goal_src/jak2/engine/target/target-h.gc +++ b/goal_src/jak2/engine/target/target-h.gc @@ -24,63 +24,29 @@ ;; for target (define-extern want-to-darkjak? (function symbol :behavior target)) -(define-extern target-darkjak-get-on (state int target)) -(define-extern target-darkjak-running-attack (state target)) -(define-extern target-darkjak-bomb0 (state target)) -(define-extern target-darkjak-bomb1 (state float float target)) (define-extern can-feet? (function symbol symbol :behavior target)) -(define-extern target-attack-air (state symbol target)) -(define-extern target-hit-ground (state symbol target)) (define-extern slide-down-test (function none :behavior target)) -(define-extern target-startup (state target)) (define-extern target-standard-event-handler (function process int symbol event-message-block object :behavior target)) -(define-extern target-stance (state target)) (define-extern target-state-hook-exit (function none :behavior target)) -(define-extern target-wade-stance (state target)) -(define-extern target-ice-stance (state target)) (define-extern move-legs? (function symbol :behavior target)) -(define-extern target-walk (state target)) (define-extern can-duck? (function symbol :behavior target)) -(define-extern target-duck-stance (state symbol target)) (define-extern can-jump? (function symbol symbol :behavior target)) (define-extern target-jump-go (function none :behavior target)) -(define-extern target-attack (state target)) (define-extern can-hands? (function symbol symbol :behavior target)) -(define-extern target-running-attack (state target)) -(define-extern target-gun-stance (state target)) -(define-extern target-carry-pickup (state target)) -(define-extern fall-test (function (state symbol target) float none :behavior target)) -(define-extern target-falling (state symbol target)) (define-extern target-stance-anim (function none :behavior target)) (define-extern target-effect-exit (function none :behavior target)) -(define-extern target-ice-walk (state target)) (define-extern can-roll? (function symbol :behavior target)) -(define-extern target-roll (state target)) -(define-extern target-duck-walk (state symbol target)) -(define-extern target-turn-around (state target)) -(define-extern target-hide (state target)) (define-extern target-walk-event-handler (function process int symbol event-message-block object :behavior target)) -(define-extern target-gun-walk (state target)) (define-extern target-walk-anim (function int none :behavior target)) (define-extern set-forward-vel (function float vector :behavior target)) (define-extern ja-done? (function int symbol :behavior process-drawable)) -(define-extern target-jump (state float float surface target)) (define-extern delete-back-vel (function none :behavior target)) -(define-extern target-high-jump (state float float object target)) -(define-extern target-attack-uppercut (state float float target)) (define-extern target-top-anim-base-mode (function int none :behavior target)) -(define-extern target-double-jump (state float float target)) -(define-extern target-flop (state float float float target)) (define-extern target-jump-event-handler (function process int symbol event-message-block object :behavior target)) -(define-extern target-launch (state float symbol vector int target)) (define-extern ja-group-size (function int :behavior process-drawable)) (define-extern target-falling-anim (function int time-frame symbol :behavior target)) -(define-extern target-duck-high-jump (state float float symbol target)) -(define-extern target-duck-high-jump-jump (state float float symbol target)) (define-extern *uppercut-jump-mods* surface) (define-extern ja-eval (function int :behavior process-drawable)) -(define-extern target-wade-walk (state target)) -(define-extern target-hit-ground-hard (state float target)) (define-extern target-land-effect (function none :behavior target)) (define-extern target-hit-ground-anim (function symbol symbol none :behavior target)) (define-extern are-still? (function symbol :behavior target)) @@ -95,38 +61,21 @@ (define-extern target-bonk-event-handler (function process int symbol event-message-block object :behavior target)) (define-extern target-attack-air-anim (function none :behavior target)) (define-extern *uppercut-mods* surface) -(define-extern target-attack-uppercut-jump (state float float target)) (define-extern touch-tracker-init (function vector float time-frame none :behavior touch-tracker)) -(define-extern target-flop-hit-ground (state symbol target)) -(define-extern target-swim-stance (state target)) -(define-extern target-swim-walk (state target)) -(define-extern target-swim-down (state target)) -(define-extern target-swim-up (state target)) -(define-extern target-yellow-jump-blast (state target)) -(define-extern target-hit (state symbol attack-info target)) -(define-extern target-shoved (function meters meters process (state object object target) object :behavior target)) -(define-extern target-roll-flip (state float float target)) ;; target-util (define-extern target-move-dist (function time-frame float :behavior target)) -(define-extern target-slide-down (state target)) (define-extern get-intersect-point (function vector touching-prims-entry collide-shape touching-shapes-entry vector)) ;; target-swim -(define-extern target-swim-jump (state float float target)) -(define-extern target-swim-jump-jump (state float float surface target)) ;; target-darkjak -(define-extern target-darkjak-get-off (state target)) (define-extern set-darkjak-texture-morph! (function float none)) (define-extern process-drawable-random-point! (function process-drawable vector vector)) -(define-extern target-grab (state symbol target)) -(define-extern target-darkjak-giant (state target)) (define-extern target-falling-anim-trans (function none :behavior target)) (define-extern ja-blend-eval (function int :behavior process-drawable)) ;; target-gun - TODO move to `gun-h` perhaps? -(define-extern target-look-around (state target)) (define-extern target-gun-end-mode (function symbol symbol :behavior target)) (define-extern target-gun-marking-menu (function target none)) (define-extern gun-init (function none :behavior gun)) @@ -141,38 +90,32 @@ (define-extern stop (function symbol int)) ;; target-anim -(define-extern target-stance-ambient (state target)) ;; target2 (define-extern target-gun-check (function none :behavior target)) (define-extern target-gun-fire (function pickup-type none :behavior target)) -(define-extern target-clone-anim (state handle target)) (define-extern target-darkjak-end-mode (function none :behavior target)) (define-extern target-gun-init (function int none :behavior target)) -(define-extern target-demo (state symbol target)) -(define-extern target-title (state symbol target)) -(define-extern target-pole-flip-up (state object object float target)) -(define-extern target-pole-flip-forward (state float float float target)) -(define-extern target-pole-flip-up-jump (state float float target)) -(define-extern target-pole-flip-forward-jump (state float float target)) -(define-extern target-edge-grab-jump (state float float target)) -(define-extern target-edge-grab-off (state target)) (define-extern *hit-ground-hard-mods* surface) -(define-extern target-death (state symbol target)) (define-extern *float-mods* surface) (define-extern target-send-attack (function process symbol touching-shapes-entry int int penetrate symbol :behavior target)) (define-extern target-powerup-effect (function symbol none :behavior target)) -(define-extern target-load-wait (state target)) -(define-extern target-board-start (state object target)) -(define-extern target-mech-start (state handle float symbol target)) -(define-extern target-turret-get-on (state handle target)) -(define-extern target-play-anim (state string handle target)) -(define-extern target-edge-grab (state target)) -(define-extern target-pole-cycle (state handle target)) -(define-extern target-slide-down-to-ground (state target)) +(defenum darkjak-stage + :bitfield #t + :type uint32 + (force-on) + (active) + (bomb0) + (bomb1) + (invinc) + (giant) + (no-anim) + (disable-force-on) + ) + ;; og:ignore-form:(new 'static 'boxed-array ;; DECOMP BEGINS @@ -293,7 +236,7 @@ target-darkjak-bomb0 (target-darkjak-bomb1 float float) target-darkjak-get-off - (target-darkjak-get-on int) + (target-darkjak-get-on darkjak-stage) target-darkjak-giant target-darkjak-running-attack (target-death symbol) diff --git a/goal_src/jak2/engine/target/target-handler.gc b/goal_src/jak2/engine/target/target-handler.gc index 0ab6fa60a7..05a803dc0a 100644 --- a/goal_src/jak2/engine/target/target-handler.gc +++ b/goal_src/jak2/engine/target/target-handler.gc @@ -274,8 +274,12 @@ (set! (-> self control send-attack-dest) (process->handle arg0)) (set! (-> self control send-attack-time) (current-time)) (send-event self 'hit arg1 arg0 arg2) - (set! arg0 - (the process (and (and (focus-test? self dark) (nonzero? (-> self darkjak)) (logtest? (-> self darkjak stage) 2)) arg0)) + (set! arg0 (the process (and (and (focus-test? self dark) + (nonzero? (-> self darkjak)) + (logtest? (-> self darkjak stage) (darkjak-stage active)) + ) + arg0 + )) ) (when (the-as object arg0) (when (and s4-0 (not s3-1) (-> self control danger-mode) (not (logtest? (-> s4-0 mask) (process-mask dark-effect)))) @@ -837,7 +841,10 @@ ) ) (('effect-control) - (when (and (focus-test? self dark) (nonzero? (-> self darkjak)) (logtest? (-> self darkjak stage) 32)) + (when (and (focus-test? self dark) + (nonzero? (-> self darkjak)) + (logtest? (-> self darkjak stage) (darkjak-stage giant)) + ) (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)) @@ -953,7 +960,10 @@ v0-0 ) ((and (and (focus-test? self dark) (nonzero? (-> self darkjak))) - (or (and (focus-test? self dark) (nonzero? (-> self darkjak)) (logtest? (-> self darkjak stage) 16)) + (or (and (focus-test? self dark) + (nonzero? (-> self darkjak)) + (logtest? (-> self darkjak stage) (darkjak-stage invinc)) + ) (logtest? (process-mask crate) (-> arg0 mask)) ) ) @@ -1249,10 +1259,10 @@ ((= v1-45 'darkjak) (cond ((not (and (focus-test? self dark) (nonzero? (-> self darkjak)))) - (go target-darkjak-get-on (the-as int (-> arg3 param 2))) + (go target-darkjak-get-on (the-as darkjak-stage (-> arg3 param 2))) ) ((logtest? (-> arg3 param 2) 128) - (logand! (-> self darkjak stage) -2) + (logclear! (-> self darkjak stage) (darkjak-stage force-on)) (set! v0-0 (+ (- (seconds 20) (-> self fact darkjak-start-time)) (current-time))) (set! (-> self fact darkjak-effect-time) (the-as time-frame v0-0)) v0-0 @@ -1302,7 +1312,7 @@ (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) + (set! (-> self darkjak want-stage) (the-as darkjak-stage v1-164)) (go target-darkjak-bomb0) ) ) diff --git a/goal_src/jak2/engine/target/target-util.gc b/goal_src/jak2/engine/target/target-util.gc index 47b6974ca5..e4f1b335a5 100644 --- a/goal_src/jak2/engine/target/target-util.gc +++ b/goal_src/jak2/engine/target/target-util.gc @@ -302,7 +302,9 @@ ) ) ) - (if (and (focus-test? self dark) (and (nonzero? (-> self darkjak)) (logtest? (-> self darkjak stage) 32))) + (if (and (focus-test? self dark) + (and (nonzero? (-> self darkjak)) (logtest? (-> self darkjak stage) (darkjak-stage giant))) + ) (set! f30-0 1.0) ) (set! (-> self control penetrate-using) (penetrate touch)) @@ -461,7 +463,10 @@ (set! (-> s5-0 transform-index) 21) ) (set! (-> self control penetrate-using) (penetrate touch punch)) - (if (and (focus-test? self dark) (nonzero? (-> self darkjak)) (logtest? (-> self darkjak stage) 2)) + (if (and (focus-test? self dark) + (nonzero? (-> self darkjak)) + (logtest? (-> self darkjak stage) (darkjak-stage active)) + ) (logior! (-> self control penetrate-using) (penetrate dark-punch)) ) ) @@ -607,7 +612,10 @@ ) (when (and (focus-test? self dark) (nonzero? (-> self darkjak))) (logior! (-> self control penetrate-using) (penetrate dark-skin)) - (when (and (focus-test? self dark) (nonzero? (-> self darkjak)) (logtest? (-> self darkjak stage) 32)) + (when (and (focus-test? self dark) + (nonzero? (-> self darkjak)) + (logtest? (-> self darkjak stage) (darkjak-stage giant)) + ) (logior! (-> self control penetrate-using) (penetrate dark-giant)) (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)) @@ -962,7 +970,9 @@ ) ) ) - (when (and (focus-test? self dark) (and (nonzero? (-> self darkjak)) (logtest? (-> self darkjak stage) 32))) + (when (and (focus-test? self dark) + (and (nonzero? (-> self darkjak)) (logtest? (-> self darkjak stage) (darkjak-stage giant))) + ) (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)) @@ -1002,7 +1012,10 @@ ) (defmethod get-inv-mass target ((obj target)) - (if (or (and (focus-test? obj dark) (nonzero? (-> obj darkjak)) (logtest? (-> obj darkjak stage) 32)) + (if (or (and (focus-test? obj dark) + (nonzero? (-> obj darkjak)) + (logtest? (-> obj darkjak stage) (darkjak-stage giant)) + ) (focus-test? obj mech) ) 0.1 diff --git a/goal_src/jak2/engine/target/target.gc b/goal_src/jak2/engine/target/target.gc index dfcf05218b..6f24ded39f 100644 --- a/goal_src/jak2/engine/target/target.gc +++ b/goal_src/jak2/engine/target/target.gc @@ -9,7 +9,7 @@ (defbehavior target-falling-trans target ((arg0 symbol) (arg1 time-frame)) (if (want-to-darkjak?) - (go target-darkjak-get-on 2) + (go target-darkjak-get-on (darkjak-stage active)) ) (if (and (cpad-pressed? (-> self control cpad number) circle) (can-feet? #f)) (go target-attack-air #f) @@ -76,7 +76,7 @@ (go target-walk) ) (if (want-to-darkjak?) - (go target-darkjak-get-on 2) + (go target-darkjak-get-on (darkjak-stage active)) ) (when (and (cpad-hold? (-> self control cpad number) l1) (can-duck?)) (logclear! (-> self state-flags) (state-flags lleg-still rleg-still lleg-no-ik rleg-no-ik)) @@ -188,7 +188,7 @@ (go target-stance) ) (if (want-to-darkjak?) - (go target-darkjak-get-on 2) + (go target-darkjak-get-on (darkjak-stage active)) ) (if (and (logtest? (logior (logior (-> *cpad-list* cpads (-> self control cpad number) button0-rel 0) (-> *cpad-list* cpads (-> self control cpad number) button0-rel 1) @@ -569,7 +569,10 @@ ) (defbehavior init-var-jump target ((arg0 float) (arg1 float) (arg2 symbol) (arg3 symbol) (arg4 vector) (arg5 float)) - (when (and (focus-test? self dark) (nonzero? (-> self darkjak)) (logtest? (-> self darkjak stage) 32)) + (when (and (focus-test? self dark) + (nonzero? (-> self darkjak)) + (logtest? (-> self darkjak stage) (darkjak-stage giant)) + ) (set! arg0 (* arg0 (-> self darkjak-giant-interp))) (set! arg1 (* arg1 (-> self darkjak-giant-interp))) ) @@ -694,17 +697,22 @@ ) ) 0 - (when (and arg1 - (ja-group) - (and (-> (ja-group) extra) - (not (and (focus-test? self dark) (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) (darkjak-stage giant)) + ) + ) + #t + ) ) (let ((v1-62 (res-lump-struct (-> (ja-group) extra) 'collide-offset vector :time (ja-aframe-num 0)))) (cond (v1-62 - (if (and (focus-test? self dark) (nonzero? (-> self darkjak)) (logtest? (-> self darkjak stage) 32)) + (if (and (focus-test? self dark) + (nonzero? (-> self darkjak)) + (logtest? (-> self darkjak stage) (darkjak-stage giant)) + ) (set! (-> v1-62 y) (* 0.5 (-> v1-62 y))) ) (set! v0-1 (-> self control anim-collide-offset-local)) @@ -720,55 +728,57 @@ ) ) -(define *duck-mods* - (new 'static 'surface - :name 'duck - :turnv 131072.0 - :turnvv 524288.0 - :tiltv 65536.0 - :tiltvv 262144.0 - :transv-max 16384.0 - :target-speed 16384.0 - :seek0 1.0 - :seek90 1.0 - :seek180 1.0 - :fric 1.0 - :nonlin-fric-dist 1.0 - :slip-factor 1.0 - :slide-factor 1.0 - :slope-up-factor 1.0 - :slope-down-factor 1.0 - :slope-slip-angle 1.0 - :impact-fric 1.0 - :bend-factor 1.0 - :bend-speed 1.0 - :alignv 1.0 - :slope-up-traction 1.0 - :align-speed 1.0 - :turnvf 30.0 - :turnvvf 30.0 - :tiltvf 150.0 - :tiltvvf 15.0 - :mult-hook (lambda :behavior target - ((arg0 surface) (arg1 surface) (arg2 surface) (arg3 int)) - (surface-clamp-speed arg0 arg1 arg2 arg3) - (when (= arg3 1) - (cond - ((and (focus-test? self dark) (nonzero? (-> self darkjak)) (logtest? (-> self darkjak stage) 32)) - (set! (-> arg0 target-speed) 81920.0) - ) - ((and (focus-test? self dark) (nonzero? (-> self darkjak))) - (set! (-> arg0 target-speed) 40960.0) - ) - (else - (set! (-> arg0 target-speed) 16384.0) - ) - ) +(define *duck-mods* (new 'static 'surface + :name 'duck + :turnv 131072.0 + :turnvv 524288.0 + :tiltv 65536.0 + :tiltvv 262144.0 + :transv-max 16384.0 + :target-speed 16384.0 + :seek0 1.0 + :seek90 1.0 + :seek180 1.0 + :fric 1.0 + :nonlin-fric-dist 1.0 + :slip-factor 1.0 + :slide-factor 1.0 + :slope-up-factor 1.0 + :slope-down-factor 1.0 + :slope-slip-angle 1.0 + :impact-fric 1.0 + :bend-factor 1.0 + :bend-speed 1.0 + :alignv 1.0 + :slope-up-traction 1.0 + :align-speed 1.0 + :turnvf 30.0 + :turnvvf 30.0 + :tiltvf 150.0 + :tiltvvf 15.0 + :mult-hook (lambda :behavior target + ((arg0 surface) (arg1 surface) (arg2 surface) (arg3 int)) + (surface-clamp-speed arg0 arg1 arg2 arg3) + (when (= arg3 1) + (cond + ((and (focus-test? self dark) + (nonzero? (-> self darkjak)) + (logtest? (-> self darkjak stage) (darkjak-stage giant)) + ) + (set! (-> arg0 target-speed) 81920.0) + ) + ((and (focus-test? self dark) (nonzero? (-> self darkjak))) + (set! (-> arg0 target-speed) 40960.0) + ) + (else + (set! (-> arg0 target-speed) 16384.0) + ) + ) + ) + ) + :flags (surface-flag duck) + ) ) - ) - :flags (surface-flag duck) - ) - ) (defstate target-duck-stance (target) :event target-standard-event-handler @@ -823,7 +833,7 @@ (go target-duck-walk 'duck) ) (if (want-to-darkjak?) - (go target-darkjak-get-on 2) + (go target-darkjak-get-on (darkjak-stage active)) ) (when (and (logtest? (logior (logior (-> *cpad-list* cpads (-> self control cpad number) button0-rel 0) (-> *cpad-list* cpads (-> self control cpad number) button0-rel 1) @@ -979,7 +989,7 @@ (go target-duck-stance 'duck) ) (if (want-to-darkjak?) - (go target-darkjak-get-on 2) + (go target-darkjak-get-on (darkjak-stage active)) ) (when (and (logtest? (logior (logior (-> *cpad-list* cpads (-> self control cpad number) button0-rel 0) (-> *cpad-list* cpads (-> self control cpad number) button0-rel 1) @@ -1895,7 +1905,10 @@ 600 1500 ) - (if (and (focus-test? self dark) (nonzero? (-> self darkjak)) (logtest? (-> self darkjak stage) 32)) + (if (and (focus-test? self dark) + (nonzero? (-> self darkjak)) + (logtest? (-> self darkjak stage) (darkjak-stage giant)) + ) (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))) @@ -3118,7 +3131,10 @@ ) ) ) - ((and (focus-test? self dark) (nonzero? (-> self darkjak)) (logtest? (-> self darkjak stage) 8)) + ((and (focus-test? self dark) + (nonzero? (-> self darkjak)) + (logtest? (-> self darkjak stage) (darkjak-stage bomb1)) + ) (set! (-> self control unknown-sound-id00) (add-process *gui-control* self (gui-channel jak) (gui-action queue) "darkbom1" -99.0 0) ) @@ -3368,7 +3384,10 @@ ((and (= (-> self fact eco-type) 1) (>= (-> self fact eco-level) 1.0)) (go target-yellow-jump-blast) ) - ((and (focus-test? self dark) (nonzero? (-> self darkjak)) (logtest? (-> self darkjak stage) 4)) + ((and (focus-test? self dark) + (nonzero? (-> self darkjak)) + (logtest? (-> self darkjak stage) (darkjak-stage bomb0)) + ) (go target-darkjak-bomb0) ) ) @@ -3439,7 +3458,10 @@ (when gp-1 (logior! (-> self control status) (collide-status on-surface)) (when (or (and (= (-> self fact eco-type) 2) (>= (-> self fact eco-level) 1.0)) - (and (focus-test? self dark) (nonzero? (-> self darkjak)) (logtest? (-> self darkjak stage) 2)) + (and (focus-test? self dark) + (nonzero? (-> self darkjak)) + (logtest? (-> self darkjak stage) (darkjak-stage active)) + ) ) (cpad-set-buzz! (-> *cpad-list* cpads 0) 1 255 (seconds 0.5)) (if (and (= (-> self fact eco-type) 2) (>= (-> self fact eco-level) 1.0)) diff --git a/goal_src/jak2/engine/target/target2.gc b/goal_src/jak2/engine/target/target2.gc index d14454a610..b2cb566faf 100644 --- a/goal_src/jak2/engine/target/target2.gc +++ b/goal_src/jak2/engine/target/target2.gc @@ -308,7 +308,7 @@ ) (set! (-> self gun fire-dir-out quad) (-> gp-0 vector 2 quad)) ) - (set! (-> self gun track?) (the-as uint 6)) + (set! (-> self gun track?) (gun-track-flags gutflags-1 gutflags-2)) (target-gun-check) ) (none) @@ -1209,7 +1209,7 @@ (go target-walk) ) (if (want-to-darkjak?) - (go target-darkjak-get-on 2) + (go target-darkjak-get-on (darkjak-stage active)) ) (if (and (cpad-hold? (-> self control cpad number) l1) (can-duck?)) (go target-duck-stance #f) diff --git a/goal_src/jak2/engine/ui/minimap.gc b/goal_src/jak2/engine/ui/minimap.gc index 152fe937ba..00631c7294 100644 --- a/goal_src/jak2/engine/ui/minimap.gc +++ b/goal_src/jak2/engine/ui/minimap.gc @@ -1914,12 +1914,7 @@ (set! (-> (the-as (pointer uint128) s3-1) 1) (-> obj draw2-tmpl quad 1)) (let ((s2-0 (new-stack-vector0))) (let ((s1-0 (new-stack-vector0))) - (let ((s0-0 s1-0) - (t9-3 matrix-local->world) - (a0-10 #f) - ) - (set! (-> s0-0 quad) (-> (t9-3 a0-10) vector 2 quad)) - ) + (set! (-> s1-0 quad) (-> (matrix-local->world #f #f) vector 2 quad)) (set! (-> s1-0 y) 0.0) (vector-normalize! s1-0 1.0) (let ((v1-16 (-> arg0 mat))) diff --git a/goal_src/jak2/levels/atoll/sig0-course.gc b/goal_src/jak2/levels/atoll/sig0-course.gc index bc778e7a95..b097421499 100644 --- a/goal_src/jak2/levels/atoll/sig0-course.gc +++ b/goal_src/jak2/levels/atoll/sig0-course.gc @@ -142,8 +142,8 @@ ) (defun sig0-say-look-out-if-should ((arg0 sig-atoll)) - (when (logtest? (-> arg0 bot-task-bits) 4) - (when (not (logtest? (-> arg0 bot-task-bits) 16)) + (when (logtest? (-> arg0 bot-task-bits) (bot-task-bits botbits-2)) + (when (not (logtest? (-> arg0 bot-task-bits) (bot-task-bits botbits-4))) (let ((s5-0 (handle->process (-> arg0 focus handle)))) (when s5-0 (let ((v1-9 (if (type? s5-0 nav-enemy) @@ -153,14 +153,14 @@ ) (when v1-9 (if (>= 20480.0 (- (-> (the-as process-focusable v1-9) root trans y) (-> arg0 root trans y))) - (logior! (-> arg0 bot-task-bits) 16) + (logior! (-> arg0 bot-task-bits) (bot-task-bits botbits-4)) ) ) ) ) ) ) - (if (and (logtest? (-> arg0 bot-task-bits) 16) + (if (and (logtest? (-> arg0 bot-task-bits) (bot-task-bits botbits-4)) (not (speech-playing? arg0 26)) (not (channel-active? arg0 (the-as uint 0))) ) @@ -171,7 +171,7 @@ ) (defun sig-say-waste-the-suckers-if-should ((arg0 sig-atoll)) - (if (and (logtest? (-> arg0 bot-task-bits) 8) + (if (and (logtest? (-> arg0 bot-task-bits) (bot-task-bits botbits-3)) (not (speech-playing? arg0 25)) (not (channel-active? arg0 (the-as uint 0))) ) @@ -363,7 +363,7 @@ ) ) :on-update (lambda ((arg0 sig-atoll)) - (if (and (logtest? (-> arg0 bot-task-bits) 2) + (if (and (logtest? (-> arg0 bot-task-bits) (bot-task-bits botbits-1)) (not (speech-playing? arg0 33)) (not (channel-active? arg0 (the-as uint 0))) ) @@ -416,7 +416,7 @@ (none) ) :on-update (lambda ((arg0 sig-atoll)) - (if (and (logtest? (-> arg0 bot-task-bits) 2) + (if (and (logtest? (-> arg0 bot-task-bits) (bot-task-bits botbits-1)) (not (speech-playing? arg0 33)) (not (channel-active? arg0 (the-as uint 0))) ) @@ -739,7 +739,7 @@ (f1-0 98304.0) ) (if (>= f0-0 (* f1-0 f1-0)) - (logior! (-> arg0 waypoint-bits) 2) + (logior! (-> arg0 waypoint-bits) (waypoint-bits wabits-1)) ) ) (play-speech arg0 6) @@ -752,11 +752,11 @@ (function sigt-wait-spot sig symbol) (lambda ((arg0 object) (arg1 sig-atoll)) (with-pp - (when (and (not (logtest? (-> arg1 waypoint-bits) 4)) + (when (and (not (logtest? (-> arg1 waypoint-bits) (waypoint-bits wabits-2))) (outside-spot-radius? arg1 (the-as bot-spot #f) (the-as vector #f) #f) ) - (logand! (-> arg1 waypoint-bits) -5) - (when (not (logtest? (-> arg1 waypoint-bits) 1)) + (logclear! (-> arg1 waypoint-bits) (waypoint-bits wabits-2)) + (when (not (logtest? (-> arg1 waypoint-bits) (waypoint-bits wabits-0))) (let ((a1-2 (new 'stack-no-clear 'event-message-block))) (set! (-> a1-2 from) (process->ppointer pp)) (set! (-> a1-2 num-params) 0) @@ -788,8 +788,8 @@ a1-3 ) ((2) - (when (not (logtest? (-> arg1 waypoint-bits) 1)) - (logior! (-> arg1 waypoint-bits) 1) + (when (not (logtest? (-> arg1 waypoint-bits) (waypoint-bits wabits-0))) + (logior! (-> arg1 waypoint-bits) (waypoint-bits wabits-0)) (let ((a1-4 (new 'stack-no-clear 'event-message-block))) (set! (-> a1-4 from) (process->ppointer pp)) (set! (-> a1-4 num-params) 0) @@ -844,22 +844,22 @@ :on-update (lambda ((arg0 sig-atoll)) (with-pp (cond - ((and (logtest? (-> arg0 waypoint-bits) 2) + ((and (logtest? (-> arg0 waypoint-bits) (waypoint-bits wabits-1)) (outside-spot-radius? arg0 (the-as bot-spot #f) (the-as vector #f) #f) ) - (logand! (-> arg0 waypoint-bits) -3) + (logclear! (-> arg0 waypoint-bits) (waypoint-bits wabits-1)) (let ((f0-0 98304.0)) (if (>= (* f0-0 f0-0) (vector-vector-xz-distance-squared (target-pos 0) (-> arg0 root trans))) (play-speech arg0 34) ) ) ) - ((and (logtest? (-> arg0 waypoint-bits) 2) + ((and (logtest? (-> arg0 waypoint-bits) (waypoint-bits wabits-1)) (let ((f0-3 49152.0)) (>= (* f0-3 f0-3) (vector-vector-xz-distance-squared (target-pos 0) (-> arg0 root trans))) ) ) - (logand! (-> arg0 waypoint-bits) -3) + (logclear! (-> arg0 waypoint-bits) (waypoint-bits wabits-1)) (play-speech arg0 34) ) (else @@ -886,16 +886,18 @@ ) (when (and (demo?) (>= (- (current-time) (-> arg0 waypoint-time0)) (seconds 1)) - (logtest? (-> arg0 waypoint-bits) 16) + (logtest? (-> arg0 waypoint-bits) (waypoint-bits wabits-4)) ) - (logand! (-> arg0 waypoint-bits) -17) + (logclear! (-> arg0 waypoint-bits) (waypoint-bits wabits-4)) (talker-spawn-func (-> *talker-speech* 80) *entity-pool* (target-pos 0) (the-as region #f)) ) - (when (or (not (logtest? (-> arg0 waypoint-bits) 8)) (>= (- (current-time) (-> arg0 waypoint-time0)) (seconds 8))) - (if (and (demo?) (not (logtest? (-> arg0 waypoint-bits) 8))) - (logior! (-> arg0 waypoint-bits) 16) + (when (or (not (logtest? (-> arg0 waypoint-bits) (waypoint-bits wabits-3))) + (>= (- (current-time) (-> arg0 waypoint-time0)) (seconds 8)) + ) + (if (and (demo?) (not (logtest? (-> arg0 waypoint-bits) (waypoint-bits wabits-3)))) + (logior! (-> arg0 waypoint-bits) (waypoint-bits wabits-4)) ) - (logior! (-> arg0 waypoint-bits) 8) + (logior! (-> arg0 waypoint-bits) (waypoint-bits wabits-3)) (let* ((s5-4 (-> arg0 sig-course)) (s4-1 (-> s5-4 liftcat-speech-index)) ) @@ -948,7 +950,7 @@ (set! (-> arg1 too-far-warn-dist) 184320.0) (set! (-> arg1 too-far-fail-dist-delta) 122880.0) (cond - ((not (logtest? (-> arg1 waypoint-bits) 1)) + ((not (logtest? (-> arg1 waypoint-bits) (waypoint-bits wabits-0))) (when (outside-spot-radius? arg1 (the-as bot-spot #f) (the-as vector #f) #f) (let ((f0-2 (vector-vector-xz-distance-squared (-> arg1 root trans) (target-pos 0))) (f1-0 81920.0) @@ -960,7 +962,7 @@ (process-grab? *target* #t) ) (set! (-> arg1 waypoint-time0) (current-time)) - (logior! (-> arg1 waypoint-bits) 1) + (logior! (-> arg1 waypoint-bits) (waypoint-bits wabits-0)) (process-grab? arg1 #f) (process-grab? *target* #f) (reset-warn-time! arg1) @@ -975,7 +977,7 @@ ) ) ) - ((begin (reset-warn-time! arg1) (logtest? (-> arg1 waypoint-bits) 2)) + ((begin (reset-warn-time! arg1) (logtest? (-> arg1 waypoint-bits) (waypoint-bits wabits-1))) (when (>= (- (current-time) (-> arg1 waypoint-time0)) (seconds 4.5)) (process-release? arg1) (process-release? *target*) @@ -988,7 +990,7 @@ (else (when (>= (- (current-time) (-> arg1 waypoint-time0)) (seconds 3)) (remove-setting! 'entity-name) - (logior! (-> arg1 waypoint-bits) 2) + (logior! (-> arg1 waypoint-bits) (waypoint-bits wabits-1)) (set-setting! 'sound-mode #f 0.0 1) ) ) @@ -1038,7 +1040,7 @@ (with-pp (cond ((sig-plasma-method-10 (-> arg1 plasma)) - (when (not (logtest? (-> arg1 waypoint-bits) 1)) + (when (not (logtest? (-> arg1 waypoint-bits) (waypoint-bits wabits-0))) (let ((a1-1 (new 'stack-no-clear 'event-message-block))) (set! (-> a1-1 from) (process->ppointer pp)) (set! (-> a1-1 num-params) 0) @@ -1054,7 +1056,7 @@ ) ) ) - (logior! (-> arg1 waypoint-bits) 1) + (logior! (-> arg1 waypoint-bits) (waypoint-bits wabits-0)) ) (let ((s5-0 *target*)) (if (and s5-0 (let ((a1-2 (new 'stack-no-clear 'event-message-block))) @@ -1089,7 +1091,7 @@ ) ) (else - (when (logtest? (-> arg1 waypoint-bits) 1) + (when (logtest? (-> arg1 waypoint-bits) (waypoint-bits wabits-0)) (let ((a1-8 (new 'stack-no-clear 'event-message-block))) (set! (-> a1-8 from) (process->ppointer pp)) (set! (-> a1-8 num-params) 0) @@ -1105,7 +1107,7 @@ ) ) ) - (logand! (-> arg1 waypoint-bits) -2) + (logclear! (-> arg1 waypoint-bits) (waypoint-bits wabits-0)) ) ) ) @@ -1402,7 +1404,7 @@ ) ) ) - ((begin (reset-warn-time! arg1) (logtest? (-> arg1 waypoint-bits) 1)) + ((begin (reset-warn-time! arg1) (logtest? (-> arg1 waypoint-bits) (waypoint-bits wabits-0))) (when (>= (- (current-time) (-> arg1 waypoint-time0)) (seconds 4.5)) (process-release? arg1) (process-release? *target*) @@ -1415,7 +1417,7 @@ (else (when (>= (- (current-time) (-> arg1 waypoint-time0)) (seconds 3)) (remove-setting! 'entity-name) - (logior! (-> arg1 waypoint-bits) 1) + (logior! (-> arg1 waypoint-bits) (waypoint-bits wabits-0)) (set-setting! 'sound-mode #f 0.0 1) ) ) @@ -1466,7 +1468,7 @@ (with-pp (cond ((sig-plasma-method-10 (-> arg1 plasma)) - (when (not (logtest? (-> arg1 waypoint-bits) 1)) + (when (not (logtest? (-> arg1 waypoint-bits) (waypoint-bits wabits-0))) (let ((a1-1 (new 'stack-no-clear 'event-message-block))) (set! (-> a1-1 from) (process->ppointer pp)) (set! (-> a1-1 num-params) 0) @@ -1482,7 +1484,7 @@ ) ) ) - (logior! (-> arg1 waypoint-bits) 1) + (logior! (-> arg1 waypoint-bits) (waypoint-bits wabits-0)) ) (if (and *target* (let ((a1-2 (new 'stack-no-clear 'event-message-block))) @@ -1517,7 +1519,7 @@ ) ) (else - (when (logtest? (-> arg1 waypoint-bits) 1) + (when (logtest? (-> arg1 waypoint-bits) (waypoint-bits wabits-0)) (let ((a1-9 (new 'stack-no-clear 'event-message-block))) (set! (-> a1-9 from) (process->ppointer pp)) (set! (-> a1-9 num-params) 0) @@ -1533,7 +1535,7 @@ ) ) ) - (logand! (-> arg1 waypoint-bits) -2) + (logclear! (-> arg1 waypoint-bits) (waypoint-bits wabits-0)) ) ) ) @@ -1564,14 +1566,14 @@ (the-as (function sigt-wait-spot sig symbol) (lambda ((arg0 object) (arg1 sig-atoll)) - (when (and (not (logtest? (-> arg1 waypoint-bits) 1)) (scene-release? arg1)) + (when (and (not (logtest? (-> arg1 waypoint-bits) (waypoint-bits wabits-0))) (scene-release? arg1)) (remove-setting! 'sound-mode) (clear-poi-and-focus! arg1) (reset-warn-time! arg1) (play-speech arg1 17) - (logior! (-> arg1 waypoint-bits) 1) + (logior! (-> arg1 waypoint-bits) (waypoint-bits wabits-0)) ) - (when (and (logtest? (-> arg1 waypoint-bits) 1) (not (channel-active? arg1 (the-as uint 0)))) + (when (and (logtest? (-> arg1 waypoint-bits) (waypoint-bits wabits-0)) (not (channel-active? arg1 (the-as uint 0)))) (ai-task-control-method-12 (-> arg1 ai-ctrl) arg1) (go-to-waypoint! arg1 20 #f) (ai-task-control-method-10 (-> arg1 ai-ctrl) arg1) @@ -1669,8 +1671,10 @@ ) ) ) - (when (or (not (logtest? (-> arg1 waypoint-bits) 2)) (>= (- (current-time) (-> arg1 waypoint-time0)) (seconds 8))) - (logior! (-> arg1 waypoint-bits) 2) + (when (or (not (logtest? (-> arg1 waypoint-bits) (waypoint-bits wabits-1))) + (>= (- (current-time) (-> arg1 waypoint-time0)) (seconds 8)) + ) + (logior! (-> arg1 waypoint-bits) (waypoint-bits wabits-1)) (let* ((s5-1 (-> arg1 sig-course)) (s4-1 (-> s5-1 liftcat-speech-index)) ) @@ -1689,8 +1693,8 @@ ) ) ((= v1-6 2) - (when (not (logtest? (-> arg1 waypoint-bits) 1)) - (logior! (-> arg1 waypoint-bits) 1) + (when (not (logtest? (-> arg1 waypoint-bits) (waypoint-bits wabits-0))) + (logior! (-> arg1 waypoint-bits) (waypoint-bits wabits-0)) (let ((a1-8 (new 'stack-no-clear 'event-message-block))) (set! (-> a1-8 from) (process->ppointer pp)) (set! (-> a1-8 num-params) 0) @@ -1802,7 +1806,7 @@ ) ) ) - ((begin (reset-warn-time! arg1) (logtest? (-> arg1 waypoint-bits) 1)) + ((begin (reset-warn-time! arg1) (logtest? (-> arg1 waypoint-bits) (waypoint-bits wabits-0))) (when (>= (- (current-time) (-> arg1 waypoint-time0)) (seconds 4.5)) (process-release? arg1) (process-release? *target*) @@ -1815,7 +1819,7 @@ (else (when (>= (- (current-time) (-> arg1 waypoint-time0)) (seconds 3)) (remove-setting! 'entity-name) - (logior! (-> arg1 waypoint-bits) 1) + (logior! (-> arg1 waypoint-bits) (waypoint-bits wabits-0)) (set-setting! 'sound-mode #f 0.0 1) ) ) @@ -1864,7 +1868,7 @@ (with-pp (cond ((sig-plasma-method-10 (-> arg1 plasma)) - (when (not (logtest? (-> arg1 waypoint-bits) 1)) + (when (not (logtest? (-> arg1 waypoint-bits) (waypoint-bits wabits-0))) (let ((a1-1 (new 'stack-no-clear 'event-message-block))) (set! (-> a1-1 from) (process->ppointer pp)) (set! (-> a1-1 num-params) 0) @@ -1880,7 +1884,7 @@ ) ) ) - (logior! (-> arg1 waypoint-bits) 1) + (logior! (-> arg1 waypoint-bits) (waypoint-bits wabits-0)) ) (if (and *target* (let ((a1-2 (new 'stack-no-clear 'event-message-block))) @@ -1919,7 +1923,7 @@ ) ) (else - (when (logtest? (-> arg1 waypoint-bits) 1) + (when (logtest? (-> arg1 waypoint-bits) (waypoint-bits wabits-0)) (let ((a1-9 (new 'stack-no-clear 'event-message-block))) (set! (-> a1-9 from) (process->ppointer pp)) (set! (-> a1-9 num-params) 0) @@ -1935,7 +1939,7 @@ ) ) ) - (logand! (-> arg1 waypoint-bits) -2) + (logclear! (-> arg1 waypoint-bits) (waypoint-bits wabits-0)) ) ) ) @@ -2149,12 +2153,12 @@ ) ) ) - ((begin (reset-warn-time! arg1) (logtest? (-> arg1 waypoint-bits) 1)) - (when (and (not (logtest? (-> arg1 waypoint-bits) 2)) + ((begin (reset-warn-time! arg1) (logtest? (-> arg1 waypoint-bits) (waypoint-bits wabits-0))) + (when (and (not (logtest? (-> arg1 waypoint-bits) (waypoint-bits wabits-1))) (>= (- (current-time) (-> arg1 waypoint-time0)) (seconds 0.1)) ) (remove-setting! 'string-startup-vector) - (logior! (-> arg1 waypoint-bits) 2) + (logior! (-> arg1 waypoint-bits) (waypoint-bits wabits-1)) ) (when (>= (- (current-time) (-> arg1 waypoint-time0)) (seconds 3.5)) (process-release? arg1) @@ -2169,7 +2173,7 @@ (when (>= (- (current-time) (-> arg1 waypoint-time0)) (seconds 2)) (set-setting! 'string-startup-vector 'abs (new 'static 'vector :x 1.0) 0) (remove-setting! 'entity-name) - (logior! (-> arg1 waypoint-bits) 1) + (logior! (-> arg1 waypoint-bits) (waypoint-bits wabits-0)) (set-setting! 'sound-mode #f 0.0 1) ) ) @@ -2218,7 +2222,7 @@ (with-pp (cond ((sig-plasma-method-10 (-> arg1 plasma)) - (when (not (logtest? (-> arg1 waypoint-bits) 1)) + (when (not (logtest? (-> arg1 waypoint-bits) (waypoint-bits wabits-0))) (let ((a1-1 (new 'stack-no-clear 'event-message-block))) (set! (-> a1-1 from) (process->ppointer pp)) (set! (-> a1-1 num-params) 0) @@ -2234,7 +2238,7 @@ ) ) ) - (logior! (-> arg1 waypoint-bits) 1) + (logior! (-> arg1 waypoint-bits) (waypoint-bits wabits-0)) ) (if (and *target* (let ((a1-2 (new 'stack-no-clear 'event-message-block))) @@ -2269,7 +2273,7 @@ ) ) (else - (when (logtest? (-> arg1 waypoint-bits) 1) + (when (logtest? (-> arg1 waypoint-bits) (waypoint-bits wabits-0)) (let ((a1-9 (new 'stack-no-clear 'event-message-block))) (set! (-> a1-9 from) (process->ppointer pp)) (set! (-> a1-9 num-params) 0) @@ -2285,7 +2289,7 @@ ) ) ) - (logand! (-> arg1 waypoint-bits) -2) + (logclear! (-> arg1 waypoint-bits) (waypoint-bits wabits-0)) ) ) ) @@ -2315,14 +2319,14 @@ (the-as (function sigt-wait-spot sig symbol) (lambda ((arg0 object) (arg1 sig-atoll)) - (when (and (not (logtest? (-> arg1 waypoint-bits) 1)) (scene-release? arg1)) + (when (and (not (logtest? (-> arg1 waypoint-bits) (waypoint-bits wabits-0))) (scene-release? arg1)) (clear-poi-and-focus! arg1) (remove-setting! 'sound-mode) (reset-warn-time! arg1) (play-speech arg1 24) - (logior! (-> arg1 waypoint-bits) 1) + (logior! (-> arg1 waypoint-bits) (waypoint-bits wabits-0)) ) - (when (and (logtest? (-> arg1 waypoint-bits) 1) (not (channel-active? arg1 (the-as uint 0)))) + (when (and (logtest? (-> arg1 waypoint-bits) (waypoint-bits wabits-0)) (not (channel-active? arg1 (the-as uint 0)))) (ai-task-control-method-12 (-> arg1 ai-ctrl) arg1) (go-to-waypoint! arg1 31 #f) (ai-task-control-method-10 (-> arg1 ai-ctrl) arg1) @@ -2372,11 +2376,11 @@ :on-update (lambda ((arg0 sig-atoll)) (with-pp (cond - ((not (logtest? (-> arg0 bot-task-bits) 4)) + ((not (logtest? (-> arg0 bot-task-bits) (bot-task-bits botbits-2))) (when (and (>= (- (current-time) (-> arg0 waypoint-time0)) (seconds 0.25)) (< (-> arg0 sig-course spots 36 center x) (-> (target-pos 0) x)) ) - (logior! (-> arg0 bot-task-bits) 4) + (logior! (-> arg0 bot-task-bits) (bot-task-bits botbits-2)) (let ((a1-0 (new 'stack-no-clear 'event-message-block))) (set! (-> a1-0 from) (process->ppointer pp)) (set! (-> a1-0 num-params) 0) @@ -2422,8 +2426,8 @@ (set! (-> arg0 too-far-fail-dist-delta) 163840.0) (logclear! (-> arg0 focus-status) (focus-status disable)) (set! (-> arg0 notice-enemy-dist) 122880.0) - (when (not (logtest? (-> arg0 bot-task-bits) 4)) - (logior! (-> arg0 bot-task-bits) 4) + (when (not (logtest? (-> arg0 bot-task-bits) (bot-task-bits botbits-2))) + (logior! (-> arg0 bot-task-bits) (bot-task-bits botbits-2)) (let ((a1-0 (new 'stack-no-clear 'event-message-block))) (set! (-> a1-0 from) (process->ppointer pp)) (set! (-> a1-0 num-params) 0) @@ -2447,7 +2451,7 @@ (set! (-> (the-as sigt-wait-spot v1-18) check-done) (the-as (function sigt-wait-spot sig symbol) - (lambda ((arg0 object) (arg1 sig-atoll)) (when (logtest? (-> arg1 waypoint-bits) 1) + (lambda ((arg0 object) (arg1 sig-atoll)) (when (logtest? (-> arg1 waypoint-bits) (waypoint-bits wabits-0)) (ai-task-control-method-12 (-> arg1 ai-ctrl) arg1) (go-to-waypoint! arg1 33 #f) (ai-task-control-method-10 (-> arg1 ai-ctrl) arg1) @@ -2462,8 +2466,10 @@ ) :on-update (lambda ((arg0 sig-atoll)) (sig0-say-look-out-if-should arg0) - (when (and (not (logtest? (-> arg0 waypoint-bits) 1)) (>= (- (current-time) (-> arg0 waypoint-time0)) (seconds 8))) - (logior! (-> arg0 waypoint-bits) 1) + (when (and (not (logtest? (-> arg0 waypoint-bits) (waypoint-bits wabits-0))) + (>= (- (current-time) (-> arg0 waypoint-time0)) (seconds 8)) + ) + (logior! (-> arg0 waypoint-bits) (waypoint-bits wabits-0)) (logior! (-> arg0 focus-status) (focus-status disable)) (set! (-> arg0 notice-enemy-dist) 16384.0) ) @@ -2566,15 +2572,15 @@ (play-speech arg0 27) ) ) - ((not (logtest? (-> arg0 waypoint-bits) 1)) + ((not (logtest? (-> arg0 waypoint-bits) (waypoint-bits wabits-0))) (when (speech-ended? arg0 27) - (logior! (-> arg0 waypoint-bits) 1) + (logior! (-> arg0 waypoint-bits) (waypoint-bits wabits-0)) (logclear! (-> arg0 focus-status) (focus-status disable)) (set! (-> arg0 notice-enemy-dist) 122880.0) (set! (-> arg0 waypoint-time0) (current-time)) ) ) - ((not (logtest? (-> arg0 waypoint-bits) 2)) + ((not (logtest? (-> arg0 waypoint-bits) (waypoint-bits wabits-1))) (let ((a1-3 (new 'stack-no-clear 'event-message-block))) (set! (-> a1-3 from) (process->ppointer pp)) (set! (-> a1-3 num-params) 1) @@ -2598,7 +2604,7 @@ (>= (- (current-time) (-> arg0 waypoint-time0)) (seconds 10)) ) (logior! (-> arg0 bot-flags) (bot-flags bf21)) - (logior! (-> arg0 waypoint-bits) 2) + (logior! (-> arg0 waypoint-bits) (waypoint-bits wabits-1)) ) (else (if (and (>= (- (current-time) (-> arg0 waypoint-time0)) (seconds 4)) (not (speech-playing? arg0 28))) @@ -2771,12 +2777,12 @@ ) ) ) - ((begin (reset-warn-time! arg1) (logtest? (-> arg1 waypoint-bits) 1)) - (when (and (not (logtest? (-> arg1 waypoint-bits) 2)) + ((begin (reset-warn-time! arg1) (logtest? (-> arg1 waypoint-bits) (waypoint-bits wabits-0))) + (when (and (not (logtest? (-> arg1 waypoint-bits) (waypoint-bits wabits-1))) (>= (- (current-time) (-> arg1 waypoint-time0)) (seconds 0.1)) ) (remove-setting! 'string-startup-vector) - (logior! (-> arg1 waypoint-bits) 2) + (logior! (-> arg1 waypoint-bits) (waypoint-bits wabits-1)) ) (when (>= (- (current-time) (-> arg1 waypoint-time0)) (seconds 4.5)) (process-release? arg1) @@ -2791,7 +2797,7 @@ (when (>= (- (current-time) (-> arg1 waypoint-time0)) (seconds 3)) (set-setting! 'string-startup-vector 'abs (new 'static 'vector :x -1.0) 0) (remove-setting! 'entity-name) - (logior! (-> arg1 waypoint-bits) 1) + (logior! (-> arg1 waypoint-bits) (waypoint-bits wabits-0)) (set-setting! 'sound-mode #f 0.0 1) ) ) @@ -2849,7 +2855,7 @@ (with-pp (cond ((sig-plasma-method-10 (-> arg1 plasma)) - (when (not (logtest? (-> arg1 waypoint-bits) 1)) + (when (not (logtest? (-> arg1 waypoint-bits) (waypoint-bits wabits-0))) (let ((a1-1 (new 'stack-no-clear 'event-message-block))) (set! (-> a1-1 from) (process->ppointer pp)) (set! (-> a1-1 num-params) 0) @@ -2865,7 +2871,7 @@ ) ) ) - (logior! (-> arg1 waypoint-bits) 1) + (logior! (-> arg1 waypoint-bits) (waypoint-bits wabits-0)) ) (when (and *target* (let ((a1-2 (new 'stack-no-clear 'event-message-block))) @@ -2908,7 +2914,7 @@ ) ) (else - (when (logtest? (-> arg1 waypoint-bits) 1) + (when (logtest? (-> arg1 waypoint-bits) (waypoint-bits wabits-0)) (let ((a1-12 (new 'stack-no-clear 'event-message-block))) (set! (-> a1-12 from) (process->ppointer pp)) (set! (-> a1-12 num-params) 0) @@ -2924,7 +2930,7 @@ ) ) ) - (logand! (-> arg1 waypoint-bits) -2) + (logclear! (-> arg1 waypoint-bits) (waypoint-bits wabits-0)) ) ) ) diff --git a/goal_src/jak2/levels/city/kiddogescort/hal4-course.gc b/goal_src/jak2/levels/city/kiddogescort/hal4-course.gc index cdb58cfe73..bf0a7fb8be 100644 --- a/goal_src/jak2/levels/city/kiddogescort/hal4-course.gc +++ b/goal_src/jak2/levels/city/kiddogescort/hal4-course.gc @@ -791,23 +791,23 @@ (v1-10 (the-as process *traffic-manager*)) ) (cond - ((not (logtest? (-> arg1 waypoint-bits) 1)) + ((not (logtest? (-> arg1 waypoint-bits) (waypoint-bits wabits-0))) (when (and s4-0 (and s5-1 v1-10)) - (logior! (-> arg1 waypoint-bits) 1) + (logior! (-> arg1 waypoint-bits) (waypoint-bits wabits-0)) (set! (-> arg1 slave-handle 0) (process->handle s4-0)) (set! (-> arg1 slave-handle 1) (process->handle s5-1)) ) #f ) - ((not (logtest? (-> arg1 waypoint-bits) 2)) - (logior! (-> arg1 waypoint-bits) 2) + ((not (logtest? (-> arg1 waypoint-bits) (waypoint-bits wabits-1))) + (logior! (-> arg1 waypoint-bits) (waypoint-bits wabits-1)) (hal-method-226 arg1) (send-event s4-0 'request 'waypoint 2) (send-event s5-1 'request 'waypoint 2) #f ) - ((not (logtest? (-> arg1 waypoint-bits) 4)) - (logior! (-> arg1 waypoint-bits) 4) + ((not (logtest? (-> arg1 waypoint-bits) (waypoint-bits wabits-2))) + (logior! (-> arg1 waypoint-bits) (waypoint-bits wabits-2)) (let ((s5-2 *traffic-manager*)) (send-event s5-2 'deactivate-all) (let ((s4-1 (new 'stack 'traffic-object-spawn-params))) @@ -1192,9 +1192,11 @@ (function halt-wait-spot hal symbol) (lambda ((arg0 object) (arg1 hal-escort)) (hal-escort-method-232 arg1) - (when (and (not (logtest? (-> arg1 waypoint-bits) 1)) (not (-> *setting-control* user-current pilot-exit))) + (when (and (not (logtest? (-> arg1 waypoint-bits) (waypoint-bits wabits-0))) + (not (-> *setting-control* user-current pilot-exit)) + ) (send-event (handle->process (-> arg1 arrow-handle)) 'set-position (-> arg1 hal4-course spots 6)) - (logior! (-> arg1 waypoint-bits) 1) + (logior! (-> arg1 waypoint-bits) (waypoint-bits wabits-0)) ) (if (and (not (speech-playing? arg1 14)) (not (-> *setting-control* user-current pilot-exit)) @@ -1548,9 +1550,9 @@ (not (logtest? (-> s5-0 focus-status) (focus-status edge-grab))) ) ) - (when (not (logtest? (-> arg1 bot-task-bits) 1)) + (when (not (logtest? (-> arg1 bot-task-bits) (bot-task-bits botbits-0))) (send-event *traffic-manager* 'set-alert-duration (seconds 1)) - (logior! (-> arg1 bot-task-bits) 1) + (logior! (-> arg1 bot-task-bits) (bot-task-bits botbits-0)) ) (when (not (hal-escort-method-230 arg1)) (let* ((v1-34 (-> arg1 actor-group 0 data 2 actor)) @@ -1586,12 +1588,12 @@ ) ) (else - (when (logtest? (-> arg1 bot-task-bits) 1) + (when (logtest? (-> arg1 bot-task-bits) (bot-task-bits botbits-0)) (let ((s5-1 *traffic-manager*)) (send-event s5-1 'set-alert-level 1) (send-event s5-1 'set-alert-duration (seconds 36000)) ) - (logand! (-> arg1 bot-task-bits) -2) + (logclear! (-> arg1 bot-task-bits) (bot-task-bits botbits-0)) ) ) ) @@ -1671,10 +1673,10 @@ ) ) ) - (when (and (not (logtest? (-> arg1 waypoint-bits) 2)) + (when (and (not (logtest? (-> arg1 waypoint-bits) (waypoint-bits wabits-1))) (>= (- (current-time) (-> arg1 waypoint-time0)) (seconds 0.75)) ) - (logior! (-> arg1 waypoint-bits) 2) + (logior! (-> arg1 waypoint-bits) (waypoint-bits wabits-1)) (let ((s5-0 *traffic-manager*)) (send-event s5-0 'deactivate-by-type (traffic-type crimson-guard-1)) (send-event s5-0 'deactivate-by-type (traffic-type guard-bike)) @@ -1682,7 +1684,7 @@ (send-event s5-0 'deactivate-by-type (traffic-type traffic-type-20)) ) ) - (when (and (not (logtest? (-> arg1 waypoint-bits) 1)) + (when (and (not (logtest? (-> arg1 waypoint-bits) (waypoint-bits wabits-0))) (>= (- (current-time) (-> arg1 waypoint-time0)) (seconds 1.2)) ) (let* ((v1-55 (-> arg1 actor-group 0 data 2 actor)) @@ -1705,7 +1707,7 @@ ) ) ) - (logior! (-> arg1 waypoint-bits) 1) + (logior! (-> arg1 waypoint-bits) (waypoint-bits wabits-0)) (send-event a0-16 'request 'waypoint 26) ) (send-event s5-1 'request 'waypoint 26) @@ -1770,12 +1772,12 @@ (none) ) :on-update (lambda ((arg0 hal-escort)) - (when (not (logtest? (-> arg0 waypoint-bits) 1)) + (when (not (logtest? (-> arg0 waypoint-bits) (waypoint-bits wabits-0))) (let* ((a1-1 (nav-mesh-from-res-tag (-> arg0 entity) 'nav-mesh-actor 0)) (gp-0 (hal-escort-method-234 arg0 a1-1)) ) (when gp-0 - (logior! (-> arg0 waypoint-bits) 1) + (logior! (-> arg0 waypoint-bits) (waypoint-bits wabits-0)) (let* ((v1-8 (-> arg0 actor-group 0 data 1 actor)) (a0-3 (when v1-8 (let ((s5-1 (-> v1-8 extra process))) @@ -1908,12 +1910,12 @@ (none) ) :on-update (lambda ((arg0 hal-escort)) - (when (not (logtest? (-> arg0 waypoint-bits) 1)) + (when (not (logtest? (-> arg0 waypoint-bits) (waypoint-bits wabits-0))) (let* ((a1-1 (nav-mesh-from-res-tag (-> arg0 entity) 'nav-mesh-actor 1)) (gp-0 (hal-escort-method-234 arg0 a1-1)) ) (when gp-0 - (logior! (-> arg0 waypoint-bits) 1) + (logior! (-> arg0 waypoint-bits) (waypoint-bits wabits-0)) (let* ((v1-8 (-> arg0 actor-group 0 data 1 actor)) (a0-3 (when v1-8 (let ((s5-1 (-> v1-8 extra process))) diff --git a/goal_src/jak2/levels/city/market/ashelin/ash4-course.gc b/goal_src/jak2/levels/city/market/ashelin/ash4-course.gc index 5529c0eb7d..685dc48984 100644 --- a/goal_src/jak2/levels/city/market/ashelin/ash4-course.gc +++ b/goal_src/jak2/levels/city/market/ashelin/ash4-course.gc @@ -95,31 +95,32 @@ (set! (-> (the-as asht-wait-spot v1-7) check-done) (the-as (function asht-wait-spot ashelin symbol) - (lambda ((arg0 object) (arg1 ashelin-tanker)) (let ((v1-0 *traffic-manager*)) - (cond - ((not (logtest? (-> arg1 waypoint-bits) 1)) - (if v1-0 - (logior! (-> arg1 waypoint-bits) 1) - ) - #f - ) - ((not (logtest? (-> arg1 waypoint-bits) 2)) - (logior! (-> arg1 waypoint-bits) 2) - #f - ) - ((not (logtest? (-> arg1 waypoint-bits) 4)) - (logior! (-> arg1 waypoint-bits) 4) - #f - ) - (else - (ai-task-control-method-12 (-> arg1 ai-ctrl) arg1) - (go-to-waypoint! arg1 2 #f) - (ai-task-control-method-10 (-> arg1 ai-ctrl) arg1) - #t - ) - ) - ) + (lambda ((arg0 object) (arg1 ashelin-tanker)) + (let ((v1-0 *traffic-manager*)) + (cond + ((not (logtest? (-> arg1 waypoint-bits) (waypoint-bits wabits-0))) + (if v1-0 + (logior! (-> arg1 waypoint-bits) (waypoint-bits wabits-0)) + ) + #f + ) + ((not (logtest? (-> arg1 waypoint-bits) (waypoint-bits wabits-1))) + (logior! (-> arg1 waypoint-bits) (waypoint-bits wabits-1)) + #f + ) + ((not (logtest? (-> arg1 waypoint-bits) (waypoint-bits wabits-2))) + (logior! (-> arg1 waypoint-bits) (waypoint-bits wabits-2)) + #f + ) + (else + (ai-task-control-method-12 (-> arg1 ai-ctrl) arg1) + (go-to-waypoint! arg1 2 #f) + (ai-task-control-method-10 (-> arg1 ai-ctrl) arg1) + #t ) + ) + ) + ) ) ) ) @@ -163,13 +164,13 @@ (>= (-> v1-2 z) 1703936.0) (>= 2027520.0 (-> v1-2 z)) ) - (logior! (-> arg1 bot-task-bits) 1) + (logior! (-> arg1 bot-task-bits) (bot-task-bits botbits-0)) ) ) ) ) (let ((v1-8 (get-current-task-event (-> arg1 task)))) - (when (and (logtest? (-> arg1 bot-task-bits) 1) (= (-> v1-8 action) (game-task-action say))) + (when (and (logtest? (-> arg1 bot-task-bits) (bot-task-bits botbits-0)) (= (-> v1-8 action) (game-task-action say))) (ai-task-control-method-12 (-> arg1 ai-ctrl) arg1) (go-to-waypoint! arg1 3 #f) (ai-task-control-method-10 (-> arg1 ai-ctrl) arg1) @@ -257,7 +258,7 @@ (set-setting! 'music 'danger9 0.0 0) (set! (-> arg0 notice-enemy-dist) 245760.0) (logior! (-> arg0 bot-flags) (bot-flags bf06)) - (logand! (-> arg0 bot-task-bits) -3) + (logclear! (-> arg0 bot-task-bits) (bot-task-bits botbits-1)) (let ((a1-3 (new 'stack-no-clear 'event-message-block))) (set! (-> a1-3 from) (process->ppointer pp)) (set! (-> a1-3 num-params) 0) @@ -314,7 +315,7 @@ ) :on-update (lambda ((arg0 ashelin-tanker)) (suppress-traffic arg0) - (when (logtest? (-> arg0 bot-task-bits) 2) + (when (logtest? (-> arg0 bot-task-bits) (bot-task-bits botbits-1)) (ai-task-control-method-12 (-> arg0 ai-ctrl) arg0) (go-to-waypoint! arg0 9 #f) ) @@ -375,7 +376,7 @@ ) :on-update (lambda ((arg0 ashelin-tanker)) (suppress-traffic arg0) - (when (logtest? (-> arg0 bot-task-bits) 2) + (when (logtest? (-> arg0 bot-task-bits) (bot-task-bits botbits-1)) (ai-task-control-method-12 (-> arg0 ai-ctrl) arg0) (go-to-waypoint! arg0 9 #f) ) diff --git a/goal_src/jak2/levels/city/oracle/oracle-training.gc b/goal_src/jak2/levels/city/oracle/oracle-training.gc index 9e5ff71544..415fca9c03 100644 --- a/goal_src/jak2/levels/city/oracle/oracle-training.gc +++ b/goal_src/jak2/levels/city/oracle/oracle-training.gc @@ -14,7 +14,7 @@ (lambda :behavior task-manager () (set! (-> self data-float 0) (the-as float (send-event *target* 'test-pickup (pickup-type eco-pill-dark)))) - (send-event *target* 'change-mode 'darkjak #f 65) + (send-event *target* 'change-mode 'darkjak #f (darkjak-stage force-on no-anim)) (set! (-> self sound-id 0) (add-process *gui-control* self (gui-channel message) (gui-action play) (-> self name) 81920.0 0) ) @@ -30,7 +30,7 @@ (lambda :behavior task-manager () (send-event *target* 'get-pickup (pickup-type eco-pill-dark) (-> self data-float 0)) - (send-event *target* 'change-mode 'darkjak #f 128) + (send-event *target* 'change-mode 'darkjak #f (darkjak-stage disable-force-on)) (send-event *target* 'get-notify #f) (set-action! *gui-control* @@ -74,7 +74,7 @@ (lambda :behavior task-manager () (if (and *target* (not (logtest? (focus-status dark) (-> *target* focus-status)))) - (send-event *target* 'change-mode 'darkjak #f 65) + (send-event *target* 'change-mode 'darkjak #f (darkjak-stage force-on no-anim)) ) (when (= (get-status *gui-control* (-> self sound-id 0)) (gui-status active)) (let ((gp-1 @@ -108,7 +108,7 @@ (lambda :behavior task-manager () (set! (-> self data-float 0) (the-as float (send-event *target* 'test-pickup (pickup-type eco-pill-dark)))) - (send-event *target* 'change-mode 'darkjak #f 65) + (send-event *target* 'change-mode 'darkjak #f (darkjak-stage force-on no-anim)) (set! (-> self sound-id 0) (add-process *gui-control* self (gui-channel message) (gui-action play) (-> self name) 81920.0 0) ) @@ -124,7 +124,7 @@ (lambda :behavior task-manager () (send-event *target* 'get-pickup (pickup-type eco-pill-dark) (-> self data-float 0)) - (send-event *target* 'change-mode 'darkjak #f 128) + (send-event *target* 'change-mode 'darkjak #f (darkjak-stage disable-force-on)) (send-event *target* 'get-notify #f) (set-action! *gui-control* @@ -168,7 +168,7 @@ (lambda :behavior task-manager () (if (and *target* (not (logtest? (focus-status dark) (-> *target* focus-status)))) - (send-event *target* 'change-mode 'darkjak #f 65) + (send-event *target* 'change-mode 'darkjak #f (darkjak-stage force-on no-anim)) ) (when (= (get-status *gui-control* (-> self sound-id 0)) (gui-status active)) (let ((gp-1 @@ -202,7 +202,7 @@ (lambda :behavior task-manager () (set! (-> self data-float 0) (the-as float (send-event *target* 'test-pickup (pickup-type eco-pill-dark)))) - (send-event *target* 'change-mode 'darkjak #f 65) + (send-event *target* 'change-mode 'darkjak #f (darkjak-stage force-on no-anim)) (set! (-> self sound-id 0) (add-process *gui-control* self (gui-channel message) (gui-action play) (-> self name) 81920.0 0) ) @@ -219,7 +219,7 @@ (lambda :behavior task-manager () (send-event *target* 'get-pickup (pickup-type eco-pill-dark) (-> self data-float 0)) - (send-event *target* 'change-mode 'darkjak #f 128) + (send-event *target* 'change-mode 'darkjak #f (darkjak-stage disable-force-on)) (send-event *target* 'get-notify #f) (set-action! *gui-control* @@ -243,7 +243,7 @@ (lambda :behavior task-manager () (if (and *target* (not (logtest? (focus-status dark) (-> *target* focus-status)))) - (send-event *target* 'change-mode 'darkjak #f 65) + (send-event *target* 'change-mode 'darkjak #f (darkjak-stage force-on no-anim)) ) (when (= (get-status *gui-control* (-> self sound-id 0)) (gui-status active)) (let ((gp-1 @@ -277,7 +277,7 @@ (lambda :behavior task-manager () (set! (-> self data-float 0) (the-as float (send-event *target* 'test-pickup (pickup-type eco-pill-dark)))) - (send-event *target* 'change-mode 'darkjak #f 65) + (send-event *target* 'change-mode 'darkjak #f (darkjak-stage force-on no-anim)) (set! (-> self sound-id 0) (add-process *gui-control* self (gui-channel message) (gui-action play) (-> self name) 81920.0 0) ) @@ -293,7 +293,7 @@ (lambda :behavior task-manager () (send-event *target* 'get-pickup (pickup-type eco-pill-dark) (-> self data-float 0)) - (send-event *target* 'change-mode 'darkjak #f 128) + (send-event *target* 'change-mode 'darkjak #f (darkjak-stage disable-force-on)) (send-event *target* 'get-notify #f) (set-action! *gui-control* @@ -338,7 +338,7 @@ (lambda :behavior task-manager () (if (and *target* (not (logtest? (focus-status dark) (-> *target* focus-status)))) - (send-event *target* 'change-mode 'darkjak #f 65) + (send-event *target* 'change-mode 'darkjak #f (darkjak-stage force-on no-anim)) ) (when (= (get-status *gui-control* (-> self sound-id 0)) (gui-status active)) (let ((gp-1 diff --git a/goal_src/jak2/levels/city/slums/kor/hal3-course.gc b/goal_src/jak2/levels/city/slums/kor/hal3-course.gc index 82aee30f29..2835429706 100644 --- a/goal_src/jak2/levels/city/slums/kor/hal3-course.gc +++ b/goal_src/jak2/levels/city/slums/kor/hal3-course.gc @@ -71,7 +71,7 @@ (set! (-> v1-0 decay-rate) 0.0) (set! (-> v1-0 flags) (traffic-danger-flags tdf0)) (set! (-> v1-0 danger-type) (traffic-danger-type tdt4)) - (add-danger (-> (the-as traffic-manager *traffic-manager*) traffic-engine) v1-0) + (add-danger (-> *traffic-manager* traffic-engine) v1-0) ) (none) ) @@ -82,15 +82,15 @@ (local-vars (v0-0 object)) (case arg2 (('fail) - (set! v0-0 (logior (-> obj bot-task-bits) 1)) - (set! (-> obj bot-task-bits) (the-as uint v0-0)) + (set! v0-0 (logior (-> obj bot-task-bits) (bot-task-bits botbits-0))) + (set! (-> obj bot-task-bits) (the-as bot-task-bits v0-0)) v0-0 ) (('request) (case (-> arg3 param 0) (('scene-player) - (set! v0-0 (logior (-> obj bot-task-bits) 8)) - (set! (-> obj bot-task-bits) (the-as uint v0-0)) + (set! v0-0 (logior (-> obj bot-task-bits) (bot-task-bits botbits-3))) + (set! (-> obj bot-task-bits) (the-as bot-task-bits v0-0)) v0-0 ) (else @@ -174,8 +174,7 @@ (s3-0 *traffic-manager*) ) (cond - ((not (logtest? (-> arg1 waypoint-bits) 1)) - ;; (set! s3-0 (and s4-0 (and s5-0 s3-0))) + ((not (logtest? (-> arg1 waypoint-bits) (waypoint-bits wabits-0))) (when (and s4-0 (and s5-0 s3-0)) (let* ((v1-15 (-> *game-info* sub-task-list (game-task-node city-help-kid-introduction))) (v1-18 (handle->process (if (-> v1-15 info) @@ -187,7 +186,7 @@ ) (when v1-18 (set! (-> (the-as task-manager v1-18) slave 0) (process->handle arg1)) - (logior! (-> arg1 waypoint-bits) 1) + (logior! (-> arg1 waypoint-bits) (waypoint-bits wabits-0)) (set! (-> arg1 slave-handle 0) (process->handle s4-0)) (set! (-> arg1 slave-handle 1) (process->handle s5-0)) ) @@ -195,21 +194,21 @@ ) #f ) - ((not (logtest? (-> arg1 waypoint-bits) 2)) - (logior! (-> arg1 waypoint-bits) 2) + ((not (logtest? (-> arg1 waypoint-bits) (waypoint-bits wabits-1))) + (logior! (-> arg1 waypoint-bits) (waypoint-bits wabits-1)) (hal-method-226 arg1) (send-event s4-0 'request 'waypoint 2) (send-event s5-0 'request 'waypoint 2) #f ) - ((not (logtest? (-> arg1 waypoint-bits) 4)) - (logior! (-> arg1 waypoint-bits) 4) - (send-event s3-0 'deactivate-by-type 6) - (send-event s3-0 'deactivate-by-type 18) - (send-event s3-0 'deactivate-by-type 19) - (send-event s3-0 'deactivate-by-type 20) + ((not (logtest? (-> arg1 waypoint-bits) (waypoint-bits wabits-2))) + (logior! (-> arg1 waypoint-bits) (waypoint-bits wabits-2)) + (send-event s3-0 'deactivate-by-type (traffic-type crimson-guard-1)) + (send-event s3-0 'deactivate-by-type (traffic-type guard-bike)) + (send-event s3-0 'deactivate-by-type (traffic-type hellcat)) + (send-event s3-0 'deactivate-by-type (traffic-type traffic-type-20)) (send-event s3-0 'set-guard-target-level 0) - (send-event s3-0 'set-object-reserve-count 6 14) + (send-event s3-0 'set-object-reserve-count (traffic-type crimson-guard-1) 14) #f ) (else @@ -353,7 +352,7 @@ (send-event s5-0 'set-guard-force-visible #t) (send-event s5-0 'set-max-alert-level 1) (send-event s5-0 'set-alert-level 1) - (send-event s5-0 'set-alert-duration #xa4cb80) + (send-event s5-0 'set-alert-duration (seconds 36000)) (send-event s5-0 'set-guard-target-level 0) ) (dotimes (s5-1 3) @@ -389,19 +388,21 @@ (function halt-wait-spot hal symbol) (lambda ((arg0 object) (arg1 hal-help-kid)) (cond - ((and (logtest? (-> arg1 bot-task-bits) 1) (not (logtest? (-> arg1 bot-flags) (bot-flags bf09)))) + ((and (logtest? (-> arg1 bot-task-bits) (bot-task-bits botbits-0)) + (not (logtest? (-> arg1 bot-flags) (bot-flags bf09))) + ) (ai-task-control-method-12 (-> arg1 ai-ctrl) arg1) (go-to-waypoint! arg1 7 #f) (ai-task-control-method-10 (-> arg1 ai-ctrl) arg1) #t ) - ((zero? (send-event *traffic-manager* 'get-object-remaining-count 6)) + ((zero? (send-event *traffic-manager* 'get-object-remaining-count (traffic-type crimson-guard-1))) (let ((v1-16 *target*)) (when v1-16 (cond ((focus-test? v1-16 dark) - (if (and (not (logtest? (-> arg1 bot-task-bits) 4)) (send-event *target* 'end-mode)) - (logior! (-> arg1 bot-task-bits) 4) + (if (and (not (logtest? (-> arg1 bot-task-bits) (bot-task-bits botbits-2))) (send-event *target* 'end-mode)) + (logior! (-> arg1 bot-task-bits) (bot-task-bits botbits-2)) ) #f ) @@ -441,15 +442,17 @@ (set! (-> a1-1 message) 'get-object-remaining-count) (set! (-> a1-1 param 0) (the-as uint 6)) (let ((v1-6 (send-event-function *traffic-manager* a1-1))) - (if (and (not (logtest? (-> arg0 bot-task-bits) 2)) - (and (>= 12 (the-as int v1-6)) (send-event *target* 'change-mode 'darkjak #f 2)) + (if (and (not (logtest? (-> arg0 bot-task-bits) (bot-task-bits botbits-1))) + (and (>= 12 (the-as int v1-6)) (send-event *target* 'change-mode 'darkjak #f (darkjak-stage active))) ) - (logior! (-> arg0 bot-task-bits) 2) + (logior! (-> arg0 bot-task-bits) (bot-task-bits botbits-1)) ) ) ) - (when (and (not (logtest? (-> arg0 waypoint-bits) 2)) (>= (- (current-time) (-> arg0 waypoint-time0)) (seconds 3))) - (logior! (-> arg0 waypoint-bits) 2) + (when (and (not (logtest? (-> arg0 waypoint-bits) (waypoint-bits wabits-1))) + (>= (- (current-time) (-> arg0 waypoint-time0)) (seconds 3)) + ) + (logior! (-> arg0 waypoint-bits) (waypoint-bits wabits-1)) (let ((s5-0 (new 'stack-no-clear 'transport-params))) (set-vector! (-> s5-0 spawn-pos) 2689966.0 65208.32 -481075.2 1.0) (quaternion-copy! (-> s5-0 quat) *unity-quaternion*) @@ -463,10 +466,10 @@ ) ) (hal-help-kid-method-227 arg0) - (when (and (not (logtest? (-> arg0 waypoint-bits) 1)) + (when (and (not (logtest? (-> arg0 waypoint-bits) (waypoint-bits wabits-0))) (>= (- (current-time) (-> arg0 waypoint-time0)) (seconds 0.2)) ) - (logior! (-> arg0 waypoint-bits) 1) + (logior! (-> arg0 waypoint-bits) (waypoint-bits wabits-0)) (let ((a1-7 (new 'stack-no-clear 'event-message-block))) (set! (-> a1-7 from) (process->ppointer pp)) (set! (-> a1-7 num-params) 2) @@ -506,7 +509,7 @@ (logclear! (-> v1-7 focus-status) (focus-status arrestable)) ) (let ((a0-8 *traffic-manager*)) - (send-event a0-8 'deactivate-by-type 6) + (send-event a0-8 'deactivate-by-type (traffic-type crimson-guard-1)) ) (set-action! *gui-control* @@ -530,7 +533,7 @@ ) :on-update (lambda ((arg0 hal-help-kid)) (with-pp - (when (not (logtest? (-> arg0 waypoint-bits) 1)) + (when (not (logtest? (-> arg0 waypoint-bits) (waypoint-bits wabits-0))) (let* ((s4-0 (new 'stack 'traffic-object-spawn-params)) (v1-6 (-> arg0 actor-group 0 data 1 actor)) (s5-0 (if v1-6 @@ -550,8 +553,8 @@ (set! (-> s4-0 guard-type) (the-as uint 7)) (vector-reset! (-> s4-0 velocity)) (set! (-> s4-0 position quad) (-> (the-as process-drawable s5-0) root trans quad)) - (set! (-> s4-0 position x) (+ 13312.0 (-> s4-0 position x))) - (set! (-> s4-0 position z) (+ 17408.0 (-> s4-0 position z))) + (+! (-> s4-0 position x) 13312.0) + (+! (-> s4-0 position z) 17408.0) (let ((a1-1 (new 'stack-no-clear 'vector))) (vector-! a1-1 (-> (the-as process-drawable s5-0) root trans) (-> s4-0 position)) (forward-up->quaternion (-> s4-0 rotation) a1-1 *up-vector*) @@ -559,7 +562,7 @@ (send-event *traffic-manager* 'activate-object s4-0) (let ((s4-1 (-> s4-0 proc))) (when s4-1 - (logior! (-> arg0 waypoint-bits) 1) + (logior! (-> arg0 waypoint-bits) (waypoint-bits wabits-0)) (send-event s5-0 'instant-arrest s4-1) (let ((a1-4 (new 'stack-no-clear 'event-message-block))) (set! (-> a1-4 from) (process->ppointer pp)) @@ -624,7 +627,7 @@ (the-as (function halt-wait-spot hal symbol) (lambda ((arg0 object) (arg1 hal-help-kid)) - (if (and *target* (not (logtest? (-> arg1 bot-task-bits) 8))) + (if (and *target* (not (logtest? (-> arg1 bot-task-bits) (bot-task-bits botbits-3)))) (set! (-> arg1 waypoint-time0) (current-time)) ) (let ((v1-7 (get-current-task-event (-> arg1 task)))) diff --git a/goal_src/jak2/levels/common/ai/bot-h.gc b/goal_src/jak2/levels/common/ai/bot-h.gc index d82aa0b234..3f7dc22b21 100644 --- a/goal_src/jak2/levels/common/ai/bot-h.gc +++ b/goal_src/jak2/levels/common/ai/bot-h.gc @@ -66,6 +66,32 @@ ) ;; ---bot-h:bot-flags +(defenum bot-task-bits + :type uint32 + :bitfield #t + (botbits-0) + (botbits-1) + (botbits-2) + (botbits-3) + (botbits-4) + (botbits-5) + (botbits-6) + (botbits-7) + ) + +(defenum waypoint-bits + :bitfield #t + :type uint32 + (wabits-0) + (wabits-1) + (wabits-2) + (wabits-3) + (wabits-4) + (wabits-5) + (wabits-6) + (wabits-7) + ) + (declare-type bot nav-enemy) (declare-type bot-speech-list basic) (declare-type bot-speech-list-shuffle bot-speech-list) @@ -201,9 +227,9 @@ (ai-ctrl ai-task-control :offset-assert 648) (course bot-course :offset-assert 652) (waypoint bot-waypoint :offset-assert 656) - (waypoint-bits uint32 :offset-assert 660) + (waypoint-bits waypoint-bits :offset-assert 660) (waypoint-int32a int32 :offset-assert 664) - (bot-task-bits uint32 :offset-assert 668) + (bot-task-bits bot-task-bits :offset-assert 668) (hit-invuln-ignore-me-delay uint32 :offset-assert 672) (hit-invuln-focus-disable-delay uint32 :offset-assert 676) (warn-to-fail-timeout uint32 :offset-assert 680) diff --git a/goal_src/jak2/levels/common/ai/bot.gc b/goal_src/jak2/levels/common/ai/bot.gc index 038472687e..031ca1255e 100644 --- a/goal_src/jak2/levels/common/ai/bot.gc +++ b/goal_src/jak2/levels/common/ai/bot.gc @@ -1370,7 +1370,7 @@ If the player is too far, play a warning speech." (let ((waypoint (-> course waypoints i))) (when (= (-> waypoint waypoint-id) id) (set! (-> obj waypoint) waypoint) - (set! (-> obj waypoint-bits) (the-as uint 0)) + (set! (-> obj waypoint-bits) (waypoint-bits)) (set! (-> obj waypoint-time0) (current-time)) (set! (-> obj too-far-warn-dist) (-> obj too-far-warn-dist-default)) (set! (-> obj too-far-fail-dist-delta) (-> obj too-far-fail-dist-delta-default)) diff --git a/goal_src/jak2/levels/common/enemy/amphibian/amphibian.gc b/goal_src/jak2/levels/common/enemy/amphibian/amphibian.gc index d89eef6e1d..d472495938 100644 --- a/goal_src/jak2/levels/common/enemy/amphibian/amphibian.gc +++ b/goal_src/jak2/levels/common/enemy/amphibian/amphibian.gc @@ -5,6 +5,19 @@ ;; name in dgo: amphibian ;; dgos: ATE, SEB, SWB, RUI +(defenum amphibian-flags + :bitfield #t + :type uint8 + (amflags-0) + (amflags-1) + (amflags-2) + (amflags-3) + (amflags-4) + (amflags-5) + (amflags-6) + (amflags-7) + ) + ;; DECOMP BEGINS (deftype amphibian-tongue-attack-info (structure) @@ -77,7 +90,7 @@ (deftype amphibian (nav-enemy) ((tongue-scale float :offset-assert 604) - (flags uint8 :offset-assert 608) + (flags amphibian-flags :offset-assert 608) (knocked-anim-index int8 :offset-assert 609) (jump-anim-index int8 :offset-assert 610) (tongue-mode uint64 :offset-assert 616) @@ -902,7 +915,7 @@ ((>= f26-0 13.0) (set! s4-0 #t) ) - ((and (>= 1.0 f26-0) (logtest? (-> obj flags) 1)) + ((and (>= 1.0 f26-0) (logtest? (-> obj flags) (amphibian-flags amflags-0))) (set! s5-0 #t) ) ) @@ -916,8 +929,8 @@ ) ) (if s4-0 - (logior! (-> obj flags) 1) - (logand! (-> obj flags) -2) + (logior! (-> obj flags) (amphibian-flags amflags-0)) + (logclear! (-> obj flags) (amphibian-flags amflags-0)) ) ) (cond @@ -940,7 +953,7 @@ ) (set! (-> s5-3 frame-num) (ja-aframe f26-0 0)) ) - (logand! (-> obj flags) -2) + (logclear! (-> obj flags) (amphibian-flags amflags-0)) ) ) (else @@ -962,7 +975,7 @@ ) (set! (-> s5-4 frame-num) (ja-aframe f26-0 0)) ) - (logand! (-> obj flags) -2) + (logclear! (-> obj flags) (amphibian-flags amflags-0)) ) ) (else @@ -976,7 +989,7 @@ ) (set! (-> s5-5 frame-num) (ja-aframe f26-0 0)) ) - (logand! (-> obj flags) -2) + (logclear! (-> obj flags) (amphibian-flags amflags-0)) ) ) ) @@ -1001,7 +1014,7 @@ ) (set! (-> s5-6 frame-num) (ja-aframe f26-0 0)) ) - (logand! (-> obj flags) -2) + (logclear! (-> obj flags) (amphibian-flags amflags-0)) ) ) ) diff --git a/goal_src/jak2/levels/common/enemy/grenadier.gc b/goal_src/jak2/levels/common/enemy/grenadier.gc index 582eec0c1b..c0ee8a5937 100644 --- a/goal_src/jak2/levels/common/enemy/grenadier.gc +++ b/goal_src/jak2/levels/common/enemy/grenadier.gc @@ -5,6 +5,18 @@ ;; name in dgo: grenadier ;; dgos: DG1, D3A, UNB, RUI +(defenum grenadier-flags + :bitfield #t + (grflags-0) + (grflags-1) + (grflags-2) + (grflags-3) + (grflags-4) + (grflags-5) + (grflags-6) + (grflags-7) + ) + ;; DECOMP BEGINS (defpartgroup group-grenadier-drip @@ -67,7 +79,7 @@ (heading symbol :offset-assert 724) (move-pos vector :inline :offset-assert 736) (move-angle float :offset-assert 752) - (status-flags uint64 :offset-assert 760) + (status-flags grenadier-flags :offset-assert 760) (suppress-knockaside-timer time-frame :offset-assert 768) ) :heap-base #x290 @@ -292,7 +304,7 @@ ) (return #t) ) - (logior! (-> obj status-flags) 1) + (logior! (-> obj status-flags) (grenadier-flags grflags-0)) (set! (-> obj suppress-knockaside-timer) (current-time)) ) ((method-of-type nav-enemy general-event-handler) obj arg0 arg1 arg2 arg3) @@ -513,7 +525,7 @@ ) (grenadier-method-181 self) (look-at-target! self (enemy-flag death-start)) - (logand! (-> self status-flags) -2) + (logclear! (-> self status-flags) (grenadier-flags grflags-0)) (none) ) :trans (behavior () @@ -881,7 +893,7 @@ (logior! (-> self nav flags) (nav-control-flag update-heading-from-facing)) (logclear! (-> self nav flags) (nav-control-flag update-heading-from-facing)) ) - (logand! (-> self status-flags) -3) + (logclear! (-> self status-flags) (grenadier-flags grflags-1)) (if (logtest? (-> self enemy-flags) (enemy-flag check-water)) (logior! (-> self focus-status) (focus-status dangerous)) (logclear! (-> self focus-status) (focus-status dangerous)) @@ -908,7 +920,7 @@ ) 0 (logclear! (-> self nav flags) (nav-control-flag update-heading-from-facing)) - (logior! (-> self status-flags) 2) + (logior! (-> self status-flags) (grenadier-flags grflags-1)) (ja-no-eval :group! grenadier-run-to-throw-ja :num! (seek! (the float (+ (-> (the-as art-joint-anim grenadier-run-to-throw-ja) frames num-frames) -1)) f30-0) :frame-num 0.0 @@ -918,7 +930,7 @@ (ja :num! (seek! max f30-0)) ) (ja-channel-push! 1 (seconds 0.067)) - (logand! (-> self status-flags) -3) + (logclear! (-> self status-flags) (grenadier-flags grflags-1)) (if (logtest? (enemy-flag enemy-flag43) (-> self enemy-flags)) (logior! (-> self nav flags) (nav-control-flag update-heading-from-facing)) (logclear! (-> self nav flags) (nav-control-flag update-heading-from-facing)) @@ -931,7 +943,7 @@ ) 0 (cond - ((logtest? (-> self status-flags) 1) + ((logtest? (-> self status-flags) (grenadier-flags grflags-0)) (ja-channel-push! 1 (seconds 0.135)) (ja-no-eval :group! grenadier-throw-quick-ja :num! (seek! (the float (+ (-> (the-as art-joint-anim grenadier-throw-quick-ja) frames num-frames) -1)) f30-0) @@ -941,7 +953,7 @@ (suspend) (ja :num! (seek! max f30-0)) ) - (logand! (-> self status-flags) -2) + (logclear! (-> self status-flags) (grenadier-flags grflags-0)) ) (else (when (not (enemy-method-96 self 1820.4445 #t)) @@ -1114,7 +1126,7 @@ (defmethod go-hostile grenadier ((obj grenadier)) (if (and (and (-> obj next-state) (= (-> obj next-state name) 'knocked)) - (and (logtest? (-> obj status-flags) 1) + (and (logtest? (-> obj status-flags) (grenadier-flags grflags-0)) (handle->process (-> obj focus handle)) (not (logtest? (-> (the-as process-focusable (handle->process (-> obj focus handle))) focus-status) (focus-status disable dead ignore grabbed) @@ -1163,7 +1175,7 @@ (defmethod nav-enemy-method-142 grenadier ((obj grenadier) (arg0 nav-control)) (local-vars (a0-4 int) (a0-6 int)) - (b! (logtest? (-> obj status-flags) 2) cfg-6 :delay (empty-form)) + (b! (logtest? (-> obj status-flags) (grenadier-flags grflags-1)) cfg-6 :delay (empty-form)) (let ((v1-3 (new 'stack-no-clear 'vector)) (a2-0 (new 'stack-no-clear 'vector)) ) @@ -1354,7 +1366,7 @@ ) ) (set! (-> obj move-angle) 5461.3335) - (set! (-> obj status-flags) (the-as uint 0)) + (set! (-> obj status-flags) (grenadier-flags)) (set! (-> obj suppress-knockaside-timer) 0) (set-vector! (-> obj root scale) 1.5 1.5 1.5 1.0) (set! (-> obj joint) (new 'process 'joint-mod-blend-world obj 17 #f 0.0)) diff --git a/goal_src/jak2/levels/common/enemy/hover/hover-nav-control-h.gc b/goal_src/jak2/levels/common/enemy/hover/hover-nav-control-h.gc index 45258601b2..799a59c563 100644 --- a/goal_src/jak2/levels/common/enemy/hover/hover-nav-control-h.gc +++ b/goal_src/jak2/levels/common/enemy/hover/hover-nav-control-h.gc @@ -17,6 +17,19 @@ (declare-type nav-network basic) (define-extern *nav-network* nav-network) +(defenum hover-nav-flags + :bitfield #t + :type uint16 + (honflags-0) + (honflags-1) + (honflags-2) + (honflags-3) + (honflags-4) + (honflags-5) + (honflags-6) + (honflags-7) + ) + ;; DECOMP BEGINS (deftype nav-network-adjacency (structure) @@ -210,7 +223,7 @@ (deftype hover-nav-control (basic) ((root collide-shape-moving :offset-assert 4) (nav nav-network :offset-assert 8) - (flags uint16 :offset-assert 12) + (flags hover-nav-flags :offset-assert 12) (params hover-nav-params :offset-assert 16) (path-timer time-frame :offset-assert 24) (transvv vector :inline :offset-assert 32) diff --git a/goal_src/jak2/levels/common/enemy/hover/hover-nav-control.gc b/goal_src/jak2/levels/common/enemy/hover/hover-nav-control.gc index c27d4acdaa..89ff7f9327 100644 --- a/goal_src/jak2/levels/common/enemy/hover/hover-nav-control.gc +++ b/goal_src/jak2/levels/common/enemy/hover/hover-nav-control.gc @@ -1191,7 +1191,7 @@ ) (hover-nav-control-method-29 obj (the-as vector #f)) (set! (-> obj path-info curr-segment) (-> obj path-info segment-list)) - (logior! (-> obj flags) 1) + (logior! (-> obj flags) (hover-nav-flags honflags-0)) 0 (none) ) @@ -1209,14 +1209,14 @@ ) (hover-nav-control-method-29 obj (the-as vector #f)) (set! (-> obj path-info curr-segment) (-> obj path-info segment-list)) - (logior! (-> obj flags) 1) + (logior! (-> obj flags) (hover-nav-flags honflags-0)) 0 (none) ) (defmethod hover-nav-control-method-20 hover-nav-control ((obj hover-nav-control)) (hover-nav-control-method-21 obj) - (logand! (-> obj flags) -2) + (logclear! (-> obj flags) (hover-nav-flags honflags-0)) 0 (none) ) @@ -1265,7 +1265,7 @@ ) (defmethod hover-nav-control-method-24 hover-nav-control ((obj hover-nav-control)) - (when (not (logtest? (-> obj flags) 1)) + (when (not (logtest? (-> obj flags) (hover-nav-flags honflags-0))) (let ((s5-0 (new 'stack-no-clear 'collide-query))) (-> obj params) (let ((v1-5 (hover-nav-control-method-17 obj)) @@ -1291,11 +1291,11 @@ (cond ((>= f0-4 0.0) (set! (-> obj los-obstruction-distance) (* f0-4 (vector-length s4-0))) - (logior! (-> obj flags) 2) + (logior! (-> obj flags) (hover-nav-flags honflags-1)) ) (else (set! (-> obj los-last-clear-time) (current-time)) - (logand! (-> obj flags) -3) + (logclear! (-> obj flags) (hover-nav-flags honflags-1)) ) ) ) @@ -1324,7 +1324,7 @@ ) ) ) - (when (not (logtest? (-> obj flags) 1)) + (when (not (logtest? (-> obj flags) (hover-nav-flags honflags-0))) (cond ((and arg0 (and (< (vector-vector-distance arg0 (-> obj root trans)) 40960.0) (>= (-> obj los-last-clear-time) (+ (current-time) (seconds -0.2))) @@ -1414,7 +1414,7 @@ (add-debug-sphere #t (bucket-id debug-no-zbuf1) s4-1 (meters 0.8) *color-magenta*) ) (let ((f0-19 (+ 2048.0 (vector-length (-> obj root transv))))) - (if (logtest? (-> obj flags) 2) + (if (logtest? (-> obj flags) (hover-nav-flags honflags-1)) (set! f0-19 (fmin f0-19 (fmax 8192.0 (-> obj los-obstruction-distance)))) ) (hover-nav-path-segment-method-9 s2-1 f0-19) @@ -1475,7 +1475,7 @@ (-> pp clock seconds-per-frame) ) (let ((f0-12 (vector-length (the-as vector (&-> s5-0 next)))) - (f1-6 (if (logtest? (-> obj flags) 2) + (f1-6 (if (logtest? (-> obj flags) (hover-nav-flags honflags-1)) (fmax 8192.0 (* 0.8 (-> obj los-obstruction-distance))) f30-0 ) @@ -1589,7 +1589,7 @@ (v1-2 (vector-! (new 'stack-no-clear 'vector) (the-as vector s3-0) (-> s5-0 trans))) (s4-1 (vector-! (new 'stack-no-clear 'vector) (-> obj dest-pos) v1-2)) ) - (when (not (logtest? (-> obj flags) 1)) + (when (not (logtest? (-> obj flags) (hover-nav-flags honflags-0))) (let* ((s2-0 (-> obj root transv)) (f30-0 (vector-length s2-0)) (s1-0 lerp-scale) @@ -1701,7 +1701,7 @@ (set! (-> s5-0 path-info tail-segment) #f) (set! (-> s5-0 path-info curr-segment) #f) (set! (-> s5-0 path-info curr-u) 0.0) - (set! (-> s5-0 flags) (the-as uint 0)) + (set! (-> s5-0 flags) (hover-nav-flags)) (set! (-> s5-0 params) arg2) (set! *hover-nav-time-offset* (+ *hover-nav-time-offset* 1)) (vector-reset! (-> s5-0 dest-pos)) diff --git a/goal_src/jak2/levels/common/enemy/spyder.gc b/goal_src/jak2/levels/common/enemy/spyder.gc index 01918e19e7..8bf3739ad2 100644 --- a/goal_src/jak2/levels/common/enemy/spyder.gc +++ b/goal_src/jak2/levels/common/enemy/spyder.gc @@ -5,6 +5,18 @@ ;; name in dgo: spyder ;; dgos: FOR, ATE +(defenum spyder-flags + :bitfield #t + (spflags-0) + (spflags-1) + (spflags-2) + (spflags-3) + (spflags-4) + (spflags-5) + (spflags-6) + (spflags-7) + ) + ;; DECOMP BEGINS (deftype spyder-shot (metalhead-shot) @@ -52,7 +64,7 @@ (start-pos vector :inline :offset-assert 768) (face-pos vector :inline :offset 800) (my-up-vector vector :inline :offset-assert 816) - (status-flags uint64 :offset-assert 832) + (status-flags spyder-flags :offset-assert 832) (change-dir-timer time-frame :offset-assert 840) (fire-info vector 2 :inline :offset-assert 848) (joint-ik joint-mod-ik 4 :offset 880) @@ -289,7 +301,7 @@ ) (('attack) (if (type? (-> arg0 parent 0) enemy) - (logior! (-> obj status-flags) 2) + (logior! (-> obj status-flags) (spyder-flags spflags-1)) ) ((method-of-type nav-enemy general-event-handler) obj arg0 arg1 arg2 arg3) ) @@ -390,8 +402,8 @@ (cond ((>= 143360.0 f0-0) (let ((s3-0 (new 'stack-no-clear 'vector))) - (logxor! (-> obj status-flags) 16) - (if (logtest? (-> obj status-flags) 16) + (logxor! (-> obj status-flags) (spyder-flags spflags-4)) + (if (logtest? (-> obj status-flags) (spyder-flags spflags-4)) (set-vector! s3-0 (-> s2-1 z) (-> s2-1 y) (- (-> s2-1 x)) 1.0) (set-vector! s3-0 (- (-> s2-1 z)) (-> s2-1 y) (-> s2-1 x) 1.0) ) @@ -558,14 +570,14 @@ (defbehavior spyder-travel-post spyder () (set! (-> self face-pos quad) (-> self move-dest quad)) - (logior! (-> self status-flags) 8) + (logior! (-> self status-flags) (spyder-flags spflags-3)) (nav-enemy-travel-post) 0 (none) ) (defbehavior spyder-face-player-post spyder () - (logior! (-> self status-flags) 8) + (logior! (-> self status-flags) (spyder-flags spflags-3)) (let ((gp-0 (handle->process (-> self focus handle))) (f30-0 (-> self nav max-rotation-rate)) ) @@ -591,10 +603,10 @@ (defmethod spyder-method-182 spyder ((obj spyder)) (with-pp (cond - ((and (logtest? (-> obj status-flags) 4) (!= (-> obj joint scale z) 1.0)) + ((and (logtest? (-> obj status-flags) (spyder-flags spflags-2)) (!= (-> obj joint scale z) 1.0)) (seek! (-> obj joint scale z) 1.0 (* 0.8 (-> pp clock seconds-per-frame))) ) - ((and (not (logtest? (-> obj status-flags) 4)) (!= (-> obj joint scale z) 0.0)) + ((and (not (logtest? (-> obj status-flags) (spyder-flags spflags-2))) (!= (-> obj joint scale z) 0.0)) (seek! (-> obj joint scale z) 0.0 (* 0.8 (-> pp clock seconds-per-frame))) ) ) @@ -609,9 +621,9 @@ (s3-0 (vector-z-quaternion! (new 'stack-no-clear 'vector) (-> obj root quat))) ) (cond - ((logtest? (-> obj status-flags) 8) + ((logtest? (-> obj status-flags) (spyder-flags spflags-3)) (vector-! s4-1 (-> obj face-pos) (-> obj root trans)) - (logand! (-> obj status-flags) -9) + (logclear! (-> obj status-flags) (spyder-flags spflags-3)) ) (else (set! (-> s4-1 quad) (-> s3-0 quad)) @@ -639,7 +651,7 @@ (defmethod spyder-method-184 spyder ((obj spyder) (arg0 vector)) (with-pp - (when (not (logtest? (-> obj status-flags) 1)) + (when (not (logtest? (-> obj status-flags) (spyder-flags spflags-0))) (let ((s4-0 (new 'stack-no-clear 'vector))) (set! (-> s4-0 quad) (-> *up-vector* quad)) (let ((s3-0 (new 'stack-no-clear 'quaternion))) @@ -652,7 +664,7 @@ (forward-up-nopitch->quaternion (-> obj root quat) arg0 s3-1) ) ) - (logior! (-> obj status-flags) 1) + (logior! (-> obj status-flags) (spyder-flags spflags-0)) ) 0 (none) @@ -672,8 +684,8 @@ (let ((t9-6 (method-of-type nav-enemy track-target!))) (t9-6 obj) ) - (logand! (-> obj status-flags) -2) - (if (logtest? (-> obj status-flags) 32) + (logclear! (-> obj status-flags) (spyder-flags spflags-0)) + (if (logtest? (-> obj status-flags) (spyder-flags spflags-5)) (los-control-method-9 (-> obj los) (the-as process-focusable #f) (the-as vector #f) 2048.0) ) (if (-> obj predator-effect?) @@ -862,7 +874,7 @@ ) (spyder-method-181 self) (look-at-target! self (enemy-flag death-start)) - (logand! (-> self status-flags) -3) + (logclear! (-> self status-flags) (spyder-flags spflags-1)) (when (!= (-> self dest-fade) 128.0) (set! (-> self shock-effect-end) (+ (current-time) (seconds 1))) (set! (-> self dest-fade) 128.0) @@ -876,7 +888,7 @@ (t9-0) ) ) - (logand! (-> self status-flags) -33) + (logclear! (-> self status-flags) (spyder-flags spflags-5)) (look-at-target! self (enemy-flag lock-focus)) (none) ) @@ -902,7 +914,7 @@ (spyder-method-181 self) ) ((>= 24576.0 f0-0) - (logior! (-> self status-flags) 32) + (logior! (-> self status-flags) (spyder-flags spflags-5)) ) ) ) @@ -1148,9 +1160,11 @@ ;; WARN: Return type mismatch object vs none. (defmethod go-hostile spyder ((obj spyder)) - (if (and (not (logtest? (-> obj status-flags) 2)) (-> obj next-state) (let ((v1-5 (-> obj next-state name))) - (or (= v1-5 'notice) (= v1-5 'knocked)) - ) + (if (and (not (logtest? (-> obj status-flags) (spyder-flags spflags-1))) + (-> obj next-state) + (let ((v1-5 (-> obj next-state name))) + (or (= v1-5 'notice) (= v1-5 'knocked)) + ) ) (go (method-of-object obj attack)) ) @@ -1166,7 +1180,7 @@ (t9-0) ) ) - (logand! (-> self status-flags) -5) + (logclear! (-> self status-flags) (spyder-flags spflags-2)) (dotimes (gp-0 4) (enable-set! (-> self joint-ik gp-0) #f) ) @@ -1179,7 +1193,7 @@ ) ) (when (nonzero? (-> self hit-points)) - (logior! (-> self status-flags) 4) + (logior! (-> self status-flags) (spyder-flags spflags-2)) (dotimes (gp-0 4) (enable-set! (-> self joint-ik gp-0) #t) ) @@ -1365,9 +1379,9 @@ (set-gravity-length (-> obj root dynam) 573440.0) (set-vector! (-> obj root scale) 1.5 1.5 1.5 1.0) (set! (-> obj my-up-vector quad) (-> *up-vector* quad)) - (set! (-> obj status-flags) (the-as uint 4)) + (set! (-> obj status-flags) (spyder-flags spflags-2)) (if (rand-vu-percent? 0.5) - (logior! (-> obj status-flags) 16) + (logior! (-> obj status-flags) (spyder-flags spflags-4)) ) (set! (-> obj start-pos quad) (-> obj root trans quad)) (set! (-> obj sound) diff --git a/goal_src/jak2/levels/common/entities/gun-buoy.gc b/goal_src/jak2/levels/common/entities/gun-buoy.gc index d6c680c472..12c7d13a80 100644 --- a/goal_src/jak2/levels/common/entities/gun-buoy.gc +++ b/goal_src/jak2/levels/common/entities/gun-buoy.gc @@ -5,6 +5,19 @@ ;; name in dgo: gun-buoy ;; dgos: ATO, NESTT, NES, LPROTECT +(defenum gun-buoy-flags + :bitfield #t + :type uint16 + (gubflags-0) + (gubflags-1) + (gubflags-2) + (gubflags-3) + (gubflags-4) + (gubflags-5) + (gubflags-6) + (gubflags-7) + ) + ;; DECOMP BEGINS (defskelgroup skel-gun-buoy gun-buoy gun-buoy-lod0-jg gun-buoy-idle-ja @@ -274,24 +287,24 @@ (set! (-> *gun-buoy-nav-enemy-info* fact-defaults) *fact-info-enemy-defaults*) (deftype gun-buoy (nav-enemy) - ((gun-elev-jmod joint-mod :offset-assert 604) - (start-pos vector :inline :offset-assert 608) - (aim-dir vector :inline :offset-assert 624) - (banking-quat quaternion :inline :offset 656) - (offset-from-player vector :inline :offset-assert 672) - (offset-y-angular float :offset-assert 688) - (elev-angle float :offset-assert 692) - (y-final float :offset-assert 696) - (y-offset float :offset-assert 700) - (y-bob float :offset-assert 704) - (y-speed float :offset-assert 708) - (warning-interval time-frame :offset-assert 712) - (warning-timer time-frame :offset-assert 720) - (splash-timer time-frame :offset-assert 728) - (stare-down-timer time-frame :offset-assert 736) - (warning-id sound-id :offset-assert 744) - (voice-id sound-id :offset-assert 748) - (flags uint16 :offset-assert 752) + ((gun-elev-jmod joint-mod :offset-assert 604) + (start-pos vector :inline :offset-assert 608) + (aim-dir vector :inline :offset-assert 624) + (banking-quat quaternion :inline :offset 656) + (offset-from-player vector :inline :offset-assert 672) + (offset-y-angular float :offset-assert 688) + (elev-angle float :offset-assert 692) + (y-final float :offset-assert 696) + (y-offset float :offset-assert 700) + (y-bob float :offset-assert 704) + (y-speed float :offset-assert 708) + (warning-interval time-frame :offset-assert 712) + (warning-timer time-frame :offset-assert 720) + (splash-timer time-frame :offset-assert 728) + (stare-down-timer time-frame :offset-assert 736) + (warning-id sound-id :offset-assert 744) + (voice-id sound-id :offset-assert 748) + (flags gun-buoy-flags :offset-assert 752) ) :heap-base #x280 :method-count-assert 184 @@ -329,7 +342,7 @@ (set! (-> s4-0 y) (fmax (-> s4-0 y) (-> (the-as process-focusable gp-0) water height))) (vector+! s5-0 s4-0 v1-8) (cond - ((logtest? (-> self flags) 1) + ((logtest? (-> self flags) (gun-buoy-flags gubflags-0)) (cloest-point-on-mesh (-> self nav) s5-0 s5-0 (the-as nav-poly #f)) (let ((v1-14 (-> self root trans))) (vector-length (vector-! (new 'stack-no-clear 'vector) v1-14 s5-0)) @@ -392,15 +405,15 @@ :event (behavior ((proc process) (arg1 int) (event-type symbol) (event event-message-block)) (case event-type (('kill-player) - (logior! (-> self flags) 4) + (logior! (-> self flags) (gun-buoy-flags gubflags-2)) (go-virtual ambush) ) ) ) :enter (behavior () (set! (-> self root trans quad) (-> self start-pos quad)) - (logand! (-> self flags) -3) - (logand! (-> self flags) -5) + (logclear! (-> self flags) (gun-buoy-flags gubflags-1)) + (logclear! (-> self flags) (gun-buoy-flags gubflags-2)) (none) ) :trans (behavior () @@ -409,7 +422,7 @@ (-> *setting-control* user-current gun-buoy) ) (if (logtest? (-> self fact enemy-options) (enemy-option user0)) - (logior! (-> self flags) 4) + (logior! (-> self flags) (gun-buoy-flags gubflags-2)) ) (go-ambush self) ) @@ -434,7 +447,7 @@ ) 0 (nav-enemy-method-166 self) - (logior! (-> self flags) 1) + (logior! (-> self flags) (gun-buoy-flags gubflags-0)) (logior! (-> self water flags) (water-flags touch-water)) (let* ((gp-0 *target*) (s3-0 (if (type? gp-0 process-focusable) @@ -495,7 +508,7 @@ :trans (behavior () (when (< (fabs (-> self y-offset)) 409.6) (set! (-> self y-offset) 0.0) - (when (not (logtest? (-> self flags) 4)) + (when (not (logtest? (-> self flags) (gun-buoy-flags gubflags-2))) (set! *gun-buoy-warning-index* (rand-vu-int-range 0 (+ (-> *gun-buoy-warning-speech* length) -1))) (let ((t0-0 (-> *gun-buoy-warning-speech* *gun-buoy-warning-index*))) (set! (-> self voice-id) (add-process *gui-control* self (gui-channel guard) (gui-action play) t0-0 -99.0 0)) @@ -539,7 +552,7 @@ (defstate exit-ambush (gun-buoy) :virtual #t :enter (behavior () - (logand! (-> self flags) -2) + (logclear! (-> self flags) (gun-buoy-flags gubflags-0)) (none) ) :exit (behavior () @@ -618,7 +631,7 @@ ) ) (set! (-> self gun-elev-jmod mode) (the-as joint-mod-mode #t)) - (if (logtest? (-> self flags) 4) + (if (logtest? (-> self flags) (gun-buoy-flags gubflags-2)) (go-virtual attack) ) (case (-> self focus aware) @@ -684,14 +697,14 @@ :event (behavior ((proc process) (arg1 int) (event-type symbol) (event event-message-block)) (case event-type (('kill-player) - (logior! (-> self flags) 4) + (logior! (-> self flags) (gun-buoy-flags gubflags-2)) (go-virtual attack) ) ) ) :enter (behavior () (cond - ((logtest? (-> self flags) 2) + ((logtest? (-> self flags) (gun-buoy-flags gubflags-1)) (set! (-> self warning-interval) (seconds 0.1)) ) (else @@ -731,7 +744,7 @@ (when (>= (- (current-time) (-> self warning-timer)) (-> self warning-interval)) (cond ((>= (the-as int gp-0) 3) - (logior! (-> self flags) 2) + (logior! (-> self flags) (gun-buoy-flags gubflags-1)) (go-hostile self) ) (else @@ -819,7 +832,7 @@ :virtual #t :trans (behavior () (let ((v1-0 (-> self focus aware))) - (when (not (logtest? (-> self flags) 4)) + (when (not (logtest? (-> self flags) (gun-buoy-flags gubflags-2))) (if (>= 2 (the-as int v1-0)) (go-virtual hostile) ) @@ -995,7 +1008,7 @@ ;; WARN: Return type mismatch object vs none. (defmethod go-hostile gun-buoy ((obj gun-buoy)) - (if (logtest? (-> obj flags) 2) + (if (logtest? (-> obj flags) (gun-buoy-flags gubflags-1)) (go (method-of-object obj hostile)) (go (method-of-object obj warning)) ) @@ -1258,7 +1271,7 @@ (logclear! (-> obj mask) (process-mask actor-pause)) (process-entity-status! obj (entity-perm-status no-kill) #t) (set! (-> obj start-pos quad) (-> obj root trans quad)) - (set! (-> obj flags) (the-as uint 0)) + (set! (-> obj flags) (gun-buoy-flags)) (set! (-> obj gun-elev-jmod) (the-as joint-mod (new 'process 'joint-mod-rotate-local obj 6 #f))) (quaternion-copy! (the-as quaternion (-> obj gun-elev-jmod target)) *unity-quaternion*) (set! (-> obj water) (new 'process 'water-control obj 3 8192.0 8192.0 2048.0)) diff --git a/goal_src/jak2/levels/forest/wren.gc b/goal_src/jak2/levels/forest/wren.gc index a7c9fed660..83b2ee905a 100644 --- a/goal_src/jak2/levels/forest/wren.gc +++ b/goal_src/jak2/levels/forest/wren.gc @@ -5,6 +5,19 @@ ;; name in dgo: wren ;; dgos: FOR +(defenum wren-flags + :bitfield #t + :type uint16 + (wrflags-0) + (wrflags-1) + (wrflags-2) + (wrflags-3) + (wrflags-4) + (wrflags-5) + (wrflags-6) + (wrflags-7) + ) + ;; DECOMP BEGINS (deftype wren (process-drawable) @@ -21,7 +34,7 @@ (bob-level-seek float :offset-assert 264) (bank-angle float :offset-assert 268) (peck-timer uint64 :offset-assert 272) - (flags uint16 :offset-assert 280) + (flags wren-flags :offset-assert 280) ) :heap-base #xa0 :method-count-assert 28 @@ -131,8 +144,8 @@ If so, it transitions from [[wren::peck]] to [[wren::hunt]]" :trans (behavior () (when (< (vector-vector-xz-distance (-> self root trans) (-> self move-dest)) 2048.0) (cond - ((logtest? (-> self flags) 4) - (logand! (-> self flags) -5) + ((logtest? (-> self flags) (wren-flags wrflags-2)) + (logclear! (-> self flags) (wren-flags wrflags-2)) (set! (-> self fly-index) (the-as uint 0)) (go-virtual fly) ) @@ -189,7 +202,7 @@ If so, it transitions from [[wren::peck]] to [[wren::hunt]]" :enter (behavior () (set! (-> self state-time) (current-time)) (set! (-> self peck-timer) (the-as uint (the int (* 300.0 (rand-vu-float-range 1.4 4.3))))) - (logand! (-> self flags) -7) + (logclear! (-> self flags) (wren-flags wrflags-1 wrflags-2)) (none) ) :trans (behavior () @@ -200,15 +213,15 @@ If so, it transitions from [[wren::peck]] to [[wren::hunt]]" ) ) ) - (when (logtest? (-> self flags) 2) - (logand! (-> self flags) -3) + (when (logtest? (-> self flags) (wren-flags wrflags-1)) + (logclear! (-> self flags) (wren-flags wrflags-1)) (when (spooked? self) (get-point-in-path! (-> self fly-curve 0) (-> self move-dest) 0.0 'interp) (set-yaw-angle-clear-roll-pitch! (-> self root) (vector-y-angle (vector-! (new 'stack-no-clear 'vector) (-> self move-dest) (-> self root trans))) ) - (logior! (-> self flags) 4) + (logior! (-> self flags) (wren-flags wrflags-2)) (go-virtual hunt) ) ) @@ -217,11 +230,11 @@ If so, it transitions from [[wren::peck]] to [[wren::hunt]]" :code (behavior () (local-vars (v1-34 symbol)) (until #f - (logand! (-> self flags) -2) + (logclear! (-> self flags) (wren-flags wrflags-0)) (let ((f0-0 (rand-vu-float-range 0.0 (get-num-segments (-> self path))))) (get-point-in-path! (-> self path) (-> self move-dest) f0-0 'interp) ) - (logior! (-> self flags) 2) + (logior! (-> self flags) (wren-flags wrflags-1)) (ja-no-eval :group! wren-peck-ja :num! (seek! (the float (+ (-> (the-as art-joint-anim wren-peck-ja) frames num-frames) -1))) :frame-num 0.0 @@ -231,7 +244,7 @@ If so, it transitions from [[wren::peck]] to [[wren::hunt]]" (ja :num! (seek!)) ) #t - (let ((v1-33 (the-as symbol (logand (-> self flags) 2)))) + (let ((v1-33 (the-as symbol (logand (-> self flags) (wren-flags wrflags-1))))) (set! v1-33 v1-33) (cmove-#f-zero v1-34 v1-33 v1-33) ) @@ -245,7 +258,7 @@ If so, it transitions from [[wren::peck]] to [[wren::hunt]]" (ja :num! (loop! f30-1)) ) ) - (logior! (-> self flags) 1) + (logior! (-> self flags) (wren-flags wrflags-0)) (let ((gp-2 (current-time)) (s5-2 (the int (* 300.0 (rand-vu-float-range 0.2 1.5)))) (f30-3 1.0) @@ -261,7 +274,7 @@ If so, it transitions from [[wren::peck]] to [[wren::hunt]]" (none) ) :post (behavior () - (if (logtest? (-> self flags) 1) + (if (logtest? (-> self flags) (wren-flags wrflags-0)) (seek-to-point-toward-point! (-> self root) (-> self move-dest) 262144.0 (seconds 0.02)) ) (ja-post) @@ -400,7 +413,7 @@ If so, it transitions from [[wren::peck]] to [[wren::hunt]]" (none) ) :code (behavior () - (logand! (-> self flags) -2) + (logclear! (-> self flags) (wren-flags wrflags-0)) (ja-channel-push! 1 (seconds 0.2)) (let ((gp-0 (current-time)) (s5-0 (the int (* 300.0 (rand-vu-float-range 4.2 16.8)))) @@ -412,7 +425,7 @@ If so, it transitions from [[wren::peck]] to [[wren::hunt]]" (ja :num! (loop! f30-1)) ) ) - (logior! (-> self flags) 1) + (logior! (-> self flags) (wren-flags wrflags-0)) (let ((gp-1 (current-time)) (s5-1 600) (f30-2 1.0) @@ -426,7 +439,7 @@ If so, it transitions from [[wren::peck]] to [[wren::hunt]]" (none) ) :post (behavior () - (if (logtest? (-> self flags) 1) + (if (logtest? (-> self flags) (wren-flags wrflags-0)) (seek-to-point-toward-point! (-> self root) (-> self move-dest) 262144.0 (seconds 0.02)) ) (debug-draw-path self) @@ -478,7 +491,7 @@ This commonly includes things such as: ) (set! (-> obj fly-index) (the-as uint 0)) (set! (-> obj path-u) 0.0) - (set! (-> obj flags) (the-as uint 0)) + (set! (-> obj flags) (wren-flags)) (set! (-> obj bob-level) 0.0) (set! (-> obj bank-angle) 0.0) (set! (-> obj path) (new 'process 'path-control obj 'idle 0.0 arg0 #f)) diff --git a/goal_src/jak2/levels/fortress/dump/fort-robotank-turret.gc b/goal_src/jak2/levels/fortress/dump/fort-robotank-turret.gc index d3fd7430ff..f125bc2395 100644 --- a/goal_src/jak2/levels/fortress/dump/fort-robotank-turret.gc +++ b/goal_src/jak2/levels/fortress/dump/fort-robotank-turret.gc @@ -7,35 +7,56 @@ ;; og:ignore-form:draw-2d-hud +(defenum robotank-turret-flags + :bitfield #t + :type uint16 + (rotflags-0) + (rotflags-1) + (rotflags-2) + (rotflags-3) + (rotflags-4) + (rotflags-5) + (rotflags-6) + (rotflags-7) + (rotflags-8) + (rotflags-9) + (rotflags-10) + (rotflags-11) + (rotflags-12) + (rotflags-13) + (rotflags-14) + (rotflags-15) + ) + ;; DECOMP BEGINS (deftype fort-robotank-turret (process-focusable) - ((los los-control :inline :offset-assert 208) - (reticle handle :offset-assert 360) - (screen handle :offset-assert 368) - (tank-quat quaternion :inline :offset-assert 384) - (tank-quat-vibe-only quaternion :inline :offset-assert 400) - (rotate-quat quaternion :inline :offset-assert 416) - (rotate-rate float :offset-assert 432) - (rotate-mult float :offset-assert 436) - (shot-range float :offset-assert 440) - (fov-mult float :offset-assert 444) - (offset vector :inline :offset-assert 448) - (sight-pos vector :inline :offset-assert 464) - (firing-sight-pos vector :inline :offset-assert 480) - (aim-pos vector 3 :inline :offset-assert 496) - (aim-pos-2 vector :inline :offset 512) - (aim-pos-1 vector :inline :offset 528) - (gun-timer time-frame :offset-assert 544) - (gun-elev-jmod joint-mod-set-local :offset-assert 552) - (gun-elev float :offset-assert 556) - (gun-elev-cam float :offset-assert 560) - (gun-joint-l int32 2 :offset-assert 564) - (gun-joint-r int32 2 :offset-assert 572) - (gun-spread float :offset-assert 580) - (gun-index int32 :offset-assert 584) - (flags uint16 :offset-assert 588) - (turn-sound-id sound-id :offset-assert 592) + ((los los-control :inline :offset-assert 208) + (reticle handle :offset-assert 360) + (screen handle :offset-assert 368) + (tank-quat quaternion :inline :offset-assert 384) + (tank-quat-vibe-only quaternion :inline :offset-assert 400) + (rotate-quat quaternion :inline :offset-assert 416) + (rotate-rate float :offset-assert 432) + (rotate-mult float :offset-assert 436) + (shot-range float :offset-assert 440) + (fov-mult float :offset-assert 444) + (offset vector :inline :offset-assert 448) + (sight-pos vector :inline :offset-assert 464) + (firing-sight-pos vector :inline :offset-assert 480) + (aim-pos vector 3 :inline :offset-assert 496) + (aim-pos-2 vector :inline :offset 512) + (aim-pos-1 vector :inline :offset 528) + (gun-timer time-frame :offset-assert 544) + (gun-elev-jmod joint-mod-set-local :offset-assert 552) + (gun-elev float :offset-assert 556) + (gun-elev-cam float :offset-assert 560) + (gun-joint-l int32 2 :offset-assert 564) + (gun-joint-r int32 2 :offset-assert 572) + (gun-spread float :offset-assert 580) + (gun-index int32 :offset-assert 584) + (flags robotank-turret-flags :offset-assert 588) + (turn-sound-id sound-id :offset-assert 592) ) :heap-base #x1e0 :method-count-assert 35 @@ -858,9 +879,9 @@ ) ) (cond - ((and (logtest? (-> self flags) 1) gp-0) + ((and (logtest? (-> self flags) (robotank-turret-flags rotflags-0)) gp-0) (send-event (handle->process (-> self reticle)) 'on) - (if (logtest? (-> self flags) 512) + (if (logtest? (-> self flags) (robotank-turret-flags rotflags-9)) (los-control-method-9 (-> self los) gp-0 (the-as vector #f) 1638.4) ) (target-look-at-me! :trans (the-as vector (-> self root root-prim prim-core)) :message 'attacking) @@ -885,11 +906,11 @@ (let ((f30-0 (vector-length gp-2))) (vector-normalize! gp-2 1.0) (vector-normalize! s3-1 1.0) - (if (logtest? (-> self flags) 8) + (if (logtest? (-> self flags) (robotank-turret-flags rotflags-3)) (set! (-> s5-3 quad) (-> s3-1 quad)) (set! (-> s5-3 quad) (-> gp-2 quad)) ) - (when (logtest? (-> self flags) 128) + (when (logtest? (-> self flags) (robotank-turret-flags rotflags-7)) (let ((f0-6 (lerp-scale 1.0 0.2 f30-0 8192.0 327680.0))) (seek! (-> self fov-mult) f0-6 (* 2.0 (-> self clock seconds-per-frame))) ) @@ -936,7 +957,7 @@ ) ) ) - (when (logtest? (-> self flags) 1024) + (when (logtest? (-> self flags) (robotank-turret-flags rotflags-10)) (cond ((< -1456.3556 (-> self gun-elev)) (send-event (handle->process (-> self reticle)) 'spotlight-on) @@ -954,7 +975,9 @@ ) ) ) - (when (and (logtest? (-> self flags) 1) (not (logtest? (-> self flags) 8))) + (when (and (logtest? (-> self flags) (robotank-turret-flags rotflags-0)) + (not (logtest? (-> self flags) (robotank-turret-flags rotflags-3))) + ) (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 @@ -973,17 +996,17 @@ ) ) (cond - ((logtest? (-> self flags) 64) + ((logtest? (-> self flags) (robotank-turret-flags rotflags-6)) (sound-play "robotank-turret" :id (-> self turn-sound-id) :position (-> self root trans)) (when (< (fabs (-> self rotate-rate)) 728.1778) - (logand! (-> self flags) -65) + (logclear! (-> self flags) (robotank-turret-flags rotflags-6)) (sound-stop (-> self turn-sound-id)) (sound-play "robo-turret-end") ) ) (else (if (< 2184.5334 (fabs (-> self rotate-rate))) - (logior! (-> self flags) 64) + (logior! (-> self flags) (robotank-turret-flags rotflags-6)) ) ) ) @@ -1003,19 +1026,19 @@ (case arg2 (('trigger) (when (and (-> self next-state) (= (-> self next-state name) 'idle)) - (logior! (-> self flags) 1) + (logior! (-> self flags) (robotank-turret-flags rotflags-0)) (go-virtual ready) ) ) (('fire-suppress) (cond ((-> arg3 param 0) - (set! v0-0 (logior (-> self flags) 16)) - (set! (-> self flags) (the-as uint v0-0)) + (set! v0-0 (logior (-> self flags) (robotank-turret-flags rotflags-4))) + (set! (-> self flags) (the-as robotank-turret-flags v0-0)) ) (else - (set! v0-0 (logand -17 (-> self flags))) - (set! (-> self flags) (the-as uint v0-0)) + (set! v0-0 (logclear (-> self flags) (robotank-turret-flags rotflags-4))) + (set! (-> self flags) (the-as robotank-turret-flags v0-0)) ) ) v0-0 @@ -1026,12 +1049,12 @@ (('use-los) (cond ((-> arg3 param 0) - (set! v0-0 (logior (-> self flags) 512)) - (set! (-> self flags) (the-as uint v0-0)) + (set! v0-0 (logior (-> self flags) (robotank-turret-flags rotflags-9))) + (set! (-> self flags) (the-as robotank-turret-flags v0-0)) ) (else - (set! v0-0 (logand -513 (-> self flags))) - (set! (-> self flags) (the-as uint v0-0)) + (set! v0-0 (logclear (-> self flags) (robotank-turret-flags rotflags-9))) + (set! (-> self flags) (the-as robotank-turret-flags v0-0)) ) ) v0-0 @@ -1039,12 +1062,12 @@ (('limit-reticle-elev) (cond ((-> arg3 param 0) - (set! v0-0 (logior (-> self flags) 1024)) - (set! (-> self flags) (the-as uint v0-0)) + (set! v0-0 (logior (-> self flags) (robotank-turret-flags rotflags-10))) + (set! (-> self flags) (the-as robotank-turret-flags v0-0)) ) (else - (set! v0-0 (logand -1025 (-> self flags))) - (set! (-> self flags) (the-as uint v0-0)) + (set! v0-0 (logclear (-> self flags) (robotank-turret-flags rotflags-10))) + (set! (-> self flags) (the-as robotank-turret-flags v0-0)) ) ) v0-0 @@ -1054,7 +1077,7 @@ (set! (-> v1-22 prim-core collide-as) (collide-spec obstacle pusher)) (set! (-> v1-22 prim-core collide-with) (collide-spec jak player-list)) ) - (logior! (-> self flags) 128) + (logior! (-> self flags) (robotank-turret-flags rotflags-7)) (send-event (handle->process (-> self screen)) 'trigger) ) (('pov-cam-off) @@ -1063,7 +1086,7 @@ (set! (-> v1-33 prim-core collide-with) (collide-spec)) ) 0 - (logand! (-> self flags) -129) + (logclear! (-> self flags) (robotank-turret-flags rotflags-7)) (remove-setting! 'fov) (send-event (handle->process (-> self screen)) 'untrigger) ) @@ -1120,14 +1143,14 @@ (none) ) :trans (behavior () - (if (logtest? (-> self flags) 16) + (if (logtest? (-> self flags) (robotank-turret-flags rotflags-4)) (set! (-> self gun-timer) (current-time)) ) (let ((gp-0 *target*)) (if (and (if (type? gp-0 process-focusable) gp-0 ) - (or (not (logtest? (-> self flags) 512)) (check-los? (-> self los) 0)) + (or (not (logtest? (-> self flags) (robotank-turret-flags rotflags-9))) (check-los? (-> self los) 0)) (>= (- (current-time) (-> self gun-timer)) (seconds 1)) ) (go-virtual fire) @@ -1156,7 +1179,7 @@ :virtual #t :event robotank-turret-handler :enter (behavior () - (logior! (-> self flags) 256) + (logior! (-> self flags) (robotank-turret-flags rotflags-8)) (let* ((gp-0 *target*) (a0-1 (if (type? gp-0 process-focusable) gp-0 @@ -1177,10 +1200,13 @@ gp-0 ) ) - (and (logtest? (-> self flags) 512) (not (logtest? (-> self flags) 8)) (skip-check-los? (-> self los) 0)) - (logtest? (-> self flags) 16) + (and (logtest? (-> self flags) (robotank-turret-flags rotflags-9)) + (not (logtest? (-> self flags) (robotank-turret-flags rotflags-3))) + (skip-check-los? (-> self los) 0) + ) + (logtest? (-> self flags) (robotank-turret-flags rotflags-4)) ) - (logand! (-> self flags) -257) + (logclear! (-> self flags) (robotank-turret-flags rotflags-8)) (go-virtual ready) ) ) @@ -1191,7 +1217,7 @@ (until (fort-robotank-turret-method-34 self (-> self aim-pos-1) 2730.6667) (suspend) ) - (logior! (-> self flags) 8) + (logior! (-> self flags) (robotank-turret-flags rotflags-3)) (set! (-> self firing-sight-pos quad) (-> self sight-pos quad)) (send-event (handle->process (-> self reticle)) 'lock) (let ((gp-0 (current-time))) @@ -1240,7 +1266,7 @@ ) ) (label cfg-26) - (logand! (-> self flags) -9) + (logclear! (-> self flags) (robotank-turret-flags rotflags-3)) (send-event (handle->process (-> self reticle)) 'unlock) (until (fort-robotank-turret-method-34 self (-> self aim-pos-1) 2730.6667) (suspend) @@ -1284,7 +1310,7 @@ ) (defmethod deactivate fort-robotank-turret ((obj fort-robotank-turret)) - (logand! (-> obj flags) -65) + (logclear! (-> obj flags) (robotank-turret-flags rotflags-6)) (sound-stop (-> obj turn-sound-id)) (let ((a0-4 (handle->process (-> obj screen)))) (if a0-4 @@ -1380,7 +1406,7 @@ (set! (-> self aim-pos-2 quad) (-> self root trans quad)) (set! (-> self aim-pos-1 quad) (-> self root trans quad)) (set! (-> self gun-timer) (current-time)) - (set! (-> self flags) (the-as uint 0)) + (set! (-> self flags) (robotank-turret-flags)) (set! (-> self fov-mult) 1.0) (set! (-> self shot-range) 204800.0) (set! (-> self gun-joint-l 0) 10) diff --git a/goal_src/jak2/levels/fortress/dump/fort-robotank.gc b/goal_src/jak2/levels/fortress/dump/fort-robotank.gc index 18be808c35..a3b46a5bcf 100644 --- a/goal_src/jak2/levels/fortress/dump/fort-robotank.gc +++ b/goal_src/jak2/levels/fortress/dump/fort-robotank.gc @@ -7,6 +7,28 @@ (declare-type fort-robotank process-drawable) + +(defenum robotank-flags + :bitfield #t + :type uint16 + (roflags-0) + (roflags-1) + (roflags-2) + (roflags-3) + (roflags-4) + (roflags-5) + (roflags-6) + (roflags-7) + (roflags-8) + (roflags-9) + (roflags-10) + (roflags-11) + (roflags-12) + (roflags-13) + (roflags-14) + (roflags-15) + ) + ;; DECOMP BEGINS (defpartgroup group-robotank-barrel-sparks @@ -137,7 +159,7 @@ (tread fort-robotank-tread-info 2 :inline :offset-assert 224) (path-info fort-robotank-path-info-array :offset-assert 512) (segment-table (inline-array fort-robotank-segment) :offset-assert 516) - (flags uint16 :offset-assert 520) + (flags robotank-flags :offset-assert 520) (pov-cam-offset vector 2 :inline :offset-assert 528) (turret handle :offset-assert 560) (no-collision-timer time-frame :offset-assert 568) @@ -350,7 +372,7 @@ ) (let ((v1-65 (-> self path-info data (-> self path-index)))) (cond - ((and (logtest? (-> self flags) 4) (!= (-> v1-65 u) (-> v1-65 prev-u))) + ((and (logtest? (-> self flags) (robotank-flags roflags-2)) (!= (-> v1-65 u) (-> v1-65 prev-u))) (seek! (-> self engine-vibe-rate) 3.0 (-> self clock seconds-per-frame)) (seek! (-> self engine-vibe-amp) 1.0 (-> self clock seconds-per-frame)) ) @@ -409,7 +431,7 @@ (dotimes (gp-4 (-> self path-count)) (debug-draw (-> self path-info data gp-4 path)) ) - (when (logtest? (-> self flags) 128) + (when (logtest? (-> self flags) (robotank-flags roflags-7)) (let ((gp-5 (quaternion-inverse! (new 'stack-no-clear 'quaternion) (-> self root quat))) (a1-28 (new 'stack-no-clear 'event-message-block)) ) @@ -470,7 +492,7 @@ (set! (-> v1-14 message) 'trigger) ) ) - (logior! (-> self flags) 32) + (logior! (-> self flags) (robotank-flags roflags-5)) (let ((ret (the-as object (-> arg3 param 0)))) (set! (-> self continue-index) (the-as int ret)) ret @@ -597,7 +619,7 @@ ) (set-setting! 'pov-offset 'asdf (-> obj pov-cam-offset) 0) (send-event (handle->process (-> obj turret)) 'pov-cam-on) - (logior! (-> obj flags) 128) + (logior! (-> obj flags) (robotank-flags roflags-7)) (let ((v1-41 (-> (the-as collide-shape-prim-group (-> obj root root-prim)) child 2))) (set! (-> v1-41 prim-core collide-as) (collide-spec enemy pusher)) (set! (-> v1-41 prim-core collide-with) (collide-spec jak bot player-list)) @@ -610,7 +632,7 @@ (remove-setting! 'target-height) (remove-setting! 'pov-offset) (send-event (handle->process (-> obj turret)) 'pov-cam-off) - (logand! (-> obj flags) -129) + (logclear! (-> obj flags) (robotank-flags roflags-7)) (let ((v1-57 (-> (the-as collide-shape-prim-group (-> obj root root-prim)) child 2))) (set! (-> v1-57 prim-core collide-as) (collide-spec)) (set! (-> v1-57 prim-core collide-with) (collide-spec)) @@ -677,10 +699,10 @@ (set! (-> v1-8 message) 'trigger) ) ) - (logior! (-> self flags) 32) + (logior! (-> self flags) (robotank-flags roflags-5)) ) - (when (logtest? (-> self flags) 32) - (logand! (-> self flags) -33) + (when (logtest? (-> self flags) (robotank-flags roflags-5)) + (logclear! (-> self flags) (robotank-flags roflags-5)) (set-setting! 'music 'danger11 0.0 0) (set-setting! 'music-volume 'rel 0.9 0) (go-virtual moving) @@ -739,7 +761,7 @@ (none) ) :exit (behavior () - (logand! (-> self flags) -5) + (logclear! (-> self flags) (robotank-flags roflags-2)) (none) ) :trans (behavior () @@ -795,18 +817,18 @@ (none) ) :code (behavior () - (logand! (-> self flags) -5) + (logclear! (-> self flags) (robotank-flags roflags-2)) (let ((gp-0 (current-time))) (until (>= (- (current-time) gp-0) (seconds 0.1)) (suspend) ) ) - (logior! (-> self flags) 4) + (logior! (-> self flags) (robotank-flags roflags-2)) (sleep-code) (none) ) :post (behavior () - (when (logtest? (-> self flags) 4) + (when (logtest? (-> self flags) (robotank-flags roflags-2)) (let* ((gp-0 *target*) (s3-0 (if (type? gp-0 process-focusable) gp-0 @@ -911,8 +933,8 @@ (none) ) :trans (behavior () - (when (logtest? (-> self flags) 32) - (logand! (-> self flags) -33) + (when (logtest? (-> self flags) (robotank-flags roflags-5)) + (logclear! (-> self flags) (robotank-flags roflags-5)) (go-virtual moving) ) (none) @@ -1067,7 +1089,7 @@ This commonly includes things such as: (set! (-> obj fact) (new 'process 'fact-info obj (pickup-type eco-pill-random) (-> *FACT-bank* default-eco-pill-green-inc)) ) - (set! (-> obj flags) (the-as uint 0)) + (set! (-> obj flags) (robotank-flags)) (set! (-> obj no-collision-timer) 0) (set! (-> obj engine-vibe-rate) 1.0) (set! (-> obj buzz-timer) 0) diff --git a/goal_src/jak2/levels/mountain/mountain-obs.gc b/goal_src/jak2/levels/mountain/mountain-obs.gc index ffc7333d33..90018d4dfe 100644 --- a/goal_src/jak2/levels/mountain/mountain-obs.gc +++ b/goal_src/jak2/levels/mountain/mountain-obs.gc @@ -5,6 +5,15 @@ ;; name in dgo: mountain-obs ;; dgos: MTN +(defenum mtn-plat-flags + :bitfield #t + :type uint16 + (mtpflags-0) + (mtpflags-1) + (mtpflags-2) + (mtpflags-3) + ) + ;; DECOMP BEGINS (define *dice-back-way-num* 0) @@ -2546,11 +2555,11 @@ This commonly includes things such as: ) (deftype mtn-plat-return (base-plat) - ((ride-timer time-frame :offset-assert 272) - (flags uint16 :offset-assert 280) - (path-pos float :offset-assert 284) - (dest-pos float :offset-assert 288) - (path-speed float :offset-assert 292) + ((ride-timer time-frame :offset-assert 272) + (flags mtn-plat-flags :offset-assert 280) + (path-pos float :offset-assert 284) + (dest-pos float :offset-assert 288) + (path-speed float :offset-assert 292) ) :heap-base #xb0 :method-count-assert 38 @@ -2575,8 +2584,8 @@ This commonly includes things such as: :event (behavior ((proc process) (arg1 int) (event-type symbol) (event event-message-block)) (case event-type (('ridden) - (let ((v0-0 (the-as object (logior (-> self flags) 1)))) - (set! (-> self flags) (the-as uint v0-0)) + (let ((v0-0 (the-as object (logior (-> self flags) (mtn-plat-flags mtpflags-0))))) + (set! (-> self flags) (the-as mtn-plat-flags v0-0)) v0-0 ) ) @@ -2591,14 +2600,14 @@ This commonly includes things such as: (none) ) :trans (behavior () - (logand! (-> self flags) -2) + (logclear! (-> self flags) (mtn-plat-flags mtpflags-0)) (plat-trans) - (if (not (logtest? (-> self flags) 1)) + (if (not (logtest? (-> self flags) (mtn-plat-flags mtpflags-0))) (set! (-> self ride-timer) (current-time)) ) (let ((v1-10 (and (>= (- (current-time) (-> self ride-timer)) (seconds 0.5)) - (logtest? (-> self flags) 1) - (if (logtest? (-> self flags) 2) + (logtest? (-> self flags) (mtn-plat-flags mtpflags-0)) + (if (logtest? (-> self flags) (mtn-plat-flags mtpflags-1)) (and *target* (process-grab? *target* #f)) #t ) @@ -2624,8 +2633,8 @@ This commonly includes things such as: :event (behavior ((proc process) (arg1 int) (event-type symbol) (event event-message-block)) (case event-type (('ridden) - (let ((v0-0 (the-as object (logior (-> self flags) 1)))) - (set! (-> self flags) (the-as uint v0-0)) + (let ((v0-0 (the-as object (logior (-> self flags) (mtn-plat-flags mtpflags-0))))) + (set! (-> self flags) (the-as mtn-plat-flags v0-0)) v0-0 ) ) @@ -2734,7 +2743,7 @@ This commonly includes things such as: (the-as pair 0) ) (stop-bouncing! obj) - (set! (-> obj flags) (the-as uint 0)) + (set! (-> obj flags) (mtn-plat-flags)) (set! (-> obj path-pos) 0.0) (set! (-> obj path) (new 'process 'curve-control obj 'path -1000000000.0)) (if (logtest? (-> obj path flags) (path-control-flag not-found)) @@ -3315,7 +3324,7 @@ This commonly includes things such as: (t9-0) ) ) - (if (logtest? (-> self flags) 1) + (if (logtest? (-> self flags) (mtn-plat-flags mtpflags-0)) (process-release? *target*) ) (none) @@ -3343,7 +3352,7 @@ This commonly includes things such as: (defmethod init-plat! trans-plat ((obj trans-plat)) "Does any necessary initial platform setup. For example for an elevator pre-compute the distance between the first and last points (both ways) and clear the sound." - (logior! (-> obj flags) 2) + (logior! (-> obj flags) (mtn-plat-flags mtpflags-1)) (let* ((s5-0 *target*) (a0-2 (if (type? s5-0 process-focusable) s5-0 diff --git a/goal_src/jak2/levels/nest/boss/nestb-scenes.gc b/goal_src/jak2/levels/nest/boss/nestb-scenes.gc index 94d0fa866a..4720ad016f 100644 --- a/goal_src/jak2/levels/nest/boss/nestb-scenes.gc +++ b/goal_src/jak2/levels/nest/boss/nestb-scenes.gc @@ -25,7 +25,7 @@ (suspend) ) ) - (send-event *target* 'change-mode 'darkjak #f 64) + (send-event *target* 'change-mode 'darkjak #f (darkjak-stage no-anim)) (let ((gp-1 (current-time))) (until (>= (- (current-time) gp-1) (seconds 0.1)) (suspend) diff --git a/goal_src/jak2/levels/ruins/rapid-gunner.gc b/goal_src/jak2/levels/ruins/rapid-gunner.gc index 13f393e87d..eab9560960 100644 --- a/goal_src/jak2/levels/ruins/rapid-gunner.gc +++ b/goal_src/jak2/levels/ruins/rapid-gunner.gc @@ -5,28 +5,38 @@ ;; name in dgo: rapid-gunner ;; dgos: RUI +(defenum rapid-gunner-flags + :bitfield #t + (ragflags-0) + (ragflags-1) + (ragflags-2) + (ragflags-3) + (ragflags-4) + (ragflags-5) + ) + ;; DECOMP BEGINS (deftype rapid-gunner (nav-enemy) - ((los los-control :inline :offset-assert 608) - (joint joint-mod :offset-assert 756) - (joint-blend float :offset-assert 760) - (joint-enable symbol :offset-assert 764) - (shot-timer uint64 :offset-assert 768) - (predict-timer uint64 :offset-assert 776) - (target-prev-pos vector :inline :offset-assert 784) - (target-next-pos vector :inline :offset-assert 800) - (focus-dir vector :inline :offset-assert 816) - (y-diff float :offset-assert 832) - (shots-fired uint32 :offset-assert 836) - (spin-up-angle float :offset-assert 840) - (spin-up-timer time-frame :offset-assert 848) - (shoot-anim-index int32 :offset-assert 856) - (status-flags uint64 :offset-assert 864) - (start-pos vector :inline :offset-assert 880) - (dest-pos vector :inline :offset-assert 896) - (hop-dir vector :inline :offset-assert 912) - (roam-radius float :offset-assert 928) + ((los los-control :inline :offset-assert 608) + (joint joint-mod :offset-assert 756) + (joint-blend float :offset-assert 760) + (joint-enable symbol :offset-assert 764) + (shot-timer uint64 :offset-assert 768) + (predict-timer uint64 :offset-assert 776) + (target-prev-pos vector :inline :offset-assert 784) + (target-next-pos vector :inline :offset-assert 800) + (focus-dir vector :inline :offset-assert 816) + (y-diff float :offset-assert 832) + (shots-fired uint32 :offset-assert 836) + (spin-up-angle float :offset-assert 840) + (spin-up-timer time-frame :offset-assert 848) + (shoot-anim-index int32 :offset-assert 856) + (status-flags rapid-gunner-flags :offset-assert 864) + (start-pos vector :inline :offset-assert 880) + (dest-pos vector :inline :offset-assert 896) + (hop-dir vector :inline :offset-assert 912) + (roam-radius float :offset-assert 928) ) :heap-base #x330 :method-count-assert 187 @@ -705,9 +715,9 @@ (set! (-> v1-15 attack-id) a0-6) (set! (-> self attack-id) a0-6) ) - (when (logtest? (-> self status-flags) 2) + (when (logtest? (-> self status-flags) (rapid-gunner-flags ragflags-1)) (set! (-> self spin-up-timer) (+ (current-time) (seconds 2))) - (logand! (-> self status-flags) -3) + (logclear! (-> self status-flags) (rapid-gunner-flags ragflags-1)) ) (if (zero? (rand-vu-int-range 0 3)) (set! (-> self shoot-anim-index) 15) @@ -1165,12 +1175,12 @@ (cond ((handle->process (-> self focus handle)) (if (check-los? (-> self los) 0) - (logand! (-> self status-flags) -3) - (logior! (-> self status-flags) 2) + (logclear! (-> self status-flags) (rapid-gunner-flags ragflags-1)) + (logior! (-> self status-flags) (rapid-gunner-flags ragflags-1)) ) ) (else - (logior! (-> self status-flags) 2) + (logior! (-> self status-flags) (rapid-gunner-flags ragflags-1)) ) ) (let ((v1-18 self)) @@ -1524,8 +1534,8 @@ ) (set! (-> obj shots-fired) (the-as uint 0)) (set! (-> obj spin-up-timer) 0) - (logand! (-> obj status-flags) -2) - (logior! (-> obj status-flags) 2) + (logclear! (-> obj status-flags) (rapid-gunner-flags ragflags-0)) + (logior! (-> obj status-flags) (rapid-gunner-flags ragflags-1)) (let ((f30-0 3640.889)) (set! sv-48 0) (let ((v1-22 (res-lump-data (-> obj entity) 'spinup-angle pointer :tag-ptr (the-as (pointer res-tag) (& sv-48))))) diff --git a/goal_src/jak2/levels/sewer/hal2-course.gc b/goal_src/jak2/levels/sewer/hal2-course.gc index 5d94c08fd8..3deab746e5 100644 --- a/goal_src/jak2/levels/sewer/hal2-course.gc +++ b/goal_src/jak2/levels/sewer/hal2-course.gc @@ -70,7 +70,7 @@ (('notify) (case (-> arg3 param 0) (('jinx-bomb) - (logior! (-> obj bot-task-bits) 1) + (logior! (-> obj bot-task-bits) (bot-task-bits botbits-0)) #t ) (else @@ -426,17 +426,17 @@ ) ) (cond - ((not (logtest? (-> arg1 waypoint-bits) 1)) + ((not (logtest? (-> arg1 waypoint-bits) (waypoint-bits wabits-0))) (when (and s3-0 s4-0 s5-0) - (logior! (-> arg1 waypoint-bits) 1) + (logior! (-> arg1 waypoint-bits) (waypoint-bits wabits-0)) (set! (-> arg1 slave-handle 0) (process->handle s3-0)) (set! (-> arg1 slave-handle 1) (process->handle s4-0)) (set! (-> arg1 slave-handle 2) (process->handle s5-0)) ) #f ) - ((not (logtest? (-> arg1 waypoint-bits) 2)) - (logior! (-> arg1 waypoint-bits) 2) + ((not (logtest? (-> arg1 waypoint-bits) (waypoint-bits wabits-1))) + (logior! (-> arg1 waypoint-bits) (waypoint-bits wabits-1)) (hal-method-226 arg1) (send-event s3-0 'request 'waypoint 2) (send-event s4-0 'request 'waypoint 2) @@ -1610,7 +1610,7 @@ (the-as (function halt-wait-spot hal symbol) (lambda ((arg0 object) (arg1 hal-sewer)) (cond - ((logtest? (-> arg1 bot-task-bits) 1) + ((logtest? (-> arg1 bot-task-bits) (bot-task-bits botbits-0)) (ai-task-control-method-12 (-> arg1 ai-ctrl) arg1) (go-to-waypoint! arg1 24 #f) (ai-task-control-method-10 (-> arg1 ai-ctrl) arg1) @@ -1733,7 +1733,7 @@ ) (play-speech arg1 28) ) - (when (logtest? (-> arg1 bot-task-bits) 2) + (when (logtest? (-> arg1 bot-task-bits) (bot-task-bits botbits-1)) (ai-task-control-method-12 (-> arg1 ai-ctrl) arg1) (go-to-waypoint! arg1 25 #f) (ai-task-control-method-10 (-> arg1 ai-ctrl) arg1) @@ -1826,7 +1826,7 @@ (cond ((>= (- (current-time) (-> arg1 waypoint-time0)) (seconds 1.5)) (cond - ((logtest? (-> arg1 waypoint-bits) 1) + ((logtest? (-> arg1 waypoint-bits) (waypoint-bits wabits-0)) (when (and (not (speech-playing? arg1 29)) (not (speech-playing? arg1 30))) (if (zero? (get-rand-int arg1 2)) (play-speech arg1 29) @@ -1846,7 +1846,7 @@ (else (let ((a0-11 *target*)) (if (and a0-11 (focus-test? a0-11 hit)) - (logior! (-> arg1 waypoint-bits) 1) + (logior! (-> arg1 waypoint-bits) (waypoint-bits wabits-0)) ) ) ) @@ -2727,9 +2727,9 @@ (play-speech arg1 52) ) (cond - ((not (logtest? (-> arg1 waypoint-bits) 1)) + ((not (logtest? (-> arg1 waypoint-bits) (waypoint-bits wabits-0))) (when (>= (- (current-time) (-> arg1 waypoint-time0)) (seconds 0.5)) - (logior! (-> arg1 waypoint-bits) 1) + (logior! (-> arg1 waypoint-bits) (waypoint-bits wabits-0)) (let ((a1-5 (new 'stack-no-clear 'event-message-block))) (set! (-> a1-5 from) (process->ppointer pp)) (set! (-> a1-5 num-params) 0) @@ -2752,9 +2752,9 @@ ) #f ) - ((not (logtest? (-> arg1 waypoint-bits) 2)) + ((not (logtest? (-> arg1 waypoint-bits) (waypoint-bits wabits-1))) (when (>= (- (current-time) (-> arg1 waypoint-time0)) (seconds 4)) - (logior! (-> arg1 waypoint-bits) 2) + (logior! (-> arg1 waypoint-bits) (waypoint-bits wabits-1)) (let ((a1-10 (new 'stack-no-clear 'event-message-block))) (set! (-> a1-10 from) (process->ppointer pp)) (set! (-> a1-10 num-params) 0) @@ -2773,9 +2773,9 @@ ) #f ) - ((not (logtest? (-> arg1 waypoint-bits) 4)) + ((not (logtest? (-> arg1 waypoint-bits) (waypoint-bits wabits-2))) (when (>= (- (current-time) (-> arg1 waypoint-time0)) (seconds 5)) - (logior! (-> arg1 waypoint-bits) 4) + (logior! (-> arg1 waypoint-bits) (waypoint-bits wabits-2)) (let ((a1-11 (new 'stack-no-clear 'event-message-block))) (set! (-> a1-11 from) (process->ppointer pp)) (set! (-> a1-11 num-params) 0) @@ -2936,7 +2936,7 @@ (with-pp (logclear! (-> arg0 bot-flags) (bot-flags bf24)) (reset-warn-time! arg0) - (if (and (not (logtest? (-> arg0 bot-task-bits) 16)) (not (hal-sewer-method-231 arg0 24))) + (if (and (not (logtest? (-> arg0 bot-task-bits) (bot-task-bits botbits-4))) (not (hal-sewer-method-231 arg0 24))) (play-speech arg0 55) ) (let ((a1-2 (new 'stack-no-clear 'event-message-block))) @@ -2969,7 +2969,7 @@ (return #t) ) (cond - ((logtest? (-> arg1 bot-task-bits) 20) + ((logtest? (-> arg1 bot-task-bits) (bot-task-bits botbits-2 botbits-4)) (logclear! (-> arg1 bot-flags) (bot-flags bf24)) (reset-warn-time! arg1) (set! (-> arg1 waypoint-time0) (current-time)) @@ -3160,7 +3160,7 @@ (with-pp (logclear! (-> arg0 bot-flags) (bot-flags bf24)) (reset-warn-time! arg0) - (if (and (not (logtest? (-> arg0 bot-task-bits) 32)) (not (hal-sewer-method-231 arg0 27))) + (if (and (not (logtest? (-> arg0 bot-task-bits) (bot-task-bits botbits-5))) (not (hal-sewer-method-231 arg0 27))) (play-speech arg0 62) ) (let ((a1-2 (new 'stack-no-clear 'event-message-block))) @@ -3193,7 +3193,7 @@ (return #t) ) (cond - ((logtest? (-> arg1 bot-task-bits) 40) + ((logtest? (-> arg1 bot-task-bits) (bot-task-bits botbits-3 botbits-5)) (logclear! (-> arg1 bot-flags) (bot-flags bf24)) (reset-warn-time! arg1) (set! (-> arg1 waypoint-time0) (current-time)) @@ -3300,8 +3300,10 @@ ) ) ) - (when (and (logtest? (-> arg1 waypoint-bits) 1) (>= (- (current-time) (-> arg1 waypoint-time0)) (seconds 0.25))) - (logand! (-> arg1 waypoint-bits) -2) + (when (and (logtest? (-> arg1 waypoint-bits) (waypoint-bits wabits-0)) + (>= (- (current-time) (-> arg1 waypoint-time0)) (seconds 0.25)) + ) + (logclear! (-> arg1 waypoint-bits) (waypoint-bits wabits-0)) (let ((a1-1 (new 'stack-no-clear 'event-message-block))) (set! (-> a1-1 from) (process->ppointer pp)) (set! (-> a1-1 num-params) 0) @@ -3534,7 +3536,7 @@ (send-event s4-0 'skip) (send-event s3-0 'skip) ) - (logior! (-> arg0 waypoint-bits) 1) + (logior! (-> arg0 waypoint-bits) (waypoint-bits wabits-0)) (none) ) :check-too-far 'hal2-default-check-too-far diff --git a/goal_src/jak2/levels/tomb/tomb-obs.gc b/goal_src/jak2/levels/tomb/tomb-obs.gc index b5527270bc..a976109284 100644 --- a/goal_src/jak2/levels/tomb/tomb-obs.gc +++ b/goal_src/jak2/levels/tomb/tomb-obs.gc @@ -7,6 +7,13 @@ (define-extern *indax-bounce-mods* surface) +(defenum tomb-plat-flags + :bitfield #t + :type uint16 + (topflags-0) + (topflags-1) + ) + ;; DECOMP BEGINS (deftype tomb-plat-wall (plat) @@ -1415,13 +1422,13 @@ This commonly includes things such as: ) (deftype tomb-plat-return (base-plat) - ((intro-path path-control :offset-assert 272) - (ride-timer time-frame :offset-assert 280) - (flags uint16 :offset-assert 288) - (path-pos float :offset-assert 292) - (dest-pos float :offset-assert 296) - (path-speed float :offset-assert 300) - (sound-id sound-id :offset-assert 304) + ((intro-path path-control :offset-assert 272) + (ride-timer time-frame :offset-assert 280) + (flags tomb-plat-flags :offset-assert 288) + (path-pos float :offset-assert 292) + (dest-pos float :offset-assert 296) + (path-speed float :offset-assert 300) + (sound-id sound-id :offset-assert 304) ) :heap-base #xc0 :method-count-assert 39 @@ -1505,8 +1512,8 @@ This commonly includes things such as: :event (behavior ((proc process) (arg1 int) (event-type symbol) (event event-message-block)) (case event-type (('ridden) - (let ((v0-0 (the-as object (logior (-> self flags) 1)))) - (set! (-> self flags) (the-as uint v0-0)) + (let ((v0-0 (the-as object (logior (-> self flags) (tomb-plat-flags topflags-0))))) + (set! (-> self flags) (the-as tomb-plat-flags v0-0)) v0-0 ) ) @@ -1521,9 +1528,9 @@ This commonly includes things such as: (none) ) :trans (behavior () - (logand! (-> self flags) -2) + (logclear! (-> self flags) (tomb-plat-flags topflags-0)) (plat-trans) - (if (not (logtest? (-> self flags) 1)) + (if (not (logtest? (-> self flags) (tomb-plat-flags topflags-0))) (set! (-> self ride-timer) (current-time)) ) (when (>= (- (current-time) (-> self ride-timer)) (seconds 0.5)) @@ -1544,8 +1551,8 @@ This commonly includes things such as: :event (behavior ((proc process) (arg1 int) (event-type symbol) (event event-message-block)) (case event-type (('ridden) - (let ((v0-0 (the-as object (logior (-> self flags) 1)))) - (set! (-> self flags) (the-as uint v0-0)) + (let ((v0-0 (the-as object (logior (-> self flags) (tomb-plat-flags topflags-0))))) + (set! (-> self flags) (the-as tomb-plat-flags v0-0)) v0-0 ) ) @@ -1668,7 +1675,7 @@ This commonly includes things such as: (the-as pair 0) ) (stop-bouncing! obj) - (set! (-> obj flags) (the-as uint 0)) + (set! (-> obj flags) (tomb-plat-flags)) (set! (-> obj path-pos) 0.0) (let ((s4-1 (new 'process 'curve-control obj 'path -1000000000.0))) (if (logtest? (-> s4-1 flags) (path-control-flag not-found)) diff --git a/goal_src/jak2/levels/tomb/tomb-water.gc b/goal_src/jak2/levels/tomb/tomb-water.gc index 36cfa882bd..1689f6499d 100644 --- a/goal_src/jak2/levels/tomb/tomb-water.gc +++ b/goal_src/jak2/levels/tomb/tomb-water.gc @@ -31,6 +31,15 @@ (declare-type tomb-simon-block base-plat) (define-extern tomb-simon-block-init-by-other (function vector int int int int none :behavior tomb-simon-block)) +(defenum tomb-vibe-flags + :bitfield #t + :type uint16 + (tovflags-0) + (tovflags-1) + (tovflags-2) + (tovflags-3) + ) + ;; DECOMP BEGINS (deftype tomb-door (process-drawable) @@ -1849,7 +1858,7 @@ This commonly includes things such as: (pat-duration time-frame :offset-assert 248) (actor-group (pointer actor-group) :offset-assert 256) (actor-group-count int32 :offset-assert 260) - (flags uint16 :offset-assert 264) + (flags tomb-vibe-flags :offset-assert 264) (on-activate basic :offset-assert 268) ) :heap-base #x90 @@ -1937,7 +1946,7 @@ This commonly includes things such as: ((and (= (-> v1-0 0) (-> self pat-tbl (-> self pat-index))) (!= (-> gp-0 0) (process->handle self))) (send-event (handle->process (-> gp-0 0)) 'interrupt) (send-event (handle->process (-> gp-0 0)) 'die) - (logior! (-> self flags) 1) + (logior! (-> self flags) (tomb-vibe-flags tovflags-0)) (go-virtual vibrate) ) (else @@ -1982,17 +1991,17 @@ This commonly includes things such as: ) ) (when gp-0 - (when (and (not (logtest? (-> self flags) 2)) + (when (and (not (logtest? (-> self flags) (tomb-vibe-flags tovflags-1))) (< (vector-vector-distance (-> self root trans) (get-trans gp-0 0)) 102400.0) ) (set-setting! 'sound-mode #f 0.0 2) - (logior! (-> self flags) 2) + (logior! (-> self flags) (tomb-vibe-flags tovflags-1)) ) - (when (and (logtest? (-> self flags) 2) + (when (and (logtest? (-> self flags) (tomb-vibe-flags tovflags-1)) (< 184320.0 (vector-vector-distance (-> self root trans) (get-trans gp-0 0))) ) (remove-setting! 'sound-mode) - (logand! (-> self flags) -3) + (logclear! (-> self flags) (tomb-vibe-flags tovflags-1)) ) ) ) @@ -2090,7 +2099,7 @@ This commonly includes things such as: ) ) (process-release? *target*) - (if (logtest? (-> self flags) 1) + (if (logtest? (-> self flags) (tomb-vibe-flags tovflags-0)) (go-virtual die #f) (go-virtual idle) ) @@ -2277,7 +2286,7 @@ This commonly includes things such as: (joint-control-channel-group! a0-53 (the-as art-joint-anim (-> obj draw art-group data 3)) num-func-identity) ) (transform-post) - (set! (-> obj flags) (the-as uint 0)) + (set! (-> obj flags) (tomb-vibe-flags)) (set! (-> obj event-hook) (-> (method-of-type tomb-vibe idle) event)) (cond ((logtest? (-> obj entity extra perm status) (entity-perm-status subtask-complete)) diff --git a/goal_src/jak2/levels/under/sig5-course.gc b/goal_src/jak2/levels/under/sig5-course.gc index ff2616d04b..8232879f57 100644 --- a/goal_src/jak2/levels/under/sig5-course.gc +++ b/goal_src/jak2/levels/under/sig5-course.gc @@ -129,11 +129,11 @@ (with-pp (case arg2 (('set-task) - (let* ((s1-1 (logtest? (-> obj bot-task-bits) 16)) + (let* ((s1-1 (logtest? (-> obj bot-task-bits) (bot-task-bits botbits-4))) (t9-0 (method-of-type sig general-event-handler)) (s5-1 (t9-0 obj arg0 arg1 arg2 arg3)) ) - (when (and (not s1-1) (logtest? (-> obj bot-task-bits) 16)) + (when (and (not s1-1) (logtest? (-> obj bot-task-bits) (bot-task-bits botbits-4))) (let ((a1-2 (new 'stack-no-clear 'event-message-block))) (set! (-> a1-2 from) (process->ppointer pp)) (set! (-> a1-2 num-params) 0) @@ -180,7 +180,7 @@ ;; WARN: disable def twice: 39. This may happen when a cond (no else) is nested inside of another conditional, but it should be rare. (defmethod sig-under-method-262 sig-under ((obj sig-under) (arg0 symbol)) - (when (or (logtest? (-> obj bot-task-bits) 2) + (when (or (logtest? (-> obj bot-task-bits) (bot-task-bits botbits-1)) (and arg0 (let ((f0-0 81920.0)) (>= (* f0-0 f0-0) (vector-vector-xz-distance-squared (target-pos 0) (-> obj root trans))) ) @@ -200,7 +200,7 @@ ) (defmethod sig-under-method-264 sig-under ((obj sig-under)) - (and (logtest? (-> obj bot-task-bits) 8) + (and (logtest? (-> obj bot-task-bits) (bot-task-bits botbits-3)) (not (channel-active? obj (the-as uint 0))) (scene-play obj "under-get-sig-out-res" #f) ) @@ -382,7 +382,7 @@ (until #f (let ((gp-0 (get-rand-int self 2))) (let ((s5-0 (new 'stack-no-clear 'vector))) - (if (and (not (logtest? (-> self bot-task-bits) 1)) (zero? gp-0)) + (if (and (not (logtest? (-> self bot-task-bits) (bot-task-bits botbits-0))) (zero? gp-0)) (set! (-> s5-0 quad) (-> self sig5-course spots 2 center quad)) (set! (-> s5-0 quad) (-> self sig5-course spots 1 center quad)) ) @@ -480,7 +480,7 @@ ;; WARN: Return type mismatch int vs symbol. (defun sig5-default-check-too-far ((arg0 sig-under)) (let ((v0-0 (bot-simple-check-too-far arg0))) - (if (logtest? (-> arg0 bot-task-bits) 4) + (if (logtest? (-> arg0 bot-task-bits) (bot-task-bits botbits-2)) (set! v0-0 2) ) (the-as symbol v0-0) @@ -536,7 +536,7 @@ (the-as (function sigt-wait-spot sig symbol) (lambda ((arg0 object) (arg1 sig-under)) - (if (not (and (logtest? (-> arg1 bot-task-bits) 1) + (if (not (and (logtest? (-> arg1 bot-task-bits) (bot-task-bits botbits-0)) *target* (not (logtest? (-> *target* focus-status) (focus-status dead in-air edge-grab))) ) @@ -602,7 +602,7 @@ :nav-mesh-index -1 :skip-to -1 :on-set (lambda ((arg0 sig-under)) - (logand! (-> arg0 bot-task-bits) -5) + (logclear! (-> arg0 bot-task-bits) (bot-task-bits botbits-2)) (logior! (-> arg0 bot-flags) (bot-flags bf06)) (logior! (-> arg0 enemy-flags) (enemy-flag enable-on-active checking-water)) (set! (-> arg0 notice-enemy-dist) 122880.0) @@ -1178,8 +1178,8 @@ (function sigt-wait-spot sig symbol) (lambda ((arg0 object) (arg1 sig-under)) (with-pp - (when (not (logtest? (-> arg1 waypoint-bits) 1)) - (logior! (-> arg1 waypoint-bits) 1) + (when (not (logtest? (-> arg1 waypoint-bits) (waypoint-bits wabits-0))) + (logior! (-> arg1 waypoint-bits) (waypoint-bits wabits-0)) (let ((a1-1 (new 'stack-no-clear 'event-message-block))) (set! (-> a1-1 from) (process->ppointer pp)) (set! (-> a1-1 num-params) 0) @@ -1229,8 +1229,8 @@ (the-as (function sigt-wait-spot sig symbol) (lambda ((arg0 object) (arg1 sig-under)) - (when (and (not (logtest? (-> arg1 waypoint-bits) 1)) (+ (current-time) (seconds -6))) - (logior! (-> arg1 waypoint-bits) 1) + (when (and (not (logtest? (-> arg1 waypoint-bits) (waypoint-bits wabits-0))) (+ (current-time) (seconds -6))) + (logior! (-> arg1 waypoint-bits) (waypoint-bits wabits-0)) (set-setting! 'music 'danger3 0.0 0) ) #f @@ -1332,17 +1332,17 @@ (play-speech arg1 12) ) (cond - ((not (logtest? (-> arg1 waypoint-bits) 1)) - (logior! (-> arg1 waypoint-bits) 1) + ((not (logtest? (-> arg1 waypoint-bits) (waypoint-bits wabits-0))) + (logior! (-> arg1 waypoint-bits) (waypoint-bits wabits-0)) (process-release? arg1) (sig-under-method-260 arg1) (move-to-point! (-> arg1 root) (the-as vector (-> arg1 sig5-course spots 20))) #f ) - ((not (logtest? (-> arg1 waypoint-bits) 2)) + ((not (logtest? (-> arg1 waypoint-bits) (waypoint-bits wabits-1))) (when (>= (- (current-time) (-> arg1 waypoint-time0)) (seconds 2)) (remove-setting! 'entity-name) - (logior! (-> arg1 waypoint-bits) 2) + (logior! (-> arg1 waypoint-bits) (waypoint-bits wabits-1)) (add-process *gui-control* arg1 (gui-channel art-load) (gui-action queue) "under-centipede-three" -99.0 0) ) #f @@ -1398,7 +1398,7 @@ (lambda ((arg0 object) (arg1 sig-under)) (local-vars (v1-14 symbol)) (with-pp - (when (logtest? (-> arg1 waypoint-bits) 1) + (when (logtest? (-> arg1 waypoint-bits) (waypoint-bits wabits-0)) (let ((a1-1 (new 'stack-no-clear 'event-message-block))) (set! (-> a1-1 from) (process->ppointer pp)) (set! (-> a1-1 num-params) 0) @@ -1483,7 +1483,7 @@ (clear-poi-and-focus! arg0) (set! (-> arg0 focus-mode) 0) (set! (-> arg0 root penetrated-by) (get-penetrate-info arg0)) - (logior! (-> arg0 waypoint-bits) 1) + (logior! (-> arg0 waypoint-bits) (waypoint-bits wabits-0)) (send-event arg0 'move-trans (-> arg0 sig5-course spots 21)) (send-event *target* 'continue (get-continue-by-name *game-info* "sig5-skip-to-cent2")) (react-to-focus arg0) @@ -1498,7 +1498,7 @@ :on-set (lambda ((arg0 sig-under)) (stop-speech arg0 (the-as uint 0) #f) (set-setting! 'music 'danger7 0.0 0) - (logand! (-> arg0 bot-task-bits) -9) + (logclear! (-> arg0 bot-task-bits) (bot-task-bits botbits-3)) (let ((v1-7 (get-task-by-type (-> arg0 ai-ctrl) sigt-wait-spot arg0))) (set! (-> v1-7 bytes 5) 1) (set! (-> v1-7 bytes 6) 23) @@ -1609,14 +1609,14 @@ (ai-task-control-method-10 (-> arg1 ai-ctrl) arg1) (return #t) ) - (if (not (logtest? (-> arg1 bot-task-bits) 16)) + (if (not (logtest? (-> arg1 bot-task-bits) (bot-task-bits botbits-4))) (set! (-> arg1 waypoint-time0) (current-time)) ) - (when (and (not (logtest? (-> arg1 waypoint-bits) 2)) + (when (and (not (logtest? (-> arg1 waypoint-bits) (waypoint-bits wabits-1))) (>= (- (current-time) (-> arg1 waypoint-time0)) (seconds 0.5)) (not (logtest? (-> arg1 focus-status) (focus-status in-air))) ) - (logior! (-> arg1 waypoint-bits) 2) + (logior! (-> arg1 waypoint-bits) (waypoint-bits wabits-1)) (logior! (-> arg1 enemy-flags) (enemy-flag enable-on-active checking-water)) ) (if (and (>= (- (current-time) (-> arg1 waypoint-time0)) (seconds 1)) @@ -1639,8 +1639,8 @@ ) (or (nonzero? (-> arg1 next-chase-play-time)) (>= (- (current-time) (-> arg1 waypoint-time0)) (seconds 6))) ) - (when (not (logtest? (-> arg1 waypoint-bits) 1)) - (logior! (-> arg1 waypoint-bits) 1) + (when (not (logtest? (-> arg1 waypoint-bits) (waypoint-bits wabits-0))) + (logior! (-> arg1 waypoint-bits) (waypoint-bits wabits-0)) (send-event (ppointer->process (-> arg1 my-simple-focus)) 'move-trans (-> arg1 sig5-course spots 32)) (set! (-> arg1 poi-handle) (ppointer->handle (-> arg1 my-simple-focus))) ) @@ -1707,11 +1707,11 @@ (the-as (function sigt-wait-spot sig symbol) (lambda ((arg0 object) (arg1 sig-under)) - (when (and (not (logtest? (-> arg1 waypoint-bits) 1)) + (when (and (not (logtest? (-> arg1 waypoint-bits) (waypoint-bits wabits-0))) (>= (- (current-time) (-> arg1 waypoint-time0)) (seconds 0.5)) (not (logtest? (-> arg1 focus-status) (focus-status in-air))) ) - (logior! (-> arg1 waypoint-bits) 1) + (logior! (-> arg1 waypoint-bits) (waypoint-bits wabits-0)) (logior! (-> arg1 enemy-flags) (enemy-flag enable-on-active checking-water)) ) (cond diff --git a/goal_src/jak2/levels/under/under-shoot-block.gc b/goal_src/jak2/levels/under/under-shoot-block.gc index 13dd25f97b..fdd58c2018 100644 --- a/goal_src/jak2/levels/under/under-shoot-block.gc +++ b/goal_src/jak2/levels/under/under-shoot-block.gc @@ -5,6 +5,13 @@ ;; name in dgo: under-shoot-block ;; dgos: UNB +(defenum under-block-flags + :bitfield #t + (unbflags-0) + (unbflags-1) + (unbflags-2) + ) + ;; DECOMP BEGINS (deftype under-block-spawner (basic) @@ -629,7 +636,7 @@ (pulse-op int8 :offset-assert 224) (pulse-pc int8 :offset-assert 225) (pulse-ctr int8 :offset-assert 226) - (flags uint64 :offset-assert 232) + (flags under-block-flags :offset-assert 232) (activated-time time-frame :offset-assert 240) (rot-axis vector :inline :offset-assert 256) (away-from-focal-pt vector :inline :offset-assert 272) @@ -695,18 +702,18 @@ (('track) (cond ((-> arg3 param 0) - (if (logtest? (-> self flags) 1) + (if (logtest? (-> self flags) (under-block-flags unbflags-0)) #t 'abort ) ) (else - (logtest? (-> self flags) 1) + (logtest? (-> self flags) (under-block-flags unbflags-0)) ) ) ) (('attack) - (when (logtest? (-> self flags) 1) + (when (logtest? (-> self flags) (under-block-flags unbflags-0)) (let ((gp-0 (the-as attack-info (-> arg3 param 1)))) (when (and (!= (-> gp-0 id) (-> self prev-attack-id)) (!= (-> gp-0 id) (-> self puzzle prev-special-attack-id))) (let ((s5-0 (get-penetrate-using-from-attack-event (the-as process-drawable arg0) arg3))) @@ -746,7 +753,7 @@ (set! (-> self move-dir-x) s5-1) (set! (-> self move-dir-z) gp-1) (under-block-method-48 self (+ (-> self col) s5-1) (+ (-> self row) gp-1)) - (logand! (-> self flags) -2) + (logclear! (-> self flags) (under-block-flags unbflags-0)) (if (zero? (-> self activated-time)) (under-block-method-42 self) ) @@ -755,7 +762,7 @@ ((under-block-method-49 self s5-1 gp-1) (set! (-> self move-dir-x) s5-1) (set! (-> self move-dir-z) gp-1) - (logand! (-> self flags) -2) + (logclear! (-> self flags) (under-block-flags unbflags-0)) (go-virtual rock) ) ((and (-> self next-state) (= (-> self next-state name) 'idle)) @@ -859,7 +866,7 @@ (defmethod under-block-method-42 under-block ((obj under-block)) (set! (-> obj activated-time) (current-time)) - (logior! (-> obj flags) 2) + (logior! (-> obj flags) (under-block-flags unbflags-1)) (set! (-> obj pulse-pc) 0) (set! (-> obj pulse-op) 0) 0 @@ -870,7 +877,7 @@ ;; WARN: Function (method 45 under-block) has a return type of none, but the expression builder found a return statement. (defmethod under-block-method-45 under-block ((obj under-block)) (let ((v1-0 (-> obj puzzle))) - (when (logtest? (-> obj flags) 2) + (when (logtest? (-> obj flags) (under-block-flags unbflags-1)) (cond ((!= (-> v1-0 slot-mask) (-> v1-0 slot-mask-full)) (when (zero? (-> obj pulse-op)) @@ -918,7 +925,7 @@ ) ) (else - (logand! (-> obj flags) -3) + (logclear! (-> obj flags) (under-block-flags unbflags-1)) (set-vector! (-> obj draw color-mult) 1.0 1.0 1.0 1.0) (set-vector! (-> obj draw color-emissive) 0.0 0.0 0.0 1.0) ) @@ -1184,15 +1191,16 @@ (defmethod under-block-method-50 under-block ((obj under-block)) (with-pp - (let ((s5-0 (new 'stack 'joint-exploder-tuning (the-as uint (if (logtest? (-> obj flags) 4) - 1 - 0 - ) - ) - ) - ) + (let ((s5-0 + (new 'stack 'joint-exploder-tuning (the-as uint (if (logtest? (-> obj flags) (under-block-flags unbflags-2)) + 1 + 0 + ) + ) + ) + ) ) - (when (logtest? (-> obj flags) 4) + (when (logtest? (-> obj flags) (under-block-flags unbflags-2)) (set! (-> s5-0 fountain-rand-transv-lo quad) (-> obj away-from-focal-pt quad)) (set! (-> s5-0 fountain-rand-transv-hi x) 24576.0) (set! (-> s5-0 fountain-rand-transv-hi y) 49152.0) @@ -1228,7 +1236,7 @@ :virtual #t :event under-block-event-handler :enter (behavior () - (logand! (-> self flags) -2) + (logclear! (-> self flags) (under-block-flags unbflags-0)) (none) ) :code (the-as (function none :behavior under-block) sleep-code) @@ -1239,7 +1247,7 @@ :event under-block-event-handler :trans (the-as (function none :behavior under-block) rider-trans) :code (behavior () - (logand! (-> self flags) -2) + (logclear! (-> self flags) (under-block-flags unbflags-0)) (while (not (under-block-method-48 self (-> self col) (-> self row))) (suspend) ) @@ -1273,7 +1281,7 @@ :event under-block-event-handler :trans (the-as (function none :behavior under-block) rider-trans) :code (behavior () - (logand! (-> self flags) -2) + (logclear! (-> self flags) (under-block-flags unbflags-0)) (set! (-> self state-time) (current-time)) (let ((gp-0 (new 'stack-no-clear 'matrix))) (set! (-> gp-0 vector 0 quad) (-> self root trans quad)) @@ -1302,7 +1310,7 @@ :virtual #t :event under-block-event-handler :enter (behavior () - (logior! (-> self flags) 1) + (logior! (-> self flags) (under-block-flags unbflags-0)) (under-block-method-41 self 'active) (none) ) @@ -1313,12 +1321,12 @@ :virtual #t :event under-block-event-handler :enter (behavior () - (logior! (-> self flags) 1) + (logior! (-> self flags) (under-block-flags unbflags-0)) (under-block-method-41 self 'active) (none) ) :exit (behavior () - (logand! (-> self flags) -2) + (logclear! (-> self flags) (under-block-flags unbflags-0)) (none) ) :trans (behavior () @@ -1524,7 +1532,7 @@ :virtual #t :event under-block-event-handler :enter (behavior () - (logand! (-> self flags) -2) + (logclear! (-> self flags) (under-block-flags unbflags-0)) (none) ) :trans (behavior () @@ -1599,7 +1607,7 @@ :virtual #t :event under-block-event-handler :enter (behavior () - (logand! (-> self flags) -2) + (logclear! (-> self flags) (under-block-flags unbflags-0)) (under-block-method-41 self 'beaten) (none) ) @@ -1610,7 +1618,7 @@ :virtual #t :event under-block-event-handler :enter (behavior () - (logand! (-> self flags) -2) + (logclear! (-> self flags) (under-block-flags unbflags-0)) (logclear! (-> self mask) (process-mask actor-pause)) (under-block-method-41 self 'fall) (none) @@ -1650,7 +1658,7 @@ (when (and (logtest? (-> (the-as collide-shape-moving gp-0) status) (collide-status touch-surface)) (>= (- (current-time) (-> self state-time)) (seconds 0.01)) ) - (logior! (-> self flags) 4) + (logior! (-> self flags) (under-block-flags unbflags-2)) (go-virtual explode) ) ) @@ -1663,7 +1671,7 @@ :virtual #t :event under-block-event-handler :enter (behavior () - (logand! (-> self flags) -2) + (logclear! (-> self flags) (under-block-flags unbflags-0)) (under-block-method-46 self (-> self col) (-> self row)) (let ((v1-4 (-> self puzzle))) (countdown (a0-3 (-> v1-4 slots length)) diff --git a/test/decompiler/reference/jak2/decompiler-macros.gc b/test/decompiler/reference/jak2/decompiler-macros.gc index caeead0957..6d0b0f572f 100644 --- a/test/decompiler/reference/jak2/decompiler-macros.gc +++ b/test/decompiler/reference/jak2/decompiler-macros.gc @@ -624,6 +624,22 @@ `(logtest? (cpad-hold ,pad-idx) (pad-buttons ,@buttons)) ) +(defmacro mouse-pressed () + `(-> *mouse* button0-rel 0) + ) + +(defmacro mouse-hold () + `(-> *mouse* button0-abs 0) + ) + +(defmacro mouse-pressed? (&rest buttons) + `(logtest? (mouse-pressed) (mouse-buttons ,@buttons)) + ) + +(defmacro mouse-hold? (&rest buttons) + `(logtest? (mouse-hold) (mouse-buttons ,@buttons)) + ) + (defmacro res-lump-data (lump name type &key (tag-ptr (the-as (pointer res-tag) #f)) &key (time -1000000000.0)) "Helper macro to get data from a res-lump without interpolation." `(the-as ,type ((method-of-type res-lump get-property-data) diff --git a/test/decompiler/reference/jak2/engine/camera/cam-interface_REF.gc b/test/decompiler/reference/jak2/engine/camera/cam-interface_REF.gc index cd8d997a57..ab2ebd38c5 100644 --- a/test/decompiler/reference/jak2/engine/camera/cam-interface_REF.gc +++ b/test/decompiler/reference/jak2/engine/camera/cam-interface_REF.gc @@ -21,7 +21,7 @@ ) ;; definition for function matrix-local->world -(defun matrix-local->world ((smooth? symbol)) +(defun matrix-local->world ((smooth? symbol) (arg1 symbol)) "Returns [[*math-camera*]]'s `inv-camera-rot-smooth` if `smooth?` is true, else return `inv-camera-rot`" (if smooth? (-> *math-camera* inv-camera-rot-smooth) diff --git a/test/decompiler/reference/jak2/engine/camera/cam-states-dbg_REF.gc b/test/decompiler/reference/jak2/engine/camera/cam-states-dbg_REF.gc index 3477ccc636..1400f87fb4 100644 --- a/test/decompiler/reference/jak2/engine/camera/cam-states-dbg_REF.gc +++ b/test/decompiler/reference/jak2/engine/camera/cam-states-dbg_REF.gc @@ -128,7 +128,7 @@ (let ((v1-0 (new 'stack-no-clear 'vector))) (vector-! v1-0 (the-as vector (-> *mouse* pos)) (-> *mouse* pos 1)) (cond - ((logtest? (-> *mouse* button0-abs 0) 1) + ((mouse-hold? left) (let ((a0-7 (new 'stack-no-clear 'vector))) 0.0 (vector-! a0-7 (-> *math-camera* trans) (-> *setting-control* cam-current mouse-tumble-point)) @@ -161,11 +161,11 @@ ) ) ) - ((logtest? (-> *mouse* button0-abs 0) 2) + ((mouse-hold? right) (+! (-> arg1 x) (* (-> v1-0 x) (-> *CAM_FREE-bank* speed))) (set! (-> arg1 z) (+ (-> arg1 z) (* (-> v1-0 y) (-> *CAM_FREE-bank* speed)))) ) - ((logtest? (-> *mouse* button0-abs 0) 4) + ((mouse-hold? middle) (+! (-> arg1 x) (* (-> v1-0 x) (-> *CAM_FREE-bank* speed))) (set! (-> arg1 y) (+ (-> arg1 y) (* (-> v1-0 y) (-> *CAM_FREE-bank* speed)))) ) @@ -514,3 +514,7 @@ (none) ) ) + + + + 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 fdec923050..d302d0ddea 100644 --- a/test/decompiler/reference/jak2/engine/common_objs/water_REF.gc +++ b/test/decompiler/reference/jak2/engine/common_objs/water_REF.gc @@ -1160,7 +1160,7 @@ ) ((and (logtest? (focus-status dark) (-> obj process focus-status)) (nonzero? (-> obj process darkjak)) - (logtest? (-> obj process darkjak stage) 32) + (logtest? (-> obj process darkjak stage) (darkjak-stage giant)) ) (set! (-> obj swim-height) 16384.0) ) diff --git a/test/decompiler/reference/jak2/engine/debug/debug_REF.gc b/test/decompiler/reference/jak2/engine/debug/debug_REF.gc index 56ad4cac08..5ab7d71a8c 100644 --- a/test/decompiler/reference/jak2/engine/debug/debug_REF.gc +++ b/test/decompiler/reference/jak2/engine/debug/debug_REF.gc @@ -1605,6 +1605,7 @@ ) ;; definition for method 3 of type debug-vertex-stats +;; INFO: this function exists in multiple non-identical object files (defmethod inspect debug-vertex-stats ((obj debug-vertex-stats)) (format #t "[~8x] ~A~%" obj (-> obj type)) (format #t "~Tlength: ~D~%" (-> obj length)) @@ -1726,8 +1727,7 @@ ;; definition (debug) for function add-debug-cursor ;; INFO: Used lq/sq -;; WARN: Return type mismatch int vs none. -(defun-debug add-debug-cursor ((enable symbol) (bucket bucket-id) (x int) (y int) (arg4 int)) +(defun-debug add-debug-cursor ((enable symbol) (bucket bucket-id) (x int) (y int) (arg4 mouse-buttons)) (when enable (with-dma-buffer-add-bucket ((buf (-> *display* frames (-> *display* on-screen) global-buf)) bucket @@ -1740,13 +1740,13 @@ (+ x -5) (+ y -4) (cond - ((= v1-7 1) + ((= v1-7 (mouse-buttons left)) (font-color red) ) - ((= v1-7 2) + ((= v1-7 (mouse-buttons right)) (font-color yellow) ) - ((= v1-7 4) + ((= v1-7 (mouse-buttons middle)) (font-color green) ) (else @@ -1759,7 +1759,6 @@ ) ) 0 - (none) ) ;; this part is debug only 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 c647888442..df3c605251 100644 --- a/test/decompiler/reference/jak2/engine/debug/default-menu_REF.gc +++ b/test/decompiler/reference/jak2/engine/debug/default-menu_REF.gc @@ -3989,7 +3989,7 @@ ) (logior! (-> *game-info* features) (game-feature darkjak)) (logior! (-> *game-info* debug-features) (game-feature darkjak)) - (send-event *target* 'change-mode 'darkjak #f 3) + (send-event *target* 'change-mode 'darkjak #f (darkjak-stage force-on active)) ) ) (function "indax" #f ,(lambda () @@ -4050,7 +4050,7 @@ ) (logior! (-> *game-info* features) (game-feature darkjak)) (logior! (-> *game-info* debug-features) (game-feature darkjak)) - (send-event *target* 'change-mode 'darkjak #f 3) + (send-event *target* 'change-mode 'darkjak #f (darkjak-stage force-on active)) ) ) (function "rapid" #f ,(lambda ((arg0 object) (arg1 debug-menu-msg)) @@ -4059,37 +4059,46 @@ ) (logior! (-> *game-info* features) (game-feature darkjak)) (logior! (-> *game-info* debug-features) (game-feature darkjak)) - (send-event *target* 'change-mode 'darkjak #f 2) + (send-event *target* 'change-mode 'darkjak #f (darkjak-stage active)) ) ) (function "bomb0" #f ,(lambda ((arg0 object) (arg1 debug-menu-msg)) (if (not *target*) (start 'debug (get-current-continue-forced *game-info*)) ) - (send-event *target* 'change-mode 'darkjak #f 7) - ) - ) - (function "bomb1" #f ,(lambda ((arg0 object) (arg1 debug-menu-msg)) - (if (not *target*) - (start 'debug (get-current-continue-forced *game-info*)) - ) - (send-event *target* 'change-mode 'darkjak #f 15) - ) - ) - (function "invinc" #f ,(lambda ((arg0 object) (arg1 debug-menu-msg)) - (if (not *target*) - (start 'debug (get-current-continue-forced *game-info*)) - ) - (send-event *target* 'change-mode 'darkjak #f 31) - ) - ) - (function "giant" #f ,(lambda ((arg0 object) (arg1 debug-menu-msg)) - (if (not *target*) - (start 'debug (get-current-continue-forced *game-info*)) - ) - (send-event *target* 'change-mode 'darkjak #f 63) + (send-event *target* 'change-mode 'darkjak #f (darkjak-stage force-on active bomb0)) ) ) + (function + "bomb1" + #f + ,(lambda ((arg0 object) (arg1 debug-menu-msg)) + (if (not *target*) + (start 'debug (get-current-continue-forced *game-info*)) + ) + (send-event *target* 'change-mode 'darkjak #f (darkjak-stage force-on active bomb0 bomb1)) + ) + ) + (function + "invinc" + #f + ,(lambda ((arg0 object) (arg1 debug-menu-msg)) + (if (not *target*) + (start 'debug (get-current-continue-forced *game-info*)) + ) + (send-event *target* 'change-mode 'darkjak #f (darkjak-stage force-on active bomb0 bomb1 invinc)) + ) + ) + (function + "giant" + #f + ,(lambda ((arg0 object) (arg1 debug-menu-msg)) + (if (not *target*) + (start 'debug (get-current-continue-forced *game-info*)) + ) + (send-event *target* 'change-mode 'darkjak #f (darkjak-stage force-on active bomb0 bomb1 invinc giant)) + ) + ) ) (menu "Gun" @@ -6092,7 +6101,7 @@ ) (logior! (-> *game-info* features) (game-feature darkjak)) (logior! (-> *game-info* debug-features) (game-feature darkjak)) - (send-event *target* 'change-mode 'darkjak #f 3) + (send-event *target* 'change-mode 'darkjak #f (darkjak-stage force-on active)) ) ) (function "indax" #f ,(lambda () diff --git a/test/decompiler/reference/jak2/engine/debug/editable-player_REF.gc b/test/decompiler/reference/jak2/engine/debug/editable-player_REF.gc index 4ce9b97614..f3fed86adb 100644 --- a/test/decompiler/reference/jak2/engine/debug/editable-player_REF.gc +++ b/test/decompiler/reference/jak2/engine/debug/editable-player_REF.gc @@ -1460,19 +1460,19 @@ *stdcon* "~16S~16S~16S~%" (editable-command->string - (if (and (nonzero? (-> obj command 1)) (or (zero? (-> obj command 0)) (logtest? (-> *mouse* button0-abs 0) 1))) + (if (and (nonzero? (-> obj command 1)) (or (zero? (-> obj command 0)) (mouse-hold? left))) (the-as editable-command (-> obj command 1)) (the-as editable-command (-> obj command 0)) ) ) (editable-command->string - (if (and (nonzero? (-> obj command 5)) (or (zero? (-> obj command 4)) (logtest? (-> *mouse* button0-abs 0) 4))) + (if (and (nonzero? (-> obj command 5)) (or (zero? (-> obj command 4)) (mouse-hold? middle))) (the-as editable-command (-> obj command 5)) (the-as editable-command (-> obj command 4)) ) ) (editable-command->string - (if (and (nonzero? (-> obj command 3)) (or (zero? (-> obj command 2)) (logtest? (-> *mouse* button0-abs 0) 2))) + (if (and (nonzero? (-> obj command 3)) (or (zero? (-> obj command 2)) (mouse-hold? right))) (the-as editable-command (-> obj command 3)) (the-as editable-command (-> obj command 2)) ) @@ -2026,19 +2026,19 @@ ) ) ) - (if (logtest? (-> *mouse* button0-rel 0) 1) + (if (mouse-pressed? left) (editable-array-method-9 gp-0 (the-as editable-command (-> self command 0)) (the-as editable-array *mouse*)) ) - (if (logtest? (-> *mouse* button0-abs 0) 1) + (if (mouse-hold? left) (editable-array-method-9 gp-0 (the-as editable-command (-> self command 1)) (the-as editable-array *mouse*)) ) - (if (logtest? (-> *mouse* button0-rel 0) 2) + (if (mouse-pressed? right) (editable-array-method-9 gp-0 (the-as editable-command (-> self command 2)) (the-as editable-array *mouse*)) ) - (if (logtest? (-> *mouse* button0-abs 0) 2) + (if (mouse-hold? right) (editable-array-method-9 gp-0 (the-as editable-command (-> self command 3)) (the-as editable-array *mouse*)) ) - (when (logtest? (-> *mouse* button0-rel 0) 4) + (when (mouse-pressed? middle) (let ((a2-11 (-> self command 4))) (case a2-11 ((36) @@ -2053,7 +2053,7 @@ ) ) ) - (if (logtest? (-> *mouse* button0-abs 0) 4) + (if (mouse-hold? middle) (editable-array-method-9 gp-0 (the-as editable-command (-> self command 5)) (the-as editable-array *mouse*)) ) ) @@ -2619,3 +2619,7 @@ *debug-hook* ) ) + + + + diff --git a/test/decompiler/reference/jak2/engine/debug/nav/nav-graph-editor_REF.gc b/test/decompiler/reference/jak2/engine/debug/nav/nav-graph-editor_REF.gc index b9356d68df..7716a92351 100644 --- a/test/decompiler/reference/jak2/engine/debug/nav/nav-graph-editor_REF.gc +++ b/test/decompiler/reference/jak2/engine/debug/nav/nav-graph-editor_REF.gc @@ -1539,7 +1539,7 @@ (nav-graph-editor-method-34 obj) (nav-graph-editor-method-32 obj (-> obj selected-node-edge?) (-> obj selected-index)) (cond - ((not (logtest? (-> *mouse* button0-abs 0) 1)) + ((not (mouse-hold? left)) (let ((a0-4 (nav-graph-editor-method-49 obj))) (vector-! (-> a0-4 move-vec) @@ -1590,12 +1590,12 @@ (defstate adjust-plane (nav-graph-editor) :virtual #t :trans (behavior () - (if (logtest? (-> *mouse* button0-abs 0) 1) + (if (mouse-hold? left) (go-virtual move-plane) ) - (when (and (logtest? (-> *mouse* button0-abs 0) 4) (>= (-> self selected-index) 0)) - (logand! (-> *mouse* button0-abs 0) -5) - (logand! (-> *mouse* button0-rel 0) -5) + (when (and (mouse-hold? middle) (>= (-> self selected-index) 0)) + (logclear! (-> *mouse* button0-abs 0) (mouse-buttons middle)) + (logclear! (-> *mouse* button0-rel 0) (mouse-buttons middle)) (set! (-> self plane-height) (-> self nav-graph node-array data (-> self selected-index) position y)) ) (nav-graph-editor-method-41 self) @@ -1622,7 +1622,7 @@ (none) ) :trans (behavior () - (if (not (logtest? (-> *mouse* button0-abs 0) 1)) + (if (not (mouse-hold? left)) (go-virtual adjust-plane) ) (none) @@ -1668,12 +1668,13 @@ ) ) (cond - ((and (logtest? (-> *mouse* button0-rel 0) 1) - (begin (logand! (-> *mouse* button0-abs 0) -2) (let ((v1-20 (logand -2 (-> *mouse* button0-rel 0)))) - (set! (-> *mouse* button0-rel 0) v1-20) - (and v1-20 (!= (-> obj selected-index) (-> obj edge-src))) - ) - ) + ((and (mouse-pressed? left) (begin + (logclear! (-> *mouse* button0-abs 0) (mouse-buttons left)) + (let ((v1-20 (logclear (-> *mouse* button0-rel 0) (mouse-buttons left)))) + (set! (-> *mouse* button0-rel 0) v1-20) + (and v1-20 (!= (-> obj selected-index) (-> obj edge-src))) + ) + ) ) (cond ((>= (-> obj selected-index) 0) @@ -1692,12 +1693,12 @@ (nav-graph-editor-method-47 obj) (set! (-> obj edge-src) (-> obj edge-dst)) ) - ((logtest? (-> *mouse* button0-rel 0) 2) + ((mouse-pressed? right) (if (= (-> obj edge-dst) -2) (nav-graph-editor-method-58 obj) ) - (logand! (-> *mouse* button0-abs 0) -3) - (logand! (-> *mouse* button0-rel 0) -3) + (logclear! (-> *mouse* button0-abs 0) (mouse-buttons right)) + (logclear! (-> *mouse* button0-rel 0) (mouse-buttons right)) (go (method-of-object obj create)) ) ) @@ -1742,15 +1743,12 @@ (nav-graph-editor-method-43 obj) (nav-graph-editor-method-32 obj (-> obj selected-node-edge?) (-> obj selected-index)) (cond - ((logtest? (-> *mouse* button0-rel 0) 1) - (logand! (-> *mouse* button0-abs 0) -2) - (logand! (-> *mouse* button0-rel 0) -2) + ((mouse-pressed? left) + (logclear! (-> *mouse* button0-abs 0) (mouse-buttons left)) + (logclear! (-> *mouse* button0-rel 0) (mouse-buttons left)) (go (method-of-object obj create-edge)) ) - ((and (logtest? (-> *mouse* button0-rel 0) 2) - (>= (-> obj selected-index) 0) - (not (-> obj selected-node-edge?)) - ) + ((and (mouse-pressed? right) (>= (-> obj selected-index) 0) (not (-> obj selected-node-edge?))) ) (else (nav-graph-editor-method-59 obj) @@ -1798,19 +1796,19 @@ (nav-graph-editor-method-42 self) (nav-graph-editor-method-32 self (-> self selected-node-edge?) (-> self selected-index)) (cond - ((and (logtest? (-> *mouse* button0-abs 0) 1) (>= (-> self selected-index) 0)) - (logand! (-> *mouse* button0-abs 0) -2) - (logand! (-> *mouse* button0-rel 0) -2) + ((and (mouse-hold? left) (>= (-> self selected-index) 0)) + (logclear! (-> *mouse* button0-abs 0) (mouse-buttons left)) + (logclear! (-> *mouse* button0-rel 0) (mouse-buttons left)) (nav-graph-editor-method-53 self (-> self edge-visibility) (-> self selected-index)) ) - ((and (logtest? (-> *mouse* button0-abs 0) 4) (>= (-> self selected-index) 0)) - (logand! (-> *mouse* button0-abs 0) -5) - (logand! (-> *mouse* button0-rel 0) -5) + ((and (mouse-hold? middle) (>= (-> self selected-index) 0)) + (logclear! (-> *mouse* button0-abs 0) (mouse-buttons middle)) + (logclear! (-> *mouse* button0-rel 0) (mouse-buttons middle)) (nav-graph-editor-method-57 self (-> self edge-visibility) (-> self selected-index)) ) - ((logtest? (-> *mouse* button0-abs 0) 2) - (logand! (-> *mouse* button0-abs 0) -3) - (logand! (-> *mouse* button0-rel 0) -3) + ((mouse-hold? right) + (logclear! (-> *mouse* button0-abs 0) (mouse-buttons right)) + (logclear! (-> *mouse* button0-rel 0) (mouse-buttons right)) (go-virtual adjust-minimap) ) ) @@ -1830,7 +1828,7 @@ (nav-graph-editor-method-28 self) (nav-graph-editor-method-34 self) (cond - ((not (logtest? (-> *mouse* button0-abs 0) 1)) + ((not (mouse-hold? left)) (go-virtual adjust-it) ) (else @@ -1857,7 +1855,7 @@ (nav-graph-editor-method-28 self) (nav-graph-editor-method-34 self) (cond - ((not (logtest? (-> *mouse* button0-abs 0) 2)) + ((not (mouse-hold? right)) (go-virtual adjust-it) ) (else @@ -1887,7 +1885,7 @@ (nav-graph-editor-method-28 self) (nav-graph-editor-method-34 self) (cond - ((not (logtest? (-> *mouse* button0-abs 0) 2)) + ((not (mouse-hold? right)) (go-virtual adjust-it) ) (else @@ -1918,7 +1916,7 @@ (nav-graph-editor-method-34 self) (nav-graph-editor-method-32 self (-> self selected-node-edge?) (-> self selected-index)) (cond - ((not (logtest? (-> *mouse* button0-abs 0) 4)) + ((not (mouse-hold? middle)) (go-virtual adjust-it) ) (else @@ -1954,21 +1952,18 @@ ) ) (cond - ((and (logtest? (-> *mouse* button0-abs 0) 1) (>= (-> obj selected-index) 0)) + ((and (mouse-hold? left) (>= (-> obj selected-index) 0)) (if (-> obj selected-node-edge?) (go (method-of-object obj adjust-node-angle)) ) ) - ((and (logtest? (-> *mouse* button0-abs 0) 2) (>= (-> obj selected-index) 0)) + ((and (mouse-hold? right) (>= (-> obj selected-index) 0)) (if (-> obj selected-node-edge?) (go (method-of-object obj adjust-node-radius)) (go (method-of-object obj adjust-edge-width)) ) ) - ((and (logtest? (-> *mouse* button0-abs 0) 4) - (>= (-> obj selected-index) 0) - (not (-> obj selected-node-edge?)) - ) + ((and (mouse-hold? middle) (>= (-> obj selected-index) 0) (not (-> obj selected-node-edge?))) (go (method-of-object obj adjust-edge-density)) ) (else @@ -2016,14 +2011,14 @@ (nav-graph-editor-method-30 obj (-> obj selected-index)) ) (cond - ((and (logtest? (-> *mouse* button0-abs 0) 1) (>= (-> obj selected-index) 0)) - (logand! (-> *mouse* button0-abs 0) -2) - (logand! (-> *mouse* button0-rel 0) -2) + ((and (mouse-hold? left) (>= (-> obj selected-index) 0)) + (logclear! (-> *mouse* button0-abs 0) (mouse-buttons left)) + (logclear! (-> *mouse* button0-rel 0) (mouse-buttons left)) (go (method-of-object obj adjust-edge-visibility)) ) - ((logtest? (-> *mouse* button0-abs 0) 2) - (logand! (-> *mouse* button0-abs 0) -3) - (logand! (-> *mouse* button0-rel 0) -3) + ((mouse-hold? right) + (logclear! (-> *mouse* button0-abs 0) (mouse-buttons right)) + (logclear! (-> *mouse* button0-rel 0) (mouse-buttons right)) (go (method-of-object obj draw-closest-minimap)) ) (else @@ -2096,9 +2091,9 @@ ) ) (cond - ((logtest? (-> *mouse* button0-abs 0) 2) - (logand! (-> *mouse* button0-abs 0) -3) - (logand! (-> *mouse* button0-rel 0) -3) + ((mouse-hold? right) + (logclear! (-> *mouse* button0-abs 0) (mouse-buttons right)) + (logclear! (-> *mouse* button0-rel 0) (mouse-buttons right)) (go-virtual adjust-minimap) ) (else @@ -2118,19 +2113,19 @@ (nav-graph-editor-method-43 obj) (nav-graph-editor-method-32 obj (-> obj selected-node-edge?) (-> obj selected-index)) (cond - ((and (logtest? (-> *mouse* button0-abs 0) 1) (>= (-> obj selected-index) 0) (-> obj selected-node-edge?)) - (logand! (-> *mouse* button0-abs 0) -2) - (logand! (-> *mouse* button0-rel 0) -2) + ((and (mouse-hold? left) (>= (-> obj selected-index) 0) (-> obj selected-node-edge?)) + (logclear! (-> *mouse* button0-abs 0) (mouse-buttons left)) + (logclear! (-> *mouse* button0-rel 0) (mouse-buttons left)) (go (method-of-object obj move-node)) ) - ((logtest? (-> *mouse* button0-abs 0) 2) - (logand! (-> *mouse* button0-abs 0) -3) - (logand! (-> *mouse* button0-rel 0) -3) + ((mouse-hold? right) + (logclear! (-> *mouse* button0-abs 0) (mouse-buttons right)) + (logclear! (-> *mouse* button0-rel 0) (mouse-buttons right)) (go (method-of-object obj create-edge)) ) - ((and (logtest? (-> *mouse* button0-abs 0) 4) (>= (-> obj selected-index) 0)) - (logand! (-> *mouse* button0-abs 0) -5) - (logand! (-> *mouse* button0-rel 0) -5) + ((and (mouse-hold? middle) (>= (-> obj selected-index) 0)) + (logclear! (-> *mouse* button0-abs 0) (mouse-buttons middle)) + (logclear! (-> *mouse* button0-rel 0) (mouse-buttons middle)) (if (-> obj selected-node-edge?) (nav-graph-editor-method-55 obj (-> obj selected-index)) (nav-graph-editor-method-56 obj (-> obj selected-index)) diff --git a/test/decompiler/reference/jak2/engine/gfx/mood/weather-part_REF.gc b/test/decompiler/reference/jak2/engine/gfx/mood/weather-part_REF.gc index 9cbbd74173..43e1e25249 100644 --- a/test/decompiler/reference/jak2/engine/gfx/mood/weather-part_REF.gc +++ b/test/decompiler/reference/jak2/engine/gfx/mood/weather-part_REF.gc @@ -736,29 +736,25 @@ (set! (-> v1-0 z) (-> arg2 z)) (set! (-> v1-0 w) 1.0) (let ((gp-1 (vector+float*! (new 'stack-no-clear 'vector) arg1 v1-0 0.0))) - (let ((t9-0 matrix-local->world) - (a0-3 #f) - ) - (let* ((s4-0 (t9-0 a0-3)) - (f28-0 (lerp-scale 122.88 245.76 (fabs (-> s4-0 vector 2 y)) 0.0 0.7)) - (f30-0 (lerp-scale 2048.0 245.76 (fabs (-> s4-0 vector 2 y)) 0.0 0.7)) - ) - (let ((f26-0 (lerp-scale 0.0 0.1 (-> s4-0 vector 2 y) 0.3 0.7)) - (f0-11 (lerp-scale 1.0 0.1 (-> s4-0 vector 2 y) 0.3 0.7)) - ) - (if (< 0.0 f26-0) - (send-event *camera* 'part-water-drip f26-0 f0-11) - ) - ) - (set! (-> *part-id-table* 60 init-specs 5 initial-valuef) f28-0) - (set! (-> *part-id-table* 60 init-specs 5 random-rangef) f28-0) - (set! (-> *part-id-table* 61 init-specs 5 initial-valuef) f28-0) - (set! (-> *part-id-table* 61 init-specs 5 random-rangef) f28-0) - (set! (-> *part-id-table* 60 init-specs 6 initial-valuef) f30-0) - (set! (-> *part-id-table* 60 init-specs 6 random-rangef) f30-0) - (set! (-> *part-id-table* 61 init-specs 6 initial-valuef) f30-0) - (set! (-> *part-id-table* 61 init-specs 6 random-rangef) f30-0) + (let* ((s4-0 (matrix-local->world #f #f)) + (f28-0 (lerp-scale 122.88 245.76 (fabs (-> s4-0 vector 2 y)) 0.0 0.7)) + (f30-0 (lerp-scale 2048.0 245.76 (fabs (-> s4-0 vector 2 y)) 0.0 0.7)) + ) + (let ((f26-0 (lerp-scale 0.0 0.1 (-> s4-0 vector 2 y) 0.3 0.7)) + (f0-11 (lerp-scale 1.0 0.1 (-> s4-0 vector 2 y) 0.3 0.7)) + ) + (if (< 0.0 f26-0) + (send-event *camera* 'part-water-drip f26-0 f0-11) + ) ) + (set! (-> *part-id-table* 60 init-specs 5 initial-valuef) f28-0) + (set! (-> *part-id-table* 60 init-specs 5 random-rangef) f28-0) + (set! (-> *part-id-table* 61 init-specs 5 initial-valuef) f28-0) + (set! (-> *part-id-table* 61 init-specs 5 random-rangef) f28-0) + (set! (-> *part-id-table* 60 init-specs 6 initial-valuef) f30-0) + (set! (-> *part-id-table* 60 init-specs 6 random-rangef) f30-0) + (set! (-> *part-id-table* 61 init-specs 6 initial-valuef) f30-0) + (set! (-> *part-id-table* 61 init-specs 6 random-rangef) f30-0) ) (set! (-> *part-id-table* 60 init-specs 2 initial-valuef) arg0) (set! (-> *part-id-table* 61 init-specs 2 initial-valuef) (* 4.0 arg0)) @@ -951,3 +947,7 @@ (:func 'sparticle-track-sun) ) ) + + + + diff --git a/test/decompiler/reference/jak2/engine/gfx/ocean/ocean-mid_REF.gc b/test/decompiler/reference/jak2/engine/gfx/ocean/ocean-mid_REF.gc index eb444edaa8..e41598f05a 100644 --- a/test/decompiler/reference/jak2/engine/gfx/ocean/ocean-mid_REF.gc +++ b/test/decompiler/reference/jak2/engine/gfx/ocean/ocean-mid_REF.gc @@ -15,15 +15,11 @@ (set-vector! (-> arg0 fog) (-> v1-0 pfog0) (-> v1-0 fog-min) (-> v1-0 fog-max) 3072.0) ) (set-vector! (-> arg0 constants) -0.25 -0.5 0.0 393216.0) - (let ((t9-0 matrix-local->world) - (a0-8 #f) - ) - (let* ((s4-0 (-> (t9-0 a0-8) vector 2)) - (f0-12 (- 1.5 (* 0.000015258789 (atan (-> s4-0 x) (-> s4-0 z))))) - (f1-1 (+ 0.5 (* -0.5 (-> s4-0 y)))) - ) - (set-vector! (-> arg0 constants2) f0-12 f1-1 1.0 0.0) - ) + (let* ((s4-0 (-> (matrix-local->world #f #f) vector 2)) + (f0-12 (- 1.5 (* 0.000015258789 (atan (-> s4-0 x) (-> s4-0 z))))) + (f1-1 (+ 0.5 (* -0.5 (-> s4-0 y)))) + ) + (set-vector! (-> arg0 constants2) f0-12 f1-1 1.0 0.0) ) (case *subdivide-ocean-draw-mode* (((subdivide-setting textured)) @@ -1227,3 +1223,7 @@ (none) ) ) + + + + diff --git a/test/decompiler/reference/jak2/engine/gfx/ocean/ocean-near_REF.gc b/test/decompiler/reference/jak2/engine/gfx/ocean/ocean-near_REF.gc index 69ee91ac92..2a83730737 100644 --- a/test/decompiler/reference/jak2/engine/gfx/ocean/ocean-near_REF.gc +++ b/test/decompiler/reference/jak2/engine/gfx/ocean/ocean-near_REF.gc @@ -45,15 +45,11 @@ (set-vector! (-> arg0 fog) (-> v1-0 pfog0) (-> v1-0 fog-min) (-> v1-0 fog-max) 3072.0) ) (set-vector! (-> arg0 constants) -0.25 -0.5 0.0 0.000010172526) - (let ((t9-0 matrix-local->world) - (a0-8 #f) - ) - (let* ((s4-0 (-> (t9-0 a0-8) vector 2)) - (f0-12 (- 1.5 (* 0.000015258789 (atan (-> s4-0 x) (-> s4-0 z))))) - (f1-1 (+ 0.5 (* -0.5 (-> s4-0 y)))) - ) - (set-vector! (-> arg0 constants2) f0-12 f1-1 1.0 128.0) - ) + (let* ((s4-0 (-> (matrix-local->world #f #f) vector 2)) + (f0-12 (- 1.5 (* 0.000015258789 (atan (-> s4-0 x) (-> s4-0 z))))) + (f1-1 (+ 0.5 (* -0.5 (-> s4-0 y)))) + ) + (set-vector! (-> arg0 constants2) f0-12 f1-1 1.0 128.0) ) (set-vector! (-> arg0 constants3) 12288.0 0.125 2.0 0.03125) (set-vector! (-> arg0 constants4) 2.0 255.0 3.0 0.0078125) @@ -668,7 +664,6 @@ ;; definition for method 29 of type ocean ;; INFO: Used lq/sq ;; WARN: Return type mismatch int vs none. -;; ERROR: Failed store: (s.w! (+ a0-1 8) 0) at op 6 (defmethod draw-ocean-near ocean ((obj ocean) (arg0 dma-buffer)) (local-vars (sv-16 uint)) (dma-buffer-add-gs-set arg0 @@ -723,3 +718,7 @@ 0 (none) ) + + + + diff --git a/test/decompiler/reference/jak2/engine/ps2/pad_REF.gc b/test/decompiler/reference/jak2/engine/ps2/pad_REF.gc index 2b44c19eb8..22133c3d89 100644 --- a/test/decompiler/reference/jak2/engine/ps2/pad_REF.gc +++ b/test/decompiler/reference/jak2/engine/ps2/pad_REF.gc @@ -535,26 +535,26 @@ ;; definition of type mouse-info (deftype mouse-info (basic) - ((active symbol :offset-assert 4) - (cursor basic :offset-assert 8) - (valid symbol :offset-assert 12) - (id uint8 :offset-assert 16) - (status uint16 :offset-assert 18) - (button0 uint16 :offset-assert 20) - (deltax int8 :offset-assert 22) - (deltay int8 :offset-assert 23) - (wheel uint8 :offset-assert 24) - (change-time time-frame :offset-assert 32) - (button0-abs uint32 3 :offset-assert 40) - (button0-shadow-abs uint32 1 :offset-assert 52) - (button0-rel uint32 3 :offset-assert 56) - (pos vector 2 :inline :offset-assert 80) - (posx float :offset 80) - (posy float :offset 84) - (oldposx float :offset 96) - (oldposy float :offset 100) - (speedx float :offset 92) - (speedy float :offset 108) + ((active symbol :offset-assert 4) + (cursor basic :offset-assert 8) + (valid symbol :offset-assert 12) + (id uint8 :offset-assert 16) + (status uint16 :offset-assert 18) + (button0 uint16 :offset-assert 20) + (deltax int8 :offset-assert 22) + (deltay int8 :offset-assert 23) + (wheel uint8 :offset-assert 24) + (change-time time-frame :offset-assert 32) + (button0-abs mouse-buttons 3 :offset-assert 40) + (button0-shadow-abs mouse-buttons 1 :offset-assert 52) + (button0-rel mouse-buttons 3 :offset-assert 56) + (pos vector 2 :inline :offset-assert 80) + (posx float :offset 80) + (posy float :offset 84) + (oldposx float :offset 96) + (oldposy float :offset 100) + (speedx float :offset 92) + (speedy float :offset 108) ) :method-count-assert 9 :size-assert #x70 @@ -622,7 +622,7 @@ (set! (-> gp-0 button0-abs 1) (-> gp-0 button0-shadow-abs 0)) (set! (-> gp-0 button0-rel 2) (-> gp-0 button0-rel 1)) (set! (-> gp-0 button0-rel 1) (-> gp-0 button0-rel 0)) - (set! (-> gp-0 button0-rel 0) (the-as uint 0)) + (set! (-> gp-0 button0-rel 0) (mouse-buttons)) (set! (-> gp-0 speedx) 0.0) (set! (-> gp-0 speedy) 0.0) (cond @@ -639,8 +639,8 @@ (set! (-> gp-0 posx) (fmax -256.0 (fmin 256.0 (+ (-> gp-0 posx) (-> gp-0 speedx))))) (set! (-> gp-0 posy) (fmax -208.0 (fmin 208.0 (+ (-> gp-0 posy) (-> gp-0 speedy))))) (let ((v1-22 (-> gp-0 button0))) - (set! (-> gp-0 button0-shadow-abs 0) v1-22) - (set! (-> gp-0 button0-abs 0) v1-22) + (set! (-> gp-0 button0-shadow-abs 0) (the-as mouse-buttons v1-22)) + (set! (-> gp-0 button0-abs 0) (the-as mouse-buttons v1-22)) ) (set! (-> gp-0 button0-rel 0) (logclear (-> gp-0 button0-abs 0) (-> gp-0 button0-abs 1))) ) @@ -651,7 +651,7 @@ (bucket-id debug-no-zbuf2) (+ (the int (-> gp-0 posx)) 256) (+ (the int (-> gp-0 posy)) 208) - (the-as int (-> gp-0 button0-abs 0)) + (-> gp-0 button0-abs 0) ) ) ) diff --git a/test/decompiler/reference/jak2/engine/target/darkjak-h_REF.gc b/test/decompiler/reference/jak2/engine/target/darkjak-h_REF.gc index ab20f856bf..1f6939ec6c 100644 --- a/test/decompiler/reference/jak2/engine/target/darkjak-h_REF.gc +++ b/test/decompiler/reference/jak2/engine/target/darkjak-h_REF.gc @@ -8,8 +8,8 @@ (start-time time-frame :offset-assert 16) (attack-time time-frame :offset-assert 24) (attack-count uint64 :offset-assert 32) - (stage uint32 :offset-assert 40) - (want-stage uint32 :offset-assert 44) + (stage darkjak-stage :offset-assert 40) + (want-stage darkjak-stage :offset-assert 44) (clock-pos float :offset-assert 48) (clock-vel float :offset-assert 52) (clock-on symbol :offset-assert 56) 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 a7505cbd24..7aafdeec9a 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 @@ -89,7 +89,7 @@ (laser-point vector :inline :offset-assert 304) (laser-dir vector 2 :inline :offset-assert 320) (laser-hit-point vector :inline :offset-assert 352) - (track? uint16 :offset-assert 368) + (track? gun-track-flags :offset-assert 368) (track-tilt degrees :offset-assert 372) (track-turn degrees :offset-assert 376) (track-find-range meters :offset-assert 380) diff --git a/test/decompiler/reference/jak2/engine/target/gun/gun-states_REF.gc b/test/decompiler/reference/jak2/engine/target/gun/gun-states_REF.gc index f6077af74f..8eea41963a 100644 --- a/test/decompiler/reference/jak2/engine/target/gun/gun-states_REF.gc +++ b/test/decompiler/reference/jak2/engine/target/gun/gun-states_REF.gc @@ -68,7 +68,7 @@ (go target-gun-walk) ) (if (want-to-darkjak?) - (go target-darkjak-get-on 2) + (go target-darkjak-get-on (darkjak-stage active)) ) (when (and (cpad-hold? (-> self control cpad number) l1) (can-duck?)) (logclear! (-> self state-flags) (state-flags lleg-still rleg-still)) @@ -176,7 +176,7 @@ (go target-gun-stance) ) (if (want-to-darkjak?) - (go target-darkjak-get-on 2) + (go target-darkjak-get-on (darkjak-stage active)) ) (if (and (logtest? (logior (logior (-> *cpad-list* cpads (-> self control cpad number) button0-rel 0) (-> *cpad-list* cpads (-> self control cpad number) button0-rel 1) 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 17b23dde00..7a0594046f 100644 --- a/test/decompiler/reference/jak2/engine/target/logic-target_REF.gc +++ b/test/decompiler/reference/jak2/engine/target/logic-target_REF.gc @@ -518,21 +518,17 @@ (set! (-> self control pad-xz-dir quad) (-> arg0 quad)) (set! (-> self control pad-magnitude) (-> self control cpad stick0-speed)) (when (< (-> self control update-cam-R-w-start-time) (current-time)) - (let ((s5-0 (-> self control cam-R-w)) - (t9-2 matrix-local->world) - (a0-13 #t) - ) - (let* ((a2-0 (t9-2 a0-13)) - (v1-24 (-> a2-0 quad 0)) - (a0-14 (-> a2-0 quad 1)) - (a1-1 (-> a2-0 quad 2)) - (a2-1 (-> a2-0 trans quad)) - ) - (set! (-> s5-0 quad 0) v1-24) - (set! (-> s5-0 quad 1) a0-14) - (set! (-> s5-0 quad 2) a1-1) - (set! (-> s5-0 trans quad) a2-1) - ) + (let* ((s5-0 (-> self control cam-R-w)) + (a2-0 (matrix-local->world #t #f)) + (v1-24 (-> a2-0 quad 0)) + (a0-14 (-> a2-0 quad 1)) + (a1-1 (-> a2-0 quad 2)) + (a2-1 (-> a2-0 trans quad)) + ) + (set! (-> s5-0 quad 0) v1-24) + (set! (-> s5-0 quad 1) a0-14) + (set! (-> s5-0 quad 2) a1-1) + (set! (-> s5-0 trans quad) a2-1) ) ) (vector-matrix*! arg0 arg0 (-> self control cam-R-w)) @@ -569,20 +565,17 @@ ;; WARN: Return type mismatch vector vs none. (defun vector<-pad-in-matrix! ((arg0 vector) (arg1 cpad-info) (arg2 matrix)) (let ((gp-0 (new 'stack-no-clear 'vector)) - (t9-0 matrix-local->world) - (a0-1 #t) - ) - (let ((s5-0 (t9-0 a0-1))) - (set! (-> gp-0 x) (* -0.0078125 (+ -128.0 (the float (-> arg1 leftx))))) - (set! (-> gp-0 y) 0.0) - (set! (-> gp-0 z) (* -0.0078125 (+ -128.0 (the float (-> arg1 lefty))))) - (set! (-> gp-0 w) 0.0) - (let ((f30-0 (vector-length gp-0))) - (vector-matrix*! gp-0 gp-0 s5-0) - (warp-vector-into-surface! arg0 gp-0 (-> arg2 vector 1) s5-0) - (vector-matrix*! arg0 arg0 arg2) - (vector-normalize! arg0 f30-0) + (s5-0 (matrix-local->world #t #f)) ) + (set! (-> gp-0 x) (* -0.0078125 (+ -128.0 (the float (-> arg1 leftx))))) + (set! (-> gp-0 y) 0.0) + (set! (-> gp-0 z) (* -0.0078125 (+ -128.0 (the float (-> arg1 lefty))))) + (set! (-> gp-0 w) 0.0) + (let ((f30-0 (vector-length gp-0))) + (vector-matrix*! gp-0 gp-0 s5-0) + (warp-vector-into-surface! arg0 gp-0 (-> arg2 vector 1) s5-0) + (vector-matrix*! arg0 arg0 arg2) + (vector-normalize! arg0 f30-0) ) ) (none) @@ -3453,3 +3446,7 @@ (kill-by-name "tobot" *active-pool*) 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 2dd95bc6fd..b054428cce 100644 --- a/test/decompiler/reference/jak2/engine/target/target-darkjak_REF.gc +++ b/test/decompiler/reference/jak2/engine/target/target-darkjak_REF.gc @@ -56,7 +56,11 @@ ) ) (and (and (focus-test? self dark) (nonzero? (-> self darkjak))) - (not (and (focus-test? self dark) (nonzero? (-> self darkjak)) (logtest? (-> self darkjak stage) 32))) + (not (and (focus-test? self dark) + (nonzero? (-> self darkjak)) + (logtest? (-> self darkjak stage) (darkjak-stage giant)) + ) + ) (logtest? (game-feature darkjak-giant) (-> self game features)) ) ) @@ -116,7 +120,7 @@ ) (not (focus-test? self dead dangerous hit grabbed)) (not (and (-> self next-state) (= (-> self next-state name) 'target-darkjak-get-off))) - (not (logtest? (-> self darkjak stage) 1)) + (not (logtest? (-> self darkjak stage) (darkjak-stage force-on))) ) (go target-darkjak-get-off) ) @@ -142,7 +146,10 @@ ) (let ((f26-1 (* 1.1 f26-0))) (cond - ((and (focus-test? self dark) (nonzero? (-> self darkjak)) (logtest? (-> self darkjak stage) 32)) + ((and (focus-test? self dark) + (nonzero? (-> self darkjak)) + (logtest? (-> self darkjak stage) (darkjak-stage giant)) + ) (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)))) @@ -258,7 +265,7 @@ (case event-type (('darkjak) (when (zero? (-> self darkjak want-stage)) - (set! (-> self darkjak want-stage) (-> event param 0)) + (set! (-> self darkjak want-stage) (the-as darkjak-stage (-> event param 0))) #t ) ) @@ -285,20 +292,20 @@ ) (none) ) - :code (behavior ((arg0 int)) + :code (behavior ((arg0 darkjak-stage)) (send-event (handle->process (-> self notify)) 'notify 'attack 15) (if (and (focus-test? self dark) (nonzero? (-> self darkjak))) (go target-darkjak-giant) ) - (set! (-> self darkjak stage) (the-as uint (logior arg0 2))) + (set! (-> self darkjak stage) (logior arg0 (darkjak-stage active))) (if (logtest? (game-feature darkjak-bomb0) (-> self game features)) - (logior! (-> self darkjak stage) 4) + (logior! (-> self darkjak stage) (darkjak-stage bomb0)) ) (if (logtest? (game-feature darkjak-bomb1) (-> self game features)) - (logior! (-> self darkjak stage) 8) + (logior! (-> self darkjak stage) (darkjak-stage bomb1)) ) (if (logtest? (game-feature darkjak-invinc) (-> self game features)) - (logior! (-> self darkjak stage) 16) + (logior! (-> self darkjak stage) (darkjak-stage invinc)) ) (set! (-> self darkjak want-stage) (-> self darkjak stage)) (set! (-> self neck flex-blend) 0.0) @@ -310,11 +317,11 @@ (logior! (-> self focus-status) (focus-status dark)) (set! (-> (the-as fact-info-target (-> self fact)) darkjak-start-time) (current-time)) (set! (-> (the-as fact-info-target (-> self fact)) darkjak-effect-time) (seconds 20)) - (if (logtest? (-> self darkjak stage) 16) + (if (logtest? (-> self darkjak stage) (darkjak-stage invinc)) (logior! (-> self state-flags) (state-flags sf4)) (logclear! (-> self state-flags) (state-flags sf4)) ) - (if (logtest? arg0 64) + (if (logtest? arg0 (darkjak-stage no-anim)) (go target-stance) ) (set-setting! 'bg-r 'abs 0.1 0) @@ -354,7 +361,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) (not (logtest? arg0 1))) + (and (< (ja-aframe-num 0) 5.0) (not (logtest? arg0 (darkjak-stage force-on)))) ) (let ((v1-131 (the-as sound-rpc-set-param (get-sound-buffer-entry)))) (set! (-> v1-131 command) (sound-command set-param)) @@ -376,7 +383,10 @@ (send-event *traffic-manager* 'increase-alert-level - (if (and (focus-test? self dark) (nonzero? (-> self darkjak)) (logtest? (-> self darkjak stage) 16)) + (if (and (focus-test? self dark) + (nonzero? (-> self darkjak)) + (logtest? (-> self darkjak stage) (darkjak-stage invinc)) + ) 3 2 ) @@ -498,7 +508,11 @@ (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 (focus-test? self dark) (nonzero? (-> self darkjak)) (logtest? (-> self darkjak stage) 32))) + (or (not (and (focus-test? self dark) + (nonzero? (-> self darkjak)) + (logtest? (-> self darkjak stage) (darkjak-stage giant)) + ) + ) (= (-> self darkjak-interp) 0.0) ) ) @@ -515,7 +529,11 @@ (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 (focus-test? self dark) (nonzero? (-> self darkjak)) (logtest? (-> self darkjak stage) 32))) + (or (not (and (focus-test? self dark) + (nonzero? (-> self darkjak)) + (logtest? (-> self darkjak stage) (darkjak-stage giant)) + ) + ) (= (-> self darkjak-interp) 0.0) ) ) @@ -535,7 +553,11 @@ (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 (focus-test? self dark) (nonzero? (-> self darkjak)) (logtest? (-> self darkjak stage) 32))) + (or (not (and (focus-test? self dark) + (nonzero? (-> self darkjak)) + (logtest? (-> self darkjak stage) (darkjak-stage giant)) + ) + ) (= (-> self darkjak-interp) 0.0) ) ) @@ -552,7 +574,11 @@ (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 (focus-test? self dark) (nonzero? (-> self darkjak)) (logtest? (-> self darkjak stage) 32))) + (or (not (and (focus-test? self dark) + (nonzero? (-> self darkjak)) + (logtest? (-> self darkjak stage) (darkjak-stage giant)) + ) + ) (= (-> self darkjak-interp) 0.0) ) ) @@ -652,7 +678,10 @@ (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 (focus-test? self dark) (nonzero? (-> self darkjak)) (logtest? (-> self darkjak stage) 2)) + (and (focus-test? self dark) + (nonzero? (-> self darkjak)) + (logtest? (-> self darkjak stage) (darkjak-stage active)) + ) (< sv-32 2) ) (set! sv-40 (the-as int (current-time))) @@ -1239,7 +1268,10 @@ ) ) ) - (if (and (focus-test? self dark) (nonzero? (-> self darkjak)) (logtest? (-> self darkjak stage) 32)) + (if (and (focus-test? self dark) + (nonzero? (-> self darkjak)) + (logtest? (-> self darkjak stage) (darkjak-stage giant)) + ) (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)) ) @@ -1322,7 +1354,9 @@ (suspend) (ja-eval) ) - (when (and (focus-test? self dark) (and (nonzero? (-> self darkjak)) (logtest? (-> self darkjak stage) 32))) + (when (and (focus-test? self dark) + (and (nonzero? (-> self darkjak)) (logtest? (-> self darkjak stage) (darkjak-stage giant))) + ) (let ((gp-10 (process-spawn manipy :init manipy-init @@ -1477,11 +1511,13 @@ (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 (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! (-> v1-19 penetrate-using) (if (and (focus-test? self dark) + (nonzero? (-> self darkjak)) + (logtest? (-> self darkjak stage) (darkjak-stage giant)) + ) + (penetrate touch dark-skin dark-bomb dark-giant) + (penetrate touch dark-skin dark-bomb) + ) ) (set! (-> a1-6 param 1) (the-as uint v1-19)) ) @@ -1744,7 +1780,9 @@ ) ) (set! (-> sv-56 r) - (if (and (focus-test? self dark) (and (nonzero? (-> self darkjak)) (logtest? (-> self darkjak stage) 32))) + (if (and (focus-test? self dark) + (and (nonzero? (-> self darkjak)) (logtest? (-> self darkjak stage) (darkjak-stage giant))) + ) 614400.0 327680.0 ) @@ -1883,7 +1921,7 @@ (set! (-> self darkjak-interp) 1.0) (set! (-> self darkjak-giant-interp) (the-as float (-> self control unknown-word04))) (when (= (the-as float (-> self control unknown-word04)) 1.0) - (logand! (-> self darkjak stage) -33) + (logclear! (-> self darkjak stage) (darkjak-stage giant)) (set! (-> self darkjak want-stage) (-> self darkjak stage)) ) (none) @@ -1894,7 +1932,7 @@ (logior! (-> self state-flags) (state-flags sf4)) (set! (-> self neck flex-blend) 0.0) (set! (-> self control mod-surface) *darkjak-trans-mods*) - (logior! (-> self darkjak stage) 32) + (logior! (-> self darkjak stage) (darkjak-stage giant)) (set! (-> self darkjak want-stage) (-> self darkjak stage)) (sound-play "djak-transform") (let ((gp-1 (new 'stack-no-clear 'collide-query))) 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 2b64b987f2..5d27dac450 100644 --- a/test/decompiler/reference/jak2/engine/target/target-gun_REF.gc +++ b/test/decompiler/reference/jak2/engine/target/target-gun_REF.gc @@ -44,7 +44,7 @@ (f30-0 (lerp-scale 0.0 1.0 (fabs f0-0) 1820.4445 6371.5557)) ) (cond - ((and (logtest? (-> self gun track?) 1) + ((and (logtest? (-> self gun track?) (gun-track-flags gutflags-0)) (!= (-> *cpad-list* cpads (-> self control cpad number) stick0-speed) 0.0) (>= (-> self gun track-turnv-range) (vector-vector-distance (-> self control trans) (-> self gun track-trans)) @@ -214,7 +214,7 @@ (set! (-> self gun put-away?) #f) (set! (-> self gun active?) #f) (set! (-> self gun surpress-time) 0) - (set! (-> self gun track?) (the-as uint 6)) + (set! (-> self gun track?) (gun-track-flags gutflags-1 gutflags-2)) (set! (-> self gun track-turn) 0.0) (set! (-> self gun track-tilt) 0.0) (set! (-> self gun track-target-hold-time) 0) @@ -1187,8 +1187,8 @@ ;; WARN: Return type mismatch int vs none. (defbehavior target-gun-find-track target () (if (logtest? (-> self gun upper-body track-mode) (track-mode lock-on)) - (logior! (-> self gun track?) 8) - (logand! (-> self gun track?) -9) + (logior! (-> self gun track?) (gun-track-flags gutflags-3)) + (logclear! (-> self gun track?) (gun-track-flags gutflags-3)) ) (let ((gp-0 (the-as basic #f))) (when (and (or (< (- (current-time) (-> self control time-of-last-nonzero-input)) (seconds 0.2)) @@ -1267,7 +1267,7 @@ (cond (gp-0 (set! (-> self gun track-target-hold-time) 0) - (set! (-> self gun track?) (the-as uint 7)) + (set! (-> self gun track?) (gun-track-flags gutflags-0 gutflags-1 gutflags-2)) (set! (-> self gun track-trans quad) (-> (get-trans (the-as process-focusable gp-0) 3) quad)) (when ((method-of-type focus try-update-focus) (the-as focus (-> self gun track-target)) @@ -1321,7 +1321,7 @@ (= (send-event (the-as process-focusable s5-1) 'track #t) 'abort) ) ) - (set! (-> self gun track?) (the-as uint 6)) + (set! (-> self gun track?) (gun-track-flags gutflags-1 gutflags-2)) (set! (-> self gun track-target-hold-time) 0) ((method-of-type focus clear-focused) (the-as focus (-> self gun track-target))) ) @@ -1335,7 +1335,7 @@ ((and (not (send-event-function (the-as process-focusable s5-1) a1-21)) (zero? (-> self gun track-target-hold-time)) ) - (logand! (-> self gun track?) -5) + (logclear! (-> self gun track?) (gun-track-flags gutflags-2)) (set! (-> self gun track-trans quad) (-> (get-trans (the-as process-focusable s5-1) 3) quad)) ) (else @@ -1391,7 +1391,7 @@ ) ) ) - (when (logtest? (-> self gun track?) 1) + (when (logtest? (-> self gun track?) (gun-track-flags gutflags-0)) (if *gun-marks* (add-debug-sphere #t @@ -1582,7 +1582,7 @@ ) (try-update-focus (-> self gun track-target 1) (the-as process-focusable gp-0)) (set! (-> self gun track-trans quad) (-> (get-trans (the-as process-focusable gp-0) 3) quad)) - (set! (-> self gun track?) (the-as uint 7)) + (set! (-> self gun track?) (gun-track-flags gutflags-0 gutflags-1 gutflags-2)) (if (zero? (-> self gun fire-pending)) (+! (-> self gun fire-pending) 1) ) @@ -1698,7 +1698,9 @@ ) (target-gun-find-track) (cond - ((and (= (-> self gun gun-type) (pickup-type eco-blue)) (not (logtest? (-> self gun track?) 1))) + ((and (= (-> self gun gun-type) (pickup-type eco-blue)) + (not (logtest? (-> self gun track?) (gun-track-flags gutflags-0))) + ) (let ((f0-8 (vector-vector-distance (-> self gun fire-point) (-> self gun laser-hit-point)))) (cond ((< f0-8 122880.0) @@ -1739,7 +1741,9 @@ (cond ((or (and (nonzero? (-> self gun track-target-hold-time)) (< (current-time) (-> self gun track-target-hold-time))) (and (nonzero? (-> self gun turn-fast-hold-time)) (< (current-time) (-> self gun turn-fast-hold-time))) - (and (logtest? (-> self gun track?) 1) (logtest? (-> self gun track?) 4)) + (and (logtest? (-> self gun track?) (gun-track-flags gutflags-0)) + (logtest? (-> self gun track?) (gun-track-flags gutflags-2)) + ) (or (logtest? (surface-flag gun-strafe) (-> self control current-surface flags)) (focus-test? self pilot-riding) ) @@ -1764,7 +1768,7 @@ (set! (-> self upper-body flex-blend) 0.0) (seek! (-> self upper-body flex-blend) 1.0 (* 8.0 (-> self clock seconds-per-frame))) ) - (when (logtest? (-> self gun track?) 1) + (when (logtest? (-> self gun track?) (gun-track-flags gutflags-0)) (set! (-> self gun top-anim-look-at quad) (-> self gun track-trans quad)) (let ((gp-6 (new 'stack-no-clear 'vector))) (set! (-> gp-6 quad) (-> self gun top-anim-look-at quad)) @@ -1798,7 +1802,7 @@ ) ) (cond - ((and (logtest? (-> self gun track?) 1) + ((and (logtest? (-> self gun track?) (gun-track-flags gutflags-0)) (logtest? (process-mask enemy guard) (-> (handle->process (-> self gun track-target 0 handle)) mask)) ) (if (and (< (- (current-time) (-> self gun track-press-start-time)) (seconds 0.5)) @@ -1818,7 +1822,7 @@ ((or (and (nonzero? (-> self gun track-target-hold-time)) (< (current-time) (-> self gun track-target-hold-time))) (and (nonzero? (-> self gun turn-fast-hold-time)) (< (current-time) (-> self gun turn-fast-hold-time))) ) - (set! (-> self gun track?) (the-as uint 7)) + (set! (-> self gun track?) (gun-track-flags gutflags-0 gutflags-1 gutflags-2)) (set! (-> self gun upper-body twist-max y) 21845.334) (set! (-> self gun upper-body twist-speed-y) 0.2) (set! (-> self gun upper-body twist-speed-x) 0.6) diff --git a/test/decompiler/reference/jak2/engine/target/target-h_REF.gc b/test/decompiler/reference/jak2/engine/target/target-h_REF.gc index 40c140c1e8..6c0e80af50 100644 --- a/test/decompiler/reference/jak2/engine/target/target-h_REF.gc +++ b/test/decompiler/reference/jak2/engine/target/target-h_REF.gc @@ -118,7 +118,7 @@ target-darkjak-bomb0 (target-darkjak-bomb1 float float) target-darkjak-get-off - (target-darkjak-get-on int) + (target-darkjak-get-on darkjak-stage) target-darkjak-giant target-darkjak-running-attack (target-death symbol) 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 153dd40bcb..174b668ac4 100644 --- a/test/decompiler/reference/jak2/engine/target/target-handler_REF.gc +++ b/test/decompiler/reference/jak2/engine/target/target-handler_REF.gc @@ -280,8 +280,12 @@ (set! (-> self control send-attack-dest) (process->handle arg0)) (set! (-> self control send-attack-time) (current-time)) (send-event self 'hit arg1 arg0 arg2) - (set! arg0 - (and (and (focus-test? self dark) (nonzero? (-> self darkjak)) (logtest? (-> self darkjak stage) 2)) arg0) + (set! arg0 (and (and (focus-test? self dark) + (nonzero? (-> self darkjak)) + (logtest? (-> self darkjak stage) (darkjak-stage active)) + ) + arg0 + ) ) (when (the-as object arg0) (when (and s4-0 (not s3-1) (-> self control danger-mode) (not (logtest? (-> s4-0 mask) (process-mask dark-effect)))) @@ -844,7 +848,10 @@ ) ) (('effect-control) - (when (and (focus-test? self dark) (nonzero? (-> self darkjak)) (logtest? (-> self darkjak stage) 32)) + (when (and (focus-test? self dark) + (nonzero? (-> self darkjak)) + (logtest? (-> self darkjak stage) (darkjak-stage giant)) + ) (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)) @@ -960,7 +967,10 @@ v0-0 ) ((and (and (focus-test? self dark) (nonzero? (-> self darkjak))) - (or (and (focus-test? self dark) (nonzero? (-> self darkjak)) (logtest? (-> self darkjak stage) 16)) + (or (and (focus-test? self dark) + (nonzero? (-> self darkjak)) + (logtest? (-> self darkjak stage) (darkjak-stage invinc)) + ) (logtest? (process-mask crate) (-> arg0 mask)) ) ) @@ -1258,10 +1268,10 @@ ((= v1-45 'darkjak) (cond ((not (and (focus-test? self dark) (nonzero? (-> self darkjak)))) - (go target-darkjak-get-on (the-as int (-> arg3 param 2))) + (go target-darkjak-get-on (the-as darkjak-stage (-> arg3 param 2))) ) ((logtest? (-> arg3 param 2) 128) - (logand! (-> self darkjak stage) -2) + (logclear! (-> self darkjak stage) (darkjak-stage force-on)) (set! v0-0 (+ (- (seconds 20) (-> self fact darkjak-start-time)) (current-time))) (set! (-> self fact darkjak-effect-time) (the-as time-frame v0-0)) v0-0 @@ -1311,7 +1321,7 @@ (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) + (set! (-> self darkjak want-stage) (the-as darkjak-stage v1-164)) (go target-darkjak-bomb0) ) ) 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 6767e1b7d2..45be7d0b8d 100644 --- a/test/decompiler/reference/jak2/engine/target/target-util_REF.gc +++ b/test/decompiler/reference/jak2/engine/target/target-util_REF.gc @@ -422,7 +422,9 @@ ) ) ) - (if (and (focus-test? self dark) (and (nonzero? (-> self darkjak)) (logtest? (-> self darkjak stage) 32))) + (if (and (focus-test? self dark) + (and (nonzero? (-> self darkjak)) (logtest? (-> self darkjak stage) (darkjak-stage giant))) + ) (set! f30-0 1.0) ) (set! (-> self control penetrate-using) (penetrate touch)) @@ -581,7 +583,10 @@ (set! (-> s5-0 transform-index) 21) ) (set! (-> self control penetrate-using) (penetrate touch punch)) - (if (and (focus-test? self dark) (nonzero? (-> self darkjak)) (logtest? (-> self darkjak stage) 2)) + (if (and (focus-test? self dark) + (nonzero? (-> self darkjak)) + (logtest? (-> self darkjak stage) (darkjak-stage active)) + ) (logior! (-> self control penetrate-using) (penetrate dark-punch)) ) ) @@ -727,7 +732,10 @@ ) (when (and (focus-test? self dark) (nonzero? (-> self darkjak))) (logior! (-> self control penetrate-using) (penetrate dark-skin)) - (when (and (focus-test? self dark) (nonzero? (-> self darkjak)) (logtest? (-> self darkjak stage) 32)) + (when (and (focus-test? self dark) + (nonzero? (-> self darkjak)) + (logtest? (-> self darkjak stage) (darkjak-stage giant)) + ) (logior! (-> self control penetrate-using) (penetrate dark-giant)) (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)) @@ -1083,7 +1091,9 @@ ) ) ) - (when (and (focus-test? self dark) (and (nonzero? (-> self darkjak)) (logtest? (-> self darkjak stage) 32))) + (when (and (focus-test? self dark) + (and (nonzero? (-> self darkjak)) (logtest? (-> self darkjak stage) (darkjak-stage giant))) + ) (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)) @@ -1127,7 +1137,10 @@ ;; definition for method 26 of type target (defmethod get-inv-mass target ((obj target)) - (if (or (and (focus-test? obj dark) (nonzero? (-> obj darkjak)) (logtest? (-> obj darkjak stage) 32)) + (if (or (and (focus-test? obj dark) + (nonzero? (-> obj darkjak)) + (logtest? (-> obj darkjak stage) (darkjak-stage giant)) + ) (focus-test? obj mech) ) 0.1 diff --git a/test/decompiler/reference/jak2/engine/target/target2_REF.gc b/test/decompiler/reference/jak2/engine/target/target2_REF.gc index 28e87f22df..73542793f6 100644 --- a/test/decompiler/reference/jak2/engine/target/target2_REF.gc +++ b/test/decompiler/reference/jak2/engine/target/target2_REF.gc @@ -305,7 +305,7 @@ ) (set! (-> self gun fire-dir-out quad) (-> gp-0 vector 2 quad)) ) - (set! (-> self gun track?) (the-as uint 6)) + (set! (-> self gun track?) (gun-track-flags gutflags-1 gutflags-2)) (target-gun-check) ) (none) @@ -1219,7 +1219,7 @@ (go target-walk) ) (if (want-to-darkjak?) - (go target-darkjak-get-on 2) + (go target-darkjak-get-on (darkjak-stage active)) ) (if (and (cpad-hold? (-> self control cpad number) l1) (can-duck?)) (go target-duck-stance #f) diff --git a/test/decompiler/reference/jak2/engine/target/target_REF.gc b/test/decompiler/reference/jak2/engine/target/target_REF.gc index ec38cdc94c..82a2580f73 100644 --- a/test/decompiler/reference/jak2/engine/target/target_REF.gc +++ b/test/decompiler/reference/jak2/engine/target/target_REF.gc @@ -5,7 +5,7 @@ ;; WARN: Return type mismatch int vs none. (defbehavior target-falling-trans target ((arg0 symbol) (arg1 time-frame)) (if (want-to-darkjak?) - (go target-darkjak-get-on 2) + (go target-darkjak-get-on (darkjak-stage active)) ) (if (and (cpad-pressed? (-> self control cpad number) circle) (can-feet? #f)) (go target-attack-air #f) @@ -74,7 +74,7 @@ (go target-walk) ) (if (want-to-darkjak?) - (go target-darkjak-get-on 2) + (go target-darkjak-get-on (darkjak-stage active)) ) (when (and (cpad-hold? (-> self control cpad number) l1) (can-duck?)) (logclear! (-> self state-flags) (state-flags lleg-still rleg-still lleg-no-ik rleg-no-ik)) @@ -187,7 +187,7 @@ (go target-stance) ) (if (want-to-darkjak?) - (go target-darkjak-get-on 2) + (go target-darkjak-get-on (darkjak-stage active)) ) (if (and (logtest? (logior (logior (-> *cpad-list* cpads (-> self control cpad number) button0-rel 0) (-> *cpad-list* cpads (-> self control cpad number) button0-rel 1) @@ -575,7 +575,10 @@ ;; 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 (focus-test? self dark) (nonzero? (-> self darkjak)) (logtest? (-> self darkjak stage) 32)) + (when (and (focus-test? self dark) + (nonzero? (-> self darkjak)) + (logtest? (-> self darkjak stage) (darkjak-stage giant)) + ) (set! arg0 (* arg0 (-> self darkjak-giant-interp))) (set! arg1 (* arg1 (-> self darkjak-giant-interp))) ) @@ -702,17 +705,22 @@ ) ) 0 - (when (and arg1 - (ja-group) - (and (-> (ja-group) extra) - (not (and (focus-test? self dark) (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) (darkjak-stage giant)) + ) + ) + #t + ) ) (let ((v1-62 (res-lump-struct (-> (ja-group) extra) 'collide-offset vector :time (ja-aframe-num 0)))) (cond (v1-62 - (if (and (focus-test? self dark) (nonzero? (-> self darkjak)) (logtest? (-> self darkjak stage) 32)) + (if (and (focus-test? self dark) + (nonzero? (-> self darkjak)) + (logtest? (-> self darkjak stage) (darkjak-stage giant)) + ) (set! (-> v1-62 y) (* 0.5 (-> v1-62 y))) ) (set! v0-1 (-> self control anim-collide-offset-local)) @@ -729,55 +737,57 @@ ) ;; definition for symbol *duck-mods*, type surface -(define *duck-mods* - (new 'static 'surface - :name 'duck - :turnv 131072.0 - :turnvv 524288.0 - :tiltv 65536.0 - :tiltvv 262144.0 - :transv-max 16384.0 - :target-speed 16384.0 - :seek0 1.0 - :seek90 1.0 - :seek180 1.0 - :fric 1.0 - :nonlin-fric-dist 1.0 - :slip-factor 1.0 - :slide-factor 1.0 - :slope-up-factor 1.0 - :slope-down-factor 1.0 - :slope-slip-angle 1.0 - :impact-fric 1.0 - :bend-factor 1.0 - :bend-speed 1.0 - :alignv 1.0 - :slope-up-traction 1.0 - :align-speed 1.0 - :turnvf 30.0 - :turnvvf 30.0 - :tiltvf 150.0 - :tiltvvf 15.0 - :mult-hook (lambda :behavior target - ((arg0 surface) (arg1 surface) (arg2 surface) (arg3 int)) - (surface-clamp-speed arg0 arg1 arg2 arg3) - (when (= arg3 1) - (cond - ((and (focus-test? self dark) (nonzero? (-> self darkjak)) (logtest? (-> self darkjak stage) 32)) - (set! (-> arg0 target-speed) 81920.0) - ) - ((and (focus-test? self dark) (nonzero? (-> self darkjak))) - (set! (-> arg0 target-speed) 40960.0) - ) - (else - (set! (-> arg0 target-speed) 16384.0) - ) - ) +(define *duck-mods* (new 'static 'surface + :name 'duck + :turnv 131072.0 + :turnvv 524288.0 + :tiltv 65536.0 + :tiltvv 262144.0 + :transv-max 16384.0 + :target-speed 16384.0 + :seek0 1.0 + :seek90 1.0 + :seek180 1.0 + :fric 1.0 + :nonlin-fric-dist 1.0 + :slip-factor 1.0 + :slide-factor 1.0 + :slope-up-factor 1.0 + :slope-down-factor 1.0 + :slope-slip-angle 1.0 + :impact-fric 1.0 + :bend-factor 1.0 + :bend-speed 1.0 + :alignv 1.0 + :slope-up-traction 1.0 + :align-speed 1.0 + :turnvf 30.0 + :turnvvf 30.0 + :tiltvf 150.0 + :tiltvvf 15.0 + :mult-hook (lambda :behavior target + ((arg0 surface) (arg1 surface) (arg2 surface) (arg3 int)) + (surface-clamp-speed arg0 arg1 arg2 arg3) + (when (= arg3 1) + (cond + ((and (focus-test? self dark) + (nonzero? (-> self darkjak)) + (logtest? (-> self darkjak stage) (darkjak-stage giant)) + ) + (set! (-> arg0 target-speed) 81920.0) + ) + ((and (focus-test? self dark) (nonzero? (-> self darkjak))) + (set! (-> arg0 target-speed) 40960.0) + ) + (else + (set! (-> arg0 target-speed) 16384.0) + ) + ) + ) + ) + :flags (surface-flag duck) + ) ) - ) - :flags (surface-flag duck) - ) - ) ;; failed to figure out what this is: (defstate target-duck-stance (target) @@ -833,7 +843,7 @@ (go target-duck-walk 'duck) ) (if (want-to-darkjak?) - (go target-darkjak-get-on 2) + (go target-darkjak-get-on (darkjak-stage active)) ) (when (and (logtest? (logior (logior (-> *cpad-list* cpads (-> self control cpad number) button0-rel 0) (-> *cpad-list* cpads (-> self control cpad number) button0-rel 1) @@ -990,7 +1000,7 @@ (go target-duck-stance 'duck) ) (if (want-to-darkjak?) - (go target-darkjak-get-on 2) + (go target-darkjak-get-on (darkjak-stage active)) ) (when (and (logtest? (logior (logior (-> *cpad-list* cpads (-> self control cpad number) button0-rel 0) (-> *cpad-list* cpads (-> self control cpad number) button0-rel 1) @@ -1916,7 +1926,10 @@ 600 1500 ) - (if (and (focus-test? self dark) (nonzero? (-> self darkjak)) (logtest? (-> self darkjak stage) 32)) + (if (and (focus-test? self dark) + (nonzero? (-> self darkjak)) + (logtest? (-> self darkjak stage) (darkjak-stage giant)) + ) (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))) @@ -3149,7 +3162,10 @@ ) ) ) - ((and (focus-test? self dark) (nonzero? (-> self darkjak)) (logtest? (-> self darkjak stage) 8)) + ((and (focus-test? self dark) + (nonzero? (-> self darkjak)) + (logtest? (-> self darkjak stage) (darkjak-stage bomb1)) + ) (set! (-> self control unknown-sound-id00) (add-process *gui-control* self (gui-channel jak) (gui-action queue) "darkbom1" -99.0 0) ) @@ -3401,7 +3417,10 @@ ((and (= (-> self fact eco-type) 1) (>= (-> self fact eco-level) 1.0)) (go target-yellow-jump-blast) ) - ((and (focus-test? self dark) (nonzero? (-> self darkjak)) (logtest? (-> self darkjak stage) 4)) + ((and (focus-test? self dark) + (nonzero? (-> self darkjak)) + (logtest? (-> self darkjak stage) (darkjak-stage bomb0)) + ) (go target-darkjak-bomb0) ) ) @@ -3472,7 +3491,10 @@ (when gp-1 (logior! (-> self control status) (collide-status on-surface)) (when (or (and (= (-> self fact eco-type) 2) (>= (-> self fact eco-level) 1.0)) - (and (focus-test? self dark) (nonzero? (-> self darkjak)) (logtest? (-> self darkjak stage) 2)) + (and (focus-test? self dark) + (nonzero? (-> self darkjak)) + (logtest? (-> self darkjak stage) (darkjak-stage active)) + ) ) (cpad-set-buzz! (-> *cpad-list* cpads 0) 1 255 (seconds 0.5)) (if (and (= (-> self fact eco-type) 2) (>= (-> self fact eco-level) 1.0)) diff --git a/test/decompiler/reference/jak2/engine/ui/minimap_REF.gc b/test/decompiler/reference/jak2/engine/ui/minimap_REF.gc index 83c72ead2d..e1a5e350ae 100644 --- a/test/decompiler/reference/jak2/engine/ui/minimap_REF.gc +++ b/test/decompiler/reference/jak2/engine/ui/minimap_REF.gc @@ -1163,7 +1163,6 @@ ) ;; definition for method 3 of type engine-minimap -;; INFO: this function exists in multiple non-identical object files (defmethod inspect engine-minimap ((obj engine-minimap)) ((the-as (function engine-minimap engine-minimap) (find-parent-method engine-minimap 3)) obj) (let ((s5-0 0) @@ -1986,12 +1985,7 @@ (set! (-> (the-as (pointer uint128) s3-1) 1) (-> obj draw2-tmpl quad 1)) (let ((s2-0 (new-stack-vector0))) (let ((s1-0 (new-stack-vector0))) - (let ((s0-0 s1-0) - (t9-3 matrix-local->world) - (a0-10 #f) - ) - (set! (-> s0-0 quad) (-> (t9-3 a0-10) vector 2 quad)) - ) + (set! (-> s1-0 quad) (-> (matrix-local->world #f #f) vector 2 quad)) (set! (-> s1-0 y) 0.0) (vector-normalize! s1-0 1.0) (let ((v1-16 (-> arg0 mat))) @@ -2772,3 +2766,7 @@ 0 (none) ) + + + + 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 4d2f0a7163..20602e00c7 100644 --- a/test/decompiler/reference/jak2/levels/atoll/sig0-course_REF.gc +++ b/test/decompiler/reference/jak2/levels/atoll/sig0-course_REF.gc @@ -182,8 +182,8 @@ ;; definition for function sig0-say-look-out-if-should (defun sig0-say-look-out-if-should ((arg0 sig-atoll)) - (when (logtest? (-> arg0 bot-task-bits) 4) - (when (not (logtest? (-> arg0 bot-task-bits) 16)) + (when (logtest? (-> arg0 bot-task-bits) (bot-task-bits botbits-2)) + (when (not (logtest? (-> arg0 bot-task-bits) (bot-task-bits botbits-4))) (let ((s5-0 (handle->process (-> arg0 focus handle)))) (when s5-0 (let ((v1-9 (if (type? s5-0 nav-enemy) @@ -193,14 +193,14 @@ ) (when v1-9 (if (>= 20480.0 (- (-> (the-as process-focusable v1-9) root trans y) (-> arg0 root trans y))) - (logior! (-> arg0 bot-task-bits) 16) + (logior! (-> arg0 bot-task-bits) (bot-task-bits botbits-4)) ) ) ) ) ) ) - (if (and (logtest? (-> arg0 bot-task-bits) 16) + (if (and (logtest? (-> arg0 bot-task-bits) (bot-task-bits botbits-4)) (not (speech-playing? arg0 26)) (not (channel-active? arg0 (the-as uint 0))) ) @@ -212,7 +212,7 @@ ;; definition for function sig-say-waste-the-suckers-if-should (defun sig-say-waste-the-suckers-if-should ((arg0 sig-atoll)) - (if (and (logtest? (-> arg0 bot-task-bits) 8) + (if (and (logtest? (-> arg0 bot-task-bits) (bot-task-bits botbits-3)) (not (speech-playing? arg0 25)) (not (channel-active? arg0 (the-as uint 0))) ) @@ -405,7 +405,7 @@ ) ) :on-update (lambda ((arg0 sig-atoll)) - (if (and (logtest? (-> arg0 bot-task-bits) 2) + (if (and (logtest? (-> arg0 bot-task-bits) (bot-task-bits botbits-1)) (not (speech-playing? arg0 33)) (not (channel-active? arg0 (the-as uint 0))) ) @@ -458,7 +458,7 @@ (none) ) :on-update (lambda ((arg0 sig-atoll)) - (if (and (logtest? (-> arg0 bot-task-bits) 2) + (if (and (logtest? (-> arg0 bot-task-bits) (bot-task-bits botbits-1)) (not (speech-playing? arg0 33)) (not (channel-active? arg0 (the-as uint 0))) ) @@ -781,7 +781,7 @@ (f1-0 98304.0) ) (if (>= f0-0 (* f1-0 f1-0)) - (logior! (-> arg0 waypoint-bits) 2) + (logior! (-> arg0 waypoint-bits) (waypoint-bits wabits-1)) ) ) (play-speech arg0 6) @@ -794,11 +794,11 @@ (function sigt-wait-spot sig symbol) (lambda ((arg0 object) (arg1 sig-atoll)) (with-pp - (when (and (not (logtest? (-> arg1 waypoint-bits) 4)) + (when (and (not (logtest? (-> arg1 waypoint-bits) (waypoint-bits wabits-2))) (outside-spot-radius? arg1 (the-as bot-spot #f) (the-as vector #f) #f) ) - (logand! (-> arg1 waypoint-bits) -5) - (when (not (logtest? (-> arg1 waypoint-bits) 1)) + (logclear! (-> arg1 waypoint-bits) (waypoint-bits wabits-2)) + (when (not (logtest? (-> arg1 waypoint-bits) (waypoint-bits wabits-0))) (let ((a1-2 (new 'stack-no-clear 'event-message-block))) (set! (-> a1-2 from) (process->ppointer pp)) (set! (-> a1-2 num-params) 0) @@ -830,8 +830,8 @@ a1-3 ) ((2) - (when (not (logtest? (-> arg1 waypoint-bits) 1)) - (logior! (-> arg1 waypoint-bits) 1) + (when (not (logtest? (-> arg1 waypoint-bits) (waypoint-bits wabits-0))) + (logior! (-> arg1 waypoint-bits) (waypoint-bits wabits-0)) (let ((a1-4 (new 'stack-no-clear 'event-message-block))) (set! (-> a1-4 from) (process->ppointer pp)) (set! (-> a1-4 num-params) 0) @@ -886,22 +886,22 @@ :on-update (lambda ((arg0 sig-atoll)) (with-pp (cond - ((and (logtest? (-> arg0 waypoint-bits) 2) + ((and (logtest? (-> arg0 waypoint-bits) (waypoint-bits wabits-1)) (outside-spot-radius? arg0 (the-as bot-spot #f) (the-as vector #f) #f) ) - (logand! (-> arg0 waypoint-bits) -3) + (logclear! (-> arg0 waypoint-bits) (waypoint-bits wabits-1)) (let ((f0-0 98304.0)) (if (>= (* f0-0 f0-0) (vector-vector-xz-distance-squared (target-pos 0) (-> arg0 root trans))) (play-speech arg0 34) ) ) ) - ((and (logtest? (-> arg0 waypoint-bits) 2) + ((and (logtest? (-> arg0 waypoint-bits) (waypoint-bits wabits-1)) (let ((f0-3 49152.0)) (>= (* f0-3 f0-3) (vector-vector-xz-distance-squared (target-pos 0) (-> arg0 root trans))) ) ) - (logand! (-> arg0 waypoint-bits) -3) + (logclear! (-> arg0 waypoint-bits) (waypoint-bits wabits-1)) (play-speech arg0 34) ) (else @@ -928,16 +928,18 @@ ) (when (and (demo?) (>= (- (current-time) (-> arg0 waypoint-time0)) (seconds 1)) - (logtest? (-> arg0 waypoint-bits) 16) + (logtest? (-> arg0 waypoint-bits) (waypoint-bits wabits-4)) ) - (logand! (-> arg0 waypoint-bits) -17) + (logclear! (-> arg0 waypoint-bits) (waypoint-bits wabits-4)) (talker-spawn-func (-> *talker-speech* 80) *entity-pool* (target-pos 0) (the-as region #f)) ) - (when (or (not (logtest? (-> arg0 waypoint-bits) 8)) (>= (- (current-time) (-> arg0 waypoint-time0)) (seconds 8))) - (if (and (demo?) (not (logtest? (-> arg0 waypoint-bits) 8))) - (logior! (-> arg0 waypoint-bits) 16) + (when (or (not (logtest? (-> arg0 waypoint-bits) (waypoint-bits wabits-3))) + (>= (- (current-time) (-> arg0 waypoint-time0)) (seconds 8)) + ) + (if (and (demo?) (not (logtest? (-> arg0 waypoint-bits) (waypoint-bits wabits-3)))) + (logior! (-> arg0 waypoint-bits) (waypoint-bits wabits-4)) ) - (logior! (-> arg0 waypoint-bits) 8) + (logior! (-> arg0 waypoint-bits) (waypoint-bits wabits-3)) (let* ((s5-4 (-> arg0 sig-course)) (s4-1 (-> s5-4 liftcat-speech-index)) ) @@ -990,7 +992,7 @@ (set! (-> arg1 too-far-warn-dist) 184320.0) (set! (-> arg1 too-far-fail-dist-delta) 122880.0) (cond - ((not (logtest? (-> arg1 waypoint-bits) 1)) + ((not (logtest? (-> arg1 waypoint-bits) (waypoint-bits wabits-0))) (when (outside-spot-radius? arg1 (the-as bot-spot #f) (the-as vector #f) #f) (let ((f0-2 (vector-vector-xz-distance-squared (-> arg1 root trans) (target-pos 0))) (f1-0 81920.0) @@ -1002,7 +1004,7 @@ (process-grab? *target* #t) ) (set! (-> arg1 waypoint-time0) (current-time)) - (logior! (-> arg1 waypoint-bits) 1) + (logior! (-> arg1 waypoint-bits) (waypoint-bits wabits-0)) (process-grab? arg1 #f) (process-grab? *target* #f) (reset-warn-time! arg1) @@ -1017,7 +1019,7 @@ ) ) ) - ((begin (reset-warn-time! arg1) (logtest? (-> arg1 waypoint-bits) 2)) + ((begin (reset-warn-time! arg1) (logtest? (-> arg1 waypoint-bits) (waypoint-bits wabits-1))) (when (>= (- (current-time) (-> arg1 waypoint-time0)) (seconds 4.5)) (process-release? arg1) (process-release? *target*) @@ -1030,7 +1032,7 @@ (else (when (>= (- (current-time) (-> arg1 waypoint-time0)) (seconds 3)) (remove-setting! 'entity-name) - (logior! (-> arg1 waypoint-bits) 2) + (logior! (-> arg1 waypoint-bits) (waypoint-bits wabits-1)) (set-setting! 'sound-mode #f 0.0 1) ) ) @@ -1080,7 +1082,7 @@ (with-pp (cond ((sig-plasma-method-10 (-> arg1 plasma)) - (when (not (logtest? (-> arg1 waypoint-bits) 1)) + (when (not (logtest? (-> arg1 waypoint-bits) (waypoint-bits wabits-0))) (let ((a1-1 (new 'stack-no-clear 'event-message-block))) (set! (-> a1-1 from) (process->ppointer pp)) (set! (-> a1-1 num-params) 0) @@ -1096,7 +1098,7 @@ ) ) ) - (logior! (-> arg1 waypoint-bits) 1) + (logior! (-> arg1 waypoint-bits) (waypoint-bits wabits-0)) ) (let ((s5-0 *target*)) (if (and s5-0 (let ((a1-2 (new 'stack-no-clear 'event-message-block))) @@ -1131,7 +1133,7 @@ ) ) (else - (when (logtest? (-> arg1 waypoint-bits) 1) + (when (logtest? (-> arg1 waypoint-bits) (waypoint-bits wabits-0)) (let ((a1-8 (new 'stack-no-clear 'event-message-block))) (set! (-> a1-8 from) (process->ppointer pp)) (set! (-> a1-8 num-params) 0) @@ -1147,7 +1149,7 @@ ) ) ) - (logand! (-> arg1 waypoint-bits) -2) + (logclear! (-> arg1 waypoint-bits) (waypoint-bits wabits-0)) ) ) ) @@ -1444,7 +1446,7 @@ ) ) ) - ((begin (reset-warn-time! arg1) (logtest? (-> arg1 waypoint-bits) 1)) + ((begin (reset-warn-time! arg1) (logtest? (-> arg1 waypoint-bits) (waypoint-bits wabits-0))) (when (>= (- (current-time) (-> arg1 waypoint-time0)) (seconds 4.5)) (process-release? arg1) (process-release? *target*) @@ -1457,7 +1459,7 @@ (else (when (>= (- (current-time) (-> arg1 waypoint-time0)) (seconds 3)) (remove-setting! 'entity-name) - (logior! (-> arg1 waypoint-bits) 1) + (logior! (-> arg1 waypoint-bits) (waypoint-bits wabits-0)) (set-setting! 'sound-mode #f 0.0 1) ) ) @@ -1508,7 +1510,7 @@ (with-pp (cond ((sig-plasma-method-10 (-> arg1 plasma)) - (when (not (logtest? (-> arg1 waypoint-bits) 1)) + (when (not (logtest? (-> arg1 waypoint-bits) (waypoint-bits wabits-0))) (let ((a1-1 (new 'stack-no-clear 'event-message-block))) (set! (-> a1-1 from) (process->ppointer pp)) (set! (-> a1-1 num-params) 0) @@ -1524,7 +1526,7 @@ ) ) ) - (logior! (-> arg1 waypoint-bits) 1) + (logior! (-> arg1 waypoint-bits) (waypoint-bits wabits-0)) ) (if (and *target* (let ((a1-2 (new 'stack-no-clear 'event-message-block))) @@ -1559,7 +1561,7 @@ ) ) (else - (when (logtest? (-> arg1 waypoint-bits) 1) + (when (logtest? (-> arg1 waypoint-bits) (waypoint-bits wabits-0)) (let ((a1-9 (new 'stack-no-clear 'event-message-block))) (set! (-> a1-9 from) (process->ppointer pp)) (set! (-> a1-9 num-params) 0) @@ -1575,7 +1577,7 @@ ) ) ) - (logand! (-> arg1 waypoint-bits) -2) + (logclear! (-> arg1 waypoint-bits) (waypoint-bits wabits-0)) ) ) ) @@ -1606,14 +1608,14 @@ (the-as (function sigt-wait-spot sig symbol) (lambda ((arg0 object) (arg1 sig-atoll)) - (when (and (not (logtest? (-> arg1 waypoint-bits) 1)) (scene-release? arg1)) + (when (and (not (logtest? (-> arg1 waypoint-bits) (waypoint-bits wabits-0))) (scene-release? arg1)) (remove-setting! 'sound-mode) (clear-poi-and-focus! arg1) (reset-warn-time! arg1) (play-speech arg1 17) - (logior! (-> arg1 waypoint-bits) 1) + (logior! (-> arg1 waypoint-bits) (waypoint-bits wabits-0)) ) - (when (and (logtest? (-> arg1 waypoint-bits) 1) (not (channel-active? arg1 (the-as uint 0)))) + (when (and (logtest? (-> arg1 waypoint-bits) (waypoint-bits wabits-0)) (not (channel-active? arg1 (the-as uint 0)))) (ai-task-control-method-12 (-> arg1 ai-ctrl) arg1) (go-to-waypoint! arg1 20 #f) (ai-task-control-method-10 (-> arg1 ai-ctrl) arg1) @@ -1711,8 +1713,10 @@ ) ) ) - (when (or (not (logtest? (-> arg1 waypoint-bits) 2)) (>= (- (current-time) (-> arg1 waypoint-time0)) (seconds 8))) - (logior! (-> arg1 waypoint-bits) 2) + (when (or (not (logtest? (-> arg1 waypoint-bits) (waypoint-bits wabits-1))) + (>= (- (current-time) (-> arg1 waypoint-time0)) (seconds 8)) + ) + (logior! (-> arg1 waypoint-bits) (waypoint-bits wabits-1)) (let* ((s5-1 (-> arg1 sig-course)) (s4-1 (-> s5-1 liftcat-speech-index)) ) @@ -1731,8 +1735,8 @@ ) ) ((= v1-6 2) - (when (not (logtest? (-> arg1 waypoint-bits) 1)) - (logior! (-> arg1 waypoint-bits) 1) + (when (not (logtest? (-> arg1 waypoint-bits) (waypoint-bits wabits-0))) + (logior! (-> arg1 waypoint-bits) (waypoint-bits wabits-0)) (let ((a1-8 (new 'stack-no-clear 'event-message-block))) (set! (-> a1-8 from) (process->ppointer pp)) (set! (-> a1-8 num-params) 0) @@ -1844,7 +1848,7 @@ ) ) ) - ((begin (reset-warn-time! arg1) (logtest? (-> arg1 waypoint-bits) 1)) + ((begin (reset-warn-time! arg1) (logtest? (-> arg1 waypoint-bits) (waypoint-bits wabits-0))) (when (>= (- (current-time) (-> arg1 waypoint-time0)) (seconds 4.5)) (process-release? arg1) (process-release? *target*) @@ -1857,7 +1861,7 @@ (else (when (>= (- (current-time) (-> arg1 waypoint-time0)) (seconds 3)) (remove-setting! 'entity-name) - (logior! (-> arg1 waypoint-bits) 1) + (logior! (-> arg1 waypoint-bits) (waypoint-bits wabits-0)) (set-setting! 'sound-mode #f 0.0 1) ) ) @@ -1906,7 +1910,7 @@ (with-pp (cond ((sig-plasma-method-10 (-> arg1 plasma)) - (when (not (logtest? (-> arg1 waypoint-bits) 1)) + (when (not (logtest? (-> arg1 waypoint-bits) (waypoint-bits wabits-0))) (let ((a1-1 (new 'stack-no-clear 'event-message-block))) (set! (-> a1-1 from) (process->ppointer pp)) (set! (-> a1-1 num-params) 0) @@ -1922,7 +1926,7 @@ ) ) ) - (logior! (-> arg1 waypoint-bits) 1) + (logior! (-> arg1 waypoint-bits) (waypoint-bits wabits-0)) ) (if (and *target* (let ((a1-2 (new 'stack-no-clear 'event-message-block))) @@ -1961,7 +1965,7 @@ ) ) (else - (when (logtest? (-> arg1 waypoint-bits) 1) + (when (logtest? (-> arg1 waypoint-bits) (waypoint-bits wabits-0)) (let ((a1-9 (new 'stack-no-clear 'event-message-block))) (set! (-> a1-9 from) (process->ppointer pp)) (set! (-> a1-9 num-params) 0) @@ -1977,7 +1981,7 @@ ) ) ) - (logand! (-> arg1 waypoint-bits) -2) + (logclear! (-> arg1 waypoint-bits) (waypoint-bits wabits-0)) ) ) ) @@ -2191,12 +2195,12 @@ ) ) ) - ((begin (reset-warn-time! arg1) (logtest? (-> arg1 waypoint-bits) 1)) - (when (and (not (logtest? (-> arg1 waypoint-bits) 2)) + ((begin (reset-warn-time! arg1) (logtest? (-> arg1 waypoint-bits) (waypoint-bits wabits-0))) + (when (and (not (logtest? (-> arg1 waypoint-bits) (waypoint-bits wabits-1))) (>= (- (current-time) (-> arg1 waypoint-time0)) (seconds 0.1)) ) (remove-setting! 'string-startup-vector) - (logior! (-> arg1 waypoint-bits) 2) + (logior! (-> arg1 waypoint-bits) (waypoint-bits wabits-1)) ) (when (>= (- (current-time) (-> arg1 waypoint-time0)) (seconds 3.5)) (process-release? arg1) @@ -2211,7 +2215,7 @@ (when (>= (- (current-time) (-> arg1 waypoint-time0)) (seconds 2)) (set-setting! 'string-startup-vector 'abs (new 'static 'vector :x 1.0) 0) (remove-setting! 'entity-name) - (logior! (-> arg1 waypoint-bits) 1) + (logior! (-> arg1 waypoint-bits) (waypoint-bits wabits-0)) (set-setting! 'sound-mode #f 0.0 1) ) ) @@ -2260,7 +2264,7 @@ (with-pp (cond ((sig-plasma-method-10 (-> arg1 plasma)) - (when (not (logtest? (-> arg1 waypoint-bits) 1)) + (when (not (logtest? (-> arg1 waypoint-bits) (waypoint-bits wabits-0))) (let ((a1-1 (new 'stack-no-clear 'event-message-block))) (set! (-> a1-1 from) (process->ppointer pp)) (set! (-> a1-1 num-params) 0) @@ -2276,7 +2280,7 @@ ) ) ) - (logior! (-> arg1 waypoint-bits) 1) + (logior! (-> arg1 waypoint-bits) (waypoint-bits wabits-0)) ) (if (and *target* (let ((a1-2 (new 'stack-no-clear 'event-message-block))) @@ -2311,7 +2315,7 @@ ) ) (else - (when (logtest? (-> arg1 waypoint-bits) 1) + (when (logtest? (-> arg1 waypoint-bits) (waypoint-bits wabits-0)) (let ((a1-9 (new 'stack-no-clear 'event-message-block))) (set! (-> a1-9 from) (process->ppointer pp)) (set! (-> a1-9 num-params) 0) @@ -2327,7 +2331,7 @@ ) ) ) - (logand! (-> arg1 waypoint-bits) -2) + (logclear! (-> arg1 waypoint-bits) (waypoint-bits wabits-0)) ) ) ) @@ -2357,14 +2361,14 @@ (the-as (function sigt-wait-spot sig symbol) (lambda ((arg0 object) (arg1 sig-atoll)) - (when (and (not (logtest? (-> arg1 waypoint-bits) 1)) (scene-release? arg1)) + (when (and (not (logtest? (-> arg1 waypoint-bits) (waypoint-bits wabits-0))) (scene-release? arg1)) (clear-poi-and-focus! arg1) (remove-setting! 'sound-mode) (reset-warn-time! arg1) (play-speech arg1 24) - (logior! (-> arg1 waypoint-bits) 1) + (logior! (-> arg1 waypoint-bits) (waypoint-bits wabits-0)) ) - (when (and (logtest? (-> arg1 waypoint-bits) 1) (not (channel-active? arg1 (the-as uint 0)))) + (when (and (logtest? (-> arg1 waypoint-bits) (waypoint-bits wabits-0)) (not (channel-active? arg1 (the-as uint 0)))) (ai-task-control-method-12 (-> arg1 ai-ctrl) arg1) (go-to-waypoint! arg1 31 #f) (ai-task-control-method-10 (-> arg1 ai-ctrl) arg1) @@ -2414,11 +2418,11 @@ :on-update (lambda ((arg0 sig-atoll)) (with-pp (cond - ((not (logtest? (-> arg0 bot-task-bits) 4)) + ((not (logtest? (-> arg0 bot-task-bits) (bot-task-bits botbits-2))) (when (and (>= (- (current-time) (-> arg0 waypoint-time0)) (seconds 0.25)) (< (-> arg0 sig-course spots 36 center x) (-> (target-pos 0) x)) ) - (logior! (-> arg0 bot-task-bits) 4) + (logior! (-> arg0 bot-task-bits) (bot-task-bits botbits-2)) (let ((a1-0 (new 'stack-no-clear 'event-message-block))) (set! (-> a1-0 from) (process->ppointer pp)) (set! (-> a1-0 num-params) 0) @@ -2464,8 +2468,8 @@ (set! (-> arg0 too-far-fail-dist-delta) 163840.0) (logclear! (-> arg0 focus-status) (focus-status disable)) (set! (-> arg0 notice-enemy-dist) 122880.0) - (when (not (logtest? (-> arg0 bot-task-bits) 4)) - (logior! (-> arg0 bot-task-bits) 4) + (when (not (logtest? (-> arg0 bot-task-bits) (bot-task-bits botbits-2))) + (logior! (-> arg0 bot-task-bits) (bot-task-bits botbits-2)) (let ((a1-0 (new 'stack-no-clear 'event-message-block))) (set! (-> a1-0 from) (process->ppointer pp)) (set! (-> a1-0 num-params) 0) @@ -2489,7 +2493,7 @@ (set! (-> (the-as sigt-wait-spot v1-18) check-done) (the-as (function sigt-wait-spot sig symbol) - (lambda ((arg0 object) (arg1 sig-atoll)) (when (logtest? (-> arg1 waypoint-bits) 1) + (lambda ((arg0 object) (arg1 sig-atoll)) (when (logtest? (-> arg1 waypoint-bits) (waypoint-bits wabits-0)) (ai-task-control-method-12 (-> arg1 ai-ctrl) arg1) (go-to-waypoint! arg1 33 #f) (ai-task-control-method-10 (-> arg1 ai-ctrl) arg1) @@ -2504,8 +2508,10 @@ ) :on-update (lambda ((arg0 sig-atoll)) (sig0-say-look-out-if-should arg0) - (when (and (not (logtest? (-> arg0 waypoint-bits) 1)) (>= (- (current-time) (-> arg0 waypoint-time0)) (seconds 8))) - (logior! (-> arg0 waypoint-bits) 1) + (when (and (not (logtest? (-> arg0 waypoint-bits) (waypoint-bits wabits-0))) + (>= (- (current-time) (-> arg0 waypoint-time0)) (seconds 8)) + ) + (logior! (-> arg0 waypoint-bits) (waypoint-bits wabits-0)) (logior! (-> arg0 focus-status) (focus-status disable)) (set! (-> arg0 notice-enemy-dist) 16384.0) ) @@ -2608,15 +2614,15 @@ (play-speech arg0 27) ) ) - ((not (logtest? (-> arg0 waypoint-bits) 1)) + ((not (logtest? (-> arg0 waypoint-bits) (waypoint-bits wabits-0))) (when (speech-ended? arg0 27) - (logior! (-> arg0 waypoint-bits) 1) + (logior! (-> arg0 waypoint-bits) (waypoint-bits wabits-0)) (logclear! (-> arg0 focus-status) (focus-status disable)) (set! (-> arg0 notice-enemy-dist) 122880.0) (set! (-> arg0 waypoint-time0) (current-time)) ) ) - ((not (logtest? (-> arg0 waypoint-bits) 2)) + ((not (logtest? (-> arg0 waypoint-bits) (waypoint-bits wabits-1))) (let ((a1-3 (new 'stack-no-clear 'event-message-block))) (set! (-> a1-3 from) (process->ppointer pp)) (set! (-> a1-3 num-params) 1) @@ -2640,7 +2646,7 @@ (>= (- (current-time) (-> arg0 waypoint-time0)) (seconds 10)) ) (logior! (-> arg0 bot-flags) (bot-flags bf21)) - (logior! (-> arg0 waypoint-bits) 2) + (logior! (-> arg0 waypoint-bits) (waypoint-bits wabits-1)) ) (else (if (and (>= (- (current-time) (-> arg0 waypoint-time0)) (seconds 4)) (not (speech-playing? arg0 28))) @@ -2813,12 +2819,12 @@ ) ) ) - ((begin (reset-warn-time! arg1) (logtest? (-> arg1 waypoint-bits) 1)) - (when (and (not (logtest? (-> arg1 waypoint-bits) 2)) + ((begin (reset-warn-time! arg1) (logtest? (-> arg1 waypoint-bits) (waypoint-bits wabits-0))) + (when (and (not (logtest? (-> arg1 waypoint-bits) (waypoint-bits wabits-1))) (>= (- (current-time) (-> arg1 waypoint-time0)) (seconds 0.1)) ) (remove-setting! 'string-startup-vector) - (logior! (-> arg1 waypoint-bits) 2) + (logior! (-> arg1 waypoint-bits) (waypoint-bits wabits-1)) ) (when (>= (- (current-time) (-> arg1 waypoint-time0)) (seconds 4.5)) (process-release? arg1) @@ -2833,7 +2839,7 @@ (when (>= (- (current-time) (-> arg1 waypoint-time0)) (seconds 3)) (set-setting! 'string-startup-vector 'abs (new 'static 'vector :x -1.0) 0) (remove-setting! 'entity-name) - (logior! (-> arg1 waypoint-bits) 1) + (logior! (-> arg1 waypoint-bits) (waypoint-bits wabits-0)) (set-setting! 'sound-mode #f 0.0 1) ) ) @@ -2891,7 +2897,7 @@ (with-pp (cond ((sig-plasma-method-10 (-> arg1 plasma)) - (when (not (logtest? (-> arg1 waypoint-bits) 1)) + (when (not (logtest? (-> arg1 waypoint-bits) (waypoint-bits wabits-0))) (let ((a1-1 (new 'stack-no-clear 'event-message-block))) (set! (-> a1-1 from) (process->ppointer pp)) (set! (-> a1-1 num-params) 0) @@ -2907,7 +2913,7 @@ ) ) ) - (logior! (-> arg1 waypoint-bits) 1) + (logior! (-> arg1 waypoint-bits) (waypoint-bits wabits-0)) ) (when (and *target* (let ((a1-2 (new 'stack-no-clear 'event-message-block))) @@ -2950,7 +2956,7 @@ ) ) (else - (when (logtest? (-> arg1 waypoint-bits) 1) + (when (logtest? (-> arg1 waypoint-bits) (waypoint-bits wabits-0)) (let ((a1-12 (new 'stack-no-clear 'event-message-block))) (set! (-> a1-12 from) (process->ppointer pp)) (set! (-> a1-12 num-params) 0) @@ -2966,7 +2972,7 @@ ) ) ) - (logand! (-> arg1 waypoint-bits) -2) + (logclear! (-> arg1 waypoint-bits) (waypoint-bits wabits-0)) ) ) ) diff --git a/test/decompiler/reference/jak2/levels/city/kiddogescort/hal4-course_REF.gc b/test/decompiler/reference/jak2/levels/city/kiddogescort/hal4-course_REF.gc index 3293b6f631..18c9de794c 100644 --- a/test/decompiler/reference/jak2/levels/city/kiddogescort/hal4-course_REF.gc +++ b/test/decompiler/reference/jak2/levels/city/kiddogescort/hal4-course_REF.gc @@ -857,23 +857,23 @@ (v1-10 (the-as process *traffic-manager*)) ) (cond - ((not (logtest? (-> arg1 waypoint-bits) 1)) + ((not (logtest? (-> arg1 waypoint-bits) (waypoint-bits wabits-0))) (when (and s4-0 (and s5-1 v1-10)) - (logior! (-> arg1 waypoint-bits) 1) + (logior! (-> arg1 waypoint-bits) (waypoint-bits wabits-0)) (set! (-> arg1 slave-handle 0) (process->handle s4-0)) (set! (-> arg1 slave-handle 1) (process->handle s5-1)) ) #f ) - ((not (logtest? (-> arg1 waypoint-bits) 2)) - (logior! (-> arg1 waypoint-bits) 2) + ((not (logtest? (-> arg1 waypoint-bits) (waypoint-bits wabits-1))) + (logior! (-> arg1 waypoint-bits) (waypoint-bits wabits-1)) (hal-method-226 arg1) (send-event s4-0 'request 'waypoint 2) (send-event s5-1 'request 'waypoint 2) #f ) - ((not (logtest? (-> arg1 waypoint-bits) 4)) - (logior! (-> arg1 waypoint-bits) 4) + ((not (logtest? (-> arg1 waypoint-bits) (waypoint-bits wabits-2))) + (logior! (-> arg1 waypoint-bits) (waypoint-bits wabits-2)) (let ((s5-2 *traffic-manager*)) (send-event s5-2 'deactivate-all) (let ((s4-1 (new 'stack 'traffic-object-spawn-params))) @@ -1258,9 +1258,11 @@ (function halt-wait-spot hal symbol) (lambda ((arg0 object) (arg1 hal-escort)) (hal-escort-method-232 arg1) - (when (and (not (logtest? (-> arg1 waypoint-bits) 1)) (not (-> *setting-control* user-current pilot-exit))) + (when (and (not (logtest? (-> arg1 waypoint-bits) (waypoint-bits wabits-0))) + (not (-> *setting-control* user-current pilot-exit)) + ) (send-event (handle->process (-> arg1 arrow-handle)) 'set-position (-> arg1 hal4-course spots 6)) - (logior! (-> arg1 waypoint-bits) 1) + (logior! (-> arg1 waypoint-bits) (waypoint-bits wabits-0)) ) (if (and (not (speech-playing? arg1 14)) (not (-> *setting-control* user-current pilot-exit)) @@ -1614,9 +1616,9 @@ (not (logtest? (-> s5-0 focus-status) (focus-status edge-grab))) ) ) - (when (not (logtest? (-> arg1 bot-task-bits) 1)) + (when (not (logtest? (-> arg1 bot-task-bits) (bot-task-bits botbits-0))) (send-event *traffic-manager* 'set-alert-duration (seconds 1)) - (logior! (-> arg1 bot-task-bits) 1) + (logior! (-> arg1 bot-task-bits) (bot-task-bits botbits-0)) ) (when (not (hal-escort-method-230 arg1)) (let* ((v1-34 (-> arg1 actor-group 0 data 2 actor)) @@ -1652,12 +1654,12 @@ ) ) (else - (when (logtest? (-> arg1 bot-task-bits) 1) + (when (logtest? (-> arg1 bot-task-bits) (bot-task-bits botbits-0)) (let ((s5-1 *traffic-manager*)) (send-event s5-1 'set-alert-level 1) (send-event s5-1 'set-alert-duration (seconds 36000)) ) - (logand! (-> arg1 bot-task-bits) -2) + (logclear! (-> arg1 bot-task-bits) (bot-task-bits botbits-0)) ) ) ) @@ -1737,10 +1739,10 @@ ) ) ) - (when (and (not (logtest? (-> arg1 waypoint-bits) 2)) + (when (and (not (logtest? (-> arg1 waypoint-bits) (waypoint-bits wabits-1))) (>= (- (current-time) (-> arg1 waypoint-time0)) (seconds 0.75)) ) - (logior! (-> arg1 waypoint-bits) 2) + (logior! (-> arg1 waypoint-bits) (waypoint-bits wabits-1)) (let ((s5-0 *traffic-manager*)) (send-event s5-0 'deactivate-by-type (traffic-type crimson-guard-1)) (send-event s5-0 'deactivate-by-type (traffic-type guard-bike)) @@ -1748,7 +1750,7 @@ (send-event s5-0 'deactivate-by-type (traffic-type traffic-type-20)) ) ) - (when (and (not (logtest? (-> arg1 waypoint-bits) 1)) + (when (and (not (logtest? (-> arg1 waypoint-bits) (waypoint-bits wabits-0))) (>= (- (current-time) (-> arg1 waypoint-time0)) (seconds 1.2)) ) (let* ((v1-55 (-> arg1 actor-group 0 data 2 actor)) @@ -1771,7 +1773,7 @@ ) ) ) - (logior! (-> arg1 waypoint-bits) 1) + (logior! (-> arg1 waypoint-bits) (waypoint-bits wabits-0)) (send-event a0-16 'request 'waypoint 26) ) (send-event s5-1 'request 'waypoint 26) @@ -1836,12 +1838,12 @@ (none) ) :on-update (lambda ((arg0 hal-escort)) - (when (not (logtest? (-> arg0 waypoint-bits) 1)) + (when (not (logtest? (-> arg0 waypoint-bits) (waypoint-bits wabits-0))) (let* ((a1-1 (nav-mesh-from-res-tag (-> arg0 entity) 'nav-mesh-actor 0)) (gp-0 (hal-escort-method-234 arg0 a1-1)) ) (when gp-0 - (logior! (-> arg0 waypoint-bits) 1) + (logior! (-> arg0 waypoint-bits) (waypoint-bits wabits-0)) (let* ((v1-8 (-> arg0 actor-group 0 data 1 actor)) (a0-3 (when v1-8 (let ((s5-1 (-> v1-8 extra process))) @@ -1974,12 +1976,12 @@ (none) ) :on-update (lambda ((arg0 hal-escort)) - (when (not (logtest? (-> arg0 waypoint-bits) 1)) + (when (not (logtest? (-> arg0 waypoint-bits) (waypoint-bits wabits-0))) (let* ((a1-1 (nav-mesh-from-res-tag (-> arg0 entity) 'nav-mesh-actor 1)) (gp-0 (hal-escort-method-234 arg0 a1-1)) ) (when gp-0 - (logior! (-> arg0 waypoint-bits) 1) + (logior! (-> arg0 waypoint-bits) (waypoint-bits wabits-0)) (let* ((v1-8 (-> arg0 actor-group 0 data 1 actor)) (a0-3 (when v1-8 (let ((s5-1 (-> v1-8 extra process))) diff --git a/test/decompiler/reference/jak2/levels/city/market/ashelin/ash4-course_REF.gc b/test/decompiler/reference/jak2/levels/city/market/ashelin/ash4-course_REF.gc index c947c5257e..e0b0b4640e 100644 --- a/test/decompiler/reference/jak2/levels/city/market/ashelin/ash4-course_REF.gc +++ b/test/decompiler/reference/jak2/levels/city/market/ashelin/ash4-course_REF.gc @@ -108,31 +108,32 @@ (set! (-> (the-as asht-wait-spot v1-7) check-done) (the-as (function asht-wait-spot ashelin symbol) - (lambda ((arg0 object) (arg1 ashelin-tanker)) (let ((v1-0 *traffic-manager*)) - (cond - ((not (logtest? (-> arg1 waypoint-bits) 1)) - (if v1-0 - (logior! (-> arg1 waypoint-bits) 1) - ) - #f - ) - ((not (logtest? (-> arg1 waypoint-bits) 2)) - (logior! (-> arg1 waypoint-bits) 2) - #f - ) - ((not (logtest? (-> arg1 waypoint-bits) 4)) - (logior! (-> arg1 waypoint-bits) 4) - #f - ) - (else - (ai-task-control-method-12 (-> arg1 ai-ctrl) arg1) - (go-to-waypoint! arg1 2 #f) - (ai-task-control-method-10 (-> arg1 ai-ctrl) arg1) - #t - ) - ) - ) + (lambda ((arg0 object) (arg1 ashelin-tanker)) + (let ((v1-0 *traffic-manager*)) + (cond + ((not (logtest? (-> arg1 waypoint-bits) (waypoint-bits wabits-0))) + (if v1-0 + (logior! (-> arg1 waypoint-bits) (waypoint-bits wabits-0)) + ) + #f + ) + ((not (logtest? (-> arg1 waypoint-bits) (waypoint-bits wabits-1))) + (logior! (-> arg1 waypoint-bits) (waypoint-bits wabits-1)) + #f + ) + ((not (logtest? (-> arg1 waypoint-bits) (waypoint-bits wabits-2))) + (logior! (-> arg1 waypoint-bits) (waypoint-bits wabits-2)) + #f + ) + (else + (ai-task-control-method-12 (-> arg1 ai-ctrl) arg1) + (go-to-waypoint! arg1 2 #f) + (ai-task-control-method-10 (-> arg1 ai-ctrl) arg1) + #t ) + ) + ) + ) ) ) ) @@ -176,13 +177,13 @@ (>= (-> v1-2 z) 1703936.0) (>= 2027520.0 (-> v1-2 z)) ) - (logior! (-> arg1 bot-task-bits) 1) + (logior! (-> arg1 bot-task-bits) (bot-task-bits botbits-0)) ) ) ) ) (let ((v1-8 (get-current-task-event (-> arg1 task)))) - (when (and (logtest? (-> arg1 bot-task-bits) 1) (= (-> v1-8 action) (game-task-action say))) + (when (and (logtest? (-> arg1 bot-task-bits) (bot-task-bits botbits-0)) (= (-> v1-8 action) (game-task-action say))) (ai-task-control-method-12 (-> arg1 ai-ctrl) arg1) (go-to-waypoint! arg1 3 #f) (ai-task-control-method-10 (-> arg1 ai-ctrl) arg1) @@ -270,7 +271,7 @@ (set-setting! 'music 'danger9 0.0 0) (set! (-> arg0 notice-enemy-dist) 245760.0) (logior! (-> arg0 bot-flags) (bot-flags bf06)) - (logand! (-> arg0 bot-task-bits) -3) + (logclear! (-> arg0 bot-task-bits) (bot-task-bits botbits-1)) (let ((a1-3 (new 'stack-no-clear 'event-message-block))) (set! (-> a1-3 from) (process->ppointer pp)) (set! (-> a1-3 num-params) 0) @@ -327,7 +328,7 @@ ) :on-update (lambda ((arg0 ashelin-tanker)) (suppress-traffic arg0) - (when (logtest? (-> arg0 bot-task-bits) 2) + (when (logtest? (-> arg0 bot-task-bits) (bot-task-bits botbits-1)) (ai-task-control-method-12 (-> arg0 ai-ctrl) arg0) (go-to-waypoint! arg0 9 #f) ) @@ -388,7 +389,7 @@ ) :on-update (lambda ((arg0 ashelin-tanker)) (suppress-traffic arg0) - (when (logtest? (-> arg0 bot-task-bits) 2) + (when (logtest? (-> arg0 bot-task-bits) (bot-task-bits botbits-1)) (ai-task-control-method-12 (-> arg0 ai-ctrl) arg0) (go-to-waypoint! arg0 9 #f) ) 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 cc634be63a..a392766ac6 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 @@ -9,7 +9,7 @@ (lambda :behavior task-manager () (set! (-> self data-float 0) (the-as float (send-event *target* 'test-pickup (pickup-type eco-pill-dark)))) - (send-event *target* 'change-mode 'darkjak #f 65) + (send-event *target* 'change-mode 'darkjak #f (darkjak-stage force-on no-anim)) (set! (-> self sound-id 0) (add-process *gui-control* self (gui-channel message) (gui-action play) (-> self name) 81920.0 0) ) @@ -26,7 +26,7 @@ (lambda :behavior task-manager () (send-event *target* 'get-pickup (pickup-type eco-pill-dark) (-> self data-float 0)) - (send-event *target* 'change-mode 'darkjak #f 128) + (send-event *target* 'change-mode 'darkjak #f (darkjak-stage disable-force-on)) (send-event *target* 'get-notify #f) (set-action! *gui-control* @@ -72,7 +72,7 @@ (lambda :behavior task-manager () (if (and *target* (not (logtest? (focus-status dark) (-> *target* focus-status)))) - (send-event *target* 'change-mode 'darkjak #f 65) + (send-event *target* 'change-mode 'darkjak #f (darkjak-stage force-on no-anim)) ) (when (= (get-status *gui-control* (-> self sound-id 0)) (gui-status active)) (let ((gp-1 @@ -107,7 +107,7 @@ (lambda :behavior task-manager () (set! (-> self data-float 0) (the-as float (send-event *target* 'test-pickup (pickup-type eco-pill-dark)))) - (send-event *target* 'change-mode 'darkjak #f 65) + (send-event *target* 'change-mode 'darkjak #f (darkjak-stage force-on no-anim)) (set! (-> self sound-id 0) (add-process *gui-control* self (gui-channel message) (gui-action play) (-> self name) 81920.0 0) ) @@ -124,7 +124,7 @@ (lambda :behavior task-manager () (send-event *target* 'get-pickup (pickup-type eco-pill-dark) (-> self data-float 0)) - (send-event *target* 'change-mode 'darkjak #f 128) + (send-event *target* 'change-mode 'darkjak #f (darkjak-stage disable-force-on)) (send-event *target* 'get-notify #f) (set-action! *gui-control* @@ -170,7 +170,7 @@ (lambda :behavior task-manager () (if (and *target* (not (logtest? (focus-status dark) (-> *target* focus-status)))) - (send-event *target* 'change-mode 'darkjak #f 65) + (send-event *target* 'change-mode 'darkjak #f (darkjak-stage force-on no-anim)) ) (when (= (get-status *gui-control* (-> self sound-id 0)) (gui-status active)) (let ((gp-1 @@ -205,7 +205,7 @@ (lambda :behavior task-manager () (set! (-> self data-float 0) (the-as float (send-event *target* 'test-pickup (pickup-type eco-pill-dark)))) - (send-event *target* 'change-mode 'darkjak #f 65) + (send-event *target* 'change-mode 'darkjak #f (darkjak-stage force-on no-anim)) (set! (-> self sound-id 0) (add-process *gui-control* self (gui-channel message) (gui-action play) (-> self name) 81920.0 0) ) @@ -223,7 +223,7 @@ (lambda :behavior task-manager () (send-event *target* 'get-pickup (pickup-type eco-pill-dark) (-> self data-float 0)) - (send-event *target* 'change-mode 'darkjak #f 128) + (send-event *target* 'change-mode 'darkjak #f (darkjak-stage disable-force-on)) (send-event *target* 'get-notify #f) (set-action! *gui-control* @@ -248,7 +248,7 @@ (lambda :behavior task-manager () (if (and *target* (not (logtest? (focus-status dark) (-> *target* focus-status)))) - (send-event *target* 'change-mode 'darkjak #f 65) + (send-event *target* 'change-mode 'darkjak #f (darkjak-stage force-on no-anim)) ) (when (= (get-status *gui-control* (-> self sound-id 0)) (gui-status active)) (let ((gp-1 @@ -283,7 +283,7 @@ (lambda :behavior task-manager () (set! (-> self data-float 0) (the-as float (send-event *target* 'test-pickup (pickup-type eco-pill-dark)))) - (send-event *target* 'change-mode 'darkjak #f 65) + (send-event *target* 'change-mode 'darkjak #f (darkjak-stage force-on no-anim)) (set! (-> self sound-id 0) (add-process *gui-control* self (gui-channel message) (gui-action play) (-> self name) 81920.0 0) ) @@ -300,7 +300,7 @@ (lambda :behavior task-manager () (send-event *target* 'get-pickup (pickup-type eco-pill-dark) (-> self data-float 0)) - (send-event *target* 'change-mode 'darkjak #f 128) + (send-event *target* 'change-mode 'darkjak #f (darkjak-stage disable-force-on)) (send-event *target* 'get-notify #f) (set-action! *gui-control* @@ -347,7 +347,7 @@ (lambda :behavior task-manager () (if (and *target* (not (logtest? (focus-status dark) (-> *target* focus-status)))) - (send-event *target* 'change-mode 'darkjak #f 65) + (send-event *target* 'change-mode 'darkjak #f (darkjak-stage force-on no-anim)) ) (when (= (get-status *gui-control* (-> self sound-id 0)) (gui-status active)) (let ((gp-1 diff --git a/test/decompiler/reference/jak2/levels/common/ai/bot-h_REF.gc b/test/decompiler/reference/jak2/levels/common/ai/bot-h_REF.gc index db5b3369b1..d4bae8bb2d 100644 --- a/test/decompiler/reference/jak2/levels/common/ai/bot-h_REF.gc +++ b/test/decompiler/reference/jak2/levels/common/ai/bot-h_REF.gc @@ -266,9 +266,9 @@ (ai-ctrl ai-task-control :offset-assert 648) (course bot-course :offset-assert 652) (waypoint bot-waypoint :offset-assert 656) - (waypoint-bits uint32 :offset-assert 660) + (waypoint-bits waypoint-bits :offset-assert 660) (waypoint-int32a int32 :offset-assert 664) - (bot-task-bits uint32 :offset-assert 668) + (bot-task-bits bot-task-bits :offset-assert 668) (hit-invuln-ignore-me-delay uint32 :offset-assert 672) (hit-invuln-focus-disable-delay uint32 :offset-assert 676) (warn-to-fail-timeout uint32 :offset-assert 680) 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 7794909ee8..fa65d2ee0f 100644 --- a/test/decompiler/reference/jak2/levels/common/ai/bot_REF.gc +++ b/test/decompiler/reference/jak2/levels/common/ai/bot_REF.gc @@ -1412,7 +1412,7 @@ If the player is too far, play a warning speech." (let ((waypoint (-> course waypoints i))) (when (= (-> waypoint waypoint-id) id) (set! (-> obj waypoint) waypoint) - (set! (-> obj waypoint-bits) (the-as uint 0)) + (set! (-> obj waypoint-bits) (waypoint-bits)) (set! (-> obj waypoint-time0) (current-time)) (set! (-> obj too-far-warn-dist) (-> obj too-far-warn-dist-default)) (set! (-> obj too-far-fail-dist-delta) (-> obj too-far-fail-dist-delta-default)) 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 f787ad1fcb..3361873b73 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 @@ -143,7 +143,7 @@ ;; definition of type amphibian (deftype amphibian (nav-enemy) ((tongue-scale float :offset-assert 604) - (flags uint8 :offset-assert 608) + (flags amphibian-flags :offset-assert 608) (knocked-anim-index int8 :offset-assert 609) (jump-anim-index int8 :offset-assert 610) (tongue-mode uint64 :offset-assert 616) @@ -1021,7 +1021,7 @@ ((>= f26-0 13.0) (set! s4-0 #t) ) - ((and (>= 1.0 f26-0) (logtest? (-> obj flags) 1)) + ((and (>= 1.0 f26-0) (logtest? (-> obj flags) (amphibian-flags amflags-0))) (set! s5-0 #t) ) ) @@ -1035,8 +1035,8 @@ ) ) (if s4-0 - (logior! (-> obj flags) 1) - (logand! (-> obj flags) -2) + (logior! (-> obj flags) (amphibian-flags amflags-0)) + (logclear! (-> obj flags) (amphibian-flags amflags-0)) ) ) (cond @@ -1059,7 +1059,7 @@ ) (set! (-> s5-3 frame-num) (ja-aframe f26-0 0)) ) - (logand! (-> obj flags) -2) + (logclear! (-> obj flags) (amphibian-flags amflags-0)) ) ) (else @@ -1081,7 +1081,7 @@ ) (set! (-> s5-4 frame-num) (ja-aframe f26-0 0)) ) - (logand! (-> obj flags) -2) + (logclear! (-> obj flags) (amphibian-flags amflags-0)) ) ) (else @@ -1095,7 +1095,7 @@ ) (set! (-> s5-5 frame-num) (ja-aframe f26-0 0)) ) - (logand! (-> obj flags) -2) + (logclear! (-> obj flags) (amphibian-flags amflags-0)) ) ) ) @@ -1120,7 +1120,7 @@ ) (set! (-> s5-6 frame-num) (ja-aframe f26-0 0)) ) - (logand! (-> obj flags) -2) + (logclear! (-> obj flags) (amphibian-flags amflags-0)) ) ) ) diff --git a/test/decompiler/reference/jak2/levels/common/enemy/grenadier_REF.gc b/test/decompiler/reference/jak2/levels/common/enemy/grenadier_REF.gc index 083c7a5d57..ef11382066 100644 --- a/test/decompiler/reference/jak2/levels/common/enemy/grenadier_REF.gc +++ b/test/decompiler/reference/jak2/levels/common/enemy/grenadier_REF.gc @@ -80,7 +80,7 @@ (heading symbol :offset-assert 724) (move-pos vector :inline :offset-assert 736) (move-angle float :offset-assert 752) - (status-flags uint64 :offset-assert 760) + (status-flags grenadier-flags :offset-assert 760) (suppress-knockaside-timer time-frame :offset-assert 768) ) :heap-base #x290 @@ -329,7 +329,7 @@ ) (return #t) ) - (logior! (-> obj status-flags) 1) + (logior! (-> obj status-flags) (grenadier-flags grflags-0)) (set! (-> obj suppress-knockaside-timer) (current-time)) ) ((method-of-type nav-enemy general-event-handler) obj arg0 arg1 arg2 arg3) @@ -558,7 +558,7 @@ ) (grenadier-method-181 self) (look-at-target! self (enemy-flag death-start)) - (logand! (-> self status-flags) -2) + (logclear! (-> self status-flags) (grenadier-flags grflags-0)) (none) ) :trans (behavior () @@ -931,7 +931,7 @@ (logior! (-> self nav flags) (nav-control-flag update-heading-from-facing)) (logclear! (-> self nav flags) (nav-control-flag update-heading-from-facing)) ) - (logand! (-> self status-flags) -3) + (logclear! (-> self status-flags) (grenadier-flags grflags-1)) (if (logtest? (-> self enemy-flags) (enemy-flag check-water)) (logior! (-> self focus-status) (focus-status dangerous)) (logclear! (-> self focus-status) (focus-status dangerous)) @@ -958,7 +958,7 @@ ) 0 (logclear! (-> self nav flags) (nav-control-flag update-heading-from-facing)) - (logior! (-> self status-flags) 2) + (logior! (-> self status-flags) (grenadier-flags grflags-1)) (ja-no-eval :group! grenadier-run-to-throw-ja :num! (seek! (the float (+ (-> (the-as art-joint-anim grenadier-run-to-throw-ja) frames num-frames) -1)) f30-0) :frame-num 0.0 @@ -968,7 +968,7 @@ (ja :num! (seek! max f30-0)) ) (ja-channel-push! 1 (seconds 0.067)) - (logand! (-> self status-flags) -3) + (logclear! (-> self status-flags) (grenadier-flags grflags-1)) (if (logtest? (enemy-flag enemy-flag43) (-> self enemy-flags)) (logior! (-> self nav flags) (nav-control-flag update-heading-from-facing)) (logclear! (-> self nav flags) (nav-control-flag update-heading-from-facing)) @@ -981,7 +981,7 @@ ) 0 (cond - ((logtest? (-> self status-flags) 1) + ((logtest? (-> self status-flags) (grenadier-flags grflags-0)) (ja-channel-push! 1 (seconds 0.135)) (ja-no-eval :group! grenadier-throw-quick-ja :num! (seek! (the float (+ (-> (the-as art-joint-anim grenadier-throw-quick-ja) frames num-frames) -1)) f30-0) @@ -991,7 +991,7 @@ (suspend) (ja :num! (seek! max f30-0)) ) - (logand! (-> self status-flags) -2) + (logclear! (-> self status-flags) (grenadier-flags grflags-0)) ) (else (when (not (enemy-method-96 self 1820.4445 #t)) @@ -1166,7 +1166,7 @@ ;; definition for method 70 of type grenadier (defmethod go-hostile grenadier ((obj grenadier)) (if (and (and (-> obj next-state) (= (-> obj next-state name) 'knocked)) - (and (logtest? (-> obj status-flags) 1) + (and (logtest? (-> obj status-flags) (grenadier-flags grflags-0)) (handle->process (-> obj focus handle)) (not (logtest? (-> (the-as process-focusable (handle->process (-> obj focus handle))) focus-status) (focus-status disable dead ignore grabbed) @@ -1219,7 +1219,7 @@ ;; WARN: Return type mismatch int vs none. (defmethod nav-enemy-method-142 grenadier ((obj grenadier) (arg0 nav-control)) (local-vars (a0-4 int) (a0-6 int)) - (b! (logtest? (-> obj status-flags) 2) cfg-6 :delay (empty-form)) + (b! (logtest? (-> obj status-flags) (grenadier-flags grflags-1)) cfg-6 :delay (empty-form)) (let ((v1-3 (new 'stack-no-clear 'vector)) (a2-0 (new 'stack-no-clear 'vector)) ) @@ -1416,7 +1416,7 @@ ) ) (set! (-> obj move-angle) 5461.3335) - (set! (-> obj status-flags) (the-as uint 0)) + (set! (-> obj status-flags) (grenadier-flags)) (set! (-> obj suppress-knockaside-timer) 0) (set-vector! (-> obj root scale) 1.5 1.5 1.5 1.0) (set! (-> obj joint) (new 'process 'joint-mod-blend-world obj 17 #f 0.0)) diff --git a/test/decompiler/reference/jak2/levels/common/enemy/hover/hover-nav-control-h_REF.gc b/test/decompiler/reference/jak2/levels/common/enemy/hover/hover-nav-control-h_REF.gc index 7ae170791c..4a387e1600 100644 --- a/test/decompiler/reference/jak2/levels/common/enemy/hover/hover-nav-control-h_REF.gc +++ b/test/decompiler/reference/jak2/levels/common/enemy/hover/hover-nav-control-h_REF.gc @@ -395,7 +395,7 @@ (deftype hover-nav-control (basic) ((root collide-shape-moving :offset-assert 4) (nav nav-network :offset-assert 8) - (flags uint16 :offset-assert 12) + (flags hover-nav-flags :offset-assert 12) (params hover-nav-params :offset-assert 16) (path-timer time-frame :offset-assert 24) (transvv vector :inline :offset-assert 32) diff --git a/test/decompiler/reference/jak2/levels/common/enemy/hover/hover-nav-control_REF.gc b/test/decompiler/reference/jak2/levels/common/enemy/hover/hover-nav-control_REF.gc index aa1a1573c5..9f0c85cc6f 100644 --- a/test/decompiler/reference/jak2/levels/common/enemy/hover/hover-nav-control_REF.gc +++ b/test/decompiler/reference/jak2/levels/common/enemy/hover/hover-nav-control_REF.gc @@ -1281,7 +1281,7 @@ ) (hover-nav-control-method-29 obj (the-as vector #f)) (set! (-> obj path-info curr-segment) (-> obj path-info segment-list)) - (logior! (-> obj flags) 1) + (logior! (-> obj flags) (hover-nav-flags honflags-0)) 0 (none) ) @@ -1301,7 +1301,7 @@ ) (hover-nav-control-method-29 obj (the-as vector #f)) (set! (-> obj path-info curr-segment) (-> obj path-info segment-list)) - (logior! (-> obj flags) 1) + (logior! (-> obj flags) (hover-nav-flags honflags-0)) 0 (none) ) @@ -1310,7 +1310,7 @@ ;; WARN: Return type mismatch int vs none. (defmethod hover-nav-control-method-20 hover-nav-control ((obj hover-nav-control)) (hover-nav-control-method-21 obj) - (logand! (-> obj flags) -2) + (logclear! (-> obj flags) (hover-nav-flags honflags-0)) 0 (none) ) @@ -1367,7 +1367,7 @@ ;; INFO: Used lq/sq ;; WARN: Return type mismatch int vs none. (defmethod hover-nav-control-method-24 hover-nav-control ((obj hover-nav-control)) - (when (not (logtest? (-> obj flags) 1)) + (when (not (logtest? (-> obj flags) (hover-nav-flags honflags-0))) (let ((s5-0 (new 'stack-no-clear 'collide-query))) (-> obj params) (let ((v1-5 (hover-nav-control-method-17 obj)) @@ -1393,11 +1393,11 @@ (cond ((>= f0-4 0.0) (set! (-> obj los-obstruction-distance) (* f0-4 (vector-length s4-0))) - (logior! (-> obj flags) 2) + (logior! (-> obj flags) (hover-nav-flags honflags-1)) ) (else (set! (-> obj los-last-clear-time) (current-time)) - (logand! (-> obj flags) -3) + (logclear! (-> obj flags) (hover-nav-flags honflags-1)) ) ) ) @@ -1429,7 +1429,7 @@ ) ) ) - (when (not (logtest? (-> obj flags) 1)) + (when (not (logtest? (-> obj flags) (hover-nav-flags honflags-0))) (cond ((and arg0 (and (< (vector-vector-distance arg0 (-> obj root trans)) 40960.0) (>= (-> obj los-last-clear-time) (+ (current-time) (seconds -0.2))) @@ -1519,7 +1519,7 @@ (add-debug-sphere #t (bucket-id debug-no-zbuf1) s4-1 (meters 0.8) *color-magenta*) ) (let ((f0-19 (+ 2048.0 (vector-length (-> obj root transv))))) - (if (logtest? (-> obj flags) 2) + (if (logtest? (-> obj flags) (hover-nav-flags honflags-1)) (set! f0-19 (fmin f0-19 (fmax 8192.0 (-> obj los-obstruction-distance)))) ) (hover-nav-path-segment-method-9 s2-1 f0-19) @@ -1583,7 +1583,7 @@ (-> pp clock seconds-per-frame) ) (let ((f0-12 (vector-length (the-as vector (&-> s5-0 next)))) - (f1-6 (if (logtest? (-> obj flags) 2) + (f1-6 (if (logtest? (-> obj flags) (hover-nav-flags honflags-1)) (fmax 8192.0 (* 0.8 (-> obj los-obstruction-distance))) f30-0 ) @@ -1702,7 +1702,7 @@ (v1-2 (vector-! (new 'stack-no-clear 'vector) (the-as vector s3-0) (-> s5-0 trans))) (s4-1 (vector-! (new 'stack-no-clear 'vector) (-> obj dest-pos) v1-2)) ) - (when (not (logtest? (-> obj flags) 1)) + (when (not (logtest? (-> obj flags) (hover-nav-flags honflags-0))) (let* ((s2-0 (-> obj root transv)) (f30-0 (vector-length s2-0)) (s1-0 lerp-scale) @@ -1820,7 +1820,7 @@ (set! (-> s5-0 path-info tail-segment) #f) (set! (-> s5-0 path-info curr-segment) #f) (set! (-> s5-0 path-info curr-u) 0.0) - (set! (-> s5-0 flags) (the-as uint 0)) + (set! (-> s5-0 flags) (hover-nav-flags)) (set! (-> s5-0 params) arg2) (set! *hover-nav-time-offset* (+ *hover-nav-time-offset* 1)) (vector-reset! (-> s5-0 dest-pos)) diff --git a/test/decompiler/reference/jak2/levels/common/enemy/spyder_REF.gc b/test/decompiler/reference/jak2/levels/common/enemy/spyder_REF.gc index b77ed1525f..9988a7d3c1 100644 --- a/test/decompiler/reference/jak2/levels/common/enemy/spyder_REF.gc +++ b/test/decompiler/reference/jak2/levels/common/enemy/spyder_REF.gc @@ -65,7 +65,7 @@ (start-pos vector :inline :offset-assert 768) (face-pos vector :inline :offset 800) (my-up-vector vector :inline :offset-assert 816) - (status-flags uint64 :offset-assert 832) + (status-flags spyder-flags :offset-assert 832) (change-dir-timer time-frame :offset-assert 840) (fire-info vector 2 :inline :offset-assert 848) (joint-ik joint-mod-ik 4 :offset 880) @@ -333,7 +333,7 @@ ) (('attack) (if (type? (-> arg0 parent 0) enemy) - (logior! (-> obj status-flags) 2) + (logior! (-> obj status-flags) (spyder-flags spflags-1)) ) ((method-of-type nav-enemy general-event-handler) obj arg0 arg1 arg2 arg3) ) @@ -439,8 +439,8 @@ (cond ((>= 143360.0 f0-0) (let ((s3-0 (new 'stack-no-clear 'vector))) - (logxor! (-> obj status-flags) 16) - (if (logtest? (-> obj status-flags) 16) + (logxor! (-> obj status-flags) (spyder-flags spflags-4)) + (if (logtest? (-> obj status-flags) (spyder-flags spflags-4)) (set-vector! s3-0 (-> s2-1 z) (-> s2-1 y) (- (-> s2-1 x)) 1.0) (set-vector! s3-0 (- (-> s2-1 z)) (-> s2-1 y) (-> s2-1 x) 1.0) ) @@ -613,7 +613,7 @@ ;; WARN: Return type mismatch int vs none. (defbehavior spyder-travel-post spyder () (set! (-> self face-pos quad) (-> self move-dest quad)) - (logior! (-> self status-flags) 8) + (logior! (-> self status-flags) (spyder-flags spflags-3)) (nav-enemy-travel-post) 0 (none) @@ -623,7 +623,7 @@ ;; INFO: Used lq/sq ;; WARN: Return type mismatch int vs none. (defbehavior spyder-face-player-post spyder () - (logior! (-> self status-flags) 8) + (logior! (-> self status-flags) (spyder-flags spflags-3)) (let ((gp-0 (handle->process (-> self focus handle))) (f30-0 (-> self nav max-rotation-rate)) ) @@ -652,10 +652,10 @@ (defmethod spyder-method-182 spyder ((obj spyder)) (with-pp (cond - ((and (logtest? (-> obj status-flags) 4) (!= (-> obj joint scale z) 1.0)) + ((and (logtest? (-> obj status-flags) (spyder-flags spflags-2)) (!= (-> obj joint scale z) 1.0)) (seek! (-> obj joint scale z) 1.0 (* 0.8 (-> pp clock seconds-per-frame))) ) - ((and (not (logtest? (-> obj status-flags) 4)) (!= (-> obj joint scale z) 0.0)) + ((and (not (logtest? (-> obj status-flags) (spyder-flags spflags-2))) (!= (-> obj joint scale z) 0.0)) (seek! (-> obj joint scale z) 0.0 (* 0.8 (-> pp clock seconds-per-frame))) ) ) @@ -670,9 +670,9 @@ (s3-0 (vector-z-quaternion! (new 'stack-no-clear 'vector) (-> obj root quat))) ) (cond - ((logtest? (-> obj status-flags) 8) + ((logtest? (-> obj status-flags) (spyder-flags spflags-3)) (vector-! s4-1 (-> obj face-pos) (-> obj root trans)) - (logand! (-> obj status-flags) -9) + (logclear! (-> obj status-flags) (spyder-flags spflags-3)) ) (else (set! (-> s4-1 quad) (-> s3-0 quad)) @@ -703,7 +703,7 @@ ;; WARN: Return type mismatch int vs none. (defmethod spyder-method-184 spyder ((obj spyder) (arg0 vector)) (with-pp - (when (not (logtest? (-> obj status-flags) 1)) + (when (not (logtest? (-> obj status-flags) (spyder-flags spflags-0))) (let ((s4-0 (new 'stack-no-clear 'vector))) (set! (-> s4-0 quad) (-> *up-vector* quad)) (let ((s3-0 (new 'stack-no-clear 'quaternion))) @@ -716,7 +716,7 @@ (forward-up-nopitch->quaternion (-> obj root quat) arg0 s3-1) ) ) - (logior! (-> obj status-flags) 1) + (logior! (-> obj status-flags) (spyder-flags spflags-0)) ) 0 (none) @@ -737,8 +737,8 @@ (let ((t9-6 (method-of-type nav-enemy track-target!))) (t9-6 obj) ) - (logand! (-> obj status-flags) -2) - (if (logtest? (-> obj status-flags) 32) + (logclear! (-> obj status-flags) (spyder-flags spflags-0)) + (if (logtest? (-> obj status-flags) (spyder-flags spflags-5)) (los-control-method-9 (-> obj los) (the-as process-focusable #f) (the-as vector #f) 2048.0) ) (if (-> obj predator-effect?) @@ -758,7 +758,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) @@ -948,7 +947,7 @@ ) (spyder-method-181 self) (look-at-target! self (enemy-flag death-start)) - (logand! (-> self status-flags) -3) + (logclear! (-> self status-flags) (spyder-flags spflags-1)) (when (!= (-> self dest-fade) 128.0) (set! (-> self shock-effect-end) (+ (current-time) (seconds 1))) (set! (-> self dest-fade) 128.0) @@ -962,7 +961,7 @@ (t9-0) ) ) - (logand! (-> self status-flags) -33) + (logclear! (-> self status-flags) (spyder-flags spflags-5)) (look-at-target! self (enemy-flag lock-focus)) (none) ) @@ -988,7 +987,7 @@ (spyder-method-181 self) ) ((>= 24576.0 f0-0) - (logior! (-> self status-flags) 32) + (logior! (-> self status-flags) (spyder-flags spflags-5)) ) ) ) @@ -1239,9 +1238,11 @@ ;; definition for method 70 of type spyder ;; WARN: Return type mismatch object vs none. (defmethod go-hostile spyder ((obj spyder)) - (if (and (not (logtest? (-> obj status-flags) 2)) (-> obj next-state) (let ((v1-5 (-> obj next-state name))) - (or (= v1-5 'notice) (= v1-5 'knocked)) - ) + (if (and (not (logtest? (-> obj status-flags) (spyder-flags spflags-1))) + (-> obj next-state) + (let ((v1-5 (-> obj next-state name))) + (or (= v1-5 'notice) (= v1-5 'knocked)) + ) ) (go (method-of-object obj attack)) ) @@ -1258,7 +1259,7 @@ (t9-0) ) ) - (logand! (-> self status-flags) -5) + (logclear! (-> self status-flags) (spyder-flags spflags-2)) (dotimes (gp-0 4) (enable-set! (-> self joint-ik gp-0) #f) ) @@ -1271,7 +1272,7 @@ ) ) (when (nonzero? (-> self hit-points)) - (logior! (-> self status-flags) 4) + (logior! (-> self status-flags) (spyder-flags spflags-2)) (dotimes (gp-0 4) (enable-set! (-> self joint-ik gp-0) #t) ) @@ -1469,9 +1470,9 @@ (set-gravity-length (-> obj root dynam) 573440.0) (set-vector! (-> obj root scale) 1.5 1.5 1.5 1.0) (set! (-> obj my-up-vector quad) (-> *up-vector* quad)) - (set! (-> obj status-flags) (the-as uint 4)) + (set! (-> obj status-flags) (spyder-flags spflags-2)) (if (rand-vu-percent? 0.5) - (logior! (-> obj status-flags) 16) + (logior! (-> obj status-flags) (spyder-flags spflags-4)) ) (set! (-> obj start-pos quad) (-> obj root trans quad)) (set! (-> obj sound) @@ -1510,3 +1511,7 @@ 0 (none) ) + + + + 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 f548dc336f..287ebd5e2f 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 @@ -295,24 +295,24 @@ ;; definition of type gun-buoy (deftype gun-buoy (nav-enemy) - ((gun-elev-jmod joint-mod :offset-assert 604) - (start-pos vector :inline :offset-assert 608) - (aim-dir vector :inline :offset-assert 624) - (banking-quat quaternion :inline :offset 656) - (offset-from-player vector :inline :offset-assert 672) - (offset-y-angular float :offset-assert 688) - (elev-angle float :offset-assert 692) - (y-final float :offset-assert 696) - (y-offset float :offset-assert 700) - (y-bob float :offset-assert 704) - (y-speed float :offset-assert 708) - (warning-interval time-frame :offset-assert 712) - (warning-timer time-frame :offset-assert 720) - (splash-timer time-frame :offset-assert 728) - (stare-down-timer time-frame :offset-assert 736) - (warning-id sound-id :offset-assert 744) - (voice-id sound-id :offset-assert 748) - (flags uint16 :offset-assert 752) + ((gun-elev-jmod joint-mod :offset-assert 604) + (start-pos vector :inline :offset-assert 608) + (aim-dir vector :inline :offset-assert 624) + (banking-quat quaternion :inline :offset 656) + (offset-from-player vector :inline :offset-assert 672) + (offset-y-angular float :offset-assert 688) + (elev-angle float :offset-assert 692) + (y-final float :offset-assert 696) + (y-offset float :offset-assert 700) + (y-bob float :offset-assert 704) + (y-speed float :offset-assert 708) + (warning-interval time-frame :offset-assert 712) + (warning-timer time-frame :offset-assert 720) + (splash-timer time-frame :offset-assert 728) + (stare-down-timer time-frame :offset-assert 736) + (warning-id sound-id :offset-assert 744) + (voice-id sound-id :offset-assert 748) + (flags gun-buoy-flags :offset-assert 752) ) :heap-base #x280 :method-count-assert 184 @@ -388,7 +388,7 @@ (set! (-> s4-0 y) (fmax (-> s4-0 y) (-> (the-as process-focusable gp-0) water height))) (vector+! s5-0 s4-0 v1-8) (cond - ((logtest? (-> self flags) 1) + ((logtest? (-> self flags) (gun-buoy-flags gubflags-0)) (cloest-point-on-mesh (-> self nav) s5-0 s5-0 (the-as nav-poly #f)) (let ((v1-14 (-> self root trans))) (vector-length (vector-! (new 'stack-no-clear 'vector) v1-14 s5-0)) @@ -452,15 +452,15 @@ :event (behavior ((proc process) (arg1 int) (event-type symbol) (event event-message-block)) (case event-type (('kill-player) - (logior! (-> self flags) 4) + (logior! (-> self flags) (gun-buoy-flags gubflags-2)) (go-virtual ambush) ) ) ) :enter (behavior () (set! (-> self root trans quad) (-> self start-pos quad)) - (logand! (-> self flags) -3) - (logand! (-> self flags) -5) + (logclear! (-> self flags) (gun-buoy-flags gubflags-1)) + (logclear! (-> self flags) (gun-buoy-flags gubflags-2)) (none) ) :trans (behavior () @@ -469,7 +469,7 @@ (-> *setting-control* user-current gun-buoy) ) (if (logtest? (-> self fact enemy-options) (enemy-option user0)) - (logior! (-> self flags) 4) + (logior! (-> self flags) (gun-buoy-flags gubflags-2)) ) (go-ambush self) ) @@ -495,7 +495,7 @@ ) 0 (nav-enemy-method-166 self) - (logior! (-> self flags) 1) + (logior! (-> self flags) (gun-buoy-flags gubflags-0)) (logior! (-> self water flags) (water-flags touch-water)) (let* ((gp-0 *target*) (s3-0 (if (type? gp-0 process-focusable) @@ -556,7 +556,7 @@ :trans (behavior () (when (< (fabs (-> self y-offset)) 409.6) (set! (-> self y-offset) 0.0) - (when (not (logtest? (-> self flags) 4)) + (when (not (logtest? (-> self flags) (gun-buoy-flags gubflags-2))) (set! *gun-buoy-warning-index* (rand-vu-int-range 0 (+ (-> *gun-buoy-warning-speech* length) -1))) (let ((t0-0 (-> *gun-buoy-warning-speech* *gun-buoy-warning-index*))) (set! (-> self voice-id) (add-process *gui-control* self (gui-channel guard) (gui-action play) t0-0 -99.0 0)) @@ -601,7 +601,7 @@ (defstate exit-ambush (gun-buoy) :virtual #t :enter (behavior () - (logand! (-> self flags) -2) + (logclear! (-> self flags) (gun-buoy-flags gubflags-0)) (none) ) :exit (behavior () @@ -681,7 +681,7 @@ ) ) (set! (-> self gun-elev-jmod mode) (the-as joint-mod-mode #t)) - (if (logtest? (-> self flags) 4) + (if (logtest? (-> self flags) (gun-buoy-flags gubflags-2)) (go-virtual attack) ) (case (-> self focus aware) @@ -749,14 +749,14 @@ :event (behavior ((proc process) (arg1 int) (event-type symbol) (event event-message-block)) (case event-type (('kill-player) - (logior! (-> self flags) 4) + (logior! (-> self flags) (gun-buoy-flags gubflags-2)) (go-virtual attack) ) ) ) :enter (behavior () (cond - ((logtest? (-> self flags) 2) + ((logtest? (-> self flags) (gun-buoy-flags gubflags-1)) (set! (-> self warning-interval) (seconds 0.1)) ) (else @@ -796,7 +796,7 @@ (when (>= (- (current-time) (-> self warning-timer)) (-> self warning-interval)) (cond ((>= (the-as int gp-0) 3) - (logior! (-> self flags) 2) + (logior! (-> self flags) (gun-buoy-flags gubflags-1)) (go-hostile self) ) (else @@ -886,7 +886,7 @@ :virtual #t :trans (behavior () (let ((v1-0 (-> self focus aware))) - (when (not (logtest? (-> self flags) 4)) + (when (not (logtest? (-> self flags) (gun-buoy-flags gubflags-2))) (if (>= 2 (the-as int v1-0)) (go-virtual hostile) ) @@ -1069,7 +1069,7 @@ ;; definition for method 70 of type gun-buoy ;; WARN: Return type mismatch object vs none. (defmethod go-hostile gun-buoy ((obj gun-buoy)) - (if (logtest? (-> obj flags) 2) + (if (logtest? (-> obj flags) (gun-buoy-flags gubflags-1)) (go (method-of-object obj hostile)) (go (method-of-object obj warning)) ) @@ -1343,7 +1343,7 @@ (logclear! (-> obj mask) (process-mask actor-pause)) (process-entity-status! obj (entity-perm-status no-kill) #t) (set! (-> obj start-pos quad) (-> obj root trans quad)) - (set! (-> obj flags) (the-as uint 0)) + (set! (-> obj flags) (gun-buoy-flags)) (set! (-> obj gun-elev-jmod) (the-as joint-mod (new 'process 'joint-mod-rotate-local obj 6 #f))) (quaternion-copy! (the-as quaternion (-> obj gun-elev-jmod target)) *unity-quaternion*) (set! (-> obj water) (new 'process 'water-control obj 3 8192.0 8192.0 2048.0)) diff --git a/test/decompiler/reference/jak2/levels/forest/wren_REF.gc b/test/decompiler/reference/jak2/levels/forest/wren_REF.gc index 287a32231a..d9a3af229b 100644 --- a/test/decompiler/reference/jak2/levels/forest/wren_REF.gc +++ b/test/decompiler/reference/jak2/levels/forest/wren_REF.gc @@ -16,7 +16,7 @@ (bob-level-seek float :offset-assert 264) (bank-angle float :offset-assert 268) (peck-timer uint64 :offset-assert 272) - (flags uint16 :offset-assert 280) + (flags wren-flags :offset-assert 280) ) :heap-base #xa0 :method-count-assert 28 @@ -157,8 +157,8 @@ If so, it transitions from [[wren::peck]] to [[wren::hunt]]" :trans (behavior () (when (< (vector-vector-xz-distance (-> self root trans) (-> self move-dest)) 2048.0) (cond - ((logtest? (-> self flags) 4) - (logand! (-> self flags) -5) + ((logtest? (-> self flags) (wren-flags wrflags-2)) + (logclear! (-> self flags) (wren-flags wrflags-2)) (set! (-> self fly-index) (the-as uint 0)) (go-virtual fly) ) @@ -216,7 +216,7 @@ If so, it transitions from [[wren::peck]] to [[wren::hunt]]" :enter (behavior () (set! (-> self state-time) (current-time)) (set! (-> self peck-timer) (the-as uint (the int (* 300.0 (rand-vu-float-range 1.4 4.3))))) - (logand! (-> self flags) -7) + (logclear! (-> self flags) (wren-flags wrflags-1 wrflags-2)) (none) ) :trans (behavior () @@ -227,15 +227,15 @@ If so, it transitions from [[wren::peck]] to [[wren::hunt]]" ) ) ) - (when (logtest? (-> self flags) 2) - (logand! (-> self flags) -3) + (when (logtest? (-> self flags) (wren-flags wrflags-1)) + (logclear! (-> self flags) (wren-flags wrflags-1)) (when (spooked? self) (get-point-in-path! (-> self fly-curve 0) (-> self move-dest) 0.0 'interp) (set-yaw-angle-clear-roll-pitch! (-> self root) (vector-y-angle (vector-! (new 'stack-no-clear 'vector) (-> self move-dest) (-> self root trans))) ) - (logior! (-> self flags) 4) + (logior! (-> self flags) (wren-flags wrflags-2)) (go-virtual hunt) ) ) @@ -244,11 +244,11 @@ If so, it transitions from [[wren::peck]] to [[wren::hunt]]" :code (behavior () (local-vars (v1-34 symbol)) (until #f - (logand! (-> self flags) -2) + (logclear! (-> self flags) (wren-flags wrflags-0)) (let ((f0-0 (rand-vu-float-range 0.0 (get-num-segments (-> self path))))) (get-point-in-path! (-> self path) (-> self move-dest) f0-0 'interp) ) - (logior! (-> self flags) 2) + (logior! (-> self flags) (wren-flags wrflags-1)) (ja-no-eval :group! wren-peck-ja :num! (seek! (the float (+ (-> (the-as art-joint-anim wren-peck-ja) frames num-frames) -1))) :frame-num 0.0 @@ -258,7 +258,7 @@ If so, it transitions from [[wren::peck]] to [[wren::hunt]]" (ja :num! (seek!)) ) #t - (let ((v1-33 (the-as symbol (logand (-> self flags) 2)))) + (let ((v1-33 (the-as symbol (logand (-> self flags) (wren-flags wrflags-1))))) (set! v1-33 v1-33) (cmove-#f-zero v1-34 v1-33 v1-33) ) @@ -272,7 +272,7 @@ If so, it transitions from [[wren::peck]] to [[wren::hunt]]" (ja :num! (loop! f30-1)) ) ) - (logior! (-> self flags) 1) + (logior! (-> self flags) (wren-flags wrflags-0)) (let ((gp-2 (current-time)) (s5-2 (the int (* 300.0 (rand-vu-float-range 0.2 1.5)))) (f30-3 1.0) @@ -288,7 +288,7 @@ If so, it transitions from [[wren::peck]] to [[wren::hunt]]" (none) ) :post (behavior () - (if (logtest? (-> self flags) 1) + (if (logtest? (-> self flags) (wren-flags wrflags-0)) (seek-to-point-toward-point! (-> self root) (-> self move-dest) 262144.0 (seconds 0.02)) ) (ja-post) @@ -430,7 +430,7 @@ If so, it transitions from [[wren::peck]] to [[wren::hunt]]" (none) ) :code (behavior () - (logand! (-> self flags) -2) + (logclear! (-> self flags) (wren-flags wrflags-0)) (ja-channel-push! 1 (seconds 0.2)) (let ((gp-0 (current-time)) (s5-0 (the int (* 300.0 (rand-vu-float-range 4.2 16.8)))) @@ -442,7 +442,7 @@ If so, it transitions from [[wren::peck]] to [[wren::hunt]]" (ja :num! (loop! f30-1)) ) ) - (logior! (-> self flags) 1) + (logior! (-> self flags) (wren-flags wrflags-0)) (let ((gp-1 (current-time)) (s5-1 600) (f30-2 1.0) @@ -456,7 +456,7 @@ If so, it transitions from [[wren::peck]] to [[wren::hunt]]" (none) ) :post (behavior () - (if (logtest? (-> self flags) 1) + (if (logtest? (-> self flags) (wren-flags wrflags-0)) (seek-to-point-toward-point! (-> self root) (-> self move-dest) 262144.0 (seconds 0.02)) ) (debug-draw-path self) @@ -511,7 +511,7 @@ This commonly includes things such as: ) (set! (-> obj fly-index) (the-as uint 0)) (set! (-> obj path-u) 0.0) - (set! (-> obj flags) (the-as uint 0)) + (set! (-> obj flags) (wren-flags)) (set! (-> obj bob-level) 0.0) (set! (-> obj bank-angle) 0.0) (set! (-> obj path) (new 'process 'path-control obj 'idle 0.0 arg0 #f)) diff --git a/test/decompiler/reference/jak2/levels/fortress/dump/fort-robotank-turret_REF.gc b/test/decompiler/reference/jak2/levels/fortress/dump/fort-robotank-turret_REF.gc index 4aef305980..d89f91c446 100644 --- a/test/decompiler/reference/jak2/levels/fortress/dump/fort-robotank-turret_REF.gc +++ b/test/decompiler/reference/jak2/levels/fortress/dump/fort-robotank-turret_REF.gc @@ -3,32 +3,32 @@ ;; definition of type fort-robotank-turret (deftype fort-robotank-turret (process-focusable) - ((los los-control :inline :offset-assert 208) - (reticle handle :offset-assert 360) - (screen handle :offset-assert 368) - (tank-quat quaternion :inline :offset-assert 384) - (tank-quat-vibe-only quaternion :inline :offset-assert 400) - (rotate-quat quaternion :inline :offset-assert 416) - (rotate-rate float :offset-assert 432) - (rotate-mult float :offset-assert 436) - (shot-range float :offset-assert 440) - (fov-mult float :offset-assert 444) - (offset vector :inline :offset-assert 448) - (sight-pos vector :inline :offset-assert 464) - (firing-sight-pos vector :inline :offset-assert 480) - (aim-pos vector 3 :inline :offset-assert 496) - (aim-pos-2 vector :inline :offset 512) - (aim-pos-1 vector :inline :offset 528) - (gun-timer time-frame :offset-assert 544) - (gun-elev-jmod joint-mod-set-local :offset-assert 552) - (gun-elev float :offset-assert 556) - (gun-elev-cam float :offset-assert 560) - (gun-joint-l int32 2 :offset-assert 564) - (gun-joint-r int32 2 :offset-assert 572) - (gun-spread float :offset-assert 580) - (gun-index int32 :offset-assert 584) - (flags uint16 :offset-assert 588) - (turn-sound-id sound-id :offset-assert 592) + ((los los-control :inline :offset-assert 208) + (reticle handle :offset-assert 360) + (screen handle :offset-assert 368) + (tank-quat quaternion :inline :offset-assert 384) + (tank-quat-vibe-only quaternion :inline :offset-assert 400) + (rotate-quat quaternion :inline :offset-assert 416) + (rotate-rate float :offset-assert 432) + (rotate-mult float :offset-assert 436) + (shot-range float :offset-assert 440) + (fov-mult float :offset-assert 444) + (offset vector :inline :offset-assert 448) + (sight-pos vector :inline :offset-assert 464) + (firing-sight-pos vector :inline :offset-assert 480) + (aim-pos vector 3 :inline :offset-assert 496) + (aim-pos-2 vector :inline :offset 512) + (aim-pos-1 vector :inline :offset 528) + (gun-timer time-frame :offset-assert 544) + (gun-elev-jmod joint-mod-set-local :offset-assert 552) + (gun-elev float :offset-assert 556) + (gun-elev-cam float :offset-assert 560) + (gun-joint-l int32 2 :offset-assert 564) + (gun-joint-r int32 2 :offset-assert 572) + (gun-spread float :offset-assert 580) + (gun-index int32 :offset-assert 584) + (flags robotank-turret-flags :offset-assert 588) + (turn-sound-id sound-id :offset-assert 592) ) :heap-base #x1e0 :method-count-assert 35 @@ -1139,9 +1139,9 @@ ) ) (cond - ((and (logtest? (-> self flags) 1) gp-0) + ((and (logtest? (-> self flags) (robotank-turret-flags rotflags-0)) gp-0) (send-event (handle->process (-> self reticle)) 'on) - (if (logtest? (-> self flags) 512) + (if (logtest? (-> self flags) (robotank-turret-flags rotflags-9)) (los-control-method-9 (-> self los) gp-0 (the-as vector #f) 1638.4) ) (if *target* @@ -1168,11 +1168,11 @@ (let ((f30-0 (vector-length gp-2))) (vector-normalize! gp-2 1.0) (vector-normalize! s3-1 1.0) - (if (logtest? (-> self flags) 8) + (if (logtest? (-> self flags) (robotank-turret-flags rotflags-3)) (set! (-> s5-3 quad) (-> s3-1 quad)) (set! (-> s5-3 quad) (-> gp-2 quad)) ) - (when (logtest? (-> self flags) 128) + (when (logtest? (-> self flags) (robotank-turret-flags rotflags-7)) (let ((f0-6 (lerp-scale 1.0 0.2 f30-0 8192.0 327680.0))) (seek! (-> self fov-mult) f0-6 (* 2.0 (-> self clock seconds-per-frame))) ) @@ -1219,7 +1219,7 @@ ) ) ) - (when (logtest? (-> self flags) 1024) + (when (logtest? (-> self flags) (robotank-turret-flags rotflags-10)) (cond ((< -1456.3556 (-> self gun-elev)) (send-event (handle->process (-> self reticle)) 'spotlight-on) @@ -1237,7 +1237,9 @@ ) ) ) - (when (and (logtest? (-> self flags) 1) (not (logtest? (-> self flags) 8))) + (when (and (logtest? (-> self flags) (robotank-turret-flags rotflags-0)) + (not (logtest? (-> self flags) (robotank-turret-flags rotflags-3))) + ) (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 @@ -1256,17 +1258,17 @@ ) ) (cond - ((logtest? (-> self flags) 64) + ((logtest? (-> self flags) (robotank-turret-flags rotflags-6)) (sound-play "robotank-turret" :id (-> self turn-sound-id) :position (-> self root trans)) (when (< (fabs (-> self rotate-rate)) 728.1778) - (logand! (-> self flags) -65) + (logclear! (-> self flags) (robotank-turret-flags rotflags-6)) (sound-stop (-> self turn-sound-id)) (sound-play "robo-turret-end") ) ) (else (if (< 2184.5334 (fabs (-> self rotate-rate))) - (logior! (-> self flags) 64) + (logior! (-> self flags) (robotank-turret-flags rotflags-6)) ) ) ) @@ -1287,19 +1289,19 @@ (case arg2 (('trigger) (when (and (-> self next-state) (= (-> self next-state name) 'idle)) - (logior! (-> self flags) 1) + (logior! (-> self flags) (robotank-turret-flags rotflags-0)) (go-virtual ready) ) ) (('fire-suppress) (cond ((-> arg3 param 0) - (set! v0-0 (logior (-> self flags) 16)) - (set! (-> self flags) (the-as uint v0-0)) + (set! v0-0 (logior (-> self flags) (robotank-turret-flags rotflags-4))) + (set! (-> self flags) (the-as robotank-turret-flags v0-0)) ) (else - (set! v0-0 (logand -17 (-> self flags))) - (set! (-> self flags) (the-as uint v0-0)) + (set! v0-0 (logclear (-> self flags) (robotank-turret-flags rotflags-4))) + (set! (-> self flags) (the-as robotank-turret-flags v0-0)) ) ) v0-0 @@ -1310,12 +1312,12 @@ (('use-los) (cond ((-> arg3 param 0) - (set! v0-0 (logior (-> self flags) 512)) - (set! (-> self flags) (the-as uint v0-0)) + (set! v0-0 (logior (-> self flags) (robotank-turret-flags rotflags-9))) + (set! (-> self flags) (the-as robotank-turret-flags v0-0)) ) (else - (set! v0-0 (logand -513 (-> self flags))) - (set! (-> self flags) (the-as uint v0-0)) + (set! v0-0 (logclear (-> self flags) (robotank-turret-flags rotflags-9))) + (set! (-> self flags) (the-as robotank-turret-flags v0-0)) ) ) v0-0 @@ -1323,12 +1325,12 @@ (('limit-reticle-elev) (cond ((-> arg3 param 0) - (set! v0-0 (logior (-> self flags) 1024)) - (set! (-> self flags) (the-as uint v0-0)) + (set! v0-0 (logior (-> self flags) (robotank-turret-flags rotflags-10))) + (set! (-> self flags) (the-as robotank-turret-flags v0-0)) ) (else - (set! v0-0 (logand -1025 (-> self flags))) - (set! (-> self flags) (the-as uint v0-0)) + (set! v0-0 (logclear (-> self flags) (robotank-turret-flags rotflags-10))) + (set! (-> self flags) (the-as robotank-turret-flags v0-0)) ) ) v0-0 @@ -1338,7 +1340,7 @@ (set! (-> v1-22 prim-core collide-as) (collide-spec obstacle pusher)) (set! (-> v1-22 prim-core collide-with) (collide-spec jak player-list)) ) - (logior! (-> self flags) 128) + (logior! (-> self flags) (robotank-turret-flags rotflags-7)) (send-event (handle->process (-> self screen)) 'trigger) ) (('pov-cam-off) @@ -1347,7 +1349,7 @@ (set! (-> v1-33 prim-core collide-with) (collide-spec)) ) 0 - (logand! (-> self flags) -129) + (logclear! (-> self flags) (robotank-turret-flags rotflags-7)) (remove-setting! 'fov) (send-event (handle->process (-> self screen)) 'untrigger) ) @@ -1408,14 +1410,14 @@ (none) ) :trans (behavior () - (if (logtest? (-> self flags) 16) + (if (logtest? (-> self flags) (robotank-turret-flags rotflags-4)) (set! (-> self gun-timer) (current-time)) ) (let ((gp-0 *target*)) (if (and (if (type? gp-0 process-focusable) gp-0 ) - (or (not (logtest? (-> self flags) 512)) (check-los? (-> self los) 0)) + (or (not (logtest? (-> self flags) (robotank-turret-flags rotflags-9))) (check-los? (-> self los) 0)) (>= (- (current-time) (-> self gun-timer)) (seconds 1)) ) (go-virtual fire) @@ -1445,7 +1447,7 @@ :virtual #t :event robotank-turret-handler :enter (behavior () - (logior! (-> self flags) 256) + (logior! (-> self flags) (robotank-turret-flags rotflags-8)) (let* ((gp-0 *target*) (a0-1 (if (type? gp-0 process-focusable) gp-0 @@ -1466,10 +1468,13 @@ gp-0 ) ) - (and (logtest? (-> self flags) 512) (not (logtest? (-> self flags) 8)) (skip-check-los? (-> self los) 0)) - (logtest? (-> self flags) 16) + (and (logtest? (-> self flags) (robotank-turret-flags rotflags-9)) + (not (logtest? (-> self flags) (robotank-turret-flags rotflags-3))) + (skip-check-los? (-> self los) 0) + ) + (logtest? (-> self flags) (robotank-turret-flags rotflags-4)) ) - (logand! (-> self flags) -257) + (logclear! (-> self flags) (robotank-turret-flags rotflags-8)) (go-virtual ready) ) ) @@ -1480,7 +1485,7 @@ (until (fort-robotank-turret-method-34 self (-> self aim-pos-1) 2730.6667) (suspend) ) - (logior! (-> self flags) 8) + (logior! (-> self flags) (robotank-turret-flags rotflags-3)) (set! (-> self firing-sight-pos quad) (-> self sight-pos quad)) (send-event (handle->process (-> self reticle)) 'lock) (let ((gp-0 (current-time))) @@ -1529,7 +1534,7 @@ ) ) (label cfg-26) - (logand! (-> self flags) -9) + (logclear! (-> self flags) (robotank-turret-flags rotflags-3)) (send-event (handle->process (-> self reticle)) 'unlock) (until (fort-robotank-turret-method-34 self (-> self aim-pos-1) 2730.6667) (suspend) @@ -1575,7 +1580,7 @@ ;; definition for method 10 of type fort-robotank-turret (defmethod deactivate fort-robotank-turret ((obj fort-robotank-turret)) - (logand! (-> obj flags) -65) + (logclear! (-> obj flags) (robotank-turret-flags rotflags-6)) (sound-stop (-> obj turn-sound-id)) (let ((a0-4 (handle->process (-> obj screen)))) (if a0-4 @@ -1674,7 +1679,7 @@ (set! (-> self aim-pos-2 quad) (-> self root trans quad)) (set! (-> self aim-pos-1 quad) (-> self root trans quad)) (set! (-> self gun-timer) (current-time)) - (set! (-> self flags) (the-as uint 0)) + (set! (-> self flags) (robotank-turret-flags)) (set! (-> self fov-mult) 1.0) (set! (-> self shot-range) 204800.0) (set! (-> self gun-joint-l 0) 10) diff --git a/test/decompiler/reference/jak2/levels/fortress/dump/fort-robotank_REF.gc b/test/decompiler/reference/jak2/levels/fortress/dump/fort-robotank_REF.gc index 7e7fb3dad1..a234423477 100644 --- a/test/decompiler/reference/jak2/levels/fortress/dump/fort-robotank_REF.gc +++ b/test/decompiler/reference/jak2/levels/fortress/dump/fort-robotank_REF.gc @@ -230,7 +230,7 @@ (tread fort-robotank-tread-info 2 :inline :offset-assert 224) (path-info fort-robotank-path-info-array :offset-assert 512) (segment-table (inline-array fort-robotank-segment) :offset-assert 516) - (flags uint16 :offset-assert 520) + (flags robotank-flags :offset-assert 520) (pov-cam-offset vector 2 :inline :offset-assert 528) (turret handle :offset-assert 560) (no-collision-timer time-frame :offset-assert 568) @@ -484,7 +484,7 @@ ) (let ((v1-65 (-> self path-info data (-> self path-index)))) (cond - ((and (logtest? (-> self flags) 4) (!= (-> v1-65 u) (-> v1-65 prev-u))) + ((and (logtest? (-> self flags) (robotank-flags roflags-2)) (!= (-> v1-65 u) (-> v1-65 prev-u))) (seek! (-> self engine-vibe-rate) 3.0 (-> self clock seconds-per-frame)) (seek! (-> self engine-vibe-amp) 1.0 (-> self clock seconds-per-frame)) ) @@ -543,7 +543,7 @@ (dotimes (gp-4 (-> self path-count)) (debug-draw (-> self path-info data gp-4 path)) ) - (when (logtest? (-> self flags) 128) + (when (logtest? (-> self flags) (robotank-flags roflags-7)) (let ((gp-5 (quaternion-inverse! (new 'stack-no-clear 'quaternion) (-> self root quat))) (a1-28 (new 'stack-no-clear 'event-message-block)) ) @@ -606,7 +606,7 @@ (set! (-> v1-14 message) 'trigger) ) ) - (logior! (-> self flags) 32) + (logior! (-> self flags) (robotank-flags roflags-5)) (let ((ret (the-as object (-> arg3 param 0)))) (set! (-> self continue-index) (the-as int ret)) ret @@ -735,7 +735,7 @@ ) (set-setting! 'pov-offset 'asdf (-> obj pov-cam-offset) 0) (send-event (handle->process (-> obj turret)) 'pov-cam-on) - (logior! (-> obj flags) 128) + (logior! (-> obj flags) (robotank-flags roflags-7)) (let ((v1-41 (-> (the-as collide-shape-prim-group (-> obj root root-prim)) child 2))) (set! (-> v1-41 prim-core collide-as) (collide-spec enemy pusher)) (set! (-> v1-41 prim-core collide-with) (collide-spec jak bot player-list)) @@ -748,7 +748,7 @@ (remove-setting! 'target-height) (remove-setting! 'pov-offset) (send-event (handle->process (-> obj turret)) 'pov-cam-off) - (logand! (-> obj flags) -129) + (logclear! (-> obj flags) (robotank-flags roflags-7)) (let ((v1-57 (-> (the-as collide-shape-prim-group (-> obj root root-prim)) child 2))) (set! (-> v1-57 prim-core collide-as) (collide-spec)) (set! (-> v1-57 prim-core collide-with) (collide-spec)) @@ -817,10 +817,10 @@ (set! (-> v1-8 message) 'trigger) ) ) - (logior! (-> self flags) 32) + (logior! (-> self flags) (robotank-flags roflags-5)) ) - (when (logtest? (-> self flags) 32) - (logand! (-> self flags) -33) + (when (logtest? (-> self flags) (robotank-flags roflags-5)) + (logclear! (-> self flags) (robotank-flags roflags-5)) (set-setting! 'music 'danger11 0.0 0) (set-setting! 'music-volume 'rel 0.9 0) (go-virtual moving) @@ -881,7 +881,7 @@ (none) ) :exit (behavior () - (logand! (-> self flags) -5) + (logclear! (-> self flags) (robotank-flags roflags-2)) (none) ) :trans (behavior () @@ -937,18 +937,18 @@ (none) ) :code (behavior () - (logand! (-> self flags) -5) + (logclear! (-> self flags) (robotank-flags roflags-2)) (let ((gp-0 (current-time))) (until (>= (- (current-time) gp-0) (seconds 0.1)) (suspend) ) ) - (logior! (-> self flags) 4) + (logior! (-> self flags) (robotank-flags roflags-2)) (sleep-code) (none) ) :post (behavior () - (when (logtest? (-> self flags) 4) + (when (logtest? (-> self flags) (robotank-flags roflags-2)) (let* ((gp-0 *target*) (s3-0 (if (type? gp-0 process-focusable) gp-0 @@ -1054,8 +1054,8 @@ (none) ) :trans (behavior () - (when (logtest? (-> self flags) 32) - (logand! (-> self flags) -33) + (when (logtest? (-> self flags) (robotank-flags roflags-5)) + (logclear! (-> self flags) (robotank-flags roflags-5)) (go-virtual moving) ) (none) @@ -1214,7 +1214,7 @@ This commonly includes things such as: (set! (-> obj fact) (new 'process 'fact-info obj (pickup-type eco-pill-random) (-> *FACT-bank* default-eco-pill-green-inc)) ) - (set! (-> obj flags) (the-as uint 0)) + (set! (-> obj flags) (robotank-flags)) (set! (-> obj no-collision-timer) 0) (set! (-> obj engine-vibe-rate) 1.0) (set! (-> obj buzz-timer) 0) diff --git a/test/decompiler/reference/jak2/levels/mountain/mountain-obs_REF.gc b/test/decompiler/reference/jak2/levels/mountain/mountain-obs_REF.gc index 00ae3d72c7..0b9779b6da 100644 --- a/test/decompiler/reference/jak2/levels/mountain/mountain-obs_REF.gc +++ b/test/decompiler/reference/jak2/levels/mountain/mountain-obs_REF.gc @@ -2779,11 +2779,11 @@ This commonly includes things such as: ;; definition of type mtn-plat-return (deftype mtn-plat-return (base-plat) - ((ride-timer time-frame :offset-assert 272) - (flags uint16 :offset-assert 280) - (path-pos float :offset-assert 284) - (dest-pos float :offset-assert 288) - (path-speed float :offset-assert 292) + ((ride-timer time-frame :offset-assert 272) + (flags mtn-plat-flags :offset-assert 280) + (path-pos float :offset-assert 284) + (dest-pos float :offset-assert 288) + (path-speed float :offset-assert 292) ) :heap-base #xb0 :method-count-assert 38 @@ -2827,8 +2827,8 @@ This commonly includes things such as: :event (behavior ((proc process) (arg1 int) (event-type symbol) (event event-message-block)) (case event-type (('ridden) - (let ((v0-0 (the-as object (logior (-> self flags) 1)))) - (set! (-> self flags) (the-as uint v0-0)) + (let ((v0-0 (the-as object (logior (-> self flags) (mtn-plat-flags mtpflags-0))))) + (set! (-> self flags) (the-as mtn-plat-flags v0-0)) v0-0 ) ) @@ -2843,14 +2843,14 @@ This commonly includes things such as: (none) ) :trans (behavior () - (logand! (-> self flags) -2) + (logclear! (-> self flags) (mtn-plat-flags mtpflags-0)) (plat-trans) - (if (not (logtest? (-> self flags) 1)) + (if (not (logtest? (-> self flags) (mtn-plat-flags mtpflags-0))) (set! (-> self ride-timer) (current-time)) ) (let ((v1-10 (and (>= (- (current-time) (-> self ride-timer)) (seconds 0.5)) - (logtest? (-> self flags) 1) - (if (logtest? (-> self flags) 2) + (logtest? (-> self flags) (mtn-plat-flags mtpflags-0)) + (if (logtest? (-> self flags) (mtn-plat-flags mtpflags-1)) (and *target* (process-grab? *target* #f)) #t ) @@ -2877,8 +2877,8 @@ This commonly includes things such as: :event (behavior ((proc process) (arg1 int) (event-type symbol) (event event-message-block)) (case event-type (('ridden) - (let ((v0-0 (the-as object (logior (-> self flags) 1)))) - (set! (-> self flags) (the-as uint v0-0)) + (let ((v0-0 (the-as object (logior (-> self flags) (mtn-plat-flags mtpflags-0))))) + (set! (-> self flags) (the-as mtn-plat-flags v0-0)) v0-0 ) ) @@ -2992,7 +2992,7 @@ This commonly includes things such as: (the-as pair 0) ) (stop-bouncing! obj) - (set! (-> obj flags) (the-as uint 0)) + (set! (-> obj flags) (mtn-plat-flags)) (set! (-> obj path-pos) 0.0) (set! (-> obj path) (new 'process 'curve-control obj 'path -1000000000.0)) (if (logtest? (-> obj path flags) (path-control-flag not-found)) @@ -3658,7 +3658,7 @@ This commonly includes things such as: (t9-0) ) ) - (if (logtest? (-> self flags) 1) + (if (logtest? (-> self flags) (mtn-plat-flags mtpflags-0)) (process-release? *target*) ) (none) @@ -3689,7 +3689,7 @@ This commonly includes things such as: (defmethod init-plat! trans-plat ((obj trans-plat)) "Does any necessary initial platform setup. For example for an elevator pre-compute the distance between the first and last points (both ways) and clear the sound." - (logior! (-> obj flags) 2) + (logior! (-> obj flags) (mtn-plat-flags mtpflags-1)) (let* ((s5-0 *target*) (a0-2 (if (type? s5-0 process-focusable) s5-0 diff --git a/test/decompiler/reference/jak2/levels/nest/boss/nestb-scenes_REF.gc b/test/decompiler/reference/jak2/levels/nest/boss/nestb-scenes_REF.gc index 6b705ef8ad..845542f29e 100644 --- a/test/decompiler/reference/jak2/levels/nest/boss/nestb-scenes_REF.gc +++ b/test/decompiler/reference/jak2/levels/nest/boss/nestb-scenes_REF.gc @@ -20,7 +20,7 @@ (suspend) ) ) - (send-event *target* 'change-mode 'darkjak #f 64) + (send-event *target* 'change-mode 'darkjak #f (darkjak-stage no-anim)) (let ((gp-1 (current-time))) (until (>= (- (current-time) gp-1) (seconds 0.1)) (suspend) 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 a2cd442edf..09f258de36 100644 --- a/test/decompiler/reference/jak2/levels/ruins/rapid-gunner_REF.gc +++ b/test/decompiler/reference/jak2/levels/ruins/rapid-gunner_REF.gc @@ -3,25 +3,25 @@ ;; definition of type rapid-gunner (deftype rapid-gunner (nav-enemy) - ((los los-control :inline :offset-assert 608) - (joint joint-mod :offset-assert 756) - (joint-blend float :offset-assert 760) - (joint-enable symbol :offset-assert 764) - (shot-timer uint64 :offset-assert 768) - (predict-timer uint64 :offset-assert 776) - (target-prev-pos vector :inline :offset-assert 784) - (target-next-pos vector :inline :offset-assert 800) - (focus-dir vector :inline :offset-assert 816) - (y-diff float :offset-assert 832) - (shots-fired uint32 :offset-assert 836) - (spin-up-angle float :offset-assert 840) - (spin-up-timer time-frame :offset-assert 848) - (shoot-anim-index int32 :offset-assert 856) - (status-flags uint64 :offset-assert 864) - (start-pos vector :inline :offset-assert 880) - (dest-pos vector :inline :offset-assert 896) - (hop-dir vector :inline :offset-assert 912) - (roam-radius float :offset-assert 928) + ((los los-control :inline :offset-assert 608) + (joint joint-mod :offset-assert 756) + (joint-blend float :offset-assert 760) + (joint-enable symbol :offset-assert 764) + (shot-timer uint64 :offset-assert 768) + (predict-timer uint64 :offset-assert 776) + (target-prev-pos vector :inline :offset-assert 784) + (target-next-pos vector :inline :offset-assert 800) + (focus-dir vector :inline :offset-assert 816) + (y-diff float :offset-assert 832) + (shots-fired uint32 :offset-assert 836) + (spin-up-angle float :offset-assert 840) + (spin-up-timer time-frame :offset-assert 848) + (shoot-anim-index int32 :offset-assert 856) + (status-flags rapid-gunner-flags :offset-assert 864) + (start-pos vector :inline :offset-assert 880) + (dest-pos vector :inline :offset-assert 896) + (hop-dir vector :inline :offset-assert 912) + (roam-radius float :offset-assert 928) ) :heap-base #x330 :method-count-assert 187 @@ -754,9 +754,9 @@ (set! (-> v1-15 attack-id) a0-6) (set! (-> self attack-id) a0-6) ) - (when (logtest? (-> self status-flags) 2) + (when (logtest? (-> self status-flags) (rapid-gunner-flags ragflags-1)) (set! (-> self spin-up-timer) (+ (current-time) (seconds 2))) - (logand! (-> self status-flags) -3) + (logclear! (-> self status-flags) (rapid-gunner-flags ragflags-1)) ) (if (zero? (rand-vu-int-range 0 3)) (set! (-> self shoot-anim-index) 15) @@ -1220,12 +1220,12 @@ (cond ((handle->process (-> self focus handle)) (if (check-los? (-> self los) 0) - (logand! (-> self status-flags) -3) - (logior! (-> self status-flags) 2) + (logclear! (-> self status-flags) (rapid-gunner-flags ragflags-1)) + (logior! (-> self status-flags) (rapid-gunner-flags ragflags-1)) ) ) (else - (logior! (-> self status-flags) 2) + (logior! (-> self status-flags) (rapid-gunner-flags ragflags-1)) ) ) (let ((v1-18 self)) @@ -1590,8 +1590,8 @@ ) (set! (-> obj shots-fired) (the-as uint 0)) (set! (-> obj spin-up-timer) 0) - (logand! (-> obj status-flags) -2) - (logior! (-> obj status-flags) 2) + (logclear! (-> obj status-flags) (rapid-gunner-flags ragflags-0)) + (logior! (-> obj status-flags) (rapid-gunner-flags ragflags-1)) (let ((f30-0 3640.889)) (set! sv-48 0) (let ((v1-22 (res-lump-data (-> obj entity) 'spinup-angle pointer :tag-ptr (the-as (pointer res-tag) (& sv-48))))) 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 5499731dd1..d5ef05dd00 100644 --- a/test/decompiler/reference/jak2/levels/sewer/hal2-course_REF.gc +++ b/test/decompiler/reference/jak2/levels/sewer/hal2-course_REF.gc @@ -110,7 +110,7 @@ (('notify) (case (-> arg3 param 0) (('jinx-bomb) - (logior! (-> obj bot-task-bits) 1) + (logior! (-> obj bot-task-bits) (bot-task-bits botbits-0)) #t ) (else @@ -478,17 +478,17 @@ ) ) (cond - ((not (logtest? (-> arg1 waypoint-bits) 1)) + ((not (logtest? (-> arg1 waypoint-bits) (waypoint-bits wabits-0))) (when (and s3-0 s4-0 s5-0) - (logior! (-> arg1 waypoint-bits) 1) + (logior! (-> arg1 waypoint-bits) (waypoint-bits wabits-0)) (set! (-> arg1 slave-handle 0) (process->handle s3-0)) (set! (-> arg1 slave-handle 1) (process->handle s4-0)) (set! (-> arg1 slave-handle 2) (process->handle s5-0)) ) #f ) - ((not (logtest? (-> arg1 waypoint-bits) 2)) - (logior! (-> arg1 waypoint-bits) 2) + ((not (logtest? (-> arg1 waypoint-bits) (waypoint-bits wabits-1))) + (logior! (-> arg1 waypoint-bits) (waypoint-bits wabits-1)) (hal-method-226 arg1) (send-event s3-0 'request 'waypoint 2) (send-event s4-0 'request 'waypoint 2) @@ -1662,7 +1662,7 @@ (the-as (function halt-wait-spot hal symbol) (lambda ((arg0 object) (arg1 hal-sewer)) (cond - ((logtest? (-> arg1 bot-task-bits) 1) + ((logtest? (-> arg1 bot-task-bits) (bot-task-bits botbits-0)) (ai-task-control-method-12 (-> arg1 ai-ctrl) arg1) (go-to-waypoint! arg1 24 #f) (ai-task-control-method-10 (-> arg1 ai-ctrl) arg1) @@ -1785,7 +1785,7 @@ ) (play-speech arg1 28) ) - (when (logtest? (-> arg1 bot-task-bits) 2) + (when (logtest? (-> arg1 bot-task-bits) (bot-task-bits botbits-1)) (ai-task-control-method-12 (-> arg1 ai-ctrl) arg1) (go-to-waypoint! arg1 25 #f) (ai-task-control-method-10 (-> arg1 ai-ctrl) arg1) @@ -1878,7 +1878,7 @@ (cond ((>= (- (current-time) (-> arg1 waypoint-time0)) (seconds 1.5)) (cond - ((logtest? (-> arg1 waypoint-bits) 1) + ((logtest? (-> arg1 waypoint-bits) (waypoint-bits wabits-0)) (when (and (not (speech-playing? arg1 29)) (not (speech-playing? arg1 30))) (if (zero? (get-rand-int arg1 2)) (play-speech arg1 29) @@ -1898,7 +1898,7 @@ (else (let ((a0-11 *target*)) (if (and a0-11 (focus-test? a0-11 hit)) - (logior! (-> arg1 waypoint-bits) 1) + (logior! (-> arg1 waypoint-bits) (waypoint-bits wabits-0)) ) ) ) @@ -2779,9 +2779,9 @@ (play-speech arg1 52) ) (cond - ((not (logtest? (-> arg1 waypoint-bits) 1)) + ((not (logtest? (-> arg1 waypoint-bits) (waypoint-bits wabits-0))) (when (>= (- (current-time) (-> arg1 waypoint-time0)) (seconds 0.5)) - (logior! (-> arg1 waypoint-bits) 1) + (logior! (-> arg1 waypoint-bits) (waypoint-bits wabits-0)) (let ((a1-5 (new 'stack-no-clear 'event-message-block))) (set! (-> a1-5 from) (process->ppointer pp)) (set! (-> a1-5 num-params) 0) @@ -2804,9 +2804,9 @@ ) #f ) - ((not (logtest? (-> arg1 waypoint-bits) 2)) + ((not (logtest? (-> arg1 waypoint-bits) (waypoint-bits wabits-1))) (when (>= (- (current-time) (-> arg1 waypoint-time0)) (seconds 4)) - (logior! (-> arg1 waypoint-bits) 2) + (logior! (-> arg1 waypoint-bits) (waypoint-bits wabits-1)) (let ((a1-10 (new 'stack-no-clear 'event-message-block))) (set! (-> a1-10 from) (process->ppointer pp)) (set! (-> a1-10 num-params) 0) @@ -2825,9 +2825,9 @@ ) #f ) - ((not (logtest? (-> arg1 waypoint-bits) 4)) + ((not (logtest? (-> arg1 waypoint-bits) (waypoint-bits wabits-2))) (when (>= (- (current-time) (-> arg1 waypoint-time0)) (seconds 5)) - (logior! (-> arg1 waypoint-bits) 4) + (logior! (-> arg1 waypoint-bits) (waypoint-bits wabits-2)) (let ((a1-11 (new 'stack-no-clear 'event-message-block))) (set! (-> a1-11 from) (process->ppointer pp)) (set! (-> a1-11 num-params) 0) @@ -2988,7 +2988,7 @@ (with-pp (logclear! (-> arg0 bot-flags) (bot-flags bf24)) (reset-warn-time! arg0) - (if (and (not (logtest? (-> arg0 bot-task-bits) 16)) (not (hal-sewer-method-231 arg0 24))) + (if (and (not (logtest? (-> arg0 bot-task-bits) (bot-task-bits botbits-4))) (not (hal-sewer-method-231 arg0 24))) (play-speech arg0 55) ) (let ((a1-2 (new 'stack-no-clear 'event-message-block))) @@ -3021,7 +3021,7 @@ (return #t) ) (cond - ((logtest? (-> arg1 bot-task-bits) 20) + ((logtest? (-> arg1 bot-task-bits) (bot-task-bits botbits-2 botbits-4)) (logclear! (-> arg1 bot-flags) (bot-flags bf24)) (reset-warn-time! arg1) (set! (-> arg1 waypoint-time0) (current-time)) @@ -3212,7 +3212,7 @@ (with-pp (logclear! (-> arg0 bot-flags) (bot-flags bf24)) (reset-warn-time! arg0) - (if (and (not (logtest? (-> arg0 bot-task-bits) 32)) (not (hal-sewer-method-231 arg0 27))) + (if (and (not (logtest? (-> arg0 bot-task-bits) (bot-task-bits botbits-5))) (not (hal-sewer-method-231 arg0 27))) (play-speech arg0 62) ) (let ((a1-2 (new 'stack-no-clear 'event-message-block))) @@ -3245,7 +3245,7 @@ (return #t) ) (cond - ((logtest? (-> arg1 bot-task-bits) 40) + ((logtest? (-> arg1 bot-task-bits) (bot-task-bits botbits-3 botbits-5)) (logclear! (-> arg1 bot-flags) (bot-flags bf24)) (reset-warn-time! arg1) (set! (-> arg1 waypoint-time0) (current-time)) @@ -3352,8 +3352,10 @@ ) ) ) - (when (and (logtest? (-> arg1 waypoint-bits) 1) (>= (- (current-time) (-> arg1 waypoint-time0)) (seconds 0.25))) - (logand! (-> arg1 waypoint-bits) -2) + (when (and (logtest? (-> arg1 waypoint-bits) (waypoint-bits wabits-0)) + (>= (- (current-time) (-> arg1 waypoint-time0)) (seconds 0.25)) + ) + (logclear! (-> arg1 waypoint-bits) (waypoint-bits wabits-0)) (let ((a1-1 (new 'stack-no-clear 'event-message-block))) (set! (-> a1-1 from) (process->ppointer pp)) (set! (-> a1-1 num-params) 0) @@ -3586,7 +3588,7 @@ (send-event s4-0 'skip) (send-event s3-0 'skip) ) - (logior! (-> arg0 waypoint-bits) 1) + (logior! (-> arg0 waypoint-bits) (waypoint-bits wabits-0)) (none) ) :check-too-far 'hal2-default-check-too-far diff --git a/test/decompiler/reference/jak2/levels/tomb/tomb-obs_REF.gc b/test/decompiler/reference/jak2/levels/tomb/tomb-obs_REF.gc index a0ca0e057e..5b8cd2ad97 100644 --- a/test/decompiler/reference/jak2/levels/tomb/tomb-obs_REF.gc +++ b/test/decompiler/reference/jak2/levels/tomb/tomb-obs_REF.gc @@ -1615,13 +1615,13 @@ This commonly includes things such as: ;; definition of type tomb-plat-return (deftype tomb-plat-return (base-plat) - ((intro-path path-control :offset-assert 272) - (ride-timer time-frame :offset-assert 280) - (flags uint16 :offset-assert 288) - (path-pos float :offset-assert 292) - (dest-pos float :offset-assert 296) - (path-speed float :offset-assert 300) - (sound-id sound-id :offset-assert 304) + ((intro-path path-control :offset-assert 272) + (ride-timer time-frame :offset-assert 280) + (flags tomb-plat-flags :offset-assert 288) + (path-pos float :offset-assert 292) + (dest-pos float :offset-assert 296) + (path-speed float :offset-assert 300) + (sound-id sound-id :offset-assert 304) ) :heap-base #xc0 :method-count-assert 39 @@ -1728,8 +1728,8 @@ This commonly includes things such as: :event (behavior ((proc process) (arg1 int) (event-type symbol) (event event-message-block)) (case event-type (('ridden) - (let ((v0-0 (the-as object (logior (-> self flags) 1)))) - (set! (-> self flags) (the-as uint v0-0)) + (let ((v0-0 (the-as object (logior (-> self flags) (tomb-plat-flags topflags-0))))) + (set! (-> self flags) (the-as tomb-plat-flags v0-0)) v0-0 ) ) @@ -1744,9 +1744,9 @@ This commonly includes things such as: (none) ) :trans (behavior () - (logand! (-> self flags) -2) + (logclear! (-> self flags) (tomb-plat-flags topflags-0)) (plat-trans) - (if (not (logtest? (-> self flags) 1)) + (if (not (logtest? (-> self flags) (tomb-plat-flags topflags-0))) (set! (-> self ride-timer) (current-time)) ) (when (>= (- (current-time) (-> self ride-timer)) (seconds 0.5)) @@ -1768,8 +1768,8 @@ This commonly includes things such as: :event (behavior ((proc process) (arg1 int) (event-type symbol) (event event-message-block)) (case event-type (('ridden) - (let ((v0-0 (the-as object (logior (-> self flags) 1)))) - (set! (-> self flags) (the-as uint v0-0)) + (let ((v0-0 (the-as object (logior (-> self flags) (tomb-plat-flags topflags-0))))) + (set! (-> self flags) (the-as tomb-plat-flags v0-0)) v0-0 ) ) @@ -1898,7 +1898,7 @@ This commonly includes things such as: (the-as pair 0) ) (stop-bouncing! obj) - (set! (-> obj flags) (the-as uint 0)) + (set! (-> obj flags) (tomb-plat-flags)) (set! (-> obj path-pos) 0.0) (let ((s4-1 (new 'process 'curve-control obj 'path -1000000000.0))) (if (logtest? (-> s4-1 flags) (path-control-flag not-found)) diff --git a/test/decompiler/reference/jak2/levels/tomb/tomb-water_REF.gc b/test/decompiler/reference/jak2/levels/tomb/tomb-water_REF.gc index ac3cb731eb..b46c6d24b7 100644 --- a/test/decompiler/reference/jak2/levels/tomb/tomb-water_REF.gc +++ b/test/decompiler/reference/jak2/levels/tomb/tomb-water_REF.gc @@ -2003,7 +2003,7 @@ This commonly includes things such as: (pat-duration time-frame :offset-assert 248) (actor-group (pointer actor-group) :offset-assert 256) (actor-group-count int32 :offset-assert 260) - (flags uint16 :offset-assert 264) + (flags tomb-vibe-flags :offset-assert 264) (on-activate basic :offset-assert 268) ) :heap-base #x90 @@ -2120,7 +2120,7 @@ This commonly includes things such as: ((and (= (-> v1-0 0) (-> self pat-tbl (-> self pat-index))) (!= (-> gp-0 0) (process->handle self))) (send-event (handle->process (-> gp-0 0)) 'interrupt) (send-event (handle->process (-> gp-0 0)) 'die) - (logior! (-> self flags) 1) + (logior! (-> self flags) (tomb-vibe-flags tovflags-0)) (go-virtual vibrate) ) (else @@ -2165,17 +2165,17 @@ This commonly includes things such as: ) ) (when gp-0 - (when (and (not (logtest? (-> self flags) 2)) + (when (and (not (logtest? (-> self flags) (tomb-vibe-flags tovflags-1))) (< (vector-vector-distance (-> self root trans) (get-trans gp-0 0)) 102400.0) ) (set-setting! 'sound-mode #f 0.0 2) - (logior! (-> self flags) 2) + (logior! (-> self flags) (tomb-vibe-flags tovflags-1)) ) - (when (and (logtest? (-> self flags) 2) + (when (and (logtest? (-> self flags) (tomb-vibe-flags tovflags-1)) (< 184320.0 (vector-vector-distance (-> self root trans) (get-trans gp-0 0))) ) (remove-setting! 'sound-mode) - (logand! (-> self flags) -3) + (logclear! (-> self flags) (tomb-vibe-flags tovflags-1)) ) ) ) @@ -2274,7 +2274,7 @@ This commonly includes things such as: ) ) (process-release? *target*) - (if (logtest? (-> self flags) 1) + (if (logtest? (-> self flags) (tomb-vibe-flags tovflags-0)) (go-virtual die #f) (go-virtual idle) ) @@ -2464,7 +2464,7 @@ This commonly includes things such as: (joint-control-channel-group! a0-53 (the-as art-joint-anim (-> obj draw art-group data 3)) num-func-identity) ) (transform-post) - (set! (-> obj flags) (the-as uint 0)) + (set! (-> obj flags) (tomb-vibe-flags)) (set! (-> obj event-hook) (-> (method-of-type tomb-vibe idle) event)) (cond ((logtest? (-> obj entity extra perm status) (entity-perm-status subtask-complete)) diff --git a/test/decompiler/reference/jak2/levels/under/sig5-course_REF.gc b/test/decompiler/reference/jak2/levels/under/sig5-course_REF.gc index 75f3a7b59e..252b26f1a2 100644 --- a/test/decompiler/reference/jak2/levels/under/sig5-course_REF.gc +++ b/test/decompiler/reference/jak2/levels/under/sig5-course_REF.gc @@ -171,11 +171,11 @@ (with-pp (case arg2 (('set-task) - (let* ((s1-1 (logtest? (-> obj bot-task-bits) 16)) + (let* ((s1-1 (logtest? (-> obj bot-task-bits) (bot-task-bits botbits-4))) (t9-0 (method-of-type sig general-event-handler)) (s5-1 (t9-0 obj arg0 arg1 arg2 arg3)) ) - (when (and (not s1-1) (logtest? (-> obj bot-task-bits) 16)) + (when (and (not s1-1) (logtest? (-> obj bot-task-bits) (bot-task-bits botbits-4))) (let ((a1-2 (new 'stack-no-clear 'event-message-block))) (set! (-> a1-2 from) (process->ppointer pp)) (set! (-> a1-2 num-params) 0) @@ -223,7 +223,7 @@ ;; definition for method 262 of type sig-under ;; WARN: disable def twice: 39. This may happen when a cond (no else) is nested inside of another conditional, but it should be rare. (defmethod sig-under-method-262 sig-under ((obj sig-under) (arg0 symbol)) - (when (or (logtest? (-> obj bot-task-bits) 2) + (when (or (logtest? (-> obj bot-task-bits) (bot-task-bits botbits-1)) (and arg0 (let ((f0-0 81920.0)) (>= (* f0-0 f0-0) (vector-vector-xz-distance-squared (target-pos 0) (-> obj root trans))) ) @@ -244,7 +244,7 @@ ;; definition for method 264 of type sig-under (defmethod sig-under-method-264 sig-under ((obj sig-under)) - (and (logtest? (-> obj bot-task-bits) 8) + (and (logtest? (-> obj bot-task-bits) (bot-task-bits botbits-3)) (not (channel-active? obj (the-as uint 0))) (scene-play obj "under-get-sig-out-res" #f) ) @@ -431,7 +431,7 @@ (until #f (let ((gp-0 (get-rand-int self 2))) (let ((s5-0 (new 'stack-no-clear 'vector))) - (if (and (not (logtest? (-> self bot-task-bits) 1)) (zero? gp-0)) + (if (and (not (logtest? (-> self bot-task-bits) (bot-task-bits botbits-0))) (zero? gp-0)) (set! (-> s5-0 quad) (-> self sig5-course spots 2 center quad)) (set! (-> s5-0 quad) (-> self sig5-course spots 1 center quad)) ) @@ -533,7 +533,7 @@ ;; WARN: Return type mismatch int vs symbol. (defun sig5-default-check-too-far ((arg0 sig-under)) (let ((v0-0 (bot-simple-check-too-far arg0))) - (if (logtest? (-> arg0 bot-task-bits) 4) + (if (logtest? (-> arg0 bot-task-bits) (bot-task-bits botbits-2)) (set! v0-0 2) ) (the-as symbol v0-0) @@ -590,7 +590,7 @@ (the-as (function sigt-wait-spot sig symbol) (lambda ((arg0 object) (arg1 sig-under)) - (if (not (and (logtest? (-> arg1 bot-task-bits) 1) + (if (not (and (logtest? (-> arg1 bot-task-bits) (bot-task-bits botbits-0)) *target* (not (logtest? (-> *target* focus-status) (focus-status dead in-air edge-grab))) ) @@ -656,7 +656,7 @@ :nav-mesh-index -1 :skip-to -1 :on-set (lambda ((arg0 sig-under)) - (logand! (-> arg0 bot-task-bits) -5) + (logclear! (-> arg0 bot-task-bits) (bot-task-bits botbits-2)) (logior! (-> arg0 bot-flags) (bot-flags bf06)) (logior! (-> arg0 enemy-flags) (enemy-flag enable-on-active checking-water)) (set! (-> arg0 notice-enemy-dist) 122880.0) @@ -1232,8 +1232,8 @@ (function sigt-wait-spot sig symbol) (lambda ((arg0 object) (arg1 sig-under)) (with-pp - (when (not (logtest? (-> arg1 waypoint-bits) 1)) - (logior! (-> arg1 waypoint-bits) 1) + (when (not (logtest? (-> arg1 waypoint-bits) (waypoint-bits wabits-0))) + (logior! (-> arg1 waypoint-bits) (waypoint-bits wabits-0)) (let ((a1-1 (new 'stack-no-clear 'event-message-block))) (set! (-> a1-1 from) (process->ppointer pp)) (set! (-> a1-1 num-params) 0) @@ -1283,8 +1283,8 @@ (the-as (function sigt-wait-spot sig symbol) (lambda ((arg0 object) (arg1 sig-under)) - (when (and (not (logtest? (-> arg1 waypoint-bits) 1)) (+ (current-time) (seconds -6))) - (logior! (-> arg1 waypoint-bits) 1) + (when (and (not (logtest? (-> arg1 waypoint-bits) (waypoint-bits wabits-0))) (+ (current-time) (seconds -6))) + (logior! (-> arg1 waypoint-bits) (waypoint-bits wabits-0)) (set-setting! 'music 'danger3 0.0 0) ) #f @@ -1386,17 +1386,17 @@ (play-speech arg1 12) ) (cond - ((not (logtest? (-> arg1 waypoint-bits) 1)) - (logior! (-> arg1 waypoint-bits) 1) + ((not (logtest? (-> arg1 waypoint-bits) (waypoint-bits wabits-0))) + (logior! (-> arg1 waypoint-bits) (waypoint-bits wabits-0)) (process-release? arg1) (sig-under-method-260 arg1) (move-to-point! (-> arg1 root) (the-as vector (-> arg1 sig5-course spots 20))) #f ) - ((not (logtest? (-> arg1 waypoint-bits) 2)) + ((not (logtest? (-> arg1 waypoint-bits) (waypoint-bits wabits-1))) (when (>= (- (current-time) (-> arg1 waypoint-time0)) (seconds 2)) (remove-setting! 'entity-name) - (logior! (-> arg1 waypoint-bits) 2) + (logior! (-> arg1 waypoint-bits) (waypoint-bits wabits-1)) (add-process *gui-control* arg1 (gui-channel art-load) (gui-action queue) "under-centipede-three" -99.0 0) ) #f @@ -1452,7 +1452,7 @@ (lambda ((arg0 object) (arg1 sig-under)) (local-vars (v1-14 symbol)) (with-pp - (when (logtest? (-> arg1 waypoint-bits) 1) + (when (logtest? (-> arg1 waypoint-bits) (waypoint-bits wabits-0)) (let ((a1-1 (new 'stack-no-clear 'event-message-block))) (set! (-> a1-1 from) (process->ppointer pp)) (set! (-> a1-1 num-params) 0) @@ -1537,7 +1537,7 @@ (clear-poi-and-focus! arg0) (set! (-> arg0 focus-mode) 0) (set! (-> arg0 root penetrated-by) (get-penetrate-info arg0)) - (logior! (-> arg0 waypoint-bits) 1) + (logior! (-> arg0 waypoint-bits) (waypoint-bits wabits-0)) (send-event arg0 'move-trans (-> arg0 sig5-course spots 21)) (send-event *target* 'continue (get-continue-by-name *game-info* "sig5-skip-to-cent2")) (react-to-focus arg0) @@ -1552,7 +1552,7 @@ :on-set (lambda ((arg0 sig-under)) (stop-speech arg0 (the-as uint 0) #f) (set-setting! 'music 'danger7 0.0 0) - (logand! (-> arg0 bot-task-bits) -9) + (logclear! (-> arg0 bot-task-bits) (bot-task-bits botbits-3)) (let ((v1-7 (get-task-by-type (-> arg0 ai-ctrl) sigt-wait-spot arg0))) (set! (-> v1-7 bytes 5) 1) (set! (-> v1-7 bytes 6) 23) @@ -1663,14 +1663,14 @@ (ai-task-control-method-10 (-> arg1 ai-ctrl) arg1) (return #t) ) - (if (not (logtest? (-> arg1 bot-task-bits) 16)) + (if (not (logtest? (-> arg1 bot-task-bits) (bot-task-bits botbits-4))) (set! (-> arg1 waypoint-time0) (current-time)) ) - (when (and (not (logtest? (-> arg1 waypoint-bits) 2)) + (when (and (not (logtest? (-> arg1 waypoint-bits) (waypoint-bits wabits-1))) (>= (- (current-time) (-> arg1 waypoint-time0)) (seconds 0.5)) (not (logtest? (-> arg1 focus-status) (focus-status in-air))) ) - (logior! (-> arg1 waypoint-bits) 2) + (logior! (-> arg1 waypoint-bits) (waypoint-bits wabits-1)) (logior! (-> arg1 enemy-flags) (enemy-flag enable-on-active checking-water)) ) (if (and (>= (- (current-time) (-> arg1 waypoint-time0)) (seconds 1)) @@ -1693,8 +1693,8 @@ ) (or (nonzero? (-> arg1 next-chase-play-time)) (>= (- (current-time) (-> arg1 waypoint-time0)) (seconds 6))) ) - (when (not (logtest? (-> arg1 waypoint-bits) 1)) - (logior! (-> arg1 waypoint-bits) 1) + (when (not (logtest? (-> arg1 waypoint-bits) (waypoint-bits wabits-0))) + (logior! (-> arg1 waypoint-bits) (waypoint-bits wabits-0)) (send-event (ppointer->process (-> arg1 my-simple-focus)) 'move-trans (-> arg1 sig5-course spots 32)) (set! (-> arg1 poi-handle) (ppointer->handle (-> arg1 my-simple-focus))) ) @@ -1761,11 +1761,11 @@ (the-as (function sigt-wait-spot sig symbol) (lambda ((arg0 object) (arg1 sig-under)) - (when (and (not (logtest? (-> arg1 waypoint-bits) 1)) + (when (and (not (logtest? (-> arg1 waypoint-bits) (waypoint-bits wabits-0))) (>= (- (current-time) (-> arg1 waypoint-time0)) (seconds 0.5)) (not (logtest? (-> arg1 focus-status) (focus-status in-air))) ) - (logior! (-> arg1 waypoint-bits) 1) + (logior! (-> arg1 waypoint-bits) (waypoint-bits wabits-0)) (logior! (-> arg1 enemy-flags) (enemy-flag enable-on-active checking-water)) ) (cond diff --git a/test/decompiler/reference/jak2/levels/under/under-shoot-block_REF.gc b/test/decompiler/reference/jak2/levels/under/under-shoot-block_REF.gc index 902add6539..41c0c15f99 100644 --- a/test/decompiler/reference/jak2/levels/under/under-shoot-block_REF.gc +++ b/test/decompiler/reference/jak2/levels/under/under-shoot-block_REF.gc @@ -682,7 +682,7 @@ (pulse-op int8 :offset-assert 224) (pulse-pc int8 :offset-assert 225) (pulse-ctr int8 :offset-assert 226) - (flags uint64 :offset-assert 232) + (flags under-block-flags :offset-assert 232) (activated-time time-frame :offset-assert 240) (rot-axis vector :inline :offset-assert 256) (away-from-focal-pt vector :inline :offset-assert 272) @@ -796,18 +796,18 @@ (('track) (cond ((-> arg3 param 0) - (if (logtest? (-> self flags) 1) + (if (logtest? (-> self flags) (under-block-flags unbflags-0)) #t 'abort ) ) (else - (logtest? (-> self flags) 1) + (logtest? (-> self flags) (under-block-flags unbflags-0)) ) ) ) (('attack) - (when (logtest? (-> self flags) 1) + (when (logtest? (-> self flags) (under-block-flags unbflags-0)) (let ((gp-0 (the-as attack-info (-> arg3 param 1)))) (when (and (!= (-> gp-0 id) (-> self prev-attack-id)) (!= (-> gp-0 id) (-> self puzzle prev-special-attack-id))) (let ((s5-0 (get-penetrate-using-from-attack-event (the-as process-drawable arg0) arg3))) @@ -847,7 +847,7 @@ (set! (-> self move-dir-x) s5-1) (set! (-> self move-dir-z) gp-1) (under-block-method-48 self (+ (-> self col) s5-1) (+ (-> self row) gp-1)) - (logand! (-> self flags) -2) + (logclear! (-> self flags) (under-block-flags unbflags-0)) (if (zero? (-> self activated-time)) (under-block-method-42 self) ) @@ -856,7 +856,7 @@ ((under-block-method-49 self s5-1 gp-1) (set! (-> self move-dir-x) s5-1) (set! (-> self move-dir-z) gp-1) - (logand! (-> self flags) -2) + (logclear! (-> self flags) (under-block-flags unbflags-0)) (go-virtual rock) ) ((and (-> self next-state) (= (-> self next-state name) 'idle)) @@ -969,7 +969,7 @@ ;; WARN: Return type mismatch int vs none. (defmethod under-block-method-42 under-block ((obj under-block)) (set! (-> obj activated-time) (current-time)) - (logior! (-> obj flags) 2) + (logior! (-> obj flags) (under-block-flags unbflags-1)) (set! (-> obj pulse-pc) 0) (set! (-> obj pulse-op) 0) 0 @@ -981,7 +981,7 @@ ;; WARN: Function (method 45 under-block) has a return type of none, but the expression builder found a return statement. (defmethod under-block-method-45 under-block ((obj under-block)) (let ((v1-0 (-> obj puzzle))) - (when (logtest? (-> obj flags) 2) + (when (logtest? (-> obj flags) (under-block-flags unbflags-1)) (cond ((!= (-> v1-0 slot-mask) (-> v1-0 slot-mask-full)) (when (zero? (-> obj pulse-op)) @@ -1029,7 +1029,7 @@ ) ) (else - (logand! (-> obj flags) -3) + (logclear! (-> obj flags) (under-block-flags unbflags-1)) (set-vector! (-> obj draw color-mult) 1.0 1.0 1.0 1.0) (set-vector! (-> obj draw color-emissive) 0.0 0.0 0.0 1.0) ) @@ -1314,15 +1314,16 @@ ;; INFO: Used lq/sq (defmethod under-block-method-50 under-block ((obj under-block)) (with-pp - (let ((s5-0 (new 'stack 'joint-exploder-tuning (the-as uint (if (logtest? (-> obj flags) 4) - 1 - 0 - ) - ) - ) - ) + (let ((s5-0 + (new 'stack 'joint-exploder-tuning (the-as uint (if (logtest? (-> obj flags) (under-block-flags unbflags-2)) + 1 + 0 + ) + ) + ) + ) ) - (when (logtest? (-> obj flags) 4) + (when (logtest? (-> obj flags) (under-block-flags unbflags-2)) (set! (-> s5-0 fountain-rand-transv-lo quad) (-> obj away-from-focal-pt quad)) (set! (-> s5-0 fountain-rand-transv-hi x) 24576.0) (set! (-> s5-0 fountain-rand-transv-hi y) 49152.0) @@ -1359,7 +1360,7 @@ :virtual #t :event under-block-event-handler :enter (behavior () - (logand! (-> self flags) -2) + (logclear! (-> self flags) (under-block-flags unbflags-0)) (none) ) :code (the-as (function none :behavior under-block) sleep-code) @@ -1371,7 +1372,7 @@ :event under-block-event-handler :trans (the-as (function none :behavior under-block) rider-trans) :code (behavior () - (logand! (-> self flags) -2) + (logclear! (-> self flags) (under-block-flags unbflags-0)) (while (not (under-block-method-48 self (-> self col) (-> self row))) (suspend) ) @@ -1406,7 +1407,7 @@ :event under-block-event-handler :trans (the-as (function none :behavior under-block) rider-trans) :code (behavior () - (logand! (-> self flags) -2) + (logclear! (-> self flags) (under-block-flags unbflags-0)) (set! (-> self state-time) (current-time)) (let ((gp-0 (new 'stack-no-clear 'matrix))) (set! (-> gp-0 vector 0 quad) (-> self root trans quad)) @@ -1436,7 +1437,7 @@ :virtual #t :event under-block-event-handler :enter (behavior () - (logior! (-> self flags) 1) + (logior! (-> self flags) (under-block-flags unbflags-0)) (under-block-method-41 self 'active) (none) ) @@ -1448,12 +1449,12 @@ :virtual #t :event under-block-event-handler :enter (behavior () - (logior! (-> self flags) 1) + (logior! (-> self flags) (under-block-flags unbflags-0)) (under-block-method-41 self 'active) (none) ) :exit (behavior () - (logand! (-> self flags) -2) + (logclear! (-> self flags) (under-block-flags unbflags-0)) (none) ) :trans (behavior () @@ -1660,7 +1661,7 @@ :virtual #t :event under-block-event-handler :enter (behavior () - (logand! (-> self flags) -2) + (logclear! (-> self flags) (under-block-flags unbflags-0)) (none) ) :trans (behavior () @@ -1738,7 +1739,7 @@ :virtual #t :event under-block-event-handler :enter (behavior () - (logand! (-> self flags) -2) + (logclear! (-> self flags) (under-block-flags unbflags-0)) (under-block-method-41 self 'beaten) (none) ) @@ -1750,7 +1751,7 @@ :virtual #t :event under-block-event-handler :enter (behavior () - (logand! (-> self flags) -2) + (logclear! (-> self flags) (under-block-flags unbflags-0)) (logclear! (-> self mask) (process-mask actor-pause)) (under-block-method-41 self 'fall) (none) @@ -1790,7 +1791,7 @@ (when (and (logtest? (-> (the-as collide-shape-moving gp-0) status) (collide-status touch-surface)) (>= (- (current-time) (-> self state-time)) (seconds 0.01)) ) - (logior! (-> self flags) 4) + (logior! (-> self flags) (under-block-flags unbflags-2)) (go-virtual explode) ) ) @@ -1804,7 +1805,7 @@ :virtual #t :event under-block-event-handler :enter (behavior () - (logand! (-> self flags) -2) + (logclear! (-> self flags) (under-block-flags unbflags-0)) (under-block-method-46 self (-> self col) (-> self row)) (let ((v1-4 (-> self puzzle))) (countdown (a0-3 (-> v1-4 slots length))